exports.id = 57933; exports.ids = [57933]; exports.modules = { /***/ 62182: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var map = { "./ar.json": [ 70017, 70017 ], "./bn.json": [ 94149, 94149 ], "./en.json": [ 69029, 69029 ], "./fa.json": [ 53557, 53557 ], "./fr.json": [ 10229, 10229 ], "./id.json": [ 46833, 46833 ], "./it.json": [ 23577, 23577 ], "./ms.json": [ 21492, 21492 ], "./nl.json": [ 53802, 53802 ], "./pt.json": [ 74105, 74105 ], "./ru.json": [ 92390, 92390 ], "./sq.json": [ 72413, 72413 ], "./th.json": [ 6383, 6383 ], "./tr.json": [ 81115, 81115 ], "./ur.json": [ 92246, 92246 ], "./zh.json": [ 71119, 71119 ] }; function webpackAsyncContext(req) { if(!__webpack_require__.o(map, req)) { return Promise.resolve().then(() => { var e = new Error("Cannot find module '" + req + "'"); e.code = 'MODULE_NOT_FOUND'; throw e; }); } var ids = map[req], id = ids[0]; return __webpack_require__.e(ids[1]).then(() => { return __webpack_require__.t(id, 3 | 16); }); } webpackAsyncContext.keys = () => (Object.keys(map)); webpackAsyncContext.id = 62182; module.exports = webpackAsyncContext; /***/ }), /***/ 92684: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "BP": () => (/* binding */ getSearchResults), /* harmony export */ "Bz": () => (/* binding */ getAvailableLanguages), /* harmony export */ "Fp": () => (/* binding */ getHizbVerses), /* harmony export */ "H4": () => (/* binding */ getNewSearchResults), /* harmony export */ "IP": () => (/* binding */ getPagesLookup), /* harmony export */ "LE": () => (/* binding */ getRubVerses), /* harmony export */ "U0": () => (/* binding */ getChapterIdBySlug), /* harmony export */ "_i": () => (/* binding */ fetcher), /* harmony export */ "ei": () => (/* binding */ getFootnote), /* harmony export */ "iw": () => (/* binding */ getPageVerses), /* harmony export */ "ix": () => (/* binding */ getChapterVerses), /* harmony export */ "lt": () => (/* binding */ getChapterAudioData), /* harmony export */ "m0": () => (/* binding */ getJuzVerses), /* harmony export */ "tS": () => (/* binding */ getAvailableReciters), /* harmony export */ "vp": () => (/* binding */ getRangeVerses), /* harmony export */ "yH": () => (/* binding */ OFFLINE_ERROR), /* harmony export */ "yZ": () => (/* binding */ getAvailableTranslations), /* harmony export */ "zg": () => (/* binding */ getChapterInfo), /* harmony export */ "zm": () => (/* binding */ getReciterData) /* harmony export */ }); /* unused harmony exports SEARCH_FETCH_OPTIONS, getAvailableWordByWordTranslations, getVerseTimestamps, getTranslationsInfo, getAdvancedCopyRawResult, getTafsirs, getChapter, getTafsirContent */ /* harmony import */ var humps__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(59606); /* harmony import */ var humps__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(humps__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _utils_apiPaths__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(46127); /* eslint-disable max-lines */ const SEARCH_FETCH_OPTIONS = { headers: { // eslint-disable-next-line @typescript-eslint/naming-convention "x-api-key": process.env.NEXT_PUBLIC_SEARCH_API_KEY } }; const OFFLINE_ERROR = "OFFLINE"; const fetcher = async function fetcher(input, init) { // if the user is not online when making the API call if (false) {} const res = await fetch(input, init); if (!res.ok || res.status === 500 || res.status === 404) { throw res; } const json = await res.json(); return (0,humps__WEBPACK_IMPORTED_MODULE_0__.camelizeKeys)(json); }; const getChapterVerses = async (id, locale, params)=>fetcher((0,_utils_apiPaths__WEBPACK_IMPORTED_MODULE_1__/* .makeVersesUrl */ .ML)(id, locale, params)); const getRangeVerses = async (locale, params)=>fetcher((0,_utils_apiPaths__WEBPACK_IMPORTED_MODULE_1__/* .makeByRangeVersesUrl */ .Eo)(locale, params)); /** * Get the current available translations with the name translated in the current language. * * @param {string} language we use this to get translated names of authors in specific the current language. * * @returns {Promise} */ const getAvailableTranslations = async (language)=>fetcher((0,_utils_apiPaths__WEBPACK_IMPORTED_MODULE_1__/* .makeTranslationsUrl */ .c7)(language)); /** * Get the current available wbw translations with the name translated in the current language. * * @param {string} language we use this to get translated names of authors in specific the current language. * * @returns {Promise} */ const getAvailableWordByWordTranslations = async (language)=>fetcher(makeWordByWordTranslationsUrl(language)); /** * Get the current available languages with the name translated in the current language. * * @param {string} language we use this to get language names in specific the current language. * * @returns {Promise} */ const getAvailableLanguages = async (language)=>fetcher((0,_utils_apiPaths__WEBPACK_IMPORTED_MODULE_1__/* .makeLanguagesUrl */ .G1)(language)); /** * Get list of available reciters. * * @param {string} locale the locale. * * @returns {Promise} */ const getAvailableReciters = async (locale, fields)=>fetcher((0,_utils_apiPaths__WEBPACK_IMPORTED_MODULE_1__/* .makeAvailableRecitersUrl */ .jL)(locale, fields)); const getReciterData = async (reciterId, locale)=>fetcher((0,_utils_apiPaths__WEBPACK_IMPORTED_MODULE_1__/* .makeReciterUrl */ .Sn)(reciterId, locale)); /** * Get audio file for a specific reciter and chapter. * additionally you can pass `segment: true` to get the timestamps * for each verse and words * * @param {number} reciterId * @param {number} chapter the id of the chapter */ const getChapterAudioData = async (reciterId, chapter, segments = false)=>{ const res = await fetcher((0,_utils_apiPaths__WEBPACK_IMPORTED_MODULE_1__/* .makeChapterAudioDataUrl */ .$6)(reciterId, chapter, segments)); if (res.error) { throw new Error(res.error); } if (res.status === 500) { throw new Error("server error: fail to get audio file"); } const { audioFiles: audioData } = res; const [firstAudio] = audioData; if (!firstAudio) { throw new Error("No audio file found"); } return { ...firstAudio, reciterId }; }; /** * Get the timestamps for a specific verseKey. * We need this to select to move the cursor in the audio player when we click "play" in a specific verse. * * @param {number} reciterId * @param {number} verseKey example "1:1", meaning chapter 1, verse 1 * @returns {Promise} */ const getVerseTimestamps = async (reciterId, verseKey)=>fetcher(makeAudioTimestampsUrl(reciterId, verseKey)); /** * Get the information of translations by their IDs. * * @param {string} locale the current user locale. * @param {number[]} translations the ids of the translations selected. * @returns {Promise} */ const getTranslationsInfo = async (locale, translations)=>fetcher(makeTranslationsInfoUrl(locale, translations)); /** * Get the advanced copy content that will be copied to clipboard and put in a file. * * @param {AdvancedCopyRequest} params * @returns {Promise} */ const getAdvancedCopyRawResult = async (params)=>fetcher(makeAdvancedCopyUrl(params)); /** * Get the search results of a query. * * @param {SearchRequest} params * @returns {Promise} */ const getSearchResults = async (params)=>fetcher((0,_utils_apiPaths__WEBPACK_IMPORTED_MODULE_1__/* .makeSearchResultsUrl */ ["do"])(params)); /** * Get the search results of a query. * * @param {SearchRequestParams} params * @returns {Promise} */ const getNewSearchResults = async (params)=>fetcher((0,_utils_apiPaths__WEBPACK_IMPORTED_MODULE_1__/* .makeNewSearchResultsUrl */ .UC)(params), SEARCH_FETCH_OPTIONS); /** * Get the list of tafsirs. * * @param {string} language * @returns {Promise} */ const getTafsirs = async (language)=>fetcher(makeTafsirsUrl(language)); /** * Get a chapter's info * * @param {string} chapterId * @param {string} language * @returns {Promise} */ const getChapterInfo = async (chapterId, language)=>fetcher((0,_utils_apiPaths__WEBPACK_IMPORTED_MODULE_1__/* .makeChapterInfoUrl */ .Iq)(chapterId, language)); /** * Get a chapter's. * * @param {string} chapterIdOrSlug * @param {string} language * @returns {Promise} */ const getChapter = async (chapterIdOrSlug, language)=>fetcher((0,_utils_apiPaths__WEBPACK_IMPORTED_MODULE_1__/* .makeChapterUrl */ .ME)(chapterIdOrSlug, language)); /** * Get the verses of a specific Juz. * * @param {string} id the ID of the Juz. * @param {string} locale the locale. * @param {string} params the params that we might need to include that differs from the default ones. * * @returns {Promise} */ const getJuzVerses = async (id, locale, params)=>fetcher((0,_utils_apiPaths__WEBPACK_IMPORTED_MODULE_1__/* .makeJuzVersesUrl */ .IC)(id, locale, params)); /** * Get the verses of a specific Rub El Hizb. * * @param {string} id the ID of the Rub El Hizb. * @param {string} locale the locale. * @param {string} params the params that we might need to include that differs from the default ones. * * @returns {Promise} */ const getRubVerses = async (id, locale, params)=>fetcher((0,_utils_apiPaths__WEBPACK_IMPORTED_MODULE_1__/* .makeRubVersesUrl */ .Im)(id, locale, params)); /** * Get the verses of a specific Hizb. * * @param {string} id the ID of the Hizb. * @param {string} locale the locale. * @param {string} params the params that we might need to include that differs from the default ones. * * @returns {Promise} */ const getHizbVerses = async (id, locale, params)=>fetcher((0,_utils_apiPaths__WEBPACK_IMPORTED_MODULE_1__/* .makeHizbVersesUrl */ .Y8)(id, locale, params)); /** * Get the verses of a specific page. * * @param {string} id the ID of the page. * @param {string} locale the locale. * @param {string} params the params that we might need to include that differs from the default ones. * * @returns {Promise} */ const getPageVerses = async (id, locale, params)=>fetcher((0,_utils_apiPaths__WEBPACK_IMPORTED_MODULE_1__/* .makePageVersesUrl */ .K2)(id, locale, params)); /** * Get the footnote details. * * @param {string} footnoteId the ID of the footnote. * * @returns {Promise} */ const getFootnote = async (footnoteId)=>fetcher((0,_utils_apiPaths__WEBPACK_IMPORTED_MODULE_1__/* .makeFootnoteUrl */ .OT)(footnoteId)); /** * Get the footnote details. * * @param {PagesLookUpRequest} params * * @returns {Promise} */ const getPagesLookup = async (params)=>fetcher((0,_utils_apiPaths__WEBPACK_IMPORTED_MODULE_1__/* .makePagesLookupUrl */ .I$)(params)); /** * Get the chapter id by a slug. * * @param {string} slug * @param {string} locale * @returns {Promise} */ const getChapterIdBySlug = async (slug, locale)=>{ try { const chapterResponse = await getChapter(encodeURI(slug), locale); return chapterResponse.chapter.id; } catch (error) { return false; } }; /** * Get the Tafsir content of a verse by the tafsir ID. * * @param {string} tafsirIdOrSlug * @param {string} verseKey * @param {QuranFont} quranFont * @param {MushafLines} mushafLines * @returns {Promise} */ const getTafsirContent = (tafsirIdOrSlug, verseKey, quranFont, mushafLines, locale)=>{ return fetcher(makeTafsirContentUrl(tafsirIdOrSlug, verseKey, { lang: locale, quranFont, mushafLines })); }; /***/ }), /***/ 92099: /***/ ((module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "analytics": () => (/* binding */ analytics), /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), /* harmony export */ "isFirebaseEnabled": () => (/* binding */ isFirebaseEnabled) /* harmony export */ }); /* harmony import */ var firebase_compat_app__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(33773); /* harmony import */ var firebase_compat_analytics__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(88813); var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([firebase_compat_app__WEBPACK_IMPORTED_MODULE_0__, firebase_compat_analytics__WEBPACK_IMPORTED_MODULE_1__]); ([firebase_compat_app__WEBPACK_IMPORTED_MODULE_0__, firebase_compat_analytics__WEBPACK_IMPORTED_MODULE_1__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__); const firebaseConfig = { apiKey: process.env.NEXT_PUBLIC_FS_API_KEY, authDomain: process.env.NEXT_PUBLIC_FS_AUTH_DOMAIN, projectId: process.env.NEXT_PUBLIC_FS_PROJECT_ID, storageBucket: process.env.NEXT_PUBLIC_FS_STORAGE_BUCKET, messagingSenderId: process.env.NEXT_PUBLIC_FS_MESSAGING_SENDER_ID, appId: process.env.NEXT_PUBLIC_FS_APP_ID, measurementId: process.env.NEXT_PUBLIC_FS_MEASUREMENT_ID }; const isFirebaseEnabled = false && 0; if (!firebase_compat_app__WEBPACK_IMPORTED_MODULE_0__["default"].apps.length) { firebase_compat_app__WEBPACK_IMPORTED_MODULE_0__["default"].initializeApp(firebaseConfig); } const analytics = ()=>{ if (isFirebaseEnabled) { return firebase_compat_app__WEBPACK_IMPORTED_MODULE_0__["default"].analytics(); } return null; }; /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (firebase_compat_app__WEBPACK_IMPORTED_MODULE_0__["default"]); __webpack_async_result__(); } catch(e) { __webpack_async_result__(e); } }); /***/ }), /***/ 11854: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "YS": () => (/* binding */ DEFAULT_RECITER), /* harmony export */ "ZP": () => (__WEBPACK_DEFAULT_EXPORT__), /* harmony export */ "hw": () => (/* binding */ DEFAULT_XSTATE_INITIAL_STATE), /* harmony export */ "j7": () => (/* binding */ DEFAULT_TAFSIRS) /* harmony export */ }); /* unused harmony export DEFAULT_TRANSLATIONS */ /* harmony import */ var _redux_types_SliceName__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(61243); /* harmony import */ var _redux_types_ThemeType__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(79265); /* harmony import */ var types_QuranReader__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(50467); // Tafsir Ibn Kathir in English const DEFAULT_TAFSIRS = [ "en-tafisr-ibn-kathir" ]; const DEFAULT_RECITER = { id: 7, name: "Mishari Rashid al-`Afasy", recitationStyle: "Warsh", relativePath: "mishaari_raashid_al_3afaasee" }; const TAFSIRS_INITIAL_STATE = { selectedTafsirs: DEFAULT_TAFSIRS, isUsingDefaultTafsirs: true }; const DEFAULT_TRANSLATIONS = [ 131 ]; // Dr. Mustafa Khattab, the Clear Quran const TRANSLATIONS_INITIAL_STATE = { selectedTranslations: DEFAULT_TRANSLATIONS, isUsingDefaultTranslations: true }; const QURAN_READER_STYLES_INITIAL_STATE = { // the base sizes in rem tafsirFontScale: 3, quranTextFontScale: 3, translationFontScale: 3, wordByWordFontScale: 3, quranFont: types_QuranReader__WEBPACK_IMPORTED_MODULE_2__/* .QuranFont.MadaniV1 */ .fr.MadaniV1, mushafLines: types_QuranReader__WEBPACK_IMPORTED_MODULE_2__/* .MushafLines.SixteenLines */ .AN.SixteenLines, isUsingDefaultFont: true }; const DEFAULT_WBW_LOCALE = "en"; const READING_PREFERENCES_INITIAL_STATE = { readingPreference: types_QuranReader__WEBPACK_IMPORTED_MODULE_2__/* .ReadingPreference.Translation */ .m3.Translation, selectedWordByWordLocale: DEFAULT_WBW_LOCALE, isUsingDefaultWordByWordLocale: true, wordByWordContentType: [ types_QuranReader__WEBPACK_IMPORTED_MODULE_2__/* .WordByWordType.Translation */ .Oj.Translation ], wordByWordDisplay: [ types_QuranReader__WEBPACK_IMPORTED_MODULE_2__/* .WordByWordDisplay.TOOLTIP */ .PT.TOOLTIP ], wordClickFunctionality: types_QuranReader__WEBPACK_IMPORTED_MODULE_2__/* .WordClickFunctionality.PlayAudio */ .MB.PlayAudio }; const THEME_INITIAL_STATE = { type: _redux_types_ThemeType__WEBPACK_IMPORTED_MODULE_1__/* ["default"].Auto */ .Z.Auto }; const AUDIO_INITIAL_STATE = { enableAutoScrolling: true, isDownloadingAudio: false, showTooltipWhenPlayingAudio: false }; const DEFAULT_XSTATE_INITIAL_STATE = { playbackRate: 1, reciterId: DEFAULT_RECITER.id, volume: 1 }; const NOTIFICATIONS_INITIAL_STATE = { notifications: [], paginatedNotifications: {}, isFetchingNotifications: false, isLoadingNotifications: false, unseenCount: 0 }; /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ [_redux_types_SliceName__WEBPACK_IMPORTED_MODULE_0__/* ["default"].THEME */ .Z.THEME]: THEME_INITIAL_STATE, [_redux_types_SliceName__WEBPACK_IMPORTED_MODULE_0__/* ["default"].READING_PREFERENCES */ .Z.READING_PREFERENCES]: READING_PREFERENCES_INITIAL_STATE, [_redux_types_SliceName__WEBPACK_IMPORTED_MODULE_0__/* ["default"].QURAN_READER_STYLES */ .Z.QURAN_READER_STYLES]: QURAN_READER_STYLES_INITIAL_STATE, [_redux_types_SliceName__WEBPACK_IMPORTED_MODULE_0__/* ["default"].TRANSLATIONS */ .Z.TRANSLATIONS]: TRANSLATIONS_INITIAL_STATE, [_redux_types_SliceName__WEBPACK_IMPORTED_MODULE_0__/* ["default"].TAFSIRS */ .Z.TAFSIRS]: TAFSIRS_INITIAL_STATE, [_redux_types_SliceName__WEBPACK_IMPORTED_MODULE_0__/* ["default"].AUDIO_PLAYER_STATE */ .Z.AUDIO_PLAYER_STATE]: AUDIO_INITIAL_STATE, [_redux_types_SliceName__WEBPACK_IMPORTED_MODULE_0__/* ["default"].NOTIFICATIONS */ .Z.NOTIFICATIONS]: NOTIFICATIONS_INITIAL_STATE }); /***/ }), /***/ 59875: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _defaultSettings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11854); /* harmony import */ var types_QuranReader__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(50467); const DEFAULT_TAFSIR = "ar-tafseer-al-qurtubi"; /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP, tafsirs: { ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].tafsirs */ .ZP.tafsirs, selectedTafsirs: [ DEFAULT_TAFSIR ] }, translations: { ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].translations */ .ZP.translations, selectedTranslations: [] }, readingPreferences: { ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].readingPreferences */ .ZP.readingPreferences, readingPreference: types_QuranReader__WEBPACK_IMPORTED_MODULE_1__/* .ReadingPreference.Reading */ .m3.Reading } }); /***/ }), /***/ 79395: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _defaultSettings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11854); /* harmony import */ var types_QuranReader__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(50467); const DEFAULT_TRANSLATION = 161; // Taisirul Quran const DEFAULT_TAFSIR = "bn-tafsir-ahsanul-bayaan"; // Tafsir Ahsanul Bayaan /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP, quranReaderStyles: { ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].quranReaderStyles */ .ZP.quranReaderStyles, quranFont: types_QuranReader__WEBPACK_IMPORTED_MODULE_1__/* .QuranFont.IndoPak */ .fr.IndoPak }, readingPreferences: { ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].readingPreferences */ .ZP.readingPreferences, selectedWordByWordLocale: "bn" }, tafsirs: { ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].tafsirs */ .ZP.tafsirs, selectedTafsirs: [ DEFAULT_TAFSIR ] }, translations: { ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].translations */ .ZP.translations, selectedTranslations: [ DEFAULT_TRANSLATION ] } }); /***/ }), /***/ 84835: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _defaultSettings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11854); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP); /***/ }), /***/ 15412: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _defaultSettings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11854); const DEFAULT_TRANSLATION = 29; // Hussein Taji /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP, translations: { ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].translations */ .ZP.translations, selectedTranslations: [ DEFAULT_TRANSLATION ] } }); /***/ }), /***/ 30823: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _defaultSettings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11854); const DEFAULT_TRANSLATION = 31; // Muhammad Hamidullah /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP, translations: { ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].translations */ .ZP.translations, selectedTranslations: [ DEFAULT_TRANSLATION ] } }); /***/ }), /***/ 41950: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _defaultSettings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11854); /* harmony import */ var types_QuranReader__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(50467); const DEFAULT_TRANSLATION = 33; // Indonesian Islamic affairs ministry /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP, readingPreferences: { ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].readingPreferences */ .ZP.readingPreferences, selectedWordByWordLocale: "id" }, quranReaderStyles: { ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].quranReaderStyles */ .ZP.quranReaderStyles, quranFont: types_QuranReader__WEBPACK_IMPORTED_MODULE_1__/* .QuranFont.IndoPak */ .fr.IndoPak }, translations: { ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].translations */ .ZP.translations, selectedTranslations: [ DEFAULT_TRANSLATION ] } }); /***/ }), /***/ 84443: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _defaultSettings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11854); const DEFAULT_TRANSLATION = 153; // Hamza Roberto Piccardo /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP, translations: { ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].translations */ .ZP.translations, selectedTranslations: [ DEFAULT_TRANSLATION ] } }); /***/ }), /***/ 38195: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _defaultSettings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11854); const DEFAULT_TRANSLATION = 39; // Abdullah Muhammad Basmeih /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP, translations: { ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].translations */ .ZP.translations, selectedTranslations: [ DEFAULT_TRANSLATION ] } }); /***/ }), /***/ 10024: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _defaultSettings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11854); const DEFAULT_TRANSLATION = 144; // Sofian S. Siregar /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP, translations: { ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].translations */ .ZP.translations, selectedTranslations: [ DEFAULT_TRANSLATION ] } }); /***/ }), /***/ 80563: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _defaultSettings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11854); const DEFAULT_TRANSLATION = 43; // Samir /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP, translations: { ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].translations */ .ZP.translations, selectedTranslations: [ DEFAULT_TRANSLATION ] } }); /***/ }), /***/ 23269: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _defaultSettings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11854); const DEFAULT_TRANSLATION = 45; // Elmir Kuliev const DEFAULT_TAFSIR = "ru-tafseer-al-saddi"; // Russian Tafseer Al Saddi /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP, translations: { ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].translations */ .ZP.translations, selectedTranslations: [ DEFAULT_TRANSLATION ] }, tafsirs: { ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].tafsirs */ .ZP.tafsirs, selectedTafsirs: [ DEFAULT_TAFSIR ] } }); /***/ }), /***/ 12586: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _defaultSettings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11854); const DEFAULT_TRANSLATION = 47; // Albanian /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP, translations: { ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].translations */ .ZP.translations, selectedTranslations: [ DEFAULT_TRANSLATION ] } }); /***/ }), /***/ 43222: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _defaultSettings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11854); const DEFAULT_TRANSLATION = 230; // Society of Institutes and Universities /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP, translations: { ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].translations */ .ZP.translations, selectedTranslations: [ DEFAULT_TRANSLATION ] } }); /***/ }), /***/ 79896: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _defaultSettings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11854); const DEFAULT_TRANSLATION = 77; // Diyanet /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP, translations: { ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].translations */ .ZP.translations, selectedTranslations: [ DEFAULT_TRANSLATION ] } }); /***/ }), /***/ 80046: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _defaultSettings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11854); /* harmony import */ var types_QuranReader__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(50467); const DEFAULT_TRANSLATION = 158; // Bayan Ul Quran const DEFAULT_TAFSIR = "tafseer-ibn-e-kaseer-urdu"; // Bayan ul Quran /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP, quranReaderStyles: { ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].quranReaderStyles */ .ZP.quranReaderStyles, quranFont: types_QuranReader__WEBPACK_IMPORTED_MODULE_1__/* .QuranFont.IndoPak */ .fr.IndoPak }, readingPreferences: { ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].readingPreferences */ .ZP.readingPreferences, selectedWordByWordLocale: "ur" }, translations: { ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].translations */ .ZP.translations, selectedTranslations: [ DEFAULT_TRANSLATION ] }, tafsirs: { ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].tafsirs */ .ZP.tafsirs, selectedTafsirs: [ DEFAULT_TAFSIR ] } }); /***/ }), /***/ 5492: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _defaultSettings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11854); const DEFAULT_TRANSLATION = 56; // Ma Jain /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP, translations: { ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].translations */ .ZP.translations, selectedTranslations: [ DEFAULT_TRANSLATION ] } }); /***/ }), /***/ 17241: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "$t": () => (/* binding */ getNotificationsInitialState), /* harmony export */ "Fy": () => (/* binding */ getTafsirsInitialState), /* harmony export */ "aq": () => (/* binding */ getAudioPlayerStateInitialState), /* harmony export */ "h0": () => (/* binding */ getTranslationsInitialState), /* harmony export */ "iF": () => (/* binding */ getLocaleInitialState), /* harmony export */ "kq": () => (/* binding */ getQuranReaderStylesInitialState), /* harmony export */ "r2": () => (/* binding */ getStoreInitialState), /* harmony export */ "wH": () => (/* binding */ getReadingPreferencesInitialState), /* harmony export */ "yO": () => (/* binding */ getThemeInitialState) /* harmony export */ }); /* harmony import */ var _redux_types_SliceName__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(61243); /* eslint-disable import/no-dynamic-require */ /* eslint-disable @typescript-eslint/no-var-requires */ /* eslint-disable global-require */ /** * Get the initial state of the store. * * @param {string} locale * @returns {RootState} */ const getStoreInitialState = (locale)=>{ return { [_redux_types_SliceName__WEBPACK_IMPORTED_MODULE_0__/* ["default"].THEME */ .Z.THEME]: getThemeInitialState(locale), [_redux_types_SliceName__WEBPACK_IMPORTED_MODULE_0__/* ["default"].READING_PREFERENCES */ .Z.READING_PREFERENCES]: getReadingPreferencesInitialState(locale), [_redux_types_SliceName__WEBPACK_IMPORTED_MODULE_0__/* ["default"].QURAN_READER_STYLES */ .Z.QURAN_READER_STYLES]: getQuranReaderStylesInitialState(locale), [_redux_types_SliceName__WEBPACK_IMPORTED_MODULE_0__/* ["default"].TRANSLATIONS */ .Z.TRANSLATIONS]: getTranslationsInitialState(locale), [_redux_types_SliceName__WEBPACK_IMPORTED_MODULE_0__/* ["default"].TAFSIRS */ .Z.TAFSIRS]: getTafsirsInitialState(locale), // @ts-ignore [_redux_types_SliceName__WEBPACK_IMPORTED_MODULE_0__/* ["default"].AUDIO_PLAYER_STATE */ .Z.AUDIO_PLAYER_STATE]: getAudioPlayerStateInitialState(locale), [_redux_types_SliceName__WEBPACK_IMPORTED_MODULE_0__/* ["default"].DEFAULT_SETTINGS */ .Z.DEFAULT_SETTINGS]: { isUsingDefaultSettings: true }, [_redux_types_SliceName__WEBPACK_IMPORTED_MODULE_0__/* ["default"].NOTIFICATIONS */ .Z.NOTIFICATIONS]: getNotificationsInitialState(locale) }; }; const DEFAULT_LOCALE = "en"; /** * Dynamically load the default settings of the locale passed. * * @param {string} locale * @returns {DefaultSettings} */ const importLocaleFile = (locale)=>__webpack_require__(70301)(`./${locale}`).default; /** * Get specific settings by its key for a locale. * e.g. get the settings for theme by the key 'theme'. * * @param {string} locale * @param {string} key * @returns {any} */ const getLocaleInitialStateByKey = (locale, key)=>importLocaleFile(locale)[key]; const getLocaleInitialState = (locale)=>importLocaleFile(locale); const getThemeInitialState = (locale = DEFAULT_LOCALE)=>{ return getLocaleInitialStateByKey(locale, _redux_types_SliceName__WEBPACK_IMPORTED_MODULE_0__/* ["default"].THEME */ .Z.THEME); }; const getReadingPreferencesInitialState = (locale = DEFAULT_LOCALE)=>{ return getLocaleInitialStateByKey(locale, _redux_types_SliceName__WEBPACK_IMPORTED_MODULE_0__/* ["default"].READING_PREFERENCES */ .Z.READING_PREFERENCES); }; const getQuranReaderStylesInitialState = (locale = DEFAULT_LOCALE)=>{ return getLocaleInitialStateByKey(locale, _redux_types_SliceName__WEBPACK_IMPORTED_MODULE_0__/* ["default"].QURAN_READER_STYLES */ .Z.QURAN_READER_STYLES); }; const getTranslationsInitialState = (locale = DEFAULT_LOCALE)=>{ return getLocaleInitialStateByKey(locale, _redux_types_SliceName__WEBPACK_IMPORTED_MODULE_0__/* ["default"].TRANSLATIONS */ .Z.TRANSLATIONS); }; const getTafsirsInitialState = (locale = DEFAULT_LOCALE)=>{ return getLocaleInitialStateByKey(locale, _redux_types_SliceName__WEBPACK_IMPORTED_MODULE_0__/* ["default"].TAFSIRS */ .Z.TAFSIRS); }; const getAudioPlayerStateInitialState = (locale = DEFAULT_LOCALE)=>{ return getLocaleInitialStateByKey(locale, _redux_types_SliceName__WEBPACK_IMPORTED_MODULE_0__/* ["default"].AUDIO_PLAYER_STATE */ .Z.AUDIO_PLAYER_STATE); }; const getNotificationsInitialState = (locale = DEFAULT_LOCALE)=>{ return getLocaleInitialStateByKey(locale, _redux_types_SliceName__WEBPACK_IMPORTED_MODULE_0__/* ["default"].NOTIFICATIONS */ .Z.NOTIFICATIONS); }; /***/ }), /***/ 85895: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "ZP": () => (__WEBPACK_DEFAULT_EXPORT__), /* harmony export */ "ag": () => (/* binding */ selectSearchHistory), /* harmony export */ "rd": () => (/* binding */ removeSearchHistoryRecord), /* harmony export */ "zr": () => (/* binding */ addSearchHistoryRecord) /* harmony export */ }); /* unused harmony export searchSlice */ /* harmony import */ var _reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(75184); /* harmony import */ var _reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _redux_types_SliceName__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(61243); const initialState = { searchHistory: [] }; const MAXIMUM_RECENT_SEARCH_QUERIES = 5; const searchSlice = (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_0__.createSlice)({ name: _redux_types_SliceName__WEBPACK_IMPORTED_MODULE_1__/* ["default"].SEARCH */ .Z.SEARCH, initialState, reducers: { addSearchHistoryRecord: (state, action)=>{ let newSearchHistory = [ ...state.searchHistory ]; const newSearchQuery = action.payload; // if we have reached the maximum number of search queries, remove the last element if (state.searchHistory.length >= MAXIMUM_RECENT_SEARCH_QUERIES) { // splice will mutate newSearchHistory and remove the last element newSearchHistory.splice(-1); } // filter out the old search queries that match the new search queries (if any). newSearchHistory = newSearchHistory.filter((currentSearchQuery)=>currentSearchQuery !== newSearchQuery); // put the new search query at the beginning of the array newSearchHistory = [ newSearchQuery, ...newSearchHistory ]; return { ...state, searchHistory: newSearchHistory }; }, removeSearchHistoryRecord: (state, action)=>{ // filter out the search queries from the current search queries array. const newSearchHistory = [ ...state.searchHistory ].filter((currentSearchQuery)=>currentSearchQuery !== action.payload); return { ...state, searchHistory: newSearchHistory }; } } }); const { addSearchHistoryRecord , removeSearchHistoryRecord } = searchSlice.actions; const selectSearchHistory = (state)=>state.search.searchHistory; /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (searchSlice.reducer); /***/ }), /***/ 61243: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); var SliceName; (function(SliceName) { SliceName["THEME"] = "theme"; SliceName["READING_PREFERENCES"] = "readingPreferences"; SliceName["QURAN_READER_STYLES"] = "quranReaderStyles"; SliceName["TRANSLATIONS"] = "translations"; SliceName["TAFSIRS"] = "tafsirs"; SliceName["AUDIO_PLAYER_STATE"] = "audioPlayerState"; SliceName["DEFAULT_SETTINGS"] = "defaultSettings"; SliceName["BANNER"] = "banner"; SliceName["NAVBAR"] = "navbar"; SliceName["SESSION"] = "session"; SliceName["BOOKMARKS"] = "bookmarks"; SliceName["VOICE_SEARCH"] = "voiceSearch"; SliceName["WELCOME_MESSAGE"] = "welcomeMessage"; SliceName["COMMAND_BAR"] = "commandBar"; SliceName["CONTEXT_MENU"] = "contextMenu"; SliceName["FONT_FACES"] = "fontFaces"; SliceName["NOTES"] = "notes"; SliceName["READING_TRACKER"] = "readingTracker"; SliceName["READING_VIEW_HOVERED_VERSE"] = "readingViewHoveredVerse"; SliceName["SIDEBAR_NAVIGATION"] = "sidebarNavigation"; SliceName["SEARCH"] = "search"; SliceName["LOCALE"] = "locale"; SliceName["USER_DATA_SYNC"] = "userDataSync"; SliceName["PERSIST_GATE_HYDRATION"] = "persistGateHydration"; SliceName["REVELATION_ORDER"] = "revelationOrder"; SliceName["NOTIFICATIONS"] = "notifications"; SliceName["ONBOARDING"] = "onboarding"; })(SliceName || (SliceName = {})); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SliceName); /***/ }), /***/ 79265: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); var ThemeType; (function(ThemeType) { ThemeType["Auto"] = "auto"; ThemeType["Light"] = "light"; ThemeType["Sepia"] = "sepia"; ThemeType["Dark"] = "dark"; })(ThemeType || (ThemeType = {})); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ThemeType); /***/ }), /***/ 4917: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "$P": () => (/* binding */ getMushafId), /* harmony export */ "H": () => (/* binding */ API_HOST), /* harmony export */ "bf": () => (/* binding */ makeUrl), /* harmony export */ "gK": () => (/* binding */ ITEMS_PER_PAGE), /* harmony export */ "hD": () => (/* binding */ getDefaultWordFields) /* harmony export */ }); /* harmony import */ var humps__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(59606); /* harmony import */ var humps__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(humps__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _qs_stringify__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(99921); /* harmony import */ var types_QuranReader__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(50467); const ITEMS_PER_PAGE = 10; const STAGING_API_HOST = "https://staging.quran.com"; const PRODUCTION_API_HOST = "https://api.qurancdn.com"; const API_ROOT_PATH = "/api/qdc"; // env variables in Vercel can't be dynamic, we have to hardcode the urls here. https://stackoverflow.com/questions/44342226/next-js-error-only-absolute-urls-are-supported const API_HOST = process.env.NEXT_PUBLIC_VERCEL_ENV === "production" ? PRODUCTION_API_HOST : STAGING_API_HOST; /** * Generates a url to make an api call to our backend * * @param {string} path the path for the call * @param {Record} parameters optional query params, {a: 1, b: 2} is parsed to "?a=1&b=2" * @returns {string} */ const makeUrl = (path, parameters)=>{ if (!parameters) { return `${API_HOST}${API_ROOT_PATH}${path}`; } const decamelizedParams = (0,humps__WEBPACK_IMPORTED_MODULE_0__.decamelizeKeys)(parameters); // The following section parses the query params for convenience // E.g. parses {a: 1, b: 2} to "?a=1&b=2" const queryParameters = `?${(0,_qs_stringify__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z)(decamelizedParams)}`; return `${API_HOST}${API_ROOT_PATH}${path}${queryParameters}`; }; /** * Get the default word fields that should exist in the response. * qpc_uthmani_hafs is added so that we can use it as a fallback * text for QCF font V1 and V2. * * @param {QuranFont} quranFont the selected quran font since. * @returns {{ wordFields: string}} * */ const getDefaultWordFields = (quranFont = types_QuranReader__WEBPACK_IMPORTED_MODULE_2__/* .QuranFont.QPCHafs */ .fr.QPCHafs)=>({ wordFields: `verse_key,verse_id,page_number,location,text_uthmani,${quranFont}${quranFont === types_QuranReader__WEBPACK_IMPORTED_MODULE_2__/* .QuranFont.QPCHafs */ .fr.QPCHafs ? "" : `,${types_QuranReader__WEBPACK_IMPORTED_MODULE_2__/* .QuranFont.QPCHafs */ .fr.QPCHafs}`}` }); /** * Get the mushaf id based on the value inside redux (if it's not SSR). * * @param {QuranFont} quranFont * @param {MushafLines} mushafLines * @returns {{mushaf: Mushaf}} */ const getMushafId = (// eslint-disable-next-line default-param-last quranFont = types_QuranReader__WEBPACK_IMPORTED_MODULE_2__/* .QuranFont.QPCHafs */ .fr.QPCHafs, mushafLines)=>{ let mushaf = types_QuranReader__WEBPACK_IMPORTED_MODULE_2__/* .QuranFontMushaf */ .ru[quranFont]; // convert the Indopak mushaf to either 15 or 16 lines Mushaf if (quranFont === types_QuranReader__WEBPACK_IMPORTED_MODULE_2__/* .QuranFont.IndoPak */ .fr.IndoPak && mushafLines) { mushaf = mushafLines === types_QuranReader__WEBPACK_IMPORTED_MODULE_2__/* .MushafLines.FifteenLines */ .AN.FifteenLines ? types_QuranReader__WEBPACK_IMPORTED_MODULE_2__/* .Mushaf.Indopak15Lines */ .RA.Indopak15Lines : types_QuranReader__WEBPACK_IMPORTED_MODULE_2__/* .Mushaf.Indopak16Lines */ .RA.Indopak16Lines; } return { mushaf }; }; /***/ }), /***/ 46127: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "$6": () => (/* binding */ makeChapterAudioDataUrl), /* harmony export */ "A9": () => (/* binding */ makeTafsirsUrl), /* harmony export */ "Eo": () => (/* binding */ makeByRangeVersesUrl), /* harmony export */ "G1": () => (/* binding */ makeLanguagesUrl), /* harmony export */ "I$": () => (/* binding */ makePagesLookupUrl), /* harmony export */ "IC": () => (/* binding */ makeJuzVersesUrl), /* harmony export */ "Im": () => (/* binding */ makeRubVersesUrl), /* harmony export */ "Iq": () => (/* binding */ makeChapterInfoUrl), /* harmony export */ "K2": () => (/* binding */ makePageVersesUrl), /* harmony export */ "ME": () => (/* binding */ makeChapterUrl), /* harmony export */ "ML": () => (/* binding */ makeVersesUrl), /* harmony export */ "OT": () => (/* binding */ makeFootnoteUrl), /* harmony export */ "Sn": () => (/* binding */ makeReciterUrl), /* harmony export */ "UC": () => (/* binding */ makeNewSearchResultsUrl), /* harmony export */ "Wq": () => (/* binding */ makeVersesFilterUrl), /* harmony export */ "Wy": () => (/* binding */ makeTafsirContentUrl), /* harmony export */ "Y8": () => (/* binding */ makeHizbVersesUrl), /* harmony export */ "c7": () => (/* binding */ makeTranslationsUrl), /* harmony export */ "do": () => (/* binding */ makeSearchResultsUrl), /* harmony export */ "jL": () => (/* binding */ makeAvailableRecitersUrl), /* harmony export */ "v2": () => (/* binding */ makeByVerseKeyUrl) /* harmony export */ }); /* unused harmony exports DEFAULT_VERSES_PARAMS, makeWordByWordTranslationsUrl, makeAudioTimestampsUrl, makeTranslationsInfoUrl, makeAdvancedCopyUrl, makeNewSearchApiUrl, makeNavigationSearchUrl, makeDonateUrl, makeDonatePageUrl */ /* harmony import */ var humps__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(59606); /* harmony import */ var humps__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(humps__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _api__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4917); /* harmony import */ var _qs_stringify__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(99921); /* harmony import */ var _redux_defaultSettings_defaultSettings__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(11854); /* harmony import */ var _redux_defaultSettings_util__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(17241); /* harmony import */ var types_QuranReader__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(50467); const DEFAULT_VERSES_PARAMS = { words: true, translationFields: "resource_name,language_id", perPage: _api__WEBPACK_IMPORTED_MODULE_1__/* .ITEMS_PER_PAGE */ .gK, fields: `${types_QuranReader__WEBPACK_IMPORTED_MODULE_5__/* .QuranFont.Uthmani */ .fr.Uthmani},chapter_id,hizb_number,text_imlaei_simple` }; /** * Use the default params and allow overriding the default values e.g. translations. * * @param {string} currentLocale * @param {Record} params * @param {boolean} includeTranslationFields * @returns {Record} */ const getVersesParams = (currentLocale, params, includeTranslationFields = true)=>{ const defaultParams = { ...DEFAULT_VERSES_PARAMS, translations: (0,_redux_defaultSettings_util__WEBPACK_IMPORTED_MODULE_4__/* .getTranslationsInitialState */ .h0)(currentLocale).selectedTranslations.join(", "), reciter: _redux_defaultSettings_defaultSettings__WEBPACK_IMPORTED_MODULE_3__/* .DEFAULT_RECITER.id */ .YS.id, wordTranslationLanguage: (0,_redux_defaultSettings_util__WEBPACK_IMPORTED_MODULE_4__/* .getReadingPreferencesInitialState */ .wH)(currentLocale).selectedWordByWordLocale }; if (!includeTranslationFields) { delete defaultParams.translationFields; delete defaultParams.translations; } return { ...defaultParams, ...params }; }; const makeVersesUrl = (id, currentLocale, params)=>(0,_api__WEBPACK_IMPORTED_MODULE_1__/* .makeUrl */ .bf)(`/verses/by_chapter/${id}`, getVersesParams(currentLocale, params)); const makeByRangeVersesUrl = (currentLocale, params)=>(0,_api__WEBPACK_IMPORTED_MODULE_1__/* .makeUrl */ .bf)(`/verses/by_range`, getVersesParams(currentLocale, params)); const makeVersesFilterUrl = (params)=>(0,_api__WEBPACK_IMPORTED_MODULE_1__/* .makeUrl */ .bf)(`/verses/filter`, { ...params }); /** * Compose the url for the translations API. * * @param {string} language * @returns {string} */ const makeTranslationsUrl = (language)=>(0,_api__WEBPACK_IMPORTED_MODULE_1__/* .makeUrl */ .bf)("/resources/translations", { language }); /** * Compose the url for the wbw translations API. * * @param {string} language * @returns {string} */ const makeWordByWordTranslationsUrl = (language)=>makeUrl("/resources/word_by_word_translations", { language }); /** * Compose the url for the languages API. * * @param {string} language * @returns {string} */ const makeLanguagesUrl = (language)=>(0,_api__WEBPACK_IMPORTED_MODULE_1__/* .makeUrl */ .bf)("/resources/languages", { language }); /** * Compose the url for reciters API. * * @param {string} locale the user's language code. * @returns {string} */ const makeAvailableRecitersUrl = (locale, fields)=>(0,_api__WEBPACK_IMPORTED_MODULE_1__/* .makeUrl */ .bf)("/audio/reciters", { locale, fields }); const makeReciterUrl = (reciterId, locale)=>(0,_api__WEBPACK_IMPORTED_MODULE_1__/* .makeUrl */ .bf)(`/audio/reciters/${reciterId}`, { locale, fields: [ "profile_picture", "cover_image", "bio" ] }); /** * Compose the url of the audio file of a surah. * * @param {number} reciterId id of reciter * @param {number} chapter the surah number. * @param {boolean} segments include segments info * * @returns {string} */ const makeChapterAudioDataUrl = (reciterId, chapter, segments)=>(0,_api__WEBPACK_IMPORTED_MODULE_1__/* .makeUrl */ .bf)(`/audio/reciters/${reciterId}/audio_files`, { chapter, segments }); const makeAudioTimestampsUrl = (reciterId, verseKey)=>makeUrl(`/audio/reciters/${reciterId}/timestamp?verse_key=${verseKey}`); /** * Compose the url for the translations' filter API. * * @param {string} locale the user's language code. * @param {number[]} translations an array holding the translations' IDs. * @returns {string} */ const makeTranslationsInfoUrl = (locale, translations)=>makeUrl("/resources/translations/filter", { locale, translations: translations.join(", ") }); /** * Compose the url for the advanced copy API. * * @param {AdvancedCopyRequest} params the request params. * @returns {string} */ const makeAdvancedCopyUrl = (params)=>makeUrl("/verses/advanced_copy", params); /** * Compose the url for search API. * * @param {SearchRequest} params the request params. * @returns {string} */ const makeSearchResultsUrl = (params)=>(0,_api__WEBPACK_IMPORTED_MODULE_1__/* .makeUrl */ .bf)("/search", params); const makeNewSearchApiUrl = (params)=>{ const baseUrl = process.env.NEXT_PUBLIC_SEARCH_BASE_URL; return `${baseUrl}/v1/search?${(0,_qs_stringify__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z)((0,humps__WEBPACK_IMPORTED_MODULE_0__.decamelizeKeys)(params))}`; }; const makeNewSearchResultsUrl = (params)=>makeNewSearchApiUrl(params); /** * Compose the url for the navigation search API that is used to show results inside the command bar. * * @param {string} query the request params. * @returns {string} */ const makeNavigationSearchUrl = (query)=>makeUrl("/navigate", { query }); /** * Compose the url for the tafsirs API. * * @param {string} language the user's language code. * @returns {string} */ const makeTafsirsUrl = (language)=>(0,_api__WEBPACK_IMPORTED_MODULE_1__/* .makeUrl */ .bf)("/resources/tafsirs", { language }); const makeTafsirContentUrl = (tafsirId, verseKey, options)=>{ const params = { locale: options.lang, words: true, ...(0,_api__WEBPACK_IMPORTED_MODULE_1__/* .getDefaultWordFields */ .hD)(options.quranFont), ...(0,_api__WEBPACK_IMPORTED_MODULE_1__/* .getMushafId */ .$P)(options.quranFont, options.mushafLines) }; return (0,_api__WEBPACK_IMPORTED_MODULE_1__/* .makeUrl */ .bf)(`/tafsirs/${tafsirId}/by_ayah/${verseKey}`, params); }; /** * Compose the url for the pages look up API. * * @param {PagesLookUpRequest} params * @returns {string} */ const makePagesLookupUrl = (params)=>(0,_api__WEBPACK_IMPORTED_MODULE_1__/* .makeUrl */ .bf)("/pages/lookup", params); /** * Compose the url for the chapter's info API. * * @param {string} chapterId the chapter Id. * @param {string} language the user's language code. * @returns {string} */ const makeChapterInfoUrl = (chapterId, language)=>(0,_api__WEBPACK_IMPORTED_MODULE_1__/* .makeUrl */ .bf)(`/chapters/${chapterId}/info`, { language }); /** * Compose the url for the chapter's API. * * @param {string} chapterIdOrSlug the chapter Id or the slug. * @param {string} language the user's language code. * @returns {string} */ const makeChapterUrl = (chapterIdOrSlug, language)=>(0,_api__WEBPACK_IMPORTED_MODULE_1__/* .makeUrl */ .bf)(`/chapters/${chapterIdOrSlug}`, { language }); /** * Compose the url for Juz's verses API. * * @param {string} id the Id of the juz. * @param {string} currentLocale the locale. * @param {Record} params in-case we need to over-ride the default params. * @returns {string} */ const makeJuzVersesUrl = (id, currentLocale, params)=>(0,_api__WEBPACK_IMPORTED_MODULE_1__/* .makeUrl */ .bf)(`/verses/by_juz/${id}`, getVersesParams(currentLocale, params)); /** * Compose the url for Rub el Hizb's verses API. * * @param {string} id the Id of the Rub el Hizb. * @param {string} currentLocale the locale. * @param {Record} params in-case we need to over-ride the default params. * @returns {string} */ const makeRubVersesUrl = (id, currentLocale, params)=>(0,_api__WEBPACK_IMPORTED_MODULE_1__/* .makeUrl */ .bf)(`/verses/by_rub_el_hizb/${id}`, getVersesParams(currentLocale, params)); /** * Compose the url for Hizb's verses API. * * @param {string} id the Id of the hizb. * @param {string} currentLocale the locale. * @param {Record} params in-case we need to over-ride the default params. * @returns {string} */ const makeHizbVersesUrl = (id, currentLocale, params)=>(0,_api__WEBPACK_IMPORTED_MODULE_1__/* .makeUrl */ .bf)(`/verses/by_hizb/${id}`, getVersesParams(currentLocale, params)); /** * Compose the url for by verse key API. * * @param {string} verseKey the Id of the juz. * @param {Record} params in-case we need to over-ride the default params. * @returns {string} */ const makeByVerseKeyUrl = (verseKey, params)=>(0,_api__WEBPACK_IMPORTED_MODULE_1__/* .makeUrl */ .bf)(`/verses/by_key/${verseKey}`, params); /** * Compose the url for page's verses API. * * @param {string} id the Id of the page. * @param {string} currentLocale the locale. * @param {Record} params in-case we need to over-ride the default params. * @param {boolean} includeTranslationFields * @returns {string} */ const makePageVersesUrl = (id, currentLocale, params, includeTranslationFields = true)=>(0,_api__WEBPACK_IMPORTED_MODULE_1__/* .makeUrl */ .bf)(`/verses/by_page/${id}`, getVersesParams(currentLocale, params, includeTranslationFields)); /** * Compose the url for footnote's API. * * @param {string} footnoteId * @returns {string} */ const makeFootnoteUrl = (footnoteId)=>(0,_api__WEBPACK_IMPORTED_MODULE_1__/* .makeUrl */ .bf)(`/foot_notes/${footnoteId}`); const makeDonateUrl = (showDonationPopup = false)=>`https://donate.quran.foundation${showDonationPopup ? "?showDonationPopup" : ""}`; // eslint-disable-next-line @typescript-eslint/no-unused-vars const makeDonatePageUrl = (isOnce = true, shouldUseProviderUrl = false)=>{ if (shouldUseProviderUrl) { return `https://give.quran.foundation/give/${isOnce ? 482507 : 474400}/#!/donation/checkout`; } return makeDonateUrl(); }; /***/ }), /***/ 95892: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "T4": () => (/* binding */ getAllChaptersData), /* harmony export */ "_L": () => (/* binding */ getChapterReadingProgress), /* harmony export */ "dy": () => (/* binding */ getChapterData), /* harmony export */ "it": () => (/* binding */ getChapterIdsForJuz), /* harmony export */ "op": () => (/* binding */ getChapterIdsForPage) /* harmony export */ }); /* unused harmony exports getAllJuzMappings, getChapterAndVerseMappingForJuz, isFirstSurah, isLastSurah, QURAN_CHAPTERS_COUNT, getRandomChapterId */ /* harmony import */ var lodash_random__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(35526); /* harmony import */ var lodash_random__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_random__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _number__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(19303); /* eslint-disable @typescript-eslint/no-var-requires */ /* eslint-disable global-require */ const DEFAULT_LANGUAGE = "en"; const SUPPORTED_CHAPTER_LOCALES = [ "en", "ar", "bn", "fr", "id", "it", "nl", "ru", "tr", "ur", "zh", ]; /** * Get chapters data from the json file, by language * * @param {string} lang * @returns {Promise>} chapter */ const getAllChaptersData = (lang = DEFAULT_LANGUAGE)=>{ if (SUPPORTED_CHAPTER_LOCALES.includes(lang)) { return new Promise((res)=>{ __webpack_require__(62182)(`./${lang}.json`).then((data)=>{ res(data.default); }); }); } return new Promise((res)=>{ __webpack_require__.e(/* import() */ 69029).then(__webpack_require__.t.bind(__webpack_require__, 69029, 19)).then((data)=>{ // @ts-ignore res(data.default); }); }); }; /** * Get chapter data by id from the json file * * @param {ChaptersData} chapters * @param {string} id * @returns {Chapter} chapter */ const getChapterData = (chapters, id)=>chapters[(0,_number__WEBPACK_IMPORTED_MODULE_1__/* .formatStringNumber */ .XK)(id)]; /** * Given a pageId, get chapter ids from a json file * * @param {string} pageId * @returns {Promise} chapterIds */ const getChapterIdsForPage = (pageId)=>{ return new Promise((res)=>{ __webpack_require__.e(/* import() */ 80370).then(__webpack_require__.t.bind(__webpack_require__, 80370, 19)).then((data)=>{ res(data.default[pageId]); }); }); }; /** * Given a juzId, get chapters ids from a json file * * @param {string} juzId * @returns {string[]} chapterIds */ const getChapterIdsForJuz = async (juzId)=>{ return new Promise((res)=>{ __webpack_require__.e(/* import() */ 19535).then(__webpack_require__.t.bind(__webpack_require__, 19535, 19)).then((data)=>{ res(data.default[juzId]); }); }); }; /** * get ChapterAndVerseMapping for all juzs * * @returns {[juz: string]: ChapterAndVerseMapping} */ const getAllJuzMappings = ()=>{ return new Promise((res)=>{ __webpack_require__.e(/* import() */ 92447).then(__webpack_require__.t.bind(__webpack_require__, 92447, 19)).then((data)=>{ res(data.default); }); }); }; /** * Given a juzId get a chapter + verse mapping for this juz * * @param {string} juzId * @returns {[chapter: string]: string} * * original data source: https://api.quran.com/api/v4/juzs * * Example: * getChapterAndVerseMappingForJuz("1") // { "1": "1-7", "2" : "1-141"} * -> juz "1" contains chapter "1" with verse "1-7" and chapter "2" with verse "1-141" * */ const getChapterAndVerseMappingForJuz = async (juzId)=>{ const juzVerseMapping = await getAllJuzMappings(); return juzVerseMapping[juzId]; }; /** * Whether the current surah is the first surah. * * @param {number} surahNumber * @param {boolean} isReadingByRevelationOrder * @returns {boolean} */ const isFirstSurah = (surahNumber, isReadingByRevelationOrder)=>{ if (!isReadingByRevelationOrder) return surahNumber === 1; return REVELATION_ORDER[0] === surahNumber; }; /** * Whether the current surah is the last surah. * * @param {number} surahNumber * @param {boolean} isReadingByRevelationOrder * @returns {boolean} */ const isLastSurah = (surahNumber, isReadingByRevelationOrder)=>{ if (!isReadingByRevelationOrder) return surahNumber === 114; return REVELATION_ORDER[REVELATION_ORDER.length - 1] === surahNumber; }; /** * Get how much percentage of the chapter has been read. * * @param {number} currentVerse * @param {number} totalNumberOfVerses * @returns {number} */ const getChapterReadingProgress = (currentVerse, totalNumberOfVerses)=>Math.ceil(currentVerse * 100 / totalNumberOfVerses); const QURAN_CHAPTERS_COUNT = 114; const getRandomChapterId = ()=>{ return random(1, QURAN_CHAPTERS_COUNT); }; /***/ }), /***/ 55943: /***/ ((module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try { /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "An": () => (/* binding */ logCarouselSlideCompletion), /* harmony export */ "Dy": () => (/* binding */ logEmptySearchResults), /* harmony export */ "Io": () => (/* binding */ logTarteelLinkClick), /* harmony export */ "Kz": () => (/* binding */ logEvent), /* harmony export */ "MY": () => (/* binding */ logButtonClick), /* harmony export */ "Q8": () => (/* binding */ logValueChange), /* harmony export */ "dz": () => (/* binding */ logFormSubmission), /* harmony export */ "qS": () => (/* binding */ logSearchResults), /* harmony export */ "tL": () => (/* binding */ logTextSearchQuery), /* harmony export */ "u8": () => (/* binding */ logItemSelectionChange) /* harmony export */ }); /* harmony import */ var _types_SearchType__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73634); /* harmony import */ var src_lib_firebase__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(92099); var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([src_lib_firebase__WEBPACK_IMPORTED_MODULE_1__]); src_lib_firebase__WEBPACK_IMPORTED_MODULE_1__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0]; /* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable @typescript-eslint/naming-convention */ /** * Filter out empty search queries. * * @param {string} rawSearchQuery * @returns {string} */ const getSearchQuery = (rawSearchQuery)=>{ if (!rawSearchQuery) { return ""; } // trim search query so we don't log a query like ' '. return rawSearchQuery.trim(); }; const logEvent = async (eventName, params)=>{ if (src_lib_firebase__WEBPACK_IMPORTED_MODULE_1__.isFirebaseEnabled) { Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 92099)).then((firebaseModule)=>{ // eslint-disable-next-line i18next/no-literal-string firebaseModule.analytics().logEvent(eventName, params); }); } }; /** * Log when a button is clicked. * * @param {string} buttonName */ const logButtonClick = (buttonName, params)=>{ logEvent(`${buttonName}_clicked`, params); }; /** * Log when a form is submitted. * * @param {string} formName */ const logFormSubmission = (formName, params)=>{ logEvent(`${formName}_form_submitted`, params); }; /** * Log when a carousel slide is completed. * * @param {string} carouselName * @param {number|string} slideNumber */ const logCarouselSlideCompletion = (carouselName, slideNumber)=>{ logEvent(`${carouselName}_slide_${slideNumber}_completed`); }; /** * Log when a value changes. * * @param {string} name * @param {string | boolean | number | string[] | number[] | Record} currentValue * @param {string | boolean | number | string[] | number[] | Record} newValue */ const logValueChange = (name, currentValue, newValue, params = {})=>{ logEvent(`${name}_change`, { current_value: currentValue, new_value: newValue, ...params }); }; /** * Log when the user makes a search query whether through typing or voice search when there are no results. * * @param {SearchResultsParams} eventData */ const logEmptySearchResults = ({ query: searchQuery , source , type =_types_SearchType__WEBPACK_IMPORTED_MODULE_0__/* ["default"].Text */ .Z.Text , service })=>{ const query = getSearchQuery(searchQuery); // if the searchQuery is not empty if (query !== "") { logEvent(`${type}_search_query_with_no_result`, { query, source, ...service && { service } }); } }; /** * Log when the user makes a search query whether through typing or voice search when there are results. * * @param {SearchResultsParams} eventData */ const logSearchResults = ({ query: searchQuery , source , type =_types_SearchType__WEBPACK_IMPORTED_MODULE_0__/* ["default"].Text */ .Z.Text , service })=>{ const query = getSearchQuery(searchQuery); // if the searchQuery is not empty if (query !== "") { logEvent("search_query_with_results", { type, query, source, ...service && { service } }); } }; /** * Log text search queries entered by the user. * * @param {string} searchQuery * @param {SearchQuerySource} source */ const logTextSearchQuery = (searchQuery, source)=>{ const query = getSearchQuery(searchQuery); // if the searchQuery is not empty if (query !== "") { logEvent("search_query", { query, source }); } }; const logTarteelLinkClick = (type)=>{ logEvent("tarteel_link_click", { type: `${type}_attribution` }); }; /** * Log when an item selection status change. * * @param {string} itemName * @param {string | number} itemId * @param {boolean} isSelected */ const logItemSelectionChange = (itemName, itemId, isSelected = true)=>{ logEvent(`${itemName}_${isSelected ? "selected" : "unselected"}`, { value: itemId }); }; __webpack_async_result__(); } catch(e) { __webpack_async_result__(e); } }); /***/ }), /***/ 57933: /***/ ((module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try { /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "AO": () => (/* binding */ getNotesNavigationUrl), /* harmony export */ "CZ": () => (/* binding */ getJuzNavigationUrl), /* harmony export */ "ES": () => (/* binding */ getCourseNavigationUrl), /* harmony export */ "Fk": () => (/* binding */ getRamadanActivitiesNavigationUrl), /* harmony export */ "GK": () => (/* binding */ getPageNavigationUrl), /* harmony export */ "HT": () => (/* binding */ getVerseReflectionNavigationUrl), /* harmony export */ "I8": () => (/* binding */ getVerseSelectedTafsirNavigationUrl), /* harmony export */ "L$": () => (/* binding */ getMyCoursesNavigationUrl), /* harmony export */ "Mf": () => (/* binding */ getRubNavigationUrl), /* harmony export */ "P6": () => (/* binding */ getChapterWithStartingVerseUrl), /* harmony export */ "So": () => (/* binding */ getVerseTafsirNavigationUrl), /* harmony export */ "Wq": () => (/* binding */ getHizbNavigationUrl), /* harmony export */ "Y9": () => (/* binding */ getReciterChapterNavigationUrl), /* harmony export */ "Z2": () => (/* binding */ getCanonicalUrl), /* harmony export */ "Zm": () => (/* binding */ getSurahInfoNavigationUrl), /* harmony export */ "_V": () => (/* binding */ fakeNavigate), /* harmony export */ "aT": () => (/* binding */ getReciterNavigationUrl), /* harmony export */ "dC": () => (/* binding */ getLessonNavigationUrl), /* harmony export */ "gk": () => (/* binding */ getLoginNavigationUrl), /* harmony export */ "hb": () => (/* binding */ scrollWindowToTop), /* harmony export */ "kJ": () => (/* binding */ getProfileNavigationUrl), /* harmony export */ "lj": () => (/* binding */ getNotificationSettingsNavigationUrl), /* harmony export */ "ly": () => (/* binding */ getQuranicCalendarNavigationUrl), /* harmony export */ "nT": () => (/* binding */ getQuranicCalendarRangesNavigationUrl), /* harmony export */ "oJ": () => (/* binding */ getReadingGoalProgressNavigationUrl), /* harmony export */ "p5": () => (/* binding */ getVerseNavigationUrl), /* harmony export */ "pO": () => (/* binding */ getProductUpdatesUrl), /* harmony export */ "pg": () => (/* binding */ getCollectionNavigationUrl), /* harmony export */ "qm": () => (/* binding */ getSurahNavigationUrl), /* harmony export */ "qs": () => (/* binding */ getVerseNavigationUrlByVerseKey), /* harmony export */ "ty": () => (/* binding */ getCoursesNavigationUrl), /* harmony export */ "uv": () => (/* binding */ QuranicCalendarRangesNavigationSettings), /* harmony export */ "we": () => (/* binding */ getReadingGoalNavigationUrl), /* harmony export */ "xl": () => (/* binding */ getRangesNavigationUrl), /* harmony export */ "zp": () => (/* binding */ resolveUrlBySearchNavigationType) /* harmony export */ }); /* unused harmony exports getSurahRangeNavigationUrlByVerseKey, getPreviousSurahNavigationUrl, getNextSurahNavigationUrl, getSearchQueryNavigationUrl */ /* harmony import */ var querystring__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(63477); /* harmony import */ var querystring__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(querystring__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _search__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(87098); /* harmony import */ var _url__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(69663); /* harmony import */ var _verse__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(44519); /* harmony import */ var _types_QueryParam__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(11721); /* harmony import */ var _types_QuranReader__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(50467); /* harmony import */ var types_SearchNavigationResult__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(87582); var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_search__WEBPACK_IMPORTED_MODULE_1__]); _search__WEBPACK_IMPORTED_MODULE_1__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0]; /* eslint-disable max-lines */ /** * Get the href link to a verse. * * @param {string} verseKey * @returns {string} */ const getVerseNavigationUrlByVerseKey = (verseKey)=>{ const [chapterId, verseNumber] = (0,_verse__WEBPACK_IMPORTED_MODULE_2__/* .getVerseAndChapterNumbersFromKey */ .bV)(verseKey); return `/${chapterId}/${verseNumber}`; }; /** * Get the href link to a verse range e.g. 3:5-7. * * @param {string} key * @returns {string} */ const getSurahRangeNavigationUrlByVerseKey = (key)=>{ const { surah , from , to } = (0,_verse__WEBPACK_IMPORTED_MODULE_2__/* .getVerseNumberRangeFromKey */ .YN)(key); return `/${surah}/${from}-${to}`; }; /** * Get the scroll to link of a verseKey. * * @param {string} verseKey * @returns {string} */ const getChapterWithStartingVerseUrl = (verseKey)=>{ const [chapterId, verseNumber] = (0,_verse__WEBPACK_IMPORTED_MODULE_2__/* .getVerseAndChapterNumbersFromKey */ .bV)(verseKey); return `/${chapterId}?${_types_QueryParam__WEBPACK_IMPORTED_MODULE_3__/* ["default"].STARTING_VERSE */ .Z.STARTING_VERSE}=${verseNumber}`; }; /** * Get the href link to a verse. * * @param {string} chapterIdOrSlug * @param {string} verseNumber * @returns {string} */ const getVerseNavigationUrl = (chapterIdOrSlug, verseNumber)=>`/${chapterIdOrSlug}/${verseNumber}`; /** * Get the href link to a range. * * @param {string} startVerseKey * @param {string} endVerseKey * @returns {string} */ const getRangesNavigationUrl = (startVerseKey, endVerseKey)=>`/${startVerseKey}-${endVerseKey}`; /** * Get the href link to a juz. * * @param {string | number} juzNumber * @returns {string} */ const getJuzNavigationUrl = (juzNumber)=>`/juz/${juzNumber}`; /** * Get the href link to a Rub el Hizb. * * @param {string | number} rubNumber * @returns {string} */ const getRubNavigationUrl = (rubNumber)=>`/rub/${rubNumber}`; /** * Get the href link to a hizb. * * @param {string | number} hizbNumber * @returns {string} */ const getHizbNavigationUrl = (hizbNumber)=>`/hizb/${hizbNumber}`; /** * Get the href link to a page. * * @param {string | number} pageNumber * @returns {string} */ const getPageNavigationUrl = (pageNumber)=>`/page/${pageNumber}`; /** * Get the href link to tafsir for Ayah. * * @param {string | number} chapterIdOrSlug * @param {number} verseNumber * @returns {string} */ const getVerseTafsirNavigationUrl = (chapterIdOrSlug, verseNumber, tafsirId)=>`/${chapterIdOrSlug}/${verseNumber}/tafsirs${tafsirId ? `?${(0,querystring__WEBPACK_IMPORTED_MODULE_0__.stringify)({ tafsirId })}` : ""}`; /** * Get the href link to selected tafsir for Ayah. * * @param {string | number} chapterId * @param {number} verseNumber * @param {number |string} tafsirId * @returns {string} */ const getVerseSelectedTafsirNavigationUrl = (chapterId, verseNumber, tafsirId)=>`/${chapterId}:${verseNumber}/tafsirs/${tafsirId}`; /** * Get the href link to selected tafsir for Ayah. * * @param {string} verseKey * @returns {string} */ const getVerseReflectionNavigationUrl = (verseKey)=>`/${verseKey}/reflections`; /** * Get the href link to a surah. * * @param {string | number} surahIdOrSlug * @returns {string} */ const getSurahNavigationUrl = (surahIdOrSlug)=>`/${surahIdOrSlug}`; var QuranicCalendarRangesNavigationSettings; (function(QuranicCalendarRangesNavigationSettings) { QuranicCalendarRangesNavigationSettings["EnglishOnly"] = "englishOnly"; QuranicCalendarRangesNavigationSettings["EnglishAndArabic"] = "englishAndArabic"; QuranicCalendarRangesNavigationSettings["DefaultSettings"] = "defaultSettings"; })(QuranicCalendarRangesNavigationSettings || (QuranicCalendarRangesNavigationSettings = {})); const getQuranicCalendarRangesNavigationUrl = (ranges, settings)=>{ const params = { [_types_QueryParam__WEBPACK_IMPORTED_MODULE_3__/* ["default"].FLOW */ .Z.FLOW]: _types_QuranReader__WEBPACK_IMPORTED_MODULE_4__/* .QuranReaderFlow.QURANIC_CALENDER */ .Bc.QURANIC_CALENDER }; if (settings !== QuranicCalendarRangesNavigationSettings.DefaultSettings) { params[_types_QueryParam__WEBPACK_IMPORTED_MODULE_3__/* ["default"].Translations */ .Z.Translations] = 85; if (settings === QuranicCalendarRangesNavigationSettings.EnglishOnly) { params[_types_QueryParam__WEBPACK_IMPORTED_MODULE_3__/* ["default"].HIDE_ARABIC */ .Z.HIDE_ARABIC] = "true"; } } return `${ranges}?${(0,querystring__WEBPACK_IMPORTED_MODULE_0__.stringify)(params)}`; }; /** * Get the href link to the previous surah. * * @param {number} chapterNumber * @param {boolean} isReadingByRevelationOrder * @returns {string} */ const getPreviousSurahNavigationUrl = (chapterNumber, isReadingByRevelationOrder)=>{ if (!isReadingByRevelationOrder) { return getSurahNavigationUrl(chapterNumber - 1); } const currentChapterRevelationOrderIndex = REVELATION_ORDER.indexOf(chapterNumber); const previousChapterRevelationOrderIndex = currentChapterRevelationOrderIndex - 1; const previousChapterNumberByRevelationOrder = REVELATION_ORDER[previousChapterRevelationOrderIndex]; return getSurahNavigationUrl(previousChapterNumberByRevelationOrder); }; /** * Get the href link to the next surah. * * @param chapterNumber * @param isReadingByRevelationOrder * @returns {string} */ const getNextSurahNavigationUrl = (chapterNumber, isReadingByRevelationOrder)=>{ if (!isReadingByRevelationOrder) { return getSurahNavigationUrl(chapterNumber + 1); } const currentChapterRevelationOrderIndex = REVELATION_ORDER.indexOf(chapterNumber); const nextChapterRevelationOrderIndex = currentChapterRevelationOrderIndex + 1; const nextChapterNumberByRevelationOrder = REVELATION_ORDER[nextChapterRevelationOrderIndex]; return getSurahNavigationUrl(nextChapterNumberByRevelationOrder); }; /** * Generate the navigation url based on the type. * * @param {SearchNavigationType} type * @param {string | number} key * @param {boolean} isKalimatSearch * @returns {string} */ const resolveUrlBySearchNavigationType = (type, key, isKalimatSearch = false)=>{ const stringKey = isKalimatSearch ? (0,_search__WEBPACK_IMPORTED_MODULE_1__/* .searchIdToNavigationKey */ .Ck)(type, String(key)) : String(key); if (type === types_SearchNavigationResult__WEBPACK_IMPORTED_MODULE_5__/* .SearchNavigationType.AYAH */ .H.AYAH) { return getChapterWithStartingVerseUrl(stringKey); } if (type === types_SearchNavigationResult__WEBPACK_IMPORTED_MODULE_5__/* .SearchNavigationType.JUZ */ .H.JUZ) { return getJuzNavigationUrl(stringKey); } if (type === types_SearchNavigationResult__WEBPACK_IMPORTED_MODULE_5__/* .SearchNavigationType.RUB_EL_HIZB */ .H.RUB_EL_HIZB) { return getRubNavigationUrl(stringKey); } if (type === types_SearchNavigationResult__WEBPACK_IMPORTED_MODULE_5__/* .SearchNavigationType.HIZB */ .H.HIZB) { return getHizbNavigationUrl(stringKey); } if (type === types_SearchNavigationResult__WEBPACK_IMPORTED_MODULE_5__/* .SearchNavigationType.PAGE */ .H.PAGE) { return getPageNavigationUrl(stringKey); } if (type === types_SearchNavigationResult__WEBPACK_IMPORTED_MODULE_5__/* .SearchNavigationType.SEARCH_PAGE */ .H.SEARCH_PAGE) { return getSearchQueryNavigationUrl(stringKey); } if (type === types_SearchNavigationResult__WEBPACK_IMPORTED_MODULE_5__/* .SearchNavigationType.RANGE */ .H.RANGE) { return getSurahRangeNavigationUrlByVerseKey(stringKey); } // for the Surah navigation return getSurahNavigationUrl(stringKey); }; /** * Get the href link to the search page with a specific query. * * @param {string} query the search query. * @returns {string} */ const getSearchQueryNavigationUrl = (query)=>`/search${query ? `?${_types_QueryParam__WEBPACK_IMPORTED_MODULE_3__/* ["default"].QUERY */ .Z.QUERY}=${query}` : ""}`; /** * Get the href link to the info page of a Surah. * * @param {string} chapterIdOrSlug * @returns {string} chapterUrl */ const getSurahInfoNavigationUrl = (chapterIdOrSlug)=>`/surah/${chapterIdOrSlug}/info`; /** * Get href link to the reciter page * * @param {string} reciterId * @returns {string} reciterPageUrl */ const getReciterNavigationUrl = (reciterId)=>`/reciters/${reciterId}`; /** * Get href link to the course page * * @param {string} courseSlug * @returns {string} coursePageUrl */ const getCourseNavigationUrl = (courseSlug)=>`/learning-plans/${courseSlug}`; /** * Get href link to the lesson page * * @param {string} courseSlug * @returns {string} lessonPageUrl */ const getLessonNavigationUrl = (courseSlug, lessonSlug)=>`/learning-plans/${courseSlug}/lessons/${lessonSlug}`; /** * Get href link to an audio recitation page by reciterId and chapterId * * @param {string} reciterId * @param {string} chapterId * @returns {string} recitationPageUrl */ const getReciterChapterNavigationUrl = (reciterId, chapterId)=>`/reciters/${reciterId}/${chapterId}`; /** * Get the canonical url. Will include the language in the url except for English. * * @param {string} lang * @param {string} path * @returns {string} */ const getCanonicalUrl = (lang, path)=>`${(0,_url__WEBPACK_IMPORTED_MODULE_6__/* .getBasePath */ .bv)()}${lang === "en" ? "" : `/${lang}`}${path}`; /** * Get the href link to the product updates page. * * @param {string} id * @returns {string} */ const getProductUpdatesUrl = (id = "")=>`/product-updates${`${id ? `/${id}` : ""}`}`; const getProfileNavigationUrl = ()=>{ return "/profile"; }; const getCollectionNavigationUrl = (collectionId)=>{ return `/collections/${collectionId}`; }; const getReadingGoalNavigationUrl = ()=>"/reading-goal"; const getMyCoursesNavigationUrl = ()=>"/my-learning-plans"; const getCoursesNavigationUrl = ()=>"/learning-plans"; const getRamadanActivitiesNavigationUrl = ()=>"/ramadan-activities"; const getLoginNavigationUrl = (redirectTo)=>`/login${redirectTo ? `?${_types_QueryParam__WEBPACK_IMPORTED_MODULE_3__/* ["default"].REDIRECT_TO */ .Z.REDIRECT_TO}=${redirectTo}` : ""}`; const getReadingGoalProgressNavigationUrl = ()=>"/reading-goal/progress"; const getNotesNavigationUrl = ()=>"/notes-and-reflections"; const getNotificationSettingsNavigationUrl = ()=>"/notification-settings"; const getQuranicCalendarNavigationUrl = ()=>"/calendar"; /** * Update the browser history with the new url. * without actually navigating into that url. * So it does not trigger re render or page visit on Next.js * * @param {string} url * @param {string} locale */ const fakeNavigate = (url, locale)=>{ window.history.pushState({}, "", `${locale === "en" ? "" : `/${locale}`}${url}`); }; /** * Scroll to the top of the page. */ const scrollWindowToTop = ()=>{ if (false) {} }; __webpack_async_result__(); } catch(e) { __webpack_async_result__(e); } }); /***/ }), /***/ 19303: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "XK": () => (/* binding */ formatStringNumber), /* harmony export */ "XN": () => (/* binding */ getPageNumberFromIndexAndPerPage), /* harmony export */ "uZ": () => (/* binding */ convertNumberToDecimal), /* harmony export */ "xT": () => (/* binding */ convertFractionToPercent) /* harmony export */ }); /* eslint-disable import/prefer-default-export */ /** * This function returns a number string after making sure * it's in the valid format. e.g. * 1 -> 1 * 001 -> 1 * * @param {string} number * @returns {string} */ const formatStringNumber = (number)=>String(Number(number)); /** * This function takes a fraction (a number between 0 and 1) and converts it to a percent number (limited to 100). * * @param {string | number} fraction a number between 0 and 1 * @param {number} decimalPoints number of decimal points * @returns {number} a number between 0 and 100 */ const convertFractionToPercent = (fraction, decimalPoints = 1)=>{ const number = convertNumberToDecimal(Number(fraction) * 100, decimalPoints); return Math.min(number, 100); }; /** * This function takes a number and converts it to a decimal number. * * @param {string | number} number * @param {number} decimalPoints number of decimal points * @returns {number} */ const convertNumberToDecimal = (number, decimalPoints = 1)=>{ return Number((typeof number === "string" ? Number(number) : number).toFixed(decimalPoints)); }; /** * This function takes an item index and the number of items per page and returns the page number. * * Example: * index: 0, perPage: 10 -> 1 * index: 1, perPage: 10 -> 1 * index: 10, perPage: 10 -> 2 * index: 11, perPage: 10 -> 2 * * @param {number} index * @param {number} perPage * @returns {number} */ const getPageNumberFromIndexAndPerPage = (index, perPage)=>{ return Math.ceil((index + 1) / perPage); }; /***/ }), /***/ 99921: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); // Reference: https://github.com/billjs/query-string/blob/master/src/index.ts const defaultStringifyFunction = (key, value)=>value; const defaultEq = "="; const defaultSep = "&"; const defaultConfig = { eq: defaultEq, sep: defaultSep, prefix: "", fn: defaultStringifyFunction }; /** * Given a query object, return the query string * See qs-stringify.test.ts for examples * * @param {QueryObject} obj a query object to be converted to a query string * @param {Config} config optional configuration * @returns {string} query string * * @example * stringify({a: 1, b: 2}) // returns 'a=1&b=s' */ function stringify(obj, config = defaultConfig) { const { eq , sep , fn , prefix } = { ...defaultConfig, ...config }; if (obj == null || !isObject(obj)) { return ""; } return Object.entries(obj).filter(([, value])=>value !== null) // filter out null values .map(([key, value])=>{ if (Array.isArray(value)) { return encode(key, value.join(","), { eq, fn, prefix }); } if (isObject(value)) { return stringify(value, { eq, sep, fn, prefix: getKey(key, prefix) }); } return encode(key, value, { eq, fn, prefix }); }).join(sep); } // encode the key and add prefix if necessary const getKey = (key, prefix = "")=>{ const encodedKey = encodeURIComponent(key); if (prefix) return `${prefix}[${encodedKey}]`; return encodedKey; }; // encode the key and value of a query object const encode = (key, value, { eq =defaultEq , fn =defaultStringifyFunction , prefix ="" })=>{ const newValue = encodeURIComponent(fn(key, value)); const newKey = getKey(key, prefix); return [ newKey, newValue ].join(eq); }; // check if the given value is an object function isObject(obj) { const type = typeof obj; return obj && (type === "object" || type === "function") || false; } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (stringify); /***/ }), /***/ 87098: /***/ ((module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try { /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "Ck": () => (/* binding */ searchIdToNavigationKey), /* harmony export */ "Em": () => (/* binding */ getSearchNavigationResult), /* harmony export */ "Gs": () => (/* binding */ getDefaultTranslationIdsByLang), /* harmony export */ "NC": () => (/* binding */ getTranslationsByLanguages), /* harmony export */ "UC": () => (/* binding */ searchGetResults), /* harmony export */ "YA": () => (/* binding */ addToSearchHistory) /* harmony export */ }); /* unused harmony exports LOCALE_TO_TRANSLATION_LANGUAGE, idToPageNumber, idToJuzNumber */ /* harmony import */ var lodash_groupBy__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(98492); /* harmony import */ var lodash_groupBy__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_groupBy__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _eventLogger__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(55943); /* harmony import */ var _api__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(92684); /* harmony import */ var _redux_slices_Search_search__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(85895); /* harmony import */ var _types_Search_SearchRequestParams__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(92086); /* harmony import */ var _types_Search_SearchService__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(64609); /* harmony import */ var _utils_chapter__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(95892); /* harmony import */ var _utils_locale__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(24709); /* harmony import */ var _utils_verse__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(44519); /* harmony import */ var types_SearchNavigationResult__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(87582); var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_eventLogger__WEBPACK_IMPORTED_MODULE_1__]); _eventLogger__WEBPACK_IMPORTED_MODULE_1__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0]; /* eslint-disable max-lines */ /* eslint-disable react-func/max-lines-per-function */ const LOCALE_TO_TRANSLATION_LANGUAGE = { en: "english", ar: "arabic", bn: "bengali", fa: "persian", fr: "french", id: "indonesian", it: "italian", nl: "dutch", pt: "portuguese", ru: "russian", sq: "albanian", th: "thai", tr: "turkish", ur: "urdu", zh: "chinese", ms: "malay" }; /** * Given a list of translations, group them by language * after converting the language name to lowercase to account * for case differences e.g. "dutch", "Dutch" * * @param {AvailableTranslation[]} translations * @returns {Record} */ const getTranslationsByLanguages = (translations)=>{ const translationByLanguages = lodash_groupBy__WEBPACK_IMPORTED_MODULE_0___default()(translations, (translation)=>translation.languageName.toLowerCase()); return translationByLanguages; }; /** * Get the default translation ids for the passed language. * * @param {AvailableTranslation[]} translations * @param {string} lang * @param {boolean} returnAsString * @returns {string | string[]} */ const getDefaultTranslationIdsByLang = (translations, lang, returnAsString = true)=>{ const translationsByLanguages = getTranslationsByLanguages(translations); let translationIds = []; // If the language is in the map, return list of its translation ids if (translationsByLanguages[LOCALE_TO_TRANSLATION_LANGUAGE[lang]]) { translationIds = translationsByLanguages[LOCALE_TO_TRANSLATION_LANGUAGE[lang]].map((translation)=>translation.id.toString()); } if (returnAsString) { return translationIds.join(","); } return translationIds; }; /** * Convert a search id to navigation key. an example of * a search id is j29 for Juz 29 or p50 for Page 50. * * @param {type} type * @param {string} id * @returns {string} */ const searchIdToNavigationKey = (type, id)=>{ if (type === types_SearchNavigationResult__WEBPACK_IMPORTED_MODULE_9__/* .SearchNavigationType.JUZ */ .H.JUZ) { // e.g. j29 return idToJuzNumber(id); } if (type === types_SearchNavigationResult__WEBPACK_IMPORTED_MODULE_9__/* .SearchNavigationType.PAGE */ .H.PAGE) { // e.g. p50 return idToPageNumber(id); } // e.g. 1 or 1:1 which don't need converting return id; }; const idToPageNumber = (id)=>id.substring(id.indexOf("p") + 1); const idToJuzNumber = (id)=>id.substring(id.indexOf("j") + 1); const getSearchNavigationResult = (chaptersData, result, t, locale)=>{ const { key , resultType } = result; if (resultType === types_SearchNavigationResult__WEBPACK_IMPORTED_MODULE_9__/* .SearchNavigationType.JUZ */ .H.JUZ) { const juzNumber = idToJuzNumber(key); return { name: `${t("common:juz")} ${(0,_utils_locale__WEBPACK_IMPORTED_MODULE_7__/* .toLocalizedNumber */ .rQ)(Number(juzNumber), locale)}`, key: juzNumber, resultType: types_SearchNavigationResult__WEBPACK_IMPORTED_MODULE_9__/* .SearchNavigationType.JUZ */ .H.JUZ }; } if (resultType === types_SearchNavigationResult__WEBPACK_IMPORTED_MODULE_9__/* .SearchNavigationType.PAGE */ .H.PAGE) { const pageNumber = idToPageNumber(key); return { name: `${t("common:page")} ${(0,_utils_locale__WEBPACK_IMPORTED_MODULE_7__/* .toLocalizedNumber */ .rQ)(Number(pageNumber), locale)}`, key: pageNumber, resultType: types_SearchNavigationResult__WEBPACK_IMPORTED_MODULE_9__/* .SearchNavigationType.PAGE */ .H.PAGE }; } if (resultType === types_SearchNavigationResult__WEBPACK_IMPORTED_MODULE_9__/* .SearchNavigationType.RANGE */ .H.RANGE) { const { surah , from , to } = (0,_utils_verse__WEBPACK_IMPORTED_MODULE_8__/* .getVerseNumberRangeFromKey */ .YN)(key); return { name: `${t("common:surah")} ${(0,_utils_chapter__WEBPACK_IMPORTED_MODULE_6__/* .getChapterData */ .dy)(chaptersData, `${surah}`).transliteratedName} ${t("common:ayah")} ${(0,_utils_locale__WEBPACK_IMPORTED_MODULE_7__/* .toLocalizedNumber */ .rQ)(from, locale)} - ${(0,_utils_locale__WEBPACK_IMPORTED_MODULE_7__/* .toLocalizedNumber */ .rQ)(to, locale)}`, key, resultType: types_SearchNavigationResult__WEBPACK_IMPORTED_MODULE_9__/* .SearchNavigationType.RANGE */ .H.RANGE }; } if (resultType === types_SearchNavigationResult__WEBPACK_IMPORTED_MODULE_9__/* .SearchNavigationType.AYAH */ .H.AYAH) { const [surahNumber, ayahNumber] = (0,_utils_verse__WEBPACK_IMPORTED_MODULE_8__/* .getVerseAndChapterNumbersFromKey */ .bV)(key); return { name: `${t("common:surah")} ${(0,_utils_chapter__WEBPACK_IMPORTED_MODULE_6__/* .getChapterData */ .dy)(chaptersData, `${surahNumber}`).transliteratedName}, ${t("common:ayah")} ${(0,_utils_locale__WEBPACK_IMPORTED_MODULE_7__/* .toLocalizedNumber */ .rQ)(Number(ayahNumber), locale)}`, key, resultType: types_SearchNavigationResult__WEBPACK_IMPORTED_MODULE_9__/* .SearchNavigationType.AYAH */ .H.AYAH }; } // when it's a chapter return { name: `${t("common:surah")} ${(0,_utils_chapter__WEBPACK_IMPORTED_MODULE_6__/* .getChapterData */ .dy)(chaptersData, key).transliteratedName}`, key, resultType: types_SearchNavigationResult__WEBPACK_IMPORTED_MODULE_9__/* .SearchNavigationType.SURAH */ .H.SURAH }; }; /** * Call BE to fetch the search results using the passed filters * and if there are no results call Kalimat API. * * @param {SearchQuerySource} source * @param {string} query * @param {number} page * @param {number} pageSize * @param {(arg: boolean) => void} setIsSearching * @param {(arg: boolean) => void} setHasError * @param {(data: SearchResponse) => void} setSearchResult * @param {string} languages * @param {string} translations */ const searchGetResults = (source, query, page, pageSize, setIsSearching, setHasError, setSearchResult, languages, translations)=>{ setIsSearching(true); (0,_eventLogger__WEBPACK_IMPORTED_MODULE_1__/* .logTextSearchQuery */ .tL)(query, source); (0,_api__WEBPACK_IMPORTED_MODULE_2__/* .getSearchResults */ .BP)({ query, ...languages && { filterLanguages: languages }, size: pageSize, page, ...translations && { filterTranslations: translations } }).then(async (response)=>{ if (response.status === 500) { setHasError(true); } else { setSearchResult({ ...response, service: _types_Search_SearchService__WEBPACK_IMPORTED_MODULE_5__/* ["default"].QDC */ .Z.QDC }); const noQdcResults = response.pagination.totalRecords === 0 && !response.result.navigation.length; // if there is no navigations nor verses in the response if (noQdcResults) { (0,_eventLogger__WEBPACK_IMPORTED_MODULE_1__/* .logEmptySearchResults */ .Dy)({ query, source, service: _types_Search_SearchService__WEBPACK_IMPORTED_MODULE_5__/* ["default"].QDC */ .Z.QDC }); const kalimatResponse = await (0,_api__WEBPACK_IMPORTED_MODULE_2__/* .getNewSearchResults */ .H4)({ mode: _types_Search_SearchRequestParams__WEBPACK_IMPORTED_MODULE_4__/* .SearchMode.Advanced */ .N.Advanced, query, size: pageSize, filterLanguages: languages, page, exactMatchesOnly: 0, // translations will be included only when there is a selected translation ...translations && { filterTranslations: translations, translationFields: "resource_name" } }); setSearchResult({ ...kalimatResponse, service: _types_Search_SearchService__WEBPACK_IMPORTED_MODULE_5__/* ["default"].KALIMAT */ .Z.KALIMAT }); if (kalimatResponse.pagination.totalRecords === 0) { (0,_eventLogger__WEBPACK_IMPORTED_MODULE_1__/* .logEmptySearchResults */ .Dy)({ query, source, service: _types_Search_SearchService__WEBPACK_IMPORTED_MODULE_5__/* ["default"].KALIMAT */ .Z.KALIMAT }); } else { (0,_eventLogger__WEBPACK_IMPORTED_MODULE_1__/* .logSearchResults */ .qS)({ query, source, service: _types_Search_SearchService__WEBPACK_IMPORTED_MODULE_5__/* ["default"].KALIMAT */ .Z.KALIMAT }); } } } }).catch(()=>{ setHasError(true); }).finally(()=>{ setIsSearching(false); }); }; /** * Adds the searched text to the recent history. * * @param {Dispatch} dispatch * @param {string} debouncedSearchQuery * @param {SearchQuerySource} source */ const addToSearchHistory = (dispatch, debouncedSearchQuery, source)=>{ dispatch({ type: _redux_slices_Search_search__WEBPACK_IMPORTED_MODULE_3__/* .addSearchHistoryRecord.type */ .zr.type, payload: debouncedSearchQuery }); (0,_eventLogger__WEBPACK_IMPORTED_MODULE_1__/* .logTextSearchQuery */ .tL)(debouncedSearchQuery, source); }; __webpack_async_result__(); } catch(e) { __webpack_async_result__(e); } }); /***/ }), /***/ 44519: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "Bo": () => (/* binding */ getDistanceBetweenVerses), /* harmony export */ "G$": () => (/* binding */ makeWordLocation), /* harmony export */ "LQ": () => (/* binding */ getVerseWords), /* harmony export */ "TO": () => (/* binding */ getWordDataByLocation), /* harmony export */ "Tc": () => (/* binding */ getChapterNumberFromKey), /* harmony export */ "YN": () => (/* binding */ getVerseNumberRangeFromKey), /* harmony export */ "Yx": () => (/* binding */ isVerseKeyWithinRanges), /* harmony export */ "ZZ": () => (/* binding */ getFirstWordOfSurah), /* harmony export */ "bV": () => (/* binding */ getVerseAndChapterNumbersFromKey), /* harmony export */ "cI": () => (/* binding */ getFirstAndLastVerseKeys), /* harmony export */ "kC": () => (/* binding */ isLastVerseOfSurah), /* harmony export */ "qB": () => (/* binding */ generateChapterVersesKeys), /* harmony export */ "tR": () => (/* binding */ getVerseNumberFromKey), /* harmony export */ "u": () => (/* binding */ makeVerseKey) /* harmony export */ }); /* unused harmony exports sortWordLocation, formatChapterId, getVerseUrl, sortByVerseKey, sortVersesObjectByVerseKeys, isFirstVerseOfSurah, getChapterFirstAndLastVerseKey, shortenVerseText */ /* harmony import */ var lodash_range__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(64042); /* harmony import */ var lodash_range__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_range__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _chapter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(95892); /* harmony import */ var _number__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(19303); /* harmony import */ var _verseKeys__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(36495); /* eslint-disable max-lines */ /* eslint-disable react-func/max-lines-per-function */ const COLON_SPLITTER = ":"; /** * This will generate all the keys for the verses of a chapter. a key is `{chapterId}:{verseId}`. * * @param {ChaptersData} data * @param {string} chapterId * @returns {string[]} */ const generateChapterVersesKeys = (data, chapterId)=>{ const chapterNumberString = (0,_number__WEBPACK_IMPORTED_MODULE_3__/* .formatStringNumber */ .XK)(chapterId); return lodash_range__WEBPACK_IMPORTED_MODULE_0___default()(data[chapterNumberString].versesCount).map((verseId)=>`${chapterNumberString}:${verseId + 1}`); }; /** * Get the chapter number from its key. A key is the combination between the verse's chapter * and its number separated by ":" e.g. 1:5. * * @param {string} verseKey * @returns {number} The verse number extracted from the key. */ const getChapterNumberFromKey = (verseKey)=>Number(verseKey.split(COLON_SPLITTER)[0]); /** * Get the verse number from its key. A key is the combination between the verse's chapter * and its number separated by ":" e.g. 1:5. * * @param {string} verseKey * @returns {number} The verse number extracted from the key. */ const getVerseNumberFromKey = (verseKey)=>Number(verseKey.split(COLON_SPLITTER)[1]); /** * If the verse is a range of verses, for example 1:3-5 * we'll return {surah: 1, from: 3, to: 5} * * @param {string} verseKey * @returns {surah: number, from: Number, to: Number} */ const getVerseNumberRangeFromKey = (verseKey)=>{ const splits = verseKey.split(COLON_SPLITTER); const surahNumber = splits[0]; const verseNumber = splits[1]; // for example (3-5) const [from, to] = verseNumber.split("-"); // for example [3, 5] return { surah: Number(surahNumber), from: Number(from), to: to ? Number(to) : Number(from) }; }; /** * Get the chapter and verse number of a verse from its key. * * @param {string} verseKey * @returns {[string, string]} The verse number extracted from the key. */ const getVerseAndChapterNumbersFromKey = (verseKey)=>{ const splits = verseKey.split(COLON_SPLITTER); return [ splits[0], splits[1] ]; }; /** * Split the word's location and get the surahNumber, verseNumber and wordNumber. * * @param {string} wordLocation the word location {surahNumber}:{verseNumber}:{wordNumber} * @returns {[string, string, string]} */ const getWordDataByLocation = (wordLocation)=>{ const locationSplits = wordLocation.split(COLON_SPLITTER); return [ locationSplits[0], locationSplits[1], locationSplits[2] ]; }; /** * Extract the data related to a word. The first is the chapter Id, * the second is whether the word is the first word of the first verse * of the Surah. To do that we will have to split the word location * which comes in the following format: {surahNumber}:{verseNumber}:{wordNumber}. * For this to be true, the combination of {verseNumber}:{wordNumber} has to be * 1:1. * * @param {string} wordLocation whose format is {surahNumber}:{verseNumber}:{wordNumber} e.g. "112:1:1" * @returns {{ chapterId: string; isFirstWordOfSurah: boolean }} */ const getFirstWordOfSurah = (wordLocation)=>{ const locationSplits = getWordDataByLocation(wordLocation); return { chapterId: locationSplits[0], isFirstWordOfSurah: locationSplits[1] === "1" && locationSplits[2] === "1" }; }; /** * sort the the word location of the verses * * @param {string[]} locations , the location of the word, Example ['1:1:2', '1:1:1', '1:3:1] * @returns {number} sortedLocations , Example ['1:1:1', '1:1:2', '1:3:1'] * * Reference: https://gomakethings.com/sorting-an-array-by-multiple-criteria-with-vanilla-javascript/ */ const sortWordLocation = (locations)=>locations.sort((a, b)=>{ const [aChapter, aVerse, aWord] = a.split(":"); const [bChapter, bVerse, bWord] = b.split(":"); if (Number(aChapter) > Number(bChapter)) return 1; if (Number(aChapter) < Number(bChapter)) return -1; if (Number(aVerse) > Number(bVerse)) return 1; if (Number(aVerse) < Number(bVerse)) return -1; if (Number(aWord) > Number(bWord)) return 1; if (Number(aWord) < Number(bWord)) return -1; return 0; }); /** * Format chapter id, add prefix '0' if it's a single digit number * * @param {string} id chapter id * @returns {string} formattedChapterId * * @example * // returns '01' * formatChapterId('1') * @example * // returns '102' * formatChapterId('102') */ const formatChapterId = (id)=>`0${id}`.slice(-2); /** * Given the verseKey, return the verseUrl * * @param {string} verseKey example: "1:5" * @returns {string} verseUrl , example "/1/5"; */ const getVerseUrl = (verseKey)=>{ const [chapterNumber, verseNumber] = getVerseAndChapterNumbersFromKey(verseKey); return `/${chapterNumber}/${verseNumber}`; }; /** * This is a sorting function that is meant to be used with array.sort() function * to sort a list of verse keys to match their appearance in the Mushaf. * * @param {string} verseKey1 * @param {string} verseKey2 * @returns {number} */ const sortByVerseKey = (verseKey1, verseKey2)=>{ const [chapterId1, verseId1] = getVerseAndChapterNumbersFromKey(verseKey1); const [chapterId2, verseId2] = getVerseAndChapterNumbersFromKey(verseKey2); const chapterId1Number = Number(chapterId1); const chapterId2Number = Number(chapterId2); const verseId1Number = Number(verseId1); const verseId2Number = Number(verseId2); if (chapterId1Number > chapterId2Number) { return 1; } if (chapterId1Number < chapterId2Number) { return -1; } return verseId1Number > verseId2Number ? 1 : -1; }; /** * Sort an object by keys whose keys are verse keys. * * @param {Record} object * @returns {Record} */ // eslint-disable-next-line @typescript-eslint/no-explicit-any const sortVersesObjectByVerseKeys = (object)=>{ const sortedObject = {}; Object.keys(object).sort((verseKey1, verseKey2)=>sortByVerseKey(verseKey1, verseKey2)).forEach((verseKey)=>{ sortedObject[verseKey] = object[verseKey]; }); return sortedObject; }; /** * make verseKey from chapterNumber and verseNumber, example "1:5" * * @param {number|string} chapterNumber * @param {number|string} verseNumberOrRangeFrom * @param {number|string} rangeTo * @returns {string} */ const makeVerseKey = (chapterNumber, verseNumberOrRangeFrom, rangeTo)=>{ if (rangeTo && verseNumberOrRangeFrom !== rangeTo) { return `${chapterNumber}:${verseNumberOrRangeFrom}-${rangeTo}`; } return `${chapterNumber}:${verseNumberOrRangeFrom}`; }; /** * make wordLocation from verseKey and wordPosition, example "1:1:2" * * @param {string} verseKey * @param {string} wordPosition * @returns {string} wordLocation */ const makeWordLocation = (verseKey, wordPosition)=>`${verseKey}:${wordPosition}`; /** * Get the words of each verse. This can be used to extend * the BE response of each word to add custom fields. * * @param {Verse} verse * @param {boolean} isReadingView * @returns {Word[]} */ const getVerseWords = (verse, isReadingView = false)=>{ const words = []; verse.words.forEach((word)=>{ const wordVerse = { ...verse }; words.push({ ...word, hizbNumber: verse.hizbNumber, ...isReadingView && { verse: wordVerse } }); }); return words; }; /** * Calculate the number of verses in a range of chapters. * * @param {ChaptersData} chaptersData * @param {number} startChapter * @param {number} endChapter * @returns {number} */ const getNumberOfVersesInRangeOfChapters = (chaptersData, startChapter, endChapter)=>{ let total = 0; for(let currentChapterId = startChapter; currentChapterId < endChapter; currentChapterId += 1){ total += (0,_chapter__WEBPACK_IMPORTED_MODULE_1__/* .getChapterData */ .dy)(chaptersData, String(currentChapterId)).versesCount; } return total; }; /** * Calculate how far apart 2 verses are from each other. The order of the verses * won't matter as we swap them if they are not in the same order of the Mushaf. * * @param {ChaptersData} chaptersData * @param {string} firstVerseKey * @param {string} secondVerseKey * * @returns {number} */ const getDistanceBetweenVerses = (chaptersData, firstVerseKey, secondVerseKey)=>{ // eslint-disable-next-line prefer-const let [firstChapterString, firstVerseNumberString] = getVerseAndChapterNumbersFromKey(firstVerseKey); const [secondChapterString, secondVerseNumberString] = getVerseAndChapterNumbersFromKey(secondVerseKey); let firstChapterNumber = Number(firstChapterString); let secondChapterNumber = Number(secondChapterString); let firstVerseNumber = Number(firstVerseNumberString); let secondVerseNumber = Number(secondVerseNumberString); // if they are within the same chapter if (firstChapterNumber === secondChapterNumber) { if (firstVerseNumber > secondVerseNumber) { return firstVerseNumber - secondVerseNumber; } return secondVerseNumber - firstVerseNumber; } // if the first verse chapter is after the second, we swap them to match the same order in the Mushaf if (firstChapterNumber > secondChapterNumber) { [firstVerseNumber, secondVerseNumber, firstChapterNumber, secondChapterNumber, firstChapterString, ] = [ secondVerseNumber, firstVerseNumber, secondChapterNumber, firstChapterNumber, secondChapterString, ]; } let distance = 0; // if there is more than 1 full chapter in between the verses' chapters being checked, we sum the number of verses in each chapter. if (secondChapterNumber - firstChapterNumber > 1) { distance += getNumberOfVersesInRangeOfChapters(chaptersData, firstChapterNumber + 1, secondChapterNumber); } /* 1. we add the number of verses from beginning of the second verse's chapter -> the verse itself. 2. we add the difference between the last verse of the first verse's chapter and the first verse itself. */ return distance + secondVerseNumber + (0,_chapter__WEBPACK_IMPORTED_MODULE_1__/* .getChapterData */ .dy)(chaptersData, firstChapterString).versesCount - firstVerseNumber; }; /** * Whether the current verse is the first in surah. * * @param {number} verseNumber * @returns {boolean} */ const isFirstVerseOfSurah = (verseNumber)=>verseNumber === 1; /** * Whether the current verse is the last in surah. * * @param {ChaptersData} chaptersData * @param {string} chapterNumber * @param {number} verseNumber * @returns {boolean} */ const isLastVerseOfSurah = (chaptersData, chapterNumber, verseNumber)=>verseNumber === (0,_chapter__WEBPACK_IMPORTED_MODULE_1__/* .getChapterData */ .dy)(chaptersData, chapterNumber).versesCount; const getChapterFirstAndLastVerseKey = (chaptersData, chapterId)=>{ if (!chaptersData) { return [ "", "" ]; } const chapterData = getChapterData(chaptersData, chapterId); return [ makeVerseKey(Number(chapterId), 1), makeVerseKey(Number(chapterId), chapterData.versesCount), ]; }; /** * Shorten a text by setting the maximum number of characters * by the value of the parameter and adding "..." at the end. * * @param {string} text * @param {number} length * @returns {string} */ const shortenVerseText = (text, length = 150)=>{ const characters = text.split("", length); let shortenedText = ""; for(let index = 0; index < characters.length; index += 1){ const character = characters[index]; if (shortenedText.length === length - 1) { shortenedText = `${shortenedText}${character}...`; break; } shortenedText = `${shortenedText}${character}`; } return shortenedText; }; /** * Given list of verses, get all the first and the last verseKeys * * @param {Record} verses * @returns {string[]} [firstVerseKey, lastVerseKey] */ const getFirstAndLastVerseKeys = (verses)=>{ const verseKeys = Object.keys(verses).sort(sortByVerseKey); return [ verseKeys[0], verseKeys[verseKeys.length - 1] ]; }; /** * This function checks if a verse key is within a range or an array of ranges. * * Examples: * - `isVerseKeyWithinRanges('1:1', '1:1-1:7')` -> `true` * - `isVerseKeyWithinRanges('1:1', '1:2-1:7')` -> `false` * - `isVerseKeyWithinRanges('2:4', ['1:1-1:7', '2:1-2:5'])` -> `true` * - `isVerseKeyWithinRanges('2:10', ['1:2-1:7', '2:1-2:5'])` -> `false` * * @param {string} verseKey - verse key, e.g. 1:1 * @param {string[] | string} ranges - verse range or array of verse ranges, e.g. `1:1-1:7` or `['1:1-1:7', '2:1-2:5']` * @returns {boolean} */ const isVerseKeyWithinRanges = (verseKey, ranges)=>{ const [chapter, verse] = getVerseAndChapterNumbersFromKey(verseKey).map(Number); const rangesArray = Array.isArray(ranges) ? ranges : [ ranges ]; for(let i = 0; i < rangesArray.length; i += 1){ const verseRange = rangesArray[i]; const [from, to] = (0,_verseKeys__WEBPACK_IMPORTED_MODULE_2__/* .parseVerseRange */ .p)(verseRange, true); // if the chapter is less than or greater than the range, then skip this range if (chapter < from.chapter || chapter > to.chapter) { continue; } // if the chapter is equal to the chapter of the range start, then check if the verse is within the range // if the verse is less than the range, then skip this range if (chapter === from.chapter && verse < from.verse) { continue; } // if the chapter is equal to the chapter of the range end, then check if the verse is within the range // if the verse is greater than the range, then skip this range if (chapter === to.chapter && verse > to.verse) { continue; } // if we're here, it means that the verse is within the range // so we can return true directly and end the loop return true; } // if we're here, it means that the verse is not within any of the ranges // so we can return false return false; }; /***/ }), /***/ 36495: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "h": () => (/* binding */ generateVerseKeysBetweenTwoVerseKeys), /* harmony export */ "p": () => (/* binding */ parseVerseRange) /* harmony export */ }); /* harmony import */ var lodash_range__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(64042); /* harmony import */ var lodash_range__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_range__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _chapter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(95892); /* eslint-disable react-func/max-lines-per-function */ /* eslint-disable import/prefer-default-export */ /** * Generate the verse keys between two verse keys. * * @param {ChaptersData} chaptersData * @param {string} fromVerseKey * @param {string} toVerseKey * @returns {string[]} */ const generateVerseKeysBetweenTwoVerseKeys = (chaptersData, fromVerseKey, toVerseKey)=>{ const verseKeys = []; const [startChapter, startVerse] = fromVerseKey.split(":"); const [endChapter, endVerse] = toVerseKey.split(":"); if (startChapter === endChapter) { lodash_range__WEBPACK_IMPORTED_MODULE_0___default()(Number(startVerse), Number(endVerse) + 1).forEach((verseNumber)=>{ verseKeys.push(`${startChapter}:${verseNumber}`); }); } else { lodash_range__WEBPACK_IMPORTED_MODULE_0___default()(Number(startChapter), Number(endChapter) + 1).forEach((chapterNumber)=>{ if (chapterNumber === Number(startChapter)) { const chapterData = (0,_chapter__WEBPACK_IMPORTED_MODULE_1__/* .getChapterData */ .dy)(chaptersData, startChapter); lodash_range__WEBPACK_IMPORTED_MODULE_0___default()(Number(startVerse), chapterData.versesCount + 1).forEach((verseNumber)=>{ verseKeys.push(`${startChapter}:${verseNumber}`); }); } else if (chapterNumber === Number(endChapter)) { lodash_range__WEBPACK_IMPORTED_MODULE_0___default()(1, Number(endVerse) + 1).forEach((verseNumber)=>{ verseKeys.push(`${endChapter}:${verseNumber}`); }); } else { const chapterData1 = (0,_chapter__WEBPACK_IMPORTED_MODULE_1__/* .getChapterData */ .dy)(chaptersData, String(chapterNumber)); lodash_range__WEBPACK_IMPORTED_MODULE_0___default()(1, chapterData1.versesCount + 1).forEach((verseNumber)=>{ verseKeys.push(`${chapterNumber}:${verseNumber}`); }); } }); } return verseKeys; }; const parseVerseRange = (verseRange, parseAsNumbers)=>{ const result = verseRange.match(/(\d+):(\d+)-(\d+):(\d+)/); if (!result) { return null; } const [, startChapter, startVerse, endChapter, endVerse] = result; if (!startChapter || !startVerse || !endChapter || !endVerse) { return null; } const parse = (value)=>parseAsNumbers ? Number(value) : value; return [ { chapter: parse(startChapter), verse: parse(startVerse), verseKey: `${startChapter}:${startVerse}` }, { chapter: parse(endChapter), verse: parse(endVerse), verseKey: `${endChapter}:${endVerse}` }, ]; }; /***/ }), /***/ 11721: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); var QueryParam; (function(QueryParam) { QueryParam["Translations"] = "translations"; QueryParam["Reciter"] = "reciter"; QueryParam["WBW_LOCALE"] = "wbw_locale"; QueryParam["HIDE_ARABIC"] = "hideArabic"; QueryParam["FLOW"] = "flow"; QueryParam["STARTING_VERSE"] = "startingVerse"; QueryParam["QUERY"] = "query"; QueryParam["REDIRECT_TO"] = "r"; })(QueryParam || (QueryParam = {})); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (QueryParam); /***/ }), /***/ 50467: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "AN": () => (/* binding */ MushafLines), /* harmony export */ "Bc": () => (/* binding */ QuranReaderFlow), /* harmony export */ "MB": () => (/* binding */ WordClickFunctionality), /* harmony export */ "Oj": () => (/* binding */ WordByWordType), /* harmony export */ "PT": () => (/* binding */ WordByWordDisplay), /* harmony export */ "Qi": () => (/* binding */ QuranReaderDataType), /* harmony export */ "RA": () => (/* binding */ Mushaf), /* harmony export */ "fr": () => (/* binding */ QuranFont), /* harmony export */ "m3": () => (/* binding */ ReadingPreference), /* harmony export */ "ru": () => (/* binding */ QuranFontMushaf), /* harmony export */ "v3": () => (/* binding */ FALLBACK_FONT) /* harmony export */ }); var WordByWordType; (function(WordByWordType) { WordByWordType["Translation"] = "translation"; WordByWordType["Transliteration"] = "transliteration"; })(WordByWordType || (WordByWordType = {})); var ReadingPreference; (function(ReadingPreference) { ReadingPreference["Translation"] = "translation"; ReadingPreference["Reading"] = "reading"; })(ReadingPreference || (ReadingPreference = {})); var WordClickFunctionality; (function(WordClickFunctionality) { WordClickFunctionality["PlayAudio"] = "play-audio"; WordClickFunctionality["NoAudio"] = "no-audio"; })(WordClickFunctionality || (WordClickFunctionality = {})); var QuranReaderDataType; (function(QuranReaderDataType) { QuranReaderDataType["Chapter"] = "chapter"; QuranReaderDataType["Verse"] = "verse"; QuranReaderDataType["ChapterVerseRanges"] = "chapterVerseRanges"; QuranReaderDataType["Ranges"] = "ranges"; QuranReaderDataType["Tafsir"] = "tafsir"; QuranReaderDataType["SelectedTafsir"] = "selectedTafsir"; QuranReaderDataType["Hizb"] = "hizb"; QuranReaderDataType["Juz"] = "juz"; QuranReaderDataType["Rub"] = "rub"; QuranReaderDataType["Page"] = "page"; })(QuranReaderDataType || (QuranReaderDataType = {})); var QuranFont; (function(QuranFont) { QuranFont["MadaniV1"] = "code_v1"; QuranFont["MadaniV2"] = "code_v2"; QuranFont["Uthmani"] = "text_uthmani"; QuranFont["IndoPak"] = "text_indopak"; QuranFont["QPCHafs"] = "qpc_uthmani_hafs"; QuranFont["Tajweed"] = "tajweed"; })(QuranFont || (QuranFont = {})); const FALLBACK_FONT = QuranFont.QPCHafs; var MushafLines; (function(MushafLines) { MushafLines["FifteenLines"] = "15_lines"; MushafLines["SixteenLines"] = "16_lines"; })(MushafLines || (MushafLines = {})); var Mushaf; (function(Mushaf) { Mushaf[Mushaf["QCFV2"] = 1] = "QCFV2"; Mushaf[Mushaf["QCFV1"] = 2] = "QCFV1"; Mushaf[Mushaf["Indopak"] = 3] = "Indopak"; Mushaf[Mushaf["UthmaniHafs"] = 4] = "UthmaniHafs"; Mushaf[Mushaf["KFGQPCHAFS"] = 5] = "KFGQPCHAFS"; Mushaf[Mushaf["Indopak15Lines"] = 6] = "Indopak15Lines"; Mushaf[Mushaf["Indopak16Lines"] = 7] = "Indopak16Lines"; Mushaf[Mushaf["Tajweeed"] = 11] = "Tajweeed"; })(Mushaf || (Mushaf = {})); const QuranFontMushaf = { [QuranFont.MadaniV1]: Mushaf.QCFV1, [QuranFont.MadaniV2]: Mushaf.QCFV2, [QuranFont.Uthmani]: Mushaf.UthmaniHafs, [QuranFont.IndoPak]: Mushaf.Indopak, [QuranFont.QPCHafs]: Mushaf.KFGQPCHAFS, [QuranFont.Tajweed]: Mushaf.Tajweeed }; var WordByWordDisplay; (function(WordByWordDisplay) { WordByWordDisplay["INLINE"] = "inline"; WordByWordDisplay["TOOLTIP"] = "tooltip"; })(WordByWordDisplay || (WordByWordDisplay = {})); var QuranReaderFlow; (function(QuranReaderFlow) { QuranReaderFlow["QURANIC_CALENDER"] = "calendar"; })(QuranReaderFlow || (QuranReaderFlow = {})); /* unused harmony default export */ var __WEBPACK_DEFAULT_EXPORT__ = ({ ReadingPreference, QuranFont }); /***/ }), /***/ 92086: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "N": () => (/* binding */ SearchMode) /* harmony export */ }); var SearchMode; (function(SearchMode) { SearchMode["Advanced"] = "advanced"; SearchMode["Quick"] = "quick"; })(SearchMode || (SearchMode = {})); /***/ }), /***/ 64609: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); var SearchService; (function(SearchService) { SearchService["KALIMAT"] = "kalimat"; SearchService["QDC"] = "qdc"; SearchService["Tarteel"] = "tarteel"; })(SearchService || (SearchService = {})); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SearchService); /***/ }), /***/ 87582: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "H": () => (/* binding */ SearchNavigationType) /* harmony export */ }); var SearchNavigationType; (function(SearchNavigationType) { SearchNavigationType["SURAH"] = "surah"; SearchNavigationType["JUZ"] = "juz"; SearchNavigationType["HIZB"] = "hizb"; SearchNavigationType["AYAH"] = "ayah"; SearchNavigationType["RUB_EL_HIZB"] = "rub_el_hizb"; SearchNavigationType["SEARCH_PAGE"] = "search_page"; SearchNavigationType["PAGE"] = "page"; SearchNavigationType["RANGE"] = "range"; })(SearchNavigationType || (SearchNavigationType = {})); /***/ }), /***/ 73634: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); var SearchType; (function(SearchType) { SearchType["Voice"] = "voice"; SearchType["Text"] = "text"; })(SearchType || (SearchType = {})); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SearchType); /***/ }), /***/ 70301: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var map = { "./ar": 59875, "./ar.ts": 59875, "./bn": 79395, "./bn.ts": 79395, "./en": 84835, "./en.ts": 84835, "./fa": 15412, "./fa.ts": 15412, "./fr": 30823, "./fr.ts": 30823, "./id": 41950, "./id.ts": 41950, "./it": 84443, "./it.ts": 84443, "./ms": 38195, "./ms.ts": 38195, "./nl": 10024, "./nl.ts": 10024, "./pt": 80563, "./pt.ts": 80563, "./ru": 23269, "./ru.ts": 23269, "./sq": 12586, "./sq.ts": 12586, "./th": 43222, "./th.ts": 43222, "./tr": 79896, "./tr.ts": 79896, "./ur": 80046, "./ur.ts": 80046, "./zh": 5492, "./zh.ts": 5492 }; function webpackContext(req) { var id = webpackContextResolve(req); return __webpack_require__(id); } function webpackContextResolve(req) { if(!__webpack_require__.o(map, req)) { var e = new Error("Cannot find module '" + req + "'"); e.code = 'MODULE_NOT_FOUND'; throw e; } return map[req]; } webpackContext.keys = function webpackContextKeys() { return Object.keys(map); }; webpackContext.resolve = webpackContextResolve; module.exports = webpackContext; webpackContext.id = 70301; /***/ }) }; ; //# sourceMappingURL=57933.js.map