12 |
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[19960],{19960:function(e,i,n){"use strict";n.r(i),n.d(i,{default:function(){return Be}});var t=n(45361),a=n(57611),_=n(67597),d=n(37014),l=n.n(d),r=n(33770),o=n.n(r),s=n(61395),h=n(47189),c=n(648),u=n(39682),w=n(57044),f=n(15129),g=n(15721),p=n(27967),m=n(69640),v=n(87739),x=n(63747),k=n(24213),R=function(e,i,n){var t=(0,m.tR)(n[i].from),a=(0,m.tR)(n[i].to),_=100*((0,m.tR)(e)-t+1)/(a-t+1);return _<=33.3?k.Z.Start:_<=66.6?k.Z.Center:k.Z.End},b=function(e,i,n,t,a,d,l,r,o,s){var h=(0,f.useRouter)().query,c=h.startingVerse,u=h.chapterId,m=(0,_.useRef)(!0);(0,_.useEffect)((function(){m.current=!0}),[r,o,c]),(0,_.useEffect)((function(){if(!s&&i.current&&Object.keys(d).length&&e===x.Qi.Chapter&&c){var _=Number(c);if(Number.isInteger(_)&&_>0){var r=l?n.verses[0].pageNumber:Number(Object.keys(d)[0]),o=a.find((function(e){return e.verseNumber===_}));if(o&&!0===m.current&&d[o.pageNumber]){var h=o.pageNumber-r;i.current.scrollToIndex({index:h,align:R("".concat(u,":").concat(_),o.pageNumber,d)}),m.current=!1}else(0,v._i)((0,p.Wq)((0,w.Z)({filters:"".concat(u,":").concat(_),fields:"page_number"},(0,g.$P)(t.quranFont,t.mushafLines)))).then((function(e){if(e.verses.length&&!0===m.current){var n=e.verses[0].pageNumber-r;d[e.verses[0].pageNumber]&&(i.current.scrollToIndex({index:n,align:R("".concat(u,":").concat(_),e.verses[0].pageNumber,d)}),m.current=!1)}}))}}}),[u,n.verses,s,l,d,e,t.mushafLines,t.quranFont,c,a,i])},V=n(16946),j=n(62103),q=n(8522),y=n(85378),N=n.n(y),Z=function(e){var i=[];return e.forEach((function(e){i=(0,q.Z)(i).concat((0,q.Z)((0,m.LQ)(e,!0)))})),N()(i,(function(e){return"Page".concat(e.pageNumber,"-Line").concat(e.lineNumber)}))},P=n(69976),T=n(21594),C=n(40168),I=n(34919),S=n.n(I),W=n(7215),L=n(18419),B=n(51628),O=n(81858),E=n(33294),F=n(46581),D=n(82427),M=function(e){var i=e.lineKey,n=e.words,d=e.isBigTextLayout,r=e.pageIndex,o=e.lineIndex,s=(0,_.useContext)(D.c),h=(0,T.v)(s,(function(e){var i=e.context,t=i.surah,a=i.ayahNumber;return n.map((function(e){return e.verseKey})).includes("".concat(t,":").concat(a))})),u=(0,P.Z)((0,O.ZP)(O.nv),2),w=u[0],f=u[1],g=(0,L.P)().isActive,p=(0,c.v9)(E.Mj,c.wU)&&!g,v=(0,c.v9)(F.eB,c.wU),x=v.showWordByWordTranslation,k=v.showWordByWordTransliteration;(0,_.useEffect)((function(){h&&p&&w()}),[h,w,p]);var R,b,V=(0,m.TO)(n[0].location),j="1"===V[1]&&"1"===V[2],q=x||k;return(0,a.jsxs)("div",{ref:f,id:i,className:l()(S().container,(R={},(0,t.Z)(R,S().highlighted,h),(0,t.Z)(R,S().mobileInline,d),R)),children:[j&&(0,a.jsx)(W.Z,{chapterId:V[0],pageNumber:n[0].pageNumber,hizbNumber:n[0].hizbNumber}),(0,a.jsx)("div",{className:l()(S().line,(b={},(0,t.Z)(b,S().mobileInline,d),(0,t.Z)(b,S().fixedWidth,!q),b)),children:(0,a.jsx)(B.Z,{words:n,isReadingMode:!0,isHighlighted:h,shouldShowH1ForSEO:0===r&&0===o})})]})},K=function(e,i){return e.lineKey===i.lineKey&&e.isBigTextLayout===i.isBigTextLayout&&!(0,C.RG)(e.quranReaderStyles,i.quranReaderStyles,e.words,i.words)},Q=(0,_.memo)(M,K),H=n(53138),U=n.n(H),X=n(42760),A=n.n(X),z=n(57830),G=n(43609),J=n(84020),Y=function(e){var i=e.page,n=(0,s.Z)("quran-reader").lang,t=(0,J.GK)(i);return(0,a.jsx)("div",{className:A().pageText,children:(0,a.jsx)(z.Z,{href:t,shouldPassHref:!0,shouldPrefetch:!1,children:(0,a.jsx)("p",{className:A().pageLink,children:(0,G.rQ)(i,n)})})})},$=n(21596),ee=n(51652),ie=function(e){var i,n=e.verses,d=e.pageNumber,r=e.quranReaderStyles,o=e.pageIndex,s=(0,_.useMemo)((function(){return n&&n.length?Z(n):{}}),[n]),h=r.quranTextFontScale,u=r.quranFont,w=r.mushafLines,f=(0,c.v9)(F.eB,c.wU),g=f.showWordByWordTranslation,p=f.showWordByWordTransliteration,m=g||p||h>3||u===x.fr.Tajweed,v=(0,$.Z)(d,u);return(0,a.jsxs)("div",{id:"page-".concat(d),className:l()(U().container,(i={},(0,t.Z)(i,U().mobileCenterText,m),(0,t.Z)(i,U()[(0,ee.oj)(x.v3,h,w,!0)],!v),i)),children:[Object.keys(s).map((function(e,i){return(0,a.jsx)(Q,{pageIndex:o,lineIndex:i,lineKey:e,words:s[e],isBigTextLayout:m,quranReaderStyles:r},e)})),(0,a.jsx)(Y,{page:d})]})},ne=n(57065),te=n.n(ne),ae=n(87352),_e=n.n(ae),de=n(81456),le=n.n(de),re=n(90914),oe=n(5330),se=n(98271),he=function(){var e=(0,c.v9)(oe.Pt,c.wU),i=e.quranFont,n=e.quranTextFontScale,_=e.mushafLines,d=(0,c.v9)(F.eB,c.wU),r=d.showWordByWordTranslation,o=d.showWordByWordTransliteration,s=(0,se.Nl)(i,_),h=r||o;return(0,a.jsx)("div",{className:_e().skeletonContainer,children:te()(s).map((function(e){return(0,a.jsx)(re.Z,{className:l()(_e().skeleton,le()[(0,ee.bZ)(i,n,_)],(0,t.Z)({},_e().fixedWidth,!h))},e)}))})},ce=n(73181),ue=n(81200),we=function(e,i){var n=(0,w.Z)({},i[e]);return delete n.firstVerseKey,delete n.lastVerseKey,n},fe=function(e){var i=e.pagesVersesRange,n=e.quranReaderStyles,d=e.reciterId,l=e.lang,r=e.wordByWordLocale,o=e.pageIndex,s=e.setMushafPageToVersesMap,h=e.initialData,c=(0,_.useMemo)((function(){return function(e,i){return Number(Object.keys(i)[0])+e}(o,i)}),[o,i]),u=(0,_.useMemo)((function(){return 0===o?function(e,i){return i.map((function(i){return(0,V.Z)((0,w.Z)({},i),{words:i.words.filter((function(i){return i.pageNumber===e}))})}))}(c,h.verses):h.verses}),[h.verses,o,c]),f=(0,ue.Z)(),g=0===o&&f,p=(0,j.Z)((0,ce.oA)({pageNumber:c,pageVersesRange:we(c,i),quranReaderStyles:n,reciter:d,locale:l,wordByWordLocale:r}),ce.f3,{fallbackData:g?u:null,revalidateOnMount:!g}),m=p.data,v=p.isValidating;return(0,_.useEffect)((function(){m&&s((function(e){return(0,V.Z)((0,w.Z)({},e),(0,t.Z)({},c,m))}))}),[c,s,m]),!m||v?(0,a.jsx)(he,{}):(0,a.jsx)(ie,{verses:m,pageNumber:Number(c),quranReaderStyles:n,pageIndex:o},"page-".concat(c))},ge=n(57178),pe=n.n(ge),me=n(85494),ve=n(52140),xe=n(45077),ke=n(75183),Re=function(e){var i=e.scrollToNextPage,n=e.scrollToPreviousPage,d=(0,s.Z)("quran-reader").t,r=(0,_.useContext)(D.c),o=(0,T.v)(r,(function(e){return e.matches("HIDDEN")}));return(0,a.jsxs)("div",{className:l()(pe().buttonsContainer,(0,t.Z)({},pe().audioPlayerOpen,!o)),children:[(0,a.jsx)(me.ZP,{size:me.qE.Small,className:pe().prevButton,onClick:n,shouldFlipOnRTL:!1,tooltip:(0,a.jsxs)(a.Fragment,{children:[d("prev-page")," ",(0,a.jsx)(ve.Z,{invertColors:!0,keyboardKey:"\u2b06"})]}),tooltipContentSide:xe.iw.LEFT,children:(0,a.jsx)(ke.Z,{})}),(0,a.jsx)(me.ZP,{size:me.qE.Small,onClick:i,tooltip:(0,a.jsxs)(a.Fragment,{children:[d("next-page")," ",(0,a.jsx)(ve.Z,{invertColors:!0,keyboardKey:"\u2b07"})]}),tooltipContentSide:xe.iw.LEFT,children:(0,a.jsx)(ke.Z,{})})]})},be=n(48158),Ve=n.n(be),je=n(60780),qe=n(36441),ye=n(86591),Ne=n(10117),Ze=n(82257),Pe=n(13695),Te=n(60948),Ce=n(88555),Ie=n(12195),Se=n(50148),We=n(89773),Le=o()((function(){return Promise.all([n.e(81301),n.e(97917)]).then(n.bind(n,29229))}),{loadableGenerated:{webpack:function(){return[29229]}},ssr:!1,loading:function(){return(0,a.jsx)(Ne.Z,{})}}),Be=function(e){var i=e.quranReaderStyles,n=e.quranReaderDataType,d=e.initialData,r=e.resourceId,o=(0,_.useState)((0,t.Z)({},d.verses[0].pageNumber,d.verses)),w=o[0],f=o[1],g=(0,s.Z)("quran-reader").lang,p=(0,c.v9)(oe.i9),m=(0,c.v9)(Ce.E9,c.wU),v=(0,_.useMemo)((function(){return Object.values(w).flat()}),[w]),x=(0,Pe.Z)(We.Z.Reciter),k=x.value,R=x.isQueryParamDifferent,V=(0,Ze.Z)(We.Z.WBW_LOCALE),j=V.value,q=V.isQueryParamDifferent,y=i.quranFont,N=i.mushafLines,Z=i.quranTextFontScale;(0,Te.Z)(y,v);var P=(0,je.Z)(r,n,d,i,p),T=P.pagesCount,C=P.hasError,I=P.pagesVersesRange,S=P.isLoading,W=(0,_.useMemo)((function(){return function(e,i){return Number(e)-Number(Object.keys(i)[0])}(Number(m),I)}),[m,I]),L=(0,_.useRef)(null);b(n,L,d,i,v,I,p,y,N,S);var B=(0,_.useCallback)((function(){L.current.scrollToIndex({index:W-1,align:"start",offset:-35})}),[W]),O=(0,_.useCallback)((function(){L.current.scrollToIndex({index:W+1,align:"start",offset:25})}),[W]),E=(0,_.useCallback)((function(){(0,Ie.MY)("reading_view_prev_page_button"),B()}),[B]),F=(0,_.useCallback)((function(){(0,Ie.MY)("reading_view_next_page_button"),O()}),[O]),D=Z<=5,M=(0,_.useCallback)((function(e){e.preventDefault(),B()}),[B]),K=(0,_.useCallback)((function(e){e.preventDefault(),O()}),[O]);(0,h.y1)("Up",M,{enabled:D},[B]),(0,h.y1)("Down",K,{enabled:D},[O]);if(C)return(0,a.jsx)(Se.default,{});var Q=R||q;return(0,a.jsxs)(a.Fragment,{children:[Q&&(0,a.jsx)(ye.Z,{translationsQueryParamDifferent:!1,reciterQueryParamDifferent:R,wordByWordLocaleQueryParamDifferent:q}),(0,a.jsx)("div",{onCopy:function(e){return(0,qe.Z)(e,v,y)},className:l()(Ve().container,Ve()[(0,ee.oj)(y,Z,N)]),children:S?(0,a.jsx)("div",{className:Ve().virtuosoScroller,children:(0,a.jsx)(he,{})}):(0,a.jsx)(u.OO,{ref:L,useWindowScroll:!0,increaseViewportBy:1200,className:Ve().virtuosoScroller,initialItemCount:1,totalCount:T+1,itemContent:function(e){if(e===T){var t=w[m],_=null===t||void 0===t?void 0:t[t.length-1];return _?(0,a.jsx)(Le,{quranReaderDataType:n,lastVerse:_,initialData:d}):null}return(0,a.jsx)(fe,{pagesVersesRange:I,quranReaderStyles:i,reciterId:k,lang:g,wordByWordLocale:j,pageIndex:e,setMushafPageToVersesMap:f,initialData:d})}})}),D&&(0,a.jsx)(Re,{scrollToNextPage:F,scrollToPreviousPage:E})]})}},34919:function(e){e.exports={line:"Line_line__3jPyY",container:"Line_container__CApVP",mobileInline:"Line_mobileInline__jEjq9",fixedWidth:"Line_fixedWidth__AHk9W"}},53138:function(e){e.exports={"fallback_qpc_uthmani_hafs-line-width-1":"Page_fallback_qpc_uthmani_hafs-line-width-1__X9dUi","fallback_qpc_uthmani_hafs-line-width-2":"Page_fallback_qpc_uthmani_hafs-line-width-2__prdZQ","fallback_qpc_uthmani_hafs-line-width-3":"Page_fallback_qpc_uthmani_hafs-line-width-3__CpdkI","fallback_qpc_uthmani_hafs-line-width-4":"Page_fallback_qpc_uthmani_hafs-line-width-4__bpdKT","fallback_qpc_uthmani_hafs-line-width-5":"Page_fallback_qpc_uthmani_hafs-line-width-5__r0dhC","fallback_qpc_uthmani_hafs-line-width-6":"Page_fallback_qpc_uthmani_hafs-line-width-6__hNehk","fallback_qpc_uthmani_hafs-line-width-7":"Page_fallback_qpc_uthmani_hafs-line-width-7__W627r","fallback_qpc_uthmani_hafs-line-width-8":"Page_fallback_qpc_uthmani_hafs-line-width-8__obMGX","fallback_qpc_uthmani_hafs-line-width-9":"Page_fallback_qpc_uthmani_hafs-line-width-9__uE3Np","fallback_qpc_uthmani_hafs-line-width-10":"Page_fallback_qpc_uthmani_hafs-line-width-10__g_Coa",container:"Page_container__hkXnW",mobileCenterText:"Page_mobileCenterText__WB1en"}},42760:function(e){e.exports={pageText:"PageFooter_pageText__YdcIS",pageLink:"PageFooter_pageLink__YT3wq"}},57178:function(e){e.exports={buttonsContainer:"PageNavigationButtons_buttonsContainer__fomTO",prevButton:"PageNavigationButtons_prevButton__OOwCQ",audioPlayerOpen:"PageNavigationButtons_audioPlayerOpen__sIOdL"}},48158:function(e){e.exports={"code_v1-line-width-1":"ReadingView_code_v1-line-width-1__u_hC8","code_v1-line-width-2":"ReadingView_code_v1-line-width-2__Hf8MJ","code_v1-line-width-3":"ReadingView_code_v1-line-width-3__C3GX9","code_v1-line-width-4":"ReadingView_code_v1-line-width-4__JF_zd","code_v1-line-width-5":"ReadingView_code_v1-line-width-5__6kO9e","code_v1-line-width-6":"ReadingView_code_v1-line-width-6__Xmg9T","code_v1-line-width-7":"ReadingView_code_v1-line-width-7__5DID0","code_v1-line-width-8":"ReadingView_code_v1-line-width-8__QSPjI","code_v1-line-width-9":"ReadingView_code_v1-line-width-9__g4KUg","code_v1-line-width-10":"ReadingView_code_v1-line-width-10__EbYvu","code_v2-line-width-1":"ReadingView_code_v2-line-width-1__LKGTJ","code_v2-line-width-2":"ReadingView_code_v2-line-width-2__XxvSm","code_v2-line-width-3":"ReadingView_code_v2-line-width-3__boomP","code_v2-line-width-4":"ReadingView_code_v2-line-width-4__jii3F","code_v2-line-width-5":"ReadingView_code_v2-line-width-5__yh418","code_v2-line-width-6":"ReadingView_code_v2-line-width-6__PmlQ_","code_v2-line-width-7":"ReadingView_code_v2-line-width-7__L3zwX","code_v2-line-width-8":"ReadingView_code_v2-line-width-8__fodHn","code_v2-line-width-9":"ReadingView_code_v2-line-width-9__R51Sk","code_v2-line-width-10":"ReadingView_code_v2-line-width-10__aRnmF","text_indopak_15_lines-line-width-1":"ReadingView_text_indopak_15_lines-line-width-1__HIvVb","text_indopak_15_lines-line-width-2":"ReadingView_text_indopak_15_lines-line-width-2__COw_J","text_indopak_15_lines-line-width-3":"ReadingView_text_indopak_15_lines-line-width-3__x0I0x","text_indopak_15_lines-line-width-4":"ReadingView_text_indopak_15_lines-line-width-4__oxtcz","text_indopak_15_lines-line-width-5":"ReadingView_text_indopak_15_lines-line-width-5__CIg5C","text_indopak_15_lines-line-width-6":"ReadingView_text_indopak_15_lines-line-width-6__e8_Zq","text_indopak_15_lines-line-width-7":"ReadingView_text_indopak_15_lines-line-width-7__R1c56","text_indopak_15_lines-line-width-8":"ReadingView_text_indopak_15_lines-line-width-8__f1hhH","text_indopak_15_lines-line-width-9":"ReadingView_text_indopak_15_lines-line-width-9__e_Fhh","text_indopak_15_lines-line-width-10":"ReadingView_text_indopak_15_lines-line-width-10__av8qG","text_indopak_16_lines-line-width-1":"ReadingView_text_indopak_16_lines-line-width-1__wEGW4","text_indopak_16_lines-line-width-2":"ReadingView_text_indopak_16_lines-line-width-2__AeVXj","text_indopak_16_lines-line-width-3":"ReadingView_text_indopak_16_lines-line-width-3__UEeqd","text_indopak_16_lines-line-width-4":"ReadingView_text_indopak_16_lines-line-width-4__2Nw2u","text_indopak_16_lines-line-width-5":"ReadingView_text_indopak_16_lines-line-width-5__r2tKN","text_indopak_16_lines-line-width-6":"ReadingView_text_indopak_16_lines-line-width-6__ybw6l","text_indopak_16_lines-line-width-7":"ReadingView_text_indopak_16_lines-line-width-7____CTX","text_indopak_16_lines-line-width-8":"ReadingView_text_indopak_16_lines-line-width-8__ymIE0","text_indopak_16_lines-line-width-9":"ReadingView_text_indopak_16_lines-line-width-9__MKM2y","text_indopak_16_lines-line-width-10":"ReadingView_text_indopak_16_lines-line-width-10__XhBAV","qpc_uthmani_hafs-line-width-1":"ReadingView_qpc_uthmani_hafs-line-width-1__1ArHr","qpc_uthmani_hafs-line-width-2":"ReadingView_qpc_uthmani_hafs-line-width-2__I6rKn","qpc_uthmani_hafs-line-width-3":"ReadingView_qpc_uthmani_hafs-line-width-3__jIQg8","qpc_uthmani_hafs-line-width-4":"ReadingView_qpc_uthmani_hafs-line-width-4__RXw5a","qpc_uthmani_hafs-line-width-5":"ReadingView_qpc_uthmani_hafs-line-width-5__eO8Fo","qpc_uthmani_hafs-line-width-6":"ReadingView_qpc_uthmani_hafs-line-width-6__TbgkW","qpc_uthmani_hafs-line-width-7":"ReadingView_qpc_uthmani_hafs-line-width-7__RoJmi","qpc_uthmani_hafs-line-width-8":"ReadingView_qpc_uthmani_hafs-line-width-8__m_AJa","qpc_uthmani_hafs-line-width-9":"ReadingView_qpc_uthmani_hafs-line-width-9___DGtD","qpc_uthmani_hafs-line-width-10":"ReadingView_qpc_uthmani_hafs-line-width-10__uNVi7","tajweed-line-width-1":"ReadingView_tajweed-line-width-1__XzcHo","tajweed-line-width-2":"ReadingView_tajweed-line-width-2__qI_3N","tajweed-line-width-3":"ReadingView_tajweed-line-width-3__iPATb","tajweed-line-width-4":"ReadingView_tajweed-line-width-4___gTZv","tajweed-line-width-5":"ReadingView_tajweed-line-width-5__8creJ","tajweed-line-width-6":"ReadingView_tajweed-line-width-6__mqO8v","tajweed-line-width-7":"ReadingView_tajweed-line-width-7__p1Oi4","tajweed-line-width-8":"ReadingView_tajweed-line-width-8__js74h","tajweed-line-width-9":"ReadingView_tajweed-line-width-9__gjjDU","tajweed-line-width-10":"ReadingView_tajweed-line-width-10__xBOUh",container:"ReadingView_container__99RFM",virtuosoScroller:"ReadingView_virtuosoScroller__Y3HA6"}},87352:function(e){e.exports={skeletonContainer:"ReadingViewSkeleton_skeletonContainer__h5Sb2",skeleton:"ReadingViewSkeleton_skeleton__hw8ZE",fixedWidth:"ReadingViewSkeleton_fixedWidth__fIRzb"}}}]);
- //# sourceMappingURL=19960.e3d310e5eed7e5d7.js.map
|