PageSourceSearch

https://cdn.savemyexams.com/production/_next/static/chunks/pages/upgrade-fc735808abe679e3.js

js savemyexams.com collected 2026-10-02 07:42:14 UTC 29,697 bytes, 1 lines download raw bytes

1!function(){try{var e="u">typeof window?window:"u">typeof global?global:"u">typeof globalThis?globalThis:"u">typeof self?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[(new e.Error).stack]=function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];if(null!=r)for(var n in r)r.hasOwnProperty(n)&&(e[n]=r[n])}return e}({},e._sentryModuleMetadata[(new e.Error).stack],{"_sentryBundlerPluginAppKey:sme-site":!0});var t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="14520c4a-d73e-4e41-9e9a-e72f47ff9f83",e._sentryDebugIdIdentifier="sentry-dbid-14520c4a-d73e-4e41-9e9a-e72f47ff9f83")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2676],{6923:e=>{let t=e=>new TextEncoder().encode(e);function r(e,r){let n,a,i,s,l,c;for("string"==typeof e&&(e=t(e)),n=3&e.length,a=e.length-n,i=r,c=0;c<a;)l=255&e[c]|(255&e[++c])<<8|(255&e[++c])<<16|(255&e[++c])<<24,++c,i^=l=(65535&(l=(l=(65535&l)*0xcc9e2d51+(((l>>>16)*0xcc9e2d51&65535)<<16)|0)<<15|l>>>17))*0x1b873593+(((l>>>16)*0x1b873593&65535)<<16)|0,i=(65535&(s=(65535&(i=i<<13|i>>>19))*5+(((i>>>16)*5&65535)<<16)|0))+27492+(((s>>>16)+58964&65535)<<16);switch(l=0,n){case 3:l^=(255&e[c+2])<<16;case 2:l^=(255&e[c+1])<<8;case 1:l^=255&e[c],i^=l=(65535&(l=(l=(65535&l)*0xcc9e2d51+(((l>>>16)*0xcc9e2d51&65535)<<16)|0)<<15|l>>>17))*0x1b873593+(((l>>>16)*0x1b873593&65535)<<16)|0}return i^=e.length,i^=i>>>16,i=(65535&i)*0x85ebca6b+(((i>>>16)*0x85ebca6b&65535)<<16)|0,i^=i>>>13,i=(65535&i)*0xc2b2ae35+(((i>>>16)*0xc2b2ae35&65535)<<16)|0,(i^=i>>>16)>>>0}r.v2=function(e,r){"string"==typeof e&&(e=t(e));let n=e.length,a=r^n,i=0,s;for(;n>=4;)s=(65535&(s=255&e[i]|(255&e[++i])<<8|(255&e[++i])<<16|(255&e[++i])<<24))*0x5bd1e995+(((s>>>16)*0x5bd1e995&65535)<<16),s^=s>>>24,a=(65535&a)*0x5bd1e995+(((a>>>16)*0x5bd1e995&65535)<<16)^(s=(65535&s)*0x5bd1e995+(((s>>>16)*0x5bd1e995&65535)<<16)),n-=4,++i;switch(n){case 3:a^=(255&e[i+2])<<16;case 2:a^=(255&e[i+1])<<8;case 1:a^=255&e[i],a=(65535&a)*0x5bd1e995+(((a>>>16)*0x5bd1e995&65535)<<16)}return a^=a>>>13,a=(65535&a)*0x5bd1e995+(((a>>>16)*0x5bd1e995&65535)<<16),(a^=a>>>15)>>>0},r.v3=r,e.exports=r},19055:(e,t,r)=>{"use strict";r.d(t,{BX:()=>c,SL:()=>u,Sd:()=>l,bv:()=>d,cU:()=>p,jN:()=>h,yA:()=>o});var n=r(21952),a=r(61335),i=r(23583),s=r(95922);let l=["* 1917 Save My Exams students were surveyed in September 2025"],c=["* 1,878 Save My Exams teachers surveyed in October 2025"],o=[{title:"Today",subtitle:"Unlock full access to all Save My Exams features.",icon:a.A},{title:"Day 5",subtitle:"Get reminded that your trial is about to end.",icon:i.A},{title:"Day 7",subtitle:"Your account is charged, unless you cancel during the free trial.",icon:n.A}],u=[{title:"Unlimited Revision Notes",subtitle:"Fill knowledge gaps with Revision Notes",icon:n.A},{title:"Unlimited Exam Questions",subtitle:"Feel more prepared and confident with Exam Questions",icon:n.A},{title:"Unlimited Mock Exams",subtitle:"Predict your grade and walk in exam-ready",icon:n.A}],d=[{title:"Downloadable notes & questions",subtitle:"Study online and offline with PDF downloads",icon:n.A},{title:"Guided practice",subtitle:"Adaptive lessons that target exactly where you’re weak",icon:n.A},{title:"Unlimited Smart Mark",subtitle:"Instant, examiner-trained feedback whenever you need it",icon:n.A}],h=[{title:"On average, students go up 2.6 grades*",subtitle:"Proven results. Built for top grades",icon:n.A},{title:"Examiner-written. Exam-board matched",subtitle:"No wasted time. Everything in one place",icon:n.A},{title:"Trusted by 3M+ students & teachers",subtitle:"Real expertise. Less stress",icon:n.A}],p=[{title:"Save time",subtitle:"Teachers save 4h 50m+ per week with Premium",icon:n.A},{title:"Improve Student Grades",subtitle:"On average, teachers who use Premium report improving their students’ grades by 3.5*",icon:n.A},{title:"Unlimited access to examiner-written resources",subtitle:"Access over ".concat(s.JY," questions and ").concat(s.FW," revision notes"),icon:n.A}]},20972:(e,t,r)=>{"use strict";r.d(t,{A:()=>d});
1var n=r(26514),a=r(69001),i=r.n(a),s=r(75303),l=r(95798),c=r.n(l);let o={brand:c().brand,red:c().red},u=e=>{let{className:t,referenceList:r}=e;return(0,n.jsx)("ul",{className:i()(t,c().referencesList),children:r.map((e,t)=>(0,n.jsx)("li",{className:"m-0",children:e},t))})},d=e=>{let{items:t,variant:r="brand",itemReferences:a,showConnectors:l,className:d=""}=e;return(0,n.jsxs)("div",{className:i()("w-100 d-flex flex-column gap-4",d),children:[t.map((e,t)=>(0,n.jsxs)("div",{className:i()(c().feature,{[c().connectors]:l}),children:[(0,n.jsx)("div",{children:(0,n.jsx)("div",{className:i()(c().icon,o[r]),children:(0,n.jsx)(s.A,{svg:e.icon,size:"S"})})}),(0,n.jsxs)("div",{className:"align-self-center",children:[e.title&&(0,n.jsx)("p",{className:c().title,children:e.title}),(0,n.jsx)("p",{className:c().subtitle,children:e.subtitle})]})]},"item".concat(t))),a&&(0,n.jsx)(u,{referenceList:a})]})}},21952:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});var n,a=r(75834);function i(){return(i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(null,arguments)}let s=e=>a.createElement("svg",i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},e),n||(n=a.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m4.59-12.42L10 14.17l-2.59-2.58L6 13l4 4 8-8z"})))},23583:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});var n,a=r(75834);function i(){return(i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(null,arguments)}let s=e=>a.createElement("svg",i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},e),n||(n=a.createElement("path",{d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.9 2 2 2m6-6v-5c0-3.07-1.63-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.64 5.36 6 7.92 6 11v5l-2 2v1h16v-1zm-2 1H8v-6c0-2.48 1.51-4.5 4-4.5s4 2.02 4 4.5z"})))},31779:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}r.d(t,{c:()=>_});var a,i="dahlia",s="https://js.stripe.com",l="".concat(s,"/").concat(i,"/stripe.js"),c=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,o=/^https:\/\/js\.stripe\.com\/(v3|[a-z]+)\/stripe\.js(\?.*)?$/,u=function(){for(var e=document.querySelectorAll('script[src^="'.concat(s,'"]')),t=0;t<e.length;t++){var r,n=e[t];if(r=n.src,c.test(r)||o.test(r))return n}return null},d=function(e){var t=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",r=document.createElement("script");r.src="".concat(l).concat(t);var n=document.head||document.body;if(!n)throw Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return n.appendChild(r),r},h=function(e,t){e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",version:"9.16.0",startTime:t})},p=null,g=null,m=null,y=function(e,t,r){if(null===e)return null;var a,s=t[0];if("string"!=typeof s)throw Error("Expected publishable key to be of type string, got type ".concat(n(s)," instead."));var l=s.match(/^pk_test/),c=3===(a=e.version)?"v3":a;l&&c!==i&&console.warn("Stripe.js@".concat(c," was loaded on the page, but @stripe/stripe-js@").concat("9.16.0"," expected Stripe.js@").concat(i,". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));var o=e.apply(void 0,t);return h(o,r),o},v=!1,f=function(){return a||(a=(null!==p?p:(p=new Promise(function(e,t){if("u"<typeof window||"u"<typeof document)return void e(null);if(window.Stripe,window.Stripe)return void e(window.Stripe);try{var r,n=u();n?n&&null!==m&&null!==g&&(n.removeEventListener("load",m),n.removeEventListener("error",g),null==(r=n.parentNode)||r.removeChild(n),n=d(null)):n=d(null),m=function(){window.Stripe?e(window.Stripe):t(Error("Stripe.js not available"))},g=function(e){t(Error("Failed to load Stripe.js",{cause:e}))},n.addEventListener("load",m),n.addEventListener("error",g)}catch(e){t(e);return}})).catch(function(e){return p=null,Promise.reject(e)})).catch(function(e){return a=null,Promise.reject(e)}))};Promise.resolve().then(function(){return f()}
1).catch(function(e){v||console.warn(e)});var _=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];v=!0;var n=Date.now();return f().then(function(e){return y(e,t,n)})}},34379:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});var n,a=r(75834);function i(){return(i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(null,arguments)}let s=e=>a.createElement("svg",i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},e),n||(n=a.createElement("path",{d:"M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2M6 9h12v2H6zm8 5H6v-2h8zm4-6H6V6h12z"})))},36877:e=>{e.exports={wrapper:"PricesStep_wrapper__9ta6H",grid:"PricesStep_grid__DlkDk"}},38283:e=>{e.exports={features:"PayStep_features__wH1UR",dueToday:"PayStep_dueToday__QVuzF",p:"PayStep_p__oP3_V",summary:"PayStep_summary__Zd2Iu",row:"PayStep_row__8DTe5",divider:"PayStep_divider__Uz3J6",heading:"PayStep_heading__HYEt5",smallPrint:"PayStep_smallPrint__CqGFH",errorLink:"PayStep_errorLink__G3IXh"}},39226:(e,t,r)=>{"use strict";r.d(t,{A:()=>c});var n=r(26514),a=r(69001),i=r.n(a),s=r(97136),l=r.n(s);let c=e=>{let{text:t}=e;return(0,n.jsx)("span",{className:i()("highlighter",l().highlight),children:t})}},40235:(e,t,r)=>{"use strict";r.d(t,{A:()=>l});var n=r(31779),a=r(59750);let{stripePublicKey:i=""}=(0,r(91321).i6)(),s=async e=>{let{numberOfRetries:t=0}=e;try{return await (0,n.c)(i)}catch(e){if(t>0)return await (0,a.fm)(1e3),s({numberOfRetries:t-1});throw Error("[Growth] ".concat(e.message))}},l=s},43440:(e,t,r)=>{"use strict";r.d(t,{D:()=>s});var n=r(84552),a=r(52333),i=r(11906);let s=async(e,t)=>{var r;let s=await a.A.post((0,n.lt)(n.JZ.billing.billingUpdateFlows.list),{data:{type:i.k.BILLING_UPDATE_FLOW,attributes:t||{},relationships:{subscription:{data:{id:e,type:i.k.SUBSCRIPTION}}}}});return{sessionUrl:(null==s||null==(r=s.data)?void 0:r.data.attributes.session.url)||null}}},46823:(e,t,r)=>{"use strict";r.d(t,{U:()=>a});var n=r(74651);function a(e,t,r){let[a,i]=(0,n.x)(null==r?void 0:r.in,e,t);return 12*(a.getFullYear()-i.getFullYear())+(a.getMonth()-i.getMonth())}},50946:e=>{e.exports={container:"Layout_container__wIA41",withHeader:"Layout_withHeader__wvDGW",header:"Layout_header__kPcn_",backButton:"Layout_backButton__iUnFu",closeButton:"Layout_closeButton__3CPiq",content:"Layout_content__iK5FE",title:"Layout_title__129i_",fullWidth:"Layout_fullWidth__EeJlf",right:"Layout_right__3b0ut"}},57757:e=>{e.exports={termsCopy:"UpgradeSmallPrint_termsCopy__SjU_y",termsTitle:"UpgradeSmallPrint_termsTitle__PuCzO"}},61335:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});var n,a=r(75834);function i(){return(i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(null,arguments)}let s=e=>a.createElement("svg",i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},e),n||(n=a.createElement("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6h2c0-1.66 1.34-3 3-3s3 1.34 3 3v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2m0 12H6V10h12zm-6-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2"})))},73103:(e,t,r)=>{"use strict";r.r(t),r.d(t,{__N_SSP:()=>eF,default:()=>eO});var n,a=r(26514),i=r(18690),s=r(22840),l=r(46225),c=r(75834),o=r(99355),u=r(97858),d=r(35202),h=r(54244),p=r(54),g=r(91570),m=r(25829),y=r(17537),v=r(58935);let f=e=>{let{interaction:t,outcome:r,unsuccessfulReason:n,offerLookupKey:a,currency:i}=e;(0,v.u4)(y.Ru.interactedWithUpgradeSubscriptionPage,{interaction:t,outcome:null!=r?r:null,unsuccessfulReason:null!=n?n:null,offerLookupKey:null!=a?a:null,currency:null!=i?i:null})};var _=r(69001),b=r.n(_),x=r(46823),w=r(74160),j=r(74651),A=r(96611),E=r(99795),P=r(8824),S=r(18824),N=r(58780),k=r(89130),L=r(35297),M=r(83798),U=r(20972),F=r(19055),O=r(39226),C=r(11012),I=r(43440),R=r(84552),T=r(95922),H=r(52333),B=r(1334),D=r(95183),W=r(92260);let G="Something went wrong, please try again.",Y="We are unable to process your payment method.",z={card:Y,"4xx":G,"5xx":"Something went wrong, please contact ".concat(T.BH,".")},K=Object.values(D.J7),V=async e=>{var t,r,n;let{subscriptionId:a,offerLookupKey:i}=e,s=await H.A.post((0,R.dk)(R.JZ.billing.subscriptionUpgradeFlows.create),{data:{type:W.kq.SUBSCRIPTION_UPGRADE_FLOW,relationships:{offer:{data:{id:i,type:W.kq.OFFER}},subscription:{data:{id:a,type:W.kq.SUBSCRIPTION}}}}});return s.error&&s.error.code>=500&&(0,B.N)(Error("[createSubscriptionUpgradeFlow] Error creating subscription upgrade flow",{cause:s.error}),{extra:{subscriptionId:a,offerLookupKey:i}}),{data:null!=(t=null==(n=s.data)?void 0:n.data)?t:null,error:null!=(r=s.error)?r:null}},q=async e=>{var t,r,n;let{subscriptionUpgradeFlowId:a}=e,i=await H.A.post((0,R.dk)(R.JZ.billing.subscriptionUpgradeFlows.complete,{params:{id:a}}),{data:{type:W.kq.SUBSCRIPTION_UPGRADE_FLOW}});return i.error&&i.error.code>
1=500&&(0,B.N)(Error("[completeSubscriptionUpgradeFlow] Error completing subscription upgrade flow",{cause:i.error}),{extra:{subscriptionUpgradeFlowId:a}}),{data:null!=(t=null==(n=i.data)?void 0:n.data)?t:null,error:null!=(r=i.error)?r:null}},J=e=>!!e&&K.includes(e),Z=e=>e?"".concat(z.card," ").concat(e):z.card,X=e=>{var t;let r=null==(t=e.validationErrors)?void 0:t.find(e=>{var t;return null==(t=e.path)?void 0:t.some(e=>J(String(e)))});return r?Z(r.message):e.code>=500?z["5xx"]:z["4xx"]};var Q=r(58128),$=r(74025),ee=r(10712),et=r(40235);function er(){return(er=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(null,arguments)}let en=e=>c.createElement("svg",er({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},e),n||(n=c.createElement("path",{d:"M20 4H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2m0 14H4v-6h16zm0-10H4V6h16z"})));var ea=r(75303),ei=r(74737),es=r(91946),el=r.n(es);let ec=e=>{let{email:t}=e;
1return(0,a.jsxs)("div",{className:el().card,children:[(0,a.jsx)(ei.A,{src:"/images/icons/paypal-monogram.png",alt:"PayPal",width:24,height:24}),(0,a.jsx)(L.EY,{children:t?(0,a.jsx)("strong",{children:t}):null})]})},eo=e=>{let{last4:t}=e;return(0,a.jsxs)("div",{className:el().card,children:[(0,a.jsx)(ea.A,{svg:en,size:"M"}),(0,a.jsxs)(L.EY,{children:["Card ending in ",(0,a.jsx)("strong",{children:t})]})]})},eu=e=>{let{method:t,last4:r,email:n}=e;return"paypal"===t?(0,a.jsx)(ec,{email:n}):(0,a.jsx)(eo,{last4:r})};var ed=r(96456),eh=r.n(ed),ep=r(57757),eg=r.n(ep);let em=e=>{let{amountDueToday:t,renewalAmount:r,renewalDate:n,renewalFrequency:i,currency:s}=e,l=(0,$.e8)({amount:t,currency:s,showTrailingZeros:!0}),c=(0,$.e8)({amount:r,currency:s});return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(L.EY,{className:eg().termsTitle,children:(0,a.jsx)("strong",{children:"Recurring billing, cancel anytime"})}),(0,a.jsxs)(L.EY,{className:eg().termsCopy,children:["By upgrading you agree to our"," ",(0,a.jsx)(eh(),{href:u.Ay.PAGES.TERMS,target:"_blank",children:"Terms"})," ","and"," ",(0,a.jsx)(eh(),{href:u.Ay.PAGES.PRIVACY,target:"_blank",children:"Privacy Policy"}),". Your card will be charged ",l," today, then ",c," ",s.toUpperCase()," on ",(0,P.GP)(n,"d MMMM yyyy")," and"," ",i," thereafter, unless you cancel."]})]})};var ey=r(38283),ev=r.n(ey);let ef={paypal:"PayPal Account",card:"card"},e_=e=>{let{price:t,billingSummary:r,upgradePreview:n,currentProductName:i}=e,{subscription:s,paymentMethod:o}=r,d=(0,C.A)(),h=(0,l.useRouter)(),{confirmUpgrade:p,isSubmitting:m,errorMessage:v}=(e=>{let{subscription:t,selectedPrice:r}=e,n=(0,l.useRouter)(),[a,i]=(0,c.useState)(!1),[s,o]=(0,c.useState)(null),d=async e=>{var t,r,n;let a=await (0,et.A)({numberOfRetries:4});if(!a)return G;let{paymentIntent:i,error:s}=await a.retrievePaymentIntent(e);if(s||!i)return null!=(t=null==s?void 0:s.message)?t:G;if("requires_action"===i.status){let{paymentIntent:t,error:n}=await a.handleNextAction({clientSecret:e});if(n||(null==t?void 0:t.status)!=="succeeded")return null!=(r=null==n?void 0:n.message)?r:G}else if("succeeded"!==i.status){let e=i.last_payment_error;return J(null==e?void 0:e.code)?Z(null==e?void 0:e.message):null!=(n=null==e?void 0:e.message)?n:G}return null},h=(e,t)=>{f({interaction:y.W7.upgradeSubscriptionPage.interactions.confirmedUpgrade,offerLookupKey:r.offerLookupKey,currency:r.currency,outcome:e,unsuccessfulReason:t})};return{confirmUpgrade:async()=>{i(!0),o(null);let{data:e,error:a}=await V({subscriptionId:t.id,offerLookupKey:r.offerLookupKey});if(a||!e){let e=a?X(a):G;h(y.W7.outcome.unsuccessful,e),o(e),i(!1);return}let s=e.attributes.client_secret;if(s){let e=await d(s);if(e){h(y.W7.outcome.unsuccessful,e),o(e),i(!1);return}}let{error:l}=await q({subscriptionUpgradeFlowId:e.id});if(l){let e=X(l);h(y.W7.outcome.unsuccessful,e),o(e),i(!1);return}h(y.W7.outcome.successful),await n.push({pathname:u.Ay.PAGES.MEMBERS,query:{upgraded:"true",product_key:r.productKey}})},isSubmitting:a,errorMessage:s}})({subscription:s,selectedPrice:t}),_=new Date(s.attributes.current_period_end_at),R=Math.max(1,(0,x.U)(_,new Date)),T=t.monthlyAmount*R,H=(0,M.AO)(n.attributes.prorated_amount),B=Math.min(0,H-T),D="annual"===t.cycle,W=D?R:Math.max(1,function(e,t){let[r,n]=(0,j.x)(void 0,e,t),a=(0,E.k)(r,void 0),i=(0,E.k)(n,void 0);return Math.round((a-(0,w.G)(a)-(i-(0,w.G)(i)))/A.my)}(_,new Date)),{method:z,last_4:K,email_address:er}=o.attributes,en=Q.$[t.cycle].renewalFrequency,ea=v&&v.startsWith(Y),ei=e=>(0,$.e8)({amount:e,currency:t.currency}),es=async()=>{f({interaction:y.W7.upgradeSubscriptionPage.interactions.clickedToUpdateBillingDetails,offerLookupKey:t.offerLookupKey,currency:t.currency});let e=await (0,I.D)(s.id,{success_path:u.Ay.PAGES.UPGRADE,cancel_path:u.Ay.PAGES.UPGRADE});e.sessionUrl?h.push(e.sessionUrl):h.push(u.Ay.PAGES.MEMBERSHIP)};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(g.A.Left,{children:[(0,a.jsxs)(L.DZ,{tag:"h1",children:["Upgrade to ",(0,a.jsx)(O.A,{text:t.productName})]}),(0,a.jsx)(U.A,{items:d?F.cU:F.bv,className:ev().features}),(0,a.jsx)("hr",{className:ev().divider}),(0,a.jsxs)("div",{className:ev().dueToday,children:[(0,a.jsxs)(L.DZ,{tag:"h5",className:b()(ev().heading,ev().row),children:[(0,a.jsx)("span",{children:"Due today"}),(0,a.jsx)("span",{children:ei(H)})]}),(0,a.jsxs)(L.EY,{size:"M",className:ev().p,children:["You only pay the difference for the ",W," ",(0,ee.td)(D?"month":"week",W)," left on your plan. It then auto-renews at"," ",(0,a.jsxs)("strong",{children:[ei(t.cycleAmount)," ",en," starting"," ",(0,P.GP)(_,"d MMMM yyyy"),"."]})]})]})]}),(0,a.jsx)(g.A.Right,{children:(0,a.jsxs)(k.A,{className:ev().summary,children:[(0,a.jsxs)("div",{className:ev().row,children:[(0,a.jsxs)(L.EY,{children:[t.productName," for the rest of your plan"]}),(0,a.jsx)(L.EY,{children:ei(T)})]}),(0,a.jsxs)("div",{className:ev().row,children:[(0,a.jsxs)(L.EY,{children:["Credit for unused ",i]}),(0,a.jsx)(L.EY,{children:ei(B)})]}),(0,a.jsxs)("div",{className:ev().row,children:[(0,a.jsx)(L.EY,{className:ev().heading,children:"Due today"}),(0,a.jsx)(L.EY,{className:ev().heading,children:ei(H)})]}),(0,a.jsx)("hr",{className:ev().divider}),(0,a.jsx)(L.EY,{className:ev().heading,children:"Payment method"}),(0,a.jsx)(eu,{method:z,last4:K,email:er}),(0,a.jsxs)(L.EY,{size:"S",children:["We'll use the ",ef[z]," on file from your ",i," plan. Your bank may ask you to confirm."]}),v&&!ea&&(0,a.jsx)(S.A,{variant:"danger",title:v,stretch:!0}),v&&ea&&(0,a.jsx)(S.A,{variant:"danger",stretch:!0,children:(0,a.jsxs)(L.EY,{children:[v," Please"," ",(0,a.jsx)(N.A,{variant:"anchor",onClick:es,className:ev().errorLink,children:"update your billing details"})," ","to try again."]})}),(0,a.jsx)(N.A,{variant:"primary",size:"L",stretch:!0,onClick:p,loading:m,disabled:m,children:"Confirm upgrade"})]})}),(0,a.jsx)(g.A.FullWidth,{children:(0,a.jsx)("div",{className:ev().smallPrint,children:(0,a.jsx)(em,{amountDueToday:H,renewalAmount:t.cycleAmount,renewalDate:_,renewalFrequency:en,currency:t.currency})})})]})};var eb=r(21554),ex=r(13725),ew=r(36877),ej=r.n(ew);let eA={annual:"per year",quarterly:"every 3 months",monthly:"a month"},eE=e=>{var t,r,n,i,s,l,c;
1let{billingSummary:o,upgradePrice:u,currentProductName:d,onUpgrade:h,onKeepPlan:p}=e,m=(0,C.A)()?"teacher":"student",{subscription:y,product:v}=o,f=y.attributes.plan,_=(0,Q.m)(f.interval,f.interval_count),b=v.attributes.name,x=null!=(t=y.attributes.plan.currency)?t:u.currency,w=(0,M.AO)(f.amount),j=(0,$.v9)({amount:w,interval:f.interval,intervalCount:f.interval_count});return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(g.A.Title,{children:["Unlock ",(0,a.jsx)(O.A,{text:"all resources"})," today"]}),(0,a.jsx)(g.A.FullWidth,{children:(0,a.jsx)("div",{className:ej().wrapper,children:(0,a.jsxs)("div",{className:ej().grid,children:[(0,a.jsx)(ex.A,{title:d,price:(0,$.e8)({amount:j,currency:x}),suffix:"/ month",subtitle:"Billed at ".concat((0,$.e8)({amount:w,currency:x})," ").concat(eA[_]),features:null!=(r=null==(n=(0,eb.j)(b))?void 0:n.features[m])?r:[],featuresTitle:null==(i=(0,eb.j)(b))?void 0:i.featuresTitle,variant:ex.x.DEFAULT,ctaLabel:"Keep my plan",onCtaClick:p,badge:"Your current plan",badgeVariant:"neutral"}),(0,a.jsx)(ex.A,{...{title:u.productName,price:(0,$.e8)({amount:u.monthlyAmount,currency:u.currency}),suffix:"/ month",subtitle:"Billed at ".concat((0,$.e8)({amount:u.cycleAmount,currency:u.currency})," ").concat(eA[u.cycle]),features:null!=(s=null==(l=(0,eb.j)(u.productKey))?void 0:l.features[m])?s:[],featuresTitle:null==(c=(0,eb.j)(u.productKey))?void 0:c.featuresTitle},variant:ex.x.GRADIENT,ctaLabel:"Upgrade for full access",onCtaClick:()=>h(u),badge:"Most popular"})]})})})]})},eP="prices";var eS=r(98747),eN=r.n(eS);let ek=e=>{var t,r,n;let{billingSummary:i,upgradePreview:s,upgradePrice:l,onClose:o}=e,[u,d]=(0,c.useState)(eP),[h,_]=(0,c.useState)(null),b=null!=(t=null==(n=p.NM.find(e=>e.key===i.product.attributes.name))?void 0:n.name)?t:i.subscription.attributes.plan.name,x=null!=(r=i.subscription.attributes.plan.currency)?r:l.currency;(0,c.useEffect)(()=>{let e=y.W7.upgradeSubscriptionPage.steps.prices;"pay"===u&&(e=y.W7.upgradeSubscriptionPage.steps.pay),(e=>{let{currency:t,step:r}=e;(0,v.u4)(y.Ru.viewedUpgradeSubscriptionPage,{currency:t,step:r})})({currency:x,step:e})},[u]);let w=u===eP,j="pay"===u;return(0,a.jsxs)(g.A,{onClose:j?void 0:o,onBack:j?()=>{_(null),d(eP)}:void 0,className:eN().layout,children:[(0,a.jsxs)(g.A.Content,{className:eN().content,children:[w&&(0,a.jsx)(eE,{billingSummary:i,upgradePrice:l,currentProductName:b,onUpgrade:e=>{f({interaction:y.W7.upgradeSubscriptionPage.interactions.selectedNewProduct,offerLookupKey:e.offerLookupKey,currency:e.currency}),_(e),d("pay")},onKeepPlan:()=>{f({interaction:y.W7.upgradeSubscriptionPage.interactions.selectedExistingProduct}),o()}}),j&&h&&(0,a.jsx)(e_,{price:h,billingSummary:i,upgradePreview:s,currentProductName:b})]}),w&&(0,a.jsx)(m.A,{className:"mt-auto"})]})};var eL=r(15475),eM=r(11906);let eU=async e=>{var t,r;let{subscriptionId:n,offerLookupKey:a,cookie:i=""}=e,s=await H.A.post((0,R.dk)(R.JZ.billing.subscriptionUpgradePreviews.create),{data:{type:eM.k.SUBSCRIPTION_UPGRADE_PREVIEW,relationships:{offer:{data:{id:a,type:eM.k.OFFER}},subscription:{data:{id:n,type:eM.k.SUBSCRIPTION}}}}},{Cookie:i,rid:"anti-csrf"});return s.error&&s.error.code>=500&&(0,B.N)(Error("[createSubscriptionUpgradePreview] Failed to create subscription upgrade preview",{cause:s.error}),{extra:{subscriptionId:n,offerLookupKey:a}}),null!=(t=null==(r=s.data)?void 0:r.data)?t:null};var eF=!0;function eO(e){let{billingSummary:t,ipAddress:r,countryCode:n}=e,p=(0,l.useRouter)(),g=(0,eL.A)(),[m,y]=(0,c.useState)(null),{prices:v}=(0,d.A)({ipAddress:r,countryCode:n,assignToVariant:!1}),f=(0,h.HC)({subscriptionId:t.subscription.id,countryPrices:v,plan:t.subscription.attributes.plan}),_=!f||!m;(0,c.useEffect)(()=>{g&&(f?b(f):p.replace(u.Ay.PAGES.MEMBERS))},[g]);let b=async e=>{let r=await eU({subscriptionId:t.subscription.id,offerLookupKey:e.offerLookupKey});r?y(r):p.replace(u.Ay.PAGES.MEMBERS)};return(0,a.jsxs)(i.N,{mode:"wait",children:[_&&(0,a.jsx)(s.PY1.div,{initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0,scale:.95},transition:{duration:.2},className:"d-flex align-items-center justify-content-center my-5",children:(0,a.jsx)(o.A,{"aria-label":"Loading prices"})},"loading"),!_&&(0,a.jsx)(s.PY1.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.3,ease:"easeOut"},children:(0,a.jsx)(ek,{billingSummary:t,upgradePreview:m,upgradePrice:f,onClose:()=>p.push(u.Ay.PAGES.MEMBERS)})},"content")]})}eO.getLayout=e=>(0,a.jsx)("div",{children:e})},81539:(e,t,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/upgrade",function(){return r(73103)}])},82818:(e,t,r)=>{"use strict";r.d(t,{A:()=>l});var n,a,i=r(75834);function s(){return(s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(null,arguments)}let l=e=>i.createElement("svg",s({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},e),n||(n=i.createElement("path",{d:"M13 8.57a1.43 1.43 0 1 0 0 2.86 1.43 1.43 0 0 0 0-2.86"})),a||(a=i.createElement("path",{d:"M13 3C9.25 3 6.2 5.94 6.02 9.64L4.1 12.2a.5.5 0 0 0 .4.8H6v3c0 1.1.9 2 2 2h1v3h7v-4.68A6.999 6.999 0 0 0 13 3m3 7c0 .13-.01.26-.02.39l.83.66c.08.06.1.16.05.25l-.8 1.39c-.05.09-.16.12-.24.09l-.99-.4c-.21.16-.43.29-.67.39L14 13.83c-.01.1-.1.17-.2.17h-1.6c-.1 0-.18-.07-.2-.17l-.15-1.06c-.25-.1-.47-.23-.68-.39l-.99.4c-.09.03-.2 0-.25-.09l-.8-1.39a.19.19 0 0 1 .05-.25l.84-.66c-.01-.13-.02-.26-.02-.39s.02-.27.04-.39l-.85-.66c-.08-.06-.1-.16-.05-.26l.8-1.38c.05-.09.15-.12.24-.09l1 .4c.2-.15.43-.29.67-.39L12 6.17c.02-.1.1-.17.2-.17h1.6c.1 0 .18.07.2.17l.15 1.06c.24.1.46.23.67.39l1-.4c.09-.03.2 0 .24.09l.8 1.38a.2.2 0 0 1-.05.26l-.85.66c.03.12.04.25.04.39"})))},85388:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});var n,a=r(75834);function i(){return(i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(null,arguments)}let s=e=>a.createElement("svg",i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},e),n||(n=a.createElement("path",{d:"M18 2h-8L4 8v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m-6 15-4-4h3V9.02L13 9v4h3z"})))},91570:(e,t,r)=>{"use strict";r.d(t,{A:()=>d});var n=r(26514),a=r(69001),i=r.n(a),s=r(35297),l=r(32927),c=r(50946),o=r.n(c);let u=e=>{let{onBack:t,onClose:r,className:a,children:s}=e,c=!!t||!!r;return(0,n.jsxs)("div",{className:i()(o().container,{[o().withHeader]:c},a),children:[c&&(0,n.jsx)(l.A,{onBack:t,onClose:r}),s]})};u.Content=e=>{let{className:t,children:r}=e;return(0,n.jsx)("div",{className:i()(o().content,t),children:r})},u.FullWidth=e=>{let{className:t,children:r}=e;return(0,n.jsx)("div",{className:i()(o().fullWidth,t),children:r})},u.Title=e=>{let{className:t,children:r}=e;return(0,n.jsx)("div",{className:i()(o().title,t),children:(0,n.jsx)(s.DZ,{tag:"h1",children:r})})},u.Left=e=>{let{className:t,children:r}=e;return(0,n.jsx)("div",{className:t,children:r})},u.Right=e=>{let{className:t,children:r}=e;return(0,n.jsx)("div",{className:i()(o().right,t),children:r})};let d=u},91946:e=>{e.exports={card:"PaymentMethod_card__IdSKg"}},95798:e=>{e.exports={feature:"FeatureList_feature__Q2D7r",icon:"FeatureList_icon__IeS00",brand:"FeatureList_brand__kc2xl",red:"FeatureList_red__5G52C",title:"FeatureList_title__B_Foz",subtitle:"FeatureList_subtitle___d8IH",connectors:"FeatureList_connectors__2wWe6",referencesList:"FeatureList_referencesList__Q4XkK"}},97136:e=>{e.exports={"text-green":"Highlight_text-green__GFFMk","text-preline":"Highlight_text-preline__NFfT2",highlighter:"Highlight_highlighter__hVBW0","highlighter-blue":"Highlight_highlighter-blue___0tXr",highlight:"Highlight_highlight__d6Y2j","highlighter-yellow":"Highlight_highlighter-yellow__k4JHz","highlighter-green":"Highlight_highlighter-green__xJ_IF","highlighter-purple":"Highlight_highlighter-purple__m8Vub","bg-gradient-subtle":"Highlight_bg-gradient-subtle__j2V8b","bg-gradient-hero":"Highlight_bg-gradient-hero__BAkOn","hide-scrollbar":"Highlight_hide-scrollbar__z1z7_","offset-scroll-to-view":"Highlight_offset-scroll-to-view__yuIUq","text-on-brand":"Highlight_text-on-brand__iCOOw","filter-to-brand":"Highlight_filter-to-brand__3hoKP"}},98747:e=>{e.exports={content:"UpgradeWall_content__7CPut",layout:"UpgradeWall_layout__LRnE8"}},99355:(e,t,r)=>{"use strict";r.d(t,{A:()=>
1o});var n=r(69001),a=r.n(n),i=r(75834),s=r(20090),l=r(26514);let c=i.forwardRef((e,t)=>{let{bsPrefix:r,variant:n,animation:i="border",size:c,as:o="div",className:u,...d}=e;r=(0,s.oU)(r,"spinner");let h="".concat(r,"-").concat(i);return(0,l.jsx)(o,{ref:t,...d,className:a()(u,h,c&&"".concat(h,"-").concat(c),n&&"text-".concat(n))})});c.displayName="Spinner";let o=c}},e=>{e.O(0,[9967,636,6593,8792],()=>e(e.s=81539)),_N_E=e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.