12 |
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[93862],{5754:function(e,n,t){"use strict";var a,r=t(67597);function o(){return o=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var a in t)({}).hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},o.apply(null,arguments)}n.Z=function(e){return r.createElement("svg",o({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),a||(a=r.createElement("path",{d:"M6.65 5.813h11.625V9.3l4.65-4.65L18.275 0v3.487H4.325v6.976H6.65v-4.65Zm11.625 11.625H6.65V13.95L2 18.6l4.65 4.65v-3.488H20.6v-6.975h-2.325v4.65Z",fill:"currentColor"})))}},13533:function(e,n,t){"use strict";var a,r,o,i,s,l=t(67597);function c(){return c=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var a in t)({}).hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},c.apply(null,arguments)}n.Z=function(e){return l.createElement("svg",c({viewBox:"0 0 92 80",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),a||(a=l.createElement("path",{d:"m12.34 45.828.005.007.006.007c2.639 2.996 5.947 5.452 9.705 7.21a32.563 32.563 0 0 0 12.105 2.993 32.981 32.981 0 0 0 12.401-1.734c3.953-1.36 7.547-3.46 10.544-6.165 2.996-2.705 5.33-5.954 6.841-9.536a24.806 24.806 0 0 0 1.925-11.245c-.243-3.83-1.382-7.569-3.337-10.97-1.956-3.4-4.684-6.385-8.002-8.76l-.291.406.272-.42a.577.577 0 0 1-.248-.322.477.477 0 0 1 .04-.358.642.642 0 0 1 .33-.284.808.808 0 0 1 .498-.034c5.97 1.539 11.385 4.455 15.713 8.457 4.327 4.002 7.416 8.949 8.967 14.348a29.004 29.004 0 0 1-.112 16.452c-1.625 5.382-4.782 10.294-9.164 14.248-4.382 3.954-9.838 6.81-15.829 8.282a39.4 39.4 0 0 1-18.315.102c-6.01-1.405-11.505-4.201-15.941-8.106-4.434-3.903-7.656-8.776-9.355-14.137a.477.477 0 0 1 .04-.346c.061-.116.17-.22.32-.284a.806.806 0 0 1 .492-.043.702.702 0 0 1 .39.232Z",stroke:"currentColor"})),r||(r=l.createElement("path",{d:"M79.173 34.298c.302-1.936.417-3.889.345-5.837a29.111 29.111 0 0 1 1.431 9.421c-.061 4.362-1.11 8.668-3.084 12.654-1.974 3.987-4.831 7.572-8.4 10.533-3.57 2.96-7.776 5.235-12.36 6.68a39.256 39.256 0 0 1-14.294 1.72c-4.846-.311-9.568-1.512-13.878-3.528-4.309-2.016-8.113-4.803-11.18-8.188-3.066-3.385-5.33-7.296-6.658-11.493l-.004-.013a.41.41 0 0 1 .004-.284c3.692 5.875 9.286 10.586 16.028 13.501 6.934 2.998 14.735 3.948 22.298 2.718 7.562-1.231 14.51-4.582 19.853-9.584 5.343-5.002 8.81-11.404 9.899-18.3Z",stroke:"currentColor"})),o||(o=l.createElement("path",{d:"M54.242 8.04c3.262 2.337 5.94 5.27 7.86 8.605 1.917 3.336 3.033 7 3.272 10.752a24.305 24.305 0 0 1-1.887 11.018c-1.483 3.512-3.772 6.702-6.717 9.36-2.944 2.658-6.479 4.724-10.37 6.063a32.481 32.481 0 0 1-12.213 1.708 32.064 32.064 0 0 1-11.92-2.948c-3.698-1.729-6.95-4.144-9.54-7.086a1.202 1.202 0 0 0-.666-.403 1.306 1.306 0 0 0-.799.07c-.248.106-.449.287-.566.512a.976.976 0 0 0-.078.72c1.727 5.455 5.004 10.408 9.504 14.37 4.502 3.962 10.071 6.795 16.159 8.218a39.901 39.901 0 0 0 18.548-.103c6.067-1.491 11.598-4.386 16.044-8.397 4.447-4.012 7.655-9.001 9.307-14.475a29.503 29.503 0 0 0 .115-16.734c-1.578-5.491-4.718-10.516-9.11-14.577-4.39-4.06-9.881-7.016-15.928-8.574a1.308 1.308 0 0 0-.81.055c-.254.103-.46.284-.582.511a.977.977 0 0 0-.08.73c.068.244.23.458.457.606v0Z",stroke:"currentColor",strokeWidth:.5,strokeLinecap:"round",strokeLinejoin:"round"})),i||(i=l.createElement("path",{clipRule:"evenodd",d:"M28.306 38.49c1.355-4.41 2.243-7.634 3.174-13.1-.05.085 7.202-2.569 10.347-3.753-4.508-.57-10.678-1.417-10.617-1.324-.848-3.48-1.636-8.948-3.62-15.313-.852 4.775-2.35 10.221-2.973 15.03-3.843 1-6.947 2.025-10.617 3.573 4.511.96 7.36 1.888 11.077 2.73 1.125 5.027 1.95 7.847 3.229 12.158Z",stroke:"currentColor",strokeWidth:1.5,strokeMiterlimit:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),s||(s=l.createElement("path",{d:"M5.744 25c.02 1.313-.077 2.688.05 3.994M2 32.059c.708.011 1.434-.104 2.14-.05M6.206 33.953c-.185 1.095-.145 2.213-.15 3.322M8.378 31.378c.983.085 2.025-.244 2.98-.015",stroke:"currentColor",strokeWidth:1.5,strokeMiterlimit:1.5,strokeLinecap:"round",strokeLinejoin:"round"})))}},21515:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/reading-goal",function(){return t(40235)}])},66498:function(e,n,t){"use strict";t.d(n,{Z:function(){return P}});var a=t(45361),r=t(57611),o=t(57384),i=t(67597),s=t(61544),l=t(4300);const c="Progress",u=100,[d,p]=(0,s.b)(c),[g,m]=d(c),v=(0,i.forwardRef)(((e,n)=>{const{__scopeProgress:t,value:a,max:r,getValueLabel:s=_,...c}=e,d=C(r)?r:u,p=E(a,d)?a:null,m=x(p)?s(p,d):void 0;return(0,i.createElement)(g,{scope:t,value:p,max:d},(0,i.createElement)(l.WV.div,(0,o.Z)({"aria-valuemax":d,"aria-valuemin":0,"aria-valuenow":x(p)?p:void 0,"aria-valuetext":m,role:"progressbar","data-state":h(p,d),"data-value":null!==p&&void 0!==p?p:void 0,"data-max":d},c,{ref:n})))}));v.propTypes={max(e,n,t){const a=e[n],r=String(a);return a&&!C(a)?new Error(function(e,n){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${n}\`. Only numbers greater than 0 are valid max values. Defaulting to \`100\`.`}(r,t)):null},value(e,n,t){const a=e[n],r=String(a),o=C(e.max)?e.max:u;return null==a||E(a,o)?null:new Error(function(e,n){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${n}\`. The \`value\` prop must be:\n - a positive number\n - less than the value passed to \`max\` (or 100 if no \`max\` prop is set)\n - \`null\` if the progress is indeterminate.\n\nDefaulting to \`null\`.`}(r,t))}};const f="ProgressIndicator",y=(0,i.forwardRef)(((e,n)=>{var t;const{__scopeProgress:a,...r}=e,s=m(f,a);return(0,i.createElement)(l.WV.div,(0,o.Z)({"data-state":h(s.value,s.max),"data-value":null!==(t=s.value)&&void 0!==t?t:void 0,"data-max":s.max},r,{ref:n}))}));function _(e,n){return`${Math.round(e/n*100)}%`}function h(e,n){return null==e?"indeterminate":e===n?"complete":"loading"}function x(e){return"number"===typeof e}function C(e){return x(e)&&!isNaN(e)&&e>0}function E(e,n){return x(e)&&!isNaN(e)&&e<=n&&e>=0}const j=v,N=y;var Z,w=t(37014),b=t.n(w),k=t(75302),S=t.n(k);!function(e){e.Small="small",e.Medium="medium",e.Large="large"}(Z||(Z={}));var P=function(e){var n,t=e.value,o=e.rootStyles,i=e.size,s=void 0===i?Z.Small:i,l=e.indicatorStyles,c=b()(S().progressRoot,(n={},(0,a.Z)(n,S().progressSmall,s===Z.Small),(0,a.Z)(n,S().progressMedium,s===Z.Medium),(0,a.Z)(n,S().progressLarge,s===Z.Large),n),o);return(0,r.jsx)(j,{className:c,value:t,children:(0,r.jsx)(N,{className:b()(S().progressIndicator,l),style:{transform:"translateX(-".concat(100-t,"%)")}})})}},83548:function(e,n,t){"use strict";t.d(n,{Z:function(){return h}});var a,r=t(57044),o=t(16946),i=t(67597),s=t(61395),l=t(648),c=t(99968),u=t(5330);!function(e){e.QURAN="QURAN"}(a||(a={}));var d=t(15721),p=t(9740),g=t(37572),m=t(19226),v=t(85149),f=t(43609),y=function(){return(0,i.useMemo)((function(){var e=[],n=new Date,t=new Date(n);0!==n.getDay()&&t.setDate(n.getDate()-n.getDay());for(var a=0;a<7;a+=1){var r=new Date(t);r.setDate(t.getDate()+a),e.push({current:r.getDate()===n.getDate(),date:r,dateString:(0,v.Bz)(r)})}return e}),[])},_=function(e,n){var t=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=(0,s.Z)("reading-goal"),r=a.t,o=a.lang;return(0,i.useMemo)((function(){var a=[],i=n>1,s=0;!t&&i&&e.forEach((function(e,t){e.current&&(i=n>t+1,s=t)}));for(var l=0;l<7;l+=1){var c=void 0;if(t)c={localizedNumber:(0,f.rQ)(l+1,o),title:(0,v.Zu)(e[l].date,o)};else{var u=(0,f.rQ)(i?n-s+l:l+1,o);c={localizedNumber:u,title:r("day-x",{day:u})}}a.push(c)}return a}),[o,t,n,r,e])},h=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.showDayName,t=e.disableIfNoGoalExists,s=y(),v=(0,l.v9)(u.Ho,l.wU),f=(0,l.v9)(u.z$,l.wU),h=(0,d.$P)(v,f).mushaf,x=(0,i.useState)(null),C=x[0],E=x[1],j={mushafId:h,from:s[0].dateString,to:s[s.length-1].dateString,type:a.QURAN},N=(0,c.ZP)((0,m.jl)()&&!0!==C?(0,g.G_)():null,(function(){return(0,p.DG)(j)}),{revalidateOnFocus:!1}),Z=N.data,w=N.isValidating,b=N.error;(0,i.useEffect)((function(){null===C&&t&&Z&&E(!Z.data.goal)}),[t,C,Z]);var k=w&&!Z,S=(null===Z||void 0===Z?void 0:Z.data)||{activityDays:[],goal:void 0,streak:0},P=S.activityDays,T=S.goal,R=S.streak,A=(0,i.useMemo)((function(){if(!P)return{};var e={};return P.forEach((function(n){e[n.date]=(0,o.Z)((0,r.Z)({},n),{hasRead:n.pagesRead>0||n.secondsRead>0||n.ranges.length>0||n.manuallyAddedSeconds>0})})),e}),[P]),G=(0,i.useMemo)((function(){var e;return A[null===(e=s.find((function(e){return e.current})))||void 0===e?void 0:e.dateString]}),[A,s]),M=_(s,R,n),D=(0,i.useMemo)((function(){return{days:s.map((function(e,n){return(0,o.Z)((0,r.Z)({},e),{info:M[n]})})),readingDaysMap:A}}),[s,M,A]);return{isLoading:k,error:b,weekData:D,streak:R,goal:T,activityDays:P,currentActivityDay:G}}},40235:function(e,n,t){"use strict";t.r(n),t.d(n,{__N_SSG:function(){return Pe},default:function(){return Te}});var a,r=t(57611),o=t(67597),i=t(37014),s=t.n(i),l=t(15129),c=t(61395),u=t(86719),d=t.n(u),p=t(96771),g=t.n(p),m=t(98038),v=t(21648),f=t(1997),y=t(57044),_=t(69976),h=t(51726),x=t(99968),C=t(16946),E=t(30098);function j(){return j=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var a in t)({}).hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},j.apply(null,arguments)}var N,Z,w=function(e){return o.createElement("svg",j({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"w-6 h-6"},e),a||(a=o.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 0 1 2.25-2.25h13.5A2.25 2.25 0 0 1 21 7.5v11.25m-18 0A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75m-18 0v-7.5A2.25 2.25 0 0 1 5.25 9h13.5A2.25 2.25 0 0 1 21 11.25v7.5"})))},b=t(9785);function k(){return k=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var a in t)({}).hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},k.apply(null,arguments)}var S,P,T=function(e){return o.createElement("svg",k({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"w-6 h-6"},e),N||(N=o.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.324.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 0 1 1.37.49l1.296 2.247a1.125 1.125 0 0 1-.26 1.431l-1.003.827c-.293.24-.438.613-.431.992a6.759 6.759 0 0 1 0 .255c-.007.378.138.75.43.99l1.005.828c.424.35.534.954.26 1.43l-1.298 2.247a1.125 1.125 0 0 1-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.57 6.57 0 0 1-.22.128c-.331.183-.581.495-.644.869l-.213 1.28c-.09.543-.56.941-1.11.941h-2.594c-.55 0-1.02-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 0 1-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 0 1-1.369-.49l-1.297-2.247a1.125 1.125 0 0 1 .26-1.431l1.004-.827c.292-.24.437-.613.43-.992a6.932 6.932 0 0 1 0-.255c.007-.378-.138-.75-.43-.99l-1.004-.828a1.125 1.125 0 0 1-.26-1.43l1.297-2.247a1.125 1.125 0 0 1 1.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.087.22-.128.332-.183.582-.495.644-.869l.214-1.281z"})),Z||(Z=o.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0z"})))},R=t(47898),A=function(e,n){switch(n.type){case"SET_PERIOD":return(0,C.Z)((0,y.Z)({},e),{duration:n.payload.period===R.r_.Continuous?30:null,period:n.payload.period});case"SET_TYPE":return(0,C.Z)((0,y.Z)({},e),{type:n.payload.type});case"SET_PAGES":return(0,C.Z)((0,y.Z)({},e),{pages:n.payload.pages});case"SET_SECONDS":return(0,C.Z)((0,y.Z)({},e),{seconds:n.payload.seconds});case"SET_DURATION":return(0,C.Z)((0,y.Z)({},e),{duration:n.payload.duration,period:n.payload.duration?R.r_.Continuous:R.r_.Daily});case"SET_RANGE":return(0,C.Z)((0,y.Z)({},e),{rangeStartVerse:n.payload.startVerse,rangeEndVerse:n.payload.endVerse});case"SET_EXAMPLE":var t=G[n.payload.exampleKey],a={};return"values"in t&&(a=(0,y.Z)({},t.values)),(0,y.Z)((0,C.Z)((0,y.Z)({},e),{exampleKey:n.payload.exampleKey}),a);default:return e}},G={"10_mins":{i18nKey:"time",icon:b.Z,recommended:!0,values:{type:R.lC.TIME,seconds:600,period:R.r_.Daily}},khatm:{i18nKey:"khatm",icon:E.Z,values:{type:R.lC.RANGE,rangeStartVerse:"1:1",rangeEndVerse:"114:6",duration:30,period:R.r_.Continuous}},yearly:{i18nKey:"year",icon:w,values:{type:R.lC.RANGE,rangeStartVerse:"1:1",rangeEndVerse:"114:6",duration:365,period:R.r_.Continuous}},custom:{i18nKey:"custom",icon:T}},M={period:R.r_.Daily,type:R.lC.PAGES,exampleKey:null,pages:1,seconds:60,duration:null,rangeStartVerse:"1:1",rangeEndVerse:"114:6"},D=function(){var e=(0,o.useReducer)(A,M);return[e[0],e[1]]},V=t(27061),L=t.n(V),O=t(45361),I=t(17453),z=t.n(I),K=t(13533),U=function(e){var n=e.option,t=e.description,a=e.selected,o=e.recommended,i=e.icon,l=void 0===i?K.Z:i,u=e.onSelect,d=(0,c.Z)("reading-goal").t;return(0,r.jsxs)("button",{type:"button",onClick:u,className:s()(z().button,a&&z().selected),children:[(0,r.jsx)(l,{className:z().icon}),o&&(0,r.jsx)("span",{className:z().recommended,children:d("recommended")}),(0,r.jsxs)("div",{className:z().textContainer,children:[(0,r.jsx)("p",{className:z().title,children:n}),t&&(0,r.jsx)("p",{className:z().description,children:t})]})]})},Q=function(e){var n=e.state,t=e.dispatch,a=e.nav,o=e.logClick,i=(0,c.Z)("reading-goal").t;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:L().titleContainer,children:[(0,r.jsx)("h1",{className:L().title,children:i("examples-title")}),(0,r.jsx)("p",{className:L().subtitle,children:i("examples-subtitle")})]}),(0,r.jsxs)("div",{className:L().optionsContainer,children:[Object.keys(G).map((function(e){var a=G[e];return(0,r.jsx)(U,{icon:a.icon,onSelect:function(){t({type:"SET_EXAMPLE",payload:{exampleKey:e}}),o(e)},selected:n.exampleKey===e,option:i("examples.".concat(a.i18nKey,".title")),recommended:"recommended"in a&&a.recommended,description:i("examples.".concat(a.i18nKey,".description"))},a.i18nKey)})),a]})]})},B=t(67418),F=t(38429),W=t(83216),H=function(e){var n=e.state,t=e.dispatch,a=e.nav,i=e.logChange,s=(0,c.Z)("reading-goal"),l=s.t,u=s.lang,d=n.type,p=n.period,g=n.pages,m=n.seconds,v=n.rangeStartVerse,f=n.rangeEndVerse,y=n.duration,_=(0,o.useMemo)((function(){return(0,W.zQ)(l,u)}),[l,u]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:L().titleContainer,children:[(0,r.jsx)("h1",{className:L().title,children:l("goal-target.title")}),(0,r.jsx)("p",{className:L().subtitle,children:l("goal-target.description")})]}),(0,r.jsxs)("div",{className:L().optionsContainer,children:[(0,r.jsx)(B.Z,{type:d,pages:g,seconds:m,rangeStartVerse:v,rangeEndVerse:f,onRangeChange:function(e){t({type:"SET_RANGE",payload:e})},onPagesChange:function(e){t({type:"SET_PAGES",payload:{pages:e}})},onSecondsChange:function(e){t({type:"SET_SECONDS",payload:{seconds:e}})},logChange:i}),p===R.r_.Continuous&&(0,r.jsxs)("div",{className:L().inputContainer,children:[(0,r.jsx)("label",{htmlFor:"duration",className:L().label,children:l("duration")}),(0,r.jsx)(F.Z,{id:"duration",name:"duration",size:F.h.Large,className:L().input,options:_,value:y.toString(),onChange:function(e){var n=Number(e);i("duration",{currentValue:y,newValue:n}),t({type:"SET_DURATION",payload:{duration:n}})}})]}),a]})]})},$=t(5754),Y=[{key:R.r_.Daily,icon:$.Z},{key:R.r_.Continuous,icon:w}],q=function(e){var n=e.state,t=e.dispatch,a=e.nav,o=e.logClick,i=(0,c.Z)("reading-goal").t;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:L().titleContainer,children:[(0,r.jsx)("h1",{className:L().title,children:i("frequency-tab.title")}),(0,r.jsx)("p",{className:L().subtitle,children:i("frequency-tab.description")})]}),(0,r.jsxs)("div",{className:L().optionsContainer,children:[Y.map((function(e){return(0,r.jsx)(U,{icon:e.icon,onSelect:function(){t({type:"SET_PERIOD",payload:{period:e.key}}),o(e.key)},selected:n.period===e.key,option:i("".concat(e.key.toLowerCase(),".title")),description:i("".concat(e.key.toLowerCase(),".description"))},e.key)})),a]})]})},X=[{type:R.lC.TIME,key:"time",icon:b.Z},{type:R.lC.PAGES,key:"pages",icon:E.Z},{type:R.lC.RANGE,key:"range",icon:T}],J=function(e){var n=e.state,t=e.dispatch,a=e.nav,o=e.logClick,i=(0,c.Z)("reading-goal").t;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:L().titleContainer,children:[(0,r.jsx)("h1",{className:L().title,children:i("goal-type.title")}),(0,r.jsx)("p",{className:L().subtitle,children:i("goal-type.description")})]}),(0,r.jsxs)("div",{className:L().optionsContainer,children:[X.map((function(e){return(0,r.jsx)(U,{onSelect:function(){t({type:"SET_TYPE",payload:{type:e.type}}),o(e.key)},selected:n.type===e.type,option:i("goal-types.".concat(e.key,".title")),description:i("goal-types.".concat(e.key,".description")),icon:e.icon},e.key)})),a]})]})},ee=t(648),ne=t(73756),te=t(10117),ae=function(e){var n=e.numberOfDays,t=Array.from({length:Math.min(n,7)}).map((function(e,n){return(0,r.jsx)("li",{className:L().dayPreview,children:(0,r.jsx)(te.Z,{})},n)}));return(0,r.jsx)(r.Fragment,{children:t})},re=t(9192),oe=t(92111),ie=t(5330),se=t(15721),le=t(9740),ce=t(37572),ue=t(22582),de=t(85149),pe=t(43609),ge=t(95932),me=t(78056),ve=function(e){var n=e.state,t=e.nav,a=(0,c.Z)("reading-goal"),i=a.t,l=a.lang,u=(0,o.useContext)(re.Z),d=(0,ee.v9)(ie.Ho,ee.wU),p=(0,ee.v9)(ie.z$,ee.wU),g=(0,se.$P)(d,p).mushaf,m=function(e,n){var t,a={mushafId:n,type:e.type,amount:(t={},(0,O.Z)(t,R.lC.PAGES,e.pages),(0,O.Z)(t,R.lC.TIME,e.seconds),(0,O.Z)(t,R.lC.RANGE,"".concat(e.rangeStartVerse,"-").concat(e.rangeEndVerse)),t)[e.type]};return e.period===R.r_.Continuous&&(a.duration=e.duration),a}(n,g),v=function(e,t){var a=n.type,o=e.week[t];if(a===R.lC.RANGE){var s=o.amount,c=(0,_.Z)((0,me.p)(s),2),d=c[0],p=d.chapter,g=d.verse,m=c[1],v=m.chapter,f=m.verse,y=(0,ue.dy)(u,p).transliteratedName,h=(0,ue.dy)(u,v).transliteratedName;return(0,r.jsxs)("div",{className:L().rangePreview,children:[(0,r.jsxs)("p",{children:[i("reciter:read")," ",y," ",(0,pe.rQ)(Number(g),l)]}),(0,r.jsxs)("p",{children:[i("common:to").toLowerCase()," ",h," ",(0,pe.rQ)(Number(f),l)]})]})}var x=o.amount;if(a===R.lC.TIME)return"".concat(i("reciter:read")," ").concat((0,de.by)(x,i,l));var C=(0,ge.uZ)(x,2);return"".concat(i("reciter:read")," ").concat(i("x-pages",{count:C,pages:(0,pe.rQ)(C,l)}))};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:L().titleContainer,children:[(0,r.jsx)("h1",{className:L().title,children:i("preview-schedule.title")}),(0,r.jsx)("p",{className:L().subtitle,children:i("preview-schedule.description")})]}),(0,r.jsxs)("ol",{className:s()(L().optionsContainer,L().previewWrapper),children:[(0,r.jsx)(ne.Z,{queryKey:(0,ce.I0)(m),fetcher:le.UK,loading:function(){return(0,r.jsx)(ae,{numberOfDays:n.period===R.r_.Continuous?n.duration:7})},render:function(e){var t=e.data;return(0,r.jsx)(r.Fragment,{children:t.week.map((function(e,a){var o=new Date(e.date),c=n.duration>6&&n.period===R.r_.Continuous&&a>5;return(0,r.jsx)("li",{className:s()(L().dayPreview,c&&L().lastDay),children:c?(0,r.jsx)("h3",{children:i("plus-x-more-days",{count:n.duration-6,days:(0,pe.rQ)(n.duration-6,l)})}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(oe.default,{content:(0,de.ZC)(o,l),children:(0,r.jsx)("h3",{children:(0,de.Zu)(o,l)})}),(0,r.jsx)("p",{children:v(t,a)})]})},e.date)}))})}}),t]})]})},fe=t(12195);!function(e){e.ExamplesTab="examples",e.ContinuityTab="continuity",e.TypeTab="type",e.AmountTab="amount",e.PreviewTab="preview"}(S||(S={}));var ye=(P={},(0,O.Z)(P,S.ExamplesTab,Q),(0,O.Z)(P,S.ContinuityTab,q),(0,O.Z)(P,S.TypeTab,J),(0,O.Z)(P,S.AmountTab,H),(0,O.Z)(P,S.PreviewTab,ve),P),_e=Object.keys(ye).map((function(e){return{key:e,Component:ye[e]}})),he=function(e,n,t){(0,fe.MY)("create_goal_".concat(e,"_tab_").concat(n),t)},xe=t(23998),Ce=t(85494),Ee=t(66498),je=t(85609),Ne=t(75038),Ze=t(89932),we=t(4845),be=function(){var e=(0,c.Z)("reading-goal").t,n=(0,l.useRouter)(),t=(0,o.useContext)(re.Z),a=(0,Ne.Z)(),i=(0,o.useState)(!1),u=i[0],p=i[1],g=(0,o.useState)(0),m=g[0],v=g[1],C=(0,_.Z)(D(),2),E=C[0],j=C[1],N=(0,je.useToast)(),Z=(0,x.kY)().cache,w=(0,o.useCallback)(function(){var e=(0,f.Z)((function(e){return(0,h.__generator)(this,(function(n){switch(n.label){case 0:return[4,(0,le.Ec)(e).then((function(){Z.delete((0,ce.G_)())}))];case 1:return n.sent(),[2]}}))}));return function(n){return e.apply(this,arguments)}}(),[Z]),b=_e[m],k=function(){var t=(0,f.Z)((function(){var t,r;return(0,h.__generator)(this,(function(o){switch(o.label){case 0:t=E.type===R.lC.PAGES?E.pages:E.type===R.lC.TIME?E.seconds:"".concat(E.rangeStartVerse,"-").concat(E.rangeEndVerse),r={mushafId:a,type:E.type,amount:t,category:R.c9.QURAN},E.period===R.r_.Continuous&&(r.duration=E.duration),(0,fe.dz)("create_goal",(0,y.Z)({duration:null},r)),p(!0),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,w(r)];case 2:return o.sent(),N(e("set-reading-goal-success"),{status:je.ToastStatus.Success}),n.push("/"),[3,4];case 3:return o.sent(),N(e("common:error.general"),{status:je.ToastStatus.Error}),[3,4];case 4:return p(!1),[2]}}))}));return function(){return t.apply(this,arguments)}}(),P=b.key===S.PreviewTab,T=P?100:m/_e.length*100;return(0,r.jsxs)("div",{className:s()(d().flowItem),children:[(0,r.jsx)(Ee.Z,{value:T}),(0,r.jsx)("div",{className:L().tabContainer,children:u?(0,r.jsx)(te.Z,{isCentered:!0,size:te.E.Large}):(0,r.jsx)(b.Component,{onTabChange:v,state:E,dispatch:j,logClick:function(e){he(b.key,e)},logChange:function(e,n,t){!function(e,n,t,a){(0,fe.Q8)("create_goal_".concat(e,"_tab_").concat(n),t.currentValue,t.newValue,a)}(b.key,e,n,t)},nav:(0,r.jsxs)("div",{className:L().navigationContainer,children:[m>0&&(0,r.jsx)(Ce.ZP,{className:L().navigateButton,size:Ce.qE.Large,prefix:(0,r.jsx)(Ze.Z,{}),onClick:function(){0!==m&&"custom"!==E.exampleKey?(v(0),he(b.key,"previous")):(v((function(e){return e-1})),he(b.key,"previous"))},type:Ce.L$.Secondary,children:e("common:prev")}),(0,r.jsx)(Ce.ZP,{className:L().navigateButton,size:Ce.qE.Large,suffix:P?void 0:(0,r.jsx)(we.Z,{}),isDisabled:b.key===S.ExamplesTab&&!E.exampleKey||b.key===S.AmountTab&&!(0,xe.w)(t,{type:E.type,pages:E.pages,seconds:E.seconds,range:{startVerse:E.rangeStartVerse,endVerse:E.rangeEndVerse}},a),onClick:function(){P?k():(0===m&&"custom"!==E.exampleKey?v(_e.length-1):v((function(e){return e+1})),function(e,n){var t;e===S.ExamplesTab?t={example:n.exampleKey}:e===S.TypeTab?t={goal_type:n.type}:e===S.AmountTab?t={pages:n.type===R.lC.PAGES?n.pages:null,seconds:n.type===R.lC.TIME?n.seconds:null,range:n.type===R.lC.RANGE?"".concat(n.rangeStartVerse,"-").concat(n.rangeEndVerse):null,duration:n.period===R.r_.Continuous?n.duration:null}:e===S.ContinuityTab&&(t={goal_period:n.period}),he(e,"next",t)}(b.key,E))},children:e(P?"start-journey":"common:next")})]})})})]})},ke=t(83548),Se=t(84020),Pe=!0,Te=(0,m.Z)((function(){var e=(0,c.Z)("reading-goal"),n=e.t,t=e.lang,a=(0,l.useRouter)(),i=(0,ke.Z)(),u=i.goal,p=i.isLoading||!a.isReady||!!u;return(0,o.useEffect)((function(){u&&a.push("/")}),[a,u]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(v.Z,{title:n("reading-goal"),url:(0,Se.Z2)(t,(0,Se.we)()),languageAlternates:(0,pe.qc)((0,Se.we)()),nofollow:!0,noindex:!0}),(0,r.jsx)("div",{className:d().pageContainer,children:(0,r.jsx)("div",{className:s()(d().flow,p&&g().loadingContainer),children:p?(0,r.jsx)(te.Z,{}):(0,r.jsx)(be,{})})})]})}))},36685:function(e,n,t){"use strict";var a,r,o;t.d(n,{EQ:function(){return r},JF:function(){return o},Nk:function(){return a}}),function(e){e.From="from",e.To="to"}(a||(a={})),function(e){e.Start="start",e.End="end"}(r||(r={})),function(e){e.StartingChapter="starting-chapter",e.StartingVerse="starting-verse",e.EndingChapter="ending-chapter",e.EndingVerse="ending-verse"}(o||(o={}))},47898:function(e,n,t){"use strict";var a,r,o;t.d(n,{c9:function(){return a},lC:function(){return r},r_:function(){return o}}),function(e){e.QURAN="QURAN"}(a||(a={})),function(e){e.TIME="QURAN_TIME",e.PAGES="QURAN_PAGES",e.RANGE="QURAN_RANGE"}(r||(r={})),function(e){e.Daily="DAILY",e.Continuous="CONTINUOUS"}(o||(o={}))},17453:function(e){e.exports={icon:"OptionButton_icon__w5iJa",button:"OptionButton_button__koa5L",textContainer:"OptionButton_textContainer__KGc0j",title:"OptionButton_title__fLEFm",description:"OptionButton_description__paNw7",selected:"OptionButton_selected__9vy3U",recommended:"OptionButton_recommended__sDzVm"}},27061:function(e){e.exports={tabContainer:"ReadingGoalPage_tabContainer__mzLNd",optionsContainer:"ReadingGoalPage_optionsContainer__3v9HQ",titleContainer:"ReadingGoalPage_titleContainer__A2zup",title:"ReadingGoalPage_title__s7pGO",subtitle:"ReadingGoalPage_subtitle__ljYxq",navigationContainer:"ReadingGoalPage_navigationContainer__0nY0E",previewWrapper:"ReadingGoalPage_previewWrapper__sykGt",dayPreview:"ReadingGoalPage_dayPreview__M4mrU",lastDay:"ReadingGoalPage_lastDay__ieeGh",rangePreview:"ReadingGoalPage_rangePreview__xB27p",rangeInputContainer:"ReadingGoalPage_rangeInputContainer__SkyH9",inputContainer:"ReadingGoalPage_inputContainer__RmukP",input:"ReadingGoalPage_input__T_M3H",label:"ReadingGoalPage_label__04sb1"}},75302:function(e){e.exports={progressRoot:"Progress_progressRoot__Np4He",progressSmall:"Progress_progressSmall__xl_va",progressMedium:"Progress_progressMedium__ys5Rw",progressLarge:"Progress_progressLarge__smmtV",progressIndicator:"Progress_progressIndicator__dPgS9"}},86719:function(e){e.exports={pageContainer:"index_pageContainer__Pxtn3",loadingContainer:"index_loadingContainer__WEZFc",flow:"index_flow__rCTR5",flowItem:"index_flowItem__GnXWz",additionalVerticalGap:"index_additionalVerticalGap__nzYz6",fullWidth:"index_fullWidth__1n4ux"}},96771:function(e){e.exports={loadingContainer:"reading-goal_loadingContainer__5MEZB"}}},function(e){e.O(0,[87373,13769,70303,49774,92888,40179],(function(){return n=21515,e(e.s=n);var n}));var n=e.O();_N_E=n}]);
- //# sourceMappingURL=reading-goal-6020e7d4ae50e444.js.map
|