"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6872],{36872:function(e,r,a){a.r(r),a.d(r,{default:function(){return j}});var t=a(41120),n=(a(67294),a(35809)),i=a(92809),o=a(99956),c=a(43832),s=a(22318),l=a(282),f=a(27361),u=a.n(f),m=a(68751),d=a(11163),p=a(10861),h=a(58885),g=a(85893),x=(0,t.Z)((function(e){var r;return{affirmContainer:function(r){return{maxWidth:u()(e,"breakpoints.values.lg","1224px"),padding:r.isHome?e.spacing(0,.5):e.spacing(4,.5)}},affirmInnerContainer:function(r){return{background:"DARK"===r.affirmTheme?u()(e,"palette.promo.darkBackground"):u()(e,"palette.promo.lightBackground"),width:"100%","& p":{color:"DARK"===r.affirmTheme?u()(e,"palette.text.secondary"):u()(e,"palette.text.primary"),"& a":{color:"inherit",textTransform:"capitalize","&:hover":{color:"inherit"}}},"& .MuiButton-containedPrimary":{backgroundColor:u()(e,"palette.secondary.main"),color:"#ffffff",padding:e.spacing(1.375,3),borderRadius:e.spacing(.5),"&:hover":{backgroundColor:"#5200d8"}},"& .MuiButton-containedSecondary":{backgroundColor:u()(e,"palette.background.default"),padding:e.spacing(1.375,3),borderRadius:e.spacing(.5),"&:hover":{backgroundColor:u()(e,"palette.background.hover")}}}},affirmSpacing:(r={},(0,i.Z)(r,e.breakpoints.up("md"),{padding:e.spacing(3,8,1,8),display:"flex",justifyContent:"space-between",alignItems:"center"}),(0,i.Z)(r,e.breakpoints.down("md"),{padding:e.spacing(3,3,1,3)}),(0,i.Z)(r,e.breakpoints.down("sm"),{padding:e.spacing(3),"& p":{paddingBottom:e.spacing(1)},textAlign:"center"}),r),affirmHeader:{fontSize:"2.8rem"},homeBg:function(r){return{backgroundColor:r.isHome?u()(e,"palette.promo.lightBackground"):e.palette.background.default}}}}));function y(e){var r=(0,h.Oc)().prismicConfig,a=(0,d.useRouter)(),t=(0,p.Qc)(a.asPath,!1).pathname,n=u()(e,"children"),i=e.isHome,f=x({affirmTheme:u()(e,"affirmColorTheme","DARK"),isHome:i});return(0,g.jsx)(o.Z,{className:f.homeBg,children:(0,g.jsx)(c.Z,{className:f.affirmContainer,children:(0,g.jsx)("div",{className:f.affirmInnerContainer,children:(0,g.jsxs)(o.Z,{className:f.affirmSpacing,children:[(0,g.jsxs)(o.Z,{children:[(0,g.jsx)(s.Z,{color:"DARK"===e.affirmColorTheme?"textSecondary":"textPrimary",variant:"h4",className:f.affirmHeader,children:"Study Now, Pay Later."}),n]}),(0,g.jsx)(l.Z,{variant:"contained",color:"DARK"===e.affirmColorTheme?"secondary":"primary",href:"https://www.affirm.com/apps/prequal/?public_api_key=".concat(r.affirm_public_key,"&use_best_terms=true&use_promo=true&referring_url=").concat(r.root).concat(t.trim().slice(1)),children:m.Z.asText(r.affirm_link)})]})})})})}var b=a(52829),v=(0,t.Z)((function(){return{affirmImg:function(e){return{width:"50px",height:"20px",marginBottom:"DARK"===e.affirmTheme?"-1px":""}}}}));function j(e){var r=v({affirmTheme:u()(e,"affirmColorTheme","DARK")}),a=e.isHome;return e.affirmPromoBanner?(0,g.jsx)(n.default,{children:(0,g.jsx)(b.Z,{pageType:"homepage",Img:r.affirmImg})}):(0,g.jsx)(y,{affirmColorTheme:e.affirmColorTheme,isHome:a,children:(0,g.jsx)(b.Z,{pageType:"homepage",Img:r.affirmImg,affirmColorTheme:e.affirmColorTheme})})}},52829:function(e,r,a){a.d(r,{Z:function(){return g}});var t=a(67294),n=a(69135),i=a(27361),o=a.n(i),c=a(40590),s=a(68751),l=a(58885),f=a(8920),u=a(10861),m=a(11163),d=a(96486),p=a(82872),h=a(85893);function g(e){var r=e.affirmColorTheme,a=e.affirmEligible,i=e.affirmPromoMessage,g=e.classes,x=e.pageType,y=e.Img,b=e.product,v=e.bundles,j=(0,l.Oc)(),w=j.config,k=j.query,Z=j.prismicConfig,C=j.country,N=(0,n.useAmp)(),D=(0,f.Z)(),S="dark"===o()(D,"palette.type"),T=o()(w,"affirm.logoPath")&&!N&&S?o()(w,"affirm.logoPath"):"DARK"===r?"/static/images/affirm_white_logo-solid_bg.svg":"/static/images/affirm_logo.svg",_="affirm logo",I=(0,m.useRouter)(),A=(0,u.Qc)(I.asPath,!1).path,B=function(e,r,a){return a||(a=o()(e,"affirm")),r&&r.classIds&&r.classIds.length>0&&(r=Object.values({key:{catalog:r}})),r&&r.length>0&&e&&a?(0,d.reduce)(r,(function(r,t){var n=t.catalog;if(!(n&&n.affirm&&n.affirm.ala&&n.affirm.link))return a;var i=e&&e.affirm&&parseInt((0,p.Zx)(e),10),o=n&&n.affirm&&parseInt((0,p.Zx)(n),10),c=i+o,s=n.affirm.ala.replace(o,c),l=n.affirm.link.replace(n.promoPrice,e.promoPrice+n.promoPrice);return i&&{ala:s,link:l}}),a):a}(b,v,i),R=B&&o()(B,"ala",void 0),P=B&&decodeURIComponent(o()(B,"link",void 0)),F=B&&P?P.indexOf("kaptest")>-1?P&&P.replace("https://www.kaptest.com","https://www.kaptest.com".concat(A)):P&&P.replace("https://www.manhattanprep.com","https://www.manhattanprep.com".concat(A)):void 0;return(0,t.useEffect)((function(){window&&window.affirm&&window.affirm.ui&&window.affirm.ui.ready()&&C&&"US"===C&&window.affirm.ui.refresh()})),(0,h.jsx)(h.Fragment,{children:C&&"US"===C&&(0,h.jsx)(h.Fragment,{children:k&&"1"===k.automation?(0,h.jsx)("span",{}):"product"===x||"landing"===x?a&&B&&(0,h.jsx)("span",{className:g,children:(0,h.jsx)("p",{children:(0,h.jsx)("a",{href:"".concat(F),children:R})})}):"product-detail"===x?a&&B&&(0,h.jsx)("span",{className:g,children:(0,h.jsxs)("p",{children:[(0,h.jsxs)("a",{href:"".concat(F),children:[R," with "]}),(0,h.jsx)(c.$V,{noLazy:!0,src:{url:T,alt:_,dimensions:{width:50,height:20}},className:y,ariaLabel:_}),". ",(0,h.jsx)("a",{href:"/affirm",children:"Learn more"})]})}):(0,h.jsx)("span",{className:g,children:(0,h.jsxs)("p",{children:[s.Z.asText(Z.affirm),(0,h.jsx)(c.$V,{noLazy:!0,src:{url:T,alt:_,dimensions:{width:50,height:20}},className:y,ariaLabel:_}),". ",(0,h.jsx)("a",{href:"/affirm",children:"Learn More"})]})})})})}},74831:function(e,r,a){a.d(r,{of:function(){return t},dB:function(){return n},I7:function(){return i},FD:function(){return o},rf:function(){return c},NJ:function(){return s},AP:function(){return l},at:function(){return f},a6:function(){return u},t1:function(){return m}});var t=1,n="startDate",i="endDate",o="testDate",c="distance",s=5,l=3,f=1040075751,u={name:"Online",distance:-1,id:1},m={all:{defaultValue:c,options:[{label:"Sort by Distance",value:c},{label:"Sort by Start Date",value:n},{label:"Sort by End Date",value:i}]},o:{defaultValue:n,options:[{label:"Sort by Start Date",value:n},{label:"Sort by End Date",value:i}]},ip:{defaultValue:c,options:[{label:"Sort by Distance",value:c},{label:"Sort by Start Date",value:n},{label:"Sort by End Date",value:i}]}}},82872:function(e,r,a){a.d(r,{XH:function(){return t},ap:function(){return i},df:function(){return o},Zx:function(){return c}});a(74831);var t=function(e){var r=e.reduce((function(e,r){var a=r.facility,t=e[a.id];return t?t.classes.push(r):e[a.id]={facility:a,classes:[r]},e}),{});return Object.keys(r).reduce((function(e,a){return e.push(r[a]),e}),[]).sort((function(e,r){return e.facility.distance-r.facility.distance}))},n=["January","February","March","April","May","June","July","August","September","October","November","December"],i=function(e,r){return e.reduce((function(e,a){var t=0===e.length?0:e.length-1,i=new Date(a[r]),o=i.getMonth(),c=n[o],s=i.getFullYear();return e[t]&&e[t].month===c?e[t].classes.push(a):e.push({month:c,year:s,classes:[a]}),e}),[])},o=function(e,r){return e.sort((function(e,a){return Date.parse(e[r])-Date.parse(a[r])>=0?1:-1}))},c=function(e){return e&&e.affirm&&e.affirm.ala?e.affirm.ala.split("$").pop().split("/")[0]:0}},35809:function(e,r,a){a.r(r),a.d(r,{default:function(){return h}});var t=a(43832),n=a(99956),i=a(22318),o=a(41120),c=a(27361),s=a.n(c),l=a(67294),f=a(68751),u=a(24216),m=a(85893);function d(e){var r=s()(e,"start",void 0),a=s()(e,"end",void 0);if(void 0===r||!r||void 0===a)return null;if(!(0,u.Kh)((0,u.cQ)(),(0,u.NN)(r),(0,u.NN)(a)))return null;var t=function(){var e=(0,u.NN)(a)-+(0,u.cQ)(),r={};return e>0&&(r={d:Math.floor(e/864e5),h:Math.floor(e/36e5%24),m:Math.floor(e/1e3/60%60),s:Math.floor(e/1e3%60)}),r},n=(0,l.useState)(t()),i=n[0],o=n[1];(0,l.useEffect)((function(){setTimeout((function(){o(t())}),1e3)}));var c=[];return Object.keys(i).forEach((function(e,r){i[e]&&c.push((0,m.jsx)("span",{children:!("d"===e&&0===i[e])&&(0,m.jsxs)(m.Fragment,{children:[i[e],e," "]})},r))})),(0,m.jsxs)(m.Fragment,{children:["Offer ends in ",c.length&&c]})}var p=(0,o.Z)((function(e){return{root:{background:s()(e,"palette.promo.background"),"& a":{color:s()(e,"palette.promo.text")}},container:{maxWidth:s()(e,"breakpoints.values.xl","1224px"),padding:e.spacing(0,.5,0,.5)},wrapper:{display:"flex",justifyContent:"space-between",alignItems:"center",minHeight:e.spacing(7)},promoBox:function(r){return{display:"flex",padding:e.spacing(1,1.5),textAlign:r.textAlign,alignItems:"center",flexGrow:1,"& p:last-child":{marginBottom:0}}},promoText:{width:"100%","& p":{color:s()(e,"palette.promo.text"),display:"inline",fontFamily:s()(e,"palette.promo.fontFamily","inherit"),fontSize:e.typography.body2.fontSize},"& p:last-child":{marginBottom:0}},close:{width:e.spacing(8),display:"flex",justifyContent:"flex-end",alignItems:"center"}}}));function h(e){var r=(0,l.useState)(!0),a=r[0],o=(r[1],p({textAlign:s()(e,"data.primary.alignment","center")})),c=s()(e,"data.primary.text"),h=s()(e,"data.primary.start_counter",void 0),g=s()(e,"data.primary.end_counter",void 0),x=s()(e,"children"),y=(0,u.RR)(new Date,g);return(0,m.jsx)(m.Fragment,{children:(y&&a||x)&&(0,m.jsx)("div",{className:o.root,children:(0,m.jsx)(t.Z,{className:o.container,children:(0,m.jsx)(n.Z,{className:o.wrapper,children:(0,m.jsx)(n.Z,{className:o.promoBox,children:(0,m.jsxs)(n.Z,{className:o.promoText,children:[c&&(0,m.jsx)(f.Z,{render:c}),h&&g&&(0,m.jsxs)(i.Z,{variant:"body1",children:[" ",(0,m.jsx)(d,{start:h,end:g})]}),x&&(0,m.jsx)(m.Fragment,{children:x})]})})})})})})}}}]);