diff --git a/README.md b/README.md index 40fb9a0a..29af56b2 100644 --- a/README.md +++ b/README.md @@ -475,6 +475,8 @@ wtf - **.title()** - get/set the title of the page from the first-sentence - **.pageID()** - get/set the wikimedia id of the page, if we have it. +- **.wikidata()** - get/set the wikidata id of the page, if we have it. +- **.domain()** - get/set the domain of the wiki we're on, if we have it. - **.url()** - (try to) generate the url for the current article - **.lang()** - get/set the current language (used for url method) - **.namespace()** - get/set the wikimedia namespace of the page, if we have it @@ -654,6 +656,9 @@ wtf.fetch('2016-06-04_-_J.Fernandes_@_FIL,_Lisbon', { domain: 'www.mixesdb.com', }) ``` +for image-urls to work properly, the wiki should also have `Special:Redirect` enabled. +Some wikis, (like wikia) have intentionally disabled this. + ### i18n and multi-language: wikitext is (amazingly) used across all languages, wikis, and even in right-to-left languages. diff --git a/builds/wtf_wikipedia-client.js b/builds/wtf_wikipedia-client.js index 450ad04d..ba30f168 100644 --- a/builds/wtf_wikipedia-client.js +++ b/builds/wtf_wikipedia-client.js @@ -1,4 +1,4 @@ -/* wtf_wikipedia 8.3.0 MIT */ +/* wtf_wikipedia 8.4.0 MIT */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : @@ -74,7 +74,7 @@ if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; - if (n === "Map" || n === "Set") return Array.from(n); + if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } @@ -93,7 +93,7 @@ var isInterWiki = /(wiktionary|wikinews|wikibooks|wikiquote|wikisource|wikispecies|wikiversity|wikivoyage|wikipedia|wikimedia|foundation|meta)\.org/; var defaults = { action: 'query', - prop: 'revisions', + prop: 'revisions|pageprops', //we use the 'revisions' api here, instead of the Raw api, for its CORS-rules.. rvprop: 'content', maxlag: 5, @@ -185,10 +185,20 @@ text = page.revisions[0].slots.main['*']; } + page.pageprops = page.pageprops || {}; + var domain = options.domain; + + if (!domain && options.wiki) { + domain = "".concat(options.wiki, ".org"); + } + var meta = Object.assign({}, options, { title: page.title, pageID: page.pageid, - namespace: page.ns + namespace: page.ns, + domain: domain, + wikidata: page.pageprops.wikibase_item, + description: page.pageprops['wikibase-shortdesc'] }); try { @@ -553,7 +563,7 @@ var toJson_1 = toJson$1; - var server = 'https://wikipedia.org/wiki/Special:Redirect/file/'; + var server = 'wikipedia.org'; var encodeTitle = function encodeTitle(file) { var title = file.replace(/^(image|file?)\:/i, ''); //titlecase it @@ -604,12 +614,15 @@ return []; }, url: function url() { - return server + makeSrc(this.file()); + // let lang = 'en' //this.language() || 'en' //hmm: get actual language? + var fileName = makeSrc(this.file()); + var domain = this.data.domain || server; + var path = "wiki/Special:Redirect/file"; + return "https://".concat(domain, "/").concat(path, "/").concat(fileName); }, thumbnail: function thumbnail(size) { size = size || 300; - var path = makeSrc(this.file()); - return server + path + '?width=' + size; + return this.url() + '?width=' + size; }, format: function format() { var arr = this.file().split('.'); @@ -678,6 +691,20 @@ return this.data.pageID; }, + wikidata: function wikidata(id) { + if (id !== undefined) { + this.data.wikidata = id; + } + + return this.data.wikidata; + }, + domain: function domain(str) { + if (str !== undefined) { + this.data.domain = str; + } + + return this.data.domain; + }, language: function language(lang) { if (lang !== undefined) { this.data.lang = lang; @@ -693,7 +720,7 @@ } var lang = this.language() || 'en'; - var domain = this.data.domain || 'wikipedia.org'; // replace blank to underscore + var domain = this.domain() || 'wikipedia.org'; // replace blank to underscore title = title.replace(/ /g, '_'); title = encodeURIComponent(title); @@ -780,6 +807,8 @@ return this.sentences(0); }, images: function images(clue) { + var _this2 = this; + var arr = _sectionMap(this, 'images', null); //grab image from infobox, first this.infoboxes().forEach(function (info) { @@ -795,6 +824,8 @@ obj.images = obj.images || []; obj.images.forEach(function (img) { if (img instanceof Image_1 === false) { + img.language = _this2.language(); + img.domain = _this2.domain(); img = new Image_1(img); } @@ -2171,7 +2202,7 @@ var ignore_links = /^:?(category|catégorie|Kategorie|Categoría|Categoria|Categorie|Kategoria|تصنيف|image|file|image|fichier|datei|media):/i; var external_link = /\[(https?|news|ftp|mailto|gopher|irc)(:\/\/[^\]\| ]{4,1500})([\| ].*?)?\]/g; - var link_reg = /\[\[(.{0,160}?)\]\]([a-z]+)?(\w{0,10})/gi; //allow dangling suffixes - "[[flanders]]s" + var link_reg = /\[\[(.{0,160}?)\]\]([a-z]+)?/gi; //allow dangling suffixes - "[[flanders]]s" var external_links = function external_links(links, str) { str.replace(external_link, function (raw, protocol, link, text) { @@ -2323,11 +2354,17 @@ //only kill ref tags if they are selfclosing wiki = wiki.replace(/ ?< ?(ref) [a-zA-Z0-9=" ]{2,100}\/ ?> ?/g, ' '); // - //some formatting xml, we'll keep their insides though + // convert these html tags to known formatting + + wiki = wiki.replace(/(.*?)<\/i>/g, "''$1''"); + wiki = wiki.replace(/(.*?)<\/b>/g, "'''$1'''"); // these are better-handled with templates + + wiki = wiki.replace(/(.*?)<\/sub>/g, "{{sub|$1}}"); + wiki = wiki.replace(/(.*?)<\/sup>/g, "{{sup|$1}}"); //some formatting xml, we'll keep their insides though wiki = wiki.replace(/ ?<[ \/]?(p|sub|sup|span|nowiki|div|table|br|tr|td|th|pre|pre2|hr)[ \/]?> ?/g, ' '); //, - wiki = wiki.replace(/ ?<[ \/]?(abbr|bdi|bdo|blockquote|cite|del|dfn|em|i|ins|kbd|mark|q|s|small)[ \/]?> ?/g, ' '); //, + wiki = wiki.replace(/ ?<[ \/]?(abbr|bdi|bdo|blockquote|cite|del|dfn|em|ins|kbd|mark|q|s|small)[ \/]?> ?/g, ' '); //, wiki = wiki.replace(/ ?<[ \/]?h[0-9][ \/]?> ?/g, ' '); //

,

@@ -4354,7 +4391,7 @@ "super": true }; //images are usually [[image:my_pic.jpg]] - var oneImage = function oneImage(img) { + var oneImage = function oneImage(img, doc) { var m = img.match(file_reg); if (m === null || !m[2]) { @@ -4370,7 +4407,9 @@ if (title) { var obj = { - file: file + file: file, + lang: doc.lang, + domain: doc.domain }; //try to grab other metadata, too img = img.replace(/^\[\[/, ''); @@ -4393,20 +4432,20 @@ obj.caption = parseSentence$4(arr[arr.length - 1]); } - return new Image_1(obj, img); + return new Image_1(obj); } return null; }; - var parseImages = function parseImages(paragraph) { + var parseImages = function parseImages(paragraph, doc) { var wiki = paragraph.wiki; //parse+remove scary '[[ [[]] ]]' stuff var matches = nested_find_1(wiki); matches.forEach(function (s) { if (isFile.test(s) === true) { paragraph.images = paragraph.images || []; - var img = oneImage(s); + var img = oneImage(s, doc); if (img) { paragraph.images.push(img); @@ -4563,7 +4602,7 @@ list: list }; - var parseParagraphs = function parseParagraphs(section) { + var parseParagraphs = function parseParagraphs(section, doc) { var wiki = section.wiki; var paragraphs = wiki.split(twoNewLines); //don't create empty paragraphs @@ -4580,7 +4619,7 @@ parse$5.list(paragraph); // parse images - parse$5.image(paragraph); //parse the sentences + parse$5.image(paragraph, doc); //parse the sentences parseSentences(paragraph); return new Paragraph_1(paragraph); @@ -4618,6 +4657,7 @@ var Infobox = function Infobox(obj) { this._type = obj.type; + this.domain = obj.domain; Object.defineProperty(this, 'data', { enumerable: false, value: obj.data @@ -4662,6 +4702,8 @@ var obj = s.json(); obj.file = obj.text; obj.text = ''; + obj.domain = this.domain; // add domain information for image + return new Image_1(obj); }, get: function get() { @@ -5722,6 +5764,18 @@ } return str; + }, + //https://en.wikipedia.org/wiki/Template:Sub + sub: function sub(tmpl, list) { + var obj = parse$3(tmpl, ['text']); + list.push(obj); + return obj.text || ''; + }, + //https://en.wikipedia.org/wiki/Template:Sup + sup: function sup(tmpl, list) { + var obj = parse$3(tmpl, ['text']); + list.push(obj); + return obj.text || ''; } }; //aliases @@ -6344,19 +6398,19 @@ return ''; }, // https://en.wikipedia.org/wiki/Template:See - 'see': function see(tmpl, list) { + see: function see(tmpl, list) { var obj = parse$3(tmpl); list.push(obj); return ''; }, // https://en.wikipedia.org/wiki/Template:For - 'for': function _for(tmpl, list) { + "for": function _for(tmpl, list) { var obj = parse$3(tmpl); list.push(obj); return ''; }, // https://en.wikipedia.org/wiki/Template:Further - 'further': function further(tmpl, list) { + further: function further(tmpl, list) { var obj = parse$3(tmpl); list.push(obj); return ''; @@ -6368,7 +6422,7 @@ return ''; }, // https://en.wikipedia.org/wiki/Template:Listen - 'listen': function listen(tmpl, list) { + listen: function listen(tmpl, list) { var obj = parse$3(tmpl); list.push(obj); return ''; @@ -6472,7 +6526,8 @@ images = images.map(function (file) { var img = { file: file - }; + }; // TODO: add lang and domain information + return new Image_1(img).json(); }); obj = { @@ -6602,7 +6657,7 @@ }; //a bunch of aliases for these ones: // https://en.wikipedia.org/wiki/Category:Tournament_bracket_templates - var brackets = ['2teambracket', '4team2elimbracket', '8teambracket', '16teambracket', '32teambracket', 'cwsbracket', 'nhlbracket', 'nhlbracket-reseed', '4teambracket-nhl', '4teambracket-ncaa', '4teambracket-mma', '4teambracket-mlb', '8teambracket-nhl', '8teambracket-mlb', '8teambracket-ncaa', '8teambracket-afc', '8teambracket-afl', '8teambracket-tennis3', '8teambracket-tennis5', '16teambracket-nhl', '16teambracket-nhl divisional', '16teambracket-nhl-reseed', '16teambracket-nba', '16teambracket-swtc', '16teambracket-afc', '16teambracket-tennis3', '16teambracket-tennis5']; + var brackets = ['2teambracket', '4team2elimbracket', '8teambracket', '16teambracket', '32teambracket', '4roundbracket-byes', 'cwsbracket', 'nhlbracket', 'nhlbracket-reseed', '4teambracket-nhl', '4teambracket-ncaa', '4teambracket-mma', '4teambracket-mlb', '16teambracket-two-reseeds', '8teambracket-nhl', '8teambracket-mlb', '8teambracket-ncaa', '8teambracket-afc', '8teambracket-afl', '8teambracket-tennis3', '8teambracket-tennis5', '16teambracket-nhl', '16teambracket-nhl divisional', '16teambracket-nhl-reseed', '16teambracket-nba', '16teambracket-swtc', '16teambracket-afc', '16teambracket-tennis3', '16teambracket-tennis5']; brackets.forEach(function (key) { all[key] = all['4teambracket']; }); @@ -8174,7 +8229,7 @@ }; //reduce the scary recursive situations - var allTemplates = function allTemplates(section) { + var allTemplates = function allTemplates(section, doc) { var wiki = section.wiki; // nested data-structure of templates var list = find(wiki); @@ -8219,6 +8274,8 @@ } if (isInfobox$1(obj) === true) { + obj.domain = doc.domain; // + section.infoboxes.push(new Infobox_1(obj)); return false; } @@ -8241,7 +8298,7 @@ //all deities help us. truly -> https://en.wikipedia.org/wiki/Help:Gallery_tag // - not to be confused with https://en.wikipedia.org/wiki/Template:Gallery... - var parseGallery = function parseGallery(section) { + var parseGallery = function parseGallery(section, doc) { var wiki = section.wiki; wiki = wiki.replace(/]*?)>([\s\S]+?)<\/gallery>/g, function (_, attrs, inside) { var images = inside.split(/\n/g); @@ -8252,7 +8309,9 @@ images = images.map(function (str) { var arr = str.split(/\|/); var obj = { - file: arr[0].trim() + file: arr[0].trim(), + lang: doc.language, + domain: doc.domain }; var img = new Image_1(obj).json(); var caption = arr.slice(1).join('|'); @@ -8462,9 +8521,9 @@ // ... others are {{start}}...{{end}} // -> these are those ones. - var xmlTemplates = function xmlTemplates(section) { + var xmlTemplates = function xmlTemplates(section, doc) { election(section); - gallery(section); + gallery(section, doc); math$1(section); mlb(section); mma(section); @@ -8486,11 +8545,11 @@ }; var oneSection = function oneSection(section, doc) { - parse$6.startEndTemplates(section); //parse-out the tags + parse$6.startEndTemplates(section, doc); //parse-out the tags parse$6.references(section); //parse-out all {{templates}} - parse$6.templates(section); // //parse the tables + parse$6.templates(section, doc); // //parse the tables parse$6.table(section); //now parse all double-newlines @@ -8764,7 +8823,7 @@ url = "https://".concat(options.domain, "/").concat(options.path, "?"); } - url += "format=json&action=query&generator=random&grnnamespace=0&prop=revisions&rvprop=content&grnlimit=1&rvslots=main&origin=*"; + url += "format=json&action=query&generator=random&grnnamespace=0&prop=revisions|pageprops&rvprop=content&grnlimit=1&rvslots=main&origin=*"; var headers = _headers(options); return client(url, headers).then(function (res) { try { @@ -8879,7 +8938,7 @@ var category = fetchCategory; - var _version = '8.3.0'; + var _version = '8.4.0'; var wtf = function wtf(wiki, options) { return _01Document(wiki, options); diff --git a/builds/wtf_wikipedia-client.min.js b/builds/wtf_wikipedia-client.min.js index a7d1302d..c716c579 100644 --- a/builds/wtf_wikipedia-client.min.js +++ b/builds/wtf_wikipedia-client.min.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).wtf=t()}(this,(function(){"use strict";var e=function(e){var t=new URL(e),i=t.pathname.replace(/^\/(wiki\/)?/,"");return i=decodeURIComponent(i),{domain:t.host,title:i}};function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var i=[],n=!0,a=!1,r=void 0;try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done)&&(i.push(o.value),!t||i.length!==t);n=!0);}catch(e){a=!0,r=e}finally{try{n||null==s.return||s.return()}finally{if(a)throw r}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return n(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(i);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return n(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);iObject.keys(t.data).length?-1:1})),"number"==typeof e?t[e]:t},text:function(e){return e=p(e,E),!0===this.isRedirect()?"":this.sections().map((function(t){return t.text(e)})).join("\n\n")},json:function(e){return e=p(e,E),d(this,e)},debug:function(){return console.log("\n"),this.sections().forEach((function(e){for(var t=" - ",i=0;i500)&&U.test(e)},K=function(e){var t=e.match(U);return t&&t[2]?(R(t[2])||[])[0]:{}},B=["table","code","score","data","categorytree","charinsert","hiero","imagemap","inputbox","nowiki","poem","references","source","syntaxhighlight","timeline"],W="< ?(".concat(B.join("|"),") ?[^>]{0,200}?>"),Y="< ?/ ?(".concat(B.join("|"),") ?>"),Z=new RegExp("".concat(W,"[").concat("\\s\\S","]+?").concat(Y),"ig"),G=function(e){return(e=(e=(e=(e=(e=(e=(e=e.replace(Z," ")).replace(/ ?< ?(span|div|table|data) [a-zA-Z0-9=%\.#:;'" ]{2,100}\/? ?> ?/g," ")).replace(/ ?< ?(ref) [a-zA-Z0-9=" ]{2,100}\/ ?> ?/g," ")).replace(/ ?<[ \/]?(p|sub|sup|span|nowiki|div|table|br|tr|td|th|pre|pre2|hr)[ \/]?> ?/g," ")).replace(/ ?<[ \/]?(abbr|bdi|bdo|blockquote|cite|del|dfn|em|i|ins|kbd|mark|q|s|small)[ \/]?> ?/g," ")).replace(/ ?<[ \/]?h[0-9][ \/]?> ?/g," ")).replace(/ ?< ?br ?\/> ?/g,"\n")).trim()};var H=function(e){var t=e.wiki;t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace(//g,"")).replace(/__(NOTOC|NOEDITSECTION|FORCETOC|TOC)__/gi,"")).replace(/~~{1,3}/g,"")).replace(/\r/g,"")).replace(/\u3002/g,". ")).replace(/----/g,"")).replace(/\{\{\}\}/g," – ")).replace(/\{\{\\\}\}/g," / ")).replace(/ /g," "),t=(t=(t=G(t)).replace(/\([,;: ]+?\)/g,"")).replace(/{{(baseball|basketball) (primary|secondary) (style|color).*?\}\}/i,""),e.wiki=t},V=/[\\\.$]/,J=function(e){return"string"!=typeof e&&(e=""),e=(e=(e=e.replace(/\\/g,"\\\\")).replace(/^\$/,"\\u0024")).replace(/\./g,"\\u002e")},Q=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Object.keys(e),i=0;i0&&(i.paragraphs=n)}if(!0===t.images){var a=e.images().map((function(e){return e.json(t)}));a.length>0&&(i.images=a)}if(!0===t.tables){var r=e.tables().map((function(e){return e.json(t)}));r.length>0&&(i.tables=r)}if(!0===t.templates){var o=e.templates();o.length>0&&(i.templates=o,!0===t.encode&&i.templates.forEach((function(e){return Q(e)})))}if(!0===t.infoboxes){var s=e.infoboxes().map((function(e){return e.json(t)}));s.length>0&&(i.infoboxes=s)}if(!0===t.lists){var c=e.lists().map((function(e){return e.json(t)}));c.length>0&&(i.lists=c)}if(!0===t.references||!0===t.citations){var u=e.references().map((function(e){return e.json(t)}));u.length>0&&(i.references=u)}return!0===t.sentences&&(i.sentences=e.sentences().map((function(e){return e.json(t)}))),i},te={tables:!0,references:!0,paragraphs:!0,templates:!0,infoboxes:!0},ie=function(e){this.depth=e.depth,this.doc=null,this._title=e.title||"",Object.defineProperty(this,"doc",{enumerable:!1,value:null}),e.templates=e.templates||[],Object.defineProperty(this,"data",{enumerable:!1,value:e})},ne={title:function(){return this._title||""},index:function(){if(!this.doc)return null;var e=this.doc.sections().indexOf(this);return-1===e?null:e},indentation:function(){return this.depth},sentences:function(e){var t=this.paragraphs().reduce((function(e,t){return e.concat(t.sentences())}),[]);return"number"==typeof e?t[e]:t||[]},paragraphs:function(e){var t=this.data.paragraphs||[];return"number"==typeof e?t[e]:t||[]},paragraph:function(e){var t=this.data.paragraphs||[];return"number"==typeof e?t[e]:t[0]},links:function(e){var t=[];if(this.infoboxes().forEach((function(i){i.links(e).forEach((function(e){return t.push(e)}))})),this.sentences().forEach((function(i){i.links(e).forEach((function(e){return t.push(e)}))})),this.tables().forEach((function(i){i.links(e).forEach((function(e){return t.push(e)}))})),this.lists().forEach((function(i){i.links(e).forEach((function(e){return t.push(e)}))})),"number"==typeof e)return t[e];if("string"==typeof e){e=e.charAt(0).toUpperCase()+e.substring(1);var i=t.find((function(t){return t.page()===e}));return void 0===i?[]:[i]}return t},tables:function(e){var t=this.data.tables||[];return"number"==typeof e?t[e]:t},templates:function(e){var t=this.data.templates||[];return t=t.map((function(e){return e.json()})),"number"==typeof e?t[e]:"string"==typeof e?(e=e.toLowerCase(),t.filter((function(t){return t.template===e||t.name===e}))):t},infoboxes:function(e){var t=this.data.infoboxes||[];return"number"==typeof e?t[e]:t},coordinates:function(e){var t=[].concat(this.templates("coord"),this.templates("coor"));return"number"==typeof e?t[e]?t[e]:[]:t},lists:function(e){var t=[];return this.paragraphs().forEach((function(e){t=t.concat(e.lists())})),"number"==typeof e?t[e]:t},interwiki:function(e){var t=[];return this.paragraphs().forEach((function(e){t=t.concat(e.interwiki())})),"number"==typeof e?t[e]:t||[]},images:function(e){var t=[];return this.paragraphs().forEach((function(e){t=t.concat(e.images())})),"number"==typeof e?t[e]:t||[]},references:function(e){var t=this.data.references||[];return"number"==typeof e?t[e]:t},remove:function(){if(!this.doc)return null;var e={};e[this.title()]=!0,this.children().forEach((function(t){return e[t.title()]=!0}));var t=this.doc.data.sections;return t=t.filter((function(t){return!0!==e.hasOwnProperty(t.title())})),this.doc.data.sections=t,this.doc},nextSibling:function(){if(!this.doc)return null;for(var e=this.doc.sections(),t=this.index()+1;tthis.depth)for(var a=i+1;athis.depth;a+=1)n.push(t[a]);return"string"==typeof e?(e=e.toLowerCase(),n.find((function(t){return t.title().toLowerCase()===e}))):"number"==typeof e?n[e]:n},parent:function(){if(!this.doc)return null;for(var e=this.doc.sections(),t=this.index();t>=0;t-=1)if(e[t]&&e[t].depth0&&(e.fmt=e.fmt||{},e.fmt.bold=t),i.length>0&&(e.fmt=e.fmt||{},e.fmt.italic=i),e},me=/^[0-9,.]+$/,de={text:!0,links:!0,formatting:!0,numbers:!0},fe=function(e,t){t=p(t,de);var i={},n=e.text();if(!0===t.text&&(i.text=n),!0===t.numbers&&me.test(n)){var a=Number(n.replace(/,/g,""));!1===isNaN(a)&&(i.number=a)}return t.links&&e.links().length>0&&(i.links=e.links().map((function(e){return e.json()}))),t.formatting&&e.data.fmt&&(i.formatting=e.data.fmt),i},ge=function(e){Object.defineProperty(this,"data",{enumerable:!1,value:e})},he={links:function(e){var t=this.data.links||[];if("number"==typeof e)return t[e];if("string"==typeof e){e=e.charAt(0).toUpperCase()+e.substring(1);var i=t.find((function(t){return t.page===e}));return void 0===i?[]:[i]}return t},interwiki:function(e){var t=this.links().filter((function(e){return void 0!==e.wiki}));return"number"==typeof e?t[e]:t},bolds:function(e){var t=[];return this.data&&this.data.fmt&&this.data.fmt.bold&&(t=this.data.fmt.bold||[]),"number"==typeof e?t[e]:t},italics:function(e){var t=[];return this.data&&this.data.fmt&&this.data.fmt.italic&&(t=this.data.fmt.italic||[]),"number"==typeof e?t[e]:t},dates:function(e){var t=[];return"number"==typeof e?t[e]:t},text:function(e){return void 0!==e&&"string"==typeof e&&(this.data.text=e),this.data.text||""},json:function(e){return fe(this,e)}};Object.keys(he).forEach((function(e){ge.prototype[e]=he[e]})),ge.prototype.italic=ge.prototype.italics,ge.prototype.bold=ge.prototype.bolds,ge.prototype.plaintext=ge.prototype.text;var be=ge,ke=["ad","adj","adm","adv","al","alta","approx","apr","apt","arc","ariz","assn","asst","atty","aug","ave","ba","bc","bl","bldg","blvd","brig","bros","ca","cal","calif","capt","cca","cg","cl","cm","cmdr","co","col","colo","comdr","conn","corp","cpl","cres","ct","cyn","dak","dec","def","dept","det","dg","dist","dl","dm","dr","ea","eg","eng","esp","esq","est","etc","ex","exp","feb","fem","fig","fl oz","fl","fla","fm","fr","ft","fy","ga","gal","gb","gen","gov","hg","hon","hr","hrs","hwy","hz","ia","ida","ie","inc","inf","jan","jd","jr","jul","jun","kan","kans","kb","kg","km","kmph","lat","lb","lit","llb","lm","lng","lt","ltd","lx","ma","maj","mar","masc","mb","md","messrs","mg","mi","min","minn","misc","mister","ml","mlle","mm","mme","mph","mps","mr","mrs","ms","mstr","mt","neb","nebr","nee","no","nov","oct","okla","ont","op","ord","oz","pa","pd","penn","penna","phd","pl","pp","pref","prob","prof","pron","ps","psa","pseud","pt","pvt","qt","que","rb","rd","rep","reps","res","rev","sask","sec","sen","sens","sep","sept","sfc","sgt","sir","situ","sq ft","sq","sr","ss","st","supt","surg","tb","tbl","tbsp","tce","td","tel","temp","tenn","tex","tsp","univ","usafa","ut","va","vb","ver","vet","vitro","vivo","vol","vs","vt","wis","wisc","wr","wy","wyo","yb","µg"].concat("[^]][^]]"),we=new RegExp("(^| |')("+ke.join("|")+")[.!?] ?$","i"),ve=new RegExp("[ |.|'|[][A-Z].? *?$","i"),ye=new RegExp("\\.\\.\\.* +?$"),xe=/ c\. $/,$e=new RegExp("[a-zа-яぁ-ゟ][a-zа-яぁ-ゟ゠-ヿ]","iu"),je=function(e){var t=[],i=[];if(!e||"string"!=typeof e||0===e.trim().length)return t;for(var n=function(e){var t=e.split(/(\n+)/);return function(e){var t=[];return e.forEach((function(e){t=t.concat(e)})),t}(t=(t=t.filter((function(e){return e.match(/\S/)}))).map((function(e){return e.split(/(\S.+?[.!?]"?)(?=\s+|$)/g)})))}(e),a=0;ai.length)return!1;var n=e.match(/"/g);return!(n&&n.length%2!=0&&e.length<900)}(o))?i[s+1]=i[s]+(i[s+1]||""):i[s]&&i[s].length>0&&(t.push(i[s]),i[s]="");return 0===t.length?[e]:t};function ze(e){var t,i={text:e};return le(i),i.text=(t=(t=(t=i.text).replace(/\([,;: ]*\)/g,"")).replace(/\( *(; ?)+/g,"("),t=(t=re(t)).replace(/ +\.$/,".")),i=pe(i),new be(i)}var Ee=ze,Oe=function(e){var t=je(e.wiki);(t=t.map(ze))[0]&&t[0].text()&&":"===t[0].text()[0]&&(t=t.slice(1)),e.sentences=t},_e=function(e){return e=(e=e.replace(/^\{\{/,"")).replace(/\}\}$/,"")},Se=function(e){return e=(e=(e=(e||"").trim()).toLowerCase()).replace(/_/g," ")},Ce=function(e){var t=e.split(/\n?\|/);t.forEach((function(e,i){null!==e&&(/\[\[[^\]]+$/.test(e)||/\{\{[^\}]+$/.test(e)||e.split("{{").length!==e.split("}}").length||e.split("[[").length!==e.split("]]").length)&&(t[i+1]=t[i]+"|"+t[i+1],t[i]=null)}));for(var i=(t=(t=t.filter((function(e){return null!==e}))).map((function(e){return(e||"").trim()}))).length-1;i>=0;i-=1){""===t[i]&&t.pop();break}return t},qe=/^[ '-\)\x2D\.0-9_a-z\xC0-\xFF\u0153\u017F\u1E9E\u212A\u212B]+=/i,Ne={template:!0,list:!0,prototype:!0},Ae=function(e,t){var i=0;return e.reduce((function(e,n){if(n=(n||"").trim(),!0===qe.test(n)){var a=function(e){var t=e.split("="),i=t[0]||"";i=i.toLowerCase().trim();var n=t.slice(1).join("=");return Ne.hasOwnProperty(i)&&(i="_"+i),{key:i,val:n.trim()}}(n);if(a.key)return e[a.key]=a.val,e}t&&t[i]?e[t[i]]=n:(e.list=e.list||[],e.list.push(n));return i+=1,e}),{})},Le={classname:!0,style:!0,align:!0,margin:!0,left:!0,break:!0,boxsize:!0,framestyle:!0,item_style:!0,collapsible:!0,list_style_type:!0,"list-style-type":!0,colwidth:!0},De=function(e){return Object.keys(e).forEach((function(t){!0===Le[t.toLowerCase()]&&delete e[t],null!==e[t]&&""!==e[t]||delete e[t]})),e},Ie=Ee,Te=function(e,t){var i=Ie(e);return"json"===t?i.json():"raw"===t?i:i.text()},Pe=function(e,t,i){t=t||[],e=_e(e||"");var n=Ce(e),a=n.shift(),r=Ae(n,t);return(r=De(r))[1]&&t[0]&&!1===r.hasOwnProperty(t[0])&&(r[t[0]]=r[1],delete r[1]),Object.keys(r).forEach((function(e){r[e]="list"!==e?Te(r[e],i):r[e].map((function(e){return Te(e,i)}))})),a&&(r.template=Se(a)),r},Me=function(e){Object.defineProperty(this,"data",{enumerable:!1,value:e})},Re={title:function(){var e=this.data;return e.title||e.encyclopedia||e.author||""},links:function(e){var t=[];if("number"==typeof e)return t[e];if("number"==typeof e)return t[e];if("string"==typeof e){e=e.charAt(0).toUpperCase()+e.substring(1);var i=t.find((function(t){return t.page()===e}));return void 0===i?[]:[i]}return t||[]},text:function(){return""},json:function(){return this.data}};Object.keys(Re).forEach((function(e){Me.prototype[e]=Re[e]}));var Ue=Me,Fe=Ee,Ke=function(e){return/^ *?\{\{ *?(cite|citation)/i.test(e)&&/\}\} *?$/.test(e)&&!1===/citation needed/i.test(e)},Be=function(e){var t=Pe(e);return t.type=t.template.replace(/cite /,""),t.template="citation",t},We=function(e){return{template:"citation",type:"inline",data:{},inline:Fe(e)||{}}},Ye=function(e){var t=[],i=e.wiki;i=(i=(i=(i=i.replace(/ ?([\s\S]{0,1800}?)<\/ref> ?/gi,(function(e,n){if(Ke(n)){var a=Be(n);a&&t.push(a),i=i.replace(n,"")}else t.push(We(n));return" "}))).replace(/ ?]{0,200}?\/> ?/gi," ")).replace(/ ?]{0,200}?>([\s\S]{0,1800}?)<\/ref> ?/gi,(function(e,n){if(Ke(n)){var a=Be(n);a&&t.push(a),i=i.replace(n,"")}else t.push(We(n));return" "}))).replace(/ ?<[ \/]?[a-z0-9]{1,8}[a-z0-9=" ]{2,20}[ \/]?> ?/g," "),e.references=t.map((function(e){return new Ue(e)})),e.wiki=i},Ze=Ee,Ge=/^(={1,5})(.{1,200}?)={1,5}$/,He=function(e,t){var i=t.match(Ge);if(!i)return e.title="",e.depth=0,e;var n=i[2]||"",a={wiki:n=(n=Ze(n).text()).replace(/\{\{.+?\}\}/,"")};Ye(a),n=re(n=a.wiki);var r=0;return i[1]&&(r=i[1].length-2),e.title=n,e.depth=r,e},Ve=function(e){var t=[],i=[];e=function(e){return e=e.filter((function(e){return e&&!0!==/^\|\+/.test(e)})),!0===/^{\|/.test(e[0])&&e.shift(),!0===/^\|}/.test(e[e.length-1])&&e.pop(),!0===/^\|-/.test(e[0])&&e.shift(),e}(e);for(var n=0;n0&&(t.push(i),i=[]):(!(a=a.split(/(?:\|\||!!)/))[0]&&a[1]&&a.shift(),a.forEach((function(e){e=(e=e.replace(/^\| */,"")).trim(),i.push(e)})))}return i.length>0&&t.push(i),t},Je=/.*rowspan *?= *?["']?([0-9]+)["']?[ \|]*/,Qe=/.*colspan *?= *?["']?([0-9]+)["']?[ \|]*/,Xe=function(e){return e=function(e){return e.forEach((function(t,i){t.forEach((function(n,a){var r=n.match(Je);if(null!==r){var o=parseInt(r[1],10);n=n.replace(Je,""),t[a]=n;for(var s=i+1;s0}))}(e))},et=Ee,tt=/^!/,it={name:!0,age:!0,born:!0,date:!0,year:!0,city:!0,country:!0,population:!0,count:!0,number:!0},nt=function(e){return(e=et(e).text()).match(/\|/)&&(e=e.replace(/.+\| ?/,"")),e=(e=(e=e.replace(/style=['"].*?["']/,"")).replace(/^!/,"")).trim()},at=function(e){return(e=e||[]).length-e.filter((function(e){return e})).length>3},rt=function(e){if(e.length<=3)return[];var t=e[0].slice(0);t=t.map((function(e){return e=e.replace(/^\! */,""),e=et(e).text(),e=(e=nt(e)).toLowerCase()}));for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:[],t=[];at(e[0])&&e.shift();var i=e[0];return i&&i[0]&&i[1]&&(/^!/.test(i[0])||/^!/.test(i[1]))&&(t=i.map((function(e){return e=e.replace(/^\! */,""),e=nt(e)})),e.shift()),(i=e[0])&&i[0]&&i[1]&&/^!/.test(i[0])&&/^!/.test(i[1])&&(i.forEach((function(e,i){e=e.replace(/^\! */,""),e=nt(e),!0===Boolean(e)&&(t[i]=e)})),e.shift()),t}(i=Xe(i));if(!n||n.length<=1){n=rt(i);var a=i[i.length-1]||[];n.length<=1&&a.length>2&&(n=rt(i.slice(1))).length>0&&(i=i.slice(2))}return i.map((function(e){return function(e,t){var i={};return e.forEach((function(e,n){var a=t[n]||"col"+(n+1),r=et(e);r.text(nt(r.text())),i[a]=r})),i}(e,n)}))},st=function(e,t){return e.map((function(e){var i={};return Object.keys(e).forEach((function(t){i[t]=e[t].json()})),!0===t.encode&&(i=Q(i)),i}))},ct={},ut=function(e){Object.defineProperty(this,"data",{enumerable:!1,value:e})},lt={links:function(e){var t=[];if(this.data.forEach((function(e){Object.keys(e).forEach((function(i){t=t.concat(e[i].links())}))})),"number"==typeof e)return t[e];if("string"==typeof e){e=e.charAt(0).toUpperCase()+e.substring(1);var i=t.find((function(t){return t.page()===e}));return void 0===i?[]:[i]}return t},keyValue:function(e){var t=this.json(e);return t.forEach((function(e){Object.keys(e).forEach((function(t){e[t]=e[t].text}))})),t},json:function(e){return e=p(e,ct),st(this.data,e)},text:function(){return""}};lt.keyvalue=lt.keyValue,lt.keyval=lt.keyValue,Object.keys(lt).forEach((function(e){ut.prototype[e]=lt[e]}));var pt=ut,mt=/^\s*{\|/,dt=/^\s*\|}/,ft=function(e){for(var t=[],i=e.wiki,n=i.split("\n"),a=[],r=0;r0&&(a[a.length-1]+="\n"+n[r]);else{a[a.length-1]+="\n"+n[r];var o=a.pop();t.push(o)}else a.push(n[r]);var s=[];t.forEach((function(e){if(e){i=(i=i.replace(e+"\n","")).replace(e,"");var t=ot(e);t&&t.length>0&&s.push(new pt(t))}})),s.length>0&&(e.tables=s),e.wiki=i},gt={sentences:!0},ht=function(e,t){var i={};return!0===(t=p(t,gt)).sentences&&(i.sentences=e.sentences().map((function(e){return e.json(t)}))),i},bt={sentences:!0,lists:!0,images:!0},kt=function(e){Object.defineProperty(this,"data",{enumerable:!1,value:e})},wt={sentences:function(e){return"number"==typeof e?this.data.sentences[e]:this.data.sentences||[]},references:function(e){return"number"==typeof e?this.data.references[e]:this.data.references},lists:function(e){return"number"==typeof e?this.data.lists[e]:this.data.lists},images:function(e){return"number"==typeof e?this.data.images[e]:this.data.images||[]},links:function(e){var t=[];if(this.sentences().forEach((function(i){t=t.concat(i.links(e))})),"number"==typeof e)return t[e];if("string"==typeof e){e=e.charAt(0).toUpperCase()+e.substring(1);var i=t.find((function(t){return t.page()===e}));return void 0===i?[]:[i]}return t||[]},interwiki:function(e){var t=[];return this.sentences().forEach((function(e){t=t.concat(e.interwiki())})),"number"==typeof e?t[e]:t||[]},text:function(e){e=p(e,bt);var t=this.sentences().map((function(t){return t.text(e)})).join(" ");return this.lists().forEach((function(e){t+="\n"+e.text()})),t},json:function(e){return e=p(e,bt),ht(this,e)}};wt.citations=wt.references,Object.keys(wt).forEach((function(e){kt.prototype[e]=wt[e]}));var vt=kt;var yt=function(e){for(var t=[],i=[],n=e.split(""),a=0,r=0;r0){for(var s=0,c=0,u=0;uc&&i.push("]"),t.push(i.join("")),i=[]}}return t},xt=Ee,$t=new RegExp("("+C.images.join("|")+"):","i"),jt="(".concat(C.images.join("|"),")"),zt=new RegExp(jt+":(.+?)[\\||\\]]","iu"),Et={thumb:!0,thumbnail:!0,border:!0,right:!0,left:!0,center:!0,top:!0,bottom:!0,none:!0,upright:!0,baseline:!0,middle:!0,sub:!0,super:!0},Ot=function(e){var t=e.wiki;yt(t).forEach((function(i){if(!0===$t.test(i)){e.images=e.images||[];var n=function(e){var t=e.match(zt);if(null===t||!t[2])return null;var i="".concat(t[1],":").concat(t[2]||""),n=(i=i.trim()).charAt(0).toUpperCase()+i.substring(1);if(n=n.replace(/ /g,"_")){var a={file:i};e=(e=e.replace(/^\[\[/,"")).replace(/\]\]$/,"");var r=Pe(e),o=r.list||[];return r.alt&&(a.alt=r.alt),(o=o.filter((function(e){return!1===Et.hasOwnProperty(e)})))[o.length-1]&&(a.caption=xt(o[o.length-1])),new z(a,e)}return null}(i);n&&e.images.push(n),t=t.replace(i,"")}})),e.wiki=t},_t={},St=function(e){Object.defineProperty(this,"data",{enumerable:!1,value:e})},Ct={lines:function(){return this.data},links:function(e){var t=[];if(this.lines().forEach((function(e){t=t.concat(e.links())})),"number"==typeof e)return t[e];if("string"==typeof e){e=e.charAt(0).toUpperCase()+e.substring(1);var i=t.find((function(t){return t.page()===e}));return void 0===i?[]:[i]}return t},json:function(e){return e=p(e,_t),this.lines().map((function(t){return t.json(e)}))},text:function(){return function(e,t){return e.map((function(e){return" * "+e.text(t)})).join("\n")}(this.data)}};Object.keys(Ct).forEach((function(e){St.prototype[e]=Ct[e]}));var qt=St,Nt=Ee,At=/^[#\*:;\|]+/,Lt=/^\*+[^:,\|]{4}/,Dt=/^ ?\#[^:,\|]{4}/,It=/[a-z_0-9\]\}]/i,Tt=function(e){return At.test(e)||Lt.test(e)||Dt.test(e)},Pt=function(e,t){for(var i=[],n=t;n0&&(i.push(r),a+=r.length-1)}else n.push(t[a]);e.lists=i.map((function(e){return new qt(e)})),e.wiki=n.join("\n")}},Ft=function(e){var t=e.wiki,i=t.split(Rt);i=(i=i.filter((function(e){return e&&e.trim().length>0}))).map((function(e){var t={wiki:e,lists:[],sentences:[],images:[]};return Ut.list(t),Ut.image(t),Mt(t),new vt(t)})),e.wiki=t,e.paragraphs=i},Kt=function(e,t){var i=Object.keys(e.data).reduce((function(t,i){return e.data[i]&&(t[i]=e.data[i].json()),t}),{});return!0===t.encode&&(i=Q(i)),i},Bt=function(e){return(e=(e=e.toLowerCase()).replace(/[-_]/g," ")).trim()},Wt=function(e){this._type=e.type,Object.defineProperty(this,"data",{enumerable:!1,value:e.data})},Yt={type:function(){return this._type},links:function(e){var t=this,i=[];if(Object.keys(this.data).forEach((function(e){t.data[e].links().forEach((function(e){return i.push(e)}))})),"number"==typeof e)return i[e];if("string"==typeof e){e=e.charAt(0).toUpperCase()+e.substring(1);var n=i.find((function(t){return t.page()===e}));return void 0===n?[]:[n]}return i},image:function(){var e=this.get("image")||this.get("image2")||this.get("logo");if(!e)return null;var t=e.json();return t.file=t.text,t.text="",new z(t)},get:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";e=Bt(e);for(var t=Object.keys(this.data),i=0;i0?a++:a=e.indexOf("{",a+1)){var r=e[a];if("{"===r&&(t+=1),t>0){if("}"===r&&0===(t-=1)){n.push(r);var o=n.join("");n=[],/\{\{/.test(o)&&/\}\}/.test(o)&&i.push(o);continue}if(1===t&&"{"!==r&&"}"!==r){t=0,n=[];continue}n.push(r)}}return i},Ht=function(e){var t=null;return(t=/^\{\{[^\n]+\|/.test(e)?(e.match(/^\{\{(.+?)\|/)||[])[1]:-1!==e.indexOf("\n")?(e.match(/^\{\{(.+?)\n/)||[])[1]:(e.match(/^\{\{(.+?)\}\}$/)||[])[1])&&(t=t.replace(/:.*/,""),t=Se(t)),t||null},Vt=/\{\{/,Jt=function(e){return{body:e=e.replace(/#invoke:/,""),name:Ht(e),children:[]}},Qt=function e(t){var i=t.body.substr(2);return i=i.replace(/\}\}$/,""),t.children=Gt(i),t.children=t.children.map(Jt),0===t.children.length||t.children.forEach((function(t){var i=t.body.substr(2);return Vt.test(i)?e(t):null})),t},Xt=function(e){var t=Gt(e);return t=(t=t.map(Jt)).map(Qt)},ei=["anchor","defaultsort","use list-defined references","void","pp","pp-move-indef","pp-semi-indef","pp-vandalism","r","#tag","div col","pope list end","shipwreck list end","starbox end","end box","end","s-end"].reduce((function(e,t){return e[t]=!0,e}),{}),ti=new RegExp("^(subst.)?("+C.infoboxes.join("|")+")[: \n]","i"),ii=/^infobox /i,ni=/ infobox$/i,ai=/$Year in [A-Z]/i,ri={"gnf protein box":!0,"automatic taxobox":!0,"chembox ":!0,editnotice:!0,geobox:!0,hybridbox:!0,ichnobox:!0,infraspeciesbox:!0,mycomorphbox:!0,oobox:!0,"paraphyletic group":!0,speciesbox:!0,subspeciesbox:!0,"starbox short":!0,taxobox:!0,nhlteamseason:!0,"asian games bid":!0,"canadian federal election results":!0,"dc thomson comic strip":!0,"daytona 24 races":!0,edencharacter:!0,"moldova national football team results":!0,samurai:!0,protein:!0,"sheet authority":!0,"order-of-approx":!0,"bacterial labs":!0,"medical resources":!0,ordination:!0,"hockey team coach":!0,"hockey team gm":!0,"pro hockey team":!0,"hockey team player":!0,"hockey team start":!0,mlbbioret:!0},oi=function(e){return!0===ri.hasOwnProperty(e)||(!!ti.test(e)||(!(!ii.test(e)&&!ni.test(e))||!!ai.test(e)))},si=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.template.match(ti),i=e.template;t&&t[0]&&(i=i.replace(t[0],""));var n={template:"infobox",type:i=i.trim(),data:e};return delete n.data.template,delete n.data.list,n},ci=[void 0,"January","February","March","April","May","June","July","August","September","October","November","December"],ui=ci.reduce((function(e,t,i){return 0===i||(e[t.toLowerCase()]=i),e}),{}),li=function(e){return e<10?"0"+e:String(e)},pi=function(e){var t=String(e.year||"");if(void 0!==e.month&&!0===ci.hasOwnProperty(e.month))if(void 0===e.date)t="".concat(ci[e.month]," ").concat(e.year);else{if(t="".concat(ci[e.month]," ").concat(e.date,", ").concat(e.year),void 0!==e.hour&&void 0!==e.minute){var i="".concat(li(e.hour),":").concat(li(e.minute));void 0!==e.second&&(i=i+":"+li(e.second)),t=i+", "+t}e.tz&&(t+=" (".concat(e.tz,")"))}return t},mi=function(e){for(var t={},i=["year","month","date","hour","minute","second"],n=0;n0&&(n.years=a,i-=31536e6*n.years);var r=Math.floor(i/2592e6,10);r>0&&(n.months=r,i-=2592e6*n.months);var o=Math.floor(i/864e5,10);return o>0&&(n.days=o),n},hi=mi,bi=pi,ki=function(e){return{template:"date",data:e}},wi=function(e){var t=(e=_e(e)).split("|"),i=hi(t.slice(1,4)),n=t.slice(4,7);if(0===n.length){var a=new Date;n=[a.getFullYear(),a.getMonth(),a.getDate()]}return{from:i,to:n=hi(n)}},vi={date:function(e,t){var i=Pe(e,["year","month","date","hour","minute","second","timezone"]),n=hi([i.year,i.month,i.date||i.day]);return i.text=bi(n),i.timezone&&("Z"===i.timezone&&(i.timezone="UTC"),i.text+=" (".concat(i.timezone,")")),i.hour&&i.minute&&(i.second?i.text="".concat(i.hour,":").concat(i.minute,":").concat(i.second,", ")+i.text:i.text="".concat(i.hour,":").concat(i.minute,", ")+i.text),i.text&&t.push(ki(i)),i.text},natural_date:function(e,t){var i=Pe(e,["text"]).text||"",n={};if(/^[0-9]{4}$/.test(i))n.year=parseInt(i,10);else{var a=i.replace(/[a-z]+\/[a-z]+/i,"");a=a.replace(/[0-9]+:[0-9]+(am|pm)?/i,"");var r=new Date(a);!1===isNaN(r.getTime())&&(n.year=r.getFullYear(),n.month=r.getMonth()+1,n.date=r.getDate())}return t.push(ki(n)),i.trim()},one_year:function(e,t){var i=Pe(e,["year"]),n=Number(i.year);return t.push(ki({year:n})),String(n)},two_dates:function(e,t){var i=Pe(e,["b","birth_year","birth_month","birth_date","death_year","death_month","death_date"]);if(i.b&&"b"===i.b.toLowerCase()){var n=hi([i.birth_year,i.birth_month,i.birth_date]);return t.push(ki(n)),bi(n)}var a=hi([i.death_year,i.death_month,i.death_date]);return t.push(ki(a)),bi(a)},age:function(e){var t=wi(e);return gi(t.from,t.to).years||0},"diff-y":function(e){var t=wi(e),i=gi(t.from,t.to);return 1===i.years?i.years+" year":(i.years||0)+" years"},"diff-ym":function(e){var t=wi(e),i=gi(t.from,t.to),n=[];return 1===i.years?n.push(i.years+" year"):i.years&&0!==i.years&&n.push(i.years+" years"),1===i.months?n.push("1 month"):i.months&&0!==i.months&&n.push(i.months+" months"),n.join(", ")},"diff-ymd":function(e){var t=wi(e),i=gi(t.from,t.to),n=[];return 1===i.years?n.push(i.years+" year"):i.years&&0!==i.years&&n.push(i.years+" years"),1===i.months?n.push("1 month"):i.months&&0!==i.months&&n.push(i.months+" months"),1===i.days?n.push("1 day"):i.days&&0!==i.days&&n.push(i.days+" days"),n.join(", ")},"diff-yd":function(e){var t=wi(e),i=gi(t.from,t.to),n=[];return 1===i.years?n.push(i.years+" year"):i.years&&0!==i.years&&n.push(i.years+" years"),i.days+=30*(i.months||0),1===i.days?n.push("1 day"):i.days&&0!==i.days&&n.push(i.days+" days"),n.join(", ")},"diff-d":function(e){var t=wi(e),i=gi(t.from,t.to),n=[];return i.days+=365*(i.years||0),i.days+=30*(i.months||0),1===i.days?n.push("1 day"):i.days&&0!==i.days&&n.push(i.days+" days"),n.join(", ")}},yi=function(e){var t=new Date(e);if(isNaN(t.getTime()))return"";var i=(new Date).getTime()-t.getTime(),n="ago";i<0&&(n="from now",i=Math.abs(i));var a=i/1e3/60/60/24;return a<365?parseInt(a,10)+" days "+n:parseInt(a/365,10)+" years "+n},xi=vi.date,$i=vi.natural_date,ji=["January","February","March","April","May","June","July","August","September","October","November","December"],zi=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Ei=Object.assign({},di,{currentday:function(){var e=new Date;return String(e.getDate())},currentdayname:function(){var e=new Date;return zi[e.getDay()]},currentmonth:function(){var e=new Date;return ji[e.getMonth()]},currentyear:function(){var e=new Date;return String(e.getFullYear())},monthyear:function(){var e=new Date;return ji[e.getMonth()]+" "+e.getFullYear()},"monthyear-1":function(){var e=new Date;return e.setMonth(e.getMonth()-1),ji[e.getMonth()]+" "+e.getFullYear()},"monthyear+1":function(){var e=new Date;return e.setMonth(e.getMonth()+1),ji[e.getMonth()]+" "+e.getFullYear()},date:0,"time ago":function(e){var t=Pe(e,["date","fmt"]).date;return yi(t)},"birth date and age":function(e,t){var i=Pe(e,["year","month","day"]);return i.year&&/[a-z]/i.test(i.year)?$i(e,t):(t.push(i),i=mi([i.year,i.month,i.day]),pi(i))},"birth year and age":function(e,t){var i=Pe(e,["birth_year","birth_month"]);if(i.death_year&&/[a-z]/i.test(i.death_year))return $i(e,t);t.push(i);var n=(new Date).getFullYear()-parseInt(i.birth_year,10);i=mi([i.birth_year,i.birth_month]);var a=pi(i);return n&&(a+=" (age ".concat(n,")")),a},"death year and age":function(e,t){var i=Pe(e,["death_year","birth_year","death_month"]);return i.death_year&&/[a-z]/i.test(i.death_year)?$i(e,t):(t.push(i),i=mi([i.death_year,i.death_month]),pi(i))},"birth date and age2":function(e,t){var i=Pe(e,["at_year","at_month","at_day","birth_year","birth_month","birth_day"]);return t.push(i),i=mi([i.birth_year,i.birth_month,i.birth_day]),pi(i)},"birth based on age as of date":function(e,t){var i=Pe(e,["age","year","month","day"]);t.push(i);var n=parseInt(i.age,10),a=parseInt(i.year,10)-n;return a&&n?"".concat(a," (age ").concat(i.age,")"):"(age ".concat(i.age,")")},"death date and given age":function(e,t){var i=Pe(e,["year","month","day","age"]);t.push(i),i=mi([i.year,i.month,i.day]);var n=pi(i);return i.age&&(n+=" (age ".concat(i.age,")")),n},dts:function(e){e=(e=e.replace(/\|format=[ymd]+/i,"")).replace(/\|abbr=(on|off)/i,"");var t=Pe(e,["year","month","date","bc"]);return t.date&&t.month&&t.year?!0===/[a-z]/.test(t.month)?[t.month,t.date,t.year].join(" "):[t.year,t.month,t.date].join("-"):t.month&&t.year?[t.year,t.month].join("-"):t.year?(t.year<0&&(t.year=Math.abs(t.year)+" BC"),t.year):""},start:xi,end:xi,birth:xi,death:xi,"start date":xi,"end date":xi,"birth date":xi,"death date":xi,"start date and age":xi,"end date and age":xi,"start-date":$i,"end-date":$i,"birth-date":$i,"death-date":$i,"birth-date and age":$i,"birth-date and given age":$i,"death-date and age":$i,"death-date and given age":$i,birthdeathage:vi.two_dates,dob:xi,age:vi.age,"age nts":vi.age,"age in years":vi["diff-y"],"age in years and months":vi["diff-ym"],"age in years, months and days":vi["diff-ymd"],"age in years and days":vi["diff-yd"],"age in days":vi["diff-d"]});Ei.localday=Ei.currentday,Ei.localdayname=Ei.currentdayname,Ei.localmonth=Ei.currentmonth,Ei.localyear=Ei.currentyear,Ei.currentmonthname=Ei.currentmonth,Ei.currentmonthabbrev=Ei.currentmonth,Ei["death date and age"]=Ei["birth date and age"],Ei.bda=Ei["birth date and age"],Ei["birth date based on age at death"]=Ei["birth based on age as of date"];var Oi=Ei,_i={tag:function(e){var t=Pe(e,["tag","open"]);return t.open&&"pair"!==t.open?"":{span:!0,div:!0,p:!0}[t.tag]?t.content||"":"<".concat(t.tag," ").concat(t.attribs||"",">").concat(t.content||"","")},plural:function(e){e=e.replace(/plural:/,"plural|");var t=Pe(e,["num","word"]),i=Number(t.num),n=t.word;return 1!==i&&(/.y$/.test(n)?n=n.replace(/y$/,"ies"):n+="s"),i+" "+n},"first word":function(e){var t=Pe(e,["text"]),i=t.text;return t.sep?i.split(t.sep)[0]:i.split(" ")[0]},trunc:function(e){var t=Pe(e,["str","len"]);return t.str.substr(0,t.len)},"str mid":function(e){var t=Pe(e,["str","start","end"]),i=parseInt(t.start,10)-1,n=parseInt(t.end,10);return t.str.substr(i,n)},p1:0,p2:1,p3:2,braces:function(e){var t=Pe(e,["text"]),i="";return t.list&&(i="|"+t.list.join("|")),"{{"+(t.text||"")+i+"}}"},nobold:0,noitalic:0,nocaps:0,syntaxhighlight:function(e,t){var i=Pe(e);return t.push(i),i.code||""},samp:function(e,t){var i=Pe(e,["1"]);return t.push(i),i[1]||""},vanchor:0,resize:1,ra:function(e){var t=Pe(e,["hours","minutes","seconds"]);return[t.hours||0,t.minutes||0,t.seconds||0].join(":")},deg2hms:function(e){return(Pe(e,["degrees"]).degrees||"")+"°"},hms2deg:function(e){var t=Pe(e,["hours","minutes","seconds"]);return[t.hours||0,t.minutes||0,t.seconds||0].join(":")},decdeg:function(e){var t=Pe(e,["deg","min","sec","hem","rnd"]);return(t.deg||t.degrees)+"°"},rnd:0,dec:function(e){var t=Pe(e,["degrees","minutes","seconds"]),i=(t.degrees||0)+"°";return t.minutes&&(i+=t.minutes+"′"),t.seconds&&(i+=t.seconds+"″"),i},val:function(e){var t=Pe(e,["number","uncertainty"]),i=t.number;i&&Number(i)&&(i=Number(i).toLocaleString());var n=i||"";return t.p&&(n=t.p+n),t.s&&(n=t.s+n),(t.u||t.ul||t.upl)&&(n=n+" "+(t.u||t.ul||t.upl)),n}};_i.rndfrac=_i.rnd,_i.rndnear=_i.rnd,_i["unité"]=_i.val;["nowrap","nobr","big","cquote","pull quote","small","smaller","midsize","larger","big","kbd","bigger","large","mono","strongbad","stronggood","huge","xt","xt2","!xt","xtn","xtd","dc","dcr","mxt","!mxt","mxtn","mxtd","bxt","!bxt","bxtn","bxtd","delink","pre","var","mvar","pre2","code"].forEach((function(e){_i[e]=function(e){return Pe(e,["text"]).text||""}}));var Si=_i,Ci={plainlist:function(e){var t=(e=_e(e)).split("|");return e=(t=t.slice(1)).join("|"),(t=(t=e.split(/\n ?\* ?/)).filter((function(e){return e}))).join("\n\n")},"collapsible list":function(e,t){var i=Pe(e);t.push(i);var n="";if(i.title&&(n+="'''".concat(i.title,"'''")+"\n\n"),!i.list){i.list=[];for(var a=1;a<10;a+=1)i[a]&&(i.list.push(i[a]),delete i[a])}return i.list=i.list.filter((function(e){return e})),n+=i.list.join("\n\n")},"ordered list":function(e,t){var i=Pe(e);return t.push(i),i.list=i.list||[],i.list.map((function(e,t){return"".concat(t+1,". ").concat(e)})).join("\n\n")},hlist:function(e){var t=Pe(e);return t.list=t.list||[],t.list.join(" · ")},pagelist:function(e){return(Pe(e).list||[]).join(", ")},catlist:function(e){return(Pe(e).list||[]).join(", ")},"br separated entries":function(e){return(Pe(e).list||[]).join("\n\n")},"comma separated entries":function(e){return(Pe(e).list||[]).join(", ")},"anchored list":function(e){var t=Pe(e).list||[];return(t=t.map((function(e,t){return"".concat(t+1,". ").concat(e)}))).join("\n\n")},"bulleted list":function(e){var t=Pe(e).list||[];return(t=(t=t.filter((function(e){return e}))).map((function(e){return"• "+e}))).join("\n\n")},"columns-list":function(e,t){var i=((Pe(e).list||[])[0]||"").split(/\n/);return i=(i=i.filter((function(e){return e}))).map((function(e){return e.replace(/\*/,"")})),t.push({template:"columns-list",list:i}),(i=i.map((function(e){return"• "+e}))).join("\n\n")}};Ci.flatlist=Ci.plainlist,Ci.ublist=Ci.plainlist,Ci["unbulleted list"]=Ci["collapsible list"],Ci.ubl=Ci["collapsible list"],Ci["bare anchored list"]=Ci["anchored list"],Ci["plain list"]=Ci.plainlist,Ci.cmn=Ci["columns-list"],Ci.collist=Ci["columns-list"],Ci["col-list"]=Ci["columns-list"],Ci.columnslist=Ci["columns-list"];var qi=Ci,Ni={convert:function(e){var t=Pe(e,["num","two","three","four"]);return"-"===t.two||"to"===t.two||"and"===t.two?t.four?"".concat(t.num," ").concat(t.two," ").concat(t.three," ").concat(t.four):"".concat(t.num," ").concat(t.two," ").concat(t.three):"".concat(t.num," ").concat(t.two)},term:function(e){var t=Pe(e,["term"]);return"".concat(t.term,":")},defn:0,lino:0,linum:function(e){var t=Pe(e,["num","text"]);return"".concat(t.num,". ").concat(t.text)},ill:function(e){return Pe(e,["text","lan1","text1","lan2","text2"]).text},frac:function(e){var t=Pe(e,["a","b","c"]);return t.c?"".concat(t.a," ").concat(t.b,"/").concat(t.c):t.b?"".concat(t.a,"/").concat(t.b):"1/".concat(t.b)},height:function(e,t){var i=Pe(e);t.push(i);var n=[];return["m","cm","ft","in"].forEach((function(e){!0===i.hasOwnProperty(e)&&n.push(i[e]+e)})),n.join(" ")},"block indent":function(e){var t=Pe(e);return t[1]?"\n"+t[1]+"\n":""},quote:function(e,t){var i=Pe(e,["text","author"]);if(t.push(i),i.text){var n='"'.concat(i.text,'"');return i.author&&(n+="\n\n",n+=" - ".concat(i.author)),n+"\n"}return""},lbs:function(e){var t=Pe(e,["text"]);return"[[".concat(t.text," Lifeboat Station|").concat(t.text,"]]")},lbc:function(e){var t=Pe(e,["text"]);return"[[".concat(t.text,"-class lifeboat|").concat(t.text,"-class]]")},lbb:function(e){var t=Pe(e,["text"]);return"[[".concat(t.text,"-class lifeboat|").concat(t.text,"]]")},own:function(e){var t=Pe(e,["author"]),i="Own work";return t.author&&(i+=" by "+t.author),i},sic:function(e,t){var i=Pe(e,["one","two","three"]),n=(i.one||"")+(i.two||"");return"?"===i.one&&(n=(i.two||"")+(i.three||"")),t.push({template:"sic",word:n}),"y"===i.nolink?n:"".concat(n," [sic]")},formatnum:function(e){e=e.replace(/:/,"|");var t=Pe(e,["number"]).number||"";return t=t.replace(/,/g,""),Number(t).toLocaleString()||""},"#dateformat":function(e){return e=e.replace(/:/,"|"),Pe(e,["date","format"]).date},lc:function(e){return e=e.replace(/:/,"|"),(Pe(e,["text"]).text||"").toLowerCase()},lcfirst:function(e){e=e.replace(/:/,"|");var t=Pe(e,["text"]).text;return t?t[0].toLowerCase()+t.substr(1):""},uc:function(e){return e=e.replace(/:/,"|"),(Pe(e,["text"]).text||"").toUpperCase()},ucfirst:function(e){e=e.replace(/:/,"|");var t=Pe(e,["text"]).text;return t?t[0].toUpperCase()+t.substr(1):""},padleft:function(e){e=e.replace(/:/,"|");var t=Pe(e,["text","num"]);return(t.text||"").padStart(t.num,t.str||"0")},padright:function(e){e=e.replace(/:/,"|");var t=Pe(e,["text","num"]);return(t.text||"").padEnd(t.num,t.str||"0")},abbr:function(e){return Pe(e,["abbr","meaning","ipa"]).abbr},abbrlink:function(e){var t=Pe(e,["abbr","page"]);return t.page?"[[".concat(t.page,"|").concat(t.abbr,"]]"):"[[".concat(t.abbr,"]]")},h:1,finedetail:0,sort:1};Ni["str left"]=Ni.trunc,Ni["str crop"]=Ni.trunc,Ni.tooltip=Ni.abbr,Ni.abbrv=Ni.abbr,Ni.define=Ni.abbr,Ni.cvt=Ni.convert;var Ai=Ni,Li=Object.assign({},Si,qi,Ai);var Di=function(e){var t=e.pop(),i=Number(e[0]||0),n=Number(e[1]||0),a=Number(e[2]||0);if("string"!=typeof t||isNaN(i))return null;var r=1;return/[SW]/i.test(t)&&(r=-1),r*(i+n/60+a/3600)},Ii=function(e){if("number"!=typeof e)return e;return Math.round(1e5*e)/1e5},Ti={s:!0,w:!0},Pi=function(e){var i=Pe(e);i=function(e){return e.list=e.list||[],e.list=e.list.map((function(t){var i=Number(t);if(!isNaN(i))return i;var n=t.split(/:/);return n.length>1?(e.props=e.props||{},e.props[n[0]]=n.slice(1).join(":"),null):t})),e.list=e.list.filter((function(e){return null!==e})),e}(i);var n,a,r=(n=i.list,a=n.map((function(e){return t(e)})).join("|"),2===n.length&&"number|number"===a?{lat:n[0],lon:n[1]}:4===n.length&&"number|string|number|string"===a?(Ti[n[1].toLowerCase()]&&(n[0]*=-1),"w"===n[3].toLowerCase()&&(n[2]*=-1),{lat:n[0],lon:n[2]}):6===n.length?{lat:Di(n.slice(0,3)),lon:Di(n.slice(3))}:8===n.length?{lat:Di(n.slice(0,4)),lon:Di(n.slice(4))}:{});return i.lat=Ii(r.lat),i.lon=Ii(r.lon),i.template="coord",delete i.list,i},Mi={coord:function(e,t){var i=Pi(e);return t.push(i),i.display&&-1===i.display.indexOf("inline")?"":"".concat(i.lat||"","°N, ").concat(i.lon||"","°W")},geo:["lat","lon","zoom"]};Mi.coor=Mi.coord,Mi["coor title dms"]=Mi.coord,Mi["coor title dec"]=Mi.coord,Mi["coor dms"]=Mi.coord,Mi["coor dm"]=Mi.coord,Mi["coor dec"]=Mi.coord;var Ri=Mi,Ui={etyl:1,mention:1,link:1,"la-verb-form":0,"la-ipa":0,sortname:function(e){var t=Pe(e,["first","last","target","sort"]),i="".concat(t.first||""," ").concat(t.last||"");return i=i.trim(),t.nolink?t.target||i:(t.dab&&(i+=" (".concat(t.dab,")"),t.target&&(t.target+=" (".concat(t.dab,")"))),t.target?"[[".concat(t.target,"|").concat(i,"]]"):"[[".concat(i,"]]"))}};["lts","t","tfd links","tiw","tltt","tetl","tsetl","ti","tic","tiw","tlt","ttl","twlh","tl2","tlu","demo","hatnote","xpd","para","elc","xtag","mli","mlix","#invoke","url"].forEach((function(e){Ui[e]=function(e){var t=Pe(e,["first","second"]);return t.second||t.first}})),Ui.m=Ui.mention,Ui["m-self"]=Ui.mention,Ui.l=Ui.link,Ui.ll=Ui.link,Ui["l-self"]=Ui.link;var Fi=Ui,Ki={wikt:"wiktionary",commons:"commons",c:"commons",commonscat:"commonscat",n:"wikinews",q:"wikiquote",s:"wikisource",a:"wikiauthor",b:"wikibooks",voy:"wikivoyage",v:"wikiversity",d:"wikidata",species:"wikispecies",m:"meta",mw:"mediawiki"},Bi={about:function(e,t){var i=Pe(e);return t.push(i),""},main:function(e,t){var i=Pe(e);return t.push(i),""},"main list":function(e,t){var i=Pe(e);return t.push(i),""},see:function(e,t){var i=Pe(e);return t.push(i),""},for:function(e,t){var i=Pe(e);return t.push(i),""},further:function(e,t){var i=Pe(e);return t.push(i),""},"further information":function(e,t){var i=Pe(e);return t.push(i),""},listen:function(e,t){var i=Pe(e);return t.push(i),""},"wide image":["file","width","caption"],redirect:function(e,t){for(var i=Pe(e,["redirect"]),n=i.list||[],a=[],r=0;r0&&t.push(a)}return{template:"playoffbracket",rounds:t}}(e);return t.push(i),""}};["2teambracket","4team2elimbracket","8teambracket","16teambracket","32teambracket","cwsbracket","nhlbracket","nhlbracket-reseed","4teambracket-nhl","4teambracket-ncaa","4teambracket-mma","4teambracket-mlb","8teambracket-nhl","8teambracket-mlb","8teambracket-ncaa","8teambracket-afc","8teambracket-afl","8teambracket-tennis3","8teambracket-tennis5","16teambracket-nhl","16teambracket-nhl divisional","16teambracket-nhl-reseed","16teambracket-nba","16teambracket-swtc","16teambracket-afc","16teambracket-tennis3","16teambracket-tennis5"].forEach((function(e){Qi[e]=Qi["4teambracket"]}));var Xi=Qi,en={"£":"GB£","¥":"¥","৳":"৳","₩":"₩","€":"€","₱":"₱","₹":"₹","₽":"₽","cn¥":"CN¥","gb£":"GB£","india rs":"₹","indian rupee symbol":"₹","indian rupee":"₹","indian rupees":"₹","philippine peso":"₱","russian ruble":"₽","SK won":"₩","turkish lira":"TRY",a$:"A$",au$:"A$",aud:"A$",bdt:"BDT",brl:"BRL",ca$:"CA$",cad:"CA$",chf:"CHF",cny:"CN¥",czk:"czk",dkk:"dkk",dkk2:"dkk",euro:"€",gbp:"GB£",hk$:"HK$",hkd:"HK$",ils:"ILS",inr:"₹",jpy:"¥",myr:"MYR",nis:"ILS",nok:"NOK",nok2:"NOK",nz$:"NZ$",nzd:"NZ$",peso:"peso",pkr:"₨",r$:"BRL",rmb:"CN¥",rub:"₽",ruble:"₽",rupee:"₹",s$:"sgd",sek:"SEK",sek2:"SEK",sfr:"CHF",sgd:"sgd",shekel:"ILS",sheqel:"ILS",ttd:"TTD",us$:"US$",usd:"US$",yen:"¥",zar:"R"},tn=function(e,t){var i=Pe(e,["amount","code"]);t.push(i);var n=i.template||"";switch("currency"===n?(n=i.code)||(i.code=n="usd"):""!==n&&"monnaie"!==n&&"unité"!==n&&"nombre"!==n&&"nb"!==n||(n=i.code),n=(n||"").toLowerCase()){case"us":i.code=n="usd";break;case"uk":i.code=n="gbp"}var a="".concat(en[n]||"").concat(i.amount||"");return i.code&&!en[i.code.toLowerCase()]&&(a+=" "+i.code),a},nn={currency:tn,monnaie:tn,"unité":tn,nombre:tn,nb:tn,iso4217:tn,inrconvert:function(e,t){var i=Pe(e,["rupee_value","currency_formatting"]);t.push(i);var n=i.currency_formatting;if(n){var a=1;switch(n){case"k":a=1e3;break;case"m":a=1e6;break;case"b":a=1e9;break;case"t":a=1e12;break;case"l":a=1e5;break;case"c":a=1e7;break;case"lc":a=1e12}i.rupee_value=i.rupee_value*a}return"inr ".concat(i.rupee_value||"")}};Object.keys(en).forEach((function(e){nn[e]=tn}));var an=nn,rn={"election box begin":function(e,t){var i=Pe(e);return t.push(i),""},"election box candidate":function(e,t){var i=Pe(e);return t.push(i),""},"election box hold with party link":function(e,t){var i=Pe(e);return t.push(i),""},"election box gain with party link":function(e,t){var i=Pe(e);return t.push(i),""}};rn["election box begin no change"]=rn["election box begin"],rn["election box begin no party"]=rn["election box begin"],rn["election box begin no party no change"]=rn["election box begin"],rn["election box inline begin"]=rn["election box begin"],rn["election box inline begin no change"]=rn["election box begin"],rn["election box candidate for alliance"]=rn["election box candidate"],rn["election box candidate minor party"]=rn["election box candidate"],rn["election box candidate no party link no change"]=rn["election box candidate"],rn["election box candidate with party link"]=rn["election box candidate"],rn["election box candidate with party link coalition 1918"]=rn["election box candidate"],rn["election box candidate with party link no change"]=rn["election box candidate"],rn["election box inline candidate"]=rn["election box candidate"],rn["election box inline candidate no change"]=rn["election box candidate"],rn["election box inline candidate with party link"]=rn["election box candidate"],rn["election box inline candidate with party link no change"]=rn["election box candidate"],rn["election box inline incumbent"]=rn["election box candidate"];var on=rn,sn=[["🇦🇩","and","andorra"],["🇦🇪","are","united arab emirates"],["🇦🇫","afg","afghanistan"],["🇦🇬","atg","antigua and barbuda"],["🇦🇮","aia","anguilla"],["🇦🇱","alb","albania"],["🇦🇲","arm","armenia"],["🇦🇴","ago","angola"],["🇦🇶","ata","antarctica"],["🇦🇷","arg","argentina"],["🇦🇸","asm","american samoa"],["🇦🇹","aut","austria"],["🇦🇺","aus","australia"],["🇦🇼","abw","aruba"],["🇦🇽","ala","åland islands"],["🇦🇿","aze","azerbaijan"],["🇧🇦","bih","bosnia and herzegovina"],["🇧🇧","brb","barbados"],["🇧🇩","bgd","bangladesh"],["🇧🇪","bel","belgium"],["🇧🇫","bfa","burkina faso"],["🇧🇬","bgr","bulgaria"],["🇧🇬","bul","bulgaria"],["🇧🇭","bhr","bahrain"],["🇧🇮","bdi","burundi"],["🇧🇯","ben","benin"],["🇧🇱","blm","saint barthélemy"],["🇧🇲","bmu","bermuda"],["🇧🇳","brn","brunei darussalam"],["🇧🇴","bol","bolivia"],["🇧🇶","bes","bonaire, sint eustatius and saba"],["🇧🇷","bra","brazil"],["🇧🇸","bhs","bahamas"],["🇧🇹","btn","bhutan"],["🇧🇻","bvt","bouvet island"],["🇧🇼","bwa","botswana"],["🇧🇾","blr","belarus"],["🇧🇿","blz","belize"],["🇨🇦","can","canada"],["🇨🇨","cck","cocos (keeling) islands"],["🇨🇩","cod","congo"],["🇨🇫","caf","central african republic"],["🇨🇬","cog","congo"],["🇨🇭","che","switzerland"],["🇨🇮","civ","côte d'ivoire"],["🇨🇰","cok","cook islands"],["🇨🇱","chl","chile"],["🇨🇲","cmr","cameroon"],["🇨🇳","chn","china"],["🇨🇴","col","colombia"],["🇨🇷","cri","costa rica"],["🇨🇺","cub","cuba"],["🇨🇻","cpv","cape verde"],["🇨🇼","cuw","curaçao"],["🇨🇽","cxr","christmas island"],["🇨🇾","cyp","cyprus"],["🇨🇿","cze","czech republic"],["🇩🇪","deu","germany"],["🇩🇪","ger","germany"],["🇩🇯","dji","djibouti"],["🇩🇰","dnk","denmark"],["🇩🇲","dma","dominica"],["🇩🇴","dom","dominican republic"],["🇩🇿","dza","algeria"],["🇪🇨","ecu","ecuador"],["🇪🇪","est","estonia"],["🇪🇬","egy","egypt"],["🇪🇭","esh","western sahara"],["🇪🇷","eri","eritrea"],["🇪🇸","esp","spain"],["🇪🇹","eth","ethiopia"],["🇫🇮","fin","finland"],["🇫🇯","fji","fiji"],["🇫🇰","flk","falkland islands (malvinas)"],["🇫🇲","fsm","micronesia"],["🇫🇴","fro","faroe islands"],["🇫🇷","fra","france"],["🇬🇦","gab","gabon"],["🇬🇧","gbr","united kingdom"],["🇬🇩","grd","grenada"],["🇬🇫","guf","french guiana"],["🇬🇬","ggy","guernsey"],["🇬🇭","gha","ghana"],["🇬🇮","gib","gibraltar"],["🇬🇱","grl","greenland"],["🇬🇲","gmb","gambia"],["🇬🇳","gin","guinea"],["🇬🇵","glp","guadeloupe"],["🇬🇶","gnq","equatorial guinea"],["🇬🇷","grc","greece"],["🇬🇸","sgs","south georgia"],["🇬🇹","gtm","guatemala"],["🇬🇺","gum","guam"],["🇬🇼","gnb","guinea-bissau"],["🇬🇾","guy","guyana"],["🇭🇰","hkg","hong kong"],["🇭🇲","hmd","heard island and mcdonald islands"],["🇭🇳","hnd","honduras"],["🇭🇷","hrv","croatia"],["🇭🇹","hti","haiti"],["🇭🇺","hun","hungary"],["🇮🇩","idn","indonesia"],["🇮🇪","irl","ireland"],["🇮🇱","isr","israel"],["🇮🇲","imn","isle of man"],["🇮🇳","ind","india"],["🇮🇴","iot","british indian ocean territory"],["🇮🇶","irq","iraq"],["🇮🇷","irn","iran"],["🇮🇸","isl","iceland"],["🇮🇹","ita","italy"],["🇯🇪","jey","jersey"],["🇯🇲","jam","jamaica"],["🇯🇴","jor","jordan"],["🇯🇵","jpn","japan"],["🇰🇪","ken","kenya"],["🇰🇬","kgz","kyrgyzstan"],["🇰🇭","khm","cambodia"],["🇰🇮","kir","kiribati"],["🇰🇲","com","comoros"],["🇰🇳","kna","saint kitts and nevis"],["🇰🇵","prk","north korea"],["🇰🇷","kor","south korea"],["🇰🇼","kwt","kuwait"],["🇰🇾","cym","cayman islands"],["🇰🇿","kaz","kazakhstan"],["🇱🇦","lao","lao people's democratic republic"],["🇱🇧","lbn","lebanon"],["🇱🇨","lca","saint lucia"],["🇱🇮","lie","liechtenstein"],["🇱🇰","lka","sri lanka"],["🇱🇷","lbr","liberia"],["🇱🇸","lso","lesotho"],["🇱🇹","ltu","lithuania"],["🇱🇺","lux","luxembourg"],["🇱🇻","lva","latvia"],["🇱🇾","lby","libya"],["🇲🇦","mar","morocco"],["🇲🇨","mco","monaco"],["🇲🇩","mda","moldova"],["🇲🇪","mne","montenegro"],["🇲🇫","maf","saint martin (french part)"],["🇲🇬","mdg","madagascar"],["🇲🇭","mhl","marshall islands"],["🇲🇰","mkd","macedonia"],["🇲🇱","mli","mali"],["🇲🇲","mmr","myanmar"],["🇲🇳","mng","mongolia"],["🇲🇴","mac","macao"],["🇲🇵","mnp","northern mariana islands"],["🇲🇶","mtq","martinique"],["🇲🇷","mrt","mauritania"],["🇲🇸","msr","montserrat"],["🇲🇹","mlt","malta"],["🇲🇺","mus","mauritius"],["🇲🇻","mdv","maldives"],["🇲🇼","mwi","malawi"],["🇲🇽","mex","mexico"],["🇲🇾","mys","malaysia"],["🇲🇿","moz","mozambique"],["🇳🇦","nam","namibia"],["🇳🇨","ncl","new caledonia"],["🇳🇪","ner","niger"],["🇳🇫","nfk","norfolk island"],["🇳🇬","nga","nigeria"],["🇳🇮","nic","nicaragua"],["🇳🇱","nld","netherlands"],["🇳🇴","nor","norway"],["🇳🇵","npl","nepal"],["🇳🇷","nru","nauru"],["🇳🇺","niu","niue"],["🇳🇿","nzl","new zealand"],["🇴🇲","omn","oman"],["🇵🇦","pan","panama"],["🇵🇪","per","peru"],["🇵🇫","pyf","french polynesia"],["🇵🇬","png","papua new guinea"],["🇵🇭","phl","philippines"],["🇵🇰","pak","pakistan"],["🇵🇱","pol","poland"],["🇵🇲","spm","saint pierre and miquelon"],["🇵🇳","pcn","pitcairn"],["🇵🇷","pri","puerto rico"],["🇵🇸","pse","palestinian territory"],["🇵🇹","prt","portugal"],["🇵🇼","plw","palau"],["🇵🇾","pry","paraguay"],["🇶🇦","qat","qatar"],["🇷🇪","reu","réunion"],["🇷🇴","rou","romania"],["🇷🇸","srb","serbia"],["🇷🇺","rus","russia"],["🇷🇼","rwa","rwanda"],["🇸🇦","sau","saudi arabia"],["🇸🇧","slb","solomon islands"],["🇸🇨","syc","seychelles"],["🇸🇩","sdn","sudan"],["🇸🇪","swe","sweden"],["🇸🇬","sgp","singapore"],["🇸🇭","shn","saint helena, ascension and tristan da cunha"],["🇸🇮","svn","slovenia"],["🇸🇯","sjm","svalbard and jan mayen"],["🇸🇰","svk","slovakia"],["🇸🇱","sle","sierra leone"],["🇸🇲","smr","san marino"],["🇸🇳","sen","senegal"],["🇸🇴","som","somalia"],["🇸🇷","sur","suriname"],["🇸🇸","ssd","south sudan"],["🇸🇹","stp","sao tome and principe"],["🇸🇻","slv","el salvador"],["🇸🇽","sxm","sint maarten (dutch part)"],["🇸🇾","syr","syrian arab republic"],["🇸🇿","swz","swaziland"],["🇹🇨","tca","turks and caicos islands"],["🇹🇩","tcd","chad"],["🇹🇫","atf","french southern territories"],["🇹🇬","tgo","togo"],["🇹🇭","tha","thailand"],["🇹🇯","tjk","tajikistan"],["🇹🇰","tkl","tokelau"],["🇹🇱","tls","timor-leste"],["🇹🇲","tkm","turkmenistan"],["🇹🇳","tun","tunisia"],["🇹🇴","ton","tonga"],["🇹🇷","tur","turkey"],["🇹🇹","tto","trinidad and tobago"],["🇹🇻","tuv","tuvalu"],["🇹🇼","twn","taiwan"],["🇹🇿","tza","tanzania"],["🇺🇦","ukr","ukraine"],["🇺🇬","uga","uganda"],["🇺🇲","umi","united states minor outlying islands"],["🇺🇸","usa","united states"],["🇺🇸","us","united states"],["🇺🇾","ury","uruguay"],["🇺🇿","uzb","uzbekistan"],["🇻🇦","vat","vatican city"],["🇻🇨","vct","saint vincent and the grenadines"],["🇻🇪","ven","venezuela"],["🇻🇬","vgb","virgin islands, british"],["🇻🇮","vir","virgin islands, u.s."],["🇻🇳","vnm","viet nam"],["🇻🇺","vut","vanuatu"],["","win","west indies"],["🇼🇫","wlf","wallis and futuna"],["🇼🇸","wsm","samoa"],["🇾🇪","yem","yemen"],["🇾🇹","myt","mayotte"],["🇿🇦","zaf","south africa"],["🇿🇲","zmb","zambia"],["🇿🇼 ","zwe","zimbabwe"],["🇺🇳","un","united nations"],["🏴󠁧󠁢󠁥󠁮󠁧󠁿󠁧󠁢󠁥󠁮󠁧󠁿","eng","england"],["🏴󠁧󠁢󠁳󠁣󠁴󠁿","sct","scotland"],["🏴󠁧󠁢󠁷󠁬󠁳󠁿","wal","wales"],["🇪🇺","eu","european union"]],cn={flag:function(e){var t=Pe(e,["flag","variant"]),i=t.flag||"";t.flag=(t.flag||"").toLowerCase();var n=sn.find((function(e){return t.flag===e[1]||t.flag===e[2]}))||[],a=n[0]||"";return"".concat(a," [[").concat(n[2],"|").concat(i,"]]")},flagcountry:function(e){var t=Pe(e,["flag","variant"]);t.flag=(t.flag||"").toLowerCase();var i=sn.find((function(e){return t.flag===e[1]||t.flag===e[2]}))||[],n=i[0]||"";return"".concat(n," [[").concat(i[2],"]]")},flagcu:function(e){var t=Pe(e,["flag","variant"]);t.flag=(t.flag||"").toLowerCase();var i=sn.find((function(e){return t.flag===e[1]||t.flag===e[2]}))||[],n=i[0]||"";return"".concat(n," ").concat(i[2])},flagicon:function(e){var t=Pe(e,["flag","variant"]);t.flag=(t.flag||"").toLowerCase();var i=sn.find((function(e){return t.flag===e[1]||t.flag===e[2]}));return i?"[[".concat(i[2],"|").concat(i[0],"]]"):""},flagdeco:function(e){var t=Pe(e,["flag","variant"]);return t.flag=(t.flag||"").toLowerCase(),(sn.find((function(e){return t.flag===e[1]||t.flag===e[2]}))||[])[0]||""},fb:function(e){var t=Pe(e,["flag","variant"]);t.flag=(t.flag||"").toLowerCase();var i=sn.find((function(e){return t.flag===e[1]||t.flag===e[2]}));return i?"".concat(i[0]," [[").concat(i[2]," national football team|").concat(i[2],"]]"):""},fbicon:function(e){var t=Pe(e,["flag","variant"]);t.flag=(t.flag||"").toLowerCase();var i=sn.find((function(e){return t.flag===e[1]||t.flag===e[2]}));return i?" [[".concat(i[2]," national football team|").concat(i[0],"]]"):""},flagathlete:function(e){var t=Pe(e,["name","flag","variant"]);t.flag=(t.flag||"").toLowerCase();var i=sn.find((function(e){return t.flag===e[1]||t.flag===e[2]}));return i?"".concat(i[0]," [[").concat(t.name||"","]] (").concat(i[1].toUpperCase(),")"):"[[".concat(t.name||"","]]")}};sn.forEach((function(e){cn[e[1]]=function(){return e[0]}})),cn.cr=cn.flagcountry,cn["cr-rt"]=cn.flagcountry,cn.cricon=cn.flagicon;var un=cn,ln=function(e){var t=e.match(/ipac?-(.+)/);return null!==t?!0===q.hasOwnProperty(t[1])?q[t[1]].english_title:t[1]:null},pn={ipa:function(e,t){var i=Pe(e,["transcription","lang","audio"]);return i.lang=ln(i.template),i.template="ipa",t.push(i),""},ipac:function(e,t){var i=Pe(e);return i.transcription=(i.list||[]).join(","),delete i.list,i.lang=ln(i.template),i.template="ipac",t.push(i),""},transl:function(e,t){var i=Pe(e,["lang","text","text2"]);return i.text2&&(i.iso=i.text,i.text=i.text2,delete i.text2),t.push(i),i.text||""}};Object.keys(q).forEach((function(e){pn["ipa-"+e]=pn.ipa,pn["ipac-"+e]=pn.ipac}));var mn=pn,dn={lang:1,"lang-de":0,"rtl-lang":1,taste:0,nihongo:function(e,t){var i=Pe(e,["english","kanji","romaji","extra"]);t.push(i);var n=i.english||i.romaji||"";return i.kanji&&(n+=" (".concat(i.kanji,")")),n}};Object.keys(q).forEach((function(e){dn["lang-"+e]=dn["lang-de"]})),dn.nihongo2=dn.nihongo,dn.nihongo3=dn.nihongo,dn["nihongo-s"]=dn.nihongo,dn["nihongo foot"]=dn.nihongo;var fn=dn,gn=function(e){if(!e.numerator&&!e.denominator)return null;var t=Number(e.numerator)/Number(e.denominator);t*=100;var i=Number(e.decimals);return isNaN(i)&&(i=1),t=t.toFixed(i),Number(t)},hn={math:function(e,t){var i=Pe(e,["formula"]);return t.push(i),"\n\n"+(i.formula||"")+"\n\n"},frac:function(e,t){var i=Pe(e,["a","b","c"]),n={template:"sfrac"};return i.c?(n.integer=i.a,n.numerator=i.b,n.denominator=i.c):i.b?(n.numerator=i.a,n.denominator=i.b):(n.numerator=1,n.denominator=i.a),t.push(n),n.integer?"".concat(n.integer," ").concat(n.numerator,"⁄").concat(n.denominator):"".concat(n.numerator,"⁄").concat(n.denominator)},radic:function(e){var t=Pe(e,["after","before"]);return"".concat(t.before||"","√").concat(t.after||"")},percentage:function(e){var t=Pe(e,["numerator","denominator","decimals"]),i=gn(t);return null===i?"":i+"%"},"percent-done":function(e){var t=Pe(e,["done","total","digits"]),i=gn({numerator:t.done,denominator:t.total,decimals:t.digits});return null===i?"":"".concat(t.done," (").concat(i,"%) done")},"winning percentage":function(e,t){var i=Pe(e,["wins","losses","ties"]);t.push(i);var n=Number(i.wins),a=Number(i.losses),r=Number(i.ties)||0,o=n+a+r;"y"===i.ignore_ties&&(r=0),r&&(n+=r/2);var s=gn({numerator:n,denominator:o,decimals:1});return null===s?"":".".concat(10*s)},winlosspct:function(e,t){var i=Pe(e,["wins","losses"]);t.push(i);var n=Number(i.wins),a=Number(i.losses),r=gn({numerator:n,denominator:n+a,decimals:1});return null===r?"":(r=".".concat(10*r),"".concat(n||0," || ").concat(a||0," || ").concat(r||"-"))}};hn.sfrac=hn.frac,hn.sqrt=hn.radic,hn.pct=hn.percentage,hn.percent=hn.percentage,hn.winpct=hn["winning percentage"],hn.winperc=hn["winning percentage"];var bn=hn,kn=function(e,t,i){var n=Pe(e);return i&&(n.name=n.template,n.template=i),t.push(n),""},wn={persondata:kn,taxobox:kn,citation:kn,portal:kn,reflist:kn,"cite book":kn,"cite journal":kn,"cite web":kn,"commons cat":kn,"portuguese name":["first","second","suffix"],uss:["ship","id"],isbn:function(e,t){var i=Pe(e,["id","id2","id3"]);return t.push(i),"ISBN: "+(i.id||"")},marriage:function(e,t){var i=Pe(e,["spouse","from","to","end"]);t.push(i);var n="".concat(i.spouse||"");return i.from&&(i.to?n+=" (m. ".concat(i.from,"-").concat(i.to,")"):n+=" (m. ".concat(i.from,")")),n},"based on":function(e,t){var i=Pe(e,["title","author"]);return t.push(i),"".concat(i.title," by ").concat(i.author||"")},"video game release":function(e,t){for(var i=["region","date","region2","date2","region3","date3","region4","date4"],n=Pe(e,i),a={template:"video game release",releases:[]},r=0;r0&&t.push(c),""},Zn=function(e){Object.defineProperty(this,"data",{enumerable:!1,value:e})},Gn={text:function(){return""},json:function(){return this.data}};Object.keys(Gn).forEach((function(e){Zn.prototype[e]=Gn[e]}));var Hn=Zn,Vn=new RegExp("^(cite |citation)","i"),Jn={citation:!0,refn:!0,harvnb:!0},Qn=function(e){return"infobox"===e.template&&e.data&&function(e){return e&&"[object Object]"===Object.prototype.toString.call(e)}(e.data)},Xn=function(e){var t=e.wiki,i=Xt(t),n=[];i.forEach((function(e){return function e(i,a){i.parent=a,i.children&&i.children.length>0&&i.children.forEach((function(t){return e(t,i)})),i.out=Yn(i,n);!function e(t,i,n){t.parent&&(t.parent.body=t.parent.body.replace(i,n),e(t.parent,i,n))}(i,i.body,i.out),t=t.replace(i.body,i.out)}(e,null)})),e.infoboxes=e.infoboxes||[],e.references=e.references||[],e.templates=e.templates||[],e.templates=e.templates.concat(n),e.templates=e.templates.filter((function(t){return!0===function(e){return!0===Jn[e.template]||!0===Vn.test(e.template)}(t)?(e.references.push(new Ue(t)),!1):!0!==Qn(t)||(e.infoboxes.push(new Zt(t)),!1)})),e.templates=e.templates.map((function(e){return new Hn(e)})),i.forEach((function(e){t=t.replace(e.body,e.out)})),e.wiki=t},ea=Ee,ta=function(e){var t=e.wiki;t=t.replace(/]*?)>([\s\S]+?)<\/gallery>/g,(function(t,i,n){var a=n.split(/\n/g);return(a=(a=a.filter((function(e){return e&&""!==e.trim()}))).map((function(e){var t=e.split(/\|/),i={file:t[0].trim()},n=new z(i).json(),a=t.slice(1).join("|");return""!==a&&(n.caption=ea(a)),n}))).length>0&&e.templates.push({template:"gallery",images:a,pos:e.title}),""})),e.wiki=t},ia=function(e){var t=e.wiki;t=t.replace(/\{\{election box begin([\s\S]+?)\{\{election box end\}\}/gi,(function(t){var i={wiki:t,templates:[]};Xn(i);var n=i.templates.map((function(e){return e.json()})),a=n.find((function(e){return"election box"===e.template}))||{},r=n.filter((function(e){return"election box candidate"===e.template})),o=n.find((function(e){return"election box gain"===e.template||"election box hold"===e.template}))||{};return(r.length>0||o)&&e.templates.push({template:"election box",title:a.title,candidates:r,summary:o.data}),""})),e.wiki=t},na={coach:["team","year","g","w","l","w-l%","finish","pg","pw","pl","pw-l%"],player:["year","team","gp","gs","mpg","fg%","3p%","ft%","rpg","apg","spg","bpg","ppg"],roster:["player","gp","gs","mpg","fg%","3fg%","ft%","rpg","apg","spg","bpg","ppg"]},aa=function(e){var t=e.wiki;t=t.replace(/\{\{nba (coach|player|roster) statistics start([\s\S]+?)\{\{s-end\}\}/gi,(function(t,i){t=(t=t.replace(/^\{\{.*?\}\}/,"")).replace(/\{\{s-end\}\}/,""),i=i.toLowerCase().trim();var n="! "+na[i].join(" !! "),a=ot("{|\n"+n+"\n"+t+"\n|}");return a=a.map((function(e){return Object.keys(e).forEach((function(t){e[t]=e[t].text()})),e})),e.templates.push({template:"NBA "+i+" statistics",data:a}),""})),e.wiki=t},ra=function(e){var t=e.wiki;t=t.replace(/\{\{mlb game log (section|month)[\s\S]+?\{\{mlb game log (section|month) end\}\}/gi,(function(t){var i=function(e){var t=["#","date","opponent","score","win","loss","save","attendance","record"];return!0===/\|stadium=y/i.test(e)&&t.splice(7,0,"stadium"),!0===/\|time=y/i.test(e)&&t.splice(7,0,"time"),!0===/\|box=y/i.test(e)&&t.push("box"),t}(t);t=(t=t.replace(/^\{\{.*?\}\}/,"")).replace(/\{\{mlb game log (section|month) end\}\}/i,"");var n="! "+i.join(" !! "),a=ot("{|\n"+n+"\n"+t+"\n|}");return a=a.map((function(e){return Object.keys(e).forEach((function(t){e[t]=e[t].text()})),e})),e.templates.push({template:"mlb game log section",data:a}),""})),e.wiki=t},oa=["res","record","opponent","method","event","date","round","time","location","notes"],sa=function(e){var t=e.wiki;t=t.replace(/\{\{mma record start[\s\S]+?\{\{end\}\}/gi,(function(t){t=(t=t.replace(/^\{\{.*?\}\}/,"")).replace(/\{\{end\}\}/i,"");var i="! "+oa.join(" !! "),n=ot("{|\n"+i+"\n"+t+"\n|}");return n=n.map((function(e){return Object.keys(e).forEach((function(t){e[t]=e[t].text()})),e})),e.templates.push({template:"mma record start",data:n}),""})),e.wiki=t},ca=Ee,ua=function(e){var t=e.wiki;t=(t=t.replace(/]*?)>([\s\S]+?)<\/math>/g,(function(t,i,n){var a=ca(n).text();return e.templates.push({template:"math",formula:a,raw:n}),a&&a.length<12?a:""}))).replace(/]*?)>([\s\S]+?)<\/chem>/g,(function(t,i,n){return e.templates.push({template:"chem",data:n}),""})),e.wiki=t},la=function(e){ia(e),ta(e),ua(e),ra(e),sa(e),aa(e)},pa=new RegExp("^("+C.references.join("|")+"):?","i"),ma=/(?:\n|^)(={2,5}.{1,200}?={2,5})/g,da={heading:He,table:ft,paragraphs:Ft,templates:Xn,references:Ye,startEndTemplates:la},fa=function(e,t){return da.startEndTemplates(e),da.references(e),da.templates(e),da.table(e),da.paragraphs(e,t),e=new ae(e)},ga=function(e){for(var t=[],i=e.wiki.split(ma),n=0;n0||(t.templates().length>0||(e[i+1]&&e[i+1].depth>t.depth&&(e[i+1].depth-=1),!1)))}))}(t)},ha=new RegExp("\\[\\[:?("+C.categories.join("|")+"):(.{2,178}?)]](w{0,10})","ig"),ba=new RegExp("^\\[\\[:?("+C.categories.join("|")+"):","ig"),ka={section:ga,categories:function(e){var t=e.wiki,i=t.match(ha);i&&i.forEach((function(t){(t=(t=(t=t.replace(ba,"")).replace(/\|?[ \*]?\]\]$/i,"")).replace(/\|.*/,""))&&!t.match(/[\[\]]/)&&e.categories.push(t.trim())})),t=t.replace(ha,""),e.wiki=t}},wa=function(e,t){t=t||{};var i=Object.assign(t,{title:t.title||null,pageID:t.pageID||t.id||null,namespace:t.namespace||t.ns||null,type:"page",wiki:e||"",categories:[],sections:[],coordinates:[]});return!0===F(e)?(i.type="redirect",i.redirectTo=K(e),ka.categories(i),new S(i)):(H(i),ka.categories(i),ka.section(i),new S(i))},va=function(e){var t=(e=e.filter((function(e){return e}))).map((function(e){return wa(e.wiki,e.meta)}));return 0===t.length?null:1===t.length?t[0]:t},ya=function(e,t){return fetch(e,t).then((function(e){return e.json()}))},xa=function(e){var t=e.userAgent||e["User-Agent"]||e["Api-User-Agent"]||"User of the wtf_wikipedia library";return{method:"GET",headers:{"Content-Type":"application/json","Api-User-Agent":t,"User-Agent":t,Origin:"*"},redirect:"follow"}},$a=/^https?:\/\//,ja={lang:"en",wiki:"wikipedia",domain:null,follow_redirects:!0,path:"api.php"},za=function(t,i,n){var a=null;"function"==typeof i&&(a=i,i={}),"function"==typeof n&&(a=n,n={}),"string"==typeof i&&(n=n||{},i=Object.assign({},{lang:i},n)),i=i||{},(i=Object.assign({},ja,i)).title=t,$a.test(t)&&(i=Object.assign(i,e(t)));var r=c(i),o=xa(i);return ya(r,o).then((function(e){try{var t=u(e,i);return t=va(t),a&&a(null,t),t}catch(e){throw e}})).catch((function(e){return console.error(e),a&&a(e,null),null}))},Ea={lang:"en",wiki:"wikipedia",domain:null,path:"w/api.php"},Oa=function(e,t){var i;t=t||{},t=Object.assign({},Ea,t),"string"==typeof e?t.lang=e:(i=e)&&"[object Object]"===Object.prototype.toString.call(i)&&(t=Object.assign(t,e));var n="https://".concat(t.lang,".wikipedia.org/").concat(t.path,"?");t.domain&&(n="https://".concat(t.domain,"/").concat(t.path,"?")),n+="format=json&action=query&generator=random&grnnamespace=0&prop=revisions&rvprop=content&grnlimit=1&rvslots=main&origin=*";var a=xa(t);return ya(n,a).then((function(e){try{var t=u(e);return va(t)}catch(e){throw e}})).catch((function(e){return console.error(e),null}))},_a={lang:"en",wiki:"wikipedia",domain:null,path:"w/api.php"},Sa=function(e,t,i){var n;i=i||{},i=Object.assign({},_a,i),"string"==typeof t?i.lang=t:(n=t)&&"[object Object]"===Object.prototype.toString.call(n)&&(i=Object.assign(i,t));var a={pages:[],categories:[]};return new Promise((function(t,n){!function r(o){var s=function(e,t,i){e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!1===/^Category/i.test(e)&&(e="Category:"+e),e=e.replace(/ /g,"_")}(e),e=encodeURIComponent(e);var n="https://".concat(t.lang,".wikipedia.org/").concat(t.path,"?");return t.domain&&(n="https://".concat(t.domain,"/").concat(t.path,"?")),n+="action=query&list=categorymembers&cmtitle=".concat(e,"&cmlimit=500&format=json&origin=*&redirects=true&cmtype=page|subcat"),i&&(n+="&cmcontinue="+i),n}(e,i,o),c=xa(i);return ya(s,c).then((function(e){a=function(e){var t=e.query.categorymembers||[],i={pages:[],categories:[]};return t.forEach((function(e){14===e.ns?(delete e.ns,i.categories.push(e)):(delete e.ns,i.pages.push(e))})),i}(e),e.continue&&e.continue.cmcontinue?r(e.continue.cmcontinue):t(a)})).catch((function(e){console.error(e),n(e)}))}(null)}))},Ca=function(e,t){return wa(e,t)},qa={Doc:S,Section:ae,Paragraph:vt,Sentence:be,Image:z,Infobox:Zt,Link:ue,List:qt,Reference:Ue,Table:pt,Template:Hn,http:ya,wtf:Ca};return Ca.fetch=function(e,t,i,n){return za(e,t,i)},Ca.random=function(e,t,i){return Oa(e,t)},Ca.category=function(e,t,i,n){return Sa(e,t,i)},Ca.extend=function(e){return e(qa,Kn,this),this},Ca.version="8.3.0",Ca})); +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).wtf=t()}(this,(function(){"use strict";var e=function(e){var t=new URL(e),i=t.pathname.replace(/^\/(wiki\/)?/,"");return i=decodeURIComponent(i),{domain:t.host,title:i}};function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var i=[],n=!0,a=!1,r=void 0;try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done)&&(i.push(o.value),!t||i.length!==t);n=!0);}catch(e){a=!0,r=e}finally{try{n||null==s.return||s.return()}finally{if(a)throw r}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return n(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return n(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);iObject.keys(t.data).length?-1:1})),"number"==typeof e?t[e]:t},text:function(e){return e=p(e,j),!0===this.isRedirect()?"":this.sections().map((function(t){return t.text(e)})).join("\n\n")},json:function(e){return e=p(e,j),d(this,e)},debug:function(){return console.log("\n"),this.sections().forEach((function(e){for(var t=" - ",i=0;i500)&&M.test(e)},U=function(e){var t=e.match(M);return t&&t[2]?(P(t[2])||[])[0]:{}},F=["table","code","score","data","categorytree","charinsert","hiero","imagemap","inputbox","nowiki","poem","references","source","syntaxhighlight","timeline"],K="< ?(".concat(F.join("|"),") ?[^>]{0,200}?>"),B="< ?/ ?(".concat(F.join("|"),") ?>"),W=new RegExp("".concat(K,"[").concat("\\s\\S","]+?").concat(B),"ig"),Y=function(e){return(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=e.replace(W," ")).replace(/ ?< ?(span|div|table|data) [a-zA-Z0-9=%\.#:;'" ]{2,100}\/? ?> ?/g," ")).replace(/ ?< ?(ref) [a-zA-Z0-9=" ]{2,100}\/ ?> ?/g," ")).replace(/(.*?)<\/i>/g,"''$1''")).replace(/(.*?)<\/b>/g,"'''$1'''")).replace(/(.*?)<\/sub>/g,"{{sub|$1}}")).replace(/(.*?)<\/sup>/g,"{{sup|$1}}")).replace(/ ?<[ \/]?(p|sub|sup|span|nowiki|div|table|br|tr|td|th|pre|pre2|hr)[ \/]?> ?/g," ")).replace(/ ?<[ \/]?(abbr|bdi|bdo|blockquote|cite|del|dfn|em|ins|kbd|mark|q|s|small)[ \/]?> ?/g," ")).replace(/ ?<[ \/]?h[0-9][ \/]?> ?/g," ")).replace(/ ?< ?br ?\/> ?/g,"\n")).trim()};var Z=function(e){var t=e.wiki;t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace(//g,"")).replace(/__(NOTOC|NOEDITSECTION|FORCETOC|TOC)__/gi,"")).replace(/~~{1,3}/g,"")).replace(/\r/g,"")).replace(/\u3002/g,". ")).replace(/----/g,"")).replace(/\{\{\}\}/g," – ")).replace(/\{\{\\\}\}/g," / ")).replace(/ /g," "),t=(t=(t=Y(t)).replace(/\([,;: ]+?\)/g,"")).replace(/{{(baseball|basketball) (primary|secondary) (style|color).*?\}\}/i,""),e.wiki=t},G=/[\\\.$]/,H=function(e){return"string"!=typeof e&&(e=""),e=(e=(e=e.replace(/\\/g,"\\\\")).replace(/^\$/,"\\u0024")).replace(/\./g,"\\u002e")},V=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Object.keys(e),i=0;i0&&(i.paragraphs=n)}if(!0===t.images){var a=e.images().map((function(e){return e.json(t)}));a.length>0&&(i.images=a)}if(!0===t.tables){var r=e.tables().map((function(e){return e.json(t)}));r.length>0&&(i.tables=r)}if(!0===t.templates){var o=e.templates();o.length>0&&(i.templates=o,!0===t.encode&&i.templates.forEach((function(e){return V(e)})))}if(!0===t.infoboxes){var s=e.infoboxes().map((function(e){return e.json(t)}));s.length>0&&(i.infoboxes=s)}if(!0===t.lists){var c=e.lists().map((function(e){return e.json(t)}));c.length>0&&(i.lists=c)}if(!0===t.references||!0===t.citations){var u=e.references().map((function(e){return e.json(t)}));u.length>0&&(i.references=u)}return!0===t.sentences&&(i.sentences=e.sentences().map((function(e){return e.json(t)}))),i},X={tables:!0,references:!0,paragraphs:!0,templates:!0,infoboxes:!0},ee=function(e){this.depth=e.depth,this.doc=null,this._title=e.title||"",Object.defineProperty(this,"doc",{enumerable:!1,value:null}),e.templates=e.templates||[],Object.defineProperty(this,"data",{enumerable:!1,value:e})},te={title:function(){return this._title||""},index:function(){if(!this.doc)return null;var e=this.doc.sections().indexOf(this);return-1===e?null:e},indentation:function(){return this.depth},sentences:function(e){var t=this.paragraphs().reduce((function(e,t){return e.concat(t.sentences())}),[]);return"number"==typeof e?t[e]:t||[]},paragraphs:function(e){var t=this.data.paragraphs||[];return"number"==typeof e?t[e]:t||[]},paragraph:function(e){var t=this.data.paragraphs||[];return"number"==typeof e?t[e]:t[0]},links:function(e){var t=[];if(this.infoboxes().forEach((function(i){i.links(e).forEach((function(e){return t.push(e)}))})),this.sentences().forEach((function(i){i.links(e).forEach((function(e){return t.push(e)}))})),this.tables().forEach((function(i){i.links(e).forEach((function(e){return t.push(e)}))})),this.lists().forEach((function(i){i.links(e).forEach((function(e){return t.push(e)}))})),"number"==typeof e)return t[e];if("string"==typeof e){e=e.charAt(0).toUpperCase()+e.substring(1);var i=t.find((function(t){return t.page()===e}));return void 0===i?[]:[i]}return t},tables:function(e){var t=this.data.tables||[];return"number"==typeof e?t[e]:t},templates:function(e){var t=this.data.templates||[];return t=t.map((function(e){return e.json()})),"number"==typeof e?t[e]:"string"==typeof e?(e=e.toLowerCase(),t.filter((function(t){return t.template===e||t.name===e}))):t},infoboxes:function(e){var t=this.data.infoboxes||[];return"number"==typeof e?t[e]:t},coordinates:function(e){var t=[].concat(this.templates("coord"),this.templates("coor"));return"number"==typeof e?t[e]?t[e]:[]:t},lists:function(e){var t=[];return this.paragraphs().forEach((function(e){t=t.concat(e.lists())})),"number"==typeof e?t[e]:t},interwiki:function(e){var t=[];return this.paragraphs().forEach((function(e){t=t.concat(e.interwiki())})),"number"==typeof e?t[e]:t||[]},images:function(e){var t=[];return this.paragraphs().forEach((function(e){t=t.concat(e.images())})),"number"==typeof e?t[e]:t||[]},references:function(e){var t=this.data.references||[];return"number"==typeof e?t[e]:t},remove:function(){if(!this.doc)return null;var e={};e[this.title()]=!0,this.children().forEach((function(t){return e[t.title()]=!0}));var t=this.doc.data.sections;return t=t.filter((function(t){return!0!==e.hasOwnProperty(t.title())})),this.doc.data.sections=t,this.doc},nextSibling:function(){if(!this.doc)return null;for(var e=this.doc.sections(),t=this.index()+1;tthis.depth)for(var a=i+1;athis.depth;a+=1)n.push(t[a]);return"string"==typeof e?(e=e.toLowerCase(),n.find((function(t){return t.title().toLowerCase()===e}))):"number"==typeof e?n[e]:n},parent:function(){if(!this.doc)return null;for(var e=this.doc.sections(),t=this.index();t>=0;t-=1)if(e[t]&&e[t].depth0&&(e.fmt=e.fmt||{},e.fmt.bold=t),i.length>0&&(e.fmt=e.fmt||{},e.fmt.italic=i),e},le=/^[0-9,.]+$/,pe={text:!0,links:!0,formatting:!0,numbers:!0},me=function(e,t){t=p(t,pe);var i={},n=e.text();if(!0===t.text&&(i.text=n),!0===t.numbers&&le.test(n)){var a=Number(n.replace(/,/g,""));!1===isNaN(a)&&(i.number=a)}return t.links&&e.links().length>0&&(i.links=e.links().map((function(e){return e.json()}))),t.formatting&&e.data.fmt&&(i.formatting=e.data.fmt),i},de=function(e){Object.defineProperty(this,"data",{enumerable:!1,value:e})},fe={links:function(e){var t=this.data.links||[];if("number"==typeof e)return t[e];if("string"==typeof e){e=e.charAt(0).toUpperCase()+e.substring(1);var i=t.find((function(t){return t.page===e}));return void 0===i?[]:[i]}return t},interwiki:function(e){var t=this.links().filter((function(e){return void 0!==e.wiki}));return"number"==typeof e?t[e]:t},bolds:function(e){var t=[];return this.data&&this.data.fmt&&this.data.fmt.bold&&(t=this.data.fmt.bold||[]),"number"==typeof e?t[e]:t},italics:function(e){var t=[];return this.data&&this.data.fmt&&this.data.fmt.italic&&(t=this.data.fmt.italic||[]),"number"==typeof e?t[e]:t},dates:function(e){var t=[];return"number"==typeof e?t[e]:t},text:function(e){return void 0!==e&&"string"==typeof e&&(this.data.text=e),this.data.text||""},json:function(e){return me(this,e)}};Object.keys(fe).forEach((function(e){de.prototype[e]=fe[e]})),de.prototype.italic=de.prototype.italics,de.prototype.bold=de.prototype.bolds,de.prototype.plaintext=de.prototype.text;var ge=de,he=["ad","adj","adm","adv","al","alta","approx","apr","apt","arc","ariz","assn","asst","atty","aug","ave","ba","bc","bl","bldg","blvd","brig","bros","ca","cal","calif","capt","cca","cg","cl","cm","cmdr","co","col","colo","comdr","conn","corp","cpl","cres","ct","cyn","dak","dec","def","dept","det","dg","dist","dl","dm","dr","ea","eg","eng","esp","esq","est","etc","ex","exp","feb","fem","fig","fl oz","fl","fla","fm","fr","ft","fy","ga","gal","gb","gen","gov","hg","hon","hr","hrs","hwy","hz","ia","ida","ie","inc","inf","jan","jd","jr","jul","jun","kan","kans","kb","kg","km","kmph","lat","lb","lit","llb","lm","lng","lt","ltd","lx","ma","maj","mar","masc","mb","md","messrs","mg","mi","min","minn","misc","mister","ml","mlle","mm","mme","mph","mps","mr","mrs","ms","mstr","mt","neb","nebr","nee","no","nov","oct","okla","ont","op","ord","oz","pa","pd","penn","penna","phd","pl","pp","pref","prob","prof","pron","ps","psa","pseud","pt","pvt","qt","que","rb","rd","rep","reps","res","rev","sask","sec","sen","sens","sep","sept","sfc","sgt","sir","situ","sq ft","sq","sr","ss","st","supt","surg","tb","tbl","tbsp","tce","td","tel","temp","tenn","tex","tsp","univ","usafa","ut","va","vb","ver","vet","vitro","vivo","vol","vs","vt","wis","wisc","wr","wy","wyo","yb","µg"].concat("[^]][^]]"),be=new RegExp("(^| |')("+he.join("|")+")[.!?] ?$","i"),ke=new RegExp("[ |.|'|[][A-Z].? *?$","i"),we=new RegExp("\\.\\.\\.* +?$"),ve=/ c\. $/,ye=new RegExp("[a-zа-яぁ-ゟ][a-zа-яぁ-ゟ゠-ヿ]","iu"),xe=function(e){var t=[],i=[];if(!e||"string"!=typeof e||0===e.trim().length)return t;for(var n=function(e){var t=e.split(/(\n+)/);return function(e){var t=[];return e.forEach((function(e){t=t.concat(e)})),t}(t=(t=t.filter((function(e){return e.match(/\S/)}))).map((function(e){return e.split(/(\S.+?[.!?]"?)(?=\s+|$)/g)})))}(e),a=0;ai.length)return!1;var n=e.match(/"/g);return!(n&&n.length%2!=0&&e.length<900)}(o))?i[s+1]=i[s]+(i[s+1]||""):i[s]&&i[s].length>0&&(t.push(i[s]),i[s]="");return 0===t.length?[e]:t};function $e(e){var t,i={text:e};return ce(i),i.text=(t=(t=(t=i.text).replace(/\([,;: ]*\)/g,"")).replace(/\( *(; ?)+/g,"("),t=(t=ne(t)).replace(/ +\.$/,".")),i=ue(i),new ge(i)}var je=$e,ze=function(e){var t=xe(e.wiki);(t=t.map($e))[0]&&t[0].text()&&":"===t[0].text()[0]&&(t=t.slice(1)),e.sentences=t},Ee=function(e){return e=(e=e.replace(/^\{\{/,"")).replace(/\}\}$/,"")},Oe=function(e){return e=(e=(e=(e||"").trim()).toLowerCase()).replace(/_/g," ")},_e=function(e){var t=e.split(/\n?\|/);t.forEach((function(e,i){null!==e&&(/\[\[[^\]]+$/.test(e)||/\{\{[^\}]+$/.test(e)||e.split("{{").length!==e.split("}}").length||e.split("[[").length!==e.split("]]").length)&&(t[i+1]=t[i]+"|"+t[i+1],t[i]=null)}));for(var i=(t=(t=t.filter((function(e){return null!==e}))).map((function(e){return(e||"").trim()}))).length-1;i>=0;i-=1){""===t[i]&&t.pop();break}return t},Se=/^[ '-\)\x2D\.0-9_a-z\xC0-\xFF\u0153\u017F\u1E9E\u212A\u212B]+=/i,Ce={template:!0,list:!0,prototype:!0},qe=function(e,t){var i=0;return e.reduce((function(e,n){if(n=(n||"").trim(),!0===Se.test(n)){var a=function(e){var t=e.split("="),i=t[0]||"";i=i.toLowerCase().trim();var n=t.slice(1).join("=");return Ce.hasOwnProperty(i)&&(i="_"+i),{key:i,val:n.trim()}}(n);if(a.key)return e[a.key]=a.val,e}t&&t[i]?e[t[i]]=n:(e.list=e.list||[],e.list.push(n));return i+=1,e}),{})},Ne={classname:!0,style:!0,align:!0,margin:!0,left:!0,break:!0,boxsize:!0,framestyle:!0,item_style:!0,collapsible:!0,list_style_type:!0,"list-style-type":!0,colwidth:!0},Ae=function(e){return Object.keys(e).forEach((function(t){!0===Ne[t.toLowerCase()]&&delete e[t],null!==e[t]&&""!==e[t]||delete e[t]})),e},Le=je,De=function(e,t){var i=Le(e);return"json"===t?i.json():"raw"===t?i:i.text()},Ie=function(e,t,i){t=t||[],e=Ee(e||"");var n=_e(e),a=n.shift(),r=qe(n,t);return(r=Ae(r))[1]&&t[0]&&!1===r.hasOwnProperty(t[0])&&(r[t[0]]=r[1],delete r[1]),Object.keys(r).forEach((function(e){r[e]="list"!==e?De(r[e],i):r[e].map((function(e){return De(e,i)}))})),a&&(r.template=Oe(a)),r},Te=function(e){Object.defineProperty(this,"data",{enumerable:!1,value:e})},Pe={title:function(){var e=this.data;return e.title||e.encyclopedia||e.author||""},links:function(e){var t=[];if("number"==typeof e)return t[e];if("number"==typeof e)return t[e];if("string"==typeof e){e=e.charAt(0).toUpperCase()+e.substring(1);var i=t.find((function(t){return t.page()===e}));return void 0===i?[]:[i]}return t||[]},text:function(){return""},json:function(){return this.data}};Object.keys(Pe).forEach((function(e){Te.prototype[e]=Pe[e]}));var Me=Te,Re=je,Ue=function(e){return/^ *?\{\{ *?(cite|citation)/i.test(e)&&/\}\} *?$/.test(e)&&!1===/citation needed/i.test(e)},Fe=function(e){var t=Ie(e);return t.type=t.template.replace(/cite /,""),t.template="citation",t},Ke=function(e){return{template:"citation",type:"inline",data:{},inline:Re(e)||{}}},Be=function(e){var t=[],i=e.wiki;i=(i=(i=(i=i.replace(/ ?([\s\S]{0,1800}?)<\/ref> ?/gi,(function(e,n){if(Ue(n)){var a=Fe(n);a&&t.push(a),i=i.replace(n,"")}else t.push(Ke(n));return" "}))).replace(/ ?]{0,200}?\/> ?/gi," ")).replace(/ ?]{0,200}?>([\s\S]{0,1800}?)<\/ref> ?/gi,(function(e,n){if(Ue(n)){var a=Fe(n);a&&t.push(a),i=i.replace(n,"")}else t.push(Ke(n));return" "}))).replace(/ ?<[ \/]?[a-z0-9]{1,8}[a-z0-9=" ]{2,20}[ \/]?> ?/g," "),e.references=t.map((function(e){return new Me(e)})),e.wiki=i},We=je,Ye=/^(={1,5})(.{1,200}?)={1,5}$/,Ze=function(e,t){var i=t.match(Ye);if(!i)return e.title="",e.depth=0,e;var n=i[2]||"",a={wiki:n=(n=We(n).text()).replace(/\{\{.+?\}\}/,"")};Be(a),n=ne(n=a.wiki);var r=0;return i[1]&&(r=i[1].length-2),e.title=n,e.depth=r,e},Ge=function(e){var t=[],i=[];e=function(e){return e=e.filter((function(e){return e&&!0!==/^\|\+/.test(e)})),!0===/^{\|/.test(e[0])&&e.shift(),!0===/^\|}/.test(e[e.length-1])&&e.pop(),!0===/^\|-/.test(e[0])&&e.shift(),e}(e);for(var n=0;n0&&(t.push(i),i=[]):(!(a=a.split(/(?:\|\||!!)/))[0]&&a[1]&&a.shift(),a.forEach((function(e){e=(e=e.replace(/^\| */,"")).trim(),i.push(e)})))}return i.length>0&&t.push(i),t},He=/.*rowspan *?= *?["']?([0-9]+)["']?[ \|]*/,Ve=/.*colspan *?= *?["']?([0-9]+)["']?[ \|]*/,Je=function(e){return e=function(e){return e.forEach((function(t,i){t.forEach((function(n,a){var r=n.match(He);if(null!==r){var o=parseInt(r[1],10);n=n.replace(He,""),t[a]=n;for(var s=i+1;s0}))}(e))},Qe=je,Xe=/^!/,et={name:!0,age:!0,born:!0,date:!0,year:!0,city:!0,country:!0,population:!0,count:!0,number:!0},tt=function(e){return(e=Qe(e).text()).match(/\|/)&&(e=e.replace(/.+\| ?/,"")),e=(e=(e=e.replace(/style=['"].*?["']/,"")).replace(/^!/,"")).trim()},it=function(e){return(e=e||[]).length-e.filter((function(e){return e})).length>3},nt=function(e){if(e.length<=3)return[];var t=e[0].slice(0);t=t.map((function(e){return e=e.replace(/^\! */,""),e=Qe(e).text(),e=(e=tt(e)).toLowerCase()}));for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:[],t=[];it(e[0])&&e.shift();var i=e[0];return i&&i[0]&&i[1]&&(/^!/.test(i[0])||/^!/.test(i[1]))&&(t=i.map((function(e){return e=e.replace(/^\! */,""),e=tt(e)})),e.shift()),(i=e[0])&&i[0]&&i[1]&&/^!/.test(i[0])&&/^!/.test(i[1])&&(i.forEach((function(e,i){e=e.replace(/^\! */,""),e=tt(e),!0===Boolean(e)&&(t[i]=e)})),e.shift()),t}(i=Je(i));if(!n||n.length<=1){n=nt(i);var a=i[i.length-1]||[];n.length<=1&&a.length>2&&(n=nt(i.slice(1))).length>0&&(i=i.slice(2))}return i.map((function(e){return function(e,t){var i={};return e.forEach((function(e,n){var a=t[n]||"col"+(n+1),r=Qe(e);r.text(tt(r.text())),i[a]=r})),i}(e,n)}))},rt=function(e,t){return e.map((function(e){var i={};return Object.keys(e).forEach((function(t){i[t]=e[t].json()})),!0===t.encode&&(i=V(i)),i}))},ot={},st=function(e){Object.defineProperty(this,"data",{enumerable:!1,value:e})},ct={links:function(e){var t=[];if(this.data.forEach((function(e){Object.keys(e).forEach((function(i){t=t.concat(e[i].links())}))})),"number"==typeof e)return t[e];if("string"==typeof e){e=e.charAt(0).toUpperCase()+e.substring(1);var i=t.find((function(t){return t.page()===e}));return void 0===i?[]:[i]}return t},keyValue:function(e){var t=this.json(e);return t.forEach((function(e){Object.keys(e).forEach((function(t){e[t]=e[t].text}))})),t},json:function(e){return e=p(e,ot),rt(this.data,e)},text:function(){return""}};ct.keyvalue=ct.keyValue,ct.keyval=ct.keyValue,Object.keys(ct).forEach((function(e){st.prototype[e]=ct[e]}));var ut=st,lt=/^\s*{\|/,pt=/^\s*\|}/,mt=function(e){for(var t=[],i=e.wiki,n=i.split("\n"),a=[],r=0;r0&&(a[a.length-1]+="\n"+n[r]);else{a[a.length-1]+="\n"+n[r];var o=a.pop();t.push(o)}else a.push(n[r]);var s=[];t.forEach((function(e){if(e){i=(i=i.replace(e+"\n","")).replace(e,"");var t=at(e);t&&t.length>0&&s.push(new ut(t))}})),s.length>0&&(e.tables=s),e.wiki=i},dt={sentences:!0},ft=function(e,t){var i={};return!0===(t=p(t,dt)).sentences&&(i.sentences=e.sentences().map((function(e){return e.json(t)}))),i},gt={sentences:!0,lists:!0,images:!0},ht=function(e){Object.defineProperty(this,"data",{enumerable:!1,value:e})},bt={sentences:function(e){return"number"==typeof e?this.data.sentences[e]:this.data.sentences||[]},references:function(e){return"number"==typeof e?this.data.references[e]:this.data.references},lists:function(e){return"number"==typeof e?this.data.lists[e]:this.data.lists},images:function(e){return"number"==typeof e?this.data.images[e]:this.data.images||[]},links:function(e){var t=[];if(this.sentences().forEach((function(i){t=t.concat(i.links(e))})),"number"==typeof e)return t[e];if("string"==typeof e){e=e.charAt(0).toUpperCase()+e.substring(1);var i=t.find((function(t){return t.page()===e}));return void 0===i?[]:[i]}return t||[]},interwiki:function(e){var t=[];return this.sentences().forEach((function(e){t=t.concat(e.interwiki())})),"number"==typeof e?t[e]:t||[]},text:function(e){e=p(e,gt);var t=this.sentences().map((function(t){return t.text(e)})).join(" ");return this.lists().forEach((function(e){t+="\n"+e.text()})),t},json:function(e){return e=p(e,gt),ft(this,e)}};bt.citations=bt.references,Object.keys(bt).forEach((function(e){ht.prototype[e]=bt[e]}));var kt=ht;var wt=function(e){for(var t=[],i=[],n=e.split(""),a=0,r=0;r0){for(var s=0,c=0,u=0;uc&&i.push("]"),t.push(i.join("")),i=[]}}return t},vt=je,yt=new RegExp("("+_.images.join("|")+"):","i"),xt="(".concat(_.images.join("|"),")"),$t=new RegExp(xt+":(.+?)[\\||\\]]","iu"),jt={thumb:!0,thumbnail:!0,border:!0,right:!0,left:!0,center:!0,top:!0,bottom:!0,none:!0,upright:!0,baseline:!0,middle:!0,sub:!0,super:!0},zt=function(e,t){var i=e.wiki;wt(i).forEach((function(n){if(!0===yt.test(n)){e.images=e.images||[];var a=function(e,t){var i=e.match($t);if(null===i||!i[2])return null;var n="".concat(i[1],":").concat(i[2]||""),a=(n=n.trim()).charAt(0).toUpperCase()+n.substring(1);if(a=a.replace(/ /g,"_")){var r={file:n,lang:t.lang,domain:t.domain};e=(e=e.replace(/^\[\[/,"")).replace(/\]\]$/,"");var o=Ie(e),s=o.list||[];return o.alt&&(r.alt=o.alt),(s=s.filter((function(e){return!1===jt.hasOwnProperty(e)})))[s.length-1]&&(r.caption=vt(s[s.length-1])),new $(r)}return null}(n,t);a&&e.images.push(a),i=i.replace(n,"")}})),e.wiki=i},Et={},Ot=function(e){Object.defineProperty(this,"data",{enumerable:!1,value:e})},_t={lines:function(){return this.data},links:function(e){var t=[];if(this.lines().forEach((function(e){t=t.concat(e.links())})),"number"==typeof e)return t[e];if("string"==typeof e){e=e.charAt(0).toUpperCase()+e.substring(1);var i=t.find((function(t){return t.page()===e}));return void 0===i?[]:[i]}return t},json:function(e){return e=p(e,Et),this.lines().map((function(t){return t.json(e)}))},text:function(){return function(e,t){return e.map((function(e){return" * "+e.text(t)})).join("\n")}(this.data)}};Object.keys(_t).forEach((function(e){Ot.prototype[e]=_t[e]}));var St=Ot,Ct=je,qt=/^[#\*:;\|]+/,Nt=/^\*+[^:,\|]{4}/,At=/^ ?\#[^:,\|]{4}/,Lt=/[a-z_0-9\]\}]/i,Dt=function(e){return qt.test(e)||Nt.test(e)||At.test(e)},It=function(e,t){for(var i=[],n=t;n0&&(i.push(r),a+=r.length-1)}else n.push(t[a]);e.lists=i.map((function(e){return new St(e)})),e.wiki=n.join("\n")}},Rt=function(e,t){var i=e.wiki,n=i.split(Pt);n=(n=n.filter((function(e){return e&&e.trim().length>0}))).map((function(e){var i={wiki:e,lists:[],sentences:[],images:[]};return Mt.list(i),Mt.image(i,t),Tt(i),new kt(i)})),e.wiki=i,e.paragraphs=n},Ut=function(e,t){var i=Object.keys(e.data).reduce((function(t,i){return e.data[i]&&(t[i]=e.data[i].json()),t}),{});return!0===t.encode&&(i=V(i)),i},Ft=function(e){return(e=(e=e.toLowerCase()).replace(/[-_]/g," ")).trim()},Kt=function(e){this._type=e.type,this.domain=e.domain,Object.defineProperty(this,"data",{enumerable:!1,value:e.data})},Bt={type:function(){return this._type},links:function(e){var t=this,i=[];if(Object.keys(this.data).forEach((function(e){t.data[e].links().forEach((function(e){return i.push(e)}))})),"number"==typeof e)return i[e];if("string"==typeof e){e=e.charAt(0).toUpperCase()+e.substring(1);var n=i.find((function(t){return t.page()===e}));return void 0===n?[]:[n]}return i},image:function(){var e=this.get("image")||this.get("image2")||this.get("logo");if(!e)return null;var t=e.json();return t.file=t.text,t.text="",t.domain=this.domain,new $(t)},get:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";e=Ft(e);for(var t=Object.keys(this.data),i=0;i0?a++:a=e.indexOf("{",a+1)){var r=e[a];if("{"===r&&(t+=1),t>0){if("}"===r&&0===(t-=1)){n.push(r);var o=n.join("");n=[],/\{\{/.test(o)&&/\}\}/.test(o)&&i.push(o);continue}if(1===t&&"{"!==r&&"}"!==r){t=0,n=[];continue}n.push(r)}}return i},Zt=function(e){var t=null;return(t=/^\{\{[^\n]+\|/.test(e)?(e.match(/^\{\{(.+?)\|/)||[])[1]:-1!==e.indexOf("\n")?(e.match(/^\{\{(.+?)\n/)||[])[1]:(e.match(/^\{\{(.+?)\}\}$/)||[])[1])&&(t=t.replace(/:.*/,""),t=Oe(t)),t||null},Gt=/\{\{/,Ht=function(e){return{body:e=e.replace(/#invoke:/,""),name:Zt(e),children:[]}},Vt=function e(t){var i=t.body.substr(2);return i=i.replace(/\}\}$/,""),t.children=Yt(i),t.children=t.children.map(Ht),0===t.children.length||t.children.forEach((function(t){var i=t.body.substr(2);return Gt.test(i)?e(t):null})),t},Jt=function(e){var t=Yt(e);return t=(t=t.map(Ht)).map(Vt)},Qt=["anchor","defaultsort","use list-defined references","void","pp","pp-move-indef","pp-semi-indef","pp-vandalism","r","#tag","div col","pope list end","shipwreck list end","starbox end","end box","end","s-end"].reduce((function(e,t){return e[t]=!0,e}),{}),Xt=new RegExp("^(subst.)?("+_.infoboxes.join("|")+")[: \n]","i"),ei=/^infobox /i,ti=/ infobox$/i,ii=/$Year in [A-Z]/i,ni={"gnf protein box":!0,"automatic taxobox":!0,"chembox ":!0,editnotice:!0,geobox:!0,hybridbox:!0,ichnobox:!0,infraspeciesbox:!0,mycomorphbox:!0,oobox:!0,"paraphyletic group":!0,speciesbox:!0,subspeciesbox:!0,"starbox short":!0,taxobox:!0,nhlteamseason:!0,"asian games bid":!0,"canadian federal election results":!0,"dc thomson comic strip":!0,"daytona 24 races":!0,edencharacter:!0,"moldova national football team results":!0,samurai:!0,protein:!0,"sheet authority":!0,"order-of-approx":!0,"bacterial labs":!0,"medical resources":!0,ordination:!0,"hockey team coach":!0,"hockey team gm":!0,"pro hockey team":!0,"hockey team player":!0,"hockey team start":!0,mlbbioret:!0},ai=function(e){return!0===ni.hasOwnProperty(e)||(!!Xt.test(e)||(!(!ei.test(e)&&!ti.test(e))||!!ii.test(e)))},ri=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.template.match(Xt),i=e.template;t&&t[0]&&(i=i.replace(t[0],""));var n={template:"infobox",type:i=i.trim(),data:e};return delete n.data.template,delete n.data.list,n},oi=[void 0,"January","February","March","April","May","June","July","August","September","October","November","December"],si=oi.reduce((function(e,t,i){return 0===i||(e[t.toLowerCase()]=i),e}),{}),ci=function(e){return e<10?"0"+e:String(e)},ui=function(e){var t=String(e.year||"");if(void 0!==e.month&&!0===oi.hasOwnProperty(e.month))if(void 0===e.date)t="".concat(oi[e.month]," ").concat(e.year);else{if(t="".concat(oi[e.month]," ").concat(e.date,", ").concat(e.year),void 0!==e.hour&&void 0!==e.minute){var i="".concat(ci(e.hour),":").concat(ci(e.minute));void 0!==e.second&&(i=i+":"+ci(e.second)),t=i+", "+t}e.tz&&(t+=" (".concat(e.tz,")"))}return t},li=function(e){for(var t={},i=["year","month","date","hour","minute","second"],n=0;n0&&(n.years=a,i-=31536e6*n.years);var r=Math.floor(i/2592e6,10);r>0&&(n.months=r,i-=2592e6*n.months);var o=Math.floor(i/mi,10);return o>0&&(n.days=o),n},gi=li,hi=ui,bi=function(e){return{template:"date",data:e}},ki=function(e){var t=(e=Ee(e)).split("|"),i=gi(t.slice(1,4)),n=t.slice(4,7);if(0===n.length){var a=new Date;n=[a.getFullYear(),a.getMonth(),a.getDate()]}return{from:i,to:n=gi(n)}},wi={date:function(e,t){var i=Ie(e,["year","month","date","hour","minute","second","timezone"]),n=gi([i.year,i.month,i.date||i.day]);return i.text=hi(n),i.timezone&&("Z"===i.timezone&&(i.timezone="UTC"),i.text+=" (".concat(i.timezone,")")),i.hour&&i.minute&&(i.second?i.text="".concat(i.hour,":").concat(i.minute,":").concat(i.second,", ")+i.text:i.text="".concat(i.hour,":").concat(i.minute,", ")+i.text),i.text&&t.push(bi(i)),i.text},natural_date:function(e,t){var i=Ie(e,["text"]).text||"",n={};if(/^[0-9]{4}$/.test(i))n.year=parseInt(i,10);else{var a=i.replace(/[a-z]+\/[a-z]+/i,"");a=a.replace(/[0-9]+:[0-9]+(am|pm)?/i,"");var r=new Date(a);!1===isNaN(r.getTime())&&(n.year=r.getFullYear(),n.month=r.getMonth()+1,n.date=r.getDate())}return t.push(bi(n)),i.trim()},one_year:function(e,t){var i=Ie(e,["year"]),n=Number(i.year);return t.push(bi({year:n})),String(n)},two_dates:function(e,t){var i=Ie(e,["b","birth_year","birth_month","birth_date","death_year","death_month","death_date"]);if(i.b&&"b"===i.b.toLowerCase()){var n=gi([i.birth_year,i.birth_month,i.birth_date]);return t.push(bi(n)),hi(n)}var a=gi([i.death_year,i.death_month,i.death_date]);return t.push(bi(a)),hi(a)},age:function(e){var t=ki(e);return fi(t.from,t.to).years||0},"diff-y":function(e){var t=ki(e),i=fi(t.from,t.to);return 1===i.years?i.years+" year":(i.years||0)+" years"},"diff-ym":function(e){var t=ki(e),i=fi(t.from,t.to),n=[];return 1===i.years?n.push(i.years+" year"):i.years&&0!==i.years&&n.push(i.years+" years"),1===i.months?n.push("1 month"):i.months&&0!==i.months&&n.push(i.months+" months"),n.join(", ")},"diff-ymd":function(e){var t=ki(e),i=fi(t.from,t.to),n=[];return 1===i.years?n.push(i.years+" year"):i.years&&0!==i.years&&n.push(i.years+" years"),1===i.months?n.push("1 month"):i.months&&0!==i.months&&n.push(i.months+" months"),1===i.days?n.push("1 day"):i.days&&0!==i.days&&n.push(i.days+" days"),n.join(", ")},"diff-yd":function(e){var t=ki(e),i=fi(t.from,t.to),n=[];return 1===i.years?n.push(i.years+" year"):i.years&&0!==i.years&&n.push(i.years+" years"),i.days+=30*(i.months||0),1===i.days?n.push("1 day"):i.days&&0!==i.days&&n.push(i.days+" days"),n.join(", ")},"diff-d":function(e){var t=ki(e),i=fi(t.from,t.to),n=[];return i.days+=365*(i.years||0),i.days+=30*(i.months||0),1===i.days?n.push("1 day"):i.days&&0!==i.days&&n.push(i.days+" days"),n.join(", ")}},vi=function(e){var t=new Date(e);if(isNaN(t.getTime()))return"";var i=(new Date).getTime()-t.getTime(),n="ago";i<0&&(n="from now",i=Math.abs(i));var a=i/1e3/60/60/24;return a<365?parseInt(a,10)+" days "+n:parseInt(a/365,10)+" years "+n},yi=wi.date,xi=wi.natural_date,$i=["January","February","March","April","May","June","July","August","September","October","November","December"],ji=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],zi=Object.assign({},pi,{currentday:function(){var e=new Date;return String(e.getDate())},currentdayname:function(){var e=new Date;return ji[e.getDay()]},currentmonth:function(){var e=new Date;return $i[e.getMonth()]},currentyear:function(){var e=new Date;return String(e.getFullYear())},monthyear:function(){var e=new Date;return $i[e.getMonth()]+" "+e.getFullYear()},"monthyear-1":function(){var e=new Date;return e.setMonth(e.getMonth()-1),$i[e.getMonth()]+" "+e.getFullYear()},"monthyear+1":function(){var e=new Date;return e.setMonth(e.getMonth()+1),$i[e.getMonth()]+" "+e.getFullYear()},date:0,"time ago":function(e){var t=Ie(e,["date","fmt"]).date;return vi(t)},"birth date and age":function(e,t){var i=Ie(e,["year","month","day"]);return i.year&&/[a-z]/i.test(i.year)?xi(e,t):(t.push(i),i=li([i.year,i.month,i.day]),ui(i))},"birth year and age":function(e,t){var i=Ie(e,["birth_year","birth_month"]);if(i.death_year&&/[a-z]/i.test(i.death_year))return xi(e,t);t.push(i);var n=(new Date).getFullYear()-parseInt(i.birth_year,10);i=li([i.birth_year,i.birth_month]);var a=ui(i);return n&&(a+=" (age ".concat(n,")")),a},"death year and age":function(e,t){var i=Ie(e,["death_year","birth_year","death_month"]);return i.death_year&&/[a-z]/i.test(i.death_year)?xi(e,t):(t.push(i),i=li([i.death_year,i.death_month]),ui(i))},"birth date and age2":function(e,t){var i=Ie(e,["at_year","at_month","at_day","birth_year","birth_month","birth_day"]);return t.push(i),i=li([i.birth_year,i.birth_month,i.birth_day]),ui(i)},"birth based on age as of date":function(e,t){var i=Ie(e,["age","year","month","day"]);t.push(i);var n=parseInt(i.age,10),a=parseInt(i.year,10)-n;return a&&n?"".concat(a," (age ").concat(i.age,")"):"(age ".concat(i.age,")")},"death date and given age":function(e,t){var i=Ie(e,["year","month","day","age"]);t.push(i),i=li([i.year,i.month,i.day]);var n=ui(i);return i.age&&(n+=" (age ".concat(i.age,")")),n},dts:function(e){e=(e=e.replace(/\|format=[ymd]+/i,"")).replace(/\|abbr=(on|off)/i,"");var t=Ie(e,["year","month","date","bc"]);return t.date&&t.month&&t.year?!0===/[a-z]/.test(t.month)?[t.month,t.date,t.year].join(" "):[t.year,t.month,t.date].join("-"):t.month&&t.year?[t.year,t.month].join("-"):t.year?(t.year<0&&(t.year=Math.abs(t.year)+" BC"),t.year):""},start:yi,end:yi,birth:yi,death:yi,"start date":yi,"end date":yi,"birth date":yi,"death date":yi,"start date and age":yi,"end date and age":yi,"start-date":xi,"end-date":xi,"birth-date":xi,"death-date":xi,"birth-date and age":xi,"birth-date and given age":xi,"death-date and age":xi,"death-date and given age":xi,birthdeathage:wi.two_dates,dob:yi,age:wi.age,"age nts":wi.age,"age in years":wi["diff-y"],"age in years and months":wi["diff-ym"],"age in years, months and days":wi["diff-ymd"],"age in years and days":wi["diff-yd"],"age in days":wi["diff-d"]});zi.localday=zi.currentday,zi.localdayname=zi.currentdayname,zi.localmonth=zi.currentmonth,zi.localyear=zi.currentyear,zi.currentmonthname=zi.currentmonth,zi.currentmonthabbrev=zi.currentmonth,zi["death date and age"]=zi["birth date and age"],zi.bda=zi["birth date and age"],zi["birth date based on age at death"]=zi["birth based on age as of date"];var Ei=zi,Oi={tag:function(e){var t=Ie(e,["tag","open"]);return t.open&&"pair"!==t.open?"":{span:!0,div:!0,p:!0}[t.tag]?t.content||"":"<".concat(t.tag," ").concat(t.attribs||"",">").concat(t.content||"","")},plural:function(e){e=e.replace(/plural:/,"plural|");var t=Ie(e,["num","word"]),i=Number(t.num),n=t.word;return 1!==i&&(/.y$/.test(n)?n=n.replace(/y$/,"ies"):n+="s"),i+" "+n},"first word":function(e){var t=Ie(e,["text"]),i=t.text;return t.sep?i.split(t.sep)[0]:i.split(" ")[0]},trunc:function(e){var t=Ie(e,["str","len"]);return t.str.substr(0,t.len)},"str mid":function(e){var t=Ie(e,["str","start","end"]),i=parseInt(t.start,10)-1,n=parseInt(t.end,10);return t.str.substr(i,n)},p1:0,p2:1,p3:2,braces:function(e){var t=Ie(e,["text"]),i="";return t.list&&(i="|"+t.list.join("|")),"{{"+(t.text||"")+i+"}}"},nobold:0,noitalic:0,nocaps:0,syntaxhighlight:function(e,t){var i=Ie(e);return t.push(i),i.code||""},samp:function(e,t){var i=Ie(e,["1"]);return t.push(i),i[1]||""},vanchor:0,resize:1,ra:function(e){var t=Ie(e,["hours","minutes","seconds"]);return[t.hours||0,t.minutes||0,t.seconds||0].join(":")},deg2hms:function(e){return(Ie(e,["degrees"]).degrees||"")+"°"},hms2deg:function(e){var t=Ie(e,["hours","minutes","seconds"]);return[t.hours||0,t.minutes||0,t.seconds||0].join(":")},decdeg:function(e){var t=Ie(e,["deg","min","sec","hem","rnd"]);return(t.deg||t.degrees)+"°"},rnd:0,dec:function(e){var t=Ie(e,["degrees","minutes","seconds"]),i=(t.degrees||0)+"°";return t.minutes&&(i+=t.minutes+"′"),t.seconds&&(i+=t.seconds+"″"),i},val:function(e){var t=Ie(e,["number","uncertainty"]),i=t.number;i&&Number(i)&&(i=Number(i).toLocaleString());var n=i||"";return t.p&&(n=t.p+n),t.s&&(n=t.s+n),(t.u||t.ul||t.upl)&&(n=n+" "+(t.u||t.ul||t.upl)),n},sub:function(e,t){var i=Ie(e,["text"]);return t.push(i),i.text||""},sup:function(e,t){var i=Ie(e,["text"]);return t.push(i),i.text||""}};Oi.rndfrac=Oi.rnd,Oi.rndnear=Oi.rnd,Oi["unité"]=Oi.val;["nowrap","nobr","big","cquote","pull quote","small","smaller","midsize","larger","big","kbd","bigger","large","mono","strongbad","stronggood","huge","xt","xt2","!xt","xtn","xtd","dc","dcr","mxt","!mxt","mxtn","mxtd","bxt","!bxt","bxtn","bxtd","delink","pre","var","mvar","pre2","code"].forEach((function(e){Oi[e]=function(e){return Ie(e,["text"]).text||""}}));var _i=Oi,Si={plainlist:function(e){var t=(e=Ee(e)).split("|");return e=(t=t.slice(1)).join("|"),(t=(t=e.split(/\n ?\* ?/)).filter((function(e){return e}))).join("\n\n")},"collapsible list":function(e,t){var i=Ie(e);t.push(i);var n="";if(i.title&&(n+="'''".concat(i.title,"'''")+"\n\n"),!i.list){i.list=[];for(var a=1;a<10;a+=1)i[a]&&(i.list.push(i[a]),delete i[a])}return i.list=i.list.filter((function(e){return e})),n+=i.list.join("\n\n")},"ordered list":function(e,t){var i=Ie(e);return t.push(i),i.list=i.list||[],i.list.map((function(e,t){return"".concat(t+1,". ").concat(e)})).join("\n\n")},hlist:function(e){var t=Ie(e);return t.list=t.list||[],t.list.join(" · ")},pagelist:function(e){return(Ie(e).list||[]).join(", ")},catlist:function(e){return(Ie(e).list||[]).join(", ")},"br separated entries":function(e){return(Ie(e).list||[]).join("\n\n")},"comma separated entries":function(e){return(Ie(e).list||[]).join(", ")},"anchored list":function(e){var t=Ie(e).list||[];return(t=t.map((function(e,t){return"".concat(t+1,". ").concat(e)}))).join("\n\n")},"bulleted list":function(e){var t=Ie(e).list||[];return(t=(t=t.filter((function(e){return e}))).map((function(e){return"• "+e}))).join("\n\n")},"columns-list":function(e,t){var i=((Ie(e).list||[])[0]||"").split(/\n/);return i=(i=i.filter((function(e){return e}))).map((function(e){return e.replace(/\*/,"")})),t.push({template:"columns-list",list:i}),(i=i.map((function(e){return"• "+e}))).join("\n\n")}};Si.flatlist=Si.plainlist,Si.ublist=Si.plainlist,Si["unbulleted list"]=Si["collapsible list"],Si.ubl=Si["collapsible list"],Si["bare anchored list"]=Si["anchored list"],Si["plain list"]=Si.plainlist,Si.cmn=Si["columns-list"],Si.collist=Si["columns-list"],Si["col-list"]=Si["columns-list"],Si.columnslist=Si["columns-list"];var Ci=Si,qi={convert:function(e){var t=Ie(e,["num","two","three","four"]);return"-"===t.two||"to"===t.two||"and"===t.two?t.four?"".concat(t.num," ").concat(t.two," ").concat(t.three," ").concat(t.four):"".concat(t.num," ").concat(t.two," ").concat(t.three):"".concat(t.num," ").concat(t.two)},term:function(e){var t=Ie(e,["term"]);return"".concat(t.term,":")},defn:0,lino:0,linum:function(e){var t=Ie(e,["num","text"]);return"".concat(t.num,". ").concat(t.text)},ill:function(e){return Ie(e,["text","lan1","text1","lan2","text2"]).text},frac:function(e){var t=Ie(e,["a","b","c"]);return t.c?"".concat(t.a," ").concat(t.b,"/").concat(t.c):t.b?"".concat(t.a,"/").concat(t.b):"1/".concat(t.b)},height:function(e,t){var i=Ie(e);t.push(i);var n=[];return["m","cm","ft","in"].forEach((function(e){!0===i.hasOwnProperty(e)&&n.push(i[e]+e)})),n.join(" ")},"block indent":function(e){var t=Ie(e);return t[1]?"\n"+t[1]+"\n":""},quote:function(e,t){var i=Ie(e,["text","author"]);if(t.push(i),i.text){var n='"'.concat(i.text,'"');return i.author&&(n+="\n\n",n+=" - ".concat(i.author)),n+"\n"}return""},lbs:function(e){var t=Ie(e,["text"]);return"[[".concat(t.text," Lifeboat Station|").concat(t.text,"]]")},lbc:function(e){var t=Ie(e,["text"]);return"[[".concat(t.text,"-class lifeboat|").concat(t.text,"-class]]")},lbb:function(e){var t=Ie(e,["text"]);return"[[".concat(t.text,"-class lifeboat|").concat(t.text,"]]")},own:function(e){var t=Ie(e,["author"]),i="Own work";return t.author&&(i+=" by "+t.author),i},sic:function(e,t){var i=Ie(e,["one","two","three"]),n=(i.one||"")+(i.two||"");return"?"===i.one&&(n=(i.two||"")+(i.three||"")),t.push({template:"sic",word:n}),"y"===i.nolink?n:"".concat(n," [sic]")},formatnum:function(e){e=e.replace(/:/,"|");var t=Ie(e,["number"]).number||"";return t=t.replace(/,/g,""),Number(t).toLocaleString()||""},"#dateformat":function(e){return e=e.replace(/:/,"|"),Ie(e,["date","format"]).date},lc:function(e){return e=e.replace(/:/,"|"),(Ie(e,["text"]).text||"").toLowerCase()},lcfirst:function(e){e=e.replace(/:/,"|");var t=Ie(e,["text"]).text;return t?t[0].toLowerCase()+t.substr(1):""},uc:function(e){return e=e.replace(/:/,"|"),(Ie(e,["text"]).text||"").toUpperCase()},ucfirst:function(e){e=e.replace(/:/,"|");var t=Ie(e,["text"]).text;return t?t[0].toUpperCase()+t.substr(1):""},padleft:function(e){e=e.replace(/:/,"|");var t=Ie(e,["text","num"]);return(t.text||"").padStart(t.num,t.str||"0")},padright:function(e){e=e.replace(/:/,"|");var t=Ie(e,["text","num"]);return(t.text||"").padEnd(t.num,t.str||"0")},abbr:function(e){return Ie(e,["abbr","meaning","ipa"]).abbr},abbrlink:function(e){var t=Ie(e,["abbr","page"]);return t.page?"[[".concat(t.page,"|").concat(t.abbr,"]]"):"[[".concat(t.abbr,"]]")},h:1,finedetail:0,sort:1};qi["str left"]=qi.trunc,qi["str crop"]=qi.trunc,qi.tooltip=qi.abbr,qi.abbrv=qi.abbr,qi.define=qi.abbr,qi.cvt=qi.convert;var Ni=qi,Ai=Object.assign({},_i,Ci,Ni);var Li=function(e){var t=e.pop(),i=Number(e[0]||0),n=Number(e[1]||0),a=Number(e[2]||0);if("string"!=typeof t||isNaN(i))return null;var r=1;return/[SW]/i.test(t)&&(r=-1),r*(i+n/60+a/3600)},Di=function(e){if("number"!=typeof e)return e;return Math.round(1e5*e)/1e5},Ii={s:!0,w:!0},Ti=function(e){var i=Ie(e);i=function(e){return e.list=e.list||[],e.list=e.list.map((function(t){var i=Number(t);if(!isNaN(i))return i;var n=t.split(/:/);return n.length>1?(e.props=e.props||{},e.props[n[0]]=n.slice(1).join(":"),null):t})),e.list=e.list.filter((function(e){return null!==e})),e}(i);var n,a,r=(n=i.list,a=n.map((function(e){return t(e)})).join("|"),2===n.length&&"number|number"===a?{lat:n[0],lon:n[1]}:4===n.length&&"number|string|number|string"===a?(Ii[n[1].toLowerCase()]&&(n[0]*=-1),"w"===n[3].toLowerCase()&&(n[2]*=-1),{lat:n[0],lon:n[2]}):6===n.length?{lat:Li(n.slice(0,3)),lon:Li(n.slice(3))}:8===n.length?{lat:Li(n.slice(0,4)),lon:Li(n.slice(4))}:{});return i.lat=Di(r.lat),i.lon=Di(r.lon),i.template="coord",delete i.list,i},Pi={coord:function(e,t){var i=Ti(e);return t.push(i),i.display&&-1===i.display.indexOf("inline")?"":"".concat(i.lat||"","°N, ").concat(i.lon||"","°W")},geo:["lat","lon","zoom"]};Pi.coor=Pi.coord,Pi["coor title dms"]=Pi.coord,Pi["coor title dec"]=Pi.coord,Pi["coor dms"]=Pi.coord,Pi["coor dm"]=Pi.coord,Pi["coor dec"]=Pi.coord;var Mi=Pi,Ri={etyl:1,mention:1,link:1,"la-verb-form":0,"la-ipa":0,sortname:function(e){var t=Ie(e,["first","last","target","sort"]),i="".concat(t.first||""," ").concat(t.last||"");return i=i.trim(),t.nolink?t.target||i:(t.dab&&(i+=" (".concat(t.dab,")"),t.target&&(t.target+=" (".concat(t.dab,")"))),t.target?"[[".concat(t.target,"|").concat(i,"]]"):"[[".concat(i,"]]"))}};["lts","t","tfd links","tiw","tltt","tetl","tsetl","ti","tic","tiw","tlt","ttl","twlh","tl2","tlu","demo","hatnote","xpd","para","elc","xtag","mli","mlix","#invoke","url"].forEach((function(e){Ri[e]=function(e){var t=Ie(e,["first","second"]);return t.second||t.first}})),Ri.m=Ri.mention,Ri["m-self"]=Ri.mention,Ri.l=Ri.link,Ri.ll=Ri.link,Ri["l-self"]=Ri.link;var Ui=Ri,Fi={wikt:"wiktionary",commons:"commons",c:"commons",commonscat:"commonscat",n:"wikinews",q:"wikiquote",s:"wikisource",a:"wikiauthor",b:"wikibooks",voy:"wikivoyage",v:"wikiversity",d:"wikidata",species:"wikispecies",m:"meta",mw:"mediawiki"},Ki={about:function(e,t){var i=Ie(e);return t.push(i),""},main:function(e,t){var i=Ie(e);return t.push(i),""},"main list":function(e,t){var i=Ie(e);return t.push(i),""},see:function(e,t){var i=Ie(e);return t.push(i),""},for:function(e,t){var i=Ie(e);return t.push(i),""},further:function(e,t){var i=Ie(e);return t.push(i),""},"further information":function(e,t){var i=Ie(e);return t.push(i),""},listen:function(e,t){var i=Ie(e);return t.push(i),""},"wide image":["file","width","caption"],redirect:function(e,t){for(var i=Ie(e,["redirect"]),n=i.list||[],a=[],r=0;r0&&t.push(a)}return{template:"playoffbracket",rounds:t}}(e);return t.push(i),""}};["2teambracket","4team2elimbracket","8teambracket","16teambracket","32teambracket","4roundbracket-byes","cwsbracket","nhlbracket","nhlbracket-reseed","4teambracket-nhl","4teambracket-ncaa","4teambracket-mma","4teambracket-mlb","16teambracket-two-reseeds","8teambracket-nhl","8teambracket-mlb","8teambracket-ncaa","8teambracket-afc","8teambracket-afl","8teambracket-tennis3","8teambracket-tennis5","16teambracket-nhl","16teambracket-nhl divisional","16teambracket-nhl-reseed","16teambracket-nba","16teambracket-swtc","16teambracket-afc","16teambracket-tennis3","16teambracket-tennis5"].forEach((function(e){Ji[e]=Ji["4teambracket"]}));var Qi=Ji,Xi={"£":"GB£","¥":"¥","৳":"৳","₩":"₩","€":"€","₱":"₱","₹":"₹","₽":"₽","cn¥":"CN¥","gb£":"GB£","india rs":"₹","indian rupee symbol":"₹","indian rupee":"₹","indian rupees":"₹","philippine peso":"₱","russian ruble":"₽","SK won":"₩","turkish lira":"TRY",a$:"A$",au$:"A$",aud:"A$",bdt:"BDT",brl:"BRL",ca$:"CA$",cad:"CA$",chf:"CHF",cny:"CN¥",czk:"czk",dkk:"dkk",dkk2:"dkk",euro:"€",gbp:"GB£",hk$:"HK$",hkd:"HK$",ils:"ILS",inr:"₹",jpy:"¥",myr:"MYR",nis:"ILS",nok:"NOK",nok2:"NOK",nz$:"NZ$",nzd:"NZ$",peso:"peso",pkr:"₨",r$:"BRL",rmb:"CN¥",rub:"₽",ruble:"₽",rupee:"₹",s$:"sgd",sek:"SEK",sek2:"SEK",sfr:"CHF",sgd:"sgd",shekel:"ILS",sheqel:"ILS",ttd:"TTD",us$:"US$",usd:"US$",yen:"¥",zar:"R"},en=function(e,t){var i=Ie(e,["amount","code"]);t.push(i);var n=i.template||"";switch("currency"===n?(n=i.code)||(i.code=n="usd"):""!==n&&"monnaie"!==n&&"unité"!==n&&"nombre"!==n&&"nb"!==n||(n=i.code),n=(n||"").toLowerCase()){case"us":i.code=n="usd";break;case"uk":i.code=n="gbp"}var a="".concat(Xi[n]||"").concat(i.amount||"");return i.code&&!Xi[i.code.toLowerCase()]&&(a+=" "+i.code),a},tn={currency:en,monnaie:en,"unité":en,nombre:en,nb:en,iso4217:en,inrconvert:function(e,t){var i=Ie(e,["rupee_value","currency_formatting"]);t.push(i);var n=i.currency_formatting;if(n){var a=1;switch(n){case"k":a=1e3;break;case"m":a=1e6;break;case"b":a=1e9;break;case"t":a=1e12;break;case"l":a=1e5;break;case"c":a=1e7;break;case"lc":a=1e12}i.rupee_value=i.rupee_value*a}return"inr ".concat(i.rupee_value||"")}};Object.keys(Xi).forEach((function(e){tn[e]=en}));var nn=tn,an={"election box begin":function(e,t){var i=Ie(e);return t.push(i),""},"election box candidate":function(e,t){var i=Ie(e);return t.push(i),""},"election box hold with party link":function(e,t){var i=Ie(e);return t.push(i),""},"election box gain with party link":function(e,t){var i=Ie(e);return t.push(i),""}};an["election box begin no change"]=an["election box begin"],an["election box begin no party"]=an["election box begin"],an["election box begin no party no change"]=an["election box begin"],an["election box inline begin"]=an["election box begin"],an["election box inline begin no change"]=an["election box begin"],an["election box candidate for alliance"]=an["election box candidate"],an["election box candidate minor party"]=an["election box candidate"],an["election box candidate no party link no change"]=an["election box candidate"],an["election box candidate with party link"]=an["election box candidate"],an["election box candidate with party link coalition 1918"]=an["election box candidate"],an["election box candidate with party link no change"]=an["election box candidate"],an["election box inline candidate"]=an["election box candidate"],an["election box inline candidate no change"]=an["election box candidate"],an["election box inline candidate with party link"]=an["election box candidate"],an["election box inline candidate with party link no change"]=an["election box candidate"],an["election box inline incumbent"]=an["election box candidate"];var rn=an,on=[["🇦🇩","and","andorra"],["🇦🇪","are","united arab emirates"],["🇦🇫","afg","afghanistan"],["🇦🇬","atg","antigua and barbuda"],["🇦🇮","aia","anguilla"],["🇦🇱","alb","albania"],["🇦🇲","arm","armenia"],["🇦🇴","ago","angola"],["🇦🇶","ata","antarctica"],["🇦🇷","arg","argentina"],["🇦🇸","asm","american samoa"],["🇦🇹","aut","austria"],["🇦🇺","aus","australia"],["🇦🇼","abw","aruba"],["🇦🇽","ala","åland islands"],["🇦🇿","aze","azerbaijan"],["🇧🇦","bih","bosnia and herzegovina"],["🇧🇧","brb","barbados"],["🇧🇩","bgd","bangladesh"],["🇧🇪","bel","belgium"],["🇧🇫","bfa","burkina faso"],["🇧🇬","bgr","bulgaria"],["🇧🇬","bul","bulgaria"],["🇧🇭","bhr","bahrain"],["🇧🇮","bdi","burundi"],["🇧🇯","ben","benin"],["🇧🇱","blm","saint barthélemy"],["🇧🇲","bmu","bermuda"],["🇧🇳","brn","brunei darussalam"],["🇧🇴","bol","bolivia"],["🇧🇶","bes","bonaire, sint eustatius and saba"],["🇧🇷","bra","brazil"],["🇧🇸","bhs","bahamas"],["🇧🇹","btn","bhutan"],["🇧🇻","bvt","bouvet island"],["🇧🇼","bwa","botswana"],["🇧🇾","blr","belarus"],["🇧🇿","blz","belize"],["🇨🇦","can","canada"],["🇨🇨","cck","cocos (keeling) islands"],["🇨🇩","cod","congo"],["🇨🇫","caf","central african republic"],["🇨🇬","cog","congo"],["🇨🇭","che","switzerland"],["🇨🇮","civ","côte d'ivoire"],["🇨🇰","cok","cook islands"],["🇨🇱","chl","chile"],["🇨🇲","cmr","cameroon"],["🇨🇳","chn","china"],["🇨🇴","col","colombia"],["🇨🇷","cri","costa rica"],["🇨🇺","cub","cuba"],["🇨🇻","cpv","cape verde"],["🇨🇼","cuw","curaçao"],["🇨🇽","cxr","christmas island"],["🇨🇾","cyp","cyprus"],["🇨🇿","cze","czech republic"],["🇩🇪","deu","germany"],["🇩🇪","ger","germany"],["🇩🇯","dji","djibouti"],["🇩🇰","dnk","denmark"],["🇩🇲","dma","dominica"],["🇩🇴","dom","dominican republic"],["🇩🇿","dza","algeria"],["🇪🇨","ecu","ecuador"],["🇪🇪","est","estonia"],["🇪🇬","egy","egypt"],["🇪🇭","esh","western sahara"],["🇪🇷","eri","eritrea"],["🇪🇸","esp","spain"],["🇪🇹","eth","ethiopia"],["🇫🇮","fin","finland"],["🇫🇯","fji","fiji"],["🇫🇰","flk","falkland islands (malvinas)"],["🇫🇲","fsm","micronesia"],["🇫🇴","fro","faroe islands"],["🇫🇷","fra","france"],["🇬🇦","gab","gabon"],["🇬🇧","gbr","united kingdom"],["🇬🇩","grd","grenada"],["🇬🇫","guf","french guiana"],["🇬🇬","ggy","guernsey"],["🇬🇭","gha","ghana"],["🇬🇮","gib","gibraltar"],["🇬🇱","grl","greenland"],["🇬🇲","gmb","gambia"],["🇬🇳","gin","guinea"],["🇬🇵","glp","guadeloupe"],["🇬🇶","gnq","equatorial guinea"],["🇬🇷","grc","greece"],["🇬🇸","sgs","south georgia"],["🇬🇹","gtm","guatemala"],["🇬🇺","gum","guam"],["🇬🇼","gnb","guinea-bissau"],["🇬🇾","guy","guyana"],["🇭🇰","hkg","hong kong"],["🇭🇲","hmd","heard island and mcdonald islands"],["🇭🇳","hnd","honduras"],["🇭🇷","hrv","croatia"],["🇭🇹","hti","haiti"],["🇭🇺","hun","hungary"],["🇮🇩","idn","indonesia"],["🇮🇪","irl","ireland"],["🇮🇱","isr","israel"],["🇮🇲","imn","isle of man"],["🇮🇳","ind","india"],["🇮🇴","iot","british indian ocean territory"],["🇮🇶","irq","iraq"],["🇮🇷","irn","iran"],["🇮🇸","isl","iceland"],["🇮🇹","ita","italy"],["🇯🇪","jey","jersey"],["🇯🇲","jam","jamaica"],["🇯🇴","jor","jordan"],["🇯🇵","jpn","japan"],["🇰🇪","ken","kenya"],["🇰🇬","kgz","kyrgyzstan"],["🇰🇭","khm","cambodia"],["🇰🇮","kir","kiribati"],["🇰🇲","com","comoros"],["🇰🇳","kna","saint kitts and nevis"],["🇰🇵","prk","north korea"],["🇰🇷","kor","south korea"],["🇰🇼","kwt","kuwait"],["🇰🇾","cym","cayman islands"],["🇰🇿","kaz","kazakhstan"],["🇱🇦","lao","lao people's democratic republic"],["🇱🇧","lbn","lebanon"],["🇱🇨","lca","saint lucia"],["🇱🇮","lie","liechtenstein"],["🇱🇰","lka","sri lanka"],["🇱🇷","lbr","liberia"],["🇱🇸","lso","lesotho"],["🇱🇹","ltu","lithuania"],["🇱🇺","lux","luxembourg"],["🇱🇻","lva","latvia"],["🇱🇾","lby","libya"],["🇲🇦","mar","morocco"],["🇲🇨","mco","monaco"],["🇲🇩","mda","moldova"],["🇲🇪","mne","montenegro"],["🇲🇫","maf","saint martin (french part)"],["🇲🇬","mdg","madagascar"],["🇲🇭","mhl","marshall islands"],["🇲🇰","mkd","macedonia"],["🇲🇱","mli","mali"],["🇲🇲","mmr","myanmar"],["🇲🇳","mng","mongolia"],["🇲🇴","mac","macao"],["🇲🇵","mnp","northern mariana islands"],["🇲🇶","mtq","martinique"],["🇲🇷","mrt","mauritania"],["🇲🇸","msr","montserrat"],["🇲🇹","mlt","malta"],["🇲🇺","mus","mauritius"],["🇲🇻","mdv","maldives"],["🇲🇼","mwi","malawi"],["🇲🇽","mex","mexico"],["🇲🇾","mys","malaysia"],["🇲🇿","moz","mozambique"],["🇳🇦","nam","namibia"],["🇳🇨","ncl","new caledonia"],["🇳🇪","ner","niger"],["🇳🇫","nfk","norfolk island"],["🇳🇬","nga","nigeria"],["🇳🇮","nic","nicaragua"],["🇳🇱","nld","netherlands"],["🇳🇴","nor","norway"],["🇳🇵","npl","nepal"],["🇳🇷","nru","nauru"],["🇳🇺","niu","niue"],["🇳🇿","nzl","new zealand"],["🇴🇲","omn","oman"],["🇵🇦","pan","panama"],["🇵🇪","per","peru"],["🇵🇫","pyf","french polynesia"],["🇵🇬","png","papua new guinea"],["🇵🇭","phl","philippines"],["🇵🇰","pak","pakistan"],["🇵🇱","pol","poland"],["🇵🇲","spm","saint pierre and miquelon"],["🇵🇳","pcn","pitcairn"],["🇵🇷","pri","puerto rico"],["🇵🇸","pse","palestinian territory"],["🇵🇹","prt","portugal"],["🇵🇼","plw","palau"],["🇵🇾","pry","paraguay"],["🇶🇦","qat","qatar"],["🇷🇪","reu","réunion"],["🇷🇴","rou","romania"],["🇷🇸","srb","serbia"],["🇷🇺","rus","russia"],["🇷🇼","rwa","rwanda"],["🇸🇦","sau","saudi arabia"],["🇸🇧","slb","solomon islands"],["🇸🇨","syc","seychelles"],["🇸🇩","sdn","sudan"],["🇸🇪","swe","sweden"],["🇸🇬","sgp","singapore"],["🇸🇭","shn","saint helena, ascension and tristan da cunha"],["🇸🇮","svn","slovenia"],["🇸🇯","sjm","svalbard and jan mayen"],["🇸🇰","svk","slovakia"],["🇸🇱","sle","sierra leone"],["🇸🇲","smr","san marino"],["🇸🇳","sen","senegal"],["🇸🇴","som","somalia"],["🇸🇷","sur","suriname"],["🇸🇸","ssd","south sudan"],["🇸🇹","stp","sao tome and principe"],["🇸🇻","slv","el salvador"],["🇸🇽","sxm","sint maarten (dutch part)"],["🇸🇾","syr","syrian arab republic"],["🇸🇿","swz","swaziland"],["🇹🇨","tca","turks and caicos islands"],["🇹🇩","tcd","chad"],["🇹🇫","atf","french southern territories"],["🇹🇬","tgo","togo"],["🇹🇭","tha","thailand"],["🇹🇯","tjk","tajikistan"],["🇹🇰","tkl","tokelau"],["🇹🇱","tls","timor-leste"],["🇹🇲","tkm","turkmenistan"],["🇹🇳","tun","tunisia"],["🇹🇴","ton","tonga"],["🇹🇷","tur","turkey"],["🇹🇹","tto","trinidad and tobago"],["🇹🇻","tuv","tuvalu"],["🇹🇼","twn","taiwan"],["🇹🇿","tza","tanzania"],["🇺🇦","ukr","ukraine"],["🇺🇬","uga","uganda"],["🇺🇲","umi","united states minor outlying islands"],["🇺🇸","usa","united states"],["🇺🇸","us","united states"],["🇺🇾","ury","uruguay"],["🇺🇿","uzb","uzbekistan"],["🇻🇦","vat","vatican city"],["🇻🇨","vct","saint vincent and the grenadines"],["🇻🇪","ven","venezuela"],["🇻🇬","vgb","virgin islands, british"],["🇻🇮","vir","virgin islands, u.s."],["🇻🇳","vnm","viet nam"],["🇻🇺","vut","vanuatu"],["","win","west indies"],["🇼🇫","wlf","wallis and futuna"],["🇼🇸","wsm","samoa"],["🇾🇪","yem","yemen"],["🇾🇹","myt","mayotte"],["🇿🇦","zaf","south africa"],["🇿🇲","zmb","zambia"],["🇿🇼 ","zwe","zimbabwe"],["🇺🇳","un","united nations"],["🏴󠁧󠁢󠁥󠁮󠁧󠁿󠁧󠁢󠁥󠁮󠁧󠁿","eng","england"],["🏴󠁧󠁢󠁳󠁣󠁴󠁿","sct","scotland"],["🏴󠁧󠁢󠁷󠁬󠁳󠁿","wal","wales"],["🇪🇺","eu","european union"]],sn={flag:function(e){var t=Ie(e,["flag","variant"]),i=t.flag||"";t.flag=(t.flag||"").toLowerCase();var n=on.find((function(e){return t.flag===e[1]||t.flag===e[2]}))||[],a=n[0]||"";return"".concat(a," [[").concat(n[2],"|").concat(i,"]]")},flagcountry:function(e){var t=Ie(e,["flag","variant"]);t.flag=(t.flag||"").toLowerCase();var i=on.find((function(e){return t.flag===e[1]||t.flag===e[2]}))||[],n=i[0]||"";return"".concat(n," [[").concat(i[2],"]]")},flagcu:function(e){var t=Ie(e,["flag","variant"]);t.flag=(t.flag||"").toLowerCase();var i=on.find((function(e){return t.flag===e[1]||t.flag===e[2]}))||[],n=i[0]||"";return"".concat(n," ").concat(i[2])},flagicon:function(e){var t=Ie(e,["flag","variant"]);t.flag=(t.flag||"").toLowerCase();var i=on.find((function(e){return t.flag===e[1]||t.flag===e[2]}));return i?"[[".concat(i[2],"|").concat(i[0],"]]"):""},flagdeco:function(e){var t=Ie(e,["flag","variant"]);return t.flag=(t.flag||"").toLowerCase(),(on.find((function(e){return t.flag===e[1]||t.flag===e[2]}))||[])[0]||""},fb:function(e){var t=Ie(e,["flag","variant"]);t.flag=(t.flag||"").toLowerCase();var i=on.find((function(e){return t.flag===e[1]||t.flag===e[2]}));return i?"".concat(i[0]," [[").concat(i[2]," national football team|").concat(i[2],"]]"):""},fbicon:function(e){var t=Ie(e,["flag","variant"]);t.flag=(t.flag||"").toLowerCase();var i=on.find((function(e){return t.flag===e[1]||t.flag===e[2]}));return i?" [[".concat(i[2]," national football team|").concat(i[0],"]]"):""},flagathlete:function(e){var t=Ie(e,["name","flag","variant"]);t.flag=(t.flag||"").toLowerCase();var i=on.find((function(e){return t.flag===e[1]||t.flag===e[2]}));return i?"".concat(i[0]," [[").concat(t.name||"","]] (").concat(i[1].toUpperCase(),")"):"[[".concat(t.name||"","]]")}};on.forEach((function(e){sn[e[1]]=function(){return e[0]}})),sn.cr=sn.flagcountry,sn["cr-rt"]=sn.flagcountry,sn.cricon=sn.flagicon;var cn=sn,un=function(e){var t=e.match(/ipac?-(.+)/);return null!==t?!0===S.hasOwnProperty(t[1])?S[t[1]].english_title:t[1]:null},ln={ipa:function(e,t){var i=Ie(e,["transcription","lang","audio"]);return i.lang=un(i.template),i.template="ipa",t.push(i),""},ipac:function(e,t){var i=Ie(e);return i.transcription=(i.list||[]).join(","),delete i.list,i.lang=un(i.template),i.template="ipac",t.push(i),""},transl:function(e,t){var i=Ie(e,["lang","text","text2"]);return i.text2&&(i.iso=i.text,i.text=i.text2,delete i.text2),t.push(i),i.text||""}};Object.keys(S).forEach((function(e){ln["ipa-"+e]=ln.ipa,ln["ipac-"+e]=ln.ipac}));var pn=ln,mn={lang:1,"lang-de":0,"rtl-lang":1,taste:0,nihongo:function(e,t){var i=Ie(e,["english","kanji","romaji","extra"]);t.push(i);var n=i.english||i.romaji||"";return i.kanji&&(n+=" (".concat(i.kanji,")")),n}};Object.keys(S).forEach((function(e){mn["lang-"+e]=mn["lang-de"]})),mn.nihongo2=mn.nihongo,mn.nihongo3=mn.nihongo,mn["nihongo-s"]=mn.nihongo,mn["nihongo foot"]=mn.nihongo;var dn=mn,fn=function(e){if(!e.numerator&&!e.denominator)return null;var t=Number(e.numerator)/Number(e.denominator);t*=100;var i=Number(e.decimals);return isNaN(i)&&(i=1),t=t.toFixed(i),Number(t)},gn={math:function(e,t){var i=Ie(e,["formula"]);return t.push(i),"\n\n"+(i.formula||"")+"\n\n"},frac:function(e,t){var i=Ie(e,["a","b","c"]),n={template:"sfrac"};return i.c?(n.integer=i.a,n.numerator=i.b,n.denominator=i.c):i.b?(n.numerator=i.a,n.denominator=i.b):(n.numerator=1,n.denominator=i.a),t.push(n),n.integer?"".concat(n.integer," ").concat(n.numerator,"⁄").concat(n.denominator):"".concat(n.numerator,"⁄").concat(n.denominator)},radic:function(e){var t=Ie(e,["after","before"]);return"".concat(t.before||"","√").concat(t.after||"")},percentage:function(e){var t=Ie(e,["numerator","denominator","decimals"]),i=fn(t);return null===i?"":i+"%"},"percent-done":function(e){var t=Ie(e,["done","total","digits"]),i=fn({numerator:t.done,denominator:t.total,decimals:t.digits});return null===i?"":"".concat(t.done," (").concat(i,"%) done")},"winning percentage":function(e,t){var i=Ie(e,["wins","losses","ties"]);t.push(i);var n=Number(i.wins),a=Number(i.losses),r=Number(i.ties)||0,o=n+a+r;"y"===i.ignore_ties&&(r=0),r&&(n+=r/2);var s=fn({numerator:n,denominator:o,decimals:1});return null===s?"":".".concat(10*s)},winlosspct:function(e,t){var i=Ie(e,["wins","losses"]);t.push(i);var n=Number(i.wins),a=Number(i.losses),r=fn({numerator:n,denominator:n+a,decimals:1});return null===r?"":(r=".".concat(10*r),"".concat(n||0," || ").concat(a||0," || ").concat(r||"-"))}};gn.sfrac=gn.frac,gn.sqrt=gn.radic,gn.pct=gn.percentage,gn.percent=gn.percentage,gn.winpct=gn["winning percentage"],gn.winperc=gn["winning percentage"];var hn=gn,bn=function(e,t,i){var n=Ie(e);return i&&(n.name=n.template,n.template=i),t.push(n),""},kn={persondata:bn,taxobox:bn,citation:bn,portal:bn,reflist:bn,"cite book":bn,"cite journal":bn,"cite web":bn,"commons cat":bn,"portuguese name":["first","second","suffix"],uss:["ship","id"],isbn:function(e,t){var i=Ie(e,["id","id2","id3"]);return t.push(i),"ISBN: "+(i.id||"")},marriage:function(e,t){var i=Ie(e,["spouse","from","to","end"]);t.push(i);var n="".concat(i.spouse||"");return i.from&&(i.to?n+=" (m. ".concat(i.from,"-").concat(i.to,")"):n+=" (m. ".concat(i.from,")")),n},"based on":function(e,t){var i=Ie(e,["title","author"]);return t.push(i),"".concat(i.title," by ").concat(i.author||"")},"video game release":function(e,t){for(var i=["region","date","region2","date2","region3","date3","region4","date4"],n=Ie(e,i),a={template:"video game release",releases:[]},r=0;r0&&t.push(c),""},Yn=function(e){Object.defineProperty(this,"data",{enumerable:!1,value:e})},Zn={text:function(){return""},json:function(){return this.data}};Object.keys(Zn).forEach((function(e){Yn.prototype[e]=Zn[e]}));var Gn=Yn,Hn=new RegExp("^(cite |citation)","i"),Vn={citation:!0,refn:!0,harvnb:!0},Jn=function(e){return"infobox"===e.template&&e.data&&function(e){return e&&"[object Object]"===Object.prototype.toString.call(e)}(e.data)},Qn=function(e,t){var i=e.wiki,n=Jt(i),a=[];n.forEach((function(e){return function e(t,n){t.parent=n,t.children&&t.children.length>0&&t.children.forEach((function(i){return e(i,t)})),t.out=Wn(t,a);!function e(t,i,n){t.parent&&(t.parent.body=t.parent.body.replace(i,n),e(t.parent,i,n))}(t,t.body,t.out),i=i.replace(t.body,t.out)}(e,null)})),e.infoboxes=e.infoboxes||[],e.references=e.references||[],e.templates=e.templates||[],e.templates=e.templates.concat(a),e.templates=e.templates.filter((function(i){return!0===function(e){return!0===Vn[e.template]||!0===Hn.test(e.template)}(i)?(e.references.push(new Me(i)),!1):!0!==Jn(i)||(i.domain=t.domain,e.infoboxes.push(new Wt(i)),!1)})),e.templates=e.templates.map((function(e){return new Gn(e)})),n.forEach((function(e){i=i.replace(e.body,e.out)})),e.wiki=i},Xn=je,ea=function(e,t){var i=e.wiki;i=i.replace(/]*?)>([\s\S]+?)<\/gallery>/g,(function(i,n,a){var r=a.split(/\n/g);return(r=(r=r.filter((function(e){return e&&""!==e.trim()}))).map((function(e){var i=e.split(/\|/),n={file:i[0].trim(),lang:t.language,domain:t.domain},a=new $(n).json(),r=i.slice(1).join("|");return""!==r&&(a.caption=Xn(r)),a}))).length>0&&e.templates.push({template:"gallery",images:r,pos:e.title}),""})),e.wiki=i},ta=function(e){var t=e.wiki;t=t.replace(/\{\{election box begin([\s\S]+?)\{\{election box end\}\}/gi,(function(t){var i={wiki:t,templates:[]};Qn(i);var n=i.templates.map((function(e){return e.json()})),a=n.find((function(e){return"election box"===e.template}))||{},r=n.filter((function(e){return"election box candidate"===e.template})),o=n.find((function(e){return"election box gain"===e.template||"election box hold"===e.template}))||{};return(r.length>0||o)&&e.templates.push({template:"election box",title:a.title,candidates:r,summary:o.data}),""})),e.wiki=t},ia={coach:["team","year","g","w","l","w-l%","finish","pg","pw","pl","pw-l%"],player:["year","team","gp","gs","mpg","fg%","3p%","ft%","rpg","apg","spg","bpg","ppg"],roster:["player","gp","gs","mpg","fg%","3fg%","ft%","rpg","apg","spg","bpg","ppg"]},na=function(e){var t=e.wiki;t=t.replace(/\{\{nba (coach|player|roster) statistics start([\s\S]+?)\{\{s-end\}\}/gi,(function(t,i){t=(t=t.replace(/^\{\{.*?\}\}/,"")).replace(/\{\{s-end\}\}/,""),i=i.toLowerCase().trim();var n="! "+ia[i].join(" !! "),a=at("{|\n"+n+"\n"+t+"\n|}");return a=a.map((function(e){return Object.keys(e).forEach((function(t){e[t]=e[t].text()})),e})),e.templates.push({template:"NBA "+i+" statistics",data:a}),""})),e.wiki=t},aa=function(e){var t=e.wiki;t=t.replace(/\{\{mlb game log (section|month)[\s\S]+?\{\{mlb game log (section|month) end\}\}/gi,(function(t){var i=function(e){var t=["#","date","opponent","score","win","loss","save","attendance","record"];return!0===/\|stadium=y/i.test(e)&&t.splice(7,0,"stadium"),!0===/\|time=y/i.test(e)&&t.splice(7,0,"time"),!0===/\|box=y/i.test(e)&&t.push("box"),t}(t);t=(t=t.replace(/^\{\{.*?\}\}/,"")).replace(/\{\{mlb game log (section|month) end\}\}/i,"");var n="! "+i.join(" !! "),a=at("{|\n"+n+"\n"+t+"\n|}");return a=a.map((function(e){return Object.keys(e).forEach((function(t){e[t]=e[t].text()})),e})),e.templates.push({template:"mlb game log section",data:a}),""})),e.wiki=t},ra=["res","record","opponent","method","event","date","round","time","location","notes"],oa=function(e){var t=e.wiki;t=t.replace(/\{\{mma record start[\s\S]+?\{\{end\}\}/gi,(function(t){t=(t=t.replace(/^\{\{.*?\}\}/,"")).replace(/\{\{end\}\}/i,"");var i="! "+ra.join(" !! "),n=at("{|\n"+i+"\n"+t+"\n|}");return n=n.map((function(e){return Object.keys(e).forEach((function(t){e[t]=e[t].text()})),e})),e.templates.push({template:"mma record start",data:n}),""})),e.wiki=t},sa=je,ca=function(e){var t=e.wiki;t=(t=t.replace(/]*?)>([\s\S]+?)<\/math>/g,(function(t,i,n){var a=sa(n).text();return e.templates.push({template:"math",formula:a,raw:n}),a&&a.length<12?a:""}))).replace(/]*?)>([\s\S]+?)<\/chem>/g,(function(t,i,n){return e.templates.push({template:"chem",data:n}),""})),e.wiki=t},ua=function(e,t){ta(e),ea(e,t),ca(e),aa(e),oa(e),na(e)},la=new RegExp("^("+_.references.join("|")+"):?","i"),pa=/(?:\n|^)(={2,5}.{1,200}?={2,5})/g,ma={heading:Ze,table:mt,paragraphs:Rt,templates:Qn,references:Be,startEndTemplates:ua},da=function(e,t){return ma.startEndTemplates(e,t),ma.references(e),ma.templates(e,t),ma.table(e),ma.paragraphs(e,t),e=new ie(e)},fa=function(e){for(var t=[],i=e.wiki.split(pa),n=0;n0||(t.templates().length>0||(e[i+1]&&e[i+1].depth>t.depth&&(e[i+1].depth-=1),!1)))}))}(t)},ga=new RegExp("\\[\\[:?("+_.categories.join("|")+"):(.{2,178}?)]](w{0,10})","ig"),ha=new RegExp("^\\[\\[:?("+_.categories.join("|")+"):","ig"),ba={section:fa,categories:function(e){var t=e.wiki,i=t.match(ga);i&&i.forEach((function(t){(t=(t=(t=t.replace(ha,"")).replace(/\|?[ \*]?\]\]$/i,"")).replace(/\|.*/,""))&&!t.match(/[\[\]]/)&&e.categories.push(t.trim())})),t=t.replace(ga,""),e.wiki=t}},ka=function(e,t){t=t||{};var i=Object.assign(t,{title:t.title||null,pageID:t.pageID||t.id||null,namespace:t.namespace||t.ns||null,type:"page",wiki:e||"",categories:[],sections:[],coordinates:[]});return!0===R(e)?(i.type="redirect",i.redirectTo=U(e),ba.categories(i),new O(i)):(Z(i),ba.categories(i),ba.section(i),new O(i))},wa=function(e){var t=(e=e.filter((function(e){return e}))).map((function(e){return ka(e.wiki,e.meta)}));return 0===t.length?null:1===t.length?t[0]:t},va=function(e,t){return fetch(e,t).then((function(e){return e.json()}))},ya=function(e){var t=e.userAgent||e["User-Agent"]||e["Api-User-Agent"]||"User of the wtf_wikipedia library";return{method:"GET",headers:{"Content-Type":"application/json","Api-User-Agent":t,"User-Agent":t,Origin:"*"},redirect:"follow"}},xa=/^https?:\/\//,$a={lang:"en",wiki:"wikipedia",domain:null,follow_redirects:!0,path:"api.php"},ja=function(t,i,n){var a=null;"function"==typeof i&&(a=i,i={}),"function"==typeof n&&(a=n,n={}),"string"==typeof i&&(n=n||{},i=Object.assign({},{lang:i},n)),i=i||{},(i=Object.assign({},$a,i)).title=t,xa.test(t)&&(i=Object.assign(i,e(t)));var r=c(i),o=ya(i);return va(r,o).then((function(e){try{var t=u(e,i);return t=wa(t),a&&a(null,t),t}catch(e){throw e}})).catch((function(e){return console.error(e),a&&a(e,null),null}))},za={lang:"en",wiki:"wikipedia",domain:null,path:"w/api.php"},Ea=function(e,t){var i;t=t||{},t=Object.assign({},za,t),"string"==typeof e?t.lang=e:(i=e)&&"[object Object]"===Object.prototype.toString.call(i)&&(t=Object.assign(t,e));var n="https://".concat(t.lang,".wikipedia.org/").concat(t.path,"?");t.domain&&(n="https://".concat(t.domain,"/").concat(t.path,"?")),n+="format=json&action=query&generator=random&grnnamespace=0&prop=revisions|pageprops&rvprop=content&grnlimit=1&rvslots=main&origin=*";var a=ya(t);return va(n,a).then((function(e){try{var t=u(e);return wa(t)}catch(e){throw e}})).catch((function(e){return console.error(e),null}))},Oa={lang:"en",wiki:"wikipedia",domain:null,path:"w/api.php"},_a=function(e,t,i){var n;i=i||{},i=Object.assign({},Oa,i),"string"==typeof t?i.lang=t:(n=t)&&"[object Object]"===Object.prototype.toString.call(n)&&(i=Object.assign(i,t));var a={pages:[],categories:[]};return new Promise((function(t,n){!function r(o){var s=function(e,t,i){e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!1===/^Category/i.test(e)&&(e="Category:"+e),e=e.replace(/ /g,"_")}(e),e=encodeURIComponent(e);var n="https://".concat(t.lang,".wikipedia.org/").concat(t.path,"?");return t.domain&&(n="https://".concat(t.domain,"/").concat(t.path,"?")),n+="action=query&list=categorymembers&cmtitle=".concat(e,"&cmlimit=500&format=json&origin=*&redirects=true&cmtype=page|subcat"),i&&(n+="&cmcontinue="+i),n}(e,i,o),c=ya(i);return va(s,c).then((function(e){a=function(e){var t=e.query.categorymembers||[],i={pages:[],categories:[]};return t.forEach((function(e){14===e.ns?(delete e.ns,i.categories.push(e)):(delete e.ns,i.pages.push(e))})),i}(e),e.continue&&e.continue.cmcontinue?r(e.continue.cmcontinue):t(a)})).catch((function(e){console.error(e),n(e)}))}(null)}))},Sa=function(e,t){return ka(e,t)},Ca={Doc:O,Section:ie,Paragraph:kt,Sentence:ge,Image:$,Infobox:Wt,Link:se,List:St,Reference:Me,Table:ut,Template:Gn,http:va,wtf:Sa};return Sa.fetch=function(e,t,i,n){return ja(e,t,i)},Sa.random=function(e,t,i){return Ea(e,t)},Sa.category=function(e,t,i,n){return _a(e,t,i)},Sa.extend=function(e){return e(Ca,Fn,this),this},Sa.version="8.4.0",Sa})); diff --git a/builds/wtf_wikipedia-client.mjs b/builds/wtf_wikipedia-client.mjs index 4c77632d..cf58e90a 100644 --- a/builds/wtf_wikipedia-client.mjs +++ b/builds/wtf_wikipedia-client.mjs @@ -1 +1 @@ -var e=function(e){var t=new URL(e),i=t.pathname.replace(/^\/(wiki\/)?/,"");return i=decodeURIComponent(i),{domain:t.host,title:i}};function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var i=[],n=!0,a=!1,r=void 0;try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done)&&(i.push(o.value),!t||i.length!==t);n=!0);}catch(e){a=!0,r=e}finally{try{n||null==s.return||s.return()}finally{if(a)throw r}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return n(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(i);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return n(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);iObject.keys(t.data).length?-1:1})),"number"==typeof e?t[e]:t},text:function(e){return e=p(e,E),!0===this.isRedirect()?"":this.sections().map((function(t){return t.text(e)})).join("\n\n")},json:function(e){return e=p(e,E),d(this,e)},debug:function(){return console.log("\n"),this.sections().forEach((function(e){for(var t=" - ",i=0;i500)&&U.test(e)},K=function(e){var t=e.match(U);return t&&t[2]?(R(t[2])||[])[0]:{}},B=["table","code","score","data","categorytree","charinsert","hiero","imagemap","inputbox","nowiki","poem","references","source","syntaxhighlight","timeline"],W="< ?(".concat(B.join("|"),") ?[^>]{0,200}?>"),Y="< ?/ ?(".concat(B.join("|"),") ?>"),Z=new RegExp("".concat(W,"[").concat("\\s\\S","]+?").concat(Y),"ig"),G=function(e){return(e=(e=(e=(e=(e=(e=(e=e.replace(Z," ")).replace(/ ?< ?(span|div|table|data) [a-zA-Z0-9=%\.#:;'" ]{2,100}\/? ?> ?/g," ")).replace(/ ?< ?(ref) [a-zA-Z0-9=" ]{2,100}\/ ?> ?/g," ")).replace(/ ?<[ \/]?(p|sub|sup|span|nowiki|div|table|br|tr|td|th|pre|pre2|hr)[ \/]?> ?/g," ")).replace(/ ?<[ \/]?(abbr|bdi|bdo|blockquote|cite|del|dfn|em|i|ins|kbd|mark|q|s|small)[ \/]?> ?/g," ")).replace(/ ?<[ \/]?h[0-9][ \/]?> ?/g," ")).replace(/ ?< ?br ?\/> ?/g,"\n")).trim()};var H=function(e){var t=e.wiki;t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace(//g,"")).replace(/__(NOTOC|NOEDITSECTION|FORCETOC|TOC)__/gi,"")).replace(/~~{1,3}/g,"")).replace(/\r/g,"")).replace(/\u3002/g,". ")).replace(/----/g,"")).replace(/\{\{\}\}/g," – ")).replace(/\{\{\\\}\}/g," / ")).replace(/ /g," "),t=(t=(t=G(t)).replace(/\([,;: ]+?\)/g,"")).replace(/{{(baseball|basketball) (primary|secondary) (style|color).*?\}\}/i,""),e.wiki=t},V=/[\\\.$]/,J=function(e){return"string"!=typeof e&&(e=""),e=(e=(e=e.replace(/\\/g,"\\\\")).replace(/^\$/,"\\u0024")).replace(/\./g,"\\u002e")},Q=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Object.keys(e),i=0;i0&&(i.paragraphs=n)}if(!0===t.images){var a=e.images().map((function(e){return e.json(t)}));a.length>0&&(i.images=a)}if(!0===t.tables){var r=e.tables().map((function(e){return e.json(t)}));r.length>0&&(i.tables=r)}if(!0===t.templates){var o=e.templates();o.length>0&&(i.templates=o,!0===t.encode&&i.templates.forEach((function(e){return Q(e)})))}if(!0===t.infoboxes){var s=e.infoboxes().map((function(e){return e.json(t)}));s.length>0&&(i.infoboxes=s)}if(!0===t.lists){var c=e.lists().map((function(e){return e.json(t)}));c.length>0&&(i.lists=c)}if(!0===t.references||!0===t.citations){var u=e.references().map((function(e){return e.json(t)}));u.length>0&&(i.references=u)}return!0===t.sentences&&(i.sentences=e.sentences().map((function(e){return e.json(t)}))),i},te={tables:!0,references:!0,paragraphs:!0,templates:!0,infoboxes:!0},ie=function(e){this.depth=e.depth,this.doc=null,this._title=e.title||"",Object.defineProperty(this,"doc",{enumerable:!1,value:null}),e.templates=e.templates||[],Object.defineProperty(this,"data",{enumerable:!1,value:e})},ne={title:function(){return this._title||""},index:function(){if(!this.doc)return null;var e=this.doc.sections().indexOf(this);return-1===e?null:e},indentation:function(){return this.depth},sentences:function(e){var t=this.paragraphs().reduce((function(e,t){return e.concat(t.sentences())}),[]);return"number"==typeof e?t[e]:t||[]},paragraphs:function(e){var t=this.data.paragraphs||[];return"number"==typeof e?t[e]:t||[]},paragraph:function(e){var t=this.data.paragraphs||[];return"number"==typeof e?t[e]:t[0]},links:function(e){var t=[];if(this.infoboxes().forEach((function(i){i.links(e).forEach((function(e){return t.push(e)}))})),this.sentences().forEach((function(i){i.links(e).forEach((function(e){return t.push(e)}))})),this.tables().forEach((function(i){i.links(e).forEach((function(e){return t.push(e)}))})),this.lists().forEach((function(i){i.links(e).forEach((function(e){return t.push(e)}))})),"number"==typeof e)return t[e];if("string"==typeof e){e=e.charAt(0).toUpperCase()+e.substring(1);var i=t.find((function(t){return t.page()===e}));return void 0===i?[]:[i]}return t},tables:function(e){var t=this.data.tables||[];return"number"==typeof e?t[e]:t},templates:function(e){var t=this.data.templates||[];return t=t.map((function(e){return e.json()})),"number"==typeof e?t[e]:"string"==typeof e?(e=e.toLowerCase(),t.filter((function(t){return t.template===e||t.name===e}))):t},infoboxes:function(e){var t=this.data.infoboxes||[];return"number"==typeof e?t[e]:t},coordinates:function(e){var t=[].concat(this.templates("coord"),this.templates("coor"));return"number"==typeof e?t[e]?t[e]:[]:t},lists:function(e){var t=[];return this.paragraphs().forEach((function(e){t=t.concat(e.lists())})),"number"==typeof e?t[e]:t},interwiki:function(e){var t=[];return this.paragraphs().forEach((function(e){t=t.concat(e.interwiki())})),"number"==typeof e?t[e]:t||[]},images:function(e){var t=[];return this.paragraphs().forEach((function(e){t=t.concat(e.images())})),"number"==typeof e?t[e]:t||[]},references:function(e){var t=this.data.references||[];return"number"==typeof e?t[e]:t},remove:function(){if(!this.doc)return null;var e={};e[this.title()]=!0,this.children().forEach((function(t){return e[t.title()]=!0}));var t=this.doc.data.sections;return t=t.filter((function(t){return!0!==e.hasOwnProperty(t.title())})),this.doc.data.sections=t,this.doc},nextSibling:function(){if(!this.doc)return null;for(var e=this.doc.sections(),t=this.index()+1;tthis.depth)for(var a=i+1;athis.depth;a+=1)n.push(t[a]);return"string"==typeof e?(e=e.toLowerCase(),n.find((function(t){return t.title().toLowerCase()===e}))):"number"==typeof e?n[e]:n},parent:function(){if(!this.doc)return null;for(var e=this.doc.sections(),t=this.index();t>=0;t-=1)if(e[t]&&e[t].depth0&&(e.fmt=e.fmt||{},e.fmt.bold=t),i.length>0&&(e.fmt=e.fmt||{},e.fmt.italic=i),e},me=/^[0-9,.]+$/,de={text:!0,links:!0,formatting:!0,numbers:!0},fe=function(e,t){t=p(t,de);var i={},n=e.text();if(!0===t.text&&(i.text=n),!0===t.numbers&&me.test(n)){var a=Number(n.replace(/,/g,""));!1===isNaN(a)&&(i.number=a)}return t.links&&e.links().length>0&&(i.links=e.links().map((function(e){return e.json()}))),t.formatting&&e.data.fmt&&(i.formatting=e.data.fmt),i},ge=function(e){Object.defineProperty(this,"data",{enumerable:!1,value:e})},he={links:function(e){var t=this.data.links||[];if("number"==typeof e)return t[e];if("string"==typeof e){e=e.charAt(0).toUpperCase()+e.substring(1);var i=t.find((function(t){return t.page===e}));return void 0===i?[]:[i]}return t},interwiki:function(e){var t=this.links().filter((function(e){return void 0!==e.wiki}));return"number"==typeof e?t[e]:t},bolds:function(e){var t=[];return this.data&&this.data.fmt&&this.data.fmt.bold&&(t=this.data.fmt.bold||[]),"number"==typeof e?t[e]:t},italics:function(e){var t=[];return this.data&&this.data.fmt&&this.data.fmt.italic&&(t=this.data.fmt.italic||[]),"number"==typeof e?t[e]:t},dates:function(e){var t=[];return"number"==typeof e?t[e]:t},text:function(e){return void 0!==e&&"string"==typeof e&&(this.data.text=e),this.data.text||""},json:function(e){return fe(this,e)}};Object.keys(he).forEach((function(e){ge.prototype[e]=he[e]})),ge.prototype.italic=ge.prototype.italics,ge.prototype.bold=ge.prototype.bolds,ge.prototype.plaintext=ge.prototype.text;var be=ge,ke=["ad","adj","adm","adv","al","alta","approx","apr","apt","arc","ariz","assn","asst","atty","aug","ave","ba","bc","bl","bldg","blvd","brig","bros","ca","cal","calif","capt","cca","cg","cl","cm","cmdr","co","col","colo","comdr","conn","corp","cpl","cres","ct","cyn","dak","dec","def","dept","det","dg","dist","dl","dm","dr","ea","eg","eng","esp","esq","est","etc","ex","exp","feb","fem","fig","fl oz","fl","fla","fm","fr","ft","fy","ga","gal","gb","gen","gov","hg","hon","hr","hrs","hwy","hz","ia","ida","ie","inc","inf","jan","jd","jr","jul","jun","kan","kans","kb","kg","km","kmph","lat","lb","lit","llb","lm","lng","lt","ltd","lx","ma","maj","mar","masc","mb","md","messrs","mg","mi","min","minn","misc","mister","ml","mlle","mm","mme","mph","mps","mr","mrs","ms","mstr","mt","neb","nebr","nee","no","nov","oct","okla","ont","op","ord","oz","pa","pd","penn","penna","phd","pl","pp","pref","prob","prof","pron","ps","psa","pseud","pt","pvt","qt","que","rb","rd","rep","reps","res","rev","sask","sec","sen","sens","sep","sept","sfc","sgt","sir","situ","sq ft","sq","sr","ss","st","supt","surg","tb","tbl","tbsp","tce","td","tel","temp","tenn","tex","tsp","univ","usafa","ut","va","vb","ver","vet","vitro","vivo","vol","vs","vt","wis","wisc","wr","wy","wyo","yb","µg"].concat("[^]][^]]"),we=new RegExp("(^| |')("+ke.join("|")+")[.!?] ?$","i"),ve=new RegExp("[ |.|'|[][A-Z].? *?$","i"),ye=new RegExp("\\.\\.\\.* +?$"),xe=/ c\. $/,$e=new RegExp("[a-zа-яぁ-ゟ][a-zа-яぁ-ゟ゠-ヿ]","iu"),je=function(e){var t=[],i=[];if(!e||"string"!=typeof e||0===e.trim().length)return t;for(var n=function(e){var t=e.split(/(\n+)/);return function(e){var t=[];return e.forEach((function(e){t=t.concat(e)})),t}(t=(t=t.filter((function(e){return e.match(/\S/)}))).map((function(e){return e.split(/(\S.+?[.!?]"?)(?=\s+|$)/g)})))}(e),a=0;ai.length)return!1;var n=e.match(/"/g);return!(n&&n.length%2!=0&&e.length<900)}(o))?i[s+1]=i[s]+(i[s+1]||""):i[s]&&i[s].length>0&&(t.push(i[s]),i[s]="");return 0===t.length?[e]:t};function ze(e){var t,i={text:e};return le(i),i.text=(t=(t=(t=i.text).replace(/\([,;: ]*\)/g,"")).replace(/\( *(; ?)+/g,"("),t=(t=re(t)).replace(/ +\.$/,".")),i=pe(i),new be(i)}var Ee=ze,Oe=function(e){var t=je(e.wiki);(t=t.map(ze))[0]&&t[0].text()&&":"===t[0].text()[0]&&(t=t.slice(1)),e.sentences=t},_e=function(e){return e=(e=e.replace(/^\{\{/,"")).replace(/\}\}$/,"")},Se=function(e){return e=(e=(e=(e||"").trim()).toLowerCase()).replace(/_/g," ")},Ce=function(e){var t=e.split(/\n?\|/);t.forEach((function(e,i){null!==e&&(/\[\[[^\]]+$/.test(e)||/\{\{[^\}]+$/.test(e)||e.split("{{").length!==e.split("}}").length||e.split("[[").length!==e.split("]]").length)&&(t[i+1]=t[i]+"|"+t[i+1],t[i]=null)}));for(var i=(t=(t=t.filter((function(e){return null!==e}))).map((function(e){return(e||"").trim()}))).length-1;i>=0;i-=1){""===t[i]&&t.pop();break}return t},qe=/^[ '-\)\x2D\.0-9_a-z\xC0-\xFF\u0153\u017F\u1E9E\u212A\u212B]+=/i,Ne={template:!0,list:!0,prototype:!0},Ae=function(e,t){var i=0;return e.reduce((function(e,n){if(n=(n||"").trim(),!0===qe.test(n)){var a=function(e){var t=e.split("="),i=t[0]||"";i=i.toLowerCase().trim();var n=t.slice(1).join("=");return Ne.hasOwnProperty(i)&&(i="_"+i),{key:i,val:n.trim()}}(n);if(a.key)return e[a.key]=a.val,e}t&&t[i]?e[t[i]]=n:(e.list=e.list||[],e.list.push(n));return i+=1,e}),{})},Le={classname:!0,style:!0,align:!0,margin:!0,left:!0,break:!0,boxsize:!0,framestyle:!0,item_style:!0,collapsible:!0,list_style_type:!0,"list-style-type":!0,colwidth:!0},De=function(e){return Object.keys(e).forEach((function(t){!0===Le[t.toLowerCase()]&&delete e[t],null!==e[t]&&""!==e[t]||delete e[t]})),e},Ie=Ee,Te=function(e,t){var i=Ie(e);return"json"===t?i.json():"raw"===t?i:i.text()},Pe=function(e,t,i){t=t||[],e=_e(e||"");var n=Ce(e),a=n.shift(),r=Ae(n,t);return(r=De(r))[1]&&t[0]&&!1===r.hasOwnProperty(t[0])&&(r[t[0]]=r[1],delete r[1]),Object.keys(r).forEach((function(e){r[e]="list"!==e?Te(r[e],i):r[e].map((function(e){return Te(e,i)}))})),a&&(r.template=Se(a)),r},Me=function(e){Object.defineProperty(this,"data",{enumerable:!1,value:e})},Re={title:function(){var e=this.data;return e.title||e.encyclopedia||e.author||""},links:function(e){var t=[];if("number"==typeof e)return t[e];if("number"==typeof e)return t[e];if("string"==typeof e){e=e.charAt(0).toUpperCase()+e.substring(1);var i=t.find((function(t){return t.page()===e}));return void 0===i?[]:[i]}return t||[]},text:function(){return""},json:function(){return this.data}};Object.keys(Re).forEach((function(e){Me.prototype[e]=Re[e]}));var Ue=Me,Fe=Ee,Ke=function(e){return/^ *?\{\{ *?(cite|citation)/i.test(e)&&/\}\} *?$/.test(e)&&!1===/citation needed/i.test(e)},Be=function(e){var t=Pe(e);return t.type=t.template.replace(/cite /,""),t.template="citation",t},We=function(e){return{template:"citation",type:"inline",data:{},inline:Fe(e)||{}}},Ye=function(e){var t=[],i=e.wiki;i=(i=(i=(i=i.replace(/ ?([\s\S]{0,1800}?)<\/ref> ?/gi,(function(e,n){if(Ke(n)){var a=Be(n);a&&t.push(a),i=i.replace(n,"")}else t.push(We(n));return" "}))).replace(/ ?]{0,200}?\/> ?/gi," ")).replace(/ ?]{0,200}?>([\s\S]{0,1800}?)<\/ref> ?/gi,(function(e,n){if(Ke(n)){var a=Be(n);a&&t.push(a),i=i.replace(n,"")}else t.push(We(n));return" "}))).replace(/ ?<[ \/]?[a-z0-9]{1,8}[a-z0-9=" ]{2,20}[ \/]?> ?/g," "),e.references=t.map((function(e){return new Ue(e)})),e.wiki=i},Ze=Ee,Ge=/^(={1,5})(.{1,200}?)={1,5}$/,He=function(e,t){var i=t.match(Ge);if(!i)return e.title="",e.depth=0,e;var n=i[2]||"",a={wiki:n=(n=Ze(n).text()).replace(/\{\{.+?\}\}/,"")};Ye(a),n=re(n=a.wiki);var r=0;return i[1]&&(r=i[1].length-2),e.title=n,e.depth=r,e},Ve=function(e){var t=[],i=[];e=function(e){return e=e.filter((function(e){return e&&!0!==/^\|\+/.test(e)})),!0===/^{\|/.test(e[0])&&e.shift(),!0===/^\|}/.test(e[e.length-1])&&e.pop(),!0===/^\|-/.test(e[0])&&e.shift(),e}(e);for(var n=0;n0&&(t.push(i),i=[]):(!(a=a.split(/(?:\|\||!!)/))[0]&&a[1]&&a.shift(),a.forEach((function(e){e=(e=e.replace(/^\| */,"")).trim(),i.push(e)})))}return i.length>0&&t.push(i),t},Je=/.*rowspan *?= *?["']?([0-9]+)["']?[ \|]*/,Qe=/.*colspan *?= *?["']?([0-9]+)["']?[ \|]*/,Xe=function(e){return e=function(e){return e.forEach((function(t,i){t.forEach((function(n,a){var r=n.match(Je);if(null!==r){var o=parseInt(r[1],10);n=n.replace(Je,""),t[a]=n;for(var s=i+1;s0}))}(e))},et=Ee,tt=/^!/,it={name:!0,age:!0,born:!0,date:!0,year:!0,city:!0,country:!0,population:!0,count:!0,number:!0},nt=function(e){return(e=et(e).text()).match(/\|/)&&(e=e.replace(/.+\| ?/,"")),e=(e=(e=e.replace(/style=['"].*?["']/,"")).replace(/^!/,"")).trim()},at=function(e){return(e=e||[]).length-e.filter((function(e){return e})).length>3},rt=function(e){if(e.length<=3)return[];var t=e[0].slice(0);t=t.map((function(e){return e=e.replace(/^\! */,""),e=et(e).text(),e=(e=nt(e)).toLowerCase()}));for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:[],t=[];at(e[0])&&e.shift();var i=e[0];return i&&i[0]&&i[1]&&(/^!/.test(i[0])||/^!/.test(i[1]))&&(t=i.map((function(e){return e=e.replace(/^\! */,""),e=nt(e)})),e.shift()),(i=e[0])&&i[0]&&i[1]&&/^!/.test(i[0])&&/^!/.test(i[1])&&(i.forEach((function(e,i){e=e.replace(/^\! */,""),e=nt(e),!0===Boolean(e)&&(t[i]=e)})),e.shift()),t}(i=Xe(i));if(!n||n.length<=1){n=rt(i);var a=i[i.length-1]||[];n.length<=1&&a.length>2&&(n=rt(i.slice(1))).length>0&&(i=i.slice(2))}return i.map((function(e){return function(e,t){var i={};return e.forEach((function(e,n){var a=t[n]||"col"+(n+1),r=et(e);r.text(nt(r.text())),i[a]=r})),i}(e,n)}))},st=function(e,t){return e.map((function(e){var i={};return Object.keys(e).forEach((function(t){i[t]=e[t].json()})),!0===t.encode&&(i=Q(i)),i}))},ct={},ut=function(e){Object.defineProperty(this,"data",{enumerable:!1,value:e})},lt={links:function(e){var t=[];if(this.data.forEach((function(e){Object.keys(e).forEach((function(i){t=t.concat(e[i].links())}))})),"number"==typeof e)return t[e];if("string"==typeof e){e=e.charAt(0).toUpperCase()+e.substring(1);var i=t.find((function(t){return t.page()===e}));return void 0===i?[]:[i]}return t},keyValue:function(e){var t=this.json(e);return t.forEach((function(e){Object.keys(e).forEach((function(t){e[t]=e[t].text}))})),t},json:function(e){return e=p(e,ct),st(this.data,e)},text:function(){return""}};lt.keyvalue=lt.keyValue,lt.keyval=lt.keyValue,Object.keys(lt).forEach((function(e){ut.prototype[e]=lt[e]}));var pt=ut,mt=/^\s*{\|/,dt=/^\s*\|}/,ft=function(e){for(var t=[],i=e.wiki,n=i.split("\n"),a=[],r=0;r0&&(a[a.length-1]+="\n"+n[r]);else{a[a.length-1]+="\n"+n[r];var o=a.pop();t.push(o)}else a.push(n[r]);var s=[];t.forEach((function(e){if(e){i=(i=i.replace(e+"\n","")).replace(e,"");var t=ot(e);t&&t.length>0&&s.push(new pt(t))}})),s.length>0&&(e.tables=s),e.wiki=i},gt={sentences:!0},ht=function(e,t){var i={};return!0===(t=p(t,gt)).sentences&&(i.sentences=e.sentences().map((function(e){return e.json(t)}))),i},bt={sentences:!0,lists:!0,images:!0},kt=function(e){Object.defineProperty(this,"data",{enumerable:!1,value:e})},wt={sentences:function(e){return"number"==typeof e?this.data.sentences[e]:this.data.sentences||[]},references:function(e){return"number"==typeof e?this.data.references[e]:this.data.references},lists:function(e){return"number"==typeof e?this.data.lists[e]:this.data.lists},images:function(e){return"number"==typeof e?this.data.images[e]:this.data.images||[]},links:function(e){var t=[];if(this.sentences().forEach((function(i){t=t.concat(i.links(e))})),"number"==typeof e)return t[e];if("string"==typeof e){e=e.charAt(0).toUpperCase()+e.substring(1);var i=t.find((function(t){return t.page()===e}));return void 0===i?[]:[i]}return t||[]},interwiki:function(e){var t=[];return this.sentences().forEach((function(e){t=t.concat(e.interwiki())})),"number"==typeof e?t[e]:t||[]},text:function(e){e=p(e,bt);var t=this.sentences().map((function(t){return t.text(e)})).join(" ");return this.lists().forEach((function(e){t+="\n"+e.text()})),t},json:function(e){return e=p(e,bt),ht(this,e)}};wt.citations=wt.references,Object.keys(wt).forEach((function(e){kt.prototype[e]=wt[e]}));var vt=kt;var yt=function(e){for(var t=[],i=[],n=e.split(""),a=0,r=0;r0){for(var s=0,c=0,u=0;uc&&i.push("]"),t.push(i.join("")),i=[]}}return t},xt=Ee,$t=new RegExp("("+C.images.join("|")+"):","i"),jt="(".concat(C.images.join("|"),")"),zt=new RegExp(jt+":(.+?)[\\||\\]]","iu"),Et={thumb:!0,thumbnail:!0,border:!0,right:!0,left:!0,center:!0,top:!0,bottom:!0,none:!0,upright:!0,baseline:!0,middle:!0,sub:!0,super:!0},Ot=function(e){var t=e.wiki;yt(t).forEach((function(i){if(!0===$t.test(i)){e.images=e.images||[];var n=function(e){var t=e.match(zt);if(null===t||!t[2])return null;var i="".concat(t[1],":").concat(t[2]||""),n=(i=i.trim()).charAt(0).toUpperCase()+i.substring(1);if(n=n.replace(/ /g,"_")){var a={file:i};e=(e=e.replace(/^\[\[/,"")).replace(/\]\]$/,"");var r=Pe(e),o=r.list||[];return r.alt&&(a.alt=r.alt),(o=o.filter((function(e){return!1===Et.hasOwnProperty(e)})))[o.length-1]&&(a.caption=xt(o[o.length-1])),new z(a,e)}return null}(i);n&&e.images.push(n),t=t.replace(i,"")}})),e.wiki=t},_t={},St=function(e){Object.defineProperty(this,"data",{enumerable:!1,value:e})},Ct={lines:function(){return this.data},links:function(e){var t=[];if(this.lines().forEach((function(e){t=t.concat(e.links())})),"number"==typeof e)return t[e];if("string"==typeof e){e=e.charAt(0).toUpperCase()+e.substring(1);var i=t.find((function(t){return t.page()===e}));return void 0===i?[]:[i]}return t},json:function(e){return e=p(e,_t),this.lines().map((function(t){return t.json(e)}))},text:function(){return function(e,t){return e.map((function(e){return" * "+e.text(t)})).join("\n")}(this.data)}};Object.keys(Ct).forEach((function(e){St.prototype[e]=Ct[e]}));var qt=St,Nt=Ee,At=/^[#\*:;\|]+/,Lt=/^\*+[^:,\|]{4}/,Dt=/^ ?\#[^:,\|]{4}/,It=/[a-z_0-9\]\}]/i,Tt=function(e){return At.test(e)||Lt.test(e)||Dt.test(e)},Pt=function(e,t){for(var i=[],n=t;n0&&(i.push(r),a+=r.length-1)}else n.push(t[a]);e.lists=i.map((function(e){return new qt(e)})),e.wiki=n.join("\n")}},Ft=function(e){var t=e.wiki,i=t.split(Rt);i=(i=i.filter((function(e){return e&&e.trim().length>0}))).map((function(e){var t={wiki:e,lists:[],sentences:[],images:[]};return Ut.list(t),Ut.image(t),Mt(t),new vt(t)})),e.wiki=t,e.paragraphs=i},Kt=function(e,t){var i=Object.keys(e.data).reduce((function(t,i){return e.data[i]&&(t[i]=e.data[i].json()),t}),{});return!0===t.encode&&(i=Q(i)),i},Bt=function(e){return(e=(e=e.toLowerCase()).replace(/[-_]/g," ")).trim()},Wt=function(e){this._type=e.type,Object.defineProperty(this,"data",{enumerable:!1,value:e.data})},Yt={type:function(){return this._type},links:function(e){var t=this,i=[];if(Object.keys(this.data).forEach((function(e){t.data[e].links().forEach((function(e){return i.push(e)}))})),"number"==typeof e)return i[e];if("string"==typeof e){e=e.charAt(0).toUpperCase()+e.substring(1);var n=i.find((function(t){return t.page()===e}));return void 0===n?[]:[n]}return i},image:function(){var e=this.get("image")||this.get("image2")||this.get("logo");if(!e)return null;var t=e.json();return t.file=t.text,t.text="",new z(t)},get:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";e=Bt(e);for(var t=Object.keys(this.data),i=0;i0?a++:a=e.indexOf("{",a+1)){var r=e[a];if("{"===r&&(t+=1),t>0){if("}"===r&&0===(t-=1)){n.push(r);var o=n.join("");n=[],/\{\{/.test(o)&&/\}\}/.test(o)&&i.push(o);continue}if(1===t&&"{"!==r&&"}"!==r){t=0,n=[];continue}n.push(r)}}return i},Ht=function(e){var t=null;return(t=/^\{\{[^\n]+\|/.test(e)?(e.match(/^\{\{(.+?)\|/)||[])[1]:-1!==e.indexOf("\n")?(e.match(/^\{\{(.+?)\n/)||[])[1]:(e.match(/^\{\{(.+?)\}\}$/)||[])[1])&&(t=t.replace(/:.*/,""),t=Se(t)),t||null},Vt=/\{\{/,Jt=function(e){return{body:e=e.replace(/#invoke:/,""),name:Ht(e),children:[]}},Qt=function e(t){var i=t.body.substr(2);return i=i.replace(/\}\}$/,""),t.children=Gt(i),t.children=t.children.map(Jt),0===t.children.length||t.children.forEach((function(t){var i=t.body.substr(2);return Vt.test(i)?e(t):null})),t},Xt=function(e){var t=Gt(e);return t=(t=t.map(Jt)).map(Qt)},ei=["anchor","defaultsort","use list-defined references","void","pp","pp-move-indef","pp-semi-indef","pp-vandalism","r","#tag","div col","pope list end","shipwreck list end","starbox end","end box","end","s-end"].reduce((function(e,t){return e[t]=!0,e}),{}),ti=new RegExp("^(subst.)?("+C.infoboxes.join("|")+")[: \n]","i"),ii=/^infobox /i,ni=/ infobox$/i,ai=/$Year in [A-Z]/i,ri={"gnf protein box":!0,"automatic taxobox":!0,"chembox ":!0,editnotice:!0,geobox:!0,hybridbox:!0,ichnobox:!0,infraspeciesbox:!0,mycomorphbox:!0,oobox:!0,"paraphyletic group":!0,speciesbox:!0,subspeciesbox:!0,"starbox short":!0,taxobox:!0,nhlteamseason:!0,"asian games bid":!0,"canadian federal election results":!0,"dc thomson comic strip":!0,"daytona 24 races":!0,edencharacter:!0,"moldova national football team results":!0,samurai:!0,protein:!0,"sheet authority":!0,"order-of-approx":!0,"bacterial labs":!0,"medical resources":!0,ordination:!0,"hockey team coach":!0,"hockey team gm":!0,"pro hockey team":!0,"hockey team player":!0,"hockey team start":!0,mlbbioret:!0},oi=function(e){return!0===ri.hasOwnProperty(e)||(!!ti.test(e)||(!(!ii.test(e)&&!ni.test(e))||!!ai.test(e)))},si=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.template.match(ti),i=e.template;t&&t[0]&&(i=i.replace(t[0],""));var n={template:"infobox",type:i=i.trim(),data:e};return delete n.data.template,delete n.data.list,n},ci=[void 0,"January","February","March","April","May","June","July","August","September","October","November","December"],ui=ci.reduce((function(e,t,i){return 0===i||(e[t.toLowerCase()]=i),e}),{}),li=function(e){return e<10?"0"+e:String(e)},pi=function(e){var t=String(e.year||"");if(void 0!==e.month&&!0===ci.hasOwnProperty(e.month))if(void 0===e.date)t="".concat(ci[e.month]," ").concat(e.year);else{if(t="".concat(ci[e.month]," ").concat(e.date,", ").concat(e.year),void 0!==e.hour&&void 0!==e.minute){var i="".concat(li(e.hour),":").concat(li(e.minute));void 0!==e.second&&(i=i+":"+li(e.second)),t=i+", "+t}e.tz&&(t+=" (".concat(e.tz,")"))}return t},mi=function(e){for(var t={},i=["year","month","date","hour","minute","second"],n=0;n0&&(n.years=a,i-=31536e6*n.years);var r=Math.floor(i/2592e6,10);r>0&&(n.months=r,i-=2592e6*n.months);var o=Math.floor(i/864e5,10);return o>0&&(n.days=o),n},hi=mi,bi=pi,ki=function(e){return{template:"date",data:e}},wi=function(e){var t=(e=_e(e)).split("|"),i=hi(t.slice(1,4)),n=t.slice(4,7);if(0===n.length){var a=new Date;n=[a.getFullYear(),a.getMonth(),a.getDate()]}return{from:i,to:n=hi(n)}},vi={date:function(e,t){var i=Pe(e,["year","month","date","hour","minute","second","timezone"]),n=hi([i.year,i.month,i.date||i.day]);return i.text=bi(n),i.timezone&&("Z"===i.timezone&&(i.timezone="UTC"),i.text+=" (".concat(i.timezone,")")),i.hour&&i.minute&&(i.second?i.text="".concat(i.hour,":").concat(i.minute,":").concat(i.second,", ")+i.text:i.text="".concat(i.hour,":").concat(i.minute,", ")+i.text),i.text&&t.push(ki(i)),i.text},natural_date:function(e,t){var i=Pe(e,["text"]).text||"",n={};if(/^[0-9]{4}$/.test(i))n.year=parseInt(i,10);else{var a=i.replace(/[a-z]+\/[a-z]+/i,"");a=a.replace(/[0-9]+:[0-9]+(am|pm)?/i,"");var r=new Date(a);!1===isNaN(r.getTime())&&(n.year=r.getFullYear(),n.month=r.getMonth()+1,n.date=r.getDate())}return t.push(ki(n)),i.trim()},one_year:function(e,t){var i=Pe(e,["year"]),n=Number(i.year);return t.push(ki({year:n})),String(n)},two_dates:function(e,t){var i=Pe(e,["b","birth_year","birth_month","birth_date","death_year","death_month","death_date"]);if(i.b&&"b"===i.b.toLowerCase()){var n=hi([i.birth_year,i.birth_month,i.birth_date]);return t.push(ki(n)),bi(n)}var a=hi([i.death_year,i.death_month,i.death_date]);return t.push(ki(a)),bi(a)},age:function(e){var t=wi(e);return gi(t.from,t.to).years||0},"diff-y":function(e){var t=wi(e),i=gi(t.from,t.to);return 1===i.years?i.years+" year":(i.years||0)+" years"},"diff-ym":function(e){var t=wi(e),i=gi(t.from,t.to),n=[];return 1===i.years?n.push(i.years+" year"):i.years&&0!==i.years&&n.push(i.years+" years"),1===i.months?n.push("1 month"):i.months&&0!==i.months&&n.push(i.months+" months"),n.join(", ")},"diff-ymd":function(e){var t=wi(e),i=gi(t.from,t.to),n=[];return 1===i.years?n.push(i.years+" year"):i.years&&0!==i.years&&n.push(i.years+" years"),1===i.months?n.push("1 month"):i.months&&0!==i.months&&n.push(i.months+" months"),1===i.days?n.push("1 day"):i.days&&0!==i.days&&n.push(i.days+" days"),n.join(", ")},"diff-yd":function(e){var t=wi(e),i=gi(t.from,t.to),n=[];return 1===i.years?n.push(i.years+" year"):i.years&&0!==i.years&&n.push(i.years+" years"),i.days+=30*(i.months||0),1===i.days?n.push("1 day"):i.days&&0!==i.days&&n.push(i.days+" days"),n.join(", ")},"diff-d":function(e){var t=wi(e),i=gi(t.from,t.to),n=[];return i.days+=365*(i.years||0),i.days+=30*(i.months||0),1===i.days?n.push("1 day"):i.days&&0!==i.days&&n.push(i.days+" days"),n.join(", ")}},yi=function(e){var t=new Date(e);if(isNaN(t.getTime()))return"";var i=(new Date).getTime()-t.getTime(),n="ago";i<0&&(n="from now",i=Math.abs(i));var a=i/1e3/60/60/24;return a<365?parseInt(a,10)+" days "+n:parseInt(a/365,10)+" years "+n},xi=vi.date,$i=vi.natural_date,ji=["January","February","March","April","May","June","July","August","September","October","November","December"],zi=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Ei=Object.assign({},di,{currentday:function(){var e=new Date;return String(e.getDate())},currentdayname:function(){var e=new Date;return zi[e.getDay()]},currentmonth:function(){var e=new Date;return ji[e.getMonth()]},currentyear:function(){var e=new Date;return String(e.getFullYear())},monthyear:function(){var e=new Date;return ji[e.getMonth()]+" "+e.getFullYear()},"monthyear-1":function(){var e=new Date;return e.setMonth(e.getMonth()-1),ji[e.getMonth()]+" "+e.getFullYear()},"monthyear+1":function(){var e=new Date;return e.setMonth(e.getMonth()+1),ji[e.getMonth()]+" "+e.getFullYear()},date:0,"time ago":function(e){var t=Pe(e,["date","fmt"]).date;return yi(t)},"birth date and age":function(e,t){var i=Pe(e,["year","month","day"]);return i.year&&/[a-z]/i.test(i.year)?$i(e,t):(t.push(i),i=mi([i.year,i.month,i.day]),pi(i))},"birth year and age":function(e,t){var i=Pe(e,["birth_year","birth_month"]);if(i.death_year&&/[a-z]/i.test(i.death_year))return $i(e,t);t.push(i);var n=(new Date).getFullYear()-parseInt(i.birth_year,10);i=mi([i.birth_year,i.birth_month]);var a=pi(i);return n&&(a+=" (age ".concat(n,")")),a},"death year and age":function(e,t){var i=Pe(e,["death_year","birth_year","death_month"]);return i.death_year&&/[a-z]/i.test(i.death_year)?$i(e,t):(t.push(i),i=mi([i.death_year,i.death_month]),pi(i))},"birth date and age2":function(e,t){var i=Pe(e,["at_year","at_month","at_day","birth_year","birth_month","birth_day"]);return t.push(i),i=mi([i.birth_year,i.birth_month,i.birth_day]),pi(i)},"birth based on age as of date":function(e,t){var i=Pe(e,["age","year","month","day"]);t.push(i);var n=parseInt(i.age,10),a=parseInt(i.year,10)-n;return a&&n?"".concat(a," (age ").concat(i.age,")"):"(age ".concat(i.age,")")},"death date and given age":function(e,t){var i=Pe(e,["year","month","day","age"]);t.push(i),i=mi([i.year,i.month,i.day]);var n=pi(i);return i.age&&(n+=" (age ".concat(i.age,")")),n},dts:function(e){e=(e=e.replace(/\|format=[ymd]+/i,"")).replace(/\|abbr=(on|off)/i,"");var t=Pe(e,["year","month","date","bc"]);return t.date&&t.month&&t.year?!0===/[a-z]/.test(t.month)?[t.month,t.date,t.year].join(" "):[t.year,t.month,t.date].join("-"):t.month&&t.year?[t.year,t.month].join("-"):t.year?(t.year<0&&(t.year=Math.abs(t.year)+" BC"),t.year):""},start:xi,end:xi,birth:xi,death:xi,"start date":xi,"end date":xi,"birth date":xi,"death date":xi,"start date and age":xi,"end date and age":xi,"start-date":$i,"end-date":$i,"birth-date":$i,"death-date":$i,"birth-date and age":$i,"birth-date and given age":$i,"death-date and age":$i,"death-date and given age":$i,birthdeathage:vi.two_dates,dob:xi,age:vi.age,"age nts":vi.age,"age in years":vi["diff-y"],"age in years and months":vi["diff-ym"],"age in years, months and days":vi["diff-ymd"],"age in years and days":vi["diff-yd"],"age in days":vi["diff-d"]});Ei.localday=Ei.currentday,Ei.localdayname=Ei.currentdayname,Ei.localmonth=Ei.currentmonth,Ei.localyear=Ei.currentyear,Ei.currentmonthname=Ei.currentmonth,Ei.currentmonthabbrev=Ei.currentmonth,Ei["death date and age"]=Ei["birth date and age"],Ei.bda=Ei["birth date and age"],Ei["birth date based on age at death"]=Ei["birth based on age as of date"];var Oi=Ei,_i={tag:function(e){var t=Pe(e,["tag","open"]);return t.open&&"pair"!==t.open?"":{span:!0,div:!0,p:!0}[t.tag]?t.content||"":"<".concat(t.tag," ").concat(t.attribs||"",">").concat(t.content||"","")},plural:function(e){e=e.replace(/plural:/,"plural|");var t=Pe(e,["num","word"]),i=Number(t.num),n=t.word;return 1!==i&&(/.y$/.test(n)?n=n.replace(/y$/,"ies"):n+="s"),i+" "+n},"first word":function(e){var t=Pe(e,["text"]),i=t.text;return t.sep?i.split(t.sep)[0]:i.split(" ")[0]},trunc:function(e){var t=Pe(e,["str","len"]);return t.str.substr(0,t.len)},"str mid":function(e){var t=Pe(e,["str","start","end"]),i=parseInt(t.start,10)-1,n=parseInt(t.end,10);return t.str.substr(i,n)},p1:0,p2:1,p3:2,braces:function(e){var t=Pe(e,["text"]),i="";return t.list&&(i="|"+t.list.join("|")),"{{"+(t.text||"")+i+"}}"},nobold:0,noitalic:0,nocaps:0,syntaxhighlight:function(e,t){var i=Pe(e);return t.push(i),i.code||""},samp:function(e,t){var i=Pe(e,["1"]);return t.push(i),i[1]||""},vanchor:0,resize:1,ra:function(e){var t=Pe(e,["hours","minutes","seconds"]);return[t.hours||0,t.minutes||0,t.seconds||0].join(":")},deg2hms:function(e){return(Pe(e,["degrees"]).degrees||"")+"°"},hms2deg:function(e){var t=Pe(e,["hours","minutes","seconds"]);return[t.hours||0,t.minutes||0,t.seconds||0].join(":")},decdeg:function(e){var t=Pe(e,["deg","min","sec","hem","rnd"]);return(t.deg||t.degrees)+"°"},rnd:0,dec:function(e){var t=Pe(e,["degrees","minutes","seconds"]),i=(t.degrees||0)+"°";return t.minutes&&(i+=t.minutes+"′"),t.seconds&&(i+=t.seconds+"″"),i},val:function(e){var t=Pe(e,["number","uncertainty"]),i=t.number;i&&Number(i)&&(i=Number(i).toLocaleString());var n=i||"";return t.p&&(n=t.p+n),t.s&&(n=t.s+n),(t.u||t.ul||t.upl)&&(n=n+" "+(t.u||t.ul||t.upl)),n}};_i.rndfrac=_i.rnd,_i.rndnear=_i.rnd,_i["unité"]=_i.val;["nowrap","nobr","big","cquote","pull quote","small","smaller","midsize","larger","big","kbd","bigger","large","mono","strongbad","stronggood","huge","xt","xt2","!xt","xtn","xtd","dc","dcr","mxt","!mxt","mxtn","mxtd","bxt","!bxt","bxtn","bxtd","delink","pre","var","mvar","pre2","code"].forEach((function(e){_i[e]=function(e){return Pe(e,["text"]).text||""}}));var Si=_i,Ci={plainlist:function(e){var t=(e=_e(e)).split("|");return e=(t=t.slice(1)).join("|"),(t=(t=e.split(/\n ?\* ?/)).filter((function(e){return e}))).join("\n\n")},"collapsible list":function(e,t){var i=Pe(e);t.push(i);var n="";if(i.title&&(n+="'''".concat(i.title,"'''")+"\n\n"),!i.list){i.list=[];for(var a=1;a<10;a+=1)i[a]&&(i.list.push(i[a]),delete i[a])}return i.list=i.list.filter((function(e){return e})),n+=i.list.join("\n\n")},"ordered list":function(e,t){var i=Pe(e);return t.push(i),i.list=i.list||[],i.list.map((function(e,t){return"".concat(t+1,". ").concat(e)})).join("\n\n")},hlist:function(e){var t=Pe(e);return t.list=t.list||[],t.list.join(" · ")},pagelist:function(e){return(Pe(e).list||[]).join(", ")},catlist:function(e){return(Pe(e).list||[]).join(", ")},"br separated entries":function(e){return(Pe(e).list||[]).join("\n\n")},"comma separated entries":function(e){return(Pe(e).list||[]).join(", ")},"anchored list":function(e){var t=Pe(e).list||[];return(t=t.map((function(e,t){return"".concat(t+1,". ").concat(e)}))).join("\n\n")},"bulleted list":function(e){var t=Pe(e).list||[];return(t=(t=t.filter((function(e){return e}))).map((function(e){return"• "+e}))).join("\n\n")},"columns-list":function(e,t){var i=((Pe(e).list||[])[0]||"").split(/\n/);return i=(i=i.filter((function(e){return e}))).map((function(e){return e.replace(/\*/,"")})),t.push({template:"columns-list",list:i}),(i=i.map((function(e){return"• "+e}))).join("\n\n")}};Ci.flatlist=Ci.plainlist,Ci.ublist=Ci.plainlist,Ci["unbulleted list"]=Ci["collapsible list"],Ci.ubl=Ci["collapsible list"],Ci["bare anchored list"]=Ci["anchored list"],Ci["plain list"]=Ci.plainlist,Ci.cmn=Ci["columns-list"],Ci.collist=Ci["columns-list"],Ci["col-list"]=Ci["columns-list"],Ci.columnslist=Ci["columns-list"];var qi=Ci,Ni={convert:function(e){var t=Pe(e,["num","two","three","four"]);return"-"===t.two||"to"===t.two||"and"===t.two?t.four?"".concat(t.num," ").concat(t.two," ").concat(t.three," ").concat(t.four):"".concat(t.num," ").concat(t.two," ").concat(t.three):"".concat(t.num," ").concat(t.two)},term:function(e){var t=Pe(e,["term"]);return"".concat(t.term,":")},defn:0,lino:0,linum:function(e){var t=Pe(e,["num","text"]);return"".concat(t.num,". ").concat(t.text)},ill:function(e){return Pe(e,["text","lan1","text1","lan2","text2"]).text},frac:function(e){var t=Pe(e,["a","b","c"]);return t.c?"".concat(t.a," ").concat(t.b,"/").concat(t.c):t.b?"".concat(t.a,"/").concat(t.b):"1/".concat(t.b)},height:function(e,t){var i=Pe(e);t.push(i);var n=[];return["m","cm","ft","in"].forEach((function(e){!0===i.hasOwnProperty(e)&&n.push(i[e]+e)})),n.join(" ")},"block indent":function(e){var t=Pe(e);return t[1]?"\n"+t[1]+"\n":""},quote:function(e,t){var i=Pe(e,["text","author"]);if(t.push(i),i.text){var n='"'.concat(i.text,'"');return i.author&&(n+="\n\n",n+=" - ".concat(i.author)),n+"\n"}return""},lbs:function(e){var t=Pe(e,["text"]);return"[[".concat(t.text," Lifeboat Station|").concat(t.text,"]]")},lbc:function(e){var t=Pe(e,["text"]);return"[[".concat(t.text,"-class lifeboat|").concat(t.text,"-class]]")},lbb:function(e){var t=Pe(e,["text"]);return"[[".concat(t.text,"-class lifeboat|").concat(t.text,"]]")},own:function(e){var t=Pe(e,["author"]),i="Own work";return t.author&&(i+=" by "+t.author),i},sic:function(e,t){var i=Pe(e,["one","two","three"]),n=(i.one||"")+(i.two||"");return"?"===i.one&&(n=(i.two||"")+(i.three||"")),t.push({template:"sic",word:n}),"y"===i.nolink?n:"".concat(n," [sic]")},formatnum:function(e){e=e.replace(/:/,"|");var t=Pe(e,["number"]).number||"";return t=t.replace(/,/g,""),Number(t).toLocaleString()||""},"#dateformat":function(e){return e=e.replace(/:/,"|"),Pe(e,["date","format"]).date},lc:function(e){return e=e.replace(/:/,"|"),(Pe(e,["text"]).text||"").toLowerCase()},lcfirst:function(e){e=e.replace(/:/,"|");var t=Pe(e,["text"]).text;return t?t[0].toLowerCase()+t.substr(1):""},uc:function(e){return e=e.replace(/:/,"|"),(Pe(e,["text"]).text||"").toUpperCase()},ucfirst:function(e){e=e.replace(/:/,"|");var t=Pe(e,["text"]).text;return t?t[0].toUpperCase()+t.substr(1):""},padleft:function(e){e=e.replace(/:/,"|");var t=Pe(e,["text","num"]);return(t.text||"").padStart(t.num,t.str||"0")},padright:function(e){e=e.replace(/:/,"|");var t=Pe(e,["text","num"]);return(t.text||"").padEnd(t.num,t.str||"0")},abbr:function(e){return Pe(e,["abbr","meaning","ipa"]).abbr},abbrlink:function(e){var t=Pe(e,["abbr","page"]);return t.page?"[[".concat(t.page,"|").concat(t.abbr,"]]"):"[[".concat(t.abbr,"]]")},h:1,finedetail:0,sort:1};Ni["str left"]=Ni.trunc,Ni["str crop"]=Ni.trunc,Ni.tooltip=Ni.abbr,Ni.abbrv=Ni.abbr,Ni.define=Ni.abbr,Ni.cvt=Ni.convert;var Ai=Ni,Li=Object.assign({},Si,qi,Ai);var Di=function(e){var t=e.pop(),i=Number(e[0]||0),n=Number(e[1]||0),a=Number(e[2]||0);if("string"!=typeof t||isNaN(i))return null;var r=1;return/[SW]/i.test(t)&&(r=-1),r*(i+n/60+a/3600)},Ii=function(e){if("number"!=typeof e)return e;return Math.round(1e5*e)/1e5},Ti={s:!0,w:!0},Pi=function(e){var i=Pe(e);i=function(e){return e.list=e.list||[],e.list=e.list.map((function(t){var i=Number(t);if(!isNaN(i))return i;var n=t.split(/:/);return n.length>1?(e.props=e.props||{},e.props[n[0]]=n.slice(1).join(":"),null):t})),e.list=e.list.filter((function(e){return null!==e})),e}(i);var n,a,r=(n=i.list,a=n.map((function(e){return t(e)})).join("|"),2===n.length&&"number|number"===a?{lat:n[0],lon:n[1]}:4===n.length&&"number|string|number|string"===a?(Ti[n[1].toLowerCase()]&&(n[0]*=-1),"w"===n[3].toLowerCase()&&(n[2]*=-1),{lat:n[0],lon:n[2]}):6===n.length?{lat:Di(n.slice(0,3)),lon:Di(n.slice(3))}:8===n.length?{lat:Di(n.slice(0,4)),lon:Di(n.slice(4))}:{});return i.lat=Ii(r.lat),i.lon=Ii(r.lon),i.template="coord",delete i.list,i},Mi={coord:function(e,t){var i=Pi(e);return t.push(i),i.display&&-1===i.display.indexOf("inline")?"":"".concat(i.lat||"","°N, ").concat(i.lon||"","°W")},geo:["lat","lon","zoom"]};Mi.coor=Mi.coord,Mi["coor title dms"]=Mi.coord,Mi["coor title dec"]=Mi.coord,Mi["coor dms"]=Mi.coord,Mi["coor dm"]=Mi.coord,Mi["coor dec"]=Mi.coord;var Ri=Mi,Ui={etyl:1,mention:1,link:1,"la-verb-form":0,"la-ipa":0,sortname:function(e){var t=Pe(e,["first","last","target","sort"]),i="".concat(t.first||""," ").concat(t.last||"");return i=i.trim(),t.nolink?t.target||i:(t.dab&&(i+=" (".concat(t.dab,")"),t.target&&(t.target+=" (".concat(t.dab,")"))),t.target?"[[".concat(t.target,"|").concat(i,"]]"):"[[".concat(i,"]]"))}};["lts","t","tfd links","tiw","tltt","tetl","tsetl","ti","tic","tiw","tlt","ttl","twlh","tl2","tlu","demo","hatnote","xpd","para","elc","xtag","mli","mlix","#invoke","url"].forEach((function(e){Ui[e]=function(e){var t=Pe(e,["first","second"]);return t.second||t.first}})),Ui.m=Ui.mention,Ui["m-self"]=Ui.mention,Ui.l=Ui.link,Ui.ll=Ui.link,Ui["l-self"]=Ui.link;var Fi=Ui,Ki={wikt:"wiktionary",commons:"commons",c:"commons",commonscat:"commonscat",n:"wikinews",q:"wikiquote",s:"wikisource",a:"wikiauthor",b:"wikibooks",voy:"wikivoyage",v:"wikiversity",d:"wikidata",species:"wikispecies",m:"meta",mw:"mediawiki"},Bi={about:function(e,t){var i=Pe(e);return t.push(i),""},main:function(e,t){var i=Pe(e);return t.push(i),""},"main list":function(e,t){var i=Pe(e);return t.push(i),""},see:function(e,t){var i=Pe(e);return t.push(i),""},for:function(e,t){var i=Pe(e);return t.push(i),""},further:function(e,t){var i=Pe(e);return t.push(i),""},"further information":function(e,t){var i=Pe(e);return t.push(i),""},listen:function(e,t){var i=Pe(e);return t.push(i),""},"wide image":["file","width","caption"],redirect:function(e,t){for(var i=Pe(e,["redirect"]),n=i.list||[],a=[],r=0;r0&&t.push(a)}return{template:"playoffbracket",rounds:t}}(e);return t.push(i),""}};["2teambracket","4team2elimbracket","8teambracket","16teambracket","32teambracket","cwsbracket","nhlbracket","nhlbracket-reseed","4teambracket-nhl","4teambracket-ncaa","4teambracket-mma","4teambracket-mlb","8teambracket-nhl","8teambracket-mlb","8teambracket-ncaa","8teambracket-afc","8teambracket-afl","8teambracket-tennis3","8teambracket-tennis5","16teambracket-nhl","16teambracket-nhl divisional","16teambracket-nhl-reseed","16teambracket-nba","16teambracket-swtc","16teambracket-afc","16teambracket-tennis3","16teambracket-tennis5"].forEach((function(e){Qi[e]=Qi["4teambracket"]}));var Xi=Qi,en={"£":"GB£","¥":"¥","৳":"৳","₩":"₩","€":"€","₱":"₱","₹":"₹","₽":"₽","cn¥":"CN¥","gb£":"GB£","india rs":"₹","indian rupee symbol":"₹","indian rupee":"₹","indian rupees":"₹","philippine peso":"₱","russian ruble":"₽","SK won":"₩","turkish lira":"TRY",a$:"A$",au$:"A$",aud:"A$",bdt:"BDT",brl:"BRL",ca$:"CA$",cad:"CA$",chf:"CHF",cny:"CN¥",czk:"czk",dkk:"dkk",dkk2:"dkk",euro:"€",gbp:"GB£",hk$:"HK$",hkd:"HK$",ils:"ILS",inr:"₹",jpy:"¥",myr:"MYR",nis:"ILS",nok:"NOK",nok2:"NOK",nz$:"NZ$",nzd:"NZ$",peso:"peso",pkr:"₨",r$:"BRL",rmb:"CN¥",rub:"₽",ruble:"₽",rupee:"₹",s$:"sgd",sek:"SEK",sek2:"SEK",sfr:"CHF",sgd:"sgd",shekel:"ILS",sheqel:"ILS",ttd:"TTD",us$:"US$",usd:"US$",yen:"¥",zar:"R"},tn=function(e,t){var i=Pe(e,["amount","code"]);t.push(i);var n=i.template||"";switch("currency"===n?(n=i.code)||(i.code=n="usd"):""!==n&&"monnaie"!==n&&"unité"!==n&&"nombre"!==n&&"nb"!==n||(n=i.code),n=(n||"").toLowerCase()){case"us":i.code=n="usd";break;case"uk":i.code=n="gbp"}var a="".concat(en[n]||"").concat(i.amount||"");return i.code&&!en[i.code.toLowerCase()]&&(a+=" "+i.code),a},nn={currency:tn,monnaie:tn,"unité":tn,nombre:tn,nb:tn,iso4217:tn,inrconvert:function(e,t){var i=Pe(e,["rupee_value","currency_formatting"]);t.push(i);var n=i.currency_formatting;if(n){var a=1;switch(n){case"k":a=1e3;break;case"m":a=1e6;break;case"b":a=1e9;break;case"t":a=1e12;break;case"l":a=1e5;break;case"c":a=1e7;break;case"lc":a=1e12}i.rupee_value=i.rupee_value*a}return"inr ".concat(i.rupee_value||"")}};Object.keys(en).forEach((function(e){nn[e]=tn}));var an=nn,rn={"election box begin":function(e,t){var i=Pe(e);return t.push(i),""},"election box candidate":function(e,t){var i=Pe(e);return t.push(i),""},"election box hold with party link":function(e,t){var i=Pe(e);return t.push(i),""},"election box gain with party link":function(e,t){var i=Pe(e);return t.push(i),""}};rn["election box begin no change"]=rn["election box begin"],rn["election box begin no party"]=rn["election box begin"],rn["election box begin no party no change"]=rn["election box begin"],rn["election box inline begin"]=rn["election box begin"],rn["election box inline begin no change"]=rn["election box begin"],rn["election box candidate for alliance"]=rn["election box candidate"],rn["election box candidate minor party"]=rn["election box candidate"],rn["election box candidate no party link no change"]=rn["election box candidate"],rn["election box candidate with party link"]=rn["election box candidate"],rn["election box candidate with party link coalition 1918"]=rn["election box candidate"],rn["election box candidate with party link no change"]=rn["election box candidate"],rn["election box inline candidate"]=rn["election box candidate"],rn["election box inline candidate no change"]=rn["election box candidate"],rn["election box inline candidate with party link"]=rn["election box candidate"],rn["election box inline candidate with party link no change"]=rn["election box candidate"],rn["election box inline incumbent"]=rn["election box candidate"];var on=rn,sn=[["🇦🇩","and","andorra"],["🇦🇪","are","united arab emirates"],["🇦🇫","afg","afghanistan"],["🇦🇬","atg","antigua and barbuda"],["🇦🇮","aia","anguilla"],["🇦🇱","alb","albania"],["🇦🇲","arm","armenia"],["🇦🇴","ago","angola"],["🇦🇶","ata","antarctica"],["🇦🇷","arg","argentina"],["🇦🇸","asm","american samoa"],["🇦🇹","aut","austria"],["🇦🇺","aus","australia"],["🇦🇼","abw","aruba"],["🇦🇽","ala","åland islands"],["🇦🇿","aze","azerbaijan"],["🇧🇦","bih","bosnia and herzegovina"],["🇧🇧","brb","barbados"],["🇧🇩","bgd","bangladesh"],["🇧🇪","bel","belgium"],["🇧🇫","bfa","burkina faso"],["🇧🇬","bgr","bulgaria"],["🇧🇬","bul","bulgaria"],["🇧🇭","bhr","bahrain"],["🇧🇮","bdi","burundi"],["🇧🇯","ben","benin"],["🇧🇱","blm","saint barthélemy"],["🇧🇲","bmu","bermuda"],["🇧🇳","brn","brunei darussalam"],["🇧🇴","bol","bolivia"],["🇧🇶","bes","bonaire, sint eustatius and saba"],["🇧🇷","bra","brazil"],["🇧🇸","bhs","bahamas"],["🇧🇹","btn","bhutan"],["🇧🇻","bvt","bouvet island"],["🇧🇼","bwa","botswana"],["🇧🇾","blr","belarus"],["🇧🇿","blz","belize"],["🇨🇦","can","canada"],["🇨🇨","cck","cocos (keeling) islands"],["🇨🇩","cod","congo"],["🇨🇫","caf","central african republic"],["🇨🇬","cog","congo"],["🇨🇭","che","switzerland"],["🇨🇮","civ","côte d'ivoire"],["🇨🇰","cok","cook islands"],["🇨🇱","chl","chile"],["🇨🇲","cmr","cameroon"],["🇨🇳","chn","china"],["🇨🇴","col","colombia"],["🇨🇷","cri","costa rica"],["🇨🇺","cub","cuba"],["🇨🇻","cpv","cape verde"],["🇨🇼","cuw","curaçao"],["🇨🇽","cxr","christmas island"],["🇨🇾","cyp","cyprus"],["🇨🇿","cze","czech republic"],["🇩🇪","deu","germany"],["🇩🇪","ger","germany"],["🇩🇯","dji","djibouti"],["🇩🇰","dnk","denmark"],["🇩🇲","dma","dominica"],["🇩🇴","dom","dominican republic"],["🇩🇿","dza","algeria"],["🇪🇨","ecu","ecuador"],["🇪🇪","est","estonia"],["🇪🇬","egy","egypt"],["🇪🇭","esh","western sahara"],["🇪🇷","eri","eritrea"],["🇪🇸","esp","spain"],["🇪🇹","eth","ethiopia"],["🇫🇮","fin","finland"],["🇫🇯","fji","fiji"],["🇫🇰","flk","falkland islands (malvinas)"],["🇫🇲","fsm","micronesia"],["🇫🇴","fro","faroe islands"],["🇫🇷","fra","france"],["🇬🇦","gab","gabon"],["🇬🇧","gbr","united kingdom"],["🇬🇩","grd","grenada"],["🇬🇫","guf","french guiana"],["🇬🇬","ggy","guernsey"],["🇬🇭","gha","ghana"],["🇬🇮","gib","gibraltar"],["🇬🇱","grl","greenland"],["🇬🇲","gmb","gambia"],["🇬🇳","gin","guinea"],["🇬🇵","glp","guadeloupe"],["🇬🇶","gnq","equatorial guinea"],["🇬🇷","grc","greece"],["🇬🇸","sgs","south georgia"],["🇬🇹","gtm","guatemala"],["🇬🇺","gum","guam"],["🇬🇼","gnb","guinea-bissau"],["🇬🇾","guy","guyana"],["🇭🇰","hkg","hong kong"],["🇭🇲","hmd","heard island and mcdonald islands"],["🇭🇳","hnd","honduras"],["🇭🇷","hrv","croatia"],["🇭🇹","hti","haiti"],["🇭🇺","hun","hungary"],["🇮🇩","idn","indonesia"],["🇮🇪","irl","ireland"],["🇮🇱","isr","israel"],["🇮🇲","imn","isle of man"],["🇮🇳","ind","india"],["🇮🇴","iot","british indian ocean territory"],["🇮🇶","irq","iraq"],["🇮🇷","irn","iran"],["🇮🇸","isl","iceland"],["🇮🇹","ita","italy"],["🇯🇪","jey","jersey"],["🇯🇲","jam","jamaica"],["🇯🇴","jor","jordan"],["🇯🇵","jpn","japan"],["🇰🇪","ken","kenya"],["🇰🇬","kgz","kyrgyzstan"],["🇰🇭","khm","cambodia"],["🇰🇮","kir","kiribati"],["🇰🇲","com","comoros"],["🇰🇳","kna","saint kitts and nevis"],["🇰🇵","prk","north korea"],["🇰🇷","kor","south korea"],["🇰🇼","kwt","kuwait"],["🇰🇾","cym","cayman islands"],["🇰🇿","kaz","kazakhstan"],["🇱🇦","lao","lao people's democratic republic"],["🇱🇧","lbn","lebanon"],["🇱🇨","lca","saint lucia"],["🇱🇮","lie","liechtenstein"],["🇱🇰","lka","sri lanka"],["🇱🇷","lbr","liberia"],["🇱🇸","lso","lesotho"],["🇱🇹","ltu","lithuania"],["🇱🇺","lux","luxembourg"],["🇱🇻","lva","latvia"],["🇱🇾","lby","libya"],["🇲🇦","mar","morocco"],["🇲🇨","mco","monaco"],["🇲🇩","mda","moldova"],["🇲🇪","mne","montenegro"],["🇲🇫","maf","saint martin (french part)"],["🇲🇬","mdg","madagascar"],["🇲🇭","mhl","marshall islands"],["🇲🇰","mkd","macedonia"],["🇲🇱","mli","mali"],["🇲🇲","mmr","myanmar"],["🇲🇳","mng","mongolia"],["🇲🇴","mac","macao"],["🇲🇵","mnp","northern mariana islands"],["🇲🇶","mtq","martinique"],["🇲🇷","mrt","mauritania"],["🇲🇸","msr","montserrat"],["🇲🇹","mlt","malta"],["🇲🇺","mus","mauritius"],["🇲🇻","mdv","maldives"],["🇲🇼","mwi","malawi"],["🇲🇽","mex","mexico"],["🇲🇾","mys","malaysia"],["🇲🇿","moz","mozambique"],["🇳🇦","nam","namibia"],["🇳🇨","ncl","new caledonia"],["🇳🇪","ner","niger"],["🇳🇫","nfk","norfolk island"],["🇳🇬","nga","nigeria"],["🇳🇮","nic","nicaragua"],["🇳🇱","nld","netherlands"],["🇳🇴","nor","norway"],["🇳🇵","npl","nepal"],["🇳🇷","nru","nauru"],["🇳🇺","niu","niue"],["🇳🇿","nzl","new zealand"],["🇴🇲","omn","oman"],["🇵🇦","pan","panama"],["🇵🇪","per","peru"],["🇵🇫","pyf","french polynesia"],["🇵🇬","png","papua new guinea"],["🇵🇭","phl","philippines"],["🇵🇰","pak","pakistan"],["🇵🇱","pol","poland"],["🇵🇲","spm","saint pierre and miquelon"],["🇵🇳","pcn","pitcairn"],["🇵🇷","pri","puerto rico"],["🇵🇸","pse","palestinian territory"],["🇵🇹","prt","portugal"],["🇵🇼","plw","palau"],["🇵🇾","pry","paraguay"],["🇶🇦","qat","qatar"],["🇷🇪","reu","réunion"],["🇷🇴","rou","romania"],["🇷🇸","srb","serbia"],["🇷🇺","rus","russia"],["🇷🇼","rwa","rwanda"],["🇸🇦","sau","saudi arabia"],["🇸🇧","slb","solomon islands"],["🇸🇨","syc","seychelles"],["🇸🇩","sdn","sudan"],["🇸🇪","swe","sweden"],["🇸🇬","sgp","singapore"],["🇸🇭","shn","saint helena, ascension and tristan da cunha"],["🇸🇮","svn","slovenia"],["🇸🇯","sjm","svalbard and jan mayen"],["🇸🇰","svk","slovakia"],["🇸🇱","sle","sierra leone"],["🇸🇲","smr","san marino"],["🇸🇳","sen","senegal"],["🇸🇴","som","somalia"],["🇸🇷","sur","suriname"],["🇸🇸","ssd","south sudan"],["🇸🇹","stp","sao tome and principe"],["🇸🇻","slv","el salvador"],["🇸🇽","sxm","sint maarten (dutch part)"],["🇸🇾","syr","syrian arab republic"],["🇸🇿","swz","swaziland"],["🇹🇨","tca","turks and caicos islands"],["🇹🇩","tcd","chad"],["🇹🇫","atf","french southern territories"],["🇹🇬","tgo","togo"],["🇹🇭","tha","thailand"],["🇹🇯","tjk","tajikistan"],["🇹🇰","tkl","tokelau"],["🇹🇱","tls","timor-leste"],["🇹🇲","tkm","turkmenistan"],["🇹🇳","tun","tunisia"],["🇹🇴","ton","tonga"],["🇹🇷","tur","turkey"],["🇹🇹","tto","trinidad and tobago"],["🇹🇻","tuv","tuvalu"],["🇹🇼","twn","taiwan"],["🇹🇿","tza","tanzania"],["🇺🇦","ukr","ukraine"],["🇺🇬","uga","uganda"],["🇺🇲","umi","united states minor outlying islands"],["🇺🇸","usa","united states"],["🇺🇸","us","united states"],["🇺🇾","ury","uruguay"],["🇺🇿","uzb","uzbekistan"],["🇻🇦","vat","vatican city"],["🇻🇨","vct","saint vincent and the grenadines"],["🇻🇪","ven","venezuela"],["🇻🇬","vgb","virgin islands, british"],["🇻🇮","vir","virgin islands, u.s."],["🇻🇳","vnm","viet nam"],["🇻🇺","vut","vanuatu"],["","win","west indies"],["🇼🇫","wlf","wallis and futuna"],["🇼🇸","wsm","samoa"],["🇾🇪","yem","yemen"],["🇾🇹","myt","mayotte"],["🇿🇦","zaf","south africa"],["🇿🇲","zmb","zambia"],["🇿🇼 ","zwe","zimbabwe"],["🇺🇳","un","united nations"],["🏴󠁧󠁢󠁥󠁮󠁧󠁿󠁧󠁢󠁥󠁮󠁧󠁿","eng","england"],["🏴󠁧󠁢󠁳󠁣󠁴󠁿","sct","scotland"],["🏴󠁧󠁢󠁷󠁬󠁳󠁿","wal","wales"],["🇪🇺","eu","european union"]],cn={flag:function(e){var t=Pe(e,["flag","variant"]),i=t.flag||"";t.flag=(t.flag||"").toLowerCase();var n=sn.find((function(e){return t.flag===e[1]||t.flag===e[2]}))||[],a=n[0]||"";return"".concat(a," [[").concat(n[2],"|").concat(i,"]]")},flagcountry:function(e){var t=Pe(e,["flag","variant"]);t.flag=(t.flag||"").toLowerCase();var i=sn.find((function(e){return t.flag===e[1]||t.flag===e[2]}))||[],n=i[0]||"";return"".concat(n," [[").concat(i[2],"]]")},flagcu:function(e){var t=Pe(e,["flag","variant"]);t.flag=(t.flag||"").toLowerCase();var i=sn.find((function(e){return t.flag===e[1]||t.flag===e[2]}))||[],n=i[0]||"";return"".concat(n," ").concat(i[2])},flagicon:function(e){var t=Pe(e,["flag","variant"]);t.flag=(t.flag||"").toLowerCase();var i=sn.find((function(e){return t.flag===e[1]||t.flag===e[2]}));return i?"[[".concat(i[2],"|").concat(i[0],"]]"):""},flagdeco:function(e){var t=Pe(e,["flag","variant"]);return t.flag=(t.flag||"").toLowerCase(),(sn.find((function(e){return t.flag===e[1]||t.flag===e[2]}))||[])[0]||""},fb:function(e){var t=Pe(e,["flag","variant"]);t.flag=(t.flag||"").toLowerCase();var i=sn.find((function(e){return t.flag===e[1]||t.flag===e[2]}));return i?"".concat(i[0]," [[").concat(i[2]," national football team|").concat(i[2],"]]"):""},fbicon:function(e){var t=Pe(e,["flag","variant"]);t.flag=(t.flag||"").toLowerCase();var i=sn.find((function(e){return t.flag===e[1]||t.flag===e[2]}));return i?" [[".concat(i[2]," national football team|").concat(i[0],"]]"):""},flagathlete:function(e){var t=Pe(e,["name","flag","variant"]);t.flag=(t.flag||"").toLowerCase();var i=sn.find((function(e){return t.flag===e[1]||t.flag===e[2]}));return i?"".concat(i[0]," [[").concat(t.name||"","]] (").concat(i[1].toUpperCase(),")"):"[[".concat(t.name||"","]]")}};sn.forEach((function(e){cn[e[1]]=function(){return e[0]}})),cn.cr=cn.flagcountry,cn["cr-rt"]=cn.flagcountry,cn.cricon=cn.flagicon;var un=cn,ln=function(e){var t=e.match(/ipac?-(.+)/);return null!==t?!0===q.hasOwnProperty(t[1])?q[t[1]].english_title:t[1]:null},pn={ipa:function(e,t){var i=Pe(e,["transcription","lang","audio"]);return i.lang=ln(i.template),i.template="ipa",t.push(i),""},ipac:function(e,t){var i=Pe(e);return i.transcription=(i.list||[]).join(","),delete i.list,i.lang=ln(i.template),i.template="ipac",t.push(i),""},transl:function(e,t){var i=Pe(e,["lang","text","text2"]);return i.text2&&(i.iso=i.text,i.text=i.text2,delete i.text2),t.push(i),i.text||""}};Object.keys(q).forEach((function(e){pn["ipa-"+e]=pn.ipa,pn["ipac-"+e]=pn.ipac}));var mn=pn,dn={lang:1,"lang-de":0,"rtl-lang":1,taste:0,nihongo:function(e,t){var i=Pe(e,["english","kanji","romaji","extra"]);t.push(i);var n=i.english||i.romaji||"";return i.kanji&&(n+=" (".concat(i.kanji,")")),n}};Object.keys(q).forEach((function(e){dn["lang-"+e]=dn["lang-de"]})),dn.nihongo2=dn.nihongo,dn.nihongo3=dn.nihongo,dn["nihongo-s"]=dn.nihongo,dn["nihongo foot"]=dn.nihongo;var fn=dn,gn=function(e){if(!e.numerator&&!e.denominator)return null;var t=Number(e.numerator)/Number(e.denominator);t*=100;var i=Number(e.decimals);return isNaN(i)&&(i=1),t=t.toFixed(i),Number(t)},hn={math:function(e,t){var i=Pe(e,["formula"]);return t.push(i),"\n\n"+(i.formula||"")+"\n\n"},frac:function(e,t){var i=Pe(e,["a","b","c"]),n={template:"sfrac"};return i.c?(n.integer=i.a,n.numerator=i.b,n.denominator=i.c):i.b?(n.numerator=i.a,n.denominator=i.b):(n.numerator=1,n.denominator=i.a),t.push(n),n.integer?"".concat(n.integer," ").concat(n.numerator,"⁄").concat(n.denominator):"".concat(n.numerator,"⁄").concat(n.denominator)},radic:function(e){var t=Pe(e,["after","before"]);return"".concat(t.before||"","√").concat(t.after||"")},percentage:function(e){var t=Pe(e,["numerator","denominator","decimals"]),i=gn(t);return null===i?"":i+"%"},"percent-done":function(e){var t=Pe(e,["done","total","digits"]),i=gn({numerator:t.done,denominator:t.total,decimals:t.digits});return null===i?"":"".concat(t.done," (").concat(i,"%) done")},"winning percentage":function(e,t){var i=Pe(e,["wins","losses","ties"]);t.push(i);var n=Number(i.wins),a=Number(i.losses),r=Number(i.ties)||0,o=n+a+r;"y"===i.ignore_ties&&(r=0),r&&(n+=r/2);var s=gn({numerator:n,denominator:o,decimals:1});return null===s?"":".".concat(10*s)},winlosspct:function(e,t){var i=Pe(e,["wins","losses"]);t.push(i);var n=Number(i.wins),a=Number(i.losses),r=gn({numerator:n,denominator:n+a,decimals:1});return null===r?"":(r=".".concat(10*r),"".concat(n||0," || ").concat(a||0," || ").concat(r||"-"))}};hn.sfrac=hn.frac,hn.sqrt=hn.radic,hn.pct=hn.percentage,hn.percent=hn.percentage,hn.winpct=hn["winning percentage"],hn.winperc=hn["winning percentage"];var bn=hn,kn=function(e,t,i){var n=Pe(e);return i&&(n.name=n.template,n.template=i),t.push(n),""},wn={persondata:kn,taxobox:kn,citation:kn,portal:kn,reflist:kn,"cite book":kn,"cite journal":kn,"cite web":kn,"commons cat":kn,"portuguese name":["first","second","suffix"],uss:["ship","id"],isbn:function(e,t){var i=Pe(e,["id","id2","id3"]);return t.push(i),"ISBN: "+(i.id||"")},marriage:function(e,t){var i=Pe(e,["spouse","from","to","end"]);t.push(i);var n="".concat(i.spouse||"");return i.from&&(i.to?n+=" (m. ".concat(i.from,"-").concat(i.to,")"):n+=" (m. ".concat(i.from,")")),n},"based on":function(e,t){var i=Pe(e,["title","author"]);return t.push(i),"".concat(i.title," by ").concat(i.author||"")},"video game release":function(e,t){for(var i=["region","date","region2","date2","region3","date3","region4","date4"],n=Pe(e,i),a={template:"video game release",releases:[]},r=0;r0&&t.push(c),""},Zn=function(e){Object.defineProperty(this,"data",{enumerable:!1,value:e})},Gn={text:function(){return""},json:function(){return this.data}};Object.keys(Gn).forEach((function(e){Zn.prototype[e]=Gn[e]}));var Hn=Zn,Vn=new RegExp("^(cite |citation)","i"),Jn={citation:!0,refn:!0,harvnb:!0},Qn=function(e){return"infobox"===e.template&&e.data&&function(e){return e&&"[object Object]"===Object.prototype.toString.call(e)}(e.data)},Xn=function(e){var t=e.wiki,i=Xt(t),n=[];i.forEach((function(e){return function e(i,a){i.parent=a,i.children&&i.children.length>0&&i.children.forEach((function(t){return e(t,i)})),i.out=Yn(i,n);!function e(t,i,n){t.parent&&(t.parent.body=t.parent.body.replace(i,n),e(t.parent,i,n))}(i,i.body,i.out),t=t.replace(i.body,i.out)}(e,null)})),e.infoboxes=e.infoboxes||[],e.references=e.references||[],e.templates=e.templates||[],e.templates=e.templates.concat(n),e.templates=e.templates.filter((function(t){return!0===function(e){return!0===Jn[e.template]||!0===Vn.test(e.template)}(t)?(e.references.push(new Ue(t)),!1):!0!==Qn(t)||(e.infoboxes.push(new Zt(t)),!1)})),e.templates=e.templates.map((function(e){return new Hn(e)})),i.forEach((function(e){t=t.replace(e.body,e.out)})),e.wiki=t},ea=Ee,ta=function(e){var t=e.wiki;t=t.replace(/]*?)>([\s\S]+?)<\/gallery>/g,(function(t,i,n){var a=n.split(/\n/g);return(a=(a=a.filter((function(e){return e&&""!==e.trim()}))).map((function(e){var t=e.split(/\|/),i={file:t[0].trim()},n=new z(i).json(),a=t.slice(1).join("|");return""!==a&&(n.caption=ea(a)),n}))).length>0&&e.templates.push({template:"gallery",images:a,pos:e.title}),""})),e.wiki=t},ia=function(e){var t=e.wiki;t=t.replace(/\{\{election box begin([\s\S]+?)\{\{election box end\}\}/gi,(function(t){var i={wiki:t,templates:[]};Xn(i);var n=i.templates.map((function(e){return e.json()})),a=n.find((function(e){return"election box"===e.template}))||{},r=n.filter((function(e){return"election box candidate"===e.template})),o=n.find((function(e){return"election box gain"===e.template||"election box hold"===e.template}))||{};return(r.length>0||o)&&e.templates.push({template:"election box",title:a.title,candidates:r,summary:o.data}),""})),e.wiki=t},na={coach:["team","year","g","w","l","w-l%","finish","pg","pw","pl","pw-l%"],player:["year","team","gp","gs","mpg","fg%","3p%","ft%","rpg","apg","spg","bpg","ppg"],roster:["player","gp","gs","mpg","fg%","3fg%","ft%","rpg","apg","spg","bpg","ppg"]},aa=function(e){var t=e.wiki;t=t.replace(/\{\{nba (coach|player|roster) statistics start([\s\S]+?)\{\{s-end\}\}/gi,(function(t,i){t=(t=t.replace(/^\{\{.*?\}\}/,"")).replace(/\{\{s-end\}\}/,""),i=i.toLowerCase().trim();var n="! "+na[i].join(" !! "),a=ot("{|\n"+n+"\n"+t+"\n|}");return a=a.map((function(e){return Object.keys(e).forEach((function(t){e[t]=e[t].text()})),e})),e.templates.push({template:"NBA "+i+" statistics",data:a}),""})),e.wiki=t},ra=function(e){var t=e.wiki;t=t.replace(/\{\{mlb game log (section|month)[\s\S]+?\{\{mlb game log (section|month) end\}\}/gi,(function(t){var i=function(e){var t=["#","date","opponent","score","win","loss","save","attendance","record"];return!0===/\|stadium=y/i.test(e)&&t.splice(7,0,"stadium"),!0===/\|time=y/i.test(e)&&t.splice(7,0,"time"),!0===/\|box=y/i.test(e)&&t.push("box"),t}(t);t=(t=t.replace(/^\{\{.*?\}\}/,"")).replace(/\{\{mlb game log (section|month) end\}\}/i,"");var n="! "+i.join(" !! "),a=ot("{|\n"+n+"\n"+t+"\n|}");return a=a.map((function(e){return Object.keys(e).forEach((function(t){e[t]=e[t].text()})),e})),e.templates.push({template:"mlb game log section",data:a}),""})),e.wiki=t},oa=["res","record","opponent","method","event","date","round","time","location","notes"],sa=function(e){var t=e.wiki;t=t.replace(/\{\{mma record start[\s\S]+?\{\{end\}\}/gi,(function(t){t=(t=t.replace(/^\{\{.*?\}\}/,"")).replace(/\{\{end\}\}/i,"");var i="! "+oa.join(" !! "),n=ot("{|\n"+i+"\n"+t+"\n|}");return n=n.map((function(e){return Object.keys(e).forEach((function(t){e[t]=e[t].text()})),e})),e.templates.push({template:"mma record start",data:n}),""})),e.wiki=t},ca=Ee,ua=function(e){var t=e.wiki;t=(t=t.replace(/]*?)>([\s\S]+?)<\/math>/g,(function(t,i,n){var a=ca(n).text();return e.templates.push({template:"math",formula:a,raw:n}),a&&a.length<12?a:""}))).replace(/]*?)>([\s\S]+?)<\/chem>/g,(function(t,i,n){return e.templates.push({template:"chem",data:n}),""})),e.wiki=t},la=function(e){ia(e),ta(e),ua(e),ra(e),sa(e),aa(e)},pa=new RegExp("^("+C.references.join("|")+"):?","i"),ma=/(?:\n|^)(={2,5}.{1,200}?={2,5})/g,da={heading:He,table:ft,paragraphs:Ft,templates:Xn,references:Ye,startEndTemplates:la},fa=function(e,t){return da.startEndTemplates(e),da.references(e),da.templates(e),da.table(e),da.paragraphs(e,t),e=new ae(e)},ga=function(e){for(var t=[],i=e.wiki.split(ma),n=0;n0||(t.templates().length>0||(e[i+1]&&e[i+1].depth>t.depth&&(e[i+1].depth-=1),!1)))}))}(t)},ha=new RegExp("\\[\\[:?("+C.categories.join("|")+"):(.{2,178}?)]](w{0,10})","ig"),ba=new RegExp("^\\[\\[:?("+C.categories.join("|")+"):","ig"),ka={section:ga,categories:function(e){var t=e.wiki,i=t.match(ha);i&&i.forEach((function(t){(t=(t=(t=t.replace(ba,"")).replace(/\|?[ \*]?\]\]$/i,"")).replace(/\|.*/,""))&&!t.match(/[\[\]]/)&&e.categories.push(t.trim())})),t=t.replace(ha,""),e.wiki=t}},wa=function(e,t){t=t||{};var i=Object.assign(t,{title:t.title||null,pageID:t.pageID||t.id||null,namespace:t.namespace||t.ns||null,type:"page",wiki:e||"",categories:[],sections:[],coordinates:[]});return!0===F(e)?(i.type="redirect",i.redirectTo=K(e),ka.categories(i),new S(i)):(H(i),ka.categories(i),ka.section(i),new S(i))},va=function(e){var t=(e=e.filter((function(e){return e}))).map((function(e){return wa(e.wiki,e.meta)}));return 0===t.length?null:1===t.length?t[0]:t},ya=function(e,t){return fetch(e,t).then((function(e){return e.json()}))},xa=function(e){var t=e.userAgent||e["User-Agent"]||e["Api-User-Agent"]||"User of the wtf_wikipedia library";return{method:"GET",headers:{"Content-Type":"application/json","Api-User-Agent":t,"User-Agent":t,Origin:"*"},redirect:"follow"}},$a=/^https?:\/\//,ja={lang:"en",wiki:"wikipedia",domain:null,follow_redirects:!0,path:"api.php"},za=function(t,i,n){var a=null;"function"==typeof i&&(a=i,i={}),"function"==typeof n&&(a=n,n={}),"string"==typeof i&&(n=n||{},i=Object.assign({},{lang:i},n)),i=i||{},(i=Object.assign({},ja,i)).title=t,$a.test(t)&&(i=Object.assign(i,e(t)));var r=c(i),o=xa(i);return ya(r,o).then((function(e){try{var t=u(e,i);return t=va(t),a&&a(null,t),t}catch(e){throw e}})).catch((function(e){return console.error(e),a&&a(e,null),null}))},Ea={lang:"en",wiki:"wikipedia",domain:null,path:"w/api.php"},Oa=function(e,t){var i;t=t||{},t=Object.assign({},Ea,t),"string"==typeof e?t.lang=e:(i=e)&&"[object Object]"===Object.prototype.toString.call(i)&&(t=Object.assign(t,e));var n="https://".concat(t.lang,".wikipedia.org/").concat(t.path,"?");t.domain&&(n="https://".concat(t.domain,"/").concat(t.path,"?")),n+="format=json&action=query&generator=random&grnnamespace=0&prop=revisions&rvprop=content&grnlimit=1&rvslots=main&origin=*";var a=xa(t);return ya(n,a).then((function(e){try{var t=u(e);return va(t)}catch(e){throw e}})).catch((function(e){return console.error(e),null}))},_a={lang:"en",wiki:"wikipedia",domain:null,path:"w/api.php"},Sa=function(e,t,i){var n;i=i||{},i=Object.assign({},_a,i),"string"==typeof t?i.lang=t:(n=t)&&"[object Object]"===Object.prototype.toString.call(n)&&(i=Object.assign(i,t));var a={pages:[],categories:[]};return new Promise((function(t,n){!function r(o){var s=function(e,t,i){e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!1===/^Category/i.test(e)&&(e="Category:"+e),e=e.replace(/ /g,"_")}(e),e=encodeURIComponent(e);var n="https://".concat(t.lang,".wikipedia.org/").concat(t.path,"?");return t.domain&&(n="https://".concat(t.domain,"/").concat(t.path,"?")),n+="action=query&list=categorymembers&cmtitle=".concat(e,"&cmlimit=500&format=json&origin=*&redirects=true&cmtype=page|subcat"),i&&(n+="&cmcontinue="+i),n}(e,i,o),c=xa(i);return ya(s,c).then((function(e){a=function(e){var t=e.query.categorymembers||[],i={pages:[],categories:[]};return t.forEach((function(e){14===e.ns?(delete e.ns,i.categories.push(e)):(delete e.ns,i.pages.push(e))})),i}(e),e.continue&&e.continue.cmcontinue?r(e.continue.cmcontinue):t(a)})).catch((function(e){console.error(e),n(e)}))}(null)}))},Ca=function(e,t){return wa(e,t)},qa={Doc:S,Section:ae,Paragraph:vt,Sentence:be,Image:z,Infobox:Zt,Link:ue,List:qt,Reference:Ue,Table:pt,Template:Hn,http:ya,wtf:Ca};Ca.fetch=function(e,t,i,n){return za(e,t,i)},Ca.random=function(e,t,i){return Oa(e,t)},Ca.category=function(e,t,i,n){return Sa(e,t,i)},Ca.extend=function(e){return e(qa,Kn,this),this},Ca.version="8.3.0";var Na=Ca;export default Na; +var e=function(e){var t=new URL(e),i=t.pathname.replace(/^\/(wiki\/)?/,"");return i=decodeURIComponent(i),{domain:t.host,title:i}};function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var i=[],n=!0,a=!1,r=void 0;try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done)&&(i.push(o.value),!t||i.length!==t);n=!0);}catch(e){a=!0,r=e}finally{try{n||null==s.return||s.return()}finally{if(a)throw r}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return n(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return n(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);iObject.keys(t.data).length?-1:1})),"number"==typeof e?t[e]:t},text:function(e){return e=p(e,j),!0===this.isRedirect()?"":this.sections().map((function(t){return t.text(e)})).join("\n\n")},json:function(e){return e=p(e,j),d(this,e)},debug:function(){return console.log("\n"),this.sections().forEach((function(e){for(var t=" - ",i=0;i500)&&M.test(e)},U=function(e){var t=e.match(M);return t&&t[2]?(P(t[2])||[])[0]:{}},F=["table","code","score","data","categorytree","charinsert","hiero","imagemap","inputbox","nowiki","poem","references","source","syntaxhighlight","timeline"],K="< ?(".concat(F.join("|"),") ?[^>]{0,200}?>"),B="< ?/ ?(".concat(F.join("|"),") ?>"),W=new RegExp("".concat(K,"[").concat("\\s\\S","]+?").concat(B),"ig"),Y=function(e){return(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=e.replace(W," ")).replace(/ ?< ?(span|div|table|data) [a-zA-Z0-9=%\.#:;'" ]{2,100}\/? ?> ?/g," ")).replace(/ ?< ?(ref) [a-zA-Z0-9=" ]{2,100}\/ ?> ?/g," ")).replace(/(.*?)<\/i>/g,"''$1''")).replace(/(.*?)<\/b>/g,"'''$1'''")).replace(/(.*?)<\/sub>/g,"{{sub|$1}}")).replace(/(.*?)<\/sup>/g,"{{sup|$1}}")).replace(/ ?<[ \/]?(p|sub|sup|span|nowiki|div|table|br|tr|td|th|pre|pre2|hr)[ \/]?> ?/g," ")).replace(/ ?<[ \/]?(abbr|bdi|bdo|blockquote|cite|del|dfn|em|ins|kbd|mark|q|s|small)[ \/]?> ?/g," ")).replace(/ ?<[ \/]?h[0-9][ \/]?> ?/g," ")).replace(/ ?< ?br ?\/> ?/g,"\n")).trim()};var Z=function(e){var t=e.wiki;t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace(//g,"")).replace(/__(NOTOC|NOEDITSECTION|FORCETOC|TOC)__/gi,"")).replace(/~~{1,3}/g,"")).replace(/\r/g,"")).replace(/\u3002/g,". ")).replace(/----/g,"")).replace(/\{\{\}\}/g," – ")).replace(/\{\{\\\}\}/g," / ")).replace(/ /g," "),t=(t=(t=Y(t)).replace(/\([,;: ]+?\)/g,"")).replace(/{{(baseball|basketball) (primary|secondary) (style|color).*?\}\}/i,""),e.wiki=t},G=/[\\\.$]/,H=function(e){return"string"!=typeof e&&(e=""),e=(e=(e=e.replace(/\\/g,"\\\\")).replace(/^\$/,"\\u0024")).replace(/\./g,"\\u002e")},V=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Object.keys(e),i=0;i0&&(i.paragraphs=n)}if(!0===t.images){var a=e.images().map((function(e){return e.json(t)}));a.length>0&&(i.images=a)}if(!0===t.tables){var r=e.tables().map((function(e){return e.json(t)}));r.length>0&&(i.tables=r)}if(!0===t.templates){var o=e.templates();o.length>0&&(i.templates=o,!0===t.encode&&i.templates.forEach((function(e){return V(e)})))}if(!0===t.infoboxes){var s=e.infoboxes().map((function(e){return e.json(t)}));s.length>0&&(i.infoboxes=s)}if(!0===t.lists){var c=e.lists().map((function(e){return e.json(t)}));c.length>0&&(i.lists=c)}if(!0===t.references||!0===t.citations){var u=e.references().map((function(e){return e.json(t)}));u.length>0&&(i.references=u)}return!0===t.sentences&&(i.sentences=e.sentences().map((function(e){return e.json(t)}))),i},X={tables:!0,references:!0,paragraphs:!0,templates:!0,infoboxes:!0},ee=function(e){this.depth=e.depth,this.doc=null,this._title=e.title||"",Object.defineProperty(this,"doc",{enumerable:!1,value:null}),e.templates=e.templates||[],Object.defineProperty(this,"data",{enumerable:!1,value:e})},te={title:function(){return this._title||""},index:function(){if(!this.doc)return null;var e=this.doc.sections().indexOf(this);return-1===e?null:e},indentation:function(){return this.depth},sentences:function(e){var t=this.paragraphs().reduce((function(e,t){return e.concat(t.sentences())}),[]);return"number"==typeof e?t[e]:t||[]},paragraphs:function(e){var t=this.data.paragraphs||[];return"number"==typeof e?t[e]:t||[]},paragraph:function(e){var t=this.data.paragraphs||[];return"number"==typeof e?t[e]:t[0]},links:function(e){var t=[];if(this.infoboxes().forEach((function(i){i.links(e).forEach((function(e){return t.push(e)}))})),this.sentences().forEach((function(i){i.links(e).forEach((function(e){return t.push(e)}))})),this.tables().forEach((function(i){i.links(e).forEach((function(e){return t.push(e)}))})),this.lists().forEach((function(i){i.links(e).forEach((function(e){return t.push(e)}))})),"number"==typeof e)return t[e];if("string"==typeof e){e=e.charAt(0).toUpperCase()+e.substring(1);var i=t.find((function(t){return t.page()===e}));return void 0===i?[]:[i]}return t},tables:function(e){var t=this.data.tables||[];return"number"==typeof e?t[e]:t},templates:function(e){var t=this.data.templates||[];return t=t.map((function(e){return e.json()})),"number"==typeof e?t[e]:"string"==typeof e?(e=e.toLowerCase(),t.filter((function(t){return t.template===e||t.name===e}))):t},infoboxes:function(e){var t=this.data.infoboxes||[];return"number"==typeof e?t[e]:t},coordinates:function(e){var t=[].concat(this.templates("coord"),this.templates("coor"));return"number"==typeof e?t[e]?t[e]:[]:t},lists:function(e){var t=[];return this.paragraphs().forEach((function(e){t=t.concat(e.lists())})),"number"==typeof e?t[e]:t},interwiki:function(e){var t=[];return this.paragraphs().forEach((function(e){t=t.concat(e.interwiki())})),"number"==typeof e?t[e]:t||[]},images:function(e){var t=[];return this.paragraphs().forEach((function(e){t=t.concat(e.images())})),"number"==typeof e?t[e]:t||[]},references:function(e){var t=this.data.references||[];return"number"==typeof e?t[e]:t},remove:function(){if(!this.doc)return null;var e={};e[this.title()]=!0,this.children().forEach((function(t){return e[t.title()]=!0}));var t=this.doc.data.sections;return t=t.filter((function(t){return!0!==e.hasOwnProperty(t.title())})),this.doc.data.sections=t,this.doc},nextSibling:function(){if(!this.doc)return null;for(var e=this.doc.sections(),t=this.index()+1;tthis.depth)for(var a=i+1;athis.depth;a+=1)n.push(t[a]);return"string"==typeof e?(e=e.toLowerCase(),n.find((function(t){return t.title().toLowerCase()===e}))):"number"==typeof e?n[e]:n},parent:function(){if(!this.doc)return null;for(var e=this.doc.sections(),t=this.index();t>=0;t-=1)if(e[t]&&e[t].depth0&&(e.fmt=e.fmt||{},e.fmt.bold=t),i.length>0&&(e.fmt=e.fmt||{},e.fmt.italic=i),e},le=/^[0-9,.]+$/,pe={text:!0,links:!0,formatting:!0,numbers:!0},me=function(e,t){t=p(t,pe);var i={},n=e.text();if(!0===t.text&&(i.text=n),!0===t.numbers&&le.test(n)){var a=Number(n.replace(/,/g,""));!1===isNaN(a)&&(i.number=a)}return t.links&&e.links().length>0&&(i.links=e.links().map((function(e){return e.json()}))),t.formatting&&e.data.fmt&&(i.formatting=e.data.fmt),i},de=function(e){Object.defineProperty(this,"data",{enumerable:!1,value:e})},fe={links:function(e){var t=this.data.links||[];if("number"==typeof e)return t[e];if("string"==typeof e){e=e.charAt(0).toUpperCase()+e.substring(1);var i=t.find((function(t){return t.page===e}));return void 0===i?[]:[i]}return t},interwiki:function(e){var t=this.links().filter((function(e){return void 0!==e.wiki}));return"number"==typeof e?t[e]:t},bolds:function(e){var t=[];return this.data&&this.data.fmt&&this.data.fmt.bold&&(t=this.data.fmt.bold||[]),"number"==typeof e?t[e]:t},italics:function(e){var t=[];return this.data&&this.data.fmt&&this.data.fmt.italic&&(t=this.data.fmt.italic||[]),"number"==typeof e?t[e]:t},dates:function(e){var t=[];return"number"==typeof e?t[e]:t},text:function(e){return void 0!==e&&"string"==typeof e&&(this.data.text=e),this.data.text||""},json:function(e){return me(this,e)}};Object.keys(fe).forEach((function(e){de.prototype[e]=fe[e]})),de.prototype.italic=de.prototype.italics,de.prototype.bold=de.prototype.bolds,de.prototype.plaintext=de.prototype.text;var ge=de,he=["ad","adj","adm","adv","al","alta","approx","apr","apt","arc","ariz","assn","asst","atty","aug","ave","ba","bc","bl","bldg","blvd","brig","bros","ca","cal","calif","capt","cca","cg","cl","cm","cmdr","co","col","colo","comdr","conn","corp","cpl","cres","ct","cyn","dak","dec","def","dept","det","dg","dist","dl","dm","dr","ea","eg","eng","esp","esq","est","etc","ex","exp","feb","fem","fig","fl oz","fl","fla","fm","fr","ft","fy","ga","gal","gb","gen","gov","hg","hon","hr","hrs","hwy","hz","ia","ida","ie","inc","inf","jan","jd","jr","jul","jun","kan","kans","kb","kg","km","kmph","lat","lb","lit","llb","lm","lng","lt","ltd","lx","ma","maj","mar","masc","mb","md","messrs","mg","mi","min","minn","misc","mister","ml","mlle","mm","mme","mph","mps","mr","mrs","ms","mstr","mt","neb","nebr","nee","no","nov","oct","okla","ont","op","ord","oz","pa","pd","penn","penna","phd","pl","pp","pref","prob","prof","pron","ps","psa","pseud","pt","pvt","qt","que","rb","rd","rep","reps","res","rev","sask","sec","sen","sens","sep","sept","sfc","sgt","sir","situ","sq ft","sq","sr","ss","st","supt","surg","tb","tbl","tbsp","tce","td","tel","temp","tenn","tex","tsp","univ","usafa","ut","va","vb","ver","vet","vitro","vivo","vol","vs","vt","wis","wisc","wr","wy","wyo","yb","µg"].concat("[^]][^]]"),be=new RegExp("(^| |')("+he.join("|")+")[.!?] ?$","i"),ke=new RegExp("[ |.|'|[][A-Z].? *?$","i"),we=new RegExp("\\.\\.\\.* +?$"),ve=/ c\. $/,ye=new RegExp("[a-zа-яぁ-ゟ][a-zа-яぁ-ゟ゠-ヿ]","iu"),xe=function(e){var t=[],i=[];if(!e||"string"!=typeof e||0===e.trim().length)return t;for(var n=function(e){var t=e.split(/(\n+)/);return function(e){var t=[];return e.forEach((function(e){t=t.concat(e)})),t}(t=(t=t.filter((function(e){return e.match(/\S/)}))).map((function(e){return e.split(/(\S.+?[.!?]"?)(?=\s+|$)/g)})))}(e),a=0;ai.length)return!1;var n=e.match(/"/g);return!(n&&n.length%2!=0&&e.length<900)}(o))?i[s+1]=i[s]+(i[s+1]||""):i[s]&&i[s].length>0&&(t.push(i[s]),i[s]="");return 0===t.length?[e]:t};function $e(e){var t,i={text:e};return ce(i),i.text=(t=(t=(t=i.text).replace(/\([,;: ]*\)/g,"")).replace(/\( *(; ?)+/g,"("),t=(t=ne(t)).replace(/ +\.$/,".")),i=ue(i),new ge(i)}var je=$e,ze=function(e){var t=xe(e.wiki);(t=t.map($e))[0]&&t[0].text()&&":"===t[0].text()[0]&&(t=t.slice(1)),e.sentences=t},Ee=function(e){return e=(e=e.replace(/^\{\{/,"")).replace(/\}\}$/,"")},Oe=function(e){return e=(e=(e=(e||"").trim()).toLowerCase()).replace(/_/g," ")},_e=function(e){var t=e.split(/\n?\|/);t.forEach((function(e,i){null!==e&&(/\[\[[^\]]+$/.test(e)||/\{\{[^\}]+$/.test(e)||e.split("{{").length!==e.split("}}").length||e.split("[[").length!==e.split("]]").length)&&(t[i+1]=t[i]+"|"+t[i+1],t[i]=null)}));for(var i=(t=(t=t.filter((function(e){return null!==e}))).map((function(e){return(e||"").trim()}))).length-1;i>=0;i-=1){""===t[i]&&t.pop();break}return t},Se=/^[ '-\)\x2D\.0-9_a-z\xC0-\xFF\u0153\u017F\u1E9E\u212A\u212B]+=/i,Ce={template:!0,list:!0,prototype:!0},qe=function(e,t){var i=0;return e.reduce((function(e,n){if(n=(n||"").trim(),!0===Se.test(n)){var a=function(e){var t=e.split("="),i=t[0]||"";i=i.toLowerCase().trim();var n=t.slice(1).join("=");return Ce.hasOwnProperty(i)&&(i="_"+i),{key:i,val:n.trim()}}(n);if(a.key)return e[a.key]=a.val,e}t&&t[i]?e[t[i]]=n:(e.list=e.list||[],e.list.push(n));return i+=1,e}),{})},Ne={classname:!0,style:!0,align:!0,margin:!0,left:!0,break:!0,boxsize:!0,framestyle:!0,item_style:!0,collapsible:!0,list_style_type:!0,"list-style-type":!0,colwidth:!0},Ae=function(e){return Object.keys(e).forEach((function(t){!0===Ne[t.toLowerCase()]&&delete e[t],null!==e[t]&&""!==e[t]||delete e[t]})),e},Le=je,De=function(e,t){var i=Le(e);return"json"===t?i.json():"raw"===t?i:i.text()},Ie=function(e,t,i){t=t||[],e=Ee(e||"");var n=_e(e),a=n.shift(),r=qe(n,t);return(r=Ae(r))[1]&&t[0]&&!1===r.hasOwnProperty(t[0])&&(r[t[0]]=r[1],delete r[1]),Object.keys(r).forEach((function(e){r[e]="list"!==e?De(r[e],i):r[e].map((function(e){return De(e,i)}))})),a&&(r.template=Oe(a)),r},Te=function(e){Object.defineProperty(this,"data",{enumerable:!1,value:e})},Pe={title:function(){var e=this.data;return e.title||e.encyclopedia||e.author||""},links:function(e){var t=[];if("number"==typeof e)return t[e];if("number"==typeof e)return t[e];if("string"==typeof e){e=e.charAt(0).toUpperCase()+e.substring(1);var i=t.find((function(t){return t.page()===e}));return void 0===i?[]:[i]}return t||[]},text:function(){return""},json:function(){return this.data}};Object.keys(Pe).forEach((function(e){Te.prototype[e]=Pe[e]}));var Me=Te,Re=je,Ue=function(e){return/^ *?\{\{ *?(cite|citation)/i.test(e)&&/\}\} *?$/.test(e)&&!1===/citation needed/i.test(e)},Fe=function(e){var t=Ie(e);return t.type=t.template.replace(/cite /,""),t.template="citation",t},Ke=function(e){return{template:"citation",type:"inline",data:{},inline:Re(e)||{}}},Be=function(e){var t=[],i=e.wiki;i=(i=(i=(i=i.replace(/ ?([\s\S]{0,1800}?)<\/ref> ?/gi,(function(e,n){if(Ue(n)){var a=Fe(n);a&&t.push(a),i=i.replace(n,"")}else t.push(Ke(n));return" "}))).replace(/ ?]{0,200}?\/> ?/gi," ")).replace(/ ?]{0,200}?>([\s\S]{0,1800}?)<\/ref> ?/gi,(function(e,n){if(Ue(n)){var a=Fe(n);a&&t.push(a),i=i.replace(n,"")}else t.push(Ke(n));return" "}))).replace(/ ?<[ \/]?[a-z0-9]{1,8}[a-z0-9=" ]{2,20}[ \/]?> ?/g," "),e.references=t.map((function(e){return new Me(e)})),e.wiki=i},We=je,Ye=/^(={1,5})(.{1,200}?)={1,5}$/,Ze=function(e,t){var i=t.match(Ye);if(!i)return e.title="",e.depth=0,e;var n=i[2]||"",a={wiki:n=(n=We(n).text()).replace(/\{\{.+?\}\}/,"")};Be(a),n=ne(n=a.wiki);var r=0;return i[1]&&(r=i[1].length-2),e.title=n,e.depth=r,e},Ge=function(e){var t=[],i=[];e=function(e){return e=e.filter((function(e){return e&&!0!==/^\|\+/.test(e)})),!0===/^{\|/.test(e[0])&&e.shift(),!0===/^\|}/.test(e[e.length-1])&&e.pop(),!0===/^\|-/.test(e[0])&&e.shift(),e}(e);for(var n=0;n0&&(t.push(i),i=[]):(!(a=a.split(/(?:\|\||!!)/))[0]&&a[1]&&a.shift(),a.forEach((function(e){e=(e=e.replace(/^\| */,"")).trim(),i.push(e)})))}return i.length>0&&t.push(i),t},He=/.*rowspan *?= *?["']?([0-9]+)["']?[ \|]*/,Ve=/.*colspan *?= *?["']?([0-9]+)["']?[ \|]*/,Je=function(e){return e=function(e){return e.forEach((function(t,i){t.forEach((function(n,a){var r=n.match(He);if(null!==r){var o=parseInt(r[1],10);n=n.replace(He,""),t[a]=n;for(var s=i+1;s0}))}(e))},Qe=je,Xe=/^!/,et={name:!0,age:!0,born:!0,date:!0,year:!0,city:!0,country:!0,population:!0,count:!0,number:!0},tt=function(e){return(e=Qe(e).text()).match(/\|/)&&(e=e.replace(/.+\| ?/,"")),e=(e=(e=e.replace(/style=['"].*?["']/,"")).replace(/^!/,"")).trim()},it=function(e){return(e=e||[]).length-e.filter((function(e){return e})).length>3},nt=function(e){if(e.length<=3)return[];var t=e[0].slice(0);t=t.map((function(e){return e=e.replace(/^\! */,""),e=Qe(e).text(),e=(e=tt(e)).toLowerCase()}));for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:[],t=[];it(e[0])&&e.shift();var i=e[0];return i&&i[0]&&i[1]&&(/^!/.test(i[0])||/^!/.test(i[1]))&&(t=i.map((function(e){return e=e.replace(/^\! */,""),e=tt(e)})),e.shift()),(i=e[0])&&i[0]&&i[1]&&/^!/.test(i[0])&&/^!/.test(i[1])&&(i.forEach((function(e,i){e=e.replace(/^\! */,""),e=tt(e),!0===Boolean(e)&&(t[i]=e)})),e.shift()),t}(i=Je(i));if(!n||n.length<=1){n=nt(i);var a=i[i.length-1]||[];n.length<=1&&a.length>2&&(n=nt(i.slice(1))).length>0&&(i=i.slice(2))}return i.map((function(e){return function(e,t){var i={};return e.forEach((function(e,n){var a=t[n]||"col"+(n+1),r=Qe(e);r.text(tt(r.text())),i[a]=r})),i}(e,n)}))},rt=function(e,t){return e.map((function(e){var i={};return Object.keys(e).forEach((function(t){i[t]=e[t].json()})),!0===t.encode&&(i=V(i)),i}))},ot={},st=function(e){Object.defineProperty(this,"data",{enumerable:!1,value:e})},ct={links:function(e){var t=[];if(this.data.forEach((function(e){Object.keys(e).forEach((function(i){t=t.concat(e[i].links())}))})),"number"==typeof e)return t[e];if("string"==typeof e){e=e.charAt(0).toUpperCase()+e.substring(1);var i=t.find((function(t){return t.page()===e}));return void 0===i?[]:[i]}return t},keyValue:function(e){var t=this.json(e);return t.forEach((function(e){Object.keys(e).forEach((function(t){e[t]=e[t].text}))})),t},json:function(e){return e=p(e,ot),rt(this.data,e)},text:function(){return""}};ct.keyvalue=ct.keyValue,ct.keyval=ct.keyValue,Object.keys(ct).forEach((function(e){st.prototype[e]=ct[e]}));var ut=st,lt=/^\s*{\|/,pt=/^\s*\|}/,mt=function(e){for(var t=[],i=e.wiki,n=i.split("\n"),a=[],r=0;r0&&(a[a.length-1]+="\n"+n[r]);else{a[a.length-1]+="\n"+n[r];var o=a.pop();t.push(o)}else a.push(n[r]);var s=[];t.forEach((function(e){if(e){i=(i=i.replace(e+"\n","")).replace(e,"");var t=at(e);t&&t.length>0&&s.push(new ut(t))}})),s.length>0&&(e.tables=s),e.wiki=i},dt={sentences:!0},ft=function(e,t){var i={};return!0===(t=p(t,dt)).sentences&&(i.sentences=e.sentences().map((function(e){return e.json(t)}))),i},gt={sentences:!0,lists:!0,images:!0},ht=function(e){Object.defineProperty(this,"data",{enumerable:!1,value:e})},bt={sentences:function(e){return"number"==typeof e?this.data.sentences[e]:this.data.sentences||[]},references:function(e){return"number"==typeof e?this.data.references[e]:this.data.references},lists:function(e){return"number"==typeof e?this.data.lists[e]:this.data.lists},images:function(e){return"number"==typeof e?this.data.images[e]:this.data.images||[]},links:function(e){var t=[];if(this.sentences().forEach((function(i){t=t.concat(i.links(e))})),"number"==typeof e)return t[e];if("string"==typeof e){e=e.charAt(0).toUpperCase()+e.substring(1);var i=t.find((function(t){return t.page()===e}));return void 0===i?[]:[i]}return t||[]},interwiki:function(e){var t=[];return this.sentences().forEach((function(e){t=t.concat(e.interwiki())})),"number"==typeof e?t[e]:t||[]},text:function(e){e=p(e,gt);var t=this.sentences().map((function(t){return t.text(e)})).join(" ");return this.lists().forEach((function(e){t+="\n"+e.text()})),t},json:function(e){return e=p(e,gt),ft(this,e)}};bt.citations=bt.references,Object.keys(bt).forEach((function(e){ht.prototype[e]=bt[e]}));var kt=ht;var wt=function(e){for(var t=[],i=[],n=e.split(""),a=0,r=0;r0){for(var s=0,c=0,u=0;uc&&i.push("]"),t.push(i.join("")),i=[]}}return t},vt=je,yt=new RegExp("("+_.images.join("|")+"):","i"),xt="(".concat(_.images.join("|"),")"),$t=new RegExp(xt+":(.+?)[\\||\\]]","iu"),jt={thumb:!0,thumbnail:!0,border:!0,right:!0,left:!0,center:!0,top:!0,bottom:!0,none:!0,upright:!0,baseline:!0,middle:!0,sub:!0,super:!0},zt=function(e,t){var i=e.wiki;wt(i).forEach((function(n){if(!0===yt.test(n)){e.images=e.images||[];var a=function(e,t){var i=e.match($t);if(null===i||!i[2])return null;var n="".concat(i[1],":").concat(i[2]||""),a=(n=n.trim()).charAt(0).toUpperCase()+n.substring(1);if(a=a.replace(/ /g,"_")){var r={file:n,lang:t.lang,domain:t.domain};e=(e=e.replace(/^\[\[/,"")).replace(/\]\]$/,"");var o=Ie(e),s=o.list||[];return o.alt&&(r.alt=o.alt),(s=s.filter((function(e){return!1===jt.hasOwnProperty(e)})))[s.length-1]&&(r.caption=vt(s[s.length-1])),new $(r)}return null}(n,t);a&&e.images.push(a),i=i.replace(n,"")}})),e.wiki=i},Et={},Ot=function(e){Object.defineProperty(this,"data",{enumerable:!1,value:e})},_t={lines:function(){return this.data},links:function(e){var t=[];if(this.lines().forEach((function(e){t=t.concat(e.links())})),"number"==typeof e)return t[e];if("string"==typeof e){e=e.charAt(0).toUpperCase()+e.substring(1);var i=t.find((function(t){return t.page()===e}));return void 0===i?[]:[i]}return t},json:function(e){return e=p(e,Et),this.lines().map((function(t){return t.json(e)}))},text:function(){return function(e,t){return e.map((function(e){return" * "+e.text(t)})).join("\n")}(this.data)}};Object.keys(_t).forEach((function(e){Ot.prototype[e]=_t[e]}));var St=Ot,Ct=je,qt=/^[#\*:;\|]+/,Nt=/^\*+[^:,\|]{4}/,At=/^ ?\#[^:,\|]{4}/,Lt=/[a-z_0-9\]\}]/i,Dt=function(e){return qt.test(e)||Nt.test(e)||At.test(e)},It=function(e,t){for(var i=[],n=t;n0&&(i.push(r),a+=r.length-1)}else n.push(t[a]);e.lists=i.map((function(e){return new St(e)})),e.wiki=n.join("\n")}},Rt=function(e,t){var i=e.wiki,n=i.split(Pt);n=(n=n.filter((function(e){return e&&e.trim().length>0}))).map((function(e){var i={wiki:e,lists:[],sentences:[],images:[]};return Mt.list(i),Mt.image(i,t),Tt(i),new kt(i)})),e.wiki=i,e.paragraphs=n},Ut=function(e,t){var i=Object.keys(e.data).reduce((function(t,i){return e.data[i]&&(t[i]=e.data[i].json()),t}),{});return!0===t.encode&&(i=V(i)),i},Ft=function(e){return(e=(e=e.toLowerCase()).replace(/[-_]/g," ")).trim()},Kt=function(e){this._type=e.type,this.domain=e.domain,Object.defineProperty(this,"data",{enumerable:!1,value:e.data})},Bt={type:function(){return this._type},links:function(e){var t=this,i=[];if(Object.keys(this.data).forEach((function(e){t.data[e].links().forEach((function(e){return i.push(e)}))})),"number"==typeof e)return i[e];if("string"==typeof e){e=e.charAt(0).toUpperCase()+e.substring(1);var n=i.find((function(t){return t.page()===e}));return void 0===n?[]:[n]}return i},image:function(){var e=this.get("image")||this.get("image2")||this.get("logo");if(!e)return null;var t=e.json();return t.file=t.text,t.text="",t.domain=this.domain,new $(t)},get:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";e=Ft(e);for(var t=Object.keys(this.data),i=0;i0?a++:a=e.indexOf("{",a+1)){var r=e[a];if("{"===r&&(t+=1),t>0){if("}"===r&&0===(t-=1)){n.push(r);var o=n.join("");n=[],/\{\{/.test(o)&&/\}\}/.test(o)&&i.push(o);continue}if(1===t&&"{"!==r&&"}"!==r){t=0,n=[];continue}n.push(r)}}return i},Zt=function(e){var t=null;return(t=/^\{\{[^\n]+\|/.test(e)?(e.match(/^\{\{(.+?)\|/)||[])[1]:-1!==e.indexOf("\n")?(e.match(/^\{\{(.+?)\n/)||[])[1]:(e.match(/^\{\{(.+?)\}\}$/)||[])[1])&&(t=t.replace(/:.*/,""),t=Oe(t)),t||null},Gt=/\{\{/,Ht=function(e){return{body:e=e.replace(/#invoke:/,""),name:Zt(e),children:[]}},Vt=function e(t){var i=t.body.substr(2);return i=i.replace(/\}\}$/,""),t.children=Yt(i),t.children=t.children.map(Ht),0===t.children.length||t.children.forEach((function(t){var i=t.body.substr(2);return Gt.test(i)?e(t):null})),t},Jt=function(e){var t=Yt(e);return t=(t=t.map(Ht)).map(Vt)},Qt=["anchor","defaultsort","use list-defined references","void","pp","pp-move-indef","pp-semi-indef","pp-vandalism","r","#tag","div col","pope list end","shipwreck list end","starbox end","end box","end","s-end"].reduce((function(e,t){return e[t]=!0,e}),{}),Xt=new RegExp("^(subst.)?("+_.infoboxes.join("|")+")[: \n]","i"),ei=/^infobox /i,ti=/ infobox$/i,ii=/$Year in [A-Z]/i,ni={"gnf protein box":!0,"automatic taxobox":!0,"chembox ":!0,editnotice:!0,geobox:!0,hybridbox:!0,ichnobox:!0,infraspeciesbox:!0,mycomorphbox:!0,oobox:!0,"paraphyletic group":!0,speciesbox:!0,subspeciesbox:!0,"starbox short":!0,taxobox:!0,nhlteamseason:!0,"asian games bid":!0,"canadian federal election results":!0,"dc thomson comic strip":!0,"daytona 24 races":!0,edencharacter:!0,"moldova national football team results":!0,samurai:!0,protein:!0,"sheet authority":!0,"order-of-approx":!0,"bacterial labs":!0,"medical resources":!0,ordination:!0,"hockey team coach":!0,"hockey team gm":!0,"pro hockey team":!0,"hockey team player":!0,"hockey team start":!0,mlbbioret:!0},ai=function(e){return!0===ni.hasOwnProperty(e)||(!!Xt.test(e)||(!(!ei.test(e)&&!ti.test(e))||!!ii.test(e)))},ri=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.template.match(Xt),i=e.template;t&&t[0]&&(i=i.replace(t[0],""));var n={template:"infobox",type:i=i.trim(),data:e};return delete n.data.template,delete n.data.list,n},oi=[void 0,"January","February","March","April","May","June","July","August","September","October","November","December"],si=oi.reduce((function(e,t,i){return 0===i||(e[t.toLowerCase()]=i),e}),{}),ci=function(e){return e<10?"0"+e:String(e)},ui=function(e){var t=String(e.year||"");if(void 0!==e.month&&!0===oi.hasOwnProperty(e.month))if(void 0===e.date)t="".concat(oi[e.month]," ").concat(e.year);else{if(t="".concat(oi[e.month]," ").concat(e.date,", ").concat(e.year),void 0!==e.hour&&void 0!==e.minute){var i="".concat(ci(e.hour),":").concat(ci(e.minute));void 0!==e.second&&(i=i+":"+ci(e.second)),t=i+", "+t}e.tz&&(t+=" (".concat(e.tz,")"))}return t},li=function(e){for(var t={},i=["year","month","date","hour","minute","second"],n=0;n0&&(n.years=a,i-=31536e6*n.years);var r=Math.floor(i/2592e6,10);r>0&&(n.months=r,i-=2592e6*n.months);var o=Math.floor(i/mi,10);return o>0&&(n.days=o),n},gi=li,hi=ui,bi=function(e){return{template:"date",data:e}},ki=function(e){var t=(e=Ee(e)).split("|"),i=gi(t.slice(1,4)),n=t.slice(4,7);if(0===n.length){var a=new Date;n=[a.getFullYear(),a.getMonth(),a.getDate()]}return{from:i,to:n=gi(n)}},wi={date:function(e,t){var i=Ie(e,["year","month","date","hour","minute","second","timezone"]),n=gi([i.year,i.month,i.date||i.day]);return i.text=hi(n),i.timezone&&("Z"===i.timezone&&(i.timezone="UTC"),i.text+=" (".concat(i.timezone,")")),i.hour&&i.minute&&(i.second?i.text="".concat(i.hour,":").concat(i.minute,":").concat(i.second,", ")+i.text:i.text="".concat(i.hour,":").concat(i.minute,", ")+i.text),i.text&&t.push(bi(i)),i.text},natural_date:function(e,t){var i=Ie(e,["text"]).text||"",n={};if(/^[0-9]{4}$/.test(i))n.year=parseInt(i,10);else{var a=i.replace(/[a-z]+\/[a-z]+/i,"");a=a.replace(/[0-9]+:[0-9]+(am|pm)?/i,"");var r=new Date(a);!1===isNaN(r.getTime())&&(n.year=r.getFullYear(),n.month=r.getMonth()+1,n.date=r.getDate())}return t.push(bi(n)),i.trim()},one_year:function(e,t){var i=Ie(e,["year"]),n=Number(i.year);return t.push(bi({year:n})),String(n)},two_dates:function(e,t){var i=Ie(e,["b","birth_year","birth_month","birth_date","death_year","death_month","death_date"]);if(i.b&&"b"===i.b.toLowerCase()){var n=gi([i.birth_year,i.birth_month,i.birth_date]);return t.push(bi(n)),hi(n)}var a=gi([i.death_year,i.death_month,i.death_date]);return t.push(bi(a)),hi(a)},age:function(e){var t=ki(e);return fi(t.from,t.to).years||0},"diff-y":function(e){var t=ki(e),i=fi(t.from,t.to);return 1===i.years?i.years+" year":(i.years||0)+" years"},"diff-ym":function(e){var t=ki(e),i=fi(t.from,t.to),n=[];return 1===i.years?n.push(i.years+" year"):i.years&&0!==i.years&&n.push(i.years+" years"),1===i.months?n.push("1 month"):i.months&&0!==i.months&&n.push(i.months+" months"),n.join(", ")},"diff-ymd":function(e){var t=ki(e),i=fi(t.from,t.to),n=[];return 1===i.years?n.push(i.years+" year"):i.years&&0!==i.years&&n.push(i.years+" years"),1===i.months?n.push("1 month"):i.months&&0!==i.months&&n.push(i.months+" months"),1===i.days?n.push("1 day"):i.days&&0!==i.days&&n.push(i.days+" days"),n.join(", ")},"diff-yd":function(e){var t=ki(e),i=fi(t.from,t.to),n=[];return 1===i.years?n.push(i.years+" year"):i.years&&0!==i.years&&n.push(i.years+" years"),i.days+=30*(i.months||0),1===i.days?n.push("1 day"):i.days&&0!==i.days&&n.push(i.days+" days"),n.join(", ")},"diff-d":function(e){var t=ki(e),i=fi(t.from,t.to),n=[];return i.days+=365*(i.years||0),i.days+=30*(i.months||0),1===i.days?n.push("1 day"):i.days&&0!==i.days&&n.push(i.days+" days"),n.join(", ")}},vi=function(e){var t=new Date(e);if(isNaN(t.getTime()))return"";var i=(new Date).getTime()-t.getTime(),n="ago";i<0&&(n="from now",i=Math.abs(i));var a=i/1e3/60/60/24;return a<365?parseInt(a,10)+" days "+n:parseInt(a/365,10)+" years "+n},yi=wi.date,xi=wi.natural_date,$i=["January","February","March","April","May","June","July","August","September","October","November","December"],ji=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],zi=Object.assign({},pi,{currentday:function(){var e=new Date;return String(e.getDate())},currentdayname:function(){var e=new Date;return ji[e.getDay()]},currentmonth:function(){var e=new Date;return $i[e.getMonth()]},currentyear:function(){var e=new Date;return String(e.getFullYear())},monthyear:function(){var e=new Date;return $i[e.getMonth()]+" "+e.getFullYear()},"monthyear-1":function(){var e=new Date;return e.setMonth(e.getMonth()-1),$i[e.getMonth()]+" "+e.getFullYear()},"monthyear+1":function(){var e=new Date;return e.setMonth(e.getMonth()+1),$i[e.getMonth()]+" "+e.getFullYear()},date:0,"time ago":function(e){var t=Ie(e,["date","fmt"]).date;return vi(t)},"birth date and age":function(e,t){var i=Ie(e,["year","month","day"]);return i.year&&/[a-z]/i.test(i.year)?xi(e,t):(t.push(i),i=li([i.year,i.month,i.day]),ui(i))},"birth year and age":function(e,t){var i=Ie(e,["birth_year","birth_month"]);if(i.death_year&&/[a-z]/i.test(i.death_year))return xi(e,t);t.push(i);var n=(new Date).getFullYear()-parseInt(i.birth_year,10);i=li([i.birth_year,i.birth_month]);var a=ui(i);return n&&(a+=" (age ".concat(n,")")),a},"death year and age":function(e,t){var i=Ie(e,["death_year","birth_year","death_month"]);return i.death_year&&/[a-z]/i.test(i.death_year)?xi(e,t):(t.push(i),i=li([i.death_year,i.death_month]),ui(i))},"birth date and age2":function(e,t){var i=Ie(e,["at_year","at_month","at_day","birth_year","birth_month","birth_day"]);return t.push(i),i=li([i.birth_year,i.birth_month,i.birth_day]),ui(i)},"birth based on age as of date":function(e,t){var i=Ie(e,["age","year","month","day"]);t.push(i);var n=parseInt(i.age,10),a=parseInt(i.year,10)-n;return a&&n?"".concat(a," (age ").concat(i.age,")"):"(age ".concat(i.age,")")},"death date and given age":function(e,t){var i=Ie(e,["year","month","day","age"]);t.push(i),i=li([i.year,i.month,i.day]);var n=ui(i);return i.age&&(n+=" (age ".concat(i.age,")")),n},dts:function(e){e=(e=e.replace(/\|format=[ymd]+/i,"")).replace(/\|abbr=(on|off)/i,"");var t=Ie(e,["year","month","date","bc"]);return t.date&&t.month&&t.year?!0===/[a-z]/.test(t.month)?[t.month,t.date,t.year].join(" "):[t.year,t.month,t.date].join("-"):t.month&&t.year?[t.year,t.month].join("-"):t.year?(t.year<0&&(t.year=Math.abs(t.year)+" BC"),t.year):""},start:yi,end:yi,birth:yi,death:yi,"start date":yi,"end date":yi,"birth date":yi,"death date":yi,"start date and age":yi,"end date and age":yi,"start-date":xi,"end-date":xi,"birth-date":xi,"death-date":xi,"birth-date and age":xi,"birth-date and given age":xi,"death-date and age":xi,"death-date and given age":xi,birthdeathage:wi.two_dates,dob:yi,age:wi.age,"age nts":wi.age,"age in years":wi["diff-y"],"age in years and months":wi["diff-ym"],"age in years, months and days":wi["diff-ymd"],"age in years and days":wi["diff-yd"],"age in days":wi["diff-d"]});zi.localday=zi.currentday,zi.localdayname=zi.currentdayname,zi.localmonth=zi.currentmonth,zi.localyear=zi.currentyear,zi.currentmonthname=zi.currentmonth,zi.currentmonthabbrev=zi.currentmonth,zi["death date and age"]=zi["birth date and age"],zi.bda=zi["birth date and age"],zi["birth date based on age at death"]=zi["birth based on age as of date"];var Ei=zi,Oi={tag:function(e){var t=Ie(e,["tag","open"]);return t.open&&"pair"!==t.open?"":{span:!0,div:!0,p:!0}[t.tag]?t.content||"":"<".concat(t.tag," ").concat(t.attribs||"",">").concat(t.content||"","")},plural:function(e){e=e.replace(/plural:/,"plural|");var t=Ie(e,["num","word"]),i=Number(t.num),n=t.word;return 1!==i&&(/.y$/.test(n)?n=n.replace(/y$/,"ies"):n+="s"),i+" "+n},"first word":function(e){var t=Ie(e,["text"]),i=t.text;return t.sep?i.split(t.sep)[0]:i.split(" ")[0]},trunc:function(e){var t=Ie(e,["str","len"]);return t.str.substr(0,t.len)},"str mid":function(e){var t=Ie(e,["str","start","end"]),i=parseInt(t.start,10)-1,n=parseInt(t.end,10);return t.str.substr(i,n)},p1:0,p2:1,p3:2,braces:function(e){var t=Ie(e,["text"]),i="";return t.list&&(i="|"+t.list.join("|")),"{{"+(t.text||"")+i+"}}"},nobold:0,noitalic:0,nocaps:0,syntaxhighlight:function(e,t){var i=Ie(e);return t.push(i),i.code||""},samp:function(e,t){var i=Ie(e,["1"]);return t.push(i),i[1]||""},vanchor:0,resize:1,ra:function(e){var t=Ie(e,["hours","minutes","seconds"]);return[t.hours||0,t.minutes||0,t.seconds||0].join(":")},deg2hms:function(e){return(Ie(e,["degrees"]).degrees||"")+"°"},hms2deg:function(e){var t=Ie(e,["hours","minutes","seconds"]);return[t.hours||0,t.minutes||0,t.seconds||0].join(":")},decdeg:function(e){var t=Ie(e,["deg","min","sec","hem","rnd"]);return(t.deg||t.degrees)+"°"},rnd:0,dec:function(e){var t=Ie(e,["degrees","minutes","seconds"]),i=(t.degrees||0)+"°";return t.minutes&&(i+=t.minutes+"′"),t.seconds&&(i+=t.seconds+"″"),i},val:function(e){var t=Ie(e,["number","uncertainty"]),i=t.number;i&&Number(i)&&(i=Number(i).toLocaleString());var n=i||"";return t.p&&(n=t.p+n),t.s&&(n=t.s+n),(t.u||t.ul||t.upl)&&(n=n+" "+(t.u||t.ul||t.upl)),n},sub:function(e,t){var i=Ie(e,["text"]);return t.push(i),i.text||""},sup:function(e,t){var i=Ie(e,["text"]);return t.push(i),i.text||""}};Oi.rndfrac=Oi.rnd,Oi.rndnear=Oi.rnd,Oi["unité"]=Oi.val;["nowrap","nobr","big","cquote","pull quote","small","smaller","midsize","larger","big","kbd","bigger","large","mono","strongbad","stronggood","huge","xt","xt2","!xt","xtn","xtd","dc","dcr","mxt","!mxt","mxtn","mxtd","bxt","!bxt","bxtn","bxtd","delink","pre","var","mvar","pre2","code"].forEach((function(e){Oi[e]=function(e){return Ie(e,["text"]).text||""}}));var _i=Oi,Si={plainlist:function(e){var t=(e=Ee(e)).split("|");return e=(t=t.slice(1)).join("|"),(t=(t=e.split(/\n ?\* ?/)).filter((function(e){return e}))).join("\n\n")},"collapsible list":function(e,t){var i=Ie(e);t.push(i);var n="";if(i.title&&(n+="'''".concat(i.title,"'''")+"\n\n"),!i.list){i.list=[];for(var a=1;a<10;a+=1)i[a]&&(i.list.push(i[a]),delete i[a])}return i.list=i.list.filter((function(e){return e})),n+=i.list.join("\n\n")},"ordered list":function(e,t){var i=Ie(e);return t.push(i),i.list=i.list||[],i.list.map((function(e,t){return"".concat(t+1,". ").concat(e)})).join("\n\n")},hlist:function(e){var t=Ie(e);return t.list=t.list||[],t.list.join(" · ")},pagelist:function(e){return(Ie(e).list||[]).join(", ")},catlist:function(e){return(Ie(e).list||[]).join(", ")},"br separated entries":function(e){return(Ie(e).list||[]).join("\n\n")},"comma separated entries":function(e){return(Ie(e).list||[]).join(", ")},"anchored list":function(e){var t=Ie(e).list||[];return(t=t.map((function(e,t){return"".concat(t+1,". ").concat(e)}))).join("\n\n")},"bulleted list":function(e){var t=Ie(e).list||[];return(t=(t=t.filter((function(e){return e}))).map((function(e){return"• "+e}))).join("\n\n")},"columns-list":function(e,t){var i=((Ie(e).list||[])[0]||"").split(/\n/);return i=(i=i.filter((function(e){return e}))).map((function(e){return e.replace(/\*/,"")})),t.push({template:"columns-list",list:i}),(i=i.map((function(e){return"• "+e}))).join("\n\n")}};Si.flatlist=Si.plainlist,Si.ublist=Si.plainlist,Si["unbulleted list"]=Si["collapsible list"],Si.ubl=Si["collapsible list"],Si["bare anchored list"]=Si["anchored list"],Si["plain list"]=Si.plainlist,Si.cmn=Si["columns-list"],Si.collist=Si["columns-list"],Si["col-list"]=Si["columns-list"],Si.columnslist=Si["columns-list"];var Ci=Si,qi={convert:function(e){var t=Ie(e,["num","two","three","four"]);return"-"===t.two||"to"===t.two||"and"===t.two?t.four?"".concat(t.num," ").concat(t.two," ").concat(t.three," ").concat(t.four):"".concat(t.num," ").concat(t.two," ").concat(t.three):"".concat(t.num," ").concat(t.two)},term:function(e){var t=Ie(e,["term"]);return"".concat(t.term,":")},defn:0,lino:0,linum:function(e){var t=Ie(e,["num","text"]);return"".concat(t.num,". ").concat(t.text)},ill:function(e){return Ie(e,["text","lan1","text1","lan2","text2"]).text},frac:function(e){var t=Ie(e,["a","b","c"]);return t.c?"".concat(t.a," ").concat(t.b,"/").concat(t.c):t.b?"".concat(t.a,"/").concat(t.b):"1/".concat(t.b)},height:function(e,t){var i=Ie(e);t.push(i);var n=[];return["m","cm","ft","in"].forEach((function(e){!0===i.hasOwnProperty(e)&&n.push(i[e]+e)})),n.join(" ")},"block indent":function(e){var t=Ie(e);return t[1]?"\n"+t[1]+"\n":""},quote:function(e,t){var i=Ie(e,["text","author"]);if(t.push(i),i.text){var n='"'.concat(i.text,'"');return i.author&&(n+="\n\n",n+=" - ".concat(i.author)),n+"\n"}return""},lbs:function(e){var t=Ie(e,["text"]);return"[[".concat(t.text," Lifeboat Station|").concat(t.text,"]]")},lbc:function(e){var t=Ie(e,["text"]);return"[[".concat(t.text,"-class lifeboat|").concat(t.text,"-class]]")},lbb:function(e){var t=Ie(e,["text"]);return"[[".concat(t.text,"-class lifeboat|").concat(t.text,"]]")},own:function(e){var t=Ie(e,["author"]),i="Own work";return t.author&&(i+=" by "+t.author),i},sic:function(e,t){var i=Ie(e,["one","two","three"]),n=(i.one||"")+(i.two||"");return"?"===i.one&&(n=(i.two||"")+(i.three||"")),t.push({template:"sic",word:n}),"y"===i.nolink?n:"".concat(n," [sic]")},formatnum:function(e){e=e.replace(/:/,"|");var t=Ie(e,["number"]).number||"";return t=t.replace(/,/g,""),Number(t).toLocaleString()||""},"#dateformat":function(e){return e=e.replace(/:/,"|"),Ie(e,["date","format"]).date},lc:function(e){return e=e.replace(/:/,"|"),(Ie(e,["text"]).text||"").toLowerCase()},lcfirst:function(e){e=e.replace(/:/,"|");var t=Ie(e,["text"]).text;return t?t[0].toLowerCase()+t.substr(1):""},uc:function(e){return e=e.replace(/:/,"|"),(Ie(e,["text"]).text||"").toUpperCase()},ucfirst:function(e){e=e.replace(/:/,"|");var t=Ie(e,["text"]).text;return t?t[0].toUpperCase()+t.substr(1):""},padleft:function(e){e=e.replace(/:/,"|");var t=Ie(e,["text","num"]);return(t.text||"").padStart(t.num,t.str||"0")},padright:function(e){e=e.replace(/:/,"|");var t=Ie(e,["text","num"]);return(t.text||"").padEnd(t.num,t.str||"0")},abbr:function(e){return Ie(e,["abbr","meaning","ipa"]).abbr},abbrlink:function(e){var t=Ie(e,["abbr","page"]);return t.page?"[[".concat(t.page,"|").concat(t.abbr,"]]"):"[[".concat(t.abbr,"]]")},h:1,finedetail:0,sort:1};qi["str left"]=qi.trunc,qi["str crop"]=qi.trunc,qi.tooltip=qi.abbr,qi.abbrv=qi.abbr,qi.define=qi.abbr,qi.cvt=qi.convert;var Ni=qi,Ai=Object.assign({},_i,Ci,Ni);var Li=function(e){var t=e.pop(),i=Number(e[0]||0),n=Number(e[1]||0),a=Number(e[2]||0);if("string"!=typeof t||isNaN(i))return null;var r=1;return/[SW]/i.test(t)&&(r=-1),r*(i+n/60+a/3600)},Di=function(e){if("number"!=typeof e)return e;return Math.round(1e5*e)/1e5},Ii={s:!0,w:!0},Ti=function(e){var i=Ie(e);i=function(e){return e.list=e.list||[],e.list=e.list.map((function(t){var i=Number(t);if(!isNaN(i))return i;var n=t.split(/:/);return n.length>1?(e.props=e.props||{},e.props[n[0]]=n.slice(1).join(":"),null):t})),e.list=e.list.filter((function(e){return null!==e})),e}(i);var n,a,r=(n=i.list,a=n.map((function(e){return t(e)})).join("|"),2===n.length&&"number|number"===a?{lat:n[0],lon:n[1]}:4===n.length&&"number|string|number|string"===a?(Ii[n[1].toLowerCase()]&&(n[0]*=-1),"w"===n[3].toLowerCase()&&(n[2]*=-1),{lat:n[0],lon:n[2]}):6===n.length?{lat:Li(n.slice(0,3)),lon:Li(n.slice(3))}:8===n.length?{lat:Li(n.slice(0,4)),lon:Li(n.slice(4))}:{});return i.lat=Di(r.lat),i.lon=Di(r.lon),i.template="coord",delete i.list,i},Pi={coord:function(e,t){var i=Ti(e);return t.push(i),i.display&&-1===i.display.indexOf("inline")?"":"".concat(i.lat||"","°N, ").concat(i.lon||"","°W")},geo:["lat","lon","zoom"]};Pi.coor=Pi.coord,Pi["coor title dms"]=Pi.coord,Pi["coor title dec"]=Pi.coord,Pi["coor dms"]=Pi.coord,Pi["coor dm"]=Pi.coord,Pi["coor dec"]=Pi.coord;var Mi=Pi,Ri={etyl:1,mention:1,link:1,"la-verb-form":0,"la-ipa":0,sortname:function(e){var t=Ie(e,["first","last","target","sort"]),i="".concat(t.first||""," ").concat(t.last||"");return i=i.trim(),t.nolink?t.target||i:(t.dab&&(i+=" (".concat(t.dab,")"),t.target&&(t.target+=" (".concat(t.dab,")"))),t.target?"[[".concat(t.target,"|").concat(i,"]]"):"[[".concat(i,"]]"))}};["lts","t","tfd links","tiw","tltt","tetl","tsetl","ti","tic","tiw","tlt","ttl","twlh","tl2","tlu","demo","hatnote","xpd","para","elc","xtag","mli","mlix","#invoke","url"].forEach((function(e){Ri[e]=function(e){var t=Ie(e,["first","second"]);return t.second||t.first}})),Ri.m=Ri.mention,Ri["m-self"]=Ri.mention,Ri.l=Ri.link,Ri.ll=Ri.link,Ri["l-self"]=Ri.link;var Ui=Ri,Fi={wikt:"wiktionary",commons:"commons",c:"commons",commonscat:"commonscat",n:"wikinews",q:"wikiquote",s:"wikisource",a:"wikiauthor",b:"wikibooks",voy:"wikivoyage",v:"wikiversity",d:"wikidata",species:"wikispecies",m:"meta",mw:"mediawiki"},Ki={about:function(e,t){var i=Ie(e);return t.push(i),""},main:function(e,t){var i=Ie(e);return t.push(i),""},"main list":function(e,t){var i=Ie(e);return t.push(i),""},see:function(e,t){var i=Ie(e);return t.push(i),""},for:function(e,t){var i=Ie(e);return t.push(i),""},further:function(e,t){var i=Ie(e);return t.push(i),""},"further information":function(e,t){var i=Ie(e);return t.push(i),""},listen:function(e,t){var i=Ie(e);return t.push(i),""},"wide image":["file","width","caption"],redirect:function(e,t){for(var i=Ie(e,["redirect"]),n=i.list||[],a=[],r=0;r0&&t.push(a)}return{template:"playoffbracket",rounds:t}}(e);return t.push(i),""}};["2teambracket","4team2elimbracket","8teambracket","16teambracket","32teambracket","4roundbracket-byes","cwsbracket","nhlbracket","nhlbracket-reseed","4teambracket-nhl","4teambracket-ncaa","4teambracket-mma","4teambracket-mlb","16teambracket-two-reseeds","8teambracket-nhl","8teambracket-mlb","8teambracket-ncaa","8teambracket-afc","8teambracket-afl","8teambracket-tennis3","8teambracket-tennis5","16teambracket-nhl","16teambracket-nhl divisional","16teambracket-nhl-reseed","16teambracket-nba","16teambracket-swtc","16teambracket-afc","16teambracket-tennis3","16teambracket-tennis5"].forEach((function(e){Ji[e]=Ji["4teambracket"]}));var Qi=Ji,Xi={"£":"GB£","¥":"¥","৳":"৳","₩":"₩","€":"€","₱":"₱","₹":"₹","₽":"₽","cn¥":"CN¥","gb£":"GB£","india rs":"₹","indian rupee symbol":"₹","indian rupee":"₹","indian rupees":"₹","philippine peso":"₱","russian ruble":"₽","SK won":"₩","turkish lira":"TRY",a$:"A$",au$:"A$",aud:"A$",bdt:"BDT",brl:"BRL",ca$:"CA$",cad:"CA$",chf:"CHF",cny:"CN¥",czk:"czk",dkk:"dkk",dkk2:"dkk",euro:"€",gbp:"GB£",hk$:"HK$",hkd:"HK$",ils:"ILS",inr:"₹",jpy:"¥",myr:"MYR",nis:"ILS",nok:"NOK",nok2:"NOK",nz$:"NZ$",nzd:"NZ$",peso:"peso",pkr:"₨",r$:"BRL",rmb:"CN¥",rub:"₽",ruble:"₽",rupee:"₹",s$:"sgd",sek:"SEK",sek2:"SEK",sfr:"CHF",sgd:"sgd",shekel:"ILS",sheqel:"ILS",ttd:"TTD",us$:"US$",usd:"US$",yen:"¥",zar:"R"},en=function(e,t){var i=Ie(e,["amount","code"]);t.push(i);var n=i.template||"";switch("currency"===n?(n=i.code)||(i.code=n="usd"):""!==n&&"monnaie"!==n&&"unité"!==n&&"nombre"!==n&&"nb"!==n||(n=i.code),n=(n||"").toLowerCase()){case"us":i.code=n="usd";break;case"uk":i.code=n="gbp"}var a="".concat(Xi[n]||"").concat(i.amount||"");return i.code&&!Xi[i.code.toLowerCase()]&&(a+=" "+i.code),a},tn={currency:en,monnaie:en,"unité":en,nombre:en,nb:en,iso4217:en,inrconvert:function(e,t){var i=Ie(e,["rupee_value","currency_formatting"]);t.push(i);var n=i.currency_formatting;if(n){var a=1;switch(n){case"k":a=1e3;break;case"m":a=1e6;break;case"b":a=1e9;break;case"t":a=1e12;break;case"l":a=1e5;break;case"c":a=1e7;break;case"lc":a=1e12}i.rupee_value=i.rupee_value*a}return"inr ".concat(i.rupee_value||"")}};Object.keys(Xi).forEach((function(e){tn[e]=en}));var nn=tn,an={"election box begin":function(e,t){var i=Ie(e);return t.push(i),""},"election box candidate":function(e,t){var i=Ie(e);return t.push(i),""},"election box hold with party link":function(e,t){var i=Ie(e);return t.push(i),""},"election box gain with party link":function(e,t){var i=Ie(e);return t.push(i),""}};an["election box begin no change"]=an["election box begin"],an["election box begin no party"]=an["election box begin"],an["election box begin no party no change"]=an["election box begin"],an["election box inline begin"]=an["election box begin"],an["election box inline begin no change"]=an["election box begin"],an["election box candidate for alliance"]=an["election box candidate"],an["election box candidate minor party"]=an["election box candidate"],an["election box candidate no party link no change"]=an["election box candidate"],an["election box candidate with party link"]=an["election box candidate"],an["election box candidate with party link coalition 1918"]=an["election box candidate"],an["election box candidate with party link no change"]=an["election box candidate"],an["election box inline candidate"]=an["election box candidate"],an["election box inline candidate no change"]=an["election box candidate"],an["election box inline candidate with party link"]=an["election box candidate"],an["election box inline candidate with party link no change"]=an["election box candidate"],an["election box inline incumbent"]=an["election box candidate"];var rn=an,on=[["🇦🇩","and","andorra"],["🇦🇪","are","united arab emirates"],["🇦🇫","afg","afghanistan"],["🇦🇬","atg","antigua and barbuda"],["🇦🇮","aia","anguilla"],["🇦🇱","alb","albania"],["🇦🇲","arm","armenia"],["🇦🇴","ago","angola"],["🇦🇶","ata","antarctica"],["🇦🇷","arg","argentina"],["🇦🇸","asm","american samoa"],["🇦🇹","aut","austria"],["🇦🇺","aus","australia"],["🇦🇼","abw","aruba"],["🇦🇽","ala","åland islands"],["🇦🇿","aze","azerbaijan"],["🇧🇦","bih","bosnia and herzegovina"],["🇧🇧","brb","barbados"],["🇧🇩","bgd","bangladesh"],["🇧🇪","bel","belgium"],["🇧🇫","bfa","burkina faso"],["🇧🇬","bgr","bulgaria"],["🇧🇬","bul","bulgaria"],["🇧🇭","bhr","bahrain"],["🇧🇮","bdi","burundi"],["🇧🇯","ben","benin"],["🇧🇱","blm","saint barthélemy"],["🇧🇲","bmu","bermuda"],["🇧🇳","brn","brunei darussalam"],["🇧🇴","bol","bolivia"],["🇧🇶","bes","bonaire, sint eustatius and saba"],["🇧🇷","bra","brazil"],["🇧🇸","bhs","bahamas"],["🇧🇹","btn","bhutan"],["🇧🇻","bvt","bouvet island"],["🇧🇼","bwa","botswana"],["🇧🇾","blr","belarus"],["🇧🇿","blz","belize"],["🇨🇦","can","canada"],["🇨🇨","cck","cocos (keeling) islands"],["🇨🇩","cod","congo"],["🇨🇫","caf","central african republic"],["🇨🇬","cog","congo"],["🇨🇭","che","switzerland"],["🇨🇮","civ","côte d'ivoire"],["🇨🇰","cok","cook islands"],["🇨🇱","chl","chile"],["🇨🇲","cmr","cameroon"],["🇨🇳","chn","china"],["🇨🇴","col","colombia"],["🇨🇷","cri","costa rica"],["🇨🇺","cub","cuba"],["🇨🇻","cpv","cape verde"],["🇨🇼","cuw","curaçao"],["🇨🇽","cxr","christmas island"],["🇨🇾","cyp","cyprus"],["🇨🇿","cze","czech republic"],["🇩🇪","deu","germany"],["🇩🇪","ger","germany"],["🇩🇯","dji","djibouti"],["🇩🇰","dnk","denmark"],["🇩🇲","dma","dominica"],["🇩🇴","dom","dominican republic"],["🇩🇿","dza","algeria"],["🇪🇨","ecu","ecuador"],["🇪🇪","est","estonia"],["🇪🇬","egy","egypt"],["🇪🇭","esh","western sahara"],["🇪🇷","eri","eritrea"],["🇪🇸","esp","spain"],["🇪🇹","eth","ethiopia"],["🇫🇮","fin","finland"],["🇫🇯","fji","fiji"],["🇫🇰","flk","falkland islands (malvinas)"],["🇫🇲","fsm","micronesia"],["🇫🇴","fro","faroe islands"],["🇫🇷","fra","france"],["🇬🇦","gab","gabon"],["🇬🇧","gbr","united kingdom"],["🇬🇩","grd","grenada"],["🇬🇫","guf","french guiana"],["🇬🇬","ggy","guernsey"],["🇬🇭","gha","ghana"],["🇬🇮","gib","gibraltar"],["🇬🇱","grl","greenland"],["🇬🇲","gmb","gambia"],["🇬🇳","gin","guinea"],["🇬🇵","glp","guadeloupe"],["🇬🇶","gnq","equatorial guinea"],["🇬🇷","grc","greece"],["🇬🇸","sgs","south georgia"],["🇬🇹","gtm","guatemala"],["🇬🇺","gum","guam"],["🇬🇼","gnb","guinea-bissau"],["🇬🇾","guy","guyana"],["🇭🇰","hkg","hong kong"],["🇭🇲","hmd","heard island and mcdonald islands"],["🇭🇳","hnd","honduras"],["🇭🇷","hrv","croatia"],["🇭🇹","hti","haiti"],["🇭🇺","hun","hungary"],["🇮🇩","idn","indonesia"],["🇮🇪","irl","ireland"],["🇮🇱","isr","israel"],["🇮🇲","imn","isle of man"],["🇮🇳","ind","india"],["🇮🇴","iot","british indian ocean territory"],["🇮🇶","irq","iraq"],["🇮🇷","irn","iran"],["🇮🇸","isl","iceland"],["🇮🇹","ita","italy"],["🇯🇪","jey","jersey"],["🇯🇲","jam","jamaica"],["🇯🇴","jor","jordan"],["🇯🇵","jpn","japan"],["🇰🇪","ken","kenya"],["🇰🇬","kgz","kyrgyzstan"],["🇰🇭","khm","cambodia"],["🇰🇮","kir","kiribati"],["🇰🇲","com","comoros"],["🇰🇳","kna","saint kitts and nevis"],["🇰🇵","prk","north korea"],["🇰🇷","kor","south korea"],["🇰🇼","kwt","kuwait"],["🇰🇾","cym","cayman islands"],["🇰🇿","kaz","kazakhstan"],["🇱🇦","lao","lao people's democratic republic"],["🇱🇧","lbn","lebanon"],["🇱🇨","lca","saint lucia"],["🇱🇮","lie","liechtenstein"],["🇱🇰","lka","sri lanka"],["🇱🇷","lbr","liberia"],["🇱🇸","lso","lesotho"],["🇱🇹","ltu","lithuania"],["🇱🇺","lux","luxembourg"],["🇱🇻","lva","latvia"],["🇱🇾","lby","libya"],["🇲🇦","mar","morocco"],["🇲🇨","mco","monaco"],["🇲🇩","mda","moldova"],["🇲🇪","mne","montenegro"],["🇲🇫","maf","saint martin (french part)"],["🇲🇬","mdg","madagascar"],["🇲🇭","mhl","marshall islands"],["🇲🇰","mkd","macedonia"],["🇲🇱","mli","mali"],["🇲🇲","mmr","myanmar"],["🇲🇳","mng","mongolia"],["🇲🇴","mac","macao"],["🇲🇵","mnp","northern mariana islands"],["🇲🇶","mtq","martinique"],["🇲🇷","mrt","mauritania"],["🇲🇸","msr","montserrat"],["🇲🇹","mlt","malta"],["🇲🇺","mus","mauritius"],["🇲🇻","mdv","maldives"],["🇲🇼","mwi","malawi"],["🇲🇽","mex","mexico"],["🇲🇾","mys","malaysia"],["🇲🇿","moz","mozambique"],["🇳🇦","nam","namibia"],["🇳🇨","ncl","new caledonia"],["🇳🇪","ner","niger"],["🇳🇫","nfk","norfolk island"],["🇳🇬","nga","nigeria"],["🇳🇮","nic","nicaragua"],["🇳🇱","nld","netherlands"],["🇳🇴","nor","norway"],["🇳🇵","npl","nepal"],["🇳🇷","nru","nauru"],["🇳🇺","niu","niue"],["🇳🇿","nzl","new zealand"],["🇴🇲","omn","oman"],["🇵🇦","pan","panama"],["🇵🇪","per","peru"],["🇵🇫","pyf","french polynesia"],["🇵🇬","png","papua new guinea"],["🇵🇭","phl","philippines"],["🇵🇰","pak","pakistan"],["🇵🇱","pol","poland"],["🇵🇲","spm","saint pierre and miquelon"],["🇵🇳","pcn","pitcairn"],["🇵🇷","pri","puerto rico"],["🇵🇸","pse","palestinian territory"],["🇵🇹","prt","portugal"],["🇵🇼","plw","palau"],["🇵🇾","pry","paraguay"],["🇶🇦","qat","qatar"],["🇷🇪","reu","réunion"],["🇷🇴","rou","romania"],["🇷🇸","srb","serbia"],["🇷🇺","rus","russia"],["🇷🇼","rwa","rwanda"],["🇸🇦","sau","saudi arabia"],["🇸🇧","slb","solomon islands"],["🇸🇨","syc","seychelles"],["🇸🇩","sdn","sudan"],["🇸🇪","swe","sweden"],["🇸🇬","sgp","singapore"],["🇸🇭","shn","saint helena, ascension and tristan da cunha"],["🇸🇮","svn","slovenia"],["🇸🇯","sjm","svalbard and jan mayen"],["🇸🇰","svk","slovakia"],["🇸🇱","sle","sierra leone"],["🇸🇲","smr","san marino"],["🇸🇳","sen","senegal"],["🇸🇴","som","somalia"],["🇸🇷","sur","suriname"],["🇸🇸","ssd","south sudan"],["🇸🇹","stp","sao tome and principe"],["🇸🇻","slv","el salvador"],["🇸🇽","sxm","sint maarten (dutch part)"],["🇸🇾","syr","syrian arab republic"],["🇸🇿","swz","swaziland"],["🇹🇨","tca","turks and caicos islands"],["🇹🇩","tcd","chad"],["🇹🇫","atf","french southern territories"],["🇹🇬","tgo","togo"],["🇹🇭","tha","thailand"],["🇹🇯","tjk","tajikistan"],["🇹🇰","tkl","tokelau"],["🇹🇱","tls","timor-leste"],["🇹🇲","tkm","turkmenistan"],["🇹🇳","tun","tunisia"],["🇹🇴","ton","tonga"],["🇹🇷","tur","turkey"],["🇹🇹","tto","trinidad and tobago"],["🇹🇻","tuv","tuvalu"],["🇹🇼","twn","taiwan"],["🇹🇿","tza","tanzania"],["🇺🇦","ukr","ukraine"],["🇺🇬","uga","uganda"],["🇺🇲","umi","united states minor outlying islands"],["🇺🇸","usa","united states"],["🇺🇸","us","united states"],["🇺🇾","ury","uruguay"],["🇺🇿","uzb","uzbekistan"],["🇻🇦","vat","vatican city"],["🇻🇨","vct","saint vincent and the grenadines"],["🇻🇪","ven","venezuela"],["🇻🇬","vgb","virgin islands, british"],["🇻🇮","vir","virgin islands, u.s."],["🇻🇳","vnm","viet nam"],["🇻🇺","vut","vanuatu"],["","win","west indies"],["🇼🇫","wlf","wallis and futuna"],["🇼🇸","wsm","samoa"],["🇾🇪","yem","yemen"],["🇾🇹","myt","mayotte"],["🇿🇦","zaf","south africa"],["🇿🇲","zmb","zambia"],["🇿🇼 ","zwe","zimbabwe"],["🇺🇳","un","united nations"],["🏴󠁧󠁢󠁥󠁮󠁧󠁿󠁧󠁢󠁥󠁮󠁧󠁿","eng","england"],["🏴󠁧󠁢󠁳󠁣󠁴󠁿","sct","scotland"],["🏴󠁧󠁢󠁷󠁬󠁳󠁿","wal","wales"],["🇪🇺","eu","european union"]],sn={flag:function(e){var t=Ie(e,["flag","variant"]),i=t.flag||"";t.flag=(t.flag||"").toLowerCase();var n=on.find((function(e){return t.flag===e[1]||t.flag===e[2]}))||[],a=n[0]||"";return"".concat(a," [[").concat(n[2],"|").concat(i,"]]")},flagcountry:function(e){var t=Ie(e,["flag","variant"]);t.flag=(t.flag||"").toLowerCase();var i=on.find((function(e){return t.flag===e[1]||t.flag===e[2]}))||[],n=i[0]||"";return"".concat(n," [[").concat(i[2],"]]")},flagcu:function(e){var t=Ie(e,["flag","variant"]);t.flag=(t.flag||"").toLowerCase();var i=on.find((function(e){return t.flag===e[1]||t.flag===e[2]}))||[],n=i[0]||"";return"".concat(n," ").concat(i[2])},flagicon:function(e){var t=Ie(e,["flag","variant"]);t.flag=(t.flag||"").toLowerCase();var i=on.find((function(e){return t.flag===e[1]||t.flag===e[2]}));return i?"[[".concat(i[2],"|").concat(i[0],"]]"):""},flagdeco:function(e){var t=Ie(e,["flag","variant"]);return t.flag=(t.flag||"").toLowerCase(),(on.find((function(e){return t.flag===e[1]||t.flag===e[2]}))||[])[0]||""},fb:function(e){var t=Ie(e,["flag","variant"]);t.flag=(t.flag||"").toLowerCase();var i=on.find((function(e){return t.flag===e[1]||t.flag===e[2]}));return i?"".concat(i[0]," [[").concat(i[2]," national football team|").concat(i[2],"]]"):""},fbicon:function(e){var t=Ie(e,["flag","variant"]);t.flag=(t.flag||"").toLowerCase();var i=on.find((function(e){return t.flag===e[1]||t.flag===e[2]}));return i?" [[".concat(i[2]," national football team|").concat(i[0],"]]"):""},flagathlete:function(e){var t=Ie(e,["name","flag","variant"]);t.flag=(t.flag||"").toLowerCase();var i=on.find((function(e){return t.flag===e[1]||t.flag===e[2]}));return i?"".concat(i[0]," [[").concat(t.name||"","]] (").concat(i[1].toUpperCase(),")"):"[[".concat(t.name||"","]]")}};on.forEach((function(e){sn[e[1]]=function(){return e[0]}})),sn.cr=sn.flagcountry,sn["cr-rt"]=sn.flagcountry,sn.cricon=sn.flagicon;var cn=sn,un=function(e){var t=e.match(/ipac?-(.+)/);return null!==t?!0===S.hasOwnProperty(t[1])?S[t[1]].english_title:t[1]:null},ln={ipa:function(e,t){var i=Ie(e,["transcription","lang","audio"]);return i.lang=un(i.template),i.template="ipa",t.push(i),""},ipac:function(e,t){var i=Ie(e);return i.transcription=(i.list||[]).join(","),delete i.list,i.lang=un(i.template),i.template="ipac",t.push(i),""},transl:function(e,t){var i=Ie(e,["lang","text","text2"]);return i.text2&&(i.iso=i.text,i.text=i.text2,delete i.text2),t.push(i),i.text||""}};Object.keys(S).forEach((function(e){ln["ipa-"+e]=ln.ipa,ln["ipac-"+e]=ln.ipac}));var pn=ln,mn={lang:1,"lang-de":0,"rtl-lang":1,taste:0,nihongo:function(e,t){var i=Ie(e,["english","kanji","romaji","extra"]);t.push(i);var n=i.english||i.romaji||"";return i.kanji&&(n+=" (".concat(i.kanji,")")),n}};Object.keys(S).forEach((function(e){mn["lang-"+e]=mn["lang-de"]})),mn.nihongo2=mn.nihongo,mn.nihongo3=mn.nihongo,mn["nihongo-s"]=mn.nihongo,mn["nihongo foot"]=mn.nihongo;var dn=mn,fn=function(e){if(!e.numerator&&!e.denominator)return null;var t=Number(e.numerator)/Number(e.denominator);t*=100;var i=Number(e.decimals);return isNaN(i)&&(i=1),t=t.toFixed(i),Number(t)},gn={math:function(e,t){var i=Ie(e,["formula"]);return t.push(i),"\n\n"+(i.formula||"")+"\n\n"},frac:function(e,t){var i=Ie(e,["a","b","c"]),n={template:"sfrac"};return i.c?(n.integer=i.a,n.numerator=i.b,n.denominator=i.c):i.b?(n.numerator=i.a,n.denominator=i.b):(n.numerator=1,n.denominator=i.a),t.push(n),n.integer?"".concat(n.integer," ").concat(n.numerator,"⁄").concat(n.denominator):"".concat(n.numerator,"⁄").concat(n.denominator)},radic:function(e){var t=Ie(e,["after","before"]);return"".concat(t.before||"","√").concat(t.after||"")},percentage:function(e){var t=Ie(e,["numerator","denominator","decimals"]),i=fn(t);return null===i?"":i+"%"},"percent-done":function(e){var t=Ie(e,["done","total","digits"]),i=fn({numerator:t.done,denominator:t.total,decimals:t.digits});return null===i?"":"".concat(t.done," (").concat(i,"%) done")},"winning percentage":function(e,t){var i=Ie(e,["wins","losses","ties"]);t.push(i);var n=Number(i.wins),a=Number(i.losses),r=Number(i.ties)||0,o=n+a+r;"y"===i.ignore_ties&&(r=0),r&&(n+=r/2);var s=fn({numerator:n,denominator:o,decimals:1});return null===s?"":".".concat(10*s)},winlosspct:function(e,t){var i=Ie(e,["wins","losses"]);t.push(i);var n=Number(i.wins),a=Number(i.losses),r=fn({numerator:n,denominator:n+a,decimals:1});return null===r?"":(r=".".concat(10*r),"".concat(n||0," || ").concat(a||0," || ").concat(r||"-"))}};gn.sfrac=gn.frac,gn.sqrt=gn.radic,gn.pct=gn.percentage,gn.percent=gn.percentage,gn.winpct=gn["winning percentage"],gn.winperc=gn["winning percentage"];var hn=gn,bn=function(e,t,i){var n=Ie(e);return i&&(n.name=n.template,n.template=i),t.push(n),""},kn={persondata:bn,taxobox:bn,citation:bn,portal:bn,reflist:bn,"cite book":bn,"cite journal":bn,"cite web":bn,"commons cat":bn,"portuguese name":["first","second","suffix"],uss:["ship","id"],isbn:function(e,t){var i=Ie(e,["id","id2","id3"]);return t.push(i),"ISBN: "+(i.id||"")},marriage:function(e,t){var i=Ie(e,["spouse","from","to","end"]);t.push(i);var n="".concat(i.spouse||"");return i.from&&(i.to?n+=" (m. ".concat(i.from,"-").concat(i.to,")"):n+=" (m. ".concat(i.from,")")),n},"based on":function(e,t){var i=Ie(e,["title","author"]);return t.push(i),"".concat(i.title," by ").concat(i.author||"")},"video game release":function(e,t){for(var i=["region","date","region2","date2","region3","date3","region4","date4"],n=Ie(e,i),a={template:"video game release",releases:[]},r=0;r0&&t.push(c),""},Yn=function(e){Object.defineProperty(this,"data",{enumerable:!1,value:e})},Zn={text:function(){return""},json:function(){return this.data}};Object.keys(Zn).forEach((function(e){Yn.prototype[e]=Zn[e]}));var Gn=Yn,Hn=new RegExp("^(cite |citation)","i"),Vn={citation:!0,refn:!0,harvnb:!0},Jn=function(e){return"infobox"===e.template&&e.data&&function(e){return e&&"[object Object]"===Object.prototype.toString.call(e)}(e.data)},Qn=function(e,t){var i=e.wiki,n=Jt(i),a=[];n.forEach((function(e){return function e(t,n){t.parent=n,t.children&&t.children.length>0&&t.children.forEach((function(i){return e(i,t)})),t.out=Wn(t,a);!function e(t,i,n){t.parent&&(t.parent.body=t.parent.body.replace(i,n),e(t.parent,i,n))}(t,t.body,t.out),i=i.replace(t.body,t.out)}(e,null)})),e.infoboxes=e.infoboxes||[],e.references=e.references||[],e.templates=e.templates||[],e.templates=e.templates.concat(a),e.templates=e.templates.filter((function(i){return!0===function(e){return!0===Vn[e.template]||!0===Hn.test(e.template)}(i)?(e.references.push(new Me(i)),!1):!0!==Jn(i)||(i.domain=t.domain,e.infoboxes.push(new Wt(i)),!1)})),e.templates=e.templates.map((function(e){return new Gn(e)})),n.forEach((function(e){i=i.replace(e.body,e.out)})),e.wiki=i},Xn=je,ea=function(e,t){var i=e.wiki;i=i.replace(/]*?)>([\s\S]+?)<\/gallery>/g,(function(i,n,a){var r=a.split(/\n/g);return(r=(r=r.filter((function(e){return e&&""!==e.trim()}))).map((function(e){var i=e.split(/\|/),n={file:i[0].trim(),lang:t.language,domain:t.domain},a=new $(n).json(),r=i.slice(1).join("|");return""!==r&&(a.caption=Xn(r)),a}))).length>0&&e.templates.push({template:"gallery",images:r,pos:e.title}),""})),e.wiki=i},ta=function(e){var t=e.wiki;t=t.replace(/\{\{election box begin([\s\S]+?)\{\{election box end\}\}/gi,(function(t){var i={wiki:t,templates:[]};Qn(i);var n=i.templates.map((function(e){return e.json()})),a=n.find((function(e){return"election box"===e.template}))||{},r=n.filter((function(e){return"election box candidate"===e.template})),o=n.find((function(e){return"election box gain"===e.template||"election box hold"===e.template}))||{};return(r.length>0||o)&&e.templates.push({template:"election box",title:a.title,candidates:r,summary:o.data}),""})),e.wiki=t},ia={coach:["team","year","g","w","l","w-l%","finish","pg","pw","pl","pw-l%"],player:["year","team","gp","gs","mpg","fg%","3p%","ft%","rpg","apg","spg","bpg","ppg"],roster:["player","gp","gs","mpg","fg%","3fg%","ft%","rpg","apg","spg","bpg","ppg"]},na=function(e){var t=e.wiki;t=t.replace(/\{\{nba (coach|player|roster) statistics start([\s\S]+?)\{\{s-end\}\}/gi,(function(t,i){t=(t=t.replace(/^\{\{.*?\}\}/,"")).replace(/\{\{s-end\}\}/,""),i=i.toLowerCase().trim();var n="! "+ia[i].join(" !! "),a=at("{|\n"+n+"\n"+t+"\n|}");return a=a.map((function(e){return Object.keys(e).forEach((function(t){e[t]=e[t].text()})),e})),e.templates.push({template:"NBA "+i+" statistics",data:a}),""})),e.wiki=t},aa=function(e){var t=e.wiki;t=t.replace(/\{\{mlb game log (section|month)[\s\S]+?\{\{mlb game log (section|month) end\}\}/gi,(function(t){var i=function(e){var t=["#","date","opponent","score","win","loss","save","attendance","record"];return!0===/\|stadium=y/i.test(e)&&t.splice(7,0,"stadium"),!0===/\|time=y/i.test(e)&&t.splice(7,0,"time"),!0===/\|box=y/i.test(e)&&t.push("box"),t}(t);t=(t=t.replace(/^\{\{.*?\}\}/,"")).replace(/\{\{mlb game log (section|month) end\}\}/i,"");var n="! "+i.join(" !! "),a=at("{|\n"+n+"\n"+t+"\n|}");return a=a.map((function(e){return Object.keys(e).forEach((function(t){e[t]=e[t].text()})),e})),e.templates.push({template:"mlb game log section",data:a}),""})),e.wiki=t},ra=["res","record","opponent","method","event","date","round","time","location","notes"],oa=function(e){var t=e.wiki;t=t.replace(/\{\{mma record start[\s\S]+?\{\{end\}\}/gi,(function(t){t=(t=t.replace(/^\{\{.*?\}\}/,"")).replace(/\{\{end\}\}/i,"");var i="! "+ra.join(" !! "),n=at("{|\n"+i+"\n"+t+"\n|}");return n=n.map((function(e){return Object.keys(e).forEach((function(t){e[t]=e[t].text()})),e})),e.templates.push({template:"mma record start",data:n}),""})),e.wiki=t},sa=je,ca=function(e){var t=e.wiki;t=(t=t.replace(/]*?)>([\s\S]+?)<\/math>/g,(function(t,i,n){var a=sa(n).text();return e.templates.push({template:"math",formula:a,raw:n}),a&&a.length<12?a:""}))).replace(/]*?)>([\s\S]+?)<\/chem>/g,(function(t,i,n){return e.templates.push({template:"chem",data:n}),""})),e.wiki=t},ua=function(e,t){ta(e),ea(e,t),ca(e),aa(e),oa(e),na(e)},la=new RegExp("^("+_.references.join("|")+"):?","i"),pa=/(?:\n|^)(={2,5}.{1,200}?={2,5})/g,ma={heading:Ze,table:mt,paragraphs:Rt,templates:Qn,references:Be,startEndTemplates:ua},da=function(e,t){return ma.startEndTemplates(e,t),ma.references(e),ma.templates(e,t),ma.table(e),ma.paragraphs(e,t),e=new ie(e)},fa=function(e){for(var t=[],i=e.wiki.split(pa),n=0;n0||(t.templates().length>0||(e[i+1]&&e[i+1].depth>t.depth&&(e[i+1].depth-=1),!1)))}))}(t)},ga=new RegExp("\\[\\[:?("+_.categories.join("|")+"):(.{2,178}?)]](w{0,10})","ig"),ha=new RegExp("^\\[\\[:?("+_.categories.join("|")+"):","ig"),ba={section:fa,categories:function(e){var t=e.wiki,i=t.match(ga);i&&i.forEach((function(t){(t=(t=(t=t.replace(ha,"")).replace(/\|?[ \*]?\]\]$/i,"")).replace(/\|.*/,""))&&!t.match(/[\[\]]/)&&e.categories.push(t.trim())})),t=t.replace(ga,""),e.wiki=t}},ka=function(e,t){t=t||{};var i=Object.assign(t,{title:t.title||null,pageID:t.pageID||t.id||null,namespace:t.namespace||t.ns||null,type:"page",wiki:e||"",categories:[],sections:[],coordinates:[]});return!0===R(e)?(i.type="redirect",i.redirectTo=U(e),ba.categories(i),new O(i)):(Z(i),ba.categories(i),ba.section(i),new O(i))},wa=function(e){var t=(e=e.filter((function(e){return e}))).map((function(e){return ka(e.wiki,e.meta)}));return 0===t.length?null:1===t.length?t[0]:t},va=function(e,t){return fetch(e,t).then((function(e){return e.json()}))},ya=function(e){var t=e.userAgent||e["User-Agent"]||e["Api-User-Agent"]||"User of the wtf_wikipedia library";return{method:"GET",headers:{"Content-Type":"application/json","Api-User-Agent":t,"User-Agent":t,Origin:"*"},redirect:"follow"}},xa=/^https?:\/\//,$a={lang:"en",wiki:"wikipedia",domain:null,follow_redirects:!0,path:"api.php"},ja=function(t,i,n){var a=null;"function"==typeof i&&(a=i,i={}),"function"==typeof n&&(a=n,n={}),"string"==typeof i&&(n=n||{},i=Object.assign({},{lang:i},n)),i=i||{},(i=Object.assign({},$a,i)).title=t,xa.test(t)&&(i=Object.assign(i,e(t)));var r=c(i),o=ya(i);return va(r,o).then((function(e){try{var t=u(e,i);return t=wa(t),a&&a(null,t),t}catch(e){throw e}})).catch((function(e){return console.error(e),a&&a(e,null),null}))},za={lang:"en",wiki:"wikipedia",domain:null,path:"w/api.php"},Ea=function(e,t){var i;t=t||{},t=Object.assign({},za,t),"string"==typeof e?t.lang=e:(i=e)&&"[object Object]"===Object.prototype.toString.call(i)&&(t=Object.assign(t,e));var n="https://".concat(t.lang,".wikipedia.org/").concat(t.path,"?");t.domain&&(n="https://".concat(t.domain,"/").concat(t.path,"?")),n+="format=json&action=query&generator=random&grnnamespace=0&prop=revisions|pageprops&rvprop=content&grnlimit=1&rvslots=main&origin=*";var a=ya(t);return va(n,a).then((function(e){try{var t=u(e);return wa(t)}catch(e){throw e}})).catch((function(e){return console.error(e),null}))},Oa={lang:"en",wiki:"wikipedia",domain:null,path:"w/api.php"},_a=function(e,t,i){var n;i=i||{},i=Object.assign({},Oa,i),"string"==typeof t?i.lang=t:(n=t)&&"[object Object]"===Object.prototype.toString.call(n)&&(i=Object.assign(i,t));var a={pages:[],categories:[]};return new Promise((function(t,n){!function r(o){var s=function(e,t,i){e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!1===/^Category/i.test(e)&&(e="Category:"+e),e=e.replace(/ /g,"_")}(e),e=encodeURIComponent(e);var n="https://".concat(t.lang,".wikipedia.org/").concat(t.path,"?");return t.domain&&(n="https://".concat(t.domain,"/").concat(t.path,"?")),n+="action=query&list=categorymembers&cmtitle=".concat(e,"&cmlimit=500&format=json&origin=*&redirects=true&cmtype=page|subcat"),i&&(n+="&cmcontinue="+i),n}(e,i,o),c=ya(i);return va(s,c).then((function(e){a=function(e){var t=e.query.categorymembers||[],i={pages:[],categories:[]};return t.forEach((function(e){14===e.ns?(delete e.ns,i.categories.push(e)):(delete e.ns,i.pages.push(e))})),i}(e),e.continue&&e.continue.cmcontinue?r(e.continue.cmcontinue):t(a)})).catch((function(e){console.error(e),n(e)}))}(null)}))},Sa=function(e,t){return ka(e,t)},Ca={Doc:O,Section:ie,Paragraph:kt,Sentence:ge,Image:$,Infobox:Wt,Link:se,List:St,Reference:Me,Table:ut,Template:Gn,http:va,wtf:Sa};Sa.fetch=function(e,t,i,n){return ja(e,t,i)},Sa.random=function(e,t,i){return Ea(e,t)},Sa.category=function(e,t,i,n){return _a(e,t,i)},Sa.extend=function(e){return e(Ca,Fn,this),this},Sa.version="8.4.0";var qa=Sa;export default qa; diff --git a/builds/wtf_wikipedia.js b/builds/wtf_wikipedia.js index d888b32d..af3ba2f6 100644 --- a/builds/wtf_wikipedia.js +++ b/builds/wtf_wikipedia.js @@ -1,4 +1,4 @@ -/* wtf_wikipedia 8.3.0 MIT */ +/* wtf_wikipedia 8.4.0 MIT */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('https')) : typeof define === 'function' && define.amd ? define(['https'], factory) : @@ -76,7 +76,7 @@ if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; - if (n === "Map" || n === "Set") return Array.from(n); + if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } @@ -95,7 +95,7 @@ var isInterWiki = /(wiktionary|wikinews|wikibooks|wikiquote|wikisource|wikispecies|wikiversity|wikivoyage|wikipedia|wikimedia|foundation|meta)\.org/; var defaults = { action: 'query', - prop: 'revisions', + prop: 'revisions|pageprops', //we use the 'revisions' api here, instead of the Raw api, for its CORS-rules.. rvprop: 'content', maxlag: 5, @@ -187,10 +187,20 @@ text = page.revisions[0].slots.main['*']; } + page.pageprops = page.pageprops || {}; + var domain = options.domain; + + if (!domain && options.wiki) { + domain = "".concat(options.wiki, ".org"); + } + var meta = Object.assign({}, options, { title: page.title, pageID: page.pageid, - namespace: page.ns + namespace: page.ns, + domain: domain, + wikidata: page.pageprops.wikibase_item, + description: page.pageprops['wikibase-shortdesc'] }); try { @@ -555,7 +565,7 @@ var toJson_1 = toJson$1; - var server = 'https://wikipedia.org/wiki/Special:Redirect/file/'; + var server = 'wikipedia.org'; var encodeTitle = function encodeTitle(file) { var title = file.replace(/^(image|file?)\:/i, ''); //titlecase it @@ -606,12 +616,15 @@ return []; }, url: function url() { - return server + makeSrc(this.file()); + // let lang = 'en' //this.language() || 'en' //hmm: get actual language? + var fileName = makeSrc(this.file()); + var domain = this.data.domain || server; + var path = "wiki/Special:Redirect/file"; + return "https://".concat(domain, "/").concat(path, "/").concat(fileName); }, thumbnail: function thumbnail(size) { size = size || 300; - var path = makeSrc(this.file()); - return server + path + '?width=' + size; + return this.url() + '?width=' + size; }, format: function format() { var arr = this.file().split('.'); @@ -680,6 +693,20 @@ return this.data.pageID; }, + wikidata: function wikidata(id) { + if (id !== undefined) { + this.data.wikidata = id; + } + + return this.data.wikidata; + }, + domain: function domain(str) { + if (str !== undefined) { + this.data.domain = str; + } + + return this.data.domain; + }, language: function language(lang) { if (lang !== undefined) { this.data.lang = lang; @@ -695,7 +722,7 @@ } var lang = this.language() || 'en'; - var domain = this.data.domain || 'wikipedia.org'; // replace blank to underscore + var domain = this.domain() || 'wikipedia.org'; // replace blank to underscore title = title.replace(/ /g, '_'); title = encodeURIComponent(title); @@ -782,6 +809,8 @@ return this.sentences(0); }, images: function images(clue) { + var _this2 = this; + var arr = _sectionMap(this, 'images', null); //grab image from infobox, first this.infoboxes().forEach(function (info) { @@ -797,6 +826,8 @@ obj.images = obj.images || []; obj.images.forEach(function (img) { if (img instanceof Image_1 === false) { + img.language = _this2.language(); + img.domain = _this2.domain(); img = new Image_1(img); } @@ -2173,7 +2204,7 @@ var ignore_links = /^:?(category|catégorie|Kategorie|Categoría|Categoria|Categorie|Kategoria|تصنيف|image|file|image|fichier|datei|media):/i; var external_link = /\[(https?|news|ftp|mailto|gopher|irc)(:\/\/[^\]\| ]{4,1500})([\| ].*?)?\]/g; - var link_reg = /\[\[(.{0,160}?)\]\]([a-z]+)?(\w{0,10})/gi; //allow dangling suffixes - "[[flanders]]s" + var link_reg = /\[\[(.{0,160}?)\]\]([a-z]+)?/gi; //allow dangling suffixes - "[[flanders]]s" var external_links = function external_links(links, str) { str.replace(external_link, function (raw, protocol, link, text) { @@ -2325,11 +2356,17 @@ //only kill ref tags if they are selfclosing wiki = wiki.replace(/ ?< ?(ref) [a-zA-Z0-9=" ]{2,100}\/ ?> ?/g, ' '); // - //some formatting xml, we'll keep their insides though + // convert these html tags to known formatting + + wiki = wiki.replace(/(.*?)<\/i>/g, "''$1''"); + wiki = wiki.replace(/(.*?)<\/b>/g, "'''$1'''"); // these are better-handled with templates + + wiki = wiki.replace(/(.*?)<\/sub>/g, "{{sub|$1}}"); + wiki = wiki.replace(/(.*?)<\/sup>/g, "{{sup|$1}}"); //some formatting xml, we'll keep their insides though wiki = wiki.replace(/ ?<[ \/]?(p|sub|sup|span|nowiki|div|table|br|tr|td|th|pre|pre2|hr)[ \/]?> ?/g, ' '); //, - wiki = wiki.replace(/ ?<[ \/]?(abbr|bdi|bdo|blockquote|cite|del|dfn|em|i|ins|kbd|mark|q|s|small)[ \/]?> ?/g, ' '); //, + wiki = wiki.replace(/ ?<[ \/]?(abbr|bdi|bdo|blockquote|cite|del|dfn|em|ins|kbd|mark|q|s|small)[ \/]?> ?/g, ' '); //, wiki = wiki.replace(/ ?<[ \/]?h[0-9][ \/]?> ?/g, ' '); //

,

@@ -4356,7 +4393,7 @@ "super": true }; //images are usually [[image:my_pic.jpg]] - var oneImage = function oneImage(img) { + var oneImage = function oneImage(img, doc) { var m = img.match(file_reg); if (m === null || !m[2]) { @@ -4372,7 +4409,9 @@ if (title) { var obj = { - file: file + file: file, + lang: doc.lang, + domain: doc.domain }; //try to grab other metadata, too img = img.replace(/^\[\[/, ''); @@ -4395,20 +4434,20 @@ obj.caption = parseSentence$4(arr[arr.length - 1]); } - return new Image_1(obj, img); + return new Image_1(obj); } return null; }; - var parseImages = function parseImages(paragraph) { + var parseImages = function parseImages(paragraph, doc) { var wiki = paragraph.wiki; //parse+remove scary '[[ [[]] ]]' stuff var matches = nested_find_1(wiki); matches.forEach(function (s) { if (isFile.test(s) === true) { paragraph.images = paragraph.images || []; - var img = oneImage(s); + var img = oneImage(s, doc); if (img) { paragraph.images.push(img); @@ -4565,7 +4604,7 @@ list: list }; - var parseParagraphs = function parseParagraphs(section) { + var parseParagraphs = function parseParagraphs(section, doc) { var wiki = section.wiki; var paragraphs = wiki.split(twoNewLines); //don't create empty paragraphs @@ -4582,7 +4621,7 @@ parse$5.list(paragraph); // parse images - parse$5.image(paragraph); //parse the sentences + parse$5.image(paragraph, doc); //parse the sentences parseSentences(paragraph); return new Paragraph_1(paragraph); @@ -4620,6 +4659,7 @@ var Infobox = function Infobox(obj) { this._type = obj.type; + this.domain = obj.domain; Object.defineProperty(this, 'data', { enumerable: false, value: obj.data @@ -4664,6 +4704,8 @@ var obj = s.json(); obj.file = obj.text; obj.text = ''; + obj.domain = this.domain; // add domain information for image + return new Image_1(obj); }, get: function get() { @@ -5724,6 +5766,18 @@ } return str; + }, + //https://en.wikipedia.org/wiki/Template:Sub + sub: function sub(tmpl, list) { + var obj = parse$3(tmpl, ['text']); + list.push(obj); + return obj.text || ''; + }, + //https://en.wikipedia.org/wiki/Template:Sup + sup: function sup(tmpl, list) { + var obj = parse$3(tmpl, ['text']); + list.push(obj); + return obj.text || ''; } }; //aliases @@ -6346,19 +6400,19 @@ return ''; }, // https://en.wikipedia.org/wiki/Template:See - 'see': function see(tmpl, list) { + see: function see(tmpl, list) { var obj = parse$3(tmpl); list.push(obj); return ''; }, // https://en.wikipedia.org/wiki/Template:For - 'for': function _for(tmpl, list) { + "for": function _for(tmpl, list) { var obj = parse$3(tmpl); list.push(obj); return ''; }, // https://en.wikipedia.org/wiki/Template:Further - 'further': function further(tmpl, list) { + further: function further(tmpl, list) { var obj = parse$3(tmpl); list.push(obj); return ''; @@ -6370,7 +6424,7 @@ return ''; }, // https://en.wikipedia.org/wiki/Template:Listen - 'listen': function listen(tmpl, list) { + listen: function listen(tmpl, list) { var obj = parse$3(tmpl); list.push(obj); return ''; @@ -6474,7 +6528,8 @@ images = images.map(function (file) { var img = { file: file - }; + }; // TODO: add lang and domain information + return new Image_1(img).json(); }); obj = { @@ -6604,7 +6659,7 @@ }; //a bunch of aliases for these ones: // https://en.wikipedia.org/wiki/Category:Tournament_bracket_templates - var brackets = ['2teambracket', '4team2elimbracket', '8teambracket', '16teambracket', '32teambracket', 'cwsbracket', 'nhlbracket', 'nhlbracket-reseed', '4teambracket-nhl', '4teambracket-ncaa', '4teambracket-mma', '4teambracket-mlb', '8teambracket-nhl', '8teambracket-mlb', '8teambracket-ncaa', '8teambracket-afc', '8teambracket-afl', '8teambracket-tennis3', '8teambracket-tennis5', '16teambracket-nhl', '16teambracket-nhl divisional', '16teambracket-nhl-reseed', '16teambracket-nba', '16teambracket-swtc', '16teambracket-afc', '16teambracket-tennis3', '16teambracket-tennis5']; + var brackets = ['2teambracket', '4team2elimbracket', '8teambracket', '16teambracket', '32teambracket', '4roundbracket-byes', 'cwsbracket', 'nhlbracket', 'nhlbracket-reseed', '4teambracket-nhl', '4teambracket-ncaa', '4teambracket-mma', '4teambracket-mlb', '16teambracket-two-reseeds', '8teambracket-nhl', '8teambracket-mlb', '8teambracket-ncaa', '8teambracket-afc', '8teambracket-afl', '8teambracket-tennis3', '8teambracket-tennis5', '16teambracket-nhl', '16teambracket-nhl divisional', '16teambracket-nhl-reseed', '16teambracket-nba', '16teambracket-swtc', '16teambracket-afc', '16teambracket-tennis3', '16teambracket-tennis5']; brackets.forEach(function (key) { all[key] = all['4teambracket']; }); @@ -8176,7 +8231,7 @@ }; //reduce the scary recursive situations - var allTemplates = function allTemplates(section) { + var allTemplates = function allTemplates(section, doc) { var wiki = section.wiki; // nested data-structure of templates var list = find(wiki); @@ -8221,6 +8276,8 @@ } if (isInfobox$1(obj) === true) { + obj.domain = doc.domain; // + section.infoboxes.push(new Infobox_1(obj)); return false; } @@ -8243,7 +8300,7 @@ //all deities help us. truly -> https://en.wikipedia.org/wiki/Help:Gallery_tag // - not to be confused with https://en.wikipedia.org/wiki/Template:Gallery... - var parseGallery = function parseGallery(section) { + var parseGallery = function parseGallery(section, doc) { var wiki = section.wiki; wiki = wiki.replace(/]*?)>([\s\S]+?)<\/gallery>/g, function (_, attrs, inside) { var images = inside.split(/\n/g); @@ -8254,7 +8311,9 @@ images = images.map(function (str) { var arr = str.split(/\|/); var obj = { - file: arr[0].trim() + file: arr[0].trim(), + lang: doc.language, + domain: doc.domain }; var img = new Image_1(obj).json(); var caption = arr.slice(1).join('|'); @@ -8464,9 +8523,9 @@ // ... others are {{start}}...{{end}} // -> these are those ones. - var xmlTemplates = function xmlTemplates(section) { + var xmlTemplates = function xmlTemplates(section, doc) { election(section); - gallery(section); + gallery(section, doc); math$1(section); mlb(section); mma(section); @@ -8488,11 +8547,11 @@ }; var oneSection = function oneSection(section, doc) { - parse$6.startEndTemplates(section); //parse-out the tags + parse$6.startEndTemplates(section, doc); //parse-out the tags parse$6.references(section); //parse-out all {{templates}} - parse$6.templates(section); // //parse the tables + parse$6.templates(section, doc); // //parse the tables parse$6.table(section); //now parse all double-newlines @@ -8782,7 +8841,7 @@ url = "https://".concat(options.domain, "/").concat(options.path, "?"); } - url += "format=json&action=query&generator=random&grnnamespace=0&prop=revisions&rvprop=content&grnlimit=1&rvslots=main&origin=*"; + url += "format=json&action=query&generator=random&grnnamespace=0&prop=revisions|pageprops&rvprop=content&grnlimit=1&rvslots=main&origin=*"; var headers = _headers(options); return server$1(url, headers).then(function (res) { try { @@ -8897,7 +8956,7 @@ var category = fetchCategory; - var _version = '8.3.0'; + var _version = '8.4.0'; var wtf = function wtf(wiki, options) { return _01Document(wiki, options); diff --git a/builds/wtf_wikipedia.mjs b/builds/wtf_wikipedia.mjs index c2185237..1aaef2b1 100644 --- a/builds/wtf_wikipedia.mjs +++ b/builds/wtf_wikipedia.mjs @@ -1,4 +1,4 @@ -/* wtf_wikipedia 8.3.0 MIT */ +/* wtf_wikipedia 8.4.0 MIT */ import https from 'https'; var parseUrl = function parseUrl(url) { @@ -70,7 +70,7 @@ function _unsupportedIterableToArray(o, minLen) { if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; - if (n === "Map" || n === "Set") return Array.from(n); + if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } @@ -89,7 +89,7 @@ function _nonIterableRest() { var isInterWiki = /(wiktionary|wikinews|wikibooks|wikiquote|wikisource|wikispecies|wikiversity|wikivoyage|wikipedia|wikimedia|foundation|meta)\.org/; var defaults = { action: 'query', - prop: 'revisions', + prop: 'revisions|pageprops', //we use the 'revisions' api here, instead of the Raw api, for its CORS-rules.. rvprop: 'content', maxlag: 5, @@ -181,10 +181,20 @@ var getResult = function getResult(data, options) { text = page.revisions[0].slots.main['*']; } + page.pageprops = page.pageprops || {}; + var domain = options.domain; + + if (!domain && options.wiki) { + domain = "".concat(options.wiki, ".org"); + } + var meta = Object.assign({}, options, { title: page.title, pageID: page.pageid, - namespace: page.ns + namespace: page.ns, + domain: domain, + wikidata: page.pageprops.wikibase_item, + description: page.pageprops['wikibase-shortdesc'] }); try { @@ -549,7 +559,7 @@ var toJson$1 = function toJson(img, options) { var toJson_1 = toJson$1; -var server = 'https://wikipedia.org/wiki/Special:Redirect/file/'; +var server = 'wikipedia.org'; var encodeTitle = function encodeTitle(file) { var title = file.replace(/^(image|file?)\:/i, ''); //titlecase it @@ -600,12 +610,15 @@ var methods = { return []; }, url: function url() { - return server + makeSrc(this.file()); + // let lang = 'en' //this.language() || 'en' //hmm: get actual language? + var fileName = makeSrc(this.file()); + var domain = this.data.domain || server; + var path = "wiki/Special:Redirect/file"; + return "https://".concat(domain, "/").concat(path, "/").concat(fileName); }, thumbnail: function thumbnail(size) { size = size || 300; - var path = makeSrc(this.file()); - return server + path + '?width=' + size; + return this.url() + '?width=' + size; }, format: function format() { var arr = this.file().split('.'); @@ -674,6 +687,20 @@ var methods$1 = { return this.data.pageID; }, + wikidata: function wikidata(id) { + if (id !== undefined) { + this.data.wikidata = id; + } + + return this.data.wikidata; + }, + domain: function domain(str) { + if (str !== undefined) { + this.data.domain = str; + } + + return this.data.domain; + }, language: function language(lang) { if (lang !== undefined) { this.data.lang = lang; @@ -689,7 +716,7 @@ var methods$1 = { } var lang = this.language() || 'en'; - var domain = this.data.domain || 'wikipedia.org'; // replace blank to underscore + var domain = this.domain() || 'wikipedia.org'; // replace blank to underscore title = title.replace(/ /g, '_'); title = encodeURIComponent(title); @@ -776,6 +803,8 @@ var methods$1 = { return this.sentences(0); }, images: function images(clue) { + var _this2 = this; + var arr = _sectionMap(this, 'images', null); //grab image from infobox, first this.infoboxes().forEach(function (info) { @@ -791,6 +820,8 @@ var methods$1 = { obj.images = obj.images || []; obj.images.forEach(function (img) { if (img instanceof Image_1 === false) { + img.language = _this2.language(); + img.domain = _this2.domain(); img = new Image_1(img); } @@ -2167,7 +2198,7 @@ var interwiki$1 = parseInterwiki; var ignore_links = /^:?(category|catégorie|Kategorie|Categoría|Categoria|Categorie|Kategoria|تصنيف|image|file|image|fichier|datei|media):/i; var external_link = /\[(https?|news|ftp|mailto|gopher|irc)(:\/\/[^\]\| ]{4,1500})([\| ].*?)?\]/g; -var link_reg = /\[\[(.{0,160}?)\]\]([a-z]+)?(\w{0,10})/gi; //allow dangling suffixes - "[[flanders]]s" +var link_reg = /\[\[(.{0,160}?)\]\]([a-z]+)?/gi; //allow dangling suffixes - "[[flanders]]s" var external_links = function external_links(links, str) { str.replace(external_link, function (raw, protocol, link, text) { @@ -2319,11 +2350,17 @@ var kill_xml = function kill_xml(wiki) { //only kill ref tags if they are selfclosing wiki = wiki.replace(/ ?< ?(ref) [a-zA-Z0-9=" ]{2,100}\/ ?> ?/g, ' '); // - //some formatting xml, we'll keep their insides though + // convert these html tags to known formatting + + wiki = wiki.replace(/(.*?)<\/i>/g, "''$1''"); + wiki = wiki.replace(/(.*?)<\/b>/g, "'''$1'''"); // these are better-handled with templates + + wiki = wiki.replace(/(.*?)<\/sub>/g, "{{sub|$1}}"); + wiki = wiki.replace(/(.*?)<\/sup>/g, "{{sup|$1}}"); //some formatting xml, we'll keep their insides though wiki = wiki.replace(/ ?<[ \/]?(p|sub|sup|span|nowiki|div|table|br|tr|td|th|pre|pre2|hr)[ \/]?> ?/g, ' '); //, - wiki = wiki.replace(/ ?<[ \/]?(abbr|bdi|bdo|blockquote|cite|del|dfn|em|i|ins|kbd|mark|q|s|small)[ \/]?> ?/g, ' '); //, + wiki = wiki.replace(/ ?<[ \/]?(abbr|bdi|bdo|blockquote|cite|del|dfn|em|ins|kbd|mark|q|s|small)[ \/]?> ?/g, ' '); //, wiki = wiki.replace(/ ?<[ \/]?h[0-9][ \/]?> ?/g, ' '); //

,

@@ -4350,7 +4387,7 @@ var imgLayouts = { "super": true }; //images are usually [[image:my_pic.jpg]] -var oneImage = function oneImage(img) { +var oneImage = function oneImage(img, doc) { var m = img.match(file_reg); if (m === null || !m[2]) { @@ -4366,7 +4403,9 @@ var oneImage = function oneImage(img) { if (title) { var obj = { - file: file + file: file, + lang: doc.lang, + domain: doc.domain }; //try to grab other metadata, too img = img.replace(/^\[\[/, ''); @@ -4389,20 +4428,20 @@ var oneImage = function oneImage(img) { obj.caption = parseSentence$4(arr[arr.length - 1]); } - return new Image_1(obj, img); + return new Image_1(obj); } return null; }; -var parseImages = function parseImages(paragraph) { +var parseImages = function parseImages(paragraph, doc) { var wiki = paragraph.wiki; //parse+remove scary '[[ [[]] ]]' stuff var matches = nested_find_1(wiki); matches.forEach(function (s) { if (isFile.test(s) === true) { paragraph.images = paragraph.images || []; - var img = oneImage(s); + var img = oneImage(s, doc); if (img) { paragraph.images.push(img); @@ -4559,7 +4598,7 @@ var parse$5 = { list: list }; -var parseParagraphs = function parseParagraphs(section) { +var parseParagraphs = function parseParagraphs(section, doc) { var wiki = section.wiki; var paragraphs = wiki.split(twoNewLines); //don't create empty paragraphs @@ -4576,7 +4615,7 @@ var parseParagraphs = function parseParagraphs(section) { parse$5.list(paragraph); // parse images - parse$5.image(paragraph); //parse the sentences + parse$5.image(paragraph, doc); //parse the sentences parseSentences(paragraph); return new Paragraph_1(paragraph); @@ -4614,6 +4653,7 @@ var normalize = function normalize(str) { var Infobox = function Infobox(obj) { this._type = obj.type; + this.domain = obj.domain; Object.defineProperty(this, 'data', { enumerable: false, value: obj.data @@ -4658,6 +4698,8 @@ var methods$9 = { var obj = s.json(); obj.file = obj.text; obj.text = ''; + obj.domain = this.domain; // add domain information for image + return new Image_1(obj); }, get: function get() { @@ -5718,6 +5760,18 @@ var templates = { } return str; + }, + //https://en.wikipedia.org/wiki/Template:Sub + sub: function sub(tmpl, list) { + var obj = parse$3(tmpl, ['text']); + list.push(obj); + return obj.text || ''; + }, + //https://en.wikipedia.org/wiki/Template:Sup + sup: function sup(tmpl, list) { + var obj = parse$3(tmpl, ['text']); + list.push(obj); + return obj.text || ''; } }; //aliases @@ -6340,19 +6394,19 @@ var parsers$1 = { return ''; }, // https://en.wikipedia.org/wiki/Template:See - 'see': function see(tmpl, list) { + see: function see(tmpl, list) { var obj = parse$3(tmpl); list.push(obj); return ''; }, // https://en.wikipedia.org/wiki/Template:For - 'for': function _for(tmpl, list) { + "for": function _for(tmpl, list) { var obj = parse$3(tmpl); list.push(obj); return ''; }, // https://en.wikipedia.org/wiki/Template:Further - 'further': function further(tmpl, list) { + further: function further(tmpl, list) { var obj = parse$3(tmpl); list.push(obj); return ''; @@ -6364,7 +6418,7 @@ var parsers$1 = { return ''; }, // https://en.wikipedia.org/wiki/Template:Listen - 'listen': function listen(tmpl, list) { + listen: function listen(tmpl, list) { var obj = parse$3(tmpl); list.push(obj); return ''; @@ -6468,7 +6522,8 @@ var parsers$1 = { images = images.map(function (file) { var img = { file: file - }; + }; // TODO: add lang and domain information + return new Image_1(img).json(); }); obj = { @@ -6598,7 +6653,7 @@ var all = { }; //a bunch of aliases for these ones: // https://en.wikipedia.org/wiki/Category:Tournament_bracket_templates -var brackets = ['2teambracket', '4team2elimbracket', '8teambracket', '16teambracket', '32teambracket', 'cwsbracket', 'nhlbracket', 'nhlbracket-reseed', '4teambracket-nhl', '4teambracket-ncaa', '4teambracket-mma', '4teambracket-mlb', '8teambracket-nhl', '8teambracket-mlb', '8teambracket-ncaa', '8teambracket-afc', '8teambracket-afl', '8teambracket-tennis3', '8teambracket-tennis5', '16teambracket-nhl', '16teambracket-nhl divisional', '16teambracket-nhl-reseed', '16teambracket-nba', '16teambracket-swtc', '16teambracket-afc', '16teambracket-tennis3', '16teambracket-tennis5']; +var brackets = ['2teambracket', '4team2elimbracket', '8teambracket', '16teambracket', '32teambracket', '4roundbracket-byes', 'cwsbracket', 'nhlbracket', 'nhlbracket-reseed', '4teambracket-nhl', '4teambracket-ncaa', '4teambracket-mma', '4teambracket-mlb', '16teambracket-two-reseeds', '8teambracket-nhl', '8teambracket-mlb', '8teambracket-ncaa', '8teambracket-afc', '8teambracket-afl', '8teambracket-tennis3', '8teambracket-tennis5', '16teambracket-nhl', '16teambracket-nhl divisional', '16teambracket-nhl-reseed', '16teambracket-nba', '16teambracket-swtc', '16teambracket-afc', '16teambracket-tennis3', '16teambracket-tennis5']; brackets.forEach(function (key) { all[key] = all['4teambracket']; }); @@ -8170,7 +8225,7 @@ var isInfobox$1 = function isInfobox(obj) { }; //reduce the scary recursive situations -var allTemplates = function allTemplates(section) { +var allTemplates = function allTemplates(section, doc) { var wiki = section.wiki; // nested data-structure of templates var list = find(wiki); @@ -8215,6 +8270,8 @@ var allTemplates = function allTemplates(section) { } if (isInfobox$1(obj) === true) { + obj.domain = doc.domain; // + section.infoboxes.push(new Infobox_1(obj)); return false; } @@ -8237,7 +8294,7 @@ var parseSentence$6 = _04Sentence.fromText; //okay, is a xml-tag, with //all deities help us. truly -> https://en.wikipedia.org/wiki/Help:Gallery_tag // - not to be confused with https://en.wikipedia.org/wiki/Template:Gallery... -var parseGallery = function parseGallery(section) { +var parseGallery = function parseGallery(section, doc) { var wiki = section.wiki; wiki = wiki.replace(/]*?)>([\s\S]+?)<\/gallery>/g, function (_, attrs, inside) { var images = inside.split(/\n/g); @@ -8248,7 +8305,9 @@ var parseGallery = function parseGallery(section) { images = images.map(function (str) { var arr = str.split(/\|/); var obj = { - file: arr[0].trim() + file: arr[0].trim(), + lang: doc.language, + domain: doc.domain }; var img = new Image_1(obj).json(); var caption = arr.slice(1).join('|'); @@ -8458,9 +8517,9 @@ var math$1 = parseMath; // ... others are {{start}}...{{end}} // -> these are those ones. -var xmlTemplates = function xmlTemplates(section) { +var xmlTemplates = function xmlTemplates(section, doc) { election(section); - gallery(section); + gallery(section, doc); math$1(section); mlb(section); mma(section); @@ -8482,11 +8541,11 @@ var parse$6 = { }; var oneSection = function oneSection(section, doc) { - parse$6.startEndTemplates(section); //parse-out the tags + parse$6.startEndTemplates(section, doc); //parse-out the tags parse$6.references(section); //parse-out all {{templates}} - parse$6.templates(section); // //parse the tables + parse$6.templates(section, doc); // //parse the tables parse$6.table(section); //now parse all double-newlines @@ -8776,7 +8835,7 @@ var fetchRandom = function fetchRandom(lang, options) { url = "https://".concat(options.domain, "/").concat(options.path, "?"); } - url += "format=json&action=query&generator=random&grnnamespace=0&prop=revisions&rvprop=content&grnlimit=1&rvslots=main&origin=*"; + url += "format=json&action=query&generator=random&grnnamespace=0&prop=revisions|pageprops&rvprop=content&grnlimit=1&rvslots=main&origin=*"; var headers = _headers(options); return server$1(url, headers).then(function (res) { try { @@ -8891,7 +8950,7 @@ var fetchCategory = function fetchCategory(category, lang, options) { var category = fetchCategory; -var _version = '8.3.0'; +var _version = '8.4.0'; var wtf = function wtf(wiki, options) { return _01Document(wiki, options); diff --git a/changelog.md b/changelog.md index 75b7c695..de55e150 100644 --- a/changelog.md +++ b/changelog.md @@ -2,6 +2,15 @@ #### [unreleased] +#### 8.4.0 + +- new `wikidata()` method +- new `domain()` method +- support image urls from 3rd-party wikis +- support for some html formatting tags \#374 +- support for sub and sup templates +- [fix] for link-parsing bug \#375 + ### 8.3.0 - adds some wikivoyage templates diff --git a/package-lock.json b/package-lock.json index c064d516..8d410b72 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,43 +1,43 @@ { "name": "wtf_wikipedia", - "version": "8.2.1", + "version": "8.3.0", "lockfileVersion": 1, "requires": true, "dependencies": { "@babel/code-frame": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz", - "integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz", + "integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==", "dev": true, "requires": { - "@babel/highlight": "^7.8.3" + "@babel/highlight": "^7.10.4" } }, "@babel/compat-data": { - "version": "7.9.0", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.9.0.tgz", - "integrity": "sha512-zeFQrr+284Ekvd9e7KAX954LkapWiOmQtsfHirhxqfdlX6MEC32iRE+pqUGlYIBchdevaCwvzxWGSy/YBNI85g==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.10.4.tgz", + "integrity": "sha512-t+rjExOrSVvjQQXNp5zAIYDp00KjdvGl/TpDX5REPr0S9IAIPQMTilcfG6q8c0QFmj9lSTVySV2VTsyggvtNIw==", "dev": true, "requires": { - "browserslist": "^4.9.1", + "browserslist": "^4.12.0", "invariant": "^2.2.4", "semver": "^5.5.0" } }, "@babel/core": { - "version": "7.9.0", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.9.0.tgz", - "integrity": "sha512-kWc7L0fw1xwvI0zi8OKVBuxRVefwGOrKSQMvrQ3dW+bIIavBY3/NpXmpjMy7bQnLgwgzWQZ8TlM57YHpHNHz4w==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.8.3", - "@babel/generator": "^7.9.0", - "@babel/helper-module-transforms": "^7.9.0", - "@babel/helpers": "^7.9.0", - "@babel/parser": "^7.9.0", - "@babel/template": "^7.8.6", - "@babel/traverse": "^7.9.0", - "@babel/types": "^7.9.0", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.10.4.tgz", + "integrity": "sha512-3A0tS0HWpy4XujGc7QtOIHTeNwUgWaZc/WuS5YQrfhU67jnVmsD6OGPc1AKHH0LJHQICGncy3+YUjIhVlfDdcA==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.10.4", + "@babel/generator": "^7.10.4", + "@babel/helper-module-transforms": "^7.10.4", + "@babel/helpers": "^7.10.4", + "@babel/parser": "^7.10.4", + "@babel/template": "^7.10.4", + "@babel/traverse": "^7.10.4", + "@babel/types": "^7.10.4", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.1", @@ -49,12 +49,12 @@ }, "dependencies": { "@babel/types": { - "version": "7.9.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.0.tgz", - "integrity": "sha512-BS9JKfXkzzJl8RluW4JGknzpiUV7ZrvTayM6yfqLTVBEnFtyowVIOu6rqxRd5cVO6yGoWf4T8u8dgK9oB+GCng==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.4.tgz", + "integrity": "sha512-UTCFOxC3FsFHb7lkRMVvgLzaRVamXuAs2Tz4wajva4WxtVY82eZeaUBtC2Zt95FU9TiznuC0Zk35tsim8jeVpg==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.9.0", + "@babel/helper-validator-identifier": "^7.10.4", "lodash": "^4.17.13", "to-fast-properties": "^2.0.0" } @@ -62,24 +62,24 @@ } }, "@babel/generator": { - "version": "7.9.4", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.9.4.tgz", - "integrity": "sha512-rjP8ahaDy/ouhrvCoU1E5mqaitWrxwuNGU+dy1EpaoK48jZay4MdkskKGIMHLZNewg8sAsqpGSREJwP0zH3YQA==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.10.4.tgz", + "integrity": "sha512-toLIHUIAgcQygFZRAQcsLQV3CBuX6yOIru1kJk/qqqvcRmZrYe6WavZTSG+bB8MxhnL9YPf+pKQfuiP161q7ng==", "dev": true, "requires": { - "@babel/types": "^7.9.0", + "@babel/types": "^7.10.4", "jsesc": "^2.5.1", "lodash": "^4.17.13", "source-map": "^0.5.0" }, "dependencies": { "@babel/types": { - "version": "7.9.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.0.tgz", - "integrity": "sha512-BS9JKfXkzzJl8RluW4JGknzpiUV7ZrvTayM6yfqLTVBEnFtyowVIOu6rqxRd5cVO6yGoWf4T8u8dgK9oB+GCng==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.4.tgz", + "integrity": "sha512-UTCFOxC3FsFHb7lkRMVvgLzaRVamXuAs2Tz4wajva4WxtVY82eZeaUBtC2Zt95FU9TiznuC0Zk35tsim8jeVpg==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.9.0", + "@babel/helper-validator-identifier": "^7.10.4", "lodash": "^4.17.13", "to-fast-properties": "^2.0.0" } @@ -87,105 +87,223 @@ } }, "@babel/helper-annotate-as-pure": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.8.3.tgz", - "integrity": "sha512-6o+mJrZBxOoEX77Ezv9zwW7WV8DdluouRKNY/IR5u/YTMuKHgugHOzYWlYvYLpLA9nPsQCAAASpCIbjI9Mv+Uw==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.10.4.tgz", + "integrity": "sha512-XQlqKQP4vXFB7BN8fEEerrmYvHp3fK/rBkRFz9jaJbzK0B1DSfej9Kc7ZzE8Z/OnId1jpJdNAZ3BFQjWG68rcA==", "dev": true, "requires": { - "@babel/types": "^7.8.3" + "@babel/types": "^7.10.4" + }, + "dependencies": { + "@babel/types": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.4.tgz", + "integrity": "sha512-UTCFOxC3FsFHb7lkRMVvgLzaRVamXuAs2Tz4wajva4WxtVY82eZeaUBtC2Zt95FU9TiznuC0Zk35tsim8jeVpg==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.10.4", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + } } }, "@babel/helper-builder-binary-assignment-operator-visitor": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.8.3.tgz", - "integrity": "sha512-5eFOm2SyFPK4Rh3XMMRDjN7lBH0orh3ss0g3rTYZnBQ+r6YPj7lgDyCvPphynHvUrobJmeMignBr6Acw9mAPlw==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.10.4.tgz", + "integrity": "sha512-L0zGlFrGWZK4PbT8AszSfLTM5sDU1+Az/En9VrdT8/LmEiJt4zXt+Jve9DCAnQcbqDhCI+29y/L93mrDzddCcg==", "dev": true, "requires": { - "@babel/helper-explode-assignable-expression": "^7.8.3", - "@babel/types": "^7.8.3" + "@babel/helper-explode-assignable-expression": "^7.10.4", + "@babel/types": "^7.10.4" + }, + "dependencies": { + "@babel/types": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.4.tgz", + "integrity": "sha512-UTCFOxC3FsFHb7lkRMVvgLzaRVamXuAs2Tz4wajva4WxtVY82eZeaUBtC2Zt95FU9TiznuC0Zk35tsim8jeVpg==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.10.4", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + } } }, "@babel/helper-compilation-targets": { - "version": "7.8.7", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.8.7.tgz", - "integrity": "sha512-4mWm8DCK2LugIS+p1yArqvG1Pf162upsIsjE7cNBjez+NjliQpVhj20obE520nao0o14DaTnFJv+Fw5a0JpoUw==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.10.4.tgz", + "integrity": "sha512-a3rYhlsGV0UHNDvrtOXBg8/OpfV0OKTkxKPzIplS1zpx7CygDcWWxckxZeDd3gzPzC4kUT0A4nVFDK0wGMh4MQ==", "dev": true, "requires": { - "@babel/compat-data": "^7.8.6", - "browserslist": "^4.9.1", + "@babel/compat-data": "^7.10.4", + "browserslist": "^4.12.0", "invariant": "^2.2.4", "levenary": "^1.1.1", "semver": "^5.5.0" } }, + "@babel/helper-create-class-features-plugin": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.10.4.tgz", + "integrity": "sha512-9raUiOsXPxzzLjCXeosApJItoMnX3uyT4QdM2UldffuGApNrF8e938MwNpDCK9CPoyxrEoCgT+hObJc3mZa6lQ==", + "dev": true, + "requires": { + "@babel/helper-function-name": "^7.10.4", + "@babel/helper-member-expression-to-functions": "^7.10.4", + "@babel/helper-optimise-call-expression": "^7.10.4", + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/helper-replace-supers": "^7.10.4", + "@babel/helper-split-export-declaration": "^7.10.4" + } + }, "@babel/helper-create-regexp-features-plugin": { - "version": "7.8.8", - "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.8.8.tgz", - "integrity": "sha512-LYVPdwkrQEiX9+1R29Ld/wTrmQu1SSKYnuOk3g0CkcZMA1p0gsNxJFj/3gBdaJ7Cg0Fnek5z0DsMULePP7Lrqg==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.10.4.tgz", + "integrity": "sha512-2/hu58IEPKeoLF45DBwx3XFqsbCXmkdAay4spVr2x0jYgRxrSNp+ePwvSsy9g6YSaNDcKIQVPXk1Ov8S2edk2g==", "dev": true, "requires": { - "@babel/helper-annotate-as-pure": "^7.8.3", - "@babel/helper-regex": "^7.8.3", + "@babel/helper-annotate-as-pure": "^7.10.4", + "@babel/helper-regex": "^7.10.4", "regexpu-core": "^4.7.0" } }, "@babel/helper-define-map": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-define-map/-/helper-define-map-7.8.3.tgz", - "integrity": "sha512-PoeBYtxoZGtct3md6xZOCWPcKuMuk3IHhgxsRRNtnNShebf4C8YonTSblsK4tvDbm+eJAw2HAPOfCr+Q/YRG/g==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-define-map/-/helper-define-map-7.10.4.tgz", + "integrity": "sha512-nIij0oKErfCnLUCWaCaHW0Bmtl2RO9cN7+u2QT8yqTywgALKlyUVOvHDElh+b5DwVC6YB1FOYFOTWcN/+41EDA==", "dev": true, "requires": { - "@babel/helper-function-name": "^7.8.3", - "@babel/types": "^7.8.3", + "@babel/helper-function-name": "^7.10.4", + "@babel/types": "^7.10.4", "lodash": "^4.17.13" + }, + "dependencies": { + "@babel/types": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.4.tgz", + "integrity": "sha512-UTCFOxC3FsFHb7lkRMVvgLzaRVamXuAs2Tz4wajva4WxtVY82eZeaUBtC2Zt95FU9TiznuC0Zk35tsim8jeVpg==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.10.4", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + } } }, "@babel/helper-explode-assignable-expression": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.8.3.tgz", - "integrity": "sha512-N+8eW86/Kj147bO9G2uclsg5pwfs/fqqY5rwgIL7eTBklgXjcOJ3btzS5iM6AitJcftnY7pm2lGsrJVYLGjzIw==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.10.4.tgz", + "integrity": "sha512-4K71RyRQNPRrR85sr5QY4X3VwG4wtVoXZB9+L3r1Gp38DhELyHCtovqydRi7c1Ovb17eRGiQ/FD5s8JdU0Uy5A==", "dev": true, "requires": { - "@babel/traverse": "^7.8.3", - "@babel/types": "^7.8.3" + "@babel/traverse": "^7.10.4", + "@babel/types": "^7.10.4" + }, + "dependencies": { + "@babel/types": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.4.tgz", + "integrity": "sha512-UTCFOxC3FsFHb7lkRMVvgLzaRVamXuAs2Tz4wajva4WxtVY82eZeaUBtC2Zt95FU9TiznuC0Zk35tsim8jeVpg==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.10.4", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + } } }, "@babel/helper-function-name": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.8.3.tgz", - "integrity": "sha512-BCxgX1BC2hD/oBlIFUgOCQDOPV8nSINxCwM3o93xP4P9Fq6aV5sgv2cOOITDMtCfQ+3PvHp3l689XZvAM9QyOA==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.10.4.tgz", + "integrity": "sha512-YdaSyz1n8gY44EmN7x44zBn9zQ1Ry2Y+3GTA+3vH6Mizke1Vw0aWDM66FOYEPw8//qKkmqOckrGgTYa+6sceqQ==", "dev": true, "requires": { - "@babel/helper-get-function-arity": "^7.8.3", - "@babel/template": "^7.8.3", - "@babel/types": "^7.8.3" + "@babel/helper-get-function-arity": "^7.10.4", + "@babel/template": "^7.10.4", + "@babel/types": "^7.10.4" + }, + "dependencies": { + "@babel/types": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.4.tgz", + "integrity": "sha512-UTCFOxC3FsFHb7lkRMVvgLzaRVamXuAs2Tz4wajva4WxtVY82eZeaUBtC2Zt95FU9TiznuC0Zk35tsim8jeVpg==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.10.4", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + } } }, "@babel/helper-get-function-arity": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.8.3.tgz", - "integrity": "sha512-FVDR+Gd9iLjUMY1fzE2SR0IuaJToR4RkCDARVfsBBPSP53GEqSFjD8gNyxg246VUyc/ALRxFaAK8rVG7UT7xRA==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.10.4.tgz", + "integrity": "sha512-EkN3YDB+SRDgiIUnNgcmiD361ti+AVbL3f3Henf6dqqUyr5dMsorno0lJWJuLhDhkI5sYEpgj6y9kB8AOU1I2A==", "dev": true, "requires": { - "@babel/types": "^7.8.3" + "@babel/types": "^7.10.4" + }, + "dependencies": { + "@babel/types": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.4.tgz", + "integrity": "sha512-UTCFOxC3FsFHb7lkRMVvgLzaRVamXuAs2Tz4wajva4WxtVY82eZeaUBtC2Zt95FU9TiznuC0Zk35tsim8jeVpg==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.10.4", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + } } }, "@babel/helper-hoist-variables": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.8.3.tgz", - "integrity": "sha512-ky1JLOjcDUtSc+xkt0xhYff7Z6ILTAHKmZLHPxAhOP0Nd77O+3nCsd6uSVYur6nJnCI029CrNbYlc0LoPfAPQg==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.10.4.tgz", + "integrity": "sha512-wljroF5PgCk2juF69kanHVs6vrLwIPNp6DLD+Lrl3hoQ3PpPPikaDRNFA+0t81NOoMt2DL6WW/mdU8k4k6ZzuA==", "dev": true, "requires": { - "@babel/types": "^7.8.3" + "@babel/types": "^7.10.4" + }, + "dependencies": { + "@babel/types": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.4.tgz", + "integrity": "sha512-UTCFOxC3FsFHb7lkRMVvgLzaRVamXuAs2Tz4wajva4WxtVY82eZeaUBtC2Zt95FU9TiznuC0Zk35tsim8jeVpg==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.10.4", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + } } }, "@babel/helper-member-expression-to-functions": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.8.3.tgz", - "integrity": "sha512-fO4Egq88utkQFjbPrSHGmGLFqmrshs11d46WI+WZDESt7Wu7wN2G2Iu+NMMZJFDOVRHAMIkB5SNh30NtwCA7RA==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.10.4.tgz", + "integrity": "sha512-m5j85pK/KZhuSdM/8cHUABQTAslV47OjfIB9Cc7P+PvlAoBzdb79BGNfw8RhT5Mq3p+xGd0ZfAKixbrUZx0C7A==", "dev": true, "requires": { - "@babel/types": "^7.8.3" + "@babel/types": "^7.10.4" + }, + "dependencies": { + "@babel/types": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.4.tgz", + "integrity": "sha512-UTCFOxC3FsFHb7lkRMVvgLzaRVamXuAs2Tz4wajva4WxtVY82eZeaUBtC2Zt95FU9TiznuC0Zk35tsim8jeVpg==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.10.4", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + } } }, "@babel/helper-module-imports": { @@ -198,27 +316,36 @@ } }, "@babel/helper-module-transforms": { - "version": "7.9.0", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.9.0.tgz", - "integrity": "sha512-0FvKyu0gpPfIQ8EkxlrAydOWROdHpBmiCiRwLkUiBGhCUPRRbVD2/tm3sFr/c/GWFrQ/ffutGUAnx7V0FzT2wA==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.10.4.tgz", + "integrity": "sha512-Er2FQX0oa3nV7eM1o0tNCTx7izmQtwAQsIiaLRWtavAAEcskb0XJ5OjJbVrYXWOTr8om921Scabn4/tzlx7j1Q==", "dev": true, "requires": { - "@babel/helper-module-imports": "^7.8.3", - "@babel/helper-replace-supers": "^7.8.6", - "@babel/helper-simple-access": "^7.8.3", - "@babel/helper-split-export-declaration": "^7.8.3", - "@babel/template": "^7.8.6", - "@babel/types": "^7.9.0", + "@babel/helper-module-imports": "^7.10.4", + "@babel/helper-replace-supers": "^7.10.4", + "@babel/helper-simple-access": "^7.10.4", + "@babel/helper-split-export-declaration": "^7.10.4", + "@babel/template": "^7.10.4", + "@babel/types": "^7.10.4", "lodash": "^4.17.13" }, "dependencies": { + "@babel/helper-module-imports": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.10.4.tgz", + "integrity": "sha512-nEQJHqYavI217oD9+s5MUBzk6x1IlvoS9WTPfgG43CbMEeStE0v+r+TucWdx8KFGowPGvyOkDT9+7DHedIDnVw==", + "dev": true, + "requires": { + "@babel/types": "^7.10.4" + } + }, "@babel/types": { - "version": "7.9.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.0.tgz", - "integrity": "sha512-BS9JKfXkzzJl8RluW4JGknzpiUV7ZrvTayM6yfqLTVBEnFtyowVIOu6rqxRd5cVO6yGoWf4T8u8dgK9oB+GCng==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.4.tgz", + "integrity": "sha512-UTCFOxC3FsFHb7lkRMVvgLzaRVamXuAs2Tz4wajva4WxtVY82eZeaUBtC2Zt95FU9TiznuC0Zk35tsim8jeVpg==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.9.0", + "@babel/helper-validator-identifier": "^7.10.4", "lodash": "^4.17.13", "to-fast-properties": "^2.0.0" } @@ -226,109 +353,187 @@ } }, "@babel/helper-optimise-call-expression": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.8.3.tgz", - "integrity": "sha512-Kag20n86cbO2AvHca6EJsvqAd82gc6VMGule4HwebwMlwkpXuVqrNRj6CkCV2sKxgi9MyAUnZVnZ6lJ1/vKhHQ==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.10.4.tgz", + "integrity": "sha512-n3UGKY4VXwXThEiKrgRAoVPBMqeoPgHVqiHZOanAJCG9nQUL2pLRQirUzl0ioKclHGpGqRgIOkgcIJaIWLpygg==", "dev": true, "requires": { - "@babel/types": "^7.8.3" + "@babel/types": "^7.10.4" + }, + "dependencies": { + "@babel/types": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.4.tgz", + "integrity": "sha512-UTCFOxC3FsFHb7lkRMVvgLzaRVamXuAs2Tz4wajva4WxtVY82eZeaUBtC2Zt95FU9TiznuC0Zk35tsim8jeVpg==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.10.4", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + } } }, "@babel/helper-plugin-utils": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz", - "integrity": "sha512-j+fq49Xds2smCUNYmEHF9kGNkhbet6yVIBp4e6oeQpH1RUs/Ir06xUKzDjDkGcaaokPiTNs2JBWHjaE4csUkZQ==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.10.4.tgz", + "integrity": "sha512-O4KCvQA6lLiMU9l2eawBPMf1xPP8xPfB3iEQw150hOVTqj/rfXz0ThTb4HEzqQfs2Bmo5Ay8BzxfzVtBrr9dVg==", "dev": true }, "@babel/helper-regex": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-regex/-/helper-regex-7.8.3.tgz", - "integrity": "sha512-BWt0QtYv/cg/NecOAZMdcn/waj/5P26DR4mVLXfFtDokSR6fyuG0Pj+e2FqtSME+MqED1khnSMulkmGl8qWiUQ==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-regex/-/helper-regex-7.10.4.tgz", + "integrity": "sha512-inWpnHGgtg5NOF0eyHlC0/74/VkdRITY9dtTpB2PrxKKn+AkVMRiZz/Adrx+Ssg+MLDesi2zohBW6MVq6b4pOQ==", "dev": true, "requires": { "lodash": "^4.17.13" } }, "@babel/helper-remap-async-to-generator": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.8.3.tgz", - "integrity": "sha512-kgwDmw4fCg7AVgS4DukQR/roGp+jP+XluJE5hsRZwxCYGg+Rv9wSGErDWhlI90FODdYfd4xG4AQRiMDjjN0GzA==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.10.4.tgz", + "integrity": "sha512-86Lsr6NNw3qTNl+TBcF1oRZMaVzJtbWTyTko+CQL/tvNvcGYEFKbLXDPxtW0HKk3McNOk4KzY55itGWCAGK5tg==", "dev": true, "requires": { - "@babel/helper-annotate-as-pure": "^7.8.3", - "@babel/helper-wrap-function": "^7.8.3", - "@babel/template": "^7.8.3", - "@babel/traverse": "^7.8.3", - "@babel/types": "^7.8.3" + "@babel/helper-annotate-as-pure": "^7.10.4", + "@babel/helper-wrap-function": "^7.10.4", + "@babel/template": "^7.10.4", + "@babel/traverse": "^7.10.4", + "@babel/types": "^7.10.4" + }, + "dependencies": { + "@babel/types": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.4.tgz", + "integrity": "sha512-UTCFOxC3FsFHb7lkRMVvgLzaRVamXuAs2Tz4wajva4WxtVY82eZeaUBtC2Zt95FU9TiznuC0Zk35tsim8jeVpg==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.10.4", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + } } }, "@babel/helper-replace-supers": { - "version": "7.8.6", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.8.6.tgz", - "integrity": "sha512-PeMArdA4Sv/Wf4zXwBKPqVj7n9UF/xg6slNRtZW84FM7JpE1CbG8B612FyM4cxrf4fMAMGO0kR7voy1ForHHFA==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.10.4.tgz", + "integrity": "sha512-sPxZfFXocEymYTdVK1UNmFPBN+Hv5mJkLPsYWwGBxZAxaWfFu+xqp7b6qWD0yjNuNL2VKc6L5M18tOXUP7NU0A==", "dev": true, "requires": { - "@babel/helper-member-expression-to-functions": "^7.8.3", - "@babel/helper-optimise-call-expression": "^7.8.3", - "@babel/traverse": "^7.8.6", - "@babel/types": "^7.8.6" + "@babel/helper-member-expression-to-functions": "^7.10.4", + "@babel/helper-optimise-call-expression": "^7.10.4", + "@babel/traverse": "^7.10.4", + "@babel/types": "^7.10.4" + }, + "dependencies": { + "@babel/types": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.4.tgz", + "integrity": "sha512-UTCFOxC3FsFHb7lkRMVvgLzaRVamXuAs2Tz4wajva4WxtVY82eZeaUBtC2Zt95FU9TiznuC0Zk35tsim8jeVpg==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.10.4", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + } } }, "@babel/helper-simple-access": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.8.3.tgz", - "integrity": "sha512-VNGUDjx5cCWg4vvCTR8qQ7YJYZ+HBjxOgXEl7ounz+4Sn7+LMD3CFrCTEU6/qXKbA2nKg21CwhhBzO0RpRbdCw==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.10.4.tgz", + "integrity": "sha512-0fMy72ej/VEvF8ULmX6yb5MtHG4uH4Dbd6I/aHDb/JVg0bbivwt9Wg+h3uMvX+QSFtwr5MeItvazbrc4jtRAXw==", "dev": true, "requires": { - "@babel/template": "^7.8.3", - "@babel/types": "^7.8.3" + "@babel/template": "^7.10.4", + "@babel/types": "^7.10.4" + }, + "dependencies": { + "@babel/types": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.4.tgz", + "integrity": "sha512-UTCFOxC3FsFHb7lkRMVvgLzaRVamXuAs2Tz4wajva4WxtVY82eZeaUBtC2Zt95FU9TiznuC0Zk35tsim8jeVpg==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.10.4", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + } } }, "@babel/helper-split-export-declaration": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.8.3.tgz", - "integrity": "sha512-3x3yOeyBhW851hroze7ElzdkeRXQYQbFIb7gLK1WQYsw2GWDay5gAJNw1sWJ0VFP6z5J1whqeXH/WCdCjZv6dA==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.10.4.tgz", + "integrity": "sha512-pySBTeoUff56fL5CBU2hWm9TesA4r/rOkI9DyJLvvgz09MB9YtfIYe3iBriVaYNaPe+Alua0vBIOVOLs2buWhg==", "dev": true, "requires": { - "@babel/types": "^7.8.3" + "@babel/types": "^7.10.4" + }, + "dependencies": { + "@babel/types": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.4.tgz", + "integrity": "sha512-UTCFOxC3FsFHb7lkRMVvgLzaRVamXuAs2Tz4wajva4WxtVY82eZeaUBtC2Zt95FU9TiznuC0Zk35tsim8jeVpg==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.10.4", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + } } }, "@babel/helper-validator-identifier": { - "version": "7.9.0", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.9.0.tgz", - "integrity": "sha512-6G8bQKjOh+of4PV/ThDm/rRqlU7+IGoJuofpagU5GlEl29Vv0RGqqt86ZGRV8ZuSOY3o+8yXl5y782SMcG7SHw==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz", + "integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==", "dev": true }, "@babel/helper-wrap-function": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.8.3.tgz", - "integrity": "sha512-LACJrbUET9cQDzb6kG7EeD7+7doC3JNvUgTEQOx2qaO1fKlzE/Bf05qs9w1oXQMmXlPO65lC3Tq9S6gZpTErEQ==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.10.4.tgz", + "integrity": "sha512-6py45WvEF0MhiLrdxtRjKjufwLL1/ob2qDJgg5JgNdojBAZSAKnAjkyOCNug6n+OBl4VW76XjvgSFTdaMcW0Ug==", "dev": true, "requires": { - "@babel/helper-function-name": "^7.8.3", - "@babel/template": "^7.8.3", - "@babel/traverse": "^7.8.3", - "@babel/types": "^7.8.3" + "@babel/helper-function-name": "^7.10.4", + "@babel/template": "^7.10.4", + "@babel/traverse": "^7.10.4", + "@babel/types": "^7.10.4" + }, + "dependencies": { + "@babel/types": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.4.tgz", + "integrity": "sha512-UTCFOxC3FsFHb7lkRMVvgLzaRVamXuAs2Tz4wajva4WxtVY82eZeaUBtC2Zt95FU9TiznuC0Zk35tsim8jeVpg==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.10.4", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + } } }, "@babel/helpers": { - "version": "7.9.2", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.9.2.tgz", - "integrity": "sha512-JwLvzlXVPjO8eU9c/wF9/zOIN7X6h8DYf7mG4CiFRZRvZNKEF5dQ3H3V+ASkHoIB3mWhatgl5ONhyqHRI6MppA==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.10.4.tgz", + "integrity": "sha512-L2gX/XeUONeEbI78dXSrJzGdz4GQ+ZTA/aazfUsFaWjSe95kiCuOZ5HsXvkiw3iwF+mFHSRUfJU8t6YavocdXA==", "dev": true, "requires": { - "@babel/template": "^7.8.3", - "@babel/traverse": "^7.9.0", - "@babel/types": "^7.9.0" + "@babel/template": "^7.10.4", + "@babel/traverse": "^7.10.4", + "@babel/types": "^7.10.4" }, "dependencies": { "@babel/types": { - "version": "7.9.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.0.tgz", - "integrity": "sha512-BS9JKfXkzzJl8RluW4JGknzpiUV7ZrvTayM6yfqLTVBEnFtyowVIOu6rqxRd5cVO6yGoWf4T8u8dgK9oB+GCng==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.4.tgz", + "integrity": "sha512-UTCFOxC3FsFHb7lkRMVvgLzaRVamXuAs2Tz4wajva4WxtVY82eZeaUBtC2Zt95FU9TiznuC0Zk35tsim8jeVpg==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.9.0", + "@babel/helper-validator-identifier": "^7.10.4", "lodash": "^4.17.13", "to-fast-properties": "^2.0.0" } @@ -336,112 +541,132 @@ } }, "@babel/highlight": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.8.3.tgz", - "integrity": "sha512-PX4y5xQUvy0fnEVHrYOarRPXVWafSjTW9T0Hab8gVIawpl2Sj0ORyrygANq+KjcNlSSTw0YCLSNA8OyZ1I4yEg==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", + "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", "dev": true, "requires": { + "@babel/helper-validator-identifier": "^7.10.4", "chalk": "^2.0.0", - "esutils": "^2.0.2", "js-tokens": "^4.0.0" } }, "@babel/parser": { - "version": "7.9.4", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.9.4.tgz", - "integrity": "sha512-bC49otXX6N0/VYhgOMh4gnP26E9xnDZK3TmbNpxYzzz9BQLBosQwfyOe9/cXUU3txYhTzLCbcqd5c8y/OmCjHA==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.10.4.tgz", + "integrity": "sha512-8jHII4hf+YVDsskTF6WuMB3X4Eh+PsUkC2ljq22so5rHvH+T8BzyL94VOdyFLNR8tBSVXOTbNHOKpR4TfRxVtA==", "dev": true }, "@babel/plugin-proposal-async-generator-functions": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.8.3.tgz", - "integrity": "sha512-NZ9zLv848JsV3hs8ryEh7Uaz/0KsmPLqv0+PdkDJL1cJy0K4kOCFa8zc1E3mp+RHPQcpdfb/6GovEsW4VDrOMw==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.10.4.tgz", + "integrity": "sha512-MJbxGSmejEFVOANAezdO39SObkURO5o/8b6fSH6D1pi9RZQt+ldppKPXfqgUWpSQ9asM6xaSaSJIaeWMDRP0Zg==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/helper-remap-async-to-generator": "^7.8.3", + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/helper-remap-async-to-generator": "^7.10.4", "@babel/plugin-syntax-async-generators": "^7.8.0" } }, + "@babel/plugin-proposal-class-properties": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.10.4.tgz", + "integrity": "sha512-vhwkEROxzcHGNu2mzUC0OFFNXdZ4M23ib8aRRcJSsW8BZK9pQMD7QB7csl97NBbgGZO7ZyHUyKDnxzOaP4IrCg==", + "dev": true, + "requires": { + "@babel/helper-create-class-features-plugin": "^7.10.4", + "@babel/helper-plugin-utils": "^7.10.4" + } + }, "@babel/plugin-proposal-dynamic-import": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.8.3.tgz", - "integrity": "sha512-NyaBbyLFXFLT9FP+zk0kYlUlA8XtCUbehs67F0nnEg7KICgMc2mNkIeu9TYhKzyXMkrapZFwAhXLdnt4IYHy1w==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.10.4.tgz", + "integrity": "sha512-up6oID1LeidOOASNXgv/CFbgBqTuKJ0cJjz6An5tWD+NVBNlp3VNSBxv2ZdU7SYl3NxJC7agAQDApZusV6uFwQ==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.8.3", + "@babel/helper-plugin-utils": "^7.10.4", "@babel/plugin-syntax-dynamic-import": "^7.8.0" } }, "@babel/plugin-proposal-json-strings": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.8.3.tgz", - "integrity": "sha512-KGhQNZ3TVCQG/MjRbAUwuH+14y9q0tpxs1nWWs3pbSleRdDro9SAMMDyye8HhY1gqZ7/NqIc8SKhya0wRDgP1Q==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.10.4.tgz", + "integrity": "sha512-fCL7QF0Jo83uy1K0P2YXrfX11tj3lkpN7l4dMv9Y9VkowkhkQDwFHFd8IiwyK5MZjE8UpbgokkgtcReH88Abaw==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.8.3", + "@babel/helper-plugin-utils": "^7.10.4", "@babel/plugin-syntax-json-strings": "^7.8.0" } }, "@babel/plugin-proposal-nullish-coalescing-operator": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.8.3.tgz", - "integrity": "sha512-TS9MlfzXpXKt6YYomudb/KU7nQI6/xnapG6in1uZxoxDghuSMZsPb6D2fyUwNYSAp4l1iR7QtFOjkqcRYcUsfw==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.10.4.tgz", + "integrity": "sha512-wq5n1M3ZUlHl9sqT2ok1T2/MTt6AXE0e1Lz4WzWBr95LsAZ5qDXe4KnFuauYyEyLiohvXFMdbsOTMyLZs91Zlw==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.8.3", + "@babel/helper-plugin-utils": "^7.10.4", "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.0" } }, "@babel/plugin-proposal-numeric-separator": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.8.3.tgz", - "integrity": "sha512-jWioO1s6R/R+wEHizfaScNsAx+xKgwTLNXSh7tTC4Usj3ItsPEhYkEpU4h+lpnBwq7NBVOJXfO6cRFYcX69JUQ==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.10.4.tgz", + "integrity": "sha512-73/G7QoRoeNkLZFxsoCCvlg4ezE4eM+57PnOqgaPOozd5myfj7p0muD1mRVJvbUWbOzD+q3No2bWbaKy+DJ8DA==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/plugin-syntax-numeric-separator": "^7.8.3" + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/plugin-syntax-numeric-separator": "^7.10.4" } }, "@babel/plugin-proposal-object-rest-spread": { - "version": "7.9.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.9.5.tgz", - "integrity": "sha512-VP2oXvAf7KCYTthbUHwBlewbl1Iq059f6seJGsxMizaCdgHIeczOr7FBqELhSqfkIl04Fi8okzWzl63UKbQmmg==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.10.4.tgz", + "integrity": "sha512-6vh4SqRuLLarjgeOf4EaROJAHjvu9Gl+/346PbDH9yWbJyfnJ/ah3jmYKYtswEyCoWZiidvVHjHshd4WgjB9BA==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.8.3", + "@babel/helper-plugin-utils": "^7.10.4", "@babel/plugin-syntax-object-rest-spread": "^7.8.0", - "@babel/plugin-transform-parameters": "^7.9.5" + "@babel/plugin-transform-parameters": "^7.10.4" } }, "@babel/plugin-proposal-optional-catch-binding": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.8.3.tgz", - "integrity": "sha512-0gkX7J7E+AtAw9fcwlVQj8peP61qhdg/89D5swOkjYbkboA2CVckn3kiyum1DE0wskGb7KJJxBdyEBApDLLVdw==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.10.4.tgz", + "integrity": "sha512-LflT6nPh+GK2MnFiKDyLiqSqVHkQnVf7hdoAvyTnnKj9xB3docGRsdPuxp6qqqW19ifK3xgc9U5/FwrSaCNX5g==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.8.3", + "@babel/helper-plugin-utils": "^7.10.4", "@babel/plugin-syntax-optional-catch-binding": "^7.8.0" } }, "@babel/plugin-proposal-optional-chaining": { - "version": "7.9.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.9.0.tgz", - "integrity": "sha512-NDn5tu3tcv4W30jNhmc2hyD5c56G6cXx4TesJubhxrJeCvuuMpttxr0OnNCqbZGhFjLrg+NIhxxC+BK5F6yS3w==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.10.4.tgz", + "integrity": "sha512-ZIhQIEeavTgouyMSdZRap4VPPHqJJ3NEs2cuHs5p0erH+iz6khB0qfgU8g7UuJkG88+fBMy23ZiU+nuHvekJeQ==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.8.3", + "@babel/helper-plugin-utils": "^7.10.4", "@babel/plugin-syntax-optional-chaining": "^7.8.0" } }, + "@babel/plugin-proposal-private-methods": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.10.4.tgz", + "integrity": "sha512-wh5GJleuI8k3emgTg5KkJK6kHNsGEr0uBTDBuQUBJwckk9xs1ez79ioheEVVxMLyPscB0LfkbVHslQqIzWV6Bw==", + "dev": true, + "requires": { + "@babel/helper-create-class-features-plugin": "^7.10.4", + "@babel/helper-plugin-utils": "^7.10.4" + } + }, "@babel/plugin-proposal-unicode-property-regex": { - "version": "7.8.8", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.8.8.tgz", - "integrity": "sha512-EVhjVsMpbhLw9ZfHWSx2iy13Q8Z/eg8e8ccVWt23sWQK5l1UdkoLJPN5w69UA4uITGBnEZD2JOe4QOHycYKv8A==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.10.4.tgz", + "integrity": "sha512-H+3fOgPnEXFL9zGYtKQe4IDOPKYlZdF1kqFDQRRb8PK4B8af1vAGK04tF5iQAAsui+mHNBQSAtd2/ndEDe9wuA==", "dev": true, "requires": { - "@babel/helper-create-regexp-features-plugin": "^7.8.8", - "@babel/helper-plugin-utils": "^7.8.3" + "@babel/helper-create-regexp-features-plugin": "^7.10.4", + "@babel/helper-plugin-utils": "^7.10.4" } }, "@babel/plugin-syntax-async-generators": { @@ -453,6 +678,15 @@ "@babel/helper-plugin-utils": "^7.8.0" } }, + "@babel/plugin-syntax-class-properties": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.10.4.tgz", + "integrity": "sha512-GCSBF7iUle6rNugfURwNmCGG3Z/2+opxAMLs1nND4bhEG5PuxTIggDBoeYYSujAlLtsupzOHYJQgPS3pivwXIA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, "@babel/plugin-syntax-dynamic-import": { "version": "7.8.3", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz", @@ -481,12 +715,12 @@ } }, "@babel/plugin-syntax-numeric-separator": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.8.3.tgz", - "integrity": "sha512-H7dCMAdN83PcCmqmkHB5dtp+Xa9a6LKSvA2hiFBC/5alSHxM5VgWZXFqDi0YFe8XNGT6iCa+z4V4zSt/PdZ7Dw==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz", + "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.8.3" + "@babel/helper-plugin-utils": "^7.10.4" } }, "@babel/plugin-syntax-object-rest-spread": { @@ -517,431 +751,439 @@ } }, "@babel/plugin-syntax-top-level-await": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.8.3.tgz", - "integrity": "sha512-kwj1j9lL/6Wd0hROD3b/OZZ7MSrZLqqn9RAZ5+cYYsflQ9HZBIKCUkr3+uL1MEJ1NePiUbf98jjiMQSv0NMR9g==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.10.4.tgz", + "integrity": "sha512-ni1brg4lXEmWyafKr0ccFWkJG0CeMt4WV1oyeBW6EFObF4oOHclbkj5cARxAPQyAQ2UTuplJyK4nfkXIMMFvsQ==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.8.3" + "@babel/helper-plugin-utils": "^7.10.4" } }, "@babel/plugin-transform-arrow-functions": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.8.3.tgz", - "integrity": "sha512-0MRF+KC8EqH4dbuITCWwPSzsyO3HIWWlm30v8BbbpOrS1B++isGxPnnuq/IZvOX5J2D/p7DQalQm+/2PnlKGxg==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.10.4.tgz", + "integrity": "sha512-9J/oD1jV0ZCBcgnoFWFq1vJd4msoKb/TCpGNFyyLt0zABdcvgK3aYikZ8HjzB14c26bc7E3Q1yugpwGy2aTPNA==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.8.3" + "@babel/helper-plugin-utils": "^7.10.4" } }, "@babel/plugin-transform-async-to-generator": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.8.3.tgz", - "integrity": "sha512-imt9tFLD9ogt56Dd5CI/6XgpukMwd/fLGSrix2httihVe7LOGVPhyhMh1BU5kDM7iHD08i8uUtmV2sWaBFlHVQ==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.10.4.tgz", + "integrity": "sha512-F6nREOan7J5UXTLsDsZG3DXmZSVofr2tGNwfdrVwkDWHfQckbQXnXSPfD7iO+c/2HGqycwyLST3DnZ16n+cBJQ==", "dev": true, "requires": { - "@babel/helper-module-imports": "^7.8.3", - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/helper-remap-async-to-generator": "^7.8.3" + "@babel/helper-module-imports": "^7.10.4", + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/helper-remap-async-to-generator": "^7.10.4" + }, + "dependencies": { + "@babel/helper-module-imports": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.10.4.tgz", + "integrity": "sha512-nEQJHqYavI217oD9+s5MUBzk6x1IlvoS9WTPfgG43CbMEeStE0v+r+TucWdx8KFGowPGvyOkDT9+7DHedIDnVw==", + "dev": true, + "requires": { + "@babel/types": "^7.10.4" + } + }, + "@babel/types": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.4.tgz", + "integrity": "sha512-UTCFOxC3FsFHb7lkRMVvgLzaRVamXuAs2Tz4wajva4WxtVY82eZeaUBtC2Zt95FU9TiznuC0Zk35tsim8jeVpg==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.10.4", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + } } }, "@babel/plugin-transform-block-scoped-functions": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.8.3.tgz", - "integrity": "sha512-vo4F2OewqjbB1+yaJ7k2EJFHlTP3jR634Z9Cj9itpqNjuLXvhlVxgnjsHsdRgASR8xYDrx6onw4vW5H6We0Jmg==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.10.4.tgz", + "integrity": "sha512-WzXDarQXYYfjaV1szJvN3AD7rZgZzC1JtjJZ8dMHUyiK8mxPRahynp14zzNjU3VkPqPsO38CzxiWO1c9ARZ8JA==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.8.3" + "@babel/helper-plugin-utils": "^7.10.4" } }, "@babel/plugin-transform-block-scoping": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.8.3.tgz", - "integrity": "sha512-pGnYfm7RNRgYRi7bids5bHluENHqJhrV4bCZRwc5GamaWIIs07N4rZECcmJL6ZClwjDz1GbdMZFtPs27hTB06w==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.10.4.tgz", + "integrity": "sha512-J3b5CluMg3hPUii2onJDRiaVbPtKFPLEaV5dOPY5OeAbDi1iU/UbbFFTgwb7WnanaDy7bjU35kc26W3eM5Qa0A==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.8.3", + "@babel/helper-plugin-utils": "^7.10.4", "lodash": "^4.17.13" } }, "@babel/plugin-transform-classes": { - "version": "7.9.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.9.5.tgz", - "integrity": "sha512-x2kZoIuLC//O5iA7PEvecB105o7TLzZo8ofBVhP79N+DO3jaX+KYfww9TQcfBEZD0nikNyYcGB1IKtRq36rdmg==", - "dev": true, - "requires": { - "@babel/helper-annotate-as-pure": "^7.8.3", - "@babel/helper-define-map": "^7.8.3", - "@babel/helper-function-name": "^7.9.5", - "@babel/helper-optimise-call-expression": "^7.8.3", - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/helper-replace-supers": "^7.8.6", - "@babel/helper-split-export-declaration": "^7.8.3", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.10.4.tgz", + "integrity": "sha512-2oZ9qLjt161dn1ZE0Ms66xBncQH4In8Sqw1YWgBUZuGVJJS5c0OFZXL6dP2MRHrkU/eKhWg8CzFJhRQl50rQxA==", + "dev": true, + "requires": { + "@babel/helper-annotate-as-pure": "^7.10.4", + "@babel/helper-define-map": "^7.10.4", + "@babel/helper-function-name": "^7.10.4", + "@babel/helper-optimise-call-expression": "^7.10.4", + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/helper-replace-supers": "^7.10.4", + "@babel/helper-split-export-declaration": "^7.10.4", "globals": "^11.1.0" - }, - "dependencies": { - "@babel/helper-function-name": { - "version": "7.9.5", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.9.5.tgz", - "integrity": "sha512-JVcQZeXM59Cd1qanDUxv9fgJpt3NeKUaqBqUEvfmQ+BCOKq2xUgaWZW2hr0dkbyJgezYuplEoh5knmrnS68efw==", - "dev": true, - "requires": { - "@babel/helper-get-function-arity": "^7.8.3", - "@babel/template": "^7.8.3", - "@babel/types": "^7.9.5" - } - }, - "@babel/helper-validator-identifier": { - "version": "7.9.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.9.5.tgz", - "integrity": "sha512-/8arLKUFq882w4tWGj9JYzRpAlZgiWUJ+dtteNTDqrRBz9Iguck9Rn3ykuBDoUwh2TO4tSAJlrxDUOXWklJe4g==", - "dev": true - }, - "@babel/types": { - "version": "7.9.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.5.tgz", - "integrity": "sha512-XjnvNqenk818r5zMaba+sLQjnbda31UfUURv3ei0qPQw4u+j2jMyJ5b11y8ZHYTRSI3NnInQkkkRT4fLqqPdHg==", - "dev": true, - "requires": { - "@babel/helper-validator-identifier": "^7.9.5", - "lodash": "^4.17.13", - "to-fast-properties": "^2.0.0" - } - } } }, "@babel/plugin-transform-computed-properties": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.8.3.tgz", - "integrity": "sha512-O5hiIpSyOGdrQZRQ2ccwtTVkgUDBBiCuK//4RJ6UfePllUTCENOzKxfh6ulckXKc0DixTFLCfb2HVkNA7aDpzA==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.10.4.tgz", + "integrity": "sha512-JFwVDXcP/hM/TbyzGq3l/XWGut7p46Z3QvqFMXTfk6/09m7xZHJUN9xHfsv7vqqD4YnfI5ueYdSJtXqqBLyjBw==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.8.3" + "@babel/helper-plugin-utils": "^7.10.4" } }, "@babel/plugin-transform-destructuring": { - "version": "7.9.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.9.5.tgz", - "integrity": "sha512-j3OEsGel8nHL/iusv/mRd5fYZ3DrOxWC82x0ogmdN/vHfAP4MYw+AFKYanzWlktNwikKvlzUV//afBW5FTp17Q==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.10.4.tgz", + "integrity": "sha512-+WmfvyfsyF603iPa6825mq6Qrb7uLjTOsa3XOFzlYcYDHSS4QmpOWOL0NNBY5qMbvrcf3tq0Cw+v4lxswOBpgA==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.8.3" + "@babel/helper-plugin-utils": "^7.10.4" } }, "@babel/plugin-transform-dotall-regex": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.8.3.tgz", - "integrity": "sha512-kLs1j9Nn4MQoBYdRXH6AeaXMbEJFaFu/v1nQkvib6QzTj8MZI5OQzqmD83/2jEM1z0DLilra5aWO5YpyC0ALIw==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.10.4.tgz", + "integrity": "sha512-ZEAVvUTCMlMFAbASYSVQoxIbHm2OkG2MseW6bV2JjIygOjdVv8tuxrCTzj1+Rynh7ODb8GivUy7dzEXzEhuPaA==", "dev": true, "requires": { - "@babel/helper-create-regexp-features-plugin": "^7.8.3", - "@babel/helper-plugin-utils": "^7.8.3" + "@babel/helper-create-regexp-features-plugin": "^7.10.4", + "@babel/helper-plugin-utils": "^7.10.4" } }, "@babel/plugin-transform-duplicate-keys": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.8.3.tgz", - "integrity": "sha512-s8dHiBUbcbSgipS4SMFuWGqCvyge5V2ZeAWzR6INTVC3Ltjig/Vw1G2Gztv0vU/hRG9X8IvKvYdoksnUfgXOEQ==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.10.4.tgz", + "integrity": "sha512-GL0/fJnmgMclHiBTTWXNlYjYsA7rDrtsazHG6mglaGSTh0KsrW04qml+Bbz9FL0LcJIRwBWL5ZqlNHKTkU3xAA==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.8.3" + "@babel/helper-plugin-utils": "^7.10.4" } }, "@babel/plugin-transform-exponentiation-operator": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.8.3.tgz", - "integrity": "sha512-zwIpuIymb3ACcInbksHaNcR12S++0MDLKkiqXHl3AzpgdKlFNhog+z/K0+TGW+b0w5pgTq4H6IwV/WhxbGYSjQ==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.10.4.tgz", + "integrity": "sha512-S5HgLVgkBcRdyQAHbKj+7KyuWx8C6t5oETmUuwz1pt3WTWJhsUV0WIIXuVvfXMxl/QQyHKlSCNNtaIamG8fysw==", "dev": true, "requires": { - "@babel/helper-builder-binary-assignment-operator-visitor": "^7.8.3", - "@babel/helper-plugin-utils": "^7.8.3" + "@babel/helper-builder-binary-assignment-operator-visitor": "^7.10.4", + "@babel/helper-plugin-utils": "^7.10.4" } }, "@babel/plugin-transform-for-of": { - "version": "7.9.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.9.0.tgz", - "integrity": "sha512-lTAnWOpMwOXpyDx06N+ywmF3jNbafZEqZ96CGYabxHrxNX8l5ny7dt4bK/rGwAh9utyP2b2Hv7PlZh1AAS54FQ==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.10.4.tgz", + "integrity": "sha512-ItdQfAzu9AlEqmusA/65TqJ79eRcgGmpPPFvBnGILXZH975G0LNjP1yjHvGgfuCxqrPPueXOPe+FsvxmxKiHHQ==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.8.3" + "@babel/helper-plugin-utils": "^7.10.4" } }, "@babel/plugin-transform-function-name": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.8.3.tgz", - "integrity": "sha512-rO/OnDS78Eifbjn5Py9v8y0aR+aSYhDhqAwVfsTl0ERuMZyr05L1aFSCJnbv2mmsLkit/4ReeQ9N2BgLnOcPCQ==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.10.4.tgz", + "integrity": "sha512-OcDCq2y5+E0dVD5MagT5X+yTRbcvFjDI2ZVAottGH6tzqjx/LKpgkUepu3hp/u4tZBzxxpNGwLsAvGBvQ2mJzg==", "dev": true, "requires": { - "@babel/helper-function-name": "^7.8.3", - "@babel/helper-plugin-utils": "^7.8.3" + "@babel/helper-function-name": "^7.10.4", + "@babel/helper-plugin-utils": "^7.10.4" } }, "@babel/plugin-transform-literals": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.8.3.tgz", - "integrity": "sha512-3Tqf8JJ/qB7TeldGl+TT55+uQei9JfYaregDcEAyBZ7akutriFrt6C/wLYIer6OYhleVQvH/ntEhjE/xMmy10A==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.10.4.tgz", + "integrity": "sha512-Xd/dFSTEVuUWnyZiMu76/InZxLTYilOSr1UlHV+p115Z/Le2Fi1KXkJUYz0b42DfndostYlPub3m8ZTQlMaiqQ==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.8.3" + "@babel/helper-plugin-utils": "^7.10.4" } }, "@babel/plugin-transform-member-expression-literals": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.8.3.tgz", - "integrity": "sha512-3Wk2EXhnw+rP+IDkK6BdtPKsUE5IeZ6QOGrPYvw52NwBStw9V1ZVzxgK6fSKSxqUvH9eQPR3tm3cOq79HlsKYA==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.10.4.tgz", + "integrity": "sha512-0bFOvPyAoTBhtcJLr9VcwZqKmSjFml1iVxvPL0ReomGU53CX53HsM4h2SzckNdkQcHox1bpAqzxBI1Y09LlBSw==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.8.3" + "@babel/helper-plugin-utils": "^7.10.4" } }, "@babel/plugin-transform-modules-amd": { - "version": "7.9.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.9.0.tgz", - "integrity": "sha512-vZgDDF003B14O8zJy0XXLnPH4sg+9X5hFBBGN1V+B2rgrB+J2xIypSN6Rk9imB2hSTHQi5OHLrFWsZab1GMk+Q==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.10.4.tgz", + "integrity": "sha512-3Fw+H3WLUrTlzi3zMiZWp3AR4xadAEMv6XRCYnd5jAlLM61Rn+CRJaZMaNvIpcJpQ3vs1kyifYvEVPFfoSkKOA==", "dev": true, "requires": { - "@babel/helper-module-transforms": "^7.9.0", - "@babel/helper-plugin-utils": "^7.8.3", - "babel-plugin-dynamic-import-node": "^2.3.0" + "@babel/helper-module-transforms": "^7.10.4", + "@babel/helper-plugin-utils": "^7.10.4", + "babel-plugin-dynamic-import-node": "^2.3.3" } }, "@babel/plugin-transform-modules-commonjs": { - "version": "7.9.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.9.0.tgz", - "integrity": "sha512-qzlCrLnKqio4SlgJ6FMMLBe4bySNis8DFn1VkGmOcxG9gqEyPIOzeQrA//u0HAKrWpJlpZbZMPB1n/OPa4+n8g==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.10.4.tgz", + "integrity": "sha512-Xj7Uq5o80HDLlW64rVfDBhao6OX89HKUmb+9vWYaLXBZOma4gA6tw4Ni1O5qVDoZWUV0fxMYA0aYzOawz0l+1w==", "dev": true, "requires": { - "@babel/helper-module-transforms": "^7.9.0", - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/helper-simple-access": "^7.8.3", - "babel-plugin-dynamic-import-node": "^2.3.0" + "@babel/helper-module-transforms": "^7.10.4", + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/helper-simple-access": "^7.10.4", + "babel-plugin-dynamic-import-node": "^2.3.3" } }, "@babel/plugin-transform-modules-systemjs": { - "version": "7.9.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.9.0.tgz", - "integrity": "sha512-FsiAv/nao/ud2ZWy4wFacoLOm5uxl0ExSQ7ErvP7jpoihLR6Cq90ilOFyX9UXct3rbtKsAiZ9kFt5XGfPe/5SQ==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.10.4.tgz", + "integrity": "sha512-Tb28LlfxrTiOTGtZFsvkjpyjCl9IoaRI52AEU/VIwOwvDQWtbNJsAqTXzh+5R7i74e/OZHH2c2w2fsOqAfnQYQ==", "dev": true, "requires": { - "@babel/helper-hoist-variables": "^7.8.3", - "@babel/helper-module-transforms": "^7.9.0", - "@babel/helper-plugin-utils": "^7.8.3", - "babel-plugin-dynamic-import-node": "^2.3.0" + "@babel/helper-hoist-variables": "^7.10.4", + "@babel/helper-module-transforms": "^7.10.4", + "@babel/helper-plugin-utils": "^7.10.4", + "babel-plugin-dynamic-import-node": "^2.3.3" } }, "@babel/plugin-transform-modules-umd": { - "version": "7.9.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.9.0.tgz", - "integrity": "sha512-uTWkXkIVtg/JGRSIABdBoMsoIeoHQHPTL0Y2E7xf5Oj7sLqwVsNXOkNk0VJc7vF0IMBsPeikHxFjGe+qmwPtTQ==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.10.4.tgz", + "integrity": "sha512-mohW5q3uAEt8T45YT7Qc5ws6mWgJAaL/8BfWD9Dodo1A3RKWli8wTS+WiQ/knF+tXlPirW/1/MqzzGfCExKECA==", "dev": true, "requires": { - "@babel/helper-module-transforms": "^7.9.0", - "@babel/helper-plugin-utils": "^7.8.3" + "@babel/helper-module-transforms": "^7.10.4", + "@babel/helper-plugin-utils": "^7.10.4" } }, "@babel/plugin-transform-named-capturing-groups-regex": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.8.3.tgz", - "integrity": "sha512-f+tF/8UVPU86TrCb06JoPWIdDpTNSGGcAtaD9mLP0aYGA0OS0j7j7DHJR0GTFrUZPUU6loZhbsVZgTh0N+Qdnw==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.10.4.tgz", + "integrity": "sha512-V6LuOnD31kTkxQPhKiVYzYC/Jgdq53irJC/xBSmqcNcqFGV+PER4l6rU5SH2Vl7bH9mLDHcc0+l9HUOe4RNGKA==", "dev": true, "requires": { - "@babel/helper-create-regexp-features-plugin": "^7.8.3" + "@babel/helper-create-regexp-features-plugin": "^7.10.4" } }, "@babel/plugin-transform-new-target": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.8.3.tgz", - "integrity": "sha512-QuSGysibQpyxexRyui2vca+Cmbljo8bcRckgzYV4kRIsHpVeyeC3JDO63pY+xFZ6bWOBn7pfKZTqV4o/ix9sFw==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.10.4.tgz", + "integrity": "sha512-YXwWUDAH/J6dlfwqlWsztI2Puz1NtUAubXhOPLQ5gjR/qmQ5U96DY4FQO8At33JN4XPBhrjB8I4eMmLROjjLjw==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.8.3" + "@babel/helper-plugin-utils": "^7.10.4" } }, "@babel/plugin-transform-object-super": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.8.3.tgz", - "integrity": "sha512-57FXk+gItG/GejofIyLIgBKTas4+pEU47IXKDBWFTxdPd7F80H8zybyAY7UoblVfBhBGs2EKM+bJUu2+iUYPDQ==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.10.4.tgz", + "integrity": "sha512-5iTw0JkdRdJvr7sY0vHqTpnruUpTea32JHmq/atIWqsnNussbRzjEDyWep8UNztt1B5IusBYg8Irb0bLbiEBCQ==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/helper-replace-supers": "^7.8.3" + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/helper-replace-supers": "^7.10.4" } }, "@babel/plugin-transform-parameters": { - "version": "7.9.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.9.5.tgz", - "integrity": "sha512-0+1FhHnMfj6lIIhVvS4KGQJeuhe1GI//h5uptK4PvLt+BGBxsoUJbd3/IW002yk//6sZPlFgsG1hY6OHLcy6kA==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.10.4.tgz", + "integrity": "sha512-RurVtZ/D5nYfEg0iVERXYKEgDFeesHrHfx8RT05Sq57ucj2eOYAP6eu5fynL4Adju4I/mP/I6SO0DqNWAXjfLQ==", "dev": true, "requires": { - "@babel/helper-get-function-arity": "^7.8.3", - "@babel/helper-plugin-utils": "^7.8.3" + "@babel/helper-get-function-arity": "^7.10.4", + "@babel/helper-plugin-utils": "^7.10.4" } }, "@babel/plugin-transform-property-literals": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.8.3.tgz", - "integrity": "sha512-uGiiXAZMqEoQhRWMK17VospMZh5sXWg+dlh2soffpkAl96KAm+WZuJfa6lcELotSRmooLqg0MWdH6UUq85nmmg==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.10.4.tgz", + "integrity": "sha512-ofsAcKiUxQ8TY4sScgsGeR2vJIsfrzqvFb9GvJ5UdXDzl+MyYCaBj/FGzXuv7qE0aJcjWMILny1epqelnFlz8g==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.8.3" + "@babel/helper-plugin-utils": "^7.10.4" } }, "@babel/plugin-transform-regenerator": { - "version": "7.8.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.8.7.tgz", - "integrity": "sha512-TIg+gAl4Z0a3WmD3mbYSk+J9ZUH6n/Yc57rtKRnlA/7rcCvpekHXe0CMZHP1gYp7/KLe9GHTuIba0vXmls6drA==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.10.4.tgz", + "integrity": "sha512-3thAHwtor39A7C04XucbMg17RcZ3Qppfxr22wYzZNcVIkPHfpM9J0SO8zuCV6SZa265kxBJSrfKTvDCYqBFXGw==", "dev": true, "requires": { "regenerator-transform": "^0.14.2" } }, "@babel/plugin-transform-reserved-words": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.8.3.tgz", - "integrity": "sha512-mwMxcycN3omKFDjDQUl+8zyMsBfjRFr0Zn/64I41pmjv4NJuqcYlEtezwYtw9TFd9WR1vN5kiM+O0gMZzO6L0A==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.10.4.tgz", + "integrity": "sha512-hGsw1O6Rew1fkFbDImZIEqA8GoidwTAilwCyWqLBM9f+e/u/sQMQu7uX6dyokfOayRuuVfKOW4O7HvaBWM+JlQ==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.8.3" + "@babel/helper-plugin-utils": "^7.10.4" } }, "@babel/plugin-transform-shorthand-properties": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.8.3.tgz", - "integrity": "sha512-I9DI6Odg0JJwxCHzbzW08ggMdCezoWcuQRz3ptdudgwaHxTjxw5HgdFJmZIkIMlRymL6YiZcped4TTCB0JcC8w==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.10.4.tgz", + "integrity": "sha512-AC2K/t7o07KeTIxMoHneyX90v3zkm5cjHJEokrPEAGEy3UCp8sLKfnfOIGdZ194fyN4wfX/zZUWT9trJZ0qc+Q==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.8.3" + "@babel/helper-plugin-utils": "^7.10.4" } }, "@babel/plugin-transform-spread": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.8.3.tgz", - "integrity": "sha512-CkuTU9mbmAoFOI1tklFWYYbzX5qCIZVXPVy0jpXgGwkplCndQAa58s2jr66fTeQnA64bDox0HL4U56CFYoyC7g==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.10.4.tgz", + "integrity": "sha512-1e/51G/Ni+7uH5gktbWv+eCED9pP8ZpRhZB3jOaI3mmzfvJTWHkuyYTv0Z5PYtyM+Tr2Ccr9kUdQxn60fI5WuQ==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.8.3" + "@babel/helper-plugin-utils": "^7.10.4" } }, "@babel/plugin-transform-sticky-regex": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.8.3.tgz", - "integrity": "sha512-9Spq0vGCD5Bb4Z/ZXXSK5wbbLFMG085qd2vhL1JYu1WcQ5bXqZBAYRzU1d+p79GcHs2szYv5pVQCX13QgldaWw==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.10.4.tgz", + "integrity": "sha512-Ddy3QZfIbEV0VYcVtFDCjeE4xwVTJWTmUtorAJkn6u/92Z/nWJNV+mILyqHKrUxXYKA2EoCilgoPePymKL4DvQ==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/helper-regex": "^7.8.3" + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/helper-regex": "^7.10.4" } }, "@babel/plugin-transform-template-literals": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.8.3.tgz", - "integrity": "sha512-820QBtykIQOLFT8NZOcTRJ1UNuztIELe4p9DCgvj4NK+PwluSJ49we7s9FB1HIGNIYT7wFUJ0ar2QpCDj0escQ==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.10.4.tgz", + "integrity": "sha512-4NErciJkAYe+xI5cqfS8pV/0ntlY5N5Ske/4ImxAVX7mk9Rxt2bwDTGv1Msc2BRJvWQcmYEC+yoMLdX22aE4VQ==", "dev": true, "requires": { - "@babel/helper-annotate-as-pure": "^7.8.3", - "@babel/helper-plugin-utils": "^7.8.3" + "@babel/helper-annotate-as-pure": "^7.10.4", + "@babel/helper-plugin-utils": "^7.10.4" } }, "@babel/plugin-transform-typeof-symbol": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.8.4.tgz", - "integrity": "sha512-2QKyfjGdvuNfHsb7qnBBlKclbD4CfshH2KvDabiijLMGXPHJXGxtDzwIF7bQP+T0ysw8fYTtxPafgfs/c1Lrqg==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.10.4.tgz", + "integrity": "sha512-QqNgYwuuW0y0H+kUE/GWSR45t/ccRhe14Fs/4ZRouNNQsyd4o3PG4OtHiIrepbM2WKUBDAXKCAK/Lk4VhzTaGA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-transform-unicode-escapes": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.10.4.tgz", + "integrity": "sha512-y5XJ9waMti2J+e7ij20e+aH+fho7Wb7W8rNuu72aKRwCHFqQdhkdU2lo3uZ9tQuboEJcUFayXdARhcxLQ3+6Fg==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.8.3" + "@babel/helper-plugin-utils": "^7.10.4" } }, "@babel/plugin-transform-unicode-regex": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.8.3.tgz", - "integrity": "sha512-+ufgJjYdmWfSQ+6NS9VGUR2ns8cjJjYbrbi11mZBTaWm+Fui/ncTLFF28Ei1okavY+xkojGr1eJxNsWYeA5aZw==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.10.4.tgz", + "integrity": "sha512-wNfsc4s8N2qnIwpO/WP2ZiSyjfpTamT2C9V9FDH/Ljub9zw6P3SjkXcFmc0RQUt96k2fmIvtla2MMjgTwIAC+A==", "dev": true, "requires": { - "@babel/helper-create-regexp-features-plugin": "^7.8.3", - "@babel/helper-plugin-utils": "^7.8.3" + "@babel/helper-create-regexp-features-plugin": "^7.10.4", + "@babel/helper-plugin-utils": "^7.10.4" } }, "@babel/preset-env": { - "version": "7.9.5", - "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.9.5.tgz", - "integrity": "sha512-eWGYeADTlPJH+wq1F0wNfPbVS1w1wtmMJiYk55Td5Yu28AsdR9AsC97sZ0Qq8fHqQuslVSIYSGJMcblr345GfQ==", - "dev": true, - "requires": { - "@babel/compat-data": "^7.9.0", - "@babel/helper-compilation-targets": "^7.8.7", - "@babel/helper-module-imports": "^7.8.3", - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/plugin-proposal-async-generator-functions": "^7.8.3", - "@babel/plugin-proposal-dynamic-import": "^7.8.3", - "@babel/plugin-proposal-json-strings": "^7.8.3", - "@babel/plugin-proposal-nullish-coalescing-operator": "^7.8.3", - "@babel/plugin-proposal-numeric-separator": "^7.8.3", - "@babel/plugin-proposal-object-rest-spread": "^7.9.5", - "@babel/plugin-proposal-optional-catch-binding": "^7.8.3", - "@babel/plugin-proposal-optional-chaining": "^7.9.0", - "@babel/plugin-proposal-unicode-property-regex": "^7.8.3", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.10.4.tgz", + "integrity": "sha512-tcmuQ6vupfMZPrLrc38d0sF2OjLT3/bZ0dry5HchNCQbrokoQi4reXqclvkkAT5b+gWc23meVWpve5P/7+w/zw==", + "dev": true, + "requires": { + "@babel/compat-data": "^7.10.4", + "@babel/helper-compilation-targets": "^7.10.4", + "@babel/helper-module-imports": "^7.10.4", + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/plugin-proposal-async-generator-functions": "^7.10.4", + "@babel/plugin-proposal-class-properties": "^7.10.4", + "@babel/plugin-proposal-dynamic-import": "^7.10.4", + "@babel/plugin-proposal-json-strings": "^7.10.4", + "@babel/plugin-proposal-nullish-coalescing-operator": "^7.10.4", + "@babel/plugin-proposal-numeric-separator": "^7.10.4", + "@babel/plugin-proposal-object-rest-spread": "^7.10.4", + "@babel/plugin-proposal-optional-catch-binding": "^7.10.4", + "@babel/plugin-proposal-optional-chaining": "^7.10.4", + "@babel/plugin-proposal-private-methods": "^7.10.4", + "@babel/plugin-proposal-unicode-property-regex": "^7.10.4", "@babel/plugin-syntax-async-generators": "^7.8.0", + "@babel/plugin-syntax-class-properties": "^7.10.4", "@babel/plugin-syntax-dynamic-import": "^7.8.0", "@babel/plugin-syntax-json-strings": "^7.8.0", "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.0", - "@babel/plugin-syntax-numeric-separator": "^7.8.0", + "@babel/plugin-syntax-numeric-separator": "^7.10.4", "@babel/plugin-syntax-object-rest-spread": "^7.8.0", "@babel/plugin-syntax-optional-catch-binding": "^7.8.0", "@babel/plugin-syntax-optional-chaining": "^7.8.0", - "@babel/plugin-syntax-top-level-await": "^7.8.3", - "@babel/plugin-transform-arrow-functions": "^7.8.3", - "@babel/plugin-transform-async-to-generator": "^7.8.3", - "@babel/plugin-transform-block-scoped-functions": "^7.8.3", - "@babel/plugin-transform-block-scoping": "^7.8.3", - "@babel/plugin-transform-classes": "^7.9.5", - "@babel/plugin-transform-computed-properties": "^7.8.3", - "@babel/plugin-transform-destructuring": "^7.9.5", - "@babel/plugin-transform-dotall-regex": "^7.8.3", - "@babel/plugin-transform-duplicate-keys": "^7.8.3", - "@babel/plugin-transform-exponentiation-operator": "^7.8.3", - "@babel/plugin-transform-for-of": "^7.9.0", - "@babel/plugin-transform-function-name": "^7.8.3", - "@babel/plugin-transform-literals": "^7.8.3", - "@babel/plugin-transform-member-expression-literals": "^7.8.3", - "@babel/plugin-transform-modules-amd": "^7.9.0", - "@babel/plugin-transform-modules-commonjs": "^7.9.0", - "@babel/plugin-transform-modules-systemjs": "^7.9.0", - "@babel/plugin-transform-modules-umd": "^7.9.0", - "@babel/plugin-transform-named-capturing-groups-regex": "^7.8.3", - "@babel/plugin-transform-new-target": "^7.8.3", - "@babel/plugin-transform-object-super": "^7.8.3", - "@babel/plugin-transform-parameters": "^7.9.5", - "@babel/plugin-transform-property-literals": "^7.8.3", - "@babel/plugin-transform-regenerator": "^7.8.7", - "@babel/plugin-transform-reserved-words": "^7.8.3", - "@babel/plugin-transform-shorthand-properties": "^7.8.3", - "@babel/plugin-transform-spread": "^7.8.3", - "@babel/plugin-transform-sticky-regex": "^7.8.3", - "@babel/plugin-transform-template-literals": "^7.8.3", - "@babel/plugin-transform-typeof-symbol": "^7.8.4", - "@babel/plugin-transform-unicode-regex": "^7.8.3", + "@babel/plugin-syntax-top-level-await": "^7.10.4", + "@babel/plugin-transform-arrow-functions": "^7.10.4", + "@babel/plugin-transform-async-to-generator": "^7.10.4", + "@babel/plugin-transform-block-scoped-functions": "^7.10.4", + "@babel/plugin-transform-block-scoping": "^7.10.4", + "@babel/plugin-transform-classes": "^7.10.4", + "@babel/plugin-transform-computed-properties": "^7.10.4", + "@babel/plugin-transform-destructuring": "^7.10.4", + "@babel/plugin-transform-dotall-regex": "^7.10.4", + "@babel/plugin-transform-duplicate-keys": "^7.10.4", + "@babel/plugin-transform-exponentiation-operator": "^7.10.4", + "@babel/plugin-transform-for-of": "^7.10.4", + "@babel/plugin-transform-function-name": "^7.10.4", + "@babel/plugin-transform-literals": "^7.10.4", + "@babel/plugin-transform-member-expression-literals": "^7.10.4", + "@babel/plugin-transform-modules-amd": "^7.10.4", + "@babel/plugin-transform-modules-commonjs": "^7.10.4", + "@babel/plugin-transform-modules-systemjs": "^7.10.4", + "@babel/plugin-transform-modules-umd": "^7.10.4", + "@babel/plugin-transform-named-capturing-groups-regex": "^7.10.4", + "@babel/plugin-transform-new-target": "^7.10.4", + "@babel/plugin-transform-object-super": "^7.10.4", + "@babel/plugin-transform-parameters": "^7.10.4", + "@babel/plugin-transform-property-literals": "^7.10.4", + "@babel/plugin-transform-regenerator": "^7.10.4", + "@babel/plugin-transform-reserved-words": "^7.10.4", + "@babel/plugin-transform-shorthand-properties": "^7.10.4", + "@babel/plugin-transform-spread": "^7.10.4", + "@babel/plugin-transform-sticky-regex": "^7.10.4", + "@babel/plugin-transform-template-literals": "^7.10.4", + "@babel/plugin-transform-typeof-symbol": "^7.10.4", + "@babel/plugin-transform-unicode-escapes": "^7.10.4", + "@babel/plugin-transform-unicode-regex": "^7.10.4", "@babel/preset-modules": "^0.1.3", - "@babel/types": "^7.9.5", - "browserslist": "^4.9.1", + "@babel/types": "^7.10.4", + "browserslist": "^4.12.0", "core-js-compat": "^3.6.2", "invariant": "^2.2.2", "levenary": "^1.1.1", "semver": "^5.5.0" }, "dependencies": { - "@babel/helper-validator-identifier": { - "version": "7.9.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.9.5.tgz", - "integrity": "sha512-/8arLKUFq882w4tWGj9JYzRpAlZgiWUJ+dtteNTDqrRBz9Iguck9Rn3ykuBDoUwh2TO4tSAJlrxDUOXWklJe4g==", - "dev": true + "@babel/helper-module-imports": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.10.4.tgz", + "integrity": "sha512-nEQJHqYavI217oD9+s5MUBzk6x1IlvoS9WTPfgG43CbMEeStE0v+r+TucWdx8KFGowPGvyOkDT9+7DHedIDnVw==", + "dev": true, + "requires": { + "@babel/types": "^7.10.4" + } }, "@babel/types": { - "version": "7.9.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.5.tgz", - "integrity": "sha512-XjnvNqenk818r5zMaba+sLQjnbda31UfUURv3ei0qPQw4u+j2jMyJ5b11y8ZHYTRSI3NnInQkkkRT4fLqqPdHg==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.4.tgz", + "integrity": "sha512-UTCFOxC3FsFHb7lkRMVvgLzaRVamXuAs2Tz4wajva4WxtVY82eZeaUBtC2Zt95FU9TiznuC0Zk35tsim8jeVpg==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.9.5", + "@babel/helper-validator-identifier": "^7.10.4", "lodash": "^4.17.13", "to-fast-properties": "^2.0.0" } @@ -962,49 +1204,62 @@ } }, "@babel/runtime": { - "version": "7.9.2", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.9.2.tgz", - "integrity": "sha512-NE2DtOdufG7R5vnfQUTehdTfNycfUANEtCa9PssN9O/xmTzP4E08UI797ixaei6hBEVL9BI/PsdJS5x7mWoB9Q==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.10.4.tgz", + "integrity": "sha512-UpTN5yUJr9b4EX2CnGNWIvER7Ab83ibv0pcvvHc4UOdrBI5jb8bj+32cCwPX6xu0mt2daFNjYhoi+X7beH0RSw==", "dev": true, "requires": { "regenerator-runtime": "^0.13.4" } }, "@babel/template": { - "version": "7.8.6", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.8.6.tgz", - "integrity": "sha512-zbMsPMy/v0PWFZEhQJ66bqjhH+z0JgMoBWuikXybgG3Gkd/3t5oQ1Rw2WQhnSrsOmsKXnZOx15tkC4qON/+JPg==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.10.4.tgz", + "integrity": "sha512-ZCjD27cGJFUB6nmCB1Enki3r+L5kJveX9pq1SvAUKoICy6CZ9yD8xO086YXdYhvNjBdnekm4ZnaP5yC8Cs/1tA==", "dev": true, "requires": { - "@babel/code-frame": "^7.8.3", - "@babel/parser": "^7.8.6", - "@babel/types": "^7.8.6" + "@babel/code-frame": "^7.10.4", + "@babel/parser": "^7.10.4", + "@babel/types": "^7.10.4" + }, + "dependencies": { + "@babel/types": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.4.tgz", + "integrity": "sha512-UTCFOxC3FsFHb7lkRMVvgLzaRVamXuAs2Tz4wajva4WxtVY82eZeaUBtC2Zt95FU9TiznuC0Zk35tsim8jeVpg==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.10.4", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + } } }, "@babel/traverse": { - "version": "7.9.0", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.9.0.tgz", - "integrity": "sha512-jAZQj0+kn4WTHO5dUZkZKhbFrqZE7K5LAQ5JysMnmvGij+wOdr+8lWqPeW0BcF4wFwrEXXtdGO7wcV6YPJcf3w==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.10.4.tgz", + "integrity": "sha512-aSy7p5THgSYm4YyxNGz6jZpXf+Ok40QF3aA2LyIONkDHpAcJzDUqlCKXv6peqYUs2gmic849C/t2HKw2a2K20Q==", "dev": true, "requires": { - "@babel/code-frame": "^7.8.3", - "@babel/generator": "^7.9.0", - "@babel/helper-function-name": "^7.8.3", - "@babel/helper-split-export-declaration": "^7.8.3", - "@babel/parser": "^7.9.0", - "@babel/types": "^7.9.0", + "@babel/code-frame": "^7.10.4", + "@babel/generator": "^7.10.4", + "@babel/helper-function-name": "^7.10.4", + "@babel/helper-split-export-declaration": "^7.10.4", + "@babel/parser": "^7.10.4", + "@babel/types": "^7.10.4", "debug": "^4.1.0", "globals": "^11.1.0", "lodash": "^4.17.13" }, "dependencies": { "@babel/types": { - "version": "7.9.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.0.tgz", - "integrity": "sha512-BS9JKfXkzzJl8RluW4JGknzpiUV7ZrvTayM6yfqLTVBEnFtyowVIOu6rqxRd5cVO6yGoWf4T8u8dgK9oB+GCng==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.4.tgz", + "integrity": "sha512-UTCFOxC3FsFHb7lkRMVvgLzaRVamXuAs2Tz4wajva4WxtVY82eZeaUBtC2Zt95FU9TiznuC0Zk35tsim8jeVpg==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.9.0", + "@babel/helper-validator-identifier": "^7.10.4", "lodash": "^4.17.13", "to-fast-properties": "^2.0.0" } @@ -1023,9 +1278,9 @@ } }, "@rollup/plugin-alias": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@rollup/plugin-alias/-/plugin-alias-3.1.0.tgz", - "integrity": "sha512-IzoejtAqdfwAvx4D0bztAJFoL5Js36kJgnbO00zfI1B9jf9G80vWysyG0C4+E6w5uG5hz0EeetPpoBWKdNktCQ==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@rollup/plugin-alias/-/plugin-alias-3.1.1.tgz", + "integrity": "sha512-hNcQY4bpBUIvxekd26DBPgF7BT4mKVNDF5tBG4Zi+3IgwLxGYRY0itHs9D0oLVwXM5pvJDWJlBQro+au8WaUWw==", "dev": true, "requires": { "slash": "^3.0.0" @@ -1076,9 +1331,9 @@ } }, "babel-plugin-dynamic-import-node": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.0.tgz", - "integrity": "sha512-o6qFkpeQEBxcqt0XYlWzAVxNCSCZdUgcR8IRlhD/8DylxjjO4foPcvTW0GGKa/cVt3rvxZ7o5ippJ+/0nvLhlQ==", + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz", + "integrity": "sha512-jZVI+s9Zg3IqA/kdi0i6UDCybUI3aSBLnglhYbSSjKlV7yF1F/5LWv8MakQmvYpnbJDS6fcBL2KzHSxNCMtWSQ==", "dev": true, "requires": { "object.assign": "^4.1.0" @@ -1116,15 +1371,15 @@ } }, "browserslist": { - "version": "4.11.1", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.11.1.tgz", - "integrity": "sha512-DCTr3kDrKEYNw6Jb9HFxVLQNaue8z+0ZfRBRjmCunKDEXEBajKDj2Y+Uelg+Pi29OnvaSGwjOsnRyNEkXzHg5g==", + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.13.0.tgz", + "integrity": "sha512-MINatJ5ZNrLnQ6blGvePd/QOz9Xtu+Ne+x29iQSCHfkU5BugKVJwZKn/iiL8UbpIpa3JhviKjz+XxMo0m2caFQ==", "dev": true, "requires": { - "caniuse-lite": "^1.0.30001038", - "electron-to-chromium": "^1.3.390", - "node-releases": "^1.1.53", - "pkg-up": "^2.0.0" + "caniuse-lite": "^1.0.30001093", + "electron-to-chromium": "^1.3.488", + "escalade": "^3.0.1", + "node-releases": "^1.1.58" } }, "buffer-from": { @@ -1140,9 +1395,9 @@ "dev": true }, "caniuse-lite": { - "version": "1.0.30001042", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001042.tgz", - "integrity": "sha512-igMQ4dlqnf4tWv0xjaaE02op9AJ2oQzXKjWf4EuAHFN694Uo9/EfPVIPJcmn2WkU9RqozCxx5e2KPcVClHDbDw==", + "version": "1.0.30001096", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001096.tgz", + "integrity": "sha512-PFTw9UyVfbkcMEFs82q8XVlRayj7HKvnhu5BLcmjGpv+SNyiWasCcWXPGJuO0rK0dhLRDJmtZcJ+LHUfypbw1w==", "dev": true }, "chalk": { @@ -1302,28 +1557,28 @@ } }, "electron-to-chromium": { - "version": "1.3.408", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.408.tgz", - "integrity": "sha512-vn1zWIxIdyl0MR72lr81/7kHYTRlDRjJT4ocp8dtb85VhH46J3lNqDMEBljAKPKgguqjK0+WAbf3IL6ZKw72kQ==", + "version": "1.3.494", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.494.tgz", + "integrity": "sha512-EOZuaDT3L1sCIMAVN5J0nGuGWVq5dThrdl0d8XeDYf4MOzbXqZ19OLKesN8TZj0RxtpYjqHpiw/fR6BKWdMwYA==", "dev": true }, "es-abstract": { - "version": "1.17.5", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.5.tgz", - "integrity": "sha512-BR9auzDbySxOcfog0tLECW8l28eRGpDpU3Dm3Hp4q/N+VtLTmyj4EUN088XZWQDW/hzj6sYRDXeOFsaAODKvpg==", + "version": "1.17.6", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.6.tgz", + "integrity": "sha512-Fr89bON3WFyUi5EvAeI48QTWX0AyekGgLA8H+c+7fbfCkJwRWRMLd8CQedNEyJuoYYhmtEqY92pgte1FAhBlhw==", "dev": true, "requires": { "es-to-primitive": "^1.2.1", "function-bind": "^1.1.1", "has": "^1.0.3", "has-symbols": "^1.0.1", - "is-callable": "^1.1.5", - "is-regex": "^1.0.5", + "is-callable": "^1.2.0", + "is-regex": "^1.1.0", "object-inspect": "^1.7.0", "object-keys": "^1.1.1", "object.assign": "^4.1.0", - "string.prototype.trimleft": "^2.1.1", - "string.prototype.trimright": "^2.1.1" + "string.prototype.trimend": "^1.0.1", + "string.prototype.trimstart": "^1.0.1" } }, "es-get-iterator": { @@ -1360,6 +1615,12 @@ "is-symbol": "^1.0.2" } }, + "escalade": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.0.1.tgz", + "integrity": "sha512-DR6NO3h9niOT+MZs7bjxlj2a1k+POu5RN8CLTPX2+i78bRi9eLe7+0zXgUHMnGXWybYcL61E9hGhPKqedy8tQA==", + "dev": true + }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", @@ -1387,15 +1648,6 @@ "to-regex-range": "^5.0.1" } }, - "find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", - "dev": true, - "requires": { - "locate-path": "^2.0.0" - } - }, "for-each": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", @@ -1545,9 +1797,9 @@ "dev": true }, "is-callable": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.5.tgz", - "integrity": "sha512-ESKv5sMCJB2jnHTWZ3O5itG+O128Hsus4K4Qh1h2/cgn2vbgnLSVqfV46AeJA9D5EeeLa9w81KUXMtn34zhX+Q==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.0.tgz", + "integrity": "sha512-pyVD9AaGLxtg6srb2Ng6ynWJqkHU9bEM087AKck0w8QwDarTfNcpIYoU8x8Hv2Icm8u6kFJM18Dag8lyqGkviw==", "dev": true }, "is-date-object": { @@ -1607,12 +1859,12 @@ } }, "is-regex": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.5.tgz", - "integrity": "sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.0.tgz", + "integrity": "sha512-iI97M8KTWID2la5uYXlkbSDQIg4F6o1sYboZKKTDpnDQMLtUL86zxhgDet3Q2SriaYsyGqZ6Mn2SjbRKeLHdqw==", "dev": true, "requires": { - "has": "^1.0.3" + "has-symbols": "^1.0.1" } }, "is-set": { @@ -1667,22 +1919,28 @@ "dev": true }, "jest-worker": { - "version": "24.9.0", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-24.9.0.tgz", - "integrity": "sha512-51PE4haMSXcHohnSMdM42anbvZANYTqMrr52tVKPqqsPJMzoP6FYYDVqahX/HrAoKEKz3uUPzSvKs9A3qR4iVw==", + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.1.0.tgz", + "integrity": "sha512-Z9P5pZ6UC+kakMbNJn+tA2RdVdNX5WH1x+5UCBZ9MxIK24pjYtFt96fK+UwBTrjLYm232g1xz0L3eTh51OW+yQ==", "dev": true, "requires": { "merge-stream": "^2.0.0", - "supports-color": "^6.1.0" + "supports-color": "^7.0.0" }, "dependencies": { + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, "supports-color": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", - "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", "dev": true, "requires": { - "has-flag": "^3.0.0" + "has-flag": "^4.0.0" } } } @@ -1700,20 +1958,12 @@ "dev": true }, "json5": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.2.tgz", - "integrity": "sha512-MoUOQ4WdiN3yxhm7NEVJSJrieAo5hNSLQ5sj05OTRHPL9HOBy8u4Bu88jsC1jvqAdN+E1bJmsUcZH+1HQxliqQ==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.3.tgz", + "integrity": "sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==", "dev": true, "requires": { "minimist": "^1.2.5" - }, - "dependencies": { - "minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", - "dev": true - } } }, "leven": { @@ -1731,16 +1981,6 @@ "leven": "^3.1.0" } }, - "locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", - "dev": true, - "requires": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" - } - }, "lodash": { "version": "4.17.15", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", @@ -1793,9 +2033,9 @@ "dev": true }, "node-releases": { - "version": "1.1.53", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.53.tgz", - "integrity": "sha512-wp8zyQVwef2hpZ/dJH7SfSrIPD6YoJz6BDQDpGEkcA0s3LpAQoxBIYmfIq6QAhC1DhwsyCgTaTTcONwX8qzCuQ==", + "version": "1.1.59", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.59.tgz", + "integrity": "sha512-H3JrdUczbdiwxN5FuJPyCHnGHIFqQ0wWxo+9j1kAXAzqNMAHlo+4I/sYYxpyK0irQ73HgdiyzD32oqQDcU2Osw==", "dev": true }, "normalize-path": { @@ -1805,9 +2045,9 @@ "dev": true }, "object-inspect": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.7.0.tgz", - "integrity": "sha512-a7pEHdh1xKIAgTySUGgLMx/xwDZskN1Ud6egYYN3EdRW4ZMPNEDUTF+hwy2LUC+Bl+SyLXANnwz/jyh/qutKUw==", + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.8.0.tgz", + "integrity": "sha512-jLdtEOB112fORuypAyl/50VRVIBIdVQOSUUGQHzJ4xBSbit81zRarz7GThkEFZy1RceYrWYcPcBFPQwHyAc1gA==", "dev": true }, "object-is": { @@ -1847,36 +2087,6 @@ "wrappy": "1" } }, - "p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", - "dev": true, - "requires": { - "p-try": "^1.0.0" - } - }, - "p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", - "dev": true, - "requires": { - "p-limit": "^1.1.0" - } - }, - "p-try": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", - "dev": true - }, - "path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", - "dev": true - }, "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", @@ -1895,27 +2105,21 @@ "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", "dev": true }, - "pkg-up": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/pkg-up/-/pkg-up-2.0.0.tgz", - "integrity": "sha1-yBmscoBZpGHKscOImivjxJoATX8=", - "dev": true, - "requires": { - "find-up": "^2.1.0" - } - }, - "private": { - "version": "0.1.8", - "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", - "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==", - "dev": true - }, "process-nextick-args": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=", "dev": true }, + "randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "requires": { + "safe-buffer": "^5.1.0" + } + }, "re-emitter": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/re-emitter/-/re-emitter-1.1.3.tgz", @@ -1941,9 +2145,9 @@ } }, "regenerate": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.0.tgz", - "integrity": "sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg==", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.1.tgz", + "integrity": "sha512-j2+C8+NtXQgEKWk49MMP5P/u2GhnahTtVkRIHr5R5lVRlbKvmQ+oS+A5aLKWp2ma5VkT8sh6v+v4hbH0YHR66A==", "dev": true }, "regenerate-unicode-properties": { @@ -1962,13 +2166,12 @@ "dev": true }, "regenerator-transform": { - "version": "0.14.4", - "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.14.4.tgz", - "integrity": "sha512-EaJaKPBI9GvKpvUz2mz4fhx7WPgvwRLY9v3hlNHWmAuJHI13T4nwKnNvm5RWJzEdnI5g5UwtOww+S8IdoUC2bw==", + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.14.5.tgz", + "integrity": "sha512-eOf6vka5IO151Jfsw2NO9WpGX58W6wWmefK3I1zEGr0lOD0u8rwPaNqQL1aRxUaxLeKO3ArNh3VYg1KbaD+FFw==", "dev": true, "requires": { - "@babel/runtime": "^7.8.4", - "private": "^0.1.8" + "@babel/runtime": "^7.8.4" } }, "regexp.prototype.flags": { @@ -1996,9 +2199,9 @@ } }, "regjsgen": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.5.1.tgz", - "integrity": "sha512-5qxzGZjDs9w4tzT3TPhCJqWdCc3RLYwy9J2NB0nm5Lz+S273lvWcpjaTGHsT1dc6Hhfq41uSEOw8wBmxrKOuyg==", + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.5.2.tgz", + "integrity": "sha512-OFFT3MfrH90xIW8OOSyUrk6QHD5E9JOTeGodiJeBS3J6IwlgzJMNE/1bZklWz5oTg+9dCMyEetclvCVXOPoN3A==", "dev": true }, "regjsparser": { @@ -2037,9 +2240,9 @@ } }, "rollup": { - "version": "2.7.2", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.7.2.tgz", - "integrity": "sha512-SdtTZVMMVSPe7SNv4exUyPXARe5v/p3TeeG3LRA5WabLPJt4Usi3wVrvVlyAUTG40JJmqS6zbIHt2vWTss2prw==", + "version": "2.21.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.21.0.tgz", + "integrity": "sha512-BEGgy+wSzux7Ycq58pRiWEOBZaXRXTuvzl1gsm7gqmsAHxkWf9nyA5V2LN9fGSHhhDQd0/C13iRzSh4bbIpWZQ==", "dev": true, "requires": { "fsevents": "~2.1.2" @@ -2092,27 +2295,15 @@ "dev": true }, "rollup-plugin-terser": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/rollup-plugin-terser/-/rollup-plugin-terser-5.3.0.tgz", - "integrity": "sha512-XGMJihTIO3eIBsVGq7jiNYOdDMb3pVxuzY0uhOE/FM4x/u9nQgr3+McsjzqBn3QfHIpNSZmFnpoKAwHBEcsT7g==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/rollup-plugin-terser/-/rollup-plugin-terser-6.1.0.tgz", + "integrity": "sha512-4fB3M9nuoWxrwm39habpd4hvrbrde2W2GG4zEGPQg1YITNkM3Tqur5jSuXlWNzbv/2aMLJ+dZJaySc3GCD8oDw==", "dev": true, "requires": { - "@babel/code-frame": "^7.5.5", - "jest-worker": "^24.9.0", - "rollup-pluginutils": "^2.8.2", - "serialize-javascript": "^2.1.2", - "terser": "^4.6.2" - }, - "dependencies": { - "rollup-pluginutils": { - "version": "2.8.2", - "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz", - "integrity": "sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ==", - "dev": true, - "requires": { - "estree-walker": "^0.6.1" - } - } + "@babel/code-frame": "^7.8.3", + "jest-worker": "^26.0.0", + "serialize-javascript": "^3.0.0", + "terser": "^4.7.0" } }, "rollup-pluginutils": { @@ -2137,10 +2328,13 @@ "dev": true }, "serialize-javascript": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-2.1.2.tgz", - "integrity": "sha512-rs9OggEUF0V4jUSecXazOYsLfu7OGK2qIn3c7IPBiffz32XniEp/TX9Xmc9LQfK2nQ2QKHvZ2oygKUGU0lG4jQ==", - "dev": true + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-3.1.0.tgz", + "integrity": "sha512-JIJT1DGiWmIKhzRsG91aS6Ze4sFUrYbltlkg2onR5OrnNM02Kl/hnY/T4FN2omvyeBbQmMJv+K4cPOpGzOTFBg==", + "dev": true, + "requires": { + "randombytes": "^2.1.0" + } }, "shelljs": { "version": "0.8.4", @@ -2176,9 +2370,9 @@ "dev": true }, "source-map-support": { - "version": "0.5.16", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.16.tgz", - "integrity": "sha512-efyLRJDr68D9hBBNIPWFjhpFzURh+KJykQwvMyW5UiZzYwoF6l4YMMDIJJEyFWxWCqfyxLzz6tSfUFR+kXXsVQ==", + "version": "0.5.19", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", + "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", "dev": true, "requires": { "buffer-from": "^1.0.0", @@ -2229,28 +2423,6 @@ "es-abstract": "^1.17.5" } }, - "string.prototype.trimleft": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.1.2.tgz", - "integrity": "sha512-gCA0tza1JBvqr3bfAIFJGqfdRTyPae82+KTnm3coDXkZN9wnuW3HjGgN386D7hfv5CHQYCI022/rJPVlqXyHSw==", - "dev": true, - "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.5", - "string.prototype.trimstart": "^1.0.0" - } - }, - "string.prototype.trimright": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/string.prototype.trimright/-/string.prototype.trimright-2.1.2.tgz", - "integrity": "sha512-ZNRQ7sY3KroTaYjRS6EbNiiHrOkjihL9aQE/8gfQ4DtAC/aEBRHFJa44OmoWxGGqXuJlfKkZW4WcXErGr+9ZFg==", - "dev": true, - "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.5", - "string.prototype.trimend": "^1.0.0" - } - }, "string.prototype.trimstart": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.1.tgz", @@ -2350,9 +2522,9 @@ } }, "tape": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/tape/-/tape-5.0.0.tgz", - "integrity": "sha512-+fi4WiHuvxpKL6GpcvnG5PXfzopgw9h1JM9CJdpEPAbyU3r3VjRgt059fD6Up2/u6BQXmmxKmUMm6mXQP+HS3w==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/tape/-/tape-5.0.1.tgz", + "integrity": "sha512-wVsOl2shKPcjdJdc8a+PwacvrOdJZJ57cLUXlxW4TQ2R6aihXwG0m0bKm4mA4wjtQNTaLMCrYNEb4f9fjHKUYQ==", "dev": true, "requires": { "deep-equal": "^2.0.3", @@ -2398,9 +2570,9 @@ } }, "terser": { - "version": "4.6.6", - "resolved": "https://registry.npmjs.org/terser/-/terser-4.6.6.tgz", - "integrity": "sha512-4lYPyeNmstjIIESr/ysHg2vUPRGf2tzF9z2yYwnowXVuVzLEamPN1Gfrz7f8I9uEPuHcbFlW4PLIAsJoxXyJ1g==", + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-4.8.0.tgz", + "integrity": "sha512-EAPipTNeWsb/3wLPeup1tVPaXfIaU68xMnVdPafIL1TV05OhASArYyIfFvnvJCNrR2NIOvDVNNTFRa+Re2MWyw==", "dev": true, "requires": { "commander": "^2.20.0", diff --git a/package.json b/package.json index c867ce60..936fd95c 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "wtf_wikipedia", "description": "parse wikiscript into json", - "version": "8.3.0", + "version": "8.4.0", "author": "Spencer Kelly (http://spencermounta.in)", "repository": { "type": "git", @@ -23,6 +23,7 @@ "test": "TESTENV=dev node ./scripts/test.js", "testb": "TESTENV=prod node ./scripts/test.js", "test:fetch": "TESTENV=dev tape ./tests/fetch/*.test.js | tap-dancer", + "test:spec": "TESTENV=dev tape ./tests/fetch/*.test.js | tap-spec", "test:types": "ts-node ./tests/types/index.ts", "watch": "amble ./scratch.js", "lint": "eslint ./src/" @@ -53,18 +54,18 @@ }, "dependencies": {}, "devDependencies": { - "@babel/core": "7.9.0", - "@babel/preset-env": "7.9.5", - "@rollup/plugin-alias": "3.1.0", + "@babel/core": "7.10.4", + "@babel/preset-env": "7.10.4", + "@rollup/plugin-alias": "3.1.1", "amble": "1.0.0", - "rollup": "2.7.2", + "rollup": "2.21.0", "rollup-plugin-babel": "4.4.0", "rollup-plugin-commonjs": "10.1.0", "rollup-plugin-filesize-check": "0.0.1", - "rollup-plugin-terser": "5.3.0", + "rollup-plugin-terser": "6.1.0", "shelljs": "0.8.4", "tap-dancer": "0.2.0", - "tape": "5.0.0" + "tape": "5.0.1" }, "eslintIgnore": [ "builds/*.js" diff --git a/scratch.js b/scratch.js index 2040f5b4..9ed91775 100644 --- a/scratch.js +++ b/scratch.js @@ -5,11 +5,25 @@ wtf.extend(require('./plugins/wikitext/src')) // var str = `[[Image:Levellers declaration and standard.gif|thumb|Woodcut from a [[Diggers]] document by [[William Everard (Digger)|William Everard]]]]` // console.log(wtf(str).json()) -// wtf.fetch('Template:2019–20 coronavirus pandemic data/United States/California medical cases chart').then((doc) => { -// console.log(doc.template('medical cases chart')) +// wtf.fetch('Quartz', 'en').then((doc) => { +// // console.log(doc.lang()) +// console.log(doc.images().map((j) => j.url())) // }) -let str = `{{;}} hello` -// let str = `{{·}}` -let doc = wtf(str) -console.log('|' + doc.text() + '|') +let str = `{{Gallery +|title=Cultural depictions of George Washington +|width=160 | height=170 +|align=center +|footer=Example 1 +|File:VeryCool.JPG +|alt1=Statue facing a city building with Greek columns and huge U.S. flag +}}` + +let doc = wtf(str, { domain: 'cool.com' }) +console.log(doc.template()) +// console.log(doc.infobox().image().url()) +// console.log(doc.images().map((img) => img.url())) + +wtf.fetch('https://doom.fandom.com/wiki/Samuel_Hayden').then((doc) => { + console.log(doc.images().map((img) => img.url())) +}) diff --git a/src/01-document/Document.js b/src/01-document/Document.js index 3eb54c58..9cd428fb 100644 --- a/src/01-document/Document.js +++ b/src/01-document/Document.js @@ -43,6 +43,20 @@ const methods = { } return this.data.pageID }, + wikidata: function (id) { + if (id !== undefined) { + this.data.wikidata = id + } + return this.data.wikidata + }, + domain: function (str) { + if (str !== undefined) { + this.data.domain = str + } else { + // console.log(this.data) + } + return this.data.domain + }, language: function (lang) { if (lang !== undefined) { this.data.lang = lang @@ -55,7 +69,7 @@ const methods = { return null } let lang = this.language() || 'en' - let domain = this.data.domain || 'wikipedia.org' + let domain = this.domain() || 'wikipedia.org' // replace blank to underscore title = title.replace(/ /g, '_') title = encodeURIComponent(title) @@ -142,6 +156,8 @@ const methods = { obj.images = obj.images || [] obj.images.forEach((img) => { if (img instanceof Image === false) { + img.language = this.language() + img.domain = this.domain() img = new Image(img) } arr.push(img) diff --git a/src/01-document/preProcess/kill_xml.js b/src/01-document/preProcess/kill_xml.js index 732e5fa0..631ef490 100644 --- a/src/01-document/preProcess/kill_xml.js +++ b/src/01-document/preProcess/kill_xml.js @@ -18,14 +18,14 @@ const ignore = [ 'references', 'source', 'syntaxhighlight', - 'timeline' + 'timeline', ] const openTag = `< ?(${ignore.join('|')}) ?[^>]{0,200}?>` const closeTag = `< ?/ ?(${ignore.join('|')}) ?>` const anyChar = '\\s\\S' //including newline const noThanks = new RegExp(`${openTag}[${anyChar}]+?${closeTag}`, 'ig') -const kill_xml = function(wiki) { +const kill_xml = function (wiki) { //( tags are parsed in Section class) - luckily, refs can't be recursive. //types of html/xml that we want to trash completely. wiki = wiki.replace(noThanks, ' ') @@ -33,9 +33,18 @@ const kill_xml = function(wiki) { wiki = wiki.replace(/ ?< ?(span|div|table|data) [a-zA-Z0-9=%\.#:;'" ]{2,100}\/? ?> ?/g, ' ') // //only kill ref tags if they are selfclosing wiki = wiki.replace(/ ?< ?(ref) [a-zA-Z0-9=" ]{2,100}\/ ?> ?/g, ' ') // + + // convert these html tags to known formatting + wiki = wiki.replace(/(.*?)<\/i>/g, `''$1''`) + wiki = wiki.replace(/(.*?)<\/b>/g, `'''$1'''`) + + // these are better-handled with templates + wiki = wiki.replace(/(.*?)<\/sub>/g, `{{sub|$1}}`) + wiki = wiki.replace(/(.*?)<\/sup>/g, `{{sup|$1}}`) + //some formatting xml, we'll keep their insides though wiki = wiki.replace(/ ?<[ \/]?(p|sub|sup|span|nowiki|div|table|br|tr|td|th|pre|pre2|hr)[ \/]?> ?/g, ' ') //, - wiki = wiki.replace(/ ?<[ \/]?(abbr|bdi|bdo|blockquote|cite|del|dfn|em|i|ins|kbd|mark|q|s|small)[ \/]?> ?/g, ' ') //, + wiki = wiki.replace(/ ?<[ \/]?(abbr|bdi|bdo|blockquote|cite|del|dfn|em|ins|kbd|mark|q|s|small)[ \/]?> ?/g, ' ') //, wiki = wiki.replace(/ ?<[ \/]?h[0-9][ \/]?> ?/g, ' ') //

,

wiki = wiki.replace(/ ?< ?br ?\/> ?/g, '\n') //
return wiki.trim() diff --git a/src/02-section/index.js b/src/02-section/index.js index 813ca270..30f0ca40 100644 --- a/src/02-section/index.js +++ b/src/02-section/index.js @@ -10,15 +10,15 @@ const parse = { paragraphs: require('../03-paragraph'), templates: require('../template'), references: require('../reference'), - startEndTemplates: require('./start-to-end') + startEndTemplates: require('./start-to-end'), } -const oneSection = function(section, doc) { - parse.startEndTemplates(section) +const oneSection = function (section, doc) { + parse.startEndTemplates(section, doc) //parse-out the tags parse.references(section) //parse-out all {{templates}} - parse.templates(section) + parse.templates(section, doc) // //parse the tables parse.table(section) //now parse all double-newlines @@ -27,7 +27,7 @@ const oneSection = function(section, doc) { return section } -const removeReferenceSection = function(sections) { +const removeReferenceSection = function (sections) { return sections.filter((s, i) => { if (isReference.test(s.title()) === true) { if (s.paragraphs().length > 0) { @@ -47,7 +47,7 @@ const removeReferenceSection = function(sections) { }) } -const parseSections = function(doc) { +const parseSections = function (doc) { let sections = [] let split = doc.wiki.split(section_reg) for (let i = 0; i < split.length; i += 2) { @@ -64,7 +64,7 @@ const parseSections = function(doc) { templates: [], tables: [], infoboxes: [], - references: [] + references: [], } //figure-out title/depth parse.heading(section, heading) diff --git a/src/02-section/start-to-end/gallery.js b/src/02-section/start-to-end/gallery.js index 86738e28..57dc882c 100644 --- a/src/02-section/start-to-end/gallery.js +++ b/src/02-section/start-to-end/gallery.js @@ -3,16 +3,18 @@ const Image = require('../../image/Image') //okay, is a xml-tag, with newline-seperated data, somehow pivoted by '|'... //all deities help us. truly -> https://en.wikipedia.org/wiki/Help:Gallery_tag // - not to be confused with https://en.wikipedia.org/wiki/Template:Gallery... -const parseGallery = function(section) { +const parseGallery = function (section, doc) { let wiki = section.wiki wiki = wiki.replace(/]*?)>([\s\S]+?)<\/gallery>/g, (_, attrs, inside) => { let images = inside.split(/\n/g) - images = images.filter(str => str && str.trim() !== '') + images = images.filter((str) => str && str.trim() !== '') //parse the line, which has an image and sometimes a caption - images = images.map(str => { + images = images.map((str) => { let arr = str.split(/\|/) let obj = { - file: arr[0].trim() + file: arr[0].trim(), + lang: doc.language, + domain: doc.domain, } let img = new Image(obj).json() let caption = arr.slice(1).join('|') @@ -26,7 +28,7 @@ const parseGallery = function(section) { section.templates.push({ template: 'gallery', images: images, - pos: section.title + pos: section.title, }) } return '' diff --git a/src/02-section/start-to-end/index.js b/src/02-section/start-to-end/index.js index 6d7c1b2c..9e892dc9 100644 --- a/src/02-section/start-to-end/index.js +++ b/src/02-section/start-to-end/index.js @@ -7,9 +7,9 @@ const parseMath = require('./math') // Most templates are '{{template}}', but then, some are ''. // ... others are {{start}}...{{end}} // -> these are those ones. -const xmlTemplates = function(section) { +const xmlTemplates = function (section, doc) { parseElection(section) - parseGallery(section) + parseGallery(section, doc) parseMath(section) parseMlb(section) parseMMA(section) diff --git a/src/03-paragraph/index.js b/src/03-paragraph/index.js index 538566cd..8151f614 100644 --- a/src/03-paragraph/index.js +++ b/src/03-paragraph/index.js @@ -4,25 +4,25 @@ const parseSentences = require('../04-sentence').byParagraph const twoNewLines = /\r?\n\r?\n/ const parse = { image: require('../image'), - list: require('../list') + list: require('../list'), } -const parseParagraphs = function(section) { +const parseParagraphs = function (section, doc) { let wiki = section.wiki let paragraphs = wiki.split(twoNewLines) //don't create empty paragraphs - paragraphs = paragraphs.filter(p => p && p.trim().length > 0) - paragraphs = paragraphs.map(str => { + paragraphs = paragraphs.filter((p) => p && p.trim().length > 0) + paragraphs = paragraphs.map((str) => { let paragraph = { wiki: str, lists: [], sentences: [], - images: [] + images: [], } //parse the lists parse.list(paragraph) // parse images - parse.image(paragraph) + parse.image(paragraph, doc) //parse the sentences parseSentences(paragraph) return new Paragraph(paragraph) diff --git a/src/_fetch/01-makeUrl.js b/src/_fetch/01-makeUrl.js index 3dff63e1..043f2c7a 100644 --- a/src/_fetch/01-makeUrl.js +++ b/src/_fetch/01-makeUrl.js @@ -2,16 +2,16 @@ const isInterWiki = /(wiktionary|wikinews|wikibooks|wikiquote|wikisource|wikispe const defaults = { action: 'query', - prop: 'revisions', //we use the 'revisions' api here, instead of the Raw api, for its CORS-rules.. + prop: 'revisions|pageprops', //we use the 'revisions' api here, instead of the Raw api, for its CORS-rules.. rvprop: 'content', maxlag: 5, rvslots: 'main', origin: '*', format: 'json', - redirects: 'true' + redirects: 'true', } -const toQueryString = function(obj) { +const toQueryString = function (obj) { return Object.entries(obj) .map(([key, value]) => { return `${encodeURIComponent(key)}=${encodeURIComponent(value)}` @@ -19,18 +19,18 @@ const toQueryString = function(obj) { .join('&') } -const isArray = function(arr) { +const isArray = function (arr) { return Object.prototype.toString.call(arr) === '[object Array]' } -const cleanTitle = page => { +const cleanTitle = (page) => { page = page.replace(/ /g, '_') page = page.trim() // page = encodeURIComponent(page) return page } -const makeUrl = function(options) { +const makeUrl = function (options) { let params = Object.assign({}, defaults) // default url let url = `https://${options.lang}.${options.wiki}.org/w/api.php?` diff --git a/src/_fetch/02-getResult.js b/src/_fetch/02-getResult.js index 3f3f3abf..9d1c5bf4 100644 --- a/src/_fetch/02-getResult.js +++ b/src/_fetch/02-getResult.js @@ -1,8 +1,8 @@ //this data-format from mediawiki api is nutso -const getResult = function(data, options) { +const getResult = function (data, options) { options = options || {} let pages = Object.keys(data.query.pages) - let docs = pages.map(id => { + let docs = pages.map((id) => { let page = data.query.pages[id] || {} if (page.hasOwnProperty('missing') || page.hasOwnProperty('invalid')) { return null @@ -13,10 +13,18 @@ const getResult = function(data, options) { if (!text && page.revisions[0].slots) { text = page.revisions[0].slots.main['*'] } + page.pageprops = page.pageprops || {} + let domain = options.domain + if (!domain && options.wiki) { + domain = `${options.wiki}.org` + } let meta = Object.assign({}, options, { title: page.title, pageID: page.pageid, - namespace: page.ns + namespace: page.ns, + domain: domain, + wikidata: page.pageprops.wikibase_item, + description: page.pageprops['wikibase-shortdesc'], }) try { return { wiki: text, meta: meta } diff --git a/src/_fetch/index.js b/src/_fetch/index.js index 8cdf6c9b..4e8ae30a 100644 --- a/src/_fetch/index.js +++ b/src/_fetch/index.js @@ -11,10 +11,10 @@ const defaults = { wiki: 'wikipedia', domain: null, follow_redirects: true, - path: 'api.php' //some 3rd party sites use a weird path + path: 'api.php', //some 3rd party sites use a weird path } -const fetch = function(title, options, c) { +const fetch = function (title, options, c) { let callback = null if (typeof options === 'function') { callback = options @@ -40,7 +40,7 @@ const fetch = function(title, options, c) { const url = makeUrl(options) const headers = makeHeaders(options) return http(url, headers) - .then(res => { + .then((res) => { try { let data = getResult(res, options) data = parseDoc(data) @@ -52,7 +52,7 @@ const fetch = function(title, options, c) { throw e } }) - .catch(e => { + .catch((e) => { console.error(e) if (callback) { callback(e, null) diff --git a/src/_fetch/random.js b/src/_fetch/random.js index 818c212a..a529acf4 100644 --- a/src/_fetch/random.js +++ b/src/_fetch/random.js @@ -7,13 +7,13 @@ const defaults = { lang: 'en', wiki: 'wikipedia', domain: null, - path: 'w/api.php' //some 3rd party sites use a weird path + path: 'w/api.php', //some 3rd party sites use a weird path } -const isObject = function(obj) { +const isObject = function (obj) { return obj && Object.prototype.toString.call(obj) === '[object Object]' } -const fetchRandom = function(lang, options) { +const fetchRandom = function (lang, options) { options = options || {} options = Object.assign({}, defaults, options) //support lang 2nd param @@ -27,11 +27,11 @@ const fetchRandom = function(lang, options) { if (options.domain) { url = `https://${options.domain}/${options.path}?` } - url += `format=json&action=query&generator=random&grnnamespace=0&prop=revisions&rvprop=content&grnlimit=1&rvslots=main&origin=*` + url += `format=json&action=query&generator=random&grnnamespace=0&prop=revisions|pageprops&rvprop=content&grnlimit=1&rvslots=main&origin=*` const headers = makeHeaders(options) return http(url, headers) - .then(res => { + .then((res) => { try { let data = getResult(res) return parseDoc(data) @@ -39,7 +39,7 @@ const fetchRandom = function(lang, options) { throw e } }) - .catch(e => { + .catch((e) => { console.error(e) return null }) diff --git a/src/_version.js b/src/_version.js index 86631f07..535368a2 100644 --- a/src/_version.js +++ b/src/_version.js @@ -1 +1 @@ -module.exports = '8.3.0' \ No newline at end of file +module.exports = '8.4.0' \ No newline at end of file diff --git a/src/image/Image.js b/src/image/Image.js index 88e94931..3f86df4f 100644 --- a/src/image/Image.js +++ b/src/image/Image.js @@ -1,7 +1,7 @@ const toJson = require('./toJson') -const server = 'https://wikipedia.org/wiki/Special:Redirect/file/' +const server = 'wikipedia.org' -const encodeTitle = function(file) { +const encodeTitle = function (file) { let title = file.replace(/^(image|file?)\:/i, '') //titlecase it title = title.charAt(0).toUpperCase() + title.substring(1) @@ -11,17 +11,17 @@ const encodeTitle = function(file) { } //the wikimedia image url is a little silly: -const makeSrc = function(file) { +const makeSrc = function (file) { let title = encodeTitle(file) title = encodeURIComponent(title) return title } //the class for our image generation functions -const Image = function(data) { +const Image = function (data) { Object.defineProperty(this, 'data', { enumerable: false, - value: data + value: data, }) } @@ -48,12 +48,15 @@ const methods = { return [] }, url() { - return server + makeSrc(this.file()) + // let lang = 'en' //this.language() || 'en' //hmm: get actual language? + let fileName = makeSrc(this.file()) + let domain = this.data.domain || server + let path = `wiki/Special:Redirect/file` + return `https://${domain}/${path}/${fileName}` }, thumbnail(size) { size = size || 300 - let path = makeSrc(this.file()) - return server + path + '?width=' + size + return this.url() + '?width=' + size }, format() { let arr = this.file().split('.') @@ -62,16 +65,16 @@ const methods = { } return null }, - json: function(options) { + json: function (options) { options = options || {} return toJson(this, options) }, - text: function() { + text: function () { return '' - } + }, } -Object.keys(methods).forEach(k => { +Object.keys(methods).forEach((k) => { Image.prototype[k] = methods[k] }) diff --git a/src/image/index.js b/src/image/index.js index 9590c7e5..4a46a800 100644 --- a/src/image/index.js +++ b/src/image/index.js @@ -23,11 +23,11 @@ const imgLayouts = { baseline: true, middle: true, sub: true, - super: true + super: true, } //images are usually [[image:my_pic.jpg]] -const oneImage = function(img) { +const oneImage = function (img, doc) { let m = img.match(file_reg) if (m === null || !m[2]) { return null @@ -40,7 +40,9 @@ const oneImage = function(img) { title = title.replace(/ /g, '_') if (title) { let obj = { - file: file + file: file, + lang: doc.lang, + domain: doc.domain, } //try to grab other metadata, too img = img.replace(/^\[\[/, '') @@ -55,24 +57,23 @@ const oneImage = function(img) { obj.alt = imgData.alt } //remove 'thumb' and things - arr = arr.filter(str => imgLayouts.hasOwnProperty(str) === false) + arr = arr.filter((str) => imgLayouts.hasOwnProperty(str) === false) if (arr[arr.length - 1]) { obj.caption = parseSentence(arr[arr.length - 1]) } - return new Image(obj, img) + return new Image(obj) } return null } -const parseImages = function(paragraph) { +const parseImages = function (paragraph, doc) { let wiki = paragraph.wiki - //parse+remove scary '[[ [[]] ]]' stuff let matches = nested_find(wiki) - matches.forEach(function(s) { + matches.forEach(function (s) { if (isFile.test(s) === true) { paragraph.images = paragraph.images || [] - let img = oneImage(s) + let img = oneImage(s, doc) if (img) { paragraph.images.push(img) } diff --git a/src/infobox/Infobox.js b/src/infobox/Infobox.js index 92a3caae..e579fdb4 100644 --- a/src/infobox/Infobox.js +++ b/src/infobox/Infobox.js @@ -1,41 +1,42 @@ const toJson = require('./toJson') const Image = require('../image/Image') -const normalize = str => { +const normalize = (str) => { str = str.toLowerCase() str = str.replace(/[-_]/g, ' ') return str.trim() } //a formal key-value data table about a topic -const Infobox = function(obj) { +const Infobox = function (obj) { this._type = obj.type + this.domain = obj.domain Object.defineProperty(this, 'data', { enumerable: false, - value: obj.data + value: obj.data, }) } const methods = { - type: function() { + type: function () { return this._type }, - links: function(n) { + links: function (n) { let arr = [] - Object.keys(this.data).forEach(k => { - this.data[k].links().forEach(l => arr.push(l)) + Object.keys(this.data).forEach((k) => { + this.data[k].links().forEach((l) => arr.push(l)) }) if (typeof n === 'number') { return arr[n] } else if (typeof n === 'string') { //grab a link like .links('Fortnight') n = n.charAt(0).toUpperCase() + n.substring(1) //titlecase it - let link = arr.find(o => o.page() === n) + let link = arr.find((o) => o.page() === n) return link === undefined ? [] : [link] } return arr }, - image: function() { + image: function () { let s = this.get('image') || this.get('image2') || this.get('logo') if (!s) { return null @@ -43,9 +44,10 @@ const methods = { let obj = s.json() obj.file = obj.text obj.text = '' + obj.domain = this.domain // add domain information for image return new Image(obj) }, - get: function(key = '') { + get: function (key = '') { key = normalize(key) let keys = Object.keys(this.data) for (let i = 0; i < keys.length; i += 1) { @@ -56,25 +58,25 @@ const methods = { } return null }, - text: function() { + text: function () { return '' }, - json: function(options) { + json: function (options) { options = options || {} return toJson(this, options) }, - keyValue: function() { + keyValue: function () { return Object.keys(this.data).reduce((h, k) => { if (this.data[k]) { h[k] = this.data[k].text() } return h }, {}) - } + }, } //aliases -Object.keys(methods).forEach(k => { +Object.keys(methods).forEach((k) => { Infobox.prototype[k] = methods[k] }) Infobox.prototype.data = Infobox.prototype.keyValue diff --git a/src/link/parse.js b/src/link/parse.js index 232123f0..f24822a7 100644 --- a/src/link/parse.js +++ b/src/link/parse.js @@ -1,25 +1,25 @@ const parse_interwiki = require('./interwiki') const ignore_links = /^:?(category|catégorie|Kategorie|Categoría|Categoria|Categorie|Kategoria|تصنيف|image|file|image|fichier|datei|media):/i const external_link = /\[(https?|news|ftp|mailto|gopher|irc)(:\/\/[^\]\| ]{4,1500})([\| ].*?)?\]/g -const link_reg = /\[\[(.{0,160}?)\]\]([a-z]+)?(\w{0,10})/gi //allow dangling suffixes - "[[flanders]]s" +const link_reg = /\[\[(.{0,160}?)\]\]([a-z]+)?/gi //allow dangling suffixes - "[[flanders]]s" -const external_links = function(links, str) { - str.replace(external_link, function(raw, protocol, link, text) { +const external_links = function (links, str) { + str.replace(external_link, function (raw, protocol, link, text) { text = text || '' links.push({ type: 'external', site: protocol + link, text: text.trim(), - raw: raw + raw: raw, }) return text }) return links } -const internal_links = function(links, str) { +const internal_links = function (links, str) { //regular links - str.replace(link_reg, function(raw, s, suffix) { + str.replace(link_reg, function (raw, s, suffix) { let txt = null //make a copy of original let link = s @@ -46,7 +46,7 @@ const internal_links = function(links, str) { //remove anchors from end [[toronto#history]] let obj = { page: link, - raw: raw + raw: raw, } obj.page = obj.page.replace(/#(.*)/, (a, b) => { obj.anchor = b @@ -79,7 +79,7 @@ const internal_links = function(links, str) { } //grab an array of internal links in the text -const parse_links = function(str) { +const parse_links = function (str) { let links = [] //first, parse external links links = external_links(links, str) diff --git a/src/template/index.js b/src/template/index.js index 6f396d49..e12d212a 100644 --- a/src/template/index.js +++ b/src/template/index.js @@ -24,7 +24,7 @@ const isInfobox = function (obj) { } //reduce the scary recursive situations -const allTemplates = function (section) { +const allTemplates = function (section, doc) { let wiki = section.wiki // nested data-structure of templates let list = findTemplates(wiki) @@ -64,6 +64,7 @@ const allTemplates = function (section) { return false } if (isInfobox(obj) === true) { + obj.domain = doc.domain // section.infoboxes.push(new Infobox(obj)) return false } diff --git a/src/template/templates/brackets.js b/src/template/templates/brackets.js index bd24b2c0..166b46c1 100644 --- a/src/template/templates/brackets.js +++ b/src/template/templates/brackets.js @@ -1,6 +1,6 @@ const parse = require('../_parsers/parse') -const zeroPad = function(num) { +const zeroPad = function (num) { num = String(num) if (num.length === 1) { num = '0' + num @@ -8,7 +8,7 @@ const zeroPad = function(num) { return num } -const parseTeam = function(obj, round, team) { +const parseTeam = function (obj, round, team) { if (obj[`rd${round}-team${zeroPad(team)}`]) { team = zeroPad(team) } @@ -20,12 +20,12 @@ const parseTeam = function(obj, round, team) { return { team: obj[`rd${round}-team${team}`], score: score, - seed: obj[`rd${round}-seed${team}`] + seed: obj[`rd${round}-seed${team}`], } } //these are weird. -const playoffBracket = function(tmpl) { +const playoffBracket = function (tmpl) { let rounds = [] let obj = parse(tmpl) //try some rounds @@ -47,17 +47,17 @@ const playoffBracket = function(tmpl) { } return { template: 'playoffbracket', - rounds: rounds + rounds: rounds, } } let all = { //playoff brackets - '4teambracket': function(tmpl, list) { + '4teambracket': function (tmpl, list) { let obj = playoffBracket(tmpl) list.push(obj) return '' - } + }, } //a bunch of aliases for these ones: @@ -68,7 +68,7 @@ const brackets = [ '8teambracket', '16teambracket', '32teambracket', - + '4roundbracket-byes', 'cwsbracket', 'nhlbracket', 'nhlbracket-reseed', @@ -76,6 +76,7 @@ const brackets = [ '4teambracket-ncaa', '4teambracket-mma', '4teambracket-mlb', + '16teambracket-two-reseeds', '8teambracket-nhl', '8teambracket-mlb', @@ -92,9 +93,9 @@ const brackets = [ '16teambracket-swtc', '16teambracket-afc', '16teambracket-tennis3', - '16teambracket-tennis5' + '16teambracket-tennis5', ] -brackets.forEach(key => { +brackets.forEach((key) => { all[key] = all['4teambracket'] }) diff --git a/src/template/templates/formatting/format.js b/src/template/templates/formatting/format.js index 7c1b7e55..851b9f69 100644 --- a/src/template/templates/formatting/format.js +++ b/src/template/templates/formatting/format.js @@ -2,12 +2,12 @@ const parse = require('../../_parsers/parse') let templates = { //a convulated way to make a xml tag - https://en.wikipedia.org/wiki/Template:Tag - tag: tmpl => { + tag: (tmpl) => { let obj = parse(tmpl, ['tag', 'open']) const ignore = { span: true, div: true, - p: true + p: true, } //pair, empty, close, single if (!obj.open || obj.open === 'pair') { @@ -20,7 +20,7 @@ let templates = { return '' }, //dumb inflector - https://en.wikipedia.org/wiki/Template:Plural - plural: tmpl => { + plural: (tmpl) => { tmpl = tmpl.replace(/plural:/, 'plural|') let order = ['num', 'word'] let obj = parse(tmpl, order) @@ -36,7 +36,7 @@ let templates = { return num + ' ' + word }, // https://en.wikipedia.org/wiki/Template:First_word - 'first word': tmpl => { + 'first word': (tmpl) => { let obj = parse(tmpl, ['text']) let str = obj.text if (obj.sep) { @@ -44,12 +44,12 @@ let templates = { } return str.split(' ')[0] }, - trunc: tmpl => { + trunc: (tmpl) => { let order = ['str', 'len'] let obj = parse(tmpl, order) return obj.str.substr(0, obj.len) }, - 'str mid': tmpl => { + 'str mid': (tmpl) => { let order = ['str', 'start', 'end'] let obj = parse(tmpl, order) let start = parseInt(obj.start, 10) - 1 @@ -61,7 +61,7 @@ let templates = { p2: 1, p3: 2, //formatting things - https://en.wikipedia.org/wiki/Template:Nobold - braces: tmpl => { + braces: (tmpl) => { let obj = parse(tmpl, ['text']) let attrs = '' if (obj.list) { @@ -87,29 +87,29 @@ let templates = { //https://en.wikipedia.org/wiki/Template:Resize resize: 1, //https://en.wikipedia.org/wiki/Template:Ra - ra: tmpl => { + ra: (tmpl) => { let obj = parse(tmpl, ['hours', 'minutes', 'seconds']) return [obj.hours || 0, obj.minutes || 0, obj.seconds || 0].join(':') }, //https://en.wikipedia.org/wiki/Template:Deg2HMS - deg2hms: tmpl => { + deg2hms: (tmpl) => { //this template should do the conversion let obj = parse(tmpl, ['degrees']) return (obj.degrees || '') + '°' }, - hms2deg: tmpl => { + hms2deg: (tmpl) => { //this template should do the conversion too let obj = parse(tmpl, ['hours', 'minutes', 'seconds']) return [obj.hours || 0, obj.minutes || 0, obj.seconds || 0].join(':') }, - decdeg: tmpl => { + decdeg: (tmpl) => { //this template should do the conversion too let obj = parse(tmpl, ['deg', 'min', 'sec', 'hem', 'rnd']) return (obj.deg || obj.degrees) + '°' }, rnd: 0, //https://en.wikipedia.org/wiki/Template:DEC - dec: tmpl => { + dec: (tmpl) => { let obj = parse(tmpl, ['degrees', 'minutes', 'seconds']) let str = (obj.degrees || 0) + '°' if (obj.minutes) { @@ -121,7 +121,7 @@ let templates = { return str }, //https://en.wikipedia.org/wiki/Template:Val - val: tmpl => { + val: (tmpl) => { let obj = parse(tmpl, ['number', 'uncertainty']) let num = obj.number if (num && Number(num)) { @@ -140,7 +140,19 @@ let templates = { str = str + ' ' + (obj.u || obj.ul || obj.upl) } return str - } + }, + //https://en.wikipedia.org/wiki/Template:Sub + sub: (tmpl, list) => { + let obj = parse(tmpl, ['text']) + list.push(obj) + return obj.text || '' + }, + //https://en.wikipedia.org/wiki/Template:Sup + sup: (tmpl, list) => { + let obj = parse(tmpl, ['text']) + list.push(obj) + return obj.text || '' + }, } //aliases @@ -188,10 +200,10 @@ let inline = [ 'var', 'mvar', 'pre2', - 'code' + 'code', ] -inline.forEach(k => { - templates[k] = tmpl => { +inline.forEach((k) => { + templates[k] = (tmpl) => { return parse(tmpl, ['text']).text || '' } }) diff --git a/src/template/templates/wikipedia/page.js b/src/template/templates/wikipedia/page.js index b10e7155..a26c311a 100644 --- a/src/template/templates/wikipedia/page.js +++ b/src/template/templates/wikipedia/page.js @@ -16,11 +16,10 @@ const sisterProjects = { d: 'wikidata', species: 'wikispecies', m: 'meta', - mw: 'mediawiki' + mw: 'mediawiki', } const parsers = { - // https://en.wikipedia.org/wiki/Template:About about: (tmpl, list) => { let obj = parse(tmpl) @@ -43,21 +42,21 @@ const parsers = { }, // https://en.wikipedia.org/wiki/Template:See - 'see': (tmpl, list) => { + see: (tmpl, list) => { let obj = parse(tmpl) list.push(obj) return '' }, // https://en.wikipedia.org/wiki/Template:For - 'for': (tmpl, list) => { + for: (tmpl, list) => { let obj = parse(tmpl) list.push(obj) return '' }, // https://en.wikipedia.org/wiki/Template:Further - 'further': (tmpl, list) => { + further: (tmpl, list) => { let obj = parse(tmpl) list.push(obj) return '' @@ -71,7 +70,7 @@ const parsers = { }, // https://en.wikipedia.org/wiki/Template:Listen - 'listen': (tmpl, list) => { + listen: (tmpl, list) => { let obj = parse(tmpl) list.push(obj) return '' @@ -87,13 +86,13 @@ const parsers = { for (let i = 0; i < lines.length; i += 2) { links.push({ page: lines[i + 1], - desc: lines[i] + desc: lines[i], }) } let obj = { template: 'redirect', redirect: data.redirect, - links: links + links: links, } list.push(obj) return '' @@ -137,14 +136,14 @@ const parsers = { let data = parse(tmpl) //rename 'wd' to 'wikidata' let links = {} - Object.keys(sisterProjects).forEach(k => { + Object.keys(sisterProjects).forEach((k) => { if (data.hasOwnProperty(k) === true) { links[sisterProjects[k]] = data[k] //.text(); } }) let obj = { template: 'sister project links', - links: links + links: links, } list.push(obj) return '' @@ -153,7 +152,7 @@ const parsers = { //https://en.wikipedia.org/wiki/Template:Subject_bar 'subject bar': (tmpl, list) => { let data = parse(tmpl) - Object.keys(data).forEach(k => { + Object.keys(data).forEach((k) => { //rename 'voy' to 'wikivoyage' if (sisterProjects.hasOwnProperty(k)) { data[sisterProjects[k]] = data[k] @@ -162,7 +161,7 @@ const parsers = { }) let obj = { template: 'subject bar', - links: data + links: data, } list.push(obj) return '' @@ -174,16 +173,17 @@ const parsers = { //https://en.wikipedia.org/wiki/Template:Gallery gallery: (tmpl, list) => { let obj = parse(tmpl) - let images = (obj.list || []).filter(line => /^ *File ?:/.test(line)) - images = images.map(file => { + let images = (obj.list || []).filter((line) => /^ *File ?:/.test(line)) + images = images.map((file) => { let img = { - file: file + file: file, } + // TODO: add lang and domain information return new Image(img).json() }) obj = { template: 'gallery', - images: images + images: images, } list.push(obj) return '' @@ -194,7 +194,7 @@ const parsers = { list.push(data) return '' }, - unreferenced: ['date'] + unreferenced: ['date'], } //aliases parsers['cite'] = parsers.citation diff --git a/tests/domain.test.js b/tests/domain.test.js new file mode 100644 index 00000000..ee37d3c1 --- /dev/null +++ b/tests/domain.test.js @@ -0,0 +1,49 @@ +var test = require('tape') +var wtf = require('./lib') + +test('domain - normal', (t) => { + let str = `hello [[File:SpencerKelly.jpg]] world` + let doc = wtf(str, { domain: 'cool.com' }) + let img = doc.images(0).url() + t.equal(img, 'https://cool.com/wiki/Special:Redirect/file/SpencerKelly.jpg', 'set new domain - normal') + t.end() +}) + +test('domain - xml gallery', (t) => { + let str = ` +File:YYZ Aerial 2.jpg +` + let doc = wtf(str, { domain: 'cool.com' }) + let img = doc.images(0).url() + t.equal(img, 'https://cool.com/wiki/Special:Redirect/file/YYZ_Aerial_2.jpg', 'set new domain - xml') + t.end() +}) + +test('domain - template gallery', (t) => { + let str = `{{Gallery +|title=Cultural depictions of George Washington +|width=160 | height=170 +|align=center +|footer=Example 1 +|File:VeryCool.JPG +|alt1=Statue facing a city building with Greek columns and huge U.S. flag +}}` + let doc = wtf(str, { domain: 'verycool.com' }) + let img = doc.images(0).url() + t.equal(img, 'https://verycool.com/wiki/Special:Redirect/file/VeryCool.JPG', 'set new domain - template') + t.end() +}) + +test('domain - infobox', (t) => { + let str = `{{Infobox settlement +| name = New York City +| image = Cool.jpg +}}` + let doc = wtf(str, { domain: 'cool.com' }) + let img = doc.images(0).url() + t.equal(img, 'https://cool.com/wiki/Special:Redirect/file/Cool.jpg', 'set new domain - infobox') + + img = doc.infobox().image().url() + t.equal(img, 'https://cool.com/wiki/Special:Redirect/file/Cool.jpg', 'set new domain - infobox-direct') + t.end() +}) diff --git a/tests/fetch/image.test.js b/tests/fetch/image.test.js new file mode 100644 index 00000000..618cf92b --- /dev/null +++ b/tests/fetch/image.test.js @@ -0,0 +1,37 @@ +const test = require('tape') +const wtf = require('../lib') + +test('3rd-party image bulbapedia', function (t) { + t.plan(3) + var p = wtf.fetch('https://bulbapedia.bulbagarden.net/wiki/Aegislash_(Pok%C3%A9mon)', { path: 'w/api.php' }) + + p.then((doc) => { + t.equal(doc.domain(), 'bulbapedia.bulbagarden.net', 'got domain from url input') + + let urls = doc.images().map((j) => j.url()) + t.ok(urls.length > 2, 'got urls') + t.ok(urls[0].match(/bulbapedia\.bulbagarden\.net/), '3rd-party image url') + }) + p.catch(function (e) { + t.throw(e) + }) +}) + +test('3rd-party image mozilla', function (t) { + t.plan(3) + var p = wtf.fetch('WeeklyUpdates/020-06-29', { domain: 'wiki.mozilla.org' }) + p.then((doc) => { + t.equal(doc.domain(), 'wiki.mozilla.org', 'got domain from obj input') + + let urls = doc.images().map((j) => j.url()) + t.ok(urls.length === 1, 'got url') + t.equal( + urls[0], + 'https://wiki.mozilla.org/wiki/Special:Redirect/file/Don%E2%80%99t_hurt_the_Web.png', + 'got working image' + ) + }) + p.catch(function (e) { + t.throw(e) + }) +}) diff --git a/tests/fetch/metadata.test.js b/tests/fetch/metadata.test.js new file mode 100644 index 00000000..a1869879 --- /dev/null +++ b/tests/fetch/metadata.test.js @@ -0,0 +1,16 @@ +var test = require('tape') +var wtf = require('../lib') + +test('get metadata', (t) => { + t.plan(2) + var p = wtf.fetch('Toronto Raptors', 'en', { + 'Api-User-Agent': 'wtf_wikipedia test script - ', + }) + p.then(function (doc) { + t.equal(doc.pageID(), 72879, 'got wikipedia id') + t.equal(doc.wikidata(), 'Q132880', 'got wikidata id') + }) + p.catch(function (e) { + t.throw(e) + }) +}) diff --git a/tests/html.test.js b/tests/html.test.js new file mode 100644 index 00000000..9ad5bec4 --- /dev/null +++ b/tests/html.test.js @@ -0,0 +1,35 @@ +var test = require('tape') +var wtf = require('./lib') + +test('support bold and italics', (t) => { + let doc = wtf(`hi world there`) + t.equal(doc.text(), 'hi world there') + let obj = doc.sentence(0).json().formatting || {} + t.equal((obj.bold || [])[0], 'world', 'got bold') + + doc = wtf(`hi world there`) + t.equal(doc.text(), 'hi world there') + obj = doc.sentence(0).json().formatting || {} + t.equal((obj.italic || [])[0], 'world', 'got italic') + + // both + doc = wtf(`hi world there`) + t.equal(doc.text(), 'hi world there') + obj = doc.sentence(0).json().formatting || {} + t.equal((obj.bold || [])[0], 'world', 'got bold') + t.equal((obj.italic || [])[0], 'world', 'got italic') + t.end() +}) + +test('support sub and sup', (t) => { + let doc = wtf(`hi world there`) + t.equal(doc.text(), 'hi world there') + let tmpl = doc.templates(0) || {} + t.equal(tmpl.text, 'world', 'got sub template') + + doc = wtf(`hi world there`) + t.equal(doc.text(), 'hi world there') + tmpl = doc.templates(0) || {} + t.equal(tmpl.text, 'world', 'got sup template') + t.end() +}) diff --git a/tests/images.test.js b/tests/images.test.js index 43293087..fc858e2e 100644 --- a/tests/images.test.js +++ b/tests/images.test.js @@ -2,7 +2,7 @@ var test = require('tape') var wtf = require('./lib') var readFile = require('./lib/_cachedPage') -test('gallery-tag', t => { +test('gallery-tag', (t) => { var str = ` hey cool! ==Paintings== @@ -28,7 +28,7 @@ The paintings have the freedom and energy of sketches, using warm and cool ligh t.end() }) -test('gallery-tag-2', t => { +test('gallery-tag-2', (t) => { var doc = wtf(`hello @@ -50,7 +50,7 @@ test('gallery-tag-2', t => { t.end() }) -test('gallery-template', t => { +test('gallery-template', (t) => { var str = `{{Gallery|width=200 |lines=4 |File:India1909PrevailingRaces.JPG|The map of the prevailing "races" of India (now discredited) based on the 1901 Census of British India. The Kurmi are shown both in the [[United Provinces of Agra and Oudh|United Provinces]] (UP) and the [[Central Provinces]]. |File:Kurmi sowing.jpg|An "ethnographic" photograph from 1916 showing Kurmi farmers, both men and women, sowing a field. @@ -63,24 +63,19 @@ test('gallery-template', t => { t.end() }) -test('from-infobox', t => { +test('from-infobox', (t) => { let doc = readFile('jodie_emery') t.equal( - doc - .infobox(0) - .images(0) - .thumb(), + doc.infobox(0).images(0).thumb(), 'https://wikipedia.org/wiki/Special:Redirect/file/Marc_Emery_and_Jodie_Emery.JPG?width=300', 'has correct thumbnail' ) t.end() }) -test('img-alt', t => { +test('img-alt', (t) => { let str = `[[File:Wikipedesketch1.png|thumb|alt=A cartoon centipede detailed description.|The Wikipede edits ''[[Myriapoda]]''.]]` - let img = wtf(str) - .images(0) - .json() + let img = wtf(str).images(0).json() t.equal(img.file, 'File:Wikipedesketch1.png', 'file') t.equal(img.thumb, 'https://wikipedia.org/wiki/Special:Redirect/file/Wikipedesketch1.png?width=300', 'thumb') t.equal(img.url, 'https://wikipedia.org/wiki/Special:Redirect/file/Wikipedesketch1.png', 'image') @@ -90,11 +85,9 @@ test('img-alt', t => { t.end() }) -test('parsed-captions', t => { +test('parsed-captions', (t) => { let str = `[[File:Volkswagen W12.jpg|thumb|upright|[[Volkswagen Group]] W12 engine from the [[Volkswagen Phaeton|Volkswagen Phaeton W12]]]]` - let img = wtf(str) - .images(0) - .json() + let img = wtf(str).images(0).json() t.equal(img.caption, 'Volkswagen Group W12 engine from the Volkswagen Phaeton W12', 'caption') t.end() }) diff --git a/tests/links.test.js b/tests/links.test.js index 36bb4467..92d6f645 100644 --- a/tests/links.test.js +++ b/tests/links.test.js @@ -1,7 +1,7 @@ var test = require('tape') var wtf = require('./lib') -test('document-links', t => { +test('document-links', (t) => { var str = `before [[the shining|movie]] {| ! h1 !! h2 || h3 @@ -24,24 +24,24 @@ after now var links = wtf(str).links() t.equal(links.length, 3, 'found-all-links') t.ok( - links.find(l => l.text()), + links.find((l) => l.text()), 'movie', 'link-text' ) t.ok( - links.find(l => l.page()), + links.find((l) => l.page()), 'Minnesota Twins', 'link-table' ) t.ok( - links.find(l => l.page()), + links.find((l) => l.page()), 'three', 'link-list' ) t.end() }) -test('anchor-links', t => { +test('anchor-links', (t) => { var str = `[[Doug Ford#Personal Life]]` var link = wtf(str).links(0) t.equal(link.page(), 'Doug Ford', 'page1') @@ -69,64 +69,24 @@ test('anchor-links', t => { t.end() }) -test('title-case-links', t => { - t.equal( - wtf('[[john]]') - .links(0) - .page(), - 'john', - 'page' - ) - t.equal( - wtf('[[john]]') - .links(0) - .text(), - 'john', - 'lowercase text' - ) +test('title-case-links', (t) => { + t.equal(wtf('[[john]]').links(0).page(), 'john', 'page') + t.equal(wtf('[[john]]').links(0).text(), 'john', 'lowercase text') - t.equal( - wtf('[[John smith]]') - .links(0) - .page(), - 'John smith', - 'already titlecased' - ) - t.equal( - wtf('[[John]]') - .links(0) - .text(), - undefined, - 'no text stored when already titlecase' - ) + t.equal(wtf('[[John smith]]').links(0).page(), 'John smith', 'already titlecased') + t.equal(wtf('[[John]]').links(0).text(), undefined, 'no text stored when already titlecase') - t.equal( - wtf('[[john|his son]]') - .links(0) - .text(), - 'his son', - 'lowercase given text' - ) - t.equal( - wtf('[[john|his son]]') - .links(0) - .page(), - 'john', - 'titlecase given page' - ) - t.equal( - wtf('[[John|his son]]') - .links(0) - .page(), - 'John', - 'already titlecased given page' - ) + t.equal(wtf('[[john|his son]]').links(0).text(), 'his son', 'lowercase given text') + t.equal(wtf('[[john|his son]]').links(0).page(), 'john', 'titlecase given page') + t.equal(wtf('[[John|his son]]').links(0).page(), 'John', 'already titlecased given page') t.end() }) -// test('tricksy-links', t => { -// var doc = wtf('then [[John Entwistle|John [Entwistle]]] and I'); -// t.equal(doc.links(0).page, 'John Entwistle', 'page without bracket'); -// t.equal(doc.links(0).text, 'John [Entwistle]', 'text with bracket'); -// t.end(); -// }); +test('tricksy-links', (t) => { + var doc = wtf(`[[US]]9999.2`) + t.equal(doc.text(), 'US9999.2', 'link-nospace') + // var doc = wtf('then [[John Entwistle|John [Entwistle]]] and I'); + // t.equal(doc.links(0).page, 'John Entwistle', 'page without bracket'); + // t.equal(doc.links(0).text, 'John [Entwistle]', 'text with bracket'); + t.end() +}) diff --git a/types/index.d.ts b/types/index.d.ts index bff06ce1..c2a3c800 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -37,6 +37,10 @@ declare module wtf { title(str?: string): string /**get/set the wikimedia id for the page */ pageID(str?: string | number): string + /**get/set the wikidata id for the page */ + wikidata(str?: string | number): string + /**get/set the domain of the wiki */ + domain(str?: string | number): string /**get/set the wikimedia namespace for the page */ namespace(str?: string | number): string /**get/set the language for the page */