12 |
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[58078],{75183: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<arguments.length;n++){var t=arguments[n];for(var r in t)({}).hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},i.apply(null,arguments)}n.Z=function(e){return o.createElement("svg",i({width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),r||(r=o.createElement("path",{d:"M3.135 6.158a.5.5 0 0 1 .707-.023L7.5 9.565l3.658-3.43a.5.5 0 0 1 .684.73l-4 3.75a.5.5 0 0 1-.684 0l-4-3.75a.5.5 0 0 1-.023-.707Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})))}},50024:function(e,n,t){"use strict";var r,o,i=t(67597);function a(){return a=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)({}).hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},a.apply(null,arguments)}n.Z=function(e){return i.createElement("svg",a({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-help-circle"},e),r||(r=i.createElement("circle",{cx:12,cy:12,r:10})),o||(o=i.createElement("path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3M12 17h.01"})))}},79194:function(e,n,t){"use strict";var r=t(57044),o=t(14574),i=t.n(o),a=t(24277);n.Z=function(e,n){return(0,r.Z)({},e,e.rules&&{rules:e.rules.map((function(t){return{type:t.type,value:t.value,errorMessage:n("common:validation.".concat(t.errorId),(0,r.Z)({field:i()(e.field)},t.errorExtraParams))}}))},e.label&&{label:e.type===a.E.Checkbox?e.label:n("form.".concat(e.label))},e.defaultValue&&{defaultValue:e.defaultValue},e.placeholder&&{placeholder:e.placeholder})}},6507:function(e,n,t){"use strict";var r=t(57044),o=t(14574),i=t.n(o),a=t(48559),s=a.Z.InvalidField;n.Z=function(e,n,t,o){return Object.values(a.Z).includes(e)?t("common:validation.".concat(e),(0,r.Z)({field:i()(n)},o)):t("common:validation.".concat(s),{field:i()(n)})}},43856:function(e,n,t){"use strict";var r=t(69976),o=t(57611),i=t(67597),a=t(61395),s=t(62394),c=t.n(s),l=t(9192),u=t(22582),d=t(43609),f=t(78056);n.Z=function(e){var n=e.ranges,t=(0,a.Z)().lang,s=(0,i.useContext)(l.Z);if(!n||0===n.length)return(0,o.jsx)(o.Fragment,{});var h=(0,r.Z)((0,f.p)(n[0]),1)[0],p=h.chapter,v=h.verseKey,m=(0,u.dy)(s,p),x="".concat(m.transliteratedName," ").concat((0,d.Tj)(v,t));return(0,o.jsx)("div",{className:c().container,children:x})}},58078:function(e,n,t){"use strict";t.d(n,{Z:function(){return Se}});var r,o=t(57611),i=t(67597),a=t(87874),s=t.n(a),c=t(61395),l=t(1997),u=t(45361),d=t(57044),f=t(16946),h=t(8522),p=t(51726),v=t(99968),m=t(85950),x=t.n(m),_=t(67385),Z=t(68559),b=t.n(Z),g=t(23266),j=t(57830),C=t(75183),N=t(12195);!function(e){e.NEW="new",e.EDIT="edit"}(r||(r={}));var y,E=function(e){var n=e.type,t=void 0===n?r.NEW:n,i=(0,c.Z)("notes").t,a=t===r.EDIT;return(0,o.jsx)("div",{className:b().container,children:(0,o.jsx)(g.Z,{title:(0,o.jsx)("div",{className:b().title,children:i(a?"checkbox-refl-intro.post-button":"checkbox-refl-intro.title")}),prefix:(0,o.jsx)(C.Z,{}),direction:g.a.Right,shouldRotatePrefixOnToggle:!0,onOpenChange:function(e){e?(0,N.Kz)("".concat(t,"_note_reflection_intro_opened")):(0,N.Kz)("".concat(t,"_note_reflection_intro_closed"))},children:function(e){return e.isOpen?(0,o.jsxs)("div",{className:b().contentContainer,children:[(0,o.jsx)(_.Z,{components:{li:(0,o.jsx)("li",{},0),link:(0,o.jsx)(j.Z,{href:"https://quranreflect.com/faq",variant:j.r.Blend,isNewTab:!0},0)},i18nKey:"notes:checkbox-refl-intro.qr-intro"}),(0,o.jsx)("p",{className:b().checkboxTitle,children:i(a?"checkbox-refl-intro.post-button":"checkbox-refl-intro.checkbox.title")}),(0,o.jsx)(_.Z,{components:{li:(0,o.jsx)("li",{},0),link:(0,o.jsx)(j.Z,{href:"https://quranreflect.com",variant:j.r.Blend,isNewTab:!0},0)},i18nKey:"notes:checkbox-refl-intro.checkbox.desc"})]}):null}})})},k=t(79194),w=t(6507),M=t(47995),S=t(37014),T=t.n(S),L=t(48469),I=t.n(L);function R(){return R=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)({}).hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},R.apply(null,arguments)}var q,P=function(e){return i.createElement("svg",R({width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),y||(y=i.createElement("path",{d:"M8.697.04a.5.5 0 0 1 .296.542L8.09 6h4.41a.5.5 0 0 1 .4.8l-6 8a.5.5 0 0 1-.893-.382L6.91 9H2.5a.5.5 0 0 1-.4-.8l6-8a.5.5 0 0 1 .597-.16ZM3.5 8h4a.5.5 0 0 1 .493.582L7.33 12.56 11.5 7h-4a.5.5 0 0 1-.493-.582L7.67 2.44 3.5 8Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})))},O=function(){var e=(0,c.Z)("notes").t;return(0,o.jsx)("div",{className:I().container,children:(0,o.jsx)(g.Z,{title:(0,o.jsxs)("div",{className:I().title,children:[(0,o.jsx)(P,{}),e("new-note-reflc-intro.title")]}),prefix:(0,o.jsx)(C.Z,{}),direction:g.a.Right,shouldRotatePrefixOnToggle:!0,onOpenChange:function(e){e?(0,N.Kz)("new_note_reflection_intro_opened"):(0,N.Kz)("new_note_reflection_intro_closed")},children:function(n){return n.isOpen?(0,o.jsxs)("div",{children:[(0,o.jsxs)("div",{className:I().sectionContainer,children:[(0,o.jsx)("div",{className:I().sectionHeader,children:e("new-note-reflc-intro.what-is-reflc.title")}),(0,o.jsx)(_.Z,{components:{br:(0,o.jsx)("br",{},0),link1:(0,o.jsx)(j.Z,{href:"/38:29",variant:j.r.Blend,isNewTab:!0},1),link2:(0,o.jsx)(j.Z,{href:"/47:24",variant:j.r.Blend,isNewTab:!0},2),link3:(0,o.jsx)(j.Z,{href:"/4:82",variant:j.r.Blend,isNewTab:!0},3),link4:(0,o.jsx)(j.Z,{href:"https://quranReflect.com/faq",variant:j.r.Blend,isNewTab:!0},4),link5:(0,o.jsx)(j.Z,{href:"/learning-plans/five-lenses-to-reflect-on-the-quran",variant:j.r.Blend,isNewTab:!0},5)},i18nKey:"notes:new-note-reflc-intro.what-is-reflc.desc"})]}),(0,o.jsxs)("div",{className:I().sectionContainer,children:[(0,o.jsx)("div",{className:I().sectionHeader,children:e("new-note-reflc-intro.reflc-prompts.title")}),(0,o.jsx)("div",{className:I().sectionHeader,children:e("new-note-reflc-intro.reflc-prompts.personal.title")}),(0,o.jsx)(_.Z,{components:{br:(0,o.jsx)("br",{},0),li:(0,o.jsx)("li",{},1)},i18nKey:"notes:new-note-reflc-intro.reflc-prompts.personal.desc"}),(0,o.jsx)("div",{className:T()(I().sectionHeader,I().subSectionHeader),children:e("new-note-reflc-intro.reflc-prompts.deeper.title")}),(0,o.jsx)(_.Z,{components:{br:(0,o.jsx)("br",{},0),li:(0,o.jsx)("li",{},1)},i18nKey:"notes:new-note-reflc-intro.reflc-prompts.deeper.desc"})]})]}):null}})})},F=t(52006),B=t.n(F),K=t(3357),D=t(90740),H=function(){var e=(0,D.Z)().user.firstName,n=(0,c.Z)("notes").t;return(0,o.jsxs)("div",{children:[(0,o.jsxs)("div",{className:B().container,children:[n("share-to-qr"),(0,o.jsx)(K.Z,{children:(0,o.jsx)(_.Z,{i18nKey:"notes:qr-tooltip",components:{link:(0,o.jsx)(j.Z,{href:"https://quranreflect.com",variant:j.r.Blend,isNewTab:!0},0),span:(0,o.jsx)("span",{},1)}})})]}),(0,o.jsx)(_.Z,{i18nKey:"notes:share-to-qr-desc",components:{b:(0,o.jsx)("b",{className:B().bold},0)},values:{name:"".concat(e)}})]})},Y=t(85494),z=t(85609),A=t(32607),W=function(e,n){var t=(0,i.useState)(!1),r=t[0],o=t[1],a=(0,i.useState)(null),s=a[0],c=a[1],u=(0,i.useCallback)(function(){var t=(0,l.Z)((function(t){var r,i,a,s;return(0,p.__generator)(this,(function(l){switch(l.label){case 0:o(!0),c(null),l.label=1;case 1:return l.trys.push([1,3,4,5]),[4,e(t)];case 2:return i=l.sent(),null===n||void 0===n||null===(r=n.onSuccess)||void 0===r||r.call(n,i,t),[2,i];case 3:return a=l.sent(),c(a),null===n||void 0===n||null===(s=n.onError)||void 0===s||s.call(n,a,t),[3,5];case 4:return o(!1),[7];case 5:return[2,null]}}))}));return function(e){return t.apply(this,arguments)}}(),[e,n]);return{mutate:u,isMutating:r,error:s}},U=t(65481),V=t(48559),Q=t(12253),J=t(24277),G=t(9740),X=t(37572),$=t(69640),ee={value:6},ne={value:1e4},te=function(e){var n=e.verseKey,t=e.onSuccess,r=(0,c.Z)("common").t,a=(0,z.useToast)(),s=(0,v.kY)(),m=s.mutate,_=s.cache,Z=(0,i.useState)(!1),b=Z[0],g=Z[1],j=(0,A.Z)(),C=W(function(){var e=(0,l.Z)((function(e){var t,r;return(0,p.__generator)(this,(function(o){return t=e.body,r=e.saveToQR,[2,(0,G.AL)((0,d.Z)({body:t,saveToQR:r},n&&{ranges:["".concat(n,"-").concat(n)]}))]}))}));return function(n){return e.apply(this,arguments)}}(),{onSuccess:function(e){!0===(null===e||void 0===e?void 0:e.error)?(a(r("notes:save-publish-failed"),{status:z.ToastStatus.Error}),T([e.note])):(a(r("notes:save-success"),{status:z.ToastStatus.Success}),T([e])),L(),j((0,X.bo)(),(function(e){return(0,f.Z)((0,d.Z)({},e),{consents:(0,f.Z)((0,d.Z)({},e.consents),(0,u.Z)({},U.Z.HAS_NOTES,!0))})})),t&&t()},onError:function(){a(r("common:error.general"),{status:z.ToastStatus.Error})}}),y=C.mutate,S=C.isMutating,T=function(e){n&&m((0,X.qY)(n),e)},L=function(){var e=(0,h.Z)(_.keys()).filter((function(e){if(!e.startsWith("countNotes/"))return!1;if(n){var t=e.replace("countNotes/","");return(0,$.Yx)(n,t)}return!0}));e.length&&e.forEach((function(e){_.delete(e),m(e)}))},I=function(){var e=(0,l.Z)((function(e){var n,t;return(0,p.__generator)(this,(function(r){return n=e.body,t=e.saveToQR,(0,N.MY)("add_note"),y({body:n,saveToQR:t}),[2]}))}));return function(n){return e.apply(this,arguments)}}();return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(O,{}),(0,o.jsx)(M.Z,{formFields:[{field:"body",placeholder:r("notes:body-placeholder"),rules:[{type:Q.S.Required,errorId:V.Z.RequiredField,value:!0},(0,f.Z)((0,d.Z)({},ee),{type:Q.S.MinimumLength,errorId:V.Z.MinimumLength,errorExtraParams:(0,d.Z)({},ee),errorMessage:(0,w.Z)(V.Z.MinimumLength,"body",r,(0,d.Z)({},ee))}),(0,f.Z)((0,d.Z)({},ne),{type:Q.S.MaximumLength,errorId:V.Z.MaximumLength,errorExtraParams:(0,d.Z)({},ne),errorMessage:(0,w.Z)(V.Z.MaximumLength,"body",r,(0,d.Z)({},ne))})],type:J.E.TextArea,containerClassName:x().bodyInput,fieldSetLegend:r("notes:notes-and-reflcs")},{field:"saveToQR",label:(0,o.jsx)(H,{}),defaultValue:!1,type:J.E.Checkbox,extraSection:(0,o.jsx)(E,{}),onChange:function(e){g(e)}}].map((function(e){return(0,k.Z)(e,r)})),onSubmit:I,isSubmitting:S,renderAction:function(e){return(0,o.jsx)("div",{className:x().submitContainer,children:(0,o.jsx)("div",{className:x().actionContainer,children:(0,o.jsx)(Y.ZP,{htmlType:"submit",isLoading:e.isLoading,isDisabled:e.isLoading,onClick:function(e){e.stopPropagation()},children:r(b?"notes:save-post-to-qr":"notes:save-privately")})})})}})]})},re=t(78033),oe=t(85483),ie=function(e){var n=e.isDisabled,t=e.note.id,r=e.onConfirm,i=(0,c.Z)("notes").t,a=(0,oe.N)(),s=function(){var e=(0,l.Z)((function(){return(0,p.__generator)(this,(function(e){switch(e.label){case 0:return(0,N.MY)("note_delete"),[4,a({confirmText:i("common:delete"),cancelText:i("common:cancel"),title:i("delete-note-modal.title"),subtitle:i("delete-note-modal.subtitle")})];case 1:return e.sent()?((0,N.MY)("note_delete_confirm",{noteId:t}),r()):(0,N.MY)("note_delete_confirm_cancel",{noteId:t}),[2]}}))}));return function(){return e.apply(this,arguments)}}(),u={isDisabled:n,isLoading:n};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(Y.ZP,(0,f.Z)((0,d.Z)({variant:Y.Wu.Ghost,onClick:s,tooltip:i("delete"),size:Y.qE.Small,type:Y.L$.Warning},u),{children:"X"})),(0,o.jsx)(re.Z,{})]})},ae={value:6},se={value:1e4},ce=function(e){var n=e.note,t=e.onNoteUpdated,r=e.verseKey,a=e.noteId,s=e.onCancelEditClicked,u=(0,c.Z)("common").t,h=(0,i.useState)(!1),m=h[0],_=h[1],Z=(0,z.useToast)(),b=(0,v.kY)().mutate,g=function(e){r&&b((0,X.qY)(r),e),a&&b((0,X.Y0)(a),e)},j=W(function(){var e=(0,l.Z)((function(e){var n,t;return(0,p.__generator)(this,(function(r){return n=e.id,t=e.body,[2,(0,G.Qk)(n,t,m)]}))}));return function(n){return e.apply(this,arguments)}}(),{onSuccess:function(e){!0===(null===e||void 0===e?void 0:e.error)?(Z(u("notes:update-publish-failed"),{status:z.ToastStatus.Error}),null===t||void 0===t||t(e.note),g([e.note])):(Z(u("notes:update-success"),{status:z.ToastStatus.Success}),null===t||void 0===t||t(e),g([e]))},onError:function(){Z(u("common:error.general"),{status:z.ToastStatus.Error})}}),C=j.mutate,y=j.isMutating,E=function(){var e=(0,l.Z)((function(e){var t;return(0,p.__generator)(this,(function(r){return t=e.body,(0,N.MY)("update_note",{saveToQR:m}),C({id:n.id,body:t}),[2]}))}));return function(n){return e.apply(this,arguments)}}();return(0,o.jsx)(M.Z,{formFields:[{field:"body",placeholder:u("notes:body-placeholder"),defaultValue:n.body,rules:[{type:Q.S.Required,errorId:V.Z.RequiredField,value:!0},(0,f.Z)((0,d.Z)({},ae),{type:Q.S.MinimumLength,errorId:V.Z.MinimumLength,errorExtraParams:(0,d.Z)({},ae),errorMessage:(0,w.Z)(V.Z.MinimumLength,"body",u,(0,d.Z)({},ae))}),(0,f.Z)((0,d.Z)({},se),{type:Q.S.MaximumLength,errorId:V.Z.MaximumLength,errorExtraParams:(0,d.Z)({},se),errorMessage:(0,w.Z)(V.Z.MaximumLength,"body",u,(0,d.Z)({},se))})],type:J.E.TextArea,containerClassName:x().bodyInput,fieldSetLegend:u("notes:notes-and-reflcs")}].map((function(e){return(0,k.Z)(e,u)})),onSubmit:E,isSubmitting:y,renderAction:function(e){var n=e.isLoading;return(0,o.jsxs)("div",{className:x().editFormButtons,children:[(0,o.jsx)(Y.ZP,{isLoading:n,variant:Y.Wu.Outlined,isDisabled:n,onClick:function(e){e.stopPropagation(),s()},children:u("cancel")}),(0,o.jsx)("div",{children:(0,o.jsx)(Y.ZP,{htmlType:"submit",isLoading:n,isDisabled:n,className:x().saveButton,onClick:function(e){e.stopPropagation(),_(!1)},children:u("notes:save-privately")})})]})}})},le=t(29586),ue=t.n(le);function de(){return de=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)({}).hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},de.apply(null,arguments)}var fe,he=function(e){return i.createElement("svg",de({viewBox:"0 0 1024 1024",fill:"currentColor"},e),q||(q=i.createElement("path",{d:"M128 736v160h160l472.107-472.107-160-160L128 736zm755.413-435.413c16.64-16.64 16.64-43.734 0-60.374l-99.626-99.626c-16.64-16.64-43.734-16.64-60.374 0l-78.08 78.08 160 160 78.08-78.08z"})))};!function(e){e.REFLECTION="reflection"}(fe||(fe={}));var pe=t(83459),ve=function(e){var n,t,a=e.note,s=e.verseKey,u=e.noteId,m=e.onNoteUpdated,x=e.onNoteDeleted,_=(0,c.Z)("common").t,Z=(0,z.useToast)(),b=(0,v.kY)(),g=b.mutate,j=b.cache,C=(0,i.useState)(!1),y=C[0],k=C[1],w=function(e){s&&g((0,X.qY)(s),e),u&&g((0,X.Y0)(u),e)},M=W((function(){return(0,G.yJ)(a.id,{body:a.body,ranges:(null===a||void 0===a?void 0:a.ranges)||[]})}),{onSuccess:function(e){var n=e.postId;Z(_("notes:export-success"),{status:z.ToastStatus.Success}),w((0,f.Z)((0,d.Z)({},a),{attachedEntities:[{type:fe.REFLECTION,id:n,createdAt:new Date,updatedAt:new Date}]}))},onError:function(){Z(_("common:error.general"),{status:z.ToastStatus.Error})}}),S=M.mutate,T=M.isMutating,L=W(function(){var e=(0,l.Z)((function(e){return(0,p.__generator)(this,(function(n){return[2,(0,G.f_)(e)]}))}));return function(n){return e.apply(this,arguments)}}(),{onSuccess:function(){Z(_("notes:delete-success"),{status:z.ToastStatus.Success}),w([]),function(){var e=(0,h.Z)(j.keys()).filter((function(e){if(!e.startsWith("countNotes/"))return!1;if(s){var n=e.replace("countNotes/","");return(0,$.Yx)(s,n)}return!0}));e.length&&e.forEach((function(e){j.delete(e),g(e)}))}(),x&&x()},onError:function(){Z(_("common:error.general"),{status:z.ToastStatus.Error})}}),I=L.mutate,R=L.isMutating||T,q={isDisabled:R,isLoading:R},P=null===(t=null===a||void 0===a||null===(n=a.attachedEntities)||void 0===n?void 0:n.find((function(e){return e.type===fe.REFLECTION})))||void 0===t?void 0:t.id;return(0,o.jsx)("div",{className:ue().container,children:y?(0,o.jsx)(ce,{onCancelEditClicked:function(){k(!1),(0,N.MY)("cancel_edit_note")},note:a,onNoteUpdated:function(e){k(!1),m&&m(e)},verseKey:s,noteId:u}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("div",{className:ue().buttonsContainer,children:[(0,o.jsx)(Y.ZP,(0,f.Z)((0,d.Z)({shouldFlipOnRTL:!1,variant:Y.Wu.Ghost,onClick:function(e){e.stopPropagation(),(0,N.MY)("edit_note"),k(!0)},tooltip:_("edit"),size:Y.qE.Small},q),{children:(0,o.jsx)(he,{})})),(0,o.jsx)(ie,{onConfirm:function(){I(a.id)},note:a,isDisabled:R})]}),(0,o.jsx)("div",{className:ue().noteBody,children:a.body}),P?(0,o.jsx)("div",{className:ue().shareButtonContainer,children:(0,o.jsx)(Y.ZP,(0,f.Z)((0,d.Z)({size:Y.qE.Small,href:(0,pe.rW)(P),isNewTab:!0,onClick:function(e){e.stopPropagation(),(0,N.MY)("qr_view_note_post")}},q),{children:_("notes:view-on-qr")}))}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("div",{className:ue().shareButtonContainer,children:(0,o.jsx)(Y.ZP,(0,f.Z)((0,d.Z)({size:Y.qE.Small,onClick:function(e){e.stopPropagation(),(0,N.MY)("qr_publish_note"),S()}},q),{children:_("notes:post-on-qr")}))}),(0,o.jsx)(E,{type:r.EDIT})]})]})})},me=t(88096),xe=t.n(me),_e=t(69976),Ze=t(43856),be=t(96619),ge=t.n(be),je=t(59027),Ce=t(78056),Ne=function(e){var n=e.ranges;return(0,o.jsx)("div",{className:ge().container,children:(0,o.jsx)(g.Z,{title:(0,o.jsx)("div",{className:ge().headerContainer,children:(0,o.jsx)(Ze.Z,{ranges:n})}),prefix:(0,o.jsx)(C.Z,{}),shouldRotatePrefixOnToggle:!0,onOpenChange:function(e){e?(0,N.Kz)("note_range_collapse_opened"):(0,N.Kz)("note_range_collapse_closed")},children:function(e){if(!e.isOpen)return null;var t=(0,_e.Z)((0,Ce.p)(n[0]),1)[0],r=t.chapter,i=t.verse;return(0,o.jsx)(je.Z,{chapterId:Number(r),verseNumber:Number(i)})}})})},ye=t(77107),Ee=t(85149),ke=function(e){var n=e.notes,t=e.verseKey,r=e.onNoteUpdated,a=e.onNoteDeleted,s=e.noteId,l=(0,c.Z)("notes"),u=l.t,d=l.lang,f=(0,i.useState)(!1),h=f[0],p=f[1];return(0,o.jsxs)("div",{className:xe().container,children:[!s&&(0,o.jsx)(o.Fragment,{children:h?(0,o.jsxs)("div",{className:xe().addNoteContainer,children:[(0,o.jsxs)("div",{className:xe().addNoteContainerHeader,children:[(0,o.jsx)("p",{children:u("add-another-note")}),(0,o.jsx)(Y.ZP,{variant:Y.Wu.Ghost,size:Y.qE.Small,onClick:function(){(0,N.MY)("close_add_more_notes_button"),p(!1)},tooltip:u("common:close"),children:"X"})]}),(0,o.jsx)(te,{verseKey:t,onSuccess:function(){p(!1)}})]}):(0,o.jsx)("div",{className:xe().addNoteBtnContainer,children:(0,o.jsx)(Y.ZP,{size:Y.qE.Small,prefix:(0,o.jsx)(ye.Z,{}),onClick:function(){(0,N.MY)("add_more_notes_button"),p(!0)},children:u("add-another-note")})})}),n.map((function(e,n){return(0,o.jsxs)("div",{children:[(0,o.jsxs)("div",{className:xe().noteHeaderContainer,children:[(0,o.jsx)("p",{children:"".concat(u("notes:note")," ").concat(n+1)}),(0,o.jsx)("time",{className:xe().noteDate,dateTime:e.createdAt.toString(),children:(0,Ee.ZC)(e.createdAt,d,{year:"numeric",weekday:void 0,month:"short"})})]}),(null===e||void 0===e?void 0:e.ranges)&&(0,o.jsx)(Ne,{ranges:e.ranges}),(0,o.jsx)(ve,{verseKey:t,onNoteUpdated:r,onNoteDeleted:a,noteId:s,note:e},e.id)]},e.id)}))]})},we=t(73756),Me=t(59807),Se=function(e){var n=e.onClose,t=e.isOpen,r=e.verseKey,a=e.noteId,c=e.onNoteUpdated,l=e.onNoteDeleted,u=(0,i.useRef)(),d=a?(0,X.Y0)(a):(0,X.qY)(r),f=function(){l(),n()};return(0,o.jsx)(Me.default,{innerRef:u,isOpen:t,header:(0,o.jsx)("div",{className:x().headerContainer}),hasCloseButton:!0,onClose:n,onEscapeKeyDown:n,size:Me.ContentModalSize.MEDIUM,children:(0,o.jsx)(we.Z,{queryKey:d,fetcher:G.UK,showSpinnerOnRevalidate:!1,render:function(e){return(a?e:e[0])?(0,o.jsx)(ke,{onNoteUpdated:c,onNoteDeleted:l?f:void 0,verseKey:r,notes:s()(e)?e:[e],noteId:a}):(0,o.jsx)(te,{verseKey:r})}})})}},59027:function(e,n,t){"use strict";var r=t(57044),o=t(16946),i=t(57611),a=(t(67597),t(61395)),s=t(648),c=t(14068),l=t.n(c),u=t(87739),d=t(73756),f=t(4424),h=t(43550),p=t(5330),v=t(48752),m=t(15721),x=t(27967),_=t(1050);n.Z=function(e){var n=e.chapterId,t=e.verseNumber,c=e.fontScale,Z=(0,s.v9)(p.Pt,s.wU),b=Z.quranFont,g=Z.mushafLines,j=(0,m.$P)(b,g).mushaf,C=(0,s.v9)(v.qw,_.Hj),N=(0,a.Z)().lang,y=(0,o.Z)((0,r.Z)({words:!0,perPage:1,translations:C.join(","),page:t},(0,m.hD)(Z.quranFont)),{mushaf:j});return(0,i.jsx)(d.Z,{queryKey:"embeddable-verse-".concat(n,":").concat(t),fetcher:function(){return(0,u._i)((0,x.ML)(n.toString(),N,y))},render:function(e){var n,t;if(!e)return null;var r=null===(n=e.verses)||void 0===n?void 0:n[0];return(0,i.jsxs)("div",{className:l().verseContainer,children:[(0,i.jsx)(h.Z,{verses:e.verses,fontScale:c}),(0,i.jsx)("div",{children:null===(t=r.translations)||void 0===t?void 0:t.map((function(e){return(0,i.jsx)(f.Z,{translationFontScale:Z.translationFontScale,text:e.text,languageId:e.languageId,resourceName:e.resourceName},e.id)}))})]})}})}},23266:function(e,n,t){"use strict";t.d(n,{a:function(){return r}});var r,o=t(45361),i=t(57611),a=t(67597),s=t(64826),c=t(37014),l=t.n(c),u=t(55340),d=t.n(u);!function(e){e.Left="left",e.Right="right"}(r||(r={}));n.Z=function(e){var n=e.isDefaultOpen,t=void 0!==n&&n,c=e.prefix,u=e.title,f=e.suffix,h=e.children,p=e.shouldRotatePrefixOnToggle,v=e.shouldOpen,m=e.onOpenChange,x=e.direction,_=void 0===x?r.Left:x,Z=(0,a.useState)(t),b=Z[0],g=Z[1];(0,a.useEffect)((function(){g(v)}),[v]);return(0,i.jsxs)(s.fC,{onOpenChange:m,open:b,children:[(0,i.jsx)(s.xz,{asChild:!0,children:(0,i.jsx)("div",{className:d().header,onClick:function(){return g((function(e){return!e}))},children:_===r.Left?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:d().headerLeft,children:[(0,i.jsx)("div",{className:l()(d().prefixContainer,(0,o.Z)({},d().prefixRotated,p&&b)),children:c}),u]}),(0,i.jsx)("div",{className:d().suffixContainer,onClick:function(e){e.preventDefault(),e.stopPropagation()},children:f})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{className:d().headerLeft,children:u}),(0,i.jsx)("div",{className:l()(d().prefixContainer,(0,o.Z)({},d().prefixRotated,p&&b)),children:c})]})})}),(0,i.jsx)(s.Fw,{children:b&&h({isOpen:b})})]})}},78033:function(e,n,t){"use strict";var r=t(57611),o=t(67597),i=t(85483),a=t(3463);n.Z=function(){var e=(0,i.t)(),n=e.onCancel,t=e.onConfirm,s=e.state,c=(0,o.useMemo)((function(){var e=[];return s.confirmText&&t&&e.push({label:s.confirmText,onClick:t}),s.cancelText&&n&&e.push({label:s.cancelText,onClick:n,isCloseAction:!0}),e}),[n,t,s.cancelText,s.confirmText]),l=function(){n&&n()};return(0,r.jsxs)(a.Z,{isOpen:!!s.open,onClickOutside:l,onEscapeKeyDown:l,children:[(0,r.jsxs)(a.Z.Body,{children:[(0,r.jsxs)(a.Z.Header,{children:[(0,r.jsx)(a.Z.Title,{children:s.title}),(0,r.jsx)(a.Z.Subtitle,{children:s.subtitle})]}),(0,r.jsx)("p",{children:s.description})]}),(0,r.jsx)(a.Z.Footer,{children:c.map((function(e,n){var t=e.onClick,o=e.label;return e.isCloseAction?(0,r.jsx)(a.Z.CloseAction,{onClick:t,children:o},n):(0,r.jsx)(a.Z.Action,{onClick:t,children:o},n)}))})]})}},85483:function(e,n,t){"use strict";t.d(n,{N:function(){return d},t:function(){return u}});var r,o=t(57044),i=t(16946),a=t(67597),s={open:!1},c=function(e){s=e,l.forEach((function(e){return e(s)}))},l=[],u=function(){var e=(0,a.useState)(s),n=e[0],t=e[1];(0,a.useEffect)((function(){return l.push(t),function(){var e=l.indexOf(t);e>-1&&l.splice(e,1)}}),[n]);var u=function(){c((0,i.Z)((0,o.Z)({},n),{open:!1}))};return{state:n,onCancel:function(){u(),r(!1)},onConfirm:function(){u(),r(!0)}}},d=function(){return function(e){return c((0,i.Z)((0,o.Z)({},e),{open:!0})),new Promise((function(e){r=e}))}}},3357:function(e,n,t){"use strict";var r=t(57611),o=t(92111),i=t(76682),a=t.n(i),s=t(50024);n.Z=function(e){var n=e.children;return(0,r.jsx)(o.default,{triggerStyles:a().trigger,content:(0,r.jsx)("span",{className:a().content,children:n}),children:(0,r.jsx)("span",{className:a().questionMarkIconContainer,children:(0,r.jsx)(s.Z,{})})})}},90740:function(e,n,t){"use strict";var r=t(99968),o=t(9740),i=t(37572),a=t(19226);n.Z=function(){var e=(0,r.ZP)((0,a.jl)()?(0,i.bo)():null,o.et),n=e.data;return{user:n||{},isLoading:e.isValidating&&!n,error:e.error}}},32607:function(e,n,t){"use strict";t.d(n,{F:function(){return i}});var r=t(67597),o=t(99968),i={revalidate:!1};n.Z=function(){var e=(0,o.kY)().mutate;return(0,r.useCallback)((function(n,t){e(n,t,i)}),[e])}},83459:function(e,n,t){"use strict";t.d(n,{Pr:function(){return a},Q1:function(){return s},dx:function(){return u},oJ:function(){return c},rW:function(){return l}});var r=t(32837),o="production"===t(25620).env.NEXT_PUBLIC_VERCEL_ENV?"https://quranreflect.com":"https://quranreflect.org",i=function(e,n,t){return"".concat(o,"?filters=").concat(e,":").concat(n,"&").concat((0,r.Z)(t))},a=function(e,n){return i(e,n,{feed:!0})},s=function(e,n){return i(e,n,{edit:!0})},c=function(e){return"".concat(o,"/").concat(e)},l=function(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return"".concat(o,"/posts/").concat(e).concat(n?"#comments":"")},u=function(e){return"".concat(o,"/?tags=").concat(encodeURIComponent(e))}},48559:function(e,n){"use strict";var t;!function(e){e.InvalidEmail="invalid-email",e.RequiredField="required-field",e.InvalidField="invalid-field",e.MaximumLength="maximum-length",e.MinimumLength="minimum-length"}(t||(t={})),n.Z=t},29586:function(e){e.exports={container:"NoteListItem_container__HNwm7",headerContainer:"NoteListItem_headerContainer__zgYkk",noteBody:"NoteListItem_noteBody__bfdT6",shareButtonContainer:"NoteListItem_shareButtonContainer__Wzr8B",buttonsContainer:"NoteListItem_buttonsContainer__doHJf"}},88096:function(e){e.exports={container:"EditNoteMode_container__0xUq7",addNoteContainer:"EditNoteMode_addNoteContainer__NY196",addNoteContainerHeader:"EditNoteMode_addNoteContainerHeader__WntFV",addNoteBtnContainer:"EditNoteMode_addNoteBtnContainer__kX0s1",noteDate:"EditNoteMode_noteDate__dWtIB",noteHeaderContainer:"EditNoteMode_noteHeaderContainer__R_xwT"}},96619:function(e){e.exports={container:"NoteRanges_container__viLQL",headerContainer:"NoteRanges_headerContainer__t3h7p"}},85950:function(e){e.exports={buttonContainer:"NoteModal_buttonContainer__REWT1",headerContainer:"NoteModal_headerContainer__HecMx",titleInput:"NoteModal_titleInput__0_sP0",bodyInput:"NoteModal_bodyInput__bHmPH",actionContainer:"NoteModal_actionContainer__IELkO",editFormButtons:"NoteModal_editFormButtons__pp_5t",saveButton:"NoteModal_saveButton__DFAyS",buttonsContainer:"NoteModal_buttonsContainer__ZaPz8",submitContainer:"NoteModal_submitContainer__nd8cY"}},62394:function(e){e.exports={container:"NoteRangesIndicator_container__uDwLA"}},68559:function(e){e.exports={container:"PublicReflectionCheckboxDescription_container__JM8_o",title:"PublicReflectionCheckboxDescription_title__7MLJF",contentContainer:"PublicReflectionCheckboxDescription_contentContainer__SdVyV",checkboxTitle:"PublicReflectionCheckboxDescription_checkboxTitle__9YZq2"}},48469:function(e){e.exports={container:"ReflectionIntro_container__KZx81",title:"ReflectionIntro_title__Mo4RF",sectionHeader:"ReflectionIntro_sectionHeader__HwKUd",subSectionHeader:"ReflectionIntro_subSectionHeader__EwvII",sectionContainer:"ReflectionIntro_sectionContainer__qeZwZ"}},52006:function(e){e.exports={container:"ShareToQrCheckboxLabel_container__GqRjE",bold:"ShareToQrCheckboxLabel_bold__Pz7cF"}},14068:function(e){e.exports={verseContainer:"EmbeddableVerseCell_verseContainer__GCj_d"}},55340:function(e){e.exports={header:"Collapsible_header__CmhJq",headerLeft:"Collapsible_headerLeft__Xh00n",prefixContainer:"Collapsible_prefixContainer__AVHUT",prefixRotated:"Collapsible_prefixRotated__bjKLn",suffixContainer:"Collapsible_suffixContainer__uZ1IW"}},76682:function(e){e.exports={questionMarkIconContainer:"HelperTooltip_questionMarkIconContainer__i20QV",trigger:"HelperTooltip_trigger__1zmSb",content:"HelperTooltip_content__NhcCK"}}}]);
- //# sourceMappingURL=58078-02009497cf392859.js.map
|