// ==UserScript== // @name Dollchan Extension Tools // @version 23.9.19.0 // @namespace http://www.freedollchan.org/scripts/* // @author Sthephan Shinkufag @ FreeDollChan // @copyright © Dollchan Extension Team. See the LICENSE file for license rights and limitations (MIT). // @description Doing some profit for imageboards // @icon https://raw.github.com/SthephanShinkufag/Dollchan-Extension-Tools/master/Icon.png // @updateURL https://raw.github.com/SthephanShinkufag/Dollchan-Extension-Tools/master/Dollchan_Extension_Tools.meta.js // @nocompat Chrome // @run-at document-start // @grant GM_getValue // @grant GM_setValue // @grant GM_deleteValue // @grant GM_openInTab // @grant GM_xmlhttpRequest // @grant GM.getValue // @grant GM.setValue // @grant GM.deleteValue // @grant GM.xmlHttpRequest // @grant unsafeWindow // @include * // ==/UserScript== /* eslint-disable */ (function deMainFuncOuter(localData) { (function(){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){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i 1 ? arguments[1] : undefined; var mapping = mapfn !== undefined; if (mapping) mapfn = bind(mapfn, argumentsLength > 2 ? arguments[2] : undefined); var iteratorMethod = getIteratorMethod(O); var index = 0; var length, result, step, iterator, next, value; if (iteratorMethod && !(this === $Array && isArrayIteratorMethod(iteratorMethod))) { iterator = getIterator(O, iteratorMethod); next = iterator.next; result = IS_CONSTRUCTOR ? new this() : []; for (;!(step = call(next, iterator)).done; index++) { value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value; createProperty(result, index, value); } } else { length = lengthOfArrayLike(O); result = IS_CONSTRUCTOR ? new this(length) : $Array(length); for (;length > index; index++) { value = mapping ? mapfn(O[index], index) : O[index]; createProperty(result, index, value); } } result.length = index; return result; }; },{"../internals/call-with-safe-iteration-closing":75,"../internals/create-property":89,"../internals/function-bind-context":118,"../internals/function-call":120,"../internals/get-iterator":128,"../internals/get-iterator-method":127,"../internals/is-array-iterator-method":145,"../internals/is-constructor":148,"../internals/length-of-array-like":163,"../internals/to-object":238}],68:[function(require,module,exports){ 'use strict'; var toIndexedObject = require('../internals/to-indexed-object'); var toAbsoluteIndex = require('../internals/to-absolute-index'); var lengthOfArrayLike = require('../internals/length-of-array-like'); var createMethod = function (IS_INCLUDES) { return function ($this, el, fromIndex) { var O = toIndexedObject($this); var length = lengthOfArrayLike(O); var index = toAbsoluteIndex(fromIndex, length); var value; if (IS_INCLUDES && el !== el) while (length > index) { value = O[index++]; if (value !== value) return true; } else for (;length > index; index++) { if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0; } return !IS_INCLUDES && -1; }; }; module.exports = { includes: createMethod(true), indexOf: createMethod(false) }; },{"../internals/length-of-array-like":163,"../internals/to-absolute-index":234,"../internals/to-indexed-object":235}],69:[function(require,module,exports){ 'use strict'; var bind = require('../internals/function-bind-context'); var uncurryThis = require('../internals/function-uncurry-this'); var IndexedObject = require('../internals/indexed-object'); var toObject = require('../internals/to-object'); var lengthOfArrayLike = require('../internals/length-of-array-like'); var arraySpeciesCreate = require('../internals/array-species-create'); var push = uncurryThis([].push); var createMethod = function (TYPE) { var IS_MAP = TYPE === 1; var IS_FILTER = TYPE === 2; var IS_SOME = TYPE === 3; var IS_EVERY = TYPE === 4; var IS_FIND_INDEX = TYPE === 6; var IS_FILTER_REJECT = TYPE === 7; var NO_HOLES = TYPE === 5 || IS_FIND_INDEX; return function ($this, callbackfn, that, specificCreate) { var O = toObject($this); var self = IndexedObject(O); var boundFunction = bind(callbackfn, that); var length = lengthOfArrayLike(self); var index = 0; var create = specificCreate || arraySpeciesCreate; var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_REJECT ? create($this, 0) : undefined; var value, result; for (;length > index; index++) if (NO_HOLES || index in self) { value = self[index]; result = boundFunction(value, index, O); if (TYPE) { if (IS_MAP) target[index] = result; else if (result) switch (TYPE) { case 3: return true; case 5: return value; case 6: return index; case 2: push(target, value); } else switch (TYPE) { case 4: return false; case 7: push(target, value); } } } return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target; }; }; module.exports = { forEach: createMethod(0), map: createMethod(1), filter: createMethod(2), some: createMethod(3), every: createMethod(4), find: createMethod(5), findIndex: createMethod(6), filterReject: createMethod(7) }; },{"../internals/array-species-create":74,"../internals/function-bind-context":118,"../internals/function-uncurry-this":124,"../internals/indexed-object":139,"../internals/length-of-array-like":163,"../internals/to-object":238}],70:[function(require,module,exports){ 'use strict'; var fails = require('../internals/fails'); var wellKnownSymbol = require('../internals/well-known-symbol'); var V8_VERSION = require('../internals/engine-v8-version'); var SPECIES = wellKnownSymbol('species'); module.exports = function (METHOD_NAME) { return V8_VERSION >= 51 || !fails(function () { var array = []; var constructor = array.constructor = {}; constructor[SPECIES] = function () { return { foo: 1 }; }; return array[METHOD_NAME](Boolean).foo !== 1; }); }; },{"../internals/engine-v8-version":107,"../internals/fails":114,"../internals/well-known-symbol":252}],71:[function(require,module,exports){ 'use strict'; var toAbsoluteIndex = require('../internals/to-absolute-index'); var lengthOfArrayLike = require('../internals/length-of-array-like'); var createProperty = require('../internals/create-property'); var $Array = Array; var max = Math.max; module.exports = function (O, start, end) { var length = lengthOfArrayLike(O); var k = toAbsoluteIndex(start, length); var fin = toAbsoluteIndex(end === undefined ? length : end, length); var result = $Array(max(fin - k, 0)); var n = 0; for (; k < fin; k++, n++) createProperty(result, n, O[k]); result.length = n; return result; }; },{"../internals/create-property":89,"../internals/length-of-array-like":163,"../internals/to-absolute-index":234}],72:[function(require,module,exports){ 'use strict'; var uncurryThis = require('../internals/function-uncurry-this'); module.exports = uncurryThis([].slice); },{"../internals/function-uncurry-this":124}],73:[function(require,module,exports){ 'use strict'; var isArray = require('../internals/is-array'); var isConstructor = require('../internals/is-constructor'); var isObject = require('../internals/is-object'); var wellKnownSymbol = require('../internals/well-known-symbol'); var SPECIES = wellKnownSymbol('species'); var $Array = Array; module.exports = function (originalArray) { var C; if (isArray(originalArray)) { C = originalArray.constructor; if (isConstructor(C) && (C === $Array || isArray(C.prototype))) C = undefined; else if (isObject(C)) { C = C[SPECIES]; if (C === null) C = undefined; } } return C === undefined ? $Array : C; }; },{"../internals/is-array":146,"../internals/is-constructor":148,"../internals/is-object":152,"../internals/well-known-symbol":252}],74:[function(require,module,exports){ 'use strict'; var arraySpeciesConstructor = require('../internals/array-species-constructor'); module.exports = function (originalArray, length) { return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length); }; },{"../internals/array-species-constructor":73}],75:[function(require,module,exports){ 'use strict'; var anObject = require('../internals/an-object'); var iteratorClose = require('../internals/iterator-close'); module.exports = function (iterator, fn, value, ENTRIES) { try { return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value); } catch (error) { iteratorClose(iterator, 'throw', error); } }; },{"../internals/an-object":65,"../internals/iterator-close":158}],76:[function(require,module,exports){ 'use strict'; var wellKnownSymbol = require('../internals/well-known-symbol'); var ITERATOR = wellKnownSymbol('iterator'); var SAFE_CLOSING = false; try { var called = 0; var iteratorWithReturn = { next: function () { return { done: !!called++ }; }, 'return': function () { SAFE_CLOSING = true; } }; iteratorWithReturn[ITERATOR] = function () { return this; }; Array.from(iteratorWithReturn, function () { throw 2; }); } catch (error) { } module.exports = function (exec, SKIP_CLOSING) { try { if (!SKIP_CLOSING && !SAFE_CLOSING) return false; } catch (error) { return false; } var ITERATION_SUPPORT = false; try { var object = {}; object[ITERATOR] = function () { return { next: function () { return { done: ITERATION_SUPPORT = true }; } }; }; exec(object); } catch (error) { } return ITERATION_SUPPORT; }; },{"../internals/well-known-symbol":252}],77:[function(require,module,exports){ 'use strict'; var uncurryThis = require('../internals/function-uncurry-this'); var toString = uncurryThis({}.toString); var stringSlice = uncurryThis(''.slice); module.exports = function (it) { return stringSlice(toString(it), 8, -1); }; },{"../internals/function-uncurry-this":124}],78:[function(require,module,exports){ 'use strict'; var TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support'); var isCallable = require('../internals/is-callable'); var classofRaw = require('../internals/classof-raw'); var wellKnownSymbol = require('../internals/well-known-symbol'); var TO_STRING_TAG = wellKnownSymbol('toStringTag'); var $Object = Object; var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) === 'Arguments'; var tryGet = function (it, key) { try { return it[key]; } catch (error) { } }; module.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) { var O, tag, result; return it === undefined ? 'Undefined' : it === null ? 'Null' : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag : CORRECT_ARGUMENTS ? classofRaw(O) : (result = classofRaw(O)) === 'Object' && isCallable(O.callee) ? 'Arguments' : result; }; },{"../internals/classof-raw":77,"../internals/is-callable":147,"../internals/to-string-tag-support":242,"../internals/well-known-symbol":252}],79:[function(require,module,exports){ 'use strict'; var bind = require('../internals/function-bind-context'); var call = require('../internals/function-call'); var aCallable = require('../internals/a-callable'); var aConstructor = require('../internals/a-constructor'); var isNullOrUndefined = require('../internals/is-null-or-undefined'); var iterate = require('../internals/iterate'); var push = [].push; module.exports = function from(source ) { var length = arguments.length; var mapFn = length > 1 ? arguments[1] : undefined; var mapping, array, n, boundFunction; aConstructor(this); mapping = mapFn !== undefined; if (mapping) aCallable(mapFn); if (isNullOrUndefined(source)) return new this(); array = []; if (mapping) { n = 0; boundFunction = bind(mapFn, length > 2 ? arguments[2] : undefined); iterate(source, function (nextItem) { call(push, array, boundFunction(nextItem, n++)); }); } else { iterate(source, push, { that: array }); } return new this(array); }; },{"../internals/a-callable":57,"../internals/a-constructor":58,"../internals/function-bind-context":118,"../internals/function-call":120,"../internals/is-null-or-undefined":151,"../internals/iterate":157}],80:[function(require,module,exports){ 'use strict'; var arraySlice = require('../internals/array-slice'); module.exports = function of() { return new this(arraySlice(arguments)); }; },{"../internals/array-slice":72}],81:[function(require,module,exports){ 'use strict'; var create = require('../internals/object-create'); var defineBuiltInAccessor = require('../internals/define-built-in-accessor'); var defineBuiltIns = require('../internals/define-built-ins'); var bind = require('../internals/function-bind-context'); var anInstance = require('../internals/an-instance'); var isNullOrUndefined = require('../internals/is-null-or-undefined'); var iterate = require('../internals/iterate'); var defineIterator = require('../internals/iterator-define'); var createIterResultObject = require('../internals/create-iter-result-object'); var setSpecies = require('../internals/set-species'); var DESCRIPTORS = require('../internals/descriptors'); var fastKey = require('../internals/internal-metadata').fastKey; var InternalStateModule = require('../internals/internal-state'); var setInternalState = InternalStateModule.set; var internalStateGetterFor = InternalStateModule.getterFor; module.exports = { getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) { var Constructor = wrapper(function (that, iterable) { anInstance(that, Prototype); setInternalState(that, { type: CONSTRUCTOR_NAME, index: create(null), first: undefined, last: undefined, size: 0 }); if (!DESCRIPTORS) that.size = 0; if (!isNullOrUndefined(iterable)) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP }); }); var Prototype = Constructor.prototype; var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME); var define = function (that, key, value) { var state = getInternalState(that); var entry = getEntry(that, key); var previous, index; if (entry) { entry.value = value; } else { state.last = entry = { index: index = fastKey(key, true), key: key, value: value, previous: previous = state.last, next: undefined, removed: false }; if (!state.first) state.first = entry; if (previous) previous.next = entry; if (DESCRIPTORS) state.size++; else that.size++; if (index !== 'F') state.index[index] = entry; } return that; }; var getEntry = function (that, key) { var state = getInternalState(that); var index = fastKey(key); var entry; if (index !== 'F') return state.index[index]; for (entry = state.first; entry; entry = entry.next) { if (entry.key === key) return entry; } }; defineBuiltIns(Prototype, { clear: function clear() { var that = this; var state = getInternalState(that); var data = state.index; var entry = state.first; while (entry) { entry.removed = true; if (entry.previous) entry.previous = entry.previous.next = undefined; delete data[entry.index]; entry = entry.next; } state.first = state.last = undefined; if (DESCRIPTORS) state.size = 0; else that.size = 0; }, 'delete': function (key) { var that = this; var state = getInternalState(that); var entry = getEntry(that, key); if (entry) { var next = entry.next; var prev = entry.previous; delete state.index[entry.index]; entry.removed = true; if (prev) prev.next = next; if (next) next.previous = prev; if (state.first === entry) state.first = next; if (state.last === entry) state.last = prev; if (DESCRIPTORS) state.size--; else that.size--; } return !!entry; }, forEach: function forEach(callbackfn ) { var state = getInternalState(this); var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined); var entry; while (entry = entry ? entry.next : state.first) { boundFunction(entry.value, entry.key, this); while (entry && entry.removed) entry = entry.previous; } }, has: function has(key) { return !!getEntry(this, key); } }); defineBuiltIns(Prototype, IS_MAP ? { get: function get(key) { var entry = getEntry(this, key); return entry && entry.value; }, set: function set(key, value) { return define(this, key === 0 ? 0 : key, value); } } : { add: function add(value) { return define(this, value = value === 0 ? 0 : value, value); } }); if (DESCRIPTORS) defineBuiltInAccessor(Prototype, 'size', { configurable: true, get: function () { return getInternalState(this).size; } }); return Constructor; }, setStrong: function (Constructor, CONSTRUCTOR_NAME, IS_MAP) { var ITERATOR_NAME = CONSTRUCTOR_NAME + ' Iterator'; var getInternalCollectionState = internalStateGetterFor(CONSTRUCTOR_NAME); var getInternalIteratorState = internalStateGetterFor(ITERATOR_NAME); defineIterator(Constructor, CONSTRUCTOR_NAME, function (iterated, kind) { setInternalState(this, { type: ITERATOR_NAME, target: iterated, state: getInternalCollectionState(iterated), kind: kind, last: undefined }); }, function () { var state = getInternalIteratorState(this); var kind = state.kind; var entry = state.last; while (entry && entry.removed) entry = entry.previous; if (!state.target || !(state.last = entry = entry ? entry.next : state.state.first)) { state.target = undefined; return createIterResultObject(undefined, true); } if (kind === 'keys') return createIterResultObject(entry.key, false); if (kind === 'values') return createIterResultObject(entry.value, false); return createIterResultObject([entry.key, entry.value], false); }, IS_MAP ? 'entries' : 'values', !IS_MAP, true); setSpecies(CONSTRUCTOR_NAME); } }; },{"../internals/an-instance":64,"../internals/create-iter-result-object":86,"../internals/define-built-in-accessor":90,"../internals/define-built-ins":92,"../internals/descriptors":94,"../internals/function-bind-context":118,"../internals/internal-metadata":143,"../internals/internal-state":144,"../internals/is-null-or-undefined":151,"../internals/iterate":157,"../internals/iterator-define":160,"../internals/object-create":174,"../internals/set-species":218}],82:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var global = require('../internals/global'); var uncurryThis = require('../internals/function-uncurry-this'); var isForced = require('../internals/is-forced'); var defineBuiltIn = require('../internals/define-built-in'); var InternalMetadataModule = require('../internals/internal-metadata'); var iterate = require('../internals/iterate'); var anInstance = require('../internals/an-instance'); var isCallable = require('../internals/is-callable'); var isNullOrUndefined = require('../internals/is-null-or-undefined'); var isObject = require('../internals/is-object'); var fails = require('../internals/fails'); var checkCorrectnessOfIteration = require('../internals/check-correctness-of-iteration'); var setToStringTag = require('../internals/set-to-string-tag'); var inheritIfRequired = require('../internals/inherit-if-required'); module.exports = function (CONSTRUCTOR_NAME, wrapper, common) { var IS_MAP = CONSTRUCTOR_NAME.indexOf('Map') !== -1; var IS_WEAK = CONSTRUCTOR_NAME.indexOf('Weak') !== -1; var ADDER = IS_MAP ? 'set' : 'add'; var NativeConstructor = global[CONSTRUCTOR_NAME]; var NativePrototype = NativeConstructor && NativeConstructor.prototype; var Constructor = NativeConstructor; var exported = {}; var fixMethod = function (KEY) { var uncurriedNativeMethod = uncurryThis(NativePrototype[KEY]); defineBuiltIn(NativePrototype, KEY, KEY === 'add' ? function add(value) { uncurriedNativeMethod(this, value === 0 ? 0 : value); return this; } : KEY === 'delete' ? function (key) { return IS_WEAK && !isObject(key) ? false : uncurriedNativeMethod(this, key === 0 ? 0 : key); } : KEY === 'get' ? function get(key) { return IS_WEAK && !isObject(key) ? undefined : uncurriedNativeMethod(this, key === 0 ? 0 : key); } : KEY === 'has' ? function has(key) { return IS_WEAK && !isObject(key) ? false : uncurriedNativeMethod(this, key === 0 ? 0 : key); } : function set(key, value) { uncurriedNativeMethod(this, key === 0 ? 0 : key, value); return this; } ); }; var REPLACE = isForced( CONSTRUCTOR_NAME, !isCallable(NativeConstructor) || !(IS_WEAK || NativePrototype.forEach && !fails(function () { new NativeConstructor().entries().next(); })) ); if (REPLACE) { Constructor = common.getConstructor(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER); InternalMetadataModule.enable(); } else if (isForced(CONSTRUCTOR_NAME, true)) { var instance = new Constructor(); var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) !== instance; var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); }); var ACCEPT_ITERABLES = checkCorrectnessOfIteration(function (iterable) { new NativeConstructor(iterable); }); var BUGGY_ZERO = !IS_WEAK && fails(function () { var $instance = new NativeConstructor(); var index = 5; while (index--) $instance[ADDER](index, index); return !$instance.has(-0); }); if (!ACCEPT_ITERABLES) { Constructor = wrapper(function (dummy, iterable) { anInstance(dummy, NativePrototype); var that = inheritIfRequired(new NativeConstructor(), dummy, Constructor); if (!isNullOrUndefined(iterable)) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP }); return that; }); Constructor.prototype = NativePrototype; NativePrototype.constructor = Constructor; } if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) { fixMethod('delete'); fixMethod('has'); IS_MAP && fixMethod('get'); } if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER); if (IS_WEAK && NativePrototype.clear) delete NativePrototype.clear; } exported[CONSTRUCTOR_NAME] = Constructor; $({ global: true, constructor: true, forced: Constructor !== NativeConstructor }, exported); setToStringTag(Constructor, CONSTRUCTOR_NAME); if (!IS_WEAK) common.setStrong(Constructor, CONSTRUCTOR_NAME, IS_MAP); return Constructor; }; },{"../internals/an-instance":64,"../internals/check-correctness-of-iteration":76,"../internals/define-built-in":91,"../internals/export":113,"../internals/fails":114,"../internals/function-uncurry-this":124,"../internals/global":133,"../internals/inherit-if-required":140,"../internals/internal-metadata":143,"../internals/is-callable":147,"../internals/is-forced":149,"../internals/is-null-or-undefined":151,"../internals/is-object":152,"../internals/iterate":157,"../internals/set-to-string-tag":220}],83:[function(require,module,exports){ 'use strict'; var hasOwn = require('../internals/has-own-property'); var ownKeys = require('../internals/own-keys'); var getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor'); var definePropertyModule = require('../internals/object-define-property'); module.exports = function (target, source, exceptions) { var keys = ownKeys(source); var defineProperty = definePropertyModule.f; var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f; for (var i = 0; i < keys.length; i++) { var key = keys[i]; if (!hasOwn(target, key) && !(exceptions && hasOwn(exceptions, key))) { defineProperty(target, key, getOwnPropertyDescriptor(source, key)); } } }; },{"../internals/has-own-property":134,"../internals/object-define-property":176,"../internals/object-get-own-property-descriptor":177,"../internals/own-keys":191}],84:[function(require,module,exports){ 'use strict'; var wellKnownSymbol = require('../internals/well-known-symbol'); var MATCH = wellKnownSymbol('match'); module.exports = function (METHOD_NAME) { var regexp = /./; try { '/./'[METHOD_NAME](regexp); } catch (error1) { try { regexp[MATCH] = false; return '/./'[METHOD_NAME](regexp); } catch (error2) { } } return false; }; },{"../internals/well-known-symbol":252}],85:[function(require,module,exports){ 'use strict'; var fails = require('../internals/fails'); module.exports = !fails(function () { function F() { } F.prototype.constructor = null; return Object.getPrototypeOf(new F()) !== F.prototype; }); },{"../internals/fails":114}],86:[function(require,module,exports){ 'use strict'; module.exports = function (value, done) { return { value: value, done: done }; }; },{}],87:[function(require,module,exports){ 'use strict'; var DESCRIPTORS = require('../internals/descriptors'); var definePropertyModule = require('../internals/object-define-property'); var 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) { object[key] = value; return object; }; },{"../internals/create-property-descriptor":88,"../internals/descriptors":94,"../internals/object-define-property":176}],88:[function(require,module,exports){ 'use strict'; module.exports = function (bitmap, value) { return { enumerable: !(bitmap & 1), configurable: !(bitmap & 2), writable: !(bitmap & 4), value: value }; }; },{}],89:[function(require,module,exports){ 'use strict'; var toPropertyKey = require('../internals/to-property-key'); var definePropertyModule = require('../internals/object-define-property'); var createPropertyDescriptor = require('../internals/create-property-descriptor'); module.exports = function (object, key, value) { var propertyKey = toPropertyKey(key); if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value)); else object[propertyKey] = value; }; },{"../internals/create-property-descriptor":88,"../internals/object-define-property":176,"../internals/to-property-key":240}],90:[function(require,module,exports){ 'use strict'; var makeBuiltIn = require('../internals/make-built-in'); var defineProperty = require('../internals/object-define-property'); module.exports = function (target, name, descriptor) { if (descriptor.get) makeBuiltIn(descriptor.get, name, { getter: true }); if (descriptor.set) makeBuiltIn(descriptor.set, name, { setter: true }); return defineProperty.f(target, name, descriptor); }; },{"../internals/make-built-in":164,"../internals/object-define-property":176}],91:[function(require,module,exports){ 'use strict'; var isCallable = require('../internals/is-callable'); var definePropertyModule = require('../internals/object-define-property'); var makeBuiltIn = require('../internals/make-built-in'); var defineGlobalProperty = require('../internals/define-global-property'); module.exports = function (O, key, value, options) { if (!options) options = {}; var simple = options.enumerable; var name = options.name !== undefined ? options.name : key; if (isCallable(value)) makeBuiltIn(value, name, options); if (options.global) { if (simple) O[key] = value; else defineGlobalProperty(key, value); } else { try { if (!options.unsafe) delete O[key]; else if (O[key]) simple = true; } catch (error) { } if (simple) O[key] = value; else definePropertyModule.f(O, key, { value: value, enumerable: false, configurable: !options.nonConfigurable, writable: !options.nonWritable }); } return O; }; },{"../internals/define-global-property":93,"../internals/is-callable":147,"../internals/make-built-in":164,"../internals/object-define-property":176}],92:[function(require,module,exports){ 'use strict'; var defineBuiltIn = require('../internals/define-built-in'); module.exports = function (target, src, options) { for (var key in src) defineBuiltIn(target, key, src[key], options); return target; }; },{"../internals/define-built-in":91}],93:[function(require,module,exports){ 'use strict'; var global = require('../internals/global'); var defineProperty = Object.defineProperty; module.exports = function (key, value) { try { defineProperty(global, key, { value: value, configurable: true, writable: true }); } catch (error) { global[key] = value; } return value; }; },{"../internals/global":133}],94:[function(require,module,exports){ 'use strict'; var fails = require('../internals/fails'); module.exports = !fails(function () { return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] !== 7; }); },{"../internals/fails":114}],95:[function(require,module,exports){ 'use strict'; var documentAll = typeof document == 'object' && document.all; var IS_HTMLDDA = typeof documentAll == 'undefined' && documentAll !== undefined; module.exports = { all: documentAll, IS_HTMLDDA: IS_HTMLDDA }; },{}],96:[function(require,module,exports){ 'use strict'; var global = require('../internals/global'); var isObject = require('../internals/is-object'); var document = global.document; var EXISTS = isObject(document) && isObject(document.createElement); module.exports = function (it) { return EXISTS ? document.createElement(it) : {}; }; },{"../internals/global":133,"../internals/is-object":152}],97:[function(require,module,exports){ 'use strict'; var $TypeError = TypeError; var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF; module.exports = function (it) { if (it > MAX_SAFE_INTEGER) throw $TypeError('Maximum allowed index exceeded'); return it; }; },{}],98:[function(require,module,exports){ 'use strict'; 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 }; },{}],99:[function(require,module,exports){ 'use strict'; var documentCreateElement = require('../internals/document-create-element'); var classList = documentCreateElement('span').classList; var DOMTokenListPrototype = classList && classList.constructor && classList.constructor.prototype; module.exports = DOMTokenListPrototype === Object.prototype ? undefined : DOMTokenListPrototype; },{"../internals/document-create-element":96}],100:[function(require,module,exports){ 'use strict'; var IS_DENO = require('../internals/engine-is-deno'); var IS_NODE = require('../internals/engine-is-node'); module.exports = !IS_DENO && !IS_NODE && typeof window == 'object' && typeof document == 'object'; },{"../internals/engine-is-deno":101,"../internals/engine-is-node":104}],101:[function(require,module,exports){ 'use strict'; module.exports = typeof Deno == 'object' && Deno && typeof Deno.version == 'object'; },{}],102:[function(require,module,exports){ 'use strict'; var userAgent = require('../internals/engine-user-agent'); module.exports = /ipad|iphone|ipod/i.test(userAgent) && typeof Pebble != 'undefined'; },{"../internals/engine-user-agent":106}],103:[function(require,module,exports){ 'use strict'; var userAgent = require('../internals/engine-user-agent'); module.exports = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent); },{"../internals/engine-user-agent":106}],104:[function(require,module,exports){ 'use strict'; var global = require('../internals/global'); var classof = require('../internals/classof-raw'); module.exports = classof(global.process) === 'process'; },{"../internals/classof-raw":77,"../internals/global":133}],105:[function(require,module,exports){ 'use strict'; var userAgent = require('../internals/engine-user-agent'); module.exports = /web0s(?!.*chrome)/i.test(userAgent); },{"../internals/engine-user-agent":106}],106:[function(require,module,exports){ 'use strict'; module.exports = typeof navigator != 'undefined' && String(navigator.userAgent) || ''; },{}],107:[function(require,module,exports){ 'use strict'; var global = require('../internals/global'); var userAgent = require('../internals/engine-user-agent'); var process = global.process; var Deno = global.Deno; var versions = process && process.versions || Deno && Deno.version; var v8 = versions && versions.v8; var match, version; if (v8) { match = v8.split('.'); version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]); } if (!version && userAgent) { match = userAgent.match(/Edge\/(\d+)/); if (!match || match[1] >= 74) { match = userAgent.match(/Chrome\/(\d+)/); if (match) version = +match[1]; } } module.exports = version; },{"../internals/engine-user-agent":106,"../internals/global":133}],108:[function(require,module,exports){ 'use strict'; var global = require('../internals/global'); var uncurryThis = require('../internals/function-uncurry-this'); module.exports = function (CONSTRUCTOR, METHOD) { return uncurryThis(global[CONSTRUCTOR].prototype[METHOD]); }; },{"../internals/function-uncurry-this":124,"../internals/global":133}],109:[function(require,module,exports){ 'use strict'; module.exports = [ 'constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf' ]; },{}],110:[function(require,module,exports){ 'use strict'; var uncurryThis = require('../internals/function-uncurry-this'); var $Error = Error; var replace = uncurryThis(''.replace); var TEST = (function (arg) { return String(new $Error(arg).stack); })('zxcasd'); var V8_OR_CHAKRA_STACK_ENTRY = /\n\s*at [^:]*:[^\n]*/; var IS_V8_OR_CHAKRA_STACK = V8_OR_CHAKRA_STACK_ENTRY.test(TEST); module.exports = function (stack, dropEntries) { if (IS_V8_OR_CHAKRA_STACK && typeof stack == 'string' && !$Error.prepareStackTrace) { while (dropEntries--) stack = replace(stack, V8_OR_CHAKRA_STACK_ENTRY, ''); } return stack; }; },{"../internals/function-uncurry-this":124}],111:[function(require,module,exports){ 'use strict'; var createNonEnumerableProperty = require('../internals/create-non-enumerable-property'); var clearErrorStack = require('../internals/error-stack-clear'); var ERROR_STACK_INSTALLABLE = require('../internals/error-stack-installable'); var captureStackTrace = Error.captureStackTrace; module.exports = function (error, C, stack, dropEntries) { if (ERROR_STACK_INSTALLABLE) { if (captureStackTrace) captureStackTrace(error, C); else createNonEnumerableProperty(error, 'stack', clearErrorStack(stack, dropEntries)); } }; },{"../internals/create-non-enumerable-property":87,"../internals/error-stack-clear":110,"../internals/error-stack-installable":112}],112:[function(require,module,exports){ 'use strict'; var fails = require('../internals/fails'); var createPropertyDescriptor = require('../internals/create-property-descriptor'); module.exports = !fails(function () { var error = new Error('a'); if (!('stack' in error)) return true; Object.defineProperty(error, 'stack', createPropertyDescriptor(1, 7)); return error.stack !== 7; }); },{"../internals/create-property-descriptor":88,"../internals/fails":114}],113:[function(require,module,exports){ 'use strict'; var global = require('../internals/global'); var getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f; var createNonEnumerableProperty = require('../internals/create-non-enumerable-property'); var defineBuiltIn = require('../internals/define-built-in'); var defineGlobalProperty = require('../internals/define-global-property'); var copyConstructorProperties = require('../internals/copy-constructor-properties'); var isForced = require('../internals/is-forced'); module.exports = function (options, source) { var TARGET = options.target; var GLOBAL = options.global; var STATIC = options.stat; var FORCED, target, key, targetProperty, sourceProperty, descriptor; if (GLOBAL) { target = global; } else if (STATIC) { target = global[TARGET] || defineGlobalProperty(TARGET, {}); } else { target = (global[TARGET] || {}).prototype; } if (target) for (key in source) { sourceProperty = source[key]; if (options.dontCallGetSet) { descriptor = getOwnPropertyDescriptor(target, key); targetProperty = descriptor && descriptor.value; } else targetProperty = target[key]; FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced); if (!FORCED && targetProperty !== undefined) { if (typeof sourceProperty == typeof targetProperty) continue; copyConstructorProperties(sourceProperty, targetProperty); } if (options.sham || (targetProperty && targetProperty.sham)) { createNonEnumerableProperty(sourceProperty, 'sham', true); } defineBuiltIn(target, key, sourceProperty, options); } }; },{"../internals/copy-constructor-properties":83,"../internals/create-non-enumerable-property":87,"../internals/define-built-in":91,"../internals/define-global-property":93,"../internals/global":133,"../internals/is-forced":149,"../internals/object-get-own-property-descriptor":177}],114:[function(require,module,exports){ 'use strict'; module.exports = function (exec) { try { return !!exec(); } catch (error) { return true; } }; },{}],115:[function(require,module,exports){ 'use strict'; require('../modules/es.regexp.exec'); var uncurryThis = require('../internals/function-uncurry-this-clause'); var defineBuiltIn = require('../internals/define-built-in'); var regexpExec = require('../internals/regexp-exec'); var fails = require('../internals/fails'); var wellKnownSymbol = require('../internals/well-known-symbol'); var createNonEnumerableProperty = require('../internals/create-non-enumerable-property'); var SPECIES = wellKnownSymbol('species'); var RegExpPrototype = RegExp.prototype; module.exports = function (KEY, exec, FORCED, SHAM) { var SYMBOL = wellKnownSymbol(KEY); var DELEGATES_TO_SYMBOL = !fails(function () { var O = {}; O[SYMBOL] = function () { return 7; }; return ''[KEY](O) !== 7; }); var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () { var execCalled = false; var re = /a/; if (KEY === 'split') { re = {}; re.constructor = {}; re.constructor[SPECIES] = function () { return re; }; re.flags = ''; re[SYMBOL] = /./[SYMBOL]; } re.exec = function () { execCalled = true; return null; }; re[SYMBOL](''); return !execCalled; }); if ( !DELEGATES_TO_SYMBOL || !DELEGATES_TO_EXEC || FORCED ) { var uncurriedNativeRegExpMethod = uncurryThis(/./[SYMBOL]); var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) { var uncurriedNativeMethod = uncurryThis(nativeMethod); var $exec = regexp.exec; if ($exec === regexpExec || $exec === RegExpPrototype.exec) { if (DELEGATES_TO_SYMBOL && !forceStringMethod) { return { done: true, value: uncurriedNativeRegExpMethod(regexp, str, arg2) }; } return { done: true, value: uncurriedNativeMethod(str, regexp, arg2) }; } return { done: false }; }); defineBuiltIn(String.prototype, KEY, methods[0]); defineBuiltIn(RegExpPrototype, SYMBOL, methods[1]); } if (SHAM) createNonEnumerableProperty(RegExpPrototype[SYMBOL], 'sham', true); }; },{"../internals/create-non-enumerable-property":87,"../internals/define-built-in":91,"../internals/fails":114,"../internals/function-uncurry-this-clause":123,"../internals/regexp-exec":200,"../internals/well-known-symbol":252,"../modules/es.regexp.exec":279}],116:[function(require,module,exports){ 'use strict'; var fails = require('../internals/fails'); module.exports = !fails(function () { return Object.isExtensible(Object.preventExtensions({})); }); },{"../internals/fails":114}],117:[function(require,module,exports){ 'use strict'; var NATIVE_BIND = require('../internals/function-bind-native'); var FunctionPrototype = Function.prototype; var apply = FunctionPrototype.apply; var call = FunctionPrototype.call; module.exports = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND ? call.bind(apply) : function () { return call.apply(apply, arguments); }); },{"../internals/function-bind-native":119}],118:[function(require,module,exports){ 'use strict'; var uncurryThis = require('../internals/function-uncurry-this-clause'); var aCallable = require('../internals/a-callable'); var NATIVE_BIND = require('../internals/function-bind-native'); var bind = uncurryThis(uncurryThis.bind); module.exports = function (fn, that) { aCallable(fn); return that === undefined ? fn : NATIVE_BIND ? bind(fn, that) : function () { return fn.apply(that, arguments); }; }; },{"../internals/a-callable":57,"../internals/function-bind-native":119,"../internals/function-uncurry-this-clause":123}],119:[function(require,module,exports){ 'use strict'; var fails = require('../internals/fails'); module.exports = !fails(function () { var test = (function () { }).bind(); return typeof test != 'function' || test.hasOwnProperty('prototype'); }); },{"../internals/fails":114}],120:[function(require,module,exports){ 'use strict'; var NATIVE_BIND = require('../internals/function-bind-native'); var call = Function.prototype.call; module.exports = NATIVE_BIND ? call.bind(call) : function () { return call.apply(call, arguments); }; },{"../internals/function-bind-native":119}],121:[function(require,module,exports){ 'use strict'; var DESCRIPTORS = require('../internals/descriptors'); var hasOwn = require('../internals/has-own-property'); var FunctionPrototype = Function.prototype; var getDescriptor = DESCRIPTORS && Object.getOwnPropertyDescriptor; var EXISTS = hasOwn(FunctionPrototype, 'name'); var PROPER = EXISTS && (function something() { }).name === 'something'; var CONFIGURABLE = EXISTS && (!DESCRIPTORS || (DESCRIPTORS && getDescriptor(FunctionPrototype, 'name').configurable)); module.exports = { EXISTS: EXISTS, PROPER: PROPER, CONFIGURABLE: CONFIGURABLE }; },{"../internals/descriptors":94,"../internals/has-own-property":134}],122:[function(require,module,exports){ 'use strict'; var uncurryThis = require('../internals/function-uncurry-this'); var aCallable = require('../internals/a-callable'); module.exports = function (object, key, method) { try { return uncurryThis(aCallable(Object.getOwnPropertyDescriptor(object, key)[method])); } catch (error) { } }; },{"../internals/a-callable":57,"../internals/function-uncurry-this":124}],123:[function(require,module,exports){ 'use strict'; var classofRaw = require('../internals/classof-raw'); var uncurryThis = require('../internals/function-uncurry-this'); module.exports = function (fn) { if (classofRaw(fn) === 'Function') return uncurryThis(fn); }; },{"../internals/classof-raw":77,"../internals/function-uncurry-this":124}],124:[function(require,module,exports){ 'use strict'; var NATIVE_BIND = require('../internals/function-bind-native'); var FunctionPrototype = Function.prototype; var call = FunctionPrototype.call; var uncurryThisWithBind = NATIVE_BIND && FunctionPrototype.bind.bind(call, call); module.exports = NATIVE_BIND ? uncurryThisWithBind : function (fn) { return function () { return call.apply(fn, arguments); }; }; },{"../internals/function-bind-native":119}],125:[function(require,module,exports){ 'use strict'; var global = require('../internals/global'); var isCallable = require('../internals/is-callable'); var aFunction = function (argument) { return isCallable(argument) ? argument : undefined; }; module.exports = function (namespace, method) { return arguments.length < 2 ? aFunction(global[namespace]) : global[namespace] && global[namespace][method]; }; },{"../internals/global":133,"../internals/is-callable":147}],126:[function(require,module,exports){ 'use strict'; module.exports = function (obj) { return { iterator: obj, next: obj.next, done: false }; }; },{}],127:[function(require,module,exports){ 'use strict'; var classof = require('../internals/classof'); var getMethod = require('../internals/get-method'); var isNullOrUndefined = require('../internals/is-null-or-undefined'); var Iterators = require('../internals/iterators'); var wellKnownSymbol = require('../internals/well-known-symbol'); var ITERATOR = wellKnownSymbol('iterator'); module.exports = function (it) { if (!isNullOrUndefined(it)) return getMethod(it, ITERATOR) || getMethod(it, '@@iterator') || Iterators[classof(it)]; }; },{"../internals/classof":78,"../internals/get-method":130,"../internals/is-null-or-undefined":151,"../internals/iterators":162,"../internals/well-known-symbol":252}],128:[function(require,module,exports){ 'use strict'; var call = require('../internals/function-call'); var aCallable = require('../internals/a-callable'); var anObject = require('../internals/an-object'); var tryToString = require('../internals/try-to-string'); var getIteratorMethod = require('../internals/get-iterator-method'); var $TypeError = TypeError; module.exports = function (argument, usingIterator) { var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator; if (aCallable(iteratorMethod)) return anObject(call(iteratorMethod, argument)); throw new $TypeError(tryToString(argument) + ' is not iterable'); }; },{"../internals/a-callable":57,"../internals/an-object":65,"../internals/function-call":120,"../internals/get-iterator-method":127,"../internals/try-to-string":244}],129:[function(require,module,exports){ 'use strict'; var uncurryThis = require('../internals/function-uncurry-this'); var isArray = require('../internals/is-array'); var isCallable = require('../internals/is-callable'); var classof = require('../internals/classof-raw'); var toString = require('../internals/to-string'); var push = uncurryThis([].push); module.exports = function (replacer) { if (isCallable(replacer)) return replacer; if (!isArray(replacer)) return; var rawLength = replacer.length; var keys = []; for (var i = 0; i < rawLength; i++) { var element = replacer[i]; if (typeof element == 'string') push(keys, element); else if (typeof element == 'number' || classof(element) === 'Number' || classof(element) === 'String') push(keys, toString(element)); } var keysLength = keys.length; var root = true; return function (key, value) { if (root) { root = false; return value; } if (isArray(this)) return value; for (var j = 0; j < keysLength; j++) if (keys[j] === key) return value; }; }; },{"../internals/classof-raw":77,"../internals/function-uncurry-this":124,"../internals/is-array":146,"../internals/is-callable":147,"../internals/to-string":243}],130:[function(require,module,exports){ 'use strict'; var aCallable = require('../internals/a-callable'); var isNullOrUndefined = require('../internals/is-null-or-undefined'); module.exports = function (V, P) { var func = V[P]; return isNullOrUndefined(func) ? undefined : aCallable(func); }; },{"../internals/a-callable":57,"../internals/is-null-or-undefined":151}],131:[function(require,module,exports){ 'use strict'; var aCallable = require('../internals/a-callable'); var anObject = require('../internals/an-object'); var call = require('../internals/function-call'); var toIntegerOrInfinity = require('../internals/to-integer-or-infinity'); var getIteratorDirect = require('../internals/get-iterator-direct'); var INVALID_SIZE = 'Invalid size'; var $RangeError = RangeError; var $TypeError = TypeError; var max = Math.max; var SetRecord = function (set, size, has, keys) { this.set = set; this.size = size; this.has = has; this.keys = keys; }; SetRecord.prototype = { getIterator: function () { return getIteratorDirect(anObject(call(this.keys, this.set))); }, includes: function (it) { return call(this.has, this.set, it); } }; module.exports = function (obj) { anObject(obj); var numSize = +obj.size; if (numSize !== numSize) throw new $TypeError(INVALID_SIZE); var intSize = toIntegerOrInfinity(numSize); if (intSize < 0) throw new $RangeError(INVALID_SIZE); return new SetRecord( obj, max(intSize, 0), aCallable(obj.has), aCallable(obj.keys) ); }; },{"../internals/a-callable":57,"../internals/an-object":65,"../internals/function-call":120,"../internals/get-iterator-direct":126,"../internals/to-integer-or-infinity":236}],132:[function(require,module,exports){ 'use strict'; var uncurryThis = require('../internals/function-uncurry-this'); var toObject = require('../internals/to-object'); var floor = Math.floor; var charAt = uncurryThis(''.charAt); var replace = uncurryThis(''.replace); var stringSlice = uncurryThis(''.slice); var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g; var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g; module.exports = function (matched, str, position, captures, namedCaptures, replacement) { var tailPos = position + matched.length; var m = captures.length; var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED; if (namedCaptures !== undefined) { namedCaptures = toObject(namedCaptures); symbols = SUBSTITUTION_SYMBOLS; } return replace(replacement, symbols, function (match, ch) { var capture; switch (charAt(ch, 0)) { case '$': return '$'; case '&': return matched; case '`': return stringSlice(str, 0, position); case "'": return stringSlice(str, tailPos); case '<': capture = namedCaptures[stringSlice(ch, 1, -1)]; break; default: var n = +ch; if (n === 0) return match; if (n > m) { var f = floor(n / 10); if (f === 0) return match; if (f <= m) return captures[f - 1] === undefined ? charAt(ch, 1) : captures[f - 1] + charAt(ch, 1); return match; } capture = captures[n - 1]; } return capture === undefined ? '' : capture; }); }; },{"../internals/function-uncurry-this":124,"../internals/to-object":238}],133:[function(require,module,exports){ (function (global){(function (){ 'use strict'; var check = function (it) { return it && it.Math === Math && it; }; module.exports = check(typeof globalThis == 'object' && globalThis) || check(typeof window == 'object' && window) || check(typeof self == 'object' && self) || check(typeof global == 'object' && global) || (function () { return this; })() || this || Function('return this')(); }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{}],134:[function(require,module,exports){ 'use strict'; var uncurryThis = require('../internals/function-uncurry-this'); var toObject = require('../internals/to-object'); var hasOwnProperty = uncurryThis({}.hasOwnProperty); module.exports = Object.hasOwn || function hasOwn(it, key) { return hasOwnProperty(toObject(it), key); }; },{"../internals/function-uncurry-this":124,"../internals/to-object":238}],135:[function(require,module,exports){ 'use strict'; module.exports = {}; },{}],136:[function(require,module,exports){ 'use strict'; module.exports = function (a, b) { try { arguments.length === 1 ? console.error(a) : console.error(a, b); } catch (error) { } }; },{}],137:[function(require,module,exports){ 'use strict'; var getBuiltIn = require('../internals/get-built-in'); module.exports = getBuiltIn('document', 'documentElement'); },{"../internals/get-built-in":125}],138:[function(require,module,exports){ 'use strict'; var DESCRIPTORS = require('../internals/descriptors'); var fails = require('../internals/fails'); var createElement = require('../internals/document-create-element'); module.exports = !DESCRIPTORS && !fails(function () { return Object.defineProperty(createElement('div'), 'a', { get: function () { return 7; } }).a !== 7; }); },{"../internals/descriptors":94,"../internals/document-create-element":96,"../internals/fails":114}],139:[function(require,module,exports){ 'use strict'; var uncurryThis = require('../internals/function-uncurry-this'); var fails = require('../internals/fails'); var classof = require('../internals/classof-raw'); var $Object = Object; var split = uncurryThis(''.split); module.exports = fails(function () { return !$Object('z').propertyIsEnumerable(0); }) ? function (it) { return classof(it) === 'String' ? split(it, '') : $Object(it); } : $Object; },{"../internals/classof-raw":77,"../internals/fails":114,"../internals/function-uncurry-this":124}],140:[function(require,module,exports){ 'use strict'; var isCallable = require('../internals/is-callable'); var isObject = require('../internals/is-object'); var setPrototypeOf = require('../internals/object-set-prototype-of'); module.exports = function ($this, dummy, Wrapper) { var NewTarget, NewTargetPrototype; if ( setPrototypeOf && isCallable(NewTarget = dummy.constructor) && NewTarget !== Wrapper && isObject(NewTargetPrototype = NewTarget.prototype) && NewTargetPrototype !== Wrapper.prototype ) setPrototypeOf($this, NewTargetPrototype); return $this; }; },{"../internals/is-callable":147,"../internals/is-object":152,"../internals/object-set-prototype-of":187}],141:[function(require,module,exports){ 'use strict'; var uncurryThis = require('../internals/function-uncurry-this'); var isCallable = require('../internals/is-callable'); var store = require('../internals/shared-store'); var functionToString = uncurryThis(Function.toString); if (!isCallable(store.inspectSource)) { store.inspectSource = function (it) { return functionToString(it); }; } module.exports = store.inspectSource; },{"../internals/function-uncurry-this":124,"../internals/is-callable":147,"../internals/shared-store":223}],142:[function(require,module,exports){ 'use strict'; var isObject = require('../internals/is-object'); var createNonEnumerableProperty = require('../internals/create-non-enumerable-property'); module.exports = function (O, options) { if (isObject(options) && 'cause' in options) { createNonEnumerableProperty(O, 'cause', options.cause); } }; },{"../internals/create-non-enumerable-property":87,"../internals/is-object":152}],143:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var uncurryThis = require('../internals/function-uncurry-this'); var hiddenKeys = require('../internals/hidden-keys'); var isObject = require('../internals/is-object'); var hasOwn = require('../internals/has-own-property'); var defineProperty = require('../internals/object-define-property').f; var getOwnPropertyNamesModule = require('../internals/object-get-own-property-names'); var getOwnPropertyNamesExternalModule = require('../internals/object-get-own-property-names-external'); var isExtensible = require('../internals/object-is-extensible'); var uid = require('../internals/uid'); var FREEZING = require('../internals/freezing'); var REQUIRED = false; var METADATA = uid('meta'); var id = 0; var setMetadata = function (it) { defineProperty(it, METADATA, { value: { objectID: 'O' + id++, weakData: {} } }); }; var fastKey = function (it, create) { if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it; if (!hasOwn(it, METADATA)) { if (!isExtensible(it)) return 'F'; if (!create) return 'E'; setMetadata(it); } return it[METADATA].objectID; }; var getWeakData = function (it, create) { if (!hasOwn(it, METADATA)) { if (!isExtensible(it)) return true; if (!create) return false; setMetadata(it); } return it[METADATA].weakData; }; var onFreeze = function (it) { if (FREEZING && REQUIRED && isExtensible(it) && !hasOwn(it, METADATA)) setMetadata(it); return it; }; var enable = function () { meta.enable = function () { }; REQUIRED = true; var getOwnPropertyNames = getOwnPropertyNamesModule.f; var splice = uncurryThis([].splice); var test = {}; test[METADATA] = 1; if (getOwnPropertyNames(test).length) { getOwnPropertyNamesModule.f = function (it) { var result = getOwnPropertyNames(it); for (var i = 0, length = result.length; i < length; i++) { if (result[i] === METADATA) { splice(result, i, 1); break; } } return result; }; $({ target: 'Object', stat: true, forced: true }, { getOwnPropertyNames: getOwnPropertyNamesExternalModule.f }); } }; var meta = module.exports = { enable: enable, fastKey: fastKey, getWeakData: getWeakData, onFreeze: onFreeze }; hiddenKeys[METADATA] = true; },{"../internals/export":113,"../internals/freezing":116,"../internals/function-uncurry-this":124,"../internals/has-own-property":134,"../internals/hidden-keys":135,"../internals/is-object":152,"../internals/object-define-property":176,"../internals/object-get-own-property-names":179,"../internals/object-get-own-property-names-external":178,"../internals/object-is-extensible":182,"../internals/uid":245}],144:[function(require,module,exports){ 'use strict'; var NATIVE_WEAK_MAP = require('../internals/weak-map-basic-detection'); var global = require('../internals/global'); var isObject = require('../internals/is-object'); var createNonEnumerableProperty = require('../internals/create-non-enumerable-property'); var hasOwn = require('../internals/has-own-property'); var shared = require('../internals/shared-store'); var sharedKey = require('../internals/shared-key'); var hiddenKeys = require('../internals/hidden-keys'); var OBJECT_ALREADY_INITIALIZED = 'Object already initialized'; var TypeError = global.TypeError; var WeakMap = global.WeakMap; var set, get, has; var enforce = function (it) { return has(it) ? get(it) : set(it, {}); }; var getterFor = function (TYPE) { return function (it) { var state; if (!isObject(it) || (state = get(it)).type !== TYPE) { throw new TypeError('Incompatible receiver, ' + TYPE + ' required'); } return state; }; }; if (NATIVE_WEAK_MAP || shared.state) { var store = shared.state || (shared.state = new WeakMap()); store.get = store.get; store.has = store.has; store.set = store.set; set = function (it, metadata) { if (store.has(it)) throw new TypeError(OBJECT_ALREADY_INITIALIZED); metadata.facade = it; store.set(it, metadata); return metadata; }; get = function (it) { return store.get(it) || {}; }; has = function (it) { return store.has(it); }; } else { var STATE = sharedKey('state'); hiddenKeys[STATE] = true; set = function (it, metadata) { if (hasOwn(it, STATE)) throw new TypeError(OBJECT_ALREADY_INITIALIZED); metadata.facade = it; createNonEnumerableProperty(it, STATE, metadata); return metadata; }; get = function (it) { return hasOwn(it, STATE) ? it[STATE] : {}; }; has = function (it) { return hasOwn(it, STATE); }; } module.exports = { set: set, get: get, has: has, enforce: enforce, getterFor: getterFor }; },{"../internals/create-non-enumerable-property":87,"../internals/global":133,"../internals/has-own-property":134,"../internals/hidden-keys":135,"../internals/is-object":152,"../internals/shared-key":222,"../internals/shared-store":223,"../internals/weak-map-basic-detection":249}],145:[function(require,module,exports){ 'use strict'; var wellKnownSymbol = require('../internals/well-known-symbol'); var Iterators = require('../internals/iterators'); var ITERATOR = wellKnownSymbol('iterator'); var ArrayPrototype = Array.prototype; module.exports = function (it) { return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it); }; },{"../internals/iterators":162,"../internals/well-known-symbol":252}],146:[function(require,module,exports){ 'use strict'; var classof = require('../internals/classof-raw'); module.exports = Array.isArray || function isArray(argument) { return classof(argument) === 'Array'; }; },{"../internals/classof-raw":77}],147:[function(require,module,exports){ 'use strict'; var $documentAll = require('../internals/document-all'); var documentAll = $documentAll.all; module.exports = $documentAll.IS_HTMLDDA ? function (argument) { return typeof argument == 'function' || argument === documentAll; } : function (argument) { return typeof argument == 'function'; }; },{"../internals/document-all":95}],148:[function(require,module,exports){ 'use strict'; var uncurryThis = require('../internals/function-uncurry-this'); var fails = require('../internals/fails'); var isCallable = require('../internals/is-callable'); var classof = require('../internals/classof'); var getBuiltIn = require('../internals/get-built-in'); var inspectSource = require('../internals/inspect-source'); var noop = function () { }; var empty = []; var construct = getBuiltIn('Reflect', 'construct'); var constructorRegExp = /^\s*(?:class|function)\b/; var exec = uncurryThis(constructorRegExp.exec); var INCORRECT_TO_STRING = !constructorRegExp.test(noop); var isConstructorModern = function isConstructor(argument) { if (!isCallable(argument)) return false; try { construct(noop, empty, argument); return true; } catch (error) { return false; } }; var isConstructorLegacy = function isConstructor(argument) { if (!isCallable(argument)) return false; switch (classof(argument)) { case 'AsyncFunction': case 'GeneratorFunction': case 'AsyncGeneratorFunction': return false; } try { return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument)); } catch (error) { return true; } }; isConstructorLegacy.sham = true; module.exports = !construct || fails(function () { var called; return isConstructorModern(isConstructorModern.call) || !isConstructorModern(Object) || !isConstructorModern(function () { called = true; }) || called; }) ? isConstructorLegacy : isConstructorModern; },{"../internals/classof":78,"../internals/fails":114,"../internals/function-uncurry-this":124,"../internals/get-built-in":125,"../internals/inspect-source":141,"../internals/is-callable":147}],149:[function(require,module,exports){ 'use strict'; var fails = require('../internals/fails'); var isCallable = require('../internals/is-callable'); var replacement = /#|\.prototype\./; var isForced = function (feature, detection) { var value = data[normalize(feature)]; return value === POLYFILL ? true : value === NATIVE ? false : isCallable(detection) ? fails(detection) : !!detection; }; var normalize = isForced.normalize = function (string) { return String(string).replace(replacement, '.').toLowerCase(); }; var data = isForced.data = {}; var NATIVE = isForced.NATIVE = 'N'; var POLYFILL = isForced.POLYFILL = 'P'; module.exports = isForced; },{"../internals/fails":114,"../internals/is-callable":147}],150:[function(require,module,exports){ 'use strict'; var classof = require('../internals/classof'); var hasOwn = require('../internals/has-own-property'); var isNullOrUndefined = require('../internals/is-null-or-undefined'); var wellKnownSymbol = require('../internals/well-known-symbol'); var Iterators = require('../internals/iterators'); var ITERATOR = wellKnownSymbol('iterator'); var $Object = Object; module.exports = function (it) { if (isNullOrUndefined(it)) return false; var O = $Object(it); return O[ITERATOR] !== undefined || '@@iterator' in O || hasOwn(Iterators, classof(O)); }; },{"../internals/classof":78,"../internals/has-own-property":134,"../internals/is-null-or-undefined":151,"../internals/iterators":162,"../internals/well-known-symbol":252}],151:[function(require,module,exports){ 'use strict'; module.exports = function (it) { return it === null || it === undefined; }; },{}],152:[function(require,module,exports){ 'use strict'; var isCallable = require('../internals/is-callable'); var $documentAll = require('../internals/document-all'); var documentAll = $documentAll.all; module.exports = $documentAll.IS_HTMLDDA ? function (it) { return typeof it == 'object' ? it !== null : isCallable(it) || it === documentAll; } : function (it) { return typeof it == 'object' ? it !== null : isCallable(it); }; },{"../internals/document-all":95,"../internals/is-callable":147}],153:[function(require,module,exports){ 'use strict'; module.exports = false; },{}],154:[function(require,module,exports){ 'use strict'; var isObject = require('../internals/is-object'); var classof = require('../internals/classof-raw'); var wellKnownSymbol = require('../internals/well-known-symbol'); var MATCH = wellKnownSymbol('match'); module.exports = function (it) { var isRegExp; return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classof(it) === 'RegExp'); }; },{"../internals/classof-raw":77,"../internals/is-object":152,"../internals/well-known-symbol":252}],155:[function(require,module,exports){ 'use strict'; var getBuiltIn = require('../internals/get-built-in'); var isCallable = require('../internals/is-callable'); var isPrototypeOf = require('../internals/object-is-prototype-of'); var USE_SYMBOL_AS_UID = require('../internals/use-symbol-as-uid'); var $Object = Object; module.exports = USE_SYMBOL_AS_UID ? function (it) { return typeof it == 'symbol'; } : function (it) { var $Symbol = getBuiltIn('Symbol'); return isCallable($Symbol) && isPrototypeOf($Symbol.prototype, $Object(it)); }; },{"../internals/get-built-in":125,"../internals/is-callable":147,"../internals/object-is-prototype-of":183,"../internals/use-symbol-as-uid":246}],156:[function(require,module,exports){ 'use strict'; var call = require('../internals/function-call'); module.exports = function (record, fn, ITERATOR_INSTEAD_OF_RECORD) { var iterator = ITERATOR_INSTEAD_OF_RECORD ? record : record.iterator; var next = record.next; var step, result; while (!(step = call(next, iterator)).done) { result = fn(step.value); if (result !== undefined) return result; } }; },{"../internals/function-call":120}],157:[function(require,module,exports){ 'use strict'; var bind = require('../internals/function-bind-context'); var call = require('../internals/function-call'); var anObject = require('../internals/an-object'); var tryToString = require('../internals/try-to-string'); var isArrayIteratorMethod = require('../internals/is-array-iterator-method'); var lengthOfArrayLike = require('../internals/length-of-array-like'); var isPrototypeOf = require('../internals/object-is-prototype-of'); var getIterator = require('../internals/get-iterator'); var getIteratorMethod = require('../internals/get-iterator-method'); var iteratorClose = require('../internals/iterator-close'); var $TypeError = TypeError; var Result = function (stopped, result) { this.stopped = stopped; this.result = result; }; var ResultPrototype = Result.prototype; module.exports = function (iterable, unboundFunction, options) { var that = options && options.that; var AS_ENTRIES = !!(options && options.AS_ENTRIES); var IS_RECORD = !!(options && options.IS_RECORD); var IS_ITERATOR = !!(options && options.IS_ITERATOR); var INTERRUPTED = !!(options && options.INTERRUPTED); var fn = bind(unboundFunction, that); var iterator, iterFn, index, length, result, next, step; var stop = function (condition) { if (iterator) iteratorClose(iterator, 'normal', condition); return new Result(true, condition); }; var callFn = function (value) { if (AS_ENTRIES) { anObject(value); return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]); } return INTERRUPTED ? fn(value, stop) : fn(value); }; if (IS_RECORD) { iterator = iterable.iterator; } else if (IS_ITERATOR) { iterator = iterable; } else { iterFn = getIteratorMethod(iterable); if (!iterFn) throw new $TypeError(tryToString(iterable) + ' is not iterable'); if (isArrayIteratorMethod(iterFn)) { for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) { result = callFn(iterable[index]); if (result && isPrototypeOf(ResultPrototype, result)) return result; } return new Result(false); } iterator = getIterator(iterable, iterFn); } next = IS_RECORD ? iterable.next : iterator.next; while (!(step = call(next, iterator)).done) { try { result = callFn(step.value); } catch (error) { iteratorClose(iterator, 'throw', error); } if (typeof result == 'object' && result && isPrototypeOf(ResultPrototype, result)) return result; } return new Result(false); }; },{"../internals/an-object":65,"../internals/function-bind-context":118,"../internals/function-call":120,"../internals/get-iterator":128,"../internals/get-iterator-method":127,"../internals/is-array-iterator-method":145,"../internals/iterator-close":158,"../internals/length-of-array-like":163,"../internals/object-is-prototype-of":183,"../internals/try-to-string":244}],158:[function(require,module,exports){ 'use strict'; var call = require('../internals/function-call'); var anObject = require('../internals/an-object'); var getMethod = require('../internals/get-method'); module.exports = function (iterator, kind, value) { var innerResult, innerError; anObject(iterator); try { innerResult = getMethod(iterator, 'return'); if (!innerResult) { if (kind === 'throw') throw value; return value; } innerResult = call(innerResult, iterator); } catch (error) { innerError = true; innerResult = error; } if (kind === 'throw') throw value; if (innerError) throw innerResult; anObject(innerResult); return value; }; },{"../internals/an-object":65,"../internals/function-call":120,"../internals/get-method":130}],159:[function(require,module,exports){ 'use strict'; var IteratorPrototype = require('../internals/iterators-core').IteratorPrototype; var create = require('../internals/object-create'); var createPropertyDescriptor = require('../internals/create-property-descriptor'); var setToStringTag = require('../internals/set-to-string-tag'); var Iterators = require('../internals/iterators'); var returnThis = function () { return this; }; module.exports = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) { var TO_STRING_TAG = NAME + ' Iterator'; IteratorConstructor.prototype = create(IteratorPrototype, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) }); setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true); Iterators[TO_STRING_TAG] = returnThis; return IteratorConstructor; }; },{"../internals/create-property-descriptor":88,"../internals/iterators":162,"../internals/iterators-core":161,"../internals/object-create":174,"../internals/set-to-string-tag":220}],160:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var call = require('../internals/function-call'); var IS_PURE = require('../internals/is-pure'); var FunctionName = require('../internals/function-name'); var isCallable = require('../internals/is-callable'); var createIteratorConstructor = require('../internals/iterator-create-constructor'); var getPrototypeOf = require('../internals/object-get-prototype-of'); var setPrototypeOf = require('../internals/object-set-prototype-of'); var setToStringTag = require('../internals/set-to-string-tag'); var createNonEnumerableProperty = require('../internals/create-non-enumerable-property'); var defineBuiltIn = require('../internals/define-built-in'); var wellKnownSymbol = require('../internals/well-known-symbol'); var Iterators = require('../internals/iterators'); var IteratorsCore = require('../internals/iterators-core'); var PROPER_FUNCTION_NAME = FunctionName.PROPER; var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE; var IteratorPrototype = IteratorsCore.IteratorPrototype; var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS; var ITERATOR = wellKnownSymbol('iterator'); var KEYS = 'keys'; var VALUES = 'values'; var ENTRIES = 'entries'; var returnThis = function () { return this; }; module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) { createIteratorConstructor(IteratorConstructor, NAME, next); var getIterationMethod = function (KIND) { if (KIND === DEFAULT && defaultIterator) return defaultIterator; if (!BUGGY_SAFARI_ITERATORS && KIND && KIND in IterablePrototype) return IterablePrototype[KIND]; switch (KIND) { case KEYS: return function keys() { return new IteratorConstructor(this, KIND); }; case VALUES: return function values() { return new IteratorConstructor(this, KIND); }; case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); }; } return function () { return new IteratorConstructor(this); }; }; var TO_STRING_TAG = NAME + ' Iterator'; var INCORRECT_VALUES_NAME = false; var IterablePrototype = Iterable.prototype; var nativeIterator = IterablePrototype[ITERATOR] || IterablePrototype['@@iterator'] || DEFAULT && IterablePrototype[DEFAULT]; var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT); var anyNativeIterator = NAME === 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator; var CurrentIteratorPrototype, methods, KEY; if (anyNativeIterator) { CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable())); if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) { if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) { if (setPrototypeOf) { setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype); } else if (!isCallable(CurrentIteratorPrototype[ITERATOR])) { defineBuiltIn(CurrentIteratorPrototype, ITERATOR, returnThis); } } setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true); if (IS_PURE) Iterators[TO_STRING_TAG] = returnThis; } } if (PROPER_FUNCTION_NAME && DEFAULT === VALUES && nativeIterator && nativeIterator.name !== VALUES) { if (!IS_PURE && CONFIGURABLE_FUNCTION_NAME) { createNonEnumerableProperty(IterablePrototype, 'name', VALUES); } else { INCORRECT_VALUES_NAME = true; defaultIterator = function values() { return call(nativeIterator, this); }; } } if (DEFAULT) { methods = { values: getIterationMethod(VALUES), keys: IS_SET ? defaultIterator : getIterationMethod(KEYS), entries: getIterationMethod(ENTRIES) }; if (FORCED) for (KEY in methods) { if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) { defineBuiltIn(IterablePrototype, KEY, methods[KEY]); } } else $({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods); } if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) { defineBuiltIn(IterablePrototype, ITERATOR, defaultIterator, { name: DEFAULT }); } Iterators[NAME] = defaultIterator; return methods; }; },{"../internals/create-non-enumerable-property":87,"../internals/define-built-in":91,"../internals/export":113,"../internals/function-call":120,"../internals/function-name":121,"../internals/is-callable":147,"../internals/is-pure":153,"../internals/iterator-create-constructor":159,"../internals/iterators":162,"../internals/iterators-core":161,"../internals/object-get-prototype-of":181,"../internals/object-set-prototype-of":187,"../internals/set-to-string-tag":220,"../internals/well-known-symbol":252}],161:[function(require,module,exports){ 'use strict'; var fails = require('../internals/fails'); var isCallable = require('../internals/is-callable'); var isObject = require('../internals/is-object'); var create = require('../internals/object-create'); var getPrototypeOf = require('../internals/object-get-prototype-of'); var defineBuiltIn = require('../internals/define-built-in'); var wellKnownSymbol = require('../internals/well-known-symbol'); var IS_PURE = require('../internals/is-pure'); var ITERATOR = wellKnownSymbol('iterator'); var BUGGY_SAFARI_ITERATORS = false; var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator; if ([].keys) { arrayIterator = [].keys(); if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true; else { PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator)); if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype; } } var NEW_ITERATOR_PROTOTYPE = !isObject(IteratorPrototype) || fails(function () { var test = {}; return IteratorPrototype[ITERATOR].call(test) !== test; }); if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype = {}; else if (IS_PURE) IteratorPrototype = create(IteratorPrototype); if (!isCallable(IteratorPrototype[ITERATOR])) { defineBuiltIn(IteratorPrototype, ITERATOR, function () { return this; }); } module.exports = { IteratorPrototype: IteratorPrototype, BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS }; },{"../internals/define-built-in":91,"../internals/fails":114,"../internals/is-callable":147,"../internals/is-object":152,"../internals/is-pure":153,"../internals/object-create":174,"../internals/object-get-prototype-of":181,"../internals/well-known-symbol":252}],162:[function(require,module,exports){ arguments[4][135][0].apply(exports,arguments) },{"dup":135}],163:[function(require,module,exports){ 'use strict'; var toLength = require('../internals/to-length'); module.exports = function (obj) { return toLength(obj.length); }; },{"../internals/to-length":237}],164:[function(require,module,exports){ 'use strict'; var uncurryThis = require('../internals/function-uncurry-this'); var fails = require('../internals/fails'); var isCallable = require('../internals/is-callable'); var hasOwn = require('../internals/has-own-property'); var DESCRIPTORS = require('../internals/descriptors'); var CONFIGURABLE_FUNCTION_NAME = require('../internals/function-name').CONFIGURABLE; var inspectSource = require('../internals/inspect-source'); var InternalStateModule = require('../internals/internal-state'); var enforceInternalState = InternalStateModule.enforce; var getInternalState = InternalStateModule.get; var $String = String; var defineProperty = Object.defineProperty; var stringSlice = uncurryThis(''.slice); var replace = uncurryThis(''.replace); var join = uncurryThis([].join); var CONFIGURABLE_LENGTH = DESCRIPTORS && !fails(function () { return defineProperty(function () { }, 'length', { value: 8 }).length !== 8; }); var TEMPLATE = String(String).split('String'); var makeBuiltIn = module.exports = function (value, name, options) { if (stringSlice($String(name), 0, 7) === 'Symbol(') { name = '[' + replace($String(name), /^Symbol\(([^)]*)\)/, '$1') + ']'; } if (options && options.getter) name = 'get ' + name; if (options && options.setter) name = 'set ' + name; if (!hasOwn(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) { if (DESCRIPTORS) defineProperty(value, 'name', { value: name, configurable: true }); else value.name = name; } if (CONFIGURABLE_LENGTH && options && hasOwn(options, 'arity') && value.length !== options.arity) { defineProperty(value, 'length', { value: options.arity }); } try { if (options && hasOwn(options, 'constructor') && options.constructor) { if (DESCRIPTORS) defineProperty(value, 'prototype', { writable: false }); } else if (value.prototype) value.prototype = undefined; } catch (error) { } var state = enforceInternalState(value); if (!hasOwn(state, 'source')) { state.source = join(TEMPLATE, typeof name == 'string' ? name : ''); } return value; }; Function.prototype.toString = makeBuiltIn(function toString() { return isCallable(this) && getInternalState(this).source || inspectSource(this); }, 'toString'); },{"../internals/descriptors":94,"../internals/fails":114,"../internals/function-name":121,"../internals/function-uncurry-this":124,"../internals/has-own-property":134,"../internals/inspect-source":141,"../internals/internal-state":144,"../internals/is-callable":147}],165:[function(require,module,exports){ 'use strict'; var uncurryThis = require('../internals/function-uncurry-this'); var MapPrototype = Map.prototype; module.exports = { Map: Map, set: uncurryThis(MapPrototype.set), get: uncurryThis(MapPrototype.get), has: uncurryThis(MapPrototype.has), remove: uncurryThis(MapPrototype['delete']), proto: MapPrototype }; },{"../internals/function-uncurry-this":124}],166:[function(require,module,exports){ 'use strict'; var uncurryThis = require('../internals/function-uncurry-this'); var iterateSimple = require('../internals/iterate-simple'); var MapHelpers = require('../internals/map-helpers'); var Map = MapHelpers.Map; var MapPrototype = MapHelpers.proto; var forEach = uncurryThis(MapPrototype.forEach); var entries = uncurryThis(MapPrototype.entries); var next = entries(new Map()).next; module.exports = function (map, fn, interruptible) { return interruptible ? iterateSimple({ iterator: entries(map), next: next }, function (entry) { return fn(entry[1], entry[0]); }) : forEach(map, fn); }; },{"../internals/function-uncurry-this":124,"../internals/iterate-simple":156,"../internals/map-helpers":165}],167:[function(require,module,exports){ 'use strict'; var call = require('../internals/function-call'); var aCallable = require('../internals/a-callable'); var isCallable = require('../internals/is-callable'); var anObject = require('../internals/an-object'); var $TypeError = TypeError; module.exports = function upsert(key, updateFn ) { var map = anObject(this); var get = aCallable(map.get); var has = aCallable(map.has); var set = aCallable(map.set); var insertFn = arguments.length > 2 ? arguments[2] : undefined; var value; if (!isCallable(updateFn) && !isCallable(insertFn)) { throw new $TypeError('At least one callback required'); } if (call(has, map, key)) { value = call(get, map, key); if (isCallable(updateFn)) { value = updateFn(value); call(set, map, key, value); } } else if (isCallable(insertFn)) { value = insertFn(); call(set, map, key, value); } return value; }; },{"../internals/a-callable":57,"../internals/an-object":65,"../internals/function-call":120,"../internals/is-callable":147}],168:[function(require,module,exports){ 'use strict'; var ceil = Math.ceil; var floor = Math.floor; module.exports = Math.trunc || function trunc(x) { var n = +x; return (n > 0 ? floor : ceil)(n); }; },{}],169:[function(require,module,exports){ 'use strict'; var global = require('../internals/global'); var bind = require('../internals/function-bind-context'); var getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f; var macrotask = require('../internals/task').set; var Queue = require('../internals/queue'); var IS_IOS = require('../internals/engine-is-ios'); var IS_IOS_PEBBLE = require('../internals/engine-is-ios-pebble'); var IS_WEBOS_WEBKIT = require('../internals/engine-is-webos-webkit'); var IS_NODE = require('../internals/engine-is-node'); var MutationObserver = global.MutationObserver || global.WebKitMutationObserver; var document = global.document; var process = global.process; var Promise = global.Promise; var queueMicrotaskDescriptor = getOwnPropertyDescriptor(global, 'queueMicrotask'); var microtask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value; var notify, toggle, node, promise, then; if (!microtask) { var queue = new Queue(); var flush = function () { var parent, fn; if (IS_NODE && (parent = process.domain)) parent.exit(); while (fn = queue.get()) try { fn(); } catch (error) { if (queue.head) notify(); throw error; } if (parent) parent.enter(); }; if (!IS_IOS && !IS_NODE && !IS_WEBOS_WEBKIT && MutationObserver && document) { toggle = true; node = document.createTextNode(''); new MutationObserver(flush).observe(node, { characterData: true }); notify = function () { node.data = toggle = !toggle; }; } else if (!IS_IOS_PEBBLE && Promise && Promise.resolve) { promise = Promise.resolve(undefined); promise.constructor = Promise; then = bind(promise.then, promise); notify = function () { then(flush); }; } else if (IS_NODE) { notify = function () { process.nextTick(flush); }; } else { macrotask = bind(macrotask, global); notify = function () { macrotask(flush); }; } microtask = function (fn) { if (!queue.head) notify(); queue.add(fn); }; } module.exports = microtask; },{"../internals/engine-is-ios":103,"../internals/engine-is-ios-pebble":102,"../internals/engine-is-node":104,"../internals/engine-is-webos-webkit":105,"../internals/function-bind-context":118,"../internals/global":133,"../internals/object-get-own-property-descriptor":177,"../internals/queue":198,"../internals/task":233}],170:[function(require,module,exports){ 'use strict'; var aCallable = require('../internals/a-callable'); var $TypeError = TypeError; var PromiseCapability = function (C) { var resolve, reject; this.promise = new C(function ($$resolve, $$reject) { if (resolve !== undefined || reject !== undefined) throw new $TypeError('Bad Promise constructor'); resolve = $$resolve; reject = $$reject; }); this.resolve = aCallable(resolve); this.reject = aCallable(reject); }; module.exports.f = function (C) { return new PromiseCapability(C); }; },{"../internals/a-callable":57}],171:[function(require,module,exports){ 'use strict'; var toString = require('../internals/to-string'); module.exports = function (argument, $default) { return argument === undefined ? arguments.length < 2 ? '' : $default : toString(argument); }; },{"../internals/to-string":243}],172:[function(require,module,exports){ 'use strict'; var isRegExp = require('../internals/is-regexp'); var $TypeError = TypeError; module.exports = function (it) { if (isRegExp(it)) { throw new $TypeError("The method doesn't accept regular expressions"); } return it; }; },{"../internals/is-regexp":154}],173:[function(require,module,exports){ 'use strict'; var DESCRIPTORS = require('../internals/descriptors'); var uncurryThis = require('../internals/function-uncurry-this'); var call = require('../internals/function-call'); var fails = require('../internals/fails'); var objectKeys = require('../internals/object-keys'); var getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols'); var propertyIsEnumerableModule = require('../internals/object-property-is-enumerable'); var toObject = require('../internals/to-object'); var IndexedObject = require('../internals/indexed-object'); var $assign = Object.assign; var defineProperty = Object.defineProperty; var concat = uncurryThis([].concat); module.exports = !$assign || fails(function () { if (DESCRIPTORS && $assign({ b: 1 }, $assign(defineProperty({}, 'a', { enumerable: true, get: function () { defineProperty(this, 'b', { value: 3, enumerable: false }); } }), { b: 2 })).b !== 1) return true; var A = {}; var B = {}; var symbol = Symbol('assign detection'); var alphabet = 'abcdefghijklmnopqrst'; A[symbol] = 7; alphabet.split('').forEach(function (chr) { B[chr] = chr; }); return $assign({}, A)[symbol] !== 7 || objectKeys($assign({}, B)).join('') !== alphabet; }) ? function assign(target, source) { var T = toObject(target); var argumentsLength = arguments.length; var index = 1; var getOwnPropertySymbols = getOwnPropertySymbolsModule.f; var propertyIsEnumerable = propertyIsEnumerableModule.f; while (argumentsLength > index) { var S = IndexedObject(arguments[index++]); var keys = getOwnPropertySymbols ? concat(objectKeys(S), getOwnPropertySymbols(S)) : objectKeys(S); var length = keys.length; var j = 0; var key; while (length > j) { key = keys[j++]; if (!DESCRIPTORS || call(propertyIsEnumerable, S, key)) T[key] = S[key]; } } return T; } : $assign; },{"../internals/descriptors":94,"../internals/fails":114,"../internals/function-call":120,"../internals/function-uncurry-this":124,"../internals/indexed-object":139,"../internals/object-get-own-property-symbols":180,"../internals/object-keys":185,"../internals/object-property-is-enumerable":186,"../internals/to-object":238}],174:[function(require,module,exports){ 'use strict'; var anObject = require('../internals/an-object'); var definePropertiesModule = require('../internals/object-define-properties'); var enumBugKeys = require('../internals/enum-bug-keys'); var hiddenKeys = require('../internals/hidden-keys'); var html = require('../internals/html'); var documentCreateElement = require('../internals/document-create-element'); var sharedKey = require('../internals/shared-key'); var GT = '>'; var LT = '<'; var PROTOTYPE = 'prototype'; var SCRIPT = 'script'; var IE_PROTO = sharedKey('IE_PROTO'); var EmptyConstructor = function () { }; var scriptTag = function (content) { return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT; }; var NullProtoObjectViaActiveX = function (activeXDocument) { activeXDocument.write(scriptTag('')); activeXDocument.close(); var temp = activeXDocument.parentWindow.Object; activeXDocument = null; return temp; }; var NullProtoObjectViaIFrame = function () { var iframe = documentCreateElement('iframe'); var JS = 'java' + SCRIPT + ':'; var iframeDocument; iframe.style.display = 'none'; html.appendChild(iframe); iframe.src = String(JS); iframeDocument = iframe.contentWindow.document; iframeDocument.open(); iframeDocument.write(scriptTag('document.F=Object')); iframeDocument.close(); return iframeDocument.F; }; var activeXDocument; var NullProtoObject = function () { try { activeXDocument = new ActiveXObject('htmlfile'); } catch (error) { } NullProtoObject = typeof document != 'undefined' ? document.domain && activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame() : NullProtoObjectViaActiveX(activeXDocument); var length = enumBugKeys.length; while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]]; return NullProtoObject(); }; hiddenKeys[IE_PROTO] = true; module.exports = Object.create || function create(O, Properties) { var result; if (O !== null) { EmptyConstructor[PROTOTYPE] = anObject(O); result = new EmptyConstructor(); EmptyConstructor[PROTOTYPE] = null; result[IE_PROTO] = O; } else result = NullProtoObject(); return Properties === undefined ? result : definePropertiesModule.f(result, Properties); }; },{"../internals/an-object":65,"../internals/document-create-element":96,"../internals/enum-bug-keys":109,"../internals/hidden-keys":135,"../internals/html":137,"../internals/object-define-properties":175,"../internals/shared-key":222}],175:[function(require,module,exports){ 'use strict'; var DESCRIPTORS = require('../internals/descriptors'); var V8_PROTOTYPE_DEFINE_BUG = require('../internals/v8-prototype-define-bug'); var definePropertyModule = require('../internals/object-define-property'); var anObject = require('../internals/an-object'); var toIndexedObject = require('../internals/to-indexed-object'); var objectKeys = require('../internals/object-keys'); exports.f = DESCRIPTORS && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) { anObject(O); var props = toIndexedObject(Properties); var keys = objectKeys(Properties); var length = keys.length; var index = 0; var key; while (length > index) definePropertyModule.f(O, key = keys[index++], props[key]); return O; }; },{"../internals/an-object":65,"../internals/descriptors":94,"../internals/object-define-property":176,"../internals/object-keys":185,"../internals/to-indexed-object":235,"../internals/v8-prototype-define-bug":247}],176:[function(require,module,exports){ 'use strict'; var DESCRIPTORS = require('../internals/descriptors'); var IE8_DOM_DEFINE = require('../internals/ie8-dom-define'); var V8_PROTOTYPE_DEFINE_BUG = require('../internals/v8-prototype-define-bug'); var anObject = require('../internals/an-object'); var toPropertyKey = require('../internals/to-property-key'); var $TypeError = TypeError; var $defineProperty = Object.defineProperty; var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; var ENUMERABLE = 'enumerable'; var CONFIGURABLE = 'configurable'; var WRITABLE = 'writable'; exports.f = DESCRIPTORS ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) { anObject(O); P = toPropertyKey(P); anObject(Attributes); if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) { var current = $getOwnPropertyDescriptor(O, P); if (current && current[WRITABLE]) { O[P] = Attributes.value; Attributes = { configurable: CONFIGURABLE in Attributes ? Attributes[CONFIGURABLE] : current[CONFIGURABLE], enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE], writable: false }; } } return $defineProperty(O, P, Attributes); } : $defineProperty : function defineProperty(O, P, Attributes) { anObject(O); P = toPropertyKey(P); anObject(Attributes); if (IE8_DOM_DEFINE) try { return $defineProperty(O, P, Attributes); } catch (error) { } if ('get' in Attributes || 'set' in Attributes) throw new $TypeError('Accessors not supported'); if ('value' in Attributes) O[P] = Attributes.value; return O; }; },{"../internals/an-object":65,"../internals/descriptors":94,"../internals/ie8-dom-define":138,"../internals/to-property-key":240,"../internals/v8-prototype-define-bug":247}],177:[function(require,module,exports){ 'use strict'; var DESCRIPTORS = require('../internals/descriptors'); var call = require('../internals/function-call'); var propertyIsEnumerableModule = require('../internals/object-property-is-enumerable'); var createPropertyDescriptor = require('../internals/create-property-descriptor'); var toIndexedObject = require('../internals/to-indexed-object'); var toPropertyKey = require('../internals/to-property-key'); var hasOwn = require('../internals/has-own-property'); var IE8_DOM_DEFINE = require('../internals/ie8-dom-define'); var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; exports.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) { O = toIndexedObject(O); P = toPropertyKey(P); if (IE8_DOM_DEFINE) try { return $getOwnPropertyDescriptor(O, P); } catch (error) { } if (hasOwn(O, P)) return createPropertyDescriptor(!call(propertyIsEnumerableModule.f, O, P), O[P]); }; },{"../internals/create-property-descriptor":88,"../internals/descriptors":94,"../internals/function-call":120,"../internals/has-own-property":134,"../internals/ie8-dom-define":138,"../internals/object-property-is-enumerable":186,"../internals/to-indexed-object":235,"../internals/to-property-key":240}],178:[function(require,module,exports){ 'use strict'; var classof = require('../internals/classof-raw'); var toIndexedObject = require('../internals/to-indexed-object'); var $getOwnPropertyNames = require('../internals/object-get-own-property-names').f; var arraySlice = require('../internals/array-slice-simple'); var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames ? Object.getOwnPropertyNames(window) : []; var getWindowNames = function (it) { try { return $getOwnPropertyNames(it); } catch (error) { return arraySlice(windowNames); } }; module.exports.f = function getOwnPropertyNames(it) { return windowNames && classof(it) === 'Window' ? getWindowNames(it) : $getOwnPropertyNames(toIndexedObject(it)); }; },{"../internals/array-slice-simple":71,"../internals/classof-raw":77,"../internals/object-get-own-property-names":179,"../internals/to-indexed-object":235}],179:[function(require,module,exports){ 'use strict'; var internalObjectKeys = require('../internals/object-keys-internal'); var enumBugKeys = require('../internals/enum-bug-keys'); var hiddenKeys = enumBugKeys.concat('length', 'prototype'); exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { return internalObjectKeys(O, hiddenKeys); }; },{"../internals/enum-bug-keys":109,"../internals/object-keys-internal":184}],180:[function(require,module,exports){ 'use strict'; exports.f = Object.getOwnPropertySymbols; },{}],181:[function(require,module,exports){ 'use strict'; var hasOwn = require('../internals/has-own-property'); var isCallable = require('../internals/is-callable'); var toObject = require('../internals/to-object'); var sharedKey = require('../internals/shared-key'); var CORRECT_PROTOTYPE_GETTER = require('../internals/correct-prototype-getter'); var IE_PROTO = sharedKey('IE_PROTO'); var $Object = Object; var ObjectPrototype = $Object.prototype; module.exports = CORRECT_PROTOTYPE_GETTER ? $Object.getPrototypeOf : function (O) { var object = toObject(O); if (hasOwn(object, IE_PROTO)) return object[IE_PROTO]; var constructor = object.constructor; if (isCallable(constructor) && object instanceof constructor) { return constructor.prototype; } return object instanceof $Object ? ObjectPrototype : null; }; },{"../internals/correct-prototype-getter":85,"../internals/has-own-property":134,"../internals/is-callable":147,"../internals/shared-key":222,"../internals/to-object":238}],182:[function(require,module,exports){ 'use strict'; var fails = require('../internals/fails'); var isObject = require('../internals/is-object'); var classof = require('../internals/classof-raw'); var ARRAY_BUFFER_NON_EXTENSIBLE = require('../internals/array-buffer-non-extensible'); var $isExtensible = Object.isExtensible; var FAILS_ON_PRIMITIVES = fails(function () { $isExtensible(1); }); module.exports = (FAILS_ON_PRIMITIVES || ARRAY_BUFFER_NON_EXTENSIBLE) ? function isExtensible(it) { if (!isObject(it)) return false; if (ARRAY_BUFFER_NON_EXTENSIBLE && classof(it) === 'ArrayBuffer') return false; return $isExtensible ? $isExtensible(it) : true; } : $isExtensible; },{"../internals/array-buffer-non-extensible":66,"../internals/classof-raw":77,"../internals/fails":114,"../internals/is-object":152}],183:[function(require,module,exports){ 'use strict'; var uncurryThis = require('../internals/function-uncurry-this'); module.exports = uncurryThis({}.isPrototypeOf); },{"../internals/function-uncurry-this":124}],184:[function(require,module,exports){ 'use strict'; var uncurryThis = require('../internals/function-uncurry-this'); var hasOwn = require('../internals/has-own-property'); var toIndexedObject = require('../internals/to-indexed-object'); var indexOf = require('../internals/array-includes').indexOf; var hiddenKeys = require('../internals/hidden-keys'); var push = uncurryThis([].push); module.exports = function (object, names) { var O = toIndexedObject(object); var i = 0; var result = []; var key; for (key in O) !hasOwn(hiddenKeys, key) && hasOwn(O, key) && push(result, key); while (names.length > i) if (hasOwn(O, key = names[i++])) { ~indexOf(result, key) || push(result, key); } return result; }; },{"../internals/array-includes":68,"../internals/function-uncurry-this":124,"../internals/has-own-property":134,"../internals/hidden-keys":135,"../internals/to-indexed-object":235}],185:[function(require,module,exports){ 'use strict'; var internalObjectKeys = require('../internals/object-keys-internal'); var enumBugKeys = require('../internals/enum-bug-keys'); module.exports = Object.keys || function keys(O) { return internalObjectKeys(O, enumBugKeys); }; },{"../internals/enum-bug-keys":109,"../internals/object-keys-internal":184}],186:[function(require,module,exports){ 'use strict'; var $propertyIsEnumerable = {}.propertyIsEnumerable; var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; var NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1); exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) { var descriptor = getOwnPropertyDescriptor(this, V); return !!descriptor && descriptor.enumerable; } : $propertyIsEnumerable; },{}],187:[function(require,module,exports){ 'use strict'; var uncurryThisAccessor = require('../internals/function-uncurry-this-accessor'); var anObject = require('../internals/an-object'); var aPossiblePrototype = require('../internals/a-possible-prototype'); module.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () { var CORRECT_SETTER = false; var test = {}; var setter; try { setter = uncurryThisAccessor(Object.prototype, '__proto__', 'set'); setter(test, []); CORRECT_SETTER = test instanceof Array; } catch (error) { } return function setPrototypeOf(O, proto) { anObject(O); aPossiblePrototype(proto); if (CORRECT_SETTER) setter(O, proto); else O.__proto__ = proto; return O; }; }() : undefined); },{"../internals/a-possible-prototype":60,"../internals/an-object":65,"../internals/function-uncurry-this-accessor":122}],188:[function(require,module,exports){ 'use strict'; var DESCRIPTORS = require('../internals/descriptors'); var fails = require('../internals/fails'); var uncurryThis = require('../internals/function-uncurry-this'); var objectGetPrototypeOf = require('../internals/object-get-prototype-of'); var objectKeys = require('../internals/object-keys'); var toIndexedObject = require('../internals/to-indexed-object'); var $propertyIsEnumerable = require('../internals/object-property-is-enumerable').f; var propertyIsEnumerable = uncurryThis($propertyIsEnumerable); var push = uncurryThis([].push); var IE_BUG = DESCRIPTORS && fails(function () { var O = Object.create(null); O[2] = 2; return !propertyIsEnumerable(O, 2); }); var createMethod = function (TO_ENTRIES) { return function (it) { var O = toIndexedObject(it); var keys = objectKeys(O); var IE_WORKAROUND = IE_BUG && objectGetPrototypeOf(O) === null; var length = keys.length; var i = 0; var result = []; var key; while (length > i) { key = keys[i++]; if (!DESCRIPTORS || (IE_WORKAROUND ? key in O : propertyIsEnumerable(O, key))) { push(result, TO_ENTRIES ? [key, O[key]] : O[key]); } } return result; }; }; module.exports = { entries: createMethod(true), values: createMethod(false) }; },{"../internals/descriptors":94,"../internals/fails":114,"../internals/function-uncurry-this":124,"../internals/object-get-prototype-of":181,"../internals/object-keys":185,"../internals/object-property-is-enumerable":186,"../internals/to-indexed-object":235}],189:[function(require,module,exports){ 'use strict'; var TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support'); var classof = require('../internals/classof'); module.exports = TO_STRING_TAG_SUPPORT ? {}.toString : function toString() { return '[object ' + classof(this) + ']'; }; },{"../internals/classof":78,"../internals/to-string-tag-support":242}],190:[function(require,module,exports){ 'use strict'; var call = require('../internals/function-call'); var isCallable = require('../internals/is-callable'); var isObject = require('../internals/is-object'); var $TypeError = TypeError; module.exports = function (input, pref) { var fn, val; if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val; if (isCallable(fn = input.valueOf) && !isObject(val = call(fn, input))) return val; if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val; throw new $TypeError("Can't convert object to primitive value"); }; },{"../internals/function-call":120,"../internals/is-callable":147,"../internals/is-object":152}],191:[function(require,module,exports){ 'use strict'; var getBuiltIn = require('../internals/get-built-in'); var uncurryThis = require('../internals/function-uncurry-this'); var getOwnPropertyNamesModule = require('../internals/object-get-own-property-names'); var getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols'); var anObject = require('../internals/an-object'); var concat = uncurryThis([].concat); module.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) { var keys = getOwnPropertyNamesModule.f(anObject(it)); var getOwnPropertySymbols = getOwnPropertySymbolsModule.f; return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys; }; },{"../internals/an-object":65,"../internals/function-uncurry-this":124,"../internals/get-built-in":125,"../internals/object-get-own-property-names":179,"../internals/object-get-own-property-symbols":180}],192:[function(require,module,exports){ 'use strict'; var global = require('../internals/global'); module.exports = global; },{"../internals/global":133}],193:[function(require,module,exports){ 'use strict'; module.exports = function (exec) { try { return { error: false, value: exec() }; } catch (error) { return { error: true, value: error }; } }; },{}],194:[function(require,module,exports){ 'use strict'; var global = require('../internals/global'); var NativePromiseConstructor = require('../internals/promise-native-constructor'); var isCallable = require('../internals/is-callable'); var isForced = require('../internals/is-forced'); var inspectSource = require('../internals/inspect-source'); var wellKnownSymbol = require('../internals/well-known-symbol'); var IS_BROWSER = require('../internals/engine-is-browser'); var IS_DENO = require('../internals/engine-is-deno'); var IS_PURE = require('../internals/is-pure'); var V8_VERSION = require('../internals/engine-v8-version'); var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype; var SPECIES = wellKnownSymbol('species'); var SUBCLASSING = false; var NATIVE_PROMISE_REJECTION_EVENT = isCallable(global.PromiseRejectionEvent); var FORCED_PROMISE_CONSTRUCTOR = isForced('Promise', function () { var PROMISE_CONSTRUCTOR_SOURCE = inspectSource(NativePromiseConstructor); var GLOBAL_CORE_JS_PROMISE = PROMISE_CONSTRUCTOR_SOURCE !== String(NativePromiseConstructor); if (!GLOBAL_CORE_JS_PROMISE && V8_VERSION === 66) return true; if (IS_PURE && !(NativePromisePrototype['catch'] && NativePromisePrototype['finally'])) return true; if (!V8_VERSION || V8_VERSION < 51 || !/native code/.test(PROMISE_CONSTRUCTOR_SOURCE)) { var promise = new NativePromiseConstructor(function (resolve) { resolve(1); }); var FakePromise = function (exec) { exec(function () { }, function () { }); }; var constructor = promise.constructor = {}; constructor[SPECIES] = FakePromise; SUBCLASSING = promise.then(function () { }) instanceof FakePromise; if (!SUBCLASSING) return true; } return !GLOBAL_CORE_JS_PROMISE && (IS_BROWSER || IS_DENO) && !NATIVE_PROMISE_REJECTION_EVENT; }); module.exports = { CONSTRUCTOR: FORCED_PROMISE_CONSTRUCTOR, REJECTION_EVENT: NATIVE_PROMISE_REJECTION_EVENT, SUBCLASSING: SUBCLASSING }; },{"../internals/engine-is-browser":100,"../internals/engine-is-deno":101,"../internals/engine-v8-version":107,"../internals/global":133,"../internals/inspect-source":141,"../internals/is-callable":147,"../internals/is-forced":149,"../internals/is-pure":153,"../internals/promise-native-constructor":195,"../internals/well-known-symbol":252}],195:[function(require,module,exports){ 'use strict'; var global = require('../internals/global'); module.exports = global.Promise; },{"../internals/global":133}],196:[function(require,module,exports){ 'use strict'; var anObject = require('../internals/an-object'); var isObject = require('../internals/is-object'); var newPromiseCapability = require('../internals/new-promise-capability'); module.exports = function (C, x) { anObject(C); if (isObject(x) && x.constructor === C) return x; var promiseCapability = newPromiseCapability.f(C); var resolve = promiseCapability.resolve; resolve(x); return promiseCapability.promise; }; },{"../internals/an-object":65,"../internals/is-object":152,"../internals/new-promise-capability":170}],197:[function(require,module,exports){ 'use strict'; var NativePromiseConstructor = require('../internals/promise-native-constructor'); var checkCorrectnessOfIteration = require('../internals/check-correctness-of-iteration'); var FORCED_PROMISE_CONSTRUCTOR = require('../internals/promise-constructor-detection').CONSTRUCTOR; module.exports = FORCED_PROMISE_CONSTRUCTOR || !checkCorrectnessOfIteration(function (iterable) { NativePromiseConstructor.all(iterable).then(undefined, function () { }); }); },{"../internals/check-correctness-of-iteration":76,"../internals/promise-constructor-detection":194,"../internals/promise-native-constructor":195}],198:[function(require,module,exports){ 'use strict'; var Queue = function () { this.head = null; this.tail = null; }; Queue.prototype = { add: function (item) { var entry = { item: item, next: null }; var tail = this.tail; if (tail) tail.next = entry; else this.head = entry; this.tail = entry; }, get: function () { var entry = this.head; if (entry) { var next = this.head = entry.next; if (next === null) this.tail = null; return entry.item; } } }; module.exports = Queue; },{}],199:[function(require,module,exports){ 'use strict'; var call = require('../internals/function-call'); var anObject = require('../internals/an-object'); var isCallable = require('../internals/is-callable'); var classof = require('../internals/classof-raw'); var regexpExec = require('../internals/regexp-exec'); var $TypeError = TypeError; module.exports = function (R, S) { var exec = R.exec; if (isCallable(exec)) { var result = call(exec, R, S); if (result !== null) anObject(result); return result; } if (classof(R) === 'RegExp') return call(regexpExec, R, S); throw new $TypeError('RegExp#exec called on incompatible receiver'); }; },{"../internals/an-object":65,"../internals/classof-raw":77,"../internals/function-call":120,"../internals/is-callable":147,"../internals/regexp-exec":200}],200:[function(require,module,exports){ 'use strict'; var call = require('../internals/function-call'); var uncurryThis = require('../internals/function-uncurry-this'); var toString = require('../internals/to-string'); var regexpFlags = require('../internals/regexp-flags'); var stickyHelpers = require('../internals/regexp-sticky-helpers'); var shared = require('../internals/shared'); var create = require('../internals/object-create'); var getInternalState = require('../internals/internal-state').get; var UNSUPPORTED_DOT_ALL = require('../internals/regexp-unsupported-dot-all'); var UNSUPPORTED_NCG = require('../internals/regexp-unsupported-ncg'); var nativeReplace = shared('native-string-replace', String.prototype.replace); var nativeExec = RegExp.prototype.exec; var patchedExec = nativeExec; var charAt = uncurryThis(''.charAt); var indexOf = uncurryThis(''.indexOf); var replace = uncurryThis(''.replace); var stringSlice = uncurryThis(''.slice); var UPDATES_LAST_INDEX_WRONG = (function () { var re1 = /a/; var re2 = /b*/g; call(nativeExec, re1, 'a'); call(nativeExec, re2, 'a'); return re1.lastIndex !== 0 || re2.lastIndex !== 0; })(); var UNSUPPORTED_Y = stickyHelpers.BROKEN_CARET; var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined; var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG; if (PATCH) { patchedExec = function exec(string) { var re = this; var state = getInternalState(re); var str = toString(string); var raw = state.raw; var result, reCopy, lastIndex, match, i, object, group; if (raw) { raw.lastIndex = re.lastIndex; result = call(patchedExec, raw, str); re.lastIndex = raw.lastIndex; return result; } var groups = state.groups; var sticky = UNSUPPORTED_Y && re.sticky; var flags = call(regexpFlags, re); var source = re.source; var charsAdded = 0; var strCopy = str; if (sticky) { flags = replace(flags, 'y', ''); if (indexOf(flags, 'g') === -1) { flags += 'g'; } strCopy = stringSlice(str, re.lastIndex); if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt(str, re.lastIndex - 1) !== '\n')) { source = '(?: ' + source + ')'; strCopy = ' ' + strCopy; charsAdded++; } reCopy = new RegExp('^(?:' + source + ')', flags); } if (NPCG_INCLUDED) { reCopy = new RegExp('^' + source + '$(?!\\s)', flags); } if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex; match = call(nativeExec, sticky ? reCopy : re, strCopy); if (sticky) { if (match) { match.input = stringSlice(match.input, charsAdded); match[0] = stringSlice(match[0], charsAdded); match.index = re.lastIndex; re.lastIndex += match[0].length; } else re.lastIndex = 0; } else if (UPDATES_LAST_INDEX_WRONG && match) { re.lastIndex = re.global ? match.index + match[0].length : lastIndex; } if (NPCG_INCLUDED && match && match.length > 1) { call(nativeReplace, match[0], reCopy, function () { for (i = 1; i < arguments.length - 2; i++) { if (arguments[i] === undefined) match[i] = undefined; } }); } if (match && groups) { match.groups = object = create(null); for (i = 0; i < groups.length; i++) { group = groups[i]; object[group[0]] = match[group[1]]; } } return match; }; } module.exports = patchedExec; },{"../internals/function-call":120,"../internals/function-uncurry-this":124,"../internals/internal-state":144,"../internals/object-create":174,"../internals/regexp-flags":201,"../internals/regexp-sticky-helpers":203,"../internals/regexp-unsupported-dot-all":204,"../internals/regexp-unsupported-ncg":205,"../internals/shared":224,"../internals/to-string":243}],201:[function(require,module,exports){ 'use strict'; var anObject = require('../internals/an-object'); module.exports = function () { var that = anObject(this); var result = ''; if (that.hasIndices) result += 'd'; if (that.global) result += 'g'; if (that.ignoreCase) result += 'i'; if (that.multiline) result += 'm'; if (that.dotAll) result += 's'; if (that.unicode) result += 'u'; if (that.unicodeSets) result += 'v'; if (that.sticky) result += 'y'; return result; }; },{"../internals/an-object":65}],202:[function(require,module,exports){ 'use strict'; var call = require('../internals/function-call'); var hasOwn = require('../internals/has-own-property'); var isPrototypeOf = require('../internals/object-is-prototype-of'); var regExpFlags = require('../internals/regexp-flags'); var RegExpPrototype = RegExp.prototype; module.exports = function (R) { var flags = R.flags; return flags === undefined && !('flags' in RegExpPrototype) && !hasOwn(R, 'flags') && isPrototypeOf(RegExpPrototype, R) ? call(regExpFlags, R) : flags; }; },{"../internals/function-call":120,"../internals/has-own-property":134,"../internals/object-is-prototype-of":183,"../internals/regexp-flags":201}],203:[function(require,module,exports){ 'use strict'; var fails = require('../internals/fails'); var global = require('../internals/global'); var $RegExp = global.RegExp; var UNSUPPORTED_Y = fails(function () { var re = $RegExp('a', 'y'); re.lastIndex = 2; return re.exec('abcd') !== null; }); var MISSED_STICKY = UNSUPPORTED_Y || fails(function () { return !$RegExp('a', 'y').sticky; }); var BROKEN_CARET = UNSUPPORTED_Y || fails(function () { var re = $RegExp('^r', 'gy'); re.lastIndex = 2; return re.exec('str') !== null; }); module.exports = { BROKEN_CARET: BROKEN_CARET, MISSED_STICKY: MISSED_STICKY, UNSUPPORTED_Y: UNSUPPORTED_Y }; },{"../internals/fails":114,"../internals/global":133}],204:[function(require,module,exports){ 'use strict'; var fails = require('../internals/fails'); var global = require('../internals/global'); var $RegExp = global.RegExp; module.exports = fails(function () { var re = $RegExp('.', 's'); return !(re.dotAll && re.test('\n') && re.flags === 's'); }); },{"../internals/fails":114,"../internals/global":133}],205:[function(require,module,exports){ 'use strict'; var fails = require('../internals/fails'); var global = require('../internals/global'); var $RegExp = global.RegExp; module.exports = fails(function () { var re = $RegExp('(?b)', 'g'); return re.exec('b').groups.a !== 'b' || 'b'.replace(re, '$c') !== 'bc'; }); },{"../internals/fails":114,"../internals/global":133}],206:[function(require,module,exports){ 'use strict'; var isNullOrUndefined = require('../internals/is-null-or-undefined'); var $TypeError = TypeError; module.exports = function (it) { if (isNullOrUndefined(it)) throw new $TypeError("Can't call method on " + it); return it; }; },{"../internals/is-null-or-undefined":151}],207:[function(require,module,exports){ 'use strict'; module.exports = function (x, y) { return x === y || x !== x && y !== y; }; },{}],208:[function(require,module,exports){ 'use strict'; var SetHelpers = require('../internals/set-helpers'); var iterate = require('../internals/set-iterate'); var Set = SetHelpers.Set; var add = SetHelpers.add; module.exports = function (set) { var result = new Set(); iterate(set, function (it) { add(result, it); }); return result; }; },{"../internals/set-helpers":210,"../internals/set-iterate":215}],209:[function(require,module,exports){ 'use strict'; var aSet = require('../internals/a-set'); var SetHelpers = require('../internals/set-helpers'); var clone = require('../internals/set-clone'); var size = require('../internals/set-size'); var getSetRecord = require('../internals/get-set-record'); var iterateSet = require('../internals/set-iterate'); var iterateSimple = require('../internals/iterate-simple'); var has = SetHelpers.has; var remove = SetHelpers.remove; module.exports = function difference(other) { var O = aSet(this); var otherRec = getSetRecord(other); var result = clone(O); if (size(O) <= otherRec.size) iterateSet(O, function (e) { if (otherRec.includes(e)) remove(result, e); }); else iterateSimple(otherRec.getIterator(), function (e) { if (has(O, e)) remove(result, e); }); return result; }; },{"../internals/a-set":61,"../internals/get-set-record":131,"../internals/iterate-simple":156,"../internals/set-clone":208,"../internals/set-helpers":210,"../internals/set-iterate":215,"../internals/set-size":217}],210:[function(require,module,exports){ 'use strict'; var uncurryThis = require('../internals/function-uncurry-this'); var SetPrototype = Set.prototype; module.exports = { Set: Set, add: uncurryThis(SetPrototype.add), has: uncurryThis(SetPrototype.has), remove: uncurryThis(SetPrototype['delete']), proto: SetPrototype }; },{"../internals/function-uncurry-this":124}],211:[function(require,module,exports){ 'use strict'; var aSet = require('../internals/a-set'); var SetHelpers = require('../internals/set-helpers'); var size = require('../internals/set-size'); var getSetRecord = require('../internals/get-set-record'); var iterateSet = require('../internals/set-iterate'); var iterateSimple = require('../internals/iterate-simple'); var Set = SetHelpers.Set; var add = SetHelpers.add; var has = SetHelpers.has; module.exports = function intersection(other) { var O = aSet(this); var otherRec = getSetRecord(other); var result = new Set(); if (size(O) > otherRec.size) { iterateSimple(otherRec.getIterator(), function (e) { if (has(O, e)) add(result, e); }); } else { iterateSet(O, function (e) { if (otherRec.includes(e)) add(result, e); }); } return result; }; },{"../internals/a-set":61,"../internals/get-set-record":131,"../internals/iterate-simple":156,"../internals/set-helpers":210,"../internals/set-iterate":215,"../internals/set-size":217}],212:[function(require,module,exports){ 'use strict'; var aSet = require('../internals/a-set'); var has = require('../internals/set-helpers').has; var size = require('../internals/set-size'); var getSetRecord = require('../internals/get-set-record'); var iterateSet = require('../internals/set-iterate'); var iterateSimple = require('../internals/iterate-simple'); var iteratorClose = require('../internals/iterator-close'); module.exports = function isDisjointFrom(other) { var O = aSet(this); var otherRec = getSetRecord(other); if (size(O) <= otherRec.size) return iterateSet(O, function (e) { if (otherRec.includes(e)) return false; }, true) !== false; var iterator = otherRec.getIterator(); return iterateSimple(iterator, function (e) { if (has(O, e)) return iteratorClose(iterator, 'normal', false); }) !== false; }; },{"../internals/a-set":61,"../internals/get-set-record":131,"../internals/iterate-simple":156,"../internals/iterator-close":158,"../internals/set-helpers":210,"../internals/set-iterate":215,"../internals/set-size":217}],213:[function(require,module,exports){ 'use strict'; var aSet = require('../internals/a-set'); var size = require('../internals/set-size'); var iterate = require('../internals/set-iterate'); var getSetRecord = require('../internals/get-set-record'); module.exports = function isSubsetOf(other) { var O = aSet(this); var otherRec = getSetRecord(other); if (size(O) > otherRec.size) return false; return iterate(O, function (e) { if (!otherRec.includes(e)) return false; }, true) !== false; }; },{"../internals/a-set":61,"../internals/get-set-record":131,"../internals/set-iterate":215,"../internals/set-size":217}],214:[function(require,module,exports){ 'use strict'; var aSet = require('../internals/a-set'); var has = require('../internals/set-helpers').has; var size = require('../internals/set-size'); var getSetRecord = require('../internals/get-set-record'); var iterateSimple = require('../internals/iterate-simple'); var iteratorClose = require('../internals/iterator-close'); module.exports = function isSupersetOf(other) { var O = aSet(this); var otherRec = getSetRecord(other); if (size(O) < otherRec.size) return false; var iterator = otherRec.getIterator(); return iterateSimple(iterator, function (e) { if (!has(O, e)) return iteratorClose(iterator, 'normal', false); }) !== false; }; },{"../internals/a-set":61,"../internals/get-set-record":131,"../internals/iterate-simple":156,"../internals/iterator-close":158,"../internals/set-helpers":210,"../internals/set-size":217}],215:[function(require,module,exports){ 'use strict'; var uncurryThis = require('../internals/function-uncurry-this'); var iterateSimple = require('../internals/iterate-simple'); var SetHelpers = require('../internals/set-helpers'); var Set = SetHelpers.Set; var SetPrototype = SetHelpers.proto; var forEach = uncurryThis(SetPrototype.forEach); var keys = uncurryThis(SetPrototype.keys); var next = keys(new Set()).next; module.exports = function (set, fn, interruptible) { return interruptible ? iterateSimple({ iterator: keys(set), next: next }, fn) : forEach(set, fn); }; },{"../internals/function-uncurry-this":124,"../internals/iterate-simple":156,"../internals/set-helpers":210}],216:[function(require,module,exports){ 'use strict'; var getBuiltIn = require('../internals/get-built-in'); var createSetLike = function (size) { return { size: size, has: function () { return false; }, keys: function () { return { next: function () { return { done: true }; } }; } }; }; module.exports = function (name) { var Set = getBuiltIn('Set'); try { new Set()[name](createSetLike(0)); try { new Set()[name](createSetLike(-1)); return false; } catch (error2) { return true; } } catch (error) { return false; } }; },{"../internals/get-built-in":125}],217:[function(require,module,exports){ 'use strict'; var uncurryThisAccessor = require('../internals/function-uncurry-this-accessor'); var SetHelpers = require('../internals/set-helpers'); module.exports = uncurryThisAccessor(SetHelpers.proto, 'size', 'get') || function (set) { return set.size; }; },{"../internals/function-uncurry-this-accessor":122,"../internals/set-helpers":210}],218:[function(require,module,exports){ 'use strict'; var getBuiltIn = require('../internals/get-built-in'); var defineBuiltInAccessor = require('../internals/define-built-in-accessor'); var wellKnownSymbol = require('../internals/well-known-symbol'); var DESCRIPTORS = require('../internals/descriptors'); var SPECIES = wellKnownSymbol('species'); module.exports = function (CONSTRUCTOR_NAME) { var Constructor = getBuiltIn(CONSTRUCTOR_NAME); if (DESCRIPTORS && Constructor && !Constructor[SPECIES]) { defineBuiltInAccessor(Constructor, SPECIES, { configurable: true, get: function () { return this; } }); } }; },{"../internals/define-built-in-accessor":90,"../internals/descriptors":94,"../internals/get-built-in":125,"../internals/well-known-symbol":252}],219:[function(require,module,exports){ 'use strict'; var aSet = require('../internals/a-set'); var SetHelpers = require('../internals/set-helpers'); var clone = require('../internals/set-clone'); var getSetRecord = require('../internals/get-set-record'); var iterateSimple = require('../internals/iterate-simple'); var add = SetHelpers.add; var has = SetHelpers.has; var remove = SetHelpers.remove; module.exports = function symmetricDifference(other) { var O = aSet(this); var keysIter = getSetRecord(other).getIterator(); var result = clone(O); iterateSimple(keysIter, function (e) { if (has(O, e)) remove(result, e); else add(result, e); }); return result; }; },{"../internals/a-set":61,"../internals/get-set-record":131,"../internals/iterate-simple":156,"../internals/set-clone":208,"../internals/set-helpers":210}],220:[function(require,module,exports){ 'use strict'; var defineProperty = require('../internals/object-define-property').f; var hasOwn = require('../internals/has-own-property'); var wellKnownSymbol = require('../internals/well-known-symbol'); var TO_STRING_TAG = wellKnownSymbol('toStringTag'); module.exports = function (target, TAG, STATIC) { if (target && !STATIC) target = target.prototype; if (target && !hasOwn(target, TO_STRING_TAG)) { defineProperty(target, TO_STRING_TAG, { configurable: true, value: TAG }); } }; },{"../internals/has-own-property":134,"../internals/object-define-property":176,"../internals/well-known-symbol":252}],221:[function(require,module,exports){ 'use strict'; var aSet = require('../internals/a-set'); var add = require('../internals/set-helpers').add; var clone = require('../internals/set-clone'); var getSetRecord = require('../internals/get-set-record'); var iterateSimple = require('../internals/iterate-simple'); module.exports = function union(other) { var O = aSet(this); var keysIter = getSetRecord(other).getIterator(); var result = clone(O); iterateSimple(keysIter, function (it) { add(result, it); }); return result; }; },{"../internals/a-set":61,"../internals/get-set-record":131,"../internals/iterate-simple":156,"../internals/set-clone":208,"../internals/set-helpers":210}],222:[function(require,module,exports){ 'use strict'; var shared = require('../internals/shared'); var uid = require('../internals/uid'); var keys = shared('keys'); module.exports = function (key) { return keys[key] || (keys[key] = uid(key)); }; },{"../internals/shared":224,"../internals/uid":245}],223:[function(require,module,exports){ 'use strict'; var global = require('../internals/global'); var defineGlobalProperty = require('../internals/define-global-property'); var SHARED = '__core-js_shared__'; var store = global[SHARED] || defineGlobalProperty(SHARED, {}); module.exports = store; },{"../internals/define-global-property":93,"../internals/global":133}],224:[function(require,module,exports){ 'use strict'; var IS_PURE = require('../internals/is-pure'); var store = require('../internals/shared-store'); (module.exports = function (key, value) { return store[key] || (store[key] = value !== undefined ? value : {}); })('versions', []).push({ version: '3.33.2', mode: IS_PURE ? 'pure' : 'global', copyright: '© 2014-2023 Denis Pushkarev (zloirock.ru)', license: 'https://github.com/zloirock/core-js/blob/v3.33.2/LICENSE', source: 'https://github.com/zloirock/core-js' }); },{"../internals/is-pure":153,"../internals/shared-store":223}],225:[function(require,module,exports){ 'use strict'; var anObject = require('../internals/an-object'); var aConstructor = require('../internals/a-constructor'); var isNullOrUndefined = require('../internals/is-null-or-undefined'); var wellKnownSymbol = require('../internals/well-known-symbol'); var SPECIES = wellKnownSymbol('species'); module.exports = function (O, defaultConstructor) { var C = anObject(O).constructor; var S; return C === undefined || isNullOrUndefined(S = anObject(C)[SPECIES]) ? defaultConstructor : aConstructor(S); }; },{"../internals/a-constructor":58,"../internals/an-object":65,"../internals/is-null-or-undefined":151,"../internals/well-known-symbol":252}],226:[function(require,module,exports){ 'use strict'; var uncurryThis = require('../internals/function-uncurry-this'); var toIntegerOrInfinity = require('../internals/to-integer-or-infinity'); var toString = require('../internals/to-string'); var requireObjectCoercible = require('../internals/require-object-coercible'); var charAt = uncurryThis(''.charAt); var charCodeAt = uncurryThis(''.charCodeAt); var stringSlice = uncurryThis(''.slice); var createMethod = function (CONVERT_TO_STRING) { return function ($this, pos) { var S = toString(requireObjectCoercible($this)); var position = toIntegerOrInfinity(pos); var size = S.length; var first, second; if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined; first = charCodeAt(S, position); return first < 0xD800 || first > 0xDBFF || position + 1 === size || (second = charCodeAt(S, position + 1)) < 0xDC00 || second > 0xDFFF ? CONVERT_TO_STRING ? charAt(S, position) : first : CONVERT_TO_STRING ? stringSlice(S, position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000; }; }; module.exports = { codeAt: createMethod(false), charAt: createMethod(true) }; },{"../internals/function-uncurry-this":124,"../internals/require-object-coercible":206,"../internals/to-integer-or-infinity":236,"../internals/to-string":243}],227:[function(require,module,exports){ 'use strict'; var toIntegerOrInfinity = require('../internals/to-integer-or-infinity'); var toString = require('../internals/to-string'); var requireObjectCoercible = require('../internals/require-object-coercible'); var $RangeError = RangeError; module.exports = function repeat(count) { var str = toString(requireObjectCoercible(this)); var result = ''; var n = toIntegerOrInfinity(count); if (n < 0 || n === Infinity) throw new $RangeError('Wrong number of repetitions'); for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) result += str; return result; }; },{"../internals/require-object-coercible":206,"../internals/to-integer-or-infinity":236,"../internals/to-string":243}],228:[function(require,module,exports){ 'use strict'; var V8_VERSION = require('../internals/engine-v8-version'); var fails = require('../internals/fails'); var global = require('../internals/global'); var $String = global.String; module.exports = !!Object.getOwnPropertySymbols && !fails(function () { var symbol = Symbol('symbol detection'); return !$String(symbol) || !(Object(symbol) instanceof Symbol) || !Symbol.sham && V8_VERSION && V8_VERSION < 41; }); },{"../internals/engine-v8-version":107,"../internals/fails":114,"../internals/global":133}],229:[function(require,module,exports){ 'use strict'; var call = require('../internals/function-call'); var getBuiltIn = require('../internals/get-built-in'); var wellKnownSymbol = require('../internals/well-known-symbol'); var defineBuiltIn = require('../internals/define-built-in'); module.exports = function () { var Symbol = getBuiltIn('Symbol'); var SymbolPrototype = Symbol && Symbol.prototype; var valueOf = SymbolPrototype && SymbolPrototype.valueOf; var TO_PRIMITIVE = wellKnownSymbol('toPrimitive'); if (SymbolPrototype && !SymbolPrototype[TO_PRIMITIVE]) { defineBuiltIn(SymbolPrototype, TO_PRIMITIVE, function (hint) { return call(valueOf, this); }, { arity: 1 }); } }; },{"../internals/define-built-in":91,"../internals/function-call":120,"../internals/get-built-in":125,"../internals/well-known-symbol":252}],230:[function(require,module,exports){ 'use strict'; var getBuiltIn = require('../internals/get-built-in'); var uncurryThis = require('../internals/function-uncurry-this'); var Symbol = getBuiltIn('Symbol'); var keyFor = Symbol.keyFor; var thisSymbolValue = uncurryThis(Symbol.prototype.valueOf); module.exports = Symbol.isRegisteredSymbol || function isRegisteredSymbol(value) { try { return keyFor(thisSymbolValue(value)) !== undefined; } catch (error) { return false; } }; },{"../internals/function-uncurry-this":124,"../internals/get-built-in":125}],231:[function(require,module,exports){ 'use strict'; var shared = require('../internals/shared'); var getBuiltIn = require('../internals/get-built-in'); var uncurryThis = require('../internals/function-uncurry-this'); var isSymbol = require('../internals/is-symbol'); var wellKnownSymbol = require('../internals/well-known-symbol'); var Symbol = getBuiltIn('Symbol'); var $isWellKnownSymbol = Symbol.isWellKnownSymbol; var getOwnPropertyNames = getBuiltIn('Object', 'getOwnPropertyNames'); var thisSymbolValue = uncurryThis(Symbol.prototype.valueOf); var WellKnownSymbolsStore = shared('wks'); for (var i = 0, symbolKeys = getOwnPropertyNames(Symbol), symbolKeysLength = symbolKeys.length; i < symbolKeysLength; i++) { try { var symbolKey = symbolKeys[i]; if (isSymbol(Symbol[symbolKey])) wellKnownSymbol(symbolKey); } catch (error) { } } module.exports = function isWellKnownSymbol(value) { if ($isWellKnownSymbol && $isWellKnownSymbol(value)) return true; try { var symbol = thisSymbolValue(value); for (var j = 0, keys = getOwnPropertyNames(WellKnownSymbolsStore), keysLength = keys.length; j < keysLength; j++) { if (WellKnownSymbolsStore[keys[j]] == symbol) return true; } } catch (error) { } return false; }; },{"../internals/function-uncurry-this":124,"../internals/get-built-in":125,"../internals/is-symbol":155,"../internals/shared":224,"../internals/well-known-symbol":252}],232:[function(require,module,exports){ 'use strict'; var NATIVE_SYMBOL = require('../internals/symbol-constructor-detection'); module.exports = NATIVE_SYMBOL && !!Symbol['for'] && !!Symbol.keyFor; },{"../internals/symbol-constructor-detection":228}],233:[function(require,module,exports){ 'use strict'; var global = require('../internals/global'); var apply = require('../internals/function-apply'); var bind = require('../internals/function-bind-context'); var isCallable = require('../internals/is-callable'); var hasOwn = require('../internals/has-own-property'); var fails = require('../internals/fails'); var html = require('../internals/html'); var arraySlice = require('../internals/array-slice'); var createElement = require('../internals/document-create-element'); var validateArgumentsLength = require('../internals/validate-arguments-length'); var IS_IOS = require('../internals/engine-is-ios'); var IS_NODE = require('../internals/engine-is-node'); var set = global.setImmediate; var clear = global.clearImmediate; var process = global.process; var Dispatch = global.Dispatch; var Function = global.Function; var MessageChannel = global.MessageChannel; var String = global.String; var counter = 0; var queue = {}; var ONREADYSTATECHANGE = 'onreadystatechange'; var $location, defer, channel, port; fails(function () { $location = global.location; }); var run = function (id) { if (hasOwn(queue, id)) { var fn = queue[id]; delete queue[id]; fn(); } }; var runner = function (id) { return function () { run(id); }; }; var eventListener = function (event) { run(event.data); }; var globalPostMessageDefer = function (id) { global.postMessage(String(id), $location.protocol + '//' + $location.host); }; if (!set || !clear) { set = function setImmediate(handler) { validateArgumentsLength(arguments.length, 1); var fn = isCallable(handler) ? handler : Function(handler); var args = arraySlice(arguments, 1); queue[++counter] = function () { apply(fn, undefined, args); }; defer(counter); return counter; }; clear = function clearImmediate(id) { delete queue[id]; }; if (IS_NODE) { defer = function (id) { process.nextTick(runner(id)); }; } else if (Dispatch && Dispatch.now) { defer = function (id) { Dispatch.now(runner(id)); }; } else if (MessageChannel && !IS_IOS) { channel = new MessageChannel(); port = channel.port2; channel.port1.onmessage = eventListener; defer = bind(port.postMessage, port); } else if ( global.addEventListener && isCallable(global.postMessage) && !global.importScripts && $location && $location.protocol !== 'file:' && !fails(globalPostMessageDefer) ) { defer = globalPostMessageDefer; global.addEventListener('message', eventListener, false); } else if (ONREADYSTATECHANGE in createElement('script')) { defer = function (id) { html.appendChild(createElement('script'))[ONREADYSTATECHANGE] = function () { html.removeChild(this); run(id); }; }; } else { defer = function (id) { setTimeout(runner(id), 0); }; } } module.exports = { set: set, clear: clear }; },{"../internals/array-slice":72,"../internals/document-create-element":96,"../internals/engine-is-ios":103,"../internals/engine-is-node":104,"../internals/fails":114,"../internals/function-apply":117,"../internals/function-bind-context":118,"../internals/global":133,"../internals/has-own-property":134,"../internals/html":137,"../internals/is-callable":147,"../internals/validate-arguments-length":248}],234:[function(require,module,exports){ 'use strict'; var toIntegerOrInfinity = require('../internals/to-integer-or-infinity'); var max = Math.max; var min = Math.min; module.exports = function (index, length) { var integer = toIntegerOrInfinity(index); return integer < 0 ? max(integer + length, 0) : min(integer, length); }; },{"../internals/to-integer-or-infinity":236}],235:[function(require,module,exports){ 'use strict'; var IndexedObject = require('../internals/indexed-object'); var requireObjectCoercible = require('../internals/require-object-coercible'); module.exports = function (it) { return IndexedObject(requireObjectCoercible(it)); }; },{"../internals/indexed-object":139,"../internals/require-object-coercible":206}],236:[function(require,module,exports){ 'use strict'; var trunc = require('../internals/math-trunc'); module.exports = function (argument) { var number = +argument; return number !== number || number === 0 ? 0 : trunc(number); }; },{"../internals/math-trunc":168}],237:[function(require,module,exports){ 'use strict'; var toIntegerOrInfinity = require('../internals/to-integer-or-infinity'); var min = Math.min; module.exports = function (argument) { return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; }; },{"../internals/to-integer-or-infinity":236}],238:[function(require,module,exports){ 'use strict'; var requireObjectCoercible = require('../internals/require-object-coercible'); var $Object = Object; module.exports = function (argument) { return $Object(requireObjectCoercible(argument)); }; },{"../internals/require-object-coercible":206}],239:[function(require,module,exports){ 'use strict'; var call = require('../internals/function-call'); var isObject = require('../internals/is-object'); var isSymbol = require('../internals/is-symbol'); var getMethod = require('../internals/get-method'); var ordinaryToPrimitive = require('../internals/ordinary-to-primitive'); var wellKnownSymbol = require('../internals/well-known-symbol'); var $TypeError = TypeError; var TO_PRIMITIVE = wellKnownSymbol('toPrimitive'); module.exports = function (input, pref) { if (!isObject(input) || isSymbol(input)) return input; var exoticToPrim = getMethod(input, TO_PRIMITIVE); var result; if (exoticToPrim) { if (pref === undefined) pref = 'default'; result = call(exoticToPrim, input, pref); if (!isObject(result) || isSymbol(result)) return result; throw new $TypeError("Can't convert object to primitive value"); } if (pref === undefined) pref = 'number'; return ordinaryToPrimitive(input, pref); }; },{"../internals/function-call":120,"../internals/get-method":130,"../internals/is-object":152,"../internals/is-symbol":155,"../internals/ordinary-to-primitive":190,"../internals/well-known-symbol":252}],240:[function(require,module,exports){ 'use strict'; var toPrimitive = require('../internals/to-primitive'); var isSymbol = require('../internals/is-symbol'); module.exports = function (argument) { var key = toPrimitive(argument, 'string'); return isSymbol(key) ? key : key + ''; }; },{"../internals/is-symbol":155,"../internals/to-primitive":239}],241:[function(require,module,exports){ 'use strict'; var getBuiltIn = require('../internals/get-built-in'); var isCallable = require('../internals/is-callable'); var isIterable = require('../internals/is-iterable'); var isObject = require('../internals/is-object'); var Set = getBuiltIn('Set'); var isSetLike = function (it) { return isObject(it) && typeof it.size == 'number' && isCallable(it.has) && isCallable(it.keys); }; module.exports = function (it) { if (isSetLike(it)) return it; return isIterable(it) ? new Set(it) : it; }; },{"../internals/get-built-in":125,"../internals/is-callable":147,"../internals/is-iterable":150,"../internals/is-object":152}],242:[function(require,module,exports){ 'use strict'; var wellKnownSymbol = require('../internals/well-known-symbol'); var TO_STRING_TAG = wellKnownSymbol('toStringTag'); var test = {}; test[TO_STRING_TAG] = 'z'; module.exports = String(test) === '[object z]'; },{"../internals/well-known-symbol":252}],243:[function(require,module,exports){ 'use strict'; var classof = require('../internals/classof'); var $String = String; module.exports = function (argument) { if (classof(argument) === 'Symbol') throw new TypeError('Cannot convert a Symbol value to a string'); return $String(argument); }; },{"../internals/classof":78}],244:[function(require,module,exports){ 'use strict'; var $String = String; module.exports = function (argument) { try { return $String(argument); } catch (error) { return 'Object'; } }; },{}],245:[function(require,module,exports){ 'use strict'; var uncurryThis = require('../internals/function-uncurry-this'); var id = 0; var postfix = Math.random(); var toString = uncurryThis(1.0.toString); module.exports = function (key) { return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36); }; },{"../internals/function-uncurry-this":124}],246:[function(require,module,exports){ 'use strict'; var NATIVE_SYMBOL = require('../internals/symbol-constructor-detection'); module.exports = NATIVE_SYMBOL && !Symbol.sham && typeof Symbol.iterator == 'symbol'; },{"../internals/symbol-constructor-detection":228}],247:[function(require,module,exports){ 'use strict'; var DESCRIPTORS = require('../internals/descriptors'); var fails = require('../internals/fails'); module.exports = DESCRIPTORS && fails(function () { return Object.defineProperty(function () { }, 'prototype', { value: 42, writable: false }).prototype !== 42; }); },{"../internals/descriptors":94,"../internals/fails":114}],248:[function(require,module,exports){ 'use strict'; var $TypeError = TypeError; module.exports = function (passed, required) { if (passed < required) throw new $TypeError('Not enough arguments'); return passed; }; },{}],249:[function(require,module,exports){ 'use strict'; var global = require('../internals/global'); var isCallable = require('../internals/is-callable'); var WeakMap = global.WeakMap; module.exports = isCallable(WeakMap) && /native code/.test(String(WeakMap)); },{"../internals/global":133,"../internals/is-callable":147}],250:[function(require,module,exports){ 'use strict'; var path = require('../internals/path'); var hasOwn = require('../internals/has-own-property'); var wrappedWellKnownSymbolModule = require('../internals/well-known-symbol-wrapped'); var defineProperty = require('../internals/object-define-property').f; module.exports = function (NAME) { var Symbol = path.Symbol || (path.Symbol = {}); if (!hasOwn(Symbol, NAME)) defineProperty(Symbol, NAME, { value: wrappedWellKnownSymbolModule.f(NAME) }); }; },{"../internals/has-own-property":134,"../internals/object-define-property":176,"../internals/path":192,"../internals/well-known-symbol-wrapped":251}],251:[function(require,module,exports){ 'use strict'; var wellKnownSymbol = require('../internals/well-known-symbol'); exports.f = wellKnownSymbol; },{"../internals/well-known-symbol":252}],252:[function(require,module,exports){ 'use strict'; var global = require('../internals/global'); var shared = require('../internals/shared'); var hasOwn = require('../internals/has-own-property'); var uid = require('../internals/uid'); var NATIVE_SYMBOL = require('../internals/symbol-constructor-detection'); var USE_SYMBOL_AS_UID = require('../internals/use-symbol-as-uid'); var Symbol = global.Symbol; var WellKnownSymbolsStore = shared('wks'); var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol['for'] || Symbol : Symbol && Symbol.withoutSetter || uid; module.exports = function (name) { if (!hasOwn(WellKnownSymbolsStore, name)) { WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn(Symbol, name) ? Symbol[name] : createWellKnownSymbol('Symbol.' + name); } return WellKnownSymbolsStore[name]; }; },{"../internals/global":133,"../internals/has-own-property":134,"../internals/shared":224,"../internals/symbol-constructor-detection":228,"../internals/uid":245,"../internals/use-symbol-as-uid":246}],253:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var isPrototypeOf = require('../internals/object-is-prototype-of'); var getPrototypeOf = require('../internals/object-get-prototype-of'); var setPrototypeOf = require('../internals/object-set-prototype-of'); var copyConstructorProperties = require('../internals/copy-constructor-properties'); var create = require('../internals/object-create'); var createNonEnumerableProperty = require('../internals/create-non-enumerable-property'); var createPropertyDescriptor = require('../internals/create-property-descriptor'); var installErrorCause = require('../internals/install-error-cause'); var installErrorStack = require('../internals/error-stack-install'); var iterate = require('../internals/iterate'); var normalizeStringArgument = require('../internals/normalize-string-argument'); var wellKnownSymbol = require('../internals/well-known-symbol'); var TO_STRING_TAG = wellKnownSymbol('toStringTag'); var $Error = Error; var push = [].push; var $AggregateError = function AggregateError(errors, message ) { var isInstance = isPrototypeOf(AggregateErrorPrototype, this); var that; if (setPrototypeOf) { that = setPrototypeOf(new $Error(), isInstance ? getPrototypeOf(this) : AggregateErrorPrototype); } else { that = isInstance ? this : create(AggregateErrorPrototype); createNonEnumerableProperty(that, TO_STRING_TAG, 'Error'); } if (message !== undefined) createNonEnumerableProperty(that, 'message', normalizeStringArgument(message)); installErrorStack(that, $AggregateError, that.stack, 1); if (arguments.length > 2) installErrorCause(that, arguments[2]); var errorsArray = []; iterate(errors, push, { that: errorsArray }); createNonEnumerableProperty(that, 'errors', errorsArray); return that; }; if (setPrototypeOf) setPrototypeOf($AggregateError, $Error); else copyConstructorProperties($AggregateError, $Error, { name: true }); var AggregateErrorPrototype = $AggregateError.prototype = create($Error.prototype, { constructor: createPropertyDescriptor(1, $AggregateError), message: createPropertyDescriptor(1, ''), name: createPropertyDescriptor(1, 'AggregateError') }); $({ global: true, constructor: true, arity: 2 }, { AggregateError: $AggregateError }); },{"../internals/copy-constructor-properties":83,"../internals/create-non-enumerable-property":87,"../internals/create-property-descriptor":88,"../internals/error-stack-install":111,"../internals/export":113,"../internals/install-error-cause":142,"../internals/iterate":157,"../internals/normalize-string-argument":171,"../internals/object-create":174,"../internals/object-get-prototype-of":181,"../internals/object-is-prototype-of":183,"../internals/object-set-prototype-of":187,"../internals/well-known-symbol":252}],254:[function(require,module,exports){ 'use strict'; require('../modules/es.aggregate-error.constructor'); },{"../modules/es.aggregate-error.constructor":253}],255:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var fails = require('../internals/fails'); var isArray = require('../internals/is-array'); var isObject = require('../internals/is-object'); var toObject = require('../internals/to-object'); var lengthOfArrayLike = require('../internals/length-of-array-like'); var doesNotExceedSafeInteger = require('../internals/does-not-exceed-safe-integer'); var createProperty = require('../internals/create-property'); var arraySpeciesCreate = require('../internals/array-species-create'); var arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support'); var wellKnownSymbol = require('../internals/well-known-symbol'); var V8_VERSION = require('../internals/engine-v8-version'); var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable'); var IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION >= 51 || !fails(function () { var array = []; array[IS_CONCAT_SPREADABLE] = false; return array.concat()[0] !== array; }); var isConcatSpreadable = function (O) { if (!isObject(O)) return false; var spreadable = O[IS_CONCAT_SPREADABLE]; return spreadable !== undefined ? !!spreadable : isArray(O); }; var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !arrayMethodHasSpeciesSupport('concat'); $({ target: 'Array', proto: true, arity: 1, forced: FORCED }, { concat: function concat(arg) { var O = toObject(this); var A = arraySpeciesCreate(O, 0); var n = 0; var i, k, length, len, E; for (i = -1, length = arguments.length; i < length; i++) { E = i === -1 ? O : arguments[i]; if (isConcatSpreadable(E)) { len = lengthOfArrayLike(E); doesNotExceedSafeInteger(n + len); for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]); } else { doesNotExceedSafeInteger(n + 1); createProperty(A, n++, E); } } A.length = n; return A; } }); },{"../internals/array-method-has-species-support":70,"../internals/array-species-create":74,"../internals/create-property":89,"../internals/does-not-exceed-safe-integer":97,"../internals/engine-v8-version":107,"../internals/export":113,"../internals/fails":114,"../internals/is-array":146,"../internals/is-object":152,"../internals/length-of-array-like":163,"../internals/to-object":238,"../internals/well-known-symbol":252}],256:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var from = require('../internals/array-from'); var checkCorrectnessOfIteration = require('../internals/check-correctness-of-iteration'); var INCORRECT_ITERATION = !checkCorrectnessOfIteration(function (iterable) { Array.from(iterable); }); $({ target: 'Array', stat: true, forced: INCORRECT_ITERATION }, { from: from }); },{"../internals/array-from":67,"../internals/check-correctness-of-iteration":76,"../internals/export":113}],257:[function(require,module,exports){ 'use strict'; var toIndexedObject = require('../internals/to-indexed-object'); var addToUnscopables = require('../internals/add-to-unscopables'); var Iterators = require('../internals/iterators'); var InternalStateModule = require('../internals/internal-state'); var defineProperty = require('../internals/object-define-property').f; var defineIterator = require('../internals/iterator-define'); var createIterResultObject = require('../internals/create-iter-result-object'); var IS_PURE = require('../internals/is-pure'); var DESCRIPTORS = require('../internals/descriptors'); var ARRAY_ITERATOR = 'Array Iterator'; var setInternalState = InternalStateModule.set; var 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); var target = state.target; var index = state.index++; if (!target || index >= target.length) { state.target = undefined; return createIterResultObject(undefined, true); } switch (state.kind) { case 'keys': return createIterResultObject(index, false); case 'values': return createIterResultObject(target[index], false); } return createIterResultObject([index, target[index]], false); }, 'values'); var values = Iterators.Arguments = Iterators.Array; addToUnscopables('keys'); addToUnscopables('values'); addToUnscopables('entries'); if (!IS_PURE && DESCRIPTORS && values.name !== 'values') try { defineProperty(values, 'name', { value: 'values' }); } catch (error) { } },{"../internals/add-to-unscopables":62,"../internals/create-iter-result-object":86,"../internals/descriptors":94,"../internals/internal-state":144,"../internals/is-pure":153,"../internals/iterator-define":160,"../internals/iterators":162,"../internals/object-define-property":176,"../internals/to-indexed-object":235}],258:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var getBuiltIn = require('../internals/get-built-in'); var apply = require('../internals/function-apply'); var call = require('../internals/function-call'); var uncurryThis = require('../internals/function-uncurry-this'); var fails = require('../internals/fails'); var isCallable = require('../internals/is-callable'); var isSymbol = require('../internals/is-symbol'); var arraySlice = require('../internals/array-slice'); var getReplacerFunction = require('../internals/get-json-replacer-function'); var NATIVE_SYMBOL = require('../internals/symbol-constructor-detection'); var $String = String; var $stringify = getBuiltIn('JSON', 'stringify'); var exec = uncurryThis(/./.exec); var charAt = uncurryThis(''.charAt); var charCodeAt = uncurryThis(''.charCodeAt); var replace = uncurryThis(''.replace); var numberToString = uncurryThis(1.0.toString); var tester = /[\uD800-\uDFFF]/g; var low = /^[\uD800-\uDBFF]$/; var hi = /^[\uDC00-\uDFFF]$/; var WRONG_SYMBOLS_CONVERSION = !NATIVE_SYMBOL || fails(function () { var symbol = getBuiltIn('Symbol')('stringify detection'); return $stringify([symbol]) !== '[null]' || $stringify({ a: symbol }) !== '{}' || $stringify(Object(symbol)) !== '{}'; }); var ILL_FORMED_UNICODE = fails(function () { return $stringify('\uDF06\uD834') !== '"\\udf06\\ud834"' || $stringify('\uDEAD') !== '"\\udead"'; }); var stringifyWithSymbolsFix = function (it, replacer) { var args = arraySlice(arguments); var $replacer = getReplacerFunction(replacer); if (!isCallable($replacer) && (it === undefined || isSymbol(it))) return; args[1] = function (key, value) { if (isCallable($replacer)) value = call($replacer, this, $String(key), value); if (!isSymbol(value)) return value; }; return apply($stringify, null, args); }; var fixIllFormed = function (match, offset, string) { var prev = charAt(string, offset - 1); var next = charAt(string, offset + 1); if ((exec(low, match) && !exec(hi, next)) || (exec(hi, match) && !exec(low, prev))) { return '\\u' + numberToString(charCodeAt(match, 0), 16); } return match; }; if ($stringify) { $({ target: 'JSON', stat: true, arity: 3, forced: WRONG_SYMBOLS_CONVERSION || ILL_FORMED_UNICODE }, { stringify: function stringify(it, replacer, space) { var args = arraySlice(arguments); var result = apply(WRONG_SYMBOLS_CONVERSION ? stringifyWithSymbolsFix : $stringify, null, args); return ILL_FORMED_UNICODE && typeof result == 'string' ? replace(result, tester, fixIllFormed) : result; } }); } },{"../internals/array-slice":72,"../internals/export":113,"../internals/fails":114,"../internals/function-apply":117,"../internals/function-call":120,"../internals/function-uncurry-this":124,"../internals/get-built-in":125,"../internals/get-json-replacer-function":129,"../internals/is-callable":147,"../internals/is-symbol":155,"../internals/symbol-constructor-detection":228}],259:[function(require,module,exports){ 'use strict'; var global = require('../internals/global'); var setToStringTag = require('../internals/set-to-string-tag'); setToStringTag(global.JSON, 'JSON', true); },{"../internals/global":133,"../internals/set-to-string-tag":220}],260:[function(require,module,exports){ 'use strict'; var collection = require('../internals/collection'); var collectionStrong = require('../internals/collection-strong'); collection('Map', function (init) { return function Map() { return init(this, arguments.length ? arguments[0] : undefined); }; }, collectionStrong); },{"../internals/collection":82,"../internals/collection-strong":81}],261:[function(require,module,exports){ 'use strict'; require('../modules/es.map.constructor'); },{"../modules/es.map.constructor":260}],262:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var floor = Math.floor; var log = Math.log; var LOG2E = Math.LOG2E; $({ target: 'Math', stat: true }, { clz32: function clz32(x) { var n = x >>> 0; return n ? 31 - floor(log(n + 0.5) * LOG2E) : 32; } }); },{"../internals/export":113}],263:[function(require,module,exports){ 'use strict'; var setToStringTag = require('../internals/set-to-string-tag'); setToStringTag(Math, 'Math', true); },{"../internals/set-to-string-tag":220}],264:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var assign = require('../internals/object-assign'); $({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, { assign: assign }); },{"../internals/export":113,"../internals/object-assign":173}],265:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var $entries = require('../internals/object-to-array').entries; $({ target: 'Object', stat: true }, { entries: function entries(O) { return $entries(O); } }); },{"../internals/export":113,"../internals/object-to-array":188}],266:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var NATIVE_SYMBOL = require('../internals/symbol-constructor-detection'); var fails = require('../internals/fails'); var getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols'); var toObject = require('../internals/to-object'); var FORCED = !NATIVE_SYMBOL || fails(function () { getOwnPropertySymbolsModule.f(1); }); $({ target: 'Object', stat: true, forced: FORCED }, { getOwnPropertySymbols: function getOwnPropertySymbols(it) { var $getOwnPropertySymbols = getOwnPropertySymbolsModule.f; return $getOwnPropertySymbols ? $getOwnPropertySymbols(toObject(it)) : []; } }); },{"../internals/export":113,"../internals/fails":114,"../internals/object-get-own-property-symbols":180,"../internals/symbol-constructor-detection":228,"../internals/to-object":238}],267:[function(require,module,exports){ 'use strict'; var TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support'); var defineBuiltIn = require('../internals/define-built-in'); var toString = require('../internals/object-to-string'); if (!TO_STRING_TAG_SUPPORT) { defineBuiltIn(Object.prototype, 'toString', toString, { unsafe: true }); } },{"../internals/define-built-in":91,"../internals/object-to-string":189,"../internals/to-string-tag-support":242}],268:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var call = require('../internals/function-call'); var aCallable = require('../internals/a-callable'); var newPromiseCapabilityModule = require('../internals/new-promise-capability'); var perform = require('../internals/perform'); var iterate = require('../internals/iterate'); var PROMISE_STATICS_INCORRECT_ITERATION = require('../internals/promise-statics-incorrect-iteration'); $({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, { allSettled: function allSettled(iterable) { var C = this; var capability = newPromiseCapabilityModule.f(C); var resolve = capability.resolve; var reject = capability.reject; var result = perform(function () { var promiseResolve = aCallable(C.resolve); var values = []; var counter = 0; var remaining = 1; iterate(iterable, function (promise) { var index = counter++; var alreadyCalled = false; remaining++; call(promiseResolve, C, promise).then(function (value) { if (alreadyCalled) return; alreadyCalled = true; values[index] = { status: 'fulfilled', value: value }; --remaining || resolve(values); }, function (error) { if (alreadyCalled) return; alreadyCalled = true; values[index] = { status: 'rejected', reason: error }; --remaining || resolve(values); }); }); --remaining || resolve(values); }); if (result.error) reject(result.value); return capability.promise; } }); },{"../internals/a-callable":57,"../internals/export":113,"../internals/function-call":120,"../internals/iterate":157,"../internals/new-promise-capability":170,"../internals/perform":193,"../internals/promise-statics-incorrect-iteration":197}],269:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var call = require('../internals/function-call'); var aCallable = require('../internals/a-callable'); var newPromiseCapabilityModule = require('../internals/new-promise-capability'); var perform = require('../internals/perform'); var iterate = require('../internals/iterate'); var PROMISE_STATICS_INCORRECT_ITERATION = require('../internals/promise-statics-incorrect-iteration'); $({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, { all: function all(iterable) { var C = this; var capability = newPromiseCapabilityModule.f(C); var resolve = capability.resolve; var reject = capability.reject; var result = perform(function () { var $promiseResolve = aCallable(C.resolve); var values = []; var counter = 0; var remaining = 1; iterate(iterable, function (promise) { var index = counter++; var alreadyCalled = false; remaining++; call($promiseResolve, C, promise).then(function (value) { if (alreadyCalled) return; alreadyCalled = true; values[index] = value; --remaining || resolve(values); }, reject); }); --remaining || resolve(values); }); if (result.error) reject(result.value); return capability.promise; } }); },{"../internals/a-callable":57,"../internals/export":113,"../internals/function-call":120,"../internals/iterate":157,"../internals/new-promise-capability":170,"../internals/perform":193,"../internals/promise-statics-incorrect-iteration":197}],270:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var call = require('../internals/function-call'); var aCallable = require('../internals/a-callable'); var getBuiltIn = require('../internals/get-built-in'); var newPromiseCapabilityModule = require('../internals/new-promise-capability'); var perform = require('../internals/perform'); var iterate = require('../internals/iterate'); var PROMISE_STATICS_INCORRECT_ITERATION = require('../internals/promise-statics-incorrect-iteration'); var PROMISE_ANY_ERROR = 'No one promise resolved'; $({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, { any: function any(iterable) { var C = this; var AggregateError = getBuiltIn('AggregateError'); var capability = newPromiseCapabilityModule.f(C); var resolve = capability.resolve; var reject = capability.reject; var result = perform(function () { var promiseResolve = aCallable(C.resolve); var errors = []; var counter = 0; var remaining = 1; var alreadyResolved = false; iterate(iterable, function (promise) { var index = counter++; var alreadyRejected = false; remaining++; call(promiseResolve, C, promise).then(function (value) { if (alreadyRejected || alreadyResolved) return; alreadyResolved = true; resolve(value); }, function (error) { if (alreadyRejected || alreadyResolved) return; alreadyRejected = true; errors[index] = error; --remaining || reject(new AggregateError(errors, PROMISE_ANY_ERROR)); }); }); --remaining || reject(new AggregateError(errors, PROMISE_ANY_ERROR)); }); if (result.error) reject(result.value); return capability.promise; } }); },{"../internals/a-callable":57,"../internals/export":113,"../internals/function-call":120,"../internals/get-built-in":125,"../internals/iterate":157,"../internals/new-promise-capability":170,"../internals/perform":193,"../internals/promise-statics-incorrect-iteration":197}],271:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var IS_PURE = require('../internals/is-pure'); var FORCED_PROMISE_CONSTRUCTOR = require('../internals/promise-constructor-detection').CONSTRUCTOR; var NativePromiseConstructor = require('../internals/promise-native-constructor'); var getBuiltIn = require('../internals/get-built-in'); var isCallable = require('../internals/is-callable'); var defineBuiltIn = require('../internals/define-built-in'); var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype; $({ target: 'Promise', proto: true, forced: FORCED_PROMISE_CONSTRUCTOR, real: true }, { 'catch': function (onRejected) { return this.then(undefined, onRejected); } }); if (!IS_PURE && isCallable(NativePromiseConstructor)) { var method = getBuiltIn('Promise').prototype['catch']; if (NativePromisePrototype['catch'] !== method) { defineBuiltIn(NativePromisePrototype, 'catch', method, { unsafe: true }); } } },{"../internals/define-built-in":91,"../internals/export":113,"../internals/get-built-in":125,"../internals/is-callable":147,"../internals/is-pure":153,"../internals/promise-constructor-detection":194,"../internals/promise-native-constructor":195}],272:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var IS_PURE = require('../internals/is-pure'); var IS_NODE = require('../internals/engine-is-node'); var global = require('../internals/global'); var call = require('../internals/function-call'); var defineBuiltIn = require('../internals/define-built-in'); var setPrototypeOf = require('../internals/object-set-prototype-of'); var setToStringTag = require('../internals/set-to-string-tag'); var setSpecies = require('../internals/set-species'); var aCallable = require('../internals/a-callable'); var isCallable = require('../internals/is-callable'); var isObject = require('../internals/is-object'); var anInstance = require('../internals/an-instance'); var speciesConstructor = require('../internals/species-constructor'); var task = require('../internals/task').set; var microtask = require('../internals/microtask'); var hostReportErrors = require('../internals/host-report-errors'); var perform = require('../internals/perform'); var Queue = require('../internals/queue'); var InternalStateModule = require('../internals/internal-state'); var NativePromiseConstructor = require('../internals/promise-native-constructor'); var PromiseConstructorDetection = require('../internals/promise-constructor-detection'); var newPromiseCapabilityModule = require('../internals/new-promise-capability'); var PROMISE = 'Promise'; var FORCED_PROMISE_CONSTRUCTOR = PromiseConstructorDetection.CONSTRUCTOR; var NATIVE_PROMISE_REJECTION_EVENT = PromiseConstructorDetection.REJECTION_EVENT; var NATIVE_PROMISE_SUBCLASSING = PromiseConstructorDetection.SUBCLASSING; var getInternalPromiseState = InternalStateModule.getterFor(PROMISE); var setInternalState = InternalStateModule.set; var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype; var PromiseConstructor = NativePromiseConstructor; var PromisePrototype = NativePromisePrototype; var TypeError = global.TypeError; var document = global.document; var process = global.process; var newPromiseCapability = newPromiseCapabilityModule.f; var newGenericPromiseCapability = newPromiseCapability; var DISPATCH_EVENT = !!(document && document.createEvent && global.dispatchEvent); var UNHANDLED_REJECTION = 'unhandledrejection'; var REJECTION_HANDLED = 'rejectionhandled'; var PENDING = 0; var FULFILLED = 1; var REJECTED = 2; var HANDLED = 1; var UNHANDLED = 2; var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen; var isThenable = function (it) { var then; return isObject(it) && isCallable(then = it.then) ? then : false; }; var callReaction = function (reaction, state) { var value = state.value; var ok = state.state === FULFILLED; var handler = ok ? reaction.ok : reaction.fail; var resolve = reaction.resolve; var reject = reaction.reject; var domain = reaction.domain; var result, then, exited; try { if (handler) { if (!ok) { if (state.rejection === UNHANDLED) onHandleUnhandled(state); state.rejection = HANDLED; } if (handler === true) result = value; else { if (domain) domain.enter(); result = handler(value); if (domain) { domain.exit(); exited = true; } } if (result === reaction.promise) { reject(new TypeError('Promise-chain cycle')); } else if (then = isThenable(result)) { call(then, result, resolve, reject); } else resolve(result); } else reject(value); } catch (error) { if (domain && !exited) domain.exit(); reject(error); } }; var notify = function (state, isReject) { if (state.notified) return; state.notified = true; microtask(function () { var reactions = state.reactions; var reaction; while (reaction = reactions.get()) { callReaction(reaction, state); } state.notified = false; if (isReject && !state.rejection) onUnhandled(state); }); }; var dispatchEvent = function (name, promise, reason) { var event, handler; if (DISPATCH_EVENT) { event = document.createEvent('Event'); event.promise = promise; event.reason = reason; event.initEvent(name, false, true); global.dispatchEvent(event); } else event = { promise: promise, reason: reason }; if (!NATIVE_PROMISE_REJECTION_EVENT && (handler = global['on' + name])) handler(event); else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason); }; var onUnhandled = function (state) { call(task, global, function () { var promise = state.facade; var value = state.value; var IS_UNHANDLED = isUnhandled(state); var result; if (IS_UNHANDLED) { result = perform(function () { if (IS_NODE) { process.emit('unhandledRejection', value, promise); } else dispatchEvent(UNHANDLED_REJECTION, promise, value); }); state.rejection = IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED; if (result.error) throw result.value; } }); }; var isUnhandled = function (state) { return state.rejection !== HANDLED && !state.parent; }; var onHandleUnhandled = function (state) { call(task, global, function () { var promise = state.facade; if (IS_NODE) { process.emit('rejectionHandled', promise); } else dispatchEvent(REJECTION_HANDLED, promise, state.value); }); }; var bind = function (fn, state, unwrap) { return function (value) { fn(state, value, unwrap); }; }; var internalReject = function (state, value, unwrap) { if (state.done) return; state.done = true; if (unwrap) state = unwrap; state.value = value; state.state = REJECTED; notify(state, true); }; var internalResolve = function (state, value, unwrap) { if (state.done) return; state.done = true; if (unwrap) state = unwrap; try { if (state.facade === value) throw new TypeError("Promise can't be resolved itself"); var then = isThenable(value); if (then) { microtask(function () { var wrapper = { done: false }; try { call(then, value, bind(internalResolve, wrapper, state), bind(internalReject, wrapper, state) ); } catch (error) { internalReject(wrapper, error, state); } }); } else { state.value = value; state.state = FULFILLED; notify(state, false); } } catch (error) { internalReject({ done: false }, error, state); } }; if (FORCED_PROMISE_CONSTRUCTOR) { PromiseConstructor = function Promise(executor) { anInstance(this, PromisePrototype); aCallable(executor); call(Internal, this); var state = getInternalPromiseState(this); try { executor(bind(internalResolve, state), bind(internalReject, state)); } catch (error) { internalReject(state, error); } }; PromisePrototype = PromiseConstructor.prototype; Internal = function Promise(executor) { setInternalState(this, { type: PROMISE, done: false, notified: false, parent: false, reactions: new Queue(), rejection: false, state: PENDING, value: undefined }); }; Internal.prototype = defineBuiltIn(PromisePrototype, 'then', function then(onFulfilled, onRejected) { var state = getInternalPromiseState(this); var reaction = newPromiseCapability(speciesConstructor(this, PromiseConstructor)); state.parent = true; reaction.ok = isCallable(onFulfilled) ? onFulfilled : true; reaction.fail = isCallable(onRejected) && onRejected; reaction.domain = IS_NODE ? process.domain : undefined; if (state.state === PENDING) state.reactions.add(reaction); else microtask(function () { callReaction(reaction, state); }); return reaction.promise; }); OwnPromiseCapability = function () { var promise = new Internal(); var state = getInternalPromiseState(promise); this.promise = promise; this.resolve = bind(internalResolve, state); this.reject = bind(internalReject, state); }; newPromiseCapabilityModule.f = newPromiseCapability = function (C) { return C === PromiseConstructor || C === PromiseWrapper ? new OwnPromiseCapability(C) : newGenericPromiseCapability(C); }; if (!IS_PURE && isCallable(NativePromiseConstructor) && NativePromisePrototype !== Object.prototype) { nativeThen = NativePromisePrototype.then; if (!NATIVE_PROMISE_SUBCLASSING) { defineBuiltIn(NativePromisePrototype, 'then', function then(onFulfilled, onRejected) { var that = this; return new PromiseConstructor(function (resolve, reject) { call(nativeThen, that, resolve, reject); }).then(onFulfilled, onRejected); }, { unsafe: true }); } try { delete NativePromisePrototype.constructor; } catch (error) { } if (setPrototypeOf) { setPrototypeOf(NativePromisePrototype, PromisePrototype); } } } $({ global: true, constructor: true, wrap: true, forced: FORCED_PROMISE_CONSTRUCTOR }, { Promise: PromiseConstructor }); setToStringTag(PromiseConstructor, PROMISE, false, true); setSpecies(PROMISE); },{"../internals/a-callable":57,"../internals/an-instance":64,"../internals/define-built-in":91,"../internals/engine-is-node":104,"../internals/export":113,"../internals/function-call":120,"../internals/global":133,"../internals/host-report-errors":136,"../internals/internal-state":144,"../internals/is-callable":147,"../internals/is-object":152,"../internals/is-pure":153,"../internals/microtask":169,"../internals/new-promise-capability":170,"../internals/object-set-prototype-of":187,"../internals/perform":193,"../internals/promise-constructor-detection":194,"../internals/promise-native-constructor":195,"../internals/queue":198,"../internals/set-species":218,"../internals/set-to-string-tag":220,"../internals/species-constructor":225,"../internals/task":233}],273:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var IS_PURE = require('../internals/is-pure'); var NativePromiseConstructor = require('../internals/promise-native-constructor'); var fails = require('../internals/fails'); var getBuiltIn = require('../internals/get-built-in'); var isCallable = require('../internals/is-callable'); var speciesConstructor = require('../internals/species-constructor'); var promiseResolve = require('../internals/promise-resolve'); var defineBuiltIn = require('../internals/define-built-in'); var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype; var NON_GENERIC = !!NativePromiseConstructor && fails(function () { NativePromisePrototype['finally'].call({ then: function () { } }, function () { }); }); $({ target: 'Promise', proto: true, real: true, forced: NON_GENERIC }, { 'finally': function (onFinally) { var C = speciesConstructor(this, getBuiltIn('Promise')); var isFunction = isCallable(onFinally); return this.then( isFunction ? function (x) { return promiseResolve(C, onFinally()).then(function () { return x; }); } : onFinally, isFunction ? function (e) { return promiseResolve(C, onFinally()).then(function () { throw e; }); } : onFinally ); } }); if (!IS_PURE && isCallable(NativePromiseConstructor)) { var method = getBuiltIn('Promise').prototype['finally']; if (NativePromisePrototype['finally'] !== method) { defineBuiltIn(NativePromisePrototype, 'finally', method, { unsafe: true }); } } },{"../internals/define-built-in":91,"../internals/export":113,"../internals/fails":114,"../internals/get-built-in":125,"../internals/is-callable":147,"../internals/is-pure":153,"../internals/promise-native-constructor":195,"../internals/promise-resolve":196,"../internals/species-constructor":225}],274:[function(require,module,exports){ 'use strict'; require('../modules/es.promise.constructor'); require('../modules/es.promise.all'); require('../modules/es.promise.catch'); require('../modules/es.promise.race'); require('../modules/es.promise.reject'); require('../modules/es.promise.resolve'); },{"../modules/es.promise.all":269,"../modules/es.promise.catch":271,"../modules/es.promise.constructor":272,"../modules/es.promise.race":275,"../modules/es.promise.reject":276,"../modules/es.promise.resolve":277}],275:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var call = require('../internals/function-call'); var aCallable = require('../internals/a-callable'); var newPromiseCapabilityModule = require('../internals/new-promise-capability'); var perform = require('../internals/perform'); var iterate = require('../internals/iterate'); var PROMISE_STATICS_INCORRECT_ITERATION = require('../internals/promise-statics-incorrect-iteration'); $({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, { race: function race(iterable) { var C = this; var capability = newPromiseCapabilityModule.f(C); var reject = capability.reject; var result = perform(function () { var $promiseResolve = aCallable(C.resolve); iterate(iterable, function (promise) { call($promiseResolve, C, promise).then(capability.resolve, reject); }); }); if (result.error) reject(result.value); return capability.promise; } }); },{"../internals/a-callable":57,"../internals/export":113,"../internals/function-call":120,"../internals/iterate":157,"../internals/new-promise-capability":170,"../internals/perform":193,"../internals/promise-statics-incorrect-iteration":197}],276:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var call = require('../internals/function-call'); var newPromiseCapabilityModule = require('../internals/new-promise-capability'); var FORCED_PROMISE_CONSTRUCTOR = require('../internals/promise-constructor-detection').CONSTRUCTOR; $({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR }, { reject: function reject(r) { var capability = newPromiseCapabilityModule.f(this); call(capability.reject, undefined, r); return capability.promise; } }); },{"../internals/export":113,"../internals/function-call":120,"../internals/new-promise-capability":170,"../internals/promise-constructor-detection":194}],277:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var getBuiltIn = require('../internals/get-built-in'); var IS_PURE = require('../internals/is-pure'); var NativePromiseConstructor = require('../internals/promise-native-constructor'); var FORCED_PROMISE_CONSTRUCTOR = require('../internals/promise-constructor-detection').CONSTRUCTOR; var promiseResolve = require('../internals/promise-resolve'); var PromiseConstructorWrapper = getBuiltIn('Promise'); var CHECK_WRAPPER = IS_PURE && !FORCED_PROMISE_CONSTRUCTOR; $({ target: 'Promise', stat: true, forced: IS_PURE || FORCED_PROMISE_CONSTRUCTOR }, { resolve: function resolve(x) { return promiseResolve(CHECK_WRAPPER && this === PromiseConstructorWrapper ? NativePromiseConstructor : this, x); } }); },{"../internals/export":113,"../internals/get-built-in":125,"../internals/is-pure":153,"../internals/promise-constructor-detection":194,"../internals/promise-native-constructor":195,"../internals/promise-resolve":196}],278:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var global = require('../internals/global'); var setToStringTag = require('../internals/set-to-string-tag'); $({ global: true }, { Reflect: {} }); setToStringTag(global.Reflect, 'Reflect', true); },{"../internals/export":113,"../internals/global":133,"../internals/set-to-string-tag":220}],279:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var exec = require('../internals/regexp-exec'); $({ target: 'RegExp', proto: true, forced: /./.exec !== exec }, { exec: exec }); },{"../internals/export":113,"../internals/regexp-exec":200}],280:[function(require,module,exports){ 'use strict'; var collection = require('../internals/collection'); var collectionStrong = require('../internals/collection-strong'); collection('Set', function (init) { return function Set() { return init(this, arguments.length ? arguments[0] : undefined); }; }, collectionStrong); },{"../internals/collection":82,"../internals/collection-strong":81}],281:[function(require,module,exports){ 'use strict'; require('../modules/es.set.constructor'); },{"../modules/es.set.constructor":280}],282:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var uncurryThis = require('../internals/function-uncurry-this-clause'); var getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f; var toLength = require('../internals/to-length'); var toString = require('../internals/to-string'); var notARegExp = require('../internals/not-a-regexp'); var requireObjectCoercible = require('../internals/require-object-coercible'); var correctIsRegExpLogic = require('../internals/correct-is-regexp-logic'); var IS_PURE = require('../internals/is-pure'); var nativeEndsWith = uncurryThis(''.endsWith); var slice = uncurryThis(''.slice); var min = Math.min; var CORRECT_IS_REGEXP_LOGIC = correctIsRegExpLogic('endsWith'); var MDN_POLYFILL_BUG = !IS_PURE && !CORRECT_IS_REGEXP_LOGIC && !!function () { var descriptor = getOwnPropertyDescriptor(String.prototype, 'endsWith'); return descriptor && !descriptor.writable; }(); $({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC }, { endsWith: function endsWith(searchString ) { var that = toString(requireObjectCoercible(this)); notARegExp(searchString); var endPosition = arguments.length > 1 ? arguments[1] : undefined; var len = that.length; var end = endPosition === undefined ? len : min(toLength(endPosition), len); var search = toString(searchString); return nativeEndsWith ? nativeEndsWith(that, search, end) : slice(that, end - search.length, end) === search; } }); },{"../internals/correct-is-regexp-logic":84,"../internals/export":113,"../internals/function-uncurry-this-clause":123,"../internals/is-pure":153,"../internals/not-a-regexp":172,"../internals/object-get-own-property-descriptor":177,"../internals/require-object-coercible":206,"../internals/to-length":237,"../internals/to-string":243}],283:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var uncurryThis = require('../internals/function-uncurry-this'); var notARegExp = require('../internals/not-a-regexp'); var requireObjectCoercible = require('../internals/require-object-coercible'); var toString = require('../internals/to-string'); var correctIsRegExpLogic = require('../internals/correct-is-regexp-logic'); var stringIndexOf = uncurryThis(''.indexOf); $({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }, { includes: function includes(searchString ) { return !!~stringIndexOf( toString(requireObjectCoercible(this)), toString(notARegExp(searchString)), arguments.length > 1 ? arguments[1] : undefined ); } }); },{"../internals/correct-is-regexp-logic":84,"../internals/export":113,"../internals/function-uncurry-this":124,"../internals/not-a-regexp":172,"../internals/require-object-coercible":206,"../internals/to-string":243}],284:[function(require,module,exports){ 'use strict'; var charAt = require('../internals/string-multibyte').charAt; var toString = require('../internals/to-string'); var InternalStateModule = require('../internals/internal-state'); var defineIterator = require('../internals/iterator-define'); var createIterResultObject = require('../internals/create-iter-result-object'); var STRING_ITERATOR = 'String Iterator'; var setInternalState = InternalStateModule.set; var getInternalState = InternalStateModule.getterFor(STRING_ITERATOR); defineIterator(String, 'String', function (iterated) { setInternalState(this, { type: STRING_ITERATOR, string: toString(iterated), index: 0 }); }, function next() { var state = getInternalState(this); var string = state.string; var index = state.index; var point; if (index >= string.length) return createIterResultObject(undefined, true); point = charAt(string, index); state.index += point.length; return createIterResultObject(point, false); }); },{"../internals/create-iter-result-object":86,"../internals/internal-state":144,"../internals/iterator-define":160,"../internals/string-multibyte":226,"../internals/to-string":243}],285:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var repeat = require('../internals/string-repeat'); $({ target: 'String', proto: true }, { repeat: repeat }); },{"../internals/export":113,"../internals/string-repeat":227}],286:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var call = require('../internals/function-call'); var uncurryThis = require('../internals/function-uncurry-this'); var requireObjectCoercible = require('../internals/require-object-coercible'); var isCallable = require('../internals/is-callable'); var isNullOrUndefined = require('../internals/is-null-or-undefined'); var isRegExp = require('../internals/is-regexp'); var toString = require('../internals/to-string'); var getMethod = require('../internals/get-method'); var getRegExpFlags = require('../internals/regexp-get-flags'); var getSubstitution = require('../internals/get-substitution'); var wellKnownSymbol = require('../internals/well-known-symbol'); var IS_PURE = require('../internals/is-pure'); var REPLACE = wellKnownSymbol('replace'); var $TypeError = TypeError; var indexOf = uncurryThis(''.indexOf); var replace = uncurryThis(''.replace); var stringSlice = uncurryThis(''.slice); var max = Math.max; var stringIndexOf = function (string, searchValue, fromIndex) { if (fromIndex > string.length) return -1; if (searchValue === '') return fromIndex; return indexOf(string, searchValue, fromIndex); }; $({ target: 'String', proto: true }, { replaceAll: function replaceAll(searchValue, replaceValue) { var O = requireObjectCoercible(this); var IS_REG_EXP, flags, replacer, string, searchString, functionalReplace, searchLength, advanceBy, replacement; var position = 0; var endOfLastMatch = 0; var result = ''; if (!isNullOrUndefined(searchValue)) { IS_REG_EXP = isRegExp(searchValue); if (IS_REG_EXP) { flags = toString(requireObjectCoercible(getRegExpFlags(searchValue))); if (!~indexOf(flags, 'g')) throw new $TypeError('`.replaceAll` does not allow non-global regexes'); } replacer = getMethod(searchValue, REPLACE); if (replacer) { return call(replacer, searchValue, O, replaceValue); } else if (IS_PURE && IS_REG_EXP) { return replace(toString(O), searchValue, replaceValue); } } string = toString(O); searchString = toString(searchValue); functionalReplace = isCallable(replaceValue); if (!functionalReplace) replaceValue = toString(replaceValue); searchLength = searchString.length; advanceBy = max(1, searchLength); position = stringIndexOf(string, searchString, 0); while (position !== -1) { replacement = functionalReplace ? toString(replaceValue(searchString, position, string)) : getSubstitution(searchString, string, position, [], undefined, replaceValue); result += stringSlice(string, endOfLastMatch, position) + replacement; endOfLastMatch = position + searchLength; position = stringIndexOf(string, searchString, position + advanceBy); } if (endOfLastMatch < string.length) { result += stringSlice(string, endOfLastMatch); } return result; } }); },{"../internals/export":113,"../internals/function-call":120,"../internals/function-uncurry-this":124,"../internals/get-method":130,"../internals/get-substitution":132,"../internals/is-callable":147,"../internals/is-null-or-undefined":151,"../internals/is-pure":153,"../internals/is-regexp":154,"../internals/regexp-get-flags":202,"../internals/require-object-coercible":206,"../internals/to-string":243,"../internals/well-known-symbol":252}],287:[function(require,module,exports){ 'use strict'; var apply = require('../internals/function-apply'); var call = require('../internals/function-call'); var uncurryThis = require('../internals/function-uncurry-this'); var fixRegExpWellKnownSymbolLogic = require('../internals/fix-regexp-well-known-symbol-logic'); var fails = require('../internals/fails'); var anObject = require('../internals/an-object'); var isCallable = require('../internals/is-callable'); var isNullOrUndefined = require('../internals/is-null-or-undefined'); var toIntegerOrInfinity = require('../internals/to-integer-or-infinity'); var toLength = require('../internals/to-length'); var toString = require('../internals/to-string'); var requireObjectCoercible = require('../internals/require-object-coercible'); var advanceStringIndex = require('../internals/advance-string-index'); var getMethod = require('../internals/get-method'); var getSubstitution = require('../internals/get-substitution'); var regExpExec = require('../internals/regexp-exec-abstract'); var wellKnownSymbol = require('../internals/well-known-symbol'); var REPLACE = wellKnownSymbol('replace'); var max = Math.max; var min = Math.min; var concat = uncurryThis([].concat); var push = uncurryThis([].push); var stringIndexOf = uncurryThis(''.indexOf); var stringSlice = uncurryThis(''.slice); var maybeToString = function (it) { return it === undefined ? it : String(it); }; var REPLACE_KEEPS_$0 = (function () { return 'a'.replace(/./, '$0') === '$0'; })(); var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () { if (/./[REPLACE]) { return /./[REPLACE]('a', '$0') === ''; } return false; })(); var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () { var re = /./; re.exec = function () { var result = []; result.groups = { a: '7' }; return result; }; return ''.replace(re, '$') !== '7'; }); fixRegExpWellKnownSymbolLogic('replace', function (_, nativeReplace, maybeCallNative) { var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0'; return [ function replace(searchValue, replaceValue) { var O = requireObjectCoercible(this); var replacer = isNullOrUndefined(searchValue) ? undefined : getMethod(searchValue, REPLACE); return replacer ? call(replacer, searchValue, O, replaceValue) : call(nativeReplace, toString(O), searchValue, replaceValue); }, function (string, replaceValue) { var rx = anObject(this); var S = toString(string); if ( typeof replaceValue == 'string' && stringIndexOf(replaceValue, UNSAFE_SUBSTITUTE) === -1 && stringIndexOf(replaceValue, '$<') === -1 ) { var res = maybeCallNative(nativeReplace, rx, S, replaceValue); if (res.done) return res.value; } var functionalReplace = isCallable(replaceValue); if (!functionalReplace) replaceValue = toString(replaceValue); var global = rx.global; var fullUnicode; if (global) { fullUnicode = rx.unicode; rx.lastIndex = 0; } var results = []; var result; while (true) { result = regExpExec(rx, S); if (result === null) break; push(results, result); if (!global) break; var matchStr = toString(result[0]); if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode); } var accumulatedResult = ''; var nextSourcePosition = 0; for (var i = 0; i < results.length; i++) { result = results[i]; var matched = toString(result[0]); var position = max(min(toIntegerOrInfinity(result.index), S.length), 0); var captures = []; var replacement; for (var j = 1; j < result.length; j++) push(captures, maybeToString(result[j])); var namedCaptures = result.groups; if (functionalReplace) { var replacerArgs = concat([matched], captures, position, S); if (namedCaptures !== undefined) push(replacerArgs, namedCaptures); replacement = toString(apply(replaceValue, undefined, replacerArgs)); } else { replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue); } if (position >= nextSourcePosition) { accumulatedResult += stringSlice(S, nextSourcePosition, position) + replacement; nextSourcePosition = position + matched.length; } } return accumulatedResult + stringSlice(S, nextSourcePosition); } ]; }, !REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE); },{"../internals/advance-string-index":63,"../internals/an-object":65,"../internals/fails":114,"../internals/fix-regexp-well-known-symbol-logic":115,"../internals/function-apply":117,"../internals/function-call":120,"../internals/function-uncurry-this":124,"../internals/get-method":130,"../internals/get-substitution":132,"../internals/is-callable":147,"../internals/is-null-or-undefined":151,"../internals/regexp-exec-abstract":199,"../internals/require-object-coercible":206,"../internals/to-integer-or-infinity":236,"../internals/to-length":237,"../internals/to-string":243,"../internals/well-known-symbol":252}],288:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var uncurryThis = require('../internals/function-uncurry-this-clause'); var getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f; var toLength = require('../internals/to-length'); var toString = require('../internals/to-string'); var notARegExp = require('../internals/not-a-regexp'); var requireObjectCoercible = require('../internals/require-object-coercible'); var correctIsRegExpLogic = require('../internals/correct-is-regexp-logic'); var IS_PURE = require('../internals/is-pure'); var nativeStartsWith = uncurryThis(''.startsWith); var stringSlice = uncurryThis(''.slice); var min = Math.min; var CORRECT_IS_REGEXP_LOGIC = correctIsRegExpLogic('startsWith'); var MDN_POLYFILL_BUG = !IS_PURE && !CORRECT_IS_REGEXP_LOGIC && !!function () { var descriptor = getOwnPropertyDescriptor(String.prototype, 'startsWith'); return descriptor && !descriptor.writable; }(); $({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC }, { startsWith: function startsWith(searchString ) { var that = toString(requireObjectCoercible(this)); notARegExp(searchString); var index = toLength(min(arguments.length > 1 ? arguments[1] : undefined, that.length)); var search = toString(searchString); return nativeStartsWith ? nativeStartsWith(that, search, index) : stringSlice(that, index, index + search.length) === search; } }); },{"../internals/correct-is-regexp-logic":84,"../internals/export":113,"../internals/function-uncurry-this-clause":123,"../internals/is-pure":153,"../internals/not-a-regexp":172,"../internals/object-get-own-property-descriptor":177,"../internals/require-object-coercible":206,"../internals/to-length":237,"../internals/to-string":243}],289:[function(require,module,exports){ 'use strict'; var defineWellKnownSymbol = require('../internals/well-known-symbol-define'); defineWellKnownSymbol('asyncIterator'); },{"../internals/well-known-symbol-define":250}],290:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var global = require('../internals/global'); var call = require('../internals/function-call'); var uncurryThis = require('../internals/function-uncurry-this'); var IS_PURE = require('../internals/is-pure'); var DESCRIPTORS = require('../internals/descriptors'); var NATIVE_SYMBOL = require('../internals/symbol-constructor-detection'); var fails = require('../internals/fails'); var hasOwn = require('../internals/has-own-property'); var isPrototypeOf = require('../internals/object-is-prototype-of'); var anObject = require('../internals/an-object'); var toIndexedObject = require('../internals/to-indexed-object'); var toPropertyKey = require('../internals/to-property-key'); var $toString = require('../internals/to-string'); var createPropertyDescriptor = require('../internals/create-property-descriptor'); var nativeObjectCreate = require('../internals/object-create'); var objectKeys = require('../internals/object-keys'); var getOwnPropertyNamesModule = require('../internals/object-get-own-property-names'); var getOwnPropertyNamesExternal = require('../internals/object-get-own-property-names-external'); var getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols'); var getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor'); var definePropertyModule = require('../internals/object-define-property'); var definePropertiesModule = require('../internals/object-define-properties'); var propertyIsEnumerableModule = require('../internals/object-property-is-enumerable'); var defineBuiltIn = require('../internals/define-built-in'); var defineBuiltInAccessor = require('../internals/define-built-in-accessor'); var shared = require('../internals/shared'); var sharedKey = require('../internals/shared-key'); var hiddenKeys = require('../internals/hidden-keys'); var uid = require('../internals/uid'); var wellKnownSymbol = require('../internals/well-known-symbol'); var wrappedWellKnownSymbolModule = require('../internals/well-known-symbol-wrapped'); var defineWellKnownSymbol = require('../internals/well-known-symbol-define'); var defineSymbolToPrimitive = require('../internals/symbol-define-to-primitive'); var setToStringTag = require('../internals/set-to-string-tag'); var InternalStateModule = require('../internals/internal-state'); var $forEach = require('../internals/array-iteration').forEach; var HIDDEN = sharedKey('hidden'); var SYMBOL = 'Symbol'; var PROTOTYPE = 'prototype'; var setInternalState = InternalStateModule.set; var getInternalState = InternalStateModule.getterFor(SYMBOL); var ObjectPrototype = Object[PROTOTYPE]; var $Symbol = global.Symbol; var SymbolPrototype = $Symbol && $Symbol[PROTOTYPE]; var RangeError = global.RangeError; var TypeError = global.TypeError; var QObject = global.QObject; var nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f; var nativeDefineProperty = definePropertyModule.f; var nativeGetOwnPropertyNames = getOwnPropertyNamesExternal.f; var nativePropertyIsEnumerable = propertyIsEnumerableModule.f; var push = uncurryThis([].push); var AllSymbols = shared('symbols'); var ObjectPrototypeSymbols = shared('op-symbols'); var WellKnownSymbolsStore = shared('wks'); var USE_SETTER = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild; var fallbackDefineProperty = function (O, P, Attributes) { var ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor(ObjectPrototype, P); if (ObjectPrototypeDescriptor) delete ObjectPrototype[P]; nativeDefineProperty(O, P, Attributes); if (ObjectPrototypeDescriptor && O !== ObjectPrototype) { nativeDefineProperty(ObjectPrototype, P, ObjectPrototypeDescriptor); } }; var setSymbolDescriptor = DESCRIPTORS && fails(function () { return nativeObjectCreate(nativeDefineProperty({}, 'a', { get: function () { return nativeDefineProperty(this, 'a', { value: 7 }).a; } })).a !== 7; }) ? fallbackDefineProperty : nativeDefineProperty; var wrap = function (tag, description) { var symbol = AllSymbols[tag] = nativeObjectCreate(SymbolPrototype); setInternalState(symbol, { type: SYMBOL, tag: tag, description: description }); if (!DESCRIPTORS) symbol.description = description; return symbol; }; var $defineProperty = function defineProperty(O, P, Attributes) { if (O === ObjectPrototype) $defineProperty(ObjectPrototypeSymbols, P, Attributes); anObject(O); var key = toPropertyKey(P); anObject(Attributes); if (hasOwn(AllSymbols, key)) { if (!Attributes.enumerable) { if (!hasOwn(O, HIDDEN)) nativeDefineProperty(O, HIDDEN, createPropertyDescriptor(1, {})); O[HIDDEN][key] = true; } else { if (hasOwn(O, HIDDEN) && O[HIDDEN][key]) O[HIDDEN][key] = false; Attributes = nativeObjectCreate(Attributes, { enumerable: createPropertyDescriptor(0, false) }); } return setSymbolDescriptor(O, key, Attributes); } return nativeDefineProperty(O, key, Attributes); }; var $defineProperties = function defineProperties(O, Properties) { anObject(O); var properties = toIndexedObject(Properties); var keys = objectKeys(properties).concat($getOwnPropertySymbols(properties)); $forEach(keys, function (key) { if (!DESCRIPTORS || call($propertyIsEnumerable, properties, key)) $defineProperty(O, key, properties[key]); }); return O; }; var $create = function create(O, Properties) { return Properties === undefined ? nativeObjectCreate(O) : $defineProperties(nativeObjectCreate(O), Properties); }; var $propertyIsEnumerable = function propertyIsEnumerable(V) { var P = toPropertyKey(V); var enumerable = call(nativePropertyIsEnumerable, this, P); if (this === ObjectPrototype && hasOwn(AllSymbols, P) && !hasOwn(ObjectPrototypeSymbols, P)) return false; return enumerable || !hasOwn(this, P) || !hasOwn(AllSymbols, P) || hasOwn(this, HIDDEN) && this[HIDDEN][P] ? enumerable : true; }; var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(O, P) { var it = toIndexedObject(O); var key = toPropertyKey(P); if (it === ObjectPrototype && hasOwn(AllSymbols, key) && !hasOwn(ObjectPrototypeSymbols, key)) return; var descriptor = nativeGetOwnPropertyDescriptor(it, key); if (descriptor && hasOwn(AllSymbols, key) && !(hasOwn(it, HIDDEN) && it[HIDDEN][key])) { descriptor.enumerable = true; } return descriptor; }; var $getOwnPropertyNames = function getOwnPropertyNames(O) { var names = nativeGetOwnPropertyNames(toIndexedObject(O)); var result = []; $forEach(names, function (key) { if (!hasOwn(AllSymbols, key) && !hasOwn(hiddenKeys, key)) push(result, key); }); return result; }; var $getOwnPropertySymbols = function (O) { var IS_OBJECT_PROTOTYPE = O === ObjectPrototype; var names = nativeGetOwnPropertyNames(IS_OBJECT_PROTOTYPE ? ObjectPrototypeSymbols : toIndexedObject(O)); var result = []; $forEach(names, function (key) { if (hasOwn(AllSymbols, key) && (!IS_OBJECT_PROTOTYPE || hasOwn(ObjectPrototype, key))) { push(result, AllSymbols[key]); } }); return result; }; if (!NATIVE_SYMBOL) { $Symbol = function Symbol() { if (isPrototypeOf(SymbolPrototype, this)) throw new TypeError('Symbol is not a constructor'); var description = !arguments.length || arguments[0] === undefined ? undefined : $toString(arguments[0]); var tag = uid(description); var setter = function (value) { var $this = this === undefined ? global : this; if ($this === ObjectPrototype) call(setter, ObjectPrototypeSymbols, value); if (hasOwn($this, HIDDEN) && hasOwn($this[HIDDEN], tag)) $this[HIDDEN][tag] = false; var descriptor = createPropertyDescriptor(1, value); try { setSymbolDescriptor($this, tag, descriptor); } catch (error) { if (!(error instanceof RangeError)) throw error; fallbackDefineProperty($this, tag, descriptor); } }; if (DESCRIPTORS && USE_SETTER) setSymbolDescriptor(ObjectPrototype, tag, { configurable: true, set: setter }); return wrap(tag, description); }; SymbolPrototype = $Symbol[PROTOTYPE]; defineBuiltIn(SymbolPrototype, 'toString', function toString() { return getInternalState(this).tag; }); defineBuiltIn($Symbol, 'withoutSetter', function (description) { return wrap(uid(description), description); }); propertyIsEnumerableModule.f = $propertyIsEnumerable; definePropertyModule.f = $defineProperty; definePropertiesModule.f = $defineProperties; getOwnPropertyDescriptorModule.f = $getOwnPropertyDescriptor; getOwnPropertyNamesModule.f = getOwnPropertyNamesExternal.f = $getOwnPropertyNames; getOwnPropertySymbolsModule.f = $getOwnPropertySymbols; wrappedWellKnownSymbolModule.f = function (name) { return wrap(wellKnownSymbol(name), name); }; if (DESCRIPTORS) { defineBuiltInAccessor(SymbolPrototype, 'description', { configurable: true, get: function description() { return getInternalState(this).description; } }); if (!IS_PURE) { defineBuiltIn(ObjectPrototype, 'propertyIsEnumerable', $propertyIsEnumerable, { unsafe: true }); } } } $({ global: true, constructor: true, wrap: true, forced: !NATIVE_SYMBOL, sham: !NATIVE_SYMBOL }, { Symbol: $Symbol }); $forEach(objectKeys(WellKnownSymbolsStore), function (name) { defineWellKnownSymbol(name); }); $({ target: SYMBOL, stat: true, forced: !NATIVE_SYMBOL }, { useSetter: function () { USE_SETTER = true; }, useSimple: function () { USE_SETTER = false; } }); $({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL, sham: !DESCRIPTORS }, { create: $create, defineProperty: $defineProperty, defineProperties: $defineProperties, getOwnPropertyDescriptor: $getOwnPropertyDescriptor }); $({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL }, { getOwnPropertyNames: $getOwnPropertyNames }); defineSymbolToPrimitive(); setToStringTag($Symbol, SYMBOL); hiddenKeys[HIDDEN] = true; },{"../internals/an-object":65,"../internals/array-iteration":69,"../internals/create-property-descriptor":88,"../internals/define-built-in":91,"../internals/define-built-in-accessor":90,"../internals/descriptors":94,"../internals/export":113,"../internals/fails":114,"../internals/function-call":120,"../internals/function-uncurry-this":124,"../internals/global":133,"../internals/has-own-property":134,"../internals/hidden-keys":135,"../internals/internal-state":144,"../internals/is-pure":153,"../internals/object-create":174,"../internals/object-define-properties":175,"../internals/object-define-property":176,"../internals/object-get-own-property-descriptor":177,"../internals/object-get-own-property-names":179,"../internals/object-get-own-property-names-external":178,"../internals/object-get-own-property-symbols":180,"../internals/object-is-prototype-of":183,"../internals/object-keys":185,"../internals/object-property-is-enumerable":186,"../internals/set-to-string-tag":220,"../internals/shared":224,"../internals/shared-key":222,"../internals/symbol-constructor-detection":228,"../internals/symbol-define-to-primitive":229,"../internals/to-indexed-object":235,"../internals/to-property-key":240,"../internals/to-string":243,"../internals/uid":245,"../internals/well-known-symbol":252,"../internals/well-known-symbol-define":250,"../internals/well-known-symbol-wrapped":251}],291:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var DESCRIPTORS = require('../internals/descriptors'); var global = require('../internals/global'); var uncurryThis = require('../internals/function-uncurry-this'); var hasOwn = require('../internals/has-own-property'); var isCallable = require('../internals/is-callable'); var isPrototypeOf = require('../internals/object-is-prototype-of'); var toString = require('../internals/to-string'); var defineBuiltInAccessor = require('../internals/define-built-in-accessor'); var copyConstructorProperties = require('../internals/copy-constructor-properties'); var NativeSymbol = global.Symbol; var SymbolPrototype = NativeSymbol && NativeSymbol.prototype; if (DESCRIPTORS && isCallable(NativeSymbol) && (!('description' in SymbolPrototype) || NativeSymbol().description !== undefined )) { var EmptyStringDescriptionStore = {}; var SymbolWrapper = function Symbol() { var description = arguments.length < 1 || arguments[0] === undefined ? undefined : toString(arguments[0]); var result = isPrototypeOf(SymbolPrototype, this) ? new NativeSymbol(description) : description === undefined ? NativeSymbol() : NativeSymbol(description); if (description === '') EmptyStringDescriptionStore[result] = true; return result; }; copyConstructorProperties(SymbolWrapper, NativeSymbol); SymbolWrapper.prototype = SymbolPrototype; SymbolPrototype.constructor = SymbolWrapper; var NATIVE_SYMBOL = String(NativeSymbol('description detection')) === 'Symbol(description detection)'; var thisSymbolValue = uncurryThis(SymbolPrototype.valueOf); var symbolDescriptiveString = uncurryThis(SymbolPrototype.toString); var regexp = /^Symbol\((.*)\)[^)]+$/; var replace = uncurryThis(''.replace); var stringSlice = uncurryThis(''.slice); defineBuiltInAccessor(SymbolPrototype, 'description', { configurable: true, get: function description() { var symbol = thisSymbolValue(this); if (hasOwn(EmptyStringDescriptionStore, symbol)) return ''; var string = symbolDescriptiveString(symbol); var desc = NATIVE_SYMBOL ? stringSlice(string, 7, -1) : replace(string, regexp, '$1'); return desc === '' ? undefined : desc; } }); $({ global: true, constructor: true, forced: true }, { Symbol: SymbolWrapper }); } },{"../internals/copy-constructor-properties":83,"../internals/define-built-in-accessor":90,"../internals/descriptors":94,"../internals/export":113,"../internals/function-uncurry-this":124,"../internals/global":133,"../internals/has-own-property":134,"../internals/is-callable":147,"../internals/object-is-prototype-of":183,"../internals/to-string":243}],292:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var getBuiltIn = require('../internals/get-built-in'); var hasOwn = require('../internals/has-own-property'); var toString = require('../internals/to-string'); var shared = require('../internals/shared'); var NATIVE_SYMBOL_REGISTRY = require('../internals/symbol-registry-detection'); var StringToSymbolRegistry = shared('string-to-symbol-registry'); var SymbolToStringRegistry = shared('symbol-to-string-registry'); $({ target: 'Symbol', stat: true, forced: !NATIVE_SYMBOL_REGISTRY }, { 'for': function (key) { var string = toString(key); if (hasOwn(StringToSymbolRegistry, string)) return StringToSymbolRegistry[string]; var symbol = getBuiltIn('Symbol')(string); StringToSymbolRegistry[string] = symbol; SymbolToStringRegistry[symbol] = string; return symbol; } }); },{"../internals/export":113,"../internals/get-built-in":125,"../internals/has-own-property":134,"../internals/shared":224,"../internals/symbol-registry-detection":232,"../internals/to-string":243}],293:[function(require,module,exports){ 'use strict'; var defineWellKnownSymbol = require('../internals/well-known-symbol-define'); defineWellKnownSymbol('hasInstance'); },{"../internals/well-known-symbol-define":250}],294:[function(require,module,exports){ 'use strict'; var defineWellKnownSymbol = require('../internals/well-known-symbol-define'); defineWellKnownSymbol('isConcatSpreadable'); },{"../internals/well-known-symbol-define":250}],295:[function(require,module,exports){ 'use strict'; var defineWellKnownSymbol = require('../internals/well-known-symbol-define'); defineWellKnownSymbol('iterator'); },{"../internals/well-known-symbol-define":250}],296:[function(require,module,exports){ 'use strict'; require('../modules/es.symbol.constructor'); require('../modules/es.symbol.for'); require('../modules/es.symbol.key-for'); require('../modules/es.json.stringify'); require('../modules/es.object.get-own-property-symbols'); },{"../modules/es.json.stringify":258,"../modules/es.object.get-own-property-symbols":266,"../modules/es.symbol.constructor":290,"../modules/es.symbol.for":292,"../modules/es.symbol.key-for":297}],297:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var hasOwn = require('../internals/has-own-property'); var isSymbol = require('../internals/is-symbol'); var tryToString = require('../internals/try-to-string'); var shared = require('../internals/shared'); var NATIVE_SYMBOL_REGISTRY = require('../internals/symbol-registry-detection'); var SymbolToStringRegistry = shared('symbol-to-string-registry'); $({ target: 'Symbol', stat: true, forced: !NATIVE_SYMBOL_REGISTRY }, { keyFor: function keyFor(sym) { if (!isSymbol(sym)) throw new TypeError(tryToString(sym) + ' is not a symbol'); if (hasOwn(SymbolToStringRegistry, sym)) return SymbolToStringRegistry[sym]; } }); },{"../internals/export":113,"../internals/has-own-property":134,"../internals/is-symbol":155,"../internals/shared":224,"../internals/symbol-registry-detection":232,"../internals/try-to-string":244}],298:[function(require,module,exports){ 'use strict'; var defineWellKnownSymbol = require('../internals/well-known-symbol-define'); defineWellKnownSymbol('matchAll'); },{"../internals/well-known-symbol-define":250}],299:[function(require,module,exports){ 'use strict'; var defineWellKnownSymbol = require('../internals/well-known-symbol-define'); defineWellKnownSymbol('match'); },{"../internals/well-known-symbol-define":250}],300:[function(require,module,exports){ 'use strict'; var defineWellKnownSymbol = require('../internals/well-known-symbol-define'); defineWellKnownSymbol('replace'); },{"../internals/well-known-symbol-define":250}],301:[function(require,module,exports){ 'use strict'; var defineWellKnownSymbol = require('../internals/well-known-symbol-define'); defineWellKnownSymbol('search'); },{"../internals/well-known-symbol-define":250}],302:[function(require,module,exports){ 'use strict'; var defineWellKnownSymbol = require('../internals/well-known-symbol-define'); defineWellKnownSymbol('species'); },{"../internals/well-known-symbol-define":250}],303:[function(require,module,exports){ 'use strict'; var defineWellKnownSymbol = require('../internals/well-known-symbol-define'); defineWellKnownSymbol('split'); },{"../internals/well-known-symbol-define":250}],304:[function(require,module,exports){ 'use strict'; var defineWellKnownSymbol = require('../internals/well-known-symbol-define'); var defineSymbolToPrimitive = require('../internals/symbol-define-to-primitive'); defineWellKnownSymbol('toPrimitive'); defineSymbolToPrimitive(); },{"../internals/symbol-define-to-primitive":229,"../internals/well-known-symbol-define":250}],305:[function(require,module,exports){ 'use strict'; var getBuiltIn = require('../internals/get-built-in'); var defineWellKnownSymbol = require('../internals/well-known-symbol-define'); var setToStringTag = require('../internals/set-to-string-tag'); defineWellKnownSymbol('toStringTag'); setToStringTag(getBuiltIn('Symbol'), 'Symbol'); },{"../internals/get-built-in":125,"../internals/set-to-string-tag":220,"../internals/well-known-symbol-define":250}],306:[function(require,module,exports){ 'use strict'; var defineWellKnownSymbol = require('../internals/well-known-symbol-define'); defineWellKnownSymbol('unscopables'); },{"../internals/well-known-symbol-define":250}],307:[function(require,module,exports){ 'use strict'; require('../modules/es.aggregate-error'); },{"../modules/es.aggregate-error":254}],308:[function(require,module,exports){ 'use strict'; var wellKnownSymbol = require('../internals/well-known-symbol'); var defineProperty = require('../internals/object-define-property').f; var METADATA = wellKnownSymbol('metadata'); var FunctionPrototype = Function.prototype; if (FunctionPrototype[METADATA] === undefined) { defineProperty(FunctionPrototype, METADATA, { value: null }); } },{"../internals/object-define-property":176,"../internals/well-known-symbol":252}],309:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var aMap = require('../internals/a-map'); var remove = require('../internals/map-helpers').remove; $({ target: 'Map', proto: true, real: true, forced: true }, { deleteAll: function deleteAll() { var collection = aMap(this); var allDeleted = true; var wasDeleted; for (var k = 0, len = arguments.length; k < len; k++) { wasDeleted = remove(collection, arguments[k]); allDeleted = allDeleted && wasDeleted; } return !!allDeleted; } }); },{"../internals/a-map":59,"../internals/export":113,"../internals/map-helpers":165}],310:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var aMap = require('../internals/a-map'); var MapHelpers = require('../internals/map-helpers'); var get = MapHelpers.get; var has = MapHelpers.has; var set = MapHelpers.set; $({ target: 'Map', proto: true, real: true, forced: true }, { emplace: function emplace(key, handler) { var map = aMap(this); var value, inserted; if (has(map, key)) { value = get(map, key); if ('update' in handler) { value = handler.update(value, key, map); set(map, key, value); } return value; } inserted = handler.insert(key, map); set(map, key, inserted); return inserted; } }); },{"../internals/a-map":59,"../internals/export":113,"../internals/map-helpers":165}],311:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var bind = require('../internals/function-bind-context'); var aMap = require('../internals/a-map'); var iterate = require('../internals/map-iterate'); $({ target: 'Map', proto: true, real: true, forced: true }, { every: function every(callbackfn ) { var map = aMap(this); var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined); return iterate(map, function (value, key) { if (!boundFunction(value, key, map)) return false; }, true) !== false; } }); },{"../internals/a-map":59,"../internals/export":113,"../internals/function-bind-context":118,"../internals/map-iterate":166}],312:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var bind = require('../internals/function-bind-context'); var aMap = require('../internals/a-map'); var MapHelpers = require('../internals/map-helpers'); var iterate = require('../internals/map-iterate'); var Map = MapHelpers.Map; var set = MapHelpers.set; $({ target: 'Map', proto: true, real: true, forced: true }, { filter: function filter(callbackfn ) { var map = aMap(this); var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined); var newMap = new Map(); iterate(map, function (value, key) { if (boundFunction(value, key, map)) set(newMap, key, value); }); return newMap; } }); },{"../internals/a-map":59,"../internals/export":113,"../internals/function-bind-context":118,"../internals/map-helpers":165,"../internals/map-iterate":166}],313:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var bind = require('../internals/function-bind-context'); var aMap = require('../internals/a-map'); var iterate = require('../internals/map-iterate'); $({ target: 'Map', proto: true, real: true, forced: true }, { findKey: function findKey(callbackfn ) { var map = aMap(this); var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined); var result = iterate(map, function (value, key) { if (boundFunction(value, key, map)) return { key: key }; }, true); return result && result.key; } }); },{"../internals/a-map":59,"../internals/export":113,"../internals/function-bind-context":118,"../internals/map-iterate":166}],314:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var bind = require('../internals/function-bind-context'); var aMap = require('../internals/a-map'); var iterate = require('../internals/map-iterate'); $({ target: 'Map', proto: true, real: true, forced: true }, { find: function find(callbackfn ) { var map = aMap(this); var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined); var result = iterate(map, function (value, key) { if (boundFunction(value, key, map)) return { value: value }; }, true); return result && result.value; } }); },{"../internals/a-map":59,"../internals/export":113,"../internals/function-bind-context":118,"../internals/map-iterate":166}],315:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var from = require('../internals/collection-from'); $({ target: 'Map', stat: true, forced: true }, { from: from }); },{"../internals/collection-from":79,"../internals/export":113}],316:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var uncurryThis = require('../internals/function-uncurry-this'); var aCallable = require('../internals/a-callable'); var requireObjectCoercible = require('../internals/require-object-coercible'); var iterate = require('../internals/iterate'); var MapHelpers = require('../internals/map-helpers'); var IS_PURE = require('../internals/is-pure'); var Map = MapHelpers.Map; var has = MapHelpers.has; var get = MapHelpers.get; var set = MapHelpers.set; var push = uncurryThis([].push); $({ target: 'Map', stat: true, forced: IS_PURE }, { groupBy: function groupBy(items, callbackfn) { requireObjectCoercible(items); aCallable(callbackfn); var map = new Map(); var k = 0; iterate(items, function (value) { var key = callbackfn(value, k++); if (!has(map, key)) set(map, key, [value]); else push(get(map, key), value); }); return map; } }); },{"../internals/a-callable":57,"../internals/export":113,"../internals/function-uncurry-this":124,"../internals/is-pure":153,"../internals/iterate":157,"../internals/map-helpers":165,"../internals/require-object-coercible":206}],317:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var sameValueZero = require('../internals/same-value-zero'); var aMap = require('../internals/a-map'); var iterate = require('../internals/map-iterate'); $({ target: 'Map', proto: true, real: true, forced: true }, { includes: function includes(searchElement) { return iterate(aMap(this), function (value) { if (sameValueZero(value, searchElement)) return true; }, true) === true; } }); },{"../internals/a-map":59,"../internals/export":113,"../internals/map-iterate":166,"../internals/same-value-zero":207}],318:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var call = require('../internals/function-call'); var iterate = require('../internals/iterate'); var isCallable = require('../internals/is-callable'); var aCallable = require('../internals/a-callable'); var Map = require('../internals/map-helpers').Map; $({ target: 'Map', stat: true, forced: true }, { keyBy: function keyBy(iterable, keyDerivative) { var C = isCallable(this) ? this : Map; var newMap = new C(); aCallable(keyDerivative); var setter = aCallable(newMap.set); iterate(iterable, function (element) { call(setter, newMap, keyDerivative(element), element); }); return newMap; } }); },{"../internals/a-callable":57,"../internals/export":113,"../internals/function-call":120,"../internals/is-callable":147,"../internals/iterate":157,"../internals/map-helpers":165}],319:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var aMap = require('../internals/a-map'); var iterate = require('../internals/map-iterate'); $({ target: 'Map', proto: true, real: true, forced: true }, { keyOf: function keyOf(searchElement) { var result = iterate(aMap(this), function (value, key) { if (value === searchElement) return { key: key }; }, true); return result && result.key; } }); },{"../internals/a-map":59,"../internals/export":113,"../internals/map-iterate":166}],320:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var bind = require('../internals/function-bind-context'); var aMap = require('../internals/a-map'); var MapHelpers = require('../internals/map-helpers'); var iterate = require('../internals/map-iterate'); var Map = MapHelpers.Map; var set = MapHelpers.set; $({ target: 'Map', proto: true, real: true, forced: true }, { mapKeys: function mapKeys(callbackfn ) { var map = aMap(this); var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined); var newMap = new Map(); iterate(map, function (value, key) { set(newMap, boundFunction(value, key, map), value); }); return newMap; } }); },{"../internals/a-map":59,"../internals/export":113,"../internals/function-bind-context":118,"../internals/map-helpers":165,"../internals/map-iterate":166}],321:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var bind = require('../internals/function-bind-context'); var aMap = require('../internals/a-map'); var MapHelpers = require('../internals/map-helpers'); var iterate = require('../internals/map-iterate'); var Map = MapHelpers.Map; var set = MapHelpers.set; $({ target: 'Map', proto: true, real: true, forced: true }, { mapValues: function mapValues(callbackfn ) { var map = aMap(this); var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined); var newMap = new Map(); iterate(map, function (value, key) { set(newMap, key, boundFunction(value, key, map)); }); return newMap; } }); },{"../internals/a-map":59,"../internals/export":113,"../internals/function-bind-context":118,"../internals/map-helpers":165,"../internals/map-iterate":166}],322:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var aMap = require('../internals/a-map'); var iterate = require('../internals/iterate'); var set = require('../internals/map-helpers').set; $({ target: 'Map', proto: true, real: true, arity: 1, forced: true }, { merge: function merge(iterable ) { var map = aMap(this); var argumentsLength = arguments.length; var i = 0; while (i < argumentsLength) { iterate(arguments[i++], function (key, value) { set(map, key, value); }, { AS_ENTRIES: true }); } return map; } }); },{"../internals/a-map":59,"../internals/export":113,"../internals/iterate":157,"../internals/map-helpers":165}],323:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var of = require('../internals/collection-of'); $({ target: 'Map', stat: true, forced: true }, { of: of }); },{"../internals/collection-of":80,"../internals/export":113}],324:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var aCallable = require('../internals/a-callable'); var aMap = require('../internals/a-map'); var iterate = require('../internals/map-iterate'); var $TypeError = TypeError; $({ target: 'Map', proto: true, real: true, forced: true }, { reduce: function reduce(callbackfn ) { var map = aMap(this); var noInitial = arguments.length < 2; var accumulator = noInitial ? undefined : arguments[1]; aCallable(callbackfn); iterate(map, function (value, key) { if (noInitial) { noInitial = false; accumulator = value; } else { accumulator = callbackfn(accumulator, value, key, map); } }); if (noInitial) throw new $TypeError('Reduce of empty map with no initial value'); return accumulator; } }); },{"../internals/a-callable":57,"../internals/a-map":59,"../internals/export":113,"../internals/map-iterate":166}],325:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var bind = require('../internals/function-bind-context'); var aMap = require('../internals/a-map'); var iterate = require('../internals/map-iterate'); $({ target: 'Map', proto: true, real: true, forced: true }, { some: function some(callbackfn ) { var map = aMap(this); var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined); return iterate(map, function (value, key) { if (boundFunction(value, key, map)) return true; }, true) === true; } }); },{"../internals/a-map":59,"../internals/export":113,"../internals/function-bind-context":118,"../internals/map-iterate":166}],326:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var upsert = require('../internals/map-upsert'); $({ target: 'Map', proto: true, real: true, name: 'upsert', forced: true }, { updateOrInsert: upsert }); },{"../internals/export":113,"../internals/map-upsert":167}],327:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var aCallable = require('../internals/a-callable'); var aMap = require('../internals/a-map'); var MapHelpers = require('../internals/map-helpers'); var $TypeError = TypeError; var get = MapHelpers.get; var has = MapHelpers.has; var set = MapHelpers.set; $({ target: 'Map', proto: true, real: true, forced: true }, { update: function update(key, callback ) { var map = aMap(this); var length = arguments.length; aCallable(callback); var isPresentInMap = has(map, key); if (!isPresentInMap && length < 3) { throw new $TypeError('Updating absent value'); } var value = isPresentInMap ? get(map, key) : aCallable(length > 2 ? arguments[2] : undefined)(key, map); set(map, key, callback(value, key, map)); return map; } }); },{"../internals/a-callable":57,"../internals/a-map":59,"../internals/export":113,"../internals/map-helpers":165}],328:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var upsert = require('../internals/map-upsert'); $({ target: 'Map', proto: true, real: true, forced: true }, { upsert: upsert }); },{"../internals/export":113,"../internals/map-upsert":167}],329:[function(require,module,exports){ 'use strict'; require('../modules/es.promise.all-settled.js'); },{"../modules/es.promise.all-settled.js":268}],330:[function(require,module,exports){ 'use strict'; require('../modules/es.promise.any'); },{"../modules/es.promise.any":270}],331:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var newPromiseCapabilityModule = require('../internals/new-promise-capability'); var perform = require('../internals/perform'); $({ target: 'Promise', stat: true, forced: true }, { 'try': function (callbackfn) { var promiseCapability = newPromiseCapabilityModule.f(this); var result = perform(callbackfn); (result.error ? promiseCapability.reject : promiseCapability.resolve)(result.value); return promiseCapability.promise; } }); },{"../internals/export":113,"../internals/new-promise-capability":170,"../internals/perform":193}],332:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var newPromiseCapabilityModule = require('../internals/new-promise-capability'); $({ target: 'Promise', stat: true }, { withResolvers: function withResolvers() { var promiseCapability = newPromiseCapabilityModule.f(this); return { promise: promiseCapability.promise, resolve: promiseCapability.resolve, reject: promiseCapability.reject }; } }); },{"../internals/export":113,"../internals/new-promise-capability":170}],333:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var aSet = require('../internals/a-set'); var add = require('../internals/set-helpers').add; $({ target: 'Set', proto: true, real: true, forced: true }, { addAll: function addAll() { var set = aSet(this); for (var k = 0, len = arguments.length; k < len; k++) { add(set, arguments[k]); } return set; } }); },{"../internals/a-set":61,"../internals/export":113,"../internals/set-helpers":210}],334:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var aSet = require('../internals/a-set'); var remove = require('../internals/set-helpers').remove; $({ target: 'Set', proto: true, real: true, forced: true }, { deleteAll: function deleteAll() { var collection = aSet(this); var allDeleted = true; var wasDeleted; for (var k = 0, len = arguments.length; k < len; k++) { wasDeleted = remove(collection, arguments[k]); allDeleted = allDeleted && wasDeleted; } return !!allDeleted; } }); },{"../internals/a-set":61,"../internals/export":113,"../internals/set-helpers":210}],335:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var call = require('../internals/function-call'); var toSetLike = require('../internals/to-set-like'); var $difference = require('../internals/set-difference'); $({ target: 'Set', proto: true, real: true, forced: true }, { difference: function difference(other) { return call($difference, this, toSetLike(other)); } }); },{"../internals/export":113,"../internals/function-call":120,"../internals/set-difference":209,"../internals/to-set-like":241}],336:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var difference = require('../internals/set-difference'); var setMethodAcceptSetLike = require('../internals/set-method-accept-set-like'); $({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike('difference') }, { difference: difference }); },{"../internals/export":113,"../internals/set-difference":209,"../internals/set-method-accept-set-like":216}],337:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var bind = require('../internals/function-bind-context'); var aSet = require('../internals/a-set'); var iterate = require('../internals/set-iterate'); $({ target: 'Set', proto: true, real: true, forced: true }, { every: function every(callbackfn ) { var set = aSet(this); var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined); return iterate(set, function (value) { if (!boundFunction(value, value, set)) return false; }, true) !== false; } }); },{"../internals/a-set":61,"../internals/export":113,"../internals/function-bind-context":118,"../internals/set-iterate":215}],338:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var bind = require('../internals/function-bind-context'); var aSet = require('../internals/a-set'); var SetHelpers = require('../internals/set-helpers'); var iterate = require('../internals/set-iterate'); var Set = SetHelpers.Set; var add = SetHelpers.add; $({ target: 'Set', proto: true, real: true, forced: true }, { filter: function filter(callbackfn ) { var set = aSet(this); var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined); var newSet = new Set(); iterate(set, function (value) { if (boundFunction(value, value, set)) add(newSet, value); }); return newSet; } }); },{"../internals/a-set":61,"../internals/export":113,"../internals/function-bind-context":118,"../internals/set-helpers":210,"../internals/set-iterate":215}],339:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var bind = require('../internals/function-bind-context'); var aSet = require('../internals/a-set'); var iterate = require('../internals/set-iterate'); $({ target: 'Set', proto: true, real: true, forced: true }, { find: function find(callbackfn ) { var set = aSet(this); var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined); var result = iterate(set, function (value) { if (boundFunction(value, value, set)) return { value: value }; }, true); return result && result.value; } }); },{"../internals/a-set":61,"../internals/export":113,"../internals/function-bind-context":118,"../internals/set-iterate":215}],340:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var from = require('../internals/collection-from'); $({ target: 'Set', stat: true, forced: true }, { from: from }); },{"../internals/collection-from":79,"../internals/export":113}],341:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var call = require('../internals/function-call'); var toSetLike = require('../internals/to-set-like'); var $intersection = require('../internals/set-intersection'); $({ target: 'Set', proto: true, real: true, forced: true }, { intersection: function intersection(other) { return call($intersection, this, toSetLike(other)); } }); },{"../internals/export":113,"../internals/function-call":120,"../internals/set-intersection":211,"../internals/to-set-like":241}],342:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var fails = require('../internals/fails'); var intersection = require('../internals/set-intersection'); var setMethodAcceptSetLike = require('../internals/set-method-accept-set-like'); var INCORRECT = !setMethodAcceptSetLike('intersection') || fails(function () { return Array.from(new Set([1, 2, 3]).intersection(new Set([3, 2]))) !== '3,2'; }); $({ target: 'Set', proto: true, real: true, forced: INCORRECT }, { intersection: intersection }); },{"../internals/export":113,"../internals/fails":114,"../internals/set-intersection":211,"../internals/set-method-accept-set-like":216}],343:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var call = require('../internals/function-call'); var toSetLike = require('../internals/to-set-like'); var $isDisjointFrom = require('../internals/set-is-disjoint-from'); $({ target: 'Set', proto: true, real: true, forced: true }, { isDisjointFrom: function isDisjointFrom(other) { return call($isDisjointFrom, this, toSetLike(other)); } }); },{"../internals/export":113,"../internals/function-call":120,"../internals/set-is-disjoint-from":212,"../internals/to-set-like":241}],344:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var isDisjointFrom = require('../internals/set-is-disjoint-from'); var setMethodAcceptSetLike = require('../internals/set-method-accept-set-like'); $({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike('isDisjointFrom') }, { isDisjointFrom: isDisjointFrom }); },{"../internals/export":113,"../internals/set-is-disjoint-from":212,"../internals/set-method-accept-set-like":216}],345:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var call = require('../internals/function-call'); var toSetLike = require('../internals/to-set-like'); var $isSubsetOf = require('../internals/set-is-subset-of'); $({ target: 'Set', proto: true, real: true, forced: true }, { isSubsetOf: function isSubsetOf(other) { return call($isSubsetOf, this, toSetLike(other)); } }); },{"../internals/export":113,"../internals/function-call":120,"../internals/set-is-subset-of":213,"../internals/to-set-like":241}],346:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var isSubsetOf = require('../internals/set-is-subset-of'); var setMethodAcceptSetLike = require('../internals/set-method-accept-set-like'); $({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike('isSubsetOf') }, { isSubsetOf: isSubsetOf }); },{"../internals/export":113,"../internals/set-is-subset-of":213,"../internals/set-method-accept-set-like":216}],347:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var call = require('../internals/function-call'); var toSetLike = require('../internals/to-set-like'); var $isSupersetOf = require('../internals/set-is-superset-of'); $({ target: 'Set', proto: true, real: true, forced: true }, { isSupersetOf: function isSupersetOf(other) { return call($isSupersetOf, this, toSetLike(other)); } }); },{"../internals/export":113,"../internals/function-call":120,"../internals/set-is-superset-of":214,"../internals/to-set-like":241}],348:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var isSupersetOf = require('../internals/set-is-superset-of'); var setMethodAcceptSetLike = require('../internals/set-method-accept-set-like'); $({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike('isSupersetOf') }, { isSupersetOf: isSupersetOf }); },{"../internals/export":113,"../internals/set-is-superset-of":214,"../internals/set-method-accept-set-like":216}],349:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var uncurryThis = require('../internals/function-uncurry-this'); var aSet = require('../internals/a-set'); var iterate = require('../internals/set-iterate'); var toString = require('../internals/to-string'); var arrayJoin = uncurryThis([].join); var push = uncurryThis([].push); $({ target: 'Set', proto: true, real: true, forced: true }, { join: function join(separator) { var set = aSet(this); var sep = separator === undefined ? ',' : toString(separator); var array = []; iterate(set, function (value) { push(array, value); }); return arrayJoin(array, sep); } }); },{"../internals/a-set":61,"../internals/export":113,"../internals/function-uncurry-this":124,"../internals/set-iterate":215,"../internals/to-string":243}],350:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var bind = require('../internals/function-bind-context'); var aSet = require('../internals/a-set'); var SetHelpers = require('../internals/set-helpers'); var iterate = require('../internals/set-iterate'); var Set = SetHelpers.Set; var add = SetHelpers.add; $({ target: 'Set', proto: true, real: true, forced: true }, { map: function map(callbackfn ) { var set = aSet(this); var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined); var newSet = new Set(); iterate(set, function (value) { add(newSet, boundFunction(value, value, set)); }); return newSet; } }); },{"../internals/a-set":61,"../internals/export":113,"../internals/function-bind-context":118,"../internals/set-helpers":210,"../internals/set-iterate":215}],351:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var of = require('../internals/collection-of'); $({ target: 'Set', stat: true, forced: true }, { of: of }); },{"../internals/collection-of":80,"../internals/export":113}],352:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var aCallable = require('../internals/a-callable'); var aSet = require('../internals/a-set'); var iterate = require('../internals/set-iterate'); var $TypeError = TypeError; $({ target: 'Set', proto: true, real: true, forced: true }, { reduce: function reduce(callbackfn ) { var set = aSet(this); var noInitial = arguments.length < 2; var accumulator = noInitial ? undefined : arguments[1]; aCallable(callbackfn); iterate(set, function (value) { if (noInitial) { noInitial = false; accumulator = value; } else { accumulator = callbackfn(accumulator, value, value, set); } }); if (noInitial) throw new $TypeError('Reduce of empty set with no initial value'); return accumulator; } }); },{"../internals/a-callable":57,"../internals/a-set":61,"../internals/export":113,"../internals/set-iterate":215}],353:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var bind = require('../internals/function-bind-context'); var aSet = require('../internals/a-set'); var iterate = require('../internals/set-iterate'); $({ target: 'Set', proto: true, real: true, forced: true }, { some: function some(callbackfn ) { var set = aSet(this); var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined); return iterate(set, function (value) { if (boundFunction(value, value, set)) return true; }, true) === true; } }); },{"../internals/a-set":61,"../internals/export":113,"../internals/function-bind-context":118,"../internals/set-iterate":215}],354:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var call = require('../internals/function-call'); var toSetLike = require('../internals/to-set-like'); var $symmetricDifference = require('../internals/set-symmetric-difference'); $({ target: 'Set', proto: true, real: true, forced: true }, { symmetricDifference: function symmetricDifference(other) { return call($symmetricDifference, this, toSetLike(other)); } }); },{"../internals/export":113,"../internals/function-call":120,"../internals/set-symmetric-difference":219,"../internals/to-set-like":241}],355:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var symmetricDifference = require('../internals/set-symmetric-difference'); var setMethodAcceptSetLike = require('../internals/set-method-accept-set-like'); $({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike('symmetricDifference') }, { symmetricDifference: symmetricDifference }); },{"../internals/export":113,"../internals/set-method-accept-set-like":216,"../internals/set-symmetric-difference":219}],356:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var call = require('../internals/function-call'); var toSetLike = require('../internals/to-set-like'); var $union = require('../internals/set-union'); $({ target: 'Set', proto: true, real: true, forced: true }, { union: function union(other) { return call($union, this, toSetLike(other)); } }); },{"../internals/export":113,"../internals/function-call":120,"../internals/set-union":221,"../internals/to-set-like":241}],357:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var union = require('../internals/set-union'); var setMethodAcceptSetLike = require('../internals/set-method-accept-set-like'); $({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike('union') }, { union: union }); },{"../internals/export":113,"../internals/set-method-accept-set-like":216,"../internals/set-union":221}],358:[function(require,module,exports){ 'use strict'; require('../modules/es.string.replace-all'); },{"../modules/es.string.replace-all":286}],359:[function(require,module,exports){ 'use strict'; var global = require('../internals/global'); var defineWellKnownSymbol = require('../internals/well-known-symbol-define'); var defineProperty = require('../internals/object-define-property').f; var getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f; var Symbol = global.Symbol; defineWellKnownSymbol('asyncDispose'); if (Symbol) { var descriptor = getOwnPropertyDescriptor(Symbol, 'asyncDispose'); if (descriptor.enumerable && descriptor.configurable && descriptor.writable) { defineProperty(Symbol, 'asyncDispose', { value: descriptor.value, enumerable: false, configurable: false, writable: false }); } } },{"../internals/global":133,"../internals/object-define-property":176,"../internals/object-get-own-property-descriptor":177,"../internals/well-known-symbol-define":250}],360:[function(require,module,exports){ 'use strict'; var global = require('../internals/global'); var defineWellKnownSymbol = require('../internals/well-known-symbol-define'); var defineProperty = require('../internals/object-define-property').f; var getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f; var Symbol = global.Symbol; defineWellKnownSymbol('dispose'); if (Symbol) { var descriptor = getOwnPropertyDescriptor(Symbol, 'dispose'); if (descriptor.enumerable && descriptor.configurable && descriptor.writable) { defineProperty(Symbol, 'dispose', { value: descriptor.value, enumerable: false, configurable: false, writable: false }); } } },{"../internals/global":133,"../internals/object-define-property":176,"../internals/object-get-own-property-descriptor":177,"../internals/well-known-symbol-define":250}],361:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var isRegisteredSymbol = require('../internals/symbol-is-registered'); $({ target: 'Symbol', stat: true }, { isRegisteredSymbol: isRegisteredSymbol }); },{"../internals/export":113,"../internals/symbol-is-registered":230}],362:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var isRegisteredSymbol = require('../internals/symbol-is-registered'); $({ target: 'Symbol', stat: true, name: 'isRegisteredSymbol' }, { isRegistered: isRegisteredSymbol }); },{"../internals/export":113,"../internals/symbol-is-registered":230}],363:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var isWellKnownSymbol = require('../internals/symbol-is-well-known'); $({ target: 'Symbol', stat: true, forced: true }, { isWellKnownSymbol: isWellKnownSymbol }); },{"../internals/export":113,"../internals/symbol-is-well-known":231}],364:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var isWellKnownSymbol = require('../internals/symbol-is-well-known'); $({ target: 'Symbol', stat: true, name: 'isWellKnownSymbol', forced: true }, { isWellKnown: isWellKnownSymbol }); },{"../internals/export":113,"../internals/symbol-is-well-known":231}],365:[function(require,module,exports){ 'use strict'; var defineWellKnownSymbol = require('../internals/well-known-symbol-define'); defineWellKnownSymbol('matcher'); },{"../internals/well-known-symbol-define":250}],366:[function(require,module,exports){ 'use strict'; var defineWellKnownSymbol = require('../internals/well-known-symbol-define'); defineWellKnownSymbol('metadataKey'); },{"../internals/well-known-symbol-define":250}],367:[function(require,module,exports){ 'use strict'; var defineWellKnownSymbol = require('../internals/well-known-symbol-define'); defineWellKnownSymbol('metadata'); },{"../internals/well-known-symbol-define":250}],368:[function(require,module,exports){ 'use strict'; var defineWellKnownSymbol = require('../internals/well-known-symbol-define'); defineWellKnownSymbol('observable'); },{"../internals/well-known-symbol-define":250}],369:[function(require,module,exports){ 'use strict'; var defineWellKnownSymbol = require('../internals/well-known-symbol-define'); defineWellKnownSymbol('patternMatch'); },{"../internals/well-known-symbol-define":250}],370:[function(require,module,exports){ 'use strict'; var defineWellKnownSymbol = require('../internals/well-known-symbol-define'); defineWellKnownSymbol('replaceAll'); },{"../internals/well-known-symbol-define":250}],371:[function(require,module,exports){ 'use strict'; var global = require('../internals/global'); var DOMIterables = require('../internals/dom-iterables'); var DOMTokenListPrototype = require('../internals/dom-token-list-prototype'); var ArrayIteratorMethods = require('../modules/es.array.iterator'); var createNonEnumerableProperty = require('../internals/create-non-enumerable-property'); var wellKnownSymbol = require('../internals/well-known-symbol'); var ITERATOR = wellKnownSymbol('iterator'); var TO_STRING_TAG = wellKnownSymbol('toStringTag'); var ArrayValues = ArrayIteratorMethods.values; var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) { 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); } if (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]; } } } }; for (var COLLECTION_NAME in DOMIterables) { handlePrototype(global[COLLECTION_NAME] && global[COLLECTION_NAME].prototype, COLLECTION_NAME); } handlePrototype(DOMTokenListPrototype, 'DOMTokenList'); },{"../internals/create-non-enumerable-property":87,"../internals/dom-iterables":98,"../internals/dom-token-list-prototype":99,"../internals/global":133,"../internals/well-known-symbol":252,"../modules/es.array.iterator":257}],372:[function(require,module,exports){ 'use strict'; var parent = require('../../es/array/from'); module.exports = parent; },{"../../es/array/from":15}],373:[function(require,module,exports){ 'use strict'; var parent = require('../../es/array/iterator'); module.exports = parent; },{"../../es/array/iterator":16}],374:[function(require,module,exports){ 'use strict'; var parent = require('../../es/map'); require('../../modules/web.dom-collections.iterator'); module.exports = parent; },{"../../es/map":17,"../../modules/web.dom-collections.iterator":371}],375:[function(require,module,exports){ 'use strict'; var parent = require('../../es/math/clz32'); module.exports = parent; },{"../../es/math/clz32":18}],376:[function(require,module,exports){ 'use strict'; var parent = require('../../es/object/assign'); module.exports = parent; },{"../../es/object/assign":19}],377:[function(require,module,exports){ 'use strict'; var parent = require('../../es/object/entries'); module.exports = parent; },{"../../es/object/entries":20}],378:[function(require,module,exports){ 'use strict'; var parent = require('../../es/promise'); require('../../modules/web.dom-collections.iterator'); module.exports = parent; },{"../../es/promise":21,"../../modules/web.dom-collections.iterator":371}],379:[function(require,module,exports){ 'use strict'; var parent = require('../../es/set'); require('../../modules/web.dom-collections.iterator'); module.exports = parent; },{"../../es/set":22,"../../modules/web.dom-collections.iterator":371}],380:[function(require,module,exports){ 'use strict'; var parent = require('../../es/string/ends-with'); module.exports = parent; },{"../../es/string/ends-with":23}],381:[function(require,module,exports){ 'use strict'; var parent = require('../../es/string/includes'); module.exports = parent; },{"../../es/string/includes":24}],382:[function(require,module,exports){ 'use strict'; var parent = require('../../es/string/repeat'); module.exports = parent; },{"../../es/string/repeat":25}],383:[function(require,module,exports){ 'use strict'; var parent = require('../../es/string/replace-all'); module.exports = parent; },{"../../es/string/replace-all":26}],384:[function(require,module,exports){ 'use strict'; var parent = require('../../es/string/starts-with'); module.exports = parent; },{"../../es/string/starts-with":27}],385:[function(require,module,exports){ 'use strict'; var parent = require('../../es/symbol'); require('../../modules/web.dom-collections.iterator'); module.exports = parent; },{"../../es/symbol":28,"../../modules/web.dom-collections.iterator":371}],386:[function(require,module,exports){ require("./polyfills/element.child-node.after"); require("./polyfills/element.child-node.before"); require("./polyfills/element.child-node.closest"); require("./polyfills/element.child-node.remove"); require("./polyfills/element.child-node.replace-with"); require("./polyfills/element.parent-node.append"); require("./polyfills/element.parent-node.prepend"); require("./polyfills/element.node-list.for-each"); },{"./polyfills/element.child-node.after":387,"./polyfills/element.child-node.before":388,"./polyfills/element.child-node.closest":389,"./polyfills/element.child-node.remove":390,"./polyfills/element.child-node.replace-with":391,"./polyfills/element.node-list.for-each":392,"./polyfills/element.parent-node.append":393,"./polyfills/element.parent-node.prepend":394}],387:[function(require,module,exports){ (function (arr) { arr.forEach(function (item) { if (item.hasOwnProperty("after")) { return; } Object.defineProperty(item, "after", { configurable: true, enumerable: true, writable: true, value: function after() { var argArr = Array.prototype.slice.call(arguments), docFrag = document.createDocumentFragment(); argArr.forEach(function (argItem) { var isNode = argItem instanceof Node; docFrag.appendChild( isNode ? argItem : document.createTextNode(String(argItem)) ); }); this.parentNode.insertBefore(docFrag, this.nextSibling); }, }); }); })([Element.prototype, CharacterData.prototype, DocumentType.prototype]); },{}],388:[function(require,module,exports){ (function (arr) { arr.forEach(function (item) { if (item.hasOwnProperty("before")) { return; } Object.defineProperty(item, "before", { configurable: true, enumerable: true, writable: true, value: function before() { var argArr = Array.prototype.slice.call(arguments), docFrag = document.createDocumentFragment(); argArr.forEach(function (argItem) { var isNode = argItem instanceof Node; docFrag.appendChild( isNode ? argItem : document.createTextNode(String(argItem)) ); }); this.parentNode.insertBefore(docFrag, this); }, }); }); })([Element.prototype, CharacterData.prototype, DocumentType.prototype]); },{}],389:[function(require,module,exports){ if (!Element.prototype.matches) { Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector; } if (!Element.prototype.closest) { Element.prototype.closest = function (s) { var el = this; do { if (Element.prototype.matches.call(el, s)) return el; el = el.parentElement || el.parentNode; } while (el !== null && el.nodeType === 1); return null; }; } },{}],390:[function(require,module,exports){ (function (arr) { arr.forEach(function (item) { if (item.hasOwnProperty("remove")) { return; } Object.defineProperty(item, "remove", { configurable: true, enumerable: true, writable: true, value: function remove() { if (this.parentNode === null) { return; } this.parentNode.removeChild(this); }, }); }); })([Element.prototype, CharacterData.prototype, DocumentType.prototype]); },{}],391:[function(require,module,exports){ function ReplaceWithPolyfill() { "use-strict"; var parent = this.parentNode, i = arguments.length, currentNode; if (!parent) return; if (!i) parent.removeChild(this); while (i--) { currentNode = arguments[i]; if (typeof currentNode !== "object") { currentNode = this.ownerDocument.createTextNode(currentNode); } else if (currentNode.parentNode) { currentNode.parentNode.removeChild(currentNode); } if (!i) parent.replaceChild(currentNode, this); else parent.insertBefore(currentNode, this.previousSibling); } } if (!Element.prototype.replaceWith) Element.prototype.replaceWith = ReplaceWithPolyfill; if (!CharacterData.prototype.replaceWith) CharacterData.prototype.replaceWith = ReplaceWithPolyfill; if (!DocumentType.prototype.replaceWith) DocumentType.prototype.replaceWith = ReplaceWithPolyfill; },{}],392:[function(require,module,exports){ if (window.NodeList && !NodeList.prototype.forEach) { NodeList.prototype.forEach = function (callback, thisArg) { thisArg = thisArg || window; for (var i = 0; i < this.length; i++) { callback.call(thisArg, this[i], i, this); } }; } },{}],393:[function(require,module,exports){ (function (arr) { arr.forEach(function (item) { if (item.hasOwnProperty("append")) { return; } Object.defineProperty(item, "append", { configurable: true, enumerable: true, writable: true, value: function append() { var argArr = Array.prototype.slice.call(arguments), docFrag = document.createDocumentFragment(); argArr.forEach(function (argItem) { var isNode = argItem instanceof Node; docFrag.appendChild( isNode ? argItem : document.createTextNode(String(argItem)) ); }); this.appendChild(docFrag); }, }); }); })([Element.prototype, Document.prototype, DocumentFragment.prototype]); },{}],394:[function(require,module,exports){ (function (arr) { arr.forEach(function (item) { if (item.hasOwnProperty("prepend")) { return; } Object.defineProperty(item, "prepend", { configurable: true, enumerable: true, writable: true, value: function prepend() { var argArr = Array.prototype.slice.call(arguments), docFrag = document.createDocumentFragment(); argArr.forEach(function (argItem) { var isNode = argItem instanceof Node; docFrag.appendChild( isNode ? argItem : document.createTextNode(String(argItem)) ); }); this.insertBefore(docFrag, this.firstChild); }, }); }); })([Element.prototype, Document.prototype, DocumentFragment.prototype]); },{}],395:[function(require,module,exports){ var runtime = (function (exports) { "use strict"; var Op = Object.prototype; var hasOwn = Op.hasOwnProperty; var defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }; var undefined; var $Symbol = typeof Symbol === "function" ? Symbol : {}; var iteratorSymbol = $Symbol.iterator || "@@iterator"; var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator"; var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); return obj[key]; } try { define({}, ""); } catch (err) { define = function(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator; var generator = Object.create(protoGenerator.prototype); var context = new Context(tryLocsList || []); defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }); return generator; } exports.wrap = wrap; function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } var GenStateSuspendedStart = "suspendedStart"; var GenStateSuspendedYield = "suspendedYield"; var GenStateExecuting = "executing"; var GenStateCompleted = "completed"; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf; var NativeIteratorPrototype = getProto && getProto(getProto(values([]))); if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) { IteratorPrototype = NativeIteratorPrototype; } var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); GeneratorFunction.prototype = GeneratorFunctionPrototype; defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: true }); defineProperty( GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: true } ); GeneratorFunction.displayName = define( GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction" ); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function(method) { define(prototype, method, function(arg) { return this._invoke(method, arg); }); }); } exports.isGeneratorFunction = function(genFun) { var ctor = typeof genFun === "function" && genFun.constructor; return ctor ? ctor === GeneratorFunction || (ctor.displayName || ctor.name) === "GeneratorFunction" : false; }; exports.mark = function(genFun) { if (Object.setPrototypeOf) { Object.setPrototypeOf(genFun, GeneratorFunctionPrototype); } else { genFun.__proto__ = GeneratorFunctionPrototype; define(genFun, toStringTagSymbol, "GeneratorFunction"); } genFun.prototype = Object.create(Gp); return genFun; }; exports.awrap = function(arg) { return { __await: arg }; }; function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if (record.type === "throw") { reject(record.arg); } else { var result = record.arg; var value = result.value; if (value && typeof value === "object" && hasOwn.call(value, "__await")) { return PromiseImpl.resolve(value.__await).then(function(value) { invoke("next", value, resolve, reject); }, function(err) { invoke("throw", err, resolve, reject); }); } return PromiseImpl.resolve(value).then(function(unwrapped) { result.value = unwrapped; resolve(result); }, function(error) { return invoke("throw", error, resolve, reject); }); } } var previousPromise; function enqueue(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function(resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then( callInvokeWithMethodAndArg, callInvokeWithMethodAndArg ) : callInvokeWithMethodAndArg(); } defineProperty(this, "_invoke", { value: enqueue }); } defineIteratorMethods(AsyncIterator.prototype); define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }); exports.AsyncIterator = AsyncIterator; exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) { if (PromiseImpl === void 0) PromiseImpl = Promise; var iter = new AsyncIterator( wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl ); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function(result) { return result.done ? result.value : iter.next(); }); }; function makeInvokeMethod(innerFn, self, context) { var state = GenStateSuspendedStart; return function invoke(method, arg) { if (state === GenStateExecuting) { throw new Error("Generator is already running"); } if (state === GenStateCompleted) { if (method === "throw") { throw arg; } return doneResult(); } context.method = method; context.arg = arg; while (true) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if (context.method === "next") { context.sent = context._sent = context.arg; } else if (context.method === "throw") { if (state === GenStateSuspendedStart) { state = GenStateCompleted; throw context.arg; } context.dispatchException(context.arg); } else if (context.method === "return") { context.abrupt("return", context.arg); } state = GenStateExecuting; var record = tryCatch(innerFn, self, context); if (record.type === "normal") { state = context.done ? GenStateCompleted : GenStateSuspendedYield; if (record.arg === ContinueSentinel) { continue; } return { value: record.arg, done: context.done }; } else if (record.type === "throw") { state = GenStateCompleted; context.method = "throw"; context.arg = record.arg; } } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method; var method = delegate.iterator[methodName]; if (method === undefined) { context.delegate = null; if (methodName === "throw" && delegate.iterator["return"]) { context.method = "return"; context.arg = undefined; maybeInvokeDelegate(delegate, context); if (context.method === "throw") { return ContinueSentinel; } } if (methodName !== "return") { context.method = "throw"; context.arg = new TypeError( "The iterator does not provide a '" + methodName + "' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if (record.type === "throw") { context.method = "throw"; context.arg = record.arg; context.delegate = null; return ContinueSentinel; } var info = record.arg; if (! info) { context.method = "throw"; context.arg = new TypeError("iterator result is not an object"); context.delegate = null; return ContinueSentinel; } if (info.done) { context[delegate.resultName] = info.value; context.next = delegate.nextLoc; if (context.method !== "return") { context.method = "next"; context.arg = undefined; } } else { return info; } context.delegate = null; return ContinueSentinel; } defineIteratorMethods(Gp); define(Gp, toStringTagSymbol, "Generator"); define(Gp, iteratorSymbol, function() { return this; }); define(Gp, "toString", function() { return "[object Generator]"; }); function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; if (1 in locs) { entry.catchLoc = locs[1]; } if (2 in locs) { entry.finallyLoc = locs[2]; entry.afterLoc = locs[3]; } this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal"; delete record.arg; entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }]; tryLocsList.forEach(pushTryEntry, this); this.reset(true); } exports.keys = function(val) { var object = Object(val); var keys = []; for (var key in object) { keys.push(key); } keys.reverse(); return function next() { while (keys.length) { var key = keys.pop(); if (key in object) { next.value = key; next.done = false; return next; } } next.done = true; return next; }; }; function values(iterable) { if (iterable || iterable === "") { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) { return iteratorMethod.call(iterable); } if (typeof iterable.next === "function") { return iterable; } if (!isNaN(iterable.length)) { var i = -1, next = function next() { while (++i < iterable.length) { if (hasOwn.call(iterable, i)) { next.value = iterable[i]; next.done = false; return next; } } next.value = undefined; next.done = true; return next; }; return next.next = next; } } throw new TypeError(typeof iterable + " is not iterable"); } exports.values = values; function doneResult() { return { value: undefined, done: true }; } Context.prototype = { constructor: Context, reset: function(skipTempReset) { this.prev = 0; this.next = 0; this.sent = this._sent = undefined; this.done = false; this.delegate = null; this.method = "next"; this.arg = undefined; this.tryEntries.forEach(resetTryEntry); if (!skipTempReset) { for (var name in this) { if (name.charAt(0) === "t" && hasOwn.call(this, name) && !isNaN(+name.slice(1))) { this[name] = undefined; } } } }, stop: function() { this.done = true; var rootEntry = this.tryEntries[0]; var rootRecord = rootEntry.completion; if (rootRecord.type === "throw") { throw rootRecord.arg; } return this.rval; }, dispatchException: function(exception) { if (this.done) { throw exception; } var context = this; function handle(loc, caught) { record.type = "throw"; record.arg = exception; context.next = loc; if (caught) { context.method = "next"; context.arg = undefined; } return !! caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; var record = entry.completion; if (entry.tryLoc === "root") { return handle("end"); } if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"); var hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) { return handle(entry.catchLoc, true); } else if (this.prev < entry.finallyLoc) { return handle(entry.finallyLoc); } } else if (hasCatch) { if (this.prev < entry.catchLoc) { return handle(entry.catchLoc, true); } } else if (hasFinally) { if (this.prev < entry.finallyLoc) { return handle(entry.finallyLoc); } } else { throw new Error("try statement without catch or finally"); } } } }, abrupt: function(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } if (finallyEntry && (type === "break" || type === "continue") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) { finallyEntry = null; } var record = finallyEntry ? finallyEntry.completion : {}; record.type = type; record.arg = arg; if (finallyEntry) { this.method = "next"; this.next = finallyEntry.finallyLoc; return ContinueSentinel; } return this.complete(record); }, complete: function(record, afterLoc) { if (record.type === "throw") { throw record.arg; } if (record.type === "break" || record.type === "continue") { this.next = record.arg; } else if (record.type === "return") { this.rval = this.arg = record.arg; this.method = "return"; this.next = "end"; } else if (record.type === "normal" && afterLoc) { this.next = afterLoc; } return ContinueSentinel; }, finish: function(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) { this.complete(entry.completion, entry.afterLoc); resetTryEntry(entry); return ContinueSentinel; } } }, "catch": function(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if (record.type === "throw") { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function(iterable, resultName, nextLoc) { this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }; if (this.method === "next") { this.arg = undefined; } return ContinueSentinel; } }; return exports; }( typeof module === "object" ? module.exports : {} )); try { regeneratorRuntime = runtime; } catch (accidentalStrictMode) { if (typeof globalThis === "object") { globalThis.regeneratorRuntime = runtime; } else { Function("r", "regeneratorRuntime = r")(runtime); } } },{}],396:[function(require,module,exports){ "use strict"; var _window$opera; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } function _nonIterableSpread() { 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 _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); } function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _regeneratorRuntime() { "use strict"; _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; } function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _nonIterableRest() { 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) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } 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 || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } (function deMainFuncInner(deWindow, prestoStorage, FormData, scrollTo, localData) { 'use strict'; var _marked = _regeneratorRuntime().mark(getFormElements); var version = '23.9.19.0'; var commit = '335b491'; var doc = deWindow.document; var gitWiki = 'https://github.com/SthephanShinkufag/Dollchan-Extension-Tools/wiki/'; var gitRaw = 'https://raw.githubusercontent.com/SthephanShinkufag/Dollchan-Extension-Tools/master/'; var aib, Cfg, dTime, dummy, isExpImg, isPreImg, lang, locStorage, nav, needScroll, pByEl, pByNum, postform, sesStorage, updater; var topWinZ = 10; var defaultCfg = { disabled: 0, language: 0, hideBySpell: 1, spells: null, sortSpells: 0, hideRefPsts: 0, nextPageThr: 0, delHiddPost: 0, ajaxUpdThr: 1, updThrDelay: 20, updCount: 1, favIcoBlink: 1, desktNotif: 0, markNewPosts: 1, markMyPosts: 1, expandTrunc: 0, widePosts: 0, limitPostMsg: 2000, showHideBtn: 1, showRepBtn: 1, postBtnsCSS: 2, postBtnsBack: '#8c8c8c', thrBtns: 1, noSpoilers: 0, noPostNames: 0, correctTime: 0, timeOffset: '+0', timePattern: '', timeRPattern: '', expandImgs: 2, imgNavBtns: 1, imgInfoLink: 1, resizeDPI: 0, resizeImgs: 1, minImgSize: 100, maxImgSize: 2000, zoomFactor: 20, webmControl: 1, webmTitles: 1, webmVolume: 100, minWebmWidth: 320, preLoadImgs: 0, findImgFile: 0, openImgs: 0, imgSrcBtns: 1, imgNames: 0, maskImgs: 0, maskVisib: 7, linksNavig: 1, linksOver: 100, linksOut: 1500, markViewed: 0, strikeHidd: 0, removeHidd: 0, noNavigHidd: 0, markMyLinks: 1, crossLinks: 1, decodeLinks: 1, insertNum: 1, addOPLink: 1, addImgs: 0, addMP3: 1, addVocaroo: 1, embedYTube: 1, YTubeWidth: 360, YTubeHeigh: 270, YTubeTitles: 1, ytApiKey: '', addVimeo: 1, ajaxPosting: 1, postSameImg: 1, removeEXIF: 0, removeFName: 0, sendErrNotif: 1, scrAfterRep: 0, fileInputs: 2, addPostForm: 2, spacedQuote: 1, favOnReply: 1, warnSubjTrip: 0, addSageBtn: 1, saveSage: 1, sageReply: 0, altCaptcha: 0, capUpdTime: 300, captchaLang: 1, addTextBtns: 1, txtBtnsLoc: 1, userPassw: 1, passwValue: '', userName: 0, nameValue: '', noBoardRule: 0, noPassword: 1, noName: 0, noSubj: 0, scriptStyle: 0, userCSS: 0, userCSSTxt: '', expandPanel: 0, animation: 1, hotKeys: 1, loadPages: 1, panelCounter: 1, rePageTitle: 1, inftyScroll: 1, hideReplies: 0, scrollToTop: 0, saveScroll: 1, favFolders: 1, favThrOrder: 0, favWinOn: 0, closePopups: 0, updDollchan: 2, textaWidth: 300, textaHeight: 115, replyWinDrag: 0, replyWinX: 'right: 0', replyWinY: 'top: 0', cfgTab: 'filters', cfgWinDrag: 0, cfgWinX: 'right: 0', cfgWinY: 'top: 0', hidWinDrag: 0, hidWinX: 'right: 0', hidWinY: 'top: 0', favWinDrag: 0, favWinX: 'right: 0', favWinY: 'top: 0', favWinWidth: 500, vidWinDrag: 0, vidWinX: 'right: 0', vidWinY: 'top: 0' }; var Lng = { cfgNeedReload: ['Для применения необходима перезагрузка', 'Reboot required to apply', 'Для застосування необхідне перезавантаження'], cfgTab: { filters: ['Фильтры', 'Filters', 'Фільтри'], posts: ['Посты', 'Posts', 'Дописи'], images: ['Картинки', 'Images', 'Зображ.'], links: ['Ссылки', 'Links', 'Посил.'], form: ['Форма', 'Form', 'Форма'], common: ['Общее', 'Common', 'Спільне'], info: ['Инфо', 'Info', 'Інфо'] }, cfg: { language: { sel: [['Ru', 'En', 'Ua'], ['Ru', 'En', 'Ua'], ['Ru', 'En', 'Ua']], txt: ['', '', ''] }, hideBySpell: ['Спеллы: ', 'Magic spells: ', 'Спелли: '], sortSpells: ['Сортировать спеллы и удалять дубликаты', 'Sort spells and remove duplicates', 'Сортувати спелли та видаляти дублікати'], hideRefPsts: ['Скрывать ответы на скрытые посты', 'Hide replies to hidden posts', 'Ховати відповіді на сховані дописи'], nextPageThr: ['Скрытые треды - загружать со следующих страниц', 'Load threads from next pages instead of hidden', 'Сховані треди - брати з наступних сторінок'], delHiddPost: { sel: [['Откл.', 'Всё', 'Только посты', 'Только треды'], ['Disable', 'All', 'Posts only', 'Threads only'], ['Вимк.', 'Все', 'Лише дописи', 'Лише треди']], txt: ['Удалять скрытое', 'Remove placeholders', 'Видаляти сховане'] }, ajaxUpdThr: ['Апдейтер тредов ', 'Threads updater ', 'Оновлювач тредів '], updThrDelay: ['(сек)', '(sec)', '(сек)'], updCount: ['Обратный счетчик обновления треда', 'Show countdown to thread update', 'Зворотній відлік оновлення треду'], favIcoBlink: ['Мигать фавиконом при появлении новых постов', 'Blink the favicon on new posts', 'Блимати фавіконом в разі появи нових дописів'], desktNotif: ['Уведомлять о новых постах на рабочем столе', 'Desktop notifications for new posts', 'Повідомляти про нові дописи на стільниці'], markNewPosts: ['Выделять цветом новые посты', 'Highlight new posts with color', 'Виділяти кольором нові дописи'], markMyPosts: ['Выделять цветом мои посты', 'Highlight my own posts', 'Виділяти кольором мої дописи'], expandTrunc: ['Авторазворот сокращенных постов', 'Autoexpand truncated posts', 'Авторозгортання скорочених дописів'], widePosts: ['Растягивать посты по ширине экрана', 'Stretch posts to page width', 'Розтягувати дописи на ширину екрану'], limitPostMsg: ['Ограничение ширины текста в постах (px)', 'Limit text width in posts messages (px)', 'Обмеження ширини тексту в дописах (px)'], thrBtns: { sel: [['Откл.', 'Все', 'Все (на доске)', '"Новые посты" на доске'], ['Disable', 'All', 'All (on board)', '"New posts" on board'], ['Вимк.', 'Всі', 'Всі (на дошці)', '"Нові дописи" на дошці']], txt: ['Кнопки под тредами', 'Buttons under threads', 'Кнопки під тредами'] }, showHideBtn: { sel: [['Откл.', 'С меню', 'Без меню'], ['Disable', 'With menu', 'No menu'], ['Вимк.', 'Із меню', 'Без меню']], txt: ['Кнопки "Скрыть пост/тред"', '"Hide post/thread" buttons', 'Кнопки "Сховати допис/тред"'] }, showRepBtn: { sel: [['Откл.', 'С меню', 'Без меню'], ['Disable', 'With menu', 'No menu'], ['Вимк.', 'Із меню', 'Без меню']], txt: ['Кнопки "Ответить на пост/тред"', '"Reply to post/thread" buttons', 'Кнопки "Відповісти на допис/тред"'] }, postBtnsCSS: { sel: [['Упрощенные', 'Серый градиент', 'Настраиваемые'], ['Simple', 'Gradient grey', 'Custom'], ['Спрощені', 'Сірий градієнт', 'Користувацькі']], txt: ['Кнопки постов ', 'Post buttons ', 'Кнопки дописів '] }, noSpoilers: { sel: [['Откл.', 'Серое', 'Родное'], ['Disable', 'Grey', 'Native'], ['Вимк.', 'Сіре', 'Рідне']], txt: ['Раскрытие текстовых спойлеров', 'Text spoilers expansion', 'Розкриття текстових спойлерів'] }, noPostNames: ['Скрывать имена в постах', 'Hide poster names', 'Ховати імена в дописах'], correctTime: ['Коррекция времени в постах', 'Time correction in posts', 'Корекція часу в дописах'], timeOffset: ['разница (ч) ', 'time offset (h) ', 'різниця (год) '], timePattern: ['Шаблон поиска', 'Search pattern', 'Шаблон пошуку'], timeRPattern: ['Шаблон замены', 'Replace pattern', 'Шаблон заміни'], expandImgs: { sel: [['Откл.', 'В посте', 'По центру'], ['Disable', 'In post', 'By center'], ['Вимк.', 'В дописі', 'По центру']], txt: ['Раскрывать картинки по клику', 'Expand images on click', 'Розгортати зображення по кліку'] }, imgNavBtns: ['Добавлять кнопки навигации по картинкам', 'Add buttons to navigate images', 'Додавати кнопки навігації по зображеннях'], imgInfoLink: ['Имя файла под раскрытой картинкой', 'Show file name under expanded image', 'Імʼя файлу під розкритим зображенням'], resizeDPI: ['Не растягивать на дисплеях с высоким DPI', 'Donʼt upscale images on high DPI displays', 'Не розтягувати на дисплеях з високим DPI'], resizeImgs: { sel: [['Откл.', 'По ширине', 'Шир.+выс.'], ['Disable', 'By width', 'Width+Height'], ['Вимк.', 'По ширині', 'Шир.+выс.']], txt: ['Уменьшать при раскрытии в посте', 'Fit to screen for expanding in post', 'Зменшувати при розкритті в дописі'] }, minImgSize: ['мин.', 'min', 'мін.'], maxImgSize: ['макс. размер раскрытия (px)', 'max expansion size (px)', 'макс. розмір розгортання (px)'], zoomFactor: ['Чувствительность зума картинок [1-100%]', 'Images zoom sensibility [1-100%]', 'Чутливість зуму зображень [1-100%]'], webmControl: ['Показывать контрол-бар для WebM', 'Show control bar for WebM', 'Показувати смугу керування для WebM'], webmTitles: ['Получать названия WebM из метаданных', 'Load titles from WebM metadata', 'Отримувати назви WebM з метаданих'], webmVolume: ['Громкость WebM по умолчанию [0-100%]', 'Default volume for WebM [0-100%]', 'Гучність WebM по замовчуванню [0-100%]'], minWebmWidth: ['Минимальная ширина WebM (px)', 'Minimal width for WebM (px)', 'Мінімальна ширина WebM (px)'], preLoadImgs: { sel: [['Откл.', 'Все', 'Без WebM'], ['Disable', 'All', 'Non-WebM'], ['Вимк.', 'Всі', 'Крім WebM']], txt: ['Предварительно загружать картинки', 'Preload images', 'Наперед завантажувати зображення'] }, findImgFile: ['Распознавать файлы, встроенные в картинках', 'Detect embedded files in images', 'Розпізнавати файли, що вбудовані в зображення'], openImgs: { sel: [['Откл.', 'Все подряд', 'Только GIF', 'Кроме GIF'], ['Disable', 'All types', 'Only GIF', 'Non-GIF'], ['Вимк.', 'Всі', 'Лише GIF', 'Крім GIF']], txt: ['Заменять тамбнейлы на оригиналы', 'Replace thumbnails with original images', 'Замінювати зображення на оригінали'] }, imgSrcBtns: ['Добавлять кнопки "Поиск" для картинок', 'Add "Search" buttons for images', 'Додавати кнопки "Пошук" для зображень'], imgNames: { sel: [['Не изменять', 'Настоящие (сокр.)', 'Скрывать', 'Настоящие (полные)'], ['Donʼt change', 'Original (trunc.)', 'Hide', 'Original (full)'], ['Не змінювати', 'Справжні (скороч.)', 'Ховати', 'Справжні (повні)']], txt: ['имена картинок', 'filenames', 'імена зображень'] }, maskVisib: ['Видимость для NSFW-картинок [0-100%]', 'Visibility for NSFW images [0-100%]', 'Видимість для NSFW-зображень [0-100%]'], linksNavig: ['Навигация постов по >>ссылкам', 'Posts navigation by >>links', 'Навігація дописів по >>посиланнях'], linksOver: ['Появление ', 'Appearance ', 'Поява '], linksOut: ['Пропадание (мс)', 'Disappearance (ms)', 'Зникнення (мс)'], markViewed: ['Помечать просмотренные посты', 'Mark viewed posts', 'Позначати переглянуті дописи'], strikeHidd: ['Зачеркивать >>ссылки на скрытые посты', 'Strike >>links to hidden posts', 'Закреслювати >>посилання на сховані дописи'], removeHidd: ['Также удалять из обратных >>ссылок', 'Also remove from >>backlinks', 'Також видаляти із зворотніх >>посилань'], noNavigHidd: ['Не отображать превью для скрытых постов', 'Donʼt show previews for hidden posts', 'Не показувати превʼю до cхованих дописів'], markMyLinks: ['Помечать ссылки на мои посты как (You)', 'Mark links to my posts with (You)', 'Позначати посилання на мої дописи як (You)'], crossLinks: ['Заменять http:// на >>/b/ссылки', 'Replace http:// with >>/b/links', 'Замінювати https:// на >>/b/посилання'], decodeLinks: ['Декодировать %D0%A5%D1 в ссылках', 'Decode %D0%A5%D1 in links', 'Декодувати %D0%A5%D1 в посиланнях'], insertNum: ['Вставлять >>ссылку по клику на №поста', 'Insert >>link on №postnumber click', 'Вставляти >>посилання на клік по №допису'], addOPLink: ['>>ссылка при ответе на OP в списке тредов', 'Insert >>link when replying to OP on threads list', '>>посилання при відповіді на OP у списці тредів'], addImgs: ['Загружать картинки к jpg/png/gif ссылкам', 'Load images for jpg/png/gif links', 'Додавати зображення до jpg/png/gif посилань'], addMP3: ['Плеер к mp3 ссылкам', 'Player for mp3 links', 'Плеєр до mp3 посилань'], addVocaroo: ['к Vocaroo ссылкам', 'for Vocaroo links', 'до Vocaroo посилань'], addVimeo: ['Добавлять плеер к Vimeo ссылкам', 'Add player for Vimeo links', 'Додавати плеєр до Vimeo посилань'], embedYTube: { sel: [['Ничего', 'Превью+плеер', 'Плеер по клику'], ['Nothing', 'Preview+player', 'On click player'], ['Нічого', 'Превʼю+плеєр', 'Плеєр по кліку']], txt: ['к YouTube ссылкам', 'for YouTube links', 'до YouTube посилань'] }, YTubeTitles: ['Загружать названия к YouTube ссылкам', 'Load titles for YouTube links', 'Отримувати назви до YouTube посилань'], ytApiKey: ['Ключ YT API*', 'YT API Key*', 'Ключ YT API*'], ajaxPosting: ['Отправка постов без перезагрузки', 'Posting without page refresh', 'Дописування без оновлення сторінки'], postSameImg: ['Возможность отправки одинаковых картинок', 'Ability to post duplicate images', 'Можливість надсилання однакових зображень'], removeEXIF: ['Удалять EXIF из JPEG ', 'Remove EXIF from JPEG ', 'Видаляти EXIF з JPEG '], removeFName: { sel: [['Не изменять', 'Удалять', 'Unixtime', 'Unixtime-random'], ['Donʼt change', 'Clear', 'Unixtime', 'Unixtime-random'], ['Не змінювати', 'Видаляти', 'Unixtime', 'Unixtime-random']], txt: ['имена файлов', 'file names', 'імена файлів'] }, sendErrNotif: ['Оповещать в заголовке об ошибке отправки', 'Inform in title about post send error', 'Сповіщати в заголовку про помилку надсилання'], scrAfterRep: ['Перемещаться в конец треда после отправки', 'Scroll to bottom after reply', 'Гортати в кінець треду після надсилання'], fileInputs: { sel: [['Откл.', 'Упрощ.', 'Превью'], ['Disable', 'Simple', 'Preview'], ['Вимкн.', 'Спрощене', 'Превʼю']], txt: ['Улучшенное поле добавления файлов', 'Enhanced file attachment field', 'Покращене поле додавання файлів'] }, addPostForm: { sel: [['Сверху', 'Внизу', 'Скрытая'], ['At top', 'At bottom', 'Hidden'], ['Вгорі', 'Знизу', 'Прихована']], txt: ['Форма ответа в треде', 'Reply form display in thread', 'Форма відповіді в треді'] }, spacedQuote: ['Вставлять пробел при цитировании "> "', 'Insert a space when quoting "> "', 'Вставляти пробіл при цитуванні "> "'], favOnReply: ['Добавлять тред в Избранное после ответа', 'Add thread to Favorites after reply', 'Додавати тред в Вибране після відповіді'], warnSubjTrip: ['Оповещать о трипкоде в поле "Тема"', 'Warn about a tripcode in "Subject" field', 'Сповіщувати про трипкод в полі "Тема"'], addSageBtn: ['Кнопка Sage вместо поля "Email" ', 'Replace "Email" with Sage button ', 'Кнопка Sage замість "E-mail" '], saveSage: ['Помнить сажу', 'Remember sage', 'Памʼятати сажу'], altCaptcha: ['Использовать альтернативную капчу', 'Use alternative captcha', 'Використовувати альтернативну капчу'], capUpdTime: ['Интервал обновления капчи (сек)', 'Captcha update interval (sec)', 'Інтервал оновлення капчі (сек)'], captchaLang: { sel: [['Откл.', 'Eng', 'Rus'], ['Disable', 'Eng', 'Rus'], ['Вимк.', 'Eng', 'Ukr']], txt: ['Принудительный язык ввода капчи', 'Forced captcha input language', 'Примусова мова вводу капчі'] }, addTextBtns: { sel: [['Откл.', 'Графические', 'Упрощённые', 'Стандартные'], ['Disable', 'As images', 'As text', 'Standard'], ['Вимк.', 'Графічні', 'Спрощені', 'Стандартні']], txt: ['Кнопки разметки текста ', 'Text markup buttons ', 'Кнопки розмітки тексту '] }, txtBtnsLoc: ['Внизу', 'At bottom', 'Знизу'], userPassw: ['Постоянный пароль', 'Fixed password', 'Постійний пароль'], userName: ['Постоянное имя', 'Fixed name', 'Постійне імʼя'], noBoardRule: ['Правила ', 'Rules ', 'Правила '], noPassword: ['Пароль ', 'Password ', 'Пароль '], noName: ['Имя ', 'Name ', 'Імʼя '], noSubj: ['Тему', 'Subject', 'Тему'], scriptStyle: { sel: [['Gradient darkblue', 'Gradient blue', 'Solid grey', 'Transparent blue', 'Square dark', 'Gradient pink'], ['Gradient darkblue', 'Gradient blue', 'Solid grey', 'Transparent blue', 'Square dark', 'Gradient pink'], ['Gradient darkblue', 'Gradient blue', 'Solid grey', 'Transparent blue', 'Square dark', 'Gradient pink']], txt: ['Стиль Dollchan', 'Dollchan style', 'Стиль Dollchan'] }, userCSS: ['Пользовательский CSS', 'User CSS', 'Користувацький CSS'], animation: ['CSS3 анимация', 'CSS3 animation', 'CSS3 анімація'], hotKeys: ['Горячие клавиши', 'Hotkeys', 'Гарячі клавіші'], loadPages: ['Количество страниц, загружаемых по F5', 'Number of pages that are loaded on F5 ', 'Кількість сторінок, що завантажуються по F5'], panelCounter: { sel: [['Откл.', 'Все посты', 'Без скрытых'], ['Disabled', 'All posts', 'Except hidden'], ['Вимкн.', 'Всі дописи', 'Крім схованих']], txt: ['Счетчик постов/картинок в треде', 'Сounter for posts/images in thread', 'Лічильник дописів/зображ. в треді'] }, rePageTitle: ['Название треда в заголовке вкладки', 'Show thread title in the page tab', 'Назва треду в заголовку вкладки'], inftyScroll: ['Бесконечная прокрутка страниц', 'Infinite scrolling for pages', 'Нескінченна прокрутка сторінок'], hideReplies: ['Показывать только OP в списке тредов', 'Show only OP in threads list', 'Показувати лише OP в списку тредів'], scrollToTop: ['Всегда перемещаться вверх в списке тредов', 'Always scroll to top in the threads list', 'Завжди гортати догори в списку тредів'], saveScroll: ['Запоминать позицию скролла в тредах', 'Remember the scroll position in threads', 'Пам`ятати позицію скролла в тредах'], favFolders: ['Папки досок в окне Избранного', 'Boards folders in the Favorites window', 'Папки дошок в вікні Вибраного'], favThrOrder: { sel: [['По номеру', 'По номеру (убыв)', 'По добавлению', 'По добавлению (убыв)'], ['By number', 'By number (desc)', 'By adding', 'By adding (desc)'], ['За номером', 'За номером (зменш)', 'По додаванню', 'По додаванню (зменш)']], txt: ['Сортировка в Избранном', 'Sorting in Favorites', 'Сортування в Вибраному'] }, favWinOn: ['Всегда открывать окно Избранное', 'Always open the Favorites window', 'Завжди відкривати вікно Вибране'], closePopups: ['Автоматически закрывать уведомления', 'Close popups automatically', 'Автоматично закривати сповіщення'], updDollchan: { sel: [['Откл.', 'Каждый день', 'Каждые 2 дня', 'Каждую неделю', 'Каждые 2 недели', 'Каждый месяц'], ['Disable', 'Every day', 'Every 2 days', 'Every week', 'Every 2 weeks', 'Every month'], ['Вимкн.', 'Щодня', 'Кожні 2 дні', 'Щотижня', 'Кожні 2 тижні', 'Щомісяця']], txt: ['Проверять обновления Dollchan', 'Check for Dollchan updates', 'Перевіряти оновлення Dollchan'] } }, panelBtn: { attach: ['Прикрепить/Открепить панель', 'Attach/Detach panel', 'Закріпити/відкріпити панель'], cfg: ['Настройки', 'Settings', 'Налаштування'], hid: ['Скрытое', 'Hidden', 'Сховане'], fav: ['Избранное', 'Favorites', 'Вибране'], vid: ['Ссылки на видео', 'Video links', 'Посилання на відео'], refresh: ['Обновить', 'Refresh', 'Оновити'], goback: ['Назад на доску', 'Return to board', 'Назад до дошки'], gonext: ['На %s страницу', 'Go to page %s', 'До %s сторінки'], goup: ['В начало страницы', 'Scroll to top', 'Прогорнути догори'], godown: ['В конец страницы', 'Scroll to bottom', 'Прогорнути донизу'], expimg: ['Раскрыть все картинки', 'Expand all images', 'Розгорнути всі зображення'], maskimg: ['Режим NSFW', 'NSFW mode', 'Режим NSFW'], preimg: ['Предзагрузить картинки\r\n([Ctrl+Click] только для новых постов)', 'Preload images\r\n([Ctrl+Click] for new posts only)', 'Наперед завантажити зображення\r\n([Ctrl+Click] лише для нових дописів)'], savethr: ['Сохранить на диск', 'Save to disk', 'Зберегти на диск'], 'upd-on': ['Выключить автообновление треда', 'Disable thread updater', 'Вимкнути оновлювач треду'], 'upd-off': ['Включить автообновление треда', 'Enable thread updater', 'Увімкнути оновлювач треду'], 'audio-off': ['Звуковое оповещение о новых постах', 'Sound notification about new posts', 'Звукове сповіщення про нові дописи'], catalog: ['Перейти в каталог', 'Go to catalog', 'Перейти до каталогу'], enable: ['Включить/выключить Dollchan', 'Turn on/off the Dollchan', 'Увімкнути/вимкнути Dollchan'], postsCount: ['Постов в треде', 'Posts in thread', 'Дописів у треді'], postsNotHid: ['Постов в треде (без скрытых)', 'Posts in thread (without hidden)', 'Дописів у треді (крім схованих)'], filesCount: ['Картинок и видео в треде', 'Images and videos in thread', 'Зображень та відео у треді'], postersCount: ['Постящих в треде', 'Posters in thread', 'Дописувачів у треді'] }, togglePost: ['Скрыть/Раскрыть пост', 'Hide/Unhide post', 'Сховати/показати допис'], toggleThr: ['Скрыть/Раскрыть тред', 'Hide/Unhide thread', 'Сховати/показати тред'], replyToPost: ['Ответить на пост', 'Reply to post', 'Відповісти на допис'], replyToThr: ['Ответить в тред', 'Reply to thread', 'Відповісти в тред'], expandThr: ['Развернуть тред', 'Expand thread', 'Розгорнути тред'], addFav: ['Добавить тред в Избранное', 'Add thread to Favorites', 'Додати тред в Вибране'], delFav: ['Убрать тред из Избранного', 'Remove thread from Favorites', 'Прибрати тред з Вибраного'], attachPview: ['Закрепить превью', 'Attach preview', 'Закріпити превʼю'], closeWindow: ['Закрыть окно', 'Close window', 'Закрити вікно'], closeReply: ['Закрыть форму', 'Close form', 'Закрити форму'], toPanel: ['Закрепить на панели', 'Attach to panel', 'Закріпити на панелі'], makeDrag: ['Сделать перетаскиваемым окном', 'Make draggable window', 'Зробити перетягуваним вікном'], underPost: ['Разместить форму после поста', 'Move form under post', 'Розмістити форму після допису'], clearForm: ['Очистить форму', 'Clear form', 'Очистити форму'], txtBtn: [['Жирный', 'Bold', 'Жирний'], ['Курсив', 'Italic', 'Курсив'], ['Подчеркнутый', 'Underlined', 'Підкреслений'], ['Зачеркнутый', 'Strike', 'Закреслений'], ['Спойлер', 'Spoiler', 'Спойлер'], ['Код', 'Code', 'Код'], ['Верхний индекс', 'Superscript', 'Верхній індекс'], ['Нижний индекс', 'Subscript', 'Нижній індекс'], ['Цитировать выделенное', 'Quote selected', 'Цитувати виділене']], selHiderMenu: { sel: ['Скрывать выделенное', 'Hide selected text', 'Ховати виділене'], name: ['Скрывать по имени', 'Hide by name', 'Ховати по імені'], trip: ['Скрывать по трипкоду', 'Hide by tripcode', 'Ховати по тріпкоду'], img: ['Скрывать по размеру картинки', 'Hide by image size', 'Ховати по розміру зображення'], imgn: ['Скрывать по имени картинки', 'Hide by image name', 'Ховати по імені зображення'], ihash: ['Скрывать схожие картинки', 'Hide by similar images', 'Ховати подібні зображення'], noimg: ['Скрывать без картинок', 'Hide without images', 'Ховати без зображень'], notext: ['Скрывать без текста', 'Hide without text', 'Ховати без тексту'], text: ['Скрыть схожий текст', 'Hide similar text', 'Сховати схожий текст'], refs: ['Скрыть с ответами', 'Hide with replies', 'Сховати з відповідями'], refsonly: ['Скрывать ответы', 'Hide replies', 'Ховати відповіді'] }, selExpandThr: [ ['+10 постов', 'Последние 30', 'Последние 50', 'Последние 100', 'Весь тред'], ['+10 posts', 'Last 30 posts', 'Last 50 posts', 'Last 100 posts', 'Entire thread'], ['+10 дописів', 'Останні 30', 'Останні 50', 'Останні 100', 'Весь тред']], selAjaxPages: [ ['1 страница', '2 страницы', '3 страницы', '4 страницы', '5 страниц'], ['1 page', '2 pages', '3 pages', '4 pages', '5 pages'], ['1 сторінка', '2 сторінки', '3 сторінки', '4 сторінки', '5 сторінок']], selSaveThr: [ ['Скачать весь тред', 'Скачать картинки'], ['Download thread', 'Download images'], ['Завантажити весь тред', 'Завантажити зображення']], selAudioNotif: [ ['Каждые 30 сек.', 'Каждую минуту', 'Каждые 2 мин.', 'Каждые 5 мин.'], ['Every 30 sec.', 'Every minute', 'Every 2 min.', 'Every 5 min.'], ['Кожні 30 сек.', 'Щохвилини', 'Кожні 2 хв.', 'Кожні 5 хв.']], reportPost: ['Жалоба на пост', 'Report a post', 'Скарга на допис'], reportThr: ['Жалоба на тред', 'Report a thread', 'Скарга на тред'], markMyPost: ['Пометить как мой пост', 'Mark as my post', 'Відмітити як мій допис'], deleteMyPost: ['Убрать из моих постов', 'Delete from my posts', 'Прибрати з моїх дописів'], saveAs: ['Сохр. как ', 'Save as ', 'Збер. як '], origName: ['Оригинальное имя', 'Original name', 'Оригінальне імʼя'], metaName: ['Имя из метаданных', 'Name from metadata', 'Імʼя з метаданих'], boardName: ['Имя, присвоенное доской', 'Name assigned by the board', 'Імʼя, присвоєне дошкою'], searchIn: ['Искать в ', 'Search in ', 'Шукати в '], frameSearch: ['Поиск кадра в ', 'Frame search in ', 'Пошук кадру в '], gotoResults: ['Перейти к результатам поиска', 'Go to search results', 'Перейти до результатів пошуку'], getFrameLinks: ['Получить ссылки для поиска этого кадра', 'Get links to search this frame', 'Отримати посилання для пошуку цього кадру'], saveFrame: ['Сохранить полученный кадр', 'Save the received frame', 'Зберегти отриманий кадр'], errSaucenao: ['Ошибка: не могу загрузить на saucenao.com', 'Error: canʼt load to saucenao.com', 'Помилка: не можу завантажити на saucenao.com'], hotKeyEdit: [[ '%l%i24 – предыдущая страница/картинка%/l', '%l%i217 – следующая страница/картинка%/l', '%l%i21 – тред (на доске)/пост (в треде) ниже%/l', '%l%i20 – тред (на доске)/пост (в треде) выше%/l', '%l%i31 – пост (на доске) ниже%/l', '%l%i30 – пост (на доске) выше%/l', '%l%i23 – скрыть пост/тред%/l', '%l%i32 – перейти в тред%/l', '%l%i33 – развернуть тред%/l', '%l%i211 – раскрыть картинку в посте%/l', '%l%i22 – быстрый ответ%/l', '%l%i25t – отправить пост%/l', '%l%i210 – открыть/закрыть "Настройки"%/l', '%l%i26 – открыть/закрыть "Избранное"%/l', '%l%i27 – открыть/закрыть "Скрытое"%/l', '%l%i218 – открыть/закрыть "Видео"%/l', '%l%i28 – открыть/закрыть панель%/l', '%l%i29 – вкл./выкл. режим NSFW%/l', '%l%i40 – обновить тред (в треде)%/l', '%l%i212t – жирный%/l', '%l%i213t – курсив%/l', '%l%i214t – зачеркнутый%/l', '%l%i215t – спойлер%/l', '%l%i216t – код%/l'], [ '%l%i24 – previous page/image%/l', '%l%i217 – next page/image%/l', '%l%i21 – thread (on board)/post (in thread) below%/l', '%l%i20 – thread (on board)/post (in thread) above%/l', '%l%i31 – on board post below%/l', '%l%i30 – on board post above%/l', '%l%i23 – hide post/thread%/l', '%l%i32 – go to thread%/l', '%l%i33 – expand thread%/l', '%l%i211 – expand postʼs images%/l', '%l%i22 – quick reply%/l', '%l%i25t – send post%/l', '%l%i210 – open/close "Settings"%/l', '%l%i26 – open/close "Favorites"%/l', '%l%i27 – open/close "Hidden"%/l', '%l%i218 – open/close "Videos"%/l', '%l%i28 – open/close main panel%/l', '%l%i29 – toggle NSFW mode%/l', '%l%i40 – update thread%/l', '%l%i212t – bold%/l', '%l%i213t – italic%/l', '%l%i214t – strike%/l', '%l%i215t – spoiler%/l', '%l%i216t – code%/l'], [ '%l%i24 – попередня сторінка/зображення%/l', '%l%i217 – наступна сторінка/зображення%/l', '%l%i21 – тред (на дошці)/допис (в треді) нижче%/l', '%l%i20 – тред (на дошці)/допис (в треді) вище%/l', '%l%i31 – допис (на дошці) нижче%/l', '%l%i30 – допис (на дошці) вище%/l', '%l%i23 – приховати допис/тред%/l', '%l%i32 – перейти в тред%/l', '%l%i33 – розгорнути тред%/l', '%l%i211 – розгорнути зображення в дописі%/l', '%l%i22 – швидка відповідь%/l', '%l%i25t – відправити допис%/l', '%l%i210 – відкрити/закрити "Налаштування"%/l', '%l%i26 – відкрити/закрити "Вибране"%/l', '%l%i27 – відкрити/закрити "Сховане"%/l', '%l%i218 – відкрити/закрити "Посилання на відео"%/l', '%l%i28 – відкрити/закрити панель%/l', '%l%i29 – увімкнути/вимкнути режим NSFW%/l', '%l%i40 – оновити тред (в треді)%/l', '%l%i212t – жирний%/l', '%l%i213t – курсив%/l', '%l%i214t – закреслений%/l', '%l%i215t – спойлер%/l', '%l%i216t – код%/l']], cTimeError: ['Неправильные настройки времени', 'Invalid time settings', 'Неправильні налаштування часу'], month: [['янв', 'фев', 'мар', 'апр', 'мая', 'июн', 'июл', 'авг', 'сен', 'окт', 'ноя', 'дек'], ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], ['січ', 'лют', 'бер', 'кві', 'тра', 'чер', 'лип', 'сер', 'вер', 'жов', 'лис', 'гру']], fullMonth: [['января', 'февраля', 'марта', 'апреля', 'мая', 'июня', 'июля', 'августа', 'сентября', 'октября', 'ноября', 'декабря'], ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], ['січня', 'лютого', 'березня', 'квітня', 'травня', 'червня', 'липня', 'серпня', 'вересня', 'жовтня', 'листопада', 'грудня']], week: [['Вск', 'Пнд', 'Втр', 'Срд', 'Чтв', 'Птн', 'Сбт'], ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], ['Нед', 'Пон', 'Вів', 'Сер', 'Чет', 'Птн', 'Сбт']], monthDict: { янв: 0, фев: 1, мар: 2, апр: 3, май: 4, мая: 4, июн: 5, июл: 6, авг: 7, сен: 8, окт: 9, ноя: 10, дек: 11, jan: 0, feb: 1, mar: 2, apr: 3, may: 4, jun: 5, jul: 6, aug: 7, sep: 8, oct: 9, nov: 10, dec: 11, січ: 0, лют: 1, бер: 2, кві: 3, тра: 4, чер: 5, лип: 6, сер: 7, вер: 8, жов: 9, лис: 10, гру: 11 }, seSyntaxErr: ['синтаксическая ошибка в аргументе спелла: #%s', 'syntax error in argument of spell: #%s', 'синтаксична помилка в аргументі спеллу: #%s'], seUnknown: ['неизвестный спелл: #%s', 'unknown spell: #%s', 'невідомий спелл: #%s'], seMissOp: ['пропущен оператор', 'missing operator', 'пропущено оператор'], seMissArg: ['пропущен аргумент спелла: #%s', 'missing argument of spell: #%s', 'пропущено аргумент спеллу: #%s'], seMissSpell: ['пропущен спелл', 'missing spell', 'пропущено спелл'], seErrRegex: ['синтаксическая ошибка в регулярном выражении: %s', 'syntax error in regular expression: %s', 'синтаксична помилка в регулярному виразі: %s'], seUnexpChar: ['неожиданный символ: %s', 'unexpected character: %s', 'неочікуваний символ: %s'], seMissClBkt: ['пропущена закрывающая скобка', 'missing \')\' in expression', 'пропущено закривну дужку'], seRepsInParens: ['спелл #%s не должен располагаться в скобках', 'spell #%s shouldnʼt be inside parentheses', 'спелл #%s не може бути в дужках'], seOpInReps: ['недопустимо использовать оператор %s со спеллами #rep и #outrep', 'donʼt use operator %s with spells #rep & #outrep', 'неприпустимо використовувати оператор %s зі спеллами #rep и #outrep'], seRow: [' (строка ', ' (row ', ' (рядок '], seCol: [', столбец ', ', column ', ', стовпчик '], editInTxt: ['Правка в текстовом формате', 'Edit in text format', 'Правка в текстовому форматі'], editor: { cfg: ['Редактирование настроек', 'Edit settings', 'Редагування налаштувань'], hidden: ['Редактирование скрытых тредов', 'Edit hidden threads', 'Редагування схованих тредів'], favor: ['Редактирование избранного', 'Edit favorites', 'Редагування вибраного'], css: ['Редактирование CSS', 'Edit CSS', 'Редагування CSS'] }, fileImpExp: ['Импорт/экспорт настроек в файл', 'Import/export config to file', 'Імпорт/експорт налаштувань до файлу'], fileToData: ['Загрузить данные из файла', 'Load data from a file', 'Завантажити дані з файла'], dataToFile: ['Получить файл с данными', 'Get the file with data', 'Отримати файл з даними'], globalCfg: ['Глобальные настройки', 'Global config', 'Глобальні налаштування'], loadGlobal: ['и применить к этому домену', 'and apply to this domain', 'і застосувати до цього домену'], saveGlobal: ['текущие настройки как глобальные', 'current config as global', 'поточні налаштування як глобальні'], descrGlobal: ['Глобальные настройки применяются по умолчанию
при первом посещении других доменов', 'Global config is applied by default
on the first visit of other domains', 'Глобальні налаштування застосовуються по замовчуванню
під час першого відвідання інших доменів'], resetCfg: ['Сбросить в настройки по умолчанию', 'Reset config to defaults', 'Скинути в налаштування по замовчуванню'], resetData: ['Очистить выбранные данные', 'Reset selected data', 'Очистити обрані дані'], allDomains: ['для всех доменов', 'for all domains', 'для всіх доменів'], delEntries: ['Удалить выбранные записи', 'Delete selected entries', 'Видалити обрані записи'], saveChanges: ['Сохранить внесенные изменения', 'Save your changes', 'Зберегти внесені зміни'], hidPostThr: ['Скрытые посты и треды', 'Hidden posts and threads', 'Сховані дописи та треди'], myPosts: ['Мои посты', 'My posts', 'Мої дописи'], checkNow: ['Проверить сейчас', 'Check now', 'Перевірити зараз'], updAvail: ['Доступно обновление Dollchan: %s', 'Dollchan update available: %s!', 'Доступне оновлення Dollchan: %s'], newCommitsAvail: ['Обнаружены новые исправления: %s', 'New fixes detected: %s', 'Виявлено нові виправлення: %s'], changeLog: ['Список изменений', 'List of changes', 'Список змін'], haveLatestStable: ['Ваша версия %s является последней из стабильных.', 'Your %s version is the latest from stable versions.', 'Ваша версія %s є останньою зі стабільних.'], haveLatestCommit: ['Ваша версия %s содержит последние исправления.', 'Your %s version contains all the latest fixes.', 'Ваша версія %s містить всі останні виправлення.'], thrViewed: ['Тредов посещено', 'Threads visited', 'Тредів відвідано'], thrCreated: ['Тредов создано', 'Threads created', 'Тредів створено'], thrHidden: ['Тредов скрыто', 'Threads hidden', 'Тредів сховано'], postsSent: ['Постов отправлено', 'Posts sent', 'дописів надіслано'], total: ['Всего', 'Total', 'Всього'], debug: ['Отладка', 'Debug', 'Відлагодження'], infoDebug: ['Информация для отладки', 'Information for debugging', 'Інформація для відлагодження'], refreshCounters: ['Обновить счетчики постов', 'Refresh posts counters', 'Оновити лічильники дописів'], refreshClear404: ['Обновить счетчики и очистить недоступные (404) треды', 'Refresh counters and clear inaccessible (404) threads', 'Оновити лічильники та очистити недоступні (404) треди'], clear404: ['Очистить недоступные (404) треды', 'Clear inaccessible (404) threads', 'Очистити недоступні (404) треди'], infoPage: ['Проверить положение тредов (до 10-й страницы)', 'Check for threads position (up to 10th page)', 'Перевірити актуальність тредів (до 10 сторінки)'], totalPosts: ['Всего постов в треде', 'Total posts in thread', 'Всього дописів в треді'], newPosts: ['Количество новых постов', 'Number of new posts', 'Кількість нових дописів'], myPostsRep: ['Ответов на ваши посты', 'Replies to your posts', 'Відповідей на ваші дописи'], thrPage: ['На какой странице сейчас тред', 'What page is the thread on now', 'На якій сторінці зараз тред'], goToThread: ['Перейти к треду', 'Go to the thread', 'Перейти до треду'], goToBoard: ['Перейти к доске', 'Go to the board', 'Перейти до дошки'], toggleEntries: ['Скрыть/раскрыть записи', 'Hide/expand entries', 'Сховати/розкрити записи'], hideLnkList: ['Скрыть/Показать список ссылок', 'Hide/Unhide list of links', 'Сховати/показати перелік посилань'], expandVideo: ['Развернуть/Свернуть видео', 'Expand/Collapse video', 'Розгорнути/згорнути відео'], prevVideo: ['Предыдущее видео', 'Previous video', 'Попереднє відео'], nextVideo: ['Следующее видео', 'Next video', 'Наступне відео'], duration: ['Продолжительность: ', 'Duration: ', 'Тривалість: '], published: ['опубликовано: ', 'published: ', 'опубліковано: '], author: ['Автор: ', 'Author: ', 'Автор: '], views: ['просмотров: ', 'views: ', 'переглядів: '], dropFileHere: ['Бросьте сюда файл(ы) или ссылку', 'Drop file(s) or link here', 'Киньте сюди файл(и) чи посилання'], youCanDrag: ['Можно перетаскивать картинки и ссылки на файлы\r\nпрямо со страницы или других сайтов', 'You can drag images and file links\r\ndirectly from the page or other sites', 'Можна перетягувати зображення чи посилання на файли\r\nбезпосередньо зі сторінки чи інших сайтів'], removeFile: ['Удалить файл', 'Remove file', 'Видалити файл'], renameFile: ['Переименовать файл', 'Rename file', 'Перейменувати файл'], spoilFile: ['Спойлер', 'Spoiler', 'Спойлер'], addManually: ['Ввести ссылку на файл вручную', 'Enter a link to the file manually', 'Ввести посилання на файл вручну'], enterTheLink: ['Введите ссылку и нажмите \'+\'', 'Enter the link and click \'+\'', 'Введіть посилання та натисніть \'+\''], helpAddFile: ['Встроить ogg/rar/zip/7z в картинку', 'Embed ogg/rar/zip/7z into the image', 'Вбудувати ogg/rar/zip/7z в зображення'], expImgInline: ['[Click] открыть в посте, [Ctrl+Click] по центру', '[Click] expand in post, [Ctrl+Click] by center', '[Click] розгорнути в дописі, [Ctrl+Click] в центрі'], expImgFull: ['[Click] открыть по центру, [Ctrl+Click] в посте', '[Click] expand by center, [Ctrl+Click] in post', '[Click] розгорнути в центрі, [Ctrl+Click] в дописі'], nextImg: ['Следующая картинка', 'Next image', 'Наступне зображення'], prevImg: ['Предыдущая картинка', 'Previous image', 'Попереднє зображення'], rotateImg: ['Повернуть вправо', 'Rotate right', 'Повернути вправо'], autoPlayOn: ['Автоматически воспроизводить следующее видео', 'Automatically play the next video', 'Автоматично відтворювати наступне відео'], autoPlayOff: ['Отключить автовоспроизведение', 'Disable autoplay', 'Відключити автовідтворення'], downloadFile: ['Скачать содержащийся в картинке файл', 'Download embedded file from the image', 'Завантажити файл, що міститься в зображенні'], openOriginal: ['Открыть оригинал в новой вкладке', 'Open the original image in new tab', 'Відкрити оригінал в новій вкладці'], loadImage: ['Загружаются картинки', 'Loading images', 'Завантажуються зображення'], loadFile: ['Загружаются файлы', 'Loading files', 'Завантажуються файли'], cantLoad: ['Не могу загрузить', 'Canʼt load', 'Не можу завантажити'], willSavePview: ['Будет сохранено превью', 'Thumbnail will be saved', 'Буде збережено превʼю'], loadErrors: ['Во время загрузки произошли ошибки:', 'An error occurred during the loading:', 'Під час завантаження сталися помилки:'], succDeleted: ['Успешно удалено!', 'Succesfully deleted!', 'Успішно видалено!'], succReported: ['Жалоба успешно отправлена', 'Succesfully reported', 'Скарга успішно відправлена'], errDelete: ['Не могу удалить', 'Canʼt delete', 'Не можу видалити'], fileCorrupt: ['Файл повреждён', 'File is corrupt', 'Файл пошкоджено'], errCorruptData: ['Ошибка: сервер отправил повреждённые данные', 'Error: server sent corrupted data', 'Помилка: сервер надіслав пошкоджені дані'], noConnect: ['Ошибка подключения', 'Connection failed', 'Помилка зʼєднання'], thrNotFound: ['Тред недоступен', 'Thread is unavailable', 'Тред недоступний'], thrClosed: ['Тред закрыт', 'Thread is closed', 'Тред закрито'], thrArchived: ['Тред в архиве', 'Thread is archived', 'Тред заархівовано'], stormWallCheck: ['Проверка StormWall защиты от DDoS атак...', 'Checking for the StormWall DDoS protection...', 'Перевірка StormWall захисту від DDoS атак...'], stormWallErr: ['Пожалуйста, решите капчу StormWall защиты', 'Please resolve the StormWall protection captcha', 'Будь ласка, вирішіть капчу StormWall захисту'], internalError: ['Внутренняя ошибка:\n', 'Internal error:\n', 'Внутрішня помилка:\n'], postNotFound: ['Пост не найден', 'Post not found', 'Допис не знайдено'], noHidThr: ['Нет скрытых тредов…', 'No hidden threads…', 'Немає схованих дописів…'], noFavThr: ['Нет избранных тредов…', 'Favorites is empty…', 'Немає вибраних тредів…'], noVideoLinks: ['Нет ссылок на видео…', 'No video links…', 'Немає посилань на відео…'], invalidData: ['Некорректный формат данных', 'Incorrect data format', 'Некоректний формат даних'], noGlobalCfg: ['Глобальные настройки не найдены', 'Global config not found', 'Глобальні налаштування не знайдено'], subjHasTrip: ['Поле "Тема" содержит трипкод!', '"Subject" field contains a tripcode!', 'Поле "Тема" містить трипкод!'], errMsEdgeWebm: ['Загрузите скрипт для воспроизведения WebM (VP9/Opus)', 'Please load a script to play WebM (VP9/Opus)', 'Завантажте скрипт для відтворення WebM (VP9/Opus)'], errFormLoad: ['Не удаётся загрузить форму ответа', 'Canʼt load the reply form', 'Не вдалося завантажити форму відповіді'], second: ['с', 's', 'с'], sizeByte: [' Байт', ' Byte', ' Байт'], sizeKByte: [' КБ', ' KB', ' КБ'], sizeMByte: [' МБ', ' MB', ' МБ'], sizeGByte: [' ГБ', ' GB', ' ГБ'], name: ['Имя', 'Name', 'Імʼя'], subj: ['Тема', 'Subject', 'Тема'], mail: ['Почта', 'Email', 'Пошта'], video: ['Видео', 'Video', 'Відео'], cap: ['Капча', 'Captcha', 'Капча'], add: ['Добавить', 'Add', 'Додати'], apply: ['Применить', 'Apply', 'Застосувати'], cancel: ['Отмена', 'Cancel', 'Скасувати'], clear: ['Очистить', 'Clear', 'Очистити'], refresh: ['Обновить', 'Refresh', 'Оновити'], save: ['Сохранить', 'Save', 'Зберегти'], load: ['Загрузить', 'Load', 'Завантажити'], edit: ['Правка', 'Edit', 'Правка'], file: ['Файл', 'File', 'Файл'], global: ['Глобальные', 'Global', 'Глобальні'], reset: ['Сброс', 'Reset', 'Скинути'], remove: ['Удалить', 'Remove', 'Видалити'], change: ['Сменить', 'Change', 'Змінити'], page: ['Страница', 'Page', 'Сторінка'], reply: ['Ответ', 'Reply', 'Відповідь'], replies: ['Ответы:', 'Replies:', 'Відповіді:'], makeReply: ['Ответить', 'Reply', 'Відповісти'], error: ['Ошибка', 'Error', 'Помилка'], loading: ['Загрузка…', 'Loading…', 'Завантаження…'], sending: ['Отправка…', 'Sending…', 'Надсилання…'], checking: ['Проверка…', 'Checking…', 'Перевірка…'], updating: ['Обновление…', 'Updating…', 'Оновлення…'], deleting: ['Удаление…', 'Deleting…', 'Видалення…'], deleted: ['удалён', 'deleted', 'видалено'], hide: ['Скрыть: ', 'Hide: ', 'Сховати: '], hidePosts: ['Скрыть посты', 'Hide posts', 'Сховати дописи'], showPosts: ['Показать посты', 'Show posts', 'Показати дописи'], getNewPosts: ['Получить новые посты', 'Get new posts', 'Отримати нові дописи'], makeThr: ['Создать тред', 'Create thread', 'Створити тред'], collapseThr: ['Свернуть тред', 'Collapse thread', 'Згорнути тред'], hiddenThr: ['Скрытый тред', 'Hidden thread', 'Схований тред'], hideForm: ['Скрыть форму', 'Hide form', 'Сховати форму'], enableSage: ['Нажмите, чтобы включить сажу', 'Click to enable sage', 'Натисніть, щоб увімкнути сажу'], disableSage: ['САЖА включена! Нажмите, чтобы отключить', 'SAGE enabled! Click to disable', 'САЖА ввімкнена! Натисніть, щоб вимкнути'], postsOmitted: ['Пропущено ответов: ', 'Posts omitted: ', 'Пропущено відповідей: '], newPost: [['новый пост', 'новых поста', 'новых постов'], ['new post', 'new posts', 'new posts'], ['новий допис', 'нових дописи', 'нових дописів']], youReplies: [['ответ Вам', 'ответа Вам', 'ответов Вам'], ['reply to You', 'replies to You', 'replies to You'], ['відповідь Вам', 'відповіді Вам', 'відповідей Вам']], latestPost: ['Последний пост', 'Latest post', 'Останній допис'], donateMsg: ['Спасибо за использование Dollchan Extension!
Вы можете поддержать проект пожертвованием', 'Thank You for using Dollchan Extension!
You can support the project by donating', 'Дякуємо за використання Dollchan Extension!
Ви можете підтримати проект пожертвою'], donateOnline: ['Онлайн донат (грн)', 'Donate online (UAH)', 'Онлайн донат (грн)'], firefoxAddon: ['Firefox аддон доступен!', 'Firefox add-on is available!', 'Firefox аддон доступний!'] }; function $id(id) { return doc.getElementById(id); } function $q(path) { var rootEl = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : doc.body; return rootEl.querySelector(path); } function $Q(path) { var rootEl = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : doc.body; return rootEl.querySelectorAll(path); } function $match(parentStr) { for (var _len = arguments.length, rules = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { rules[_key - 1] = arguments[_key]; } return parentStr.split(', ').map(function (val) { return val + rules.join(', ' + val); }).join(', '); } function $bBegin(siblingEl, html) { siblingEl.insertAdjacentHTML('beforebegin', html); return siblingEl.previousSibling; } function $aBegin(parentEl, html) { parentEl.insertAdjacentHTML('afterbegin', html); return parentEl.firstChild; } function $bEnd(parentEl, html) { parentEl.insertAdjacentHTML('beforeend', html); return parentEl.lastChild; } function $aEnd(siblingEl, html) { siblingEl.insertAdjacentHTML('afterend', html); return siblingEl.nextSibling; } function $delAll(path) { var rootEl = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : doc.body; rootEl.querySelectorAll(path, rootEl).forEach(function (el) { return el.remove(); }); } function $add(html) { dummy.innerHTML = html; return dummy.firstElementChild; } function $button(value, title, fn) { var className = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'de-button'; var el = $add("")); el.addEventListener('click', fn); return el; } function $script(text) { try { var el = doc.createElement('script'); el.type = 'text/javascript'; el.textContent = text; doc.head.append(el); el.remove(); } catch (err) {} } function $css(text) { return $bEnd(doc.head, "")); } function $createDoc(html) { var myDoc = doc.implementation.createHTMLDocument(''); myDoc.documentElement.innerHTML = html; return myDoc; } function $show(el) { el.style.removeProperty('display'); } function $hide(el) { el.style.display = 'none'; } function $toggle(el) { var needToShow = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : el.style.display; if (needToShow) { el.style.removeProperty('display'); } else { el.style.display = 'none'; } } function $animate(el, cName) { var isRemove = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; el.addEventListener('animationend', function aEvent() { el.removeEventListener('animationend', aEvent); if (isRemove) { el.remove(); } else { el.classList.remove(cName); } }); el.classList.add(cName); } function $hasProp(obj, i) { return Object.prototype.hasOwnProperty.call(obj, i); } function $isEmpty(obj) { for (var i in obj) { if ($hasProp(obj, i)) { return false; } } return true; } function escapeRegExp(str) { return (str + '').replace(/([.?*+^$[\]\\(){}|-])/g, '\\$1'); } function strToRegExp(str, notGlobal) { var l = str.lastIndexOf('/'); var flags = str.substr(l + 1); return new RegExp(str.substr(1, l - 1), notGlobal ? flags.replace('g', '') : flags); } function pad2(i) { return i < 10 ? '0' + i : i; } function arrTags(arr, start, end) { return start + arr.join(end + start) + end; } function fixBoardName(board) { return "/".concat(board ? board + '/' : ''); } function getFileName(url) { return url.substring(url.lastIndexOf('/') + 1); } function getFileExt(url) { return url.substring(url.lastIndexOf('.') + 1); } function cutFileExt(fileName) { return fileName.substring(0, fileName.lastIndexOf('.')); } function prettifySize(val) { return val > 512 * 1024 * 1024 ? (val / Math.pow(1024, 3)).toFixed(2) + Lng.sizeGByte[lang] : val > 512 * 1024 ? (val / Math.pow(1024, 2)).toFixed(2) + Lng.sizeMByte[lang] : val > 512 ? (val / 1024).toFixed(2) + Lng.sizeKByte[lang] : val.toFixed(2) + Lng.sizeByte[lang]; } function insertText(el, txt) { var scrollTop = el.scrollTop, start = el.selectionStart, value = el.value; el.value = value.substr(0, start) + txt + value.substr(el.selectionEnd); el.setSelectionRange(start + txt.length, start + txt.length); el.focus(); el.scrollTop = scrollTop; } function getErrorMessage(err) { if (err instanceof AjaxError) { return err.toString(); } if (typeof err === 'string') { return err; } var stack = err.stack, name = err.name, message = err.message; return Lng.internalError[lang] + (!stack ? "".concat(name, ": ").concat(message) : nav.isWebkit ? stack : "".concat(name, ": ").concat(message, "\n").concat(!nav.isFirefox ? stack : stack.replace(/^([^@]*).*\/(.+)$/gm, function (str, fName, line) { return " at ".concat(fName ? "".concat(fName, " (").concat(line, ")") : line); }))); } function getCookies() { var obj = {}; var cookies = doc.cookie.split(';'); for (var i = 0, len = cookies.length; i < len; ++i) { var parts = cookies[i].split('='); obj[parts.shift().trim()] = decodeURI(parts.join('=')); } return obj; } function readFile(_x, _x2) { return _readFile.apply(this, arguments); } function _readFile() { _readFile = _asyncToGenerator( _regeneratorRuntime().mark(function _callee47(file, asText) { return _regeneratorRuntime().wrap(function _callee47$(_context55) { while (1) switch (_context55.prev = _context55.next) { case 0: return _context55.abrupt("return", new Promise(function (resolve) { var fr = new FileReader(); fr.onload = function (e) { return resolve({ data: e.target.result }); }; if (asText) { fr.readAsText(file); } else { fr.readAsArrayBuffer(file); } })); case 1: case "end": return _context55.stop(); } }, _callee47); })); return _readFile.apply(this, arguments); } function getFileMime(url) { var dotIdx = url.lastIndexOf('.') + 1; switch (dotIdx && url.substr(dotIdx).toLowerCase()) { case 'gif': return 'image/gif'; case 'jfif': case 'jpeg': case 'jpg': return 'image/jpeg'; case 'mov': return 'video/quicktime'; case 'mp4': case 'm4v': return 'video/mp4'; case 'ogv': return 'video/ogv'; case 'png': return 'image/png'; case 'webm': return 'video/webm'; case 'webp': return 'image/webp'; default: return ''; } } function downloadBlob(blob, name) { var url = nav.isMsEdge ? navigator.msSaveOrOpenBlob(blob, name) : deWindow.URL.createObjectURL(blob); var link = $bEnd(doc.body, "")); link.click(); setTimeout(function () { deWindow.URL.revokeObjectURL(url); link.remove(); }, 2e5); } var Logger = { finish: function finish() { this._finished = true; this._marks.push(['LoggerFinish', Date.now()]); }, getLogData: function getLogData(isFull) { var marks = this._marks; var timeLog = []; var duration; var i = 1; var lastExtra = 0; for (var len = marks.length - 1; i < len; ++i) { duration = marks[i][1] - marks[i - 1][1] + lastExtra; if (isFull || duration > 1) { lastExtra = 0; timeLog.push([marks[i][0], duration]); } else { lastExtra = duration; } } timeLog.push([Lng.total[lang], marks[i][1] - marks[0][1]]); return timeLog; }, initLogger: function initLogger() { this._marks.push(['LoggerInit', Date.now()]); }, log: function log(text) { if (!this._finished) { this._marks.push([text, Date.now()]); } }, _finished: false, _marks: [] }; function CancelError() {} var CancelablePromise = function () { function CancelablePromise(resolver, cancelFn) { var _this = this; _classCallCheck(this, CancelablePromise); this._promise = new Promise(function (resolve, reject) { _this._reject = reject; resolver(function (value) { resolve(value); _this._isResolved = true; }, function (reason) { reject(reason); _this._isResolved = true; }); }); this._cancelFn = cancelFn; this._isResolved = false; } _createClass(CancelablePromise, [{ key: "cancelPromise", value: function cancelPromise() { this._reject(new CancelError()); if (!this._isResolved && this._cancelFn) { this._cancelFn(); } } }, { key: "catch", value: function _catch(eb) { return this.then(undefined, eb); } }, { key: "then", value: function then(cb, eb) { var _this2 = this; var children = []; var wrap = function wrap(fn) { return function () { var child = fn.apply(void 0, arguments); if (child instanceof CancelablePromise) { children.push(child); } return child; }; }; return new CancelablePromise(function (resolve) { return resolve(_this2._promise.then(cb && wrap(cb), eb && wrap(eb))); }, function () { for (var _i = 0, _children = children; _i < _children.length; _i++) { var child = _children[_i]; child.cancelPromise(); } _this2.cancelPromise(); }); } }], [{ key: "reject", value: function reject(val) { return new CancelablePromise(function (res, rej) { return rej(val); }); } }, { key: "resolve", value: function resolve(val) { return new CancelablePromise(function (res) { return res(val); }); } }]); return CancelablePromise; }(); var Maybe = function () { function Maybe(Ctor ) { _classCallCheck(this, Maybe); this._ctor = Ctor; this.hasValue = false; } _createClass(Maybe, [{ key: "value", get: function get() { var Ctor = this._ctor; this.hasValue = !!Ctor; var value = Ctor ? new Ctor( ) : null; Object.defineProperty(this, 'value', { value: value }); return value; } }]); return Maybe; }(); var TemporaryContent = function () { function TemporaryContent(key) { _classCallCheck(this, TemporaryContent); var oClass = this.constructor; if (oClass.purgeTO) { clearTimeout(oClass.purgeTO); } oClass.purgeTO = setTimeout(function () { return oClass.purge(); }, oClass.purgeSecs); if (oClass.data) { var rv = oClass.data.get(key); if (rv) { return rv; } } else { oClass.data = new Map(); } oClass.data.set(key, this); } _createClass(TemporaryContent, null, [{ key: "get", value: function get(key) { return this.data ? this.data.get(key) : null; } }, { key: "has", value: function has(key) { return this.data ? this.data.has(key) : false; } }, { key: "purge", value: function purge() { if (this.purgeTO) { clearTimeout(this.purgeTO); this.purgeTO = null; } this.data = null; } }, { key: "removeTempData", value: function removeTempData(key) { if (this.data) { this.data["delete"](key); } } }]); return TemporaryContent; }(); TemporaryContent.purgeSecs = 6e4; var TasksPool = function () { function TasksPool(tasksCount, taskFunc, endFn) { _classCallCheck(this, TasksPool); this.array = []; this.running = 0; this.num = 1; this.func = taskFunc; this.endFn = endFn; this.max = tasksCount; this.completed = this.paused = this.stopped = false; } _createClass(TasksPool, [{ key: "completeTasks", value: function completeTasks() { if (!this.stopped) { if (!this.array.length && this.running === 0) { this.endFn(); } else { this.completed = true; } } } }, { key: "pauseTasks", value: function pauseTasks() { this.paused = true; } }, { key: "runTask", value: function runTask(data) { if (!this.stopped) { if (this.paused || this.running === this.max) { this.array.push(data); } else { this._runTask(data); this.running++; } } } }, { key: "stopTasks", value: function stopTasks() { this.stopped = true; this.endFn(); } }, { key: "_continueTasks", value: function _continueTasks() { if (!this.stopped) { this.paused = false; if (!this.array.length) { if (this.completed) { this.endFn(); } return; } while (this.array.length && this.running !== this.max) { this._runTask(this.array.shift()); this.running++; } } } }, { key: "_endTask", value: function _endTask() { if (!this.stopped) { if (!this.paused && this.array.length) { this._runTask(this.array.shift()); return; } this.running--; if (!this.paused && this.completed && this.running === 0) { this.endFn(); } } } }, { key: "_runTask", value: function _runTask(data) { var _this3 = this; this.func(this.num++, data).then(function () { return _this3._endTask(); }, function (err) { if (err instanceof TasksPool.PauseError) { _this3.pauseTasks(); if (err.duration !== -1) { setTimeout(function () { return _this3._continueTasks(); }, err.duration); } } else { _this3._endTask(); throw err; } }); } }]); return TasksPool; }(); TasksPool.PauseError = function (duration) { this.name = 'TasksPool.PauseError'; this.duration = duration; }; var WorkerPool = function () { function WorkerPool(mReqs, wrkFn, errFn) { var _this4 = this; _classCallCheck(this, WorkerPool); if (!nav.hasWorker) { this.runWorker = function (data, transferObjs, fn) { return fn(wrkFn(data)); }; return; } var url = deWindow.URL.createObjectURL(new Blob(["self.onmessage = function(e) {\n\t\t\tvar info = (".concat(String(wrkFn), ")(e.data);\n\t\t\tif(info.data) {\n\t\t\t\tself.postMessage(info, [info.data]);\n\t\t\t} else {\n\t\t\t\tself.postMessage(info);\n\t\t\t}\n\t\t}")], { type: 'text/javascript' })); this._pool = new TasksPool(mReqs, function (num, data) { return _this4._createWorker(num, data); }, null); this._freeWorkers = []; this._url = url; this._errFn = errFn; while (mReqs--) { this._freeWorkers.push(new Worker(url)); } } _createClass(WorkerPool, [{ key: "clearWorkers", value: function clearWorkers() { deWindow.URL.revokeObjectURL(this._url); this._freeWorkers.forEach(function (w) { return w.terminate(); }); this._freeWorkers = []; } }, { key: "runWorker", value: function runWorker(data, transferObjs, fn) { this._pool.runTask([data, transferObjs, fn]); } }, { key: "_createWorker", value: function _createWorker(num, data) { var _this5 = this; return new Promise(function (resolve) { var worker = _this5._freeWorkers.pop(); var _data2 = _slicedToArray(data, 3), sendData = _data2[0], transferObjs = _data2[1], fn = _data2[2]; worker.onmessage = function (e) { fn(e.data); _this5._freeWorkers.push(worker); resolve(); }; worker.onerror = function (err) { resolve(); _this5._freeWorkers.push(worker); _this5._errFn(err); }; worker.postMessage(sendData, transferObjs); }); } }]); return WorkerPool; }(); var TarBuilder = function () { function TarBuilder() { _classCallCheck(this, TarBuilder); this._data = []; } _createClass(TarBuilder, [{ key: "addFile", value: function addFile(filepath, input) { var i; var checksum = 0; var fileSize = input.length; var header = new Uint8Array(512); var nameLen = Math.min(filepath.length, 100); for (i = 0; i < nameLen; ++i) { header[i] = filepath.charCodeAt(i) & 0xFF; } TarBuilder._padSet(header, 100, '100777', 8); TarBuilder._padSet(header, 108, '0', 8); TarBuilder._padSet(header, 116, '0', 8); TarBuilder._padSet(header, 124, fileSize.toString(8), 13); TarBuilder._padSet(header, 136, Math.floor(Date.now() / 1e3).toString(8), 12); TarBuilder._padSet(header, 148, ' ', 8); header[156] = 0x30; for (i = 0; i < 157; ++i) { checksum += header[i]; } TarBuilder._padSet(header, 148, checksum.toString(8), 8); this._data.push(header, input); if ((i = Math.ceil(fileSize / 512) * 512 - fileSize) !== 0) { this._data.push(new Uint8Array(i)); } } }, { key: "addString", value: function addString(filepath, str) { var sDat = unescape(encodeURIComponent(str)); this.addFile(filepath, new Uint8Array(sDat.length).map(function (val, i) { return sDat.charCodeAt(i) & 0xFF; })); } }, { key: "get", value: function get() { this._data.push(new Uint8Array(1024)); return new Blob(this._data, { type: 'application/x-tar' }); } }], [{ key: "_padSet", value: function _padSet(data, offset, num, len) { var i = 0; var nLen = num.length; len -= 2; while (nLen < len) { data[offset++] = 0x20; len--; } while (i < nLen) { data[offset++] = num.charCodeAt(i++); } data[offset] = 0x20; } }]); return TarBuilder; }(); var WebmParser = function () { function WebmParser(data) { _classCallCheck(this, WebmParser); var offset = 0; var dv = nav.getUnsafeDataView(data); var len = dv.byteLength; var el = new WebmParser.Element(dv, len, 0); var voids = []; var EBMLId = 0x1A45DFA3; var segmentId = 0x18538067; var voidId = 0xEC; this.voidId = voidId; error: do { if (el.error || el.id !== EBMLId) { break; } this.EBML = el; offset += el.headSize + el.size; while (true) { var _el = new WebmParser.Element(dv, len, offset); if (_el.error) { break error; } if (_el.id === segmentId) { this.segment = _el; break; } else if (_el.id === voidId) { voids.push(_el); } else { break error; } offset += _el.headSize + _el.size; } this.voids = voids; this.data = data; this.length = len; this.rv = [null]; this.error = false; return; } while (false); this.error = true; } _createClass(WebmParser, [{ key: "addWebmData", value: function addWebmData(data) { if (this.error || !data) { return this; } var size = typeof data === 'string' ? data.length : data.byteLength; if (size > 127) { this.error = true; return; } this.rv.push(new Uint8Array([this.voidId, 0x80 | size]), data); return this; } }, { key: "getWebmData", value: function getWebmData() { if (this.error) { return null; } this.rv[0] = nav.getUnsafeUint8Array(this.data, 0, this.segment.endOffset); return this.rv; } }]); return WebmParser; }(); WebmParser.Element = function (elData, dataLength, offset) { this.error = false; this.id = 0; if (offset + 4 >= dataLength) { return; } var num = elData.getUint32(offset); var leadZeroes = Math.clz32(num); if (leadZeroes > 3) { this.error = true; return; } offset += leadZeroes + 1; if (offset >= dataLength) { this.error = true; return; } this.id = num >>> 8 * (3 - leadZeroes); this.headSize = leadZeroes + 1; num = elData.getUint32(offset); leadZeroes = Math.clz32(num); var size = num & 0xFFFFFFFF >>> leadZeroes + 1; if (leadZeroes > 3) { var shift = 8 * (7 - leadZeroes); if (size >>> shift !== 0 || offset + 4 > dataLength) { this.error = true; return; } size = size << 32 - shift | elData.getUint32(offset + 4) >>> shift; } else { size >>>= 8 * (3 - leadZeroes); } this.headSize += leadZeroes + 1; offset += leadZeroes + 1; if (offset + size > dataLength) { this.error = true; return; } this.data = elData; this.offset = offset; this.endOffset = offset + size; this.size = size; }; function getStored(_x3) { return _getStored.apply(this, arguments); } function _getStored() { _getStored = _asyncToGenerator( _regeneratorRuntime().mark(function _callee48(id) { var value; return _regeneratorRuntime().wrap(function _callee48$(_context56) { while (1) switch (_context56.prev = _context56.next) { case 0: if (!nav.hasNewGM) { _context56.next = 7; break; } _context56.next = 3; return GM.getValue(id); case 3: value = _context56.sent; return _context56.abrupt("return", value); case 7: if (!nav.hasOldGM) { _context56.next = 11; break; } return _context56.abrupt("return", GM_getValue(id)); case 11: if (!nav.hasWebStorage) { _context56.next = 15; break; } return _context56.abrupt("return", new Promise(function (resolve) { return chrome.storage.local.get(id, function (obj) { if (Object.keys(obj).length) { resolve(obj[id]); } else { chrome.storage.sync.get(id, function (obj) { return resolve(obj[id]); }); } }); })); case 15: if (!nav.hasPrestoStorage) { _context56.next = 17; break; } return _context56.abrupt("return", prestoStorage.getItem(id)); case 17: return _context56.abrupt("return", locStorage[id]); case 18: case "end": return _context56.stop(); } }, _callee48); })); return _getStored.apply(this, arguments); } function setStored(id, value) { if (nav.hasNewGM) { return GM.setValue(id, value); } else if (nav.hasOldGM) { GM_setValue(id, value); } else if (nav.hasWebStorage) { return new Promise(function (resolve) { var obj = {}; obj[id] = value; chrome.storage.sync.set(obj, function () { if (chrome.runtime.lastError) { chrome.storage.local.set(obj, Function.prototype); chrome.storage.sync.remove(id, Function.prototype); } else { chrome.storage.local.remove(id, Function.prototype); } resolve(); }); }); } else if (nav.hasPrestoStorage) { prestoStorage.setItem(id, value); } else { locStorage[id] = value; } return null; } function delStored(id) { if (nav.hasNewGM) { return GM.deleteValue(id); } else if (nav.hasOldGM) { GM_deleteValue(id); } else if (nav.hasWebStorage) { chrome.storage.sync.remove(id, Function.prototype); } else if (nav.hasPrestoStorage) { prestoStorage.removeItem(id); } else { locStorage.removeItem(id); } } function getStoredObj(_x4) { return _getStoredObj.apply(this, arguments); } function _getStoredObj() { _getStoredObj = _asyncToGenerator( _regeneratorRuntime().mark(function _callee49(id) { return _regeneratorRuntime().wrap(function _callee49$(_context57) { while (1) switch (_context57.prev = _context57.next) { case 0: _context57.t1 = JSON; _context57.next = 3; return getStored(id); case 3: _context57.t2 = _context57.sent; if (_context57.t2) { _context57.next = 6; break; } _context57.t2 = '{}'; case 6: _context57.t3 = _context57.t2; _context57.t0 = _context57.t1.parse.call(_context57.t1, _context57.t3); if (_context57.t0) { _context57.next = 10; break; } _context57.t0 = {}; case 10: return _context57.abrupt("return", _context57.t0); case 11: case "end": return _context57.stop(); } }, _callee49); })); return _getStoredObj.apply(this, arguments); } var CfgSaver = { save: function save() { var _arguments = arguments, _this6 = this; return _asyncToGenerator( _regeneratorRuntime().mark(function _callee() { var _len2, args, _key2, isChanged, i, id, val; return _regeneratorRuntime().wrap(function _callee$(_context) { while (1) switch (_context.prev = _context.next) { case 0: for (_len2 = _arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { args[_key2] = _arguments[_key2]; } isChanged = false; for (i = 0; i < args.length; i += 2) { id = args[i]; val = args[i + 1]; if (Cfg[id] !== val) { Cfg[id] = val; isChanged = true; } } if (!isChanged) { _context.next = 6; break; } _context.next = 6; return _this6.saveObj(aib.domain, function (loadedCfg) { for (var _i2 = 0; _i2 < args.length; _i2 += 2) { loadedCfg[args[_i2]] = args[_i2 + 1]; } return loadedCfg; }); case 6: case "end": return _context.stop(); } }, _callee); }))(); }, saveObj: function saveObj(domain, fn) { var _this7 = this; return _asyncToGenerator( _regeneratorRuntime().mark(function _callee2() { var _this7$_queue$splice, _this7$_queue$splice2, _this7$_queue$splice3, qDomain, qFn, resolve, reject; return _regeneratorRuntime().wrap(function _callee2$(_context2) { while (1) switch (_context2.prev = _context2.next) { case 0: if (!_this7._isBusy) { _context2.next = 4; break; } _context2.next = 3; return new Promise(function (resolve, reject) { _this7._queue.push([domain, fn, resolve, reject]); }); case 3: return _context2.abrupt("return"); case 4: _this7._isBusy = true; _context2.next = 7; return _this7.saveObjHelper(domain, fn); case 7: if (!(_this7._queue.length > 0)) { _context2.next = 21; break; } case 8: if (!(_this7._queue.length > 0)) { _context2.next = 21; break; } _this7$_queue$splice = _this7._queue.splice(0, 1), _this7$_queue$splice2 = _slicedToArray(_this7$_queue$splice, 1), _this7$_queue$splice3 = _slicedToArray(_this7$_queue$splice2[0], 4), qDomain = _this7$_queue$splice3[0], qFn = _this7$_queue$splice3[1], resolve = _this7$_queue$splice3[2], reject = _this7$_queue$splice3[3]; _context2.prev = 10; _context2.next = 13; return _this7.saveObjHelper(qDomain, qFn); case 13: resolve(); _context2.next = 19; break; case 16: _context2.prev = 16; _context2.t0 = _context2["catch"](10); reject(_context2.t0); case 19: _context2.next = 8; break; case 21: _this7._isBusy = false; case 22: case "end": return _context2.stop(); } }, _callee2, null, [[10, 16]]); }))(); }, saveObjHelper: function saveObjHelper(domain, fn) { return _asyncToGenerator( _regeneratorRuntime().mark(function _callee3() { var val, res, rv; return _regeneratorRuntime().wrap(function _callee3$(_context3) { while (1) switch (_context3.prev = _context3.next) { case 0: _context3.next = 2; return getStoredObj('DESU_Config'); case 2: val = _context3.sent; res = fn(val[domain]); if (res) { val[domain] = res; } else { delete val[domain]; } rv = setStored('DESU_Config', JSON.stringify(val)); if (!rv) { _context3.next = 9; break; } _context3.next = 9; return rv; case 9: case "end": return _context3.stop(); } }, _callee3); }))(); }, _isBusy: false, _queue: [] }; function toggleCfg(_x5) { return _toggleCfg.apply(this, arguments); } function _toggleCfg() { _toggleCfg = _asyncToGenerator( _regeneratorRuntime().mark(function _callee50(id) { return _regeneratorRuntime().wrap(function _callee50$(_context58) { while (1) switch (_context58.prev = _context58.next) { case 0: _context58.next = 2; return CfgSaver.save(id, +!Cfg[id]); case 2: case "end": return _context58.stop(); } }, _callee50); })); return _toggleCfg.apply(this, arguments); } function readCfg() { return _readCfg.apply(this, arguments); } function _readCfg() { _readCfg = _asyncToGenerator( _regeneratorRuntime().mark(function _callee51() { var obj, val, isGlobal, browserLang; return _regeneratorRuntime().wrap(function _callee51$(_context59) { while (1) switch (_context59.prev = _context59.next) { case 0: _context59.next = 2; return getStoredObj('DESU_Config'); case 2: val = _context59.sent; if (!(aib.domain in val) || $isEmpty(obj = val[aib.domain])) { isGlobal = nav.hasGlobalStorage && !!val.global; obj = isGlobal ? val.global : {}; if (isGlobal) { delete obj.correctTime; delete obj.captchaLang; } } defaultCfg.captchaLang = aib.captchaLang; browserLang = String(navigator.language).toLowerCase(); defaultCfg.language = browserLang.startsWith('ru') ? 0 : browserLang.startsWith('en') ? 1 : browserLang.startsWith('uk') ? 2 : defaultCfg.language; Cfg = Object.assign(Object.create(defaultCfg), obj); if (!Cfg.timeOffset) { Cfg.timeOffset = '+0'; } if (!Cfg.timePattern) { Cfg.timePattern = aib.timePattern; } if (!('FormData' in deWindow)) { Cfg.ajaxPosting = 0; } if (!Cfg.ajaxPosting) { Cfg.fileInputs = 0; } if (!('Notification' in deWindow)) { Cfg.desktNotif = 0; } if (nav.isPresto) { Cfg.preLoadImgs = 0; Cfg.findImgFile = 0; if (!nav.hasOldGM) { Cfg.updDollchan = 0; } Cfg.fileInputs = 0; } if (nav.scriptHandler === 'WebExtension') { Cfg.updDollchan = 0; } if (Cfg.updThrDelay < 10) { Cfg.updThrDelay = 10; } if (!Cfg.addSageBtn || !Cfg.saveSage) { Cfg.sageReply = 0; } if (!Cfg.passwValue) { Cfg.passwValue = Math.round(Math.random() * 1e12).toString(32); } if (!Cfg.stats) { Cfg.stats = { view: 0, op: 0, reply: 0 }; } lang = Cfg.language; val[aib.domain] = Cfg; if (val.commit !== commit && !localData) { if (doc.readyState === 'loading') { doc.addEventListener('DOMContentLoaded', function () { return setTimeout(showDonateMsg, 1e3); }); } else { setTimeout(showDonateMsg, 1e3); } val.commit = commit; } setStored('DESU_Config', JSON.stringify(val)); if (Cfg.updDollchan && !localData) { checkForUpdates(false, val.lastUpd).then(function (html) { if (doc.readyState === 'loading') { doc.addEventListener('DOMContentLoaded', function () { return $popup('updavail', html); }); } else { $popup('updavail', html); } }, Function.prototype); } case 24: case "end": return _context59.stop(); } }, _callee51); })); return _readCfg.apply(this, arguments); } function readPostsData(firstPost, favObj) { var _favObj$aib$host; var sVis = null; try { var str = aib.t ? sesStorage['de-hidden-' + aib.b + aib.t] : null; if (str) { var json = JSON.parse(str); if (json.hash === (Cfg.hideBySpell ? Spells.hash : 0) && pByNum.has(json.lastNum) && pByNum.get(json.lastNum).count === json.lastCount) { var _json$data; sVis = ((_json$data = json.data) === null || _json$data === void 0 ? void 0 : _json$data[0]) instanceof Array ? json.data : null; } } } catch (err) { sesStorage['de-hidden-' + aib.b + aib.t] = null; } if (!firstPost) { return; } var updatedFav = null; var favBoardObj = ((_favObj$aib$host = favObj[aib.host]) === null || _favObj$aib$host === void 0 ? void 0 : _favObj$aib$host[aib.b]) || {}; var spellsHide = Cfg.hideBySpell; var maybeSpells = new Maybe(SpellsRunner); for (var post = firstPost; post; post = post.next) { var _post2 = post, num = _post2.num; if (post.isOp && num in favBoardObj) { var newCount = 0; var youCount = 0; post.toggleFavBtn(true); var _post3 = post, thr = _post3.thr; thr.isFav = true; var isThrActive = aib.t && !doc.hidden; var entry = favBoardObj[num]; var _post = pByNum.get(+entry.last.match(/\d+/)); if (_post) { while (_post = _post.nextInThread) { if (Cfg.markNewPosts) { Post.addMark(_post.el, true); } if (!isThrActive) { newCount++; if (isPostRefToYou(_post.el)) { youCount++; } } } } else if (!aib.t) { newCount = entry["new"] + thr.postsCount - entry.cnt; _post = post; while (_post = _post.nextInThread) { if (Cfg.markNewPosts) { Post.addMark(_post.el, true); } if (isPostRefToYou(_post.el)) { youCount++; } } } if (isThrActive) { entry.last = aib.anchor + thr.last.num; } updatedFav = [aib.host, aib.b, aib.t, [entry.cnt = thr.postsCount, entry["new"] = newCount, entry.you = youCount, thr.last.num], 'update']; } if (HiddenPosts.has(num)) { HiddenPosts.hideHidden(post, num); continue; } var hideData = void 0; if (post.isOp) { if (HiddenThreads.has(num)) { hideData = [true, null]; } else if (spellsHide) { var _sVis; hideData = (_sVis = sVis) === null || _sVis === void 0 ? void 0 : _sVis[post.count]; } } else if (spellsHide) { var _sVis2; hideData = (_sVis2 = sVis) === null || _sVis2 === void 0 ? void 0 : _sVis2[post.count]; } else { continue; } if (!hideData) { maybeSpells.value.runSpells(post); } else if (hideData[0]) { if (post.isHidden) { post.spellHidden = true; } else { post.spellHide(hideData[1]); } } } if (maybeSpells.hasValue) { maybeSpells.value.endSpells(); } if (aib.t && Cfg.panelCounter === 2) { $id('de-panel-info-posts').textContent = Thread.first.postsCount - Thread.first.hiddenCount; } if (updatedFav) { saveFavorites(favObj); sendStorageEvent('__de-favorites', updatedFav); } var hasFavWinKey = sesStorage['de-fav-win'] === '1'; if (hasFavWinKey || Cfg.favWinOn) { toggleWindow('fav', !!$q('#de-win-fav.de-win-active'), null, true); if (hasFavWinKey) { sesStorage.removeItem('de-fav-win'); } } var data = sesStorage['de-fav-newthr']; if (data) { data = JSON.parse(data); var isTimeOut = !data.num && Date.now() - data.date > 2e4; if (data.num === firstPost.num || !firstPost.next && !isTimeOut) { firstPost.thr.toggleFavState(true); sesStorage.removeItem('de-fav-newthr'); } else if (isTimeOut) { sesStorage.removeItem('de-fav-newthr'); } } if (Cfg.nextPageThr && DelForm.first === DelForm.last) { var hidThrLen = $Q('.de-thr-hid', firstPost.thr.form.el).length; if (hidThrLen) { Pages.addPage(hidThrLen); } } } function readFavorites() { return getStoredObj('DESU_Favorites'); } function saveFavorites(data) { setStored('DESU_Favorites', JSON.stringify(data)); } function readViewedPosts() { if (!Cfg.markViewed) { return; } var data = sesStorage['de-viewed']; if (data) { data.split(',').forEach(function (pNum) { var post = pByNum.get(+pNum); if (post) { post.el.classList.add('de-viewed'); post.isViewed = true; } }); } } var PostsStorage = function () { function PostsStorage() { _classCallCheck(this, PostsStorage); this.storageName = ''; this.__cachedTime = null; this._cachedStorage = null; this._cacheTO = null; this._onReadNew = null; this._onAfterSave = null; } _createClass(PostsStorage, [{ key: "get", value: function get(num) { var storage = this._readStorage()[aib.b]; if (storage) { var val = storage[num]; return val ? val[2] : null; } return null; } }, { key: "has", value: function has(num) { var storage = this._readStorage()[aib.b]; return storage ? $hasProp(storage, num) : false; } }, { key: "purge", value: function purge() { this._cacheTO = this.__cachedTime = this._cachedStorage = null; } }, { key: "removeStorage", value: function removeStorage(num) { var board = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : aib.b; var storage = this._readStorage(true); var bStorage = storage[board]; if (bStorage && $hasProp(bStorage, num)) { delete bStorage[num]; if ($isEmpty(bStorage)) { delete storage[board]; } this._saveStorage(); } } }, { key: "set", value: function set(num, thrNum) { var data = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; var storage = this._readStorage(true); this._removeOldItems(storage); (storage[aib.b] || (storage[aib.b] = {}))[num] = [this._cachedTime, thrNum, data]; this._saveStorage(); } }, { key: "_removeOldItems", value: function _removeOldItems(storage) { if (storage && storage.$count > 5e3) { var minDate = Date.now() - 5 * 24 * 3600 * 1e3; for (var board in storage) { if ($hasProp(storage, board)) { var data = storage[board]; for (var key in data) { if ($hasProp(data, key) && data[key][0] < minDate) { delete data[key]; } } } } } } }, { key: "_cachedTime", get: function get() { return this.__cachedTime || (this.__cachedTime = Date.now()); } }, { key: "_readStorage", value: function _readStorage() { var ignoreCache = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; if (!ignoreCache && this._cachedStorage) { return this._cachedStorage; } var data = locStorage[this.storageName]; var rv = {}; if (data) { try { rv = this._cachedStorage = JSON.parse(data); } catch (err) {} } this._cachedStorage = rv; if (this._onReadNew) { this._onReadNew(rv); } return rv; } }, { key: "_saveStorage", value: function _saveStorage() { var _this8 = this; if (this._cacheTO === null) { this._cacheTO = setTimeout(function () { if (_this8._cachedStorage) { locStorage[_this8.storageName] = JSON.stringify(_this8._cachedStorage); } _this8.purge(); if (_this8._onAfterSave) { _this8._onAfterSave(); } }, 0); } } }]); return PostsStorage; }(); var HiddenPosts = new ( function (_PostsStorage) { _inherits(HiddenPostsClass, _PostsStorage); var _super = _createSuper(HiddenPostsClass); function HiddenPostsClass() { var _this9; _classCallCheck(this, HiddenPostsClass); _this9 = _super.call(this); _this9.storageName = 'de-posts'; return _this9; } _createClass(HiddenPostsClass, [{ key: "hideHidden", value: function hideHidden(post, num) { var uHideData = HiddenPosts.get(num); if (!uHideData && post.isOp && HiddenThreads.has(num)) { post.setUserVisib(true); } else { post.setUserVisib(!!uHideData, false); } } }]); return HiddenPostsClass; }(PostsStorage))(); var HiddenThreads = new ( function (_PostsStorage2) { _inherits(HiddenThreadsClass, _PostsStorage2); var _super2 = _createSuper(HiddenThreadsClass); function HiddenThreadsClass() { var _this10; _classCallCheck(this, HiddenThreadsClass); _this10 = _super2.call(this); _this10.storageName = 'de-threads'; return _this10; } _createClass(HiddenThreadsClass, [{ key: "getCount", value: function getCount() { var storage = this._readStorage(); var rv = 0; for (var board in storage) { if ($hasProp(storage, board)) { rv += Object.keys(storage[board]).length; } } return rv; } }, { key: "getRawData", value: function getRawData() { return this._readStorage(); } }, { key: "saveRawData", value: function saveRawData(data) { locStorage[this.storageName] = JSON.stringify(data); this.purge(); } }]); return HiddenThreadsClass; }(PostsStorage))(); var MyPosts = new ( function (_PostsStorage3) { _inherits(MyPostsClass, _PostsStorage3); var _super3 = _createSuper(MyPostsClass); function MyPostsClass() { var _this11; _classCallCheck(this, MyPostsClass); _this11 = _super3.call(this); _this11.storageName = 'de-myposts'; _this11._cachedData = null; _this11._onReadNew = function (newStorage) { _this11._cachedData = newStorage[aib.b] ? new Set(Object.keys(newStorage[aib.b]).map(function (val) { return +val; })) : new Set(); }; _this11._onAfterSave = function () { return sendStorageEvent('__de-mypost', 1); }; return _this11; } _createClass(MyPostsClass, [{ key: "has", value: function has(num) { return this._cachedData.has(num); } }, { key: "update", value: function update() { this.purge(); for (var _iterator = _createForOfIteratorHelperLoose(this._cachedData), _step; !(_step = _iterator()).done;) { var _pByNum$num; var num = _step.value; (_pByNum$num = pByNum[num]) === null || _pByNum$num === void 0 || _pByNum$num.changeMyMark(true); } } }, { key: "purge", value: function purge() { _get(_getPrototypeOf(MyPostsClass.prototype), "purge", this).call(this); this._cachedData = null; this._readStorage(); } }, { key: "readStorage", value: function readStorage() { this._readStorage(); } }, { key: "set", value: function set(num, thrNum) { _get(_getPrototypeOf(MyPostsClass.prototype), "set", this).call(this, num, thrNum); this._cachedData.add(+num); } }]); return MyPostsClass; }(PostsStorage))(); function sendStorageEvent(name, value) { locStorage[name] = typeof value === 'string' ? value : JSON.stringify(value); locStorage.removeItem(name); } function initStorageEvent() { doc.defaultView.addEventListener('storage', function (e) { var data, temp; var val = e.newValue; if (!val) { return; } switch (e.key) { case '__de-favorites': { try { data = JSON.parse(val); } catch (err) { return; } updateFavWindow.apply(void 0, _toConsumableArray(data)); return; } case '__de-mypost': MyPosts.update(); return; case '__de-webmvolume': val = +val || 0; Cfg.webmVolume = val; temp = $q('input[info="webmVolume"]'); if (temp) { temp.value = val; } return; case '__de-post': (function () { try { data = JSON.parse(val); } catch (err) { return; } HiddenThreads.purge(); HiddenPosts.purge(); if (data.brd === aib.b) { var post = pByNum.get(data.num); if (post && post.isHidden ^ data.hide) { post.setUserVisib(data.hide, false); } else if (post = pByNum.get(data.thrNum)) { post.thr.userTouched.set(data.num, data.hide); } } toggleWindow('hid', true); })(); return; case 'de-threads': HiddenThreads.purge(); Thread.first.updateHidden(HiddenThreads.getRawData()[aib.b]); toggleWindow('hid', true); return; case '__de-spells': _asyncToGenerator( _regeneratorRuntime().mark(function _callee4() { return _regeneratorRuntime().wrap(function _callee4$(_context4) { while (1) switch (_context4.prev = _context4.next) { case 0: _context4.prev = 0; data = JSON.parse(val); _context4.next = 7; break; case 4: _context4.prev = 4; _context4.t0 = _context4["catch"](0); return _context4.abrupt("return"); case 7: Cfg.hideBySpell = +data.hide; temp = $q('input[info="hideBySpell"]'); if (temp) { temp.checked = data.hide; } $hide(doc.body); if (!data.data) { _context4.next = 19; break; } _context4.next = 14; return Spells.setSpells(data.data, false); case 14: Cfg.spells = JSON.stringify(data.data); temp = $id('de-spell-txt'); if (temp) { temp.value = Spells.list; } _context4.next = 24; break; case 19: SpellsRunner.unhideAll(); _context4.next = 22; return Spells.disableSpells(); case 22: temp = $id('de-spell-txt'); if (temp) { temp.value = ''; } case 24: $show(doc.body); case 25: case "end": return _context4.stop(); } }, _callee4, null, [[0, 4]]); }))(); } }, false); } var Panel = Object.create({ isVidEnabled: false, initPanel: function initPanel(formEl) { var _postform, _this12 = this; var filesCount = $Q(aib.qPostImg, formEl).length; var isThr = aib.t; (((_postform = postform) === null || _postform === void 0 ? void 0 : _postform.pArea[0]) || formEl).insertAdjacentHTML('beforebegin', "
\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t\t").concat(Cfg.disabled ? '' : '

', "\n\t\t
")); this._el = $id('de-panel'); this._el.addEventListener('click', this, true); ['mouseover', 'mouseout'].forEach(function (e) { return _this12._el.addEventListener(e, _this12); }); this._buttons = $id('de-panel-buttons'); }, removeMain: function removeMain() { var _this13 = this; this._el.removeEventListener('click', this, true); ['mouseover', 'mouseout'].forEach(function (e) { return _this13._el.removeEventListener(e, _this13); }); delete this._postsCountEl; delete this._filesCountEl; delete this._postersCountEl; $id('de-main').remove(); }, handleEvent: function handleEvent(e) { var _this14 = this; return _asyncToGenerator( _regeneratorRuntime().mark(function _callee5() { var _$q, _$q2, _this14$_menu; var el, post, _iterator2, _step2, _el2; return _regeneratorRuntime().wrap(function _callee5$(_context5) { while (1) switch (_context5.prev = _context5.next) { case 0: if (!('isTrusted' in e && !e.isTrusted)) { _context5.next = 2; break; } return _context5.abrupt("return"); case 2: el = nav.fixEventEl(e.target); el = el.tagName.toLowerCase() === 'svg' ? el.parentNode : el; _context5.t0 = e.type; _context5.next = _context5.t0 === 'click' ? 7 : _context5.t0 === 'mouseover' ? 57 : 81; break; case 7: if (!(el.tagName.toLowerCase() === 'a')) { _context5.next = 9; break; } return _context5.abrupt("return"); case 9: e.preventDefault(); _context5.t1 = el.id; _context5.next = _context5.t1 === 'de-panel-logo' ? 13 : _context5.t1 === 'de-panel-cfg' ? 17 : _context5.t1 === 'de-panel-hid' ? 19 : _context5.t1 === 'de-panel-fav' ? 21 : _context5.t1 === 'de-panel-vid' ? 23 : _context5.t1 === 'de-panel-refresh' ? 26 : _context5.t1 === 'de-panel-goup' ? 28 : _context5.t1 === 'de-panel-godown' ? 30 : _context5.t1 === 'de-panel-expimg' ? 32 : _context5.t1 === 'de-panel-preimg' ? 37 : _context5.t1 === 'de-panel-maskimg' ? 41 : _context5.t1 === 'de-panel-upd-on' ? 46 : _context5.t1 === 'de-panel-upd-warn' ? 46 : _context5.t1 === 'de-panel-upd-off' ? 46 : _context5.t1 === 'de-panel-audio-on' ? 48 : _context5.t1 === 'de-panel-audio-off' ? 48 : _context5.t1 === 'de-panel-savethr' ? 51 : _context5.t1 === 'de-panel-enable' ? 52 : 56; break; case 13: if (Cfg.expandPanel && !$q('.de-win-active')) { $hide(_this14._buttons); } _context5.next = 16; return toggleCfg('expandPanel'); case 16: return _context5.abrupt("return"); case 17: toggleWindow('cfg', false); return _context5.abrupt("return"); case 19: toggleWindow('hid', false); return _context5.abrupt("return"); case 21: toggleWindow('fav', false); return _context5.abrupt("return"); case 23: _this14.isVidEnabled = !_this14.isVidEnabled; toggleWindow('vid', false); return _context5.abrupt("return"); case 26: deWindow.location.reload(); return _context5.abrupt("return"); case 28: scrollTo(0, 0); return _context5.abrupt("return"); case 30: scrollTo(0, doc.body.scrollHeight || doc.body.offsetHeight); return _context5.abrupt("return"); case 32: el.classList.toggle('de-panel-button-active'); isExpImg = !isExpImg; (_$q = $q('.de-fullimg-center')) === null || _$q === void 0 || _$q.remove(); for (post = Thread.first.op; post; post = post.next) { post.toggleImages(isExpImg, false); } return _context5.abrupt("return"); case 37: el.classList.toggle('de-panel-button-active'); isPreImg = !isPreImg; if (!e.ctrlKey) { for (_iterator2 = _createForOfIteratorHelperLoose(DelForm); !(_step2 = _iterator2()).done;) { _el2 = _step2.value.el; ContentLoader.preloadImages(_el2); } } return _context5.abrupt("return"); case 41: el.classList.toggle('de-panel-button-active'); _context5.next = 44; return toggleCfg('maskImgs'); case 44: updateCSS(); return _context5.abrupt("return"); case 46: updater.toggle(); return _context5.abrupt("return"); case 48: if (updater.toggleAudio(0)) { updater.enableUpdater(); el.id = 'de-panel-audio-on'; } else { el.id = 'de-panel-audio-off'; } (_$q2 = $q('.de-menu')) === null || _$q2 === void 0 || _$q2.remove(); return _context5.abrupt("return"); case 51: return _context5.abrupt("return"); case 52: _context5.next = 54; return toggleCfg('disabled'); case 54: deWindow.location.reload(); return _context5.abrupt("return"); case 56: return _context5.abrupt("return"); case 57: if (!Cfg.expandPanel) { clearTimeout(_this14._hideTO); $show(_this14._buttons); } _context5.t2 = el.id; _context5.next = _context5.t2 === 'de-panel-cfg' ? 61 : _context5.t2 === 'de-panel-hid' ? 63 : _context5.t2 === 'de-panel-fav' ? 65 : _context5.t2 === 'de-panel-vid' ? 67 : _context5.t2 === 'de-panel-goback' ? 69 : _context5.t2 === 'de-panel-gonext' ? 71 : _context5.t2 === 'de-panel-maskimg' ? 73 : _context5.t2 === 'de-panel-refresh' ? 75 : _context5.t2 === 'de-panel-savethr' ? 77 : _context5.t2 === 'de-panel-audio-off' ? 77 : 80; break; case 61: KeyEditListener.setTitle(el, 10); return _context5.abrupt("break", 80); case 63: KeyEditListener.setTitle(el, 7); return _context5.abrupt("break", 80); case 65: KeyEditListener.setTitle(el, 6); return _context5.abrupt("break", 80); case 67: KeyEditListener.setTitle(el, 18); return _context5.abrupt("break", 80); case 69: KeyEditListener.setTitle(el, 4); return _context5.abrupt("break", 80); case 71: KeyEditListener.setTitle(el, 17); return _context5.abrupt("break", 80); case 73: KeyEditListener.setTitle(el, 9); return _context5.abrupt("break", 80); case 75: if (!aib.t) { _context5.next = 77; break; } return _context5.abrupt("return"); case 77: if (!(((_this14$_menu = _this14._menu) === null || _this14$_menu === void 0 ? void 0 : _this14$_menu.parentEl) === el)) { _context5.next = 79; break; } return _context5.abrupt("return"); case 79: _this14._menuTO = setTimeout(function () { _this14._menu = addMenu(el); _this14._menu.onover = function () { return clearTimeout(_this14._hideTO); }; _this14._menu.onout = function () { return _this14._prepareToHide(null); }; _this14._menu.onremove = function () { return _this14._menu = null; }; }, Cfg.linksOver); case 80: return _context5.abrupt("return"); case 81: _this14._prepareToHide(nav.fixEventEl(e.relatedTarget)); switch (el.id) { case 'de-panel-refresh': case 'de-panel-savethr': case 'de-panel-audio-off': clearTimeout(_this14._menuTO); _this14._menuTO = 0; } case 83: case "end": return _context5.stop(); } }, _callee5); }))(); }, updateCounter: function updateCounter(postCount, filesCount, postersCount) { this._postsCountEl.textContent = postCount; this._filesCountEl.textContent = filesCount; this._postersCountEl.textContent = postersCount; if (aib.makaba) { $Q('span[title="Всего постов в треде"]').forEach(function (el) { return el.innerHTML = el.innerHTML.replace(/\d+$/, postCount); }); $Q('span[title="Всего файлов в треде"]').forEach(function (el) { return el.innerHTML = el.innerHTML.replace(/\d+$/, filesCount); }); $Q('span[title="Постеры"]').forEach(function (el) { return el.innerHTML = el.innerHTML.replace(/\d+$/, postersCount); }); } }, _el: null, _hideTO: 0, _menu: null, _menuTO: 0, get _filesCountEl() { var value = $id('de-panel-info-files'); Object.defineProperty(this, '_filesCountEl', { value: value, configurable: true }); return value; }, get _postersCountEl() { var value = $id('de-panel-info-posters'); Object.defineProperty(this, '_postersCountEl', { value: value, configurable: true }); return value; }, get _postsCountEl() { var value = $id('de-panel-info-posts'); Object.defineProperty(this, '_postsCountEl', { value: value, configurable: true }); return value; }, _getButton: function _getButton(id) { var page, href, title, useId; var tag = 'button'; switch (id) { case 'goback': tag = 'a'; page = Math.max(aib.page - 1, 0); href = aib.getPageUrl(aib.b, page); if (!aib.t) { title = Lng.panelBtn.gonext[lang].replace('%s', page); } useId = 'arrow'; break; case 'gonext': tag = 'a'; page = aib.page + 1; href = aib.getPageUrl(aib.b, page); title = Lng.panelBtn.gonext[lang].replace('%s', page); case 'goup': case 'godown': useId = 'arrow'; break; case 'upd-on': case 'upd-off': useId = 'upd'; break; case 'catalog': tag = 'a'; href = aib.catalogUrl; } return "<".concat(tag, " id=\"de-panel-").concat(id, "\" class=\"de-abtn de-panel-button\"\n\t\t\ttitle=\"").concat(title || Lng.panelBtn[id][lang], "\" ").concat(href ? 'href="' + href + '"' : '', ">\n\t\t\t\n\t\t\t").concat(id !== 'audio-off' ? "\n\t\t\t\t") : "\n\t\t\t\t\n\t\t\t\t", "\n\t\t\t\n\t\t"); }, _prepareToHide: function _prepareToHide(rt) { var _this15 = this; if (!Cfg.expandPanel && !$q('.de-win-active') && (!rt || !this._el.contains(rt.farthestViewportElement || rt))) { this._hideTO = setTimeout(function () { return $hide(_this15._buttons); }, 500); } } }); function updateWinZ(winEl) { var style = winEl.style; if (style.zIndex < topWinZ) { style.zIndex = ++topWinZ; } } function makeDraggable(name, winEl, headEl) { headEl.addEventListener('mousedown', { _oldX: 0, _oldY: 0, _win: winEl, _wStyle: winEl.style, _X: 0, _Y: 0, _Z: 0, handleEvent: function handleEvent(e) { var _this16 = this; return _asyncToGenerator( _regeneratorRuntime().mark(function _callee6() { var curX, curY, maxX, maxY, cr, x, y, width; return _regeneratorRuntime().wrap(function _callee6$(_context6) { while (1) switch (_context6.prev = _context6.next) { case 0: if (Cfg[name + 'WinDrag']) { _context6.next = 2; break; } return _context6.abrupt("return"); case 2: curX = e.clientX, curY = e.clientY; _context6.t0 = e.type; _context6.next = _context6.t0 === 'mousedown' ? 6 : _context6.t0 === 'mousemove' ? 14 : _context6.t0 === 'mouseleave' ? 26 : _context6.t0 === 'mouseup' ? 26 : 29; break; case 6: _this16._oldX = curX; _this16._oldY = curY; _this16._X = Cfg[name + 'WinX']; _this16._Y = Cfg[name + 'WinY']; if (_this16._Z < topWinZ) { _this16._Z = _this16._wStyle.zIndex = ++topWinZ; } ['mouseleave', 'mousemove', 'mouseup'].forEach(function (e) { return doc.body.addEventListener(e, _this16); }); e.preventDefault(); return _context6.abrupt("return"); case 14: maxX = Post.sizing.wWidth - _this16._win.offsetWidth; maxY = Post.sizing.wHeight - _this16._win.offsetHeight - 25; cr = _this16._win.getBoundingClientRect(); x = cr.left + curX - _this16._oldX; y = cr.top + curY - _this16._oldY; _this16._X = x >= maxX || curX > _this16._oldX && x > maxX - 20 ? 'right: 0' : x < 0 || curX < _this16._oldX && x < 20 ? 'left: 0' : "left: ".concat(x, "px"); _this16._Y = y >= maxY || curY > _this16._oldY && y > maxY - 20 ? 'bottom: 25px' : y < 0 || curY < _this16._oldY && y < 20 ? 'top: 0' : "top: ".concat(y, "px"); width = _this16._wStyle.width; _this16._win.setAttribute('style', "".concat(_this16._X, "; ").concat(_this16._Y, "; z-index: ").concat(_this16._Z).concat(width ? '; width: ' + width : '')); _this16._oldX = curX; _this16._oldY = curY; return _context6.abrupt("return"); case 26: ['mouseleave', 'mousemove', 'mouseup'].forEach(function (e) { return doc.body.removeEventListener(e, _this16); }); _context6.next = 29; return CfgSaver.save(name + 'WinX', _this16._X, name + 'WinY', _this16._Y); case 29: case "end": return _context6.stop(); } }, _callee6); }))(); } }); } var WinResizer = function () { function WinResizer(name, direction, cfgName, winEl, targetEl) { _classCallCheck(this, WinResizer); this.name = name; this.direction = direction; this.cfgName = cfgName; this.vertical = direction === 'top' || direction === 'bottom'; this.winEl = winEl; this.wStyle = this.winEl.style; this.tStyle = targetEl.style; $q('.de-resizer-' + direction, winEl).addEventListener('mousedown', this); } _createClass(WinResizer, [{ key: "handleEvent", value: function () { var _handleEvent = _asyncToGenerator( _regeneratorRuntime().mark(function _callee7(e) { var _this17 = this; var val, x, y, _Post$sizing, maxX, maxY, width, cr, z; return _regeneratorRuntime().wrap(function _callee7$(_context7) { while (1) switch (_context7.prev = _context7.next) { case 0: _Post$sizing = Post.sizing, maxX = _Post$sizing.wWidth, maxY = _Post$sizing.wHeight; width = this.wStyle.width; cr = this.winEl.getBoundingClientRect(); z = "; z-index: ".concat(this.wStyle.zIndex).concat(width ? '; width:' + width : ''); _context7.t0 = e.type; _context7.next = _context7.t0 === 'mousedown' ? 7 : _context7.t0 === 'mousemove' ? 22 : 24; break; case 7: if (this.winEl.classList.contains('de-win-fixed')) { x = 'right: 0'; y = 'bottom: 25px'; } else { x = Cfg[this.name + 'WinX']; y = Cfg[this.name + 'WinY']; } _context7.t1 = this.direction; _context7.next = _context7.t1 === 'top' ? 11 : _context7.t1 === 'bottom' ? 13 : _context7.t1 === 'left' ? 15 : _context7.t1 === 'right' ? 17 : 18; break; case 11: val = "".concat(x, "; bottom: ").concat(maxY - cr.bottom, "px").concat(z); return _context7.abrupt("break", 18); case 13: val = "".concat(x, "; top: ").concat(cr.top, "px").concat(z); return _context7.abrupt("break", 18); case 15: val = "right: ".concat(maxX - cr.right, "px; ").concat(y + z); return _context7.abrupt("break", 18); case 17: val = "left: ".concat(cr.left, "px; ").concat(y + z); case 18: this.winEl.setAttribute('style', val); ['mousemove', 'mouseup'].forEach(function (e) { return doc.body.addEventListener(e, _this17); }); e.preventDefault(); return _context7.abrupt("return"); case 22: if (this.vertical) { val = e.clientY; this.tStyle.setProperty('height', Math.max(parseInt(this.tStyle.height, 10) + (this.direction === 'top' ? cr.top - (val < 20 ? 0 : val) : (val > maxY - 45 ? maxY - 25 : val) - cr.bottom), 90) + 'px', 'important'); } else { val = e.clientX; this.tStyle.setProperty('width', Math.max(parseInt(this.tStyle.width, 10) + (this.direction === 'left' ? cr.left - (val < 20 ? 0 : val) : (val > maxX - 20 ? maxX : val) - cr.right), this.name === 'reply' ? 275 : 400) + 'px', 'important'); } return _context7.abrupt("return"); case 24: ['mousemove', 'mouseup'].forEach(function (e) { return doc.body.removeEventListener(e, _this17); }); _context7.next = 27; return CfgSaver.save(this.cfgName, parseInt(this.vertical ? this.tStyle.height : this.tStyle.width, 10)); case 27: if (!this.winEl.classList.contains('de-win-fixed')) { _context7.next = 30; break; } this.winEl.setAttribute('style', 'right: 0; bottom: 25px' + z); return _context7.abrupt("return"); case 30: if (!this.vertical) { _context7.next = 35; break; } _context7.next = 33; return CfgSaver.save(this.name + 'WinY', cr.top < 1 ? 'top: 0' : cr.bottom > maxY - 26 ? 'bottom: 25px' : "top: ".concat(cr.top, "px")); case 33: _context7.next = 37; break; case 35: _context7.next = 37; return CfgSaver.save(this.name + 'WinX', cr.left < 1 ? 'left: 0' : cr.right > maxX - 1 ? 'right: 0' : "left: ".concat(cr.left, "px")); case 37: this.winEl.setAttribute('style', Cfg[this.name + 'WinX'] + '; ' + Cfg[this.name + 'WinY'] + z); case 38: case "end": return _context7.stop(); } }, _callee7, this); })); function handleEvent(_x6) { return _handleEvent.apply(this, arguments); } return handleEvent; }() }]); return WinResizer; }(); function toggleWindow(name, isUpdate, data, noAnim) { var _winEl; var el; var winEl = $id('de-win-' + name); var isActive = (_winEl = winEl) === null || _winEl === void 0 ? void 0 : _winEl.classList.contains('de-win-active'); if (isUpdate && !isActive) { return; } if (!winEl) { var winAttr = (Cfg[name + 'WinDrag'] ? "de-win\" style=\"".concat(Cfg[name + 'WinX'], "; ").concat(Cfg[name + 'WinY']) : 'de-win-fixed" style="right: 0; bottom: 25px') + (name !== 'fav' ? '' : "; width: ".concat(Cfg.favWinWidth, "px; ")); winEl = $aBegin($id('de-main'), "
\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\t").concat(name === 'cfg' ? 'Dollchan Extension Tools' : Lng.panelBtn[name][lang], "\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t
\n\t\t\t
\n\t\t\t").concat(name !== 'fav' ? '' : "\n\t\t\t\t
\n\t\t\t\t
", "\n\t\t
")); var _winBody = $q('.de-win-body', winEl); if (name === 'cfg') { _winBody.className = 'de-win-body ' + aib.cReply; } else { setTimeout(function () { var backColor = getComputedStyle(doc.body).getPropertyValue('background-color'); _winBody.style.backgroundColor = backColor !== 'transparent' ? backColor : '#EEE'; }, 100); } if (name === 'fav') { new WinResizer('fav', 'left', 'favWinWidth', winEl, winEl); new WinResizer('fav', 'right', 'favWinWidth', winEl, winEl); } el = $q('.de-win-buttons', winEl); el.onmouseover = function (e) { var el = nav.fixEventEl(e.target); var parent = el.parentNode; switch (el.classList[0]) { case 'de-win-btn-close': parent.title = Lng.closeWindow[lang]; break; case 'de-win-btn-toggle': parent.title = Cfg[name + 'WinDrag'] ? Lng.toPanel[lang] : Lng.makeDrag[lang]; } }; el.lastElementChild.onclick = function () { return toggleWindow(name, false); }; $q('.de-win-btn-toggle', el).onclick = _asyncToGenerator( _regeneratorRuntime().mark(function _callee8() { var isDrag, temp, width; return _regeneratorRuntime().wrap(function _callee8$(_context8) { while (1) switch (_context8.prev = _context8.next) { case 0: _context8.next = 2; return toggleCfg(name + 'WinDrag'); case 2: isDrag = Cfg[name + 'WinDrag']; if (!isDrag) { temp = $q('.de-win-active.de-win-fixed', winEl.parentNode); if (temp) { toggleWindow(temp.id.substr(7), false); } } winEl.classList.toggle('de-win', isDrag); winEl.classList.toggle('de-win-fixed', !isDrag); width = winEl.style.width; winEl.style.cssText = "".concat(isDrag ? "".concat(Cfg[name + 'WinX'], "; ").concat(Cfg[name + 'WinY']) : 'right: 0; bottom: 25px').concat(width ? '; width: ' + width : ''); updateWinZ(winEl); case 9: case "end": return _context8.stop(); } }, _callee8); })); makeDraggable(name, winEl, $q('.de-win-head', winEl)); } updateWinZ(winEl); var isRemove = !isUpdate && isActive; if (!isRemove && !winEl.classList.contains('de-win') && (el = $q(".de-win-active.de-win-fixed:not(#de-win-".concat(name, ")"), winEl.parentNode))) { toggleWindow(el.id.substr(7), false); } var isAnim = !noAnim && !isUpdate && Cfg.animation; var winBody = $q('.de-win-body', winEl); if (isAnim && winBody.hasChildNodes()) { winEl.addEventListener('animationend', function aEvent(e) { e.target.removeEventListener('animationend', aEvent); showWindow(winEl, winBody, name, isRemove, data, Cfg.animation); winEl = winBody = name = isRemove = data = null; }); winEl.classList.remove('de-win-open'); winEl.classList.add('de-win-close'); } else { showWindow(winEl, winBody, name, isRemove, data, isAnim); } } function showWindow(winEl, winBody, name, isRemove, data, isAnim) { winBody.innerHTML = ''; winEl.classList.toggle('de-win-active', !isRemove); if (isRemove) { winEl.classList.remove('de-win-close'); $hide(winEl); if (!Cfg.expandPanel && !$q('.de-win-active')) { $hide($id('de-panel-buttons')); } return; } if (!Cfg.expandPanel) { $show($id('de-panel-buttons')); } switch (name) { case 'fav': if (data) { showFavoritesWindow(winBody, data); break; } readFavorites().then(function (favObj) { showFavoritesWindow(winBody, favObj); $show(winEl); if (isAnim) { winEl.classList.add('de-win-open'); } }); return; case 'cfg': CfgWindow.initCfgWindow(winBody); break; case 'hid': showHiddenWindow(winBody); break; case 'vid': showVideosWindow(winBody); } $show(winEl); if (isAnim) { winEl.classList.add('de-win-open'); } } function showVideosWindow(winBody) { var els = $Q('.de-video-link'); if (!els.length) { winBody.innerHTML = "".concat(Lng.noVideoLinks[lang], ""); return; } if (!$id('de-ytube-api')) { var _script = doc.createElement('script'); _script.type = 'text/javascript'; _script.src = aib.protocol + '//www.youtube.com/player_api'; _script.id = 'de-ytube-api'; doc.head.append(_script); } winBody.innerHTML = "
\n\t
\n\t\t\n\t\t\n\t\t\n\t\t\n\t
"); var linkList = $add("
")); var script = doc.createElement('script'); script.type = 'text/javascript'; script.textContent = "(function() {\n\t\tif('YT' in window && 'Player' in window.YT) {\n\t\t\tonYouTubePlayerAPIReady();\n\t\t} else {\n\t\t\twindow.onYouTubePlayerAPIReady = onYouTubePlayerAPIReady;\n\t\t}\n\t\tfunction onYouTubePlayerAPIReady() {\n\t\t\twindow.de_addVideoEvents =\n\t\t\t\taddEvents.bind(document.querySelector('#de-win-vid > .de-win-body > .de-video-obj'));\n\t\t\twindow.de_addVideoEvents();\n\t\t}\n\t\tfunction addEvents() {\n\t\t\tvar autoplay = true;\n\t\t\tif(this.hasAttribute('de-disableautoplay')) {\n\t\t\t\tautoplay = false;\n\t\t\t\tthis.removeAttribute('de-disableautoplay');\n\t\t\t}\n\t\t\tnew YT.Player(this.firstChild, { events: {\n\t\t\t\t'onError': gotoNextVideo,\n\t\t\t\t'onReady': autoplay ? function(e) {\n\t\t\t\t\te.target.playVideo();\n\t\t\t\t} : Function.prototype,\n\t\t\t\t'onStateChange': function(e) {\n\t\t\t\t\tif(e.data === 0) {\n\t\t\t\t\t\tgotoNextVideo();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}});\n\t\t}\n\t\tfunction gotoNextVideo() {\n\t\t\tdocument.getElementById(\"de-video-btn-next\").click();\n\t\t}\n\t})();"; winBody.append(script); winBody.addEventListener('click', { linkList: linkList, currentLink: null, listHidden: false, player: winBody.firstElementChild, playerInfo: null, handleEvent: function handleEvent(e) { var el = e.target; if (el.classList.contains('de-abtn')) { var node; switch (el.id) { case 'de-video-btn-hide': { var isHide = this.listHidden = !this.listHidden; $toggle(this.linkList, !isHide); el.textContent = isHide ? "\u25BC" : "\u25B2"; break; } case 'de-video-btn-prev': node = this.currentLink.parentNode; node = node.previousElementSibling || node.parentNode.lastElementChild; node.lastElementChild.click(); break; case 'de-video-btn-next': node = this.currentLink.parentNode; node = node.nextElementSibling || node.parentNode.firstElementChild; node.lastElementChild.click(); break; case 'de-video-btn-resize': { var exp = this.player.className === 'de-video-obj'; this.player.className = exp ? 'de-video-obj de-video-expanded' : 'de-video-obj'; this.linkList.style.maxWidth = "".concat(exp ? 894 : +Cfg.YTubeWidth + 40, "px"); this.linkList.style.maxHeight = "".concat(nav.viewportHeight() * 0.92 - (exp ? 562 : +Cfg.YTubeHeigh + 82), "px"); } } e.preventDefault(); return; } else if (!el.classList.contains('de-video-link')) { pByNum.get(+el.getAttribute('de-num')).selectAndScrollTo(); return; } var info = el.videoInfo; if (this.playerInfo !== info) { if (this.currentLink) { this.currentLink.classList.remove('de-current'); } this.currentLink = el; el.classList.add('de-current'); Videos.addPlayer(this, info, el.classList.contains('de-ytube'), true); } e.preventDefault(); } }, true); for (var i = 0, len = els.length; i < len; ++i) { updateVideoList(linkList, els[i], aib.getPostOfEl(els[i]).num); } winBody.append(linkList); $q('.de-video-link', linkList).click(); } function updateVideoList(parent, link, num) { var el = link.cloneNode(true); el.videoInfo = link.videoInfo; el.classList.remove('de-current'); el.setAttribute('onclick', 'window.de_addVideoEvents && window.de_addVideoEvents();'); $bEnd(parent, "
\n\t\t>").concat(num, "\" de-num=\"").concat(num, "\">>>\n\t
")).append(el); } function showHiddenWindow(winBody) { var boards = HiddenThreads.getRawData(); var hasThreads = !$isEmpty(boards); if (hasThreads) { var _loop = function _loop() { if (!$hasProp(boards, board)) { return 0; } var threads = boards[board]; if ($isEmpty(threads)) { return 0; } var block = $bEnd(winBody, "
/".concat(board, "
")); block.firstChild.onclick = function (e) { return $Q('.de-entry > input', block).forEach(function (el) { return el.checked = e.target.checked; }); }; for (var tNum in threads) { if ($hasProp(threads, tNum)) { block.insertAdjacentHTML('beforeend', "
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t").concat(tNum, "\n\t\t\t\t\t\t\t
- ").concat(threads[tNum][2], "
\n\t\t\t\t\t\t
")); } } }, _ret; for (var board in boards) { _ret = _loop(); if (_ret === 0) continue; } } $bEnd(winBody, (!hasThreads ? "
".concat(Lng.noHidThr[lang], "
") : '') + '
').append( getEditButton('hidden', function (fn) { return fn(HiddenThreads.getRawData(), true, function (data) { HiddenThreads.saveRawData(data); Thread.first.updateHidden(data[aib.b]); toggleWindow('hid', true); }); }), $button(Lng.clear[lang], Lng.clear404[lang], function () { var _ref3 = _asyncToGenerator( _regeneratorRuntime().mark(function _callee9(e) { var els, _loop2, i, len; return _regeneratorRuntime().wrap(function _callee9$(_context10) { while (1) switch (_context10.prev = _context10.next) { case 0: els = $Q('.de-entry[info]', e.target.parentNode.parentNode); _loop2 = _regeneratorRuntime().mark(function _loop2() { var _els$i$getAttribute$s, _els$i$getAttribute$s2, board, tNum; return _regeneratorRuntime().wrap(function _loop2$(_context9) { while (1) switch (_context9.prev = _context9.next) { case 0: _els$i$getAttribute$s = els[i].getAttribute('info').split(';'), _els$i$getAttribute$s2 = _slicedToArray(_els$i$getAttribute$s, 2), board = _els$i$getAttribute$s2[0], tNum = _els$i$getAttribute$s2[1]; _context9.next = 3; return $ajax(aib.getThrUrl(board, tNum))["catch"](function (err) { if (err.code === 404) { HiddenThreads.removeStorage(tNum, board); HiddenPosts.removeStorage(tNum, board); } }); case 3: case "end": return _context9.stop(); } }, _loop2); }); i = 0, len = els.length; case 3: if (!(i < len)) { _context10.next = 8; break; } return _context10.delegateYield(_loop2(), "t0", 5); case 5: ++i; _context10.next = 3; break; case 8: toggleWindow('hid', true); case 9: case "end": return _context10.stop(); } }, _callee9); })); return function (_x7) { return _ref3.apply(this, arguments); }; }()), $button(Lng.remove[lang], Lng.delEntries[lang], function () { $Q('.de-entry[info]', winBody).forEach(function (el) { if (!$q('input', el).checked) { return; } var _el$getAttribute$spli = el.getAttribute('info').split(';'), _el$getAttribute$spli2 = _slicedToArray(_el$getAttribute$spli, 2), board = _el$getAttribute$spli2[0], tNum = _el$getAttribute$spli2[1]; var num = +tNum; if (pByNum.has(num)) { pByNum.get(num).setUserVisib(false); } else { sendStorageEvent('__de-post', { brd: board, num: num, hide: false, thrNum: num }); } HiddenThreads.removeStorage(num, board); HiddenPosts.set(num, num, false); }); toggleWindow('hid', true); })); } function saveRenewFavorites(favObj) { saveFavorites(favObj); toggleWindow('fav', true, favObj); } function removeFavEntry(favObj, host, board, num) { var _favObj$host; var entry = (_favObj$host = favObj[host]) === null || _favObj$host === void 0 ? void 0 : _favObj$host[board]; if (entry !== null && entry !== void 0 && entry[num]) { delete entry[num]; if (!(Object.keys(entry).length - +$hasProp(entry, 'url') - +$hasProp(entry, 'hide'))) { delete favObj[host][board]; if ($isEmpty(favObj[host])) { delete favObj[host]; } } } } function toggleThrFavBtn(host, board, num, isEnable) { if (host === aib.host && board === aib.b && pByNum.has(num)) { var post = pByNum.get(num); post.toggleFavBtn(isEnable); post.thr.isFav = isEnable; } } function updateFavorites(num, value, mode) { readFavorites().then(function (favObj) { var _favObj$aib$host2; var entry = (_favObj$aib$host2 = favObj[aib.host]) === null || _favObj$aib$host2 === void 0 || (_favObj$aib$host2 = _favObj$aib$host2[aib.b]) === null || _favObj$aib$host2 === void 0 ? void 0 : _favObj$aib$host2[num]; if (!entry) { return; } var isUpdate = false; switch (mode) { case 'error': if (entry.err !== value) { entry.err = value; isUpdate = true; } break; case 'update': if (entry.last !== aib.anchor + value[3]) { if (doc.hidden) { value[1] += entry["new"]; } else { value[1] = value[2] = 0; entry.last = aib.anchor + value[3]; } if (entry.err) { delete entry.err; } var _value = _slicedToArray(value, 3); entry.cnt = _value[0]; entry["new"] = _value[1]; entry.you = _value[2]; isUpdate = true; } } if (isUpdate) { var data = [aib.host, aib.b, num, value, mode]; updateFavWindow.apply(void 0, data); saveFavorites(favObj); sendStorageEvent('__de-favorites', data); } }); } function updateFavWindow(host, board, num, value, mode) { if (mode === 'add' || mode === 'delete') { toggleThrFavBtn(host, board, num, mode === 'add'); toggleWindow('fav', true, value); return; } var winEl = $q('#de-win-fav > .de-win-body'); if (!(winEl !== null && winEl !== void 0 && winEl.hasChildNodes())) { return; } var el = $q(".de-entry[de-host=\"".concat(host, "\"][de-board=\"").concat(board, "\"][de-num=\"").concat(num, "\"] > .de-fav-inf"), winEl); if (!el) { return; } var _ref4 = _toConsumableArray(el.children), iconEl = _ref4[0], youEl = _ref4[1], newEl = _ref4[2], oldEl = _ref4[3]; $toggle(newEl, value[1]); $toggle(youEl, value[2]); if (mode === 'error') { iconEl.firstElementChild.setAttribute('class', 'de-fav-inf-icon de-fav-unavail'); iconEl.title = value; return; } else if (mode === 'update') { iconEl.firstElementChild.setAttribute('class', 'de-fav-inf-icon'); iconEl.removeAttribute('title'); } oldEl.textContent = value[0]; newEl.textContent = value[1]; youEl.textContent = value[2]; } function remove404Favorites(_x8) { return _remove404Favorites.apply(this, arguments); } function _remove404Favorites() { _remove404Favorites = _asyncToGenerator( _regeneratorRuntime().mark(function _callee52(favObj) { var els, len, i, el, host, board, num; return _regeneratorRuntime().wrap(function _callee52$(_context60) { while (1) switch (_context60.prev = _context60.next) { case 0: els = $Q('.de-entry[de-removed]'); len = els.length; if (len) { _context60.next = 4; break; } return _context60.abrupt("return"); case 4: if (favObj) { _context60.next = 8; break; } _context60.next = 7; return readFavorites(); case 7: favObj = _context60.sent; case 8: for (i = 0; i < len; ++i) { el = els[i]; host = el.getAttribute('de-host'); board = el.getAttribute('de-board'); num = +el.getAttribute('de-num'); removeFavEntry(favObj, host, board, num); toggleThrFavBtn(host, board, num, false); } saveRenewFavorites(favObj); case 10: case "end": return _context60.stop(); } }, _callee52); })); return _remove404Favorites.apply(this, arguments); } function isPostRefToYou(post, myPosts) { if (Cfg.markMyPosts && (myPosts || MyPosts)) { var isMatch = myPosts ? function (num) { return myPosts[num]; } : function (num) { return MyPosts.has(num); }; var links = $Q(aib.qPostMsg.split(', ').join(' a, ') + ' a', post); for (var a = 0, linksLen = links.length; a < linksLen; ++a) { var tc = links[a].textContent; if (tc[0] === '>' && tc[1] === '>' && isMatch(parseInt(tc.substr(2), 10))) { return true; } } } return false; } function refreshFavorites(_x9) { return _refreshFavorites.apply(this, arguments); } function _refreshFavorites() { _refreshFavorites = _asyncToGenerator( _regeneratorRuntime().mark(function _callee53(needClear404) { var isUpdate, isLast404, favObj, myPosts, parentEl, entryEls, i, len, _entry$last$match, entryEl, _ref61, titleEl, youEl, newEl, totalEl, iconEl, host, board, num, url, entry, oldClassName, oldTitle, formEl, isArchived, _yield$ajaxLoad, _yield$ajaxLoad2, newCount, youCount, lastNum, posts, postsLen, j, post; return _regeneratorRuntime().wrap(function _callee53$(_context61) { while (1) switch (_context61.prev = _context61.next) { case 0: isUpdate = false; isLast404 = false; _context61.next = 4; return readFavorites(); case 4: favObj = _context61.sent; myPosts = JSON.parse(locStorage['de-myposts'] || '{}'); parentEl = $q('.de-fav-table'); entryEls = $Q('.de-entry'); i = 0, len = entryEls.length; case 9: if (!(i < len)) { _context61.next = 107; break; } entryEl = entryEls[i]; _ref61 = _toConsumableArray(entryEl.lastElementChild.children), titleEl = _ref61[0], youEl = _ref61[1], newEl = _ref61[2], totalEl = _ref61[3]; iconEl = titleEl.firstElementChild; host = entryEl.getAttribute('de-host'); board = entryEl.getAttribute('de-board'); num = entryEl.getAttribute('de-num'); url = entryEl.getAttribute('de-url'); entry = favObj[host][board][num]; if (!(entry.err === 'Archived')) { _context61.next = 20; break; } return _context61.abrupt("continue", 104); case 20: if (!(host !== aib.host || entry.err === 'Closed')) { _context61.next = 50; break; } if (!needClear404) { _context61.next = 49; break; } parentEl.classList.add('de-fav-table-unfold'); oldClassName = iconEl.getAttribute('class'); oldTitle = titleEl.title; iconEl.setAttribute('class', 'de-fav-inf-icon de-fav-wait'); titleEl.title = Lng.updating[lang]; _context61.prev = 27; _context61.next = 30; return $ajax(url, null, true); case 30: iconEl.setAttribute('class', oldClassName); if (oldTitle) { titleEl.title = oldTitle; } else { titleEl.removeAttribute('title'); } isLast404 = false; if (entry.err && entry.err !== 'Closed') { delete entry.err; isUpdate = true; } _context61.next = 49; break; case 36: _context61.prev = 36; _context61.t0 = _context61["catch"](27); if (!(_context61.t0 instanceof AjaxError && _context61.t0.code === 404)) { _context61.next = 44; break; } if (isLast404) { _context61.next = 43; break; } isLast404 = true; --i; return _context61.abrupt("continue", 104); case 43: Thread.removeSavedData(board, num); case 44: entryEl.setAttribute('de-removed', ''); iconEl.setAttribute('class', 'de-fav-inf-icon de-fav-unavail'); titleEl.title = entry.err = getErrorMessage(_context61.t0); isLast404 = false; isUpdate = true; case 49: return _context61.abrupt("continue", 104); case 50: formEl = void 0, isArchived = void 0; iconEl.setAttribute('class', 'de-fav-inf-icon de-fav-wait'); titleEl.title = Lng.updating[lang]; _context61.prev = 53; if (!aib.hasArchive) { _context61.next = 63; break; } _context61.next = 57; return ajaxLoad(url, true, false, true); case 57: _yield$ajaxLoad = _context61.sent; _yield$ajaxLoad2 = _slicedToArray(_yield$ajaxLoad, 2); formEl = _yield$ajaxLoad2[0]; isArchived = _yield$ajaxLoad2[1]; _context61.next = 66; break; case 63: _context61.next = 65; return ajaxLoad(url); case 65: formEl = _context61.sent; case 66: isLast404 = false; _context61.next = 85; break; case 69: _context61.prev = 69; _context61.t1 = _context61["catch"](53); if (!(_context61.t1 instanceof AjaxError && _context61.t1.code === 404)) { _context61.next = 77; break; } if (isLast404) { _context61.next = 76; break; } isLast404 = true; --i; return _context61.abrupt("continue", 104); case 76: Thread.removeSavedData(board, num); case 77: $hide(newEl); $hide(youEl); entryEl.setAttribute('de-removed', ''); iconEl.setAttribute('class', 'de-fav-inf-icon de-fav-unavail'); titleEl.title = entry.err = getErrorMessage(_context61.t1); isLast404 = false; isUpdate = true; return _context61.abrupt("continue", 104); case 85: if (aib.qClosed && $q(aib.qClosed, formEl)) { iconEl.setAttribute('class', 'de-fav-inf-icon de-fav-closed'); titleEl.title = Lng.thrClosed[lang]; entry.err = 'Closed'; isUpdate = true; } else if (isArchived) { iconEl.setAttribute('class', 'de-fav-inf-icon de-fav-closed'); titleEl.title = Lng.thrArchived[lang]; entry.err = 'Archived'; isUpdate = true; } else { iconEl.setAttribute('class', 'de-fav-inf-icon'); titleEl.removeAttribute('title'); if (entry.err) { delete entry.err; isUpdate = true; } } newCount = 0; youCount = 0; lastNum = ((_entry$last$match = entry.last.match(/\d+$/)) === null || _entry$last$match === void 0 ? void 0 : _entry$last$match[0]) || 0; posts = $Q(aib.qPost, formEl); postsLen = posts.length; j = 0; case 92: if (!(j < postsLen)) { _context61.next = 101; break; } post = posts[j]; if (!(lastNum >= aib.getPNum(post))) { _context61.next = 96; break; } return _context61.abrupt("continue", 98); case 96: newCount++; if (isPostRefToYou(post, myPosts[board])) { youCount++; } case 98: ++j; _context61.next = 92; break; case 101: if (newCount !== entry["new"] || entry.cnt !== postsLen + 1) { isUpdate = true; } totalEl.textContent = entry.cnt = postsLen + 1; if (newCount) { newEl.textContent = entry["new"] = newCount; $show(newEl); if (youCount) { youEl.textContent = entry.you = youCount; $show(youEl); } } else { $hide(newEl); $hide(youEl); } case 104: ++i; _context61.next = 9; break; case 107: AjaxCache.clearCache(); if (needClear404) { if (isUpdate) { remove404Favorites(favObj); } parentEl.classList.remove('de-fav-table-unfold'); } else if (isUpdate) { saveFavorites(favObj); } case 109: case "end": return _context61.stop(); } }, _callee53, null, [[27, 36], [53, 69]]); })); return _refreshFavorites.apply(this, arguments); } function showFavoritesWindow(winBody, favObj) { var html = ''; for (var host in favObj) { if (!$hasProp(favObj, host)) { continue; } var boards = favObj[host]; for (var board in boards) { if (!$hasProp(boards, board)) { continue; } var threads = boards[board]; var hb = "de-host=\"".concat(host, "\" de-board=\"").concat(board, "\""); var delBtn = "\n\t\t\t\t\n\t\t\t"; var tNums = void 0; var tArr = Object.entries(threads); switch (Cfg.favThrOrder) { case 0: tNums = tArr; break; case 1: tNums = tArr.reverse(); break; case 2: tNums = tArr.sort(function (a, b) { return (a[1].time || 0) - (b[1].time || 0); }); break; case 3: tNums = tArr.sort(function (a, b) { return (b[1].time || 0) - (a[1].time || 0); }); } var innerHtml = ''; for (var i = 0, len = tNums.length; i < len; ++i) { var tNum = tNums[i][0]; if (tNum === 'url' || tNum === 'hide') { continue; } var entry = threads[tNum]; var favLinkHref = entry.url + (!entry.last ? '' : entry.last.startsWith('#') ? entry.last : host === aib.host ? aib.anchor + entry.last : ''); var favInfIwrapTitle = !entry.err ? '' : entry.err === 'Closed' ? "title=\"".concat(Lng.thrClosed[lang], "\"") : "title=\"".concat(entry.err, "\""); var favInfIconClass = !entry.err ? '' : entry.err === 'Closed' || entry.err === 'Archived' ? 'de-fav-closed' : 'de-fav-unavail'; var favInfYouDisp = entry.you ? '' : ' style="display: none;"'; var favInfNewDisp = entry["new"] ? '' : ' style="display: none;"'; innerHtml += "
\n\t\t\t\t\t").concat(delBtn, "\n\t\t\t\t\t").concat(tNum, "\n\t\t\t\t\t
- ").concat(entry.txt, "
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t").concat(entry.you || 0, "\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t").concat(entry["new"] || 0, "\n\t\t\t\t\t\t").concat(entry.cnt, "\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
"); } if (!innerHtml) { continue; } var isHide = threads.hide === undefined ? host !== aib.host : threads.hide; html += "
\n\t\t\t\t
\n\t\t\t\t\t").concat(delBtn, "\n\t\t\t\t\t").concat(host, "/").concat(board, "\n\t\t\t\t\t".concat(isHide ? '▼' : '▲', "\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t").concat(innerHtml, "\n\t\t\t\t
\n\t\t\t
"); } } if (html) { $bEnd(winBody, "
".concat(html, "
")).addEventListener('click', function (e) { var el = nav.fixEventEl(e.target); var parentEl = el.parentNode; if (el.tagName.toLowerCase() === 'svg') { el = parentEl; parentEl = parentEl.parentNode; } switch (el.className) { case 'de-fav-link': sesStorage['de-fav-win'] = '1'; sesStorage.removeItem('de-scroll-' + parentEl.getAttribute('de-board') + (parentEl.getAttribute('de-num') || '')); break; case 'de-fav-del-btn': { var wasChecked = el.hasAttribute('de-checked'); var toggleFn = function toggleFn(btnEl) { return btnEl.toggleAttribute('de-checked', !wasChecked); }; toggleFn(el); if (parentEl.className === 'de-fav-header') { var entriesEl = parentEl.nextElementSibling; $Q('.de-fav-del-btn', entriesEl).forEach(toggleFn); if (!wasChecked && entriesEl.classList.contains('de-fav-entries-hide')) { entriesEl.classList.remove('de-fav-entries-hide'); } } var isShowDelBtns = !!$q('.de-entry > .de-fav-del-btn[de-checked]', winBody); $toggle($id('de-fav-buttons'), !isShowDelBtns); $toggle($id('de-fav-del-confirm'), isShowDelBtns); break; } case 'de-abtn de-fav-header-btn': { var _entriesEl = parentEl.nextElementSibling; var _isHide = !_entriesEl.classList.contains('de-fav-entries-hide'); el.innerHTML = _isHide ? '▼' : '▲'; favObj[_entriesEl.getAttribute('de-host')][_entriesEl.getAttribute('de-board')].hide = _isHide; saveFavorites(favObj); e.preventDefault(); _entriesEl.classList.toggle('de-fav-entries-hide'); } } }); } else { winBody.insertAdjacentHTML('beforeend', "
".concat(Lng.noFavThr[lang], "
")); } var btns = $bEnd(winBody, '
'); btns.append( getEditButton('favor', function (fn) { return readFavorites().then(function (favObj) { return fn(favObj, true, saveRenewFavorites); }); }), $button(Lng.refresh[lang], Lng.refreshCounters[lang], function () { return refreshFavorites(false); }), $button(Lng.clear[lang], Lng.refreshClear404[lang], function () { return refreshFavorites(true); }), $button(Lng.page[lang], Lng.infoPage[lang], _asyncToGenerator( _regeneratorRuntime().mark(function _callee10() { var els, len, thrInfo, _i3, el, iconEl, titleEl, endPage, infoLoaded, updateInf, page, _tNums, form, _els, _i4, _len3, _i5, inf, _i6, _inf; return _regeneratorRuntime().wrap(function _callee10$(_context11) { while (1) switch (_context11.prev = _context11.next) { case 0: els = $Q('.de-fav-current > .de-fav-entries > .de-entry'); len = els.length; if (len) { _context11.next = 4; break; } return _context11.abrupt("return"); case 4: $popup('load-pages', Lng.loading[lang], true); thrInfo = []; for (_i3 = 0; _i3 < len; ++_i3) { el = els[_i3]; iconEl = $q('.de-fav-inf-icon', el); titleEl = iconEl.parentNode; thrInfo.push({ found: false, num: +el.getAttribute('de-num'), pageEl: $q('.de-fav-inf-page', el), iconClass: iconEl.getAttribute('class'), iconEl: iconEl, iconTitle: titleEl.getAttribute('title'), titleEl: titleEl }); iconEl.setAttribute('class', 'de-fav-inf-icon de-fav-wait'); titleEl.title = Lng.updating[lang]; } endPage = (aib.lastPage || 10) + 1; infoLoaded = 0; updateInf = function updateInf(inf, page) { inf.iconEl.setAttribute('class', inf.iconClass); if (inf.iconTitle) { inf.titleEl.title = inf.iconTitle; } else { inf.titleEl.removeAttribute('title'); } inf.pageEl.textContent = '@' + page; }; page = 0; case 11: if (!(page < endPage)) { _context11.next = 30; break; } _tNums = new Set(); _context11.prev = 13; _context11.next = 16; return ajaxLoad(aib.getPageUrl(aib.b, page)); case 16: form = _context11.sent; _els = DelForm.getThreads(form); for (_i4 = 0, _len3 = _els.length; _i4 < _len3; ++_i4) { _tNums.add(aib.getTNum(_els[_i4])); } _context11.next = 24; break; case 21: _context11.prev = 21; _context11.t0 = _context11["catch"](13); return _context11.abrupt("continue", 27); case 24: for (_i5 = 0; _i5 < len; ++_i5) { inf = thrInfo[_i5]; if (_tNums.has(inf.num)) { updateInf(inf, page); inf.found = true; infoLoaded++; } } if (!(infoLoaded === len)) { _context11.next = 27; break; } return _context11.abrupt("break", 30); case 27: ++page; _context11.next = 11; break; case 30: for (_i6 = 0; _i6 < len; ++_i6) { _inf = thrInfo[_i6]; if (!_inf.found) { updateInf(_inf, '?'); } } closePopup('load-pages'); case 32: case "end": return _context11.stop(); } }, _callee10, null, [[13, 21]]); })))); var delBtns = $bEnd(winBody, ''); delBtns.append($button(Lng.remove[lang], Lng.delEntries[lang], function () { $Q('.de-entry > .de-fav-del-btn[de-checked]', winBody).forEach(function (el) { return el.parentNode.setAttribute('de-removed', ''); }); remove404Favorites(); $show(btns); $hide(delBtns); }), $button(Lng.cancel[lang], '', function () { $Q('.de-fav-del-btn', winBody).forEach(function (el) { return el.removeAttribute('de-checked'); }); $show(btns); $hide(delBtns); })); } var CfgWindow = { initCfgWindow: function initCfgWindow(winBody) { var _this18 = this; ['click', 'mouseover', 'mouseout', 'change', 'keyup', 'keydown', 'scroll'].forEach(function (e) { return winBody.addEventListener(e, _this18); }); var div = $bEnd(winBody, "
".concat(this._getTab('filters') + this._getTab('posts') + this._getTab('images') + this._getTab('links') + (postform.form || postform.oeForm ? this._getTab('form') : '') + this._getTab('common') + this._getTab('info'), "
").concat(this._getSel('language'), "
")); this._clickTab(Cfg.cfgTab); div.append( getEditButton('cfg', function (fn) { return fn(Cfg, true, function () { var _ref6 = _asyncToGenerator( _regeneratorRuntime().mark(function _callee11(data) { return _regeneratorRuntime().wrap(function _callee11$(_context12) { while (1) switch (_context12.prev = _context12.next) { case 0: _context12.next = 2; return CfgSaver.saveObj(aib.domain, function () { return data; }); case 2: deWindow.location.reload(); case 3: case "end": return _context12.stop(); } }, _callee11); })); return function (_x10) { return _ref6.apply(this, arguments); }; }()); }), nav.hasGlobalStorage ? $button(Lng.global[lang], Lng.globalCfg[lang], function () { var el = $popup('cfg-global', "".concat(Lng.globalCfg[lang], ":")); $bEnd(el, "
").concat(Lng.loadGlobal[lang], "
")).firstElementChild.onclick = _asyncToGenerator( _regeneratorRuntime().mark(function _callee12() { var data; return _regeneratorRuntime().wrap(function _callee12$(_context13) { while (1) switch (_context13.prev = _context13.next) { case 0: _context13.next = 2; return getStoredObj('DESU_Config'); case 2: data = _context13.sent; if (!(data && 'global' in data && !$isEmpty(data.global))) { _context13.next = 9; break; } _context13.next = 6; return CfgSaver.saveObj(aib.domain, function () { return data.global; }); case 6: deWindow.location.reload(); _context13.next = 10; break; case 9: $popup('err-noglobalcfg', Lng.noGlobalCfg[lang]); case 10: case "end": return _context13.stop(); } }, _callee12); })); div = $bEnd(el, "
").concat(Lng.saveGlobal[lang], "
")).firstElementChild.onclick = _asyncToGenerator( _regeneratorRuntime().mark(function _callee13() { var data, obj, com, i; return _regeneratorRuntime().wrap(function _callee13$(_context14) { while (1) switch (_context14.prev = _context14.next) { case 0: _context14.next = 2; return getStoredObj('DESU_Config'); case 2: data = _context14.sent; obj = {}; com = data[aib.domain]; for (i in com) { if (i !== 'correctTime' && i !== 'timePattern' && i !== 'userCSS' && i !== 'userCSSTxt' && i !== 'stats' && com[i] !== defaultCfg[i]) { obj[i] = com[i]; } } data.global = obj; _context14.next = 9; return CfgSaver.saveObj('global', function () { return data.global; }); case 9: toggleWindow('cfg', true); case 10: case "end": return _context14.stop(); } }, _callee13); })); el.insertAdjacentHTML('beforeend', "
".concat(Lng.descrGlobal[lang], "")); }) : '', !nav.isPresto ? $button(Lng.file[lang], Lng.fileImpExp[lang], function () { var list = _this18._getList([Lng.panelBtn.cfg[lang] + ' ' + Lng.allDomains[lang], Lng.panelBtn.fav[lang], Lng.hidPostThr[lang] + " (".concat(aib.domain, ")"), Lng.myPosts[lang] + " (".concat(aib.domain, ")")]); $popup('cfg-file', "".concat(Lng.fileImpExp[lang], ":
").concat(Lng.fileToData[lang], ":

").concat(Lng.dataToFile[lang], ":
").concat(list, "
")); $id('de-import-file').onchange = function (e) { var file = e.target.files[0]; if (!file) { return; } readFile(file, true).then(function (_ref9) { var data = _ref9.data; var obj; try { obj = JSON.parse(data); } catch (err) { $popup('err-invaliddata', Lng.invalidData[lang]); return; } var _obj = obj, cfgObj = _obj.settings, favObj = _obj.favorites, domainObj = _obj[aib.domain]; var isOldCfg = !cfgObj && !favObj && !domainObj; if (isOldCfg) { setStored('DESU_Config', data); } if (cfgObj) { try { setStored('DESU_Config', JSON.stringify(cfgObj)); setStored('DESU_keys', JSON.stringify(obj.hotkeys)); } catch (err) {} } if (favObj) { saveRenewFavorites(favObj); } if (domainObj) { if (domainObj.posts) { locStorage['de-posts'] = JSON.stringify(domainObj.posts); } if (domainObj.threads) { locStorage['de-threads'] = JSON.stringify(domainObj.threads); } if (domainObj.myposts) { locStorage['de-myposts'] = JSON.stringify(domainObj.myposts); } } if (cfgObj || domainObj || isOldCfg) { $popup('cfg-file', Lng.updating[lang], true); deWindow.location.reload(); return; } closePopup('cfg-file'); }); }; var expFile = $id('de-export-file'); var els = $Q('input', expFile.nextElementSibling); els[0].checked = true; expFile.addEventListener('click', function () { var _ref10 = _asyncToGenerator( _regeneratorRuntime().mark(function _callee14(e) { var name, nameDomain, d, val, valDomain, i, len, cfgData; return _regeneratorRuntime().wrap(function _callee14$(_context15) { while (1) switch (_context15.prev = _context15.next) { case 0: name = []; nameDomain = []; d = new Date(); val = []; valDomain = []; i = 0, len = els.length; case 6: if (!(i < len)) { _context15.next = 38; break; } if (els[i].checked) { _context15.next = 9; break; } return _context15.abrupt("continue", 35); case 9: _context15.t0 = i; _context15.next = _context15.t0 === 0 ? 12 : _context15.t0 === 1 ? 18 : _context15.t0 === 2 ? 30 : _context15.t0 === 3 ? 33 : 35; break; case 12: name.push('Cfg'); _context15.next = 15; return Promise.all([getStored('DESU_Config'), getStored('DESU_keys')]); case 15: cfgData = _context15.sent; val.push("\"settings\":".concat(cfgData[0]), "\"hotkeys\":".concat(cfgData[1] || '""')); return _context15.abrupt("break", 35); case 18: name.push('Fav'); _context15.t1 = val; _context15.t2 = "\"favorites\":"; _context15.next = 23; return getStored('DESU_Favorites'); case 23: _context15.t3 = _context15.sent; if (_context15.t3) { _context15.next = 26; break; } _context15.t3 = '{}'; case 26: _context15.t4 = _context15.t3; _context15.t5 = _context15.t2.concat.call(_context15.t2, _context15.t4); _context15.t1.push.call(_context15.t1, _context15.t5); return _context15.abrupt("break", 35); case 30: nameDomain.push('Hid'); valDomain.push("\"posts\":".concat(locStorage['de-posts'] || '{}'), "\"threads\":".concat(locStorage['de-threads'] || '{}')); return _context15.abrupt("break", 35); case 33: nameDomain.push('You'); valDomain.push("\"myposts\":".concat(locStorage['de-myposts'] || '{}')); case 35: ++i; _context15.next = 6; break; case 38: if (valDomain = valDomain.join(',')) { val.push("\"".concat(aib.domain, "\":{").concat(valDomain, "}")); name.push("".concat(aib.domain, " (").concat(nameDomain.join('+'), ")")); } if (val = val.join(',')) { downloadBlob(new Blob(["{".concat(val, "}")], { type: 'application/json' }), "DE_".concat(d.getFullYear()).concat(pad2(d.getMonth() + 1)).concat(pad2(d.getDate()), "_").concat(pad2(d.getHours())).concat(pad2(d.getMinutes()), "_").concat(name.join('+'), ".json")); } e.preventDefault(); case 41: case "end": return _context15.stop(); } }, _callee14); })); return function (_x11) { return _ref10.apply(this, arguments); }; }(), true); }) : '', $button(Lng.reset[lang] + '…', Lng.resetCfg[lang], function () { return $popup('cfg-reset', "".concat(Lng.resetData[lang], ":
") + "
".concat(aib.domain, ":").concat(_this18._getList([Lng.panelBtn.cfg[lang], Lng.hidPostThr[lang], Lng.myPosts[lang]]), "

") + "
".concat(Lng.allDomains[lang], ":").concat(_this18._getList([Lng.panelBtn.cfg[lang], Lng.panelBtn.fav[lang]]), "

")).append($button(Lng.clear[lang], '', function (e) { var els = $Q('input[type="checkbox"]', e.target.parentNode); for (var i = 1, len = els.length; i < len; ++i) { if (!els[i].checked) { continue; } switch (i) { case 1: locStorage.removeItem('de-posts'); locStorage.removeItem('de-threads'); break; case 2: locStorage.removeItem('de-myposts'); break; case 4: delStored('DESU_Favorites'); } } if (els[3].checked) { delStored('DESU_Config'); delStored('DESU_keys'); } else if (els[0].checked) { getStoredObj('DESU_Config').then(function (data) { delete data[aib.domain]; setStored('DESU_Config', JSON.stringify(data)); $popup('cfg-reset', Lng.updating[lang], true); deWindow.location.reload(); }); return; } $popup('cfg-reset', Lng.updating[lang], true); deWindow.location.reload(); })); })); }, handleEvent: function handleEvent(e) { var _this19 = this; return _asyncToGenerator( _regeneratorRuntime().mark(function _callee15() { var type, el, tag, classList, info, _info, isHide, post, _iterator3, _step3, _el3, _info2, _post4, img, _iterator4, _step4, _el4, perf, arr, i, len, _info3, isValidColor, color, image, val; return _regeneratorRuntime().wrap(function _callee15$(_context16) { while (1) switch (_context16.prev = _context16.next) { case 0: type = e.type, el = e.target; tag = el.tagName.toLowerCase(); classList = el.classList; if (type === 'mouseover' && classList.contains('de-cfg-needreload') && !el.title) { el.title = Lng.cfgNeedReload[lang]; } if (!(type === 'click' && tag === 'div' && classList.contains('de-cfg-tab'))) { _context16.next = 9; break; } info = el.getAttribute('info'); _this19._clickTab(info); _context16.next = 9; return CfgSaver.save('cfgTab', info); case 9: if (!(type === 'change' && tag === 'select')) { _context16.next = 51; break; } _info = el.getAttribute('info'); _context16.next = 13; return CfgSaver.save(_info, el.selectedIndex); case 13: _this19._updateDependant(); _context16.t0 = _info; _context16.next = _context16.t0 === 'language' ? 17 : _context16.t0 === 'delHiddPost' ? 24 : _context16.t0 === 'postBtnsCSS' ? 28 : _context16.t0 === 'thrBtns' ? 31 : _context16.t0 === 'noSpoilers' ? 31 : _context16.t0 === 'resizeImgs' ? 31 : _context16.t0 === 'expandImgs' ? 33 : _context16.t0 === 'imgNames' ? 36 : _context16.t0 === 'fileInputs' ? 39 : _context16.t0 === 'addPostForm' ? 43 : _context16.t0 === 'addTextBtns' ? 46 : _context16.t0 === 'scriptStyle' ? 47 : _context16.t0 === 'panelCounter' ? 47 : _context16.t0 === 'favThrOrder' ? 49 : 50; break; case 17: lang = el.selectedIndex; Panel.removeMain(); if (postform.form) { postform.addMarkupPanel(); postform.setPlaceholders(); aib.updateSubmitBtn(postform.subm); if (postform.files) { $Q('.de-file-img, .de-file-txt-input', postform.form).forEach(function (el) { return el.title = Lng.youCanDrag[lang]; }); } } _this19._updateCSS(); Panel.initPanel(DelForm.first.el); toggleWindow('cfg', false); return _context16.abrupt("break", 50); case 24: isHide = Cfg.delHiddPost === 1 || Cfg.delHiddPost === 2; for (post = Thread.first.op; post; post = post.next) { if (post.isHidden && !post.isOp) { post.wrap.classList.toggle('de-hidden', isHide); } } updateCSS(); return _context16.abrupt("break", 50); case 28: updateCSS(); if (nav.isPresto) { $q('.de-svg-icons').remove(); addSVGIcons(); } return _context16.abrupt("break", 50); case 31: updateCSS(); return _context16.abrupt("break", 50); case 33: updateCSS(); AttachedImage.closeImg(); return _context16.abrupt("break", 50); case 36: if (Cfg.imgNames) { for (_iterator3 = _createForOfIteratorHelperLoose(DelForm); !(_step3 = _iterator3()).done;) { _el3 = _step3.value.el; processImgInfoLinks(_el3, 0, Cfg.imgNames); } } else { $Q('.de-img-name').forEach(function (el) { return el.textContent = el.getAttribute('de-img-name-old'); }); } updateCSS(); return _context16.abrupt("break", 50); case 39: postform.files.changeMode(); postform.setPlaceholders(); updateCSS(); return _context16.abrupt("break", 50); case 43: postform.isBottom = Cfg.addPostForm === 1; postform.setReply(false, !aib.t || Cfg.addPostForm > 1); return _context16.abrupt("break", 50); case 46: postform.addMarkupPanel(); case 47: _this19._updateCSS(); return _context16.abrupt("break", 50); case 49: readFavorites().then(function (favObj) { var winBody = $q('#de-win-fav > .de-win-body'); winBody.innerHTML = ''; showFavoritesWindow(winBody, favObj); }); case 50: return _context16.abrupt("return"); case 51: if (!(type === 'click' && tag === 'input' && el.type === 'checkbox')) { _context16.next = 115; break; } _info2 = el.getAttribute('info'); _context16.next = 55; return toggleCfg(_info2); case 55: _this19._updateDependant(); _context16.t1 = _info2; _context16.next = _context16.t1 === 'expandTrunc' ? 59 : _context16.t1 === 'widePosts' ? 59 : _context16.t1 === 'showHideBtn' ? 59 : _context16.t1 === 'showRepBtn' ? 59 : _context16.t1 === 'noPostNames' ? 59 : _context16.t1 === 'imgNavBtns' ? 59 : _context16.t1 === 'strikeHidd' ? 59 : _context16.t1 === 'removeHidd' ? 59 : _context16.t1 === 'noBoardRule' ? 59 : _context16.t1 === 'favFolders' ? 59 : _context16.t1 === 'userCSS' ? 59 : _context16.t1 === 'hideBySpell' ? 61 : _context16.t1 === 'sortSpells' ? 64 : _context16.t1 === 'hideRefPsts' ? 68 : _context16.t1 === 'ajaxUpdThr' ? 70 : _context16.t1 === 'updCount' ? 72 : _context16.t1 === 'desktNotif' ? 74 : _context16.t1 === 'markNewPosts' ? 76 : _context16.t1 === 'markMyPosts' ? 78 : _context16.t1 === 'markMyLinks' ? 78 : _context16.t1 === 'correctTime' ? 81 : _context16.t1 === 'imgInfoLink' ? 84 : _context16.t1 === 'imgSrcBtns' ? 88 : _context16.t1 === 'addSageBtn' ? 90 : _context16.t1 === 'altCaptcha' ? 94 : _context16.t1 === 'txtBtnsLoc' ? 96 : _context16.t1 === 'userPassw' ? 99 : _context16.t1 === 'userName' ? 102 : _context16.t1 === 'noPassword' ? 105 : _context16.t1 === 'noName' ? 107 : _context16.t1 === 'noSubj' ? 109 : _context16.t1 === 'inftyScroll' ? 111 : _context16.t1 === 'hotKeys' ? 113 : 114; break; case 59: updateCSS(); return _context16.abrupt("break", 114); case 61: _context16.next = 63; return Spells.toggle(); case 63: return _context16.abrupt("break", 114); case 64: if (!Cfg.sortSpells) { _context16.next = 67; break; } _context16.next = 67; return Spells.toggle(); case 67: return _context16.abrupt("break", 114); case 68: for (_post4 = Thread.first.op; _post4; _post4 = _post4.next) { if (!Cfg.hideRefPsts) { _post4.ref.unhideRef(); } else if (_post4.isHidden) { _post4.ref.hideRef(); } } return _context16.abrupt("break", 114); case 70: if (aib.t) { if (Cfg.ajaxUpdThr) { updater.enableUpdater(); } else { updater.disableUpdater(); } } return _context16.abrupt("break", 114); case 72: updater.toggleCounter(Cfg.updCount); return _context16.abrupt("break", 114); case 74: if (Cfg.desktNotif) { Notification.requestPermission(); } return _context16.abrupt("break", 114); case 76: Post.clearMarks(); return _context16.abrupt("break", 114); case 78: if (!Cfg.markMyPosts && !Cfg.markMyLinks) { locStorage.removeItem('de-myposts'); MyPosts.purge(); } updateCSS(); return _context16.abrupt("break", 114); case 81: _context16.next = 83; return DateTime.toggleSettings(el); case 83: return _context16.abrupt("break", 114); case 84: img = $q('.de-fullimg-wrap'); if (img) { img.click(); } updateCSS(); return _context16.abrupt("break", 114); case 88: if (Cfg.imgSrcBtns) { for (_iterator4 = _createForOfIteratorHelperLoose(DelForm); !(_step4 = _iterator4()).done;) { _el4 = _step4.value.el; processImgInfoLinks(_el4, 1, 0); $Q('.de-img-embed').forEach(function (el) { return addImgButtons(el.parentNode.nextSibling.nextSibling); }); } } else { $delAll('.de-btn-img'); } return _context16.abrupt("break", 114); case 90: PostForm.hideField(postform.mail.closest('label') || postform.mail); setTimeout(function () { return postform.toggleSage(); }, 0); updateCSS(); return _context16.abrupt("break", 114); case 94: postform.cap.initCapPromise(); return _context16.abrupt("break", 114); case 96: postform.addMarkupPanel(); updateCSS(); return _context16.abrupt("break", 114); case 99: _context16.next = 101; return PostForm.setUserPassw(); case 101: return _context16.abrupt("break", 114); case 102: _context16.next = 104; return PostForm.setUserName(); case 104: return _context16.abrupt("break", 114); case 105: $toggle(postform.passw.closest(aib.qFormTr)); return _context16.abrupt("break", 114); case 107: PostForm.hideField(postform.name); return _context16.abrupt("break", 114); case 109: PostForm.hideField(postform.subj); return _context16.abrupt("break", 114); case 111: toggleInfinityScroll(); return _context16.abrupt("break", 114); case 113: if (Cfg.hotKeys) { HotKeys.enableHotKeys(); } else { HotKeys.disableHotKeys(); } case 114: return _context16.abrupt("return"); case 115: if (!(type === 'click' && tag === 'input' && el.type === 'button')) { _context16.next = 137; break; } _context16.t2 = el.id; _context16.next = _context16.t2 === 'de-cfg-button-pass' ? 119 : _context16.t2 === 'de-cfg-button-keys' ? 123 : _context16.t2 === 'de-cfg-button-updnow' ? 128 : _context16.t2 === 'de-cfg-button-donate' ? 131 : _context16.t2 === 'de-cfg-button-debug' ? 133 : 137; break; case 119: $q('input[info="passwValue"]').value = Math.round(Math.random() * 1e12).toString(32); _context16.next = 122; return PostForm.setUserPassw(); case 122: return _context16.abrupt("break", 137); case 123: e.preventDefault(); if (!$id('de-popup-edit-hotkeys')) { _context16.next = 126; break; } return _context16.abrupt("return"); case 126: Promise.resolve(HotKeys.readKeys()).then(function (keys) { var temp = KeyEditListener.getEditMarkup(keys); var el = $popup('edit-hotkeys', temp[1]); var fn = new KeyEditListener(el, keys, temp[0]); ['focus', 'blur', 'click', 'keydown', 'keyup'].forEach(function (e) { return el.addEventListener(e, fn, true); }); }); return _context16.abrupt("break", 137); case 128: $popup('updavail', Lng.loading[lang], true); getStoredObj('DESU_Config').then(function (data) { return checkForUpdates(true, data.lastUpd); }).then(function (html) { return $popup('updavail', html); }, Function.prototype); return _context16.abrupt("break", 137); case 131: showDonateMsg(); return _context16.abrupt("break", 137); case 133: perf = {}; arr = Logger.getLogData(true); for (i = 0, len = arr.length; i < len; ++i) { perf[arr[i][0]] = arr[i][1]; } $popup('cfg-debug', Lng.infoDebug[lang] + ':').firstElementChild.value = JSON.stringify({ version: version + '.' + commit, location: String(deWindow.location), nav: nav, Cfg: Cfg, sSpells: Spells.list.split('\n'), oSpells: sesStorage["de-spells-".concat(aib.b).concat(aib.t || '')], perf: perf }, function (key, value) { switch (key) { case 'stats': case 'nameValue': case 'passwValue': case 'ytApiKey': return undefined; } return key in defaultCfg && value === defaultCfg[key] ? undefined : value; }, '\t'); case 137: if (!(type === 'keyup' && tag === 'input' && el.type === 'text')) { _context16.next = 194; break; } _info3 = el.getAttribute('info'); _context16.t3 = _info3; _context16.next = _context16.t3 === 'postBtnsBack' ? 142 : _context16.t3 === 'limitPostMsg' ? 151 : _context16.t3 === 'minImgSize' ? 155 : _context16.t3 === 'maxImgSize' ? 158 : _context16.t3 === 'zoomFactor' ? 161 : _context16.t3 === 'webmVolume' ? 164 : _context16.t3 === 'minWebmWidth' ? 169 : _context16.t3 === 'maskVisib' ? 172 : _context16.t3 === 'linksOver' ? 176 : _context16.t3 === 'linksOut' ? 179 : _context16.t3 === 'ytApiKey' ? 182 : _context16.t3 === 'passwValue' ? 185 : _context16.t3 === 'nameValue' ? 188 : 191; break; case 142: isValidColor = false; color = el.value; if (color === 'transparent') { isValidColor = true; } else if (color && color !== 'inherit' && color !== 'currentColor') { image = doc.createElement('img'); image.style.color = 'rgb(0, 0, 0)'; image.style.color = color; if (image.style.color !== 'rgb(0, 0, 0)') { isValidColor = true; } image.style.color = 'rgb(255, 255, 255)'; image.style.color = color; isValidColor = image.style.color !== 'rgb(255, 255, 255)'; } classList.toggle('de-input-error', !isValidColor); if (!isValidColor) { _context16.next = 150; break; } _context16.next = 149; return CfgSaver.save('postBtnsBack', el.value); case 149: updateCSS(); case 150: return _context16.abrupt("break", 193); case 151: _context16.next = 153; return CfgSaver.save('limitPostMsg', Math.max(+el.value || 0, 50)); case 153: updateCSS(); return _context16.abrupt("break", 193); case 155: _context16.next = 157; return CfgSaver.save('minImgSize', Math.min(Math.max(+el.value, 1)), Cfg.maxImgSize); case 157: return _context16.abrupt("break", 193); case 158: _context16.next = 160; return CfgSaver.save('maxImgSize', Math.max(+el.value, Cfg.minImgSize)); case 160: return _context16.abrupt("break", 193); case 161: _context16.next = 163; return CfgSaver.save('zoomFactor', Math.min(Math.max(+el.value, 1), 100)); case 163: return _context16.abrupt("break", 193); case 164: val = Math.min(+el.value || 0, 100); _context16.next = 167; return CfgSaver.save('webmVolume', val); case 167: sendStorageEvent('__de-webmvolume', val); return _context16.abrupt("break", 193); case 169: _context16.next = 171; return CfgSaver.save('minWebmWidth', Math.max(+el.value, Cfg.minImgSize)); case 171: return _context16.abrupt("break", 193); case 172: _context16.next = 174; return CfgSaver.save('maskVisib', Math.min(+el.value || 0, 100)); case 174: updateCSS(); return _context16.abrupt("break", 193); case 176: _context16.next = 178; return CfgSaver.save('linksOver', +el.value | 0); case 178: return _context16.abrupt("break", 193); case 179: _context16.next = 181; return CfgSaver.save('linksOut', +el.value | 0); case 181: return _context16.abrupt("break", 193); case 182: _context16.next = 184; return CfgSaver.save('ytApiKey', el.value.trim()); case 184: return _context16.abrupt("break", 193); case 185: _context16.next = 187; return PostForm.setUserPassw(); case 187: return _context16.abrupt("break", 193); case 188: _context16.next = 190; return PostForm.setUserName(); case 190: return _context16.abrupt("break", 193); case 191: _context16.next = 193; return CfgSaver.save(_info3, el.value); case 193: return _context16.abrupt("return"); case 194: if (!(tag === 'a')) { _context16.next = 223; break; } if (!(el.id === 'de-btn-spell-add')) { _context16.next = 205; break; } _context16.t4 = e.type; _context16.next = _context16.t4 === 'click' ? 199 : _context16.t4 === 'mouseover' ? 201 : _context16.t4 === 'mouseout' ? 203 : 204; break; case 199: e.preventDefault(); return _context16.abrupt("break", 204); case 201: el.odelay = setTimeout(function () { return addMenu(el); }, Cfg.linksOver); return _context16.abrupt("break", 204); case 203: clearTimeout(el.odelay); case 204: return _context16.abrupt("return"); case 205: if (!(type === 'click')) { _context16.next = 222; break; } _context16.t5 = el.id; _context16.next = _context16.t5 === 'de-btn-spell-apply' ? 209 : _context16.t5 === 'de-btn-spell-clear' ? 216 : 222; break; case 209: e.preventDefault(); _context16.next = 212; return CfgSaver.save('hideBySpell', 1); case 212: $q('input[info="hideBySpell"]').checked = true; _context16.next = 215; return Spells.toggle(); case 215: return _context16.abrupt("break", 222); case 216: e.preventDefault(); if (confirm(Lng.clear[lang] + '?')) { _context16.next = 219; break; } return _context16.abrupt("return"); case 219: $id('de-spell-txt').value = ''; _context16.next = 222; return Spells.toggle(); case 222: return _context16.abrupt("return"); case 223: if (tag === 'textarea' && el.id === 'de-spell-txt' && (type === 'keydown' || type === 'scroll')) { _this19._updateRowMeter(el); } case 224: case "end": return _context16.stop(); } }, _callee15); }))(); }, _clickTab: function _clickTab(info) { var el = $q(".de-cfg-tab[info=\"".concat(info, "\"]")); if (el.hasAttribute('selected')) { return; } var prefTab = $q('.de-cfg-body'); if (prefTab) { prefTab.className = 'de-cfg-unvis'; $q('.de-cfg-tab[selected]').removeAttribute('selected'); } el.setAttribute('selected', ''); var id = el.getAttribute('info'); var newTab = $id('de-cfg-' + id); if (!newTab) { newTab = $aEnd($id('de-cfg-bar'), id === 'filters' ? this._getCfgFilters() : id === 'posts' ? this._getCfgPosts() : id === 'images' ? this._getCfgImages() : id === 'links' ? this._getCfgLinks() : id === 'form' ? this._getCfgForm() : id === 'common' ? this._getCfgCommon() : this._getCfgInfo()); if (id === 'filters') { this._updateRowMeter($id('de-spell-txt')); } if (id === 'common') { $q('input[info="userCSS"]').parentNode.after(getEditButton('css', function (fn) { return fn(Cfg.userCSSTxt, false, function () { var _ref11 = _asyncToGenerator( _regeneratorRuntime().mark(function _callee16(inputEl) { return _regeneratorRuntime().wrap(function _callee16$(_context17) { while (1) switch (_context17.prev = _context17.next) { case 0: _context17.next = 2; return CfgSaver.save('userCSSTxt', inputEl.value); case 2: updateCSS(); toggleWindow('cfg', true); case 4: case "end": return _context17.stop(); } }, _callee16); })); return function (_x12) { return _ref11.apply(this, arguments); }; }()); }, 'de-cfg-button')); } } newTab.className = 'de-cfg-body'; if (id === 'filters') { $id('de-spell-txt').value = Spells.list; } this._updateDependant(); var els = $Q('.de-cfg-chkbox, .de-cfg-inptxt, .de-cfg-select', newTab.parentNode); for (var i = 0, len = els.length; i < len; ++i) { var _el5 = els[i]; var _info4 = _el5.getAttribute('info'); if (_el5.tagName.toLowerCase() === 'input') { if (_el5.type === 'checkbox') { _el5.checked = !!Cfg[_info4]; } else { _el5.value = Cfg[_info4]; } } else { _el5.selectedIndex = Cfg[_info4]; } } }, _getCfgFilters: function _getCfgFilters() { return "
\n\t\t\t\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t\t").concat(this._getBox('sortSpells'), "
\n\t\t\t").concat(this._getBox('hideRefPsts'), "
\n\t\t\t").concat(this._getBox('nextPageThr'), "
\n\t\t\t").concat(this._getSel('delHiddPost'), "\n\t\t
"); }, _getCfgPosts: function _getCfgPosts() { return "
\n\t\t\t".concat(localData ? '' : "".concat(this._getBox('ajaxUpdThr'), "\n\t\t\t\t").concat(this._getInp('updThrDelay'), "\n\t\t\t\t
\n\t\t\t\t\t").concat(this._getBox('updCount'), "
\n\t\t\t\t\t").concat(this._getBox('favIcoBlink'), "
\n\t\t\t\t\t").concat('Notification' in deWindow ? this._getBox('desktNotif') + '
' : '', "\n\t\t\t\t\t").concat(this._getBox('markNewPosts'), "\n\t\t\t\t
"), "\n\t\t\t").concat(this._getBox('markMyPosts'), "
\n\t\t\t").concat(!localData ? "".concat(this._getBox('expandTrunc', true), "
") : '', "\n\t\t\t").concat(this._getBox('widePosts'), "
\n\t\t\t").concat(this._getInp('limitPostMsg', true, 5), "
\n\t\t\t").concat(this._getSel('showHideBtn'), "
\n\t\t\t").concat(!localData ? this._getSel('showRepBtn') : '', "
\n\t\t\t").concat(this._getSel('postBtnsCSS'), "\n\t\t\t").concat(this._getInp('postBtnsBack', false, 8), "
\n\t\t\t").concat(!localData ? this._getSel('thrBtns') : '', "
\n\t\t\t").concat(this._getSel('noSpoilers'), "
\n\t\t\t").concat(this._getBox('noPostNames'), "
\n\t\t\t").concat(this._getBox('correctTime', true), "\n\t\t\t").concat(this._getInp('timeOffset', true, 1), "\n\t\t\t[?]\n\t\t\t
\n\t\t\t\t").concat(this._getInp('timePattern', true, 24), "
\n\t\t\t\t").concat(this._getInp('timeRPattern', true, 24), "\n\t\t\t
\n\t\t
"); }, _getCfgImages: function _getCfgImages() { return "
\n\t\t\t".concat(this._getSel('expandImgs'), "
\n\t\t\t
\n\t\t\t\t").concat(this._getBox('imgNavBtns'), "
\n\t\t\t\t").concat(this._getBox('imgInfoLink'), "
\n\t\t\t\t").concat(this._getSel('resizeImgs'), "
\n\t\t\t\t").concat(Post.sizing.dPxRatio > 1 ? this._getBox('resizeDPI') + '
' : '', "\n\t\t\t\t").concat(this._getInp('minImgSize')).concat(this._getInp('maxImgSize'), "
\n\t\t\t\t").concat(this._getInp('zoomFactor'), "
\n\t\t\t\t").concat(this._getBox('webmControl'), "
\n\t\t\t\t").concat(this._getBox('webmTitles'), "
\n\t\t\t\t").concat(this._getInp('webmVolume'), "
\n\t\t\t\t").concat(this._getInp('minWebmWidth'), "\n\t\t\t
\n\t\t\t").concat(nav.isPresto ? '' : this._getSel('preLoadImgs', true) + '
', "\n\t\t\t").concat(nav.isPresto || aib._4chan ? '' : "
\n\t\t\t\t".concat(this._getBox('findImgFile', true), "\n\t\t\t
"), "\n\t\t\t").concat(this._getSel('openImgs', true), "
\n\t\t\t").concat(this._getBox('imgSrcBtns'), "
\n\t\t\t").concat(this._getSel('imgNames'), "
\n\t\t\t").concat(this._getInp('maskVisib'), "\n\t\t
"); }, _getCfgLinks: function _getCfgLinks() { return "
\n\t\t\t".concat(this._getBox('linksNavig', true), "\n\t\t\t
\n\t\t\t\t").concat(this._getInp('linksOver'), "\n\t\t\t\t").concat(this._getInp('linksOut'), "
\n\t\t\t\t").concat(this._getBox('markViewed'), "
\n\t\t\t\t").concat(this._getBox('strikeHidd'), "\n\t\t\t\t
").concat(this._getBox('removeHidd'), "
\n\t\t\t\t").concat(this._getBox('noNavigHidd'), "\n\t\t\t
\n\t\t\t").concat(this._getBox('markMyLinks'), "
\n\t\t\t").concat(this._getBox('crossLinks', true), "
\n\t\t\t").concat(this._getBox('decodeLinks', true), "
\n\t\t\t").concat(this._getBox('insertNum'), "
\n\t\t\t").concat(!localData ? "".concat(this._getBox('addOPLink'), "
\n\t\t\t\t").concat(this._getBox('addImgs', true), "
") : '', "\n\t\t\t
\n\t\t\t\t").concat(this._getBox('addMP3', true), "\n\t\t\t\t").concat(this._getBox('addVocaroo', true), "\n\t\t\t
\n\t\t\t").concat(this._getSel('embedYTube', true), "\n\t\t\t
\n\t\t\t\t").concat(this._getInp('YTubeWidth', false), "\xD7\n\t\t\t\t").concat(this._getInp('YTubeHeigh', false), "(px)
\n\t\t\t\t").concat(this._getBox('YTubeTitles', true), "
\n\t\t\t\t").concat(this._getInp('ytApiKey', true, 25), "
\n\t\t\t\t").concat(this._getBox('addVimeo', true), "\n\t\t\t
\n\t\t
"); }, _getCfgForm: function _getCfgForm() { return "
\n\t\t\t".concat(this._getBox('ajaxPosting', true), "
\n\t\t\t").concat(postform.form ? "
\n\t\t\t\t".concat(this._getBox('postSameImg'), "
\n\t\t\t\t").concat(this._getBox('removeEXIF'), "
\n\t\t\t\t").concat(this._getSel('removeFName'), "
\n\t\t\t\t").concat(this._getBox('sendErrNotif'), "
\n\t\t\t\t").concat(this._getBox('scrAfterRep'), "
\n\t\t\t\t").concat(postform.files && !nav.isPresto ? this._getSel('fileInputs') : '', "\n\t\t\t
") : '', "\n\t\t\t").concat(postform.form ? this._getSel('addPostForm') + '
' : '', "\n\t\t\t").concat(postform.txta ? this._getBox('spacedQuote') + '
' : '', "\n\t\t\t").concat(this._getBox('favOnReply'), "
\n\t\t\t").concat(postform.subj ? this._getBox('warnSubjTrip') + '
' : '', "\n\t\t\t").concat(postform.mail ? "".concat(this._getBox('addSageBtn'), "\n\t\t\t\t").concat(this._getBox('saveSage'), "
") : '', "\n\t\t\t").concat(postform.cap ? "".concat(aib.hasAltCaptcha ? "".concat(this._getBox('altCaptcha'), "
") : '', "\n\t\t\t\t").concat(!aib.makaba ? "".concat(this._getInp('capUpdTime'), "
") : '', "\n\t\t\t\t").concat(this._getSel('captchaLang'), "
") : '', "\n\t\t\t").concat(postform.txta ? "".concat(this._getSel('addTextBtns'), "\n\t\t\t\t").concat(!aib._4chan ? this._getBox('txtBtnsLoc') : '', "
") : '', "\n\t\t\t").concat(postform.passw ? "".concat(this._getInp('passwValue', false, 9), "\n\t\t\t\t").concat(this._getBox('userPassw'), "
") : '', "\n\t\t\t").concat(postform.name ? "".concat(this._getInp('nameValue', false, 9), "\n\t\t\t\t").concat(this._getBox('userName'), "
") : '', "\n\t\t\t").concat(postform.rules || postform.passw || postform.name ? Lng.hide[lang] + (postform.rules ? this._getBox('noBoardRule') : '') + (postform.passw ? this._getBox('noPassword') : '') + (postform.name ? this._getBox('noName') : '') + (postform.subj ? this._getBox('noSubj') : '') : '', "\n\t\t
"); }, _getCfgCommon: function _getCfgCommon() { return "
\n\t\t\t".concat(this._getSel('scriptStyle'), "
\n\t\t\t").concat(this._getBox('userCSS'), "\n\t\t\t[?]
\n\t\t\t").concat('animation' in doc.body.style ? this._getBox('animation') + '
' : '', "\n\t\t\t").concat(this._getBox('hotKeys'), "\n\t\t\t\n\t\t\t
").concat(this._getInp('loadPages'), "
\n\t\t\t").concat(this._getSel('panelCounter'), "
\n\t\t\t").concat(this._getBox('rePageTitle', true), "
\n\t\t\t").concat(!localData ? "".concat(this._getBox('inftyScroll'), "
\n\t\t\t\t").concat(this._getBox('hideReplies', true), "
\n\t\t\t\t").concat(this._getBox('scrollToTop'), "
") : '', "\n\t\t\t").concat(this._getBox('saveScroll'), "
\n\t\t\t").concat(this._getBox('favFolders'), "
\n\t\t\t").concat(this._getSel('favThrOrder'), "
\n\t\t\t").concat(this._getBox('favWinOn'), "
\n\t\t\t").concat(this._getBox('closePopups'), "\n\t\t
"); }, _getCfgInfo: function _getCfgInfo() { var statsTable = this._getInfoTable([[Lng.thrViewed[lang], Cfg.stats.view], [Lng.thrCreated[lang], Cfg.stats.op], [Lng.thrHidden[lang], HiddenThreads.getCount()], [Lng.postsSent[lang], Cfg.stats.reply]], false); return "
\n\t\t\t
\n\t\t\t\tv").concat(version, ".").concat(commit) + "".concat(nav.isESNext ? '.es6' : '', " |\n\t\t\t\tHomepage |\n\t\t\t\tGithub |\n\t\t\t\t\n\t\t\t
\n\t\t\t
\n\t\t\t\t
").concat(statsTable, "
\n\t\t\t\t
").concat(this._getInfoTable(Logger.getLogData(false), true), "
\n\t\t\t
\n\t\t\t").concat(!nav.hasWebStorage && !nav.isPresto && !localData || nav.hasGMXHR ? "\n\t\t\t\t".concat(this._getSel('updDollchan'), "\n\t\t\t\t
>>\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t<<
") : "
>>\n\t\t\t\t\t\n\t\t\t\t<<
", "\n\t\t
"); }, _getBox: function _getBox(id, needReload) { return ""); }, _getInfoTable: function _getInfoTable(data, needMs) { return data.map(function (val) { return "
\n\t\t".concat(val[0], "\n\t\t").concat(val[1] + (needMs ? 'ms' : ''), "
"); }).join(''); }, _getInp: function _getInp(id) { var addText = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; var size = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 2; var el = doc.createElement('div'); el.append(Cfg[id]); return ""); }, _getList: function _getList(arr) { return arrTags(arr, ''); }, _getSel: function _getSel(id, needReload) { return ""); }, _getTab: function _getTab(id) { return "
").concat(Lng.cfgTab[id][lang], "
"); }, _toggleDependant: function _toggleDependant(state, arr) { var i = arr.length; var nState = !state; while (i--) { var el = $q(arr[i]); if (el) { el.disabled = nState; } } }, _updateCSS: function _updateCSS() { $delAll('#de-css, #de-css-dynamic, #de-css-user', doc.head); scriptCSS(); }, _updateDependant: function _updateDependant() { var fn = this._toggleDependant; fn(Cfg.ajaxUpdThr, ['input[info="updThrDelay"]', 'input[info="updCount"]', 'input[info="favIcoBlink"]', 'input[info="markNewPosts"]', 'input[info="desktNotif"]']); fn(Cfg.postBtnsCSS === 2, ['input[info="postBtnsBack"]']); fn(Cfg.expandImgs, ['input[info="imgNavBtns"]', 'input[info="imgInfoLink"]', 'input[info="resizeDPI"]', 'select[info="resizeImgs"]', 'input[info="minImgSize"]', 'input[info="maxImgSize"]', 'input[info="zoomFactor"]', 'input[info="webmControl"]', 'input[info="webmTitles"]', 'input[info="webmVolume"]', 'input[info="minWebmWidth"]']); fn(Cfg.preLoadImgs, ['input[info="findImgFile"]']); fn(Cfg.linksNavig, ['input[info="linksOver"]', 'input[info="linksOut"]', 'input[info="markViewed"]', 'input[info="strikeHidd"]', 'input[info="noNavigHidd"]']); fn(Cfg.strikeHidd && Cfg.linksNavig, ['input[info="removeHidd"]']); fn(Cfg.embedYTube, ['input[info="YTubeWidth"]', 'input[info="YTubeHeigh"]', 'input[info="YTubeTitles"]', 'input[info="ytApiKey"]', 'input[info="addVimeo"]']); fn(Cfg.YTubeTitles, ['input[info="ytApiKey"]']); fn(Cfg.ajaxPosting, ['input[info="postSameImg"]', 'input[info="removeEXIF"]', 'select[info="removeFName"]', 'input[info="sendErrNotif"]', 'input[info="scrAfterRep"]', 'select[info="fileInputs"]']); fn(Cfg.addSageBtn, ['input[info="saveSage"]']); fn(Cfg.addTextBtns, ['input[info="txtBtnsLoc"]']); fn(Cfg.hotKeys, ['input[info="loadPages"]']); }, _updateRowMeter: function _updateRowMeter(node) { var top = node.scrollTop; var el = node.previousElementSibling; var num = el.numLines || 1; var i = 19; if (num - i < (top / 12 | 0 + 1)) { var str = ''; while (i--) { str += "".concat(num++, "
"); } el.insertAdjacentHTML('beforeend', str); el.numLines = num; } el.scrollTop = top; } }; function closePopup(data) { var el = typeof data === 'string' ? $id('de-popup-' + data) : data; if (el) { el.closeTimeout = null; if (Cfg.animation) { $animate(el, 'de-close', true); } else { el.remove(); } } } function $popup(id, txt) { var isWait = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; var el = $id('de-popup-' + id); var buttonHTML = isWait ? '' : "\u2716 "; if (el) { $q('div', el).innerHTML = txt.trim(); $q('span', el).innerHTML = buttonHTML; if (!isWait && Cfg.animation) { $animate(el, 'de-blink'); } } else { el = $bEnd($id('de-wrapper-popup'), "
\n\t\t\t").concat(buttonHTML, "\n\t\t\t
").concat(txt.trim(), "
\n\t\t
")); el.onclick = function (e) { var el = nav.fixEventEl(e.target); el = el.tagName.toLowerCase() === 'svg' ? el.parentNode : el; if (el.className === 'de-popup-btn') { closePopup(el.parentNode); } }; if (Cfg.animation) { $animate(el, 'de-open'); } } if (Cfg.closePopups && !isWait && !id.includes('edit') && !id.includes('cfg')) { el.closeTimeout = setTimeout(closePopup, 6e3, el); } return el.lastElementChild; } function getEditButton(name, getDataFn) { var className = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'de-button'; return $button(Lng.edit[lang], Lng.editInTxt[lang], function () { return getDataFn(function (val, isJSON, saveFn) { var el = $popup('edit-' + name, "".concat(Lng.editor[name][lang], "")); var inputEl = el.lastChild; inputEl.value = isJSON ? JSON.stringify(val, null, '\t') : val; el.append($button(Lng.save[lang], Lng.saveChanges[lang], !isJSON ? function () { return saveFn(inputEl); } : function () { var data; try { data = JSON.parse(inputEl.value.trim().replace(/[\n\r\t]/g, '') || '{}'); } catch (err) {} if (!data) { $popup('err-invaliddata', Lng.invalidData[lang]); return; } saveFn(data); closePopup('edit-' + name); closePopup('err-invaliddata'); })); }); }, className); } var Menu = function () { function Menu(parentEl, html, clickFn) { var _this20 = this; var isFixed = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true; _classCallCheck(this, Menu); this.onout = null; this.onover = null; this.onremove = null; this._closeTO = 0; var el = $bEnd(doc.body, "
").concat(html, "
")); var cr = parentEl.getBoundingClientRect(); var style = el.style, w = el.offsetWidth, h = el.offsetHeight; style.left = (isFixed ? 0 : deWindow.pageXOffset) + (cr.left + w < Post.sizing.wWidth ? cr.left : cr.right - w) + 'px'; style.top = (isFixed ? 0 : deWindow.pageYOffset) + (cr.bottom + h < Post.sizing.wHeight ? cr.bottom - 0.5 : cr.top - h + 0.5) + 'px'; style.removeProperty('visibility'); this._clickFn = clickFn; this._el = el; this.parentEl = parentEl; ['mouseover', 'mouseout'].forEach(function (e) { return el.addEventListener(e, _this20, true); }); el.addEventListener('click', this); parentEl.addEventListener('mouseout', this); } _createClass(Menu, [{ key: "handleEvent", value: function handleEvent(e) { var _this21 = this; var isOverEvent = false; switch (e.type) { case 'click': if (e.target.classList.contains('de-menu-item')) { this.removeMenu(); this._clickFn(e.target, e); if (!Cfg.expandPanel && !$q('.de-win-active')) { $hide($id('de-panel-buttons')); } } break; case 'mouseover': isOverEvent = true; case 'mouseout': { var _rt; clearTimeout(this._closeTO); var rt = nav.fixEventEl(e.relatedTarget); rt = ((_rt = rt) === null || _rt === void 0 ? void 0 : _rt.farthestViewportElement) || rt; if (!rt || rt !== this._el && !this._el.contains(rt)) { if (isOverEvent) { if (this.onover) { this.onover(); } } else if (!rt || rt !== this.parentEl && !this.parentEl.contains(rt)) { this._closeTO = setTimeout(function () { return _this21.removeMenu(); }, 75); if (this.onout) { this.onout(); } } } } } } }, { key: "removeMenu", value: function removeMenu() { var _this22 = this; if (!this._el) { return; } if (this.onremove) { this.onremove(); } ['mouseover', 'mouseout'].forEach(function (e) { return _this22._el.removeEventListener(e, _this22, true); }); this.parentEl.removeEventListener('mouseout', this); this._el.removeEventListener('click', this); this._el.remove(); this._el = null; } }], [{ key: "getMenuImg", value: function getMenuImg(data) { var isDlOnly = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; var p; var dlLinks = ''; if (typeof data === 'string') { p = encodeURIComponent(data) + '" target="_blank">' + Lng.frameSearch[lang]; } else { var _$q3; var link = data.nextSibling; var href = link.href; var origSrc = link.getAttribute('de-href') || href; p = encodeURIComponent(origSrc) + '" target="_blank">' + Lng.searchIn[lang]; var getDlLnk = function getDlLnk(href, name, title, isAddExt) { var ext; if (isAddExt) { ext = getFileExt(href); name += '.' + ext; } else { ext = getFileExt(name); } var nameShort = name; if (name.length > 20) { nameShort = name.substr(0, 20 - ext.length) + "\u2026" + ext; } var info = aib.domain !== href.match(/^(?:(?:blob:)?https?:\/\/)([^/]+)/)[1] ? ' info="img-load"' : ''; return "").concat(Lng.saveAs[lang], " "").concat(nameShort, """); }; var name = decodeURIComponent(getFileName(origSrc)); var isFullImg = link.classList.contains('de-fullimg-link'); var realName = isFullImg ? link.textContent : link.classList.contains('de-img-name') ? aib.getImgRealName(aib.getImgWrap(data)) : name; if (name !== realName) { dlLinks += getDlLnk(href, realName, Lng.origName[lang], false); } var webmTitle; if (isFullImg && (webmTitle = (_$q3 = $q('.de-webm-title', link.parentNode)) === null || _$q3 === void 0 ? void 0 : _$q3.textContent)) { dlLinks += getDlLnk(href, webmTitle, Lng.metaName[lang], true); } dlLinks += getDlLnk(href, name, Lng.boardName[lang], false); } if (aib.kohlchan) { p = p.replace('kohlchanagb7ih5g.onion', 'kohlchan.net').replace('kohlchanvwpfx6hthoti5fvqsjxgcwm3tmddvpduph5fqntv5affzfqd.onion', 'kohlchan.net'); } return dlLinks + (isDlOnly ? '' : arrTags(["de-src-google\" href=\"https://lens.google.com/uploadbyurl?url=".concat(p, "Google"), "de-src-yandex\" href=\"https://yandex.com/images/search?rpt=imageview&url=".concat(p, "Yandex"), "de-src-tineye\" href=\"https://tineye.com/search/?url=".concat(p, "TinEye"), "de-src-saucenao\" href=\"https://saucenao.com/search.php?url=".concat(p, "SauceNAO"), "de-src-iqdb\" href=\"https://iqdb.org/?url=".concat(p, "IQDB"), "de-src-tracemoe\" href=\"https://trace.moe/?auto&url=".concat(p, "TraceMoe")], '', ''); }; switch (el.id) { case 'de-btn-spell-add': return new Menu(el, "
".concat(fn('#words,#exp,#exph,#imgn,#ihash,#subj,#name,#trip,#img,#sage'.split(',')), "
").concat(fn('#op,#tlen,#all,#video,#vauthor,#num,#wipe,#rep,#outrep,
'.split(',')), "
"), function (_ref12) { var s = _ref12.textContent; return insertText($id('de-spell-txt'), s + (!aib.t || s === '#op' || s === '#rep' || s === '#outrep' ? '' : "[".concat(aib.b, ",").concat(aib.t, "]")) + (Spells.needArg[Spells.names.indexOf(s.substr(1))] ? '(' : '')); }); case 'de-panel-refresh': return new Menu(el, fn(Lng.selAjaxPages[lang]), function (el) { return Pages.loadPages(Array.prototype.indexOf.call(el.parentNode.children, el) + 1); }); case 'de-panel-savethr': return new Menu(el, fn($q(aib.qPostImg, DelForm.first.el) ? Lng.selSaveThr[lang] : [Lng.selSaveThr[lang][0]]), function (el) { if ($id('de-popup-savethr')) { return; } var imgOnly = !!Array.prototype.indexOf.call(el.parentNode.children, el); if (ContentLoader.isLoading) { $popup('savethr', Lng.loading[lang], true); ContentLoader.afterFn = function () { return ContentLoader.downloadThread(imgOnly); }; ContentLoader.popupId = 'savethr'; } else { ContentLoader.downloadThread(imgOnly); } }); case 'de-panel-audio-off': return new Menu(el, fn(Lng.selAudioNotif[lang]), function (el) { updater.enableUpdater(); updater.toggleAudio([3e4, 6e4, 12e4, 3e5][Array.prototype.indexOf.call(el.parentNode.children, el)]); $id('de-panel-audio-off').id = 'de-panel-audio-on'; }); } } var HotKeys = { cPost: null, enabled: false, gKeys: null, lastPageOffset: 0, ntKeys: null, tKeys: null, version: 7, clearCPost: function clearCPost() { this.cPost = null; this.lastPageOffset = 0; }, disableHotKeys: function disableHotKeys() { if (this.enabled) { this.enabled = false; if (this.cPost) { this.cPost.unselect(); } this.clearCPost(); this.gKeys = this.ntKeys = this.tKeys = null; doc.removeEventListener('keydown', this, true); } }, enableHotKeys: function enableHotKeys() { var _this23 = this; if (!this.enabled) { this.enabled = true; this._paused = false; Promise.resolve(this.readKeys()).then(function (keys) { if (_this23.enabled) { var _keys = _slicedToArray(keys, 5); _this23.gKeys = _keys[2]; _this23.ntKeys = _keys[3]; _this23.tKeys = _keys[4]; doc.addEventListener('keydown', _this23, true); } }); } }, getDefaultKeys: function getDefaultKeys() { return [HotKeys.version, nav.isFirefox, [ 0x004B , 0x004A , 0x0052 , 0x0048 , 0x1025 , 0x900D , 0x4046 , 0x4048 , 0x0050 , 0x0042 , 0x4053 , 0x0049 , 0xC042 , 0xC049 , 0xC054 , 0xC050 , 0xC043 , 0x1027 , 0x4056 ], [ 0x004D , 0x004E , 0x0056 , 0x0045 ], [ 0x0055 ]]; }, handleEvent: function handleEvent(e) { if (this._paused || e.metaKey) { return; } var idx; var isThr = aib.t; var el = e.target; var tag = el.tagName.toLowerCase(); var kc = e.keyCode | (e.ctrlKey ? 0x1000 : 0) | (e.shiftKey ? 0x2000 : 0) | (e.altKey ? 0x4000 : 0) | (tag === 'textarea' || tag === 'input' && (el.type === 'text' || el.type === 'password') ? 0x8000 : 0); if (kc === 0x74 || kc === 0x8074) { if (isThr || $id('de-popup-load-pages')) { return; } AttachedImage.closeImg(); Pages.loadPages(+Cfg.loadPages); } else if (kc === 0x1B) { if (AttachedImage.viewer) { AttachedImage.closeImg(); return; } if (this.cPost) { this.cPost.unselect(); this.cPost = null; } if (isThr) { Post.clearMarks(); } this.lastPageOffset = 0; } else if (kc === 0x801B) { el.blur(); } else { var post; var globIdx = this.gKeys.indexOf(kc); switch (globIdx) { case 2: if (postform.form) { post = this.cPost || this._getFirstVisPost(false, true) || Thread.first.op; this.cPost = post; postform.showQuickReply(post, post.num, true, false); post.select(); } break; case 3: post = this._getFirstVisPost(false, true) || this._getNextVisPost(null, true, false); if (post) { post.setUserVisib(!post.isHidden); this._scroll(post, false, post.isOp); } break; case 4: if (AttachedImage.viewer) { AttachedImage.viewer.navigate(false); } else if (isThr || aib.page !== aib.firstPage) { deWindow.location.pathname = aib.getPageUrl(aib.b, isThr ? 0 : aib.page - 1); } break; case 5: if (el !== postform.txta && el !== postform.cap.textEl) { return; } postform.subm.click(); break; case 6: toggleWindow('fav', false); break; case 7: toggleWindow('hid', false); break; case 8: $toggle($id('de-panel-buttons')); break; case 9: toggleCfg('maskImgs').then(function () { return updateCSS(); }); break; case 10: toggleWindow('cfg', false); break; case 11: post = this._getFirstVisPost(false, true) || this._getNextVisPost(null, true, false); if (post) { post.toggleImages(); } break; case 12: if (el !== postform.txta) { return; } $id('de-btn-bold').click(); break; case 13: if (el !== postform.txta) { return; } $id('de-btn-italic').click(); break; case 14: if (el !== postform.txta) { return; } $id('de-btn-strike').click(); break; case 15: if (el !== postform.txta) { return; } $id('de-btn-spoil').click(); break; case 16: if (el !== postform.txta) { return; } $id('de-btn-code').click(); break; case 17: if (AttachedImage.viewer) { AttachedImage.viewer.navigate(true); } else if (!isThr) { var pageNum = DelForm.last.pageNum + 1; if (pageNum <= aib.lastPage) { deWindow.location.pathname = aib.getPageUrl(aib.b, pageNum); } } break; case 18: toggleWindow('vid', false); break; case -1: if (isThr) { idx = this.tKeys.indexOf(kc); if (idx === 0) { updater.forceLoad(null); break; } return; } idx = this.ntKeys.indexOf(kc); if (idx === -1) { return; } else if (idx === 2) { post = this._getFirstVisPost(false, true) || this._getNextVisPost(null, true, false); if (post) { if (typeof GM_openInTab === 'function') { GM_openInTab(aib.getThrUrl(aib.b, post.tNum), false, true); } else { deWindow.open(aib.getThrUrl(aib.b, post.tNum), '_blank'); } } break; } else if (idx === 3) { post = this._getFirstVisPost(false, true) || this._getNextVisPost(null, true, false); if (post) { if (post.thr.loadCount !== 0 && post.thr.op.next.count === 1) { var nextThr = post.thr.nextNotHidden; post.thr.loadPosts(Thread.visPosts, !!nextThr); post = (nextThr || post.thr).op; } else { post.thr.loadPosts('all'); post = post.thr.op; } scrollTo(deWindow.pageXOffset, deWindow.pageYOffset + post.top); if (this.cPost && this.cPost !== post) { this.cPost.unselect(); this.cPost = post; } } break; } default: { var scrollToThr = !isThr && (globIdx === 0 || globIdx === 1); this._scroll(this._getFirstVisPost(scrollToThr, false), globIdx === 0 || idx === 0, scrollToThr); } } } e.preventDefault(); e.stopPropagation(); }, pauseHotKeys: function pauseHotKeys() { this._paused = true; }, readKeys: function readKeys() { var _this24 = this; return _asyncToGenerator( _regeneratorRuntime().mark(function _callee17() { var str, keys, tKeys, mapFunc; return _regeneratorRuntime().wrap(function _callee17$(_context18) { while (1) switch (_context18.prev = _context18.next) { case 0: _context18.next = 2; return getStored('DESU_keys'); case 2: str = _context18.sent; if (str) { _context18.next = 5; break; } return _context18.abrupt("return", _this24.getDefaultKeys()); case 5: try { keys = JSON.parse(str); } catch (err) {} if (keys) { _context18.next = 8; break; } return _context18.abrupt("return", _this24.getDefaultKeys()); case 8: if (keys[0] !== _this24.version) { tKeys = _this24.getDefaultKeys(); switch (keys[0]) { case 1: keys[2][11] = tKeys[2][11]; keys[4] = tKeys[4]; case 2: keys[2][12] = tKeys[2][12]; keys[2][13] = tKeys[2][13]; keys[2][14] = tKeys[2][14]; keys[2][15] = tKeys[2][15]; keys[2][16] = tKeys[2][16]; case 3: keys[2][17] = keys[3][3]; keys[3][3] = keys[3].splice(4, 1)[0]; case 4: case 5: case 6: keys[2][18] = tKeys[2][18]; } keys[0] = _this24.version; setStored('DESU_keys', JSON.stringify(keys)); } if (keys[1] ^ nav.isFirefox) { mapFunc = nav.isFirefox ? function (key) { return key === 189 ? 173 : key === 187 ? 61 : key === 186 ? 59 : key; } : function (key) { return key === 173 ? 189 : key === 61 ? 187 : key === 59 ? 186 : key; }; keys[1] = nav.isFirefox; keys[2] = keys[2].map(mapFunc); keys[3] = keys[3].map(mapFunc); setStored('DESU_keys', JSON.stringify(keys)); } return _context18.abrupt("return", keys); case 11: case "end": return _context18.stop(); } }, _callee17); }))(); }, resume: function resume(keys) { var _keys2 = _slicedToArray(keys, 5); this.gKeys = _keys2[2]; this.ntKeys = _keys2[3]; this.tKeys = _keys2[4]; this._paused = false; }, _paused: false, _getNextVisPost: function _getNextVisPost(cPost, isOp, toUp) { if (isOp) { var thr = cPost ? toUp ? cPost.thr.prevNotHidden : cPost.thr.nextNotHidden : Thread.first.isHidden ? Thread.first.nextNotHidden : Thread.first; return thr ? thr.op : null; } return cPost ? cPost.getAdjacentVisPost(toUp) : Thread.first.isHidden || Thread.first.op.isHidden ? Thread.first.op.getAdjacentVisPost(toUp) : Thread.first.op; }, _getFirstVisPost: function _getFirstVisPost(getThread, getFull) { if (this.lastPageOffset !== deWindow.pageYOffset) { var post = getThread ? Thread.first : Thread.first.op; while (post.top < 1) { var tPost = post.next; if (!tPost) { break; } post = tPost; } if (this.cPost) { this.cPost.unselect(); } this.cPost = getThread ? getFull ? post.op : post.op.prev : getFull ? post : post.prev; this.lastPageOffset = deWindow.pageYOffset; } return this.cPost; }, _scroll: function _scroll(post, toUp, toThread) { var next = this._getNextVisPost(post, toThread, toUp); if (!next) { if (!aib.t) { var pageNum = toUp ? DelForm.first.pageNum - 1 : DelForm.last.pageNum + 1; if (toUp ? pageNum >= aib.firstPage : pageNum <= aib.lastPage) { deWindow.location.pathname = aib.getPageUrl(aib.b, pageNum); } } return; } if (post) { post.unselect(); } if (toThread) { next.el.scrollIntoView(); } else { scrollTo(0, deWindow.pageYOffset + next.el.getBoundingClientRect().top - Post.sizing.wHeight / 2 + next.el.clientHeight / 2); } this.lastPageOffset = deWindow.pageYOffset; next.select(); this.cPost = next; } }; var KeyEditListener = function () { function KeyEditListener(popupEl, keys, allKeys) { _classCallCheck(this, KeyEditListener); this.cEl = null; this.cKey = -1; this.errorInput = false; var aInputs = _toConsumableArray($Q('.de-input-key', popupEl)); for (var i = 0, len = allKeys.length; i < len; ++i) { var k = allKeys[i]; if (k !== 0) { for (var j = i + 1; j < len; ++j) { if (k === allKeys[j]) { aInputs[i].classList.add('de-input-error'); aInputs[j].classList.add('de-input-error'); break; } } } } this.popupEl = popupEl; this.keys = keys; this.initKeys = JSON.parse(JSON.stringify(keys)); this.allKeys = allKeys; this.allInputs = aInputs; this.errCount = $Q('.de-input-error', popupEl).length; if (this.errCount !== 0) { this.saveButton.disabled = true; } } _createClass(KeyEditListener, [{ key: "saveButton", get: function get() { var value = $id('de-keys-save'); Object.defineProperty(this, 'saveButton', { value: value, configurable: true }); return value; } }, { key: "handleEvent", value: function handleEvent(e) { var key; var el = e.target; switch (e.type) { case 'blur': if (HotKeys.enabled && this.errCount === 0) { HotKeys.resume(this.keys); } el.classList.remove('de-input-selected'); this.cEl = null; return; case 'focus': if (HotKeys.enabled) { HotKeys.pauseHotKeys(); } el.classList.add('de-input-selected'); this.cEl = el; return; case 'click': { var keys; if (el.id === 'de-keys-reset') { this.keys = HotKeys.getDefaultKeys(); this.initKeys = HotKeys.getDefaultKeys(); if (HotKeys.enabled) { HotKeys.resume(this.keys); } var _KeyEditListener$getE = KeyEditListener.getEditMarkup(this.keys); var _KeyEditListener$getE2 = _slicedToArray(_KeyEditListener$getE, 2); this.allKeys = _KeyEditListener$getE2[0]; this.popupEl.innerHTML = _KeyEditListener$getE2[1]; this.allInputs = _toConsumableArray($Q('.de-input-key', this.popupEl)); this.errCount = 0; delete this.saveButton; break; } else if (el.id === 'de-keys-save') { keys = this.keys; setStored('DESU_keys', JSON.stringify(keys)); } else if (el.className === 'de-popup-btn') { keys = this.initKeys; } else { return; } if (HotKeys.enabled) { HotKeys.resume(keys); } closePopup('edit-hotkeys'); break; } case 'keydown': { if (!this.cEl) { return; } key = e.keyCode; if (key === 0x1B || key === 0x2E) { this.cEl.value = ''; this.cKey = 0; this.errorInput = false; break; } var keyStr = KeyEditListener.keyCodes[key]; if (typeof keyStr === 'undefined') { this.cKey = -1; return; } var str = ''; if (e.ctrlKey) { str += 'Ctrl+'; } if (e.shiftKey) { str += 'Shift+'; } if (e.altKey) { str += 'Alt+'; } if (key === 16 || key === 17 || key === 18) { this.errorInput = true; this.cKey = 0; } else { this.cKey = key | (e.ctrlKey ? 0x1000 : 0) | (e.shiftKey ? 0x2000 : 0) | (e.altKey ? 0x4000 : 0) | (this.cEl.hasAttribute('de-text') ? 0x8000 : 0); this.errorInput = false; str += keyStr; } this.cEl.value = str; break; } case 'keyup': { el = this.cEl; key = this.cKey; if (!el || key === -1) { return; } var rEl; var isError = el.classList.contains('de-input-error'); if (!this.errorInput && key !== -1) { var idx = this.allInputs.indexOf(el); var oKey = this.allKeys[idx]; if (oKey === key) { this.errorInput = false; break; } var rIdx = key === 0 ? -1 : this.allKeys.indexOf(key); this.allKeys[idx] = key; if (isError) { idx = this.allKeys.indexOf(oKey); if (idx !== -1 && this.allKeys.indexOf(oKey, idx + 1) === -1) { rEl = this.allInputs[idx]; if (rEl.classList.contains('de-input-error')) { this.errCount--; rEl.classList.remove('de-input-error'); } } if (rIdx === -1) { this.errCount--; el.classList.remove('de-input-error'); } } if (rIdx === -1) { this.keys[+el.getAttribute('de-id1')][+el.getAttribute('de-id2')] = key; if (this.errCount === 0) { this.saveButton.disabled = false; } this.errorInput = false; break; } rEl = this.allInputs[rIdx]; if (!rEl.classList.contains('de-input-error')) { this.errCount++; rEl.classList.add('de-input-error'); } } if (!isError) { this.errCount++; el.classList.add('de-input-error'); } if (this.errCount !== 0) { this.saveButton.disabled = true; } } } e.preventDefault(); } }], [{ key: "getEditMarkup", value: function getEditMarkup(keys) { var allKeys = []; return [allKeys, "".concat(Lng.hotKeyEdit[lang].join('').replace(/%l/g, '').replace(/%i([2-4])([0-9]+)(t)?/g, function (all, id1, id2, isText) { var key = keys[+id1][+id2]; allKeys.push(key); return ""); }), "") + "")]; } }, { key: "getStrKey", value: function getStrKey(key) { return (key & 0x1000 ? 'Ctrl+' : '') + (key & 0x2000 ? 'Shift+' : '') + (key & 0x4000 ? 'Alt+' : '') + KeyEditListener.keyCodes[key & 0xFFF]; } }, { key: "setTitle", value: function setTitle(el, idx) { var title = el.getAttribute('de-title'); if (!title) { title = el.getAttribute('title'); el.setAttribute('de-title', title); } if (HotKeys.enabled && idx !== -1) { title += " [".concat(KeyEditListener.getStrKey(HotKeys.gKeys[idx]), "]"); } el.title = title; } }]); return KeyEditListener; }(); KeyEditListener.keyCodes = ['', ,,,,,,, 'Backspace', 'Tab',,,, 'Enter',,, 'Shift', 'Ctrl', 'Alt',,,,,,,,,,,,,, 'Space',,,,, '←', '↑', '→', '↓',,,,,,,, '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',, ';',, '=',,,, 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',,,,,, 'Num 0', 'Num 1', 'Num 2', 'Num 3', 'Num 4', 'Num 5', 'Num 6', 'Num 7', 'Num 8', 'Num 9', 'Num *', 'Num +',, 'Num -', 'Num .', 'Num /',,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, '-',,,,,,,,,,,,, ';', '=', ',', '-', '.', '/', '`',,,,,,,,,,,,,,,,,,,,,,,,,,, '[', '\\', ']', '\'']; var ContentLoader = { afterFn: null, isLoading: false, popupId: null, downloadThread: function downloadThread(imgOnly) { var _this25 = this; var progress, counter; var current = 1; var warnings = ''; var tar = new TarBuilder(); var dc = imgOnly ? doc : doc.documentElement.cloneNode(true); var els = _toConsumableArray($Q(aib.qPostImg, $q('[de-form]', dc))); var count = els.length; var delSymbols = function delSymbols(str) { var r = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; return str.replace(/[\\/:*?"<>|]/g, r); }; this._thrPool = new TasksPool(4, function (num, data) { return _this25.loadImgData(data[0]).then(function (imgData) { var _data3 = _slicedToArray(data, 4), url = _data3[0], fName = _data3[1], el = _data3[2], parentLink = _data3[3]; var safeName = delSymbols(fName, '_'); progress.value = counter.innerHTML = current++; if (parentLink) { var thumbName = safeName.replace(/\.[a-z]+$/, '.png'); if (imgOnly) { thumbName = 'thumb-' + thumbName; } else { thumbName = 'thumbs/' + thumbName; safeName = imgData ? 'images/' + safeName : thumbName; parentLink.href = getImgNameLink(el).href = safeName; } if (imgData) { tar.addFile(safeName, imgData); } else { warnings += "
".concat(Lng.cantLoad[lang], "
").concat(url, "") + "
".concat(Lng.willSavePview[lang]); $popup('err-files', Lng.loadErrors[lang] + warnings); if (imgOnly) { return _this25.getDataFromImg(el).then(function (data) { return tar.addFile(thumbName, data); }, Function.prototype); } } return imgOnly ? null : _this25.getDataFromImg(el).then(function (data) { el.src = thumbName; tar.addFile(thumbName, data); }, function () { return el.src = safeName; }); } else if (imgData !== null && imgData !== void 0 && imgData.length) { tar.addFile(el.href = el.src = 'data/' + safeName, imgData); } else { el.remove(); } }); }, function () { var docName = "".concat(aib.domain, "-").concat(delSymbols(aib.b), "-").concat(aib.t); if (!imgOnly) { $q('head', dc).insertAdjacentHTML('beforeend', ''); var dcBody = $q('body', dc); dcBody.classList.remove('de-runned'); dcBody.classList.add('de-mode-local'); $delAll('#de-css, #de-css-dynamic, #de-css-user', dc); tar.addString('data/dollscript.js', "".concat(nav.isESNext ? "(".concat(String(deMainFuncInner), ")(window, null, null, (x, y) => window.scrollTo(x, y), ") : "(".concat(String( deMainFuncOuter), ")(")).concat(JSON.stringify({ domain: aib.domain, b: aib.b, t: aib.t }), ");")); var dt = doc.doctype; tar.addString(docName + '.html', '' + dc.outerHTML); } var title = delSymbols(Thread.first.op.title.trim()); downloadBlob(tar.get(), "".concat(docName).concat(imgOnly ? '-images' : '').concat(title ? ' - ' + title : '', ".tar")); closePopup('load-files'); _this25._thrPool = tar = warnings = count = current = imgOnly = progress = counter = null; }); els.forEach(function (el) { var parentLink = el.closest('a'); if (parentLink) { var url = parentLink.href; _this25._thrPool.runTask([url, parentLink.getAttribute('download') || getFileName(url), el, parentLink]); } }); if (!imgOnly) { $delAll('.de-btn-img, #de-main, .de-parea, .de-post-btns, .de-refmap, .de-thr-buttons, ' + '.de-video-obj, #de-win-reply, link[rel="alternate stylesheet"], script, ' + aib.qForm, dc); $Q('a', dc).forEach(function (el) { var num; var tc = el.textContent; if (tc[0] === '>' && tc[1] === '>' && (num = parseInt(tc.substr(2), 10)) && pByNum.has(num)) { el.href = aib.anchor + num; if (!el.classList.contains('de-link-postref')) { el.className = 'de-link-postref ' + el.className; } } else { el.href = aib.getAbsLink(el.href); } }); $Q(aib.qPost, dc).forEach(function (el, i) { return el.setAttribute('de-num', i ? aib.getPNum(el) : aib.t); }); var files = []; var urlRegex = new RegExp("^\\/\\/?|^https?:\\/\\/([^\\/]*\\.)?".concat(escapeRegExp(aib._4chan ? '4cdn.org' : aib.domain), "\\/"), 'i'); $Q('link, *[src]', dc).forEach(function (el) { if (els.indexOf(el) !== -1) { return; } var url = el.tagName.toLowerCase() === 'link' ? el.href : el.src; if (!urlRegex.test(url)) { el.remove(); return; } var fName = delSymbols(getFileName(url).replace(/(#|\?).*?$/, ''), '_').toLowerCase(); if (files.indexOf(fName) !== -1) { var temp = url.lastIndexOf('.'); var ext = url.substring(temp); url = url.substring(0, temp); fName = cutFileExt(fName); for (var i = 0;; ++i) { temp = "".concat(fName, "(").concat(i, ")").concat(ext); if (files.indexOf(temp) === -1) { break; } } fName = temp; } files.push(fName); _this25._thrPool.runTask([url, fName, el, null]); count++; }); } $popup('load-files', "".concat(imgOnly ? Lng.loadImage[lang] : Lng.loadFile[lang], ":
1/").concat(count), true); progress = $id('de-loadprogress'); counter = progress.nextElementSibling; this._thrPool.completeTasks(); els = null; }, getDataFromCanvas: function getDataFromCanvas(el) { return new Uint8Array(atob(el.toDataURL('image/png').split(',')[1]).split('').map(function (a) { return a.charCodeAt(); })); }, getDataFromImg: function getDataFromImg(el) { if (el.getAttribute('loading') === 'lazy') { return this.loadImgData(el.src); } try { var cnv = this._canvas || (this._canvas = doc.createElement('canvas')); cnv.width = el.width || el.videoWidth; cnv.height = el.height || el.videoHeight; cnv.getContext('2d').drawImage(el, 0, 0); return Promise.resolve(this.getDataFromCanvas(cnv)); } catch (err) { return this.loadImgData(el.src); } }, loadImgData: function loadImgData(url) { var repeatOnError = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; return $ajax(url, { responseType: 'arraybuffer' }, !url.startsWith('blob')).then(function (xhr) { if ('response' in xhr) { try { return nav.getUnsafeUint8Array(xhr.response); } catch (err) {} } var txt = xhr.responseText; return new Uint8Array(txt.length).map(function (val, i) { return txt.charCodeAt(i) & 0xFF; }); }, function (err) { return err.code !== 404 && repeatOnError ? ContentLoader.loadImgData(url, false) : null; }); }, preloadImages: function preloadImages(data) { var _this26 = this; if (!Cfg.preLoadImgs && !Cfg.openImgs && !isPreImg) { return; } var preloadPool; var isPost = data instanceof AbstractPost; var els = $Q(aib.qPostImg, isPost ? data.el : data); var len = els.length; if (isPreImg || Cfg.preLoadImgs) { var cImg = 1; var mReqs = isPost ? 1 : 4; var rarJpgFinder = (isPreImg || Cfg.findImgFile) && new WorkerPool(mReqs, this._detectImgFile, function (err) { return console.error('File detector error:', "line: ".concat(err.lineno, " - ").concat(err.message)); }); preloadPool = new TasksPool(mReqs, function (num, data) { return _this26.loadImgData(data[0]).then(function (imageData) { var _data4 = _slicedToArray(data, 6), url = _data4[0], parentLink = _data4[1], iType = _data4[2], isRepToOrig = _data4[3], el = _data4[4], isVideo = _data4[5]; if (imageData) { var fName = decodeURIComponent(getFileName(url)); var nameLink = getImgNameLink(el); parentLink.setAttribute('download', fName); if (!Cfg.imgNames) { nameLink.setAttribute('download', fName); nameLink.setAttribute('de-href', nameLink.href); } parentLink.href = nameLink.href = deWindow.URL.createObjectURL(new Blob([imageData], { type: iType })); if (isVideo) { el.setAttribute('de-video', ''); } if (isRepToOrig) { el.src = parentLink.href; } if (rarJpgFinder) { rarJpgFinder.runWorker(imageData.buffer, [imageData.buffer], function (info) { return _this26._addImgFileIcon(nameLink, fName, info); }); } } if (_this26.popupId) { $popup(_this26.popupId, "".concat(Lng.loadImage[lang], ": ").concat(cImg, "/").concat(len), true); } cImg++; }); }, function () { _this26.isLoading = false; if (_this26.afterFn) { _this26.afterFn(); _this26.afterFn = _this26.popupId = null; } if (rarJpgFinder) { rarJpgFinder.clearWorkers(); } }); this.isLoading = true; } for (var i = 0; i < len; ++i) { var imgEl = els[i]; var parentLink = imgEl.closest('a'); if (!parentLink) { continue; } var isRepToOrig = !!Cfg.openImgs; var url = aib.getImgSrcLink(imgEl).getAttribute('href'); var type = getFileMime(url); var isVideo = type && (type === 'video/webm' || type === 'video/mp4' || type === 'video/quicktime' || type === 'video/ogv'); if (!type || isVideo && Cfg.preLoadImgs === 2) { continue; } else if ($q('img[src*="/spoiler"]', parentLink)) { isRepToOrig = false; } else if (type === 'image/gif') { isRepToOrig &= Cfg.openImgs !== 3; } else { if (isVideo) { isRepToOrig = false; } isRepToOrig &= Cfg.openImgs !== 2; } if (preloadPool) { preloadPool.runTask([url, parentLink, type, isRepToOrig, imgEl, isVideo]); } else if (isRepToOrig) { imgEl.src = url; } } if (preloadPool) { preloadPool.completeTasks(); } }, _canvas: null, _thrPool: null, _addImgFileIcon: function _addImgFileIcon(nameLink, fName, info) { var type = info.type; if (typeof type === 'undefined') { return; } var ext = ['7z', 'zip', 'rar', 'ogg', 'mp3'][type]; nameLink.insertAdjacentHTML('afterend', " 2 ? 'audio' : 'arch', "\" title=\"").concat(Lng.downloadFile[lang], "\" download=\"").concat(cutFileExt(fName), ".").concat(ext, "\">.").concat(ext, "")); }, _detectImgFile: function _detectImgFile(arrBuf) { var i, j; var dat = new Uint8Array(arrBuf); var len = dat.length; if (dat[0] === 0xFF && dat[1] === 0xD8) { for (i = 0, j = 0; i < len - 1; ++i) { if (dat[i] === 0xFF) { if (dat[i + 1] === 0xD8) { j++; } else if (dat[i + 1] === 0xD9 && --j === 0) { i += 2; break; } } } } else if (dat[0] === 0x89 && dat[1] === 0x50) { for (i = 0; i < len - 7; ++i) { if (dat[i] === 0x49 && dat[i + 1] === 0x45 && dat[i + 2] === 0x4E && dat[i + 3] === 0x44) { i += 8; break; } } } else { return {}; } if (i === len || len - i <= 60) { return {}; } for (len = i + 90; i < len; ++i) { if (dat[i] === 0x37 && dat[i + 1] === 0x7A && dat[i + 2] === 0xBC) { return { type: 0, idx: i, data: arrBuf }; } else if (dat[i] === 0x50 && dat[i + 1] === 0x4B && dat[i + 2] === 0x03) { return { type: 1, idx: i, data: arrBuf }; } else if (dat[i] === 0x52 && dat[i + 1] === 0x61 && dat[i + 2] === 0x72) { return { type: 2, idx: i, data: arrBuf }; } else if (dat[i] === 0x4F && dat[i + 1] === 0x67 && dat[i + 2] === 0x67) { return { type: 3, idx: i, data: arrBuf }; } else if (dat[i] === 0x49 && dat[i + 1] === 0x44 && dat[i + 2] === 0x33) { return { type: 4, idx: i, data: arrBuf }; } } return {}; } }; var DateTime = function () { function DateTime(pattern, rPattern, diff, dtLang, onRPat) { _classCallCheck(this, DateTime); this.pad2 = pad2; this.genDateTime = null; this.onRPat = null; if (DateTime.checkPattern(pattern)) { this.disabled = true; return; } this.regex = pattern.replace(/(?:[sihdny]\?){2,}/g, function (str) { return "(?:".concat(str.replace(/\?/g, ''), ")?"); }).replace(/-/g, '[^<]').replace(/\+/g, '[^0-9<]').replace(/([sihdny]+)/g, '($1)').replace(/[sihdny]/g, '\\d').replace(/m|w/g, '([a-zA-Zа-яА-Я]+)'); this.pattern = pattern.replace(/[?\-+]+/g, '').replace(/([a-z])\1+/g, '$1'); this.diff = parseInt(diff, 10); this.arrW = Lng.week[dtLang]; this.arrM = Lng.month[dtLang]; this.arrFM = Lng.fullMonth[dtLang]; if (rPattern) { this.genDateTime = this.genRFunc(rPattern); } else { this.onRPat = onRPat; } } _createClass(DateTime, [{ key: "genRFunc", value: function genRFunc(rPattern) { var _this27 = this; return function (dtime) { return rPattern.replace('_o', (_this27.diff < 0 ? '' : '+') + _this27.diff).replace('_s', function () { return _this27.pad2(dtime.getSeconds()); }).replace('_i', function () { return _this27.pad2(dtime.getMinutes()); }).replace('_h', function () { return _this27.pad2(dtime.getHours()); }).replace('_d', function () { return _this27.pad2(dtime.getDate()); }).replace('_w', function () { return _this27.arrW[dtime.getDay()]; }).replace('_n', function () { return _this27.pad2(dtime.getMonth() + 1); }).replace('_m', function () { return _this27.arrM[dtime.getMonth()]; }).replace('_M', function () { return _this27.arrFM[dtime.getMonth()]; }).replace('_y', function () { return ('' + dtime.getFullYear()).substring(2); }).replace('_Y', function () { return dtime.getFullYear(); }); }; } }, { key: "getRPattern", value: function getRPattern(txt) { var m = txt.match(new RegExp(this.regex)); if (!m) { this.disabled = true; return false; } var rPattern = ''; for (var i = 1, len = m.length, j = 0, str = m[0]; i < len;) { var a = m[i++]; if (!a) { continue; } var p = this.pattern[i - 2]; if ((p === 'm' || p === 'y') && a.length > 3) { p = p.toUpperCase(); } var k = str.indexOf(a, j); rPattern += str.substring(j, k) + '_' + p; j = k + a.length; } if (this.onRPat) { this.onRPat(rPattern); } this.genDateTime = this.genRFunc(rPattern); return true; } }, { key: "fix", value: function fix(txt) { var _this28 = this; if (this.disabled || !this.genDateTime && !this.getRPattern(txt)) { return txt; } return txt.replace(new RegExp(this.regex, 'g'), function (str) { var second, minute, hour, day, month, year; for (var i = 0; i < 7; ++i) { var a = i + 1 < 1 || arguments.length <= i + 1 ? undefined : arguments[i + 1]; switch (_this28.pattern[i]) { case 's': second = a; break; case 'i': minute = a; break; case 'h': hour = a; break; case 'd': day = a; break; case 'n': month = a - 1; break; case 'y': year = a; break; case 'm': month = Lng.monthDict[a.slice(0, 3).toLowerCase()] || 0; break; } } var dtime = new Date(year.length === 2 ? '20' + year : year, month, day, hour, minute, second || 0); dtime.setHours(dtime.getHours() + _this28.diff); return _this28.genDateTime(dtime); }); } }], [{ key: "checkPattern", value: function checkPattern(val) { return !val.includes('i') || !val.includes('h') || !val.includes('d') || !val.includes('y') || !(val.includes('n') || val.includes('m')) || /[^?\-+sihdmwny]|mm|ww|\?\?|([ihdny]\?)\1+/.test(val); } }, { key: "toggleSettings", value: function () { var _toggleSettings = _asyncToGenerator( _regeneratorRuntime().mark(function _callee18(el) { return _regeneratorRuntime().wrap(function _callee18$(_context19) { while (1) switch (_context19.prev = _context19.next) { case 0: if (!(el.checked && (!/^[+-]\d{1,2}$/.test(Cfg.timeOffset) || DateTime.checkPattern(Cfg.timePattern)))) { _context19.next = 5; break; } $popup('err-correcttime', Lng.cTimeError[lang]); _context19.next = 4; return CfgSaver.save('correctTime', 0); case 4: el.checked = false; case 5: case "end": return _context19.stop(); } }, _callee18); })); function toggleSettings(_x13) { return _toggleSettings.apply(this, arguments); } return toggleSettings; }() }]); return DateTime; }(); var Videos = function () { function Videos(post) { var player = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; var playerInfo = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; _classCallCheck(this, Videos); this.currentLink = null; this.hasLinks = false; this.linksCount = 0; this.loadedLinksCount = 0; this.playerInfo = null; this.post = post; this.titleLoadFn = null; this.vData = [[], []]; if (player && playerInfo) { Object.defineProperty(this, 'player', { value: player }); this.playerInfo = playerInfo; } } _createClass(Videos, [{ key: "player", get: function get() { var post = this.post; var value = $bBegin(post.msg, "
")); Object.defineProperty(this, 'player', { value: value }); return value; } }, { key: "addLink", value: function addLink(m, loader, link, isYtube) { this.hasLinks = true; this.linksCount++; if (this.playerInfo === null) { if (Cfg.embedYTube === 1) { this._addThumb(m, isYtube); } } else if (!link && $q(".de-video-link[href*=\"".concat(m[1], "\"]"), this.post.msg)) { return; } var dataObj; if (loader && (dataObj = Videos._global.vData[+!isYtube][m[1]])) { this.vData[+!isYtube].push(dataObj); } var time = ''; var _Videos$_fixTime = Videos._fixTime(m[4], m[3], m[2]); var _Videos$_fixTime2 = _slicedToArray(_Videos$_fixTime, 4); time = _Videos$_fixTime2[0]; m[2] = _Videos$_fixTime2[1]; m[3] = _Videos$_fixTime2[2]; m[4] = _Videos$_fixTime2[3]; if (link) { link.href = link.href.replace(/^http:/, 'https:'); if (time) { link.setAttribute('de-time', time); } link.className = "de-video-link ".concat(isYtube ? 'de-ytube' : 'de-vimeo'); } else { var src = isYtube ? "".concat(aib.protocol, "//www.youtube.com/watch?v=").concat(m[1]).concat(time ? '#t=' + time : '') : "".concat(aib.protocol, "//vimeo.com/").concat(m[1]); link = $bEnd(this.post.msg, "

").concat(dataObj ? '' : src, "

")).firstChild; } if (dataObj) { Videos.setLinkData(link, dataObj); } if (this.playerInfo === null || this.playerInfo === m) { this.currentLink = link; } link.videoInfo = m; var vidListEl; if (Panel.isVidEnabled && (vidListEl = $id('de-video-list'))) { updateVideoList(vidListEl, link, this.post.num); } if (loader && !dataObj) { loader.runTask([link, isYtube, this, m[1]]); } } }, { key: "clickLink", value: function clickLink(el, mode) { var m = el.videoInfo; if (this.playerInfo !== m) { this.currentLink.classList.remove('de-current'); this.currentLink = el; if (mode === 1) { this._addThumb(m, el.classList.contains('de-ytube')); } else { el.classList.add('de-current'); this.setPlayer(m, el.classList.contains('de-ytube')); } return; } if (mode === 1) { if ($q('.de-video-thumb', this.player)) { el.classList.add('de-current'); this.setPlayer(m, el.classList.contains('de-ytube')); } else { el.classList.remove('de-current'); this._addThumb(m, el.classList.contains('de-ytube')); } } else { el.classList.remove('de-current'); $hide(this.player); this.player.innerHTML = ''; this.playerInfo = null; } } }, { key: "setPlayer", value: function setPlayer(m, isYtube) { Videos.addPlayer(this, m, isYtube); } }, { key: "toggleFloatedThumb", value: function toggleFloatedThumb(linkEl, isOutEvent) { var el = $id('de-video-thumb-floated'); if (isOutEvent) { el.remove(); return; } if (!el) { el = $bEnd(doc.body, "")); } var cr = linkEl.getBoundingClientRect(); var pvHeight = Cfg.YTubeHeigh; var isTop = cr.top + cr.height + pvHeight < nav.viewportHeight(); el.style.cssText = "position: absolute; left: ".concat(deWindow.pageXOffset + cr.left, "px; top: ").concat(deWindow.pageYOffset + (isTop ? cr.top + cr.height : cr.top - pvHeight), "px; width: ").concat(Cfg.YTubeWidth, "px; height: ").concat(pvHeight, "px; z-index: 9999;"); } }, { key: "updatePost", value: function updatePost(oldLinks, newLinks, cloned) { var loader = !cloned && Videos._getTitlesLoader(); var j = 0; for (var i = 0, len = newLinks.length; i < len; ++i) { var el = newLinks[i]; var link = oldLinks[j]; if (link !== null && link !== void 0 && link.classList.contains('de-current')) { this.currentLink = el; } if (cloned) { el.videoInfo = link.videoInfo; j++; } else { var m = el.href.match(Videos.ytReg); if (m) { this.addLink(m, loader, el, true); j++; } } } this.currentLink = this.currentLink || newLinks[0]; if (loader) { loader.completeTasks(); } } }, { key: "_addThumb", value: function _addThumb(m, isYtube) { var el = this.player; this.playerInfo = m; el.classList.remove('de-video-expanded'); $show(el); var str = "") + ""); return; } el.innerHTML = "".concat(str, "//vimeo.com/").concat(m[1], "\" target=\"_blank\">") + ''; $ajax("".concat(aib.protocol, "//vimeo.com/api/v2/video/").concat(m[1], ".json"), null, true).then(function (xhr) { el.firstChild.firstChild.setAttribute('src', JSON.parse(xhr.responseText)[0].thumbnail_large); })["catch"](Function.prototype); } }], [{ key: "addPlayer", value: function addPlayer(obj, m, isYtube) { var enableJsapi = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; var el = obj.player; obj.playerInfo = m; var txt; if (isYtube) { var list = m[0].match(/list=[^&#]+/); txt = "'; } else { var id = m[1] + (m[2] ? m[2] : ''); txt = ""); } el.innerHTML = txt + (enableJsapi ? '' : "")); $show(el); if (!enableJsapi) { el.lastChild.onclick = function (e) { return e.target.parentNode.classList.toggle('de-video-expanded'); }; } } }, { key: "setLinkData", value: function setLinkData(link, data) { var isCloned = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; var _data5 = _slicedToArray(data, 5), title = _data5[0], author = _data5[1], views = _data5[2], publ = _data5[3], duration = _data5[4]; if (Panel.isVidEnabled && !isCloned) { var clonedLink = $q(".de-entry > .de-video-link[href=\"".concat(link.href, "\"]:not(title)")); if (clonedLink) { Videos.setLinkData(clonedLink, data, true); } } link.textContent = title; link.classList.add('de-video-title'); link.setAttribute('de-author', author); link.title = (duration ? Lng.duration[lang] + duration : '') + (publ ? ", ".concat(Lng.published[lang] + publ, "\n") : '') + Lng.author[lang] + author + (views ? ', ' + Lng.views[lang] + views : ''); } }, { key: "_fixTime", value: function _fixTime() { var seconds = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; var minutes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; var hours = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; if (seconds >= 60) { minutes += Math.floor(seconds / 60); seconds %= 60; } if (minutes >= 60) { hours += Math.floor(seconds / 60); minutes %= 60; } return [(hours ? hours + 'h' : '') + (minutes ? minutes + 'm' : '') + (seconds ? seconds + 's' : ''), hours, minutes, seconds]; } }, { key: "_getTitlesLoader", value: function _getTitlesLoader() { return Cfg.YTubeTitles && new TasksPool(4, function (num, info) { var _info5 = _slicedToArray(info, 4), isYtube = _info5[1], id = _info5[3]; if (isYtube) { return Cfg.ytApiKey ? Videos._getYTInfoAPI(info, num, id) : Videos._getYTInfoOembed(info, num, id); } return $ajax("".concat(aib.protocol, "//vimeo.com/api/v2/video/").concat(id, ".json"), null, true).then(function (xhr) { var entry = JSON.parse(xhr.responseText)[0]; return Videos._titlesLoaderHelper(info, num, entry.title, entry.user_name, entry.stats_number_of_plays, /(.*)\s(.*)?/.exec(entry.upload_date)[1], Videos._fixTime(entry.duration)[0]); })["catch"](function () { return Videos._titlesLoaderHelper(info, num); }); }, function () { return sesStorage['de-videos-data2'] = JSON.stringify(Videos._global.vData); }); } }, { key: "_getYTInfoAPI", value: function _getYTInfoAPI(info, num, id) { return $ajax("https://www.googleapis.com/youtube/v3/videos?key=".concat(Cfg.ytApiKey, "&id=").concat(id) + '&part=snippet,statistics,contentDetails&fields=items/snippet/title,items/snippet/publishedAt,' + 'items/snippet/channelTitle,items/statistics/viewCount,items/contentDetails/duration', null, true).then(function (xhr) { var items = JSON.parse(xhr.responseText).items[0]; return Videos._titlesLoaderHelper(info, num, items.snippet.title, items.snippet.channelTitle, items.statistics.viewCount, items.snippet.publishedAt.substr(0, 10), items.contentDetails.duration.substr(2).toLowerCase()); })["catch"](function () { return Videos._getYTInfoOembed(info, num, id); }); } }, { key: "_getYTInfoOembed", value: function _getYTInfoOembed(info, num, id) { var canSendCORS = nav.hasGMXHR || nav.canUseFetch; return (canSendCORS ? $ajax("https://www.youtube.com/oembed?url=http%3A//youtube.com/watch%3Fv%3D".concat(id, "&format=json"), null, true) : $ajax("https://noembed.com/embed?url=http%3A//youtube.com/watch%3Fv%3D".concat(id, "&callback=?"))).then(function (xhr) { var res = xhr.responseText; var json = JSON.parse(canSendCORS ? res : res.replace(/^[^{]+|\)$/g, '')); return Videos._titlesLoaderHelper(info, num, json.title, json.author_name, null, null, null); })["catch"](function () { return Videos._titlesLoaderHelper(info, num); }); } }, { key: "_titlesLoaderHelper", value: function _titlesLoaderHelper(_ref13, num) { var _ref14 = _slicedToArray(_ref13, 4), link = _ref14[0], isYtube = _ref14[1], videoObj = _ref14[2], id = _ref14[3]; for (var _len4 = arguments.length, data = new Array(_len4 > 2 ? _len4 - 2 : 0), _key3 = 2; _key3 < _len4; _key3++) { data[_key3 - 2] = arguments[_key3]; } if (data.length) { Videos.setLinkData(link, data); Videos._global.vData[+!isYtube][id] = data; videoObj.vData[+!isYtube].push(data); if (videoObj.titleLoadFn) { videoObj.titleLoadFn(data); } } videoObj.loadedLinksCount++; if (num % 30 === 0) { return Promise.reject(new TasksPool.PauseError(3e3)); } return new Promise(function (resolve) { return setTimeout(resolve, 250); }); } }]); return Videos; }(); Videos.ytReg = /^https?:\/\/(?:www\.|m\.)?youtu(?:be\.com\/(?:watch\?.*?v=|v\/|embed\/)|\.be\/)([a-zA-Z0-9-_]+).*?(?:t(?:ime)?=(?:(\d+)h)?(?:(\d+)m)?(?:(\d+)s?)?)?$/; Videos.vimReg = /^https?:\/\/(?:www\.)?vimeo\.com\/(?:[^?]+\?clip_id=|.*?\/)?(\d+).*?(#t=\d+)?$/; Videos._global = { get vData() { var value; try { value = Cfg.YTubeTitles ? JSON.parse(sesStorage['de-videos-data2'] || '[{}, {}]') : [{}, {}]; } catch (err) { value = [{}, {}]; } Object.defineProperty(this, 'vData', { value: value }); return value; } }; var VideosParser = function () { function VideosParser() { _classCallCheck(this, VideosParser); this._loader = Videos._getTitlesLoader(); } _createClass(VideosParser, [{ key: "endParser", value: function endParser() { if (this._loader) { this._loader.completeTasks(); } } }, { key: "parse", value: function parse(data) { var isPost = data instanceof AbstractPost; var loader = this._loader; VideosParser._parserHelper('a[href*="youtu"]', data, loader, isPost, true, Videos.ytReg); if (Cfg.addVimeo) { VideosParser._parserHelper('a[href*="vimeo.com"]', data, loader, isPost, false, Videos.vimReg); } var vids = aib.fixVideo(isPost, data); for (var i = 0, len = vids.length; i < len; ++i) { var _vids$i = _slicedToArray(vids[i], 3), post = _vids$i[0], m = _vids$i[1], isYtube = _vids$i[2]; if (post) { post.videos.addLink(m, loader, null, isYtube); } } return this; } }], [{ key: "_parserHelper", value: function _parserHelper(qPath, data, loader, isPost, isYtube, reg) { var links = $Q(qPath, isPost ? data.el : data); for (var i = 0, len = links.length; i < len; ++i) { var link = links[i]; var m = link.href.match(reg); if (m) { var mPost = isPost ? data : aib.getPostOfEl(link); if (mPost) { mPost.videos.addLink(m, loader, link, isYtube); } } } } }]); return VideosParser; }(); function embedAudioLinks(data) { var isPost = data instanceof AbstractPost; if (Cfg.addMP3) { var els = $Q('a[href*=".mp3"], a[href*=".opus"]', isPost ? data.el : data); for (var i = 0, len = els.length; i < len; ++i) { var link = els[i]; if (link.target !== '_blank' && link.rel !== 'nofollow' || !link.pathname.includes('.mp3') && !link.pathname.includes('.opus')) { continue; } var src = link.href; var el = (isPost ? data : aib.getPostOfEl(link)).mp3Obj; if (nav.canPlayMP3) { if (!$q("audio[src=\"".concat(src, "\"]"), el)) { el.insertAdjacentHTML('beforeend', "

")); } } else if (!$q("object[FlashVars*=\"".concat(src, "\"]"), el)) { el.insertAdjacentHTML('beforeend', '
")); } } } if (Cfg.addVocaroo) { $Q('a[href*="voca.ro"], a[href*="vocaroo.com"]', isPost ? data.el : data).forEach(function (link) { var _link$previousSibling; if (!(((_link$previousSibling = link.previousSibling) === null || _link$previousSibling === void 0 ? void 0 : _link$previousSibling.className) === 'de-vocaroo')) { link.insertAdjacentHTML('beforebegin', "")); } }); } } function $ajax(url) { var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; var isCORS = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; var resolve, reject, cancelFn; var needTO = params ? params.useTimeout : false; var WAITING_TIME = 5e3; if (nav.canUseFetch && ((isCORS ? !nav.hasGMXHR : !nav.canUseNativeXHR) || aib.hasRefererErr) && !(isCORS && nav.isTampermonkey)) { if (!params) { params = {}; } params.referrer = doc.referrer.startsWith(aib.protocol + '//' + aib.host) ? doc.referrer : deWindow.location; params.referrerPolicy = 'unsafe-url'; if (params.data) { params.body = params.data; delete params.data; } if (isCORS) { params.mode = 'cors'; } var controller = new AbortController(); params.signal = controller.signal; var loadTO = needTO && setTimeout(function () { reject(AjaxError.Timeout); try { controller.abort(); } catch (err) {} }, WAITING_TIME); cancelFn = function cancelFn() { if (needTO) { clearTimeout(loadTO); } controller.abort(); }; fetch(aib.getAbsLink(url), params).then( function () { var _ref15 = _asyncToGenerator( _regeneratorRuntime().mark(function _callee19(res) { return _regeneratorRuntime().wrap(function _callee19$(_context20) { while (1) switch (_context20.prev = _context20.next) { case 0: if (aib.isAjaxStatusOK(res.status)) { _context20.next = 3; break; } reject(new AjaxError(res.status, res.statusText)); return _context20.abrupt("return"); case 3: _context20.t0 = params.responseType; _context20.next = _context20.t0 === 'arraybuffer' ? 6 : _context20.t0 === 'blob' ? 10 : 14; break; case 6: _context20.next = 8; return res.arrayBuffer(); case 8: res.response = _context20.sent; return _context20.abrupt("break", 17); case 10: _context20.next = 12; return res.blob(); case 12: res.response = _context20.sent; return _context20.abrupt("break", 17); case 14: _context20.next = 16; return res.text(); case 16: res.responseText = _context20.sent; case 17: resolve(res); case 18: case "end": return _context20.stop(); } }, _callee19); })); return function (_x14) { return _ref15.apply(this, arguments); }; }())["catch"](function (err) { return reject(getErrorMessage(err)); }); } else if ((isCORS || !nav.canUseNativeXHR) && nav.hasGMXHR) { var _params; var gmxhr; var timeoutFn = function timeoutFn() { reject(AjaxError.Timeout); try { gmxhr.abort(); } catch (err) {} }; var _loadTO = needTO && setTimeout(timeoutFn, WAITING_TIME); var newParams = { method: ((_params = params) === null || _params === void 0 ? void 0 : _params.method) || 'GET', url: nav.isSafari ? aib.getAbsLink(url) : url, onreadystatechange: function onreadystatechange(e) { if (needTO) { clearTimeout(_loadTO); } if (e.readyState === 4 && !( nav.isViolentmonkey && e.status === 200 && typeof e.responseText === 'undefined' && typeof e.response === 'undefined')) { if (aib.isAjaxStatusOK(e.status)) { resolve(e); } else { reject(new AjaxError(e.status, e.statusText)); } } else if (needTO) { _loadTO = setTimeout(timeoutFn, WAITING_TIME); } } }; if (params) { if (params.onprogress) { newParams.upload = { onprogress: params.onprogress }; delete params.onprogress; } delete params.method; Object.assign(newParams, params); } if (nav.hasNewGM) { GM.xmlHttpRequest(newParams); cancelFn = Function.prototype; } else { gmxhr = GM_xmlhttpRequest(newParams); cancelFn = function cancelFn() { if (needTO) { clearTimeout(_loadTO); } try { gmxhr.abort(); } catch (err) {} }; } } else if (nav.canUseNativeXHR) { var _params2; var xhr = new XMLHttpRequest(); var _timeoutFn = function _timeoutFn() { reject(AjaxError.Timeout); xhr.abort(); }; var _loadTO2 = needTO && setTimeout(_timeoutFn, WAITING_TIME); if ((_params2 = params) !== null && _params2 !== void 0 && _params2.onprogress) { xhr.upload.onprogress = params.onprogress; } if (aib._4chan) { xhr.withCredentials = true; } xhr.onreadystatechange = function (_ref16) { var target = _ref16.target; if (needTO) { clearTimeout(_loadTO2); } if (target.readyState === 4) { if (aib.isAjaxStatusOK(target.status)) { resolve(target); } else { reject(new AjaxError(target.status, target.statusText)); } } else if (needTO) { _loadTO2 = setTimeout(_timeoutFn, WAITING_TIME); } }; try { var _params3, _params5; xhr.open(((_params3 = params) === null || _params3 === void 0 ? void 0 : _params3.method) || 'GET', aib.getAbsLink(url), true); if (params) { if (params.responseType) { xhr.responseType = params.responseType; } var _params4 = params, headers = _params4.headers; if (headers) { for (var header in headers) { if ($hasProp(headers, header)) { xhr.setRequestHeader(header, headers[header]); } } } } xhr.send(((_params5 = params) === null || _params5 === void 0 ? void 0 : _params5.data) || null); cancelFn = function cancelFn() { if (needTO) { clearTimeout(_loadTO2); } xhr.abort(); }; } catch (err) { clearTimeout(_loadTO2); nav.canUseNativeXHR = false; return $ajax(url, params); } } else { reject(new AjaxError(0, 'Ajax error: Canʼt send any type of request.')); } return new CancelablePromise(function (res, rej) { resolve = res; reject = rej; }, cancelFn); } var AjaxError = function () { function AjaxError(code, message) { _classCallCheck(this, AjaxError); this.code = code; this.message = message; } _createClass(AjaxError, [{ key: "toString", value: function toString() { return this.code <= 0 ? String(this.message || Lng.noConnect[lang]) : "HTTP [".concat(this.code, "] ").concat(this.message); } }]); return AjaxError; }(); AjaxError.Success = new AjaxError(200, 'OK'); AjaxError.Locked = new AjaxError(-1, { toString: function toString() { return Lng.thrClosed[lang]; } }); AjaxError.Timeout = new AjaxError(0, { toString: function toString() { return Lng.noConnect[lang] + ' (timeout)'; } }); var AjaxCache = { clearCache: function clearCache() { this._data = new Map(); }, fixURL: function fixURL(url) { return "".concat(url).concat(url.includes('?') ? '&' : '?', "nocache=").concat(Math.round(Math.random() * 1e12)); }, runCachedAjax: function runCachedAjax(url, useCache) { var _this29 = this; var _ref17 = this._data.get(url) || {}, hasCacheControl = _ref17.hasCacheControl, params = _ref17.params; var ajaxURL = hasCacheControl === false ? this.fixURL(url) : url; return $ajax(ajaxURL, useCache && params || { useTimeout: true }, aib._4chan).then(function (xhr) { return _this29.saveData(url, xhr) ? xhr : $ajax(_this29.fixURL(url), useCache && params, aib._4chan); }); }, saveData: function saveData(url, xhr) { var ETag = null; var LastModified = null; var i = 0; var hasCacheControl = false; var headers = 'getAllResponseHeaders' in xhr ? xhr.getAllResponseHeaders() : xhr.responseHeaders; headers = headers ? headers.split('\r\n') : xhr.headers; for (var idx in headers) { if (!$hasProp(headers, idx)) { continue; } var header = headers[idx]; if (typeof header === 'string') { var сIdx = header.indexOf(':'); if (сIdx === -1) { continue; } var name = header.substring(0, сIdx); var value = header.substring(сIdx + 2, header.length); header = [name, value]; } var hName = header[0].toLowerCase(); var matched = true; switch (hName) { case 'cache-control': hasCacheControl = true; break; case 'last-modified': LastModified = header[1]; break; case 'etag': ETag = header[1]; break; default: matched = false; } if (matched && ++i === 3) { break; } } headers = null; if (ETag || LastModified) { headers = {}; if (ETag) { headers['If-None-Match'] = ETag; } if (LastModified) { headers['If-Modified-Since'] = LastModified; } } var hasUrl = this._data.has(url); this._data.set(url, { hasCacheControl: hasCacheControl, params: headers ? { headers: headers, useTimeout: true } : { useTimeout: true } }); return hasUrl || hasCacheControl; }, _data: new Map() }; function getAjaxResponseEl(text, needForm) { return !text.includes('') ? null : needForm ? $q(aib.qDelForm, $createDoc(text)) : $createDoc(text); } function ajaxLoad(url) { var needForm = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; var useCache = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; var checkArch = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; return AjaxCache.runCachedAjax(url, useCache).then(function (xhr) { var fnResult = function fnResult(el) { return !el ? CancelablePromise.reject(new AjaxError(0, Lng.errCorruptData[lang])) : checkArch ? [el, (xhr.responseURL || '').includes('/arch/')] : el; }; var text = xhr.responseText; var el = getAjaxResponseEl(text, needForm); return aib.stormWallFixAjax ? aib.stormWallFixAjax(url, text, el, needForm, fnResult) : fnResult(el); }, function (err) { return err.code === 304 ? null : CancelablePromise.reject(err); }); } function ajaxPostsLoad(board, tNum, useCache) { var useJson = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true; if (useJson && aib.JsonBuilder) { return AjaxCache.runCachedAjax(aib.getJsonApiUrl(board, tNum), useCache).then(function (xhr) { try { return new aib.JsonBuilder(JSON.parse(xhr.responseText), board); } catch (err) { if (err instanceof AjaxError) { return CancelablePromise.reject(err); } console.warn("API error: ".concat(err, ". Switching to DOM parsing!")); aib.JsonBuilder = null; return ajaxPostsLoad(board, tNum, useCache); } }, function (err) { return err.code === 304 ? null : CancelablePromise.reject(err); }); } return aib.hasArchive ? ajaxLoad(aib.getThrUrl(board, tNum), true, useCache, true).then(function (data) { return data !== null && data !== void 0 && data[0] ? new DOMPostsBuilder(data[0], data[1]) : null; }) : ajaxLoad(aib.getThrUrl(board, tNum), true, useCache).then(function (form) { return form ? new DOMPostsBuilder(form) : null; }); } function infoLoadErrors(err) { var showError = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; var isAjax = err instanceof AjaxError; var eCode = isAjax ? err.code : 0; if (eCode === 200) { closePopup('newposts'); } else if (isAjax && eCode === 0) { $popup('newposts', err.message ? String(err.message) : "".concat(Lng.noConnect[lang], ": \n").concat(getErrorMessage(err))); } else { $popup('newposts', "".concat(Lng.thrNotFound[lang], " (\u2116").concat(aib.t, "): \n").concat(getErrorMessage(err))); if (showError) { doc.title = "{".concat(eCode, "} ").concat(doc.title); } } } var Pages = { addPage: function addPage() { var _this30 = this; var needThreads = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; var pageNum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DelForm.last.pageNum + 1; if (this._isAdding || pageNum > aib.lastPage || needThreads && pageNum > 4) { return; } this._isAdding = true; DelForm.last.el.insertAdjacentHTML('beforeend', "

\n\t\t\t\t".concat(Lng.loading[lang], "
")); MyPosts.purge(); this._addingPromise = ajaxLoad(aib.getPageUrl(aib.b, pageNum)).then( function () { var _ref18 = _asyncToGenerator( _regeneratorRuntime().mark(function _callee20(formEl) { var newForm, firstForm, thr, oldLastThr; return _regeneratorRuntime().wrap(function _callee20$(_context21) { while (1) switch (_context21.prev = _context21.next) { case 0: newForm = _this30._addForm(formEl, pageNum); if (!newForm.firstThr) { _context21.next = 16; break; } if (needThreads) { _context21.next = 4; break; } return _context21.abrupt("return", _this30._updateForms(DelForm.last)); case 4: $hide(newForm.el); _context21.next = 7; return _this30._updateForms(DelForm.last); case 7: firstForm = DelForm.first; thr = newForm.firstThr; do { if (thr.isHidden) { DelForm.tNums["delete"](thr.num); } else { oldLastThr = firstForm.lastThr; oldLastThr.el.after(thr.el); newForm.firstThr = thr.next; thr.prev = oldLastThr; thr.form = firstForm; firstForm.lastThr = oldLastThr.next = thr; needThreads--; } thr = thr.next; } while (needThreads && thr); DelForm.last = firstForm; firstForm.next = firstForm.lastThr.next = null; newForm.el.remove(); _this30._endAdding(); if (needThreads) { _this30.addPage(needThreads, pageNum + 1); } return _context21.abrupt("return", CancelablePromise.reject(new CancelError())); case 16: _this30._endAdding(); _this30.addPage(); return _context21.abrupt("return", CancelablePromise.reject(new CancelError())); case 19: case "end": return _context21.stop(); } }, _callee20); })); return function (_x15) { return _ref18.apply(this, arguments); }; }()).then(function () { return _this30._endAdding(); })["catch"](function (err) { if (!(err instanceof CancelError)) { $popup('add-page', getErrorMessage(err)); _this30._endAdding(); } }); }, loadPages: function loadPages(count) { var _this31 = this; return _asyncToGenerator( _regeneratorRuntime().mark(function _callee21() { var _iterator5, _step5, form, i, len, first; return _regeneratorRuntime().wrap(function _callee21$(_context22) { while (1) switch (_context22.prev = _context22.next) { case 0: $popup('load-pages', Lng.loading[lang], true); if (_this31._addingPromise) { _this31._addingPromise.cancelPromise(); _this31._endAdding(); } PviewsCache.purge(); isExpImg = false; pByEl = new Map(); pByNum = new Map(); Post.hiddenNums = new Set(); AttachedImage.closeImg(); if (postform.isQuick) { postform.clearForm(); } DelForm.tNums = new Set(); _iterator5 = _createForOfIteratorHelperLoose(DelForm); case 11: if ((_step5 = _iterator5()).done) { _context22.next = 20; break; } form = _step5.value; $Q('a[href^="blob:"]', form.el).forEach(function (el) { return URL.revokeObjectURL(el.href); }); $hide(form.el); if (!(form === DelForm.last)) { _context22.next = 17; break; } return _context22.abrupt("break", 20); case 17: form.el.remove(); case 18: _context22.next = 11; break; case 20: DelForm.first = DelForm.last; i = aib.page, len = Math.min(aib.lastPage + 1, aib.page + count); case 22: if (!(i < len)) { _context22.next = 38; break; } _context22.prev = 23; _context22.t0 = _this31; _context22.next = 27; return ajaxLoad(aib.getPageUrl(aib.b, i)); case 27: _context22.t1 = _context22.sent; _context22.t2 = i; _context22.t0._addForm.call(_context22.t0, _context22.t1, _context22.t2); _context22.next = 35; break; case 32: _context22.prev = 32; _context22.t3 = _context22["catch"](23); $popup('load-pages', getErrorMessage(_context22.t3)); case 35: ++i; _context22.next = 22; break; case 38: first = DelForm.first; if (!(first !== DelForm.last)) { _context22.next = 45; break; } DelForm.first = first.next; first.el.remove(); _context22.next = 44; return _this31._updateForms(DelForm.first); case 44: closePopup('load-pages'); case 45: case "end": return _context22.stop(); } }, _callee21, null, [[23, 32]]); }))(); }, _isAdding: false, _addingPromise: null, _addForm: function _addForm(formEl, pageNum) { formEl = doc.adoptNode(formEl); $hide(formEl = aib.fixHTML(formEl)); DelForm.last.el.after(formEl); var form = new DelForm(formEl, +pageNum, DelForm.last); DelForm.last = form; form.addStuff(); if (pageNum !== aib.page && form.firstThr) { formEl.insertAdjacentHTML('afterbegin', "
\n\t\t\t\t
".concat(Lng.page[lang], " ").concat(pageNum, "

")); } $show(formEl); return form; }, _endAdding: function _endAdding() { $q('.de-addpage-wait').remove(); this._isAdding = false; this._addingPromise = null; }, _updateForms: function _updateForms(newForm) { return _asyncToGenerator( _regeneratorRuntime().mark(function _callee22() { return _regeneratorRuntime().wrap(function _callee22$(_context23) { while (1) switch (_context23.prev = _context23.next) { case 0: _context23.t0 = readPostsData; _context23.t1 = newForm.firstThr.op; _context23.next = 4; return readFavorites(); case 4: _context23.t2 = _context23.sent; (0, _context23.t0)(_context23.t1, _context23.t2); if (!postform.passw) { _context23.next = 9; break; } _context23.next = 9; return PostForm.setUserPassw(); case 9: embedPostMsgImages(newForm.el); if (HotKeys.enabled) { HotKeys.clearCPost(); } case 11: case "end": return _context23.stop(); } }, _callee22); }))(); } }; function toggleInfinityScroll() { if (!aib.t) { doc.defaultView[Cfg.inftyScroll ? 'addEventListener' : 'removeEventListener']('onwheel' in doc.defaultView ? 'wheel' : 'mousewheel', toggleInfinityScroll.onwheel); } } toggleInfinityScroll.onwheel = function (e) { if ((e.type === 'wheel' ? e.deltaY : -('wheelDeltaY' in e ? e.wheelDeltaY : e.wheelDelta)) > 0) { deWindow.requestAnimationFrame(function () { if (Thread.last.bottom - 150 < Post.sizing.wHeight) { Pages.addPage(); } }); } }; var Spells = Object.create({ hash: null, get hiders() { this._initSpells(); return this.hiders; }, get list() { if (Cfg.spells === null) { return '#wipe(samelines,samewords,longwords,symbols,numbers,whitespace)'; } var data; try { data = JSON.parse(Cfg.spells); } catch (err) { return ''; } var _data6 = data, _data7 = _slicedToArray(_data6, 4), s = _data7[1], reps = _data7[2], oreps = _data7[3]; var str = s ? this._decompileSpells(s, '')[0].join('\n') : ''; if (reps || oreps) { if (str) { str += '\n\n'; } if (reps) { for (var _iterator6 = _createForOfIteratorHelperLoose(reps), _step6; !(_step6 = _iterator6()).done;) { var rep = _step6.value; str += this._decompileRep(rep, false) + '\n'; } } if (oreps) { for (var _iterator7 = _createForOfIteratorHelperLoose(oreps), _step7; !(_step7 = _iterator7()).done;) { var orep = _step7.value; str += this._decompileRep(orep, true) + '\n'; } } str = str.substr(0, str.length - 1); } return str; }, get names() { return ['words', 'exp', 'exph', 'imgn', 'ihash', 'subj', 'name', 'trip', 'img', 'sage', 'op', 'tlen', 'all', 'video', 'wipe', 'num', 'vauthor', '//']; }, get needArg() { return [true, true, true, true, true, false, false, false, false, false, false, false, false, false, false, true, true, false]; }, get outreps() { this._initSpells(); return this.outreps; }, get reps() { this._initSpells(); return this.reps; }, addSpell: function addSpell(type, arg, isNeg) { var _this32 = this; return _asyncToGenerator( _regeneratorRuntime().mark(function _callee23() { var inputEl, value, checkboxEl, spells, idx, isAdded, scope, sScope, sArg; return _regeneratorRuntime().wrap(function _callee23$(_context24) { while (1) switch (_context24.prev = _context24.next) { case 0: inputEl = $id('de-spell-txt'); value = inputEl === null || inputEl === void 0 ? void 0 : inputEl.value; checkboxEl = $q('input[info="hideBySpell"]'); spells = value && _this32.parseText(value); if (!(!value || spells)) { _context24.next = 28; break; } if (!spells) { try { spells = JSON.parse(Cfg.spells); } catch (err) {} spells = spells || [Date.now(), [], null, null]; } isAdded = true; scope = aib.t ? [aib.b, aib.t] : null; if (spells[1]) { sScope = String(scope); sArg = String(arg); spells[1].some(scope && isNeg ? function (spell, i) { var data; if (spell[0] === 0xFF && (data = spell[1]) instanceof Array && data.length === 2 && data[0][0] === 0x20C && data[1][0] === type && data[1][2] == null && String(data[1][1]) === sArg && String(data[0][2]) === sScope) { idx = i; return true; } return (spell[0] & 0x200) !== 0; } : function (spell, i) { if (spell[0] === type && String(spell[1]) === sArg && String(spell[2]) === sScope) { idx = i; return true; } return (spell[0] & 0x200) !== 0; }); } else { spells[1] = []; } if (typeof idx === 'undefined') { if (scope && isNeg) { spells[1].unshift([0xFF, [[0x20C, '', scope], [type, arg, undefined]], undefined]); } else { spells[1].unshift([type, arg, scope]); } } else if (Cfg.hideBySpell) { if (spells[1].length === 1) { spells[1] = null; } else { spells[1].splice(idx, 1); } isAdded = false; } if (!isAdded) { _context24.next = 16; break; } _context24.next = 13; return CfgSaver.save('hideBySpell', 1); case 13: if (checkboxEl) { checkboxEl.checked = true; } _context24.next = 20; break; case 16: if (!(!spells[1] && !spells[2] && !spells[3])) { _context24.next = 20; break; } _context24.next = 19; return CfgSaver.save('hideBySpell', 0); case 19: if (checkboxEl) { checkboxEl.checked = false; } case 20: if (spells[1] && Cfg.sortSpells) { _this32._sort(spells[1]); } _context24.next = 23; return CfgSaver.save('spells', JSON.stringify(spells)); case 23: _context24.next = 25; return _this32.setSpells(spells, true); case 25: if (inputEl) { inputEl.value = _this32.list; } Pview.updatePosition(true); return _context24.abrupt("return"); case 28: if (checkboxEl) { checkboxEl.checked = false; } case 29: case "end": return _context24.stop(); } }, _callee23); }))(); }, decompileSpell: function decompileSpell(type, neg, val, scope) { var wipeMsg = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null; var spell = (neg ? '!#' : '#') + this.names[type] + (scope ? "[".concat(scope[0]).concat(scope[1] ? ",".concat(scope[1] === -1 ? '' : scope[1]) : '', "]") : ''); if (!val && val !== 0) { return spell; } switch (type) { case 8: return spell + '(' + (val[0] === 2 ? '>' : val[0] === 1 ? '<' : '=') + (val[1] ? val[1][0] + (val[1][1] === val[1][0] ? '' : '-' + val[1][1]) : '') + (val[2] ? '@' + val[2][0] + (val[2][0] === val[2][1] ? '' : '-' + val[2][1]) + 'x' + val[2][2] + (val[2][2] === val[2][3] ? '' : '-' + val[2][3]) : '') + ')'; case 14: { if (val === 0x3F && !wipeMsg) { return spell; } var _ref19 = wipeMsg || [], _ref20 = _slicedToArray(_ref19, 2), msgBit = _ref20[0], msgData = _ref20[1]; var names = []; var bits = { 1: 'samelines', 2: 'samewords', 4: 'longwords', 8: 'symbols', 16: 'capslock', 32: 'numbers', 64: 'whitespace' }; for (var bit in bits) { if (+bit !== msgBit && val & +bit) { names.push(bits[bit]); } } if (msgBit) { names.push(bits[msgBit].toUpperCase() + (msgData ? ': ' + msgData : '')); } return "".concat(spell, "(").concat(names.join(','), ")"); } case 11: case 15: { var temp_; var temp = val[1].length - 1; if (temp !== -1) { for (temp_ = []; temp >= 0; --temp) { temp_.push(val[1][temp][0] + '-' + val[1][temp][1]); } temp_.reverse(); } spell += '('; if (val[0].length) { spell += val[0].join(',') + (temp_ ? ',' : ''); } if (temp_) { spell += temp_.join(','); } return spell + ')'; } case 0: case 6: case 7: case 16: return "".concat(spell, "(").concat(val.replace(/([)\\])/g, '\\$1').replace(/\n/g, '\\n'), ")"); case 17: return '//' + String(val); default: return "".concat(spell, "(").concat(String(val), ")"); } }, disableSpells: function disableSpells() { var _this33 = this; return _asyncToGenerator( _regeneratorRuntime().mark(function _callee24() { var value, configurable; return _regeneratorRuntime().wrap(function _callee24$(_context25) { while (1) switch (_context25.prev = _context25.next) { case 0: value = null; configurable = true; Object.defineProperties(_this33, { hiders: { configurable: configurable, value: value }, outreps: { configurable: configurable, value: value }, reps: { configurable: configurable, value: value } }); _context25.next = 5; return CfgSaver.save('hideBySpell', 0); case 5: case "end": return _context25.stop(); } }, _callee24); }))(); }, outReplace: function outReplace(txt) { for (var _iterator8 = _createForOfIteratorHelperLoose(this.outreps), _step8; !(_step8 = _iterator8()).done;) { var orep = _step8.value; txt = txt.replace(orep[0], orep[1]); } return txt; }, parseText: function parseText(text) { var codeGen = new SpellsCodegen(text); var data = codeGen.generate(); if (codeGen.hasError) { $popup('err-spell', Lng.error[lang] + ': ' + codeGen.errorSpell); } else if (data) { if (data[0] && Cfg.sortSpells) { this._sort(data[0]); } return [Date.now()].concat(_toConsumableArray(data)); } return null; }, replace: function replace(txt) { for (var _iterator9 = _createForOfIteratorHelperLoose(this.reps), _step9; !(_step9 = _iterator9()).done;) { var rep = _step9.value; txt = txt.replace(rep[0], rep[1]); } return txt; }, setSpells: function setSpells(spells, sync) { var _this34 = this; return _asyncToGenerator( _regeneratorRuntime().mark(function _callee25() { var sRunner, post; return _regeneratorRuntime().wrap(function _callee25$(_context26) { while (1) switch (_context26.prev = _context26.next) { case 0: if (sync) { _this34._sync(spells); } if (Cfg.hideBySpell) { _context26.next = 6; break; } SpellsRunner.unhideAll(); _context26.next = 5; return _this34.disableSpells(); case 5: return _context26.abrupt("return"); case 6: _this34._optimize(spells); if (_this34.hiders) { _context26.next = 10; break; } SpellsRunner.unhideAll(); return _context26.abrupt("return"); case 10: sRunner = new SpellsRunner(); for (post = Thread.first.op; post; post = post.next) { sRunner.runSpells(post); } sRunner.endSpells(); case 13: case "end": return _context26.stop(); } }, _callee25); }))(); }, toggle: function toggle() { var _this35 = this; return _asyncToGenerator( _regeneratorRuntime().mark(function _callee26() { var spells, inputEl, value; return _regeneratorRuntime().wrap(function _callee26$(_context27) { while (1) switch (_context27.prev = _context27.next) { case 0: inputEl = $id('de-spell-txt'); value = inputEl.value; if (!(value && (spells = _this35.parseText(value)))) { _context27.next = 10; break; } closePopup('err-spell'); _context27.next = 6; return _this35.setSpells(spells, true); case 6: _context27.next = 8; return CfgSaver.save('spells', JSON.stringify(spells)); case 8: inputEl.value = _this35.list; return _context27.abrupt("return"); case 10: if (value) { _context27.next = 18; break; } closePopup('err-spell'); SpellsRunner.unhideAll(); _context27.next = 15; return _this35.disableSpells(); case 15: _context27.next = 17; return CfgSaver.save('spells', JSON.stringify([Date.now(), null, null, null])); case 17: sendStorageEvent('__de-spells', '{ hide: false, data: null }'); case 18: $q('input[info="hideBySpell"]').checked = false; case 19: case "end": return _context27.stop(); } }, _callee26); }))(); }, _decompileRep: function _decompileRep(rep, isOrep) { return (isOrep ? '#outrep' : '#rep') + (rep[0] ? "[".concat(rep[0]).concat(rep[1] ? ",".concat(rep[1] === -1 ? '' : rep[1]) : '', "]") : '') + "(".concat(rep[2], ",").concat(rep[3].replace(/([)\\])/g, '\\$1').replace(/\n/g, '\\n'), ")"); }, _decompileSpells: function _decompileSpells(scope, indent) { var dScope = []; var hScope = false; for (var i = 0, j = 0, len = scope.length; i < len; ++i, ++j) { var spell = scope[i]; var type = spell[0] & 0xFF; if (type === 0xFF) { hScope = true; var temp = this._decompileSpells(spell[1], indent + ' '); if (temp[1]) { var str = "".concat(spell[0] & 0x100 ? '!(\n' : '(\n').concat(indent, " ") + "".concat(temp[0].join("\n".concat(indent, " ")), "\n").concat(indent, ")"); if (j === 0) { dScope[0] = str; } else { dScope[--j] += ' ' + str; } } else { dScope[j] = "".concat(spell[0] & 0x100 ? '!(' : '(').concat(temp[0].join(' '), ")"); } } else if (type === 17) { dScope[j] = '//' + spell[1]; } else { dScope[j] = this.decompileSpell(type, spell[0] & 0x100, spell[1], spell[2]); } var k = i + 1; while (k < len && (scope[k][0] & 0xFF) === 17) { k++; } if (k !== len && type !== 17) { dScope[j] += spell[0] & 0x200 ? ' &' : ' |'; } } return [dScope, dScope.length > 2 || hScope]; }, _initSpells: function _initSpells() { if (!Cfg.hideBySpell) { var value = null; var configurable = true; Object.defineProperties(this, { hiders: { configurable: configurable, value: value }, outreps: { configurable: configurable, value: value }, reps: { configurable: configurable, value: value } }); return; } var spells, data; try { spells = JSON.parse(Cfg.spells); data = JSON.parse(sesStorage["de-spells-".concat(aib.b).concat(aib.t || '')]); } catch (err) {} if (data && spells && data[0] === spells[0]) { this.hash = data[0]; this._setData(data[1], data[2], data[3]); return; } if (spells) { this._optimize(spells); } else { this.disableSpells(); } }, _initHiders: function _initHiders(data) { if (data) { for (var _iterator10 = _createForOfIteratorHelperLoose(data), _step10; !(_step10 = _iterator10()).done;) { var item = _step10.value; var val = item[1]; if (val) { switch (item[0] & 0xFF) { case 1: case 2: case 3: case 5: case 13: item[1] = strToRegExp(val, true); break; case 0xFF: this._initHiders(val); } } } } return data; }, _initReps: function _initReps(data) { if (data) { for (var _iterator11 = _createForOfIteratorHelperLoose(data), _step11; !(_step11 = _iterator11()).done;) { var item = _step11.value; item[0] = strToRegExp(item[0], false); } } return data; }, _optimize: function _optimize(data) { var arr = [data[1] ? this._optimizeSpells(data[1]) : null, data[2] ? this._optimizeReps(data[2]) : null, data[3] ? this._optimizeReps(data[3]) : null]; sesStorage["de-spells-".concat(aib.b).concat(aib.t || '')] = JSON.stringify([data[0]].concat(arr)); this.hash = data[0]; this._setData.apply(this, arr); }, _optimizeReps: function _optimizeReps(data) { var rv = []; for (var _iterator12 = _createForOfIteratorHelperLoose(data), _step12; !(_step12 = _iterator12()).done;) { var _step12$value = _slicedToArray(_step12.value, 4), r0 = _step12$value[0], r1 = _step12$value[1], r2 = _step12$value[2], r3 = _step12$value[3]; if (!r0 || r0 === aib.b && (r1 === -1 ? !aib.t : !r1 || +r1 === aib.t)) { rv.push([r2, r3]); } } return !rv.length ? null : rv; }, _optimizeSpells: function _optimizeSpells(spells) { var neg; var lastSpell = -1; var newSpells = []; for (var i = 0, len = spells.length; i < len; ++i) { var j = void 0; var spell = spells[i]; var flags = spell[0]; var type = flags & 0xFF; neg = (flags & 0x100) !== 0; if (type === 0xFF) { var parensSpells = this._optimizeSpells(spell[1]); if (parensSpells) { if (parensSpells.length !== 1) { newSpells.push([flags, parensSpells]); lastSpell++; continue; } else if ((parensSpells[0][0] & 0xFF) !== 12) { newSpells.push([(parensSpells[0][0] | flags & 0x200) ^ flags & 0x100, parensSpells[0][1]]); lastSpell++; continue; } flags = parensSpells[0][0]; neg = !(neg ^ (flags & 0x100) !== 0); } } else { var scope = spell[2]; if (!scope || scope[0] === aib.b && (scope[1] === -1 ? !aib.t : !scope[1] || +scope[1] === aib.t)) { if (type === 12) { neg = !neg; } else { newSpells.push([flags, spell[1]]); lastSpell++; continue; } } } for (j = lastSpell; j >= 0 && (newSpells[j][0] & 0x200) !== 0 ^ neg; --j) ; if (j !== lastSpell) { newSpells = newSpells.slice(0, j + 1); lastSpell = j; } if (neg && j !== -1) { newSpells[j][0] &= 0x1FF; } if ((flags & 0x200) !== 0 ^ neg) { break; } } return lastSpell === -1 ? neg ? [[12, '']] : null : newSpells; }, _setData: function _setData(hiders, reps, outreps) { var configurable = true; Object.defineProperties(this, { hiders: { configurable: configurable, value: this._initHiders(hiders) }, outreps: { configurable: configurable, value: this._initReps(outreps) }, reps: { configurable: configurable, value: this._initReps(reps) } }); }, _sort: function _sort(sp) { for (var i = 0, len = sp.length - 1; i < len; ++i) { if (sp[i][0] > 0x200) { var temp = [0xFF, []]; do { temp[1].push(sp.splice(i, 1)[0]); len--; } while (sp[i][0] > 0x200); temp[1].push(sp.splice(i, 1)[0]); sp.splice(i, 0, temp); } } sp = sp.sort().sort(function (a, b) { return ( a[2] && !b[2] || a[2] && b[2] && (a[2][0] > b[2][0] || a[2][1] > b[2][1]) ? 1 : 0 ); }); for (var _i7 = 0, _len5 = sp.length - 1; _i7 < _len5; ++_i7) { var j = _i7 + 1; if (sp[_i7][0] === sp[j][0] && sp[_i7][1] <= sp[j][1] && sp[_i7][1] >= sp[j][1] && (sp[_i7][2] === null || sp[_i7][2] === undefined || sp[_i7][2] <= sp[j][2] && sp[_i7][2] >= sp[j][2])) { sp.splice(j, 1); _i7--; _len5--; } else if (sp[_i7][0] === 0xFF) { sp.push(sp.splice(_i7, 1)[0]); _i7--; _len5--; } } }, _sync: function _sync(data) { sendStorageEvent('__de-spells', { hide: !!Cfg.hideBySpell, data: data }); } }); var SpellsCodegen = function () { function SpellsCodegen(sList) { _classCallCheck(this, SpellsCodegen); this.TYPE_UNKNOWN = 0; this.TYPE_ANDOR = 1; this.TYPE_NOT = 2; this.TYPE_SPELL = 3; this.TYPE_PARENTHESES = 4; this.TYPE_REPLACER = 5; this.hasError = false; this._col = 1; this._errMsg = ''; this._errMsgArg = null; this._line = 1; this._sList = sList; } _createClass(SpellsCodegen, [{ key: "errorSpell", get: function get() { return !this.hasError ? '' : (this._errMsgArg ? this._errMsg.replace('%s', this._errMsgArg) : this._errMsg) + Lng.seRow[lang] + this._line + Lng.seCol[lang] + this._col + ')'; } }, { key: "generate", value: function generate() { return this._sList ? this._generate(this._sList, false) : null; } }, { key: "_generate", value: function _generate(sList, inParens) { var spellsArr = []; var reps = []; var outreps = []; var lastType = this.TYPE_UNKNOWN; var hasReps = false; for (var i = 0, len = sList.length; i < len; i++, this._col++) { var res = void 0; switch (sList[i]) { case '\n': this._line++; this._col = 0; case '\r': case ' ': continue; case '#': { var name = ''; i++; var colStart = this._col; this._col++; while (sList[i] >= 'a' && sList[i] <= 'z' || sList[i] >= 'A' && sList[i] <= 'Z') { name += sList[i].toLowerCase(); i++; this._col++; } if (name === '') { this._setError(Lng.seUnknown[lang], sList[i].replace(/[\r\n]/, '')); return null; } else if (name === 'rep' || name === 'outrep') { if (!hasReps) { if (inParens) { this._col -= 1 + name.length; this._setError(Lng.seRepsInParens[lang], '#' + name); return null; } if (lastType === this.TYPE_ANDOR || lastType === this.TYPE_NOT) { i -= 1 + name.length; this._col -= 1 + name.length; lookBack: while (i >= 0) { switch (sList[i]) { case '\n': { i--; this._line--; var j = 0; while (j <= i && sList[i - j] !== '\n') { j++; } this._col = j; break; } case '\r': case ' ': case '#': i--; this._col--; break; default: break lookBack; } } this._setError(Lng.seOpInReps[lang], sList[i]); return null; } hasReps = true; } res = this._doRep(name, sList.substr(i)); if (!res) { return null; } (name === 'rep' ? reps : outreps).push(res[1]); i += res[0] - 1; this._col += res[0] - 1; lastType = this.TYPE_REPLACER; } else { if (lastType === this.TYPE_SPELL || lastType === this.TYPE_PARENTHESES) { this._col = colStart; this._setError(Lng.seMissOp[lang], null); return null; } res = this._doSpell(name, sList.substr(i), lastType === this.TYPE_NOT); if (!res) { return null; } i += res[0] - 1; this._col += res[0] - 1; spellsArr.push(res[1]); lastType = this.TYPE_SPELL; } break; } case '(': if (hasReps) { this._setError(Lng.seUnexpChar[lang], '('); return null; } if (lastType === this.TYPE_SPELL || lastType === this.TYPE_PARENTHESES) { this._setError(Lng.seMissOp[lang], null); return null; } res = this._generate(sList.substr(i + 1), true); if (!res) { return null; } i += res[0] + 1; spellsArr.push([lastType === this.TYPE_NOT ? 0x1FF : 0xFF, res[1]]); lastType = this.TYPE_PARENTHESES; break; case '|': case '&': if (hasReps) { this._setError(Lng.seUnexpChar[lang], sList[i]); return null; } if (lastType !== this.TYPE_SPELL && lastType !== this.TYPE_PARENTHESES) { this._setError(Lng.seMissSpell[lang], null); return null; } if (sList[i] === '&') { spellsArr[spellsArr.length - 1][0] |= 0x200; } lastType = this.TYPE_ANDOR; break; case '!': if (hasReps) { this._setError(Lng.seUnexpChar[lang], '!'); return null; } if (lastType !== this.TYPE_ANDOR && lastType !== this.TYPE_UNKNOWN) { this._setError(Lng.seMissOp[lang], null); return null; } lastType = this.TYPE_NOT; break; case '/': { i++; this._col++; if (sList[i] === '/') { var text = ''; while (i + 1 < len && sList[i + 1] !== '\n' && sList[i + 1] !== '\r') { i++; this._col++; text += sList[i]; } spellsArr.push([17, text]); } else { this._setError(Lng.seUnexpChar[lang], '/'); return null; } break; } case ')': if (hasReps) { this._setError(Lng.seUnexpChar[lang], ')'); return null; } if (lastType === this.TYPE_ANDOR || lastType === this.TYPE_NOT) { this._setError(Lng.seMissSpell[lang], null); return null; } if (inParens) { return [i, spellsArr]; } default: this._setError(Lng.seUnexpChar[lang], sList[i]); return null; } } if (inParens) { this._setError(Lng.seMissClBkt[lang], null); return null; } if (lastType !== this.TYPE_SPELL && lastType !== this.TYPE_PARENTHESES && lastType !== this.TYPE_REPLACER) { this._setError(Lng.seMissSpell[lang], null); return null; } if (!reps.length) { reps = false; } if (!outreps.length) { outreps = false; } return [spellsArr, reps, outreps]; } }, { key: "_getRegex", value: function _getRegex(str, haveComma) { var m = str.match(/^\((\/.*?[^\\]\/[igm]*)(?:\)|\s*(,))/); if (!m || haveComma !== Boolean(m[2])) { return null; } var val = m[1]; try { strToRegExp(val, true); } catch (err) { this._col++; this._setError(Lng.seErrRegex[lang], val); return null; } return [m[0].length, val]; } }, { key: "_doRep", value: function _doRep(name, str) { var scope = SpellsCodegen._getScope(str); if (scope) { str = str.substring(scope[0]); } else { scope = [0, ['', '']]; } if (str[0] !== '(' || str[1] === ')') { this._setError(Lng.seMissArg[lang], name); return null; } var regex = this._getRegex(str, true); if (regex) { str = str.substring(regex[0]); if (str[0] === ')') { return [regex[0] + scope[0] + 1, [scope[1][0], scope[1][1], regex[1], '']]; } var val = SpellsCodegen._getText(str, false); if (val) { return [val[0] + regex[0] + scope[0], [scope[1][0], scope[1][1], regex[1], val[1]]]; } } if (!this.hasError) { this._setError(Lng.seSyntaxErr[lang], name); } return null; } }, { key: "_doSpell", value: function _doSpell(name, str, isNeg) { var m; var i = 0; var spellIdx = Spells.names.indexOf(name); if (spellIdx === -1) { this._col -= name.length + 1; this._setError(Lng.seUnknown[lang], name); return null; } var scope = SpellsCodegen._getScope(str); if (scope) { i += scope[0]; str = str.substring(scope[0]); scope = scope[1]; } var spellType = isNeg ? spellIdx | 0x100 : spellIdx; if (str[0] !== '(' || str[1] === ')') { if (Spells.needArg[spellIdx]) { this._setError(Lng.seMissArg[lang], name); return null; } return [str[0] === '(' ? i + 2 : i, [spellType, spellIdx === 14 ? 0x3F : '', scope]]; } switch (spellIdx) { case 0: case 6: case 7: case 9: case 10: case 12: case 16: m = SpellsCodegen._getText(str, true); if (m) { return [i + m[0], [spellType, spellIdx === 0 ? m[1].toLowerCase() : m[1], scope]]; } break; case 1: case 2: case 3: case 5: case 13: m = this._getRegex(str, false); if (m) { return [i + m[0], [spellType, m[1], scope]]; } break; case 4: m = str.match(/^\((\d+)\)/); if (!isNaN(+m[1])) { return [i + m[0].length, [spellType, +m[1], scope]]; } break; case 8: m = str.match(/^\(([><=])(?:(\d+(?:\.\d+)?)(?:-(\d+(?:\.\d+)?))?)?(?:@(\d+)(?:-(\d+))?x(\d+)(?:-(\d+))?)?\)/); if (m && (m[2] || m[4])) { return [i + m[0].length, [spellType, [m[1] === '=' ? 0 : m[1] === '<' ? 1 : 2, m[2] && [+m[2], m[3] ? +m[3] : +m[2]], m[4] && [+m[4], m[5] ? +m[5] : +m[4], +m[6], m[7] ? +m[7] : +m[6]]], scope]]; } break; case 14: m = str.match(/^\(([a-z, ]+)\)/); if (m) { var val = 0; var arr = m[1].split(/, */); for (var _i8 = 0, len = arr.length; _i8 < len; ++_i8) { switch (arr[_i8]) { case 'samelines': val |= 1; break; case 'samewords': val |= 2; break; case 'longwords': val |= 4; break; case 'symbols': val |= 8; break; case 'capslock': val |= 16; break; case 'numbers': val |= 32; break; case 'whitespace': val |= 64; break; default: val = -1; } } if (val !== -1) { return [i + m[0].length, [spellType, val, scope]]; } } break; case 11: case 15: { m = str.match(/^\(([\d-, ]+)\)/); if (m) { var _val; m[1].split(/, */).forEach(function (v) { if (v.includes('-')) { var nums = v.split('-'); nums[0] = +nums[0]; nums[1] = +nums[1]; this[1].push(nums); } else { this[0].push(+v); } }, _val = [[], []]); return [i + m[0].length, [spellType, _val, scope]]; } break; } } if (!this.hasError) { this._setError(Lng.seSyntaxErr[lang], name); } return null; } }, { key: "_setError", value: function _setError(msg, arg) { this.hasError = true; this._errMsg = msg; this._errMsgArg = arg; } }], [{ key: "_getScope", value: function _getScope(str) { var m = str.match(/^\[([a-z0-9/-]+)?(?:(,)|,(\s*[0-9]+))?\]/); return m ? [m[0].length, [m[1] || '', m[3] ? +m[3] : m[2] ? -1 : false]] : null; } }, { key: "_getText", value: function _getText(str, haveBracket) { if (haveBracket && str[0] !== '(') { return [0, '']; } var rv = ''; for (var i = haveBracket ? 1 : 0, len = str.length; i < len; ++i) { var ch = str[i]; if (ch === '\\') { if (i === len - 1) { return null; } switch (str[i + 1]) { case 'n': rv += '\n'; break; case '\\': rv += '\\'; break; case ')': rv += ')'; break; default: return null; } ++i; } else if (ch === ')') { return [i + 1, rv]; } else { rv += ch; } } return null; } }]); return SpellsCodegen; }(); var SpellsRunner = function () { function SpellsRunner() { _classCallCheck(this, SpellsRunner); this.hasNumSpell = false; this._endPromise = null; this._spells = Spells.hiders; if (!this._spells) { this.runSpells = SpellsRunner._unhidePost; SpellsRunner.cachedData = null; } } _createClass(SpellsRunner, [{ key: "endSpells", value: function endSpells() { var _this36 = this; if (this._endPromise) { this._endPromise.then(function () { return _this36._savePostsHelper(); }); } else { this._savePostsHelper(); } } }, { key: "runSpells", value: function runSpells(post) { var _this37 = this; var res = new SpellsInterpreter(post, this._spells).runInterpreter(); if (res instanceof Promise) { res = res.then(function (val) { return _this37._checkRes(post, val); }); this._endPromise = this._endPromise ? this._endPromise.then(function () { return res; }) : res; return 0; } return this._checkRes(post, res); } }, { key: "_checkRes", value: function _checkRes(post, _ref21) { var _ref22 = _slicedToArray(_ref21, 3), hasNumSpell = _ref22[0], val = _ref22[1], msg = _ref22[2]; this.hasNumSpell |= hasNumSpell; if (val) { post.spellHide(msg); if (SpellsRunner.cachedData && !post.isDeleted) { SpellsRunner.cachedData[post.count] = [true, msg]; } return 1; } return SpellsRunner._unhidePost(post); } }, { key: "_savePostsHelper", value: function _savePostsHelper() { if (this._spells) { if (aib.t) { var lPost = Thread.first.lastNotDeleted; var data = null; if (Spells.hiders) { if (SpellsRunner.cachedData) { data = SpellsRunner.cachedData; } else { data = []; for (var post = Thread.first.op; post; post = post.nextNotDeleted) { data.push(post.spellHidden ? [true, Post.Note.text] : [false, null]); } SpellsRunner.cachedData = data; } } sesStorage['de-hidden-' + aib.b + aib.t] = !data ? null : JSON.stringify({ hash: Cfg.hideBySpell ? Spells.hash : 0, lastCount: lPost.count, lastNum: lPost.num, data: data }); } toggleWindow('hid', true); } ImagesHashStorage.endFn(); } }], [{ key: "unhideAll", value: function unhideAll() { if (aib.t) { sesStorage['de-hidden-' + aib.b + aib.t] = null; } for (var post = Thread.first.op; post; post = post.next) { if (post.spellHidden) { post.spellUnhide(); } } } }, { key: "_unhidePost", value: function _unhidePost(post) { if (post.spellHidden) { post.spellUnhide(); if (SpellsRunner.cachedData && !post.isDeleted) { SpellsRunner.cachedData[post.count] = [false, null]; } } return 0; } }]); return SpellsRunner; }(); SpellsRunner.cachedData = null; var SpellsInterpreter = function () { function SpellsInterpreter(post, spells) { _classCallCheck(this, SpellsInterpreter); this.hasNumSpell = false; this._ctx = [spells.length, spells, 0, false]; this._deep = 0; this._lastTSpells = []; this._post = post; this._triggeredSpellsStack = [this._lastTSpells]; this._wipeMsg = null; } _createClass(SpellsInterpreter, [{ key: "runInterpreter", value: function runInterpreter() { var _this38 = this; var rv, stopCheck; var isNegScope = this._ctx.pop(); var i = this._ctx.pop(); var scope = this._ctx.pop(); var len = this._ctx.pop(); while (true) { if (i < len) { var type = scope[i][0] & 0xFF; if (type === 0xFF) { this._deep++; this._ctx.push(len, scope, i, isNegScope); isNegScope = !!((scope[i][0] & 0x100) !== 0 ^ isNegScope); scope = scope[i][1]; len = scope.length; i = 0; this._lastTSpells = []; this._triggeredSpellsStack.push(this._lastTSpells); continue; } else if (type === 17) { i++; continue; } var val = this._runSpell(type, scope[i][1]); if (val instanceof Promise) { this._ctx.push(len, scope, ++i, isNegScope); return val.then(function (v) { return _this38._asyncContinue(v); }); } var _this$_checkRes = this._checkRes(scope[i], val, isNegScope); var _this$_checkRes2 = _slicedToArray(_this$_checkRes, 2); rv = _this$_checkRes2[0]; stopCheck = _this$_checkRes2[1]; if (!stopCheck) { i++; continue; } } if (this._deep !== 0) { this._deep--; isNegScope = this._ctx.pop(); i = this._ctx.pop(); scope = this._ctx.pop(); len = this._ctx.pop(); if ((scope[i][0] & 0x200) === 0 ^ rv) { i++; this._triggeredSpellsStack.pop(); this._lastTSpells = this._triggeredSpellsStack[this._triggeredSpellsStack.length - 1]; continue; } } return [this.hasNumSpell, rv, rv ? this._getMsg() : null]; } } }, { key: "_asyncContinue", value: function _asyncContinue(val) { var cl = this._ctx.length; var spell = this._ctx[cl - 3][this._ctx[cl - 2] - 1]; var _this$_checkRes3 = this._checkRes(spell, val, this._ctx[cl - 1]), _this$_checkRes4 = _slicedToArray(_this$_checkRes3, 2), rv = _this$_checkRes4[0], stopCheck = _this$_checkRes4[1]; return stopCheck ? [this.hasNumSpell, rv, rv ? this._getMsg() : null] : this.runInterpreter(); } }, { key: "_checkRes", value: function _checkRes(spell, val, isNegScope) { var flags = spell[0]; var isAndSpell = (flags & 0x200) !== 0 ^ isNegScope; var isNegSpell = (flags & 0x100) !== 0 ^ isNegScope; if (isNegSpell ^ val) { this._lastTSpells.push([isNegSpell, spell, (spell[0] & 0xFF) === 14 ? this._wipeMsg : null]); return [true, !isAndSpell]; } this._lastTSpells.length = 0; return [false, isAndSpell]; } }, { key: "_getMsg", value: function _getMsg() { var rv = []; for (var _iterator13 = _createForOfIteratorHelperLoose(this._triggeredSpellsStack), _step13; !(_step13 = _iterator13()).done;) { var spellEls = _step13.value; for (var _iterator14 = _createForOfIteratorHelperLoose(spellEls), _step14; !(_step14 = _iterator14()).done;) { var _step14$value = _slicedToArray(_step14.value, 3), isNeg = _step14$value[0], spell = _step14$value[1], wipeMsg = _step14$value[2]; rv.push(Spells.decompileSpell(spell[0] & 0xFF, isNeg, spell[1], spell[2], wipeMsg)); } } return rv.join(' & '); } }, { key: "_runSpell", value: function _runSpell(spellId, val) { switch (spellId) { case 0: return this._words(val); case 1: return this._exp(val); case 2: return this._exph(val); case 3: return this._imgn(val); case 4: return this._ihash(val); case 5: return this._subj(val); case 6: return this._name(val); case 7: return this._trip(val); case 8: return this._img(val); case 9: return this._sage(val); case 10: return this._op(val); case 11: return this._tlen(val); case 12: return this._all(val); case 13: return this._video(val); case 14: return this._wipe(val); case 15: this.hasNumSpell = true; return this._num(val); case 16: return this._vauthor(val); } } }, { key: "_all", value: function _all() { return true; } }, { key: "_exp", value: function _exp(val) { return val.test(this._post.text); } }, { key: "_exph", value: function _exph(val) { return val.test(this._post.html); } }, { key: "_ihash", value: function () { var _ihash2 = _asyncToGenerator( _regeneratorRuntime().mark(function _callee27(val) { var _iterator15, _step15, image; return _regeneratorRuntime().wrap(function _callee27$(_context28) { while (1) switch (_context28.prev = _context28.next) { case 0: _iterator15 = _createForOfIteratorHelperLoose(this._post.images); case 1: if ((_step15 = _iterator15()).done) { _context28.next = 14; break; } image = _step15.value; _context28.t0 = image instanceof AttachedImage; if (!_context28.t0) { _context28.next = 10; break; } _context28.next = 7; return ImagesHashStorage.getHash(image); case 7: _context28.t1 = _context28.sent; _context28.t2 = val; _context28.t0 = _context28.t1 === _context28.t2; case 10: if (!_context28.t0) { _context28.next = 12; break; } return _context28.abrupt("return", true); case 12: _context28.next = 1; break; case 14: return _context28.abrupt("return", false); case 15: case "end": return _context28.stop(); } }, _callee27, this); })); function _ihash(_x16) { return _ihash2.apply(this, arguments); } return _ihash; }() }, { key: "_img", value: function _img(val) { var images = this._post.images; var _val2 = _slicedToArray(val, 3), compareRule = _val2[0], weightVals = _val2[1], sizeVals = _val2[2]; if (!val) { return images.hasAttachments; } for (var _iterator16 = _createForOfIteratorHelperLoose(images), _step16; !(_step16 = _iterator16()).done;) { var image = _step16.value; if (!(image instanceof AttachedImage)) { continue; } if (weightVals) { var w = image.weight; var isHide = void 0; switch (compareRule) { case 0: isHide = w >= weightVals[0] && w <= weightVals[1]; break; case 1: isHide = w < weightVals[0]; break; case 2: isHide = w > weightVals[0]; break; } if (!isHide) { continue; } else if (!sizeVals) { return true; } } if (sizeVals) { var h = image.height, _w = image.width; switch (compareRule) { case 0: if (_w >= sizeVals[0] && _w <= sizeVals[1] && h >= sizeVals[2] && h <= sizeVals[3]) { return true; } break; case 1: if (_w < sizeVals[0] && h < sizeVals[3]) { return true; } break; case 2: if (_w > sizeVals[0] && h > sizeVals[3]) { return true; } } } } return false; } }, { key: "_imgn", value: function _imgn(val) { for (var _iterator17 = _createForOfIteratorHelperLoose(this._post.images), _step17; !(_step17 = _iterator17()).done;) { var image = _step17.value; if (image instanceof AttachedImage && val.test(image.name)) { return true; } } return false; } }, { key: "_name", value: function _name(val) { var pName = this._post.posterName; return pName ? !val || pName.includes(val) : false; } }, { key: "_num", value: function _num(val) { return SpellsInterpreter._tlenNumHelper(val, this._post.count + 1); } }, { key: "_op", value: function _op() { return this._post.isOp; } }, { key: "_sage", value: function _sage() { return this._post.sage; } }, { key: "_subj", value: function _subj(val) { var pSubj = this._post.subj; return pSubj ? !val || val.test(pSubj) : false; } }, { key: "_tlen", value: function _tlen(val) { var text = this._post.text.replace(/\s+(?=\s)|\n/g, ''); return !val ? !!text : SpellsInterpreter._tlenNumHelper(val, text.length); } }, { key: "_trip", value: function _trip(val) { var pTrip = this._post.posterTrip; return pTrip ? !val || pTrip.includes(val) : false; } }, { key: "_vauthor", value: function _vauthor(val) { return this._videoVauthor(val, true); } }, { key: "_video", value: function _video(val) { return this._videoVauthor(val, false); } }, { key: "_videoVauthor", value: function _videoVauthor(val, isAuthorSpell) { var videos = this._post.videos; if (!val) { return !!videos.hasLinks; } if (!videos.hasLinks || !Cfg.YTubeTitles) { return false; } for (var _iterator18 = _createForOfIteratorHelperLoose(videos.vData), _step18; !(_step18 = _iterator18()).done;) { var siteData = _step18.value; for (var _iterator19 = _createForOfIteratorHelperLoose(siteData), _step19; !(_step19 = _iterator19()).done;) { var data = _step19.value; if (isAuthorSpell ? val === data[1] : val.test(data[0])) { return true; } } } if (videos.linksCount === videos.loadedLinksCount) { return false; } return new Promise(function (resolve) { return videos.titleLoadFn = function (data) { if (isAuthorSpell ? val === data[1] : val.test(data[0])) { resolve(true); } else if (videos.linksCount === videos.loadedLinksCount) { resolve(false); } else { return; } videos.titleLoadFn = null; }; }); } }, { key: "_wipe", value: function _wipe(val) { var arr, len, x; var txt = this._post.text; if (val & 1) { arr = txt.replaceAll('>', '').split(/\s*\n\s*/); if ((len = arr.length) > 5) { arr.sort(); for (var i = 0, n = len / 4; i < len;) { x = arr[i]; var j = 0; while (arr[i++] === x) { j++; } if (j > 4 && j > n && x) { this._wipeMsg = [1, "\"".concat(x.substr(0, 20), "\" x").concat(j + 1)]; return true; } } } } if (val & 2) { arr = txt.replace(/[\s.?!,>]+/g, ' ').toUpperCase().split(' '); if ((len = arr.length) > 3) { arr.sort(); var keys = 0; var pop = 0; for (var _i9 = 0, _n = len / 4; _i9 < len; keys++) { x = arr[_i9]; var _j = 0; while (arr[_i9++] === x) { _j++; } if (len > 25) { if (_j > pop && x.length > 2) { pop = _j; } if (pop >= _n) { this._wipeMsg = [2, "same \"".concat(x.substr(0, 20), "\" x").concat(pop + 1)]; return true; } } } x = keys / len; if (x < 0.25) { this._wipeMsg = [2, "uniq ".concat((x * 100).toFixed(0), "%")]; return true; } } } if (val & 4) { arr = txt.replace(/https*:\/\/.*?(\s|$)/g, '').replace(/[\s.?!,>:;-]+/g, ' ').split(' '); if (arr[0].length > 50 || (len = arr.length) > 1 && arr.join('').length / len > 10) { this._wipeMsg = [4, null]; return true; } } if (val & 8) { var _txt = txt.replace(/\s+/g, ''); if ((len = _txt.length) > 30 && (x = _txt.replace(/[0-9a-zа-я.?!,]/ig, '').length / len) > 0.4) { this._wipeMsg = [8, "".concat((x * 100).toFixed(0), "%")]; return true; } } if (val & 16) { arr = txt.replace(/[\s.?!;,-]+/g, ' ').trim().split(' '); if ((len = arr.length) > 4) { var _n2 = 0; var capsw = 0; var casew = 0; for (var _i10 = 0; _i10 < len; ++_i10) { x = arr[_i10]; if ((x.match(/[a-zа-я]/ig) || []).length < 5) { continue; } if ((x.match(/[A-ZА-Я]/g) || []).length > 2) { casew++; } if (x === x.toUpperCase()) { capsw++; } _n2++; } if (capsw / _n2 >= 0.3 && _n2 > 4) { this._wipeMsg = [16, "CAPS ".concat(capsw / arr.length * 100, "%")]; return true; } else if (casew / _n2 >= 0.3 && _n2 > 8) { this._wipeMsg = [16, "cAsE ".concat(casew / arr.length * 100, "%")]; return true; } } } if (val & 32) { var _txt2 = txt.replace(/\s+/g, ' ').replace(/>>\d+|https*:\/\/.*?(?: |$)/g, ''); if ((len = _txt2.length) > 30 && (x = (len - _txt2.replace(/\d/g, '').length) / len) > 0.4) { this._wipeMsg = [32, "".concat(Math.round(x * 100), "%")]; return true; } } if (val & 64) { if (/(?:\n\s*){10}/i.test(txt)) { this._wipeMsg = [64, null]; return true; } } return false; } }, { key: "_words", value: function _words(val) { return this._post.text.toLowerCase().includes(val) || this._post.subj.toLowerCase().includes(val); } }], [{ key: "_tlenNumHelper", value: function _tlenNumHelper(val, num) { for (var arr = val[0], i = arr.length - 1; i >= 0; --i) { if (arr[i] === num) { return true; } } for (var _arr = val[1], _i11 = _arr.length - 1; _i11 >= 0; --_i11) { if (num >= _arr[_i11][0] && num <= _arr[_i11][1]) { return true; } } return false; } }]); return SpellsInterpreter; }(); var PostForm = function () { function PostForm(form) { var _this39 = this; var oeForm = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; var ignoreForm = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; _classCallCheck(this, PostForm); this.isBottom = false; this.isHidden = false; this.isQuick = false; this.lastQuickPNum = -1; this.pArea = []; this.pForm = null; this.qArea = null; this.quotedText = ''; this._pBtn = []; var qOeForm = 'form[name="oeform"], form[action*="paint"]'; this.oeForm = oeForm || $q(qOeForm); if (!ignoreForm && !form) { if (this.oeForm) { ajaxLoad(aib.getThrUrl(aib.b, Thread.first.num), false).then(function (loadedDoc) { var form = $q(aib.qForm, loadedDoc); var oeForm = $q(qOeForm, loadedDoc); postform = new PostForm(form && doc.adoptNode(form), oeForm && doc.adoptNode(oeForm), true); }, function () { return postform = new PostForm(null, null, true); }); } else { this.form = null; } return; } this.tNum = aib.t; this.form = form; this.files = null; this.txta = $q(aib.qFormTxta, form); this.subm = $q(aib.qFormSubm, form); this.name = $q(aib.qFormName, form); this.mail = $q(aib.qFormMail, form); this.subj = $q(aib.qFormSubj, form); this.passw = $q(aib.qFormPassw, form); this.rules = $q(aib.qFormRules, form); this.video = $q('tr input[name="video"], tr input[name="embed"]', form); this._initFileInputs(); this._makeHideableContainer(); this._makeWindow(); if (!form || !this.txta) { return; } form.style.display = 'inline-block'; form.style.textAlign = 'left'; var qArea = this.qArea, txta = this.txta; new WinResizer('reply', 'top', 'textaHeight', qArea, txta); new WinResizer('reply', 'left', 'textaWidth', qArea, txta); new WinResizer('reply', 'right', 'textaWidth', qArea, txta); new WinResizer('reply', 'bottom', 'textaHeight', qArea, txta); this._initTextarea(); this.addMarkupPanel(); this.setPlaceholders(); this._initCaptcha(); this._initSubmit(); aib.updateSubmitBtn(this.subm); if (Cfg.ajaxPosting) { this._initAjaxPosting(); } if (Cfg.addSageBtn && this.mail) { PostForm.hideField(this.mail.closest('label') || this.mail); setTimeout(function () { return _this39.toggleSage(); }, 0); } if (Cfg.noPassword && this.passw) { $hide(this.passw.closest(aib.qFormTr)); } if (Cfg.noName && this.name) { PostForm.hideField(this.name); } if (Cfg.noSubj && this.subj) { PostForm.hideField(this.subj); } if (Cfg.userName && this.name) { setTimeout(PostForm.setUserName, 0); } if (this.passw) { setTimeout(PostForm.setUserPassw, 0); } } _createClass(PostForm, [{ key: "isVisible", get: function get() { if (!this.isHidden && this.isBottom && $q(':focus', this.pForm)) { var cr = this.pForm.getBoundingClientRect(); return cr.bottom > 0 && cr.top < nav.viewportHeight(); } return false; } }, { key: "sageBtn", get: function get() { var _this40 = this; var value = $aEnd(this.subm, '' + ''); value.onclick = _asyncToGenerator( _regeneratorRuntime().mark(function _callee28() { return _regeneratorRuntime().wrap(function _callee28$(_context29) { while (1) switch (_context29.prev = _context29.next) { case 0: _context29.next = 2; return toggleCfg('sageReply'); case 2: _this40.toggleSage(); case 3: case "end": return _context29.stop(); } }, _callee28); })); Object.defineProperty(this, 'sageBtn', { value: value }); return value; } }, { key: "top", get: function get() { return this.pForm.getBoundingClientRect().top; } }, { key: "addMarkupPanel", value: function addMarkupPanel() { var _this41 = this; var el = $id('de-txt-panel'); if (!Cfg.addTextBtns) { aib.removeMarkupButtons(el); return; } if (!el) { el = $add(''); ['click', 'mouseover'].forEach(function (e) { return el.addEventListener(e, _this41); }); } el.style.cssFloat = Cfg.txtBtnsLoc ? 'none' : 'right'; aib.insertMarkupButtons(this, el); var id = ['bold', 'italic', 'under', 'strike', 'spoil', 'code', 'sup', 'sub']; var val = ['B', 'i', 'U', 'S', '%', 'C', "x\xB2", "x\u2082"]; var mode = Cfg.addTextBtns; var html = ''; for (var i = 0, len = aib.markupTags.length; i < len; ++i) { var tag = aib.markupTags[i]; if (tag) { html += "
").concat(mode === 2 ? "".concat(!html ? '[' : '', " ").concat(val[i], " /") : mode === 3 ? "") : ""), "
"); } } el.innerHTML = "".concat(html, "
").concat(mode === 2 ? ' > ]' : mode === 3 ? '' : '', ""); } }, { key: "clearForm", value: function clearForm() { if (this.txta) { this.txta.value = ''; } if (this.files) { this.files.clearInputs(); } if (this.video) { this.video.value = ''; } } }, { key: "closeReply", value: function closeReply() { if (this.isQuick) { this.isQuick = false; this.lastQuickPNum = -1; if (!aib.t) { this._toggleQuickReply(false); this.tNum = false; } this.setReply(false, !aib.t || Cfg.addPostForm > 1); } } }, { key: "getSelectedText", value: function getSelectedText() { this.quotedText = deWindow.getSelection().toString(); } }, { key: "handleEvent", value: function handleEvent(e) { var el = e.target; if (el.tagName.toLowerCase() !== 'div') { el = el.parentNode; } var _el6 = el, id = _el6.id; if (!id.startsWith('de-btn')) { return; } if (e.type === 'mouseover') { if (id === 'de-btn-quote') { this.getSelectedText(); } var key = -1; if (HotKeys.enabled) { switch (id.substr(7)) { case 'bold': key = 12; break; case 'italic': key = 13; break; case 'strike': key = 14; break; case 'spoil': key = 15; break; case 'code': key = 16; } } KeyEditListener.setTitle(el, key); return; } var txtaEl = postform.txta; var start = txtaEl.selectionStart, end = txtaEl.selectionEnd; var quote = Cfg.spacedQuote ? '> ' : '>'; if (id === 'de-btn-quote') { insertText(txtaEl, quote + (start === end ? this.quotedText : txtaEl.value.substring(start, end)).replace(/^[\r\n]|[\r\n]+$/g, '').replace(/\n/gm, '\n' + quote) + (this.quotedText ? '\n' : '')); this.quotedText = ''; } else { var scrtop = txtaEl.scrtop, value = txtaEl.value; var val = PostForm._wrapText(el.getAttribute('de-tag'), value.substring(start, end)); var len = start + val[0]; txtaEl.value = value.substr(0, start) + val[1] + value.substr(end); txtaEl.setSelectionRange(len, len); txtaEl.focus(); txtaEl.scrollTop = scrtop; } e.preventDefault(); e.stopPropagation(); } }, { key: "refreshCap", value: function refreshCap() { var isError = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; if (this.cap) { this.cap.refreshCaptcha(isError, isError, this.tNum); } } }, { key: "setPlaceholders", value: function setPlaceholders() { if (aib.formHeaders || !aib.multiFile && Cfg.fileInputs === 2) { return; } this._setPlaceholder('name'); this._setPlaceholder('subj'); this._setPlaceholder('mail'); this._setPlaceholder('video'); if (this.cap) { this._setPlaceholder('cap'); } } }, { key: "setReply", value: function setReply(isQuick, needToHide) { if (isQuick) { this.qArea.firstChild.after(this.pForm); } else { this.pArea[+this.isBottom].after(this.qArea); this._pBtn[+this.isBottom].after(this.pForm); } this.isHidden = needToHide; $toggle(this.qArea, isQuick); $toggle(this.pForm, !needToHide); this.updatePAreaBtns(); } }, { key: "showMainReply", value: function showMainReply(isBottom, e) { this.closeReply(); if (!aib.t) { this.tNum = false; this.refreshCap(); } if (this.isBottom === isBottom) { $toggle(this.pForm, this.isHidden); this.isHidden = !this.isHidden; this.updatePAreaBtns(); } else { this.isBottom = isBottom; this.setReply(false, false); } if (e) { e.preventDefault(); } } }, { key: "showQuickReply", value: function showQuickReply(post, pNum, isCloseReply, isNumClick) { var isNoLink = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; if (!this.isQuick) { this.isQuick = true; this.setReply(true, false); $q('a', this._pBtn[+this.isBottom]).className = "de-abtn de-parea-btn-".concat(aib.t ? 'reply' : 'thr'); } else if (isCloseReply && !this.quotedText && post.wrap.nextElementSibling === this.qArea) { this.closeReply(); return; } post.wrap.after(this.qArea); if (this.qArea.classList.contains('de-win')) { updateWinZ(this.qArea); } var qNum = post.thr.num; if (!aib.t) { this._toggleQuickReply(qNum); } if (!this.form) { return; } if (!aib.t && this.tNum !== qNum) { this.tNum = qNum; this.refreshCap(); } this.tNum = qNum; var txt = this.txta.value; var isOnNewLine = txt === '' || txt.slice(-1) === '\n'; var link = isNoLink || post.isOp && !Cfg.addOPLink && !aib.t && !isNumClick ? '' : isNumClick ? ">>".concat(pNum).concat(isOnNewLine ? '\n' : '') : (isOnNewLine ? '' : '\n') + (this.lastQuickPNum === pNum && txt.includes('>>' + pNum) ? '' : ">>".concat(pNum, "\n")); var quote = this.quotedText ? "".concat(this.quotedText.replace(/^[\r\n]|[\r\n]+$/g, '').replace(/(^|\n)(.)/gm, "$1>".concat(Cfg.spacedQuote ? ' ' : '', "$2")), "\n") : ''; insertText(this.txta, link + quote); var winTitle = post.thr.op.title.trim(); $q('.de-win-title', this.qArea).textContent = (winTitle.length < 28 ? winTitle : "".concat(winTitle.substr(0, 30), "\u2026")) || "#".concat(pNum); this.lastQuickPNum = pNum; } }, { key: "toggleSage", value: function toggleSage() { if (!Cfg.addSageBtn || !this.mail) { return; } var isSage = Cfg.sageReply; this.sageBtn.style.opacity = isSage ? '1' : '.3'; this.sageBtn.title = isSage ? Lng.disableSage[lang] : Lng.enableSage[lang]; if (this.mail.type === 'text') { this.mail.value = isSage ? 'sage' : aib._4chan ? 'noko' : ''; } else { this.mail.checked = isSage; } } }, { key: "updatePAreaBtns", value: function updatePAreaBtns() { var txt = 'de-abtn de-parea-btn-'; var rep = aib.t ? 'reply' : 'thr'; $q('a', this._pBtn[+this.isBottom]).className = txt + (!this.pForm.style.display ? 'close' : rep); $q('a', this._pBtn[+!this.isBottom]).className = txt + rep; } }, { key: "_initAjaxPosting", value: function _initAjaxPosting() { var _this42 = this; var el; if (aib.qFormRedir && (el = $q(aib.qFormRedir, this.form))) { $hide(el.closest(aib.qFormTr)); el.checked = true; } this.form.onsubmit = function () { var _ref24 = _asyncToGenerator( _regeneratorRuntime().mark(function _callee29(e) { var data; return _regeneratorRuntime().wrap(function _callee29$(_context30) { while (1) switch (_context30.prev = _context30.next) { case 0: e.preventDefault(); $popup('upload', Lng.sending[lang], true); _context30.prev = 2; _context30.next = 5; return html5Submit(_this42.form, _this42.subm, true); case 5: data = _context30.sent; _context30.next = 8; return checkSubmit(data); case 8: _context30.next = 13; break; case 10: _context30.prev = 10; _context30.t0 = _context30["catch"](2); showSubmitError(_context30.t0); case 13: case "end": return _context30.stop(); } }, _callee29, null, [[2, 10]]); })); return function (_x17) { return _ref24.apply(this, arguments); }; }(); } }, { key: "_initCaptcha", value: function _initCaptcha() { var _this43 = this; var capEl = $q('input[type="text"][name*="aptcha"], *[id*="captcha"], *[class*="captcha"]', this.form); if (!capEl) { this.cap = null; return; } this.cap = new Captcha(capEl, this.tNum); var updCapFn = function updCapFn() { _this43.cap.addCaptcha(); _this43.cap.updateOutdated(); }; this.txta.addEventListener('focus', updCapFn); if (this.files) { this.files.onchange = updCapFn; } this.form.addEventListener('click', function () { return _this43.cap.addCaptcha(); }, true); } }, { key: "_initFileInputs", value: function _initFileInputs() { var _this44 = this; var fileEl = $q(aib.qFormFile, this.form); if (!fileEl) { return; } if (aib.fixFileInputs) { aib.fixFileInputs(fileEl.closest(aib.qFormTd)); } this.files = new Files(this, $q(aib.qFormFile, this.form)); deWindow.addEventListener('load', function () { return setTimeout(function () { return !_this44.files.filesCount && _this44.files.clearInputs(); }, 0); }); } }, { key: "_initSubmit", value: function _initSubmit() { var _this45 = this; this.subm.addEventListener('click', function (e) { var _this45$video$value; if (Cfg.warnSubjTrip && _this45.subj && /#.|##./.test(_this45.subj.value)) { e.preventDefault(); $popup('upload', Lng.subjHasTrip[lang]); return; } var val = _this45.txta.value; if (Spells.outreps) { val = Spells.outReplace(val); } if (_this45.tNum && pByNum.get(_this45.tNum).subj === 'Dollchan Extension Tools') { var temp = "\n\n".concat(PostForm._wrapText(aib.markupTags[5], "".concat('-'.repeat(50), "\n").concat(nav.ua, "\nv").concat(version, ".").concat(commit).concat(nav.isESNext ? '.es6' : '', " [").concat(nav.scriptHandler, "]"))[1]); if (!val.includes(temp)) { val += temp; } } _this45.txta.value = val; _this45.toggleSage(); if (Cfg.ajaxPosting) { $popup('upload', Lng.checking[lang], true); } if (_this45.video && (val = (_this45$video$value = _this45.video.value) === null || _this45$video$value === void 0 ? void 0 : _this45$video$value.match(Videos.ytReg))) { _this45.video.value = 'http://www.youtube.com/watch?v=' + val[1]; } if (_this45.isQuick) { $hide(_this45.pForm); $hide(_this45.qArea); _this45._pBtn[+_this45.isBottom].after(_this45.pForm); } updater.pauseUpdater(); }); } }, { key: "_initTextarea", value: function _initTextarea() { var _this46 = this; var el = this.txta; el.classList.add('de-textarea'); var style = el.style; style.setProperty('width', Cfg.textaWidth + 'px', 'important'); style.setProperty('height', Cfg.textaHeight + 'px', 'important'); el.addEventListener('keypress', function (e) { var code = e.charCode || e.keyCode; if ((code === 33 || code === 34 ) && e.which === 0) { e.target.blur(); deWindow.focus(); } }); el.addEventListener('paste', function () { var _ref25 = _asyncToGenerator( _regeneratorRuntime().mark(function _callee30(e) { var _e$clipboardData; var files, _iterator20, _step20, file, inputs, i, len, input; return _regeneratorRuntime().wrap(function _callee30$(_context31) { while (1) switch (_context31.prev = _context31.next) { case 0: files = e === null || e === void 0 || (_e$clipboardData = e.clipboardData) === null || _e$clipboardData === void 0 ? void 0 : _e$clipboardData.files; _iterator20 = _createForOfIteratorHelperLoose(files); case 2: if ((_step20 = _iterator20()).done) { _context31.next = 17; break; } file = _step20.value; inputs = _this46.files._inputs; i = 0, len = inputs.length; case 6: if (!(i < len)) { _context31.next = 15; break; } input = inputs[i]; if (input.hasFile) { _context31.next = 12; break; } _context31.next = 11; return input.addUrlFile(URL.createObjectURL(file), file); case 11: return _context31.abrupt("break", 15); case 12: ++i; _context31.next = 6; break; case 15: _context31.next = 2; break; case 17: case "end": return _context31.stop(); } }, _callee30); })); return function (_x18) { return _ref25.apply(this, arguments); }; }()); if (nav.isFirefox || nav.isWebkit) { el.addEventListener('mouseup', function (_ref26) { var target = _ref26.target; var s = target.style; var width = s.width, height = s.height; s.setProperty('width', width + 'px', 'important'); s.setProperty('height', height + 'px', 'important'); CfgSaver.save('textaWidth', parseInt(width, 10), 'textaHeight', parseInt(height, 10)); }); return; } $aEnd(el, '
').addEventListener('mousedown', { _el: el, _elStyle: style, handleEvent: function handleEvent(e) { var _this47 = this; switch (e.type) { case 'mousedown': ['mousemove', 'mouseup'].forEach(function (e) { return doc.body.addEventListener(e, _this47); }); e.preventDefault(); return; case 'mousemove': { var cr = this._el.getBoundingClientRect(); this._elStyle.setProperty('width', e.clientX - cr.left + 'px', 'important'); this._elStyle.setProperty('height', e.clientY - cr.top + 'px', 'important'); return; } default: ['mousemove', 'mouseup'].forEach(function (e) { return doc.body.removeEventListener(e, _this47); }); CfgSaver.save('textaWidth', parseInt(this._elStyle.width, 10), 'textaHeight', parseInt(this._elStyle.height, 10)); } } }); } }, { key: "_makeHideableContainer", value: function _makeHideableContainer() { var _this48 = this; (this.pForm = $add('
')).append(this.form || '', this.oeForm || ''); var html = '
[]

'; this.pArea = [$bBegin(DelForm.first.el, html), $aEnd(aib._4chan ? $q('.board', DelForm.first.el) : DelForm.first.el, html)]; this._pBtn = [this.pArea[0].firstChild, this.pArea[1].firstChild]; this._pBtn[0].firstElementChild.onclick = function (e) { return _this48.showMainReply(false, e); }; this._pBtn[1].firstElementChild.onclick = function (e) { return _this48.showMainReply(true, e); }; this.qArea = $add("
")); this.isBottom = Cfg.addPostForm === 1; this.setReply(false, !aib.t || Cfg.addPostForm > 1); } }, { key: "_makeWindow", value: function _makeWindow() { var _this49 = this; makeDraggable('reply', this.qArea, $aBegin(this.qArea, "
\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t
\n\t\t
\n\t\t
\n\t\t
\n\t\t
")); var buttons = $q('.de-win-buttons', this.qArea); buttons.onmouseover = function (_ref27) { var target = _ref27.target; var el = target.parentNode; switch (nav.fixEventEl(target).classList[0]) { case 'de-win-btn-clear': el.title = Lng.clearForm[lang]; break; case 'de-win-btn-close': el.title = Lng.closeReply[lang]; break; case 'de-win-btn-toggle': el.title = Cfg.replyWinDrag ? Lng.underPost[lang] : Lng.makeDrag[lang]; } }; var _ref28 = _toConsumableArray(buttons.children), clearBtn = _ref28[0], toggleBtn = _ref28[1], closeBtn = _ref28[2]; clearBtn.onclick = _asyncToGenerator( _regeneratorRuntime().mark(function _callee31() { return _regeneratorRuntime().wrap(function _callee31$(_context32) { while (1) switch (_context32.prev = _context32.next) { case 0: _context32.next = 2; return CfgSaver.save('sageReply', 0); case 2: _this49.toggleSage(); _this49.files.clearInputs(); [_this49.txta, _this49.name, _this49.mail, _this49.subj, _this49.video, _this49.cap && _this49.cap.textEl].forEach(function (el) { return el && (el.value = ''); }); case 5: case "end": return _context32.stop(); } }, _callee31); })); toggleBtn.onclick = _asyncToGenerator( _regeneratorRuntime().mark(function _callee32() { return _regeneratorRuntime().wrap(function _callee32$(_context33) { while (1) switch (_context33.prev = _context33.next) { case 0: _context33.next = 2; return toggleCfg('replyWinDrag'); case 2: if (Cfg.replyWinDrag) { _this49.qArea.className = aib.cReply + ' de-win'; updateWinZ(_this49.qArea); } else { _this49.qArea.className = aib.cReply + ' de-win-inpost'; _this49.txta.focus(); } case 3: case "end": return _context33.stop(); } }, _callee32); })); closeBtn.onclick = function () { return _this49.closeReply(); }; } }, { key: "_setPlaceholder", value: function _setPlaceholder(val) { var el = val === 'cap' ? this.cap.textEl : this[val]; if (el) { if (aib.multiFile || Cfg.fileInputs !== 2) { el.placeholder = Lng[val][lang]; } else { el.removeAttribute('placeholder'); } } } }, { key: "_toggleQuickReply", value: function _toggleQuickReply(tNum) { if (this.oeForm) { var _$q4; (_$q4 = $q('input[name="oek_parent"]', this.oeForm)) === null || _$q4 === void 0 || _$q4.remove(); if (tNum) { this.oeForm.insertAdjacentHTML('afterbegin', "")); } } if (this.form) { var _$q5; if (aib.changeReplyMode && tNum !== this.tNum) { aib.changeReplyMode(this.form, tNum); } (_$q5 = $q("input[name=\"".concat(aib.formParent, "\"]"), this.form)) === null || _$q5 === void 0 || _$q5.remove(); if (tNum) { this.form.insertAdjacentHTML('afterbegin', "")); } } } }], [{ key: "hideField", value: function hideField(el) { var els = el.parentNode.children; var hideTr = true; for (var i = 0, len = els.length; i < len; ++i) { if (els[i] !== el && els[i].style.display !== 'none') { hideTr = false; break; } } $toggle(hideTr ? el.closest(aib.qFormTr) : el); } }, { key: "setUserName", value: function () { var _setUserName = _asyncToGenerator( _regeneratorRuntime().mark(function _callee33() { var el; return _regeneratorRuntime().wrap(function _callee33$(_context34) { while (1) switch (_context34.prev = _context34.next) { case 0: el = $q('input[info="nameValue"]'); if (!el) { _context34.next = 4; break; } _context34.next = 4; return CfgSaver.save('nameValue', el.value); case 4: postform.name.value = Cfg.userName ? Cfg.nameValue : ''; case 5: case "end": return _context34.stop(); } }, _callee33); })); function setUserName() { return _setUserName.apply(this, arguments); } return setUserName; }() }, { key: "setUserPassw", value: function () { var _setUserPassw = _asyncToGenerator( _regeneratorRuntime().mark(function _callee34() { var el, value, _iterator21, _step21, passEl; return _regeneratorRuntime().wrap(function _callee34$(_context35) { while (1) switch (_context35.prev = _context35.next) { case 0: if (Cfg.userPassw) { _context35.next = 2; break; } return _context35.abrupt("return"); case 2: el = $q('input[info="passwValue"]'); if (!el) { _context35.next = 6; break; } _context35.next = 6; return CfgSaver.save('passwValue', el.value); case 6: value = postform.passw.value = Cfg.passwValue; for (_iterator21 = _createForOfIteratorHelperLoose(DelForm); !(_step21 = _iterator21()).done;) { passEl = _step21.value.passEl; if (passEl) { passEl.value = value; } } case 8: case "end": return _context35.stop(); } }, _callee34); })); function setUserPassw() { return _setUserPassw.apply(this, arguments); } return setUserPassw; }() }, { key: "_wrapText", value: function _wrapText(tag, text) { var isBB = aib.markupBB; if (tag.startsWith('[')) { tag = tag.substr(1); isBB = true; } if (isBB) { if (text.includes('\n')) { var _str = "[".concat(tag, "]").concat(text, "[/").concat(tag, "]"); return [_str.length, _str]; } var _m = text.match(/^(\s*)(.*?)(\s*)$/); var str = "".concat(_m[1], "[").concat(tag, "]").concat(_m[2], "[/").concat(tag, "]").concat(_m[3]); return [!_m[2].length ? _m[1].length + tag.length + 2 : str.length, str]; } var m; var rv = ''; var i = 0; var arr = text.split('\n'); for (var len = arr.length; i < len; ++i) { m = arr[i].match(/^(\s*)(.*?)(\s*)$/); rv += '\n' + m[1] + (tag === '^H' ? m[2] + '^H'.repeat(m[2].length) : tag + m[2] + tag) + m[3]; } return [i === 1 && !m[2].length && tag !== '^H' ? m[1].length + tag.length : rv.length - 1, rv.slice(1)]; } }]); return PostForm; }(); function getSubmitError(dc) { var _dc$body; if (!((_dc$body = dc.body) !== null && _dc$body !== void 0 && _dc$body.hasChildNodes()) || $q(aib.qDelForm, dc)) { return null; } var err = _toConsumableArray($Q(aib.qError, dc)).map(function (str) { return str.innerHTML + '\n'; }).join('').replace(/]+>Назад.+/, '') || dc.body.innerHTML; return aib.isIgnoreError(err) ? null : err; } function showSubmitError(error) { if (postform.isQuick) { postform.setReply(true, false); } if (/[cf]aptch|капч|подтвер|verifi/i.test(error)) { postform.refreshCap(true); } $popup('upload', error.toString()); updater.sendErrNotif(); updater.continueUpdater(); DollchanAPI.notify('submitform', { success: false, error: error }); } function checkSubmit(_x19) { return _checkSubmit.apply(this, arguments); } function _checkSubmit() { _checkSubmit = _asyncToGenerator( _regeneratorRuntime().mark(function _callee54(data) { var error, postNum, isDocument, _aib$captchaAfterSubm, _aib3, _data, _aib$getSubmitData, _postform2, tNum, _pByNum$get, thr, statsParam, dForm; return _regeneratorRuntime().wrap(function _callee54$(_context62) { while (1) switch (_context62.prev = _context62.next) { case 0: error = null; postNum = null; isDocument = data instanceof HTMLDocument; if (!aib.getSubmitData) { _context62.next = 12; break; } if (!aib.jsonSubmit) { _context62.next = 9; break; } if (!((_aib$captchaAfterSubm = (_aib3 = aib).captchaAfterSubmit) !== null && _aib$captchaAfterSubm !== void 0 && _aib$captchaAfterSubm.call(_aib3, data))) { _context62.next = 7; break; } return _context62.abrupt("return"); case 7: _data = (isDocument ? data.body.textContent : data).trim(); try { data = JSON.parse(_data); } catch (err) { error = getSubmitError(_data); } case 9: if (!error) { _aib$getSubmitData = aib.getSubmitData(data); error = _aib$getSubmitData.error; postNum = _aib$getSubmitData.postNum; } _context62.next = 13; break; case 12: error = getSubmitError(data); case 13: if (!error) { _context62.next = 16; break; } showSubmitError(error); return _context62.abrupt("return"); case 16: _postform2 = postform, tNum = _postform2.tNum; if ((Cfg.markMyPosts || Cfg.markMyLinks) && postNum) { MyPosts.set(postNum, tNum || postNum); } if (Cfg.favOnReply && !Cfg.sageReply) { if (tNum) { _pByNum$get = pByNum.get(tNum), thr = _pByNum$get.thr; if (!thr.isFav) { thr.toggleFavState(true); } } else { sesStorage['de-fav-newthr'] = JSON.stringify({ num: postNum, date: Date.now() }); } } postform.clearForm(); DollchanAPI.notify('submitform', { success: true, num: postNum }); statsParam = tNum ? 'reply' : 'op'; Cfg.stats[statsParam]++; _context62.next = 25; return CfgSaver.saveObj(aib.domain, function (loadedCfg) { loadedCfg.stats[statsParam]++; return loadedCfg; }); case 25: if (tNum) { _context62.next = 28; break; } if (postNum) { deWindow.location.assign(aib.getThrUrl(aib.b, postNum)); } else if (isDocument) { dForm = $q(aib.qDelForm, data); if (dForm) { deWindow.location.assign(aib.getThrUrl(aib.b, aib.getTNum(dForm))); } } return _context62.abrupt("return"); case 28: if (aib.t) { Post.clearMarks(); Thread.first.loadNewPosts().then(function () { return AjaxError.Success; }, function (err) { return err; }).then(function (err) { infoLoadErrors(err); if (Cfg.scrAfterRep) { scrollTo(0, deWindow.pageYOffset + Thread.first.last.el.getBoundingClientRect().top); } updater.continueUpdater(true); closePopup('upload'); }); } else { pByNum.get(tNum).thr.loadPosts('new', false, false).then(function () { return closePopup('upload'); }); } postform.closeReply(); postform.refreshCap(); case 31: case "end": return _context62.stop(); } }, _callee54); })); return _checkSubmit.apply(this, arguments); } function checkDelete(_x20) { return _checkDelete.apply(this, arguments); } function _checkDelete() { _checkDelete = _asyncToGenerator( _regeneratorRuntime().mark(function _callee55(data) { var err, els, threads, isThr, i, len, el; return _regeneratorRuntime().wrap(function _callee55$(_context63) { while (1) switch (_context63.prev = _context63.next) { case 0: err = getSubmitError(data instanceof HTMLDocument ? data : $createDoc(data)); if (!err) { _context63.next = 5; break; } $popup('delete', Lng.errDelete[lang] + ':\n' + err); updater.sendErrNotif(); return _context63.abrupt("return"); case 5: els = $Q("[de-form] ".concat(aib.qPost.split(', ').join(' input:checked, [de-form] '), " input:checked")); threads = new Set(); isThr = aib.t; for (i = 0, len = els.length; i < len; ++i) { el = els[i]; el.checked = false; if (!isThr) { threads.add(aib.getPostOfEl(el).thr); } } if (!isThr) { _context63.next = 15; break; } Post.clearMarks(); _context63.next = 13; return Thread.first.loadNewPosts()["catch"](function (err) { return infoLoadErrors(err); }); case 13: _context63.next = 17; break; case 15: _context63.next = 17; return Promise.all(_toConsumableArray(threads).map(function (thr) { return thr.loadPosts('new', false, false); })); case 17: $popup('delete', Lng.succDeleted[lang]); case 18: case "end": return _context63.stop(); } }, _callee55); })); return _checkDelete.apply(this, arguments); } function isFormElDisabled(el) { switch (el.tagName.toLowerCase()) { case 'button': case 'input': case 'select': case 'textarea': if (el.hasAttribute('disabled')) { return true; } default: if (nav.matchesSelector(el, 'fieldset[disabled] > :not(legend):not(:first-of-type) *')) { return true; } } return false; } function getFormElements(form, submitter) { var controls, fixName, i, len, field, tag, type, name, options, j, jlen, option, img, files, _j2, _jlen, dirname; return _regeneratorRuntime().wrap(function getFormElements$(_context36) { while (1) switch (_context36.prev = _context36.next) { case 0: controls = $Q('button, input, keygen, object, select, textarea', form); fixName = function fixName(name) { return name ? name.replace(/([^\r])\n|\r([^\n])/g, '$1\r\n$2') : ''; }; i = 0, len = controls.length; case 3: if (!(i < len)) { _context36.next = 65; break; } field = controls[i]; tag = field.tagName.toLowerCase(); type = field.getAttribute('type'); name = field.getAttribute('name'); if (!(field.closest('datalist') || isFormElDisabled(field) || field !== submitter && (tag === 'button' || tag === 'input' && (type === 'submit' || type === 'reset' || type === 'button')) || tag === 'input' && (type === 'checkbox' && !field.checked || type === 'radio' && !field.checked || type === 'image' && !name) || tag === 'object')) { _context36.next = 10; break; } return _context36.abrupt("continue", 62); case 10: if (!(tag === 'select')) { _context36.next = 23; break; } options = $Q('select > option, select > optgrout > option', field); j = 0, jlen = options.length; case 13: if (!(j < jlen)) { _context36.next = 21; break; } option = options[j]; if (!(option.selected && !isFormElDisabled(option))) { _context36.next = 18; break; } _context36.next = 18; return { type: type, el: field, name: fixName(name), value: option.value }; case 18: ++j; _context36.next = 13; break; case 21: _context36.next = 51; break; case 23: if (!(tag === 'input')) { _context36.next = 51; break; } _context36.t0 = type; _context36.next = _context36.t0 === 'image' ? 27 : _context36.t0 === 'checkbox' ? 28 : _context36.t0 === 'radio' ? 28 : _context36.t0 === 'file' ? 31 : 51; break; case 27: throw new Error('input[type="image"] is not supported'); case 28: _context36.next = 30; return { type: type, el: field, name: fixName(name), value: field.value || 'on' }; case 30: return _context36.abrupt("continue", 62); case 31: img = void 0; if (!field.files.length) { _context36.next = 43; break; } files = field.files; _j2 = 0, _jlen = files.length; case 35: if (!(_j2 < _jlen)) { _context36.next = 41; break; } _context36.next = 38; return { name: name, type: type, el: field, value: files[_j2] }; case 38: ++_j2; _context36.next = 35; break; case 41: _context36.next = 50; break; case 43: if (!(field.obj && (img = field.obj.imgFile))) { _context36.next = 48; break; } _context36.next = 46; return { name: name, type: type, el: field, value: new File([img.data], img.name, { type: img.type }) }; case 46: _context36.next = 50; break; case 48: _context36.next = 50; return aib.getEmptyFile(field, fixName(name)); case 50: return _context36.abrupt("continue", 62); case 51: if (!(type === 'textarea')) { _context36.next = 56; break; } _context36.next = 54; return { type: type, el: field, name: name || '', value: field.value }; case 54: _context36.next = 58; break; case 56: _context36.next = 58; return { type: type, el: field, name: fixName(name), value: field.value }; case 58: dirname = field.getAttribute('dirname'); if (!dirname) { _context36.next = 62; break; } _context36.next = 62; return { el: field, name: fixName(dirname), type: 'direction', value: nav.matchesSelector(field, ':dir(rtl)') ? 'rtl' : 'ltr' }; case 62: ++i; _context36.next = 3; break; case 65: case "end": return _context36.stop(); } }, _marked); } function getUploadFunc() { $popup('upload', Lng.sending[lang] + '
' + ' / ()
', true); var isInited = false; var beginTime = Date.now(); var progress = $id('de-uploadprogress'); var counterWrap = progress.nextElementSibling; var _ref31 = _toConsumableArray(counterWrap.children), counterEl = _ref31[0], totalEl = _ref31[1], speedEl = _ref31[2]; return function (_ref32) { var total = _ref32.total, i = _ref32.loaded; if (!isInited) { progress.setAttribute('max', total); $show(progress); totalEl.textContent = prettifySize(total); $show(counterWrap); isInited = true; } progress.value = i; counterEl.textContent = prettifySize(i); speedEl.textContent = "".concat(prettifySize(1e3 * i / (Date.now() - beginTime)), "/").concat(Lng.second[lang]); }; } function html5Submit(_x21, _x22) { return _html5Submit.apply(this, arguments); } function _html5Submit() { _html5Submit = _asyncToGenerator( _regeneratorRuntime().mark(function _callee56(form, submitter) { var needProgress, data, hasFiles, _iterator36, _step36, _step36$value, name, value, type, el, val, _el$obj, fileName, newFileName, mime, cleanData, ajaxParams, url, _args64 = arguments; return _regeneratorRuntime().wrap(function _callee56$(_context64) { while (1) switch (_context64.prev = _context64.next) { case 0: needProgress = _args64.length > 2 && _args64[2] !== undefined ? _args64[2] : false; data = new FormData(); hasFiles = false; _iterator36 = _createForOfIteratorHelperLoose(getFormElements(form, submitter)); case 4: if ((_step36 = _iterator36()).done) { _context64.next = 30; break; } _step36$value = _step36.value, name = _step36$value.name, value = _step36$value.value, type = _step36$value.type, el = _step36$value.el; val = value; if (!(name === 'de-file-txt')) { _context64.next = 9; break; } return _context64.abrupt("continue", 28); case 9: if (!(type === 'file')) { _context64.next = 27; break; } hasFiles = true; fileName = value.name; newFileName = !Cfg.removeFName || (_el$obj = el.obj) !== null && _el$obj !== void 0 && (_el$obj = _el$obj.imgFile) !== null && _el$obj !== void 0 && _el$obj.isCustomName ? fileName : (Cfg.removeFName === 1 ? '' : Date.now() - (Cfg.removeFName === 2 ? 0 : Math.round(Math.random() * 15768e7))) + '.' + getFileExt(fileName); mime = value.type; if (!((Cfg.postSameImg || Cfg.removeEXIF) && (mime === 'image/jpeg' || mime === 'image/png' || mime === 'image/gif' || mime === 'video/webm'))) { _context64.next = 26; break; } _context64.t0 = cleanFile; _context64.next = 18; return readFile(value); case 18: _context64.t1 = _context64.sent.data; _context64.t2 = el.obj ? el.obj.extraFile : null; cleanData = (0, _context64.t0)(_context64.t1, _context64.t2); if (cleanData) { _context64.next = 23; break; } return _context64.abrupt("return", Promise.reject(new Error(Lng.fileCorrupt[lang] + ': ' + fileName))); case 23: val = new File(cleanData, newFileName, { type: mime }); _context64.next = 27; break; case 26: if (Cfg.removeFName) { val = new File([value], newFileName, { type: mime }); } case 27: data.append(name, val); case 28: _context64.next = 4; break; case 30: if (!aib.sendHTML5Post) { _context64.next = 32; break; } return _context64.abrupt("return", aib.sendHTML5Post(form, data, needProgress, hasFiles)); case 32: ajaxParams = { data: data, method: 'POST' }; if (needProgress && hasFiles) { ajaxParams.onprogress = getUploadFunc(); } url = form.action; return _context64.abrupt("return", $ajax(url, ajaxParams).then(function (_ref62) { var text = _ref62.responseText; return aib.jsonSubmit ? text : aib.stormWallFixSubmit ? aib.stormWallFixSubmit(url, text, ajaxParams) : $createDoc(text); })["catch"](function (err) { return Promise.reject(err); })); case 36: case "end": return _context64.stop(); } }, _callee56); })); return _html5Submit.apply(this, arguments); } function cleanFile(data, extraData) { var img = nav.getUnsafeUint8Array(data); var rand = Cfg.postSameImg && String(Math.round(Math.random() * 1e6)); var rv = extraData ? rand ? [img, extraData, rand] : [img, extraData] : rand ? [img, rand] : [img]; var rExif = !!Cfg.removeEXIF; if (!rand && !rExif && !extraData) { return rv; } var i, len, val, lIdx, jpgDat; var subarray = function subarray(begin, end) { return nav.getUnsafeUint8Array(data, begin, end - begin); }; if (img[0] === 0xFF && img[1] === 0xD8) { var deep = 1; for (i = 2, len = img.length - 1, val = [null, null], lIdx = 2, jpgDat = null; i < len;) { if (img[i] === 0xFF) { if (rExif) { if (!jpgDat && deep === 1) { if (img[i + 1] === 0xE1 && img[i + 4] === 0x45) { jpgDat = readExif(data, i + 10, (img[i + 2] << 8) + img[i + 3]); } else if (img[i + 1] === 0xE0 && img[i + 7] === 0x46 && (img[i + 2] !== 0 || img[i + 3] >= 0x0E || img[i + 15] !== 0xFF)) { jpgDat = subarray(i + 11, i + 16); } } if (img[i + 1] >> 4 === 0xE && img[i + 1] !== 0xEE || img[i + 1] === 0xFE) { if (lIdx !== i) { val.push(subarray(lIdx, i)); } i += 2 + (img[i + 2] << 8) + img[i + 3]; lIdx = i; continue; } } else if (img[i + 1] === 0xD8) { deep++; i++; continue; } if (img[i + 1] === 0xD9 && --deep === 0) { break; } } i++; } i += 2; if (!extraData && len - i > 75) { i = len; } if (lIdx === 2) { if (i !== len) { rv[0] = nav.getUnsafeUint8Array(data, 0, i); } return rv; } val[0] = new Uint8Array([0xFF, 0xD8, 0xFF, 0xE0, 0, 0x0E, 0x4A, 0x46, 0x49, 0x46, 0, 1, 1]); val[1] = jpgDat || new Uint8Array([0, 0, 1, 0, 1]); val.push(subarray(lIdx, i)); if (extraData) { val.push(extraData); } if (rand) { val.push(rand); } return val; } if (img[0] === 0x89 && img[1] === 0x50) { for (i = 0, len = img.length - 7; i < len && (img[i] !== 0x49 || img[i + 1] !== 0x45 || img[i + 2] !== 0x4E || img[i + 3] !== 0x44); ++i) ; i += 8; if (i !== len && (extraData || len - i <= 75)) { rv[0] = nav.getUnsafeUint8Array(data, 0, i); } return rv; } if (img[0] === 0x47 && img[1] === 0x49 && img[2] === 0x46) { i = len = img.length; while (i && img[--i - 1] !== 0x00 && img[i] !== 0x3B) ; if (++i !== len) { rv[0] = nav.getUnsafeUint8Array(data, 0, i); } return rv; } if (img[0] === 0x1a && img[1] === 0x45 && img[2] === 0xDF && img[3] === 0xA3) { return new WebmParser(data).addWebmData(rand).getWebmData(); } return null; } function readExif(data, off, len) { var xRes = 0; var yRes = 0; var resT = 0; var dv = nav.getUnsafeDataView(data, off); var le = String.fromCharCode(dv.getUint8(0), dv.getUint8(1)) !== 'MM'; if (dv.getUint16(2, le) !== 0x2A) { return null; } var i = dv.getUint32(4, le); if (i > len) { return null; } for (var j = 0, tgLen = dv.getUint16(i, le); j < tgLen; ++j) { var dE = i + 2 + 12 * j; var tag = dv.getUint16(dE, le); if (tag === 0x0128) { resT = dv.getUint16(dE + 8, le) - 1; } else if (tag === 0x011A || tag === 0x011B) { dE = dv.getUint32(dE + 8, le); if (dE > len) { return null; } if (tag === 0x11A) { xRes = Math.round(dv.getUint32(dE, le) / dv.getUint32(dE + 4, le)); } else { yRes = Math.round(dv.getUint32(dE, le) / dv.getUint32(dE + 4, le)); } } } xRes = xRes || yRes; yRes = yRes || xRes; return new Uint8Array([resT & 0xFF, xRes >> 8, xRes & 0xFF, yRes >> 8, yRes & 0xFF]); } var Files = function () { function Files(form, fileEl) { _classCallCheck(this, Files); this.filesCount = 0; this.fileTr = fileEl.closest(aib.qFormTr); this.onchange = null; this._form = form; this._inputs = []; var els = $Q('input[type="file"]', this.fileTr); for (var i = 0, len = els.length; i < len; ++i) { this._inputs.push(new FileInput(this, els[i])); } this._files = []; this.hideEmpty(); } _createClass(Files, [{ key: "rarInput", get: function get() { var value = $bEnd(doc.body, ''); Object.defineProperty(this, 'rarInput', { value: value }); return value; } }, { key: "thumbsEl", get: function get() { var value; if (aib.multiFile) { value = $aEnd(this.fileTr, '
'); } else { value = this._form.txta.closest(aib.qFormTd).previousElementSibling; value.innerHTML = "
".concat(value.innerHTML, "
"); value = value.lastChild; } Object.defineProperty(this, 'thumbsEl', { value: value }); return value; } }, { key: "changeMode", value: function changeMode() { var isThumbMode = Cfg.fileInputs === 2; for (var _iterator22 = _createForOfIteratorHelperLoose(this._inputs), _step22; !(_step22 = _iterator22()).done;) { var inp = _step22.value; inp.changeMode(isThumbMode); } this.hideEmpty(); } }, { key: "clearInputs", value: function clearInputs() { for (var _iterator23 = _createForOfIteratorHelperLoose(this._inputs), _step23; !(_step23 = _iterator23()).done;) { var inp = _step23.value; inp.clearInp(); } this.hideEmpty(); if (aib.clearFileInputs) { aib.clearFileInputs(); } } }, { key: "hideEmpty", value: function hideEmpty() { for (var els = this._inputs, i = els.length - 1; i > 0; --i) { var inp = els[i]; if (inp.hasFile) { break; } else if (els[i - 1].hasFile) { inp.showInp(); break; } inp.hideInp(); } } }]); return Files; }(); var FileInput = function () { function FileInput(parent, el) { var _el$files; _classCallCheck(this, FileInput); this.extraFile = null; this.hasFile = false; this.imgFile = null; this._input = el; this._isTxtEditable = false; this._isTxtEditName = false; this._mediaEl = null; this._parent = parent; this._rarMsg = null; this._spoilEl = $q(aib.qFormSpoiler, el.parentNode); this._thumb = null; this._utils = $add("
\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t
")); var _ref33 = _toConsumableArray(this._utils.children); this._btnRar = _ref33[0]; this._btnSpoil = _ref33[1]; this._btnTxt = _ref33[2]; this._btnRen = _ref33[3]; this._btnDel = _ref33[4]; this._utils.addEventListener('click', this); this._txtWrap = $add("\n\t\t\t\n\t\t\t")); var _ref34 = _toConsumableArray(this._txtWrap.children); this._txtInput = _ref34[0]; this._txtAddBtn = _ref34[1]; this._txtWrap.addEventListener('click', this); this._toggleDragEvents(this._txtWrap, true); el.obj = this; el.classList.add('de-file-input'); el.addEventListener('change', this); if ((_el$files = el.files) !== null && _el$files !== void 0 && _el$files[0]) { this._removeFile(); } if (Cfg.fileInputs) { $hide(el); if (aib.multiFile) { this._input.setAttribute('multiple', true); } } if (FileInput._isThumbMode) { this._initThumbs(); } else { this._initUtils(); } } _createClass(FileInput, [{ key: "addUrlFile", value: function () { var _addUrlFile = _asyncToGenerator( _regeneratorRuntime().mark(function _callee35(url) { var _this50 = this; var file, _args37 = arguments; return _regeneratorRuntime().wrap(function _callee35$(_context37) { while (1) switch (_context37.prev = _context37.next) { case 0: file = _args37.length > 1 && _args37[1] !== undefined ? _args37[1] : null; if (url) { _context37.next = 3; break; } return _context37.abrupt("return", Promise.reject(new Error('URL is null'))); case 3: $popup('file-loading', Lng.loading[lang], true); _context37.next = 6; return ContentLoader.loadImgData(url, false).then(function (data) { var _file, _file2; if (file) { deWindow.URL.revokeObjectURL(url); } if (!data) { $popup('file-loading', Lng.cantLoad[lang] + ' URL: ' + url); return; } closePopup('file-loading'); _this50._isTxtEditable = _this50._isTxtEditName = false; var name = ((_file = file) === null || _file === void 0 ? void 0 : _file.name) || getFileName(url); var type = ((_file2 = file) === null || _file2 === void 0 ? void 0 : _file2.type) || getFileMime(name); if (!type || name.includes('?')) { var ext; switch (data[0] << 8 | data[1]) { case 0xFFD8: ext = 'jpg'; break; case 0x8950: ext = 'png'; break; case 0x4749: ext = 'gif'; break; case 0x1A45: ext = 'webm'; break; default: ext = ''; } if (ext) { name = name.split('?').shift() + '.' + ext; } } _this50.imgFile = { data: data.buffer, name: name, type: type || getFileMime(name) }; if (!file) { file = new Blob([data], { type: _this50.imgFile.type }); file.name = name; } _this50._parent._files[_this50._parent._inputs.indexOf(_this50)] = file; DollchanAPI.notify('filechange', _this50._parent._files); if (FileInput._isThumbMode) { $hide(_this50._txtWrap); } _this50._onFileChange(true); }); case 6: return _context37.abrupt("return", _context37.sent); case 7: case "end": return _context37.stop(); } }, _callee35); })); function addUrlFile(_x23) { return _addUrlFile.apply(this, arguments); } return addUrlFile; }() }, { key: "changeMode", value: function changeMode(showThumbs) { var _$q6; $toggle(this._input, !Cfg.fileInputs); this._input.toggleAttribute('multiple', aib.multiFile && Cfg.fileInputs); $toggle(this._btnRen, Cfg.fileInputs && this.hasFile); if (!(showThumbs ^ !!this._thumb)) { return; } if (showThumbs) { this._initThumbs(); return; } this._initUtils(); $show(this._parent.fileTr); $show(this._txtWrap); if (this._mediaEl) { deWindow.URL.revokeObjectURL(this._mediaEl.src); } this._toggleDragEvents(this._thumb, false); (_$q6 = $q('.de-file-txt-area')) === null || _$q6 === void 0 || _$q6.remove(); this._thumb.remove(); this._thumb = this._mediaEl = null; } }, { key: "clearInp", value: function clearInp() { if (FileInput._isThumbMode) { this._thumb.classList.add('de-file-off'); if (this._mediaEl) { deWindow.URL.revokeObjectURL(this._mediaEl.src); this._mediaEl.parentNode.title = Lng.youCanDrag[lang]; this._mediaEl.remove(); this._mediaEl = null; } } if (this._btnDel) { var _this$_rarMsg; this._toggleDelBtn(false); $hide(this._btnSpoil); if (this._spoilEl) { this._spoilEl.checked = this._btnSpoil.checked = false; } $hide(this._btnRar); $hide(this._txtAddBtn); (_this$_rarMsg = this._rarMsg) === null || _this$_rarMsg === void 0 || _this$_rarMsg.remove(); if (FileInput._isThumbMode) { $hide(this._txtWrap); } this._txtInput.value = ''; this._txtInput.classList.add('de-file-txt-noedit'); this._txtInput.placeholder = Lng.dropFileHere[lang]; } this.extraFile = this.imgFile = null; this._isTxtEditable = this._isTxtEditName = false; this._changeFilesCount(-1); this._removeFile(); } }, { key: "handleEvent", value: function handleEvent(e) { var _this51 = this; var el = e.target; var thumb = this._thumb; var isThumb = el === thumb || el.className === 'de-file-img'; switch (e.type) { case 'change': { var inpArray = this._parent._inputs; var curInpIdx = inpArray.indexOf(this); var filesLen = el.files.length; if (filesLen > 1) { var allowedLen = Math.min(filesLen, inpArray.length - curInpIdx); var j = allowedLen; for (var i = 0; i < allowedLen; ++i) { FileInput._readDroppedFile(inpArray[curInpIdx + i], el.files[i]).then(function () { if (! --j) { _this51._removeFileHelper(); } }); this._parent._files[curInpIdx + i] = el.files[i]; } } else { if (filesLen > 0) { setTimeout(function () { return _this51._onFileChange(false); }, 20); this._parent._files[curInpIdx] = el.files[0]; } else { this.clearInp(); delete this._parent._files[curInpIdx]; } } DollchanAPI.notify('filechange', this._parent._files); break; } case 'click': { var parent = el.parentNode; if (isThumb) { this._input.click(); } else if (parent === this._btnDel) { this.clearInp(); this._parent.hideEmpty(); delete this._parent._files[this._parent._inputs.indexOf(this)]; DollchanAPI.notify('filechange', this._parent._files); } else if (parent === this._btnRar) { this._addRarJpeg(); } else if (parent === this._btnRen) { var isShow = this._isTxtEditName = !this._isTxtEditName; this._isTxtEditable = !this._isTxtEditable; if (FileInput._isThumbMode) { $toggle(this._txtWrap, isShow); } $toggle(this._txtAddBtn, isShow); this._txtInput.classList.toggle('de-file-txt-noedit', !isShow); if (isShow) { this._txtInput.focus(); } } else if (parent === this._btnTxt) { this._toggleDelBtn(this._isTxtEditable = true); $show(this._txtAddBtn); if (FileInput._isThumbMode) { $toggle(this._txtWrap); } this._txtInput.classList.remove('de-file-txt-noedit'); this._txtInput.placeholder = Lng.enterTheLink[lang]; this._txtInput.focus(); } else if (el === this._btnSpoil) { this._spoilEl.checked = this._btnSpoil.checked; return; } else if (el === this._txtAddBtn) { if (this._isTxtEditName) { if (FileInput._isThumbMode) { $hide(this._txtWrap); } $hide(this._txtAddBtn); this._txtInput.classList.add('de-file-txt-noedit'); this._isTxtEditable = this._isTxtEditName = false; var newName = this._txtInput.value; if (!newName) { this._txtInput.value = this.imgFile ? this.imgFile.name : this._input.files[0].name; return; } if (this.imgFile) { this.imgFile.isCustomName = true; this.imgFile.name = newName; if (FileInput._isThumbMode) { this._addThumbTitle(newName, this.imgFile.data.byteLength); } return; } var file = this._input.files[0]; readFile(file).then(function (_ref35) { var data = _ref35.data; _this51.imgFile = { data: data, name: newName, type: file.type, isCustomName: true }; _this51._removeFileHelper(); if (FileInput._isThumbMode) { _this51._addThumbTitle(newName, data.byteLength); } }); return; } else { this.addUrlFile(this._txtInput.value); } } else if (el === this._txtInput && !this._isTxtEditable) { this._input.click(); this._txtInput.blur(); } break; } case 'dragenter': if (isThumb) { thumb.classList.add('de-file-drag'); } return; case 'dragleave': if (isThumb && el.classList.contains('de-file-img')) { thumb.classList.remove('de-file-drag'); } return; case 'drop': { var dt = e.dataTransfer; if (!isThumb && el !== this._txtInput) { return; } var _filesLen = dt.files.length; if (_filesLen) { var _inpArray = this._parent._inputs; var inpLen = _inpArray.length; for (var _i12 = _inpArray.indexOf(this), _j3 = 0; _i12 < inpLen && _j3 < _filesLen; ++_i12, ++_j3) { FileInput._readDroppedFile(_inpArray[_i12], dt.files[_j3]); this._parent._files[_i12] = dt.files[_j3]; } DollchanAPI.notify('filechange', this._parent._files); } else { this.addUrlFile(dt.getData('text/plain')); } if (FileInput._isThumbMode) { setTimeout(function () { return thumb.classList.remove('de-file-drag'); }, 10); } } } e.preventDefault(); e.stopPropagation(); } }, { key: "hideInp", value: function hideInp() { if (FileInput._isThumbMode) { this._toggleDelBtn(false); $hide(this._thumb); $hide(this._txtWrap); } $hide(this._wrap); } }, { key: "showInp", value: function showInp() { if (FileInput._isThumbMode) { $show(this._thumb); } $show(this._wrap); } }, { key: "_wrap", get: function get() { return aib.multiFile ? this._input.parentNode : this._input; } }, { key: "_addNewThumb", value: function _addNewThumb(fileData, fileName, fileType, fileSize) { var el = this._thumb; el.classList.remove('de-file-off'); el = el.firstChild.firstChild; el.title = "".concat(fileName, ", ").concat((fileSize / 1024).toFixed(2), "KB"); this._mediaEl = el = $aBegin(el, fileType.startsWith('video/') ? '' : ''); el.src = deWindow.URL.createObjectURL(new Blob([fileData])); if (el = el.nextSibling) { deWindow.URL.revokeObjectURL(el.src); el.remove(); } } }, { key: "_addRarJpeg", value: function _addRarJpeg() { var _this52 = this; var el = this._parent.rarInput; el.onchange = function (e) { $hide(_this52._btnRar); var myBtn = _this52._rarMsg = $aBegin(_this52._utils, ''); var file = e.target.files[0]; readFile(file).then(function (_ref36) { var data = _ref36.data; if (_this52._rarMsg === myBtn) { myBtn.className = 'de-file-rarmsg'; var origFileName = _this52.imgFile ? _this52.imgFile.name : _this52._input.files[0].name; myBtn.title = origFileName + ' + ' + file.name; myBtn.textContent = getFileExt(origFileName) + ' + ' + getFileExt(file.name); _this52.extraFile = data; } }); }; el.click(); } }, { key: "_addThumbTitle", value: function _addThumbTitle(name, size) { this._thumb.firstChild.firstChild.title = "".concat(name, ", ").concat((size / 1024).toFixed(2), "KB"); } }, { key: "_changeFilesCount", value: function _changeFilesCount(val) { this._parent.filesCount = Math.max(this._parent.filesCount + val, 0); } }, { key: "_initThumbs", value: function _initThumbs() { var _this53 = this; var fileTr = this._parent.fileTr; $hide(fileTr); $hide(this._txtWrap); var isTr = fileTr.tagName.toLowerCase() === 'tr'; var txtArea = $q('.de-file-txt-area') || $bBegin(fileTr, isTr ? '' : '
'); (isTr ? txtArea.lastChild : txtArea).append(this._txtWrap); this._thumb = $bEnd(this._parent.thumbsEl, "
")); ['click', 'dragenter'].forEach(function (e) { return _this53._thumb.addEventListener(e, _this53); }); this._thumb.append(this._utils); this._toggleDragEvents(this._thumb, true); if (this.hasFile) { this._showFileThumb(); } } }, { key: "_initUtils", value: function _initUtils() { this._input.parentNode.classList.add('de-file-wrap'); this._input.before(this._txtWrap); this._input.after(this._utils); } }, { key: "_onFileChange", value: function _onFileChange(hasImgFile) { this._txtInput.value = hasImgFile ? this.imgFile.name : this._input.files[0].name; if (!hasImgFile) { this.imgFile = null; } if (this._parent.onchange) { this._parent.onchange(); } if (FileInput._isThumbMode) { this._showFileThumb(); } if (this.hasFile) { this.extraFile = null; } else { this.hasFile = true; this._changeFilesCount(+1); this._toggleDelBtn(true); $hide(this._txtAddBtn); if (FileInput._isThumbMode) { $hide(this._txtWrap); } if (this._spoilEl) { this._btnSpoil.checked = this._spoilEl.checked; $show(this._btnSpoil); } this._txtInput.classList.add('de-file-txt-noedit'); this._txtInput.placeholder = Lng.dropFileHere[lang]; } this._parent.hideEmpty(); if (!nav.isPresto && !aib._4chan && /^image\/(?:png|jpeg)$/.test(hasImgFile ? this.imgFile.type : this._input.files[0].type)) { var _this$_rarMsg2; (_this$_rarMsg2 = this._rarMsg) === null || _this$_rarMsg2 === void 0 || _this$_rarMsg2.remove(); $show(this._btnRar); } } }, { key: "_removeFile", value: function _removeFile() { this._removeFileHelper(); this.hasFile = false; if (this._parent._files) { delete this._parent._files[this._parent._inputs.indexOf(this)]; } } }, { key: "_removeFileHelper", value: function _removeFileHelper() { var oldEl = this._input; var newEl = $aEnd(oldEl, oldEl.outerHTML); oldEl.removeEventListener('change', this); newEl.addEventListener('change', this); newEl.obj = this; this._input = newEl; oldEl.remove(); } }, { key: "_showFileThumb", value: function _showFileThumb() { var _this54 = this; var imgFile = this.imgFile; if (imgFile) { this._addNewThumb(imgFile.data, imgFile.name, imgFile.type, imgFile.data.byteLength); return; } var file = this._input.files[0]; if (file) { readFile(file).then(function (_ref37) { var data = _ref37.data; if (_this54._input.files[0] === file) { _this54._addNewThumb(data, file.name, file.type, file.size); } }); } } }, { key: "_toggleDelBtn", value: function _toggleDelBtn(isShow) { $toggle(this._btnDel, isShow); $toggle(this._btnRen, Cfg.fileInputs && isShow && this.hasFile); $toggle(this._btnTxt, !isShow); } }, { key: "_toggleDragEvents", value: function _toggleDragEvents(el, isAdd) { var _this55 = this; var name = isAdd ? 'addEventListener' : 'removeEventListener'; el[name]('dragover', function (e) { return e.preventDefault(); }); ['dragenter', 'dragleave', 'drop'].forEach(function (e) { return el[name](e, _this55); }); } }], [{ key: "_isThumbMode", get: function get() { return Cfg.fileInputs === 2; } }, { key: "_readDroppedFile", value: function _readDroppedFile(inputObj, file) { return readFile(file).then(function (_ref38) { var data = _ref38.data; inputObj.imgFile = { data: data, name: file.name, type: file.type }; inputObj.showInp(); inputObj._onFileChange(true); }); } }]); return FileInput; }(); var Captcha = function () { function Captcha(el, initNum) { _classCallCheck(this, Captcha); this.hasCaptcha = true; this.textEl = null; this.tNum = initNum; this.parentEl = nav.matchesSelector(el, aib.qFormTr) ? el : aib.getCapParent(el); this.isAdded = false; this._isHcap = !!$q('.h-captcha', this.parentEl); this._isRecap = this._isHcap || !!$q('[id*="recaptcha"], [class*="recaptcha"]', this.parentEl); this._lastUpdate = null; this.originHTML = this.parentEl.innerHTML; $hide(this.parentEl); if (!this._isRecap) { this.parentEl.innerHTML = ''; } } _createClass(Captcha, [{ key: "addCaptcha", value: function addCaptcha() { if (this.isAdded) { return; } this.isAdded = true; if (this._isHcap) { $show(this.parentEl); } else if (this._isRecap) { var el = $q('#g-recaptcha, .g-recaptcha'); el.insertAdjacentHTML('afterend', "
")); el.remove(); } else { this.parentEl.innerHTML = this.originHTML; this.textEl = $q('input[type="text"][name*="aptcha"]', this.parentEl); } this.initCapPromise(); } }, { key: "handleEvent", value: function handleEvent(e) { switch (e.type) { case 'keypress': { if (!Cfg.captchaLang || e.which === 0) { return; } var ruUa = 'йцукенгшщзхъїфыівапролджэєячсмитьбюёґ'; var en = 'qwertyuiop[]]assdfghjkl;\'\'zxcvbnm,.`\\'; var code = e.charCode || e.keyCode; var i; var chr = String.fromCharCode(code).toLowerCase(); if (Cfg.captchaLang === 1) { if (code < 0x0410 || code > 0x04FF || (i = ruUa.indexOf(chr)) === -1) { return; } chr = en[i]; } else { if (code < 0x0021 || code > 0x007A || (i = en.indexOf(chr)) === -1) { return; } chr = ruUa[i]; } insertText(e.target, chr); break; } case 'focus': this.updateOutdated(); } e.preventDefault(); e.stopPropagation(); } }, { key: "initCapPromise", value: function initCapPromise() { var _this56 = this; var initPromise = aib.captchaInit ? aib.captchaInit(this) : null; if (initPromise) { initPromise.then(function () { return _this56.showCaptcha(); }, function (err) { if (err instanceof AjaxError) { _this56._setUpdateError(err); } else { _this56.hasCaptcha = false; } }); } else if (this.hasCaptcha) { this.showCaptcha(true); } } }, { key: "initImage", value: function initImage(img) { var _this57 = this; img.title = Lng.refresh[lang]; img.alt = Lng.loading[lang]; img.style.cssText = 'vertical-align: text-bottom; border: none; cursor: pointer;'; img.onclick = function () { return _this57.refreshCaptcha(true); }; } }, { key: "initTextEl", value: function initTextEl() { var _this58 = this; this.textEl.autocomplete = 'off'; if (!aib.formHeaders && (aib.multiFile || Cfg.fileInputs !== 2)) { this.textEl.placeholder = Lng.cap[lang]; } ['keypress', 'focus'].forEach(function (e) { return _this58.textEl.addEventListener(e, _this58); }); this.textEl.onkeypress = null; this.textEl.onfocus = null; } }, { key: "showCaptcha", value: function showCaptcha() { var isUpdateImage = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; if (!this.textEl) { $show(this.parentEl); if (aib.captchaUpdate) { aib.captchaUpdate(this, false); } else if (this._isRecap) { this._updateRecap(); } return; } this.initTextEl(); var img; if (this._isRecap || !(img = $q('img', this.parentEl))) { $show(this.parentEl); return; } this.initImage(img); var a = img.parentNode; if (a.tagName.toLowerCase() === 'a') { a.replaceWith(img); } if (isUpdateImage) { this.refreshCaptcha(false); } else { this._lastUpdate = Date.now(); } $show(this.parentEl); } }, { key: "refreshCaptcha", value: function refreshCaptcha(isFocus) { var _this59 = this; var isError = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; var tNum = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.tNum; if (!this.isAdded || tNum !== this.tNum) { this.tNum = tNum; this.isAdded = false; this.hasCaptcha = true; this.textEl = null; $hide(this.parentEl); this.addCaptcha(); return; } else if (!this.hasCaptcha && !isError) { return; } this._lastUpdate = Date.now(); if (aib.captchaUpdate) { var updatePromise = aib.captchaUpdate(this, isError); if (updatePromise) { updatePromise.then(function () { return _this59._updateTextEl(isFocus); }, function (err) { return _this59._setUpdateError(err); }); } } else if (this._isRecap) { this._updateRecap(); } else if (this.textEl) { this._updateTextEl(isFocus); var img = $q('img', this.parentEl); if (!img) { return; } if (!aib.getCaptchaSrc) { img.click(); return; } var src = img.getAttribute('src'); if (!src) { return; } var newSrc = aib.getCaptchaSrc(src, tNum); img.src = ''; img.src = newSrc; if (aib.stormWallFixCaptcha) { aib.stormWallFixCaptcha(newSrc, img); } } } }, { key: "updateHelper", value: function updateHelper(url, fn) { if (aib.captchaUpdPromise) { aib.captchaUpdPromise.cancelPromise(); } return aib.captchaUpdPromise = $ajax(url).then(function (xhr) { aib.captchaUpdPromise = null; fn(xhr); }, function (err) { if (!(err instanceof CancelError)) { aib.captchaUpdPromise = null; return CancelablePromise.reject(err); } }); } }, { key: "updateOutdated", value: function updateOutdated() { if (!aib.makaba && this._lastUpdate && Date.now() - this._lastUpdate > Cfg.capUpdTime * 1e3) { this.refreshCaptcha(false); } } }, { key: "_setUpdateError", value: function _setUpdateError(e) { var _this60 = this; if (e) { this.parentEl.innerHTML = e.toString(); this.isAdded = false; this.parentEl.onclick = function () { _this60.parentEl.onclick = null; _this60.addCaptcha(); }; $show(this.parentEl); } } }, { key: "_updateRecap", value: function _updateRecap() { var script = doc.createElement('script'); script.src = aib.protocol + (this._isHcap ? '//js.hcaptcha.com/1/api.js' : '//www.google.com/recaptcha/api.js'); doc.head.append(script); setTimeout(function () { return script.remove(); }, 1e5); } }, { key: "_updateTextEl", value: function _updateTextEl(isFocus) { if (this.textEl) { this.textEl.value = ''; if (isFocus) { this.textEl.focus(); } } } }]); return Captcha; }(); var AbstractPost = function () { function AbstractPost(thr, num, isOp) { _classCallCheck(this, AbstractPost); this.isOp = isOp; this.kid = null; this.num = num; this.ref = new RefMap(this); this.thr = thr; this._hasEvents = false; this._linkDelay = 0; this._menu = null; this._menuDelay = 0; } _createClass(AbstractPost, [{ key: "btnFav", get: function get() { var value = $q('.de-btn-fav, .de-btn-fav-sel', this.btns); Object.defineProperty(this, 'btnFav', { value: value }); return value; } }, { key: "btnHide", get: function get() { var value = this.btns.firstChild; Object.defineProperty(this, 'btnHide', { value: value }); return value; } }, { key: "images", get: function get() { var value = new PostImages(this); Object.defineProperty(this, 'images', { value: value }); return value; } }, { key: "mp3Obj", get: function get() { var value = $bBegin(this.msg, '
'); Object.defineProperty(this, 'mp3Obj', { value: value }); return value; } }, { key: "refLinks", value: _regeneratorRuntime().mark(function refLinks() { var links, lNum, i, len, link, tc; return _regeneratorRuntime().wrap(function refLinks$(_context38) { while (1) switch (_context38.prev = _context38.next) { case 0: links = $Q('a', this.msg); i = 0, len = links.length; case 2: if (!(i < len)) { _context38.next = 12; break; } link = links[i]; tc = link.textContent; if (!(tc[0] !== '>' || tc[1] !== '>' || !(lNum = parseInt(tc.substr(2), 10)))) { _context38.next = 7; break; } return _context38.abrupt("continue", 9); case 7: _context38.next = 9; return [link, lNum]; case 9: ++i; _context38.next = 2; break; case 12: case "end": return _context38.stop(); } }, refLinks, this); }) }, { key: "msg", get: function get() { var value = $q(aib.qPostMsg, this.el); Object.defineProperty(this, 'msg', { value: value, configurable: true }); return value; } }, { key: "trunc", get: function get() { var value = null; var el = aib.qTrunc && $q(aib.qTrunc, this.el); if (el && /long|full comment|gekürzt|слишком|длинн|мног|полн/i.test(el.textContent)) { value = el; } Object.defineProperty(this, 'trunc', { value: value, configurable: true }); return value; } }, { key: "videos", get: function get() { var value = Cfg.embedYTube ? new Videos(this) : null; Object.defineProperty(this, 'videos', { value: value }); return value; } }, { key: "addFuncs", value: function addFuncs() { RefMap.updateRefMap(this, true); embedAudioLinks(this); } }, { key: "handleEvent", value: function handleEvent(e) { var _temp, _this61 = this; var temp; var el = nav.fixEventEl(e.target); var type = e.type; var isOutEvent = type === 'mouseout'; var isPview = this instanceof Pview; if (type === 'click') { if (aib.handlePostClick) { aib.handlePostClick(this, el, e); } switch (e.button) { case 0: break; case 1: e.stopPropagation(); default: return; } if (this._menu) { this._menu.removeMenu(); this._menu = null; } switch (el.tagName.toLowerCase()) { case 'a': if (el.classList.contains('de-video-link')) { this.videos.clickLink(el, Cfg.embedYTube); e.preventDefault(); return; } if (((_temp = temp = el.firstElementChild) === null || _temp === void 0 ? void 0 : _temp.tagName.toLowerCase()) !== 'img') { temp = el.parentNode; if (temp === this.trunc) { this._getFullMsg(temp, false); e.preventDefault(); e.stopPropagation(); } else if (Cfg.insertNum && postform.form && (this._pref === temp || this._pref === el) && !/Reply|Ответ/.test(el.textContent)) { e.preventDefault(); e.stopPropagation(); if (!Cfg.showRepBtn) { postform.getSelectedText(); postform.showQuickReply(isPview ? Pview.topParent : this, this.num, !isPview, false); postform.quotedText = ''; } else if (postform.isQuick || aib.t && postform.isHidden) { postform.showQuickReply(isPview ? Pview.topParent : this, this.num, false, true); } else if (aib.t) { var formText = postform.txta.value; var isOnNewLine = formText === '' || formText.slice(-1) === '\n'; insertText(postform.txta, ">>".concat(this.num).concat(isOnNewLine ? '\n' : '')); } else { deWindow.location.assign(el.href.replace(/#i/, '#')); } } else if ((temp = el.textContent)[0] === '>' && temp[1] === '>' && !temp[2].includes('/')) { var post = pByNum.get(+temp.match(/\d+/)); if (post) { post.selectAndScrollTo(); } } return; } el = temp; case 'img': if (el.classList.contains('de-video-thumb')) { if (Cfg.embedYTube === 1) { var videos = this.videos; videos.currentLink.classList.add('de-current'); videos.setPlayer(videos.playerInfo, el.classList.contains('de-ytube')); e.preventDefault(); } } else if (Cfg.expandImgs !== 0) { this._clickImage(el, e); } return; case 'object': case 'video': if (Cfg.expandImgs !== 0 && !ExpandableImage.isControlClick(e)) { this._clickImage(el, e); } return; } switch (el.classList[0]) { case 'de-btn-expthr': this.thr.loadPosts('all'); return; case 'de-btn-fav': this.thr.toggleFavState(true, isPview ? this : null); return; case 'de-btn-fav-sel': this.thr.toggleFavState(false, isPview ? this : null); return; case 'de-btn-hide': case 'de-btn-hide-user': case 'de-btn-unhide': case 'de-btn-unhide-user': this.setUserVisib(!this.isHidden); return; case 'de-btn-img': postform.quotedText = aib.getImgRealName(aib.getImgWrap(el)); postform.showQuickReply(isPview ? Pview.topParent : this, this.num, !isPview, false); return; case 'de-btn-reply': postform.showQuickReply(isPview ? Pview.topParent : this, this.num, !isPview, false); postform.quotedText = ''; return; case 'de-btn-sage': Spells.addSpell(9, '', false); return; case 'de-btn-stick': this.toggleSticky(true); return; case 'de-btn-stick-on': this.toggleSticky(false); return; } return; } if (!this._hasEvents) { this._hasEvents = true; ['click', 'mouseout'].forEach(function (e) { return _this61.el.addEventListener(e, _this61, true); }); } if (Cfg.embedYTube === 2 && el.classList.contains('de-video-link')) { this.videos.toggleFloatedThumb(el, isOutEvent); } if (!isOutEvent && Cfg.expandImgs && el.tagName.toLowerCase() === 'img' && !el.classList.contains('de-fullimg') && (temp = this.images.getImageByEl(el)) && (temp.isImage || temp.isVideo)) { el.title = Cfg.expandImgs === 1 ? Lng.expImgInline[lang] : Lng.expImgFull[lang]; } switch (el.classList[0]) { case 'de-btn-expthr': this.btns.title = Lng.expandThr[lang]; this._addMenu(el, isOutEvent, arrTags(Lng.selExpandThr[lang], '', '')); return; case 'de-btn-fav': this.btns.title = Lng.addFav[lang]; return; case 'de-btn-fav-sel': this.btns.title = Lng.delFav[lang]; return; case 'de-btn-hide': case 'de-btn-hide-user': case 'de-btn-unhide': case 'de-btn-unhide-user': this.btns.title = this.isOp ? Lng.toggleThr[lang] : Lng.togglePost[lang]; if (Cfg.showHideBtn === 1) { this._addMenu(el, isOutEvent, (this instanceof Pview ? pByNum.get(this.num) : this)._getMenuHide()); } return; case 'de-btn-img': if (el.parentNode.className !== 'de-fullimg-info') { this._addMenu(el, isOutEvent, Menu.getMenuImg(el)); } return; case 'de-btn-reply': { var title = this.btns.title = this.isOp ? Lng.replyToThr[lang] : Lng.replyToPost[lang]; if (Cfg.showRepBtn === 1) { if (!isOutEvent) { postform.getSelectedText(); } this._addMenu(el, isOutEvent, "".concat(title, "") + (aib.reportForm ? "".concat(this.num === this.thr.num ? Lng.reportThr[lang] : Lng.reportPost[lang], "") : '') + (Cfg.markMyPosts || Cfg.markMyLinks ? "".concat(MyPosts.has(this.num) ? Lng.deleteMyPost[lang] : Lng.markMyPost[lang], "") : '')); } return; } case 'de-btn-sage': this.btns.title = 'SAGE'; return; case 'de-btn-stick': this.btns.title = Lng.attachPview[lang]; return; case 'de-post-btns': el.removeAttribute('title'); return; default: if (!Cfg.linksNavig || el.tagName.toLowerCase() !== 'a' || el.isNotRefLink) { return; } if (!el.textContent.startsWith('>>')) { el.isNotRefLink = true; return; } el.className = 'de-link-postref ' + el.className; case 'de-link-backref': case 'de-link-postref': if (!Cfg.linksNavig) { return; } if (isOutEvent) { clearTimeout(this._linkDelay); if (!(aib.getPostOfEl(nav.fixEventEl(e.relatedTarget)) instanceof Pview) && Pview.top) { Pview.top.markToDel(); } else if (this.kid) { this.kid.markToDel(); } } else { this._linkDelay = setTimeout(function () { return _this61.kid = Pview.showPview(_this61, el); }, Cfg.linksOver); } e.preventDefault(); e.stopPropagation(); } } }, { key: "toggleFavBtn", value: function toggleFavBtn(isEnable) { var elClass = isEnable ? 'de-btn-fav-sel' : 'de-btn-fav'; if (this.btnFav) { this.btnFav.setAttribute('class', elClass); } if (this.thr.btnFav) { this.thr.btnFav.setAttribute('class', elClass); } } }, { key: "updateMsg", value: function updateMsg(newMsg, sRunner) { var videoExt, videoLinks; if (Cfg.embedYTube) { videoExt = $q('.de-video-ext', this.msg); videoLinks = $Q(':not(.de-video-ext) > .de-video-link', this.msg); } this.msg.replaceWith(newMsg); Object.defineProperties(this, { msg: { configurable: true, value: newMsg }, trunc: { configurable: true, value: null } }); Post.Сontent.removeTempData(this); if (Cfg.embedYTube) { this.videos.updatePost(videoLinks, $Q('a[href*="youtu"], a[href*="vimeo.com"]', newMsg), false); if (videoExt) { newMsg.append(videoExt); } } this.addFuncs(); sRunner.runSpells(this); embedPostMsgImages(this.el); if (this.isHidden) { this.hideContent(this.isHidden); } closePopup('load-fullmsg'); } }, { key: "changeMyMark", value: function changeMyMark(val) { var _this62 = this; this.el.classList.toggle('de-mypost', val); $Q("[de-form] ".concat(aib.qPostMsg, " a[href$=\"").concat(aib.anchor + this.num, "\"]")).forEach(function (el) { var post = aib.getPostOfEl(el); if (post.el !== _this62.el) { el.classList.toggle('de-ref-you', val); post.el.classList.toggle('de-mypost-reply', val); } }); } }, { key: "_addMenu", value: function _addMenu(el, isOutEvent, html) { var _this63 = this; if (!this.menu || this.menu.parentEl !== el) { if (isOutEvent) { clearTimeout(this._menuDelay); } else { this._menuDelay = setTimeout(function () { return _this63._showMenu(el, html); }, Cfg.linksOver); } } } }, { key: "_clickImage", value: function _clickImage(el, e) { var image = this.images.getImageByEl(el); if (!image || !image.isImage && !image.isVideo) { return; } image.expandImg(Cfg.expandImgs === 1 ^ e.ctrlKey, e); e.preventDefault(); e.stopPropagation(); } }, { key: "_clickMenu", value: function () { var _clickMenu2 = _asyncToGenerator( _regeneratorRuntime().mark(function _callee36(el, e) { var isHide, num, _this$_selRange, start, end, inMsgSel, _this$images$firstAtt, w, wi, h, hash, words, post, isAdd, isPview, task; return _regeneratorRuntime().wrap(function _callee36$(_context39) { while (1) switch (_context39.prev = _context39.next) { case 0: isHide = !this.isHidden; num = this.num; _context39.t0 = el.getAttribute('info'); _context39.next = _context39.t0 === 'hide-sel' ? 5 : _context39.t0 === 'hide-name' ? 24 : _context39.t0 === 'hide-trip' ? 27 : _context39.t0 === 'hide-img' ? 30 : _context39.t0 === 'hide-imgn' ? 34 : _context39.t0 === 'hide-ihash' ? 37 : _context39.t0 === 'hide-noimg' ? 44 : _context39.t0 === 'hide-text' ? 47 : _context39.t0 === 'hide-notext' ? 50 : _context39.t0 === 'hide-refs' ? 53 : _context39.t0 === 'hide-refsonly' ? 56 : _context39.t0 === 'img-load' ? 59 : _context39.t0 === 'post-markmy' ? 61 : _context39.t0 === 'post-reply' ? 65 : _context39.t0 === 'post-report' ? 69 : _context39.t0 === 'thr-exp' ? 71 : 73; break; case 5: _this$_selRange = this._selRange, start = _this$_selRange.startContainer, end = _this$_selRange.endContainer; if (start.nodeType === 3) { start = start.parentNode; } if (end.nodeType === 3) { end = end.parentNode; } inMsgSel = "".concat(aib.qPostMsg, ", ").concat(aib.qPostMsg, " *"); if (!(nav.matchesSelector(start, inMsgSel) && nav.matchesSelector(end, inMsgSel) || nav.matchesSelector(start, aib.qPostSubj) && nav.matchesSelector(end, aib.qPostSubj))) { _context39.next = 19; break; } if (!this._selText.includes('\n')) { _context39.next = 15; break; } _context39.next = 13; return Spells.addSpell(1 , "/".concat(escapeRegExp(this._selText).replace(/\r?\n/g, '\\n'), "/"), false); case 13: _context39.next = 17; break; case 15: _context39.next = 17; return Spells.addSpell(0 , this._selText.toLowerCase(), false); case 17: _context39.next = 23; break; case 19: dummy.innerHTML = ''; dummy.append(this._selRange.cloneContents()); _context39.next = 23; return Spells.addSpell(2 , "/".concat(escapeRegExp(dummy.innerHTML.replace(/^<[^>]+>|<[^>]+>$/g, '')), "/"), false); case 23: return _context39.abrupt("return"); case 24: _context39.next = 26; return Spells.addSpell(6 , this.posterName, false); case 26: return _context39.abrupt("return"); case 27: _context39.next = 29; return Spells.addSpell(7 , this.posterTrip, false); case 29: return _context39.abrupt("return"); case 30: _this$images$firstAtt = this.images.firstAttach, w = _this$images$firstAtt.weight, wi = _this$images$firstAtt.width, h = _this$images$firstAtt.height; _context39.next = 33; return Spells.addSpell(8 , [0, [w, w], [wi, wi, h, h]], false); case 33: return _context39.abrupt("return"); case 34: _context39.next = 36; return Spells.addSpell(3 , "/".concat(escapeRegExp(this.images.firstAttach.name), "/"), false); case 36: return _context39.abrupt("return"); case 37: _context39.next = 39; return ImagesHashStorage.getHash(this.images.firstAttach); case 39: hash = _context39.sent; if (!(hash !== -1)) { _context39.next = 43; break; } _context39.next = 43; return Spells.addSpell(4 , hash, false); case 43: return _context39.abrupt("return"); case 44: _context39.next = 46; return Spells.addSpell(0x108 , '', true); case 46: return _context39.abrupt("return"); case 47: words = Post.getWrds(this.text); for (post = Thread.first.op; post; post = post.next) { Post.findSameText(num, !isHide, words, post); } return _context39.abrupt("return"); case 50: _context39.next = 52; return Spells.addSpell(0x10B , '', true); case 52: return _context39.abrupt("return"); case 53: this.ref.toggleRef(isHide, true); this.setUserVisib(isHide); return _context39.abrupt("return"); case 56: _context39.next = 58; return Spells.addSpell(0 , '>>' + num, false); case 58: return _context39.abrupt("return"); case 59: this._downloadImageByLink(el, e); return _context39.abrupt("return"); case 61: isAdd = !MyPosts.has(num); if (isAdd) { MyPosts.set(num, this.thr.num); } else { MyPosts.removeStorage(num); } this.changeMyMark(isAdd); return _context39.abrupt("return"); case 65: isPview = this instanceof Pview; postform.showQuickReply(isPview ? Pview.topParent : this, num, !isPview, false); postform.quotedText = ''; return _context39.abrupt("return"); case 69: aib.reportForm(num, this.thr.num); return _context39.abrupt("return"); case 71: task = +el.textContent.match(/\d+/); this.thr.loadPosts(!task ? 'all' : task === 10 ? 'more' : task); case 73: case "end": return _context39.stop(); } }, _callee36, this); })); function _clickMenu(_x24, _x25) { return _clickMenu2.apply(this, arguments); } return _clickMenu; }() }, { key: "_downloadImageByLink", value: function () { var _downloadImageByLink2 = _asyncToGenerator( _regeneratorRuntime().mark(function _callee37(el, e) { var url, data; return _regeneratorRuntime().wrap(function _callee37$(_context40) { while (1) switch (_context40.prev = _context40.next) { case 0: e.preventDefault(); $popup('file-loading', Lng.loading[lang], true); url = el.href; _context40.next = 5; return ContentLoader.loadImgData(url, false); case 5: data = _context40.sent; if (data) { _context40.next = 9; break; } $popup('file-loading', Lng.cantLoad[lang] + ' URL: ' + url); return _context40.abrupt("return"); case 9: closePopup('file-loading'); downloadBlob(new Blob([data], { type: getFileMime(url) }), el.getAttribute('download')); case 11: case "end": return _context40.stop(); } }, _callee37); })); function _downloadImageByLink(_x26, _x27) { return _downloadImageByLink2.apply(this, arguments); } return _downloadImageByLink; }() }, { key: "_getFullMsg", value: function _getFullMsg(truncEl, isInit) { var _this64 = this; if (aib.deleteTruncMsg) { aib.deleteTruncMsg(this, truncEl, isInit); return; } if (!isInit) { $popup('load-fullmsg', Lng.loading[lang], true); } ajaxLoad(aib.getThrUrl(aib.b, this.tNum)).then(function (form) { var sourceEl; var maybeSpells = new Maybe(SpellsRunner); if (_this64.isOp) { sourceEl = form; } else { var posts = $Q(aib.qPost, form); for (var i = 0, len = posts.length; i < len; ++i) { var post = posts[i]; if (_this64.num === aib.getPNum(post)) { sourceEl = post; break; } } } if (sourceEl) { _this64.updateMsg(aib.fixHTML(doc.adoptNode($q(aib.qPostMsg, sourceEl))), maybeSpells.value); truncEl.remove(); } if (maybeSpells.hasValue) { maybeSpells.value.endSpells(); } }, Function.prototype); } }, { key: "_showMenu", value: function _showMenu(el, html) { var _this65 = this; if (this._menu) { this._menu.removeMenu(); } this._menu = new Menu(el, html, function (el, e) { return (_this65 instanceof Pview ? pByNum.get(_this65.num) || _this65 : _this65)._clickMenu(el, e); }, false); this._menu.onremove = function () { return _this65._menu = null; }; } }]); return AbstractPost; }(); var Post = function (_AbstractPost) { _inherits(Post, _AbstractPost); var _super4 = _createSuper(Post); function Post(el, thr, num, count, isOp, prev) { var _this66; _classCallCheck(this, Post); _this66 = _super4.call(this, thr, num, isOp); _this66.count = count; _this66.el = el; _this66.isDeleted = false; _this66.isHidden = false; _this66.isOmitted = false; _this66.isViewed = false; _this66.next = null; _this66.prev = prev; _this66.spellHidden = false; _this66.userToggled = false; _this66._selRange = null; _this66._selText = ''; if (prev) { prev.next = _assertThisInitialized(_this66); } pByEl.set(el, _assertThisInitialized(_this66)); pByNum.set(num, _assertThisInitialized(_this66)); var isMyPost = MyPosts.has(num); if (isMyPost) { _this66.el.classList.add('de-mypost'); } else if (localData && _this66.el.classList.contains('de-mypost')) { MyPosts.set(num, thr.num); isMyPost = true; } el.classList.add(isOp ? 'de-oppost' : 'de-reply'); _this66.btns = $aEnd(_this66._pref = $q(aib.qPostRef, el), '' + Post.getPostBtns(isOp, aib.t) + (_this66.sage ? '' : '') + (isOp ? '' : "".concat(count + 1, "")) + (isMyPost ? '(You)' : '') + ''); _this66.counterEl = isOp ? null : $q('.de-post-counter', _this66.btns); if (Cfg.expandTrunc && _this66.trunc) { _this66._getFullMsg(_this66.trunc, true); } el.addEventListener('mouseover', _assertThisInitialized(_this66), true); return _this66; } _createClass(Post, [{ key: "banned", get: function get() { var value = aib.getBanId(this.el); Object.defineProperty(this, 'banned', { value: value, writable: true }); return value; } }, { key: "bottom", get: function get() { return (this.isOp && this.isHidden ? this.thr.el.previousElementSibling : this.el).getBoundingClientRect().bottom; } }, { key: "headerEl", get: function get() { return new Post.Сontent(this).headerEl; } }, { key: "html", get: function get() { return new Post.Сontent(this).html; } }, { key: "nextInThread", get: function get() { var post = this.next; return !post || post.count === 0 ? null : post; } }, { key: "nextNotDeleted", get: function get() { var post = this.nextInThread; while ((_post5 = post) !== null && _post5 !== void 0 && _post5.isDeleted) { var _post5; post = post.nextInThread; } return post; } }, { key: "note", get: function get() { var value = new Post.Note(this); Object.defineProperty(this, 'note', { value: value }); return value; } }, { key: "posterName", get: function get() { return new Post.Сontent(this).posterName; } }, { key: "posterTrip", get: function get() { return new Post.Сontent(this).posterTrip; } }, { key: "sage", get: function get() { var value = aib.getSage(this.el); Object.defineProperty(this, 'sage', { value: value }); return value; } }, { key: "subj", get: function get() { return new Post.Сontent(this).subj; } }, { key: "text", get: function get() { return new Post.Сontent(this).text; } }, { key: "title", get: function get() { return new Post.Сontent(this).title; } }, { key: "tNum", get: function get() { return this.thr.num; } }, { key: "top", get: function get() { return (this.isOp && this.isHidden ? this.thr.el.previousElementSibling : this.el).getBoundingClientRect().top; } }, { key: "wrap", get: function get() { return new Post.Сontent(this).wrap; } }, { key: "addFuncs", value: function addFuncs() { _get(_getPrototypeOf(Post.prototype), "addFuncs", this).call(this); if (isExpImg) { this.toggleImages(true, false); } } }, { key: "deleteCounter", value: function deleteCounter() { this.isDeleted = true; this.counterEl.textContent = Lng.deleted[lang]; this.counterEl.classList.add('de-post-counter-deleted'); this.el.classList.add('de-post-removed'); this.wrap.classList.add('de-wrap-removed'); } }, { key: "deletePost", value: function deletePost(isRemovePost) { if (isRemovePost) { this.wrap.remove(); pByEl["delete"](this.el); pByNum["delete"](this.num); if (this.isHidden) { this.ref.unhideRef(); } RefMap.updateRefMap(this, false); if (this.prev.next = this.next) { this.next.prev = this.prev; } return; } this.deleteCounter(); ($q('input[type="checkbox"]', this.el) || {}).disabled = true; } }, { key: "getAdjacentVisPost", value: function getAdjacentVisPost(toUp) { var post = toUp ? this.prev : this.next; while (post) { if (post.thr.isHidden) { post = toUp ? post.thr.op.prev : post.thr.last.next; } else if (post.isHidden || post.isOmitted) { post = toUp ? post.prev : post.next; } else { return post; } } return null; } }, { key: "hideContent", value: function hideContent(needToHide) { if (this.isOp) { if (!aib.t) { $toggle(this.thr.el, !needToHide); $toggle(this.thr.btns, !needToHide); } } else { Post.hideContent(this.headerEl, this.btnHide, this.userToggled, needToHide); } } }, { key: "select", value: function select() { if (this.isOp) { if (this.isHidden) { this.thr.el.previousElementSibling.classList.add('de-selected'); } this.thr.el.classList.add('de-selected'); } else { this.el.classList.add('de-selected'); } } }, { key: "selectAndScrollTo", value: function selectAndScrollTo() { var scrollNode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.el; scrollTo(0, deWindow.pageYOffset + scrollNode.getBoundingClientRect().top - Post.sizing.wHeight / 2 + scrollNode.clientHeight / 2); if (HotKeys.enabled) { if (HotKeys.cPost) { HotKeys.cPost.unselect(); } HotKeys.cPost = this; HotKeys.lastPageOffset = deWindow.pageYOffset; } else { var _$q7; (_$q7 = $q('.de-selected')) === null || _$q7 === void 0 || _$q7.unselect(); } this.select(); } }, { key: "setUserVisib", value: function setUserVisib(isHide) { var isSave = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; var note = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; this.userToggled = true; this.setVisib(isHide, note); if (this.isOp || this.isHidden === isHide) { var hideClass = isHide ? 'de-btn-unhide-user' : 'de-btn-hide-user'; this.btnHide.setAttribute('class', hideClass); if (this.isOp) { this.thr.btnHide.setAttribute('class', hideClass); } } if (isSave) { var num = this.num; HiddenPosts.set(num, this.thr.num, isHide); if (this.isOp) { if (isHide) { HiddenThreads.set(num, num, this.title); } else { HiddenThreads.removeStorage(num); } } sendStorageEvent('__de-post', { hide: isHide, brd: aib.b, num: num, thrNum: this.thr.num, title: this.isOp ? this.title : '' }); } this.ref.toggleRef(isHide, false); } }, { key: "setVisib", value: function setVisib(isHide) { var _this67 = this; var note = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; if (this.isHidden === isHide) { if (isHide && note) { this.note.set(note); } return; } if (this.isOp) { this.thr.isHidden = isHide; } else { if (Cfg.delHiddPost === 1 || Cfg.delHiddPost === 2) { this.wrap.classList.toggle('de-hidden', isHide); } else { this._pref.onmouseover = this._pref.onmouseout = !isHide ? null : function (e) { var yOffset = deWindow.pageYOffset; _this67.hideContent(e.type === 'mouseout'); scrollTo(deWindow.pageXOffset, yOffset); }; } } if (Cfg.strikeHidd) { setTimeout(function () { return _this67._strikePostNum(isHide); }, 50); } if (isHide) { this.note.set(note); } else { this.note.hideNote(); } this.hideContent(this.isHidden = isHide); } }, { key: "spellHide", value: function spellHide(note) { this.spellHidden = true; if (!this.userToggled) { this.setVisib(true, note); this.ref.hideRef(); } } }, { key: "spellUnhide", value: function spellUnhide() { this.spellHidden = false; if (!this.userToggled) { this.setVisib(false); this.ref.unhideRef(); } } }, { key: "toggleImages", value: function toggleImages() { var isExpand = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !this.images.expanded; var isExpandVideos = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; for (var _iterator24 = _createForOfIteratorHelperLoose(this.images), _step24; !(_step24 = _iterator24()).done;) { var image = _step24.value; if ((image.isImage || isExpandVideos && image.isVideo) && image.expanded ^ isExpand) { if (isExpand) { image.expandImg(true, null); } else { image.collapseImg(null); } } } } }, { key: "unselect", value: function unselect() { if (this.isOp) { var _$id; (_$id = $id('de-thr-hid-' + this.num)) === null || _$id === void 0 || _$id.classList.remove('de-selected'); this.thr.el.classList.remove('de-selected'); } else { this.el.classList.remove('de-selected'); } } }, { key: "_getMenuHide", value: function _getMenuHide() { var item = function item(name) { return "").concat(Lng.selHiderMenu[name][lang], ""); }; var sel = deWindow.getSelection(); var ssel = sel.toString().trim(); if (ssel) { this._selText = ssel; this._selRange = sel.getRangeAt(0); } return "".concat(ssel ? item('sel') : '').concat(this.posterName ? item('name') : '').concat(this.posterTrip ? item('trip') : '').concat(this.images.hasAttachments ? item('img') + item('imgn') + item('ihash') : item('noimg')).concat(this.text ? item('text') : item('notext')).concat(!Cfg.hideRefPsts && this.ref.hasMap ? item('refs') : '').concat(item('refsonly')); } }, { key: "_strikePostNum", value: function _strikePostNum(isHide) { var num = this.num; if (isHide) { Post.hiddenNums.add(+num); } else { Post.hiddenNums["delete"](+num); } $Q("[de-form] a[href$=\"".concat(aib.anchor + num, "\"]")).forEach(function (el) { el.classList.toggle('de-link-hid', isHide); if (Cfg.removeHidd && el.classList.contains('de-link-backref')) { var refMapEl = el.parentNode; if (isHide === !$q('.de-link-backref:not(.de-link-hid)', refMapEl)) { $toggle(refMapEl, !isHide); } } }); } }], [{ key: "addMark", value: function addMark(postEl, forced) { if (doc.hidden || forced) { if (!Post.hasNew) { Post.hasNew = true; doc.addEventListener('click', Post.clearMarks, true); } postEl.classList.add('de-new-post'); } else { Post.clearMarks(); } } }, { key: "clearMarks", value: function clearMarks() { if (Post.hasNew) { Post.hasNew = false; $Q('.de-new-post').forEach(function (el) { return el.classList.remove('de-new-post'); }); doc.removeEventListener('click', Post.clearMarks, true); } } }, { key: "getPostBtns", value: function getPostBtns(isOp, noExpThr) { return '' + '' + '' + (isOp ? (noExpThr ? '' : '') + '' : ''); } }, { key: "findSameText", value: function findSameText(pNum, isHidden, words, curPost) { var curWords = Post.getWrds(curPost.text); var len = curWords.length; var i = words.length; var olen = i; var _olen = i; var n = 0; if (len < olen * 0.4 || len > olen * 3) { return; } while (i--) { if (olen > 6 && words[i].length < 3) { _olen--; continue; } var j = len; while (j--) { if (curWords[j] === words[i] || words[i].match(/>>\d+/) && curWords[j].match(/>>\d+/)) { n++; } } } if (n < _olen * 0.4 || len > _olen * 3) { return; } if (isHidden) { if (curPost.spellHidden) { Post.Note.reset(); } else { curPost.setVisib(false); } if (curPost.userToggled) { HiddenPosts.removeStorage(curPost.num); curPost.userToggled = false; } } else { curPost.setUserVisib(true, true, 'similar to >>' + pNum); } return false; } }, { key: "getWrds", value: function getWrds(text) { return text.replace(/\s+/g, ' ').replace(/[^a-zа-яё ]/ig, '').trim().substring(0, 800).split(' '); } }, { key: "hideContent", value: function hideContent(headerEl, btnHide, isUser, isHide) { if (!isHide) { btnHide.setAttribute('class', isUser ? 'de-btn-hide-user' : 'de-btn-hide'); $Q('.de-post-hiddencontent', headerEl.parentNode).forEach(function (el) { return el.classList.remove('de-post-hiddencontent'); }); return; } if (aib.t) { Thread.first.hiddenCount++; } btnHide.setAttribute('class', isUser ? 'de-btn-unhide-user' : 'de-btn-unhide'); if (headerEl) { for (var el = headerEl.nextElementSibling; el; el = el.nextElementSibling) { el.classList.add('de-post-hiddencontent'); } } } }]); return Post; }(AbstractPost); Post.hasNew = false; Post.hiddenNums = new Set(); Post.Сontent = function (_TemporaryContent) { _inherits(PostContent, _TemporaryContent); var _super5 = _createSuper(PostContent); function PostContent(post) { var _this68; _classCallCheck(this, PostContent); _this68 = _super5.call(this, post); if (_this68._isInited) { return _possibleConstructorReturn(_this68); } _this68._isInited = true; _this68.el = post.el; _this68.post = post; return _this68; } _createClass(PostContent, [{ key: "headerEl", get: function get() { var value = $q(aib.qPostHeader, this.el); Object.defineProperty(this, 'headerEl', { value: value }); return value; } }, { key: "html", get: function get() { var value = this.el.outerHTML; Object.defineProperty(this, 'html', { value: value }); return value; } }, { key: "posterName", get: function get() { var pName = $q(aib.qPostName, this.el); var value = pName ? pName.textContent.trim().replace(/\s/g, ' ') : ''; Object.defineProperty(this, 'posterName', { value: value }); return value; } }, { key: "posterTrip", get: function get() { var pTrip = $q(aib.qPostTrip, this.el); var value = pTrip ? pTrip.textContent : ''; Object.defineProperty(this, 'posterTrip', { value: value }); return value; } }, { key: "subj", get: function get() { var subj = $q(aib.qPostSubj, this.el); var value = subj ? subj.textContent : ''; Object.defineProperty(this, 'subj', { value: value }); return value; } }, { key: "text", get: function get() { var value = this.post.msg.innerHTML.replace(/<\/?(?:br|p|li)[^>]*?>/gi, '\n').replace(/<[^>]+?>/g, '').replaceAll('>', '>').replaceAll('<', '<').replaceAll(' ', "\xA0").trim(); Object.defineProperty(this, 'text', { value: value }); return value; } }, { key: "title", get: function get() { var value = this.subj || this.text.substring(0, 85).replace(/\s+/g, ' '); Object.defineProperty(this, 'title', { value: value }); return value; } }, { key: "wrap", get: function get() { var value = aib.getPostWrap(this.el, this.post.isOp); Object.defineProperty(this, 'wrap', { value: value }); return value; } }]); return PostContent; }(TemporaryContent); Post.Note = function () { function PostNote(post) { _classCallCheck(this, PostNote); this.text = null; this._post = post; this.isHideThr = this._post.isOp && !aib.t; if (!this.isHideThr) { this._noteEl = this.textEl = $bEnd(post.btns, ''); return; } this._noteEl = $bBegin(post.thr.el, "
")); this._aEl = $q('a', this._noteEl); this.textEl = this._aEl.nextElementSibling; } _createClass(PostNote, [{ key: "hideNote", value: function hideNote() { if (this.isHideThr) { this._aEl.onmouseover = this._aEl.onmouseout = this._aEl.onclick = null; } $hide(this._noteEl); } }, { key: "reset", value: function reset() { this.text = null; if (this.isHideThr) { this.set(null); } else { this.hideNote(); } } }, { key: "set", value: function set(note) { var _this69 = this; this.text = note; var text; if (this.isHideThr) { this._aEl.onmouseover = this._aEl.onmouseout = function (e) { return _this69._post.hideContent(e.type === 'mouseout'); }; this._aEl.onclick = function (e) { e.preventDefault(); _this69._post.setUserVisib(!_this69._post.isHidden); }; text = (this._post.title ? "(".concat(this._post.title, ") ") : '') + (note ? "[autohide: ".concat(note, "]") : ''); } else { text = note ? "autohide: ".concat(note) : ''; } this.textEl.textContent = text; $show(this._noteEl); } }]); return PostNote; }(); Post.sizing = { get dPxRatio() { var value = deWindow.devicePixelRatio || 1; Object.defineProperty(this, 'dPxRatio', { value: value }); return value; }, get wHeight() { var value = nav.viewportHeight(); if (!this._enabled) { doc.defaultView.addEventListener('resize', this); this._enabled = true; } Object.defineProperties(this, { wHeight: { writable: true, configurable: true, value: value }, wWidth: { writable: true, configurable: true, value: nav.viewportWidth() } }); return value; }, get wWidth() { var value = nav.viewportWidth(); if (!this._enabled) { doc.defaultView.addEventListener('resize', this); this._enabled = true; } Object.defineProperties(this, { wHeight: { writable: true, configurable: true, value: nav.viewportHeight() }, wWidth: { writable: true, configurable: true, value: value } }); return value; }, handleEvent: function handleEvent() { this.wHeight = nav.viewportHeight(); this.wWidth = nav.viewportWidth(); }, _enabled: false }; var Pview = function (_AbstractPost2) { _inherits(Pview, _AbstractPost2); var _super6 = _createSuper(Pview); function Pview(parent, link, pNum, tNum) { var _this70; _classCallCheck(this, Pview); _this70 = _super6.call(this, parent.thr, pNum, pNum === tNum); _this70.isSticky = false; _this70.parent = parent; _this70.remoteThr = null; _this70.tNum = tNum; _this70._isCached = false; _this70._isLeft = false; _this70._isTop = false; _this70._link = link; _this70._newPos = null; _this70._offsetTop = 0; _this70._readDelay = 0; var post = pByNum.get(pNum); if (post && (!post.isOp || !(parent instanceof Pview) || !parent._isCached)) { _this70._buildPview(post); return _possibleConstructorReturn(_this70); } _this70._isCached = true; _this70.board = link.pathname.match(/^\/?(.+\/)/)[1].replace(aib.res, '').replace(/\/$/, ''); if (PviewsCache.has(_this70.board + tNum)) { post = PviewsCache.get(_this70.board + tNum).getPost(pNum); if (post) { _this70._buildPview(post); } else { _this70._showPview(_this70.el = $add("
\n\t\t\t\t\t").concat(Lng.postNotFound[lang], "
"))); } return _possibleConstructorReturn(_this70); } _this70._showPview(_this70.el = $add("
\n\t\t\t").concat(Lng.loading[lang], "
"))); _this70._loadPromise = ajaxPostsLoad(_this70.board, tNum, false, false).then(function (pBuilder) { return _this70._onload(pBuilder); }, function (err) { return _this70._onerror(err); }); return _this70; } _createClass(Pview, [{ key: "stickBtn", get: function get() { var value = $q('.de-btn-stick', this.el); Object.defineProperty(this, 'stickBtn', { value: value }); return value; } }, { key: "deletePview", value: function deletePview() { var _AttachedImage$viewer; this.parent.kid = null; this._link.classList.remove('de-link-parent'); if (Pview.top === this) { Pview.top = null; } if (this._loadPromise) { this._loadPromise.cancelPromise(); this._loadPromise = null; } var vPost = (_AttachedImage$viewer = AttachedImage.viewer) === null || _AttachedImage$viewer === void 0 ? void 0 : _AttachedImage$viewer.data.post; var pv = this; do { clearTimeout(pv._readDelay); if (vPost === pv) { AttachedImage.closeImg(); vPost = null; } var _pv = pv, el = _pv.el; pByEl["delete"](el); if (Cfg.animation) { $animate(el, 'de-pview-anim', true); el.style.animationName = "de-post-close-".concat(this._isTop ? 't' : 'b').concat(this._isLeft ? 'l' : 'r'); } else { el.remove(); } } while (pv = pv.kid); } }, { key: "deleteNonSticky", value: function deleteNonSticky() { var lastSticky = null; var pv = this; do { if (pv.isSticky) { lastSticky = pv; } } while (pv = pv.kid); if (!lastSticky) { this.deletePview(); } else if (lastSticky.kid) { lastSticky.kid.deletePview(); } } }, { key: "handleEvent", value: function handleEvent(e) { var pv = e.target; if (e.type === 'animationend' && pv.style.animationName) { pv.classList.remove('de-pview-anim'); pv.style.cssText = this._newPos; this._newPos = null; $delAll('.de-css-move', doc.head); pv.removeEventListener('animationend', this); return; } var isOverEvent = false; checkMouse: do { switch (e.type) { case 'mouseover': isOverEvent = true; break; case 'mouseout': break; default: break checkMouse; } var el = nav.fixEventEl(e.relatedTarget); if (!el || isOverEvent && (el.tagName.toLowerCase() !== 'a' || el.isNotRefLink) || el !== this.el && !this.el.contains(el)) { if (isOverEvent) { this.mouseEnter(); } else if (Pview.top) { Pview.top.markToDel(); } } } while (false); if (!this.loading) { _get(_getPrototypeOf(Pview.prototype), "handleEvent", this).call(this, e); } } }, { key: "markToDel", value: function markToDel() { var _this71 = this; clearTimeout(Pview._delTO); Pview._delTO = setTimeout(function () { return _this71.deleteNonSticky(); }, Cfg.linksOut); } }, { key: "mouseEnter", value: function mouseEnter() { if (this.kid) { this.kid.markToDel(); } else { clearTimeout(Pview._delTO); } } }, { key: "setUserVisib", value: function setUserVisib() { var post = pByNum.get(this.num); var isHide = post.isHidden; post.setUserVisib(!isHide); Pview.updatePosition(true); $Q(".de-btn-pview-hide[de-num=\"".concat(this.num, "\"]")).forEach(function (el) { el.setAttribute('class', "".concat(isHide ? 'de-btn-hide-user' : 'de-btn-unhide-user', " de-btn-pview-hide")); el.parentNode.classList.toggle('de-post-hide', !isHide); }); } }, { key: "toggleSticky", value: function toggleSticky(isEnabled) { this.stickBtn.setAttribute('class', isEnabled ? 'de-btn-stick-on' : 'de-btn-stick'); this.isSticky = isEnabled; } }, { key: "_buildPview", value: function () { var _buildPview2 = _asyncToGenerator( _regeneratorRuntime().mark(function _callee38(post) { var _this$el, _yield$readFavorites$; var isOp, num, pv, isMyPost, isFav, isCached, postsCountHtml, pText, _$q8, btnsEl, link; return _regeneratorRuntime().wrap(function _callee38$(_context41) { while (1) switch (_context41.prev = _context41.next) { case 0: (_this$el = this.el) === null || _this$el === void 0 || _this$el.remove(); isOp = this.isOp, num = this.num; pv = this.el = post.el.cloneNode(true); pByEl.set(pv, this); isMyPost = MyPosts.has(num); pv.className = "".concat(aib.cReply, " de-pview").concat(post.isViewed ? ' de-viewed' : '').concat(isMyPost ? ' de-mypost' : '') + "".concat(post.el.classList.contains('de-mypost-reply') ? ' de-mypost-reply' : ''); $show(pv); $Q('.de-post-hiddencontent', pv).forEach(function (el) { return el.classList.remove('de-post-hiddencontent'); }); if (Cfg.linksNavig) { Pview._markLink(pv, this.parent.num); } this._pref = $q(aib.qPostRef, pv); this._link.classList.add('de-link-parent'); _context41.t0 = isOp; if (!_context41.t0) { _context41.next = 32; break; } _context41.t1 = post.thr.isFav; if (_context41.t1) { _context41.next = 31; break; } _context41.next = 17; return readFavorites(); case 17: _context41.t4 = aib.host; _context41.t5 = _yield$readFavorites$ = _context41.sent[_context41.t4]; _context41.t3 = _context41.t5 === null; if (_context41.t3) { _context41.next = 22; break; } _context41.t3 = _yield$readFavorites$ === void 0; case 22: _context41.t2 = _context41.t3; if (_context41.t2) { _context41.next = 25; break; } _context41.t2 = (_yield$readFavorites$ = _yield$readFavorites$[this.board]) === null || _yield$readFavorites$ === void 0; case 25: if (!_context41.t2) { _context41.next = 29; break; } _context41.t6 = void 0; _context41.next = 30; break; case 29: _context41.t6 = _yield$readFavorites$[num]; case 30: _context41.t1 = _context41.t6; case 31: _context41.t0 = _context41.t1; case 32: isFav = _context41.t0; isCached = post instanceof CacheItem; postsCountHtml = (post.isDeleted ? " de-post-counter-deleted\">".concat(Lng.deleted[lang], "") : "\">".concat(isOp ? '(OP)' : post.count + +!(aib.JsonBuilder && isCached), "")) + (isMyPost ? '(You)' : ''); pText = '' + (isOp ? "") + '' : '') + (post.sage ? '' : '') + '' + '".concat(pText, "")); embedAudioLinks(this); if (Cfg.embedYTube) { new VideosParser().parse(this).endParser(); } embedPostMsgImages(pv); processImgInfoLinks(this); } else { btnsEl = this.btns = $q('.de-post-btns', pv); (_$q8 = $q('.de-post-counter', btnsEl)) === null || _$q8 === void 0 || _$q8.remove(); if (post.isHidden) { btnsEl.classList.add('de-post-hide'); } btnsEl.innerHTML = "").concat(pText); $delAll("".concat(!aib.t && isOp ? aib.qOmitted + ', ' : '', ".de-fullimg-wrap, .de-fullimg-after"), pv); $Q(aib.qPostImg, pv).forEach(function (el) { return $show(el.parentNode); }); link = $q('.de-link-parent', pv); if (link) { link.classList.remove('de-link-parent'); } if (Cfg.embedYTube && post.videos.hasLinks) { if (post.videos.playerInfo !== null) { Object.defineProperty(this, 'videos', { value: new Videos(this, $q('.de-video-obj', pv), post.videos.playerInfo) }); } this.videos.updatePost($Q('.de-video-link', post.el), $Q('.de-video-link', pv), true); } if (Cfg.addImgs) { $Q('.de-img-embed', pv).forEach($show); } if (Cfg.markViewed) { this._readDelay = setTimeout(function (post) { if (!post.isViewed) { post.el.classList.add('de-viewed'); post.isViewed = true; } var arr = (sesStorage['de-viewed'] || '').split(','); arr.push(post.num); sesStorage['de-viewed'] = arr; }, post.text.length > 100 ? 2e3 : 500, post); } } pv.addEventListener('click', this, true); this._showPview(pv); case 39: case "end": return _context41.stop(); } }, _callee38, this); })); function _buildPview(_x28) { return _buildPview2.apply(this, arguments); } return _buildPview; }() }, { key: "_onerror", value: function _onerror(err) { if (!(err instanceof CancelError)) { this.el.innerHTML = err instanceof AjaxError && err.code === 404 ? Lng.postNotFound[lang] : getErrorMessage(err); } } }, { key: "_onload", value: function _onload(pBuilder) { var board = this.board; var _this$parent = this.parent, num = _this$parent.num, tNum = _this$parent.tNum; var post = new PviewsCache(pBuilder, board, this.tNum).getPost(this.num); if (post && (aib.b !== board || !post.ref.hasMap || !post.ref.has(num))) { (post.ref.hasMap ? $q('.de-refmap', post.el) : $aEnd(post.msg, '
')).insertAdjacentHTML('afterbegin', ">>").concat(aib.b === board ? '' : "/".concat(aib.b, "/")).concat(num, ", ")); } if (post) { this._buildPview(post); } else { this.el.innerHTML = Lng.postNotFound[lang]; } } }, { key: "_setPosition", value: function _setPosition(link, isAnim) { var oldCSS; var cr = link.getBoundingClientRect(); var offX = cr.left + deWindow.pageXOffset + cr.width / 2; var offY = cr.top; var bWidth = nav.viewportWidth(); var isLeft = offX < bWidth / 2; var pv = this.el; var temp = isLeft ? offX : offX - Math.min(parseInt(pv.offsetWidth, 10), offX - 10); var lmw = "max-width:".concat(bWidth - temp - 10, "px; left:").concat(temp, "px;"); var style = pv.style; if (isAnim) { oldCSS = style.cssText; } style.cssText = (isAnim ? 'opacity: 0; ' : '') + lmw; var top = pv.offsetHeight; var isTop = offY + top + cr.height < nav.viewportHeight() || offY - top < 5; top = deWindow.pageYOffset + (isTop ? offY + cr.height : offY - top); this._offsetTop = top; this._isLeft = isLeft; this._isTop = isTop; if (!isAnim) { style.top = top + 'px'; return; } var uId = 'de-movecss-' + Math.round(Math.random() * 1e12); $css("@keyframes ".concat(uId, " { to { ").concat(lmw, " top:").concat(top, "px; } }")).className = 'de-css-move'; if (this._newPos) { style.cssText = this._newPos; pv.removeEventListener('animationend', this); } else { style.cssText = oldCSS; } this._newPos = "".concat(lmw, " top:").concat(top, "px;"); pv.addEventListener('animationend', this); pv.classList.add('de-pview-anim'); style.animationName = uId; } }, { key: "_showMenu", value: function _showMenu(el, html) { var _this72 = this; _get(_getPrototypeOf(Pview.prototype), "_showMenu", this).call(this, el, html); this._menu.onover = function () { return _this72.mouseEnter(); }; this._menu.onout = function () { return Pview.top.markToDel(); }; } }, { key: "_showPview", value: function _showPview(el) { var _this73 = this; ['mouseover', 'mouseout'].forEach(function (e) { return el.addEventListener(e, _this73, true); }); this.thr.form.el.append(el); this._setPosition(this._link, false); if (Cfg.animation) { el.addEventListener('animationend', function aEvent() { el.removeEventListener('animationend', aEvent); el.classList.remove('de-pview-anim'); el.style.animationName = ''; }); el.classList.add('de-pview-anim'); el.style.animationName = "de-post-open-".concat(this._isTop ? 't' : 'b').concat(this._isLeft ? 'l' : 'r'); } } }], [{ key: "topParent", get: function get() { return Pview.top ? Pview.top.parent : null; } }, { key: "showPview", value: function showPview(parent, link) { var tNum = +(link.pathname.match(/.+?\/[^\d]*(\d+)/) || [0, aib.getPostOfEl(link).tNum])[1]; var pNum = link.textContent.match(/\d+/g); pNum = pNum ? +pNum.pop() : tNum; var isTop = !(parent instanceof Pview); var pv = isTop ? Pview.top : parent.kid; clearTimeout(Pview._delTO); if (pv && pv.num === pNum) { if (pv.kid) { pv.kid.deletePview(); } if (pv._link !== link) { pv._setPosition(link, Cfg.animation); pv._link.classList.remove('de-link-parent'); link.classList.add('de-link-parent'); pv._link = link; if (pv.parent.num !== parent.num) { $Q('.de-link-pview', pv.el).forEach(function (el) { return el.classList.remove('de-link-pview'); }); Pview._markLink(pv.el, parent.num); } } pv.parent = parent; } else if (!Cfg.noNavigHidd || !pByNum.has(pNum) || !pByNum.get(pNum).hidden) { if (pv) { pv.deletePview(); } pv = new Pview(parent, link, pNum, tNum); if (isTop) { Pview.top = pv; } } else { return null; } return pv; } }, { key: "updatePosition", value: function updatePosition(scroll) { var pv = Pview.top; if (!pv) { return; } var _pv2 = pv, parent = _pv2.parent; if (parent.isOmitted) { pv.deletePview(); return; } if (parent.thr.loadCount === 1 && !parent.el.contains(pv._link)) { var el = parent.ref.getElByNum(pv.num); if (!el) { pv.deletePview(); return; } pv._link = el; } var cr = parent.isHidden ? parent : pv._link.getBoundingClientRect(); var diff = pv._isTop ? pv._offsetTop - deWindow.pageYOffset - cr.bottom : pv._offsetTop + pv.el.offsetHeight - deWindow.pageYOffset - cr.top; if (Math.abs(diff) > 1) { if (scroll) { scrollTo(deWindow.pageXOffset, deWindow.pageYOffset - diff); } do { pv._offsetTop -= diff; pv.el.style.top = Math.max(pv._offsetTop, 0) + 'px'; } while (pv = pv.kid); } } }, { key: "_markLink", value: function _markLink(el, num) { $Q("a[href*=\"".concat(num, "\"]"), el).forEach(function (el) { return el.textContent.startsWith('>>' + num) && el.classList.add('de-link-pview'); }); } }]); return Pview; }(AbstractPost); Pview.top = null; Pview._delTO = null; var CacheItem = function () { function CacheItem(pBuilder, thrUrl, count) { _classCallCheck(this, CacheItem); this._pBuilder = pBuilder; this._thrUrl = thrUrl; this.count = count; this.isDeleted = false; this.isInited = false; this.isOp = count === 0; this.isViewed = false; } _createClass(CacheItem, [{ key: "refLinks", value: _regeneratorRuntime().mark(function refLinks() { return _regeneratorRuntime().wrap(function refLinks$(_context42) { while (1) switch (_context42.prev = _context42.next) { case 0: return _context42.delegateYield(this._pBuilder.getRefLinks(this.count, this._thrUrl), "t0", 1); case 1: case "end": return _context42.stop(); } }, refLinks, this); }) }, { key: "msg", get: function get() { var value = $q(aib.qPostMsg, this.el); Object.defineProperty(this, 'msg', { value: value }); return value; } }, { key: "ref", get: function get() { var value = new RefMap(this); Object.defineProperty(this, 'ref', { value: value }); return value; } }, { key: "sage", get: function get() { var value = aib.getSage(this.el); Object.defineProperty(this, 'sage', { value: value }); return value; } }, { key: "title", get: function get() { return new Post.Сontent(this).title; } }, { key: "el", get: function get() { var value = this.isOp ? this._pBuilder.getOpEl() : this._pBuilder.getPostEl(this.count - 1); Object.defineProperty(this, 'el', { value: doc.adoptNode(value) }); return value; } }, { key: "thr", get: function get() { var _this74 = this; var value = null; if (this.isOp) { var postsCount = this._pBuilder.length; value = { lastNum: this._pBuilder.getPNum(postsCount - 1), postsCount: postsCount }; Object.defineProperty(value, 'title', { get: function get() { return _this74.title; } }); } Object.defineProperty(this, 'thr', { value: value }); return value; } }]); return CacheItem; }(); var PviewsCache = function (_TemporaryContent2) { _inherits(PviewsCache, _TemporaryContent2); var _super7 = _createSuper(PviewsCache); function PviewsCache(pBuilder, board, tNum) { var _this75; _classCallCheck(this, PviewsCache); _this75 = _super7.call(this, board + tNum); if (_this75._isInited) { return _possibleConstructorReturn(_this75); } _this75._isInited = true; var lPByNum = new Map(); var thrUrl = aib.getThrUrl(board, tNum); lPByNum.set(tNum, new CacheItem(pBuilder, thrUrl, 0)); for (var i = 0; i < pBuilder.length; ++i) { lPByNum.set(pBuilder.getPNum(i), new CacheItem(pBuilder, thrUrl, i + 1)); } DelForm.tNums.add(tNum); _this75._b = board; _this75._posts = lPByNum; if (Cfg.linksNavig) { RefMap.gen(lPByNum); } return _this75; } _createClass(PviewsCache, [{ key: "getPost", value: function getPost(num) { var post = this._posts.get(num); if (post && !post.isInited) { if (this._b === aib.b && pByNum.has(num)) { post.ref.makeUnion(pByNum.get(num).ref); } if (post.ref.hasMap) { post.ref.initPostRef(post._thrUrl, Cfg.strikeHidd && Post.hiddenNums.size ? Post.hiddenNums : null); } post.isInited = true; } return post; } }]); return PviewsCache; }(TemporaryContent); PviewsCache.purgeSecs = 3e5; var ImagesNavigBtns = function () { function ImagesNavigBtns(viewerObj) { _classCallCheck(this, ImagesNavigBtns); var btns = $bEnd(doc.body, "
\n\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t\t\t
")); var _ref39 = _toConsumableArray(btns.children); this.prevBtn = _ref39[0]; this.nextBtn = _ref39[1]; this.autoBtn = _ref39[2]; this._btns = btns; this._btnsStyle = btns.style; this._hideTmt = 0; this._isHidden = true; this._oldX = -1; this._oldY = -1; this._viewer = viewerObj; doc.defaultView.addEventListener('mousemove', this); btns.addEventListener('mouseover', this); } _createClass(ImagesNavigBtns, [{ key: "handleEvent", value: function handleEvent(e) { var _this76 = this; switch (e.type) { case 'mousemove': { var curX = e.clientX, curY = e.clientY; if (this._oldX !== curX || this._oldY !== curY) { this._oldX = curX; this._oldY = curY; this.showBtns(); } return; } case 'mouseover': if (!this.hasEvents) { this.hasEvents = true; ['mouseout', 'click'].forEach(function (e) { return _this76._btns.addEventListener(e, _this76); }); } if (!this._isHidden) { clearTimeout(this._hideTmt); KeyEditListener.setTitle(this.prevBtn, 4); KeyEditListener.setTitle(this.nextBtn, 17); } return; case 'mouseout': this._setHideTmt(); return; case 'click': { var parent = e.target.parentNode; var viewer = this._viewer; switch (parent.id) { case 'de-img-btn-next': viewer.navigate(true); return; case 'de-img-btn-prev': viewer.navigate(false); return; case 'de-img-btn-rotate': viewer.rotateView(true); return; case 'de-img-btn-auto': viewer.isAutoPlay = !viewer.isAutoPlay; this.autoBtn.title = viewer.isAutoPlay ? Lng.autoPlayOff[lang] : Lng.autoPlayOn[lang]; viewer.toggleVideoLoop(); parent.classList.toggle('de-img-btn-auto-on'); } } } } }, { key: "hideBtns", value: function hideBtns() { this._btnsStyle.display = 'none'; this._isHidden = true; this._oldX = this._oldY = -1; } }, { key: "removeBtns", value: function removeBtns() { this._btns.remove(); doc.defaultView.removeEventListener('mousemove', this); clearTimeout(this._hideTmt); } }, { key: "showBtns", value: function showBtns() { if (this._isHidden) { this._btnsStyle.removeProperty('display'); this._isHidden = false; this._setHideTmt(); } } }, { key: "_setHideTmt", value: function _setHideTmt() { var _this77 = this; clearTimeout(this._hideTmt); this._hideTmt = setTimeout(function () { return _this77.hideBtns(); }, 2e3); } }]); return ImagesNavigBtns; }(); var ImagesViewer = function () { function ImagesViewer(data) { _classCallCheck(this, ImagesViewer); this.data = null; this.isAutoPlay = false; this._elStyle = null; this._fullEl = null; this._height = 0; this._minSize = 0; this._moved = false; this._oldL = 0; this._oldT = 0; this._oldX = 0; this._oldY = 0; this._parentEl = null; this._width = 0; this._showFullImg(data); } _createClass(ImagesViewer, [{ key: "closeImgViewer", value: function closeImgViewer(e) { if ($hasProp(this, '_btns')) { this._btns.removeBtns(); } this._removeFullImg(e); } }, { key: "handleEvent", value: function handleEvent(e) { var _this78 = this; switch (e.type) { case 'mousedown': if (this.data.isVideo && ExpandableImage.isControlClick(e)) { return; } this._oldX = e.clientX; this._oldY = e.clientY; ['mousemove', 'mouseup'].forEach(function (e) { return doc.body.addEventListener(e, _this78, true); }); break; case 'mousemove': { var curX = e.clientX, curY = e.clientY; if (curX !== this._oldX || curY !== this._oldY) { this._oldL = parseInt(this._elStyle.left, 10) + curX - this._oldX; this._elStyle.left = this._oldL + 'px'; this._oldT = parseInt(this._elStyle.top, 10) + curY - this._oldY; this._elStyle.top = this._oldT + 'px'; this._oldX = curX; this._oldY = curY; this._moved = true; } return; } case 'mouseup': ['mousemove', 'mouseup'].forEach(function (e) { return doc.body.removeEventListener(e, _this78, true); }); return; case 'click': { var el = e.target; var tag = el.tagName.toLowerCase(); if (this.data.isVideo && ExpandableImage.isControlClick(e) || tag !== 'img' && tag !== 'video' && !el.classList.contains('de-fullimg-wrap') && !el.classList.contains('de-fullimg-wrap-link') && !el.classList.contains('de-fullimg-video-hack') && el.className !== 'de-fullimg-load') { return; } if (e.button === 0) { if (this._moved) { this._moved = false; } else { this.closeImgViewer(e); AttachedImage.viewer = null; } e.stopPropagation(); break; } return; } case 'mousewheel': this._handleWheelEvent(e.clientX, e.clientY, -1 / 40 * ('wheelDeltaY' in e ? e.wheelDeltaY : e.wheelDelta)); break; default: this._handleWheelEvent(e.clientX, e.clientY, e.deltaY); } e.preventDefault(); } }, { key: "navigate", value: function navigate(isForward) { var isVideoOnly = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; var data = this.data; data.cancelWebmLoad(this._fullEl); do { data = data.getFollowImg(isForward); } while (data && (!data.isVideo && !data.isImage || isVideoOnly && data.isImage)); if (data) { this.updateImgViewer(data, true, null); data.post.selectAndScrollTo(data.post.images.first.el); } } }, { key: "rotateView", value: function rotateView(isNextAngle) { if (isNextAngle) { this.data.rotate += this.data.rotate === 270 ? -270 : 90; } var angle = this.data.rotate; var isVert = angle === 90 || angle === 270; var img = $q('img, video', this._fullEl); img.style.transform = "rotate(".concat(angle, "deg)").concat(angle === 90 ? ' translateY(-100%)' : angle === 270 ? ' translateX(-100%)' : ''); img.classList.toggle('de-fullimg-rotated', isVert); img.style.height = "".concat((isVert ? this._height / this._width : 1) * 100, "%"); if (this.data.isVideo && nav.firefoxVer >= 59) { img.previousElementSibling.style = (isVert ? 'width: calc(100% - 40px); height: 100%; ' : '') + (angle === 90 ? 'right: 0; ' : '') + (angle === 180 ? 'bottom: 0;' : ''); } if (isNextAngle || angle !== 180) { this._rotateFullImg(this._fullEl); } } }, { key: "toggleVideoLoop", value: function toggleVideoLoop() { if (this.data.isVideo) { $q('video', this._fullEl).toggleAttribute('loop', !this.isAutoPlay); } } }, { key: "updateImgViewer", value: function updateImgViewer(data, showButtons, e) { this._removeFullImg(e); this._showFullImg(data, showButtons); } }, { key: "_btns", get: function get() { var value = new ImagesNavigBtns(this); Object.defineProperty(this, '_btns', { value: value }); return value; } }, { key: "_zoomFactor", get: function get() { var value = 1 + Cfg.zoomFactor / 100; Object.defineProperty(this, '_zoomFactor', { value: value }); return value; } }, { key: "_handleWheelEvent", value: function _handleWheelEvent(clientX, clientY, delta) { if (delta === 0) { return; } var width, height; var oldW = this._width, oldH = this._height; if (delta > 0) { width = oldW / this._zoomFactor; height = oldH / this._zoomFactor; if (width <= this._minSize && height <= this._minSize) { return; } } else { width = oldW * this._zoomFactor; height = oldH * this._zoomFactor; } this._width = width; this._height = height; this._elStyle.width = width + 'px'; this._elStyle.height = height + 'px'; this._oldL = parseInt(clientX - width / oldW * (clientX - this._oldL), 10); this._elStyle.left = this._oldL + 'px'; this._oldT = parseInt(clientY - height / oldH * (clientY - this._oldT), 10); this._elStyle.top = this._oldT + 'px'; var scale = 100 * width / this.data.width; $q('.de-fullimg-scale', this._fullEl).textContent = scale === 100 ? '' : "".concat(parseInt(scale, 10), "%"); } }, { key: "_removeFullImg", value: function _removeFullImg(e) { var data = this.data; data.cancelWebmLoad(this._fullEl); if (data.inPview && data.post.isSticky) { data.post.toggleSticky(false); } this._parentEl.remove(); if (e && data.inPview) { data.sendCloseEvent(e, false); } } }, { key: "_resizeFullImg", value: function _resizeFullImg(el) { if (el !== this._fullEl) { return; } var _this$data$computeFul = this.data.computeFullSize(), _this$data$computeFul2 = _slicedToArray(_this$data$computeFul, 3), width = _this$data$computeFul2[0], height = _this$data$computeFul2[1], minSize = _this$data$computeFul2[2]; this._minSize = minSize ? minSize / this._zoomFactor : Cfg.minImgSize; if (Post.sizing.wWidth - this._oldL - this._width < 5 || Post.sizing.wHeight - this._oldT - this._height < 5) { return; } var cPointX = this._oldL + this._width / 2; var cPointY = this._oldT + this._height / 2; var maxWidth = (Post.sizing.wWidth - cPointX - 2) * 2; var maxHeight = (Post.sizing.wHeight - cPointY - 2) * 2; if (width > maxWidth || height > maxHeight) { var ar = width / height; if (ar > maxWidth / maxHeight) { width = maxWidth; height = width / ar; } else { height = maxHeight; width = height * ar; } if (minSize && width < minSize || height < minSize) { this._minSize = Math.max(width, height); } } this._width = width; this._height = height; this._elStyle.width = width + 'px'; this._elStyle.height = height + 'px'; this._elStyle.left = "".concat(this._oldL = parseInt(cPointX - width / 2, 10), "px"); this._elStyle.top = "".concat(this._oldT = parseInt(cPointY - height / 2, 10), "px"); } }, { key: "_rotateFullImg", value: function _rotateFullImg(el) { if (el !== this._fullEl) { return; } var _width = this._width, _height = this._height; this._width = _height; this._height = _width; this._elStyle.width = _height + 'px'; this._elStyle.height = _width + 'px'; var halfWidth = _width / 2; var halfHeight = _height / 2; this._elStyle.left = "".concat(this._oldL = parseInt(this._oldL + halfWidth - halfHeight, 10), "px"); this._elStyle.top = "".concat(this._oldT = parseInt(this._oldT + halfHeight - halfWidth, 10), "px"); } }, { key: "_showFullImg", value: function _showFullImg(data) { var _this79 = this; var _data$computeFullSize = data.computeFullSize(), _data$computeFullSize2 = _slicedToArray(_data$computeFullSize, 3), width = _data$computeFullSize2[0], height = _data$computeFullSize2[1], minSize = _data$computeFullSize2[2]; this._fullEl = data.getFullImg(false, function (el) { return _this79._resizeFullImg(el); }, function (el) { return _this79._rotateFullImg(el); }); this._width = width; this._height = height; this._minSize = minSize ? minSize / this._zoomFactor : Cfg.minImgSize; this._oldL = (Post.sizing.wWidth - width) / 2 - 1; this._oldT = (Post.sizing.wHeight - height) / 2 - 1; var el = $add("
= 59 && data.isVideo ? 10 : 0), "px; left:").concat(this._oldL, "px; width:").concat(width, "px; height:").concat(height, "px; display: block\">
")); el.append(this._fullEl); var scale = 100 * width / data.width; $q('.de-fullimg-scale', this._fullEl).textContent = scale === 100 ? '' : "".concat(parseInt(scale, 10), "%"); if (data.isImage) { $aBegin(this._fullEl, "")).append($q('img', this._fullEl)); } this._elStyle = el.style; this.data = data; this._parentEl = el; ['onwheel' in el ? 'wheel' : 'mousewheel', 'mousedown', 'click'].forEach(function (e) { return el.addEventListener(e, _this79, true); }); data.srcBtnEvents(this); if (data.inPview && !data.post.isSticky) { data.post.toggleSticky(true); } var btns = this._btns; if (!data.inPview) { btns.showBtns(); btns.autoBtn.classList.toggle('de-img-btn-none', !data.isVideo); } else if ($hasProp(this, '_btns')) { btns.hideBtns(); } data.post.thr.form.el.append(el); this.toggleVideoLoop(); if (this.data.rotate) { this.rotateView(false); } data.checkForRedirect(this._fullEl); } }]); return ImagesViewer; }(); var ExpandableImage = function () { function ExpandableImage(post, el, prev) { _classCallCheck(this, ExpandableImage); this.el = el; this.expanded = false; this.next = null; this.post = post; this.prev = prev; this.redirected = false; this.rotate = 0; this._fullEl = null; this._webmTitleLoad = null; if (prev) { prev.next = this; } } _createClass(ExpandableImage, [{ key: "height", get: function get() { return (this._size || [-1, -1])[1]; } }, { key: "inPview", get: function get() { var value = this.post instanceof Pview; Object.defineProperty(this, 'inPview', { value: value }); return value; } }, { key: "isImage", get: function get() { var value = /(jfif|jpe?g|png|gif|webp)$/i.test(this.src) || this.src.startsWith('blob:') && !this.el.hasAttribute('de-video'); Object.defineProperty(this, 'isImage', { value: value }); return value; } }, { key: "isVideo", get: function get() { var value = /(webm|mov|mp4|m4v|ogv)(&|$)/i.test(this.src) || this.src.startsWith('blob:') && this.el.hasAttribute('de-video'); Object.defineProperty(this, 'isVideo', { value: value }); return value; } }, { key: "src", get: function get() { var value = this._getImageSrc(); Object.defineProperty(this, 'src', { value: value, configurable: true }); return value; } }, { key: "width", get: function get() { return (this._size || [-1, -1])[0]; } }, { key: "cancelWebmLoad", value: function cancelWebmLoad(fullEl) { if (this.isVideo) { var videoEl = $q('video', fullEl); videoEl.pause(); videoEl.removeAttribute('src'); videoEl.load(); } if (this._webmTitleLoad) { this._webmTitleLoad.cancelPromise(); this._webmTitleLoad = null; } } }, { key: "checkForRedirect", value: function checkForRedirect(fullEl) { var _this80 = this; if (!aib.getImgRedirectSrc || this.redirected) { return; } aib.getImgRedirectSrc(this.src).then(function (newSrc) { _this80.redirected = true; Object.defineProperty(_this80, 'src', { value: newSrc }); $q('img, video', fullEl).src = _this80.el.src = _this80.el.parentNode.href = getImgNameLink(_this80.el).href = newSrc; if (!_this80.isVideo) { $q('a', fullEl).href = newSrc; } }); } }, { key: "collapseImg", value: function collapseImg(e) { if (e && this.isVideo && ExpandableImage.isControlClick(e)) { return; } var fullImgTop; if (e) { fullImgTop = e.target.getBoundingClientRect().top; } this.cancelWebmLoad(this._fullEl); this.expanded = false; this._fullEl.remove(); this._fullEl = null; $show(this.el.parentNode); (aib.hasPicWrap ? this._getImageParent : this.el.parentNode).nextSibling.remove(); if (e) { e.preventDefault(); if (this.inPview) { this.sendCloseEvent(e, true); } var origImgTop = this.el.getBoundingClientRect().top; if (fullImgTop < 0 || origImgTop < 0) { scrollTo(deWindow.pageXOffset, deWindow.pageYOffset + origImgTop); } } if (aib.kohlchan) { var containerEl = $q('.contentOverflow', this.post.el); if (containerEl && !$q('.de-fullimg-wrap-inpost', containerEl)) { containerEl.removeAttribute('style'); } } } }, { key: "computeFullSize", value: function computeFullSize() { if (!this._size) { if (this.isVideo) { return [0, 0, null]; } var el = new Image(); el.src = this.el.src; return [el.width, el.height, null]; } var _this$_size = _slicedToArray(this._size, 2), width = _this$_size[0], height = _this$_size[1]; if (Cfg.resizeDPI) { width /= Post.sizing.dPxRatio; height /= Post.sizing.dPxRatio; } var minSize = this.isVideo ? Math.max(Cfg.minImgSize, Cfg.minWebmWidth) : Cfg.minImgSize; if (width < minSize && height < minSize) { var ar = width / height; if (width > height) { width = minSize; height = width / ar; } else { height = minSize; width = this.isVideo ? minSize : height * ar; } } var maxWidth = Math.min(Post.sizing.wWidth - 2, Cfg.maxImgSize); var maxHeight = Math.min(Post.sizing.wHeight - (Cfg.imgInfoLink ? 24 : 2) - (nav.firefoxVer >= 59 && this.isVideo ? 19 : 0), Cfg.maxImgSize); if (width > maxWidth || height > maxHeight) { var _ar = width / height; if (_ar > maxWidth / maxHeight) { width = maxWidth; height = width / _ar; } else { height = maxHeight; width = height * _ar; } if (width < minSize) { return [minSize, height, Math.max(width, height)]; } } return [width, height, null]; } }, { key: "expandImg", value: function expandImg(inPost, e) { var _this81 = this; if (e && !e.bubbles) { return; } if (!inPost) { var viewer = AttachedImage.viewer; if (!viewer) { AttachedImage.viewer = new ImagesViewer(this); return; } if (viewer.data === this) { viewer.closeImgViewer(e); AttachedImage.viewer = null; return; } viewer.updateImgViewer(this, e); return; } var origImgTop; if (e) { origImgTop = e.target.getBoundingClientRect().top; } this.expanded = true; (aib.hasPicWrap ? this._getImageParent : this.el.parentNode).insertAdjacentHTML('afterend', '
'); var fullEl = this._fullEl = this.getFullImg(true, null, null); fullEl.addEventListener('click', function (e) { return _this81.collapseImg(e); }, true); this.srcBtnEvents(this); var parent = this.el.parentNode; $hide(parent); parent.after(fullEl); this.checkForRedirect(fullEl); if (e) { var fullImgTop = fullEl.getBoundingClientRect().top; if (fullImgTop < 0 || origImgTop < 0) { scrollTo(deWindow.pageXOffset, deWindow.pageYOffset + fullImgTop); } } if (aib.kohlchan) { if (!this.isVideo) { $q('.de-fullimg', fullEl).classList.add('imgExpanded'); } var containerEl = $q('.contentOverflow', this.post.el); if (containerEl) { containerEl.style.maxHeight = 'unset'; } } } }, { key: "getFollowImg", value: function getFollowImg(isForward) { var nImage = isForward ? this.next : this.prev; if (nImage) { return nImage; } var imgs; var post = this.post; do { post = post.getAdjacentVisPost(!isForward); if (!post) { post = isForward ? Thread.first.op : Thread.last.last; if (post.isHidden || post.thr.isHidden) { post = post.getAdjacentVisPost(!isForward); if (!post) { return null; } } } imgs = post.images; } while (imgs.first === null); return isForward ? imgs.first : imgs.last; } }, { key: "getFullImg", value: function getFullImg(inPost, onsizechange, onrotate) { var _this82 = this; var wrapEl, name, origSrc; var src = this._getImageSrc(); var parent = this._getImageParent; if (this.el.className !== 'de-img-embed') { var nameEl = $q(aib.qPostImgNameLink, parent) || $q('a', parent); origSrc = nameEl.getAttribute('de-href') || nameEl.href; name = this.name; } else { origSrc = parent.href; name = getFileName(origSrc); } var imgNameEl = (Cfg.imgSrcBtns ? '' : '') + "").concat(name); var wrapClass = "".concat(inPost ? ' de-fullimg-wrap-inpost' : " de-fullimg-wrap-center".concat(this._size ? '' : ' de-fullimg-wrap-nosize')).concat(this.isVideo ? ' de-fullimg-video' : ''); if (!this.isVideo) { var waitEl = !aib.getImgRedirectSrc && this._size ? '' : ''; wrapEl = $add("")); var imgEl = $q('.de-fullimg', wrapEl); imgEl.onload = imgEl.onerror = function (_ref40) { var img = _ref40.target; if (!(img.naturalHeight + img.naturalWidth)) { if (!img.onceLoaded) { var _src = img.src; img.src = _src; img.onceLoaded = true; } return; } var newW = img.naturalWidth, newH = img.naturalHeight, scrollWidth = img.scrollWidth; var ar = _this82._size ? _this82._size[1] / _this82._size[0] : newH / newW; var isRotated = scrollWidth ? img.scrollHeight / scrollWidth > 1 ? ar < 1 : ar > 1 : false; if (!_this82._size || isRotated) { _this82._size = isRotated ? [newH, newW] : [newW, newH]; } var parentEl = img.parentNode.parentNode; var waitEl = $q('.de-fullimg-load', parentEl); if (waitEl) { $hide(waitEl); parentEl.classList.remove('de-fullimg-wrap-nosize'); if (onsizechange) { onsizechange(parentEl); } } else if (isRotated && onrotate) { onrotate(parentEl); } }; DollchanAPI.notify('expandmedia', src); return wrapEl; } var isWebm = getFileExt(origSrc) === 'webm'; var needTitle = isWebm && Cfg.webmTitles; var inPostSize = ''; if (inPost) { var _this$computeFullSize = this.computeFullSize(), _this$computeFullSize2 = _slicedToArray(_this$computeFullSize, 2), width = _this$computeFullSize2[0], height = _this$computeFullSize2[1]; inPostSize = " style=\"width: ".concat(width, "px; height: ").concat(height, "px;\""); } var hasTitle = needTitle && this.el.hasAttribute('de-metatitle'); var title = hasTitle ? this.el.getAttribute('de-metatitle') : ''; wrapEl = $add("
").concat(nav.firefoxVer < 59 ? '' : '
', "\n\t\t\t\n\t\t\t
").concat(imgNameEl, " \n\t\t\t\t").concat(hasTitle && title ? title : '', "\n\t\t\t\t").concat(needTitle && !hasTitle ? "\n\t\t\t\t\t" : '', "\n\t\t\t
\n\t\t
")); var videoEl = $q('video', wrapEl); videoEl.volume = Cfg.webmVolume / 100; videoEl.addEventListener('ended', function () { return AttachedImage.viewer.navigate(true, true); }); videoEl.addEventListener('error', function (_ref41) { var el = _ref41.target; if (!el.onceLoaded) { el.load(); el.onceLoaded = true; } }); if (!this._size) { videoEl.addEventListener('loadedmetadata', function (_ref42) { var el = _ref42.target; _this82._size = [el.videoWidth, el.videoHeight]; onsizechange(wrapEl); }); } setTimeout(function () { return videoEl.dispatchEvent(new CustomEvent('volumechange')); }, 150); videoEl.addEventListener('volumechange', function () { var _ref44 = _asyncToGenerator( _regeneratorRuntime().mark(function _callee39(_ref43) { var el, isTrusted, val; return _regeneratorRuntime().wrap(function _callee39$(_context43) { while (1) switch (_context43.prev = _context43.next) { case 0: el = _ref43.target, isTrusted = _ref43.isTrusted; val = el.muted ? 0 : Math.round(el.volume * 100); if (!(isTrusted && val !== Cfg.webmVolume)) { _context43.next = 6; break; } _context43.next = 5; return CfgSaver.save('webmVolume', val); case 5: sendStorageEvent('__de-webmvolume', val); case 6: case "end": return _context43.stop(); } }, _callee39); })); return function (_x29) { return _ref44.apply(this, arguments); }; }()); if (nav.isMsEdge && isWebm && !DollchanAPI.hasListener('expandmedia')) { var href = 'https://github.com/Kagami/webmify/'; $popup('err-expandmedia', "".concat(Lng.errMsEdgeWebm[lang], ":\n").concat(href, ""), false); } if (needTitle && !hasTitle) { this._webmTitleLoad = ContentLoader.loadImgData(videoEl.src, false).then(function (data) { $hide($q('.de-wait', wrapEl)); if (!data) { return; } var str = ''; var d = new WebmParser(data.buffer).getWebmData(); if (!d) { return; } d = d[0]; for (var i = 0, len = d.length; i < len; ++i) { if (d[i] === 0x7B && d[i + 1] === 0xA9) { var titleLenPos = i + 2; var muxingAppPos = titleLenPos + (d[titleLenPos] & 0x7F) + 1; if (d[muxingAppPos] === 0x4D && d[muxingAppPos + 1] === 0x80) { for (var j = titleLenPos + 1; j < muxingAppPos; ++j) { str += String.fromCharCode(d[j]); } break; } } } var loadedTitle = decodeURIComponent(escape(str)); _this82.el.setAttribute('de-metatitle', loadedTitle); if (str) { $q('.de-webm-title', wrapEl).textContent = videoEl.title = loadedTitle.replaceAll('.', ' '); } }); } DollchanAPI.notify('expandmedia', src); return wrapEl; } }, { key: "sendCloseEvent", value: function sendCloseEvent(e, inPost) { var post = this.post; var cr = post.el.getBoundingClientRect(); var x = e.pageX - deWindow.pageXOffset; var y = e.pageY - deWindow.pageYOffset; if (!inPost) { while (x > cr.right || x < cr.left || y > cr.bottom || y < cr.top) { post = post.parent; if (post && post instanceof Pview) { cr = post.el.getBoundingClientRect(); } else { if (Pview.top) { Pview.top.markToDel(); } return; } } post.mouseEnter(); } else if (x > cr.right || y > cr.bottom && Pview.top) { Pview.top.markToDel(); } } }, { key: "srcBtnEvents", value: function srcBtnEvents(_ref45) { var _this83 = this; var _fullEl = _ref45._fullEl; if (!Cfg.imgSrcBtns) { return; } var srcBtnEl = $q('.de-btn-img', _fullEl); srcBtnEl.addEventListener('mouseover', function () { return srcBtnEl.odelay = setTimeout(function () { var menuHtml = !_this83.isVideo ? Menu.getMenuImg(srcBtnEl) : Menu.getMenuImg(srcBtnEl, true) + "".concat(Lng.getFrameLinks[lang], ""); new Menu(srcBtnEl, menuHtml, !_this83.isVideo ? Function.prototype : function (optiontEl) { if (!optiontEl.classList.contains('de-menu-getframe')) { return; } ContentLoader.getDataFromImg($q('video', _fullEl)).then(function (arr) { $popup('upload', Lng.sending[lang], true); var name = cutFileExt(_this83.name) + '.png'; var blob = new Blob([arr], { type: 'image/png' }); var formData = new FormData(); formData.append('file', blob, name); var ajaxParams = { data: formData || { arr: arr, name: name }, method: 'POST' }; var frameLinkHtml = "").concat(Lng.saveFrame[lang], ""); $ajax('https://tmp.saucenao.com/', ajaxParams, true).then(function (xhr) { var hostUrl; var errMsg = Lng.errSaucenao[lang]; try { var obj = JSON.parse(xhr.responseText); if (obj.status === 'success') { hostUrl = obj.url ? Menu.getMenuImg(obj.url) : ''; } else { errMsg += ':
' + obj.error_message; } } catch (err) {} $popup('upload', (hostUrl || errMsg) + frameLinkHtml); }, function () { return $popup('upload', Lng.errSaucenao[lang] + frameLinkHtml); }); }, Function.prototype); }); }, Cfg.linksOver); }); srcBtnEl.addEventListener('mouseout', function (e) { return clearTimeout(e.target.odelay); }); } }, { key: "_size", get: function get() { var value = this._getImageSize(); Object.defineProperty(this, '_size', { value: value, writable: true }); return value; } }], [{ key: "isControlClick", value: function isControlClick(e) { return Cfg.webmControl && e.clientY > e.target.getBoundingClientRect().bottom - 40; } }]); return ExpandableImage; }(); var EmbeddedImage = function (_ExpandableImage) { _inherits(EmbeddedImage, _ExpandableImage); var _super8 = _createSuper(EmbeddedImage); function EmbeddedImage() { _classCallCheck(this, EmbeddedImage); return _super8.apply(this, arguments); } _createClass(EmbeddedImage, [{ key: "_getImageParent", get: function get() { var value = this.el.parentNode; Object.defineProperty(this, '_getImageParent', { value: value }); return value; } }, { key: "_getImageSize", value: function _getImageSize() { return [this.el.naturalWidth, this.el.naturalHeight]; } }, { key: "_getImageSrc", value: function _getImageSrc() { return this.el.src; } }]); return EmbeddedImage; }(ExpandableImage); var AttachedImage = function (_ExpandableImage2) { _inherits(AttachedImage, _ExpandableImage2); var _super9 = _createSuper(AttachedImage); function AttachedImage() { _classCallCheck(this, AttachedImage); return _super9.apply(this, arguments); } _createClass(AttachedImage, [{ key: "info", get: function get() { var value = aib.getImgInfo(this._getImageParent); Object.defineProperty(this, 'info', { value: value }); return value; } }, { key: "name", get: function get() { var value = aib.getImgRealName(this._getImageParent).trim(); Object.defineProperty(this, 'name', { value: value }); return value; } }, { key: "nameLink", get: function get() { var value = $q(aib.qPostImgNameLink, this._getImageParent); Object.defineProperty(this, 'nameLink', { value: value }); return value; } }, { key: "weight", get: function get() { var value = 0; if (this.info) { var w = this.info; if (this.nameLink) { w = w.replace(this.nameLink.innerText, ''); } w = w.match(/(\d+(?:[.,]\d+)?)\s*([mмkк])?i?[bб]/i); var w1 = w[1].replace(',', '.'); value = w[2] === 'M' ? w1 * 1e3 | 0 : !w[2] ? Math.round(w1 / 1e3) : w1; } Object.defineProperty(this, 'weight', { value: value }); return value; } }, { key: "_getImageParent", get: function get() { var value = aib.getImgWrap(this.el); Object.defineProperty(this, '_getImageParent', { value: value }); return value; } }, { key: "_getImageSize", value: function _getImageSize() { if (this.info) { var size = this.info.match(/(?:[\s(]|^)(\d+)\s?[x\u00D7]\s?(\d+)(?:[)\s,]|$)/); return size ? [size[1], size[2]] : null; } return null; } }, { key: "_getImageSrc", value: function _getImageSrc() { return aib.getImgSrcLink(this.el).getAttribute('href'); } }], [{ key: "closeImg", value: function closeImg() { var viewer = AttachedImage.viewer; if (viewer) { viewer.closeImgViewer(null); AttachedImage.viewer = null; } } }]); return AttachedImage; }(ExpandableImage); AttachedImage.viewer = null; var PostImages = function (_Symbol$iterator) { function PostImages(post) { _classCallCheck(this, PostImages); var first = null; var last = null; var els = $Q(aib.qPostImg, post.el); var hasAttachments = false; var filesMap = new Map(); for (var i = 0, len = els.length; i < len; ++i) { var el = els[i]; last = new AttachedImage(post, el, last); filesMap.set(el, last); hasAttachments = true; if (!first) { first = last; } } if (Cfg.addImgs || localData) { els = $Q('.de-img-embed', post.el); for (var _i13 = 0, _len6 = els.length; _i13 < _len6; ++_i13) { var _el7 = els[_i13]; last = new EmbeddedImage(post, _el7, last); filesMap.set(_el7, last); if (!first) { first = last; } } } this.first = first; this.last = last; this.hasAttachments = hasAttachments; this._map = filesMap; } _createClass(PostImages, [{ key: "expanded", get: function get() { for (var img = this.first; img; img = img.next) { if (img.expanded) { return true; } } return false; } }, { key: "firstAttach", get: function get() { return this.hasAttachments ? this.first : null; } }, { key: "getImageByEl", value: function getImageByEl(el) { return this._map.get(el); } }, { key: _Symbol$iterator, value: function value() { return { _img: this.first, next: function next() { var value = this._img; if (value) { this._img = value.next; return { value: value, done: false }; } return { done: true }; } }; } }]); return PostImages; }(Symbol.iterator); var ImagesHashStorage = Object.create({ get getHash() { var value = this._getHashHelper.bind(this); Object.defineProperty(this, 'getHash', { value: value }); return value; }, endFn: function endFn() { if ($hasProp(this, '_storage')) { sesStorage['de-imageshash'] = JSON.stringify(this._storage); } if ($hasProp(this, '_workers')) { this._workers.clearWorkers(); delete this._workers; } }, get _canvas() { var value = doc.createElement('canvas'); Object.defineProperty(this, '_canvas', { value: value }); return value; }, get _storage() { var value = null; try { value = JSON.parse(sesStorage['de-imageshash']); } catch (err) {} if (!value) { value = {}; } Object.defineProperty(this, '_storage', { value: value }); return value; }, get _workers() { var value = new WorkerPool(4, this._genImgHash, Function.prototype); Object.defineProperty(this, '_workers', { value: value, configurable: true }); return value; }, _genImgHash: function _genImgHash(_ref46) { var _ref47 = _slicedToArray(_ref46, 3), arrBuf = _ref47[0], oldw = _ref47[1], oldh = _ref47[2]; var buf = new Uint8Array(arrBuf); var size = oldw * oldh; for (var i = 0, j = 0; i < size; i++, j += 4) { buf[i] = buf[j] * 0.3 + buf[j + 1] * 0.59 + buf[j + 2] * 0.11; } var newh = 8; var neww = 8; var levels = 4; var areas = 256 / levels; var values = 256 / (levels - 1); var hash = 0; for (var _i14 = 0; _i14 < newh; ++_i14) { for (var _j4 = 0; _j4 < neww; ++_j4) { var temp = _i14 / (newh - 1) * (oldh - 1); var l = Math.min(temp | 0, oldh - 2); var u = temp - l; temp = _j4 / (neww - 1) * (oldw - 1); var c = Math.min(temp | 0, oldw - 2); var t = temp - c; hash = (hash << 4) + Math.min(values * ((buf[l * oldw + c] * ((1 - t) * (1 - u)) + buf[l * oldw + c + 1] * (t * (1 - u)) + buf[(l + 1) * oldw + c + 1] * (t * u) + buf[(l + 1) * oldw + c] * ((1 - t) * u)) / areas | 0), 255); var g = hash & 0xF0000000; if (g) { hash ^= g >>> 24; } hash &= ~g; } } return { hash: hash }; }, _getHashHelper: function _getHashHelper(_ref48) { var _this84 = this; return _asyncToGenerator( _regeneratorRuntime().mark(function _callee40() { var el, src, data, val, w, h, cnv, ctx, buffer; return _regeneratorRuntime().wrap(function _callee40$(_context44) { while (1) switch (_context44.prev = _context44.next) { case 0: el = _ref48.el, src = _ref48.src; if (!(src in _this84._storage)) { _context44.next = 3; break; } return _context44.abrupt("return", _this84._storage[src]); case 3: if (el.complete) { _context44.next = 6; break; } _context44.next = 6; return new Promise(function (resolve) { return el.addEventListener('load', function () { return resolve(); }); }); case 6: el.removeAttribute('loading'); if (!(el.naturalWidth + el.naturalHeight === 0)) { _context44.next = 9; break; } return _context44.abrupt("return", -1); case 9: val = -1; w = el.naturalWidth, h = el.naturalHeight; cnv = _this84._canvas; cnv.width = w; cnv.height = h; ctx = cnv.getContext('2d'); ctx.drawImage(el, 0, 0); buffer = ctx.getImageData(0, 0, w, h).data.buffer; if (!buffer) { _context44.next = 22; break; } _context44.next = 20; return new Promise(function (resolve) { return _this84._workers.runWorker([buffer, w, h], [buffer], function (val) { return resolve(val); }); }); case 20: data = _context44.sent; if (data && 'hash' in data) { val = data.hash; } case 22: _this84._storage[src] = val; return _context44.abrupt("return", val); case 24: case "end": return _context44.stop(); } }, _callee40); }))(); } }); function getImgNameLink(el) { return $q(aib.qPostImgNameLink, aib.getImgWrap(el)); } function addImgButtons(link) { link.insertAdjacentHTML('beforebegin', '' + ''); } function processImgInfoLinks(parent) { var addSrc = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Cfg.imgSrcBtns; var imgNames = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : Cfg.imgNames; if (addSrc || imgNames) { if (parent instanceof AbstractPost) { processPostImgInfoLinks(parent, addSrc, imgNames); } else { var posts = $Q(aib.qPost + ', ' + aib.qOPost + ', .de-oppost', parent); for (var i = 0, len = posts.length; i < len; ++i) { processPostImgInfoLinks(pByEl.get(posts[i]), addSrc, imgNames); } } } } function processPostImgInfoLinks(post, addSrc, imgNames) { if (!post) { return; } for (var _iterator25 = _createForOfIteratorHelperLoose(post.images), _step25; !(_step25 = _iterator25()).done;) { var image = _step25.value; var link = image.nameLink; if (!link) { return; } if (addSrc) { addImgButtons(link); } var name = image.name; if (!link.classList.contains('de-img-name')) { link.classList.add('de-img-name'); link.title = name; link.setAttribute('download', name); link.setAttribute('de-href', link.href); } if (imgNames) { var ext = link.getAttribute('de-img-ext'); if (!ext) { ext = getFileExt(name) || getFileExt(getFileName(link.href)); link.setAttribute('de-img-ext', ext); link.setAttribute('de-img-name-old', link.textContent); } link.textContent = imgNames === 2 ? ext : name; } } } function embedPostMsgImages(el) { if (!Cfg.addImgs || localData) { return; } var els = $Q(aib.qMsgImgLink, el); for (var i = 0, len = els.length; i < len; ++i) { var link = els[i]; var url = link.href; if (url.includes('?') || aib.getPostOfEl(link).hidden) { continue; } link.insertAdjacentHTML('beforebegin', "
")); if (Cfg.imgSrcBtns) { addImgButtons(link); } } } var DOMPostsBuilder = function () { function DOMPostsBuilder(form, isArchived) { _classCallCheck(this, DOMPostsBuilder); this._form = form; this._posts = $Q(aib.qPost, form); this.length = this._posts.length; this.postersCount = ''; this._isArchived = isArchived; } _createClass(DOMPostsBuilder, [{ key: "isClosed", get: function get() { return aib.qClosed && !!$q(aib.qClosed, this._form) || this._isArchived; } }, { key: "getOpMessage", value: function getOpMessage() { return aib.fixHTML(doc.adoptNode($q(aib.qPostMsg, this._form))); } }, { key: "getPNum", value: function getPNum(i) { return aib.getPNum(this._posts[i]); } }, { key: "getOpEl", value: function getOpEl() { return aib.fixHTML(aib.getOp($q(aib.qThread, this._form) || this._form)); } }, { key: "getPostEl", value: function getPostEl(i) { return aib.fixHTML(this._posts[i]); } }, { key: "getRefLinks", value: _regeneratorRuntime().mark(function getRefLinks(i, thrUrl) { var msg, links, _i15, len, link, tc, lNum, url; return _regeneratorRuntime().wrap(function getRefLinks$(_context45) { while (1) switch (_context45.prev = _context45.next) { case 0: msg = i === 0 ? $q(aib.qPostMsg, this._form) : $q(aib.qPostMsg, this._posts[i - 1]); links = $Q('a', msg); _i15 = 0, len = links.length; case 3: if (!(_i15 < len)) { _context45.next = 16; break; } link = links[_i15]; tc = link.textContent; if (!(tc[0] === '>' && tc[1] === '>')) { _context45.next = 13; break; } lNum = parseInt(tc.substr(2), 10); if (!lNum) { _context45.next = 13; break; } _context45.next = 11; return [link, lNum]; case 11: url = link.getAttribute('href'); if (url[0] === '#') { link.setAttribute('href', thrUrl + url); } case 13: ++_i15; _context45.next = 3; break; case 16: case "end": return _context45.stop(); } }, getRefLinks, this); }) }, { key: "bannedPostsData", value: _regeneratorRuntime().mark(function bannedPostsData() { var banEls, i, len, banEl, postEl; return _regeneratorRuntime().wrap(function bannedPostsData$(_context46) { while (1) switch (_context46.prev = _context46.next) { case 0: banEls = $Q(aib.qBan, this._form); i = 0, len = banEls.length; case 2: if (!(i < len)) { _context46.next = 10; break; } banEl = banEls[i]; postEl = aib.getPostElOfEl(banEl); _context46.next = 7; return [1, postEl ? aib.getPNum(postEl) : null, doc.adoptNode(banEl)]; case 7: ++i; _context46.next = 2; break; case 10: case "end": return _context46.stop(); } }, bannedPostsData, this); }) }]); return DOMPostsBuilder; }(); var _4chanPostsBuilder = function () { function _4chanPostsBuilder(json, board) { _classCallCheck(this, _4chanPostsBuilder); this._posts = json.posts; this._board = board; this.length = json.posts.length - 1; this.postersCount = this._posts[0].unique_ips; this._colorIDs = []; } _createClass(_4chanPostsBuilder, [{ key: "isClosed", get: function get() { return !!(this._posts[0].closed || this._posts[0].archived); } }, { key: "getOpMessage", value: function getOpMessage() { var _this$_posts$ = this._posts[0], no = _this$_posts$.no, com = _this$_posts$.com; return $add(aib.fixHTML("
").concat(com, "
"))); } }, { key: "getPNum", value: function getPNum(i) { return this._posts[i + 1].no; } }, { key: "getOpEl", value: function getOpEl() { return this.getPostEl(-1); } }, { key: "getPostEl", value: function getPostEl(i) { return $add(aib.fixHTML(this.getPostHTML(i))).lastElementChild; } }, { key: "getPostHTML", value: function getPostHTML(i) { var data = this._posts[i + 1]; var num = data.no; var board = this._board; var _icon = function _icon(id) { return "//s.4cdn.org/image/".concat(id).concat(deWindow.devicePixelRatio < 2 ? '.gif' : '@2x.gif'); }; var fileHTML = ''; if (data.filedeleted) { fileHTML = "
\n\t\t\t\t\"File\n\t\t\t
"); } else if (typeof data.filename === 'string') { var _chanPostsBuilder$fi = _4chanPostsBuilder.fixFileName(data.filename, 30), _name2 = _chanPostsBuilder$fi.name, needTitle = _chanPostsBuilder$fi.isFixed; _name2 += data.ext; if (!data.tn_w && !data.tn_h && data.ext === '.gif') { data.tn_w = data.w; data.tn_h = data.h; } var isSpoiler = data.spoiler; if (isSpoiler) { _name2 = 'Spoiler Image'; data.tn_w = data.tn_h = 100; needTitle = false; } var size = prettifySize(data.fsize); var fileTextTitle = isSpoiler ? " title=\"".concat(data.filename + data.ext, "\"") : ''; var aHref = needTitle ? "title=\"".concat(data.filename + data.ext, "\"") : ''; var imgSrc = isSpoiler ? '//s.4cdn.org/image/spoiler.png' : "//i.4cdn.org/".concat(board, "/").concat(data.tim, "s.jpg"); fileHTML = "
\n\t\t\t\t
File:\n\t\t\t\t\t").concat(_name2, "\n\t\t\t\t\t(").concat(size, ", ").concat(data.ext === '.pdf' ? 'PDF' : data.w + 'x' + data.h, ")\n\t\t\t\t
\n\t\t\t\t\n\t\t\t\t\t\"").concat(size,\n\t\t\t\t\t
\n\t\t\t\t\t\t").concat(size, " ").concat(data.ext.substr(1).toUpperCase(), "\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
"); } var highlight = ''; var ccBy = ''; var cc = data.capcode; switch (cc) { case 'admin_highlight': highlight = ' highlightPost'; cc = 'admin'; case 'admin': ccBy = 'Administrators'; break; case 'mod': ccBy = 'Moderators'; break; case 'developer': ccBy = 'Developers'; break; case 'manager': ccBy = 'Managers'; break; case 'founder': ccBy = 'Founder'; } var ccName = ''; var ccText = ''; var ccImg = ''; var ccClass = ''; if (cc) { ccName = cc[0].toUpperCase() + cc.slice(1); ccText = "## ").concat(ccName, ""); ccImg = "\"").concat(ccName,"); ccClass = 'capcode' + (cc === 'founder' ? 'Admin' : ccName); } var id = data.id, _data$name = data.name, name = _data$name === void 0 ? '' : _data$name; var nameEl = "".concat(name, ""); var mobNameEl = name.length <= 30 ? nameEl : "".concat(name.substring(30), "(\u2026)"); var tripEl = "".concat(data.trip ? "".concat(data.trip, "") : ''); var cID = id ? this._colorIDs[id] || this._computeIDColor(id) : null; var posteruidEl = id && !data.capcode ? "(ID: ").concat(id, ")") : ''; var flagEl = (data.country ? "") : '') + (data.board_flag ? "") : ''); var emailEl = data.email ? "") : ''; var replyEl = "No.").concat(num, ""); var subjEl = "".concat(data.sub || '', ""); return "
\n\t\t\t
>>
\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\t").concat(mobNameEl, "\n\t\t\t\t\t\t").concat(tripEl, "\n\t\t\t\t\t\t").concat(ccText, "\n\t\t\t\t\t\t").concat(ccImg, "\n\t\t\t\t\t\t").concat(posteruidEl, "\n\t\t\t\t\t\t").concat(flagEl, "
\n\t\t\t\t\t\t").concat(subjEl, "\n\t\t\t\t\t
\n\t\t\t\t\t").concat(data.now, " ").concat(replyEl, "\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t").concat(subjEl, "\n\t\t\t\t\t\n\t\t\t\t\t\t").concat(emailEl, "\n\t\t\t\t\t\t\t").concat(nameEl, "\n\t\t\t\t\t\t\t").concat(tripEl, "\n\t\t\t\t\t\t\t").concat(ccText, "\n\t\t\t\t\t\t").concat(data.email ? '' : '', "\n\t\t\t\t\t\t").concat(ccImg, "\n\t\t\t\t\t\t").concat(posteruidEl, "\n\t\t\t\t\t\t").concat(flagEl, "\n\t\t\t\t\t\n\t\t\t\t\t").concat(data.now, "\n\t\t\t\t\t").concat(replyEl, "\n\t\t\t\t
\n\t\t\t\t").concat(fileHTML, "\n\t\t\t\t
").concat(data.com || '', "
\n\t\t\t
\n\t\t
"); } }, { key: "bannedPostsData", value: _regeneratorRuntime().mark(function bannedPostsData() { return _regeneratorRuntime().wrap(function bannedPostsData$(_context47) { while (1) switch (_context47.prev = _context47.next) { case 0: case "end": return _context47.stop(); } }, bannedPostsData); }) }, { key: "_computeIDColor", value: function _computeIDColor(text) { var hash = 0; for (var i = 0, len = text.length; i < len; ++i) { hash = (hash << 5) - hash + text.charCodeAt(i); } var r = hash >> 24 & 255; var g = hash >> 16 & 255; var b = hash >> 8 & 255; var value = this._colorIDs[text] = [r, g, b, 0.299 * r + 0.587 * g + 0.114 * b > 125]; return value; } }], [{ key: "fixFileName", value: function fixFileName(name, maxLength) { var decodedName = name.replaceAll('&', '&').replaceAll('"', '"').replaceAll(''', '\'').replaceAll('<', '<').replaceAll('>', '>'); return decodedName.length <= maxLength ? { isFixed: false, name: name } : { isFixed: true, name: decodedName.slice(0, 25).replaceAll('&', '&').replaceAll('"', '"').replaceAll('\'', ''').replaceAll('<', '<').replaceAll('>', '>') }; } }]); return _4chanPostsBuilder; }(); _4chanPostsBuilder._customSpoiler = new Map(); var MakabaPostsBuilder = function () { function MakabaPostsBuilder(json, board) { _classCallCheck(this, MakabaPostsBuilder); if (json.Error) { throw new AjaxError(0, "API error: ".concat(json.Error, " (").concat(json.Code, ")")); } this._json = json; this._board = board; this._posts = json.threads[0].posts; this.length = json.posts_count - 1; this.postersCount = json.unique_posters; } _createClass(MakabaPostsBuilder, [{ key: "isClosed", get: function get() { return this._json.is_closed; } }, { key: "getOpMessage", value: function getOpMessage() { return $add(aib.fixHTML(this._getPostMsg(this._posts[0]))); } }, { key: "getPNum", value: function getPNum(i) { return this._posts[i + 1].num; } }, { key: "getOpEl", value: function getOpEl() { return this.getPostEl(-1); } }, { key: "getPostEl", value: function getPostEl(i) { return $add(aib.fixHTML(this.getPostHTML(i))).firstElementChild; } }, { key: "getPostHTML", value: function getPostHTML(i) { var data = this._posts[i + 1]; var files = data.files, num = data.num; var board = this._board; var _switch = function _switch(val, obj) { return val in obj ? obj[val] : obj['@@default']; }; var filesHTML = ''; if (files !== null && files !== void 0 && files.length) { filesHTML = "
"); for (var _iterator26 = _createForOfIteratorHelperLoose(files), _step26; !(_step26 = _iterator26()).done;) { var file = _step26.value; var imgId = num + '-' + file.md5; var _file$fullname = file.fullname, fullname = _file$fullname === void 0 ? file.name : _file$fullname, _file$displayname = file.displayname, dispName = _file$displayname === void 0 ? file.name : _file$displayname, type = file.type; var isVideo = type === 6 || type === 10; var imgClass = "post__file-preview".concat(isVideo ? ' post__file-webm' : '').concat(data.nsfw ? ' post__file-nsfw' : ''); filesHTML += "
\n\t\t\t\t\t
\n\t\t\t\t\t\t").concat(dispName, "\n\t\t\t\t\t\t(").concat(file.size, "\u041A\u0431, ") + "".concat(file.width, "x").concat(file.height).concat(isVideo ? ', ' + file.duration : '', ")\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
"); } filesHTML += '
'; } var emailEl = data.email ? "").concat(data.name, "") : "".concat(data.name, ""); var tripEl = !data.trip ? '' : "## Abu ##', '!!%mod%!!': 'post__mod">## Mod ##', '!!%Inquisitor%!!': 'post__inquisitor">## Applejack ##', '!!%coder%!!': 'post__mod">## Кодер ##', '!!%curunir%!!': 'post__mod">## Curunir ##', '@@default': "".concat(data.trip_style ? data.trip_style : 'post__trip', "\">") + data.trip }), ""); var refHref = "/".concat(board, "/res/").concat(parseInt(data.parent) || num, ".html#").concat(num); var rate = ''; if (this._hasLikes) { var likes = "
\n\t\t\t\t\t\n\t\t\t\t\t\t "); var dislikes = likes.replaceAll('like', 'dislike').replace('icon__thunder', 'icon__thumbdown'); rate = "".concat(likes).concat(data.likes || 0, "
\n\t\t\t\t").concat(dislikes).concat(data.dislikes || 0, "
"); } var isOp = i === -1; var reflink = "\u2116") + "").concat(num, ""); var w = function w(el) { return "".concat(el, ""); }; return "
\n\t\t\t
\n\t\t\t\t\n\t\t\t\t").concat(!data.subject ? '' : w('' + "".concat(data.subject + (data.tags ? " /".concat(data.tags, "/") : ''), "")), "\n\t\t\t\t").concat(w("\n\t\t\t\t\t".concat(emailEl, "\n\t\t\t\t\t").concat(data.icon ? '' + "".concat(data.icon, "") : '', "\n\t\t\t\t\t").concat(tripEl, "\n\t\t\t\t\t").concat(data.op === 1 ? '# OP ' : '', "\n\t\t\t\t")), "\n\t\t\t\t").concat(w("".concat(data.date, "")), "\n\t\t\t\t").concat(w(reflink), "\n\t\t\t\t").concat(rate, "\n\t\t\t
\n\t\t\t").concat(filesHTML, "\n\t\t\t").concat(this._getPostMsg(data), "\n\t\t
"); } }, { key: "bannedPostsData", value: _regeneratorRuntime().mark(function bannedPostsData() { var _iterator27, _step27, _step27$value, banned, num; return _regeneratorRuntime().wrap(function bannedPostsData$(_context48) { while (1) switch (_context48.prev = _context48.next) { case 0: _iterator27 = _createForOfIteratorHelperLoose(this._posts); case 1: if ((_step27 = _iterator27()).done) { _context48.next = 14; break; } _step27$value = _step27.value, banned = _step27$value.banned, num = _step27$value.num; _context48.t0 = banned; _context48.next = _context48.t0 === 1 ? 6 : _context48.t0 === 2 ? 9 : 12; break; case 6: _context48.next = 8; return [1, num, $add('(Автор этого поста был забанен.)')]; case 8: return _context48.abrupt("break", 12); case 9: _context48.next = 11; return [2, num, $add('' + '(Автор этого поста был предупрежден.)')]; case 11: return _context48.abrupt("break", 12); case 12: _context48.next = 1; break; case 14: case "end": return _context48.stop(); } }, bannedPostsData, this); }) }, { key: "_hasLikes", get: function get() { var value = !!$q('.like-div, .post__rate'); Object.defineProperty(this, '_hasLikes', { value: value }); return value; } }, { key: "_getPostMsg", value: function _getPostMsg(data) { var _switch = function _switch(val, obj) { return val in obj ? obj[val] : obj['@@default']; }; var comment = data.comment.replace(/