1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4486],{23716:function(e,l,t){Promise.resolve().then(t.bind(t,70980))},70980:function(e,l,t){"use strict";t.r(l),t.d(l,{default:function(){return j}});var s=t(57437),a=t(2265),n=t(16463),r=t(38093),i=t(65526),c=t(99466),o=t(10542),u=t(24212),d=t(350),x=t(16523),m=t(19063),p=t(23707);let h=e=>{let l=Number(e);return Number.isFinite(l)?l:null};function v(e,l){return(0,p.sc)(null==e?void 0:e.sourceTypeId,l)}function y(e){let{rows:l,hasNext:t,totalPages:a}=e,{t:n}=(0,r.$G)(),i=a>1;return(0,s.jsxs)("div",{className:"w-[calc(100%+4rem)] sm:w-full sm:rounded-2xl border-t sm:border border-luxBlack-500 overflow-x-auto -mx-[2rem] sm:mx-0 my-6",children:[(0,s.jsxs)("table",{className:"w-full text-sm text-luxGray-700 table-auto",children:[(0,s.jsx)("thead",{className:"text-luxGray-700 text-xs uppercase tracking-wide border-b border-luxBlack-500",children:(0,s.jsxs)("tr",{className:"text-left",children:[(0,s.jsx)("th",{className:"px-4 sm:px-6 py-3 font-medium w-[34%] min-w-0",children:n("source")}),(0,s.jsx)("th",{className:"px-4 sm:px-6 py-3 font-medium w-[20%] min-w-0",children:n("category")}),(0,s.jsx)("th",{className:"px-4 sm:px-6 py-3 font-medium w-[16%] min-w-0 whitespace-nowrap",children:n("levelPointsEarned")}),(0,s.jsx)("th",{className:"px-4 sm:px-6 py-3 font-medium w-[14%] min-w-0 whitespace-nowrap",children:n("levelPointsTotal")}),(0,s.jsx)("th",{className:"px-4 sm:px-6 py-3 font-medium text-right w-[16%] min-w-0 whitespace-nowrap",children:n("dateAndTime")})]})}),(0,s.jsx)("tbody",{children:l.map(e=>(0,s.jsxs)("tr",{className:"border-b border-luxBlack-500 hover:bg-white/5 transition odd:bg-luxBlack-640",children:[(0,s.jsx)("td",{className:"px-4 sm:px-6 py-3.5 min-w-0",children:(0,s.jsx)("span",{className:"block truncate",title:v(e,n),children:v(e,n)})}),(0,s.jsx)("td",{className:"px-4 sm:px-6 py-3.5 min-w-0 truncate",title:(0,p.qS)(e.category,n),children:(0,p.qS)(e.category,n)}),(0,s.jsx)("td",{className:"px-4 sm:px-6 py-3.5 font-medium whitespace-nowrap",children:null==e.points?(0,s.jsx)("span",{className:"text-luxGray-650",title:n("levelPointsUnknownGain"),children:"â"}):(0,s.jsxs)("span",{className:"text-luxGreen-300",children:["+",e.points]})}),(0,s.jsx)("td",{className:"px-4 sm:px-6 py-3.5 whitespace-nowrap",children:e.totalAfter}),(0,s.jsx)("td",{className:"px-4 sm:px-6 py-3.5 text-right whitespace-nowrap text-luxGray-650",children:null!=e.tsMs?(0,d.Yy)(e.tsMs):"-"})]},e.id))})]}),i?(0,s.jsx)(m.Z,{unknownTotal:!1,hasNext:t,totalPages:a}):null]})}let f=(0,t(78030).Z)("sparkles",[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}
1],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]]);function g(e){let{filtered:l=!1}=e,{t}=(0,r.$G)();return(0,s.jsx)("div",{className:"w-full h-full flex items-center justify-center px-4 py-10",children:(0,s.jsxs)("div",{className:"flex flex-col items-center text-center max-w-sm w-full",children:[(0,s.jsx)("div",{className:"rounded-full bg-luxBlack-400 w-16 h-16 flex justify-center items-center",children:(0,s.jsx)("div",{className:"relative flex items-center justify-center w-11 h-11 rounded-full bg-luxBlack-300",children:(0,s.jsx)(f,{className:"w-6 h-6 text-luxGray-650"})})}),(0,s.jsx)("h2",{className:"mt-4 text-base sm:text-xl text-luxGray-700 font-semibold",children:t("levelPointsEmptyTitle")}),(0,s.jsx)("p",{className:"mt-1 text-sm text-luxGray-650 leading-relaxed",children:t(l?"levelPointsEmptyFiltered":"levelPointsEmptyHint")})]})})}function w(e){let{level:l}=e,{t}=(0,r.$G)();if(!l)return null;let{levelName:a,totalPoints:n,nextLevel:i,pointsToNext:c,progressPercent:o}=l;return(0,s.jsxs)("div",{className:"my-5 rounded-2xl border border-luxBlack-500 p-4 sm:p-5",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-baseline justify-between gap-2",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-xs uppercase tracking-wide text-luxGray-650",children:t("levelsCurrentLevel")}),(0,s.jsx)("p",{className:"text-lg font-semibold text-white",children:a||"â"})]}),(0,s.jsxs)("div",{className:"text-right",children:[(0,s.jsx)("p",{className:"text-xs uppercase tracking-wide text-luxGray-650",children:t("levelPointsTotal")}),(0,s.jsx)("p",{className:"text-lg font-semibold text-luxYellow-100",children:n})]})]}),i?(0,s.jsxs)("div",{className:"mt-4 space-y-2",children:[(0,s.jsx)("div",{className:"h-2 w-full overflow-hidden rounded-full bg-luxBlack-400",role:"progressbar","aria-valuenow":o,"aria-valuemin":0,"aria-valuemax":100,"aria-label":t("levelPointsProgressTo",{level:i.name||""}),children:(0,s.jsx)("div",{className:"h-full rounded-full bg-luxYellow-100 transition-all",style:{width:"".concat(o,"%")}})}),(0,s.jsx)("p",{className:"text-sm text-luxGray-650",children:t("levelPointsToNext",{points:c,level:i.name||""})})]}):(0,s.jsx)("p",{className:"mt-4 text-sm text-luxGray-650",children:t("levelsMaxLevelReached")})]})}function j(){var e;let{t:l}=(0,r.$G)(),t=(0,o.q)(),m=(0,n.useSearchParams)(),v=(0,n.useRouter)(),f=(0,n.usePathname)(),j=(0,c.Tq)(),N=null!==(e=null==j?void 0:j.refreshKey)&&void 0!==e?e:0,b=(0,a.useMemo)(()=>new Date,[]),P=(0,a.useMemo)(()=>(0,p.ft)(b),[b]),S=(0,a.useMemo)(()=>(0,p.v4)(P,-29),[P]),[k,M]=(0,a.useState)(!0),[D,G]=(0,a.useState)(""),[_,T]=(0,a.useState)([]),[C,q]=(0,a.useState)(null),A=(0,a.useRef)(null),B=Number(m.get("page")||1),L=m.get("category")||"all",R=m.get("startDate"),E=m.get("endDate"),{startDate:U,endDate:F}=(0,a.useMemo)(()=>(0,p.mS)({startDate:(0,p.P9)(R,S),endDate:(0,p.P9)(E,P),today:b}),[R,E,S,P,b]),Z=(0,a.useMemo)(()=>"".concat(null!=R?R:"","|").concat(null!=E?E:""),[R,E]),$=k&&A.current!==Z,I=!t||$,Y=(0,a.useCallback)((e,l)=>{let t=new URLSearchParams(m);null==l||""===l||"all"===l?t.delete(e):t.set(e,String(l)),"page"!==e&&t.set("page","1"),v.replace("".concat(f,"?").concat(t.toString()),{scroll:!1})},[m,v,f]),z=(0,a.useCallback)(function(e,l){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,{startDate:s,endDate:a}=(0,p.mS)({startDate:e,endDate:l,today:b,changedField:t}),n=new URLSearchParams(m);n.set("startDate",(0,d.fC)(s,"yyyy-MM-dd")),n.set("endDate",(0,d.fC)(a,"yyyy-MM-dd")),n.set("page","1"),v.replace("".concat(f,"?").concat(n.toString()),{scroll:!1})},[m,v,f,b]),K=(0,a.useCallback)(()=>{let e=new URLSearchParams;e.set("page","1"),v.replace("".concat(f,"?").concat(e.toString()),{scroll:!1})}
1,[v,f]),O=(0,a.useCallback)(e=>{let{startDate:l,endDate:t}=(0,p.mS)({startDate:e.startDate,endDate:e.endDate,today:b}),s=new URLSearchParams;s.set("page","1"),s.set("startDate",(0,d.fC)(l,"yyyy-MM-dd")),s.set("endDate",(0,d.fC)(t,"yyyy-MM-dd")),e.category&&"all"!==e.category&&s.set("category",String(e.category)),v.replace("".concat(f,"?").concat(s.toString()),{scroll:!1})},[v,f,b]);(0,a.useEffect)(()=>{if(!t)return;let e=!1,s=1e3*(0,p.AB)(U);return(async()=>{M(!0),G("");try{let[l,t,a,n]=await Promise.allSettled([(0,p.zc)(u.SmarticoService,{startTimeSeconds:(0,p.AB)((0,p.v4)(U,-7)),endTimeSeconds:(0,p.yZ)(F)}),Promise.resolve(u.SmarticoService.getUserProfile()),u.SmarticoService.getCurrentLevel(),u.SmarticoService.getLevels()]);if(e)return;if("rejected"===l.status)throw l.reason;T(function(e){let{fromMs:l}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=(Array.isArray(e)?e:[]).map(e=>({entry:e,ever:h(null==e?void 0:e.user_points_ever),tsMs:function(e){let l=h(null==e?void 0:e.create_date);return null==l?null:l>1e12?l:1e3*l}(e)})).filter(e=>null!=e.ever).sort((e,l)=>(e.tsMs||0)-(l.tsMs||0)),s=Number.isFinite(l)?l:null,a=[];for(let e=0;e<t.length;e+=1){let{entry:l,ever:n,tsMs:r}=t[e],i=e>0?t[e-1].ever:null,c=null==i?null:n-i;if(null!=c&&c<=0||null!=s&&null!=r&&r<s)continue;let o=h(null==l?void 0:l.source_type_id);a.push({id:"".concat(null!=r?r:e,"-").concat(null!=o?o:"x","-").concat(n,"-").concat(e),tsMs:r,sourceTypeId:o,category:(0,p.RK)(o),points:c,totalAfter:n})}return 1===a.length&&null==a[0].points?[]:a.reverse()}(l.value,{fromMs:s})),q(function(e,l,t){var s,a;let n=null!==(s=h(null==e?void 0:e.ach_points_ever))&&void 0!==s?s:0,r=(Array.isArray(t)?t:[]).map(e=>{var l,t,s;return{levelId:null!==(t=h(null==e?void 0:e.id))&&void 0!==t?t:h(null==e?void 0:e.level_id),name:(null==e?void 0:e.name)||(null==e?void 0:null===(l=e.level_public_meta)||void 0===l?void 0:l.name)||null,requiredPoints:null!==(s=h(null==e?void 0:e.required_points))&&void 0!==s?s:0}}).sort((e,l)=>e.requiredPoints-l.requiredPoints).find(e=>e.requiredPoints>n)||null;return{levelName:(null==l?void 0:l.name)||(null==e?void 0:e.ach_level_current)||null,totalPoints:n,nextLevel:r,pointsToNext:r?Math.max(0,r.requiredPoints-n):0,progressPercent:Math.max(0,Math.min(100,null!==(a=h(null==l?void 0:l.progress))&&void 0!==a?a:r?0:100))}}("fulfilled"===t.status?t.value:null,"fulfilled"===a.status?a.value:null,"fulfilled"===n.status?n.value:[])),A.current=Z}catch(t){e||(A.current=Z,G((null==t?void 0:t.message)||l("transactionLoadError")),T([]))}finally{e||M(!1)}})(),()=>{e=!0}},[t,Z,U,F,l,N]);let H=(0,a.useMemo)(()=>"all"===L?_:_.filter(e=>(0,p.uP)(e,L)),[_,L]),J=Math.ceil(H.length/10),Q=(B-1)*10,V=H.slice(Q,Q+10);return(0,s.jsx)(i.default,{children:(0,s.jsx)("section",{className:"account-section",children:(0,s.jsxs)("div",{className:"account-container",children:[(0,s.jsxs)("div",{className:"border-b border-luxGray-650 pb-5",children:[(0,s.jsx)("h4",{className:"text-lg font-semibold text-white",children:l("levelPointsTitle")}),(0,s.jsx)("p",{className:"text-sm text-luxGray-650 mt-1",children:l("levelPointsDescription")})]}),I||D?null:(0,s.jsx)(w,{level:C}),(0,s.jsx)(x.Z,{showActionFilter:!1,type:"all",category:L,startDate:U,endDate:F,today:b,onSetParam:Y,onSetDateRange:z,onApplyFilters:O,onReset:K}),!I&&D?(0,s.jsx)("p",{className:"text-sm text-red-400 py-4",children:D}):null,I||D||0!==H.length?null:(0,s.jsx)(g,{filtered:"all"!==L}),I||D||!(V.length>0)?null:(0,s.jsx)(y,{rows:V,hasNext:B<J,totalPages:J})]})})})}}},function(e){e.O(0,[4228,1544,8093,8173,7783,3946,9705,7724,4212,751,3109,3254,6847,2971,7023,1744],function(){return e(e.s=23716)}),_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.