Page MenuHomeWickedGov Phorge

No OneTemporary

Size
691 KB
Referenced Files
None
Subscribers
None
This file is larger than 256 KB, so syntax highlighting was skipped.
diff --git a/extensions/MobileFrontend/resources/dist/mobile.common.js b/extensions/MobileFrontend/resources/dist/mobile.common.js
new file mode 100644
index 000000000..8fe48790b
--- /dev/null
+++ b/extensions/MobileFrontend/resources/dist/mobile.common.js
@@ -0,0 +1,2 @@
+(self.webpackChunkmfModules=self.webpackChunkmfModules||[]).push([[569],{"./src/mobile.init/fakeToolbar.js":(t,e,n)=>{var i=n("./src/mobile.startup/icons.js");t.exports=function(){var t=i.cancel().$el,e=i.spinner({tagName:"span",isIconOnly:!1,label:mw.msg("mobile-frontend-editor-loading")}).$el;return $("<div>").addClass("ve-mobile-fakeToolbar-container").append($("<div>").addClass("ve-mobile-fakeToolbar-header").addClass("overlay-header").append($("<div>").addClass("ve-mobile-fakeToolbar").append(t,e)))}},"./src/mobile.startup/Anchor.js":(t,e,n)=>{function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function r(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,s(i.key),i)}}function s(t){var e=function(t){if("object"!=i(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==i(e)?e:e+""}function a(t,e,n){return e=l(e),function(t,e){if(e&&("object"==i(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,o()?Reflect.construct(e,n||[],l(t).constructor):e.apply(t,n))}function o(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(o=function(){return!!t})()}function l(t){return l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},l(t)}function c(t,e){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},c(t,e)}var u=n("./src/mobile.startup/View.js"),p=n("./src/mobile.startup/util.js"),d=function(t){"use strict";function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),a(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&c(t,e)}(e,t),n=e,(i=[{key:"isTemplateMode",get:function(){return!0}},{key:"defaults",get:function(){return{progressive:void 0,destructive:void 0,additionalClassNames:"",href:void 0,label:void 0}}},{key:"template",get:function(){return p.template('\n<a {{#href}}href="{{href}}"{{/href}} class="mw-mf-anchor\n\t{{#progressive}} mw-mf-anchor-progressive{{/progressive}}\n\t{{#destructive}} mw-mf-anchor-destructive{{/destructive}}\n\t {{additionalClassNames}}">{{label}}</a>\n\t')}}])&&r(n.prototype,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,i}(u);t.exports=d},"./src/mobile.startup/Browser.js":(t,e,n)=>{var i,r=n("./src/mobile.startup/util.js");function s(t){var e=function(){var n=this["__cache"+e.cacheId]||(this["__cache"+e.cacheId]={}),i=[].join.call(arguments,"|");return Object.prototype.hasOwnProperty.call(n,i)?n[i]:n[i]=t.apply(this,arguments)};return e.cacheId=Date.now().toString()+Math.random().toString(),e}function a(t,e){this.userAgent=t,this.$el=e}a.prototype={isIos:s((function(t){var e=this.userAgent,n=/ipad|iphone|ipod/i.test(e);if(!n||!t)return n;switch(t){case 8:return/OS 8_/.test(e)||/Version\/8/.test(e);case 4:return/OS 4_/.test(e);case 5:return/OS 5_/.test(e);default:return!1}})),isWideScreen:s((function(){var t=parseInt(mw.config.get("wgMFDeviceWidthTablet"),10);return window.innerWidth>=t})),supportsTouchEvents:s((function(){return"ontouchstart"in window}))},a.getSingleton=function(){var t;return i||(t=r.getDocument(),i=new a(window.navigator.userAgent,t)),i},t.exports=a},"./src/mobile.startup/Button.js":(t,e,n)=>{var i=n("./src/mobile.startup/mfExtend.js"),r=n("./src/mobile.startup/util.js"),s=n("./src/mobile.startup/View.js"),a=n("./src/mobile.startup/IconButton.js");function o(t){s.call(this,t)}i(o,s,{preRender:function(){var t="default";this.options.progressive?t="progressive":this.options.destructive&&(t="destructive");var e=this.options.quiet?"quiet":"normal";(this.options.progressive||this.options.destructive)&&(e="primary"),this.options.block&&(this.options.additionalClassNames+=" mf-button-block");var n=r.extend({weight:e,action:t,isIconOnly:!1,icon:null},this.options);this._button=new a(n),this.options._buttonHTML=this._button.$el.get(0).outerHTML},isTemplateMode:!0,defaults:{tagName:"a",disabled:!1,block:void 0,progressive:void 0,destructive:void 0,quiet:void 0,additionalClassNames:"",href:void 0,label:void 0,size:"medium"},template:r.template("{{{_buttonHTML}}}")}),t.exports=o},"./src/mobile.startup/CtaDrawer.js":(t,e,n)=>{var i=n("./src/mobile.startup/Drawer.js"),r=n("./src/mobile.startup/util.js"),s=n("./src/mobile.startup/Button.js"),a=n("./src/mobile.startup/Anchor.js");function o(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=l(t.queryParams,t.returnTo);return new i(r.extend({children:[r.parseHTML("<p>").text(t.content),new s(r.extend({progressive:!0,href:mw.util.getUrl("Special:UserLogin",e),label:mw.msg("mobile-frontend-watchlist-cta-button-login")},t.progressiveButton)).$el,r.parseHTML("<div>").addClass("cta-drawer__anchors").append(new a(r.extend({href:mw.util.getUrl("Special:UserLogin",c(e,t.signupQueryParams)),progressive:!0,label:mw.msg("mobile-frontend-watchlist-cta-button-signup")},t.actionAnchor)).$el)]},t))}function l(t,e){return r.extend({returnto:e||mw.config.get("wgPageName")},t)}function c(){return[].push.call(arguments,{type:"signup"}),r.extend.apply(r,arguments)}o.prototype.test={redirectParams:l,signUpParams:c},t.exports=o},"./src/mobile.startup/Drawer.js":(t,e,n)=>{var i=n("./src/mobile.startup/mfExtend.js"),r=n("./src/mobile.startup/View.js"),s=n("./src/mobile.startup/util.js"),a=n("./src/mobile.startup/IconButton.js");function o(t){this.drawerClassName=t.className||"",this.collapseIcon=new a({icon:"expand",additionalClassNames:"cancel",label:mw.msg("mobile-frontend-drawer-arrow-label")}),r.call(this,s.extend({onBeforeHide:function(){},showCollapseIcon:!0},t,{className:"drawer-container"},{events:s.extend({"click .drawer-container__mask":function(){this.hide()}.bind(this),"click .cancel":function(t){t.preventDefault(),this.hide()}.bind(this),click:function(t){t.stopPropagation()}},t.events)}))}i(o,r,{$mask:null,show:function(){var t=s.Deferred();this.$el.prepend(this.$mask),this.$el.width();var e=this.$el.find(".drawer");return this.$mask.addClass("drawer-container__mask--visible"),e.hasClass("visible")?t.resolve():(e.addClass("visible"),mw.hook("mobileFrontend.loadLazyImages").fire(this.$el),this.options.onShow&&this.options.onShow(t),requestAnimationFrame((function(){return t.resolve()}))),t.promise()},hide:function(){var t=this;this.$el.find(".drawer").removeClass("visible"),this.$mask.removeClass("drawer-container__mask--visible"),setTimeout((function(){t.$mask.detach()}),100),requestAnimationFrame((function(){t.options.onBeforeHide(t)}))},postRender:function(){this.$mask=s.parseHTML("<div>").addClass("drawer-container__mask");var t=this.options,e=s.parseHTML("<div>").addClass("drawer drawer-container__drawer position-fixed ".concat(this.drawerClassName).trim());t.showCollapseIcon&&e.prepend(this.collapseIcon.$el),t.children&&e.append(t.children),this.$el.append(e)}}),t.exports=o},"./src/mobile.startup/Icon.js":(t,e,n)=>{var i=n("./src/mobile.startup/mfExtend.js"),r=n("./src/mobile.startup/util.js"),s=n("./src/mobile.startup/View.js");function a(t){s.call(this,t)}i(a,s,{preRender:function(){this.options._iconClasses=this.getIconClasses()},getRotationClass:function(){var t="";if(this.options.rotation)switch(this.options.rotation){case-180:case 180:t="mf-icon-rotate-flip";break;case-90:t="mf-icon-rotate-anti-clockwise";break;case 90:t="mf-icon-rotate-clockwise";break;case 0:break;default:throw new Error("Bad value for rotation given. Must be ±90, 0 or ±180.")}return t},getIconClasses:function(){var t=this.options.base,e=this.options.icon,n=this.options.isSmall,i=this.getRotationClass(),r=this.options.additionalClassNames,s=t+" ";return e&&(s+=this.getGlyphClassName()+" "),n&&(s+="mf-icon--small "),r&&(s+=r+" "),s+i},isTemplateMode:!0,defaults:{base:"mf-icon",glyphPrefix:null,icon:"",rotation:0,isSmall:!1,additionalClassNames:null},getClassName:function(){return this.$el.attr("class")},getGlyphClassName:function(){return this.options.glyphPrefix?"mf-icon-"+this.options.glyphPrefix+"-"+this.options.icon:"mf-icon-"+this.options.icon},template:r.template('<span class="{{_iconClasses}}"> </span>')}),t.exports=a},"./src/mobile.startup/IconButton.js":(t,e,n)=>{var i=n("./src/mobile.startup/mfExtend.js"),r=n("./src/mobile.startup/util.js"),s=n("./src/mobile.startup/View.js"),a=n("./src/mobile.startup/Icon.js");function o(t){t.href&&(t.tagName="a"),"button"===t.tagName&&(t.isTypeButton=!0),s.call(this,t)}i(o,s,{preRender:function(){this.options._buttonClasses=this.getButtonClasses(),this.options._iconHTML="",this.options.icon&&(this._icon=new a({base:this.options.base,glyphPrefix:this.options.glyphPrefix,icon:this.options.icon,rotation:this.options.rotation,isSmall:this.options.isSmall}),this.options._iconHTML=this._icon.$el.get(0).outerHTML)},getButtonClasses:function(){var t=this.options.additionalClassNames,e=this.options.size,n=this.options.weight,i=this.options.action,r=this.options.isIconOnly,s="cdx-button ";return"button"!==this.options.tagName&&(s+="cdx-button--fake-button cdx-button--fake-button--enabled "),e&&(s+="cdx-button--size-".concat(e," ")),n&&(s+="cdx-button--weight-".concat(n," ")),i&&(s+="cdx-button--action-".concat(i," ")),r&&(s+="cdx-button--icon-only "),s+t},isTemplateMode:!0,defaults:{tagName:"button",href:void 0,additionalClassNames:"",title:"",size:"large",weight:"quiet",action:"",isIconOnly:!0,disabled:!1,base:"mf-icon",icon:"",rotation:0,isSmall:!1},getClassName:function(){return this.$el.attr("class")},getIcon:function(){return this._icon},template:r.template('\n\t\t<{{tagName}}\n\t\t\ttype="button"\n\t\t\t{{#isTypeButton}}{{#disabled}}disabled{{/disabled}}{{/isTypeButton}}\n\t\t\tclass="{{_buttonClasses}}"\n\t\t\t{{#id}}id="{{id}}"{{/id}}\n\t\t\t{{#href}}href="{{href}}"{{/href}}\n\t\t\t{{#title}}title="{{title}}"{{/title}}>\n\t\t\t\t{{{_iconHTML}}}\n\t\t\t\t<span>{{label}}</span>\n\t\t</{{tagName}}>\n\t')}),t.exports=o},"./src/mobile.startup/MessageBox.js":(t,e,n)=>{var i=n("./src/mobile.startup/View.js"),r=n("./src/mobile.startup/util.js");function s(){i.apply(this,arguments)}n("./src/mobile.startup/mfExtend.js")(s,i,{isTemplateMode:!0,defaults:{},template:r.template('\n<div\n class="cdx-message cdx-message--block cdx-message--{{type}} {{className}}"\n aria-live="polite"\n>\n \x3c!-- Empty span for message icon. --\x3e\n <span class="cdx-message__icon"></span>\n \x3c!-- Div for content. --\x3e\n <div class="cdx-message__content">\n {{#heading}}<h2>{{heading}}</h2>{{/heading}}\n {{{msg}}}\n </div>\n</div>\n\t')}),t.exports=s},"./src/mobile.startup/Overlay.js":(t,e,n)=>{var i=n("./src/mobile.startup/View.js"),r=n("./src/mobile.startup/headers.js").header,s=n("./src/mobile.startup/Anchor.js"),a=n("./src/mobile.startup/util.js"),o=n("./src/mobile.startup/Browser.js").getSingleton();function l(t){this.isIos=o.isIos(),i.call(this,a.extend(!0,{headerChrome:!1,className:"overlay"},t,{events:a.extend({"click .cancel, .confirm, .initial-header .back":"onExitClick",click:function(t){return t.stopPropagation()}},t.events)}))}n("./src/mobile.startup/mfExtend.js")(l,i,{template:a.template('\n{{^noHeader}}\n<div class="overlay-header-container header-container{{#headerChrome}}\n\theader-chrome{{/headerChrome}} position-fixed">\n</div>\n{{/noHeader}}\n<div class="overlay-content">\n\t{{>content}}\n</div>\n<div class="overlay-footer-container position-fixed"></div>\n\t'),hideTimeout:null,showSpinner:function(){this.$el.find(".spinner").removeClass("hidden")},hideSpinner:function(){this.$el.find(".spinner").addClass("hidden")},postRender:function(){var t=this.options.footerAnchor;this.$overlayContent=this.$el.find(".overlay-content"),this.isIos&&this.$el.addClass("overlay-ios"),t&&this.$el.find(".overlay-footer-container").append(new s(t).$el);var e=this.options.headers||[r(this.options.heading,this.options.headerActions)];this.$el.find(".overlay-header-container").append(e)},onExitClick:function(t){var e=function(){this.hide()}.bind(this);t.preventDefault(),t.stopPropagation(),this.options.onBeforeExit?this.options.onBeforeExit(e,(function(){})):e()},show:function(){var t=a.getDocument();this.scrollTop=window.pageYOffset,t.addClass("overlay-enabled"),window.scrollTo(0,1),this.$el.addClass("visible"),null!==this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=null)},hide:function(){var t=this;return a.getDocument().removeClass("overlay-enabled"),window.scrollTo(window.pageXOffset,this.scrollTop),this.hideTimeout=setTimeout((function(){t.$el.detach(),t.hideTimeout=null}),0),this.emit("hide"),!0},showHidden:function(t){this.$el.find(".hideable").addClass("hidden"),this.$el.find(t).removeClass("hidden")}}),l.make=function(t,e){var n=new l(t);return n.$el.find(".overlay-content").append(e.$el),n},t.exports=l},"./src/mobile.startup/OverlayManager.js":(t,e,n)=>{var i=n("./src/mobile.startup/util.js"),r=null,s="MobileFrontend OverlayManager was here!";function a(t,e){t.on("route",this._checkRoute.bind(this)),this.router=t,this.entries={},this.stack=[],this.hideCurrent=!0,this.container=e}function o(t){t.on("hide",(function(){return t.emit("_om_hide")}))}a.prototype={_onHideOverlayOutsideOverlayManager:function(){if(this.stack.length){var t=this.stack[0].route,e="string"==typeof t,n=this.router.getPath(),i=e&&n===t||n.match(t);this.hideCurrent=!1,i&&this.router.back()}},_attachOverlay:function(t){t.$el.parents().length||this.container.appendChild(t.$el[0])},_show:function(t){window.history.replaceState(s,null,window.location.href),t.once("_om_hide",this._onHideOverlayOutsideOverlayManager.bind(this)),this._attachOverlay(t),t.show()},_hideOverlay:function(t,e){var n;function i(){n=!0,t.hide()}return t.off("_om_hide"),t.options&&t.options.onBeforeExit?t.options.onBeforeExit(i,e):i(),n||t.once("_om_hide",this._onHideOverlayOutsideOverlayManager.bind(this)),n},_processMatch:function(t){if(t)if(t.overlay)this._show(t.overlay);else{var e=t.factoryResult;e&&(t.overlay=e,o(t.overlay),this._show(e))}},_checkRoute:function(t){var e=this,n=this.stack[0];if(n||(this.scrollTop=window.pageYOffset),!n||void 0===n.overlay||!this.hideCurrent||this._hideOverlay(n.overlay,(function(){t.preventDefault()}))){var i=Object.keys(this.entries).reduce((function(n,i){return n||e._matchRoute(t.path,e.entries[i])}),null);i||(this.stack=[],window.scrollTo(window.pageXOffset,this.scrollTop)),this.hideCurrent=!0,this._processMatch(i)}},_matchRoute:function(t,e){var n,i,r,s=this.stack[1],a=this;if("string"==typeof e.route?(n=e.route===t,i=[]):i=(n=!!(r=t.match(e.route)))?r.slice(1):[],n){if(s&&s.path===t)return a.stack.shift(),s;var o={path:t,route:e.route,factoryResult:e.factory.apply(a,i)};return this.stack[0]&&o.path===this.stack[0].path?a.stack[0]=o:a.stack.unshift(o),o}return null},add:function(t,e){var n=this,r={route:t,factory:e};this.entries[t]=r,i.docReady((function(){return n._processMatch(n._matchRoute(n.router.getPath(),r))}))},replaceCurrent:function(t){if(0===this.stack.length)throw new Error("Trying to replace OverlayManager's current overlay, but stack is empty");var e=this.stack[0].overlay;e&&this._hideOverlay(e),this.stack[0].overlay=t,o(t),this._show(t)}},a.getSingleton=function(){if(!r){var t=require("mediawiki.router"),e=document.createElement("div"),n=t.getPath(),i=window.history.state;e.className="mw-overlays-container",document.body.appendChild(e),n&&i!==s&&(window.history.replaceState(null,null,"#"),window.history.pushState(s,null,"#".concat(n))),r=new a(t,e)}return r},a.test={MANAGED_STATE:s,__clearCache:function(){r=null}},t.exports=a},"./src/mobile.startup/Page.js":(t,e,n)=>{function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function r(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,s(i.key),i)}}function s(t){var e=function(t){if("object"!=i(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==i(e)?e:e+""}var a=mw.html,o=n("./src/mobile.startup/util.js"),l=function(){"use strict";return t=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=e.title||"";o.extend(this,{id:e.id||0,title:n,relevantTitle:e.relevantTitle||n,titleObj:e.titleObj,displayTitle:e.displayTitle||a.escape(n),namespaceNumber:e.namespaceNumber||0,protection:e.protection,url:e.url||mw.util.getUrl(n),wikidataDescription:e.wikidataDescription,_isMainPage:e.isMainPage||!1,isMissing:void 0!==e.isMissing?e.isMissing:0===e.id,anchor:e.anchor,revId:e.revId,_isWatched:e.isWatched,thumbnail:!!Object.prototype.hasOwnProperty.call(e,"thumbnail")&&e.thumbnail}),this.thumbnail&&this.thumbnail.width&&(this.thumbnail.isLandscape=this.thumbnail.width>this.thumbnail.height)},(e=[{key:"getDisplayTitle",value:function(){return this.displayTitle}},{key:"inNamespace",value:function(t){return this.namespaceNumber===mw.config.get("wgNamespaceIds")[t]}},{key:"isWikiText",value:function(){return"wikitext"===mw.config.get("wgPageContentModel")}},{key:"isVEAvailable",value:function(){return!!mw.config.get("wgVisualEditorConfig")&&!mw.config.get("wgVisualEditorDisabledByHook")&&this.isWikiText()}},{key:"isVEVisualAvailable",value:function(){return!!this.isVEAvailable()&&-1!==(mw.config.get("wgVisualEditorConfig").namespaces||[]).indexOf(mw.config.get("wgNamespaceNumber"))}},{key:"isVESourceAvailable",value:function(){return this.isVEAvailable()&&mw.config.get("wgMFEnableVEWikitextEditor")}},{key:"isMainPage",value:function(){return this._isMainPage}},{key:"isWatched",value:function(){return this._isWatched}},{key:"getRevisionId",value:function(){return this.revId}},{key:"getTitle",value:function(){return this.title}},{key:"getNamespaceId",value:function(){var t=this.title.split(":");return t[1]&&mw.config.get("wgNamespaceIds")[t[0].toLowerCase().replace(" ","_")]||0}}])&&r(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();t.exports=l},"./src/mobile.startup/PageHTMLParser.js":(t,e,n)=>{function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function r(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,s(i.key),i)}}function s(t){var e=function(t){if("object"!=i(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==i(e)?e:e+""}var a=n("./src/mobile.startup/Thumbnail.js"),o=mw.config.get("wgMFMobileFormatterHeadings",["h1","h2","h3","h4","h5"]).join(","),l=["noviewer","metadata"],c=l.map((function(t){return":not(.".concat(t,")")})).join(""),u=["a.image","a.thumbimage, a.mw-file-description"].map((function(t){return"".concat(t).concat(c)})).join(","),p=function(){"use strict";return t=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.$el=e,this.$headings=this.$el.find(o)},(e=[{key:"findSectionHeadingByIndex",value:function(t){return t<1?$([]):this.$headings.filter('.mw-parser-output > *, [class^="mf-section-"] > *').eq(t-1)}},{key:"findChildInSectionLead",value:function(t,e){var n,i,r=o;function s(t){return t.find(e).addBack()}if(0===t){var a=this.getLeadSectionElement();if(a&&a.length){var l=a.find('section[data-mw-section-id="0"]');return l.length?s(l.children(e)):s(a.children(e))}return(n=this.findSectionHeadingByIndex(1)).length?s(n.prevAll(e)):this.$el.find(e)}if((n=this.findSectionHeadingByIndex(t)).hasClass("section-heading")){var c=n.next();return(i=c.find(r).eq(0)).length?s(i.prevAll(e)):s(c.children(e))}return i=n.eq(0).nextAll(r).eq(0),n.nextUntil(i,e)}},{key:"getLeadSectionElement",value:function(){var t=this.$el.find(".mf-section-0");return t.length?t:null}},{key:"getThumbnail",value:function(t){var e="."+l.join(",."),n=t.find(".lazy-image-placeholder"),i=t.attr("href"),r=i&&new URL(i,location.href),s=r&&r.searchParams.get("title"),o=r&&r.pathname.match(/[^/]+$/),c=0===t.parents(e).length&&0===t.find(e).length;return n.length&&c&&(c=!new RegExp("\\b("+l.join("|")+")\\b").test(n.data("class"))),c&&(null!==s||o)?new a({el:t,filename:mw.util.percentDecodeFragment(null!==s?s:o[0])}):null}},{key:"getThumbnails",value:function(t){var e=this,n=[];return(t=t||this.$el).find(u).each((function(){var i=t.find(this),r=e.getThumbnail(i);r&&n.push(r)})),n}},{key:"getRedLinks",value:function(){return this.$el.find(".new")}},{key:"getLanguages",value:function(t){var e=function(e){var n,i=" – ",r=e.textContent,s=e.getAttribute("title")||t;return s.indexOf(i)>-1&&(n=(s=s.split(i)).pop(),s=s.join(i)),n||(n=r),{lang:e.getAttribute("hreflang"),autonym:r,langname:n,title:s,url:e.getAttribute("href")}};return{languages:Array.prototype.map.call(document.querySelectorAll("#p-lang .interlanguage-link a"),e),variants:Array.prototype.map.call(document.querySelectorAll("#p-variants li a"),e)}}}])&&r(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();p.HEADING_SELECTOR=o,p.THUMB_SELECTOR=u,t.exports=p},"./src/mobile.startup/PageList.js":(t,e,n)=>{var i=n("./src/mobile.startup/util.js"),r=n("./src/mobile.startup/mfExtend.js"),s=n("./src/mobile.startup/View.js"),a=n("./src/mobile.startup/Browser.js").getSingleton();function o(){s.apply(this,arguments)}r(o,s,{defaults:{pages:[]},renderPageImages:function(){var t=this;setTimeout((function(){t.$el.find(".list-thumb").each((function(){var e=t.$el.find(this).data("style");t.$el.find(this).attr("style",e)}))}),a.isWideScreen()?0:1e3)},postRender:function(){this.renderPageImages()},template:i.template('\n<ul class="mw-mf-page-list thumbs actionable">\n\t{{#pages}}\n\t\t{{>item}}\n\t{{/pages}}\n</ul>\n\t'),templatePartials:{item:i.template('\n<li title="{{title}}" data-id="{{id}}" class="page-summary">\n <a href="{{url}}" class="title {{#isMissing}}new{{/isMissing}}"\n {{#anchor}}name="{{anchor}}"{{/anchor}}\n {{#latitude}}data-latlng="{{latitude}},{{longitude}}"{{/latitude}}\n data-title="{{title}}">\n <div class="list-thumb\n {{#thumbnail.isLandscape}}list-thumb-y{{/thumbnail.isLandscape}}\n {{^thumbnail.isLandscape}}list-thumb-x{{/thumbnail.isLandscape}}"\n {{#thumbnail}}data-style="background-image: url( {{thumbnail.source}} )"{{/thumbnail}}>\n {{^thumbnail}}<span class="mf-icon-image"></span>{{/thumbnail}}\n\t</div>\n <h3>{{{displayTitle}}}</h3>\n {{#wikidataDescription}}\n <div class="wikidata-description">{{wikidataDescription}}</div>\n {{/wikidataDescription}}\n {{#proximity}}\n <div class="info proximity">{{proximity}}</div>\n {{/proximity}}\n </a>\n</li>\n\t')}}),t.exports=o},"./src/mobile.startup/Skin.js":(t,e,n)=>{var i,r=n("./src/mobile.startup/Browser.js").getSingleton(),s=n("./src/mobile.startup/View.js"),a=n("./src/mobile.startup/util.js"),o=n("./src/mobile.startup/currentPage.js"),l=n("./src/mobile.startup/eventBusSingleton.js");function c(t){var e=a.extend({},t);this.page=e.page,this.name=e.name,this.eventBus=e.eventBus,e.isBorderBox=!1,s.call(this,e)}n("./src/mobile.startup/mfExtend.js")(c,s,{defaults:{page:void 0},postRender:function(){var t=this,e=this.$el;r.supportsTouchEvents()&&e.addClass("touch-events"),this.$el.find("#mw-mf-page-center").on("click",(function(e){t.emit("click",e)}))},getLicenseLinks:function(){var t=mw.message("mobile-frontend-license-links"),e=t.exists()&&t.text();return"qqx"===mw.config.get("wgUserLanguage")||e?t.parseDom():this.$el.find("#footer-info-copyright a").clone()},getLicenseMsg:function(){var t,e=this.getLicenseLinks();if(e.length){var n=mw.language.convertNumber(e.filter("a").length);if(this.$el.find("#footer-places-terms-use").length>0){var i=mw.message("mobile-frontend-editor-terms-link",this.$el.find("#footer-places-terms-use a").attr("href")).parseDom();t=mw.message("mobile-frontend-editor-licensing-with-terms",i,e,n).parse()}else t=mw.message("mobile-frontend-editor-licensing",e,n).parse()}return t}}),c.getSingleton=function(){return i||(i=new c({el:"body",page:o(),eventBus:l})),i},t.exports=c},"./src/mobile.startup/Thumbnail.js":(t,e,n)=>{var i=n("./src/mobile.startup/mfExtend.js"),r=n("./src/mobile.startup/util.js"),s=n("./src/mobile.startup/View.js");function a(t){s.call(this,r.extend({isBorderBox:!1},t))}i(a,s,{defaults:{filename:void 0},postRender:function(){this.options.description=this.$el.siblings(".thumbcaption, figcaption").prop("innerText")||""},getDescription:function(){return this.options.description},getFileName:function(){return this.options.filename}}),t.exports=a},"./src/mobile.startup/View.js":(t,e,n)=>{var i=n("./src/mobile.startup/util.js"),r=n("./src/mobile.startup/mfExtend.js"),s=/^(\S+)\s*(.*)$/,a=0;function o(){this.initialize.apply(this,arguments)}OO.mixinClass(o,OO.EventEmitter),r(o,{tagName:"div",isTemplateMode:!1,template:void 0,templatePartials:{},defaults:{},initialize:function(t){var e,n,r=this;OO.EventEmitter.call(this),t=i.extend({},this.defaults,t),this.options=t,this.cid=(e="view",n=(++a).toString(),e?e+n:n),"string"==typeof this.template&&(this.template=mw.template.compile(this.template)),t.el?this.$el=$(t.el):this.$el=this.parseHTML("<"+this.tagName+">"),this.$el.length?this._postInitialize(t):i.docReady((function(){r.$el=$(t.el),r._postInitialize(t)}))},_postInitialize:function(t){this.$el.addClass(t.className),!1!==t.isBorderBox&&this.$el.addClass("view-border-box"),this.render({})},preRender:function(){},postRender:function(){},render:function(t){var e,n;return i.extend(this.options,t),this.preRender(),this.undelegateEvents(),this.template&&!this.options.skipTemplateRender&&(n=this.template.render(this.options,this.templatePartials),this.isTemplateMode?(e=$(n),this.$el.replaceWith(e),this.$el=e):this.$el.html(n)),this.postRender(),this.delegateEvents(),this},delegateEvents:function(t){var e,n,i;if(t=t||this.options.events)for(n in this.undelegateEvents(),t)"function"!=typeof(i=t[n])&&(i=this[t[n]]),i&&(e=n.match(s),this.delegate(e[1],e[2],i.bind(this)))},delegate:function(t,e,n){this.$el.on(t+".delegateEvents"+this.cid,e,n)},undelegateEvents:function(){this.$el&&this.$el.off(".delegateEvents"+this.cid)},undelegate:function(t,e,n){this.$el.off(t+".delegateEvents"+this.cid,e,n)},parseHTML:function(t){return i.parseHTML(t,document)}}),["append","prepend","appendTo","prependTo","after","before","insertAfter","insertBefore","remove","detach"].forEach((function(t){o.prototype[t]=function(){return this.$el[t].apply(this.$el,arguments),this}})),o.make=function(){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],e=new o(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{});return t.forEach((function(t){return e.append(t)})),e},t.exports=o},"./src/mobile.startup/actionParams.js":(t,e,n)=>{var i=n("./src/mobile.startup/util.js"),r={action:"query",formatversion:2};t.exports=function(t){var e=mw.config.get("wgMFScriptPath");return i.extend({},r,{origin:e?"*":void 0},t)}},"./src/mobile.startup/amcOutreach/AmcEnableForm.js":(t,e,n)=>{function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function r(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,s(i.key),i)}}function s(t){var e=function(t){if("object"!=i(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==i(e)?e:e+""}function a(t,e,n){return e=l(e),function(t,e){if(e&&("object"==i(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,o()?Reflect.construct(e,n||[],l(t).constructor):e.apply(t,n))}function o(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(o=function(){return!!t})()}function l(t){return l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},l(t)}function c(t,e){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},c(t,e)}var u=n("./src/mobile.startup/Button.js"),p=n("./src/mobile.startup/util.js"),d=function(t){"use strict";function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),a(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&c(t,e)}(e,t),n=e,(i=[{key:"isTemplateMode",get:function(){return!0}},{key:"template",get:function(){return p.template('\n<form class="amc-enable-form" action="{{postUrl}}" method="POST">\n\t{{#fields}}\n\t\t<input type="hidden" name="{{name}}" value="{{value}}">\n\t{{/fields}}\n</form>\n\t\t')}},{key:"postRender",value:function(){this.$el.append(new u({tagName:"button",progressive:!0,label:this.options.buttonLabel}).$el)}}])&&r(n.prototype,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,i}(n("./src/mobile.startup/View.js"));t.exports=d},"./src/mobile.startup/amcOutreach/amcOutreach.js":(t,e,n)=>{var i,r=n("./src/mobile.startup/showOnPageReload.js"),s=n("./src/mobile.startup/promoCampaign/promoCampaign.js"),a=n("./src/mobile.startup/amcOutreach/amcOutreachDrawer.js"),o={onDesktopLink:"onDesktopLink",onHistoryLink:"onHistoryLink",onTalkLink:"onTalkLink"};t.exports={loadCampaign:function(){return i||(i=s((function(t,e,n,s){return a(t,i,mw.message,mw.util,r,mw.user.tokens.get("csrfToken"),e,n,s)}),o,"amc-outreach",!!mw.config.get("wgMFAmcOutreachActive"),!!mw.config.get("wgMFAmcOutreachUserEligible"),mw.storage))},ACTIONS:o}},"./src/mobile.startup/amcOutreach/amcOutreachDrawer.js":(t,e,n)=>{var i=n("./src/mobile.startup/Drawer.js"),r=n("./src/mobile.startup/Anchor.js"),s=n("./src/mobile.startup/util.js"),a=n("./src/mobile.startup/amcOutreach/AmcEnableForm.js");t.exports=function(t,e,n,o,l,c,u,p,d){return new i({className:"amc-outreach-drawer",children:[s.parseHTML("<div>").addClass("amc-outreach-image"),s.parseHTML("<p>").append(s.parseHTML("<strong>").text(n("mobile-frontend-amc-outreach-intro").text())),s.parseHTML("<p>").text(n("mobile-frontend-amc-outreach-description").text()),new a({postUrl:o.getUrl("Special:MobileOptions",{returnto:p,returntoquery:d||""}),fields:[{name:"updateSingleOption",value:"enableAMC"},{name:"enableAMC",value:"1"},{name:"token",value:c}],buttonLabel:n("mobile-frontend-amc-outreach-enable").text(),events:{submit:function(){e.makeActionIneligible(t),l.showOnPageReload(n("mobile-frontend-amc-outreach-enabled-message").text())}}}).$el,new r({href:"#",additionalClassNames:"cancel",progressive:!0,label:n("mobile-frontend-amc-outreach-no-thanks").text()}).$el],onBeforeHide:function(){e.makeActionIneligible(t),u()}})}},"./src/mobile.startup/currentPage.js":(t,e,n)=>{var i,r=n("./src/mobile.startup/Page.js");t.exports=function(){if(i)return i;var t=[].concat(mw.config.get("wgRestrictionEdit",[])),e=mw.Title.newFromText(mw.config.get("wgRelevantPageName")),n=mw.Title.newFromText(mw.config.get("wgPageName"));return 0===t.length&&t.push("*"),i=new r({title:n.getPrefixedText(),titleObj:n,relevantTitle:e.getPrefixedText(),protection:{edit:t},revId:mw.config.get("wgRevisionId"),isMainPage:mw.config.get("wgIsMainPage"),isWatched:$("#ca-watch").hasClass("watched"),isMissing:0===mw.config.get("wgArticleId"),id:mw.config.get("wgArticleId"),namespaceNumber:mw.config.get("wgNamespaceNumber")})}},"./src/mobile.startup/currentPageHTMLParser.js":(t,e,n)=>{var i,r=n("./src/mobile.startup/PageHTMLParser.js");t.exports=function(){return i||(i=new r($("#content #bodyContent")))}},"./src/mobile.startup/eventBusSingleton.js":t=>{t.exports=new OO.EventEmitter},"./src/mobile.startup/extendSearchParams.js":(t,e,n)=>{var i=n("./src/mobile.startup/util.js"),r=n("./src/mobile.startup/actionParams.js");t.exports=function(t){var e=mw.config.get("wgMFDisplayWikibaseDescriptions")||{search:!0,watchlist:!0,tagline:!1},n=mw.config.get("wgMFScriptPath");if(!Object.prototype.hasOwnProperty.call(e,t))throw new Error('"'+t+"\" isn't a feature that shows Wikibase descriptions.");var s=Array.prototype.slice.call(arguments,1);s.unshift({prop:[]}),s.push(mw.config.get("wgMFSearchAPIParams"));var a=i.extend.apply({},s);return a.prop=a.prop.concat(mw.config.get("wgMFQueryPropModules")),e[t]&&-1===a.prop.indexOf("description")&&a.prop.push("description"),n&&(a.origin="*"),r(a)}},"./src/mobile.startup/headers.js":(t,e,n)=>{var i=n("./src/mobile.startup/util.js"),r=n("./src/mobile.startup/Button.js"),s=n("./src/mobile.startup/icons.js");function a(t,e,n,r){var a="string"==typeof t?t:void 0,o={hasActions:e&&e.length,isHidden:!1,heading:a},l=i.template('\n<div class="overlay-header header '.concat(r||"",' hideable">\n\t<ul class="header-cancel">\n\t\t<li></li>\n\t</ul>\n\t{{{heading}}}\n\t{{#hasActions}}\n\t<div class="header-action"></div>\n\t{{/hasActions}}\n</div>\n\t\t')).render(o);n=n||s.cancel();var c=i.parseHTML(l);return c.find("h2 span").addClass("truncated-text"),c.find(".header-cancel li").append(n.$el),void 0===a&&t.$el.insertAfter(c.find(".header-cancel")),e&&e.length&&c.find(".header-action").append(e.map((function(t){return t.$el}))),c[0]}function o(t,e,n,i){return a(t='<div class="overlay-title"><h2>'.concat(t,"</h2></div>"),e,n,i)}t.exports={savingHeader:function(t){return o(t,[s.spinner({additionalClassNames:"savespinner loading"})],s.cancel(),"saving-header hidden")},saveHeader:function(t,e){return o(t,[new r({tagName:"button",additionalClassNames:"save submit",disabled:!0,label:i.saveButtonMessage(),size:"large"})],s.back(),e)},formHeader:function(t,e,n,i){return a(t,e,n,i)},header:o}},"./src/mobile.startup/icons.js":(t,e,n)=>{var i="close",r=n("./src/mobile.startup/Icon.js"),s=n("./src/mobile.startup/IconButton.js"),a={CANCEL_GLYPH:i,Icon:r,IconButton:s,back:function(){return new a.IconButton({tagName:"button",icon:"previous",additionalClassNames:"back",label:mw.msg("mobile-frontend-overlay-close")})},cancel:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t?"".concat(i,"-").concat(t):"".concat(i);return e.additionalClassNames=e.additionalClassNames||"",e.additionalClassNames+=" cancel",new a.IconButton(Object.assign({tagName:"button",icon:n,label:mw.msg("mobile-frontend-overlay-close")},e))},spinner:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};void 0===t.additionalClassNames&&(t.additionalClassNames="spinner loading");var e=new a.IconButton(Object.assign({tagName:"span",icon:"spinner",label:mw.msg("mobile-frontend-loading-message")},t));return e.$el.removeClass(),e.$el.addClass(t.additionalClassNames),e.$el.attr("type",""),e.options.isIconOnly&&e.$el.addClass("mf-spinner-icon-element"),e},error:function(){return new a.IconButton({icon:"alert-invert",additionalClassNames:"load-fail-msg-icon"})},watch:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t.additionalClassNames=t.additionalClassNames||"",t.additionalClassNames+=" watch-this-article",new a.IconButton(Object.assign({icon:"star-subtle"},t))},watched:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t.additionalClassNames=t.additionalClassNames||"",t.additionalClassNames+=" watch-this-article watched",new a.IconButton(Object.assign({icon:"unStar-progressive"},t))}};t.exports=a},"./src/mobile.startup/lazyImages/lazyImageLoader.js":(t,e,n)=>{var i=n("./src/mobile.startup/util.js"),r="lazy-image-placeholder";t.exports={placeholderClass:r,queryPlaceholders:function(t){return Array.prototype.slice.call(t.getElementsByClassName(r))},loadImages:function(e){return i.Promise.all(e.map((function(e){return t.exports.loadImage(e).promise})))},loadImage:function(t){var e=i.Deferred(),n=t.dataset.width,r=t.dataset.height,s=new Image;n&&s.setAttribute("width",parseInt(n,10)),r&&s.setAttribute("height",parseInt(r,10)),s.className=t.dataset.class||"",s.alt=t.dataset.alt||"",s.useMap=t.dataset.usemap,s.style.cssText=t.style.cssText||"",s.addEventListener("load",(function(){s.classList.add("image-lazy-loaded"),t.parentNode&&t.parentNode.replaceChild(s,t),e.resolve("load")}),{once:!0}),s.addEventListener("error",(function(){t.parentNode&&t.parentNode.replaceChild(s,t),e.resolve("error")}),{once:!0});var a=t.dataset.mwSrc||"";return a&&(s.src=a,s.srcset=t.dataset.mwSrcset||""),{promise:e,image:s}},test:{placeholderClass:r}}},"./src/mobile.startup/mfExtend.js":t=>{t.exports=function(t,e,n){var i;for(i in n?OO.inheritClass(t,e):(OO.initClass(t),n=e),n)t.prototype[i]=n[i]}},"./src/mobile.startup/moduleLoader.js":t=>{function e(){this._register={}}e.prototype={require:function t(e){var n=this._register;function i(){if(!Object.hasOwnProperty.call(n,e))throw new Error("MobileFrontend Module not found: "+e);return n[e]}var r=e.split("/");try{var s=t(r[0]);return s[r[1]]?s[r[1]]:i()}catch(t){return i()}},define:function(t,e){var n=this;if(Object.hasOwnProperty.call(this._register,t))throw new Error("Module already exists: "+t);return this._register[t]=e,{deprecate:function(i){n.deprecate(i,e,t)}}},deprecate:function(t,e,n){var i;n&&(i="Use "+n+" instead."),mw.log.deprecate(this._register,t,e,i)}},t.exports=e},"./src/mobile.startup/moduleLoaderSingleton.js":(t,e,n)=>{var i=n("./src/mobile.startup/moduleLoader.js");t.exports=new i},"./src/mobile.startup/page/pageJSONParser.js":(t,e,n)=>{var i=n("./src/mobile.startup/Page.js"),r=n("./src/mobile.startup/util.js");t.exports={parse:function(t){var e,n=t.thumbnail,s=t.pageprops||{displaytitle:mw.html.escape(t.title)},a=t.terms||t.entityterms;return(s||a)&&(e=a&&a.label?mw.html.escape(a.label[0]):s.displaytitle),t.wikidataDescription=t.description||void 0,n&&(t.thumbnail.isLandscape=n.width>n.height),new i(r.extend(t,{id:t.pageid,isMissing:!!t.missing,url:mw.util.getUrl(t.title),displayTitle:e}))}}},"./src/mobile.startup/promoCampaign/promoCampaign.js":t=>{t.exports=function(t,e,n,i,r,s){var a={};for(var o in e){var l=e[o];a[l]="mobile-frontend-".concat(n,"-ineligible-").concat(l)}function c(){return i}function u(t){if(!(t in e))throw new Error("Action '".concat(t,"' not found in 'actions' object. Please add this to\n\t\t\t\tthe object when creating a campaign with promoCampaign.js if you believe\n\t\t\t\tthis is a valid action."))}return{showIfEligible:function(e){if(!function(t){return u(t),c()&&r&&null===s.get(a[t])}(e))return null;for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];return t.apply(void 0,[e].concat(i))},makeActionIneligible:function(t){return u(t),s.set(a[t],"~")},makeAllActionsIneligible:function(){var t,n;for(t in e)n=e[t],this.makeActionIneligible(n)},isCampaignActive:c}}},"./src/mobile.startup/showOnPageReload.js":t=>{var e="mobileFrontend/toast";mw.requestIdleCallback((function(){var t=mw.storage.get(e);t&&(t=JSON.parse(t),mw.notify(t.content,t.options),mw.storage.remove(e))})),t.exports={showOnPageReload:function(t,n){mw.storage.get(e)?mw.log.warn("A pending toast message already exits. The page should have been reloaded by now."):mw.storage.set(e,JSON.stringify({content:t,options:n}))}}},"./src/mobile.startup/util.js":t=>{t.exports={saveButtonMessage:function(){return mw.config.get("wgEditSubmitButtonLabelPublish")?mw.msg("mobile-frontend-editor-publish"):mw.msg("mobile-frontend-editor-save")},Promise:{all:function(t){return $.when.apply($,t)}},escapeSelector:function(t){return $.escapeSelector(t)},docReady:function(t){return $(t)},Deferred:function(){return $.Deferred()},getDocument:function(){return $(document.documentElement)},getWindow:function(){return $(window)},parseHTML:function(t,e){return e=e||document,$($.parseHTML(t,e))},extend:function(){return $.extend.apply($,arguments)},template:function(t){return{getSource:function(){return t},render:function(e,n){var i={};return Object.keys(n||{}).forEach((function(t){i[t]=n[t].getSource()})),Mustache.render(t.trim(),e,i)}}}}},"./src/mobile.startup/watchstar/WatchstarGateway.js":(t,e,n)=>{var i=n("./src/mobile.startup/util.js"),r=n("./src/mobile.startup/actionParams.js");function s(t){this.api=t}s.prototype={getStatuses:function(t,e){return i.Promise.all([this.getStatusesByID(t),this.getStatusesByTitle(e)]).then((function(){return i.extend.apply(i,arguments)}))},getStatusesByID:function(t){var e=this;return t.length?this.api.get({formatversion:2,action:"query",prop:"info",inprop:"watched",pageids:t}).then((function(t){return e._unmarshalGetResponse(t)})):i.Deferred().resolve({})},getStatusesByTitle:function(t){var e=this;return t.length?this.api.get(r({prop:"info",inprop:"watched",titles:t})).then((function(t){return e._unmarshalGetResponse(t)})):i.Deferred().resolve({})},postStatusesByTitle:function(t,e){var n={action:"watch",titles:t};return e||(n.unwatch=!e),this.api.postWithToken("watch",n)},_unmarshalGetResponse:function(t){return(t&&t.query&&t.query.pages||[]).reduce((function(t,e){return t[e.title]=e.watched,t}),{})}},t.exports=s},"./src/mobile.startup/watchstar/WatchstarPageList.js":(t,e,n)=>{var i=n("./src/mobile.startup/PageList.js"),r=n("./src/mobile.startup/watchstar/watchstar.js"),s=mw.user,a=n("./src/mobile.startup/util.js"),o=n("./src/mobile.startup/Page.js"),l=n("./src/mobile.startup/mfExtend.js"),c=n("./src/mobile.startup/watchstar/WatchstarGateway.js");function u(t){this.wsGateway=new c(t.api),i.apply(this,arguments)}l(u,i,{postRender:function(){var t=this,e=[],n=[];i.prototype.postRender.apply(this);var r=this.queryUnitializedItems(),s=this.parsePagesFromItems(r);return Object.keys(s).forEach((function(t){var i=s[t];i&&"0"!==i?e.push(i):n.push(t)})),this.getPages(e,n).then((function(e){return t.renderItems(r,e)}))},queryUnitializedItems:function(){return this.$el.find("li:not(.with-watchstar)")},getPages:function(t,e){return s.isAnon()?a.Deferred().resolve({}):this.wsGateway.getStatuses(t,e)},parsePagesFromItems:function(t){var e=this,n={};return t.each((function(t,i){var r=e.$el.find(i);n[r.attr("title")]=r.data("id")})),n},renderItems:function(t,e){var n=this;s.isAnon()||t.each((function(t,i){var r=n.$el.find(i),s=new o({sections:[],title:r.attr("title"),id:r.data("id")}),a=e[s.getTitle()];n._appendWatchstar(r,s,a),r.addClass("with-watchstar")}))},_appendWatchstar:function(t,e,n){r({isWatched:n,page:e}).appendTo(t)}}),t.exports=u},"./src/mobile.startup/watchstar/watchstar.js":(t,e,n)=>{var i=n("./src/mobile.startup/icons.js");t.exports=function(t){var e=t.isWatched,n=require("mediawiki.page.watch.ajax").watchstar,r=e?"unwatch":"watch",s={href:mw.Title.newFromText(t.page.title).getUrl({action:r})},a=i.watch(s),o=i.watched(s),l=a.getClassName(),c=o.getClassName(),u=a.getIcon().getClassName(),p=o.getIcon().getClassName(),d=e?o:a;return n(d.$el,t.page.title,(function(t,e){t.attr("class",e?c:l),t.find(".mf-icon").attr("class",e?p:u)})),d}}}]);
+//# sourceMappingURL=mobile.common.js.map.json
\ No newline at end of file
diff --git a/extensions/MobileFrontend/resources/dist/mobile.common.js.map.json b/extensions/MobileFrontend/resources/dist/mobile.common.js.map.json
new file mode 100644
index 000000000..d7a8a623d
--- /dev/null
+++ b/extensions/MobileFrontend/resources/dist/mobile.common.js.map.json
@@ -0,0 +1 @@
+{"version":3,"file":"mobile.common.js","mappings":"sHAAA,IAAMA,EAAQC,EAAS,iCAGvBC,EAAOC,QAA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,GACnB6H,EAAM1a,KAAM,QAAS6S,EACpByH,EAAuBD,GACVK,EAAMvc,KAAM,YACpB6B,KAAM,QAAS6S,EACpB2H,EAAgBD,EAClB,IAGME,CACR,C","sources":["webpack://mfModules/./src/mobile.init/fakeToolbar.js","webpack://mfModules/./src/mobile.startup/Anchor.js","webpack://mfModules/./src/mobile.startup/Browser.js","webpack://mfModules/./src/mobile.startup/Button.js","webpack://mfModules/./src/mobile.startup/CtaDrawer.js","webpack://mfModules/./src/mobile.startup/Drawer.js","webpack://mfModules/./src/mobile.startup/Icon.js","webpack://mfModules/./src/mobile.startup/IconButton.js","webpack://mfModules/./src/mobile.startup/MessageBox.js","webpack://mfModules/./src/mobile.startup/Overlay.js","webpack://mfModules/./src/mobile.startup/OverlayManager.js","webpack://mfModules/./src/mobile.startup/Page.js","webpack://mfModules/./src/mobile.startup/PageHTMLParser.js","webpack://mfModules/./src/mobile.startup/PageList.js","webpack://mfModules/./src/mobile.startup/Skin.js","webpack://mfModules/./src/mobile.startup/Thumbnail.js","webpack://mfModules/./src/mobile.startup/View.js","webpack://mfModules/./src/mobile.startup/actionParams.js","webpack://mfModules/./src/mobile.startup/amcOutreach/AmcEnableForm.js","webpack://mfModules/./src/mobile.startup/amcOutreach/amcOutreach.js","webpack://mfModules/./src/mobile.startup/amcOutreach/amcOutreachDrawer.js","webpack://mfModules/./src/mobile.startup/currentPage.js","webpack://mfModules/./src/mobile.startup/currentPageHTMLParser.js","webpack://mfModules/./src/mobile.startup/eventBusSingleton.js","webpack://mfModules/./src/mobile.startup/extendSearchParams.js","webpack://mfModules/./src/mobile.startup/headers.js","webpack://mfModules/./src/mobile.startup/icons.js","webpack://mfModules/./src/mobile.startup/lazyImages/lazyImageLoader.js","webpack://mfModules/./src/mobile.startup/mfExtend.js","webpack://mfModules/./src/mobile.startup/moduleLoader.js","webpack://mfModules/./src/mobile.startup/moduleLoaderSingleton.js","webpack://mfModules/./src/mobile.startup/page/pageJSONParser.js","webpack://mfModules/./src/mobile.startup/promoCampaign/promoCampaign.js","webpack://mfModules/./src/mobile.startup/showOnPageReload.js","webpack://mfModules/./src/mobile.startup/util.js","webpack://mfModules/./src/mobile.startup/watchstar/WatchstarGateway.js","webpack://mfModules/./src/mobile.startup/watchstar/WatchstarPageList.js","webpack://mfModules/./src/mobile.startup/watchstar/watchstar.js"],"sourcesContent":["const icons = require( '../mobile.startup/icons' );\n\n/* global $ */\nmodule.exports = function fakeToolbar() {\n\tconst $goBack = icons.cancel().$el;\n\n\t// FIXME: Should not be a button, instead should be an icon with text\n\tconst $loadingMessage = icons.spinner( {\n\t\ttagName: 'span',\n\t\tisIconOnly: false,\n\t\tlabel: mw.msg( 'mobile-frontend-editor-loading' )\n\t} ).$el;\n\n\t// Wrappers similar to .overlay-header-container, .overlay-header and .oo-ui-toolbar\n\tconst $fakeToolbar = $( '<div>' )\n\t\t.addClass( 've-mobile-fakeToolbar-container' )\n\t\t.append( $( '<div>' )\n\t\t\t.addClass( 've-mobile-fakeToolbar-header' )\n\t\t\t// Minerva has some complicated styling for this class, so we have to include it\n\t\t\t.addClass( 'overlay-header' )\n\t\t\t.append( $( '<div>' )\n\t\t\t\t.addClass( 've-mobile-fakeToolbar' )\n\t\t\t\t.append( $goBack, $loadingMessage )\n\t\t\t)\n\t\t);\n\n\treturn $fakeToolbar;\n};\n","const\n\tView = require( './View' ),\n\tutil = require( './util' );\n\n/**\n * A wrapper for creating an anchor.\n *\n * @extends module:mobile.startup/View\n * @private\n */\nclass Anchor extends View {\n\t/**\n\t * @inheritdoc\n\t */\n\tget isTemplateMode() {\n\t\treturn true;\n\t}\n\n\t/**\n\t * @memberof Anchor\n\t * @instance\n\t * @mixes module:mobile.startup/View#defaults\n\t * @property {Object} defaults Default options hash.\n\t * @property {boolean} defaults.progressive is progressive action\n\t * @property {boolean} defaults.destructive is destructive action\n\t * @property {string} defaults.additionalClassNames Additional class name(s).\n\t * @property {string} defaults.href url\n\t * @property {string} defaults.label of anchor\n\t */\n\tget defaults() {\n\t\treturn {\n\t\t\tprogressive: undefined,\n\t\t\tdestructive: undefined,\n\t\t\tadditionalClassNames: '',\n\t\t\thref: undefined,\n\t\t\tlabel: undefined\n\t\t};\n\t}\n\n\t/**\n\t * @inheritdoc\n\t */\n\tget template() {\n\t\treturn util.template( `\n<a {{#href}}href=\"{{href}}\"{{/href}} class=\"mw-mf-anchor\n\t{{#progressive}} mw-mf-anchor-progressive{{/progressive}}\n\t{{#destructive}} mw-mf-anchor-destructive{{/destructive}}\n\t {{additionalClassNames}}\">{{label}}</a>\n\t` );\n\t}\n}\n\nmodule.exports = Anchor;\n","const util = require( './util' );\n\nlet browser;\n\n/**\n * Memoize a class method. Caches the result of the method based on the\n * arguments. Instances do not share a cache.\n *\n * @private\n * @param {Function} method Method to be memoized\n * @return {Function}\n */\nfunction memoize( method ) {\n\t/**\n\t * Memoized version of the method\n\t *\n\t * @return {Function}\n\t */\n\tconst memoized = function () {\n\t\tconst cache = this[ '__cache' + memoized.cacheId ] ||\n\t\t\t( this[ '__cache' + memoized.cacheId ] = {} ),\n\t\t\tkey = [].join.call( arguments, '|' );\n\t\tif ( Object.prototype.hasOwnProperty.call( cache, key ) ) {\n\t\t\treturn cache[ key ];\n\t\t}\n\t\treturn ( cache[ key ] = method.apply( this, arguments ) );\n\t};\n\tmemoized.cacheId = Date.now().toString() + Math.random().toString();\n\treturn memoized;\n}\n\n/**\n * Representation of user's current browser\n *\n * @class Browser\n * @private\n * @param {string} ua the user agent of the current browser\n * @param {jQuery.Object} $container an element to associate with the Browser object\n */\nfunction Browser( ua, $container ) {\n\tthis.userAgent = ua;\n\tthis.$el = $container;\n}\n\nBrowser.prototype = {\n\t/**\n\t * Returns whether the current browser is an ios device.\n\t * FIXME: jquery.client does not support iPad detection so we cannot use it.\n\t *\n\t * @memberof Browser\n\t * @instance\n\t * @param {number} [version] integer describing a specific version you want to test against.\n\t * @return {boolean}\n\t */\n\tisIos: memoize( function ( version ) {\n\t\tconst ua = this.userAgent,\n\t\t\tios = /ipad|iphone|ipod/i.test( ua );\n\n\t\tif ( ios && version ) {\n\t\t\tswitch ( version ) {\n\t\t\t\tcase 8:\n\t\t\t\t\t// Test UA for iOS8. Or for simulator look for Version 8\n\t\t\t\t\t// In the iOS simulator the OS is the host machine OS version\n\t\t\t\t\t// This makes testing in iOS8 simulator work as expected\n\t\t\t\t\treturn /OS 8_/.test( ua ) || /Version\\/8/.test( ua );\n\t\t\t\tcase 4:\n\t\t\t\t\treturn /OS 4_/.test( ua );\n\t\t\t\tcase 5:\n\t\t\t\t\treturn /OS 5_/.test( ua );\n\t\t\t\tdefault:\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t} else {\n\t\t\treturn ios;\n\t\t}\n\t} ),\n\t/**\n\t * Determine if a device has a widescreen.\n\t *\n\t * @memberof Browser\n\t * @instance\n\t * @return {boolean}\n\t */\n\tisWideScreen: memoize( () => {\n\t\tconst val = parseInt( mw.config.get( 'wgMFDeviceWidthTablet' ), 10 );\n\t\t// Check viewport width to determine mobile vs tablet.\n\t\t// Note: Mobile devices held in landscape mode might receive tablet treatment.\n\t\treturn window.innerWidth >= val;\n\t} ),\n\t/**\n\t * Whether touchstart and other touch events are supported by the current browser.\n\t *\n\t * @memberof Browser\n\t * @instance\n\t * @return {boolean}\n\t */\n\tsupportsTouchEvents: memoize( () => 'ontouchstart' in window )\n};\n\n/**\n * @memberof Browser\n * @return {Browser}\n */\nBrowser.getSingleton = function () {\n\tlet $html;\n\tif ( !browser ) {\n\t\t$html = util.getDocument();\n\t\tbrowser = new Browser( window.navigator.userAgent, $html );\n\t}\n\treturn browser;\n};\n\nmodule.exports = Browser;\n","const\n\tmfExtend = require( './mfExtend' ),\n\tutil = require( './util' ),\n\tView = require( './View' ),\n\tIconButton = require( './IconButton' );\n\n/**\n * A wrapper for creating a button.\n * FIXME: T343036 This file should be combined with IconButton, all gadgets/extentions\n * using Button.js and IconButton.js will need to be updated to reflect this\n *\n * @class Button\n * @private\n * @extends module:mobile.startup/View\n *\n * @param {Object} options Configuration options\n */\nfunction Button( options ) {\n\tView.call( this, options );\n}\n\nmfExtend( Button, View, {\n\t/**\n\t * @inheritdoc\n\t * @memberof IconButton\n\t * @instance\n\t */\n\tpreRender() {\n\t\t// Mapping existing props to Codex props used in IconButton\n\t\tlet action = 'default';\n\t\tif ( this.options.progressive ) {\n\t\t\taction = 'progressive';\n\t\t} else if ( this.options.destructive ) {\n\t\t\taction = 'destructive';\n\t\t}\n\t\tlet weight = this.options.quiet ? 'quiet' : 'normal';\n\t\tif ( this.options.progressive || this.options.destructive ) {\n\t\t\tweight = 'primary';\n\t\t}\n\t\tif ( this.options.block ) {\n\t\t\tthis.options.additionalClassNames += ' mf-button-block';\n\t\t}\n\t\tconst options = util.extend( {\n\t\t\tweight,\n\t\t\taction,\n\t\t\tisIconOnly: false,\n\t\t\ticon: null\n\t\t}, this.options );\n\n\t\tthis._button = new IconButton( options );\n\t\tthis.options._buttonHTML = this._button.$el.get( 0 ).outerHTML;\n\t},\n\t/**\n\t * @inheritdoc\n\t * @memberof Button\n\t * @instance\n\t */\n\tisTemplateMode: true,\n\t/**\n\t * @memberof Button\n\t * @instance\n\t * @mixes module:mobile.startup/View#defaults\n\t * @property {Object} defaults Default options hash.\n\t * @property {string} defaults.tagName The name of the tag in which the button is wrapped.\n\t * @property {boolean} defaults.block is stacked button\n\t * @property {boolean} defaults.progressive is progressive action\n\t * @property {boolean} defaults.quiet is quiet button\n\t * @property {boolean} defaults.destructive is destructive action\n\t * @property {string} defaults.additionalClassNames Additional class name(s).\n\t * @property {string} defaults.href url\n\t * @property {string} defaults.label of button\n\t * @property {boolean} defaults.disabled should only be used with tagName button\n\t */\n\tdefaults: {\n\t\ttagName: 'a',\n\t\tdisabled: false,\n\t\tblock: undefined,\n\t\tprogressive: undefined,\n\t\tdestructive: undefined,\n\t\tquiet: undefined,\n\t\tadditionalClassNames: '',\n\t\thref: undefined,\n\t\tlabel: undefined,\n\t\tsize: 'medium'\n\t},\n\t/**\n\t * @memberof Button\n\t * @instance\n\t */\n\ttemplate: util.template( '{{{_buttonHTML}}}' )\n} );\n\nmodule.exports = Button;\n","const\n\tDrawer = require( './Drawer' ),\n\tutil = require( './util' ),\n\tButton = require( './Button' ),\n\tAnchor = require( './Anchor' );\n\n/**\n * Represents a query string value.\n *\n * @typedef {string|number|boolean|undefined|string[]|boolean[]} module:mobile.startup~QueryVal\n */\n/**\n * Describes a combination of query string parameters.\n *\n * @typedef {Object.<string, module:mobile.startup~QueryVal>} module:mobile.startup~QueryParams\n */\n\n/**\n * Describes a call to action drawer.\n *\n * @memberof module:mobile.startup\n * @typedef {Object} CtaOptions\n * @prop {string} [returnTo]\n * @prop {module:mobile.startup~QueryParams} [queryParams]\n * @prop {module:mobile.startup~QueryParams} [signupQueryParams]\n * @prop {Object} [progressiveButton] button options for Button element for signing in.\n * If omitted will create a login URL.\n * @prop {Object} [actionAnchor] anchor options for Anchor element for signing up. If omitted\n * will create a sign up URL\n * @prop {string} content text - what is the call to action?\n */\n\n/**\n * Internal for use inside Minerva only, creates the drawer at the bottom of the screen that appears when an anonymous\n * user tries to perform an action that requires being logged in. It presents the user\n * with options to log in or sign up for a new account.\n *\n * @function CtaDrawer\n * @memberof module:mobile.startup\n * @param {module:mobile.startup.CtaOptions} options Options for drawer.\n * @return {module:mobile.startup/Drawer}\n */\nfunction CtaDrawer( options = {} ) {\n\tconst params = redirectParams( options.queryParams, options.returnTo );\n\treturn new Drawer(\n\t\tutil.extend( {\n\t\t\tchildren: [\n\t\t\t\tutil.parseHTML( '<p>' ).text( options.content ),\n\t\t\t\tnew Button( util.extend( {\n\t\t\t\t\tprogressive: true,\n\t\t\t\t\thref: mw.util.getUrl( 'Special:UserLogin', params ),\n\t\t\t\t\tlabel: mw.msg( 'mobile-frontend-watchlist-cta-button-login' )\n\t\t\t\t}, options.progressiveButton ) ).$el,\n\t\t\t\tutil.parseHTML( '<div>' ).addClass( 'cta-drawer__anchors' ).append(\n\t\t\t\t\t// Update Minerva first to avoid needing to keep this closeAnchor\n\t\t\t\t\tnew Anchor( util.extend( {\n\t\t\t\t\t\thref: mw.util.getUrl(\n\t\t\t\t\t\t\t'Special:UserLogin', signUpParams( params, options.signupQueryParams )\n\t\t\t\t\t\t),\n\t\t\t\t\t\tprogressive: true,\n\t\t\t\t\t\tlabel: mw.msg( 'mobile-frontend-watchlist-cta-button-signup' )\n\t\t\t\t\t}, options.actionAnchor ) ).$el\n\t\t\t\t)\n\t\t\t]\n\t\t}, options )\n\t);\n}\n\n/**\n * Special:UserLogin post-request redirect query parameters.\n *\n * @ignore\n * @param {QueryParams} params\n * @param {string} [redirectURL]\n * @return {QueryParams}\n */\nfunction redirectParams( params, redirectURL ) {\n\treturn util.extend( {\n\t\t// use wgPageName as this includes the namespace if outside Main\n\t\treturnto: redirectURL || mw.config.get( 'wgPageName' )\n\t}, params );\n}\n\n/**\n * Special:UserLogin account creation query parameters.\n *\n * @ignore\n * @param {...QueryParams} params\n * @return {QueryParams}\n */\nfunction signUpParams() {\n\t[].push.call( arguments, { type: 'signup' } );\n\treturn util.extend.apply( util, arguments );\n}\n\nCtaDrawer.prototype.test = {\n\tredirectParams,\n\tsignUpParams\n};\n\nmodule.exports = CtaDrawer;\n","const\n\tmfExtend = require( './mfExtend' ),\n\tView = require( './View' ),\n\tutil = require( './util' ),\n\tIconButton = require( './IconButton' );\n\n/**\n * @classdesc A {@link View} that pops up from the bottom of the screen.\n * @class module:mobile.startup/Drawer\n * @extends module:mobile.startup/View\n * @final\n * @param {Object} props\n * @param {string} [props.className] Additional CSS classes to add\n * @param {jQuery.Element[]} [props.children] An array of elements to append to\n * @param {Function} [props.onShow] Callback called before showing the drawer.\n * It receives a promise given the show process is asynchronous.\n * @param {Function} [props.onBeforeHide] Callback called before hiding the drawer\n */\nfunction Drawer( props ) {\n\tthis.drawerClassName = props.className || '';\n\tthis.collapseIcon = new IconButton( {\n\t\ticon: 'expand',\n\t\tadditionalClassNames: 'cancel',\n\t\tlabel: mw.msg( 'mobile-frontend-drawer-arrow-label' )\n\t} );\n\tView.call( this,\n\t\tutil.extend(\n\t\t\t{\n\t\t\t\tonBeforeHide: () => {},\n\t\t\t\tshowCollapseIcon: true\n\t\t\t},\n\t\t\tprops,\n\t\t\t{\n\t\t\t\tclassName: 'drawer-container'\n\t\t\t},\n\t\t\t{ events: util.extend( {\n\t\t\t\t'click .drawer-container__mask': function () {\n\t\t\t\t\tthis.hide();\n\t\t\t\t}.bind( this ),\n\t\t\t\t'click .cancel': function ( ev ) {\n\t\t\t\t\tev.preventDefault();\n\t\t\t\t\tthis.hide();\n\t\t\t\t}.bind( this ),\n\t\t\t\tclick( ev ) {\n\t\t\t\t\tev.stopPropagation();\n\t\t\t\t}\n\t\t\t}, props.events ) }\n\t\t)\n\t);\n}\n\nmfExtend( Drawer, View, {\n\t$mask: null,\n\n\t/**\n\t * Shows panel after a slight delay\n\t *\n\t * @memberof module:mobile.startup/Drawer\n\t * @instance\n\t * @method\n\t * @return {jQuery.Promise}\n\t */\n\tshow() {\n\t\tconst d = util.Deferred();\n\t\tthis.$el.prepend( this.$mask );\n\t\t// Force redraw by asking the browser to measure the element's width\n\t\tthis.$el.width();\n\t\tconst $drawer = this.$el.find( '.drawer' );\n\t\tthis.$mask.addClass( 'drawer-container__mask--visible' );\n\t\tif ( !$drawer.hasClass( 'visible' ) ) {\n\t\t\t$drawer.addClass( 'visible' );\n\t\t\t// IntersectionObserver doesn't fire for content\n\t\t\t// in drawers, so trigger manually (T361212)\n\t\t\tmw.hook( 'mobileFrontend.loadLazyImages' ).fire( this.$el );\n\t\t\tif ( this.options.onShow ) {\n\t\t\t\tthis.options.onShow( d );\n\t\t\t}\n\t\t\trequestAnimationFrame( () => d.resolve() );\n\t\t} else {\n\t\t\td.resolve();\n\t\t}\n\t\treturn d.promise();\n\t},\n\n\t/**\n\t * Hides panel\n\t *\n\t * @memberof module:mobile.startup/Drawer\n\t * @instance\n\t */\n\thide() {\n\t\tconst $drawer = this.$el.find( '.drawer' );\n\t\t$drawer.removeClass( 'visible' );\n\t\tthis.$mask.removeClass( 'drawer-container__mask--visible' );\n\t\t// Should really use 'transitionend' event here, but as the\n\t\t// parent $drawer element is often detatched as well, this\n\t\t// might not fire until the next show animation.\n\t\tsetTimeout( () => {\n\t\t\tthis.$mask.detach();\n\t\t}, 100 );\n\t\trequestAnimationFrame( () => {\n\t\t\tthis.options.onBeforeHide( this );\n\t\t} );\n\t},\n\n\t/**\n\t * @inheritdoc\n\t * @memberof module:mobile.startup/Drawer\n\t * @instance\n\t */\n\tpostRender() {\n\t\tthis.$mask = util.parseHTML( '<div>' ).addClass( 'drawer-container__mask' );\n\t\tconst props = this.options,\n\t\t\t// eslint-disable-next-line mediawiki/class-doc\n\t\t\t$drawer = util.parseHTML( '<div>' )\n\t\t\t\t.addClass( `drawer drawer-container__drawer position-fixed ${ this.drawerClassName }`.trim() );\n\n\t\tif ( props.showCollapseIcon ) {\n\t\t\t// append the collapse icon at the top of the drawer\n\t\t\t$drawer.prepend( this.collapseIcon.$el );\n\t\t}\n\n\t\tif ( props.children ) {\n\t\t\t// append children\n\t\t\t$drawer.append( props.children );\n\t\t}\n\t\tthis.$el.append( $drawer );\n\t}\n} );\n\nmodule.exports = Drawer;\n","const\n\tmfExtend = require( './mfExtend' ),\n\tutil = require( './util' ),\n\tView = require( './View' );\n\n/**\n * @class module:mobile.startup/Icon\n * @classdesc A wrapper for creating an icon.\n * @extends module:mobile.startup/View\n * @param {Object} options Configuration options\n */\nfunction Icon( options ) {\n\tView.call( this, options );\n}\n\nmfExtend( Icon, View, {\n\t/**\n\t * @inheritdoc\n\t * @memberof Icon\n\t * @instance\n\t */\n\tpreRender() {\n\t\tthis.options._iconClasses = this.getIconClasses();\n\t},\n\t/**\n\t * Internal method that sets the correct rotation class for the icon\n\t * based on the value of rotation\n\t *\n\t * @memberof Icon\n\t * @instance\n\t * @private\n\t */\n\tgetRotationClass() {\n\t\tlet rotationClass = '';\n\t\tif ( this.options.rotation ) {\n\t\t\tswitch ( this.options.rotation ) {\n\t\t\t\tcase -180:\n\t\t\t\tcase 180:\n\t\t\t\t\trotationClass = 'mf-icon-rotate-flip';\n\t\t\t\t\tbreak;\n\t\t\t\tcase -90:\n\t\t\t\t\trotationClass = 'mf-icon-rotate-anti-clockwise';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 90:\n\t\t\t\t\trotationClass = 'mf-icon-rotate-clockwise';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 0:\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Error( 'Bad value for rotation given. Must be ±90, 0 or ±180.' );\n\t\t\t}\n\t\t}\n\t\treturn rotationClass;\n\t},\n\t/**\n\t * Set icon glyph class and icon type class\n\t *\n\t * @memberof Icon\n\t * @instance\n\t * @private\n\t */\n\tgetIconClasses() {\n\t\tconst base = this.options.base;\n\t\tconst icon = this.options.icon;\n\t\tconst isSmall = this.options.isSmall;\n\t\tconst rotationClasses = this.getRotationClass();\n\t\tconst additionalClassNames = this.options.additionalClassNames;\n\n\t\tlet classes = base + ' ';\n\t\tif ( icon ) {\n\t\t\tclasses += this.getGlyphClassName() + ' ';\n\t\t}\n\t\tif ( isSmall ) {\n\t\t\tclasses += 'mf-icon--small ';\n\t\t}\n\t\tif ( additionalClassNames ) {\n\t\t\tclasses += additionalClassNames + ' ';\n\t\t}\n\n\t\treturn classes + rotationClasses;\n\t},\n\t/**\n\t * @inheritdoc\n\t * @memberof Icon\n\t * @instance\n\t */\n\tisTemplateMode: true,\n\t/**\n\t * @memberof Icon\n\t * @instance\n\t * @mixes module:mobile.startup/View#defaults\n\t * @property {Object} defaults\n\t * @property {string} defaults.base Base icon class.\n\t * Defaults to 'mf-icon'.\n\t * @property {string} defaults.glyphPrefix Prefix for the icon class\n\t * Defaults to 'mf'.\n\t * @property {string} defaults.icon Name of the icon.\n\t * @property {boolean} defaults.rotation will rotate the icon by a certain number\n\t * of degrees. Must be ±90, 0 or ±180 or will throw exception.\n\t * @property {boolean} defaults.isSmall If icon is small.\n\t * @property {string} defaults.addtionalClassNames Additional classes to be added to the icon.\n\t */\n\tdefaults: {\n\t\tbase: 'mf-icon',\n\t\tglyphPrefix: null,\n\t\ticon: '',\n\t\trotation: 0,\n\t\tisSmall: false,\n\t\tadditionalClassNames: null\n\t},\n\t/**\n\t * Return the full class name that is required for the icon to render\n\t *\n\t * @memberof Icon\n\t * @instance\n\t * @return {string}\n\t */\n\tgetClassName() {\n\t\treturn this.$el.attr( 'class' );\n\t},\n\t/**\n\t * Return the class that relates to the icon glyph\n\t *\n\t * @memberof Icon\n\t * @instance\n\t * @return {string}\n\t */\n\tgetGlyphClassName() {\n\t\tif ( this.options.glyphPrefix ) {\n\t\t\treturn 'mf-icon-' + this.options.glyphPrefix + '-' + this.options.icon;\n\t\t}\n\t\treturn 'mf-icon-' + this.options.icon;\n\t},\n\n\ttemplate: util.template(\n\t\t'<span class=\"{{_iconClasses}}\"> </span>'\n\t)\n} );\n\nmodule.exports = Icon;\n","const\n\tmfExtend = require( './mfExtend' ),\n\tutil = require( './util' ),\n\tView = require( './View' ),\n\tIcon = require( './Icon' );\n\n/**\n * A wrapper for creating an icon button.\n *\n * @class IconButton\n * @extends module:mobile.startup/View\n *\n * @param {Object} options Configuration options\n */\nfunction IconButton( options ) {\n\tif ( options.href ) {\n\t\toptions.tagName = 'a';\n\t}\n\tif ( options.tagName === 'button' ) {\n\t\toptions.isTypeButton = true;\n\t}\n\tView.call( this, options );\n}\n\nmfExtend( IconButton, View, {\n\t/**\n\t * @inheritdoc\n\t * @memberof IconButton\n\t * @instance\n\t */\n\tpreRender() {\n\t\tthis.options._buttonClasses = this.getButtonClasses();\n\t\tthis.options._iconHTML = '';\n\t\tif ( this.options.icon ) {\n\t\t\tthis._icon = new Icon( {\n\t\t\t\tbase: this.options.base,\n\t\t\t\tglyphPrefix: this.options.glyphPrefix,\n\t\t\t\ticon: this.options.icon,\n\t\t\t\trotation: this.options.rotation,\n\t\t\t\tisSmall: this.options.isSmall\n\t\t\t} );\n\t\t\tthis.options._iconHTML = this._icon.$el.get( 0 ).outerHTML;\n\t\t}\n\t},\n\tgetButtonClasses() {\n\t\tconst additionalClassNames = this.options.additionalClassNames;\n\t\tconst size = this.options.size;\n\t\tconst weight = this.options.weight;\n\t\tconst action = this.options.action;\n\t\tconst isIconOnly = this.options.isIconOnly;\n\t\tlet classes = 'cdx-button ';\n\n\t\tif ( this.options.tagName !== 'button' ) {\n\t\t\tclasses += 'cdx-button--fake-button cdx-button--fake-button--enabled ';\n\t\t}\n\t\tif ( size ) {\n\t\t\tclasses += `cdx-button--size-${ size } `;\n\t\t}\n\t\tif ( weight ) {\n\t\t\tclasses += `cdx-button--weight-${ weight } `;\n\t\t}\n\t\tif ( action ) {\n\t\t\tclasses += `cdx-button--action-${ action } `;\n\t\t}\n\t\tif ( isIconOnly ) {\n\t\t\tclasses += 'cdx-button--icon-only ';\n\t\t}\n\t\treturn classes + additionalClassNames;\n\t},\n\t/**\n\t * @inheritdoc\n\t * @memberof IconButton\n\t * @instance\n\t */\n\tisTemplateMode: true,\n\t/**\n\t * @memberof IconButton\n\t * @instance\n\t * @mixes module:mobile.startup/View#defaults\n\t * @property {Object} defaults Default options hash.\n\t * @property {string} defaults.tagName The name of the tag in which the button is wrapped.\n\t * Defaults to 'a' when href option present.\n\t * @property {string} [defaults.href] value of href attribute,\n\t * when set tagName will default to anchor tag\n\t * @property {string} defaults.additionalClassNames Additional classes to be added to the button\n\t * @property {string} defaults.title Tooltip text.\n\t * @property {string} defaults.size Button size.\n\t * Defaults to 'large'.\n\t * @property {boolean} defaults.weight Button weight.\n\t * Defaults to 'quiet'.\n\t * @property {boolean} defaults.action Button action.\n\t * @property {boolean} defaults.isIconOnly Whether button is an icon only button\n\t * Defaults to true.\n\t * @property {boolean} defaults.disabled should only be used with tagName button\n\t * @property {string} defaults.base String used as a base for generating class names.\n\t * Defaults to 'mf-icon'.\n\t * @property {string} defaults.glyphPrefix Prefix for the icon class\n\t * @property {string} defaults.icon Name of the icon.\n\t * @property {boolean} defaults.rotation will rotate the icon by a certain number\n\t * of degrees. Must be ±90, 0 or ±180 or will throw exception.\n\t * @property {boolean} defaults.isSmall Whether the icon should be small.\n\t */\n\tdefaults: {\n\t\ttagName: 'button',\n\t\thref: undefined,\n\t\tadditionalClassNames: '',\n\t\ttitle: '',\n\t\tsize: 'large',\n\t\tweight: 'quiet',\n\t\taction: '',\n\t\tisIconOnly: true,\n\t\tdisabled: false,\n\t\tbase: 'mf-icon',\n\t\ticon: '',\n\t\trotation: 0,\n\t\tisSmall: false\n\t},\n\t/**\n\t * Return the full class name that is required for the icon to render\n\t *\n\t * @memberof IconButton\n\t * @instance\n\t * @return {string}\n\t */\n\tgetClassName() {\n\t\treturn this.$el.attr( 'class' );\n\t},\n\tgetIcon() {\n\t\treturn this._icon;\n\t},\n\ttemplate: util.template( `\n\t\t<{{tagName}}\n\t\t\ttype=\"button\"\n\t\t\t{{#isTypeButton}}{{#disabled}}disabled{{/disabled}}{{/isTypeButton}}\n\t\t\tclass=\"{{_buttonClasses}}\"\n\t\t\t{{#id}}id=\"{{id}}\"{{/id}}\n\t\t\t{{#href}}href=\"{{href}}\"{{/href}}\n\t\t\t{{#title}}title=\"{{title}}\"{{/title}}>\n\t\t\t\t{{{_iconHTML}}}\n\t\t\t\t<span>{{label}}</span>\n\t\t</{{tagName}}>\n\t` )\n} );\n\nmodule.exports = IconButton;\n","const\n\tView = require( './View' ),\n\tutil = require( './util' ),\n\tmfExtend = require( './mfExtend' );\n\n/**\n * Render CSS version of Codex message component.\n *\n * @class MessageBox\n * @extends module:mobile.startup/View\n */\nfunction MessageBox() {\n\tView.apply( this, arguments );\n}\n\nmfExtend( MessageBox, View, {\n\t/**\n\t * @inheritdoc\n\t * @memberof MessageBox\n\t * @instance\n\t */\n\tisTemplateMode: true,\n\t/**\n\t * @memberof MessageBox\n\t * @instance\n\t * @mixes module:mobile.startup/View#defaults\n\t * @property {Object} defaults Default options hash.\n\t * @property {string} [defaults.heading] heading to show along with message (text)\n\t * @property {string} defaults.msg message to show (html)\n\t * @property {string} defaults.type either error, notice or warning\n\t * @property {string} defaults.className\n\t */\n\tdefaults: {},\n\t/**\n\t * @memberof MessageBox\n\t * @instance\n\t */\n\ttemplate: util.template( `\n<div\n class=\"cdx-message cdx-message--block cdx-message--{{type}} {{className}}\"\n aria-live=\"polite\"\n>\n <!-- Empty span for message icon. -->\n <span class=\"cdx-message__icon\"></span>\n <!-- Div for content. -->\n <div class=\"cdx-message__content\">\n {{#heading}}<h2>{{heading}}</h2>{{/heading}}\n {{{msg}}}\n </div>\n</div>\n\t` )\n} );\n\nmodule.exports = MessageBox;\n","const\n\tView = require( './View' ),\n\theader = require( './headers' ).header,\n\tAnchor = require( './Anchor' ),\n\tutil = require( './util' ),\n\tbrowser = require( './Browser' ).getSingleton(),\n\tmfExtend = require( './mfExtend' );\n\n/**\n * @class module:mobile.startup/Overlay\n * @classdesc Mobile modal window\n * @extends module:mobile.startup/View\n * @uses Icon\n * @uses Button\n * @fires Overlay#hide\n * @param {Object} props\n * @param {Object} props.events - custom events to be bound to the overlay.\n * @param {boolean} [props.headerChrome] Whether the header has chrome.\n * @param {View[]} [props.headerActions] children (usually buttons or icons)\n * that should be placed in the header actions. Ignored when `headers` used.\n * @param {string} [props.heading] heading for the overlay header. Use `headers` where\n * overlays require more than one header. Ignored when `headers` used.\n * @param {boolean} props.noHeader renders an overlay without a header\n * @param {Element[]} [props.headers] allows overlays to have more than one\n * header. When used it is an array of jQuery Objects representing\n * headers created via the header util function. It is expected that only one of these\n * should be visible. If undefined, headerActions and heading is used.\n * @param {Object} [props.footerAnchor] options for an optional Anchor\n * that can appear in the footer\n * @param {Function} props.onBeforeExit allows a consumer to prevent exits in certain\n * situations. This callback gets the following parameters:\n * - 1) the exit function which should be run after the consumer has made their changes.\n * - 2) the cancel function which should be run if the consumer explicitly changes their mind\n */\nfunction Overlay( props ) {\n\tthis.isIos = browser.isIos();\n\n\tView.call(\n\t\tthis,\n\t\tutil.extend(\n\t\t\ttrue,\n\t\t\t{\n\t\t\t\theaderChrome: false,\n\t\t\t\tclassName: 'overlay'\n\t\t\t},\n\t\t\tprops,\n\t\t\t{\n\t\t\t\tevents: util.extend(\n\t\t\t\t\t{\n\t\t\t\t\t\t// FIXME: Remove .initial-header selector\n\t\t\t\t\t\t'click .cancel, .confirm, .initial-header .back': 'onExitClick',\n\t\t\t\t\t\tclick: ( ev ) => ev.stopPropagation()\n\t\t\t\t\t},\n\t\t\t\t\tprops.events\n\t\t\t\t)\n\t\t\t}\n\t\t)\n\t);\n}\n\nmfExtend( Overlay, View, {\n\ttemplate: util.template( `\n{{^noHeader}}\n<div class=\"overlay-header-container header-container{{#headerChrome}}\n\theader-chrome{{/headerChrome}} position-fixed\">\n</div>\n{{/noHeader}}\n<div class=\"overlay-content\">\n\t{{>content}}\n</div>\n<div class=\"overlay-footer-container position-fixed\"></div>\n\t` ),\n\n\thideTimeout: null,\n\n\t/**\n\t * Shows the spinner right to the input field.\n\t *\n\t * @memberof module:mobile.startup/Overlay\n\t * @instance\n\t * @method\n\t */\n\tshowSpinner() {\n\t\tthis.$el.find( '.spinner' ).removeClass( 'hidden' );\n\t},\n\n\t/**\n\t * Hide the spinner near to the input field.\n\t *\n\t * @memberof module:mobile.startup/Overlay\n\t * @instance\n\t * @method\n\t */\n\thideSpinner() {\n\t\tthis.$el.find( '.spinner' ).addClass( 'hidden' );\n\t},\n\n\t/**\n\t * @inheritdoc\n\t * @memberof module:mobile.startup/Overlay\n\t * @instance\n\t */\n\tpostRender() {\n\t\tconst footerAnchor = this.options.footerAnchor;\n\t\tthis.$overlayContent = this.$el.find( '.overlay-content' );\n\t\tif ( this.isIos ) {\n\t\t\tthis.$el.addClass( 'overlay-ios' );\n\t\t}\n\t\tif ( footerAnchor ) {\n\t\t\tthis.$el.find( '.overlay-footer-container' ).append( new Anchor( footerAnchor ).$el );\n\t\t}\n\t\tconst headers = this.options.headers || [\n\t\t\theader(\n\t\t\t\tthis.options.heading,\n\t\t\t\tthis.options.headerActions\n\t\t\t)\n\t\t];\n\t\tthis.$el.find( '.overlay-header-container' ).append( headers );\n\t},\n\n\t/**\n\t * ClickBack event handler\n\t *\n\t * @memberof module:mobile.startup/Overlay\n\t * @instance\n\t * @param {Object} ev event object\n\t */\n\tonExitClick( ev ) {\n\t\tconst exit = function () {\n\t\t\tthis.hide();\n\t\t}.bind( this );\n\t\tev.preventDefault();\n\t\tev.stopPropagation();\n\t\tif ( this.options.onBeforeExit ) {\n\t\t\tthis.options.onBeforeExit( exit, () => {\n\t\t\t} );\n\t\t} else {\n\t\t\texit();\n\t\t}\n\n\t},\n\t/**\n\t * Attach overlay to current view and show it.\n\t *\n\t * @memberof module:mobile.startup/Overlay\n\t * @instance\n\t */\n\tshow() {\n\t\tconst $html = util.getDocument();\n\n\t\tthis.scrollTop = window.pageYOffset;\n\n\t\t$html.addClass( 'overlay-enabled' );\n\t\t// skip the URL bar if possible\n\t\twindow.scrollTo( 0, 1 );\n\n\t\tthis.$el.addClass( 'visible' );\n\n\t\t// If .hide() was called earlier, and it scheduled an asynchronous detach\n\t\t// but it hasn't happened yet, cancel it\n\t\tif ( this.hideTimeout !== null ) {\n\t\t\tclearTimeout( this.hideTimeout );\n\t\t\tthis.hideTimeout = null;\n\t\t}\n\t},\n\t/**\n\t * Detach the overlay from the current view\n\t * Should not be overriden as soon to be deprecated.\n\t *\n\t * @memberof module:mobile.startup/Overlay\n\t * @instance\n\t * @final\n\t * @return {boolean} Whether the overlay was successfully hidden or not\n\t */\n\thide() {\n\t\tutil.getDocument().removeClass( 'overlay-enabled' );\n\t\t// return to last known scroll position\n\t\twindow.scrollTo( window.pageXOffset, this.scrollTop );\n\n\t\t// Since the hash change event caused by emitting hide will be detected later\n\t\t// and to avoid the article being shown during a transition from one overlay to\n\t\t// another, we regretfully detach the element asynchronously.\n\t\tthis.hideTimeout = setTimeout( () => {\n\t\t\tthis.$el.detach();\n\t\t\tthis.hideTimeout = null;\n\t\t}, 0 );\n\n\t\t/**\n\t\t * Fired when the overlay is closed.\n\t\t *\n\t\t * @event Overlay#hide\n\t\t */\n\t\tthis.emit( 'hide' );\n\n\t\treturn true;\n\t},\n\n\t/**\n\t * Show elements that are selected by the className.\n\t * Also hide .hideable elements\n\t * Can't use jQuery's hide() and show() because show() sets display: block.\n\t * And we want display: table for headers.\n\t *\n\t * @memberof module:mobile.startup/Overlay\n\t * @instance\n\t * @protected\n\t * @param {string} className CSS selector to show\n\t */\n\tshowHidden( className ) {\n\t\tthis.$el.find( '.hideable' ).addClass( 'hidden' );\n\t\tthis.$el.find( className ).removeClass( 'hidden' );\n\t}\n} );\n\n/**\n * Factory method for an overlay with a single child\n *\n * @memberof module:mobile.startup/Overlay\n * @instance\n * @protected\n * @param {Object} options\n * @param {module:mobile.startup/View} view\n * @return {module:mobile.startup/Overlay}\n */\nOverlay.make = function ( options, view ) {\n\tconst overlay = new Overlay( options );\n\toverlay.$el.find( '.overlay-content' ).append( view.$el );\n\treturn overlay;\n};\n\nmodule.exports = Overlay;\n","const util = require( './util' );\n\nlet overlayManager = null;\n\n// We pass this to history.pushState/replaceState to indicate that we're controlling the page URL.\n// Then we look for this marker on page load so that if the page is refreshed, we don't generate an\n// extra history entry (see #getSingleton below and T201852).\nconst MANAGED_STATE = 'MobileFrontend OverlayManager was here!';\n\n/**\n * Manages opening and closing overlays when the URL hash changes to one\n * of the registered values (see OverlayManager.add()).\n *\n * This allows overlays to function like real pages, with similar browser back/forward\n * and refresh behavior.\n *\n * @class module:mobile.startup/OverlayManager\n * @param {Router} router\n * @param {Element} container where overlays should be managed\n */\nfunction OverlayManager( router, container ) {\n\trouter.on( 'route', this._checkRoute.bind( this ) );\n\tthis.router = router;\n\t// use an object instead of an array for entries so that we don't\n\t// duplicate entries that already exist\n\tthis.entries = {};\n\t// stack of all the open overlays, stack[0] is the latest one\n\tthis.stack = [];\n\tthis.hideCurrent = true;\n\t// Set the element that overlays will be appended to\n\tthis.container = container;\n}\n\n/**\n * Attach an event to the overlays hide event\n *\n * @param {module:mobile.startup/Overlay} overlay\n * @private\n */\nfunction attachHideEvent( overlay ) {\n\toverlay.on( 'hide', () => overlay.emit( '_om_hide' ) );\n}\n\nOverlayManager.prototype = {\n\t/**\n\t * Don't try to hide the active overlay on a route change event triggered\n\t * by hiding another overlay.\n\t * Called when something other than OverlayManager calls Overlay.hide\n\t * on an overlay that it itself managed by the OverlayManager.\n\t * MUST be called when the stack is not empty.\n\t *\n\t * @memberof module:mobile.startup/OverlayManager\n\t * @instance\n\t * @private\n\t */\n\t_onHideOverlayOutsideOverlayManager() {\n\t\tif ( !this.stack.length ) {\n\t\t\treturn;\n\t\t}\n\t\tconst currentRoute = this.stack[0].route,\n\t\t\trouteIsString = typeof currentRoute === 'string',\n\t\t\tcurrentPath = this.router.getPath(),\n\t\t\t// Since routes can be strings or regexes, it's important to do an equality\n\t\t\t// check BEFORE a match check.\n\t\t\trouteIsSame = ( routeIsString && currentPath === currentRoute ) ||\n\t\t\t\tcurrentPath.match( currentRoute );\n\n\t\tthis.hideCurrent = false;\n\n\t\t// If the path hasn't changed then the user didn't close the overlay by\n\t\t// calling history.back() or triggering a route change. We must go back\n\t\t// to get out of the overlay. See T237677.\n\t\tif ( routeIsSame ) {\n\t\t\t// does the route need to change?\n\t\t\tthis.router.back();\n\t\t}\n\t},\n\n\t/**\n\t * Attach overlay to DOM\n\t *\n\t * @memberof module:mobile.startup/OverlayManager\n\t * @instance\n\t * @private\n\t * @param {module:mobile.startup/Overlay} overlay to attach\n\t */\n\t_attachOverlay( overlay ) {\n\t\tif ( !overlay.$el.parents().length ) {\n\t\t\tthis.container.appendChild( overlay.$el[0] );\n\t\t}\n\t},\n\t/**\n\t * Show the overlay and bind the '_om_hide' event to _onHideOverlay.\n\t *\n\t * @memberof module:mobile.startup/OverlayManager\n\t * @instance\n\t * @private\n\t * @param {module:mobile.startup/Overlay} overlay to show\n\t */\n\t_show( overlay ) {\n\t\t// Mark the state so that if the page is refreshed, we don't generate an extra history entry\n\t\t// (see #getSingleton below and T201852).\n\t\t// eslint-disable-next-line no-restricted-properties\n\t\twindow.history.replaceState( MANAGED_STATE, null, window.location.href );\n\n\t\t// the _om_hide event is added to an overlay that is displayed.\n\t\t// It will fire if an Overlay emits a hide event (See attachHideEvent)\n\t\t// in the case where a route change has not occurred (this event is disabled\n\t\t// inside _hideOverlay which is called inside _checkRoute)\n\t\toverlay.once( '_om_hide', this._onHideOverlayOutsideOverlayManager.bind( this ) );\n\n\t\tthis._attachOverlay( overlay );\n\t\toverlay.show();\n\t},\n\n\t/**\n\t * Hide overlay\n\t *\n\t * @memberof module:mobile.startup/OverlayManager\n\t * @instance\n\t * @private\n\t * @param {module:mobile.startup/Overlay} overlay to hide\n\t * @param {Function} onBeforeExitCancel to pass to onBeforeExit\n\t * @return {boolean} Whether the overlay has been hidden\n\t */\n\t_hideOverlay( overlay, onBeforeExitCancel ) {\n\t\tlet result;\n\n\t\tfunction exit() {\n\t\t\tresult = true;\n\t\t\toverlay.hide();\n\t\t}\n\n\t\t// remove the callback for updating state when overlay closed using\n\t\t// overlay close button\n\t\toverlay.off( '_om_hide' );\n\n\t\tif ( overlay.options && overlay.options.onBeforeExit ) {\n\t\t\toverlay.options.onBeforeExit( exit, onBeforeExitCancel );\n\t\t} else {\n\t\t\texit();\n\t\t}\n\n\t\t// if closing prevented, reattach the callback\n\t\tif ( !result ) {\n\t\t\toverlay.once( '_om_hide', this._onHideOverlayOutsideOverlayManager.bind( this ) );\n\t\t}\n\n\t\treturn result;\n\t},\n\n\t/**\n\t * Show match's overlay if match is not null.\n\t *\n\t * @memberof module:mobile.startup/OverlayManager\n\t * @instance\n\t * @private\n\t * @param {Object|null} match Object with factory function's result. null if no match.\n\t */\n\t_processMatch( match ) {\n\t\tconst self = this;\n\n\t\tif ( match ) {\n\t\t\tif ( match.overlay ) {\n\t\t\t\t// if the match is an overlay that was previously opened, reuse it\n\t\t\t\tself._show( match.overlay );\n\t\t\t} else {\n\t\t\t\t// else create an overlay using the factory function result\n\t\t\t\tconst factoryResult = match.factoryResult;\n\t\t\t\t// We were getting errors relating to no factoryResult.\n\t\t\t\t// This should never happen.\n\t\t\t\t// If it does an error should not be thrown.\n\t\t\t\tif ( factoryResult ) {\n\t\t\t\t\tmatch.overlay = factoryResult;\n\t\t\t\t\tattachHideEvent( match.overlay );\n\t\t\t\t\tself._show( factoryResult );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\n\t/**\n\t * A callback for Router's `route` event.\n\t *\n\t * @memberof module:mobile.startup/OverlayManager\n\t * @instance\n\t * @private\n\t * @param {jQuery.Event} ev Event object.\n\t */\n\t_checkRoute( ev ) {\n\t\tconst current = this.stack[0];\n\n\t\t// When entering an overlay for the first time,\n\t\t// the manager should remember the user's scroll position\n\t\t// overlays always open at top of page\n\t\t// and we'll want to restore it later.\n\t\t// This should happen before the call to _matchRoute which will \"show\" the overlay.\n\t\t// The Overlay has similar logic for overlays that are not managed via the overlay.\n\t\tif ( !current ) {\n\t\t\tthis.scrollTop = window.pageYOffset;\n\t\t}\n\n\t\t// if there is an overlay in the stack and it's opened, try to close it\n\t\tif (\n\t\t\tcurrent &&\n\t\t\tcurrent.overlay !== undefined &&\n\t\t\tthis.hideCurrent &&\n\t\t\t!this._hideOverlay( current.overlay, () => {\n\t\t\t\t// if hide prevented, prevent route change event\n\t\t\t\tev.preventDefault();\n\t\t\t} )\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst match = Object.keys( this.entries ).reduce( ( m, id ) => m ||\n\t\t\tthis._matchRoute( ev.path, this.entries[id] ), null );\n\n\t\tif ( !match ) {\n\t\t\t// if hidden and no new matches, reset the stack\n\t\t\tthis.stack = [];\n\t\t\t// restore the scroll position.\n\t\t\twindow.scrollTo( window.pageXOffset, this.scrollTop );\n\t\t}\n\n\t\tthis.hideCurrent = true;\n\t\tthis._processMatch( match );\n\t},\n\n\t/**\n\t * Check if a given path matches one of the existing entries and\n\t * remove it from the stack.\n\t *\n\t * @memberof module:mobile.startup/OverlayManager\n\t * @instance\n\t * @private\n\t * @param {string} path Path (hash) to check.\n\t * @param {Object} entry Entry object created in OverlayManager#add.\n\t * @return {Object|null} Match object with factory function's result.\n\t * Returns null if no match.\n\t */\n\t_matchRoute( path, entry ) {\n\t\tlet\n\t\t\tdidMatch,\n\t\t\tcaptures,\n\t\t\tmatch;\n\n\t\tconst\n\t\t\tprevious = this.stack[1],\n\t\t\tself = this;\n\n\t\tif ( typeof entry.route === 'string' ) {\n\t\t\tdidMatch = entry.route === path;\n\t\t\tcaptures = [];\n\t\t} else {\n\t\t\tmatch = path.match( entry.route );\n\t\t\tdidMatch = !!match;\n\t\t\tcaptures = didMatch ? match.slice( 1 ) : [];\n\t\t}\n\n\t\t/**\n\t\t * Returns object to add to stack\n\t\t *\n\t\t * @method\n\t\t * @ignore\n\t\t * @return {Object}\n\t\t */\n\t\tfunction getNext() {\n\t\t\treturn {\n\t\t\t\tpath,\n\t\t\t\t// Important for managing states of things such as the image overlay which change\n\t\t\t\t// overlay routing parameters during usage.\n\t\t\t\troute: entry.route,\n\t\t\t\tfactoryResult: entry.factory.apply( self, captures )\n\t\t\t};\n\t\t}\n\n\t\tif ( didMatch ) {\n\t\t\t// if previous stacked overlay's path matches, assume we're going back\n\t\t\t// and reuse a previously opened overlay\n\t\t\tif ( previous && previous.path === path ) {\n\t\t\t\tself.stack.shift();\n\t\t\t\treturn previous;\n\t\t\t} else {\n\t\t\t\tconst next = getNext();\n\t\t\t\tif ( this.stack[0] && next.path === this.stack[0].path ) {\n\t\t\t\t\t// current overlay path is same as path to check which means overlay\n\t\t\t\t\t// is attempting to refresh so just replace current overlay with new\n\t\t\t\t\t// overlay\n\t\t\t\t\tself.stack[0] = next;\n\t\t\t\t} else {\n\t\t\t\t\tself.stack.unshift( next );\n\t\t\t\t}\n\t\t\t\treturn next;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t},\n\n\t/**\n\t * Add an overlay that should be shown for a specific fragment identifier.\n\t *\n\t * The following code will display an overlay whenever a user visits a URL that\n\t * ends with '#/hi/name'. The value of `name` will be passed to the overlay.\n\t * Note the factory must return an Overlay.\n\t * If the overlay needs to load code asynchronously that should be done inside\n\t * the overlay.\n\t *\n\t * @example\n\t * overlayManager.add( /\\/hi\\/(.*)/, function ( name ) {\n\t * var HiOverlay = M.require( 'HiOverlay' );\n\t * return new HiOverlay( { name: name } ) );\n\t * } );\n\t *\n\t * @memberof module:mobile.startup/OverlayManager\n\t * @instance\n\t * @param {RegExp|string} route definition that can be a regular\n\t * expression (optionally with parameters) or a string literal.\n\t *\n\t * T238364: Routes should only contain characters allowed by RFC3986 to ensure\n\t * compatibility across browsers. Encode the route with `encodeURIComponent()`\n\t * prior to registering it with OverlayManager if necessary (should probably\n\t * be done with all routes containing user generated characters) to avoid\n\t * inconsistencies with how different browsers encode illegal URI characters:\n\t *\n\t * ```\n\t * var encodedRoute = encodeURIComponent('ugc < \" ` >');\n\t *\n\t * overlayManager.add(\n\t * encodedRoute,\n\t * function () { return new Overlay(); }\n\t * );\n\t *\n\t * window.location.hash = '#' + encodedRoute;\n\t * ```\n\t * The above example shows how to register a string literal route with illegal\n\t * URI characters. Routes registered as a regex will likely NOT have to\n\t * perform any encoding (unless they explicitly contain illegal URI\n\t * characters) as their user generated content portion will likely just be a\n\t * capturing group (e.g. `/\\/hi\\/(.*)/`).\n\t * @param {Function} factory a function returning an overlay\n\t */\n\tadd( route, factory ) {\n\t\tconst self = this,\n\t\t\tentry = {\n\t\t\t\troute,\n\t\t\t\tfactory\n\t\t\t};\n\n\t\tthis.entries[route] = entry;\n\t\t// Check if overlay should be shown for the current path.\n\t\t// The DOM must fully load before we can show the overlay because Overlay relies on it.\n\t\tutil.docReady( () => self._processMatch( self._matchRoute( self.router.getPath(),\n\t\t\tentry ) ) );\n\t},\n\n\t/**\n\t * Replace the currently displayed overlay with a new overlay without changing the\n\t * URL. This is useful for when you want to switch overlays, but don't want to\n\t * change the back button or close box behavior.\n\t *\n\t * @memberof module:mobile.startup/OverlayManager\n\t * @instance\n\t * @param {Object} overlay The overlay to display\n\t */\n\treplaceCurrent( overlay ) {\n\t\tif ( this.stack.length === 0 ) {\n\t\t\tthrow new Error( \"Trying to replace OverlayManager's current overlay, but stack is empty\" );\n\t\t}\n\t\tconst stackOverlay = this.stack[0].overlay;\n\t\tif ( stackOverlay ) {\n\t\t\tthis._hideOverlay( stackOverlay );\n\t\t}\n\t\tthis.stack[0].overlay = overlay;\n\t\tattachHideEvent( overlay );\n\t\tthis._show( overlay );\n\t}\n};\n\n/**\n * Retrieve a singleton instance using 'mediawiki.router'.\n *\n * @memberof module:mobile.startup/OverlayManager\n * @return {module:mobile.startup/OverlayManager}\n */\nOverlayManager.getSingleton = function () {\n\tif ( !overlayManager ) {\n\t\tconst\n\t\t\trouter = __non_webpack_require__( 'mediawiki.router' ),\n\t\t\tcontainer = document.createElement( 'div' ),\n\t\t\t// Note getPath returns hash minus the '#' character:\n\t\t\thash = router.getPath(),\n\t\t\t// eslint-disable-next-line no-restricted-properties\n\t\t\tstate = window.history.state;\n\t\tcontainer.className = 'mw-overlays-container';\n\t\tdocument.body.appendChild( container );\n\t\t// If an overlay was loaded by directly navigating to an URL with a hash (e.g. linked from\n\t\t// another page or browser bookmark), generate an extra history entry to allow closing the\n\t\t// overlay without leaving the page (see T201852). Put our marker into the entry state so\n\t\t// that we can detect it if the page is refreshed and do not generate another entry.\n\t\tif ( hash && state !== MANAGED_STATE ) {\n\t\t\t// eslint-disable-next-line no-restricted-properties\n\t\t\twindow.history.replaceState( null, null, '#' );\n\t\t\t// eslint-disable-next-line no-restricted-properties\n\t\t\twindow.history.pushState( MANAGED_STATE, null, `#${ hash }` );\n\t\t}\n\t\toverlayManager = new OverlayManager( router, container );\n\t}\n\treturn overlayManager;\n};\n\nOverlayManager.test = {\n\tMANAGED_STATE,\n\t__clearCache: () => {\n\t\toverlayManager = null;\n\t}\n};\nmodule.exports = OverlayManager;\n","const\n\tHTML = mw.html,\n\tutil = require( './util' );\n\nclass Page {\n\t/**\n\t * @class module:mobile.startup/Page\n\t * @classdesc Mobile page view object\n\t * @param {Object} options Configuration options\n\t * @param {number} options.id Page ID. The default value of 0 represents a\n\t * new or missing page. Be sure to override it to avoid side effects.\n\t * @param {string} options.title Title of the page. It includes prefix where needed and\n\t * is human readable, e.g. Talk:The man who lived.\n\t * @param {Object} options.titleObj\n\t * @param {string} options.displayTitle HTML title of the page for display. Falls back\n\t * to defaults.title (escaped) if no value is provided. Must be safe HTML!\n\t * @param {number} options.namespaceNumber the number of the\n\t * namespace the page belongs to\n\t * @param {Object} options.protection List of permissions as returned by API,\n\t * e.g. [{ edit: ['*'] }]\n\t * @param {string} options.url\n\t * @param {string} options.wikidataDescription\n\t * @param {boolean} options.isMainPage Whether the page is the Main Page.\n\t * @param {boolean} options.isMissing Whether the page exists in the wiki.\n\t * @param {string} options.anchor\n\t * @param {string} [options.relevantTitle] associated with page.\n\t * For example Special:WhatLinksHere/Foo would be associated with the page `Foo`.\n\t * @param {number} options.revId Revision ID. See `wgRevisionId`.\n\t * @param {boolean} options.isWatched Whether the page is being watched\n\t * @param {Object} options.thumbnail thumbnail definition corresponding to page image\n\t * @param {boolean} options.thumbnail.isLandscape whether the image is in\n\t * landscape format\n\t * @param {number} options.thumbnail.width of image in pixels.\n\t * @param {number} options.thumbnail.height of image in pixels.\n\t * @param {string} options.thumbnail.source url for image\n\t */\n\tconstructor( options ) {\n\t\tconst title = options.title || '';\n\t\tutil.extend( this, {\n\t\t\tid: options.id || 0,\n\t\t\t// FIXME: Deprecate title property as it can be derived from titleObj\n\t\t\t// using getPrefixedText\n\t\t\ttitle,\n\t\t\trelevantTitle: options.relevantTitle || title,\n\t\t\ttitleObj: options.titleObj,\n\t\t\tdisplayTitle: options.displayTitle || HTML.escape( title ),\n\t\t\tnamespaceNumber: options.namespaceNumber || 0,\n\t\t\tprotection: options.protection,\n\t\t\turl: options.url || mw.util.getUrl( title ),\n\t\t\twikidataDescription: options.wikidataDescription,\n\t\t\t_isMainPage: options.isMainPage || false,\n\t\t\tisMissing: ( options.isMissing !== undefined ) ?\n\t\t\t\toptions.isMissing : options.id === 0,\n\t\t\tanchor: options.anchor,\n\t\t\trevId: options.revId,\n\t\t\t_isWatched: options.isWatched,\n\t\t\tthumbnail: ( Object.prototype.hasOwnProperty.call( options, 'thumbnail' ) ) ?\n\t\t\t\toptions.thumbnail : false\n\t\t} );\n\n\t\tif ( this.thumbnail && this.thumbnail.width ) {\n\t\t\tthis.thumbnail.isLandscape = this.thumbnail.width > this.thumbnail.height;\n\t\t}\n\t}\n\n\t/**\n\t * Retrieve the title that should be displayed to the user\n\t *\n\t * @memberof module:mobile.startup/Page\n\t * @return {string} HTML\n\t */\n\tgetDisplayTitle() {\n\t\treturn this.displayTitle;\n\t}\n\n\t/**\n\t * Determine if current page is in a specified namespace\n\t *\n\t * @memberof module:mobile.startup/Page\n\t * @param {string} namespace Name of namespace\n\t * @return {boolean}\n\t */\n\tinNamespace( namespace ) {\n\t\treturn this.namespaceNumber === mw.config.get( 'wgNamespaceIds' )[namespace];\n\t}\n\n\t/**\n\t * Determines if content model is wikitext\n\t *\n\t * @memberof module:mobile.startup/Page\n\t * @return {boolean}\n\t */\n\tisWikiText() {\n\t\treturn mw.config.get( 'wgPageContentModel' ) === 'wikitext';\n\t}\n\n\t/**\n\t * Check if the visual editor is available on this page\n\t *\n\t * @memberof module:mobile.startup/Page\n\t * @return {boolean}\n\t */\n\tisVEAvailable() {\n\t\treturn !!mw.config.get( 'wgVisualEditorConfig' ) &&\n\t\t\t!mw.config.get( 'wgVisualEditorDisabledByHook' ) &&\n\t\t\tthis.isWikiText();\n\t}\n\n\t/**\n\t * Check if the visual editor in visual mode is available on this page\n\t *\n\t * @memberof module:mobile.startup/Page\n\t * @return {boolean}\n\t */\n\tisVEVisualAvailable() {\n\t\tif ( !this.isVEAvailable() ) {\n\t\t\treturn false;\n\t\t}\n\t\tconst config = mw.config.get( 'wgVisualEditorConfig' );\n\t\tconst visualEditorNamespaces = config.namespaces || [];\n\n\t\treturn visualEditorNamespaces.indexOf( mw.config.get( 'wgNamespaceNumber' ) ) !== -1;\n\t}\n\n\t/**\n\t * Check if the visual editor in source mode is available on this page\n\t *\n\t * @memberof module:mobile.startup/Page\n\t * @return {boolean}\n\t */\n\tisVESourceAvailable() {\n\t\treturn this.isVEAvailable() &&\n\t\t\tmw.config.get( 'wgMFEnableVEWikitextEditor' );\n\t}\n\n\t/**\n\t * Checks whether the current page is the main page\n\t *\n\t * @memberof module:mobile.startup/Page\n\t * @return {boolean}\n\t */\n\tisMainPage() {\n\t\treturn this._isMainPage;\n\t}\n\n\t/**\n\t * Checks whether the current page is watched\n\t *\n\t * @memberof module:mobile.startup/Page\n\t * @return {boolean}\n\t */\n\tisWatched() {\n\t\treturn this._isWatched;\n\t}\n\n\t/**\n\t * Return the latest revision id for this page\n\t *\n\t * @memberof module:mobile.startup/Page\n\t * @return {number}\n\t */\n\tgetRevisionId() {\n\t\treturn this.revId;\n\t}\n\n\t/**\n\t * Return prefixed page title\n\t *\n\t * @memberof module:mobile.startup/Page\n\t * @return {string}\n\t */\n\tgetTitle() {\n\t\treturn this.title;\n\t}\n\n\t/**\n\t * return namespace id\n\t *\n\t * @memberof module:mobile.startup/Page\n\t * @return {number} namespace Number\n\t */\n\tgetNamespaceId() {\n\t\tlet nsId;\n\t\tconst args = this.title.split( ':' );\n\n\t\tif ( args[1] ) {\n\t\t\tnsId = mw.config.get( 'wgNamespaceIds' )[ args[0].toLowerCase().replace( ' ', '_' ) ] || 0;\n\t\t} else {\n\t\t\tnsId = 0;\n\t\t}\n\t\treturn nsId;\n\t}\n}\n\nmodule.exports = Page;\n","const\n\tThumbnail = require( './Thumbnail' ),\n\tHEADING_SELECTOR = mw.config.get( 'wgMFMobileFormatterHeadings', [ 'h1', 'h2', 'h3', 'h4', 'h5' ] ).join( ',' ),\n\tEXCLUDE_THUMBNAIL_CLASS_SELECTORS = [ 'noviewer', 'metadata' ],\n\tNOT_SELECTORS = EXCLUDE_THUMBNAIL_CLASS_SELECTORS.map( ( excludeSelector ) => `:not(.${ excludeSelector })` ).join( '' ),\n\tTHUMB_SELECTOR = [ 'a.image', 'a.thumbimage, a.mw-file-description' ].map(\n\t\t( selector ) => `${ selector }${ NOT_SELECTORS }`\n\t).join( ',' );\n\nclass PageHTMLParser {\n\t/**\n\t * @constructor\n\t * @class module:mobile.startup/PageHTMLParser\n * @classdesc Parses an article and converts it into a queriable object.\n\t * @param {jQuery.Object} $container Used when parsing to find children within\n\t * this container\n\t */\n\tconstructor( $container ) {\n\t\tthis.$el = $container;\n\n\t\t// T220751: Cache headings as $el.find is a very expensive call.\n\t\t/** @private */\n\t\tthis.$headings = this.$el.find( HEADING_SELECTOR );\n\t}\n\n\t/**\n\t * Find the heading in the page.\n\t * This has the benefit of excluding any additional h2s and h3s that may\n\t * have been added programatically.\n\t *\n\t * @memberof module:mobile.startup/PageHTMLParser\n\t * @param {number} sectionIndex as defined by the PHP parser.\n\t * It should correspond to the section id\n\t * used in the edit link for the section.\n\t * Note, confusingly, this is different from section \"ID\" which is\n\t * used in methods\n\t * @return {jQuery.Object}\n\t */\n\tfindSectionHeadingByIndex( sectionIndex ) {\n\t\tif ( sectionIndex < 1 ) {\n\t\t\t// negative indexes will search from the end, which is behaviour we do not want.\n\t\t\t// return an empty set when this happens.\n\t\t\t// eslint-disable-next-line no-undef\n\t\t\treturn $( [] );\n\t\t} else {\n\t\t\treturn this.$headings\n\t\t\t\t// Headings must strictly be a child element of a section element\n\t\t\t\t// or the parser-output.\n\t\t\t\t// Not an ancestor!\n\t\t\t\t.filter( '.mw-parser-output > *, [class^=\"mf-section-\"] > *' ).eq( sectionIndex - 1 );\n\t\t}\n\t}\n\n\t/**\n\t * Finds all child elements that match the selector in a given section or subsection.\n\t * Returns any direct child elements that match the selector,\n\t * (i.e. searches only one level deep)\n\t * as well as any elements that match the selector within those children.\n\t * If the Page has no headings (e.g. a stub),\n\t * then the search will target all nodes within the page.\n\t *\n\t * This code should work on desktop (PHP parser HTML)\n\t * as well as mobile formatted HTML (PHP parser + MobileFormatter)\n\t *\n\t * @memberof module:mobile.startup/PageHTMLParser\n\t * @param {number} sectionIndex as defined by the PHP parser. It should correspond to\n\t * the section id used in the edit link for the section.\n\t * Note, confusingly, this is different from section \"ID\" which is\n\t * used in methods\n\t * @param {string} selector to match\n\t * @return {jQuery.Object}\n\t */\n\tfindChildInSectionLead( sectionIndex, selector ) {\n\t\tlet $heading, $nextHeading;\n\n\t\tconst headingSelector = HEADING_SELECTOR;\n\n\t\tfunction withNestedChildren( $matchingNodes ) {\n\t\t\treturn $matchingNodes.find( selector ).addBack();\n\t\t}\n\n\t\tif ( sectionIndex === 0 ) {\n\t\t\t// lead is easy\n\t\t\tconst $lead = this.getLeadSectionElement();\n\t\t\tif ( $lead && $lead.length ) {\n\n\t\t\t\t// Handle nested sections in Parsoid wikitext parset opt-in scenario.\n\t\t\t\tconst $nestedSection = $lead.find( 'section[data-mw-section-id=\"0\"]' );\n\t\t\t\tif ( $nestedSection.length ) {\n\t\t\t\t\treturn withNestedChildren( $nestedSection.children( selector ) );\n\t\t\t\t}\n\n\t\t\t\treturn withNestedChildren( $lead.children( selector ) );\n\t\t\t} else {\n\t\t\t\t$heading = this.findSectionHeadingByIndex( 1 );\n\t\t\t\treturn $heading.length ? withNestedChildren( $heading.prevAll( selector ) ) :\n\t\t\t\t\t// this page is a stub so search entire page\n\t\t\t\t\tthis.$el.find( selector );\n\t\t\t}\n\t\t}\n\n\t\t// find heading associated with the section by looking at its\n\t\t// index position in the article\n\t\t// section ids relate to the element position in the page and the first heading\n\t\t// lead has been dealt with above, so first heading corresponds to section 1,\n\t\t// the first heading in the article.\n\t\t$heading = this.findSectionHeadingByIndex( sectionIndex );\n\n\t\t// If section-heading is present on the heading,\n\t\t// then we know the page has been MobileFormatted\n\t\t// and that this is a wrapped section\n\t\tif ( $heading.hasClass( 'section-heading' ) ) {\n\t\t\t// get content of section\n\t\t\tconst $el = $heading.next();\n\t\t\t// inside section find the first heading\n\t\t\t$nextHeading = $el.find( headingSelector ).eq( 0 );\n\t\t\treturn $nextHeading.length ?\n\t\t\t\t// find all amboxes before the next heading\n\t\t\t\twithNestedChildren( $nextHeading.prevAll( selector ) ) :\n\t\t\t\t// There is no subheadings inside\n\t\t\t\t// Grab all issues in section\n\t\t\t\twithNestedChildren( $el.children( selector ) );\n\t\t} else {\n\t\t\t// the heading relates to a subsection (or unwrapped desktop section),\n\t\t\t// so grab elements between this and the next one\n\t\t\t$nextHeading = $heading.eq( 0 ).nextAll( headingSelector ).eq( 0 );\n\t\t\treturn $heading.nextUntil( $nextHeading, selector );\n\t\t}\n\t}\n\n\t/**\n\t * Get the lead section of the page view.\n\t *\n\t * @memberof module:mobile.startup/PageHTMLParser\n\t * @return {jQuery.Object|null}\n\t */\n\tgetLeadSectionElement() {\n\t\t/*\n\t\t * The page is formatted as follows:\n\t\t * <div id=\"bodyContent\">\n\t\t * <!-- content of the page.. -->\n\t\t * <div id=\"mw-content-text\">\n\t\t * <div class=\"mf-section-0\">lead section</div>\n\t\t * <h2></h2>\n\t\t * <div class=\"mf-section-1\">second section</div>\n\t\t * </div>\n\t\t * </div>\n\t\t */\n\t\tconst $leadSection = this.$el.find( '.mf-section-0' );\n\n\t\tif ( $leadSection.length ) {\n\t\t\treturn $leadSection;\n\t\t}\n\t\t// no lead section found\n\t\treturn null;\n\t}\n\n\t/**\n\t * Returns a Thumbnail object from an anchor element containing an image or\n\t * null if not valid.\n\t *\n\t * @memberof module:mobile.startup/PageHTMLParser\n\t * @param {jQuery} $a Anchor element that contains the image.\n\t * @return {Thumbnail|null}\n\t */\n\tgetThumbnail( $a ) {\n\t\tconst notSelector = '.' + EXCLUDE_THUMBNAIL_CLASS_SELECTORS.join( ',.' ),\n\t\t\t$lazyImage = $a.find( '.lazy-image-placeholder' ),\n\t\t\thref = $a.attr( 'href' ),\n\t\t\turl = href && new URL( href, location.href ),\n\t\t\tlegacyTitle = url && url.searchParams.get( 'title' ),\n\t\t\tmatch = url && url.pathname.match( /[^/]+$/ );\n\n\t\t// Parents need to be checked as well.\n\t\tlet valid = $a.parents( notSelector ).length === 0 &&\n\t\t\t$a.find( notSelector ).length === 0;\n\n\t\t// filter out invalid lazy loaded images if so far image is valid\n\t\tif ( $lazyImage.length && valid ) {\n\t\t\t// if the regex matches it means the image has one of the classes\n\t\t\t// thus we must invert the result\n\t\t\tvalid = !new RegExp( '\\\\b(' + EXCLUDE_THUMBNAIL_CLASS_SELECTORS.join( '|' ) + ')\\\\b' )\n\t\t\t\t.test( $lazyImage.data( 'class' ) );\n\t\t}\n\n\t\tif ( valid && ( legacyTitle !== null || match ) ) {\n\t\t\treturn new Thumbnail( {\n\t\t\t\tel: $a,\n\t\t\t\tfilename: mw.util.percentDecodeFragment(\n\t\t\t\t\tlegacyTitle !== null ? legacyTitle : match[0]\n\t\t\t\t)\n\t\t\t} );\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Return all the thumbnails in the article.\n\t * Images which have a class or link container (.image|.thumbimage)\n\t * that matches one of the items of the constant EXCLUDE_THUMBNAIL_CLASS_SELECTORS\n\t * will be excluded.\n\t * A thumbnail nested inside one of these classes will still be returned.\n\t * e.g. `<div class=\"noviewer\"><a class=\"image\"><img></a></div>` is not a valid thumbnail\n\t * `<a class=\"image noviewer\"><img></a>` is not a valid thumbnail\n\t * `<a class=\"image\"><img class=\"noviewer\"></a>` is not a valid thumbnail\n\t *\n\t * @memberof module:mobile.startup/PageHTMLParser\n\t * @param {jQuery} [$el] Container to search, defaults to this.$el.\n\t * @return {Thumbnail[]}\n\t */\n\tgetThumbnails( $el ) {\n\t\tconst\n\t\t\tself = this,\n\t\t\tthumbs = [];\n\n\t\t$el = $el || this.$el;\n\n\t\tconst $thumbs = $el.find( THUMB_SELECTOR );\n\n\t\t$thumbs.each( function () {\n\t\t\tconst $a = $el.find( this );\n\t\t\tconst thumb = self.getThumbnail( $a );\n\n\t\t\tif ( thumb ) {\n\t\t\t\tthumbs.push( thumb );\n\t\t\t}\n\t\t} );\n\t\treturn thumbs;\n\t}\n\n\t/**\n\t * Returns a jQuery object representing all redlinks on the page.\n\t *\n\t * @memberof module:mobile.startup/PageHTMLParser\n\t * @return {jQuery.Object}\n\t */\n\tgetRedLinks() {\n\t\treturn this.$el.find( '.new' );\n\t}\n\n\t/**\n\t * Returns an object consistent with MediaWiki API representing languages\n\t * associated with the page in the user's current language.\n\t *\n\t * @memberof module:mobile.startup/PageHTMLParser\n\t * @param {string} pageTitle to fallback to if none found\n\t * @return {Object} containing langlinks\n\t * and variant links as defined @ https://en.m.wikipedia.org/w/api.php?action=help&modules=query%2Blanglinks\n\t */\n\tgetLanguages( pageTitle ) {\n\t\tconst mapLinkToLanguageObj = ( node ) => {\n\t\t\tconst DELIMITER = ' – ';\n\t\t\t// Name of language (e.g. עברית for Hebrew)\n\t\t\tconst autonym = node.textContent;\n\t\t\t// The name of the language in the current language\n\t\t\t// e.g. for english this would be Hebrew\n\t\t\tlet langname;\n\t\t\tlet title = node.getAttribute( 'title' ) || pageTitle;\n\t\t\tif ( title.indexOf( DELIMITER ) > -1 ) {\n\t\t\t\ttitle = title.split( DELIMITER );\n\t\t\t\tlangname = title.pop();\n\t\t\t\ttitle = title.join( DELIMITER );\n\t\t\t}\n\t\t\tif ( !langname ) {\n\t\t\t\tlangname = autonym;\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tlang: node.getAttribute( 'hreflang' ),\n\t\t\t\tautonym,\n\t\t\t\tlangname,\n\t\t\t\ttitle,\n\t\t\t\turl: node.getAttribute( 'href' )\n\t\t\t};\n\t\t};\n\t\treturn {\n\t\t\tlanguages: Array.prototype.map.call(\n\t\t\t\tdocument.querySelectorAll( '#p-lang .interlanguage-link a' ),\n\t\t\t\tmapLinkToLanguageObj\n\t\t\t),\n\t\t\tvariants: Array.prototype.map.call(\n\t\t\t\tdocument.querySelectorAll( '#p-variants li a' ),\n\t\t\t\tmapLinkToLanguageObj\n\t\t\t)\n\t\t};\n\t}\n}\n\n/**\n * Selector for matching headings\n *\n * @memberof PageHTMLParser\n */\nPageHTMLParser.HEADING_SELECTOR = HEADING_SELECTOR;\n\n/**\n * Selector for thumbnails.\n *\n * @memberof PageHTMLParser\n */\nPageHTMLParser.THUMB_SELECTOR = THUMB_SELECTOR;\n\nmodule.exports = PageHTMLParser;\n","const util = require( './util.js' ),\n\tmfExtend = require( './mfExtend' ),\n\tView = require( './View' ),\n\tbrowser = require( './Browser' ).getSingleton();\n\n/**\n * List of items page view\n *\n * @class PageList\n * @extends module:mobile.startup/View\n */\nfunction PageList() {\n\tView.apply( this, arguments );\n}\n\nmfExtend( PageList, View, {\n\t/**\n\t * @memberof PageList\n\t * @instance\n\t * @mixes module:mobile.startup/View#defaults\n\t * @property {Object} defaults Default options hash.\n\t * @property {Page[]} defaults.pages Array of Page objects. These should match\n\t * the Page model and not necessarily the\n\t * underlying API format used.\n\t * E.g. [\n\t * {\n\t * heading: \"<strong>C</strong>laude Monet\",\n\t * id: undefined,\n\t * title: \"Claude Monet\",\n\t * displayTitle: \"<i>Claude Monet</i>\",\n\t * url: \"/wiki/Claude_Monet\",\n\t * thumbnail: {\n\t * height: 62,\n\t * source: \"http://127.0.0.1:8080/images/thumb/thumb.jpg\",\n\t * width: 80,\n\t * isLandscape: true\n\t * }\n\t * }\n\t * ]\n\t */\n\tdefaults: {\n\t\tpages: []\n\t},\n\t/**\n\t * Render page images for the existing page list. Assumes no page images have been loaded.\n\t *\n\t * @memberof PageList\n\t * @instance\n\t */\n\trenderPageImages() {\n\t\tconst self = this;\n\n\t\tsetTimeout( () => {\n\t\t\tself.$el.find( '.list-thumb' ).each( function () {\n\t\t\t\tconst style = self.$el.find( this ).data( 'style' );\n\t\t\t\tself.$el.find( this ).attr( 'style', style );\n\t\t\t} );\n\t\t\t// Delay an unnecessary load of images on mobile (slower?) connections\n\t\t\t// In particular on search results which can be regenerated quickly.\n\t\t}, browser.isWideScreen() ? 0 : 1000 );\n\t},\n\t/**\n\t * @inheritdoc\n\t * @memberof PageList\n\t * @instance\n\t */\n\tpostRender() {\n\t\tthis.renderPageImages();\n\t},\n\ttemplate: util.template( `\n<ul class=\"mw-mf-page-list thumbs actionable\">\n\t{{#pages}}\n\t\t{{>item}}\n\t{{/pages}}\n</ul>\n\t` ),\n\t/**\n\t * @memberof PageList\n\t * @instance\n\t */\n\ttemplatePartials: {\n\t\t// The server uses a very different structure in\n\t\t// SpecialMobileEditWatchlist.getLineHtml(). Be aware of these differences\n\t\t// when updating server rendered items.\n\t\titem: util.template( `\n<li title=\"{{title}}\" data-id=\"{{id}}\" class=\"page-summary\">\n <a href=\"{{url}}\" class=\"title {{#isMissing}}new{{/isMissing}}\"\n {{#anchor}}name=\"{{anchor}}\"{{/anchor}}\n {{#latitude}}data-latlng=\"{{latitude}},{{longitude}}\"{{/latitude}}\n data-title=\"{{title}}\">\n <div class=\"list-thumb\n {{#thumbnail.isLandscape}}list-thumb-y{{/thumbnail.isLandscape}}\n {{^thumbnail.isLandscape}}list-thumb-x{{/thumbnail.isLandscape}}\"\n {{#thumbnail}}data-style=\"background-image: url( {{thumbnail.source}} )\"{{/thumbnail}}>\n {{^thumbnail}}<span class=\"mf-icon-image\"></span>{{/thumbnail}}\n\t</div>\n <h3>{{{displayTitle}}}</h3>\n {{#wikidataDescription}}\n <div class=\"wikidata-description\">{{wikidataDescription}}</div>\n {{/wikidataDescription}}\n {{#proximity}}\n <div class=\"info proximity\">{{proximity}}</div>\n {{/proximity}}\n </a>\n</li>\n\t` )\n\t}\n} );\n\nmodule.exports = PageList;\n","const browser = require( './Browser' ).getSingleton(),\n\tView = require( './View' ),\n\tutil = require( './util' ),\n\tcurrentPage = require( './currentPage' ),\n\teventBus = require( './eventBusSingleton' ),\n\tmfExtend = require( './mfExtend' );\n\nlet skin;\n\n/**\n * Representation of the current skin being rendered.\n *\n * @class Skin\n * @extends module:mobile.startup/View\n * @uses Browser\n * @uses Page\n * @fires Skin#click\n * @param {Object} params Configuration options\n * @param {OO.EventEmitter} params.eventBus Object used to listen for\n * @param {Page} params.page\n * scroll:throttled, resize:throttled, and section-toggled events\n */\nfunction Skin( params ) {\n\tconst options = util.extend( {}, params );\n\n\tthis.page = options.page;\n\tthis.name = options.name;\n\tthis.eventBus = options.eventBus;\n\toptions.isBorderBox = false;\n\tView.call( this, options );\n}\n\nmfExtend( Skin, View, {\n\t/**\n\t * @memberof Skin\n\t * @instance\n\t * @mixes module:mobile.startup/View#defaults\n\t * @property {Object} defaults Default options hash.\n\t * @property {Page} defaults.page page the skin is currently rendering\n\t */\n\tdefaults: {\n\t\tpage: undefined\n\t},\n\n\t/**\n\t * @inheritdoc\n\t * @memberof Skin\n\t * @instance\n\t */\n\tpostRender() {\n\t\tconst $el = this.$el;\n\n\t\tif ( browser.supportsTouchEvents() ) {\n\t\t\t$el.addClass( 'touch-events' );\n\t\t}\n\n\t\t/**\n\t\t * Fired when the skin is clicked.\n\t\t *\n\t\t * @event Skin#click\n\t\t */\n\t\tthis.$el.find( '#mw-mf-page-center' ).on( 'click', ( ev ) => {\n\t\t\tthis.emit( 'click', ev );\n\t\t} );\n\t},\n\n\t/**\n\t * @memberof Skin\n\t * @throws {Error} if mediawiki message is in unexpected format.\n\t * @return {jQuery.Object} a list of links\n\t */\n\tgetLicenseLinks() {\n\t\tconst mobileLicense = mw.message( 'mobile-frontend-license-links' );\n\t\tconst mobileMsgExists = mobileLicense.exists() && mobileLicense.text();\n\t\tconst userLanguage = mw.config.get( 'wgUserLanguage' );\n\t\tif ( userLanguage === 'qqx' ) {\n\t\t\t// Special handling for qqx code so we can easily debug what's going on here.\n\t\t\treturn mobileLicense.parseDom();\n\t\t} else {\n\t\t\treturn mobileMsgExists ? mobileLicense.parseDom() : this.$el.find( '#footer-info-copyright a' ).clone();\n\t\t}\n\t},\n\t/**\n\t * Returns the appropriate license message including links/name to\n\t * terms of use (if any) and license page\n\t *\n\t * @memberof Skin\n\t * @instance\n\t * @return {string|undefined}\n\t */\n\tgetLicenseMsg() {\n\t\tconst $licenseLinks = this.getLicenseLinks();\n\n\t\tlet licenseMsg;\n\t\tif ( $licenseLinks.length ) {\n\t\t\tconst licensePlural = mw.language.convertNumber(\n\t\t\t\t$licenseLinks.filter( 'a' ).length\n\t\t\t);\n\n\t\t\tif ( this.$el.find( '#footer-places-terms-use' ).length > 0 ) {\n\n\t\t\t\tconst $termsLink = mw.message(\n\t\t\t\t\t'mobile-frontend-editor-terms-link',\n\t\t\t\t\tthis.$el.find( '#footer-places-terms-use a' ).attr( 'href' )\n\t\t\t\t).parseDom();\n\t\t\t\tlicenseMsg = mw.message(\n\t\t\t\t\t'mobile-frontend-editor-licensing-with-terms',\n\t\t\t\t\t$termsLink,\n\t\t\t\t\t$licenseLinks,\n\t\t\t\t\tlicensePlural\n\t\t\t\t).parse();\n\t\t\t} else {\n\t\t\t\tlicenseMsg = mw.message(\n\t\t\t\t\t'mobile-frontend-editor-licensing',\n\t\t\t\t\t$licenseLinks,\n\t\t\t\t\tlicensePlural\n\t\t\t\t).parse();\n\t\t\t}\n\t\t}\n\n\t\treturn licenseMsg;\n\t}\n} );\n\n/**\n * Get a skin singleton\n *\n * @return {Skin}\n */\nSkin.getSingleton = function () {\n\tif ( !skin ) {\n\t\tskin = new Skin( {\n\t\t\tel: 'body',\n\t\t\tpage: currentPage(),\n\t\t\teventBus\n\t\t} );\n\t}\n\treturn skin;\n};\nmodule.exports = Skin;\n","const\n\tmfExtend = require( './mfExtend' ),\n\tutil = require( './util' ),\n\tView = require( './View' );\n\n/**\n * Representation of a thumbnail\n *\n * @class Thumbnail\n * @extends module:mobile.startup/View\n * @param {Object} options\n */\nfunction Thumbnail( options ) {\n\tView.call( this,\n\t\tutil.extend( { isBorderBox: false }, options )\n\t);\n}\n\nmfExtend( Thumbnail, View, {\n\t/**\n\t * @memberof Thumbnail\n\t * @instance\n\t * @mixes module:mobile.startup/View#defaults\n\t * @property {Object} defaults Default options hash.\n\t * @property {string} defaults.filename uri decoded filename including File: prefix\n\t * associated with thumbnail\n\t */\n\tdefaults: {\n\t\tfilename: undefined\n\t},\n\t/**\n\t * @inheritdoc\n\t * @memberof Thumbnail\n\t * @instance\n\t */\n\tpostRender() {\n\t\tthis.options.description = this.$el.siblings( '.thumbcaption, figcaption' )\n\t\t\t.prop( 'innerText' ) || '';\n\t},\n\t/**\n\t * Obtain description for thumbnail\n\t *\n\t * @memberof Thumbnail\n\t * @instance\n\t * @return {string}\n\t */\n\tgetDescription() {\n\t\treturn this.options.description;\n\t},\n\t/**\n\t * Return the page title for the thumbnail\n\t *\n\t * @memberof Thumbnail\n\t * @instance\n\t * @return {string}\n\t */\n\tgetFileName() {\n\t\treturn this.options.filename;\n\t}\n} );\n\nmodule.exports = Thumbnail;\n","/* global $ */\nconst util = require( './util' ),\n\tmfExtend = require( './mfExtend' ),\n\t// Cached regex to split keys for `delegate`.\n\tdelegateEventSplitter = /^(\\S+)\\s*(.*)$/;\n\nlet idCounter = 0;\n\n/**\n * Generate a unique integer id (unique within the entire client session).\n * Useful for temporary DOM ids.\n *\n * @private\n * @param {string} prefix Prefix to be used when generating the id.\n * @return {string}\n */\nfunction uniqueId( prefix ) {\n\tconst id = ( ++idCounter ).toString();\n\treturn prefix ? prefix + id : id;\n}\n\n/**\n * Should be extended using extend().\n *\n * When options contains el property, this.$el in the constructed object\n * will be set to the corresponding jQuery object. Otherwise, this.$el\n * will be an empty div.\n *\n * When extended using extend(), if the extended prototype contains\n * template property, this.$el will be filled with rendered template (with\n * options parameter used as template data).\n *\n * template property can be a string which will be passed to mw.template.compile()\n * or an object that has a render() function which accepts an object with\n * template data as its argument (similarly to an object created by\n * mw.template.compile()).\n *\n * You can also define a defaults property which should be an object\n * containing default values for the template (if they're not present in\n * the options parameter).\n *\n * If this.$el is not a jQuery object bound to existing DOM element, the\n * view can be attached to an element using appendTo(), prependTo(),\n * insertBefore(), insertAfter() proxy functions.\n *\n * append(), prepend(), before(), after() can be used to modify $el. on()\n * can be used to bind events.\n *\n * You can also use declarative DOM events binding by specifying an `events`\n * map on the class. The keys will be 'event selector' and the value can be\n * either the name of a method to call, or a function. All methods and\n * functions will be executed on the context of the View.\n *\n * Inspired from Backbone.js\n * https://github.com/jashkenas/backbone/blob/master/backbone.js#L1128\n *\n * Example:\n * ```js\n * var\n * MyComponent = View.extend( {\n * edit: function ( ev ) {\n * //...\n * },\n * save: function ( ev ) {\n * //...\n * }\n * } ),\n * instance = new MyComponent({\n * events: {\n * 'mousedown .title': 'edit',\n * 'click .button': 'save',\n * 'click .open': function(e) { ... }\n * }\n * });\n * ```\n *\n * Example:\n * ```js\n * var View, section;\n * function Section( options ) {\n * var defaultOptions = {\n * events: {\n * // ...\n * }\n * }\n * View.call( this, util.extends( {}, defaultOptions, options ) );\n * }\n * View = require( './View' );\n * require( './mfExtend' )( Section, View, {\n * template: mw.template.compile( \"&lt;h2&gt;{{title}}&lt;/h2&gt;\" ),\n * } );\n * section = new Section( { title: 'Test', text: 'Test section body' } );\n * section.appendTo( 'body' );\n * ```\n *\n * @class module:mobile.startup/View\n * @memberof module:mobile.startup/View\n * @classdesc Describes a component for rendering.\n * @mixes OO.EventEmitter\n */\n\nfunction View() {\n\tthis.initialize.apply( this, arguments );\n}\nOO.mixinClass( View, OO.EventEmitter );\nmfExtend( View, {\n\t/**\n\t * Name of tag that contains the rendered template\n\t *\n\t * @memberof module:mobile.startup/View\n\t * @instance\n\t * @property {string} tagName\n\t */\n\ttagName: 'div',\n\t/**\n\t * Tells the View to ignore tagName and className when constructing the element\n\t * and to rely solely on the template\n\t *\n\t * @memberof module:mobile.startup/View\n\t * @instance\n\t * @property {boolean} isTemplateMode\n\t */\n\tisTemplateMode: false,\n\t/**\n\t * @memberof module:mobile.startup/View\n\t * @instance\n\t * @property {any}\n\t * Specifies the template used in render(). Object|string\n\t */\n\ttemplate: undefined,\n\n\t/**\n\t * Specifies partials (sub-templates) for the main template. Example:\n\t *\n\t * @example\n\t * // example content for the \"some\" template (sub-template will be\n\t * // inserted where {{>content}} is):\n\t * // <h1>Heading</h1>\n\t * // {{>content}}\n\t *\n\t * oo.mfExtend( SomeView, View, {\n\t * template: util.template( '<source-code>' ),\n\t * templatePartials: { content: util.template( '<source-code>' ) }\n\t * }\n\t *\n\t * @memberof module:mobile.startup/View\n\t * @instance\n\t * @property {Object}\n\t */\n\ttemplatePartials: {},\n\n\t/**\n\t * A set of default options that are merged with options passed into the initialize\n\t * function.\n\t *\n\t * @memberof module:mobile.startup/View\n\t * @instance\n\t * @property {Object} defaults Default options hash.\n\t * @property {jQuery.Object|string} [defaults.el] jQuery selector to use for rendering.\n\t * @property {boolean} [defaults.skipTemplateRender] Whether to enhance views already in\n\t * DOM. When enabled, the template is disabled so that it is not rendered in the DOM.\n\t * Use in conjunction with View::defaults.$el to associate the View with an existing\n\t * already rendered element in the DOM.\n\t */\n\tdefaults: {},\n\n\t/**\n\t * Run once during construction to set up the View\n\t *\n\t * @memberof module:mobile.startup/View\n\t * @instance\n\t * @param {Object} options Object passed to the constructor.\n\t * @param {Object.<string, string>} [options.events]\n\t */\n\tinitialize( options ) {\n\t\tconst self = this;\n\n\t\tOO.EventEmitter.call( this );\n\t\toptions = util.extend( {}, this.defaults, options );\n\t\tthis.options = options;\n\t\t// Assign a unique id for dom events binding/unbinding\n\t\tthis.cid = uniqueId( 'view' );\n\n\t\t// TODO: if template compilation is too slow, don't compile them on a\n\t\t// per object basis, but don't worry about it now (maybe add cache to\n\t\t// M.template.compile())\n\t\tif ( typeof this.template === 'string' ) {\n\t\t\tthis.template = mw.template.compile( this.template );\n\t\t}\n\n\t\tif ( options.el ) {\n\t\t\t// Note the element may not be in the document so must use global jQuery here\n\t\t\tthis.$el = $( options.el );\n\t\t} else {\n\t\t\tthis.$el = this.parseHTML( '<' + this.tagName + '>' );\n\t\t}\n\n\t\t// Make sure the element is ready to be manipulated\n\t\tif ( this.$el.length ) {\n\t\t\tthis._postInitialize( options );\n\t\t} else {\n\t\t\tutil.docReady( () => {\n\t\t\t\t// Note the element may not be in the document so must use global jQuery here\n\t\t\t\tself.$el = $( options.el );\n\t\t\t\tself._postInitialize( options );\n\t\t\t} );\n\t\t}\n\t},\n\n\t/**\n\t * Called when this.$el is ready.\n\t *\n\t * @memberof module:mobile.startup/View\n\t * @instance\n\t * @private\n\t * @param {Object} props\n\t */\n\t_postInitialize( props ) {\n\t\t// eslint-disable-next-line mediawiki/class-doc\n\t\tthis.$el.addClass( props.className );\n\t\t// border-box will be added provided this flag is not set\n\t\tif ( props.isBorderBox !== false ) {\n\t\t\tthis.$el.addClass( 'view-border-box' );\n\t\t}\n\n\t\tthis.render( {} );\n\t},\n\n\t/**\n\t * Function called before the view is rendered. Can be redefined in\n\t * objects that extend View.\n\t *\n\t * @memberof module:mobile.startup/View\n\t * @instance\n\t */\n\tpreRender() {\n\t},\n\n\t/**\n\t * Function called after the view is rendered. Can be redefined in\n\t * objects that extend View.\n\t *\n\t * @memberof module:mobile.startup/View\n\t * @instance\n\t */\n\tpostRender() {\n\t},\n\n\t/**\n\t * Fill this.$el with template rendered using data if template is set.\n\t *\n\t * @memberof module:mobile.startup/View\n\t * @instance\n\t * @param {Object} data Template data. Will be merged into the view's\n\t * options\n\t * @chainable\n\t */\n\trender( data ) {\n\t\tlet $el, html;\n\t\tutil.extend( this.options, data );\n\t\tthis.preRender();\n\t\tthis.undelegateEvents();\n\t\tif ( this.template && !this.options.skipTemplateRender ) {\n\t\t\thtml = this.template.render( this.options, this.templatePartials );\n\t\t\tif ( this.isTemplateMode ) {\n\t\t\t\t$el = $( html );\n\t\t\t\tthis.$el.replaceWith( $el );\n\t\t\t\tthis.$el = $el;\n\t\t\t} else {\n\t\t\t\tthis.$el.html( html );\n\t\t\t}\n\t\t}\n\t\tthis.postRender();\n\t\tthis.delegateEvents();\n\t\treturn this;\n\t},\n\n\t/**\n\t * Set callbacks for events.\n\t *\n\t * `this.options.events` is a hash of pairs:\n\t *\n\t * ```\n\t * { 'event selector': 'callback' }\n\t *\n\t * {\n\t * 'mousedown .title': 'edit',\n\t * 'click .button': 'save',\n\t * 'click .open': function(e) { ... }\n\t * }\n\t * ```\n\t *\n\t * Callbacks will be bound to the view, with `this` set properly.\n\t * Uses event delegation for efficiency.\n\t * Omitting the selector binds the event to `this.el`.\n\t *\n\t * @memberof module:mobile.startup/View\n\t * @instance\n\t * @param {Object} events Optionally set this events instead of the ones on this.\n\t */\n\tdelegateEvents( events ) {\n\t\tlet match, key, method;\n\t\tevents = events || this.options.events;\n\t\tif ( events ) {\n\t\t\t// Remove current events before re-binding them\n\t\t\tthis.undelegateEvents();\n\t\t\tfor ( key in events ) {\n\t\t\t\tmethod = events[key];\n\t\t\t\t// If the method is a string name of this.method, get it\n\t\t\t\tif ( typeof method !== 'function' ) {\n\t\t\t\t\tmethod = this[events[key]];\n\t\t\t\t}\n\t\t\t\tif ( method ) {\n\t\t\t\t\t// Extract event and selector from the key\n\t\t\t\t\tmatch = key.match( delegateEventSplitter );\n\t\t\t\t\tthis.delegate( match[1], match[2], method.bind( this ) );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\n\t/**\n\t * Add a single event listener to the view's element (or a child element\n\t * using `selector`). This only works for delegate-able events: not `focus`\n\t * or `blur`.\n\t *\n\t * @memberof module:mobile.startup/View\n\t * @instance\n\t * @param {string} eventName\n\t * @param {string} selector\n\t * @param {Function} listener\n\t */\n\tdelegate( eventName, selector, listener ) {\n\t\tthis.$el.on( eventName + '.delegateEvents' + this.cid, selector,\n\t\t\tlistener );\n\t},\n\n\t/**\n\t * Clears all callbacks previously bound to the view by `delegateEvents`.\n\t * You usually don't need to use this, but may wish to if you have multiple\n\t * views attached to the same DOM element.\n\t *\n\t * @memberof module:mobile.startup/View\n\t * @instance\n\t */\n\tundelegateEvents() {\n\t\tif ( this.$el ) {\n\t\t\tthis.$el.off( '.delegateEvents' + this.cid );\n\t\t}\n\t},\n\n\t/**\n\t * A finer-grained `undelegateEvents` for removing a single delegated event.\n\t * `selector` and `listener` are both optional.\n\t *\n\t * @memberof module:mobile.startup/View\n\t * @instance\n\t * @param {string} eventName\n\t * @param {string} selector\n\t * @param {Function} listener\n\t */\n\tundelegate( eventName, selector, listener ) {\n\t\tthis.$el.off( eventName + '.delegateEvents' + this.cid, selector,\n\t\t\tlistener );\n\t},\n\n\t/**\n\t * See parseHTML method of util singleton\n\t *\n\t * @memberof module:mobile.startup/View\n\t * @instance\n\t * @param {string} html to turn into a jQuery object.\n\t * @return {jQuery.Object}\n\t */\n\tparseHTML( html ) {\n\t\t// document is explicitly passed due to a bug we found in Safari 11.1.2 where failure\n\t\t// to use document resulted in an element without access to the documentElement\n\t\t// this should be redundant, but no problem in being explicit (T214451).\n\t\treturn util.parseHTML( html, document );\n\t}\n} );\n\n/**\n * @memberof View\n * @instance\n * @function append\n * @param {...(string|Node|Node[]|jQuery)} contents\n * @return {View}\n */\n\n/**\n * @memberof View\n * @instance\n * @function append\n * @param {function(number, string): string|Node|Node[]|jQuery} contents\n * @return {View}\n */\n\n/**\n * @memberof View\n * @instance\n * @function prepend\n * @param {...(string|Node|Node[]|jQuery)} contents\n * @return {View}\n */\n\n/**\n * @memberof View\n * @instance\n * @function prepend\n * @param {function(number, string): string|Node|Node[]|jQuery} contents\n * @return {View}\n */\n\n/**\n * @memberof View\n * @instance\n * @function appendTo\n * @param {string|Node|Node[]|jQuery} target\n * @return {View}\n */\n\n/**\n * @memberof View\n * @instance\n * @function prependTo\n * @param {string|Node|Node[]|jQuery} target\n * @return {View}\n */\n\n/**\n * @memberof View\n * @instance\n * @function after\n * @param {...(string|Node|Node[]|jQuery)} contents\n * @return {View}\n */\n\n/**\n * @memberof View\n * @instance\n * @function after\n * @param {function(number, string): string|Node|Node[]|jQuery} contents\n * @return {View}\n */\n\n/**\n * @memberof View\n * @instance\n * @functiontion before\n * @param {...(string|Node|Node[]|jQuery)} contents\n * @return {View}\n */\n\n/**\n * @memberof View\n * @instance\n * @function before\n * @param {function(number, string): string|Node|Node[]|jQuery} contents\n * @return {View}\n */\n\n/**\n * @memberof View\n * @instance\n * @property {jQuery.Object} $el\n */\n\n/**\n * @memberof View\n * @instance\n * @function insertAfter\n * @param {string|Node|Node[]|jQuery} target\n * @return {View}\n */\n\n/**\n * @memberof View\n * @instance\n * @function insertBefore\n * @param {string|Node|Node[]|jQuery} target\n * @return {View}\n */\n\n/**\n * @memberof View\n * @instance\n * @function remove\n * @param {string} [selector]\n * @return {View}\n */\n\n/**\n * @memberof View\n * @instance\n * @function detach\n * @param {string} [selector]\n * @return {View}\n */\n\n[\n\t'append',\n\t'prepend',\n\t'appendTo',\n\t'prependTo',\n\t'after',\n\t'before',\n\t'insertAfter',\n\t'insertBefore',\n\t'remove',\n\t'detach'\n].forEach( ( prop ) => {\n\tView.prototype[prop] = function () {\n\t\tthis.$el[prop].apply( this.$el, arguments );\n\t\treturn this;\n\t};\n} );\n\n/**\n * Generates a view with children\n *\n * @param {Object} options\n * @param {jQuery.Element[]} children\n * @return {module:mobile.startup/View}\n */\nView.make = function ( options = {}, children = [] ) {\n\tconst view = new View( options );\n\tchildren.forEach( ( $child ) => view.append( $child ) );\n\treturn view;\n};\n\nmodule.exports = View;\n","const util = require( './util' ),\n\tdefaultParams = {\n\t\taction: 'query',\n\t\tformatversion: 2\n\t};\n\n/**\n * Extends the default params for an action query with otherParams\n *\n * @ignore\n * @param {Object} otherParams\n * @return {Object}\n */\nmodule.exports = function actionParams( otherParams ) {\n\tconst scriptPath = mw.config.get( 'wgMFScriptPath' );\n\treturn util.extend( {}, defaultParams, {\n\t\torigin: scriptPath ? '*' : undefined\n\t}, otherParams );\n};\n","const\n\tButton = require( '../Button' ),\n\tutil = require( '../util' ),\n\tView = require( '../View' );\n\n/**\n * @typedef {Object} FormField\n * @private\n * @property {string} name\n * @property {string} value\n */\n\n/**\n * A form for enabling the advanced mobile editor mode.\n *\n * @param {Object} options\n * @param {string} options.postUrl Form will POST to this endpoint\n * @param {FormField[]} options.fields An array of hidden form fields\n * @param {string} options.buttonLabel Label for submit button\n * submitted\n * @extends module:mobile.startup/View\n * @ignore\n */\nclass AmcEnableForm extends View {\n\t/** @inheritdoc */\n\tget isTemplateMode() {\n\t\treturn true;\n\t}\n\n\t/** @inheritdoc */\n\tget template() {\n\t\treturn util.template( `\n<form class=\"amc-enable-form\" action=\"{{postUrl}}\" method=\"POST\">\n\t{{#fields}}\n\t\t<input type=\"hidden\" name=\"{{name}}\" value=\"{{value}}\">\n\t{{/fields}}\n</form>\n\t\t` );\n\t}\n\n\t/** @inheritdoc */\n\tpostRender() {\n\t\tthis.$el.append(\n\t\t\tnew Button( {\n\t\t\t\ttagName: 'button',\n\t\t\t\tprogressive: true,\n\t\t\t\tlabel: this.options.buttonLabel\n\t\t\t} ).$el\n\t\t);\n\t}\n}\n\nmodule.exports = AmcEnableForm;\n","/**\n * Describes a promotional campaign for advanced mobile contributions.\n *\n * @typedef {Object} module:mobile.startup/AmcOutreach~PromoCampaign\n * @property {Function} showIfEligible\n * @property {Function} makeActionIneligible\n * @property {Function} makeAllActionsIneligible\n * @property {Function} isCampaignActive\n */\n\nconst\n\ttoast = require( '../showOnPageReload' ),\n\tcreatePromoCampaign = require( '../promoCampaign/promoCampaign' ),\n\tamcOutreachDrawer = require( './amcOutreachDrawer' ),\n\t// MW constants should be kept in sync with onMakeGlobalVariableScript() from\n\t// MobileFrontendHooks.php\n\tMW_CONFIG_CAMPAIGN_ACTIVE_NAME = 'wgMFAmcOutreachActive',\n\tMW_CONFIG_USER_ELIGIBLE_NAME = 'wgMFAmcOutreachUserEligible',\n\t// This object contains arbitrary actions that are meant to only be shown one\n\t// time at most. Each action is either 'eligible' or 'ineligible' at any given\n\t// time.\n\t//\n\t// When a new action is desired, it should be added to this object.\n\t//\n\t// In other languages, this would be an enum. However, because JS doesn't\n\t// support enums, the keys/value names are identical in an attempt to mimic\n\t// some of their functionality. The names in this object are used by\n\t// promoCampaign to mark when an action has become 'ineligible'.\n\tACTIONS = {\n\t\tonDesktopLink: 'onDesktopLink',\n\t\tonHistoryLink: 'onHistoryLink',\n\t\tonTalkLink: 'onTalkLink'\n\t},\n\tCAMPAIGN_NAME = 'amc-outreach';\n\n// singleton;\nlet campaign;\n\n/**\n * Internal for use inside Minerva only. See {@link module:mobile.startup} for access.\n *\n * @exports mobile.startup/AmcOutreach\n */\nmodule.exports = {\n\t/**\n\t * Loads a promotion campaign for advanced mobile contributions if the user is eligible.\n\t *\n\t * @return {module:mobile.startup/AmcOutreach~PromoCampaign}\n\t */\n\tloadCampaign: () => {\n\t\tif ( campaign ) {\n\t\t\treturn campaign;\n\t\t}\n\n\t\tcampaign = createPromoCampaign(\n\t\t\t/**\n\t\t\t * This callback is executed by promoCampaign's `showIfEligible` method.\n\t\t\t * promoCampaign will only execute it when an action is 'eligible'.\n\t\t\t *\n\t\t\t * @param {string} action Name of one of the actions in the ACTIONS\n\t\t\t * object. This is used by the drawer to notify promoCampaign when the\n\t\t\t * action has become 'ineligible' (e.g. after enabling or dismissing the\n\t\t\t * drawer).\n\t\t\t * @param {onBeforeHide} onBeforeHide Callback exected after user\n\t\t\t * dismisses drawer.\n\t\t\t * @param {string} returnToTitle Title of page to redirect to after user enables\n\t\t\t * AMC\n\t\t\t * @param {string} [returnToQuery] Optional query params to add to redirected\n\t\t\t * URL after user enables AMC. Can also include anchor (e.g.\n\t\t\t * `foo=bar#/Talk`\n\t\t\t * @return {module:mobile.startup/Drawer|null}\n\t\t\t */\n\t\t\t( action, onBeforeHide, returnToTitle, returnToQuery ) => {\n\t\t\t\treturn amcOutreachDrawer(\n\t\t\t\t\taction,\n\t\t\t\t\tcampaign,\n\t\t\t\t\tmw.message,\n\t\t\t\t\tmw.util,\n\t\t\t\t\ttoast,\n\t\t\t\t\tmw.user.tokens.get( 'csrfToken' ),\n\t\t\t\t\tonBeforeHide,\n\t\t\t\t\treturnToTitle,\n\t\t\t\t\treturnToQuery\n\t\t\t\t);\n\t\t\t},\n\t\t\tACTIONS,\n\t\t\tCAMPAIGN_NAME,\n\t\t\t// in minerva desktop, this config will not be set\n\t\t\t!!mw.config.get( MW_CONFIG_CAMPAIGN_ACTIVE_NAME ),\n\t\t\t!!mw.config.get( MW_CONFIG_USER_ELIGIBLE_NAME ),\n\t\t\tmw.storage\n\t\t);\n\n\t\treturn campaign;\n\t},\n\t/**\n\t * @private\n\t */\n\tACTIONS\n};\n","const\n\tDrawer = require( '../Drawer' ),\n\tAnchor = require( '../Anchor' ),\n\tutil = require( '../util' ),\n\tAmcEnableForm = require( './AmcEnableForm' ),\n\t// These constants should be kept in sync with SpecialMobileOptions.php\n\tAMC_ENABLE_FIELD_NAME = 'enableAMC',\n\tAMC_ENABLE_FIELD_VALUE = '1';\n\n/**\n * Callback intended to allow the client run extra logic (e.g. show a modal)\n * after the drawer is dismissed.\n *\n * @callback module:mobile.startup~onBeforeHide\n */\n\n/**\n * @ignore\n * @memberof module:mobile.startup\n * @param {string} action Used by the drawer to notify promoCampaign when the\n * action has become 'ineligible' (e.g. after enabling or dismissing the drawer).\n * @param {module:mobile.startup/AmcOutreach~PromoCampaign} promoCampaign\n * @param {mw.message} mwMessage Used for i18n\n * @param {mw.util} mwUtil Used to determine POST url for the enable form\n * @param {Toast} toast Displays success message after user submits enable form\n * @param {string} csrfToken\n * @param {onBeforeHide} onBeforeHide\n * @param {string} returnToTitle Title to redirect to after user enables\n * AMC\n * @param {string} [returnToQuery] Optional query params to add to redirected\n * URL after user enables AMC\n * @return {module:mobile.startup/Drawer} Returns the drawer that is shown\n */\nmodule.exports = function amcOutreachDrawer(\n\taction,\n\tpromoCampaign,\n\tmwMessage,\n\tmwUtil,\n\ttoast,\n\tcsrfToken,\n\tonBeforeHide,\n\treturnToTitle,\n\treturnToQuery\n) {\n\treturn new Drawer( {\n\t\tclassName: 'amc-outreach-drawer',\n\t\tchildren: [\n\t\t\tutil.parseHTML( '<div>' ).addClass( 'amc-outreach-image' ),\n\t\t\tutil.parseHTML( '<p>' ).append(\n\t\t\t\tutil.parseHTML( '<strong>' ).text(\n\t\t\t\t\tmwMessage( 'mobile-frontend-amc-outreach-intro' ).text()\n\t\t\t\t)\n\t\t\t),\n\t\t\tutil.parseHTML( '<p>' ).text(\n\t\t\t\tmwMessage( 'mobile-frontend-amc-outreach-description' ).text()\n\t\t\t),\n\t\t\tnew AmcEnableForm( {\n\t\t\t\tpostUrl: mwUtil.getUrl( 'Special:MobileOptions', {\n\t\t\t\t\treturnto: returnToTitle,\n\t\t\t\t\treturntoquery: returnToQuery || ''\n\t\t\t\t} ),\n\t\t\t\tfields: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'updateSingleOption',\n\t\t\t\t\t\tvalue: AMC_ENABLE_FIELD_NAME\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'enableAMC',\n\t\t\t\t\t\tvalue: AMC_ENABLE_FIELD_VALUE\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'token',\n\t\t\t\t\t\tvalue: csrfToken\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\tbuttonLabel: mwMessage( 'mobile-frontend-amc-outreach-enable' ).text(),\n\t\t\t\tevents: {\n\t\t\t\t\tsubmit: () => {\n\t\t\t\t\t\tpromoCampaign.makeActionIneligible( action );\n\t\t\t\t\t\ttoast.showOnPageReload( mwMessage( 'mobile-frontend-amc-outreach-enabled-message' ).text() );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} ).$el,\n\t\t\tnew Anchor( {\n\t\t\t\thref: '#',\n\t\t\t\tadditionalClassNames: 'cancel',\n\t\t\t\tprogressive: true,\n\t\t\t\tlabel: mwMessage( 'mobile-frontend-amc-outreach-no-thanks' ).text()\n\t\t\t} ).$el\n\t\t],\n\t\tonBeforeHide: () => {\n\t\t\tpromoCampaign.makeActionIneligible( action );\n\t\t\tonBeforeHide();\n\t\t}\n\t} );\n};\n","/* global $ */\nconst\n\tPage = require( './Page' );\n\nlet page;\n\n/**\n * Constructs an incomplete Page model singleton representing the currently loaded page.\n *\n * Because this depends on the presence of certain DOM elements, it\n * should only be called after the DOMContentLoaded event.\n *\n * @ignore\n * @return {Page}\n */\nfunction loadCurrentPage() {\n\tif ( page ) {\n\t\treturn page;\n\t}\n\n\tconst permissions = [].concat( mw.config.get( 'wgRestrictionEdit', [] ) ),\n\t\trelevantTitle = mw.Title.newFromText( mw.config.get( 'wgRelevantPageName' ) ),\n\t\ttitle = mw.Title.newFromText( mw.config.get( 'wgPageName' ) );\n\n\tif ( permissions.length === 0 ) {\n\t\tpermissions.push( '*' );\n\t}\n\n\tpage = new Page( {\n\t\ttitle: title.getPrefixedText(),\n\t\ttitleObj: title,\n\t\trelevantTitle: relevantTitle.getPrefixedText(),\n\t\tprotection: {\n\t\t\tedit: permissions\n\t\t},\n\t\trevId: mw.config.get( 'wgRevisionId' ),\n\t\tisMainPage: mw.config.get( 'wgIsMainPage' ),\n\t\tisWatched: $( '#ca-watch' ).hasClass( 'watched' ),\n\t\tisMissing: mw.config.get( 'wgArticleId' ) === 0,\n\t\tid: mw.config.get( 'wgArticleId' ),\n\t\tnamespaceNumber: mw.config.get( 'wgNamespaceNumber' )\n\t} );\n\n\treturn page;\n}\n\nmodule.exports = loadCurrentPage;\n","/* global $ */\nconst\n\tPageHTMLParser = require( './PageHTMLParser' );\n\nlet pageHTMLParser;\n\n/**\n * Constructs a page parser singleton specific to the current page to find common child elements\n * more easily.\n *\n * Because this depends on the presence of certain DOM elements, it\n * should only be called after the DOMContentLoaded event.\n *\n * @ignore\n * @return {module:mobile.startup/PageHTMLParser}\n */\nfunction loadCurrentPageHTMLParser() {\n\tif ( pageHTMLParser ) {\n\t\treturn pageHTMLParser;\n\t}\n\n\tpageHTMLParser = new PageHTMLParser( $( '#content #bodyContent' ) );\n\n\treturn pageHTMLParser;\n}\n\nmodule.exports = loadCurrentPageHTMLParser;\n","/**\n * T156186: Please make judicious use of this singleton whose purpose is to\n * allow disparate components the ability to subscribe to a set of events and\n * react to those events.\n *\n * Prefer to use a more localized event bus when possible.\n *\n * Only import this in files at the edges. For example:\n *\n * Good: initialization scripts responsible for initializing classes such as\n * mobile.init/init.js\n * Bad: ImageOverlay.js or in any other component.\n *\n * By doing this, and using dependency injection of the event bus in the\n * components themselves, it will make it easier to switch this event bus out\n * for something more localized later on in our refactoring efforts.\n */\nmodule.exports = new OO.EventEmitter();\n","const util = require( './util' ),\n\tactionParams = require( './actionParams.js' );\n\n/**\n * Extends the API query parameters to include those parameters required to also fetch Wikibase\n * descriptions and appropriately sized thumbnail images as well as those required to make a query.\n *\n * This function wraps `util.extend` with some Wikibase-specific configuration\n * variable management\n * but, like `util.extend`, is variadic and so can be used as a replacement for it in search\n * gateways, e.g.\n *\n * ```\n * var params = extendSearchParams(\n * 'search',\n * baseParams,\n * specializedParams,\n * moreSpecializedParams\n * );\n * ```\n *\n * @param {string} feature The name of the feature\n * @throws {Error} If `feature` isn't one that shows Wikidata descriptions. See the\n * `wgMFDisplayWikibaseDescriptions` configuration variable for detail\n * @return {Object}\n */\nmodule.exports = function extendSearchParams( feature ) {\n\tconst displayWikibaseDescriptions = mw.config.get( 'wgMFDisplayWikibaseDescriptions' ) || {\n\t\t\t// These must be defined, as these are all the features that this can be used on.\n\t\t\t// If not defined, all these features will see their API calls broken\n\t\t\tsearch: true,\n\t\t\twatchlist: true,\n\t\t\ttagline: false\n\t\t},\n\t\tscriptPath = mw.config.get( 'wgMFScriptPath' );\n\n\tif ( !Object.prototype.hasOwnProperty.call( displayWikibaseDescriptions, feature ) ) {\n\t\tthrow new Error( '\"' + feature + '\" isn\\'t a feature that shows Wikibase descriptions.' );\n\t}\n\n\t// Construct the arguments for a call to `util.extend`\n\t// such that if it were hand-written, then it\n\t// would look like the following:\n\t//\n\t// ```\n\t// var result = util.extend( {\n\t// prop: []\n\t// }, params, /* ..., */ mw.config.get( 'wgMFSearchAPIParams' ) );\n\t// ```\n\tconst args = Array.prototype.slice.call( arguments, 1 );\n\targs.unshift( {\n\t\tprop: []\n\t} );\n\targs.push( mw.config.get( 'wgMFSearchAPIParams' ) );\n\n\tconst result = util.extend.apply( {}, args );\n\tresult.prop = result.prop.concat( mw.config.get( 'wgMFQueryPropModules' ) );\n\n\tif ( displayWikibaseDescriptions[feature] ) {\n\t\tif ( result.prop.indexOf( 'description' ) === -1 ) {\n\t\t\tresult.prop.push( 'description' );\n\t\t}\n\t}\n\n\tif ( scriptPath ) {\n\t\t// A foreign api is being accessed! Enable anonymous CORS queries!\n\t\tresult.origin = '*';\n\t}\n\treturn actionParams( result );\n};\n","const util = require( './util' ),\n\tButton = require( './Button' ),\n\ticons = require( './icons' );\n\n/**\n * Creates a header\n *\n * @ignore\n * @param {string|View} headingOrView (HTML allowed)\n * @param {View[]} headerActions\n * @param {module:mobile.startup/View} [headerCancel] defaults to cancel button\n * @param {string} [additionalClassNames] (should be escaped)\n * @return {Element}\n */\nfunction makeHeader( headingOrView, headerActions, headerCancel, additionalClassNames ) {\n\tconst heading = typeof headingOrView === 'string' ? headingOrView : undefined,\n\t\ttemplateData = {\n\t\t\thasActions: headerActions && headerActions.length,\n\t\t\tisHidden: false,\n\t\t\theading\n\t\t},\n\t\thtml = util.template( `\n<div class=\"overlay-header header ${ additionalClassNames || '' } hideable\">\n\t<ul class=\"header-cancel\">\n\t\t<li></li>\n\t</ul>\n\t{{{heading}}}\n\t{{#hasActions}}\n\t<div class=\"header-action\"></div>\n\t{{/hasActions}}\n</div>\n\t\t` ).render( templateData );\n\theaderCancel = headerCancel || icons.cancel();\n\tconst $el = util.parseHTML( html );\n\t// Truncate any text inside in the overlay header.\n\t$el.find( 'h2 span' ).addClass( 'truncated-text' );\n\t$el.find( '.header-cancel li' ).append(\n\t\theaderCancel.$el\n\t);\n\tif ( heading === undefined ) {\n\t\theadingOrView.$el.insertAfter( $el.find( '.header-cancel' ) );\n\t}\n\tif ( headerActions && headerActions.length ) {\n\t\t$el.find( '.header-action' ).append(\n\t\t\theaderActions.map( ( component ) => component.$el )\n\t\t);\n\t}\n\treturn $el[0];\n}\n\n/**\n * Creates a header with a h2 heading, internal for use inside GrowthExperiments only.\n *\n * @function\n * @memberof module:mobile.startup\n * @param {string} heading (HTML allowed)\n * @param {module:mobile.startup/View[]} headerActions\n * @param {module:mobile.startup/View} [headerCancel] defaults to cancel button\n * @param {string} [additionalClassNames] (should be escaped)\n * @return {Element}\n */\nfunction header( heading, headerActions, headerCancel, additionalClassNames ) {\n\theading = `<div class=\"overlay-title\"><h2>${ heading }</h2></div>`;\n\treturn makeHeader( heading, headerActions, headerCancel, additionalClassNames );\n}\n\n/**\n * Creates a header with a form\n *\n * @ignore\n * @param {string|View} formHTMLOrView of the header\n * @param {View[]} headerActions\n * @param {module:mobile.startup/View} [headerCancel] defaults to cancel button\n * @param {string} [additionalClassNames] (should be escaped)\n * @return {Element}\n */\nfunction formHeader( formHTMLOrView, headerActions, headerCancel, additionalClassNames ) {\n\treturn makeHeader( formHTMLOrView, headerActions, headerCancel, additionalClassNames );\n}\n\n/**\n * Creates a header with a form\n *\n * @ignore\n * @param {string} heading of the header\n * @param {string} additionalClassNames of the header\n * @return {Element}\n */\nfunction saveHeader( heading, additionalClassNames ) {\n\treturn header(\n\t\theading,\n\t\t[\n\t\t\tnew Button( {\n\t\t\t\ttagName: 'button',\n\t\t\t\tadditionalClassNames: 'save submit',\n\t\t\t\tdisabled: true,\n\t\t\t\tlabel: util.saveButtonMessage(),\n\t\t\t\tsize: 'large'\n\t\t\t} )\n\t\t],\n\t\ticons.back(),\n\t\tadditionalClassNames\n\t);\n}\n/**\n * Creates a header with a form\n *\n * @ignore\n * @param {string} heading of the header\n * @param {string} additionalClassNames of the header\n * @return {Element}\n */\nfunction savingHeader( heading ) {\n\treturn header(\n\t\theading,\n\t\t[\n\t\t\ticons.spinner( {\n\t\t\t\tadditionalClassNames: 'savespinner loading'\n\t\t\t} )\n\t\t],\n\t\ticons.cancel(),\n\t\t'saving-header hidden'\n\t);\n}\n\nmodule.exports = {\n\tsavingHeader,\n\tsaveHeader,\n\tformHeader,\n\theader\n};\n","const\n\tCANCEL_GLYPH = 'close',\n\tIcon = require( './Icon' ),\n\tIconButton = require( './IconButton' );\n\n/**\n * A set of shared icons.\n *\n * Factory methods are used to keep separate features that use the same icons\n * from accidentally manipulating one another's DOM when calling methods like\n * `remove`.\n *\n * @class icons\n * @singleton\n * @uses Icon\n */\nconst icons = {\n\tCANCEL_GLYPH,\n\t// Exported to support testing and stubbing\n\tIcon,\n\tIconButton,\n\t/**\n\t * Gets a back icon\n\t *\n\t * The icon should be used to inform the user that the front-end is\n\t * communicating with the back-end.\n\t *\n\t * @memberof icons\n\t * @instance\n\t * @return {IconButton}\n\t */\n\tback() {\n\t\treturn new icons.IconButton( {\n\t\t\ttagName: 'button',\n\t\t\ticon: 'previous',\n\t\t\tadditionalClassNames: 'back',\n\t\t\tlabel: mw.msg( 'mobile-frontend-overlay-close' )\n\t\t} );\n\t},\n\t/**\n\t * Gets a cancel icon\n\t *\n\t * The icon should be used to inform the user that the front-end is\n\t * communicating with the back-end.\n\t *\n\t * @memberof icons\n\t * @instance\n\t * @param {string} [variant]\n\t * @param {Object} [props] to extend\n\t * @return {IconButton}\n\t */\n\tcancel( variant, props = {} ) {\n\t\tconst glyph = variant ? `${ CANCEL_GLYPH }-${ variant }` : `${ CANCEL_GLYPH }`;\n\t\tprops.additionalClassNames = props.additionalClassNames || '';\n\t\tprops.additionalClassNames += ' cancel';\n\n\t\treturn new icons.IconButton( Object.assign( {\n\t\t\ttagName: 'button',\n\t\t\ticon: glyph,\n\t\t\tlabel: mw.msg( 'mobile-frontend-overlay-close' )\n\t\t}, props ) );\n\t},\n\t/**\n\t * Gets a spinner icon. This uses IconButton but should never actually\n\t * be a button or have full button styles, as its purely presentational\n\t *\n\t * The icon should be used to inform the user that the front-end is\n\t * communicating with the back-end.\n\t *\n\t * @memberof icons\n\t * @instance\n\t * @param {Object} [props] See `Icon` for more details\n\t * @return {IconButton}\n\t */\n\tspinner( props = {} ) {\n\t\tif ( props.additionalClassNames === undefined ) {\n\t\t\tprops.additionalClassNames = 'spinner loading';\n\t\t}\n\n\t\tconst spinner = new icons.IconButton( Object.assign( {\n\t\t\ttagName: 'span',\n\t\t\ticon: 'spinner',\n\t\t\tlabel: mw.msg( 'mobile-frontend-loading-message' )\n\t\t}, props ) );\n\n\t\t// Update the element to not use button classes or attributes\n\t\tspinner.$el.removeClass();\n\t\t// eslint-disable-next-line mediawiki/class-doc\n\t\tspinner.$el.addClass( props.additionalClassNames );\n\t\tspinner.$el.attr( 'type', '' );\n\t\tif ( spinner.options.isIconOnly ) {\n\t\t\tspinner.$el.addClass( 'mf-spinner-icon-element' );\n\t\t}\n\t\treturn spinner;\n\t},\n\t/**\n\t * Gets a failure (error) icon\n\t *\n\t * @memberof icons\n\t * @instance\n\t * @return {IconButton}\n\t */\n\terror() {\n\t\treturn new icons.IconButton( {\n\t\t\ticon: 'alert-invert',\n\t\t\tadditionalClassNames: 'load-fail-msg-icon'\n\t\t} );\n\t},\n\t/**\n\t * Gets a non-filled watch star icon.\n\t *\n\t * @memberof icons\n\t * @instance\n\t * @param {Object} props\n\t * @return {IconButton}\n\t */\n\twatch( props = {} ) {\n\t\tprops.additionalClassNames = props.additionalClassNames || '';\n\t\tprops.additionalClassNames += ' watch-this-article';\n\n\t\treturn new icons.IconButton( Object.assign( {\n\t\t\ticon: 'star-subtle'\n\t\t}, props ) );\n\t},\n\t/**\n\t * Gets a filled watch star icon.\n\t *\n\t * @memberof icons\n\t * @instance\n\t * @param {Object} props\n\t * @return {IconButton}\n\t */\n\twatched( props = {} ) {\n\t\tprops.additionalClassNames = props.additionalClassNames || '';\n\t\tprops.additionalClassNames += ' watch-this-article watched';\n\n\t\treturn new icons.IconButton( Object.assign( {\n\t\t\ticon: 'unStar-progressive'\n\t\t}, props ) );\n\t}\n};\n\nmodule.exports = icons;\n","const\n\tutil = require( '../util' ),\n\tplaceholderClass = 'lazy-image-placeholder';\n\n/**\n * @ignore\n * @param {HTMLElement} root\n * @return {HTMLElement[]}\n */\nfunction queryPlaceholders( root ) {\n\treturn Array.prototype.slice.call(\n\t\troot.getElementsByClassName( placeholderClass )\n\t);\n}\n\n/**\n * Load an image on demand\n *\n * @ignore\n * @param {HTMLElement[]} placeholders a list of images that have not been loaded.\n * @return {jQuery.Deferred}\n */\nfunction loadImages( placeholders ) {\n\treturn util.Promise.all(\n\t\tplaceholders.map( ( placeholder ) => module.exports.loadImage( placeholder ).promise )\n\t);\n}\n\n/**\n * Load an image on demand\n *\n * @ignore\n * @param {HTMLElement} placeholder\n * @return {{promise: jQuery.Deferred<'load'|'error'>, image: HTMLImageElement}}\n */\nfunction loadImage( placeholder ) {\n\tconst\n\t\tdeferred = util.Deferred(),\n\t\t// data-width and height are attributes and do not specify dimension.\n\t\twidth = placeholder.dataset.width,\n\t\theight = placeholder.dataset.height,\n\t\timage = new Image();\n\n\tif ( width ) {\n\t\timage.setAttribute( 'width', parseInt( width, 10 ) );\n\t}\n\tif ( height ) {\n\t\timage.setAttribute( 'height', parseInt( height, 10 ) );\n\t}\n\n\t// eslint-disable-next-line mediawiki/class-doc\n\timage.className = placeholder.dataset.class || '';\n\timage.alt = placeholder.dataset.alt || '';\n\timage.useMap = placeholder.dataset.usemap;\n\timage.style.cssText = placeholder.style.cssText || '';\n\n\t// When the image has loaded\n\timage.addEventListener( 'load', () => {\n\t\t// Swap the HTML inside the placeholder (to keep the layout and\n\t\t// dimensions the same and not trigger layouts\n\t\timage.classList.add( 'image-lazy-loaded' );\n\t\tif ( placeholder.parentNode ) {\n\t\t\tplaceholder.parentNode.replaceChild( image, placeholder );\n\t\t}\n\t\tdeferred.resolve( 'load' );\n\t}, { once: true } );\n\timage.addEventListener( 'error', () => {\n\t\t// Swap the HTML and let the browser decide what to do with the broken image.\n\t\tif ( placeholder.parentNode ) {\n\t\t\tplaceholder.parentNode.replaceChild( image, placeholder );\n\t\t}\n\t\t// Never reject. Quietly resolve so that Promise.all() awaits for all Deferreds to complete.\n\t\t// Reevaluate using Deferred.reject in T136693.\n\t\tdeferred.resolve( 'error' );\n\t}, { once: true } );\n\n\t// Trigger image download after binding the load handler\n\tconst src = placeholder.dataset.mwSrc || '';\n\tif ( src ) {\n\t\timage.src = src;\n\t\timage.srcset = placeholder.dataset.mwSrcset || '';\n\t}\n\n\treturn {\n\t\tpromise: deferred,\n\t\timage\n\t};\n}\n\nmodule.exports = {\n\tplaceholderClass,\n\tqueryPlaceholders,\n\tloadImages,\n\tloadImage,\n\ttest: {\n\t\tplaceholderClass\n\t}\n};\n","/**\n * Extends a class with new methods and member properties.\n *\n * @ignore\n * @param {Function} Child function\n * @param {Object|Function} ParentOrPrototype class to inherit from\n * OR if no inheriting class a prototype to extend the class with\n * @param {Object} [prototype]\n */\nmodule.exports = function mfExtend( Child, ParentOrPrototype, prototype ) {\n\tlet key;\n\tif ( prototype ) {\n\t\tOO.inheritClass( Child, ParentOrPrototype );\n\t} else {\n\t\tOO.initClass( Child );\n\t\tprototype = ParentOrPrototype;\n\t}\n\tfor ( key in prototype ) {\n\t\tChild.prototype[key] = prototype[key];\n\t}\n};\n","/**\n * Class for managing modules\n *\n * A module in this context is essentially a Javascript class (not to be confused with\n * ResourceLoader modules).\n *\n * @class ModuleLoader\n */\nfunction ModuleLoader() {\n\t/**\n\t * @property {Object} register of defined modules\n\t * @private\n\t */\n\tthis._register = {};\n}\n\nModuleLoader.prototype = {\n\t/**\n\t * Require (import) a module previously defined using define().\n\t * Searches core module registry using ResourceLoader require before consulting\n\t * its own local registry. This method is deprecated, please do not use.\n\t *\n\t * @memberof ModuleLoader\n\t * @instance\n\t * @param {string} id Required module id.\n\t * @return {Object} Required module, can be any JavaScript object.\n\t */\n\trequire( id ) {\n\t\tconst registry = this._register;\n\n\t\t/**\n\t\t * @return {Object} Module\n\t\t */\n\t\tfunction localRequire() {\n\t\t\tif ( !Object.hasOwnProperty.call( registry, id ) ) {\n\t\t\t\tthrow new Error( 'MobileFrontend Module not found: ' + id );\n\t\t\t}\n\t\t\treturn registry[id];\n\t\t}\n\n\t\tconst args = id.split( '/' );\n\t\ttry {\n\t\t\tconst module = __non_webpack_require__( args[0] );\n\t\t\tif ( module[args[1]] ) {\n\t\t\t\treturn module[args[1]];\n\t\t\t} else {\n\t\t\t\treturn localRequire();\n\t\t\t}\n\t\t} catch ( e ) {\n\t\t\treturn localRequire();\n\t\t}\n\t},\n\n\t/**\n\t * Define a module which can be later required (imported) using require().\n\t *\n\t * @memberof ModuleLoader\n\t * @instance\n\t * @param {string} id Defined module id.\n\t * @param {Object} obj Defined module body, can be any JavaScript object.\n\t * @return {Object}\n\t */\n\tdefine( id, obj ) {\n\t\tconst self = this;\n\n\t\tif ( Object.hasOwnProperty.call( this._register, id ) ) {\n\t\t\tthrow new Error( 'Module already exists: ' + id );\n\t\t}\n\t\tthis._register[id] = obj;\n\t\t// return an object of additionally functions to do with the registered module\n\t\treturn {\n\t\t\t/**\n\t\t\t * @see ModuleLoader#deprecate\n\t\t\t * @param {string} deprecatedId Defined module id, which is deprecated.\n\t\t\t * @ignore\n\t\t\t */\n\t\t\tdeprecate( deprecatedId ) {\n\t\t\t\tself.deprecate( deprecatedId, obj, id );\n\t\t\t}\n\t\t};\n\t},\n\n\t/**\n\t * Deprecate a module and give an replacement (if there is any).\n\t *\n\t * @memberof ModuleLoader\n\t * @instance\n\t * @param {string} id Defined module id, which is deprecated.\n\t * @param {Object} obj Defined module body, can be any JavaScript object.\n\t * @param {string} [replacement] Give an optional replacement for this module (which\n\t * needs to be already defined!)\n\t */\n\tdeprecate( id, obj, replacement ) {\n\t\tlet msg;\n\t\tif ( replacement ) {\n\t\t\t// add an alternative for this module, if any given\n\t\t\tmsg = 'Use ' + replacement + ' instead.';\n\t\t}\n\t\t// register it as a deprecated one\n\t\tmw.log.deprecate( this._register, id, obj, msg );\n\t}\n};\n\nmodule.exports = ModuleLoader;\n","const ModuleLoader = require( './moduleLoader' );\n\nmodule.exports = new ModuleLoader();\n","const Page = require( '../Page' );\nconst util = require( '../util' );\n\n/**\n * Create a Page object from an API response.\n *\n * @memberof Page\n * @param {Object} resp as representing a page in the API\n * @return {Page}\n */\nfunction parse( resp ) {\n\tlet displayTitle;\n\tconst thumb = resp.thumbnail,\n\t\tpageprops = resp.pageprops || {\n\t\t\tdisplaytitle: mw.html.escape( resp.title )\n\t\t},\n\t\tterms = resp.terms || resp.entityterms;\n\n\tif ( pageprops || terms ) {\n\t\t// The label is either the display title or the label pageprop\n\t\t// (the latter used by Wikidata)\n\t\t// Long term we want to consolidate these.\n\t\t// Note that pageprops.displaytitle is HTML, while\n\t\t// terms.label[0] is plain text.\n\t\tdisplayTitle = terms && terms.label ?\n\t\t\tmw.html.escape( terms.label[0] ) : pageprops.displaytitle;\n\t}\n\t// Add Wikidata descriptions if available (T101719)\n\tresp.wikidataDescription = resp.description || undefined;\n\n\tif ( thumb ) {\n\t\tresp.thumbnail.isLandscape = thumb.width > thumb.height;\n\t}\n\n\treturn new Page(\n\t\tutil.extend( resp, {\n\t\t\tid: resp.pageid,\n\t\t\tisMissing: !!resp.missing,\n\t\t\turl: mw.util.getUrl( resp.title ),\n\t\t\tdisplayTitle // this is HTML!\n\t\t} )\n\t);\n}\n\nmodule.exports = { parse };\n","/**\n * Creates a campaign that makes showing promo drawers, modals, etc that should\n * only be shown once (using localStorage) per action (when page loads, when\n * user clicks on a link, etc) easier. The campaign executes a given callback\n * (e.g. showing a drawer or modal) for a specific action only when it is\n * eligible. A campaign can have multiple arbitrary actions via the supplied\n * `actions` object. An action is either 'eligible' or 'ineligible' at any given\n * time. If `ineligible`, the `showIfEligible` will not execute the `onShow`\n * callback.\n *\n * @ignore\n * @param {Function} onShow A callback intended to show something related to the\n * campaign (drawer, modal, etc) when executed. The callback will only execute\n * after the client calls `showIfEligible` and only if the passed in action is\n * 'eligible'.\n * @param {Object} actions Object of arbitrary actions that are intended to be\n * either \"eligible\" or \"ineligible\" at any given time (onPageLoad,\n * onHistoryLinkClick). The `onShow` callback will only be executed when an\n * action is 'eligible'. For each action, the key and value should be the same\n * (e.g. \"onLoad\":\"onLoad\") to mimic an enum. The client is responsible for\n * notifying when each action becomes \"ineligible\" by calling the\n * `makeActionIneligible` method. All actions can be marked as ineligible by\n * calling the `makeAllActionsIneligible` method.\n * @param {string} campaignName Name of campaign. This is only used to form part\n * of the localStorage key for each action.\n * @param {boolean} campaignActive Is campaign active\n * @param {boolean} userEligible Is current user eligible\n * @param {mw.storage} mwStorage Used to mark actions as ineligible\n * into localStorage\n * @return {mobile.startup/AmcOutreach~PromoCampaign}\n */\nfunction createPromoCampaign(\n\tonShow,\n\tactions,\n\tcampaignName,\n\tcampaignActive,\n\tuserEligible,\n\tmwStorage\n) {\n\t// This object maps actions to localStorage keys\n\tconst ACTIONS_TO_STORAGE_KEYS = {};\n\tfor ( const key in actions ) {\n\t\tconst a = actions[ key ];\n\t\tACTIONS_TO_STORAGE_KEYS[a] = `mobile-frontend-${ campaignName }-ineligible-${ a }`;\n\t}\n\n\t/**\n\t * @return {boolean}\n\t */\n\tfunction isCampaignActive() {\n\t\treturn campaignActive;\n\t}\n\n\t/**\n\t * @param {string} action\n\t * @throws {Error} Throws an error if action is not valid.\n\t */\n\tfunction validateAction( action ) {\n\t\tif ( !( action in actions ) ) {\n\t\t\tthrow new Error(\n\t\t\t\t`Action '${ action }' not found in 'actions' object. Please add this to\n\t\t\t\tthe object when creating a campaign with promoCampaign.js if you believe\n\t\t\t\tthis is a valid action.`\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * @param {string} action Will check the eligibility of this action. This\n\t * should be a value in the actions object.\n\t * @throws {Error} Throws an error if action is not valid.\n\t * @return {boolean}\n\t */\n\tfunction isActionEligible( action ) {\n\t\tvalidateAction( action );\n\n\t\treturn isCampaignActive() &&\n\t\t\tuserEligible &&\n\t\t\tmwStorage.get( ACTIONS_TO_STORAGE_KEYS[action] ) === null;\n\t}\n\n\treturn {\n\t\t/**\n\t\t * @ignore\n\t\t * @param {string} action Should be one of the values in the\n\t\t * actions param\n\t\t * @param {...*} [args] Args to pass to the onShow callback\n\t\t * @throws {Error} Throws an error if action is not valid.\n\t\t * @return {module:mobile.startup/Drawer|null} Returns Drawer if drawer is eligible to be shown and\n\t\t * null if not.\n\t\t */\n\t\tshowIfEligible( action, ...args ) {\n\t\t\tif ( !isActionEligible( action ) ) {\n\t\t\t\t// If not eligible, there is no sense in continuing.\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\treturn onShow( action, ...args );\n\t\t},\n\t\t/**\n\t\t * @ignore\n\t\t * @param {string} action\n\t\t * @throws {Error} Throws an error if action is not valid.\n\t\t * @return {boolean} Whether the save operation was successful\n\t\t */\n\t\tmakeActionIneligible( action ) {\n\t\t\tvalidateAction( action );\n\n\t\t\t// The value here actually doesn't matter. The only thing that matters is\n\t\t\t// if this key exists in localStorage.\n\t\t\treturn mwStorage.set( ACTIONS_TO_STORAGE_KEYS[action], '~' );\n\t\t},\n\t\tmakeAllActionsIneligible() {\n\t\t\tlet key, action;\n\t\t\tfor ( key in actions ) {\n\t\t\t\taction = actions[key];\n\t\t\t\tthis.makeActionIneligible( action );\n\t\t\t}\n\t\t},\n\t\tisCampaignActive\n\t};\n}\n\nmodule.exports = createPromoCampaign;\n","const\n\tstorageKey = 'mobileFrontend/toast';\n\n/**\n * Show the previously saved toast data and delete it from storage\n *\n * @memberof Toast\n * @instance\n * @private\n */\nfunction showPending() {\n\tlet data = mw.storage.get( storageKey );\n\tif ( data ) {\n\t\tdata = JSON.parse( data );\n\t\tmw.notify( data.content, data.options );\n\t\tmw.storage.remove( storageKey );\n\t}\n}\n\nmw.requestIdleCallback( showPending );\n\n/**\n * Save the toast data in storage so that we can show it on page reload.\n * Also check whether there is a pending message that's not shown yet.\n * If yes, output a warning message and discard this message.\n * This is to ensure that the page needs to be reloaded before adding\n * a new message for showing later.\n *\n * @memberof Toast\n * @instance\n * @param {string} content Content to be placed in element\n * @param {Object|string} [options]\n * If a string (deprecated) CSS class to add to the element\n * If an object, more options for the notification see mw.notification.show.\n * For backwards compatibility reasons if a string is given it will be\n * treated as options.type\n */\nfunction showOnPageReload( content, options ) {\n\tif ( mw.storage.get( storageKey ) ) {\n\t\tmw.log.warn(\n\t\t\t'A pending toast message already exits. ' +\n\t\t\t\t'The page should have been reloaded by now.'\n\t\t);\n\t\treturn;\n\t}\n\tmw.storage.set( storageKey, JSON.stringify( {\n\t\tcontent,\n\t\toptions\n\t} ) );\n}\n\nmodule.exports = { showOnPageReload };\n","/* global $ */\n\n/**\n * Utility library\n *\n * @class util\n * @singleton\n */\nmodule.exports = {\n\t/**\n\t * Obtains the correct label for the save button which is project specific. It's either\n\t * \"save\" or \"publish\"\n\t *\n\t * @return {string}\n\t */\n\tsaveButtonMessage() {\n\t\treturn mw.config.get( 'wgEditSubmitButtonLabelPublish' ) ?\n\t\t\tmw.msg( 'mobile-frontend-editor-publish' ) : mw.msg( 'mobile-frontend-editor-save' );\n\t},\n\t/**\n\t * Wrapper class for Promises\n\t *\n\t * @memberof util\n\t * @instance\n\t */\n\tPromise: {\n\t\t/**\n\t\t * Wrapper class for the $.when that is compatible with Promise.all\n\t\t *\n\t\t * @memberof util\n\t\t * @param {jQuery.Promise[]} promises\n\t\t * @instance\n\t\t * @return {jQuery.Promise}\n\t\t */\n\t\tall( promises ) {\n\t\t\treturn $.when.apply( $, promises );\n\t\t}\n\t},\n\t/**\n\t * Escape a string for use as a css selector\n\t *\n\t * @memberof util\n\t * @instance\n\t * @param {string} selector\n\t * @return {string}\n\t */\n\tescapeSelector( selector ) {\n\t\treturn $.escapeSelector( selector );\n\t},\n\t/**\n\t * Run method when document is ready.\n\t *\n\t * @memberof util\n\t * @instance\n\t * @param {Function} fn\n\t * @return {jQuery.Object}\n\t */\n\tdocReady( fn ) {\n\t\treturn $( fn );\n\t},\n\t/**\n\t * Wrapper class for the Deferred method\n\t *\n\t * @memberof util\n\t * @instance\n\t * @return {jQuery.Deferred}\n\t */\n\tDeferred() {\n\t\treturn $.Deferred();\n\t},\n\t/**\n\t * Adds a class to the document\n\t *\n\t * @memberof util\n\t * @instance\n\t * @return {jQuery.Object} element representing the documentElement\n\t */\n\tgetDocument() {\n\t\treturn $( document.documentElement );\n\t},\n\t/**\n\t * Get the window object\n\t *\n\t * @memberof util\n\t * @instance\n\t * @return {jQuery.Object}\n\t */\n\tgetWindow() {\n\t\treturn $( window );\n\t},\n\t/**\n\t * Given some html, create new element(s).\n\t * Unlike jQuery.parseHTML this will return a jQuery object\n\t * not an array.\n\t *\n\t * @memberof util\n\t * @instance\n\t * @param {string} html\n\t * @param {Element} [ctx] Document element to serve as the context\n\t * in which the HTML fragment will be created\n\t * @return {jQuery.Object}\n\t */\n\tparseHTML( html, ctx ) {\n\t\tctx = ctx || document;\n\t\treturn $( $.parseHTML( html, ctx ) );\n\t},\n\t/**\n\t * Wrapper for jQuery.extend method. In future this can be bound to Object.assign\n\t * when support allows.\n\t *\n\t * Warning: if only one argument is supplied to util.extend(), this means the target argument\n\t * was omitted. In this case, the jQuery object itself is assumed to be the target.\n\t *\n\t * @memberof util\n\t * @instance\n\t * @return {Object}\n\t */\n\textend() {\n\t\treturn $.extend.apply( $, arguments );\n\t},\n\n\ttemplate( source ) {\n\t\treturn {\n\t\t\t/**\n\t\t\t * @ignore\n\t\t\t * @return {string} The raw source code of the template\n\t\t\t */\n\t\t\tgetSource() {\n\t\t\t\treturn source;\n\t\t\t},\n\t\t\t/**\n\t\t\t * @ignore\n\t\t\t * @param {Object} data Data to render\n\t\t\t * @param {Object} partials Map partial names to Mustache template objects\n\t\t\t * @return {string} Rendered HTML\n\t\t\t */\n\t\t\trender( data, partials ) {\n\t\t\t\tconst partialSource = {};\n\t\t\t\t// Map MobileFrontend templates to partial strings\n\t\t\t\tObject.keys( partials || {} ).forEach( ( key ) => {\n\t\t\t\t\tpartialSource[key] = partials[key].getSource();\n\t\t\t\t} );\n\n\t\t\t\t// Use global Mustache which is loaded by mediawiki.template.mustache (a\n\t\t\t\t// dependency of the mobile.startup module)\n\t\t\t\t// eslint-disable-next-line no-undef\n\t\t\t\treturn Mustache.render(\n\t\t\t\t\tsource.trim(),\n\t\t\t\t\tdata,\n\t\t\t\t\tpartialSource\n\t\t\t\t);\n\t\t\t}\n\t\t};\n\t}\n};\n","const util = require( '../util' ),\n\tactionParams = require( '../actionParams' );\n\n/**\n * @ignore\n * @typedef {string|number} PageID Page ID. 0 / \"0\" is a special no-ID value.\n * {@link https://www.mediawiki.org/wiki/Manual:Page_table#page_id Page ID}\n *\n * @ignore\n * @typedef {string} PageTitle Canonical page title.\n * {@link https://www.mediawiki.org/wiki/Manual:Title.php#Canonical_forms Canonical forms}\n *\n * @ignore\n * @typedef {boolean} WatchStatus Page watch status; true if watched, false if\n * unwatched.\n * {@link https://www.mediawiki.org/wiki/API:Info API:Info} (see inprop.watched)\n * {@link https://www.mediawiki.org/wiki/API:Watch API:Watch} (see unwatch)\n *\n * @ignore\n * @typedef {Object.<PageTitle, WatchStatus>} WatchStatusMap\n */\n\n/**\n * API for retrieving and modifying page watch statuses. This module interacts\n * with two endpoints, API:Info for GETs and API:Watch and for POSTs.\n *\n * @class WatchstarGateway\n * @param {mw.Api} api\n * @ignore\n */\nfunction WatchstarGateway( api ) {\n\tthis.api = api;\n}\n\nWatchstarGateway.prototype = {\n\t/**\n\t * Issues zero to two asynchronous HTTP requests for the watch status of\n\t * each page ID and title passed.\n\t *\n\t * Every watch entry has a title but not necessarily a page ID. Entries\n\t * without IDs are missing pages, i.e., pages that do not exist. These\n\t * entries are used to observe when a page with a given title is created.\n\t * Although it is convenient to use titles because they're always present,\n\t * IDs are preferred since they're far less likely to exceed the URL length\n\t * limit.\n\t *\n\t * No request is issued when no IDs and no titles are passed. Given that the\n\t * server state does not change between the two requests, overlapping title\n\t * and ID members will behave as expected but there is no reason to issue\n\t * such a request.\n\t *\n\t * @memberof WatchstarGateway\n\t * @instance\n\t * @param {PageID[]} ids\n\t * @param {PageTitle[]} titles\n\t * @return {jQuery.Deferred<WatchStatusMap>}\n\t */\n\tgetStatuses( ids, titles ) {\n\t\t// Issue two requests and coalesce the results.\n\t\treturn util.Promise.all( [\n\t\t\tthis.getStatusesByID( ids ),\n\t\t\tthis.getStatusesByTitle( titles )\n\t\t] ).then( function () {\n\t\t\treturn util.extend.apply( util, arguments );\n\t\t} );\n\t},\n\n\t/**\n\t * @memberof WatchstarGateway\n\t * @instance\n\t * @param {PageID[]} ids\n\t * @return {jQuery.Deferred<WatchStatusMap>}\n\t */\n\tgetStatusesByID( ids ) {\n\t\tconst self = this;\n\t\tif ( !ids.length ) {\n\t\t\treturn util.Deferred().resolve( {} );\n\t\t}\n\n\t\treturn this.api.get( {\n\t\t\tformatversion: 2,\n\t\t\taction: 'query',\n\t\t\tprop: 'info',\n\t\t\tinprop: 'watched',\n\t\t\tpageids: ids\n\t\t} ).then( ( rsp ) => self._unmarshalGetResponse( rsp ) );\n\t},\n\n\t/**\n\t * @memberof WatchstarGateway\n\t * @instance\n\t * @param {PageTitle[]} titles\n\t * @return {jQuery.Deferred<WatchStatusMap>}\n\t */\n\tgetStatusesByTitle( titles ) {\n\t\tconst self = this;\n\t\tif ( !titles.length ) {\n\t\t\treturn util.Deferred().resolve( {} );\n\t\t}\n\n\t\treturn this.api.get( actionParams( {\n\t\t\tprop: 'info',\n\t\t\tinprop: 'watched',\n\t\t\ttitles\n\t\t} ) ).then( ( rsp ) => self._unmarshalGetResponse( rsp ) );\n\t},\n\n\t/**\n\t * @memberof WatchstarGateway\n\t * @instance\n\t * @param {PageTitle[]} titles\n\t * @param {WatchStatus} watched\n\t * @return {jQuery.Deferred}\n\t */\n\tpostStatusesByTitle( titles, watched ) {\n\t\tconst params = {\n\t\t\taction: 'watch',\n\t\t\ttitles\n\t\t};\n\t\tif ( !watched ) {\n\t\t\tparams.unwatch = !watched;\n\t\t}\n\t\treturn this.api.postWithToken( 'watch', params );\n\t},\n\n\t/**\n\t * @memberof WatchstarGateway\n\t * @instance\n\t * @param {Object} rsp The API:Info response.\n\t * @return {jQuery.Deferred<WatchStatusMap>}\n\t * @see getStatusesByID\n\t * @see getStatusesByTitle\n\t * @ignore\n\t */\n\t_unmarshalGetResponse( rsp ) {\n\t\tconst pages = rsp && rsp.query && rsp.query.pages || [];\n\t\treturn pages.reduce( ( statuses, page ) => {\n\t\t\tstatuses[page.title] = page.watched;\n\t\t\treturn statuses;\n\t\t}, {} );\n\t}\n};\n\nmodule.exports = WatchstarGateway;\n","const PageList = require( '../PageList' ),\n\twatchstar = require( './watchstar' ),\n\tuser = mw.user,\n\tutil = require( '../util' ),\n\tPage = require( '../Page' ),\n\tmfExtend = require( '../mfExtend' ),\n\tWatchstarGateway = require( './WatchstarGateway' );\n\n/**\n * @typedef {Object.<PageTitle, PageID>} PageTitleToPageIDMap\n * @ignore\n */\n\n/**\n * List of items page view\n *\n * @class WatchstarPageList\n * @uses Page\n * @uses WatchstarGateway\n * @uses Watchstar\n * @extends PageList\n * @ignore\n *\n * @fires WatchstarPageList#unwatch\n * @fires WatchstarPageList#watch\n * @param {Object} options Configuration options\n */\nfunction WatchstarPageList( options ) {\n\tthis.wsGateway = new WatchstarGateway( options.api );\n\tPageList.apply( this, arguments );\n}\n\nmfExtend( WatchstarPageList, PageList, {\n\t/**\n\t * @memberof WatchstarPageList\n\t * @instance\n\t * @mixes PageList#defaults\n\t * @property {Object} defaults Default options hash.\n\t * @property {mw.Api} defaults.api\n\t */\n\tpostRender() {\n\t\tconst\n\t\t\tself = this,\n\t\t\tids = [],\n\t\t\ttitles = [];\n\n\t\tPageList.prototype.postRender.apply( this );\n\n\t\tconst $items = this.queryUnitializedItems();\n\t\tconst pages = this.parsePagesFromItems( $items );\n\n\t\tObject.keys( pages ).forEach( ( title ) => {\n\t\t\tconst id = pages[title];\n\t\t\t// Favor IDs since they're short and unlikely to exceed URL length\n\t\t\t// limits when batched.\n\t\t\tif ( id && id !== '0' ) {\n\t\t\t\t// ID is present and valid.\n\t\t\t\tids.push( id );\n\t\t\t} else {\n\t\t\t\t// Only titles are available for missing pages.\n\t\t\t\ttitles.push( title );\n\t\t\t}\n\t\t} );\n\n\t\treturn this.getPages( ids, titles )\n\t\t\t.then( ( statuses ) => self.renderItems( $items, statuses ) );\n\t},\n\n\t/**\n\t * @memberof WatchstarPageList\n\t * @param {jQuery.Element} $items\n\t * @param {WatchStatusMap} statuses\n\t * @ignore\n\t */\n\tqueryUnitializedItems() {\n\t\treturn this.$el.find( 'li:not(.with-watchstar)' );\n\t},\n\n\t/**\n\t * Retrieve pages\n\t *\n\t * @memberof WatchstarPageList\n\t * @instance\n\t * @param {PageID[]} ids\n\t * @param {PageTitle[]} titles\n\t * @return {jQuery.Deferred<WatchStatusMap>}\n\t * @ignore\n\t */\n\tgetPages( ids, titles ) {\n\t\t// Rendering Watchstars for anonymous users is not useful. Short-circuit\n\t\t// the request.\n\t\tif ( user.isAnon() ) {\n\t\t\treturn util.Deferred().resolve( {} );\n\t\t}\n\n\t\treturn this.wsGateway.getStatuses( ids, titles );\n\t},\n\n\t/**\n\t * @param {jQuery.Element} $items\n\t * @return {PageTitleToPageIDMap}\n\t * @memberof WatchstarPageList\n\t * @ignore\n\t */\n\tparsePagesFromItems( $items ) {\n\t\tconst\n\t\t\tself = this,\n\t\t\tpages = {};\n\t\t$items.each( ( _, item ) => {\n\t\t\tconst $item = self.$el.find( item );\n\t\t\tpages[$item.attr( 'title' )] = $item.data( 'id' );\n\t\t} );\n\t\treturn pages;\n\t},\n\n\t/**\n\t * @param {jQuery.Element} $items\n\t * @param {WatchStatusMap} statuses\n\t * @memberof WatchstarPageList\n\t * @ignore\n\t */\n\trenderItems( $items, statuses ) {\n\t\tconst self = this;\n\n\t\t// Rendering Watchstars for anonymous users is not useful. Nothing to do.\n\t\tif ( user.isAnon() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Create watch stars for each entry in list\n\t\t$items.each( ( _, item ) => {\n\t\t\tconst\n\t\t\t\t$item = self.$el.find( item ),\n\t\t\t\tpage = new Page( {\n\t\t\t\t\t// FIXME: Set sections so we don't hit the api (hacky)\n\t\t\t\t\tsections: [],\n\t\t\t\t\ttitle: $item.attr( 'title' ),\n\t\t\t\t\tid: $item.data( 'id' )\n\t\t\t\t} ),\n\t\t\t\twatched = statuses[page.getTitle()];\n\n\t\t\tself._appendWatchstar( $item, page, watched );\n\t\t\t$item.addClass( 'with-watchstar' );\n\t\t} );\n\t},\n\n\t/**\n\t * @param {jQuery.Object} $item\n\t * @param {Page} page\n\t * @param {WatchStatus} watched\n\t * @private\n\t */\n\t_appendWatchstar( $item, page, watched ) {\n\t\twatchstar( {\n\t\t\t// WatchstarPageList.getPages() already retrieved the status of\n\t\t\t// each page. Explicitly set the watch state so another request\n\t\t\t// will not be issued by the Watchstar.\n\t\t\tisWatched: watched,\n\t\t\tpage\n\t\t} ).appendTo( $item );\n\t}\n} );\n\nmodule.exports = WatchstarPageList;\n","const icons = require( '../icons' );\n\n/**\n * A clickable watchstar for logged in users.\n * Should not be used for anonymous users.\n *\n * @param {Object} options Configuration options\n * @param {Page} options.page\n * @param {boolean} options.isWatched is the article watched?\n * @return {IconButton}\n */\nmodule.exports = function ( options ) {\n\tconst isWatched = options.isWatched,\n\t\twatchstar = __non_webpack_require__( 'mediawiki.page.watch.ajax' ).watchstar,\n\t\taction = isWatched ? 'unwatch' : 'watch',\n\t\ticonProps = {\n\t\t\thref: mw.Title.newFromText( options.page.title ).getUrl( { action } )\n\t\t},\n\t\twatchButton = icons.watch( iconProps ),\n\t\twatchedButton = icons.watched( iconProps ),\n\t\tWATCH_BUTTON_CLASS = watchButton.getClassName(),\n\t\tWATCHED_BUTTON_CLASS = watchedButton.getClassName(),\n\t\tWATCH_CLASS = watchButton.getIcon().getClassName(),\n\t\tWATCHED_CLASS = watchedButton.getIcon().getClassName(),\n\t\tactiveIcon = isWatched ? watchedButton : watchButton,\n\t\tcallback = ( $link, watched ) => {\n\t\t\t$link.attr( 'class', watched ?\n\t\t\t\tWATCHED_BUTTON_CLASS : WATCH_BUTTON_CLASS );\n\t\t\tconst $icon = $link.find( '.mf-icon' );\n\t\t\t$icon.attr( 'class', watched ?\n\t\t\t\tWATCHED_CLASS : WATCH_CLASS );\n\t\t};\n\n\twatchstar( activeIcon.$el, options.page.title, callback );\n\treturn activeIcon;\n};\n"],"names":["icons","require","module","exports","$goBack","cancel","$el","$loadingMessage","spinner","tagName","isIconOnly","label","mw","msg","$","addClass","append","View","util","Anchor","_View","_classCallCheck","_callSuper","arguments","_inherits","key","get","progressive","undefined","destructive","additionalClassNames","href","template","browser","memoize","method","memoized","cache","this","cacheId","join","call","Object","prototype","hasOwnProperty","apply","Date","now","toString","Math","random","Browser","ua","$container","userAgent","isIos","version","ios","test","isWideScreen","val","parseInt","config","window","innerWidth","supportsTouchEvents","getSingleton","$html","getDocument","navigator","mfExtend","IconButton","Button","options","preRender","action","weight","quiet","block","extend","icon","_button","_buttonHTML","outerHTML","isTemplateMode","defaults","disabled","size","Drawer","CtaDrawer","length","params","redirectParams","queryParams","returnTo","children","parseHTML","text","content","getUrl","progressiveButton","signUpParams","signupQueryParams","actionAnchor","redirectURL","returnto","push","type","props","drawerClassName","className","collapseIcon","onBeforeHide","showCollapseIcon","events","hide","bind","ev","preventDefault","click","stopPropagation","$mask","show","d","Deferred","prepend","width","$drawer","find","hasClass","resolve","hook","fire","onShow","requestAnimationFrame","promise","_this","removeClass","setTimeout","detach","postRender","concat","trim","Icon","_iconClasses","getIconClasses","getRotationClass","rotationClass","rotation","Error","base","isSmall","rotationClasses","classes","getGlyphClassName","glyphPrefix","getClassName","attr","isTypeButton","_buttonClasses","getButtonClasses","_iconHTML","_icon","title","getIcon","MessageBox","header","Overlay","headerChrome","hideTimeout","showSpinner","hideSpinner","footerAnchor","$overlayContent","headers","heading","headerActions","onExitClick","exit","onBeforeExit","scrollTop","pageYOffset","scrollTo","clearTimeout","pageXOffset","emit","showHidden","make","view","overlay","overlayManager","MANAGED_STATE","OverlayManager","router","container","on","_checkRoute","entries","stack","hideCurrent","attachHideEvent","_onHideOverlayOutsideOverlayManager","currentRoute","route","routeIsString","currentPath","getPath","routeIsSame","match","back","_attachOverlay","parents","appendChild","_show","history","replaceState","location","once","_hideOverlay","onBeforeExitCancel","result","off","_processMatch","factoryResult","current","keys","reduce","m","id","_matchRoute","path","entry","didMatch","captures","previous","self","slice","shift","next","factory","unshift","add","docReady","replaceCurrent","stackOverlay","__non_webpack_require__","document","createElement","hash","state","body","pushState","__clearCache","HTML","html","Page","relevantTitle","titleObj","displayTitle","escape","namespaceNumber","protection","url","wikidataDescription","_isMainPage","isMainPage","isMissing","anchor","revId","_isWatched","isWatched","thumbnail","isLandscape","height","value","namespace","isWikiText","isVEAvailable","namespaces","indexOf","args","split","toLowerCase","replace","Thumbnail","HEADING_SELECTOR","EXCLUDE_THUMBNAIL_CLASS_SELECTORS","NOT_SELECTORS","map","excludeSelector","THUMB_SELECTOR","selector","PageHTMLParser","$headings","sectionIndex","filter","eq","$heading","$nextHeading","headingSelector","withNestedChildren","$matchingNodes","addBack","$lead","getLeadSectionElement","$nestedSection","findSectionHeadingByIndex","prevAll","nextAll","nextUntil","$leadSection","$a","notSelector","$lazyImage","URL","legacyTitle","searchParams","pathname","valid","RegExp","data","el","filename","percentDecodeFragment","thumbs","each","thumb","getThumbnail","pageTitle","mapLinkToLanguageObj","node","langname","DELIMITER","autonym","textContent","getAttribute","pop","lang","languages","Array","querySelectorAll","variants","PageList","pages","renderPageImages","style","templatePartials","item","skin","currentPage","eventBus","Skin","page","name","isBorderBox","getLicenseLinks","mobileLicense","message","mobileMsgExists","exists","parseDom","clone","getLicenseMsg","licenseMsg","$licenseLinks","licensePlural","language","convertNumber","$termsLink","parse","description","siblings","prop","getDescription","getFileName","delegateEventSplitter","idCounter","initialize","OO","mixinClass","EventEmitter","prefix","cid","compile","_postInitialize","render","undelegateEvents","skipTemplateRender","replaceWith","delegateEvents","delegate","eventName","listener","undelegate","forEach","$child","defaultParams","formatversion","otherParams","scriptPath","origin","AmcEnableForm","buttonLabel","campaign","toast","createPromoCampaign","amcOutreachDrawer","ACTIONS","onDesktopLink","onHistoryLink","onTalkLink","loadCampaign","returnToTitle","returnToQuery","user","tokens","storage","promoCampaign","mwMessage","mwUtil","csrfToken","postUrl","returntoquery","fields","submit","makeActionIneligible","showOnPageReload","permissions","Title","newFromText","getPrefixedText","edit","pageHTMLParser","actionParams","feature","displayWikibaseDescriptions","search","watchlist","tagline","makeHeader","headingOrView","headerCancel","templateData","hasActions","isHidden","insertAfter","component","savingHeader","saveHeader","saveButtonMessage","formHeader","formHTMLOrView","CANCEL_GLYPH","variant","glyph","assign","error","watch","watched","placeholderClass","queryPlaceholders","root","getElementsByClassName","loadImages","placeholders","Promise","all","placeholder","loadImage","deferred","dataset","image","Image","setAttribute","class","alt","useMap","usemap","cssText","addEventListener","classList","parentNode","replaceChild","src","mwSrc","srcset","mwSrcset","Child","ParentOrPrototype","inheritClass","initClass","ModuleLoader","_register","registry","localRequire","e","define","obj","deprecate","deprecatedId","replacement","log","resp","pageprops","displaytitle","terms","entityterms","pageid","missing","actions","campaignName","campaignActive","userEligible","mwStorage","ACTIONS_TO_STORAGE_KEYS","a","isCampaignActive","validateAction","showIfEligible","isActionEligible","_len","_key","set","makeAllActionsIneligible","storageKey","requestIdleCallback","JSON","notify","remove","warn","stringify","promises","when","escapeSelector","fn","documentElement","getWindow","ctx","source","getSource","partials","partialSource","Mustache","WatchstarGateway","api","getStatuses","ids","titles","getStatusesByID","getStatusesByTitle","then","inprop","pageids","rsp","_unmarshalGetResponse","postStatusesByTitle","unwatch","postWithToken","query","statuses","watchstar","WatchstarPageList","wsGateway","$items","queryUnitializedItems","parsePagesFromItems","getPages","renderItems","isAnon","_","$item","sections","getTitle","_appendWatchstar","appendTo","iconProps","watchButton","watchedButton","WATCH_BUTTON_CLASS","WATCHED_BUTTON_CLASS","WATCH_CLASS","WATCHED_CLASS","activeIcon","$link"],"sourceRoot":""}
\ No newline at end of file
diff --git a/extensions/MobileFrontend/resources/dist/mobile.editor.overlay.js b/extensions/MobileFrontend/resources/dist/mobile.editor.overlay.js
new file mode 100644
index 000000000..07ec2b36f
--- /dev/null
+++ b/extensions/MobileFrontend/resources/dist/mobile.editor.overlay.js
@@ -0,0 +1,2 @@
+(self.webpackChunkmfModules=self.webpackChunkmfModules||[]).push([[238],{"./src/mobile.editor.overlay/BlockMessageDetails.js":(e,t,i)=>{"use strict";function o(e){return o="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},o(e)}function n(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,r(o.key),o)}}function r(e){var t=function(e){if("object"!=o(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=o(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==o(t)?t:t+""}function a(e,t,i){return t=l(t),function(e,t){if(t&&("object"==o(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,s()?Reflect.construct(t,i||[],l(e).constructor):t.apply(e,i))}function s(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(s=function(){return!!e})()}function l(e){return l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},l(e)}function c(e,t){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},c(e,t)}var d=i("./src/mobile.startup/Button.js"),h=i("./src/mobile.startup/View.js"),u=i("./src/mobile.startup/Icon.js"),m=i("./src/mobile.startup/util.js"),p=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&c(e,t)}(t,e),i=t,(o=[{key:"isTemplateMode",get:function(){return!0}},{key:"defaults",get:function(){return{createDetailsAnchorHref:function(){return function(e,t){return mw.util.getUrl("Special:BlockList",{wpTarget:"#"+t(e)})}},createDetailsAnchorLabel:function(){return mw.msg("mobile-frontend-editor-blocked-drawer-help")},createTitle:function(){var e="mobile-frontend-editor-blocked-drawer-title";return mw.user.isAnon()&&(e+="-ip"),this.partial&&(e+="-partial"),mw.msg(e)},createBody:function(){var e="";return mw.user.isAnon()&&this.anonOnly?(e="mobile-frontend-editor-blocked-drawer-body",this.noCreateAccount?e+="-login":e+="-login-createaccount",this.partial&&(e+="-partial")):this.partial&&(e="mobile-frontend-editor-blocked-drawer-body-partial"),e?mw.msg(e):e},seeMoreLink:mw.msg("mobile-frontend-editor-blocked-drawer-body-link"),reasonHeader:mw.msg("mobile-frontend-editor-blocked-drawer-reason-header"),creatorHeader:function(){return mw.msg("mobile-frontend-editor-blocked-drawer-creator-header",mw.user.options.get("gender"))},expiryHeader:mw.msg("mobile-frontend-editor-blocked-drawer-expiry-header")}}},{key:"getButtonConfig",value:function(){var e=!0,t={progressive:!0},i=mw.config.get("wgDBname");return mw.user.isAnon()&&this.options.anonOnly?(t.label=mw.msg("mobile-frontend-editor-blocked-drawer-action-login"),t.href=new mw.Title("Special:UserLogin").getUrl()):this.options.partial?(t.label=mw.msg("mobile-frontend-editor-blocked-drawer-action-randompage"),t.href=new mw.Title("Special:Random").getUrl(),t.quiet=!0):(t.tagName="button",t.label=mw.msg("mobile-frontend-editor-blocked-drawer-action-ok"),t.additionalClassNames="cancel",e=!1),e&&mw.config.get("wgMFTrackBlockNotices")&&(mw.track("counter.MediaWiki.BlockNotices."+i+".MobileFrontend.ctaShown",1),t.events={click:function(){mw.track("counter.MediaWiki.BlockNotices."+i+".MobileFrontend.ctaClicked",1)}}),t}},{key:"postRender",value:function(){var e=this;this.$el.find(".block-message-buttons").prepend(new d(this.getButtonConfig()).$el),this.$el.find(".block-message-icon").prepend(new u({icon:"block-destructive"}).$el),this.options.parsedReason.then((function(t){e.$el.find(".block-message-reason div").html(t)}))}},{key:"template",get:function(){return m.template('\n<div class="block-message block-message-container">\n <div class="block-message-icon"></div>\n <div class="block-message-info">\n <div class="block-message-item block-message-title">\n <h5>{{ createTitle }}</h5>\n </div>\n <div class="block-message-data">\n <div class="block-message-item">\n <p>\n {{ createBody }}\n <a class ="block-message-see-more" href="#">{{ seeMoreLink }}</a>\n </p>\n </div>\n <div class="block-message-item block-message-creator">\n {{#creator.name}}\n <p>\n {{ creatorHeader }}\n <strong>\n {{#creator.url}}\n <a href="{{ creator.url }}">{{ creator.name }}</a>\n {{/creator.url}}\n {{^creator.url}}\n {{ creator.name }}\n {{/creator.url}}\n </strong>\n </p>\n {{/creator.name}}\n </div>\n {{#duration}}\n <div class="block-message-item">\n <p>\n {{ expiryHeader }}\n <strong>{{ duration }}</strong>\n </p>\n </div>\n {{/duration}}\n {{#blockId}}\n <div class="block-message-item">\n <a href="{{#createDetailsAnchorHref}}{{ blockId }}{{/createDetailsAnchorHref}}">\n {{ createDetailsAnchorLabel }}\n </a>\n </div>\n {{/blockId}}\n </div>\n </div>\n {{#reason}}\n <div class="block-message-item block-message-reason">\n <h5>{{ reasonHeader }}</h5>\n <div><p>{{{ reason }}}</p></div>\n </div>\n {{/reason}}\n <div class="block-message-buttons">\n </div>\n</div>')}}])&&n(i.prototype,o),Object.defineProperty(i,"prototype",{writable:!1}),i;var i,o}(h);e.exports=p},"./src/mobile.editor.overlay/EditorGateway.js":(e,t,i)=>{var o=i("./src/mobile.startup/util.js"),n=i("./src/mobile.startup/actionParams.js");function r(e){this.api=e.api,this.title=e.title,this.sectionId=e.sectionId,this.oldId=e.oldId,this.preload=e.preload,this.preloadparams=e.preloadparams,this.editintro=e.editintro,this.content=void 0,this.fromModified=e.fromModified,this.hasChanged=e.fromModified}r.prototype={getBlockInfo:function(e){var t;return e.actions&&e.actions.edit&&Array.isArray(e.actions.edit)&&(e.actions.edit.some((function(e){return-1!==["blocked","autoblocked"].indexOf(e.code)&&(t=e,!0)})),t&&t.data&&t.data.blockinfo)?t.data.blockinfo:null},getContent:function(){var e,t=this;function i(){return o.Deferred().resolve({text:t.content||"",blockinfo:t.blockinfo,notices:t.notices})}return void 0!==this.content?i():(e=n({prop:["revisions","info"],rvprop:["content","timestamp"],inprop:["preloadcontent","editintro"],inpreloadcustom:t.preload,inpreloadparams:t.preloadparams,ineditintrocustom:t.editintro,titles:t.title,intestactions:"edit",intestactionsautocreate:!0,intestactionsdetail:"full"}),this.oldId&&(e.rvstartid=this.oldId),this.sectionId&&(e.rvsection=this.sectionId),this.api.get(e).then((function(e){if(e.error)return o.Deferred().reject(e.error.code);var n=e.query.pages[0];if(void 0!==n.missing)n.preloadcontent?(t.content=n.preloadcontent.content,t.hasChanged=!n.preloadisdefault):t.content="";else{var r=n.revisions[0];t.content=r.content,t.timestamp=r.timestamp}return t.originalContent=t.content,t.blockinfo=t.getBlockInfo(n),t.wouldautocreate=n.wouldautocreate&&n.wouldautocreate.edit,t.notices=n.editintro,i()})))},setContent:function(e){this.originalContent!==e||this.fromModified?this.hasChanged=!0:this.hasChanged=!1,this.content=e},save:function(e){var t,i=this,n=o.Deferred();return e=e||{},t={action:"edit",errorformat:"html",errorlang:mw.config.get("wgUserLanguage"),errorsuselocal:1,formatversion:2,title:i.title,summary:e.summary,captchaid:e.captchaId,captchaword:e.captchaWord,basetimestamp:i.timestamp,starttimestamp:i.timestamp},void 0!==i.content&&(t.text=i.content),i.sectionId&&(t.section=i.sectionId),i.api.postWithToken("csrf",t).then((function(e){e&&e.edit&&"Success"===e.edit.result?(i.hasChanged=!1,n.resolve(e.edit.newrevid,e.edit.tempusercreatedredirect,e.edit.tempusercreated)):n.reject(e)}),(function(e,t){n.reject(t)})),n},abortPreview:function(){this._pending&&this._pending.abort()},getPreview:function(e){var t="",i="",n=this;return o.extend(e,{action:"parse",sectionpreview:!0,disableeditsection:!0,pst:!0,mobileformat:!0,useskin:mw.config.get("skin"),disabletoc:!0,title:this.title,prop:["text","sections"]}),this.abortPreview(),mw.user.acquireTempUserName().then((function(){return n._pending=n.api.post(e),n._pending})).then((function(e){return e&&e.parse&&e.parse.text?(n.sectionId&&"0"!==n.sectionId&&void 0!==e.parse.sections&&void 0!==e.parse.sections[0]&&(void 0!==e.parse.sections[0].anchor&&(i=e.parse.sections[0].anchor),void 0!==e.parse.sections[0].line&&(t=e.parse.sections[0].line)),{text:e.parse.text["*"],id:i,line:t}):o.Deferred().reject()})).promise({abort:function(){n._pending.abort()}})}},e.exports=r},"./src/mobile.editor.overlay/EditorOverlayBase.js":(e,t,i)=>{var o=i("./src/mobile.startup/Overlay.js"),n=i("./src/mobile.startup/util.js"),r=i("./src/mobile.editor.overlay/parseBlockInfo.js"),a=i("./src/mobile.startup/headers.js"),s=i("./src/mobile.startup/icons.js"),l=i("./src/mobile.startup/Button.js"),c=i("./src/mobile.startup/IconButton.js"),d=i("./src/mobile.startup/mfExtend.js"),h=i("./src/mobile.editor.overlay/blockMessageDrawer.js"),u=i("./src/mobile.startup/MessageBox.js"),m=mw.user;function p(e,t){(t=t||{}).classes=["visual-editor"],p.super.call(this,e,t)}function g(e){var t=n.extend(!0,{onBeforeExit:this.onBeforeExit.bind(this),className:"overlay editor-overlay",isBorderBox:!1},e,{events:n.extend({"click .back":"onClickBack","click .continue":"onClickContinue","click .submit":"onClickSubmit","click .anonymous":"onClickAnonymous"},e.events)});t.isNewPage&&(t.placeholder=mw.msg("mobile-frontend-editor-placeholder-new-page",m)),0!==mw.config.get("wgNamespaceNumber")&&(t.summaryRequestMsg=mw.msg("mobile-frontend-editor-summary")),this.isNewPage=t.isNewPage,this.sectionId=t.sectionId,this.overlayManager=t.overlayManager,o.call(this,t)}OO.inheritClass(p,OO.ui.Tool),p.static.name="editVe",p.static.icon="edit",p.static.group="editorSwitcher",p.static.title=mw.msg("mobile-frontend-editor-switch-visual-editor"),p.prototype.onSelect=function(){},p.prototype.onUpdateState=function(){},d(g,o,{defaults:n.extend({},o.prototype.defaults,{hasToolbar:!1,continueMsg:mw.msg("mobile-frontend-editor-continue"),closeMsg:mw.msg("mobile-frontend-editor-keep-editing"),summaryRequestMsg:mw.msg("mobile-frontend-editor-summary-request"),summaryMsg:mw.msg("mobile-frontend-editor-summary-placeholder"),placeholder:mw.msg("mobile-frontend-editor-placeholder"),captchaMsg:mw.msg("mobile-frontend-account-create-captcha-placeholder"),captchaTryAgainMsg:mw.msg("mobile-frontend-editor-captcha-try-again"),switchMsg:mw.msg("mobile-frontend-editor-switch-editor"),confirmMsg:mw.msg("mobile-frontend-editor-cancel-confirm"),licenseMsg:void 0}),template:n.template('\n<div class="overlay-header-container header-container position-fixed"></div>\n\n<div class="overlay-content">\n\t<div class="panels">\n\t\t<div class="save-panel panel hideable hidden">\n\t\t\t<div id="error-notice-container"></div>\n\t\t\t<h2 class="summary-request">{{{summaryRequestMsg}}}</h2>\n\t\t\t<div class="summary-input"></div>\n\t\t\t{{#licenseMsg}}<div class="license">{{{licenseMsg}}}</div>{{/licenseMsg}}\n\t\t</div>\n\t\t<div class="captcha-panel panel hideable hidden">\n\t\t\t<div class="captcha-box">\n\t\t\t\t<img id="image" src="">\n\t\t\t\t<div id="question"></div>\n\t\t\t\t<div class="cdx-text-input">\n\t\t\t\t\t<input class="captcha-word cdx-text-input__input" placeholder="{{captchaMsg}}" />\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\t{{>content}}\n</div>\n<div class="overlay-footer-container position-fixed">\n\t{{>footer}}\n</div>\n\t'),sectionId:"",log:function(e){mw.track("editAttemptStep",n.extend(e,{editor_interface:this.editor}))},logFeatureUse:function(e){mw.track("visualEditorFeatureUse",n.extend(e,{editor_interface:this.editor}))},confirmSave:function(){return!(this.isNewPage&&!window.confirm(mw.msg("mobile-frontend-editor-new-page-confirm",m)))},onSaveComplete:function(e,t,i){var o,n=this;this.saved=!0,e&&(o=n.isNewPage?"created":n.options.oldId?"restored":"saved",n.showSaveCompleteMsg(o,i)),this.log({action:"saveSuccess",revision_id:e}),i&&t||setTimeout((function(){t?window.location.href=t:n.sectionId?window.location.hash="#"+n.sectionId:window.location.hash="#"}))},showSaveCompleteMsg:function(e,t){require("mediawiki.action.view.postEdit").fireHook(e,t)},onSaveFailure:function(e){var t=e&&e.errors&&e.errors[0]&&e.errors[0].code;e.edit&&e.edit.captcha&&(t="captcha"),this.log({action:"saveFailure",message:t,type:{badtoken:"userBadToken",assertanonfailed:"userNewUser",assertuserfailed:"userNewUser",assertnameduserfailed:"userNewUser","abusefilter-disallowed":"extensionAbuseFilter","abusefilter-warning":"extensionAbuseFilter",captcha:"extensionCaptcha",spamblacklist:"extensionSpamBlacklist","titleblacklist-forbidden":"extensionTitleBlacklist",pagedeleted:"editPageDeleted",editconflict:"editConflict"}[t]||"responseUnknown"})},reportError:function(e){var t=new u({type:"error",msg:e,heading:mw.msg("mobile-frontend-editor-error")});this.$errorNoticeContainer.html(t.$el)},hideErrorNotice:function(){this.$errorNoticeContainer.empty()},onStageChanges:function(){this.showHidden(".save-header, .save-panel"),this.hideErrorNotice(),this.log({action:"saveIntent"}),window.scrollTo(0,1)},onSaveBegin:function(){this.confirmAborted=!1,this.hideErrorNotice(),this.confirmSave()?this.log({action:"saveAttempt"}):this.confirmAborted=!0},preRender:function(){var e=this.options;this.options.headers=[a.formHeader(n.template('\n{{^hasToolbar}}\n<div class="overlay-title">\n\t<h2>{{{editingMsg}}}</h2>\n</div>\n{{/hasToolbar}}\n{{#hasToolbar}}<div class="toolbar"></div>{{/hasToolbar}}\n{{#editSwitcher}}\n\t<div class="switcher-container">\n\t</div>\n{{/editSwitcher}}\n\t\t\t\t').render({hasToolbar:e.hasToolbar,editSwitcher:e.editSwitcher,editingMsg:e.editingMsg}),e.readOnly?[]:[new c({tagName:"button",action:"progressive",weight:"primary",icon:"next-invert",additionalClassNames:"continue",disabled:!0,title:e.continueMsg})],s.cancel(),"initial-header"),a.saveHeader(e.previewingMsg,"save-header hidden"),a.savingHeader(mw.msg("mobile-frontend-editor-wait"))]},postRender:function(){this.$errorNoticeContainer=this.$el.find("#error-notice-container"),o.prototype.postRender.apply(this),this.showHidden(".initial-header")},show:function(){var e=this;this.allowCloseWindow=mw.confirmCloseWindow({test:function(){return e.hasChanged()},message:mw.msg("mobile-frontend-editor-cancel-confirm"),namespace:"editwarning"}),this.saved=!1,o.prototype.show.call(this),mw.hook("mobileFrontend.editorOpened").fire(this.editor)},onClickBack:function(){},onClickSubmit:function(){this.onSaveBegin()},onClickContinue:function(){this.onStageChanges()},onClickAnonymous:function(){},onBeforeExit:function(e,t){var i=this;if(this.hasChanged()&&!this.switching)return this.windowManager||(this.windowManager=OO.ui.getWindowManager(),this.windowManager.addWindows([new mw.widgets.AbandonEditDialog])),this.windowManager.openWindow("abandonedit").closed.then((function(t){t&&"discard"===t.action&&(i.log({action:"abort",mechanism:"cancel",type:"abandon"}),i.onExit(),e())})),void t();this.switching||this.saved||this.log({action:"abort",mechanism:"cancel",type:this.target&&this.target.edited?"abandon":"nochange"}),this.onExit(),e(),"edit"===mw.config.get("wgAction")&&setTimeout((function(){mw.util.getParamValue("veaction")||mw.util.getParamValue("action")?location.href=mw.util.getUrl():location.reload()}),100)},onExit:function(){this.allowCloseWindow&&this.allowCloseWindow.release(),mw.hook("mobileFrontend.editorClosed").fire()},createAnonWarning:function(e){var t=$("<div>").addClass("actions"),i=require("./contLangMessages.json"),o=this.gateway.wouldautocreate?"mobile-frontend-editor-autocreatewarning":"mobile-frontend-editor-anonwarning",r=$("<div>").addClass("anonwarning content").append(new u({type:"notice",className:"anon-msg",msg:mw.message(o,i["tempuser-helppage"]).parse()}).$el,t),a=n.extend({returnto:e.returnTo||mw.config.get("wgPageName")+"#/editor/"+(e.sectionId||"all"),warning:"mobile-frontend-edit-login-action"},e.queryParams),s=n.extend({type:"signup",warning:"mobile-frontend-edit-signup-action"},e.signupQueryParams),c=[new l({label:mw.msg("mobile-frontend-editor-anon"),block:!0,additionalClassNames:"anonymous progressive",progressive:!0}),new l({block:!0,href:mw.util.getUrl("Special:UserLogin",a),label:mw.msg("mobile-frontend-watchlist-cta-button-login")}),new l({block:!0,href:mw.util.getUrl("Special:UserLogin",n.extend(a,s)),label:mw.msg("mobile-frontend-watchlist-cta-button-signup")})];return t.append(c.map((function(e){return e.$el}))),r},createAnonTalkWarning:function(){return $(".minerva-anon-talk-message").clone()},getOptionsForSwitch:function(){return{switched:!0,overlayManager:this.options.overlayManager,currentPageHTMLParser:this.options.currentPageHTMLParser,fakeScroll:this.options.fakeScroll,api:this.options.api,licenseMsg:this.options.licenseMsg,title:this.options.title,titleObj:this.options.titleObj,isAnon:this.options.isAnon,isNewPage:this.options.isNewPage,oldId:this.options.oldId,contentLang:this.options.contentLang,contentDir:this.options.contentDir,sectionId:this.options.sectionId}},hasChanged:function(){},getLoadingPromise:function(){return this.dataPromise.then((function(e){if(e&&e.blockinfo){var t=r(e.blockinfo),i=h(t);return n.Deferred().reject(i)}return e}))},showEditNotices:function(){var e=this;mw.config.get("wgMFEditNoticesFeatureConflict")||this.getLoadingPromise().then((function(t){if(t.notices){var i=Object.keys(t.notices).filter((function(e){if(0!==e.indexOf("editnotice"))return!1;if("editnotice-notext"===e)return!1;var t="mf-editnotices/"+mw.config.get("wgPageName")+"#"+e;return!mw.storage.get(t)&&(mw.storage.set(t,"1",86400),!0)}));i.length&&mw.loader.using("oojs-ui-windows").then((function(){var o=$("<div>").addClass("editor-overlay-editNotices");i.forEach((function(e){var i=$("<div>").append(t.notices[e]);i.addClass("editor-overlay-editNotice"),o.append(i)})),OO.ui.alert(o),e.logFeatureUse({feature:"notices",action:"show"})}))}}))},handleCaptcha:function(e){var t=this,i=this.$el.find(".captcha-word");this.captchaShown&&(i.val(""),i.attr("placeholder",this.options.captchaTryAgainMsg),setTimeout((function(){i.attr("placeholder",t.options.captchaMsg)}),2e3)),0===e.mime.indexOf("image/")?(this.$el.find(".captcha-panel#question").detach(),this.$el.find(".captcha-panel img").attr("src",e.url)):(this.$el.find(".captcha-panel #image").detach(),0===e.mime.indexOf("text/html")?this.$el.find(".captcha-panel #question").html(e.question):this.$el.find(".captcha-panel #question").text(e.question)),this.showHidden(".save-header, .captcha-panel"),this.captchaShown=!0}}),e.exports=g},"./src/mobile.editor.overlay/SourceEditorOverlay.js":(e,t,i)=>{var o=i("./src/mobile.editor.overlay/EditorOverlayBase.js"),n=i("./src/mobile.startup/util.js"),r=i("./src/mobile.startup/icons.js"),a=i("./src/mobile.startup/Section.js"),s=i("./src/mobile.editor.overlay/saveFailureMessage.js"),l=i("./src/mobile.editor.overlay/EditorGateway.js"),c=i("./src/mobile.init/fakeToolbar.js"),d=i("./src/mobile.startup/MessageBox.js"),h=i("./src/mobile.startup/mfExtend.js"),u=i("./src/mobile.editor.overlay/setPreferredEditor.js"),m=i("./src/mobile.editor.overlay/VisualEditorOverlay.js"),p=i("./src/mobile.startup/currentPage.js");function g(e,t){this.isFirefox=/firefox/i.test(window.navigator.userAgent),this.gateway=new l({api:e.api,title:e.title,sectionId:e.sectionId,oldId:e.oldId,fromModified:!!t,preload:e.preload,preloadparams:e.preloadparams,editintro:e.editintro}),this.readOnly=!!e.oldId,this.dataPromise=t||this.gateway.getContent(),this.currentPage=p(),this.currentPage.isVEVisualAvailable()&&(e.editSwitcher=!0),this.readOnly?(e.readOnly=!0,e.editingMsg=mw.msg("mobile-frontend-editor-viewing-source-page",e.title)):e.editingMsg=mw.msg("mobile-frontend-editor-editing-page",e.title),e.previewingMsg=mw.msg("mobile-frontend-editor-previewing-page",e.title),o.call(this,n.extend(!0,{events:{"input .wikitext-editor":"onInputWikitextEditor"}},e))}h(g,o,{templatePartials:n.extend({},o.prototype.templatePartials,{content:n.template('\n<div lang="{{contentLang}}" dir="{{contentDir}}" class="editor-container content">\n\t<textarea class="wikitext-editor" id="wikitext-editor" cols="40" rows="10" placeholder="{{placeholder}}"></textarea>\n\t<div class="preview collapsible-headings-expanded mw-body-content"></div>\n</div>\n\t\t')}),editor:"wikitext",sectionLine:"",show:function(){o.prototype.show.apply(this,arguments),this._resizeEditor()},onInputWikitextEditor:function(){this.gateway.setContent(this.$el.find(".wikitext-editor").val()),this.$el.find(".continue, .submit").prop("disabled",!1)},onClickBack:function(){o.prototype.onClickBack.apply(this,arguments),this._hidePreview()},postRender:function(){var e=this;this.log({action:"ready"}),this.log({action:"loaded"}),this.currentPage.isVEVisualAvailable()&&mw.loader.using("ext.visualEditor.switching").then((function(){var t=new OO.ui.ToolFactory,i=new OO.ui.ToolGroupFactory;t.register(mw.libs.ve.MWEditModeVisualTool),t.register(mw.libs.ve.MWEditModeSourceTool);var o=new OO.ui.Toolbar(t,i,{classes:["editor-switcher"]});o.on("switchEditor",(function(t){"visual"===t&&(e.gateway.hasChanged?e._switchToVisualEditor(e.gateway.content):e._switchToVisualEditor())})),o.setup([{name:"editMode",type:"list",icon:"edit",title:mw.msg("visualeditor-mweditmode-tooltip"),include:["editModeVisual","editModeSource"]}]),e.$el.find(".switcher-container").html(o.$element),o.emit("updateState")})),o.prototype.postRender.apply(this),this.$el.find(".overlay-content").append(r.spinner().$el),this.hideSpinner(),this.$preview=this.$el.find(".preview"),this.$content=this.$el.find(".wikitext-editor"),this.$content.addClass("mw-editfont-"+mw.user.options.get("editfont")),this.$el.find(".license a").attr("target","_blank"),this.readOnly&&this.$content.prop("readonly",!0),this.$content.on("input",this._resizeEditor.bind(this)).one("input",(function(){e.log({action:"firstChange"})})),this.isFirefox&&this.$content.on("mousedown",(function(){var e=document.documentElement,t=e.scrollTop;function i(){e.scrollTop=t}window.addEventListener("scroll",i),setTimeout((function(){window.removeEventListener("scroll",i)}),1e3)})),this.summaryTextArea=new OO.ui.MultilineTextInputWidget({placeholder:this.options.summaryMsg,classes:["summary"],value:"",maxRows:2}),this.$el.find(".summary-input").append(this.summaryTextArea.$element),this._loadContent()},onClickAnonymous:function(){this.$anonWarning.hide(),this.$anonTalkWarning.hide(),this.$anonHiddenButtons.show(),this.$content.show(),this._resizeEditor()},onStageChanges:function(){var e=this,t={text:this.getContent()};function i(){e.hideSpinner(),e.$preview.show(),mw.hook("wikipage.content").fire(e.$preview)}this.scrollTop=n.getDocument().find("body").scrollTop(),this.$content.hide(),this.showSpinner(),mw.config.get("wgIsMainPage")&&(t.mainpage=1),this.gateway.getPreview(t).then((function(t){var o=t.text,n=t.line;e.sectionId=t.id,e.sectionLine=e.parseHTML("<div>").html(n).text(),new a({el:e.$preview,text:o}).$el.find("a").on("click",!1),i()}),(function(){e.$preview.replaceWith(new d({type:"error",msg:mw.msg("mobile-frontend-editor-error-preview")}).$el),i()})),o.prototype.onStageChanges.apply(this,arguments)},_hidePreview:function(){this.gateway.abortPreview(),this.hideSpinner(),this.$preview.removeClass("cdx-message--error").hide(),this.$content.show(),window.scrollTo(0,this.scrollTop),this.showHidden(".initial-header")},_resizeEditor:function(){var e,t,i;this.$scrollContainer?i=this.$scrollContainer:(t=OO.ui.Element.static.getClosestScrollableContainer(this.$content[0]),i=this.$el.find(t).length?this.$el.find(t):n.getDocument(),this.$scrollContainer=i,this.$content.css("padding-bottom",.6*this.$scrollContainer.height())),this.$content.prop("scrollHeight")&&i.length&&(e=i.scrollTop(),this.$content.css("height","auto").css("height",this.$content.prop("scrollHeight")+2+"px"),i.scrollTop(e))},setContent:function(e){this.$content.show().val(e),this._resizeEditor()},getContent:function(){return this.$content.val()},_loadContent:function(){var e=this;this.$content.hide(),this.getLoadingPromise().then((function(t){var i=t.text;e.setContent(i),e.hasChanged()&&e.$el.find(".continue, .submit").prop("disabled",!1);var o=e.options;o.isAnon&&!o.switched&&(e.$anonWarning=e.createAnonWarning(o),e.$anonTalkWarning=e.createAnonTalkWarning(),e.$el.find(".editor-container").append([e.$anonTalkWarning,e.$anonWarning]),e.$content.hide(),e.$anonHiddenButtons=e.$el.find(".overlay-header .continue").hide()),e.gateway.fromModified&&e.onInputWikitextEditor(),e.showEditNotices()}))},_switchToVisualEditor:function(e){var t=this;this.log({action:"abort",type:"switchnochange",mechanism:"navigate"}),this.logFeatureUse({feature:"editor-switch",action:"visual-mobile"}),u("VisualEditor"),this.$el.addClass("switching"),this.$el.find(".overlay-header-container").hide(),this.$el.append(c()),this.$content.prop("readonly",!0),mw.loader.using("ext.visualEditor.targetLoader").then((function(){return mw.libs.ve.targetLoader.addPlugin("ext.visualEditor.mobileArticleTarget"),mw.libs.ve.targetLoader.loadModules("visual")})).then((function(){var i=t.getOptionsForSwitch();i.SourceEditorOverlay=g,e?i.dataPromise=mw.libs.ve.targetLoader.requestPageData("visual",mw.config.get("wgRelevantPageName"),{section:i.sectionId,oldId:i.oldId||mw.config.get("wgRevisionId"),targetName:"mobile",modified:!0,wikitext:e}):delete i.dataPromise;var o=new m(i);o.getLoadingPromise().then((function(){t.switching=!0,t.overlayManager.replaceCurrent(o),t.switching=!1}))}),(function(){t.$el.removeClass("switching"),t.$el.find(".overlay-header-container").show(),t.$el.find(".ve-mobile-fakeToolbar-container").remove(),t.$content.prop("readonly",!1)}))},getEditSummary:function(){return this.summaryTextArea.getValue()},onSaveBegin:function(){var e=this,t={summary:this.getEditSummary()};""!==e.sectionLine&&(t.summary="/* "+e.sectionLine+" */"+t.summary),o.prototype.onSaveBegin.apply(this,arguments),this.confirmAborted||(this.captchaId&&(t.captchaId=this.captchaId,t.captchaWord=this.$el.find(".captcha-word").val()),this.showHidden(".saving-header"),this.gateway.save(t).then((function(t,i,o){var n=e.options.title;!mw.config.get("wgIsMainPage")||i?(e.onSaveComplete(t,i,o),i&&o&&(window.location.href=i)):window.location=mw.util.getUrl(n)}),(function(t){e.onSaveFailure(t)})))},onSaveComplete:function(e,t){o.prototype.onSaveComplete.apply(this,arguments),setTimeout((function(){if(t)window.location.href=t;else if(e){var i=new URL(location.href);i.searchParams.set("mfnotify",this.isNewPage?"created":"saved"),window.location.search=i.search}else window.location.reload()}))},showSaveCompleteMsg:function(e,t){require("mediawiki.action.view.postEdit").fireHookOnPageReload(e,t)},onSaveFailure:function(e){var t;e.edit&&e.edit.captcha?(this.captchaId=e.edit.captcha.id,this.handleCaptcha(e.edit.captcha)):(t=s(e),this.reportError(t),this.showHidden(".save-header, .save-panel"),e.errors&&e.errors.some((function(e){return"abusefilter-disallowed"===e.code}))&&this.$el.find(".continue, .submit").prop("disabled",!0)),o.prototype.onSaveFailure.apply(this,arguments)},hasChanged:function(){return this.gateway.hasChanged}}),e.exports=g},"./src/mobile.editor.overlay/VisualEditorOverlay.js":(e,t,i)=>{var o=i("./src/mobile.editor.overlay/EditorOverlayBase.js"),n=i("./src/mobile.editor.overlay/EditorGateway.js"),r=i("./src/mobile.init/fakeToolbar.js"),a=i("./src/mobile.startup/mfExtend.js"),s=require("mediawiki.router"),l=i("./src/mobile.editor.overlay/identifyLeadParagraph.js"),c=i("./src/mobile.editor.overlay/setPreferredEditor.js"),d=i("./src/mobile.startup/util.js"),h=i("./src/mobile.startup/OverlayManager.js").getSingleton(),u=i("./src/mobile.startup/currentPage.js");function m(e){var t=d.Deferred();o.call(this,d.extend({editSwitcher:!1,hasToolbar:!0,onBeforeExit:this.onBeforeExit.bind(this),isBorderBox:!1,className:"overlay editor-overlay editor-overlay-ve"},e)),this.SourceEditorOverlay=e.SourceEditorOverlay,this.isNewPage=e.isNewPage,this.fromModified=e.dataPromise&&e.switched,this.$el.addClass("editor-overlay-ve-initializing"),h.container.appendChild(this.$el[0]),this.gateway=new n({api:e.api,title:e.title,sectionId:e.sectionId,oldId:e.oldId}),this.origDataPromise=this.options.dataPromise||mw.libs.ve.targetLoader.requestPageData("visual",e.titleObj.getPrefixedDb(),{sessionStore:!0,section:e.sectionId||null,oldId:e.oldId||void 0,targetName:ve.init.mw.MobileArticleTarget.static.trackingName,preload:e.preload,preloadparams:e.preloadparams,editintro:e.editintro});var i=[];this.currentPage=u(),this.currentPage.isVEVisualAvailable()&&i.push("visual"),this.currentPage.isVESourceAvailable()&&i.push("source"),this.target=ve.init.mw.targetFactory.create("article",this,{$element:this.$el,section:this.options.sectionId||null,modes:i,defaultMode:"source"===this.options.mode?"source":"visual"}),this.target.once("surfaceReady",function(){t.resolve(),this.target.getSurface().getModel().getDocument().once("transact",function(){this.log({action:"firstChange"})}.bind(this))}.bind(this));var r=!0;this.target.on("surfaceReady",function(){c("source"===this.target.getDefaultMode()?"SourceEditor":"VisualEditor"),r||this.targetInit(),r=!1}.bind(this)),this.target.load(this.origDataPromise),this.dataPromise=this.origDataPromise.then(function(e){return this.gateway.wouldautocreate=e&&e.visualeditor&&e.visualeditor.wouldautocreate,t.then(function(){return this.$el.removeClass("editor-overlay-ve-initializing"),e&&e.visualeditor}.bind(this))}.bind(this))}a(m,o,{templatePartials:d.extend({},o.prototype.templatePartials,{editHeader:d.template('\n<div class="overlay-header header initial-header hideable hidden">\n\t<div class="toolbar"></div>\n</div>\n\t\t'),content:d.template('\n<div class="surface" lang="{{contentLang}}" dir="{{contentDir}}">\n</div>\n\t\t')}),editor:"visualeditor",destroyTarget:function(){this.target&&(this.target.destroy(),this.target=null)},show:function(){var e=this.options,t=e.isAnon&&!e.switched;o.prototype.show.apply(this,arguments),this.log({action:"ready"}),this.log({action:"loaded"}),t?(this.$anonWarning=this.createAnonWarning(this.options),this.$anonTalkWarning=this.createAnonTalkWarning(),this.$el.append([this.$anonTalkWarning,this.$anonWarning]),this.$el.find(".overlay-content").hide()):this.targetInit(),this.emit("editor-loaded")},targetInit:function(){this.target&&(this.target.afterSurfaceReady(),this.scrollToLeadParagraph(),this.showEditNotices())},scrollToLeadParagraph:function(){var e,t,i,o,n,r=this.options.currentPageHTMLParser,a=this.options.fakeScroll,s=$(window),c=this.target.section,d=this.target.getSurface(),h=d.getMode();null!==c&&"0"!==c||"visual"!==h||(e=l(d.getView().$attachedRootNode),r.getLeadSectionElement()&&(i=l(r.getLeadSectionElement())),e&&i&&(o=$(e).offset().top-($(i).offset().top-a),(t=$(e).data("view"))&&(d.getModel().setLinearSelection(new ve.Range(t.getModel().getRange().start)),n=d.getView().getSelection().getSelectionBoundingRect().top,d.$element.css("min-height",s.height()+n-d.padding.top)),s.scrollTop(o)))},onBeforeExit:function(e,t){var i=this;o.prototype.onBeforeExit.call(this,(function(){e(),i.destroyTarget()}),t)},onClickBack:function(){o.prototype.onClickBack.apply(this,arguments),this.switchToEditor()},onClickAnonymous:function(){this.$anonWarning.hide(),this.$anonTalkWarning.hide(),this.$el.find(".overlay-content").show(),this.targetInit()},switchToEditor:function(){this.showHidden(".initial-header")},switchToSourceEditor:function(e){var t=this,i=this.SourceEditorOverlay,o=this.getOptionsForSwitch();this.log({action:"abort",type:"switchnochange",mechanism:"navigate"}),this.logFeatureUse({feature:"editor-switch",action:"source-mobile"}),c("SourceEditor"),this.$el.addClass("switching"),this.$el.find(".overlay-header-container").hide(),this.$el.append(r()),this.target.getSurface().setReadOnly(!0),e&&(o.sectionId=null,s.navigateTo(document.title,{path:"#/editor/all",useReplaceState:!0}));var n=new i(o,e);n.getLoadingPromise().then((function(){t.switching=!0,t.overlayManager.replaceCurrent(n),t.switching=!1}))},hasChanged:function(){return!this.saved&&(this.fromModified||this.target&&this.target.getSurface()&&this.target.getSurface().getModel().hasBeenModified())}}),e.exports=m},"./src/mobile.editor.overlay/blockMessageDrawer.js":(e,t,i)=>{var o=i("./src/mobile.startup/Drawer.js"),n=i("./src/mobile.editor.overlay/BlockMessageDetails.js");e.exports=function(e){var t=new o({className:"drawer block-message",onBeforeHide:function(e){e.$el.remove()},onShow:function(){var e=t.$el.find(".drawer.block-message"),i=e.offset().top-100,o=t.$el.find(".block-message-creator").offset().top-100,n=t.$el.find(".block-message-buttons").offset().top-100,r=t.$el.find(".block-message-see-more"),a=mw.config.get("wgDBname");e.css("top",i+(n-o)),r.on("click",(function(){var i=t.$el.find(".block-message-container");e.css("top",0),i.css("overflow-y","auto"),i.css("height",n-i.offset().top),r.hide(),mw.config.get("wgMFTrackBlockNotices")&&mw.track("counter.MediaWiki.BlockNotices."+a+".MobileFrontend.reasonShown",1)})),mw.config.get("wgMFTrackBlockNotices")&&mw.track("counter.MediaWiki.BlockNotices."+a+".MobileFrontend.shown",1)},children:[new n(e).$el]});return t}},"./src/mobile.editor.overlay/identifyLeadParagraph.js":e=>{e.exports=function(e){function t(e){e=e.cloneNode(!0);var t=$(e);return!!t.hasClass("ve-ce-focusableNode-invisible")||(t.find(".ve-ce-branchNode-inlineSlug, .ve-ce-focusableNode-invisible, style, span#coordinates").remove(),!function(e){return!/^[\s↵➞]*$/.test(e.textContent)}(e))}for(var i=e.children("p"),o=0;o<i.length;o++){var n=i[o];if(!t(n))return n}return null}},"./src/mobile.editor.overlay/mobile.editor.overlay.js":(e,t,i)=>{var o=i("./src/mobile.startup/moduleLoaderSingleton.js"),n=i("./src/mobile.editor.overlay/SourceEditorOverlay.js"),r=i("./src/mobile.editor.overlay/VisualEditorOverlay.js");o.define("mobile.editor.overlay/SourceEditorOverlay",n),o.define("mobile.editor.overlay/VisualEditorOverlay",r)},"./src/mobile.editor.overlay/parseBlockInfo.js":(e,t,i)=>{var o=i("./src/mobile.startup/util.js");e.exports=function(e){var t={partial:e.blockpartial||!1,noCreateAccount:e.blocknocreate||!1,anonOnly:void 0===e.blockanononly||e.blockanononly,creator:{name:e.blockedby,url:null},expiry:null,duration:null,reason:"",blockId:e.blockid};function i(e){var t=new mw.jqueryMsg.Parser;try{var i=t.wikiTextToAst(e);return t.emitter.emit(i).html()}catch(e){return!1}}0===e.blockedbyid?t.creator.url="":t.creator.url=mw.Title.makeTitle(mw.config.get("wgNamespaceIds").user,t.creator.name).getUrl(),-1===["infinite","indefinite","infinity","never"].indexOf(e.blockexpiry)&&(t.expiry=mw.message("parentheses",e.blockexpiryformatted).escaped(),t.duration=e.blockexpiryrelative);var n=e.blockreason;return n?(t.reason=i(n)||mw.html.escape(n),t.parsedReason=(new mw.Api).get({action:"parse",formatversion:2,text:n,contentmodel:"wikitext"}).then((function(e){return e.parse.text})).catch((function(){return i(n)||mw.html.escape(n)}))):(t.reason=mw.message("mobile-frontend-editor-generic-block-reason").escaped(),t.parsedReason=o.Deferred().resolve(t.reason).promise()),t}},"./src/mobile.editor.overlay/saveFailureMessage.js":e=>{e.exports=function(e){var t=e&&e.errors&&e.errors[0]&&e.errors[0].code;return"editconflict"===t?mw.msg("mobile-frontend-editor-error-conflict"):"readonly"===t?e.errors[0].html+"<br>"+e.errors[0].data.readonlyreason:e.errors&&e.errors[0]?e.errors[0].html:""}},"./src/mobile.editor.overlay/setPreferredEditor.js":e=>{e.exports=function(e){mw.user.isNamed()?(new mw.Api).saveOption("mobile-editor",e).then((function(){mw.user.options.set("mobile-editor",e)})):mw.storage.set("preferredEditor",e)}},"./src/mobile.startup/Section.js":(e,t,i)=>{var o=i("./src/mobile.startup/util.js"),n=i("./src/mobile.startup/mfExtend.js"),r=i("./src/mobile.startup/View.js");function a(e){var t=this;e.tag="h"+e.level,this.line=e.line,this.text=e.text,this.hasReferences=e.hasReferences||!1,this.id=e.id||null,this.anchor=e.anchor,this.subsections=[],(e.subsections||[]).forEach((function(e){return t.subsections.push(new a(e))})),r.call(this,e)}n(a,r,{template:o.template('\n<h{{level}} id="{{anchor}}">{{{line}}}</h{{level}}>\n{{{text}}}\n\t'),defaults:{line:void 0,text:""}}),e.exports=a}},e=>{e.O(0,[569],(()=>e(e.s="./src/mobile.editor.overlay/mobile.editor.overlay.js")));var t=e.O();(this.mfModules=this.mfModules||{})["mobile.editor.overlay"]=t}]);
+//# sourceMappingURL=mobile.editor.overlay.js.map.json
\ No newline at end of file
diff --git a/extensions/MobileFrontend/resources/dist/mobile.editor.overlay.js.map.json b/extensions/MobileFrontend/resources/dist/mobile.editor.overlay.js.map.json
new file mode 100644
index 000000000..0d0612198
--- /dev/null
+++ b/extensions/MobileFrontend/resources/dist/mobile.editor.overlay.js.map.json
@@ -0,0 +1 @@
+{"version":3,"file":"mobile.editor.overlay.js","mappings":"qJAAa,SAAAA,EAAAC,GAAA,OAAAD,EAAA,mBAAAE,QAAA,iBAAAA,OAAAC,SAAA,SAAAF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EAWxBmI,SAAU,CACTlC,UAAMpF,EACNoB,KAAM,MAIRhC,EAAOC,QAAUiR,C","sources":["webpack://mfModules/./src/mobile.editor.overlay/BlockMessageDetails.js","webpack://mfModules/./src/mobile.editor.overlay/EditorGateway.js","webpack://mfModules/./src/mobile.editor.overlay/EditorOverlayBase.js","webpack://mfModules/./src/mobile.editor.overlay/SourceEditorOverlay.js","webpack://mfModules/./src/mobile.editor.overlay/VisualEditorOverlay.js","webpack://mfModules/./src/mobile.editor.overlay/blockMessageDrawer.js","webpack://mfModules/./src/mobile.editor.overlay/identifyLeadParagraph.js","webpack://mfModules/./src/mobile.editor.overlay/mobile.editor.overlay.js","webpack://mfModules/./src/mobile.editor.overlay/parseBlockInfo.js","webpack://mfModules/./src/mobile.editor.overlay/saveFailureMessage.js","webpack://mfModules/./src/mobile.editor.overlay/setPreferredEditor.js","webpack://mfModules/./src/mobile.startup/Section.js"],"sourcesContent":["'use strict';\nconst Button = require( '../mobile.startup/Button' ),\n\tView = require( '../mobile.startup/View' ),\n\tIcon = require( '../mobile.startup/Icon' ),\n\tutil = require( '../mobile.startup/util' );\n\n/**\n * Renders a block message details.\n *\n * @extends module:mobile.startup/View\n * @private\n */\nclass BlockMessageDetails extends View {\n\t/** @inheritdoc */\n\tget isTemplateMode() {\n\t\treturn true;\n\t}\n\n\t/**\n\t * @inheritdoc\n\t */\n\tget defaults() {\n\t\treturn {\n\t\t\tcreateDetailsAnchorHref: function () {\n\t\t\t\treturn function ( blockId, render ) {\n\t\t\t\t\treturn mw.util.getUrl( 'Special:BlockList', { wpTarget: '#' + render( blockId ) } );\n\t\t\t\t};\n\t\t\t},\n\t\t\tcreateDetailsAnchorLabel: function () {\n\t\t\t\treturn mw.msg( 'mobile-frontend-editor-blocked-drawer-help' );\n\t\t\t},\n\t\t\tcreateTitle: function () {\n\t\t\t\tlet msgKey = 'mobile-frontend-editor-blocked-drawer-title';\n\t\t\t\tif ( mw.user.isAnon() ) {\n\t\t\t\t\tmsgKey += '-ip';\n\t\t\t\t}\n\t\t\t\tif ( this.partial ) {\n\t\t\t\t\tmsgKey += '-partial';\n\t\t\t\t}\n\t\t\t\t// The following messages can be passed here:\n\t\t\t\t// * mobile-frontend-editor-blocked-drawer-title\n\t\t\t\t// * mobile-frontend-editor-blocked-drawer-title-partial\n\t\t\t\t// * mobile-frontend-editor-blocked-drawer-title-ip\n\t\t\t\t// * mobile-frontend-editor-blocked-drawer-title-ip-partial\n\t\t\t\treturn mw.msg( msgKey );\n\t\t\t},\n\t\t\tcreateBody: function () {\n\t\t\t\tlet msgKey = '';\n\t\t\t\tif ( mw.user.isAnon() && this.anonOnly ) {\n\t\t\t\t\tmsgKey = 'mobile-frontend-editor-blocked-drawer-body';\n\t\t\t\t\tif ( this.noCreateAccount ) {\n\t\t\t\t\t\tmsgKey += '-login';\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmsgKey += '-login-createaccount';\n\t\t\t\t\t}\n\t\t\t\t\tif ( this.partial ) {\n\t\t\t\t\t\tmsgKey += '-partial';\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif ( this.partial ) {\n\t\t\t\t\t\tmsgKey = 'mobile-frontend-editor-blocked-drawer-body-partial';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// The following messages can be passed here:\n\t\t\t\t// * mobile-frontend-editor-blocked-drawer-body-partial\n\t\t\t\t// * mobile-frontend-editor-blocked-drawer-body-login\n\t\t\t\t// * mobile-frontend-editor-blocked-drawer-body-login-partial\n\t\t\t\t// * mobile-frontend-editor-blocked-drawer-body-login-createaccount\n\t\t\t\t// * mobile-frontend-editor-blocked-drawer-body-login-createaccount-partial\n\t\t\t\treturn msgKey ? mw.msg( msgKey ) : msgKey;\n\t\t\t},\n\t\t\tseeMoreLink: mw.msg( 'mobile-frontend-editor-blocked-drawer-body-link' ),\n\t\t\treasonHeader: mw.msg( 'mobile-frontend-editor-blocked-drawer-reason-header' ),\n\t\t\tcreatorHeader: function () {\n\t\t\t\t// The gender is the subject (the blockee) not the object (the blocker).\n\t\t\t\treturn mw.msg( 'mobile-frontend-editor-blocked-drawer-creator-header',\n\t\t\t\t\tmw.user.options.get( 'gender' ) );\n\t\t\t},\n\t\t\texpiryHeader: mw.msg( 'mobile-frontend-editor-blocked-drawer-expiry-header' )\n\t\t};\n\t}\n\n\t/**\n\t * Configure the call to action depending on the type of block.\n\t *\n\t * @return {Object} Configuration options\n\t */\n\tgetButtonConfig() {\n\t\tlet cta = true;\n\t\tconst config = {\n\t\t\t\tprogressive: true\n\t\t\t},\n\t\t\twiki = mw.config.get( 'wgDBname' );\n\n\t\tif ( mw.user.isAnon() && this.options.anonOnly ) {\n\t\t\t// The user can avoid the block by logging in\n\t\t\tconfig.label = mw.msg( 'mobile-frontend-editor-blocked-drawer-action-login' );\n\t\t\tconfig.href = new mw.Title( 'Special:UserLogin' ).getUrl();\n\t\t} else if ( this.options.partial ) {\n\t\t\t// The user can avoid the block by editing a different page\n\t\t\tconfig.label = mw.msg( 'mobile-frontend-editor-blocked-drawer-action-randompage' );\n\t\t\tconfig.href = new mw.Title( 'Special:Random' ).getUrl();\n\t\t\tconfig.quiet = true;\n\t\t} else {\n\t\t\t// The user cannot avoid the block\n\t\t\tconfig.tagName = 'button';\n\t\t\tconfig.label = mw.msg( 'mobile-frontend-editor-blocked-drawer-action-ok' );\n\t\t\tconfig.additionalClassNames = 'cancel';\n\t\t\tcta = false;\n\t\t}\n\n\t\tif ( cta && mw.config.get( 'wgMFTrackBlockNotices' ) ) {\n\t\t\tmw.track( 'counter.MediaWiki.BlockNotices.' + wiki + '.MobileFrontend.ctaShown', 1 );\n\t\t\tconfig.events = {\n\t\t\t\tclick: function () {\n\t\t\t\t\tmw.track( 'counter.MediaWiki.BlockNotices.' + wiki + '.MobileFrontend.ctaClicked', 1 );\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\n\t\treturn config;\n\t}\n\n\t/**\n\t * @inheritdoc\n\t */\n\tpostRender() {\n\t\tconst drawer = this;\n\t\tthis.$el.find( '.block-message-buttons' ).prepend(\n\t\t\tnew Button( this.getButtonConfig() ).$el\n\t\t);\n\t\tthis.$el.find( '.block-message-icon' ).prepend(\n\t\t\t( new Icon( {\n\t\t\t\ticon: 'block-destructive'\n\t\t\t} ) ).$el\n\t\t);\n\t\tthis.options.parsedReason.then( function ( htmlReason ) {\n\t\t\tdrawer.$el.find( '.block-message-reason div' ).html( htmlReason );\n\t\t} );\n\t}\n\n\t/**\n\t * @inheritdoc\n\t */\n\tget template() {\n\t\treturn util.template( `\n<div class=\"block-message block-message-container\">\n <div class=\"block-message-icon\"></div>\n <div class=\"block-message-info\">\n <div class=\"block-message-item block-message-title\">\n <h5>{{ createTitle }}</h5>\n </div>\n <div class=\"block-message-data\">\n <div class=\"block-message-item\">\n <p>\n {{ createBody }}\n <a class =\"block-message-see-more\" href=\"#\">{{ seeMoreLink }}</a>\n </p>\n </div>\n <div class=\"block-message-item block-message-creator\">\n {{#creator.name}}\n <p>\n {{ creatorHeader }}\n <strong>\n {{#creator.url}}\n <a href=\"{{ creator.url }}\">{{ creator.name }}</a>\n {{/creator.url}}\n {{^creator.url}}\n {{ creator.name }}\n {{/creator.url}}\n </strong>\n </p>\n {{/creator.name}}\n </div>\n {{#duration}}\n <div class=\"block-message-item\">\n <p>\n {{ expiryHeader }}\n <strong>{{ duration }}</strong>\n </p>\n </div>\n {{/duration}}\n {{#blockId}}\n <div class=\"block-message-item\">\n <a href=\"{{#createDetailsAnchorHref}}{{ blockId }}{{/createDetailsAnchorHref}}\">\n {{ createDetailsAnchorLabel }}\n </a>\n </div>\n {{/blockId}}\n </div>\n </div>\n {{#reason}}\n <div class=\"block-message-item block-message-reason\">\n <h5>{{ reasonHeader }}</h5>\n <div><p>{{{ reason }}}</p></div>\n </div>\n {{/reason}}\n <div class=\"block-message-buttons\">\n </div>\n</div>` );\n\t}\n}\n\nmodule.exports = BlockMessageDetails;\n","const util = require( '../mobile.startup/util' ),\n\tactionParams = require( '../mobile.startup/actionParams' );\n\n/**\n * API that helps save and retrieve page content\n *\n * @param {Object} options Configuration options\n * @param {mw.Api} options.api an Api to use.\n * @param {string} options.title the title to edit\n * @param {string|null} options.sectionId the id of the section to operate edits on.\n * @param {number} [options.oldId] revision to operate on. If absent defaults to latest.\n * @param {boolean} [options.fromModified] whether the page was loaded in a modified state\n * @param {string} [options.preload] the name of a page to preload into the editor\n * @param {Array} [options.preloadparams] parameters to prefill into the preload content\n * @param {string} [options.editintro] edit intro to add to notices\n * @private\n */\nfunction EditorGateway( options ) {\n\tthis.api = options.api;\n\tthis.title = options.title;\n\tthis.sectionId = options.sectionId;\n\tthis.oldId = options.oldId;\n\tthis.preload = options.preload;\n\tthis.preloadparams = options.preloadparams;\n\tthis.editintro = options.editintro;\n\tthis.content = undefined;\n\tthis.fromModified = options.fromModified;\n\tthis.hasChanged = options.fromModified;\n}\n\nEditorGateway.prototype = {\n\n\t/**\n\t * Get the block (if there is one) from the result.\n\t *\n\t * @memberof EditorGateway\n\t * @param {Object} pageObj Page object\n\t * @return {Object|null}\n\t */\n\tgetBlockInfo: function ( pageObj ) {\n\t\tlet blockedError;\n\n\t\tif ( pageObj.actions &&\n\t\t\tpageObj.actions.edit &&\n\t\t\tArray.isArray( pageObj.actions.edit )\n\t\t) {\n\t\t\tpageObj.actions.edit.some( function ( error ) {\n\t\t\t\tif ( [ 'blocked', 'autoblocked' ].indexOf( error.code ) !== -1 ) {\n\t\t\t\t\tblockedError = error;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t} );\n\n\t\t\tif ( blockedError && blockedError.data && blockedError.data.blockinfo ) {\n\t\t\t\treturn blockedError.data.blockinfo;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t},\n\t/**\n\t * Get the content of a page.\n\t *\n\t * @memberof EditorGateway\n\t * @instance\n\t * @return {jQuery.Promise}\n\t */\n\tgetContent: function () {\n\t\tlet options;\n\n\t\tconst self = this;\n\n\t\tfunction resolve() {\n\t\t\treturn util.Deferred().resolve( {\n\t\t\t\ttext: self.content || '',\n\t\t\t\tblockinfo: self.blockinfo,\n\t\t\t\tnotices: self.notices\n\t\t\t} );\n\t\t}\n\n\t\tif ( this.content !== undefined ) {\n\t\t\treturn resolve();\n\t\t} else {\n\t\t\toptions = actionParams( {\n\t\t\t\tprop: [ 'revisions', 'info' ],\n\t\t\t\trvprop: [ 'content', 'timestamp' ],\n\t\t\t\tinprop: [ 'preloadcontent', 'editintro' ],\n\t\t\t\tinpreloadcustom: self.preload,\n\t\t\t\tinpreloadparams: self.preloadparams,\n\t\t\t\tineditintrocustom: self.editintro,\n\t\t\t\ttitles: self.title,\n\t\t\t\t// get block information for this user\n\t\t\t\tintestactions: 'edit',\n\t\t\t\t// …and test whether this edit will auto-create an account\n\t\t\t\tintestactionsautocreate: true,\n\t\t\t\tintestactionsdetail: 'full'\n\t\t\t} );\n\t\t\t// Load text of old revision if desired\n\t\t\tif ( this.oldId ) {\n\t\t\t\toptions.rvstartid = this.oldId;\n\t\t\t}\n\t\t\t// See T52136 - passing rvsection will fail with non wikitext\n\t\t\tif ( this.sectionId ) {\n\t\t\t\toptions.rvsection = this.sectionId;\n\t\t\t}\n\t\t\treturn this.api.get( options ).then( function ( resp ) {\n\t\t\t\tif ( resp.error ) {\n\t\t\t\t\treturn util.Deferred().reject( resp.error.code );\n\t\t\t\t}\n\n\t\t\t\tconst pageObj = resp.query.pages[0];\n\t\t\t\t// page might not exist and caller might not have known.\n\t\t\t\tif ( pageObj.missing !== undefined ) {\n\t\t\t\t\tif ( pageObj.preloadcontent ) {\n\t\t\t\t\t\tself.content = pageObj.preloadcontent.content;\n\t\t\t\t\t\tself.hasChanged = !pageObj.preloadisdefault;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tself.content = '';\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tconst revision = pageObj.revisions[0];\n\t\t\t\t\tself.content = revision.content;\n\t\t\t\t\tself.timestamp = revision.timestamp;\n\t\t\t\t}\n\n\t\t\t\t// save content a second time to be able to check for changes\n\t\t\t\tself.originalContent = self.content;\n\t\t\t\tself.blockinfo = self.getBlockInfo( pageObj );\n\t\t\t\tself.wouldautocreate = pageObj.wouldautocreate && pageObj.wouldautocreate.edit;\n\t\t\t\tself.notices = pageObj.editintro;\n\n\t\t\t\treturn resolve();\n\t\t\t} );\n\t\t}\n\t},\n\n\t/**\n\t * Mark content as modified and set changes to be submitted when #save\n\t * is invoked.\n\t *\n\t * @memberof EditorGateway\n\t * @instance\n\t * @param {string} content New section content.\n\t */\n\tsetContent: function ( content ) {\n\t\tif ( this.originalContent !== content || this.fromModified ) {\n\t\t\tthis.hasChanged = true;\n\t\t} else {\n\t\t\tthis.hasChanged = false;\n\t\t}\n\t\tthis.content = content;\n\t},\n\n\t/**\n\t * Save the new content of the section, previously set using #setContent.\n\t *\n\t * @memberof EditorGateway\n\t * @instance\n\t * @param {Object} options Configuration options\n\t * @param {string} [options.summary] Optional summary for the edit.\n\t * @param {string} [options.captchaId] If CAPTCHA was requested, ID of the\n\t * captcha.\n\t * @param {string} [options.captchaWord] If CAPTCHA was requested, term\n\t * displayed in the CAPTCHA.\n\t * @return {jQuery.Deferred} On failure callback is passed an object with\n\t * `type` and `details` properties. `type` is a string describing the type\n\t * of error, `details` can be any object (usually error message).\n\t */\n\tsave: function ( options ) {\n\t\tconst self = this,\n\t\t\tresult = util.Deferred();\n\n\t\toptions = options || {};\n\n\t\t/**\n\t\t * Save content. Make an API request.\n\t\t *\n\t\t * @return {jQuery.Deferred}\n\t\t */\n\t\tfunction saveContent() {\n\t\t\tconst apiOptions = {\n\t\t\t\taction: 'edit',\n\t\t\t\terrorformat: 'html',\n\t\t\t\terrorlang: mw.config.get( 'wgUserLanguage' ),\n\t\t\t\terrorsuselocal: 1,\n\t\t\t\tformatversion: 2,\n\t\t\t\ttitle: self.title,\n\t\t\t\tsummary: options.summary,\n\t\t\t\tcaptchaid: options.captchaId,\n\t\t\t\tcaptchaword: options.captchaWord,\n\t\t\t\tbasetimestamp: self.timestamp,\n\t\t\t\tstarttimestamp: self.timestamp\n\t\t\t};\n\n\t\t\tif ( self.content !== undefined ) {\n\t\t\t\tapiOptions.text = self.content;\n\t\t\t}\n\n\t\t\tif ( self.sectionId ) {\n\t\t\t\tapiOptions.section = self.sectionId;\n\t\t\t}\n\n\t\t\t// TODO: When `wouldautocreate` is true, we should also set up:\n\t\t\t// - apiOptions.returntofragment to be the URL fragment to link to the section\n\t\t\t// (but we don't know what it is; `sectionId` here is the number)\n\t\t\t// - apiOptions.returntoquery to be 'redirect=no' if we're saving a redirect\n\t\t\t// (but we have can't figure that out, unless we parse the wikitext)\n\n\t\t\tself.api.postWithToken( 'csrf', apiOptions ).then( function ( data ) {\n\t\t\t\tif ( data && data.edit && data.edit.result === 'Success' ) {\n\t\t\t\t\tself.hasChanged = false;\n\t\t\t\t\tresult.resolve( data.edit.newrevid, data.edit.tempusercreatedredirect,\n\t\t\t\t\t\tdata.edit.tempusercreated );\n\t\t\t\t} else {\n\t\t\t\t\tresult.reject( data );\n\t\t\t\t}\n\t\t\t}, function ( code, data ) {\n\t\t\t\tresult.reject( data );\n\t\t\t} );\n\t\t\treturn result;\n\t\t}\n\n\t\treturn saveContent();\n\t},\n\n\t/**\n\t * Abort any pending previews.\n\t *\n\t * @memberof EditorGateway\n\t * @instance\n\t */\n\tabortPreview: function () {\n\t\tif ( this._pending ) {\n\t\t\tthis._pending.abort();\n\t\t}\n\t},\n\n\t/**\n\t * Get page preview from the API and abort any existing previews.\n\t *\n\t * @memberof EditorGateway\n\t * @instance\n\t * @param {Object} options API query parameters\n\t * @return {jQuery.Deferred}\n\t */\n\tgetPreview: function ( options ) {\n\t\tlet\n\t\t\tsectionLine = '',\n\t\t\tsectionId = '';\n\n\t\tconst self = this;\n\n\t\tutil.extend( options, {\n\t\t\taction: 'parse',\n\t\t\t// Enable section preview mode to avoid errors (T51218)\n\t\t\tsectionpreview: true,\n\t\t\t// Hide section edit links\n\t\t\tdisableeditsection: true,\n\t\t\t// needed for pre-save transform to work (T55692)\n\t\t\tpst: true,\n\t\t\t// Output mobile HTML (T56243)\n\t\t\tmobileformat: true,\n\t\t\tuseskin: mw.config.get( 'skin' ),\n\t\t\tdisabletoc: true,\n\t\t\ttitle: this.title,\n\t\t\tprop: [ 'text', 'sections' ]\n\t\t} );\n\n\t\tthis.abortPreview();\n\t\t// Acquire a temporary user username before previewing, so that signatures and\n\t\t// user-related magic words display the temp user instead of IP user in the\n\t\t// preview. (T331397)\n\t\tconst promise = mw.user.acquireTempUserName().then( function () {\n\t\t\tself._pending = self.api.post( options );\n\t\t\treturn self._pending;\n\t\t} );\n\n\t\treturn promise.then( function ( resp ) {\n\t\t\tif ( resp && resp.parse && resp.parse.text ) {\n\t\t\t\t// When editing section 0 or the whole page, there is no section name, so skip\n\t\t\t\tif ( self.sectionId && self.sectionId !== '0' &&\n\t\t\t\t\tresp.parse.sections !== undefined &&\n\t\t\t\t\tresp.parse.sections[0] !== undefined\n\t\t\t\t) {\n\t\t\t\t\tif ( resp.parse.sections[0].anchor !== undefined ) {\n\t\t\t\t\t\tsectionId = resp.parse.sections[0].anchor;\n\t\t\t\t\t}\n\t\t\t\t\tif ( resp.parse.sections[0].line !== undefined ) {\n\t\t\t\t\t\tsectionLine = resp.parse.sections[0].line;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\ttext: resp.parse.text['*'],\n\t\t\t\t\tid: sectionId,\n\t\t\t\t\tline: sectionLine\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\treturn util.Deferred().reject();\n\t\t\t}\n\t\t} ).promise( {\n\t\t\tabort: function () {\n\t\t\t\tself._pending.abort();\n\t\t\t}\n\t\t} );\n\t}\n};\n\nmodule.exports = EditorGateway;\n","/* global $ */\n/**\n * @class EditorOverlayBase\n * @private\n */\nconst Overlay = require( '../mobile.startup/Overlay' ),\n\tutil = require( '../mobile.startup/util' ),\n\tparseBlockInfo = require( './parseBlockInfo' ),\n\theaders = require( '../mobile.startup/headers' ),\n\ticons = require( '../mobile.startup/icons' ),\n\tButton = require( '../mobile.startup/Button' ),\n\tIconButton = require( '../mobile.startup/IconButton' ),\n\tmfExtend = require( '../mobile.startup/mfExtend' ),\n\tblockMessageDrawer = require( './blockMessageDrawer' ),\n\tMessageBox = require( '../mobile.startup/MessageBox' ),\n\tmwUser = mw.user;\n\n/**\n * 'Edit' button\n *\n * @param {OO.ui.ToolGroup} toolGroup\n * @param {Object} config\n * @private\n */\nfunction EditVeTool( toolGroup, config ) {\n\tconfig = config || {};\n\tconfig.classes = [ 'visual-editor' ];\n\tEditVeTool.super.call( this, toolGroup, config );\n}\nOO.inheritClass( EditVeTool, OO.ui.Tool );\n\nEditVeTool.static.name = 'editVe';\nEditVeTool.static.icon = 'edit';\nEditVeTool.static.group = 'editorSwitcher';\nEditVeTool.static.title = mw.msg( 'mobile-frontend-editor-switch-visual-editor' );\n/**\n * click handler\n *\n * @memberof EditVeTool\n * @instance\n */\nEditVeTool.prototype.onSelect = function () {\n\t// will be overridden later\n};\n/**\n * Toolbar update state handler.\n *\n * @memberof EditVeTool\n * @instance\n */\nEditVeTool.prototype.onUpdateState = function () {\n\t// do nothing\n};\n\n/**\n * Base class for SourceEditorOverlay and VisualEditorOverlay\n *\n * @class EditorOverlayBase\n * @private\n * @extends Overlay\n * @uses IconButton\n * @uses user\n * @param {Object} params Configuration options\n * @param {boolean} params.editSwitcher whether possible to switch mode in header\n * @param {boolean} params.hasToolbar whether the editor has a toolbar\n */\nfunction EditorOverlayBase( params ) {\n\tconst\n\t\toptions = util.extend(\n\t\t\ttrue,\n\t\t\t{\n\t\t\t\tonBeforeExit: this.onBeforeExit.bind( this ),\n\t\t\t\tclassName: 'overlay editor-overlay',\n\t\t\t\tisBorderBox: false\n\t\t\t},\n\t\t\tparams,\n\t\t\t{\n\t\t\t\tevents: util.extend(\n\t\t\t\t\t{\n\t\t\t\t\t\t'click .back': 'onClickBack',\n\t\t\t\t\t\t'click .continue': 'onClickContinue',\n\t\t\t\t\t\t'click .submit': 'onClickSubmit',\n\t\t\t\t\t\t'click .anonymous': 'onClickAnonymous'\n\t\t\t\t\t},\n\t\t\t\t\tparams.events\n\t\t\t\t)\n\t\t\t}\n\t\t);\n\n\tif ( options.isNewPage ) {\n\t\toptions.placeholder = mw.msg( 'mobile-frontend-editor-placeholder-new-page', mwUser );\n\t}\n\t// change the message to request a summary when not in article namespace\n\tif ( mw.config.get( 'wgNamespaceNumber' ) !== 0 ) {\n\t\toptions.summaryRequestMsg = mw.msg( 'mobile-frontend-editor-summary' );\n\t}\n\tthis.isNewPage = options.isNewPage;\n\tthis.sectionId = options.sectionId;\n\tthis.overlayManager = options.overlayManager;\n\n\tOverlay.call( this, options );\n}\n\nmfExtend( EditorOverlayBase, Overlay, {\n\t/**\n\t * @memberof EditorOverlayBase\n\t * @instance\n\t * @mixes Overlay#defaults\n\t * @property {Object} defaults Default options hash.\n\t * @property {OverlayManager} defaults.overlayManager instance\n\t * @property {mw.Api} defaults.api to interact with\n\t * @property {boolean} defaults.hasToolbar Whether the editor has a toolbar or not. When\n\t * disabled a header will be show instead.\n\t * @property {string} defaults.continueMsg Caption for the next button on edit form\n\t * which takes you to the screen that shows a preview and license information.\n\t * @property {string} defaults.closeMsg Caption for a button that takes you back to editing\n\t * from edit preview screen.\n\t * @property {string} defaults.summaryRequestMsg Header above edit summary input field\n\t * asking the user to summarize the changes they made to the page.\n\t * @property {string} defaults.summaryMsg A placeholder with examples for the summary input\n\t * field asking user what they changed.\n\t * @property {string} defaults.placeholder Placeholder text for empty sections.\n\t * @property {string} defaults.captchaMsg Placeholder for captcha input field.\n\t * @property {string} defaults.captchaTryAgainMsg A message shown when user enters\n\t * wrong CAPTCHA and a new one is displayed.\n\t * @property {string} defaults.switchMsg Label for button that allows the user\n\t * to switch between two different editing interfaces.\n\t * @property {string} defaults.licenseMsg Text and link of the license,\n\t * under which this contribution will be released to inform the user.\n\t */\n\tdefaults: util.extend( {}, Overlay.prototype.defaults, {\n\t\thasToolbar: false,\n\t\tcontinueMsg: mw.msg( 'mobile-frontend-editor-continue' ),\n\t\tcloseMsg: mw.msg( 'mobile-frontend-editor-keep-editing' ),\n\t\tsummaryRequestMsg: mw.msg( 'mobile-frontend-editor-summary-request' ),\n\t\tsummaryMsg: mw.msg( 'mobile-frontend-editor-summary-placeholder' ),\n\t\tplaceholder: mw.msg( 'mobile-frontend-editor-placeholder' ),\n\t\tcaptchaMsg: mw.msg( 'mobile-frontend-account-create-captcha-placeholder' ),\n\t\tcaptchaTryAgainMsg: mw.msg( 'mobile-frontend-editor-captcha-try-again' ),\n\t\tswitchMsg: mw.msg( 'mobile-frontend-editor-switch-editor' ),\n\t\tconfirmMsg: mw.msg( 'mobile-frontend-editor-cancel-confirm' ),\n\t\tlicenseMsg: undefined\n\t} ),\n\t/**\n\t * @inheritdoc\n\t * @memberof EditorOverlayBase\n\t * @instance\n\t */\n\ttemplate: util.template( `\n<div class=\"overlay-header-container header-container position-fixed\"></div>\n\n<div class=\"overlay-content\">\n\t<div class=\"panels\">\n\t\t<div class=\"save-panel panel hideable hidden\">\n\t\t\t<div id=\"error-notice-container\"></div>\n\t\t\t<h2 class=\"summary-request\">{{{summaryRequestMsg}}}</h2>\n\t\t\t<div class=\"summary-input\"></div>\n\t\t\t{{#licenseMsg}}<div class=\"license\">{{{licenseMsg}}}</div>{{/licenseMsg}}\n\t\t</div>\n\t\t<div class=\"captcha-panel panel hideable hidden\">\n\t\t\t<div class=\"captcha-box\">\n\t\t\t\t<img id=\"image\" src=\"\">\n\t\t\t\t<div id=\"question\"></div>\n\t\t\t\t<div class=\"cdx-text-input\">\n\t\t\t\t\t<input class=\"captcha-word cdx-text-input__input\" placeholder=\"{{captchaMsg}}\" />\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\t{{>content}}\n</div>\n<div class=\"overlay-footer-container position-fixed\">\n\t{{>footer}}\n</div>\n\t` ),\n\t/**\n\t * @memberof EditorOverlayBase\n\t * @instance\n\t */\n\tsectionId: '',\n\t/**\n\t * Logs an event to http://meta.wikimedia.org/wiki/Schema:EditAttemptStep\n\t *\n\t * @memberof EditorOverlayBase\n\t * @instance\n\t * @param {Object} data\n\t */\n\tlog: function ( data ) {\n\t\tmw.track( 'editAttemptStep', util.extend( data, {\n\t\t\t// eslint-disable-next-line camelcase\n\t\t\teditor_interface: this.editor\n\t\t} ) );\n\t},\n\t/**\n\t * Logs an event to http://meta.wikimedia.org/wiki/Schema:VisualEditorFeatureUse\n\t *\n\t * @memberof EditorOverlayBase\n\t * @instance\n\t * @param {Object} data\n\t */\n\tlogFeatureUse: function ( data ) {\n\t\tmw.track( 'visualEditorFeatureUse', util.extend( data, {\n\t\t\t// eslint-disable-next-line camelcase\n\t\t\teditor_interface: this.editor\n\t\t} ) );\n\t},\n\n\t/**\n\t * If this is a new article, require confirmation before saving.\n\t *\n\t * @memberof EditorOverlayBase\n\t * @instance\n\t * @return {boolean} The user confirmed saving\n\t */\n\tconfirmSave: function () {\n\t\tif ( this.isNewPage &&\n\t\t\t// TODO: Replace with an OOUI dialog\n\t\t\t// eslint-disable-next-line no-alert\n\t\t\t!window.confirm( mw.msg( 'mobile-frontend-editor-new-page-confirm', mwUser ) )\n\t\t) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t},\n\t/**\n\t * Executed when page save is complete. Updates urls and shows toast message.\n\t *\n\t * @memberof EditorOverlayBase\n\t * @instance\n\t * @param {number|null} newRevId ID of the newly created revision, or null if it was a\n\t * null edit.\n\t * @param {string} [redirectUrl] URL to redirect to, if different than the current URL.\n\t * @param {boolean} [tempUserCreated] Whether a temporary user was created\n\t */\n\tonSaveComplete: function ( newRevId, redirectUrl, tempUserCreated ) {\n\t\tconst\n\t\t\tself = this;\n\n\t\tthis.saved = true;\n\n\t\tif ( newRevId ) {\n\t\t\tlet action;\n\t\t\tif ( self.isNewPage ) {\n\t\t\t\taction = 'created';\n\t\t\t} else if ( self.options.oldId ) {\n\t\t\t\taction = 'restored';\n\t\t\t} else {\n\t\t\t\taction = 'saved';\n\t\t\t}\n\t\t\tself.showSaveCompleteMsg( action, tempUserCreated );\n\t\t}\n\n\t\t// Ensure we don't lose this event when logging\n\t\tthis.log( {\n\t\t\taction: 'saveSuccess',\n\t\t\t// eslint-disable-next-line camelcase\n\t\t\trevision_id: newRevId\n\t\t} );\n\t\tif ( tempUserCreated && redirectUrl ) {\n\t\t\t// The caller handles this redirect, either in SourceEditorOverlay or in VE's ArticleTarget\n\t\t\treturn;\n\t\t}\n\t\tsetTimeout( function () {\n\t\t\t// Wait for any other teardown navigation to happen (e.g. router.back())\n\t\t\t// before setting our final location.\n\t\t\tif ( redirectUrl ) {\n\t\t\t\t// eslint-disable-next-line no-restricted-properties\n\t\t\t\twindow.location.href = redirectUrl;\n\t\t\t} else if ( self.sectionId ) {\n\t\t\t\t// Ideally we'd want to do this via replaceState (see T189173)\n\t\t\t\t// eslint-disable-next-line no-restricted-properties\n\t\t\t\twindow.location.hash = '#' + self.sectionId;\n\t\t\t} else {\n\t\t\t\t// Cancel the hash fragment\n\t\t\t\t// otherwise clicking back after a save will take you back to the editor.\n\t\t\t\t// We avoid calling the hide method of the overlay here as this can be asynchronous\n\t\t\t\t// and may conflict with the window.reload call below.\n\t\t\t\t// eslint-disable-next-line no-restricted-properties\n\t\t\t\twindow.location.hash = '#';\n\t\t\t}\n\t\t} );\n\t},\n\t/**\n\t * Show a save-complete message to the user\n\t *\n\t * @inheritdoc\n\t * @memberof VisualEditorOverlay\n\t * @instance\n\t * @param {string} action One of 'saved', 'created', 'restored'\n\t * @param {boolean} [tempUserCreated] Whether a temporary user was created\n\t */\n\tshowSaveCompleteMsg: function ( action, tempUserCreated ) {\n\t\t__non_webpack_require__( 'mediawiki.action.view.postEdit' ).fireHook( action, tempUserCreated );\n\t},\n\t/**\n\t * Executed when page save fails. Handles logging the error. Subclasses\n\t * should display error messages as appropriate.\n\t *\n\t * @memberof EditorOverlayBase\n\t * @instance\n\t * @param {Object} data API response\n\t */\n\tonSaveFailure: function ( data ) {\n\t\tlet code = data && data.errors && data.errors[0] && data.errors[0].code;\n\n\t\tconst\n\t\t\t// Compare to ve.init.mw.ArticleTargetEvents.js in VisualEditor.\n\t\t\ttypeMap = {\n\t\t\t\tbadtoken: 'userBadToken',\n\t\t\t\tassertanonfailed: 'userNewUser',\n\t\t\t\tassertuserfailed: 'userNewUser',\n\t\t\t\tassertnameduserfailed: 'userNewUser',\n\t\t\t\t'abusefilter-disallowed': 'extensionAbuseFilter',\n\t\t\t\t'abusefilter-warning': 'extensionAbuseFilter',\n\t\t\t\tcaptcha: 'extensionCaptcha',\n\t\t\t\t// FIXME: This language is non-inclusive and we would love to change it,\n\t\t\t\t// but this relates to an error code provided by software.\n\t\t\t\t// This is blocked on T254649\n\t\t\t\tspamblacklist: 'extensionSpamBlacklist',\n\t\t\t\t// FIXME: This language is non-inclusive and we would love to change it,\n\t\t\t\t// but this relates to an error code provided by software.\n\t\t\t\t// Removal of this line is blocked on T254650.\n\t\t\t\t'titleblacklist-forbidden': 'extensionTitleBlacklist',\n\t\t\t\tpagedeleted: 'editPageDeleted',\n\t\t\t\teditconflict: 'editConflict'\n\t\t\t};\n\n\t\tif ( data.edit && data.edit.captcha ) {\n\t\t\tcode = 'captcha';\n\t\t}\n\n\t\tthis.log( {\n\t\t\taction: 'saveFailure',\n\t\t\tmessage: code,\n\t\t\ttype: typeMap[code] || 'responseUnknown'\n\t\t} );\n\t},\n\t/**\n\t * Report load errors back to the user. Silently record the error using EventLogging.\n\t *\n\t * @memberof EditorOverlayBase\n\t * @instance\n\t * @param {string} text Text (HTML) of message to display to user\n\t */\n\treportError: function ( text ) {\n\t\tconst errorNotice = new MessageBox( {\n\t\t\ttype: 'error',\n\t\t\tmsg: text,\n\t\t\theading: mw.msg( 'mobile-frontend-editor-error' )\n\t\t} );\n\t\tthis.$errorNoticeContainer.html( errorNotice.$el );\n\t},\n\thideErrorNotice: function () {\n\t\tthis.$errorNoticeContainer.empty();\n\t},\n\t/**\n\t * Prepares the penultimate screen before saving.\n\t * Expects to be overridden by child class.\n\t *\n\t * @memberof EditorOverlayBase\n\t * @instance\n\t */\n\tonStageChanges: function () {\n\t\tthis.showHidden( '.save-header, .save-panel' );\n\t\tthis.hideErrorNotice();\n\t\tthis.log( {\n\t\t\taction: 'saveIntent'\n\t\t} );\n\t\t// Scroll to the top of the page, so that the summary input is visible\n\t\t// (even if overlay was scrolled down when editing) and weird iOS header\n\t\t// problems are avoided (header position not updating to the top of the\n\t\t// screen, instead staying lower until a subsequent scroll event).\n\t\twindow.scrollTo( 0, 1 );\n\t},\n\t/**\n\t * Executed when the editor clicks the save button. Expects to be overridden by child\n\t * class. Checks if the save needs to be confirmed.\n\t *\n\t * @memberof EditorOverlayBase\n\t * @instance\n\t */\n\tonSaveBegin: function () {\n\t\tthis.confirmAborted = false;\n\t\tthis.hideErrorNotice();\n\t\t// Ask for confirmation in some cases\n\t\tif ( !this.confirmSave() ) {\n\t\t\tthis.confirmAborted = true;\n\t\t\treturn;\n\t\t}\n\t\tthis.log( {\n\t\t\taction: 'saveAttempt'\n\t\t} );\n\t},\n\t/**\n\t * @inheritdoc\n\t * @memberof EditorOverlayBase\n\t */\n\tpreRender: function () {\n\t\tconst options = this.options;\n\n\t\tthis.options.headers = [\n\t\t\theaders.formHeader(\n\t\t\t\tutil.template( `\n{{^hasToolbar}}\n<div class=\"overlay-title\">\n\t<h2>{{{editingMsg}}}</h2>\n</div>\n{{/hasToolbar}}\n{{#hasToolbar}}<div class=\"toolbar\"></div>{{/hasToolbar}}\n{{#editSwitcher}}\n\t<div class=\"switcher-container\">\n\t</div>\n{{/editSwitcher}}\n\t\t\t\t` ).render( {\n\t\t\t\t\thasToolbar: options.hasToolbar,\n\t\t\t\t\teditSwitcher: options.editSwitcher,\n\t\t\t\t\teditingMsg: options.editingMsg\n\t\t\t\t} ),\n\t\t\t\toptions.readOnly ? [] : [\n\t\t\t\t\tnew IconButton( {\n\t\t\t\t\t\ttagName: 'button',\n\t\t\t\t\t\taction: 'progressive',\n\t\t\t\t\t\tweight: 'primary',\n\t\t\t\t\t\ticon: 'next-invert',\n\t\t\t\t\t\tadditionalClassNames: 'continue',\n\t\t\t\t\t\tdisabled: true,\n\t\t\t\t\t\ttitle: options.continueMsg\n\t\t\t\t\t} )\n\t\t\t\t],\n\t\t\t\ticons.cancel(),\n\t\t\t\t'initial-header'\n\t\t\t),\n\t\t\theaders.saveHeader( options.previewingMsg, 'save-header hidden' ),\n\t\t\theaders.savingHeader( mw.msg( 'mobile-frontend-editor-wait' ) )\n\t\t];\n\t},\n\n\t/**\n\t * @inheritdoc\n\t * @memberof EditorOverlayBase\n\t * @instance\n\t */\n\tpostRender: function () {\n\t\tthis.$errorNoticeContainer = this.$el.find( '#error-notice-container' );\n\n\t\tOverlay.prototype.postRender.apply( this );\n\t\tthis.showHidden( '.initial-header' );\n\t},\n\tshow: function () {\n\t\tconst self = this;\n\t\tthis.allowCloseWindow = mw.confirmCloseWindow( {\n\t\t\t// Returns true if content has changed\n\t\t\ttest: function () {\n\t\t\t\t// Check if content has changed\n\t\t\t\treturn self.hasChanged();\n\t\t\t},\n\n\t\t\t// Message to show the user, if content has changed\n\t\t\tmessage: mw.msg( 'mobile-frontend-editor-cancel-confirm' ),\n\t\t\t// Event namespace\n\t\t\tnamespace: 'editwarning'\n\t\t} );\n\n\t\tthis.saved = false;\n\t\tOverlay.prototype.show.call( this );\n\n\t\t// Inform other interested code that the editor has loaded\n\t\t/**\n\t\t * Internal for use in ContentTranslation and GrowthExperiments only.\n\t\t *\n\t\t * @event ~'mobileFrontend.editorOpened'\n\t\t * @memberof Hooks\n\t\t */\n\t\tmw.hook( 'mobileFrontend.editorOpened' ).fire( this.editor );\n\t},\n\t/**\n\t * Back button click handler\n\t *\n\t * @memberof EditorOverlayBase\n\t * @instance\n\t */\n\tonClickBack: function () {},\n\t/**\n\t * Submit button click handler\n\t *\n\t * @memberof EditorOverlayBase\n\t * @instance\n\t */\n\tonClickSubmit: function () {\n\t\tthis.onSaveBegin();\n\t},\n\t/**\n\t * Continue button click handler\n\t *\n\t * @memberof EditorOverlayBase\n\t * @instance\n\t */\n\tonClickContinue: function () {\n\t\tthis.onStageChanges();\n\t},\n\t/**\n\t * \"Edit without logging in\" button click handler\n\t *\n\t * @memberof EditorOverlayBase\n\t * @instance\n\t */\n\tonClickAnonymous: function () {},\n\t/**\n\t * @memberof EditorOverlayBase\n\t * @instance\n\t * @param {Function} exit Callback to exit the overlay\n\t * @param {Function} cancel Callback to cancel exiting the overlay\n\t */\n\tonBeforeExit: function ( exit, cancel ) {\n\t\tconst self = this;\n\t\tif ( this.hasChanged() && !this.switching ) {\n\t\t\tif ( !this.windowManager ) {\n\t\t\t\tthis.windowManager = OO.ui.getWindowManager();\n\t\t\t\tthis.windowManager.addWindows( [ new mw.widgets.AbandonEditDialog() ] );\n\t\t\t}\n\t\t\tthis.windowManager.openWindow( 'abandonedit' )\n\t\t\t\t.closed.then( function ( data ) {\n\t\t\t\t\tif ( data && data.action === 'discard' ) {\n\t\t\t\t\t\t// log abandonment\n\t\t\t\t\t\tself.log( {\n\t\t\t\t\t\t\taction: 'abort',\n\t\t\t\t\t\t\tmechanism: 'cancel',\n\t\t\t\t\t\t\ttype: 'abandon'\n\t\t\t\t\t\t} );\n\t\t\t\t\t\tself.onExit();\n\t\t\t\t\t\texit();\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\tcancel();\n\t\t\treturn;\n\t\t}\n\t\tif ( !this.switching && !this.saved ) {\n\t\t\t// log leaving without changes\n\t\t\tthis.log( {\n\t\t\t\taction: 'abort',\n\t\t\t\tmechanism: 'cancel',\n\t\t\t\t// if this is VE, hasChanged will be false because the Surface has\n\t\t\t\t// already been destroyed (which is good because it stops us\n\t\t\t\t// double-showing the abandon changes dialog above)... but we can\n\t\t\t\t// test whether there *were* changes for logging purposes by\n\t\t\t\t// examining the target:\n\t\t\t\ttype: ( this.target && this.target.edited ) ? 'abandon' : 'nochange'\n\t\t\t} );\n\t\t}\n\t\tthis.onExit();\n\t\texit();\n\t\tif ( mw.config.get( 'wgAction' ) === 'edit' ) {\n\t\t\t// We got into the overlay via directly visiting an action=edit\n\t\t\t// URL, which has been taken over. As such, depending on\n\t\t\t// how we got here, the normal overlay process isn't going to\n\t\t\t// produce the correct result.\n\t\t\tsetTimeout( function () {\n\t\t\t\t// This needs to happen after the overlay-hide has completed\n\t\t\t\t// so we have access to the \"real\" URL, and `exit`\n\t\t\t\t// unfortunately doesn't expose a promise for this. There's\n\t\t\t\t// several setTimeouts within the hide, so we're just going\n\t\t\t\t// to use a long-enough setTimeout of our own to skip those.\n\t\t\t\tif ( !mw.util.getParamValue( 'veaction' ) && !mw.util.getParamValue( 'action' ) ) {\n\t\t\t\t\t// Use reload if possible, to emulate having gone back\n\t\t\t\t\tlocation.reload();\n\t\t\t\t} else {\n\t\t\t\t\tlocation.href = mw.util.getUrl();\n\t\t\t\t}\n\t\t\t}, 100 );\n\t\t}\n\t},\n\tonExit: function () {\n\t\t// May not be set if overlay has not been previously shown\n\t\tif ( this.allowCloseWindow ) {\n\t\t\tthis.allowCloseWindow.release();\n\t\t}\n\t\t/**\n\t\t * Internal for use in ContentTranslation and GrowthExperiments only.\n\t\t *\n\t\t * @event ~'mobileFrontend.editorClosed'\n\t\t * @memberof Hooks\n\t\t */\n\t\tmw.hook( 'mobileFrontend.editorClosed' ).fire();\n\t},\n\t/**\n\t * Sets additional values used for anonymous editing warning.\n\t *\n\t * @memberof EditorOverlayBase\n\t * @instance\n\t * @param {Object} options\n\t * @return {jQuery.Element}\n\t */\n\tcreateAnonWarning: function ( options ) {\n\t\tconst $actions = $( '<div>' ).addClass( 'actions' ),\n\t\t\t// Use MediaWiki ResourceLoader require(), not Webpack require()\n\t\t\tcontLangMessages = (\n\n\t\t\t\t__non_webpack_require__( './contLangMessages.json' )\n\t\t\t),\n\t\t\tmsg = this.gateway.wouldautocreate ?\n\t\t\t\t'mobile-frontend-editor-autocreatewarning' :\n\t\t\t\t'mobile-frontend-editor-anonwarning',\n\t\t\t$anonWarning = $( '<div>' ).addClass( 'anonwarning content' ).append(\n\t\t\t\tnew MessageBox( {\n\t\t\t\t\ttype: 'notice',\n\t\t\t\t\tclassName: 'anon-msg',\n\t\t\t\t\t// eslint-disable-next-line mediawiki/msg-doc\n\t\t\t\t\tmsg: mw.message( msg, contLangMessages[ 'tempuser-helppage' ] ).parse()\n\t\t\t\t} ).$el,\n\t\t\t\t$actions\n\t\t\t),\n\t\t\tparams = util.extend( {\n\t\t\t\treturnto: options.returnTo || (\n\t\t\t\t\t// use wgPageName as this includes the namespace if outside Main\n\t\t\t\t\tmw.config.get( 'wgPageName' ) + '#/editor/' + ( options.sectionId || 'all' )\n\t\t\t\t),\n\t\t\t\twarning: 'mobile-frontend-edit-login-action'\n\t\t\t}, options.queryParams ),\n\t\t\tsignupParams = util.extend( {\n\t\t\t\ttype: 'signup',\n\t\t\t\twarning: 'mobile-frontend-edit-signup-action'\n\t\t\t}, options.signupQueryParams ),\n\t\t\tanonymousEditorActions = [\n\t\t\t\tnew Button( {\n\t\t\t\t\tlabel: mw.msg( 'mobile-frontend-editor-anon' ),\n\t\t\t\t\tblock: true,\n\t\t\t\t\tadditionalClassNames: 'anonymous progressive',\n\t\t\t\t\tprogressive: true\n\t\t\t\t} ),\n\t\t\t\tnew Button( {\n\t\t\t\t\tblock: true,\n\t\t\t\t\thref: mw.util.getUrl( 'Special:UserLogin', params ),\n\t\t\t\t\tlabel: mw.msg( 'mobile-frontend-watchlist-cta-button-login' )\n\t\t\t\t} ),\n\t\t\t\tnew Button( {\n\t\t\t\t\tblock: true,\n\t\t\t\t\thref: mw.util.getUrl( 'Special:UserLogin', util.extend( params, signupParams ) ),\n\t\t\t\t\tlabel: mw.msg( 'mobile-frontend-watchlist-cta-button-signup' )\n\t\t\t\t} )\n\t\t\t];\n\n\t\t$actions.append(\n\t\t\tanonymousEditorActions.map( function ( action ) {\n\t\t\t\treturn action.$el;\n\t\t\t} )\n\t\t);\n\n\t\treturn $anonWarning;\n\t},\n\t/**\n\t * Creates and returns a copy of the anon talk message warning\n\t *\n\t * @memberof EditorOverlayBase\n\t * @instance\n\t * @return {jQuery.Element}\n\t */\n\tcreateAnonTalkWarning: function () {\n\t\treturn $( '.minerva-anon-talk-message' ).clone();\n\t},\n\t/**\n\t * Get an options object not containing any defaults or editor\n\t * specific options, so that it can be used to construct a\n\t * different editor for switching.\n\t *\n\t * @memberof EditorOverlayBase\n\t * @return {Object} Options\n\t */\n\tgetOptionsForSwitch: function () {\n\t\t// Only preserve options that would be passed in editor.js#setupEditor\n\t\t// and skip over defaults.\n\t\treturn {\n\t\t\tswitched: true,\n\t\t\toverlayManager: this.options.overlayManager,\n\t\t\tcurrentPageHTMLParser: this.options.currentPageHTMLParser,\n\t\t\tfakeScroll: this.options.fakeScroll,\n\t\t\tapi: this.options.api,\n\t\t\tlicenseMsg: this.options.licenseMsg,\n\t\t\ttitle: this.options.title,\n\t\t\ttitleObj: this.options.titleObj,\n\t\t\tisAnon: this.options.isAnon,\n\t\t\tisNewPage: this.options.isNewPage,\n\t\t\toldId: this.options.oldId,\n\t\t\tcontentLang: this.options.contentLang,\n\t\t\tcontentDir: this.options.contentDir,\n\t\t\tsectionId: this.options.sectionId\n\t\t};\n\t},\n\n\t/**\n\t * Checks whether the state of the thing being edited as changed. Expects to be\n\t * implemented by child class.\n\t *\n\t * @memberof EditorOverlayBase\n\t * @instance\n\t */\n\thasChanged: function () {},\n\t/**\n\t * Get a promise that is resolved when the editor data has loaded,\n\t * or rejected when we're refusing to load the editor because the user is blocked.\n\t *\n\t * @memberof EditorOverlayBase\n\t * @instance\n\t * @return {jQuery.Promise}\n\t */\n\tgetLoadingPromise: function () {\n\t\treturn this.dataPromise.then( function ( result ) {\n\t\t\t// check if user is blocked\n\t\t\tif ( result && result.blockinfo ) {\n\t\t\t\tconst block = parseBlockInfo( result.blockinfo ),\n\t\t\t\t\tmessage = blockMessageDrawer( block );\n\t\t\t\treturn util.Deferred().reject( message );\n\t\t\t}\n\t\t\treturn result;\n\t\t} );\n\t},\n\tshowEditNotices: function () {\n\t\tconst overlay = this;\n\t\tif ( mw.config.get( 'wgMFEditNoticesFeatureConflict' ) ) {\n\t\t\treturn;\n\t\t}\n\t\tthis.getLoadingPromise().then( function ( data ) {\n\t\t\tif ( data.notices ) {\n\t\t\t\tconst editNotices = Object.keys( data.notices ).filter( function ( key ) {\n\t\t\t\t\tif ( key.indexOf( 'editnotice' ) !== 0 ) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tif ( key === 'editnotice-notext' ) {\n\t\t\t\t\t\t// This notice is shown on pages which don't have any\n\t\t\t\t\t\t// other edit notices. It's blank by default, but\n\t\t\t\t\t\t// some wikis have it template-generated and hidden\n\t\t\t\t\t\t// by CSS. It's filtered out from VE's API response,\n\t\t\t\t\t\t// but not from the source mode.\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\t// The contents of an edit notice is unlikely to change in the 24 hour\n\t\t\t\t\t// expiry window, so just record that a notice with this key has been shown.\n\t\t\t\t\t// If a cheap hashing function was available in core (or the API provided\n\t\t\t\t\t// as hash) it could be used here instead.\n\t\t\t\t\tconst storageKey = 'mf-editnotices/' + mw.config.get( 'wgPageName' ) + '#' + key;\n\t\t\t\t\tif ( mw.storage.get( storageKey ) ) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tmw.storage.set( storageKey, '1', 24 * 60 * 60 );\n\t\t\t\t\treturn true;\n\t\t\t\t} );\n\n\t\t\t\tif ( editNotices.length ) {\n\t\t\t\t\tmw.loader.using( 'oojs-ui-windows' ).then( function () {\n\t\t\t\t\t\tconst $container = $( '<div>' ).addClass( 'editor-overlay-editNotices' );\n\t\t\t\t\t\teditNotices.forEach( function ( key ) {\n\t\t\t\t\t\t\tconst $notice = $( '<div>' ).append( data.notices[ key ] );\n\t\t\t\t\t\t\t$notice.addClass( 'editor-overlay-editNotice' );\n\t\t\t\t\t\t\t$container.append( $notice );\n\t\t\t\t\t\t} );\n\t\t\t\t\t\tOO.ui.alert( $container );\n\n\t\t\t\t\t\toverlay.logFeatureUse( {\n\t\t\t\t\t\t\tfeature: 'notices',\n\t\t\t\t\t\t\taction: 'show'\n\t\t\t\t\t\t} );\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t},\n\t/**\n\t * Handles a failed save due to a CAPTCHA provided by ConfirmEdit extension.\n\t *\n\t * @memberof EditorOverlayBase\n\t * @instance\n\t * @param {Object} details Details returned from the api.\n\t */\n\thandleCaptcha: function ( details ) {\n\t\tconst self = this,\n\t\t\t$input = this.$el.find( '.captcha-word' );\n\n\t\tif ( this.captchaShown ) {\n\t\t\t$input.val( '' );\n\t\t\t$input.attr( 'placeholder', this.options.captchaTryAgainMsg );\n\t\t\tsetTimeout( function () {\n\t\t\t\t$input.attr( 'placeholder', self.options.captchaMsg );\n\t\t\t}, 2000 );\n\t\t}\n\n\t\t// handle different mime types different\n\t\tif ( details.mime.indexOf( 'image/' ) === 0 ) {\n\t\t\t// image based CAPTCHA's like provided by FancyCaptcha, ReCaptcha or similar\n\t\t\tthis.$el.find( '.captcha-panel#question' ).detach();\n\t\t\tthis.$el.find( '.captcha-panel img' ).attr( 'src', details.url );\n\t\t} else {\n\t\t\t// not image based CAPTCHA.\n\t\t\tthis.$el.find( '.captcha-panel #image' ).detach();\n\t\t\tif ( details.mime.indexOf( 'text/html' ) === 0 ) {\n\t\t\t\t// handle mime type of HTML as HTML content (display as-is).\n\t\t\t\t// QuestyCaptcha now have default MIME type \"text/html\": see T147606\n\t\t\t\tthis.$el.find( '.captcha-panel #question' ).html( details.question );\n\t\t\t} else {\n\t\t\t\t// handle mime types\n\t\t\t\t// (other than image based ones and HTML based ones)\n\t\t\t\t// as plain text by default.\n\t\t\t\t// e.g. MathCaptcha (solve a math formula) or\n\t\t\t\t// SimpleCaptcha (simple math formula)\n\t\t\t\tthis.$el.find( '.captcha-panel #question' ).text( details.question );\n\t\t\t}\n\t\t}\n\n\t\tthis.showHidden( '.save-header, .captcha-panel' );\n\t\tthis.captchaShown = true;\n\t}\n} );\n\nmodule.exports = EditorOverlayBase;\n","const EditorOverlayBase = require( './EditorOverlayBase' ),\n\tutil = require( '../mobile.startup/util' ),\n\ticons = require( '../mobile.startup/icons' ),\n\tSection = require( '../mobile.startup/Section' ),\n\tsaveFailureMessage = require( './saveFailureMessage' ),\n\tEditorGateway = require( './EditorGateway' ),\n\tfakeToolbar = require( '../mobile.init/fakeToolbar' ),\n\tMessageBox = require( '../mobile.startup/MessageBox' ),\n\tmfExtend = require( '../mobile.startup/mfExtend' ),\n\tsetPreferredEditor = require( './setPreferredEditor' ),\n\tVisualEditorOverlay = require( './VisualEditorOverlay' ),\n\tcurrentPage = require( '../mobile.startup/currentPage' );\n\n/**\n * Overlay that shows an editor\n *\n * @class SourceEditorOverlay\n * @uses Section\n * @uses EditorGateway\n * @uses VisualEditorOverlay\n * @extends EditorOverlayBase\n * @private\n *\n * @param {Object} options Configuration options\n * @param {jQuery.Promise} [dataPromise] Optional promise for loading content\n */\nfunction SourceEditorOverlay( options, dataPromise ) {\n\tthis.isFirefox = /firefox/i.test( window.navigator.userAgent );\n\tthis.gateway = new EditorGateway( {\n\t\tapi: options.api,\n\t\ttitle: options.title,\n\t\tsectionId: options.sectionId,\n\t\toldId: options.oldId,\n\t\tfromModified: !!dataPromise,\n\t\tpreload: options.preload,\n\t\tpreloadparams: options.preloadparams,\n\t\teditintro: options.editintro\n\t} );\n\tthis.readOnly = !!options.oldId; // If old revision, readOnly mode\n\tthis.dataPromise = dataPromise || this.gateway.getContent();\n\tthis.currentPage = currentPage();\n\tif ( this.currentPage.isVEVisualAvailable() ) {\n\t\toptions.editSwitcher = true;\n\t}\n\tif ( this.readOnly ) {\n\t\toptions.readOnly = true;\n\t\toptions.editingMsg = mw.msg( 'mobile-frontend-editor-viewing-source-page', options.title );\n\t} else {\n\t\toptions.editingMsg = mw.msg( 'mobile-frontend-editor-editing-page', options.title );\n\t}\n\toptions.previewingMsg = mw.msg( 'mobile-frontend-editor-previewing-page', options.title );\n\tEditorOverlayBase.call(\n\t\tthis,\n\t\tutil.extend( true,\n\t\t\t{ events: { 'input .wikitext-editor': 'onInputWikitextEditor' } },\n\t\t\toptions\n\t\t)\n\t);\n}\n\nmfExtend( SourceEditorOverlay, EditorOverlayBase, {\n\t/**\n\t * @inheritdoc\n\t * @memberof SourceEditorOverlay\n\t * @instance\n\t */\n\ttemplatePartials: util.extend( {}, EditorOverlayBase.prototype.templatePartials, {\n\t\tcontent: util.template( `\n<div lang=\"{{contentLang}}\" dir=\"{{contentDir}}\" class=\"editor-container content\">\n\t<textarea class=\"wikitext-editor\" id=\"wikitext-editor\" cols=\"40\" rows=\"10\" placeholder=\"{{placeholder}}\"></textarea>\n\t<div class=\"preview collapsible-headings-expanded mw-body-content\"></div>\n</div>\n\t\t` )\n\t} ),\n\t/**\n\t * @memberof SourceEditorOverlay\n\t * @instance\n\t */\n\teditor: 'wikitext',\n\t/**\n\t * @memberof SourceEditorOverlay\n\t * @instance\n\t */\n\tsectionLine: '',\n\n\t/**\n\t * @inheritdoc\n\t * @memberof SourceEditorOverlay\n\t * @instance\n\t */\n\tshow: function () {\n\t\tEditorOverlayBase.prototype.show.apply( this, arguments );\n\t\t// Ensure we do this after showing the overlay, otherwise it doesn't work.\n\t\tthis._resizeEditor();\n\t},\n\t/**\n\t * Wikitext Editor input handler\n\t *\n\t * @memberof SourceEditorOverlay\n\t * @instance\n\t */\n\tonInputWikitextEditor: function () {\n\t\tthis.gateway.setContent( this.$el.find( '.wikitext-editor' ).val() );\n\t\tthis.$el.find( '.continue, .submit' ).prop( 'disabled', false );\n\t},\n\t/**\n\t * @inheritdoc\n\t * @memberof SourceEditorOverlay\n\t * @instance\n\t */\n\tonClickBack: function () {\n\t\tEditorOverlayBase.prototype.onClickBack.apply( this, arguments );\n\t\tthis._hidePreview();\n\t},\n\t/**\n\t * @inheritdoc\n\t * @memberof SourceEditorOverlay\n\t * @instance\n\t */\n\tpostRender: function () {\n\t\tconst self = this;\n\n\t\t// log edit attempt\n\t\tthis.log( { action: 'ready' } );\n\t\tthis.log( { action: 'loaded' } );\n\n\t\tif ( this.currentPage.isVEVisualAvailable() ) {\n\t\t\tmw.loader.using( 'ext.visualEditor.switching' ).then( function () {\n\t\t\t\tconst toolFactory = new OO.ui.ToolFactory(),\n\t\t\t\t\ttoolGroupFactory = new OO.ui.ToolGroupFactory();\n\n\t\t\t\ttoolFactory.register( mw.libs.ve.MWEditModeVisualTool );\n\t\t\t\ttoolFactory.register( mw.libs.ve.MWEditModeSourceTool );\n\t\t\t\tconst switchToolbar = new OO.ui.Toolbar( toolFactory, toolGroupFactory, {\n\t\t\t\t\tclasses: [ 'editor-switcher' ]\n\t\t\t\t} );\n\n\t\t\t\tswitchToolbar.on( 'switchEditor', function ( mode ) {\n\t\t\t\t\tif ( mode === 'visual' ) {\n\t\t\t\t\t\tif ( !self.gateway.hasChanged ) {\n\t\t\t\t\t\t\tself._switchToVisualEditor();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Pass wikitext if there are changes.\n\t\t\t\t\t\t\tself._switchToVisualEditor( self.gateway.content );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} );\n\n\t\t\t\tswitchToolbar.setup( [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'editMode',\n\t\t\t\t\t\ttype: 'list',\n\t\t\t\t\t\ticon: 'edit',\n\t\t\t\t\t\ttitle: mw.msg( 'visualeditor-mweditmode-tooltip' ),\n\t\t\t\t\t\tinclude: [ 'editModeVisual', 'editModeSource' ]\n\t\t\t\t\t}\n\t\t\t\t] );\n\n\t\t\t\tself.$el.find( '.switcher-container' ).html( switchToolbar.$element );\n\t\t\t\tswitchToolbar.emit( 'updateState' );\n\t\t\t} );\n\t\t}\n\n\t\tEditorOverlayBase.prototype.postRender.apply( this );\n\n\t\t// This spinner is still used when displaying save/preview panel\n\t\tthis.$el.find( '.overlay-content' ).append( icons.spinner().$el );\n\t\tthis.hideSpinner();\n\n\t\tthis.$preview = this.$el.find( '.preview' );\n\t\tthis.$content = this.$el.find( '.wikitext-editor' );\n\t\t// The following classes can be used here:\n\t\t// * mw-editfont-monospace\n\t\t// * mw-editfont-sans-serif\n\t\t// * mw-editfont-serif\n\t\tthis.$content.addClass( 'mw-editfont-' + mw.user.options.get( 'editfont' ) );\n\n\t\t// make license links open in separate tabs\n\t\tthis.$el.find( '.license a' ).attr( 'target', '_blank' );\n\n\t\t// If in readOnly mode, make textarea readonly\n\t\tif ( this.readOnly ) {\n\t\t\tthis.$content.prop( 'readonly', true );\n\t\t}\n\n\t\tthis.$content\n\t\t\t.on( 'input', this._resizeEditor.bind( this ) )\n\t\t\t.one( 'input', function () {\n\t\t\t\tself.log( { action: 'firstChange' } );\n\t\t\t} );\n\n\t\tif ( this.isFirefox ) {\n\t\t\tthis.$content.on( 'mousedown', function () {\n\t\t\t\t// Support: Firefox Mobile\n\t\t\t\t// Firefox scrolls back to the top of the page *every time*\n\t\t\t\t// you tap on the textarea. This makes things slightly\n\t\t\t\t// more usable by restoring your scroll offset every time\n\t\t\t\t// the page scrolls for the next 1000ms.\n\t\t\t\t// The page will still flicker every time the user touches\n\t\t\t\t// to place the cursor, but this is better than completely\n\t\t\t\t// losing your scroll offset. (T214880)\n\t\t\t\tconst docEl = document.documentElement,\n\t\t\t\t\tscrollTop = docEl.scrollTop;\n\t\t\t\tfunction blockScroll() {\n\t\t\t\t\tdocEl.scrollTop = scrollTop;\n\t\t\t\t}\n\t\t\t\twindow.addEventListener( 'scroll', blockScroll );\n\t\t\t\tsetTimeout( function () {\n\t\t\t\t\twindow.removeEventListener( 'scroll', blockScroll );\n\t\t\t\t}, 1000 );\n\t\t\t} );\n\t\t}\n\n\t\t// Render edit summary\n\t\tthis.summaryTextArea = new OO.ui.MultilineTextInputWidget( {\n\t\t\tplaceholder: this.options.summaryMsg,\n\t\t\tclasses: [ 'summary' ],\n\t\t\tvalue: '',\n\t\t\tmaxRows: 2\n\t\t} );\n\t\tthis.$el.find( '.summary-input' ).append(\n\t\t\tthis.summaryTextArea.$element\n\t\t);\n\n\t\tthis._loadContent();\n\t},\n\n\t/**\n\t * Handles click on \"Edit without login\" in anonymous editing warning.\n\t *\n\t * @memberof SourceEditorOverlay\n\t * @instance\n\t * @private\n\t */\n\tonClickAnonymous: function () {\n\t\tthis.$anonWarning.hide();\n\t\tthis.$anonTalkWarning.hide();\n\t\t// reenable \"Next\" button\n\t\tthis.$anonHiddenButtons.show();\n\t\tthis.$content.show();\n\t\tthis._resizeEditor();\n\t},\n\n\t/**\n\t * Prepares the preview interface and reveals the save screen of the overlay\n\t *\n\t * @inheritdoc\n\t * @memberof SourceEditorOverlay\n\t * @instance\n\t */\n\tonStageChanges: function () {\n\t\tconst self = this,\n\t\t\tparams = {\n\t\t\t\ttext: this.getContent()\n\t\t\t};\n\n\t\tthis.scrollTop = util.getDocument().find( 'body' ).scrollTop();\n\t\tthis.$content.hide();\n\t\tthis.showSpinner();\n\n\t\tif ( mw.config.get( 'wgIsMainPage' ) ) {\n\t\t\tparams.mainpage = 1; // Setting it to 0 will have the same effect\n\t\t}\n\n\t\tfunction hideSpinnerAndShowPreview() {\n\t\t\tself.hideSpinner();\n\t\t\tself.$preview.show();\n\t\t\tmw.hook( 'wikipage.content' ).fire( self.$preview );\n\t\t}\n\n\t\tthis.gateway.getPreview( params ).then( function ( result ) {\n\t\t\tconst parsedText = result.text,\n\t\t\t\tparsedSectionLine = result.line;\n\n\t\t\tself.sectionId = result.id;\n\t\t\t// On desktop edit summaries strip tags. Mimic this behavior on mobile devices\n\t\t\tself.sectionLine = self.parseHTML( '<div>' ).html( parsedSectionLine ).text();\n\t\t\tnew Section( {\n\t\t\t\tel: self.$preview,\n\t\t\t\ttext: parsedText\n\t\t\t} ).$el.find( 'a' ).on( 'click', false );\n\n\t\t\thideSpinnerAndShowPreview();\n\t\t}, function () {\n\t\t\tself.$preview.replaceWith(\n\t\t\t\tnew MessageBox( {\n\t\t\t\t\ttype: 'error',\n\t\t\t\t\tmsg: mw.msg( 'mobile-frontend-editor-error-preview' )\n\t\t\t\t} ).$el\n\t\t\t);\n\t\t\thideSpinnerAndShowPreview();\n\t\t} );\n\n\t\tEditorOverlayBase.prototype.onStageChanges.apply( this, arguments );\n\t},\n\n\t/**\n\t * Hides the preview and reverts back to initial screen.\n\t *\n\t * @memberof SourceEditorOverlay\n\t * @instance\n\t * @private\n\t */\n\t_hidePreview: function () {\n\t\tthis.gateway.abortPreview();\n\t\tthis.hideSpinner();\n\t\t// FIXME: Don't rely on internals - we re-render template instead.\n\t\tthis.$preview.removeClass(\n\t\t\t'cdx-message--error'\n\t\t).hide();\n\t\tthis.$content.show();\n\t\twindow.scrollTo( 0, this.scrollTop );\n\t\tthis.showHidden( '.initial-header' );\n\t},\n\n\t/**\n\t * Resize the editor textarea, maintaining scroll position in iOS\n\t *\n\t * @memberof SourceEditorOverlay\n\t * @instance\n\t */\n\t_resizeEditor: function () {\n\t\tlet scrollTop, container, $scrollContainer;\n\n\t\tif ( !this.$scrollContainer ) {\n\t\t\tcontainer = OO.ui.Element.static\n\t\t\t\t.getClosestScrollableContainer( this.$content[ 0 ] );\n\t\t\t// The scroll container will be either within the view\n\t\t\t// or the document element itself.\n\t\t\t$scrollContainer = this.$el.find( container ).length ?\n\t\t\t\tthis.$el.find( container ) : util.getDocument();\n\t\t\tthis.$scrollContainer = $scrollContainer;\n\t\t\tthis.$content.css( 'padding-bottom', this.$scrollContainer.height() * 0.6 );\n\t\t} else {\n\t\t\t$scrollContainer = this.$scrollContainer;\n\t\t}\n\n\t\t// Only do this if scroll container exists\n\t\tif ( this.$content.prop( 'scrollHeight' ) && $scrollContainer.length ) {\n\t\t\tscrollTop = $scrollContainer.scrollTop();\n\t\t\tthis.$content\n\t\t\t\t.css( 'height', 'auto' )\n\t\t\t\t// can't reuse prop( 'scrollHeight' ) because we need the current value\n\t\t\t\t.css( 'height', ( this.$content.prop( 'scrollHeight' ) + 2 ) + 'px' );\n\t\t\t$scrollContainer.scrollTop( scrollTop );\n\t\t}\n\t},\n\n\t/**\n\t * Set content to the user input field.\n\t *\n\t * @memberof SourceEditorOverlay\n\t * @instance\n\t * @param {string} content The content to set.\n\t */\n\tsetContent: function ( content ) {\n\t\tthis.$content\n\t\t\t.show()\n\t\t\t.val( content );\n\t\tthis._resizeEditor();\n\t},\n\n\t/**\n\t * Returns the content of the user input field.\n\t *\n\t * @memberof SourceEditorOverlay\n\t * @instance\n\t * @return {string}\n\t */\n\tgetContent: function () {\n\t\treturn this.$content.val();\n\t},\n\n\t/**\n\t * Requests content from the API and reveals it in UI.\n\t *\n\t * @memberof SourceEditorOverlay\n\t * @instance\n\t * @private\n\t */\n\t_loadContent: function () {\n\t\tconst self = this;\n\n\t\tthis.$content.hide();\n\n\t\tthis.getLoadingPromise()\n\t\t\t.then( function ( result ) {\n\t\t\t\tconst content = result.text;\n\n\t\t\t\tself.setContent( content );\n\n\t\t\t\t// If the loaded content is not the default content, enable the save button\n\t\t\t\tif ( self.hasChanged() ) {\n\t\t\t\t\tself.$el.find( '.continue, .submit' ).prop( 'disabled', false );\n\t\t\t\t}\n\n\t\t\t\tconst options = self.options;\n\t\t\t\tconst showAnonWarning = options.isAnon && !options.switched;\n\n\t\t\t\tif ( showAnonWarning ) {\n\t\t\t\t\tself.$anonWarning = self.createAnonWarning( options );\n\t\t\t\t\tself.$anonTalkWarning = self.createAnonTalkWarning();\n\t\t\t\t\tself.$el.find( '.editor-container' ).append( [ self.$anonTalkWarning, self.$anonWarning ] );\n\t\t\t\t\tself.$content.hide();\n\t\t\t\t\t// the user has to click login, signup or edit without login,\n\t\t\t\t\t// disable \"Next\" button on top right\n\t\t\t\t\tself.$anonHiddenButtons = self.$el.find( '.overlay-header .continue' ).hide();\n\t\t\t\t}\n\n\t\t\t\tif ( self.gateway.fromModified ) {\n\t\t\t\t\t// Trigger intial EditorGateway#setContent and update save button\n\t\t\t\t\tself.onInputWikitextEditor();\n\t\t\t\t}\n\n\t\t\t\tself.showEditNotices();\n\t\t\t} );\n\t},\n\n\t/**\n\t * Loads a {VisualEditorOverlay} and replaces the existing SourceEditorOverlay with it\n\t * based on the current option values.\n\t *\n\t * @memberof SourceEditorOverlay\n\t * @instance\n\t * @private\n\t * @param {string} [wikitext] Wikitext to pass to VE\n\t */\n\t_switchToVisualEditor: function ( wikitext ) {\n\t\tconst self = this;\n\t\tthis.log( {\n\t\t\taction: 'abort',\n\t\t\ttype: 'switchnochange',\n\t\t\tmechanism: 'navigate'\n\t\t} );\n\t\tthis.logFeatureUse( {\n\t\t\tfeature: 'editor-switch',\n\t\t\taction: 'visual-mobile'\n\t\t} );\n\n\t\t// Save a user setting indicating that this user prefers using the VisualEditor\n\t\tsetPreferredEditor( 'VisualEditor' );\n\n\t\tthis.$el.addClass( 'switching' );\n\t\tthis.$el.find( '.overlay-header-container' ).hide();\n\t\tthis.$el.append( fakeToolbar() );\n\t\tthis.$content.prop( 'readonly', true );\n\n\t\tmw.loader.using( 'ext.visualEditor.targetLoader' ).then( function () {\n\t\t\tmw.libs.ve.targetLoader.addPlugin( 'ext.visualEditor.mobileArticleTarget' );\n\t\t\treturn mw.libs.ve.targetLoader.loadModules( 'visual' );\n\t\t} ).then(\n\t\t\tfunction () {\n\t\t\t\tconst options = self.getOptionsForSwitch();\n\t\t\t\toptions.SourceEditorOverlay = SourceEditorOverlay;\n\t\t\t\tif ( wikitext ) {\n\t\t\t\t\toptions.dataPromise = mw.libs.ve.targetLoader.requestPageData( 'visual', mw.config.get( 'wgRelevantPageName' ), {\n\t\t\t\t\t\tsection: options.sectionId,\n\t\t\t\t\t\toldId: options.oldId || mw.config.get( 'wgRevisionId' ),\n\t\t\t\t\t\ttargetName: 'mobile',\n\t\t\t\t\t\tmodified: true,\n\t\t\t\t\t\twikitext: wikitext\n\t\t\t\t\t} );\n\t\t\t\t} else {\n\t\t\t\t\tdelete options.dataPromise;\n\t\t\t\t}\n\n\t\t\t\tconst newOverlay = new VisualEditorOverlay( options );\n\t\t\t\tnewOverlay.getLoadingPromise().then( function () {\n\t\t\t\t\tself.switching = true;\n\t\t\t\t\tself.overlayManager.replaceCurrent( newOverlay );\n\t\t\t\t\tself.switching = false;\n\t\t\t\t} );\n\t\t\t},\n\t\t\tfunction () {\n\t\t\t\tself.$el.removeClass( 'switching' );\n\t\t\t\tself.$el.find( '.overlay-header-container' ).show();\n\t\t\t\tself.$el.find( '.ve-mobile-fakeToolbar-container' ).remove();\n\t\t\t\tself.$content.prop( 'readonly', false );\n\t\t\t\t// FIXME: We should show an error notification, but right now toast\n\t\t\t\t// notifications are not dismissible when shown within the editor.\n\t\t\t}\n\t\t);\n\t},\n\n\t/**\n\t * Get the current edit summary.\n\t *\n\t * @memberof SourceEditorOverlay\n\t * @return {string}\n\t */\n\tgetEditSummary: function () {\n\t\treturn this.summaryTextArea.getValue();\n\t},\n\n\t/**\n\t * Executed when the editor clicks the save/publish button. Handles logging and submitting\n\t * the save action to the editor API.\n\t *\n\t * @inheritdoc\n\t * @memberof SourceEditorOverlay\n\t * @instance\n\t */\n\tonSaveBegin: function () {\n\t\tconst self = this,\n\t\t\toptions = {\n\t\t\t\tsummary: this.getEditSummary()\n\t\t\t};\n\n\t\tif ( self.sectionLine !== '' ) {\n\t\t\toptions.summary = '/* ' + self.sectionLine + ' */' + options.summary;\n\t\t}\n\t\tEditorOverlayBase.prototype.onSaveBegin.apply( this, arguments );\n\t\tif ( this.confirmAborted ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( this.captchaId ) {\n\t\t\toptions.captchaId = this.captchaId;\n\t\t\toptions.captchaWord = this.$el.find( '.captcha-word' ).val();\n\t\t}\n\n\t\tthis.showHidden( '.saving-header' );\n\n\t\tthis.gateway.save( options )\n\t\t\t.then( function ( newRevId, redirectUrl, tempUserCreated ) {\n\t\t\t\tconst title = self.options.title;\n\t\t\t\t// Special case behaviour of main page\n\t\t\t\tif ( mw.config.get( 'wgIsMainPage' ) && !redirectUrl ) {\n\t\t\t\t\t// FIXME: Blocked on T189173\n\t\t\t\t\t// eslint-disable-next-line no-restricted-properties\n\t\t\t\t\twindow.location = mw.util.getUrl( title );\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tself.onSaveComplete( newRevId, redirectUrl, tempUserCreated );\n\n\t\t\t\tif ( redirectUrl && tempUserCreated ) {\n\t\t\t\t\t// eslint-disable-next-line no-restricted-properties\n\t\t\t\t\twindow.location.href = redirectUrl;\n\t\t\t\t}\n\t\t\t}, function ( data ) {\n\t\t\t\tself.onSaveFailure( data );\n\t\t\t} );\n\t},\n\n\t/**\n\t * @inheritdoc\n\t * @memberof SourceEditorOverlay\n\t * @instance\n\t * @param {number|null} newRevId ID of the newly created revision, or null if it was a\n\t * null edit.\n\t * @param {string} [redirectUrl] URL to redirect to, if different than the current URL.\n\t * @param {boolean} [tempUserCreated] Whether a temporary user was created\n\t */\n\tonSaveComplete: function ( newRevId, redirectUrl ) {\n\t\tEditorOverlayBase.prototype.onSaveComplete.apply( this, arguments );\n\n\t\t// The parent class changes the location hash in a setTimeout, so wait\n\t\t// for that to happen before reloading.\n\t\tsetTimeout( function () {\n\t\t\tif ( redirectUrl ) {\n\t\t\t\t// eslint-disable-next-line no-restricted-properties\n\t\t\t\twindow.location.href = redirectUrl;\n\t\t\t} else if ( newRevId ) {\n\t\t\t\t// Set a notify parameter similar to venotify in VisualEditor.\n\t\t\t\tconst url = new URL( location.href );\n\t\t\t\turl.searchParams.set( 'mfnotify', this.isNewPage ? 'created' : 'saved' );\n\t\t\t\t// eslint-disable-next-line no-restricted-properties\n\t\t\t\twindow.location.search = url.search;\n\t\t\t} else {\n\t\t\t\t// Null edit; do not add notify parameter.\n\t\t\t\t// Note the \"#\" may be in the URL.\n\t\t\t\t// If so, using window.location alone will not reload the page\n\t\t\t\t// we need to forcefully refresh\n\t\t\t\t// eslint-disable-next-line no-restricted-properties\n\t\t\t\twindow.location.reload();\n\t\t\t}\n\t\t} );\n\t},\n\n\t/**\n\t * @inheritdoc\n\t * @memberof SourceEditorOverlay\n\t * @instance\n\t */\n\tshowSaveCompleteMsg: function ( action, tempUserCreated ) {\n\t\t__non_webpack_require__( 'mediawiki.action.view.postEdit' ).fireHookOnPageReload( action, tempUserCreated );\n\t},\n\n\t/**\n\t * Executed when page save fails. Handles error display and bookkeeping,\n\t * passes logging duties to the parent.\n\t *\n\t * @inheritdoc\n\t * @memberof SourceEditorOverlay\n\t * @instance\n\t */\n\tonSaveFailure: function ( data ) {\n\t\tlet msg, noRetry;\n\n\t\tif ( data.edit && data.edit.captcha ) {\n\t\t\tthis.captchaId = data.edit.captcha.id;\n\t\t\tthis.handleCaptcha( data.edit.captcha );\n\t\t} else {\n\t\t\tmsg = saveFailureMessage( data );\n\t\t\tthis.reportError( msg );\n\t\t\tthis.showHidden( '.save-header, .save-panel' );\n\n\t\t\t// Some errors may be temporary, but for others we know for sure that the save will\n\t\t\t// never succeed, so don't confuse the user by giving them the option to retry.\n\t\t\tnoRetry = data.errors && data.errors.some( function ( error ) {\n\t\t\t\treturn error.code === 'abusefilter-disallowed';\n\t\t\t} );\n\n\t\t\tif ( noRetry ) {\n\t\t\t\t// disable continue and save buttons, reenabled when user changes content\n\t\t\t\tthis.$el.find( '.continue, .submit' ).prop( 'disabled', true );\n\t\t\t}\n\t\t}\n\n\t\tEditorOverlayBase.prototype.onSaveFailure.apply( this, arguments );\n\t},\n\n\t/**\n\t * Checks whether the existing content has changed.\n\t *\n\t * @memberof SourceEditorOverlay\n\t * @instance\n\t * @return {boolean}\n\t */\n\thasChanged: function () {\n\t\treturn this.gateway.hasChanged;\n\t}\n} );\n\nmodule.exports = SourceEditorOverlay;\n","/* global ve, $ */\nconst EditorOverlayBase = require( './EditorOverlayBase' ),\n\tEditorGateway = require( './EditorGateway' ),\n\tfakeToolbar = require( '../mobile.init/fakeToolbar' ),\n\tmfExtend = require( '../mobile.startup/mfExtend' ),\n\trouter = __non_webpack_require__( 'mediawiki.router' ),\n\tidentifyLeadParagraph = require( './identifyLeadParagraph' ),\n\tsetPreferredEditor = require( './setPreferredEditor' ),\n\tutil = require( '../mobile.startup/util' ),\n\tOverlayManager = require( '../mobile.startup/OverlayManager' ),\n\toverlayManager = OverlayManager.getSingleton(),\n\tcurrentPage = require( '../mobile.startup/currentPage' );\n\n/**\n * Overlay for VisualEditor view\n *\n * @class VisualEditorOverlay\n * @extends EditorOverlayBase\n * @private\n *\n * @param {Object} options Configuration options\n * @param {SourceEditorOverlay} options.SourceEditorOverlay Class to use for standard\n * Wikitext editor. It must be passed in explicitly to avoid a cyclic\n * dependency between VisualEditorOverlay and SourceEditorOverlay\n */\nfunction VisualEditorOverlay( options ) {\n\tconst surfaceReady = util.Deferred();\n\n\tEditorOverlayBase.call( this,\n\t\tutil.extend( {\n\t\t\teditSwitcher: false,\n\t\t\thasToolbar: true,\n\t\t\tonBeforeExit: this.onBeforeExit.bind( this ),\n\t\t\tisBorderBox: false,\n\t\t\tclassName: 'overlay editor-overlay editor-overlay-ve'\n\t\t}, options )\n\t);\n\tthis.SourceEditorOverlay = options.SourceEditorOverlay;\n\tthis.isNewPage = options.isNewPage;\n\tthis.fromModified = options.dataPromise && options.switched;\n\n\t// VE surfaces must be attached to the DOM while initializing, and measurable\n\tthis.$el.addClass( 'editor-overlay-ve-initializing' );\n\toverlayManager.container.appendChild( this.$el[ 0 ] );\n\n\t// Gateway present for a few utility purposes; the VE articletarget\n\t// handles the actual API calls separately\n\tthis.gateway = new EditorGateway( {\n\t\tapi: options.api,\n\t\ttitle: options.title,\n\t\tsectionId: options.sectionId,\n\t\toldId: options.oldId\n\t} );\n\n\tthis.origDataPromise = this.options.dataPromise || mw.libs.ve.targetLoader.requestPageData(\n\t\t'visual',\n\t\toptions.titleObj.getPrefixedDb(),\n\t\t{\n\t\t\tsessionStore: true,\n\t\t\tsection: options.sectionId || null,\n\t\t\toldId: options.oldId || undefined,\n\t\t\ttargetName: ve.init.mw.MobileArticleTarget.static.trackingName,\n\t\t\tpreload: options.preload,\n\t\t\tpreloadparams: options.preloadparams,\n\t\t\teditintro: options.editintro\n\t\t}\n\t);\n\n\tconst modes = [];\n\tthis.currentPage = currentPage();\n\tif ( this.currentPage.isVEVisualAvailable() ) {\n\t\tmodes.push( 'visual' );\n\t}\n\tif ( this.currentPage.isVESourceAvailable() ) {\n\t\tmodes.push( 'source' );\n\t}\n\n\tthis.target = ve.init.mw.targetFactory.create( 'article', this, {\n\t\t$element: this.$el,\n\t\t// string or null, but not undefined\n\t\tsection: this.options.sectionId || null,\n\t\tmodes: modes,\n\t\t// If source is passed in without being in modes, it'll just fall back to visual\n\t\tdefaultMode: this.options.mode === 'source' ? 'source' : 'visual'\n\t} );\n\tthis.target.once( 'surfaceReady', function () {\n\t\tsurfaceReady.resolve();\n\n\t\tthis.target.getSurface().getModel().getDocument().once( 'transact', function () {\n\t\t\tthis.log( { action: 'firstChange' } );\n\t\t}.bind( this ) );\n\t}.bind( this ) );\n\tlet firstLoad = true;\n\tthis.target.on( 'surfaceReady', function () {\n\t\tsetPreferredEditor( this.target.getDefaultMode() === 'source' ? 'SourceEditor' : 'VisualEditor' );\n\t\t// On first surfaceReady we wait for any dialogs to be closed before running targetInit.\n\t\t// On subsequent surfaceReady's (i.e. edit mode switch) we can initialize immediately.\n\t\tif ( !firstLoad ) {\n\t\t\tthis.targetInit();\n\t\t}\n\t\tfirstLoad = false;\n\t}.bind( this ) );\n\n\tthis.target.load( this.origDataPromise );\n\n\t// Overlay is only shown after this is resolved. It must be resolved\n\t// with the API response regardless of what we are waiting for.\n\tthis.dataPromise = this.origDataPromise.then( function ( data ) {\n\t\tthis.gateway.wouldautocreate =\n\t\t\tdata && data.visualeditor && data.visualeditor.wouldautocreate;\n\n\t\treturn surfaceReady.then( function () {\n\t\t\tthis.$el.removeClass( 'editor-overlay-ve-initializing' );\n\t\t\treturn data && data.visualeditor;\n\t\t}.bind( this ) );\n\t}.bind( this ) );\n}\n\nmfExtend( VisualEditorOverlay, EditorOverlayBase, {\n\t/**\n\t * @inheritdoc\n\t * @memberof VisualEditorOverlay\n\t * @instance\n\t */\n\ttemplatePartials: util.extend( {}, EditorOverlayBase.prototype.templatePartials, {\n\t\teditHeader: util.template( `\n<div class=\"overlay-header header initial-header hideable hidden\">\n\t<div class=\"toolbar\"></div>\n</div>\n\t\t` ),\n\t\tcontent: util.template( `\n<div class=\"surface\" lang=\"{{contentLang}}\" dir=\"{{contentDir}}\">\n</div>\n\t\t` )\n\t} ),\n\t/**\n\t * @memberof VisualEditorOverlay\n\t * @instance\n\t */\n\teditor: 'visualeditor',\n\t/**\n\t * Destroy the existing VisualEditor target.\n\t *\n\t * @memberof VisualEditorOverlay\n\t * @instance\n\t */\n\tdestroyTarget: function () {\n\t\tif ( this.target ) {\n\t\t\tthis.target.destroy();\n\t\t\tthis.target = null;\n\t\t}\n\t},\n\t/**\n\t * @inheritdoc\n\t * @memberof VisualEditorOverlay\n\t * @instance\n\t */\n\tshow: function () {\n\t\tconst\n\t\t\toptions = this.options,\n\t\t\tshowAnonWarning = options.isAnon && !options.switched;\n\n\t\tEditorOverlayBase.prototype.show.apply( this, arguments );\n\n\t\t// log edit attempt\n\t\tthis.log( { action: 'ready' } );\n\t\tthis.log( { action: 'loaded' } );\n\n\t\tif ( !showAnonWarning ) {\n\t\t\tthis.targetInit();\n\t\t} else {\n\t\t\tthis.$anonWarning = this.createAnonWarning( this.options );\n\t\t\tthis.$anonTalkWarning = this.createAnonTalkWarning();\n\t\t\tthis.$el.append( [ this.$anonTalkWarning, this.$anonWarning ] );\n\t\t\tthis.$el.find( '.overlay-content' ).hide();\n\t\t}\n\n\t\tthis.emit( 'editor-loaded' );\n\t},\n\t/**\n\t * Initialize the target after it has been made visible\n\t * @memberof VisualEditorOverlay\n\t */\n\ttargetInit: function () {\n\t\t// Note this.target will not be set if an error occurred and/or destroyTarget was called.\n\t\tif ( this.target ) {\n\t\t\tthis.target.afterSurfaceReady();\n\t\t\tthis.scrollToLeadParagraph();\n\t\t\tthis.showEditNotices();\n\t\t}\n\t},\n\t/**\n\t * Scroll so that the lead paragraph in edit mode shows at the same place on the screen\n\t * as the lead paragraph in read mode.\n\t *\n\t * Their normal position is different because of (most importantly) the lead paragraph\n\t * transformation to move it before the infobox, and also invisible templates and slugs\n\t * caused by the presence of hatnote templates (both only shown in edit mode).\n\t * @memberof VisualEditorOverlay\n\t */\n\tscrollToLeadParagraph: function () {\n\t\tlet editLead, editLeadView, readLead, offset, initialCursorOffset;\n\n\t\tconst\n\t\t\tcurrentPageHTMLParser = this.options.currentPageHTMLParser,\n\t\t\tfakeScroll = this.options.fakeScroll,\n\t\t\t$window = $( window ),\n\t\t\tsection = this.target.section,\n\t\t\tsurface = this.target.getSurface(),\n\t\t\tmode = surface.getMode();\n\n\t\tif ( ( section === null || section === '0' ) && mode === 'visual' ) {\n\t\t\teditLead = identifyLeadParagraph( surface.getView().$attachedRootNode );\n\t\t\tif ( currentPageHTMLParser.getLeadSectionElement() ) {\n\t\t\t\treadLead = identifyLeadParagraph( currentPageHTMLParser.getLeadSectionElement() );\n\t\t\t}\n\n\t\t\tif ( editLead && readLead ) {\n\t\t\t\toffset = $( editLead ).offset().top - ( $( readLead ).offset().top - fakeScroll );\n\t\t\t\t// Set a model range to match\n\t\t\t\teditLeadView = $( editLead ).data( 'view' );\n\t\t\t\tif ( editLeadView ) {\n\t\t\t\t\tsurface.getModel().setLinearSelection(\n\t\t\t\t\t\tnew ve.Range( editLeadView.getModel().getRange().start )\n\t\t\t\t\t);\n\t\t\t\t\tinitialCursorOffset =\n\t\t\t\t\t\tsurface.getView().getSelection().getSelectionBoundingRect().top;\n\t\t\t\t\t// Ensure the surface is tall enough to scroll the cursor into view\n\t\t\t\t\tsurface.$element.css( 'min-height', $window.height() + initialCursorOffset - surface.padding.top );\n\t\t\t\t}\n\t\t\t\t$window.scrollTop( offset );\n\t\t\t}\n\t\t}\n\t},\n\t/**\n\t * @inheritdoc\n\t * @memberof VisualEditorOverlay\n\t * @instance\n\t */\n\tonBeforeExit: function ( exit, cancel ) {\n\t\tconst overlay = this;\n\t\tEditorOverlayBase.prototype.onBeforeExit.call( this, function () {\n\t\t\t// If this function is called, the parent method has decided that we should exit\n\t\t\texit();\n\t\t\t// VE-specific cleanup\n\t\t\toverlay.destroyTarget();\n\t\t}, cancel );\n\t},\n\t/**\n\t * @inheritdoc\n\t * @memberof VisualEditorOverlay\n\t * @instance\n\t */\n\tonClickBack: function () {\n\t\tEditorOverlayBase.prototype.onClickBack.apply( this, arguments );\n\t\tthis.switchToEditor();\n\t},\n\t/**\n\t * @inheritdoc\n\t * @memberof VisualEditorOverlay\n\t * @instance\n\t */\n\tonClickAnonymous: function () {\n\t\tconst self = this;\n\t\tthis.$anonWarning.hide();\n\t\tthis.$anonTalkWarning.hide();\n\t\tself.$el.find( '.overlay-content' ).show();\n\t\tthis.targetInit();\n\t},\n\t/**\n\t * Reveal the editing interface.\n\t *\n\t * @memberof VisualEditorOverlay\n\t * @instance\n\t */\n\tswitchToEditor: function () {\n\t\tthis.showHidden( '.initial-header' );\n\t},\n\t/**\n\t * Loads an {SourceEditorOverlay} and replaces the existing {VisualEditorOverlay}\n\t *\n\t * @memberof VisualEditorOverlay\n\t * @instance\n\t * @param {jQuery.Promise} [dataPromise] Optional promise for loading content\n\t */\n\tswitchToSourceEditor: function ( dataPromise ) {\n\t\tconst self = this,\n\t\t\tSourceEditorOverlay = this.SourceEditorOverlay,\n\t\t\toptions = this.getOptionsForSwitch();\n\t\tthis.log( {\n\t\t\taction: 'abort',\n\t\t\ttype: 'switchnochange',\n\t\t\tmechanism: 'navigate'\n\t\t} );\n\t\tthis.logFeatureUse( {\n\t\t\tfeature: 'editor-switch',\n\t\t\taction: 'source-mobile'\n\t\t} );\n\n\t\t// Save a user setting indicating that this user prefers using the SourceEditor\n\t\tsetPreferredEditor( 'SourceEditor' );\n\n\t\tthis.$el.addClass( 'switching' );\n\t\tthis.$el.find( '.overlay-header-container' ).hide();\n\t\tthis.$el.append( fakeToolbar() );\n\t\tthis.target.getSurface().setReadOnly( true );\n\n\t\tif ( dataPromise ) {\n\t\t\t// If switching with edits we can't stay in section editing, as a VE edit\n\t\t\t// can always affect the whole document (e.g. references)\n\t\t\toptions.sectionId = null;\n\t\t\trouter.navigateTo( document.title, {\n\t\t\t\tpath: '#/editor/all',\n\t\t\t\tuseReplaceState: true\n\t\t\t} );\n\t\t}\n\t\tconst newOverlay = new SourceEditorOverlay( options, dataPromise );\n\t\tnewOverlay.getLoadingPromise().then( function () {\n\t\t\tself.switching = true;\n\t\t\tself.overlayManager.replaceCurrent( newOverlay );\n\t\t\tself.switching = false;\n\t\t} );\n\t},\n\t/**\n\t * @inheritdoc\n\t * @memberof VisualEditorOverlay\n\t * @instance\n\t */\n\thasChanged: function () {\n\t\tif ( this.saved ) {\n\t\t\t// If we just saved, there's not really any changes, and the\n\t\t\t// target is going to be destroyed in one tick\n\t\t\treturn false;\n\t\t}\n\t\treturn this.fromModified || (\n\t\t\tthis.target &&\n\t\t\tthis.target.getSurface() &&\n\t\t\tthis.target.getSurface().getModel().hasBeenModified()\n\t\t);\n\t}\n} );\n\nmodule.exports = VisualEditorOverlay;\n","const\n\tDrawer = require( '../mobile.startup/Drawer' ),\n\tBlockMessageDetails = require( './BlockMessageDetails' );\n\n/**\n * @private\n * @typedef {Object} BlockMessageOptions\n * @property {number} blockId representing the block\n * @property {boolean} partial is this a partial block?\n * @property {Object} creator\n * @property {string} creator.name of the blocker\n * @property {string} creator.url associated with the block\n * @property {string} reason for block\n * @property {string} [duration] of block e.g. \"1 week\"\n * @property {string} [expiry] of block, wrapped in parentheses\n * e.g. \"(1st September 2019)\"\n */\n\n/**\n * This creates the drawer at the bottom of the screen that appears when a\n * blocked user tries to edit.\n *\n * @private\n * @param {BlockMessageOptions} props\n * @return {module:mobile.startup/Drawer}\n */\nmodule.exports = function blockMessageDrawer( props ) {\n\tconst blockDrawer = new Drawer( {\n\t\tclassName: 'drawer block-message',\n\t\tonBeforeHide: function ( drawer ) {\n\t\t\tdrawer.$el.remove();\n\t\t},\n\t\tonShow: function () {\n\t\t\tconst $drawer = blockDrawer.$el.find( '.drawer.block-message' ),\n\t\t\t\tdrawerTop = $drawer.offset().top - 100,\n\t\t\t\tcreatorTop = blockDrawer.$el.find( '.block-message-creator' ).offset().top - 100,\n\t\t\t\tbuttonsTop = blockDrawer.$el.find( '.block-message-buttons' ).offset().top - 100,\n\t\t\t\t$seeMore = blockDrawer.$el.find( '.block-message-see-more' ),\n\t\t\t\twiki = mw.config.get( 'wgDBname' );\n\n\t\t\t$drawer.css( 'top', drawerTop + ( buttonsTop - creatorTop ) );\n\t\t\t$seeMore.on(\n\t\t\t\t'click',\n\t\t\t\tfunction () {\n\t\t\t\t\tconst $container = blockDrawer.$el.find( '.block-message-container' );\n\t\t\t\t\t$drawer.css( 'top', 0 );\n\t\t\t\t\t$container.css( 'overflow-y', 'auto' );\n\t\t\t\t\t$container.css( 'height', buttonsTop - $container.offset().top );\n\t\t\t\t\t$seeMore.hide();\n\n\t\t\t\t\tif ( mw.config.get( 'wgMFTrackBlockNotices' ) ) {\n\t\t\t\t\t\tmw.track( 'counter.MediaWiki.BlockNotices.' + wiki + '.MobileFrontend.reasonShown', 1 );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tif ( mw.config.get( 'wgMFTrackBlockNotices' ) ) {\n\t\t\t\tmw.track( 'counter.MediaWiki.BlockNotices.' + wiki + '.MobileFrontend.shown', 1 );\n\t\t\t}\n\t\t},\n\t\tchildren: [\n\t\t\t( new BlockMessageDetails( props ) ).$el\n\t\t]\n\t} );\n\treturn blockDrawer;\n};\n","/* global $ */\n/**\n * Find first paragraph that has text content, i.e. paragraphs that are not empty.\n * Keep in sync with MoveLeadParagraphTransform::identifyLeadParagraph().\n *\n * @private\n * @param {jQuery} $body Where to search for paragraphs\n * @return {Node|null} The lead paragraph\n */\nmodule.exports = function identifyLeadParagraph( $body ) {\n\t// Keep in sync with MoveLeadParagraphTransform::isNotEmptyNode()\n\tfunction isNotEmptyNode( node ) {\n\t\t// Ignore VE whitespace characters\n\t\treturn !/^[\\s↵➞]*$/.test( node.textContent );\n\t}\n\n\t// Keep in sync with MoveLeadParagraphTransform::isNonLeadParagraph()\n\tfunction isNonLeadParagraph( node ) {\n\t\tnode = node.cloneNode( true );\n\t\tconst $node = $( node );\n\t\t// The paragraph itself can be an invisible template (T293834)\n\t\tif ( $node.hasClass( 've-ce-focusableNode-invisible' ) ) {\n\t\t\treturn true;\n\t\t}\n\t\t// Ignore non-content nodes, TemplateStyles and coordinates\n\t\t$node.find( '.ve-ce-branchNode-inlineSlug, .ve-ce-focusableNode-invisible, style, span#coordinates' ).remove();\n\t\tif ( isNotEmptyNode( node ) ) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n\tconst $paragraphs = $body.children( 'p' );\n\tfor ( let i = 0; i < $paragraphs.length; i++ ) {\n\t\tconst p = $paragraphs[ i ];\n\t\tif ( !isNonLeadParagraph( p ) ) {\n\t\t\treturn p;\n\t\t}\n\t}\n\treturn null;\n};\n","const m = require( './../mobile.startup/moduleLoaderSingleton' ),\n\tSourceEditorOverlay = require( './SourceEditorOverlay' ),\n\tVisualEditorOverlay = require( './VisualEditorOverlay' );\n\n// Exposed for MobileFrontend mobile.init usage.\nm.define( 'mobile.editor.overlay/SourceEditorOverlay', SourceEditorOverlay );\nm.define( 'mobile.editor.overlay/VisualEditorOverlay', VisualEditorOverlay );\n","const util = require( '../mobile.startup/util' );\n\n/**\n * @param {string} blockinfo\n * @return {Object}\n */\nmodule.exports = function parseBlockInfo( blockinfo ) {\n\tconst blockInfo = {\n\t\tpartial: blockinfo.blockpartial || false,\n\t\tnoCreateAccount: blockinfo.blocknocreate || false,\n\t\tanonOnly: blockinfo.blockanononly === undefined ? true : blockinfo.blockanononly,\n\t\tcreator: {\n\t\t\tname: blockinfo.blockedby,\n\t\t\turl: null\n\t\t},\n\t\texpiry: null,\n\t\tduration: null,\n\t\treason: '',\n\t\tblockId: blockinfo.blockid\n\t};\n\n\t// Workaround to parse a message parameter for mw.message, see T96885\n\tfunction jqueryMsgParse( wikitext ) {\n\t\tconst parser = new mw.jqueryMsg.Parser();\n\t\ttry {\n\t\t\tconst ast = parser.wikiTextToAst( wikitext );\n\t\t\treturn parser.emitter.emit( ast ).html();\n\t\t} catch ( e ) {\n\t\t\t// Ignore error as it's probably the parser error. Usually this is because we\n\t\t\t// can't parse templates.\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t// URL only useful if block creator is a local user\n\tif ( blockinfo.blockedbyid === 0 ) {\n\t\tblockInfo.creator.url = '';\n\t} else {\n\t\tblockInfo.creator.url = mw.Title.makeTitle(\n\t\t\tmw.config.get( 'wgNamespaceIds' ).user,\n\t\t\tblockInfo.creator.name\n\t\t).getUrl();\n\t}\n\n\tif ( [ 'infinite', 'indefinite', 'infinity', 'never' ].indexOf( blockinfo.blockexpiry ) === -1 ) {\n\t\tblockInfo.expiry = mw.message( 'parentheses', blockinfo.blockexpiryformatted ).escaped();\n\t\tblockInfo.duration = blockinfo.blockexpiryrelative;\n\t}\n\n\tconst reason = blockinfo.blockreason;\n\tif ( reason ) {\n\t\tblockInfo.reason = jqueryMsgParse( reason ) || mw.html.escape( reason );\n\t\tblockInfo.parsedReason = ( new mw.Api() ).get( {\n\t\t\taction: 'parse',\n\t\t\tformatversion: 2,\n\t\t\ttext: reason,\n\t\t\tcontentmodel: 'wikitext'\n\t\t} ).then( function ( result ) {\n\t\t\treturn result.parse.text;\n\t\t} ).catch( function () {\n\t\t\treturn jqueryMsgParse( reason ) || mw.html.escape( reason );\n\t\t} );\n\t} else {\n\t\tblockInfo.reason = mw.message( 'mobile-frontend-editor-generic-block-reason' ).escaped();\n\t\tblockInfo.parsedReason = util.Deferred().resolve( blockInfo.reason ).promise();\n\t}\n\n\treturn blockInfo;\n};\n","/**\n * Build a save failure message from the API response\n *\n * @param {Object} data API response\n * @return {string} message HTML text describing the failure for display to the user\n */\nmodule.exports = function saveFailureMessage( data ) {\n\t// In most cases, return the error message from the API directly.\n\t// Handle a few exceptions where it is unsuitable for end-users\n\t// (some error messages are seemingly intended for tool developers).\n\n\tconst code = data && data.errors && data.errors[0] && data.errors[0].code;\n\n\tif ( code === 'editconflict' ) {\n\t\treturn mw.msg( 'mobile-frontend-editor-error-conflict' );\n\t}\n\n\tif ( code === 'readonly' ) {\n\t\treturn data.errors[0].html + '<br>' + data.errors[0].data.readonlyreason;\n\t}\n\n\tif ( data.errors && data.errors[0] ) {\n\t\treturn data.errors[0].html;\n\t}\n\n\t// This probably indicates a connection problem and a \"fake\" response\n\t// generated by mediawiki.Api. TODO Give a better error message here.\n\treturn '';\n};\n","/**\n * Store the user's preferred editor\n *\n * @param {string} editor 'VisualEditor' or 'SourceEditor'\n */\nmodule.exports = function setPreferredEditor( editor ) {\n\tif ( mw.user.isNamed() ) {\n\t\tnew mw.Api().saveOption( 'mobile-editor', editor ).then( function () {\n\t\t\tmw.user.options.set( 'mobile-editor', editor );\n\t\t} );\n\t} else {\n\t\tmw.storage.set( 'preferredEditor', editor );\n\t}\n};\n","const util = require( './util.js' ),\n\tmfExtend = require( './mfExtend' ),\n\tView = require( './View' );\n\n/**\n * Builds a section of a page\n *\n * @extends module:mobile.startup/View\n * @ignore\n * @param {Object} options Configuration options\n */\nfunction Section( options ) {\n\tconst self = this;\n\toptions.tag = 'h' + options.level;\n\tthis.line = options.line;\n\tthis.text = options.text;\n\tthis.hasReferences = options.hasReferences || false;\n\tthis.id = options.id || null;\n\tthis.anchor = options.anchor;\n\tthis.subsections = [];\n\t( options.subsections || [] ).forEach( ( section ) => self.subsections.push(\n\t\tnew Section( section ) ) );\n\tView.call( this, options );\n}\n\nmfExtend( Section, View, {\n\ttemplate: util.template( `\n<h{{level}} id=\"{{anchor}}\">{{{line}}}</h{{level}}>\n{{{text}}}\n\t` ),\n\t/**\n\t * @memberof Section\n\t * @instance\n\t * @mixes module:mobile.startup/View#defaults\n\t * @property {Object} defaults Default options hash.\n\t * @property {string} defaults.text Section text.\n\t */\n\tdefaults: {\n\t\tline: undefined,\n\t\ttext: ''\n\t}\n} );\n\nmodule.exports = Section;\n"],"names":["_typeof","o","Symbol","iterator","constructor","prototype","_defineProperties","e","r","t","length","enumerable","configurable","writable","Object","defineProperty","_toPropertyKey","key","i","toPrimitive","call","TypeError","String","_toPrimitive","_callSuper","_getPrototypeOf","ReferenceError","_assertThisInitialized","_possibleConstructorReturn","_isNativeReflectConstruct","Reflect","construct","apply","Boolean","valueOf","setPrototypeOf","getPrototypeOf","bind","__proto__","_setPrototypeOf","Button","require","View","Icon","util","BlockMessageDetails","_View","a","n","_classCallCheck","arguments","create","value","_inherits","get","createDetailsAnchorHref","blockId","render","mw","getUrl","wpTarget","createDetailsAnchorLabel","msg","createTitle","msgKey","user","isAnon","this","partial","createBody","anonOnly","noCreateAccount","seeMoreLink","reasonHeader","creatorHeader","options","expiryHeader","cta","config","progressive","wiki","label","href","Title","quiet","tagName","additionalClassNames","track","events","click","drawer","$el","find","prepend","getButtonConfig","icon","parsedReason","then","htmlReason","html","template","module","exports","actionParams","EditorGateway","api","title","sectionId","oldId","preload","preloadparams","editintro","content","undefined","fromModified","hasChanged","getBlockInfo","pageObj","blockedError","actions","edit","Array","isArray","some","error","indexOf","code","data","blockinfo","getContent","self","resolve","Deferred","text","notices","prop","rvprop","inprop","inpreloadcustom","inpreloadparams","ineditintrocustom","titles","intestactions","intestactionsautocreate","intestactionsdetail","rvstartid","rvsection","resp","reject","query","pages","missing","preloadcontent","preloadisdefault","revision","revisions","timestamp","originalContent","wouldautocreate","setContent","save","apiOptions","result","action","errorformat","errorlang","errorsuselocal","formatversion","summary","captchaid","captchaId","captchaword","captchaWord","basetimestamp","starttimestamp","section","postWithToken","newrevid","tempusercreatedredirect","tempusercreated","abortPreview","_pending","abort","getPreview","sectionLine","extend","sectionpreview","disableeditsection","pst","mobileformat","useskin","disabletoc","acquireTempUserName","post","parse","sections","anchor","line","id","promise","Overlay","parseBlockInfo","headers","icons","IconButton","mfExtend","blockMessageDrawer","MessageBox","mwUser","EditVeTool","toolGroup","classes","super","EditorOverlayBase","params","onBeforeExit","className","isBorderBox","isNewPage","placeholder","summaryRequestMsg","overlayManager","OO","inheritClass","ui","Tool","static","name","group","onSelect","onUpdateState","defaults","hasToolbar","continueMsg","closeMsg","summaryMsg","captchaMsg","captchaTryAgainMsg","switchMsg","confirmMsg","licenseMsg","log","editor_interface","editor","logFeatureUse","confirmSave","window","confirm","onSaveComplete","newRevId","redirectUrl","tempUserCreated","saved","showSaveCompleteMsg","revision_id","setTimeout","location","hash","__non_webpack_require__","fireHook","onSaveFailure","errors","captcha","message","type","badtoken","assertanonfailed","assertuserfailed","assertnameduserfailed","spamblacklist","pagedeleted","editconflict","reportError","errorNotice","heading","$errorNoticeContainer","hideErrorNotice","empty","onStageChanges","showHidden","scrollTo","onSaveBegin","confirmAborted","preRender","formHeader","editSwitcher","editingMsg","readOnly","weight","disabled","cancel","saveHeader","previewingMsg","savingHeader","postRender","show","allowCloseWindow","confirmCloseWindow","test","namespace","hook","fire","onClickBack","onClickSubmit","onClickContinue","onClickAnonymous","exit","switching","windowManager","getWindowManager","addWindows","widgets","AbandonEditDialog","openWindow","closed","mechanism","onExit","target","edited","getParamValue","reload","release","createAnonWarning","$actions","$","addClass","contLangMessages","gateway","$anonWarning","append","returnto","returnTo","warning","queryParams","signupParams","signupQueryParams","anonymousEditorActions","block","map","createAnonTalkWarning","clone","getOptionsForSwitch","switched","currentPageHTMLParser","fakeScroll","titleObj","contentLang","contentDir","getLoadingPromise","dataPromise","showEditNotices","overlay","editNotices","keys","filter","storageKey","storage","set","loader","using","$container","forEach","$notice","alert","feature","handleCaptcha","details","$input","captchaShown","val","attr","mime","detach","url","question","Section","saveFailureMessage","fakeToolbar","setPreferredEditor","VisualEditorOverlay","currentPage","SourceEditorOverlay","isFirefox","navigator","userAgent","isVEVisualAvailable","templatePartials","_resizeEditor","onInputWikitextEditor","_hidePreview","toolFactory","ToolFactory","toolGroupFactory","ToolGroupFactory","register","libs","ve","MWEditModeVisualTool","MWEditModeSourceTool","switchToolbar","Toolbar","on","mode","_switchToVisualEditor","setup","include","$element","emit","spinner","hideSpinner","$preview","$content","one","docEl","document","documentElement","scrollTop","blockScroll","addEventListener","removeEventListener","summaryTextArea","MultilineTextInputWidget","maxRows","_loadContent","hide","$anonTalkWarning","$anonHiddenButtons","hideSpinnerAndShowPreview","getDocument","showSpinner","mainpage","parsedText","parsedSectionLine","parseHTML","el","replaceWith","removeClass","container","$scrollContainer","Element","getClosestScrollableContainer","css","height","wikitext","targetLoader","addPlugin","loadModules","requestPageData","targetName","modified","newOverlay","replaceCurrent","remove","getEditSummary","getValue","URL","searchParams","search","fireHookOnPageReload","router","identifyLeadParagraph","getSingleton","surfaceReady","appendChild","origDataPromise","getPrefixedDb","sessionStore","init","MobileArticleTarget","trackingName","modes","push","isVESourceAvailable","targetFactory","defaultMode","once","getSurface","getModel","firstLoad","getDefaultMode","targetInit","load","visualeditor","editHeader","destroyTarget","destroy","showAnonWarning","afterSurfaceReady","scrollToLeadParagraph","editLead","editLeadView","readLead","offset","initialCursorOffset","$window","surface","getMode","getView","$attachedRootNode","getLeadSectionElement","top","setLinearSelection","Range","getRange","start","getSelection","getSelectionBoundingRect","padding","switchToEditor","switchToSourceEditor","setReadOnly","navigateTo","path","useReplaceState","hasBeenModified","Drawer","props","blockDrawer","onBeforeHide","onShow","$drawer","drawerTop","creatorTop","buttonsTop","$seeMore","children","$body","isNonLeadParagraph","node","cloneNode","$node","hasClass","textContent","isNotEmptyNode","$paragraphs","p","m","define","blockInfo","blockpartial","blocknocreate","blockanononly","creator","blockedby","expiry","duration","reason","blockid","jqueryMsgParse","parser","jqueryMsg","Parser","ast","wikiTextToAst","emitter","blockedbyid","makeTitle","blockexpiry","blockexpiryformatted","escaped","blockexpiryrelative","blockreason","escape","Api","contentmodel","catch","readonlyreason","isNamed","saveOption","tag","level","hasReferences","subsections"],"sourceRoot":""}
\ No newline at end of file
diff --git a/extensions/MobileFrontend/resources/dist/mobile.init.js b/extensions/MobileFrontend/resources/dist/mobile.init.js
new file mode 100644
index 000000000..fc491441c
--- /dev/null
+++ b/extensions/MobileFrontend/resources/dist/mobile.init.js
@@ -0,0 +1,2 @@
+(self.webpackChunkmfModules=self.webpackChunkmfModules||[]).push([[243],{"./src/mobile.init/editor.js":(e,t,i)=>{var o=i("./src/mobile.startup/moduleLoaderSingleton.js"),n=i("./src/mobile.startup/util.js"),a=i("./src/mobile.init/editorLoadingOverlay.js"),r=i("./src/mobile.startup/OverlayManager.js"),s=$("#ca-edit, #ca-editsource, #ca-viewsource, #ca-ve-edit, #ca-ve-create, #ca-createsource"),l=s.length>1,c=".mw-editsection a, .edit-link",d=mw.user,u=i("./src/mobile.startup/CtaDrawer.js"),m=mw.config.get("wgVisualEditorConfig"),f=/^\/editor\/(\d+|T-\d+|all)$/,g=null;function p(e,t,i){var o;o=0===$(c).length?"all":mw.util.getParamValue("section",e.href)||"all",mw.config.get("wgPageName")===mw.util.getParamValue("title",e.href)&&(l&&("ca-ve-edit"===e.id||"ca-ve-create"===e.id?g="VisualEditor":"ca-editsource"!==e.id&&"ca-createsource"!==e.id||(g="SourceEditor")),i.navigate("#/editor/"+o),t.preventDefault())}function w(){if(g)return g;var e=mw.user.options.get("mobile-editor")||mw.storage.get("preferredEditor");if(e)return e;switch(mw.config.get("wgMFDefaultEditor")){case"source":return"SourceEditor";case"visual":return"VisualEditor";case"preference":return mw.user.options.get("visualeditor-hidebetawelcome")||mw.user.options.get("visualeditor-hideusered")?"visualeditor"===mw.user.options.get("visualeditor-editor")?"VisualEditor":"SourceEditor":"visual"===mw.config.get("wgMFFallbackEditor")?"VisualEditor":"SourceEditor"}return"SourceEditor"}function h(e,t){s.on("click",(function(t){mw.notify(e),t.preventDefault()})),mw.hook("wikipage.content").add((function(t){t.find(c).on("click",(function(t){mw.notify(e),t.preventDefault()}))})),t.addRoute(f,(function(){mw.notify(e)})),t.checkRoute()}e.exports=function(e,t,i){var l=require("mediawiki.router");e.inNamespace("file")&&0===e.id?h(mw.msg("mobile-frontend-editor-uploadenable"),l):function(e,t,i,l){var b,v=mw.config.get("wgMinervaReadOnly");if(!v&&mw.config.get("wgIsProbablyEditable"))!function(e,t,i,l){var u=r.getSingleton(),h=0===e.id;if(s.add(".edit-link").on("click.mfeditlink",(function(e){p(this,e,u.router)})),mw.hook("wikipage.content").add((function(e){e.find(c).off("click.mfeditlink").on("click.mfeditlink",(function(e){p(this,e,u.router)}))})),u.add(f,(function(r){var s,l,c=window.pageYOffset,f=$("#mw-content-text"),p=new URL(location.href),b={overlayManager:u,currentPageHTMLParser:i,fakeScroll:0,api:new mw.Api,licenseMsg:t.getLicenseMsg(),title:e.title,titleObj:e.titleObj,isAnon:d.isAnon(),isNewPage:h,oldId:mw.util.getParamValue("oldid"),contentLang:f.attr("lang"),contentDir:f.attr("dir"),preload:p.searchParams.get("preload"),preloadparams:mw.util.getArrayParam("preloadparams",p.searchParams),editintro:p.searchParams.get("editintro")},v=$.Deferred(),y=n.Deferred(),k=mw.util.getParamValue("redlink")?"new":"click";function x(e){mw.track("editAttemptStep",{action:"init",type:"section",mechanism:k,integration:"page",editor_interface:e})}function E(){var t=w();return e.isVESourceAvailable()||e.isVEVisualAvailable()&&"VisualEditor"===t}function C(){return x("wikitext"),mw.hook("mobileFrontend.editorOpening").fire(),mw.loader.using("mobile.editor.overlay").then((function(){return new(o.require("mobile.editor.overlay/SourceEditorOverlay"))(b)}))}"all"!==r&&(b.sectionId=e.isWikiText()?r:void 0);var S=a((function(){var e,t,i;$(document.body).addClass("ve-loading");var o=$("#mw-mf-page-center"),n=$("#content");"0"===r||"all"===r?e=$("#bodyContent"):(e=$('a[href$="section='+r+'"],a[href*="section='+r+'&"]').closest(".mw-heading, h1, h2, h3, h4, h5, h6")).length||(e=$("#bodyContent")),o.prop("scrollTop",c),t=e[0].getBoundingClientRect().top,t-=48,E()?(i=!0===m.enableVisualSectionEditing||"mobile"===m.enableVisualSectionEditing,("0"===r||"all"===r||i)&&(t-=16)):"0"!==r&&"all"!==r||(t-=16),n.css({transform:"translate( 0, "+-t+"px )","padding-bottom":"+="+t,"margin-bottom":"-="+t}),b.fakeScroll=t,setTimeout(y.resolve,500)}),(function(){s&&s.abort&&s.abort(),$("#content").css({transform:"","padding-bottom":"","margin-bottom":""}),$(document.body).removeClass("ve-loading")}),E()?function(){k="tooslow",v.reject(),s&&s.abort&&s.abort()}:null);return l=E()?function(){x("visualeditor"),mw.hook("mobileFrontend.editorOpening").fire(),b.mode=mw.config.get("wgMFEnableVEWikitextEditor")&&"SourceEditor"===w()?"source":"visual",b.dataPromise=mw.loader.using("ext.visualEditor.targetLoader").then((function(){return s=mw.libs.ve.targetLoader.requestPageData(b.mode,b.titleObj.getPrefixedDb(),{sessionStore:!0,section:void 0===b.sectionId?null:b.sectionId,oldId:b.oldId||void 0,preload:b.preload,preloadparams:b.preloadparams,editintro:b.editintro,targetName:"mobile"})}));var e=mw.loader.using("ext.visualEditor.targetLoader").then((function(){return mw.loader.using("mobile.editor.overlay").then((function(){return mw.libs.ve.targetLoader.addPlugin("ext.visualEditor.mobileArticleTarget"),mw.config.get("wgMFEnableVEWikitextEditor")&&mw.libs.ve.targetLoader.addPlugin("ext.visualEditor.mwwikitext"),mw.libs.ve.targetLoader.loadModules(b.mode)}))})),t=$.Deferred();return e.then(t.resolve,t.reject),v.then(t.reject,t.reject),t.then((function(){var e=o.require("mobile.editor.overlay/VisualEditorOverlay"),t=o.require("mobile.editor.overlay/SourceEditorOverlay");return b.SourceEditorOverlay=t,new e(b)}),(function(){return C()}))}():C(),n.Promise.all([l,y]).then((function(e){e.getLoadingPromise().catch((function(t){return"rejected"===v.state()?C().then((function(t){return(e=t).getLoadingPromise()})):$.Deferred().reject(t).promise()})).then((function(){var t=u.stack[0];t&&t.overlay===S&&u.replaceCurrent(e)}),(function(e,t){u.router.back(),e.show?(document.body.appendChild(e.$el[0]),e.show()):t?mw.notify(b.api.getErrorMessage(t)):mw.notify(mw.msg("mobile-frontend-editor-error-loading"))}))})),g=null,S})),$("#ca-edit a, a#ca-edit, #ca-editsource a, a#ca-editsource").prop("href",(function(e,t){var i=new URL(t,location.href);return i.searchParams.set("section","0"),i.toString()})),!l.getPath()&&(mw.util.getParamValue("veaction")||"edit"===mw.config.get("wgAction"))){"edit"===mw.util.getParamValue("veaction")?g="VisualEditor":"editsource"===mw.util.getParamValue("veaction")&&(g="SourceEditor");var b="#/editor/"+(mw.util.getParamValue("section")||("edit"===mw.config.get("wgAction")?"all":"0"));if(window.history&&history.pushState){var v=new URL(location.href);v.searchParams.delete("action"),v.searchParams.delete("veaction"),v.searchParams.delete("section"),history.replaceState(null,document.title,v)}n.docReady((function(){l.navigate(b)}))}}(e,i,t,l);else if(function(e){e.$el.find(".mw-editsection").hide()}(t),b=mw.config.get("wgRestrictionEdit"),mw.user.isAnon()&&Array.isArray(b)&&!b.length)!function(e){var t;function i(){t||(t=new u({content:mw.msg("mobile-frontend-editor-disabled-anon"),signupQueryParams:{warning:"mobile-frontend-watchlist-signup-action"}}),document.body.appendChild(t.$el[0])),t.show()}s.on("click",(function(e){i(),e.preventDefault()})),mw.hook("wikipage.content").add((function(e){e.find(c).on("click",(function(e){i(),e.preventDefault()}))})),e.addRoute(f,(function(){i()})),e.checkRoute()}(l);else{var y=$("<a>").attr("href",mw.util.getUrl(mw.config.get("wgPageName"),{action:"edit"}));h(v?mw.msg("apierror-readonly"):mw.message("mobile-frontend-editor-disabled",y).parseDom(),l)}}(e,t,i,l)}},"./src/mobile.init/editorLoadingOverlay.js":(e,t,i)=>{var o=i("./src/mobile.init/fakeToolbar.js"),n=i("./src/mobile.startup/IconButton.js"),a=i("./src/mobile.startup/Overlay.js");e.exports=function(e,t,i){var r,s=o(),l=$("<div>").addClass("ve-loadbasiceditor"),c=new n({label:mw.msg("mobile-frontend-editor-loadbasiceditor"),action:"progressive",weight:"normal",size:"medium",isIconOnly:!1,icon:null}),d=new a({className:"overlay overlay-loading",noHeader:!0,isBorderBox:!1,onBeforeExit:function(e){e(),t(),r&&clearTimeout(r)}}),u=function(e,t){mw.track("visualEditorFeatureUse",{feature:e,action:t,editor_interface:"visualeditor"})};return d.show=function(){a.prototype.show.call(this),e()},d.$el.find(".overlay-content").append(s),i&&(d.$el.find(".overlay-content").append(l.append($("<p>").text(mw.msg("mobile-frontend-editor-loadingtooslow")),c.$el)),r=setTimeout((function(){l.addClass("ve-loadbasiceditor-shown"),u("mobileVisualFallback","context-show")}),3e3),c.$el.on("click",(function(){l.removeClass("ve-loadbasiceditor-shown"),u("mobileVisualFallback","fallback-confirm"),i()}))),s.addClass("toolbar-hidden"),setTimeout((function(){s.addClass("toolbar-shown"),setTimeout((function(){s.addClass("toolbar-shown-done")}),250)})),d}},"./src/mobile.init/lazyLoadedImages.js":(e,t,i)=>{var o=i("./src/mobile.startup/lazyImages/lazyImageLoader.js");function n(e){if(e[0]instanceof HTMLElement){var t=o.queryPlaceholders(e[0]);if(window.addEventListener("beforeprint",(function(){o.loadImages(t)})),mw.config.get("wgMFLazyLoadImages")){var i=new IntersectionObserver((function(e){e.forEach((function(e){var t=e.target;e.isIntersecting&&(o.loadImage(t),i.unobserve(t))}))}),{rootMargin:"0px 0px 50% 0px",threshold:0});t.forEach((function(e){i.observe(e)}))}}}mw.hook("mobileFrontend.loadLazyImages").add((function(e){var t=o.queryPlaceholders(e[0]);o.loadImages(t)})),e.exports=function(){mw.hook("wikipage.content").add(n)}},"./src/mobile.init/mobile.init.js":(e,t,i)=>{var o,n=i("./src/mobile.init/toggling.js"),a="mf-font-size",r="mf-expand-sections",s=mw.storage,l=new mw.Api,c=i("./src/mobile.init/lazyLoadedImages.js"),d=i("./src/mobile.init/editor.js"),u=i("./src/mobile.startup/currentPage.js")(),m=i("./src/mobile.startup/currentPageHTMLParser.js")(),f=i("./src/mobile.startup/util.js").getWindow(),g=i("./src/mobile.startup/Skin.js"),p=i("./src/mobile.startup/eventBusSingleton.js"),w=g.getSingleton();function h(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}f.on("resize",h(mw.util.debounce((function(){p.emit("resize")}),100),mw.util.throttle((function(){p.emit("resize:throttled")}),200))).on("scroll",h(mw.util.debounce((function(){p.emit("scroll")}),100),mw.util.throttle((function(){p.emit("scroll:throttled")}),200))),window.history&&history.pushState&&((o=new URL(window.location.href)).searchParams.has("venotify")||o.searchParams.has("mfnotify"))&&(o.searchParams.delete("venotify"),o.searchParams.delete("mfnotify"),window.history.replaceState(null,document.title,o.toString())),window.console&&window.console.log&&window.console.log.apply&&mw.config.get("wgMFEnableJSConsoleRecruitment")&&console.log(mw.msg("mobile-frontend-console-recruit")),mw.config.get("wgMFIsSupportedEditRequest")&&d(u,m,w),document.documentElement.classList.contains("mf-font-size-clientpref-xlarge")&&(mw.user.isAnon()?mw.user.clientPrefs.set(a,"large"):l.saveOption(a,"large")),mw.storage.get("expandSections")&&(mw.user.isAnon()?mw.user.clientPrefs.set(r,"1"):l.saveOption(r,"1"),s.remove("expandSections")),n(),c()},"./src/mobile.init/toggling.js":(e,t,i)=>{e.exports=function(){var e=i("./src/mobile.startup/currentPage.js")(),t=i("./src/mobile.startup/Toggler.js"),o=i("./src/mobile.startup/sectionCollapsing.js"),n=i("./src/mobile.startup/eventBusSingleton.js");e.inNamespace("special")||"view"!==mw.config.get("wgAction")&&"edit"!==mw.config.get("wgAction")||mw.hook("wikipage.content").add((function(i){var a=i.find(".mw-parser-output");0===a.length&&(a=i),function(e,i,a){document.querySelector(".mw-parser-output[data-mw-parsoid-version]")?o.init(e[0]):(e.find(".section-heading").removeAttr("onclick"),void 0!==window.mfTempOpenSection&&delete window.mfTempOpenSection,new t({$container:e,prefix:"content-",page:a,eventBus:n}))}(a,0,e)}))}},"./src/mobile.startup/Toggler.js":(e,t,i)=>{var o=i("./src/mobile.startup/util.js"),n=o.escapeSelector,a={icon:"expand",isSmall:!0,additionalClassNames:"indicator"},r=i("./src/mobile.startup/Icon.js"),s=i("./src/mobile.startup/isCollapsedByDefault.js");function l(e){this.eventBus=e.eventBus,this.$container=e.$container,this.prefix=e.prefix,this.page=e.page,this._enable()}function c(e){var t=mw.storage.session.getObject("expandedSections")||{};return t[e.title]=t[e.title]||{},t}function d(e,t,i){var o=c(i);t.find(".section-heading span").each((function(){var n=t.find(this),a=n.parents(".section-heading");o[i.title][n.attr("id")]&&!a.hasClass("open-block")&&e.toggle(a,!0)}))}l.prototype.isCollapsedByDefault=function(){if(void 0===this._isCollapsedByDefault){var e=this.$container.closest(".collapsible-headings-collapsed, .collapsible-headings-expanded");e.length?this._isCollapsedByDefault=e.hasClass("collapsible-headings-collapsed"):this._isCollapsedByDefault=s()}return this._isCollapsedByDefault},l.prototype.toggle=function(e,t){if(!t&&e.hasClass("collapsible-heading-disabled"))return!1;var i=this,o=e.is(".open-block");e.toggleClass("open-block"),a.rotation=o?0:180;var n=new r(a),s=e.data("indicator");s&&(s.replaceWith(n.$el),e.data("indicator",n.$el)),e.find(".mw-headline").attr("aria-expanded",!o);var l=e.next();return l.hasClass("open-block")?(l.removeClass("open-block"),l.get(0).setAttribute("hidden","until-found")):(l.addClass("open-block"),l.removeAttr("hidden")),mw.requestIdleCallback((function(){i.eventBus.emit("section-toggled",{expanded:o,$heading:e}),mw.hook("mobileFrontend.section-toggled").fire({expanded:o,$heading:e})})),this.isCollapsedByDefault()&&function(e,t){var i=e.find(".mw-headline").attr("id"),o=c(t);i&&o[t.title]&&(e.hasClass("open-block")?o[t.title][i]=!0:delete o[t.title][i],function(e){mw.storage.session.setObject("expandedSections",e)}(o))}(e,this.page),!0},l.prototype.reveal=function(e){var t;try{t=this.$container.find("#"+n(e))}catch(e){}if(!t||!t.length)return!1;var i=t.parents(".collapsible-heading");return i.length||(i=t.parents(".collapsible-block").prev(".collapsible-heading")),i.length&&!i.hasClass("open-block")&&this.toggle(i),i.length&&window.scrollTo(0,t.offset().top),!0},l.prototype._enable=function(){var e,t,i=this;function n(){var e=window.location.hash;if(0===e.indexOf("#")&&(e=e.slice(1),!i.reveal(e))){var t=mw.util.percentDecodeFragment(e);t&&i.reveal(t)}}this.$container.children(".section-heading").each((function(e){var t=i.$container.find(this),o=t.find(".mw-headline"),n=t.find(".indicator"),s=i.prefix+"collapsible-block-"+e;if(t.next().is("section")){var l=t.next("section");t.addClass("collapsible-heading ").data("section-number",e).on("click",(function(e){var o=e.target.closest("a");o&&o.href||(e.preventDefault(),i.toggle(t))})),o.attr({tabindex:0,role:"button","aria-controls":s,"aria-expanded":"false"}),a.rotation=i.isCollapsedByDefault()?0:180;var c=new r(a);n.length?n.replaceWith(c.$el):c.prependTo(t),t.data("indicator",c.$el),l.addClass("collapsible-block").eq(0).attr({id:s}).on("beforematch",(function(){return i.toggle(t)})).addClass("collapsible-block-js").get(0).setAttribute("hidden","until-found"),function(e,t){t.on("keypress",(function(i){13!==i.which&&32!==i.which||e.toggle(t)})).find("a").on("keypress mouseup",(function(e){return e.stopPropagation()}))}(i,t),i.isCollapsedByDefault()||i.toggle(t)}})),(t=!!(e=mw.config.get("wgInternalRedirectTargetUrl"))&&e.split("#")[1])&&(window.location.hash=t),n(),o.getWindow().on("hashchange",(function(){return n()})),this.isCollapsedByDefault()&&this.page&&d(this,this.$container,this.page)},l._getExpandedSections=c,l._expandStoredSections=d,e.exports=l},"./src/mobile.startup/isCollapsedByDefault.js":(e,t,i)=>{var o=i("./src/mobile.startup/Browser.js").getSingleton();e.exports=function(){return mw.config.get("wgMFCollapseSectionsByDefault")&&!o.isWideScreen()&&!document.documentElement.classList.contains("mf-expand-sections-clientpref-1")}},"./src/mobile.startup/sectionCollapsing.js":(e,t,i)=>{var o=i("./src/mobile.startup/isCollapsedByDefault.js");function n(e,t,i,o){e.hidden=!!o&&"until-found",o?(t.setAttribute("aria-expanded","true"),i.classList.add("mf-icon-expand"),i.classList.remove("mf-icon-collapse")):(t.setAttribute("aria-expanded","false"),i.classList.add("mf-icon-collapse"),i.classList.remove("mf-icon-expand"))}e.exports={init:function(e){var t=o();Array.from(e.querySelectorAll(".mw-parser-output > section > .mw-heading")).forEach((function(e){e.classList.add("mf-collapsible-heading");var i=e.firstElementChild,o=e.nextElementSibling;o.classList.add("mf-collapsible-content");var a=document.createElement("span");a.textContent=i.textContent,a.setAttribute("tabindex","0"),a.setAttribute("role","button"),a.setAttribute("aria-controls",o.id);var r=document.createElement("span");r.classList.add("mf-icon","mf-icon--small","mf-collapsible-icon"),r.setAttribute("aria-hidden",!0),n(o,a,r,t),i.innerHTML="",i.append(r),i.append(a),i.addEventListener("click",(function(){return function(e,t,i){n(e,t,i,!e.hidden)}(o,a,r)}))}))}}}},e=>{e.O(0,[569],(()=>e(e.s="./src/mobile.init/mobile.init.js")));var t=e.O();(this.mfModules=this.mfModules||{})["mobile.init"]=t}]);
+//# sourceMappingURL=mobile.init.js.map.json
\ No newline at end of file
diff --git a/extensions/MobileFrontend/resources/dist/mobile.init.js.map.json b/extensions/MobileFrontend/resources/dist/mobile.init.js.map.json
new file mode 100644
index 000000000..d66c3d066
--- /dev/null
+++ b/extensions/MobileFrontend/resources/dist/mobile.init.js.map.json
@@ -0,0 +1 @@
+{"version":3,"file":"mobile.init.js","mappings":"iHACA,IAAMA,EAAIC,EAAS,iDAClBC,EAAOD,EAAS,gCAChBE,EAAuBF,EAAS,6CAChCG,EAAiBH,EAAS,0CAK1BI,EAAWC,EAAG,0FACdC,EAAkBF,EAASG,OAAS,EACpCC,EAAuB,gCACvBC,EAAOC,GAAGD,KACVE,EAAYX,EAAS,qCACrBY,EAAWF,GAAGG,OAAOC,IAAK,wBAC1BC,EAAa,8BAEVC,EAAiB,KAYrB,SAASC,EAAiBC,EAAMC,EAAIC,GACnC,IAAIC,EAIHA,EAHyC,IAArChB,EAAGG,GAAuBD,OAGpB,MAEAG,GAAGT,KAAKqB,cAAe,UAAWJ,EAAKK,OAAU,MAGvDb,GAAGG,OAAOC,IAAK,gBAAmB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webpack://mfModules/./src/mobile.init/editorLoadingOverlay.js","webpack://mfModules/./src/mobile.init/lazyLoadedImages.js","webpack://mfModules/./src/mobile.init/mobile.init.js","webpack://mfModules/./src/mobile.init/toggling.js","webpack://mfModules/./src/mobile.startup/Toggler.js","webpack://mfModules/./src/mobile.startup/isCollapsedByDefault.js","webpack://mfModules/./src/mobile.startup/sectionCollapsing.js"],"sourcesContent":["/* global $ */\nconst M = require( '../mobile.startup/moduleLoaderSingleton' ),\n\tutil = require( '../mobile.startup/util' ),\n\teditorLoadingOverlay = require( './editorLoadingOverlay' ),\n\tOverlayManager = require( '../mobile.startup/OverlayManager' ),\n\t// #ca-edit, .mw-editsection are standard MediaWiki elements\n\t// .edit-link can be added to links anywhere to trigger the editor (e.g. MobileFrontend\n\t// user page creation CTA, edit-full-page overflow menu item)\n\t// Links in content are handled separately to allow reloading the content (T324686)\n\t$editTab = $( '#ca-edit, #ca-editsource, #ca-viewsource, #ca-ve-edit, #ca-ve-create, #ca-createsource' ),\n\thasTwoEditIcons = $editTab.length > 1,\n\tEDITSECTION_SELECTOR = '.mw-editsection a, .edit-link',\n\tuser = mw.user,\n\tCtaDrawer = require( '../mobile.startup/CtaDrawer' ),\n\tveConfig = mw.config.get( 'wgVisualEditorConfig' ),\n\teditorPath = /^\\/editor\\/(\\d+|T-\\d+|all)$/;\n\nlet editorOverride = null;\n\n/**\n * Event handler for edit link clicks. Will prevent default link\n * behaviour and will not allow propagation\n *\n * @method\n * @ignore\n * @param {HTMLElement} elem\n * @param {jQuery.Event} ev\n * @param {Router} router\n */\nfunction onEditLinkClick( elem, ev, router ) {\n\tlet section;\n\tif ( $( EDITSECTION_SELECTOR ).length === 0 ) {\n\t\t// If section edit links are not available, the only edit link\n\t\t// should allow editing the whole page (T232170)\n\t\tsection = 'all';\n\t} else {\n\t\tsection = mw.util.getParamValue( 'section', elem.href ) || 'all';\n\t}\n\t// Don't do anything for section edit links for different pages (transcluded)\n\tif ( mw.config.get( 'wgPageName' ) !== mw.util.getParamValue( 'title', elem.href ) ) {\n\t\treturn;\n\t}\n\tif ( hasTwoEditIcons ) {\n\t\tif ( elem.id === 'ca-ve-edit' || elem.id === 'ca-ve-create' ) {\n\t\t\t// \"Edit\" tab loads the visual editor\n\t\t\teditorOverride = 'VisualEditor';\n\t\t} else if ( elem.id === 'ca-editsource' || elem.id === 'ca-createsource' ) {\n\t\t\t// \"Edit source\" tab loads the source editor\n\t\t\teditorOverride = 'SourceEditor';\n\t\t} else {\n\t\t\t// Any other edit links (e.g. for sections) load the preferred editor\n\t\t}\n\t}\n\trouter.navigate( '#/editor/' + section );\n\t// DO NOT USE stopPropagation or you'll break click tracking in WikimediaEvents\n\t// You DO NOT NEED to\n\t// prevent folding section when clicking Edit by stopping propagation\n\t// as this is a concern of the Toggler class and taken care of by inspecting\n\t// !ev.target.href (see Toggler.js)\n\t// avoid navigating to ?action=edit\n\tev.preventDefault();\n}\n\n/**\n * Retrieve the user's preferred editor setting. If none is set, return the default\n * editor for this wiki.\n *\n * @method\n * @ignore\n * @return {string} Either 'VisualEditor' or 'SourceEditor'\n */\nfunction getPreferredEditor() {\n\tif ( editorOverride ) {\n\t\t// Temporary override, set via the URL for this request\n\t\t// or by clicking the chosen mode when both tabs are shown\n\t\treturn editorOverride;\n\t}\n\tconst preferredEditor = mw.user.options.get( 'mobile-editor' ) || mw.storage.get( 'preferredEditor' );\n\tif ( preferredEditor ) {\n\t\treturn preferredEditor;\n\t}\n\tswitch ( mw.config.get( 'wgMFDefaultEditor' ) ) {\n\t\tcase 'source':\n\t\t\treturn 'SourceEditor';\n\t\tcase 'visual':\n\t\t\treturn 'VisualEditor';\n\t\tcase 'preference':\n\t\t\t// First check if the user has actually used the desktop editor.\n\t\t\t// This is done hackily by checking if they have the preference\n\t\t\t// set to suppress the welcome dialog or user education popups. (T261423)\n\t\t\tif ( mw.user.options.get( 'visualeditor-hidebetawelcome' ) || mw.user.options.get( 'visualeditor-hideusered' ) ) {\n\t\t\t\treturn mw.user.options.get( 'visualeditor-editor' ) === 'visualeditor' ? 'VisualEditor' : 'SourceEditor';\n\t\t\t} else {\n\t\t\t\t// When there is no desktop preference, we use MFFallbackEditor.\n\t\t\t\treturn mw.config.get( 'wgMFFallbackEditor' ) === 'visual' ? 'VisualEditor' : 'SourceEditor';\n\t\t\t}\n\t}\n\t// In the event of misconfiguration, fall back to source\n\treturn 'SourceEditor';\n}\n\n/**\n * Initialize the edit button so that it launches the editor interface when clicked.\n *\n * @method\n * @ignore\n * @param {Page} page The page to edit.\n * @param {Skin} skin\n * @param {module:mobile.startup/PageHTMLParser} currentPageHTMLParser\n * @param {Router} router\n */\nfunction setupEditor( page, skin, currentPageHTMLParser, router ) {\n\tconst\n\t\toverlayManager = OverlayManager.getSingleton(),\n\t\tisNewPage = page.id === 0;\n\n\t$editTab.add( '.edit-link' ).on( 'click.mfeditlink', function ( ev ) {\n\t\tonEditLinkClick( this, ev, overlayManager.router );\n\t} );\n\tmw.hook( 'wikipage.content' ).add( function ( $content ) {\n\t\t// make sure that any .edit-link links in here don't get double-handled\n\t\t$content.find( EDITSECTION_SELECTOR ).off( 'click.mfeditlink' ).on( 'click.mfeditlink', function ( ev ) {\n\t\t\tonEditLinkClick( this, ev, overlayManager.router );\n\t\t} );\n\t} );\n\n\toverlayManager.add( editorPath, function ( sectionId ) {\n\t\tconst\n\t\t\tscrollTop = window.pageYOffset,\n\t\t\t$contentText = $( '#mw-content-text' ),\n\t\t\turl = new URL( location.href ),\n\t\t\teditorOptions = {\n\t\t\t\toverlayManager: overlayManager,\n\t\t\t\tcurrentPageHTMLParser: currentPageHTMLParser,\n\t\t\t\tfakeScroll: 0,\n\t\t\t\tapi: new mw.Api(),\n\t\t\t\tlicenseMsg: skin.getLicenseMsg(),\n\t\t\t\ttitle: page.title,\n\t\t\t\ttitleObj: page.titleObj,\n\t\t\t\tisAnon: user.isAnon(),\n\t\t\t\tisNewPage: isNewPage,\n\t\t\t\toldId: mw.util.getParamValue( 'oldid' ),\n\t\t\t\tcontentLang: $contentText.attr( 'lang' ),\n\t\t\t\tcontentDir: $contentText.attr( 'dir' ),\n\t\t\t\t// Arrange preload content if we're on a page with those URL parameters\n\t\t\t\tpreload: url.searchParams.get( 'preload' ),\n\t\t\t\tpreloadparams: mw.util.getArrayParam( 'preloadparams', url.searchParams ),\n\t\t\t\teditintro: url.searchParams.get( 'editintro' )\n\t\t\t},\n\t\t\tvisualAbortPromise = $.Deferred();\n\n\t\tconst animationDelayDeferred = util.Deferred();\n\n\t\tlet abortableDataPromise, overlayPromise,\n\t\t\tinitMechanism = mw.util.getParamValue( 'redlink' ) ? 'new' : 'click';\n\n\t\tif ( sectionId !== 'all' ) {\n\t\t\teditorOptions.sectionId = page.isWikiText() ? sectionId : undefined;\n\t\t}\n\n\t\tfunction showLoading() {\n\t\t\tlet $sectionTop, fakeScroll, enableVisualSectionEditing;\n\n\t\t\t$( document.body ).addClass( 've-loading' );\n\n\t\t\tconst $page = $( '#mw-mf-page-center' );\n\t\t\tconst $content = $( '#content' );\n\t\t\tif ( sectionId === '0' || sectionId === 'all' ) {\n\t\t\t\t$sectionTop = $( '#bodyContent' );\n\t\t\t} else {\n\t\t\t\t$sectionTop = $(\n\t\t\t\t\t// ends with section=N\n\t\t\t\t\t'a[href$=\"section=' + sectionId + '\"],' +\n\t\t\t\t\t// contains section=N&...\n\t\t\t\t\t'a[href*=\"section=' + sectionId + '&\"]'\n\t\t\t\t).closest( '.mw-heading, h1, h2, h3, h4, h5, h6' );\n\t\t\t\t// When loading on action=edit URLs, there is no page content\n\t\t\t\tif ( !$sectionTop.length ) {\n\t\t\t\t\t$sectionTop = $( '#bodyContent' );\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Pretend that we didn't just scroll the page to the top.\n\t\t\t$page.prop( 'scrollTop', scrollTop );\n\t\t\t// Then, pretend that we're scrolling to the position of the clicked heading.\n\t\t\tfakeScroll = $sectionTop[0].getBoundingClientRect().top;\n\t\t\t// Adjust for height of the toolbar.\n\t\t\tfakeScroll -= 48;\n\t\t\tif ( shouldLoadVisualEditor() ) {\n\t\t\t\tenableVisualSectionEditing = veConfig.enableVisualSectionEditing === true ||\n\t\t\t\t\t// === ve.init.mw.MobileArticleTarget.static.trackingName\n\t\t\t\t\tveConfig.enableVisualSectionEditing === 'mobile';\n\t\t\t\tif ( sectionId === '0' || sectionId === 'all' || enableVisualSectionEditing ) {\n\t\t\t\t\t// Adjust for surface padding. Only needed if we're at the beginning of the doc.\n\t\t\t\t\tfakeScroll -= 16;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ( sectionId === '0' || sectionId === 'all' ) {\n\t\t\t\t\tfakeScroll -= 16;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$content.css( {\n\t\t\t\t// Use transform instead of scroll for smoother animation (via CSS transitions).\n\t\t\t\ttransform: 'translate( 0, ' + -fakeScroll + 'px )',\n\t\t\t\t// If the clicked heading is near the end of the page, we might need to insert\n\t\t\t\t// some extra space to allow us to scroll \"beyond the end\" of the page.\n\t\t\t\t'padding-bottom': '+=' + fakeScroll,\n\t\t\t\t'margin-bottom': '-=' + fakeScroll\n\t\t\t} );\n\t\t\teditorOptions.fakeScroll = fakeScroll;\n\t\t\tsetTimeout( animationDelayDeferred.resolve, 500 );\n\t\t}\n\n\t\tfunction clearLoading() {\n\t\t\tif ( abortableDataPromise && abortableDataPromise.abort ) {\n\t\t\t\tabortableDataPromise.abort();\n\t\t\t}\n\n\t\t\t$( '#content' ).css( {\n\t\t\t\ttransform: '',\n\t\t\t\t'padding-bottom': '',\n\t\t\t\t'margin-bottom': ''\n\t\t\t} );\n\n\t\t\t$( document.body ).removeClass( 've-loading' );\n\t\t}\n\n\t\tfunction loadBasicEditor() {\n\t\t\t// Note that this option was used when logging a wikitext init later\n\t\t\tinitMechanism = 'tooslow';\n\n\t\t\t// This restarts the loading (whether it was aborted when loading the code or the data)\n\t\t\tvisualAbortPromise.reject();\n\t\t\tif ( abortableDataPromise && abortableDataPromise.abort ) {\n\t\t\t\tabortableDataPromise.abort();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Log init event to edit schema.\n\t\t * Need to log this from outside the Overlay object because that module\n\t\t * won't have loaded yet.\n\t\t *\n\t\t * @private\n\t\t * @ignore\n\t\t * @param {string} editor name e.g. wikitext or visualeditor\n\t\t * @method\n\t\t */\n\t\tfunction logInit( editor ) {\n\t\t\tmw.track( 'editAttemptStep', {\n\t\t\t\taction: 'init',\n\t\t\t\ttype: 'section',\n\t\t\t\tmechanism: initMechanism,\n\t\t\t\tintegration: 'page',\n\t\t\t\t/* eslint-disable camelcase */\n\t\t\t\teditor_interface: editor\n\t\t\t\t/* eslint-enable camelcase */\n\t\t\t} );\n\t\t}\n\n\t\t/**\n\t\t * Check whether VisualEditor should be loaded\n\t\t *\n\t\t * @private\n\t\t * @ignore\n\t\t * @method\n\t\t * @return {bool}\n\t\t */\n\t\tfunction shouldLoadVisualEditor() {\n\t\t\tconst preferredEditor = getPreferredEditor();\n\n\t\t\treturn page.isVESourceAvailable() || (\n\t\t\t\tpage.isVEVisualAvailable() &&\n\t\t\t\t// If the user prefers visual mode or the user has no preference and\n\t\t\t\t// the visual mode is the default editor for this wiki\n\t\t\t\tpreferredEditor === 'VisualEditor'\n\t\t\t);\n\t\t}\n\n\t\t/**\n\t\t * Load source editor\n\t\t *\n\t\t * @ignore\n\t\t * @method\n\t\t * @return {jQuery.Promise} Promise resolved with the editor overlay\n\t\t * @fires mobileFrontend.editorOpening\n\t\t */\n\t\tfunction loadSourceEditor() {\n\t\t\tlogInit( 'wikitext' );\n\t\t\t// Inform other interested code that we're loading the editor\n\t\t\t/**\n\t\t\t * Internal for use in GrowthExperiments only.\n\t\t\t *\n\t\t\t * @event ~'mobileFrontend.editorOpening'\n\t\t\t * @memberof Hooks\n\t\t\t */\n\t\t\tmw.hook( 'mobileFrontend.editorOpening' ).fire();\n\n\t\t\treturn mw.loader.using( 'mobile.editor.overlay' ).then( function () {\n\t\t\t\tconst SourceEditorOverlay = M.require( 'mobile.editor.overlay/SourceEditorOverlay' );\n\t\t\t\treturn new SourceEditorOverlay( editorOptions );\n\t\t\t} );\n\t\t}\n\n\t\t/**\n\t\t * Load visual editor. If it fails to load for any reason, load the source editor instead.\n\t\t *\n\t\t * @private\n\t\t * @ignore\n\t\t * @method\n\t\t * @return {jQuery.Promise} Promise resolved with the editor overlay\n\t\t */\n\t\tfunction loadVisualEditorMaybe() {\n\t\t\tlogInit( 'visualeditor' );\n\t\t\t// Inform other interested code that we're loading the editor\n\t\t\t/**\n\t\t\t * Internal for use in GrowthExperiments only.\n\t\t\t *\n\t\t\t * @event ~'mobileFrontend.editorOpening'\n\t\t\t * @memberof Hooks\n\t\t\t */\n\t\t\tmw.hook( 'mobileFrontend.editorOpening' ).fire();\n\n\t\t\teditorOptions.mode = mw.config.get( 'wgMFEnableVEWikitextEditor' ) && getPreferredEditor() === 'SourceEditor' ?\n\t\t\t\t'source' :\n\t\t\t\t'visual';\n\t\t\teditorOptions.dataPromise = mw.loader.using( 'ext.visualEditor.targetLoader' ).then( function () {\n\t\t\t\tabortableDataPromise = mw.libs.ve.targetLoader.requestPageData(\n\t\t\t\t\teditorOptions.mode,\n\t\t\t\t\teditorOptions.titleObj.getPrefixedDb(),\n\t\t\t\t\t{\n\t\t\t\t\t\tsessionStore: true,\n\t\t\t\t\t\tsection: editorOptions.sectionId === undefined ?\n\t\t\t\t\t\t\tnull : editorOptions.sectionId,\n\t\t\t\t\t\toldId: editorOptions.oldId || undefined,\n\t\t\t\t\t\tpreload: editorOptions.preload,\n\t\t\t\t\t\tpreloadparams: editorOptions.preloadparams,\n\t\t\t\t\t\teditintro: editorOptions.editintro,\n\t\t\t\t\t\t// Should be ve.init.mw.MobileArticleTarget.static.trackingName,\n\t\t\t\t\t\t// but the class hasn't loaded yet.\n\t\t\t\t\t\ttargetName: 'mobile'\n\t\t\t\t\t} );\n\t\t\t\treturn abortableDataPromise;\n\t\t\t} );\n\n\t\t\tconst visualLoadingPromise = mw.loader.using( 'ext.visualEditor.targetLoader' )\n\t\t\t\t.then( function () {\n\t\t\t\t\t// Load 'mobile.editor.overlay' separately, so that if we fall back to basic\n\t\t\t\t\t// editor, we can display it without waiting for the visual code\n\t\t\t\t\treturn mw.loader.using( 'mobile.editor.overlay' ).then( function () {\n\t\t\t\t\t\tmw.libs.ve.targetLoader.addPlugin( 'ext.visualEditor.mobileArticleTarget' );\n\t\t\t\t\t\tif ( mw.config.get( 'wgMFEnableVEWikitextEditor' ) ) {\n\t\t\t\t\t\t\t// Target loader only loads wikitext editor if the desktop\n\t\t\t\t\t\t\t// preference is set.\n\t\t\t\t\t\t\t// TODO: Have a cleaner API for this instead of duplicating\n\t\t\t\t\t\t\t// the module name here.\n\t\t\t\t\t\t\tmw.libs.ve.targetLoader.addPlugin( 'ext.visualEditor.mwwikitext' );\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn mw.libs.ve.targetLoader.loadModules( editorOptions.mode );\n\t\t\t\t\t} );\n\t\t\t\t} );\n\n\t\t\t// Continue when loading is completed or aborted\n\t\t\tconst visualPromise = $.Deferred();\n\t\t\tvisualLoadingPromise.then( visualPromise.resolve, visualPromise.reject );\n\t\t\tvisualAbortPromise.then( visualPromise.reject, visualPromise.reject );\n\n\t\t\treturn visualPromise\n\t\t\t\t.then( function () {\n\t\t\t\t\tconst VisualEditorOverlay = M.require( 'mobile.editor.overlay/VisualEditorOverlay' ),\n\t\t\t\t\t\tSourceEditorOverlay = M.require( 'mobile.editor.overlay/SourceEditorOverlay' );\n\t\t\t\t\teditorOptions.SourceEditorOverlay = SourceEditorOverlay;\n\t\t\t\t\treturn new VisualEditorOverlay( editorOptions );\n\t\t\t\t}, function () {\n\t\t\t\t\treturn loadSourceEditor();\n\t\t\t\t} );\n\t\t}\n\n\t\t// showLoading() has to run after the overlay has opened, which disables page scrolling.\n\t\t// clearLoading() has to run after the loading overlay is hidden in any way\n\t\t// (either when loading is aborted, or when the editor overlay is shown instead).\n\t\tconst loadingOverlay = editorLoadingOverlay(\n\t\t\tshowLoading, clearLoading, shouldLoadVisualEditor() ? loadBasicEditor : null\n\t\t);\n\n\t\tif ( shouldLoadVisualEditor() ) {\n\t\t\toverlayPromise = loadVisualEditorMaybe();\n\t\t} else {\n\t\t\toverlayPromise = loadSourceEditor();\n\t\t}\n\n\t\t// Wait for the scroll animation to finish before we show the editor overlay\n\t\tutil.Promise.all( [ overlayPromise, animationDelayDeferred ] ).then( function ( overlay ) {\n\t\t\t// Wait for the data to load before we show the editor overlay\n\t\t\toverlay.getLoadingPromise().catch( function ( error ) {\n\t\t\t\tif ( visualAbortPromise.state() === 'rejected' ) {\n\t\t\t\t\treturn loadSourceEditor().then( function ( sourceOverlay ) {\n\t\t\t\t\t\toverlay = sourceOverlay;\n\t\t\t\t\t\treturn overlay.getLoadingPromise();\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t\treturn $.Deferred().reject( error ).promise();\n\t\t\t} ).then( function () {\n\t\t\t\t// Make sure the user did not close the loading overlay while we were waiting\n\t\t\t\tconst overlayData = overlayManager.stack[0];\n\t\t\t\tif ( !overlayData || overlayData.overlay !== loadingOverlay ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t// Show the editor!\n\t\t\t\toverlayManager.replaceCurrent( overlay );\n\t\t\t}, function ( error, apiResponse ) {\n\t\t\t\t// Could not load the editor.\n\t\t\t\toverlayManager.router.back();\n\t\t\t\tif ( error.show ) {\n\t\t\t\t\t// Probably a blockMessageDrawer returned because the user is blocked.\n\t\t\t\t\tdocument.body.appendChild( error.$el[ 0 ] );\n\t\t\t\t\terror.show();\n\t\t\t\t} else if ( apiResponse ) {\n\t\t\t\t\tmw.notify( editorOptions.api.getErrorMessage( apiResponse ) );\n\t\t\t\t} else {\n\t\t\t\t\tmw.notify( mw.msg( 'mobile-frontend-editor-error-loading' ) );\n\t\t\t\t}\n\t\t\t} );\n\t\t} );\n\n\t\t// Reset the temporary override for the next load\n\t\teditorOverride = null;\n\n\t\treturn loadingOverlay;\n\t} );\n\n\t$( '#ca-edit a, a#ca-edit, #ca-editsource a, a#ca-editsource' ).prop( 'href', function ( i, href ) {\n\t\tconst editUrl = new URL( href, location.href );\n\t\t// By default the editor opens section 0 (lead section), rather than the whole article.\n\t\t// This might be changed in the future (T210659).\n\t\teditUrl.searchParams.set( 'section', '0' );\n\t\treturn editUrl.toString();\n\t} );\n\n\t// We use wgAction instead of getParamValue('action') as the former can be\n\t// overridden by hooks to stop the editor loading automatically.\n\tif ( !router.getPath() && ( mw.util.getParamValue( 'veaction' ) || mw.config.get( 'wgAction' ) === 'edit' ) ) {\n\t\tif ( mw.util.getParamValue( 'veaction' ) === 'edit' ) {\n\t\t\teditorOverride = 'VisualEditor';\n\t\t} else if ( mw.util.getParamValue( 'veaction' ) === 'editsource' ) {\n\t\t\teditorOverride = 'SourceEditor';\n\t\t}\n\t\t// else: action=edit, for which we allow the default to take effect\n\t\tconst fragment = '#/editor/' + ( mw.util.getParamValue( 'section' ) || ( mw.config.get( 'wgAction' ) === 'edit' ? 'all' : '0' ) );\n\t\t// eslint-disable-next-line no-restricted-properties\n\t\tif ( window.history && history.pushState ) {\n\t\t\t// We're reformatting the action=edit URL into a view URL and\n\t\t\t// replacing it into the history, and then will fall through to\n\t\t\t// router.navigate which will move us to the editing URL for the\n\t\t\t// mobile site. We do this because the editor overlay deeply\n\t\t\t// expects to have been opened on top of an actual page, and e.g.\n\t\t\t// closing the editor via the X will produce unexpected behavior\n\t\t\t// otherwise.\n\t\t\tconst url = new URL( location.href );\n\t\t\turl.searchParams.delete( 'action' );\n\t\t\turl.searchParams.delete( 'veaction' );\n\t\t\turl.searchParams.delete( 'section' );\n\t\t\thistory.replaceState( null, document.title, url );\n\t\t}\n\t\tutil.docReady( function () {\n\t\t\trouter.navigate( fragment );\n\t\t} );\n\t}\n}\n\n/**\n * Hide any section id icons in the page. This will not hide the edit icon in the page action\n * menu.\n *\n * @method\n * @ignore\n * @param {module:mobile.startup/PageHTMLParser} currentPageHTMLParser\n */\nfunction hideSectionEditIcons( currentPageHTMLParser ) {\n\tcurrentPageHTMLParser.$el.find( '.mw-editsection' ).hide();\n}\n\n/**\n * Show a drawer with log in / sign up buttons.\n *\n * @method\n * @ignore\n * @param {Router} router\n */\nfunction bindEditLinksLoginDrawer( router ) {\n\tlet drawer;\n\tfunction showLoginDrawer() {\n\t\tif ( !drawer ) {\n\t\t\tdrawer = new CtaDrawer( {\n\t\t\t\tcontent: mw.msg( 'mobile-frontend-editor-disabled-anon' ),\n\t\t\t\tsignupQueryParams: {\n\t\t\t\t\twarning: 'mobile-frontend-watchlist-signup-action'\n\t\t\t\t}\n\t\t\t} );\n\t\t\tdocument.body.appendChild( drawer.$el[ 0 ] );\n\t\t}\n\t\tdrawer.show();\n\t}\n\t$editTab.on( 'click', function ( ev ) {\n\t\tshowLoginDrawer();\n\t\tev.preventDefault();\n\t} );\n\tmw.hook( 'wikipage.content' ).add( function ( $content ) {\n\t\t$content.find( EDITSECTION_SELECTOR ).on( 'click', function ( ev ) {\n\t\t\tshowLoginDrawer();\n\t\t\tev.preventDefault();\n\t\t} );\n\t} );\n\trouter.addRoute( editorPath, function () {\n\t\tshowLoginDrawer();\n\t} );\n\trouter.checkRoute();\n}\n\n/**\n * Setup the editor if the user can edit the page otherwise show a sorry toast.\n *\n * @method\n * @ignore\n * @param {Page} currentPage\n * @param {module:mobile.startup/PageHTMLParser} currentPageHTMLParser\n * @param {Skin} skin\n * @param {Router} router\n */\nfunction init( currentPage, currentPageHTMLParser, skin, router ) {\n\tlet editErrorMessage, editRestrictions;\n\t// see: https://www.mediawiki.org/wiki/Manual:Interface/JavaScript#Page-specific\n\tconst isReadOnly = mw.config.get( 'wgMinervaReadOnly' );\n\tconst isEditable = !isReadOnly && mw.config.get( 'wgIsProbablyEditable' );\n\n\tif ( isEditable ) {\n\t\t// Edit button updated in setupEditor.\n\t\tsetupEditor( currentPage, skin, currentPageHTMLParser, router );\n\t} else {\n\t\thideSectionEditIcons( currentPageHTMLParser );\n\t\teditRestrictions = mw.config.get( 'wgRestrictionEdit' );\n\t\tif ( mw.user.isAnon() && Array.isArray( editRestrictions ) && !editRestrictions.length ) {\n\t\t\tbindEditLinksLoginDrawer( router );\n\t\t} else {\n\t\t\tconst $link = $( '<a>' ).attr( 'href', mw.util.getUrl( mw.config.get( 'wgPageName' ), { action: 'edit' } ) );\n\t\t\teditErrorMessage = isReadOnly ? mw.msg( 'apierror-readonly' ) : mw.message( 'mobile-frontend-editor-disabled', $link ).parseDom();\n\t\t\tbindEditLinksSorryToast( editErrorMessage, router );\n\t\t}\n\t}\n}\n\n/**\n * Wire up events that ensure we\n * show a toast message with sincere condolences when user navigates to\n * #/editor or clicks on an edit button\n *\n * @method\n * @ignore\n * @param {string} msg Message for sorry message\n * @param {Router} router\n */\nfunction bindEditLinksSorryToast( msg, router ) {\n\t$editTab.on( 'click', function ( ev ) {\n\t\tmw.notify( msg );\n\t\tev.preventDefault();\n\t} );\n\tmw.hook( 'wikipage.content' ).add( function ( $content ) {\n\t\t$content.find( EDITSECTION_SELECTOR ).on( 'click', function ( ev ) {\n\t\t\tmw.notify( msg );\n\t\t\tev.preventDefault();\n\t\t} );\n\t} );\n\trouter.addRoute( editorPath, function () {\n\t\tmw.notify( msg );\n\t} );\n\trouter.checkRoute();\n}\n\nmodule.exports = function ( currentPage, currentPageHTMLParser, skin ) {\n\tconst router = __non_webpack_require__( 'mediawiki.router' );\n\n\tif ( currentPage.inNamespace( 'file' ) && currentPage.id === 0 ) {\n\t\t// Is a new file page (enable upload image only) T60311\n\t\tbindEditLinksSorryToast( mw.msg( 'mobile-frontend-editor-uploadenable' ), router );\n\t} else {\n\t\t// Edit button is currently hidden. A call to init() will update it as needed.\n\t\tinit( currentPage, currentPageHTMLParser, skin, router );\n\t}\n};\n","const\n\tfakeToolbar = require( './fakeToolbar' ),\n\tIconButton = require( '../mobile.startup/IconButton' ),\n\tOverlay = require( '../mobile.startup/Overlay' );\n\n/* global $ */\n\n/**\n * Like loadingOverlay(), but with a fake editor toolbar instead of the spinner.\n *\n * @private\n * @param {Function} afterShow Callback which runs after overlay is shown\n * @param {Function} afterHide Callback which runs after overlay is hidden\n * @param {Function} [loadBasicEditor] Callback for the \"Use basic editor\" button\n * @return {module:mobile.startup/Overlay}\n */\nmodule.exports = function editorLoadingOverlay( afterShow, afterHide, loadBasicEditor ) {\n\tlet timeout;\n\tconst\n\t\t$fakeToolbar = fakeToolbar(),\n\t\t$loadBasicWrapper = $( '<div>' ).addClass( 've-loadbasiceditor' ),\n\t\tloadBasicButton = new IconButton( {\n\t\t\tlabel: mw.msg( 'mobile-frontend-editor-loadbasiceditor' ),\n\t\t\taction: 'progressive',\n\t\t\tweight: 'normal',\n\t\t\tsize: 'medium',\n\t\t\tisIconOnly: false,\n\t\t\ticon: null\n\t\t} ),\n\t\toverlay = new Overlay( {\n\t\t\tclassName: 'overlay overlay-loading',\n\t\t\tnoHeader: true,\n\t\t\tisBorderBox: false,\n\t\t\tonBeforeExit: function ( exit ) {\n\t\t\t\texit();\n\t\t\t\tafterHide();\n\t\t\t\tif ( timeout ) {\n\t\t\t\t\tclearTimeout( timeout );\n\t\t\t\t}\n\t\t\t}\n\t\t} ),\n\t\tlogFeatureUse = function ( feature, action ) {\n\t\t\tmw.track( 'visualEditorFeatureUse', {\n\t\t\t\tfeature: feature,\n\t\t\t\taction: action,\n\t\t\t\t// eslint-disable-next-line camelcase\n\t\t\t\teditor_interface: 'visualeditor'\n\t\t\t} );\n\t\t};\n\n\toverlay.show = function () {\n\t\tOverlay.prototype.show.call( this );\n\t\tafterShow();\n\t};\n\n\toverlay.$el.find( '.overlay-content' ).append( $fakeToolbar );\n\n\tif ( loadBasicEditor ) {\n\t\toverlay.$el.find( '.overlay-content' ).append(\n\t\t\t$loadBasicWrapper.append(\n\t\t\t\t$( '<p>' ).text( mw.msg( 'mobile-frontend-editor-loadingtooslow' ) ),\n\t\t\t\tloadBasicButton.$el\n\t\t\t)\n\t\t);\n\n\t\ttimeout = setTimeout( function () {\n\t\t\t$loadBasicWrapper.addClass( 've-loadbasiceditor-shown' );\n\t\t\tlogFeatureUse( 'mobileVisualFallback', 'context-show' );\n\t\t}, 3000 );\n\n\t\tloadBasicButton.$el.on( 'click', function () {\n\t\t\t$loadBasicWrapper.removeClass( 've-loadbasiceditor-shown' );\n\t\t\tlogFeatureUse( 'mobileVisualFallback', 'fallback-confirm' );\n\t\t\tloadBasicEditor();\n\t\t} );\n\t}\n\n\t// Animate the toolbar sliding into place.\n\t$fakeToolbar.addClass( 'toolbar-hidden' );\n\tsetTimeout( function () {\n\t\t$fakeToolbar.addClass( 'toolbar-shown' );\n\t\tsetTimeout( function () {\n\t\t\t$fakeToolbar.addClass( 'toolbar-shown-done' );\n\t\t}, 250 );\n\t} );\n\n\treturn overlay;\n};\n","const lazyImageLoader = require( '../mobile.startup/lazyImages/lazyImageLoader' );\n\n/**\n * @namespace Hooks\n */\n\n/**\n * Initialise lazy loading images to supplement the HTML changes inside the\n * MobileFormatter.\n *\n * @param {jQuery} $container\n * @private\n */\nfunction init( $container ) {\n\n\t// T360781 - since this is invoked via hook, the value of $container is not guaranteed.\n\t// If undefined, return early since no further work can be done on $container.\n\tif ( !( $container[ 0 ] instanceof HTMLElement ) ) {\n\t\treturn;\n\t}\n\n\tconst imagePlaceholders = lazyImageLoader.queryPlaceholders( $container[ 0 ] );\n\n\t// Regardless of whether or not lazy load is turned on\n\t// We need to load in all images before print\n\twindow.addEventListener( 'beforeprint', function () {\n\t\tlazyImageLoader.loadImages( imagePlaceholders );\n\t} );\n\n\tif ( !mw.config.get( 'wgMFLazyLoadImages' ) ) {\n\t\treturn;\n\t}\n\n\t// eslint-disable-next-line compat/compat\n\tconst observer = new IntersectionObserver(\n\t\t( entries ) => {\n\t\t\tentries.forEach( ( entry ) => {\n\t\t\t\tconst placeholder = entry.target;\n\t\t\t\t// If intersecting load image and stop observing it to free up resources.\n\t\t\t\tif ( entry.isIntersecting ) {\n\t\t\t\t\tlazyImageLoader.loadImage( placeholder );\n\t\t\t\t\tobserver.unobserve( placeholder );\n\t\t\t\t}\n\t\t\t} );\n\t\t},\n\t\t// See https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API\n\t\t{\n\t\t\t// Setup the area for observing.\n\t\t\t// By default the root is the viewport.\n\t\t\t// We want the detection area to be as tall as 150% of the viewport height,\n\t\t\t// allowing elements to be detected before they reach the viewport.\n\t\t\t// This is achieved with a 50% bottom margin.\n\t\t\trootMargin: '0px 0px 50% 0px',\n\t\t\t// The default is 0 (meaning as soon as even one pixel is visible,\n\t\t\t// the callback will be run), however we explicitly set this so that\n\t\t\t// it is clear we have made this choice in case we want to revisit later.\n\t\t\tthreshold: 0\n\t\t}\n\t);\n\n\t// observe all the placeholders\n\timagePlaceholders.forEach( ( placeholder ) => {\n\t\tobserver.observe( placeholder );\n\t} );\n}\n\n/**\n * Make modifications after an image was lazy loaded, stable for use.\n *\n * @event ~'mobileFrontend.loadLazyImages'\n * @memberof Hooks\n * @param {jQuery} $container\n */\nmw.hook( 'mobileFrontend.loadLazyImages' ).add( function ( $container ) {\n\tconst imagePlaceholders = lazyImageLoader.queryPlaceholders( $container[ 0 ] );\n\tlazyImageLoader.loadImages( imagePlaceholders );\n} );\n\nmodule.exports = function () {\n\tmw.hook( 'wikipage.content' ).add( init );\n};\n","// FIXME: make this an object with a constructor to facilitate testing\n// (see https://bugzilla.wikimedia.org/show_bug.cgi?id=44264)\n/**\n * mobileFrontend namespace\n * @private\n */\nlet url;\n\nconst\n\ttoggling = require( './toggling' ),\n\tFONT_SIZE_KEY = 'mf-font-size',\n\tSECTION_COLLAPSING_TOGGLE = 'mf-expand-sections',\n\tstorage = mw.storage,\n\tapi = new mw.Api(),\n\tlazyLoadedImages = require( './lazyLoadedImages' ),\n\teditor = require( './editor' ),\n\tcurrentPage = require( '../mobile.startup/currentPage' )(),\n\tcurrentPageHTMLParser = require( '../mobile.startup/currentPageHTMLParser' )(),\n\tmfUtil = require( '../mobile.startup/util' ),\n\t$window = mfUtil.getWindow(),\n\tSkin = require( '../mobile.startup/Skin' ),\n\teventBus = require( '../mobile.startup/eventBusSingleton' );\n\nconst skin = Skin.getSingleton();\n\n/**\n * Given 2 functions, it returns a function that will run both with it's\n * context and parameters and return the results combined\n *\n * @private\n * @param {Function} fn1\n * @param {Function} fn2\n * @return {Function} which returns void\n */\nfunction apply2( fn1, fn2 ) {\n\treturn function () {\n\t\tfn1.apply( this, arguments );\n\t\tfn2.apply( this, arguments );\n\t};\n}\n\n/**\n * The `window`'s resize event debounced at 100 ms.\n * The `resize:throttled` event is the `window`'s\n * resize event throttled to 200 ms.\n *\n * @event resize\n * @memberof window\n */\n\n/**\n * The `window`'s scroll event debounced at 100 ms.\n * The `scroll:throttled` event is the `window`'s\n * scroll event throttled to 200 ms.\n *\n * @event scroll\n * @memberof window\n */\n\n$window\n\t.on( 'resize', apply2(\n\t\tmw.util.debounce( function () {\n\t\t\teventBus.emit( 'resize' );\n\t\t}, 100 ),\n\t\tmw.util.throttle( function () {\n\t\t\teventBus.emit( 'resize:throttled' );\n\t\t}, 200 )\n\t) )\n\t.on( 'scroll', apply2(\n\t\tmw.util.debounce( function () {\n\t\t\teventBus.emit( 'scroll' );\n\t\t}, 100 ),\n\t\tmw.util.throttle( function () {\n\t\t\teventBus.emit( 'scroll:throttled' );\n\t\t}, 200 )\n\t) );\n\n// Hide URL flags used to pass state through reloads\n// venotify is normally handled in ve.init.mw.DesktopArticleTarget.init.js\n// but that's not loaded on mobile\n// eslint-disable-next-line no-restricted-properties\nif ( window.history && history.pushState ) {\n\t// eslint-disable-next-line no-restricted-properties\n\turl = new URL( window.location.href );\n\tif ( url.searchParams.has( 'venotify' ) || url.searchParams.has( 'mfnotify' ) ) {\n\t\turl.searchParams.delete( 'venotify' );\n\t\turl.searchParams.delete( 'mfnotify' );\n\t\t// eslint-disable-next-line no-restricted-properties\n\t\twindow.history.replaceState( null, document.title, url.toString() );\n\t}\n}\n\n// Recruit volunteers through the console\n// (note console.log may not be a function so check via apply)\n/* eslint-disable no-console */\nif ( window.console && window.console.log && window.console.log.apply &&\n\t\tmw.config.get( 'wgMFEnableJSConsoleRecruitment' ) ) {\n\tconsole.log( mw.msg( 'mobile-frontend-console-recruit' ) );\n}\n/* eslint-enable no-console */\n\n// Setup editor, if supported for the current page view\nif ( mw.config.get( 'wgMFIsSupportedEditRequest' ) ) {\n\teditor( currentPage, currentPageHTMLParser, skin );\n}\n\nfunction migrateXLargeToLarge() {\n\tif ( document.documentElement.classList.contains( 'mf-font-size-clientpref-xlarge' ) ) {\n\t\tif ( mw.user.isAnon() ) {\n\t\t\tmw.user.clientPrefs.set( FONT_SIZE_KEY, 'large' );\n\t\t} else {\n\t\t\tapi.saveOption( FONT_SIZE_KEY, 'large' );\n\t\t}\n\t}\n}\n\nfunction migrateLegacyExpandAllSectionsToggle() {\n\tconst currentValue = mw.storage.get( 'expandSections' );\n\tif ( currentValue ) {\n\t\tif ( mw.user.isAnon() ) {\n\t\t\tmw.user.clientPrefs.set( SECTION_COLLAPSING_TOGGLE, '1' );\n\t\t} else {\n\t\t\tapi.saveOption( SECTION_COLLAPSING_TOGGLE, '1' );\n\t\t}\n\t\tstorage.remove( 'expandSections' );\n\t}\n}\n\nmigrateXLargeToLarge();\nmigrateLegacyExpandAllSectionsToggle();\ntoggling();\nlazyLoadedImages();\n","module.exports = function () {\n\tconst\n\t\tcurrentPage = require( '../mobile.startup/currentPage' )(),\n\t\tToggler = require( '../mobile.startup/Toggler' ),\n\t\tsectionCollapsing = require( '../mobile.startup/sectionCollapsing' ),\n\t\teventBus = require( '../mobile.startup/eventBusSingleton' );\n\n\t/**\n\t * Initialises toggling code.\n\t *\n\t * @method\n\t * @param {jQuery.Object} $container to enable toggling on\n\t * @param {string} prefix a prefix to use for the id.\n\t * @param {Page} page The current page\n\t * @ignore\n\t */\n\tfunction init( $container, prefix, page ) {\n\t\tconst isParsoidEnabled = !!document.querySelector( '.mw-parser-output[data-mw-parsoid-version]' );\n\t\tif ( isParsoidEnabled ) {\n\t\t\tsectionCollapsing.init( $container[0] );\n\t\t} else {\n\t\t\t// Only handle headings in content processed by MakeSectionsTransform.\n\t\t\t// Remove event handler added by MakeSectionsTransform::interimTogglingSupport().\n\t\t\t$container.find( '.section-heading' ).removeAttr( 'onclick' );\n\t\t\t// Cleanup global as it is no longer needed. We check if it's undefined because\n\t\t\t// there is no guarantee this won't be run on other skins e.g. Vector or cached HTML.\n\t\t\tif ( window.mfTempOpenSection !== undefined ) {\n\t\t\t\tdelete window.mfTempOpenSection;\n\t\t\t}\n\t\t\t// eslint-disable-next-line no-new\n\t\t\tnew Toggler( {\n\t\t\t\t$container: $container,\n\t\t\t\tprefix: prefix,\n\t\t\t\tpage: page,\n\t\t\t\teventBus: eventBus\n\t\t\t} );\n\t\t}\n\t}\n\n\tif (\n\t\t// Avoid this running on Watchlist.\n\t\t!currentPage.inNamespace( 'special' ) &&\n\t\t(\n\t\t\tmw.config.get( 'wgAction' ) === 'view' ||\n\t\t\tmw.config.get( 'wgAction' ) === 'edit'\n\t\t)\n\t) {\n\t\tmw.hook( 'wikipage.content' ).add( function ( $container ) {\n\t\t\tlet $contentContainer = $container.find( '.mw-parser-output' );\n\t\t\t// If there was no mw-parser-output wrapper, just use the parent.\n\t\t\tif ( $contentContainer.length === 0 ) {\n\t\t\t\t$contentContainer = $container;\n\t\t\t}\n\t\t\tinit( $contentContainer, 'content-', currentPage );\n\t\t} );\n\t}\n};\n","const\n\tutil = require( './util' ),\n\tescapeSelector = util.escapeSelector,\n\tarrowOptions = {\n\t\ticon: 'expand',\n\t\tisSmall: true,\n\t\tadditionalClassNames: 'indicator'\n\t},\n\tIcon = require( './Icon' );\nconst isCollapsedByDefault = require( './isCollapsedByDefault.js' );\n\n/**\n * @typedef {Object} ToggledEvent\n * @prop {boolean} expanded True if section is opened, false if closed.\n * @prop {Page} page\n * @prop {jQuery.Object} $heading\n * @memberof module:mobile.startup\n * @ignore\n */\n\n/**\n * A class for enabling toggling\n *\n * Toggling can be disabled on a sepcific heading by adding the\n * collapsible-heading-disabled class.\n *\n * @class Toggler\n * @param {Object} options\n * @param {OO.EventEmitter} options.eventBus Object used to emit section-toggled events.\n * @param {jQuery.Object} options.$container to apply toggling to\n * @param {string} options.prefix a prefix to use for the id.\n * @param {Page} options.page to allow storage of session for future visits\n */\nfunction Toggler( options ) {\n\tthis.eventBus = options.eventBus;\n\tthis.$container = options.$container;\n\tthis.prefix = options.prefix;\n\tthis.page = options.page;\n\tthis._enable();\n}\n\n/**\n * Using the settings module looks at what sections were previously expanded on\n * existing page.\n *\n * @param {Page} page\n * @return {Object} representing open sections\n * @ignore\n */\nfunction getExpandedSections( page ) {\n\tconst expandedSections = mw.storage.session.getObject( 'expandedSections' ) || {};\n\texpandedSections[page.title] = expandedSections[page.title] || {};\n\treturn expandedSections;\n}\n\n/**\n * Save expandedSections to sessionStorage\n *\n * @param {Object} expandedSections\n * @ignore\n */\nfunction saveExpandedSections( expandedSections ) {\n\tmw.storage.session.setObject(\n\t\t'expandedSections', expandedSections\n\t);\n}\n\n/**\n * Given an expanded heading, store it to sessionStorage.\n * If the heading is collapsed, remove it from sessionStorage.\n *\n * @param {jQuery.Object} $heading - A heading belonging to a section\n * @param {Page} page\n * @ignore\n */\nfunction storeSectionToggleState( $heading, page ) {\n\tconst headline = $heading.find( '.mw-headline' ).attr( 'id' ),\n\t\texpandedSections = getExpandedSections( page );\n\n\tif ( headline && expandedSections[page.title] ) {\n\t\tconst isSectionOpen = $heading.hasClass( 'open-block' );\n\t\tif ( isSectionOpen ) {\n\t\t\texpandedSections[page.title][headline] = true;\n\t\t} else {\n\t\t\tdelete expandedSections[page.title][headline];\n\t\t}\n\n\t\tsaveExpandedSections( expandedSections );\n\t}\n}\n\n/**\n * Expand sections that were previously expanded before leaving this page.\n *\n * @param {Toggler} toggler\n * @param {jQuery.Object} $container\n * @param {Page} page\n * @ignore\n */\nfunction expandStoredSections( toggler, $container, page ) {\n\tconst expandedSections = getExpandedSections( page ),\n\t\t$headlines = $container.find( '.section-heading span' );\n\n\t$headlines.each( function () {\n\t\tconst $headline = $container.find( this );\n\t\tconst $sectionHeading = $headline.parents( '.section-heading' );\n\t\t// toggle only if the section is not already expanded\n\t\tif (\n\t\t\texpandedSections[page.title][$headline.attr( 'id' )] &&\n\t\t\t!$sectionHeading.hasClass( 'open-block' )\n\t\t) {\n\t\t\ttoggler.toggle( $sectionHeading, true );\n\t\t}\n\t} );\n}\n\n/**\n * Check if sections should be collapsed by default\n *\n * @return {boolean}\n */\nToggler.prototype.isCollapsedByDefault = function () {\n\tif ( this._isCollapsedByDefault === undefined ) {\n\t\t// Thess classes override site settings and user preferences. For example:\n\t\t// * ...-collapsed used on talk pages by DiscussionTools. (T321618, T322628)\n\t\t// * ...-expanded used in previews (T336572)\n\t\tconst $override = this.$container.closest( '.collapsible-headings-collapsed, .collapsible-headings-expanded' );\n\t\tif ( $override.length ) {\n\t\t\tthis._isCollapsedByDefault = $override.hasClass( 'collapsible-headings-collapsed' );\n\t\t} else {\n\t\t\t// Check site config\n\t\t\tthis._isCollapsedByDefault = isCollapsedByDefault();\n\t\t}\n\t}\n\treturn this._isCollapsedByDefault;\n};\n\n/**\n * Given a heading, toggle it and any of its children\n *\n * @memberof Toggler\n * @instance\n * @param {jQuery.Object} $heading A heading belonging to a section\n * @param {boolean} fromSaved Section is being toggled from a saved state\n * @return {boolean}\n */\nToggler.prototype.toggle = function ( $heading, fromSaved ) {\n\tif ( !fromSaved && $heading.hasClass( 'collapsible-heading-disabled' ) ) {\n\t\treturn false;\n\t}\n\n\tconst self = this,\n\t\twasExpanded = $heading.is( '.open-block' );\n\n\t$heading.toggleClass( 'open-block' );\n\n\tarrowOptions.rotation = wasExpanded ? 0 : 180;\n\tconst newIndicator = new Icon( arrowOptions );\n\tconst $indicatorElement = $heading.data( 'indicator' );\n\tif ( $indicatorElement ) {\n\t\t$indicatorElement.replaceWith( newIndicator.$el );\n\t\t$heading.data( 'indicator', newIndicator.$el );\n\t}\n\n\tconst $headingLabel = $heading.find( '.mw-headline' );\n\t$headingLabel.attr( 'aria-expanded', !wasExpanded );\n\n\tconst $content = $heading.next();\n\tif ( $content.hasClass( 'open-block' ) ) {\n\t\t$content.removeClass( 'open-block' );\n\t\t// jquery doesn't allow custom values for the hidden attribute it seems.\n\t\t$content.get( 0 ).setAttribute( 'hidden', 'until-found' );\n\t} else {\n\t\t$content.addClass( 'open-block' );\n\t\t$content.removeAttr( 'hidden' );\n\t}\n\n\t/* T239418 We consider this event as a low-priority one and emit it asynchronously.\n\tThis ensures that any logic associated with section toggling is async and not contributing\n\tdirectly to a slow click/press event handler.\n\n\tCurrently costly reflow-inducing viewport size computation is being done for lazy-loaded\n\timages by the main listener to this event. */\n\tmw.requestIdleCallback( () => {\n\t\t/**\n\t\t * Global event emitted after a section has been toggled\n\t\t *\n\t\t * @event ~section-toggled\n\t\t * @type {ToggledEvent}\n\t\t * @memberof module:mobile.startup~Toggler\n\t\t * @ignore\n\t\t */\n\n\t\tself.eventBus.emit( 'section-toggled', {\n\t\t\texpanded: wasExpanded,\n\t\t\t$heading\n\t\t} );\n\t\t/**\n\t\t * Internal for use inside ExternalGuidance.\n\t\t *\n\t\t * @event ~'mobileFrontend.section-toggled'\n\t\t * @memberof Hooks\n\t\t */\n\t\tmw.hook( 'mobileFrontend.section-toggled' ).fire( {\n\t\t\texpanded: wasExpanded,\n\t\t\t$heading\n\t\t} );\n\t} );\n\n\tif ( this.isCollapsedByDefault() ) {\n\t\tstoreSectionToggleState( $heading, this.page );\n\t}\n\treturn true;\n};\n\n/**\n * Enables toggling via enter and space keys\n *\n * @param {Toggler} toggler instance.\n * @param {jQuery.Object} $heading\n * @ignore\n */\nfunction enableKeyboardActions( toggler, $heading ) {\n\t$heading.on( 'keypress', ( ev ) => {\n\t\tif ( ev.which === 13 || ev.which === 32 ) {\n\t\t\t// Only handle keypresses on the \"Enter\" or \"Space\" keys\n\t\t\ttoggler.toggle( $heading );\n\t\t}\n\t} ).find( 'a' ).on( 'keypress mouseup', ( ev ) => ev.stopPropagation() );\n}\n\n/**\n * Reveals an element and its parent section as identified by it's id\n *\n * @memberof Toggler\n * @instance\n * @param {string} id An element ID within the $container\n * @return {boolean} Target ID was found\n */\nToggler.prototype.reveal = function ( id ) {\n\tlet $target;\n\t// jQuery will throw for hashes containing certain characters which can break toggling\n\ttry {\n\t\t$target = this.$container.find( '#' + escapeSelector( id ) );\n\t} catch ( e ) {}\n\tif ( !$target || !$target.length ) {\n\t\treturn false;\n\t}\n\n\tlet $heading = $target.parents( '.collapsible-heading' );\n\t// The heading is not a section heading, check if in a content block!\n\tif ( !$heading.length ) {\n\t\t$heading = $target.parents( '.collapsible-block' ).prev( '.collapsible-heading' );\n\t}\n\tif ( $heading.length && !$heading.hasClass( 'open-block' ) ) {\n\t\tthis.toggle( $heading );\n\t}\n\tif ( $heading.length ) {\n\t\t// scroll again after opening section (opening section makes the page longer)\n\t\twindow.scrollTo( 0, $target.offset().top );\n\t}\n\treturn true;\n};\n\n/**\n * Enables section toggling in a given container.\n *\n * @memberof Toggler\n * @instance\n * @private\n */\nToggler.prototype._enable = function () {\n\tconst self = this;\n\n\t// FIXME This should use .find() instead of .children(), some extensions like Wikibase\n\t// want to toggle other headlines than direct descendants of $container. (T95889)\n\tthis.$container.children( '.section-heading' ).each( function ( i ) {\n\t\tconst $heading = self.$container.find( this ),\n\t\t\t$headingLabel = $heading.find( '.mw-headline' ),\n\t\t\t$indicator = $heading.find( '.indicator' ),\n\t\t\tid = self.prefix + 'collapsible-block-' + i;\n\t\t// Be sure there is a `section` wrapping the section content.\n\t\t// Otherwise, collapsible sections for this page is not enabled.\n\t\tif ( $heading.next().is( 'section' ) ) {\n\t\t\tconst $content = $heading.next( 'section' );\n\t\t\t$heading\n\t\t\t\t.addClass( 'collapsible-heading ' )\n\t\t\t\t.data( 'section-number', i )\n\t\t\t\t.on( 'click', ( ev ) => {\n\t\t\t\t\t// don't toggle, if the click target was a link\n\t\t\t\t\t// (a link in a section heading)\n\t\t\t\t\t// See T117880\n\t\t\t\t\tconst clickedLink = ev.target.closest( 'a' );\n\t\t\t\t\tif ( !clickedLink || !clickedLink.href ) {\n\t\t\t\t\t\t// prevent taps/clicks on edit button after toggling (T58209)\n\t\t\t\t\t\tev.preventDefault();\n\t\t\t\t\t\tself.toggle( $heading );\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t$headingLabel\n\t\t\t\t.attr( {\n\t\t\t\t\ttabindex: 0,\n\t\t\t\t\trole: 'button',\n\t\t\t\t\t'aria-controls': id,\n\t\t\t\t\t'aria-expanded': 'false'\n\t\t\t\t} );\n\n\t\t\tarrowOptions.rotation = !self.isCollapsedByDefault() ? 180 : 0;\n\t\t\tconst indicator = new Icon( arrowOptions );\n\t\t\tif ( $indicator.length ) {\n\t\t\t\t// replace the existing indicator\n\t\t\t\t$indicator.replaceWith( indicator.$el );\n\t\t\t} else {\n\t\t\t\tindicator.prependTo( $heading );\n\t\t\t}\n\t\t\t$heading.data( 'indicator', indicator.$el );\n\t\t\t$content\n\t\t\t\t.addClass( 'collapsible-block' )\n\t\t\t\t.eq( 0 )\n\t\t\t\t.attr( {\n\t\t\t\t\t// We need to give each content block a unique id as that's\n\t\t\t\t\t// the only way we can tell screen readers what element we're\n\t\t\t\t\t// referring to via `aria-controls`.\n\t\t\t\t\tid\n\t\t\t\t} )\n\t\t\t\t.on( 'beforematch', () => self.toggle( $heading ) )\n\t\t\t\t.addClass( 'collapsible-block-js' )\n\t\t\t\t.get( 0 ).setAttribute( 'hidden', 'until-found' );\n\n\t\t\tenableKeyboardActions( self, $heading );\n\n\t\t\tif ( !self.isCollapsedByDefault() ) {\n\t\t\t\t// Expand sections by default on wide screen devices\n\t\t\t\t// or if the expand sections setting is set.\n\t\t\t\t// The wide screen logic for determining whether to collapse sections initially\n\t\t\t\t// should be kept in sync with mobileoptions#initLocalStorageElements().\n\t\t\t\tself.toggle( $heading );\n\t\t\t}\n\t\t}\n\t} );\n\n\t/**\n\t * Checks the existing hash and toggles open any section that contains the fragment.\n\t *\n\t * @method\n\t */\n\tfunction checkHash() {\n\t\t// eslint-disable-next-line no-restricted-properties\n\t\tlet hash = window.location.hash;\n\t\tif ( hash.indexOf( '#' ) === 0 ) {\n\t\t\thash = hash.slice( 1 );\n\t\t\t// Per https://html.spec.whatwg.org/multipage/browsing-the-web.html#target-element\n\t\t\t// we try the raw fragment first, then the percent-decoded fragment.\n\t\t\tif ( !self.reveal( hash ) ) {\n\t\t\t\tconst decodedHash = mw.util.percentDecodeFragment( hash );\n\t\t\t\tif ( decodedHash ) {\n\t\t\t\t\tself.reveal( decodedHash );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Checks the value of wgInternalRedirectTargetUrl and sets the hash if present.\n\t * checkHash() will reveal the collapsed section that contains it afterwards.\n\t *\n\t * @method\n\t */\n\tfunction checkInternalRedirectAndHash() {\n\t\tconst internalRedirect = mw.config.get( 'wgInternalRedirectTargetUrl' ),\n\t\t\tinternalRedirectHash = internalRedirect ? internalRedirect.split( '#' )[1] : false;\n\n\t\tif ( internalRedirectHash ) {\n\t\t\t// eslint-disable-next-line no-restricted-properties\n\t\t\twindow.location.hash = internalRedirectHash;\n\t\t}\n\t}\n\n\tcheckInternalRedirectAndHash();\n\tcheckHash();\n\n\tutil.getWindow().on( 'hashchange', () => checkHash() );\n\n\tif ( this.isCollapsedByDefault() && this.page ) {\n\t\texpandStoredSections( this, this.$container, this.page );\n\t}\n};\n\nToggler._getExpandedSections = getExpandedSections;\nToggler._expandStoredSections = expandStoredSections;\n\nmodule.exports = Toggler;\n","const browser = require( './Browser' ).getSingleton();\n\n/**\n * Checks if sections should be collapsed by default.\n * @ignore\n *\n * @return {boolean}\n */\nfunction isCollapsedByDefault() {\n\treturn mw.config.get( 'wgMFCollapseSectionsByDefault' ) && !browser.isWideScreen() &&\n\t\t// Section collapsing can be disabled in MobilePreferences\n\t\t!document.documentElement.classList.contains(\n\t\t\t'mf-expand-sections-clientpref-1'\n\t\t);\n}\n\nmodule.exports = isCollapsedByDefault;\n","const isCollapsedByDefault = require( './isCollapsedByDefault' );\n\n/**\n * Sets attributes on collapsible elements based on collapsed state\n *\n * @method\n * @param {HTMLElement} container div element containing collapsible heading\n * @param {HTMLElement} headingText span element containing heading text\n * @param {HTMLElement} icon span element for icon\n * @param {boolean} isCollapsed collapsed state to set\n * @ignore\n */\nfunction setCollapsedState( content, headingText, icon, isCollapsed ) {\n\t// show the content if hidden, hide if shown (until found so find in page works)\n\tcontent.hidden = isCollapsed ? 'until-found' : false;\n\n\t// update the dropdown state based on the content visibility\n\tif ( isCollapsed ) {\n\t\theadingText.setAttribute( 'aria-expanded', 'true' );\n\t\ticon.classList.add( 'mf-icon-expand' );\n\t\ticon.classList.remove( 'mf-icon-collapse' );\n\t} else {\n\t\theadingText.setAttribute( 'aria-expanded', 'false' );\n\t\ticon.classList.add( 'mf-icon-collapse' );\n\t\ticon.classList.remove( 'mf-icon-expand' );\n\t}\n}\n\n/**\n * Toggles collapsible state for a heading\n *\n * @method\n * @param {HTMLElement} container div element containing collapsible heading\n * @param {HTMLElement} headingText span element containing heading text\n * @param {HTMLElement} icon span element for icon\n * @ignore\n */\nfunction toggle( content, headingText, icon ) {\n\tconst currentlyHidden = content.hidden;\n\tsetCollapsedState( content, headingText, icon, !currentlyHidden );\n}\n\n/**\n * Initialises collapsing code.\n *\n * @method\n * @param {HTMLElement} container to enable collapsing on\n * @ignore\n */\nfunction init( container ) {\n\tconst isCollapsed = isCollapsedByDefault();\n\tconst headingWrappers = Array.from( container.querySelectorAll( '.mw-parser-output > section > .mw-heading' ) );\n\theadingWrappers.forEach( ( wrapper ) => {\n\t\twrapper.classList.add( 'mf-collapsible-heading' );\n\t\tconst heading = wrapper.firstElementChild;\n\n\t\t// Add class to collapsible content\n\t\t// Used in CSS before hidden attribute is added\n\t\tconst content = wrapper.nextElementSibling;\n\t\tcontent.classList.add( 'mf-collapsible-content' );\n\n\t\t// Update the heading text to account for semantics of collapsing sections\n\t\tconst headingText = document.createElement( 'span' );\n\t\theadingText.textContent = heading.textContent;\n\t\theadingText.setAttribute( 'tabindex', '0' );\n\t\theadingText.setAttribute( 'role', 'button' );\n\t\theadingText.setAttribute( 'aria-controls', content.id );\n\n\t\t// Create the dropdown arrow\n\t\tconst icon = document.createElement( 'span' );\n\t\ticon.classList.add( 'mf-icon', 'mf-icon--small', 'mf-collapsible-icon' );\n\t\ticon.setAttribute( 'aria-hidden', true );\n\n\t\tsetCollapsedState( content, headingText, icon, isCollapsed );\n\n\t\t// Replace contents of the heading element\n\t\theading.innerHTML = '';\n\t\theading.append( icon );\n\t\theading.append( headingText );\n\n\t\t// Register the click handlers\n\t\theading.addEventListener( 'click', () => toggle( content, headingText, icon ) );\n\t} );\n}\n\nmodule.exports = { init };\n"],"names":["M","require","util","editorLoadingOverlay","OverlayManager","$editTab","$","hasTwoEditIcons","length","EDITSECTION_SELECTOR","user","mw","CtaDrawer","veConfig","config","get","editorPath","editorOverride","onEditLinkClick","elem","ev","router","section","getParamValue","href","id","navigate","preventDefault","getPreferredEditor","preferredEditor","options","storage","bindEditLinksSorryToast","msg","on","notify","hook","add","$content","find","addRoute","checkRoute","module","exports","currentPage","currentPageHTMLParser","skin","__non_webpack_require__","inNamespace","editRestrictions","isReadOnly","page","overlayManager","getSingleton","isNewPage","this","off","sectionId","abortableDataPromise","overlayPromise","scrollTop","window","pageYOffset","$contentText","url","URL","location","editorOptions","fakeScroll","api","Api","licenseMsg","getLicenseMsg","title","titleObj","isAnon","oldId","contentLang","attr","contentDir","preload","searchParams","preloadparams","getArrayParam","editintro","visualAbortPromise","Deferred","animationDelayDeferred","initMechanism","logInit","editor","track","action","type","mechanism","integration","editor_interface","shouldLoadVisualEditor","isVESourceAvailable","isVEVisualAvailable","loadSourceEditor","fire","loader","using","then","isWikiText","undefined","loadingOverlay","$sectionTop","enableVisualSectionEditing","document","body","addClass","$page","closest","prop","getBoundingClientRect","top","css","transform","setTimeout","resolve","abort","removeClass","reject","mode","dataPromise","libs","ve","targetLoader","requestPageData","getPrefixedDb","sessionStore","targetName","visualLoadingPromise","addPlugin","loadModules","visualPromise","VisualEditorOverlay","SourceEditorOverlay","loadVisualEditorMaybe","Promise","all","overlay","getLoadingPromise","catch","error","state","sourceOverlay","promise","overlayData","stack","replaceCurrent","apiResponse","back","show","appendChild","$el","getErrorMessage","i","editUrl","set","toString","getPath","fragment","history","pushState","delete","replaceState","docReady","setupEditor","hide","hideSectionEditIcons","Array","isArray","drawer","showLoginDrawer","content","signupQueryParams","warning","bindEditLinksLoginDrawer","$link","getUrl","message","parseDom","init","fakeToolbar","IconButton","Overlay","afterShow","afterHide","loadBasicEditor","timeout","$fakeToolbar","$loadBasicWrapper","loadBasicButton","label","weight","size","isIconOnly","icon","className","noHeader","isBorderBox","onBeforeExit","exit","clearTimeout","logFeatureUse","feature","prototype","call","append","text","lazyImageLoader","$container","HTMLElement","imagePlaceholders","queryPlaceholders","addEventListener","loadImages","observer","IntersectionObserver","entries","forEach","entry","placeholder","target","isIntersecting","loadImage","unobserve","rootMargin","threshold","observe","toggling","FONT_SIZE_KEY","SECTION_COLLAPSING_TOGGLE","lazyLoadedImages","$window","getWindow","Skin","eventBus","apply2","fn1","fn2","apply","arguments","debounce","emit","throttle","has","console","log","documentElement","classList","contains","clientPrefs","saveOption","remove","Toggler","sectionCollapsing","$contentContainer","prefix","querySelector","removeAttr","mfTempOpenSection","escapeSelector","arrowOptions","isSmall","additionalClassNames","Icon","isCollapsedByDefault","_enable","getExpandedSections","expandedSections","session","getObject","expandStoredSections","toggler","each","$headline","$sectionHeading","parents","hasClass","toggle","_isCollapsedByDefault","$override","$heading","fromSaved","self","wasExpanded","is","toggleClass","rotation","newIndicator","$indicatorElement","data","replaceWith","next","setAttribute","requestIdleCallback","expanded","headline","setObject","saveExpandedSections","storeSectionToggleState","reveal","$target","e","prev","scrollTo","offset","internalRedirect","internalRedirectHash","checkHash","hash","indexOf","slice","decodedHash","percentDecodeFragment","children","$headingLabel","$indicator","clickedLink","tabindex","role","indicator","prependTo","eq","which","stopPropagation","enableKeyboardActions","split","_getExpandedSections","_expandStoredSections","browser","isWideScreen","setCollapsedState","headingText","isCollapsed","hidden","container","from","querySelectorAll","wrapper","heading","firstElementChild","nextElementSibling","createElement","textContent","innerHTML"],"sourceRoot":""}
\ No newline at end of file
diff --git a/extensions/MobileFrontend/resources/dist/mobile.languages.structured.js b/extensions/MobileFrontend/resources/dist/mobile.languages.structured.js
new file mode 100644
index 000000000..b3f805057
--- /dev/null
+++ b/extensions/MobileFrontend/resources/dist/mobile.languages.structured.js
@@ -0,0 +1,2 @@
+(self.webpackChunkmfModules=self.webpackChunkmfModules||[]).push([[799],{"./src/mobile.languages.structured/LanguageSearcher.js":(e,t,a)=>{var s=a("./src/mobile.startup/View.js"),n=a("./src/mobile.startup/util.js"),r=a("./src/mobile.languages.structured/util.js");function l(e){var t=r.getStructuredLanguages(e.languages,e.variants,r.getFrequentlyUsedLanguages(),e.showSuggestedLanguages,e.deviceLanguage);s.call(this,n.extend({className:"language-searcher",events:{"click a":"onLinkClick","click .language-search-banner":"onSearchBannerClick","input .search":"onSearchInput"},inputPlaceholder:mw.msg("mobile-frontend-languages-structured-overlay-search-input-placeholder"),allLanguagesHeader:mw.msg("mobile-frontend-languages-structured-overlay-all-languages-header").toLocaleUpperCase(),suggestedLanguagesHeader:mw.msg("mobile-frontend-languages-structured-overlay-suggested-languages-header").toLocaleUpperCase(),noResultsFoundHeader:mw.msg("mobile-frontend-languages-structured-overlay-no-results"),noResultsFoundMessage:mw.msg("mobile-frontend-languages-structured-overlay-no-results-body"),allLanguages:t.all,allLanguagesCount:t.all.length,suggestedLanguages:t.suggested,suggestedLanguagesCount:t.suggested.length,showSuggestedLanguagesHeader:t.suggested.length>0},e));var a=e.onOpen;if(a){var l=this;setTimeout((function(){a(l)}),0)}}a("./src/mobile.startup/mfExtend.js")(l,s,{template:n.template('\n<div class="panel">\n\t<div class="panel-body search-box">\n\t\t<input type="search" class="search" placeholder="{{inputPlaceholder}}">\n\t</div>\n</div>\n\n<div class="overlay-content-body">\n\t{{#showSuggestedLanguagesHeader}}\n\t<h3 class="list-header">{{suggestedLanguagesHeader}}</h3>\n\t{{/showSuggestedLanguagesHeader}}\n\t{{#suggestedLanguagesCount}}\n\t<ol class="site-link-list suggested-languages">\n\t\t{{#suggestedLanguages}}\n\t\t\t<li>\n\t\t\t\t<a href="{{url}}" class="{{lang}}" hreflang="{{lang}}" lang="{{lang}}" dir="{{dir}}">\n\t\t\t\t\t<span class="autonym">{{autonym}}</span>\n\t\t\t\t\t{{#title}}\n\t\t\t\t\t\t<span class="title">{{title}}</span>\n\t\t\t\t\t{{/title}}\n\t\t\t\t</a>\n\t\t\t</li>\n\t\t{{/suggestedLanguages}}\n\t</ol>\n\t{{/suggestedLanguagesCount}}\n\t{{#bannerHTML}}\n\t<div class="language-search-banner">\n\t\t{{{.}}}\n\t</div>\n\t{{/bannerHTML}}\n\t{{#allLanguagesCount}}\n\t<h3 class="list-header">{{allLanguagesHeader}} ({{allLanguagesCount}})</h3>\n\t<ul class="site-link-list all-languages">\n\t\t{{#allLanguages}}\n\t\t\t<li>\n\t\t\t\t<a href="{{url}}" class="{{lang}}" hreflang="{{lang}}" lang="{{lang}}" dir="{{dir}}">\n\t\t\t\t\t<span class="autonym">{{autonym}}</span>\n\t\t\t\t\t{{#title}}\n\t\t\t\t\t\t<span class="title">{{title}}</span>\n\t\t\t\t\t{{/title}}\n\t\t\t\t</a>\n\t\t\t</li>\n\t\t{{/allLanguages}}\n\t</ul>\n\t{{/allLanguagesCount}}\n\t<section class="empty-results hidden">\n\t\t<h4 class="empty-results-header">{{noResultsFoundHeader}}</h4>\n\t\t<p class="empty-results-body">{{noResultsFoundMessage}}</p>\n\t</section>\n</div>\n\t'),postRender:function(){this.$siteLinksList=this.$el.find(".site-link-list"),this.$languageItems=this.$siteLinksList.find("a"),this.$subheaders=this.$el.find("h3"),this.$emptyResultsSection=this.$el.find(".empty-results")},addBanner:function(e,t){this.options.bannerHTML=e,this.options.bannerFirstLanguage=t,this.options.showSuggestedLanguagesHeader=!0,this.render()},onSearchBannerClick:function(){this.$el.find(".search").val(this.options.bannerFirstLanguage).trigger("input")},onLinkClick:function(e){var t=this.$el.find(e.currentTarget).attr("lang");mw.hook("mobileFrontend.languageSearcher.linkClick").fire(t),r.saveLanguageUsageCount(t,r.getFrequentlyUsedLanguages())},onSearchInput:function(e){var t=void 0===e.originalEvent?"entrypoint-banner":"ui";this.filterLanguages(e.target.value.toLowerCase(),t)},filterLanguages:function(e,t){var a=[];e?(this.options.languages.forEach((function(t){var s=t.langname;(t.autonym.toLowerCase().indexOf(e)>-1||s&&s.toLowerCase().indexOf(e)>-1||t.lang.toLowerCase().indexOf(e)>-1)&&a.push(t.lang)})),this.options.variants&&this.options.variants.forEach((function(t){(t.autonym.toLowerCase().indexOf(e)>-1||t.lang.toLowerCase().indexOf(e)>-1)&&a.push(t.lang)})),this.$languageItems.addClass("hidden"),a.length?(this.$siteLinksList.find(".".concat(mw.util.escapeRegExp(a.join(",.")))).removeClass("hidden"),this.$emptyResultsSection.addClass("hidden")):(this.$emptyResultsSection.removeClass("hidden"),mw.hook("mobileFrontend.languageSearcher.noresults").fire(e,this.$emptyResultsSection.get(0),t)),this.$siteLinksList.addClass("filtered"),this.$subheaders.addClass("hidden")):(this.$languageItems.removeClass("hidden"),this.$siteLinksList.removeClass("filtered"),this.$subheaders.removeClass("hidden"),this.$emptyResultsSection.addClass("hidden"))}}),e.exports=l},"./src/mobile.languages.structured/mobile.languages.structured.js":(e,t,a)=>{var s=a("./src/mobile.startup/moduleLoaderSingleton.js"),n=a("./src/mobile.languages.structured/LanguageSearcher.js");s.define("mobile.languages.structured/LanguageSearcher",n)},"./src/mobile.languages.structured/rtlLanguages.js":e=>{e.exports=["acm","aeb","aeb-arab","apc","ar","arc","arq","ary","arz","azb","bcc","bgn","bqi","ckb","dv","fa","glk","he","hno","khw","kk-arab","kk-cn","ks","ks-arab","ku-arab","lki","lrc","luz","ms-arab","mzn","nqo","pnb","ps","sd","sdh","skr","skr-arab","ug","ug-arab","ur","yi"]},"./src/mobile.languages.structured/util.js":(e,t,a)=>{var s=a("./src/mobile.startup/util.js"),n=a("./src/mobile.languages.structured/rtlLanguages.js");e.exports={getDir:function(e){var t=n.indexOf(e.lang)>-1?"rtl":"ltr";return s.extend({},e,{dir:t})},getStructuredLanguages:function(e,t,a,s,n){var r=Object.prototype.hasOwnProperty,l=this,u=0,g=0,i=[],o=[];function d(e){return e.dir?e:l.getDir(e)}return n=function(e,t){var a,s=Object.prototype.hasOwnProperty,n={};if(t){var r=t.indexOf("-");return-1!==r&&(a=t.slice(0,r)),e.forEach((function(e){e.lang!==a&&e.lang!==t||(n[e.lang]=!0)})),s.call(n,t)?t:s.call(n,a)?a:void 0}}(e,n),n&&(Object.keys(a).forEach((function(e){var t=a[e];u=u<t?t:u,g=g>t?t:g})),a[n]=u+1),s?e.map(d).forEach((function(e){r.call(a,e.lang)?(e.frequency=a[e.lang],i.push(e)):o.push(e)})):o=e.map(d),t&&s&&t.map(d).forEach((function(e){r.call(a,e.lang)?e.frequency=a[e.lang]:e.frequency=g-1,i.push(e)})),i=i.sort((function(e,t){return t.frequency-e.frequency})),o=o.sort((function(e,t){return e.autonym.toLocaleLowerCase()<t.autonym.toLocaleLowerCase()?-1:1})),{suggested:i,all:o}},getFrequentlyUsedLanguages:function(){var e=mw.storage.get("langMap");return e?JSON.parse(e):{}},saveFrequentlyUsedLanguages:function(e){mw.storage.set("langMap",JSON.stringify(e))},saveLanguageUsageCount:function(e,t){var a=t[e]||0;a+=1,t[e]=a>100?100:a,this.saveFrequentlyUsedLanguages(t)}}}},e=>{e.O(0,[569],(()=>e(e.s="./src/mobile.languages.structured/mobile.languages.structured.js")));var t=e.O();(this.mfModules=this.mfModules||{})["mobile.languages.structured"]=t}]);
+//# sourceMappingURL=mobile.languages.structured.js.map.json
\ No newline at end of file
diff --git a/extensions/MobileFrontend/resources/dist/mobile.languages.structured.js.map.json b/extensions/MobileFrontend/resources/dist/mobile.languages.structured.js.map.json
new file mode 100644
index 000000000..00d9e3008
--- /dev/null
+++ b/extensions/MobileFrontend/resources/dist/mobile.languages.structured.js.map.json
@@ -0,0 +1 @@
+{"version":3,"file":"mobile.languages.structured.js","mappings":"2IAAA,IACCA,EAAOC,EAAS,gCAChBC,EAAOD,EAAS,gCAChBE,EAAWF,EAAS,6CAkBrB,SAASG,EAAkBC,GAI1B,IAAMC,EAAYH,EAASI,uBAC1BF,EAAMC,UACND,EAAMG,SACNL,EAASM,6BACTJ,EAAMK,uBACNL,EAAMM,gBAGPX,EAAKY,KACJC,KACAX,EAAKY,OACJ,CACCC,UAAW,oBACXC,OAAQ,CACP,UAAW,cACX,gCAAiC,sBACjC,gBAAiB,iBAGlBC,iBAAkBC,GAAGC,IAAK,yEAE1BC,mBAAoBF,GAAGC,IAAK,qEAAsEE,oBAClGC,yBAA0BJ,GAAGC,IAAK,2EAA4EE,oBAC9GE,qBAAsBL,GAAGC,IAAK,2DAC9BK,sBAAuBN,GAAGC,IAAK,gEAC/BM,aAAcnB,EAAUoB,IACxBC,kBAAmBrB,EAAUoB,IAAIE,OACjCC,mBAAoBvB,EAAUwB,UAC9BC,wBAAyBzB,EAAUwB,UAAUF,OAC7CI,6BAA8B1B,EAAUwB,UAAUF,OAAS,GAE5DvB,IAKF,IAAM4B,EAAS5B,EAAM4B,OACrB,GAAMA,EAAN,CAGA,IAAMC,EAAWrB,KACjBsB,YAAY,WACXF,EAAQC,EACT,GAAG,EAJH,CAKD,CAjEYjC,EAAS,mCAmErBmC,CAAUhC,EAAkBJ,EAAM,CAMjCqC,SAAUnC,EAAKmC,SAAS,ukDAwDxBC,WAAY,WAEXzB,KAAK0B,eAAiB1B,KAAK2B,IAAIC,KAAM,mBACrC5B,KAAK6B,eAAiB7B,KAAK0B,eAAeE,KAAM,KAChD5B,KAAK8B,YAAc9B,KAAK2B,IAAIC,KAAM,MAClC5B,KAAK+B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AAQsC,qBAAuB,EAAI,CAC7E,IAGO,CACNnF,UAAWD,EACXH,IAAKD,EAEP,EASAhB,2BAA4B,WAC3B,IAAMyG,EAAchG,GAAGiG,QAAQ/B,IAAK,WAEpC,OAAO8B,EAAcE,KAAKC,MAAOH,GAAgB,CAAC,CACnD,EASAI,4BAA6B,SAAWJ,GACvChG,GAAGiG,QAAQI,IAAK,UAAWH,KAAKI,UAAWN,GAC5C,EAWArD,uBAAwB,SAAW4D,EAAc5B,GAChD,IAAI6B,EAAQ7B,EAAyB4B,IAAkB,EAEvDC,GAAS,EAET7B,EAAyB4B,GAAiBC,EAAQ,IAAM,IAAMA,EAC9D7G,KAAKyG,4BAA6BzB,EACnC,E","sources":["webpack://mfModules/./src/mobile.languages.structured/LanguageSearcher.js","webpack://mfModules/./src/mobile.languages.structured/mobile.languages.structured.js","webpack://mfModules/./src/mobile.languages.structured/rtlLanguages.js","webpack://mfModules/./src/mobile.languages.structured/util.js"],"sourcesContent":["const\n\tView = require( '../mobile.startup/View' ),\n\tutil = require( '../mobile.startup/util' ),\n\tlangUtil = require( './util' ),\n\tmfExtend = require( '../mobile.startup/mfExtend' );\n\n/**\n * @class Hooks~LanguageSearcher\n * @classdesc Overlay displaying a structured list of languages for a page, only accessible via\n * the {@link Hooks~'mobileFrontend.languageSearcher.onOpen' mobileFrontend.languageSearcher.onOpen hook}.\n * @hideconstructor\n * @extends module:mobile.startup/View\n * @param {Object} props Configuration options\n * @param {Object[]} props.languages list of language objects as returned by the API\n * @param {Array|boolean} props.variants language variant objects\n * or false if no variants exist\n * @param {boolean} props.showSuggestedLanguages If the suggested languages\n * section should be rendered.\n * @param {string} [props.deviceLanguage] the device's primary language\n * @param {Function} [props.onOpen] callback that fires on opening the searcher\n */\nfunction LanguageSearcher( props ) {\n\t/**\n\t * @prop {StructuredLanguages} languages` JSDoc.\n\t */\n\tconst languages = langUtil.getStructuredLanguages(\n\t\tprops.languages,\n\t\tprops.variants,\n\t\tlangUtil.getFrequentlyUsedLanguages(),\n\t\tprops.showSuggestedLanguages,\n\t\tprops.deviceLanguage\n\t);\n\n\tView.call(\n\t\tthis,\n\t\tutil.extend(\n\t\t\t{\n\t\t\t\tclassName: 'language-searcher',\n\t\t\t\tevents: {\n\t\t\t\t\t'click a': 'onLinkClick',\n\t\t\t\t\t'click .language-search-banner': 'onSearchBannerClick',\n\t\t\t\t\t'input .search': 'onSearchInput'\n\t\t\t\t},\n\t\t\t\t// the rest are template properties\n\t\t\t\tinputPlaceholder: mw.msg( 'mobile-frontend-languages-structured-overlay-search-input-placeholder' ),\n\t\t\t\t// we can't rely on CSS only to uppercase the headings. See https://stackoverflow.com/questions/3777443/css-text-transform-not-working-properly-for-turkish-characters\n\t\t\t\tallLanguagesHeader: mw.msg( 'mobile-frontend-languages-structured-overlay-all-languages-header' ).toLocaleUpperCase(),\n\t\t\t\tsuggestedLanguagesHeader: mw.msg( 'mobile-frontend-languages-structured-overlay-suggested-languages-header' ).toLocaleUpperCase(),\n\t\t\t\tnoResultsFoundHeader: mw.msg( 'mobile-frontend-languages-structured-overlay-no-results' ),\n\t\t\t\tnoResultsFoundMessage: mw.msg( 'mobile-frontend-languages-structured-overlay-no-results-body' ),\n\t\t\t\tallLanguages: languages.all,\n\t\t\t\tallLanguagesCount: languages.all.length,\n\t\t\t\tsuggestedLanguages: languages.suggested,\n\t\t\t\tsuggestedLanguagesCount: languages.suggested.length,\n\t\t\t\tshowSuggestedLanguagesHeader: languages.suggested.length > 0\n\t\t\t},\n\t\t\tprops\n\t\t)\n\t);\n\n\t// defer event to be emitted after event handler has been registered\n\tconst onOpen = props.onOpen;\n\tif ( !onOpen ) {\n\t\treturn;\n\t}\n\tconst searcher = this;\n\tsetTimeout( () => {\n\t\tonOpen( searcher );\n\t}, 0 );\n}\n\nmfExtend( LanguageSearcher, View, {\n\t/**\n\t * @inheritdoc\n\t * @memberof LanguageSearcher\n\t * @instance\n\t */\n\ttemplate: util.template( `\n<div class=\"panel\">\n\t<div class=\"panel-body search-box\">\n\t\t<input type=\"search\" class=\"search\" placeholder=\"{{inputPlaceholder}}\">\n\t</div>\n</div>\n\n<div class=\"overlay-content-body\">\n\t{{#showSuggestedLanguagesHeader}}\n\t<h3 class=\"list-header\">{{suggestedLanguagesHeader}}</h3>\n\t{{/showSuggestedLanguagesHeader}}\n\t{{#suggestedLanguagesCount}}\n\t<ol class=\"site-link-list suggested-languages\">\n\t\t{{#suggestedLanguages}}\n\t\t\t<li>\n\t\t\t\t<a href=\"{{url}}\" class=\"{{lang}}\" hreflang=\"{{lang}}\" lang=\"{{lang}}\" dir=\"{{dir}}\">\n\t\t\t\t\t<span class=\"autonym\">{{autonym}}</span>\n\t\t\t\t\t{{#title}}\n\t\t\t\t\t\t<span class=\"title\">{{title}}</span>\n\t\t\t\t\t{{/title}}\n\t\t\t\t</a>\n\t\t\t</li>\n\t\t{{/suggestedLanguages}}\n\t</ol>\n\t{{/suggestedLanguagesCount}}\n\t{{#bannerHTML}}\n\t<div class=\"language-search-banner\">\n\t\t{{{.}}}\n\t</div>\n\t{{/bannerHTML}}\n\t{{#allLanguagesCount}}\n\t<h3 class=\"list-header\">{{allLanguagesHeader}} ({{allLanguagesCount}})</h3>\n\t<ul class=\"site-link-list all-languages\">\n\t\t{{#allLanguages}}\n\t\t\t<li>\n\t\t\t\t<a href=\"{{url}}\" class=\"{{lang}}\" hreflang=\"{{lang}}\" lang=\"{{lang}}\" dir=\"{{dir}}\">\n\t\t\t\t\t<span class=\"autonym\">{{autonym}}</span>\n\t\t\t\t\t{{#title}}\n\t\t\t\t\t\t<span class=\"title\">{{title}}</span>\n\t\t\t\t\t{{/title}}\n\t\t\t\t</a>\n\t\t\t</li>\n\t\t{{/allLanguages}}\n\t</ul>\n\t{{/allLanguagesCount}}\n\t<section class=\"empty-results hidden\">\n\t\t<h4 class=\"empty-results-header\">{{noResultsFoundHeader}}</h4>\n\t\t<p class=\"empty-results-body\">{{noResultsFoundMessage}}</p>\n\t</section>\n</div>\n\t` ),\n\t/**\n\t * @inheritdoc\n\t * @memberof LanguageSearcher\n\t * @instance\n\t */\n\tpostRender: function () {\n\t\t// cache\n\t\tthis.$siteLinksList = this.$el.find( '.site-link-list' );\n\t\tthis.$languageItems = this.$siteLinksList.find( 'a' );\n\t\tthis.$subheaders = this.$el.find( 'h3' );\n\t\tthis.$emptyResultsSection = this.$el.find( '.empty-results' );\n\t},\n\t/**\n\t * Method that can be called outside MF extension to render\n\t * a banner inside the language overlay.\n\t *\n\t * Stable for use inside ContentTranslation\n\t * @memberof LanguageSearcher\n\t * @param {string} bannerHTML\n\t * @param {string} firstMissingLanguage\n\t */\n\taddBanner: function ( bannerHTML, firstMissingLanguage ) {\n\t\tthis.options.bannerHTML = bannerHTML;\n\t\tthis.options.bannerFirstLanguage = firstMissingLanguage;\n\t\tthis.options.showSuggestedLanguagesHeader = true;\n\t\tthis.render();\n\t},\n\tonSearchBannerClick: function () {\n\t\tthis.$el.find( '.search' ).val( this.options.bannerFirstLanguage ).trigger( 'input' );\n\t},\n\t/**\n\t * Article link click event handler\n\t *\n\t * @memberof LanguageSearcher\n\t * @instance\n\t * @param {jQuery.Event} ev\n\t */\n\tonLinkClick: function ( ev ) {\n\t\tconst $link = this.$el.find( ev.currentTarget ),\n\t\t\tlang = $link.attr( 'lang' );\n\t\t/**\n\t\t * Internal for use in GrowthExperiments only.\n\t\t *\n\t\t * @event ~'mobileFrontend.languageSearcher.linkClick'\n\t\t * @memberof Hooks\n\t\t */\n\t\tmw.hook( 'mobileFrontend.languageSearcher.linkClick' ).fire( lang );\n\t\tlangUtil.saveLanguageUsageCount( lang, langUtil.getFrequentlyUsedLanguages() );\n\t},\n\t/**\n\t * Search input handler\n\t *\n\t * @memberof LanguageSearcher\n\t * @instance\n\t * @param {jQuery.Event} ev Event object.\n\t */\n\tonSearchInput: function ( ev ) {\n\t\tconst searchOrigin = ev.originalEvent === undefined ? 'entrypoint-banner' : 'ui';\n\n\t\tthis.filterLanguages( ev.target.value.toLowerCase(), searchOrigin );\n\t},\n\t/**\n\t * Filter the language list to only show languages that match the current search term.\n\t *\n\t * @memberof LanguageSearcher\n\t * @instance\n\t * @param {string} searchQuery of search term (lowercase).\n\t * @param {'entrypoint-banner'|'ui'} searchOrigin for internal use by CX entrypoints only\n\t */\n\tfilterLanguages: function ( searchQuery, searchOrigin ) {\n\t\tconst filteredList = [];\n\n\t\tif ( searchQuery ) {\n\t\t\tthis.options.languages.forEach( function ( language ) {\n\t\t\t\tconst langname = language.langname;\n\t\t\t\t// search by language code or language name\n\t\t\t\tif ( language.autonym.toLowerCase().indexOf( searchQuery ) > -1 ||\n\t\t\t\t\t\t( langname && langname.toLowerCase().indexOf( searchQuery ) > -1 ) ||\n\t\t\t\t\t\tlanguage.lang.toLowerCase().indexOf( searchQuery ) > -1\n\t\t\t\t) {\n\t\t\t\t\tfilteredList.push( language.lang );\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\tif ( this.options.variants ) {\n\t\t\t\tthis.options.variants.forEach( function ( variant ) {\n\t\t\t\t\t// search by variant code or variant name\n\t\t\t\t\tif ( variant.autonym.toLowerCase().indexOf( searchQuery ) > -1 ||\n\t\t\t\t\t\tvariant.lang.toLowerCase().indexOf( searchQuery ) > -1\n\t\t\t\t\t) {\n\t\t\t\t\t\tfilteredList.push( variant.lang );\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\tthis.$languageItems.addClass( 'hidden' );\n\t\t\tif ( filteredList.length ) {\n\t\t\t\tthis.$siteLinksList.find(\n\t\t\t\t\t`.${ mw.util.escapeRegExp( filteredList.join( ',.' ) ) }`\n\t\t\t\t).removeClass( 'hidden' );\n\t\t\t\tthis.$emptyResultsSection.addClass( 'hidden' );\n\t\t\t} else {\n\t\t\t\tthis.$emptyResultsSection.removeClass( 'hidden' );\n\t\t\t\t// Fire with the search query and the DOM element corresponding to no-results\n\t\t\t\t// message so that it can be customized in hook handler\n\t\t\t\t/**\n\t\t\t\t * Internal for use in ContentTranslation only.\n\t\t\t\t *\n\t\t\t\t * @event ~'mobileFrontend.editorOpening'\n\t\t\t\t * @memberof Hooks\n\t\t\t\t */\n\t\t\t\tmw.hook( 'mobileFrontend.languageSearcher.noresults' )\n\t\t\t\t\t.fire( searchQuery, this.$emptyResultsSection.get( 0 ), searchOrigin );\n\t\t\t}\n\t\t\tthis.$siteLinksList.addClass( 'filtered' );\n\t\t\tthis.$subheaders.addClass( 'hidden' );\n\t\t} else {\n\t\t\tthis.$languageItems.removeClass( 'hidden' );\n\t\t\tthis.$siteLinksList.removeClass( 'filtered' );\n\t\t\tthis.$subheaders.removeClass( 'hidden' );\n\t\t\tthis.$emptyResultsSection.addClass( 'hidden' );\n\t\t}\n\t}\n} );\n\nmodule.exports = LanguageSearcher;\n","const\n\tm = require( '../mobile.startup/moduleLoaderSingleton' ),\n\tLanguageSearcher = require( './LanguageSearcher' );\n\n// Needed because LanguageSearcher is lazy loaded, and if we try to use require\n// (instead of m.require), webpack will excise it into mobile.common.\nm.define( 'mobile.languages.structured/LanguageSearcher', LanguageSearcher );\n","/**\n * @private\n */\nmodule.exports = [\n\t'acm',\n\t'aeb',\n\t'aeb-arab',\n\t'apc',\n\t'ar',\n\t'arc',\n\t'arq',\n\t'ary',\n\t'arz',\n\t'azb',\n\t'bcc',\n\t'bgn',\n\t'bqi',\n\t'ckb',\n\t'dv',\n\t'fa',\n\t'glk',\n\t'he',\n\t'hno',\n\t'khw',\n\t'kk-arab',\n\t'kk-cn',\n\t'ks',\n\t'ks-arab',\n\t'ku-arab',\n\t'lki',\n\t'lrc',\n\t'luz',\n\t'ms-arab',\n\t'mzn',\n\t'nqo',\n\t'pnb',\n\t'ps',\n\t'sd',\n\t'sdh',\n\t'skr',\n\t'skr-arab',\n\t'ug',\n\t'ug-arab',\n\t'ur',\n\t'yi'\n];\n","const\n\tmfUtils = require( '../mobile.startup/util' ),\n\trtlLanguages = require( './rtlLanguages' );\n\n/**\n * @typedef {Object} Language\n * @prop {string} autonym of language e.g. français\n * @prop {string} langname in the user's current language e.g French\n * @prop {string} title of the page in the language e.g. Espagne\n * @prop {string} dir (rtl or ltr)\n * @prop {string} url of the page\n *\n * @typedef {Object} SuggestedLanguage\n * @prop {string} autonym of language e.g. français\n * @prop {string} langname in the user's current language e.g French\n * @prop {string} title of the page in the language e.g. Espagne\n * @prop {string} dir (rtl or ltr)\n * @prop {string} url of the page\n * @prop {number} frequency of times the language has been used by the given user\n *\n * @typedef {Object} StructuredLanguages\n * @prop {Language[]} all languages that are available\n * @prop {SuggestedLanguage[]} suggested languages based on users browsing history\n * @ignore\n */\n\n/**\n * Return the device language if it's in the list of article languages.\n * If the language is a variant of a general language, and if the article\n * is not available in that language, then return the general language\n * if article is available in it. For example, if the device language is\n * 'en-gb', and the article is only available in 'en', then return 'en'.\n *\n * @ignore\n * @param {Object[]} languages list of language objects as returned by the API\n * @param {string|undefined} deviceLanguage the device's primary language\n * @return {string|undefined} Return undefined if the article is not available in\n * the (general or variant) device language\n */\nfunction getDeviceLanguageOrParent( languages, deviceLanguage ) {\n\tlet parentLanguage;\n\n\tconst\n\t\thasOwn = Object.prototype.hasOwnProperty,\n\t\tdeviceLanguagesWithVariants = {};\n\n\tif ( !deviceLanguage ) {\n\t\treturn;\n\t}\n\n\t// Are we dealing with a variant?\n\tconst index = deviceLanguage.indexOf( '-' );\n\tif ( index !== -1 ) {\n\t\tparentLanguage = deviceLanguage.slice( 0, index );\n\t}\n\n\tlanguages.forEach( function ( language ) {\n\t\tif ( language.lang === parentLanguage || language.lang === deviceLanguage ) {\n\t\t\tdeviceLanguagesWithVariants[ language.lang ] = true;\n\t\t}\n\t} );\n\n\tif ( hasOwn.call( deviceLanguagesWithVariants, deviceLanguage ) ) {\n\t\t// the device language is one of the available languages\n\t\treturn deviceLanguage;\n\t} else if ( hasOwn.call( deviceLanguagesWithVariants, parentLanguage ) ) {\n\t\t// no device language, but the parent language is one of the available languages\n\t\treturn parentLanguage;\n\t}\n}\n\n/**\n * Utility function for the structured language overlay\n *\n * @class util\n * @singleton\n * @private\n */\nmodule.exports = {\n\t/**\n\t * Determine whether a language is LTR or RTL\n\t * This works around T74153 and T189036\n\t * and the fact that adding dir attribute to HTML in core\n\t * at time of writing is memory-intensive\n\t * (I7cd8a3117f49467e3ff26f35371459a667c71470)\n\t *\n\t * @memberof util\n\t * @instance\n\t * @param {Object} language with 'lang' key.\n\t * @return {Object} language with 'lang' key and new 'dir' key.\n\t */\n\tgetDir: function ( language ) {\n\t\tconst dir = rtlLanguages.indexOf( language.lang ) > -1 ? 'rtl' : 'ltr';\n\t\treturn mfUtils.extend( {}, language, { dir } );\n\t},\n\n\t/**\n\t * Return two sets of languages: suggested and all (everything else)\n\t *\n\t * Suggested languages are the ones that the user has used before. This also\n\t * includes the user device's primary language. Suggested languages are ordered\n\t * by frequency in descending order. The device's language is always at the top.\n\t * This group also includes the variants.\n\t *\n\t * All languages are the languages that are not suggested.\n\t * Languages in this list are ordered in the lexicographical order of\n\t * their language names.\n\t *\n\t * @memberof util\n\t * @ignore\n\t * @instance\n\t * @param {Object[]} languages list of language objects as returned by the API\n\t * @param {Array|boolean} variants language variant objects or false if no variants exist\n\t * @param {Object} frequentlyUsedLanguages list of the frequently used languages\n\t * @param {boolean} showSuggestedLanguages\n\t * @param {string} [deviceLanguage] the device's primary language\n\t * @return {StructuredLanguages}\n\t */\n\tgetStructuredLanguages: function (\n\t\tlanguages,\n\t\tvariants,\n\t\tfrequentlyUsedLanguages,\n\t\tshowSuggestedLanguages,\n\t\tdeviceLanguage\n\t) {\n\t\tconst hasOwn = Object.prototype.hasOwnProperty,\n\t\t\tself = this;\n\n\t\tlet maxFrequency = 0,\n\t\t\tminFrequency = 0,\n\t\t\tsuggestedLanguages = [],\n\t\t\tallLanguages = [];\n\n\t\t// Is the article available in the user's device language?\n\t\tdeviceLanguage = getDeviceLanguageOrParent( languages, deviceLanguage );\n\t\tif ( deviceLanguage ) {\n\t\t\tObject.keys( frequentlyUsedLanguages ).forEach( function ( language ) {\n\t\t\t\tconst frequency = frequentlyUsedLanguages[ language ];\n\t\t\t\tmaxFrequency = maxFrequency < frequency ? frequency : maxFrequency;\n\t\t\t\tminFrequency = minFrequency > frequency ? frequency : minFrequency;\n\t\t\t} );\n\n\t\t\t// Make the device language the most frequently used one so that\n\t\t\t// it appears at the top of the list when sorted by frequency.\n\t\t\tfrequentlyUsedLanguages[ deviceLanguage ] = maxFrequency + 1;\n\t\t}\n\n\t\t/**\n\t\t * @param {Object} language\n\t\t * @return {Object} which has 'dir' key.\n\t\t */\n\t\tfunction addLangDir( language ) {\n\t\t\tif ( language.dir ) {\n\t\t\t\treturn language;\n\t\t\t} else {\n\t\t\t\treturn self.getDir( language );\n\t\t\t}\n\t\t}\n\n\t\t// Separate languages into suggested and all languages.\n\t\tif ( showSuggestedLanguages ) {\n\t\t\tlanguages.map( addLangDir ).forEach( function ( language ) {\n\t\t\t\tif ( hasOwn.call( frequentlyUsedLanguages, language.lang ) ) {\n\t\t\t\t\tlanguage.frequency = frequentlyUsedLanguages[language.lang];\n\t\t\t\t\tsuggestedLanguages.push( language );\n\t\t\t\t} else {\n\t\t\t\t\tallLanguages.push( language );\n\t\t\t\t}\n\t\t\t} );\n\t\t} else {\n\t\t\tallLanguages = languages.map( addLangDir );\n\t\t}\n\n\t\t// Add variants to the suggested languages list and assign the lowest\n\t\t// frequency because the variant hasn't been clicked on yet.\n\t\t// Note that the variants data doesn't contain the article title, thus\n\t\t// we cannot show it for the variants.\n\t\tif ( variants && showSuggestedLanguages ) {\n\t\t\tvariants.map( addLangDir ).forEach( function ( variant ) {\n\t\t\t\tif ( hasOwn.call( frequentlyUsedLanguages, variant.lang ) ) {\n\t\t\t\t\tvariant.frequency = frequentlyUsedLanguages[variant.lang];\n\t\t\t\t} else {\n\t\t\t\t\tvariant.frequency = minFrequency - 1;\n\t\t\t\t}\n\t\t\t\tsuggestedLanguages.push( variant );\n\t\t\t} );\n\t\t}\n\n\t\t// sort suggested languages in descending order by frequency\n\t\tsuggestedLanguages = suggestedLanguages.sort( function ( a, b ) {\n\t\t\treturn b.frequency - a.frequency;\n\t\t} );\n\n\t\t/**\n\t\t * Compare language names lexicographically\n\t\t *\n\t\t * @param {Object} a first language\n\t\t * @param {Object} b second language\n\t\t * @return {number} Comparison value, 1 or -1\n\t\t */\n\t\tfunction compareLanguagesByLanguageName( a, b ) {\n\t\t\treturn a.autonym.toLocaleLowerCase() < b.autonym.toLocaleLowerCase() ? -1 : 1;\n\t\t}\n\n\t\tallLanguages = allLanguages.sort( compareLanguagesByLanguageName );\n\t\treturn {\n\t\t\tsuggested: suggestedLanguages,\n\t\t\tall: allLanguages\n\t\t};\n\t},\n\n\t/**\n\t * Return a map of frequently used languages on the current device.\n\t *\n\t * @memberof util\n\t * @instance\n\t * @return {Object}\n\t */\n\tgetFrequentlyUsedLanguages: function () {\n\t\tconst languageMap = mw.storage.get( 'langMap' );\n\n\t\treturn languageMap ? JSON.parse( languageMap ) : {};\n\t},\n\n\t/**\n\t * Save the frequently used languages to the user's device\n\t *\n\t * @memberof util\n\t * @instance\n\t * @param {Object} languageMap\n\t */\n\tsaveFrequentlyUsedLanguages: function ( languageMap ) {\n\t\tmw.storage.set( 'langMap', JSON.stringify( languageMap ) );\n\t},\n\n\t/**\n\t * Increment the current language usage by one and save it to the device.\n\t * Cap the result at 100.\n\t *\n\t * @memberof util\n\t * @instance\n\t * @param {string} languageCode\n\t * @param {Object} frequentlyUsedLanguages list of the frequently used languages\n\t */\n\tsaveLanguageUsageCount: function ( languageCode, frequentlyUsedLanguages ) {\n\t\tlet count = frequentlyUsedLanguages[ languageCode ] || 0;\n\n\t\tcount += 1;\n\t\t// cap at 100 as this is enough data to work on\n\t\tfrequentlyUsedLanguages[ languageCode ] = count > 100 ? 100 : count;\n\t\tthis.saveFrequentlyUsedLanguages( frequentlyUsedLanguages );\n\t}\n};\n"],"names":["View","require","util","langUtil","LanguageSearcher","props","languages","getStructuredLanguages","variants","getFrequentlyUsedLanguages","showSuggestedLanguages","deviceLanguage","call","this","extend","className","events","inputPlaceholder","mw","msg","allLanguagesHeader","toLocaleUpperCase","suggestedLanguagesHeader","noResultsFoundHeader","noResultsFoundMessage","allLanguages","all","allLanguagesCount","length","suggestedLanguages","suggested","suggestedLanguagesCount","showSuggestedLanguagesHeader","onOpen","searcher","setTimeout","mfExtend","template","postRender","$siteLinksList","$el","find","$languageItems","$subheaders","$emptyResultsSection","addBanner","bannerHTML","firstMissingLanguage","options","bannerFirstLanguage","render","onSearchBannerClick","val","trigger","onLinkClick","ev","lang","currentTarget","attr","hook","fire","saveLanguageUsageCount","onSearchInput","searchOrigin","undefined","originalEvent","filterLanguages","target","value","toLowerCase","searchQuery","filteredList","forEach","language","langname","autonym","indexOf","push","variant","addClass","concat","escapeRegExp","join","removeClass","get","module","exports","m","define","mfUtils","rtlLanguages","getDir","dir","frequentlyUsedLanguages","hasOwn","Object","prototype","hasOwnProperty","self","maxFrequency","minFrequency","addLangDir","parentLanguage","deviceLanguagesWithVariants","index","slice","getDeviceLanguageOrParent","keys","frequency","map","sort","a","b","toLocaleLowerCase","languageMap","storage","JSON","parse","saveFrequentlyUsedLanguages","set","stringify","languageCode","count"],"sourceRoot":""}
\ No newline at end of file
diff --git a/extensions/MobileFrontend/resources/dist/mobile.mediaViewer.js b/extensions/MobileFrontend/resources/dist/mobile.mediaViewer.js
new file mode 100644
index 000000000..0ea7e39fd
--- /dev/null
+++ b/extensions/MobileFrontend/resources/dist/mobile.mediaViewer.js
@@ -0,0 +1,2 @@
+(self.webpackChunkmfModules=self.webpackChunkmfModules||[]).push([[548],{"./src/mobile.mediaViewer/ImageCarousel.js":(e,t,i)=>{var s=i("./src/mobile.startup/View.js"),a=i("./src/mobile.startup/util.js"),n=i("./src/mobile.startup/mfExtend.js"),r=i("./src/mobile.startup/IconButton.js"),o=i("./src/mobile.startup/icons.js"),l=i("./src/mobile.startup/eventBusSingleton.js"),d=new(i("./src/mobile.startup/Button.js"))({label:mw.msg("mobile-frontend-media-details"),additionalClassNames:"button",progressive:!0}),m=new r({rotation:90,icon:"expand-invert",label:mw.msg("mobile-frontend-media-prev")}),h=new r({rotation:-90,icon:"expand-invert",label:mw.msg("mobile-frontend-media-next")}),u=i("./src/mobile.mediaViewer/LoadErrorMessage.js"),c=i("./src/mobile.mediaViewer/ImageGateway.js"),g=require("mediawiki.router");function p(e){this.gateway=e.gateway||new c({api:e.api}),this.router=e.router||g,this.eventBus=e.eventBus,this.hasLoadError=!1,s.call(this,a.extend({className:"image-carousel",events:{"click .image-wrapper":"onToggleDetails","click .slider-button":"onSlide"}},e))}n(p,s,{template:a.template('\n<button title="{{prevMsg}}" class="prev slider-button"></button>\n<div class="main">\n\t<div class="image-wrapper">\n\t\t<div class="image"></div>\n\t</div>\n\t\x3c!-- cancel button will go here --\x3e\n\t<div class="image-details">\n\t\t\x3c!-- details button will go here --\x3e\n\t\t<p class="truncated-text">{{caption}}</p>\n\t\t<p class="license"><a href="#">{{licenseLinkMsg}}</a></p>\n\t</div>\n</div>\n<button title="{{nextMsg}}" class="next slider-button"></button>\n\t'),defaults:a.extend({},s.prototype.defaults,{licenseLinkMsg:mw.msg("mobile-frontend-media-license-link"),prevMsg:mw.msg("mobile-frontend-media-prev"),nextMsg:mw.msg("mobile-frontend-media-next"),thumbnails:[]}),onSlide:function(e){var t=this.$el.find(e.target).closest(".slider-button").data("thumbnail"),i=t.options.filename;this.router.navigateTo(null,{path:"#/media/"+i,useReplaceState:!0}),this.options.title=t.options.filename;var s=new p(this.options);this.$el.replaceWith(s.$el),this.$el=s.$el},preRender:function(){var e=this;this.options.thumbnails.forEach((function(t,i){t.getFileName()===e.options.title&&(e.options.caption=t.getDescription(),e.galleryOffset=i)}))},_enableArrowImages:function(e){var t,i,s=this.galleryOffset;void 0===this.galleryOffset?(t=e[e.length-1],i=e[0]):(t=e[0===s?e.length-1:s-1],i=e[s===e.length-1?0:s+1]),this.$el.find(".prev").data("thumbnail",t),this.$el.find(".next").data("thumbnail",i)},_disableArrowImages:function(){this.$el.find(".prev, .next").remove()},_handleRetry:function(){this.router.emit("hashchange")},postRender:function(){var e,t=this.$el,i=o.spinner().$el,s=this.options.thumbnails||[],a=this;function n(){a.hasLoadError=!0,i.hide(),t.find(".image img").hide(),0===t.find(".load-fail-msg").length&&new u({retryPath:a.router.getPath()}).on("retry",a._handleRetry.bind(a)).prependTo(t.find(".image"))}function r(){e.addClass("image-loaded")}s.length<2?this._disableArrowImages():this._enableArrowImages(s),this.$details=t.find(".image-details"),t.find(".image").append(i),this.$details.prepend(d.$el),this.gateway.getThumb(a.options.title).then((function(s){var o,l=s.descriptionurl+"#mw-jump-to-license";i.hide(),a.thumbWidth=s.thumbwidth,a.thumbHeight=s.thumbheight,a.imgRatio=s.thumbwidth/s.thumbheight,(e=a.parseHTML("<img>",document)).on("load",r).on("error",n),e.attr("src",s.thumburl).attr("alt",a.options.caption),t.find(".image").append(e),a.$details.addClass("is-visible"),a._positionImage(),t.find(".image-details a").attr("href",l),s.extmetadata&&(s.extmetadata.LicenseShortName&&t.find(".license a").text(s.extmetadata.LicenseShortName.value).attr("href",l),s.extmetadata.Artist&&(o=s.extmetadata.Artist.value.replace(/<.*?>/g,""),t.find(".license").prepend(o+" &bull; "))),a.adjustDetails()}),(function(){n()})),l.on("resize:throttled",this._positionImage.bind(this)),this._positionImage()},onToggleDetails:function(){this.hasLoadError||(this.$el.find(".cancel, .slider-button").toggle(),this.$details.toggle(),this._positionImage())},_positionImage:function(){var e=a.getWindow();this.adjustDetails();var t=this.$details.is(":visible")?this.$details.outerHeight():0,i=e.width(),s=e.height()-t,n=i/s,r=this.$el.find("img");this.imgRatio>n?i<this.thumbWidth&&r.css({width:i,height:"auto"}):s<this.thumbHeight&&r.css({width:"auto",height:s}),this.$el.find(".image-wrapper").css("bottom",t),this.$el.find(".slider-button.prev").append(m.$el),this.$el.find(".slider-button.next").append(h.$el)},adjustDetails:function(){var e=a.getWindow().height();this.$el.find(".image-details").height()>.5*e&&this.$el.find(".image-details").css("max-height",.5*e)}}),e.exports=p},"./src/mobile.mediaViewer/ImageGateway.js":(e,t,i)=>{var s=[320,640,800,1024,1280,1920,2560,2880],a=i("./src/mobile.startup/actionParams.js"),n=i("./src/mobile.startup/util.js");function r(e){for(var t=0;e>s[t]&&t<s.length-1;)++t;return s[t]}function o(e){this._cache={},this.api=e.api}o.prototype.getThumb=function(e){var t=this._cache[e],i=n.getWindow(),s=window.devicePixelRatio&&window.devicePixelRatio>1?window.devicePixelRatio:1;return t||(this._cache[e]=this.api.get(a({prop:"imageinfo",titles:e,iiprop:["url","extmetadata"],iiurlwidth:r(i.width()*s),iiurlheight:r(i.height()*s)})).then((function(e){if(e.query&&e.query.pages&&e.query.pages[0]&&e.query.pages[0].imageinfo)return e.query.pages[0].imageinfo[0];throw new Error("The API failed to return any pages matching the titles.")}))),this._cache[e]},o._findSizeBucket=r,e.exports=o},"./src/mobile.mediaViewer/LoadErrorMessage.js":(e,t,i)=>{var s=i("./src/mobile.startup/util.js"),a=i("./src/mobile.startup/mfExtend.js"),n=i("./src/mobile.startup/icons.js"),r=i("./src/mobile.startup/View.js");function o(e){r.call(this,{events:{"click .load-fail-msg-link a":"onRetry"}},e)}a(o,r,{template:s.template('\n<div class="load-fail-msg">\n <div class="load-fail-msg-text">{{msgToUser}}</div>\n <div class="load-fail-msg-link">\n <a href="#">{{retryTxt}}</a>\n </div>\n</div>\n\t'),isTemplateMode:!0,defaults:s.extend({},o.prototype.defaults,{msgToUser:mw.msg("mobile-frontend-media-load-fail-message"),retryTxt:mw.msg("mobile-frontend-media-load-fail-retry")}),postRender:function(){this.$el.prepend(n.error().$el),this.$el.find(".load-fail-msg-link a").attr("href","#"+this.options.retryPath)},onRetry:function(){return this.emit("retry"),!1}}),e.exports=o},"./src/mobile.mediaViewer/mobile.mediaViewer.js":(e,t,i)=>{var s=i("./src/mobile.startup/moduleLoaderSingleton.js"),a=i("./src/mobile.mediaViewer/ImageCarousel.js");s.define("mobile.mediaViewer",{ImageCarousel:a})}},e=>{e.O(0,[569],(()=>e(e.s="./src/mobile.mediaViewer/mobile.mediaViewer.js")));var t=e.O();(this.mfModules=this.mfModules||{})["mobile.mediaViewer"]=t}]);
+//# sourceMappingURL=mobile.mediaViewer.js.map.json
\ No newline at end of file
diff --git a/extensions/MobileFrontend/resources/dist/mobile.mediaViewer.js.map.json b/extensions/MobileFrontend/resources/dist/mobile.mediaViewer.js.map.json
new file mode 100644
index 000000000..a1728a9cf
--- /dev/null
+++ b/extensions/MobileFrontend/resources/dist/mobile.mediaViewer.js.map.json
@@ -0,0 +1 @@
+{"version":3,"file":"mobile.mediaViewer.js","mappings":"+HAAA,IAAMA,EAAOC,EAAS,gCACrBC,EAAOD,EAAS,gCAChBE,EAAWF,EAAS,oCACpBG,EAAaH,EAAS,sCACtBI,EAAQJ,EAAS,iCACjBK,EAAWL,EAAS,6CAEpBM,EAAgB,IADPN,EAAS,kCACF,CAAY,CAC3BO,MAAOC,GAAGC,IAAK,iCACfC,qBAAsB,SACtBC,aAAa,IAEdC,EAAkB,IAAIT,EAAY,CACjCU,SAAU,GACVC,KAAM,gBACNP,MAAOC,GAAGC,IAAK,gCAEhBM,EAAmB,IAAIZ,EAAY,CAClCU,UAAW,GACXC,KAAM,gBACNP,MAAOC,GAAGC,IAAK,gCAEhBO,EAAmBhB,EAAS,gDAC5BiB,EAAejB,EAAS,4CACxBkB,EAASC,QAAyB,oBAUnC,SAASC,EAAeC,GACvBC,KAAKC,QAAUF,EAAQE,SAAW,IAAIN,EAAc,CACnDO,IAAKH,EAAQG,MAEdF,KAAKJ,OAASG,EAAQH,QAAUA,EAChCI,KAAKjB,SAAWgB,EAAQhB,SACxBiB,KAAKG,cAAe,EAEpB1B,EAAK2B,KACJJ,KACArB,EAAK0B,OACJ,CACCC,UAAW,iBACXC,OAAQ,CACP,uBAAwB,kBAExB,uBAAwB,YAG1BR,GAGH,CAEAnB,EAAUkB,EAAerB,EAAM,CAK9B+B,SAAU7B,EAAK6B,SAAS,oeA2BxBC,SAAU9B,EAAK0B,OAA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jC+B,SAAU7B,EAAK6B,SAAS,oLAQxBoH,gBAAgB,EAWhBnH,SAAU9B,EAAK0B,OAAQ,CAAC,EAAGX,EAAiBgB,UAAUD,SAAU,CAC/DoH,UAAW3I,GAAGC,IAAK,2CACnB2I,SAAU5I,GAAGC,IAAK,2CAQnB+D,WAAY,WACXlD,KAAKkB,IAAI+C,QAASnF,EAAMiJ,QAAQ7G,KAChClB,KAAKkB,IAAIC,KAAM,yBAA0B2D,KAAM,OAAQ,IAAM9E,KAAKD,QAAQyD,UAC3E,EAWAwE,QAAS,WAQR,OAFAhI,KAAKiD,KAAM,UAEJ,CACR,IAGDoD,EAAOC,QAAU5G,C,6DC/EjB,IAAMuI,EAAIvJ,EAAS,iDAClBoB,EAAgBpB,EAAS,6CAG1BuJ,EAAEC,OAAQ,qBAAsB,CAC/BpI,cAAAA,G","sources":["webpack://mfModules/./src/mobile.mediaViewer/ImageCarousel.js","webpack://mfModules/./src/mobile.mediaViewer/ImageGateway.js","webpack://mfModules/./src/mobile.mediaViewer/LoadErrorMessage.js","webpack://mfModules/./src/mobile.mediaViewer/mobile.mediaViewer.js"],"sourcesContent":["const View = require( '../mobile.startup/View' ),\n\tutil = require( '../mobile.startup/util' ),\n\tmfExtend = require( '../mobile.startup/mfExtend' ),\n\tIconButton = require( '../mobile.startup/IconButton' ),\n\ticons = require( '../mobile.startup/icons' ),\n\teventBus = require( '../mobile.startup/eventBusSingleton' ),\n\tButton = require( '../mobile.startup/Button' ),\n\tdetailsButton = new Button( {\n\t\tlabel: mw.msg( 'mobile-frontend-media-details' ),\n\t\tadditionalClassNames: 'button',\n\t\tprogressive: true\n\t} ),\n\tslideLeftButton = new IconButton( {\n\t\trotation: 90,\n\t\ticon: 'expand-invert',\n\t\tlabel: mw.msg( 'mobile-frontend-media-prev' )\n\t} ),\n\tslideRightButton = new IconButton( {\n\t\trotation: -90,\n\t\ticon: 'expand-invert',\n\t\tlabel: mw.msg( 'mobile-frontend-media-next' )\n\t} ),\n\tLoadErrorMessage = require( './LoadErrorMessage' ),\n\tImageGateway = require( './ImageGateway' ),\n\trouter = __non_webpack_require__( 'mediawiki.router' );\n\n/**\n * Displays images in full screen overlay\n *\n * @class ImageCarousel\n * @extends module:mobile.startup/View\n * @param {Object} options Configuration options, see Overlay#defaults\n * @private\n */\nfunction ImageCarousel( options ) {\n\tthis.gateway = options.gateway || new ImageGateway( {\n\t\tapi: options.api\n\t} );\n\tthis.router = options.router || router;\n\tthis.eventBus = options.eventBus;\n\tthis.hasLoadError = false;\n\n\tView.call(\n\t\tthis,\n\t\tutil.extend(\n\t\t\t{\n\t\t\t\tclassName: 'image-carousel',\n\t\t\t\tevents: {\n\t\t\t\t\t'click .image-wrapper': 'onToggleDetails',\n\t\t\t\t\t// Click tracking for table of contents so we can see if people interact with it\n\t\t\t\t\t'click .slider-button': 'onSlide'\n\t\t\t\t}\n\t\t\t},\n\t\t\toptions\n\t\t)\n\t);\n}\n\nmfExtend( ImageCarousel, View, {\n\t/**\n\t * @memberof ImageCarousel\n\t * @instance\n\t */\n\ttemplate: util.template( `\n<button title=\"{{prevMsg}}\" class=\"prev slider-button\"></button>\n<div class=\"main\">\n\t<div class=\"image-wrapper\">\n\t\t<div class=\"image\"></div>\n\t</div>\n\t<!-- cancel button will go here -->\n\t<div class=\"image-details\">\n\t\t<!-- details button will go here -->\n\t\t<p class=\"truncated-text\">{{caption}}</p>\n\t\t<p class=\"license\"><a href=\"#\">{{licenseLinkMsg}}</a></p>\n\t</div>\n</div>\n<button title=\"{{nextMsg}}\" class=\"next slider-button\"></button>\n\t` ),\n\n\t/**\n\t * @memberof ImageCarousel\n\t * @instance\n\t * @mixes Overlay#defaults\n\t * @property {Object} defaults Default options hash.\n\t * @property {mw.Api} defaults.api instance of API to use\n\t * @property {string} defaults.licenseLinkMsg Link to license information in media viewer.\n\t * @property {string} defaults.prevMsg Title for \"prev\" button in media viewer.\n\t * @property {string} defaults.nextMsg Title for \"next\" button in media viewer.\n\t * @property {Thumbnail[]} defaults.thumbnails a list of thumbnails to browse\n\t */\n\tdefaults: util.extend( {}, View.prototype.defaults, {\n\t\tlicenseLinkMsg: mw.msg( 'mobile-frontend-media-license-link' ),\n\t\tprevMsg: mw.msg( 'mobile-frontend-media-prev' ),\n\t\tnextMsg: mw.msg( 'mobile-frontend-media-next' ),\n\t\tthumbnails: []\n\t} ),\n\t/**\n\t * Event handler for slide event\n\t *\n\t * @memberof ImageCarousel\n\t * @instance\n\t * @param {jQuery.Event} ev\n\t */\n\tonSlide: function ( ev ) {\n\t\tconst\n\t\t\tnextThumbnail = this.$el.find( ev.target ).closest( '.slider-button' ).data( 'thumbnail' ),\n\t\t\ttitle = nextThumbnail.options.filename;\n\n\t\tthis.router.navigateTo( null, {\n\t\t\tpath: '#/media/' + title,\n\t\t\tuseReplaceState: true\n\t\t} );\n\t\tthis.options.title = nextThumbnail.options.filename;\n\t\tconst newImageCarousel = new ImageCarousel( this.options );\n\t\tthis.$el.replaceWith( newImageCarousel.$el );\n\t\tthis.$el = newImageCarousel.$el;\n\t},\n\t/**\n\t * @inheritdoc\n\t * @memberof ImageCarousel\n\t * @instance\n\t */\n\tpreRender: function () {\n\t\tconst self = this;\n\t\tthis.options.thumbnails.forEach( function ( thumbnail, i ) {\n\t\t\tif ( thumbnail.getFileName() === self.options.title ) {\n\t\t\t\tself.options.caption = thumbnail.getDescription();\n\t\t\t\tself.galleryOffset = i;\n\t\t\t}\n\t\t} );\n\t},\n\t/**\n\t * Setup the next and previous images to enable the user to arrow through\n\t * all images in the set of images given in thumbs.\n\t *\n\t * @memberof ImageCarousel\n\t * @instance\n\t * @param {Array} thumbs A set of images, which are available\n\t * @private\n\t */\n\t_enableArrowImages: function ( thumbs ) {\n\t\tconst offset = this.galleryOffset;\n\t\tlet lastThumb, nextThumb;\n\n\t\tif ( this.galleryOffset === undefined ) {\n\t\t\t// couldn't find a suitable matching thumbnail so make\n\t\t\t// next slide start at beginning and previous slide be end\n\t\t\tlastThumb = thumbs[thumbs.length - 1];\n\t\t\tnextThumb = thumbs[0];\n\t\t} else {\n\t\t\t// identify last thumbnail\n\t\t\tlastThumb = thumbs[ offset === 0 ? thumbs.length - 1 : offset - 1 ];\n\t\t\tnextThumb = thumbs[ offset === thumbs.length - 1 ? 0 : offset + 1 ];\n\t\t}\n\n\t\tthis.$el.find( '.prev' ).data( 'thumbnail', lastThumb );\n\t\tthis.$el.find( '.next' ).data( 'thumbnail', nextThumb );\n\t},\n\t/**\n\t * Disables the possibility to arrow through all images of the page.\n\t *\n\t * @memberof ImageCarousel\n\t * @instance\n\t * @private\n\t */\n\t_disableArrowImages: function () {\n\t\tthis.$el.find( '.prev, .next' ).remove();\n\t},\n\n\t/**\n\t * Handler for retry event which triggers when user tries to reload overlay\n\t * after a loading error.\n\t *\n\t * @memberof ImageCarousel\n\t * @instance\n\t * @private\n\t */\n\t_handleRetry: function () {\n\t\t// A hacky way to simulate a reload of the overlay\n\t\tthis.router.emit( 'hashchange' );\n\t},\n\n\t/**\n\t * @inheritdoc\n\t * @memberof ImageCarousel\n\t * @instance\n\t */\n\tpostRender: function () {\n\t\tlet\n\t\t\t$img;\n\t\tconst\n\t\t\t$el = this.$el,\n\t\t\t$spinner = icons.spinner().$el,\n\t\t\tthumbs = this.options.thumbnails || [],\n\t\t\tself = this;\n\n\t\t/**\n\t\t * Display media load failure message\n\t\t *\n\t\t * @method\n\t\t * @ignore\n\t\t */\n\t\tfunction showLoadFailMsg() {\n\t\t\tself.hasLoadError = true;\n\n\t\t\t$spinner.hide();\n\t\t\t// hide broken image if present\n\t\t\t$el.find( '.image img' ).hide();\n\n\t\t\t// show error message if not visible already\n\t\t\tif ( $el.find( '.load-fail-msg' ).length === 0 ) {\n\t\t\t\tnew LoadErrorMessage( { retryPath: self.router.getPath() } )\n\t\t\t\t\t.on( 'retry', self._handleRetry.bind( self ) )\n\t\t\t\t\t.prependTo( $el.find( '.image' ) );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Start image load transitions\n\t\t *\n\t\t * @method\n\t\t * @ignore\n\t\t */\n\t\tfunction addImageLoadClass() {\n\t\t\t$img.addClass( 'image-loaded' );\n\t\t}\n\n\t\tif ( thumbs.length < 2 ) {\n\t\t\tthis._disableArrowImages();\n\t\t} else {\n\t\t\tthis._enableArrowImages( thumbs );\n\t\t}\n\n\t\tthis.$details = $el.find( '.image-details' );\n\t\t$el.find( '.image' ).append( $spinner );\n\n\t\tthis.$details.prepend( detailsButton.$el );\n\n\t\tthis.gateway.getThumb( self.options.title ).then( function ( data ) {\n\t\t\tlet author;\n\t\t\tconst url = data.descriptionurl + '#mw-jump-to-license';\n\n\t\t\t$spinner.hide();\n\n\t\t\tself.thumbWidth = data.thumbwidth;\n\t\t\tself.thumbHeight = data.thumbheight;\n\t\t\tself.imgRatio = data.thumbwidth / data.thumbheight;\n\n\t\t\t// We need to explicitly specify document for context param as jQuery 3\n\t\t\t// will create a new document for the element if the context is\n\t\t\t// undefined. If element is appended to active document, event handlers\n\t\t\t// can fire in both the active document and new document which can cause\n\t\t\t// insidious bugs.\n\t\t\t// (https://api.jquery.com/jquery.parsehtml/#entry-longdesc)\n\t\t\t$img = self.parseHTML( '<img>', document );\n\n\t\t\t// Remove the loader when the image is loaded or display load fail\n\t\t\t// message on failure\n\t\t\t//\n\t\t\t// Error event handler must be attached before error occurs\n\t\t\t// (https://api.jquery.com/error/#entry-longdesc)\n\t\t\t//\n\t\t\t// For the load event, it is more unclear what happens cross-browser when\n\t\t\t// the image is loaded from cache. It seems that a .complete check is\n\t\t\t// needed if attaching the load event after setting the src.\n\t\t\t// (http://stackoverflow.com/questions/910727/jquery-event-for-images-loaded#comment10616132_1110094)\n\t\t\t//\n\t\t\t// However, perhaps .complete check is not needed if attaching load\n\t\t\t// event prior to setting the image src\n\t\t\t// (https://stackoverflow.com/questions/12354865/image-onload-event-and-browser-cache#answer-12355031)\n\t\t\t$img.on( 'load', addImageLoadClass ).on( 'error', showLoadFailMsg );\n\t\t\t$img.attr( 'src', data.thumburl ).attr( 'alt', self.options.caption );\n\t\t\t$el.find( '.image' ).append( $img );\n\n\t\t\tself.$details.addClass( 'is-visible' );\n\t\t\tself._positionImage();\n\t\t\t$el.find( '.image-details a' ).attr( 'href', url );\n\t\t\tif ( data.extmetadata ) {\n\t\t\t\t// Add license information\n\t\t\t\tif ( data.extmetadata.LicenseShortName ) {\n\t\t\t\t\t$el.find( '.license a' )\n\t\t\t\t\t\t.text( data.extmetadata.LicenseShortName.value )\n\t\t\t\t\t\t.attr( 'href', url );\n\t\t\t\t}\n\t\t\t\t// Add author information\n\t\t\t\tif ( data.extmetadata.Artist ) {\n\t\t\t\t\t// Strip any tags\n\t\t\t\t\tauthor = data.extmetadata.Artist.value.replace( /<.*?>/g, '' );\n\t\t\t\t\t$el.find( '.license' ).prepend( author + ' &bull; ' );\n\t\t\t\t}\n\t\t\t}\n\t\t\tself.adjustDetails();\n\t\t}, function () {\n\t\t\t// retrieving image location failed so show load fail msg\n\t\t\tshowLoadFailMsg();\n\t\t} );\n\n\t\teventBus.on( 'resize:throttled', this._positionImage.bind( this ) );\n\t\tthis._positionImage();\n\t},\n\n\t/**\n\t * Event handler that toggles the details bar.\n\t *\n\t * @memberof ImageCarousel\n\t * @instance\n\t */\n\tonToggleDetails: function () {\n\t\tif ( !this.hasLoadError ) {\n\t\t\tthis.$el.find( '.cancel, .slider-button' ).toggle();\n\t\t\tthis.$details.toggle();\n\t\t\tthis._positionImage();\n\t\t}\n\t},\n\t/**\n\t * Fit the image into the window if its dimensions are bigger than the window dimensions.\n\t * Compare window width to height ratio to that of image width to height when setting\n\t * image width or height.\n\t *\n\t * @memberof ImageCarousel\n\t * @instance\n\t * @private\n\t */\n\t_positionImage: function () {\n\t\tconst $window = util.getWindow();\n\n\t\tthis.adjustDetails();\n\t\t// with a hidden details box we have a little bit more space, we just need to use it\n\t\t// TODO: Get visibility from the model\n\t\t// eslint-disable-next-line no-jquery/no-sizzle\n\t\tconst detailsHeight = !this.$details.is( ':visible' ) ? 0 : this.$details.outerHeight();\n\t\tconst windowWidth = $window.width();\n\t\tconst windowHeight = $window.height() - detailsHeight;\n\t\tconst windowRatio = windowWidth / windowHeight;\n\t\tconst $img = this.$el.find( 'img' );\n\n\t\tif ( this.imgRatio > windowRatio ) {\n\t\t\tif ( windowWidth < this.thumbWidth ) {\n\t\t\t\t$img.css( {\n\t\t\t\t\twidth: windowWidth,\n\t\t\t\t\theight: 'auto'\n\t\t\t\t} );\n\t\t\t}\n\t\t} else {\n\t\t\tif ( windowHeight < this.thumbHeight ) {\n\t\t\t\t$img.css( {\n\t\t\t\t\twidth: 'auto',\n\t\t\t\t\theight: windowHeight\n\t\t\t\t} );\n\t\t\t}\n\t\t}\n\n\t\tthis.$el.find( '.image-wrapper' ).css( 'bottom', detailsHeight );\n\t\tthis.$el.find( '.slider-button.prev' ).append( slideLeftButton.$el );\n\t\tthis.$el.find( '.slider-button.next' ).append( slideRightButton.$el );\n\t},\n\n\t/**\n\t * Function to adjust the height of details section to not more than 50% of window height.\n\t *\n\t * @memberof ImageCarousel\n\t * @instance\n\t */\n\tadjustDetails: function () {\n\t\tconst windowHeight = util.getWindow().height();\n\t\tif ( this.$el.find( '.image-details' ).height() > windowHeight * 0.50 ) {\n\t\t\tthis.$el.find( '.image-details' ).css( 'max-height', windowHeight * 0.50 );\n\t\t}\n\t}\n} );\n\nmodule.exports = ImageCarousel;\n","const sizeBuckets = [ 320, 640, 800, 1024, 1280, 1920, 2560, 2880 ],\n\tactionParams = require( './../mobile.startup/actionParams' ),\n\tutil = require( './../mobile.startup/util' );\n\n/**\n * Gets the first size larger than or equal to the provided size\n *\n * @memberof ImageGateway\n * @param {number} size\n * @return {number}\n */\nfunction findSizeBucket( size ) {\n\tlet i = 0;\n\twhile ( size > sizeBuckets[i] && i < sizeBuckets.length - 1 ) {\n\t\t++i;\n\t}\n\treturn sizeBuckets[i];\n}\n\n/**\n * API for retrieving image thumbnails for a given page\n *\n * @param {Object} options Configuration options\n * @param {mw.Api} options.api\n * @private\n */\nfunction ImageGateway( options ) {\n\tthis._cache = {};\n\tthis.api = options.api;\n}\n/**\n * Get thumbnail via the API and cache it. Return the result from the cache if exists.\n *\n * @param {string} title Url of image\n * @return {jQuery.Deferred} with the image info\n */\nImageGateway.prototype.getThumb = function ( title ) {\n\tconst cachedThumb = this._cache[title],\n\t\t$window = util.getWindow(),\n\t\timageSizeMultiplier = ( window.devicePixelRatio && window.devicePixelRatio > 1 ) ?\n\t\t\twindow.devicePixelRatio : 1;\n\n\tif ( !cachedThumb ) {\n\t\tthis._cache[title] = this.api.get( actionParams( {\n\t\t\tprop: 'imageinfo',\n\t\t\ttitles: title,\n\t\t\tiiprop: [ 'url', 'extmetadata' ],\n\t\t\t// request an image devicePixelRatio times bigger than the reported screen size\n\t\t\t// for retina displays and zooming\n\t\t\tiiurlwidth: findSizeBucket( $window.width() * imageSizeMultiplier ),\n\t\t\tiiurlheight: findSizeBucket( $window.height() * imageSizeMultiplier )\n\t\t} ) ).then( function ( resp ) {\n\t\t\t// imageinfo is undefined for missing pages.\n\t\t\tif ( resp.query && resp.query.pages &&\n\t\t\t\tresp.query.pages[0] && resp.query.pages[0].imageinfo ) {\n\t\t\t\treturn resp.query.pages[0].imageinfo[0];\n\t\t\t}\n\t\t\tthrow new Error( 'The API failed to return any pages matching the titles.' );\n\t\t} );\n\t}\n\n\treturn this._cache[title];\n};\n\nImageGateway._findSizeBucket = findSizeBucket;\nmodule.exports = ImageGateway;\n","const util = require( './../mobile.startup/util' ),\n\tmfExtend = require( './../mobile.startup/mfExtend' ),\n\ticons = require( './../mobile.startup/icons' ),\n\tView = require( './../mobile.startup/View' );\n\n/**\n * Shows the user a load failure message\n *\n * @extends module:mobile.startup/View\n * @fires LoadErrorMessage#retry\n *\n * @param {Object} options Configuration options\n * @param {string} options.retryPath path of URL to try again\n * @private\n */\nfunction LoadErrorMessage( options ) {\n\tView.call(\n\t\tthis,\n\t\t{ events: { 'click .load-fail-msg-link a': 'onRetry' } },\n\t\toptions\n\t);\n}\n\nmfExtend( LoadErrorMessage, View, {\n\ttemplate: util.template( `\n<div class=\"load-fail-msg\">\n <div class=\"load-fail-msg-text\">{{msgToUser}}</div>\n <div class=\"load-fail-msg-link\">\n <a href=\"#\">{{retryTxt}}</a>\n </div>\n</div>\n\t` ),\n\tisTemplateMode: true,\n\n\t/**\n\t\t* @inheritdoc\n\t\t* @cfg {Object} defaults Default options hash.\n\t\t* @cfg {string} defaults.icon HTML of the alert icon\n\t\t* @cfg {string} defaults.msgToUser Message shown when media load fails\n\t\t* @cfg {string} defaults.retryTxt Text of retry link\n\t\t* @memberof LoadErrorMessage\n\t\t* @instance\n\t\t*/\n\tdefaults: util.extend( {}, LoadErrorMessage.prototype.defaults, {\n\t\tmsgToUser: mw.msg( 'mobile-frontend-media-load-fail-message' ),\n\t\tretryTxt: mw.msg( 'mobile-frontend-media-load-fail-retry' )\n\t} ),\n\n\t/**\n\t * @inheritdoc\n\t * @memberof LoadErrorMessage\n\t * @instance\n\t */\n\tpostRender: function () {\n\t\tthis.$el.prepend( icons.error().$el );\n\t\tthis.$el.find( '.load-fail-msg-link a' ).attr( 'href', '#' + this.options.retryPath );\n\t},\n\n\t/**\n\t * Event handler for retry event\n\t *\n\t * @param {jQuery.Event} ev\n\t * @return {boolean} Returns false to prevent default behavior for links and\n\t * stop the event from propagating\n\t * @memberof LoadErrorMessage\n\t * @instance\n\t */\n\tonRetry: function () {\n\t\t/**\n\t\t * Triggered when retry button is clicked.\n\t\t *\n\t\t * @event LoadErrorMessage#retry\n\t\t */\n\t\tthis.emit( 'retry' );\n\n\t\treturn false;\n\t}\n} );\n\nmodule.exports = LoadErrorMessage;\n","const m = require( '../mobile.startup/moduleLoaderSingleton' ),\n\tImageCarousel = require( './ImageCarousel' );\n\n// Needed for lazy loading ImageCarousel\nm.define( 'mobile.mediaViewer', {\n\tImageCarousel\n} );\n"],"names":["View","require","util","mfExtend","IconButton","icons","eventBus","detailsButton","label","mw","msg","additionalClassNames","progressive","slideLeftButton","rotation","icon","slideRightButton","LoadErrorMessage","ImageGateway","router","__non_webpack_require__","ImageCarousel","options","this","gateway","api","hasLoadError","call","extend","className","events","template","defaults","prototype","licenseLinkMsg","prevMsg","nextMsg","thumbnails","onSlide","ev","nextThumbnail","$el","find","target","closest","data","title","filename","navigateTo","path","useReplaceState","newImageCarousel","replaceWith","preRender","self","forEach","thumbnail","i","getFileName","caption","getDescription","galleryOffset","_enableArrowImages","thumbs","lastThumb","nextThumb","offset","undefined","length","_disableArrowImages","remove","_handleRetry","emit","postRender","$img","$spinner","spinner","showLoadFailMsg","hide","retryPath","getPath","on","bind","prependTo","addImageLoadClass","addClass","$details","append","prepend","getThumb","then","author","url","descriptionurl","thumbWidth","thumbwidth","thumbHeight","thumbheight","imgRatio","parseHTML","document","attr","thumburl","_positionImage","extmetadata","LicenseShortName","text","value","Artist","replace","adjustDetails","onToggleDetails","toggle","$window","getWindow","detailsHeight","is","outerHeight","windowWidth","width","windowHeight","height","windowRatio","css","module","exports","sizeBuckets","actionParams","findSizeBucket","size","_cache","cachedThumb","imageSizeMultiplier","window","devicePixelRatio","get","prop","titles","iiprop","iiurlwidth","iiurlheight","resp","query","pages","imageinfo","Error","_findSizeBucket","isTemplateMode","msgToUser","retryTxt","error","onRetry","m","define"],"sourceRoot":""}
\ No newline at end of file
diff --git a/extensions/MobileFrontend/resources/dist/mobile.special.mobileoptions.scripts.js b/extensions/MobileFrontend/resources/dist/mobile.special.mobileoptions.scripts.js
new file mode 100644
index 000000000..0a5562f7c
--- /dev/null
+++ b/extensions/MobileFrontend/resources/dist/mobile.special.mobileoptions.scripts.js
@@ -0,0 +1,2 @@
+(self.webpackChunkmfModules=self.webpackChunkmfModules||[]).push([[898],{"./node_modules/@wikimedia/mediawiki.skins.clientpreferences/clientPreferences.js":e=>{function t(e){return document.documentElement.classList.contains(e+"-clientpref--excluded")}function n(e,t,n,i){const c=n[e],s=c.callback||(()=>{});mw.user.isNamed()?(n[e].options.forEach((t=>{document.documentElement.classList.remove(`${e}-clientpref-${t}`)})),document.documentElement.classList.add(`${e}-clientpref-${t}`),mw.util.debounce((()=>{(i=i||new mw.Api).saveOptions({[c.preferenceKey]:t}).then((()=>{s()}))}),100)()):(mw.user.clientPrefs.set(e,t),s())}const i=(e,t)=>`skin-client-pref-${e}-value-${t}`;function c(e,t,n){const c=document.createElement("input"),s=`skin-client-pref-${t}-group`,o=i(t,n);return c.name=s,c.id=o,c.type=e,"checkbox"===e?c.checked="1"===n:c.value=n,c.setAttribute("data-event-name",o),c}function s(e,t){const n=document.createElement("label");return n.textContent=mw.msg(`${e}-${t}-label`),n.setAttribute("for",i(e,t)),n}const o=e=>mw.message(`${e}-name`);function a(e,i,a,r){const l=o(i);if(l.exists()||"qqx"===mw.config.get("wgUserLanguage")){const d=`skin-client-prefs-${i}`,m=mw.util.addPortlet(d,l.text());if(a[i].betaMessage){const e=function(){const e=document.createElement("span"),t=document.createElement("span");return t.textContent=mw.message("vector-night-mode-beta-tag").text(),e.appendChild(t),e}();m.querySelector(".vector-menu-heading span")||(m.querySelector(".vector-menu-heading").textContent+=" ",m.querySelector(".vector-menu-heading").appendChild(e))}const u=m.querySelector("label"),p=mw.message(`${i}-description`);if(p.exists()){const e=document.createElement("span");e.classList.add("skin-client-pref-description"),e.textContent=p.text(),u&&u.parentNode&&u.appendChild(e)}const f=mw.message(`${i}-exclusion-notice`);if(f.exists()){const e=m.querySelector(".vector-menu-content"),t=document.createElement("span");t.classList.add("skin-client-pref-exclusion-notice"),t.textContent=f.text(),e&&e.appendChild(t)}e.appendChild(m);const g=function(e,i,a){const r=i[e],l=t(e);if(!r)return null;const d=mw.user.clientPrefs.get(e);if("boolean"==typeof d&&!l)return null;const m=function(){const e=document.createElement("div");return e.setAttribute("class",""),e}(),u=document.createElement("form");switch(r.type||"radio"){case"radio":r.options.forEach((o=>{!function(e,i,o,a,r,l){const d=c("radio",i,o);d.classList.add("cdx-radio__input"),a===o&&(d.checked=!0),t(i)&&(d.disabled=!0);const m=document.createElement("span");m.classList.add("cdx-radio__icon");const u=s(i,o);u.classList.add("cdx-radio__label");const p=document.createElement("div");p.classList.add("cdx-radio"),p.appendChild(d),p.appendChild(m),p.appendChild(u),e.appendChild(p),d.addEventListener("change",(()=>{n(i,o,r,l)}))}(u,e,o,String(d),i,a)}));break;case"switch":{const t=document.createElement("label");t.textContent=o(e).text(),function(e,t,i,o,a,r){const l=c("checkbox",t,o);l.classList.add("cdx-toggle-switch__input");const d=document.createElement("span");d.classList.add("cdx-toggle-switch__switch");const m=document.createElement("span");m.classList.add("cdx-toggle-switch__switch__grip"),d.appendChild(m);const u=i||s(t,o);u.classList.add("cdx-toggle-switch__label");const p=document.createElement("span");p.classList.add("cdx-toggle-switch"),p.appendChild(l),p.appendChild(d),p.appendChild(u),l.addEventListener("change",(()=>{n(t,l.checked?"1":"0",a,r)})),e.appendChild(p)}(u,e,t,String(d),i,a);break}default:throw new Error("Unknown client preference! Only switch or radio are supported.")}if(m.appendChild(u),l){const t=function(e){const t=document.createElement("p"),n=mw.message(`${e}-exclusion-notice`);return t.classList.add("exclusion-notice",`${e}-exclusion-notice`),t.textContent=n.text(),t}(e);m.appendChild(t)}return m}(i,a,r);if(g){const e=mw.util.addPortletLink(d,"","");if(e){const t=e.querySelector("a");t&&t.replaceWith(g)}if(a[i].betaMessage&&!t(i)){const e=document.createElement("span");e.id=`${i}-beta-notice`;const t=`[https://${window.location.hostname+mw.util.getUrl(mw.config.get("wgPageName"))} ${mw.config.get("wgTitle")}]`,n=mw.message("vector-night-mode-issue-reporting-preload-title",t).text(),c=mw.msg("vector-night-mode-issue-reporting-notice-url",window.location.host,n),s=mw.message("vector-night-mode-issue-reporting-link-label").text(),o=document.createElement("a");mw.user.isAnon()||(o.setAttribute("href",c),o.setAttribute("target","_blank")),o.textContent=s;const a=function(){const e=document.createElement("span");e.classList.add("vector-icon","vector-icon--heart"),o.textContent=mw.msg("vector-night-mode-issue-reporting-link-notification"),o.classList.add("skin-theme-beta-notice-success"),o.prepend(e),o.removeEventListener("click",a)};o.addEventListener("click",a),e.appendChild(o),g.appendChild(e)}}}}function r(e,t,n){const i=document.querySelector(e);return i?new Promise((e=>{(function(e){const t=Array.from(document.documentElement.classList).filter((e=>e.match(/-clientpref-/))).map((e=>e.split("-clientpref-")[0]));return Object.keys(e).filter((e=>t.indexOf(e)>-1))})(t).forEach((e=>{n=n||new mw.Api,a(i,e,t,n)})),mw.requestIdleCallback((()=>{e(i)}))})):Promise.reject()}e.exports={bind:function(e,t,n,i){let c=!1;const s=document.querySelector(e);s&&(i||(i=new mw.Api),s.checked?(r(t,n,i),c=!0):s.addEventListener("input",(()=>{c||(r(t,n,i),c=!0)})))},toggleDocClassAndSave:n,render:r}},"./src/mobile.special.mobileoptions.scripts.js":(e,t,n)=>{var i,c=n("./node_modules/@wikimedia/mediawiki.skins.clientpreferences/clientPreferences.js"),s=n("./src/mobile.startup/showOnPageReload.js"),o=n("./src/mobile.startup/amcOutreach/amcOutreach.js"),a="mf-expand-sections",r=mw.msg,l="mf-font-size";function d(e){e?s.showOnPageReload(r("mobile-frontend-settings-save")):mw.notify(r("mobile-frontend-settings-save"))}function m(e){return(i=i||new mw.Api).saveOptions(e,{global:"update"})}function u(e,t){var n=document.createElement("div"),i="mf-client-preferences";return n.id=i,e.prepend(n),c.render("#".concat(i),t,{saveOptions:m})}window.QUnit||mw.loader.using("oojs-ui-widgets").then((function(){var e=$("#mobile-options"),t=$("#enable-beta-toggle"),n=$("#enable-amc-toggle"),i=[];t.length&&i.push({$el:t,onToggle:function(){}}),n.length&&i.push({$el:n,onToggle:function(e){!e&&o.loadCampaign().isCampaignActive()&&o.loadCampaign().makeAllActionsIneligible()}}),function(e,t){e.forEach((function(e){var n=e.$el,i=OO.ui.infuse(n),c=i.$element,s=new OO.ui.ToggleSwitchWidget({value:i.isSelected()});s.$element.insertAfter(c),c.hide(),c.on("change",(function(){c.attr("disabled",!0),s.setValue(i.isSelected())})),s.on("change",(function(n){e.onToggle(n),s.setValue=function(){},c.find("input").prop("checked",n),d(!0),setTimeout((function(){t.trigger("submit")}),250)}))}))}(i,e);var c={};mw.config.get("wgMFEnableFontChanger")&&(c[l]={options:["small","regular","large"],preferenceKey:l,callback:d});var s=mw.config.get("skin");function r(e){e.find(".skin-client-pref-description").appendTo(e.find(".cdx-toggle-switch__label")),e.find("> label").remove()}c["skin-theme"]={options:["day","night","os"],preferenceKey:"".concat(s,"-theme")},c[a]={options:["0","1"],type:"switch",preferenceKey:a,callback:d},mw.user.isAnon()||(c["mw-mf-amc"]={options:["0","1"],type:"switch",preferenceKey:"mf_amc_optin",callback:function(){return location.reload()}}),u(e,c).then((function(){$("#amc-field .option-links").appendTo("#skin-client-prefs-mw-mf-amc"),r($("#skin-client-prefs-mf-expand-sections")),r($("#skin-client-prefs-mw-mf-amc")),$("#amc-field").remove()}))})),e.exports={test:{addClientPreferencesToForm:u}}}},e=>{e.O(0,[569],(()=>e(e.s="./src/mobile.special.mobileoptions.scripts.js")));var t=e.O();(this.mfModules=this.mfModules||{})["mobile.special.mobileoptions.scripts"]=t}]);
+//# sourceMappingURL=mobile.special.mobileoptions.scripts.js.map.json
\ No newline at end of file
diff --git a/extensions/MobileFrontend/resources/dist/mobile.special.mobileoptions.scripts.js.map.json b/extensions/MobileFrontend/resources/dist/mobile.special.mobileoptions.scripts.js.map.json
new file mode 100644
index 000000000..11119433c
--- /dev/null
+++ b/extensions/MobileFrontend/resources/dist/mobile.special.mobileoptions.scripts.js.map.json
@@ -0,0 +1 @@
+{"version":3,"file":"mobile.special.mobileoptions.scripts.js","mappings":"gKAoCA,SAASA,EAAmBC,GAC3B,OAAOC,SAASC,gBAAgBC,UAAUC,SAAUJ,EAAc,wBACnE,CAoBA,SAASK,EAAuBL,EAAaM,EAAOC,EAAQC,GAC3D,MAAMC,EAAOF,EAAQP,GACfU,EAAWD,EAAKC,UAAY,MAAW,GACxCC,GAAGC,KAAKC,WAKZN,EAAQP,GAAcc,QAAQC,SAAWC,IACxCf,SAASC,gBAAgBC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/mediawiki.skins.clientpreferences/clientPreferences.js","webpack://mfModules/./src/mobile.special.mobileoptions.scripts.js"],"sourcesContent":["/**\n * @typedef {Object} ClientPreference\n * @property {string[]} options that are valid for this client preference\n * @property {string} preferenceKey for registered users.\n * @property {string} betaMessage whether to show a notice indicating this feature is in beta.\n * @property {string} [type] defaults to radio. Supported: radio, switch\n * @property {Function} [callback] callback executed after a client preference has been modified.\n */\n\n/**\n * @typedef {Object} UserPreferencesApi\n * @property {Function} saveOptions\n */\n/**\n * @typedef {Object} PreferenceOption\n * @property {string} label\n * @property {string} value\n */\n\n/**\n * Get the list of client preferences that are active on the page, including hidden.\n *\n * @return {string[]} of active client preferences\n */\nfunction getClientPreferences() {\n\treturn Array.from( document.documentElement.classList ).filter(\n\t\t( className ) => className.match( /-clientpref-/ )\n\t).map( ( className ) => className.split( '-clientpref-' )[ 0 ] );\n}\n\n/**\n * Check if the feature is excluded from the current page.\n *\n * @param {string} featureName\n * @return {boolean}\n */\nfunction isFeatureExcluded( featureName ) {\n\treturn document.documentElement.classList.contains( featureName + '-clientpref--excluded' );\n}\n\n/**\n * Get the list of client preferences that are active on the page and not hidden.\n *\n * @param {Record<string,ClientPreference>} config\n * @return {string[]} of user facing client preferences\n */\nfunction getVisibleClientPreferences( config ) {\n\tconst active = getClientPreferences();\n\t// Order should be based on key in config.json\n\treturn Object.keys( config ).filter( ( key ) => active.indexOf( key ) > -1 );\n}\n\n/**\n * @param {string} featureName\n * @param {string} value\n * @param {Record<string,ClientPreference>} config\n * @param {UserPreferencesApi} [userPreferences]\n */\nfunction toggleDocClassAndSave( featureName, value, config, userPreferences ) {\n\tconst pref = config[ featureName ];\n\tconst callback = pref.callback || ( () => {} );\n\tif ( mw.user.isNamed() ) {\n\t\t// FIXME: Ideally this would be done in mw.user.clientprefs API.\n\t\t// mw.user.clientPrefs.get is marked as being only stable for anonymous and temporary users.\n\t\t// So instead we have to keep track of all the different possible values and remove them\n\t\t// before adding the new class.\n\t\tconfig[ featureName ].options.forEach( ( possibleValue ) => {\n\t\t\tdocument.documentElement.classList.remove( `${ featureName }-clientpref-${ possibleValue }` );\n\t\t} );\n\t\tdocument.documentElement.classList.add( `${ featureName }-clientpref-${ value }` );\n\t\t// Ideally this should be taken care of via a single core helper function.\n\t\tmw.util.debounce( () => {\n\t\t\tuserPreferences = userPreferences || new mw.Api();\n\t\t\tuserPreferences.saveOptions( { [ pref.preferenceKey ]: value } ).then( () => {\n\t\t\t\tcallback();\n\t\t\t} );\n\t\t}, 100 )();\n\t\t// END FIXME.\n\t} else {\n\t\t// This case is much simpler, the API transparently takes care of classes as well as storage\n\t\tmw.user.clientPrefs.set( featureName, value );\n\t\tcallback();\n\t}\n}\n\n/**\n * @param {string} featureName\n * @param {string} value\n * @return {string}\n */\nconst getInputId = ( featureName, value ) => `skin-client-pref-${ featureName }-value-${ value }`;\n\n/**\n * @param {string} type\n * @param {string} featureName\n * @param {string} value\n * @return {HTMLInputElement}\n */\nfunction makeInputElement( type, featureName, value ) {\n\tconst input = document.createElement( 'input' );\n\tconst name = `skin-client-pref-${ featureName }-group`;\n\tconst id = getInputId( featureName, value );\n\tinput.name = name;\n\tinput.id = id;\n\tinput.type = type;\n\tif ( type === 'checkbox' ) {\n\t\tinput.checked = value === '1';\n\t} else {\n\t\tinput.value = value;\n\t}\n\tinput.setAttribute( 'data-event-name', id );\n\treturn input;\n}\n\n/**\n * @param {string} featureName\n * @param {string} value\n * @return {HTMLLabelElement}\n */\nfunction makeLabelElement( featureName, value ) {\n\tconst label = document.createElement( 'label' );\n\t// eslint-disable-next-line mediawiki/msg-doc\n\tlabel.textContent = mw.msg( `${ featureName }-${ value }-label` );\n\tlabel.setAttribute( 'for', getInputId( featureName, value ) );\n\treturn label;\n}\n\n/**\n * Create an element that informs users that a feature is not functional\n * on a given page. This message is hidden by default and made visible in\n * CSS if a specific exclusion class exists.\n *\n * @param {string} featureName\n * @return {HTMLElement}\n */\nfunction makeExclusionNotice( featureName ) {\n\tconst p = document.createElement( 'p' );\n\t// eslint-disable-next-line mediawiki/msg-doc\n\tconst noticeMessage = mw.message( `${ featureName }-exclusion-notice` );\n\tp.classList.add( 'exclusion-notice', `${ featureName }-exclusion-notice` );\n\tp.textContent = noticeMessage.text();\n\treturn p;\n}\n\n/**\n * @return {HTMLElement}\n */\nfunction makeBetaInfoTag() {\n\tconst infoTag = document.createElement( 'span' );\n\t// custom style to avoid moving heading bottom border.\n\tconst infoTagText = document.createElement( 'span' );\n\tinfoTagText.textContent = mw.message( 'vector-night-mode-beta-tag' ).text();\n\tinfoTag.appendChild( infoTagText );\n\treturn infoTag;\n}\n\n/**\n * @param {Element} parent\n * @param {string} featureName\n * @param {string} value\n * @param {string} currentValue\n * @param {Record<string,ClientPreference>} config\n * @param {UserPreferencesApi} userPreferences\n */\nfunction appendRadioToggle( parent, featureName, value, currentValue, config, userPreferences ) {\n\tconst input = makeInputElement( 'radio', featureName, value );\n\tinput.classList.add( 'cdx-radio__input' );\n\tif ( currentValue === value ) {\n\t\tinput.checked = true;\n\t}\n\n\tif ( isFeatureExcluded( featureName ) ) {\n\t\tinput.disabled = true;\n\t}\n\n\tconst icon = document.createElement( 'span' );\n\ticon.classList.add( 'cdx-radio__icon' );\n\tconst label = makeLabelElement( featureName, value );\n\tlabel.classList.add( 'cdx-radio__label' );\n\tconst container = document.createElement( 'div' );\n\tcontainer.classList.add( 'cdx-radio' );\n\tcontainer.appendChild( input );\n\tcontainer.appendChild( icon );\n\tcontainer.appendChild( label );\n\tparent.appendChild( container );\n\tinput.addEventListener( 'change', () => {\n\t\ttoggleDocClassAndSave( featureName, value, config, userPreferences );\n\t} );\n}\n\n/**\n * @param {Element} form\n * @param {string} featureName\n * @param {HTMLElement} labelElement\n * @param {string} currentValue\n * @param {Record<string,ClientPreference>} config\n * @param {UserPreferencesApi} userPreferences\n */\nfunction appendToggleSwitch( form, featureName, labelElement, currentValue, config, userPreferences ) {\n\tconst input = makeInputElement( 'checkbox', featureName, currentValue );\n\tinput.classList.add( 'cdx-toggle-switch__input' );\n\tconst switcher = document.createElement( 'span' );\n\tswitcher.classList.add( 'cdx-toggle-switch__switch' );\n\tconst grip = document.createElement( 'span' );\n\tgrip.classList.add( 'cdx-toggle-switch__switch__grip' );\n\tswitcher.appendChild( grip );\n\tconst label = labelElement || makeLabelElement( featureName, currentValue );\n\tlabel.classList.add( 'cdx-toggle-switch__label' );\n\tconst toggleSwitch = document.createElement( 'span' );\n\ttoggleSwitch.classList.add( 'cdx-toggle-switch' );\n\ttoggleSwitch.appendChild( input );\n\ttoggleSwitch.appendChild( switcher );\n\ttoggleSwitch.appendChild( label );\n\tinput.addEventListener( 'change', () => {\n\t\ttoggleDocClassAndSave( featureName, input.checked ? '1' : '0', config, userPreferences );\n\t} );\n\tform.appendChild( toggleSwitch );\n}\n\n/**\n * @param {string} className\n * @return {Element}\n */\nfunction createRow( className ) {\n\tconst row = document.createElement( 'div' );\n\trow.setAttribute( 'class', className );\n\treturn row;\n}\n\n/**\n * Get the label for the feature.\n *\n * @param {string} featureName\n * @return {MwMessage}\n */\n// eslint-disable-next-line mediawiki/msg-doc\nconst getFeatureLabelMsg = ( featureName ) => mw.message( `${ featureName }-name` );\n\n/**\n * adds a toggle button\n *\n * @param {string} featureName\n * @param {Record<string,ClientPreference>} config\n * @param {UserPreferencesApi} userPreferences\n * @return {Element|null}\n */\nfunction makeControl( featureName, config, userPreferences ) {\n\tconst pref = config[ featureName ];\n\tconst isExcluded = isFeatureExcluded( featureName );\n\n\tif ( !pref ) {\n\t\treturn null;\n\t}\n\tconst currentValue = mw.user.clientPrefs.get( featureName );\n\t// The client preference was invalid. This shouldn't happen unless a gadget\n\t// or script has modified the documentElement or client preference is excluded.\n\tif ( typeof currentValue === 'boolean' && !isExcluded ) {\n\t\treturn null;\n\t}\n\tconst row = createRow( '' );\n\tconst form = document.createElement( 'form' );\n\tconst type = pref.type || 'radio';\n\tswitch ( type ) {\n\t\tcase 'radio':\n\t\t\tpref.options.forEach( ( value ) => {\n\t\t\t\tappendRadioToggle( form, featureName, value, String( currentValue ), config, userPreferences );\n\t\t\t} );\n\t\t\tbreak;\n\t\tcase 'switch': {\n\t\t\tconst labelElement = document.createElement( 'label' );\n\t\t\tlabelElement.textContent = getFeatureLabelMsg( featureName ).text();\n\t\t\tappendToggleSwitch( form, featureName, labelElement, String( currentValue ), config, userPreferences );\n\t\t\tbreak;\n\t\t} default:\n\t\t\tthrow new Error( 'Unknown client preference! Only switch or radio are supported.' );\n\t}\n\trow.appendChild( form );\n\n\tif ( isExcluded ) {\n\t\tconst exclusionNotice = makeExclusionNotice( featureName );\n\t\trow.appendChild( exclusionNotice );\n\t}\n\treturn row;\n}\n\n/**\n * @param {Element} parent\n * @param {string} featureName\n * @param {Record<string,ClientPreference>} config\n * @param {UserPreferencesApi} userPreferences\n */\nfunction makeClientPreference( parent, featureName, config, userPreferences ) {\n\tconst labelMsg = getFeatureLabelMsg( featureName );\n\t// If the user is not debugging messages and no language exists,\n\t// exit as its a hidden client preference.\n\tif ( !labelMsg.exists() && mw.config.get( 'wgUserLanguage' ) !== 'qqx' ) {\n\t\treturn;\n\t} else {\n\t\tconst id = `skin-client-prefs-${ featureName }`;\n\t\t// @ts-ignore TODO: upstream patch URL\n\t\tconst portlet = mw.util.addPortlet( id, labelMsg.text() );\n\n\t\tif ( config[ featureName ].betaMessage ) {\n\t\t\tconst betaInfoTag = makeBetaInfoTag();\n\t\t\tif ( !portlet.querySelector( '.vector-menu-heading span' ) ) {\n\t\t\t\tportlet.querySelector( '.vector-menu-heading' ).textContent += ' ';\n\t\t\t\tportlet.querySelector( '.vector-menu-heading' ).appendChild( betaInfoTag );\n\t\t\t}\n\t\t}\n\n\t\tconst labelElement = portlet.querySelector( 'label' );\n\n\t\t// Add additional description for mobile\n\t\t// eslint-disable-next-line mediawiki/msg-doc\n\t\tconst descriptionMsg = mw.message( `${ featureName }-description` );\n\t\tif ( descriptionMsg.exists() ) {\n\t\t\tconst desc = document.createElement( 'span' );\n\t\t\tdesc.classList.add( 'skin-client-pref-description' );\n\t\t\tdesc.textContent = descriptionMsg.text();\n\t\t\tif ( labelElement && labelElement.parentNode ) {\n\t\t\t\tlabelElement.appendChild( desc );\n\t\t\t}\n\t\t}\n\n\t\t// Add exclusion notice for desktop\n\t\t// eslint-disable-next-line mediawiki/msg-doc\n\t\tconst exclusionNoticeMsg = mw.message( `${ featureName }-exclusion-notice` );\n\t\tif ( exclusionNoticeMsg.exists() ) {\n\t\t\tconst content = portlet.querySelector( '.vector-menu-content' );\n\t\t\tconst notice = document.createElement( 'span' );\n\t\t\tnotice.classList.add( 'skin-client-pref-exclusion-notice' );\n\t\t\tnotice.textContent = exclusionNoticeMsg.text();\n\t\t\tif ( content ) {\n\t\t\t\tcontent.appendChild( notice );\n\t\t\t}\n\t\t}\n\n\t\tparent.appendChild( portlet );\n\t\tconst row = makeControl( featureName, config, userPreferences );\n\t\tif ( row ) {\n\t\t\tconst tmp = mw.util.addPortletLink( id, '', '' );\n\t\t\t// create a dummy link\n\t\t\tif ( tmp ) {\n\t\t\t\tconst link = tmp.querySelector( 'a' );\n\t\t\t\tif ( link ) {\n\t\t\t\t\tlink.replaceWith( row );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( config[ featureName ].betaMessage && !isFeatureExcluded( featureName ) ) {\n\t\t\t\tconst betaMessageElement = document.createElement( 'span' );\n\t\t\t\tbetaMessageElement.id = `${ featureName }-beta-notice`;\n\t\t\t\tconst pageWikiLink = `[https://${ window.location.hostname + mw.util.getUrl( mw.config.get( 'wgPageName' ) ) } ${ mw.config.get( 'wgTitle' ) }]`;\n\t\t\t\tconst preloadTitle = mw.message( 'vector-night-mode-issue-reporting-preload-title', pageWikiLink ).text();\n\t\t\t\tconst link = mw.msg( 'vector-night-mode-issue-reporting-notice-url', window.location.host, preloadTitle );\n\t\t\t\tconst linkLabel = mw.message( 'vector-night-mode-issue-reporting-link-label' ).text();\n\t\t\t\tconst anchor = document.createElement( 'a' );\n\t\t\t\t// per requirements: only logged in users can report errors.\n\t\t\t\tif ( !mw.user.isAnon() ) {\n\t\t\t\t\tanchor.setAttribute( 'href', link );\n\t\t\t\t\tanchor.setAttribute( 'target', '_blank' );\n\t\t\t\t}\n\t\t\t\tanchor.textContent = linkLabel;\n\t\t\t\tconst showSuccessFeedback = function () {\n\t\t\t\t\tconst icon = document.createElement( 'span' );\n\t\t\t\t\ticon.classList.add( 'vector-icon', 'vector-icon--heart' );\n\t\t\t\t\tanchor.textContent = mw.msg( 'vector-night-mode-issue-reporting-link-notification' );\n\t\t\t\t\tanchor.classList.add( 'skin-theme-beta-notice-success' );\n\t\t\t\t\tanchor.prepend( icon );\n\t\t\t\t\tanchor.removeEventListener( 'click', showSuccessFeedback );\n\t\t\t\t};\n\t\t\t\tanchor.addEventListener( 'click', showSuccessFeedback );\n\t\t\t\tbetaMessageElement.appendChild( anchor );\n\t\t\t\trow.appendChild( betaMessageElement );\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * Fills the client side preference dropdown with controls.\n *\n * @param {string} selector of element to fill with client preferences\n * @param {Record<string,ClientPreference>} config\n * @param {UserPreferencesApi} [userPreferences]\n * @return {Promise<Node>}\n */\nfunction render( selector, config, userPreferences ) {\n\tconst node = document.querySelector( selector );\n\tif ( !node ) {\n\t\treturn Promise.reject();\n\t}\n\treturn new Promise( ( resolve ) => {\n\t\tgetVisibleClientPreferences( config ).forEach( ( pref ) => {\n\t\t\tuserPreferences = userPreferences || new mw.Api();\n\t\t\tmakeClientPreference( node, pref, config, userPreferences );\n\t\t} );\n\t\tmw.requestIdleCallback( () => {\n\t\t\tresolve( node );\n\t\t} );\n\t} );\n}\n\n/**\n * @param {string} clickSelector what to click\n * @param {string} renderSelector where to render\n * @param {Record<string,ClientPreference>} config\n * @param {UserPreferencesApi} [userPreferences]\n */\nfunction bind( clickSelector, renderSelector, config, userPreferences ) {\n\tlet enhanced = false;\n\tconst chk = /** @type {HTMLInputElement} */ (\n\t\tdocument.querySelector( clickSelector )\n\t);\n\tif ( !chk ) {\n\t\treturn;\n\t}\n\tif ( !userPreferences ) {\n\t\tuserPreferences = new mw.Api();\n\t}\n\tif ( chk.checked ) {\n\t\trender( renderSelector, config, userPreferences );\n\t\tenhanced = true;\n\t} else {\n\t\tchk.addEventListener( 'input', () => {\n\t\t\tif ( enhanced ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\trender( renderSelector, config, userPreferences );\n\t\t\tenhanced = true;\n\t\t} );\n\t}\n}\nmodule.exports = {\n\tbind,\n\ttoggleDocClassAndSave,\n\trender\n};\n","/* global $ */\n/* See T354224 for information on the @wikimedia/mediawiki.skins.clientpreferences module. */\nconst clientPrefs = require( '@wikimedia/mediawiki.skins.clientpreferences' ),\n\ttoast = require( './mobile.startup/showOnPageReload' ),\n\tamcOutreach = require( './mobile.startup/amcOutreach/amcOutreach' ),\n\tEXPAND_SECTIONS_KEY = 'mf-expand-sections',\n\tmsg = mw.msg,\n\tUSER_FONT_SIZE_SMALL = 'small',\n\tUSER_FONT_SIZE_REGULAR = 'regular',\n\tUSER_FONT_SIZE_LARGE = 'large',\n\tTHEME = 'skin-theme',\n\t// FIXME: This value should be synced between back-end and front-end code,\n\t// but it's currently hard-coded because ResourceLoader virtual imports\n\t// i.e. require( './config.json') are incompatible with the\n\t// Webpack build. Requires updating to Webpack 5 and common.js magic comments.\n\t// https://webpack.js.org/configuration/module/#moduleparserjavascriptcommonjsmagiccomments\n\t// e.g: require(/* webpackIgnore: true */ './config.json');\n\tFONT_SIZE_KEY = 'mf-font-size';\n\n/**\n * Notifies the user that settings were asynchronously saved.\n *\n * @private\n * @param {boolean} [isPending] if set toast will show after page has been reloaded.\n */\nfunction notify( isPending ) {\n\tif ( isPending ) {\n\t\ttoast.showOnPageReload( msg( 'mobile-frontend-settings-save' ) );\n\t} else {\n\t\tmw.notify( msg( 'mobile-frontend-settings-save' ) );\n\t}\n}\n\nlet api;\n/**\n * @ignore\n * @param {Object<string,string|number>} options\n * @return {JQuery.Promise<Object>}\n */\nfunction saveOptions( options ) {\n\tapi = api || new mw.Api();\n\t// @ts-ignore\n\treturn api.saveOptions( options, {\n\t\tglobal: 'update'\n\t} );\n}\n\n/**\n * Adds a font changer field to the form\n *\n * @private\n * @param {jQuery.Object} $form\n * @param {Record<string,ClientPreference>} clientPreferences\n * @return {Promise<Node>}\n */\nfunction addClientPreferencesToForm( $form, clientPreferences ) {\n\tconst cp = document.createElement( 'div' );\n\tconst id = 'mf-client-preferences';\n\tcp.id = id;\n\t$form.prepend( cp );\n\treturn clientPrefs.render( `#${ id }`, clientPreferences, { saveOptions } );\n}\n\n/**\n * Helper method to infuse checkbox elements with OO magic\n * Additionally it applies all known hacks to make it mobile friendly\n *\n * @private\n * @param {Object[]} toggleObjects an array of toggle objects to infuse\n * @param {jQuery.Object} $form form to submit when there is interaction with toggle\n */\nfunction infuseToggles( toggleObjects, $form ) {\n\ttoggleObjects.forEach( function ( toggleObject ) {\n\t\tconst $toggleElement = toggleObject.$el;\n\t\tconst enableToggle = OO.ui.infuse( $toggleElement );\n\t\tconst $checkbox = enableToggle.$element;\n\t\tconst toggleSwitch = new OO.ui.ToggleSwitchWidget( {\n\t\t\tvalue: enableToggle.isSelected()\n\t\t} );\n\n\t\t// Strangely the ToggleSwitchWidget does not behave as an input so any change\n\t\t// to it is not reflected in the form. (see T182466)\n\t\t// Ideally we'd replaceWith here and not have to hide the original element.\n\t\ttoggleSwitch.$element.insertAfter( $checkbox );\n\t\t// although the checkbox is hidden already, that is done via visibility\n\t\t// as a result, it still takes up space. We don't want it to any more now that the\n\t\t// new toggle switch has been added.\n\t\t$checkbox.hide();\n\n\t\t// listening on checkbox change is required to make the clicking on label working.\n\t\t// Otherwise clicking on label changes the checkbox \"checked\" state\n\t\t// but it's not reflected in the toggle switch\n\t\t$checkbox.on( 'change', function () {\n\t\t\t// disable checkbox as submit is delayed by 0.25s\n\t\t\t$checkbox.attr( 'disabled', true );\n\t\t\ttoggleSwitch.setValue( enableToggle.isSelected() );\n\t\t} );\n\t\ttoggleSwitch.on( 'change', function ( value ) {\n\t\t\t// execute callback\n\t\t\ttoggleObject.onToggle( value );\n\n\t\t\t// ugly hack, we're delaying submit form by 0.25s\n\t\t\t// and we want to disable registering clicks\n\t\t\t// we want to disable the toggleSwitch\n\t\t\t// but we cannot use setDisabled(true) as it makes button gray\n\t\t\ttoggleSwitch.setValue = function () {};\n\n\t\t\t$checkbox.find( 'input' )\n\t\t\t\t.prop( 'checked', value );\n\t\t\tnotify( true );\n\t\t\t// On some Android devices animation gets stuck in the middle as browser\n\t\t\t// starts submitting the form.\n\t\t\t// Let's call submit on the form after toggle button transition is done\n\t\t\t// (0.25s, defined in OOUI)\n\t\t\tsetTimeout( function () {\n\t\t\t\t$form.trigger( 'submit' );\n\t\t\t}, 250 );\n\t\t} );\n\t} );\n}\n\n/**\n * Add features, that depends on localStorage, such as \"expand all sections\" or \"fontchanger\".\n * The checkbox is used for turning on/off expansion of all sections on page load.\n * @private\n */\nfunction initMobileOptions() {\n\tconst $form = $( '#mobile-options' ),\n\t\t$betaToggle = $( '#enable-beta-toggle' ),\n\t\t$amcToggle = $( '#enable-amc-toggle' ),\n\t\ttoggles = [];\n\n\tif ( $betaToggle.length ) {\n\t\ttoggles.push( {\n\t\t\t$el: $betaToggle,\n\t\t\tonToggle: function () {}\n\t\t} );\n\t}\n\tif ( $amcToggle.length ) {\n\t\ttoggles.push( {\n\t\t\t$el: $amcToggle,\n\t\t\tonToggle: function ( value ) {\n\t\t\t\tif ( !value && amcOutreach.loadCampaign().isCampaignActive() ) {\n\t\t\t\t\t// Make all amc outreach actions ineligible so the user doesn't have\n\t\t\t\t\t// to see the outreach drawer again\n\t\t\t\t\tamcOutreach.loadCampaign().makeAllActionsIneligible();\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t}\n\tinfuseToggles( toggles, $form );\n\n\tconst clientPreferences = {};\n\n\tif ( mw.config.get( 'wgMFEnableFontChanger' ) ) {\n\t\tclientPreferences[ FONT_SIZE_KEY ] = {\n\t\t\toptions: [\n\t\t\t\tUSER_FONT_SIZE_SMALL,\n\t\t\t\tUSER_FONT_SIZE_REGULAR,\n\t\t\t\tUSER_FONT_SIZE_LARGE\n\t\t\t],\n\t\t\tpreferenceKey: FONT_SIZE_KEY,\n\t\t\tcallback: notify\n\t\t};\n\t}\n\n\tconst skin = mw.config.get( 'skin' );\n\tclientPreferences[ THEME ] = {\n\t\toptions: [ 'day', 'night', 'os' ],\n\t\tpreferenceKey: `${ skin }-theme`\n\t};\n\n\tclientPreferences[ EXPAND_SECTIONS_KEY ] = {\n\t\toptions: [\n\t\t\t'0',\n\t\t\t'1'\n\t\t],\n\t\ttype: 'switch',\n\t\tpreferenceKey: EXPAND_SECTIONS_KEY,\n\t\tcallback: notify\n\t};\n\n\tif ( !mw.user.isAnon() ) {\n\t\tclientPreferences[ 'mw-mf-amc' ] = {\n\t\t\toptions: [\n\t\t\t\t'0',\n\t\t\t\t'1'\n\t\t\t],\n\t\t\ttype: 'switch',\n\t\t\tpreferenceKey: 'mf_amc_optin',\n\t\t\tcallback: () => location.reload()\n\t\t};\n\t}\n\n\t// Transport existing links to new layout.\n\n\t/**\n\t * Currently toggle switches have duplicate headings and a description that is not\n\t * part of the toggle switch layout.\n\t * This works around this to retain the classic MobileFrontend layout for these\n\t * controls.\n\t * FIXME: This should be upstreamed to @wikimedia/mediawiki.skins.clientpreferences\n\t *\n\t * @param {jQuery} $node\n\t */\n\tfunction modifyToggleSwitch( $node ) {\n\t\t// Move the description from the heading into the label.\n\t\t$node.find( '.skin-client-pref-description' )\n\t\t\t.appendTo( $node.find( '.cdx-toggle-switch__label' ) );\n\t\t// Drop the duplicate label.\n\t\t$node.find( '> label' ).remove();\n\t}\n\n\taddClientPreferencesToForm( $form, clientPreferences ).then( () => {\n\t\t// Make some modifications that are currently not supported by the Vector client preferences\n\t\t// Move the links from the server side preference into the row.\n\t\t$( '#amc-field .option-links' ).appendTo( '#skin-client-prefs-mw-mf-amc' );\n\t\tmodifyToggleSwitch( $( '#skin-client-prefs-mf-expand-sections' ) );\n\t\tmodifyToggleSwitch( $( '#skin-client-prefs-mw-mf-amc' ) );\n\t\t// Remove the server side rendered OOUI field.\n\t\t$( '#amc-field' ).remove();\n\n\t} );\n}\n\nif ( !window.QUnit ) {\n\tmw.loader.using( 'oojs-ui-widgets' ).then( initMobileOptions );\n}\n\nmodule.exports = {\n\ttest: {\n\t\taddClientPreferencesToForm\n\t}\n};\n"],"names":["isFeatureExcluded","featureName","document","documentElement","classList","contains","toggleDocClassAndSave","value","config","userPreferences","pref","callback","mw","user","isNamed","options","forEach","possibleValue","remove","add","util","debounce","Api","saveOptions","preferenceKey","then","clientPrefs","set","getInputId","makeInputElement","type","input","createElement","name","id","checked","setAttribute","makeLabelElement","label","textContent","msg","getFeatureLabelMsg","message","makeClientPreference","parent","labelMsg","exists","get","portlet","addPortlet","text","betaMessage","betaInfoTag","infoTag","infoTagText","appendChild","makeBetaInfoTag","querySelector","labelElement","descriptionMsg","desc","parentNode","exclusionNoticeMsg","content","notice","row","isExcluded","currentValue","createRow","form","disabled","icon","container","addEventListener","appendRadioToggle","String","switcher","grip","toggleSwitch","appendToggleSwitch","Error","exclusionNotice","p","noticeMessage","makeExclusionNotice","makeControl","tmp","addPortletLink","link","replaceWith","betaMessageElement","pageWikiLink","window","location","hostname","getUrl","preloadTitle","host","linkLabel","anchor","isAnon","showSuccessFeedback","prepend","removeEventListener","render","selector","node","Promise","resolve","active","Array","from","filter","className","match","map","split","Object","keys","key","indexOf","getVisibleClientPreferences","requestIdleCallback","reject","module","exports","bind","clickSelector","renderSelector","enhanced","chk","api","require","toast","amcOutreach","EXPAND_SECTIONS_KEY","FONT_SIZE_KEY","notify","isPending","showOnPageReload","global","addClientPreferencesToForm","$form","clientPreferences","cp","concat","QUnit","loader","using","$","$betaToggle","$amcToggle","toggles","length","push","$el","onToggle","loadCampaign","isCampaignActive","makeAllActionsIneligible","toggleObjects","toggleObject","$toggleElement","enableToggle","OO","ui","infuse","$checkbox","$element","ToggleSwitchWidget","isSelected","insertAfter","hide","on","attr","setValue","find","prop","setTimeout","trigger","infuseToggles","skin","modifyToggleSwitch","$node","appendTo","reload","test"],"sourceRoot":""}
\ No newline at end of file
diff --git a/extensions/MobileFrontend/resources/dist/mobile.special.userlogin.scripts.js b/extensions/MobileFrontend/resources/dist/mobile.special.userlogin.scripts.js
new file mode 100644
index 000000000..f05eb8267
--- /dev/null
+++ b/extensions/MobileFrontend/resources/dist/mobile.special.userlogin.scripts.js
@@ -0,0 +1,2 @@
+(self.webpackChunkmfModules=self.webpackChunkmfModules||[]).push([[85],{"./src/mobile.special.userlogin.scripts.js":()=>{$((function(){$("#wpRemember").prop("checked",!0)}))}},s=>{var e=s(s.s="./src/mobile.special.userlogin.scripts.js");(this.mfModules=this.mfModules||{})["mobile.special.userlogin.scripts"]=e}]);
+//# sourceMappingURL=mobile.special.userlogin.scripts.js.map.json
\ No newline at end of file
diff --git a/extensions/MobileFrontend/resources/dist/mobile.special.userlogin.scripts.js.map.json b/extensions/MobileFrontend/resources/dist/mobile.special.userlogin.scripts.js.map.json
new file mode 100644
index 000000000..8ce462f1b
--- /dev/null
+++ b/extensions/MobileFrontend/resources/dist/mobile.special.userlogin.scripts.js.map.json
@@ -0,0 +1 @@
+{"version":3,"file":"mobile.special.userlogin.scripts.js","mappings":"yHACAA,GAAG,WAGFA,EAAG,eAAgBC,KAAM,WAAW,EACrC,G","sources":["webpack://mfModules/./src/mobile.special.userlogin.scripts.js"],"sourcesContent":["/* global $ */\n$( function () {\n\t// Most people on mobile devices are on a personal device so this property should be assumed.\n\t// To be consistent across platforms do same on desktop\n\t$( '#wpRemember' ).prop( 'checked', true );\n} );\n"],"names":["$","prop"],"sourceRoot":""}
\ No newline at end of file
diff --git a/extensions/MobileFrontend/resources/dist/mobile.special.watchlist.scripts.js b/extensions/MobileFrontend/resources/dist/mobile.special.watchlist.scripts.js
new file mode 100644
index 000000000..324bd1e00
--- /dev/null
+++ b/extensions/MobileFrontend/resources/dist/mobile.special.watchlist.scripts.js
@@ -0,0 +1,2 @@
+(self.webpackChunkmfModules=self.webpackChunkmfModules||[]).push([[601],{"./src/mobile.special.watchlist.scripts/ScrollEndEventEmitter.js":(t,s,e)=>{var i=e("./src/mobile.startup/util.js"),l=e("./src/mobile.startup/mfExtend.js");function r(t,s){this.threshold=s||100,this.eventBus=t,this.enable(),OO.EventEmitter.call(this)}OO.mixinClass(r,OO.EventEmitter),r.EVENT_SCROLL_END="ScrollEndEventEmitter-scrollEnd",l(r,{_bindScroll:function(){this._scrollHandler||(this._scrollHandler=this._onScroll.bind(this),this.eventBus.on("scroll:throttled",this._scrollHandler))},_unbindScroll:function(){this._scrollHandler&&(this.eventBus.off("scroll:throttled",this._scrollHandler),this._scrollHandler=null)},_onScroll:function(){this.$el&&this.enabled&&this.scrollNearEnd()&&(this.disable(),this.emit(r.EVENT_SCROLL_END))},scrollNearEnd:function(){if(!this.$el||!this.$el.offset())return!1;var t=i.getWindow(),s=t.scrollTop()+t.height(),e=this.$el.offset().top+this.$el.outerHeight();return s+this.threshold>e},enable:function(){this.enabled=!0,this._bindScroll()},disable:function(){this.enabled=!1,this._unbindScroll()},setElement:function(t){this.$el=t}}),t.exports=r},"./src/mobile.special.watchlist.scripts/WatchList.js":(t,s,e)=>{var i=e("./src/mobile.startup/mfExtend.js"),l=e("./src/mobile.startup/PageList.js"),r=e("./src/mobile.startup/watchstar/WatchstarPageList.js"),n=e("./src/mobile.special.watchlist.scripts/ScrollEndEventEmitter.js"),a=e("./src/mobile.startup/util.js"),c=e("./src/mobile.special.watchlist.scripts/WatchListGateway.js");function o(t){var s,e=a.extend({},{isBorderBox:!1},t);this.scrollEndEventEmitter=new n(e.eventBus),this.scrollEndEventEmitter.on(n.EVENT_SCROLL_END,this._loadPages.bind(this)),e.el&&(s=this.getLastTitle(e.el)),this.gateway=new c(e.api,s),r.call(this,e)}i(o,r,{preRender:function(){this.scrollEndEventEmitter.disable(),this.scrollEndEventEmitter.setElement(this.$el)},postRender:function(){l.prototype.postRender.apply(this);var t=this.queryUnitializedItems(),s=Object.keys(this.parsePagesFromItems(t)).reduce((function(t,s){return t[s]=!0,t}),{});this.renderItems(t,s),this.scrollEndEventEmitter.enable()},_loadPages:function(){this.gateway.loadWatchlist().then(function(t){t.forEach(function(t){this.appendPage(t)}.bind(this)),this.render()}.bind(this))},appendPage:function(t){var s=a.extend({},t,{wikidataDescription:void 0});this.$el.append(this.templatePartials.item.render(s))},getLastTitle:function(t){return t.find("li").last().attr("title")}}),t.exports=o},"./src/mobile.special.watchlist.scripts/WatchListGateway.js":(t,s,e)=>{var i=e("./src/mobile.startup/page/pageJSONParser.js"),l=e("./src/mobile.startup/util.js"),r=e("./src/mobile.startup/extendSearchParams.js");function n(t,s){this.api=t,this.limit=50,s?(this.continueParams={continue:"gwrcontinue||",gwrcontinue:"0|"+s.replace(/ /g,"_")},this.shouldSkipFirstTitle=!0):(this.continueParams={continue:""},this.shouldSkipFirstTitle=!1),this.canContinue=!0}n.prototype={loadWatchlist:function(){var t=this,s=r("watchlist",{prop:["info","revisions"],rvprop:"timestamp|user",generator:"watchlistraw",gwrnamespace:"0",gwrlimit:this.limit},this.continueParams);return!1===this.canContinue?l.Deferred().resolve([]):this.api.get(s).then((function(s){return void 0!==s.continue?t.continueParams=s.continue:t.canContinue=!1,t.parseData(s)}))},parseData:function(t){var s;return t.query&&t.query.pages?((s=t.query.pages).sort((function(t,s){return t.title===s.title?0:t.title<s.title?-1:1})),this.shouldSkipFirstTitle&&(s=s.slice(1),this.shouldSkipFirstTitle=!1),s.map(i.parse)):[]}},t.exports=n},"./src/mobile.special.watchlist.scripts/mobile.special.watchlist.scripts.js":(t,s,e)=>{var i=e("./src/mobile.special.watchlist.scripts/WatchList.js"),l=e("./src/mobile.startup/eventBusSingleton.js");$((function(){var t;t=$("ul.mw-mf-watchlist-page-list"),0===$(".mw-mf-watchlist-selector").length&&new i({api:new mw.Api,el:t,funnel:"watchlist",skipTemplateRender:!0,eventBus:l}),t.find(".mw-mf-watchlist-more").remove()}))}},t=>{t.O(0,[569],(()=>t(t.s="./src/mobile.special.watchlist.scripts/mobile.special.watchlist.scripts.js")));var s=t.O();(this.mfModules=this.mfModules||{})["mobile.special.watchlist.scripts"]=s}]);
+//# sourceMappingURL=mobile.special.watchlist.scripts.js.map.json
\ No newline at end of file
diff --git a/extensions/MobileFrontend/resources/dist/mobile.special.watchlist.scripts.js.map.json b/extensions/MobileFrontend/resources/dist/mobile.special.watchlist.scripts.js.map.json
new file mode 100644
index 000000000..10c2ff38d
--- /dev/null
+++ b/extensions/MobileFrontend/resources/dist/mobile.special.watchlist.scripts.js.map.json
@@ -0,0 +1 @@
+{"version":3,"file":"mobile.special.watchlist.scripts.js","mappings":"qJAAA,IAAMA,EAAOC,EAAS,gCACrBC,EAAWD,EAAS,oCA8DrB,SAASE,EAAuBC,EAAUC,GACzCC,KAAKD,UAAYA,GAAa,IAC9BC,KAAKF,SAAWA,EAChBE,KAAKC,SACLC,GAAGC,aAAaC,KAAMJ,KACvB,CACAE,GAAGG,WAAYR,EAAuBK,GAAGC,cAOzCN,EAAsBS,iBAAmB,kCAEzCV,EAAUC,EAAuB,CAQhCU,YAAW,WACJP,KAAKQ,iBACVR,KAAKQ,eAAiBR,KAAKS,UAAUC,KAAMV,MAC3CA,KAAKF,SAASa,GAAI,mBAAoBX,KAAKQ,gBAE7C,EAQAI,cAAa,WACPZ,KAAKQ,iBACTR,KAAKF,SAASe,IAAK,mBAAoBb,KAAKQ,gBAC5CR,KAAKQ,eAAiB,KAExB,EAQAC,UAAS,WACHT,KAAKc,KAAOd,KAAKe,SAAWf,KAAKgB,kBAGrChB,KAAKiB,UACLjB,KAAKkB,KAAMrB,EAAsBS,kBAEnC,EASAU,cAAa,WACZ,IAAMhB,KAAKc,MAAQd,KAAKc,IAAIK,SAC3B,OAAO,EAER,IAAMC,EAAU1B,EAAK2B,YACpBC,EAAeF,EAAQG,YAAcH,EAAQI,SAC7CC,EAAczB,KAAKc,IAA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AAUF,EAAKE,MAAMlC,QAIhCA,EAAQgC,EAAKE,MAAMlC,OAIbmC,MAAM,SAAWC,EAAIC,GAC1B,OAAOD,EAAGxC,QAAUyC,EAAGzC,MAAQ,EAAMwC,EAAGxC,MAAQyC,EAAGzC,OAAS,EAAI,CACjE,IAIK1D,KAAKmF,uBACTrB,EAAQA,EAAMsC,MAAO,GACrBpG,KAAKmF,sBAAuB,GAItBrB,EAAMuC,IAAKzB,EAAe0B,QAnBzB,EAoBT,GAIDzE,EAAOC,QAAUG,C,yFChGjB,IAAMC,EAAYvC,EAAS,uDAC1BG,EAAWH,EAAS,6CAwBrB4G,GAAG,WAlBH,IACOC,IAAaD,EAAG,gCAG2B,IAA5CA,EAAG,6BAA8BE,QAErC,IAAIvE,EAAW,CACdW,IAAK,IAAI6D,GAAGC,IACZjE,GAAI8D,EACJI,OAAQ,YACRC,oBAAoB,EACpB/G,SAAUA,IAIZ0G,EAAW/B,KAAM,yBAA0BqC,QAK5C,G","sources":["webpack://mfModules/./src/mobile.special.watchlist.scripts/ScrollEndEventEmitter.js","webpack://mfModules/./src/mobile.special.watchlist.scripts/WatchList.js","webpack://mfModules/./src/mobile.special.watchlist.scripts/WatchListGateway.js","webpack://mfModules/./src/mobile.special.watchlist.scripts/mobile.special.watchlist.scripts.js"],"sourcesContent":["const util = require( '../mobile.startup/util' ),\n\tmfExtend = require( '../mobile.startup/mfExtend' );\n\n/**\n * Class to assist a view in implementing infinite scrolling on some DOM\n * element. This module itself is only responsible for emitting an Event when\n * the bottom of an Element is scrolled to.\n *\n * @class ScrollEndEventEmitter\n * @mixes OO.EventEmitter\n *\n * Use this class in a view to help it do infinite scrolling.\n *\n * 1. Initialize it in the constructor `initialize` and listen to the\n * EVENT_SCROLL_END event it emits (and call your loading function then)\n * 2. On preRender (once we have the DOM element) set it into the infinite\n * scrolling object and disable it until we've loaded.\n * 3. Once you have loaded the list and put it in the DOM, enable the\n * infinite scrolling detection.\n * - Every time the scroller detection triggers a load, it auto disables\n * to not trigger multiple times. After you have loaded, manually\n * re-enable it.\n *\n * Example:\n * @example\n * <code>\n * var\n * mfExtend = require( './mfExtend' ),\n * ScrollEndEventEmitter = require( './ScrollEndEventEmitter' ),\n * eventBus = require( './eventBusSingleton' );\n * mfExtend( PhotoList, View, {\n * //...\n * initialize: function ( options ) {\n * this.gateway = new PhotoListGateway( {\n * username: options.username\n * } );\n * // 1. Set up infinite scroll helper and listen to events\n * this.scrollEndEventEmitter = new ScrollEndEventEmitter( eventBus, 1000 );\n * this.scrollEndEventEmitter.on( ScrollEndEventEmitter.EVENT_SCROLL_END,\n * this._loadPhotos.bind( this ) );\n * View.prototype.initialize.apply( this, arguments );\n * },\n * preRender: function () {\n * // 2. Disable until we've got the list rendered and set DOM el\n * this.scrollEndEventEmitter.setElement( this.$el );\n * this.scrollEndEventEmitter.disable();\n * },\n * _loadPhotos: function () {\n * var self = this;\n * this.gateway.getPhotos().then( function ( photos ) {\n * // load photos into the DOM ...\n * // 3. and (re-)enable infinite scrolling\n * self.scrollEndEventEmitter.enable();\n * } );\n * }\n * } );\n * </code>\n *\n * @fires ScrollEndEventEmitter#ScrollEndEventEmitter-scrollEnd\n * @param {Object} eventBus object to listen for scroll:throttled events\n * @param {number} [threshold=100] distance in pixels used to calculate if scroll\n * position is near the end of the $el\n */\nfunction ScrollEndEventEmitter( eventBus, threshold ) {\n\tthis.threshold = threshold || 100;\n\tthis.eventBus = eventBus;\n\tthis.enable();\n\tOO.EventEmitter.call( this );\n}\nOO.mixinClass( ScrollEndEventEmitter, OO.EventEmitter );\n\n/**\n * Fired when scroll bottom has been reached.\n *\n * @event ScrollEndEventEmitter#ScrollEndEventEmitter-scrollEnd\n */\nScrollEndEventEmitter.EVENT_SCROLL_END = 'ScrollEndEventEmitter-scrollEnd';\n\nmfExtend( ScrollEndEventEmitter, {\n\t/**\n\t * Listen to scroll on window and notify this._onScroll\n\t *\n\t * @memberof ScrollEndEventEmitter\n\t * @instance\n\t * @private\n\t */\n\t_bindScroll() {\n\t\tif ( !this._scrollHandler ) {\n\t\t\tthis._scrollHandler = this._onScroll.bind( this );\n\t\t\tthis.eventBus.on( 'scroll:throttled', this._scrollHandler );\n\t\t}\n\t},\n\t/**\n\t * Unbind scroll handler\n\t *\n\t * @memberof ScrollEndEventEmitter\n\t * @instance\n\t * @private\n\t */\n\t_unbindScroll() {\n\t\tif ( this._scrollHandler ) {\n\t\t\tthis.eventBus.off( 'scroll:throttled', this._scrollHandler );\n\t\t\tthis._scrollHandler = null;\n\t\t}\n\t},\n\t/**\n\t * Scroll handler. Triggers load event when near the end of the container.\n\t *\n\t * @memberof ScrollEndEventEmitter\n\t * @instance\n\t * @private\n\t */\n\t_onScroll() {\n\t\tif ( this.$el && this.enabled && this.scrollNearEnd() ) {\n\t\t\t// Disable when triggering an event. Won't trigger again until\n\t\t\t// re-enabled.\n\t\t\tthis.disable();\n\t\t\tthis.emit( ScrollEndEventEmitter.EVENT_SCROLL_END );\n\t\t}\n\t},\n\t/**\n\t * Is the scroll position near the end of the container element?\n\t *\n\t * @memberof ScrollEndEventEmitter\n\t * @instance\n\t * @private\n\t * @return {boolean}\n\t */\n\tscrollNearEnd() {\n\t\tif ( !this.$el || !this.$el.offset() ) {\n\t\t\treturn false;\n\t\t}\n\t\tconst $window = util.getWindow(),\n\t\t\tscrollBottom = $window.scrollTop() + $window.height(),\n\t\t\tendPosition = this.$el.offset().top + this.$el.outerHeight();\n\t\treturn scrollBottom + this.threshold > endPosition;\n\t},\n\t/**\n\t * Enable the ScrollEndEventEmitter so that it triggers events.\n\t *\n\t * @memberof ScrollEndEventEmitter\n\t * @instance\n\t */\n\tenable() {\n\t\tthis.enabled = true;\n\t\tthis._bindScroll();\n\t},\n\t/**\n\t * Disable the ScrollEndEventEmitter so that it doesn't trigger events.\n\t *\n\t * @memberof ScrollEndEventEmitter\n\t * @instance\n\t */\n\tdisable() {\n\t\tthis.enabled = false;\n\t\tthis._unbindScroll();\n\t},\n\t/**\n\t * Set the element to compare to scroll position to\n\t *\n\t * @memberof ScrollEndEventEmitter\n\t * @instance\n\t * @param {jQuery.Object} $el jQuery element where we want to listen for\n\t * scroll end.\n\t */\n\tsetElement( $el ) {\n\t\tthis.$el = $el;\n\t}\n} );\n\nmodule.exports = ScrollEndEventEmitter;\n","const\n\tmfExtend = require( '../mobile.startup/mfExtend' ),\n\tPageList = require( '../mobile.startup/PageList' ),\n\tWatchstarPageList = require( '../mobile.startup/watchstar/WatchstarPageList' ),\n\tScrollEndEventEmitter = require( './ScrollEndEventEmitter' ),\n\tutil = require( '../mobile.startup/util' ),\n\tWatchListGateway = require( './WatchListGateway' );\n\n/**\n * An extension of the WatchstarPageList which preloads pages as all being\n * watched.\n *\n * @extends WatchstarPageList\n * @class WatchList\n * @uses ScrollEndEventEmitter\n *\n * @fires watched\n * @fires watch\n * @param {Object} params Configuration options\n * @param {OO.EventEmitter} params.eventBus Object used to listen for scroll:throttled events\n * @private\n */\nfunction WatchList( params ) {\n\tlet lastTitle;\n\tconst options = util.extend(\n\t\t{},\n\t\t{\n\t\t\tisBorderBox: false\n\t\t},\n\t\tparams\n\t);\n\n\t// Set up infinite scroll helper and listen to events\n\tthis.scrollEndEventEmitter = new ScrollEndEventEmitter( options.eventBus );\n\tthis.scrollEndEventEmitter.on( ScrollEndEventEmitter.EVENT_SCROLL_END,\n\t\tthis._loadPages.bind( this ) );\n\n\tif ( options.el ) {\n\t\tlastTitle = this.getLastTitle( options.el );\n\t}\n\tthis.gateway = new WatchListGateway( options.api, lastTitle );\n\n\tWatchstarPageList.call( this, options );\n}\n\nmfExtend( WatchList, WatchstarPageList, {\n\t/**\n\t * @inheritdoc\n\t * @memberof WatchList\n\t * @instance\n\t */\n\tpreRender: function () {\n\t\t// The DOM will be modified. Prevent any false scroll end events from\n\t\t// being emitted.\n\t\tthis.scrollEndEventEmitter.disable();\n\t\tthis.scrollEndEventEmitter.setElement( this.$el );\n\t},\n\t/**\n\t * Also sets a watch uploads funnel.\n\t *\n\t * @inheritdoc\n\t * @memberof WatchList\n\t * @instance\n\t */\n\tpostRender: function () {\n\t\t// Skip a level from WatchstarPageList directly to PageList.\n\t\tPageList.prototype.postRender.apply( this );\n\n\t\tconst $items = this.queryUnitializedItems();\n\n\t\t// WatchList requests list of watched pages. The list contains only\n\t\t// watched pages so it's safe to transform the title map to a status map\n\t\t// with each entry marked watched (true).\n\t\tconst statuses = Object.keys( this.parsePagesFromItems( $items ) )\n\t\t\t.reduce( function ( arr, title ) {\n\t\t\t\tarr[ title ] = true;\n\t\t\t\treturn arr;\n\t\t\t}, {} );\n\t\tthis.renderItems( $items, statuses );\n\n\t\t// The list has been extended. Re-enable scroll end events.\n\t\tthis.scrollEndEventEmitter.enable();\n\t},\n\n\t/**\n\t * Loads pages from the api and triggers render.\n\t * Infinite scroll is re-enabled in postRender.\n\t *\n\t * @memberof WatchList\n\t * @instance\n\t */\n\t_loadPages: function () {\n\t\tthis.gateway.loadWatchlist().then( function ( pages ) {\n\t\t\tpages.forEach( function ( page ) {\n\t\t\t\tthis.appendPage( page );\n\t\t\t}.bind( this ) );\n\t\t\tthis.render();\n\t\t}.bind( this ) );\n\t},\n\n\t/**\n\t * Appends a list item\n\t *\n\t * @memberof WatchList\n\t * @instance\n\t * @param {Page} page\n\t */\n\tappendPage: function ( page ) {\n\t\t// wikidata descriptions should not show in this view.\n\t\tconst templateOptions = util.extend( {}, page, {\n\t\t\twikidataDescription: undefined\n\t\t} );\n\t\tthis.$el.append( this.templatePartials.item.render( templateOptions ) );\n\t},\n\n\t/**\n\t * Get the last title from the rendered HTML.\n\t * Used for initializing the API\n\t *\n\t * @memberof WatchList\n\t * @instance\n\t * @param {jQuery.Object} $el Dom element of the list\n\t * @return {string}\n\t */\n\tgetLastTitle: function ( $el ) {\n\t\treturn $el.find( 'li' ).last().attr( 'title' );\n\t}\n} );\n\nmodule.exports = WatchList;\n","const\n\tpageJSONParser = require( '../mobile.startup/page/pageJSONParser' ),\n\tutil = require( '../mobile.startup/util' ),\n\textendSearchParams = require( '../mobile.startup/extendSearchParams' );\n\n/**\n * API for interacting with watchlist.\n *\n * @param {mw.Api} api\n * @param {string} lastTitle of page listed in Watchlist to be used as a continuation parameter\n * @private\n */\nfunction WatchListGateway( api, lastTitle ) {\n\tthis.api = api;\n\t// Try to keep it in sync with SpecialMobileEditWatchlist::LIMIT (php)\n\tthis.limit = 50;\n\n\tif ( lastTitle ) {\n\t\tthis.continueParams = {\n\t\t\tcontinue: 'gwrcontinue||',\n\t\t\tgwrcontinue: '0|' + lastTitle.replace( / /g, '_' )\n\t\t};\n\t\tthis.shouldSkipFirstTitle = true;\n\t} else {\n\t\tthis.continueParams = {\n\t\t\tcontinue: ''\n\t\t};\n\t\tthis.shouldSkipFirstTitle = false;\n\t}\n\n\tthis.canContinue = true;\n}\n\nWatchListGateway.prototype = {\n\t/**\n\t * Load the list of items on the watchlist\n\t *\n\t * @return {jQuery.Deferred}\n\t */\n\tloadWatchlist: function () {\n\t\tconst self = this,\n\t\t\tparams = extendSearchParams( 'watchlist', {\n\t\t\t\tprop: [ 'info', 'revisions' ],\n\t\t\t\trvprop: 'timestamp|user',\n\t\t\t\tgenerator: 'watchlistraw',\n\t\t\t\tgwrnamespace: '0',\n\t\t\t\tgwrlimit: this.limit\n\t\t\t}, this.continueParams );\n\n\t\tif ( this.canContinue === false ) {\n\t\t\treturn util.Deferred().resolve( [] );\n\t\t}\n\t\treturn this.api.get( params ).then( function ( data ) {\n\t\t\tif ( data.continue !== undefined ) {\n\t\t\t\tself.continueParams = data.continue;\n\t\t\t} else {\n\t\t\t\tself.canContinue = false;\n\t\t\t}\n\n\t\t\treturn self.parseData( data );\n\t\t} );\n\t},\n\n\t/**\n\t * Parse api response data into pagelist item format\n\t *\n\t * @param {Object[]} data\n\t * @return {Page[]}\n\t */\n\tparseData: function ( data ) {\n\t\tlet pages;\n\n\t\tif ( !data.query || !data.query.pages ) {\n\t\t\treturn [];\n\t\t}\n\n\t\tpages = data.query.pages;\n\n\t\t// Sort results alphabetically (the api map doesn't have any order). The\n\t\t// watchlist is ordered alphabetically right now.\n\t\tpages.sort( function ( p1, p2 ) {\n\t\t\treturn p1.title === p2.title ? 0 : ( p1.title < p2.title ? -1 : 1 );\n\t\t} );\n\n\t\t// If we requested from the last item of the previous page, we shall\n\t\t// remove the first result (to avoid it being repeated)\n\t\tif ( this.shouldSkipFirstTitle ) {\n\t\t\tpages = pages.slice( 1 );\n\t\t\tthis.shouldSkipFirstTitle = false;\n\t\t}\n\n\t\t// Transform the items to a sensible format\n\t\treturn pages.map( pageJSONParser.parse );\n\t}\n\n};\n\nmodule.exports = WatchListGateway;\n","/* global $ */\nconst WatchList = require( './WatchList' ),\n\teventBus = require( '../mobile.startup/eventBusSingleton' );\n\n/**\n * Initialises JavaScript on Special:Watchlist\n * @private\n */\nfunction init() {\n\tconst $watchlist = $( 'ul.mw-mf-watchlist-page-list' );\n\n\t// FIXME: find more elegant way to not show watchlist stars on recent changes\n\tif ( $( '.mw-mf-watchlist-selector' ).length === 0 ) {\n\t\t// eslint-disable-next-line no-new\n\t\tnew WatchList( {\n\t\t\tapi: new mw.Api(),\n\t\t\tel: $watchlist,\n\t\t\tfunnel: 'watchlist',\n\t\t\tskipTemplateRender: true,\n\t\t\teventBus: eventBus\n\t\t} );\n\t}\n\t// not needed now we have JS view which has infinite scrolling\n\t$watchlist.find( '.mw-mf-watchlist-more' ).remove();\n}\n\n$( function () {\n\tinit();\n} );\n"],"names":["util","require","mfExtend","ScrollEndEventEmitter","eventBus","threshold","this","enable","OO","EventEmitter","call","mixinClass","EVENT_SCROLL_END","_bindScroll","_scrollHandler","_onScroll","bind","on","_unbindScroll","off","$el","enabled","scrollNearEnd","disable","emit","offset","$window","getWindow","scrollBottom","scrollTop","height","endPosition","top","outerHeight","setElement","module","exports","PageList","WatchstarPageList","WatchListGateway","WatchList","params","lastTitle","options","extend","isBorderBox","scrollEndEventEmitter","_loadPages","el","getLastTitle","gateway","api","preRender","postRender","prototype","apply","$items","queryUnitializedItems","statuses","Object","keys","parsePagesFromItems","reduce","arr","title","renderItems","loadWatchlist","then","pages","forEach","page","appendPage","render","templateOptions","wikidataDescription","undefined","append","templatePartials","item","find","last","attr","pageJSONParser","extendSearchParams","limit","continueParams","continue","gwrcontinue","replace","shouldSkipFirstTitle","canContinue","self","prop","rvprop","generator","gwrnamespace","gwrlimit","Deferred","resolve","get","data","parseData","query","sort","p1","p2","slice","map","parse","$","$watchlist","length","mw","Api","funnel","skipTemplateRender","remove"],"sourceRoot":""}
\ No newline at end of file
diff --git a/extensions/MobileFrontend/resources/dist/mobile.startup.js b/extensions/MobileFrontend/resources/dist/mobile.startup.js
new file mode 100644
index 000000000..840ba510c
--- /dev/null
+++ b/extensions/MobileFrontend/resources/dist/mobile.startup.js
@@ -0,0 +1,2 @@
+(self.webpackChunkmfModules=self.webpackChunkmfModules||[]).push([[380],{"./src/mobile.startup/LanguageInfo.js":(e,t,r)=>{var n=r("./src/mobile.startup/util.js"),a=r("./src/mobile.startup/actionParams.js");function s(e){this.api=e}s.prototype={getLanguages:function(){return this.api.get(a({meta:"languageinfo",liprop:"code|autonym|name|bcp47"})).then((function(e){var t=[];return Object.keys(e.query.languageinfo).forEach((function(r){var n=e.query.languageinfo[r];n.code.toLowerCase()===n.bcp47.toLowerCase()&&n.autonym&&t.push(n)})),t}),(function(){return n.Deferred().reject()})).then((function(e){return{languages:e.map((function(e){return e.url="#",e.lang=e.code,e.langname=e.name,e.title=e.name,e}))}}),(function(){return n.Deferred().reject()}))}},e.exports=s},"./src/mobile.startup/languageOverlay/getDeviceLanguage.js":e=>{e.exports=function(e){var t=e.languages?e.languages[0]:e.language||e.userLanguage||e.browserLanguage||e.systemLanguage;return t?t.toLowerCase():void 0}},"./src/mobile.startup/languageOverlay/languageInfoOverlay.js":(e,t,r)=>{var n=r("./src/mobile.startup/moduleLoaderSingleton.js"),a=r("./src/mobile.startup/languageOverlay/getDeviceLanguage.js"),s=r("./src/mobile.startup/Overlay.js"),o=r("./src/mobile.startup/promisedView.js");function i(e,t){return mw.loader.using("mobile.languages.structured").then((function(){return e.getLanguages()})).then((function(e){return new(n.require("mobile.languages.structured/LanguageSearcher"))({languages:e.languages,variants:e.variants,showSuggestedLanguages:t,deviceLanguage:a(navigator)})}))}function c(e,t){return s.make({heading:mw.msg("mobile-frontend-language-heading"),className:"overlay language-info-overlay"},o(i(e,t)))}c.test={loadLanguageInfoSearcher:i},e.exports=c},"./src/mobile.startup/languageOverlay/languageOverlay.js":(e,t,r)=>{var n=r("./src/mobile.startup/moduleLoaderSingleton.js"),a=r("./src/mobile.startup/languageOverlay/getDeviceLanguage.js"),s=r("./src/mobile.startup/Overlay.js"),o=r("./src/mobile.startup/MessageBox.js"),i=r("./src/mobile.startup/currentPageHTMLParser.js")(),c=r("./src/mobile.startup/promisedView.js");function u(){return mw.loader.using("mobile.languages.structured").then((function(){return i.getLanguages(mw.config.get("wgTitle"))})).then((function(e){return new(n.require("mobile.languages.structured/LanguageSearcher"))({languages:e.languages,variants:e.variants,showSuggestedLanguages:!0,deviceLanguage:a(navigator),onOpen:function(e){return mw.hook("mobileFrontend.languageSearcher.onOpen").fire(e)}})}),(function(){return new o({type:"error",className:"content",msg:mw.msg("mobile-frontend-languages-structured-overlay-error")})}))}function l(){return s.make({heading:mw.msg("mobile-frontend-language-heading"),className:"overlay language-overlay"},c(u()))}l.test={loadLanguageSearcher:u},e.exports=l},"./src/mobile.startup/mediaViewer/overlay.js":(e,t,r)=>{var n=r("./src/mobile.startup/moduleLoaderSingleton.js"),a=r("./src/mobile.startup/promisedView.js"),s=r("./src/mobile.startup/util.js"),o=r("./src/mobile.startup/headers.js").header,i=r("./src/mobile.startup/icons.js"),c=r("./src/mobile.startup/Overlay.js");e.exports=function(e){return c.make({headers:[o("",[],i.cancel("gray"))],className:"overlay media-viewer"},a(s.Promise.all([mw.loader.using("mobile.mediaViewer")]).then((function(){return new(0,n.require("mobile.mediaViewer").ImageCarousel)(e)}))))}},"./src/mobile.startup/mobile.startup.js":(e,t,r)=>{var n=r("./src/mobile.startup/currentPageHTMLParser.js"),a=r("./src/mobile.startup/time.js"),s=r("./src/mobile.startup/LanguageInfo.js"),o=r("./src/mobile.startup/currentPage.js"),i=r("./src/mobile.startup/Drawer.js"),c=r("./src/mobile.startup/CtaDrawer.js"),u=r("./src/mobile.startup/lazyImages/lazyImageLoader.js"),l=r("./src/mobile.startup/icons.js"),p=r("./src/mobile.startup/PageHTMLParser.js"),f=r("./src/mobile.startup/showOnPageReload.js"),m=r("./src/mobile.startup/OverlayManager.js"),h=r("./src/mobile.startup/View.js"),d=r("./src/mobile.startup/Overlay.js"),g=r("./src/mobile.startup/references/references.js"),b={SearchOverlay:r("./src/mobile.startup/search/SearchOverlay.js"),SearchGateway:r("./src/mobile.startup/search/SearchGateway.js")},y=r("./src/mobile.startup/promisedView.js"),v=r("./src/mobile.startup/headers.js"),w=r("./src/mobile.startup/Skin.js"),j={overlay:r("./src/mobile.startup/mediaViewer/overlay.js")},S=r("./src/mobile.startup/languageOverlay/languageInfoOverlay.js"),O=r("./src/mobile.startup/languageOverlay/languageOverlay.js"),R=r("./src/mobile.startup/amcOutreach/amcOutreach.js");mw._mobileFrontend={amcOutreach:R,overlayHeader:v.header,Drawer:i,CtaDrawer:c,View:h,Overlay:d,currentPageHTMLParser:n,getOverlayManager:function(){return m.getSingleton()},currentPage:o,PageHTMLParser:p,spinner:l.spinner,mediaViewer:j,references:g,search:b,time:a,promisedView:y,loadAllImagesInPage:function(){return u.loadImages(u.queryPlaceholders(document.getElementById("content")))},notifyOnPageReload:function(e){return f(e)},license:function(){return w.getSingleton().getLicenseMsg()},languages:{languageOverlay:O,languageInfoOverlay:function(e,t){return S(new s(e),t)}}}},"./src/mobile.startup/promisedView.js":(e,t,r)=>{var n=r("./src/mobile.startup/icons.js"),a=r("./src/mobile.startup/View.js");e.exports=function(e){var t=new a({className:"promised-view"});return t.$el.append(n.spinner().$el),e.then((function(e){t.$el.replaceWith(e.$el),t.$el=e.$el}),(function(e){e&&e.$el&&(t.$el.replaceWith(e.$el),t.$el=e.$el)})),t}},"./src/mobile.startup/references/ReferencesGateway.js":e=>{function t(e){this.api=e}t.prototype.getReference=null,t.ERROR_NOT_EXIST="NOT_EXIST_ERROR",t.ERROR_OTHER="OTHER_ERROR",e.exports=t},"./src/mobile.startup/references/ReferencesHtmlScraperGateway.js":(e,t,r)=>{var n=r("./src/mobile.startup/references/ReferencesGateway.js"),a=r("./src/mobile.startup/mfExtend.js"),s=r("./src/mobile.startup/util.js");function o(){n.apply(this,arguments)}a(o,n,{EXTERNAL_LINK_CLASS:"external--reference",getReferenceFromContainer:function(e,t){var r=s.Deferred(),a=t.find("#"+s.escapeSelector(e));if(a.length){var o,i=a.closest("ol"),c=i.hasClass("mw-extended-references");c&&(o=i.parent()),(o||a).find(".external").addClass(this.EXTERNAL_LINK_CLASS),r.resolve({text:this.getReferenceHtml(a),parentText:this.getReferenceHtml(o),isSubref:c})}else r.reject(n.ERROR_NOT_EXIST);return r.promise()},getReferenceHtml:function(e){return e?e.children(".mw-reference-text, .reference-text").first().html():""},getReference:function(e,t,r){var n=mw.util.percentDecodeFragment(e.slice(1));return this.getReferenceFromContainer(n,r.$el.find("ol.references"))}}),e.exports=o},"./src/mobile.startup/references/references.js":(e,t,r)=>{var n=r("./src/mobile.startup/Drawer.js"),a=r("./src/mobile.startup/util.js"),s=r("./src/mobile.startup/icons.js"),o=r("./src/mobile.startup/references/ReferencesGateway.js"),i=r("./src/mobile.startup/Icon.js"),c=r("./src/mobile.startup/references/ReferencesHtmlScraperGateway.js"),u=r("./src/mobile.startup/IconButton.js");function l(e){return function(t){var r=t.currentTarget.querySelector("a");if(r)return e(r.getAttribute("href"),r.textContent),!1}}function p(e){var t=e.error?new u({name:"error",isSmall:!0}).$el:null,r=e.isSubref?e.parentText:e.text,o=a.parseHTML("<div>").addClass("main-reference-content").html(r);r||o.append(s.spinner().$el);var c=e.isSubref?a.parseHTML("<div>").html(e.text):"";return new n(a.extend({showCollapseIcon:!1,className:"drawer position-fixed text references-drawer",events:{"click sup a":function(e){e.preventDefault()},"click sup":e.onNestedReferenceClick&&l(e.onNestedReferenceClick)},children:[a.parseHTML("<div>").addClass("references-drawer__header").append([new i({icon:"reference",isSmall:!0}).$el,a.parseHTML("<span>").addClass("references-drawer__title").text(mw.msg("mobile-frontend-references-citation")),s.cancel("gray",{isSmall:!0,additionalClassNames:"mf-button-flush-right"}).$el]),a.parseHTML("<div>").addClass("mw-parser-output").append([t,a.parseHTML("<sup>").text(e.title),o,c])]},e))}var f={test:{makeOnNestedReferenceClickHandler:l},ReferencesHtmlScraperGateway:c,referenceDrawer:p,showReference:function(e,t,r,n,s,i,c){return s.getReference(e,t,n).then((function(e){var o=p(a.extend({title:r,text:e.text,parentText:e.parentText,isSubref:e.isSubref,onNestedReferenceClick:function(e,r){f.showReference(e,t,r,n,s).then((function(e){i.onShowNestedReference?c(o,e):(mw.log.warn("Please provide onShowNestedReferences parameter."),document.body.appendChild(e.$el[0]),o.hide(),e.show())}))}},i));return o}),(function(e){if(e!==o.ERROR_NOT_EXIST)return p({error:!0,title:r,text:mw.msg("mobile-frontend-references-citation-error")})}))}};e.exports=f},"./src/mobile.startup/search/SearchGateway.js":(e,t,r)=>{var n=r("./src/mobile.startup/page/pageJSONParser.js"),a=r("./src/mobile.startup/util.js"),s=r("./src/mobile.startup/extendSearchParams.js");function o(e){this.api=e,this.searchCache={},this.generator=mw.config.get("wgMFSearchGenerator")}o.prototype={searchNamespace:0,getApiData:function(e){var t=this.generator.prefix,r=s("search",{generator:this.generator.name});return r.redirects="",r["g"+t+"search"]=e,r["g"+t+"namespace"]=this.searchNamespace,r["g"+t+"limit"]=15,r.pilimit&&(r.pilimit=15,r.pithumbsize=mw.config.get("wgMFThumbnailSizes").tiny),r},_createSearchRegEx:function(e){return e=e.replace(/[-\[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),new RegExp("^("+e+")","ig")},_highlightSearchTerm:function(e,t){return e=a.parseHTML("<span>").text(e).html(),t=t.trim(),t=a.parseHTML("<span>").text(t).html(),e.replace(this._createSearchRegEx(t),"<strong>$1</strong>")},_getPage:function(e,t){var r=n.parse(t);return r.displayTitle=this._highlightSearchTerm(t.displaytext?t.displaytext:r.title,e),r.index=t.index,r},_processData:function(e,t){var r=this,n=[];return t.query&&(n=t.query.pages||{},(n=Object.keys(n).map((function(t){return r._getPage(e,n[t])}))).sort((function(e,t){return e.index-t.index}))),n},search:function(e){var t=mw.config.get("wgMFScriptPath"),r=this;if(!this.isCached(e)){var n=this.api.get(this.getApiData(e),t?{url:t}:void 0),a=n.then((function(t,n){return{query:e,results:r._processData(e,t),searchId:n&&n.getResponseHeader("x-search-id")}}),(function(){r.searchCache[e]=void 0}));this.searchCache[e]=a.promise({abort:function(){n.abort()}})}return this.searchCache[e]},isCached:function(e){return Boolean(this.searchCache[e])}},e.exports=o},"./src/mobile.startup/search/SearchHeaderView.js":(e,t,r)=>{function n(e){return n="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},n(e)}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,s(n.key),n)}}function s(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}function o(e,t,r){return t=c(t),function(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,i()?Reflect.construct(t,r||[],c(e).constructor):t.apply(e,r))}function i(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(i=function(){return!!e})()}function c(e){return c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},c(e)}function u(e,t){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},u(e,t)}var l=r("./src/mobile.startup/util.js"),p=r("./src/mobile.startup/View.js"),f=r("./src/mobile.startup/IconButton.js"),m=function(e){"use strict";function t(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),o(this,t,[l.extend({autocapitalize:"sentences"},e,{events:{"input input":"onInput"}})])}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&u(e,t)}(t,e),r=t,(n=[{key:"onInput",value:function(e){var t=e.target.value;this.options.onInput(t),t?this.clearIcon.$el.show():this.clearIcon.$el.hide()}},{key:"isTemplateMode",get:function(){return!0}},{key:"template",get:function(){return l.template('<div class="overlay-title search-header-view">\n\t\t<form method="get" action="{{action}}" class="search-box">\n\t\t<input class="search mf-icon-search" type="search" name="search"\n\t\t\tautocapitalize="{{autocapitalize}}"\n\t\t\tautocomplete="off" placeholder="{{placeholderMsg}}" aria-label="{{placeholderMsg}}" value="{{searchTerm}}">\n\t\t<input type="hidden" name="title" value="{{defaultSearchPage}}">\n\t\t</form>\n</div>')}},{key:"postRender",value:function(){var e=new f({tagName:"button",icon:"clear",size:"medium",isSmall:!0,label:mw.msg("mobile-frontend-clear-search"),additionalClassNames:"clear",events:{click:function(){return this.$el.find("input").val("").trigger("focus"),this.options.onInput(""),e.$el.hide(),!1}.bind(this)}});this.clearIcon=e,e.$el.hide(),e.$el.attr("aria-hidden","true"),this.$el.find("form").append(e.$el)}}])&&a(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(p);e.exports=m},"./src/mobile.startup/search/SearchOverlay.js":(e,t,r)=>{var n=r("./src/mobile.startup/mfExtend.js"),a=r("./src/mobile.startup/Overlay.js"),s=r("./src/mobile.startup/util.js"),o=r("./src/mobile.startup/search/searchHeader.js"),i=r("./src/mobile.startup/search/SearchResultsView.js"),c=r("./src/mobile.startup/watchstar/WatchstarPageList.js");function u(e){var t=this,r=o(e.placeholderMsg,e.action||mw.config.get("wgScript"),(function(e){return t.performSearch(e)}),e.defaultSearchPage||"",e.autocapitalize),n=s.extend(!0,{headerChrome:!0,isBorderBox:!1,className:"overlay search-overlay",headers:[r],events:{"click .search-content":"onClickSearchContent","click .overlay-content":"onClickOverlayContent","click .overlay-content > div":function(e){e.stopPropagation()},"touchstart .results":"hideKeyboardOnScroll","mousedown .results":"hideKeyboardOnScroll","click .results a":"onClickResult"}},e);this.header=r,a.call(this,n),this.api=n.api,this.gateway=n.gateway||new n.gatewayClass(this.api),this.router=n.router,this.currentSearchId=null}n(u,a,{onClickSearchContent:function(){var e=this.$el.find("form"),t=e[0].parentNode;this.parseHTML("<input>").attr({type:"hidden",name:"fulltext",value:"search"}).appendTo(e),setTimeout((function(){e[0].parentNode||e.appendTo(t),e.trigger("submit")}),0)},onClickOverlayContent:function(){this.$el.find(".cancel").trigger("click")},hideKeyboardOnScroll:function(){this.$input.trigger("blur")},onClickResult:function(e){var t=this,r=this.$el.find(e.currentTarget);e.preventDefault(),this.router.back().then((function(){if(this.currentSearchId){var e=new URL(location.href);e.searchParams.set("searchToken",this.currentSearchId),t.router.navigateTo(document.title,{path:e.toString(),useReplaceState:!0}),this.currentSearchId=null}window.location.href=r.attr("href")}))},postRender:function(){var e,t=this,r=this,n=new i({searchContentLabel:mw.msg("mobile-frontend-search-content"),noResultsMsg:mw.msg("mobile-frontend-search-no-results"),searchContentNoResultsMsg:mw.message("mobile-frontend-search-content-no-results").parse()});function s(){r.$spinner.hide(),clearTimeout(e)}this.$el.find(".overlay-content").append(n.$el),a.prototype.postRender.call(this),this.$input=this.$el.find(this.header).find("input"),this.$searchContent=n.$el.hide(),this.$resultContainer=n.$el.find(".results-list-container"),this.$resultContainer[0].addEventListener("touchstart",(function(e){document.activeElement===t.$input[0]&&e.stopPropagation()})),this.$spinner=n.$el.find(".spinner-container"),this.on("search-start",(function(t){e&&s(),e=setTimeout((function(){return r.$spinner.show()}),2e3-t.delay)})),this.on("search-results",s)},showKeyboard:function(){var e=this.$input.val().length;this.$input.trigger("focus"),this.$input[0].setSelectionRange&&this.$input[0].setSelectionRange(e,e)},show:function(){a.prototype.show.apply(this,arguments),this.showKeyboard()},performSearch:function(e){var t=this,r=this.api,n=this.gateway.isCached(e)?0:300;e!==this.lastQuery&&(t._pendingQuery&&t._pendingQuery.abort(),clearTimeout(this.timer),e.length?this.timer=setTimeout((function(){var n=t.gateway.search(e);t._pendingQuery=n.then((function(e){this.currentSearchId=e.searchId,e&&e.query===t.$input.val()&&(t.$el.toggleClass("no-results",0===e.results.length),t.$searchContent.show().find("p").hide().filter(e.results.length?".with-results":".without-results").show(),new c({api:r,funnel:"search",pages:e.results,el:t.$resultContainer}),t.$results=t.$resultContainer.find("li"))})).promise({abort:function(){n.abort()}})}),n):t.resetSearch(),this.lastQuery=e)},resetSearch:function(){this.$el.find(".overlay-content").children().hide()}}),e.exports=u},"./src/mobile.startup/search/SearchResultsView.js":(e,t,r)=>{function n(e){return n="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},n(e)}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,s(n.key),n)}}function s(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}function o(e,t,r){return t=u(t),function(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,i()?Reflect.construct(t,r||[],u(e).constructor):t.apply(e,r))}function i(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(i=function(){return!!e})()}function c(){return c="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=u(e)););return e}(e,t);if(n){var a=Object.getOwnPropertyDescriptor(n,t);return a.get?a.get.call(arguments.length<3?e:r):a.value}},c.apply(null,arguments)}function u(e){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},u(e)}function l(e,t){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},l(e,t)}var p=r("./src/mobile.startup/View.js"),f=r("./src/mobile.startup/Icon.js"),m=r("./src/mobile.startup/Anchor.js"),h=r("./src/mobile.startup/icons.js").spinner().$el,d=r("./src/mobile.startup/util.js"),g=function(e){"use strict";function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),o(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&l(e,t)}(t,e),r=t,n=[{key:"isTemplateMode",get:function(){return!0}},{key:"template",get:function(){return d.template('\n<div class="search-results-view">\n\t<div class="search-content">\n\t\t<div class="caption">\n\t\t\t<p class="with-results">{{searchContentLabel}}</p>\n\t\t\t<p class="without-results">{{noResultsMsg}}</p>\n\t\t\t<p class="without-results">{{{searchContentNoResultsMsg}}}</p>\n\t\t</div>\n\t</div>\n\t<div class="spinner-container position-fixed"></div>\n\t<div class="results">\n\t\t<div class="results-list-container"></div>\n\t\t{{#feedback}}\n\t\t\t<div class="search-feedback">\n\t\t\t\t{{prompt}}\n\t\t\t</div>\n\t\t{{/feedback}}\n\t</div>\n</div>')}},{key:"preRender",value:function(){mw.config.get("wgCirrusSearchFeedbackLink")&&(this.options.feedback={prompt:mw.msg("mobile-frontend-search-feedback-prompt")})}},{key:"postRender",value:function(e){var r,n,a,s=mw.config.get("wgCirrusSearchFeedbackLink");(r=t,n=this,a=c(u(1&3?r.prototype:r),"postRender",n),function(e){return a.apply(n,e)})([e]),this.$el.find(".search-content").prepend(new f({icon:"articlesSearch"}).$el),this.$el.find(".spinner-container").append(h),s&&this.$el.find(".search-feedback").append(new m({label:mw.msg("mobile-frontend-search-feedback-link-text"),href:s}).$el)}}],n&&a(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(p);e.exports=g},"./src/mobile.startup/search/searchHeader.js":(e,t,r)=>{var n=r("./src/mobile.startup/headers.js").formHeader,a=r("./src/mobile.startup/search/SearchHeaderView.js"),s=r("./src/mobile.startup/icons.js");e.exports=function(e,t,r,o,i){return n(new a({placeholderMsg:e,autocapitalize:i,action:t,onInput:r,defaultSearchPage:o}),[s.cancel()],!1)}},"./src/mobile.startup/time.js":(e,t,r)=>{var n=["seconds","minutes","hours","days","months","years"],a=r("./src/mobile.startup/util.js"),s=[1,60,3600,86400,2592e3,31536e3];function o(e){for(var t=0;t<s.length&&e>s[t+1];)++t;return{value:Math.round(e/s[t]),unit:n[t]}}function i(e){return o(Math.round(Date.now()/1e3)-e)}function c(e){return"seconds"===e.unit&&e.value<10}e.exports={getLastModifiedMessage:function(e,t,r,n){var s=void 0===n,o=[];r=r||"unknown";var u=i(e);c(u)?o.push("mobile-frontend-last-modified-with-user-just-now",r,t):o.push({seconds:"mobile-frontend-last-modified-with-user-seconds",minutes:"mobile-frontend-last-modified-with-user-minutes",hours:"mobile-frontend-last-modified-with-user-hours",days:"mobile-frontend-last-modified-with-user-days",months:"mobile-frontend-last-modified-with-user-months",years:"mobile-frontend-last-modified-with-user-years"}[u.unit],r,t,mw.language.convertNumber(u.value));var l=s?a.parseHTML("<strong>").attr("class","last-modified-text-accent"):a.parseHTML("<a>").attr("href",n||"#"),p=s?a.parseHTML("<span>").attr("class","last-modified-text-accent"):a.parseHTML("<a>").attr("href",mw.util.getUrl("User:"+t));return o.push(l,mw.language.convertNumber(t?1:0),t?p:""),mw.message.apply(this,o).parse()},getRegistrationMessage:function(e,t){var r=[];t=t||"unknown";var n=i(parseInt(e,10));return c(n)?r.push("mobile-frontend-joined-just-now",t):r.push({seconds:"mobile-frontend-joined-seconds",minutes:"mobile-frontend-joined-minutes",hours:"mobile-frontend-joined-hours",days:"mobile-frontend-joined-days",months:"mobile-frontend-joined-months",years:"mobile-frontend-joined-years"}[n.unit],t,mw.language.convertNumber(n.value)),mw.message.apply(this,r).parse()},timeAgo:o,getTimeAgoDelta:i,isNow:c,isRecent:function(e){return["seconds","minutes","hours"].indexOf(e.unit)>-1}}}},e=>{e.O(0,[569],(()=>e(e.s="./src/mobile.startup/mobile.startup.js")));var t=e.O();(this.mfModules=this.mfModules||{})["mobile.startup"]=t}]);
+//# sourceMappingURL=mobile.startup.js.map.json
\ No newline at end of file
diff --git a/extensions/MobileFrontend/resources/dist/mobile.startup.js.map.json b/extensions/MobileFrontend/resources/dist/mobile.startup.js.map.json
new file mode 100644
index 000000000..e80092aef
--- /dev/null
+++ b/extensions/MobileFrontend/resources/dist/mobile.startup.js.map.json
@@ -0,0 +1 @@
+{"version":3,"file":"mobile.startup.js","mappings":"0HAAA,IAAMA,EAAOC,EAAS,gCACrBC,EAAeD,EAAS,wCAQzB,SAASE,EAAcC,GACtBC,KAAKD,IAAMA,CACZ,CAEAD,EAAaG,UAAY,CAUxBC,aAAY,WACX,OAAOF,KAAKD,IAAII,IAAKN,EAAc,CAClCO,KAAM,eACNC,OAAQ,6BACHC,MAAM,SAAEC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,EAAK9T,KAAM,kCAAmC2T,GAE9CG,EAAK9T,KAjBO,CACZ+T,QAAS,iCACTC,QAAS,iCACTC,MAAO,+BACPC,KAAM,8BACNC,OAAQ,gCACRC,MAAO,gCAWUb,EAAMN,MAAQU,EAAQlS,GAAG9B,SAAS0U,cAAed,EAAMhG,QAE5D9L,GAAGqP,QAAQ5K,MAAOtH,KAAMkV,GAAOjI,OAE7C,EAUC+G,QAAAA,EACAM,gBAAAA,EACAI,MAAAA,EACAqB,SAjHD,SAAmBpB,GAClB,MAAO,CAAE,UAAW,UAAW,SAAUqB,QAASrB,EAAMN,OAAU,CACnE,E","sources":["webpack://mfModules/./src/mobile.startup/LanguageInfo.js","webpack://mfModules/./src/mobile.startup/languageOverlay/getDeviceLanguage.js","webpack://mfModules/./src/mobile.startup/languageOverlay/languageInfoOverlay.js","webpack://mfModules/./src/mobile.startup/languageOverlay/languageOverlay.js","webpack://mfModules/./src/mobile.startup/mediaViewer/overlay.js","webpack://mfModules/./src/mobile.startup/mobile.startup.js","webpack://mfModules/./src/mobile.startup/promisedView.js","webpack://mfModules/./src/mobile.startup/references/ReferencesGateway.js","webpack://mfModules/./src/mobile.startup/references/ReferencesHtmlScraperGateway.js","webpack://mfModules/./src/mobile.startup/references/references.js","webpack://mfModules/./src/mobile.startup/search/SearchGateway.js","webpack://mfModules/./src/mobile.startup/search/SearchHeaderView.js","webpack://mfModules/./src/mobile.startup/search/SearchOverlay.js","webpack://mfModules/./src/mobile.startup/search/SearchResultsView.js","webpack://mfModules/./src/mobile.startup/search/searchHeader.js","webpack://mfModules/./src/mobile.startup/time.js"],"sourcesContent":["const util = require( './util.js' ),\n\tactionParams = require( './actionParams' );\n\n/**\n * API for providing language data.\n *\n * @class module:mobile.startup/languages~LanguageInfo\n * @param {mw.Api} api\n */\nfunction LanguageInfo( api ) {\n\tthis.api = api;\n}\n\nLanguageInfo.prototype = {\n\n\t/**\n\t * Get languageinfo API data from the local wiki, and transform it into a\n\t * format usable by LanguageSearcher.\n\t *\n\t * @memberof module:mobile.startup/languages~LanguageInfo\n\t * @instance\n\t * @returns {jQuery.Deferred}\n\t */\n\tgetLanguages() {\n\t\treturn this.api.get( actionParams( {\n\t\t\tmeta: 'languageinfo',\n\t\t\tliprop: 'code|autonym|name|bcp47'\n\t\t} ) ).then( ( resp ) => {\n\t\t\tconst filteredLanguages = [];\n\t\t\t// Filter out legacy languages and require an autonym.\n\t\t\t// If the bcp47 (https://w.wiki/Y7A) does not match the language\n\t\t\t// code, that is in an indication that the language code is outdated\n\t\t\t// and should not be used.\n\t\t\tObject.keys( resp.query.languageinfo ).forEach( ( key ) => {\n\t\t\t\tconst language = resp.query.languageinfo[key];\n\t\t\t\tif ( ( language.code.toLowerCase() === language.bcp47.toLowerCase() ) &&\n\t\t\t\t\tlanguage.autonym ) {\n\t\t\t\t\tfilteredLanguages.push( language );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn filteredLanguages;\n\t\t}, () => util.Deferred().reject() ).then( ( filteredLanguages ) => ( {\n\t\t\tlanguages: filteredLanguages.map( ( data ) => {\n\t\t\t\tdata.url = '#';\n\t\t\t\tdata.lang = data.code;\n\t\t\t\tdata.langname = data.name;\n\t\t\t\t// FIXME: This isn't a \"title\" in the sense of a MediaWiki\n\t\t\t\t// Title, and it is rendered as a subheader in the list\n\t\t\t\t// item, so a different name would be wiser, both here and\n\t\t\t\t// in LanguageSearcher's template. Also it would arguably\n\t\t\t\t// be more intuitive for the language name (localized) to\n\t\t\t\t// appear as the main emphasized element of each language\n\t\t\t\t// list element; but instead the autonym has that role.\n\t\t\t\t// A more thorough refactoring of LanguageSearcher to allow\n\t\t\t\t// for generic header/subheader elements is left for a\n\t\t\t\t// follow-up.\n\t\t\t\tdata.title = data.name;\n\t\t\t\treturn data;\n\t\t\t} )\n\t\t} ), () => util.Deferred().reject() );\n\t}\n};\n\nmodule.exports = LanguageInfo;\n","/**\n * Return the language code of the device in lowercase\n *\n * @ignore\n * @param {window.navigator} navigator\n * @return {string|undefined}\n */\nfunction getDeviceLanguage( navigator ) {\n\tconst lang = navigator.languages ?\n\t\tnavigator.languages[ 0 ] :\n\t\tnavigator.language || navigator.userLanguage ||\n\t\t\t\tnavigator.browserLanguage || navigator.systemLanguage;\n\n\treturn lang ? lang.toLowerCase() : undefined;\n}\n\nmodule.exports = getDeviceLanguage;\n","const\n\tm = require( '../moduleLoaderSingleton' ),\n\tgetDeviceLanguage = require( './getDeviceLanguage' ),\n\tOverlay = require( '../Overlay' ),\n\tpromisedView = require( '../promisedView' );\n\n/**\n * @ignore\n * @param {LanguageInfo} languageInfo\n * @param {boolean} showSuggestedLanguages If the suggested languages section\n * should be rendered.\n * @return {jQuery.Promise} Resolves to LanguageSearcher\n */\nfunction loadLanguageInfoSearcher( languageInfo, showSuggestedLanguages ) {\n\treturn mw.loader.using( 'mobile.languages.structured' ).then( () => languageInfo.getLanguages() ).then( ( data ) => {\n\t\tconst LanguageSearcher = m.require( 'mobile.languages.structured/LanguageSearcher' );\n\t\treturn new LanguageSearcher( {\n\t\t\tlanguages: data.languages,\n\t\t\tvariants: data.variants,\n\t\t\tshowSuggestedLanguages,\n\t\t\tdeviceLanguage: getDeviceLanguage( navigator )\n\t\t} );\n\n\t} );\n}\n\n/**\n * Factory function that returns a language info featured instance of an Overlay\n *\n * @ignore\n * @function\n * @memberof module:mobile.startup/languages\n * @param {module:mobile.startup/languages~LanguageInfo} languageInfo\n * @param {boolean} showSuggestedLanguages If the suggested languages section\n * should be rendered.\n * @return {module:mobile.startup/Overlay}\n */\nfunction languageInfoOverlay( languageInfo, showSuggestedLanguages ) {\n\treturn Overlay.make(\n\t\t{\n\t\t\theading: mw.msg( 'mobile-frontend-language-heading' ),\n\t\t\tclassName: 'overlay language-info-overlay'\n\t\t}, promisedView( loadLanguageInfoSearcher( languageInfo, showSuggestedLanguages ) )\n\t);\n}\n\n// To make knowing when async logic has resolved easier in tests\nlanguageInfoOverlay.test = {\n\tloadLanguageInfoSearcher\n};\n\nmodule.exports = languageInfoOverlay;\n","const\n\tm = require( '../moduleLoaderSingleton' ),\n\tgetDeviceLanguage = require( './getDeviceLanguage' ),\n\tOverlay = require( '../Overlay' ),\n\tMessageBox = require( '../MessageBox' ),\n\tcurrentPageHTMLParser = require( '../currentPageHTMLParser' )(),\n\tpromisedView = require( '../promisedView' );\n\n/**\n * @ignore\n * @return {jQuery.Promise} Resolves to LanguageSearcher\n */\nfunction loadLanguageSearcher() {\n\treturn mw.loader.using( 'mobile.languages.structured' ).then( () =>\n\t\tcurrentPageHTMLParser.getLanguages(\n\t\t\tmw.config.get( 'wgTitle' )\n\t\t) ).then( ( data ) => {\n\t\tconst LanguageSearcher = m.require( 'mobile.languages.structured/LanguageSearcher' );\n\n\t\treturn new LanguageSearcher( {\n\t\t\tlanguages: data.languages,\n\t\t\tvariants: data.variants,\n\t\t\tshowSuggestedLanguages: true,\n\t\t\tdeviceLanguage: getDeviceLanguage( navigator ),\n\t\t\t/**\n\t\t\t * Stable for use inside ContentTranslation.\n\t\t\t * @event ~'mobileFrontend.languageSearcher.onOpen'\n\t\t\t * @memberof Hooks\n\t\t\t * @param {Hooks~LanguageSearcher} searcher\n\t\t\t */\n\t\t\tonOpen: ( searcher ) => mw.hook( 'mobileFrontend.languageSearcher.onOpen' ).fire( searcher )\n\t\t} );\n\t}, () =>\n\t\tnew MessageBox( {\n\t\t\ttype: 'error',\n\t\t\tclassName: 'content',\n\t\t\tmsg: mw.msg( 'mobile-frontend-languages-structured-overlay-error' )\n\t\t} ) );\n}\n\n/**\n * Factory function that returns a language featured instance of an Overlay.\n *\n * @function\n * @memberof module:mobile.startup/languages\n * @return {module:mobile.startup/Overlay}\n */\nfunction languageOverlay() {\n\treturn Overlay.make(\n\t\t{\n\t\t\theading: mw.msg( 'mobile-frontend-language-heading' ),\n\t\t\tclassName: 'overlay language-overlay'\n\t\t}, promisedView( loadLanguageSearcher() )\n\t);\n}\n\n// To make knowing when async logic has resolved easier in tests\nlanguageOverlay.test = {\n\tloadLanguageSearcher\n};\n\nmodule.exports = languageOverlay;\n","/**\n * Internal for use inside Minerva only. See {@link module:mobile.startup} for access.\n *\n * @module mobile.startup/mediaViewer\n */\nconst m = require( '../moduleLoaderSingleton' ),\n\tpromisedView = require( '../promisedView' ),\n\tutil = require( '../util' ),\n\theader = require( '../headers' ).header,\n\ticons = require( '../icons' ),\n\tOverlay = require( '../Overlay' );\n\n/**\n * Produce an overlay for mediaViewer\n *\n * @name overlay\n * @memberof module:mobile.startup/mediaViewer\n * @param {Object} options\n * @return {module:mobile.startup/Overlay}\n */\nfunction mediaViewerOverlay( options ) {\n\tconst overlay = Overlay.make(\n\t\t{\n\t\t\theaders: [\n\t\t\t\theader( '', [], icons.cancel( 'gray' ) )\n\t\t\t],\n\t\t\tclassName: 'overlay media-viewer'\n\t\t},\n\t\tpromisedView(\n\t\t\tutil.Promise.all( [\n\t\t\t\tmw.loader.using( 'mobile.mediaViewer' )\n\t\t\t] ).then( () => {\n\t\t\t\tconst ImageCarousel = m.require( 'mobile.mediaViewer' ).ImageCarousel;\n\t\t\t\treturn new ImageCarousel( options );\n\t\t\t} )\n\t\t)\n\t);\n\n\treturn overlay;\n}\n\nmodule.exports = mediaViewerOverlay;\n","const currentPageHTMLParser = require( './currentPageHTMLParser' );\nconst time = require( './time' );\nconst LanguageInfo = require( './LanguageInfo' );\nconst currentPage = require( './currentPage' );\nconst Drawer = require( './Drawer' );\nconst CtaDrawer = require( './CtaDrawer' );\nconst lazyImageLoader = require( './lazyImages/lazyImageLoader' );\nconst icons = require( './icons' );\nconst PageHTMLParser = require( './PageHTMLParser' );\nconst showOnPageReload = require( './showOnPageReload' );\nconst OverlayManager = require( './OverlayManager' );\nconst View = require( './View' );\nconst Overlay = require( './Overlay' );\nconst references = require( './references/references' );\nconst search = {\n\tSearchOverlay: require( './search/SearchOverlay' ),\n\tSearchGateway: require( './search/SearchGateway' )\n};\nconst promisedView = require( './promisedView' );\nconst headers = require( './headers' );\nconst Skin = require( './Skin' );\nconst mediaViewer = {\n\toverlay: require( './mediaViewer/overlay' )\n};\nconst languageInfoOverlay = require( './languageOverlay/languageInfoOverlay' );\nconst languageOverlay = require( './languageOverlay/languageOverlay' );\nconst amcOutreach = require( './amcOutreach/amcOutreach' );\n\n// Expose chunk to temporary variable which will be deleted and exported via ResourceLoader\n// package inside mobile.startup.exports.\n\n/**\n * The main library for accessing MobileFrontend's stable APIs.\n *\n * @module mobile.startup\n */\nmw._mobileFrontend = {\n\t/**\n\t * Internal for use inside Minerva only\n\t *\n\t * @memberof module:mobile.startup\n\t * @type module:mobile.startup/AmcOutreach\n\t */\n\n\tamcOutreach,\n\t// Internal for use inside GrowthExperiments only.\n\toverlayHeader: headers.header,\n\t/**\n\t * Internal for use inside Minerva, GrowthExperiments only.\n\t * @type module:mobile.startup/Drawer\n\t */\n\tDrawer,\n\t// Internal for use inside Minerva only.\n\tCtaDrawer,\n\t/**\n\t * Internal for use inside Minerva, ExternalGuidance and Echo only.\n\t *\n\t * @memberof module:mobile.startup\n\t * @type module:mobile.startup/View\n\t */\n\tView,\n\t/**\n\t * Internal for use inside Minerva, ExternalGuidance,\n\t * GrowthExperiments and Echo only.\n\t *\n\t * @memberof module:mobile.startup\n\t * @type module:mobile.startup/Overlay\n\t */\n\tOverlay,\n\t/**\n\t * Internal for use inside Minerva only.\n\t *\n\t * @memberof module:mobile.startup\n\t * @type module:mobile.startup/PageHTMLParser\n\t */\n\tcurrentPageHTMLParser,\n\t/**\n\t * Internal for use inside Minerva, ExternalGuidance and Echo only.\n\t *\n\t * @memberof module:mobile.startup\n\t * @return {module:mobile.startup/OverlayManager}\n\t */\n\tgetOverlayManager: () => {\n\t\treturn OverlayManager.getSingleton();\n\t},\n\t/**\n\t * Internal for use inside Minerva only.\n\t * @type module:mobile.startup/Page\n\t * @memberof module:mobile.startup\n\t */\n\tcurrentPage,\n\t/**\n\t * Internal for use inside Minerva only.\n\t * @type module:mobile.startup/PageHTMLParser\n\t * @memberof module:mobile.startup\n\t */\n\tPageHTMLParser,\n\t/**\n\t * Internal for use inside Minerva only.\n\t * @type module:mobile.startup/Icon\n\t * @memberof module:mobile.startup\n\t */\n\tspinner: icons.spinner,\n\t/**\n\t * Internal for use inside Minerva only.\n\t *\n\t * @memberof module:mobile.startup\n\t * @type module:mobile.startup/mediaViewer\n\t */\n\tmediaViewer,\n\t/**\n\t * Internal for use inside Minerva only.\n\t *\n\t * @memberof module:mobile.startup\n\t * @type module:mobile.startup/references\n\t */\n\treferences,\n\t/**\n\t * Internal for use inside Minerva only.\n\t *\n\t * @memberof module:mobile.startup\n\t * @type module:mobile.startup/search\n\t */\n\tsearch,\n\t/**\n\t * Internal for use inside Minerva only.\n\t *\n\t * @memberof module:mobile.startup\n\t * @type module:mobile.startup/time\n\t */\n\ttime,\n\t// Internal for use inside Echo, GrowthExperiments only.\n\tpromisedView,\n\t/**\n\t * Loads all images on the page, stable to call.\n\t *\n\t * @memberof module:mobile.startup\n\t * @return {jQuery.Deferred}\n\t */\n\tloadAllImagesInPage: () => {\n\t\treturn lazyImageLoader.loadImages(\n\t\t\tlazyImageLoader.queryPlaceholders( document.getElementById( 'content' ) )\n\t\t);\n\t},\n\t/**\n\t * Show a notification on page reload, internal for Minerva\n\t *\n\t * @memberof module:mobile.startup\n\t * @param {string} msg\n\t * @return {jQuery.Deferred}\n\t */\n\tnotifyOnPageReload: ( msg ) => showOnPageReload( msg ),\n\t/**\n\t * Internal for use inside VisualEditor\n\t *\n\t * @memberof module:mobile.startup\n\t * @return {string|undefined}\n\t */\n\tlicense() {\n\t\tconst skin = Skin.getSingleton();\n\t\treturn skin.getLicenseMsg();\n\t},\n\t/**\n\t * Internal for use inside Minerva. See {@link module:mobile.startup} for access.\n\t *\n\t * @module mobile.startup/languages\n\t */\n\t/**\n\t * Access to language overlays for usage inside Minerva only.\n\t *\n\t * @memberof module:mobile.startup\n\t * @type module:mobile.startup/languages\n\t */\n\tlanguages: {\n\t\tlanguageOverlay,\n\t\t/**\n\t\t * Shows information about suggested languages.\n\t\t *\n\t\t * @memberof module:mobile.startup/languages\n\t\t * @param {mw.Api} api\n\t\t * @param {boolean} showSuggestedLanguage If the suggested languages section\n\t\t * should be rendered.\n\t\t */\n\t\tlanguageInfoOverlay( api, showSuggestedLanguage ) {\n\t\t\treturn languageInfoOverlay( new LanguageInfo( api ), showSuggestedLanguage );\n\t\t}\n\t}\n};\n","const\n\ticons = require( './icons' ),\n\tView = require( './View' );\n\n/**\n * Internal for use inside Echo, GrowthExperiments only.\n * It's a view that spins until the promise resolves!\n * If the promise successfully resolves, the newView will be shown. if the\n * promise rejects and rejects to a view, the errorView will be shown.\n *\n * @function promisedView\n * @memberof module:mobile.startup\n * @param {jQuery.Promise} promise\n * @return {module:mobile.startup/View}\n */\nmodule.exports = function promisedView( promise ) {\n\tconst view = new View( {\n\t\tclassName: 'promised-view'\n\t} );\n\tview.$el.append( icons.spinner().$el );\n\tpromise.then( ( newView ) => {\n\t\tview.$el.replaceWith( newView.$el );\n\t\t// update the internal reference.\n\t\tview.$el = newView.$el;\n\t}, ( errorView ) => {\n\t\tif ( !errorView || !errorView.$el ) {\n\t\t\t// return early to keep backwards compatibility with clients of\n\t\t\t// promisedView that do not reject to an error view\n\t\t\treturn;\n\t\t}\n\n\t\tview.$el.replaceWith( errorView.$el );\n\t\t// update the internal reference.\n\t\tview.$el = errorView.$el;\n\t} );\n\n\treturn view;\n};\n","/**\n * Abstract base class\n * Gateway for retrieving references\n *\n * @class module:mobile.startup/references~Gateway\n * @abstract\n *\n * @param {mw.Api} api\n */\nfunction ReferencesGateway( api ) {\n\tthis.api = api;\n}\n\n/**\n * Return the matched reference via API or DOM query\n *\n * @memberof module:mobile.startup/references~Gateway\n * @instance\n * @param {string} id CSS selector\n * @param {Page} page to find reference for\n * @param {module:mobile.startup/PageHTMLParser} pageHTMLParser\n * @return {jQuery.Promise} resolves with an Object representing reference\n * with a `text` property\n * The promise should be rejected with ReferenceGateway.ERROR_NOT_EXIST:\n * if the reference is not found.\n * If for some reason locating the reference fails return ReferenceGateway.ERROR_OTHER.\n */\nReferencesGateway.prototype.getReference = null;\n\n/**\n * ERROR_NOT_EXIST error code to be returned by getReference\n * when a reference does not exist.\n *\n * @memberof module:mobile.startup/references~Gateway\n * @type string\n */\nReferencesGateway.ERROR_NOT_EXIST = 'NOT_EXIST_ERROR';\n/**\n * ERROR_OTHER error code to be returned by getReference\n * under any other circumstance not covered\n * by ERROR_NOT_EXIST. It should be used if it is unclear whether a reference exists or not.\n *\n * @memberof module:mobile.startup/references~Gateway\n * @type string\n */\nReferencesGateway.ERROR_OTHER = 'OTHER_ERROR';\n\nmodule.exports = ReferencesGateway;\n","const ReferencesGateway = require( './ReferencesGateway' ),\n\tmfExtend = require( './../mfExtend' ),\n\tutil = require( './../util' );\n\n/**\n * Gateway for retrieving references via the content of the Page\n *\n * @class ReferencesHtmlScraperGateway\n * @memberof module:mobile.startup/references\n * @extends module:mobile.startup/references~Gateway\n * @inheritdoc\n */\nfunction ReferencesHtmlScraperGateway() {\n\tReferencesGateway.apply( this, arguments );\n}\n\nmfExtend( ReferencesHtmlScraperGateway, ReferencesGateway, {\n\t/**\n\t * @memberof ReferencesHtmlScraperGateway\n\t * @property EXTERNAL_LINK_CLASS a CSS class to place on external links\n\t * in addition to the default 'external' class.\n\t */\n\tEXTERNAL_LINK_CLASS: 'external--reference',\n\t/**\n\t * @memberof ReferencesHtmlScraperGateway\n\t * @instance\n\t * @param {string} id ID of a DOM element in the page.\n\t * @param {jQuery.Object} $container to scan for an element\n\t * @return {jQuery.Promise} that can be used by getReference\n\t */\n\tgetReferenceFromContainer( id, $container ) {\n\t\tconst result = util.Deferred();\n\n\t\tconst $el = $container.find( '#' + util.escapeSelector( id ) );\n\t\tif ( $el.length ) {\n\t\t\tlet $parent;\n\n\t\t\t// This finds either the inner <ol class=\"mw-extended-references\">, or the outer\n\t\t\t// <ol class=\"references\">\n\t\t\tconst $ol = $el.closest( 'ol' );\n\t\t\tconst isSubref = $ol.hasClass( 'mw-extended-references' );\n\t\t\tif ( isSubref ) {\n\t\t\t\t$parent = $ol.parent();\n\t\t\t}\n\t\t\t// The following classes are used here:\n\t\t\t// * external--reference\n\t\t\t// * other values of EXTERNAL_LINK_CLASS in sub-classes\n\t\t\t( $parent || $el ).find( '.external' ).addClass( this.EXTERNAL_LINK_CLASS );\n\t\t\tresult.resolve( {\n\t\t\t\ttext: this.getReferenceHtml( $el ),\n\t\t\t\tparentText: this.getReferenceHtml( $parent ),\n\t\t\t\tisSubref\n\t\t\t} );\n\t\t} else {\n\t\t\tresult.reject( ReferencesGateway.ERROR_NOT_EXIST );\n\t\t}\n\t\treturn result.promise();\n\t},\n\t/**\n\t * @memberof ReferencesHtmlScraperGateway\n\t * @param {jQuery.Object|undefined} $reference\n\t * @return {string|undefined}\n\t */\n\tgetReferenceHtml( $reference ) {\n\t\treturn $reference ?\n\t\t\t$reference.children( '.mw-reference-text, .reference-text' ).first().html() :\n\t\t\t'';\n\t},\n\t/**\n\t * @inheritdoc\n\t * @memberof ReferencesHtmlScraperGateway\n\t * @instance\n\t * @param {string} hash Hash fragment with leading '#'\n\t * @param {Page} page (unused)\n\t * @param {module:mobile.startup/PageHTMLParser} pageHTMLParser\n\t */\n\tgetReference( hash, page, pageHTMLParser ) {\n\t\tconst id = mw.util.percentDecodeFragment( hash.slice( 1 ) );\n\t\t// If an id is not found it's possible the id passed needs decoding (per T188547).\n\t\treturn this.getReferenceFromContainer( id, pageHTMLParser.$el.find( 'ol.references' ) );\n\t}\n} );\n\nmodule.exports = ReferencesHtmlScraperGateway;\n","const Drawer = require( '../Drawer' ),\n\tutil = require( '../util' ),\n\ticons = require( '../icons' ),\n\tReferencesGateway = require( './ReferencesGateway' ),\n\tIcon = require( '../Icon' ),\n\tReferencesHtmlScraperGateway = require( './ReferencesHtmlScraperGateway' ),\n\tIconButton = require( '../IconButton' );\n\n/**\n * Create a callback for clicking references\n *\n * @ignore\n * @param {Function} onNestedReferenceClick\n * @return {Function}\n */\nfunction makeOnNestedReferenceClickHandler( onNestedReferenceClick ) {\n\treturn ( ev ) => {\n\t\tconst target = ev.currentTarget.querySelector( 'a' );\n\t\tif ( target ) {\n\t\t\tonNestedReferenceClick(\n\t\t\t\ttarget.getAttribute( 'href' ),\n\t\t\t\ttarget.textContent\n\t\t\t);\n\t\t\t// Don't hide the already shown drawer via propagation\n\t\t\treturn false;\n\t\t}\n\t};\n}\n\n/**\n * Drawer for references\n *\n * @memberof module:mobile.startup/references\n * @uses IconButton\n * @param {Object} props\n * @param {boolean} [props.error] whether an error has occurred\n * @param {string} props.title of reference e.g [1]\n * @param {string} props.text is the HTML of the reference\n * @param {string} [props.parentText] is the HTML of the parent reference if there is one\n * @param {boolean} props.isSubref true when this reference has a parent\n * @param {Function} [props.onNestedReferenceClick] callback for when a reference\n * inside the reference is clicked.\n * @return {module:mobile.startup/Drawer}\n */\nfunction referenceDrawer( props ) {\n\tconst errorIcon = props.error ? new IconButton( {\n\t\tname: 'error',\n\t\tisSmall: true\n\t} ).$el : null;\n\n\tconst mainRef = props.isSubref ? props.parentText : props.text;\n\tconst mainRefHtml = util.parseHTML( '<div>' )\n\t\t.addClass( 'main-reference-content' )\n\t\t.html( mainRef );\n\tif ( !mainRef ) {\n\t\tmainRefHtml.append( icons.spinner().$el );\n\t}\n\tconst subRefHtml = props.isSubref ?\n\t\tutil.parseHTML( '<div>' ).html( props.text ) : '';\n\n\treturn new Drawer(\n\t\tutil.extend(\n\t\t\t{\n\t\t\t\tshowCollapseIcon: false,\n\t\t\t\tclassName: 'drawer position-fixed text references-drawer',\n\t\t\t\tevents: {\n\t\t\t\t\t'click sup a': function ( ev ) {\n\t\t\t\t\t\t// Stop default scroll to hash fragment behaviour.\n\t\t\t\t\t\tev.preventDefault();\n\t\t\t\t\t},\n\t\t\t\t\t'click sup': props.onNestedReferenceClick &&\n\t\t\t\t\t\tmakeOnNestedReferenceClickHandler( props.onNestedReferenceClick )\n\t\t\t\t},\n\t\t\t\tchildren: [\n\t\t\t\t\tutil.parseHTML( '<div>' )\n\t\t\t\t\t\t.addClass( 'references-drawer__header' )\n\t\t\t\t\t\t.append( [\n\t\t\t\t\t\t\tnew Icon( {\n\t\t\t\t\t\t\t\ticon: 'reference',\n\t\t\t\t\t\t\t\tisSmall: true\n\t\t\t\t\t\t\t} ).$el,\n\t\t\t\t\t\t\tutil.parseHTML( '<span>' ).addClass( 'references-drawer__title' ).text( mw.msg( 'mobile-frontend-references-citation' ) ),\n\t\t\t\t\t\t\ticons.cancel( 'gray', {\n\t\t\t\t\t\t\t\tisSmall: true,\n\t\t\t\t\t\t\t\tadditionalClassNames: 'mf-button-flush-right'\n\t\t\t\t\t\t\t} ).$el\n\t\t\t\t\t\t] ),\n\n\t\t\t\t\t// Add .mw-parser-output so that TemplateStyles styles apply (T244510)\n\t\t\t\t\tutil.parseHTML( '<div>' ).addClass( 'mw-parser-output' ).append( [\n\t\t\t\t\t\terrorIcon,\n\t\t\t\t\t\tutil.parseHTML( '<sup>' ).text( props.title ),\n\t\t\t\t\t\tmainRefHtml,\n\t\t\t\t\t\tsubRefHtml\n\t\t\t\t\t] )\n\t\t\t\t]\n\t\t\t},\n\t\t\tprops\n\t\t)\n\t);\n}\n\n/**\n * Internal for use inside Minerva only. See {@link module:mobile.startup} for access.\n *\n * @exports module:mobile.startup/references\n */\nconst references = {\n\ttest: {\n\t\tmakeOnNestedReferenceClickHandler\n\t},\n\tReferencesHtmlScraperGateway,\n\treferenceDrawer,\n\t/**\n\t * Fetch and render nested reference upon click\n\t *\n\t * @param {string} id of the reference to be retrieved\n\t * @param {Page} page to locate reference for\n\t * @param {string} refNumber the number it identifies as in the page\n\t * @param {module:mobile.startup/PageHTMLParser} pageHTMLParser\n\t * @param {module:mobile.startup/references~Gateway} gateway\n\t * @param {Object} props for referenceDrawer\n\t * @param {Function} onShowNestedReference function call when a nested reference is triggered.\n\t * @return {jQuery.Deferred}\n\t */\n\tshowReference( id, page, refNumber, pageHTMLParser, gateway, props,\n\t\tonShowNestedReference\n\t) {\n\t\treturn gateway.getReference( id, page, pageHTMLParser ).then( ( reference ) => {\n\t\t\tconst drawer = referenceDrawer( util.extend( {\n\t\t\t\ttitle: refNumber,\n\t\t\t\ttext: reference.text,\n\t\t\t\tparentText: reference.parentText,\n\t\t\t\tisSubref: reference.isSubref,\n\t\t\t\tonNestedReferenceClick( href, text ) {\n\t\t\t\t\treferences.showReference(\n\t\t\t\t\t\thref,\n\t\t\t\t\t\tpage,\n\t\t\t\t\t\ttext,\n\t\t\t\t\t\tpageHTMLParser,\n\t\t\t\t\t\tgateway\n\t\t\t\t\t).then( ( nestedDrawer ) => {\n\t\t\t\t\t\tif ( props.onShowNestedReference ) {\n\t\t\t\t\t\t\tonShowNestedReference( drawer, nestedDrawer );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tmw.log.warn( 'Please provide onShowNestedReferences parameter.' );\n\t\t\t\t\t\t\tdocument.body.appendChild( nestedDrawer.$el[0] );\n\t\t\t\t\t\t\tdrawer.hide();\n\t\t\t\t\t\t\tnestedDrawer.show();\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t}, props ) );\n\t\t\treturn drawer;\n\t\t}, ( err ) => {\n\t\t\t// If non-existent reference nothing to do.\n\t\t\tif ( err === ReferencesGateway.ERROR_NOT_EXIST ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\treturn referenceDrawer( {\n\t\t\t\terror: true,\n\t\t\t\ttitle: refNumber,\n\t\t\t\ttext: mw.msg( 'mobile-frontend-references-citation-error' )\n\t\t\t} );\n\t\t} );\n\t}\n};\n\nmodule.exports = references;\n","/**\n * Internal for use inside Minerva only. See {@link module:mobile.startup} for access.\n *\n * @module module:mobile.startup/search\n */\nconst\n\tpageJSONParser = require( '../page/pageJSONParser' ),\n\tutil = require( '../util' ),\n\textendSearchParams = require( '../extendSearchParams' );\n\n/**\n * Interact with MediaWiki search API.\n *\n * @memberof module:mobile.startup/search\n * @uses mw.Api\n * @param {mw.Api} api\n */\nfunction SearchGateway( api ) {\n\tthis.api = api;\n\tthis.searchCache = {};\n\tthis.generator = mw.config.get( 'wgMFSearchGenerator' );\n}\n\nSearchGateway.prototype = {\n\t/**\n\t * The namespace to search in.\n\t *\n\t * @memberof SearchGateway\n\t * @instance\n\t * @type {number}\n\t */\n\tsearchNamespace: 0,\n\n\t/**\n\t * Get the data used to do the search query api call.\n\t *\n\t * @memberof SearchGateway\n\t * @instance\n\t * @param {string} query to search for\n\t * @return {Object}\n\t */\n\tgetApiData( query ) {\n\t\tconst prefix = this.generator.prefix,\n\t\t\tdata = extendSearchParams( 'search', {\n\t\t\t\tgenerator: this.generator.name\n\t\t\t} );\n\n\t\tdata.redirects = '';\n\n\t\tdata['g' + prefix + 'search'] = query;\n\t\tdata['g' + prefix + 'namespace'] = this.searchNamespace;\n\t\tdata['g' + prefix + 'limit'] = 15;\n\n\t\t// If PageImages is being used configure further.\n\t\tif ( data.pilimit ) {\n\t\t\tdata.pilimit = 15;\n\t\t\tdata.pithumbsize = mw.config.get( 'wgMFThumbnailSizes' ).tiny;\n\t\t}\n\t\treturn data;\n\t},\n\n\t/**\n\t * Escapes regular expression wildcards (metacharacters) by adding a \\\\ prefix\n\t *\n\t * @memberof SearchGateway\n\t * @instance\n\t * @param {string} str a string\n\t * @return {Object} a regular expression that can be used to search for that str\n\t * @private\n\t */\n\t_createSearchRegEx( str ) {\n\t\t// '\\[' can be unescaped, but leave it balanced with '`]'\n\t\t// eslint-disable-next-line no-useless-escape\n\t\tstr = str.replace( /[-\\[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&' );\n\t\treturn new RegExp( '^(' + str + ')', 'ig' );\n\t},\n\n\t/**\n\t * Takes a label potentially beginning with term\n\t * and highlights term if it is present with strong\n\t *\n\t * @memberof SearchGateway\n\t * @instance\n\t * @param {string} label a piece of text\n\t * @param {string} term a string to search for from the start\n\t * @return {string} safe html string with matched terms encapsulated in strong tags\n\t * @private\n\t */\n\t_highlightSearchTerm( label, term ) {\n\t\tlabel = util.parseHTML( '<span>' ).text( label ).html();\n\t\tterm = term.trim();\n\t\tterm = util.parseHTML( '<span>' ).text( term ).html();\n\n\t\treturn label.replace( this._createSearchRegEx( term ), '<strong>$1</strong>' );\n\t},\n\n\t/**\n\t * Return data used for creating {Page} objects\n\t *\n\t * @memberof SearchGateway\n\t * @instance\n\t * @param {string} query to search for\n\t * @param {Object} pageInfo from the API\n\t * @return {Object} data needed to create a {Page}\n\t * @private\n\t */\n\t_getPage( query, pageInfo ) {\n\t\tconst page = pageJSONParser.parse( pageInfo );\n\n\t\t// If displaytext is set in the generator result (eg. by Wikibase),\n\t\t// use that as display title.\n\t\t// Otherwise default to the page's title.\n\t\t// FIXME: Given that displayTitle could have html in it be safe and just highlight text.\n\t\t// Note that highlightSearchTerm does full HTML escaping before highlighting.\n\t\tpage.displayTitle = this._highlightSearchTerm(\n\t\t\tpageInfo.displaytext ? pageInfo.displaytext : page.title,\n\t\t\tquery\n\t\t);\n\t\tpage.index = pageInfo.index;\n\n\t\treturn page;\n\t},\n\n\t/**\n\t * Process the data returned by the api call.\n\t *\n\t * @memberof SearchGateway\n\t * @instance\n\t * @param {string} query to search for\n\t * @param {Object} data from api\n\t * @return {Array}\n\t * @private\n\t */\n\t_processData( query, data ) {\n\t\tconst self = this;\n\n\t\tlet results = [];\n\n\t\tif ( data.query ) {\n\n\t\t\tresults = data.query.pages || {};\n\t\t\tresults = Object.keys( results ).map( ( id ) => self._getPage( query, results[id] ) );\n\t\t\t// sort in order of index\n\t\t\tresults.sort( ( a, b ) => a.index - b.index );\n\t\t}\n\n\t\treturn results;\n\t},\n\n\t/**\n\t * Perform a search for the given query.\n\t *\n\t * @memberof SearchGateway\n\t * @instance\n\t * @param {string} query to search for\n\t * @return {jQuery.Deferred}\n\t */\n\tsearch( query ) {\n\t\tconst scriptPath = mw.config.get( 'wgMFScriptPath' ),\n\t\t\tself = this;\n\n\t\tif ( !this.isCached( query ) ) {\n\t\t\tconst xhr = this.api.get( this.getApiData( query ), scriptPath ? {\n\t\t\t\turl: scriptPath\n\t\t\t} : undefined );\n\t\t\tconst request = xhr\n\t\t\t\t.then( ( data, jqXHR ) => {\n\t\t\t\t\t// resolve the Deferred object\n\t\t\t\t\treturn {\n\t\t\t\t\t\tquery,\n\t\t\t\t\t\tresults: self._processData( query, data ),\n\t\t\t\t\t\tsearchId: jqXHR && jqXHR.getResponseHeader( 'x-search-id' )\n\t\t\t\t\t};\n\t\t\t\t}, () => {\n\t\t\t\t\t// reset cached result, it maybe contains no value\n\t\t\t\t\tself.searchCache[query] = undefined;\n\t\t\t\t} );\n\n\t\t\t// cache the result to prevent the execution of one search query twice\n\t\t\t// in one session\n\t\t\tthis.searchCache[query] = request.promise( {\n\t\t\t\tabort() {\n\t\t\t\t\txhr.abort();\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\treturn this.searchCache[query];\n\t},\n\n\t/**\n\t * Check if the search has already been performed in given session.\n\t *\n\t * @memberof SearchGateway\n\t * @instance\n\t * @param {string} query\n\t * @return {boolean}\n\t */\n\tisCached( query ) {\n\t\treturn Boolean( this.searchCache[query] );\n\t}\n};\n\nmodule.exports = SearchGateway;\n","const util = require( '../util' ),\n\tView = require( '../View' ),\n\tIconButton = require( '../IconButton' );\n\n/**\n * @extends module:mobile.startup/View\n */\nclass SearchHeaderView extends View {\n\t/**\n\t * constructor\n\t *\n\t * @inheritdoc\n\t * @param {Object} props\n\t * @param {Function} props.onInput executed every time input changes\n\t * @param {string} props.placeholderMsg\n\t * @param {string} props.action\n\t * @parm {string} [props.autocapitalize] none or sentences\n\t * @param {string} [props.searchTerm] default\n\t */\n\tconstructor( props ) {\n\t\tsuper(\n\t\t\tutil.extend( {\n\t\t\t\tautocapitalize: 'sentences'\n\t\t\t}, props, {\n\t\t\t\tevents: {\n\t\t\t\t\t'input input': 'onInput'\n\t\t\t\t}\n\t\t\t} )\n\t\t);\n\t}\n\n\t/** @inheritdoc */\n\tonInput( ev ) {\n\t\tconst query = ev.target.value;\n\t\tthis.options.onInput( query );\n\t\tif ( query ) {\n\t\t\tthis.clearIcon.$el.show();\n\t\t} else {\n\t\t\tthis.clearIcon.$el.hide();\n\t\t}\n\t}\n\n\t/** @inheritdoc */\n\tget isTemplateMode() {\n\t\treturn true;\n\t}\n\n\t/** @inheritdoc */\n\tget template() {\n\t\treturn util.template( `<div class=\"overlay-title search-header-view\">\n\t\t<form method=\"get\" action=\"{{action}}\" class=\"search-box\">\n\t\t<input class=\"search mf-icon-search\" type=\"search\" name=\"search\"\n\t\t\tautocapitalize=\"{{autocapitalize}}\"\n\t\t\tautocomplete=\"off\" placeholder=\"{{placeholderMsg}}\" aria-label=\"{{placeholderMsg}}\" value=\"{{searchTerm}}\">\n\t\t<input type=\"hidden\" name=\"title\" value=\"{{defaultSearchPage}}\">\n\t\t</form>\n</div>` );\n\t}\n\n\t/** @inheritdoc */\n\tpostRender() {\n\t\tconst clearIcon = new IconButton( {\n\t\t\ttagName: 'button',\n\t\t\ticon: 'clear',\n\t\t\tsize: 'medium',\n\t\t\tisSmall: true,\n\t\t\tlabel: mw.msg( 'mobile-frontend-clear-search' ),\n\t\t\tadditionalClassNames: 'clear',\n\t\t\tevents: {\n\t\t\t\tclick: function () {\n\t\t\t\t\tthis.$el.find( 'input' ).val( '' ).trigger( 'focus' );\n\t\t\t\t\tthis.options.onInput( '' );\n\t\t\t\t\tclearIcon.$el.hide();\n\t\t\t\t\t// In beta the clear button is on top of the search input.\n\t\t\t\t\t// Stop propagation so that the input doesn't receive the click.\n\t\t\t\t\treturn false;\n\t\t\t\t}.bind( this )\n\t\t\t}\n\t\t} );\n\t\tthis.clearIcon = clearIcon;\n\t\tclearIcon.$el.hide();\n\t\tclearIcon.$el.attr( 'aria-hidden', 'true' );\n\t\tthis.$el.find( 'form' ).append( clearIcon.$el );\n\t}\n}\n\nmodule.exports = SearchHeaderView;\n","const\n\tmfExtend = require( '../mfExtend' ),\n\tOverlay = require( '../Overlay' ),\n\tutil = require( '../util' ),\n\tsearchHeader = require( './searchHeader' ),\n\tSearchResultsView = require( './SearchResultsView' ),\n\tWatchstarPageList = require( '../watchstar/WatchstarPageList' ),\n\tSEARCH_DELAY = 300,\n\tSEARCH_SPINNER_DELAY = 2000;\n\n/**\n * Overlay displaying search results\n *\n * @class SearchOverlay\n * @memberof module:mobile.startup/search\n * @extends Overlay\n * @uses SearchGateway\n * @uses IconButton\n *\n * @param {Object} params Configuration options\n * @param {string} params.placeholderMsg Search input placeholder text.\n * @param {string} [params.action] of form defaults to the value of wgScript\n * @param {string} [params.defaultSearchPage] The default search page e.g. Special:Search\n * @param {SearchGateway} [params.gateway]\n */\nfunction SearchOverlay( params ) {\n\tconst header = searchHeader(\n\t\t\tparams.placeholderMsg,\n\t\t\tparams.action || mw.config.get( 'wgScript' ),\n\t\t\t( query ) => this.performSearch( query ),\n\t\t\tparams.defaultSearchPage || '',\n\t\t\tparams.autocapitalize\n\t\t),\n\t\toptions = util.extend( true, {\n\t\t\theaderChrome: true,\n\t\t\tisBorderBox: false,\n\t\t\tclassName: 'overlay search-overlay',\n\t\t\theaders: [ header ],\n\t\t\tevents: {\n\t\t\t\t'click .search-content': 'onClickSearchContent',\n\t\t\t\t'click .overlay-content': 'onClickOverlayContent',\n\t\t\t\t'click .overlay-content > div': function ( ev ) {\n\t\t\t\t\tev.stopPropagation();\n\t\t\t\t},\n\t\t\t\t'touchstart .results': 'hideKeyboardOnScroll',\n\t\t\t\t'mousedown .results': 'hideKeyboardOnScroll',\n\t\t\t\t'click .results a': 'onClickResult'\n\t\t\t}\n\t\t},\n\t\tparams );\n\n\tthis.header = header;\n\tOverlay.call( this, options );\n\n\tthis.api = options.api;\n\t// eslint-disable-next-line new-cap\n\tthis.gateway = options.gateway || new options.gatewayClass( this.api );\n\n\tthis.router = options.router;\n\n\tthis.currentSearchId = null;\n}\n\nmfExtend( SearchOverlay, Overlay, {\n\n\t/**\n\t * Initialize 'search within pages' functionality\n\t *\n\t * @memberof SearchOverlay\n\t * @instance\n\t */\n\tonClickSearchContent() {\n\t\tconst\n\t\t\t$form = this.$el.find( 'form' ),\n\t\t\t$el = $form[0].parentNode;\n\n\t\t// Add fulltext input to force fulltext search\n\t\tthis.parseHTML( '<input>' )\n\t\t\t.attr( {\n\t\t\t\ttype: 'hidden',\n\t\t\t\tname: 'fulltext',\n\t\t\t\tvalue: 'search'\n\t\t\t} )\n\t\t\t.appendTo( $form );\n\t\t// history.back queues a task so might run after this call. Thus we use setTimeout\n\t\t// http://www.w3.org/TR/2011/WD-html5-20110113/webappapis.html#queue-a-task\n\t\tsetTimeout( () => {\n\t\t\t// Firefox doesn't allow submission of a form not in the DOM\n\t\t\t// so temporarily re-add it if it's gone.\n\t\t\tif ( !$form[0].parentNode ) {\n\t\t\t\t$form.appendTo( $el );\n\t\t\t}\n\t\t\t$form.trigger( 'submit' );\n\t\t}, 0 );\n\t},\n\n\t/**\n\t * Tapping on background only should hide the overlay\n\t *\n\t * @memberof SearchOverlay\n\t * @instance\n\t */\n\tonClickOverlayContent() {\n\t\tthis.$el.find( '.cancel' ).trigger( 'click' );\n\t},\n\n\t/**\n\t * Hide the keyboard when scrolling starts (avoid weird situation when\n\t * user taps on an item, the keyboard hides and wrong item is clicked).\n\t *\n\t * @memberof SearchOverlay\n\t * @instance\n\t */\n\thideKeyboardOnScroll() {\n\t\tthis.$input.trigger( 'blur' );\n\t},\n\n\t/**\n\t * Handle the user clicking a result.\n\t *\n\t * @memberof SearchOverlay\n\t * @instance\n\t * @param {jQuery.Event} ev\n\t */\n\tonClickResult( ev ) {\n\t\tconst\n\t\t\tself = this,\n\t\t\t$link = this.$el.find( ev.currentTarget );\n\t\t/**\n\t\t * Fired when the user clicks a search result\n\t\t *\n\t\t * @type {Object}\n\t\t * @property {jQuery.Object} result The jQuery-wrapped DOM element that\n\t\t * the user clicked\n\t\t * @property {number} resultIndex The zero-based index of the\n\t\t * result in the set of results\n\t\t * @property {jQuery.Event} originalEvent The original event\n\t\t */\n\t\t// FIXME: ugly hack that removes search from browser history\n\t\t// when navigating to search results\n\t\tev.preventDefault();\n\t\tthis.router.back().then( function () {\n\t\t\t// T308288: Appends the current search id as a url param on clickthroughs\n\t\t\tif ( this.currentSearchId ) {\n\t\t\t\tconst clickUrl = new URL( location.href );\n\t\t\t\tclickUrl.searchParams.set( 'searchToken', this.currentSearchId );\n\t\t\t\tself.router.navigateTo( document.title, {\n\t\t\t\t\tpath: clickUrl.toString(),\n\t\t\t\t\tuseReplaceState: true\n\t\t\t\t} );\n\t\t\t\tthis.currentSearchId = null;\n\t\t\t}\n\t\t\t// Router.navigate does not support changing href.\n\t\t\t// FIXME: Needs upstream change T189173\n\t\t\t// eslint-disable-next-line no-restricted-properties\n\t\t\twindow.location.href = $link.attr( 'href' );\n\t\t} );\n\t},\n\n\t/**\n\t * @inheritdoc\n\t * @memberof SearchOverlay\n\t * @instance\n\t */\n\tpostRender() {\n\t\tconst self = this,\n\t\t\tsearchResults = new SearchResultsView( {\n\t\t\t\tsearchContentLabel: mw.msg( 'mobile-frontend-search-content' ),\n\t\t\t\tnoResultsMsg: mw.msg( 'mobile-frontend-search-no-results' ),\n\t\t\t\tsearchContentNoResultsMsg: mw.message( 'mobile-frontend-search-content-no-results' ).parse()\n\t\t\t} );\n\t\tlet timer;\n\n\t\tthis.$el.find( '.overlay-content' ).append( searchResults.$el );\n\t\tOverlay.prototype.postRender.call( this );\n\n\t\t// FIXME: `this.$input` should not be set. Isolate to searchHeader function\n\t\tthis.$input = this.$el.find( this.header ).find( 'input' );\n\t\t// FIXME: `this.$searchContent` should not be set. Isolate to SearchResultsView class.\n\t\tthis.$searchContent = searchResults.$el.hide();\n\t\t// FIXME: `this.$resultContainer` should not be set. Isolate to SearchResultsView class.\n\t\tthis.$resultContainer = searchResults.$el.find( '.results-list-container' );\n\n\t\t// On iOS a touchstart event while the keyboard is open will result in a scroll\n\t\t// leading to an accidental click (T299846)\n\t\t// Stopping propagation when the input is focused will prevent scrolling while\n\t\t// the keyboard is collapsed.\n\t\tthis.$resultContainer[0].addEventListener( 'touchstart', ( ev ) => {\n\t\t\tif ( document.activeElement === this.$input[0] ) {\n\t\t\t\tev.stopPropagation();\n\t\t\t}\n\t\t} );\n\n\t\t/**\n\t\t * Hide the spinner and abort timed spinner shows.\n\t\t * FIXME: Given this manipulates SearchResultsView this should be moved into that class\n\t\t */\n\t\tfunction clearSearch() {\n\t\t\tself.$spinner.hide();\n\t\t\tclearTimeout( timer );\n\t\t}\n\n\t\t// Show a spinner on top of search results\n\t\t// FIXME: Given this manipulates SearchResultsView this should be moved into that class\n\t\tthis.$spinner = searchResults.$el.find( '.spinner-container' );\n\t\tthis.on( 'search-start', ( searchData ) => {\n\t\t\tif ( timer ) {\n\t\t\t\tclearSearch();\n\t\t\t}\n\t\t\ttimer = setTimeout( () => self.$spinner.show(),\n\t\t\t\tSEARCH_SPINNER_DELAY - searchData.delay );\n\t\t} );\n\t\tthis.on( 'search-results', clearSearch );\n\t},\n\n\t/**\n\t * Trigger a focus() event on search input in order to\n\t * bring up the virtual keyboard.\n\t *\n\t * @memberof SearchOverlay\n\t * @instance\n\t */\n\tshowKeyboard() {\n\t\tconst len = this.$input.val().length;\n\t\tthis.$input.trigger( 'focus' );\n\t\t// Cursor to the end of the input\n\t\tif ( this.$input[0].setSelectionRange ) {\n\t\t\tthis.$input[0].setSelectionRange( len, len );\n\t\t}\n\t},\n\n\t/**\n\t * @inheritdoc\n\t * @memberof SearchOverlay\n\t * @instance\n\t */\n\tshow() {\n\t\t// Overlay#show defines the actual overlay visibility.\n\t\tOverlay.prototype.show.apply( this, arguments );\n\n\t\tthis.showKeyboard();\n\t},\n\n\t/**\n\t * Perform search and render results inside current view.\n\t * FIXME: Much of the logic for caching and pending queries inside this function should\n\t * actually live in SearchGateway, please move out.\n\t *\n\t * @memberof SearchOverlay\n\t * @instance\n\t * @param {string} query\n\t */\n\tperformSearch( query ) {\n\t\tconst\n\t\t\tself = this,\n\t\t\tapi = this.api,\n\t\t\tdelay = this.gateway.isCached( query ) ? 0 : SEARCH_DELAY;\n\n\t\t// it seems the input event can be fired when virtual keyboard is closed\n\t\t// (Chrome for Android)\n\t\tif ( query !== this.lastQuery ) {\n\t\t\tif ( self._pendingQuery ) {\n\t\t\t\tself._pendingQuery.abort();\n\t\t\t}\n\t\t\tclearTimeout( this.timer );\n\n\t\t\tif ( query.length ) {\n\t\t\t\tthis.timer = setTimeout( () => {\n\t\t\t\t\tconst xhr = self.gateway.search( query );\n\t\t\t\t\tself._pendingQuery = xhr.then( function ( data ) {\n\t\t\t\t\t\tthis.currentSearchId = data.searchId;\n\t\t\t\t\t\t// FIXME: Given this manipulates SearchResultsView\n\t\t\t\t\t\t// this should be moved into that class\n\t\t\t\t\t\t// check if we're getting the rights response in case of out of\n\t\t\t\t\t\t// order responses (need to get the current value of the input)\n\t\t\t\t\t\tif ( data && data.query === self.$input.val() ) {\n\t\t\t\t\t\t\tself.$el.toggleClass( 'no-results', data.results.length === 0 );\n\t\t\t\t\t\t\tself.$searchContent\n\t\t\t\t\t\t\t\t.show()\n\t\t\t\t\t\t\t\t.find( 'p' )\n\t\t\t\t\t\t\t\t.hide()\n\t\t\t\t\t\t\t\t.filter( data.results.length ? '.with-results' : '.without-results' )\n\t\t\t\t\t\t\t\t.show();\n\n\t\t\t\t\t\t\t// eslint-disable-next-line no-new\n\t\t\t\t\t\t\tnew WatchstarPageList( {\n\t\t\t\t\t\t\t\tapi,\n\t\t\t\t\t\t\t\tfunnel: 'search',\n\t\t\t\t\t\t\t\tpages: data.results,\n\t\t\t\t\t\t\t\tel: self.$resultContainer\n\t\t\t\t\t\t\t} );\n\n\t\t\t\t\t\t\tself.$results = self.$resultContainer.find( 'li' );\n\t\t\t\t\t\t}\n\t\t\t\t\t} ).promise( {\n\t\t\t\t\t\tabort() {\n\t\t\t\t\t\t\txhr.abort();\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t}, delay );\n\t\t\t} else {\n\t\t\t\tself.resetSearch();\n\t\t\t}\n\n\t\t\tthis.lastQuery = query;\n\t\t}\n\t},\n\t/**\n\t * Clear results\n\t *\n\t * @private\n\t */\n\tresetSearch() {\n\t\tthis.$el.find( '.overlay-content' ).children().hide();\n\t}\n} );\n\nmodule.exports = SearchOverlay;\n","const View = require( '../View' ),\n\tIcon = require( '../Icon' ),\n\tAnchor = require( '../Anchor' ),\n\ticons = require( '../icons' ),\n\t$spinner = icons.spinner().$el,\n\tutil = require( '../util' );\n\n/**\n * Render search results.\n *\n * @extends module:mobile.startup/View\n * @param {Object} options\n * @param {string} options.searchContentLabel actionable label to tell the user they can \"search\n * within pages rather than doing a full text search\n * @param {string} options.noResultsMsg shows when no results displayed\n * @param {string} options.searchContentNoResultsMsg alternative to options.searchContentLabel that\n * shows when no search results have been displayed.\n */\nclass SearchResultsView extends View {\n\t/** @inheritdoc */\n\tget isTemplateMode() {\n\t\treturn true;\n\t}\n\n\t/** @inheritdoc */\n\tget template() {\n\t\treturn util.template( `\n<div class=\"search-results-view\">\n\t<div class=\"search-content\">\n\t\t<div class=\"caption\">\n\t\t\t<p class=\"with-results\">{{searchContentLabel}}</p>\n\t\t\t<p class=\"without-results\">{{noResultsMsg}}</p>\n\t\t\t<p class=\"without-results\">{{{searchContentNoResultsMsg}}}</p>\n\t\t</div>\n\t</div>\n\t<div class=\"spinner-container position-fixed\"></div>\n\t<div class=\"results\">\n\t\t<div class=\"results-list-container\"></div>\n\t\t{{#feedback}}\n\t\t\t<div class=\"search-feedback\">\n\t\t\t\t{{prompt}}\n\t\t\t</div>\n\t\t{{/feedback}}\n\t</div>\n</div>`\n\t\t);\n\t}\n\n\t/** @inheritdoc */\n\tpreRender() {\n\t\tconst feedbackLink = mw.config.get( 'wgCirrusSearchFeedbackLink' );\n\t\tif ( feedbackLink ) {\n\t\t\tthis.options.feedback = {\n\t\t\t\tprompt: mw.msg( 'mobile-frontend-search-feedback-prompt' ) };\n\t\t}\n\t}\n\n\t/** @inheritdoc */\n\tpostRender( options ) {\n\t\tconst feedbackLink = mw.config.get( 'wgCirrusSearchFeedbackLink' );\n\t\tsuper.postRender( options );\n\t\tthis.$el.find( '.search-content' ).prepend(\n\t\t\tnew Icon( { icon: 'articlesSearch' } ).$el\n\t\t);\n\t\tthis.$el.find( '.spinner-container' ).append( $spinner );\n\t\tif ( feedbackLink ) {\n\t\t\tthis.$el.find( '.search-feedback' ).append(\n\t\t\t\tnew Anchor( {\n\t\t\t\t\tlabel: mw.msg( 'mobile-frontend-search-feedback-link-text' ),\n\t\t\t\t\thref: feedbackLink\n\t\t\t\t} ).$el\n\t\t\t);\n\t\t}\n\t}\n}\n\nmodule.exports = SearchResultsView;\n","const formHeader = require( '../headers' ).formHeader,\n\tSearchHeaderView = require( './SearchHeaderView' ),\n\ticons = require( '../icons' );\n\n/**\n * Generate a search header\n *\n * @param {string} placeholderMsg\n * @param {string} action\n * @param {Function} onInput\n * @param {string} defaultSearchPage\n * @param {string} autocapitalize\n * @return {jQuery.Element}\n */\nmodule.exports = function searchHeader( placeholderMsg, action, onInput, defaultSearchPage, autocapitalize ) {\n\treturn formHeader(\n\t\tnew SearchHeaderView( {\n\t\t\tplaceholderMsg,\n\t\t\tautocapitalize,\n\t\t\taction,\n\t\t\tonInput,\n\t\t\tdefaultSearchPage\n\t\t} ),\n\t\t[\n\t\t\ticons.cancel()\n\t\t],\n\t\tfalse\n\t);\n};\n","const units = [ 'seconds', 'minutes', 'hours', 'days', 'months', 'years' ],\n\tutil = require( './util' ),\n\tlimits = [ 1, 60, 3600, 86400, 2592000, 31536000 ];\n\n/**\n * Calculate the correct unit of timestamp\n *\n * @memberof module:mobile.startup/time\n * @instance\n * @param {number} timestampDelta\n * @return {{value: number, unit: string}}\n */\nfunction timeAgo( timestampDelta ) {\n\tlet i = 0;\n\twhile ( i < limits.length && timestampDelta > limits[i + 1] ) {\n\t\t++i;\n\t}\n\treturn {\n\t\tvalue: Math.round( timestampDelta / limits[i] ),\n\t\tunit: units[i]\n\t};\n}\n\n/**\n * Calculate the correct unit of timestamp delta\n *\n * @memberof module:mobile.startup/time\n * @param {number} timestamp\n * @return {{value: number, unit: string}}\n */\nfunction getTimeAgoDelta( timestamp ) {\n\tconst currentTimestamp = Math.round( Date.now() / 1000 );\n\n\treturn timeAgo( currentTimestamp - timestamp );\n}\n\n/**\n * Whether timestamp delta is less than a day old\n *\n * @instance\n * @memberof module:mobile.startup/time\n * @param {{value: number, unit: string}} delta Object of timestamp and its label\n * @return {boolean}\n */\nfunction isRecent( delta ) {\n\treturn [ 'seconds', 'minutes', 'hours' ].indexOf( delta.unit ) > -1;\n}\n\n/**\n * Is delta less than 10 seconds?\n *\n * @instance\n * @memberof module:mobile.startup/time\n * @param {{value: number, unit: string}} delta Object of timestamp and its label\n * @return {boolean}\n */\nfunction isNow( delta ) {\n\treturn delta.unit === 'seconds' && delta.value < 10;\n}\n\n/**\n * Return a message relating to the last modified relative time.\n *\n * @instance\n * @memberof module:mobile.startup/time\n * @param {number} ts timestamp\n * @param {string} username of the last user to modify the page\n * @param {string} gender of the last user to modify the page\n * @param {string} historyUrl url to the history page for the message (deprecated)\n * @return {string}\n */\nfunction getLastModifiedMessage( ts, username, gender, historyUrl ) {\n\tconst linkAll = typeof historyUrl === 'undefined',\n\t\tkeys = {\n\t\t\tseconds: 'mobile-frontend-last-modified-with-user-seconds',\n\t\t\tminutes: 'mobile-frontend-last-modified-with-user-minutes',\n\t\t\thours: 'mobile-frontend-last-modified-with-user-hours',\n\t\t\tdays: 'mobile-frontend-last-modified-with-user-days',\n\t\t\tmonths: 'mobile-frontend-last-modified-with-user-months',\n\t\t\tyears: 'mobile-frontend-last-modified-with-user-years'\n\t\t},\n\t\targs = [];\n\n\tgender = gender || 'unknown';\n\n\tconst delta = getTimeAgoDelta( ts );\n\tif ( isNow( delta ) ) {\n\t\targs.push( 'mobile-frontend-last-modified-with-user-just-now', gender, username );\n\t} else {\n\t\targs.push( keys[ delta.unit ], gender, username,\n\t\t\tmw.language.convertNumber( delta.value )\n\t\t);\n\t}\n\n\tconst lastEditedElement = linkAll ?\n\t\tutil.parseHTML( '<strong>' ).attr( 'class', 'last-modified-text-accent' ) :\n\t\tutil.parseHTML( '<a>' ).attr( 'href', historyUrl || '#' );\n\tconst usernameElement = linkAll ?\n\t\tutil.parseHTML( '<span>' ).attr( 'class', 'last-modified-text-accent' ) :\n\t\tutil.parseHTML( '<a>' ).attr( 'href', mw.util.getUrl( 'User:' + username ) );\n\n\targs.push(\n\t\tlastEditedElement,\n\t\t// Abuse PLURAL support to determine if the user is anonymous or not\n\t\tmw.language.convertNumber( username ? 1 : 0 ),\n\t\t// Our abuse of PLURAL support means we have to pass the relative URL\n\t\t// rather than construct it from a wikilink\n\t\tusername ? usernameElement : ''\n\t);\n\n\treturn mw.message.apply( this, args ).parse();\n}\n\n/**\n * Return a message relating to the registration date of the user\n *\n * @instance\n * @memberof module:mobile.startup/time\n * @param {string} ts timestamp\n * @param {string} [gender] of the last user editing this page\n * @return {string}\n */\nfunction getRegistrationMessage( ts, gender ) {\n\tconst keys = {\n\t\tseconds: 'mobile-frontend-joined-seconds',\n\t\tminutes: 'mobile-frontend-joined-minutes',\n\t\thours: 'mobile-frontend-joined-hours',\n\t\tdays: 'mobile-frontend-joined-days',\n\t\tmonths: 'mobile-frontend-joined-months',\n\t\tyears: 'mobile-frontend-joined-years'\n\t};\n\n\tconst args = [];\n\n\tgender = gender || 'unknown';\n\n\tconst delta = getTimeAgoDelta( parseInt( ts, 10 ) );\n\tif ( isNow( delta ) ) {\n\t\targs.push( 'mobile-frontend-joined-just-now', gender );\n\t} else {\n\t\targs.push( keys[ delta.unit ], gender, mw.language.convertNumber( delta.value ) );\n\t}\n\tconst html = mw.message.apply( this, args ).parse();\n\treturn html;\n}\n\n/**\n * Utility library for relative time.\n *\n * @exports module:mobile.startup/time\n */\nmodule.exports = {\n\tgetLastModifiedMessage,\n\tgetRegistrationMessage,\n\ttimeAgo,\n\tgetTimeAgoDelta,\n\tisNow,\n\tisRecent\n};\n"],"names":["util","require","actionParams","LanguageInfo","api","this","prototype","getLanguages","get","meta","liprop","then","resp","filteredLanguages","Object","keys","query","languageinfo","forEach","key","language","code","toLowerCase","bcp47","autonym","push","Deferred","reject","languages","map","data","url","lang","langname","name","title","module","exports","navigator","userLanguage","browserLanguage","systemLanguage","undefined","m","getDeviceLanguage","Overlay","promisedView","loadLanguageInfoSearcher","languageInfo","showSuggestedLanguages","mw","loader","using","variants","deviceLanguage","languageInfoOverlay","make","heading","msg","className","test","MessageBox","currentPageHTMLParser","loadLanguageSearcher","config","onOpen","searcher","hook","fire","type","languageOverlay","header","icons","options","headers","cancel","Promise","all","ImageCarousel","time","currentPage","Drawer","CtaDrawer","lazyImageLoader","PageHTMLParser","showOnPageReload","OverlayManager","View","references","search","SearchOverlay","SearchGateway","Skin","mediaViewer","overlay","amcOutreach","_mobileFrontend","overlayHeader","getOverlayManager","getSingleton","spinner","loadAllImagesInPage","loadImages","queryPlaceholders","document","getElementById","notifyOnPageReload","license","getLicenseMsg","showSuggestedLanguage","promise","view","$el","append","newView","replaceWith","errorView","ReferencesGateway","getReference","ERROR_NOT_EXIST","ERROR_OTHER","mfExtend","ReferencesHtmlScraperGateway","apply","arguments","EXTERNAL_LINK_CLASS","getReferenceFromContainer","id","$container","result","find","escapeSelector","length","$parent","$ol","closest","isSubref","hasClass","parent","addClass","resolve","text","getReferenceHtml","parentText","$reference","children","first","html","hash","page","pageHTMLParser","percentDecodeFragment","slice","Icon","IconButton","makeOnNestedReferenceClickHandler","onNestedReferenceClick","ev","target","currentTarget","querySelector","getAttribute","textContent","referenceDrawer","props","errorIcon","error","isSmall","mainRef","mainRefHtml","parseHTML","subRefHtml","extend","showCollapseIcon","events","preventDefault","icon","additionalClassNames","showReference","refNumber","gateway","onShowNestedReference","reference","drawer","href","nestedDrawer","log","warn","body","appendChild","hide","show","err","pageJSONParser","extendSearchParams","searchCache","generator","searchNamespace","getApiData","prefix","redirects","pilimit","pithumbsize","tiny","_createSearchRegEx","str","replace","RegExp","_highlightSearchTerm","label","term","trim","_getPage","pageInfo","parse","displayTitle","displaytext","index","_processData","self","results","pages","sort","a","b","scriptPath","isCached","xhr","request","jqXHR","searchId","getResponseHeader","abort","Boolean","SearchHeaderView","_View","_classCallCheck","_callSuper","autocapitalize","_inherits","value","onInput","clearIcon","template","tagName","size","click","val","trigger","bind","attr","searchHeader","SearchResultsView","WatchstarPageList","params","_this","placeholderMsg","action","performSearch","defaultSearchPage","headerChrome","isBorderBox","stopPropagation","call","gatewayClass","router","currentSearchId","onClickSearchContent","$form","parentNode","appendTo","setTimeout","onClickOverlayContent","hideKeyboardOnScroll","$input","onClickResult","$link","back","clickUrl","URL","location","searchParams","set","navigateTo","path","toString","useReplaceState","window","postRender","timer","_this2","searchResults","searchContentLabel","noResultsMsg","searchContentNoResultsMsg","message","clearSearch","$spinner","clearTimeout","$searchContent","$resultContainer","addEventListener","activeElement","on","searchData","delay","showKeyboard","len","setSelectionRange","lastQuery","_pendingQuery","toggleClass","filter","funnel","el","$results","resetSearch","Anchor","feedback","prompt","feedbackLink","prepend","formHeader","units","limits","timeAgo","timestampDelta","i","Math","round","unit","getTimeAgoDelta","timestamp","Date","now","isNow","delta","getLastModifiedMessage","ts","username","gender","historyUrl","linkAll","args","seconds","minutes","hours","days","months","years","convertNumber","lastEditedElement","usernameElement","getUrl","getRegistrationMessage","parseInt","isRecent","indexOf"],"sourceRoot":""}
\ No newline at end of file
diff --git a/extensions/MobileFrontend/resources/dist/mobile.startup.runtime.js b/extensions/MobileFrontend/resources/dist/mobile.startup.runtime.js
new file mode 100644
index 000000000..ba46f44d0
--- /dev/null
+++ b/extensions/MobileFrontend/resources/dist/mobile.startup.runtime.js
@@ -0,0 +1,2 @@
+(()=>{"use strict";var r,e={},o={};function t(r){var n=o[r];if(void 0!==n)return n.exports;var s=o[r]={exports:{}};return e[r](s,s.exports,t),s.exports}t.m=e,r=[],t.O=(e,o,n,s)=>{if(!o){var a=1/0;for(u=0;u<r.length;u++){for(var[o,n,s]=r[u],f=!0,l=0;l<o.length;l++)(!1&s||a>=s)&&Object.keys(t.O).every((r=>t.O[r](o[l])))?o.splice(l--,1):(f=!1,s<a&&(a=s));if(f){r.splice(u--,1);var i=n();void 0!==i&&(e=i)}}return e}s=s||0;for(var u=r.length;u>0&&r[u-1][2]>s;u--)r[u]=r[u-1];r[u]=[o,n,s]},t.o=(r,e)=>Object.prototype.hasOwnProperty.call(r,e),(()=>{var r={715:0};t.O.j=e=>0===r[e];var e=(e,o)=>{var n,s,[a,f,l]=o,i=0;if(a.some((e=>0!==r[e]))){for(n in f)t.o(f,n)&&(t.m[n]=f[n]);if(l)var u=l(t)}for(e&&e(o);i<a.length;i++)s=a[i],t.o(r,s)&&r[s]&&r[s][0](),r[s]=0;return t.O(u)},o=self.webpackChunkmfModules=self.webpackChunkmfModules||[];o.forEach(e.bind(null,0)),o.push=e.bind(null,o.push.bind(o))})()})();
+//# sourceMappingURL=mobile.startup.runtime.js.map.json
\ No newline at end of file
diff --git a/extensions/MobileFrontend/resources/dist/mobile.startup.runtime.js.map.json b/extensions/MobileFrontend/resources/dist/mobile.startup.runtime.js.map.json
new file mode 100644
index 000000000..2501effbc
--- /dev/null
+++ b/extensions/MobileFrontend/resources/dist/mobile.startup.runtime.js.map.json
@@ -0,0 +1 @@
+{"version":3,"file":"mobile.startup.runtime.js","mappings":"uBAAIA,E,KCCAC,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAaE,QAGrB,IAAIC,EAASN,EAAyBE,GAAY,CAGjDG,QAAS,CAAC,GAOX,OAHAE,EAAoBL,GAAUI,EAAQA,EAAOD,QAASJ,GAG/CK,EAAOD,OACf,CAGAJ,EAAoBO,EAAID,EDzBpBR,EAAW,GACfE,EAAoBQ,EAAI,CAACC,EAAQC,EAAUC,EAAIC,KAC9C,IAAGF,EAAH,CAMA,IAAIG,EAAeC,IACnB,IAASC,EAAI,EAAGA,EA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iBC,IAAYD,EAAgBC,IACrED,EAAgBC,GAAS,KAE1BD,EAAgBC,GAAW,EAE5B,OAAOhC,EAAoBQ,EAAEC,EAAO,EAGjC+B,EAAqBC,KAA4B,sBAAIA,KAA4B,uBAAK,GAC1FD,EAAmBE,QAAQT,EAAqBU,KAAK,KAAM,IAC3DH,EAAmBI,KAAOX,EAAqBU,KAAK,KAAMH,EAAmBI,KAAKD,KAAKH,G","sources":["webpack://mfModules/webpack/runtime/chunk loaded","webpack://mfModules/webpack/bootstrap","webpack://mfModules/webpack/runtime/hasOwnProperty shorthand","webpack://mfModules/webpack/runtime/jsonp chunk loading"],"sourcesContent":["var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t715: 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkmfModules\"] = self[\"webpackChunkmfModules\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));"],"names":["deferred","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","exports","module","__webpack_modules__","m","O","result","chunkIds","fn","priority","notFulfilled","Infinity","i","length","fulfilled","j","Object","keys","every","key","splice","r","o","obj","prop","prototype","hasOwnProperty","call","installedChunks","chunkId","webpackJsonpCallback","parentChunkLoadingFunction","data","moreModules","runtime","some","id","chunkLoadingGlobal","self","forEach","bind","push"],"sourceRoot":""}
\ No newline at end of file

File Metadata

Mime Type
text/x-diff
Expires
Oct 8 2026, 02:25 (6 w, 6 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
25/95/f7755af13b0bb41090e0dd2473a6
Default Alt Text
(691 KB)

Event Timeline