MediaWiki:Gadget-XFDcloser-core.js

/* _______________________________________________________________________________ * |                                                                               | * |                     === WARNING: GLOBAL GADGET FILE ===                       | * |                  Changes to this page affect many users. | * | Please discuss changes on the talk page or on WT:Gadget before editing. | * |_______________________________________________________________________________| * * Built from source code at GitHub repository * All changes should be made in the repository, otherwise they will be lost. * * To update this script from github, you must have a local repository set up. Then * follow the instructions at * * XFDcloser: close deletion discussions at XfD venues, including actions to implement closes; see WP:XFDC * Author: Evad37 * Licencing and attribution: WP:XFDC */ /* jshint esversion: 5, esnext:false, laxbreak: true, undef: true, eqnull: true, maxerr: 3000 */ /* globals console, document, window, $, mw, OO */ /* */ !function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){return o(e[i][1][r]||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}({1:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.mw=exports.OO=exports.$=void 0;var $=window.$;exports.$=$;var mw=window.mw;exports.mw=mw;var OO=window.OO;exports.OO=OO},{}],2:[function(require,module,exports){module.exports=function(it){if("function"!=typeof it)throw TypeError(String(it)+" is not a function");return it}},{}],3:[function(require,module,exports){var isObject=require("../internals/is-object");module.exports=function(it){if(!isObject(it)&&null!==it)throw TypeError("Can't set "+String(it)+" as a prototype");return it}},{"../internals/is-object":52}],4:[function(require,module,exports){var wellKnownSymbol=require("../internals/well-known-symbol"),create=require("../internals/object-create"),definePropertyModule=require("../internals/object-define-property"),UNSCOPABLES=wellKnownSymbol("unscopables"),ArrayPrototype=Array.prototype;null==ArrayPrototype[UNSCOPABLES]&&definePropertyModule.f(ArrayPrototype,UNSCOPABLES,{configurable:!0,value:create(null)}),module.exports=function(key){ArrayPrototype[UNSCOPABLES][key]=!0}},{"../internals/object-create":61,"../internals/object-define-property":63,"../internals/well-known-symbol":102}],5:[function(require,module,exports){"use strict";var charAt=require("../internals/string-multibyte").charAt;module.exports=function(S,index,unicode){return index+(unicode?charAt(S,index).length:1)}},{"../internals/string-multibyte":90}],6:[function(require,module,exports){var isObject=require("../internals/is-object");module.exports=function(it){if(!isObject(it))throw TypeError(String(it)+" is not an object");return it}},{"../internals/is-object":52}],7:[function(require,module,exports){"use strict";var $forEach=require("../internals/array-iteration").forEach,arrayMethodIsStrict=require("../internals/array-method-is-strict"),arrayMethodUsesToLength=require("../internals/array-method-uses-to-length"),STRICT_METHOD=arrayMethodIsStrict("forEach"),USES_TO_LENGTH=arrayMethodUsesToLength("forEach");module.exports=STRICT_METHOD&&USES_TO_LENGTH?[].forEach:function(callbackfn,argument_1){return $forEach(this,callbackfn,1<arguments.length?argument_1:void 0)}},{"../internals/array-iteration":9,"../internals/array-method-is-strict":12,"../internals/array-method-uses-to-length":13}],8:[function(require,module,exports){function createMethod(IS_INCLUDES){return function($this,el,fromIndex){var value,O=toIndexedObject($this),length=toLength(O.length),index=toAbsoluteIndex(fromIndex,length);if(IS_INCLUDES&&el!=el){for(index<length;)if((value=O[index++])!=value)return!0}else for(index<length;index++)if((IS_INCLUDES||index in O)&&O[index]===el)return IS_INCLUDES||index||0;return!IS_INCLUDES&&-1}}var toIndexedObject=require("../internals/to-indexed-object"),toLength=require("../internals/to-length"),toAbsoluteIndex=require("../internals/to-absolute-index");module.exports={includes:createMethod(!0),indexOf:createMethod(!1)}},{"../internals/to-absolute-index":93,"../internals/to-indexed-object":94,"../internals/to-length":96}],9:[function(require,module,exports){function createMethod(TYPE){var IS_MAP=1==TYPE,IS_FILTER=2==TYPE,IS_SOME=3==TYPE,IS_EVERY=4==TYPE,IS_FIND_INDEX=6==TYPE,IS_FILTER_OUT=7==TYPE,NO_HOLES=5==TYPE||IS_FIND_INDEX;return function($this,callbackfn,that,specificCreate){for(var value,result,O=toObject($this),self=IndexedObject(O),boundFunction=bind(callbackfn,that,3),length=toLength(self.length),index=0,create=specificCreate||arraySpeciesCreate,target=IS_MAP?create($this,length):IS_FILTER||IS_FILTER_OUT?create($this,0):void 0;index<length;index++)if((NO_HOLES||index in self)&&(result=boundFunction(value=self[index],index,O),TYPE))if(IS_MAP)target[index]=result;else if(result)switch(TYPE){case 3:return!0;case 5:return value;case 6:return index;case 2:push.call(target,value)}else switch(TYPE){case 4:return!1;case 7:push.call(target,value)}return IS_FIND_INDEX?-1:IS_SOME||IS_EVERY?IS_EVERY:target}}var bind=require("../internals/function-bind-context"),IndexedObject=require("../internals/indexed-object"),toObject=require("../internals/to-object"),toLength=require("../internals/to-length"),arraySpeciesCreate=require("../internals/array-species-create"),push=[].push;module.exports={forEach:createMethod(0),map:createMethod(1),filter:createMethod(2),some:createMethod(3),every:createMethod(4),find:createMethod(5),findIndex:createMethod(6),filterOut:createMethod(7)}},{"../internals/array-species-create":15,"../internals/function-bind-context":37,"../internals/indexed-object":46,"../internals/to-length":96,"../internals/to-object":97}],10:[function(require,module,exports){"use strict";var toIndexedObject=require("../internals/to-indexed-object"),toInteger=require("../internals/to-integer"),toLength=require("../internals/to-length"),arrayMethodIsStrict=require("../internals/array-method-is-strict"),arrayMethodUsesToLength=require("../internals/array-method-uses-to-length"),min=Math.min,nativeLastIndexOf=[].lastIndexOf,NEGATIVE_ZERO=!!nativeLastIndexOf&&1/[1].lastIndexOf(1,-0)<0,STRICT_METHOD=arrayMethodIsStrict("lastIndexOf"),USES_TO_LENGTH=arrayMethodUsesToLength("indexOf",{ACCESSORS:!0,1:0}),FORCED=NEGATIVE_ZERO||!STRICT_METHOD||!USES_TO_LENGTH;module.exports=FORCED?function(searchElement,argument_1){if(NEGATIVE_ZERO)return nativeLastIndexOf.apply(this,arguments)||0;var O=toIndexedObject(this),length=toLength(O.length),index=length-1;for(1<arguments.length&&(index=min(index,toInteger(argument_1))),index<0&&(index=length+index);0<=index;index--)if(index in O&&O[index]===searchElement)return index||0;return-1}:nativeLastIndexOf},{"../internals/array-method-is-strict":12,"../internals/array-method-uses-to-length":13,"../internals/to-indexed-object":94,"../internals/to-integer":95,"../internals/to-length":96}],11:[function(require,module,exports){var fails=require("../internals/fails"),wellKnownSymbol=require("../internals/well-known-symbol"),V8_VERSION=require("../internals/engine-v8-version"),SPECIES=wellKnownSymbol("species");module.exports=function(METHOD_NAME){return 51<=V8_VERSION||!fails(function{var array=[];return(array.constructor={})[SPECIES]=function{return{foo:1}},1!==array[METHOD_NAME](Boolean).foo})}},{"../internals/engine-v8-version":31,"../internals/fails":34,"../internals/well-known-symbol":102}],12:[function(require,module,exports){"use strict";var fails=require("../internals/fails");module.exports=function(METHOD_NAME,argument){var method=[][METHOD_NAME];return!!method&&fails(function{method.call(null,argument||function{throw 1},1)})}},{"../internals/fails":34}],13:[function(require,module,exports){function thrower(it){throw it}var DESCRIPTORS=require("../internals/descriptors"),fails=require("../internals/fails"),has=require("../internals/has"),defineProperty=Object.defineProperty,cache={};module.exports=function(METHOD_NAME,options){if(has(cache,METHOD_NAME))return cache[METHOD_NAME];var method=[][METHOD_NAME],ACCESSORS=!!has(options=options||{},"ACCESSORS")&&options.ACCESSORS,argument0=has(options,0)?options[0]:thrower,argument1=has(options,1)?options[1]:void 0;return cache[METHOD_NAME]=!!method&&!fails(function{if(ACCESSORS&&!DESCRIPTORS)return!0;var O={length:-1};ACCESSORS?defineProperty(O,1,{enumerable:!0,get:thrower}):O[1]=1,method.call(O,argument0,argument1)})}},{"../internals/descriptors":26,"../internals/fails":34,"../internals/has":42}],14:[function(require,module,exports){function createMethod(IS_RIGHT){return function(that,callbackfn,argumentsLength,memo){aFunction(callbackfn);var O=toObject(that),self=IndexedObject(O),length=toLength(O.length),index=IS_RIGHT?length-1:0,i=IS_RIGHT?-1:1;if(argumentsLength<2)for{if(index in self){memo=self[index],index+=i;break}if(index+=i,IS_RIGHT?index<0:length<=index)throw TypeError("Reduce of empty array with no initial value")}for(IS_RIGHT?0<=index:index<length;index+=i)index in self&&(memo=callbackfn(memo,self[index],index,O));return memo}}var aFunction=require("../internals/a-function"),toObject=require("../internals/to-object"),IndexedObject=require("../internals/indexed-object"),toLength=require("../internals/to-length");module.exports={left:createMethod(!1),right:createMethod(!0)}},{"../internals/a-function":2,"../internals/indexed-object":46,"../internals/to-length":96,"../internals/to-object":97}],15:[function(require,module,exports){var isObject=require("../internals/is-object"),isArray=require("../internals/is-array"),SPECIES=require("../internals/well-known-symbol")("species");module.exports=function(originalArray,length){var C;return isArray(originalArray)&&("function"==typeof(C=originalArray.constructor)&&(C===Array||isArray(C.prototype))||isObject(C)&&null===(C=C[SPECIES]))&&(C=void 0),new(void 0===C?Array:C)(0===length?0:length)}},{"../internals/is-array":50,"../internals/is-object":52,"../internals/well-known-symbol":102}],16:[function(require,module,exports){var toString={}.toString;module.exports=function(it){return toString.call(it).slice(8,-1)}},{}],17:[function(require,module,exports){var TO_STRING_TAG_SUPPORT=require("../internals/to-string-tag-support"),classofRaw=require("../internals/classof-raw"),TO_STRING_TAG=require("../internals/well-known-symbol")("toStringTag"),CORRECT_ARGUMENTS="Arguments"==classofRaw(function{return arguments});module.exports=TO_STRING_TAG_SUPPORT?classofRaw:function(it){var O,tag,result;return void 0===it?"Undefined":null===it?"Null":"string"==typeof(tag=function(it,key){try{return it[key]}catch(error){}}(O=Object(it),TO_STRING_TAG))?tag:CORRECT_ARGUMENTS?classofRaw(O):"Object"==(result=classofRaw(O))&&"function"==typeof O.callee?"Arguments":result}},{"../internals/classof-raw":16,"../internals/to-string-tag-support":99,"../internals/well-known-symbol":102}],18:[function(require,module,exports){var has=require("../internals/has"),ownKeys=require("../internals/own-keys"),getOwnPropertyDescriptorModule=require("../internals/object-get-own-property-descriptor"),definePropertyModule=require("../internals/object-define-property");module.exports=function(target,source){for(var keys=ownKeys(source),defineProperty=definePropertyModule.f,getOwnPropertyDescriptor=getOwnPropertyDescriptorModule.f,i=0;i<keys.length;i++){var key=keys[i];has(target,key)||defineProperty(target,key,getOwnPropertyDescriptor(source,key))}}},{"../internals/has":42,"../internals/object-define-property":63,"../internals/object-get-own-property-descriptor":64,"../internals/own-keys":74}],19:[function(require,module,exports){var MATCH=require("../internals/well-known-symbol")("match");module.exports=function(METHOD_NAME){var regexp=/./;try{"/./"[METHOD_NAME](regexp)}catch(error1){try{return regexp[MATCH]=!1,"/./"[METHOD_NAME](regexp)}catch(error2){}}return!1}},{"../internals/well-known-symbol":102}],20:[function(require,module,exports){var fails=require("../internals/fails");module.exports=!fails(function{function F{}return F.prototype.constructor=null,Object.getPrototypeOf(new F)!==F.prototype})},{"../internals/fails":34}],21:[function(require,module,exports){"use strict";function returnThis{return this}var IteratorPrototype=require("../internals/iterators-core").IteratorPrototype,create=require("../internals/object-create"),createPropertyDescriptor=require("../internals/create-property-descriptor"),setToStringTag=require("../internals/set-to-string-tag"),Iterators=require("../internals/iterators");module.exports=function(IteratorConstructor,NAME,next){var TO_STRING_TAG=NAME+" Iterator";return IteratorConstructor.prototype=create(IteratorPrototype,{next:createPropertyDescriptor(1,next)}),setToStringTag(IteratorConstructor,TO_STRING_TAG,!1,!0),Iterators[TO_STRING_TAG]=returnThis,IteratorConstructor}},{"../internals/create-property-descriptor":23,"../internals/iterators":56,"../internals/iterators-core":55,"../internals/object-create":61,"../internals/set-to-string-tag":85}],22:[function(require,module,exports){var DESCRIPTORS=require("../internals/descriptors"),definePropertyModule=require("../internals/object-define-property"),createPropertyDescriptor=require("../internals/create-property-descriptor");module.exports=DESCRIPTORS?function(object,key,value){return definePropertyModule.f(object,key,createPropertyDescriptor(1,value))}:function(object,key,value){return object[key]=value,object}},{"../internals/create-property-descriptor":23,"../internals/descriptors":26,"../internals/object-define-property":63}],23:[function(require,module,exports){module.exports=function(bitmap,value){return{enumerable:!(1&bitmap),configurable:!(2&bitmap),writable:!(4&bitmap),value:value}}},{}],24:[function(require,module,exports){"use strict";var toPrimitive=require("../internals/to-primitive"),definePropertyModule=require("../internals/object-define-property"),createPropertyDescriptor=require("../internals/create-property-descriptor");module.exports=function(object,key,value){var propertyKey=toPrimitive(key);propertyKey in object?definePropertyModule.f(object,propertyKey,createPropertyDescriptor(0,value)):object[propertyKey]=value}},{"../internals/create-property-descriptor":23,"../internals/object-define-property":63,"../internals/to-primitive":98}],25:[function(require,module,exports){"use strict";function returnThis{return this}var $=require("../internals/export"),createIteratorConstructor=require("../internals/create-iterator-constructor"),getPrototypeOf=require("../internals/object-get-prototype-of"),setPrototypeOf=require("../internals/object-set-prototype-of"),setToStringTag=require("../internals/set-to-string-tag"),createNonEnumerableProperty=require("../internals/create-non-enumerable-property"),redefine=require("../internals/redefine"),wellKnownSymbol=require("../internals/well-known-symbol"),IS_PURE=require("../internals/is-pure"),Iterators=require("../internals/iterators"),IteratorsCore=require("../internals/iterators-core"),IteratorPrototype=IteratorsCore.IteratorPrototype,BUGGY_SAFARI_ITERATORS=IteratorsCore.BUGGY_SAFARI_ITERATORS,ITERATOR=wellKnownSymbol("iterator");module.exports=function(Iterable,NAME,IteratorConstructor,next,DEFAULT,IS_SET,FORCED){createIteratorConstructor(IteratorConstructor,NAME,next);function getIterationMethod(KIND){if(KIND===DEFAULT&&defaultIterator)return defaultIterator;if(!BUGGY_SAFARI_ITERATORS&&KIND in IterablePrototype)return IterablePrototype[KIND];switch(KIND){case"keys":case"values":case"entries":return function{return new IteratorConstructor(this,KIND)}}return function{return new IteratorConstructor(this)}}var CurrentIteratorPrototype,methods,KEY,TO_STRING_TAG=NAME+" Iterator",INCORRECT_VALUES_NAME=!1,IterablePrototype=Iterable.prototype,nativeIterator=IterablePrototype[ITERATOR]||IterablePrototype["@@iterator"]||DEFAULT&&IterablePrototype[DEFAULT],defaultIterator=!BUGGY_SAFARI_ITERATORS&&nativeIterator||getIterationMethod(DEFAULT),anyNativeIterator="Array"==NAME&&IterablePrototype.entries||nativeIterator;if(anyNativeIterator&&(CurrentIteratorPrototype=getPrototypeOf(anyNativeIterator.call(new Iterable)),IteratorPrototype!==Object.prototype&&CurrentIteratorPrototype.next&&(IS_PURE||getPrototypeOf(CurrentIteratorPrototype)===IteratorPrototype||(setPrototypeOf?setPrototypeOf(CurrentIteratorPrototype,IteratorPrototype):"function"!=typeof CurrentIteratorPrototype[ITERATOR]&&createNonEnumerableProperty(CurrentIteratorPrototype,ITERATOR,returnThis)),setToStringTag(CurrentIteratorPrototype,TO_STRING_TAG,!0,!0),IS_PURE&&(Iterators[TO_STRING_TAG]=returnThis))),"values"==DEFAULT&&nativeIterator&&"values"!==nativeIterator.name&&(INCORRECT_VALUES_NAME=!0,defaultIterator=function{return nativeIterator.call(this)}),IS_PURE&&!FORCED||IterablePrototype[ITERATOR]===defaultIterator||createNonEnumerableProperty(IterablePrototype,ITERATOR,defaultIterator),Iterators[NAME]=defaultIterator,DEFAULT)if(methods={values:getIterationMethod("values"),keys:IS_SET?defaultIterator:getIterationMethod("keys"),entries:getIterationMethod("entries")},FORCED)for(KEY in methods)!BUGGY_SAFARI_ITERATORS&&!INCORRECT_VALUES_NAME&&KEY in IterablePrototype||redefine(IterablePrototype,KEY,methods[KEY]);else $({target:NAME,proto:!0,forced:BUGGY_SAFARI_ITERATORS||INCORRECT_VALUES_NAME},methods);return methods}},{"../internals/create-iterator-constructor":21,"../internals/create-non-enumerable-property":22,"../internals/export":33,"../internals/is-pure":53,"../internals/iterators":56,"../internals/iterators-core":55,"../internals/object-get-prototype-of":67,"../internals/object-set-prototype-of":71,"../internals/redefine":76,"../internals/set-to-string-tag":85,"../internals/well-known-symbol":102}],26:[function(require,module,exports){var fails=require("../internals/fails");module.exports=!fails(function{return 7!=Object.defineProperty({},1,{get:function{return 7}})[1]})},{"../internals/fails":34}],27:[function(require,module,exports){var global=require("../internals/global"),isObject=require("../internals/is-object"),document=global.document,EXISTS=isObject(document)&&isObject(document.createElement);module.exports=function(it){return EXISTS?document.createElement(it):{}}},{"../internals/global":41,"../internals/is-object":52}],28:[function(require,module,exports){module.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},{}],29:[function(require,module,exports){var classof=require("../internals/classof-raw"),global=require("../internals/global");module.exports="process"==classof(global.process)},{"../internals/classof-raw":16,"../internals/global":41}],30:[function(require,module,exports){var getBuiltIn=require("../internals/get-built-in");module.exports=getBuiltIn("navigator","userAgent")||""},{"../internals/get-built-in":39}],31:[function(require,module,exports){var match,version,global=require("../internals/global"),userAgent=require("../internals/engine-user-agent"),process=global.process,versions=process&&process.versions,v8=versions&&versions.v8;v8?version=(match=v8.split("."))[0]+match[1]:userAgent&&(!(match=userAgent.match(/Edge\/(\d+)/))||74<=match[1])&&(match=userAgent.match(/Chrome\/(\d+)/))&&(version=match[1]),module.exports=version&&+version},{"../internals/engine-user-agent":30,"../internals/global":41}],32:[function(require,module,exports){module.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},{}],33:[function(require,module,exports){var global=require("../internals/global"),getOwnPropertyDescriptor=require("../internals/object-get-own-property-descriptor").f,createNonEnumerableProperty=require("../internals/create-non-enumerable-property"),redefine=require("../internals/redefine"),setGlobal=require("../internals/set-global"),copyConstructorProperties=require("../internals/copy-constructor-properties"),isForced=require("../internals/is-forced");module.exports=function(options,source){var target,key,targetProperty,sourceProperty,descriptor,TARGET=options.target,GLOBAL=options.global,STATIC=options.stat;if(target=GLOBAL?global:STATIC?global[TARGET]||setGlobal(TARGET,{}):(global[TARGET]||{}).prototype)for(key in source){if(sourceProperty=source[key],targetProperty=options.noTargetGet?(descriptor=getOwnPropertyDescriptor(target,key))&&descriptor.value:target[key],!isForced(GLOBAL?key:TARGET+(STATIC?".":"#")+key,options.forced)&&void 0!==targetProperty){if(typeof sourceProperty==typeof targetProperty)continue;copyConstructorProperties(sourceProperty,targetProperty)}(options.sham||targetProperty&&targetProperty.sham)&&createNonEnumerableProperty(sourceProperty,"sham",!0),redefine(target,key,sourceProperty,options)}}},{"../internals/copy-constructor-properties":18,"../internals/create-non-enumerable-property":22,"../internals/global":41,"../internals/is-forced":51,"../internals/object-get-own-property-descriptor":64,"../internals/redefine":76,"../internals/set-global":83}],34:[function(require,module,exports){module.exports=function(exec){try{return!!exec}catch(error){return!0}}},{}],35:[function(require,module,exports){"use strict";require("../modules/es.regexp.exec");var redefine=require("../internals/redefine"),fails=require("../internals/fails"),wellKnownSymbol=require("../internals/well-known-symbol"),regexpExec=require("../internals/regexp-exec"),createNonEnumerableProperty=require("../internals/create-non-enumerable-property"),SPECIES=wellKnownSymbol("species"),REPLACE_SUPPORTS_NAMED_GROUPS=!fails(function{var re=/./;return re.exec=function{var result=[];return result.groups={a:"7"},result},"7"!=="".replace(re,"$")}),REPLACE_KEEPS_$0="$0"==="a".replace(/./,"$0"),REPLACE=wellKnownSymbol("replace"),REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE=!!/./[REPLACE]&&""===/./[REPLACE]("a","$0"),SPLIT_WORKS_WITH_OVERWRITTEN_EXEC=!fails(function{var re=/(?:)/,originalExec=re.exec;re.exec=function{return originalExec.apply(this,arguments)};var result="ab".split(re);return 2!==result.length||"a"!==result[0]||"b"!==result[1]});module.exports=function(KEY,length,exec,sham){var SYMBOL=wellKnownSymbol(KEY),DELEGATES_TO_SYMBOL=!fails(function{var O={};return O[SYMBOL]=function{return 7},7!=""[KEY](O)}),DELEGATES_TO_EXEC=DELEGATES_TO_SYMBOL&&!fails(function{var execCalled=!1,re=/a/;return"split"===KEY&&((re={constructor:{}}).constructor[SPECIES]=function{return re},re.flags="",re[SYMBOL]=/./[SYMBOL]),re.exec=function{return execCalled=!0,null},re[SYMBOL](""),!execCalled});if(!DELEGATES_TO_SYMBOL||!DELEGATES_TO_EXEC||"replace"===KEY&&(!REPLACE_SUPPORTS_NAMED_GROUPS||!REPLACE_KEEPS_$0||REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE)||"split"===KEY&&!SPLIT_WORKS_WITH_OVERWRITTEN_EXEC){var nativeRegExpMethod=/./[SYMBOL],methods=exec(SYMBOL,""[KEY],function(nativeMethod,regexp,str,arg2,forceStringMethod){return regexp.exec===regexpExec?DELEGATES_TO_SYMBOL&&!forceStringMethod?{done:!0,value:nativeRegExpMethod.call(regexp,str,arg2)}:{done:!0,value:nativeMethod.call(str,regexp,arg2)}:{done:!1}},{REPLACE_KEEPS_$0:REPLACE_KEEPS_$0,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE}),stringMethod=methods[0],regexMethod=methods[1];redefine(String.prototype,KEY,stringMethod),redefine(RegExp.prototype,SYMBOL,2==length?function(string,arg){return regexMethod.call(string,this,arg)}:function(string){return regexMethod.call(string,this)})}sham&&createNonEnumerableProperty(RegExp.prototype[SYMBOL],"sham",!0)}},{"../internals/create-non-enumerable-property":22,"../internals/fails":34,"../internals/redefine":76,"../internals/regexp-exec":78,"../internals/well-known-symbol":102,"../modules/es.regexp.exec":132}],36:[function(require,module,exports){"use strict";var isArray=require("../internals/is-array"),toLength=require("../internals/to-length"),bind=require("../internals/function-bind-context"),flattenIntoArray=function(target,original,source,sourceLen,start,depth,mapper,thisArg){for(var element,targetIndex=start,sourceIndex=0,mapFn=!!mapper&&bind(mapper,thisArg,3);sourceIndex<sourceLen;){if(sourceIndex in source){if(element=mapFn?mapFn(source[sourceIndex],sourceIndex,original):source[sourceIndex],0<depth&&isArray(element))targetIndex=flattenIntoArray(target,original,element,toLength(element.length),targetIndex,depth-1)-1;else{if(9007199254740991<=targetIndex)throw TypeError("Exceed the acceptable array length");target[targetIndex]=element}targetIndex++}sourceIndex++}return targetIndex};module.exports=flattenIntoArray},{"../internals/function-bind-context":37,"../internals/is-array":50,"../internals/to-length":96}],37:[function(require,module,exports){var aFunction=require("../internals/a-function");module.exports=function(fn,that,length){if(aFunction(fn),void 0===that)return fn;switch(length){case 0:return function{return fn.call(that)};case 1:return function(a){return fn.call(that,a)};case 2:return function(a,b){return fn.call(that,a,b)};case 3:return function(a,b,c){return fn.call(that,a,b,c)}}return function{return fn.apply(that,arguments)}}},{"../internals/a-function":2}],38:[function(require,module,exports){"use strict";var aFunction=require("../internals/a-function"),isObject=require("../internals/is-object"),slice=[].slice,factories={};module.exports=Function.bind||function(that){var fn=aFunction(this),partArgs=slice.call(arguments,1),boundFunction=function{var args=partArgs.concat(slice.call(arguments));return this instanceof boundFunction?function(C,argsLength,args){if(!(argsLength in factories)){for(var list=[],i=0;i<argsLength;i++)list[i]="a["+i+"]";factories[argsLength]=Function("C,a","return new C("+list.join(",")+")")}return factories[argsLength](C,args)}(fn,args.length,args):fn.apply(that,args)};return isObject(fn.prototype)&&(boundFunction.prototype=fn.prototype),boundFunction}},{"../internals/a-function":2,"../internals/is-object":52}],39:[function(require,module,exports){function aFunction(variable){return"function"==typeof variable?variable:void 0}var path=require("../internals/path"),global=require("../internals/global");module.exports=function(namespace,method){return arguments.length<2?aFunction(path[namespace])||aFunction(global[namespace]):path[namespace]&&path[namespace][method]||global[namespace]&&global[namespace][method]}},{"../internals/global":41,"../internals/path":75}],40:[function(require,module,exports){var toObject=require("../internals/to-object"),floor=Math.floor,replace="".replace,SUBSTITUTION_SYMBOLS=/\$([$&'`]|\d\d?|<[^>]*>)/g,SUBSTITUTION_SYMBOLS_NO_NAMED=/\$([$&'`]|\d\d?)/g;module.exports=function(matched,str,position,captures,namedCaptures,replacement){var tailPos=position+matched.length,m=captures.length,symbols=SUBSTITUTION_SYMBOLS_NO_NAMED;return void 0!==namedCaptures&&(namedCaptures=toObject(namedCaptures),symbols=SUBSTITUTION_SYMBOLS),replace.call(replacement,symbols,function(match,ch){var capture;switch(ch.charAt(0)){case"$":return"$";case"&":return matched;case"`":return str.slice(0,position);case"'":return str.slice(tailPos);case"<":capture=namedCaptures[ch.slice(1,-1)];break;default:var n=+ch;if(0==n)return match;if(m<n){var f=floor(n/10);return 0===f?match:f<=m?void 0===captures[f-1]?ch.charAt(1):captures[f-1]+ch.charAt(1):match}capture=captures[n-1]}return void 0===capture?"":capture})}},{"../internals/to-object":97}],41:[function(require,module,exports){(function(global){function check(it){return it&&it.Math==Math&&it}module.exports=check("object"==typeof globalThis&&globalThis)||check("object"==typeof window&&window)||check("object"==typeof self&&self)||check("object"==typeof global&&global)||function{return this}||Function("return this")}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],42:[function(require,module,exports){var hasOwnProperty={}.hasOwnProperty;module.exports=function(it,key){return hasOwnProperty.call(it,key)}},{}],43:[function(require,module,exports){module.exports={}},{}],44:[function(require,module,exports){var getBuiltIn=require("../internals/get-built-in");module.exports=getBuiltIn("document","documentElement")},{"../internals/get-built-in":39}],45:[function(require,module,exports){var DESCRIPTORS=require("../internals/descriptors"),fails=require("../internals/fails"),createElement=require("../internals/document-create-element");module.exports=!DESCRIPTORS&&!fails(function{return 7!=Object.defineProperty(createElement("div"),"a",{get:function{return 7}}).a})},{"../internals/descriptors":26,"../internals/document-create-element":27,"../internals/fails":34}],46:[function(require,module,exports){var fails=require("../internals/fails"),classof=require("../internals/classof-raw"),split="".split;module.exports=fails(function{return!Object("z").propertyIsEnumerable(0)})?function(it){return"String"==classof(it)?split.call(it,""):Object(it)}:Object},{"../internals/classof-raw":16,"../internals/fails":34}],47:[function(require,module,exports){var isObject=require("../internals/is-object"),setPrototypeOf=require("../internals/object-set-prototype-of");module.exports=function($this,dummy,Wrapper){var NewTarget,NewTargetPrototype;return setPrototypeOf&&"function"==typeof(NewTarget=dummy.constructor)&&NewTarget!==Wrapper&&isObject(NewTargetPrototype=NewTarget.prototype)&&NewTargetPrototype!==Wrapper.prototype&&setPrototypeOf($this,NewTargetPrototype),$this}},{"../internals/is-object":52,"../internals/object-set-prototype-of":71}],48:[function(require,module,exports){var store=require("../internals/shared-store"),functionToString=Function.toString;"function"!=typeof store.inspectSource&&(store.inspectSource=function(it){return functionToString.call(it)}),module.exports=store.inspectSource},{"../internals/shared-store":87}],49:[function(require,module,exports){var set,get,has,NATIVE_WEAK_MAP=require("../internals/native-weak-map"),global=require("../internals/global"),isObject=require("../internals/is-object"),createNonEnumerableProperty=require("../internals/create-non-enumerable-property"),objectHas=require("../internals/has"),shared=require("../internals/shared-store"),sharedKey=require("../internals/shared-key"),hiddenKeys=require("../internals/hidden-keys"),WeakMap=global.WeakMap;if(NATIVE_WEAK_MAP){var store=shared.state||(shared.state=new WeakMap),wmget=store.get,wmhas=store.has,wmset=store.set;set=function(it,metadata){return metadata.facade=it,wmset.call(store,it,metadata),metadata},get=function(it){return wmget.call(store,it)||{}},has=function(it){return wmhas.call(store,it)}}else{var STATE=sharedKey("state");hiddenKeys[STATE]=!0,set=function(it,metadata){return metadata.facade=it,createNonEnumerableProperty(it,STATE,metadata),metadata},get=function(it){return objectHas(it,STATE)?it[STATE]:{}},has=function(it){return objectHas(it,STATE)}}module.exports={set:set,get:get,has:has,enforce:function(it){return has(it)?get(it):set(it,{})},getterFor:function(TYPE){return function(it){var state;if(!isObject(it)||(state=get(it)).type!==TYPE)throw TypeError("Incompatible receiver, "+TYPE+" required");return state}}}},{"../internals/create-non-enumerable-property":22,"../internals/global":41,"../internals/has":42,"../internals/hidden-keys":43,"../internals/is-object":52,"../internals/native-weak-map":58,"../internals/shared-key":86,"../internals/shared-store":87}],50:[function(require,module,exports){var classof=require("../internals/classof-raw");module.exports=Array.isArray||function(arg){return"Array"==classof(arg)}},{"../internals/classof-raw":16}],51:[function(require,module,exports){function isForced(feature,detection){var value=data[normalize(feature)];return value==POLYFILL||value!=NATIVE&&("function"==typeof detection?fails(detection):!!detection)}var fails=require("../internals/fails"),replacement=/#|\.prototype\./,normalize=isForced.normalize=function(string){return String(string).replace(replacement,".").toLowerCase},data=isForced.data={},NATIVE=isForced.NATIVE="N",POLYFILL=isForced.POLYFILL="P";module.exports=isForced},{"../internals/fails":34}],52:[function(require,module,exports){module.exports=function(it){return"object"==typeof it?null!==it:"function"==typeof it}},{}],53:[function(require,module,exports){module.exports=!1},{}],54:[function(require,module,exports){var isObject=require("../internals/is-object"),classof=require("../internals/classof-raw"),MATCH=require("../internals/well-known-symbol")("match");module.exports=function(it){var isRegExp;return isObject(it)&&(void 0!==(isRegExp=it[MATCH])?!!isRegExp:"RegExp"==classof(it))}},{"../internals/classof-raw":16,"../internals/is-object":52,"../internals/well-known-symbol":102}],55:[function(require,module,exports){"use strict";var IteratorPrototype,PrototypeOfArrayIteratorPrototype,arrayIterator,fails=require("../internals/fails"),getPrototypeOf=require("../internals/object-get-prototype-of"),createNonEnumerableProperty=require("../internals/create-non-enumerable-property"),has=require("../internals/has"),wellKnownSymbol=require("../internals/well-known-symbol"),IS_PURE=require("../internals/is-pure"),ITERATOR=wellKnownSymbol("iterator"),BUGGY_SAFARI_ITERATORS=!1;[].keys&&("next"in(arrayIterator=[].keys)?(PrototypeOfArrayIteratorPrototype=getPrototypeOf(getPrototypeOf(arrayIterator)))!==Object.prototype&&(IteratorPrototype=PrototypeOfArrayIteratorPrototype):BUGGY_SAFARI_ITERATORS=!0);var NEW_ITERATOR_PROTOTYPE=null==IteratorPrototype||fails(function{var test={};return IteratorPrototype[ITERATOR].call(test)!==test});NEW_ITERATOR_PROTOTYPE&&(IteratorPrototype={}),IS_PURE&&!NEW_ITERATOR_PROTOTYPE||has(IteratorPrototype,ITERATOR)||createNonEnumerableProperty(IteratorPrototype,ITERATOR,function{return this}),module.exports={IteratorPrototype:IteratorPrototype,BUGGY_SAFARI_ITERATORS:BUGGY_SAFARI_ITERATORS}},{"../internals/create-non-enumerable-property":22,"../internals/fails":34,"../internals/has":42,"../internals/is-pure":53,"../internals/object-get-prototype-of":67,"../internals/well-known-symbol":102}],56:[function(require,module,exports){arguments[4][43][0].apply(exports,arguments)},{dup:43}],57:[function(require,module,exports){var fails=require("../internals/fails");module.exports=!!Object.getOwnPropertySymbols&&!fails(function{return!String(Symbol)})},{"../internals/fails":34}],58:[function(require,module,exports){var global=require("../internals/global"),inspectSource=require("../internals/inspect-source"),WeakMap=global.WeakMap;module.exports="function"==typeof WeakMap&&/native code/.test(inspectSource(WeakMap))},{"../internals/global":41,"../internals/inspect-source":48}],59:[function(require,module,exports){var isRegExp=require("../internals/is-regexp");module.exports=function(it){if(isRegExp(it))throw TypeError("The method doesn't accept regular expressions");return it}},{"../internals/is-regexp":54}],60:[function(require,module,exports){var global=require("../internals/global"),trim=require("../internals/string-trim").trim,whitespaces=require("../internals/whitespaces"),$parseInt=global.parseInt,hex=/^[+-]?0[Xx]/,FORCED=8!==$parseInt(whitespaces+"08")||22!==$parseInt(whitespaces+"0x16");module.exports=FORCED?function(string,radix){var S=trim(String(string));return $parseInt(S,radix>>>0||(hex.test(S)?16:10))}:$parseInt},{"../internals/global":41,"../internals/string-trim":92,"../internals/whitespaces":103}],61:[function(require,module,exports){function EmptyConstructor{}function scriptTag(content){return" "+content+"<\/script>"}var activeXDocument,anObject=require("../internals/an-object"),defineProperties=require("../internals/object-define-properties"),enumBugKeys=require("../internals/enum-bug-keys"),hiddenKeys=require("../internals/hidden-keys"),html=require("../internals/html"),documentCreateElement=require("../internals/document-create-element"),sharedKey=require("../internals/shared-key"),IE_PROTO=sharedKey("IE_PROTO"),NullProtoObject=function{try{activeXDocument=document.domain&&new ActiveXObject("htmlfile")}catch(error){}var iframeDocument,iframe;NullProtoObject=activeXDocument?function(activeXDocument){activeXDocument.write(scriptTag("")),activeXDocument.close;var temp=activeXDocument.parentWindow.Object;return activeXDocument=null,temp}(activeXDocument):((iframe=documentCreateElement("iframe")).style.display="none",html.appendChild(iframe),iframe.src=String("javascript:"),(iframeDocument=iframe.contentWindow.document).open,iframeDocument.write(scriptTag("document.F=Object")),iframeDocument.close,iframeDocument.F);for(var length=enumBugKeys.length;length--;)delete NullProtoObject.prototype[enumBugKeys[length]];return NullProtoObject};hiddenKeys[IE_PROTO]=!0,module.exports=Object.create||function(O,Properties){var result;return null!==O?(EmptyConstructor.prototype=anObject(O),result=new EmptyConstructor,EmptyConstructor.prototype=null,result[IE_PROTO]=O):result=NullProtoObject,void 0===Properties?result:defineProperties(result,Properties)}},{"../internals/an-object":6,"../internals/document-create-element":27,"../internals/enum-bug-keys":32,"../internals/hidden-keys":43,"../internals/html":44,"../internals/object-define-properties":62,"../internals/shared-key":86}],62:[function(require,module,exports){var DESCRIPTORS=require("../internals/descriptors"),definePropertyModule=require("../internals/object-define-property"),anObject=require("../internals/an-object"),objectKeys=require("../internals/object-keys");module.exports=DESCRIPTORS?Object.defineProperties:function(O,Properties){anObject(O);for(var key,keys=objectKeys(Properties),length=keys.length,index=0;index<length;)definePropertyModule.f(O,key=keys[index++],Properties[key]);return O}},{"../internals/an-object":6,"../internals/descriptors":26,"../internals/object-define-property":63,"../internals/object-keys":69}],63:[function(require,module,exports){var DESCRIPTORS=require("../internals/descriptors"),IE8_DOM_DEFINE=require("../internals/ie8-dom-define"),anObject=require("../internals/an-object"),toPrimitive=require("../internals/to-primitive"),nativeDefineProperty=Object.defineProperty;exports.f=DESCRIPTORS?nativeDefineProperty:function(O,P,Attributes){if(anObject(O),P=toPrimitive(P,!0),anObject(Attributes),IE8_DOM_DEFINE)try{return nativeDefineProperty(O,P,Attributes)}catch(error){}if("get"in Attributes||"set"in Attributes)throw TypeError("Accessors not supported");return"value"in Attributes&&(O[P]=Attributes.value),O}},{"../internals/an-object":6,"../internals/descriptors":26,"../internals/ie8-dom-define":45,"../internals/to-primitive":98}],64:[function(require,module,exports){var DESCRIPTORS=require("../internals/descriptors"),propertyIsEnumerableModule=require("../internals/object-property-is-enumerable"),createPropertyDescriptor=require("../internals/create-property-descriptor"),toIndexedObject=require("../internals/to-indexed-object"),toPrimitive=require("../internals/to-primitive"),has=require("../internals/has"),IE8_DOM_DEFINE=require("../internals/ie8-dom-define"),nativeGetOwnPropertyDescriptor=Object.getOwnPropertyDescriptor;exports.f=DESCRIPTORS?nativeGetOwnPropertyDescriptor:function(O,P){if(O=toIndexedObject(O),P=toPrimitive(P,!0),IE8_DOM_DEFINE)try{return nativeGetOwnPropertyDescriptor(O,P)}catch(error){}if(has(O,P))return createPropertyDescriptor(!propertyIsEnumerableModule.f.call(O,P),O[P])}},{"../internals/create-property-descriptor":23,"../internals/descriptors":26,"../internals/has":42,"../internals/ie8-dom-define":45,"../internals/object-property-is-enumerable":70,"../internals/to-indexed-object":94,"../internals/to-primitive":98}],65:[function(require,module,exports){var internalObjectKeys=require("../internals/object-keys-internal"),hiddenKeys=require("../internals/enum-bug-keys").concat("length","prototype");exports.f=Object.getOwnPropertyNames||function(O){return internalObjectKeys(O,hiddenKeys)}},{"../internals/enum-bug-keys":32,"../internals/object-keys-internal":68}],66:[function(require,module,exports){exports.f=Object.getOwnPropertySymbols},{}],67:[function(require,module,exports){var has=require("../internals/has"),toObject=require("../internals/to-object"),sharedKey=require("../internals/shared-key"),CORRECT_PROTOTYPE_GETTER=require("../internals/correct-prototype-getter"),IE_PROTO=sharedKey("IE_PROTO"),ObjectPrototype=Object.prototype;module.exports=CORRECT_PROTOTYPE_GETTER?Object.getPrototypeOf:function(O){return O=toObject(O),has(O,IE_PROTO)?O[IE_PROTO]:"function"==typeof O.constructor&&O instanceof O.constructor?O.constructor.prototype:O instanceof Object?ObjectPrototype:null}},{"../internals/correct-prototype-getter":20,"../internals/has":42,"../internals/shared-key":86,"../internals/to-object":97}],68:[function(require,module,exports){var has=require("../internals/has"),toIndexedObject=require("../internals/to-indexed-object"),indexOf=require("../internals/array-includes").indexOf,hiddenKeys=require("../internals/hidden-keys");module.exports=function(object,names){var key,O=toIndexedObject(object),i=0,result=[];for(key in O)!has(hiddenKeys,key)&&has(O,key)&&result.push(key);for(names.length>i;)has(O,key=names[i++])&&(~indexOf(result,key)||result.push(key));return result}},{"../internals/array-includes":8,"../internals/has":42,"../internals/hidden-keys":43,"../internals/to-indexed-object":94}],69:[function(require,module,exports){var internalObjectKeys=require("../internals/object-keys-internal"),enumBugKeys=require("../internals/enum-bug-keys");module.exports=Object.keys||function(O){return internalObjectKeys(O,enumBugKeys)}},{"../internals/enum-bug-keys":32,"../internals/object-keys-internal":68}],70:[function(require,module,exports){"use strict";var nativePropertyIsEnumerable={}.propertyIsEnumerable,getOwnPropertyDescriptor=Object.getOwnPropertyDescriptor,NASHORN_BUG=getOwnPropertyDescriptor&&!nativePropertyIsEnumerable.call({1:2},1);exports.f=NASHORN_BUG?function(V){var descriptor=getOwnPropertyDescriptor(this,V);return!!descriptor&&descriptor.enumerable}:nativePropertyIsEnumerable},{}],71:[function(require,module,exports){var anObject=require("../internals/an-object"),aPossiblePrototype=require("../internals/a-possible-prototype");module.exports=Object.setPrototypeOf||("__proto__"in{}?function{var setter,CORRECT_SETTER=!1,test={};try{(setter=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(test,[]),CORRECT_SETTER=test instanceof Array}catch(error){}return function(O,proto){return anObject(O),aPossiblePrototype(proto),CORRECT_SETTER?setter.call(O,proto):O.__proto__=proto,O}}:void 0)},{"../internals/a-possible-prototype":3,"../internals/an-object":6}],72:[function(require,module,exports){function createMethod(TO_ENTRIES){return function(it){for(var key,O=toIndexedObject(it),keys=objectKeys(O),length=keys.length,i=0,result=[];i<length;)key=keys[i++],DESCRIPTORS&&!propertyIsEnumerable.call(O,key)||result.push(TO_ENTRIES?[key,O[key]]:O[key]);return result}}var DESCRIPTORS=require("../internals/descriptors"),objectKeys=require("../internals/object-keys"),toIndexedObject=require("../internals/to-indexed-object"),propertyIsEnumerable=require("../internals/object-property-is-enumerable").f;module.exports={entries:createMethod(!0),values:createMethod(!1)}},{"../internals/descriptors":26,"../internals/object-keys":69,"../internals/object-property-is-enumerable":70,"../internals/to-indexed-object":94}],73:[function(require,module,exports){"use strict";var TO_STRING_TAG_SUPPORT=require("../internals/to-string-tag-support"),classof=require("../internals/classof");module.exports=TO_STRING_TAG_SUPPORT?{}.toString:function{return"[object "+classof(this)+"]"}},{"../internals/classof":17,"../internals/to-string-tag-support":99}],74:[function(require,module,exports){var getBuiltIn=require("../internals/get-built-in"),getOwnPropertyNamesModule=require("../internals/object-get-own-property-names"),getOwnPropertySymbolsModule=require("../internals/object-get-own-property-symbols"),anObject=require("../internals/an-object");module.exports=getBuiltIn("Reflect","ownKeys")||function(it){var keys=getOwnPropertyNamesModule.f(anObject(it)),getOwnPropertySymbols=getOwnPropertySymbolsModule.f;return getOwnPropertySymbols?keys.concat(getOwnPropertySymbols(it)):keys}},{"../internals/an-object":6,"../internals/get-built-in":39,"../internals/object-get-own-property-names":65,"../internals/object-get-own-property-symbols":66}],75:[function(require,module,exports){var global=require("../internals/global");module.exports=global},{"../internals/global":41}],76:[function(require,module,exports){var global=require("../internals/global"),createNonEnumerableProperty=require("../internals/create-non-enumerable-property"),has=require("../internals/has"),setGlobal=require("../internals/set-global"),inspectSource=require("../internals/inspect-source"),InternalStateModule=require("../internals/internal-state"),getInternalState=InternalStateModule.get,enforceInternalState=InternalStateModule.enforce,TEMPLATE=String(String).split("String");(module.exports=function(O,key,value,options){var state,unsafe=!!options&&!!options.unsafe,simple=!!options&&!!options.enumerable,noTargetGet=!!options&&!!options.noTargetGet;"function"==typeof value&&("string"!=typeof key||has(value,"name")||createNonEnumerableProperty(value,"name",key),(state=enforceInternalState(value)).source||(state.source=TEMPLATE.join("string"==typeof key?key:""))),O!==global?(unsafe?!noTargetGet&&O[key]&&(simple=!0):delete O[key],simple?O[key]=value:createNonEnumerableProperty(O,key,value)):simple?O[key]=value:setGlobal(key,value)})(Function.prototype,"toString",function{return"function"==typeof this&&getInternalState(this).source||inspectSource(this)})},{"../internals/create-non-enumerable-property":22,"../internals/global":41,"../internals/has":42,"../internals/inspect-source":48,"../internals/internal-state":49,"../internals/set-global":83}],77:[function(require,module,exports){var classof=require("./classof-raw"),regexpExec=require("./regexp-exec");module.exports=function(R,S){var exec=R.exec;if("function"==typeof exec){var result=exec.call(R,S);if("object"!=typeof result)throw TypeError("RegExp exec method returned something other than an Object or null");return result}if("RegExp"!==classof(R))throw TypeError("RegExp#exec called on incompatible receiver");return regexpExec.call(R,S)}},{"./classof-raw":16,"./regexp-exec":78}],78:[function(require,module,exports){"use strict";var re1,re2,regexpFlags=require("./regexp-flags"),stickyHelpers=require("./regexp-sticky-helpers"),nativeExec=RegExp.prototype.exec,nativeReplace=String.prototype.replace,patchedExec=nativeExec,UPDATES_LAST_INDEX_WRONG=(re1=/a/,re2=/b*/g,nativeExec.call(re1,"a"),nativeExec.call(re2,"a"),0!==re1.lastIndex||0!==re2.lastIndex),UNSUPPORTED_Y=stickyHelpers.UNSUPPORTED_Y||stickyHelpers.BROKEN_CARET,NPCG_INCLUDED=void 0!==/??/.exec("")[1];(UPDATES_LAST_INDEX_WRONG||NPCG_INCLUDED||UNSUPPORTED_Y)&&(patchedExec=function(str){var lastIndex,reCopy,match,i,re=this,sticky=UNSUPPORTED_Y&&re.sticky,flags=regexpFlags.call(re),source=re.source,charsAdded=0,strCopy=str;return sticky&&(-1===(flags=flags.replace("y","")).indexOf("g")&&(flags+="g"),strCopy=String(str).slice(re.lastIndex),0<re.lastIndex&&(!re.multiline||re.multiline&&"\n"!==str[re.lastIndex-1])&&(source="(?: "+source+")",strCopy=" "+strCopy,charsAdded++),reCopy=new RegExp("^(?:"+source+")",flags)),NPCG_INCLUDED&&(reCopy=new RegExp("^"+source+"$(?!\\s)",flags)),UPDATES_LAST_INDEX_WRONG&&(lastIndex=re.lastIndex),match=nativeExec.call(sticky?reCopy:re,strCopy),sticky?match?(match.input=match.input.slice(charsAdded),match[0]=match[0].slice(charsAdded),match.index=re.lastIndex,re.lastIndex+=match[0].length):re.lastIndex=0:UPDATES_LAST_INDEX_WRONG&&match&&(re.lastIndex=re.global?match.index+match[0].length:lastIndex),NPCG_INCLUDED&&match&&1<match.length&&nativeReplace.call(match[0],reCopy,function{for(i=1;i<arguments.length-2;i++)void 0===arguments[i]&&(match[i]=void 0)}),match}),module.exports=patchedExec},{"./regexp-flags":79,"./regexp-sticky-helpers":80}],79:[function(require,module,exports){"use strict";var anObject=require("../internals/an-object");module.exports=function{var that=anObject(this),result="";return that.global&&(result+="g"),that.ignoreCase&&(result+="i"),that.multiline&&(result+="m"),that.dotAll&&(result+="s"),that.unicode&&(result+="u"),that.sticky&&(result+="y"),result}},{"../internals/an-object":6}],80:[function(require,module,exports){"use strict";var fails=require("./fails");function RE(s,f){return RegExp(s,f)}exports.UNSUPPORTED_Y=fails(function{var re=RE("a","y");return re.lastIndex=2,null!=re.exec("abcd")}),exports.BROKEN_CARET=fails(function{var re=RE("^r","gy");return re.lastIndex=2,null!=re.exec("str")})},{"./fails":34}],81:[function(require,module,exports){module.exports=function(it){if(null==it)throw TypeError("Can't call method on "+it);return it}},{}],82:[function(require,module,exports){module.exports=Object.is||function(x,y){return x===y?0!==x||1/x==1/y:x!=x&&y!=y}},{}],83:[function(require,module,exports){var global=require("../internals/global"),createNonEnumerableProperty=require("../internals/create-non-enumerable-property");module.exports=function(key,value){try{createNonEnumerableProperty(global,key,value)}catch(error){global[key]=value}return value}},{"../internals/create-non-enumerable-property":22,"../internals/global":41}],84:[function(require,module,exports){"use strict";var getBuiltIn=require("../internals/get-built-in"),definePropertyModule=require("../internals/object-define-property"),wellKnownSymbol=require("../internals/well-known-symbol"),DESCRIPTORS=require("../internals/descriptors"),SPECIES=wellKnownSymbol("species");module.exports=function(CONSTRUCTOR_NAME){var Constructor=getBuiltIn(CONSTRUCTOR_NAME),defineProperty=definePropertyModule.f;DESCRIPTORS&&Constructor&&!Constructor[SPECIES]&&defineProperty(Constructor,SPECIES,{configurable:!0,get:function{return this}})}},{"../internals/descriptors":26,"../internals/get-built-in":39,"../internals/object-define-property":63,"../internals/well-known-symbol":102}],85:[function(require,module,exports){var defineProperty=require("../internals/object-define-property").f,has=require("../internals/has"),TO_STRING_TAG=require("../internals/well-known-symbol")("toStringTag");module.exports=function(it,TAG,STATIC){it&&!has(it=STATIC?it:it.prototype,TO_STRING_TAG)&&defineProperty(it,TO_STRING_TAG,{configurable:!0,value:TAG})}},{"../internals/has":42,"../internals/object-define-property":63,"../internals/well-known-symbol":102}],86:[function(require,module,exports){var shared=require("../internals/shared"),uid=require("../internals/uid"),keys=shared("keys");module.exports=function(key){return keys[key]||(keys[key]=uid(key))}},{"../internals/shared":88,"../internals/uid":100}],87:[function(require,module,exports){var global=require("../internals/global"),setGlobal=require("../internals/set-global"),store=global["__core-js_shared__"]||setGlobal("__core-js_shared__",{});module.exports=store},{"../internals/global":41,"../internals/set-global":83}],88:[function(require,module,exports){var IS_PURE=require("../internals/is-pure"),store=require("../internals/shared-store");(module.exports=function(key,value){return store[key]||(store[key]=void 0!==value?value:{})})("versions",[]).push({version:"3.8.3",mode:IS_PURE?"pure":"global",copyright:"\xa9 2021 Denis Pushkarev (zloirock.ru)"})},{"../internals/is-pure":53,"../internals/shared-store":87}],89:[function(require,module,exports){var anObject=require("../internals/an-object"),aFunction=require("../internals/a-function"),SPECIES=require("../internals/well-known-symbol")("species");module.exports=function(O,defaultConstructor){var S,C=anObject(O).constructor;return void 0===C||null==(S=anObject(C)[SPECIES])?defaultConstructor:aFunction(S)}},{"../internals/a-function":2,"../internals/an-object":6,"../internals/well-known-symbol":102}],90:[function(require,module,exports){function createMethod(CONVERT_TO_STRING){return function($this,pos){var first,second,S=String(requireObjectCoercible($this)),position=toInteger(pos),size=S.length;return position<0||size<=position?CONVERT_TO_STRING?"":void 0:(first=S.charCodeAt(position))<55296||56319<first||position+1===size||(second=S.charCodeAt(position+1))<56320||57343<second?CONVERT_TO_STRING?S.charAt(position):first:CONVERT_TO_STRING?S.slice(position,position+2):second-56320+(first-55296<<10)+65536}}var toInteger=require("../internals/to-integer"),requireObjectCoercible=require("../internals/require-object-coercible");module.exports={codeAt:createMethod(!1),charAt:createMethod(!0)}},{"../internals/require-object-coercible":81,"../internals/to-integer":95}],91:[function(require,module,exports){var fails=require("../internals/fails"),whitespaces=require("../internals/whitespaces");module.exports=function(METHOD_NAME){return fails(function{return!!whitespaces[METHOD_NAME]||"\u200b\x85\u180e"!="\u200b\x85\u180e"[METHOD_NAME]||whitespaces[METHOD_NAME].name!==METHOD_NAME})}},{"../internals/fails":34,"../internals/whitespaces":103}],92:[function(require,module,exports){function createMethod(TYPE){return function($this){var string=String(requireObjectCoercible($this));return 1&TYPE&&(string=string.replace(ltrim,"")),2&TYPE&&(string=string.replace(rtrim,"")),string}}var requireObjectCoercible=require("../internals/require-object-coercible"),whitespace="["+require("../internals/whitespaces")+"]",ltrim=RegExp("^"+whitespace+whitespace+"*"),rtrim=RegExp(whitespace+whitespace+"*$");module.exports={start:createMethod(1),end:createMethod(2),trim:createMethod(3)}},{"../internals/require-object-coercible":81,"../internals/whitespaces":103}],93:[function(require,module,exports){var toInteger=require("../internals/to-integer"),max=Math.max,min=Math.min;module.exports=function(index,length){var integer=toInteger(index);return integer<0?max(integer+length,0):min(integer,length)}},{"../internals/to-integer":95}],94:[function(require,module,exports){var IndexedObject=require("../internals/indexed-object"),requireObjectCoercible=require("../internals/require-object-coercible");module.exports=function(it){return IndexedObject(requireObjectCoercible(it))}},{"../internals/indexed-object":46,"../internals/require-object-coercible":81}],95:[function(require,module,exports){var ceil=Math.ceil,floor=Math.floor;module.exports=function(argument){return isNaN(argument=+argument)?0:(0<argument?floor:ceil)(argument)}},{}],96:[function(require,module,exports){var toInteger=require("../internals/to-integer"),min=Math.min;module.exports=function(argument){return 0<argument?min(toInteger(argument),9007199254740991):0}},{"../internals/to-integer":95}],97:[function(require,module,exports){var requireObjectCoercible=require("../internals/require-object-coercible");module.exports=function(argument){return Object(requireObjectCoercible(argument))}},{"../internals/require-object-coercible":81}],98:[function(require,module,exports){var isObject=require("../internals/is-object");module.exports=function(input,PREFERRED_STRING){if(!isObject(input))return input;var fn,val;if(PREFERRED_STRING&&"function"==typeof(fn=input.toString)&&!isObject(val=fn.call(input)))return val;if("function"==typeof(fn=input.valueOf)&&!isObject(val=fn.call(input)))return val;if(!PREFERRED_STRING&&"function"==typeof(fn=input.toString)&&!isObject(val=fn.call(input)))return val;throw TypeError("Can't convert object to primitive value")}},{"../internals/is-object":52}],99:[function(require,module,exports){var test={};test[require("../internals/well-known-symbol")("toStringTag")]="z",module.exports="[object z]"===String(test)},{"../internals/well-known-symbol":102}],100:[function(require,module,exports){var id=0,postfix=Math.random;module.exports=function(key){return"Symbol("+String(void 0===key?"":key)+")_"+(++id+postfix).toString(36)}},{}],101:[function(require,module,exports){var NATIVE_SYMBOL=require("../internals/native-symbol");module.exports=NATIVE_SYMBOL&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},{"../internals/native-symbol":57}],102:[function(require,module,exports){var global=require("../internals/global"),shared=require("../internals/shared"),has=require("../internals/has"),uid=require("../internals/uid"),NATIVE_SYMBOL=require("../internals/native-symbol"),USE_SYMBOL_AS_UID=require("../internals/use-symbol-as-uid"),WellKnownSymbolsStore=shared("wks"),Symbol=global.Symbol,createWellKnownSymbol=USE_SYMBOL_AS_UID?Symbol:Symbol&&Symbol.withoutSetter||uid;module.exports=function(name){return has(WellKnownSymbolsStore,name)||(NATIVE_SYMBOL&&has(Symbol,name)?WellKnownSymbolsStore[name]=Symbol[name]:WellKnownSymbolsStore[name]=createWellKnownSymbol("Symbol."+name)),WellKnownSymbolsStore[name]}},{"../internals/global":41,"../internals/has":42,"../internals/native-symbol":57,"../internals/shared":88,"../internals/uid":100,"../internals/use-symbol-as-uid":101}],103:[function(require,module,exports){module.exports="\t\n\v\f\r \xa0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029\ufeff"},{}],104:[function(require,module,exports){"use strict";function isConcatSpreadable(O){if(isObject(O)){var spreadable=O[IS_CONCAT_SPREADABLE];return void 0!==spreadable?!!spreadable:isArray(O)}}var $=require("../internals/export"),fails=require("../internals/fails"),isArray=require("../internals/is-array"),isObject=require("../internals/is-object"),toObject=require("../internals/to-object"),toLength=require("../internals/to-length"),createProperty=require("../internals/create-property"),arraySpeciesCreate=require("../internals/array-species-create"),arrayMethodHasSpeciesSupport=require("../internals/array-method-has-species-support"),wellKnownSymbol=require("../internals/well-known-symbol"),V8_VERSION=require("../internals/engine-v8-version"),IS_CONCAT_SPREADABLE=wellKnownSymbol("isConcatSpreadable"),IS_CONCAT_SPREADABLE_SUPPORT=51<=V8_VERSION||!fails(function{var array=[];return array[IS_CONCAT_SPREADABLE]=!1,array.concat[0]!==array}),SPECIES_SUPPORT=arrayMethodHasSpeciesSupport("concat");$({target:"Array",proto:!0,forced:!IS_CONCAT_SPREADABLE_SUPPORT||!SPECIES_SUPPORT},{concat:function(arg){var i,k,length,len,E,O=toObject(this),A=arraySpeciesCreate(O,0),n=0;for(i=-1,length=arguments.length;i<length;i++)if(isConcatSpreadable(E=-1===i?O:arguments[i])){if(9007199254740991<n+(len=toLength(E.length)))throw TypeError("Maximum allowed index exceeded");for(k=0;k<len;k++,n++)k in E&&createProperty(A,n,E[k])}else{if(9007199254740991<=n)throw TypeError("Maximum allowed index exceeded");createProperty(A,n++,E)}return A.length=n,A}})},{"../internals/array-method-has-species-support":11,"../internals/array-species-create":15,"../internals/create-property":24,"../internals/engine-v8-version":31,"../internals/export":33,"../internals/fails":34,"../internals/is-array":50,"../internals/is-object":52,"../internals/to-length":96,"../internals/to-object":97,"../internals/well-known-symbol":102}],105:[function(require,module,exports){"use strict";var $=require("../internals/export"),$every=require("../internals/array-iteration").every,arrayMethodIsStrict=require("../internals/array-method-is-strict"),arrayMethodUsesToLength=require("../internals/array-method-uses-to-length"),STRICT_METHOD=arrayMethodIsStrict("every"),USES_TO_LENGTH=arrayMethodUsesToLength("every");$({target:"Array",proto:!0,forced:!STRICT_METHOD||!USES_TO_LENGTH},{every:function(callbackfn,argument_1){return $every(this,callbackfn,1<arguments.length?argument_1:void 0)}})},{"../internals/array-iteration":9,"../internals/array-method-is-strict":12,"../internals/array-method-uses-to-length":13,"../internals/export":33}],106:[function(require,module,exports){"use strict";var $=require("../internals/export"),$filter=require("../internals/array-iteration").filter,arrayMethodHasSpeciesSupport=require("../internals/array-method-has-species-support"),arrayMethodUsesToLength=require("../internals/array-method-uses-to-length"),HAS_SPECIES_SUPPORT=arrayMethodHasSpeciesSupport("filter"),USES_TO_LENGTH=arrayMethodUsesToLength("filter");$({target:"Array",proto:!0,forced:!HAS_SPECIES_SUPPORT||!USES_TO_LENGTH},{filter:function(callbackfn,argument_1){return $filter(this,callbackfn,1<arguments.length?argument_1:void 0)}})},{"../internals/array-iteration":9,"../internals/array-method-has-species-support":11,"../internals/array-method-uses-to-length":13,"../internals/export":33}],107:[function(require,module,exports){"use strict";var $=require("../internals/export"),$findIndex=require("../internals/array-iteration").findIndex,addToUnscopables=require("../internals/add-to-unscopables"),arrayMethodUsesToLength=require("../internals/array-method-uses-to-length"),SKIPS_HOLES=!0,USES_TO_LENGTH=arrayMethodUsesToLength("findIndex");"findIndex"in[]&&Array(1).findIndex(function{SKIPS_HOLES=!1}),$({target:"Array",proto:!0,forced:SKIPS_HOLES||!USES_TO_LENGTH},{findIndex:function(callbackfn,argument_1){return $findIndex(this,callbackfn,1<arguments.length?argument_1:void 0)}}),addToUnscopables("findIndex")},{"../internals/add-to-unscopables":4,"../internals/array-iteration":9,"../internals/array-method-uses-to-length":13,"../internals/export":33}],108:[function(require,module,exports){"use strict";var $=require("../internals/export"),$find=require("../internals/array-iteration").find,addToUnscopables=require("../internals/add-to-unscopables"),arrayMethodUsesToLength=require("../internals/array-method-uses-to-length"),SKIPS_HOLES=!0,USES_TO_LENGTH=arrayMethodUsesToLength("find");"find"in[]&&Array(1).find(function{SKIPS_HOLES=!1}),$({target:"Array",proto:!0,forced:SKIPS_HOLES||!USES_TO_LENGTH},{find:function(callbackfn,argument_1){return $find(this,callbackfn,1<arguments.length?argument_1:void 0)}}),addToUnscopables("find")},{"../internals/add-to-unscopables":4,"../internals/array-iteration":9,"../internals/array-method-uses-to-length":13,"../internals/export":33}],109:[function(require,module,exports){"use strict";var $=require("../internals/export"),flattenIntoArray=require("../internals/flatten-into-array"),toObject=require("../internals/to-object"),toLength=require("../internals/to-length"),aFunction=require("../internals/a-function"),arraySpeciesCreate=require("../internals/array-species-create");$({target:"Array",proto:!0},{flatMap:function(callbackfn,argument_1){var A,O=toObject(this),sourceLen=toLength(O.length);return aFunction(callbackfn),(A=arraySpeciesCreate(O,0)).length=flattenIntoArray(A,O,O,sourceLen,0,1,callbackfn,1<arguments.length?argument_1:void 0),A}})},{"../internals/a-function":2,"../internals/array-species-create":15,"../internals/export":33,"../internals/flatten-into-array":36,"../internals/to-length":96,"../internals/to-object":97}],110:[function(require,module,exports){"use strict";var $=require("../internals/export"),forEach=require("../internals/array-for-each");$({target:"Array",proto:!0,forced:[].forEach!=forEach},{forEach:forEach})},{"../internals/array-for-each":7,"../internals/export":33}],111:[function(require,module,exports){"use strict";var $=require("../internals/export"),$includes=require("../internals/array-includes").includes,addToUnscopables=require("../internals/add-to-unscopables");$({target:"Array",proto:!0,forced:!require("../internals/array-method-uses-to-length")("indexOf",{ACCESSORS:!0,1:0})},{includes:function(el,argument_1){return $includes(this,el,1<arguments.length?argument_1:void 0)}}),addToUnscopables("includes")},{"../internals/add-to-unscopables":4,"../internals/array-includes":8,"../internals/array-method-uses-to-length":13,"../internals/export":33}],112:[function(require,module,exports){"use strict";var $=require("../internals/export"),$indexOf=require("../internals/array-includes").indexOf,arrayMethodIsStrict=require("../internals/array-method-is-strict"),arrayMethodUsesToLength=require("../internals/array-method-uses-to-length"),nativeIndexOf=[].indexOf,NEGATIVE_ZERO=!!nativeIndexOf&&1/[1].indexOf(1,-0)<0,STRICT_METHOD=arrayMethodIsStrict("indexOf"),USES_TO_LENGTH=arrayMethodUsesToLength("indexOf",{ACCESSORS:!0,1:0});$({target:"Array",proto:!0,forced:NEGATIVE_ZERO||!STRICT_METHOD||!USES_TO_LENGTH},{indexOf:function(searchElement,argument_1){return NEGATIVE_ZERO?nativeIndexOf.apply(this,arguments)||0:$indexOf(this,searchElement,1<arguments.length?argument_1:void 0)}})},{"../internals/array-includes":8,"../internals/array-method-is-strict":12,"../internals/array-method-uses-to-length":13,"../internals/export":33}],113:[function(require,module,exports){"use strict";var toIndexedObject=require("../internals/to-indexed-object"),addToUnscopables=require("../internals/add-to-unscopables"),Iterators=require("../internals/iterators"),InternalStateModule=require("../internals/internal-state"),defineIterator=require("../internals/define-iterator"),setInternalState=InternalStateModule.set,getInternalState=InternalStateModule.getterFor("Array Iterator");module.exports=defineIterator(Array,"Array",function(iterated,kind){setInternalState(this,{type:"Array Iterator",target:toIndexedObject(iterated),index:0,kind:kind})},function{var state=getInternalState(this),target=state.target,kind=state.kind,index=state.index++;return!target||index>=target.length?{value:state.target=void 0,done:!0}:"keys"==kind?{value:index,done:!1}:"values"==kind?{value:target[index],done:!1}:{value:[index,target[index]],done:!1}},"values"),Iterators.Arguments=Iterators.Array,addToUnscopables("keys"),addToUnscopables("values"),addToUnscopables("entries")},{"../internals/add-to-unscopables":4,"../internals/define-iterator":25,"../internals/internal-state":49,"../internals/iterators":56,"../internals/to-indexed-object":94}],114:[function(require,module,exports){"use strict";var $=require("../internals/export"),IndexedObject=require("../internals/indexed-object"),toIndexedObject=require("../internals/to-indexed-object"),arrayMethodIsStrict=require("../internals/array-method-is-strict"),nativeJoin=[].join,ES3_STRINGS=IndexedObject!=Object,STRICT_METHOD=arrayMethodIsStrict("join",",");$({target:"Array",proto:!0,forced:ES3_STRINGS||!STRICT_METHOD},{join:function(separator){return nativeJoin.call(toIndexedObject(this),void 0===separator?",":separator)}})},{"../internals/array-method-is-strict":12,"../internals/export":33,"../internals/indexed-object":46,"../internals/to-indexed-object":94}],115:[function(require,module,exports){var $=require("../internals/export"),lastIndexOf=require("../internals/array-last-index-of");$({target:"Array",proto:!0,forced:lastIndexOf!==[].lastIndexOf},{lastIndexOf:lastIndexOf})},{"../internals/array-last-index-of":10,"../internals/export":33}],116:[function(require,module,exports){"use strict";var $=require("../internals/export"),$map=require("../internals/array-iteration").map,arrayMethodHasSpeciesSupport=require("../internals/array-method-has-species-support"),arrayMethodUsesToLength=require("../internals/array-method-uses-to-length"),HAS_SPECIES_SUPPORT=arrayMethodHasSpeciesSupport("map"),USES_TO_LENGTH=arrayMethodUsesToLength("map");$({target:"Array",proto:!0,forced:!HAS_SPECIES_SUPPORT||!USES_TO_LENGTH},{map:function(callbackfn,argument_1){return $map(this,callbackfn,1<arguments.length?argument_1:void 0)}})},{"../internals/array-iteration":9,"../internals/array-method-has-species-support":11,"../internals/array-method-uses-to-length":13,"../internals/export":33}],117:[function(require,module,exports){"use strict";var $=require("../internals/export"),$reduce=require("../internals/array-reduce").left,arrayMethodIsStrict=require("../internals/array-method-is-strict"),arrayMethodUsesToLength=require("../internals/array-method-uses-to-length"),CHROME_VERSION=require("../internals/engine-v8-version"),IS_NODE=require("../internals/engine-is-node"),STRICT_METHOD=arrayMethodIsStrict("reduce"),USES_TO_LENGTH=arrayMethodUsesToLength("reduce",{1:0});$({target:"Array",proto:!0,forced:!STRICT_METHOD||!USES_TO_LENGTH||!IS_NODE&&79<CHROME_VERSION&&CHROME_VERSION<83},{reduce:function(callbackfn,argument_1){return $reduce(this,callbackfn,arguments.length,1<arguments.length?argument_1:void 0)}})},{"../internals/array-method-is-strict":12,"../internals/array-method-uses-to-length":13,"../internals/array-reduce":14,"../internals/engine-is-node":29,"../internals/engine-v8-version":31,"../internals/export":33}],118:[function(require,module,exports){"use strict";var $=require("../internals/export"),isArray=require("../internals/is-array"),nativeReverse=[].reverse,test=[1,2];$({target:"Array",proto:!0,forced:String(test)===String(test.reverse)},{reverse:function{return isArray(this)&&(this.length=this.length),nativeReverse.call(this)}})},{"../internals/export":33,"../internals/is-array":50}],119:[function(require,module,exports){"use strict";var $=require("../internals/export"),isObject=require("../internals/is-object"),isArray=require("../internals/is-array"),toAbsoluteIndex=require("../internals/to-absolute-index"),toLength=require("../internals/to-length"),toIndexedObject=require("../internals/to-indexed-object"),createProperty=require("../internals/create-property"),wellKnownSymbol=require("../internals/well-known-symbol"),arrayMethodHasSpeciesSupport=require("../internals/array-method-has-species-support"),arrayMethodUsesToLength=require("../internals/array-method-uses-to-length"),HAS_SPECIES_SUPPORT=arrayMethodHasSpeciesSupport("slice"),USES_TO_LENGTH=arrayMethodUsesToLength("slice",{ACCESSORS:!0,0:0,1:2}),SPECIES=wellKnownSymbol("species"),nativeSlice=[].slice,max=Math.max;$({target:"Array",proto:!0,forced:!HAS_SPECIES_SUPPORT||!USES_TO_LENGTH},{slice:function(start,end){var Constructor,result,n,O=toIndexedObject(this),length=toLength(O.length),k=toAbsoluteIndex(start,length),fin=toAbsoluteIndex(void 0===end?length:end,length);if(isArray(O)&&(("function"==typeof(Constructor=O.constructor)&&(Constructor===Array||isArray(Constructor.prototype))||isObject(Constructor)&&null===(Constructor=Constructor[SPECIES]))&&(Constructor=void 0),Constructor===Array||void 0===Constructor))return nativeSlice.call(O,k,fin);for(result=new(void 0===Constructor?Array:Constructor)(max(fin-k,0)),n=0;k<fin;k++,n++)k in O&&createProperty(result,n,O[k]);return result.length=n,result}})},{"../internals/array-method-has-species-support":11,"../internals/array-method-uses-to-length":13,"../internals/create-property":24,"../internals/export":33,"../internals/is-array":50,"../internals/is-object":52,"../internals/to-absolute-index":93,"../internals/to-indexed-object":94,"../internals/to-length":96,"../internals/well-known-symbol":102}],120:[function(require,module,exports){"use strict";var $=require("../internals/export"),$some=require("../internals/array-iteration").some,arrayMethodIsStrict=require("../internals/array-method-is-strict"),arrayMethodUsesToLength=require("../internals/array-method-uses-to-length"),STRICT_METHOD=arrayMethodIsStrict("some"),USES_TO_LENGTH=arrayMethodUsesToLength("some");$({target:"Array",proto:!0,forced:!STRICT_METHOD||!USES_TO_LENGTH},{some:function(callbackfn,argument_1){return $some(this,callbackfn,1<arguments.length?argument_1:void 0)}})},{"../internals/array-iteration":9,"../internals/array-method-is-strict":12,"../internals/array-method-uses-to-length":13,"../internals/export":33}],121:[function(require,module,exports){require("../internals/add-to-unscopables")("flatMap")},{"../internals/add-to-unscopables":4}],122:[function(require,module,exports){require("../internals/export")({target:"Function",proto:!0},{bind:require("../internals/function-bind")})},{"../internals/export":33,"../internals/function-bind":38}],123:[function(require,module,exports){var DESCRIPTORS=require("../internals/descriptors"),defineProperty=require("../internals/object-define-property").f,FunctionPrototype=Function.prototype,FunctionPrototypeToString=FunctionPrototype.toString,nameRE=/^\s*function ([^ (]*)/;!DESCRIPTORS||"name"in FunctionPrototype||defineProperty(FunctionPrototype,"name",{configurable:!0,get:function{try{return FunctionPrototypeToString.call(this).match(nameRE)[1]}catch(error){return""}}})},{"../internals/descriptors":26,"../internals/object-define-property":63}],124:[function(require,module,exports){"use strict";function toNumber(argument){var first,third,radix,maxCode,digits,length,index,code,it=toPrimitive(argument,!1);if("string"==typeof it&&2<it.length)if(43===(first=(it=trim(it)).charCodeAt(0))||45===first){if(88===(third=it.charCodeAt(2))||120===third)return NaN}else if(48===first){switch(it.charCodeAt(1)){case 66:case 98:radix=2,maxCode=49;break;case 79:case 111:radix=8,maxCode=55;break;default:return+it}for(length=(digits=it.slice(2)).length,index=0;index<length;index++)if((code=digits.charCodeAt(index))<48||maxCode<code)return NaN;return parseInt(digits,radix)}return+it}var DESCRIPTORS=require("../internals/descriptors"),global=require("../internals/global"),isForced=require("../internals/is-forced"),redefine=require("../internals/redefine"),has=require("../internals/has"),classof=require("../internals/classof-raw"),inheritIfRequired=require("../internals/inherit-if-required"),toPrimitive=require("../internals/to-primitive"),fails=require("../internals/fails"),create=require("../internals/object-create"),getOwnPropertyNames=require("../internals/object-get-own-property-names").f,getOwnPropertyDescriptor=require("../internals/object-get-own-property-descriptor").f,defineProperty=require("../internals/object-define-property").f,trim=require("../internals/string-trim").trim,NativeNumber=global.Number,NumberPrototype=NativeNumber.prototype,BROKEN_CLASSOF="Number"==classof(create(NumberPrototype));if(isForced("Number",!NativeNumber(" 0o1")||!NativeNumber("0b1")||NativeNumber("+0x1"))){for(var key,NumberWrapper=function(value){var it=arguments.length<1?0:value,dummy=this;return dummy instanceof NumberWrapper&&(BROKEN_CLASSOF?fails(function{NumberPrototype.valueOf.call(dummy)}):"Number"!=classof(dummy))?inheritIfRequired(new NativeNumber(toNumber(it)),dummy,NumberWrapper):toNumber(it)},keys=DESCRIPTORS?getOwnPropertyNames(NativeNumber):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger,fromString,range".split(","),j=0;keys.length>j;j++)has(NativeNumber,key=keys[j])&&!has(NumberWrapper,key)&&defineProperty(NumberWrapper,key,getOwnPropertyDescriptor(NativeNumber,key));redefine(global,"Number",(NumberWrapper.prototype=NumberPrototype).constructor=NumberWrapper)}},{"../internals/classof-raw":16,"../internals/descriptors":26,"../internals/fails":34,"../internals/global":41,"../internals/has":42,"../internals/inherit-if-required":47,"../internals/is-forced":51,"../internals/object-create":61,"../internals/object-define-property":63,"../internals/object-get-own-property-descriptor":64,"../internals/object-get-own-property-names":65,"../internals/redefine":76,"../internals/string-trim":92,"../internals/to-primitive":98}],125:[function(require,module,exports){var $=require("../internals/export"),DESCRIPTORS=require("../internals/descriptors");$({target:"Object",stat:!0,forced:!DESCRIPTORS,sham:!DESCRIPTORS},{defineProperty:require("../internals/object-define-property").f})},{"../internals/descriptors":26,"../internals/export":33,"../internals/object-define-property":63}],126:[function(require,module,exports){var $=require("../internals/export"),toObject=require("../internals/to-object"),nativeKeys=require("../internals/object-keys");$({target:"Object",stat:!0,forced:require("../internals/fails")(function{nativeKeys(1)})},{keys:function(it){return nativeKeys(toObject(it))}})},{"../internals/export":33,"../internals/fails":34,"../internals/object-keys":69,"../internals/to-object":97}],127:[function(require,module,exports){require("../internals/export")({target:"Object",stat:!0},{setPrototypeOf:require("../internals/object-set-prototype-of")})},{"../internals/export":33,"../internals/object-set-prototype-of":71}],128:[function(require,module,exports){var TO_STRING_TAG_SUPPORT=require("../internals/to-string-tag-support"),redefine=require("../internals/redefine"),toString=require("../internals/object-to-string");TO_STRING_TAG_SUPPORT||redefine(Object.prototype,"toString",toString,{unsafe:!0})},{"../internals/object-to-string":73,"../internals/redefine":76,"../internals/to-string-tag-support":99}],129:[function(require,module,exports){var $=require("../internals/export"),$values=require("../internals/object-to-array").values;$({target:"Object",stat:!0},{values:function(O){return $values(O)}})},{"../internals/export":33,"../internals/object-to-array":72}],130:[function(require,module,exports){var $=require("../internals/export"),parseIntImplementation=require("../internals/number-parse-int");$({global:!0,forced:parseInt!=parseIntImplementation},{parseInt:parseIntImplementation})},{"../internals/export":33,"../internals/number-parse-int":60}],131:[function(require,module,exports){var DESCRIPTORS=require("../internals/descriptors"),global=require("../internals/global"),isForced=require("../internals/is-forced"),inheritIfRequired=require("../internals/inherit-if-required"),defineProperty=require("../internals/object-define-property").f,getOwnPropertyNames=require("../internals/object-get-own-property-names").f,isRegExp=require("../internals/is-regexp"),getFlags=require("../internals/regexp-flags"),stickyHelpers=require("../internals/regexp-sticky-helpers"),redefine=require("../internals/redefine"),fails=require("../internals/fails"),setInternalState=require("../internals/internal-state").set,setSpecies=require("../internals/set-species"),MATCH=require("../internals/well-known-symbol")("match"),NativeRegExp=global.RegExp,RegExpPrototype=NativeRegExp.prototype,re1=/a/g,re2=/a/g,CORRECT_NEW=new NativeRegExp(re1)!==re1,UNSUPPORTED_Y=stickyHelpers.UNSUPPORTED_Y;if(DESCRIPTORS&&isForced("RegExp",!CORRECT_NEW||UNSUPPORTED_Y||fails(function{return re2[MATCH]=!1,NativeRegExp(re1)!=re1||NativeRegExp(re2)==re2||"/a/i"!=NativeRegExp(re1,"i")}))){function proxy(key){key in RegExpWrapper||defineProperty(RegExpWrapper,key,{configurable:!0,get:function{return NativeRegExp[key]},set:function(it){NativeRegExp[key]=it}})}for(var RegExpWrapper=function(pattern,flags){var sticky,thisIsRegExp=this instanceof RegExpWrapper,patternIsRegExp=isRegExp(pattern),flagsAreUndefined=void 0===flags;if(!thisIsRegExp&&patternIsRegExp&&pattern.constructor===RegExpWrapper&&flagsAreUndefined)return pattern;CORRECT_NEW?patternIsRegExp&&!flagsAreUndefined&&(pattern=pattern.source):pattern instanceof RegExpWrapper&&(flagsAreUndefined&&(flags=getFlags.call(pattern)),pattern=pattern.source),UNSUPPORTED_Y&&(sticky=!!flags&&-1index;)proxy(keys[index++]);(RegExpPrototype.constructor=RegExpWrapper).prototype=RegExpPrototype,redefine(global,"RegExp",RegExpWrapper)}setSpecies("RegExp")},{"../internals/descriptors":26,"../internals/fails":34,"../internals/global":41,"../internals/inherit-if-required":47,"../internals/internal-state":49,"../internals/is-forced":51,"../internals/is-regexp":54,"../internals/object-define-property":63,"../internals/object-get-own-property-names":65,"../internals/redefine":76,"../internals/regexp-flags":79,"../internals/regexp-sticky-helpers":80,"../internals/set-species":84,"../internals/well-known-symbol":102}],132:[function(require,module,exports){"use strict";var $=require("../internals/export"),exec=require("../internals/regexp-exec");$({target:"RegExp",proto:!0,forced:/./.exec!==exec},{exec:exec})},{"../internals/export":33,"../internals/regexp-exec":78}],133:[function(require,module,exports){"use strict";var redefine=require("../internals/redefine"),anObject=require("../internals/an-object"),fails=require("../internals/fails"),flags=require("../internals/regexp-flags"),RegExpPrototype=RegExp.prototype,nativeToString=RegExpPrototype.toString,NOT_GENERIC=fails(function{return"/a/b"!=nativeToString.call({source:"a",flags:"b"})}),INCORRECT_NAME="toString"!=nativeToString.name;(NOT_GENERIC||INCORRECT_NAME)&&redefine(RegExp.prototype,"toString",function{var R=anObject(this),p=String(R.source),rf=R.flags;return"/"+p+"/"+String(void 0===rf&&R instanceof RegExp&&!("flags"in RegExpPrototype)?flags.call(R):rf)},{unsafe:!0})},{"../internals/an-object":6,"../internals/fails":34,"../internals/redefine":76,"../internals/regexp-flags":79}],134:[function(require,module,exports){"use strict";var $=require("../internals/export"),notARegExp=require("../internals/not-a-regexp"),requireObjectCoercible=require("../internals/require-object-coercible");$({target:"String",proto:!0,forced:!require("../internals/correct-is-regexp-logic")("includes")},{includes:function(searchString,argument_1){return!!~String(requireObjectCoercible(this)).indexOf(notARegExp(searchString),1<arguments.length?argument_1:void 0)}})},{"../internals/correct-is-regexp-logic":19,"../internals/export":33,"../internals/not-a-regexp":59,"../internals/require-object-coercible":81}],135:[function(require,module,exports){"use strict";var fixRegExpWellKnownSymbolLogic=require("../internals/fix-regexp-well-known-symbol-logic"),anObject=require("../internals/an-object"),toLength=require("../internals/to-length"),requireObjectCoercible=require("../internals/require-object-coercible"),advanceStringIndex=require("../internals/advance-string-index"),regExpExec=require("../internals/regexp-exec-abstract");fixRegExpWellKnownSymbolLogic("match",1,function(MATCH,nativeMatch,maybeCallNative){return[function(regexp){var O=requireObjectCoercible(this),matcher=null==regexp?void 0:regexp[MATCH];return void 0!==matcher?matcher.call(regexp,O):new RegExp(regexp)[MATCH](String(O))},function(regexp){var res=maybeCallNative(nativeMatch,regexp,this);if(res.done)return res.value;var rx=anObject(regexp),S=String(this);if(!rx.global)return regExpExec(rx,S);for(var result,fullUnicode=rx.unicode,A=[],n=rx.lastIndex=0;null!==(result=regExpExec(rx,S));){var matchStr=String(result[0]);""===(A[n]=matchStr)&&(rx.lastIndex=advanceStringIndex(S,toLength(rx.lastIndex),fullUnicode)),n++}return 0===n?null:A}]})},{"../internals/advance-string-index":5,"../internals/an-object":6,"../internals/fix-regexp-well-known-symbol-logic":35,"../internals/regexp-exec-abstract":77,"../internals/require-object-coercible":81,"../internals/to-length":96}],136:[function(require,module,exports){"use strict";var fixRegExpWellKnownSymbolLogic=require("../internals/fix-regexp-well-known-symbol-logic"),anObject=require("../internals/an-object"),toLength=require("../internals/to-length"),toInteger=require("../internals/to-integer"),requireObjectCoercible=require("../internals/require-object-coercible"),advanceStringIndex=require("../internals/advance-string-index"),getSubstitution=require("../internals/get-substitution"),regExpExec=require("../internals/regexp-exec-abstract"),max=Math.max,min=Math.min;fixRegExpWellKnownSymbolLogic("replace",2,function(REPLACE,nativeReplace,maybeCallNative,reason){var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE=reason.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,REPLACE_KEEPS_$0=reason.REPLACE_KEEPS_$0,UNSAFE_SUBSTITUTE=REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE?"$":"$0";return[function(searchValue,replaceValue){var O=requireObjectCoercible(this),replacer=null==searchValue?void 0:searchValue[REPLACE];return void 0!==replacer?replacer.call(searchValue,O,replaceValue):nativeReplace.call(String(O),searchValue,replaceValue)},function(regexp,replaceValue){if(!REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE&&REPLACE_KEEPS_$0||"string"==typeof replaceValue&&-1===replaceValue.indexOf(UNSAFE_SUBSTITUTE)){var res=maybeCallNative(nativeReplace,regexp,this,replaceValue);if(res.done)return res.value}var rx=anObject(regexp),S=String(this),functionalReplace="function"==typeof replaceValue;functionalReplace||(replaceValue=String(replaceValue));var global=rx.global;if(global){var fullUnicode=rx.unicode;rx.lastIndex=0}for(var results=[];;){var result=regExpExec(rx,S);if(null===result)break;if(results.push(result),!global)break;""===String(result[0])&&(rx.lastIndex=advanceStringIndex(S,toLength(rx.lastIndex),fullUnicode))}for(var it,accumulatedResult="",nextSourcePosition=0,i=0;i<results.length;i++){result=results[i];for(var matched=String(result[0]),position=max(min(toInteger(result.index),S.length),0),captures=[],j=1;j<result.length;j++)captures.push(void 0===(it=result[j])?it:String(it));var namedCaptures=result.groups;if(functionalReplace){var replacerArgs=[matched].concat(captures,position,S);void 0!==namedCaptures&&replacerArgs.push(namedCaptures);var replacement=String(replaceValue.apply(void 0,replacerArgs))}else replacement=getSubstitution(matched,S,position,captures,namedCaptures,replaceValue);nextSourcePosition<=position&&(accumulatedResult+=S.slice(nextSourcePosition,position)+replacement,nextSourcePosition=position+matched.length)}return accumulatedResult+S.slice(nextSourcePosition)}]})},{"../internals/advance-string-index":5,"../internals/an-object":6,"../internals/fix-regexp-well-known-symbol-logic":35,"../internals/get-substitution":40,"../internals/regexp-exec-abstract":77,"../internals/require-object-coercible":81,"../internals/to-integer":95,"../internals/to-length":96}],137:[function(require,module,exports){"use strict";var fixRegExpWellKnownSymbolLogic=require("../internals/fix-regexp-well-known-symbol-logic"),anObject=require("../internals/an-object"),requireObjectCoercible=require("../internals/require-object-coercible"),sameValue=require("../internals/same-value"),regExpExec=require("../internals/regexp-exec-abstract");fixRegExpWellKnownSymbolLogic("search",1,function(SEARCH,nativeSearch,maybeCallNative){return[function(regexp){var O=requireObjectCoercible(this),searcher=null==regexp?void 0:regexp[SEARCH];return void 0!==searcher?searcher.call(regexp,O):new RegExp(regexp)[SEARCH](String(O))},function(regexp){var res=maybeCallNative(nativeSearch,regexp,this);if(res.done)return res.value;var rx=anObject(regexp),S=String(this),previousLastIndex=rx.lastIndex;sameValue(previousLastIndex,0)||(rx.lastIndex=0);var result=regExpExec(rx,S);return sameValue(rx.lastIndex,previousLastIndex)||(rx.lastIndex=previousLastIndex),null===result?-1:result.index}]})},{"../internals/an-object":6,"../internals/fix-regexp-well-known-symbol-logic":35,"../internals/regexp-exec-abstract":77,"../internals/require-object-coercible":81,"../internals/same-value":82}],138:[function(require,module,exports){"use strict";var fixRegExpWellKnownSymbolLogic=require("../internals/fix-regexp-well-known-symbol-logic"),isRegExp=require("../internals/is-regexp"),anObject=require("../internals/an-object"),requireObjectCoercible=require("../internals/require-object-coercible"),speciesConstructor=require("../internals/species-constructor"),advanceStringIndex=require("../internals/advance-string-index"),toLength=require("../internals/to-length"),callRegExpExec=require("../internals/regexp-exec-abstract"),regexpExec=require("../internals/regexp-exec"),fails=require("../internals/fails"),arrayPush=[].push,min=Math.min,SUPPORTS_Y=!fails(function{return!RegExp(4294967295,"y")});fixRegExpWellKnownSymbolLogic("split",2,function(SPLIT,nativeSplit,maybeCallNative){var internalSplit;return internalSplit="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||1<".".split(//).length||"".split(/.?/).length?function(separator,limit){var string=String(requireObjectCoercible(this)),lim=void 0===limit?4294967295:limit>>>0;if(0==lim)return[];if(void 0===separator)return[string];if(!isRegExp(separator))return nativeSplit.call(string,separator,lim);for(var match,lastIndex,lastLength,output=[],flags=(separator.ignoreCase?"i":"")+(separator.multiline?"m":"")+(separator.unicode?"u":"")+(separator.sticky?"y":""),lastLastIndex=0,separatorCopy=new RegExp(separator.source,flags+"g");(match=regexpExec.call(separatorCopy,string))&&!(lastLastIndex<(lastIndex=separatorCopy.lastIndex)&&(output.push(string.slice(lastLastIndex,match.index)),1=lim));)separatorCopy.lastIndex===match.index&&separatorCopy.lastIndex++;return lastLastIndex===string.length?!lastLength&&separatorCopy.test("")||output.push(""):output.push(string.slice(lastLastIndex)),output.length>lim?output.slice(0,lim):output}:"0".split(void 0,0).length?function(separator,limit){return void 0===separator&&0===limit?[]:nativeSplit.call(this,separator,limit)}:nativeSplit,[function(separator,limit){var O=requireObjectCoercible(this),splitter=null==separator?void 0:separator[SPLIT];return void 0!==splitter?splitter.call(separator,O,limit):internalSplit.call(String(O),separator,limit)},function(regexp,limit){var res=maybeCallNative(internalSplit,regexp,this,limit,internalSplit!==nativeSplit);if(res.done)return res.value;var rx=anObject(regexp),S=String(this),C=speciesConstructor(rx,RegExp),unicodeMatching=rx.unicode,flags=(rx.ignoreCase?"i":"")+(rx.multiline?"m":"")+(rx.unicode?"u":"")+(SUPPORTS_Y?"y":"g"),splitter=new C(SUPPORTS_Y?rx:"^(?:"+rx.source+")",flags),lim=void 0===limit?4294967295:limit>>>0;if(0==lim)return[];if(0===S.length)return null===callRegExpExec(splitter,S)?[S]:[];for(var p=0,q=0,A=[];q<S.length;){splitter.lastIndex=SUPPORTS_Y?q:0;var e,z=callRegExpExec(splitter,SUPPORTS_Y?S:S.slice(q));if(null===z||(e=min(toLength(splitter.lastIndex+(SUPPORTS_Y?0:q)),S.length))===p)q=advanceStringIndex(S,q,unicodeMatching);else{if(A.push(S.slice(p,q)),A.length===lim)return A;for(var i=1;i<=z.length-1;i++)if(A.push(z[i]),A.length===lim)return A;q=p=e}}return A.push(S.slice(p)),A}]},!SUPPORTS_Y)},{"../internals/advance-string-index":5,"../internals/an-object":6,"../internals/fails":34,"../internals/fix-regexp-well-known-symbol-logic":35,"../internals/is-regexp":54,"../internals/regexp-exec":78,"../internals/regexp-exec-abstract":77,"../internals/require-object-coercible":81,"../internals/species-constructor":89,"../internals/to-length":96}],139:[function(require,module,exports){"use strict";var $=require("../internals/export"),$trim=require("../internals/string-trim").trim;$({target:"String",proto:!0,forced:require("../internals/string-trim-forced")("trim")},{trim:function{return $trim(this)}})},{"../internals/export":33,"../internals/string-trim":92,"../internals/string-trim-forced":91}],140:[function(require,module,exports){var global=require("../internals/global"),DOMIterables=require("../internals/dom-iterables"),forEach=require("../internals/array-for-each"),createNonEnumerableProperty=require("../internals/create-non-enumerable-property");for(var COLLECTION_NAME in DOMIterables){var Collection=global[COLLECTION_NAME],CollectionPrototype=Collection&&Collection.prototype;if(CollectionPrototype&&CollectionPrototype.forEach!==forEach)try{createNonEnumerableProperty(CollectionPrototype,"forEach",forEach)}catch(error){CollectionPrototype.forEach=forEach}}},{"../internals/array-for-each":7,"../internals/create-non-enumerable-property":22,"../internals/dom-iterables":28,"../internals/global":41}],141:[function(require,module,exports){var global=require("../internals/global"),DOMIterables=require("../internals/dom-iterables"),ArrayIteratorMethods=require("../modules/es.array.iterator"),createNonEnumerableProperty=require("../internals/create-non-enumerable-property"),wellKnownSymbol=require("../internals/well-known-symbol"),ITERATOR=wellKnownSymbol("iterator"),TO_STRING_TAG=wellKnownSymbol("toStringTag"),ArrayValues=ArrayIteratorMethods.values;for(var COLLECTION_NAME in DOMIterables){var Collection=global[COLLECTION_NAME],CollectionPrototype=Collection&&Collection.prototype;if(CollectionPrototype){if(CollectionPrototype[ITERATOR]!==ArrayValues)try{createNonEnumerableProperty(CollectionPrototype,ITERATOR,ArrayValues)}catch(error){CollectionPrototype[ITERATOR]=ArrayValues}if(CollectionPrototype[TO_STRING_TAG]||createNonEnumerableProperty(CollectionPrototype,TO_STRING_TAG,COLLECTION_NAME),DOMIterables[COLLECTION_NAME])for(var METHOD_NAME in ArrayIteratorMethods)if(CollectionPrototype[METHOD_NAME]!==ArrayIteratorMethods[METHOD_NAME])try{createNonEnumerableProperty(CollectionPrototype,METHOD_NAME,ArrayIteratorMethods[METHOD_NAME])}catch(error){CollectionPrototype[METHOD_NAME]=ArrayIteratorMethods[METHOD_NAME]}}}},{"../internals/create-non-enumerable-property":22,"../internals/dom-iterables":28,"../internals/global":41,"../internals/well-known-symbol":102,"../modules/es.array.iterator":113}],142:[function(require,module,exports){module.exports={name:"xfdcloser",version:"4.0.16",description:"Wikipedia userscript that helps assess pages for WikiProjects",homepage:"https://github.com/wikimedia-gadgets/xfdcloser",browser:"index.js",scripts:{test:"npm run globals:node && mocha --require @babel/register --reporter list && npm run globals:window","test:all":"node bin/testall && npm run test","test:delay":"mocha --delay --require @babel/register --reporter list","lint:es5":'jshint "dist/loader-dev.js" "dist/loader-gadget.js"',"lint:es5:dev":'jshint "dist/loader-dev.js"',"lint:css":'stylelint "styles-src/**/*.css"',"lint:es6":'eslint "xfdcloser-src/**/*.js" "test/*"',"lint:bin":'eslint "bin/*.js" --env node',lint:"npm run lint:es6 && npm run lint:es5 && npm run lint:css","lint:dev":"npm run lint:es6 && npm run lint:es5:dev && npm run lint:css","lint:css:fix":'stylelint "styles-src/**/*.css" --fix',"lint:es6:fix":'eslint "xfdcloser-src/**/*.js" "test/*" --fix',"lint:bin:fix":'eslint "bin/*.js" --fix --env node',"lint:fix":"npm run lint:es6:fix && npm run lint:bin:fix && npm run lint:css:fix","globals:node":'concat-cli -f "globals-src/comment.js" "globals-src/node.js" -o "globals.js"',"globals:window":'concat-cli -f "globals-src/comment.js" "globals-src/window.js" -o "globals.js"',"build:loader:dev":'concat-cli -f "loader-src/loader-dev-top.js.txt" "loader-src/loader-core.js.txt" "loader-src/loader-dev-bottom.js.txt" -o dist/loader-dev.js',"build:loader:gadget":'concat-cli -f "core-comment-top.js" "loader-src/loader-gadget-top.js.txt" "loader-src/loader-core.js.txt" "loader-src/loader-gadget-bottom.js.txt" "core-comment-bottom.js" -o dist/loader-gadget.js',"build:loader":"npm run build:loader:dev && npm run build:loader:gadget","build:bundle":"browserify xfdcloser-src/App.js --debug -t babelify --outfile dist/core.js","build:minify":"uglifyjs dist/core.js --compress -b ascii_only=true,beautify=false --output dist/core.min.js","build:concat":'concat-cli -f "core-comment-top.js" dist/core.min.js "core-comment-bottom.js" -o dist/core-gadget.js',"build:css":"node bin/concatCss",build:"npm run globals:window && npm run build:loader && npm run lint && npm run test:all && npm run build:css && npm run build:bundle && npm run build:minify && npm run build:concat","build:dev":"npm run globals:window && npm run build:loader:dev && npm run build:css && npm run build:bundle","build:quickdev":"npm run globals:window && npm run build:loader:dev && npm run build:bundle "},author:{name:"Evad37",url:"https://en.wikipedia.org/wiki/User:Evad37"},repository:{type:"git",url:"https://github.com/wikimedia-gadgets/xfdcloser.git"},license:"(MIT OR CC-BY-4.0)",devDependencies:{"@babel/core":"^7.11.0","@babel/eslint-parser":"^7.17.0","@babel/plugin-proposal-class-properties":"^7.8.3","@babel/preset-env":"^7.9.0","@babel/register":"^7.9.0",babelify:"^10.0.0",browserify:"^16.5.0",concat:"^1.0.3","concat-cli":"^4.0.0","core-js":"^3.8.3",eslint:"^8.9.0",jquery:"^3.5.1",jsdom:"^16.2.2",jshint:"^2.13.4","mediawiki-title":"^0.7.2",mocha:"^9.2.0",mwn:"^0.9.0",oojs:"^5.0.0","prompt-sync":"^4.2.0","replace-in-file":"^6.0.0",stylelint:"^14.5.0","stylelint-config-standard":"^25.0.0","uglify-js":"^3.8.0"}}},{}],143:[function(require,module,exports){"use strict";require("core-js/modules/es.array.concat"),require("core-js/modules/es.array.find"),require("core-js/modules/es.array.includes"),require("core-js/modules/es.array.slice"),require("core-js/modules/es.regexp.exec"),require("core-js/modules/es.string.includes"),require("core-js/modules/es.string.replace");var _globals=require("../globals"),_config=_interopRequireDefault(require("./config")),_ShowHideTag=_interopRequireDefault(require("./ShowHideTag")),_windowSetManager=_interopRequireDefault(require("./windowSetManager")),_DiscussionView=_interopRequireDefault(require("./Views/DiscussionView"));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _createForOfIteratorHelper(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=function(o,minLen){if(!o)return;if("string"==typeof o)return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function{};return{s:F,n:function{return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function(_e){throw _e},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator] method.")}var err,normalCompletion=!0,didErr=!1;return{s:function{it=it.call(o)},n:function{var step=it.next;return normalCompletion=step.done,step},e:function(_e2){didErr=!0,err=_e2},f:function{try{normalCompletion||null==it.return||it.return}finally{if(didErr)throw err}}}}function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}!function{if(_config.default.mw.wgUserGroups.includes("extendedconfirmed")||_config.default.mw.wgUserGroups.includes("sysop")||"testwiki"===_config.default.mw.wgDBname)if((0,_globals.$)(window).on("beforeunload",function(e){if(_windowSetManager.default.hasOpenWindows)return e.returnValue=""}),_globals.mw.util.addPortletLink("p-cactions","#","XFDC prefs","p-xfdc-prefs","XFDcloser preferences"),(0,_globals.$)("#p-xfdc-prefs").click(function(e){e.preventDefault,_windowSetManager.default.openWindow("prefs",{userIsSysop:_config.default.user.isSysop})}),0===_config.default.mw.wgArticleId)_globals.mw.util.addPortletLink("p-cactions","#","XFDC Unlink","p-xfdc-unlink","Unlink backlinks using XFDcloser"),(0,_globals.$)("#p-xfdc-unlink").click(function(e){e.preventDefault;var comment="",$commentEl=(0,_globals.$)(".mw-logline-delete").first.find(".comment").first;if($commentEl.length){var _step,_iterator=_createForOfIteratorHelper($commentEl.get[0].childNodes);try{for(_iterator.s;!(_step=_iterator.n).done;){var child=_step.value;if("A"==child.nodeName){var target=child.href.replace(/^.*?\/wiki\//,"").replace(/_/g," "),label=child.textContent;comment+=target===label?"".concat(label,""):"").concat(label,"")}else comment+=child.nodeValue}}catch(err){_iterator.e(err)}finally{_iterator.f}comment=comment.replace(/ \(\[\[Wikipedia:XFDC(#[\d.]+)?|XFDcloser]]\)/,"").slice(1,-1)}_windowSetManager.default.openWindow("unlink",{summary:comment,pageName:_config.default.mw.wgPageName})});else{var heading=_config.default.xfd.html.headlineinner,showHide=1<(0,_globals.$)("#mw-content-text "+heading).length&&_ShowHideTag.default.initialiseNewTag;(0,_globals.$)(heading).not(".XFDcloser-ignore").each(function(index){try{var discussionView=_DiscussionView.default.newFromHeadline({headingIndex:index,context:this,venue:_config.default.venue,currentPageName:_config.default.mw.wgPageName,userIsSysop:_config.default.user.isSysop});discussionView&&_config.default.isMobileSite?(0,_globals.$)(this).parent.next.prepend(discussionView.$element):discussionView&&(0,_globals.$)(this).after(discussionView.$element)}catch(e){console.warn("[XFDcloser] Could not retrieve page info for "+(0,_globals.$)(this).text,e)}}),showHide&&showHide.isHidden&&showHide.hideClosed}}},{"../globals":1,"./ShowHideTag":201,"./Views/DiscussionView":204,"./config":221,"./windowSetManager":226,"core-js/modules/es.array.concat":104,"core-js/modules/es.array.find":108,"core-js/modules/es.array.includes":111,"core-js/modules/es.array.slice":119,"core-js/modules/es.regexp.exec":132,"core-js/modules/es.string.includes":134,"core-js/modules/es.string.replace":136}],144:[function(require,module,exports){"use strict";require("core-js/modules/es.regexp.constructor"),require("core-js/modules/es.regexp.exec"),require("core-js/modules/es.regexp.to-string"),require("core-js/modules/es.string.replace"),require("core-js/modules/es.string.trim"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _globals=require("../../globals");function LookupMenuSelectWidget(config){config=config||{},LookupMenuSelectWidget.super.call(this,config)}_globals.OO.inheritClass(LookupMenuSelectWidget,_globals.OO.ui.MenuSelectWidget),LookupMenuSelectWidget.prototype.getItemMatcher=function(s,exact){var re;return s.normalize&&(s=s.normalize),s=exact?s.trim:s.replace(/^\s+/,""),re=s.replace(/([\\{}|.?*+\-^$[\]])/g,"\\$1").replace(/\s+/g,"\\s+"),exact&&(re="^\\s*"+re+"\\s*$"),re=new RegExp(re,"i"),function(item){var matchText=item.getMatchText;return matchText.normalize&&(matchText=matchText.normalize),re.test(matchText)}};var _default=LookupMenuSelectWidget;exports.default=_default},{"../../globals":1,"core-js/modules/es.regexp.constructor":131,"core-js/modules/es.regexp.exec":132,"core-js/modules/es.regexp.to-string":133,"core-js/modules/es.string.replace":136,"core-js/modules/es.string.trim":139}],145:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var obj,_globals=require("../../globals"),_LookupMenuSelectWidget=(obj=require("./LookupMenuSelectWidget"))&&obj.__esModule?obj:{default:obj};function LookupMenuTagMultiselectWidget(config){config=config||{},LookupMenuTagMultiselectWidget.super.call(this,config),this.menu=new _LookupMenuSelectWidget.default(_globals.$.extend({widget:this,input:this.hasInput?this.input:null,$input:this.hasInput?this.input.$input:null,filterFromInput:!!this.hasInput,$autoCloseIgnore:this.hasInput?this.input.$element:(0,_globals.$)([]),$floatableContainer:this.hasInput&&"outline"===this.inputPosition?this.input.$element:this.$element,$overlay:this.$overlay,disabled:this.isDisabled,multiselect:!0},config.menu)),this.menu.connect(this,{choose:"onMenuChoose",toggle:"onMenuToggle"}),this.hasInput&&this.input.connect(this,{change:"onInputChange"}),this.$input&&(this.$input.prop("disabled",this.isDisabled),this.$input.attr({role:"combobox","aria-owns":this.menu.getElementId,"aria-autocomplete":"list"})),this.popup||(this.$content.append(this.$input),this.$overlay.append(this.menu.$element))}_globals.OO.inheritClass(LookupMenuTagMultiselectWidget,_globals.OO.ui.MenuTagMultiselectWidget);var _default=LookupMenuTagMultiselectWidget;exports.default=_default},{"../../globals":1,"./LookupMenuSelectWidget":144}],146:[function(require,module,exports){"use strict";require("core-js/modules/es.array.find"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _globals=require("../../globals");function NoteWidget(config){NoteWidget.super.call(this,config),this.title=new _globals.OO.ui.LabelWidget({label:(0,_globals.$)(" ").text(config.title)}),this.noteContent=new _globals.OO.ui.LabelWidget({label:(0,_globals.$)(" ").append(config.noteContent),$element:(0,_globals.$)("")}),this.noteContent.toggle(!1),this.showButton=new _globals.OO.ui.ButtonWidget({label:"[show]",framed:!1}),this.showButton.$element.find("a").css("font-weight","normal"),this.hideButton=new _globals.OO.ui.ButtonWidget({label:"[hide]",framed:!1}),this.hideButton.$element.find("a").css("font-weight","normal"),this.hideButton.toggle(!1),this.showHideButtonGroup=new _globals.OO.ui.ButtonGroupWidget({items:[this.showButton,this.hideButton],$element:(0,_globals.$)(" ")}),this.$element.css({border:"1px dashed #888"}).append(this.title.$element,this.showHideButtonGroup.$element,this.noteContent.$element),this.showButton.connect(this,{click:["emit","expand"]}),this.hideButton.connect(this,{click:["emit","unexpand"]})}_globals.OO.inheritClass(NoteWidget,_globals.OO.ui.Widget),NoteWidget.prototype.setExpanded=function(expand){this.showButton.toggle(!expand),this.hideButton.toggle(!!expand),this.noteContent.toggle(!!expand)};var _default=NoteWidget;exports.default=_default},{"../../globals":1,"core-js/modules/es.array.find":108}],147:[function(require,module,exports){"use strict";require("core-js/modules/es.array.find"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _globals=require("../../globals");function ScrolledMessageDialog(config){ScrolledMessageDialog.super.call(this,config)}_globals.OO.inheritClass(ScrolledMessageDialog,_globals.OO.ui.MessageDialog),ScrolledMessageDialog.prototype.getReadyProcess=function(data){data=data||{};var $frameEl=this.$element.find(".oo-ui-window-frame");return ScrolledMessageDialog.super.prototype.getReadyProcess.call(this,data).next(function{var scrollBy=data.scrollBy||0;$frameEl.css("transform","translate(0px, ".concat(scrollBy,"px)")),window.scrollTo(0,scrollBy)})};var _default=ScrolledMessageDialog;exports.default=_default},{"../../globals":1,"core-js/modules/es.array.find":108}],148:[function(require,module,exports){"use strict";require("core-js/modules/es.array.for-each"),require("core-js/modules/es.object.define-property"),require("core-js/modules/es.regexp.exec"),require("core-js/modules/es.string.replace"),require("core-js/modules/web.dom-collections.for-each"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _globals=require("../../globals"),_api=_interopRequireDefault(require("../api")),_util=require("../util"),_MainWindowModel=_interopRequireDefault(require("../Models/MainWindowModel")),_windowSetManager=_interopRequireDefault(require("../windowSetManager"));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}var _default=function{function DiscussionViewController(model,widget){!function(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,DiscussionViewController),this.model=model,this.statusLabel=widget.statusLabel,this.buttonGroup=widget.buttonGroup,this.closeButton=widget.closeButton,this.relistButton=widget.relistButton,this.quickCloseButton=widget.quickCloseButtonMenu,this.quickCloseMenu=widget.quickCloseButtonMenu.getMenu,this.model.connect(this,{update:"updateFromModel"}),this.closeButton.connect(this,{click:["onButtonClick","close"]}),this.relistButton.connect(this,{click:["onButtonClick","relist"]}),this.quickCloseMenu.connect(this,{choose:"onQuickCloseChoose"}),this.model.pages.length&&this.fetchInfoFromApi}var Constructor,protoProps,staticProps;return Constructor=DiscussionViewController,(protoProps=[{key:"fetchInfoFromApi",value:function{var _this=this,pagesExistencesPromise=_api.default.get({action:"query",format:"json",formatversion:2,titles:this.model.pagesNames,prop:"info",inprop:"talkid"}).then(function(response){return response.query.pages.forEach(function(page){var pageTitle=_globals.mw.Title.newFromText(page.title),talkpageTitle=pageTitle.getTalkPage;_globals.mw.Title.exist.set(pageTitle.getPrefixedDb,!page.missing),talkpageTitle&&_globals.mw.Title.exist.set(talkpageTitle.getPrefixedDb,!!page.talkid)})}),nominationDatePromise="afd"!==this.model.venue.type&&"mfd"!==this.model.venue.type?_globals.$.Deferred.resolve((0,_util.dateFromSubpageName)(this.model.discussionSubpageName)):_api.default.get({action:"query",format:"json",formatversion:2,titles:this.model.discussionPageName,prop:"revisions",rvprop:"timestamp",rvdir:"newer",rvlimit:"1"}).then(function(response){var timestamp=response.query.pages[0].revisions[0].timestamp;return new Date(timestamp)});nominationDatePromise.then(function(nominationDate){_this.model.setNominationDate(nominationDate)}),_globals.$.when(pagesExistencesPromise,nominationDatePromise).then(function{_this.model.setStatusReady}).catch(function(code,error){_this.model.setStatusError(code,error)})}},{key:"updateFromModel",value:function{this.statusLabel.setLabel(new _globals.OO.ui.HtmlSnippet(this.model.status)).toggle(this.model.showStatus),this.buttonGroup.toggle(this.model.showButtons),this.quickCloseButton.toggle(this.model.showQuickClose),this.model.actioned&&(this.model.$headlineSpan.addClass("xfdc-actioned-heading"),(0,_globals.$)(".".concat(this.model.id,"-discussion-node")).addClass("xfdc-actioned-discussion"))}},{key:"onButtonClick",value:function(type){var _this2=this;_windowSetManager.default.openWindow("main",{model:new _MainWindowModel.default({type:type,discussion:this.model}),offsetTop:(0,_util.windowOffsetTop)}).closed.then(function(winData){_this2.model.setClosedWindowData(winData)}),this.model.setWindowOpened(type)}},{key:"onQuickCloseChoose",value:function(menuOption){var _this3=this,quickCloseResult=menuOption.getData,windowModel=new _MainWindowModel.default({type:"close",quick:!0,result:quickCloseResult,discussion:this.model});_windowSetManager.default.openWindow("main",{model:windowModel,offsetTop:(0,_util.windowOffsetTop)}).closed.then(function(winData){_this3.model.setClosedWindowData(winData)}),this.model.setWindowOpened("close"),windowModel.result.singleModeResult.setSelectedResultName(quickCloseResult.replace("quick","").toLowerCase),windowModel.options.isValid?(windowModel.taskList.resetItems,windowModel.taskList.startTasks):windowModel.showOptions}}])&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Object.defineProperty(Constructor,"prototype",{writable:!1}),DiscussionViewController};exports.default=_default},{"../../globals":1,"../Models/MainWindowModel":185,"../api":220,"../util":225,"../windowSetManager":226,"core-js/modules/es.array.for-each":110,"core-js/modules/es.object.define-property":125,"core-js/modules/es.regexp.exec":132,"core-js/modules/es.string.replace":136,"core-js/modules/web.dom-collections.for-each":140}],149:[function(require,module,exports){"use strict";function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})),keys.push.apply(keys,symbols)}return keys}function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}require("core-js/modules/es.array.find"),require("core-js/modules/es.array.for-each"),require("core-js/modules/es.array.map"),require("core-js/modules/es.function.name"),require("core-js/modules/es.object.define-property"),require("core-js/modules/web.dom-collections.for-each"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var GroupedItemController=function{function GroupedItemController(model,group){if(!function(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,GroupedItemController),!model)throw new Error("GroupedItemController: model must be defined.");if(!Array.isArray(model.items))throw console.warn("GroupedItemController: model.items = ",model.items),new Error("GroupedItemController: Expected model.items to be an array");if(!group)throw new Error("GroupedItemController: group must be defined.");if(!Array.isArray(group.items))throw console.warn("GroupedItemController: group.items = ",group.items),new Error("GroupedItemController: Expected group.items to be an array");this.model=model,this.group=group,this.model.connect(this,{update:"updateGroupFromModel"}),this.group.aggregate({update:"itemUpdate"}),this.group.connect(this,{itemUpdate:"onItemUpdate"})}var Constructor,protoProps,staticProps;return Constructor=GroupedItemController,(protoProps=[{key:"updateGroupFromModel",value:function{var _this=this,widgetItems=this.group.getItems,widgetInputStates={};widgetItems.forEach(function(widget){widget.getInputStates&&(widgetInputStates[widget.getData.name]=widget.getInputStates)}),this.group.clearItems;var newWidgetItems=this.model.getItems.map(function(modelItem){var widget=widgetItems.find(function(widgetItem){return widgetItem.getData.name===modelItem.name});if(!widget){if(!modelItem.name)throw new Error("Models for group item widgets must have names!");var data=(widget=_this.newItemWidget(modelItem)).getData||{};widget.setData(function(target){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?ownKeys(Object(source),!0).forEach(function(key){_defineProperty(target,key,source[key])}):Object.getOwnPropertyDescriptors?Object.defineProperties(target,Object.getOwnPropertyDescriptors(source)):ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))})}return target}({},data,{name:modelItem.name}))}return widget});this.group.addItems(newWidgetItems),newWidgetItems.forEach(function(widget){var state=widgetInputStates[widget.getData.name];state&&widget.setInputStates&&widget.setInputStates(state)}),this.updateFromModel}},{key:"newItemWidget",value:function{}},{key:"updateFromModel",value:function{}}])&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Object.defineProperty(Constructor,"prototype",{writable:!1}),GroupedItemController};exports.default=GroupedItemController},{"core-js/modules/es.array.find":108,"core-js/modules/es.array.for-each":110,"core-js/modules/es.array.map":116,"core-js/modules/es.function.name":123,"core-js/modules/es.object.define-property":125,"core-js/modules/web.dom-collections.for-each":140}],150:[function(require,module,exports){"use strict";function _typeof(obj){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}require("core-js/modules/es.array.concat"),require("core-js/modules/es.array.join"),require("core-js/modules/es.array.map"),require("core-js/modules/es.function.bind"),require("core-js/modules/es.object.define-property"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _globals=require("../../globals"),_util=require("../util"),prefs=function(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule)return obj;if(null===obj||"object"!==_typeof(obj)&&"function"!=typeof obj)return{default:obj};var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj))return cache.get(obj);var newObj={},hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj)if("default"!==key&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;desc&&(desc.get||desc.set)?Object.defineProperty(newObj,key,desc):newObj[key]=obj[key]}newObj.default=obj,cache&&cache.set(obj,newObj);return newObj}(require("../prefs"));function _getRequireWildcardCache(nodeInterop){if("function"!=typeof WeakMap)return null;var cacheBabelInterop=new WeakMap,cacheNodeInterop=new WeakMap;return(_getRequireWildcardCache=function(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop})(nodeInterop)}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}var _default=function{function MainWindowController(model,window){!function(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,MainWindowController),this.model=model,this.window=window,this.stackLayout=window.stackLayout,this.actions=window.actions,this.model.connect(this,{update:"updateFromModel",resize:this.window.updateSize.bind(this.window)})}var Constructor,protoProps,staticProps;return Constructor=MainWindowController,(protoProps=[{key:"updateFromModel",value:function{this.actions.setMode(this.model.mode),this.actions.setAbilities(this.model.actionAbilities);var currentPanel=this.stackLayout.findItemFromData({name:this.model.currentPanel});if(!currentPanel)throw new Error("Could not find panel with name: "+this.model.currentPanel);this.stackLayout.setItem(currentPanel);var stackElement=this.stackLayout.$element.get(0),panelElement=currentPanel.$element.get(0);this.model.suggestCurrentPanelHeight(stackElement.scrollHeight+panelElement.clientHeight/2+1)}},{key:"getActionProcess",value:function(action){var _this=this;if(this.window.setErrorsLabels,"save"!==action&&(this.model.sanityChecks.setShowWarnings(!0),this.model.sanityChecks.setShowRedirections(!0)),"save"===action)return(new _globals.OO.ui.Process).next(function{var sanityWarnings=_this.model.sanityChecks.showWarnings&&_this.model.sanityChecks.getWarnings;return sanityWarnings?(_this.model.sanityChecks.setShowWarnings(!1),_this.window.setErrorsLabels({title:"Warning",dismiss:"Cancel"}),sanityWarnings.map(function(message){return new _globals.OO.ui.Error((0,_globals.$)(" ".concat(message," ")),{warning:!0})})):0}).next(function{return _this.model.sanityChecks.showRedirections?_this.model.sanityChecks.getRedirections.then(function(redirections){if(_this.model.sanityChecks.setShowRedirections(!1),!redirections.length)return 0;_this.window.setErrorsLabels({title:"Redirection warning",dismiss:"Cancel"});var explanation="Actions will be applied to ".concat(1===redirections.length?"this redirect's target page ":"these redirects' target pages ",". To use the nominated ").concat(1===redirections.length?"page":"pages"," instead, undo the redirection before continuing."),listItems=redirections.map(function(redirect){return"".concat((0,_util.makeLink)(redirect.from)," \u2192 ").concat((0,_util.makeLink)(redirect.to),"")}).join("");return(0,_util.rejection)(new _globals.OO.ui.Error((0,_globals.$)(" ".concat(explanation,"").concat(listItems," ")),{warning:!0}))}):0}).next(function{if(_this.model.discussion.venue.expectRedirects)return 0;var redirections=_this.model.sanityChecks.getRedirections({setExistences:!0});_this.model.discussion.setRedirects(redirections)}).next(function{_this.model.startTasks});if("showPrefs"===action)this.model.showPrefs;else{if("savePrefs"===action){this.window.pushPending;var changedPrefValues=this.model.preferences.getValues({changedOnly:!0});return(new _globals.OO.ui.Process).next(function{return prefs.set(changedPrefValues)}).next(function{_this.model.preferences.resetValues(changedPrefValues),_this.model.closePrefs,_this.window.popPending})}"closePrefs"===action?this.model.closePrefs:"defaultPrefs"===action?this.model.preferences.restoreDefaults:"multimode"===action?this.model.setMultimode(!0):"singlemode"===action?this.model.setMultimode(!1):"next"===action?this.model.showOptions:"back"===action?this.model.showResult:"finish"===action?this.window.close({success:this.model.taskList.success,aborted:this.model.taskList.aborted,result:"relist"!==this.model.type&&this.model.result.getFormattedResult}):"abort"===action?this.model.taskList.abort:!action&&this.model.canClose&&this.window.close}return new _globals.OO.ui.Process}}])&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Object.defineProperty(Constructor,"prototype",{writable:!1}),MainWindowController};exports.default=_default},{"../../globals":1,"../prefs":223,"../util":225,"core-js/modules/es.array.concat":104,"core-js/modules/es.array.join":114,"core-js/modules/es.array.map":116,"core-js/modules/es.function.bind":122,"core-js/modules/es.object.define-property":125}],151:[function(require,module,exports){"use strict";require("core-js/modules/es.array.concat"),require("core-js/modules/es.array.find"),require("core-js/modules/es.array.flat-map"),require("core-js/modules/es.array.map"),require("core-js/modules/es.array.slice"),require("core-js/modules/es.array.unscopables.flat-map"),require("core-js/modules/es.function.name"),require("core-js/modules/es.object.define-property"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var obj,_globals=require("../../globals"),_LookupMenuTagMultiselectWidget=(obj=require("../Components/LookupMenuTagMultiselectWidget"))&&obj.__esModule?obj:{default:obj};function _toConsumableArray(arr){return function(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr)}(arr)||function(iter){if("undefined"!=typeof Symbol&&null!=iter[Symbol.iterator]||null!=iter["@@iterator"])return Array.from(iter)}(arr)||function(o,minLen){if(!o)return;if("string"==typeof o)return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}(arr)||function{throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator] method.")}}function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}var _default=function{function OptionsItemController(model,widget){!function(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,OptionsItemController),this.model=model,this.model.connect(this,{update:"updateFromModel"}),this.widget=widget,this.widget.fieldset.aggregate({widgetChange:"fieldWidgetChange"}),this.widget.fieldset.connect(this,{fieldWidgetChange:"onFieldWidgetChange"}),this.widget.actionsDropdown.getMenu.connect(this,{choose:"onActionChange",select:"onActionChange"})}var Constructor,protoProps,staticProps;return Constructor=OptionsItemController,(protoProps=[{key:"updateFromModel",value:function{var _this=this;this.widget.fieldset.setLabel(this.model.label);var actionsDropdownMenu=this.widget.actionsDropdown.getMenu;0===actionsDropdownMenu.items.length&&actionsDropdownMenu.addItems(this.model.actions.map(function(action){return new _globals.OO.ui.MenuOptionWidget({label:action.label,data:{name:action.name}})})),actionsDropdownMenu.selectItemByData({name:this.model.selectedActionName});var fieldLayouts=this.widget.fieldset.items.slice(1);this.widget.fieldset.removeItems(fieldLayouts),this.widget.fieldset.addItems(this.model.options.map(function(option){var fieldLayout=fieldLayouts.find(function(field){return field.getData.name===option.name});return fieldLayout?(fieldLayout.getField.setValue(option.value),fieldLayout):_this.newFieldLayout(option)})),this.widget.emit("update")}},{key:"onActionChange",value:function(option){this.model.setSelectedActionName(option&&option.getData.name)}},{key:"onFieldWidgetChange",value:function(fieldLayout){var optionName=fieldLayout.getData.name,optionValue=fieldLayout.getField.getValue;this.model.setOptionValue(optionName,optionValue)}},{key:"newFieldLayout",value:function(option){var widget;switch(option.type){case"toggleSwitch":widget=new _globals.OO.ui.ToggleSwitchWidget({value:option.value});break;case"dropdown":(widget=new _globals.OO.ui.DropdownWidget({$overlay:this.widget.$overlay,menu:{items:option.items.map(function(item){return new _globals.OO.ui.MenuOptionWidget(item)})}})).getValue=function{var selected=widget.getMenu.findSelectedItem;return selected&&selected.getData},widget.setValue=function(value){widget.getMenu.selectItemByData(value)},widget.setValue(option.value);break;case"lookupMenuTagMultiselect":widget=new _LookupMenuTagMultiselectWidget.default({data:{name:option.name},allowArbitrary:!0,$overlay:this.widget.$overlay,popup:!1,menu:{items:option.items.flatMap(function(itemgroup){return[new _globals.OO.ui.MenuSectionOptionWidget({label:itemgroup.group})].concat(_toConsumableArray(itemgroup.names.map(function(name){return new _globals.OO.ui.MenuOptionWidget({data:"",label:""})})))})}}),option.value&&widget.setValue(option.value);break;default:throw new Error("Unrecognised option type: "+option.type)}var layout=new _globals.OO.ui.FieldLayout(widget,{label:option.label,data:{name:option.name}});switch(option.type){case"lookupMenuTagMultiselect":case"toggleSwitch":widget.on("change",function{return layout.emit("widgetChange")});break;case"dropdown":widget.getMenu.on("choose",function{return layout.emit("widgetChange")}),widget.getMenu.on("select",function{return layout.emit("widgetChange")})}return layout}}])&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Object.defineProperty(Constructor,"prototype",{writable:!1}),OptionsItemController};exports.default=_default},{"../../globals":1,"../Components/LookupMenuTagMultiselectWidget":145,"core-js/modules/es.array.concat":104,"core-js/modules/es.array.find":108,"core-js/modules/es.array.flat-map":109,"core-js/modules/es.array.map":116,"core-js/modules/es.array.slice":119,"core-js/modules/es.array.unscopables.flat-map":121,"core-js/modules/es.function.name":123,"core-js/modules/es.object.define-property":125}],152:[function(require,module,exports){"use strict";function _typeof(obj){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}require("core-js/modules/es.object.set-prototype-of"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _GroupItemController=_interopRequireDefault(require("./GroupItemController")),_OptionsItemWidget=_interopRequireDefault(require("../Views/OptionsItemWidget"));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function _createSuper(Derived){var hasNativeReflectConstruct=function{if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function{})),!0}catch(e){return!1}};return function{var result,Super=_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return function(self,call){{if(call&&("object"===_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined")}return function(self){if(void 0!==self)return self;throw new ReferenceError("this hasn't been initialised - super hasn't been called")}(self)}(this,result)}}function _getPrototypeOf(o){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function _setPrototypeOf(o,p){return(_setPrototypeOf=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o})(o,p)}var OptionsPanelController=function{!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),Object.defineProperty(subClass,"prototype",{writable:!1}),superClass&&_setPrototypeOf(subClass,superClass)}(OptionsPanelController,_GroupItemController["default"]);var Constructor,protoProps,staticProps,_super=_createSuper(OptionsPanelController);function OptionsPanelController(model,widget){var _this;return function(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,OptionsPanelController),(_this=_super.call(this,model,widget)).$overlay=widget.$overlay,_this}return Constructor=OptionsPanelController,(protoProps=[{key:"newItemWidget",value:function(modelItem){return new _OptionsItemWidget.default(modelItem,{$overlay:this.$overlay})}},{key:"onItemUpdate",value:function{this.model.onItemUpdate}}])&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Object.defineProperty(Constructor,"prototype",{writable:!1}),OptionsPanelController};exports.default=OptionsPanelController},{"../Views/OptionsItemWidget":206,"./GroupItemController":149,"core-js/modules/es.object.set-prototype-of":127}],153:[function(require,module,exports){"use strict";function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}require("core-js/modules/es.array.find"),require("core-js/modules/es.object.define-property"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var PrefsItemController=function{function PrefsItemController(model,widget){!function(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,PrefsItemController),this.model=model,this.model.connect(this,{update:"updateFromModel"}),this.widget=widget,this.widget.selector.connect(this,{change:"onSelectorChange"}),"dropdown"===model.type&&this.widget.selector.getMenu.connect(this,{choose:"onMenuSelection",select:"onMenuSelection"}),this.updateFromModel}var Constructor,protoProps,staticProps;return Constructor=PrefsItemController,(protoProps=[{key:"updateFromModel",value:function{this.widget.fieldLayout.setLabel(this.model.label),this.widget.fieldLayout.setErrors(this.model.errors),this.widget.$element.find(".oo-ui-fieldLayout-messages").css("clear","both"),"dropdown"===this.model.type?this.widget.selector.getMenu.selectItemByData(this.model.value):this.widget.selector.setValue(this.model.value),this.widget.emit("update")}},{key:"onSelectorChange",value:function(value){this.model.setValue(value)}},{key:"onMenuSelection",value:function(item){this.model.setValue(item.getData)}}])&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Object.defineProperty(Constructor,"prototype",{writable:!1}),PrefsItemController};exports.default=PrefsItemController},{"core-js/modules/es.array.find":108,"core-js/modules/es.object.define-property":125}],154:[function(require,module,exports){"use strict";function _typeof(obj){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}require("core-js/modules/es.object.set-prototype-of"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _GroupItemController=_interopRequireDefault(require("./GroupItemController")),_PrefsItemWidget=_interopRequireDefault(require("../Views/PrefsItemWidget"));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function _createSuper(Derived){var hasNativeReflectConstruct=function{if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function{})),!0}catch(e){return!1}};return function{var result,Super=_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return function(self,call){{if(call&&("object"===_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined")}return function(self){if(void 0!==self)return self;throw new ReferenceError("this hasn't been initialised - super hasn't been called")}(self)}(this,result)}}function _getPrototypeOf(o){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function _setPrototypeOf(o,p){return(_setPrototypeOf=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o})(o,p)}var PrefsPanelController=function{!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),Object.defineProperty(subClass,"prototype",{writable:!1}),superClass&&_setPrototypeOf(subClass,superClass)}(PrefsPanelController,_GroupItemController["default"]);var Constructor,protoProps,staticProps,_super=_createSuper(PrefsPanelController);function PrefsPanelController(model,widget){var _this;return function(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,PrefsPanelController),(_this=_super.call(this,model,widget.fieldset)).$overlay=widget.$overlay,_this.updateGroupFromModel,_this}return Constructor=PrefsPanelController,(protoProps=[{key:"newItemWidget",value:function(modelItem){return new _PrefsItemWidget.default(modelItem,{$overlay:this.$overlay})}},{key:"onItemUpdate",value:function{this.model.onItemUpdate}}])&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Object.defineProperty(Constructor,"prototype",{writable:!1}),PrefsPanelController};exports.default=PrefsPanelController},{"../Views/PrefsItemWidget":208,"./GroupItemController":149,"core-js/modules/es.object.set-prototype-of":127}],155:[function(require,module,exports){"use strict";function _typeof(obj){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}require("core-js/modules/es.object.define-property"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _globals=require("../../globals"),prefs=function(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule)return obj;if(null===obj||"object"!==_typeof(obj)&&"function"!=typeof obj)return{default:obj};var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj))return cache.get(obj);var newObj={},hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj)if("default"!==key&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;desc&&(desc.get||desc.set)?Object.defineProperty(newObj,key,desc):newObj[key]=obj[key]}newObj.default=obj,cache&&cache.set(obj,newObj);return newObj}(require("../prefs"));function _getRequireWildcardCache(nodeInterop){if("function"!=typeof WeakMap)return null;var cacheBabelInterop=new WeakMap,cacheNodeInterop=new WeakMap;return(_getRequireWildcardCache=function(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop})(nodeInterop)}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}var PrefsWindowController=function{function PrefsWindowController(model,window){!function(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,PrefsWindowController),this.model=model,this.window=window,this.model.connect(this,{update:"updateFromModel",resize:this.window.updateSize}),this.updateFromModel}var Constructor,protoProps,staticProps;return Constructor=PrefsWindowController,(protoProps=[{key:"updateFromModel",value:function{this.window.actions.setAbilities(this.model.actionAbilities),this.window.updateSize}},{key:"getActionProcess",value:function(action){var _this=this;if("savePrefs"!==action)return"defaultPrefs"===action?this.model.preferences.restoreDefaults:this.window.close,new _globals.OO.ui.Process;this.window.pushPending;var changedPrefValues=this.model.preferences.getValues({changedOnly:!0});return(new _globals.OO.ui.Process).next(function{return prefs.set(changedPrefValues)}).next(function{_this.model.preferences.resetValues(changedPrefValues),_this.window.popPending})}},{key:"getBodyHeight",value:function{var panelHeight=this.window.prefsPanel.$element.get(0).scrollHeight||0,errorsHeight=(0,_globals.$)(".oo-ui-processDialog-errors").get(0).scrollHeight||0;return Math.max(200,panelHeight+1,errorsHeight+1)}}])&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Object.defineProperty(Constructor,"prototype",{writable:!1}),PrefsWindowController};exports.default=PrefsWindowController},{"../../globals":1,"../prefs":223,"core-js/modules/es.object.define-property":125}],156:[function(require,module,exports){"use strict";require("core-js/modules/es.array.find"),require("core-js/modules/es.array.map"),require("core-js/modules/es.function.name"),require("core-js/modules/es.object.define-property"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _globals=require("../../globals");function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}var ResultItemController=function{function ResultItemController(model,widget){!function(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,ResultItemController),this.model=model,this.model.connect(this,{update:"updateFromModel"}),this.widget=widget,this.widget.resultDropdown.getMenu.connect(this,{choose:"onResultChoose"}),this.widget.targetInput.connect(this,{change:"onTargetChange"}),this.widget.customResultInput.connect(this,{change:"onCustomResultChange"})}var Constructor,protoProps,staticProps;return Constructor=ResultItemController,(protoProps=[{key:"updateFromModel",value:function{var _this=this,dropdownMenu=this.widget.resultDropdown.getMenu;dropdownMenu.items.length!==this.model.availableResults.length&&(dropdownMenu.clearItems,dropdownMenu.addItems(this.model.availableResults.map(function(result){return new _globals.OO.ui.MenuOptionWidget({data:{name:result.name},label:result.label,title:result.title})}))),dropdownMenu.selectItem(dropdownMenu.getItems.find(function(item){return item.getData.name===_this.model.selectedResultName})),this.widget.resultField.setLabel(this.model.pageName),this.widget.targetInput.setValue(this.model.targetPageName),this.widget.targetInput.setValidityFlag(this.model.targetIsValid),this.widget.targetField.toggle(this.model.showTarget),this.widget.customResultInput.setValue(this.model.customResultText),this.widget.customResultInput.setValidityFlag(this.model.customResultIsValid),this.widget.customField.toggle(this.model.showCustomResult),this.widget.emit("update")}},{key:"onResultChoose",value:function(option){this.model.setSelectedResultName(option&&option.getData.name)}},{key:"onTargetChange",value:function(value){this.model.setTargetPageName(value)}},{key:"onCustomResultChange",value:function(value){this.model.setCustomResultText(value)}}])&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Object.defineProperty(Constructor,"prototype",{writable:!1}),ResultItemController};exports.default=ResultItemController},{"../../globals":1,"core-js/modules/es.array.find":108,"core-js/modules/es.array.map":116,"core-js/modules/es.function.name":123,"core-js/modules/es.object.define-property":125}],157:[function(require,module,exports){"use strict";function _typeof(obj){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}require("core-js/modules/es.object.set-prototype-of"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _GroupItemController=_interopRequireDefault(require("./GroupItemController")),_ResultItemWidget=_interopRequireDefault(require("../Views/ResultItemWidget"));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function _createSuper(Derived){var hasNativeReflectConstruct=function{if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function{})),!0}catch(e){return!1}};return function{var result,Super=_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return function(self,call){{if(call&&("object"===_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined")}return function(self){if(void 0!==self)return self;throw new ReferenceError("this hasn't been initialised - super hasn't been called")}(self)}(this,result)}}function _getPrototypeOf(o){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function _setPrototypeOf(o,p){return(_setPrototypeOf=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o})(o,p)}var ResultListWidgetController=function{!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),Object.defineProperty(subClass,"prototype",{writable:!1}),superClass&&_setPrototypeOf(subClass,superClass)}(ResultListWidgetController,_GroupItemController["default"]);var Constructor,protoProps,staticProps,_super=_createSuper(ResultListWidgetController);function ResultListWidgetController(model,widget){var _this;return function(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,ResultListWidgetController),(_this=_super.call(this,model,widget)).$overlay=widget.$overlay,_this.updateGroupFromModel,_this}return Constructor=ResultListWidgetController,(protoProps=[{key:"newItemWidget",value:function(modelItem){return new _ResultItemWidget.default(modelItem,{$overlay:this.$overlay})}},{key:"onItemUpdate",value:function{this.model.onItemUpdate}}])&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Object.defineProperty(Constructor,"prototype",{writable:!1}),ResultListWidgetController};exports.default=ResultListWidgetController},{"../Views/ResultItemWidget":211,"./GroupItemController":149,"core-js/modules/es.object.set-prototype-of":127}],158:[function(require,module,exports){"use strict";require("core-js/modules/es.array.map"),require("core-js/modules/es.function.name"),require("core-js/modules/es.object.define-property"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _globals=require("../../globals"),_NoteWidget=_interopRequireDefault(require("../Components/NoteWidget")),_api=_interopRequireDefault(require("../api"));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}var _default=function{function ResultPanelController(model,widgets){!function(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,ResultPanelController),this.model=model,this.notesFieldset=widgets.notesFieldset,this.resultFieldset=widgets.resultFieldset,this.resultWidgetField=widgets.resultWidgetField,this.multiResultWidgetField=widgets.multiResultWidgetField,this.resultSummary=widgets.resultSummary,this.resultSummaryField=widgets.resultSummaryField,this.rationaleFieldset=widgets.rationaleFieldset,this.copyButton=widgets.copyButton,this.rationaleTextbox=widgets.rationaleTextbox,this.newSentenceOption=widgets.newSentenceOption,this.preview=widgets.preview,this.model.connect(this,{update:"updateFromModel"}),this.resultSummary.connect(this,{change:"onResultSummaryChange"}),this.copyButton.connect(this,{click:"onCopyButtonClick"}),this.rationaleTextbox.connect(this,{change:"onRationaleChange"}),this.newSentenceOption.connect(this,{change:"onNewSentenceChange"}),this._latestPreviewWikitext="",this._latestRequestId=0}var Constructor,protoProps,staticProps;return Constructor=ResultPanelController,(protoProps=[{key:"updateFromModel",value:function{var _this=this;this.resultFieldset.toggle(this.model.showResultFieldset),this.resultWidgetField.toggle(!this.model.isMultimode),this.multiResultWidgetField.toggle(this.model.isMultimode),this.resultSummaryField.toggle(this.model.isMultimode),this.rationaleFieldset.setLabel(this.model.rationaleHeading),this.copyButton.toggle(this.model.showCopyButton),this.rationaleTextbox.setValue(this.model.rationale),this.newSentenceOption.setSelected(this.model.newSentence).toggle(this.model.showNewSentenceOption),this.preview.$element.html(this.model.preview),this.notesFieldset.clearItems,this.notesFieldset.addItems(this.model.topNotes.map(function(note){var widget=new _NoteWidget.default({title:note.title,noteContent:note.content,data:{name:note.name}});return widget.setExpanded(note.expanded),widget.connect(_this,{expand:["onNoteExpand",note.name],unexpand:["onNoteUnexpand",note.name]}),new _globals.OO.ui.FieldLayout(widget,{align:"top",$element:(0,_globals.$)(" ").css("margin-top","5px")})}));var wikitext=this.model.previewWikitext;if(this._latestPreviewWikitext!==wikitext){this._latestPreviewWikitext=wikitext;var requestId=++this._latestRequestId;return _api.default.get({action:"parse",format:"json",formatversion:"2",text:wikitext,title:this.model.discussion.discussionPageName,prop:"text",pst:1,disablelimitreport:1,contentmodel:"wikitext"}).then(function(response){requestId===_this._latestRequestId&&response&&response.parse&&response.parse.text&&(_this.preview.$element.empty.html(response.parse.text),_this.model.emit("resize"))})}}},{key:"onNoteExpand",value:function(noteName){this.model.setNoteExpanded(noteName,!0)}},{key:"onNoteUnexpand",value:function(noteName){this.model.setNoteExpanded(noteName,!1)}},{key:"onResultSelect",value:function(item){this.model.selectResult(item.getData)}},{key:"onSpeedyChange",value:function(isSelected){this.model.setSpeedyResult(isSelected)}},{key:"onSoftChange",value:function(isSelected){this.model.setSoftResult(isSelected)}},{key:"onDeleteFirstChange",value:function(isSelected){this.model.setDeleteFirstResult(isSelected)}},{key:"onTargetChange",value:function(value){this.model.setTarget(value)}},{key:"onCustomResultChange",value:function(value){this.model.setCustomResultText(value)}},{key:"onMultiResultChange",value:function(resultChange){this.model.updateMultimodeResult(resultChange)}},{key:"onResultSummaryChange",value:function(value){this.model.setResultSummary(value)}},{key:"onCopyButtonClick",value:function{this.model.copyResultsToRationale}},{key:"onRationaleChange",value:function(value){this.model.setRationale(value)}},{key:"onNewSentenceChange",value:function(isSelected){this.model.setNewSentence(isSelected)}}])&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Object.defineProperty(Constructor,"prototype",{writable:!1}),ResultPanelController};exports.default=_default},{"../../globals":1,"../Components/NoteWidget":146,"../api":220,"core-js/modules/es.array.map":116,"core-js/modules/es.function.name":123,"core-js/modules/es.object.define-property":125}],159:[function(require,module,exports){"use strict";require("core-js/modules/es.array.find"),require("core-js/modules/es.array.map"),require("core-js/modules/es.function.name"),require("core-js/modules/es.object.define-property"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _globals=require("../../globals");function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}var SingleResultWidgetController=function{function SingleResultWidgetController(model,widget){!function(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,SingleResultWidgetController),this.model=model,this.model.connect(this,{update:"updateFromModel"}),this.widget=widget,this.widget.buttonSelect.connect(this,{select:"onButtonSelect"}),this.widget.speedyOption.connect(this,{change:"onSpeedyChange"}),this.widget.softOption.connect(this,{change:"onSoftChange"}),this.widget.deleteFirstOption.connect(this,{change:"onDeleteFirstChange"}),this.widget.targetInput.connect(this,{change:"onTargetChange"}),this.widget.customResultInput.connect(this,{change:"onCustomResultChange"})}var Constructor,protoProps,staticProps;return Constructor=SingleResultWidgetController,(protoProps=[{key:"updateFromModel",value:function{var _this=this;this.widget.buttonSelect.getItems.length!==this.model.availableResults.length&&(this.widget.buttonSelect.clearItems,this.widget.buttonSelect.addItems(this.model.availableResults.map(function(result){return new _globals.OO.ui.ButtonOptionWidget({data:{name:result.name},label:result.label,title:result.title})}))),this.widget.buttonSelect.selectItem(this.widget.buttonSelect.getItems.find(function(item){return item.getData.name===_this.model.selectedResultName})),this.widget.speedyOption.setSelected(this.model.speedyResult).toggle(this.model.showSpeedyResult),this.widget.softOption.setSelected(this.model.softResult).toggle(this.model.showSoftResult),this.widget.deleteFirstOption.setSelected(this.model.deleteFirstResult).toggle(this.model.showDeleteFirstResult),this.widget.optionsMultiselect.toggle(this.model.showResultOptions),this.widget.targetInput.setValue(this.model.targetPageName).toggle(this.model.showTarget).setValidityFlag(this.model.targetIsValid),this.widget.customResultInput.setValue(this.model.customResultText).toggle(this.model.showCustomResult).setValidityFlag(this.model.customResultIsValid),this.widget.emit("update")}},{key:"onButtonSelect",value:function(option){this.model.setSelectedResultName(option&&option.getData.name)}},{key:"onSpeedyChange",value:function(isSelected){this.model.setSpeedyResult(isSelected)}},{key:"onSoftChange",value:function(isSelected){this.model.setSoftResult(isSelected)}},{key:"onDeleteFirstChange",value:function(isSelected){this.model.setDeleteFirstResult(isSelected)}},{key:"onTargetChange",value:function(value){this.model.setTargetPageName(value)}},{key:"onCustomResultChange",value:function(value){this.model.setCustomResultText(value)}}])&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Object.defineProperty(Constructor,"prototype",{writable:!1}),SingleResultWidgetController};exports.default=SingleResultWidgetController},{"../../globals":1,"core-js/modules/es.array.find":108,"core-js/modules/es.array.map":116,"core-js/modules/es.function.name":123,"core-js/modules/es.object.define-property":125}],160:[function(require,module,exports){"use strict";function _typeof(obj){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}require("core-js/modules/es.array.concat"),require("core-js/modules/es.array.map"),require("core-js/modules/es.object.define-property"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var obj,_globals=require("../../globals"),_util=require("../util"),_api=(obj=require("../api"))&&obj.__esModule?obj:{default:obj},prefs=function(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule)return obj;if(null===obj||"object"!==_typeof(obj)&&"function"!=typeof obj)return{default:obj};var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj))return cache.get(obj);var newObj={},hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj)if("default"!==key&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;desc&&(desc.get||desc.set)?Object.defineProperty(newObj,key,desc):newObj[key]=obj[key]}newObj.default=obj,cache&&cache.set(obj,newObj);return newObj}(require("../prefs"));function _getRequireWildcardCache(nodeInterop){if("function"!=typeof WeakMap)return null;var cacheBabelInterop=new WeakMap,cacheNodeInterop=new WeakMap;return(_getRequireWildcardCache=function(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop})(nodeInterop)}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function toSmallSnippet(content){return new _globals.OO.ui.HtmlSnippet(' '.concat(content," "))}var _default=function{function TaskItemController(model,widget){!function(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,TaskItemController),this.model=model,this.widget=widget,this.api=_api.default,this._doingTask=!1,this.model.connect(this,{update:"updateFromModel"}),this.widget.showAllWarningsButton&&this.widget.showAllErrorsButton&&(this.widget.showAllWarningsButton.connect(this,{click:"onShowWarningsButtonClick"}),this.widget.showAllErrorsButton.connect(this,{click:"onShowErrorsButtonClick"}))}var Constructor,protoProps,staticProps;return Constructor=TaskItemController,(protoProps=[{key:"makeWarnings",value:function{return this.model.showOverflowWarnings||this.model.warnings.length<prefs.get("collapseWarnings")?this.model.warnings.map(toSmallSnippet):[]}},{key:"onShowWarningsButtonClick",value:function{this.model.showOverflowWarnings=!0,this.updateFromModel}},{key:"makeErrors",value:function{return this.model.showOverflowErrors||this.model.errors.length<prefs.get("collapseErrors")?this.model.errors.map(toSmallSnippet):[]}},{key:"onShowErrorsButtonClick",value:function{this.model.showOverflowErrors=!0,this.updateFromModel}},{key:"updateFromModel",value:function{var _this=this;this.widget.field.setLabel(new _globals.OO.ui.HtmlSnippet(" ".concat(this.model.label," "))),this.widget.progressbar.setProgress(this.model.progress),this.widget.progressbar.toggle(this.model.showProgressBar),this.widget.field.setNotices(this.model.notices.map(toSmallSnippet)),this.widget.field.setWarnings(this.makeWarnings),this.widget.field.setErrors(this.makeErrors),this.widget.showAllWarningsButton&&this.widget.showAllErrorsButton&&(this.widget.showAllWarningsButton.toggle(!this.model.showOverflowWarnings&&this.model.warnings.length>=prefs.get("collapseWarnings")),this.widget.showAllWarningsButton.setLabel("Show ".concat(this.model.warnings.length," warnings")),this.widget.showAllErrorsButton.toggle(!this.model.showOverflowErrors&&this.model.errors.length>=prefs.get("collapseErrors")),this.widget.showAllErrorsButton.setLabel("Show ".concat(this.model.errors.length," errors"))),this.widget.emit("update"),this.model.starting&&!this._doingTask&&this.model.canProceed&&(this._doingTask=!0,this.model.setStarted,_globals.$.when(this.doTask).then(function{return _this.model.setDone}).catch(function{return _this.model.setFailed}))}},{key:"doTask",value:function{throw new Error("doTask method not implemented")}},{key:"logError",value:function(code,error){console.error("[XFDcloser/".concat(this.model.taskName,"] ").concat(code||"unknown"),error)}},{key:"handlePageError",value:function(code,error,title,action){switch(action=action||"edit",code){case"unexpectedTitle":this.model.addError("API query result included unexpected title ".concat((0,_util.makeLink)(title),"; this page will not be edited")),this.model.trackStep("failed");break;case"unexpectedTarget":this.model.addError("API query result included unexpected target talk page ".concat((0,_util.makeLink)(title),"; this page will not be edited")),this.model.trackStep("failed");break;case"doesNotExist":this.model.addError("".concat((0,_util.makeLink)(title)," does not exist, and will not be edited")),this.model.trackStep("failed");break;case"couldNotUpdate":this.model.addError("Could not update ".concat((0,_util.makeLink)(title),": ").concat(error.message)),this.model.trackStep("failed");break;case"subjectDoesNoteExist":this.model.addError("The subject page for ".concat((0,_util.makeLink)(title)," does not exist; this talk page will not be edited")),this.model.trackStep("failed");break;case"targetIsNotModule":this.model.addError("Could not redirect ".concat((0,_util.makeLink)(title)," because ").concat(error&&error.target?(0,_util.makeLink)(error.target):"the target"," is not a module")),this.model.trackStep("failed");break;case"skipped":this.model.addWarning("".concat((0,_util.makeLink)(title)," skipped")),this.model.trackStep("skipped");break;case"skippedNoneFound":this.model.addWarning("".concat((0,_util.makeLink)(title)," skipped: none found")),this.model.trackStep("skipped");break;case"skippedNoLinks":this.model.addWarning("".concat((0,_util.makeLink)(title)," skipped (no direct links)")),this.model.trackStep("skipped");break;case"noChangesMade":this.model.addError("Did not find any changes to make to ".concat((0,_util.makeLink)(title))),this.model.trackStep("skipped");break;case"nominationTemplateNotFound":this.model.addError("Nomination template not found on page ".concat((0,_util.makeLink)(title))),this.model.trackStep("skipped");break;case"abort":this.model.setAborted,this.model.trackStep("failed");break;case"aborted":this.model.trackStep("failed");break;default:this.model.addError("".concat(code||"unknown"," error: could not ").concat(action," page ").concat((0,_util.makeLink)(title))),this.model.trackStep("failed"),this.logError(code,error)}}},{key:"handleOverallError",value:function(errortype,code,error){if("read"===errortype)return this.model.addError("".concat(code||"unknown"," error: Could not read contents of nominated ").concat(1<this.model.discussion.pages.length?"pages":"page")),this.model.setFailed,this.logError(code,error),(0,_util.rejection)}}])&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Object.defineProperty(Constructor,"prototype",{writable:!1}),TaskItemController};exports.default=_default},{"../../globals":1,"../api":220,"../prefs":223,"../util":225,"core-js/modules/es.array.concat":104,"core-js/modules/es.array.map":116,"core-js/modules/es.object.define-property":125}],161:[function(require,module,exports){"use strict";function _typeof(obj){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}require("core-js/modules/es.array.for-each"),require("core-js/modules/es.object.set-prototype-of"),require("core-js/modules/web.dom-collections.for-each"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _TaskItemWidget=_interopRequireDefault(require("../Views/TaskItemWidget")),_GroupItemController=_interopRequireDefault(require("./GroupItemController"));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function _createSuper(Derived){var hasNativeReflectConstruct=function{if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function{})),!0}catch(e){return!1}};return function{var result,Super=_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return function(self,call){{if(call&&("object"===_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined")}return function(self){if(void 0!==self)return self;throw new ReferenceError("this hasn't been initialised - super hasn't been called")}(self)}(this,result)}}function _getPrototypeOf(o){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function _setPrototypeOf(o,p){return(_setPrototypeOf=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o})(o,p)}var TaskListPanelController=function{!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),Object.defineProperty(subClass,"prototype",{writable:!1}),superClass&&_setPrototypeOf(subClass,superClass)}(TaskListPanelController,_GroupItemController["default"]);var Constructor,protoProps,staticProps,_super=_createSuper(TaskListPanelController);function TaskListPanelController(model,widget){var _this;return function(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,TaskListPanelController),(_this=_super.call(this,model,widget.fieldset))._startedItems=!1,_this}return Constructor=TaskListPanelController,(protoProps=[{key:"newItemWidget",value:function(modelItem){return new _TaskItemWidget.default(modelItem)}},{key:"onItemUpdate",value:function(itemWidget){this.model.onItemUpdate(itemWidget.model)}},{key:"updateFromModel",value:function{this.model.started&&!this._startedItems&&(this._startedItems=!0,this.group.items.forEach(function(itemWidget){return itemWidget.model.start}))}}])&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Object.defineProperty(Constructor,"prototype",{writable:!1}),TaskListPanelController};exports.default=TaskListPanelController},{"../Views/TaskItemWidget":215,"./GroupItemController":149,"core-js/modules/es.array.for-each":110,"core-js/modules/es.object.set-prototype-of":127,"core-js/modules/web.dom-collections.for-each":140}],162:[function(require,module,exports){"use strict";function _typeof(obj){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}require("core-js/modules/es.array.concat"),require("core-js/modules/es.array.find"),require("core-js/modules/es.array.includes"),require("core-js/modules/es.array.map"),require("core-js/modules/es.object.set-prototype-of"),require("core-js/modules/es.string.includes"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var obj,_util=require("../../util"),_TaskItemController2=(obj=require("../TaskItemController"))&&obj.__esModule?obj:{default:obj};function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function _createSuper(Derived){var hasNativeReflectConstruct=function{if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function{})),!0}catch(e){return!1}};return function{var result,Super=_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return function(self,call){{if(call&&("object"===_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined")}return function(self){if(void 0!==self)return self;throw new ReferenceError("this hasn't been initialised - super hasn't been called")}(self)}(this,result)}}function _getPrototypeOf(o){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function _setPrototypeOf(o,p){return(_setPrototypeOf=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o})(o,p)}var AddBeingDeleted=function{!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),Object.defineProperty(subClass,"prototype",{writable:!1}),superClass&&_setPrototypeOf(subClass,superClass)}(AddBeingDeleted,_TaskItemController2["default"]);var Constructor,protoProps,staticProps,_super=_createSuper(AddBeingDeleted);function AddBeingDeleted(model,widgets){var _this;return function(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,AddBeingDeleted),(_this=_super.call(this,model,widgets)).model.setName("Updating ".concat(1<model.pageNames.length?"templates":"template")),_this.mergeTargets=[],_this.mergeTitles=[],_this}return Constructor=AddBeingDeleted,(protoProps=[{key:"transform",value:function(page){var _this2=this;if(this.model.aborted)return(0,_util.rejection)("aborted");if(page.missing)return(0,_util.rejection)("doesNotExist");var result=this.model.result.getResultsByPage.find(function(result){return result.pageName===_this2.model.discussion.redirects.unresolveOne((0,_util.docToModule)(page.title))});if(!result)return(0,_util.rejection)("unexpectedTitle");var options=this.model.options.getOptionValues(result&&result.selectedResultName);if(!options)return(0,_util.rejection)("couldNotUpdate","Internal error: could not find options for result");var holdcellsection=options.holdcellSection||options.holdcellMergeSection,inclusionTag=(0,_util.isModule)(page.title)?"includeonly":"noinclude",oldWikitext=page.content;try{return this.mergeTargets.includes(page.title)?{text:this.model.venue.removeNomTemplate(oldWikitext),summary:this.model.getEditSummary}:"ready"===holdcellsection?{text:"<".concat(inclusionTag,">")+this.model.venue.removeNomTemplate(oldWikitext),summary:this.model.getEditSummary({short:!0,prefix:"G6 Speedy deletion nomination, per"})}:{text:"<".concat(inclusionTag,">").concat(this.model.venue.removeNomTemplate(oldWikitext)),summary:this.model.getEditSummary({short:!0,prefix:"Added per"})}}catch(e){return(0,_util.rejection)("couldNotUpdate",e)}}},{key:"initialise",value:function{this.model.setStarted,this.model.setTotalSteps(this.model.pageNames.length);var mergePageResults=this.model.getPageResults("merge");this.mergeTargets=(0,_util.uniqueArray)(mergePageResults.map(function(pageResult){return pageResult.targetPageName})),this.mergeTitles=this.model.discussion.redirects.resolve(mergePageResults.map(function(pageResult){return pageResult.pageName}))}},{key:"doTask",value:function{var _this3=this;return this.initialise,this.model.setDoing,this.api.editWithRetry(this.model.getResolvedPageNames.map(_util.moduleToDoc),null,function(page){return _this3.transform(page)},function{return _this3.model.trackStep},function(code,error,title){return _this3.handlePageError(code,error,title)}).catch(function(errortype,code,error){return _this3.handleOverallError(errortype,code,error)})}}])&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Object.defineProperty(Constructor,"prototype",{writable:!1}),AddBeingDeleted};exports.default=AddBeingDeleted},{"../../util":225,"../TaskItemController":160,"core-js/modules/es.array.concat":104,"core-js/modules/es.array.find":108,"core-js/modules/es.array.includes":111,"core-js/modules/es.array.map":116,"core-js/modules/es.object.set-prototype-of":127,"core-js/modules/es.string.includes":134}],163:[function(require,module,exports){"use strict";function _typeof(obj){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}require("core-js/modules/es.array.filter"),require("core-js/modules/es.array.find"),require("core-js/modules/es.array.includes"),require("core-js/modules/es.array.join"),require("core-js/modules/es.array.map"),require("core-js/modules/es.object.define-property"),require("core-js/modules/es.regexp.exec"),require("core-js/modules/es.string.includes"),require("core-js/modules/es.string.replace"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _globals=require("../../../globals"),_TaskItemController2=_interopRequireDefault(require("../TaskItemController")),_RemoveNomTemplates=_interopRequireDefault(require("./RemoveNomTemplates")),_util=require("../../util");function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _createSuper(Derived){var hasNativeReflectConstruct=function{if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function{})),!0}catch(e){return!1}};return function{var result,Super=_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return function(self,call){{if(call&&("object"===_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined")}return function(self){if(void 0!==self)return self;throw new ReferenceError("this hasn't been initialised - super hasn't been called")}(self)}(this,result)}}function _getPrototypeOf(o){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function _setPrototypeOf(o,p){return(_setPrototypeOf=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o})(o,p)}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function _createClass(Constructor,protoProps,staticProps){return protoProps&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Object.defineProperty(Constructor,"prototype",{writable:!1}),Constructor}var Merger=function{function Merger(config){_classCallCheck(this,Merger),this.from=config.from,this.target=config.target,this.mergeToTemplate=config.mergeToTemplate,this.mergeFromTemplates=config.mergeFromTemplates,this.isNominatedPage=config.isNominatedPage}return _createClass(Merger,[{key:"mergeFromWikitext",get:function{return this.mergeFromTemplates.join("")}}]),Merger},AddMergeTemplatesTask=function{!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),Object.defineProperty(subClass,"prototype",{writable:!1}),superClass&&_setPrototypeOf(subClass,superClass)}(AddMergeTemplatesTask,_TaskItemController2["default"]);var _super=_createSuper(AddMergeTemplatesTask);function AddMergeTemplatesTask(model,widgets){var _this;return _classCallCheck(this,AddMergeTemplatesTask),(_this=_super.call(this,model,widgets)).model.setName("Adding merge templates"),_this}return _createClass(AddMergeTemplatesTask,[{key:"getMergers",value:function{var _this2=this,targets=(0,_util.uniqueArray)(this.model.getPageResults.map(function(pageResult){return pageResult.getFormattedTarget({raw:!0})})),curdate=(0,_util.dmyDateString)(new Date);return targets.map(function(target){var mergeFromPages=_this2.model.getPageResults.filter(function(pageResult){return pageResult.getFormattedTarget({raw:!0})===target}).map(function(pageResult){return _this2.model.discussion.redirects.resolveOne(pageResult.pageName)}),mergeToTemplate=_this2.model.venue.wikitext.mergeTo.replace(/__TARGET__/,target).replace(/__DEBATE__/,_this2.model.discussion.discussionSubpageName).replace(/__DATE__/,curdate).replace(/__TARGETTALK__/,_globals.mw.Title.newFromText(target).getTalkPage.getPrefixedText),mergeFromTemplates=mergeFromPages.map(function(pageName){return _this2.model.venue.wikitext.mergeFrom.replace(/__NOMINATED__/,pageName).replace(/__DEBATE__/,_this2.model.discussion.discussionSubpageName).replace(/__DATE__/,curdate)}),isNominatedPage=_this2.model.discussion.pagesNames.includes(_this2.model.discussion.redirects.unresolveOne(target));return new Merger({from:mergeFromPages,target:target,mergeToTemplate:mergeToTemplate,mergeFromTemplates:mergeFromTemplates,isNominatedPage:isNominatedPage})})}},{key:"transformTargetTalk",value:function(page){if(this.model.aborted)return(0,_util.rejection)("aborted");var merger=this.getMergers.find(function(merger){return _globals.mw.Title.newFromText(merger.target).getTalkPage.getPrefixedText===page.title});return merger?{prependtext:merger.mergeFromWikitext,summary:this.model.getEditSummary}:(0,_util.rejection)("unexpectedTarget")}},{key:"transformNominatedPage",value:function(page){if(this.model.aborted)return(0,_util.rejection)("aborted");var merger=this.getMergers.find(function(merger){return merger.from.includes(page.title)});return merger?_RemoveNomTemplates.default.transform(this,page,merger.mergeToTemplate):(0,_util.rejection)("unexpectedTitle")}},{key:"doTask",value:function{var _this3=this,mergers=this.getMergers;if(0===mergers.length)return this.model.addWarning("None found"),(0,_util.rejection);var mergersToNotNominatedPages=mergers.filter(function(merger){return!merger.isNominatedPage});this.model.setTotalSteps(this.model.pageNames.length+mergersToNotNominatedPages.length),this.model.setDoing;var editTargetsTalkPages=mergersToNotNominatedPages.length&&this.api.editWithRetry(mergersToNotNominatedPages.map(function(merger){return _globals.mw.Title.newFromText(merger.target).getTalkPage.getPrefixedText}),null,function(page){return _this3.transformTargetTalk(page)},function{return _this3.model.trackStep},function(code,error,title){return _this3.handlePageError(code,error,title)}).catch(function(errortype,code,error){"read"===errortype&&_this3.model.addError(code,error,"Could not read contents of target talk ".concat(1<mergersToNotNominatedPages.length?"pages":"page"))}),editNominatedPages=this.api.editWithRetry(this.model.getResolvedPageNames,null,function(page){return _this3.transformNominatedPage(page)},function{return _this3.model.trackStep},function(code,error,title){return _this3.handlePageError(code,error,title)}).catch(function(errortype,code,error){"read"===errortype&&_this3.model.addError(code,error,"Could not read contents of nominated ".concat(1<_this3.model.pageNames.length?"pages":"page"))});return _globals.$.when(editTargetsTalkPages,editNominatedPages)}}]),AddMergeTemplatesTask};exports.default=AddMergeTemplatesTask},{"../../../globals":1,"../../util":225,"../TaskItemController":160,"./RemoveNomTemplates":174,"core-js/modules/es.array.filter":106,"core-js/modules/es.array.find":108,"core-js/modules/es.array.includes":111,"core-js/modules/es.array.join":114,"core-js/modules/es.array.map":116,"core-js/modules/es.object.define-property":125,"core-js/modules/es.regexp.exec":132,"core-js/modules/es.string.includes":134,"core-js/modules/es.string.replace":136}],164:[function(require,module,exports){"use strict";function _typeof(obj){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}require("core-js/modules/es.array.concat"),require("core-js/modules/es.array.find"),require("core-js/modules/es.array.for-each"),require("core-js/modules/es.array.index-of"),require("core-js/modules/es.array.slice"),require("core-js/modules/es.function.name"),require("core-js/modules/es.object.set-prototype-of"),require("core-js/modules/es.object.to-string"),require("core-js/modules/es.parse-int"),require("core-js/modules/es.regexp.exec"),require("core-js/modules/es.regexp.to-string"),require("core-js/modules/es.string.replace"),require("core-js/modules/es.string.trim"),require("core-js/modules/web.dom-collections.for-each"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _globals=require("../../../globals"),_TaskItemController2=_interopRequireDefault(require("../TaskItemController")),_util=require("../../util"),_Template=_interopRequireDefault(require("../../Template"));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})),keys.push.apply(keys,symbols)}return keys}function _objectSpread(target){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?ownKeys(Object(source),!0).forEach(function(key){_defineProperty(target,key,source[key])}):Object.getOwnPropertyDescriptors?Object.defineProperties(target,Object.getOwnPropertyDescriptors(source)):ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))})}return target}function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function _createSuper(Derived){var hasNativeReflectConstruct=function{if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function{})),!0}catch(e){return!1}};return function{var result,Super=_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return function(self,call){{if(call&&("object"===_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined")}return function(self){if(void 0!==self)return self;throw new ReferenceError("this hasn't been initialised - super hasn't been called")}(self)}(this,result)}}function _getPrototypeOf(o){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function _setPrototypeOf(o,p){return(_setPrototypeOf=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o})(o,p)}var AddOldXfdTask=function{!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),Object.defineProperty(subClass,"prototype",{writable:!1}),superClass&&_setPrototypeOf(subClass,superClass)}(AddOldXfdTask,_TaskItemController2["default"]);var Constructor,protoProps,staticProps,_super=_createSuper(AddOldXfdTask);function AddOldXfdTask(model,widgets){var _this;return function(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,AddOldXfdTask),(_this=_super.call(this,model,widgets)).model.setName("Updating talk ".concat(1<model.pageNames.length?"pages":"page")),_this}return Constructor=AddOldXfdTask,(protoProps=[{key:"makeOldxfdWikitext",value:function(altpage){var result=this.model.venue.wikitext.oldXfd.replace(/__DATE__/,(0,_util.dmyDateString)(this.model.discussion.nominationDate)).replace(/__DATE_YMD__/,(0,_util.ymdDateString)(this.model.discussion.nominationDate)).replace(/__ACTION__/,this.model.discussion.action).replace(/__SECTION__/,this.model.discussion.sectionHeader).replace(/__RESULT__/,this.model.result.getResultText).replace(/__FIRSTDATE__/,(0,_util.dmyDateString)(this.model.discussion.firstCommentDate)).replace(/__SUBPAGE__/,this.model.discussion.discussionSubpageName);return altpage&&(result=result.replace("}}"," |altpage=".concat(altpage,"}}"))),result}},{key:"makeNewWikitext",value:function(wikitext,pageTitle){var oldAfdTemplate,titleObject=_globals.mw.Title.newFromText(pageTitle),PAGENAME=titleObject.getMain,SUBJECTPAGENAME=titleObject.getSubjectPage.getNamespacePrefix+PAGENAME,oldafdmulti=""),oldAfdTemplate?wikitext.replace(oldAfdTemplate.wikitext,oldafdmulti):oldafdmulti+"\n"+wikitext.trim}},{key:"transform",value:function(page){var _this2=this;if(this.model.aborted)return(0,_util.rejection)("aborted");var pageName=this.model.getResolvedTalkpagesNames.find(function(talkpageName){return talkpageName===page.title}),pageTitle=pageName&&_globals.mw.Title.newFromText(pageName);if(!pageTitle)return(0,_util.rejection)("unexpectedTitle");if(!pageTitle.getSubjectPage.exists)return(0,_util.rejection)("Subject page does not exist");var baseEditParams={section:"0",summary:this.model.getEditSummary({prefix:"Old ".concat(this.model.venue.type.toUpperCase,":")})};switch(!0){case page.redirect&&"rfd"===this.model.venue.type:return _globals.OO.ui.confirm('"'.concat(page.title,'" is currently a redirect. Okay to replace with Old RFD template?')).then(function(confirmed){return confirmed?_objectSpread({},baseEditParams,{text:_this2.makeOldxfdWikitext,redirect:!1}):_globals.$.Deferred.reject("skipped")});case page.redirect&&"mfd"===this.model.venue.type:return _objectSpread({},baseEditParams,{prependtext:this.makeOldxfdWikitext(pageTitle.getPrefixedText),redirect:!0});case page.redirect&&"afd"!==this.model.venue.type:return _objectSpread({},baseEditParams,{appendtext:"\n"+this.makeOldxfdWikitext,redirect:!1});default:return _objectSpread({},baseEditParams,{text:this.makeNewWikitext(page.missing?"":page.content,page.title),redirect:!1})}}},{key:"doTask",value:function{var _this3=this,talkpagesNames=this.model.getResolvedTalkpagesNames;return 0===talkpagesNames.length?(this.model.addWarning("None found"),(0,_util.rejection)):(this.model.setTotalSteps(talkpagesNames.length),this.model.setDoing,this.api.editWithRetry(talkpagesNames,{rvsection:"0"},function(page){return _this3.transform(page)},function{return _this3.model.trackStep},function(code,error,title){return _this3.handlePageError(code,error,title)}).catch(function(errortype,code,error){return _this3.handleOverallError(errortype,code,error)}))}}])&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Object.defineProperty(Constructor,"prototype",{writable:!1}),AddOldXfdTask};exports.default=AddOldXfdTask},{"../../../globals":1,"../../Template":202,"../../util":225,"../TaskItemController":160,"core-js/modules/es.array.concat":104,"core-js/modules/es.array.find":108,"core-js/modules/es.array.for-each":110,"core-js/modules/es.array.index-of":112,"core-js/modules/es.array.slice":119,"core-js/modules/es.function.name":123,"core-js/modules/es.object.set-prototype-of":127,"core-js/modules/es.object.to-string":128,"core-js/modules/es.parse-int":130,"core-js/modules/es.regexp.exec":132,"core-js/modules/es.regexp.to-string":133,"core-js/modules/es.string.replace":136,"core-js/modules/es.string.trim":139,"core-js/modules/web.dom-collections.for-each":140}],165:[function(require,module,exports){"use strict";function _typeof(obj){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}require("core-js/modules/es.array.concat"),require("core-js/modules/es.array.for-each"),require("core-js/modules/es.array.includes"),require("core-js/modules/es.array.join"),require("core-js/modules/es.array.map"),require("core-js/modules/es.object.define-property"),require("core-js/modules/es.regexp.exec"),require("core-js/modules/es.string.includes"),require("core-js/modules/es.string.replace"),require("core-js/modules/es.string.split"),require("core-js/modules/es.string.trim"),require("core-js/modules/web.dom-collections.for-each"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var obj,_globals=require("../../../globals"),_util=require("../../util"),_TaskItemController2=(obj=require("../TaskItemController"))&&obj.__esModule?obj:{default:obj};function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function _createSuper(Derived){var hasNativeReflectConstruct=function{if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function{})),!0}catch(e){return!1}};return function{var result,Super=_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return function(self,call){{if(call&&("object"===_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined")}return _assertThisInitialized(self)}(this,result)}}function _assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super hasn't been called");return self}function _getPrototypeOf(o){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function _setPrototypeOf(o,p){return(_setPrototypeOf=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o})(o,p)}function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}var AddToHoldingCell=function{!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),Object.defineProperty(subClass,"prototype",{writable:!1}),superClass&&_setPrototypeOf(subClass,superClass)}(AddToHoldingCell,_TaskItemController2["default"]);var Constructor,protoProps,staticProps,_super=_createSuper(AddToHoldingCell);function AddToHoldingCell(model,widgets){var _this;return function(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,AddToHoldingCell),_defineProperty(_assertThisInitialized(_this=_super.call(this,model,widgets)),"doTask",function{var _this2=this;return this.model.setTotalSteps(1),this.model.setDoing,this.api.editWithRetry(this.model.venue.subpagePath+"Holding cell",null,function(page){return _this2.transform(page)},function{return _this2.model.trackStep},function(code,error,title){return _this2.handlePageError(code,error,title)}).catch(function(errortype,code,error){return _this2.handleOverallError(errortype,code,error)})}),_this.model.setName("Listing at holding cell"),_this}return Constructor=AddToHoldingCell,(protoProps=[{key:"transform",value:function(holdingCellPage){var _this3=this;if(this.model.aborted)return(0,_util.rejection)("aorted");var sectionsArray=holdingCellPage.content.split(/\n={3,}/).map(function(section){var headingSigns=/^[^=]+(=+)\n/.exec(section);return headingSigns?headingSigns[1]+section:section}),changesMade=0,moduleCount=0;return this.model.getPageResults.forEach(function(pageResult){var pageName=_this3.model.discussion.redirects.resolveOne(pageResult.pageName),pageTitle=_globals.mw.Title.newFromText(pageName),options=_this3.model.options.getOptionValues(pageResult.selectedResultName);if(_this3.model.venue.ns_number.includes(pageTitle.getNamespaceId))if(pageTitle.exists){var main=pageTitle.getMain,dateString=(0,_util.ymdDateString)(_this3.model.discussion.nominationDate),section=_this3.model.discussion.sectionHeader,deleteParam="ready"===options.holdcellSection?"|delete=1":"",nsParam=828===pageTitle.getNamespaceId?"|ns=Module":"",sectionNum=_this3.model.venue.holdingCellSectionNumber[options.holdcellSection||options.holdcellMergeSection];sectionsArray[sectionNum]=AddToHoldingCell.cleanupSection(sectionsArray[sectionNum])+"\n*\n"),changesMade++,nsParam&&moduleCount++}else _this3.model.addError("".concat((0,_util.makeLink)(pageName)," does not exist, and will not be listed at the holding cell"));else _this3.model.addError("".concat((0,_util.makeLink)(pageName)," is not in the expected namespace, and will not be listed at the holding cell"))}),0===changesMade?(0,_util.rejection)("noChangesMade"):{text:sectionsArray.join("\n"),summary:this.model.getEditSummary({prefix:"Listing ".concat(AddToHoldingCell.typeListed(changesMade,moduleCount),":")})}}}])&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Object.defineProperty(Constructor,"prototype",{writable:!1}),AddToHoldingCell};_defineProperty(exports.default=AddToHoldingCell,"cleanupSection",function(wikitext){return wikitext.replace(/\n*^\*\s*None currently\s*$(?![^<]*?-->)/gim,"").trim}),_defineProperty(AddToHoldingCell,"typeListed",function(total,moduleCount){switch(!0){case 1===total&&0===moduleCount:return"template";case 1===total&&1===moduleCount:return"module";case total===moduleCount:return"modules";case 0===moduleCount:return"templates";case 2===total&&1===moduleCount:return"template and module";case total===moduleCount+1:return"template and modules";default:return"templates and modules"}})},{"../../../globals":1,"../../util":225,"../TaskItemController":160,"core-js/modules/es.array.concat":104,"core-js/modules/es.array.for-each":110,"core-js/modules/es.array.includes":111,"core-js/modules/es.array.join":114,"core-js/modules/es.array.map":116,"core-js/modules/es.object.define-property":125,"core-js/modules/es.regexp.exec":132,"core-js/modules/es.string.includes":134,"core-js/modules/es.string.replace":136,"core-js/modules/es.string.split":138,"core-js/modules/es.string.trim":139,"core-js/modules/web.dom-collections.for-each":140}],166:[function(require,module,exports){"use strict";function _typeof(obj){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}require("core-js/modules/es.array.concat"),require("core-js/modules/es.array.includes"),require("core-js/modules/es.array.index-of"),require("core-js/modules/es.array.slice"),require("core-js/modules/es.object.define-property"),require("core-js/modules/es.regexp.exec"),require("core-js/modules/es.string.includes"),require("core-js/modules/es.string.replace"),require("core-js/modules/es.string.trim"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _util=require("../../util"),_config=_interopRequireDefault(require("../../config")),_TaskItemController2=_interopRequireDefault(require("../TaskItemController"));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function _createSuper(Derived){var hasNativeReflectConstruct=function{if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function{})),!0}catch(e){return!1}};return function{var result,Super=_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return function(self,call){{if(call&&("object"===_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined")}return _assertThisInitialized(self)}(this,result)}}function _assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super hasn't been called");return self}function _getPrototypeOf(o){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function _setPrototypeOf(o,p){return(_setPrototypeOf=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o})(o,p)}function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}var CloseDiscussion=function{!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),Object.defineProperty(subClass,"prototype",{writable:!1}),superClass&&_setPrototypeOf(subClass,superClass)}(CloseDiscussion,_TaskItemController2["default"]);var Constructor,protoProps,staticProps,_super=_createSuper(CloseDiscussion);function CloseDiscussion(model,widgets){var _this;return function(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,CloseDiscussion),_defineProperty(_assertThisInitialized(_this=_super.call(this,model,widgets)),"doTask",function{var _this2=this;return this.model.setTotalSteps(1),this.model.setDoing,this.api.editWithRetry(this.model.discussion.discussionPageName,{rvsection:this.model.discussion.sectionNumber},function(page){return _this2.transform(page)},function{return _this2.model.trackStep},function(code,error,title){_this2.handlePageError("abort"),"abort"!==code&&"aborted"!==code&&_this2.handlePageError(code,error,title)}).catch(function(errortype,code,error){return _this2.model.setAborted,_this2.handleOverallError(errortype,code,error),(0,_util.rejection)})}),_this.model.setName("Closing discussion"),_this}return Constructor=CloseDiscussion,(protoProps=[{key:"transform",value:function(page){if(this.model.aborted)return(0,_util.rejection)("aborted");if(page.content.includes(this.model.venue.wikitext.alreadyClosed))return this.model.addError("Discussion already closed (reload page to see the close)"),(0,_util.rejection)("abort");if(this.model.venue.hasIndividualSubpages&&_config.default.startTime<new Date(page.revisions[0].timestamp))return this.model.addError("Edit conflict detected"),(0,_util.rejection)("abort");var section_heading=page.content.slice(0,page.content.indexOf("\n")),sectionHeadingText=CloseDiscussion.sectionHeadingText(section_heading);if(sectionHeadingText!==this.model.discussion.sectionHeader)return this.model.addError('Possible edit conflict detected, found section heading"'.concat(sectionHeadingText,'"')),(0,_util.rejection)("abort");var xfd_close_top=this.model.venue.wikitext.closeTop.replace(/__RESULT__/,this.model.result.getResultText||"&thinsp;").replace(/__TO_TARGET__/,this.model.result.getFormattedTarget({prepend:" to "})).replace(/__RATIONALE__/,this.model.result.getFormattedRationale("punctuated")||".").replace(/__SIG__/,_config.default.user.sig),section_content=page.content.slice(page.content.indexOf("\n")+1).replace(/(|||\{\{REMOVE THIS TEMPLATE WHEN CLOSING THIS AfD\|.?\}\}| \[\[Category:Relisted AfD debates\|.*?\]\](\[\[Category:AfD debates relisted 3 or more times|.*?\]\])?<\/noinclude>)/gi,""),updated_section=(this.model.venue.hasIndividualSubpages?xfd_close_top+"\n"+section_heading:section_heading+"\n"+xfd_close_top)+"\n"+section_content.trim+"\n"+this.model.venue.wikitext.closeBottom;return{section:this.model.discussion.sectionNumber,text:updated_section,summary:"/* ".concat(this.model.discussion.sectionHeader," */ Closed as ").concat(this.model.result.getResultText," ").concat(_config.default.script.advert)}}}])&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Object.defineProperty(Constructor,"prototype",{writable:!1}),CloseDiscussion};_defineProperty(exports.default=CloseDiscussion,"sectionHeadingText",function(wikitext){return(0,_util.decodeHtml)(wikitext.replace(/(?:^\s*=*\s*|\s*=*\s*$)/g,"").replace(/\[\[:?(?:[^\]]+\|)?([^\]]+)\]\]/g,"$1").replace(/{{\s*[Tt]l[a-z]?\s*\|\s*([^}]+)}}/g,"").replace(/s*}}/,"}}").replace(/\s{2,}/g," ").trim)})},{"../../config":221,"../../util":225,"../TaskItemController":160,"core-js/modules/es.array.concat":104,"core-js/modules/es.array.includes":111,"core-js/modules/es.array.index-of":112,"core-js/modules/es.array.slice":119,"core-js/modules/es.object.define-property":125,"core-js/modules/es.regexp.exec":132,"core-js/modules/es.string.includes":134,"core-js/modules/es.string.replace":136,"core-js/modules/es.string.trim":139}],167:[function(require,module,exports){"use strict";function _typeof(obj){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}require("core-js/modules/es.array.filter"),require("core-js/modules/es.object.set-prototype-of"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var obj,_globals=require("../../../globals"),_TaskItemController2=(obj=require("../TaskItemController"))&&obj.__esModule?obj:{default:obj},_util=require("../../util");function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function _createSuper(Derived){var hasNativeReflectConstruct=function{if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function{})),!0}catch(e){return!1}};return function{var result,Super=_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return function(self,call){{if(call&&("object"===_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined")}return function(self){if(void 0!==self)return self;throw new ReferenceError("this hasn't been initialised - super hasn't been called")}(self)}(this,result)}}function _getPrototypeOf(o){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function _setPrototypeOf(o,p){return(_setPrototypeOf=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o})(o,p)}var DeletePages=function{!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),Object.defineProperty(subClass,"prototype",{writable:!1}),superClass&&_setPrototypeOf(subClass,superClass)}(DeletePages,_TaskItemController2["default"]);var Constructor,protoProps,staticProps,_super=_createSuper(DeletePages);function DeletePages(model,widgets){var _this;return function(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,DeletePages),(_this=_super.call(this,model,widgets)).model.setName("Deleting ".concat(1<model.pageNames.length?"pages":"page")),_this}return Constructor=DeletePages,(protoProps=[{key:"verifyPage",value:function(pageName){return!!_globals.mw.Title.newFromText(pageName).exists||(this.model.addWarning("".concat((0,_util.makeLink)(pageName)," skipped: does not exist (may have already been deleted by others)")),this.model.trackStep("failed"),!1)}},{key:"doTask",value:function{var _this2=this;this.model.setTotalSteps(this.model.discussion.pages.length),this.model.setDoing;var pagesToDelete=this.model.getResolvedPageNames.filter(function(pageName){return _this2.verifyPage(pageName)});return 0===pagesToDelete.length?(0,_util.rejection):this.api.deleteWithRetry(pagesToDelete,{reason:this.model.getEditSummary({short:!0})},function{return _this2.model.trackStep},function(code,error,title){return _this2.handlePageError(code,error,title,"delete")}).catch(function(errortype,code,error){return _this2.handleOverallError(errortype,code,error)})}}])&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Object.defineProperty(Constructor,"prototype",{writable:!1}),DeletePages};exports.default=DeletePages},{"../../../globals":1,"../../util":225,"../TaskItemController":160,"core-js/modules/es.array.filter":106,"core-js/modules/es.object.set-prototype-of":127}],168:[function(require,module,exports){"use strict";function _typeof(obj){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}require("core-js/modules/es.array.concat"),require("core-js/modules/es.array.filter"),require("core-js/modules/es.array.join"),require("core-js/modules/es.array.map"),require("core-js/modules/es.object.set-prototype-of"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var obj,_globals=require("../../../globals"),_TaskItemController2=(obj=require("../TaskItemController"))&&obj.__esModule?obj:{default:obj},_util=require("../../util");function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function _createSuper(Derived){var hasNativeReflectConstruct=function{if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function{})),!0}catch(e){return!1}};return function{var result,Super=_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return function(self,call){{if(call&&("object"===_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined")}return function(self){if(void 0!==self)return self;throw new ReferenceError("this hasn't been initialised - super hasn't been called")}(self)}(this,result)}}function _getPrototypeOf(o){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function _setPrototypeOf(o,p){return(_setPrototypeOf=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o})(o,p)}var DeleteRedirects=function{!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),Object.defineProperty(subClass,"prototype",{writable:!1}),superClass&&_setPrototypeOf(subClass,superClass)}(DeleteRedirects,_TaskItemController2["default"]);var Constructor,protoProps,staticProps,_super=_createSuper(DeleteRedirects);function DeleteRedirects(model,widgets){var _this;return function(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,DeleteRedirects),(_this=_super.call(this,model,widgets)).model.setName("Deleting redirects"),_this}return Constructor=DeleteRedirects,(protoProps=[{key:"titlesFromResponsePages",value:function(pages){var _this2=this,result={titles:pages.map(function(page){return page.title}),talkTitles:pages.filter(function(page){return page.talkid}).map(function(page){return _globals.mw.Title.newFromText(page.title).getTalkPage.getPrefixedText})};return this.model.setTotalSteps(result.titles.length+result.talkTitles.length),result.titles.length<10?result:(0,_util.multiButtonConfirm)({title:"Warning",message:"Mass action to be peformed: delete ".concat(result.titles.length," redirects."),actions:[{label:"Cancel",flags:"safe"},{label:"View redirects...",action:"show"},{label:"Delete redirects",action:"accept",flags:"progressive"}],size:"medium",scrolled:!0}).then(function(action){return"show"!==action?action:(0,_util.multiButtonConfirm)({title:"Warning",message:"Mass action to be peformed: delete ".concat(result.titles.length," redirects:").concat(result.titles.map(function(title){return"".concat(title,"")}).join(""),""),actions:[{label:"Cancel",flags:"safe"},{label:"Delete redirects",action:"accept",flags:"progressive"}],size:"medium",scrolled:!0})}).then(function(action){return"accept"!==action?(_this2.model.addWarning("Cancelled by user"),_globals.$.Deferred.reject("Skipped.")):result})}},{key:"doTask",value:function{var _this3=this;return this.api.queryWithContinue({titles:this.model.getResolvedPageNames,generator:"redirects",grdlimit:"max",prop:"info",inprop:"talkid"}).then(function(response){return _this3.model.aborted?(0,_util.rejection)("aborted"):response&&response.pages?_this3.titlesFromResponsePages(response.pages):(_this3.model.addWarning("none found"),(0,_util.rejection)("Skipped."))}).then(function(result){if(_this3.model.aborted)return(0,_util.rejection)("aborted");_this3.model.setDoing;var deleteRedirectsPromise=_this3.api.deleteWithRetry(result.titles,{reason:_this3.model.getEditSummary({prefix:"G8 (redirect):"})},function{return _this3.model.trackStep},function(code,error,title){return _this3.handlePageError(code,error,title,"delete")}).catch(function(errortype,code,error){_this3.handleOverallError(errortype,code,error)}),deleteTalkpagesPromise=result.talkTitles.length&&_this3.api.deleteWithRetry(result.talkTitles,{reason:_this3.model.getEditSummary({prefix:"G8 (talk page of redirect):"})},function{return _this3.model.trackStep},function(code,error,title){return _this3.handlePageError(code,error,title,"delete")}).catch(function(errortype,code,error){_this3.handleOverallError(errortype,code,error)});return _globals.$.when(deleteRedirectsPromise,deleteTalkpagesPromise)})}}])&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Object.defineProperty(Constructor,"prototype",{writable:!1}),DeleteRedirects};exports.default=DeleteRedirects},{"../../../globals":1,"../../util":225,"../TaskItemController":160,"core-js/modules/es.array.concat":104,"core-js/modules/es.array.filter":106,"core-js/modules/es.array.join":114,"core-js/modules/es.array.map":116,"core-js/modules/es.object.set-prototype-of":127}],169:[function(require,module,exports){"use strict";function _typeof(obj){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}require("core-js/modules/es.array.filter"),require("core-js/modules/es.array.includes"),require("core-js/modules/es.object.set-prototype-of"),require("core-js/modules/es.string.includes"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var obj,_globals=require("../../../globals"),_TaskItemController2=(obj=require("../TaskItemController"))&&obj.__esModule?obj:{default:obj},_util=require("../../util");function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function _createSuper(Derived){var hasNativeReflectConstruct=function{if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function{})),!0}catch(e){return!1}};return function{var result,Super=_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return function(self,call){{if(call&&("object"===_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined")}return function(self){if(void 0!==self)return self;throw new ReferenceError("this hasn't been initialised - super hasn't been called")}(self)}(this,result)}}function _getPrototypeOf(o){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function _setPrototypeOf(o,p){return(_setPrototypeOf=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o})(o,p)}var DeleteTalkpages=function{!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),Object.defineProperty(subClass,"prototype",{writable:!1}),superClass&&_setPrototypeOf(subClass,superClass)}(DeleteTalkpages,_TaskItemController2["default"]);var Constructor,protoProps,staticProps,_super=_createSuper(DeleteTalkpages);function DeleteTalkpages(model,widgets){var _this;return function(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,DeleteTalkpages),(_this=_super.call(this,model,widgets)).model.setName("Deleting talk ".concat(1<model.pageNames.length?"pages":"page")),_this}return Constructor=DeleteTalkpages,(protoProps=[{key:"verifyPage",value:function(pageName){var title=_globals.mw.Title.newFromText(pageName),isUserTalkBasePage=3===title.getNamespaceId&&!pageName.includes("/");return title.exists?!isUserTalkBasePage||(this.model.addWarning("".concat((0,_util.makeLink)(pageName)," skipped: base user talk page (not eligible for G8 speedy deletion)")),this.model.trackStep("skipped"),!1):(this.model.addWarning("".concat((0,_util.makeLink)(pageName)," skipped: does not exist (may have already been deleted by others)")),this.model.trackStep("skipped"),!1)}},{key:"doTask",value:function{var _this2=this,talkPages=this.model.getResolvedTalkpagesNames;if(0===talkPages.length)return this.model.addWarning("None found"),(0,_util.rejection);this.model.setTotalSteps(talkPages.length);var talkPagesToDelete=talkPages.filter(function(pageName){return _this2.verifyPage(pageName)});return this.model.setDoing,this.api.deleteWithRetry(talkPagesToDelete,{reason:this.model.getEditSummary({prefix:"G8:"})},function{return _this2.model.trackStep},function(code,error,title){return _this2.handlePageError(code,error,title,"delete")}).catch(function(errortype,code,error){_this2.handleOverallError(errortype,code,error)})}}])&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Object.defineProperty(Constructor,"prototype",{writable:!1}),DeleteTalkpages};exports.default=DeleteTalkpages},{"../../../globals":1,"../../util":225,"../TaskItemController":160,"core-js/modules/es.array.filter":106,"core-js/modules/es.array.includes":111,"core-js/modules/es.object.set-prototype-of":127,"core-js/modules/es.string.includes":134}],170:[function(require,module,exports){"use strict";function _typeof(obj){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}require("core-js/modules/es.array.includes"),require("core-js/modules/es.object.set-prototype-of"),require("core-js/modules/es.regexp.exec"),require("core-js/modules/es.string.includes"),require("core-js/modules/es.string.replace"),require("core-js/modules/es.string.trim"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var obj,_TaskItemController2=(obj=require("../TaskItemController"))&&obj.__esModule?obj:{default:obj},_util=require("../../util");function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function _createSuper(Derived){var hasNativeReflectConstruct=function{if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function{})),!0}catch(e){return!1}};return function{var result,Super=_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return function(self,call){{if(call&&("object"===_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined")}return function(self){if(void 0!==self)return self;throw new ReferenceError("this hasn't been initialised - super hasn't been called")}(self)}(this,result)}}function _getPrototypeOf(o){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function _setPrototypeOf(o,p){return(_setPrototypeOf=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o})(o,p)}var Disambiguate=function{!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),Object.defineProperty(subClass,"prototype",{writable:!1}),superClass&&_setPrototypeOf(subClass,superClass)}(Disambiguate,_TaskItemController2["default"]);var Constructor,protoProps,staticProps,_super=_createSuper(Disambiguate);function Disambiguate(model,widgets){var _this;return function(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Disambiguate),(_this=_super.call(this,model,widgets)).model.setName("Updating ".concat(1<model.pageNames.length?"pages":"page")),_this}return Constructor=Disambiguate,(protoProps=[{key:"transform",value:function(page){if(this.model.aborted)return(0,_util.rejection)("aborted");if(!this.model.getResolvedPageNames.includes((0,_util.docToModule)(page.title)))return(0,_util.rejection)("unexpectedTitle");if(page.missing)return(0,_util.rejection)("doesNotExist");var updatedWikitext=page.content.replace(this.model.venue.regex.fullNomTemplate,"");return updatedWikitext===page.content&&(this.model.addWarning("Nomination template not found on page ".concat((0,_util.makeLink)(page.title))),updatedWikitext=page.content.replace(/^#REDIRECT/im,"*")),{text:/(?:disambiguation|disambig|dab|Mil-unit-dis|Numberdis)[^{]*}}/i.test(updatedWikitext)?updatedWikitext.trim:updatedWikitext.trim+"\n",summary:this.model.getEditSummary}}},{key:"doTask",value:function{var _this2=this,pageNames=this.model.getResolvedPageNames;return 0===pageNames.length?(this.model.addWarning("None found"),(0,_util.rejection)):(this.model.setTotalSteps(pageNames.length),this.model.setDoing,this.api.editWithRetry(pageNames,null,function(page){return _this2.transform(page)},function{return _this2.model.trackStep},function(code,error,title){return _this2.handlePageError(code,error,title)}).catch(function(errortype,code,error){return _this2.handleOverallError(errortype,code,error)}))}}])&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Object.defineProperty(Constructor,"prototype",{writable:!1}),Disambiguate};exports.default=Disambiguate},{"../../util":225,"../TaskItemController":160,"core-js/modules/es.array.includes":111,"core-js/modules/es.object.set-prototype-of":127,"core-js/modules/es.regexp.exec":132,"core-js/modules/es.string.includes":134,"core-js/modules/es.string.replace":136,"core-js/modules/es.string.trim":139}],171:[function(require,module,exports){"use strict";function _typeof(obj){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}require("core-js/modules/es.array.concat"),require("core-js/modules/es.array.filter"),require("core-js/modules/es.array.for-each"),require("core-js/modules/es.array.includes"),require("core-js/modules/es.array.index-of"),require("core-js/modules/es.array.join"),require("core-js/modules/es.array.last-index-of"),require("core-js/modules/es.array.map"),require("core-js/modules/es.array.reverse"),require("core-js/modules/es.array.slice"),require("core-js/modules/es.object.define-property"),require("core-js/modules/es.regexp.constructor"),require("core-js/modules/es.regexp.exec"),require("core-js/modules/es.regexp.to-string"),require("core-js/modules/es.string.includes"),require("core-js/modules/es.string.match"),require("core-js/modules/es.string.replace"),require("core-js/modules/es.string.trim"),require("core-js/modules/web.dom-collections.for-each"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _globals=require("../../../globals"),_config=_interopRequireDefault(require("../../config")),_TaskItemController2=_interopRequireDefault(require("../TaskItemController")),_util=require("../../util");function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})),keys.push.apply(keys,symbols)}return keys}function _objectSpread(target){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?ownKeys(Object(source),!0).forEach(function(key){_defineProperty(target,key,source[key])}):Object.getOwnPropertyDescriptors?Object.defineProperties(target,Object.getOwnPropertyDescriptors(source)):ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))})}return target}function _slicedToArray(arr,i){return function(arr){if(Array.isArray(arr))return arr}(arr)||function(arr,i){var _i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null==_i)return;var _s,_e,_arr=[],_n=!0,_d=!1;try{for(_i=_i.call(arr);!(_n=(_s=_i.next).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return}finally{if(_d)throw _e}}return _arr}(arr,i)||function(o,minLen){if(!o)return;if("string"==typeof o)return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}(arr,i)||function{throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator] method.")}}function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function _createSuper(Derived){var hasNativeReflectConstruct=function{if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function{})),!0}catch(e){return!1}};return function{var result,Super=_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return function(self,call){{if(call&&("object"===_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined")}return function(self){if(void 0!==self)return self;throw new ReferenceError("this hasn't been initialised - super hasn't been called")}(self)}(this,result)}}function _getPrototypeOf(o){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function _setPrototypeOf(o,p){return(_setPrototypeOf=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o})(o,p)}function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}var RelistInfo=function{!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),Object.defineProperty(subClass,"prototype",{writable:!1}),superClass&&_setPrototypeOf(subClass,superClass)}(RelistInfo,_TaskItemController2["default"]);var Constructor,protoProps,staticProps,_super=_createSuper(RelistInfo);function RelistInfo(model,widgets){var _this;return function(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,RelistInfo),(_this=_super.call(this,model,widgets)).model.setName("Preparing to relist"),_this}return Constructor=RelistInfo,(protoProps=[{key:"getRelistTemplate",value:function(content){var relists=content.match(/\[\[Wikipedia:Deletion process#Relisting discussions\|Relisted\]\]/g),relistNumber=relists?relists.length+1:1;return"".concat(this.model.result.getRelistComment,"")}},{key:"getRelistWikitext",value:function(content){var _this2=this,heading=content.slice(0,content.indexOf("\n")),newWikitext=content.trim+"\n".concat(this.getRelistTemplate(content),"\n"),oldLogWikitext="";switch(this.model.venue.type){case"afd":newWikitext=newWikitext.replace(/\[\[Wikipedia:Articles for deletion\/Log\/\d{4} \w+ \d{1,2}#/,"").concat(RelistInfo.today,"")).replace(/__RATIONALE__/,".").replace(/__SIG__/,_config.default.user.sig),pagesList=this.model.discussion.pages.map(function(page){return _this2.model.venue.wikitext.pagelinks.replace("__PAGE__",page.getMain+(828===page.getNamespaceId?"|module=Module":""))}).join("");oldLogWikitext="".concat(heading,"\n").concat(xfdCloseTop,"\n").concat(pagesList+this.model.venue.wikitext.closeBottom);break;case"mfd":var splitIndex=newWikitext.indexOf("\n",newWikitext.lastIndexOf(":{{pagelinks"));newWikitext="".concat(newWikitext.slice(0,splitIndex).trim,"\n{{subst:mfdr}}\n").concat(newWikitext.slice(splitIndex+1).trim);break;case"rfd":var topWikitext="====".concat(this.model.discussion.sectionHeader,"===="),firstNomIndex=content.indexOf("*.*$\s*/gm,"> ").trim+" "}oldLogWikitext="".concat(topWikitext,"\n{{subst:rfd relisted|page=").concat(RelistInfo.today,"|").concat(this.model.discussion.sectionHeader,"}}");break;case"cfd":oldLogWikitext="====".concat(this.model.discussion.sectionHeader,"====\n{{subst:cfd relisted|").concat(this.model.discussion.sectionHeader,"}}")}return{newWikitext:newWikitext,oldLogWikitext:oldLogWikitext}}},{key:"getLogInfo",value:function(embeddedinLogpage){var _this3=this;switch(this.model.venue.type){case"ffd":case"mfd":return{newLogEditType:"appendtext"};case"tfd":case"rfd":case"cfd":return this.api.get({action:"query",titles:this.todaysLogpage,prop:"revisions",rvprop:"content|timestamp",rvslots:"main",curtimestamp:1,formatversion:"2"}).then(function(response){return _this3.getNewLogInfo(response.query.pages[0],response.curtimestamp)});case"afd":return this.api.get({action:"query",titles:[embeddedinLogpage.title,this.todaysLogpage],prop:"revisions",rvprop:"content|timestamp",rvslots:"main",curtimestamp:1,formatversion:"2"}).then(function(response){return _this3.getTranscludingLogsInfo(response.query.pages,response.curtimestamp)});default:return(0,_util.rejection)("abort","Unknown XfD venue")}}},{key:"getNewLogInfo",value:function(page,curtimestamp){if(page.missing)return(0,_util.rejection)("abort","Today's log page does not yet exist");var newLogTimestamps={start:curtimestamp,base:page.revisions[0].timestamp},logWikitext=page.revisions[0].slots.main.content,h4_match=/====\s*(.*?)\s*====/.exec(logWikitext),h4=h4_match&&h4_match[1];return{newLogTimestamps:newLogTimestamps,newLogSection:h4?2:1,newLogEditType:h4&&"NEW NOMINATIONS"!==h4.toUpperCase?"prependtext":"appendtext"}}},{key:"getTranscludingLogsInfo",value:function(pages,curtimestamp){if(1===pages.length)return(0,_util.rejection)("abort","Already transcluded to today's log page");var _ref2=_slicedToArray(pages[0].title===this.todaysLogpage?pages:pages.slice.reverse,2),newLogpage=_ref2[0],oldLogpage=_ref2[1],newLogContent=newLogpage.revisions[0].slots.main.content,oldLogContent=oldLogpage.revisions[0].slots.main.content,newLogTimestamps={start:curtimestamp,base:newLogpage.revisions[0].timestamp},oldLogTimestamps={start:curtimestamp,base:oldLogpage.revisions[0].timestamp},escapedTitle=_globals.mw.util.escapeRegExp(this.model.discussion.discussionPageName),hiddenOnOldLogpage=new RegExp("\x3c!-- ?\\{\\{"+escapedTitle+"\\}\\} ?--\x3e","i"),listedOnNewLogpage=new RegExp("\\{\\{"+escapedTitle+"\\}\\}","i");if(hiddenOnOldLogpage.test(oldLogContent)||listedOnNewLogpage.test(newLogContent))return(0,_util.rejection)("abort","Discussion has been relisted already");var listCommentPattern=new RegExp("\x3c!-- Add new entries to the TOP of the following list --\x3e","i"),newLogWikitext=newLogContent.replace(listCommentPattern,"\x3c!-- Add new entries to the TOP of the following list --\x3e\n\x3c!--Relisted--\x3e"),transclusionPattern=new RegExp("(\\{\\{"+escapedTitle+"\\}\\})","i"),oldlogTransclusion=transclusionPattern.test(oldLogContent),oldLogWikitext=oldLogContent.replace(transclusionPattern,"\x3c!-- $1 --\x3e");return{oldlogtitle:oldLogpage.title,oldlogTransclusion:oldlogTransclusion,oldLogWikitext:oldLogWikitext,oldLogTimestamps:oldLogTimestamps,newLogWikitext:newLogWikitext,newLogTimestamps:newLogTimestamps,newLogSection:1,newLogEditType:"text"}}},{key:"getEmbeddedInLogpages",value:function(embeddedin){var _this4=this;return embeddedin.filter(function(ei){return ei.title.includes(_this4.model.venue.path)})}},{key:"doTask",value:function{var _this5=this;return this.model.setTotalSteps(1),this.model.setDoing,this.api.get(this.query).then(function(response){if(_this5.model.aborted)return(0,_util.rejection)("aborted");var content=response.query.pages[0].revisions[0].slots.main.content;if(content.includes("xfd-closed"))return(0,_util.rejection)("abort","Discussion is already closed");var embeddedinLogpage,discussionPageTimestamps={start:response.curtimestamp,base:response.query.pages[0].revisions[0].timestamp},_this5$getRelistWikit=_this5.getRelistWikitext(content),newWikitext=_this5$getRelistWikit.newWikitext,oldLogWikitext=_this5$getRelistWikit.oldLogWikitext;if(response.query.embeddedin){var embeddedInLogpages=response.query.embeddedin.filter(function(ei){return ei.title.includes(_this5.model.venue.path)});if(0===embeddedInLogpages.length)return(0,_util.rejection)("abort","Old log page not found");1<embeddedInLogpages.length&&embeddedInLogpages.slice(1).forEach(function(logpage){return _this5.model.addWarning("Note: transcluded on additional log page: "+(0,_util.makeLink)(logpage.title,logpage.title.replace(_this5.model.venue.path,"")))}),embeddedinLogpage=embeddedInLogpages[0]}return _globals.$.when(_this5.getLogInfo(embeddedinLogpage)).then(function(logInfo){if(_this5.model.aborted)return(0,_util.rejection)("abort");_this5.model.discussion.setRelistInfo(_objectSpread({today:RelistInfo.today,discussionPageTimestamps:discussionPageTimestamps,newWikitext:newWikitext,oldLogWikitext:oldLogWikitext},logInfo)),_this5.model.trackStep})}).catch(function(code,error){return _this5.model.setAborted,"abort"===code?_this5.model.addError("Aborted".concat("string"==typeof error?": "+error:".")):(_this5.model.addError("Aborted: ".concat(code||"unknown"," error")),_this5.logError(code,error)),(0,_util.rejection)})}},{key:"todaysLogpage",get:function{return this.model.venue.path+RelistInfo.today}},{key:"query",get:function{var queryBase={action:"query",titles:this.model.discussion.discussionPageName,prop:"revisions",indexpageids:1,rvprop:"content|timestamp",rvslots:"main",curtimestamp:1,formatversion:"2"};return"afd"===this.model.venue.type?_objectSpread({},queryBase,{list:"embeddedin",eititle:this.model.discussion.discussionPageName,einamespace:this.model.venue.ns_logpages,eifilterredir:"nonredirects",eilimit:500}):_objectSpread({},queryBase,{rvsection:this.model.discussion.sectionNumber})}}])&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Object.defineProperty(Constructor,"prototype",{writable:!1}),RelistInfo};_defineProperty(exports.default=RelistInfo,"today",(0,_util.ymdDateString)(new Date))},{"../../../globals":1,"../../config":221,"../../util":225,"../TaskItemController":160,"core-js/modules/es.array.concat":104,"core-js/modules/es.array.filter":106,"core-js/modules/es.array.for-each":110,"core-js/modules/es.array.includes":111,"core-js/modules/es.array.index-of":112,"core-js/modules/es.array.join":114,"core-js/modules/es.array.last-index-of":115,"core-js/modules/es.array.map":116,"core-js/modules/es.array.reverse":118,"core-js/modules/es.array.slice":119,"core-js/modules/es.object.define-property":125,"core-js/modules/es.regexp.constructor":131,"core-js/modules/es.regexp.exec":132,"core-js/modules/es.regexp.to-string":133,"core-js/modules/es.string.includes":134,"core-js/modules/es.string.match":135,"core-js/modules/es.string.replace":136,"core-js/modules/es.string.trim":139,"core-js/modules/web.dom-collections.for-each":140}],172:[function(require,module,exports){"use strict";function _typeof(obj){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}require("core-js/modules/es.array.concat"),require("core-js/modules/es.array.filter"),require("core-js/modules/es.array.find"),require("core-js/modules/es.array.includes"),require("core-js/modules/es.array.join"),require("core-js/modules/es.array.map"),require("core-js/modules/es.string.includes"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var obj,_globals=require("../../../globals"),_TaskItemController2=(obj=require("../TaskItemController"))&&obj.__esModule?obj:{default:obj},_util=require("../../util");function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function _createSuper(Derived){var hasNativeReflectConstruct=function{if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function{})),!0}catch(e){return!1}};return function{var result,Super=_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return function(self,call){{if(call&&("object"===_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined")}return function(self){if(void 0!==self)return self;throw new ReferenceError("this hasn't been initialised - super hasn't been called")}(self)}(this,result)}}function _getPrototypeOf(o){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function _setPrototypeOf(o,p){return(_setPrototypeOf=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o})(o,p)}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function Redirection(config){_classCallCheck(this,Redirection),this.from=config.from,this.to=config.to,this.deleteFirst=config.deleteFirst,this.isSoft=config.isSoft,this.rcats=config.options&&config.options.rcats}var Redirect=function{!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),Object.defineProperty(subClass,"prototype",{writable:!1}),superClass&&_setPrototypeOf(subClass,superClass)}(Redirect,_TaskItemController2["default"]);var Constructor,protoProps,staticProps,_super=_createSuper(Redirect);function Redirect(model,widgets){var _this;_classCallCheck(this,Redirect);var plural=1<(_this=_super.call(this,model,widgets)).model.pageNames.length,label=_this.redirections.find(function(redirection){return redirection.deleteFirst})?"Deleting ".concat(plural?"pages":"page"," and replacing with ").concat(plural?"redirects":"redirect"):"Replacing ".concat(plural?"pages":"page"," with ").concat(plural?"redirects":"redirect");return _this.model.setName(label),_this}return Constructor=Redirect,(protoProps=[{key:"transform",value:function(redirection){if(this.aborted&&!redirection.deleteFirst)return(0,_util.rejection)("aborted");var text,rcatshell=redirection.rcats&&redirection.rcats.length?"\n\n"):"";if((0,_util.isModule)(redirection.from)){if(!(0,_util.isModule)(redirection.to))return(0,_util.rejection)("targetIsNotModule",{target:redirection.to});text='return require( "'.concat(redirection.to,'" )')}else text=redirection.isSoft?"").concat(rcatshell):"#REDIRECT ".concat(redirection.to,"").concat(rcatshell);return{text:text,summary:this.model.getEditSummary}}},{key:"redirect",value:function(redirection){var _this2=this;return this.api.editWithRetry(redirection.from,null,function{return _this2.transform(redirection)},function{return _this2.model.trackStep},function(code,error,title){return _this2.handlePageError(code,error,title)}).catch(function(errortype,code,error){"read"===errortype&&(_this2.model.addError("".concat(code||"unknown"," error: Could not read contents of ").concat((0,_util.makeLink)(redirection.from))),_this2.model.trackStep("failed"),_this2.logError(code,error))})}},{key:"deleteAndRedirect",value:function(redirection){var _this3=this;return this.api.deleteWithRetry(redirection.from,{reason:this.model.getEditSummary({short:!0})}).then(function{return _this3.redirect(redirection)},function(_errortype,code,error){_this3.model.addError("".concat(code||"unknown"," error: Could not delete ").concat((0,_util.makeLink)(redirection.from))),_this3.model.trackStep("failed"),_this3.logError(code,error)})}},{key:"doTask",value:function{var _this4=this;return this.model.setTotalSteps(this.redirections.length),this.model.setDoing,_globals.$.when.apply(null,this.redirections.map(function(redirection){return redirection.deleteFirst?_this4.deleteAndRedirect(redirection):_this4.redirect(redirection)}))}},{key:"redirections",get:function{var _this5=this,targets=(0,_util.uniqueArray)(this.model.getPageResults.map(function(pageResult){return(0,_util.normalisePageName)(pageResult.targetPageName)}));return this.model.getPageResults.filter(function(pageResult){var resolvedPageName=_this5.model.discussion.redirects.resolveOne(pageResult.pageName);return!targets.includes(resolvedPageName)}).map(function(pageResult){return new Redirection({from:_this5.model.discussion.redirects.resolveOne(pageResult.pageName),to:(0,_util.normalisePageName)(pageResult.targetPageName),deleteFirst:pageResult.isDeleteFirst,isSoft:pageResult.isSoft,options:_this5.model.options.getOptionValues(pageResult.resultName)})})}}])&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Object.defineProperty(Constructor,"prototype",{writable:!1}),Redirect};exports.default=Redirect},{"../../../globals":1,"../../util":225,"../TaskItemController":160,"core-js/modules/es.array.concat":104,"core-js/modules/es.array.filter":106,"core-js/modules/es.array.find":108,"core-js/modules/es.array.includes":111,"core-js/modules/es.array.join":114,"core-js/modules/es.array.map":116,"core-js/modules/es.string.includes":134}],173:[function(require,module,exports){"use strict";function _typeof(obj){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}require("core-js/modules/es.array.filter"),require("core-js/modules/es.array.includes"),require("core-js/modules/es.array.map"),require("core-js/modules/es.object.set-prototype-of"),require("core-js/modules/es.string.includes"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _globals=require("../../../globals"),_TaskItemController2=_interopRequireDefault(require("../TaskItemController")),_util=require("../../util"),_unlink=_interopRequireDefault(require("../../unlink"));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function _createSuper(Derived){var hasNativeReflectConstruct=function{if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function{})),!0}catch(e){return!1}};return function{var result,Super=_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return function(self,call){{if(call&&("object"===_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined")}return function(self){if(void 0!==self)return self;throw new ReferenceError("this hasn't been initialised - super hasn't been called")}(self)}(this,result)}}function _getPrototypeOf(o){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function _setPrototypeOf(o,p){return(_setPrototypeOf=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o})(o,p)}var RemoveCircularLinks=function{!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),Object.defineProperty(subClass,"prototype",{writable:!1}),superClass&&_setPrototypeOf(subClass,superClass)}(RemoveCircularLinks,_TaskItemController2["default"]);var Constructor,protoProps,staticProps,_super=_createSuper(RemoveCircularLinks);function RemoveCircularLinks(model,widgets){var _this;return function(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,RemoveCircularLinks),(_this=_super.call(this,model,widgets)).model.setName("Unlinking circular links on redirect target"),_this}return Constructor=RemoveCircularLinks,(protoProps=[{key:"transform",value:function(page){if(this.model.aborted)return(0,_util.rejection)("aborted");var newWikitext;try{newWikitext=this.model.venue.removeNomTemplate(page.content)}catch(e){return(0,_util.rejection)("couldNotUpdate",e)}return(newWikitext=(0,_util.cleanupVoidTemplates)((0,_unlink.default)(newWikitext,this.model.getResolvedPageNames)))===page.content?(0,_util.rejection)("skippedNoneFound"):{text:newWikitext,summary:this.model.getEditSummary({prefix:"Unlinking circular redirects:"})}}},{key:"doTask",value:function{var _this2=this;return this.model.setTotalSteps(this.targets.length),this.model.setDoing,this.api.editWithRetry(this.targets,null,function(page){return _this2.transform(page)},function{return _this2.model.trackStep},function(code,error,title){return _this2.handlePageError(code,error,title)}).catch(function(errortype,code,error){if("read"===errortype)return _this2.model.addError(code,error,"Could not read contents of redirect ".concat((_this2.targets.length,"targets"))),(0,_util.rejection)})}},{key:"targets",get:function{return(0,_util.uniqueArray)(this.model.getPageResults.map(function(pageResult){return _globals.mw.Title.newFromText(pageResult.targetPageName).getPrefixedText}))}},{key:"pageNamesToUnlink",get:function{var _this3=this,targets=this.targets;return this.model.getPageResults.filter(function(pageResult){var resolvedPageName=_this3.model.discussion.redirects.resolveOne(pageResult.pageName);return!targets.includes(resolvedPageName)}).map(function(pageResult){return pageResult.pageName})}}])&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Object.defineProperty(Constructor,"prototype",{writable:!1}),RemoveCircularLinks};exports.default=RemoveCircularLinks},{"../../../globals":1,"../../unlink":224,"../../util":225,"../TaskItemController":160,"core-js/modules/es.array.filter":106,"core-js/modules/es.array.includes":111,"core-js/modules/es.array.map":116,"core-js/modules/es.object.set-prototype-of":127,"core-js/modules/es.string.includes":134}],174:[function(require,module,exports){"use strict";function _typeof(obj){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}require("core-js/modules/es.array.find"),require("core-js/modules/es.array.map"),require("core-js/modules/es.object.set-prototype-of"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var obj,_globals=require("../../../globals"),_TaskItemController2=(obj=require("../TaskItemController"))&&obj.__esModule?obj:{default:obj},_util=require("../../util");function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function _createSuper(Derived){var hasNativeReflectConstruct=function{if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function{})),!0}catch(e){return!1}};return function{var result,Super=_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return function(self,call){{if(call&&("object"===_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined")}return function(self){if(void 0!==self)return self;throw new ReferenceError("this hasn't been initialised - super hasn't been called")}(self)}(this,result)}}function _getPrototypeOf(o){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function _setPrototypeOf(o,p){return(_setPrototypeOf=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o})(o,p)}var RemoveNomTemplates=function{!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),Object.defineProperty(subClass,"prototype",{writable:!1}),superClass&&_setPrototypeOf(subClass,superClass)}(RemoveNomTemplates,_TaskItemController2["default"]);var Constructor,protoProps,staticProps,_super=_createSuper(RemoveNomTemplates);function RemoveNomTemplates(model,widgets){var _this;return function(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,RemoveNomTemplates),(_this=_super.call(this,model,widgets)).model.setName("Updating ".concat(1<model.pageNames.length?"pages":"page")),_this}return Constructor=RemoveNomTemplates,staticProps=[{key:"transform",value:function(context,page,prependContent){if(prependContent=prependContent||"",context.aborted)return(0,_util.rejection)("aborted");var text,unresolvedPageName=context.model.discussion.redirects.unresolveOne((0,_util.docToModule)(page.title));if(!context.model.discussion.pages.find(function(page){return page.getPrefixedText===unresolvedPageName}))return(0,_util.rejection)("unexpectedTitle");if(page.missing||!_globals.mw.Title.newFromText((0,_util.docToModule)(page.title)).exists)return(0,_util.rejection)("doesNotExist");if(!prependContent&&!context.model.venue.hasNomTemplate(page.content))return(0,_util.rejection)("nominationTemplateNotFound");try{text=prependContent+context.model.venue.removeNomTemplate(page.content)}catch(e){return(0,_util.rejection)("couldNotUpdate",e)}return{text:text,summary:context.model.getEditSummary}}}],(protoProps=[{key:"doTask",value:function{var _this2=this;return this.model.setTotalSteps(this.model.pageNames.length),this.model.setDoing,this.api.editWithRetry(this.model.getResolvedPageNames.map(_util.moduleToDoc),null,function(page){return RemoveNomTemplates.transform(_this2,page)},function{return _this2.model.trackStep},function(code,error,title){return _this2.handlePageError(code,error,title)}).catch(function(errortype,code,error){return _this2.handleOverallError(errortype,code,error)})}}])&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Object.defineProperty(Constructor,"prototype",{writable:!1}),RemoveNomTemplates};exports.default=RemoveNomTemplates},{"../../../globals":1,"../../util":225,"../TaskItemController":160,"core-js/modules/es.array.find":108,"core-js/modules/es.array.map":116,"core-js/modules/es.object.set-prototype-of":127}],175:[function(require,module,exports){"use strict";function _typeof(obj){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}require("core-js/modules/es.array.filter"),require("core-js/modules/es.array.includes"),require("core-js/modules/es.object.set-prototype-of"),require("core-js/modules/es.string.includes"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var obj,_globals=require("../../../globals"),_TaskItemController2=(obj=require("../TaskItemController"))&&obj.__esModule?obj:{default:obj},_util=require("../../util");function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function _createSuper(Derived){var hasNativeReflectConstruct=function{if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function{})),!0}catch(e){return!1}};return function{var result,Super=_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return function(self,call){{if(call&&("object"===_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined")}return function(self){if(void 0!==self)return self;throw new ReferenceError("this hasn't been initialised - super hasn't been called")}(self)}(this,result)}}function _getPrototypeOf(o){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function _setPrototypeOf(o,p){return(_setPrototypeOf=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o})(o,p)}var TagTalkWithSpeedy=function{!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),Object.defineProperty(subClass,"prototype",{writable:!1}),superClass&&_setPrototypeOf(subClass,superClass)}(TagTalkWithSpeedy,_TaskItemController2["default"]);var Constructor,protoProps,staticProps,_super=_createSuper(TagTalkWithSpeedy);function TagTalkWithSpeedy(model,widgets){var _this;return function(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,TagTalkWithSpeedy),(_this=_super.call(this,model,widgets)).model.setName("Tagging talk ".concat(1<model.pageNames.length?"pages":"page")),_this}return Constructor=TagTalkWithSpeedy,(protoProps=[{key:"verifyPage",value:function(pageName){var title=_globals.mw.Title.newFromText(pageName),isUserTalkBasePage=3===title.getNamespaceId&&!pageName.includes("/");return title.exists?!isUserTalkBasePage||(this.model.addWarning("".concat((0,_util.makeLink)(pageName)," skipped: base user talk page (not eligible for G8 speedy deletion)")),this.model.trackStep("skipped"),!1):(this.model.addWarning("".concat((0,_util.makeLink)(pageName)," skipped: does not exist (may have already been deleted by others)")),this.model.trackStep("skipped"),!1)}},{key:"transform",value:function{return this.aborted?(0,_util.rejection)("aborted"):{prependtext:"\n",summary:this.model.getEditSummary({short:!0,prefix:"G8 Speedy deletion nomination, per"}),nocreate:1}}},{key:"doTask",value:function{var _this2=this,talkPages=this.model.getResolvedTalkpagesNames;if(0===talkPages.length)return this.model.addWarning("None found"),(0,_util.rejection);this.model.setTotalSteps(talkPages.length);var talkPagesToTag=talkPages.filter(function(talkPage){return _this2.verifyPage(talkPage)});return 0===talkPagesToTag.length?_globals.$.Deferred.resolve("Skipped"):(this.model.setDoing,this.api.editWithRetry(talkPagesToTag,null,function(page){return _this2.transform(page)},function{return _this2.model.trackStep},function(code,error,title){return _this2.handlePageError(code,error,title)}).catch(function(errortype,code,error){return _this2.handleOverallError(errortype,code,error)}))}}])&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Object.defineProperty(Constructor,"prototype",{writable:!1}),TagTalkWithSpeedy};exports.default=TagTalkWithSpeedy},{"../../../globals":1,"../../util":225,"../TaskItemController":160,"core-js/modules/es.array.filter":106,"core-js/modules/es.array.includes":111,"core-js/modules/es.object.set-prototype-of":127,"core-js/modules/es.string.includes":134}],176:[function(require,module,exports){"use strict";function _typeof(obj){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}require("core-js/modules/es.array.concat"),require("core-js/modules/es.array.filter"),require("core-js/modules/es.array.flat-map"),require("core-js/modules/es.array.includes"),require("core-js/modules/es.array.map"),require("core-js/modules/es.array.reduce"),require("core-js/modules/es.array.slice"),require("core-js/modules/es.array.unscopables.flat-map"),require("core-js/modules/es.object.set-prototype-of"),require("core-js/modules/es.regexp.exec"),require("core-js/modules/es.string.match"),require("core-js/modules/es.string.replace"),require("core-js/modules/es.string.split"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _globals=require("../../../globals"),_TaskItemController2=_interopRequireDefault(require("../TaskItemController")),_util=require("../../util"),_unlink=_interopRequireDefault(require("../../unlink"));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _toConsumableArray(arr){return function(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr)}(arr)||function(iter){if("undefined"!=typeof Symbol&&null!=iter[Symbol.iterator]||null!=iter["@@iterator"])return Array.from(iter)}(arr)||function(o,minLen){if(!o)return;if("string"==typeof o)return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}(arr)||function{throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator] method.")}}function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})),keys.push.apply(keys,symbols)}return keys}function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function _createSuper(Derived){var hasNativeReflectConstruct=function{if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function{})),!0}catch(e){return!1}};return function{var result,Super=_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return function(self,call){{if(call&&("object"===_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined")}return function(self){if(void 0!==self)return self;throw new ReferenceError("this hasn't been initialised - super hasn't been called")}(self)}(this,result)}}function _getPrototypeOf(o){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function _setPrototypeOf(o,p){return(_setPrototypeOf=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o})(o,p)}var UnlinkBacklinks=function{!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),Object.defineProperty(subClass,"prototype",{writable:!1}),superClass&&_setPrototypeOf(subClass,superClass)}(UnlinkBacklinks,_TaskItemController2["default"]);var Constructor,protoProps,staticProps,_super=_createSuper(UnlinkBacklinks);function UnlinkBacklinks(model,widgets){var _this;return function(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,UnlinkBacklinks),(_this=_super.call(this,model,widgets)).model.setName("Unlinking backlinks"),_this.finishedReadingApi=_globals.$.Deferred,_this.queuedPrompts=[],_this.redirectPageNames=[],_this}return Constructor=UnlinkBacklinks,staticProps=[{key:"flattenResults",value:function(list){return list.flatMap(function(page){return page.redirect?(page.redirlinks||[]).map(function(subpage){return subpage.title}):page.title})}},{key:"findRedirectResults",value:function(list){return list.filter(function(page){return page.redirect}).map(function(page){return page.title})}},{key:"ignoreResultTitle",value:function(title){return["Template:WPUnited States Article alerts","Template:Article alerts columns","Template:Did you know nominations"].includes(title.split("/")[0])}}],(protoProps=[{key:"getQuery",value:function(pageName){var query={list:"backlinks",blfilterredir:"nonredirects",bllimit:"max",blnamespace:this.model.venue.ns_unlink,blredirect:1,bltitle:pageName};return(0,_util.isFile)(pageName)?function(target){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?ownKeys(Object(source),!0).forEach(function(key){_defineProperty(target,key,source[key])}):Object.getOwnPropertyDescriptors?Object.defineProperties(target,Object.getOwnPropertyDescriptors(source)):ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))})}return target}({},query,{list:"backlinks|imageusage",iufilterredir:"nonredirects",iulimit:"max",iunamespace:this.model.venue.ns_unlink,iuredirect:1,iutitle:pageName}):query}},{key:"getUnlinkPages",value:function(backlinks,imageusage){var blPageNames=(0,_util.uniqueArray)(UnlinkBacklinks.flattenResults(backlinks)).filter(function(title){return!UnlinkBacklinks.ignoreResultTitle(title)}),iuPageNames=(0,_util.uniqueArray)(UnlinkBacklinks.flattenResults(imageusage)).filter(function(title){return!UnlinkBacklinks.ignoreResultTitle(title)});return{unlinkPageNames:(0,_util.uniqueArray)([].concat(_toConsumableArray(blPageNames),_toConsumableArray(iuPageNames))),redirectPageNames:UnlinkBacklinks.findRedirectResults([].concat(_toConsumableArray(backlinks),_toConsumableArray(imageusage))),hasImageUsage:0<iuPageNames.length}}},{key:"processSelection",value:function(selection){var _this2=this;if(this.model.aborted)return(0,_util.rejection)("aborted");if(selection&&"accept"===selection.action){if(selection.items&&0!==selection.items.length){this.model.setTotalSteps(selection.items.length);var editPromises=selection.items.reduce(function(batches,title){return 50===batches[batches.length-1].length?batches[batches.length]=[title]:batches[batches.length-1].push(title),batches},).map(function(batch){return _this2.api.editWithRetry(batch,{prop:"categories|revisions",clcategories:"Category:All disambiguation pages"},function(page){return _this2.transform(page)},function{return _this2.model.trackStep},function(code,error,title){return _this2.handlePageError(code,error,title)}).catch(function(errortype,code,error){return _this2.handleOverallError(errortype,code,error)})});return _globals.$.when.apply(null,editPromises)}this.model.addWarning("No pages selected")}else this.model.addWarning("Cancelled by user")}},{key:"transform",value:function(page){var _this3=this;if(this.model.aborted)return(0,_util.rejection)("aborted");var newWikitext=(0,_unlink.default)(page.content,[].concat(_toConsumableArray(this.model.getResolvedPageNames),_toConsumableArray(this.redirectPageNames)),page.ns,!!page.categories);return newWikitext===page.content?(0,_util.rejection)("skippedNoLinks"):this.processListItems(page.title,newWikitext).then(function(updatedWikitext,isMajorEdit){var prefix="Removing link(s)"+(isMajorEdit?" / list item(s)":"")+((0,_util.isFile)(page.title)?" / file usage(s)":""),req={text:(0,_util.cleanupVoidTemplates)(updatedWikitext),summary:_this3.model.getEditSummary({prefix:prefix}),nocreate:1};return isMajorEdit||(req.minor=1),req})}},{key:"processListItems",value:function(pageTitle,wikitext,isMajorEdit){var _this4=this;if(this.model.aborted)return(0,_util.rejection)("aborted");var linesToReview=/^(.*)$/m.exec(wikitext);if(!linesToReview)return _globals.$.Deferred.resolve(wikitext,!!isMajorEdit).promise;var allHeadings=wikitext.split("")[0].match(/^=+.+?=+$/gm),heading=allHeadings?allHeadings[allHeadings.length-1].replace(/(^=* *| *=*$)/g,"").replace(/\{\{.*?\}\}/g,"").replace(/\[\[([^|\]]*?)\|([^\]]*?)\]\]/,"$2").replace(/\[\[([^|\]]*?)\]\]/,"$1"):null,message=" A backlink has been removed from the following list item: \n List: ".concat(heading?pageTitle+"\n ").concat(linesToReview[1]," \n Please check if the item matches the list's selection criteria before deciding to keep or remove the item from the list. ");return this.queueMultiButtonConfirm({title:"Review unlinked list item",message:message,actions:[{label:"Keep item",action:"keep",icon:"articleCheck",flags:"progressive"},{label:"Keep and request citation",action:"keep-cite",icon:"flag"},{label:"Remove item",action:"remove",icon:"trash",flags:"destructive"}],size:"large",scrolled:!0}).then(function(action){return"keep"===action?wikitext=wikitext.replace(/^/m,""):"keep-cite"===action?wikitext=wikitext.replace(/^(.*)(\n?)/m,"$1$2"):(wikitext=wikitext.replace(/^.*\n?/m,""),isMajorEdit=!0),_this4.processListItems(pageTitle,wikitext,isMajorEdit)})}},{key:"queueMultiButtonConfirm",value:function(params){var _this5=this,previousPrompt=this.queuedPrompts.length&&this.queuedPrompts[this.queuedPrompts.length-1],prompt=_globals.$.when(previousPrompt).then(function{return _this5.aborted?(0,_util.rejection)("aborted"):(0,_util.multiButtonConfirm)(params)});return this.queuedPrompts.push(prompt),prompt}},{key:"doTask",value:function{var _this6=this;return _globals.$.when.apply(null,this.model.getResolvedPageNames.map(function(pageName){return _this6.api.queryWithContinue(_this6.getQuery(pageName))})).then(function{return Array.prototype.slice.call(arguments).reduce(_util.recursiveMerge)}).then(function(result){if(_this6.model.setDoing,_this6.model.aborted)return(0,_util.rejection)("aborted");if(result.imageusage||(result.imageusage=[]),result.backlinks.length+result.imageusage.length===0)return _this6.model.addWarning("none found"),_this6.model.setTotalSteps(1),_this6.model.trackStep("skipped"),"Skipped";var _this6$getUnlinkPages=_this6.getUnlinkPages(result.backlinks,result.imageusage),unlinkPageNames=_this6$getUnlinkPages.unlinkPageNames,redirectPageNames=_this6$getUnlinkPages.redirectPageNames,hasImageUsage=_this6$getUnlinkPages.hasImageUsage;_this6.redirectPageNames=redirectPageNames;var title='"Unlink backlinks'.concat(hasImageUsage?" (and file usage)":"",":"),messages=[" All selected pages below may be edited (unless backlinks are only present due to transclusion of a template). "," Use with caution, after reviewing the ".concat(1===unlinkPageNames.length?"page":unlinkPageNames.length+" pages"," listed below. ")," Note that the use of high speed, high volume editing software (such as this tool and Twinkle's unlink tool) is subject to the Bot policy's Assisted editing guidelines"," "];return(0,_util.multiCheckboxMessageDialog)({title:title,message:_globals.$.apply(void 0,messages),items:unlinkPageNames.map(function(pageName){return{data:pageName,label:pageName,selected:!0}}),size:"medium",scrolled:!0}).then(function(selection){return _this6.processSelection(selection)})})}}])&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Object.defineProperty(Constructor,"prototype",{writable:!1}),UnlinkBacklinks};exports.default=UnlinkBacklinks},{"../../../globals":1,"../../unlink":224,"../../util":225,"../TaskItemController":160,"core-js/modules/es.array.concat":104,"core-js/modules/es.array.filter":106,"core-js/modules/es.array.flat-map":109,"core-js/modules/es.array.includes":111,"core-js/modules/es.array.map":116,"core-js/modules/es.array.reduce":117,"core-js/modules/es.array.slice":119,"core-js/modules/es.array.unscopables.flat-map":121,"core-js/modules/es.object.set-prototype-of":127,"core-js/modules/es.regexp.exec":132,"core-js/modules/es.string.match":135,"core-js/modules/es.string.replace":136,"core-js/modules/es.string.split":138}],177:[function(require,module,exports){"use strict";function _typeof(obj){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}require("core-js/modules/es.object.set-prototype-of"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _TaskItemController2=_interopRequireDefault(require("../TaskItemController")),_util=require("../../util"),_config=_interopRequireDefault(require("../../config"));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function _createSuper(Derived){var hasNativeReflectConstruct=function{if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function{})),!0}catch(e){return!1}};return function{var result,Super=_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return function(self,call){{if(call&&("object"===_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined")}return function(self){if(void 0!==self)return self;throw new ReferenceError("this hasn't been initialised - super hasn't been called")}(self)}(this,result)}}function _getPrototypeOf(o){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function _setPrototypeOf(o,p){return(_setPrototypeOf=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o})(o,p)}var UpdateDiscussion=function{!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),Object.defineProperty(subClass,"prototype",{writable:!1}),superClass&&_setPrototypeOf(subClass,superClass)}(UpdateDiscussion,_TaskItemController2["default"]);var Constructor,protoProps,staticProps,_super=_createSuper(UpdateDiscussion);function UpdateDiscussion(model,widgets){var _this;return function(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,UpdateDiscussion),(_this=_super.call(this,model,widgets)).model.setName("Updating discussion"),_this}return Constructor=UpdateDiscussion,(protoProps=[{key:"getParams",value:function{var _this$model$discussio=this.model.discussion.relistInfo,discussionPageTimestamps=_this$model$discussio.discussionPageTimestamps,newWikitext=_this$model$discussio.newWikitext,params={action:"edit",title:this.model.discussion.discussionPageName,text:newWikitext,summary:"Relisting discussion ".concat(_config.default.script.advert),assert:"user",basetimestamp:discussionPageTimestamps.base,starttimestamp:discussionPageTimestamps.start};return"mfd"===this.model.venue.type&&(params.section=this.model.discussion.sectionNumber),params}},{key:"doTask",value:function{var _this2=this;return this.aborted?(0,_util.rejection)("aborted"):(this.model.setTotalSteps(1),this.model.setDoing,this.api.postWithToken("csrf",this.getParams).then(function{return _this2.model.trackStep},function(code,error){return _this2.handlePageError(code,error,_this2.model.discussion.discussionPageName),(0,_util.rejection)}))}}])&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Object.defineProperty(Constructor,"prototype",{writable:!1}),UpdateDiscussion};exports.default=UpdateDiscussion},{"../../config":221,"../../util":225,"../TaskItemController":160,"core-js/modules/es.object.set-prototype-of":127}],178:[function(require,module,exports){"use strict";function _typeof(obj){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}require("core-js/modules/es.array.concat"),require("core-js/modules/es.object.set-prototype-of"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _TaskItemController2=_interopRequireDefault(require("../TaskItemController")),_util=require("../../util"),_config=_interopRequireDefault(require("../../config"));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function _createSuper(Derived){var hasNativeReflectConstruct=function{if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function{})),!0}catch(e){return!1}};return function{var result,Super=_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return function(self,call){{if(call&&("object"===_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined")}return function(self){if(void 0!==self)return self;throw new ReferenceError("this hasn't been initialised - super hasn't been called")}(self)}(this,result)}}function _getPrototypeOf(o){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function _setPrototypeOf(o,p){return(_setPrototypeOf=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o})(o,p)}var UpdateNewLogPage=function{!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),Object.defineProperty(subClass,"prototype",{writable:!1}),superClass&&_setPrototypeOf(subClass,superClass)}(UpdateNewLogPage,_TaskItemController2["default"]);var Constructor,protoProps,staticProps,_super=_createSuper(UpdateNewLogPage);function UpdateNewLogPage(model,widgets){var _this;return function(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,UpdateNewLogPage),(_this=_super.call(this,model,widgets)).model.setName("Adding to today's log page"),_this}return Constructor=UpdateNewLogPage,(protoProps=[{key:"getParams",value:function{var relistInfo=this.model.discussion.relistInfo,params={action:"edit",title:this.model.venue.path+relistInfo.today,summary:"Relisting ".concat("afd"===this.model.venue.type?"".concat(this.model.discussion.discussionPageName,""):'"'.concat(this.model.discussion.sectionHeader,'"')," ").concat(_config.default.script.advert)};return params[relistInfo.newLogEditType]="afd"===this.model.venue.type?relistInfo.newLogWikitext:("appendtext"===relistInfo.newLogEditType?"\n":"")+relistInfo.newWikitext,relistInfo.newLogTimestamps&&(params.basetimestamp=relistInfo.newLogTimestamps.base,params.starttimestamp=relistInfo.newLogTimestamps.start),/(tfd|rfd|cfd)/.test(this.model.venue.type)&&(params.section=relistInfo.newLogSection),params}},{key:"doTask",value:function{var _this2=this;if(this.aborted)return(0,_util.rejection)("aborted");this.model.setTotalSteps(1),this.model.setDoing;var params=this.getParams;return this.api.postWithToken("csrf",params).then(function{return _this2.model.trackStep},function(code,error){return _this2.handlePageError(code,error,params.title),(0,_util.rejection)})}}])&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Object.defineProperty(Constructor,"prototype",{writable:!1}),UpdateNewLogPage};exports.default=UpdateNewLogPage},{"../../config":221,"../../util":225,"../TaskItemController":160,"core-js/modules/es.array.concat":104,"core-js/modules/es.object.set-prototype-of":127}],179:[function(require,module,exports){"use strict";function _typeof(obj){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}require("core-js/modules/es.array.concat"),require("core-js/modules/es.array.find"),require("core-js/modules/es.array.map"),require("core-js/modules/es.object.set-prototype-of"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _TaskItemController2=_interopRequireDefault(require("../TaskItemController")),_util=require("../../util"),_config=_interopRequireDefault(require("../../config"));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function _createSuper(Derived){var hasNativeReflectConstruct=function{if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function{})),!0}catch(e){return!1}};return function{var result,Super=_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return function(self,call){{if(call&&("object"===_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined")}return function(self){if(void 0!==self)return self;throw new ReferenceError("this hasn't been initialised - super hasn't been called")}(self)}(this,result)}}function _getPrototypeOf(o){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function _setPrototypeOf(o,p){return(_setPrototypeOf=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o})(o,p)}var UpdateNewLogPage=function{!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),Object.defineProperty(subClass,"prototype",{writable:!1}),superClass&&_setPrototypeOf(subClass,superClass)}(UpdateNewLogPage,_TaskItemController2["default"]);var Constructor,protoProps,staticProps,_super=_createSuper(UpdateNewLogPage);function UpdateNewLogPage(model,widgets){var _this;return function(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,UpdateNewLogPage),(_this=_super.call(this,model,widgets)).model.setName("Updating link in nomination ".concat(1<model.discussion.pages.length?"templates":"template")),_this}return Constructor=UpdateNewLogPage,(protoProps=[{key:"transform",value:function(page){if(this.aborted)return(0,_util.rejection)("Aborted");var updatedWikitext;if(!this.model.getResolvedPageNames.find(function(pagename){return pagename===(0,_util.docToModule)(page.title)}))return(0,_util.rejection)("unexpectedTitle");if(page.missing)return(0,_util.rejection)("doesNotExist");try{updatedWikitext=this.model.venue.updateNomTemplateAfterRelist(page.content,this.model.discussion.relistInfo.today,this.model.discussion.sectionHeader)}catch(e){return(0,_util.rejection)("couldNotUpdate",e)}return updatedWikitext===page.content?(0,_util.rejection)("nominationTemplateNotFound"):{text:updatedWikitext,summary:"Updating ".concat(this.model.venue.type.toUpperCase," template: discussion was relisted ").concat(_config.default.script.advert)}}},{key:"doTask",value:function{var _this2=this;if(this.aborted)return(0,_util.rejection)("Aborted");var pageNames=this.model.getResolvedPageNames.map(_util.moduleToDoc);return this.model.setTotalSteps(pageNames.length),this.model.setDoing,this.api.editWithRetry(pageNames,null,function(page){return _this2.transform(page)},function{return _this2.model.trackStep},function(code,error,title){return _this2.handlePageError(code,error,title)}).catch(function(errortype,code,error){return _this2.handleOverallError(errortype,code,error)})}}])&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Object.defineProperty(Constructor,"prototype",{writable:!1}),UpdateNewLogPage};exports.default=UpdateNewLogPage},{"../../config":221,"../../util":225,"../TaskItemController":160,"core-js/modules/es.array.concat":104,"core-js/modules/es.array.find":108,"core-js/modules/es.array.map":116,"core-js/modules/es.object.set-prototype-of":127}],180:[function(require,module,exports){"use strict";function _typeof(obj){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}require("core-js/modules/es.array.concat"),require("core-js/modules/es.object.set-prototype-of"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _TaskItemController2=_interopRequireDefault(require("../TaskItemController")),_util=require("../../util"),_config=_interopRequireDefault(require("../../config"));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function _createSuper(Derived){var hasNativeReflectConstruct=function{if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function{})),!0}catch(e){return!1}};return function{var result,Super=_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return function(self,call){{if(call&&("object"===_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined")}return function(self){if(void 0!==self)return self;throw new ReferenceError("this hasn't been initialised - super hasn't been called")}(self)}(this,result)}}function _getPrototypeOf(o){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function _setPrototypeOf(o,p){return(_setPrototypeOf=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o})(o,p)}var UpdateOldLogPage=function{!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),Object.defineProperty(subClass,"prototype",{writable:!1}),superClass&&_setPrototypeOf(subClass,superClass)}(UpdateOldLogPage,_TaskItemController2["default"]);var Constructor,protoProps,staticProps,_super=_createSuper(UpdateOldLogPage);function UpdateOldLogPage(model,widgets){var _this;return function(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,UpdateOldLogPage),(_this=_super.call(this,model,widgets)).model.setName("Removing from old log page"),_this}return Constructor=UpdateOldLogPage,(protoProps=[{key:"getParams",value:function{var relistInfo=this.model.discussion.relistInfo,params={action:"edit",title:"afd"===this.model.venue.type?relistInfo.oldlogtitle:this.model.discussion.discussionPageName,text:relistInfo.oldLogWikitext,summary:"afd"===this.model.venue.type?"Relisting ".concat(this.model.discussion.discussionPageName," ").concat(_config.default.script.advert):"/* ".concat(this.model.discussion.sectionHeader," */ Relisted on ").concat(relistInfo.today," ").concat(_config.default.script.advert)};return relistInfo.oldLogTimestamps&&(params.basetimestamp=relistInfo.oldLogTimestamps.base,params.starttimestamp=relistInfo.oldLogTimestamps.start),"afd"!==this.model.venue.type&&(params.section=this.model.discussion.sectionNumber),params}},{key:"doTask",value:function{var _this2=this;if(this.aborted)return(0,_util.rejection)("aborted");if(this.model.setTotalSteps(1),"afd"===this.model.venue.type&&!this.model.discussion.relistInfo.oldlogTransclusion)return this.model.addError("Transclusion not found on old log page; could not be commented out"),this.model.trackStep("failed"),(0,_util.rejection);this.model.setDoing;var params=this.getParams;return this.api.postWithToken("csrf",params).then(function{return _this2.model.trackStep},function(code,error){return _this2.handlePageError(code,error,params.title),(0,_util.rejection)})}}])&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Object.defineProperty(Constructor,"prototype",{writable:!1}),UpdateOldLogPage};exports.default=UpdateOldLogPage},{"../../config":221,"../../util":225,"../TaskItemController":160,"core-js/modules/es.array.concat":104,"core-js/modules/es.object.set-prototype-of":127}],181:[function(require,module,exports){"use strict";require("core-js/modules/es.array.concat"),require("core-js/modules/es.array.find"),require("core-js/modules/es.object.define-property"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _globals=require("../../globals"),_api=_interopRequireDefault(require("../api")),_config=_interopRequireDefault(require("../config")),_util=require("../util");function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}var UnlinkSummaryPanelController=function{function UnlinkSummaryPanelController(model,widget){!function(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,UnlinkSummaryPanelController),this._requestId=0,this.model=model,this.summaryInput=widget.summaryInput,this.summaryInputField=widget.summaryInputField,this.summaryPreview=widget.summaryPreview,this.summaryPreviewField=widget.summaryPreviewField,this.model.connect(this,{update:"updateFromModel"}),this.summaryInput.connect(this,{change:"onInputChange",enter:"onInputEnter"}),this.updateFromModel}var Constructor,protoProps,staticProps;return Constructor=UnlinkSummaryPanelController,(protoProps=[{key:"updateFromModel",value:function{if(this.summaryInput.setValue(this.model.summary),this.summaryInputField.setErrors(this.model.summaryErrors),this.model.parsedSummary&&this.model.summaryIsValid){var $preview=(0,_globals.$)(" ").append(this.model.parsedSummary);$preview.find("a").attr("target","_blank"),this.summaryPreview.setLabel($preview)}else this.summaryPreview.setLabel("");this.summaryPreviewField.setErrors(this.model.parseErrors)}},{key:"onInputChange",value:function(value){var _this=this;this.model.setSummary(value);var requestId=++this._requestId;(0,_util.timeout)(this._delay).then(function{requestId<_this._requestId||!_this.model.summaryIsValid||_api.default.get({action:"parse",contentmodel:"wikitext",summary:"Removing link(s): ".concat(_this.model.summary," ").concat(_config.default.script.advert),prop:"text",disablelimitreport:1,format:"json",formatversion:"2"}).then(function(result){requestId<_this._requestId||!_this.model.summaryIsValid||_this.model.setParsedSummary(result.parse.parsedsummary)},function(errorCode){if(requestId<_this._requestId||!_this.model.summaryIsValid)return!1;_this.model.setParseError(errorCode)})})}},{key:"onInputEnter",value:function{this.model.onInputEnter}}])&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Object.defineProperty(Constructor,"prototype",{writable:!1}),UnlinkSummaryPanelController};_globals.OO.initClass(UnlinkSummaryPanelController);var _default=UnlinkSummaryPanelController;exports.default=_default},{"../../globals":1,"../api":220,"../config":221,"../util":225,"core-js/modules/es.array.concat":104,"core-js/modules/es.array.find":108,"core-js/modules/es.object.define-property":125}],182:[function(require,module,exports){"use strict";require("core-js/modules/es.object.define-property"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _globals=require("../../globals");function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}var _default=function{function UnlinkWindowController(model,window){!function(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,UnlinkWindowController),this.model=model,this.window=window,this.stackLayout=window.stackLayout,this.actions=window.actions,this.model.connect(this,{update:"updateFromModel",resize:this.window.updateSize}),this.updateFromModel}var Constructor,protoProps,staticProps;return Constructor=UnlinkWindowController,(protoProps=[{key:"updateFromModel",value:function{this.actions.setMode(this.model.mode),this.actions.setAbilities(this.model.actionAbilities),this.stackLayout.setItem(this.currentPanel),this.window.updateSize}},{key:"getActionProcess",value:function(action){return"start"===action?this.model.startTask:"abort"===action?this.model.abortTask:action&&"close"!==action||!this.model.canClose||this.window.close,new _globals.OO.ui.Process}},{key:"getBodyHeight",value:function{var panelHeight=this.currentPanel.$element.get(0).scrollHeight||0,errorsHeight=(0,_globals.$)(".oo-ui-processDialog-errors").get(0).scrollHeight||0;return Math.max(200,panelHeight+1,errorsHeight+1)}},{key:"currentPanel",get:function{var panel=this.stackLayout.findItemFromData({name:this.model.currentPanel});if(!panel)throw new Error("Could not find panel with name: "+this.model.currentPanel);return panel}}])&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Object.defineProperty(Constructor,"prototype",{writable:!1}),UnlinkWindowController};exports.default=_default},{"../../globals":1,"core-js/modules/es.object.define-property":125}],183:[function(require,module,exports){"use strict";require("core-js/modules/es.array.concat"),require("core-js/modules/es.array.find"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var obj,_globals=require("../../globals"),_windowSetManager=(obj=require("../windowSetManager"))&&obj.__esModule?obj:{default:obj};function DraggableMixin{}_globals.OO.initClass(DraggableMixin),DraggableMixin.uid=0,DraggableMixin.prototype.setupDraggablityStyles=function{(0,_globals.$)("body").addClass("ooui-draggbleWindow-open")},DraggableMixin.prototype.makeDraggable=function(xi,yi){(0,_globals.$)("body").addClass("ooui-draggbleWindow-open");var $frameEl=this.$element.find(".oo-ui-window-frame"),$handleEl=this.$element.find(".oo-ui-processDialog-location").css({cursor:"move"}),position={x:xi||0,y:yi||0};(xi||yi)&&($frameEl.css("transform","translate(".concat(position.x,"px, ").concat(position.y,"px)")),window.scrollTo(position.x,position.y));var constrain=function(val,minVal,maxVal){return val<minVal?minVal:maxVal<val?maxVal:val},pointerdown=!1,dragFrom={},pointer="PointerEvent"in window?"pointer":"mouse";this.draggableMixinEventNs=".oouiDraggableWin"+ ++DraggableMixin.uid,$handleEl.on(pointer+"enter"+this.draggableMixinEventNs,function{return $frameEl.css("will-change","transform")}),$handleEl.on(pointer+"leave"+this.draggableMixinEventNs,function{pointerdown||$frameEl.css("will-change","")}),$handleEl.on(pointer+"down"+this.draggableMixinEventNs,function(event){pointerdown=!0,dragFrom.x=event.clientX,dragFrom.y=event.clientY}),(0,_globals.$)("body").on(pointer+"move"+this.draggableMixinEventNs,function(event){if(pointerdown&&null!=dragFrom.x&&null!==dragFrom.y){var val,limit,dx=event.clientX-dragFrom.x,dy=event.clientY-dragFrom.y;dragFrom.x=event.clientX,dragFrom.y=event.clientY,position.x=(val=position.x+dx,limit=window.innerWidth/2+$frameEl.outerWidth/2-100,constrain(val,-1*limit,limit)),position.y=function(val){var minLimit=-1*(window.innerHeight-$frameEl.outerHeight)/2,maxLimit=(document.documentElement||document).scrollHeight-window.innerHeight/2;return constrain(val,minLimit,maxLimit)}(position.y+dy),$frameEl.css("transform","translate(".concat(position.x,"px, ").concat(position.y,"px)"))}}),(0,_globals.$)("body").on(pointer+"up"+this.draggableMixinEventNs,function{pointerdown=!1,delete dragFrom.x,delete dragFrom.y,position.x=Math.round(position.x),position.y=Math.round(position.y),$frameEl.css("transform","translate(".concat(position.x,"px, ").concat(position.y,"px)"))})},DraggableMixin.prototype.removeDraggability=function{_windowSetManager.default.hasOpenWindows||(0,_globals.$)("body").removeClass("ooui-draggbleWindow-open"),this.$element.find(".oo-ui-window-frame").css("transform",""),this.$element.find(".oo-ui-processDialog-location").off(this.draggableMixinEventNs),(0,_globals.$)("body").off(this.draggableMixinEventNs)};var _default=DraggableMixin;exports.default=_default},{"../../globals":1,"../windowSetManager":226,"core-js/modules/es.array.concat":104,"core-js/modules/es.array.find":108}],184:[function(require,module,exports){"use strict";require("core-js/modules/es.array.concat"),require("core-js/modules/es.array.filter"),require("core-js/modules/es.array.map"),require("core-js/modules/es.array.slice"),require("core-js/modules/es.object.define-property"),require("core-js/modules/es.regexp.exec"),require("core-js/modules/es.string.replace"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var obj,_globals=require("../../globals"),_RedirectList=(obj=require("./RedirectList"))&&obj.__esModule?obj:{default:obj},_util=require("../util");function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})),keys.push.apply(keys,symbols)}return keys}function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}var Discussion=function{function Discussion(config){!function(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Discussion),_globals.OO.EventEmitter.call(this),this.$headlineSpan=config.$headlineSpan,this.id=config.id,this.venue=config.venue,this.pages=config.pages||[],this.action=config.action||"",this.redirects=new _RedirectList.default,this.discussionPageName=config.discussionPageName,this.sectionHeader=config.sectionHeader,this.sectionNumber=config.sectionNumber,this.firstCommentDate=config.firstCommentDate,this.isOld=config.isOld,this.isRelisted=config.isRelisted,this.userIsSysop=config.userIsSysop,this.classes=config.classes,this.status="Loading...",this.showStatus=!0}var Constructor,protoProps,staticProps;return Constructor=Discussion,(protoProps=[{key:"setRedirects",value:function(redirections){this.redirects=new _RedirectList.default(redirections)}},{key:"setRelistInfo",value:function(relistInfo){this.relistInfo=function(target){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?ownKeys(Object(source),!0).forEach(function(key){_defineProperty(target,key,source[key])}):Object.getOwnPropertyDescriptors?Object.defineProperties(target,Object.getOwnPropertyDescriptors(source)):ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))})}return target}({},relistInfo)}},{key:"setNominationDate",value:function(nominationDate){this.nominationDate=nominationDate,this.firstCommentDate||(this.firstCommentDate=nominationDate),this.emit("update")}},{key:"setStatusReady",value:function{!this.userIsSysop&&50<this.pages.length?this.status="[XFDcloser: Too many pages for non-admin]":(this.status="",this.showStatus=!1),this.emit("update")}},{key:"setStatusError",value:function(code){this.status="".concat(code||"unknown"," error retrieving page information (reload the page to try again)"),this.emit("update")}},{key:"setWindowOpened",value:function(type){this.type=type,this.status=type.slice(0,1).toUpperCase+type.slice(1).replace(/e$/,"")+"ing discussion...",this.showStatus=!0,this.emit("update")}},{key:"setClosedWindowData",value:function(windowData){switch(!0){case windowData&&windowData.aborted:this.status=" Aborted during ".concat(this.type,"; check ").concat((0,_util.makeLink)("Special:MyContributions","your contributions")," to see which actions were already completed.");break;case windowData&&windowData.success:var actioned=this.type.slice(0,1).toUpperCase+this.type.slice(1).replace(/e$/,"")+"ed",as=windowData.result?' as "'.concat(windowData.result,'"'):"";this.status=" ".concat(actioned," ").concat(as," (reload page to see the actual ").concat(this.type,")"),this.actioned=!0;break;default:return void this.setStatusReady}this.finished=!0,this.showStatus=!0,this.emit("update")}},{key:"startClosing",value:function{this.emit("update")}},{key:"startRelisting",value:function{this.emit("update")}},{key:"startQuickClosing",value:function(result){console.log(result),this.emit("update")}},{key:"showButtons",get:function{return!this.showStatus}},{key:"showQuickClose",get:function{return 0<this.pages.length}},{key:"pagesNames",get:function{return this.pages.map(function(page){return page.getPrefixedText})}},{key:"discussionSubpageName",get:function{return this.venue.hasIndividualSubpages?this.discussionPageName.replace(this.venue.subpagePath,""):this.discussionPageName.replace(this.venue.path,"")}},{key:"discussionPageLink",get:function{return this.venue.hasIndividualSubpages?this.discussionPageName:this.discussionPageName+"#"+(0,_util.encodeForWikilinkFragment)(this.sectionHeader)}},{key:"talkpages",get:function{return this.pages.filter(function(page){return page.cahHaveTalkPage&&!page.isTalkPage}).map(function(page){return page.getTalkPage})}},{key:"talkpagesNames",get:function{return this.talkpages.map(function(page){return page.getPrefixedText})}}])&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Object.defineProperty(Constructor,"prototype",{writable:!1}),Discussion};_globals.OO.initClass(Discussion),_globals.OO.mixinClass(Discussion,_globals.OO.EventEmitter);var _default=Discussion;exports.default=_default},{"../../globals":1,"../util":225,"./RedirectList":191,"core-js/modules/es.array.concat":104,"core-js/modules/es.array.filter":106,"core-js/modules/es.array.map":116,"core-js/modules/es.array.slice":119,"core-js/modules/es.object.define-property":125,"core-js/modules/es.regexp.exec":132,"core-js/modules/es.string.replace":136}],185:[function(require,module,exports){"use strict";require("core-js/modules/es.object.define-property"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _globals=require("../../globals"),_Result=_interopRequireDefault(require("./Result")),_Options=_interopRequireDefault(require("./Options")),_TaskList=_interopRequireDefault(require("./TaskList")),_SanityChecks=_interopRequireDefault(require("./SanityChecks")),_PrefsGroup=_interopRequireDefault(require("./PrefsGroup"));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}var obj,key,value,MainWindowModel=function{function MainWindowModel(config){!function(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,MainWindowModel),_globals.OO.EventEmitter.call(this);var type=config.type,userIsSysop=config.discussion.userIsSysop;this.discussion=config.discussion,this.result=new _Result.default({discussion:this.discussion,type:type,userIsSysop:userIsSysop}),this.options=new _Options.default({result:this.result,venue:this.discussion.venue,userIsSysop:userIsSysop}),this.sanityChecks=new _SanityChecks.default({discussion:this.discussion,result:this.result,options:this.options}),this.taskList=new _TaskList.default({discussion:this.discussion,result:this.result,options:this.options,type:type,userIsSysop:userIsSysop}),this.preferences=new _PrefsGroup.default({userIsSysop:userIsSysop}),this.heights={},this.type=config.type,config.quick?(this.isQuick=!0,this.mode="tasks"):"relist"===this.type?this.mode="relist":1<this.discussion.pages.length?this.mode="multimodeAvailable":this.mode="normal",this.previousMode="",this.currentPanel=config.quick?"taskListPanel":"resultPanel",this.userIsSysop=config.userIsSysop,this.result.connect(this,{update:["emit","update"],resize:["emit","update"]}),this.options.connect(this,{update:["emit","update"],itemUpdate:["emit","update"]}),this.taskList.connect(this,{update:["emit","update"]}),this.preferences.connect(this,{update:["emit","update"],itemUpdate:["emit","update"],resize:["emit","update"]})}var Constructor,protoProps,staticProps;return Constructor=MainWindowModel,(protoProps=[{key:"suggestCurrentPanelHeight",value:function(suggestedHeight){var currentHeight=this.heights[this._heightKey]||MainWindowModel.defaultHeight;suggestedHeight<currentHeight&&currentHeight-suggestedHeight<50||(this.heights[this._heightKey]=suggestedHeight,this.emit("resize"))}},{key:"_setMode",value:function(mode){var currentMode=this.mode,nextMode="_previous"===mode?this.previousMode:mode;this.previousMode=currentMode,this.mode=nextMode}},{key:"showPrefs",value:function{var _this=this;this._setMode("prefs"),this.currentPanel="prefsPanel",this.emit("update"),setTimeout(function{_this.heights[_this._heightKey]+=15,_this.emit("update")},100)}},{key:"closePrefs",value:function{this._setMode("_previous"),this.currentPanel="resultPanel",this.emit("update")}},{key:"startTasks",value:function{this._setMode("tasks"),this.currentPanel="taskListPanel",this.emit("update"),this.taskList.startTasks}},{key:"setMultimode",value:function(active){this._setMode("multimode".concat(active?"Active":"Available")),this.result.setMultimode(active),this.emit("update")}},{key:"showOptions",value:function{this._setMode("options"),this.currentPanel="optionsPanel",this.options.onResultUpdate,this.emit("update")}},{key:"showResult",value:function{this._setMode("_previous"),this.currentPanel="resultPanel",this.emit("update")}},{key:"abortTasks",value:function{this.taskList.abortTasks}},{key:"actionAbilities",get:function{return{savePrefs:this.preferences.changed,next:this.result.isValid,save:"options"===this.mode?this.options.isValid:this.result.isValid,finish:this.taskList.done||this.taskList.aborted,closePrefs:!0,defaultPrefs:!this.preferences.allHaveDefaultValues,back:!0,abort:!this.taskList.finished&&!this.taskList.aborted,showPrefs:!0,multimode:!0,singlemode:!0}}},{key:"canClose",get:function{return"tasks"!==this.mode||this.taskList.finished||this.taskList.aborted}},{key:"_heightKey",get:function{return this.currentPanel+"_"+this.mode}},{key:"height",get:function{return this.heights[this._heightKey]||MainWindowModel.defaultHeight}}])&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Object.defineProperty(Constructor,"prototype",{writable:!1}),MainWindowModel};value=200,(key="defaultHeight")in(obj=MainWindowModel)?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,_globals.OO.initClass(MainWindowModel),_globals.OO.mixinClass(MainWindowModel,_globals.OO.EventEmitter);var _default=MainWindowModel;exports.default=_default},{"../../globals":1,"./Options":186,"./PrefsGroup":188,"./Result":192,"./SanityChecks":195,"./TaskList":197,"core-js/modules/es.object.define-property":125}],186:[function(require,module,exports){"use strict";require("core-js/modules/es.array.every"),require("core-js/modules/es.array.find"),require("core-js/modules/es.array.includes"),require("core-js/modules/es.array.iterator"),require("core-js/modules/es.array.map"),require("core-js/modules/es.object.define-property"),require("core-js/modules/es.object.to-string"),require("core-js/modules/es.string.includes"),require("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var obj,_globals=require("../../globals"),_OptionsItem=(obj=require("./OptionsItem"))&&obj.__esModule?obj:{default:obj};function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}var Options=function{function Options(config){!function(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Options),_globals.OO.EventEmitter.call(this),_globals.OO.EmitterList.call(this),this.result=config.result,this.venue=config.venue,this.userIsSysop=config.userIsSysop,this.result.connect(this,{update:"onResultUpdate"})}var Constructor,protoProps,staticProps;return Constructor=Options,(protoProps=[{key:"getOptions",value:function(result){return result?this.getItems.find(function(optionItem){return optionItem.result===result}):this.getItems}},{key:"getOptionValues",value:function(result){var resultOptions=this.getOptions(result);return resultOptions&&resultOptions.values}},{key:"onResultUpdate",value:function{var _this=this,uniqueResults=this.result.uniqueSelectedResultsNames,existingItems=this.getItems;if(existingItems.length===uniqueResults.length&&existingItems.every(function(item){return uniqueResults.includes(item.result)}))return!1;this.clearItems,this.addItems(uniqueResults.map(function(result){return existingItems.find(function(item){return item.result===result})||new _OptionsItem.default({result:result,venueType:_this.venue.type,userIsSysop:_this.userIsSysop})})),this.emit("update")}},{key:"onItemUpdate",value:function{var _this2=this;this.emit("itemUpdate"),setTimeout(function{return _this2.emit("itemUpdate")},100)}},{key:"isValid",get:function{return this.getItems.every(function(item){return item.isValid})}}])&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Object.defineProperty(Constructor,"prototype",{writable:!1}),Options};_globals.OO.initClass(Options),_globals.OO.mixinClass(Options,_globals.OO.EventEmitter),_globals.OO.mixinClass(Options,_globals.OO.EmitterList);var _default=Options;exports.default=_default},{"../../globals":1,"./OptionsItem":187,"core-js/modules/es.array.every":105,"core-js/modules/es.array.find":108,"core-js/modules/es.array.includes":111,"core-js/modules/es.array.iterator":113,"core-js/modules/es.array.map":116,"core-js/modules/es.object.define-property":125,"core-js/modules/es.object.to-string":128,"core-js/modules/es.string.includes":134,"core-js/modules/web.dom-collections.iterator":141}],187:[function(require,module,exports){"use strict";require("core-js/modules/es.array.every"),require("core-js/modules/es.array.filter"),require("core-js/modules/es.array.find"),require("core-js/modules/es.array.find-index"),require("core-js/modules/es.array.for-each"),require("core-js/modules/es.array.includes"),require("core-js/modules/es.array.join"),require("core-js/modules/es.array.map"),require("core-js/modules/es.array.slice"),require("core-js/modules/es.function.name"),require("core-js/modules/es.object.define-property"),require("core-js/modules/es.string.includes"),require("core-js/modules/web.dom-collections.for-each"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _globals=require("../../globals"),_data=require("../data"),prefs=function(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule)return obj;if(null===obj||"object"!==_typeof(obj)&&"function"!=typeof obj)return{default:obj};var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj))return cache.get(obj);var newObj={},hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj)if("default"!==key&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;desc&&(desc.get||desc.set)?Object.defineProperty(newObj,key,desc):newObj[key]=obj[key]}newObj.default=obj,cache&&cache.set(obj,newObj);return newObj}(require("../prefs"));function _getRequireWildcardCache(nodeInterop){if("function"!=typeof WeakMap)return null;var cacheBabelInterop=new WeakMap,cacheNodeInterop=new WeakMap;return(_getRequireWildcardCache=function(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop})(nodeInterop)}function _slicedToArray(arr,i){return function(arr){if(Array.isArray(arr))return arr}(arr)||function(arr,i){var _i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null==_i)return;var _s,_e,_arr=[],_n=!0,_d=!1;try{for(_i=_i.call(arr);!(_n=(_s=_i.next).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return}finally{if(_d)throw _e}}return _arr}(arr,i)||function(o,minLen){if(!o)return;if("string"==typeof o)return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}(arr,i)||function{throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator] method.")}}function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _typeof(obj){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}var OptionsItem=function{function OptionsItem(config){!function(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,OptionsItem),_globals.OO.EventEmitter.call(this),this.result=config.result,this.actions=(0,_data.getRelevantActions)(config.venueType,config.userIsSysop,config.result),this._options=(0,_data.getRelevantOptions)(config.venueType,config.userIsSysop,this.actions),this.selectedActionName=this.actions[0].name,"tfd"===config.venueType&&"delete"===config.result&&(this.selectedActionName=prefs.get("tfdDeleteAction"));var unlinkOptionIndex=this._options.findIndex(function(option){return"unlink"===option.name});-1!==unlinkOptionIndex&&(this._options[unlinkOptionIndex].value=prefs.get("unlinkBacklinks"))}var Constructor,protoProps,staticProps;return Constructor=OptionsItem,staticProps=[{key:"optionValuesEqual",value:function(value1,value2){if(_typeof(value1)!==_typeof(value2))return!1;var _map2=_slicedToArray([value1,value2].map(function(value){return Array.isArray(value)?value.join("|"):value}),2);return _map2[0]===_map2[1]}}],(protoProps=[{key:"setSelectedActionName",value:function(name){if(this.selectedActionName===name)return!1;this.selectedActionName=name||"",this.emit("update")}},{key:"setOptionValue",value:function(optionName,optionValue){var option=this._options.find(function(_option){return _option.name===optionName});if(!option)throw new Error("Could not find option with name: "+optionName);if(OptionsItem.optionValuesEqual(option.value,optionValue))return!1;option.value=optionValue,this.emit("update")}},{key:"name",get:function{return this.result}},{key:"label",get:function{return"custom"===this.result?"Custom result options":'"'.concat(this.result.slice(0,1).toUpperCase+this.result.slice(1),'" result options')}},{key:"selectedAction",get:function{var _this=this;return this.actions.find(function(action){return action.name===_this.selectedActionName})}},{key:"options",get:function{var selectedAction=this.selectedAction;return selectedAction&&selectedAction.options&&selectedAction.options.length?this._options.filter(function(option){return selectedAction.options.includes(option.name)}):[]}},{key:"isValid",get:function{return!!this.selectedAction&&this.options.every(function(option){return null!==option.value&&void 0!==option.value})}},{key:"values",get:function{var values={action:this.selectedAction&&this.selectedAction.name};return this.options.forEach(function(option){values[option.name]=option.value}),values}}])&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Object.defineProperty(Constructor,"prototype",{writable:!1}),OptionsItem};_globals.OO.initClass(OptionsItem),_globals.OO.mixinClass(OptionsItem,_globals.OO.EventEmitter);var _default=OptionsItem;exports.default=_default},{"../../globals":1,"../data":222,"../prefs":223,"core-js/modules/es.array.every":105,"core-js/modules/es.array.filter":106,"core-js/modules/es.array.find":108,"core-js/modules/es.array.find-index":107,"core-js/modules/es.array.for-each":110,"core-js/modules/es.array.includes":111,"core-js/modules/es.array.join":114,"core-js/modules/es.array.map":116,"core-js/modules/es.array.slice":119,"core-js/modules/es.function.name":123,"core-js/modules/es.object.define-property":125,"core-js/modules/es.string.includes":134,"core-js/modules/web.dom-collections.for-each":140}],188:[function(require,module,exports){"use strict";function _typeof(obj){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}require("core-js/modules/es.array.every"),require("core-js/modules/es.array.filter"),require("core-js/modules/es.array.for-each"),require("core-js/modules/es.array.map"),require("core-js/modules/es.array.some"),require("core-js/modules/es.function.name"),require("core-js/modules/es.object.define-property"),require("core-js/modules/web.dom-collections.for-each"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var obj,_globals=require("../../globals"),_PrefsItem=(obj=require("./PrefsItem"))&&obj.__esModule?obj:{default:obj},_data=require("../data"),prefs=function(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule)return obj;if(null===obj||"object"!==_typeof(obj)&&"function"!=typeof obj)return{default:obj};var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj))return cache.get(obj);var newObj={},hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj)if("default"!==key&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;desc&&(desc.get||desc.set)?Object.defineProperty(newObj,key,desc):newObj[key]=obj[key]}newObj.default=obj,cache&&cache.set(obj,newObj);return newObj}(require("../prefs"));function _getRequireWildcardCache(nodeInterop){if("function"!=typeof WeakMap)return null;var cacheBabelInterop=new WeakMap,cacheNodeInterop=new WeakMap;return(_getRequireWildcardCache=function(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop})(nodeInterop)}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}var PrefsGroup=function{function PrefsGroup(config){!function(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,PrefsGroup),_globals.OO.EventEmitter.call(this),_globals.OO.EmitterList.call(this),this.userIsSysop=config.userIsSysop,this.addItems((0,_data.getRelevantPrefs)(config.userIsSysop).map(function(prefConfig){return new _PrefsItem.default(prefConfig,prefs.get(prefConfig.name))}))}var Constructor,protoProps,staticProps;return Constructor=PrefsGroup,(protoProps=[{key:"getValues",value:function(options){var prefs={};return(options&&options.changedOnly?this.getItems.filter(function(item){return item.changed}):this.getItems).forEach(function(item){prefs[item.name]=item.value}),prefs}},{key:"resetValues",value:function(values){this.items.forEach(function(item){void 0!==values[item.name]&&item.reset(values[item.name])}),this.emit("update")}},{key:"restoreDefaults",value:function{this.items.forEach(function(item){return item.restoreDefault})}},{key:"allHaveDefaultValues",value:function{return this.getItems.every(function(item){return item.hasDefaultValue})}},{key:"onItemUpdate",value:function{this.emit("itemUpdate")}},{key:"isValid",get:function{return this.getItems.every(function(item){return item.isValid})}},{key:"changed",get:function{return this.getItems.some(function(item){return item.changed})}}])&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Object.defineProperty(Constructor,"prototype",{writable:!1}),PrefsGroup};_globals.OO.initClass(PrefsGroup),_globals.OO.mixinClass(PrefsGroup,_globals.OO.EventEmitter),_globals.OO.mixinClass(PrefsGroup,_globals.OO.EmitterList);var _default=PrefsGroup;exports.default=_default},{"../../globals":1,"../data":222,"../prefs":223,"./PrefsItem":189,"core-js/modules/es.array.every":105,"core-js/modules/es.array.filter":106,"core-js/modules/es.array.for-each":110,"core-js/modules/es.array.map":116,"core-js/modules/es.array.some":120,"core-js/modules/es.function.name":123,"core-js/modules/es.object.define-property":125,"core-js/modules/web.dom-collections.for-each":140}],189:[function(require,module,exports){"use strict";require("core-js/modules/es.array.every"),require("core-js/modules/es.array.find"),require("core-js/modules/es.function.name"),require("core-js/modules/es.number.constructor"),require("core-js/modules/es.object.define-property"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _globals=require("../../globals"),_data=require("../data");function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}var PrefsItem=function{function PrefsItem(config,value){!function(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,PrefsItem),_globals.OO.EventEmitter.call(this),this.name=config.name,this.label=config.label,this.type=config.type,this.help=config.help,this.helpInline=config.helpInline,this.value=value,this.initialValue=value,this.options=config.options,this.min=config.min,this.max=config.max}var Constructor,protoProps,staticProps;return Constructor=PrefsItem,(protoProps=[{key:"setValue",value:function(value){if(this.value===value)return!1;this.value="number"===this.type?Number(value):value,this.emit("update")}},{key:"reset",value:function(value){this.value=value,this.initialValue=value,this.emit("update")}},{key:"restoreDefault",value:function{this.setValue(_data.defaultPrefValues[this.name])}},{key:"hasDefaultValue",value:function{return this.value===_data.defaultPrefValues[this.name]}},{key:"isValid",get:function{var _this=this;switch(this.type){case"number":return"number"==typeof this.value&&!isNaN(this.value)&&(void 0===this.min||this.min<=this.value)&&(void 0===this.max||this.max>=this.value);case"toggle":return"boolean"==typeof this.value;case"dropdown":return this.options.find(function(option){return option.data===_this.value})}return this.getItems.every(function(item){return item.isValid})}},{key:"changed",get:function{return this.value!==this.initialValue}},{key:"errors",get:function{return this.isValid?[]:["Invalid value"]}}])&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Object.defineProperty(Constructor,"prototype",{writable:!1}),PrefsItem};_globals.OO.initClass(PrefsItem),_globals.OO.mixinClass(PrefsItem,_globals.OO.EventEmitter),_globals.OO.mixinClass(PrefsItem,_globals.OO.EmitterList);var _default=PrefsItem;exports.default=_default},{"../../globals":1,"../data":222,"core-js/modules/es.array.every":105,"core-js/modules/es.array.find":108,"core-js/modules/es.function.name":123,"core-js/modules/es.number.constructor":124,"core-js/modules/es.object.define-property":125}],190:[function(require,module,exports){"use strict";require("core-js/modules/es.object.define-property"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var obj,_globals=require("../../globals"),_PrefsGroup=(obj=require("./PrefsGroup"))&&obj.__esModule?obj:{default:obj};function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}var PrefsWindowModel=function{function PrefsWindowModel(config){!function(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,PrefsWindowModel),_globals.OO.EventEmitter.call(this),this.preferences=new _PrefsGroup.default({userIsSysop:config.userIsSysop}),this.preferences.connect(this,{update:["emit","update"],itemUpdate:["emit","update"],resize:["emit","update"]})}var Constructor,protoProps,staticProps;return Constructor=PrefsWindowModel,(protoProps=[{key:"actionAbilities",get:function{return{savePrefs:this.preferences.changed,defaultPrefs:!this.preferences.allHaveDefaultValues}}}])&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Object.defineProperty(Constructor,"prototype",{writable:!1}),PrefsWindowModel};_globals.OO.initClass(PrefsWindowModel),_globals.OO.mixinClass(PrefsWindowModel,_globals.OO.EventEmitter);var _default=PrefsWindowModel;exports.default=_default},{"../../globals":1,"./PrefsGroup":188,"core-js/modules/es.object.define-property":125}],191:[function(require,module,exports){"use strict";require("core-js/modules/es.array.filter"),require("core-js/modules/es.array.find"),require("core-js/modules/es.array.for-each"),require("core-js/modules/es.array.map"),require("core-js/modules/es.object.define-property"),require("core-js/modules/web.dom-collections.for-each"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _globals=require("../../globals");function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}var RedirectList=function{function RedirectList(redirections){!function(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,RedirectList),this.list=Array.isArray(redirections)?redirections:[],this.list.forEach(function(redirection){_globals.mw.Title.exist.set(_globals.mw.Title.newFromText(redirection.to).getPrefixedDb,!0)})}var Constructor,protoProps,staticProps;return Constructor=RedirectList,(protoProps=[{key:"resolve",value:function(pageNames){var _this=this;return pageNames.map(function(pageName){var redirect=_this.list.find(function(redirect){return redirect.from===pageName});return redirect?redirect.to:pageName})}},{key:"resolveOne",value:function(pageName){return this.resolve([pageName])[0]}},{key:"resolveTalks",value:function(pagesNames){return this.resolve(pagesNames).map(function(pageName){var title=_globals.mw.Title.newFromText(pageName);return title&&title.canHaveTalkPage&&!title.isTalkPage&&title.getTalkPage.getPrefixedText}).filter(function(t){return!!t})}},{key:"resolveOneTalk",value:function(pagesName){var resolved=this.resolveTalks([pagesName]);return resolved.length?resolved[0]:[]}},{key:"unresolve",value:function(pageNames){var _this2=this;return pageNames.map(function(pageName){var redirect=_this2.list.find(function(redirect){return redirect.to===pageName});return redirect?redirect.from:pageName})}},{key:"unresolveOne",value:function(pageName){return this.unresolve([pageName])[0]}}])&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Object.defineProperty(Constructor,"prototype",{writable:!1}),RedirectList};exports.default=RedirectList},{"../../globals":1,"core-js/modules/es.array.filter":106,"core-js/modules/es.array.find":108,"core-js/modules/es.array.for-each":110,"core-js/modules/es.array.map":116,"core-js/modules/es.object.define-property":125,"core-js/modules/web.dom-collections.for-each":140}],192:[function(require,module,exports){"use strict";require("core-js/modules/es.array.concat"),require("core-js/modules/es.array.every"),require("core-js/modules/es.array.find"),require("core-js/modules/es.array.find-index"),require("core-js/modules/es.array.for-each"),require("core-js/modules/es.array.includes"),require("core-js/modules/es.array.join"),require("core-js/modules/es.array.map"),require("core-js/modules/es.array.slice"),require("core-js/modules/es.function.name"),require("core-js/modules/es.object.define-property"),require("core-js/modules/es.regexp.exec"),require("core-js/modules/es.string.includes"),require("core-js/modules/es.string.replace"),require("core-js/modules/es.string.trim"),require("core-js/modules/web.dom-collections.for-each"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _globals=require("../../globals"),_ResultItem=_interopRequireDefault(require("./ResultItem")),_data=require("../data"),_ResultList=_interopRequireDefault(require("./ResultList"));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})),keys.push.apply(keys,symbols)}return keys}function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function _toConsumableArray(arr){return function(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr)}(arr)||function(iter){if("undefined"!=typeof Symbol&&null!=iter[Symbol.iterator]||null!=iter["@@iterator"])return Array.from(iter)}(arr)||function(o,minLen){if(!o)return;if("string"==typeof o)return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}(arr)||function{throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator] method.")}}function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function makeLink(target,text){text=text||target;var url="/wiki/"+encodeURIComponent(String(target)).replace(/'/g,"%27").replace(/%20/g,"_").replace(/%3B/g,";").replace(/%40/g,"@").replace(/%24/g,"$").replace(/%2C/g,",").replace(/%2F/g,"/").replace(/%3A/g,":");return(0,_globals.$)("").attr({href:url,target:"_blank"}).text(text)}var Result=function{function Result(config){!function(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Result),_globals.OO.EventEmitter.call(this),this.discussion=config.discussion,this.type=config.type,this.userIsSysop=config.userIsSysop;var availableResults=(0,_data.getRelevantResults)(this.discussion.venue.type,config.userIsSysop);if(this.singleModeResult=new _ResultItem.default({availableResults:availableResults}),this.singleModeResult.connect(this,{update:["emit","update"],softDeleteSelect:"onSoftDeleteSelect"}),this.multimodeResults=new _ResultList.default({availableResults:availableResults,pageNames:this.discussion.pagesNames}),this.multimodeResults.connect(this,{update:["emit","update"]}),this.resultSummary="",this.isMultimode=!1,this.rationale="",this.newSentence=!0,this.topNotes=[],0===this.discussion.pages.length)this.topNotes.push({name:"basicMode",title:"Discussion: ".concat(this.discussion.sectionHeader," (basic mode only)"),content:"Nominated pages were not detected.",expanded:!1});else{var pageCount=1===this.discussion.pages.length?"1 page":"".concat(this.discussion.pages.length," pages");this.topNotes.push({name:"discussionPages",title:"Discussion: ".concat(this.discussion.sectionHeader," (").concat(pageCount,")"),content:(0,_globals.$)("<ul>").append(this.discussion.pagesNames.map(function(pageName){return(0,_globals.$)("<li>").append(makeLink(pageName))})),expanded:!1})}this.userIsSysop||"close"!==this.type||this.topNotes.push({name:"nonAdminWarning",title:"Take care to avoid inappropriate non-administrator closes",content:(0,_globals.$)(" ").append("See the ",makeLink("WP:NACD")," guideline for advice on appropriate and inappropriate closures."),expanded:!1})}var Constructor,protoProps,staticProps;return Constructor=Result,(protoProps=[{key:"getFormattedRationale",value:function(format){var text=this.rationale.trim;if(!text)return"";var firstChar=text.slice(0,1),needsLinebreak="*"===firstChar||":"===firstChar||";"===firstChar;if("punctuated"!==format)return(needsLinebreak?"\n":"")+("escaped"===format?text.replace(/(\|)(?!(?:[^[]*]|[^{]*}))/g,"&#124;"):text);var isNewSentence=this.newSentence&&this.showNewSentenceOption;return"".concat(isNewSentence?".":"").concat(needsLinebreak?"\n":" ").concat(text)}},{key:"getRelistComment",value:function{return this.getFormattedRationale("escaped")}},{key:"getFormattedResult",value:function{return this.isMultimode?this.resultSummary.trim:this.singleModeResult.getResultText}},{key:"getResultText",value:function{return this.getFormattedResult}},{key:"getFormattedTarget",value:function(format){return this.isMultimode?"":this.singleModeResult.getFormattedTarget(format)}},{key:"getResultsByPage",value:function{var _this=this;return this.isMultimode?this.multimodeResults.getItems:this.discussion.pagesNames.map(function(pageName){return _ResultItem.default.newWithPageName(_this.singleModeResult,pageName)})}},{key:"setMultimode",value:function(active){this.isMultimode=!!active,this.emit("update")}},{key:"setNoteExpanded",value:function(noteName,isExpanded){var noteIndex=this.topNotes.findIndex(function(note){return note.name===noteName});if(-1===noteIndex)throw new Error("Note ".concat(noteName," not found"));this.topNotes=[].concat(_toConsumableArray(this.topNotes.slice(0,noteIndex)),[function(target){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?ownKeys(Object(source),!0).forEach(function(key){_defineProperty(target,key,source[key])}):Object.getOwnPropertyDescriptors?Object.defineProperties(target,Object.getOwnPropertyDescriptors(source)):ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))})}return target}({},this.topNotes[noteIndex],{expanded:isExpanded})],_toConsumableArray(this.topNotes.slice(noteIndex+1))),this.emit("update")}},{key:"setResultSummary",value:function(value){if(this.resultSummary===value)return!1;this.resultSummary=value,this.emit("update")}},{key:"copyResultsToRationale",value:function{if(!this.isMultimode)return!1;var results=this.multimodeResults.getItems.map(function(result){var pageName,title,value,pageLink=(pageName=result.pageName,(title=_globals.mw.Title.newFromText(pageName))&&/^(File|Image|Category):.+/.test(title.getPrefixedText)?"".concat(result.pageName,""):"".concat(result.pageName,"")),resultText=(value=result.getResultText).slice(0,1).toUpperCase+value.slice(1);if(!resultText)return"*  ".concat(pageLink,"\n");var formattedTarget=result.showTarget&&(result.getFormattedTarget||"");return"*".concat(resultText," ").concat(pageLink).concat(formattedTarget?" to "+formattedTarget:"","\n")}).join("");this.rationale=results+this.rationale,this.emit("update")}},{key:"setRationale",value:function(value){if(this.rationale===value)return!1;this.rationale=value,this.emit("update")}},{key:"prependToRationale",value:function(value){this.setRationale((value+" "+this.rationale).trim)}},{key:"setNewSentence",value:function(isSelected){if(this.newSentence===isSelected)return!1;this.newSentence=isSelected,this.emit("update")}},{key:"onSoftDeleteSelect",value:function{if(!this.rationale.includes(_data.softDeletionRationaleTemplate)){var pageName=this.discussion.pages[0].getPrefixedText,nomLink=this.discussion.discussionPageLink,isMulti=1<this.discussion.pages.length;this.prependToRationale((0,_data.makeSoftDeleteRationale)(pageName,nomLink,isMulti))}}},{key:"uniqueSelectedResults",get:function{var results=[];return(this.isMultimode?this.multimodeResults.getItems:[this.singleModeResult]).forEach(function(modeResult){var selectedResult=modeResult.selectedResult,isDuplicate=selectedResult&&results.find(function(result){return result.name===selectedResult.name});selectedResult&&!isDuplicate&&results.push(selectedResult)}),results}},{key:"uniqueSelectedResultsNames",get:function{return this.uniqueSelectedResults.map(function(data){return data.name})}},{key:"resultSummaryIsValid",get:function{return!!this.resultSummary.trim}},{key:"showNewSentenceOption",get:function{return"close"===this.type}},{key:"showResultFieldset",get:function{return"close"===this.type}},{key:"rationaleHeading",get:function{return"close"===this.type?"Rationale":"Relist comment"}},{key:"showCopyButton",get:function{return this.showResultFieldset&&this.isMultimode}},{key:"isValid",get:function{return"relist"===this.type||(this.isMultimode?this.resultSummaryIsValid&&this.multimodeResults.getItems.every(function(result){return result.isValid}):this.singleModeResult.isValid)}},{key:"previewWikitext",get:function{if("relist"===this.type)return"");var resultText=this.isMultimode?this.resultSummary.trim:this.singleModeResult.getResultText,resultWikitext=resultText?"".concat(resultText,""):"",targetWikitext=this.getFormattedTarget({prepend:" to "}),rationaleWikitext=this.getFormattedRationale("punctuated")||".";return"The result of the discussion was ".concat(resultWikitext).concat(targetWikitext).concat(rationaleWikitext)}}])&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Object.defineProperty(Constructor,"prototype",{writable:!1}),Result};_globals.OO.initClass(Result),_globals.OO.mixinClass(Result,_globals.OO.EventEmitter);var _default=Result;exports.default=_default},{"../../globals":1,"../data":222,"./ResultItem":193,"./ResultList":194,"core-js/modules/es.array.concat":104,"core-js/modules/es.array.every":105,"core-js/modules/es.array.find":108,"core-js/modules/es.array.find-index":107,"core-js/modules/es.array.for-each":110,"core-js/modules/es.array.includes":111,"core-js/modules/es.array.join":114,"core-js/modules/es.array.map":116,"core-js/modules/es.array.slice":119,"core-js/modules/es.function.name":123,"core-js/modules/es.object.define-property":125,"core-js/modules/es.regexp.exec":132,"core-js/modules/es.string.includes":134,"core-js/modules/es.string.replace":136,"core-js/modules/es.string.trim":139,"core-js/modules/web.dom-collections.for-each":140}],193:[function(require,module,exports){"use strict";require("core-js/modules/es.array.concat"),require("core-js/modules/es.array.find"),require("core-js/modules/es.function.name"),require("core-js/modules/es.object.define-property"),require("core-js/modules/es.string.trim"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _globals=require("../../globals");function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}var ResultItem=function{function ResultItem(config){!function(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,ResultItem),_globals.OO.EventEmitter.call(this),this.pageName=config.pageName,this.availableResults=config.availableResults,this.selectedResultName=config.selectedResultName||"",this.softResult=config.softResult||!1,this.speedyResult=config.speedyResult||!1,this.deleteFirstResult=config.deleteFirstResult||!1,this.targetPageName=config.targetPageName||"",this.customResultText=config.customResultText||""}var Constructor,protoProps,staticProps;return Constructor=ResultItem,staticProps=[{key:"validatePageName",value:function(pageName){return!!_globals.mw.Title.newFromText(pageName)}},{key:"validateNonEmpty",value:function(value){return!!value.trim}},{key:"newWithPageName",value:function(resultItem,pageName){var newResultItem=new ResultItem(resultItem);return newResultItem.setPageName(pageName),newResultItem}}],(protoProps=[{key:"getResultText",value:function{return this.selectedResult?"custom"===this.selectedResult.name?this.customResultText.trim:((this.isSpeedy?"speedy ":this.isSoft&&"soft ")||this.isDeleteFirst&&"delete and "||"")+this.selectedResultName:""}},{key:"getFormattedTarget",value:function(format){if(!this.targetIsValid||!this.showTarget)return"";var prepend=format&&format.prepend||"",title=_globals.mw.Title.newFromText(this.targetPageName),text=title.getPrefixedText,fragment=title.getFragment,raw="".concat(text).concat(fragment?"#"+fragment:"");return format&&format.raw?prepend+raw:"".concat(prepend,"Image|Category):.+/.test(title.getPrefixedText)}(text)?":":"").concat(raw,"")}},{key:"isValid",value:function{return!!this.selectedResult&&(!this.showTarget||this.targetIsValid)&&(!this.showCustomResult||this.customResultIsValid)}},{key:"isSpeedy",value:function{return this.showSpeedyResult&&this.speedyResult}},{key:"isSoft",value:function{return this.showSoftResult&&this.softResult}},{key:"isSoftDelete",value:function{return this.isSoft&&"delete"===this.selectedResultName}},{key:"isDeleteFirst",value:function{return this.showDeleteFirstResult&&this.deleteFirstResult}},{key:"setPageName",value:function(pageName){this.pageName=pageName,this.emit("update")}},{key:"setSelectedResultName",value:function(name){this.selectedResultName=name,this.emit("update")}},{key:"setSoftResult",value:function(isSoft){this.softResult=!!isSoft,this.softResult&&(this.speedyResult=!1,this.deleteFirstResult=!1),this.emit("update"),this.isSoftDelete&&this.emit("softDeleteSelect")}},{key:"setSpeedyResult",value:function(isSpeedy){this.speedyResult=!!isSpeedy,this.speedyResult&&(this.softResult=!1,this.deleteFirstResult=!1),this.emit("update")}},{key:"setDeleteFirstResult",value:function(isDeleteFirst){this.deleteFirstResult=!!isDeleteFirst,this.deleteFirstResult&&(this.softResult=!1,this.speedyResult=!1),this.emit("update")}},{key:"setTargetPageName",value:function(target){if(this.targetPageName===target)return!1;this.targetPageName=target,this.emit("update")}},{key:"setCustomResultText",value:function(text){if(this.customResultText===text)return!1;this.customResultText=text,this.emit("update")}},{key:"name",get:function{return this.pageName}},{key:"resultName",get:function{return this.selectedResultName}},{key:"selectedResult",get:function{var _this=this;return this.availableResults.find(function(result){return result.name===_this.selectedResultName})}},{key:"showSpeedyResult",get:function{return!!this.selectedResult&&!!this.selectedResult.allowSpeedy}},{key:"showSoftResult",get:function{return!!this.selectedResult&&!!this.selectedResult.allowSoft}},{key:"showDeleteFirstResult",get:function{return!!this.selectedResult&&!!this.selectedResult.allowDeleteFirst}},{key:"showResultOptions",get:function{return this.showSpeedyResult||this.showSoftResult||this.showDeleteFirstResult}},{key:"showTarget",get:function{return!!this.selectedResult&&!!this.selectedResult.requireTarget}},{key:"targetIsValid",get:function{return ResultItem.validatePageName(this.targetPageName)}},{key:"showCustomResult",get:function{return!!this.selectedResult&&"custom"===this.selectedResult.name}},{key:"customResultIsValid",get:function{return ResultItem.validateNonEmpty(this.customResultText)}}])&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Object.defineProperty(Constructor,"prototype",{writable:!1}),ResultItem};_globals.OO.initClass(ResultItem),_globals.OO.mixinClass(ResultItem,_globals.OO.EventEmitter);var _default=ResultItem;exports.default=_default},{"../../globals":1,"core-js/modules/es.array.concat":104,"core-js/modules/es.array.find":108,"core-js/modules/es.function.name":123,"core-js/modules/es.object.define-property":125,"core-js/modules/es.string.trim":139}],194:[function(require,module,exports){"use strict";require("core-js/modules/es.array.map"),require("core-js/modules/es.object.define-property"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var obj,_globals=require("../../globals"),_ResultItem=(obj=require("./ResultItem"))&&obj.__esModule?obj:{default:obj};function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}var ResultList=function{function ResultList(config){!function(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,ResultList),_globals.OO.EventEmitter.call(this),_globals.OO.EmitterList.call(this),this.addItems(config.pageNames.map(function(pageName){return new _ResultItem.default({availableResults:config.availableResults,pageName:pageName})})),this.aggregate({update:"itemUpdate"}),this.connect(this,{itemUpdate:["emit","update"]})}var Constructor,protoProps,staticProps;return Constructor=ResultList,(protoProps=[{key:"onItemUpdate",value:function{this.emit("update")}}])&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Object.defineProperty(Constructor,"prototype",{writable:!1}),ResultList};_globals.OO.initClass(ResultList),_globals.OO.mixinClass(ResultList,_globals.OO.EventEmitter),_globals.OO.mixinClass(ResultList,_globals.OO.EmitterList);var _default=ResultList;exports.default=_default},{"../../globals":1,"./ResultItem":193,"core-js/modules/es.array.map":116,"core-js/modules/es.object.define-property":125}],195:[function(require,module,exports){"use strict";require("core-js/modules/es.array.concat"),require("core-js/modules/es.array.filter"),require("core-js/modules/es.array.flat-map"),require("core-js/modules/es.array.for-each"),require("core-js/modules/es.array.includes"),require("core-js/modules/es.array.join"),require("core-js/modules/es.array.map"),require("core-js/modules/es.array.some"),require("core-js/modules/es.array.unscopables.flat-map"),require("core-js/modules/es.object.define-property"),require("core-js/modules/es.string.includes"),require("core-js/modules/web.dom-collections.for-each"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var obj,_globals=require("../../globals"),_util=require("../util"),_api=(obj=require("../api"))&&obj.__esModule?obj:{default:obj};function _toConsumableArray(arr){return function(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr)}(arr)||function(iter){if("undefined"!=typeof Symbol&&null!=iter[Symbol.iterator]||null!=iter["@@iterator"])return Array.from(iter)}(arr)||function(o,minLen){if(!o)return;if("string"==typeof o)return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}(arr)||function{throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator] method.")}}function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}var SanityChecks=function{function SanityChecks(config){!function(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,SanityChecks),_globals.OO.EventEmitter.call(this),this.discussion=config.discussion,this.result=config.result,this.options=config.options,this.showWarnings=!0,this.showRedirections=!0,this.result.connect(this,{update:"resetShowAll"}),this.options.connect(this,{update:"resetShowAll"})}var Constructor,protoProps,staticProps;return Constructor=SanityChecks,staticProps=[{key:"date",value:function(isOld,isRelisted){return isOld||isRelisted?[]:["It has not yet been 7 days since the discussion was listed."]}},{key:"massActions",value:function(actions,numPages){return actions.some(function(action){return"noActions"!==action})&&3<numPages?["Mass actions will be peformed (".concat(numPages," nominated pages detected).")]:[]}},{key:"nominatedPagesNamespaces",value:function(pageNames,expectedNamespaceNumbers){if(!expectedNamespaceNumbers||!expectedNamespaceNumbers.length)return[];var warnPages=pageNames.filter(function(pageName){return!expectedNamespaceNumbers.includes(_globals.mw.Title.newFromText(pageName).getNamespaceId)}).map(function(pageName){return"<li>".concat((0,_util.makeLink)(pageName),"</li>")});return warnPages.length?["The following pages are not in the expected namespace:<ul>".concat(warnPages.join(""),"</ul>")]:[]}},{key:"targetsNamespaces",value:function(targets,expectedNamespaceNumbers){return expectedNamespaceNumbers&&expectedNamespaceNumbers.length?(0,_util.uniqueArray)(targets).filter(function(target){return!!target&&!expectedNamespaceNumbers.includes(_globals.mw.Title.newFromText(target).getNamespaceId)}).map(function(target){return"Target page ".concat((0,_util.makeLink)(target)," is not in the expected namespace.")}):[]}}],(protoProps=[{key:"getWarnings",value:function{var actions=this.options.getOptions.map(function(optionItem){return optionItem.selectedAction}),targets=this.result.getResultsByPage.flatMap(function(pageResult){return pageResult.showTarget&&pageResult.targetPageName||[]}),expectedNamespaces=this.discussion.venue.ns_number;return[].concat(_toConsumableArray(SanityChecks.date(this.discussion.isOld,this.discussion.isRelisted)),_toConsumableArray(SanityChecks.massActions(actions,this.discussion.pages.length)),_toConsumableArray(SanityChecks.nominatedPagesNamespaces(this.discussion.pagesNames,expectedNamespaces)),_toConsumableArray(SanityChecks.targetsNamespaces(targets,expectedNamespaces)))}},{key:"getRedirections",value:function(options){return this.discussion.venue.expectRedirects?_globals.$.Deferred.resolve([]):_api.default.get({action:"query",titles:this.discussion.pagesNames,redirects:1,prop:"info",inprop:"talkid",format:"json",formatversion:"2"}).then(function(response){return options&&options.setExistences&&response.query.pages.forEach(function(page){var title=_globals.mw.Title.newFromText(page.title);_globals.mw.Title.exist.set(title.getPrefixedDb,!page.missing),title.canHaveTalkPage&&!title.isTalkPage&&_globals.mw.Title.exist.set(title.getTalkPage.getPrefixedDb,!!page.talkid)}),response&&response.query&&response.query.redirects||[]})}},{key:"setShowWarnings",value:function(show){this.showWarnings=!!show,this.emit("update")}},{key:"setShowRedirections",value:function(show){this.showRedirections=!!show,this.emit("update")}},{key:"resetShowAll",value:function{this.showWarnings=!0,this.showRedirections=!0,this.emit("update")}}])&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Object.defineProperty(Constructor,"prototype",{writable:!1}),SanityChecks};_globals.OO.initClass(SanityChecks),_globals.OO.mixinClass(SanityChecks,_globals.OO.EventEmitter);var _default=SanityChecks;exports.default=_default},{"../../globals":1,"../api":220,"../util":225,"core-js/modules/es.array.concat":104,"core-js/modules/es.array.filter":106,"core-js/modules/es.array.flat-map":109,"core-js/modules/es.array.for-each":110,"core-js/modules/es.array.includes":111,"core-js/modules/es.array.join":114,"core-js/modules/es.array.map":116,"core-js/modules/es.array.some":120,"core-js/modules/es.array.unscopables.flat-map":121,"core-js/modules/es.object.define-property":125,"core-js/modules/es.string.includes":134,"core-js/modules/web.dom-collections.for-each":140}],196:[function(require,module,exports){"use strict";require("core-js/modules/es.array.concat"),require("core-js/modules/es.array.filter"),require("core-js/modules/es.array.includes"),require("core-js/modules/es.array.index-of"),require("core-js/modules/es.array.map"),require("core-js/modules/es.object.define-property"),require("core-js/modules/es.string.includes"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var obj,_globals=require("../../globals"),_config=(obj=require("../config"))&&obj.__esModule?obj:{default:obj};function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}var TaskItem=function{function TaskItem(config){!function(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,TaskItem),_globals.OO.EventEmitter.call(this),this.discussion=config.discussion,this.venue=this.discussion.venue,this.result=config.result,this.options=config.options,this.pageNames=config.relaventPageNames||[],this.taskName=config.taskName,this.displayName=config.displayName,this.summary=config.summary,this.warnings=[],this.showOverflowWarnings=!1,this.errors=[],this.showOverflowErrors=!1,this.steps={total:0,completed:0,skipped:0,failed:0},this.starting=!1,this.started=!1,this.doing=!1,this.done=!1,this.aborted=!1,this.failed=!1}var Constructor,protoProps,staticProps;return Constructor=TaskItem,(protoProps=[{key:"getEditSummary",value:function(options){return((options=options||{}).prefix?options.prefix+" ":"")+(this.summary||options.short?"".concat(this.discussion.discussionPageLink,""):"".concat(this.discussion.discussionPageLink," closed as ").concat(this.result.getResultText))+" "+_config.default.script.advert}},{key:"getResolvedPageNames",value:function{return this.discussion.redirects.resolve(this.pageNames)}},{key:"getResolvedTalkpagesNames",value:function{return this.discussion.redirects.resolveTalks(this.pageNames)}},{key:"getPageResults",value:function(resultType){var _this=this;return this.result.getResultsByPage.filter(function(pageResult){return _this.pageNames.includes(pageResult.pageName)&&(!resultType||pageResult.selectedResultName===resultType)})}},{key:"setName",value:function(name){this.displayName=name,this.emit("update")}},{key:"addWarning",value:function(message){this.warnings=this.warnings.concat(message),this.emit("update")}},{key:"addError",value:function(message){this.errors=this.errors.concat(message),this.emit("update")}},{key:"setTotalSteps",value:function(count){this.steps.total=count,this.emit("update")}},{key:"trackStep",value:function(type){"failed"!==type&&"skipped"!==type&&(type="completed"),this.steps[type]++,this.emit("update")}},{key:"setPrecedingTask",value:function(task,requiredState){this.precedingTask={task:task,requiredState:requiredState},task.connect(this,{update:"onPrecedingTaskUpdate"})}},{key:"onPrecedingTaskUpdate",value:function{this.canProceed&&this.start,this.emit("update")}},{key:"canProceed",value:function{if(!this.precedingTask)return!0;var _this$precedingTask=this.precedingTask;return!!_this$precedingTask.task[_this$precedingTask.requiredState]}},{key:"start",value:function{if(this.starting)return!1;this.starting=!0,this.emit("update")}},{key:"setStarted",value:function{if(this.started)return!1;this.started=!0,this.emit("update")}},{key:"setDoing",value:function{if(this.doing)return!1;this.doing=!0,this.emit("update")}},{key:"setDone",value:function{if(this.done)return!1;0<this.steps.completed+this.steps.skipped?this.done=!0:this.failed=!0,this.emit("update")}},{key:"setAborted",value:function{if(!this.canAbort)return!1;this.aborted=!0,this.emit("update")}},{key:"setFailed",value:function{if(this.done||this.failed)return!1;this.failed=!0,this.emit("update")}},{key:"name",get:function{return this.taskName}},{key:"progress",get:function{return this.started?!(this.steps.total<=1)&&100*(this.steps.completed+this.steps.skipped)/this.steps.total:0}},{key:"showProgressBar",get:function{return!this.done&&!this.aborted&&!this.failed}},{key:"resultsByPage",get:function{return{}}},{key:"pageNamesWithModuleDocs",get:function{return this.pageNames.map(function(pageName){return"".concat(pageName).concat(0===pageName.indexOf("Module:")?"/doc":"")})}},{key:"label",get:function{var message,completedOutOfTotal="".concat(this.steps.completed,"/").concat(this.steps.total);return this.started&&0!==this.steps.total?(this.aborted&&!this.done?message=this.steps.completed?"Aborted (after completing ".concat(completedOutOfTotal,")"):"Aborted":this.failed||this.steps.failed===this.steps.total?message="Failed (completed ".concat(completedOutOfTotal,")"):this.done&&(message=this.steps.completed?"Done! (".concat(completedOutOfTotal,")"):"Skipped"+(this.steps.skipped?" (".concat(this.steps.skipped,")"):"")),message?"".concat(this.displayName,": ").concat(message):this.displayName):this.displayName}},{key:"notices",get:function{return this.aborted||this.done||this.failed?[]:this.started?0===this.steps.total?["Doing..."]:["Doing... (".concat(this.steps.completed," / ").concat(this.steps.total,")")]:["Waiting..."]}},{key:"canAbort",get:function{return!this.done&&!this.failed&&!this.aborted}}])&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Object.defineProperty(Constructor,"prototype",{writable:!1}),TaskItem};_globals.OO.initClass(TaskItem),_globals.OO.mixinClass(TaskItem,_globals.OO.EventEmitter);var _default=TaskItem;exports.default=_default},{"../../globals":1,"../config":221,"core-js/modules/es.array.concat":104,"core-js/modules/es.array.filter":106,"core-js/modules/es.array.includes":111,"core-js/modules/es.array.index-of":112,"core-js/modules/es.array.map":116,"core-js/modules/es.object.define-property":125,"core-js/modules/es.string.includes":134}],197:[function(require,module,exports){"use strict";require("core-js/modules/es.array.concat"),require("core-js/modules/es.array.every"),require("core-js/modules/es.array.filter"),require("core-js/modules/es.array.flat-map"),require("core-js/modules/es.array.for-each"),require("core-js/modules/es.array.map"),require("core-js/modules/es.array.slice"),require("core-js/modules/es.array.some"),require("core-js/modules/es.array.unscopables.flat-map"),require("core-js/modules/es.object.define-property"),require("core-js/modules/web.dom-collections.for-each"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var obj,_globals=require("../../globals"),_TaskItem=(obj=require("./TaskItem"))&&obj.__esModule?obj:{default:obj};function _toConsumableArray(arr){return function(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr)}(arr)||function(iter){if("undefined"!=typeof Symbol&&null!=iter[Symbol.iterator]||null!=iter["@@iterator"])return Array.from(iter)}(arr)||function(o,minLen){if(!o)return;if("string"==typeof o)return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}(arr)||function{throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator] method.")}}function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}var TaskList=function{function TaskList(config){!function(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,TaskList),_globals.OO.EventEmitter.call(this),_globals.OO.EmitterList.call(this),this.discussion=config.discussion,this.result=config.result,this.options=config.options,this.label=config.label||"Tasks",this.type=config.type,this.userIsSysop=config.userIsSysop,this.started=!1,this.done=!1,this.aborted=!1,this.allFailed=!1,this.result.connect(this,{update:"resetItems"}),this.options.connect(this,{update:"resetItems",itemUpdate:"resetItems"})}var Constructor,protoProps,staticProps;return Constructor=TaskList,(protoProps=[{key:"makeItemsForClose",value:function{var _this=this,resultsbyPage=this.result.getResultsByPage,tasks=[],closeDiscussionTask=new _TaskItem.default({taskName:"CloseDiscussion",discussion:this.discussion,result:this.result});tasks.push(closeDiscussionTask);var addOldXfdPageResults=resultsbyPage.filter(function(result){var optionValues=_this.options.getOptionValues(result.selectedResultName),action=optionValues&&optionValues.action;return"updatePages"===action||"redirectAndUpdate"===action||"disambiguateAndUpdate"===action||"mergeAndUpdate"===action});addOldXfdPageResults.length&&tasks.push(new _TaskItem.default({taskName:"AddOldXfd",relaventPageNames:addOldXfdPageResults.map(function(result){return result.pageName}),discussion:this.discussion,result:this.result,options:this.options}));var removeNomPageResults=resultsbyPage.filter(function(result){var optionValues=_this.options.getOptionValues(result.selectedResultName);return optionValues&&"updatePages"===optionValues.action});removeNomPageResults.length&&tasks.push(new _TaskItem.default({taskName:"RemoveNomTemplates",relaventPageNames:removeNomPageResults.map(function(result){return result.pageName}),discussion:this.discussion,result:this.result,options:this.options}));var redirectActionPageResults=resultsbyPage.filter(function(result){var optionValues=_this.options.getOptionValues(result.selectedResultName);return optionValues&&"redirectAndUpdate"===optionValues.action});if(redirectActionPageResults.length){tasks.push(new _TaskItem.default({taskName:"Redirect",relaventPageNames:redirectActionPageResults.map(function(result){return result.pageName}),discussion:this.discussion,result:this.result,options:this.options}));var notSoftRedirectPageResults=redirectActionPageResults.filter(function(result){return!result.isSoft});notSoftRedirectPageResults.length&&tasks.push(new _TaskItem.default({taskName:"RemoveCircularLinks",relaventPageNames:notSoftRedirectPageResults.map(function(result){return result.pageName}),discussion:this.discussion,result:this.result,options:this.options}))}var mergeActionPageResults=resultsbyPage.filter(function(result){var optionValues=_this.options.getOptionValues(result.selectedResultName);return optionValues&&"mergeAndUpdate"===optionValues.action});mergeActionPageResults.length&&tasks.push(new _TaskItem.default({taskName:"AddMergeTemplates",relaventPageNames:mergeActionPageResults.map(function(result){return result.pageName}),discussion:this.discussion,result:this.result,options:this.options}));var disambigPageResults=resultsbyPage.filter(function(result){var optionValues=_this.options.getOptionValues(result.selectedResultName);return optionValues&&"disambiguateAndUpdate"===optionValues.action});disambigPageResults.length&&tasks.push(new _TaskItem.default({taskName:"Disambiguate",relaventPageNames:disambigPageResults.map(function(result){return result.pageName}),discussion:this.discussion,result:this.result,options:this.options}));var deletePageResults=resultsbyPage.filter(function(result){var optionValues=_this.options.getOptionValues(result.selectedResultName);return optionValues&&"deletePages"===optionValues.action});if(deletePageResults.length){tasks.push(new _TaskItem.default({taskName:"DeletePages",relaventPageNames:deletePageResults.map(function(result){return result.pageName}),discussion:this.discussion,result:this.result,options:this.options}));var deleteTalkPageResults=deletePageResults.filter(function(result){var optionValues=_this.options.getOptionValues(result.selectedResultName);return optionValues&&optionValues.deleteTalk});deleteTalkPageResults.length&&tasks.push(new _TaskItem.default({taskName:"DeleteTalkpages",relaventPageNames:deleteTalkPageResults.map(function(result){return result.pageName}),discussion:this.discussion,result:this.result,options:this.options}));var deleteRedirPageResults=deletePageResults.filter(function(result){var optionValues=_this.options.getOptionValues(result.selectedResultName);return optionValues&&optionValues.deleteRedir});deleteRedirPageResults.length&&tasks.push(new _TaskItem.default({taskName:"DeleteRedirects",relaventPageNames:deleteRedirPageResults.map(function(result){return result.pageName}),discussion:this.discussion,result:this.result,options:this.options}));var unlinkPageResults=deletePageResults.filter(function(result){var optionValues=_this.options.getOptionValues(result.selectedResultName);return optionValues&&optionValues.unlink});if(unlinkPageResults.length&&tasks.push(new _TaskItem.default({taskName:"UnlinkBacklinks",relaventPageNames:unlinkPageResults.map(function(result){return result.pageName}),discussion:this.discussion,result:this.result,options:this.options})),deleteRedirPageResults.length&&unlinkPageResults.length){var deleteRedirTask=tasks[tasks.length-2],unlinkTask=tasks[tasks.length-1];deleteRedirTask.setPrecedingTask(unlinkTask,"doing")}}var holdingCellPageResults=resultsbyPage.filter(function(result){var optionValues=_this.options.getOptionValues(result.selectedResultName),action=optionValues&&optionValues.action;return"holdingCell"===action||"holdingCellMerge"===action});if(holdingCellPageResults.length){tasks.push(new _TaskItem.default({taskName:"AddBeingDeleted",relaventPageNames:holdingCellPageResults.map(function(result){return result.pageName}),discussion:this.discussion,result:this.result,options:this.options}),new _TaskItem.default({taskName:"AddToHoldingCell",relaventPageNames:holdingCellPageResults.map(function(result){return result.pageName}),discussion:this.discussion,result:this.result,options:this.options}));var tagTalkPageResuts=holdingCellPageResults.filter(function(result){var optionValues=_this.options.getOptionValues(result.selectedResultName);return optionValues&&optionValues.tagTalk});tagTalkPageResuts.length&&tasks.push(new _TaskItem.default({taskName:"TagTalkWithSpeedy",relaventPageNames:tagTalkPageResuts.map(function(result){return result.pageName}),discussion:this.discussion,result:this.result,options:this.options}))}return tasks.slice(1).forEach(function(task){task.precedingTask||task.setPrecedingTask(closeDiscussionTask,"done")}),tasks}},{key:"makeItemsForRelist",value:function{var _this2=this,relistInfoTask=new _TaskItem.default({taskName:"GetRelistInfo",discussion:this.discussion,result:this.result}),tasks=[relistInfoTask].concat(_toConsumableArray(this.discussion.venue.relistTasks.flatMap(function(taskName){return"UpdateNomTemplates"===taskName&&0===_this2.discussion.pages.length?[]:new _TaskItem.default({taskName:taskName,relaventPageNames:_this2.discussion.pagesNames,discussion:_this2.discussion,result:_this2.result,options:_this2.options})})));return tasks.slice(1).forEach(function(task){return task.setPrecedingTask(relistInfoTask,"done")}),tasks}},{key:"resetItems",value:function{this.clearItems,this.emit("update"),this.addItems("close"===this.type?this.makeItemsForClose:this.makeItemsForRelist),this.emit("update")}},{key:"startTasks",value:function{if(this.started)return!1;this.started=!0,this.getItems.length||this.resetItems,this.getItems[0].start,this.emit("update")}},{key:"abort",value:function{this.getItems.forEach(function(taskItem){taskItem.setAborted}),this.getItems.some(function(taskItem){return taskItem.aborted})&&this.setAborted}},{key:"setAborted",value:function{this.label="Aborted",this.aborted=!0,this.emit("update")}},{key:"setDone",value:function{this.done=!0,this.emit("update")}},{key:"setAllFailed",value:function{this.done=!0,this.allFailed=!0,this.emit("update")}},{key:"onItemUpdate",value:function{this.getItems.some(function(task){return task.aborted})?this.abort:this.getItems.every(function(task){return task.failed})?this.setAllFailed:this.getItems.every(function(task){return task.done||task.failed})&&this.setDone,this.emit("update")}},{key:"success",get:function{return this.done&&!this.allFailed}}])&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Object.defineProperty(Constructor,"prototype",{writable:!1}),TaskList};_globals.OO.initClass(TaskList),_globals.OO.mixinClass(TaskList,_globals.OO.EventEmitter),_globals.OO.mixinClass(TaskList,_globals.OO.EmitterList);var _default=TaskList;exports.default=_default},{"../../globals":1,"./TaskItem":196,"core-js/modules/es.array.concat":104,"core-js/modules/es.array.every":105,"core-js/modules/es.array.filter":106,"core-js/modules/es.array.flat-map":109,"core-js/modules/es.array.for-each":110,"core-js/modules/es.array.map":116,"core-js/modules/es.array.slice":119,"core-js/modules/es.array.some":120,"core-js/modules/es.array.unscopables.flat-map":121,"core-js/modules/es.object.define-property":125,"core-js/modules/web.dom-collections.for-each":140}],198:[function(require,module,exports){"use strict";require("core-js/modules/es.object.define-property"),require("core-js/modules/es.string.trim"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _globals=require("../../globals");function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}var UnlinkSummary=function{function UnlinkSummary(config){!function(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,UnlinkSummary),_globals.OO.EventEmitter.call(this),this.summary=config.summary||"",this.summaryErrors=[],this.parsedSummary="",this.parseErrors=[]}var Constructor,protoProps,staticProps;return Constructor=UnlinkSummary,(protoProps=[{key:"setSummary",value:function(summary){summary!==this.summary&&(this.summary=summary,this.summaryErrors=this.summaryIsValid?[]:["A reason is required"],this.emit("update"))}},{key:"setParsedSummary",value:function(parsedSummary){parsedSummary!==this.parsedSummary&&(this.parsedSummary=parsedSummary,this.parseErrors=[],this.emit("update"))}},{key:"setParseError",value:function(errorCode){this.parsedSummary="",this.parseErrors=["Preview failed: ".concat(errorCode||"unknown"," error")],this.emit("update")}},{key:"onInputEnter",value:function{this.summaryIsValid&&this.emit("inputEnter")}},{key:"summaryIsValid",get:function{return!!this.summary.trim}},{key:"value",get:function{return this.summary.trim}}])&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Object.defineProperty(Constructor,"prototype",{writable:!1}),UnlinkSummary};_globals.OO.initClass(UnlinkSummary),_globals.OO.mixinClass(UnlinkSummary,_globals.OO.EventEmitter);var _default=UnlinkSummary;exports.default=_default},{"../../globals":1,"core-js/modules/es.object.define-property":125,"core-js/modules/es.string.trim":139}],199:[function(require,module,exports){"use strict";require("core-js/modules/es.object.define-property"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _globals=require("../../globals"),_TaskItem=_interopRequireDefault(require("./TaskItem")),_Discussion=_interopRequireDefault(require("./Discussion")),_Venue=_interopRequireDefault(require("../Venue")),_UnlinkSummary=_interopRequireDefault(require("./UnlinkSummary"));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}var UnlinkWindowModel=function{function UnlinkWindowModel(config){!function(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,UnlinkWindowModel),_globals.OO.EventEmitter.call(this),this.mode="initial",this.currentPanel="summary",this.pageName=config.pageName,this.summary=new _UnlinkSummary.default({summary:config.summary}),this.task=new _TaskItem.default({taskName:"UnlinkBacklinks",relaventPageNames:[this.pageName],discussion:new _Discussion.default({venue:_Venue.default.newFromPageName(this.pageName),pages:[_globals.mw.Title.newFromText(this.pageName)]})}),this.summary.connect(this,{update:"onSummaryUpdate",inputEnter:"startTask"}),this.task.connect(this,{update:["emit","update"]})}var Constructor,protoProps,staticProps;return Constructor=UnlinkWindowModel,(protoProps=[{key:"onSummaryUpdate",value:function{this.task.summary=this.summary.value,this.emit("update")}},{key:"startTask",value:function{this.currentPanel="task",this.mode="task",this.task.start}},{key:"abortTask",value:function{this.task.setAborted}},{key:"canClose",get:function{return"summary"===this.currentPanel||!this.task.canAbort}},{key:"actionAbilities",get:function{return{start:this.summary.summaryIsValid,abort:this.task.canAbort,close:!this.task.canAbort}}}])&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Object.defineProperty(Constructor,"prototype",{writable:!1}),UnlinkWindowModel};_globals.OO.initClass(UnlinkWindowModel),_globals.OO.mixinClass(UnlinkWindowModel,_globals.OO.EventEmitter);var _default=UnlinkWindowModel;exports.default=_default},{"../../globals":1,"../Venue":203,"./Discussion":184,"./TaskItem":196,"./UnlinkSummary":198,"core-js/modules/es.object.define-property":125}],200:[function(require,module,exports){"use strict";function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}require("core-js/modules/es.array.find-index"),require("core-js/modules/es.array.slice"),require("core-js/modules/es.function.name"),require("core-js/modules/es.object.define-property"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var obj,key,value,Month=function{function Month(index){!function(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Month),this.index=index}var Constructor,protoProps,staticProps;return Constructor=Month,staticProps=[{key:"newFromMonthNumber",value:function(number){return new Month(number-1)}},{key:"newFromMonthName",value:function(monthname){var index=Month.names.findIndex(function(name){return name.toLowerCase===monthname.toLowerCase});return new Month(index)}},{key:"newFromMonthShortName",value:function(shortname){var index=Month.names.findIndex(function(name){return name.slice(0,3).toLowerCase===shortname.toLowerCase});return new Month(index)}},{key:"nameFromIndex",value:function(index){return new Month(index).name}},{key:"nameFromNumber",value:function(number){return Month.newFromMonthNumber(number).name}},{key:"shortNameFromIndex",value:function(index){return new Month(index).shortName}},{key:"shortNameFromNumber",value:function(number){return Month.newFromMonthNumber(number).shortName}},{key:"indexFromName",value:function(monthname){return Month.newFromMonthName(monthname).index}},{key:"indexFromShortName",value:function(shortName){return Month.newFromMonthShortName(shortName).index}},{key:"numberFromName",value:function(monthname,option){return Month.newFromMonthName(monthname)[option.pad?"paddedNumber":"number"]}},{key:"numberFromShortName",value:function(shortName,option){return Month.newFromMonthShortName(shortName)[option.pad?"paddedNumber":"number"]}}],(protoProps=[{key:"isValid",value:function{return"number"==typeof this.index&&0<=this.index&&this.index<=11}},{key:"name",get:function{return Month.names[this.index]}},{key:"shortName",get:function{return this.name.slice(0,3)}},{key:"number",get:function{return this.index+1}},{key:"paddedNumber",get:function{return(this.number<10?"0":"")+this.number}}])&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Object.defineProperty(Constructor,"prototype",{writable:!1}),Month};exports.default=Month,value=["January","February","March","April","May","June","July","August","September","October","November","December"],(key="names")in(obj=Month)?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value},{"core-js/modules/es.array.find-index":107,"core-js/modules/es.array.slice":119,"core-js/modules/es.function.name":123,"core-js/modules/es.object.define-property":125}],201:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _globals=require("../globals"),ShowHideTag=function{try{window.localStorage.getItem("xfdc-closedHidden")?this.isHidden=!0:this.isHidden=!1}catch(e){this.isHidden=!1}};ShowHideTag.prototype.hideClosed=function{this.isHidden=!0;try{window.localStorage.setItem("xfdc-closedHidden",!0)}catch(e){}(0,_globals.$)(".xfd-closed, .tfd-closed, #XFDcloser-showhide-hide").hide,(0,_globals.$)("#XFDcloser-showhide-show").show},ShowHideTag.prototype.showClosed=function{this.isHidden=!1;try{window.localStorage.setItem("xfdc-closedHidden","")}catch(e){}(0,_globals.$)(".xfd-closed, .tfd-closed, #XFDcloser-showhide-hide").show,(0,_globals.$)("#XFDcloser-showhide-show").hide},ShowHideTag.initialiseNewTag=function{var tag=new ShowHideTag;return(0,_globals.$)(" ").attr("id","XFDcloser-showhide").append((0,_globals.$)("<a>").attr("id","XFDcloser-showhide-hide").text("Hide closed discussions").toggle(!tag.isHidden).on("click",tag.hideClosed),(0,_globals.$)("<a>").attr("id","XFDcloser-showhide-show").text("Show closed discussions").toggle(tag.isHidden).on("click",tag.showClosed)).appendTo("body"),tag};var _default=ShowHideTag;exports.default=_default},{"../globals":1}],202:[function(require,module,exports){"use strict";require("core-js/modules/es.array.concat"),require("core-js/modules/es.array.filter"),require("core-js/modules/es.array.find"),require("core-js/modules/es.array.for-each"),require("core-js/modules/es.array.includes"),require("core-js/modules/es.array.index-of"),require("core-js/modules/es.array.map"),require("core-js/modules/es.array.slice"),require("core-js/modules/es.function.name"),require("core-js/modules/es.number.constructor"),require("core-js/modules/es.object.define-property"),require("core-js/modules/es.regexp.exec"),require("core-js/modules/es.string.includes"),require("core-js/modules/es.string.match"),require("core-js/modules/es.string.replace"),require("core-js/modules/es.string.split"),require("core-js/modules/es.string.trim"),require("core-js/modules/web.dom-collections.for-each"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _globals=require("../globals"),_util=require("./util");function _toArray(arr){return function(arr){if(Array.isArray(arr))return arr}(arr)||function(iter){if("undefined"!=typeof Symbol&&null!=iter[Symbol.iterator]||null!=iter["@@iterator"])return Array.from(iter)}(arr)||function(o,minLen){if(!o)return;if("string"==typeof o)return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}(arr)||function{throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator] method.")}}function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function _createClass(Constructor,protoProps,staticProps){return protoProps&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Object.defineProperty(Constructor,"prototype",{writable:!1}),Constructor}var obj,key,value,Parameter=function{function Parameter(name,value,wikitext){_classCallCheck(this,Parameter),this.name=name,this.value=value,this.wikitext=wikitext}return _createClass(Parameter,[{key:"isNumberedParam",get:function{return"number"==typeof this.name||/^[0-9]+$/.test(this.name)}},{key:"number",get:function{return this.isNumberedParam?Number(this.name):NaN}}],[{key:"newFromWikitext",value:function(wikitext,otherParameters){var indexOfEqualTo=wikitext.indexOf("="),indexOfOpenBraces=wikitext.indexOf("{{"),isWithoutEquals=!wikitext.includes("="),hasBracesBeforeEquals=wikitext.includes("{{")&&indexOfOpenBraces<indexOfEqualTo;if(isWithoutEquals||hasBracesBeforeEquals){for(var numbers=otherParameters.map(function(param){return param.number}),nextNumber=1;numbers.includes(nextNumber);)nextNumber++;return new Parameter(nextNumber,wikitext.trim,"|"+wikitext)}return new Parameter(wikitext.slice(0,indexOfEqualTo).trim,wikitext.slice(indexOfEqualTo+1).trim,"|"+wikitext)}}]),Parameter},Template=function{function Template(wikitext){_classCallCheck(this,Template),this.wikitext=wikitext,this.parameters=[],this.pipeStyle=" |",this.equalsStyle="=",this.endBracesStyle="}}"}return _createClass(Template,[{key:"addParam",value:function(parameter){this.parameters.push(parameter)}},{key:"getParam",value:function(paramName){return this.parameters.find(function(p){return p.name==paramName})}},{key:"getParamValue",value:function(paramName){var param=this.getParam(paramName);return param&&param.value}},{key:"setName",value:function(name){this.name=name.trim}},{key:"getTitle",value:function{return _globals.mw.Title.newFromText("Template:"+this.name)}}]),Template};exports.default=Template,value=function(wikitext,recursive){if(!wikitext)return[];for(var startIdx,strReplaceAt=function(string,index,_char){return string.slice(0,index)+_char+string.slice(index+1)},result=[],processTemplateText=function(startIdx,endIdx){for(var text=wikitext.slice(startIdx,endIdx),template=new Template("");/(\[\^\*?)\|(.*?\]\])/g.test(text);)text=text.replace(/(\[\^\*?)\|(.*?\]\])/g,"$1\x01$2");template.pipeStyle=(0,_util.mostFrequent)(text.match(/[\s\n]*\|[\s\n]*/g))||" |",template.equalsStyle=(0,_util.mostFrequent)(text.replace(/(=[^|]*)=+/g,"$1").match(/[\s\n]*=[\s\n]*/g))||"=";var endSpacing=text.match(/[\s\n]*$/);template.endBracesStyle=(endSpacing?endSpacing[0]:"")+"}}";var _text$split$map2=_toArray(text.split("|").map(function(chunk){return chunk.replace(/\x01/g,"|")})),name=_text$split$map2[0],parameterChunks=_text$split$map2.slice(1);template.setName(name),parameterChunks.forEach(function(chunk){template.addParam(Parameter.newFromWikitext(chunk,template.parameters))}),result.push(template)},n=wikitext.length,numUnclosed=0,inComment=!1,inNowiki=!1,inParameter=!1,i=0;i<n;i++)inComment||inNowiki||inParameter?"|"===wikitext[i]?wikitext=strReplaceAt(wikitext,i,"\x01"):/^-->/.test(wikitext.slice(i,i+3))?(inComment=!1,i+=2):/^<\/nowiki ?>/.test(wikitext.slice(i,i+10))?(inNowiki=!1,i+=8):"}"===wikitext[i]&&"}"===wikitext[i+1]&&"}"===wikitext[i+2]&&(inParameter=!1,i+=2):"{"===wikitext[i]&&"{"===wikitext[i+1]&&"{"===wikitext[i+2]&&"{"!==wikitext[i+3]?(inParameter=!0,i+=2):"{"===wikitext[i]&&"{"===wikitext[i+1]?(0===numUnclosed&&(startIdx=i+2),numUnclosed+=2,i++):"}"===wikitext[i]&&"}"===wikitext[i+1]?(2===numUnclosed&&processTemplateText(startIdx,i),numUnclosed-=2,i++):"|"===wikitext[i]&&2<numUnclosed?wikitext=strReplaceAt(wikitext,i,"\x01"):/^<!--/.test(wikitext.slice(i,i+4))?(inComment=!0,i+=3):/^<nowiki ?>/.test(wikitext.slice(i,i+9))&&(inNowiki=!0,i+=7);if(recursive){var subtemplates=result.filter(function(template){return/\{\{(?:.|\n)*\}\}/.test(template.wikitext.slice(2,-2))}).map(function(template){return Template.parseTemplates(template.wikitext.slice(2,-2),!0)});return result.concat.apply(result,subtemplates)}return result},(key="parseTemplates")in(obj=Template)?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value},{"../globals":1,"./util":225,"core-js/modules/es.array.concat":104,"core-js/modules/es.array.filter":106,"core-js/modules/es.array.find":108,"core-js/modules/es.array.for-each":110,"core-js/modules/es.array.includes":111,"core-js/modules/es.array.index-of":112,"core-js/modules/es.array.map":116,"core-js/modules/es.array.slice":119,"core-js/modules/es.function.name":123,"core-js/modules/es.number.constructor":124,"core-js/modules/es.object.define-property":125,"core-js/modules/es.regexp.exec":132,"core-js/modules/es.string.includes":134,"core-js/modules/es.string.match":135,"core-js/modules/es.string.replace":136,"core-js/modules/es.string.split":138,"core-js/modules/es.string.trim":139,"core-js/modules/web.dom-collections.for-each":140}],203:[function(require,module,exports){"use strict";require("core-js/modules/es.array.includes"),require("core-js/modules/es.regexp.constructor"),require("core-js/modules/es.regexp.exec"),require("core-js/modules/es.regexp.to-string"),require("core-js/modules/es.string.includes"),require("core-js/modules/es.string.match"),require("core-js/modules/es.string.replace"),require("core-js/modules/es.string.split"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _globals=require("../globals"),Venue=function(type,settings){for(var key in this.type=type,settings)this[key]=settings[key]};Venue.prototype.hasNomTemplate=function(wikitext){return new RegExp(this.regex.nomTemplate).test(wikitext)},Venue.prototype.removeNomTemplate=function(wikitext){var pattern=new RegExp(this.regex.nomTemplate),matches=wikitext.match(pattern);if(!matches)return wikitext;if(1<matches.length)throw new Error("Multiple nomination templates on page");return wikitext.replace(pattern,"")},Venue.prototype.updateNomTemplateAfterRelist=function(wikitext,today,sectionHeader){var matches=wikitext.match(this.regex.relistPattern);if(!matches)return wikitext;if(1<matches.length)throw new Error("Multiple nomination templates on page");return wikitext.replace(this.regex.relistPattern,this.wikitext.relistReplace.replace("__TODAY__",today).replace("__SECTION_HEADER__",sectionHeader))},Venue.Mfd=function{return new Venue("mfd",{path:"Wikipedia:Miscellany for deletion",subpagePath:"Wikipedia:Miscellany for deletion/",hasIndividualSubpages:!0,ns_number:null,html:{headlineouter:".mw-heading.mw-heading4",headlineinner:"h4",list:"dl",listitem:"dd"},wikitext:{closeTop:" __RESULT____TO_TARGET____RATIONALE__ __SIG__",closeBottom:"",oldXfd:"\n",mergeFrom:"\n",mergeTo:"\n",alreadyClosed:""},regex:{nomTemplate:/(?: \s*)?(?:]*}}|<span id="mfd".*?<\/span> \s*)(?:\s*<\/noinclude>)?/gi},relistTasks:["UpdateDiscussion"]})},Venue.Cfd=function{var cfdVenue=new Venue("cfd",{path:"Wikipedia:Categories for discussion/Log/",ns_number:[14],html:{headlineouter:".mw-heading.mw-heading4",headlineinner:"h4",list:"ul",listitem:"li",nthSpan:"2"},wikitext:{closeTop:" __RESULT____TO_TARGET____RATIONALE__ __SIG__",closeBottom:"",oldXfd:"\n",alreadyClosed:"\x3c!-- Template:Cfd top --\x3e",relistReplace:" full|day=__DAY__|month=__MONTH__|year=__YEAR__"},regex:{nomTemplate:/(?:.|\n)+\n*/gi,relistPattern:/ full\|day=\d\d?\|month=\w+\|year=\d{4}/gi},relistTasks:["UpdateOldLogPage","UpdateNewLogPage","UpdateNomTemplates"]});return cfdVenue.updateNomTemplateAfterRelist=function(wikitext,today){var matches=wikitext.match(cfdVenue.regex.relistPattern);if(!matches)return wikitext;if(1<matches.length)throw new Error("Multiple nomination templates on page");var todayParts=today.split(" ");return wikitext.replace(cfdVenue.regex.relistPattern,cfdVenue.wikitext.relistReplace.replace("__DAY__",todayParts[2]).replace("__MONTH__",todayParts[1]).replace("__YEAR__",todayParts[0])).replace(/'''\(?![^<]*?--\x3e)";var simple_regex=new RegExp(simple_regex_str,"g"),named_regex=new RegExp(named_regex_str,"g");/\{\{\s*(?:[Gg]iven[ _]name|[Ss]urnames?|[Nn]ickname|[Ff]irst[ _]name|[Ff]orename|[Dd]isambigN(?:ame|m)?)\s*(?:\|.*?)*?\}\}/g.test(wikitext)&&(isDab=!0);if(10===ns){var navbox_regex=new RegExp("\\{\\{[Nn]avbox(?: with collapsible groups| with columns)?\\s*\\|(?:.|\\n)*?(?:(?:\\{\\{(?:.|\\n)*?(?:(?:\\{\\{(?:.|\\n)*?\\}\\})(?:.|\\n)*?)*?\\}\\})(?:.|\\n)*?)*\\}\\}","g"),navbox_simple_regex=new RegExp("\\*+\\s*"+simple_regex_str+"[\\r\\t\\f\\v ]*\\n","g"),navbox_named_regex=new RegExp("\\*+\\s*"+named_regex_str+"[\\r\\t\\f\\v ]*\\n","g"),navboxes=wikitext.match(navbox_regex);if(navboxes)for(var replacement,jj=0;jj<navboxes.length;jj++)replacement=navboxes[jj].replace(navbox_simple_regex,"").replace(navbox_named_regex,""),wikitext=wikitext.replace(navboxes[jj],replacement)}else if(isDab){var dab_simple_regex=new RegExp("\\*+[^\\[\\]\\n\\r]*"+simple_regex_str+"[^\\[\\]\\n\\r]*\\n","g"),dab_named_regex=new RegExp("\\*+[^\\[\\]\\n\\r]*"+named_regex_str+"[^\\[\\]\\n\\r]*\\n","g");wikitext=wikitext.replace(dab_simple_regex,"").replace(dab_named_regex,"")}else{var seealso_simple_regex=new RegExp("\\*+[^\\[\\]\\n\\r]*"+simple_regex_str+"[^\\[\\]\\n\\r]*\\n","g"),seealso_named_regex=new RegExp("\\*+[^\\[\\]\\n\\r]*"+named_regex_str+"[^\\[\\]\\n\\r]*\\n","g"),seealso=wikitext.match(/==+\s*[Ss]ee [Aa]lso\s*==+\n+(?:^.*\n*)*?(?:(?===+)|$)/gm);if(seealso)for(var replacement_seealso,kk=0;kk<seealso.length;kk++)replacement_seealso=(seealso[kk]+"\n").replace(seealso_simple_regex,"").replace(seealso_named_regex,""),wikitext=wikitext.replace(seealso[kk].trim,replacement_seealso.trim)}var manual_review_regex=new RegExp("^(\\*+.*)("+simple_regex_str.replace(/([^\\])\(([^?])/g,"$1(?:$2")+"|"+named_regex_str.replace(/([^\\])\(([^?])/g,"$1(?:$2")+")(.*)$","gm");return wikitext=(wikitext=wikitext.replace(manual_review_regex,"$1$2$3")).replace(simple_regex,"$1").replace(named_regex,"$1")};var obj,_globals=require("../globals"),_Template=(obj=require("./Template"))&&obj.__esModule?obj:{default:obj}},{"../globals":1,"./Template":202,"core-js/modules/es.array.filter":106,"core-js/modules/es.array.for-each":110,"core-js/modules/es.array.includes":111,"core-js/modules/es.array.join":114,"core-js/modules/es.array.map":116,"core-js/modules/es.array.slice":119,"core-js/modules/es.array.some":120,"core-js/modules/es.function.name":123,"core-js/modules/es.number.constructor":124,"core-js/modules/es.regexp.constructor":131,"core-js/modules/es.regexp.exec":132,"core-js/modules/es.regexp.to-string":133,"core-js/modules/es.string.match":135,"core-js/modules/es.string.replace":136,"core-js/modules/es.string.trim":139,"core-js/modules/web.dom-collections.for-each":140}],225:[function(require,module,exports){"use strict";require("core-js/modules/es.array.concat"),require("core-js/modules/es.array.every"),require("core-js/modules/es.array.for-each"),require("core-js/modules/es.array.map"),require("core-js/modules/es.array.slice"),require("core-js/modules/es.function.name"),require("core-js/modules/es.number.constructor"),require("core-js/modules/es.object.keys"),require("core-js/modules/es.object.values"),require("core-js/modules/es.regexp.exec"),require("core-js/modules/es.string.replace"),require("core-js/modules/es.string.split"),require("core-js/modules/es.string.trim"),require("core-js/modules/web.dom-collections.for-each"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.uppercaseFirst=function(text){return text.slice(0,1).toUpperCase+text.slice(1)},exports.mostFrequent=function(array){if(!array||!Array.isArray(array)||0===array.length)return null;var map={},mostFreq=null;return array.forEach(function(item){map[item]=(map[item]||0)+1,(null===mostFreq||map[item]>map[mostFreq])&&(mostFreq=item)}),mostFreq},exports.cleanupVoidTemplates=exports.windowOffsetTop=exports.normalisePageName=exports.decodeHtml=exports.docToModule=exports.moduleToDoc=exports.isModule=exports.isFile=exports.timeout=exports.rejection=exports.recursiveMerge=exports.multiCheckboxMessageDialog=exports.multiButtonConfirm=exports.dateFromUserInput=exports.dateFromSubpageName=exports.dateFromSigTimestamp=exports.dateFromParts=exports.ymdDateString=exports.dmyDateString=exports.safeUnescape=exports.uniqueArray=exports.makeLink=exports.encodeForWikilinkFragment=exports.encodeForUrl=void 0;var _globals=require("../globals"),_ScrolledMessageDialog=_interopRequireDefault(require("./Components/ScrolledMessageDialog")),_Month=_interopRequireDefault(require("./Month"));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _toConsumableArray(arr){return function(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr)}(arr)||function(iter){if("undefined"!=typeof Symbol&&null!=iter[Symbol.iterator]||null!=iter["@@iterator"])return Array.from(iter)}(arr)||_unsupportedIterableToArray(arr)||function{throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator] method.")}}function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})),keys.push.apply(keys,symbols)}return keys}function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function _typeof(obj){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function _slicedToArray(arr,i){return function(arr){if(Array.isArray(arr))return arr}(arr)||function(arr,i){var _i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null==_i)return;var _s,_e,_arr=[],_n=!0,_d=!1;try{for(_i=_i.call(arr);!(_n=(_s=_i.next).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return}finally{if(_d)throw _e}}return _arr}(arr,i)||_unsupportedIterableToArray(arr,i)||function{throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator] method.")}}function _unsupportedIterableToArray(o,minLen){if(o){if("string"==typeof o)return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return"Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(o):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(o,minLen):void 0}}function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}var escapeHtml=function(string){return string.replace(/['"<>&]/g,function(_char){switch(_char){case"'":return"&#039;";case'"':return"&quot;";case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;"}})},encodeForUrl=function(text){return encodeURIComponent(String(text)).replace(/'/g,"%27").replace(/%20/g,"_").replace(/%3B/g,";").replace(/%40/g,"@").replace(/%24/g,"$").replace(/%2C/g,",").replace(/%2F/g,"/").replace(/%3A/g,":")};exports.encodeForUrl=encodeForUrl;var makeLink=function(target,text){text=text||target;var url="/wiki/"+encodeForUrl(target);return'<a href="'.concat(url,'" target="_blank">').concat(escapeHtml(text.trim),"</a>")};exports.makeLink=makeLink;exports.encodeForWikilinkFragment=function(text){return encodeForUrl(text).replace(/_/g," ")};var safeUnescape=function(text,config){return(config&&config.noEscape?text:escapeHtml(text)).replace(/&lt;(\/?pre\s?\/?)&gt;/g,"<$1>").replace(/\[\[([^|\]]*?)\|([^|\]]*?)\]\](?![^<]*?<\/pre>)/g,function(_match,linkTarget,linkText){return makeLink(linkTarget,linkText)}).replace(/\[\[([^|\]]+?)]\](?![^<]*?<\/pre>)/g,function(_match,link){return makeLink(link)}).replace(/&lt;(\/?(?:br|p|ul|li|hr|strong|em)\s?\/?)&gt;(?![^<]*?<\/pre>)/g,"<$1>").replace(/&lt;(\/?(?:br/g,"<$1>")};exports.safeUnescape=safeUnescape;exports.dmyDateString=function(date){if("Date"!==date.constructor.name)throw new Error("dmyDateString: expected a Date object, instead found ".concat(date.constructor.name));return"".concat(date.getUTCDate," ").concat(_Month.default.nameFromIndex(date.getUTCMonth)," ").concat(date.getUTCFullYear)};exports.ymdDateString=function(date){if("Date"!==date.constructor.name)throw new Error("ymdDateString: expected a Date object, instead found ".concat(date.constructor.name));return"".concat(date.getUTCFullYear," ").concat(_Month.default.nameFromIndex(date.getUTCMonth)," ").concat(date.getUTCDate)};var dateFromParts=function(year,monthName,day,time){var month=_Month.default.newFromMonthName(monthName);if(!month.isValid)return NaN;var paddedDay=Number(day)<10?"0"+day:day,iso8601DateString="".concat(year,"-").concat(month.paddedNumber,"-").concat(paddedDay,"T").concat(time||"00:01","Z");return Date.parse(iso8601DateString)&&new Date(iso8601DateString)};exports.dateFromParts=dateFromParts;exports.dateFromSigTimestamp=function(sigTimestamp){var parts=/(\d\d:\d\d), (\d{1,2}) (\w+) (\d\d\d\d) \(UTC\)/.exec(sigTimestamp);if(null===parts)return NaN;var _parts$slice2=_slicedToArray(parts.slice(1),4),time=_parts$slice2[0],day=_parts$slice2[1],monthName=_parts$slice2[2],year=_parts$slice2[3];return dateFromParts(year,monthName,day,time)};exports.dateFromSubpageName=function(subpageName){var _subpageName$split2=_slicedToArray(subpageName.split(" "),3),year=_subpageName$split2[0],monthName=_subpageName$split2[1],day=_subpageName$split2[2];return dateFromParts(year,monthName,day)};exports.dateFromUserInput=function(text){var day,monthName,year,mdyParts=/(\w+) (\d{1,2}), (\d\d\d\d)/.exec(text),dmyParts=/(\d{1,2}) (\w+) (\d{4})/.exec(text),ymdParts=/(\d{4}) (\w+) (\d{1,2})/.exec(text);switch(!0){case!!mdyParts:var _mdyParts$slice2=_slicedToArray(mdyParts.slice(1),3);monthName=_mdyParts$slice2[0],day=_mdyParts$slice2[1],year=_mdyParts$slice2[2];break;case!!dmyParts:var _dmyParts$slice2=_slicedToArray(dmyParts.slice(1),3);day=_dmyParts$slice2[0],monthName=_dmyParts$slice2[1],year=_dmyParts$slice2[2];break;case!!ymdParts:var _ymdParts$slice2=_slicedToArray(ymdParts.slice(1),3);year=_ymdParts$slice2[0],monthName=_ymdParts$slice2[1],day=_ymdParts$slice2[2];break;default:return NaN}var month=_Month.default.newFromMonthShortName(monthName.slice(0,3));return month.isValid?dateFromParts(year,month.name,day):NaN};exports.multiButtonConfirm=function(config){var htmlSnippetMessage=new _globals.OO.ui.HtmlSnippet(safeUnescape(config.message)),windowManager=new _globals.OO.ui.WindowManager,messageDialog=config.scrolled?new _ScrolledMessageDialog.default:new _globals.OO.ui.MessageDialog;return(0,_globals.$)("body").append(windowManager.$element),windowManager.addWindows([messageDialog]),windowManager.openWindow(messageDialog,{title:config.title,message:htmlSnippetMessage,actions:config.actions,size:config.size,scrollBy:config.scrolled&&windowOffsetTop}).closed.then(function(data){return windowManager.destroy,data&&data.action})};exports.multiCheckboxMessageDialog=function(config){var windowManager=new _globals.OO.ui.WindowManager,messageDialog=config.scrolled?new _ScrolledMessageDialog.default:new _globals.OO.ui.MessageDialog,selectAllCheckbox=new _globals.OO.ui.CheckboxMultioptionWidget({label:(0,_globals.$)(" Select all "),selected:config.items.every(function(item){return item.selected})});selectAllCheckbox.$element.css("margin-bottom","10px");var checkboxMultiselect=new _globals.OO.ui.CheckboxMultiselectWidget({items:config.items.map(function(item){return new _globals.OO.ui.CheckboxMultioptionWidget(item)})});return selectAllCheckbox.on("change",function(selected){checkboxMultiselect.getItems.forEach(function(item){return item.setSelected(selected)})}),(0,_globals.$)("body").append(windowManager.$element),windowManager.addWindows([messageDialog]),windowManager.openWindow(messageDialog,{title:config.title,message:(0,_globals.$)(" ").append(config.message,1<config.items.length?selectAllCheckbox.$element:null,checkboxMultiselect.$element),actions:config.actions,size:config.size,scrollBy:config.scrolled&&windowOffsetTop}).closed.then(function(data){return windowManager.destroy,{action:data&&data.action,items:checkboxMultiselect.findSelectedItemsData}})};var isPlainObject=function(obj){return!!obj&&"object"===_typeof(obj)&&obj.constructor===Object};exports.recursiveMerge=function recursiveMerge(target,source){var result={};return Object.keys(function(target){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?ownKeys(Object(source),!0).forEach(function(key){_defineProperty(target,key,source[key])}):Object.getOwnPropertyDescriptors?Object.defineProperties(target,Object.getOwnPropertyDescriptors(source)):ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))})}return target}({},target,{},source)).forEach(function(key){Array.isArray(target[key])&&Array.isArray(source[key])?result[key]=[].concat(_toConsumableArray(target[key]),_toConsumableArray(source[key])):isPlainObject(target[key])&&isPlainObject(source[key])?result[key]=recursiveMerge(target[key],source[key]):void 0===source[key]?result[key]=target[key]:result[key]=source[key]}),result};exports.rejection=function{var _$$Deferred;return(_$$Deferred=_globals.$.Deferred).reject.apply(_$$Deferred,arguments)};exports.timeout=function(delay){var deferred=_globals.$.Deferred;return setTimeout(deferred.resolve,delay),deferred.promise};exports.uniqueArray=function(array){var vals={};return array.forEach(function(val){vals["".concat(val,"___").concat(_typeof(val))]=val}),Object.values(vals)};exports.isFile=function(pageName){return 6===_globals.mw.Title.newFromText(pageName).getNamespaceId};var isModule=function(pageName){return 828===_globals.mw.Title.newFromText(pageName).getNamespaceId};exports.isModule=isModule;exports.moduleToDoc=function(pageName){return isModule(pageName)?pageName+"/doc":pageName};exports.docToModule=function(pageName){return isModule(pageName)?pageName.replace(/\/doc$/,""):pageName};exports.decodeHtml=function(t){return(0,_globals.$)(" ").html(t).text};exports.normalisePageName=function(pageName){var title=_globals.mw.Title.newFromText(pageName);if(null==title)return null;var prefixedText=title.getPrefixedText,fragment=title.getFragment;return fragment?prefixedText+"#"+fragment:prefixedText};var windowOffsetTop=function{return window.pageYOffset||(document.documentElement||document.body.parentNode||document.body).scrollTop};exports.windowOffsetTop=windowOffsetTop;exports.cleanupVoidTemplates=function(wikitext){return wikitext.replace(/\{\{subst:(?:\^|void)[^}]*\}\}/gi,"")}},{"../globals":1,"./Components/ScrolledMessageDialog":147,"./Month":200,"core-js/modules/es.array.concat":104,"core-js/modules/es.array.every":105,"core-js/modules/es.array.for-each":110,"core-js/modules/es.array.map":116,"core-js/modules/es.array.slice":119,"core-js/modules/es.function.name":123,"core-js/modules/es.number.constructor":124,"core-js/modules/es.object.keys":126,"core-js/modules/es.object.values":129,"core-js/modules/es.regexp.exec":132,"core-js/modules/es.string.replace":136,"core-js/modules/es.string.split":138,"core-js/modules/es.string.trim":139,"core-js/modules/web.dom-collections.for-each":140}],226:[function(require,module,exports){"use strict";function _typeof(obj){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}require("core-js/modules/es.array.find"),require("core-js/modules/es.array.some"),require("core-js/modules/es.object.set-prototype-of"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _globals=require("../globals"),_MainWindow=_interopRequireDefault(require("./Views/MainWindow")),_UnlinkWindow=_interopRequireDefault(require("./Views/UnlinkWindow")),_PrefsWindow=_interopRequireDefault(require("./Views/PrefsWindow"));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function _createClass(Constructor,protoProps,staticProps){return protoProps&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Object.defineProperty(Constructor,"prototype",{writable:!1}),Constructor}function _createSuper(Derived){var hasNativeReflectConstruct=function{if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function{})),!0}catch(e){return!1}};return function{var result,Super=_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return function(self,call){{if(call&&("object"===_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined")}return function(self){if(void 0!==self)return self;throw new ReferenceError("this hasn't been initialised - super hasn't been called")}(self)}(this,result)}}function _getPrototypeOf(o){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function _setPrototypeOf(o,p){return(_setPrototypeOf=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o})(o,p)}var WindowManager=function{!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),Object.defineProperty(subClass,"prototype",{writable:!1}),superClass&&_setPrototypeOf(subClass,superClass)}(WindowManager,_globals.OO.ui.WindowManager);var _super=_createSuper(WindowManager);function WindowManager(config){return _classCallCheck(this,WindowManager),_super.call(this,config)}return _createClass(WindowManager,[{key:"hasOpenWindow",value:function{var currentWindow=this.getCurrentWindow;return!(!currentWindow||!currentWindow.isOpened&&!currentWindow.isOpening)}}]),WindowManager},_default=new(function{function WindowSetManager{var factory;_classCallCheck(this,WindowSetManager),this.factory=((factory=new _globals.OO.Factory).register(_MainWindow.default),factory.register(_UnlinkWindow.default),factory.register(_PrefsWindow.default),factory),this.windowManagers=[]}return _createClass(WindowSetManager,[{key:"nextManager",value:function{var manager=this.windowManagers.find(function(windowManager){return!windowManager.hasOpenWindow});return manager||((manager=new WindowManager({factory:this.factory})).hasOpenWindow=function{var currentWindow=manager.getCurrentWindow;return!(!currentWindow||!currentWindow.isOpened&&!currentWindow.isOpening)},(0,_globals.$)(document.body).append(manager.$element),this.windowManagers.push(manager)),manager}},{key:"openWindow",value:function(win,data){return this.nextManager.openWindow(win,data)}},{key:"hasOpenWindows",value:function{return this.windowManagers.some(function(windowManager){return windowManager.hasOpenWindow})}}]),WindowSetManager});exports.default=_default},{"../globals":1,"./Views/MainWindow":205,"./Views/PrefsWindow":210,"./Views/UnlinkWindow":219,"core-js/modules/es.array.find":108,"core-js/modules/es.array.some":120,"core-js/modules/es.object.set-prototype-of":127}]},{},[143]); /* */