(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[78227],{15273:function(e,n,t){"use strict";var r,o=t(67597);function i(){return i=Object.assign?Object.assign.bind():function(e){for(var n=1;n(.*?)<\/\1>|<(\w+)\/>/,a=/(?:\r\n|\r|\n)/g;function c(e){if(!e.length)return[];var n=e.slice(0,4),t=n[0],r=n[1],o=n[2];return[[t||o,r||"",n[3]]].concat(c(e.slice(4,e.length)))}function l(e,n){void 0===n&&(n=[]);var t=e.replace(a,"").split(i);if(1===t.length)return e;var o=[],s=t.shift();return s&&o.push(s),c(t).forEach((function(e,t){var i=e[0],a=e[1],c=e[2],s=n[i]||r.createElement(r.Fragment,null);o.push((0,r.cloneElement)(s,{key:t},a?l(a,n):s.props.children)),c&&o.push(c)})),o}function s(e){var n=e.i18nKey,t=e.values,i=e.components,a=e.fallback,c=e.defaultTrans,s=e.ns,u=(0,o.Z)(s),d=u.t,v=u.lang;return(0,r.useMemo)((function(){var e=d(n,t,{fallback:a,default:c});return i&&0!==i.length?l(e,i):e}),[n,t,i,v])}},36279:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return it}});var r=t(57611),o=t(67597),i=t(21594),a=t(47189),c=t(12195),l=t(82427),s=function(e){var n=e.togglePlaying,t=e.isAudioPlayerHidden,i=(0,o.useContext)(l.c),s=(0,o.useCallback)((function(e){(0,c.Kz)("audio_player_toggle_keyboard_shortcut"),e.preventDefault(),n()}),[n]),u={enabled:!t};return(0,a.y1)("space",s,u,[n]),(0,a.y1)("right",(function(e){(0,c.Kz)("audio_player_fwd_keyboard_shortcut"),e.preventDefault(),i.send({type:"NEXT_AYAH"})}),u),(0,a.y1)("left",(function(e){(0,c.Kz)("audio_player_bwd_keyboard_shortcut"),e.preventDefault(),i.send({type:"PREV_AYAH"})}),u),(0,r.jsx)(r.Fragment,{})},u=t(69976),d=t(15129),v=t(77012),f=t.n(v),p=t(45361),h=t(57044),m=t(16946),x=t(57384);function _(e,[n,t]){return Math.min(t,Math.max(n,e))}var g=t(90149),y=t(71641),w=t(61544),E=t(82305),b=t(4460),j=t(10810),C=t(81319),Z=t(4300),S=t(67016);const k=["PageUp","PageDown"],R=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],P={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},I="Slider",[O,A,M]=(0,S.B)(I),[L,T]=(0,w.b)(I,[M]),[N,D]=L(I),B=(0,o.forwardRef)(((e,n)=>{const{name:t,min:r=0,max:i=100,step:a=1,orientation:c="horizontal",disabled:l=!1,minStepsBetweenThumbs:s=0,defaultValue:u=[r],value:d,onValueChange:v=(()=>{}),onValueCommit:f=(()=>{}),inverted:p=!1,...h}=e,[m,w]=(0,o.useState)(null),b=(0,y.e)(n,(e=>w(e))),j=(0,o.useRef)(new Set),C=(0,o.useRef)(0),Z="horizontal"===c,S=!m||Boolean(m.closest("form")),P=Z?H:W,[I=[],A]=(0,E.T)({prop:d,defaultProp:u,onChange:e=>{var n;null===(n=[...j.current][C.current])||void 0===n||n.focus(),v(e)}}),M=(0,o.useRef)(I);function L(e,n,{commit:t}={commit:!1}){const o=function(e){return(String(e).split(".")[1]||"").length}(a),c=function(e,n){const t=Math.pow(10,n);return Math.round(e*t)/t}(Math.round((e-r)/a)*a+r,o),l=_(c,[r,i]);A(((e=[])=>{const r=function(e=[],n,t){const r=[...e];return r[t]=n,r.sort(((e,n)=>e-n))}(e,l,n);if(function(e,n){if(n>0){const t=function(e){return e.slice(0,-1).map(((n,t)=>e[t+1]-n))}(e);return Math.min(...t)>=n}return!0}(r,s*a)){C.current=r.indexOf(l);const n=String(r)!==String(e);return n&&t&&f(r),n?r:e}return e}))}return(0,o.createElement)(N,{scope:e.__scopeSlider,disabled:l,min:r,max:i,valueIndexToChangeRef:C,thumbs:j.current,values:I,orientation:c},(0,o.createElement)(O.Provider,{scope:e.__scopeSlider},(0,o.createElement)(O.Slot,{scope:e.__scopeSlider},(0,o.createElement)(P,(0,x.Z)({"aria-disabled":l,"data-disabled":l?"":void 0},h,{ref:b,onPointerDown:(0,g.M)(h.onPointerDown,(()=>{l||(M.current=I)})),min:r,max:i,inverted:p,onSlideStart:l?void 0:function(e){const n=function(e,n){if(1===e.length)return 0;const t=e.map((e=>Math.abs(e-n))),r=Math.min(...t);return t.indexOf(r)}(I,e);L(e,n)},onSlideMove:l?void 0:function(e){L(e,C.current)},onSlideEnd:l?void 0:function(){const e=M.current[C.current];I[C.current]!==e&&f(I)},onHomeKeyDown:()=>!l&&L(r,0,{commit:!0}),onEndKeyDown:()=>!l&&L(i,I.length-1,{commit:!0}),onStepKeyDown:({event:e,direction:n})=>{if(!l){const t=k.includes(e.key)||e.shiftKey&&R.includes(e.key)?10:1,r=C.current;L(I[r]+a*t*n,r,{commit:!0})}}})))),S&&I.map(((e,n)=>(0,o.createElement)($,{key:n,name:t?t+(I.length>1?"[]":""):void 0,value:e}))))})),[V,G]=L(I,{startEdge:"left",endEdge:"right",size:"width",direction:1}),H=(0,o.forwardRef)(((e,n)=>{const{min:t,max:r,dir:i,inverted:a,onSlideStart:c,onSlideMove:l,onSlideEnd:s,onStepKeyDown:u,...d}=e,[v,f]=(0,o.useState)(null),p=(0,y.e)(n,(e=>f(e))),h=(0,o.useRef)(),m=(0,b.gm)(i),_="ltr"===m,g=_&&!a||!_&&a;function w(e){const n=h.current||v.getBoundingClientRect(),o=ee([0,n.width],g?[t,r]:[r,t]);return h.current=n,o(e-n.left)}return(0,o.createElement)(V,{scope:e.__scopeSlider,startEdge:g?"left":"right",endEdge:g?"right":"left",direction:g?1:-1,size:"width"},(0,o.createElement)(F,(0,x.Z)({dir:m,"data-orientation":"horizontal"},d,{ref:p,style:{...d.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:e=>{const n=w(e.clientX);null===c||void 0===c||c(n)},onSlideMove:e=>{const n=w(e.clientX);null===l||void 0===l||l(n)},onSlideEnd:()=>{h.current=void 0,null===s||void 0===s||s()},onStepKeyDown:e=>{const n=P[g?"from-left":"from-right"].includes(e.key);null===u||void 0===u||u({event:e,direction:n?-1:1})}})))})),W=(0,o.forwardRef)(((e,n)=>{const{min:t,max:r,inverted:i,onSlideStart:a,onSlideMove:c,onSlideEnd:l,onStepKeyDown:s,...u}=e,d=(0,o.useRef)(null),v=(0,y.e)(n,d),f=(0,o.useRef)(),p=!i;function h(e){const n=f.current||d.current.getBoundingClientRect(),o=ee([0,n.height],p?[r,t]:[t,r]);return f.current=n,o(e-n.top)}return(0,o.createElement)(V,{scope:e.__scopeSlider,startEdge:p?"bottom":"top",endEdge:p?"top":"bottom",size:"height",direction:p?1:-1},(0,o.createElement)(F,(0,x.Z)({"data-orientation":"vertical"},u,{ref:v,style:{...u.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:e=>{const n=h(e.clientY);null===a||void 0===a||a(n)},onSlideMove:e=>{const n=h(e.clientY);null===c||void 0===c||c(n)},onSlideEnd:()=>{f.current=void 0,null===l||void 0===l||l()},onStepKeyDown:e=>{const n=P[p?"from-bottom":"from-top"].includes(e.key);null===s||void 0===s||s({event:e,direction:n?-1:1})}})))})),F=(0,o.forwardRef)(((e,n)=>{const{__scopeSlider:t,onSlideStart:r,onSlideMove:i,onSlideEnd:a,onHomeKeyDown:c,onEndKeyDown:l,onStepKeyDown:s,...u}=e,d=D(I,t);return(0,o.createElement)(Z.WV.span,(0,x.Z)({},u,{ref:n,onKeyDown:(0,g.M)(e.onKeyDown,(e=>{"Home"===e.key?(c(e),e.preventDefault()):"End"===e.key?(l(e),e.preventDefault()):k.concat(R).includes(e.key)&&(s(e),e.preventDefault())})),onPointerDown:(0,g.M)(e.onPointerDown,(e=>{const n=e.target;n.setPointerCapture(e.pointerId),e.preventDefault(),d.thumbs.has(n)?n.focus():r(e)})),onPointerMove:(0,g.M)(e.onPointerMove,(e=>{e.target.hasPointerCapture(e.pointerId)&&i(e)})),onPointerUp:(0,g.M)(e.onPointerUp,(e=>{const n=e.target;n.hasPointerCapture(e.pointerId)&&(n.releasePointerCapture(e.pointerId),a(e))}))}))})),K="SliderTrack",U=(0,o.forwardRef)(((e,n)=>{const{__scopeSlider:t,...r}=e,i=D(K,t);return(0,o.createElement)(Z.WV.span,(0,x.Z)({"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation},r,{ref:n}))})),z="SliderRange",Y=(0,o.forwardRef)(((e,n)=>{const{__scopeSlider:t,...r}=e,i=D(z,t),a=G(z,t),c=(0,o.useRef)(null),l=(0,y.e)(n,c),s=i.values.length,u=i.values.map((e=>J(e,i.min,i.max))),d=s>1?Math.min(...u):0,v=100-Math.max(...u);return(0,o.createElement)(Z.WV.span,(0,x.Z)({"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0},r,{ref:l,style:{...e.style,[a.startEdge]:d+"%",[a.endEdge]:v+"%"}}))})),X="SliderThumb",q=(0,o.forwardRef)(((e,n)=>{const t=A(e.__scopeSlider),[r,i]=(0,o.useState)(null),a=(0,y.e)(n,(e=>i(e))),c=(0,o.useMemo)((()=>r?t().findIndex((e=>e.ref.current===r)):-1),[t,r]);return(0,o.createElement)(Q,(0,x.Z)({},e,{ref:a,index:c}))})),Q=(0,o.forwardRef)(((e,n)=>{const{__scopeSlider:t,index:r,...i}=e,a=D(X,t),c=G(X,t),[l,s]=(0,o.useState)(null),u=(0,y.e)(n,(e=>s(e))),d=(0,C.t)(l),v=a.values[r],f=void 0===v?0:J(v,a.min,a.max),p=function(e,n){return n>2?`Value ${e+1} of ${n}`:2===n?["Minimum","Maximum"][e]:void 0}(r,a.values.length),h=null===d||void 0===d?void 0:d[c.size],m=h?function(e,n,t){const r=e/2,o=ee([0,50],[0,r]);return(r-o(n)*t)*t}(h,f,c.direction):0;return(0,o.useEffect)((()=>{if(l)return a.thumbs.add(l),()=>{a.thumbs.delete(l)}}),[l,a.thumbs]),(0,o.createElement)("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[c.startEdge]:`calc(${f}% + ${m}px)`}},(0,o.createElement)(O.ItemSlot,{scope:e.__scopeSlider},(0,o.createElement)(Z.WV.span,(0,x.Z)({role:"slider","aria-label":e["aria-label"]||p,"aria-valuemin":a.min,"aria-valuenow":v,"aria-valuemax":a.max,"aria-orientation":a.orientation,"data-orientation":a.orientation,"data-disabled":a.disabled?"":void 0,tabIndex:a.disabled?void 0:0},i,{ref:u,style:void 0===v?{display:"none"}:e.style,onFocus:(0,g.M)(e.onFocus,(()=>{a.valueIndexToChangeRef.current=r}))}))))})),$=e=>{const{value:n,...t}=e,r=(0,o.useRef)(null),i=(0,j.D)(n);return(0,o.useEffect)((()=>{const e=r.current,t=window.HTMLInputElement.prototype,o=Object.getOwnPropertyDescriptor(t,"value").set;if(i!==n&&o){const t=new Event("input",{bubbles:!0});o.call(e,n),e.dispatchEvent(t)}}),[i,n]),(0,o.createElement)("input",(0,x.Z)({style:{display:"none"}},t,{ref:r,defaultValue:n}))};function J(e,n,t){return _(100/(t-n)*(e-n),[0,100])}function ee(e,n){return t=>{if(e[0]===e[1]||n[0]===n[1])return n[0];const r=(n[1]-n[0])/(e[1]-e[0]);return n[0]+r*(t-e[0])}}const ne=U,te=Y,re=q;var oe,ie,ae,ce=t(37014),le=t.n(ce),se=t(48998),ue=t.n(se);!function(e){e.Horizontal="horizontal",e.Vertical="vertical"}(oe||(oe={})),function(e){e.ltr="ltr",e.rtl="rtl"}(ie||(ie={})),function(e){e.Primary="primary",e.Secondary="secondary"}(ae||(ae={}));var de,ve=function(e){var n,t=e.label,o=e.name,i=e.onValueChange,a=e.min,c=void 0===a?0:a,l=e.max,s=void 0===l?100:l,d=e.step,v=void 0===d?1:d,f=e.minStepsBetweenThumbs,x=void 0===f?0:f,_=e.direction,g=void 0===_?ie.ltr:_,y=e.orientation,w=void 0===y?oe.Horizontal:y,E=e.disabled,b=void 0!==E&&E,j=e.defaultValue,C=e.value,Z=e.showThumbs,S=void 0===Z||Z,k=e.variant,R=void 0===k?ae.Primary:k,P=e.withBackground,I=void 0!==P&&P,O=C||j;return(0,r.jsxs)(B,(0,m.Z)((0,h.Z)({className:ue().slider,min:c,max:s,step:v,minStepsBetweenThumbs:x,dir:g,orientation:w,disabled:b,"aria-label":t},j&&{defaultValue:j},C&&{value:C},i&&{onValueChange:i},o&&{name:o}),{children:[(0,r.jsx)(ne,{className:le()(ue().track,I&&ue().trackBackground),children:(0,r.jsx)(te,{className:le()(ue().range,(n={},(0,p.Z)(n,ue().primary,R===ae.Primary),(0,p.Z)(n,ue().secondary,R===ae.Secondary),n))})}),S&&O.map((function(){for(var e=arguments.length,n=new Array(e),t=0;t1?" \u2022 ":"")]},e)}))]}):(0,r.jsx)(r.Fragment,{})},Je=t(46581),en=function(e){var n=e.showTooltipFor,t=(0,Ye.v9)(Je.XQ);return(0,r.jsxs)(r.Fragment,{children:[t&&(0,r.jsx)($e,{showTooltipFor:n}),(0,r.jsx)("div",{className:qe().helpText,children:(0,r.jsx)(Qe.Z,{i18nKey:"".concat(t?"common:audio.exp-tip":"common:audio.exp-tip-no-select"),components:{span:(0,r.jsx)("span",{},0),br:(0,r.jsx)("br",{},1),boldSpan:(0,r.jsx)("span",{className:qe().bold},2)}})})]})},nn=t(41418),tn=t(81787),rn=t(89932),on=t(33294),an=t(70356),cn=function(e){var n=e.onBack,t=(0,xe.Z)("common").t,o=(0,tn.Z)(),i=o.isLoading,a=o.actions.onSettingsChange,l=(0,Ye.v9)(on.eU),s=l.enableAutoScrolling,u=l.showTooltipWhenPlayingAudio,d=(0,Ye.v9)(Je.SV),v=function(e,n,t){a(e,n,t(n),t(l[e]),an.Z.AUDIO)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Re.Z.Item,{shouldFlipOnRTL:!0,icon:(0,r.jsx)(rn.Z,{}),onClick:n,children:t("audio.experience")}),(0,r.jsx)(Re.Z.Divider,{}),i&&(0,r.jsx)(Ee.Z,{}),(0,r.jsxs)("div",{className:qe().checkboxContainer,children:[(0,r.jsx)("div",{children:(0,r.jsx)(nn.Z,{checked:s,id:"auto-scrolling",name:"auto-scrolling",label:t("audio.auto-scroll.title"),onChange:function(e){(0,c.Q8)("audio_settings_auto_scrolling_enabled",!e,e),v("enableAutoScrolling",e,on.$8)},disabled:i})}),(0,r.jsxs)("div",{children:[(0,r.jsx)(nn.Z,{checked:u,id:"show-tooltip",name:"show-tooltip",label:t("settings.show-tooltip-when-playing-audio"),onChange:function(e){(0,c.Q8)("audio_settings_show_tooltip_when_playing_audio",!e,e),v("showTooltipWhenPlayingAudio",e,on.Wf)},disabled:i||d&&0===d.length}),(0,r.jsx)("div",{className:le()(qe().experienceTipContainer,qe().helpText),children:(0,r.jsx)(en,{showTooltipFor:d})})]})]})]})},ln=t(1614),sn=[.25,.5,.75,1,1.25,1.5,1.75,2],un=function(e){var n=e.onBack,t=(0,xe.Z)("common"),a=t.t,s=t.lang,u=(0,tn.Z)(),d=u.actions.onXstateSettingsChange,v=u.isLoading,f=(0,o.useContext)(l.c),p=(0,i.v)(f,(function(e){return e.context.playbackRate})),h=(0,o.useCallback)((function(e){return 1===e?a("audio.playback-normal"):(0,He.rQ)(e,s)}),[s,a]),m=function(e){return p===e?v?(0,r.jsx)(Ee.Z,{}):(0,r.jsx)(ln.Z,{}):(0,r.jsx)("span",{})},x=sn.map((function(e){return(0,r.jsx)(Re.Z.Item,{icon:m(e),onClick:function(){(0,c.MY)("audio_player_menu_playback_item"),(0,c.Q8)("audio_playback_rate",p,e),function(e){var t=p;d("playbackRate",e,(function(){return f.send({type:"SET_PLAYBACK_SPEED",playbackRate:e})}),(function(){return f.send({type:"SET_PLAYBACK_SPEED",playbackRate:t})}),an.Z.AUDIO,n)}(e)},children:h(e)},e)}));return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Re.Z.Item,{shouldFlipOnRTL:!0,icon:(0,r.jsx)(rn.Z,{}),onClick:n,children:a("audio.playback-speed")}),(0,r.jsx)(Re.Z.Divider,{}),x]})},dn=t(84620),vn=t(50814),fn=t(11155),pn=t(5754),hn=function(){var e=(0,xe.Z)("common").t,n=(0,o.useContext)(l.c),t=(0,o.useState)(!1),a=t[0],s=t[1],u=(0,i.v)(n,(function(e){return e.context.surah})),d=(0,i.v)(n,Ce.xU),v=(0,i.v)(n,(function(e){return e.context.repeatActor})),f=!!v;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Re.Z.Item,{onClick:function(){(0,c.MY)("audio_player_repeat"),s(!0)},isDisabled:d,icon:d?(0,r.jsx)(Ee.Z,{size:Ee.E.Large}):(0,r.jsx)(Fe.Z,{shouldWrap:f,wrapper:function(e){return(0,r.jsx)(Ke.Z,{content:f&&(0,r.jsx)(We,{rangeActor:v.getSnapshot().context.rangeCycleActor}),children:e})},children:(0,r.jsx)(pn.Z,{})}),children:e("audio.player.manage-repeat-settings")}),!d&&(0,r.jsx)(vn.Z,{defaultRepetitionMode:fn.m.Range,chapterId:u.toString(),isOpen:a,onClose:function(){return s(!1)}})]})},mn=t(2787),xn=t.n(mn),_n=t(73756),gn=t(18419),yn=t(96749),wn=t(27967),En=function(e){var n=e.onBack,t=(0,xe.Z)("common"),a=t.lang,s=t.t,u=(0,o.useContext)(l.c),d=(0,i.v)(u,(function(e){return e.context.reciterId})),v=(0,tn.Z)(),f=v.actions.onXstateSettingsChange,p=v.isLoading,h=(0,gn.P)(),m=h.isActive,x=h.activeStepGroup,_=h.activeStepIndex,g=h.nextStep;(0,o.useEffect)((function(){m&&x===yn.Z.READING_EXPERIENCE&&3===_&&g()}),[m,x,_,g]);var y=(0,o.useCallback)((function(e){var t=d;f("reciter",e.id,(function(){return u.send({type:"CHANGE_RECITER",reciterId:e.id})}),(function(){return u.send({type:"CHANGE_RECITER",reciterId:t})}),an.Z.AUDIO,n)}),[u,n,f,d]),w=(0,o.useCallback)((function(e,n){return n===e?p?(0,r.jsx)(Ee.Z,{}):(0,r.jsx)(ln.Z,{}):(0,r.jsx)("span",{})}),[p]),E=(0,o.useCallback)((function(e){return(0,r.jsx)("div",{children:e.reciters.map((function(e){return(0,r.jsxs)(Re.Z.Item,{icon:w(e.id,d),onClick:function(){(0,c.MY)("audio_player_overflow_menu_reciter_item"),(0,c.Q8)("reciter",d,e.id),(0,c.u8)("reciter",e.id),y(e)},children:[e.translatedName.name,"Murattal"!==e.style.name&&(0,r.jsx)("p",{className:xn().reciterStyle,children:" - ".concat(e.style.name)})]},e.id)}))})}),[w,d,y]),b=(0,r.jsx)("div",{id:"audio-player-reciter-list",children:(0,r.jsx)(_n.Z,{queryKey:(0,wn.jL)(a),render:E})});return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Re.Z.Item,{icon:(0,r.jsx)(rn.Z,{}),onClick:n,shouldFlipOnRTL:!0,id:"audio-player-reciter-select-item",children:s("audio.select-reciter")}),(0,r.jsx)(Re.Z.Divider,{}),b]})},bn=t(51519),jn=t.n(bn),Cn=t(37362),Zn=t(4845);function Sn(){return Sn=Object.assign?Object.assign.bind():function(e){for(var n=1;n=4?11:14};!function(e){e.Main="main",e.AudioSpeed="audio-speed",e.Reciter="reciter",e.Experience="experience"}(In||(In={}));var Mn,Ln=function(){var e=(0,o.useState)(In.Main),n=e[0],t=e[1],a=(0,o.useContext)(l.c),s=(0,xe.Z)("common").t,u=(0,i.v)(a,(function(e){return e.context.playbackRate})),d=(0,gn.P)(),v=d.prevStep,f=d.nextStep;(0,o.useEffect)((function(){var e=function(){t(In.Main),v()},n=function(){t(In.Reciter),f()};return window.addEventListener(Cn.Z.STEP_BEFORE_CHOOSING_RECITER_FROM_LIST,e),window.addEventListener(Cn.Z.STEP_AFTER_RECITER_LIST_ITEM_CLICK,n),function(){window.removeEventListener(Cn.Z.STEP_BEFORE_CHOOSING_RECITER_FROM_LIST,e),window.removeEventListener(Cn.Z.STEP_AFTER_RECITER_LIST_ITEM_CLICK,n)}}),[f,v]);var h=(0,o.useMemo)((function(){var e;return e={},(0,p.Z)(e,In.Main,[(0,r.jsx)(dn.Z,{},0),(0,r.jsx)(hn,{},1),(0,r.jsx)(Re.Z.Divider,{},2),(0,r.jsx)(Re.Z.Item,{icon:(0,r.jsx)(Rn,{}),onClick:function(){(0,c.MY)("audio_player_overflow_menu_experience"),t(In.Experience)},children:(0,r.jsxs)("div",{className:jn().menuWithNestedItems,children:[s("audio.experience"),(0,r.jsx)(Zn.Z,{})]})},3),(0,r.jsx)(Re.Z.Item,{icon:(0,r.jsxs)("span",{style:{fontSize:An(u)},children:[u,s("audio.playback-speed-unit")]}),onClick:function(){(0,c.MY)("audio_player_overflow_menu_playback"),t(In.AudioSpeed)},children:(0,r.jsxs)("div",{className:jn().menuWithNestedItems,children:[s("audio.speed"),(0,r.jsx)(Zn.Z,{})]})},4),(0,r.jsx)(Re.Z.Item,{icon:(0,r.jsx)(On,{}),onClick:function(){(0,c.MY)("audio_player_overflow_menu_reciter"),t(In.Reciter)},id:"audio-player-overflow-menu-reciter",children:(0,r.jsxs)("div",{className:jn().menuWithNestedItems,children:[s("reciter"),(0,r.jsx)(Zn.Z,{})]})},5)]),(0,p.Z)(e,In.AudioSpeed,(0,r.jsx)(un,{onBack:function(){return t(In.Main)}})),(0,p.Z)(e,In.Reciter,(0,r.jsx)(En,{onBack:function(){return t(In.Main)}})),(0,p.Z)(e,In.Experience,(0,r.jsx)(cn,{onBack:function(){return t(In.Main)}})),e}),[s,u]);return(0,r.jsx)(r.Fragment,{children:h[n]})},Tn=t(24976),Nn=t.n(Tn),Dn=function(){var e=(0,pe.Z)(),n=(0,gn.P)(),t=n.isActive,i=n.activeStepGroup,a=n.activeStepIndex,l=n.nextStep,s=n.prevStep,u=(0,o.useState)(!1),d=u[0],v=u[1];(0,o.useEffect)((function(){var e=function(){v(!1),l()},n=function(){v(!1),s()},t=function(){var e;null===(e=document.getElementById("audio-player-overflow-menu-trigger"))||void 0===e||e.click(),l()};return window.addEventListener(Cn.Z.STEP_AFTER_CHOOSING_RECITER_FROM_LIST,e),window.addEventListener(Cn.Z.STEP_AFTER_AUDIO_PLAYER_TRIGGER,t),window.addEventListener(Cn.Z.STEP_BEFORE_RECITER_LIST_ITEM_CLICK,n),function(){window.removeEventListener(Cn.Z.STEP_AFTER_CHOOSING_RECITER_FROM_LIST,e),window.removeEventListener(Cn.Z.STEP_AFTER_AUDIO_PLAYER_TRIGGER,t),window.removeEventListener(Cn.Z.STEP_BEFORE_RECITER_LIST_ITEM_CLICK,n)}}),[l,s]);var f=t&&i===yn.Z.READING_EXPERIENCE&&(3===a||4===a);return(0,r.jsx)("div",{dir:e,children:(0,r.jsx)(Re.Z,{isOpen:d,isPortalled:!0,shouldClose:!f,isModal:!f,trigger:(0,r.jsx)(ze,{}),onOpenChange:function(e){(0,c.Kz)("audio_player_overflow_menu_".concat(d?"open":"close")),v(e),e&&t&&i===yn.Z.READING_EXPERIENCE&&2===a&&l()},contentClassName:Nn().overriddenPopoverMenuContentPositioning,children:(0,r.jsx)(Ln,{})})})},Bn=t(81362),Vn=t.n(Bn);function Gn(){return Gn=Object.assign?Object.assign.bind():function(e){for(var n=1;n=(null===v||void 0===v?void 0:v.versesCount);return(0,r.jsx)(_e.ZP,{tooltip:n===Kn.PrevAyah?f("previous-ayah"):f("next-ayah"),variant:_e.Wu.Ghost,shape:_e.jL.Circle,onClick:function(){(0,c.MY)("audio_player_".concat(n)),a.send({type:n===Kn.NextAyah?"NEXT_AYAH":"PREV_AYAH"})},isDisabled:p,children:n===Kn.PrevAyah?(0,r.jsx)(Wn,{}):(0,r.jsx)(Un,{})})},qn=function(){var e=(0,o.useContext)(l.c),n=(0,i.v)(e,Ce.xU);return(0,r.jsxs)("div",{className:Vn().container,children:[(0,r.jsx)("div",{className:Vn().actionItem,children:(0,r.jsx)(Dn,{})}),(0,r.jsx)("div",{className:Vn().actionItem,children:(0,r.jsx)(Ge,{})}),(0,r.jsx)("div",{className:Vn().actionItem,children:(0,r.jsx)(Xn,{type:Kn.PrevAyah,isLoading:n})}),(0,r.jsx)("div",{className:Vn().actionItem,children:(0,r.jsx)(Ze,{})}),(0,r.jsx)("div",{className:Vn().actionItem,children:(0,r.jsx)(Xn,{type:Kn.NextAyah,isLoading:n})}),(0,r.jsx)("div",{className:Vn().actionItem,children:(0,r.jsx)(we,{})})]})},Qn=t(35090),$n=function(){var e=(0,xe.Z)("common").t,n=(0,o.useContext)(l.c);return(0,r.jsx)(_e.ZP,{tooltip:e("close"),shape:_e.jL.Circle,variant:_e.Wu.Ghost,onClick:ye((function(){(0,c.MY)("radio_player_close"),n.send("CLOSE_RADIO")})),shouldFlipOnRTL:!1,children:(0,r.jsx)(ge.Z,{})})},Jn=t(31806),et=t.n(Jn),nt=t(9734),tt=function(e){var n=e.radioActor,t=(0,u.Z)((0,Qn.L)(n),1)[0],o=(0,nt.Z)(t.context);return(0,r.jsxs)("div",{className:et().container,children:[(0,r.jsxs)("div",{className:et().infoContainer,children:[(0,r.jsx)("div",{className:et().title,children:o.title}),(0,r.jsx)("div",{className:et().description,children:o.description})]}),(0,r.jsxs)("div",{className:et().actions,children:[(0,r.jsx)(Ze,{}),(0,r.jsx)($n,{})]})]})},rt=t(44638),ot=t.n(rt),it=function(){var e=(0,o.useContext)(l.c),n=(0,i.v)(e,(function(e){return!!e.context.radioActor})),t=(0,gn.P)(),a=t.isActive,c=t.activeStepGroup,u=t.activeStepIndex,d=t.nextStep;return(0,o.useEffect)((function(){a&&c===yn.Z.READING_EXPERIENCE&&1===u&&d()}),[a,c,u,d]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:ot().innerContainer,children:[(0,r.jsx)(s,{togglePlaying:function(){return e.send("TOGGLE")},isAudioPlayerHidden:!1}),!n&&(0,r.jsx)("div",{className:ot().sliderContainer,children:(0,r.jsx)(me,{})})]}),n?(0,r.jsx)(tt,{radioActor:e.getSnapshot().context.radioActor}):(0,r.jsx)(qn,{})]})}},84620:function(e,n,t){"use strict";t.d(n,{L:function(){return h}});var r=t(69976),o=t(57611),i=t(67597),a=t(21594),c=t(61395),l=t(648),s=t(18356),u=t(10117),d=t(46031),v=t(33294),f=t(12195),p=t(82427),h=function(e,n){var t=e.substring(e.lastIndexOf("/")+1).split("?"),o=(0,r.Z)(t,1)[0],i=new XMLHttpRequest;i.responseType="blob",i.onload=function(){var e=document.createElement("a");e.href=window.URL.createObjectURL(i.response),e.download=o,e.style.display="none",document.body.appendChild(e),e.click(),n()},i.open("GET",e),i.send()};n.Z=function(){var e=(0,c.Z)("common").t,n=(0,i.useContext)(p.c),t=(0,a.v)(n,(function(e){return e.context.audioData.audioUrl})),r=(0,l.v9)(v.iL),m=(0,l.I0)();return(0,o.jsx)(s.Z.Item,{onClick:function(){(0,f.MY)("audio_player_download"),m((0,v.f3)(!0)),h(t,(function(){m((0,v.f3)(!1))}))},icon:r?(0,o.jsx)(u.Z,{size:u.E.Large}):(0,o.jsx)(d.Z,{}),children:e("audio.player.download")})}},73756:function(e,n,t){"use strict";var r=t(57611),o=t(67597),i=t(62103),a=t(19175),c=t(10117),l=t(87739),s=function(e){var n=e.queryKey,t=e.render,o=e.renderError,s=e.initialData,u=e.loading,d=void 0===u?function(){return(0,r.jsx)(c.Z,{})}:u,v=e.fetcher,f=void 0===v?l._i:v,p=e.showSpinnerOnRevalidate,h=void 0===p||p,m=e.onFetchSuccess,x=(0,i.Z)(n,(function(){return f(n).then((function(e){return null===m||void 0===m||m(e),Promise.resolve(e)})).catch((function(e){return Promise.reject(e)}))}),{fallbackData:s}),_=x.data,g=x.error,y=x.isValidating,w=x.mutate;if(h?y:y&&!_)return d();if(g){if(o){var E=o(g);if("undefined"!==typeof E)return E}return(0,r.jsx)(a.Z,{onRetryClicked:function(){w()},error:g})}return t(_)};n.Z=(0,o.memo)(s)},19175:function(e,n,t){"use strict";t.d(n,{Z:function(){return f}});var r,o=t(57611),i=t(67597),a=t(61395),c=t(36284),l=t.n(c),s=t(85494);function u(){return u=Object.assign?Object.assign.bind():function(e){for(var n=1;n{const{__scopeCheckbox:t,name:a,checked:s,defaultChecked:u,required:d,disabled:f,value:p="on",onCheckedChange:h,...x}=e,[_,g]=(0,o.useState)(null),y=(0,i.e)(n,(e=>g(e))),j=(0,o.useRef)(!1),C=!_||Boolean(_.closest("form")),[Z=!1,S]=(0,l.T)({prop:s,defaultProp:u,onChange:h}),k=(0,o.useRef)(Z);return(0,o.useEffect)((()=>{const e=null===_||void 0===_?void 0:_.form;if(e){const n=()=>S(k.current);return e.addEventListener("reset",n),()=>e.removeEventListener("reset",n)}}),[_,S]),(0,o.createElement)(m,{scope:t,state:Z,disabled:f},(0,o.createElement)(v.WV.button,(0,r.Z)({type:"button",role:"checkbox","aria-checked":E(Z)?"mixed":Z,"aria-required":d,"data-state":b(Z),"data-disabled":f?"":void 0,disabled:f,value:p},x,{ref:y,onKeyDown:(0,c.M)(e.onKeyDown,(e=>{"Enter"===e.key&&e.preventDefault()})),onClick:(0,c.M)(e.onClick,(e=>{S((e=>!!E(e)||!e)),C&&(j.current=e.isPropagationStopped(),j.current||e.stopPropagation())}))})),C&&(0,o.createElement)(w,{control:_,bubbles:!j.current,name:a,value:p,checked:Z,required:d,disabled:f,style:{transform:"translateX(-100%)"}}))})),g="CheckboxIndicator",y=(0,o.forwardRef)(((e,n)=>{const{__scopeCheckbox:t,forceMount:i,...a}=e,c=x(g,t);return(0,o.createElement)(d.z,{present:i||E(c.state)||!0===c.state},(0,o.createElement)(v.WV.span,(0,r.Z)({"data-state":b(c.state),"data-disabled":c.disabled?"":void 0},a,{ref:n,style:{pointerEvents:"none",...e.style}})))})),w=e=>{const{control:n,checked:t,bubbles:i=!0,...a}=e,c=(0,o.useRef)(null),l=(0,s.D)(t),d=(0,u.t)(n);return(0,o.useEffect)((()=>{const e=c.current,n=window.HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(n,"checked").set;if(l!==t&&r){const n=new Event("click",{bubbles:i});e.indeterminate=E(t),r.call(e,!E(t)&&t),e.dispatchEvent(n)}}),[l,t,i]),(0,o.createElement)("input",(0,r.Z)({type:"checkbox","aria-hidden":!0,defaultChecked:!E(t)&&t},a,{tabIndex:-1,ref:c,style:{...e.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function E(e){return"indeterminate"===e}function b(e){return E(e)?"indeterminate":e?"checked":"unchecked"}const j=_,C=y},10810:function(e,n,t){"use strict";t.d(n,{D:function(){return o}});var r=t(67597);function o(e){const n=(0,r.useRef)({value:e,previous:e});return(0,r.useMemo)((()=>(n.current.value!==e&&(n.current.previous=n.current.value,n.current.value=e),n.current.previous)),[e])}}}]); //# sourceMappingURL=78227.b63d41a227e10bfa.js.map