profile-135c02e5ac618796.js 11 KB

12
  1. (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[50277],{56896:function(e,n,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/profile",function(){return r(351)}])},98038:function(e,n,r){"use strict";r.d(n,{Z:function(){return u}});var s=r(57044),i=r(57611),t=r(67597),a=r(15129),o=r(84020),c=function(){var e=(0,a.useRouter)();return(0,t.useEffect)((function(){var n=e.asPath;e.replace((0,o.gk)(n))}),[e]),(0,i.jsx)(i.Fragment,{})},l=r(19226),u=function(e){return function(n){var r=(0,t.useState)(!1),a=r[0],o=r[1];return(0,t.useEffect)((function(){o(!0)}),[]),a?(0,l.jl)()?(0,i.jsx)(e,(0,s.Z)({},n)):(0,i.jsx)(c,{}):null}}},90740:function(e,n,r){"use strict";var s=r(99968),i=r(9740),t=r(37572),a=r(19226);n.Z=function(){var e=(0,s.ZP)((0,a.jl)()?(0,t.bo)():null,i.et),n=e.data;return{user:n||{},isLoading:e.isValidating&&!n,error:e.error}}},50148:function(e,n,r){"use strict";r.r(n);var s=r(45361),i=r(57611),t=r(37014),a=r.n(t),o=r(15129),c=r(61395),l=r(61085),u=r.n(l),d=r(85494),h=r(57830);n.default=function(e){e.statusCode;var n=e.hasFullWidth,r=void 0===n||n,t=(0,c.Z)("error").t,l=(0,o.useRouter)();return(0,i.jsxs)("div",{className:a()(u().container,(0,s.Z)({},u().withFullWidth,r)),children:[(0,i.jsx)("h1",{className:u().title,children:t("title")}),(0,i.jsx)("div",{className:u().goBack,children:(0,i.jsx)(d.ZP,{onClick:function(){document&&document.referrer?l.back():l.push("/")},children:t("go-back")})}),(0,i.jsxs)("p",{className:u().reportBug,children:[t("if-persist")," ",(0,i.jsx)(h.Z,{href:"https://feedback.quran.com/",variant:h.r.Highlight,children:t("report-cta")})]})]})}},351:function(e,n,r){"use strict";r.r(n),r.d(n,{__N_SSG:function(){return re},default:function(){return se}});var s,i=r(1997),t=r(51726),a=r(57611),o=r(37014),c=r.n(o),l=r(15129),u=r.n(l),d=r(61395),h=r(86719),m=r.n(h),_=r(58042),f=r.n(_),x=r(98038),j=r(21648),N=r(67597),p=r(67385),v=r(85494),k=r(56539),g=r(3463),C=r(24542),Z=r.n(C),b=r(9740),S=r(20981),w=r(12195),B=function(e){var n=e.isDisabled,r=(0,d.Z)("profile").t,s=(0,N.useState)(!1),o=s[0],c=s[1],l=(0,N.useState)(""),h=l[0],m=l[1],_=function(){m(""),c(!1)},f=function(){var e=(0,i.Z)((function(){return(0,t.__generator)(this,(function(e){switch(e.label){case 0:return(0,w.MY)("profile_confirm_delete_account"),_(),[4,(0,b.tm)()];case 1:return e.sent(),(0,S.Tk)(),u().push("/"),[2]}}))}));return function(){return e.apply(this,arguments)}}(),x=r("delete-confirmation.confirmation-text"),j=h.toLowerCase()===x.toLowerCase();return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(v.ZP,{type:v.L$.Error,variant:v.Wu.Ghost,onClick:function(){(0,w.MY)("profile_delete_account"),c(!0)},isDisabled:n,children:r("delete-account")}),(0,a.jsx)(g.Z,{isOpen:o,onClickOutside:_,children:(0,a.jsxs)(g.Z.Body,{children:[(0,a.jsxs)(g.Z.Header,{children:[(0,a.jsx)(g.Z.Title,{children:r("delete-confirmation.title")}),(0,a.jsx)(g.Z.Subtitle,{children:r("delete-confirmation.subtitle")}),(0,a.jsx)("p",{className:Z().instructionText,children:(0,a.jsx)(p.Z,{i18nKey:"profile:delete-confirmation.instruction-text",values:{text:x},components:{strong:(0,a.jsx)("strong",{className:Z().confirmationText})}})}),(0,a.jsx)(k.ZP,{id:"delete-account-confirmation",value:h,onChange:m,fixedWidth:!1,containerClassName:Z().inputContainer})]}),(0,a.jsx)(g.Z.Footer,{children:(0,a.jsx)(v.ZP,{type:v.L$.Error,variant:v.Wu.Outlined,className:Z().deleteButton,onClick:f,isDisabled:!j,children:r("delete-confirmation.action-text")})})]})})]})},P=r(7414),I=r(69976),R=r(57830),y=r(88823),L=r.n(y),A=r(33457),F=r.n(A),E=r(73645),M=r(9192),T=r(90914),W=r(87336),H=r.n(W),D=r(22582),J=r(43609),K=r(69640),O=Array(10).fill(null),V=function(){var e=(0,d.Z)("home"),n=e.t,r=e.lang,s=(0,N.useContext)(M.Z),i=(0,I.Z)((0,K.bV)("19:1"),2),t=i[0],o=i[1],l=(0,D.dy)(s,t),u=(0,J.uP)(r),h=(0,N.useMemo)((function(){return(0,J.rQ)(Number(t),r)}),[r,t]);return(0,a.jsx)(a.Fragment,{children:O.map((function(e,s){return(0,a.jsx)("div",{className:c()(L().verseLink,F().skeletonItem),children:(0,a.jsxs)("div",{className:H().container,children:[(0,a.jsxs)("div",{className:H().header,children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(T.Z,{isActive:!0,children:(0,a.jsxs)("div",{className:H().translatedSurahName,children:[u&&(0,a.jsxs)(a.Fragment,{children:[n("common:surah")," "]}),l.translatedName]})}),!u&&(0,a.jsx)(T.Z,{isActive:!0,children:(0,a.jsxs)("div",{className:H().surahName,children:[n("common:surah")," ",(0,a.jsx)("br",{}),l.transliteratedName]})})]}),(0,a.jsx)("div",{className:H().surahNumber,children:(0,a.jsx)(T.Z,{isActive:!0,children:h})})]}),(0,a.jsx)(T.Z,{isActive:!0,children:(0,a.jsxs)("div",{className:H().surahIcon,children:[(0,a.jsx)(E.Z,{chapterId:t.toString(),hasSurahPrefix:!1,size:E._.Large}),(0,a.jsx)("div",{className:H().description,children:"".concat(n("common:ayah")," ").concat((0,J.rQ)(Number(o),r))})]})})]})},"skeleton_".concat(s))}))})},Y=function(e){var n=e.chapterId,r=e.surahName,s=e.surahNumber,i=e.translatedSurahName,t=e.description,o=(0,d.Z)("common"),c=o.t,l=o.lang,u=(0,J.uP)(l),h=(0,N.useMemo)((function(){return(0,J.rQ)(s,l)}),[l,s]);return(0,a.jsxs)("div",{className:H().container,children:[(0,a.jsxs)("div",{className:H().header,children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:H().translatedSurahName,children:[u&&(0,a.jsxs)(a.Fragment,{children:[c("surah")," "]}),i]}),!u&&(0,a.jsxs)("div",{className:H().surahName,children:[c("surah")," ",(0,a.jsx)("br",{}),r]})]}),(0,a.jsx)("div",{className:H().surahNumber,children:h})]}),(0,a.jsxs)("div",{className:H().surahIcon,children:[(0,a.jsx)(E.Z,{chapterId:n.toString(),hasSurahPrefix:!1,size:E._.Large}),t&&(0,a.jsx)("div",{className:H().description,children:t})]})]})},X=r(559);!function(e){e.Block="block",e.Row="row"}(s||(s={}));var z=function(e){var n=e.chapterId,r=e.surahName,i=e.surahNumber,t=e.translatedSurahName,o=e.description,c=e.display,l=void 0===c?s.Block:c;if(l===s.Block)return(0,a.jsx)(Y,{chapterId:n,surahName:r,surahNumber:i,translatedSurahName:t,description:o});if(l===s.Row)return(0,a.jsx)(X.Z,{chapterId:n,surahName:r,surahNumber:i,translatedSurahName:t,description:o});throw new Error("display must be either block or row")},Q=r(51592),q=r(84020),U=function(){var e=(0,d.Z)("home"),n=e.t,r=e.lang,i=(0,N.useContext)(M.Z),t=(0,Q.Z)(),o=t.recentlyReadVerseKeys,c=t.isLoading,l=function(){(0,w.MY)("recently_read_card")};return c?(0,a.jsxs)("div",{className:L().sessionsContainer,id:"reading-sessions",children:[(0,a.jsx)("p",{className:L().sessionsHeader,children:n("recently-read")}),(0,a.jsx)("div",{className:L().verseLinksContainer,children:(0,a.jsx)(V,{})})]}):0===o.length?null:(0,a.jsxs)("div",{className:L().sessionsContainer,id:"reading-sessions",children:[(0,a.jsx)("p",{className:L().sessionsHeader,children:n("recently-read")}),(0,a.jsx)("div",{className:L().verseLinksContainer,children:o.map((function(e){var t=(0,I.Z)((0,K.bV)(e),2),o=t[0],c=t[1],u=(0,D.dy)(i,o);return(0,a.jsx)("div",{className:L().verseLink,children:(0,a.jsx)(R.Z,{href:(0,q.P6)(e),onClick:l,children:(0,a.jsx)(z,{display:s.Block,chapterId:Number(o),surahNumber:Number(o),translatedSurahName:u.translatedName,surahName:u.transliteratedName,description:"".concat(n("common:ayah")," ").concat((0,J.rQ)(Number(c),r))})})},e)}))})]})},G=r(90740),$=r(43405),ee=r(19226),ne=r(50148),re=!0,se=(0,x.Z)((function(){var e=(0,d.Z)(),n=e.t,r=e.lang,s=(0,l.useRouter)(),o=(0,G.Z)(),u=o.user,h=o.isLoading,_=o.error,x=function(){var e=(0,i.Z)((function(){return(0,t.__generator)(this,(function(e){switch(e.label){case 0:return(0,ee.jl)()?((0,w.MY)("profile_logout"),[4,(0,b.TX)()]):[2];case 1:return e.sent(),(0,S.Tk)(),s.push((0,q.gk)()),s.reload(),[2]}}))}));return function(){return e.apply(this,arguments)}}();if(_)return(0,a.jsx)(ne.default,{statusCode:500});var N=u.email,p=u.firstName,k=u.lastName,g=u.photoUrl,C=(0,a.jsxs)("div",{className:c()(f().profileInfoContainer,f().skeletonContainer),children:[(0,a.jsx)(T.Z,{children:(0,a.jsx)("h2",{className:f().name,children:"Mohammad Ali"})}),(0,a.jsx)(T.Z,{children:(0,a.jsx)("div",{className:f().email,children:"mohammadali@quran.com"})})]}),Z=(0,a.jsxs)("div",{className:f().profileInfoContainer,children:[(0,a.jsx)("h2",{className:f().name,children:"".concat(p," ").concat(k)}),(0,a.jsx)("div",{className:f().email,children:N})]});return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(j.Z,{title:n("common:profile"),url:(0,q.Z2)(r,(0,q.kJ)()),languageAlternates:(0,J.qc)((0,q.kJ)()),nofollow:!0,noindex:!0}),(0,a.jsx)("div",{className:m().pageContainer,children:(0,a.jsx)("div",{className:m().flow,children:(0,a.jsxs)("div",{className:f().container,children:[(0,a.jsx)("div",{className:c()(m().flowItem),children:(0,a.jsxs)("div",{className:f().profileContainer,children:[(0,a.jsx)("div",{className:f().profilePicture,children:(0,a.jsx)("img",{className:f().profilePicture,alt:"avatar",src:g||$.zU})}),h?C:Z]})}),(0,a.jsx)("div",{className:c()(m().flowItem,m().fullWidth,f().recentReadingContainer),children:(0,a.jsx)(U,{})}),(0,a.jsx)("div",{className:c()(m().flowItem,m().fullWidth,f().bookmarksAndCollectionsContainer),children:(0,a.jsx)(P.Z,{isHomepage:!1})}),(0,a.jsxs)("div",{className:c()(m().flowItem,m().fullWidth,f().actionsContainer),children:[(0,a.jsx)("div",{className:f().action,children:(0,a.jsx)(B,{isDisabled:h})}),(0,a.jsx)("div",{className:f().action,children:(0,a.jsx)(v.ZP,{isDisabled:h,onClick:x,children:n("common:logout")})})]})]})})})]})}))},24542:function(e){e.exports={inputContainer:"DeleteAccountButton_inputContainer__XvfB_",deleteButton:"DeleteAccountButton_deleteButton__N7Ex2",confirmationText:"DeleteAccountButton_confirmationText__48miH",instructionText:"DeleteAccountButton_instructionText__iVIlR"}},88823:function(e){e.exports={sessionsContainer:"RecentReadingSessions_sessionsContainer__mC450",sessionsHeader:"RecentReadingSessions_sessionsHeader__lbyVl",verseLinksContainer:"RecentReadingSessions_verseLinksContainer__18irS",verseLink:"RecentReadingSessions_verseLink__Ky4p8",button:"RecentReadingSessions_button__0mjNR"}},33457:function(e){e.exports={skeletonItem:"RecentReadingSessionsSkeleton_skeletonItem__73ehH"}},87336:function(e){e.exports={container:"SurahPreviewBlock_container__ME6vO",header:"SurahPreviewBlock_header__Jg3cj",surahIcon:"SurahPreviewBlock_surahIcon__IFm5J",surahNumber:"SurahPreviewBlock_surahNumber__MEa5C",translatedSurahName:"SurahPreviewBlock_translatedSurahName__ZZkwX",surahName:"SurahPreviewBlock_surahName__MNieK",description:"SurahPreviewBlock_description__bfpmJ"}},61085:function(e){e.exports={container:"_error_container__vJFnH",withFullWidth:"_error_withFullWidth__VEzYc",title:"_error_title__oLWAK",goBack:"_error_goBack__U4WNd",reportBug:"_error_reportBug__tsKmR"}},58042:function(e){e.exports={container:"profile_container__oyMiM",profileContainer:"profile_profileContainer__F0pv4",profilePicture:"profile_profilePicture__6x3ow",profileInfoContainer:"profile_profileInfoContainer__Z9KlM",skeletonContainer:"profile_skeletonContainer__gJPEf",name:"profile_name__4_ocA",email:"profile_email___dBtF",actionsContainer:"profile_actionsContainer__Cjx1s",action:"profile_action__OFH1d",recentReadingContainer:"profile_recentReadingContainer__jsh_S",bookmarksAndCollectionsContainer:"profile_bookmarksAndCollectionsContainer__YZ3c9",collectionListContainer:"profile_collectionListContainer__p8_hb"}}},function(e){e.O(0,[15240,47995,3732,49774,92888,40179],(function(){return n=56896,e(e.s=n);var n}));var n=e.O();_N_E=n}]);
  2. //# sourceMappingURL=profile-135c02e5ac618796.js.map