@stigg/react-sdk 4.2.0 → 4.2.1

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,2 +1,2 @@
1
- "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t,n=require("@stigg/js-client-sdk"),r=e(n),i=require("react"),a=e(i),l=e(require("@emotion/styled/base")),o=require("styled-typography"),c=require("@emotion/react"),s=e(require("color")),u=e(require("lodash/merge")),d=e(require("react-spinners/ClipLoader")),g=e(require("moment")),p=e(require("lodash/isNil")),m=require("lodash"),f=e(require("classnames")),h=require("@mui/material"),v=e(require("currency-symbol-map")),y=e(require("react-switch")),b=require("react-loading-skeleton"),w=e(b),x=e(require("lodash/sortBy")),E=require("@mui/material/styles"),P=require("styled-components"),C=e(P),S=e(require("@mui/material/Button")),U=e(require("lodash/flatMap")),k=e(require("@mui/material/Box")),T=e(require("@mui/material/Tab")),M=e(require("lodash/isEmpty")),B=e(require("@mui/material/Tabs")),N=require("react-feather"),L=e(require("@mui/material/LinearProgress")),A=e(require("lodash/isUndefined")),F=e(require("lodash/lowerCase"));function O(e,t,n,r,i,a,l){try{var o=e[a](l),c=o.value}catch(e){return void n(e)}o.done?t(c):Promise.resolve(c).then(r,i)}function I(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var a=e.apply(t,n);function l(e){O(a,r,i,l,o,"next",e)}function o(e){O(a,r,i,l,o,"throw",e)}l(void 0)}))}}function j(){return(j=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function D(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)t.indexOf(n=a[r])>=0||(i[n]=e[n]);return i}function R(e,t){return t||(t=e.slice(0)),e.raw=t,e}function _(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function H(){return(H=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var W=function(e){return i.createElement("svg",H({width:15,height:11,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),t||(t=i.createElement("path",{d:"M5.59 7.99 2.125 4.525A1 1 0 1 0 .71 5.94l4.88 4.88 8.705-8.705a.997.997 0 0 0-1.41-1.41L5.59 7.99Z",fill:"#B2BBD3"})))},q=["children","span","style","fontWeight","variant","color","overrideColor","bold"];function Z(e,t){switch(t){case"white":return"white";case"primary.main":return e.stigg.palette.primary;case"warning":return e.stigg.palette.warning;case"error":return e.stigg.palette.error;default:return e.stigg.palette.text[t]}}var $=l(o.Text,{target:"ewjez2x0"})("margin:0;",(function(e){return e.$span&&"display: inline"}),";");function G(e){switch(e){case"bold":return o.FontWeight.Bold;case"normal":default:return o.FontWeight.Normal}}function z(e,t){var n=e.stigg.typography;switch(t){case"h1":return G(n.h1.fontWeight);case"h3":return G(n.h2.fontWeight);case"h6":return G(n.h3.fontWeight);case"body1":return G(n.body.fontWeight);case"caption":return G(n.caption.fontWeight);default:return o.FontWeight.Normal}}var V=i.forwardRef((function(e,t){var n=e.children,r=e.span,i=e.style,l=e.fontWeight,s=e.variant,u=void 0===s?"body1":s,d=e.color,g=void 0===d?"primary":d,p=e.overrideColor,m=e.bold,f=D(e,q),h=c.useTheme(),v=function(e){switch(e){case"h1":return 1;case"h3":return 2;case"h6":return 3;case"body1":return 4;case"caption":return 5;default:return 3}}(u),y="typography-level-"+v;return a.createElement($,Object.assign({ref:t},f,{className:e.className?e.className+" "+y:y,style:i,level:v,color:p||Z(h,g),fontWeight:null!=l?l:m?o.FontWeight.Bold:z(h,u),$span:r}),n)})),Y=["displayNameOverride"],Q=l(V,{target:"e1mddeqb2"})({name:"ti75j2",styles:"margin:0"}),K=l("div",{target:"e1mddeqb1"})({name:"s5xdrg",styles:"display:flex;align-items:center"}),X=l(W,{target:"e1mddeqb0"})("margin-right:16px;flex-shrink:0;*{fill:",(function(e){return e.theme.stigg.palette.text.disabled}),";}");function J(e){var t=e.displayNameOverride,r=function(e){var t=e.hasUnlimitedUsage,r=e.feature,i=e.resetPeriod,a=e.usageLimit,l=e.minUnitQuantity,o=e.maxUnitQuantity,c=e.isCustom,s=l||o,u=i&&a?""+function(e){if(!e)return"";switch(e){case n.EntitlementResetPeriod.Day:return"per day";case n.EntitlementResetPeriod.Hour:return"per hour";case n.EntitlementResetPeriod.Week:return"per week";case n.EntitlementResetPeriod.Month:return"per month"}}(i):"";if(t)return"Unlimited "+(null==r?void 0:r.unitsPlural);if(c)return"Custom "+(null==r?void 0:r.unitsPlural);if(a){var d=1===a?null==r?void 0:r.units:null==r?void 0:r.unitsPlural;return function(e){return e.toLocaleString("en-US",{maximumFractionDigits:0})}(a)+" "+d+" "+u}return s?function(e,t,n){return e&&1!==e||!t?e&&e>1&&t?e+"-"+t+" "+n:e&&e>1?"Minimum "+e+" "+n:"":"Up to "+t+" "+n}(l,o,null==r?void 0:r.unitsPlural):null==r?void 0:r.displayName}(D(e,Y));return a.createElement(K,{className:"stigg-entitlement-row-container"},a.createElement(X,{className:"stigg-entitlement-row-icon"}),a.createElement(Q,{className:"stigg-entitlement-name",variant:"h6",color:"secondary"},t||r))}var ee,te=l("div",{target:"e1yz7zcg0"})({name:"budh8k",styles:"display:flex;flex-direction:column;gap:16px"});function ne(e){var t,r=e.plan,i=e.billingPeriod,l=e.paywallLocale,o=null==(t=r.pricePoints)?void 0:t.filter((function(e){return e.billingPeriod===i})),c=null==o?void 0:o.map((function(e){var t;return(null==e?void 0:e.minUnitQuantity)&&(null==e?void 0:e.minUnitQuantity)>1||(null==e?void 0:e.maxUnitQuantity)?a.createElement(J,{key:"priceUnitEntitlement-"+(null==e||null==(t=e.feature)?void 0:t.displayName),feature:null==e?void 0:e.feature,minUnitQuantity:null==e?void 0:e.minUnitQuantity,maxUnitQuantity:null==e?void 0:e.maxUnitQuantity}):null}));return a.createElement(te,{className:"stigg-plan-entitlements-container"},a.createElement(V,{className:"stigg-plan-entitlements-title",color:"secondary",variant:"h6",bold:!0},function(e,t){if(t.entitlementsTitle)return t.entitlementsTitle(e);var n=e.displayName+" includes";return e.basePlan&&(n="Everything in "+e.basePlan.displayName+", plus:"),n}(r,l)),c,r.entitlements.filter((function(e){return!(e.hiddenFromWidgets||[]).includes(n.WidgetType.Paywall)})).map((function(e){var t;return a.createElement(J,{key:null==(t=e.feature)?void 0:t.id,displayNameOverride:e.displayNameOverride,feature:e.feature,resetPeriod:e.resetPeriod,hasUnlimitedUsage:e.hasUnlimitedUsage,usageLimit:e.usageLimit,isCustom:e.isCustom})})))}(ee=exports.SubscribeIntentionType||(exports.SubscribeIntentionType={})).START_TRIAL="START_TRIAL",ee.UPGRADE_TRIAL_TO_PAID="UPGRADE_TRIAL_TO_PAID",ee.REQUEST_CUSTOM_PLAN_ACCESS="REQUEST_CUSTOM_PLAN_ACCESS",ee.CHANGE_BILLING_PERIOD="CHANGE_BILLING_PERIOD",ee.UPGRADE_PLAN="UPGRADE_PLAN",ee.DOWNGRADE_PLAN="DOWNGRADE_PLAN",ee.CANCEL_SCHEDULED_UPDATES="CANCEL_SCHEDULED_UPDATES";var re,ie,ae=function(e){return{left:"flex-start",center:"center",right:"flex-end"}[e]},le=function(e){return g.utc(e).format("MMMM Do, yyyy")};function oe(e){var t=e.scheduledUpdate,r=e.subscriptionPrices,i=e.billingPeriodRange,l=e.options,o=void 0===l?{}:l;if(!t)return{};var c=o.withDate,s=o.postfix,u=void 0===s?"":s;switch(t.subscriptionScheduleType){case n.SubscriptionScheduleType.Downgrade:var d,f=c;return p(f)&&null!=i&&i.end&&(f=!g(t.scheduledExecutionTime).isSame(null==i?void 0:i.end,"day")),{line1:a.createElement(a.Fragment,null,"Your subscription will be downgraded to the ",a.createElement("b",null,null==(d=t.targetPackage)?void 0:d.displayName," plan")," ",f?a.createElement(a.Fragment,null,"on ",le(t.scheduledExecutionTime)):u,"."),line2:"Until then you still have access to your current plan."};case n.SubscriptionScheduleType.BillingPeriod:var h;return{line1:a.createElement(a.Fragment,null,"Your billing cycle will change to ",a.createElement("b",null,null==(h=t.scheduleVariables.billingPeriod)?void 0:h.toLocaleLowerCase())," ",c?a.createElement(a.Fragment,null,"on ",le(t.scheduledExecutionTime)):u,".")};case n.SubscriptionScheduleType.UnitAmount:var v=t.scheduleVariables,y=m.compact(m.map(r,"feature")).find((function(e){return e.id===v.featureId}))||{},b=y.featureUnits,w=1===v.newUnitAmount?b:y.featureUnitsPlural;return{line1:a.createElement(a.Fragment,null,"Your subscription will be updated to ",a.createElement("b",null,v.newUnitAmount)," ",w," ",c?a.createElement(a.Fragment,null,"on ",le(t.scheduledExecutionTime)):u,"."),line2:"Until then you still have access to your current "+b+" count."};default:return{}}}function ce(e,t,r,i){switch(e.tiersMode){case n.TiersMode.Volume:return(r===n.BillingPeriod.Annually&&i?t.unitPrice.amount/12:t.unitPrice.amount)*t.upTo}return 0}function se(e,t,r,i){var a=e.pricePoints.filter((function(e){return e.billingPeriod===t&&e.isTieredPrice}));if(1==a.length){var l,o=a[0],c=o.feature.featureId,s=o.tiers[0];if(i[c])s=(null==(l=o.tiers)?void 0:l.find((function(e){return e.upTo===i[c].upTo})))||s;else if(r){var u=r.prices.find((function(e){var r;return e.pricingModel==n.BillingModel.PerUnit&&e.billingPeriod==t&&e.tiersMode&&(null==(r=e.feature)?void 0:r.featureId)===c}));u&&(s=u.tiers.find((function(e){return e.upTo===u.feature.unitQuantity}))||u.tiers[0])}var d={};return d[c]=s,d}return{}}!function(e){e[e.Lower=-1]="Lower",e[e.Equal=0]="Equal",e[e.Higher=1]="Higher"}(re||(re={}));var ue,de=l(d,{target:"e199qof96"})({name:"1a2afmv",styles:"margin-left:10px"}),ge=l("button",{target:"e199qof95"})("cursor:",(function(e){return e.$disabled?"default":"pointer"}),";padding:8px 12px;background-color:",(function(e){return e.theme.stigg.palette.backgroundButton}),";border:",(function(e){return"1px solid "+e.theme.stigg.palette.outlinedRestingBorder}),";border-radius:10px;display:flex;align-items:center;justify-content:center;min-height:42px;min-width:120px;",(function(e){return e.$disabled&&c.css(ie||(ie=R(["\n opacity: 0.5;\n "])))})," &:hover{background-color:",(function(e){var t=e.theme;return e.$disabled?t.stigg.palette.backgroundButton:t.stigg.palette.outlinedHoverBackground}),";}"),pe=l(V,{target:"e199qof94"})({name:"h05omw",styles:"margin:0;font-size:15px"}),me=l(V,{target:"e199qof93"})({name:"1cnls12",styles:"min-height:87px"}),fe=l("button",{target:"e199qof92"})("background:none;border:none;padding:0;color:",(function(e){return e.theme.stigg.palette.text.secondary}),";text-decoration:underline;cursor:pointer;"),he=l(V,{target:"e199qof91"})({name:"1etgg0o",styles:"margin-top:8px;margin-bottom:17px;min-height:20px"}),ve=l("div",{target:"e199qof90"})("display:flex;flex-direction:column;margin-top:4px;align-self:",(function(e){return ae(e.theme.stigg.layout.ctaAlignment)}),";width:100%;");function ye(e){var t=e.isNextPlan,r=e.customer,l=e.plan,o=e.billingPeriod,s=e.isCustomerOnTrial,u=e.onPlanSelected,d=e.paywallLocale,g=e.hasTiersRow,p=e.withTrialLeftRow,f=e.currentSubscription,h=e.selectedTierByFeature,v=c.useTheme(),y=i.useState(!1),b=y[0],w=y[1],x=d.planCTAButton,E=x.currentPlan,P=x.custom,C=x.downgrade,S=x.startTrial,U=x.upgrade,k=x.startNew,T=x.switchToBillingPeriod,M=x.cancelScheduledUpdate,B=m.isFunction(C)?C(l):C,N=m.isFunction(U)?U(l):U,L={title:r?l.isLowerThanCurrentPlan?B:N:k,disabled:!1,intentionType:l.isLowerThanCurrentPlan?exports.SubscribeIntentionType.DOWNGRADE_PLAN:s?exports.SubscribeIntentionType.UPGRADE_TRIAL_TO_PAID:exports.SubscribeIntentionType.UPGRADE_PLAN},A=l.pricingType===n.PricingType.Custom,F=oe({scheduledUpdate:l.scheduledUpdate,options:{withDate:!0}}).line1;if(!l.isTriable||l.isCurrentCustomerPlan||s)if(l.isCurrentCustomerPlan&&!s)if(o===l.currentCustomerPlanBillingPeriod||l.pricingType&&[n.PricingType.Free,n.PricingType.Custom].includes(l.pricingType))switch(function(e,t){if(!t||!e)return re.Equal;var r=t.prices.find((function(e){return e.pricingModel==n.BillingModel.PerUnit&&e.tiersMode}));if(!r)return re.Equal;var i=r.feature,a=i.unitQuantity;if(!a)return re.Equal;var l=e[i.featureId];return l?l.upTo<a?re.Lower:l.upTo>a?re.Higher:re.Equal:re.Equal}(h,f)){case re.Lower:L.title=B;break;case re.Higher:L.title=N;break;default:L.title=E,L.disabled=!0}else L.title=T(o),L.intentionType=exports.SubscribeIntentionType.CHANGE_BILLING_PERIOD;else A&&(L.title=P,L.intentionType=exports.SubscribeIntentionType.REQUEST_CUSTOM_PLAN_ACCESS);else L.title=S(l),L.intentionType=exports.SubscribeIntentionType.START_TRIAL;t&&l.scheduledUpdate&&(L.disabled=!1,L.title=M,L.intentionType=exports.SubscribeIntentionType.CANCEL_SCHEDULED_UPDATES);var O=b||L.disabled;return a.createElement(a.Fragment,null,a.createElement(ve,{className:"stigg-paywall-plan-button-layout"},t&&F?a.createElement(me,{color:"secondary",variant:"body1",className:"stigg-paywall-schedule-update-text"},F," ",a.createElement(fe,{color:"secondary",onClick:function(){w(!0),Promise.resolve(u(L.intentionType)).finally((function(){return w(!1)}))}},L.title)):a.createElement(a.Fragment,null,a.createElement(ge,{className:"stigg-paywall-plan-button","data-testid":"paywall-card-cta-"+l.displayName,disabled:O,$disabled:O,onClick:function(){w(!0),Promise.resolve(u(L.intentionType)).finally((function(){return w(!1)}))}},a.createElement(pe,{className:"stigg-paywall-plan-button-text",variant:"h6",color:"primary.main"},L.title),b&&a.createElement(de,{color:v.stigg.palette.text.disabled,loading:!0,size:16})),g&&!p?a.createElement("div",{style:{height:"20px"}}):a.createElement(he,{className:"stigg-trial-days-left-text",variant:"h6",color:"secondary"},l.isCurrentCustomerPlan&&l.trialDaysLeft&&a.createElement(a.Fragment,null,a.createElement("b",null,l.trialDaysLeft," days")," left on your free trial")))))}function be(){return(be=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var we=function(e){return i.createElement("svg",be({width:16,height:16,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ue||(ue=i.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.954 1.034A1 1 0 0 1 6.3 2.287a5.666 5.666 0 1 0 7.367 5.406 1 1 0 0 1 2 0c0 .23-.01.458-.03.684.01.072.012.147.006.223l-.004.049a1 1 0 0 1-.078.312A7.668 7.668 0 1 1 5.7.38a1 1 0 0 1 1.254.654Zm.614.239A1 1 0 0 1 8.648.36l.05.004a1 1 0 1 1-.182 1.992l-.037-.003a1 1 0 0 1-.911-1.081Zm4.85 1.636a1 1 0 0 1 1.41.11l.064.076a1 1 0 1 1-1.537 1.28 4.154 4.154 0 0 0-.047-.056 1 1 0 0 1 .11-1.41ZM9 5.334a1 1 0 0 0-2 0V8a1 1 0 0 0 1 1h2.667a1 1 0 1 0 0-2H9V5.334Z",fill:"#7586B0"})))},xe=function(e){var t=e.amount,r=e.currency,i=e.locale,a=e.maximumFractionDigits,l=void 0===a?5:a,o=(void 0===r?n.Currency.Usd:r).toString(),c=v(o),s=new Intl.NumberFormat(i,j({maximumFractionDigits:l,minimumFractionDigits:0,style:"currency",currency:o},c?{currencyDisplay:"code"}:{})).format(t||0);return c&&(s=s.replace(o,c)),s.replace(/\s/g,"")};function Ee(e,t,r,i,a,l){switch(e.pricingType){case n.PricingType.Free:return"function"==typeof r.price.free?r.price.free(e.paywallCurrency):r.price.free;case n.PricingType.Custom:return{price:r.price.custom};case n.PricingType.Paid:var o,c=e.pricePoints.filter((function(e){return e.billingPeriod===t})),s=null==(o=e.paywallCalculatedPricePoints)?void 0:o.find((function(e){return e.billingPeriod===t}));if(!(null!=c&&c.length||s))return{price:r.price.priceNotSet};var u={planPrices:c,paywallCalculatedPrice:s,selectedBillingPeriod:t,selectedTierByFeature:l||{}};return r.price.paid?r.price.paid(j({},u,{plan:e})):function(e){for(var t,r,i,a=e.planPrices,l=e.selectedBillingPeriod,o=e.locale,c=e.shouldShowMonthlyPriceAmount,s=e.selectedTierByFeature,u=e.paywallCalculatedPrice||a[0],d=u.currency,g=u.amount||0,p=1===a.length,m=l===n.BillingPeriod.Annually&&c?g/12:g,f=c?"/ month":"/ year",h=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return _(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_(e,void 0):void 0}}(e))){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(a);!(i=h()).done;){var v=i.value;if(v.isTieredPrice){var y=v.tiers[0];s[v.feature.featureId]&&(y=s[v.feature.featureId]||y,t=v.tiers,r=v.feature.unitsPlural||""),m+=ce(v,y,l,c)}}if(p){var b,w=a[0],x=(null==(b=w.feature)?void 0:b.units)||"";w.pricingModel!==n.BillingModel.PerUnit||w.isTieredPrice?w.pricingModel===n.BillingModel.UsageBased&&(f="per "+x):f=c?"per "+x+" / month":"per "+x+" / year"}return{price:xe({amount:m,currency:d,locale:o}),unit:f,tiers:t,tierUnits:r}}(j({},u,{locale:i,shouldShowMonthlyPriceAmount:a}));default:return{price:""}}}var Pe=l(h.Select,{target:"exuepap1"})("border-radius:10px;&:hover .MuiOutlinedInput-notchedOutline{border-color:",(function(e){return e.theme.stigg.palette.outlinedBorder}),";}"),Ce=l(h.OutlinedInput,{target:"exuepap0"})("& .MuiInputBase-input{padding:7px 12px;}&.Mui-focused .MuiOutlinedInput-notchedOutline{border-color:",(function(e){return e.theme.stigg.palette.primary}),"!important;}");function Se(e){var t=e.tiers,n=e.tierUnits,r=e.selectedTier,i=e.handleTierChange;return a.createElement(V,{className:"stigg-price-tier-select",style:{minHeight:"46px"}},t?a.createElement(Pe,{labelId:"demo-simple-select-label",id:"select_"+e.plan.id,value:r?r.upTo.toString():t[0].upTo.toString(),fullWidth:!0,onChange:function(e,n){i(t.find((function(t){return t.upTo.toString()===e.target.value})))},input:a.createElement(Ce,null),MenuProps:{MenuListProps:{disablePadding:!0},PaperProps:{sx:{marginTop:"4px",borderRadius:"10px"}}}},m.map(t,(function(e){return a.createElement(h.MenuItem,{className:"stigg-price-tier-menu-item-text",key:e.upTo,value:e.upTo.toString()},a.createElement(V,{variant:"body1",color:"primary"},e.upTo," ",n))}))):a.createElement("div",null))}var Ue=l(V,{target:"e1gsqbi12"})({name:"bfvx8c",styles:"word-break:break-word;width:100%"}),ke=l(V,{target:"e1gsqbi11"})({name:"1bmnxg7",styles:"white-space:nowrap"}),Te=l(V,{target:"e1gsqbi10"})({name:"nurf5y",styles:"white-space:normal;min-height:39px"});function Me(e){var t=e.billingPeriod,n=e.hasMonthlyPrice,r=e.hasAnnuallyPrice,i="‎";return e.plan.pricePoints.find((function(e){return e.billingPeriod===t}))&&n&&r&&(i=", billed "+t.toLowerCase()),a.createElement(V,{span:!0,className:"stigg-price-billing-period-text",variant:"h6",color:"secondary"},i)}var Be=function(e){var t=e.showStartingAt,n=e.withUnitPriceRow,r=e.withStartingAtRow,l=e.withTiersRow,o=e.selectedTierByFeature,c=e.setSelectedTierByFeature,s=e.plan,u=e.billingPeriod,d=e.paywallLocale,g=e.hasMonthlyPrice,p=e.hasAnnuallyPrice,m=Ee(s,u,d,e.locale,g,o),f=m.price,h=m.unit,v=m.tiers,y=m.tierUnits,b=i.useState(),w=b[0],x=b[1];i.useEffect((function(){x(o[P])}),[o]);var E=s.pricePoints.find((function(e){return e.billingPeriod===u&&e.isTieredPrice})),P=E?E.feature.featureId:void 0,C=function(e){var t={};t[P]=e,c(t)};return i.useEffect((function(){v&&C(o[P])}),[]),a.createElement(Ue,{className:"stigg-price-text"},a.createElement(a.Fragment,null,r&&a.createElement(V,{style:{minHeight:"20px"},className:"stigg-starting-at-text",variant:"body1",color:"secondary"},t?d.price.startingAtCaption:"‎"),a.createElement(Te,{variant:"h1"},f),n&&a.createElement(V,{className:"stigg-price-unit-and-billing-period-text",style:{minHeight:"48px"}},a.createElement(ke,{span:!0,variant:"h6",color:"secondary"},h),a.createElement(Me,{plan:s,billingPeriod:u,hasAnnuallyPrice:p,hasMonthlyPrice:g})),l&&a.createElement(Se,{plan:s,tiers:v,tierUnits:y,selectedTier:w,handleTierChange:C})))},Ne=l("div",{target:"eacdu8d8"})("position:relative;background-color:",(function(e){var t=e.theme;return e.$isCurrentPlan?t.stigg.palette.backgroundHighlight:t.stigg.palette.backgroundPaper}),";border:",(function(e){var t=e.theme;return e.$isHighlighted?"3px solid "+t.stigg.palette.primary:"1px solid "+t.stigg.palette.outlinedBorder}),";border-radius:10px;padding:",(function(e){return e.theme.stigg.layout.planPadding}),";display:flex;min-width:",(function(e){return e.theme.stigg.layout.planMinWidth}),";max-width:",(function(e){return e.theme.stigg.layout.planMaxWidth}),";flex-direction:column;align-items:flex-start;justify-content:flex-start;position:relative;"),Le=l(V,{target:"eacdu8d7"})({name:"mpkj0c",styles:"padding-bottom:8px"}),Ae=l("div",{target:"eacdu8d6"})("height:2px;width:100%;background-color:",(function(e){return e.theme.stigg.palette.outlinedBorder}),";margin-bottom:40px;"),Fe=l(V,{target:"eacdu8d5"})("text-align:",(function(e){return e.theme.stigg.layout.descriptionAlignment}),";min-height:",(function(e){return e.theme.stigg.layout.descriptionMinHeight}),";"),Oe=l("div",{target:"eacdu8d4"})("background-color:",(function(e){return e.theme.stigg.palette.primary}),";border-radius:40px;position:absolute;top:-12px;"),Ie=l(V,{target:"eacdu8d3"})({name:"a8c38r",styles:"margin:0;padding:2px 8px"}),je=l("div",{target:"eacdu8d2"})("width:100%;display:flex;flex-direction:column;align-items:",(function(e){return ae(e.theme.stigg.layout.headerAlignment)}),";"),De=l("div",{target:"eacdu8d1"})("position:absolute;top:0;background-color:",(function(e){return e.theme.stigg.palette.outlinedBorder}),";border-radius:0px 0px 10px 10px;padding:3px 12px;"),Re=l(we,{target:"eacdu8d0"})("display:flex;height:100%;margin-right:4px;path{fill:",(function(e){return e.theme.stigg.palette.text.primary}),";}");function _e(e){var t=e.text,n=void 0===t?"Next":t;return a.createElement(De,null,a.createElement(h.Grid,{display:"flex",alignItems:"center",gap:1},a.createElement(Re,{$iconsColor:e.iconsColor}),a.createElement(V,{color:"primary",variant:"body1"},n)))}function He(e){var t,n=e.withUnitPriceRow,r=e.withTiersRow,l=e.withTrialLeftRow,o=e.customer,c=e.plan,s=e.billingPeriod,u=e.isHighlighted,d=e.currentSubscription,g=e.shouldShowDescriptionSection,p=e.hasMonthlyPrice,m=e.hasAnnuallyPrice,h=e.isCustomerOnTrial,v=e.onPlanSelected,y=e.paywallLocale,b=e.locale,w=e.withStartingAtRow,x=c.isNextPlan&&c.isNextPlan(s),E=c.pricePoints.filter((function(e){return e.billingPeriod===s})),P=null==(t=c.paywallCalculatedPricePoints)?void 0:t.find((function(e){return e.billingPeriod===s})),C=E.length>1&&!(null==P||!P.additionalChargesMayApply),S=null;x?S=a.createElement(_e,{text:"Next plan"}):u&&y.highlightChip&&(S=a.createElement(Oe,{className:"stigg-highlight-badge"},a.createElement(Ie,{className:"stigg-highlight-badge-text",color:"white",bold:!0},y.highlightChip)));var U=a.useState(se(c,s,d,{})),k=U[0],T=U[1];return i.useEffect((function(){T(se(c,s,d,k))}),[s]),a.createElement(Ne,{className:f("stigg-plan-offering-container",{"stigg-current-plan":c.isCurrentCustomerPlan}),$isHighlighted:u,$isCurrentPlan:c.isCurrentCustomerPlan},S,a.createElement(je,{className:"stigg-header-wrapper"},a.createElement(Le,{className:"stigg-plan-header",variant:"h3"},c.displayName),g&&a.createElement(Fe,{className:"stigg-plan-description",variant:"h6",color:"secondary"},c.description),a.createElement(Be,{showStartingAt:C,withUnitPriceRow:n,withStartingAtRow:w,withTiersRow:r,selectedTierByFeature:k,setSelectedTierByFeature:T,plan:c,billingPeriod:s,paywallLocale:y,locale:b,hasAnnuallyPrice:m,hasMonthlyPrice:p}),a.createElement(ye,{isNextPlan:x,customer:o,plan:c,currentSubscription:d,billingPeriod:s,isCustomerOnTrial:h,onPlanSelected:function(e){var t=Object.keys(k).map((function(e){return{featureId:e,quantity:k[e].upTo}}));return v(e,t)},paywallLocale:y,hasTiersRow:r,withTrialLeftRow:l,selectedTierByFeature:k}),a.createElement(Ae,{className:"stigg-plan-header-divider"})),a.createElement(ne,{plan:c,billingPeriod:s,paywallLocale:y}))}var We,qe=l("div",{target:"esqa6i42"})("height:40px;padding:0 20px;margin-bottom:",(function(e){return e.theme.stigg.layout.switchBottomSpacing}),";border-radius:10px;border:",(function(e){return"1px solid "+e.theme.stigg.palette.outlinedBorder}),";background-color:",(function(e){return e.theme.stigg.palette.backgroundPaper}),";display:flex;align-items:center;justify-content:center;"),Ze=l(V,{target:"esqa6i41"})({name:"zvmrfm",styles:"margin:0 8px"}),$e=l(y,{target:"esqa6i40"})("& .react-switch-bg{border:",(function(e){return"1px solid "+e.theme.stigg.palette.switchBorder}),";background:",(function(e){return e.theme.stigg.palette.switchFill}),"!important;}& .react-switch-handle{box-shadow:",(function(e){return e.theme.stigg.shadows.light}),";background:",(function(e){return e.theme.stigg.palette.switchHandle}),"!important;top:0.5px!important;}");function Ge(e){return a.createElement(V,{variant:"h6",color:e.disabled?"disabled":"primary",className:"stigg-discount-rate-text"},e.discount,"% off")}function ze(e){var t=e.discountRate,r=e.onBillingPeriodChanged;if(e.availableBillingPeriods.length<=1)return null;var i=e.selectedBillingPeriod===n.BillingPeriod.Monthly;return a.createElement(qe,{className:"stigg-period-picker-container"},a.createElement(Ze,{variant:"h6",className:"stigg-monthly-period-text",color:i?"primary":"disabled"},"Monthly"),a.createElement($e,{className:"stigg-period-switch",uncheckedIcon:!1,checkedIcon:!1,height:16,width:33,onChange:function(e){return r(e?n.BillingPeriod.Annually:n.BillingPeriod.Monthly)},checked:!i,borderRadius:10,handleDiameter:19}),a.createElement(Ze,{variant:"h6",className:"stigg-annual-period-text",color:i?"disabled":"primary"},"Annual"),a.createElement(Ge,{discount:t,disabled:i}))}function Ve(){return(Ve=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var Ye=l((function(e){return i.createElement("svg",Ve({width:135,height:16,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),We||(We=i.createElement("path",{d:"M.099 3.43v9.558h1.057V9.527h2.81c1.983 0 3.323-1.275 3.323-3.049 0-1.773-1.34-3.048-3.324-3.048H.1Zm1.057 5.127v-4.15h2.889c1.289 0 2.143.855 2.143 2.071 0 1.217-.854 2.079-2.143 2.079h-2.89ZM11.779 13.162c2.129 0 3.873-1.622 3.873-3.78 0-2.165-1.715-3.758-3.844-3.758-2.158 0-3.874 1.622-3.874 3.787 0 2.158 1.687 3.75 3.845 3.75Zm.014-.934c-1.556 0-2.773-1.202-2.773-2.832 0-1.629 1.216-2.83 2.773-2.83 1.528 0 2.773 1.201 2.773 2.83 0 1.63-1.245 2.832-2.773 2.832ZM19.905 12.988l1.572-6.046h.029l1.556 6.046h1.34l2.194-7.183h-1.18l-1.622 6.104h-.03l-1.549-6.104h-1.433l-1.55 6.104h-.029l-1.65-6.104h-1.195l2.208 7.183h1.34ZM34.983 9.425c0-2.121-1.578-3.8-3.83-3.8-2.1 0-3.845 1.556-3.845 3.786 0 2.143 1.6 3.75 3.874 3.75 1.586 0 2.875-.767 3.497-1.969l-.897-.485c-.413.898-1.412 1.528-2.585 1.528-1.673 0-2.694-1.246-2.795-2.513h6.567c.014-.13.014-.18.014-.297ZM31.14 6.551c1.404 0 2.527.948 2.715 2.259h-5.423a2.745 2.745 0 0 1 2.708-2.26ZM39.592 5.682c-1.028 0-1.774.521-2.1 1.253l-.101-1.13h-.905v7.183h1.057V8.564c0-1.115.615-1.789 1.774-1.789h.68V5.682h-.405ZM48.249 9.425c0-2.121-1.579-3.8-3.83-3.8-2.1 0-3.845 1.556-3.845 3.786 0 2.143 1.6 3.75 3.873 3.75 1.586 0 2.875-.767 3.497-1.969l-.897-.485c-.413.898-1.412 1.528-2.585 1.528-1.673 0-2.694-1.246-2.795-2.513h6.567c.015-.13.015-.18.015-.297Zm-3.845-2.874c1.404 0 2.527.948 2.715 2.259h-5.423a2.745 2.745 0 0 1 2.708-2.26ZM55.846 7.029c-.63-.89-1.644-1.398-2.831-1.398-2.093 0-3.773 1.586-3.773 3.765 0 2.18 1.651 3.766 3.744 3.766 1.195 0 2.23-.522 2.867-1.42l.145 1.246h.905V2.56l-1.057.116V7.03Zm-2.817 5.199c-1.498 0-2.7-1.188-2.7-2.832 0-1.643 1.202-2.83 2.7-2.83a2.787 2.787 0 0 1 2.817 2.83 2.787 2.787 0 0 1-2.817 2.832ZM65.731 5.631c-1.194 0-2.222.514-2.86 1.412V2.561l-1.057.116v10.31h.905l.145-1.237c.63.898 1.644 1.412 2.838 1.412 2.093 0 3.773-1.586 3.773-3.766 0-2.179-1.651-3.765-3.744-3.765Zm-.043 6.597a2.787 2.787 0 0 1-2.817-2.832 2.787 2.787 0 0 1 2.817-2.83c1.499 0 2.7 1.187 2.7 2.83 0 1.644-1.201 2.832-2.7 2.832ZM76.219 5.805v4.113c0 1.412-.905 2.266-2.172 2.266-1.26 0-1.97-.738-1.97-2.07V5.804H71.02v4.468c0 1.694 1.115 2.824 2.744 2.824 1.079 0 1.926-.42 2.455-1.116v.913c0 1.267-.956 2.186-2.346 2.186-1.123 0-2.05-.6-2.288-1.65l-.927.477C71.1 15.16 72.308 16 73.858 16c1.955 0 3.418-1.405 3.418-3.208V5.805h-1.057ZM108.672 10.487c0 1.42-1.261 2.3-3.181 2.3-1.027 0-1.857-.184-2.651-.578.074-.449.142-.99.16-1.618.738.43 1.575.64 2.381.64.959 0 1.458-.221 1.458-.689.018-.461-.339-.67-1.772-.947-1.661-.332-2.399-1.021-2.399-2.24 0-1.377 1.261-2.27 3.18-2.27.849 0 1.692.16 2.338.437l-.32 1.544a4.803 4.803 0 0 0-2.018-.43c-.898 0-1.341.221-1.341.658 0 .381.308.541 1.71.83 1.79.382 2.461 1.07 2.461 2.35l-.006.013Zm4.207.609c-.719 0-1.298-.382-1.298-1.39V6.887h1.827l.339-1.63h-2.166v-2.32a9.976 9.976 0 0 1-1.9.345l-.019 6.748c0 1.84 1.101 2.769 2.75 2.769.375 0 .701-.037.978-.105l.363-1.729c-.228.08-.517.136-.874.136v-.006Zm2.086 1.593h1.919V5.258h-1.919v7.43Zm.965-10.47c-.621-.006-1.101.45-1.107 1.052 0 .621.455 1.089 1.071 1.095.621 0 1.082-.437 1.095-1.04.012-.62-.443-1.095-1.052-1.107h-.007Zm10.126 3.039v6.268c0 2.369-1.6 3.999-4.3 3.999-.972 0-2.042-.216-2.762-.628.498-.51.837-.953 1.052-1.273.486.166.996.252 1.519.252 1.71 0 2.578-.947 2.578-2.14v-.24c-.609.7-1.489 1.138-2.541 1.138-2.018 0-3.537-1.501-3.537-3.728 0-2.227 1.661-3.808 3.691-3.808 1.052 0 1.968.381 2.577 1.101l.062-.947h1.667l-.006.006Zm-1.901 3.648c0-1.181-.861-2.08-2.048-2.08-1.188 0-2.061.899-2.061 2.08 0 1.18.861 2.048 2.061 2.048 1.199 0 2.048-.898 2.048-2.048Zm10.839-3.648v6.268c0 2.369-1.6 3.999-4.3 3.999-.972 0-2.042-.216-2.762-.628.498-.51.837-.953 1.052-1.273.486.166.996.252 1.519.252 1.71 0 2.578-.947 2.578-2.14v-.24c-.609.7-1.489 1.138-2.541 1.138-2.017 0-3.537-1.501-3.537-3.728 0-2.227 1.661-3.808 3.691-3.808 1.052 0 1.968.381 2.577 1.101l.062-.947H135l-.006.006Zm-1.901 3.648c0-1.181-.861-2.08-2.048-2.08-1.188 0-2.061.899-2.061 2.08 0 1.18.861 2.048 2.061 2.048 1.199 0 2.048-.898 2.048-2.048ZM95.71 14.982c-.075.037-1.483.659-3.975.542A14.827 14.827 0 0 1 88.512 15l4.312-5.007c.77.197 1.76.381 2.885.436 2.492.123 3.9-.504 3.974-.541l-3.974 5.1v-.007Zm-6.441-9.62c-.708-2.393-.431-3.907-.413-3.987l-4.01 5.07c-.013.08-.29 1.592.412 3.985a14.98 14.98 0 0 0 1.273 3.008l3.845-5.37a15.042 15.042 0 0 1-1.107-2.7v-.006Zm9.996.529a14.561 14.561 0 0 0-1.815-3.882l-3.568 4.546.67 3.217c.4.056.794.092 1.194.117.203.006.406.012.603.012 1.931 0 3.008-.455 3.125-.51l.277-.123c.024-.665-.019-1.84-.48-3.384l-.006.007Zm-2.24-4.208A14.43 14.43 0 0 0 92.83.834c-1.605-.08-2.756.154-3.395.338l-.056.296c-.012.061-.258 1.494.4 3.74.11.381.246.756.394 1.132l3.285-.111 3.574-4.54-.006-.006Z",fill:"#001E6C"})))}),{target:"ee5i8qp1"})("*{fill:",(function(e){return e.theme.stigg.palette.text.secondary}),";}"),Qe=l("div",{target:"ee5i8qp0"})("align-self:",(function(e){return e.$alignSelf||"unset"}),";@media (max-width: 1040px){align-self:center;}");function Ke(e){var t=e.source,n=e.style;return e.showWatermark?a.createElement(Qe,{$alignSelf:e.align,className:"stigg-watermark",style:j({cursor:"pointer"},void 0===n?{}:n),onClick:function(){var e=window.location.hostname.replace("www.","");window.open("https://www.stigg.io/?utm_source="+e+"&utm_medium=referral&utm_campaign="+t,"_blank")}},a.createElement(Ye,null)):null}function Xe(e,t){return e.some((function(e){return Je(e,t)}))}function Je(e,t){return e.pricePoints.some((function(e){return e.billingPeriod===t}))}var et,tt=l("div",{target:"e19kubi82"})("color:",(function(e){return e.theme.stigg.palette.text.primary}),";display:flex;align-items:stretch;justify-content:center;flex-wrap:wrap;padding:10px 0;gap:",(function(e){return e.theme.stigg.layout.planMargin}),";"),nt=l("div",{target:"e19kubi81"})({name:"1rdsyw8",styles:"display:flex;flex-direction:column;align-items:center;& *{box-sizing:border-box;}"}),rt=l("div",{target:"e19kubi80"})({name:"zigog8",styles:"display:flex;flex-direction:column;align-items:center"}),it=function(e){var t=e.plans,r=e.customer,l=e.currentSubscription,o=e.highlightedPlanId,c=e.selectedBillingPeriod,s=e.onBillingPeriodChanged,u=e.availableBillingPeriods,d=e.isCustomerOnTrial,g=e.onPlanSelected,m=e.paywallLocale,f=e.locale,h=ct().stigg,v=function(e){return e.reduce((function(e,t){var r,i,a,l,o,c,s,u,d;null!=(r=t.paywallCalculatedPricePoints)&&r.length?(i=null==(l=t.paywallCalculatedPricePoints)||null==(o=l.find((function(e){return e.billingPeriod===n.BillingPeriod.Monthly})))?void 0:o.amount,a=null==(c=t.paywallCalculatedPricePoints)||null==(s=c.find((function(e){return e.billingPeriod===n.BillingPeriod.Annually})))?void 0:s.amount):(i=null==(u=t.pricePoints.find((function(e){return e.billingPeriod===n.BillingPeriod.Monthly})))?void 0:u.amount,a=null==(d=t.pricePoints.find((function(e){return e.billingPeriod===n.BillingPeriod.Annually})))?void 0:d.amount);var g,m,f=(m=a,p(g=i)||p(m)?null:Math.round((g-m/12)/g*100));return f&&(e=Math.max(e,f)),e}),0)}(t),y=t.some((function(e){return!!e.description})),b=Xe(t,n.BillingPeriod.Monthly),w=Xe(t,n.BillingPeriod.Annually),x=function(e,t){return e.filter((function(e){return e.pricingType!==n.PricingType.Paid||Je(e,t)}))}(t,c),E=i.useCallback((function(e,t,n){return g({plan:e,customer:r,subscription:l,intentionType:t,selectedBillingPeriod:c,billableFeatures:n})}),[r,c]),P=x.some((function(e){var t,n=e.pricePoints.filter((function(e){return e.billingPeriod===c})),r=null==(t=e.paywallCalculatedPricePoints)?void 0:t.find((function(e){return e.billingPeriod===c}));return n.length>1&&!(null==r||!r.additionalChargesMayApply)})),C=x.some((function(e){return!!Ee(e,c,m,f,b).unit})),S=x.some((function(e){return!!se(e,c,l,{})})),U=x.some((function(e){return e.isCurrentCustomerPlan&&e.trialDaysLeft}));return a.createElement(nt,{className:"stigg-paywall-container"},a.createElement(rt,{className:"stigg-paywall-layout"},a.createElement(ze,{onBillingPeriodChanged:s,selectedBillingPeriod:c,availableBillingPeriods:u,discountRate:v}),a.createElement(tt,{className:"stigg-paywall-plans-layout"},x.map((function(e){return a.createElement(He,{withUnitPriceRow:C,withTiersRow:S,withTrialLeftRow:U,key:e.id,shouldShowDescriptionSection:y,hasMonthlyPrice:b,hasAnnuallyPrice:w,plan:e,withStartingAtRow:P,currentSubscription:l,billingPeriod:c,isHighlighted:e.id===o,isCustomerOnTrial:d,onPlanSelected:function(t,n){return E(e,t,n)},paywallLocale:m,locale:f,customer:r})}))),a.createElement(Ke,{source:"paywall",align:"end",style:{marginTop:16},showWatermark:h.isWidgetWatermarkEnabled})))},at=(function(e){var t=function(e){var t=Object.prototype,n=t.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",a=r.asyncIterator||"@@asyncIterator",l=r.toStringTag||"@@toStringTag";function o(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{o({},"")}catch(e){o=function(e,t,n){return e[t]=n}}function c(e,t,n,r){var i=Object.create((t&&t.prototype instanceof d?t:d).prototype),a=new P(r||[]);return i._invoke=function(e,t,n){var r="suspendedStart";return function(i,a){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw a;return{value:void 0,done:!0}}for(n.method=i,n.arg=a;;){var l=n.delegate;if(l){var o=w(l,n);if(o){if(o===u)continue;return o}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=s(e,t,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===u)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}(e,n,a),i}function s(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var u={};function d(){}function g(){}function p(){}var m={};o(m,i,(function(){return this}));var f=Object.getPrototypeOf,h=f&&f(f(C([])));h&&h!==t&&n.call(h,i)&&(m=h);var v=p.prototype=d.prototype=Object.create(m);function y(e){["next","throw","return"].forEach((function(t){o(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){var r;this._invoke=function(i,a){function l(){return new t((function(r,l){!function r(i,a,l,o){var c=s(e[i],e,a);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==typeof d&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,l,o)}),(function(e){r("throw",e,l,o)})):t.resolve(d).then((function(e){u.value=e,l(u)}),(function(e){return r("throw",e,l,o)}))}o(c.arg)}(i,a,r,l)}))}return r=r?r.then(l,l):l()}}function w(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method))return u;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return u}var r=s(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,u;var i=r.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,u):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,u)}function x(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function C(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,a=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:S}}function S(){return{value:void 0,done:!0}}return g.prototype=p,o(v,"constructor",p),o(p,"constructor",g),g.displayName=o(p,l,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,o(e,l,"GeneratorFunction")),e.prototype=Object.create(v),e},e.awrap=function(e){return{__await:e}},y(b.prototype),o(b.prototype,a,(function(){return this})),e.AsyncIterator=b,e.async=function(t,n,r,i,a){void 0===a&&(a=Promise);var l=new b(c(t,n,r,i),a);return e.isGeneratorFunction(n)?l:l.next().then((function(e){return e.done?e.value:l.next()}))},y(v),o(v,l,"Generator"),o(v,i,(function(){return this})),o(v,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=C,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return l.type="throw",l.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],l=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var o=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(o&&c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(o){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var l=a?a.completion:{};return l.type=e,l.arg=t,a?(this.method="next",this.next=a.finallyLoc,u):this.complete(l)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),u},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),E(n),u}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;E(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:C(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),u}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}}(et={exports:{}}),et.exports),lt=new(function(){function e(){}var t=e.prototype;return t.error=function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];console.error(e,t||{},r)},t.log=function(e,t){console.log(e,t||{})},t.debug=function(e,t){console.debug(e,t||{})},e}()),ot=a.createContext(null);ot.displayName="StiggContext";var ct=function(){var e=i.useContext(ot);if(!e)throw new Error("Could not find Stigg context; You need to wrap your app in an <StiggProvider> component.");return e};function st(e,t){var r=e.flatMap((function(e){return e.pricePoints})).map((function(e){return e.billingPeriod})),i=m.countBy(r),a=m.uniq(r);return{defaultBillingPeriod:t&&a.includes(t)?t:(i[n.BillingPeriod.Monthly]||0)>(i[n.BillingPeriod.Annually]||0)?n.BillingPeriod.Monthly:n.BillingPeriod.Annually,availableBillingPeriods:a}}function ut(e,t){if(void 0===t&&(t="px"),e)return""+e+t}function dt(e,t){if(!t)return e;switch(t){case n.FontWeight.Normal:return"normal";case n.FontWeight.Bold:return"bold";default:return"normal"}}function gt(e){var t,n,r,i,a,l,o,c,s=e.typography;return{fontFamilyUrl:(null==s?void 0:s.fontFamily)||void 0,h1:{fontSize:ut(null==s||null==(t=s.h1)?void 0:t.fontSize),fontWeight:dt("bold",null==s||null==(n=s.h1)?void 0:n.fontWeight)},h2:{fontSize:ut(null==s||null==(r=s.h2)?void 0:r.fontSize),fontWeight:dt("normal",null==s||null==(i=s.h2)?void 0:i.fontWeight)},h3:{fontSize:ut(null==s||null==(a=s.h3)?void 0:a.fontSize),fontWeight:dt("normal",null==s||null==(l=s.h3)?void 0:l.fontWeight)},body:{fontSize:ut(null==s||null==(o=s.body)?void 0:o.fontSize),fontWeight:dt("normal",null==s||null==(c=s.body)?void 0:c.fontWeight)}}}function pt(e){if(e)switch(e){case n.Alignment.Left:return"left";case n.Alignment.Center:return"center";case n.Alignment.Right:return"right"}}var mt,ft=l("div",{target:"e1f7khji6"})({name:"zigog8",styles:"display:flex;flex-direction:column;align-items:center"}),ht=l(W,{target:"e1f7khji5"})({name:"o7nnmj",styles:"margin-right:16px"}),vt=l("div",{target:"e1f7khji4"})("display:flex;flex-direction:column;align-items:flex-start;gap:20px;border-radius:10px;padding:",(function(e){return e.theme.stigg.layout.planPadding}),";background-color:",(function(e){return e.theme.stigg.palette.backgroundPaper}),";min-width:",(function(e){return e.theme.stigg.layout.planMinWidth}),";max-width:",(function(e){return e.theme.stigg.layout.planMaxWidth}),";min-height:450px;border:",(function(e){return"1px solid "+e.theme.stigg.palette.outlinedBorder}),";"),yt=l("div",{target:"e1f7khji3"})("display:flex;gap:",(function(e){return e.theme.stigg.layout.planMargin}),";flex-wrap:wrap;justify-content:center;"),bt=l("div",{target:"e1f7khji2"})({name:"k8xojc",styles:"display:flex;align-items:center;margin-bottom:12px"}),wt=l("div",{target:"e1f7khji1"})({name:"xdvdnl",styles:"margin-top:auto"}),xt=l("div",{target:"e1f7khji0"})("width:150px;margin-bottom:",(function(e){return e.theme.stigg.layout.switchBottomSpacing}),";padding:12px 12px;border-radius:10px;background-color:white;border:",(function(e){return"1px solid "+e.theme.stigg.palette.outlinedBorder}),";");function Et(){return a.createElement(vt,null,a.createElement(w,{width:120,borderRadius:4}),a.createElement(w,{circle:!0,width:40,height:40}),a.createElement(w,{style:{marginBottom:33},width:120,borderRadius:4}),a.createElement(bt,null,a.createElement(ht,null),a.createElement(w,{width:120,borderRadius:4})),a.createElement(bt,null,a.createElement(ht,null),a.createElement(w,{width:120,borderRadius:4})),a.createElement(bt,null,a.createElement(ht,null),a.createElement(w,{width:120,borderRadius:4})),a.createElement(wt,null,a.createElement(w,{height:50,borderRadius:4})))}function Pt(){return a.createElement(ft,{className:"stigg-skeleton-loader-container"},a.createElement(xt,{className:"stigg-skeleton-loader-billing-period"},a.createElement(w,{borderRadius:4})),a.createElement(yt,{className:"stigg-skeleton-loader-plans-container"},a.createElement(Et,null),a.createElement(Et,null),a.createElement(Et,null)))}var Ct,St=function(e){var t=e.externalFontUrl;return a.createElement(c.Global,{styles:c.css(mt||(mt=R(["\n ","\n\n /* latin-ext */\n @font-face {\n font-family: 'DM Sans';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(https://fonts.gstatic.com/s/dmsans/v11/rP2Hp2ywxg089UriCZ2IHTWEBlwu8Q.woff2) format('woff2');\n unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F,\n U+A720-A7FF;\n }\n /* latin */\n @font-face {\n font-family: 'DM Sans';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(https://fonts.gstatic.com/s/dmsans/v11/rP2Hp2ywxg089UriCZOIHTWEBlw.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074,\n U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n }\n /* latin-ext */\n @font-face {\n font-family: 'DM Sans';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(https://fonts.gstatic.com/s/dmsans/v11/rP2Cp2ywxg089UriAWCrCBamC3YU-CnE6Q.woff2) format('woff2');\n unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F,\n U+A720-A7FF;\n }\n /* latin */\n @font-face {\n font-family: 'DM Sans';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(https://fonts.gstatic.com/s/dmsans/v11/rP2Cp2ywxg089UriAWCrCBimC3YU-Ck.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074,\n U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n }\n /* latin-ext */\n @font-face {\n font-family: 'DM Sans';\n font-style: normal;\n font-weight: 700;\n font-display: swap;\n src: url(https://fonts.gstatic.com/s/dmsans/v11/rP2Cp2ywxg089UriASitCBamC3YU-CnE6Q.woff2) format('woff2');\n unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F,\n U+A720-A7FF;\n }\n /* latin */\n @font-face {\n font-family: 'DM Sans';\n font-style: normal;\n font-weight: 700;\n font-display: swap;\n src: url(https://fonts.gstatic.com/s/dmsans/v11/rP2Cp2ywxg089UriASitCBimC3YU-Ck.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074,\n U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n }\n "])),t&&"\n @font-face {\n font-family: 'custom-font';\n font-style: normal;\n font-weight: normal;\n src: local('custom-font'), url("+t+") format('woff');\n }\n ")})},Ut=l("div",{target:"emcdfp60"})((function(e){var t=e.customCss;return t&&c.css(Ct||(Ct=R(["\n ","\n "])),t)}),";");function kt(e){var t,n,r,i,a,l,o,c=ct(),d=m.merge(e,c.theme);return a=s((null==(t=d)||null==(n=t.palette)?void 0:n.primary)||"#327EEE"),l=s((null==t||null==(r=t.palette)||null==(i=r.text)?void 0:i.primary)||"#001E6C"),o={palette:{primary:a.hex(),backgroundPaper:"#FFFFFF",backgroundHighlight:"#F5F6F9",backgroundSection:a.alpha(.1).toString(),backgroundButton:a.alpha(.08).toString(),outlinedBorder:"#C4CBDD",outlinedRestingBorder:a.alpha(.5).toString(),outlinedHoverBackground:a.lightness(95).hex(),switchBorder:a.lighten(.1).hex(),switchFill:a.lighten(.5).hex(),switchHandle:a.hex(),warning:"#ed6c02",error:"#f44336",white:"#FFFFFF",text:{primary:l.hex(),secondary:l.alpha(.75).toString(),disabled:l.alpha(.5).toString()}},layout:{planMinWidth:"330px",planMaxWidth:"330px",planMargin:"20px",planPadding:"40px",ctaAlignment:"left",headerAlignment:"left",descriptionAlignment:"left",descriptionMinHeight:"80px",switchBottomSpacing:"40px"},shadows:{light:"0px 2px 1px -1px rgba(0, 0, 0, 0.2), 0px 1px 1px rgba(0, 0, 0, 0.14), 0px 1px 3px rgba(0, 0, 0, 0.12)",popover:"0px 4px 5px -2px rgba(0, 30, 108, 0.2), 0px 7px 10px 1px rgba(0, 30, 108, 0.14), 0px 2px 16px 1px rgba(0, 30, 108, 0.12)"},border:{radius:"10px"},typography:{fontFamily:"custom-font, DM Sans, sans-serif",h1:{fontSize:"32px",fontWeight:"bold"},h2:{fontSize:"24px",fontWeight:"normal"},h3:{fontSize:"16px",fontWeight:"normal"},body:{fontSize:"14px",fontWeight:"normal"},caption:{fontSize:"12px",fontWeight:"normal"}},customCss:""},u(o,t)}function Tt(e){var t=e.typography,n=Number(t.body.fontSize.replace("px",""))/14;return{pxToRem:function(e){return e/16*n+"rem"},bodyFontFamily:t.fontFamily,headingFontFamily:t.fontFamily,fontSizes:[t.h1.fontSize,t.h2.fontSize,t.h3.fontSize,t.body.fontSize,"12px","10px"]}}var Mt=function(e){var t=e.children,n=kt(e.componentTheme);return a.createElement(E.ThemeProvider,{theme:E.createTheme({stigg:n})},a.createElement(c.ThemeProvider,{theme:{stigg:n}},a.createElement(Ut,{customCss:n.customCss},a.createElement(St,{externalFontUrl:n.typography.fontFamilyUrl}),a.createElement(P.ThemeProvider,{theme:{typography:Tt(n)}},t))))},Bt=a.createContext(null);Bt.displayName="CustomerPortalContext";var Nt=function(){var e=i.useContext(Bt);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 Lt(e){var t,n,r,l,o,c,s,d=e.children,g=e.textOverrides,p=e.theme,m=e.resourceId,f=e.productId,h=ct().customerPortalUpdatedAt,v=function(e){var t=e.resourceId,n=e.productId,r=ct(),a=r.stigg,l=r.customerPortalUpdatedAt,o=i.useState(!1),c=o[0],s=o[1],u=i.useState(),d=u[0],g=u[1];return i.useEffect((function(){!function(){var e=I(at.mark((function e(){return at.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!a.isCustomerLoaded){e.next=15;break}return e.prev=1,s(!0),e.next=5,a.getCustomerPortal({resourceId:t,productId:n});case 5:g(e.sent),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(1),lt.error("Failed to load customer portal "+(null==e.t0?void 0:e.t0.message),e.t0);case 12:return e.prev=12,s(!1),e.finish(12);case 15:case"end":return e.stop()}}),e,null,[[1,9,12,15]])})));return function(){return e.apply(this,arguments)}}()()}),[a,a.isCustomerLoaded,l,t]),{customerPortal:d,isLoading:c}}({resourceId:m,productId:f}),y=v.customerPortal,b=v.isLoading,w=null!=y&&y.configuration?function(e){var t=e.palette;return{palette:{primary:(null==t?void 0:t.primary)||void 0,backgroundPaper:(null==t?void 0:t.paywallBackgroundColor)||void 0,outlinedBorder:(null==t?void 0:t.borderColor)||void 0,backgroundHighlight:(null==t?void 0:t.currentPlanBackground)||void 0,text:{primary:(null==t?void 0:t.textColor)||void 0}},typography:gt(e)}}(y.configuration):void 0,x=(t=kt(w),r=null==y?void 0:y.configuration,{sectionTitleColor:(null==(n=p)?void 0:n.sectionTitleColor)||t.palette.text.secondary,planNameColor:(null==n?void 0:n.planNameColor)||t.palette.text.primary,backgroundColor:(null==n?void 0:n.backgroundColor)||(null==r||null==(l=r.palette)?void 0:l.backgroundColor)||"white",borderColor:(null==n?void 0:n.borderColor)||(null==r||null==(o=r.palette)?void 0:o.borderColor)||"rgba(0, 30, 108, 0.15)",listItemBackgroundColor:(null==n?void 0:n.backgroundColor)||(null==r||null==(c=r.palette)?void 0:c.backgroundColor)||"white",tabMaxHeight:(null==n?void 0:n.tabMaxHeight)||"380px",iconsColor:(null==n?void 0:n.iconsColor)||(null==r||null==(s=r.palette)?void 0:s.iconsColor)||void 0,iconsBackgroundColor:null==n?void 0:n.iconsBackgroundColor}),E=u({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"},g);return a.createElement(Mt,{componentTheme:w},a.createElement(Bt.Provider,{key:null==h?void 0:h.toString(),value:{customerPortal:y,isLoading:b,textOverrides:E,theme:x,resourceId:m}},d))}var At,Ft=l(S,{target:"emvioms0"})("border-radius:10px;padding:8px 16px;text-transform:none;&,&:hover{border-color:",(function(e){return e.theme.stigg.palette.outlinedRestingBorder}),";}");function Ot(){return(Ot=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var It=function(e){return i.createElement("svg",Ot({width:20,height:20,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),At||(At=i.createElement("path",{clipRule:"evenodd",d:"M13.333 2.5 17.5 6.667 6.667 17.5H2.5v-4.167L13.333 2.5v0Z",stroke:"#327EEE",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})))},jt=l("div",{target:"ewz8krb0"})("display:flex;align-items:center;justify-content:space-between;",(function(e){return!e.$disableMargin&&"\n &:not(:last-child) {\n margin-bottom: 32px;\n }\n "}),";");function Dt(e){var t=e.title,n=e.className,r=e.isLoading,i=Nt().theme;return r?a.createElement(w,{width:120}):a.createElement(V,{className:n,overrideColor:i.sectionTitleColor,variant:"h3",bold:!0},t)}var Rt=l(It,{target:"e1fjw26b0"})("path{stroke:",(function(e){return e.theme.stigg.palette.primary}),";}");function _t(e){var t=e.onManageSubscription,n=e.hideManageButton,r=e.textOverrides;return a.createElement(jt,{className:"stigg-customer-portal-overview-header",$disableMargin:!0},a.createElement(Dt,{title:"Subscription",className:"stigg-overview-title"}),!n&&a.createElement(Ft,{className:"stigg-manage-subscription-button",variant:"outlined",onClick:t},a.createElement(Rt,{className:"stigg-manage-subscription-button-image"}),a.createElement(V,{className:"stigg-manage-subscription-button-text",color:"primary.main",style:{marginLeft:"8px"},variant:"body1"},null==r?void 0:r.manageSubscription)))}function Ht(){var e=Nt().customerPortal,t=U(null==e?void 0:e.subscriptions,(function(e){return e.addons}));return M(t)?null:a.createElement("div",{className:"stigg-addons-list-layout"},t.map((function(e,n){return a.createElement(V,{key:e.addonId,span:!0,className:"stigg-addon-list-item-text",variant:"body1"},e.quantity>1&&e.quantity+" X ",e.displayName,n===t.length-1?"":", ")})))}var Wt=l("div",{target:"e1g6q2f50"})("display:flex;justify-content:space-between;align-items:center;gap:64px;border-bottom:",(function(e){return"1px solid "+e.$borderColor}),";padding:16px 0;&>*:first-child{max-width:60%;}");function qt(){var e=Nt(),t=e.customerPortal,n=e.theme,r=null==t?void 0:t.promotionalEntitlements;return a.createElement("div",{style:{display:"flex",flexDirection:"column"}},a.createElement(V,{color:"secondary"},e.textOverrides.promotionsSubtitle),a.createElement("div",{style:{display:"flex",flexDirection:"column"}},a.createElement(Wt,{$borderColor:n.borderColor},a.createElement(V,{variant:"body1",bold:!0},"Feature"),a.createElement(V,{variant:"body1",bold:!0},"Expiration date")),null==r?void 0:r.map((function(e){return a.createElement(Wt,{$borderColor:n.borderColor},a.createElement(V,{variant:"body1"},function(e){var t,n=e.displayName;return e.hasUnlimitedUsage?"Unlimited "+n:e.usageLimit?n+" x "+(null==(t=e.usageLimit)?void 0:t.toLocaleString()):n}(e)),a.createElement(V,{variant:"body1",color:"disabled"},e.endDate?g.utc(e.endDate).format("MMM Do, YYYY"):"None"))}))))}var Zt,$t,Gt,zt,Vt,Yt,Qt,Kt,Xt,Jt,en,tn,nn,rn,an=l(B,{target:"exlfw3j3"})({name:"jlwfj4",styles:".MuiTabs-indicator{background-color:#001e6c;}"}),ln=l("div",{target:"exlfw3j2"})({name:"1dqkbz0",styles:"width:100%;flex:1;margin-top:16px"}),on=l(k,{target:"exlfw3j1"})("margin-top:16px;max-height:",(function(e){return e.$maxHeight}),";overflow-y:auto;");function cn(){return(cn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function sn(){return(sn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function un(){return(un=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function dn(){return(dn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function gn(){return(gn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function pn(){return(pn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var mn,fn,hn,vn,yn,bn,wn,xn,En,Pn,Cn=function(e){return i.createElement("svg",pn({width:20,height:20,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),rn||(rn=i.createElement("path",{d:"M10.833 2.5a7.5 7.5 0 0 0-7.5 7.5h-2.5l3.242 3.242.058.116L7.5 10H5a5.829 5.829 0 0 1 5.833-5.833A5.83 5.83 0 0 1 16.667 10a5.83 5.83 0 0 1-5.834 5.833 5.786 5.786 0 0 1-4.116-1.716L5.533 15.3a7.462 7.462 0 0 0 5.3 2.2 7.5 7.5 0 0 0 0-15ZM10 6.667v4.166l3.567 2.117.6-1.008-2.917-1.734V6.667H10Z",fill:"#6678A7"})))};function Sn(){return(Sn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Un(){return(Un=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function kn(){return(kn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Tn(){return(Tn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var Mn,Bn,Nn,Ln={RenewSubscription:function(e){return i.createElement("svg",cn({width:36,height:36,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Zt||(Zt=i.createElement("rect",{width:36,height:36,rx:10,fill:"#F5F6F9"})),$t||($t=i.createElement("path",{clipRule:"evenodd",d:"M9 12a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H11a2 2 0 0 1-2-2V12Z",stroke:"#7586B0",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),Gt||(Gt=i.createElement("path",{d:"M22 8v4M14 8v4M9 16h18",stroke:"#7586B0",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})))},BillingInfoCustomer:function(e){return i.createElement("svg",sn({width:36,height:36,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),zt||(zt=i.createElement("rect",{width:36,height:36,rx:10,fill:"#F5F6F9"})),Vt||(Vt=i.createElement("path",{d:"M26 27v-2a4 4 0 0 0-4-4h-8a4 4 0 0 0-4 4v2",stroke:"#7586B0",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),Yt||(Yt=i.createElement("path",{clipRule:"evenodd",d:"M18 17a4 4 0 1 0 0-8 4 4 0 0 0 0 8Z",stroke:"#7586B0",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})))},CreditCard:function(e){return i.createElement("svg",un({width:36,height:36,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Qt||(Qt=i.createElement("rect",{width:36,height:36,rx:10,fill:"#F5F6F9"})),Kt||(Kt=i.createElement("path",{d:"M26 10H10c-1.11 0-1.99.89-1.99 2L8 24c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V12c0-1.11-.89-2-2-2Zm0 14H10v-6h16v6Zm0-10H10v-2h16v2Z",fill:"#7586B0"})))},ScheduleBox:function(e){return i.createElement("svg",dn({width:36,height:36,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Xt||(Xt=i.createElement("rect",{width:36,height:36,rx:10,fill:"url(#schedule-box_svg__a)"})),Jt||(Jt=i.createElement("rect",{width:36,height:36,rx:10,fill:"#F5F6F9"})),en||(en=i.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.954 7.7a1 1 0 0 1-.654 1.254 8.998 8.998 0 0 0-1.543 16.523A9 9 0 0 0 27 17.54a1 1 0 1 1 2 0c0 .357-.017.713-.052 1.066.018.089.024.182.017.278l-.004.047a.997.997 0 0 1-.101.361A11 11 0 1 1 14.7 7.046a1 1 0 0 1 1.254.654Zm1.896.252a1 1 0 0 1 1.08-.912l.048.004a1 1 0 1 1-.178 1.992l-.038-.003a1 1 0 0 1-.912-1.081ZM22.858 9.2a1 1 0 0 1 1.391-.254l.078.054a1 1 0 1 1-1.152 1.635 8.98 8.98 0 0 0-.063-.044 1 1 0 0 1-.254-1.391Zm3.748 3.609a1 1 0 0 1 1.332.473l.04.085a1 1 0 1 1-1.813.844l-.014-.031-.019-.039a1 1 0 0 1 .474-1.332ZM19 14a1 1 0 1 0-2 0v4a1 1 0 0 0 1 1h4a1 1 0 1 0 0-2h-3v-3Z",fill:"#7586B0"})),tn||(tn=i.createElement("defs",null,i.createElement("linearGradient",{id:"schedule-box_svg__a",x1:35.02,y1:1.224,x2:0,y2:36,gradientUnits:"userSpaceOnUse"}))))},ScheduleClock:function(e){return i.createElement("svg",gn({width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),nn||(nn=i.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.954 1.7A1 1 0 0 1 9.3 2.954a8.998 8.998 0 0 0-5.615 12.03A9 9 0 0 0 21 11.54a1 1 0 1 1 2 0c0 .357-.017.713-.052 1.066.018.089.024.182.017.278l-.004.047a.997.997 0 0 1-.101.361A11 11 0 1 1 8.7 1.046a1 1 0 0 1 1.254.654Zm1.896.252a1 1 0 0 1 1.08-.912l.048.004a1 1 0 1 1-.178 1.992l-.039-.003a1 1 0 0 1-.911-1.081ZM16.858 3.2a1 1 0 0 1 1.391-.254l.078.054a1 1 0 1 1-1.152 1.635 9.7 9.7 0 0 0-.063-.044 1 1 0 0 1-.254-1.391Zm3.748 3.608a1 1 0 0 1 1.332.474l.04.085a1 1 0 1 1-1.813.844l-.014-.031-.019-.039a1 1 0 0 1 .474-1.333ZM13 8a1 1 0 1 0-2 0v4a1 1 0 0 0 1 1h4a1 1 0 1 0 0-2h-3V8Z",fill:"#7586B0"})))},Restore:Cn,MiniSchedule:we,DollarCoin:function(e){return i.createElement("svg",Sn({width:21,height:20,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),mn||(mn=i.createElement("g",{clipPath:"url(#dollar-coin_svg__a)",stroke:"#7586B0",strokeWidth:1.714,strokeLinecap:"round",strokeLinejoin:"round"},i.createElement("path",{d:"M10.334 19.286A9.286 9.286 0 1 0 1.048 10a9.286 9.286 0 0 0 9.286 9.286Z"}),i.createElement("path",{d:"M12.765 7.46a1.903 1.903 0 0 0-1.796-1.27H9.494a1.7 1.7 0 0 0-.363 3.362l2.245.49a1.905 1.905 0 0 1-.407 3.768h-1.27c-.83 0-1.535-.53-1.797-1.27M10.334 6.19V4.287M10.334 15.714V13.81"}))),fn||(fn=i.createElement("defs",null,i.createElement("clipPath",{id:"dollar-coin_svg__a"},i.createElement("path",{fill:"#fff",transform:"translate(.333)",d:"M0 0h20v20H0z"})))))},Promotions:function(e){return i.createElement("svg",Un({width:24,height:25,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),hn||(hn=i.createElement("g",{clipPath:"url(#promotions_svg__a)",stroke:"#7586B0",strokeWidth:1.714,strokeLinecap:"round",strokeLinejoin:"round"},i.createElement("path",{d:"M21.429 5.325H2.57c-.946 0-1.714.767-1.714 1.714v3.429c0 .947.768 1.714 1.714 1.714H21.43c.946 0 1.714-.768 1.714-1.714V7.039c0-.947-.768-1.714-1.714-1.714ZM21.429 12.182v9.429a1.714 1.714 0 0 1-1.715 1.714H4.286a1.714 1.714 0 0 1-1.714-1.714v-9.429M12 5.325v18M17.143 1.04 12 5.324 6.857 1.039"}))),vn||(vn=i.createElement("defs",null,i.createElement("clipPath",{id:"promotions_svg__a"},i.createElement("path",{fill:"#fff",transform:"translate(0 .182)",d:"M0 0h24v24H0z"})))))},Addons:function(e){return i.createElement("svg",kn({width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),yn||(yn=i.createElement("g",{clipPath:"url(#addons_svg__a)",stroke:"#7586B0",strokeWidth:1.714,strokeLinecap:"round",strokeLinejoin:"round"},i.createElement("path",{d:"M12 6.857v10.286M6.857 12h10.286M18 .857H6A5.143 5.143 0 0 0 .857 6v12A5.143 5.143 0 0 0 6 23.143h12A5.143 5.143 0 0 0 23.143 18V6A5.143 5.143 0 0 0 18 .857Z"}))),bn||(bn=i.createElement("defs",null,i.createElement("clipPath",{id:"addons_svg__a"},i.createElement("path",{fill:"#fff",d:"M0 0h24v24H0z"})))))},ContactSupport:function(e){return i.createElement("svg",Tn({width:36,height:36,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),wn||(wn=i.createElement("rect",{width:36,height:36,rx:10,fill:"#F5F6F9"})),xn||(xn=i.createElement("path",{d:"M27 18.22C27 12.73 22.74 9 18 9c-4.69 0-9 3.65-9 9.28-.6.34-1 .98-1 1.72v2c0 1.1.9 2 2 2h1v-6.1c0-3.87 3.13-7 7-7s7 3.13 7 7V25h-8v2h8c1.1 0 2-.9 2-2v-1.22c.59-.31 1-.92 1-1.64v-2.3c0-.7-.41-1.31-1-1.62Z",fill:"#7586B0"})),En||(En=i.createElement("path",{d:"M15 20a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM21 20a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z",fill:"#7586B0"})),Pn||(Pn=i.createElement("path",{d:"M24 17.03A6.04 6.04 0 0 0 18.05 12c-3.03 0-6.29 2.51-6.03 6.45a8.075 8.075 0 0 0 4.86-5.89c1.31 2.63 4 4.44 7.12 4.47Z",fill:"#7586B0"})))}},An=function(e,t){switch(e){case"primary":return t.stigg.palette.text.primary;case"secondary":return t.stigg.palette.text.secondary;default:return e}},Fn=l("div",{target:"e1ds7xyn0"})((function(e){var t=e.$pathColor;return t&&c.css(Mn||(Mn=R(["\n path {\n fill: ",";\n }\n "])),t)})," ",(function(e){var t=e.$rectColor;return t&&c.css(Bn||(Bn=R(["\n svg rect {\n fill: ",";\n }\n "])),t)})," ",(function(e){var t=e.$strokeColor;return t&&c.css(Nn||(Nn=R(["\n g {\n stroke: ",";\n }\n "])),t)}),";");function On(e){var t=e.className,n=e.style,r=e.svgPathColor,i=e.svgRectColor,l=e.svgStrokeColor,o=Ln[e.icon],s=c.useTheme();return a.createElement(Fn,{className:t,style:n,$pathColor:An(r,s),$rectColor:An(i,s),$strokeColor:An(l,s)},a.createElement(o,null))}var In=["children","value","index","maxHeight"];function jn(e){var t=e.children,n=e.value,r=e.index,i=e.maxHeight,l=D(e,In);return a.createElement("div",Object.assign({role:"tabpanel",hidden:n!==r},l),n===r&&a.createElement(on,{$maxHeight:i},t))}function Dn(e){var t=e.isSelected,n=e.label,r=t?"primary":"secondary";return a.createElement("div",{style:{display:"flex",gap:8,alignItems:"center"}},a.createElement(On,{icon:e.icon,svgStrokeColor:r}),a.createElement(V,{variant:"h6",bold:t,fontWeight:o.FontWeight.Medium,color:r},n))}function Rn(e){var t=e.customerPortal,n=e.hiddenSections,r=e.textOverrides,l=e.theme,o=function(e){return null==n?void 0:n.some((function(t){return t===e}))},c=U(t.subscriptions,(function(e){return e.addons})).length>0&&!o("addons"),s=t.promotionalEntitlements.length>0&&!o("promotionalEntitlements"),u=i.useState(c?1:2),d=u[0],g=u[1];return c||s?a.createElement(ln,null,a.createElement(k,{sx:{borderBottom:1,borderColor:"divider"}},a.createElement(an,{value:d,onChange:function(e,t){g(t)}},c?a.createElement(T,{sx:{textTransform:"none"},value:1,label:a.createElement(Dn,{isSelected:1===d,label:r.addonsTabTitle,icon:"Addons"})}):null,s?a.createElement(T,{sx:{textTransform:"none"},value:2,label:a.createElement(Dn,{isSelected:2===d,label:r.promotionsTabTitle,icon:"Promotions"})}):null)),a.createElement(jn,{value:d,index:1,maxHeight:l.tabMaxHeight},a.createElement(Ht,null)),a.createElement(jn,{value:d,index:2,maxHeight:l.tabMaxHeight},a.createElement(qt,null))):null}var _n=l("div",{target:"ejq3grd1"})({name:"1eoy87d",styles:"display:flex;justify-content:space-between"}),Hn=l("div",{target:"ejq3grd0"})({name:"43cxha",styles:"display:flex;flex-direction:column;gap:32px"});function Wn(){return a.createElement(_n,{className:"stigg-subscription-overview-skeleton-layout"},a.createElement(Hn,null,a.createElement(w,{width:120}),a.createElement(w,{width:120})),a.createElement(w,{width:295,height:193}))}function qn(e){var t=e.scheduleUpdate.targetPackage;return a.createElement(h.Grid,{container:!0,alignItems:"center"},a.createElement(h.Grid,null,a.createElement(N.ArrowDown,{color:"#D94052",height:20,className:"stigg-scheduled-updates-arrow-down"})),a.createElement(h.Grid,{item:!0},a.createElement(V,{className:"stigg-scheduled-updates-description",variant:"body1"},"Downgrade to the ",a.createElement("b",null,null==t?void 0:t.displayName)," plan")))}function Zn(e){var t=e.scheduleUpdate.scheduleVariables.billingPeriod,r=t===n.BillingPeriod.Monthly?"annually":"monthly",i=t===n.BillingPeriod.Monthly?"monthly":"annually";return a.createElement(h.Grid,{container:!0,alignItems:"center"},a.createElement(h.Grid,null,a.createElement(N.ArrowDown,{color:"#D94052",height:20,className:"stigg-scheduled-updates-arrow-down"})),a.createElement(h.Grid,{item:!0},a.createElement(V,{className:"stigg-scheduled-updates-description",variant:"body1"},"Change from an ",r," to a ",a.createElement("b",null,i)," billing cycle")))}function $n(e){var t=e.scheduleUpdate.scheduleVariables,n=t.newUnitAmount,r=t.featureId,i=m.compact(m.map(e.subscription.prices,"feature")).find((function(e){return e.id===r}));if(!i)return null;var l=i.featureUnits,o=1===n?l:i.featureUnitsPlural;return a.createElement(h.Grid,{container:!0,alignItems:"flex-start",flexWrap:"nowrap"},a.createElement(h.Grid,null,a.createElement(N.ArrowDown,{color:"#D94052",height:20,className:"stigg-scheduled-updates-arrow-down"})),a.createElement(h.Grid,{item:!0},a.createElement(V,{className:"stigg-scheduled-updates-description",variant:"body1"},"Reduce the ",a.createElement("b",null,l)," quantity to ",n," ",o)))}function Gn(e){var t=e.scheduleUpdate,r=e.subscription;switch(t.subscriptionScheduleType){case n.SubscriptionScheduleType.Downgrade:return a.createElement(qn,{scheduleUpdate:t});case n.SubscriptionScheduleType.BillingPeriod:return a.createElement(Zn,{scheduleUpdate:t});case n.SubscriptionScheduleType.UnitAmount:return a.createElement($n,{scheduleUpdate:t,subscription:r});default:return null}}var zn=l(h.Box,{target:"eju957a2"})("border-bottom:",(function(e){return"1px solid "+e.$borderColor}),";border-top-left-radius:10px;border-top-right-radius:10px;margin:-64px -64px 64px -64px;padding:24px 32px;"),Vn=l(d,{target:"eju957a1"})({name:"158icaa",styles:"margin-left:4px"}),Yn=l(Cn,{target:"eju957a0"})("color:",(function(e){return e.theme.stigg.palette.primary}),";path{fill:",(function(e){return e.theme.stigg.palette.primary}),";}");function Qn(e){var t=e.subscription,n=t.scheduledUpdates;return a.createElement(a.Fragment,null,a.createElement(h.Grid,{container:!0,alignItems:"center",justifyContent:"space-between",gap:1},a.createElement(h.Grid,null,a.createElement(V,{className:"stigg-scheduled-updates-description",variant:"body1"},"The following updates will take effect in the next billing cycle:"))),a.createElement(h.Grid,null,(n||[]).map((function(e){return a.createElement(Gn,{key:e.subscriptionScheduleType,scheduleUpdate:e,subscription:t})}))))}function Kn(e){var t=e.subscription,n=oe({scheduledUpdate:(t.scheduledUpdates||[])[0],subscriptionPrices:t.prices,billingPeriodRange:t.billingPeriodRange,options:{postfix:"at the end of the current billing period"}}),r=n.line2;return a.createElement(a.Fragment,null,a.createElement(h.Grid,{container:!0,alignItems:"center",justifyContent:"space-between",gap:1},a.createElement(h.Grid,null,a.createElement(V,{className:"stigg-scheduled-updates-title",variant:"body1",color:"primary"},n.line1))),r&&a.createElement(h.Grid,null,a.createElement(V,{className:"stigg-scheduled-updates-subtitle",variant:"body1",color:"secondary"},r)))}function Xn(e){var t=e.subscription,n=e.onCancelScheduledUpdates,r=e.theme,l=e.cancelScheduledUpdatesButtonTitle,o=c.useTheme(),s=i.useState(!1),u=s[0],d=s[1],g=t.scheduledUpdates;if(!g||0===g.length)return null;var p=1===g.length;return a.createElement(zn,{$borderColor:r.borderColor,className:"stigg-scheduled-updates-alert-container"},a.createElement(h.Grid,{container:!0,alignItems:p?"center":"flex-start",gap:2},a.createElement(h.Grid,{item:!0,display:"flex"},a.createElement(On,{icon:"ScheduleBox",svgPathColor:r.iconsColor,svgRectColor:r.iconsBackgroundColor})),a.createElement(h.Grid,{item:!0,flex:1},a.createElement(p?Kn:Qn,{subscription:t})),!!n&&a.createElement(h.Grid,{item:!0},a.createElement(Ft,{variant:"outlined",onClick:function(){d(!0),Promise.resolve(n(t)).finally((function(){return d(!1)}))}},u?a.createElement(Vn,{loading:!0,size:16,color:o.stigg.palette.text.disabled}):a.createElement(Yn,{style:{display:"flex",marginRight:4},className:"stigg-scheduled-updates-cancel-update-button-icon"}),a.createElement(V,{variant:"body1",color:"primary.main",className:"stigg-scheduled-updates-cancel-update-button"},l)))))}var Jn=l("div",{target:"e1kw2z1l0"})("width:100%;display:flex;flex-direction:column;border-radius:10px;background-color:",(function(e){return e.$backgroundColor}),";border:",(function(e){return"1px solid "+e.$borderColor}),";padding:64px;");function er(e){var t=e.billingPeriod,r=e.rangeEnd,i=e.amount,l=e.currency;return a.createElement(a.Fragment,null,a.createElement(V,{variant:"h6"},"Next estimated bill"),a.createElement(V,{variant:"h1"},xe({amount:i,currency:l,maximumFractionDigits:2})),a.createElement(V,{variant:"body1",color:"secondary"},"Billed ",t===n.BillingPeriod.Monthly?"monthly":"annually"," on"," ",a.createElement(V,{variant:"body1",span:!0,color:"primary"},g.utc(r).format("MMM Do, YYYY"))),a.createElement(V,{variant:"body1",color:"secondary"},"* Additional tax rates may apply"))}function tr(e){var t=e.description;return a.createElement(a.Fragment,null,a.createElement(V,{variant:"h6",color:"secondary"},"No upcoming bill"),a.createElement(V,{variant:"body1",color:"secondary"},t))}var nr=l("div",{target:"e1ftdtst1"})({name:"1nocm2b",styles:"display:flex;flex-direction:column;align-items:left;gap:8px"}),rr=l(S,{target:"e1ftdtst0"})({name:"1l28f5r",styles:"width:fit-content;&.MuiButton-root{padding:0;&:hover{background:none;}}"});function ir(e){var t=e.onContactSupport,n=e.label,r=a.createElement(V,{color:t?"primary.main":"secondary"},e.linkLabel);return a.createElement(nr,{className:"stigg-contact-support-layout"},a.createElement(V,{className:"stigg-contact-support-label",color:"secondary"},n),t?a.createElement(rr,{className:"stigg-contact-support-button",style:{textTransform:"none"},variant:"text",onClick:t},r):r)}var ar,lr,or=l("div",{target:"e1u4onrr0"})("max-height:278px;display:flex;flex-direction:column;border-radius:10px;background-color:",(function(e){return e.theme.stigg.palette.backgroundSection}),";border:",(function(e){return"1px solid "+e.$borderColor}),";padding:32px;gap:16px;");function cr(e){var t,r,i,l,o=e.subscription,c=e.theme,s=e.textOverrides,u=e.onContactSupport,d=o.pricingType,g=null==(t=null==(r=o.prices)?void 0:r.every((function(e){return e.billingModel!==n.BillingModel.UsageBased})))||t,p=null==(i=o.scheduledUpdates)?void 0:i.find((function(e){var t=e.targetPackage;return e.subscriptionScheduleType===n.SubscriptionScheduleType.Downgrade&&(null==t?void 0:t.pricingType)===n.PricingType.Free}));if(d===n.PricingType.Free)l=a.createElement(tr,{description:"You're on a free plan, so you don’t have any upcoming charges"});else if(d===n.PricingType.Paid)if(p&&g)l=a.createElement(tr,{description:"Your plan will be downgraded to a free plan, so you don’t have any upcoming charges"});else if(o.status===n.SubscriptionStatus.InTrial)l=a.createElement(tr,{description:"You’re on a free trial of the "+o.planName+" plan, so you don’t have any upcoming charges"});else{var m,f,h,v,y=null==(m=o.prices)||null==(f=m[0])?void 0:f.billingPeriod,b=null==(h=o.billingPeriodRange)?void 0:h.end,w=null==(v=o.totalPrice)?void 0:v.total;y&&b&&w&&(l=a.createElement(er,{billingPeriod:y,rangeEnd:b,amount:w.amount,currency:w.currency}))}else d===n.PricingType.Custom&&(l=a.createElement(ir,{onContactSupport:u,label:s.contactSupportTitle,linkLabel:s.contactSupportLink}));return a.createElement(or,{className:"stigg-subscription-total-price-layout",$borderColor:c.borderColor},l)}function sr(){return(sr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var ur,dr,gr,pr=function(e){return i.createElement("svg",sr({width:16,height:16,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ar||(ar=i.createElement("path",{d:"M12.947 13.6h-1.013l.001-2.824a.522.522 0 0 0-.18-.392L8.622 7.918l3.134-2.465a.497.497 0 0 0 .18-.392V2.4h1.012c.278 0 .49-.212.49-.49a.481.481 0 0 0-.49-.49H3.053a.481.481 0 0 0-.49.49c0 .278.213.49.49.49h1.013l-.001 2.661c0 .147.065.294.18.392l3.117 2.465-3.117 2.466a.497.497 0 0 0-.18.392V13.6H3.054a.481.481 0 0 0-.49.49c0 .277.213.49.49.49h9.894c.277 0 .49-.213.49-.49a.481.481 0 0 0-.49-.49ZM5.045 2.4h5.91v2.416L8 7.167l-2.955-2.35V2.4Zm0 8.62L8 8.67l2.955 2.334v2.58h-5.91V11.02Z",fill:"#fff"})),lr||(lr=i.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.053 1.254h9.894c.37 0 .657.287.657.656 0 .37-.287.657-.657.657h-.845L12.1 5.06c0 .214-.088.39-.238.519l-.005.004L8.89 7.918l2.974 2.34c.152.13.238.323.238.518l-.001 2.657h.846c.37 0 .657.287.657.657 0 .37-.288.657-.657.657H3.053a.648.648 0 0 1-.657-.657c0-.37.287-.657.657-.657h.846v-2.657c0-.214.087-.39.237-.519l.005-.004 2.953-2.335L4.136 5.58a.688.688 0 0 1-.238-.519V2.567h-.845a.648.648 0 0 1-.657-.656c0-.37.287-.657.657-.657Zm9.894.333H3.053a.315.315 0 0 0-.323.324c0 .185.138.323.323.323h1.18l-.001 2.827c0 .099.043.198.119.264l3.28 2.593-3.28 2.594a.33.33 0 0 0-.119.264v2.99H3.053a.315.315 0 0 0-.323.324c0 .185.138.323.323.323h9.894a.315.315 0 0 0 .323-.323.315.315 0 0 0-.323-.323h-1.18l.001-2.991a.355.355 0 0 0-.119-.264L8.351 7.918l3.298-2.593a.33.33 0 0 0 .119-.264V2.233h1.18a.315.315 0 0 0 .323-.323.315.315 0 0 0-.324-.323Zm-8.069.646h6.244v2.664L8 7.38 4.878 4.897V2.233Zm.334.334v2.169L8 6.955l2.788-2.22V2.568H5.212ZM8 8.457l3.122 2.467v2.827H4.878v-2.81L8 8.456Zm0 .425-2.788 2.219v2.316h5.576v-2.332L8 8.882Z",fill:"#fff"})))},mr=["children","className","placement"],fr=l((function(e){var t=e.children,n=e.className,r=e.placement,i=void 0===r?"top":r,l=D(e,mr);return a.createElement(h.Tooltip,Object.assign({arrow:!0,placement:i},l,{classes:{popper:n,tooltip:"stigg-tooltip",arrow:"stigg-tooltip-arrow"}}),a.createElement("div",null,t))}),{target:"enddsuj0"})((function(e){var t,n=e.theme,r=e.$padding,i=e.$maxWidth;return(t={})["& ."+h.tooltipClasses.tooltip]={backgroundColor:n.stigg.palette.white,maxWidth:void 0===i?300:i,boxShadow:n.stigg.shadows.popover,padding:void 0===r?8:r,borderRadius:n.stigg.border.radius,color:n.stigg.palette.text.primary},t["& ."+h.tooltipClasses.arrow]={color:n.stigg.palette.white},t}),""),hr=C(V)(ur||(ur=R(["\n display: ",";\n -webkit-line-clamp: ",";\n -webkit-box-orient: vertical;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: normal;\n ","\n\n ","\n"])),(function(e){return e.$display}),(function(e){return e.$maxLines}),(function(e){return e.$wordBreak&&P.css(dr||(dr=R(["\n word-break: break-word;\n "])))}),(function(e){return e.$bold&&P.css(gr||(gr=R(["\n font-weight: bold;\n "])))}));function vr(e){return e&&(e.clientHeight<e.scrollHeight||e.offsetWidth<e.scrollWidth)}var yr=function(e){var t=e.leaveDelay,n=e.children,r=e.variant,l=e.color,o=e.maxLines,c=void 0===o?1:o,s=e.wordBreak,u=e.bold,d=e.tooltipPlacement,g=void 0===d?"top":d,p=e.className,m=e.display,f=void 0===m?"-webkit-box":m,h=e.style,v=e["data-testid"],y=i.useState(!1),b=y[0],w=y[1],x=i.useRef(null),E=a.createElement(hr,{ref:x,variant:r,color:l,$maxLines:c,$wordBreak:s,$bold:u,className:p,$display:f,style:h,"data-testid":v},n);i.useEffect((function(){if(null!=x&&x.current){var e=vr(x.current);w(e)}}),[x]);var P=(null==x?void 0:x.current)&&vr(x.current);return a.createElement("span",null,b||P?a.createElement(fr,{placement:g,leaveDelay:t,title:a.createElement(V,{variant:"body1"},n)},E):E)},br=l("div",{target:"el5iwyw1"})("width:100%;display:flex;align-items:center;gap:4px;background-color:",(function(e){return e.theme.stigg.palette.warning}),";border-radius:10px;padding:8px 16px;margin-top:16px;"),wr=l(h.Link,{target:"el5iwyw0"})({name:"69ka7t",styles:"text-decoration-color:white;color:white;cursor:pointer"});function xr(e){var t=e.subscription,r=e.includePlanName,i=e.onManageSubscription;return(null==t?void 0:t.status)!==n.SubscriptionStatus.InTrial?null:a.createElement(br,{className:"stigg-subscription-trial-badge"},a.createElement(pr,{className:"stigg-subscription-trial-badge-image"}),a.createElement("div",{style:{flex:1,marginRight:4}},a.createElement(yr,{variant:"body1",className:"stigg-subscription-trial-badge-text",color:"white"},t.trialRemainingDays+" days remaining in trial",r&&" of the "+t.planName+" plan")),a.createElement(wr,{className:"stigg-subscription-trial-upgrade-button",onClick:i},a.createElement(V,{color:"white"},"Upgrade plan")))}function Er(e){var t=e.mainSubscription,n=e.trialSubscription,r=e.onManageSubscription;return a.createElement("div",{className:"stigg-subscription-view-layout"},a.createElement(V,{className:"stigg-subscription-plan-name",variant:"h1",overrideColor:e.theme.planNameColor,style:{marginTop:8}},t.planName," plan"),a.createElement(xr,{subscription:n,includePlanName:(null==n?void 0:n.planName)!==t.planName,onManageSubscription:r}))}function Pr(e,t){return Math.min(Math.floor(e/t*100),100)}var Cr,Sr=l(L,{target:"e1cbsoof1"})("height:4px;background-color:",(function(e){return s(e.theme.stigg.palette.primary).alpha(.4).string()}),";span{background-color:",(function(e){var t=e.theme;switch(e.$progressStatus){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}}),";}"),Ur=l(h.Divider,{target:"e1cbsoof0"})("border-style:dotted;border-bottom-width:2px;border-color:",(function(e){return s(e.theme.stigg.palette.outlinedRestingBorder).alpha(.4).string()}),";");function kr(e){var t=e.entitlement;if(t.hasUnlimitedUsage)return a.createElement(Ur,null);var n,r=Pr(t.currentUsage||0,t.usageLimit),i=(n=r)<70?"standard":n<100?"warning":"error";return a.createElement(Sr,{$progressStatus:i,className:"stigg-feature-usage-progress-bar-"+i.toString(),variant:"determinate",value:r})}var Tr=C(S)(Cr||(Cr=R(["\n text-transform: none;\n padding: 0;\n white-space: nowrap;\n"])));function Mr(e){var t=e.entitlement,n=e.feature,r=e.onManageSubscription,i=e.onBuyMore,l=e.canBuyMore,o=e.canUpgradeSubscription;return e.hasCustomSubscription||t.hasUnlimitedUsage||Pr(t.currentUsage||0,t.usageLimit)<70?null:l?i?a.createElement(Tr,{variant:"text",onClick:function(){return i(n,t)}},a.createElement(V,{color:"primary.main"},"Buy more")):null:o&&r?a.createElement(Tr,{variant:"text",onClick:r},a.createElement(V,{color:"primary.main"},"Upgrade")):null}function Br(e){var t,n,r,i=e.amount,l=e.currency,o=e.entitlement,c=e.feature,s=e.hideChargePrice,u=e.onBuyMore,d=e.onManageSubscription,g=e.canUpgradeSubscription,p=e.hasCustomSubscription;return a.createElement("div",{className:"stigg-charge-list-item",style:{display:"flex",flexDirection:"column",gap:12}},a.createElement("div",{style:{display:"flex",justifyContent:"space-between",gap:12}},a.createElement("div",{style:{display:"flex",gap:12}},a.createElement(yr,{variant:"body1",color:"primary"},c.displayName),!s&&a.createElement(yr,{variant:"body1",color:"secondary"},xe({amount:i,currency:l})," per ",c.featureUnits)),a.createElement("div",{style:{display:"flex",gap:12}},a.createElement(Mr,{entitlement:o,feature:c,canBuyMore:!0,onBuyMore:u,onManageSubscription:d,canUpgradeSubscription:g,hasCustomSubscription:p}),a.createElement(V,{variant:"body1",color:"primary",style:{whiteSpace:"nowrap"}},o.hasUnlimitedUsage?null==(t=o.currentUsage)?void 0:t.toLocaleString():(null==(n=o.currentUsage)?void 0:n.toLocaleString())+" of "+(null==(r=o.usageLimit)?void 0:r.toLocaleString())))),a.createElement(kr,{entitlement:o}))}function Nr(e){var t=e.subscription,r=e.onBuyMore,i=e.onManageSubscription,l=e.hasCustomSubscription,o=e.canUpgradeSubscription,c=m.keyBy(e.entitlements,"feature.refId"),s=t.prices.filter((function(e){var t=e.feature;return!!t&&c[t.refId]&&!!e.price}));return s.length?a.createElement("div",{className:"stigg-charge-list",style:{display:"flex",flexDirection:"column",gap:16,marginTop:32}},s.map((function(e){var t=e.feature,s=e.price;if(!t||!s)return null;var u=c[t.refId];return u&&u.feature?a.createElement(Br,{key:t.refId,entitlement:u,feature:u.feature,amount:s.amount,currency:s.currency,hideChargePrice:e.billingModel===n.BillingModel.PerUnit,onBuyMore:r,onManageSubscription:i,canUpgradeSubscription:o,hasCustomSubscription:l}):null}))):null}function Lr(e){var t=e.onManageSubscription,r=e.onBuyMore,i=e.onCancelScheduledUpdates,l=e.onContactSupport,o=e.hiddenSections,c=e.cancelScheduledUpdatesButtonTitle,s=Nt(),u=s.customerPortal,d=s.textOverrides,g=s.theme,p=s.isLoading||!u,m=u||{},f=m.subscriptions,h=m.entitlements,v=m.canUpgradeSubscription,y=null==f?void 0:f.find((function(e){return e.status===n.SubscriptionStatus.Active})),b=null==f?void 0:f.find((function(e){return e.status===n.SubscriptionStatus.InTrial})),w=(null==y?void 0:y.pricingType)===n.PricingType.Custom,x=y||b;return a.createElement(Jn,{className:"stigg-customer-portal-subscriptions-overview",$backgroundColor:g.backgroundColor,$borderColor:g.borderColor},!p&&y&&y.scheduledUpdates&&a.createElement(Xn,{theme:g,subscription:y,onCancelScheduledUpdates:i,cancelScheduledUpdatesButtonTitle:c}),p||!x?a.createElement(Wn,null):a.createElement("div",{className:"stigg-overview-layout",style:{display:"flex",alignItems:"flex-start",gap:64}},a.createElement("div",{style:{display:"flex",flexDirection:"column",flex:1}},a.createElement(_t,{onManageSubscription:t,hideManageButton:w,textOverrides:d}),a.createElement(Er,{mainSubscription:x,trialSubscription:b,theme:g,onManageSubscription:t}),y&&h&&a.createElement(Nr,{subscription:y,entitlements:h,onBuyMore:r,onManageSubscription:t,canUpgradeSubscription:!!v,hasCustomSubscription:w}),a.createElement(Rn,{customerPortal:u,hiddenSections:o,textOverrides:d,theme:g})),a.createElement("div",{style:{display:"flex",flexDirection:"column",width:319,gap:24}},a.createElement(cr,{subscription:x,theme:g,onContactSupport:l,textOverrides:d}))))}var Ar=l("div",{target:"e2lw8x70"})({name:"7wpci2",styles:"display:flex;width:100%;align-items:flex-end;justify-content:flex-end;margin-bottom:24px"});function Fr(e){return a.createElement(Ar,{className:"stigg-customer-portal-header-layout"},a.createElement(Ke,{source:"customer_portal",showWatermark:e.showWatermark}))}var Or=l(V,{target:"eb0pe7a1"})({name:"kxbue8",styles:"text-transform:none"}),Ir=l(N.ExternalLink,{target:"eb0pe7a0"})("color:",(function(e){return e.theme.stigg.palette.primary}),";");function jr(e){var t=e.text,n=e.url;return a.createElement(Ft,{className:e.className,variant:"outlined",startIcon:a.createElement(Ir,{size:20,strokeWidth:2.5}),onClick:function(){window.open(n,"_blank")}},a.createElement(Or,{color:"primary.main"},t))}var Dr,Rr=l("div",{target:"e12mjvl51"})({name:"1hidw77",styles:"display:flex;flex-direction:column;align-items:flex-start;gap:16px;flex:1 0 0"}),_r=l("div",{target:"e12mjvl50"})({name:"j9hhqa",styles:"display:flex;align-items:flex-start;gap:16px;align-self:stretch"});function Hr(e){var t=e.rows;return a.createElement(Rr,null,a.createElement(V,{variant:"h6",color:"secondary",fontWeight:o.FontWeight.Medium},e.title),t.map((function(e){var t=e.classNamePrefix,n=e.label,r=e.value,i=e.valueTypographyProps;return a.createElement(_r,{key:n},a.createElement(V,Object.assign({className:t+"-label",variant:"body1",color:"secondary",style:{width:80}},e.labelTypographyProps),n),a.createElement(V,Object.assign({className:t+"-text",variant:"body1",color:"secondary"},i),r))})))}function Wr(){return a.createElement(w,{width:220,height:42})}function qr(){var e=Nt(),t=e.customerPortal,n=e.textOverrides,r=e.theme,i=(t||{}).billingInformation,l=!i||e.isLoading,o=[];if(l?o.push.apply(o,[a.createElement(Rr,null,a.createElement(w,{width:220,height:12}),a.createElement(w,{width:220,height:12}),a.createElement(w,{width:220,height:12})),a.createElement(h.Divider,{orientation:"vertical",style:{minHeight:93}}),a.createElement(Rr,null,a.createElement(w,{width:220,height:12}),a.createElement(w,{width:220,height:12}),a.createElement(w,{width:220,height:12}))]):(o.push(a.createElement(Hr,{title:"Billed to",rows:[{classNamePrefix:"stigg-customer-name",label:"Name",value:(null==i?void 0:i.name)||"-",valueTypographyProps:null!=i&&i.name?{}:{color:"disabled"}},{classNamePrefix:"stigg-customer-email",label:"Email",value:(null==i?void 0:i.email)||"-",valueTypographyProps:null!=i&&i.email?{}:{color:"disabled"}}]})),null!=i&&i.defaultPaymentMethodId&&i.defaultPaymentMethodLast4Digits&&i.defaultPaymentExpirationMonth&&i.defaultPaymentExpirationYear&&(o.unshift(a.createElement(h.Divider,{orientation:"vertical",style:{minHeight:93}})),o.unshift(a.createElement(Hr,{title:"Payment method",rows:[{classNamePrefix:"stigg-credit-card",label:"Card",value:"Ending in "+i.defaultPaymentMethodLast4Digits},{classNamePrefix:"stigg-credit-card-expiration",label:"Expires",value:m.padStart(i.defaultPaymentExpirationMonth.toString(),2,"0")+"/"+i.defaultPaymentExpirationYear}]})))),!(l||null!=i&&i.name||null!=i&&i.email||null!=i&&i.defaultPaymentMethodId))return null;var c=l?a.createElement(Wr,null):null!=t&&t.billingPortalUrl?a.createElement(jr,{url:t.billingPortalUrl,text:n.editPaymentDetails,className:"stigg-edit-payment-details-button"}):null;return a.createElement(Jn,{className:"stigg-payment-details-section-layout",$backgroundColor:r.backgroundColor,$borderColor:r.borderColor},a.createElement(jt,{className:"stigg-payment-details-section-header"},a.createElement(Dt,{isLoading:l,className:"stigg-payment-details-section-title",title:"Payment details"}),c),a.createElement("div",{style:{display:"flex",alignItems:"stretch",gap:64}},o))}var Zr=l(Jn,{target:"eqpkdww0"})("position:relative;.stigg-paywall-layout{width:100%;}.stigg-paywall-plans-layout{flex-wrap:nowrap;width:100%;overflow-x:auto;justify-content:unset;padding:0;}.stigg-paywall-plans-layout .stigg-plan-offering-container:first-of-type{margin-left:auto;}.stigg-paywall-plans-layout .stigg-plan-offering-container:last-child{margin-right:auto;}",(function(e){return e.$hideButtons&&c.css(Dr||(Dr=R(["\n .stigg-paywall-plan-button:not([disabled]) {\n display: none;\n }\n "])))})," .","stigg-watermark","{display:none;}"),$r=a.forwardRef((function(e,t){var n=e.paywallComponent,r=e.theme;return n?a.createElement(Zr,{className:"stigg-customer-portal-paywall-section",ref:t,$hideButtons:e.hidePaywallButtons,$backgroundColor:r.backgroundColor,$borderColor:r.borderColor},a.createElement(jt,{className:"stigg-customer-portal-paywall-header"},a.createElement(Dt,{isLoading:e.isLoading,className:"stigg-customer-portal-paywall-section-title",title:e.title})),n):null})),Gr=l("div",{target:"e1gjjeod1"})({name:"6xtw2",styles:"width:100%;display:flex;flex-direction:column;align-items:center;& *{box-sizing:border-box;}"}),zr=l("div",{target:"e1gjjeod0"})({name:"1c31jfu",styles:"width:100%;display:flex;flex-direction:column;align-items:center;row-gap:24px"}),Vr=l("div",{target:"eqqveb80"})("display:flex;flex-direction:column;padding:24px;border:",(function(e){return"1px solid "+e.$borderColor}),";border-radius:10px;row-gap:16px;height:100%;",(function(e){return e.$highlight&&"background-color: "+e.theme.stigg.palette.backgroundSection}),";");function Yr(e){var t,r,i,l,o,c=e.entitlement,s=e.subscriptionPrice,u=e.onManageSubscription,d=e.onBuyMore,p=e.hasCustomSubscription,m=e.canUpgradeSubscription,f=Nt().theme,h=!c.hasUnlimitedUsage&&c.currentUsage>c.usageLimit;return c.feature?a.createElement(Vr,{$highlight:!!s,$borderColor:f.borderColor},a.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:16}},a.createElement(yr,{variant:"body1"},c.feature&&((o=F((l=c.feature).displayName))===F(l.featureUnits||"")||o===F(l.featureUnitsPlural||"")?l.displayName:l.displayName+" ("+l.featureUnitsPlural+")")),s&&a.createElement(fr,{title:a.createElement(V,{variant:"body1"},s.billingModel===n.BillingModel.PerUnit?"Billed for committed usage":"Billed for actual usage")},a.createElement(On,{icon:"DollarCoin",svgStrokeColor:f.iconsColor}))),a.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:8}},a.createElement(yr,{variant:"body1",color:h?"error":"primary","data-testid":"usage-data-"+(null==(t=c.feature)?void 0:t.refId)},null==(r=c.currentUsage)?void 0:r.toLocaleString(),!c.hasUnlimitedUsage&&" / "+(null==(i=c.usageLimit)?void 0:i.toLocaleString())+" ("+Pr(c.currentUsage||0,c.usageLimit)+"%)"),a.createElement(Mr,{entitlement:c,feature:c.feature,onBuyMore:d,canBuyMore:!!s,onManageSubscription:u,canUpgradeSubscription:m,hasCustomSubscription:p})),a.createElement(kr,{entitlement:c}),c.hasUnlimitedUsage||A(c.usageLimit)||A(c.currentUsage)||!c.resetPeriod||!c.nextResetDate?null:a.createElement(V,{color:"secondary"},function(e){if(!e.resetPeriod||!e.nextResetDate)return null;var t=function(t){return g.utc(e.nextResetDate).diff(g.utc(),t)};switch(e.resetPeriod){case"MONTH":return"Resets monthly - in "+t("days")+" days";case"WEEK":return"Resets weekly - in "+t("days")+" days";case"DAY":return"Resets daily - in "+t("hours")+" hours";case"HOUR":return"Resets hourly - in "+t("minutes")+" minutes";default:return null}}(c)),c.hasUnlimitedUsage&&a.createElement(V,{color:"secondary"},"In current billing period")):null}var Qr=l("div",{target:"eoaojje0"})({name:"3hgi0y",styles:"margin-top:32px"});function Kr(){return a.createElement(h.Grid,{container:!0,spacing:4,className:"stigg-subscription-usage-skeleton-layout"},m.range(6).map((function(e){return a.createElement(h.Grid,{key:e,item:!0,xs:4},a.createElement(w,{width:280,height:120}))})))}function Xr(e){var t=e.onManageSubscription,r=e.onBuyMore,i=a.useState(!1),l=i[0],o=i[1],c=Nt(),s=c.customerPortal,u=c.textOverrides,d=c.theme,g=c.isLoading||!s,p=s||{},f=p.entitlements,v=p.subscriptions,y=null==f?void 0:f.filter((function(e){var t,r;return(null==(t=e.feature)?void 0:t.meterType)===n.MeterType.Fluctuating||(null==(r=e.feature)?void 0:r.meterType)===n.MeterType.Incremental})),b=null==v?void 0:v.find((function(e){return e.status===n.SubscriptionStatus.Active})),w=(null==b?void 0:b.pricingType)===n.PricingType.Custom,x=!(null==s||!s.canUpgradeSubscription),E=m.keyBy(null==b?void 0:b.prices,"feature.refId"),P=m.keyBy(y,"feature.refId"),C=m.compact(null==b?void 0:b.prices.map((function(e){return e.feature&&P[e.feature.refId]}))),S=m.compact(null==y?void 0:y.filter((function(e){return!E[e.feature.refId]}))),U=[].concat(C,S),k=U.length>2?4:6,T=l?U:U.slice(0,6);return g||null!=y&&y.length?a.createElement(Jn,{className:"stigg-subscription-usage-layout",$backgroundColor:d.backgroundColor,$borderColor:d.borderColor},a.createElement(jt,null,a.createElement(Dt,{title:u.usageTabTitle,className:"stigg-customer-portal-usage-section-title",isLoading:g})),g?a.createElement(Kr,null):a.createElement(a.Fragment,null,a.createElement(h.Grid,{container:!0,spacing:4},T.map((function(e){return a.createElement(h.Grid,{item:!0,xs:k},a.createElement(Yr,{key:e.feature.refId,subscriptionPrice:E[e.feature.refId],entitlement:e,onManageSubscription:t,onBuyMore:r,hasCustomSubscription:w,canUpgradeSubscription:x}))}))),U.length>6&&a.createElement(Qr,null,a.createElement(Ft,{className:"stigg-usage-toggle-many-button",variant:"text",startIcon:a.createElement(l?N.Minus:N.Plus,null),onClick:function(){return o((function(e){return!e}))}},l?"Show less":"Show more")))):null}function Jr(e){var t=e.onManageSubscription,r=e.onBuyMore,l=e.onCancelScheduledUpdates,o=e.onContactSupport,c=e.paywallComponent,s=e.hiddenSections,u=ct().stigg,d=Nt(),g=d.customerPortal,p=d.textOverrides,m=d.theme,f=d.isLoading,h=i.useRef(null),v=function(){var e;t?t():null==h||null==(e=h.current)||e.scrollIntoView({behavior:"smooth"})},y=null==g?void 0:g.subscriptions.some((function(e){return e.pricingType===n.PricingType.Custom})),b=!(null!=s&&s.some((function(e){return"usage"===e}))),w=!(null!=s&&s.some((function(e){return"paymentDetails"===e||"billingInformation"===e}))),x=!(null!=s&&s.some((function(e){return"invoices"===e||"billingInformation"===e})));return a.createElement(Gr,{className:"stigg-customer-portal-layout"},a.createElement(Fr,{showWatermark:u.isWidgetWatermarkEnabled&&!!g}),a.createElement(zr,{className:"stigg-customer-portal-sections"},a.createElement(Lr,{onCancelScheduledUpdates:l,onBuyMore:r,onManageSubscription:v,onContactSupport:o,hiddenSections:s,cancelScheduledUpdatesButtonTitle:p.cancelScheduledUpdatesButtonTitle}),b&&a.createElement(Xr,{onManageSubscription:v,onBuyMore:r}),a.createElement($r,{ref:h,paywallComponent:c,hidePaywallButtons:!!y,theme:m,title:p.paywallSectionTitle,isLoading:!g||f}),w&&a.createElement(qr,null),x&&a.createElement(ni,null)))}var ei,ti=["textOverrides","theme","resourceId","productId"];function ni(){var e=Nt(),t=e.customerPortal,n=e.textOverrides,r=e.theme,i=!t||e.isLoading,l=i?a.createElement(Wr,null):null!=t&&t.billingPortalUrl?a.createElement(jr,{url:t.billingPortalUrl,text:n.viewInvoiceHistory,className:"stigg-view-invoice-history-button"}):null;return i||null!=t&&t.billingPortalUrl?a.createElement(Jn,{className:"stigg-invoices-section-layout",$backgroundColor:r.backgroundColor,$borderColor:r.borderColor},a.createElement(jt,{className:"stigg-invoices-section-header"},a.createElement(Dt,{isLoading:i,className:"stigg-invoices-section-title",title:n.invoicesTitle}),l)):null}(ei=exports.ProvisionStatus||(exports.ProvisionStatus={})).IN_PROGRESS="IN_PROGRESS",ei.SUCCEEDED="SUCCEEDED",ei.FAILED="FAILED",Object.keys(n).forEach((function(e){"default"!==e&&Object.defineProperty(exports,e,{enumerable:!0,get:function(){return n[e]}})})),exports.AddonsList=Ht,exports.CustomerPortal=function(e){var t=e.textOverrides,n=e.theme,r=e.resourceId,i=e.productId,l=D(e,ti);return a.createElement(Lt,{textOverrides:t,theme:n,resourceId:r,productId:i},a.createElement(Jr,Object.assign({},l)))},exports.CustomerPortalProvider=Lt,exports.CustomerUsageData=Xr,exports.InvoicesSection=ni,exports.PaymentDetailsSection=qr,exports.Paywall=function(e){var t=e.productId,r=e.resourceId,l=e.highlightedPlanId,o=e.showOnlyEligiblePlans,c=e.textOverrides,s=e.onPlanSelected,d=e.preferredBillingPeriod,m=e.onBillingPeriodChange,f=e.billingCountryCode,h=!!i.useContext(Bt),v=!1;if(h){var y=Nt();v=y.isLoading,r=y.resourceId}var b=function(e){var t=e.productId,r=e.resourceId,a=e.showOnlyEligiblePlans,l=e.billingCountryCode,o=e.preferredBillingPeriod,c=ct(),s=c.stigg,u=c.locale,d=i.useState(n.BillingPeriod.Annually),m=d[0],f=d[1],h=i.useState([]),v=h[0],y=h[1],b=i.useState(null),w=b[0],E=b[1],P=i.useState(!0),C=P[0],S=P[1];i.useEffect((function(){!function(){var e=I(at.mark((function e(){var n,i,a,c;return at.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,S(!0),e.next=4,s.waitForInitialization();case 4:return e.next=6,s.getPaywall({productId:t,resourceId:r,billingCountryCode:l});case 6:i=st((n=e.sent).plans,o),a=i.availableBillingPeriods,c=i.defaultBillingPeriod,E(n),y(a),f(c),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(0),lt.error("Failed to load paywall "+(null==e.t0?void 0:e.t0.message),e.t0);case 16:return e.prev=16,S(!1),e.finish(16);case 19:case"end":return e.stop()}}),e,null,[[0,13,16,19]])})));return function(){return e.apply(this,arguments)}}()()}),[s,t,s.isCustomerLoaded,l,r]);var U=function(e,t){var r,i=e||{},a=i.plans,l=i.currency,o=i.configuration,c=i.customer,s=i.paywallCalculatedPricePoints,u=function(e){var t,r,i,a=!0,l=(null==e?void 0:e.find((function(e){return e.status===n.SubscriptionStatus.InTrial})))||null,o=null==(t=l)?void 0:t.plan,c=null!=(r=l)&&r.trialEndDate?g.utc(l.trialEndDate).diff(g.utc(),"days",!1)+1:void 0;return o||(a=!1,o=null==(i=l=(null==e?void 0:e.find((function(e){return e.status===n.SubscriptionStatus.Active})))||null)?void 0:i.plan),{currentSubscription:l,currentPlan:o,isCustomerOnTrial:a,trialDaysLeft:c}}(i.activeSubscriptions),d=u.currentSubscription,m=u.currentPlan,f=u.isCustomerOnTrial,h=u.trialDaysLeft,v=(null==d?void 0:d.scheduledUpdates)||[],y=null==d||null==(r=d.price)?void 0:r.billingPeriod,b=v.find((function(e){return e.subscriptionScheduleType===n.SubscriptionScheduleType.Downgrade})),w=v.find((function(e){return e.subscriptionScheduleType===n.SubscriptionScheduleType.BillingPeriod})),E=x(a,(function(e){return e.order})).map((function(e){var t,n=null==c||null==(t=c.eligibleForTrial)?void 0:t.find((function(t){return t.productId===e.product.id})),r=e.id===(null==m?void 0:m.id);return j({},e,{paywallCalculatedPricePoints:null==s?void 0:s.filter((function(t){return t.planId===e.id})),isTriable:!p(e.defaultTrialConfig)&&(!n||n.eligible),isCurrentCustomerPlan:r,currentCustomerPlanBillingPeriod:y,isUpcomingPlan:!1,trialDaysLeft:h,isNextPlan:function(t){var n,i=null==b?void 0:b.scheduleVariables,a=null==w?void 0:w.scheduleVariables,l=e.pricePoints.some((function(e){return e.billingPeriod===t}));return b?(null==(n=b.targetPackage)?void 0:n.refId)===e.id&&(!l||i.billingPeriod===t):!(!w||!r)&&a.billingPeriod===t},paywallCurrency:l,scheduledUpdate:b||w})}));if(a&&m){var P,C=m&&(null==a||null==(P=a.find((function(e){return e.id===(null==m?void 0:m.id)})))?void 0:P.order);p(C)||(E=E.map((function(e){return j({},e,{isLowerThanCurrentPlan:C>e.order})})),t&&(E=E.filter((function(e){return e.order>C}))))}var S=o?function(e){var t=e.palette,n=e.layout;return{customCss:e.customCss||void 0,palette:{primary:(null==t?void 0:t.primary)||void 0,backgroundPaper:(null==t?void 0:t.backgroundColor)||void 0,outlinedBorder:(null==t?void 0:t.borderColor)||void 0,backgroundHighlight:(null==t?void 0:t.currentPlanBackground)||void 0,text:{primary:(null==t?void 0:t.textColor)||void 0}},typography:gt(e),layout:{ctaAlignment:pt(null==n?void 0:n.alignment),headerAlignment:pt(null==n?void 0:n.alignment),descriptionAlignment:pt(null==n?void 0:n.alignment),planMaxWidth:ut(null==n?void 0:n.planWidth),planMinWidth:ut(null==n?void 0:n.planWidth),planMargin:ut(null==n?void 0:n.planMargin),planPadding:ut(null==n?void 0:n.planPadding)}}}(o):void 0;return{currentPlan:m,currentSubscription:d,isCustomerOnTrial:f,plans:E,paywallConfiguration:S}}(w,a);return j({customer:(null==w?void 0:w.customer)||null,isLoading:C,selectedBillingPeriod:m,setSelectedBillingPeriod:f,availableBillingPeriods:v,locale:u,configuration:U.paywallConfiguration},U)}({productId:t,resourceId:r,showOnlyEligiblePlans:o,billingCountryCode:f,preferredBillingPeriod:d}),w=b.plans,E=b.customer,P=b.currentSubscription,C=b.isCustomerOnTrial,S=b.isLoading,U=b.selectedBillingPeriod,k=b.setSelectedBillingPeriod,T=b.availableBillingPeriods,M=b.locale,B=b.configuration,N=u({highlightChip:"Recommended",planCTAButton:{upgrade:"Upgrade",downgrade:"Downgrade",startTrial:function(e){var t;return"Start "+(null==(t=e.defaultTrialConfig)?void 0:t.duration)+" day trial"},custom:"Contact us",currentPlan:"Current plan",startNew:"Get started",switchToBillingPeriod:function(e){return e===n.BillingPeriod.Monthly?"Switch to monthly billing":"Switch to annual billing"},cancelScheduledUpdate:"Cancel"},price:{startingAtCaption:"Starts at",free:function(e){return{price:(null==e?void 0:e.symbol)+"0"}},custom:"Custom",priceNotSet:"Price not set"}},c),L=!w||S||v?a.createElement(Pt,null):a.createElement(it,{plans:w,customer:E,currentSubscription:P,selectedBillingPeriod:U,onBillingPeriodChanged:function(e){k(e),m&&m(e)},availableBillingPeriods:T,highlightedPlanId:l,isLoading:S,isCustomerOnTrial:C,onPlanSelected:s,paywallLocale:N,locale:M});return h?L:a.createElement(Mt,{componentTheme:B},L)},exports.Promotions=qt,exports.StiggContext=ot,exports.StiggProvider=function(e){var t=e.apiKey,n=e.baseUri,l=e.baseEdgeUri,o=e.enableEdge,c=e.customerId,s=e.customerToken,u=e.resourceId,d=e.theme,g=e.locale,p=e.useEntitlementPolling,m=e.entitlementPollingInterval,f=e.entitlementsFallback,h=e.stiggClient,v=e.children,y=i.useRef(t),w={apiKey:t,customerId:c,customerToken:s,resourceId:u,baseUri:n,baseEdgeUri:l,enableEdge:o,entitlementsFallback:f,useEntitlementPolling:p,entitlementPollingInterval:m},x=i.useState((function(){return{stigg:null!=h?h:r.initialize(j({},w,{lazyLoad:!0})),locale:g||"en-US",isInitialized:!1,theme:d,refreshData:(e=I(at.mark((function e(){return at.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return P((function(e){return j({},e,{customerPortalUpdatedAt:new Date})})),e.next=3,E.stigg.refresh();case 3:case"end":return e.stop()}}),e)}))),function(){return e.apply(this,arguments)})};var e})),E=x[0],P=x[1];return i.useEffect((function(){var e=!0,n=function(t){e&&P(t)},i=function(){return n((function(e){return j({},e,{updatedAt:new Date})}))},a=function(e){return n((function(t){return t.stigg&&t.stigg.removeListener("entitlementsUpdated",i),e.addListener("entitlementsUpdated",i),j({},t,{stigg:e,isInitialized:!0,updatedAt:new Date})}))};return function(){var e=I(at.mark((function e(){var i;return at.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=E.stigg,t!==y.current&&(lt.log("Updating stigg client",{apiKey:t}),y.current=t,i=r.initialize(j({},w)),n((function(e){return j({},e,{isInitialized:!1,updatedAt:new Date})}))),e.next=4,i.waitForInitialization();case 4:a(i);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()(),function(){e=!1,E.stigg.removeListener("entitlementsUpdated",i),E.stigg.clearCustomer()}}),[t]),i.useEffect((function(){var e=E.stigg;c?e.setCustomerId(c,s,u):e.clearCustomer()}),[c,s,u]),i.useEffect((function(){P((function(e){return j({},e,{theme:d})}))}),[d]),a.createElement(ot.Provider,{value:E},a.createElement(b.SkeletonTheme,{baseColor:"#F5F6F9",highlightColor:"#e5e6ea"},v))},exports.SubscriptionsOverview=Lr,exports.useStiggContext=ct,exports.useWaitForCheckoutCompleted=function(e){var t,n=void 0===e?{}:e,r=n.onProvisionStart,a=n.onProvisionSucceeded,l=n.onProvisionFailed,o=ct().stigg,c=i.useState(exports.ProvisionStatus.IN_PROGRESS),s=c[0],u=c[1],d=i.useState(!1),g=d[0],p=d[1],m=i.useMemo((function(){var e=new URLSearchParams(window.location.search);return t?e.get(t):e}),[t="checkoutCompleted",window.location.search]);return i.useEffect((function(){!function(){var e=I(at.mark((function e(){var t;return at.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(m&&"false"!==m.toLowerCase()&&!g){e.next=2;break}return e.abrupt("return");case 2:return p(!0),r&&r(),e.prev=4,e.next=7,o.waitForCheckoutCompleted();case 7:t=e.sent,u(exports.ProvisionStatus.SUCCEEDED),a&&a(t),e.next=17;break;case 12:e.prev=12,e.t0=e.catch(4),console.error("Failed to wait for checkout to complete",e.t0),u(exports.ProvisionStatus.FAILED),l&&l(e.t0);case 17:return e.prev=17,p(!1),e.finish(17);case 20:case"end":return e.stop()}}),e,null,[[4,12,17,20]])})));return function(){return e.apply(this,arguments)}}()()}),[o,m]),{isAwaitingCheckout:g,provisionStatus:s}};
1
+ "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t,n=require("@stigg/js-client-sdk"),r=e(n),i=require("react"),a=e(i),l=e(require("@emotion/styled/base")),o=require("styled-typography"),c=require("@emotion/react"),s=e(require("color")),u=e(require("lodash/merge")),d=e(require("react-spinners/ClipLoader")),p=e(require("moment")),g=e(require("lodash/isNil")),m=require("lodash"),f=e(require("classnames")),h=require("@mui/material"),v=e(require("currency-symbol-map")),y=e(require("react-switch")),b=require("react-loading-skeleton"),w=e(b),x=e(require("lodash/sortBy")),E=require("@mui/material/styles"),P=require("styled-components"),C=e(P),S=e(require("@mui/material/Button")),U=e(require("lodash/flatMap")),T=e(require("@mui/material/Box")),k=e(require("@mui/material/Tab")),M=e(require("lodash/isEmpty")),N=e(require("@mui/material/Tabs")),B=require("react-feather"),L=e(require("@mui/material/LinearProgress")),A=e(require("lodash/isUndefined")),F=e(require("lodash/lowerCase"));function I(e,t,n,r,i,a,l){try{var o=e[a](l),c=o.value}catch(e){return void n(e)}o.done?t(c):Promise.resolve(c).then(r,i)}function O(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var a=e.apply(t,n);function l(e){I(a,r,i,l,o,"next",e)}function o(e){I(a,r,i,l,o,"throw",e)}l(void 0)}))}}function j(){return(j=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function D(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)t.indexOf(n=a[r])>=0||(i[n]=e[n]);return i}function R(e,t){return t||(t=e.slice(0)),e.raw=t,e}function _(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function H(){return(H=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var W=function(e){return i.createElement("svg",H({width:15,height:11,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),t||(t=i.createElement("path",{d:"M5.59 7.99 2.125 4.525A1 1 0 1 0 .71 5.94l4.88 4.88 8.705-8.705a.997.997 0 0 0-1.41-1.41L5.59 7.99Z",fill:"#B2BBD3"})))},q=["children","span","style","fontWeight","variant","color","overrideColor","bold"];function Z(e,t){switch(t){case"white":return"white";case"primary.main":return e.stigg.palette.primary;case"warning":return e.stigg.palette.warning;case"error":return e.stigg.palette.error;default:return e.stigg.palette.text[t]}}var $=l(o.Text,{target:"ewjez2x0"})("margin:0;",(function(e){return e.$span&&"display: inline"}),";");function G(e){switch(e){case"bold":return o.FontWeight.Bold;case"normal":default:return o.FontWeight.Normal}}function z(e,t){var n=e.stigg.typography;switch(t){case"h1":return G(n.h1.fontWeight);case"h3":return G(n.h2.fontWeight);case"h6":return G(n.h3.fontWeight);case"body1":return G(n.body.fontWeight);case"caption":return G(n.caption.fontWeight);default:return o.FontWeight.Normal}}var V=i.forwardRef((function(e,t){var n=e.children,r=e.span,i=e.style,l=e.fontWeight,s=e.variant,u=void 0===s?"body1":s,d=e.color,p=void 0===d?"primary":d,g=e.overrideColor,m=e.bold,f=D(e,q),h=c.useTheme(),v=function(e){switch(e){case"h1":return 1;case"h3":return 2;case"h6":return 3;case"body1":return 4;case"caption":return 5;default:return 3}}(u),y="typography-level-"+v;return a.createElement($,Object.assign({ref:t},f,{className:e.className?e.className+" "+y:y,style:i,level:v,color:g||Z(h,p),fontWeight:null!=l?l:m?o.FontWeight.Bold:z(h,u),$span:r}),n)})),Y=["displayNameOverride"],Q=l(V,{target:"e1mddeqb2"})({name:"ti75j2",styles:"margin:0"}),K=l("div",{target:"e1mddeqb1"})({name:"s5xdrg",styles:"display:flex;align-items:center"}),X=l(W,{target:"e1mddeqb0"})("margin-right:16px;flex-shrink:0;*{fill:",(function(e){return e.theme.stigg.palette.text.disabled}),";}");function J(e){var t=e.displayNameOverride,r=function(e){var t=e.hasUnlimitedUsage,r=e.feature,i=e.resetPeriod,a=e.usageLimit,l=e.minUnitQuantity,o=e.maxUnitQuantity,c=e.isCustom,s=l||o,u=i&&a?""+function(e){if(!e)return"";switch(e){case n.EntitlementResetPeriod.Day:return"per day";case n.EntitlementResetPeriod.Hour:return"per hour";case n.EntitlementResetPeriod.Week:return"per week";case n.EntitlementResetPeriod.Month:return"per month"}}(i):"";if(t)return"Unlimited "+(null==r?void 0:r.unitsPlural);if(c)return"Custom "+(null==r?void 0:r.unitsPlural);if(a){var d=1===a?null==r?void 0:r.units:null==r?void 0:r.unitsPlural;return function(e){return e.toLocaleString("en-US",{maximumFractionDigits:0})}(a)+" "+d+" "+u}return s?function(e,t,n){return e&&1!==e||!t?e&&e>1&&t?e+"-"+t+" "+n:e&&e>1?"Minimum "+e+" "+n:"":"Up to "+t+" "+n}(l,o,null==r?void 0:r.unitsPlural):null==r?void 0:r.displayName}(D(e,Y));return a.createElement(K,{className:"stigg-entitlement-row-container"},a.createElement(X,{className:"stigg-entitlement-row-icon"}),a.createElement(Q,{className:"stigg-entitlement-name",variant:"h6",color:"secondary"},t||r))}var ee,te=l("div",{target:"e1yz7zcg0"})({name:"budh8k",styles:"display:flex;flex-direction:column;gap:16px"});function ne(e){var t,r=e.plan,i=e.billingPeriod,l=e.paywallLocale,o=null==(t=r.pricePoints)?void 0:t.filter((function(e){return e.billingPeriod===i})),c=null==o?void 0:o.map((function(e){var t;return(null==e?void 0:e.minUnitQuantity)&&(null==e?void 0:e.minUnitQuantity)>1||(null==e?void 0:e.maxUnitQuantity)?a.createElement(J,{key:"priceUnitEntitlement-"+(null==e||null==(t=e.feature)?void 0:t.displayName),feature:null==e?void 0:e.feature,minUnitQuantity:null==e?void 0:e.minUnitQuantity,maxUnitQuantity:null==e?void 0:e.maxUnitQuantity}):null}));return a.createElement(te,{className:"stigg-plan-entitlements-container"},a.createElement(V,{className:"stigg-plan-entitlements-title",color:"secondary",variant:"h6",bold:!0},function(e,t){if(t.entitlementsTitle)return t.entitlementsTitle(e);var n=e.displayName+" includes";return e.basePlan&&(n="Everything in "+e.basePlan.displayName+", plus:"),n}(r,l)),c,r.entitlements.filter((function(e){return!(e.hiddenFromWidgets||[]).includes(n.WidgetType.Paywall)})).map((function(e){var t;return a.createElement(J,{key:null==(t=e.feature)?void 0:t.id,displayNameOverride:e.displayNameOverride,feature:e.feature,resetPeriod:e.resetPeriod,hasUnlimitedUsage:e.hasUnlimitedUsage,usageLimit:e.usageLimit,isCustom:e.isCustom})})))}(ee=exports.SubscribeIntentionType||(exports.SubscribeIntentionType={})).START_TRIAL="START_TRIAL",ee.UPGRADE_TRIAL_TO_PAID="UPGRADE_TRIAL_TO_PAID",ee.REQUEST_CUSTOM_PLAN_ACCESS="REQUEST_CUSTOM_PLAN_ACCESS",ee.CHANGE_BILLING_PERIOD="CHANGE_BILLING_PERIOD",ee.CHANGE_UNIT_QUANTITY="CHANGE_UNIT_QUANTITY",ee.UPGRADE_PLAN="UPGRADE_PLAN",ee.DOWNGRADE_PLAN="DOWNGRADE_PLAN",ee.CANCEL_SCHEDULED_UPDATES="CANCEL_SCHEDULED_UPDATES";var re,ie,ae=function(e){return{left:"flex-start",center:"center",right:"flex-end"}[e]},le=function(e){return p.utc(e).format("MMMM Do, yyyy")};function oe(e){var t=e.scheduledUpdate,r=e.subscriptionPrices,i=e.billingPeriodRange,l=e.options,o=void 0===l?{}:l;if(!t)return{};var c=o.withDate,s=o.postfix,u=void 0===s?"":s;switch(t.subscriptionScheduleType){case n.SubscriptionScheduleType.Downgrade:var d,f=c;return g(f)&&null!=i&&i.end&&(f=!p(t.scheduledExecutionTime).isSame(null==i?void 0:i.end,"day")),{line1:a.createElement(a.Fragment,null,"Your subscription will be downgraded to the ",a.createElement("b",null,null==(d=t.targetPackage)?void 0:d.displayName," plan")," ",f?a.createElement(a.Fragment,null,"on ",le(t.scheduledExecutionTime)):u,"."),line2:"Until then you still have access to your current plan."};case n.SubscriptionScheduleType.BillingPeriod:var h;return{line1:a.createElement(a.Fragment,null,"Your billing cycle will change to ",a.createElement("b",null,null==(h=t.scheduleVariables.billingPeriod)?void 0:h.toLocaleLowerCase())," ",c?a.createElement(a.Fragment,null,"on ",le(t.scheduledExecutionTime)):u,".")};case n.SubscriptionScheduleType.UnitAmount:var v=t.scheduleVariables,y=m.compact(m.map(r,"feature")).find((function(e){return e.id===v.featureId}))||{},b=y.featureUnits,w=1===v.newUnitAmount?b:y.featureUnitsPlural;return{line1:a.createElement(a.Fragment,null,"Your subscription will be updated to ",a.createElement("b",null,v.newUnitAmount)," ",w," ",c?a.createElement(a.Fragment,null,"on ",le(t.scheduledExecutionTime)):u,"."),line2:"Until then you still have access to your current "+b+" count."};default:return{}}}function ce(e,t,r,i){switch(e.tiersMode){case n.TiersMode.Volume:return(r===n.BillingPeriod.Annually&&i?t.unitPrice.amount/12:t.unitPrice.amount)*t.upTo}return 0}function se(e,t,r,i){var a=e.pricePoints.filter((function(e){return e.billingPeriod===t&&e.isTieredPrice}));if(1==a.length){var l,o=a[0],c=o.feature.featureId,s=o.tiers[0];if(i[c])s=(null==(l=o.tiers)?void 0:l.find((function(e){return e.upTo===i[c].upTo})))||s;else if(r){var u=r.prices.find((function(e){var r;return e.pricingModel==n.BillingModel.PerUnit&&e.billingPeriod==t&&e.tiersMode&&(null==(r=e.feature)?void 0:r.featureId)===c}));u&&(s=u.tiers.find((function(e){return e.upTo===u.feature.unitQuantity}))||u.tiers[0])}var d={};return d[c]=s,d}return{}}!function(e){e[e.Lower=-1]="Lower",e[e.Equal=0]="Equal",e[e.Higher=1]="Higher"}(re||(re={}));var ue,de=l(d,{target:"e199qof96"})({name:"1a2afmv",styles:"margin-left:10px"}),pe=l("button",{target:"e199qof95"})("cursor:",(function(e){return e.$disabled?"default":"pointer"}),";padding:8px 12px;background-color:",(function(e){return e.theme.stigg.palette.backgroundButton}),";border:",(function(e){return"1px solid "+e.theme.stigg.palette.outlinedRestingBorder}),";border-radius:10px;display:flex;align-items:center;justify-content:center;min-height:42px;min-width:120px;",(function(e){return e.$disabled&&c.css(ie||(ie=R(["\n opacity: 0.5;\n "])))})," &:hover{background-color:",(function(e){var t=e.theme;return e.$disabled?t.stigg.palette.backgroundButton:t.stigg.palette.outlinedHoverBackground}),";}"),ge=l(V,{target:"e199qof94"})({name:"h05omw",styles:"margin:0;font-size:15px"}),me=l(V,{target:"e199qof93"})({name:"1cnls12",styles:"min-height:87px"}),fe=l("button",{target:"e199qof92"})("background:none;border:none;padding:0;color:",(function(e){return e.theme.stigg.palette.text.secondary}),";text-decoration:underline;cursor:pointer;"),he=l(V,{target:"e199qof91"})({name:"1etgg0o",styles:"margin-top:8px;margin-bottom:17px;min-height:20px"}),ve=l("div",{target:"e199qof90"})("display:flex;flex-direction:column;margin-top:4px;align-self:",(function(e){return ae(e.theme.stigg.layout.ctaAlignment)}),";width:100%;");function ye(e){var t=e.isNextPlan,r=e.customer,l=e.plan,o=e.billingPeriod,s=e.isCustomerOnTrial,u=e.onPlanSelected,d=e.paywallLocale,p=e.hasTiersRow,g=e.withTrialLeftRow,f=e.currentSubscription,h=e.selectedTierByFeature,v=c.useTheme(),y=i.useState(!1),b=y[0],w=y[1],x=d.planCTAButton,E=x.currentPlan,P=x.custom,C=x.downgrade,S=x.startTrial,U=x.upgrade,T=x.startNew,k=x.switchToBillingPeriod,M=x.cancelScheduledUpdate,N=m.isFunction(C)?C(l):C,B=m.isFunction(U)?U(l):U,L={title:r?l.isLowerThanCurrentPlan?N:B:T,disabled:!1,intentionType:l.isLowerThanCurrentPlan?exports.SubscribeIntentionType.DOWNGRADE_PLAN:s?exports.SubscribeIntentionType.UPGRADE_TRIAL_TO_PAID:exports.SubscribeIntentionType.UPGRADE_PLAN},A=l.pricingType===n.PricingType.Custom,F=oe({scheduledUpdate:l.scheduledUpdate,options:{withDate:!0}}).line1;if(!l.isTriable||l.isCurrentCustomerPlan||s)if(l.isCurrentCustomerPlan&&!s)if(o===l.currentCustomerPlanBillingPeriod||l.pricingType&&[n.PricingType.Free,n.PricingType.Custom].includes(l.pricingType))switch(function(e,t){if(!t||!e)return re.Equal;var r=t.prices.find((function(e){return e.pricingModel==n.BillingModel.PerUnit&&e.tiersMode}));if(!r)return re.Equal;var i=r.feature,a=i.unitQuantity;if(!a)return re.Equal;var l=e[i.featureId];return l?l.upTo<a?re.Lower:l.upTo>a?re.Higher:re.Equal:re.Equal}(h,f)){case re.Lower:L.intentionType=exports.SubscribeIntentionType.CHANGE_UNIT_QUANTITY,L.title=N;break;case re.Higher:L.intentionType=exports.SubscribeIntentionType.CHANGE_UNIT_QUANTITY,L.title=B;break;default:L.title=E,L.disabled=!0}else L.title=k(o),L.intentionType=exports.SubscribeIntentionType.CHANGE_BILLING_PERIOD;else A&&(L.title=P,L.intentionType=exports.SubscribeIntentionType.REQUEST_CUSTOM_PLAN_ACCESS);else L.title=S(l),L.intentionType=exports.SubscribeIntentionType.START_TRIAL;t&&l.scheduledUpdate&&(L.disabled=!1,L.title=M,L.intentionType=exports.SubscribeIntentionType.CANCEL_SCHEDULED_UPDATES);var I=b||L.disabled;return a.createElement(a.Fragment,null,a.createElement(ve,{className:"stigg-paywall-plan-button-layout"},t&&F?a.createElement(me,{color:"secondary",variant:"body1",className:"stigg-paywall-schedule-update-text"},F," ",a.createElement(fe,{color:"secondary",onClick:function(){w(!0),Promise.resolve(u(L.intentionType)).finally((function(){return w(!1)}))}},L.title)):a.createElement(a.Fragment,null,a.createElement(pe,{className:"stigg-paywall-plan-button","data-testid":"paywall-card-cta-"+l.displayName,disabled:I,$disabled:I,onClick:function(){w(!0),Promise.resolve(u(L.intentionType)).finally((function(){return w(!1)}))}},a.createElement(ge,{className:"stigg-paywall-plan-button-text",variant:"h6",color:"primary.main"},L.title),b&&a.createElement(de,{color:v.stigg.palette.text.disabled,loading:!0,size:16})),p&&!g?a.createElement("div",{style:{height:"20px"}}):a.createElement(he,{className:"stigg-trial-days-left-text",variant:"h6",color:"secondary"},l.isCurrentCustomerPlan&&l.trialDaysLeft&&a.createElement(a.Fragment,null,a.createElement("b",null,l.trialDaysLeft," days")," left on your free trial")))))}function be(){return(be=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var we=function(e){return i.createElement("svg",be({width:16,height:16,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ue||(ue=i.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.954 1.034A1 1 0 0 1 6.3 2.287a5.666 5.666 0 1 0 7.367 5.406 1 1 0 0 1 2 0c0 .23-.01.458-.03.684.01.072.012.147.006.223l-.004.049a1 1 0 0 1-.078.312A7.668 7.668 0 1 1 5.7.38a1 1 0 0 1 1.254.654Zm.614.239A1 1 0 0 1 8.648.36l.05.004a1 1 0 1 1-.182 1.992l-.037-.003a1 1 0 0 1-.911-1.081Zm4.85 1.636a1 1 0 0 1 1.41.11l.064.076a1 1 0 1 1-1.537 1.28 4.154 4.154 0 0 0-.047-.056 1 1 0 0 1 .11-1.41ZM9 5.334a1 1 0 0 0-2 0V8a1 1 0 0 0 1 1h2.667a1 1 0 1 0 0-2H9V5.334Z",fill:"#7586B0"})))},xe=function(e){var t=e.amount,r=e.currency,i=e.locale,a=e.maximumFractionDigits,l=void 0===a?5:a,o=(void 0===r?n.Currency.Usd:r).toString(),c=v(o),s=new Intl.NumberFormat(i,j({maximumFractionDigits:l,minimumFractionDigits:0,style:"currency",currency:o},c?{currencyDisplay:"code"}:{})).format(t||0);return c&&(s=s.replace(o,c)),s.replace(/\s/g,"")};function Ee(e,t,r,i,a,l){switch(e.pricingType){case n.PricingType.Free:return"function"==typeof r.price.free?r.price.free(e.paywallCurrency):r.price.free;case n.PricingType.Custom:return{price:r.price.custom};case n.PricingType.Paid:var o,c=e.pricePoints.filter((function(e){return e.billingPeriod===t})),s=null==(o=e.paywallCalculatedPricePoints)?void 0:o.find((function(e){return e.billingPeriod===t}));if(!(null!=c&&c.length||s))return{price:r.price.priceNotSet};var u={planPrices:c,paywallCalculatedPrice:s,selectedBillingPeriod:t,selectedTierByFeature:l||{}};return r.price.paid?r.price.paid(j({},u,{plan:e})):function(e){for(var t,r,i,a=e.planPrices,l=e.selectedBillingPeriod,o=e.locale,c=e.shouldShowMonthlyPriceAmount,s=e.selectedTierByFeature,u=e.paywallCalculatedPrice||a[0],d=u.currency,p=u.amount||0,g=1===a.length,m=l===n.BillingPeriod.Annually&&c?p/12:p,f=c?"/ month":"/ year",h=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return _(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_(e,void 0):void 0}}(e))){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(a);!(i=h()).done;){var v=i.value;if(v.isTieredPrice){var y=v.tiers[0];s[v.feature.featureId]&&(y=s[v.feature.featureId]||y,t=v.tiers,r=v.feature.unitsPlural||""),m+=ce(v,y,l,c)}}if(g){var b,w=a[0],x=(null==(b=w.feature)?void 0:b.units)||"";w.pricingModel!==n.BillingModel.PerUnit||w.isTieredPrice?w.pricingModel===n.BillingModel.UsageBased&&(f="per "+x):f=c?"per "+x+" / month":"per "+x+" / year"}return{price:xe({amount:m,currency:d,locale:o}),unit:f,tiers:t,tierUnits:r}}(j({},u,{locale:i,shouldShowMonthlyPriceAmount:a}));default:return{price:""}}}var Pe=l(h.Select,{target:"exuepap1"})("border-radius:10px;&:hover .MuiOutlinedInput-notchedOutline{border-color:",(function(e){return e.theme.stigg.palette.outlinedBorder}),";}"),Ce=l(h.OutlinedInput,{target:"exuepap0"})("& .MuiInputBase-input{padding:7px 12px;}&.Mui-focused .MuiOutlinedInput-notchedOutline{border-color:",(function(e){return e.theme.stigg.palette.primary}),"!important;}");function Se(e){var t=e.tiers,n=e.tierUnits,r=e.selectedTier,i=e.handleTierChange;return a.createElement(V,{className:"stigg-price-tier-select",style:{minHeight:"46px"}},t?a.createElement(Pe,{labelId:"demo-simple-select-label",id:"select_"+e.plan.id,value:r?r.upTo.toString():t[0].upTo.toString(),fullWidth:!0,onChange:function(e,n){i(t.find((function(t){return t.upTo.toString()===e.target.value})))},input:a.createElement(Ce,null),MenuProps:{MenuListProps:{disablePadding:!0},PaperProps:{sx:{marginTop:"4px",borderRadius:"10px"}}}},m.map(t,(function(e){return a.createElement(h.MenuItem,{className:"stigg-price-tier-menu-item-text",key:e.upTo,value:e.upTo.toString()},a.createElement(V,{variant:"body1",color:"primary"},e.upTo," ",n))}))):a.createElement("div",null))}var Ue=l(V,{target:"e1gsqbi12"})({name:"bfvx8c",styles:"word-break:break-word;width:100%"}),Te=l(V,{target:"e1gsqbi11"})({name:"1bmnxg7",styles:"white-space:nowrap"}),ke=l(V,{target:"e1gsqbi10"})({name:"nurf5y",styles:"white-space:normal;min-height:39px"});function Me(e){var t=e.billingPeriod,n=e.hasMonthlyPrice,r=e.hasAnnuallyPrice,i="‎";return e.plan.pricePoints.find((function(e){return e.billingPeriod===t}))&&n&&r&&(i=", billed "+t.toLowerCase()),a.createElement(V,{span:!0,className:"stigg-price-billing-period-text",variant:"h6",color:"secondary"},i)}var Ne=function(e){var t=e.showStartingAt,n=e.withUnitPriceRow,r=e.withStartingAtRow,l=e.withTiersRow,o=e.selectedTierByFeature,c=e.setSelectedTierByFeature,s=e.plan,u=e.billingPeriod,d=e.paywallLocale,p=e.hasMonthlyPrice,g=e.hasAnnuallyPrice,m=Ee(s,u,d,e.locale,p,o),f=m.price,h=m.unit,v=m.tiers,y=m.tierUnits,b=i.useState(),w=b[0],x=b[1];i.useEffect((function(){x(o[P])}),[o]);var E=s.pricePoints.find((function(e){return e.billingPeriod===u&&e.isTieredPrice})),P=E?E.feature.featureId:void 0,C=function(e){var t={};t[P]=e,c(t)};return i.useEffect((function(){v&&C(o[P])}),[]),a.createElement(Ue,{className:"stigg-price-text"},a.createElement(a.Fragment,null,r&&a.createElement(V,{style:{minHeight:"20px"},className:"stigg-starting-at-text",variant:"body1",color:"secondary"},t?d.price.startingAtCaption:"‎"),a.createElement(ke,{variant:"h1"},f),n&&a.createElement(V,{className:"stigg-price-unit-and-billing-period-text",style:{minHeight:"48px"}},a.createElement(Te,{span:!0,variant:"h6",color:"secondary"},h),a.createElement(Me,{plan:s,billingPeriod:u,hasAnnuallyPrice:g,hasMonthlyPrice:p})),l&&a.createElement(Se,{plan:s,tiers:v,tierUnits:y,selectedTier:w,handleTierChange:C})))},Be=l("div",{target:"eacdu8d8"})("position:relative;background-color:",(function(e){var t=e.theme;return e.$isCurrentPlan?t.stigg.palette.backgroundHighlight:t.stigg.palette.backgroundPaper}),";border:",(function(e){var t=e.theme;return e.$isHighlighted?"3px solid "+t.stigg.palette.primary:"1px solid "+t.stigg.palette.outlinedBorder}),";border-radius:10px;padding:",(function(e){return e.theme.stigg.layout.planPadding}),";display:flex;min-width:",(function(e){return e.theme.stigg.layout.planMinWidth}),";max-width:",(function(e){return e.theme.stigg.layout.planMaxWidth}),";flex-direction:column;align-items:flex-start;justify-content:flex-start;position:relative;"),Le=l(V,{target:"eacdu8d7"})({name:"mpkj0c",styles:"padding-bottom:8px"}),Ae=l("div",{target:"eacdu8d6"})("height:2px;width:100%;background-color:",(function(e){return e.theme.stigg.palette.outlinedBorder}),";margin-bottom:40px;"),Fe=l(V,{target:"eacdu8d5"})("text-align:",(function(e){return e.theme.stigg.layout.descriptionAlignment}),";min-height:",(function(e){return e.theme.stigg.layout.descriptionMinHeight}),";"),Ie=l("div",{target:"eacdu8d4"})("background-color:",(function(e){return e.theme.stigg.palette.primary}),";border-radius:40px;position:absolute;top:-12px;"),Oe=l(V,{target:"eacdu8d3"})({name:"a8c38r",styles:"margin:0;padding:2px 8px"}),je=l("div",{target:"eacdu8d2"})("width:100%;display:flex;flex-direction:column;align-items:",(function(e){return ae(e.theme.stigg.layout.headerAlignment)}),";"),De=l("div",{target:"eacdu8d1"})("position:absolute;top:0;background-color:",(function(e){return e.theme.stigg.palette.outlinedBorder}),";border-radius:0px 0px 10px 10px;padding:3px 12px;"),Re=l(we,{target:"eacdu8d0"})("display:flex;height:100%;margin-right:4px;path{fill:",(function(e){return e.theme.stigg.palette.text.primary}),";}");function _e(e){var t=e.text,n=void 0===t?"Next":t;return a.createElement(De,null,a.createElement(h.Grid,{display:"flex",alignItems:"center",gap:1},a.createElement(Re,{$iconsColor:e.iconsColor}),a.createElement(V,{color:"primary",variant:"body1"},n)))}function He(e){var t,n=e.withUnitPriceRow,r=e.withTiersRow,l=e.withTrialLeftRow,o=e.customer,c=e.plan,s=e.billingPeriod,u=e.isHighlighted,d=e.currentSubscription,p=e.shouldShowDescriptionSection,g=e.hasMonthlyPrice,m=e.hasAnnuallyPrice,h=e.isCustomerOnTrial,v=e.onPlanSelected,y=e.paywallLocale,b=e.locale,w=e.withStartingAtRow,x=c.isNextPlan&&c.isNextPlan(s),E=c.pricePoints.filter((function(e){return e.billingPeriod===s})),P=null==(t=c.paywallCalculatedPricePoints)?void 0:t.find((function(e){return e.billingPeriod===s})),C=E.length>1&&!(null==P||!P.additionalChargesMayApply),S=null;x?S=a.createElement(_e,{text:"Next plan"}):u&&y.highlightChip&&(S=a.createElement(Ie,{className:"stigg-highlight-badge"},a.createElement(Oe,{className:"stigg-highlight-badge-text",color:"white",bold:!0},y.highlightChip)));var U=a.useState(se(c,s,d,{})),T=U[0],k=U[1];return i.useEffect((function(){k(se(c,s,d,T))}),[s]),a.createElement(Be,{className:f("stigg-plan-offering-container",{"stigg-current-plan":c.isCurrentCustomerPlan}),$isHighlighted:u,$isCurrentPlan:c.isCurrentCustomerPlan},S,a.createElement(je,{className:"stigg-header-wrapper"},a.createElement(Le,{className:"stigg-plan-header",variant:"h3"},c.displayName),p&&a.createElement(Fe,{className:"stigg-plan-description",variant:"h6",color:"secondary"},c.description),a.createElement(Ne,{showStartingAt:C,withUnitPriceRow:n,withStartingAtRow:w,withTiersRow:r,selectedTierByFeature:T,setSelectedTierByFeature:k,plan:c,billingPeriod:s,paywallLocale:y,locale:b,hasAnnuallyPrice:m,hasMonthlyPrice:g}),a.createElement(ye,{isNextPlan:x,customer:o,plan:c,currentSubscription:d,billingPeriod:s,isCustomerOnTrial:h,onPlanSelected:function(e){var t=Object.keys(T).map((function(e){return{featureId:e,quantity:T[e].upTo}}));return v(e,t)},paywallLocale:y,hasTiersRow:r,withTrialLeftRow:l,selectedTierByFeature:T}),a.createElement(Ae,{className:"stigg-plan-header-divider"})),a.createElement(ne,{plan:c,billingPeriod:s,paywallLocale:y}))}var We,qe=l("div",{target:"esqa6i42"})("height:40px;padding:0 20px;margin-bottom:",(function(e){return e.theme.stigg.layout.switchBottomSpacing}),";border-radius:10px;border:",(function(e){return"1px solid "+e.theme.stigg.palette.outlinedBorder}),";background-color:",(function(e){return e.theme.stigg.palette.backgroundPaper}),";display:flex;align-items:center;justify-content:center;"),Ze=l(V,{target:"esqa6i41"})({name:"zvmrfm",styles:"margin:0 8px"}),$e=l(y,{target:"esqa6i40"})("& .react-switch-bg{border:",(function(e){return"1px solid "+e.theme.stigg.palette.switchBorder}),";background:",(function(e){return e.theme.stigg.palette.switchFill}),"!important;}& .react-switch-handle{box-shadow:",(function(e){return e.theme.stigg.shadows.light}),";background:",(function(e){return e.theme.stigg.palette.switchHandle}),"!important;top:0.5px!important;}");function Ge(e){return a.createElement(V,{variant:"h6",color:e.disabled?"disabled":"primary",className:"stigg-discount-rate-text"},e.discount,"% off")}function ze(e){var t=e.discountRate,r=e.onBillingPeriodChanged;if(e.availableBillingPeriods.length<=1)return null;var i=e.selectedBillingPeriod===n.BillingPeriod.Monthly;return a.createElement(qe,{className:"stigg-period-picker-container"},a.createElement(Ze,{variant:"h6",className:"stigg-monthly-period-text",color:i?"primary":"disabled"},"Monthly"),a.createElement($e,{className:"stigg-period-switch",uncheckedIcon:!1,checkedIcon:!1,height:16,width:33,onChange:function(e){return r(e?n.BillingPeriod.Annually:n.BillingPeriod.Monthly)},checked:!i,borderRadius:10,handleDiameter:19}),a.createElement(Ze,{variant:"h6",className:"stigg-annual-period-text",color:i?"disabled":"primary"},"Annual"),a.createElement(Ge,{discount:t,disabled:i}))}function Ve(){return(Ve=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var Ye=l((function(e){return i.createElement("svg",Ve({width:135,height:16,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),We||(We=i.createElement("path",{d:"M.099 3.43v9.558h1.057V9.527h2.81c1.983 0 3.323-1.275 3.323-3.049 0-1.773-1.34-3.048-3.324-3.048H.1Zm1.057 5.127v-4.15h2.889c1.289 0 2.143.855 2.143 2.071 0 1.217-.854 2.079-2.143 2.079h-2.89ZM11.779 13.162c2.129 0 3.873-1.622 3.873-3.78 0-2.165-1.715-3.758-3.844-3.758-2.158 0-3.874 1.622-3.874 3.787 0 2.158 1.687 3.75 3.845 3.75Zm.014-.934c-1.556 0-2.773-1.202-2.773-2.832 0-1.629 1.216-2.83 2.773-2.83 1.528 0 2.773 1.201 2.773 2.83 0 1.63-1.245 2.832-2.773 2.832ZM19.905 12.988l1.572-6.046h.029l1.556 6.046h1.34l2.194-7.183h-1.18l-1.622 6.104h-.03l-1.549-6.104h-1.433l-1.55 6.104h-.029l-1.65-6.104h-1.195l2.208 7.183h1.34ZM34.983 9.425c0-2.121-1.578-3.8-3.83-3.8-2.1 0-3.845 1.556-3.845 3.786 0 2.143 1.6 3.75 3.874 3.75 1.586 0 2.875-.767 3.497-1.969l-.897-.485c-.413.898-1.412 1.528-2.585 1.528-1.673 0-2.694-1.246-2.795-2.513h6.567c.014-.13.014-.18.014-.297ZM31.14 6.551c1.404 0 2.527.948 2.715 2.259h-5.423a2.745 2.745 0 0 1 2.708-2.26ZM39.592 5.682c-1.028 0-1.774.521-2.1 1.253l-.101-1.13h-.905v7.183h1.057V8.564c0-1.115.615-1.789 1.774-1.789h.68V5.682h-.405ZM48.249 9.425c0-2.121-1.579-3.8-3.83-3.8-2.1 0-3.845 1.556-3.845 3.786 0 2.143 1.6 3.75 3.873 3.75 1.586 0 2.875-.767 3.497-1.969l-.897-.485c-.413.898-1.412 1.528-2.585 1.528-1.673 0-2.694-1.246-2.795-2.513h6.567c.015-.13.015-.18.015-.297Zm-3.845-2.874c1.404 0 2.527.948 2.715 2.259h-5.423a2.745 2.745 0 0 1 2.708-2.26ZM55.846 7.029c-.63-.89-1.644-1.398-2.831-1.398-2.093 0-3.773 1.586-3.773 3.765 0 2.18 1.651 3.766 3.744 3.766 1.195 0 2.23-.522 2.867-1.42l.145 1.246h.905V2.56l-1.057.116V7.03Zm-2.817 5.199c-1.498 0-2.7-1.188-2.7-2.832 0-1.643 1.202-2.83 2.7-2.83a2.787 2.787 0 0 1 2.817 2.83 2.787 2.787 0 0 1-2.817 2.832ZM65.731 5.631c-1.194 0-2.222.514-2.86 1.412V2.561l-1.057.116v10.31h.905l.145-1.237c.63.898 1.644 1.412 2.838 1.412 2.093 0 3.773-1.586 3.773-3.766 0-2.179-1.651-3.765-3.744-3.765Zm-.043 6.597a2.787 2.787 0 0 1-2.817-2.832 2.787 2.787 0 0 1 2.817-2.83c1.499 0 2.7 1.187 2.7 2.83 0 1.644-1.201 2.832-2.7 2.832ZM76.219 5.805v4.113c0 1.412-.905 2.266-2.172 2.266-1.26 0-1.97-.738-1.97-2.07V5.804H71.02v4.468c0 1.694 1.115 2.824 2.744 2.824 1.079 0 1.926-.42 2.455-1.116v.913c0 1.267-.956 2.186-2.346 2.186-1.123 0-2.05-.6-2.288-1.65l-.927.477C71.1 15.16 72.308 16 73.858 16c1.955 0 3.418-1.405 3.418-3.208V5.805h-1.057ZM108.672 10.487c0 1.42-1.261 2.3-3.181 2.3-1.027 0-1.857-.184-2.651-.578.074-.449.142-.99.16-1.618.738.43 1.575.64 2.381.64.959 0 1.458-.221 1.458-.689.018-.461-.339-.67-1.772-.947-1.661-.332-2.399-1.021-2.399-2.24 0-1.377 1.261-2.27 3.18-2.27.849 0 1.692.16 2.338.437l-.32 1.544a4.803 4.803 0 0 0-2.018-.43c-.898 0-1.341.221-1.341.658 0 .381.308.541 1.71.83 1.79.382 2.461 1.07 2.461 2.35l-.006.013Zm4.207.609c-.719 0-1.298-.382-1.298-1.39V6.887h1.827l.339-1.63h-2.166v-2.32a9.976 9.976 0 0 1-1.9.345l-.019 6.748c0 1.84 1.101 2.769 2.75 2.769.375 0 .701-.037.978-.105l.363-1.729c-.228.08-.517.136-.874.136v-.006Zm2.086 1.593h1.919V5.258h-1.919v7.43Zm.965-10.47c-.621-.006-1.101.45-1.107 1.052 0 .621.455 1.089 1.071 1.095.621 0 1.082-.437 1.095-1.04.012-.62-.443-1.095-1.052-1.107h-.007Zm10.126 3.039v6.268c0 2.369-1.6 3.999-4.3 3.999-.972 0-2.042-.216-2.762-.628.498-.51.837-.953 1.052-1.273.486.166.996.252 1.519.252 1.71 0 2.578-.947 2.578-2.14v-.24c-.609.7-1.489 1.138-2.541 1.138-2.018 0-3.537-1.501-3.537-3.728 0-2.227 1.661-3.808 3.691-3.808 1.052 0 1.968.381 2.577 1.101l.062-.947h1.667l-.006.006Zm-1.901 3.648c0-1.181-.861-2.08-2.048-2.08-1.188 0-2.061.899-2.061 2.08 0 1.18.861 2.048 2.061 2.048 1.199 0 2.048-.898 2.048-2.048Zm10.839-3.648v6.268c0 2.369-1.6 3.999-4.3 3.999-.972 0-2.042-.216-2.762-.628.498-.51.837-.953 1.052-1.273.486.166.996.252 1.519.252 1.71 0 2.578-.947 2.578-2.14v-.24c-.609.7-1.489 1.138-2.541 1.138-2.017 0-3.537-1.501-3.537-3.728 0-2.227 1.661-3.808 3.691-3.808 1.052 0 1.968.381 2.577 1.101l.062-.947H135l-.006.006Zm-1.901 3.648c0-1.181-.861-2.08-2.048-2.08-1.188 0-2.061.899-2.061 2.08 0 1.18.861 2.048 2.061 2.048 1.199 0 2.048-.898 2.048-2.048ZM95.71 14.982c-.075.037-1.483.659-3.975.542A14.827 14.827 0 0 1 88.512 15l4.312-5.007c.77.197 1.76.381 2.885.436 2.492.123 3.9-.504 3.974-.541l-3.974 5.1v-.007Zm-6.441-9.62c-.708-2.393-.431-3.907-.413-3.987l-4.01 5.07c-.013.08-.29 1.592.412 3.985a14.98 14.98 0 0 0 1.273 3.008l3.845-5.37a15.042 15.042 0 0 1-1.107-2.7v-.006Zm9.996.529a14.561 14.561 0 0 0-1.815-3.882l-3.568 4.546.67 3.217c.4.056.794.092 1.194.117.203.006.406.012.603.012 1.931 0 3.008-.455 3.125-.51l.277-.123c.024-.665-.019-1.84-.48-3.384l-.006.007Zm-2.24-4.208A14.43 14.43 0 0 0 92.83.834c-1.605-.08-2.756.154-3.395.338l-.056.296c-.012.061-.258 1.494.4 3.74.11.381.246.756.394 1.132l3.285-.111 3.574-4.54-.006-.006Z",fill:"#001E6C"})))}),{target:"ee5i8qp1"})("*{fill:",(function(e){return e.theme.stigg.palette.text.secondary}),";}"),Qe=l("div",{target:"ee5i8qp0"})("align-self:",(function(e){return e.$alignSelf||"unset"}),";@media (max-width: 1040px){align-self:center;}");function Ke(e){var t=e.source,n=e.style;return e.showWatermark?a.createElement(Qe,{$alignSelf:e.align,className:"stigg-watermark",style:j({cursor:"pointer"},void 0===n?{}:n),onClick:function(){var e=window.location.hostname.replace("www.","");window.open("https://www.stigg.io/?utm_source="+e+"&utm_medium=referral&utm_campaign="+t,"_blank")}},a.createElement(Ye,null)):null}function Xe(e,t){return e.some((function(e){return Je(e,t)}))}function Je(e,t){return e.pricePoints.some((function(e){return e.billingPeriod===t}))}var et,tt=l("div",{target:"e19kubi82"})("color:",(function(e){return e.theme.stigg.palette.text.primary}),";display:flex;align-items:stretch;justify-content:center;flex-wrap:wrap;padding:10px 0;gap:",(function(e){return e.theme.stigg.layout.planMargin}),";"),nt=l("div",{target:"e19kubi81"})({name:"1rdsyw8",styles:"display:flex;flex-direction:column;align-items:center;& *{box-sizing:border-box;}"}),rt=l("div",{target:"e19kubi80"})({name:"zigog8",styles:"display:flex;flex-direction:column;align-items:center"}),it=function(e){var t=e.plans,r=e.customer,l=e.currentSubscription,o=e.highlightedPlanId,c=e.selectedBillingPeriod,s=e.onBillingPeriodChanged,u=e.availableBillingPeriods,d=e.isCustomerOnTrial,p=e.onPlanSelected,m=e.paywallLocale,f=e.locale,h=ct().stigg,v=function(e){return e.reduce((function(e,t){var r,i,a,l,o,c,s,u,d;null!=(r=t.paywallCalculatedPricePoints)&&r.length?(i=null==(l=t.paywallCalculatedPricePoints)||null==(o=l.find((function(e){return e.billingPeriod===n.BillingPeriod.Monthly})))?void 0:o.amount,a=null==(c=t.paywallCalculatedPricePoints)||null==(s=c.find((function(e){return e.billingPeriod===n.BillingPeriod.Annually})))?void 0:s.amount):(i=null==(u=t.pricePoints.find((function(e){return e.billingPeriod===n.BillingPeriod.Monthly})))?void 0:u.amount,a=null==(d=t.pricePoints.find((function(e){return e.billingPeriod===n.BillingPeriod.Annually})))?void 0:d.amount);var p,m,f=(m=a,g(p=i)||g(m)?null:Math.round((p-m/12)/p*100));return f&&(e=Math.max(e,f)),e}),0)}(t),y=t.some((function(e){return!!e.description})),b=Xe(t,n.BillingPeriod.Monthly),w=Xe(t,n.BillingPeriod.Annually),x=function(e,t){return e.filter((function(e){return e.pricingType!==n.PricingType.Paid||Je(e,t)}))}(t,c),E=i.useCallback((function(e,t,n){return p({plan:e,customer:r,subscription:l,intentionType:t,selectedBillingPeriod:c,billableFeatures:n})}),[r,c]),P=x.some((function(e){var t,n=e.pricePoints.filter((function(e){return e.billingPeriod===c})),r=null==(t=e.paywallCalculatedPricePoints)?void 0:t.find((function(e){return e.billingPeriod===c}));return n.length>1&&!(null==r||!r.additionalChargesMayApply)})),C=x.some((function(e){return!!Ee(e,c,m,f,b).unit})),S=x.some((function(e){return!!se(e,c,l,{})})),U=x.some((function(e){return e.isCurrentCustomerPlan&&e.trialDaysLeft}));return a.createElement(nt,{className:"stigg-paywall-container"},a.createElement(rt,{className:"stigg-paywall-layout"},a.createElement(ze,{onBillingPeriodChanged:s,selectedBillingPeriod:c,availableBillingPeriods:u,discountRate:v}),a.createElement(tt,{className:"stigg-paywall-plans-layout"},x.map((function(e){return a.createElement(He,{withUnitPriceRow:C,withTiersRow:S,withTrialLeftRow:U,key:e.id,shouldShowDescriptionSection:y,hasMonthlyPrice:b,hasAnnuallyPrice:w,plan:e,withStartingAtRow:P,currentSubscription:l,billingPeriod:c,isHighlighted:e.id===o,isCustomerOnTrial:d,onPlanSelected:function(t,n){return E(e,t,n)},paywallLocale:m,locale:f,customer:r})}))),a.createElement(Ke,{source:"paywall",align:"end",style:{marginTop:16},showWatermark:h.isWidgetWatermarkEnabled})))},at=(function(e){var t=function(e){var t=Object.prototype,n=t.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",a=r.asyncIterator||"@@asyncIterator",l=r.toStringTag||"@@toStringTag";function o(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{o({},"")}catch(e){o=function(e,t,n){return e[t]=n}}function c(e,t,n,r){var i=Object.create((t&&t.prototype instanceof d?t:d).prototype),a=new P(r||[]);return i._invoke=function(e,t,n){var r="suspendedStart";return function(i,a){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw a;return{value:void 0,done:!0}}for(n.method=i,n.arg=a;;){var l=n.delegate;if(l){var o=w(l,n);if(o){if(o===u)continue;return o}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=s(e,t,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===u)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}(e,n,a),i}function s(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var u={};function d(){}function p(){}function g(){}var m={};o(m,i,(function(){return this}));var f=Object.getPrototypeOf,h=f&&f(f(C([])));h&&h!==t&&n.call(h,i)&&(m=h);var v=g.prototype=d.prototype=Object.create(m);function y(e){["next","throw","return"].forEach((function(t){o(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){var r;this._invoke=function(i,a){function l(){return new t((function(r,l){!function r(i,a,l,o){var c=s(e[i],e,a);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==typeof d&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,l,o)}),(function(e){r("throw",e,l,o)})):t.resolve(d).then((function(e){u.value=e,l(u)}),(function(e){return r("throw",e,l,o)}))}o(c.arg)}(i,a,r,l)}))}return r=r?r.then(l,l):l()}}function w(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method))return u;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return u}var r=s(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,u;var i=r.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,u):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,u)}function x(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function C(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,a=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:S}}function S(){return{value:void 0,done:!0}}return p.prototype=g,o(v,"constructor",g),o(g,"constructor",p),p.displayName=o(g,l,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===p||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,o(e,l,"GeneratorFunction")),e.prototype=Object.create(v),e},e.awrap=function(e){return{__await:e}},y(b.prototype),o(b.prototype,a,(function(){return this})),e.AsyncIterator=b,e.async=function(t,n,r,i,a){void 0===a&&(a=Promise);var l=new b(c(t,n,r,i),a);return e.isGeneratorFunction(n)?l:l.next().then((function(e){return e.done?e.value:l.next()}))},y(v),o(v,l,"Generator"),o(v,i,(function(){return this})),o(v,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=C,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return l.type="throw",l.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],l=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var o=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(o&&c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(o){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var l=a?a.completion:{};return l.type=e,l.arg=t,a?(this.method="next",this.next=a.finallyLoc,u):this.complete(l)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),u},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),E(n),u}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;E(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:C(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),u}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}}(et={exports:{}}),et.exports),lt=new(function(){function e(){}var t=e.prototype;return t.error=function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];console.error(e,t||{},r)},t.log=function(e,t){console.log(e,t||{})},t.debug=function(e,t){console.debug(e,t||{})},e}()),ot=a.createContext(null);ot.displayName="StiggContext";var ct=function(){var e=i.useContext(ot);if(!e)throw new Error("Could not find Stigg context; You need to wrap your app in an <StiggProvider> component.");return e};function st(e,t){var r=e.flatMap((function(e){return e.pricePoints})).map((function(e){return e.billingPeriod})),i=m.countBy(r),a=m.uniq(r);return{defaultBillingPeriod:t&&a.includes(t)?t:(i[n.BillingPeriod.Monthly]||0)>(i[n.BillingPeriod.Annually]||0)?n.BillingPeriod.Monthly:n.BillingPeriod.Annually,availableBillingPeriods:a}}function ut(e,t){if(void 0===t&&(t="px"),e)return""+e+t}function dt(e,t){if(!t)return e;switch(t){case n.FontWeight.Normal:return"normal";case n.FontWeight.Bold:return"bold";default:return"normal"}}function pt(e){var t,n,r,i,a,l,o,c,s=e.typography;return{fontFamilyUrl:(null==s?void 0:s.fontFamily)||void 0,h1:{fontSize:ut(null==s||null==(t=s.h1)?void 0:t.fontSize),fontWeight:dt("bold",null==s||null==(n=s.h1)?void 0:n.fontWeight)},h2:{fontSize:ut(null==s||null==(r=s.h2)?void 0:r.fontSize),fontWeight:dt("normal",null==s||null==(i=s.h2)?void 0:i.fontWeight)},h3:{fontSize:ut(null==s||null==(a=s.h3)?void 0:a.fontSize),fontWeight:dt("normal",null==s||null==(l=s.h3)?void 0:l.fontWeight)},body:{fontSize:ut(null==s||null==(o=s.body)?void 0:o.fontSize),fontWeight:dt("normal",null==s||null==(c=s.body)?void 0:c.fontWeight)}}}function gt(e){if(e)switch(e){case n.Alignment.Left:return"left";case n.Alignment.Center:return"center";case n.Alignment.Right:return"right"}}var mt,ft=l("div",{target:"e1f7khji6"})({name:"zigog8",styles:"display:flex;flex-direction:column;align-items:center"}),ht=l(W,{target:"e1f7khji5"})({name:"o7nnmj",styles:"margin-right:16px"}),vt=l("div",{target:"e1f7khji4"})("display:flex;flex-direction:column;align-items:flex-start;gap:20px;border-radius:10px;padding:",(function(e){return e.theme.stigg.layout.planPadding}),";background-color:",(function(e){return e.theme.stigg.palette.backgroundPaper}),";min-width:",(function(e){return e.theme.stigg.layout.planMinWidth}),";max-width:",(function(e){return e.theme.stigg.layout.planMaxWidth}),";min-height:450px;border:",(function(e){return"1px solid "+e.theme.stigg.palette.outlinedBorder}),";"),yt=l("div",{target:"e1f7khji3"})("display:flex;gap:",(function(e){return e.theme.stigg.layout.planMargin}),";flex-wrap:wrap;justify-content:center;"),bt=l("div",{target:"e1f7khji2"})({name:"k8xojc",styles:"display:flex;align-items:center;margin-bottom:12px"}),wt=l("div",{target:"e1f7khji1"})({name:"xdvdnl",styles:"margin-top:auto"}),xt=l("div",{target:"e1f7khji0"})("width:150px;margin-bottom:",(function(e){return e.theme.stigg.layout.switchBottomSpacing}),";padding:12px 12px;border-radius:10px;background-color:white;border:",(function(e){return"1px solid "+e.theme.stigg.palette.outlinedBorder}),";");function Et(){return a.createElement(vt,null,a.createElement(w,{width:120,borderRadius:4}),a.createElement(w,{circle:!0,width:40,height:40}),a.createElement(w,{style:{marginBottom:33},width:120,borderRadius:4}),a.createElement(bt,null,a.createElement(ht,null),a.createElement(w,{width:120,borderRadius:4})),a.createElement(bt,null,a.createElement(ht,null),a.createElement(w,{width:120,borderRadius:4})),a.createElement(bt,null,a.createElement(ht,null),a.createElement(w,{width:120,borderRadius:4})),a.createElement(wt,null,a.createElement(w,{height:50,borderRadius:4})))}function Pt(){return a.createElement(ft,{className:"stigg-skeleton-loader-container"},a.createElement(xt,{className:"stigg-skeleton-loader-billing-period"},a.createElement(w,{borderRadius:4})),a.createElement(yt,{className:"stigg-skeleton-loader-plans-container"},a.createElement(Et,null),a.createElement(Et,null),a.createElement(Et,null)))}var Ct,St=function(e){var t=e.externalFontUrl;return a.createElement(c.Global,{styles:c.css(mt||(mt=R(["\n ","\n\n /* latin-ext */\n @font-face {\n font-family: 'DM Sans';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(https://fonts.gstatic.com/s/dmsans/v11/rP2Hp2ywxg089UriCZ2IHTWEBlwu8Q.woff2) format('woff2');\n unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F,\n U+A720-A7FF;\n }\n /* latin */\n @font-face {\n font-family: 'DM Sans';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(https://fonts.gstatic.com/s/dmsans/v11/rP2Hp2ywxg089UriCZOIHTWEBlw.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074,\n U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n }\n /* latin-ext */\n @font-face {\n font-family: 'DM Sans';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(https://fonts.gstatic.com/s/dmsans/v11/rP2Cp2ywxg089UriAWCrCBamC3YU-CnE6Q.woff2) format('woff2');\n unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F,\n U+A720-A7FF;\n }\n /* latin */\n @font-face {\n font-family: 'DM Sans';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(https://fonts.gstatic.com/s/dmsans/v11/rP2Cp2ywxg089UriAWCrCBimC3YU-Ck.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074,\n U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n }\n /* latin-ext */\n @font-face {\n font-family: 'DM Sans';\n font-style: normal;\n font-weight: 700;\n font-display: swap;\n src: url(https://fonts.gstatic.com/s/dmsans/v11/rP2Cp2ywxg089UriASitCBamC3YU-CnE6Q.woff2) format('woff2');\n unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F,\n U+A720-A7FF;\n }\n /* latin */\n @font-face {\n font-family: 'DM Sans';\n font-style: normal;\n font-weight: 700;\n font-display: swap;\n src: url(https://fonts.gstatic.com/s/dmsans/v11/rP2Cp2ywxg089UriASitCBimC3YU-Ck.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074,\n U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n }\n "])),t&&"\n @font-face {\n font-family: 'custom-font';\n font-style: normal;\n font-weight: normal;\n src: local('custom-font'), url("+t+") format('woff');\n }\n ")})},Ut=l("div",{target:"emcdfp60"})((function(e){var t=e.customCss;return t&&c.css(Ct||(Ct=R(["\n ","\n "])),t)}),";");function Tt(e){var t,n,r,i,a,l,o,c=ct(),d=m.merge(e,c.theme);return a=s((null==(t=d)||null==(n=t.palette)?void 0:n.primary)||"#327EEE"),l=s((null==t||null==(r=t.palette)||null==(i=r.text)?void 0:i.primary)||"#001E6C"),o={palette:{primary:a.hex(),backgroundPaper:"#FFFFFF",backgroundHighlight:"#F5F6F9",backgroundSection:a.alpha(.1).toString(),backgroundButton:a.alpha(.08).toString(),outlinedBorder:"#C4CBDD",outlinedRestingBorder:a.alpha(.5).toString(),outlinedHoverBackground:a.lightness(95).hex(),switchBorder:a.lighten(.1).hex(),switchFill:a.lighten(.5).hex(),switchHandle:a.hex(),warning:"#ed6c02",error:"#f44336",white:"#FFFFFF",text:{primary:l.hex(),secondary:l.alpha(.75).toString(),disabled:l.alpha(.5).toString()}},layout:{planMinWidth:"330px",planMaxWidth:"330px",planMargin:"20px",planPadding:"40px",ctaAlignment:"left",headerAlignment:"left",descriptionAlignment:"left",descriptionMinHeight:"80px",switchBottomSpacing:"40px"},shadows:{light:"0px 2px 1px -1px rgba(0, 0, 0, 0.2), 0px 1px 1px rgba(0, 0, 0, 0.14), 0px 1px 3px rgba(0, 0, 0, 0.12)",popover:"0px 4px 5px -2px rgba(0, 30, 108, 0.2), 0px 7px 10px 1px rgba(0, 30, 108, 0.14), 0px 2px 16px 1px rgba(0, 30, 108, 0.12)"},border:{radius:"10px"},typography:{fontFamily:"custom-font, DM Sans, sans-serif",h1:{fontSize:"32px",fontWeight:"bold"},h2:{fontSize:"24px",fontWeight:"normal"},h3:{fontSize:"16px",fontWeight:"normal"},body:{fontSize:"14px",fontWeight:"normal"},caption:{fontSize:"12px",fontWeight:"normal"}},customCss:""},u(o,t)}function kt(e){var t=e.typography,n=Number(t.body.fontSize.replace("px",""))/14;return{pxToRem:function(e){return e/16*n+"rem"},bodyFontFamily:t.fontFamily,headingFontFamily:t.fontFamily,fontSizes:[t.h1.fontSize,t.h2.fontSize,t.h3.fontSize,t.body.fontSize,"12px","10px"]}}var Mt=function(e){var t=e.children,n=Tt(e.componentTheme);return a.createElement(E.ThemeProvider,{theme:E.createTheme({stigg:n})},a.createElement(c.ThemeProvider,{theme:{stigg:n}},a.createElement(Ut,{customCss:n.customCss},a.createElement(St,{externalFontUrl:n.typography.fontFamilyUrl}),a.createElement(P.ThemeProvider,{theme:{typography:kt(n)}},t))))},Nt=a.createContext(null);Nt.displayName="CustomerPortalContext";var Bt=function(){var e=i.useContext(Nt);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 Lt(e){var t,n,r,l,o,c,s,d=e.children,p=e.textOverrides,g=e.theme,m=e.resourceId,f=e.productId,h=ct().customerPortalUpdatedAt,v=function(e){var t=e.resourceId,n=e.productId,r=ct(),a=r.stigg,l=r.customerPortalUpdatedAt,o=i.useState(!1),c=o[0],s=o[1],u=i.useState(),d=u[0],p=u[1];return i.useEffect((function(){!function(){var e=O(at.mark((function e(){return at.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!a.isCustomerLoaded){e.next=15;break}return e.prev=1,s(!0),e.next=5,a.getCustomerPortal({resourceId:t,productId:n});case 5:p(e.sent),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(1),lt.error("Failed to load customer portal "+(null==e.t0?void 0:e.t0.message),e.t0);case 12:return e.prev=12,s(!1),e.finish(12);case 15:case"end":return e.stop()}}),e,null,[[1,9,12,15]])})));return function(){return e.apply(this,arguments)}}()()}),[a,a.isCustomerLoaded,l,t]),{customerPortal:d,isLoading:c}}({resourceId:m,productId:f}),y=v.customerPortal,b=v.isLoading,w=null!=y&&y.configuration?function(e){var t=e.palette;return{palette:{primary:(null==t?void 0:t.primary)||void 0,backgroundPaper:(null==t?void 0:t.paywallBackgroundColor)||void 0,outlinedBorder:(null==t?void 0:t.borderColor)||void 0,backgroundHighlight:(null==t?void 0:t.currentPlanBackground)||void 0,text:{primary:(null==t?void 0:t.textColor)||void 0}},typography:pt(e)}}(y.configuration):void 0,x=(t=Tt(w),r=null==y?void 0:y.configuration,{sectionTitleColor:(null==(n=g)?void 0:n.sectionTitleColor)||t.palette.text.secondary,planNameColor:(null==n?void 0:n.planNameColor)||t.palette.text.primary,backgroundColor:(null==n?void 0:n.backgroundColor)||(null==r||null==(l=r.palette)?void 0:l.backgroundColor)||"white",borderColor:(null==n?void 0:n.borderColor)||(null==r||null==(o=r.palette)?void 0:o.borderColor)||"rgba(0, 30, 108, 0.15)",listItemBackgroundColor:(null==n?void 0:n.backgroundColor)||(null==r||null==(c=r.palette)?void 0:c.backgroundColor)||"white",tabMaxHeight:(null==n?void 0:n.tabMaxHeight)||"380px",iconsColor:(null==n?void 0:n.iconsColor)||(null==r||null==(s=r.palette)?void 0:s.iconsColor)||void 0,iconsBackgroundColor:null==n?void 0:n.iconsBackgroundColor}),E=u({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"},p);return a.createElement(Mt,{componentTheme:w},a.createElement(Nt.Provider,{key:null==h?void 0:h.toString(),value:{customerPortal:y,isLoading:b,textOverrides:E,theme:x,resourceId:m}},d))}var At,Ft=l(S,{target:"emvioms0"})("border-radius:10px;padding:8px 16px;text-transform:none;&,&:hover{border-color:",(function(e){return e.theme.stigg.palette.outlinedRestingBorder}),";}");function It(){return(It=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var Ot=function(e){return i.createElement("svg",It({width:20,height:20,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),At||(At=i.createElement("path",{clipRule:"evenodd",d:"M13.333 2.5 17.5 6.667 6.667 17.5H2.5v-4.167L13.333 2.5v0Z",stroke:"#327EEE",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})))},jt=l("div",{target:"ewz8krb0"})("display:flex;align-items:center;justify-content:space-between;",(function(e){return!e.$disableMargin&&"\n &:not(:last-child) {\n margin-bottom: 32px;\n }\n "}),";");function Dt(e){var t=e.title,n=e.className,r=e.isLoading,i=Bt().theme;return r?a.createElement(w,{width:120}):a.createElement(V,{className:n,overrideColor:i.sectionTitleColor,variant:"h3",bold:!0},t)}var Rt=l(Ot,{target:"e1fjw26b0"})("path{stroke:",(function(e){return e.theme.stigg.palette.primary}),";}");function _t(e){var t=e.onManageSubscription,n=e.hideManageButton,r=e.textOverrides;return a.createElement(jt,{className:"stigg-customer-portal-overview-header",$disableMargin:!0},a.createElement(Dt,{title:"Subscription",className:"stigg-overview-title"}),!n&&a.createElement(Ft,{className:"stigg-manage-subscription-button",variant:"outlined",onClick:t},a.createElement(Rt,{className:"stigg-manage-subscription-button-image"}),a.createElement(V,{className:"stigg-manage-subscription-button-text",color:"primary.main",style:{marginLeft:"8px"},variant:"body1"},null==r?void 0:r.manageSubscription)))}function Ht(){var e=Bt().customerPortal,t=U(null==e?void 0:e.subscriptions,(function(e){return e.addons}));return M(t)?null:a.createElement("div",{className:"stigg-addons-list-layout"},t.map((function(e,n){return a.createElement(V,{key:e.addonId,span:!0,className:"stigg-addon-list-item-text",variant:"body1"},e.quantity>1&&e.quantity+" X ",e.displayName,n===t.length-1?"":", ")})))}var Wt=l("div",{target:"e1g6q2f50"})("display:flex;justify-content:space-between;align-items:center;gap:64px;border-bottom:",(function(e){return"1px solid "+e.$borderColor}),";padding:16px 0;&>*:first-child{max-width:60%;}");function qt(){var e=Bt(),t=e.customerPortal,n=e.theme,r=null==t?void 0:t.promotionalEntitlements;return a.createElement("div",{style:{display:"flex",flexDirection:"column"}},a.createElement(V,{color:"secondary"},e.textOverrides.promotionsSubtitle),a.createElement("div",{style:{display:"flex",flexDirection:"column"}},a.createElement(Wt,{$borderColor:n.borderColor},a.createElement(V,{variant:"body1",bold:!0},"Feature"),a.createElement(V,{variant:"body1",bold:!0},"Expiration date")),null==r?void 0:r.map((function(e){return a.createElement(Wt,{$borderColor:n.borderColor},a.createElement(V,{variant:"body1"},function(e){var t,n=e.displayName;return e.hasUnlimitedUsage?"Unlimited "+n:e.usageLimit?n+" x "+(null==(t=e.usageLimit)?void 0:t.toLocaleString()):n}(e)),a.createElement(V,{variant:"body1",color:"disabled"},e.endDate?p.utc(e.endDate).format("MMM Do, YYYY"):"None"))}))))}var Zt,$t,Gt,zt,Vt,Yt,Qt,Kt,Xt,Jt,en,tn,nn,rn,an=l(N,{target:"exlfw3j3"})({name:"jlwfj4",styles:".MuiTabs-indicator{background-color:#001e6c;}"}),ln=l("div",{target:"exlfw3j2"})({name:"1dqkbz0",styles:"width:100%;flex:1;margin-top:16px"}),on=l(T,{target:"exlfw3j1"})("margin-top:16px;max-height:",(function(e){return e.$maxHeight}),";overflow-y:auto;");function cn(){return(cn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function sn(){return(sn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function un(){return(un=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function dn(){return(dn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function pn(){return(pn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function gn(){return(gn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var mn,fn,hn,vn,yn,bn,wn,xn,En,Pn,Cn=function(e){return i.createElement("svg",gn({width:20,height:20,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),rn||(rn=i.createElement("path",{d:"M10.833 2.5a7.5 7.5 0 0 0-7.5 7.5h-2.5l3.242 3.242.058.116L7.5 10H5a5.829 5.829 0 0 1 5.833-5.833A5.83 5.83 0 0 1 16.667 10a5.83 5.83 0 0 1-5.834 5.833 5.786 5.786 0 0 1-4.116-1.716L5.533 15.3a7.462 7.462 0 0 0 5.3 2.2 7.5 7.5 0 0 0 0-15ZM10 6.667v4.166l3.567 2.117.6-1.008-2.917-1.734V6.667H10Z",fill:"#6678A7"})))};function Sn(){return(Sn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Un(){return(Un=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Tn(){return(Tn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function kn(){return(kn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var Mn,Nn,Bn,Ln={RenewSubscription:function(e){return i.createElement("svg",cn({width:36,height:36,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Zt||(Zt=i.createElement("rect",{width:36,height:36,rx:10,fill:"#F5F6F9"})),$t||($t=i.createElement("path",{clipRule:"evenodd",d:"M9 12a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H11a2 2 0 0 1-2-2V12Z",stroke:"#7586B0",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),Gt||(Gt=i.createElement("path",{d:"M22 8v4M14 8v4M9 16h18",stroke:"#7586B0",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})))},BillingInfoCustomer:function(e){return i.createElement("svg",sn({width:36,height:36,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),zt||(zt=i.createElement("rect",{width:36,height:36,rx:10,fill:"#F5F6F9"})),Vt||(Vt=i.createElement("path",{d:"M26 27v-2a4 4 0 0 0-4-4h-8a4 4 0 0 0-4 4v2",stroke:"#7586B0",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),Yt||(Yt=i.createElement("path",{clipRule:"evenodd",d:"M18 17a4 4 0 1 0 0-8 4 4 0 0 0 0 8Z",stroke:"#7586B0",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})))},CreditCard:function(e){return i.createElement("svg",un({width:36,height:36,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Qt||(Qt=i.createElement("rect",{width:36,height:36,rx:10,fill:"#F5F6F9"})),Kt||(Kt=i.createElement("path",{d:"M26 10H10c-1.11 0-1.99.89-1.99 2L8 24c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V12c0-1.11-.89-2-2-2Zm0 14H10v-6h16v6Zm0-10H10v-2h16v2Z",fill:"#7586B0"})))},ScheduleBox:function(e){return i.createElement("svg",dn({width:36,height:36,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Xt||(Xt=i.createElement("rect",{width:36,height:36,rx:10,fill:"url(#schedule-box_svg__a)"})),Jt||(Jt=i.createElement("rect",{width:36,height:36,rx:10,fill:"#F5F6F9"})),en||(en=i.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.954 7.7a1 1 0 0 1-.654 1.254 8.998 8.998 0 0 0-1.543 16.523A9 9 0 0 0 27 17.54a1 1 0 1 1 2 0c0 .357-.017.713-.052 1.066.018.089.024.182.017.278l-.004.047a.997.997 0 0 1-.101.361A11 11 0 1 1 14.7 7.046a1 1 0 0 1 1.254.654Zm1.896.252a1 1 0 0 1 1.08-.912l.048.004a1 1 0 1 1-.178 1.992l-.038-.003a1 1 0 0 1-.912-1.081ZM22.858 9.2a1 1 0 0 1 1.391-.254l.078.054a1 1 0 1 1-1.152 1.635 8.98 8.98 0 0 0-.063-.044 1 1 0 0 1-.254-1.391Zm3.748 3.609a1 1 0 0 1 1.332.473l.04.085a1 1 0 1 1-1.813.844l-.014-.031-.019-.039a1 1 0 0 1 .474-1.332ZM19 14a1 1 0 1 0-2 0v4a1 1 0 0 0 1 1h4a1 1 0 1 0 0-2h-3v-3Z",fill:"#7586B0"})),tn||(tn=i.createElement("defs",null,i.createElement("linearGradient",{id:"schedule-box_svg__a",x1:35.02,y1:1.224,x2:0,y2:36,gradientUnits:"userSpaceOnUse"}))))},ScheduleClock:function(e){return i.createElement("svg",pn({width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),nn||(nn=i.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.954 1.7A1 1 0 0 1 9.3 2.954a8.998 8.998 0 0 0-5.615 12.03A9 9 0 0 0 21 11.54a1 1 0 1 1 2 0c0 .357-.017.713-.052 1.066.018.089.024.182.017.278l-.004.047a.997.997 0 0 1-.101.361A11 11 0 1 1 8.7 1.046a1 1 0 0 1 1.254.654Zm1.896.252a1 1 0 0 1 1.08-.912l.048.004a1 1 0 1 1-.178 1.992l-.039-.003a1 1 0 0 1-.911-1.081ZM16.858 3.2a1 1 0 0 1 1.391-.254l.078.054a1 1 0 1 1-1.152 1.635 9.7 9.7 0 0 0-.063-.044 1 1 0 0 1-.254-1.391Zm3.748 3.608a1 1 0 0 1 1.332.474l.04.085a1 1 0 1 1-1.813.844l-.014-.031-.019-.039a1 1 0 0 1 .474-1.333ZM13 8a1 1 0 1 0-2 0v4a1 1 0 0 0 1 1h4a1 1 0 1 0 0-2h-3V8Z",fill:"#7586B0"})))},Restore:Cn,MiniSchedule:we,DollarCoin:function(e){return i.createElement("svg",Sn({width:21,height:20,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),mn||(mn=i.createElement("g",{clipPath:"url(#dollar-coin_svg__a)",stroke:"#7586B0",strokeWidth:1.714,strokeLinecap:"round",strokeLinejoin:"round"},i.createElement("path",{d:"M10.334 19.286A9.286 9.286 0 1 0 1.048 10a9.286 9.286 0 0 0 9.286 9.286Z"}),i.createElement("path",{d:"M12.765 7.46a1.903 1.903 0 0 0-1.796-1.27H9.494a1.7 1.7 0 0 0-.363 3.362l2.245.49a1.905 1.905 0 0 1-.407 3.768h-1.27c-.83 0-1.535-.53-1.797-1.27M10.334 6.19V4.287M10.334 15.714V13.81"}))),fn||(fn=i.createElement("defs",null,i.createElement("clipPath",{id:"dollar-coin_svg__a"},i.createElement("path",{fill:"#fff",transform:"translate(.333)",d:"M0 0h20v20H0z"})))))},Promotions:function(e){return i.createElement("svg",Un({width:24,height:25,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),hn||(hn=i.createElement("g",{clipPath:"url(#promotions_svg__a)",stroke:"#7586B0",strokeWidth:1.714,strokeLinecap:"round",strokeLinejoin:"round"},i.createElement("path",{d:"M21.429 5.325H2.57c-.946 0-1.714.767-1.714 1.714v3.429c0 .947.768 1.714 1.714 1.714H21.43c.946 0 1.714-.768 1.714-1.714V7.039c0-.947-.768-1.714-1.714-1.714ZM21.429 12.182v9.429a1.714 1.714 0 0 1-1.715 1.714H4.286a1.714 1.714 0 0 1-1.714-1.714v-9.429M12 5.325v18M17.143 1.04 12 5.324 6.857 1.039"}))),vn||(vn=i.createElement("defs",null,i.createElement("clipPath",{id:"promotions_svg__a"},i.createElement("path",{fill:"#fff",transform:"translate(0 .182)",d:"M0 0h24v24H0z"})))))},Addons:function(e){return i.createElement("svg",Tn({width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),yn||(yn=i.createElement("g",{clipPath:"url(#addons_svg__a)",stroke:"#7586B0",strokeWidth:1.714,strokeLinecap:"round",strokeLinejoin:"round"},i.createElement("path",{d:"M12 6.857v10.286M6.857 12h10.286M18 .857H6A5.143 5.143 0 0 0 .857 6v12A5.143 5.143 0 0 0 6 23.143h12A5.143 5.143 0 0 0 23.143 18V6A5.143 5.143 0 0 0 18 .857Z"}))),bn||(bn=i.createElement("defs",null,i.createElement("clipPath",{id:"addons_svg__a"},i.createElement("path",{fill:"#fff",d:"M0 0h24v24H0z"})))))},ContactSupport:function(e){return i.createElement("svg",kn({width:36,height:36,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),wn||(wn=i.createElement("rect",{width:36,height:36,rx:10,fill:"#F5F6F9"})),xn||(xn=i.createElement("path",{d:"M27 18.22C27 12.73 22.74 9 18 9c-4.69 0-9 3.65-9 9.28-.6.34-1 .98-1 1.72v2c0 1.1.9 2 2 2h1v-6.1c0-3.87 3.13-7 7-7s7 3.13 7 7V25h-8v2h8c1.1 0 2-.9 2-2v-1.22c.59-.31 1-.92 1-1.64v-2.3c0-.7-.41-1.31-1-1.62Z",fill:"#7586B0"})),En||(En=i.createElement("path",{d:"M15 20a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM21 20a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z",fill:"#7586B0"})),Pn||(Pn=i.createElement("path",{d:"M24 17.03A6.04 6.04 0 0 0 18.05 12c-3.03 0-6.29 2.51-6.03 6.45a8.075 8.075 0 0 0 4.86-5.89c1.31 2.63 4 4.44 7.12 4.47Z",fill:"#7586B0"})))}},An=function(e,t){switch(e){case"primary":return t.stigg.palette.text.primary;case"secondary":return t.stigg.palette.text.secondary;default:return e}},Fn=l("div",{target:"e1ds7xyn0"})((function(e){var t=e.$pathColor;return t&&c.css(Mn||(Mn=R(["\n path {\n fill: ",";\n }\n "])),t)})," ",(function(e){var t=e.$rectColor;return t&&c.css(Nn||(Nn=R(["\n svg rect {\n fill: ",";\n }\n "])),t)})," ",(function(e){var t=e.$strokeColor;return t&&c.css(Bn||(Bn=R(["\n g {\n stroke: ",";\n }\n "])),t)}),";");function In(e){var t=e.className,n=e.style,r=e.svgPathColor,i=e.svgRectColor,l=e.svgStrokeColor,o=Ln[e.icon],s=c.useTheme();return a.createElement(Fn,{className:t,style:n,$pathColor:An(r,s),$rectColor:An(i,s),$strokeColor:An(l,s)},a.createElement(o,null))}var On=["children","value","index","maxHeight"];function jn(e){var t=e.children,n=e.value,r=e.index,i=e.maxHeight,l=D(e,On);return a.createElement("div",Object.assign({role:"tabpanel",hidden:n!==r},l),n===r&&a.createElement(on,{$maxHeight:i},t))}function Dn(e){var t=e.isSelected,n=e.label,r=t?"primary":"secondary";return a.createElement("div",{style:{display:"flex",gap:8,alignItems:"center"}},a.createElement(In,{icon:e.icon,svgStrokeColor:r}),a.createElement(V,{variant:"h6",bold:t,fontWeight:o.FontWeight.Medium,color:r},n))}function Rn(e){var t=e.customerPortal,n=e.hiddenSections,r=e.textOverrides,l=e.theme,o=function(e){return null==n?void 0:n.some((function(t){return t===e}))},c=U(t.subscriptions,(function(e){return e.addons})).length>0&&!o("addons"),s=t.promotionalEntitlements.length>0&&!o("promotionalEntitlements"),u=i.useState(c?1:2),d=u[0],p=u[1];return c||s?a.createElement(ln,null,a.createElement(T,{sx:{borderBottom:1,borderColor:"divider"}},a.createElement(an,{value:d,onChange:function(e,t){p(t)}},c?a.createElement(k,{sx:{textTransform:"none"},value:1,label:a.createElement(Dn,{isSelected:1===d,label:r.addonsTabTitle,icon:"Addons"})}):null,s?a.createElement(k,{sx:{textTransform:"none"},value:2,label:a.createElement(Dn,{isSelected:2===d,label:r.promotionsTabTitle,icon:"Promotions"})}):null)),a.createElement(jn,{value:d,index:1,maxHeight:l.tabMaxHeight},a.createElement(Ht,null)),a.createElement(jn,{value:d,index:2,maxHeight:l.tabMaxHeight},a.createElement(qt,null))):null}var _n=l("div",{target:"ejq3grd1"})({name:"1eoy87d",styles:"display:flex;justify-content:space-between"}),Hn=l("div",{target:"ejq3grd0"})({name:"43cxha",styles:"display:flex;flex-direction:column;gap:32px"});function Wn(){return a.createElement(_n,{className:"stigg-subscription-overview-skeleton-layout"},a.createElement(Hn,null,a.createElement(w,{width:120}),a.createElement(w,{width:120})),a.createElement(w,{width:295,height:193}))}function qn(e){var t=e.scheduleUpdate.targetPackage;return a.createElement(h.Grid,{container:!0,alignItems:"center"},a.createElement(h.Grid,null,a.createElement(B.ArrowDown,{color:"#D94052",height:20,className:"stigg-scheduled-updates-arrow-down"})),a.createElement(h.Grid,{item:!0},a.createElement(V,{className:"stigg-scheduled-updates-description",variant:"body1"},"Downgrade to the ",a.createElement("b",null,null==t?void 0:t.displayName)," plan")))}function Zn(e){var t=e.scheduleUpdate.scheduleVariables.billingPeriod,r=t===n.BillingPeriod.Monthly?"annually":"monthly",i=t===n.BillingPeriod.Monthly?"monthly":"annually";return a.createElement(h.Grid,{container:!0,alignItems:"center"},a.createElement(h.Grid,null,a.createElement(B.ArrowDown,{color:"#D94052",height:20,className:"stigg-scheduled-updates-arrow-down"})),a.createElement(h.Grid,{item:!0},a.createElement(V,{className:"stigg-scheduled-updates-description",variant:"body1"},"Change from an ",r," to a ",a.createElement("b",null,i)," billing cycle")))}function $n(e){var t=e.scheduleUpdate.scheduleVariables,n=t.newUnitAmount,r=t.featureId,i=m.compact(m.map(e.subscription.prices,"feature")).find((function(e){return e.id===r}));if(!i)return null;var l=i.featureUnits,o=1===n?l:i.featureUnitsPlural;return a.createElement(h.Grid,{container:!0,alignItems:"flex-start",flexWrap:"nowrap"},a.createElement(h.Grid,null,a.createElement(B.ArrowDown,{color:"#D94052",height:20,className:"stigg-scheduled-updates-arrow-down"})),a.createElement(h.Grid,{item:!0},a.createElement(V,{className:"stigg-scheduled-updates-description",variant:"body1"},"Reduce the ",a.createElement("b",null,l)," quantity to ",n," ",o)))}function Gn(e){var t=e.scheduleUpdate,r=e.subscription;switch(t.subscriptionScheduleType){case n.SubscriptionScheduleType.Downgrade:return a.createElement(qn,{scheduleUpdate:t});case n.SubscriptionScheduleType.BillingPeriod:return a.createElement(Zn,{scheduleUpdate:t});case n.SubscriptionScheduleType.UnitAmount:return a.createElement($n,{scheduleUpdate:t,subscription:r});default:return null}}var zn=l(h.Box,{target:"eju957a2"})("border-bottom:",(function(e){return"1px solid "+e.$borderColor}),";border-top-left-radius:10px;border-top-right-radius:10px;margin:-64px -64px 64px -64px;padding:24px 32px;"),Vn=l(d,{target:"eju957a1"})({name:"158icaa",styles:"margin-left:4px"}),Yn=l(Cn,{target:"eju957a0"})("color:",(function(e){return e.theme.stigg.palette.primary}),";path{fill:",(function(e){return e.theme.stigg.palette.primary}),";}");function Qn(e){var t=e.subscription,n=t.scheduledUpdates;return a.createElement(a.Fragment,null,a.createElement(h.Grid,{container:!0,alignItems:"center",justifyContent:"space-between",gap:1},a.createElement(h.Grid,null,a.createElement(V,{className:"stigg-scheduled-updates-description",variant:"body1"},"The following updates will take effect in the next billing cycle:"))),a.createElement(h.Grid,null,(n||[]).map((function(e){return a.createElement(Gn,{key:e.subscriptionScheduleType,scheduleUpdate:e,subscription:t})}))))}function Kn(e){var t=e.subscription,n=oe({scheduledUpdate:(t.scheduledUpdates||[])[0],subscriptionPrices:t.prices,billingPeriodRange:t.billingPeriodRange,options:{postfix:"at the end of the current billing period"}}),r=n.line2;return a.createElement(a.Fragment,null,a.createElement(h.Grid,{container:!0,alignItems:"center",justifyContent:"space-between",gap:1},a.createElement(h.Grid,null,a.createElement(V,{className:"stigg-scheduled-updates-title",variant:"body1",color:"primary"},n.line1))),r&&a.createElement(h.Grid,null,a.createElement(V,{className:"stigg-scheduled-updates-subtitle",variant:"body1",color:"secondary"},r)))}function Xn(e){var t=e.subscription,n=e.onCancelScheduledUpdates,r=e.theme,l=e.cancelScheduledUpdatesButtonTitle,o=c.useTheme(),s=i.useState(!1),u=s[0],d=s[1],p=t.scheduledUpdates;if(!p||0===p.length)return null;var g=1===p.length;return a.createElement(zn,{$borderColor:r.borderColor,className:"stigg-scheduled-updates-alert-container"},a.createElement(h.Grid,{container:!0,alignItems:g?"center":"flex-start",gap:2},a.createElement(h.Grid,{item:!0,display:"flex"},a.createElement(In,{icon:"ScheduleBox",svgPathColor:r.iconsColor,svgRectColor:r.iconsBackgroundColor})),a.createElement(h.Grid,{item:!0,flex:1},a.createElement(g?Kn:Qn,{subscription:t})),!!n&&a.createElement(h.Grid,{item:!0},a.createElement(Ft,{variant:"outlined",onClick:function(){d(!0),Promise.resolve(n(t)).finally((function(){return d(!1)}))}},u?a.createElement(Vn,{loading:!0,size:16,color:o.stigg.palette.text.disabled}):a.createElement(Yn,{style:{display:"flex",marginRight:4},className:"stigg-scheduled-updates-cancel-update-button-icon"}),a.createElement(V,{variant:"body1",color:"primary.main",className:"stigg-scheduled-updates-cancel-update-button"},l)))))}var Jn=l("div",{target:"e1kw2z1l0"})("width:100%;display:flex;flex-direction:column;border-radius:10px;background-color:",(function(e){return e.$backgroundColor}),";border:",(function(e){return"1px solid "+e.$borderColor}),";padding:64px;");function er(e){var t=e.billingPeriod,r=e.rangeEnd,i=e.amount,l=e.currency;return a.createElement(a.Fragment,null,a.createElement(V,{variant:"h6"},"Next estimated bill"),a.createElement(V,{variant:"h1"},xe({amount:i,currency:l,maximumFractionDigits:2})),a.createElement(V,{variant:"body1",color:"secondary"},"Billed ",t===n.BillingPeriod.Monthly?"monthly":"annually"," on"," ",a.createElement(V,{variant:"body1",span:!0,color:"primary"},p.utc(r).format("MMM Do, YYYY"))),a.createElement(V,{variant:"body1",color:"secondary"},"* Additional tax rates may apply"))}function tr(e){var t=e.description;return a.createElement(a.Fragment,null,a.createElement(V,{variant:"h6",color:"secondary"},"No upcoming bill"),a.createElement(V,{variant:"body1",color:"secondary"},t))}var nr=l("div",{target:"e1ftdtst1"})({name:"1nocm2b",styles:"display:flex;flex-direction:column;align-items:left;gap:8px"}),rr=l(S,{target:"e1ftdtst0"})({name:"1l28f5r",styles:"width:fit-content;&.MuiButton-root{padding:0;&:hover{background:none;}}"});function ir(e){var t=e.onContactSupport,n=e.label,r=a.createElement(V,{color:t?"primary.main":"secondary"},e.linkLabel);return a.createElement(nr,{className:"stigg-contact-support-layout"},a.createElement(V,{className:"stigg-contact-support-label",color:"secondary"},n),t?a.createElement(rr,{className:"stigg-contact-support-button",style:{textTransform:"none"},variant:"text",onClick:t},r):r)}var ar,lr,or=l("div",{target:"e1u4onrr0"})("max-height:278px;display:flex;flex-direction:column;border-radius:10px;background-color:",(function(e){return e.theme.stigg.palette.backgroundSection}),";border:",(function(e){return"1px solid "+e.$borderColor}),";padding:32px;gap:16px;");function cr(e){var t,r,i,l,o=e.subscription,c=e.theme,s=e.textOverrides,u=e.onContactSupport,d=o.pricingType,p=null==(t=null==(r=o.prices)?void 0:r.every((function(e){return e.billingModel!==n.BillingModel.UsageBased})))||t,g=null==(i=o.scheduledUpdates)?void 0:i.find((function(e){var t=e.targetPackage;return e.subscriptionScheduleType===n.SubscriptionScheduleType.Downgrade&&(null==t?void 0:t.pricingType)===n.PricingType.Free}));if(d===n.PricingType.Free)l=a.createElement(tr,{description:"You're on a free plan, so you don’t have any upcoming charges"});else if(d===n.PricingType.Paid)if(g&&p)l=a.createElement(tr,{description:"Your plan will be downgraded to a free plan, so you don’t have any upcoming charges"});else if(o.status===n.SubscriptionStatus.InTrial)l=a.createElement(tr,{description:"You’re on a free trial of the "+o.planName+" plan, so you don’t have any upcoming charges"});else{var m,f,h,v,y=null==(m=o.prices)||null==(f=m[0])?void 0:f.billingPeriod,b=null==(h=o.billingPeriodRange)?void 0:h.end,w=null==(v=o.totalPrice)?void 0:v.total;y&&b&&w&&(l=a.createElement(er,{billingPeriod:y,rangeEnd:b,amount:w.amount,currency:w.currency}))}else d===n.PricingType.Custom&&(l=a.createElement(ir,{onContactSupport:u,label:s.contactSupportTitle,linkLabel:s.contactSupportLink}));return a.createElement(or,{className:"stigg-subscription-total-price-layout",$borderColor:c.borderColor},l)}function sr(){return(sr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var ur,dr,pr,gr=function(e){return i.createElement("svg",sr({width:16,height:16,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ar||(ar=i.createElement("path",{d:"M12.947 13.6h-1.013l.001-2.824a.522.522 0 0 0-.18-.392L8.622 7.918l3.134-2.465a.497.497 0 0 0 .18-.392V2.4h1.012c.278 0 .49-.212.49-.49a.481.481 0 0 0-.49-.49H3.053a.481.481 0 0 0-.49.49c0 .278.213.49.49.49h1.013l-.001 2.661c0 .147.065.294.18.392l3.117 2.465-3.117 2.466a.497.497 0 0 0-.18.392V13.6H3.054a.481.481 0 0 0-.49.49c0 .277.213.49.49.49h9.894c.277 0 .49-.213.49-.49a.481.481 0 0 0-.49-.49ZM5.045 2.4h5.91v2.416L8 7.167l-2.955-2.35V2.4Zm0 8.62L8 8.67l2.955 2.334v2.58h-5.91V11.02Z",fill:"#fff"})),lr||(lr=i.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.053 1.254h9.894c.37 0 .657.287.657.656 0 .37-.287.657-.657.657h-.845L12.1 5.06c0 .214-.088.39-.238.519l-.005.004L8.89 7.918l2.974 2.34c.152.13.238.323.238.518l-.001 2.657h.846c.37 0 .657.287.657.657 0 .37-.288.657-.657.657H3.053a.648.648 0 0 1-.657-.657c0-.37.287-.657.657-.657h.846v-2.657c0-.214.087-.39.237-.519l.005-.004 2.953-2.335L4.136 5.58a.688.688 0 0 1-.238-.519V2.567h-.845a.648.648 0 0 1-.657-.656c0-.37.287-.657.657-.657Zm9.894.333H3.053a.315.315 0 0 0-.323.324c0 .185.138.323.323.323h1.18l-.001 2.827c0 .099.043.198.119.264l3.28 2.593-3.28 2.594a.33.33 0 0 0-.119.264v2.99H3.053a.315.315 0 0 0-.323.324c0 .185.138.323.323.323h9.894a.315.315 0 0 0 .323-.323.315.315 0 0 0-.323-.323h-1.18l.001-2.991a.355.355 0 0 0-.119-.264L8.351 7.918l3.298-2.593a.33.33 0 0 0 .119-.264V2.233h1.18a.315.315 0 0 0 .323-.323.315.315 0 0 0-.324-.323Zm-8.069.646h6.244v2.664L8 7.38 4.878 4.897V2.233Zm.334.334v2.169L8 6.955l2.788-2.22V2.568H5.212ZM8 8.457l3.122 2.467v2.827H4.878v-2.81L8 8.456Zm0 .425-2.788 2.219v2.316h5.576v-2.332L8 8.882Z",fill:"#fff"})))},mr=["children","className","placement"],fr=l((function(e){var t=e.children,n=e.className,r=e.placement,i=void 0===r?"top":r,l=D(e,mr);return a.createElement(h.Tooltip,Object.assign({arrow:!0,placement:i},l,{classes:{popper:n,tooltip:"stigg-tooltip",arrow:"stigg-tooltip-arrow"}}),a.createElement("div",null,t))}),{target:"enddsuj0"})((function(e){var t,n=e.theme,r=e.$padding,i=e.$maxWidth;return(t={})["& ."+h.tooltipClasses.tooltip]={backgroundColor:n.stigg.palette.white,maxWidth:void 0===i?300:i,boxShadow:n.stigg.shadows.popover,padding:void 0===r?8:r,borderRadius:n.stigg.border.radius,color:n.stigg.palette.text.primary},t["& ."+h.tooltipClasses.arrow]={color:n.stigg.palette.white},t}),""),hr=C(V)(ur||(ur=R(["\n display: ",";\n -webkit-line-clamp: ",";\n -webkit-box-orient: vertical;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: normal;\n ","\n\n ","\n"])),(function(e){return e.$display}),(function(e){return e.$maxLines}),(function(e){return e.$wordBreak&&P.css(dr||(dr=R(["\n word-break: break-word;\n "])))}),(function(e){return e.$bold&&P.css(pr||(pr=R(["\n font-weight: bold;\n "])))}));function vr(e){return e&&(e.clientHeight<e.scrollHeight||e.offsetWidth<e.scrollWidth)}var yr=function(e){var t=e.leaveDelay,n=e.children,r=e.variant,l=e.color,o=e.maxLines,c=void 0===o?1:o,s=e.wordBreak,u=e.bold,d=e.tooltipPlacement,p=void 0===d?"top":d,g=e.className,m=e.display,f=void 0===m?"-webkit-box":m,h=e.style,v=e["data-testid"],y=i.useState(!1),b=y[0],w=y[1],x=i.useRef(null),E=a.createElement(hr,{ref:x,variant:r,color:l,$maxLines:c,$wordBreak:s,$bold:u,className:g,$display:f,style:h,"data-testid":v},n);i.useEffect((function(){if(null!=x&&x.current){var e=vr(x.current);w(e)}}),[x]);var P=(null==x?void 0:x.current)&&vr(x.current);return a.createElement("span",null,b||P?a.createElement(fr,{placement:p,leaveDelay:t,title:a.createElement(V,{variant:"body1"},n)},E):E)},br=l("div",{target:"el5iwyw1"})("width:100%;display:flex;align-items:center;gap:4px;background-color:",(function(e){return e.theme.stigg.palette.warning}),";border-radius:10px;padding:8px 16px;margin-top:16px;"),wr=l(h.Link,{target:"el5iwyw0"})({name:"69ka7t",styles:"text-decoration-color:white;color:white;cursor:pointer"});function xr(e){var t=e.subscription,r=e.includePlanName,i=e.onManageSubscription;return(null==t?void 0:t.status)!==n.SubscriptionStatus.InTrial?null:a.createElement(br,{className:"stigg-subscription-trial-badge"},a.createElement(gr,{className:"stigg-subscription-trial-badge-image"}),a.createElement("div",{style:{flex:1,marginRight:4}},a.createElement(yr,{variant:"body1",className:"stigg-subscription-trial-badge-text",color:"white"},t.trialRemainingDays+" days remaining in trial",r&&" of the "+t.planName+" plan")),a.createElement(wr,{className:"stigg-subscription-trial-upgrade-button",onClick:i},a.createElement(V,{color:"white"},"Upgrade plan")))}function Er(e){var t=e.mainSubscription,n=e.trialSubscription,r=e.onManageSubscription;return a.createElement("div",{className:"stigg-subscription-view-layout"},a.createElement(V,{className:"stigg-subscription-plan-name",variant:"h1",overrideColor:e.theme.planNameColor,style:{marginTop:8}},t.planName," plan"),a.createElement(xr,{subscription:n,includePlanName:(null==n?void 0:n.planName)!==t.planName,onManageSubscription:r}))}function Pr(e,t){return Math.min(Math.floor(e/t*100),100)}var Cr,Sr=l(L,{target:"e1cbsoof1"})("height:4px;background-color:",(function(e){return s(e.theme.stigg.palette.primary).alpha(.4).string()}),";span{background-color:",(function(e){var t=e.theme;switch(e.$progressStatus){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}}),";}"),Ur=l(h.Divider,{target:"e1cbsoof0"})("border-style:dotted;border-bottom-width:2px;border-color:",(function(e){return s(e.theme.stigg.palette.outlinedRestingBorder).alpha(.4).string()}),";");function Tr(e){var t=e.entitlement;if(t.hasUnlimitedUsage)return a.createElement(Ur,null);var n,r=Pr(t.currentUsage||0,t.usageLimit),i=(n=r)<70?"standard":n<100?"warning":"error";return a.createElement(Sr,{$progressStatus:i,className:"stigg-feature-usage-progress-bar-"+i.toString(),variant:"determinate",value:r})}var kr=C(S)(Cr||(Cr=R(["\n text-transform: none;\n padding: 0;\n white-space: nowrap;\n"])));function Mr(e){var t=e.entitlement,n=e.feature,r=e.onManageSubscription,i=e.onBuyMore,l=e.canBuyMore,o=e.canUpgradeSubscription;return e.hasCustomSubscription||t.hasUnlimitedUsage||Pr(t.currentUsage||0,t.usageLimit)<70?null:l?i?a.createElement(kr,{variant:"text",onClick:function(){return i(n,t)}},a.createElement(V,{color:"primary.main"},"Buy more")):null:o&&r?a.createElement(kr,{variant:"text",onClick:r},a.createElement(V,{color:"primary.main"},"Upgrade")):null}function Nr(e){var t,n,r,i=e.amount,l=e.currency,o=e.entitlement,c=e.feature,s=e.hideChargePrice,u=e.onBuyMore,d=e.onManageSubscription,p=e.canUpgradeSubscription,g=e.hasCustomSubscription;return a.createElement("div",{className:"stigg-charge-list-item",style:{display:"flex",flexDirection:"column",gap:12}},a.createElement("div",{style:{display:"flex",justifyContent:"space-between",gap:12}},a.createElement("div",{style:{display:"flex",gap:12}},a.createElement(yr,{variant:"body1",color:"primary"},c.displayName),!s&&a.createElement(yr,{variant:"body1",color:"secondary"},xe({amount:i,currency:l})," per ",c.featureUnits)),a.createElement("div",{style:{display:"flex",gap:12}},a.createElement(Mr,{entitlement:o,feature:c,canBuyMore:!0,onBuyMore:u,onManageSubscription:d,canUpgradeSubscription:p,hasCustomSubscription:g}),a.createElement(V,{variant:"body1",color:"primary",style:{whiteSpace:"nowrap"}},o.hasUnlimitedUsage?null==(t=o.currentUsage)?void 0:t.toLocaleString():(null==(n=o.currentUsage)?void 0:n.toLocaleString())+" of "+(null==(r=o.usageLimit)?void 0:r.toLocaleString())))),a.createElement(Tr,{entitlement:o}))}function Br(e){var t=e.subscription,r=e.onBuyMore,i=e.onManageSubscription,l=e.hasCustomSubscription,o=e.canUpgradeSubscription,c=m.keyBy(e.entitlements,"feature.refId"),s=t.prices.filter((function(e){var t=e.feature;return!!t&&c[t.refId]&&!!e.price}));return s.length?a.createElement("div",{className:"stigg-charge-list",style:{display:"flex",flexDirection:"column",gap:16,marginTop:32}},s.map((function(e){var t=e.feature,s=e.price;if(!t||!s)return null;var u=c[t.refId];return u&&u.feature?a.createElement(Nr,{key:t.refId,entitlement:u,feature:u.feature,amount:s.amount,currency:s.currency,hideChargePrice:e.billingModel===n.BillingModel.PerUnit,onBuyMore:r,onManageSubscription:i,canUpgradeSubscription:o,hasCustomSubscription:l}):null}))):null}function Lr(e){var t=e.onManageSubscription,r=e.onBuyMore,i=e.onCancelScheduledUpdates,l=e.onContactSupport,o=e.hiddenSections,c=e.cancelScheduledUpdatesButtonTitle,s=Bt(),u=s.customerPortal,d=s.textOverrides,p=s.theme,g=s.isLoading||!u,m=u||{},f=m.subscriptions,h=m.entitlements,v=m.canUpgradeSubscription,y=null==f?void 0:f.find((function(e){return e.status===n.SubscriptionStatus.Active})),b=null==f?void 0:f.find((function(e){return e.status===n.SubscriptionStatus.InTrial})),w=(null==y?void 0:y.pricingType)===n.PricingType.Custom,x=y||b;return a.createElement(Jn,{className:"stigg-customer-portal-subscriptions-overview",$backgroundColor:p.backgroundColor,$borderColor:p.borderColor},!g&&y&&y.scheduledUpdates&&a.createElement(Xn,{theme:p,subscription:y,onCancelScheduledUpdates:i,cancelScheduledUpdatesButtonTitle:c}),g||!x?a.createElement(Wn,null):a.createElement("div",{className:"stigg-overview-layout",style:{display:"flex",alignItems:"flex-start",gap:64}},a.createElement("div",{style:{display:"flex",flexDirection:"column",flex:1}},a.createElement(_t,{onManageSubscription:t,hideManageButton:w,textOverrides:d}),a.createElement(Er,{mainSubscription:x,trialSubscription:b,theme:p,onManageSubscription:t}),y&&h&&a.createElement(Br,{subscription:y,entitlements:h,onBuyMore:r,onManageSubscription:t,canUpgradeSubscription:!!v,hasCustomSubscription:w}),a.createElement(Rn,{customerPortal:u,hiddenSections:o,textOverrides:d,theme:p})),a.createElement("div",{style:{display:"flex",flexDirection:"column",width:319,gap:24}},a.createElement(cr,{subscription:x,theme:p,onContactSupport:l,textOverrides:d}))))}var Ar=l("div",{target:"e2lw8x70"})({name:"7wpci2",styles:"display:flex;width:100%;align-items:flex-end;justify-content:flex-end;margin-bottom:24px"});function Fr(e){return a.createElement(Ar,{className:"stigg-customer-portal-header-layout"},a.createElement(Ke,{source:"customer_portal",showWatermark:e.showWatermark}))}var Ir=l(V,{target:"eb0pe7a1"})({name:"kxbue8",styles:"text-transform:none"}),Or=l(B.ExternalLink,{target:"eb0pe7a0"})("color:",(function(e){return e.theme.stigg.palette.primary}),";");function jr(e){var t=e.text,n=e.url;return a.createElement(Ft,{className:e.className,variant:"outlined",startIcon:a.createElement(Or,{size:20,strokeWidth:2.5}),onClick:function(){window.open(n,"_blank")}},a.createElement(Ir,{color:"primary.main"},t))}var Dr,Rr=l("div",{target:"e12mjvl51"})({name:"1hidw77",styles:"display:flex;flex-direction:column;align-items:flex-start;gap:16px;flex:1 0 0"}),_r=l("div",{target:"e12mjvl50"})({name:"j9hhqa",styles:"display:flex;align-items:flex-start;gap:16px;align-self:stretch"});function Hr(e){var t=e.rows;return a.createElement(Rr,null,a.createElement(V,{variant:"h6",color:"secondary",fontWeight:o.FontWeight.Medium},e.title),t.map((function(e){var t=e.classNamePrefix,n=e.label,r=e.value,i=e.valueTypographyProps;return a.createElement(_r,{key:n},a.createElement(V,Object.assign({className:t+"-label",variant:"body1",color:"secondary",style:{width:80}},e.labelTypographyProps),n),a.createElement(V,Object.assign({className:t+"-text",variant:"body1",color:"secondary"},i),r))})))}function Wr(){return a.createElement(w,{width:220,height:42})}function qr(){var e=Bt(),t=e.customerPortal,n=e.textOverrides,r=e.theme,i=(t||{}).billingInformation,l=!i||e.isLoading,o=[];if(l?o.push.apply(o,[a.createElement(Rr,null,a.createElement(w,{width:220,height:12}),a.createElement(w,{width:220,height:12}),a.createElement(w,{width:220,height:12})),a.createElement(h.Divider,{orientation:"vertical",style:{minHeight:93}}),a.createElement(Rr,null,a.createElement(w,{width:220,height:12}),a.createElement(w,{width:220,height:12}),a.createElement(w,{width:220,height:12}))]):(o.push(a.createElement(Hr,{title:"Billed to",rows:[{classNamePrefix:"stigg-customer-name",label:"Name",value:(null==i?void 0:i.name)||"-",valueTypographyProps:null!=i&&i.name?{}:{color:"disabled"}},{classNamePrefix:"stigg-customer-email",label:"Email",value:(null==i?void 0:i.email)||"-",valueTypographyProps:null!=i&&i.email?{}:{color:"disabled"}}]})),null!=i&&i.defaultPaymentMethodId&&i.defaultPaymentMethodLast4Digits&&i.defaultPaymentExpirationMonth&&i.defaultPaymentExpirationYear&&(o.unshift(a.createElement(h.Divider,{orientation:"vertical",style:{minHeight:93}})),o.unshift(a.createElement(Hr,{title:"Payment method",rows:[{classNamePrefix:"stigg-credit-card",label:"Card",value:"Ending in "+i.defaultPaymentMethodLast4Digits},{classNamePrefix:"stigg-credit-card-expiration",label:"Expires",value:m.padStart(i.defaultPaymentExpirationMonth.toString(),2,"0")+"/"+i.defaultPaymentExpirationYear}]})))),!(l||null!=i&&i.name||null!=i&&i.email||null!=i&&i.defaultPaymentMethodId))return null;var c=l?a.createElement(Wr,null):null!=t&&t.billingPortalUrl?a.createElement(jr,{url:t.billingPortalUrl,text:n.editPaymentDetails,className:"stigg-edit-payment-details-button"}):null;return a.createElement(Jn,{className:"stigg-payment-details-section-layout",$backgroundColor:r.backgroundColor,$borderColor:r.borderColor},a.createElement(jt,{className:"stigg-payment-details-section-header"},a.createElement(Dt,{isLoading:l,className:"stigg-payment-details-section-title",title:"Payment details"}),c),a.createElement("div",{style:{display:"flex",alignItems:"stretch",gap:64}},o))}var Zr=l(Jn,{target:"eqpkdww0"})("position:relative;.stigg-paywall-layout{width:100%;}.stigg-paywall-plans-layout{flex-wrap:nowrap;width:100%;overflow-x:auto;justify-content:unset;padding:0;}.stigg-paywall-plans-layout .stigg-plan-offering-container:first-of-type{margin-left:auto;}.stigg-paywall-plans-layout .stigg-plan-offering-container:last-child{margin-right:auto;}",(function(e){return e.$hideButtons&&c.css(Dr||(Dr=R(["\n .stigg-paywall-plan-button:not([disabled]) {\n display: none;\n }\n "])))})," .","stigg-watermark","{display:none;}"),$r=a.forwardRef((function(e,t){var n=e.paywallComponent,r=e.theme;return n?a.createElement(Zr,{className:"stigg-customer-portal-paywall-section",ref:t,$hideButtons:e.hidePaywallButtons,$backgroundColor:r.backgroundColor,$borderColor:r.borderColor},a.createElement(jt,{className:"stigg-customer-portal-paywall-header"},a.createElement(Dt,{isLoading:e.isLoading,className:"stigg-customer-portal-paywall-section-title",title:e.title})),n):null})),Gr=l("div",{target:"e1gjjeod1"})({name:"6xtw2",styles:"width:100%;display:flex;flex-direction:column;align-items:center;& *{box-sizing:border-box;}"}),zr=l("div",{target:"e1gjjeod0"})({name:"1c31jfu",styles:"width:100%;display:flex;flex-direction:column;align-items:center;row-gap:24px"}),Vr=l("div",{target:"eqqveb80"})("display:flex;flex-direction:column;padding:24px;border:",(function(e){return"1px solid "+e.$borderColor}),";border-radius:10px;row-gap:16px;height:100%;",(function(e){return e.$highlight&&"background-color: "+e.theme.stigg.palette.backgroundSection}),";");function Yr(e){var t,r,i,l,o,c=e.entitlement,s=e.subscriptionPrice,u=e.onManageSubscription,d=e.onBuyMore,g=e.hasCustomSubscription,m=e.canUpgradeSubscription,f=Bt().theme,h=!c.hasUnlimitedUsage&&c.currentUsage>c.usageLimit;return c.feature?a.createElement(Vr,{$highlight:!!s,$borderColor:f.borderColor},a.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:16}},a.createElement(yr,{variant:"body1"},c.feature&&((o=F((l=c.feature).displayName))===F(l.featureUnits||"")||o===F(l.featureUnitsPlural||"")?l.displayName:l.displayName+" ("+l.featureUnitsPlural+")")),s&&a.createElement(fr,{title:a.createElement(V,{variant:"body1"},s.billingModel===n.BillingModel.PerUnit?"Billed for committed usage":"Billed for actual usage")},a.createElement(In,{icon:"DollarCoin",svgStrokeColor:f.iconsColor}))),a.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:8}},a.createElement(yr,{variant:"body1",color:h?"error":"primary","data-testid":"usage-data-"+(null==(t=c.feature)?void 0:t.refId)},null==(r=c.currentUsage)?void 0:r.toLocaleString(),!c.hasUnlimitedUsage&&" / "+(null==(i=c.usageLimit)?void 0:i.toLocaleString())+" ("+Pr(c.currentUsage||0,c.usageLimit)+"%)"),a.createElement(Mr,{entitlement:c,feature:c.feature,onBuyMore:d,canBuyMore:!!s,onManageSubscription:u,canUpgradeSubscription:m,hasCustomSubscription:g})),a.createElement(Tr,{entitlement:c}),c.hasUnlimitedUsage||A(c.usageLimit)||A(c.currentUsage)||!c.resetPeriod||!c.nextResetDate?null:a.createElement(V,{color:"secondary"},function(e){if(!e.resetPeriod||!e.nextResetDate)return null;var t=function(t){return p.utc(e.nextResetDate).diff(p.utc(),t)};switch(e.resetPeriod){case"MONTH":return"Resets monthly - in "+t("days")+" days";case"WEEK":return"Resets weekly - in "+t("days")+" days";case"DAY":return"Resets daily - in "+t("hours")+" hours";case"HOUR":return"Resets hourly - in "+t("minutes")+" minutes";default:return null}}(c)),c.hasUnlimitedUsage&&a.createElement(V,{color:"secondary"},"In current billing period")):null}var Qr=l("div",{target:"eoaojje0"})({name:"3hgi0y",styles:"margin-top:32px"});function Kr(){return a.createElement(h.Grid,{container:!0,spacing:4,className:"stigg-subscription-usage-skeleton-layout"},m.range(6).map((function(e){return a.createElement(h.Grid,{key:e,item:!0,xs:4},a.createElement(w,{width:280,height:120}))})))}function Xr(e){var t=e.onManageSubscription,r=e.onBuyMore,i=a.useState(!1),l=i[0],o=i[1],c=Bt(),s=c.customerPortal,u=c.textOverrides,d=c.theme,p=c.isLoading||!s,g=s||{},f=g.entitlements,v=g.subscriptions,y=null==f?void 0:f.filter((function(e){var t,r;return(null==(t=e.feature)?void 0:t.meterType)===n.MeterType.Fluctuating||(null==(r=e.feature)?void 0:r.meterType)===n.MeterType.Incremental})),b=null==v?void 0:v.find((function(e){return e.status===n.SubscriptionStatus.Active})),w=(null==b?void 0:b.pricingType)===n.PricingType.Custom,x=!(null==s||!s.canUpgradeSubscription),E=m.keyBy(null==b?void 0:b.prices,"feature.refId"),P=m.keyBy(y,"feature.refId"),C=m.compact(null==b?void 0:b.prices.map((function(e){return e.feature&&P[e.feature.refId]}))),S=m.compact(null==y?void 0:y.filter((function(e){return!E[e.feature.refId]}))),U=[].concat(C,S),T=U.length>2?4:6,k=l?U:U.slice(0,6);return p||null!=y&&y.length?a.createElement(Jn,{className:"stigg-subscription-usage-layout",$backgroundColor:d.backgroundColor,$borderColor:d.borderColor},a.createElement(jt,null,a.createElement(Dt,{title:u.usageTabTitle,className:"stigg-customer-portal-usage-section-title",isLoading:p})),p?a.createElement(Kr,null):a.createElement(a.Fragment,null,a.createElement(h.Grid,{container:!0,spacing:4},k.map((function(e){return a.createElement(h.Grid,{item:!0,xs:T},a.createElement(Yr,{key:e.feature.refId,subscriptionPrice:E[e.feature.refId],entitlement:e,onManageSubscription:t,onBuyMore:r,hasCustomSubscription:w,canUpgradeSubscription:x}))}))),U.length>6&&a.createElement(Qr,null,a.createElement(Ft,{className:"stigg-usage-toggle-many-button",variant:"text",startIcon:a.createElement(l?B.Minus:B.Plus,null),onClick:function(){return o((function(e){return!e}))}},l?"Show less":"Show more")))):null}function Jr(e){var t=e.onManageSubscription,r=e.onBuyMore,l=e.onCancelScheduledUpdates,o=e.onContactSupport,c=e.paywallComponent,s=e.hiddenSections,u=ct().stigg,d=Bt(),p=d.customerPortal,g=d.textOverrides,m=d.theme,f=d.isLoading,h=i.useRef(null),v=function(){var e;t?t():null==h||null==(e=h.current)||e.scrollIntoView({behavior:"smooth"})},y=null==p?void 0:p.subscriptions.some((function(e){return e.pricingType===n.PricingType.Custom})),b=!(null!=s&&s.some((function(e){return"usage"===e}))),w=!(null!=s&&s.some((function(e){return"paymentDetails"===e||"billingInformation"===e}))),x=!(null!=s&&s.some((function(e){return"invoices"===e||"billingInformation"===e})));return a.createElement(Gr,{className:"stigg-customer-portal-layout"},a.createElement(Fr,{showWatermark:u.isWidgetWatermarkEnabled&&!!p}),a.createElement(zr,{className:"stigg-customer-portal-sections"},a.createElement(Lr,{onCancelScheduledUpdates:l,onBuyMore:r,onManageSubscription:v,onContactSupport:o,hiddenSections:s,cancelScheduledUpdatesButtonTitle:g.cancelScheduledUpdatesButtonTitle}),b&&a.createElement(Xr,{onManageSubscription:v,onBuyMore:r}),a.createElement($r,{ref:h,paywallComponent:c,hidePaywallButtons:!!y,theme:m,title:g.paywallSectionTitle,isLoading:!p||f}),w&&a.createElement(qr,null),x&&a.createElement(ni,null)))}var ei,ti=["textOverrides","theme","resourceId","productId"];function ni(){var e=Bt(),t=e.customerPortal,n=e.textOverrides,r=e.theme,i=!t||e.isLoading,l=i?a.createElement(Wr,null):null!=t&&t.billingPortalUrl?a.createElement(jr,{url:t.billingPortalUrl,text:n.viewInvoiceHistory,className:"stigg-view-invoice-history-button"}):null;return i||null!=t&&t.billingPortalUrl?a.createElement(Jn,{className:"stigg-invoices-section-layout",$backgroundColor:r.backgroundColor,$borderColor:r.borderColor},a.createElement(jt,{className:"stigg-invoices-section-header"},a.createElement(Dt,{isLoading:i,className:"stigg-invoices-section-title",title:n.invoicesTitle}),l)):null}(ei=exports.ProvisionStatus||(exports.ProvisionStatus={})).IN_PROGRESS="IN_PROGRESS",ei.SUCCEEDED="SUCCEEDED",ei.FAILED="FAILED",Object.keys(n).forEach((function(e){"default"!==e&&Object.defineProperty(exports,e,{enumerable:!0,get:function(){return n[e]}})})),exports.AddonsList=Ht,exports.CustomerPortal=function(e){var t=e.textOverrides,n=e.theme,r=e.resourceId,i=e.productId,l=D(e,ti);return a.createElement(Lt,{textOverrides:t,theme:n,resourceId:r,productId:i},a.createElement(Jr,Object.assign({},l)))},exports.CustomerPortalProvider=Lt,exports.CustomerUsageData=Xr,exports.InvoicesSection=ni,exports.PaymentDetailsSection=qr,exports.Paywall=function(e){var t=e.productId,r=e.resourceId,l=e.highlightedPlanId,o=e.showOnlyEligiblePlans,c=e.textOverrides,s=e.onPlanSelected,d=e.preferredBillingPeriod,m=e.onBillingPeriodChange,f=e.billingCountryCode,h=!!i.useContext(Nt),v=!1;if(h){var y=Bt();v=y.isLoading,r=y.resourceId}var b=function(e){var t=e.productId,r=e.resourceId,a=e.showOnlyEligiblePlans,l=e.billingCountryCode,o=e.preferredBillingPeriod,c=ct(),s=c.stigg,u=c.locale,d=i.useState(n.BillingPeriod.Annually),m=d[0],f=d[1],h=i.useState([]),v=h[0],y=h[1],b=i.useState(null),w=b[0],E=b[1],P=i.useState(!0),C=P[0],S=P[1];i.useEffect((function(){!function(){var e=O(at.mark((function e(){var n,i,a,c;return at.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,S(!0),e.next=4,s.waitForInitialization();case 4:return e.next=6,s.getPaywall({productId:t,resourceId:r,billingCountryCode:l});case 6:i=st((n=e.sent).plans,o),a=i.availableBillingPeriods,c=i.defaultBillingPeriod,E(n),y(a),f(c),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(0),lt.error("Failed to load paywall "+(null==e.t0?void 0:e.t0.message),e.t0);case 16:return e.prev=16,S(!1),e.finish(16);case 19:case"end":return e.stop()}}),e,null,[[0,13,16,19]])})));return function(){return e.apply(this,arguments)}}()()}),[s,t,s.isCustomerLoaded,l,r]);var U=function(e,t){var r,i=e||{},a=i.plans,l=i.currency,o=i.configuration,c=i.customer,s=i.paywallCalculatedPricePoints,u=function(e){var t,r,i,a=!0,l=(null==e?void 0:e.find((function(e){return e.status===n.SubscriptionStatus.InTrial})))||null,o=null==(t=l)?void 0:t.plan,c=null!=(r=l)&&r.trialEndDate?p.utc(l.trialEndDate).diff(p.utc(),"days",!1)+1:void 0;return o||(a=!1,o=null==(i=l=(null==e?void 0:e.find((function(e){return e.status===n.SubscriptionStatus.Active})))||null)?void 0:i.plan),{currentSubscription:l,currentPlan:o,isCustomerOnTrial:a,trialDaysLeft:c}}(i.activeSubscriptions),d=u.currentSubscription,m=u.currentPlan,f=u.isCustomerOnTrial,h=u.trialDaysLeft,v=(null==d?void 0:d.scheduledUpdates)||[],y=null==d||null==(r=d.price)?void 0:r.billingPeriod,b=v.find((function(e){return e.subscriptionScheduleType===n.SubscriptionScheduleType.Downgrade})),w=v.find((function(e){return e.subscriptionScheduleType===n.SubscriptionScheduleType.BillingPeriod})),E=x(a,(function(e){return e.order})).map((function(e){var t,n=null==c||null==(t=c.eligibleForTrial)?void 0:t.find((function(t){return t.productId===e.product.id})),r=e.id===(null==m?void 0:m.id);return j({},e,{paywallCalculatedPricePoints:null==s?void 0:s.filter((function(t){return t.planId===e.id})),isTriable:!g(e.defaultTrialConfig)&&(!n||n.eligible),isCurrentCustomerPlan:r,currentCustomerPlanBillingPeriod:y,isUpcomingPlan:!1,trialDaysLeft:h,isNextPlan:function(t){var n,i=null==b?void 0:b.scheduleVariables,a=null==w?void 0:w.scheduleVariables,l=e.pricePoints.some((function(e){return e.billingPeriod===t}));return b?(null==(n=b.targetPackage)?void 0:n.refId)===e.id&&(!l||i.billingPeriod===t):!(!w||!r)&&a.billingPeriod===t},paywallCurrency:l,scheduledUpdate:b||w})}));if(a&&m){var P,C=m&&(null==a||null==(P=a.find((function(e){return e.id===(null==m?void 0:m.id)})))?void 0:P.order);g(C)||(E=E.map((function(e){return j({},e,{isLowerThanCurrentPlan:C>e.order})})),t&&(E=E.filter((function(e){return e.order>C}))))}var S=o?function(e){var t=e.palette,n=e.layout;return{customCss:e.customCss||void 0,palette:{primary:(null==t?void 0:t.primary)||void 0,backgroundPaper:(null==t?void 0:t.backgroundColor)||void 0,outlinedBorder:(null==t?void 0:t.borderColor)||void 0,backgroundHighlight:(null==t?void 0:t.currentPlanBackground)||void 0,text:{primary:(null==t?void 0:t.textColor)||void 0}},typography:pt(e),layout:{ctaAlignment:gt(null==n?void 0:n.alignment),headerAlignment:gt(null==n?void 0:n.alignment),descriptionAlignment:gt(null==n?void 0:n.alignment),planMaxWidth:ut(null==n?void 0:n.planWidth),planMinWidth:ut(null==n?void 0:n.planWidth),planMargin:ut(null==n?void 0:n.planMargin),planPadding:ut(null==n?void 0:n.planPadding)}}}(o):void 0;return{currentPlan:m,currentSubscription:d,isCustomerOnTrial:f,plans:E,paywallConfiguration:S}}(w,a);return j({customer:(null==w?void 0:w.customer)||null,isLoading:C,selectedBillingPeriod:m,setSelectedBillingPeriod:f,availableBillingPeriods:v,locale:u,configuration:U.paywallConfiguration},U)}({productId:t,resourceId:r,showOnlyEligiblePlans:o,billingCountryCode:f,preferredBillingPeriod:d}),w=b.plans,E=b.customer,P=b.currentSubscription,C=b.isCustomerOnTrial,S=b.isLoading,U=b.selectedBillingPeriod,T=b.setSelectedBillingPeriod,k=b.availableBillingPeriods,M=b.locale,N=b.configuration,B=u({highlightChip:"Recommended",planCTAButton:{upgrade:"Upgrade",downgrade:"Downgrade",startTrial:function(e){var t;return"Start "+(null==(t=e.defaultTrialConfig)?void 0:t.duration)+" day trial"},custom:"Contact us",currentPlan:"Current plan",startNew:"Get started",switchToBillingPeriod:function(e){return e===n.BillingPeriod.Monthly?"Switch to monthly billing":"Switch to annual billing"},cancelScheduledUpdate:"Cancel"},price:{startingAtCaption:"Starts at",free:function(e){return{price:(null==e?void 0:e.symbol)+"0"}},custom:"Custom",priceNotSet:"Price not set"}},c),L=!w||S||v?a.createElement(Pt,null):a.createElement(it,{plans:w,customer:E,currentSubscription:P,selectedBillingPeriod:U,onBillingPeriodChanged:function(e){T(e),m&&m(e)},availableBillingPeriods:k,highlightedPlanId:l,isLoading:S,isCustomerOnTrial:C,onPlanSelected:s,paywallLocale:B,locale:M});return h?L:a.createElement(Mt,{componentTheme:N},L)},exports.Promotions=qt,exports.StiggContext=ot,exports.StiggProvider=function(e){var t=e.apiKey,n=e.baseUri,l=e.baseEdgeUri,o=e.enableEdge,c=e.customerId,s=e.customerToken,u=e.resourceId,d=e.theme,p=e.locale,g=e.useEntitlementPolling,m=e.entitlementPollingInterval,f=e.entitlementsFallback,h=e.stiggClient,v=e.children,y=i.useRef(t),w={apiKey:t,customerId:c,customerToken:s,resourceId:u,baseUri:n,baseEdgeUri:l,enableEdge:o,entitlementsFallback:f,useEntitlementPolling:g,entitlementPollingInterval:m},x=i.useState((function(){return{stigg:null!=h?h:r.initialize(j({},w,{lazyLoad:!0})),locale:p||"en-US",isInitialized:!1,theme:d,refreshData:(e=O(at.mark((function e(){return at.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return P((function(e){return j({},e,{customerPortalUpdatedAt:new Date})})),e.next=3,E.stigg.refresh();case 3:case"end":return e.stop()}}),e)}))),function(){return e.apply(this,arguments)})};var e})),E=x[0],P=x[1];return i.useEffect((function(){var e=!0,n=function(t){e&&P(t)},i=function(){return n((function(e){return j({},e,{updatedAt:new Date})}))},a=function(e){return n((function(t){return t.stigg&&t.stigg.removeListener("entitlementsUpdated",i),e.addListener("entitlementsUpdated",i),j({},t,{stigg:e,isInitialized:!0,updatedAt:new Date})}))};return function(){var e=O(at.mark((function e(){var i;return at.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=E.stigg,t!==y.current&&(lt.log("Updating stigg client",{apiKey:t}),y.current=t,i=r.initialize(j({},w)),n((function(e){return j({},e,{isInitialized:!1,updatedAt:new Date})}))),e.next=4,i.waitForInitialization();case 4:a(i);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()(),function(){e=!1,E.stigg.removeListener("entitlementsUpdated",i),E.stigg.clearCustomer()}}),[t]),i.useEffect((function(){var e=E.stigg;c?e.setCustomerId(c,s,u):e.clearCustomer()}),[c,s,u]),i.useEffect((function(){P((function(e){return j({},e,{theme:d})}))}),[d]),a.createElement(ot.Provider,{value:E},a.createElement(b.SkeletonTheme,{baseColor:"#F5F6F9",highlightColor:"#e5e6ea"},v))},exports.SubscriptionsOverview=Lr,exports.useStiggContext=ct,exports.useWaitForCheckoutCompleted=function(e){var t,n=void 0===e?{}:e,r=n.onProvisionStart,a=n.onProvisionSucceeded,l=n.onProvisionFailed,o=ct().stigg,c=i.useState(exports.ProvisionStatus.IN_PROGRESS),s=c[0],u=c[1],d=i.useState(!1),p=d[0],g=d[1],m=i.useMemo((function(){var e=new URLSearchParams(window.location.search);return t?e.get(t):e}),[t="checkoutCompleted",window.location.search]);return i.useEffect((function(){!function(){var e=O(at.mark((function e(){var t;return at.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(m&&"false"!==m.toLowerCase()&&!p){e.next=2;break}return e.abrupt("return");case 2:return g(!0),r&&r(),e.prev=4,e.next=7,o.waitForCheckoutCompleted();case 7:t=e.sent,u(exports.ProvisionStatus.SUCCEEDED),a&&a(t),e.next=17;break;case 12:e.prev=12,e.t0=e.catch(4),console.error("Failed to wait for checkout to complete",e.t0),u(exports.ProvisionStatus.FAILED),l&&l(e.t0);case 17:return e.prev=17,g(!1),e.finish(17);case 20:case"end":return e.stop()}}),e,null,[[4,12,17,20]])})));return function(){return e.apply(this,arguments)}}()()}),[o,m]),{isAwaitingCheckout:p,provisionStatus:s}};
2
2
  //# sourceMappingURL=react-sdk.cjs.production.min.js.map