1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4164],{84164:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return C}});var a=n(26042),r=n(69396),s=n(828),l=n(29815),o=n(85893),i=n(67294),c=n(4374),d=n(33434),x=n(81043),m=n(8437),u=n(56889),p=n(2317),h=n(91681),b=n(99587),f=n(82105),y=n(29806),j=n(43369),g=n(31132),v=n(86443),N=n(32970),w=n(85946),k=n(43555),Z=function(e){var t,n=e.reward,a=e.onClose,r=e.rewardTitle,s=e.transactionDate,l=e.getFormatedDate,i=(null==n?void 0:n.allAmounts)&&n.allAmounts.length>1;return(0,o.jsx)(k.Z,{center:!0,open:Boolean(n),onClose:a,className:"p-4",rootClassName:"w-90%",children:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.Z,{block:!0,text:s,textType:"link",className:"text-12 mb-1 md:hidden"}),(0,o.jsx)(p.Z,{block:!0,text:r,textType:"body2",className:"text-18 mb-1"}),(0,o.jsx)(p.Z,{block:!0,text:n?n.status:"",textType:"body2",color:"grey",className:"mb-1"}),(0,o.jsxs)("div",{className:"w-full mt-3",children:[(0,o.jsxs)("div",{className:"flex border-b border-gray-200",children:[(0,o.jsx)("div",{className:"flex-1 p-2 text-left",children:(0,o.jsx)(p.Z,{block:!0,text:(0,w.t)("rewards.amount"),textType:"body2",className:"uppercase text-10-i"})}),(0,o.jsx)("div",{className:"flex-1 p-2 text-left",children:(0,o.jsx)(p.Z,{block:!0,text:(0,w.t)("rewards.expiry_date"),textType:"body2",className:"uppercase text-10-i"})})]}),(0,o.jsx)("div",{className:"flex",children:(0,o.jsxs)("div",{className:"flex-1 p-4 pl-2",children:[(0,o.jsx)(p.Z,{block:!0,color:(null==n?void 0:n.totalAmount)&&n.totalAmount>0?"green":"dark",text:"number"==typeof(null==n?void 0:n.totalAmount)?n.totalAmount<0?"-D$"+Math.abs(n.totalAmount).toLocaleString("en-US"):"+D$"+n.totalAmount.toLocaleString("en-US"):"",textType:"body2",className:"text-18 inline-block"}),(0,o.jsx)("div",{className:"flex flex-col",children:(0,o.jsx)("div",{className:"flex-1 w-full",children:null==n?void 0:null===(t=n.allAmounts)||void 0===t?void 0:t.map(function(e,t){var a;return(0,o.jsxs)("div",{className:"flex items-start w-full",children:[(0,o.jsx)("div",{className:"flex w-50% pr-3 pl-2.5",children:i&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("span",{className:"inline-block flex-shrink-0 mr-2 mt-2.5",style:{width:"1.5px",height:"1.5px",backgroundColor:"#6B7280",borderRadius:"50%"}}),(0,o.jsx)(p.Z,{block:!0,textType:"body2",color:"grey",style:{letterSpacing:"0.005rem"},text:e})]})}),(null==n?void 0:null===(a=n.expirationDates)||void 0===a?void 0:a[t])&&(0,o.jsxs)("div",{className:"flex items-center pl-3",style:{marginTop:i?"":"-22px"},children:[(0,o.jsx)("span",{className:"inline-block flex-shrink-0 mr-2",style:{width:"1.5px",height:"1.5px",backgroundColor:"#6B7280",borderRadius:"50%"}}),(0,o.jsx)(p.Z,{block:!0,textType:"body2",color:"grey",style:{letterSpacing:"0.005rem"},text:l(n.expirationDates[t])})]})]},t)})})})]})})]})]})})},T=n(57999),S={month:"short",day:"numeric",year:"numeric"},D=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t={cursor:e||void 0},n=new Date().getMonth(),a=new Date(new Date().setMonth(n-12)),r=new Date(new Date().setMonth(n));return t.dateFrom=(0,g.Z)(a,"yyyy-MM-dd"),t.dateTo=(0,g.Z)(r,"yyyy-MM-dd"),t};function C(e){var t=e.config,n=function(e){return e?e.charAt(0).toUpperCase()+e.slice(1).toLowerCase():""},g=(0,c.$)().t,w=(0,x.I0)(),k=(0,v.Z)(),C=(0,x.v9)(function(e){return e.global.currency.rates}),_=(0,x.v9)(function(e){return e.global.currency.selectedCurrency}),A=(0,x.v9)(function(e){return(0,u.Z)(e.member.user.state)}),L=(0,x.v9)(function(e){return e.member.user.rewardStatement}),M=(0,x.v9)(function(e){return e.member.user.expiringRewards}),$=(0,i.useState)(!1),E=$[0],U=$[1],R=(0,i.useState)([]),F=R[0],B=R[1],O=(0,i.useState)(null),I=O[0],H=O[1],W=(0,y.Z)(_,C),P=(0,T.j)("md"),z=(0,i.useMemo)(function(){return(null==M?void 0:M.points)?_?W.getPriceWithCode(M.points,"USD"):"D$"+M.points.toLocaleString("en-US"):""},[_,M]);(0,i.useEffect)(function(){(0,N.N4)().then(function(e){B(function(t){return(0,l.Z)(t).concat((0,l.Z)(e.data))})}),(0,N.av)().then(function(e){B(function(t){return(0,l.Z)(t).concat((0,l.Z)(e.data.filter(function(e){return!!e.theme})))})})},[]),(0,i.useEffect)(function(){w((0,m.fHb)(D(L.nextCursor)))},[]);var G=function(){w((0,m.fHb)(D(L.nextCursor),!0)),k.trackCtaClick("More","Reward Statement")},Q=A.hasState(d.j1.rewardStatementLoading),X=A.hasState(d.j1.rewardStatementLoaded),q=!Q&&0===L.rewards.length,J=function(e){if("DONATE_D$"===e.bitType){var t=F.find(function(t){return!!t.theme&&(t.locationCode||"")===(e.locationCode||"")&&+(t.sponsorId||0)==+(e.sponsorId||0)});if(null==(t=t||F.find(function(t){return!t.theme&&(t.locationCode||"")===(e.locationCode||"")&&+(t.sponsorId||0)==+(e.sponsorId||0)}
1))?void 0:t.name)return"Donate D$ - "+t.name}return e.locationTitle||e.locationName||"GHA"},K=function(e){return W.dateString2FormattedString(e,"dd mm yy",S)},V=L.rewards.reduce(function(e,t){var n=t.bitReference;return e[n]||(e[n]=[]),e[n].push(t),e},{});return(0,o.jsxs)("div",{className:"bg-ivory overflow-hidden",children:[(0,o.jsx)("div",{className:"m-container",children:(0,o.jsxs)("div",{className:"md:px-16 lg:px-36",children:[(0,o.jsx)(p.Z,{textType:"heading4",text:g("rewards.reward_statement"),className:"text-24 sm:text-24 pt-3 pb-8 md:pt-21 md:pb-6 w-full"}),q&&!X&&(0,o.jsx)(p.Z,{textType:"body",text:g("message.rewards_not_found")})]})}),!E&&M&&M.points>0&&(0,o.jsx)("div",{className:"bg-purple40 bg-opacity-40",children:(0,o.jsx)("div",{className:"m-container",children:(0,o.jsxs)("div",{className:"flex flex-row md:justify-center items-start md:items-stretch md:px-16 lg:px-36 py-5 md:mb-6",children:[(0,o.jsx)(p.Z,{textType:"body",color:"white",className:"pr-10 md:pr-5",html:t.rewardStatementTooltip.html5?t.rewardStatementTooltip.html5.replace("$DD_AMOUNT",z).replace("$DD_EXP_DATE",W.dateString2FormattedString(M.expirationDate,"dd mm yy",S)):g("rewards.expiring_message",{amount:z,date:W.dateString2FormattedString(M.expirationDate,"dd mm yy",S)})}),(0,o.jsx)("button",{className:"tid-setExpiringRewardClosed",onClick:function(){return U(!0)},children:(0,o.jsx)(h.Tw,{fill:"text-white",size:22.5})})]})})}),!q&&X&&(0,o.jsx)("hr",{className:"hr-gray hidden md:block"}),(0,o.jsx)("div",{className:"m-container",style:{paddingLeft:"0px",paddingRight:"0px"},children:(0,o.jsxs)("div",{className:"pb-64 claim-history table-w",children:[L.rewards.length>0&&(0,o.jsxs)(b.Z,{children:[(0,o.jsx)("thead",{children:(0,o.jsxs)("tr",{children:[(0,o.jsx)("th",{className:"hidden md:table-cell border-r-0 sm:first:pl-10",style:{height:"115px"},children:(0,o.jsx)(p.Z,{block:!0,text:g("rewards.date"),textType:"body2",className:"uppercase text-10-i"})}),(0,o.jsx)("th",{className:"hidden md:table-cell border-r-0",children:(0,o.jsx)(p.Z,{block:!0,text:g("rewards.transaction_type"),textType:"body2",className:"uppercase text-10-i"})}),(0,o.jsx)("th",{className:"pl-6 border-r-0",children:(0,o.jsx)(p.Z,{block:!0,text:g("rewards.description"),textType:"body2",className:"uppercase text-10-i"})}),(0,o.jsxs)("th",{className:"border-r-0",children:[(0,o.jsx)(p.Z,{block:!0,text:g("rewards.amount"),textType:"body2",className:"uppercase text-10-i"}),(0,o.jsx)(p.Z,{block:!0,text:g("info.exchange_rate_can_change"),textType:"body2",color:"grey",className:"text-10-i hidden md:flex"})]}),(0,o.jsx)("th",{className:"hidden md:table-cell",children:(0,o.jsx)(p.Z,{block:!0,text:g("rewards.expiry_date"),textType:"body2",className:"uppercase text-10-i"})})]})}),(0,o.jsxs)("tbody",{children:[Object.entries(V).map(function(e){var t,l,i=(0,s.Z)(e,2),c=(i[0],i[1]),d=c[0],x=c.reduce(function(e,t){return e+t.amount},0),m=c.map(function(e){return e.amount<0?"-D$"+Math.abs(e.amount).toLocaleString("en-US")+" ".concat(null!==(t=e.locationSubTitle)&&void 0!==t?t:""):"+D$"+e.amount.toLocaleString("en-US")+" ".concat(null!==(l=e.locationSubTitle)&&void 0!==l?l:"")}),u="expired"===d.status.toLowerCase()?[d.date]:c.map(function(e){return e.expirationDate}).filter(function(e){return!!e});return(0,o.jsxs)("tr",{children:[(0,o.jsx)("td",{className:"hidden md:table-cell relative sm:first:pl-10",style:{height:"115px"},children:(0,o.jsx)(p.Z,{block:!0,text:K(d.date),textType:"body",className:"text-12"})}),(0,o.jsx)("td",{className:"hidden md:table-cell",children:(0,o.jsx)(p.Z,{block:!0,text:n(null==d?void 0:d.status),textType:"body2",className:"text-18"})}),(0,o.jsxs)("td",{className:"w-66% md:w-auto p-6",style:{minWidth:P?"362px":""},children:[(0,o.jsx)(p.Z,{block:!0,text:K(d.date),textType:"link",className:"text-12 md:hidden"}),(0,o.jsx)(p.Z,{block:!0,text:J(d),className:"text-18",textType:"body2"}),(0,o.jsx)(p.Z,{block:!0,text:n(null==d?void 0:d.status),textType:"body2",color:"grey",className:"md:hidden"})]}),(0,o.jsxs)("td",{className:"border-r-0 md:border-r p-6",style:{maxWidth:"max-content",minWidth:P?"267px":""},children:[(0,o.jsx)(p.Z,{block:!0,color:x>
10?"green":"dark",text:x<0?"-D$"+(-1*x).toLocaleString("en-US"):"+D$"+x.toLocaleString("en-US"),textType:"body2",className:"text-18"}),(0,o.jsx)("div",{className:"hidden md:table-cell",children:m&&m.length>1&&m.map(function(e,t){return(0,o.jsxs)("div",{className:"flex items-center pl-2.5",children:[(0,o.jsx)("span",{className:"inline-block flex-shrink-0 mr-2",style:{width:"1.5px",height:"1.5px",backgroundColor:"#6B7280",borderRadius:"50%"}}),(0,o.jsx)(p.Z,{block:!0,textType:"body2",color:"grey",style:{letterSpacing:"0.005rem"},className:"ml-1",text:e})]},t)})}),(0,o.jsx)(p.Z,{block:!0,text:g("label.button.view_details"),textType:"link",className:"text-10 md:hidden uppercase underline mt-1",onClick:function(){return H((0,r.Z)((0,a.Z)({},d),{totalAmount:x,allAmounts:m,expirationDates:u}))}})]}),(0,o.jsx)("td",{className:"hidden md:table-cell ".concat(m&&m.length>1?"pt-12":""),children:(0,o.jsx)("div",{className:"hidden md:table-cell",children:null==u?void 0:u.map(function(e,t){return(0,o.jsxs)("div",{className:"flex items-center pl-2.5",children:[(0,o.jsx)("span",{className:"inline-block flex-shrink-0 mr-2",style:{width:"1.5px",height:"1.5px",backgroundColor:"#6B7280",borderRadius:"50%"}}),(0,o.jsx)(p.Z,{block:!0,textType:"body2",color:"grey",style:{letterSpacing:"0.005rem"},className:"ml-1",text:K(e)})]},t)})})})]})}),(0,o.jsx)(Z,{reward:I,onClose:function(){return H(null)}
1,rewardTitle:I?J(I):"",transactionDate:I?K(I.date):"",getFormatedDate:K})]})]}),!!L.nextCursor&&!Q&&(0,o.jsx)("div",{className:"flex justify-center pt-14 md:pt-20",children:(0,o.jsx)("div",{className:"w-full md:w-1/5",children:(0,o.jsx)(f.Z,{rootClassName:"tid-moreBtn",label:g("label.button.more"),type:"primary",size:"large",className:"uppercase",onClick:G})})}),Q&&(0,o.jsx)(j.Z,{center:!0,className:"pt-14 md:pt-20"})]})})]})}},99587:function(e,t,n){"use strict";function a(){return(a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}n.d(t,{Z:function(){return c}});var r=n(26042),s=n(85893);n(67294);var l,o=n(70082),i=n.n(o),c=function(e){var t=function(){return a.apply(this,arguments)}({},e);return(0,s.jsx)("table",(0,r.Z)({className:"".concat(i().container)},t))}},57999:function(e,t,n){"use strict";n.d(t,{j:function(){return s}});var a=n(67294),r={sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},s=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"sm",t=(0,a.useState)(!1),n=t[0],s=t[1];return(0,a.useEffect)(function(){var t=r[e],n=window.matchMedia("(min-width: ".concat(t,")"));s(n.matches);var a=function(e){s(e.matches)};return n.addEventListener("change",a),function(){n.removeEventListener("change",a)}},[e]),n}},70082:function(e){e.exports={container:"table_container__GQHM4"}}}]);
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.