1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6025],{20016:(e,n,r)=>{r.d(n,{h:()=>t});let t=(e,n)=>Math.min(100*(1-(1-n/100)*(1-e/100)),100)},31204:(e,n,r)=>{r.d(n,{q:()=>t});let t=(e,n)=>n?e.replace(/\{\{(\w+)\}\}/g,(e,r)=>{let t=n[r];return null==t?e:String(t)}):e},81614:(e,n,r)=>{r.d(n,{u:()=>o});var t=r(80263),a=r(98245),l=r(18696);let o=e=>{let{onClick:n,...r}=e;return(0,t.jsx)(l.$,{...r,onClick:e=>{(0,a.ph)(),null==n||n(e)}})}},96025:(e,n,r)=>{r.d(n,{$U:()=>f,E$:()=>p,Tq:()=>m,dx:()=>g,eZ:()=>x,iC:()=>h,lF:()=>y});var t=r(80263),a=r(31204),l=r(20016),o=r(71187),i=r(53239),s=r(81614),u=r(18696),c=r(16679),d=r(67106),g=function(e){return e.DEFAULT="default",e.SMALL_BANNER="smallBanner",e.TEXT_ONLY="textOnly",e}({}),p=function(e){return e.DEFAULT="default",e.GREEN_HIGHLIGHT="greenHighlight",e}({});let f=(e,n)=>{let r=e.length;return{planCount:r,isAllPlans:r===n,planNames:e}},h=e=>{if(!e)return;let n=new Date(e),r=new Date;return(n.getTime()-r.getTime())/36e5<24?"very_soon":(n.setDate(n.getDate()-1),n.toLocaleDateString("en-US",{month:"short",day:"2-digit"}))},b=e=>(null==e?void 0:e.toUpperCase())==="YEARLY",x=e=>{if(!e)return!1;let n=new Date(e).getTime()-Date.now();return n>0&&n<=2592e5},m=e=>{if(!e)return!1;let n=new Date(e).getTime()-Date.now();return n>0&&n<=864e5},P=e=>{let{expiresAt:n,endsInLabel:r}=e,[a,l]=(0,i.useState)(()=>Math.max(0,n-Date.now()));(0,i.useEffect)(()=>{let e=()=>l(Math.max(0,n-Date.now()));e();let r=setInterval(e,1e3);return()=>clearInterval(r)},[n]);let o=Math.floor(a/1e3),s=Math.floor(o/3600),u=Math.floor(o/60%60),c=e=>e.toString().padStart(2,"0");return(0,t.jsxs)(F,{children:[r," ",c(s),":",c(u),":",c(o%60)," hrs."]})},k=e=>{let{expiresAt:n,daysLeftLabel:r}=e,[l,o]=(0,i.useState)(()=>Math.ceil((n-Date.now())/864e5));return(0,i.useEffect)(()=>{let e=()=>{o(Math.ceil((n-Date.now())/864e5))};e();let r=setInterval(e,1e3);return()=>clearInterval(r)},[n]),(0,t.jsx)(F,{children:r?(0,a.q)(r,{daysLeft:l}):null})},y=e=>{var n,r,u,g,p,y,j,A,M,v;let{packs:S,bannerType:T="default",showColoredBorder:I=!1,offerBannerText:_,cardLayoutVariant:B}=e,{discountCode:q,offerType:H,disableAutoApply:E,campaignName:N,expiryDate:Y,offerEndAt:R,packsWithOffer:U,duration:O,durationType:V,hideEndDate:$,highestDiscountPercentage:G,campaignIconUrl:z,currentDiscountValue:W,offeredPacksSubscriptionCycles:X}=(0,i.useMemo)(()=>{let e=Object.values(S),n,r,t,a,o,i,s,u,c,d,g=0,p=[],f=[],b=0;return S&&e.forEach(e=>{let{offer:x,differentialPricingDiscountPercent:m=0}=e;if(x){var P,k,y,L;let l=null==x?void 0:x.offer_details;a=null==x||null==(P=x.data)?void 0:P.campaign_name,d=null==x||null==(k=x.data)?void 0:k.campaign_icon_url,t=null==x||null==(y=x.data)?void 0:y.disable_auto_apply,o=h(null==x?void 0:x.end_at),i=null==x?void 0:x.end_at,c=null==x||null==(L=x.data)?void 0:L.hide_end_date,l&&(p.push(e.label),f.push(e.subscriptionCycle),n=l.discount_code,r=l.type,s=l.duration,u=l.duration_type,g=Number(l.discount_value)||0)}let w=(0,l.h)(g,m);b=Math.max(b,w)}),{discountCode:n,offerType:r,disableAutoApply:t,campaignName:a,expiryDate:o,offerEndAt:i,packsWithOffer:p,duration:s,durationType:u,hideEndDate:c,highestDiscountPercentage:Math.round(b).toString(),campaignIconUrl:d,currentDiscountValue:g,offeredPacksSubscriptionCycles:f}},[S]),Z=(0,i.useMemo)(()=>f(U,Object.values(S).length),[U,S]),J=(0,i.useMemo)(()=>X.length>0&&X.every(b),[X]),K=(0,i.useCallback)(e=>e.map(e=>{switch(e.toLowerCase().replace(/\s+/g,"_")){case"quarterly":case"3_months":return _.quarterlyPackLabel;case"annual":case"12_months":return _.annualPackLabel;case"monthly":case"1_month":return _.monthlyPack;case"6_months":return _.semiAnnualPack;default:return e}}),[_.quarterlyPackLabel,_.annualPackLabel,_.monthlyPack,_.semiAnnualPack]),Q=(0,i.useMemo)(()=>{let{planCount:e,isAllPlans:n,planNames:r}=Z,t=K(r);if(!_.durationPitchForAllPacks&&!_.durationPitchForSinglePack&&!_.durationPitchForMultiplePacks)return;let l=V&&V.includes("month")&&_.monthLabel||V;if(n&&_.durationPitchForAllPacks)return(0,a.q)(_.durationPitchForAllPacks,{duration:O,durationType:l});if(1===e&&_.durationPitchForSinglePack)return(0,a.q)(_.durationPitchForSinglePack,{duration:O,durationType:l,singlePlan:t[0]});if(e>1&&_.durationPitchForMultiplePacks){let n=t[e-1],r=t.slice(0,-1).join(", ");return(0,a.q)(_.durationPitchForMultiplePacks,{duration:O,durationType:l,planList:r,lastPlan:n})}},[O,V,K,Z,_.durationPitchForAllPacks,_.durationPitchForMultiplePacks,_.durationPitchForSinglePack,_.monthLabel]),ee=(0,i.useMemo)(()=>{let{planCount:e,isAllPlans:n,planNames:r}=Z,t=K(r);if(_.nonDifferentialPitchForAllPacks||_.nonDifferentialPitchForSinglePack||_.nonDifferentialPitchForMultiplePacks){if(n&&_.nonDifferentialPitchForAllPacks)return(0,a.q)(_.nonDifferentialPitchForAllPacks,{currentDiscountValue:W});if(1===e&&_.nonDifferentialPitchForSinglePack)return(0,a.q)(_.nonDifferentialPitchForSinglePack,{currentDiscountValue:W,singlePlan:t[0]});if(e>1&&_.nonDifferentialPitchForMultiplePacks){let n=t[e-1],r=t.slice(0,-1).join(", ");return(0,a.q)(_.nonDifferentialPitchForMultiplePacks,{currentDiscountValue:W,planList:r,lastPlan:n})}}},[W,K,Z,_.nonDifferentialPitchForAllPacks,_.nonDifferentialPitchForMultiplePacks,_.nonDifferentialPitchForSinglePack]),en=(0,i.useMemo)(()=>
1{if(_.autoApplyPlansPitch)return(0,a.q)(_.autoApplyPlansPitch,{highestDiscountPercentage:G,plansLabel:J?_.annualPackLabel:_.selectPlansLabel})},[G,J,_.annualPackLabel,_.autoApplyPlansPitch,_.selectPlansLabel]),er=(0,i.useMemo)(()=>!$&&Y&&N?"very_soon"===Y?_.endSoonLabel:(0,a.q)(_.endDateLabel,{expiryDate:Y}):null,[N,Y,$,_.endDateLabel,_.endSoonLabel]),et=(0,i.useMemo)(()=>{if($||!N)return null;if(R&&e.showCountdown){let e=new Date(R).getTime();if(m(R))return(0,t.jsx)(P,{expiresAt:e,endsInLabel:_.endsInLabel});if(x(R))return(0,t.jsx)(k,{expiresAt:e,daysLeftLabel:_.daysLeftLabel})}return er},[N,er,$,_.endsInLabel,_.daysLeftLabel,R,e.showCountdown]),ea=(0,i.useCallback)(()=>{let n=()=>{var n,r;return(0,t.jsxs)(t.Fragment,{children:["default"===T&&(0,t.jsx)(F,{children:null!=N?N:_.discountDefaultCampaignName})," ",(0,t.jsx)("span",{dangerouslySetInnerHTML:(0,o.Y)((0,a.q)(_.upgradeLabel,{currentDiscountValue:W}))}),"default"===T&&(0,t.jsxs)(t.Fragment,{children:[" ",er," ",q&&E&&(0,t.jsx)("span",{dangerouslySetInnerHTML:(0,o.Y)((0,a.q)(_.discountCodeLabelForDisableAutoApply,{discountCode:q}))}),!E&&(0,t.jsx)("span",{dangerouslySetInnerHTML:(0,o.Y)(q?(0,a.q)(_.discountCodeLabelForAutoApply,{discountCode:q}):_.codeAutoAppliedLabel)})]})," ",(e.upgradeBtnText||e.onUpgradeBtnClick)&&(0,t.jsx)(s.u,{variant:"link",href:null!=(n=e.upgradeBtnHref)?n:"/plans",...e.onUpgradeBtnClick?{onClick:e.onUpgradeBtnClick}:{},...(null!=(r=e.theme)?r:"dark")==="dark"?{css:{color:c.w4.colors.white,textDecoration:"underline"}}:{css:{textDecoration:"underline"}},children:e.upgradeBtnText||_.upgradeCtaLabel})]})};if("discount"!==H)return(0,t.jsxs)(t.Fragment,{children:["default"===T&&(0,t.jsxs)(F,{children:[" ",null!=N?N:_.discountDefaultCampaignName]})," ",Q&&(0,t.jsx)("span",{dangerouslySetInnerHTML:(0,o.Y)(Q)})," ",er]});if(E)if(e.isDifferentialPricingEnabled&&e.country)return(0,t.jsx)(t.Fragment,{children:e.upgradeFlow?n():(0,t.jsxs)(t.Fragment,{children:["default"===T&&(0,t.jsx)(F,{children:null!=N?N:_.discountDefaultCampaignName})," ",(0,t.jsx)("span",{dangerouslySetInnerHTML:(0,o.Y)((0,a.q)(_.differentialTextForDisableAutoApply,{highestDiscountPercentage:G,country:e.country}))})," ",et," ",(0,t.jsx)("span",{dangerouslySetInnerHTML:(0,o.Y)((0,a.q)(_.discountCodeLabelForDisableAutoApply,{discountCode:q}))})]})});else return(0,t.jsx)(t.Fragment,{children:e.upgradeFlow?n():(0,t.jsxs)(t.Fragment,{children:["default"===T&&(0,t.jsxs)(F,{children:[" ",null!=N?N:_.discountDefaultCampaignName]})," ",ee&&(0,t.jsx)("span",{dangerouslySetInnerHTML:(0,o.Y)(ee)})," ",et," ",(0,t.jsx)("span",{dangerouslySetInnerHTML:(0,o.Y)((0,a.q)(_.discountCodeLabelForDisableAutoApply,{discountCode:q}))})]})});return e.isDifferentialPricingEnabled&&e.country?(0,t.jsx)(t.Fragment,{children:e.upgradeFlow?n():(0,t.jsxs)(t.Fragment,{children:["default"===T&&(0,t.jsx)(F,{children:null!=N?N:_.discountDefaultCampaignName})," ",(0,t.jsx)("span",{dangerouslySetInnerHTML:(0,o.Y)((0,a.q)(_.differentialTextForAutoApply,{highestDiscountPercentage:G,country:e.country}))})," ",(0,t.jsx)(F,{children:et})," ","default"===T&&_.offerAutoAppliedLabel]})}):(0,t.jsx)(t.Fragment,{children:e.upgradeFlow?n():(0,t.jsxs)(t.Fragment,{children:["default"===T&&(0,t.jsxs)(F,{children:[" ",null!=N?N:_.discountDefaultCampaignName]})," ",en&&(0,t.jsx)("span",{dangerouslySetInnerHTML:(0,o.Y)(en)})," ",et," ","default"===T&&(0,a.q)(_.discountCodeLabelForAutoApply,{discountCode:q})]})})},[en,T,N,W,E,q,ee,Q,et,er,G,H,e.country,e.isDifferentialPricingEnabled,_,e.upgradeBtnHref,e.upgradeBtnText,e.upgradeFlow]);if("duration"===H&&"IND"===e.partnerId)return(0,t.jsx)(t.Fragment,{});if("textOnly"===T)return ea();let el="greenHighlight"===e.offerBannerVariant;return(0,t.jsx)(w,{showColoredBorder:I,cardLayoutVariant:B,offerBannerVariant:"greenHighlight"===e.offerBannerVariant?"greenHighlight":void 0,children:(0,t.jsxs)(L,{theme:"greenHighlight"===e.offerBannerVariant?"green":null!=(n=e.theme)?n:"dark",children:[!e.hideBannerImage&&!el&&(0,t.jsx)("img",{src:null!=(u=null!=(r=e.bannerImageUrl)?r:z)?u:"https://cdn.paperpal.com/assets/images/icons/discount-badge.gif",alt:"Discount badge",width:35}),(0,t.jsx)(C,{children:null!=(g=e.bannerText)?g:ea()}),(e.btnText||e.onBtnClick)&&(0,t.jsx)(s.u,{size:"tiny",href:null!=(p=e.btnHref)?p:"/select-plan",...e.onBtnClick?{onClick:e.onBtnClick}:{},"aria-label":null!=(j=null!=(y=e.btnText)?y:_.claimOfferCtaLabel)?j:"Claim",css:{boxShadow:"none",background:c.w4.colors.yellow7,borderColor:c.w4.colors.yellow7,color:c.w4.colors.blue12,"&:hover":{background:c.w4.colors.yellow6,borderColor:c.w4.colors.yellow6}},...e.btnProps,children:null!=(M=null!=(A=e.btnText)?A:_.claimOfferCtaLabel)?M:"Claim"}),e.onClose&&(0,t.jsx)(D,{onClick:e.onClose,"aria-label":"Close Offer Banner",id:"close-offer-banner",trackingName:"close-offer-banner",trackingProperties:{sectionName:"offer-banner",CTALabel:"Close Offer Banner"},theme:null!=(v=e.theme)?v:"dark",children:(0,t.jsx)(d.I,{name:"faClose",variant:"solid"})})]})})},L=(0,c.I4)("div",{borderRadius:"4px",padding:"3px 10px",fontSize:"14px",display:"flex",alignItems:"center",overflow:"hidden",gap:"10px",maxWidth:"100%",margin:"0px auto",textAlign:"left",variants:{theme:{light:{background:c.w4.colors.yellow2,color:c.w4.colors.blue12},dark:{background:c.w4.colors.blue12,color:c.w4.colors.gray1},green:{background:c.w4.colors.green3,color:c.w4.colors.green12,textAlign:"center"}}}}),w=(0,c.I4)("div",{variants:{showColoredBorder:{true:{background:"radial-gradient(circle at center, #ffcb00, #3cce6b, #5e96ef)",padding:"3px",borderRadius:"10px",["& ".concat(L)]:{borderRadius:"8px"}}},cardLayoutVariant:{default:{},compact:{borderRadius:"10px",padding:"3px",background:"linear-gradient(90.32deg, #378AE9 49.19%, #33932A 100.15%)",["& ".concat(L)]:{borderRadius:"8px",paddingBlock:"2px"}}},offerBannerVariant:{greenHighlight:{borderRadius:"4px",padding:"4px",background:c.w4.colors.green3,["& ".concat(L)]:{borderRadius:"8px",background:c.w4.colors.green3,color:c.w4.colors.green12}}}}}),F=(0,c.I4)("span",{fontWeight:"600"}),C=(0,c.I4)("span",{flex:"1"}
1),D=(0,c.I4)(u.$,{position:"absolute",cursor:"pointer",border:"none",background:"transparent",margin:"0px",padding:"0px",width:"16px",height:"16px",display:"flex",alignItems:"center",justifyContent:"center",right:"20px","@sm":{position:"static",right:"0px"},variants:{theme:{light:{position:"fixed",color:c.w4.colors.blue12,"@sm":{position:"static",right:"0px"}},dark:{color:c.w4.colors.gray2}}}})},98245:(e,n,r)=>{r.d(n,{ph:()=>l,rC:()=>i,y4:()=>o});let t="plans-upgrade-return-url",a=()=>void 0!==window.sessionStorage,l=()=>{if(a())try{sessionStorage.setItem(t,window.location.href)}catch(e){console.error("[upgrade-return-url] Failed to save return URL:",e)}},o=()=>{if(!a())return null;try{return sessionStorage.getItem(t)}catch(e){return console.error("[upgrade-return-url] Failed to get return URL:",e),null}},i=e=>{if(e)return"".concat(e).concat(e.includes("?")?"&":"?","openPostPaymentModal=true")}}}]);
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.