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,WAAa,MAAO,EAAO,KAC5B,KACQ,GAAa,KAAO,GAAa,eACjC,QAAc,EAAI,QAAQ,iBAAiB,EAAO,IAGtD,aADqB,EAAI,OAAO,YAAY,EAAO,GAAa,SAEpE,CACA,MAAO,GACH,MAAM,IAAI,SAAS,UAAU,EACjC,GASJ,KAAK,IAAM,MAAO,EAAO,KACrB,IACQ,GAAY,cACZ,QAAc,EAAI,QAAQ,iBAAiB,IAG/C,aADqB,EAAI,OAAO,KAAK,EAAO,EAEhD,CACA,MAAO,GACH,MAAM,IAAI,SAAS,SAAS,EAChC,GAUJ,KAAK,SAAW,MAAO,EAAO,EAAQ,KAClC,IAEI,aADqB,EAAI,OAAO,UAAU,EAAO,EAAQ,EAE7D,CACA,MAAO,GACH,MAAM,IAAI,SAAS,cAAc,EACrC,GAYJ,KAAK,gBAAkB,MAAO,EAAO,KACjC,IACI,MAAM,EAAwB,CAC1B,KAAM,SACN,MAAO,GAAuB,OAAS,GACvC,OAAQ,EACR,OAAQ,aACR,SAAU,WAEP,CAAE,SAAyB,EAAI,UAAU,SAAS,GAAuB,GAChF,OAAO,CACX,CACA,MAAO,GACH,MAAM,IAAI,SAAS,qBAAqB,EAC5C,GAOJ,KAAK,aAAgB,KACjB,EAAI,UAAU,cAAc,EAAU,EAE1C,aAAa,QAAQ,YAAa,SAClC,aAAa,QAAQ,iBAAkB,SACvC,aAAa,QAAQ,iBAAkB,SACvC,aAAa,QAAQ,UAAW,SAChC,QAAQ,QAAU","file":"/npm/wikipedia@2.4.2/dist/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/wikipedia@2.4.2/dist/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    var desc = Object.getOwnPropertyDescriptor(m, k);\n    if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n      desc = { enumerable: true, get: function() { return m[k]; } };\n    }\n    Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n    for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst request_1 = require(\"./request\");\nconst page_1 = require(\"./page\");\nconst errors_1 = require(\"./errors\");\nconst messages_1 = require(\"./messages\");\nconst utils_1 = require(\"./utils\");\n/**\n * The default wiki export\n *\n * @remarks\n * Internally calls wiki.page\n *\n */\nconst wiki = async (title, pageOptions) => {\n    return wiki.page(title, pageOptions);\n};\n/**\n * Returns the search results for a given query\n *\n * @remarks\n * Limits results by default to 10\n *\n * @param query - The string to search for\n * @param searchOptions - The number of results and if suggestion needed {@link searchOptions | searchOptions }\n * @returns an array of {@link wikiSearchResult | wikiSearchResult }\n */\nwiki.search = async (query, searchOptions) => {\n    try {\n        const searchParams = {\n            'list': 'search',\n            'srprop': '',\n            'srlimit': searchOptions?.limit || 10,\n            'srsearch': query\n        };\n        searchOptions?.suggestion ? searchParams['srinfo'] = 'suggestion' : null;\n        const response = await (0, request_1.default)(searchParams);\n        const result = {\n            results: response.query.search,\n            suggestion: response.query.searchinfo ? response.query.searchinfo.suggestion : null\n        };\n        return result;\n    }\n    catch (error) {\n        throw new errors_1.searchError(error);\n    }\n};\n/**\n * Returns the page for a given title or string\n *\n * @remarks\n * Call this method to get the basic info for page and also to preload any params you might use in future\n *\n * @param title - The title or page Id of the page\n * @param pageOptions - Whether to redirect, autoSuggest, use url or preload any fields {@link pageOptions | pageOptions }\n * @returns The intro string\n */\nwiki.page = async (title, pageOptions) => {\n    try {\n        if (pageOptions?.url || pageOptions?.autoSuggest) {\n            title = await (0, utils_1.setTitleForPage)(title, pageOptions);\n        }\n        let pageParams = {\n            prop: 'info|pageprops',\n            inprop: 'url',\n            ppprop: 'disambiguation',\n        };\n        pageParams = (0, utils_1.setPageIdOrTitleParam)(pageParams, title);\n        const response = await (0, request_1.default)(pageParams);\n        let pageInfo = response.query.pages;\n        const pageId = (0, utils_1.setPageId)(pageParams, response);\n        pageInfo = pageInfo[pageId];\n        if (pageInfo.missing == '') {\n            throw new errors_1.pageError(`${messages_1.MSGS.PAGE_NOT_EXIST}${title}`);\n        }\n        const page = new page_1.default(pageInfo);\n        if (pageOptions?.preload) {\n            if (!pageOptions?.fields) {\n                pageOptions.fields = ['summary', 'images'];\n            }\n            for (const field of pageOptions.fields) {\n                await page.runMethod(field);\n            }\n        }\n        return page;\n    }\n    catch (error) {\n        throw new errors_1.pageError(error);\n    }\n};\n/**\n * Returns the intro present in a wiki page\n *\n * @remarks\n * Called in page object and also through wiki default object\n *\n * @param title - The title or page Id of the page\n * @param pageOptions - Whether to redirect in case of 302\n * @returns The intro string\n */\nwiki.intro = async (title, pageOptions) => {\n    try {\n        if (pageOptions?.url || pageOptions?.autoSuggest) {\n            title = await (0, utils_1.setTitleForPage)(title, pageOptions);\n        }\n        const result = await (0, page_1.intro)(title, pageOptions?.redirect);\n        return result;\n    }\n    catch (error) {\n        throw new errors_1.introError(error);\n    }\n};\n/**\n * Returns the images present in a wiki page\n *\n * @remarks\n * Called in page object and also through wiki default object\n *\n * @param title - The title or page Id of the page\n * @param listOptions - {@link listOptions | listOptions }\n * @returns an array of imageResult {@link imageResult | imageResult }\n */\nwiki.images = async (title, listOptions) => {\n    try {\n        if (listOptions?.url || listOptions?.autoSuggest) {\n            title = await (0, utils_1.setTitleForPage)(title, listOptions);\n        }\n        const result = await (0, page_1.images)(title, listOptions);\n        return result;\n    }\n    catch (error) {\n        throw new errors_1.imageError(error);\n    }\n};\n/**\n * Returns the summary of the page\n *\n * @remarks\n * Called in page object and also through wiki default object\n *\n * @param title - The title or page Id of the page\n * @param pageOptions - Whether to redirect in case of 302\n * @returns The summary of the page as {@link wikiSummary | wikiSummary}\n */\nwiki.summary = async (title, pageOptions) => {\n    try {\n        if (pageOptions?.url || pageOptions?.autoSuggest) {\n            title = await (0, utils_1.setTitleForPage)(title, pageOptions);\n        }\n        const result = await (0, page_1.summary)(title, pageOptions?.redirect);\n        return result;\n    }\n    catch (error) {\n        throw new errors_1.summaryError(error);\n    }\n};\n/**\n * Returns the html content of a page\n *\n * @remarks\n * Called in page object and also through wiki default object\n *\n * @param title - The title or page Id of the page\n * @param pageOptions - Whether to redirect in case of 302\n * @returns The html content as string\n *\n * @beta\n */\nwiki.html = async (title, pageOptions) => {\n    try {\n        if (pageOptions?.url || pageOptions?.autoSuggest) {\n            title = await (0, utils_1.setTitleForPage)(title, pageOptions);\n        }\n        const result = await (0, page_1.html)(title, pageOptions?.redirect);\n        return result;\n    }\n    catch (error) {\n        throw new errors_1.htmlError(error);\n    }\n};\n/**\n * Returns the plain text content of a page\n *\n * @remarks\n * Called in page object and also through wiki default object\n *\n * @param title - The title or page Id of the page\n * @param pageOptions - Whether to redirect in case of 302\n * @returns The plain text as string and the parent and revision ids\n */\nwiki.content = async (title, pageOptions) => {\n    try {\n        if (pageOptions?.url || pageOptions?.autoSuggest) {\n            title = await (0, utils_1.setTitleForPage)(title, pageOptions);\n        }\n        const response = await (0, page_1.content)(title, pageOptions?.redirect);\n        return response.result;\n    }\n    catch (error) {\n        throw new errors_1.contentError(error);\n    }\n};\n/**\n * Returns the cetegories present in page\n *\n * @remarks\n * Called in page object and also through wiki default object\n *\n * @param title - The title or page Id of the page\n * @param listOptions - {@link listOptions | listOptions }\n * @returns The categories as an array of string\n */\nwiki.categories = async (title, listOptions) => {\n    try {\n        if (listOptions?.url || listOptions?.autoSuggest) {\n            title = await (0, utils_1.setTitleForPage)(title, listOptions);\n        }\n        const response = await (0, page_1.categories)(title, listOptions);\n        return response;\n    }\n    catch (error) {\n        throw new errors_1.categoriesError(error);\n    }\n};\n/**\n * Returns summaries for 20 pages related to the given page. Summaries include page title, namespace\n * and id along with short text description of the page and a thumbnail.\n *\n * @remarks\n * Called in page object and also through index\n *\n * @param title - The title or page Id of the page\n * @param pageOptions - Whether to redirect in case of 302\n * @returns The related pages and summary as an array of {@link wikiSummary | wikiSummary}\n *\n * @experimental\n */\nwiki.related = async (title, pageOptions) => {\n    try {\n        if (pageOptions?.url || pageOptions?.autoSuggest) {\n            title = await (0, utils_1.setTitleForPage)(title, pageOptions);\n        }\n        const response = await (0, page_1.related)(title, pageOptions?.redirect);\n        return response;\n    }\n    catch (error) {\n        throw new errors_1.relatedError(error);\n    }\n};\n/**\n * Gets the list of media items (images, audio, and video) in the\n * order in which they appear on a given wiki page.\n *\n * @remarks\n * Called in page object and also through index\n *\n * @param title - The title or page Id of the page\n * @param redirect - Whether to redirect in case of 302\n * @returns The related pages and summary as an array of {@link wikiMediaResult | wikiMediaResult}\n *\n * @experimental\n */\nwiki.media = async (title, pageOptions) => {\n    try {\n        if (pageOptions?.url || pageOptions?.autoSuggest) {\n            title = await (0, utils_1.setTitleForPage)(title, pageOptions);\n        }\n        const response = await (0, page_1.media)(title, pageOptions?.redirect);\n        return response;\n    }\n    catch (error) {\n        throw new errors_1.mediaError(error);\n    }\n};\n/**\n * Returns the links present in page\n *\n * @remarks\n * Called in page object and also through wiki default object\n *\n * @param title - The title or page Id of the page\n * @param listOptions - {@link listOptions | listOptions }\n * @returns The links as an array of string\n */\nwiki.links = async (title, listOptions) => {\n    try {\n        if (listOptions?.url || listOptions?.autoSuggest) {\n            title = await (0, utils_1.setTitleForPage)(title, listOptions);\n        }\n        const response = await (0, page_1.links)(title, listOptions);\n        return response;\n    }\n    catch (error) {\n        throw new errors_1.linksError(error);\n    }\n};\n/**\n * Returns the references of external links present in page\n *\n * @remarks\n * Called in page object and also through wiki default object\n *\n * @param title - The title or page Id of the page\n * @param listOptions - {@link listOptions | listOptions }\n * @returns The references as an array of string\n */\nwiki.references = async (title, listOptions) => {\n    try {\n        if (listOptions?.url || listOptions?.autoSuggest) {\n            title = await (0, utils_1.setTitleForPage)(title, listOptions);\n        }\n        const response = await (0, page_1.references)(title, listOptions);\n        return response;\n    }\n    catch (error) {\n        throw new errors_1.linksError(error);\n    }\n};\n/**\n * Returns the coordinates of a page\n *\n * @remarks\n * Called in page object and also through wiki default object\n *\n * @param title - The title or page Id of the page\n * @param pageOptions - Whether to redirect in case of 302\n * @returns The coordinates as {@link coordinatesResult | coordinatesResult}\n */\nwiki.coordinates = async (title, pageOptions) => {\n    try {\n        if (pageOptions?.url || pageOptions?.autoSuggest) {\n            title = await (0, utils_1.setTitleForPage)(title, pageOptions);\n        }\n        const response = await (0, page_1.coordinates)(title, pageOptions?.redirect);\n        return response;\n    }\n    catch (error) {\n        throw new errors_1.coordinatesError(error);\n    }\n};\n/**\n * Returns the language links present in the page\n *\n * @remarks\n * Called in page object and also through wiki default object\n *\n * @param title - The title or page Id of the page\n * @param listOptions - {@link listOptions | listOptions }\n * @returns The links as an array of {@link langLinksResult | langLinksResult }\n */\nwiki.langLinks = async (title, listOptions) => {\n    try {\n        if (listOptions?.url || listOptions?.autoSuggest) {\n            title = await (0, utils_1.setTitleForPage)(title, listOptions);\n        }\n        const response = await (0, page_1.langLinks)(title, listOptions);\n        return response;\n    }\n    catch (error) {\n        throw new errors_1.linksError(error);\n    }\n};\n/**\n * Returns the infobox content of page if present\n *\n * @remarks\n * Called in page object and also through wiki default object\n *\n * @param title - The title or page Id of the page\n * @param pageOptions - Whether to redirect in case of 302\n * @returns The info as JSON object\n */\nwiki.infobox = async (title, pageOptions) => {\n    try {\n        if (pageOptions?.url || pageOptions?.autoSuggest) {\n            title = await (0, utils_1.setTitleForPage)(title, pageOptions);\n        }\n        const response = await (0, page_1.infobox)(title, pageOptions?.redirect);\n        return response;\n    }\n    catch (error) {\n        throw new errors_1.infoboxError(error);\n    }\n};\n/**\n * Returns the table content of page if present\n *\n * @remarks\n * Called in page object and also through wiki default object\n *\n * @param title - The title or page Id of the page\n * @param pageOptions - Whether to redirect in case of 302\n * @returns The tables as arrays of JSON objects\n */\nwiki.tables = async (title, pageOptions) => {\n    try {\n        if (pageOptions?.url || pageOptions?.autoSuggest) {\n            title = await (0, utils_1.setTitleForPage)(title, pageOptions);\n        }\n        const response = await (0, page_1.tables)(title, pageOptions?.redirect);\n        return response;\n    }\n    catch (error) {\n        throw new errors_1.infoboxError(error);\n    }\n};\n/**\n * Returns the languages available in wiki\n *\n * @remarks\n * Use this if you want to check if a lanuage exists before actually setting it\n *\n * @returns The languages an array of {@link languageResult | languageResult}\n */\nwiki.languages = async () => {\n    try {\n        const langParams = {\n            'meta': 'siteinfo',\n            'siprop': 'languages'\n        };\n        const response = await (0, request_1.default)(langParams);\n        const languages = [];\n        for (const lang of response.query.languages) {\n            languages.push({ [lang.code]: lang['*'] });\n        }\n        return languages;\n    }\n    catch (error) {\n        throw new errors_1.wikiError(error);\n    }\n};\n/**\n * sets the languages to given string - verify your input using languages method\n *\n * @remarks\n * Use this to set your language for future api calls\n *\n * @returns The new api endpoint as string\n */\nwiki.setLang = (language) => {\n    const apiUrl = (0, request_1.setAPIUrl)(language);\n    return apiUrl;\n};\n/**\n * Returns the pages with coordinates near the geo search coordinates\n *\n * @remarks\n * Latitude and longitude should be valid values\n *\n * @param latitude - The latitude to search\n * @param longitude - The longitude to search\n * @param geoOptions - The number of results and the search radius {@link geoOptions | geoOptions}\n * @returns The results as an array of {@link geoSearchResult | geoSearchResult}\n */\nwiki.geoSearch = async (latitude, longitude, geoOptions) => {\n    try {\n        const geoSearchParams = {\n            'list': 'geosearch',\n            'gsradius': geoOptions?.radius || 1000,\n            'gscoord': `${latitude}|${longitude}`,\n            'gslimit': geoOptions?.limit || 10,\n            'gsprop': 'type'\n        };\n        const results = await (0, request_1.default)(geoSearchParams);\n        const searchPages = results.query.geosearch;\n        return searchPages;\n    }\n    catch (error) {\n        throw new errors_1.geoSearchError(error);\n    }\n};\n/**\n * Returns the suggestion for a given query\n *\n * @remarks\n * Use this if you want your user to approve the suggestion before using it\n *\n * @param query - The string to query\n * @returns Returns a string or null based on if suggestion is present or not\n */\nwiki.suggest = async (query) => {\n    try {\n        const suggestParams = {\n            'list': 'search',\n            'srinfo': 'suggestion',\n            'srprop': '',\n            'srsearch': query\n        };\n        const result = await (0, request_1.default)(suggestParams);\n        return result.query?.searchinfo?.suggestion ? result.query?.searchinfo?.suggestion : null;\n    }\n    catch (error) {\n        throw new errors_1.searchError(error);\n    }\n};\n/**\n * Returns the events for a given day\n *\n * @remarks\n * The api returns the events that happened on a particular month and day\n *\n * @param eventOptions - the event types, and the month and day {@link eventOptions | eventOptions}\n * @returns Returns the results as array of {@link eventResult | eventResult}\n */\nwiki.onThisDay = async (eventOptions = {}) => {\n    try {\n        const type = eventOptions.type || 'all';\n        const mm = (eventOptions.month || (0, utils_1.getCurrentMonth)()).toString().padStart(2, \"0\");\n        const dd = (eventOptions.day || (0, utils_1.getCurrentDay)()).toString().padStart(2, \"0\");\n        const path = `feed/onthisday/${type}/${mm}/${dd}`;\n        const result = await (0, request_1.makeRestRequest)(path, true);\n        return result;\n    }\n    catch (error) {\n        throw new errors_1.eventsError(error);\n    }\n};\n/**\n * Returns featured content for a given day\n *\n * @remarks\n * The api returns content featured at a particular date\n *\n * @param fcOptions - the year/month/day of featured content by {@link fcOptions | eventOptions}\n * @returns Returns the results as array of {@link fcResult | fcResult}\n */\nwiki.featuredContent = async (fcOptions = {}) => {\n    try {\n        const yyyy = (fcOptions.year || (0, utils_1.getCurrentYear)()).toString();\n        const mm = (fcOptions.month || (0, utils_1.getCurrentMonth)()).toString().padStart(2, \"0\");\n        const dd = (fcOptions.day || (0, utils_1.getCurrentDay)()).toString().padStart(2, \"0\");\n        const path = `feed/featured/${yyyy}/${mm}/${dd}`;\n        const result = await (0, request_1.makeRestRequest)(path, true);\n        return result;\n    }\n    catch (error) {\n        throw new errors_1.fcError(error);\n    }\n};\n/**\n * Returns a random page\n *\n * @param format - The desired return format\n * @returns Returns content from a random page\n */\nwiki.random = async (format) => {\n    try {\n        if (!format) {\n            format = 'summary';\n        }\n        const path = `page/random/${format}`;\n        const result = await (0, request_1.makeRestRequest)(path);\n        return result;\n    }\n    catch (error) {\n        throw new errors_1.wikiError(error);\n    }\n};\n/**\n * Returns mobile-optimised HTML of a page\n *\n * @param title - The title of the page to query\n * @param pageOptions - Whether to redirect in case of 302\n * @returns Returns HTML string\n */\nwiki.mobileHtml = async (title, pageOptions) => {\n    try {\n        if (pageOptions?.url || pageOptions?.autoSuggest) {\n            title = await (0, utils_1.setTitleForPage)(title, pageOptions);\n        }\n        const result = await (0, page_1.mobileHtml)(title, pageOptions?.redirect);\n        return result;\n    }\n    catch (error) {\n        throw new errors_1.htmlError(error);\n    }\n};\n/**\n * Returns pdf of a given page\n *\n * @param title - The title of the page to query\n * @param pdfOptions - {@link pdfOptions | pdfOptions }\n * @returns Returns pdf format\n */\nwiki.pdf = async (title, pdfOptions) => {\n    try {\n        if (pdfOptions?.autoSuggest) {\n            title = await (0, utils_1.setTitleForPage)(title);\n        }\n        const result = await (0, page_1.pdf)(title, pdfOptions);\n        return result;\n    }\n    catch (error) {\n        throw new errors_1.pdfError(error);\n    }\n};\n/**\n * Returns citation of a given page, or query string\n *\n * @param format - the format of the citation result\n * @param query - url or query string\n * @param language - if you want lanuage enabled results\n * @returns Returns citation data\n */\nwiki.citation = async (query, format, language) => {\n    try {\n        const result = await (0, page_1.citation)(query, format, language);\n        return result;\n    }\n    catch (error) {\n        throw new errors_1.citationError(error);\n    }\n};\n/**\n * Returns the autocompletion results for a given query\n *\n * @remarks\n * Limits results by default to 10\n *\n * @param query - The string to search for\n * @param autocompletionOptions - The number of results {@link autocompletionOptions | autocompletionOptions }\n * @returns an array of string\n */\nwiki.autocompletions = async (query, autocompletionOptions) => {\n    try {\n        const autocompletionsParams = {\n            list: \"search\",\n            limit: autocompletionOptions?.limit || 10,\n            search: query,\n            action: \"opensearch\",\n            redirect: \"return\"\n        };\n        const [, autocompletions] = await (0, request_1.default)(autocompletionsParams, false);\n        return autocompletions;\n    }\n    catch (error) {\n        throw new errors_1.autocompletionsError(error);\n    }\n};\n/**\n * Change the default user agent for wikipedia\n *\n * @param userAgent - The new custom userAgent\n */\nwiki.setUserAgent = (userAgent) => {\n    (0, request_1.setUserAgent)(userAgent);\n};\n__exportStar(require(\"./errors\"), exports);\n__exportStar(require(\"./resultTypes\"), exports);\n__exportStar(require(\"./optionTypes\"), exports);\n__exportStar(require(\"./page\"), exports);\nexports.default = wiki;\n"]}