1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},l=(new e.Error).stack;l&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[l]="3253da18-c464-4d09-a3ba-dbc04a8bbbd1",e._sentryDebugIdIdentifier="sentry-dbid-3253da18-c464-4d09-a3ba-dbc04a8bbbd1")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6426],{6426:function(e,l,i){i.r(l),i.d(l,{default:function(){return v}});var s=i(85893),a=i(67294),t=i(83346),n=i(35693),c=i(54601),d=i(64102),r=i(83698),o=i(25072),u=function(e,l){let{userId:i,brand:s,apiBaseUrl:t,locale:n=""}=e,{page:c,pageSize:d}=l,[u,p]=(0,a.useState)([]),[x,f]=(0,a.useState)(0),[b,m]=(0,a.useState)(0),{isMutating:v,trigger:h}=(0,r.Z)("/v1/credit/log",async(e,l)=>{let{arg:i}=l;return(await fetch((0,o.lz)(n,t)+e,{method:"POST",headers:{"Content-Type":"application/json","current-language":n},body:JSON.stringify(i)})).json()}),g=(0,a.useCallback)(async()=>{await h({page:c,page_size:d,user_id:i,brand:s},{onSuccess(e){var l,i;m(c),f(null!==(i=null==e?void 0:null===(l=e.data)||void 0===l?void 0:l.total)&&void 0!==i?i:0),p(l=>{var i,s;return l.concat(null!==(s=null==e?void 0:null===(i=e.data)||void 0===i?void 0:i.creditLogs)&&void 0!==s?s:[])})}})},[c,d,i,s,h]);return(0,a.useEffect)(()=>{i&&s&&!v&&c!==b&&g()},[g,i,s,c,b,v]),{activities:u,isLoading:v,total:x,canNext:x>u.length&&!v}},p=i(3784),x=i(88968),f=i(24431),b=i(69805);function m(e){let{id:l,className:i}=e;switch(l){case p._G.Activate:return(0,s.jsx)(x._V,{className:i});case p._G.Subscribe:return(0,s.jsx)(x.H2,{className:i});case p._G.Shop:return(0,s.jsx)(x.iF,{className:i});case p._G.CompleteProfile:return(0,s.jsx)(x.YV,{className:i})}}var v=function(e){var l,i,r,x,v,h;let{copy:g}=e,{profile:_,openSignUpPopup:N,alpcConfig:j,creditInfo:S,fetchCreditInfo:k,isSubscribeSuccess:C,isActivateSuccess:y,isProfileCompleteSuccess:G}=(0,n.lT)(),{pushView:w}=(0,c.L)(),{locale:I}=j,{brand:L}=(0,t.DI)(),A=f.y.includes(L);(0,a.useEffect)(()=>{(null==_?void 0:_.user_id)&&k(_.user_id)},[]);let P=!!_,z=function(e){let{userId:l,brand:i,email:s,locale:n="",apiBaseUrl:c}=e,{activities:r}=u({userId:l,brand:i,apiBaseUrl:c,locale:n},{page:1,pageSize:50}),{data:o}=(0,t.Pd)({email:s}),p=(null==o?void 0:o.data)||o;return(0,a.useMemo)(()=>null!=p&&!!p.preference&&(!!p.preference.some(e=>e.brand===i&&e.subscribe)||(null==r?void 0:r.some(e=>e.task_sub_type===d.YT.Subscription))),[null==p?void 0:p.preference,r,i])}({userId:null==_?void 0:_.user_id,brand:L,email:null==_?void 0:_.email,locale:I,apiBaseUrl:j.apiBaseUrl}),U=(0,a.useMemo)(()=>G||!!((null==_?void 0:_.first_name)||(null==_?void 0:_.last_name))&&!!(null==_?void 0:_.phone_number)&&!!(null==_?void 0:_.dob),[_,G]);function B(e){let l={[p._G.Activate]:"activate",[p._G.CompleteProfile]:"complete_profile",[p._G.Subscribe]:"subscribe",[p._G.Shop]:"shop"};(0,t.DU)({event:"ga4Event",event_name:"lp_button",event_parameters:{position:"earn_credits",button_name:l[e],info:"Member Floating Window"}})}let E=(0,a.useMemo)(()=>({[p._G.Activate]:{finished:!!(null==_?void 0:_.activated)||y,onClick:P?()=>{B(p._G.Activate),w({type:p.YN.Activate})}:N},[p._G.CompleteProfile]:{finished:U,onClick:P?()=>{B(p._G.CompleteProfile),w({type:p.YN.CompleteProfile})}:N},[p._G.Subscribe]:{finished:z||C,onClick:P?()=>{B(p._G.Subscribe),w({type:p.YN.SubscribeEmail})}:N},[p._G.Shop]:{finished:!1,link:g.goShopLink,onClick:P?()=>B(p._G.Shop):N}}),[_,P,y,G,U,z,C,N,w,g.goShopLink]),Y=(0,a.useMemo)(()=>g.list.map(e=>{let l=E[e.id];if(!l)return null;let i=l.finished?g.completed:P?function(e,l){switch(e){case p._G.Activate:return l.activate;case p._G.CompleteProfile:return l.completeProfileLabel;case p._G.Subscribe:return l.subscribeLabel;case p._G.Shop:return l.shopNow}}(e.id,g):g.joinNow;return{...e,...l,buttonLabel:i}}).filter(Boolean),[g,E,P]);return(0,s.jsxs)("div",{className:"flex flex-col gap-[16px]",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-[16px]",children:[(0,s.jsx)("div",{className:"flex flex-col gap-[8px]",children:g.title&&(0,s.jsx)("h2",{className:"text-[24px] font-[700] leading-[1.2] text-[#080a0f]",children:g.title})}),P&&(0,s.jsxs)("div",{className:(0,t.AK)("flex items-center gap-[12px] bg-[#f5f6f7] p-[16px]",A?"rounded-[8px]":"rounded-none"),children:[(0,s.jsxs)("div",{className:"flex flex-1 flex-col gap-[4px]",children:[(0,s.jsx)("div",{className:"text-[14px] font-[700] text-[#1e2024]",children:null!==(l=g.balanceLabel)&&void 0!==l?l:"AnkerCredits Balance"}),(0,s.jsxs)("div",{className:"flex items-end gap-[4px]",children:[(0,s.jsx)("span",{className:"text-[24px] font-[700] leading-[1.2] text-[#1e2024]",children:(0,o.Y4)(null!==(i=null==S?void 0:S.available_credit)&&void 0!==i?i:0)}),(0,s.jsx)("span",{className:"text-[14px] font-[700] leading-[1.4] text-[#1e2024]",children:null!==(r=g.creditUnit)&&void 0!==r?r:"ankercredits"})]})]}),(0,s.jsx)("div",{className:"h-full w-px bg-[#dadce0]"}),(0,s.jsxs)("div",{className:"flex flex-1 flex-col gap-[4px]",children:[(0,s.jsx)("div",{className:"text-[14px] font-[700] text-[#1e2024]",children:null!==(x=g.comingSoonLabel)&&void 0!==x?x:"Coming Soon"}),(0,s.jsxs)("div",{className:"flex items-end gap-[4px]",children:[(0,s.jsx)("span",{className:"text-[24px] font-[700] leading-[1.2] text-[#1e2024]",children:(0,o.Y4)(null!==(v=null==S?void 0:S.pending_credit)&&void 0!==v?v:0)}),(0,s.jsx)("span",{className:"text-[14px] font-[700] leading-[1.4] text-[#1e2024]",children:null!==(h=g.creditUnit)&&void 0!==h?h:"ankercredits"})]})]})]})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-[16px]",children:[g.subtitle&&(0,s.jsx)("p",{className:"text-[16px] font-[700] text-[#1e2024]",children:g.subtitle}),(0,s.jsx)("div",{className:"flex flex-col",children:Y.map((e,l)=>(0,s.jsxs)("div",{className:"relative py-[16px]",children:[l>0&&(0,s.jsx)("div",{className:"absolute left-0 right-0 top-0 h-px bg-[#dadce0]"}),(0,s.jsxs)("div",{className:(0,t.AK)("flex items-center gap-[12px]"),children:[(0,s.jsx)(m,{id:e.id,className:"size-[24px] shrink-0"}),(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("div",{className:"text-[16px] font-[700] text-[#1e2024]",children:e.title}),e.credits&&(0,s.jsx)("div",{className:"mt-[4px] text-[14px] font-bold text-[#4A4C56]",children:e.credits})]}),!e.finished&&e.link&&P?(0,s.jsx)(b.zx,{as:"a",size:"base",href:e.link,target:"_blank",rel:"noopener noreferrer",className:"min-w-[116px]",onClick:()=>B(e.id),children:e.buttonLabel}):(0,s.jsx)(b.zx,{size:"base",disabled:e.finished,className:"min-w-[116px]",onClick:e.onClick,children:e.buttonLabel})]})]},l))})]})]})}}}]);
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.