84450.48b1de8a01b24596.js 7.1 KB

12
  1. (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[84450],{73756:function(e,n,r){"use strict";var i=r(57611),t=r(67597),a=r(62103),s=r(19175),l=r(10117),c=r(87739),o=function(e){var n=e.queryKey,r=e.render,t=e.renderError,o=e.initialData,u=e.loading,d=void 0===u?function(){return(0,i.jsx)(l.Z,{})}:u,f=e.fetcher,_=void 0===f?c._i:f,h=e.showSpinnerOnRevalidate,p=void 0===h||h,m=e.onFetchSuccess,x=(0,a.Z)(n,(function(){return _(n).then((function(e){return null===m||void 0===m||m(e),Promise.resolve(e)})).catch((function(e){return Promise.reject(e)}))}),{fallbackData:o}),g=x.data,v=x.error,j=x.isValidating,Z=x.mutate;if(p?j:j&&!g)return d();if(v){if(t){var C=t(v);if("undefined"!==typeof C)return C}return(0,i.jsx)(s.Z,{onRetryClicked:function(){Z()},error:v})}return r(g)};n.Z=(0,t.memo)(o)},19175:function(e,n,r){"use strict";r.d(n,{Z:function(){return _}});var i,t=r(57611),a=r(67597),s=r(61395),l=r(36284),c=r.n(l),o=r(85494);function u(){return u=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var i in r)({}).hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},u.apply(null,arguments)}var d=function(e){return a.createElement("svg",u({width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),i||(i=a.createElement("path",{d:"M1.85 7.5c0-2.835 2.21-5.65 5.65-5.65 2.778 0 4.152 2.056 4.737 3.15H10.5a.5.5 0 0 0 0 1h3a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-1 0v1.813C12.296 3.071 10.666.85 7.5.85 3.437.85.85 4.185.85 7.5c0 3.315 2.587 6.65 6.65 6.65 1.944 0 3.562-.77 4.714-1.942a6.77 6.77 0 0 0 1.428-2.167.5.5 0 1 0-.925-.38 5.77 5.77 0 0 1-1.216 1.846c-.971.99-2.336 1.643-4.001 1.643-3.44 0-5.65-2.815-5.65-5.65Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})))},f=r(87739),_=function(e){var n=e.onRetryClicked,r=e.error,i=(0,s.Z)("common").t;return(0,t.jsxs)("div",{className:c().container,children:[(0,t.jsx)("p",{className:c().text,children:r.message!==f.yH?i("error.general"):i("error.offline")}),(0,t.jsx)(o.ZP,{prefix:(0,t.jsx)(d,{}),size:o.qE.Small,type:o.L$.Secondary,onClick:n,children:i("retry")})]})}},84450:function(e,n,r){"use strict";r.r(n);var i=r(69976),t=r(8522),a=r(57611),s=r(67597),l=r(19418),c=r(85378),o=r.n(c),u=r(61395),d=r(648),f=r(89404),_=r.n(f),h=r(73756),p=r(56539),m=r(42366),x=r(5588),g=r(18054),v=r(27967),j=r(1050),Z=r(12195);n.default=function(){var e=(0,u.Z)("common").t,n=(0,d.I0)(),r=(0,d.v9)(x.XG,j.Hj),c=(0,u.Z)().lang,f=(0,s.useState)(""),C=f[0],S=f[1],y=function(e){var i=e.target.value,a=e.target.checked,s=a?(0,t.Z)(r).concat([i]):r.filter((function(e){return e!==i}));(0,Z.u8)("tafsir",i,a),(0,Z.Q8)("selected_tafsirs",r,s),n((0,x.ZY)({tafsirs:s,locale:c}))};return(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:_().searchInputContainer,children:(0,a.jsx)(p.ZP,{prefix:(0,a.jsx)(m.Z,{}),id:"tafsirs-search",value:C,onChange:S,placeholder:e("settings.search-tafsirs"),fixedWidth:!1})}),(0,a.jsx)(h.Z,{queryKey:(0,v.A9)(c),render:function(e){var n=C?function(e,n){var r=new l.Z(e,{keys:["name","languageName","authorName"],threshold:.3}).search(n).map((function(e){return e.item}));return r.length||(0,Z.Dy)({query:n,source:g.Z.TafsirSettingsDrawer}),r}(e.tafsirs,C):e.tafsirs,t=o()(n,"languageName");return(0,a.jsx)("div",{children:Object.entries(t).map((function(e){var n=(0,i.Z)(e,2),t=n[0],s=n[1];return(0,a.jsxs)("div",{className:_().group,children:[(0,a.jsx)("div",{className:_().language,children:t}),s.map((function(e){return(0,a.jsxs)("div",{className:_().item,children:[(0,a.jsx)("input",{id:e.slug.toString(),type:"checkbox",value:e.slug,checked:r.includes(e.slug),onChange:y}),(0,a.jsxs)("label",{className:_().label,htmlFor:e.slug.toString(),children:[(0,a.jsx)("span",{children:e.name})," ",(0,a.jsx)("span",{className:_().author,children:e.authorName})]})]},e.slug)}))]},t)}))})}})]})}},56539:function(e,n,r){"use strict";r.d(n,{Jf:function(){return a},fz:function(){return i}});var i,t,a,s=r(45361),l=r(57044),c=r(57611),o=r(67597),u=r(37014),d=r.n(u),f=r(85494),_=r(90724),h=r.n(_),p=r(43172);!function(e){e.Small="small",e.Medium="medium",e.Large="large"}(i||(i={})),function(e){e.Error="error",e.Warning="warning",e.Success="success"}(t||(t={})),function(e){e.Default="default",e.Main="main"}(a||(a={}));n.ZP=function(e){var n=e.id,r=e.name,u=e.label,_=e.placeholder,m=e.size,x=void 0===m?i.Medium:m,g=e.fixedWidth,v=void 0===g||g,j=e.disabled,Z=void 0!==j&&j,C=e.clearable,S=void 0!==C&&C,y=e.type,b=e.variant,I=e.prefix,N=e.suffix,w=e.onClearClicked,k=e.onChange,E=e.onKeyDown,B=e.inputMode,R=e.value,q=void 0===R?"":R,W=e.shouldFlipOnRTL,D=void 0===W||W,M=e.containerClassName,O=e.htmlType,F=e.isRequired,L=e.inputRef,P=(0,o.useState)(q),z=P[0],K=P[1];(0,o.useEffect)((function(){K(q)}),[q]);var T,H;return(0,c.jsxs)(c.Fragment,{children:[u&&(0,c.jsx)("p",{className:h().label,children:u}),(0,c.jsxs)("div",{className:d()(h().container,M,(T={},(0,s.Z)(T,h().smallContainer,x===i.Small),(0,s.Z)(T,h().mediumContainer,x===i.Medium),(0,s.Z)(T,h().largeContainer,x===i.Large),(0,s.Z)(T,h().fixedWidth,v),(0,s.Z)(T,h().disabled,Z),(0,s.Z)(T,h().error,y===t.Error),(0,s.Z)(T,h().success,y===t.Success),(0,s.Z)(T,h().warning,y===t.Warning),(0,s.Z)(T,h().main,b===a.Main),T)),children:[I&&(0,c.jsx)("div",{className:d()(h().prefix,h().prefixSuffixContainer),children:I}),(0,c.jsx)("input",(0,l.Z)({className:d()(h().input,(H={},(0,s.Z)(H,h().error,y===t.Error),(0,s.Z)(H,h().success,y===t.Success),(0,s.Z)(H,h().warning,y===t.Warning),(0,s.Z)(H,h().rtlInput,D),H)),type:O,required:F,dir:"auto",id:n,ref:L,disabled:Z,onChange:function(e){var n=e.target.value;K(n),k&&k(n)},value:z,onKeyDown:E,inputMode:B},_&&{placeholder:_},r&&{name:r})),S?(0,c.jsx)(c.Fragment,{children:z&&(0,c.jsx)("div",{className:h().clearContainer,children:(0,c.jsx)(f.ZP,{shape:f.jL.Circle,variant:f.Wu.Ghost,size:f.qE.Small,onClick:w,children:(0,c.jsx)(p.Z,{})})})}):(0,c.jsx)(c.Fragment,{children:N&&(0,c.jsx)("div",{className:d()(h().suffix,h().prefixSuffixContainer),children:N})})]})]})}},36284:function(e){e.exports={container:"Error_container__1m9XV",text:"Error_text__yg4kD"}},89404:function(e){e.exports={titleContainer:"SearchSelectionBody_titleContainer__HgOZj",language:"SearchSelectionBody_language__R3VJi",item:"SearchSelectionBody_item__6odbz",group:"SearchSelectionBody_group__a1Nqs",searchInputContainer:"SearchSelectionBody_searchInputContainer__BENkn",label:"SearchSelectionBody_label__7I2gU",author:"SearchSelectionBody_author__cejLD",input:"SearchSelectionBody_input__sxqRB"}},90724:function(e){e.exports={container:"Input_container__5BNOH",fixedWidth:"Input_fixedWidth__MZoNx",disabled:"Input_disabled__AFA4l",error:"Input_error__cfc8q",success:"Input_success__qb_Ue",warning:"Input_warning__KwRSJ",main:"Input_main__K4bVL",input:"Input_input__za7E9",rtlInput:"Input_rtlInput__8Yg1Q",smallContainer:"Input_smallContainer__bxyYT",mediumContainer:"Input_mediumContainer__jEOpT",largeContainer:"Input_largeContainer__yafZ8",label:"Input_label__loZWW",clearContainer:"Input_clearContainer__3LxT4",prefixSuffixContainer:"Input_prefixSuffixContainer__n84F6",prefix:"Input_prefix__jYhnp",suffix:"Input_suffix__v_BvR"}}}]);
  2. //# sourceMappingURL=84450.48b1de8a01b24596.js.map