// ==UserScript== // @name Dollchan Extension Tools // @version 24.9.16.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<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){ 'use strict'; var parent = require('../../stable/array/from'); module.exports = parent; },{"../../stable/array/from":381}],2:[function(require,module,exports){ 'use strict'; var parent = require('../../stable/array/iterator'); module.exports = parent; },{"../../stable/array/iterator":382}],3:[function(require,module,exports){ 'use strict'; var parent = require('../../stable/map'); require('../../modules/esnext.map.group-by'); module.exports = parent; },{"../../modules/esnext.map.group-by":324,"../../stable/map":383}],4:[function(require,module,exports){ 'use strict'; var parent = require('../../stable/math/clz32'); module.exports = parent; },{"../../stable/math/clz32":384}],5:[function(require,module,exports){ 'use strict'; var parent = require('../../stable/object/assign'); module.exports = parent; },{"../../stable/object/assign":385}],6:[function(require,module,exports){ 'use strict'; var parent = require('../../stable/object/entries'); module.exports = parent; },{"../../stable/object/entries":386}],7:[function(require,module,exports){ 'use strict'; var parent = require('../../stable/promise'); require('../../modules/esnext.promise.try'); require('../../modules/esnext.promise.with-resolvers'); module.exports = parent; },{"../../modules/esnext.promise.try":339,"../../modules/esnext.promise.with-resolvers":340,"../../stable/promise":387}],8:[function(require,module,exports){ 'use strict'; var parent = require('../../stable/set'); require('../../modules/esnext.set.difference.v2'); require('../../modules/esnext.set.intersection.v2'); require('../../modules/esnext.set.is-disjoint-from.v2'); require('../../modules/esnext.set.is-subset-of.v2'); require('../../modules/esnext.set.is-superset-of.v2'); require('../../modules/esnext.set.symmetric-difference.v2'); require('../../modules/esnext.set.union.v2'); module.exports = parent; },{"../../modules/esnext.set.difference.v2":344,"../../modules/esnext.set.intersection.v2":350,"../../modules/esnext.set.is-disjoint-from.v2":352,"../../modules/esnext.set.is-subset-of.v2":354,"../../modules/esnext.set.is-superset-of.v2":356,"../../modules/esnext.set.symmetric-difference.v2":363,"../../modules/esnext.set.union.v2":365,"../../stable/set":388}],9:[function(require,module,exports){ 'use strict'; var parent = require('../../stable/string/ends-with'); module.exports = parent; },{"../../stable/string/ends-with":389}],10:[function(require,module,exports){ 'use strict'; var parent = require('../../stable/string/includes'); module.exports = parent; },{"../../stable/string/includes":390}],11:[function(require,module,exports){ 'use strict'; var parent = require('../../stable/string/repeat'); module.exports = parent; },{"../../stable/string/repeat":391}],12:[function(require,module,exports){ 'use strict'; var parent = require('../../stable/string/replace-all'); module.exports = parent; },{"../../stable/string/replace-all":392}],13:[function(require,module,exports){ 'use strict'; var parent = require('../../stable/string/starts-with'); module.exports = parent; },{"../../stable/string/starts-with":393}],14:[function(require,module,exports){ 'use strict'; var parent = require('../../stable/symbol'); require('../../modules/esnext.function.metadata'); require('../../modules/esnext.symbol.async-dispose'); require('../../modules/esnext.symbol.dispose'); require('../../modules/esnext.symbol.metadata'); module.exports = parent; },{"../../modules/esnext.function.metadata":316,"../../modules/esnext.symbol.async-dispose":367,"../../modules/esnext.symbol.dispose":369,"../../modules/esnext.symbol.metadata":376,"../../stable/symbol":394}],15:[function(require,module,exports){ 'use strict'; require('../../modules/es.string.iterator'); require('../../modules/es.array.from'); var path = require('../../internals/path'); module.exports = path.Array.from; },{"../../internals/path":190,"../../modules/es.array.from":255,"../../modules/es.string.iterator":292}],16:[function(require,module,exports){ 'use strict'; require('../../modules/es.array.iterator'); require('../../modules/es.object.to-string'); var entryUnbind = require('../../internals/entry-unbind'); module.exports = entryUnbind('Array', 'values'); },{"../../internals/entry-unbind":98,"../../modules/es.array.iterator":256,"../../modules/es.object.to-string":267}],17:[function(require,module,exports){ 'use strict'; require('../../modules/es.array.iterator'); require('../../modules/es.map'); require('../../modules/es.map.group-by'); require('../../modules/es.object.to-string'); require('../../modules/es.string.iterator'); var path = require('../../internals/path'); module.exports = path.Map; },{"../../internals/path":190,"../../modules/es.array.iterator":256,"../../modules/es.map":261,"../../modules/es.map.group-by":260,"../../modules/es.object.to-string":267,"../../modules/es.string.iterator":292}],18:[function(require,module,exports){ 'use strict'; require('../../modules/es.math.clz32'); var path = require('../../internals/path'); module.exports = path.Math.clz32; },{"../../internals/path":190,"../../modules/es.math.clz32":262}],19:[function(require,module,exports){ 'use strict'; require('../../modules/es.object.assign'); var path = require('../../internals/path'); module.exports = path.Object.assign; },{"../../internals/path":190,"../../modules/es.object.assign":264}],20:[function(require,module,exports){ 'use strict'; require('../../modules/es.object.entries'); var path = require('../../internals/path'); module.exports = path.Object.entries; },{"../../internals/path":190,"../../modules/es.object.entries":265}],21:[function(require,module,exports){ 'use strict'; require('../../modules/es.aggregate-error'); require('../../modules/es.array.iterator'); require('../../modules/es.object.to-string'); require('../../modules/es.promise'); require('../../modules/es.promise.all-settled'); require('../../modules/es.promise.any'); require('../../modules/es.promise.with-resolvers'); require('../../modules/es.promise.finally'); require('../../modules/es.string.iterator'); var path = require('../../internals/path'); module.exports = path.Promise; },{"../../internals/path":190,"../../modules/es.aggregate-error":253,"../../modules/es.array.iterator":256,"../../modules/es.object.to-string":267,"../../modules/es.promise":274,"../../modules/es.promise.all-settled":268,"../../modules/es.promise.any":270,"../../modules/es.promise.finally":273,"../../modules/es.promise.with-resolvers":278,"../../modules/es.string.iterator":292}],22:[function(require,module,exports){ 'use strict'; require('../../modules/es.array.iterator'); require('../../modules/es.object.to-string'); require('../../modules/es.set'); require('../../modules/es.set.difference.v2'); require('../../modules/es.set.intersection.v2'); require('../../modules/es.set.is-disjoint-from.v2'); require('../../modules/es.set.is-subset-of.v2'); require('../../modules/es.set.is-superset-of.v2'); require('../../modules/es.set.symmetric-difference.v2'); require('../../modules/es.set.union.v2'); require('../../modules/es.string.iterator'); var path = require('../../internals/path'); module.exports = path.Set; },{"../../internals/path":190,"../../modules/es.array.iterator":256,"../../modules/es.object.to-string":267,"../../modules/es.set":287,"../../modules/es.set.difference.v2":282,"../../modules/es.set.intersection.v2":283,"../../modules/es.set.is-disjoint-from.v2":284,"../../modules/es.set.is-subset-of.v2":285,"../../modules/es.set.is-superset-of.v2":286,"../../modules/es.set.symmetric-difference.v2":288,"../../modules/es.set.union.v2":289,"../../modules/es.string.iterator":292}],23:[function(require,module,exports){ 'use strict'; require('../../modules/es.string.ends-with'); var entryUnbind = require('../../internals/entry-unbind'); module.exports = entryUnbind('String', 'endsWith'); },{"../../internals/entry-unbind":98,"../../modules/es.string.ends-with":290}],24:[function(require,module,exports){ 'use strict'; require('../../modules/es.string.includes'); var entryUnbind = require('../../internals/entry-unbind'); module.exports = entryUnbind('String', 'includes'); },{"../../internals/entry-unbind":98,"../../modules/es.string.includes":291}],25:[function(require,module,exports){ 'use strict'; require('../../modules/es.string.repeat'); var entryUnbind = require('../../internals/entry-unbind'); module.exports = entryUnbind('String', 'repeat'); },{"../../internals/entry-unbind":98,"../../modules/es.string.repeat":293}],26:[function(require,module,exports){ 'use strict'; require('../../modules/es.regexp.exec'); require('../../modules/es.string.replace'); require('../../modules/es.string.replace-all'); var entryUnbind = require('../../internals/entry-unbind'); module.exports = entryUnbind('String', 'replaceAll'); },{"../../internals/entry-unbind":98,"../../modules/es.regexp.exec":280,"../../modules/es.string.replace":295,"../../modules/es.string.replace-all":294}],27:[function(require,module,exports){ 'use strict'; require('../../modules/es.string.starts-with'); var entryUnbind = require('../../internals/entry-unbind'); module.exports = entryUnbind('String', 'startsWith'); },{"../../internals/entry-unbind":98,"../../modules/es.string.starts-with":296}],28:[function(require,module,exports){ 'use strict'; require('../../modules/es.array.concat'); require('../../modules/es.object.to-string'); require('../../modules/es.symbol'); require('../../modules/es.symbol.async-iterator'); require('../../modules/es.symbol.description'); require('../../modules/es.symbol.has-instance'); require('../../modules/es.symbol.is-concat-spreadable'); require('../../modules/es.symbol.iterator'); require('../../modules/es.symbol.match'); require('../../modules/es.symbol.match-all'); require('../../modules/es.symbol.replace'); require('../../modules/es.symbol.search'); require('../../modules/es.symbol.species'); require('../../modules/es.symbol.split'); require('../../modules/es.symbol.to-primitive'); require('../../modules/es.symbol.to-string-tag'); require('../../modules/es.symbol.unscopables'); require('../../modules/es.json.to-string-tag'); require('../../modules/es.math.to-string-tag'); require('../../modules/es.reflect.to-string-tag'); var path = require('../../internals/path'); module.exports = path.Symbol; },{"../../internals/path":190,"../../modules/es.array.concat":254,"../../modules/es.json.to-string-tag":258,"../../modules/es.math.to-string-tag":263,"../../modules/es.object.to-string":267,"../../modules/es.reflect.to-string-tag":279,"../../modules/es.symbol":304,"../../modules/es.symbol.async-iterator":297,"../../modules/es.symbol.description":299,"../../modules/es.symbol.has-instance":301,"../../modules/es.symbol.is-concat-spreadable":302,"../../modules/es.symbol.iterator":303,"../../modules/es.symbol.match":307,"../../modules/es.symbol.match-all":306,"../../modules/es.symbol.replace":308,"../../modules/es.symbol.search":309,"../../modules/es.symbol.species":310,"../../modules/es.symbol.split":311,"../../modules/es.symbol.to-primitive":312,"../../modules/es.symbol.to-string-tag":313,"../../modules/es.symbol.unscopables":314}],29:[function(require,module,exports){ 'use strict'; module.exports = require('../../full/array/from'); },{"../../full/array/from":43}],30:[function(require,module,exports){ 'use strict'; module.exports = require('../../full/array/iterator'); },{"../../full/array/iterator":44}],31:[function(require,module,exports){ 'use strict'; module.exports = require('../../full/map'); },{"../../full/map":45}],32:[function(require,module,exports){ 'use strict'; module.exports = require('../../full/math/clz32'); },{"../../full/math/clz32":46}],33:[function(require,module,exports){ 'use strict'; module.exports = require('../../full/object/assign'); },{"../../full/object/assign":47}],34:[function(require,module,exports){ 'use strict'; module.exports = require('../../full/object/entries'); },{"../../full/object/entries":48}],35:[function(require,module,exports){ 'use strict'; module.exports = require('../../full/promise'); },{"../../full/promise":49}],36:[function(require,module,exports){ 'use strict'; module.exports = require('../../full/set'); },{"../../full/set":50}],37:[function(require,module,exports){ 'use strict'; module.exports = require('../../full/string/ends-with'); },{"../../full/string/ends-with":51}],38:[function(require,module,exports){ 'use strict'; module.exports = require('../../full/string/includes'); },{"../../full/string/includes":52}],39:[function(require,module,exports){ 'use strict'; module.exports = require('../../full/string/repeat'); },{"../../full/string/repeat":53}],40:[function(require,module,exports){ 'use strict'; module.exports = require('../../full/string/replace-all'); },{"../../full/string/replace-all":54}],41:[function(require,module,exports){ 'use strict'; module.exports = require('../../full/string/starts-with'); },{"../../full/string/starts-with":55}],42:[function(require,module,exports){ 'use strict'; module.exports = require('../../full/symbol'); },{"../../full/symbol":56}],43:[function(require,module,exports){ 'use strict'; var parent = require('../../actual/array/from'); module.exports = parent; },{"../../actual/array/from":1}],44:[function(require,module,exports){ 'use strict'; var parent = require('../../actual/array/iterator'); module.exports = parent; },{"../../actual/array/iterator":2}],45:[function(require,module,exports){ 'use strict'; var parent = require('../../actual/map'); require('../../modules/esnext.map.from'); require('../../modules/esnext.map.of'); require('../../modules/esnext.map.delete-all'); require('../../modules/esnext.map.emplace'); require('../../modules/esnext.map.every'); require('../../modules/esnext.map.filter'); require('../../modules/esnext.map.find'); require('../../modules/esnext.map.find-key'); require('../../modules/esnext.map.includes'); require('../../modules/esnext.map.key-by'); require('../../modules/esnext.map.key-of'); require('../../modules/esnext.map.map-keys'); require('../../modules/esnext.map.map-values'); require('../../modules/esnext.map.merge'); require('../../modules/esnext.map.reduce'); require('../../modules/esnext.map.some'); require('../../modules/esnext.map.update'); require('../../modules/esnext.map.upsert'); require('../../modules/esnext.map.update-or-insert'); module.exports = parent; },{"../../actual/map":3,"../../modules/esnext.map.delete-all":317,"../../modules/esnext.map.emplace":318,"../../modules/esnext.map.every":319,"../../modules/esnext.map.filter":320,"../../modules/esnext.map.find":322,"../../modules/esnext.map.find-key":321,"../../modules/esnext.map.from":323,"../../modules/esnext.map.includes":325,"../../modules/esnext.map.key-by":326,"../../modules/esnext.map.key-of":327,"../../modules/esnext.map.map-keys":328,"../../modules/esnext.map.map-values":329,"../../modules/esnext.map.merge":330,"../../modules/esnext.map.of":331,"../../modules/esnext.map.reduce":332,"../../modules/esnext.map.some":333,"../../modules/esnext.map.update":335,"../../modules/esnext.map.update-or-insert":334,"../../modules/esnext.map.upsert":336}],46:[function(require,module,exports){ 'use strict'; var parent = require('../../actual/math/clz32'); module.exports = parent; },{"../../actual/math/clz32":4}],47:[function(require,module,exports){ 'use strict'; var parent = require('../../actual/object/assign'); module.exports = parent; },{"../../actual/object/assign":5}],48:[function(require,module,exports){ 'use strict'; var parent = require('../../actual/object/entries'); module.exports = parent; },{"../../actual/object/entries":6}],49:[function(require,module,exports){ 'use strict'; var parent = require('../../actual/promise'); require('../../modules/esnext.aggregate-error'); require('../../modules/esnext.promise.all-settled'); require('../../modules/esnext.promise.any'); module.exports = parent; },{"../../actual/promise":7,"../../modules/esnext.aggregate-error":315,"../../modules/esnext.promise.all-settled":337,"../../modules/esnext.promise.any":338}],50:[function(require,module,exports){ 'use strict'; var parent = require('../../actual/set'); require('../../modules/esnext.set.from'); require('../../modules/esnext.set.of'); require('../../modules/esnext.set.add-all'); require('../../modules/esnext.set.delete-all'); require('../../modules/esnext.set.every'); require('../../modules/esnext.set.difference'); require('../../modules/esnext.set.filter'); require('../../modules/esnext.set.find'); require('../../modules/esnext.set.intersection'); require('../../modules/esnext.set.is-disjoint-from'); require('../../modules/esnext.set.is-subset-of'); require('../../modules/esnext.set.is-superset-of'); require('../../modules/esnext.set.join'); require('../../modules/esnext.set.map'); require('../../modules/esnext.set.reduce'); require('../../modules/esnext.set.some'); require('../../modules/esnext.set.symmetric-difference'); require('../../modules/esnext.set.union'); module.exports = parent; },{"../../actual/set":8,"../../modules/esnext.set.add-all":341,"../../modules/esnext.set.delete-all":342,"../../modules/esnext.set.difference":343,"../../modules/esnext.set.every":345,"../../modules/esnext.set.filter":346,"../../modules/esnext.set.find":347,"../../modules/esnext.set.from":348,"../../modules/esnext.set.intersection":349,"../../modules/esnext.set.is-disjoint-from":351,"../../modules/esnext.set.is-subset-of":353,"../../modules/esnext.set.is-superset-of":355,"../../modules/esnext.set.join":357,"../../modules/esnext.set.map":358,"../../modules/esnext.set.of":359,"../../modules/esnext.set.reduce":360,"../../modules/esnext.set.some":361,"../../modules/esnext.set.symmetric-difference":362,"../../modules/esnext.set.union":364}],51:[function(require,module,exports){ 'use strict'; var parent = require('../../actual/string/ends-with'); module.exports = parent; },{"../../actual/string/ends-with":9}],52:[function(require,module,exports){ 'use strict'; var parent = require('../../actual/string/includes'); module.exports = parent; },{"../../actual/string/includes":10}],53:[function(require,module,exports){ 'use strict'; var parent = require('../../actual/string/repeat'); module.exports = parent; },{"../../actual/string/repeat":11}],54:[function(require,module,exports){ 'use strict'; require('../../modules/esnext.string.replace-all'); var parent = require('../../actual/string/replace-all'); module.exports = parent; },{"../../actual/string/replace-all":12,"../../modules/esnext.string.replace-all":366}],55:[function(require,module,exports){ 'use strict'; var parent = require('../../actual/string/starts-with'); module.exports = parent; },{"../../actual/string/starts-with":13}],56:[function(require,module,exports){ 'use strict'; var parent = require('../../actual/symbol'); require('../../modules/esnext.symbol.is-registered-symbol'); require('../../modules/esnext.symbol.is-well-known-symbol'); require('../../modules/esnext.symbol.custom-matcher'); require('../../modules/esnext.symbol.observable'); require('../../modules/esnext.symbol.is-registered'); require('../../modules/esnext.symbol.is-well-known'); require('../../modules/esnext.symbol.matcher'); require('../../modules/esnext.symbol.metadata-key'); require('../../modules/esnext.symbol.pattern-match'); require('../../modules/esnext.symbol.replace-all'); module.exports = parent; },{"../../actual/symbol":14,"../../modules/esnext.symbol.custom-matcher":368,"../../modules/esnext.symbol.is-registered":371,"../../modules/esnext.symbol.is-registered-symbol":370,"../../modules/esnext.symbol.is-well-known":373,"../../modules/esnext.symbol.is-well-known-symbol":372,"../../modules/esnext.symbol.matcher":374,"../../modules/esnext.symbol.metadata-key":375,"../../modules/esnext.symbol.observable":377,"../../modules/esnext.symbol.pattern-match":378,"../../modules/esnext.symbol.replace-all":379}],57:[function(require,module,exports){ 'use strict'; var isCallable = require('../internals/is-callable'); var tryToString = require('../internals/try-to-string'); var $TypeError = TypeError; module.exports = function (argument) { if (isCallable(argument)) return argument; throw new $TypeError(tryToString(argument) + ' is not a function'); }; },{"../internals/is-callable":144,"../internals/try-to-string":243}],58:[function(require,module,exports){ 'use strict'; var isConstructor = require('../internals/is-constructor'); var tryToString = require('../internals/try-to-string'); var $TypeError = TypeError; module.exports = function (argument) { if (isConstructor(argument)) return argument; throw new $TypeError(tryToString(argument) + ' is not a constructor'); }; },{"../internals/is-constructor":145,"../internals/try-to-string":243}],59:[function(require,module,exports){ 'use strict'; var has = require('../internals/map-helpers').has; module.exports = function (it) { has(it); return it; }; },{"../internals/map-helpers":163}],60:[function(require,module,exports){ 'use strict'; var isPossiblePrototype = require('../internals/is-possible-prototype'); var $String = String; var $TypeError = TypeError; module.exports = function (argument) { if (isPossiblePrototype(argument)) return argument; throw new $TypeError("Can't set " + $String(argument) + ' as a prototype'); }; },{"../internals/is-possible-prototype":150}],61:[function(require,module,exports){ 'use strict'; var has = require('../internals/set-helpers').has; module.exports = function (it) { has(it); return it; }; },{"../internals/set-helpers":209}],62:[function(require,module,exports){ 'use strict'; var wellKnownSymbol = require('../internals/well-known-symbol'); var create = require('../internals/object-create'); var defineProperty = require('../internals/object-define-property').f; var UNSCOPABLES = wellKnownSymbol('unscopables'); var ArrayPrototype = Array.prototype; if (ArrayPrototype[UNSCOPABLES] === undefined) { defineProperty(ArrayPrototype, UNSCOPABLES, { configurable: true, value: create(null) }); } module.exports = function (key) { ArrayPrototype[UNSCOPABLES][key] = true; }; },{"../internals/object-create":172,"../internals/object-define-property":174,"../internals/well-known-symbol":251}],63:[function(require,module,exports){ 'use strict'; var charAt = require('../internals/string-multibyte').charAt; module.exports = function (S, index, unicode) { return index + (unicode ? charAt(S, index).length : 1); }; },{"../internals/string-multibyte":225}],64:[function(require,module,exports){ 'use strict'; var isPrototypeOf = require('../internals/object-is-prototype-of'); var $TypeError = TypeError; module.exports = function (it, Prototype) { if (isPrototypeOf(Prototype, it)) return it; throw new $TypeError('Incorrect invocation'); }; },{"../internals/object-is-prototype-of":181}],65:[function(require,module,exports){ 'use strict'; var isObject = require('../internals/is-object'); var $String = String; var $TypeError = TypeError; module.exports = function (argument) { if (isObject(argument)) return argument; throw new $TypeError($String(argument) + ' is not an object'); }; },{"../internals/is-object":149}],66:[function(require,module,exports){ 'use strict'; var fails = require('../internals/fails'); module.exports = fails(function () { if (typeof ArrayBuffer == 'function') { var buffer = new ArrayBuffer(8); if (Object.isExtensible(buffer)) Object.defineProperty(buffer, 'a', { value: 8 }); } }); },{"../internals/fails":111}],67:[function(require,module,exports){ 'use strict'; var bind = require('../internals/function-bind-context'); var call = require('../internals/function-call'); var toObject = require('../internals/to-object'); var callWithSafeIterationClosing = require('../internals/call-with-safe-iteration-closing'); var isArrayIteratorMethod = require('../internals/is-array-iterator-method'); var isConstructor = require('../internals/is-constructor'); var lengthOfArrayLike = require('../internals/length-of-array-like'); var createProperty = require('../internals/create-property'); var getIterator = require('../internals/get-iterator'); var getIteratorMethod = require('../internals/get-iterator-method'); var $Array = Array; module.exports = function from(arrayLike ) { var O = toObject(arrayLike); var IS_CONSTRUCTOR = isConstructor(this); var argumentsLength = arguments.length; var mapfn = argumentsLength > 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))) { result = IS_CONSTRUCTOR ? new this() : []; iterator = getIterator(O, iteratorMethod); next = iterator.next; 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":74,"../internals/create-property":88,"../internals/function-bind-context":115,"../internals/function-call":117,"../internals/get-iterator":125,"../internals/get-iterator-method":124,"../internals/is-array-iterator-method":142,"../internals/is-constructor":145,"../internals/length-of-array-like":161,"../internals/to-object":237}],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); if (length === 0) return !IS_INCLUDES && -1; 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":161,"../internals/to-absolute-index":233,"../internals/to-indexed-object":234}],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 length = lengthOfArrayLike(self); var boundFunction = bind(callbackfn, that); 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":73,"../internals/function-bind-context":115,"../internals/function-uncurry-this":121,"../internals/indexed-object":136,"../internals/length-of-array-like":161,"../internals/to-object":237}],70:[function(require,module,exports){ 'use strict'; var fails = require('../internals/fails'); var wellKnownSymbol = require('../internals/well-known-symbol'); var V8_VERSION = require('../internals/environment-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/environment-v8-version":105,"../internals/fails":111,"../internals/well-known-symbol":251}],71:[function(require,module,exports){ 'use strict'; var uncurryThis = require('../internals/function-uncurry-this'); module.exports = uncurryThis([].slice); },{"../internals/function-uncurry-this":121}],72:[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":143,"../internals/is-constructor":145,"../internals/is-object":149,"../internals/well-known-symbol":251}],73:[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":72}],74:[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":156}],75:[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":251}],76:[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":121}],77:[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":76,"../internals/is-callable":144,"../internals/to-string-tag-support":241,"../internals/well-known-symbol":251}],78:[function(require,module,exports){ 'use strict'; var bind = require('../internals/function-bind-context'); var anObject = require('../internals/an-object'); var toObject = require('../internals/to-object'); var iterate = require('../internals/iterate'); module.exports = function (C, adder, ENTRY) { return function from(source ) { var O = toObject(source); var length = arguments.length; var mapFn = length > 1 ? arguments[1] : undefined; var mapping = mapFn !== undefined; var boundFunction = mapping ? bind(mapFn, length > 2 ? arguments[2] : undefined) : undefined; var result = new C(); var n = 0; iterate(O, function (nextItem) { var entry = mapping ? boundFunction(nextItem, n++) : nextItem; if (ENTRY) adder(result, anObject(entry)[0], entry[1]); else adder(result, entry); }); return result; }; }; },{"../internals/an-object":65,"../internals/function-bind-context":115,"../internals/iterate":155,"../internals/to-object":237}],79:[function(require,module,exports){ 'use strict'; var anObject = require('../internals/an-object'); module.exports = function (C, adder, ENTRY) { return function of() { var result = new C(); var length = arguments.length; for (var index = 0; index < length; index++) { var entry = arguments[index]; if (ENTRY) adder(result, anObject(entry)[0], entry[1]); else adder(result, entry); } return result; }; }; },{"../internals/an-object":65}],80:[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: null, last: null, 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: null, 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 entry = state.first; while (entry) { entry.removed = true; if (entry.previous) entry.previous = entry.previous.next = null; entry = entry.next; } state.first = state.last = null; state.index = create(null); 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: null }); }, 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 = null; 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":85,"../internals/define-built-in-accessor":89,"../internals/define-built-ins":91,"../internals/descriptors":93,"../internals/function-bind-context":115,"../internals/internal-metadata":140,"../internals/internal-state":141,"../internals/is-null-or-undefined":148,"../internals/iterate":155,"../internals/iterator-define":158,"../internals/object-create":172,"../internals/set-species":217}],81:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var globalThis = require('../internals/global-this'); 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 = globalThis[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":75,"../internals/define-built-in":90,"../internals/export":110,"../internals/fails":111,"../internals/function-uncurry-this":121,"../internals/global-this":130,"../internals/inherit-if-required":137,"../internals/internal-metadata":140,"../internals/is-callable":144,"../internals/is-forced":146,"../internals/is-null-or-undefined":148,"../internals/is-object":149,"../internals/iterate":155,"../internals/set-to-string-tag":219}],82:[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":131,"../internals/object-define-property":174,"../internals/object-get-own-property-descriptor":175,"../internals/own-keys":189}],83:[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":251}],84:[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":111}],85:[function(require,module,exports){ 'use strict'; module.exports = function (value, done) { return { value: value, done: done }; }; },{}],86:[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":87,"../internals/descriptors":93,"../internals/object-define-property":174}],87:[function(require,module,exports){ 'use strict'; module.exports = function (bitmap, value) { return { enumerable: !(bitmap & 1), configurable: !(bitmap & 2), writable: !(bitmap & 4), value: value }; }; },{}],88:[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 = function (object, key, value) { if (DESCRIPTORS) definePropertyModule.f(object, key, createPropertyDescriptor(0, value)); else object[key] = value; }; },{"../internals/create-property-descriptor":87,"../internals/descriptors":93,"../internals/object-define-property":174}],89:[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":162,"../internals/object-define-property":174}],90:[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":92,"../internals/is-callable":144,"../internals/make-built-in":162,"../internals/object-define-property":174}],91:[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":90}],92:[function(require,module,exports){ 'use strict'; var globalThis = require('../internals/global-this'); var defineProperty = Object.defineProperty; module.exports = function (key, value) { try { defineProperty(globalThis, key, { value: value, configurable: true, writable: true }); } catch (error) { globalThis[key] = value; } return value; }; },{"../internals/global-this":130}],93:[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":111}],94:[function(require,module,exports){ 'use strict'; var globalThis = require('../internals/global-this'); var isObject = require('../internals/is-object'); var document = globalThis.document; var EXISTS = isObject(document) && isObject(document.createElement); module.exports = function (it) { return EXISTS ? document.createElement(it) : {}; }; },{"../internals/global-this":130,"../internals/is-object":149}],95:[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; }; },{}],96:[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 }; },{}],97:[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":94}],98:[function(require,module,exports){ 'use strict'; var globalThis = require('../internals/global-this'); var uncurryThis = require('../internals/function-uncurry-this'); module.exports = function (CONSTRUCTOR, METHOD) { return uncurryThis(globalThis[CONSTRUCTOR].prototype[METHOD]); }; },{"../internals/function-uncurry-this":121,"../internals/global-this":130}],99:[function(require,module,exports){ 'use strict'; module.exports = [ 'constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf' ]; },{}],100:[function(require,module,exports){ 'use strict'; var userAgent = require('../internals/environment-user-agent'); module.exports = /ipad|iphone|ipod/i.test(userAgent) && typeof Pebble != 'undefined'; },{"../internals/environment-user-agent":104}],101:[function(require,module,exports){ 'use strict'; var userAgent = require('../internals/environment-user-agent'); module.exports = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent); },{"../internals/environment-user-agent":104}],102:[function(require,module,exports){ 'use strict'; var ENVIRONMENT = require('../internals/environment'); module.exports = ENVIRONMENT === 'NODE'; },{"../internals/environment":106}],103:[function(require,module,exports){ 'use strict'; var userAgent = require('../internals/environment-user-agent'); module.exports = /web0s(?!.*chrome)/i.test(userAgent); },{"../internals/environment-user-agent":104}],104:[function(require,module,exports){ 'use strict'; var globalThis = require('../internals/global-this'); var navigator = globalThis.navigator; var userAgent = navigator && navigator.userAgent; module.exports = userAgent ? String(userAgent) : ''; },{"../internals/global-this":130}],105:[function(require,module,exports){ 'use strict'; var globalThis = require('../internals/global-this'); var userAgent = require('../internals/environment-user-agent'); var process = globalThis.process; var Deno = globalThis.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/environment-user-agent":104,"../internals/global-this":130}],106:[function(require,module,exports){ 'use strict'; var globalThis = require('../internals/global-this'); var userAgent = require('../internals/environment-user-agent'); var classof = require('../internals/classof-raw'); var userAgentStartsWith = function (string) { return userAgent.slice(0, string.length) === string; }; module.exports = (function () { if (userAgentStartsWith('Bun/')) return 'BUN'; if (userAgentStartsWith('Cloudflare-Workers')) return 'CLOUDFLARE'; if (userAgentStartsWith('Deno/')) return 'DENO'; if (userAgentStartsWith('Node.js/')) return 'NODE'; if (globalThis.Bun && typeof Bun.version == 'string') return 'BUN'; if (globalThis.Deno && typeof Deno.version == 'object') return 'DENO'; if (classof(globalThis.process) === 'process') return 'NODE'; if (globalThis.window && globalThis.document) return 'BROWSER'; return 'REST'; })(); },{"../internals/classof-raw":76,"../internals/environment-user-agent":104,"../internals/global-this":130}],107:[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":121}],108:[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":86,"../internals/error-stack-clear":107,"../internals/error-stack-installable":109}],109:[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":87,"../internals/fails":111}],110:[function(require,module,exports){ 'use strict'; var globalThis = require('../internals/global-this'); 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 = globalThis; } else if (STATIC) { target = globalThis[TARGET] || defineGlobalProperty(TARGET, {}); } else { target = globalThis[TARGET] && globalThis[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":82,"../internals/create-non-enumerable-property":86,"../internals/define-built-in":90,"../internals/define-global-property":92,"../internals/global-this":130,"../internals/is-forced":146,"../internals/object-get-own-property-descriptor":175}],111:[function(require,module,exports){ 'use strict'; module.exports = function (exec) { try { return !!exec(); } catch (error) { return true; } }; },{}],112:[function(require,module,exports){ 'use strict'; require('../modules/es.regexp.exec'); var call = require('../internals/function-call'); 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 nativeRegExpMethod = /./[SYMBOL]; var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) { var $exec = regexp.exec; if ($exec === regexpExec || $exec === RegExpPrototype.exec) { if (DELEGATES_TO_SYMBOL && !forceStringMethod) { return { done: true, value: call(nativeRegExpMethod, regexp, str, arg2) }; } return { done: true, value: call(nativeMethod, 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":86,"../internals/define-built-in":90,"../internals/fails":111,"../internals/function-call":117,"../internals/regexp-exec":198,"../internals/well-known-symbol":251,"../modules/es.regexp.exec":280}],113:[function(require,module,exports){ 'use strict'; var fails = require('../internals/fails'); module.exports = !fails(function () { return Object.isExtensible(Object.preventExtensions({})); }); },{"../internals/fails":111}],114:[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":116}],115:[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":116,"../internals/function-uncurry-this-clause":120}],116:[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":111}],117:[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":116}],118:[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":93,"../internals/has-own-property":131}],119:[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":121}],120:[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":76,"../internals/function-uncurry-this":121}],121:[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":116}],122:[function(require,module,exports){ 'use strict'; var globalThis = require('../internals/global-this'); 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(globalThis[namespace]) : globalThis[namespace] && globalThis[namespace][method]; }; },{"../internals/global-this":130,"../internals/is-callable":144}],123:[function(require,module,exports){ 'use strict'; module.exports = function (obj) { return { iterator: obj, next: obj.next, done: false }; }; },{}],124:[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":77,"../internals/get-method":127,"../internals/is-null-or-undefined":148,"../internals/iterators":160,"../internals/well-known-symbol":251}],125:[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":117,"../internals/get-iterator-method":124,"../internals/try-to-string":243}],126:[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":76,"../internals/function-uncurry-this":121,"../internals/is-array":143,"../internals/is-callable":144,"../internals/to-string":242}],127:[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":148}],128:[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, intSize) { this.set = set; this.size = max(intSize, 0); this.has = aCallable(set.has); this.keys = aCallable(set.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, intSize); }; },{"../internals/a-callable":57,"../internals/an-object":65,"../internals/function-call":117,"../internals/get-iterator-direct":123,"../internals/to-integer-or-infinity":235}],129:[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":121,"../internals/to-object":237}],130:[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) || check(typeof this == 'object' && this) || (function () { return this; })() || Function('return this')(); }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{}],131:[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":121,"../internals/to-object":237}],132:[function(require,module,exports){ 'use strict'; module.exports = {}; },{}],133:[function(require,module,exports){ 'use strict'; module.exports = function (a, b) { try { arguments.length === 1 ? console.error(a) : console.error(a, b); } catch (error) { } }; },{}],134:[function(require,module,exports){ 'use strict'; var getBuiltIn = require('../internals/get-built-in'); module.exports = getBuiltIn('document', 'documentElement'); },{"../internals/get-built-in":122}],135:[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":93,"../internals/document-create-element":94,"../internals/fails":111}],136:[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":76,"../internals/fails":111,"../internals/function-uncurry-this":121}],137:[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":144,"../internals/is-object":149,"../internals/object-set-prototype-of":185}],138:[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":121,"../internals/is-callable":144,"../internals/shared-store":222}],139:[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":86,"../internals/is-object":149}],140:[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":110,"../internals/freezing":113,"../internals/function-uncurry-this":121,"../internals/has-own-property":131,"../internals/hidden-keys":132,"../internals/is-object":149,"../internals/object-define-property":174,"../internals/object-get-own-property-names":177,"../internals/object-get-own-property-names-external":176,"../internals/object-is-extensible":180,"../internals/uid":244}],141:[function(require,module,exports){ 'use strict'; var NATIVE_WEAK_MAP = require('../internals/weak-map-basic-detection'); var globalThis = require('../internals/global-this'); 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 = globalThis.TypeError; var WeakMap = globalThis.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":86,"../internals/global-this":130,"../internals/has-own-property":131,"../internals/hidden-keys":132,"../internals/is-object":149,"../internals/shared-key":221,"../internals/shared-store":222,"../internals/weak-map-basic-detection":248}],142:[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":160,"../internals/well-known-symbol":251}],143:[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":76}],144:[function(require,module,exports){ 'use strict'; var documentAll = typeof document == 'object' && document.all; module.exports = typeof documentAll == 'undefined' && documentAll !== undefined ? function (argument) { return typeof argument == 'function' || argument === documentAll; } : function (argument) { return typeof argument == 'function'; }; },{}],145:[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 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, [], 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":77,"../internals/fails":111,"../internals/function-uncurry-this":121,"../internals/get-built-in":122,"../internals/inspect-source":138,"../internals/is-callable":144}],146:[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":111,"../internals/is-callable":144}],147:[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":77,"../internals/has-own-property":131,"../internals/is-null-or-undefined":148,"../internals/iterators":160,"../internals/well-known-symbol":251}],148:[function(require,module,exports){ 'use strict'; module.exports = function (it) { return it === null || it === undefined; }; },{}],149:[function(require,module,exports){ 'use strict'; var isCallable = require('../internals/is-callable'); module.exports = function (it) { return typeof it == 'object' ? it !== null : isCallable(it); }; },{"../internals/is-callable":144}],150:[function(require,module,exports){ 'use strict'; var isObject = require('../internals/is-object'); module.exports = function (argument) { return isObject(argument) || argument === null; }; },{"../internals/is-object":149}],151:[function(require,module,exports){ 'use strict'; module.exports = false; },{}],152:[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":76,"../internals/is-object":149,"../internals/well-known-symbol":251}],153:[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":122,"../internals/is-callable":144,"../internals/object-is-prototype-of":181,"../internals/use-symbol-as-uid":245}],154:[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":117}],155:[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":115,"../internals/function-call":117,"../internals/get-iterator":125,"../internals/get-iterator-method":124,"../internals/is-array-iterator-method":142,"../internals/iterator-close":156,"../internals/length-of-array-like":161,"../internals/object-is-prototype-of":181,"../internals/try-to-string":243}],156:[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":117,"../internals/get-method":127}],157:[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":87,"../internals/iterators":160,"../internals/iterators-core":159,"../internals/object-create":172,"../internals/set-to-string-tag":219}],158:[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":86,"../internals/define-built-in":90,"../internals/export":110,"../internals/function-call":117,"../internals/function-name":118,"../internals/is-callable":144,"../internals/is-pure":151,"../internals/iterator-create-constructor":157,"../internals/iterators":160,"../internals/iterators-core":159,"../internals/object-get-prototype-of":179,"../internals/object-set-prototype-of":185,"../internals/set-to-string-tag":219,"../internals/well-known-symbol":251}],159:[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":90,"../internals/fails":111,"../internals/is-callable":144,"../internals/is-object":149,"../internals/is-pure":151,"../internals/object-create":172,"../internals/object-get-prototype-of":179,"../internals/well-known-symbol":251}],160:[function(require,module,exports){ arguments[4][132][0].apply(exports,arguments) },{"dup":132}],161:[function(require,module,exports){ 'use strict'; var toLength = require('../internals/to-length'); module.exports = function (obj) { return toLength(obj.length); }; },{"../internals/to-length":236}],162:[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":93,"../internals/fails":111,"../internals/function-name":118,"../internals/function-uncurry-this":121,"../internals/has-own-property":131,"../internals/inspect-source":138,"../internals/internal-state":141,"../internals/is-callable":144}],163:[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":121}],164:[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":121,"../internals/iterate-simple":154,"../internals/map-helpers":163}],165:[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":117,"../internals/is-callable":144}],166:[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); }; },{}],167:[function(require,module,exports){ 'use strict'; var globalThis = require('../internals/global-this'); var safeGetBuiltIn = require('../internals/safe-get-built-in'); var bind = require('../internals/function-bind-context'); var macrotask = require('../internals/task').set; var Queue = require('../internals/queue'); var IS_IOS = require('../internals/environment-is-ios'); var IS_IOS_PEBBLE = require('../internals/environment-is-ios-pebble'); var IS_WEBOS_WEBKIT = require('../internals/environment-is-webos-webkit'); var IS_NODE = require('../internals/environment-is-node'); var MutationObserver = globalThis.MutationObserver || globalThis.WebKitMutationObserver; var document = globalThis.document; var process = globalThis.process; var Promise = globalThis.Promise; var microtask = safeGetBuiltIn('queueMicrotask'); 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, globalThis); notify = function () { macrotask(flush); }; } microtask = function (fn) { if (!queue.head) notify(); queue.add(fn); }; } module.exports = microtask; },{"../internals/environment-is-ios":101,"../internals/environment-is-ios-pebble":100,"../internals/environment-is-node":102,"../internals/environment-is-webos-webkit":103,"../internals/function-bind-context":115,"../internals/global-this":130,"../internals/queue":196,"../internals/safe-get-built-in":205,"../internals/task":232}],168:[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}],169:[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":242}],170:[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":152}],171:[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":93,"../internals/fails":111,"../internals/function-call":117,"../internals/function-uncurry-this":121,"../internals/indexed-object":136,"../internals/object-get-own-property-symbols":178,"../internals/object-keys":183,"../internals/object-property-is-enumerable":184,"../internals/to-object":237}],172:[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":94,"../internals/enum-bug-keys":99,"../internals/hidden-keys":132,"../internals/html":134,"../internals/object-define-properties":173,"../internals/shared-key":221}],173:[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":93,"../internals/object-define-property":174,"../internals/object-keys":183,"../internals/to-indexed-object":234,"../internals/v8-prototype-define-bug":246}],174:[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":93,"../internals/ie8-dom-define":135,"../internals/to-property-key":239,"../internals/v8-prototype-define-bug":246}],175:[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":87,"../internals/descriptors":93,"../internals/function-call":117,"../internals/has-own-property":131,"../internals/ie8-dom-define":135,"../internals/object-property-is-enumerable":184,"../internals/to-indexed-object":234,"../internals/to-property-key":239}],176:[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'); 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":71,"../internals/classof-raw":76,"../internals/object-get-own-property-names":177,"../internals/to-indexed-object":234}],177:[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":99,"../internals/object-keys-internal":182}],178:[function(require,module,exports){ 'use strict'; exports.f = Object.getOwnPropertySymbols; },{}],179:[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":84,"../internals/has-own-property":131,"../internals/is-callable":144,"../internals/shared-key":221,"../internals/to-object":237}],180:[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":76,"../internals/fails":111,"../internals/is-object":149}],181:[function(require,module,exports){ 'use strict'; var uncurryThis = require('../internals/function-uncurry-this'); module.exports = uncurryThis({}.isPrototypeOf); },{"../internals/function-uncurry-this":121}],182:[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":121,"../internals/has-own-property":131,"../internals/hidden-keys":132,"../internals/to-indexed-object":234}],183:[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":99,"../internals/object-keys-internal":182}],184:[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; },{}],185:[function(require,module,exports){ 'use strict'; var uncurryThisAccessor = require('../internals/function-uncurry-this-accessor'); var isObject = require('../internals/is-object'); var requireObjectCoercible = require('../internals/require-object-coercible'); 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) { requireObjectCoercible(O); aPossiblePrototype(proto); if (!isObject(O)) return O; if (CORRECT_SETTER) setter(O, proto); else O.__proto__ = proto; return O; }; }() : undefined); },{"../internals/a-possible-prototype":60,"../internals/function-uncurry-this-accessor":119,"../internals/is-object":149,"../internals/require-object-coercible":204}],186:[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":93,"../internals/fails":111,"../internals/function-uncurry-this":121,"../internals/object-get-prototype-of":179,"../internals/object-keys":183,"../internals/object-property-is-enumerable":184,"../internals/to-indexed-object":234}],187:[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":77,"../internals/to-string-tag-support":241}],188:[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":117,"../internals/is-callable":144,"../internals/is-object":149}],189:[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":121,"../internals/get-built-in":122,"../internals/object-get-own-property-names":177,"../internals/object-get-own-property-symbols":178}],190:[function(require,module,exports){ 'use strict'; var globalThis = require('../internals/global-this'); module.exports = globalThis; },{"../internals/global-this":130}],191:[function(require,module,exports){ 'use strict'; module.exports = function (exec) { try { return { error: false, value: exec() }; } catch (error) { return { error: true, value: error }; } }; },{}],192:[function(require,module,exports){ 'use strict'; var globalThis = require('../internals/global-this'); 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 ENVIRONMENT = require('../internals/environment'); var IS_PURE = require('../internals/is-pure'); var V8_VERSION = require('../internals/environment-v8-version'); var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype; var SPECIES = wellKnownSymbol('species'); var SUBCLASSING = false; var NATIVE_PROMISE_REJECTION_EVENT = isCallable(globalThis.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 && (ENVIRONMENT === 'BROWSER' || ENVIRONMENT === 'DENO') && !NATIVE_PROMISE_REJECTION_EVENT; }); module.exports = { CONSTRUCTOR: FORCED_PROMISE_CONSTRUCTOR, REJECTION_EVENT: NATIVE_PROMISE_REJECTION_EVENT, SUBCLASSING: SUBCLASSING }; },{"../internals/environment":106,"../internals/environment-v8-version":105,"../internals/global-this":130,"../internals/inspect-source":138,"../internals/is-callable":144,"../internals/is-forced":146,"../internals/is-pure":151,"../internals/promise-native-constructor":193,"../internals/well-known-symbol":251}],193:[function(require,module,exports){ 'use strict'; var globalThis = require('../internals/global-this'); module.exports = globalThis.Promise; },{"../internals/global-this":130}],194:[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":149,"../internals/new-promise-capability":168}],195:[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":75,"../internals/promise-constructor-detection":192,"../internals/promise-native-constructor":193}],196:[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; },{}],197:[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":76,"../internals/function-call":117,"../internals/is-callable":144,"../internals/regexp-exec":198}],198:[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":117,"../internals/function-uncurry-this":121,"../internals/internal-state":141,"../internals/object-create":172,"../internals/regexp-flags":199,"../internals/regexp-sticky-helpers":201,"../internals/regexp-unsupported-dot-all":202,"../internals/regexp-unsupported-ncg":203,"../internals/shared":223,"../internals/to-string":242}],199:[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}],200:[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":117,"../internals/has-own-property":131,"../internals/object-is-prototype-of":181,"../internals/regexp-flags":199}],201:[function(require,module,exports){ 'use strict'; var fails = require('../internals/fails'); var globalThis = require('../internals/global-this'); var $RegExp = globalThis.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":111,"../internals/global-this":130}],202:[function(require,module,exports){ 'use strict'; var fails = require('../internals/fails'); var globalThis = require('../internals/global-this'); var $RegExp = globalThis.RegExp; module.exports = fails(function () { var re = $RegExp('.', 's'); return !(re.dotAll && re.test('\n') && re.flags === 's'); }); },{"../internals/fails":111,"../internals/global-this":130}],203:[function(require,module,exports){ 'use strict'; var fails = require('../internals/fails'); var globalThis = require('../internals/global-this'); var $RegExp = globalThis.RegExp; module.exports = fails(function () { var re = $RegExp('(?<a>b)', 'g'); return re.exec('b').groups.a !== 'b' || 'b'.replace(re, '$<a>c') !== 'bc'; }); },{"../internals/fails":111,"../internals/global-this":130}],204:[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":148}],205:[function(require,module,exports){ 'use strict'; var globalThis = require('../internals/global-this'); var DESCRIPTORS = require('../internals/descriptors'); var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; module.exports = function (name) { if (!DESCRIPTORS) return globalThis[name]; var descriptor = getOwnPropertyDescriptor(globalThis, name); return descriptor && descriptor.value; }; },{"../internals/descriptors":93,"../internals/global-this":130}],206:[function(require,module,exports){ 'use strict'; module.exports = function (x, y) { return x === y || x !== x && y !== y; }; },{}],207:[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":209,"../internals/set-iterate":214}],208:[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":128,"../internals/iterate-simple":154,"../internals/set-clone":207,"../internals/set-helpers":209,"../internals/set-iterate":214,"../internals/set-size":216}],209:[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":121}],210:[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":128,"../internals/iterate-simple":154,"../internals/set-helpers":209,"../internals/set-iterate":214,"../internals/set-size":216}],211:[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":128,"../internals/iterate-simple":154,"../internals/iterator-close":156,"../internals/set-helpers":209,"../internals/set-iterate":214,"../internals/set-size":216}],212:[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":128,"../internals/set-iterate":214,"../internals/set-size":216}],213:[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":128,"../internals/iterate-simple":154,"../internals/iterator-close":156,"../internals/set-helpers":209,"../internals/set-size":216}],214:[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":121,"../internals/iterate-simple":154,"../internals/set-helpers":209}],215:[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":122}],216:[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":119,"../internals/set-helpers":209}],217:[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":89,"../internals/descriptors":93,"../internals/get-built-in":122,"../internals/well-known-symbol":251}],218:[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":128,"../internals/iterate-simple":154,"../internals/set-clone":207,"../internals/set-helpers":209}],219:[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":131,"../internals/object-define-property":174,"../internals/well-known-symbol":251}],220:[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":128,"../internals/iterate-simple":154,"../internals/set-clone":207,"../internals/set-helpers":209}],221:[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":223,"../internals/uid":244}],222:[function(require,module,exports){ 'use strict'; var IS_PURE = require('../internals/is-pure'); var globalThis = require('../internals/global-this'); var defineGlobalProperty = require('../internals/define-global-property'); var SHARED = '__core-js_shared__'; var store = module.exports = globalThis[SHARED] || defineGlobalProperty(SHARED, {}); (store.versions || (store.versions = [])).push({ version: '3.38.1', mode: IS_PURE ? 'pure' : 'global', copyright: '© 2014-2024 Denis Pushkarev (zloirock.ru)', license: 'https://github.com/zloirock/core-js/blob/v3.38.1/LICENSE', source: 'https://github.com/zloirock/core-js' }); },{"../internals/define-global-property":92,"../internals/global-this":130,"../internals/is-pure":151}],223:[function(require,module,exports){ 'use strict'; var store = require('../internals/shared-store'); module.exports = function (key, value) { return store[key] || (store[key] = value || {}); }; },{"../internals/shared-store":222}],224:[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":148,"../internals/well-known-symbol":251}],225:[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":121,"../internals/require-object-coercible":204,"../internals/to-integer-or-infinity":235,"../internals/to-string":242}],226:[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":204,"../internals/to-integer-or-infinity":235,"../internals/to-string":242}],227:[function(require,module,exports){ 'use strict'; var V8_VERSION = require('../internals/environment-v8-version'); var fails = require('../internals/fails'); var globalThis = require('../internals/global-this'); var $String = globalThis.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/environment-v8-version":105,"../internals/fails":111,"../internals/global-this":130}],228:[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":90,"../internals/function-call":117,"../internals/get-built-in":122,"../internals/well-known-symbol":251}],229:[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":121,"../internals/get-built-in":122}],230:[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":121,"../internals/get-built-in":122,"../internals/is-symbol":153,"../internals/shared":223,"../internals/well-known-symbol":251}],231:[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":227}],232:[function(require,module,exports){ 'use strict'; var globalThis = require('../internals/global-this'); 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/environment-is-ios'); var IS_NODE = require('../internals/environment-is-node'); var set = globalThis.setImmediate; var clear = globalThis.clearImmediate; var process = globalThis.process; var Dispatch = globalThis.Dispatch; var Function = globalThis.Function; var MessageChannel = globalThis.MessageChannel; var String = globalThis.String; var counter = 0; var queue = {}; var ONREADYSTATECHANGE = 'onreadystatechange'; var $location, defer, channel, port; fails(function () { $location = globalThis.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) { globalThis.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 ( globalThis.addEventListener && isCallable(globalThis.postMessage) && !globalThis.importScripts && $location && $location.protocol !== 'file:' && !fails(globalPostMessageDefer) ) { defer = globalPostMessageDefer; globalThis.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":71,"../internals/document-create-element":94,"../internals/environment-is-ios":101,"../internals/environment-is-node":102,"../internals/fails":111,"../internals/function-apply":114,"../internals/function-bind-context":115,"../internals/global-this":130,"../internals/has-own-property":131,"../internals/html":134,"../internals/is-callable":144,"../internals/validate-arguments-length":247}],233:[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":235}],234:[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":136,"../internals/require-object-coercible":204}],235:[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":166}],236:[function(require,module,exports){ 'use strict'; var toIntegerOrInfinity = require('../internals/to-integer-or-infinity'); var min = Math.min; module.exports = function (argument) { var len = toIntegerOrInfinity(argument); return len > 0 ? min(len, 0x1FFFFFFFFFFFFF) : 0; }; },{"../internals/to-integer-or-infinity":235}],237:[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":204}],238:[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":117,"../internals/get-method":127,"../internals/is-object":149,"../internals/is-symbol":153,"../internals/ordinary-to-primitive":188,"../internals/well-known-symbol":251}],239:[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":153,"../internals/to-primitive":238}],240:[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":122,"../internals/is-callable":144,"../internals/is-iterable":147,"../internals/is-object":149}],241:[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":251}],242:[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":77}],243:[function(require,module,exports){ 'use strict'; var $String = String; module.exports = function (argument) { try { return $String(argument); } catch (error) { return 'Object'; } }; },{}],244:[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":121}],245:[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":227}],246:[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":93,"../internals/fails":111}],247:[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; }; },{}],248:[function(require,module,exports){ 'use strict'; var globalThis = require('../internals/global-this'); var isCallable = require('../internals/is-callable'); var WeakMap = globalThis.WeakMap; module.exports = isCallable(WeakMap) && /native code/.test(String(WeakMap)); },{"../internals/global-this":130,"../internals/is-callable":144}],249:[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":131,"../internals/object-define-property":174,"../internals/path":190,"../internals/well-known-symbol-wrapped":250}],250:[function(require,module,exports){ 'use strict'; var wellKnownSymbol = require('../internals/well-known-symbol'); exports.f = wellKnownSymbol; },{"../internals/well-known-symbol":251}],251:[function(require,module,exports){ 'use strict'; var globalThis = require('../internals/global-this'); 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 = globalThis.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-this":130,"../internals/has-own-property":131,"../internals/shared":223,"../internals/symbol-constructor-detection":227,"../internals/uid":244,"../internals/use-symbol-as-uid":245}],252:[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":82,"../internals/create-non-enumerable-property":86,"../internals/create-property-descriptor":87,"../internals/error-stack-install":108,"../internals/export":110,"../internals/install-error-cause":139,"../internals/iterate":155,"../internals/normalize-string-argument":169,"../internals/object-create":172,"../internals/object-get-prototype-of":179,"../internals/object-is-prototype-of":181,"../internals/object-set-prototype-of":185,"../internals/well-known-symbol":251}],253:[function(require,module,exports){ 'use strict'; require('../modules/es.aggregate-error.constructor'); },{"../modules/es.aggregate-error.constructor":252}],254:[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/environment-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":73,"../internals/create-property":88,"../internals/does-not-exceed-safe-integer":95,"../internals/environment-v8-version":105,"../internals/export":110,"../internals/fails":111,"../internals/is-array":143,"../internals/is-object":149,"../internals/length-of-array-like":161,"../internals/to-object":237,"../internals/well-known-symbol":251}],255:[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":75,"../internals/export":110}],256:[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 = null; 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":85,"../internals/descriptors":93,"../internals/internal-state":141,"../internals/is-pure":151,"../internals/iterator-define":158,"../internals/iterators":160,"../internals/object-define-property":174,"../internals/to-indexed-object":234}],257:[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":71,"../internals/export":110,"../internals/fails":111,"../internals/function-apply":114,"../internals/function-call":117,"../internals/function-uncurry-this":121,"../internals/get-built-in":122,"../internals/get-json-replacer-function":126,"../internals/is-callable":144,"../internals/is-symbol":153,"../internals/symbol-constructor-detection":227}],258:[function(require,module,exports){ 'use strict'; var globalThis = require('../internals/global-this'); var setToStringTag = require('../internals/set-to-string-tag'); setToStringTag(globalThis.JSON, 'JSON', true); },{"../internals/global-this":130,"../internals/set-to-string-tag":219}],259:[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":81,"../internals/collection-strong":80}],260:[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 fails = require('../internals/fails'); var Map = MapHelpers.Map; var has = MapHelpers.has; var get = MapHelpers.get; var set = MapHelpers.set; var push = uncurryThis([].push); var DOES_NOT_WORK_WITH_PRIMITIVES = IS_PURE || fails(function () { return Map.groupBy('ab', function (it) { return it; }).get('a').length !== 1; }); $({ target: 'Map', stat: true, forced: IS_PURE || DOES_NOT_WORK_WITH_PRIMITIVES }, { 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":110,"../internals/fails":111,"../internals/function-uncurry-this":121,"../internals/is-pure":151,"../internals/iterate":155,"../internals/map-helpers":163,"../internals/require-object-coercible":204}],261:[function(require,module,exports){ 'use strict'; require('../modules/es.map.constructor'); },{"../modules/es.map.constructor":259}],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":110}],263:[function(require,module,exports){ 'use strict'; var setToStringTag = require('../internals/set-to-string-tag'); setToStringTag(Math, 'Math', true); },{"../internals/set-to-string-tag":219}],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":110,"../internals/object-assign":171}],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":110,"../internals/object-to-array":186}],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":110,"../internals/fails":111,"../internals/object-get-own-property-symbols":178,"../internals/symbol-constructor-detection":227,"../internals/to-object":237}],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":90,"../internals/object-to-string":187,"../internals/to-string-tag-support":241}],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":110,"../internals/function-call":117,"../internals/iterate":155,"../internals/new-promise-capability":168,"../internals/perform":191,"../internals/promise-statics-incorrect-iteration":195}],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":110,"../internals/function-call":117,"../internals/iterate":155,"../internals/new-promise-capability":168,"../internals/perform":191,"../internals/promise-statics-incorrect-iteration":195}],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":110,"../internals/function-call":117,"../internals/get-built-in":122,"../internals/iterate":155,"../internals/new-promise-capability":168,"../internals/perform":191,"../internals/promise-statics-incorrect-iteration":195}],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":90,"../internals/export":110,"../internals/get-built-in":122,"../internals/is-callable":144,"../internals/is-pure":151,"../internals/promise-constructor-detection":192,"../internals/promise-native-constructor":193}],272:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var IS_PURE = require('../internals/is-pure'); var IS_NODE = require('../internals/environment-is-node'); var globalThis = require('../internals/global-this'); 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 = globalThis.TypeError; var document = globalThis.document; var process = globalThis.process; var newPromiseCapability = newPromiseCapabilityModule.f; var newGenericPromiseCapability = newPromiseCapability; var DISPATCH_EVENT = !!(document && document.createEvent && globalThis.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); globalThis.dispatchEvent(event); } else event = { promise: promise, reason: reason }; if (!NATIVE_PROMISE_REJECTION_EVENT && (handler = globalThis['on' + name])) handler(event); else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason); }; var onUnhandled = function (state) { call(task, globalThis, 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, globalThis, 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: null }); }; 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":90,"../internals/environment-is-node":102,"../internals/export":110,"../internals/function-call":117,"../internals/global-this":130,"../internals/host-report-errors":133,"../internals/internal-state":141,"../internals/is-callable":144,"../internals/is-object":149,"../internals/is-pure":151,"../internals/microtask":167,"../internals/new-promise-capability":168,"../internals/object-set-prototype-of":185,"../internals/perform":191,"../internals/promise-constructor-detection":192,"../internals/promise-native-constructor":193,"../internals/queue":196,"../internals/set-species":217,"../internals/set-to-string-tag":219,"../internals/species-constructor":224,"../internals/task":232}],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":90,"../internals/export":110,"../internals/fails":111,"../internals/get-built-in":122,"../internals/is-callable":144,"../internals/is-pure":151,"../internals/promise-native-constructor":193,"../internals/promise-resolve":194,"../internals/species-constructor":224}],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":110,"../internals/function-call":117,"../internals/iterate":155,"../internals/new-promise-capability":168,"../internals/perform":191,"../internals/promise-statics-incorrect-iteration":195}],276:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); 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); var capabilityReject = capability.reject; capabilityReject(r); return capability.promise; } }); },{"../internals/export":110,"../internals/new-promise-capability":168,"../internals/promise-constructor-detection":192}],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":110,"../internals/get-built-in":122,"../internals/is-pure":151,"../internals/promise-constructor-detection":192,"../internals/promise-native-constructor":193,"../internals/promise-resolve":194}],278:[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":110,"../internals/new-promise-capability":168}],279:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var globalThis = require('../internals/global-this'); var setToStringTag = require('../internals/set-to-string-tag'); $({ global: true }, { Reflect: {} }); setToStringTag(globalThis.Reflect, 'Reflect', true); },{"../internals/export":110,"../internals/global-this":130,"../internals/set-to-string-tag":219}],280:[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":110,"../internals/regexp-exec":198}],281:[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":81,"../internals/collection-strong":80}],282:[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":110,"../internals/set-difference":208,"../internals/set-method-accept-set-like":215}],283:[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 String(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":110,"../internals/fails":111,"../internals/set-intersection":210,"../internals/set-method-accept-set-like":215}],284:[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":110,"../internals/set-is-disjoint-from":211,"../internals/set-method-accept-set-like":215}],285:[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":110,"../internals/set-is-subset-of":212,"../internals/set-method-accept-set-like":215}],286:[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":110,"../internals/set-is-superset-of":213,"../internals/set-method-accept-set-like":215}],287:[function(require,module,exports){ 'use strict'; require('../modules/es.set.constructor'); },{"../modules/es.set.constructor":281}],288:[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":110,"../internals/set-method-accept-set-like":215,"../internals/set-symmetric-difference":218}],289:[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":110,"../internals/set-method-accept-set-like":215,"../internals/set-union":220}],290:[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 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 slice(that, end - search.length, end) === search; } }); },{"../internals/correct-is-regexp-logic":83,"../internals/export":110,"../internals/function-uncurry-this-clause":120,"../internals/is-pure":151,"../internals/not-a-regexp":170,"../internals/object-get-own-property-descriptor":175,"../internals/require-object-coercible":204,"../internals/to-length":236,"../internals/to-string":242}],291:[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":83,"../internals/export":110,"../internals/function-uncurry-this":121,"../internals/not-a-regexp":170,"../internals/require-object-coercible":204,"../internals/to-string":242}],292:[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":85,"../internals/internal-state":141,"../internals/iterator-define":158,"../internals/string-multibyte":225,"../internals/to-string":242}],293:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var repeat = require('../internals/string-repeat'); $({ target: 'String', proto: true }, { repeat: repeat }); },{"../internals/export":110,"../internals/string-repeat":226}],294:[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; $({ target: 'String', proto: true }, { replaceAll: function replaceAll(searchValue, replaceValue) { var O = requireObjectCoercible(this); var IS_REG_EXP, flags, replacer, string, searchString, functionalReplace, searchLength, advanceBy, position, replacement; 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); 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 = indexOf(string, searchString); 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 = position + advanceBy > string.length ? -1 : indexOf(string, searchString, position + advanceBy); } if (endOfLastMatch < string.length) { result += stringSlice(string, endOfLastMatch); } return result; } }); },{"../internals/export":110,"../internals/function-call":117,"../internals/function-uncurry-this":121,"../internals/get-method":127,"../internals/get-substitution":129,"../internals/is-callable":144,"../internals/is-null-or-undefined":148,"../internals/is-pure":151,"../internals/is-regexp":152,"../internals/regexp-get-flags":200,"../internals/require-object-coercible":204,"../internals/to-string":242,"../internals/well-known-symbol":251}],295:[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, '$<a>') !== '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":111,"../internals/fix-regexp-well-known-symbol-logic":112,"../internals/function-apply":114,"../internals/function-call":117,"../internals/function-uncurry-this":121,"../internals/get-method":127,"../internals/get-substitution":129,"../internals/is-callable":144,"../internals/is-null-or-undefined":148,"../internals/regexp-exec-abstract":197,"../internals/require-object-coercible":204,"../internals/to-integer-or-infinity":235,"../internals/to-length":236,"../internals/to-string":242,"../internals/well-known-symbol":251}],296:[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 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 stringSlice(that, index, index + search.length) === search; } }); },{"../internals/correct-is-regexp-logic":83,"../internals/export":110,"../internals/function-uncurry-this-clause":120,"../internals/is-pure":151,"../internals/not-a-regexp":170,"../internals/object-get-own-property-descriptor":175,"../internals/require-object-coercible":204,"../internals/to-length":236,"../internals/to-string":242}],297:[function(require,module,exports){ 'use strict'; var defineWellKnownSymbol = require('../internals/well-known-symbol-define'); defineWellKnownSymbol('asyncIterator'); },{"../internals/well-known-symbol-define":249}],298:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var globalThis = require('../internals/global-this'); 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 = globalThis.Symbol; var SymbolPrototype = $Symbol && $Symbol[PROTOTYPE]; var RangeError = globalThis.RangeError; var TypeError = globalThis.TypeError; var QObject = globalThis.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, nativeObjectCreate(null))); 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 ? globalThis : 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":87,"../internals/define-built-in":90,"../internals/define-built-in-accessor":89,"../internals/descriptors":93,"../internals/export":110,"../internals/fails":111,"../internals/function-call":117,"../internals/function-uncurry-this":121,"../internals/global-this":130,"../internals/has-own-property":131,"../internals/hidden-keys":132,"../internals/internal-state":141,"../internals/is-pure":151,"../internals/object-create":172,"../internals/object-define-properties":173,"../internals/object-define-property":174,"../internals/object-get-own-property-descriptor":175,"../internals/object-get-own-property-names":177,"../internals/object-get-own-property-names-external":176,"../internals/object-get-own-property-symbols":178,"../internals/object-is-prototype-of":181,"../internals/object-keys":183,"../internals/object-property-is-enumerable":184,"../internals/set-to-string-tag":219,"../internals/shared":223,"../internals/shared-key":221,"../internals/symbol-constructor-detection":227,"../internals/symbol-define-to-primitive":228,"../internals/to-indexed-object":234,"../internals/to-property-key":239,"../internals/to-string":242,"../internals/uid":244,"../internals/well-known-symbol":251,"../internals/well-known-symbol-define":249,"../internals/well-known-symbol-wrapped":250}],299:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var DESCRIPTORS = require('../internals/descriptors'); var globalThis = require('../internals/global-this'); 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 = globalThis.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":82,"../internals/define-built-in-accessor":89,"../internals/descriptors":93,"../internals/export":110,"../internals/function-uncurry-this":121,"../internals/global-this":130,"../internals/has-own-property":131,"../internals/is-callable":144,"../internals/object-is-prototype-of":181,"../internals/to-string":242}],300:[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":110,"../internals/get-built-in":122,"../internals/has-own-property":131,"../internals/shared":223,"../internals/symbol-registry-detection":231,"../internals/to-string":242}],301:[function(require,module,exports){ 'use strict'; var defineWellKnownSymbol = require('../internals/well-known-symbol-define'); defineWellKnownSymbol('hasInstance'); },{"../internals/well-known-symbol-define":249}],302:[function(require,module,exports){ 'use strict'; var defineWellKnownSymbol = require('../internals/well-known-symbol-define'); defineWellKnownSymbol('isConcatSpreadable'); },{"../internals/well-known-symbol-define":249}],303:[function(require,module,exports){ 'use strict'; var defineWellKnownSymbol = require('../internals/well-known-symbol-define'); defineWellKnownSymbol('iterator'); },{"../internals/well-known-symbol-define":249}],304:[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":257,"../modules/es.object.get-own-property-symbols":266,"../modules/es.symbol.constructor":298,"../modules/es.symbol.for":300,"../modules/es.symbol.key-for":305}],305:[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":110,"../internals/has-own-property":131,"../internals/is-symbol":153,"../internals/shared":223,"../internals/symbol-registry-detection":231,"../internals/try-to-string":243}],306:[function(require,module,exports){ 'use strict'; var defineWellKnownSymbol = require('../internals/well-known-symbol-define'); defineWellKnownSymbol('matchAll'); },{"../internals/well-known-symbol-define":249}],307:[function(require,module,exports){ 'use strict'; var defineWellKnownSymbol = require('../internals/well-known-symbol-define'); defineWellKnownSymbol('match'); },{"../internals/well-known-symbol-define":249}],308:[function(require,module,exports){ 'use strict'; var defineWellKnownSymbol = require('../internals/well-known-symbol-define'); defineWellKnownSymbol('replace'); },{"../internals/well-known-symbol-define":249}],309:[function(require,module,exports){ 'use strict'; var defineWellKnownSymbol = require('../internals/well-known-symbol-define'); defineWellKnownSymbol('search'); },{"../internals/well-known-symbol-define":249}],310:[function(require,module,exports){ 'use strict'; var defineWellKnownSymbol = require('../internals/well-known-symbol-define'); defineWellKnownSymbol('species'); },{"../internals/well-known-symbol-define":249}],311:[function(require,module,exports){ 'use strict'; var defineWellKnownSymbol = require('../internals/well-known-symbol-define'); defineWellKnownSymbol('split'); },{"../internals/well-known-symbol-define":249}],312:[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":228,"../internals/well-known-symbol-define":249}],313:[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":122,"../internals/set-to-string-tag":219,"../internals/well-known-symbol-define":249}],314:[function(require,module,exports){ 'use strict'; var defineWellKnownSymbol = require('../internals/well-known-symbol-define'); defineWellKnownSymbol('unscopables'); },{"../internals/well-known-symbol-define":249}],315:[function(require,module,exports){ 'use strict'; require('../modules/es.aggregate-error'); },{"../modules/es.aggregate-error":253}],316:[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":174,"../internals/well-known-symbol":251}],317:[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":110,"../internals/map-helpers":163}],318:[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":110,"../internals/map-helpers":163}],319:[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":110,"../internals/function-bind-context":115,"../internals/map-iterate":164}],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 }, { 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":110,"../internals/function-bind-context":115,"../internals/map-helpers":163,"../internals/map-iterate":164}],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 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":110,"../internals/function-bind-context":115,"../internals/map-iterate":164}],322:[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":110,"../internals/function-bind-context":115,"../internals/map-iterate":164}],323:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var MapHelpers = require('../internals/map-helpers'); var createCollectionFrom = require('../internals/collection-from'); $({ target: 'Map', stat: true, forced: true }, { from: createCollectionFrom(MapHelpers.Map, MapHelpers.set, true) }); },{"../internals/collection-from":78,"../internals/export":110,"../internals/map-helpers":163}],324:[function(require,module,exports){ 'use strict'; require('../modules/es.map.group-by'); },{"../modules/es.map.group-by":260}],325:[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":110,"../internals/map-iterate":164,"../internals/same-value-zero":206}],326:[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":110,"../internals/function-call":117,"../internals/is-callable":144,"../internals/iterate":155,"../internals/map-helpers":163}],327:[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":110,"../internals/map-iterate":164}],328:[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":110,"../internals/function-bind-context":115,"../internals/map-helpers":163,"../internals/map-iterate":164}],329:[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":110,"../internals/function-bind-context":115,"../internals/map-helpers":163,"../internals/map-iterate":164}],330:[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":110,"../internals/iterate":155,"../internals/map-helpers":163}],331:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var MapHelpers = require('../internals/map-helpers'); var createCollectionOf = require('../internals/collection-of'); $({ target: 'Map', stat: true, forced: true }, { of: createCollectionOf(MapHelpers.Map, MapHelpers.set, true) }); },{"../internals/collection-of":79,"../internals/export":110,"../internals/map-helpers":163}],332:[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":110,"../internals/map-iterate":164}],333:[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":110,"../internals/function-bind-context":115,"../internals/map-iterate":164}],334:[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":110,"../internals/map-upsert":165}],335:[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":110,"../internals/map-helpers":163}],336:[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":110,"../internals/map-upsert":165}],337:[function(require,module,exports){ 'use strict'; require('../modules/es.promise.all-settled.js'); },{"../modules/es.promise.all-settled.js":268}],338:[function(require,module,exports){ 'use strict'; require('../modules/es.promise.any'); },{"../modules/es.promise.any":270}],339:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var globalThis = require('../internals/global-this'); var apply = require('../internals/function-apply'); var slice = require('../internals/array-slice'); var newPromiseCapabilityModule = require('../internals/new-promise-capability'); var aCallable = require('../internals/a-callable'); var perform = require('../internals/perform'); var Promise = globalThis.Promise; var ACCEPT_ARGUMENTS = false; var FORCED = !Promise || !Promise['try'] || perform(function () { Promise['try'](function (argument) { ACCEPT_ARGUMENTS = argument === 8; }, 8); }).error || !ACCEPT_ARGUMENTS; $({ target: 'Promise', stat: true, forced: FORCED }, { 'try': function (callbackfn ) { var args = arguments.length > 1 ? slice(arguments, 1) : []; var promiseCapability = newPromiseCapabilityModule.f(this); var result = perform(function () { return apply(aCallable(callbackfn), undefined, args); }); (result.error ? promiseCapability.reject : promiseCapability.resolve)(result.value); return promiseCapability.promise; } }); },{"../internals/a-callable":57,"../internals/array-slice":71,"../internals/export":110,"../internals/function-apply":114,"../internals/global-this":130,"../internals/new-promise-capability":168,"../internals/perform":191}],340:[function(require,module,exports){ 'use strict'; require('../modules/es.promise.with-resolvers'); },{"../modules/es.promise.with-resolvers":278}],341:[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":110,"../internals/set-helpers":209}],342:[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":110,"../internals/set-helpers":209}],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 $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":110,"../internals/function-call":117,"../internals/set-difference":208,"../internals/to-set-like":240}],344:[function(require,module,exports){ 'use strict'; require('../modules/es.set.difference.v2'); },{"../modules/es.set.difference.v2":282}],345:[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":110,"../internals/function-bind-context":115,"../internals/set-iterate":214}],346:[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":110,"../internals/function-bind-context":115,"../internals/set-helpers":209,"../internals/set-iterate":214}],347:[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":110,"../internals/function-bind-context":115,"../internals/set-iterate":214}],348:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var SetHelpers = require('../internals/set-helpers'); var createCollectionFrom = require('../internals/collection-from'); $({ target: 'Set', stat: true, forced: true }, { from: createCollectionFrom(SetHelpers.Set, SetHelpers.add, false) }); },{"../internals/collection-from":78,"../internals/export":110,"../internals/set-helpers":209}],349:[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":110,"../internals/function-call":117,"../internals/set-intersection":210,"../internals/to-set-like":240}],350:[function(require,module,exports){ 'use strict'; require('../modules/es.set.intersection.v2'); },{"../modules/es.set.intersection.v2":283}],351:[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":110,"../internals/function-call":117,"../internals/set-is-disjoint-from":211,"../internals/to-set-like":240}],352:[function(require,module,exports){ 'use strict'; require('../modules/es.set.is-disjoint-from.v2'); },{"../modules/es.set.is-disjoint-from.v2":284}],353:[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":110,"../internals/function-call":117,"../internals/set-is-subset-of":212,"../internals/to-set-like":240}],354:[function(require,module,exports){ 'use strict'; require('../modules/es.set.is-subset-of.v2'); },{"../modules/es.set.is-subset-of.v2":285}],355:[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":110,"../internals/function-call":117,"../internals/set-is-superset-of":213,"../internals/to-set-like":240}],356:[function(require,module,exports){ 'use strict'; require('../modules/es.set.is-superset-of.v2'); },{"../modules/es.set.is-superset-of.v2":286}],357:[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":110,"../internals/function-uncurry-this":121,"../internals/set-iterate":214,"../internals/to-string":242}],358:[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":110,"../internals/function-bind-context":115,"../internals/set-helpers":209,"../internals/set-iterate":214}],359:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var SetHelpers = require('../internals/set-helpers'); var createCollectionOf = require('../internals/collection-of'); $({ target: 'Set', stat: true, forced: true }, { of: createCollectionOf(SetHelpers.Set, SetHelpers.add, false) }); },{"../internals/collection-of":79,"../internals/export":110,"../internals/set-helpers":209}],360:[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":110,"../internals/set-iterate":214}],361:[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":110,"../internals/function-bind-context":115,"../internals/set-iterate":214}],362:[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":110,"../internals/function-call":117,"../internals/set-symmetric-difference":218,"../internals/to-set-like":240}],363:[function(require,module,exports){ 'use strict'; require('../modules/es.set.symmetric-difference.v2'); },{"../modules/es.set.symmetric-difference.v2":288}],364:[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":110,"../internals/function-call":117,"../internals/set-union":220,"../internals/to-set-like":240}],365:[function(require,module,exports){ 'use strict'; require('../modules/es.set.union.v2'); },{"../modules/es.set.union.v2":289}],366:[function(require,module,exports){ 'use strict'; require('../modules/es.string.replace-all'); },{"../modules/es.string.replace-all":294}],367:[function(require,module,exports){ 'use strict'; var globalThis = require('../internals/global-this'); 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 = globalThis.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-this":130,"../internals/object-define-property":174,"../internals/object-get-own-property-descriptor":175,"../internals/well-known-symbol-define":249}],368:[function(require,module,exports){ 'use strict'; var defineWellKnownSymbol = require('../internals/well-known-symbol-define'); defineWellKnownSymbol('customMatcher'); },{"../internals/well-known-symbol-define":249}],369:[function(require,module,exports){ 'use strict'; var globalThis = require('../internals/global-this'); 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 = globalThis.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-this":130,"../internals/object-define-property":174,"../internals/object-get-own-property-descriptor":175,"../internals/well-known-symbol-define":249}],370:[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":110,"../internals/symbol-is-registered":229}],371:[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":110,"../internals/symbol-is-registered":229}],372:[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":110,"../internals/symbol-is-well-known":230}],373:[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":110,"../internals/symbol-is-well-known":230}],374:[function(require,module,exports){ 'use strict'; var defineWellKnownSymbol = require('../internals/well-known-symbol-define'); defineWellKnownSymbol('matcher'); },{"../internals/well-known-symbol-define":249}],375:[function(require,module,exports){ 'use strict'; var defineWellKnownSymbol = require('../internals/well-known-symbol-define'); defineWellKnownSymbol('metadataKey'); },{"../internals/well-known-symbol-define":249}],376:[function(require,module,exports){ 'use strict'; var defineWellKnownSymbol = require('../internals/well-known-symbol-define'); defineWellKnownSymbol('metadata'); },{"../internals/well-known-symbol-define":249}],377:[function(require,module,exports){ 'use strict'; var defineWellKnownSymbol = require('../internals/well-known-symbol-define'); defineWellKnownSymbol('observable'); },{"../internals/well-known-symbol-define":249}],378:[function(require,module,exports){ 'use strict'; var defineWellKnownSymbol = require('../internals/well-known-symbol-define'); defineWellKnownSymbol('patternMatch'); },{"../internals/well-known-symbol-define":249}],379:[function(require,module,exports){ 'use strict'; var defineWellKnownSymbol = require('../internals/well-known-symbol-define'); defineWellKnownSymbol('replaceAll'); },{"../internals/well-known-symbol-define":249}],380:[function(require,module,exports){ 'use strict'; var globalThis = require('../internals/global-this'); 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 setToStringTag = require('../internals/set-to-string-tag'); var wellKnownSymbol = require('../internals/well-known-symbol'); var ITERATOR = wellKnownSymbol('iterator'); 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; } setToStringTag(CollectionPrototype, COLLECTION_NAME, true); 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(globalThis[COLLECTION_NAME] && globalThis[COLLECTION_NAME].prototype, COLLECTION_NAME); } handlePrototype(DOMTokenListPrototype, 'DOMTokenList'); },{"../internals/create-non-enumerable-property":86,"../internals/dom-iterables":96,"../internals/dom-token-list-prototype":97,"../internals/global-this":130,"../internals/set-to-string-tag":219,"../internals/well-known-symbol":251,"../modules/es.array.iterator":256}],381:[function(require,module,exports){ 'use strict'; var parent = require('../../es/array/from'); module.exports = parent; },{"../../es/array/from":15}],382:[function(require,module,exports){ 'use strict'; var parent = require('../../es/array/iterator'); module.exports = parent; },{"../../es/array/iterator":16}],383:[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":380}],384:[function(require,module,exports){ 'use strict'; var parent = require('../../es/math/clz32'); module.exports = parent; },{"../../es/math/clz32":18}],385:[function(require,module,exports){ 'use strict'; var parent = require('../../es/object/assign'); module.exports = parent; },{"../../es/object/assign":19}],386:[function(require,module,exports){ 'use strict'; var parent = require('../../es/object/entries'); module.exports = parent; },{"../../es/object/entries":20}],387:[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":380}],388:[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":380}],389:[function(require,module,exports){ 'use strict'; var parent = require('../../es/string/ends-with'); module.exports = parent; },{"../../es/string/ends-with":23}],390:[function(require,module,exports){ 'use strict'; var parent = require('../../es/string/includes'); module.exports = parent; },{"../../es/string/includes":24}],391:[function(require,module,exports){ 'use strict'; var parent = require('../../es/string/repeat'); module.exports = parent; },{"../../es/string/repeat":25}],392:[function(require,module,exports){ 'use strict'; var parent = require('../../es/string/replace-all'); module.exports = parent; },{"../../es/string/replace-all":26}],393:[function(require,module,exports){ 'use strict'; var parent = require('../../es/string/starts-with'); module.exports = parent; },{"../../es/string/starts-with":27}],394:[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":380}],395:[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":396,"./polyfills/element.child-node.before":397,"./polyfills/element.child-node.closest":398,"./polyfills/element.child-node.remove":399,"./polyfills/element.child-node.replace-with":400,"./polyfills/element.node-list.for-each":401,"./polyfills/element.parent-node.append":402,"./polyfills/element.parent-node.prepend":403}],396:[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]); },{}],397:[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]); },{}],398:[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; }; } },{}],399:[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]); },{}],400:[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; },{}],401:[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); } }; } },{}],402:[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]); },{}],403:[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]); },{}],404:[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 != null) { 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); } } },{}],405:[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(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _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(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); } function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); } function _createForOfIteratorHelperLoose(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (t) return (t = t.call(r)).next.bind(t); if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var o = 0; return function () { return o >= r.length ? { done: !0 } : { done: !1, value: r[o++] }; }; } 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 _superPropGet(t, e, o, r) { var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), e, o); return 2 & r && "function" == typeof p ? function (t) { return p.apply(o, t); } : p; } function _get() { return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { var p = _superPropBase(e, t); if (p) { var n = Object.getOwnPropertyDescriptor(p, t); return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; } }, _get.apply(null, arguments); } function _superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); return t; } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } 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 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 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 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(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _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(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } 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(r) { if (Array.isArray(r)) return r; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } (function deMainFuncInner(deWindow, prestoStorage, FormData, scrollTo, localData) { 'use strict'; var _this26 = this; var _marked = _regeneratorRuntime().mark(getFormElements); var version = '24.9.16.0'; var commit = '8b70c12'; 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: 1, 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: 1, 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: 0, 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', 'Корекція часу'], 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: ['Получить файл</a> с данными', 'Get the file</a> with data', 'Отримати файл</a> з даними'], globalCfg: ['Глобальные настройки', 'Global config', 'Глобальні налаштування'], loadGlobal: ['и применить к этому домену', 'and apply to this domain', 'і застосувати до цього домену'], saveGlobal: ['текущие настройки как глобальные', 'current config as global', 'поточні налаштування як глобальні'], descrGlobal: ['Глобальные настройки применяются по умолчанию<br>при первом посещении других доменов', 'Global config is applied by default<br>on the first visit of other domains', 'Глобальні налаштування застосовуються по замовчуванню<br>під час першого відвідання інших доменів'], 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: ['<b>Спасибо за использование Dollchan Extension!</b><br>Вы можете поддержать проект пожертвованием', '<b>Thank You for using Dollchan Extension!</b><br>You can support the project by donating', '<b>Дякуємо за використання Dollchan Extension!</b><br>Ви можете підтримати проект пожертвою'], donateOnline: ['Онлайн донат (грн)', 'Donate online (UAH)', 'Онлайн донат (грн)'], firefoxAddon: ['Firefox аддон</a> доступен!', 'Firefox add-on</a> is available!', 'Firefox аддон</a> доступний!'] }; 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 $contains(containerEl, el) { var _el; el = ((_el = el) === null || _el === void 0 ? void 0 : _el.farthestViewportElement ) || el; return el && (el === containerEl || containerEl.contains(el)); } 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("<input type=\"button\" class=\"".concat(className, "\" value=\"").concat(value, "\" title=\"").concat(title, "\">")); 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, "<style type=\"text/css\">".concat(nav.isSafari && !('flex' in doc.body.style) ? text.replace(/(transform|transition|flex|align-items)/g, ' -webkit-$1') : text, "</style>")); } 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 _callee48(file, asText) { return _regeneratorRuntime().wrap(function _callee48$(_context56) { while (1) switch (_context56.prev = _context56.next) { case 0: return _context56.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 _context56.stop(); } }, _callee48); })); 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, "<a href=\"".concat(url, "\" download=\"").concat(name, "\"></a>")); 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; } return _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); }); } }]); }(); var Maybe = function () { function Maybe(Ctor ) { _classCallCheck(this, Maybe); this._ctor = Ctor; this.hasValue = false; } return _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; } }]); }(); 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); } return _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) { var _this$data; (_this$data = this.data) === null || _this$data === void 0 || _this$data["delete"](key); } }]); }(); 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; } return _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; } }); } }]); }(); 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)); } } return _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); }); } }]); }(); var TarBuilder = function () { function TarBuilder() { _classCallCheck(this, TarBuilder); this._data = []; } return _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; } }]); }(); 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 _el2 = new WebmParser.Element(dv, len, offset); if (_el2.error) { break error; } if (_el2.id === segmentId) { this.segment = _el2; break; } else if (_el2.id === voidId) { voids.push(_el2); } else { break error; } offset += _el2.headSize + _el2.size; } this.voids = voids; this.data = data; this.length = len; this.rv = [null]; this.error = false; return; } while (false); this.error = true; } return _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; } }]); }(); 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 _callee49(id) { return _regeneratorRuntime().wrap(function _callee49$(_context57) { while (1) switch (_context57.prev = _context57.next) { case 0: if (!nav.hasNewGM) { _context57.next = 6; break; } _context57.next = 3; return GM.getValue(id); case 3: return _context57.abrupt("return", _context57.sent); case 6: if (!nav.hasOldGM) { _context57.next = 10; break; } return _context57.abrupt("return", GM_getValue(id)); case 10: if (!nav.hasWebStorage) { _context57.next = 14; break; } return _context57.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 14: if (!nav.hasPrestoStorage) { _context57.next = 16; break; } return _context57.abrupt("return", prestoStorage.getItem(id)); case 16: return _context57.abrupt("return", locStorage[id]); case 17: case "end": return _context57.stop(); } }, _callee49); })); 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 _callee50(id) { return _regeneratorRuntime().wrap(function _callee50$(_context58) { while (1) switch (_context58.prev = _context58.next) { case 0: _context58.t1 = JSON; _context58.next = 3; return getStored(id); case 3: _context58.t2 = _context58.sent; if (_context58.t2) { _context58.next = 6; break; } _context58.t2 = '{}'; case 6: _context58.t3 = _context58.t2; _context58.t0 = _context58.t1.parse.call(_context58.t1, _context58.t3); if (_context58.t0) { _context58.next = 10; break; } _context58.t0 = {}; case 10: return _context58.abrupt("return", _context58.t0); case 11: case "end": return _context58.stop(); } }, _callee50); })); 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 && !nav.isViolentmonkey)) { _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 _callee51(id) { return _regeneratorRuntime().wrap(function _callee51$(_context59) { while (1) switch (_context59.prev = _context59.next) { case 0: _context59.next = 2; return CfgSaver.save(id, +!Cfg[id]); case 2: case "end": return _context59.stop(); } }, _callee51); })); return _toggleCfg.apply(this, arguments); } function readCfg() { return _readCfg.apply(this, arguments); } function _readCfg() { _readCfg = _asyncToGenerator(_regeneratorRuntime().mark(function _callee52() { var obj, val, isGlobal, browserLang; return _regeneratorRuntime().wrap(function _callee52$(_context60) { while (1) switch (_context60.prev = _context60.next) { case 0: _context60.next = 2; return getStoredObj('DESU_Config'); case 2: val = _context60.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 _context60.stop(); } }, _callee52); })); 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; } return _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 () { var _this8$_onAfterSave; if (_this8._cachedStorage) { locStorage[_this8.storageName] = JSON.stringify(_this8._cachedStorage); } _this8.purge(); (_this8$_onAfterSave = _this8._onAfterSave) === null || _this8$_onAfterSave === void 0 || _this8$_onAfterSave.call(_this8); }, 0); } } }]); }(); var HiddenPosts = new (function (_PostsStorage) { function HiddenPostsClass() { var _this9; _classCallCheck(this, HiddenPostsClass); _this9 = _callSuper(this, HiddenPostsClass); _this9.storageName = 'de-posts'; return _this9; } _inherits(HiddenPostsClass, _PostsStorage); return _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); } } }]); }(PostsStorage))(); var HiddenThreads = new (function (_PostsStorage2) { function HiddenThreadsClass() { var _this10; _classCallCheck(this, HiddenThreadsClass); _this10 = _callSuper(this, HiddenThreadsClass); _this10.storageName = 'de-threads'; return _this10; } _inherits(HiddenThreadsClass, _PostsStorage2); return _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(); } }]); }(PostsStorage))(); var MyPosts = new (function (_PostsStorage3) { function MyPostsClass() { var _this11; _classCallCheck(this, MyPostsClass); _this11 = _callSuper(this, MyPostsClass); _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; } _inherits(MyPostsClass, _PostsStorage3); return _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() { _superPropGet(MyPostsClass, "purge", this, 3)([]); this._cachedData = null; this._readStorage(); } }, { key: "readStorage", value: function readStorage() { this._readStorage(); } }, { key: "set", value: function set(num, thrNum) { _superPropGet(MyPostsClass, "set", this, 3)([num, thrNum]); this._cachedData.add(+num); } }]); }(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', "<div id=\"de-main\">\n\t\t\t<div id=\"de-panel\">\n\t\t\t\t<div id=\"de-panel-logo\" title=\"".concat(Lng.panelBtn.attach[lang], "\">\n\t\t\t\t\t<svg id=\"de-panel-logo-svg\">\n\t\t\t\t\t\t<use xlink:href=\"#de-symbol-panel-logo\"/>\n\t\t\t\t\t</svg>\n\t\t\t\t</div>\n\t\t\t\t<span id=\"de-panel-buttons\"").concat(!Cfg.expandPanel ? ' style="display: none;"' : '', ">\n\t\t\t\t").concat(Cfg.disabled ? this._getButton('enable') : this._getButton('cfg') + this._getButton('hid') + this._getButton('fav') + (Cfg.embedYTube ? this._getButton('vid') : '') + (!localData ? this._getButton('refresh') + (isThr || aib.page !== aib.firstPage ? this._getButton('goback') : '') + (!isThr && aib.page !== aib.lastPage ? this._getButton('gonext') : '') : '') + this._getButton('goup') + this._getButton('godown') + (filesCount ? this._getButton('expimg') + this._getButton('maskimg') : '') + (!localData && !nav.isPresto ? (filesCount && !Cfg.preLoadImgs ? this._getButton('preimg') : '') + (isThr ? this._getButton('savethr') : '') : '') + (!localData && isThr ? this._getButton(Cfg.ajaxUpdThr && !aib.isArchived ? 'upd-on' : 'upd-off') + (!nav.isSafari ? this._getButton('audio-off') : '') : '') + (aib.hasCatalog ? this._getButton('catalog') : '') + this._getButton('enable') + (isThr && Thread.first ? "<span id=\"de-panel-info\">\n\t\t\t\t\t\t<span id=\"de-panel-info-posts\" title=\"".concat(Lng.panelBtn[Cfg.panelCounter !== 2 ? 'postsCount' : 'postsNotHid'][lang], "\">").concat(Thread.first.postsCount, "</span>\n\t\t\t\t\t\t<span id=\"de-panel-info-files\" title=\"").concat(Lng.panelBtn.filesCount[lang], "\">").concat(filesCount, "</span>\n\t\t\t\t\t\t<span id=\"de-panel-info-posters\" title=\"").concat(Lng.panelBtn.postersCount[lang], "\">").concat(aib.postersCount, "</span>\n\t\t\t\t\t</span>") : ''), "\n\t\t\t\t</span>\n\t\t\t</div>\n\t\t\t").concat(Cfg.disabled ? '' : '<div id="de-wrapper-popup"></div><hr style="clear: both;">', "\n\t\t</div>")); this._el = $id('de-panel'); this._el.addEventListener('click', this, true); if (!nav.isMobile) { ['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); if (!nav.isMobile) { ['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; var el, post, _iterator2, _step2, _el3, _this14$_menu; 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' ? 67 : 91; 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' ? 52 : _context5.t1 === 'de-panel-savethr' ? 60 : _context5.t1 === 'de-panel-enable' ? 62 : 66; break; case 13: if (Cfg.expandPanel) { if (!$q('.de-win-active')) { $hide(_this14._buttons); } } else { $show(_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: if (nav.isMobile && !aib.t) { _this14._menuToggleClickBtn(el); } else { 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;) { _el3 = _step2.value.el; ContentLoader.preloadImages(_el3); } } 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 (!nav.isMobile) { _context5.next = 52; break; } updater.toggleAudio(0); el.id = 'de-panel-audio-off'; return _context5.abrupt("return"); case 52: if (!nav.isMobile) { _context5.next = 57; break; } _this14._menuToggleClickBtn(el); return _context5.abrupt("return"); case 57: if (updater.toggleAudio(0)) { updater.enableUpdater(); el.id = 'de-panel-audio-on'; } else { el.id = 'de-panel-audio-off'; } case 58: if (_this14._menu) { _this14._menu.removeMenu(); _this14._menu = null; } return _context5.abrupt("return"); case 60: if (nav.isMobile) { _this14._menuToggleClickBtn(el); } return _context5.abrupt("return"); case 62: _context5.next = 64; return toggleCfg('disabled'); case 64: deWindow.location.reload(); return _context5.abrupt("return"); case 66: return _context5.abrupt("return"); case 67: if (!Cfg.expandPanel) { clearTimeout(_this14._hideTO); $show(_this14._buttons); } _context5.t2 = el.id; _context5.next = _context5.t2 === 'de-panel-cfg' ? 71 : _context5.t2 === 'de-panel-hid' ? 73 : _context5.t2 === 'de-panel-fav' ? 75 : _context5.t2 === 'de-panel-vid' ? 77 : _context5.t2 === 'de-panel-goback' ? 79 : _context5.t2 === 'de-panel-gonext' ? 81 : _context5.t2 === 'de-panel-maskimg' ? 83 : _context5.t2 === 'de-panel-refresh' ? 85 : _context5.t2 === 'de-panel-savethr' ? 87 : _context5.t2 === 'de-panel-audio-off' ? 87 : 90; break; case 71: KeyEditListener.setTitle(el, 10); return _context5.abrupt("break", 90); case 73: KeyEditListener.setTitle(el, 7); return _context5.abrupt("break", 90); case 75: KeyEditListener.setTitle(el, 6); return _context5.abrupt("break", 90); case 77: KeyEditListener.setTitle(el, 18); return _context5.abrupt("break", 90); case 79: KeyEditListener.setTitle(el, 4); return _context5.abrupt("break", 90); case 81: KeyEditListener.setTitle(el, 17); return _context5.abrupt("break", 90); case 83: KeyEditListener.setTitle(el, 9); return _context5.abrupt("break", 90); case 85: if (!aib.t) { _context5.next = 87; break; } return _context5.abrupt("return"); case 87: if (!(((_this14$_menu = _this14._menu) === null || _this14$_menu === void 0 ? void 0 : _this14$_menu.parentEl) === el)) { _context5.next = 89; break; } return _context5.abrupt("return"); case 89: _this14._menuTO = setTimeout(function () { _this14._menu = Menu.addMenu(el); _this14._menu.onover = function () { return clearTimeout(_this14._hideTO); }; _this14._menu.onout = function () { return _this14._setHideTimeout(null); }; _this14._menu.onremove = function () { return _this14._menu = null; }; }, Cfg.linksOver); case 90: return _context5.abrupt("return"); case 91: _this14._setHideTimeout(nav.fixEventEl(e.relatedTarget)); switch (el.id) { case 'de-panel-refresh': case 'de-panel-savethr': case 'de-panel-audio-off': clearTimeout(_this14._menuTO); } case 93: 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('.tn__item > span[title="Всего постов в треде"]').forEach(function (el) { return el.innerHTML = el.innerHTML.replace(/\d+$/, postCount); }); $Q('.tn__item > span[title="Всего файлов в треде"]').forEach(function (el) { return el.innerHTML = el.innerHTML.replace(/\d+$/, filesCount); }); $Q('.tn__item > span[title="Постеры"]').forEach(function (el) { return el.innerHTML = el.innerHTML.replace(/\d+$/, postersCount); }); } }, _el: null, _hideTO: null, _menu: null, _menuTO: null, 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<svg class=\"de-panel-svg\">\n\t\t\t").concat(id !== 'audio-off' ? "\n\t\t\t\t<use xlink:href=\"#de-symbol-panel-".concat(useId || id, "\"/>") : "\n\t\t\t\t<use class=\"de-use-audio-off\" xlink:href=\"#de-symbol-panel-audio-off\"/>\n\t\t\t\t<use class=\"de-use-audio-on\" xlink:href=\"#de-symbol-panel-audio-on\"/>", "\n\t\t\t</svg>\n\t\t</").concat(tag, ">"); }, _menuToggleClickBtn: function _menuToggleClickBtn(buttonEl) { var _this$_menu; if ((_this$_menu = this._menu) !== null && _this$_menu !== void 0 && _this$_menu.el && this._menu.parentEl === buttonEl) { this._menu.removeMenu(); this._menu = null; return; } this._menu = Menu.addMenu(buttonEl); }, _setHideTimeout: function _setHideTimeout(targetEl) { var _this15 = this; if (!Cfg.expandPanel && !$q('.de-win-active') && !$contains(this._el, targetEl)) { 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); } return _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; }() }]); }(); 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'), "<div id=\"de-win-".concat(name, "\" class=\"").concat(winAttr, "; display: none;\">\n\t\t\t<div class=\"de-win-head\">\n\t\t\t\t<span class=\"de-win-title\">\n\t\t\t\t\t").concat(name === 'cfg' ? 'Dollchan Extension Tools' : Lng.panelBtn[name][lang], "\n\t\t\t\t</span>\n\t\t\t\t<span class=\"de-win-buttons\">\n\t\t\t\t\t<svg class=\"de-win-btn-toggle\"><use xlink:href=\"#de-symbol-win-arrow\"/></svg>\n\t\t\t\t\t<svg class=\"de-win-btn-close\"><use xlink:href=\"#de-symbol-win-close\"/></svg>\n\t\t\t\t</span>\n\t\t\t</div>\n\t\t\t<div class=\"de-win-body\"></div>\n\t\t\t").concat(name !== 'fav' ? '' : "\n\t\t\t\t<div class=\"de-resizer de-resizer-left\"></div>\n\t\t\t\t<div class=\"de-resizer de-resizer-right\"></div>", "\n\t\t</div>")); 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 = "<b>".concat(Lng.noVideoLinks[lang], "</b>"); 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 = "<div de-disableautoplay class=\"de-video-obj\"></div>\n\t<div id=\"de-video-buttons\">\n\t\t<a class=\"de-abtn\" id=\"de-video-btn-prev\" href=\"#\" title=\"".concat(Lng.prevVideo[lang], "\">◀</a>\n\t\t<a class=\"de-abtn\" id=\"de-video-btn-resize\" href=\"#\" title=\"").concat(Lng.expandVideo[lang], "\"></a>\n\t\t<a class=\"de-abtn\" id=\"de-video-btn-next\" href=\"#\" title=\"").concat(Lng.nextVideo[lang], "\">▶</a>\n\t\t<a class=\"de-abtn\" id=\"de-video-btn-hide\" href=\"#\" title=\"").concat(Lng.hideLnkList[lang], "\">▲</a>\n\t</div>"); var linkList = $add("<div id=\"de-video-list\" style=\"max-width: ".concat(+Cfg.YTubeWidth + 40, "px; max-height: ").concat(nav.viewportHeight() * 0.92 - +Cfg.YTubeHeigh - 82, "px;\"></div>")); 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, "<div class=\"de-entry ".concat(aib.cReply, "\">\n\t\t<a class=\"de-video-refpost\" title=\">>").concat(num, "\" de-num=\"").concat(num, "\">>></a>\n\t</div>")).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, "<div class=\"de-fold-block\"><input type=\"checkbox\"><b>/".concat(board, "</b></div>")); 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', "<div class=\"de-entry ".concat(aib.cReply, "\" info=\"").concat(board, ";").concat(tNum, "\">\n\t\t\t\t\t\t\t<input type=\"checkbox\">\n\t\t\t\t\t\t\t<a href=\"").concat(aib.getThrUrl(board, tNum), "\" target=\"_blank\">").concat(tNum, "</a>\n\t\t\t\t\t\t\t<div class=\"de-entry-title\">- ").concat(threads[tNum][2], "</div>\n\t\t\t\t\t\t</div>")); } } }, _ret; for (var board in boards) { _ret = _loop(); if (_ret === 0) continue; } } $bEnd(winBody, (!hasThreads ? "<center><b>".concat(Lng.noHidThr[lang], "</b></center>") : '') + '<div id="de-hid-buttons"></div>').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 'closed': 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]; if (Array.isArray(value)) { $toggle(newEl, value[1]); $toggle(youEl, value[2]); oldEl.textContent = value[0]; newEl.textContent = value[1]; youEl.textContent = value[2]; } if (mode === 'error' || mode === 'closed') { iconEl.firstElementChild.setAttribute('class', 'de-fav-inf-icon ' + (mode === 'closed' ? 'de-fav-closed' : 'de-fav-unavail')); iconEl.title = value; return; } else if (mode === 'update') { iconEl.firstElementChild.setAttribute('class', 'de-fav-inf-icon'); iconEl.removeAttribute('title'); } } function remove404Favorites(_x8) { return _remove404Favorites.apply(this, arguments); } function _remove404Favorites() { _remove404Favorites = _asyncToGenerator(_regeneratorRuntime().mark(function _callee53(favObj) { var els, len, i, el, host, board, num; return _regeneratorRuntime().wrap(function _callee53$(_context61) { while (1) switch (_context61.prev = _context61.next) { case 0: els = $Q('.de-entry[de-removed]'); len = els.length; if (len) { _context61.next = 4; break; } return _context61.abrupt("return"); case 4: if (favObj) { _context61.next = 8; break; } _context61.next = 7; return readFavorites(); case 7: favObj = _context61.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); Thread.removeSavedData(board, num); } saveRenewFavorites(favObj); case 10: case "end": return _context61.stop(); } }, _callee53); })); 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 _callee54(needClear404) { var isUpdate, favObj, myPosts, parentEl, entryEls, i, len, _entry$last$match, entryEl, _ref60, 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 _callee54$(_context62) { while (1) switch (_context62.prev = _context62.next) { case 0: isUpdate = false; _context62.next = 3; return readFavorites(); case 3: favObj = _context62.sent; myPosts = JSON.parse(locStorage['de-myposts'] || '{}'); parentEl = $q('.de-fav-table'); entryEls = $Q('.de-entry'); i = 0, len = entryEls.length; case 8: if (!(i < len)) { _context62.next = 90; break; } entryEl = entryEls[i]; _ref60 = _toConsumableArray(entryEl.lastElementChild.children), titleEl = _ref60[0], youEl = _ref60[1], newEl = _ref60[2], totalEl = _ref60[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')) { _context62.next = 19; break; } return _context62.abrupt("continue", 87); case 19: if (!(host !== aib.host || entry.err === 'Closed')) { _context62.next = 41; break; } if (!needClear404) { _context62.next = 40; 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]; _context62.prev = 26; _context62.next = 29; return $ajax(url, null, true); case 29: iconEl.setAttribute('class', oldClassName); if (oldTitle) { titleEl.title = oldTitle; } else { titleEl.removeAttribute('title'); } if (entry.err && entry.err !== 'Closed') { delete entry.err; isUpdate = true; } _context62.next = 40; break; case 34: _context62.prev = 34; _context62.t0 = _context62["catch"](26); if (!(_context62.t0 instanceof AjaxError) || _context62.t0.code === 0) { $popup('fav-refresh', Lng.noConnect[lang]); } else if (_context62.t0.code === 404) { entryEl.setAttribute('de-removed', ''); } iconEl.setAttribute('class', 'de-fav-inf-icon de-fav-unavail'); titleEl.title = entry.err = getErrorMessage(_context62.t0); isUpdate = true; case 40: return _context62.abrupt("continue", 87); case 41: formEl = void 0, isArchived = void 0; iconEl.setAttribute('class', 'de-fav-inf-icon de-fav-wait'); titleEl.title = Lng.updating[lang]; _context62.prev = 44; if (!aib.hasArchive) { _context62.next = 54; break; } _context62.next = 48; return ajaxLoad(url, true, false, true); case 48: _yield$ajaxLoad = _context62.sent; _yield$ajaxLoad2 = _slicedToArray(_yield$ajaxLoad, 2); formEl = _yield$ajaxLoad2[0]; isArchived = _yield$ajaxLoad2[1]; _context62.next = 57; break; case 54: _context62.next = 56; return ajaxLoad(url); case 56: formEl = _context62.sent; case 57: _context62.next = 68; break; case 59: _context62.prev = 59; _context62.t1 = _context62["catch"](44); if (!(_context62.t1 instanceof AjaxError) || _context62.t1.code === 0) { $popup('fav-refresh', Lng.noConnect[lang]); } else if (_context62.t1.code === 404) { entryEl.setAttribute('de-removed', ''); } $hide(newEl); $hide(youEl); iconEl.setAttribute('class', 'de-fav-inf-icon de-fav-unavail'); titleEl.title = entry.err = getErrorMessage(_context62.t1); isUpdate = true; return _context62.abrupt("continue", 87); case 68: 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 75: if (!(j < postsLen)) { _context62.next = 84; break; } post = posts[j]; if (!(lastNum >= aib.getPNum(post))) { _context62.next = 79; break; } return _context62.abrupt("continue", 81); case 79: newCount++; if (isPostRefToYou(post, myPosts[board])) { youCount++; } case 81: ++j; _context62.next = 75; break; case 84: 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 87: ++i; _context62.next = 8; break; case 90: AjaxCache.clearCache(); if (needClear404) { if (isUpdate) { remove404Favorites(favObj); } parentEl.classList.remove('de-fav-table-unfold'); } else if (isUpdate) { saveFavorites(favObj); } case 92: case "end": return _context62.stop(); } }, _callee54, null, [[26, 34], [44, 59]]); })); 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 = "<span class=\"de-fav-del-btn\">\n\t\t\t\t<svg><use xlink:href=\"#de-symbol-win-close\"></use></svg>\n\t\t\t</span>"; 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 += "<div class=\"de-entry ".concat(aib.cReply, "\" ").concat(hb, " de-num=\"").concat(tNum, "\" de-url=\"").concat(entry.url, "\">\n\t\t\t\t\t").concat(delBtn, "\n\t\t\t\t\t<a class=\"de-fav-link\" title=\"").concat(Lng.goToThread[lang], "\" ").concat(hb) + " href=\"".concat(favLinkHref, "\" rel=\"noreferrer\">").concat(tNum, "</a>\n\t\t\t\t\t<div class=\"de-entry-title\">- ").concat(entry.txt, "</div>\n\t\t\t\t\t<div class=\"de-fav-inf\">\n\t\t\t\t\t\t<span class=\"de-fav-inf-iwrap\" ").concat(favInfIwrapTitle, ">\n\t\t\t\t\t\t\t<svg class=\"de-fav-inf-icon ").concat(favInfIconClass, "\">\n\t\t\t\t\t\t\t\t<use class=\"de-fav-closed-use\" xlink:href=\"#de-symbol-closed\"/>\n\t\t\t\t\t\t\t\t<use class=\"de-fav-unavail-use\" xlink:href=\"#de-symbol-unavail\"/>\n\t\t\t\t\t\t\t\t<use class=\"de-fav-wait-use\" xlink:href=\"#de-symbol-wait\"/>\n\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<span class=\"de-fav-inf-you\" title=\"").concat(Lng.myPostsRep[lang], "\"").concat(favInfYouDisp, ">\n\t\t\t\t\t\t\t").concat(entry.you || 0, "</span>\n\t\t\t\t\t\t<span class=\"de-fav-inf-new\" title=\"").concat(Lng.newPosts[lang], "\"").concat(favInfNewDisp, ">\n\t\t\t\t\t\t\t").concat(entry["new"] || 0, "</span>\n\t\t\t\t\t\t<span class=\"de-fav-inf-total\" title=\"").concat(Lng.totalPosts[lang], "\">").concat(entry.cnt, "</span>\n\t\t\t\t\t\t<span class=\"de-fav-inf-page\" title=\"").concat(Lng.thrPage[lang], "\"></span>\n\t\t\t\t\t</div>\n\t\t\t\t</div>"); } if (!innerHtml) { continue; } var isHide = threads.hide === undefined ? host !== aib.host : threads.hide; html += "<div class=\"de-fold-block".concat(host === aib.host && board === aib.b ? ' de-fav-current' : '', "\">\n\t\t\t\t<div class=\"de-fav-header\">\n\t\t\t\t\t").concat(delBtn, "\n\t\t\t\t\t<a class=\"de-fav-header-link\" title=\"").concat(Lng.goToBoard[lang], "\"") + " href=\"".concat(threads.url, "\" rel=\"noreferrer\">").concat(host, "/").concat(board, "</a>\n\t\t\t\t\t<a class=\"de-abtn de-fav-header-btn\" title=\"").concat(Lng.toggleEntries[lang], "\"") + " href=\"#\">".concat(isHide ? '▼' : '▲', "</a>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"de-fav-entries").concat(isHide ? ' de-fav-entries-hide' : '', "\" ").concat(hb, ">\n\t\t\t\t\t").concat(innerHtml, "\n\t\t\t\t</div>\n\t\t\t</div>"); } } if (html) { $bEnd(winBody, "<div class=\"de-fav-table\">".concat(html, "</div>")).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', "<center><b>".concat(Lng.noFavThr[lang], "</b></center>")); } var btns = $bEnd(winBody, '<div id="de-fav-buttons"></div>'); 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, '<div id="de-fav-del-confirm" style="display: none;"></div>'); 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, "<div id=\"de-cfg-bar\">".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'), "</div><div id=\"de-cfg-buttons\">").concat(this._getSel('language'), "</div>")); 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', "<b>".concat(Lng.globalCfg[lang], ":</b>")); $bEnd(el, "<div id=\"de-list\"><input type=\"button\" value=\"".concat(Lng.load[lang], "\"> ").concat(Lng.loadGlobal[lang], "</div>")).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, "<div id=\"de-list\"><input type=\"button\" value=\"".concat(Lng.save[lang], "\"> ").concat(Lng.saveGlobal[lang], "</div>")).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', "<hr><small>".concat(Lng.descrGlobal[lang], "</small>")); }) : '', !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', "<b>".concat(Lng.fileImpExp[lang], ":</b><hr><!--\n\t\t\t\t\t--><div class=\"de-list\">").concat(Lng.fileToData[lang], ":<div class=\"de-depend\"><!--\n\t\t\t\t\t\t--><input type=\"file\" accept=\".json\" id=\"de-import-file\"></div></div><hr><!--\n\t\t\t\t\t--><div class=\"de-list\"><a id=\"de-export-file\" href=\"#\">").concat(Lng.dataToFile[lang], ":<!--\n\t\t\t\t\t--><div class=\"de-depend\">").concat(list, "</div></div>")); $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', "<b>".concat(Lng.resetData[lang], ":</b><hr>") + "<div class=\"de-list\"><b>".concat(aib.domain, ":</b>").concat(_this18._getList([Lng.panelBtn.cfg[lang], Lng.hidPostThr[lang], Lng.myPosts[lang]]), "</div><hr>") + "<div class=\"de-list\"><b>".concat(Lng.allDomains[lang], ":</b>").concat(_this18._getList([Lng.panelBtn.cfg[lang], Lng.panelBtn.fav[lang]]), "</div><hr>")).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, _el4, _info2, _post4, img, _iterator4, _step4, _el5, 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;) { _el4 = _step3.value.el; processImgInfoLinks(_el4, 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;) { _el5 = _step4.value.el; processImgInfoLinks(_el5, 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: Pages.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] + ':<textarea readonly class="de-editor"></textarea>').lastChild.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._menuTO = setTimeout(function () { return Menu.addMenu(el); }, Cfg.linksOver); return _context16.abrupt("break", 204); case 203: clearTimeout(el._menuTO); 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 _el6 = els[i]; var _info4 = _el6.getAttribute('info'); if (_el6.tagName.toLowerCase() === 'input') { if (_el6.type === 'checkbox') { _el6.checked = !!Cfg[_info4]; } else { _el6.value = Cfg[_info4]; } } else { _el6.selectedIndex = Cfg[_info4]; } } }, _getCfgFilters: function _getCfgFilters() { return "<div id=\"de-cfg-filters\" class=\"de-cfg-unvis\">\n\t\t\t<div id=\"de-spell-panel\">\n\t\t\t\t".concat(this._getBox('hideBySpell'), "\n\t\t\t\t<a id=\"de-btn-spell-add\" class=\"de-abtn de-spell-btn\" href=\"#\">").concat(Lng.add[lang], "</a>\n\t\t\t\t<a id=\"de-btn-spell-apply\" class=\"de-abtn de-spell-btn\" href=\"#\">").concat(Lng.apply[lang], "</a>\n\t\t\t\t<a id=\"de-btn-spell-clear\" class=\"de-abtn de-spell-btn\" href=\"#\">").concat(Lng.clear[lang], "</a>\n\t\t\t\t<a class=\"de-abtn de-spell-btn\" href=\"").concat(gitWiki, "Spells-") + "".concat(lang ? 'en' : 'ru', "\" target=\"_blank\">[?]</a>\n\t\t\t</div>\n\t\t\t<div id=\"de-spell-editor\">\n\t\t\t\t<div id=\"de-spell-rowmeter\"></div>\n\t\t\t\t<textarea id=\"de-spell-txt\" wrap=\"off\"></textarea>\n\t\t\t</div>\n\t\t\t").concat(this._getBox('sortSpells'), "<br>\n\t\t\t").concat(this._getBox('hideRefPsts'), "<br>\n\t\t\t").concat(this._getBox('nextPageThr'), "<br>\n\t\t\t").concat(this._getSel('delHiddPost'), "\n\t\t</div>"); }, _getCfgPosts: function _getCfgPosts() { return "<div id=\"de-cfg-posts\" class=\"de-cfg-unvis\">\n\t\t\t".concat(localData ? '' : "".concat(this._getBox('ajaxUpdThr'), "\n\t\t\t\t").concat(this._getInp('updThrDelay'), "\n\t\t\t\t<div class=\"de-depend\">\n\t\t\t\t\t").concat(this._getBox('updCount'), "<br>\n\t\t\t\t\t").concat(this._getBox('favIcoBlink'), "<br>\n\t\t\t\t\t").concat('Notification' in deWindow ? this._getBox('desktNotif') + '<br>' : '', "\n\t\t\t\t\t").concat(this._getBox('markNewPosts'), "\n\t\t\t\t</div>"), "\n\t\t\t").concat(this._getBox('markMyPosts'), "<br>\n\t\t\t").concat(!localData ? "".concat(this._getBox('expandTrunc', true), "<br>") : '', "\n\t\t\t").concat(this._getBox('widePosts'), "<br>\n\t\t\t").concat(this._getInp('limitPostMsg', true, 5), "<br>\n\t\t\t").concat(this._getSel('showHideBtn'), "<br>\n\t\t\t").concat(!localData ? this._getSel('showRepBtn') : '', "<br>\n\t\t\t").concat(this._getSel('postBtnsCSS'), "\n\t\t\t").concat(this._getInp('postBtnsBack', false, 8), "<br>\n\t\t\t").concat(!localData ? this._getSel('thrBtns') : '', "<br>\n\t\t\t").concat(this._getSel('noSpoilers'), "<br>\n\t\t\t").concat(this._getBox('noPostNames'), "<br>\n\t\t\t").concat(this._getBox('correctTime', true), "\n\t\t\t").concat(this._getInp('timeOffset', true, 1), "\n\t\t\t<a class=\"de-abtn\" target=\"_blank\" href=\"").concat(gitWiki, "Settings-time-") + "".concat(lang ? 'en' : 'ru', "\">[?]</a>\n\t\t\t<div class=\"de-depend\">\n\t\t\t\t").concat(this._getInp('timePattern', true, 24), "<br>\n\t\t\t\t").concat(this._getInp('timeRPattern', true, 24), "\n\t\t\t</div>\n\t\t</div>"); }, _getCfgImages: function _getCfgImages() { return "<div id=\"de-cfg-images\" class=\"de-cfg-unvis\">\n\t\t\t".concat(this._getSel('expandImgs'), "<br>\n\t\t\t<div class=\"de-depend\">\n\t\t\t\t").concat(this._getBox('imgNavBtns'), "<br>\n\t\t\t\t").concat(this._getBox('imgInfoLink'), "<br>\n\t\t\t\t").concat(this._getSel('resizeImgs'), "<br>\n\t\t\t\t").concat(Post.sizing.dPxRatio > 1 ? this._getBox('resizeDPI') + '<br>' : '', "\n\t\t\t\t").concat(this._getInp('minImgSize')).concat(this._getInp('maxImgSize'), "<br>\n\t\t\t\t").concat(!nav.isMobile ? this._getInp('zoomFactor') : '', "<br>\n\t\t\t\t").concat(this._getBox('webmControl'), "<br>\n\t\t\t\t").concat(this._getBox('webmTitles'), "<br>\n\t\t\t\t").concat(this._getInp('webmVolume'), "<br>\n\t\t\t\t").concat(this._getInp('minWebmWidth'), "\n\t\t\t</div>\n\t\t\t").concat(nav.isPresto ? '' : this._getSel('preLoadImgs', true) + '<br>', "\n\t\t\t").concat(nav.isPresto || aib._4chan ? '' : "<div class=\"de-depend\">\n\t\t\t\t".concat(this._getBox('findImgFile', true), "\n\t\t\t</div>"), "\n\t\t\t").concat(this._getSel('openImgs', true), "<br>\n\t\t\t").concat(this._getBox('imgSrcBtns'), "<br>\n\t\t\t").concat(this._getSel('imgNames'), "<br>\n\t\t\t").concat(this._getInp('maskVisib'), "\n\t\t</div>"); }, _getCfgLinks: function _getCfgLinks() { return "<div id=\"de-cfg-links\" class=\"de-cfg-unvis\">\n\t\t\t".concat(this._getBox('linksNavig', true), "\n\t\t\t<div class=\"de-depend\">\n\t\t\t\t").concat(this._getInp('linksOver'), "\n\t\t\t\t").concat(this._getInp('linksOut'), "<br>\n\t\t\t\t").concat(this._getBox('markViewed'), "<br>\n\t\t\t\t").concat(this._getBox('strikeHidd'), "\n\t\t\t\t<div class=\"de-depend\">").concat(this._getBox('removeHidd'), "</div>\n\t\t\t\t").concat(this._getBox('noNavigHidd'), "\n\t\t\t</div>\n\t\t\t").concat(this._getBox('markMyLinks'), "<br>\n\t\t\t").concat(this._getBox('crossLinks', true), "<br>\n\t\t\t").concat(this._getBox('decodeLinks', true), "<br>\n\t\t\t").concat(this._getBox('insertNum'), "<br>\n\t\t\t").concat(!localData ? "".concat(this._getBox('addOPLink'), "<br>\n\t\t\t\t").concat(this._getBox('addImgs', true), "<br>") : '', "\n\t\t\t<div>\n\t\t\t\t").concat(this._getBox('addMP3', true), "\n\t\t\t\t").concat(this._getBox('addVocaroo', true), "\n\t\t\t</div>\n\t\t\t").concat(this._getSel('embedYTube', true), "\n\t\t\t<div class=\"de-depend\">\n\t\t\t\t").concat(this._getInp('YTubeWidth', false), "\xD7\n\t\t\t\t").concat(this._getInp('YTubeHeigh', false), "(px)<br>\n\t\t\t\t").concat(this._getBox('YTubeTitles', true), "<br>\n\t\t\t\t").concat(this._getInp('ytApiKey', true, 25), "<br>\n\t\t\t\t").concat(this._getBox('addVimeo', true), "\n\t\t\t</div>\n\t\t</div>"); }, _getCfgForm: function _getCfgForm() { return "<div id=\"de-cfg-form\" class=\"de-cfg-unvis\">\n\t\t\t".concat(this._getBox('ajaxPosting', true), "<br>\n\t\t\t").concat(postform.form ? "<div class=\"de-depend\">\n\t\t\t\t".concat(this._getBox('postSameImg'), "<br>\n\t\t\t\t").concat(this._getBox('removeEXIF'), "<br>\n\t\t\t\t").concat(this._getSel('removeFName'), "<br>\n\t\t\t\t").concat(this._getBox('sendErrNotif'), "<br>\n\t\t\t\t").concat(this._getBox('scrAfterRep'), "<br>\n\t\t\t\t").concat(postform.files && !nav.isPresto ? this._getSel('fileInputs') : '', "\n\t\t\t</div>") : '', "\n\t\t\t").concat(postform.form ? this._getSel('addPostForm') + '<br>' : '', "\n\t\t\t").concat(postform.txta ? this._getBox('spacedQuote') + '<br>' : '', "\n\t\t\t").concat(this._getBox('favOnReply'), "<br>\n\t\t\t").concat(postform.subj ? this._getBox('warnSubjTrip') + '<br>' : '', "\n\t\t\t").concat(postform.mail ? "".concat(this._getBox('addSageBtn'), "\n\t\t\t\t").concat(this._getBox('saveSage'), "<br>") : '', "\n\t\t\t").concat(postform.cap ? "".concat(aib.hasAltCaptcha ? "".concat(this._getBox('altCaptcha'), "<br>") : '', "\n\t\t\t\t").concat(!aib.makaba ? "".concat(this._getInp('capUpdTime'), "<br>") : '', "\n\t\t\t\t").concat(this._getSel('captchaLang'), "<br>") : '', "\n\t\t\t").concat(postform.txta ? "".concat(this._getSel('addTextBtns'), "\n\t\t\t\t").concat(!aib._4chan ? this._getBox('txtBtnsLoc') : '', "<br>") : '', "\n\t\t\t").concat(postform.passw ? "".concat(this._getInp('passwValue', false, 9), "\n\t\t\t\t").concat(this._getBox('userPassw'), "<input type=\"button\"") + " id=\"de-cfg-button-pass\" class=\"de-cfg-button\" value=\"".concat(Lng.change[lang], "\"><br>") : '', "\n\t\t\t").concat(postform.name ? "".concat(this._getInp('nameValue', false, 9), "\n\t\t\t\t").concat(this._getBox('userName'), "<br>") : '', "\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</div>"); }, _getCfgCommon: function _getCfgCommon() { return "<div id=\"de-cfg-common\" class=\"de-cfg-unvis\">\n\t\t\t".concat(this._getSel('scriptStyle'), "<br>\n\t\t\t").concat(this._getBox('userCSS'), "\n\t\t\t<a href=\"").concat(gitWiki, "css-tricks\" class=\"de-abtn\" target=\"_blank\">[?]</a><br>\n\t\t\t").concat('animation' in doc.body.style ? this._getBox('animation') + '<br>' : '', "\n\t\t\t").concat(this._getBox('hotKeys'), "\n\t\t\t<input type=\"button\" id=\"de-cfg-button-keys\" class=\"de-cfg-button\" value=\"").concat(Lng.edit[lang], "\">\n\t\t\t<div class=\"de-depend\">").concat(this._getInp('loadPages'), "</div>\n\t\t\t").concat(this._getSel('panelCounter'), "<br>\n\t\t\t").concat(this._getBox('rePageTitle', true), "<br>\n\t\t\t").concat(!localData ? "".concat(this._getBox('inftyScroll'), "<br>\n\t\t\t\t").concat(this._getBox('hideReplies', true), "<br>\n\t\t\t\t").concat(this._getBox('scrollToTop'), "<br>") : '', "\n\t\t\t").concat(this._getBox('saveScroll'), "<br>\n\t\t\t").concat(this._getBox('favFolders'), "<br>\n\t\t\t").concat(this._getSel('favThrOrder'), "<br>\n\t\t\t").concat(this._getBox('favWinOn'), "<br>\n\t\t\t").concat(this._getBox('closePopups'), "\n\t\t</div>"); }, _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 "<div id=\"de-cfg-info\" class=\"de-cfg-unvis\">\n\t\t\t<div style=\"padding-bottom: 10px;\">\n\t\t\t\t<a href=\"".concat(gitWiki, "versions\" target=\"_blank\">v").concat(version, ".").concat(commit) + "".concat(nav.isESNext ? '.es6' : '', "</a> |\n\t\t\t\t<a href=\"https://dollchan.net/extension/\" target=\"_blank\">Homepage</a> |\n\t\t\t\t<a href=\"").concat(gitWiki).concat(lang === 1 ? 'home-en/' : '', "\" target=\"_blank\">Github</a> |\n\t\t\t\t<input type=\"button\" id=\"de-cfg-button-debug\" value=\"") + "".concat(Lng.debug[lang], "\" title=\"").concat(Lng.infoDebug[lang], "\">\n\t\t\t</div>\n\t\t\t<div id=\"de-info-table\">\n\t\t\t\t<div id=\"de-info-stats\">").concat(statsTable, "</div>\n\t\t\t\t<div id=\"de-info-log\">").concat(this._getInfoTable(Logger.getLogData(false), true), "</div>\n\t\t\t</div>\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<div style=\"margin-top: 3px; text-align: center;\">>>\n\t\t\t\t\t<input type=\"button\" id=\"de-cfg-button-updnow\" value=\"").concat(Lng.checkNow[lang], "\">\n\t\t\t\t\t<input type=\"button\" id=\"de-cfg-button-donate\" value=\"Donate\">\n\t\t\t\t<<</div>") : "<div style=\"margin-top: 3px; text-align: center;\">>>\n\t\t\t\t\t<input type=\"button\" id=\"de-cfg-button-donate\" value=\"Donate\">\n\t\t\t\t<<</div>", "\n\t\t</div>"); }, _getBox: function _getBox(id, needReload) { return "<label class=\"de-cfg-label".concat(needReload ? ' de-cfg-needreload' : '', "\">\n\t\t<input class=\"de-cfg-chkbox\" info=\"").concat(id, "\" type=\"checkbox\"> ").concat(Lng.cfg[id][lang], "</label>"); }, _getInfoTable: function _getInfoTable(data, needMs) { return data.map(function (val) { return "<div class=\"de-info-row\">\n\t\t<span class=\"de-info-name\">".concat(val[0], "</span>\n\t\t<span>").concat(val[1] + (needMs ? 'ms' : ''), "</span></div>"); }).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 "<label class=\"de-cfg-label\">\n\t\t<input class=\"de-cfg-inptxt\" info=\"".concat(id, "\" type=\"text\" size=\"").concat(size, "\" value=\"").concat(el.innerHTML, "\">").concat(addText && Lng.cfg[id] ? Lng.cfg[id][lang] : '', "</label>"); }, _getList: function _getList(arr) { return arrTags(arr, '<label class="de-block"><input type="checkbox"> ', '</label>'); }, _getSel: function _getSel(id, needReload) { return "<label class=\"de-cfg-label".concat(needReload ? ' de-cfg-needreload' : '', "\">\n\t\t<select class=\"de-cfg-select\" info=\"").concat(id, "\">").concat(Lng.cfg[id].sel[lang].map(function (val, i) { return "<option value=\"".concat(i, "\">").concat(val, "</option>"); }).join(''), "</select> ").concat(Lng.cfg[id].txt[lang], "</label>"); }, _getTab: function _getTab(id) { return "<div class=\"".concat(aib.cReply, " de-cfg-tab\" info=\"").concat(id, "\">").concat(Lng.cfgTab[id][lang], "</div>"); }, _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++, "<br>"); } 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 html = "<span class=\"de-popup-btn\">".concat(isWait ? '<svg class="de-wait"><use xlink:href="#de-symbol-wait"/></svg>' : "\u2716 ", "</span>").concat(txt.trim()); if (el) { el.innerHTML = html; if (!isWait && Cfg.animation) { $animate(el, 'de-blink'); } } else { el = $bEnd($id('de-wrapper-popup'), "<div class=\"".concat(aib.cReply, " de-popup\" id=\"de-popup-").concat(id, "\">").concat(html, "</div>")); 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; } 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, "<b>".concat(Lng.editor[name][lang], "</b><textarea class=\"de-editor\"></textarea>")); 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, "<div class=\"".concat(aib.cReply, " de-menu\" style=\"position: ").concat(isFixed ? 'fixed' : 'absolute', "; left: 0px; top: 0px; visibility: hidden;\">").concat(html, "</div>")); var cr = parentEl.getBoundingClientRect(); var style = el.style, w = el.offsetWidth, h = el.offsetHeight; this.el = el; style.left = (isFixed ? 0 : deWindow.pageXOffset) + (cr.left + w < Post.sizing.wWidth || w > .8 * 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.parentEl = parentEl; ['mouseover', 'mouseout'].forEach(function (e) { return el.addEventListener(e, _this20, true); }); el.addEventListener('click', this); parentEl.addEventListener('mouseout', this); } return _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': { clearTimeout(this._closeTO); var targetEl = nav.fixEventEl(e.relatedTarget); if (!$contains(this.el, targetEl)) { if (isOverEvent) { var _this$onover; (_this$onover = this.onover) === null || _this$onover === void 0 || _this$onover.call(this); } else if (!$contains(this.parentEl, targetEl)) { var _this$onout; this._closeTO = setTimeout(function () { return _this21.removeMenu(); }, 75); (_this$onout = this.onout) === null || _this$onout === void 0 || _this$onout.call(this); } } } } } }, { key: "removeMenu", value: function removeMenu() { var _this$onremove, _this22 = this; if (!this.el) { return; } (_this$onremove = this.onremove) === null || _this$onremove === void 0 || _this$onremove.call(this); ['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: "addMenu", value: function addMenu(el) { var tags = function tags(a) { return arrTags(a, '<span class="de-menu-item">', '</span>'); }; switch (el.id) { case 'de-btn-spell-add': return new Menu(el, "<div style=\"display: inline-block; border-right: 1px solid grey;\">".concat(tags('#words,#exp,#exph,#imgn,#ihash,#subj,#name,#trip,#img,#sage'.split(',')), "</div><div style=\"display: inline-block;\">").concat(tags('#op,#tlen,#all,#video,#vauthor,#num,#wipe,#rep,#outrep,<br>'.split(',')), "</div>"), 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, tags(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, tags($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, tags(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'; }); } } }, { 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 _$q2; 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 "<a class=\"de-menu-item\" href=\"".concat(href, "\" download=\"").concat(name, "\" title=\"").concat(title, "\"").concat(info, " target=\"_blank\">").concat(Lng.saveAs[lang], " "").concat(nameShort, ""</a>"); }; 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 = (_$q2 = $q('.de-webm-title', link.parentNode)) === null || _$q2 === void 0 ? void 0 : _$q2.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")], '<a class="de-menu-item ', '</a>')); } }]); }(); 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) { var _this$cPost; this.enabled = false; (_this$cPost = this.cPost) === null || _this$cPost === void 0 || _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 _this$cPost2; var post = getThread ? Thread.first : Thread.first.op; while (post.top < 1) { var tPost = post.next; if (!tPost) { break; } post = tPost; } (_this$cPost2 = this.cPost) === null || _this$cPost2 === void 0 || _this$cPost2.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; } } return _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, '<label class="de-block">').replace(/%\/l/g, '</label>').replace(/%i([2-4])([0-9]+)(t)?/g, function (all, id1, id2, isText) { var key = keys[+id1][+id2]; allKeys.push(key); return "<input class=\"de-input-key\" type=\"text\" de-id1=\"".concat(id1, "\" de-id2=\"").concat(id2) + "\" size=\"16\" value=\"".concat(KeyEditListener.getStrKey(key)).concat(isText ? '" de-text' : '"', " readonly>"); }), "<input type=\"button\" id=\"de-keys-save\" class=\"de-button\" value=\"").concat(Lng.save[lang], "\">") + "<input type=\"button\" id=\"de-keys-reset\" class=\"de-button\" value=\"".concat(Lng.reset[lang], "\">")]; } }, { 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; } }]); }(); 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.loadFileData(data[0]).then(function (fileData) { 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 = fileData ? 'images/' + safeName : thumbName; parentLink.href = getImgNameLink(el).href = safeName; } if (fileData) { tar.addFile(safeName, fileData); } else { warnings += "<br>".concat(Lng.cantLoad[lang], " <a href=\"").concat(url, "\">").concat(url, "</a>") + "<br>".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) { return tar.addFile(el.src = thumbName, data); }, function () { return el.src = safeName; }); } else if (fileData !== null && fileData !== void 0 && fileData.length) { tar.addFile(el.href = el.src = 'data/' + safeName, fileData); } else { el.remove(); } }); }, _asyncToGenerator(_regeneratorRuntime().mark(function _callee18() { var docName, dcBody, dt, html, title; return _regeneratorRuntime().wrap(function _callee18$(_context19) { while (1) switch (_context19.prev = _context19.next) { case 0: docName = "".concat(aib.domain, "-").concat(delSymbols(aib.b), "-").concat(aib.t); if (imgOnly) { _context19.next = 24; break; } $q('head', dc).insertAdjacentHTML('beforeend', '<script type="text/javascript" src="data/dollscript.js" charset="utf-8"></script>'); 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 }), ");")); dt = doc.doctype; html = dc.outerHTML; if (!aib._4chan) { _context19.next = 23; break; } html = html.replace('</head>', "<style type=\"text/css\">\n\t\t\t\t\t\t.bfl { background-image: url(data/flags-pol.png); }\n\t\t\t\t\t\t.flag { background-image: url(data/flags-country.png); }\n\t\t\t\t\t</style></head>"); _context19.t0 = tar; _context19.next = 15; return _this25.loadFileData('//s.4cdn.org/image/flags.8.png', false); case 15: _context19.t1 = _context19.sent; _context19.t0.addFile.call(_context19.t0, 'data/flags-country.png', _context19.t1); if (!(aib.b === 'pol')) { _context19.next = 23; break; } _context19.t2 = tar; _context19.next = 21; return _this25.loadFileData('//s.4cdn.org/image/flags/pol/flags.png?2', false); case 21: _context19.t3 = _context19.sent; _context19.t2.addFile.call(_context19.t2, 'data/flags-pol.png', _context19.t3); case 23: tar.addString(docName + '.html', "<!DOCTYPE ".concat(dt.name).concat(dt.publicId ? " PUBLIC \"".concat(dt.publicId, "\"") : dt.systemId ? ' SYSTEM' : '').concat(dt.systemId ? " \"".concat(dt.systemId, "\"") : '', ">").concat(html)); case 24: 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; case 28: case "end": return _context19.stop(); } }, _callee18); }))); 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], ":<br><progress ") + "id=\"de-loadprogress\" value=\"0\" max=\"".concat(count, "\"></progress> <span>1</span>/").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.loadFileData(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.loadFileData(el.src); } }, loadFileData: function loadFileData(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 ? _this26.loadFileData(url, false) : null; }); }, preloadImages: function preloadImages(data) { var _this27 = 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 _this27.loadFileData(data[0]).then(function (fileData) { var _data4 = _slicedToArray(data, 6), url = _data4[0], parentLink = _data4[1], iType = _data4[2], isRepToOrig = _data4[3], el = _data4[4], isVideo = _data4[5]; if (fileData) { 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([fileData], { type: iType })); if (isVideo) { el.setAttribute('de-video', ''); } if (isRepToOrig) { el.src = parentLink.href; } if (rarJpgFinder) { rarJpgFinder.runWorker(fileData.buffer, [fileData.buffer], function (info) { return _this27._addImgFileIcon(nameLink, fName, info); }); } } if (_this27.popupId) { $popup(_this27.popupId, "".concat(Lng.loadImage[lang], ": ").concat(cImg, "/").concat(len), true); } cImg++; }); }, function () { _this27.isLoading = false; if (_this27.afterFn) { _this27.afterFn(); _this27.afterFn = _this27.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', "<a href=\"".concat(deWindow.URL.createObjectURL(new Blob([nav.getUnsafeUint8Array(info.data, info.idx)], { type: ['application/x-7z-compressed', 'application/zip', 'application/x-rar-compressed', 'audio/ogg', 'audio/mpeg'][type] })), "\" class=\"de-img-").concat(type > 2 ? 'audio' : 'arch', "\" title=\"").concat(Lng.downloadFile[lang], "\" download=\"").concat(cutFileExt(fName), ".").concat(ext, "\">.").concat(ext, "</a>")); }, _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; } } return _createClass(DateTime, [{ key: "genRFunc", value: function genRFunc(rPattern) { var _this28 = this; return function (dtime) { return rPattern.replace('_o', (_this28.diff < 0 ? '' : '+') + _this28.diff).replace('_s', function () { return _this28.pad2(dtime.getSeconds()); }).replace('_i', function () { return _this28.pad2(dtime.getMinutes()); }).replace('_h', function () { return _this28.pad2(dtime.getHours()); }).replace('_d', function () { return _this28.pad2(dtime.getDate()); }).replace('_w', function () { return _this28.arrW[dtime.getDay()]; }).replace('_n', function () { return _this28.pad2(dtime.getMonth() + 1); }).replace('_m', function () { return _this28.arrM[dtime.getMonth()]; }).replace('_M', function () { return _this28.arrFM[dtime.getMonth()]; }).replace('_y', function () { return ('' + dtime.getFullYear()).substring(2); }).replace('_Y', function () { return dtime.getFullYear(); }); }; } }, { key: "getRPattern", value: function getRPattern(txt) { var _this$onRPat; 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; } (_this$onRPat = this.onRPat) === null || _this$onRPat === void 0 || _this$onRPat.call(this, rPattern); this.genDateTime = this.genRFunc(rPattern); return true; } }, { key: "fix", value: function fix(txt) { var _this29 = 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 (_this29.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() + _this29.diff); return _this29.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 _callee19(el) { return _regeneratorRuntime().wrap(function _callee19$(_context20) { while (1) switch (_context20.prev = _context20.next) { case 0: if (!(el.checked && (!/^[+-]\d{1,2}$/.test(Cfg.timeOffset) || DateTime.checkPattern(Cfg.timePattern)))) { _context20.next = 5; break; } $popup('err-correcttime', Lng.cTimeError[lang]); _context20.next = 4; return CfgSaver.save('correctTime', 0); case 4: el.checked = false; case 5: case "end": return _context20.stop(); } }, _callee19); })); function toggleSettings(_x13) { return _toggleSettings.apply(this, arguments); } return toggleSettings; }() }]); }(); 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; } } return _createClass(Videos, [{ key: "player", get: function get() { var post = this.post; var value = $bBegin(post.msg, "<div class=\"de-video-obj".concat(post.images.hasAttachments && !post.isOp ? ' de-video-obj-inline' : '', "\"></div>")); 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, "<p class=\"de-video-ext\"><a class=\"de-video-link ".concat(isYtube ? 'de-ytube' : 'de-vimeo').concat(time ? '" de-time="' + time : '', "\" href=\"").concat(src, "\">").concat(dataObj ? '' : src, "</a></p>")).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, "<img id=\"de-video-thumb-floated\" src=\"https://i.ytimg.com/vi/".concat(linkEl.videoInfo[1], "/0.jpg\">")); } 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 = "<a class=\"de-video-player\" href=\"".concat(aib.protocol); if (isYtube) { el.innerHTML = "".concat(str, "//www.youtube.com/watch?v=").concat(m[1], "\" target=\"_blank\">") + "<img class=\"de-video-thumb de-ytube\" src=\"https://i.ytimg.com/vi/".concat(m[1], "/0.jpg\"></a>"); return; } el.innerHTML = "".concat(str, "//vimeo.com/").concat(m[1], "\" target=\"_blank\">") + '<img class="de-video-thumb de-vimeo" src=""></a>'; $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 = "<iframe class=\"de-video-player\" src=\"https://www.youtube.com/embed/".concat(m[1], "?start=") + ((m[2] ? m[2] * 3600 : 0) + (m[3] ? m[3] * 60 : 0) + (m[4] ? +m[4] : 0)) + (enableJsapi ? '&enablejsapi=1' : Cfg.embedYTube === 1 ? '&autoplay=1' : '') + (list ? '&' + list[0] : '') + '" frameborder="0" allowfullscreen></iframe>'; } else { var id = m[1] + (m[2] ? m[2] : ''); txt = "<iframe class=\"de-video-player\" src=\"".concat(aib.protocol, "//player.vimeo.com/video/").concat(id).concat(Cfg.embedYTube === 1 ? '?autoplay=1' : '', "\" frameborder=\"0\" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>"); } el.innerHTML = txt + (enableJsapi ? '' : "<span class=\"de-video-resizer\" title=\"".concat(Lng.expandVideo[lang], "\"></span>")); $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(_ref14, num) { var _ref15 = _slicedToArray(_ref14, 4), link = _ref15[0], isYtube = _ref15[1], videoObj = _ref15[2], id = _ref15[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); }); } }]); }(); 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(); } return _createClass(VideosParser, [{ key: "endParser", value: function endParser() { var _this$_loader; (_this$_loader = this._loader) === null || _this$_loader === void 0 || _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); } } } } }]); }(); 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', "<p><audio src=\"".concat(src, "\" preload=\"none\" controls></audio></p>")); } } else if (!$q("object[FlashVars*=\"".concat(src, "\"]"), el)) { el.insertAdjacentHTML('beforeend', '<object data="' + 'http://junglebook2007.narod.ru/audio/player.swf" type="application/x-shockwave-flash" ' + 'wmode="transparent" width="220" height="16" FlashVars="playerID=1&' + 'bg=0x808080&leftbg=0xB3B3B3&lefticon=0x000000&rightbg=0x808080&' + 'rightbghover=0x999999&rightcon=0x000000&righticonhover=0xffffff&' + 'text=0xffffff&slider=0x222222&track=0xf5f5dc&border=0x666666&' + "loader=0x7fc7ff&loop=yes&autostart=no&soundFile=".concat(src, "\"><br>")); } } } 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', "<iframe class=\"de-vocaroo\" width=\"300\" height=\"48\" src=\"https://vocaroo.com/embed/".concat(getFileName(link.href), "\" frameborder=\"0\"></iframe>")); } }); } } 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 _ref16 = _asyncToGenerator(_regeneratorRuntime().mark(function _callee20(res) { return _regeneratorRuntime().wrap(function _callee20$(_context21) { while (1) switch (_context21.prev = _context21.next) { case 0: if (aib.isAjaxStatusOK(res.status)) { _context21.next = 3; break; } reject(new AjaxError(res.status, res.statusText)); return _context21.abrupt("return"); case 3: _context21.t0 = params.responseType; _context21.next = _context21.t0 === 'arraybuffer' ? 6 : _context21.t0 === 'blob' ? 10 : 14; break; case 6: _context21.next = 8; return res.arrayBuffer(); case 8: res.response = _context21.sent; return _context21.abrupt("break", 17); case 10: _context21.next = 12; return res.blob(); case 12: res.response = _context21.sent; return _context21.abrupt("break", 17); case 14: _context21.next = 16; return res.text(); case 16: res.responseText = _context21.sent; case 17: resolve(res); case 18: case "end": return _context21.stop(); } }, _callee20); })); return function (_x14) { return _ref16.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 (_ref17) { var target = _ref17.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; } return _createClass(AjaxError, [{ key: "toString", value: function toString() { return this.code <= 0 ? String(this.message || Lng.noConnect[lang]) : "HTTP [".concat(this.code, "] ").concat(this.message); } }]); }(); 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 _this30 = this; var _ref18 = this._data.get(url) || {}, hasCacheControl = _ref18.hasCacheControl, params = _ref18.params; var ajaxURL = hasCacheControl === false ? this.fixURL(url) : url; return $ajax(ajaxURL, useCache && params || { useTimeout: true }, aib._4chan).then(function (xhr) { return _this30.saveData(url, xhr) ? xhr : $ajax(_this30.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('</html>') ? 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 _this31 = 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', "<div class=\"de-addpage-wait\"><hr><center style=\"font-size: 1.5em\"><svg class=\"de-wait\">\n\t\t\t\t<use xlink:href=\"#de-symbol-wait\"/></svg>".concat(Lng.loading[lang], "</center></div>")); MyPosts.purge(); this._addingPromise = ajaxLoad(aib.getPageUrl(aib.b, pageNum)).then(function () { var _ref19 = _asyncToGenerator(_regeneratorRuntime().mark(function _callee21(formEl) { var newForm, firstForm, thr, oldLastThr; return _regeneratorRuntime().wrap(function _callee21$(_context22) { while (1) switch (_context22.prev = _context22.next) { case 0: newForm = _this31._addForm(formEl, pageNum); if (!newForm.firstThr) { _context22.next = 16; break; } if (needThreads) { _context22.next = 4; break; } return _context22.abrupt("return", _this31._updateForms(DelForm.last)); case 4: $hide(newForm.el); _context22.next = 7; return _this31._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(); _this31._endAdding(); if (needThreads) { _this31.addPage(needThreads, pageNum + 1); } return _context22.abrupt("return", CancelablePromise.reject(new CancelError())); case 16: _this31._endAdding(); _this31.addPage(); return _context22.abrupt("return", CancelablePromise.reject(new CancelError())); case 19: case "end": return _context22.stop(); } }, _callee21); })); return function (_x15) { return _ref19.apply(this, arguments); }; }()).then(function () { return _this31._endAdding(); })["catch"](function (err) { if (!(err instanceof CancelError)) { $popup('add-page', getErrorMessage(err)); _this31._endAdding(); } }); }, handleEvent: function handleEvent(e) { var needLoad = false; switch (e.type) { case 'mousewheel': needLoad = -('wheelDeltaY' in e ? e.wheelDeltaY : e.wheelDelta) > 0; break; case 'touchmove': needLoad = this._scrollY > e.touches[0].clientY; break; case 'touchstart': this._scrollY = e.touches[0].clientY; break; case 'wheel': needLoad = e.deltaY; break; } if (needLoad) { deWindow.requestAnimationFrame(function () { if (Thread.last.bottom - 150 < Post.sizing.wHeight) { Pages.addPage(); } }); } }, loadPages: function loadPages(count) { var _this32 = this; return _asyncToGenerator(_regeneratorRuntime().mark(function _callee22() { var _iterator5, _step5, form, i, len, first; return _regeneratorRuntime().wrap(function _callee22$(_context23) { while (1) switch (_context23.prev = _context23.next) { case 0: $popup('load-pages', Lng.loading[lang], true); if (_this32._addingPromise) { _this32._addingPromise.cancelPromise(); _this32._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) { _context23.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)) { _context23.next = 17; break; } return _context23.abrupt("break", 20); case 17: form.el.remove(); case 18: _context23.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)) { _context23.next = 38; break; } _context23.prev = 23; _context23.t0 = _this32; _context23.next = 27; return ajaxLoad(aib.getPageUrl(aib.b, i)); case 27: _context23.t1 = _context23.sent; _context23.t2 = i; _context23.t0._addForm.call(_context23.t0, _context23.t1, _context23.t2); _context23.next = 35; break; case 32: _context23.prev = 32; _context23.t3 = _context23["catch"](23); $popup('load-pages', getErrorMessage(_context23.t3)); case 35: ++i; _context23.next = 22; break; case 38: first = DelForm.first; if (!(first !== DelForm.last)) { _context23.next = 45; break; } DelForm.first = first.next; first.el.remove(); _context23.next = 44; return _this32._updateForms(DelForm.first); case 44: closePopup('load-pages'); case 45: case "end": return _context23.stop(); } }, _callee22, null, [[23, 32]]); }))(); }, toggleInfinityScroll: function toggleInfinityScroll() { var _this33 = this; if (aib.t) { return; } if (nav.isMobile) { ['touchmove', 'touchstart'].forEach(function (e) { return doc.defaultView[Cfg.inftyScroll ? 'addEventListener' : 'removeEventListener'](e, _this33); }); } else { doc.defaultView[Cfg.inftyScroll ? 'addEventListener' : 'removeEventListener']('onwheel' in doc.defaultView ? 'wheel' : 'mousewheel', this); } }, _addingPromise: null, _isAdding: false, _scrollY: 0, _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', "<div class=\"de-page-num\">\n\t\t\t\t<center style=\"font-size: 2em\">".concat(Lng.page[lang], " ").concat(pageNum, "</center><hr></div>")); } $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 _callee23() { return _regeneratorRuntime().wrap(function _callee23$(_context24) { while (1) switch (_context24.prev = _context24.next) { case 0: _context24.t0 = readPostsData; _context24.t1 = newForm.firstThr.op; _context24.next = 4; return readFavorites(); case 4: _context24.t2 = _context24.sent; (0, _context24.t0)(_context24.t1, _context24.t2); if (!postform.passw) { _context24.next = 9; break; } _context24.next = 9; return PostForm.setUserPassw(); case 9: embedPostMsgImages(newForm.el); if (HotKeys.enabled) { HotKeys.clearCPost(); } case 11: case "end": return _context24.stop(); } }, _callee23); }))(); } }; 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 _this34 = this; return _asyncToGenerator(_regeneratorRuntime().mark(function _callee24() { var inputEl, value, checkboxEl, spells, idx, isAdded, scope, sScope, sArg; return _regeneratorRuntime().wrap(function _callee24$(_context25) { while (1) switch (_context25.prev = _context25.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 && _this34.parseText(value); if (!(!value || spells)) { _context25.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) { _context25.next = 16; break; } _context25.next = 13; return CfgSaver.save('hideBySpell', 1); case 13: if (checkboxEl) { checkboxEl.checked = true; } _context25.next = 20; break; case 16: if (!(!spells[1] && !spells[2] && !spells[3])) { _context25.next = 20; break; } _context25.next = 19; return CfgSaver.save('hideBySpell', 0); case 19: if (checkboxEl) { checkboxEl.checked = false; } case 20: if (spells[1] && Cfg.sortSpells) { _this34._sort(spells[1]); } _context25.next = 23; return CfgSaver.save('spells', JSON.stringify(spells)); case 23: _context25.next = 25; return _this34.setSpells(spells, true); case 25: if (inputEl) { inputEl.value = _this34.list; } Pview.updatePosition(true); return _context25.abrupt("return"); case 28: if (checkboxEl) { checkboxEl.checked = false; } case 29: case "end": return _context25.stop(); } }, _callee24); }))(); }, 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 _ref20 = wipeMsg || [], _ref21 = _slicedToArray(_ref20, 2), msgBit = _ref21[0], msgData = _ref21[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 _this35 = this; return _asyncToGenerator(_regeneratorRuntime().mark(function _callee25() { var value, configurable; return _regeneratorRuntime().wrap(function _callee25$(_context26) { while (1) switch (_context26.prev = _context26.next) { case 0: value = null; configurable = true; Object.defineProperties(_this35, { hiders: { configurable: configurable, value: value }, outreps: { configurable: configurable, value: value }, reps: { configurable: configurable, value: value } }); _context26.next = 5; return CfgSaver.save('hideBySpell', 0); case 5: case "end": return _context26.stop(); } }, _callee25); }))(); }, 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 _this36 = this; return _asyncToGenerator(_regeneratorRuntime().mark(function _callee26() { var sRunner, post; return _regeneratorRuntime().wrap(function _callee26$(_context27) { while (1) switch (_context27.prev = _context27.next) { case 0: if (sync) { _this36._sync(spells); } if (Cfg.hideBySpell) { _context27.next = 6; break; } SpellsRunner.unhideAll(); _context27.next = 5; return _this36.disableSpells(); case 5: return _context27.abrupt("return"); case 6: _this36._optimize(spells); if (_this36.hiders) { _context27.next = 10; break; } SpellsRunner.unhideAll(); return _context27.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 _context27.stop(); } }, _callee26); }))(); }, toggle: function toggle() { var _this37 = this; return _asyncToGenerator(_regeneratorRuntime().mark(function _callee27() { var spells, inputEl, value; return _regeneratorRuntime().wrap(function _callee27$(_context28) { while (1) switch (_context28.prev = _context28.next) { case 0: inputEl = $id('de-spell-txt'); value = inputEl.value; if (!(value && (spells = _this37.parseText(value)))) { _context28.next = 10; break; } closePopup('err-spell'); _context28.next = 6; return _this37.setSpells(spells, true); case 6: _context28.next = 8; return CfgSaver.save('spells', JSON.stringify(spells)); case 8: inputEl.value = _this37.list; return _context28.abrupt("return"); case 10: if (value) { _context28.next = 18; break; } closePopup('err-spell'); SpellsRunner.unhideAll(); _context28.next = 15; return _this37.disableSpells(); case 15: _context28.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 _context28.stop(); } }, _callee27); }))(); }, _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; } return _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; } }]); }(); 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; } } return _createClass(SpellsRunner, [{ key: "endSpells", value: function endSpells() { var _this38 = this; if (this._endPromise) { this._endPromise.then(function () { return _this38._savePostsHelper(); }); } else { this._savePostsHelper(); } } }, { key: "runSpells", value: function runSpells(post) { var _this39 = this; var res = new SpellsInterpreter(post, this._spells).runInterpreter(); if (res instanceof Promise) { res = res.then(function (val) { return _this39._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, _ref22) { var _ref23 = _slicedToArray(_ref22, 3), hasNumSpell = _ref23[0], val = _ref23[1], msg = _ref23[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; } }]); }(); 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; } return _createClass(SpellsInterpreter, [{ key: "runInterpreter", value: function runInterpreter() { var _this40 = 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 _this40._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 _callee28(val) { var _iterator15, _step15, image; return _regeneratorRuntime().wrap(function _callee28$(_context29) { while (1) switch (_context29.prev = _context29.next) { case 0: _iterator15 = _createForOfIteratorHelperLoose(this._post.images); case 1: if ((_step15 = _iterator15()).done) { _context29.next = 14; break; } image = _step15.value; _context29.t0 = image instanceof AttachedImage; if (!_context29.t0) { _context29.next = 10; break; } _context29.next = 7; return ImagesHashStorage.getHash(image); case 7: _context29.t1 = _context29.sent; _context29.t2 = val; _context29.t0 = _context29.t1 === _context29.t2; case 10: if (!_context29.t0) { _context29.next = 12; break; } return _context29.abrupt("return", true); case 12: _context29.next = 1; break; case 14: return _context29.abrupt("return", false); case 15: case "end": return _context29.stop(); } }, _callee28, 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; } }]); }(); var PostForm = function () { function PostForm(form) { var _this41 = 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 _this41.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); } } return _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 _this42 = this; var value = $aEnd(this.subm, '<span id="de-sagebtn"><svg class="de-btn-sage">' + '<use xlink:href="#de-symbol-post-sage"/></svg></span>'); value.onclick = _asyncToGenerator(_regeneratorRuntime().mark(function _callee29() { return _regeneratorRuntime().wrap(function _callee29$(_context30) { while (1) switch (_context30.prev = _context30.next) { case 0: _context30.next = 2; return toggleCfg('sageReply'); case 2: _this42.toggleSage(); case 3: case "end": return _context30.stop(); } }, _callee29); })); Object.defineProperty(this, 'sageBtn', { value: value }); return value; } }, { key: "top", get: function get() { return this.pForm.getBoundingClientRect().top; } }, { key: "addMarkupPanel", value: function addMarkupPanel() { var _this43 = this; var el = $id('de-txt-panel'); if (!Cfg.addTextBtns) { aib.removeMarkupButtons(el); return; } if (!el) { el = $add('<span id="de-txt-panel"></span>'); ['click', 'mouseover'].forEach(function (e) { return el.addEventListener(e, _this43); }); } 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 += "<div id=\"de-btn-".concat(id[i], "\" de-title=\"").concat(Lng.txtBtn[i][lang], "\" de-tag=\"").concat(tag, "\">").concat(mode === 2 ? "".concat(!html ? '[' : '', " <a class=\"de-abtn\" href=\"#\">").concat(val[i], "</a> /") : mode === 3 ? "<button type=\"button\" style=\"font-weight: bold;\">".concat(val[i], "</button>") : "<svg><use xlink:href=\"#de-symbol-markup-".concat(id[i], "\"/></svg>"), "</div>"); } } el.innerHTML = "".concat(html, "<div id=\"de-btn-quote\" de-title=\"").concat(Lng.txtBtn[8][lang], "\" de-tag=\"q\">").concat(mode === 2 ? ' <a class="de-abtn" href="#">></a> ]' : mode === 3 ? '<button type="button" style="font-weight: bold;">></button>' : '<svg><use xlink:href="#de-symbol-markup-quote"/></svg>', "</span>"); } }, { 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 _el7 = el, id = _el7.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 _this$cap; var isError = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; (_this$cap = this.cap) === null || _this$cap === void 0 || _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 _this44 = 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 _ref25 = _asyncToGenerator(_regeneratorRuntime().mark(function _callee30(e) { var data; return _regeneratorRuntime().wrap(function _callee30$(_context31) { while (1) switch (_context31.prev = _context31.next) { case 0: e.preventDefault(); $popup('upload', Lng.sending[lang], true); _context31.prev = 2; _context31.next = 5; return html5Submit(_this44.form, _this44.subm, true); case 5: data = _context31.sent; _context31.next = 8; return checkSubmit(data); case 8: _context31.next = 13; break; case 10: _context31.prev = 10; _context31.t0 = _context31["catch"](2); showSubmitError(_context31.t0); case 13: case "end": return _context31.stop(); } }, _callee30, null, [[2, 10]]); })); return function (_x17) { return _ref25.apply(this, arguments); }; }(); } }, { key: "_initCaptcha", value: function _initCaptcha() { var _this45 = 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() { _this45.cap.addCaptcha(); _this45.cap.updateOutdated(); }; this.txta.addEventListener('focus', updCapFn); if (this.files) { this.files.onchange = updCapFn; } this.form.addEventListener('click', function () { return _this45.cap.addCaptcha(); }, true); } }, { key: "_initFileInputs", value: function _initFileInputs() { var _this46 = 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 !_this46.files.filesCount && _this46.files.clearInputs(); }, 0); }); } }, { key: "_initSubmit", value: function _initSubmit() { var _this47 = this; this.subm.addEventListener('click', function (e) { var _this47$video$value; if (Cfg.warnSubjTrip && _this47.subj && /#.|##./.test(_this47.subj.value)) { e.preventDefault(); $popup('upload', Lng.subjHasTrip[lang]); return; } var val = _this47.txta.value; if (Spells.outreps) { val = Spells.outReplace(val); } if (_this47.tNum && pByNum.get(_this47.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; } } _this47.txta.value = val; _this47.toggleSage(); if (Cfg.ajaxPosting) { $popup('upload', Lng.checking[lang], true); } if (_this47.video && (val = (_this47$video$value = _this47.video.value) === null || _this47$video$value === void 0 ? void 0 : _this47$video$value.match(Videos.ytReg))) { _this47.video.value = 'http://www.youtube.com/watch?v=' + val[1]; } if (_this47.isQuick) { $hide(_this47.pForm); $hide(_this47.qArea); _this47._pBtn[+_this47.isBottom].after(_this47.pForm); } updater.pauseUpdater(); }); } }, { key: "_initTextarea", value: function _initTextarea() { var _this48 = 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 _ref26 = _asyncToGenerator(_regeneratorRuntime().mark(function _callee31(e) { var _e$clipboardData; var files, _iterator20, _step20, file, inputs, i, len, input; return _regeneratorRuntime().wrap(function _callee31$(_context32) { while (1) switch (_context32.prev = _context32.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) { _context32.next = 17; break; } file = _step20.value; inputs = _this48.files._inputs; i = 0, len = inputs.length; case 6: if (!(i < len)) { _context32.next = 15; break; } input = inputs[i]; if (input.hasFile) { _context32.next = 12; break; } _context32.next = 11; return input.addUrlFile(URL.createObjectURL(file), file); case 11: return _context32.abrupt("break", 15); case 12: ++i; _context32.next = 6; break; case 15: _context32.next = 2; break; case 17: case "end": return _context32.stop(); } }, _callee31); })); return function (_x18) { return _ref26.apply(this, arguments); }; }()); if (nav.isFirefox || nav.isWebkit) { el.addEventListener('mouseup', function (_ref27) { var target = _ref27.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, '<div id="de-resizer-text"></div>').addEventListener('mousedown', { _el: el, _elStyle: style, handleEvent: function handleEvent(e) { var _this49 = this; switch (e.type) { case 'mousedown': ['mousemove', 'mouseup'].forEach(function (e) { return doc.body.addEventListener(e, _this49); }); 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, _this49); }); CfgSaver.save('textaWidth', parseInt(this._elStyle.width, 10), 'textaHeight', parseInt(this._elStyle.height, 10)); } } }); } }, { key: "_makeHideableContainer", value: function _makeHideableContainer() { var _this50 = this; (this.pForm = $add('<div id="de-pform" class="de-win-body"></div>')).append(this.form || '', this.oeForm || ''); var html = '<div class="de-parea"><div>[<a href="#"></a>]</div><hr></div>'; 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 _this50.showMainReply(false, e); }; this._pBtn[1].firstElementChild.onclick = function (e) { return _this50.showMainReply(true, e); }; this.qArea = $add("<div style=\"display: none; ".concat(Cfg.replyWinX, "; ").concat(Cfg.replyWinY, "; z-index: ").concat(++topWinZ, ";\" id=\"de-win-reply\" class=\"").concat(aib.cReply + (Cfg.replyWinDrag ? ' de-win' : ' de-win-inpost'), "\"></div>")); this.isBottom = Cfg.addPostForm === 1; this.setReply(false, !aib.t || Cfg.addPostForm > 1); } }, { key: "_makeWindow", value: function _makeWindow() { var _this51 = this; makeDraggable('reply', this.qArea, $aBegin(this.qArea, "<div class=\"de-win-head\">\n\t\t\t<span class=\"de-win-title\"></span>\n\t\t\t<span class=\"de-win-buttons\">\n\t\t\t\t<svg class=\"de-win-btn-clear\"><use xlink:href=\"#de-symbol-unavail\"/></svg>\n\t\t\t\t<svg class=\"de-win-btn-toggle\"><use xlink:href=\"#de-symbol-win-arrow\"/></svg>\n\t\t\t\t<svg class=\"de-win-btn-close\"><use xlink:href=\"#de-symbol-win-close\"/></svg>\n\t\t\t</span>\n\t\t</div>\n\t\t<div class=\"de-resizer de-resizer-top\"></div>\n\t\t<div class=\"de-resizer de-resizer-left\"></div>\n\t\t<div class=\"de-resizer de-resizer-right\"></div>\n\t\t<div class=\"de-resizer de-resizer-bottom\"></div>")); var buttons = $q('.de-win-buttons', this.qArea); buttons.onmouseover = function (_ref28) { var target = _ref28.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 _ref29 = _toConsumableArray(buttons.children), clearBtn = _ref29[0], toggleBtn = _ref29[1], closeBtn = _ref29[2]; clearBtn.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 CfgSaver.save('sageReply', 0); case 2: _this51.toggleSage(); _this51.files.clearInputs(); [_this51.txta, _this51.name, _this51.mail, _this51.subj, _this51.video, _this51.cap && _this51.cap.textEl].forEach(function (el) { return el && (el.value = ''); }); case 5: case "end": return _context33.stop(); } }, _callee32); })); toggleBtn.onclick = _asyncToGenerator(_regeneratorRuntime().mark(function _callee33() { return _regeneratorRuntime().wrap(function _callee33$(_context34) { while (1) switch (_context34.prev = _context34.next) { case 0: _context34.next = 2; return toggleCfg('replyWinDrag'); case 2: if (Cfg.replyWinDrag) { _this51.qArea.className = aib.cReply + ' de-win'; updateWinZ(_this51.qArea); } else { _this51.qArea.className = aib.cReply + ' de-win-inpost'; _this51.txta.focus(); } case 3: case "end": return _context34.stop(); } }, _callee33); })); closeBtn.onclick = function () { return _this51.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 _$q3; (_$q3 = $q('input[name="oek_parent"]', this.oeForm)) === null || _$q3 === void 0 || _$q3.remove(); if (tNum) { this.oeForm.insertAdjacentHTML('afterbegin', "<input type=\"hidden\" value=\"".concat(tNum, "\" name=\"oek_parent\">")); } } if (this.form) { var _$q4; if (aib.changeReplyMode && tNum !== this.tNum) { aib.changeReplyMode(this.form, tNum); } (_$q4 = $q("input[name=\"".concat(aib.formParent, "\"]"), this.form)) === null || _$q4 === void 0 || _$q4.remove(); if (tNum) { this.form.insertAdjacentHTML('afterbegin', "<input type=\"hidden\" name=\"".concat(aib.formParent, "\" value=\"").concat(tNum, "\">")); } } } }], [{ 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 _callee34() { var el; return _regeneratorRuntime().wrap(function _callee34$(_context35) { while (1) switch (_context35.prev = _context35.next) { case 0: el = $q('input[info="nameValue"]'); if (!el) { _context35.next = 4; break; } _context35.next = 4; return CfgSaver.save('nameValue', el.value); case 4: postform.name.value = Cfg.userName ? Cfg.nameValue : ''; case 5: case "end": return _context35.stop(); } }, _callee34); })); function setUserName() { return _setUserName.apply(this, arguments); } return setUserName; }() }, { key: "setUserPassw", value: function () { var _setUserPassw = _asyncToGenerator(_regeneratorRuntime().mark(function _callee35() { var el, value, _iterator21, _step21, passEl; return _regeneratorRuntime().wrap(function _callee35$(_context36) { while (1) switch (_context36.prev = _context36.next) { case 0: if (Cfg.userPassw) { _context36.next = 2; break; } return _context36.abrupt("return"); case 2: el = $q('input[info="passwValue"]'); if (!el) { _context36.next = 6; break; } _context36.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 _context36.stop(); } }, _callee35); })); 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)]; } }]); }(); 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(/<a [^>]+>Назад.+/, '') || 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 _callee55(data) { var error, postNum, isDocument, _aib$captchaAfterSubm, _aib3, _data, _aib$getSubmitData, _postform2, tNum, _pByNum$get3, thr, statsParam, dForm; return _regeneratorRuntime().wrap(function _callee55$(_context63) { while (1) switch (_context63.prev = _context63.next) { case 0: error = null; postNum = null; isDocument = data instanceof Document; if (!aib.getSubmitData) { _context63.next = 12; break; } if (!aib.jsonSubmit) { _context63.next = 9; break; } if (!((_aib$captchaAfterSubm = (_aib3 = aib).captchaAfterSubmit) !== null && _aib$captchaAfterSubm !== void 0 && _aib$captchaAfterSubm.call(_aib3, data))) { _context63.next = 7; break; } return _context63.abrupt("return"); case 7: _data = (isDocument ? data.body.textContent : data).trim(); try { data = JSON.parse(_data); } catch (err) { error = getSubmitError(isDocument ? data : $createDoc(data)); } case 9: if (!error) { _aib$getSubmitData = aib.getSubmitData(data); error = _aib$getSubmitData.error; postNum = _aib$getSubmitData.postNum; } _context63.next = 13; break; case 12: error = getSubmitError(data); case 13: if (!error) { _context63.next = 16; break; } showSubmitError(error); return _context63.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$get3 = pByNum.get(tNum), thr = _pByNum$get3.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]++; _context63.next = 25; return CfgSaver.saveObj(aib.domain, function (loadedCfg) { loadedCfg.stats[statsParam]++; return loadedCfg; }); case 25: if (tNum) { _context63.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 _context63.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 _context63.stop(); } }, _callee55); })); return _checkSubmit.apply(this, arguments); } function checkDelete(_x20) { return _checkDelete.apply(this, arguments); } function _checkDelete() { _checkDelete = _asyncToGenerator(_regeneratorRuntime().mark(function _callee56(data) { var err, els, threads, isThr, i, len, el; return _regeneratorRuntime().wrap(function _callee56$(_context64) { while (1) switch (_context64.prev = _context64.next) { case 0: err = getSubmitError(data instanceof Document ? data : $createDoc(data)); if (!err) { _context64.next = 5; break; } $popup('delete', Lng.errDelete[lang] + ':\n' + err); updater.sendErrNotif(); return _context64.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) { _context64.next = 15; break; } Post.clearMarks(); _context64.next = 13; return Thread.first.loadNewPosts()["catch"](function (err) { return infoLoadErrors(err); }); case 13: _context64.next = 17; break; case 15: _context64.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 _context64.stop(); } }, _callee56); })); 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$(_context37) { while (1) switch (_context37.prev = _context37.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)) { _context37.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')) { _context37.next = 10; break; } return _context37.abrupt("continue", 62); case 10: if (!(tag === 'select')) { _context37.next = 23; break; } options = $Q('select > option, select > optgrout > option', field); j = 0, jlen = options.length; case 13: if (!(j < jlen)) { _context37.next = 21; break; } option = options[j]; if (!(option.selected && !isFormElDisabled(option))) { _context37.next = 18; break; } _context37.next = 18; return { type: type, el: field, name: fixName(name), value: option.value }; case 18: ++j; _context37.next = 13; break; case 21: _context37.next = 51; break; case 23: if (!(tag === 'input')) { _context37.next = 51; break; } _context37.t0 = type; _context37.next = _context37.t0 === 'image' ? 27 : _context37.t0 === 'checkbox' ? 28 : _context37.t0 === 'radio' ? 28 : _context37.t0 === 'file' ? 31 : 51; break; case 27: throw new Error('input[type="image"] is not supported'); case 28: _context37.next = 30; return { type: type, el: field, name: fixName(name), value: field.value || 'on' }; case 30: return _context37.abrupt("continue", 62); case 31: img = void 0; if (!field.files.length) { _context37.next = 43; break; } files = field.files; _j2 = 0, _jlen = files.length; case 35: if (!(_j2 < _jlen)) { _context37.next = 41; break; } _context37.next = 38; return { name: name, type: type, el: field, value: files[_j2] }; case 38: ++_j2; _context37.next = 35; break; case 41: _context37.next = 50; break; case 43: if (!(field.obj && (img = field.obj.imgFile))) { _context37.next = 48; break; } _context37.next = 46; return { name: name, type: type, el: field, value: new File([img.data], img.name, { type: img.type }) }; case 46: _context37.next = 50; break; case 48: _context37.next = 50; return aib.getEmptyFile(field, fixName(name)); case 50: return _context37.abrupt("continue", 62); case 51: if (!(type === 'textarea')) { _context37.next = 56; break; } _context37.next = 54; return { type: type, el: field, name: name || '', value: field.value }; case 54: _context37.next = 58; break; case 56: _context37.next = 58; return { type: type, el: field, name: fixName(name), value: field.value }; case 58: dirname = field.getAttribute('dirname'); if (!dirname) { _context37.next = 62; break; } _context37.next = 62; return { el: field, name: fixName(dirname), type: 'direction', value: nav.matchesSelector(field, ':dir(rtl)') ? 'rtl' : 'ltr' }; case 62: ++i; _context37.next = 3; break; case 65: case "end": return _context37.stop(); } }, _marked); } function getUploadFunc() { $popup('upload', Lng.sending[lang] + '<br><progress id="de-uploadprogress" value="0" max="1" style="display: none; width: 200px;">' + '</progress><div style="display: none; font: bold 12px arial;">' + '<span></span> / <span></span> (<span></span>)</div>', true); var isInited = false; var beginTime = Date.now(); var progress = $id('de-uploadprogress'); var counterWrap = progress.nextElementSibling; var _ref32 = _toConsumableArray(counterWrap.children), counterEl = _ref32[0], totalEl = _ref32[1], speedEl = _ref32[2]; return function (_ref33) { var total = _ref33.total, i = _ref33.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 _callee57(form, submitter) { var needProgress, data, hasFiles, _iterator36, _step36, _step36$value, name, value, type, el, val, _el$obj, fileName, newFileName, mime, cleanData, ajaxParams, url, _args65 = arguments; return _regeneratorRuntime().wrap(function _callee57$(_context65) { while (1) switch (_context65.prev = _context65.next) { case 0: needProgress = _args65.length > 2 && _args65[2] !== undefined ? _args65[2] : false; data = new FormData(); hasFiles = false; _iterator36 = _createForOfIteratorHelperLoose(getFormElements(form, submitter)); case 4: if ((_step36 = _iterator36()).done) { _context65.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')) { _context65.next = 9; break; } return _context65.abrupt("continue", 28); case 9: if (!(type === 'file')) { _context65.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'))) { _context65.next = 26; break; } _context65.t0 = cleanFile; _context65.next = 18; return readFile(value); case 18: _context65.t1 = _context65.sent.data; _context65.t2 = el.obj ? el.obj.extraFile : null; cleanData = (0, _context65.t0)(_context65.t1, _context65.t2); if (cleanData) { _context65.next = 23; break; } return _context65.abrupt("return", Promise.reject(new Error(Lng.fileCorrupt[lang] + ': ' + fileName))); case 23: val = new File(cleanData, newFileName, { type: mime }); _context65.next = 27; break; case 26: if (Cfg.removeFName) { val = new File([value], newFileName, { type: mime }); } case 27: data.append(name, val); case 28: _context65.next = 4; break; case 30: if (!aib.sendHTML5Post) { _context65.next = 32; break; } return _context65.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 _context65.abrupt("return", $ajax(url, ajaxParams).then(function (_ref61) { var text = _ref61.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 _context65.stop(); } }, _callee57); })); 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(); } return _createClass(Files, [{ key: "rarInput", get: function get() { var value = $bEnd(doc.body, '<input type="file" style="display: none;">'); Object.defineProperty(this, 'rarInput', { value: value }); return value; } }, { key: "thumbsEl", get: function get() { var value; if (aib.multiFile) { value = $aEnd(this.fileTr, '<div id="de-file-area"></div>'); } else { value = this._form.txta.closest(aib.qFormTd).previousElementSibling; value.innerHTML = "<div style=\"display: none;\">".concat(value.innerHTML, "</div><div></div>"); 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(); } } }]); }(); 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("<div class=\"de-file-utils\">\n\t\t\t<span class=\"de-file-btn-rar\" title=\"".concat(Lng.helpAddFile[lang], "\" style=\"display: none;\">\n\t\t\t\t<svg><use xlink:href=\"#de-symbol-file-rar\"/></svg></span>\n\t\t\t<input class=\"de-file-spoil\" type=\"checkbox\" title=\"") + "".concat(Lng.spoilFile[lang], "\" style=\"display: none;\">\n\t\t\t<span class=\"de-file-btn-txt\" title=\"").concat(Lng.addManually[lang], "\">\n\t\t\t\t<svg><use xlink:href=\"#de-symbol-file-txt\"/></svg></span>\n\t\t\t<span class=\"de-file-btn-ren\" title=\"").concat(Lng.renameFile[lang], "\" style=\"display: none;\">\n\t\t\t\t<svg><use xlink:href=\"#de-symbol-file-ren\"/></svg></span>\n\t\t\t<span class=\"de-file-btn-del\" title=\"").concat(Lng.removeFile[lang], "\" style=\"display: none;\">\n\t\t\t\t<svg><use xlink:href=\"#de-symbol-file-del\"/></svg></span>\n\t\t</div>")); var _ref34 = _toConsumableArray(this._utils.children); this._btnRar = _ref34[0]; this._btnSpoil = _ref34[1]; this._btnTxt = _ref34[2]; this._btnRen = _ref34[3]; this._btnDel = _ref34[4]; this._utils.addEventListener('click', this); this._txtWrap = $add("<span class=\"de-file-txt-wrap\">\n\t\t\t<input type=\"text\" name=\"de-file-txt\" class=\"de-file-txt-input de-file-txt-noedit\" title=\"" + "".concat(Lng.youCanDrag[lang], "\" placeholder=\"").concat(Lng.dropFileHere[lang], "\">\n\t\t\t<input type=\"button\" class=\"de-file-txt-add\" value=\"+\" title=\"") + "".concat(Lng.add[lang], "\" style=\"display: none;\"></span>")); var _ref35 = _toConsumableArray(this._txtWrap.children); this._txtInput = _ref35[0]; this._txtAddBtn = _ref35[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(); } } return _createClass(FileInput, [{ key: "addUrlFile", value: function () { var _addUrlFile = _asyncToGenerator(_regeneratorRuntime().mark(function _callee36(url) { var _this52 = this; var file, _args38 = arguments; return _regeneratorRuntime().wrap(function _callee36$(_context38) { while (1) switch (_context38.prev = _context38.next) { case 0: file = _args38.length > 1 && _args38[1] !== undefined ? _args38[1] : null; if (url) { _context38.next = 3; break; } return _context38.abrupt("return", Promise.reject(new Error('URL is null'))); case 3: $popup('file-loading', Lng.loading[lang], true); _context38.next = 6; return ContentLoader.loadFileData(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'); _this52._isTxtEditable = _this52._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; } } _this52.imgFile = { data: data.buffer, name: name, type: type || getFileMime(name) }; if (!file) { file = new Blob([data], { type: _this52.imgFile.type }); file.name = name; } _this52._parent._files[_this52._parent._inputs.indexOf(_this52)] = file; DollchanAPI.notify('filechange', _this52._parent._files); if (FileInput._isThumbMode) { $hide(_this52._txtWrap); } _this52._onFileChange(true); }); case 6: return _context38.abrupt("return", _context38.sent); case 7: case "end": return _context38.stop(); } }, _callee36); })); function addUrlFile(_x23) { return _addUrlFile.apply(this, arguments); } return addUrlFile; }() }, { key: "changeMode", value: function changeMode(showThumbs) { var _$q5; $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); (_$q5 = $q('.de-file-txt-area')) === null || _$q5 === void 0 || _$q5.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 _this53 = 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) { _this53._removeFileHelper(); } }); this._parent._files[curInpIdx + i] = el.files[i]; } } else { if (filesLen > 0) { setTimeout(function () { return _this53._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 (_ref36) { var data = _ref36.data; _this53.imgFile = { data: data, name: newName, type: file.type, isCustomName: true }; _this53._removeFileHelper(); if (FileInput._isThumbMode) { _this53._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/') ? '<video class="de-file-img" loop autoplay muted src=""></video>' : '<img class="de-file-img" src="">'); 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 _this54 = this; var el = this._parent.rarInput; el.onchange = function (e) { $hide(_this54._btnRar); var myBtn = _this54._rarMsg = $aBegin(_this54._utils, '<span><svg class="de-wait"><use xlink:href="#de-symbol-wait"/></svg></span>'); var file = e.target.files[0]; readFile(file).then(function (_ref37) { var data = _ref37.data; if (_this54._rarMsg === myBtn) { myBtn.className = 'de-file-rarmsg'; var origFileName = _this54.imgFile ? _this54.imgFile.name : _this54._input.files[0].name; myBtn.title = origFileName + ' + ' + file.name; myBtn.textContent = getFileExt(origFileName) + ' + ' + getFileExt(file.name); _this54.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 _this55 = 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 ? '<tr class="de-file-txt-area"><td class="postblock"></td><td></td></tr>' : '<div class="de-file-txt-area"></div>'); (isTr ? txtArea.lastChild : txtArea).append(this._txtWrap); this._thumb = $bEnd(this._parent.thumbsEl, "<div class=\"de-file de-file-off\"><div class=\"de-file-img\"><div class=\"de-file-img\" title=\"".concat(Lng.youCanDrag[lang], "\"></div></div></div>")); ['click', 'dragenter'].forEach(function (e) { return _this55._thumb.addEventListener(e, _this55); }); 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) { var _this$_parent$onchang, _this$_parent; this._txtInput.value = hasImgFile ? this.imgFile.name : this._input.files[0].name; if (!hasImgFile) { this.imgFile = null; } (_this$_parent$onchang = (_this$_parent = this._parent).onchange) === null || _this$_parent$onchang === void 0 || _this$_parent$onchang.call(_this$_parent); 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 _this56 = 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 (_ref38) { var data = _ref38.data; if (_this56._input.files[0] === file) { _this56._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 _this57 = this; var name = isAdd ? 'addEventListener' : 'removeEventListener'; el[name]('dragover', function (e) { return e.preventDefault(); }); ['dragenter', 'dragleave', 'drop'].forEach(function (e) { return el[name](e, _this57); }); } }], [{ key: "_isThumbMode", get: function get() { return Cfg.fileInputs === 2; } }, { key: "_readDroppedFile", value: function _readDroppedFile(inputObj, file) { return readFile(file).then(function (_ref39) { var data = _ref39.data; inputObj.imgFile = { data: data, name: file.name, type: file.type }; inputObj.showInp(); inputObj._onFileChange(true); }); } }]); }(); 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 = ''; } } return _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', "<div id=\"g-recaptcha\" class=\"g-recaptcha\" data-sitekey=\"".concat(el.getAttribute('data-sitekey'), "\"></div>")); 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 _this58 = this; var initPromise = aib.captchaInit ? aib.captchaInit(this) : null; if (initPromise) { initPromise.then(function () { return _this58.showCaptcha(); }, function (err) { if (err instanceof AjaxError) { _this58._setUpdateError(err); } else { _this58.hasCaptcha = false; } }); } else if (this.hasCaptcha) { this.showCaptcha(true); } } }, { key: "initImage", value: function initImage(img) { var _this59 = 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 _this59.refreshCaptcha(true); }; } }, { key: "initTextEl", value: function initTextEl() { var _this60 = 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 _this60.textEl.addEventListener(e, _this60); }); 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 _this61 = 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 _this61._updateTextEl(isFocus); }, function (err) { return _this61._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 _this62 = this; if (e) { this.parentEl.innerHTML = e.toString(); this.isAdded = false; this.parentEl.onclick = function () { _this62.parentEl.onclick = null; _this62.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(); } } } }]); }(); 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._linkTO = null; this._menu = null; this._menuTO = null; } return _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, '<div class="de-mp3"></div>'); 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$(_context39) { while (1) switch (_context39.prev = _context39.next) { case 0: links = $Q('a', this.msg); i = 0, len = links.length; case 2: if (!(i < len)) { _context39.next = 12; break; } link = links[i]; tc = link.textContent; if (!(tc[0] !== '>' || tc[1] !== '>' || !(lNum = parseInt(tc.substr(2), 10)))) { _context39.next = 7; break; } return _context39.abrupt("continue", 9); case 7: _context39.next = 9; return [link, lNum]; case 9: ++i; _context39.next = 2; break; case 12: case "end": return _context39.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, _el$textContent$match, _this63 = 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 && el.classList.contains('de-menu-item')) { 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; var text = el.textContent; 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(text)) { 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); } } else if (text === '№') { var _pByNum$get; (_pByNum$get = pByNum.get(+el.href.match(/#(\d+)/)[1])) === null || _pByNum$get === void 0 || _pByNum$get.selectAndScrollTo(); } else if (nav.isMobile) { break; } else if (text[0] === '>' && text[1] === '>' && !text[2].includes('/')) { var _pByNum$get2; (_pByNum$get2 = pByNum.get(+text.match(/\d+/))) === null || _pByNum$get2 === void 0 || _pByNum$get2.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': if (nav.isMobile) { this._menuToggleClickBtn(el, arrTags(Lng.selExpandThr[lang], '<span class="de-menu-item" info="thr-exp">', '</span>')); } else { 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': if (nav.isMobile && Cfg.showHideBtn === 1) { this._menuToggleClickBtn(el, (this instanceof Pview ? pByNum.get(this.num) : this)._getMenuHide()); } else { this.setUserVisib(!this.isHidden); } return; case 'de-btn-img': if (nav.isMobile) { this._menuToggleClickBtn(el, Menu.getMenuImg(el)); } else { postform.quotedText = aib.getImgRealName(aib.getImgWrap(el)); postform.showQuickReply(isPview ? Pview.topParent : this, this.num, !isPview, false); } return; case 'de-btn-reply': if (nav.isMobile && Cfg.showRepBtn === 1) { this._menuToggleClickBtn(el, (this instanceof Pview ? pByNum.get(this.num) : this)._getMenuReply()); } else { 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; default: if (!nav.isMobile || !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 (!nav.isMobile || !Cfg.linksNavig) { return; } if (this.kid && this.kid.parent.num === this.num && this.kid.num === +((_el$textContent$match = el.textContent.match(/\d+/g)) === null || _el$textContent$match === void 0 ? void 0 : _el$textContent$match[0])) { this.kid.deletePview(); } else { this.kid = Pview.showPview(this, el); } e.preventDefault(); e.stopPropagation(); } return; } if (!this._hasEvents) { this._hasEvents = true; ['click', 'mouseout'].forEach(function (e) { return _this63.el.addEventListener(e, _this63, 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]; if (!nav.isMobile) { this._menuToggleOverBtn(el, isOutEvent, arrTags(Lng.selExpandThr[lang], '<span class="de-menu-item" info="thr-exp">', '</span>')); } 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 (!nav.isMobile && Cfg.showHideBtn === 1) { this._menuToggleOverBtn(el, isOutEvent, (this instanceof Pview ? pByNum.get(this.num) : this)._getMenuHide()); } return; case 'de-btn-img': if (!nav.isMobile && el.parentNode.className !== 'de-fullimg-info') { this._menuToggleOverBtn(el, isOutEvent, Menu.getMenuImg(el)); } return; case 'de-btn-reply': { if (!nav.isMobile && Cfg.showRepBtn === 1) { if (!isOutEvent) { postform.getSelectedText(); } this._menuToggleOverBtn(el, isOutEvent, (this instanceof Pview ? pByNum.get(this.num) : this)._getMenuReply()); } 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 (nav.isMobile || !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._linkTO); if (!(aib.getPostOfEl(nav.fixEventEl(e.relatedTarget)) instanceof Pview) && Pview.top) { Pview.top.markToDel(); } else if (this.kid) { this.kid.markToDel(); } } else { if (nav.isMobile) { return; } this._linkTO = setTimeout(function () { return _this63.kid = Pview.showPview(_this63, el); }, Cfg.linksOver); } e.preventDefault(); e.stopPropagation(); } } }, { key: "toggleFavBtn", value: function toggleFavBtn(isEnable) { var _this$btnFav, _this$thr$btnFav; var elClass = isEnable ? 'de-btn-fav-sel' : 'de-btn-fav'; (_this$btnFav = this.btnFav) === null || _this$btnFav === void 0 || _this$btnFav.setAttribute('class', elClass); (_this$thr$btnFav = this.thr.btnFav) === null || _this$thr$btnFav === void 0 || _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 _this64 = 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 !== _this64.el) { el.classList.toggle('de-ref-you', val); post.el.classList.toggle('de-mypost-reply', val); } }); } }, { 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: "_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.loadFileData(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(_x24, _x25) { return _downloadImageByLink2.apply(this, arguments); } return _downloadImageByLink; }() }, { key: "_getFullMsg", value: function _getFullMsg(truncEl, isInit) { var _this65 = 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 (_this65.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 (_this65.num === aib.getPNum(post)) { sourceEl = post; break; } } } if (sourceEl) { _this65.updateMsg(aib.fixHTML(doc.adoptNode($q(aib.qPostMsg, sourceEl))), maybeSpells.value); truncEl.remove(); } if (maybeSpells.hasValue) { maybeSpells.value.endSpells(); } }, Function.prototype); } }, { key: "_menuAdd", value: function _menuAdd(el, html) { var _this66 = this; return new Menu(el, html, function (el, e) { return (_this66 instanceof Pview ? pByNum.get(_this66.num) || _this66 : _this66)._menuClickOnOptions(el, e); }, false); } }, { key: "_menuClickOnOptions", value: function () { var _menuClickOnOptions2 = _asyncToGenerator(_regeneratorRuntime().mark(function _callee38(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 _callee38$(_context41) { while (1) switch (_context41.prev = _context41.next) { case 0: isHide = !this.isHidden; num = this.num; _context41.t0 = el.getAttribute('info'); _context41.next = _context41.t0 === 'hide-sel' ? 5 : _context41.t0 === 'hide-name' ? 24 : _context41.t0 === 'hide-trip' ? 27 : _context41.t0 === 'hide-img' ? 30 : _context41.t0 === 'hide-imgn' ? 34 : _context41.t0 === 'hide-ihash' ? 37 : _context41.t0 === 'hide-noimg' ? 44 : _context41.t0 === 'hide-post' ? 47 : _context41.t0 === 'hide-text' ? 49 : _context41.t0 === 'hide-notext' ? 52 : _context41.t0 === 'hide-refs' ? 55 : _context41.t0 === 'hide-refsonly' ? 58 : _context41.t0 === 'img-load' ? 61 : _context41.t0 === 'post-markmy' ? 63 : _context41.t0 === 'post-reply' ? 67 : _context41.t0 === 'post-report' ? 71 : _context41.t0 === 'thr-exp' ? 73 : 75; 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))) { _context41.next = 19; break; } if (!this._selText.includes('\n')) { _context41.next = 15; break; } _context41.next = 13; return Spells.addSpell(1 , "/".concat(escapeRegExp(this._selText).replace(/\r?\n/g, '\\n'), "/"), false); case 13: _context41.next = 17; break; case 15: _context41.next = 17; return Spells.addSpell(0 , this._selText.toLowerCase(), false); case 17: _context41.next = 23; break; case 19: dummy.innerHTML = ''; dummy.append(this._selRange.cloneContents()); _context41.next = 23; return Spells.addSpell(2 , "/".concat(escapeRegExp(dummy.innerHTML.replace(/^<[^>]+>|<[^>]+>$/g, '')), "/"), false); case 23: return _context41.abrupt("return"); case 24: _context41.next = 26; return Spells.addSpell(6 , this.posterName, false); case 26: return _context41.abrupt("return"); case 27: _context41.next = 29; return Spells.addSpell(7 , this.posterTrip, false); case 29: return _context41.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; _context41.next = 33; return Spells.addSpell(8 , [0, [w, w], [wi, wi, h, h]], false); case 33: return _context41.abrupt("return"); case 34: _context41.next = 36; return Spells.addSpell(3 , "/".concat(escapeRegExp(this.images.firstAttach.name), "/"), false); case 36: return _context41.abrupt("return"); case 37: _context41.next = 39; return ImagesHashStorage.getHash(this.images.firstAttach); case 39: hash = _context41.sent; if (!(hash !== -1)) { _context41.next = 43; break; } _context41.next = 43; return Spells.addSpell(4 , hash, false); case 43: return _context41.abrupt("return"); case 44: _context41.next = 46; return Spells.addSpell(0x108 , '', true); case 46: return _context41.abrupt("return"); case 47: this.setUserVisib(!this.isHidden); return _context41.abrupt("break", 75); case 49: words = Post.getWrds(this.text); for (post = Thread.first.op; post; post = post.next) { Post.findSameText(num, !isHide, words, post); } return _context41.abrupt("return"); case 52: _context41.next = 54; return Spells.addSpell(0x10B , '', true); case 54: return _context41.abrupt("return"); case 55: this.ref.toggleRef(isHide, true); this.setUserVisib(isHide); return _context41.abrupt("return"); case 58: _context41.next = 60; return Spells.addSpell(0 , '>>' + num, false); case 60: return _context41.abrupt("return"); case 61: this._downloadImageByLink(el, e); return _context41.abrupt("return"); case 63: isAdd = !MyPosts.has(num); if (isAdd) { MyPosts.set(num, this.thr.num); } else { MyPosts.removeStorage(num); } this.changeMyMark(isAdd); return _context41.abrupt("return"); case 67: isPview = this instanceof Pview; postform.showQuickReply(isPview ? Pview.topParent : this, num, !isPview, false); postform.quotedText = ''; return _context41.abrupt("return"); case 71: aib.reportForm(num, this.thr.num); return _context41.abrupt("return"); case 73: task = +el.textContent.match(/\d+/); this.thr.loadPosts(!task ? 'all' : task === 10 ? 'more' : task); case 75: case "end": return _context41.stop(); } }, _callee38, this); })); function _menuClickOnOptions(_x26, _x27) { return _menuClickOnOptions2.apply(this, arguments); } return _menuClickOnOptions; }() }, { key: "_menuShowOverBtn", value: function _menuShowOverBtn(el, html) { var _this$_menu2, _this67 = this; (_this$_menu2 = this._menu) === null || _this$_menu2 === void 0 || _this$_menu2.removeMenu(); this._menu = this._menuAdd(el, html); this._menu.onremove = function () { return _this67._menu = null; }; } }, { key: "_menuToggleClickBtn", value: function _menuToggleClickBtn(el, html) { var _this$_menu3; if ((_this$_menu3 = this._menu) !== null && _this$_menu3 !== void 0 && _this$_menu3.el && this._menu.parentEl === el) { this._menu.removeMenu(); this._menu = null; return; } this._menu = this._menuAdd(el, html); } }, { key: "_menuToggleOverBtn", value: function _menuToggleOverBtn(el, isOutEvent, html) { var _this$_menu4, _this68 = this; if (((_this$_menu4 = this._menu) === null || _this$_menu4 === void 0 ? void 0 : _this$_menu4.parentEl) === el) { return; } if (isOutEvent) { clearTimeout(this._menuTO); } else { this._menuTO = setTimeout(function () { return _this68._menuShowOverBtn(el, html); }, Cfg.linksOver); } } }]); }(); var Post = function (_AbstractPost) { function Post(el, thr, num, count, isOp, prev) { var _this69; _classCallCheck(this, Post); _this69 = _callSuper(this, Post, [thr, num, isOp]); _this69.count = count; _this69.el = el; _this69.isDeleted = false; _this69.isHidden = false; _this69.isOmitted = false; _this69.isViewed = false; _this69.next = null; _this69.prev = prev; _this69.spellHidden = false; _this69.userToggled = false; _this69._selRange = null; _this69._selText = ''; if (prev) { prev.next = _this69; } pByEl.set(el, _this69); pByNum.set(num, _this69); var isMyPost = MyPosts.has(num); if (isMyPost) { _this69.el.classList.add('de-mypost'); } else if (localData && _this69.el.classList.contains('de-mypost')) { MyPosts.set(num, thr.num); isMyPost = true; } el.classList.add(isOp ? 'de-oppost' : 'de-reply'); _this69.btns = $aEnd(_this69._pref = $q(aib.qPostRef, el), '<span class="de-post-btns">' + Post.getPostBtns(isOp, aib.t) + (_this69.sage ? '<svg class="de-btn-sage"><use xlink:href="#de-symbol-post-sage"/></svg>' : '') + (isOp ? '' : "<span class=\"de-post-counter\">".concat(count + 1, "</span>")) + (isMyPost ? '<span class="de-post-counter-you">(You)</span>' : '') + '</span>'); _this69.counterEl = isOp ? null : $q('.de-post-counter', _this69.btns); if (Cfg.expandTrunc && _this69.trunc) { _this69._getFullMsg(_this69.trunc, true); } el.addEventListener('mouseover', _this69, true); return _this69; } _inherits(Post, _AbstractPost); return _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() { _superPropGet(Post, "addFuncs", this, 3)([]); 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 _$q6; (_$q6 = $q('.de-selected')) === null || _$q6 === void 0 || _$q6.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 _this70 = 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; _this70.hideContent(e.type === 'mouseout'); scrollTo(deWindow.pageXOffset, yOffset); }; } } if (Cfg.strikeHidd) { setTimeout(function () { return _this70._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 "<span info=\"hide-".concat(name, "\" class=\"de-menu-item\">").concat(Lng.selHiderMenu[name][lang], "</span>"); }; var sel = deWindow.getSelection(); var ssel = sel.toString().trim(); if (ssel) { this._selText = ssel; this._selRange = sel.getRangeAt(0); } return "".concat(nav.isMobile ? "<span info=\"hide-post\" class=\"de-menu-item\">".concat(this.isOp ? Lng.toggleThr[lang] : Lng.togglePost[lang], "</span>") : '').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: "_getMenuReply", value: function _getMenuReply() { return "<span class=\"de-menu-item\" info=\"post-reply\">".concat(this.btns.title = this.isOp ? Lng.replyToThr[lang] : Lng.replyToPost[lang], "</span>") + (getCookies().atom_access === '1' ? "<a class=\"de-menu-item\" target=\"_blank\" href=\"/".concat(aib.b, "/imgboard.php?manage=&moderate=").concat(this.num, "\">").concat(this.isOp ? Lng.moderateThread[lang] : Lng.moderatePost[lang], "</a>") : '') + (aib.reportForm ? "<span class=\"de-menu-item\" info=\"post-report\">".concat(this.isOp ? Lng.reportThr[lang] : Lng.reportPost[lang], "</span>") : '') + (Cfg.markMyPosts || Cfg.markMyLinks ? "<span class=\"de-menu-item\" info=\"post-markmy\">".concat(MyPosts.has(this.num) ? Lng.deleteMyPost[lang] : Lng.markMyPost[lang], "</span>") : ''); } }, { 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 '<svg class="de-btn-hide"><use class="de-btn-hide-use" xlink:href="#de-symbol-post-hide"/>' + '<use class="de-btn-unhide-use" xlink:href="#de-symbol-post-unhide"/></svg>' + '<svg class="de-btn-reply"><use xlink:href="#de-symbol-post-reply"/></svg>' + (isOp ? (noExpThr ? '' : '<svg class="de-btn-expthr"><use xlink:href="#de-symbol-post-expthr"/></svg>') + '<svg class="de-btn-fav"><use xlink:href="#de-symbol-post-fav"/></svg>' : ''); } }, { 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'); } } } }]); }(AbstractPost); Post.hasNew = false; Post.hiddenNums = new Set(); Post.Сontent = function (_TemporaryContent) { function PostContent(post) { var _this71; _classCallCheck(this, PostContent); _this71 = _callSuper(this, PostContent, [post]); if (_this71._isInited) { return _possibleConstructorReturn(_this71); } _this71._isInited = true; _this71.el = post.el; _this71.post = post; return _this71; } _inherits(PostContent, _TemporaryContent); return _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; } }]); }(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, '<span class="de-post-note"></span>'); return; } this._noteEl = $bBegin(post.thr.el, "<div class=\"".concat(aib.cReply, " de-thr-hid\" id=\"de-thr-hid-").concat(post.num, "\">").concat(Lng.hiddenThr[lang], ": <a href=\"#\">\u2116").concat(post.num, "</a>\n\t\t\t<span class=\"de-thread-note\"></span>\n\t\t</div>")); this._aEl = $q('a', this._noteEl); this.textEl = this._aEl.nextElementSibling; } return _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 _this72 = this; this.text = note; var text; if (this.isHideThr) { this._aEl.onmouseover = this._aEl.onmouseout = function (e) { return _this72._post.hideContent(e.type === 'mouseout'); }; this._aEl.onclick = function (e) { e.preventDefault(); _this72._post.setUserVisib(!_this72._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); } }]); }(); 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) { function Pview(parent, link, pNum, tNum) { var _this73; _classCallCheck(this, Pview); _this73 = _callSuper(this, Pview, [parent.thr, pNum, pNum === tNum]); _this73.isSticky = false; _this73.parent = parent; _this73.remoteThr = null; _this73.tNum = tNum; _this73._isCached = false; _this73._isLeft = false; _this73._isTop = false; _this73._link = link; _this73._newPos = null; _this73._offsetTop = 0; _this73._readDelay = 0; var post = pByNum.get(pNum); if (post && (!post.isOp || !(parent instanceof Pview) || !parent._isCached)) { _this73._buildPview(post); return _possibleConstructorReturn(_this73); } _this73._isCached = true; _this73.board = link.pathname.match(/^\/?(.+\/)/)[1].replace(aib.res, '').replace(/\/$/, ''); if (PviewsCache.has(_this73.board + tNum)) { post = PviewsCache.get(_this73.board + tNum).getPost(pNum); if (post) { _this73._buildPview(post); } else { _this73._showPview(_this73.el = $add("<div class=\"".concat(aib.cReply, " de-pview-info de-pview\">\n\t\t\t\t\t").concat(Lng.postNotFound[lang], "</div>"))); } return _possibleConstructorReturn(_this73); } _this73._showPview(_this73.el = $add("<div class=\"".concat(aib.cReply, " de-pview-info de-pview\">\n\t\t\t<svg class=\"de-wait\"><use xlink:href=\"#de-symbol-wait\"/></svg>").concat(Lng.loading[lang], "</div>"))); _this73._loadPromise = ajaxPostsLoad(_this73.board, tNum, false, false).then(function (pBuilder) { return _this73._onload(pBuilder); }, function (err) { return _this73._onerror(err); }); return _this73; } _inherits(Pview, _AbstractPost2); return _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) { _superPropGet(Pview, "handleEvent", this, 3)([e]); } } }, { key: "markToDel", value: function markToDel() { var _this74 = this; clearTimeout(Pview._delTO); Pview._delTO = setTimeout(function () { return _this74.deleteNonSticky(); }, nav.isMobile ? 0 : 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: "_menuShowOverBtn", value: function _menuShowOverBtn(el, html) { var _this75 = this; _superPropGet(Pview, "_menuShowOverBtn", this, 3)([el, html]); this._menu.onover = function () { return _this75.mouseEnter(); }; this._menu.onout = function () { return Pview.top.markToDel(); }; } }, { key: "_buildPview", value: function () { var _buildPview2 = _asyncToGenerator(_regeneratorRuntime().mark(function _callee39(post) { var _this$el, _yield$readFavorites$; var isOp, num, pv, isMyPost, isFav, isCached, postsCountHtml, pText, _$q7, btnsEl, link; return _regeneratorRuntime().wrap(function _callee39$(_context42) { while (1) switch (_context42.prev = _context42.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'); _context42.t0 = isOp; if (!_context42.t0) { _context42.next = 32; break; } _context42.t1 = post.thr.isFav; if (_context42.t1) { _context42.next = 31; break; } _context42.next = 17; return readFavorites(); case 17: _context42.t4 = aib.host; _context42.t5 = _yield$readFavorites$ = _context42.sent[_context42.t4]; _context42.t3 = _context42.t5 === null; if (_context42.t3) { _context42.next = 22; break; } _context42.t3 = _yield$readFavorites$ === void 0; case 22: _context42.t2 = _context42.t3; if (_context42.t2) { _context42.next = 25; break; } _context42.t2 = (_yield$readFavorites$ = _yield$readFavorites$[this.board]) === null || _yield$readFavorites$ === void 0; case 25: if (!_context42.t2) { _context42.next = 29; break; } _context42.t6 = void 0; _context42.next = 30; break; case 29: _context42.t6 = _yield$readFavorites$[num]; case 30: _context42.t1 = _context42.t6; case 31: _context42.t0 = _context42.t1; case 32: isFav = _context42.t0; isCached = post instanceof CacheItem; postsCountHtml = (post.isDeleted ? " de-post-counter-deleted\">".concat(Lng.deleted[lang], "</span>") : "\">".concat(isOp ? '(OP)' : post.count + +!(aib.JsonBuilder && isCached), "</span>")) + (isMyPost ? '<span class="de-post-counter-you">(You)</span>' : ''); pText = '<svg class="de-btn-reply"><use xlink:href="#de-symbol-post-reply"/></svg>' + (isOp ? "<svg class=\"".concat(isFav ? 'de-btn-fav-sel' : 'de-btn-fav', "\">") + '<use xlink:href="#de-symbol-post-fav"></use></svg>' : '') + (post.sage ? '<svg class="de-btn-sage"><use xlink:href="#de-symbol-post-sage"/></svg>' : '') + '<svg class="de-btn-stick"><use xlink:href="#de-symbol-post-stick"/></svg>' + '<span class="de-post-counter' + postsCountHtml; if (isCached) { if (isOp) { this.remoteThr = post.thr; } this.btns = $aEnd(this._pref, "<span class=\"de-post-btns\">".concat(pText, "</span>")); embedAudioLinks(this); if (Cfg.embedYTube) { new VideosParser().parse(this).endParser(); } embedPostMsgImages(pv); processImgInfoLinks(this); } else { btnsEl = this.btns = $q('.de-post-btns', pv); (_$q7 = $q('.de-post-counter', btnsEl)) === null || _$q7 === void 0 || _$q7.remove(); if (post.isHidden) { btnsEl.classList.add('de-post-hide'); } btnsEl.innerHTML = "<svg class=\"de-btn-".concat(post.isHidden ? 'unhide' : 'hide').concat(post.userToggled ? '-user' : '', " de-btn-pview-hide\" de-num=\"").concat(num, "\"><!--\n\t\t\t\t--><use class=\"de-btn-hide-use\" xlink:href=\"#de-symbol-post-hide\"/><!--\n\t\t\t\t--><use class=\"de-btn-unhide-use\" xlink:href=\"#de-symbol-post-unhide\"/></svg>").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 _context42.stop(); } }, _callee39, 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, '<div class="de-refmap"></div>')).insertAdjacentHTML('afterbegin', "<a class=\"de-link-backref\" href=\"".concat(aib.getThrUrl(board, tNum) + aib.anchor + num, "\">>>").concat(aib.b === board ? '' : "/".concat(aib.b, "/")).concat(num, "</a><span class=\"de-refcomma\">, </span>")); } 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: "_showPview", value: function _showPview(el) { var _this76 = this; ['mouseover', 'mouseout'].forEach(function (e) { return el.addEventListener(e, _this76, 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 _link$pathname$match, _link$textContent$mat; var tNum = +((_link$pathname$match = link.pathname.match(/.+?\/[^\d]*(\d+)/)) === null || _link$pathname$match === void 0 ? void 0 : _link$pathname$match[1]) || aib.getPostOfEl(link).tNum; var pNum = +((_link$textContent$mat = link.textContent.match(/\d+/g)) === null || _link$textContent$mat === void 0 ? void 0 : _link$textContent$mat[0]) || 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'); }); } }]); }(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; } return _createClass(CacheItem, [{ key: "refLinks", value: _regeneratorRuntime().mark(function refLinks() { return _regeneratorRuntime().wrap(function refLinks$(_context43) { while (1) switch (_context43.prev = _context43.next) { case 0: return _context43.delegateYield(this._pBuilder.getRefLinks(this.count, this._thrUrl), "t0", 1); case 1: case "end": return _context43.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 _this77 = 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 _this77.title; } }); } Object.defineProperty(this, 'thr', { value: value }); return value; } }]); }(); var PviewsCache = function (_TemporaryContent2) { function PviewsCache(pBuilder, board, tNum) { var _this78; _classCallCheck(this, PviewsCache); _this78 = _callSuper(this, PviewsCache, [board + tNum]); if (_this78._isInited) { return _possibleConstructorReturn(_this78); } _this78._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); _this78._b = board; _this78._posts = lPByNum; if (Cfg.linksNavig) { RefMap.gen(lPByNum); } return _this78; } _inherits(PviewsCache, _TemporaryContent2); return _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; } }]); }(TemporaryContent); PviewsCache.purgeSecs = 3e5; var ImagesNavigBtns = function () { function ImagesNavigBtns(viewerObj) { _classCallCheck(this, ImagesNavigBtns); var btns = $bEnd(doc.body, "<div style=\"display: none;\">\n\t\t\t<div id=\"de-img-btn-prev\" class=\"de-img-btn\" de-title=\"".concat(Lng.prevImg[lang], "\">\n\t\t\t\t<svg><use xlink:href=\"#de-symbol-img-btn-arrow\"/></svg></div>\n\t\t\t<div id=\"de-img-btn-next\" class=\"de-img-btn\" de-title=\"").concat(Lng.nextImg[lang], "\">\n\t\t\t\t<svg><use xlink:href=\"#de-symbol-img-btn-arrow\"/></svg></div>\n\t\t\t<div id=\"de-img-btn-auto\" class=\"de-img-btn de-img-btn-none\" title=\"").concat(Lng.autoPlayOn[lang], "\">\n\t\t\t\t<svg><use xlink:href=\"#de-symbol-img-btn-auto\"/></svg></div>\n\t\t\t<div id=\"de-img-btn-rotate\" class=\"de-img-btn\" title=\"").concat(Lng.rotateImg[lang], "\">\n\t\t\t\t<svg><use xlink:href=\"#de-symbol-img-btn-rotate\"/></svg></div></div>")); var _ref40 = _toConsumableArray(btns.children); this.prevBtn = _ref40[0]; this.nextBtn = _ref40[1]; this.autoBtn = _ref40[2]; this._btns = btns; this._btnsStyle = btns.style; this._hideTO = null; this._isHidden = true; this._oldX = -1; this._oldY = -1; this._viewer = viewerObj; doc.defaultView.addEventListener('mousemove', this); btns.addEventListener('mouseover', this); } return _createClass(ImagesNavigBtns, [{ key: "handleEvent", value: function handleEvent(e) { var _this79 = 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 _this79._btns.addEventListener(e, _this79); }); } if (!this._isHidden) { clearTimeout(this._hideTO); KeyEditListener.setTitle(this.prevBtn, 4); KeyEditListener.setTitle(this.nextBtn, 17); } return; case 'mouseout': this._setHideTimeout(); 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._hideTO); } }, { key: "showBtns", value: function showBtns() { if (this._isHidden) { this._btnsStyle.removeProperty('display'); this._isHidden = false; this._setHideTimeout(); } } }, { key: "_setHideTimeout", value: function _setHideTimeout() { var _this80 = this; clearTimeout(this._hideTO); this._hideTO = setTimeout(function () { return _this80.hideBtns(); }, 2e3); } }]); }(); 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._touchDistStart = 0; this._width = 0; this._zoomed = false; this._showFullImg(data); } return _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 _this81 = this; switch (e.type) { 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 && !nav.isMobile) { this._moved = false; } else { this.closeImgViewer(e); AttachedImage.viewer = null; } e.stopPropagation(); break; } return; } 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, _this81, true); }); break; case 'mousemove': this._moveFullImg(e.clientX, e.clientY); return; case 'mouseup': ['mousemove', 'mouseup'].forEach(function (e) { return doc.body.removeEventListener(e, _this81, true); }); return; case 'mousewheel': this._handleZoom(e.clientX, e.clientY, -1 / 40 * ('wheelDeltaY' in e ? e.wheelDeltaY : e.wheelDelta)); break; case 'touchend': if (e.targetTouches.length === 0) { this._zoomed = false; return; } case 'touchmove': { var touchesLen = e.targetTouches.length; if (touchesLen === 1 && !this._zoomed) { this._moveFullImg(e.touches[0].clientX, e.touches[0].clientY); } else if (touchesLen === 2 && e.changedTouches.length === 2) { var finger0X = e.touches[0].clientX; var finger1X = e.touches[1].clientX; var finger0Y = e.touches[0].clientY; var finger1Y = e.touches[1].clientY; this._handleZoom((finger0X + finger1X) / 2, (finger0Y + finger1Y) / 2, this._touchDistStart - (this._touchDistStart = Math.hypot(finger0X - finger1X, finger0Y - finger1Y))); this._zoomed = true; } break; } case 'touchstart': { var _touchesLen = e.targetTouches.length; if (_touchesLen === 1) { if (this.data.isVideo && ExpandableImage.isControlClick(e)) { return; } this._oldX = e.touches[0].clientX; this._oldY = e.touches[0].clientY; } else if (_touchesLen === 2) { this._touchDistStart = Math.hypot(e.touches[0].clientX - e.touches[1].clientX, e.touches[0].clientY - e.touches[1].clientY); } return; } case 'wheel': this._handleZoom(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: "_handleZoom", value: function _handleZoom(clientX, clientY, delta) { if (delta === 0) { return; } var width, height; var oldW = this._width, oldH = this._height; if (nav.isMobile) { var wh = oldW / oldH; width = oldW - 1.5 * delta; height = width / wh; } else if (delta > 0) { width = oldW / this._zoomFactor; height = oldH / this._zoomFactor; } else { width = oldW * this._zoomFactor; height = oldH * this._zoomFactor; } if (width <= this._minSize && height <= this._minSize) { return; } 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: "_moveFullImg", value: function _moveFullImg(curX, curY) { 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; } } }, { 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 _this82 = 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 _this82._resizeFullImg(el); }, function (el) { return _this82._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("<div class=\"de-fullimg-center".concat(data.isVideo ? ' de-fullimg-center-video' : '', "\" style=\"top:").concat(this._oldT - (Cfg.imgInfoLink ? 11 : 0) - (nav.firefoxVer >= 59 && data.isVideo ? 10 : 0), "px; left:").concat(this._oldL, "px; width:").concat(width, "px; height:").concat(height, "px; display: block\"></div>")); 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, "<a class=\"de-fullimg-wrap-link\" href=\"".concat(data.src, "\"></a>")).append($q('img', this._fullEl)); } this._elStyle = el.style; this.data = data; this._parentEl = el; var events = nav.isMobile ? ['click', 'touchend', 'touchmove', 'touchstart'] : ['click', 'mousedown', 'onwheel' in el ? 'wheel' : 'mousewheel']; events.forEach(function (e) { return el.addEventListener(e, _this82, 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); } }]); }(); 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; } } return _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 _this83 = this; if (!aib.getImgRedirectSrc || this.redirected) { return; } aib.getImgRedirectSrc(this.src).then(function (newSrc) { _this83.redirected = true; Object.defineProperty(_this83, 'src', { value: newSrc }); $q('img, video', fullEl).src = _this83.el.src = _this83.el.parentNode.href = getImgNameLink(_this83.el).href = newSrc; if (!_this83.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 _this84 = 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', '<div class="de-fullimg-after"></div>'); var fullEl = this._fullEl = this.getFullImg(true, null, null); fullEl.addEventListener('click', function (e) { return _this84.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 _this85 = 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 ? '<svg class="de-btn-img"><use xlink:href="#de-symbol-post-img"></use></svg>' : '') + "<a class=\"de-fullimg-link\" target=\"_blank\" title=\"".concat(Lng.openOriginal[lang], "\" href=\"").concat(origSrc, "\">").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 ? '' : '<svg class="de-fullimg-load"><use xlink:href="#de-symbol-wait"/></svg>'; wrapEl = $add("<div class=\"de-fullimg-wrap".concat(wrapClass, "\">\n\t\t\t\t").concat(waitEl, "\n\t\t\t\t<img class=\"de-fullimg\" src=\"").concat(src, "\" alt=\"").concat(src, "\">\n\t\t\t\t<div class=\"de-fullimg-info\">").concat(imgNameEl, "</a> <span class=\"de-fullimg-scale\"></span></div>\n\t\t\t</div>")); var imgEl = $q('.de-fullimg', wrapEl); imgEl.onload = imgEl.onerror = function (_ref41) { var img = _ref41.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 = _this85._size ? _this85._size[1] / _this85._size[0] : newH / newW; var isRotated = scrollWidth ? img.scrollHeight / scrollWidth > 1 ? ar < 1 : ar > 1 : false; if (!_this85._size || isRotated) { _this85._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("<div class=\"de-fullimg-wrap".concat(wrapClass, "\"").concat(inPostSize, ">").concat(nav.firefoxVer >= 59 || nav.isMobile ? "<div class=\"de-fullimg-video-hack\">".concat(nav.isMobile && nav.isWebkit ? "\xD7" : '', "</div>") : '', "\n\t\t\t<video src=\"").concat(src, "\" ") + "".concat(hasTitle && title ? "title=\"".concat(title, "\" ") : '', "loop autoplay ") + "".concat(Cfg.webmControl ? 'controls ' : '') + "".concat(Cfg.webmVolume === 0 ? 'muted ' : '', "></video>\n\t\t\t<div class=\"de-fullimg-info\">").concat(imgNameEl, "</a> <span class=\"de-fullimg-scale\"></span>\n\t\t\t\t<span class=\"de-webm-title\">").concat(hasTitle && title ? title : '', "</span>\n\t\t\t\t").concat(needTitle && !hasTitle ? "<svg class=\"de-wait\">\n\t\t\t\t\t<use xlink:href=\"#de-symbol-wait\"/></svg>" : '', "\n\t\t\t</div>\n\t\t</div>")); var videoEl = $q('video', wrapEl); videoEl.volume = Cfg.webmVolume / 100; videoEl.addEventListener('ended', function () { return AttachedImage.viewer.navigate(true, true); }); videoEl.addEventListener('error', function (_ref42) { var el = _ref42.target; if (!el.onceLoaded) { el.load(); el.onceLoaded = true; } }); if (!this._size) { videoEl.addEventListener('loadedmetadata', function (_ref43) { var el = _ref43.target; _this85._size = [el.videoWidth, el.videoHeight]; onsizechange(wrapEl); }); } setTimeout(function () { return videoEl.dispatchEvent(new CustomEvent('volumechange')); }, 150); videoEl.addEventListener('volumechange', function () { var _ref45 = _asyncToGenerator(_regeneratorRuntime().mark(function _callee40(_ref44) { var el, isTrusted, val; return _regeneratorRuntime().wrap(function _callee40$(_context44) { while (1) switch (_context44.prev = _context44.next) { case 0: el = _ref44.target, isTrusted = _ref44.isTrusted; val = el.muted ? 0 : Math.round(el.volume * 100); if (!(isTrusted && val !== Cfg.webmVolume)) { _context44.next = 6; break; } _context44.next = 5; return CfgSaver.save('webmVolume', val); case 5: sendStorageEvent('__de-webmvolume', val); case 6: case "end": return _context44.stop(); } }, _callee40); })); return function (_x29) { return _ref45.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<a href=\"").concat(href, "\" target=\"_blank\">").concat(href, "</a>"), false); } if (needTitle && !hasTitle) { this._webmTitleLoad = ContentLoader.loadFileData(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)); _this85.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(_ref46) { var _this86 = this; var _fullEl = _ref46._fullEl; if (!Cfg.imgSrcBtns) { return; } var srcBtnEl = $q('.de-btn-img', _fullEl); var event = nav.isMobile ? 'click' : 'mouseover'; srcBtnEl.addEventListener(event, function () { return srcBtnEl._menuTO = setTimeout(function () { var _srcBtnEl$_menu, _srcBtnEl$_menu2; if (nav.isMobile && (_srcBtnEl$_menu = srcBtnEl._menu) !== null && _srcBtnEl$_menu !== void 0 && _srcBtnEl$_menu.el && ((_srcBtnEl$_menu2 = srcBtnEl._menu) === null || _srcBtnEl$_menu2 === void 0 ? void 0 : _srcBtnEl$_menu2.parentEl) === srcBtnEl) { srcBtnEl._menu.el.remove(); srcBtnEl._menu = null; return; } var menuHtml = !_this86.isVideo ? Menu.getMenuImg(srcBtnEl) : Menu.getMenuImg(srcBtnEl, true) + "<span class=\"de-menu-item de-menu-getframe\">".concat(Lng.getFrameLinks[lang], "</span>"); srcBtnEl._menu = new Menu(srcBtnEl, menuHtml, !_this86.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(_this86.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 = "<a class=\"de-menu-item de-list\" href=\"".concat(deWindow.URL.createObjectURL(blob), "\" download=\"").concat(name, "\" target=\"_blank\">").concat(Lng.saveFrame[lang], "</a>"); $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 += ':<br>' + 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._menuTO); }); } }, { 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; } }]); }(); var EmbeddedImage = function (_ExpandableImage) { function EmbeddedImage() { _classCallCheck(this, EmbeddedImage); return _callSuper(this, EmbeddedImage, arguments); } _inherits(EmbeddedImage, _ExpandableImage); return _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; } }]); }(ExpandableImage); var AttachedImage = function (_ExpandableImage2) { function AttachedImage() { _classCallCheck(this, AttachedImage); return _callSuper(this, AttachedImage, arguments); } _inherits(AttachedImage, _ExpandableImage2); return _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; } } }]); }(ExpandableImage); AttachedImage.viewer = null; var PostImages = function () { 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 _el8 = els[_i13]; last = new EmbeddedImage(post, _el8, last); filesMap.set(_el8, last); if (!first) { first = last; } } } this.first = first; this.last = last; this.hasAttachments = hasAttachments; this._map = filesMap; } return _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 }; } }; } }]); }(); 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(_ref47) { var _ref48 = _slicedToArray(_ref47, 3), arrBuf = _ref48[0], oldw = _ref48[1], oldh = _ref48[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(_ref49) { var _this87 = this; return _asyncToGenerator(_regeneratorRuntime().mark(function _callee41() { var el, src, data, val, w, h, cnv, ctx, buffer; return _regeneratorRuntime().wrap(function _callee41$(_context45) { while (1) switch (_context45.prev = _context45.next) { case 0: el = _ref49.el, src = _ref49.src; if (!(src in _this87._storage)) { _context45.next = 3; break; } return _context45.abrupt("return", _this87._storage[src]); case 3: if (el.complete) { _context45.next = 6; break; } _context45.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)) { _context45.next = 9; break; } return _context45.abrupt("return", -1); case 9: val = -1; w = el.naturalWidth, h = el.naturalHeight; cnv = _this87._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) { _context45.next = 22; break; } _context45.next = 20; return new Promise(function (resolve) { return _this87._workers.runWorker([buffer, w, h], [buffer], function (val) { return resolve(val); }); }); case 20: data = _context45.sent; if (data && 'hash' in data) { val = data.hash; } case 22: _this87._storage[src] = val; return _context45.abrupt("return", val); case 24: case "end": return _context45.stop(); } }, _callee41); }))(); } }); function getImgNameLink(el) { return $q(aib.qPostImgNameLink, aib.getImgWrap(el)); } function addImgButtons(link) { link.insertAdjacentHTML('beforebegin', '<svg class="de-btn-img">' + '<use xlink:href="#de-symbol-post-img"/></svg>'); } 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', "<a href=\"".concat(url, "\" target=\"_blank\"><img class=\"de-img-embed\" src=\"").concat(url, "\"></a><br>")); 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; } return _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$(_context46) { while (1) switch (_context46.prev = _context46.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)) { _context46.next = 16; break; } link = links[_i15]; tc = link.textContent; if (!(tc[0] === '>' && tc[1] === '>')) { _context46.next = 13; break; } lNum = parseInt(tc.substr(2), 10); if (!lNum) { _context46.next = 13; break; } _context46.next = 11; return [link, lNum]; case 11: url = link.getAttribute('href'); if (url[0] === '#') { link.setAttribute('href', thrUrl + url); } case 13: ++_i15; _context46.next = 3; break; case 16: case "end": return _context46.stop(); } }, getRefLinks, this); }) }, { key: "bannedPostsData", value: _regeneratorRuntime().mark(function bannedPostsData() { var banEls, i, len, banEl, postEl; return _regeneratorRuntime().wrap(function bannedPostsData$(_context47) { while (1) switch (_context47.prev = _context47.next) { case 0: banEls = $Q(aib.qBan, this._form); i = 0, len = banEls.length; case 2: if (!(i < len)) { _context47.next = 10; break; } banEl = banEls[i]; postEl = aib.getPostElOfEl(banEl); _context47.next = 7; return [1, postEl ? aib.getPNum(postEl) : null, doc.adoptNode(banEl)]; case 7: ++i; _context47.next = 2; break; case 10: case "end": return _context47.stop(); } }, bannedPostsData, this); }) }]); }(); 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 = []; } return _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("<blockquote class=\"postMessage\" id=\"m".concat(no, "\"> ").concat(com, "</blockquote>"))); } }, { 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 = "<div id=\"f".concat(num, "\" class=\"file\"><span class=\"fileThumb\">\n\t\t\t\t<img src=\"").concat(_icon('filedeleted-res'), "\" class=\"fileDeletedRes\" alt=\"File deleted.\">\n\t\t\t</span></div>"); } 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 = "<div class=\"file\" id=\"f".concat(num, "\">\n\t\t\t\t<div class=\"fileText\" id=\"fT").concat(num, "\"").concat(fileTextTitle, ">File:\n\t\t\t\t\t<a href=\"//i.4cdn.org/").concat(board, "/").concat(data.tim + data.ext, "\" ").concat(aHref, " target=\"_blank\">").concat(_name2, "</a>\n\t\t\t\t\t(").concat(size, ", ").concat(data.ext === '.pdf' ? 'PDF' : data.w + 'x' + data.h, ")\n\t\t\t\t</div>\n\t\t\t\t<a class=\"fileThumb ").concat(isSpoiler ? 'imgspoiler' : '', "\" href=\"//i.4cdn.org/").concat(board, "/") + "".concat(data.tim + data.ext, "\" target=\"_blank\">\n\t\t\t\t\t<img src=\"").concat(imgSrc, "\" alt=\"").concat(size, "\" data-md5=\"") + "".concat(data.md5, "\" style=\"height: ").concat(data.tn_h, "px; width: ").concat(data.tn_w, "px;\">\n\t\t\t\t\t<div data-tip=\"\" data-tip-cb=\"mShowFull\" class=\"mFileInfo mobile\">\n\t\t\t\t\t\t").concat(size, " ").concat(data.ext.substr(1).toUpperCase(), "\n\t\t\t\t\t</div>\n\t\t\t\t</a>\n\t\t\t</div>"); } 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 = "<strong class=\"capcode hand id_".concat(cc === 'founder' ? 'admin' : cc) + "\" title=\"Highlight posts by ".concat(ccBy, "\">## ").concat(ccName, "</strong>"); ccImg = "<img src=\"".concat(_icon(cc + 'icon'), "\" alt=\"").concat(ccName, " Icon.\" title=\"This user is 4chan ").concat(ccName, ".\" class=\"identityIcon\">"); ccClass = 'capcode' + (cc === 'founder' ? 'Admin' : ccName); } var id = data.id, _data$name = data.name, name = _data$name === void 0 ? '' : _data$name; var nameEl = "<span class=\"name\">".concat(name, "</span>"); var mobNameEl = name.length <= 30 ? nameEl : "<span class=\"name\" data-tip data-tip-cb=\"mShowFull\">".concat(name.substring(30), "(\u2026)</span>"); var tripEl = "".concat(data.trip ? "<span class=\"postertrip\">".concat(data.trip, "</span>") : ''); var cID = id ? this._colorIDs[id] || this._computeIDColor(id) : null; var posteruidEl = id && !data.capcode ? "<span class=\"posteruid id_".concat(id) + "\">(ID: <span class=\"hand\" title=\"Highlight posts by this ID\" style=\"background-color: rgb(".concat(cID[0], ", ").concat(cID[1], ", ").concat(cID[2], "); color: ").concat(cID[3] ? 'black' : 'white', ";\">").concat(id, "</span>)</span>") : ''; var flagEl = (data.country ? "<span title=\"".concat(data.country_name, "\" class=\"flag flag-").concat(data.country.toLowerCase(), "\"></span>") : '') + (data.board_flag ? "<span title=\"".concat(data.flag_name, "\" class=\"bfl bfl-").concat(data.board_flag.toLowerCase(), "\"></span>") : ''); var emailEl = data.email ? "<a href=\"mailto:".concat(data.email.replaceAll(' ', '%20'), "\" class=\"useremail\">") : ''; var replyEl = "<a href=\"#p".concat(num, "\" title=\"Link to this post\">No.</a><a href=\"javascript:quote('").concat(num, "');\" title=\"Reply to this post\">").concat(num, "</a>"); var subjEl = "<span class=\"subject\">".concat(data.sub || '', "</span>"); return "<div class=\"postContainer replyContainer\" id=\"pc".concat(num, "\">\n\t\t\t<div class=\"sideArrows\" id=\"sa").concat(num, "\">>></div>\n\t\t\t<div id=\"p").concat(num, "\" class=\"post ").concat(i === -1 ? 'op' : 'reply', " ").concat(highlight, "\">\n\t\t\t\t<div class=\"postInfoM mobile\" id=\"pim").concat(num, "\">\n\t\t\t\t\t<span class=\"nameBlock ").concat(ccClass, "\">\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, "<br>\n\t\t\t\t\t\t").concat(subjEl, "\n\t\t\t\t\t</span>\n\t\t\t\t\t<span class=\"dateTime postNum\" data-utc=\"").concat(data.time, "\">").concat(data.now, " ").concat(replyEl, "</span>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"postInfo desktop\" id=\"pi").concat(num, "\">\n\t\t\t\t\t<input name=\"").concat(num, "\" value=\"delete\" type=\"checkbox\">\n\t\t\t\t\t").concat(subjEl, "\n\t\t\t\t\t<span class=\"nameBlock ").concat(ccClass, "\">\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 ? '</a>' : '', "\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</span>\n\t\t\t\t\t<span class=\"dateTime\" data-utc=\"").concat(data.time, "\">").concat(data.now, "</span>\n\t\t\t\t\t<span class=\"postNum desktop\">").concat(replyEl, "</span>\n\t\t\t\t</div>\n\t\t\t\t").concat(fileHTML, "\n\t\t\t\t<blockquote class=\"postMessage\" id=\"m").concat(num, "\"> ").concat(data.com || '', "</blockquote>\n\t\t\t</div>\n\t\t</div>"); } }, { key: "bannedPostsData", value: _regeneratorRuntime().mark(function bannedPostsData() { return _regeneratorRuntime().wrap(function bannedPostsData$(_context48) { while (1) switch (_context48.prev = _context48.next) { case 0: case "end": return _context48.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('>', '>') }; } }]); }(); _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; } return _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 = "<div class=\"post__images post__images_type_".concat(files.length === 1 ? 'single' : 'multi', "\">"); 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 += "<figure class=\"post__image\">\n\t\t\t\t\t<figcaption class=\"post__file-attr\">\n\t\t\t\t\t\t<a id=\"title-".concat(imgId, "\" class=\"desktop\" target=\"_blank\" href=\"") + "".concat(type === 100 ? file.install : file.path, "\"") + "".concat(dispName === fullname ? '' : " title=\"".concat(fullname, "\""), ">").concat(dispName, "</a>\n\t\t\t\t\t\t<span class=\"post__filezise\">(").concat(file.size, "\u041A\u0431, ") + "".concat(file.width, "x").concat(file.height).concat(isVideo ? ', ' + file.duration : '', ")</span>\n\t\t\t\t\t</figcaption>\n\t\t\t\t\t<div id=\"exlink-").concat(imgId, "\">\n\t\t\t\t\t\t<a class=\"post__image-link\" href=\"").concat(file.path, "\">\n\t\t\t\t\t\t\t<img class=\"").concat(imgClass, "\" src=\"").concat(file.thumbnail, "\" alt=\"").concat(file.width, "x") + "".concat(file.height, "\" width=\"").concat(file.tn_width, "\" height=\"").concat(file.tn_height, "\">\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</div>\n\t\t\t\t</figure>"); } filesHTML += '</div>'; } var emailEl = data.email ? "<a href=\"".concat(data.email, "\" class=\"post__email\">").concat(data.name, "</a>") : "<span class=\"post__anon\">".concat(data.name, "</span>"); var tripEl = !data.trip ? '' : "<span class=\"".concat(_switch(data.trip, { '!!%adm%!!': 'post__adm">## 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 }), "</span>"); var refHref = "/".concat(board, "/res/").concat(parseInt(data.parent) || num, ".html#").concat(num); var rate = ''; if (this._hasLikes) { var likes = "<div id=\"like-div".concat(num, "\" class=\"post__detailpart post__rate") + " post__rate_type_like\" title=\"\u041C\u043D\u0435 \u044D\u0442\u043E \u043D\u0440\u0430\u0432\u0438\u0442\u0441\u044F\">\n\t\t\t\t\t<svg xmlns=\"http://www.w3.org/2000/svg\" class=\"post__rate-icon icon\">\n\t\t\t\t\t\t<use xlink:href=\"#icon__thunder\"></use></svg> <span id=\"like-count".concat(num, "\">"); var dislikes = likes.replaceAll('like', 'dislike').replace('icon__thunder', 'icon__thumbdown'); rate = "".concat(likes).concat(data.likes || 0, "</span></div>\n\t\t\t\t").concat(dislikes).concat(data.dislikes || 0, "</span></div>"); } var isOp = i === -1; var reflink = "<a id=\"".concat(num, "\" class=\"post__reflink\" href=\"").concat(refHref, "\">\u2116</a>") + "<a class=\"post__reflink postbtn-reply-href\" href=\"".concat(refHref, "\"") + " name=\"".concat(num, "\">").concat(num, "</a>"); var w = function w(el) { return "<span class=\"post__detailpart\">".concat(el, "</span>"); }; return "<div id=\"post-".concat(num, "\" class=\"post post_type_").concat(isOp ? 'oppost' : 'reply') + "".concat(filesHTML ? ' post_withimg' : '', "\" data-num=\"").concat(num, "\">\n\t\t\t<div id=\"post-details-").concat(num, "\" class=\"post__details\">\n\t\t\t\t<input class=\"turnmeoff\" type=\"checkbox\" name=\"delete\" value=\"").concat(num, "\">\n\t\t\t\t").concat(!data.subject ? '' : w('<span class="post__title">' + "".concat(data.subject + (data.tags ? " /".concat(data.tags, "/") : ''), "</span>")), "\n\t\t\t\t").concat(w("\n\t\t\t\t\t".concat(emailEl, "\n\t\t\t\t\t").concat(data.icon ? '<span class="post__icon">' + "".concat(data.icon, "</span>") : '', "\n\t\t\t\t\t").concat(tripEl, "\n\t\t\t\t\t").concat(data.op === 1 ? '<span class="post__ophui"># OP</span> ' : '', "\n\t\t\t\t")), "\n\t\t\t\t").concat(w("<span class=\"post__time\">".concat(data.date, "</span>")), "\n\t\t\t\t").concat(w(reflink), "\n\t\t\t\t").concat(rate, "\n\t\t\t</div>\n\t\t\t").concat(filesHTML, "\n\t\t\t").concat(this._getPostMsg(data), "\n\t\t</div>"); } }, { key: "bannedPostsData", value: _regeneratorRuntime().mark(function bannedPostsData() { var _iterator27, _step27, _step27$value, banned, num; return _regeneratorRuntime().wrap(function bannedPostsData$(_context49) { while (1) switch (_context49.prev = _context49.next) { case 0: _iterator27 = _createForOfIteratorHelperLoose(this._posts); case 1: if ((_step27 = _iterator27()).done) { _context49.next = 14; break; } _step27$value = _step27.value, banned = _step27$value.banned, num = _step27$value.num; _context49.t0 = banned; _context49.next = _context49.t0 === 1 ? 6 : _context49.t0 === 2 ? 9 : 12; break; case 6: _context49.next = 8; return [1, num, $add('<span class="post__pomyanem">(Автор этого поста был забанен.)</span>')]; case 8: return _context49.abrupt("break", 12); case 9: _context49.next = 11; return [2, num, $add('<span class="post__pomyanem">' + '(Автор этого поста был предупрежден.)</span>')]; case 11: return _context49.abrupt("break", 12); case 12: _context49.next = 1; break; case 14: case "end": return _context49.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(/<script /ig, '<!--<textarea ').replace(/<\/script>/ig, '</textarea>-->'); return "<article id=\"m".concat(data.num, "\" class=\"post__message\">") + "".concat(comment).concat(_switch(data.banned, { 1: '<br><span class="post__pomyanem">(Автор этого поста был забанен.)</span>', 2: '<br><span class="post__pomyanem">(Автор этого поста был предупрежден.)</span>', '@@default': '' }), "</article>"); } }]); }(); var RefMap = function () { function RefMap(post) { _classCallCheck(this, RefMap); this.hasMap = false; this._isHidden = false; this._isInited = false; this._post = post; this._set = new Set(); } return _createClass(RefMap, [{ key: "addRefNum", value: function addRefNum(post, num) { var isHidden = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; if (isHidden === null) { var strNums = Cfg.strikeHidd && Post.hiddenNums.size ? Post.hiddenNums : null; isHidden = strNums ? strNums.has(+num) : false; } if (!this._set.has(num)) { this._set.add(num); this._el.insertAdjacentHTML('beforeend', this._getHTML(num, '', isHidden)); if (Cfg.hideRefPsts && this._post.isHidden && post instanceof Post) { post.setVisib(true, 'reference to >>' + num); post.ref.hideRef(); } } if (!isHidden && Cfg.removeHidd) { $toggle(this._el, true); } } }, { key: "getElByNum", value: function getElByNum(num) { return $q("a[href$=\"".concat(num, "\"]"), this._el); } }, { key: "has", value: function has(num) { return this._set.has(num); } }, { key: "hideRef", value: function hideRef() { var isForced = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; if (!isForced && !Cfg.hideRefPsts || !this.hasMap || this._isHidden) { return; } this._isHidden = true; for (var _iterator28 = _createForOfIteratorHelperLoose(this._set), _step28; !(_step28 = _iterator28()).done;) { var num = _step28.value; var post = pByNum.get(num); if (post && !post.isHidden) { if (isForced) { post.setUserVisib(true, true, 'reference to >>' + this._post.num); post.ref.hideRef(true); } else if (!post.userToggled) { post.setVisib(true, 'reference to >>' + this._post.num); post.ref.hideRef(); } } } } }, { key: "initPostRef", value: function initPostRef(tUrl, strNums) { var html = ''; for (var _iterator29 = _createForOfIteratorHelperLoose(this._set), _step29; !(_step29 = _iterator29()).done;) { var num = _step29.value; html += this._getHTML(num, tUrl, strNums === null || strNums === void 0 ? void 0 : strNums.has(num)); } this._createEl(html, false); this._isInited = true; } }, { key: "makeUnion", value: function makeUnion(oRef) { this._set = new Set([].concat(_toConsumableArray(this._set), _toConsumableArray(oRef._set)).sort(function (a, b) { return a - b; })); } }, { key: "removeLink", value: function removeLink(num) { this._set["delete"](num); if (!this._set.size) { this.removeMap(); return; } var el = this.getElByNum(num); if (el) { el.nextSibling.remove(); el.remove(); } } }, { key: "removeMap", value: function removeMap() { this._set = new Set(); this._el.remove(); delete this._el; this.hasMap = false; } }, { key: "toggleRef", value: function toggleRef(isHide, isForced) { if (isHide) { this.hideRef(isForced); } else { this.unhideRef(isForced); } } }, { key: "unhideRef", value: function unhideRef() { var isForced = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; if (this._isHidden && !this.hasMap) { return; } this._isHidden = false; for (var _iterator30 = _createForOfIteratorHelperLoose(this._set), _step30; !(_step30 = _iterator30()).done;) { var num = _step30.value; var post = pByNum.get(num); if (post && post.isHidden && !post.spellHidden) { if (isForced) { post.setUserVisib(false); post.ref.unhideRef(true); } else if (!post.userToggled) { post.setVisib(false); post.ref.unhideRef(); } } } } }, { key: "_el", get: function get() { var value = $q('.de-refmap', this._post.el); if (!value) { this._createEl('', this._post.isHidden); value = $q('.de-refmap', this._post.el); } Object.defineProperty(this, '_el', { value: value, configurable: true }); return value; } }, { key: "_createEl", value: function _createEl(innerHTML, isHidden) { this._post.msg.insertAdjacentHTML('afterend', "<div class=\"de-refmap".concat(isHidden ? ' de-post-hiddencontent' : '', "\">").concat(innerHTML, "</div>")); } }, { key: "_getHTML", value: function _getHTML(num, tUrl, isHidden) { return "<a href=\"".concat(tUrl).concat(aib.anchor).concat(num, "\" class=\"de-link-backref").concat(isHidden ? ' de-link-hid' : '').concat(MyPosts.has(num) ? ' de-ref-you' : '', "\">>>").concat(num, "</a><span class=\"de-refcomma\">, </span>"); } }], [{ key: "gen", value: function gen(posts) { var tNums = DelForm.tNums; for (var _iterator31 = _createForOfIteratorHelperLoose(posts), _step31; !(_step31 = _iterator31()).done;) { var _step31$value = _slicedToArray(_step31.value, 2), pNum = _step31$value[0], post = _step31$value[1]; for (var _iterator32 = _createForOfIteratorHelperLoose(post.refLinks()), _step32; !(_step32 = _iterator32()).done;) { var _step32$value = _slicedToArray(_step32.value, 2), link = _step32$value[0], lNum = _step32$value[1]; if (MyPosts.has(lNum)) { link.classList.add('de-ref-you'); if (!MyPosts.has(pNum) && post instanceof AbstractPost) { post.el.classList.add('de-mypost-reply'); } } if (!aib.hasOPNum && tNums.has(lNum)) { link.classList.add('de-ref-op'); } if (!posts.has(lNum)) { continue; } var _posts$get = posts.get(lNum), ref = _posts$get.ref; if (ref._isInited) { ref.addRefNum(post, pNum); } else { ref._set.add(pNum); ref.hasMap = true; } } } } }, { key: "initRefMap", value: function initRefMap(form) { var _form$firstThr; var post = (_form$firstThr = form.firstThr) === null || _form$firstThr === void 0 ? void 0 : _form$firstThr.op; if (post && Cfg.linksNavig) { this.gen(pByNum); var strNums = Cfg.strikeHidd && Post.hiddenNums.size ? Post.hiddenNums : null; for (; post; post = post.next) { if (post.ref.hasMap) { post.ref.initPostRef('', strNums); } } } } }, { key: "updateRefMap", value: function updateRefMap(post, isAdd) { var pNum = post.num; var strNums = isAdd && Cfg.strikeHidd && Post.hiddenNums.size ? Post.hiddenNums : null; var links = $Q('a', post.msg); for (var lNum, i = 0, len = links.length; i < len; ++i) { var link = links[i]; var tc = link.textContent; if (tc[0] !== '>' || tc[1] !== '>' || !(lNum = parseInt(tc.substr(2), 10))) { continue; } if (isAdd && MyPosts.has(lNum)) { link.classList.add('de-ref-you'); if (!MyPosts.has(pNum)) { var postClass = post.el.classList; if (!postClass.contains('de-mypost-reply')) { postClass.add('de-mypost-reply'); if (doc.hidden) { updater.addReplyToYou(pNum); } } } } if (!pByNum.has(lNum)) { continue; } var lPost = pByNum.get(lNum); if (!aib.t) { link.href = "#".concat(aib._4chan ? 'p' : '').concat(lNum); } if (!isAdd) { lPost.ref.removeLink(pNum); return; } if (strNums !== null && strNums !== void 0 && strNums.has(lNum)) { link.classList.add('de-link-hid'); } if (!aib.hasOPNum && DelForm.tNums.has(lNum)) { link.classList.add('de-ref-op'); } lPost.ref.hasMap = true; lPost.ref.addRefNum(post, pNum, strNums === null || strNums === void 0 ? void 0 : strNums.has(pNum)); } } }]); }(); var Thread = function () { function Thread(el, num, prev, form) { var _$q8, _this88 = this; _classCallCheck(this, Thread); this.hasNew = false; this.hiddenCount = 0; this.isFav = false; this.isHidden = false; this.loadCount = 0; this.next = null; this.num = num; var els = $Q(aib.qPost, el); var len = els.length; var omitted = (!aib.t && +((_$q8 = $q(aib.qOmitted, el)) === null || _$q8 === void 0 || (_$q8 = _$q8.textContent) === null || _$q8 === void 0 ? void 0 : _$q8.match(/\d+/)) || 0) + 1; this.postsCount = omitted + len; this.el = el; this.prev = prev; this.form = form; this._lastModified = ''; if (prev) { prev.next = this; } var lastPost = this.op = new Post(aib.getOp(el), this, num, 0, true, prev ? prev.last : null); pByEl.set(el, lastPost); for (var i = 0; i < len; ++i) { var pEl = els[i]; lastPost = new Post(pEl, this, aib.getPNum(pEl), omitted + i, false, lastPost); } this.last = lastPost; el.setAttribute('de-thread', null); Thread.visPosts = Math.max(Thread.visPosts, len); if (localData) { return; } this.btns = $bEnd(el, "<div class=\"de-thr-buttons\">".concat(Post.getPostBtns(true, true), "\n\t\t\t<span class=\"de-thr-updater\">[<a class=\"de-thr-updater-link de-abtn\" href=\"#\"></a>") + (!aib.t ? ']</span>' : '<span id="de-updater-count" style="display: none;"></span>]</span>') + '</div>'); ['click', 'mouseover'].forEach(function (e) { return _this88.btns.addEventListener(e, _this88); }); var _ref50 = _toConsumableArray(this.btns.children); this.btnHide = _ref50[0]; this.btnFav = _ref50[2]; this.btnUpd = _ref50[3]; if (!aib.t && Cfg.hideReplies) { this.btnReplies = $bEnd(this.btns, ' <span class="de-btn-replies">[<a class="de-abtn" href="#"></a>]</span>'); this._toggleReplies(); } } return _createClass(Thread, [{ key: "bottom", get: function get() { return this.isHidden || Cfg.hideReplies ? this.op.bottom : this.last.bottom; } }, { key: "lastNotDeleted", get: function get() { var post = this.last; while (post.isDeleted) { post = post.prev; } return post; } }, { key: "nextNotHidden", get: function get() { var thr; for (thr = this.next; (_thr = thr) !== null && _thr !== void 0 && _thr.isHidden; thr = thr.next) { var _thr; ; } return thr; } }, { key: "prevNotHidden", get: function get() { var thr; for (thr = this.prev; (_thr2 = thr) !== null && _thr2 !== void 0 && _thr2.isHidden; thr = thr.prev) { var _thr2; ; } return thr; } }, { key: "top", get: function get() { return this.op.top; } }, { key: "userTouched", get: function get() { var value = new Map(); Object.defineProperty(this, 'userTouched', { value: value }); return value; } }, { key: "deletePosts", value: function deletePosts(post, delAll, isRemovePost) { SpellsRunner.cachedData = null; var count = 0; do { if (isRemovePost && this.last === post) { this.last = post.prev; } post.deletePost(isRemovePost); post = post.nextNotDeleted; count++; } while (delAll && post); for (var tPost = post; tPost; tPost = tPost.nextInThread) { if (!tPost.isDeleted) { tPost.count -= count; tPost.counterEl.textContent = tPost.count + 1; } } this.postsCount -= count; return post; } }, { key: "handleEvent", value: function handleEvent(e) { e.preventDefault(); var el = nav.fixEventEl(e.target); var elClass = el.classList[0]; var nextThr = this.next; var oldCoord = false; if (e.type === 'click') { switch (elClass) { case 'de-btn-fav': this.toggleFavState(true); break; case 'de-btn-fav-sel': this.toggleFavState(false); break; case 'de-btn-hide': case 'de-btn-hide-user': case 'de-btn-unhide-user': oldCoord = nextThr === null || nextThr === void 0 ? void 0 : nextThr.top; this.op.setUserVisib(!this.isHidden); break; case 'de-btn-reply': postform.showQuickReply(this.last, this.num, false, false, true); break; case 'de-btn-replies': case 'de-replies-show': case 'de-replies-hide': oldCoord = !nextThr || this.last.isOmitted ? null : nextThr.top; this._toggleReplies(); break; case 'de-thr-collapse': case 'de-thr-collapse-link': this.loadPosts(Thread.visPosts, true); break; case 'de-thr-updater': case 'de-thr-updater-link': if (aib.t) { updater.forceLoad(); } else { this.loadPosts('new'); } } if (oldCoord) { scrollTo(deWindow.pageXOffset, deWindow.pageYOffset + nextThr.top - oldCoord); } } else if (e.type === 'mouseover') { switch (el.classList[0]) { case 'de-btn-reply': this.btns.title = Lng.replyToThr[lang]; postform.getSelectedText(); return; case 'de-btn-hide': case 'de-btn-hide-user': case 'de-btn-unhide': case 'de-btn-unhide-user': this.btns.title = Lng.toggleThr[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; default: this.btns.removeAttribute('title'); } } } }, { key: "loadPosts", value: function loadPosts(task) { var _this89 = this; var isSmartScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; var isInformUser = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; if (isInformUser) { $popup('load-thr', Lng.loading[lang], true); } return ajaxPostsLoad(aib.b, this.num, false).then(function (pBuilder) { return _this89._loadFromBuilder(task, isSmartScroll, pBuilder); }, function (err) { return $popup('load-thr', getErrorMessage(err)); }); } }, { key: "loadNewPosts", value: function loadNewPosts() { var _this90 = this; return ajaxPostsLoad(aib.b, this.num, true).then(function (pBuilder) { return pBuilder ? _this90._loadNewFromBuilder(pBuilder) : { newCount: 0, locked: false }; }); } }, { key: "toggleFavState", value: function toggleFavState(isEnable) { var preview = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; var host, board, num, cnt, txt, last; if (preview) { preview.toggleFavBtn(isEnable); } if (!preview || preview.num === this.num) { this.op.toggleFavBtn(isEnable); this.isFav = isEnable; var _aib = aib; host = _aib.host; board = _aib.b; num = this.num; cnt = this.postsCount; txt = this.op.title; last = aib.anchor + this.last.num; } else { var _aib2 = aib; host = _aib2.host; board = preview.board; num = preview.num; cnt = preview.remoteThr.postsCount; txt = preview.remoteThr.title; last = aib.anchor + preview.remoteThr.lastNum; } readFavorites().then(function (favObj) { if (isEnable) { var entry = favObj[host] || (favObj[host] = {}); entry = entry[board] || (entry[board] = {}); entry.url = aib.protocol + '//' + aib.host + aib.getPageUrl(board, 0); var url = aib.getThrUrl(board, num); entry[num] = { cnt: cnt, "new": 0, you: 0, txt: txt, url: url, last: last, time: Date.now() }; } else { removeFavEntry(favObj, host, board, num); } sendStorageEvent('__de-favorites', [host, board, num, favObj, isEnable ? 'add' : 'delete']); saveRenewFavorites(favObj); }); } }, { key: "updateHidden", value: function updateHidden(data) { var thr = this; do { var realHid = data ? $hasProp(data, thr.num) : false; if (thr.isHidden ^ realHid) { if (realHid) { thr.op.setUserVisib(true, false); data[thr.num] = thr.op.title; } else if (thr.isHidden) { thr.op.setUserVisib(false, false); } } } while (thr = thr.next); } }, { key: "_addPost", value: function _addPost(parent, el, i, prev, maybeVParser) { var num = aib.getPNum(el); var wrap = doc.adoptNode(aib.getPostWrap(el, false)); var post = new Post(el, this, num, i, false, prev); parent.append(wrap); if (aib.t && !doc.hidden && Cfg.animation) { $animate(el, 'de-post-new'); } if (this.userTouched.has(num)) { post.setUserVisib(this.userTouched.get(num), false); this.userTouched["delete"](num); } else if (HiddenPosts.has(num)) { HiddenPosts.hideHidden(post, num); } if (maybeVParser.value) { maybeVParser.value.parse(post); } processImgInfoLinks(post); post.addFuncs(); ContentLoader.preloadImages(post); if (aib.t && Cfg.markNewPosts) { Post.addMark(el, false); } if (aib.fixKCUnixFilenames && post.images.hasAttachments) { aib.fixKCUnixFilenames(post); } return post; } }, { key: "_checkBans", value: function _checkBans(pBuilder) { if (!aib.qBan) { return; } for (var _iterator33 = _createForOfIteratorHelperLoose(pBuilder.bannedPostsData()), _step33; !(_step33 = _iterator33()).done;) { var _step33$value = _slicedToArray(_step33.value, 3), banId = _step33$value[0], bNum = _step33$value[1], bEl = _step33$value[2]; var post = bNum ? pByNum.get(bNum) : this.op; if (post && post.banned !== banId) { $q(aib.qBan, post.el).remove(); post.msg.append(bEl); post.banned = banId; } } } }, { key: "_importPosts", value: function _importPosts(last, pBuilder, begin, end, maybeVParser, maybeSpells) { var nums = []; var newCount = end - begin; var newVisCount = newCount; var fragm; if (aib.JsonBuilder && nav.hasTemplate) { var html = []; for (var i = begin; i < end; ++i) { html.push(pBuilder.getPostHTML(i)); nums.push(pBuilder.getPNum(i)); } var temp = doc.createElement('template'); temp.innerHTML = aib.fixHTML(html.join('')); fragm = temp.content; var posts = $Q(aib.qPost, fragm); for (var _i16 = 0, len = posts.length; _i16 < len; ++_i16) { last = this._addPost(fragm, posts[_i16], begin + _i16 + 1, last, maybeVParser); newVisCount -= maybeSpells.value.runSpells(last); embedPostMsgImages(last.el); } } else { fragm = doc.createDocumentFragment(); for (; begin < end; ++begin) { last = this._addPost(fragm, pBuilder.getPostEl(begin), begin + 1, last, maybeVParser); nums.push(last.num); newVisCount -= maybeSpells.value.runSpells(last); embedPostMsgImages(last.el); } } return [newCount, newVisCount, fragm, last, nums]; } }, { key: "_loadFromBuilder", value: function _loadFromBuilder(last, smartScroll, pBuilder) { var _$q9; var nextCoord; var maybeSpells = new Maybe(SpellsRunner); if (smartScroll) { if (this.next) { nextCoord = this.next.top; } else { smartScroll = false; } } var op = this.op, thrEl = this.el; (_$q9 = $q(aib.qOmitted + ', .de-omitted', thrEl)) === null || _$q9 === void 0 || _$q9.remove(); if (this.loadCount === 0) { if (op.trunc) { op.updateMsg(pBuilder.getOpMessage(), maybeSpells.value); } op.ref.removeMap(); } this.loadCount++; this._parsePosts(pBuilder); var needToHide, needToOmit, needToShow; var post = op.next; var needRMUpdate = false; var hasPosts = post && this.postsCount > 1; var existed = hasPosts ? this.postsCount - post.count : 0; switch (last) { case 'new': needToHide = $Q('.de-hidden', thrEl).length; needToOmit = hasPosts ? needToHide + post.count - 1 : 0; needToShow = pBuilder.length - needToOmit; break; case 'all': needToHide = needToOmit = 0; needToShow = pBuilder.length; break; case 'more': needToHide = $Q('.de-hidden', thrEl).length - 10; needToOmit = Math.max(hasPosts ? needToHide + post.count - 1 : 0, 0); needToHide = Math.max(needToHide, 0); needToShow = pBuilder.length - needToOmit; break; default: needToHide = Math.max(existed - last, 0); needToOmit = Math.max(pBuilder.length - last, 0); needToShow = last; } if (needToHide) { while (existed-- !== needToShow) { post.wrap.classList.add('de-hidden'); post.isOmitted = true; post = post.next; } } else { var nonExisted = pBuilder.length - existed; var maybeVParser = new Maybe(Cfg.embedYTube ? VideosParser : null); var _this$_importPosts = this._importPosts(op, pBuilder, Math.max(0, nonExisted + existed - needToShow), nonExisted, maybeVParser, maybeSpells), _this$_importPosts2 = _slicedToArray(_this$_importPosts, 5), fragm = _this$_importPosts2[2], _last = _this$_importPosts2[3], nums = _this$_importPosts2[4]; if (maybeVParser.hasValue) { maybeVParser.value.endParser(); } op.wrap.after(fragm); DollchanAPI.notify('newpost', nums); _last.next = post; if (post) { post.prev = _last; } needRMUpdate = true; needToShow = Math.min(nonExisted + existed, needToShow); } while (existed-- !== 0) { if (post.trunc) { var newMsg = doc.adoptNode($q(aib.qPostMsg, pBuilder.getPostEl(post.count - 1))); post.updateMsg(aib.fixHTML(newMsg), maybeSpells.value); } if (post.isOmitted) { post.wrap.classList.remove('de-hidden'); post.isOmitted = false; } if (needRMUpdate) { RefMap.updateRefMap(post, true); } post = post.next; } if (maybeSpells.hasValue) { maybeSpells.value.endSpells(); } var btns = this._moveBtnsToEnd(); if (!$q('.de-thr-collapse', btns)) { btns.insertAdjacentHTML('beforeend', "<span class=\"de-thr-collapse\"> [<a class=\"de-thr-collapse-link de-abtn\" href=\"".concat(aib.getThrUrl(aib.b, this.num), "\"></a>]</span>")); } if (needToShow > Thread.visPosts) { thrNavPanel.addThr(this); btns.lastChild.style.display = 'initial'; } else { thrNavPanel.removeThr(this); $hide(btns.lastChild); } if (needToOmit > 0) { op.el.insertAdjacentHTML('afterend', "<div class=\"de-omitted\">".concat(needToOmit, "</div>")); } if (smartScroll) { scrollTo(deWindow.pageXOffset, deWindow.pageYOffset + this.next.top - nextCoord); } Pview.updatePosition(false); if (Cfg.hideReplies) { this.btnReplies.firstElementChild.className = 'de-replies-hide de-abtn'; if (Cfg.updThrBtns) { $show(this.btnUpd); } } closePopup('load-thr'); } }, { key: "_loadNewFromBuilder", value: function _loadNewFromBuilder(pBuilder) { var lastOffset = postform.isVisible ? postform.top : null; var _this$_parsePosts = this._parsePosts(pBuilder), _this$_parsePosts2 = _slicedToArray(_this$_parsePosts, 2), newPosts = _this$_parsePosts2[0], newVisPosts = _this$_parsePosts2[1]; this._moveBtnsToEnd(); if (lastOffset !== null) { scrollTo(deWindow.pageXOffset, deWindow.pageYOffset + postform.top - lastOffset); } if (newPosts !== 0) { Panel.updateCounter(pBuilder.length + 1 - (Cfg.panelCounter === 2 ? this.hiddenCount : 0), $Q(".de-reply:not(.de-post-removed) ".concat(aib.qPostImg, ", .de-oppost ").concat(aib.qPostImg), this.el).length, pBuilder.postersCount); Pview.updatePosition(true); } if (pBuilder.isClosed) { AjaxCache.clearCache(); } return { newCount: newVisPosts, locked: pBuilder.isClosed }; } }, { key: "_moveBtnsToEnd", value: function _moveBtnsToEnd() { var btns = this.btns, el = this.el; if (btns !== el.lastChild) { el.append(btns); } return btns; } }, { key: "_parsePosts", value: function _parsePosts(pBuilder) { this._checkBans(pBuilder); var newPosts = 0; var newVisPosts = 0; var post = this.lastNotDeleted; var len = pBuilder.length; var maybeSpells = new Maybe(SpellsRunner); var maybeVParser = new Maybe(Cfg.embedYTube ? VideosParser : null); var _post6 = post, count = _post6.count; if (count !== 0 && (count > len || pBuilder.getPNum(count - 1) !== post.num)) { post = this.op.nextNotDeleted; var i = post.count - 1; var firstChangedPost = null; for (; i < len && post;) { var _post7 = post, num = _post7.num, prev = _post7.prev; var iNum = pBuilder.getPNum(i); if (num === iNum) { i++; post = post.nextNotDeleted; continue; } if (num <= iNum) { if (!firstChangedPost) { firstChangedPost = post; } post = this.deletePosts(post, false, !aib.t); continue; } if (!firstChangedPost) { firstChangedPost = prev; } var cnt = 0; do { cnt++; i++; } while (pBuilder.getPNum(i) < num); var res = this._importPosts(prev, pBuilder, i - cnt, i, maybeVParser, maybeSpells); newPosts += res[0]; this.postsCount += res[0]; newVisPosts += res[1]; prev.wrap.after(res[2]); res[3].next = post; post.prev = res[3]; DollchanAPI.notify('newpost', res[4]); for (var temp = post; temp; temp = temp.nextInThread) { temp.count += cnt; } } if (i === len && post) { this.deletePosts(post, true, !aib.t); } if (firstChangedPost && maybeSpells.hasValue && maybeSpells.value.hasNumSpell) { for (post = firstChangedPost.nextInThread; post; post = post.nextInThread) { maybeSpells.value.runSpells(post); } } if (newPosts !== 0) { for (post = firstChangedPost; post; post = post.nextInThread) { RefMap.updateRefMap(post, true); } } } if (len + 1 > this.postsCount) { var _res = this._importPosts(this.last, pBuilder, this.lastNotDeleted.count, len, maybeVParser, maybeSpells); newPosts += _res[0]; newVisPosts += _res[1]; (aib.qPostsParent ? $q(aib.qPostsParent, this.el) : this.el).append(_res[2]); this.last = _res[3]; DollchanAPI.notify('newpost', _res[4]); this.postsCount = len + 1; } updateFavorites(this.op.num, [this.postsCount, newPosts, updater.getRepliesToYou, this.last.num], 'update'); if (maybeVParser.hasValue) { maybeVParser.value.endParser(); } if (maybeSpells.hasValue) { maybeSpells.value.endSpells(); } return [newPosts, newVisPosts]; } }, { key: "_toggleReplies", value: function _toggleReplies() { var _this91 = this, _$q10; var isHide = !this.last.isOmitted; var post = this.op; var i = 0; for (; post !== this.last; ++i) { (post = post.next).isOmitted = isHide; post.wrap.classList.toggle('de-hidden', isHide); } this.btnReplies.firstElementChild.className = "".concat(isHide ? 'de-replies-show' : 'de-replies-hide', " de-abtn"); _toConsumableArray(this.btns.children).forEach(function (el) { return el !== _this91.btnReplies && $toggle(el, !isHide); }); (_$q10 = $q(aib.qOmitted + ', .de-omitted', this.el)) === null || _$q10 === void 0 || _$q10.remove(); i = this.postsCount - 1 - (isHide ? 0 : i); if (i) { this.op.el.insertAdjacentHTML('afterend', "<span class=\"de-omitted\">".concat(i, "</span> ")); } } }], [{ key: "first", get: function get() { return DelForm.first.firstThr; } }, { key: "last", get: function get() { return DelForm.last.lastThr; } }, { key: "removeSavedData", value: function removeSavedData() { } }]); }(); Thread.visPosts = 2; var thrNavPanel = { addThr: function addThr(thr) { this._thrs.add(thr.el); if (this._thrs.size === 1) { doc.defaultView.addEventListener('scroll', this); } if (!this._visible) { this._checkThreads(); } }, handleEvent: function handleEvent(e) { var _this92 = this; switch (e.type) { case 'scroll': deWindow.requestAnimationFrame(function () { return _this92._checkThreads(); }); break; case 'mouseover': this._expandCollapse(true, nav.fixEventEl(e.relatedTarget)); break; case 'mouseout': this._expandCollapse(false, nav.fixEventEl(e.relatedTarget)); break; case 'click': this._handleClick(e); break; } }, initThrNav: function initThrNav() { var _this93 = this; var el = $bEnd(doc.body, "\n\t\t<div id=\"de-thr-navpanel\" class=\"de-thr-navpanel-hidden\" style=\"display: none;\">\n\t\t\t<svg id=\"de-thr-navarrow\"><use xlink:href=\"#de-symbol-thr-nav-arrow\"/></svg>\n\t\t\t<div id=\"de-thr-navup\">\n\t\t\t\t<svg viewBox=\"0 0 24 24\"><use xlink:href=\"#de-symbol-thr-nav-up\"/></svg>\n\t\t\t</div>\n\t\t\t<div id=\"de-thr-navdown\">\n\t\t\t\t<svg viewBox=\"0 0 24 24\"><use xlink:href=\"#de-symbol-thr-nav-down\"/></svg>\n\t\t\t</div>\n\t\t</div>"); ['mouseover', 'mouseout', 'click'].forEach(function (e) { return el.addEventListener(e, _this93, true); }); this._el = el; this._thrs = new Set(); }, removeThr: function removeThr(thr) { this._thrs["delete"](thr.el); if (!this._thrs.size) { $hide(this._el); this._currentThr = null; this._visible = false; doc.defaultView.removeEventListener('scroll', this); } }, _currentThr: null, _el: null, _toggleTO: null, _thrs: null, _visible: false, _checkThreads: function _checkThreads() { var el = this._findCurrentThread(); if (el) { if (!this._visible) { this._toggleNavPanel(false); } this._currentThr = el; } else if (this._visible) { this._toggleNavPanel(true); } }, _expandCollapse: function _expandCollapse(isExpand, targetEl) { var _this94 = this; if (!$contains(this._el, targetEl)) { clearTimeout(this._toggleTO); this._toggleTO = setTimeout(function () { return _this94._el.classList.toggle('de-thr-navpanel-hidden', !isExpand); }, Cfg.linksOver); } }, _findCurrentThread: function _findCurrentThread() { var _this95 = this; Object.defineProperty(this, '_findCurrentThread', { value: 'elementsFromPoint' in doc ? function () { return doc.elementsFromPoint(Post.sizing.wWidth / 2, Post.sizing.wHeight / 2).find(function (el) { return _this95._thrs.has(el); }); } : function () { var el = doc.elementFromPoint(Post.sizing.wWidth / 2, Post.sizing.wHeight / 2); while (el) { if (_this95._thrs.has(el)) { return el; } el = el.parentElement; } return undefined; } }); return this._findCurrentThread(); }, _handleClick: function _handleClick(e) { var el = nav.fixEventEl(e.target); switch ((el.tagName.toLowerCase() === 'svg' ? el.parentNode : el).id) { case 'de-thr-navup': scrollTo(deWindow.pageXOffset, deWindow.pageYOffset + this._currentThr.getBoundingClientRect().top - 50); break; case 'de-thr-navdown': scrollTo(deWindow.pageXOffset, deWindow.pageYOffset + this._currentThr.getBoundingClientRect().bottom - Post.sizing.wHeight + 50); break; } }, _toggleNavPanel: function _toggleNavPanel(isHide) { this._el.style.display = isHide ? 'none' : 'initial'; this._visible = !isHide; } }; function initThreadUpdater(title, enableUpdate) { var focusLoadTime; var disabledByUser = true; var enabled = false; var repliesToYou = new Set(); var lastECode = 200; var newPosts = 0; var paused = false; var sendError = false; var storageName = "de-last-postscount-".concat(aib.b, "-").concat(aib.t); var audio = { enabled: false, repeatMS: 0, disableAudio: function disableAudio() { this.stopAudio(); this.enabled = false; var btn = $id('de-panel-audio-on'); if (btn) { btn.id = 'de-panel-audio-off'; } }, playAudio: function playAudio() { var _this96 = this; this.stopAudio(); if (this.repeatMS === 0) { this._el.play(); return; } this._playInterval = setInterval(function () { return _this96._el.play(); }, this.repeatMS); }, stopAudio: function stopAudio() { if (this._playInterval) { clearInterval(this._playInterval); this._playInterval = null; } }, get _el() { var value = doc.createElement('audio'); value.setAttribute('preload', 'auto'); value.src = gitRaw + 'signal.ogg'; Object.defineProperty(this, '_el', { value: value }); return value; } }; var counter = { count: function count(delayMS, useCounter, callback) { var _this97 = this; if (!this._enabled || !useCounter) { this._countingTO = setTimeout(function () { _this97._countingTO = null; callback(); }, delayMS); return; } var seconds = delayMS / 1e3; this._set(seconds); this._countingIV = setInterval(function () { seconds--; if (seconds === 0) { _this97._stopCounter(); callback(); } else { _this97._set(seconds); } }, 1e3); }, disableCounter: function disableCounter() { this._enabled = false; this._stopCounter(); $hide(this._el); }, enableCounter: function enableCounter() { this._enabled = true; $show(this._el); }, setWait: function setWait() { this._stopCounter(); if (this._enabled) { this._el.innerHTML = '<svg class="de-wait"><use xlink:href="#de-symbol-wait"/></svg>'; } }, _countingTO: null, _countingIV: null, _enabled: false, get _el() { var value = $id('de-updater-count'); Object.defineProperty(this, '_el', { value: value }); return value; }, _set: function _set(seconds) { this._el.innerHTML = seconds; }, _stopCounter: function _stopCounter() { if (this._countingIV) { clearInterval(this._countingIV); this._countingIV = null; } if (this._countingTO) { clearTimeout(this._countingTO); this._countingTO = null; } } }; var favicon = { get canBlink() { return Cfg.favIcoBlink && !!this.originalIcon; }, get originalIcon() { return this._iconEl ? this._iconEl.href : null; }, initIcons: function initIcons() { var _this98 = this; if (this._isInited) { return; } this._isInited = true; var icon = new Image(); icon.onload = function (e) { try { _this98._initIconsHelper(e.target); } catch (err) { console.warn('Icon error:', err); } }; if (aib._4chan) { $ajax(this._iconEl.href, { responseType: 'blob' }, true).then(function (xhr) { icon.src = 'response' in xhr ? deWindow.URL.createObjectURL(xhr.response) : '/favicon.ico'; }); return; } icon.src = this._iconEl.href; }, startBlink: function startBlink(isError) { var _this99 = this; var iconUrl = !this._hasIcons ? this._emptyIcon : isError ? this._iconError : repliesToYou.size ? this._getIconYou(newPosts) : this._getIconNew(newPosts); if (this._blinkInterv) { if (this._currentIcon === iconUrl) { return; } clearInterval(this._blinkInterv); } this._currentIcon = iconUrl; this._blinkInterv = setInterval(function () { _this99._isOrigIcon = !_this99._isOrigIcon; _this99._setIcon(_this99._isOrigIcon ? _this99.originalIcon : _this99._currentIcon); }, this._blinkMS); }, stopBlink: function stopBlink() { if (this._blinkInterv) { clearInterval(this._blinkInterv); this._blinkInterv = null; } if (!this._isOrigIcon) { this._setIcon(this.originalIcon); this._isOrigIcon = true; } }, updateIcon: function updateIcon(isError) { if (!isError && !newPosts) { this._setIcon(this.originalIcon); } else if (this._hasIcons) { this._setIcon(isError ? this._iconError : repliesToYou.size ? this._getIconYou(newPosts) : this._getIconNew(newPosts)); } }, _blinkInterv: null, _blinkMS: 800, _currentIcon: null, _emptyIcon: 'data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==', _getIconNew: function _getIconNew() { return null; }, _getIconYou: function _getIconYou() { return null; }, _hasIcons: false, _iconError: null, _iconsNew: [], _iconsYou: [], _isInited: false, _isOrigIcon: true, get _iconEl() { var el = $q('link[rel="shortcut icon"]', doc.head) || $bEnd(doc.head, '<link href="/favicon.ico" rel="shortcut icon"/>'); Object.defineProperties(this, { _iconEl: { value: el, writable: true }, originalIcon: { value: el.href } }); return el; }, _drawCanvCircle: function _drawCanvCircle(ctx, strokeColor, fillColor, scale) { ctx.beginPath(); ctx.arc(10.5 * scale, 10.5 * scale, 5 * scale, 0, 2 * Math.PI); ctx.fillStyle = fillColor; ctx.fill(); ctx.lineWidth = 1; ctx.strokeStyle = strokeColor; ctx.stroke(); }, _drawCanvLines: function _drawCanvLines(ctx, line1, line2, color, width, scale) { ctx.beginPath(); ctx.strokeStyle = color; ctx.lineWidth = width * scale; ctx.moveTo(line1[0] * scale, line1[1] * scale); ctx.lineTo(line1[2] * scale, line1[3] * scale); ctx.moveTo(line2[0] * scale, line2[1] * scale); ctx.lineTo(line2[2] * scale, line2[3] * scale); ctx.stroke(); }, _drawIconsNewYou: function _drawIconsNewYou(ctx, canvas, id, iconCircle, scale) { ctx.putImageData(iconCircle, 0, 0); ctx.fillStyle = '#fff'; if (id) { ctx.font = "bold ".concat(12 * scale, "px Arial"); ctx.fillText(id, 7 * scale, 15 * scale); } else { ctx.fillRect(6 * scale, 9 * scale, 2 * scale, 3 * scale); ctx.fillRect(9.5 * scale, 9 * scale, 2 * scale, 3 * scale); ctx.fillRect(13 * scale, 9 * scale, 2 * scale, 3 * scale); } return canvas.toDataURL('image/png'); }, _initIconsHelper: function _initIconsHelper(icon) { var _this100 = this; var canvas = doc.createElement('canvas'); var ctx = canvas.getContext('2d'); var wh = Math.max(icon.naturalHeight, 16 * (deWindow.devicePixelRatio || 1)); var scale = wh / 16; canvas.width = canvas.height = wh; ctx.drawImage(icon, 0, 0, wh, wh); var original = ctx.getImageData(0, 0, wh, wh); this._drawCanvLines(ctx, [15, 15, 7, 7], [7, 15, 15, 7], '#780000', 3, scale); this._drawCanvLines(ctx, [14.5, 14.5, 7.5, 7.5], [7.5, 14.5, 14.5, 7.5], '#fa2020', 1.5, scale); this._iconError = canvas.toDataURL('image/png'); ctx.putImageData(original, 0, 0); this._drawCanvCircle(ctx, '#174f1d', '#00a000', scale); var iconNewCircle = ctx.getImageData(0, 0, wh, wh); ctx.putImageData(original, 0, 0); this._drawCanvCircle(ctx, '#122091', '#1b6df5', scale); var iconYouCircle = ctx.getImageData(0, 0, wh, wh); this._getIconNew = function (newPosts) { var id = newPosts < 10 ? newPosts : 0; return _this100._iconsNew[id] || (_this100._iconsNew[id] = _this100._drawIconsNewYou(ctx, canvas, id, iconNewCircle, scale)); }; this._getIconYou = function (newPosts) { var id = newPosts < 10 ? newPosts : 0; return _this100._iconsYou[id] || (_this100._iconsYou[id] = _this100._drawIconsNewYou(ctx, canvas, id, iconYouCircle, scale)); }; this._hasIcons = true; }, _setIcon: function _setIcon(iconUrl) { this._iconEl.remove(); this._iconEl = $aBegin(doc.head, "<link rel=\"shortcut icon\" href=\"".concat(iconUrl, "\">")); } }; var notification = { get canShow() { return Cfg.desktNotif && this._granted; }, checkPermission: function checkPermission() { var _this101 = this; return _asyncToGenerator(_regeneratorRuntime().mark(function _callee42() { return _regeneratorRuntime().wrap(function _callee42$(_context50) { while (1) switch (_context50.prev = _context50.next) { case 0: if (!(Cfg.desktNotif && 'permission' in Notification)) { _context50.next = 8; break; } _context50.t0 = Notification.permission.toLowerCase(); _context50.next = _context50.t0 === 'default' ? 4 : _context50.t0 === 'denied' ? 6 : 8; break; case 4: _this101._requestPermission(); return _context50.abrupt("break", 8); case 6: _context50.next = 8; return CfgSaver.save('desktNotif', 0); case 8: case "end": return _context50.stop(); } }, _callee42); }))(); }, closeNotif: function closeNotif() { if (this._notifEl) { this._notifEl.close(); this._notifEl = null; } }, showNotif: function showNotif() { var _this102 = this; var lngQuantity = function lngQuantity(num) { var new10 = num % 10; return lang === 1 ? +(num !== 1) : new10 > 4 || new10 === 0 || (num % 100 / 10 | 0) === 1 ? 2 : new10 === 1 ? 0 : 1; }; var post = Thread.first.last; var toYou = repliesToYou.size; var notif = new Notification("".concat(aib.domain, "/").concat(aib.b, "/").concat(aib.t, ": ").concat(newPosts, " ").concat(Lng.newPost[lang][lngQuantity(newPosts)], ". ").concat(toYou ? "".concat(toYou, " ").concat(Lng.youReplies[lang][lngQuantity(toYou)], ".") : ''), { body: Lng.latestPost[lang] + ':\n' + post.text.substring(0, 250).replace(/\s+/g, ' '), icon: post.images.firstAttach ? post.images.firstAttach.src : favicon.originalIcon, tag: aib.domain + aib.b + aib.t }); notif.onshow = function () { return setTimeout(function () { return notif === _this102._notifEl && _this102.closeNotif(); }, 12e3); }; notif.onclick = function () { return deWindow.focus(); }; notif.onerror = function () { deWindow.focus(); _this102._requestPermission(); }; this._notifEl = notif; }, _granted: true, _notifEl: null, _requestPermission: function _requestPermission() { var _this103 = this; this._granted = false; Notification.requestPermission(function () { var _ref51 = _asyncToGenerator(_regeneratorRuntime().mark(function _callee43(state) { return _regeneratorRuntime().wrap(function _callee43$(_context51) { while (1) switch (_context51.prev = _context51.next) { case 0: if (!(state.toLowerCase() === 'denied')) { _context51.next = 5; break; } _context51.next = 3; return CfgSaver.save('desktNotif', 0); case 3: _context51.next = 6; break; case 5: _this103._granted = true; case 6: case "end": return _context51.stop(); } }, _callee43); })); return function (_x30) { return _ref51.apply(this, arguments); }; }()); } }; var updMachine = { start: function start() { var needSleep = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; var loadOnce = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; if (this._state !== -1) { this.stopUpdater(false); } this._state = 0; this._loadOnce = loadOnce; this._delay = this._initDelay = Cfg.updThrDelay * 1e3; if (!loadOnce) { this._setUpdateStatus('on'); } this._makeStep(needSleep); }, stopUpdater: function stopUpdater() { var updateStatus = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; if (this._state !== -1) { this._state = -1; if (this._loadPromise) { this._loadPromise.cancelPromise(); this._loadPromise = null; } counter.setWait(); if (updateStatus) { this._setUpdateStatus('off'); } } }, _delay: 0, _initDelay: 0, _loadOnce: false, _loadPromise: null, _seconds: 0, _state: -1, get _panelButton() { var value = $q('button[id^="de-panel-upd"]'); if (value) { Object.defineProperty(this, '_panelButton', { value: value }); } return value; }, _handleNewPosts: function _handleNewPosts(lPosts, err) { if (err instanceof CancelError) { return; } infoLoadErrors(err, false); var eCode = err instanceof AjaxError ? err.code : 0; if (eCode !== 200 && eCode !== 304) { if (doc.hidden && favicon.canBlink) { favicon.startBlink(true); } if (eCode === -1 || eCode === 404 && lastECode === 404) { Thread.removeSavedData(aib.b, aib.t); updateTitle(eCode); _disableUpdater(); } else { this._setUpdateStatus('warn'); updateTitle(eCode); this._makeStep(); } lastECode = eCode; updateFavorites(aib.t, getErrorMessage(err), aib.qClosed && $q(aib.qClosed) ? 'closed' : 'error'); return; } if (lastECode !== 200) { favicon.stopBlink(); this._setUpdateStatus('on'); updateTitle(eCode); } lastECode = eCode; if (doc.hidden) { if (lPosts !== 0) { newPosts += lPosts; updateTitle(); if (favicon.canBlink) { favicon.startBlink(false); } if (notification.canShow) { notification.showNotif(); } if (audio.enabled) { audio.playAudio(); } sesStorage[storageName] = Thread.first.postsCount; this._delay = this._initDelay; } else if (this._delay !== 12e4) { this._delay = Math.min(this._delay + this._initDelay, 12e4); } } this._makeStep(); }, _makeStep: function _makeStep() { var _this104 = this; var needSleep = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; while (true) { switch (this._state) { case 0: if (needSleep) { this._state = 1; counter.count(this._delay, !doc.hidden, function () { return _this104._makeStep(); }); return; } case 1: counter.setWait(); this._state = 2; this._loadPromise = Thread.first.loadNewPosts().then(function (_ref52) { var newCount = _ref52.newCount, locked = _ref52.locked; return _this104._handleNewPosts(newCount, locked ? AjaxError.Locked : AjaxError.Success); }, function (err) { return _this104._handleNewPosts(0, err); }); return; case 2: this._loadPromise = null; if (this._loadOnce) { this._state = -1; return; } this._state = 0; break; default: console.error('Invalid thread updater state:', this._state, new Error().stack); return; } } }, _setUpdateStatus: function _setUpdateStatus(status) { if (this._panelButton) { this._panelButton.id = 'de-panel-upd-' + status; this._panelButton.title = Lng.panelBtn["upd-".concat(status === 'off' ? 'off' : 'on')][lang]; if (nav.isPresto) { this._panelButton.innerHTML = '<svg class="de-panel-svg"><use xlink:href="#de-symbol-panel-upd"/></svg>'; } } } }; function _enableUpdater() { enabled = true; disabledByUser = paused = false; repliesToYou = new Set(); newPosts = 0; focusLoadTime = -1e4; notification.checkPermission(); if (Cfg.updCount) { counter.enableCounter(); } favicon.initIcons(); } function _disableUpdater() { if (enabled) { audio.disableAudio(); counter.disableCounter(); updMachine.stopUpdater(); enabled = false; } } function forceLoadPosts() { if (enabled && paused) { return; } if (!enabled && !disabledByUser) { _enableUpdater(); } updMachine.start(false, !enabled); } function updateTitle() { var eCode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : lastECode; doc.title = (sendError === true ? "{".concat(Lng.error[lang], "} ") : '') + (eCode <= 0 || eCode === 200 ? '' : "{".concat(eCode, "} ")) + (newPosts ? "[".concat(newPosts, "] ") : '') + title; favicon.updateIcon(eCode !== 200 && eCode !== 304); } doc.addEventListener('visibilitychange', function (e) { if (!doc.hidden) { var focusTime = e.timeStamp; favicon.stopBlink(); audio.stopAudio(); notification.closeNotif(); newPosts = 0; repliesToYou = new Set(); sendError = false; setTimeout(function () { updateTitle(); if (enabled && focusTime - focusLoadTime > 1e4) { focusLoadTime = focusTime; forceLoadPosts(); } }, 200); if (aib.t) { var thr = Thread.first; updateFavorites(thr.op.num, [thr.postsCount, 0, 0, thr.last.num], 'update'); } } else if (Thread.first) { Post.clearMarks(); } }); if (enableUpdate) { _enableUpdater(); updMachine.start(true); } return { get getRepliesToYou() { return repliesToYou.size; }, addReplyToYou: function addReplyToYou(pNum) { repliesToYou.add(pNum); }, continueUpdater: function continueUpdater() { var needSleep = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; if (enabled && paused) { updMachine.start(needSleep); paused = false; } }, disableUpdater: function disableUpdater() { disabledByUser = true; _disableUpdater(); }, enableUpdater: function enableUpdater() { if (!enabled) { _enableUpdater(); updMachine.start(); } }, forceLoad: function forceLoad(e) { if (e) { e.preventDefault(); } Post.clearMarks(); if (enabled && paused) { return; } $popup('newposts', Lng.loading[lang], true); forceLoadPosts(); }, pauseUpdater: function pauseUpdater() { if (enabled && !paused) { updMachine.stopUpdater(); paused = true; } }, toggle: function toggle() { if (enabled) { this.disableUpdater(); } else { this.enableUpdater(); } }, toggleAudio: function toggleAudio(repeatMS) { if (audio.enabled) { audio.stopAudio(); return audio.enabled = false; } audio.repeatMS = repeatMS; return audio.enabled = true; }, toggleCounter: function toggleCounter(enableCnt) { if (enableCnt) { counter.enableCounter(); counter.setWait(); } else { counter.disableCounter(); } forceLoadPosts(); }, sendErrNotif: function sendErrNotif() { if (Cfg.sendErrNotif && doc.hidden) { sendError = true; updateTitle(); } } }; } var DelForm = function () { function DelForm(formEl, pageNum, prev) { _classCallCheck(this, DelForm); var thr = null; this.el = formEl; this.firstThr = null; this.lastThr = null; this.next = null; this.pageNum = pageNum; this.prev = prev; if (prev) { prev.next = this; thr = prev.lastThr; } formEl.setAttribute('de-form', ''); formEl.removeAttribute('id'); $delAll('script', this.el); var threads = DelForm.getThreads(this.el); for (var i = 0, len = threads.length; i < len; ++i) { var num = aib.getTNum(threads[i]); if (!DelForm.tNums.has(num)) { DelForm.tNums.add(num); thr = new Thread(threads[i], num, thr, this); if (this.firstThr === null) { this.firstThr = thr; } continue; } var el = threads[i]; var thrNext = threads[i + 1]; var elNext = el.nextSibling; while (elNext && elNext !== thrNext) { elNext.remove(); elNext = el.nextSibling; } el.remove(); console.log('Repeated thread: ' + num); } if (this.firstThr === null) { if (prev) { this.lastThr = prev.lastThr; } return; } this.lastThr = thr; } return _createClass(DelForm, [{ key: "passEl", get: function get() { var value = aib.qDelPassw ? $q(aib.qDelPassw, this.el) : null; Object.defineProperty(this, 'passEl', { value: value }); return value; } }, { key: "addStuff", value: function addStuff() { var el = this.el; if (Cfg.ajaxPosting && !localData) { var delBtn = aib.qDelBtn ? $q(aib.qDelBtn, el) : null; if (delBtn) { el.onsubmit = function (e) { return e.preventDefault(); }; delBtn.onclick = function (e) { e.preventDefault(); postform.closeReply(); $popup('delete', Lng.deleting[lang], true); html5Submit(el, e.target).then(checkDelete)["catch"](function (err) { return $popup('delete', getErrorMessage(err)); }); }; } Logger.log('Init AJAX'); } ContentLoader.preloadImages(el); Logger.log('Preload images'); embedAudioLinks(el); Logger.log('Audio links'); if (Cfg.embedYTube) { new VideosParser().parse(el).endParser(); Logger.log('Video links'); } processImgInfoLinks(el); Logger.log('Image names'); RefMap.initRefMap(this); Logger.log('Reflinks map'); } }], [{ key: "getThreads", value: function getThreads(formEl) { var threads = $Q(aib.qThread, formEl); var len = threads.length; if (len === 0) { if (localData) { threads = $Q('div[de-thread]'); len = threads.length; } if (len === 0) { threads = DelForm._parseClasslessThreads(formEl); } } return threads; } }, { key: Symbol.iterator, value: function value() { return { _data: this.first, next: function next() { var value = this._data; if (value) { this._data = value.next; return { value: value, done: false }; } return { done: true }; } }; } }, { key: "_parseClasslessThreads", value: function _parseClasslessThreads(formEl) { var i, len; var cThr = doc.createElement('div'); var threads = []; var fNodes = _toConsumableArray(formEl.childNodes); for (i = 0, len = fNodes.length - 1; i < len; ++i) { var _el$tagName; var el = fNodes[i]; if (((_el$tagName = el.tagName) === null || _el$tagName === void 0 ? void 0 : _el$tagName.toLowerCase()) === 'hr') { var _lastEl$tagName; el.before(cThr); var lastEl = cThr.lastElementChild; if (((_lastEl$tagName = lastEl.tagName) === null || _lastEl$tagName === void 0 ? void 0 : _lastEl$tagName.toLowerCase()) === 'br') { el.before(lastEl); } try { aib.getTNum(cThr); threads.push(cThr); } catch (err) {} cThr = doc.createElement('div'); } else { cThr.append(el); if (i === len - 1) { var tNum = void 0; try { tNum = aib.getTNum(cThr); } catch (err) {} if (tNum) { threads.push(cThr); } } } } cThr.append(fNodes[i]); formEl.append(cThr); return threads; } }]); }(); DelForm.tNums = new Set(); function checkStorage() { try { locStorage = deWindow.localStorage; sesStorage = deWindow.sessionStorage; sesStorage['de-test'] = 1; } catch (err) { if (typeof unsafeWindow !== 'undefined') { locStorage = unsafeWindow.localStorage; sesStorage = unsafeWindow.sessionStorage; } } if (!(locStorage && _typeof(locStorage) === 'object' && sesStorage)) { console.error('Webstorage error: please, enable webstorage!'); return false; } return true; } function initNavFuncs() { var ua = navigator.userAgent; var isFirefox = ua.includes('Gecko/'); var isWebkit = ua.includes('WebKit/'); var isChrome = isWebkit && ua.includes('Chrome/'); var isSafari = isWebkit && !isChrome; var hasPrestoStorage = !!prestoStorage && !ua.includes('Opera Mobi'); var canUseFetch = 'AbortController' in deWindow; var hasNewGM = typeof GM !== 'undefined' && typeof GM.xmlHttpRequest === 'function'; var hasGMXHR, hasOldGM, hasWebStorage, scriptHandler; if (hasNewGM) { var inf = GM.info; var handlerName = inf ? inf.scriptHandler : ''; if (handlerName === 'FireMonkey') { hasGMXHR = false; hasOldGM = true; } else { hasGMXHR = typeof GM.xmlHttpRequest === 'function'; hasOldGM = false; } hasWebStorage = false; scriptHandler = inf ? handlerName + ' ' + inf.version : 'Greasemonkey'; } else { hasGMXHR = typeof GM_xmlhttpRequest === 'function'; try { hasOldGM = typeof GM_setValue === 'function' && (!isChrome || !GM_setValue.toString().includes('not supported')); } catch (err) { hasOldGM = err.message === 'Permission denied to access property "toString"'; } hasWebStorage = !hasOldGM && (isFirefox || 'chrome' in deWindow) && (typeof chrome === "undefined" ? "undefined" : _typeof(chrome)) === 'object' && !!chrome && !!chrome.storage; scriptHandler = hasWebStorage ? 'WebExtension' : typeof GM_info === 'undefined' ? isFirefox ? 'Scriptish' : 'Unknown' : GM_info.scriptHandler ? "".concat(GM_info.scriptHandler, " ").concat(GM_info.version) : isFirefox ? 'Greasemonkey' : 'Unknown'; } if (!('requestAnimationFrame' in deWindow)) { deWindow.requestAnimationFrame = function (fn) { return setTimeout(fn, 0); }; } var needFileHack = false; try { new File([''], ''); if (isFirefox || isSafari) { needFileHack = !FormData.prototype.get; } } catch (err) { needFileHack = true; } if (needFileHack && FormData) { var OrigFormData = FormData; var origAppend = FormData.prototype.append; FormData = function FormData(form) { var rv = form ? new OrigFormData(form) : new OrigFormData(); rv.append = function append(name, value) { var fileName = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; if (value instanceof Blob && 'name' in value && fileName === null) { return origAppend.call(this, name, value, value.name); } return origAppend.apply(this, [name, value, fileName]); }; return rv; }; deWindow.File = function File(arr, name) { var rv = new Blob(arr); rv.name = name; return rv; }; } nav = { canUseFetch: canUseFetch, canUseNativeXHR: true, firefoxVer: isFirefox ? +(ua.match(/Firefox\/(\d+)/) || [0, 0])[1] : 0, hasGlobalStorage: hasOldGM || hasNewGM || hasWebStorage || hasPrestoStorage, hasGMXHR: hasGMXHR, hasNewGM: hasNewGM, hasOldGM: hasOldGM, hasPrestoStorage: hasPrestoStorage, hasWebStorage: hasWebStorage, isESNext: typeof deMainFuncOuter === 'undefined', isFirefox: isFirefox, isMsEdge: ua.includes('Edge/'), isMobile: /Android|iPhone/i.test(ua), isPresto: !!deWindow.opera, isSafari: isSafari, isTampermonkey: scriptHandler.startsWith('Tampermonkey'), isViolentmonkey: scriptHandler.startsWith('Violentmonkey'), isWebkit: isWebkit, scriptHandler: scriptHandler, ua: ua + (isFirefox ? " [".concat(navigator.buildID, "]") : ''), get canPlayMP3() { var value = !!new Audio().canPlayType('audio/mpeg;'); Object.defineProperty(this, 'canPlayMP3', { value: value }); return value; }, get hasTemplate() { var value = 'content' in doc.createElement('template'); Object.defineProperty(this, 'hasTemplate', { value: value }); return value; }, get hasWorker() { var value = false; try { value = 'Worker' in deWindow && 'URL' in deWindow; } catch (err) {} if (value && this.isFirefox) { value = this.firefoxVer >= 40; } Object.defineProperty(this, 'hasWorker', { value: value }); return value; }, get matchesSelector() { var dE = doc.documentElement; var func = dE.matches || dE.mozMatchesSelector || dE.webkitMatchesSelector || dE.oMatchesSelector; var value = function value(el, sel) { return func.call(el, sel); }; Object.defineProperty(this, 'matchesSelector', { value: value }); return value; }, get viewportHeight() { var value = doc.compatMode && doc.compatMode === 'CSS1Compat' ? function () { return doc.documentElement.clientHeight; } : function () { return doc.body.clientHeight; }; Object.defineProperty(this, 'viewportHeight', { value: value }); return value; }, get viewportWidth() { var value = doc.compatMode && doc.compatMode === 'CSS1Compat' ? function () { return doc.documentElement.clientWidth; } : function () { return doc.body.clientWidth; }; Object.defineProperty(this, 'viewportWidth', { value: value }); return value; }, get fixEventEl() { var value = !this.isPresto ? function (el) { return el; } : function (el) { var _el$correspondingUseE; return (el === null || el === void 0 || (_el$correspondingUseE = el.correspondingUseElement) === null || _el$correspondingUseE === void 0 ? void 0 : _el$correspondingUseE.ownerSVGElement) || el; }; Object.defineProperty(this, 'fixEventEl', { value: value }); return value; }, getUnsafeUint8Array: function getUnsafeUint8Array(data, i, len) { var Ctor = Uint8Array; if (this.isFirefox && (this.hasOldGM || this.isTampermonkey)) { try { if (!(new Uint8Array(data) instanceof Uint8Array)) { Ctor = unsafeWindow.Uint8Array; } } catch (err) { Ctor = unsafeWindow.Uint8Array; } } switch (arguments.length) { case 1: return new Ctor(data); case 2: return new Ctor(data, i); case 3: return new Ctor(data, i, len); } throw new Error(); }, getUnsafeDataView: function getUnsafeDataView(data, offset) { var value = new DataView(data, offset || 0); return this.isFirefox && this.hasOldGM && !(value instanceof DataView) ? new unsafeWindow.DataView(data, offset || 0) : value; } }; } var BaseBoard = function () { function BaseBoard(protocol, domain) { _classCallCheck(this, BaseBoard); this._4chan = false; this.kohlchan = false; this.makaba = false; this.cReply = 'reply'; this.qBan = null; this.qClosed = null; this.qDelBtn = 'input[type="submit"]'; this.qDelForm = '#delform, form[name="delform"]'; this.qDelPassw = 'input[type="password"], input[name="password"]'; this.qError = 'h1, h2, font[size="5"]'; this.qForm = '#postform'; this.qFormFile = 'tr input[type="file"]'; this.qFormPassw = 'tr input[type="password"]'; this.qFormRedir = 'input[name="postredir"][value="1"]'; this.qFormRules = '.rules, #rules'; this.qFormSpoiler = 'input[type="checkbox"][name="spoiler"]'; this.qFormSubm = 'tr input[type="submit"]'; this.qFormTd = 'td'; this.qFormTr = 'tr'; this.qFormTxta = 'tr:not([style*="none"]) textarea:not([style*="display:none"])'; this.qOmitted = '.omittedposts'; this.qOPost = '.oppost'; this.qOPostEnd = 'form > table, div > table, div[id^="repl"]'; this.qPages = 'table[border="1"] > tbody > tr > td:nth-child(2) > a:last-of-type'; this.qPost = '.reply'; this.qPostHeader = '.de-post-btns'; this.qPostImg = '.thumb, .ca_thumb, img[src*="thumb"], img[src*="/spoiler"], img[src^="blob:"]'; this.qPostImgInfo = '.filesize'; this.qPostMsg = 'blockquote'; this.qPostName = '.postername, .commentpostername'; this.qPostSubj = '.filetitle'; this.qPostTrip = '.postertrip'; this.qPostRef = '.reflink'; this.qPostsParent = null; this.qTrunc = '.abbrev, .abbr, .shortened'; var port = deWindow.location.port; port = port ? ':' + port : ''; this.anchor = '#'; this.b = ''; this.captchaRu = false; this.domain = domain + port; this.docExt = null; this.firstPage = 0; this.formHeaders = false; this.formParent = 'parent'; this.hasAltCaptcha = false; this.hasArchive = false; this.hasCatalog = false; this.hasOPNum = false; this.hasPicWrap = false; this.hasRefererErr = false; this.hasTextLinks = false; this.host = deWindow.location.hostname + port; this.JsonBuilder = null; this.jsonSubmit = false; this.markupBB = false; this.multiFile = false; this.page = 0; this.protocol = protocol; this.res = 'res/'; this.t = false; this.timePattern = 'w+dd+m+yyyy+hh+ii+ss'; } return _createClass(BaseBoard, [{ key: "qFormMail", get: function get() { return $match('tr:not([style*="none"]) input:not([type="hidden"]):not([style*="none"])', '[name="email"]', '[name="em"]', '[name="field2"]', '[name="sage"]'); } }, { key: "qFormName", get: function get() { return $match('tr:not([style*="none"]) input:not([type="hidden"]):not([style*="none"])', '[name="name"]', '[name="field1"]'); } }, { key: "qFormSubj", get: function get() { return $match('tr:not([style*="none"]) input:not([type="hidden"]):not([style*="none"])', '[name="subject"]', '[name="field3"]'); } }, { key: "qMsgImgLink", get: function get() { var value = $match(this.qPostMsg.split(', ').join(' a, ') + ' a', '[href$=".jfif"]', '[href$=".jpg"]', '[href$=".jpeg"]', '[href$=".png"]', '[href$=".gif"]', '[href$=".webp"]'); Object.defineProperty(this, 'qMsgImgLink', { value: value }); return value; } }, { key: "qPostImgNameLink", get: function get() { var value = $match(this.qPostImgInfo.split(', ').join(' a, ') + ' a', '[href$=".jfif"]', '[href$=".jpg"]', '[href$=".jpeg"]', '[href$=".png"]', '[href$=".gif"]', '[href$=".webm"]', '[href$=".webp"]', '[href$=".mov"]', '[href$=".mp4"]', '[href$=".m4v"]', '[href$=".ogv"]', '[href$=".apng"]', ', [href^="blob:"]'); Object.defineProperty(this, 'qPostImgNameLink', { value: value }); return value; } }, { key: "qThread", get: function get() { var value = $q('.thread') ? '.thread' : '[id^="thread"]'; Object.defineProperty(this, 'qThread', { value: value }); return value; } }, { key: "captchaAfterSubmit", get: function get() { return null; } }, { key: "captchaInit", get: function get() { return null; } }, { key: "captchaLang", get: function get() { return this.captchaRu ? 2 : 1; } }, { key: "captchaUpdate", get: function get() { return null; } }, { key: "catalogUrl", get: function get() { return "".concat(this.protocol, "//").concat(this.host, "/").concat(this.b, "/catalog.html"); } }, { key: "changeReplyMode", get: function get() { return null; } }, { key: "clearFileInputs", get: function get() { return null; } }, { key: "css", get: function get() { return ''; } }, { key: "deleteTruncMsg", get: function get() { return null; } }, { key: "fixDeadLinks", get: function get() { return null; } }, { key: "fixHTMLHelper", get: function get() { return null; } }, { key: "fixFileInputs", get: function get() { return null; } }, { key: "fixKCUnixFilenames", get: function get() { return null; } }, { key: "getImgRedirectSrc", get: function get() { return null; } }, { key: "getSubmitData", get: function get() { return null; } }, { key: "isArchived", get: function get() { return false; } }, { key: "lastPage", get: function get() { var el = $q(this.qPages); var value = el && +Array.prototype.pop.call(el.textContent.match(/\d+/g) || []) || 0; if (this.page === value + 1) { value++; } Object.defineProperty(this, 'lastPage', { value: value }); return value; } }, { key: "markupTags", get: function get() { return this.markupBB ? ['b', 'i', 'u', 's', 'spoiler', 'code'] : ['**', '*', '', '^H', '%%', '`']; } }, { key: "observeContent", get: function get() { return null; } }, { key: "handlePostClick", get: function get() { return null; } }, { key: "postersCount", get: function get() { return ''; } }, { key: "reCrossLinks", get: function get() { var value = new RegExp(">https?:\\/\\/[^\\/]*".concat(this.domain, "\\/([a-z0-9]+)\\/").concat(escapeRegExp(this.res), "(\\d+)(?:[^#<]+)?(?:#i?(\\d+))?<"), 'g'); Object.defineProperty(this, 'reCrossLinks', { value: value }); return value; } }, { key: "reportForm", get: function get() { return null; } }, { key: "sendHTML5Post", get: function get() { return null; } }, { key: "stormWallFixAjax", get: function get() { return null; } }, { key: "stormWallFixCaptcha", get: function get() { return null; } }, { key: "stormWallFixSubmit", get: function get() { return null; } }, { key: "stormWallHelper", get: function get() { return null; } }, { key: "fixHTML", value: function fixHTML(data) { var isForm = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; if (!(dTime || Spells.reps || Cfg.crossLinks || Cfg.decodeLinks || this.fixHTMLHelper || this.fixDeadLinks || this.hasTextLinks)) { return data; } var str; if (typeof data === 'string') { str = data; } else if (isForm) { data.id = 'de-dform-old'; str = data.outerHTML; } else { str = data.innerHTML; } if (dTime) { str = dTime.fix(str); } if (this.fixHTMLHelper) { str = this.fixHTMLHelper(str); } if (this.fixDeadLinks) { str = this.fixDeadLinks(str); } if (this.hasTextLinks) { str = str.replace(/(^|>|\s|>)(https*:\/\/[^"<>]*?)(<\/a>)?(?=$|<|\s)/ig, function (x, a, b, c) { return c ? x : "".concat(a, "<a rel=\"noreferrer\" href=\"").concat(b, "\">").concat(b, "</a>"); }); } if (Spells.reps) { str = Spells.replace(str); } if (Cfg.crossLinks) { str = str.replace(this.reCrossLinks, function (_, board, tNum, pNum) { return ">>>/".concat(board, "/").concat(pNum || tNum, "<"); }); } if (Cfg.decodeLinks) { str = str.replace(/>https?:\/\/[^<]+</ig, function (match) { try { return decodeURI(match); } catch (err) {} return match; }); } if (typeof data === 'string') { return str; } if (isForm) { var newForm = $bBegin(data, str); $hide(data); deWindow.addEventListener('load', function () { return $id('de-dform-old').remove(); }); return newForm; } data.innerHTML = str; return data; } }, { key: "fixVideo", value: function fixVideo(isPost, data) { var videos = []; var els = $Q('embed, object, iframe', isPost ? data.el : data); for (var i = 0, len = els.length; i < len; ++i) { var el = els[i]; var src = el.src || el.data; if (!src) { continue; } var m = src.match(Videos.ytReg); if (m) { videos.push([isPost ? data : this.getPostOfEl(el), m, true]); el.remove(); } else if (Cfg.addVimeo && (m = src.match(Videos.vimReg))) { videos.push([isPost ? data : this.getPostOfEl(el), m, false]); el.remove(); } } return videos; } }, { key: "getAbsLink", value: function getAbsLink(url) { return (url[1] === '/' ? this.protocol : url[0] === '/' ? this.protocol + '//' + this.host : '') + url; } }, { key: "getBanId", value: function getBanId(postEl) { return this.qBan && $q(this.qBan, postEl) ? 1 : 0; } }, { key: "getCapParent", value: function getCapParent(el) { return el.closest(this.qFormTr); } }, { key: "getCaptchaSrc", value: function getCaptchaSrc(src, tNum) { var temp = src.replace(/pl$/, 'pl?key=mainpage&dummy=').replace(/dummy=[\d.]*/, 'dummy=' + Math.random()); return tNum ? temp.replace(/mainpage|res\d+/, 'res' + tNum) : temp.replace(/res\d+/, 'mainpage'); } }, { key: "getEmptyFile", value: function getEmptyFile(field, name) { return { el: field, name: name, type: 'application/octet-stream', value: new File([''], '') }; } }, { key: "getImgInfo", value: function getImgInfo(wrap) { var el = $q(this.qPostImgInfo, wrap); return el ? el.textContent : ''; } }, { key: "getImgRealName", value: function getImgRealName(wrap) { var el = $q(this.qPostImgNameLink, wrap); return el ? el.title || el.textContent : ''; } }, { key: "getImgSrcLink", value: function getImgSrcLink(img) { return img.closest('a'); } }, { key: "getImgWrap", value: function getImgWrap(img) { return (img.closest('a') || img).parentNode; } }, { key: "getJsonApiUrl", value: function getJsonApiUrl() {} }, { key: "getOp", value: function getOp(thr) { var op = localData ? $q('.de-oppost', thr) : $q(this.qOPost, thr); if (op) { return op; } op = thr.ownerDocument.createElement('div'); op.classList.add('de-oppost'); var el; var opEnd = $q(this.qOPostEnd, thr); while ((el = thr.firstChild) && el !== opEnd) { op.append(el); } thr.prepend(op); return op; } }, { key: "getPageUrl", value: function getPageUrl(board, page) { return fixBoardName(board) + (page > 0 ? page + this.docExt : ''); } }, { key: "getPNum", value: function getPNum(post) { return +post.id.match(/\d+/); } }, { key: "getPostElOfEl", value: function getPostElOfEl(el) { var sel = this.qPost + ', [de-thread], .de-pview'; while (el && !nav.matchesSelector(el, sel)) { el = el.parentElement; } return el; } }, { key: "getPostOfEl", value: function getPostOfEl(el) { return pByEl.get(this.getPostElOfEl(el)); } }, { key: "getPostWrap", value: function getPostWrap(el, isOp) { if (isOp) { return el; } Object.defineProperty(this, 'getPostWrap', { value: el.tagName.toLowerCase() === 'td' ? function (el, isOp) { return isOp ? el : el.closest('table'); } : function (el) { return el; } }); return this.getPostWrap(el, isOp); } }, { key: "getSage", value: function getSage(post) { if ($q('.sage', post)) { return true; } var el = $q('a[href^="mailto:"], a[href="sage"]', post); return !!el && /sage/i.test(el.href); } }, { key: "getThrUrl", value: function getThrUrl(board, tNum) { return this.protocol + '//' + this.host + fixBoardName(board) + this.res + tNum + this.docExt; } }, { key: "getTNum", value: function getTNum(thr) { return +$q('input[type="checkbox"]', thr).value; } }, { key: "insertMarkupButtons", value: function insertMarkupButtons(postForm, el) { (Cfg.txtBtnsLoc ? $id('de-resizer-text') || postForm.txta : postForm.subm).after(el); } }, { key: "isAjaxStatusOK", value: function isAjaxStatusOK(status) { return status === 200 || status === 206; } }, { key: "isIgnoreError", value: function isIgnoreError(txt) { return /successful|uploaded|updating|post deleted|post created|обновл|удален[о.]/i.test(txt); } }, { key: "parseURL", value: function parseURL() { var url = (deWindow.location.pathname || '').replace(/^[/]+/, '').replace(/[/]+/g, '/'); if (url.match(this.res)) { var temp = url.split(this.res); this.b = temp[0].replace(/\/$/, ''); this.t = +temp[1].match(/^[^\d]?\d+/)[0]; this.page = this.firstPage; } else { var _temp2 = url.match(/\/?(\d+)[^/]*?$/); this.page = +(_temp2 === null || _temp2 === void 0 ? void 0 : _temp2[1]) || this.firstPage; this.b = url.replace(_temp2 && this.page ? _temp2[0] : /\/(?:[^/]+\.[a-z]+)?$/, ''); } if (this.docExt === null) { this.docExt = (url.match(/\.[a-z]+$/) || ['.html'])[0]; } } }, { key: "removeMarkupButtons", value: function removeMarkupButtons(el) { el === null || el === void 0 || el.remove(); } }, { key: "updateSubmitBtn", value: function updateSubmitBtn(el) { el.value = Lng.reply[lang]; } }]); }(); function getImageBoard(checkDomains, checkEngines) { var ibDomains = {}; var ibEngines = []; ibEngines.push(['form[action$="wakaba.pl"]', BaseBoard]); var Kusaba = function (_BaseBoard) { function Kusaba() { var _this105; _classCallCheck(this, Kusaba); for (var _len7 = arguments.length, args = new Array(_len7), _key4 = 0; _key4 < _len7; _key4++) { args[_key4] = arguments[_key4]; } _this105 = _callSuper(this, Kusaba, [].concat(args)); _this105.qError = 'h1, h2, div[style*="1.25em"]'; _this105.qFormRedir = 'input[name="redirecttothread"][value="1"]'; _this105.formHeaders = true; _this105.formParent = 'replythread'; _this105.markupBB = true; return _this105; } _inherits(Kusaba, _BaseBoard); return _createClass(Kusaba, [{ key: "css", get: function get() { return ".extrabtns > a, .extrabtns > span, #newposts_get, .replymode, .ui-resizable-handle,\n\t\t\t\t\tblockquote + a { display: none; }\n\t\t\t\t.ui-wrapper { display: inline-block; width: auto !important;\n\t\t\t\t\theight: auto !important; padding: 0 !important; }"; } }, { key: "getCaptchaSrc", value: function getCaptchaSrc(src) { return src.replace(/\?[^?]+$|$/, '?' + Math.random()); } }, { key: "getImgRealName", value: function getImgRealName(wrap) { var el = $q('.filesize', wrap); if (el) { var info = el.textContent.split(','); if (info.length > 2) { return info.pop().replace(')', ''); } } return _superPropGet(Kusaba, "getImgRealName", this, 3)([wrap]); } }, { key: "init", value: function init() { var el = $id('posttypeindicator'); if (el) { var _el$previousSibling, _el$nextSibling; (_el$previousSibling = el.previousSibling) === null || _el$previousSibling === void 0 || _el$previousSibling.remove(); (_el$nextSibling = el.nextSibling) === null || _el$nextSibling === void 0 || _el$nextSibling.remove(); el.remove(); } return false; } }]); }(BaseBoard); ibEngines.push(['script[src*="kusaba"]', Kusaba], ['form#delform[action$="/board.php"]', Kusaba]); var Tinyboard = function (_BaseBoard2) { function Tinyboard() { var _this106; _classCallCheck(this, Tinyboard); for (var _len8 = arguments.length, args = new Array(_len8), _key5 = 0; _key5 < _len8; _key5++) { args[_key5] = arguments[_key5]; } _this106 = _callSuper(this, Tinyboard, [].concat(args)); _this106.cReply = 'post reply'; _this106.qClosed = '.fa-lock'; _this106.qDelForm = 'form[name*="postcontrols"]'; _this106.qForm = 'form[name="post"]'; _this106.qFormPassw = 'input[name="password"]:not([type="hidden"])'; _this106.qFormRedir = null; _this106.qOmitted = '.omitted'; _this106.qOPostEnd = '.post.reply'; _this106.qPages = '.pages'; _this106.qPostHeader = '.intro'; _this106.qPostImgInfo = '.fileinfo'; _this106.qPostMsg = '.body'; _this106.qPostName = '.name'; _this106.qPostRef = '.post_no + a'; _this106.qPostSubj = '.subject'; _this106.qPostTrip = '.trip'; _this106.qTrunc = '.toolong'; _this106.firstPage = 1; _this106.formParent = 'thread'; _this106.hasCatalog = true; _this106.hasRefererErr = true; _this106.jsonSubmit = true; _this106.timePattern = 'nn+dd+yy++w++hh+ii+ss'; _this106._origInputs = null; return _this106; } _inherits(Tinyboard, _BaseBoard2); return _createClass(Tinyboard, [{ key: "qPostImgNameLink", get: function get() { return 'p.fileinfo > a:first-of-type'; } }, { key: "css", get: function get() { return ".banner, .hide-thread-link, .mentioned,\n\t\t\t\t\t.post-hover { display: none !important; }\n\t\t\t\tdiv.post.reply:not(.de-entry):not(.de-cfg-tab):not(.de-win-body) {\n\t\t\t\t\tfloat: left !important; clear: left; display: block; }\n\t\t\t\t".concat(Cfg.imgNames ? ".postfilename, .unimportant > a[download] { display: none }\n\t\t\t\t\t.fileinfo > .unimportant { white-space: nowrap; }" : ''); } }, { key: "markupTags", get: function get() { return ['\'\'\'', '\'\'', '__', '~~', '**', '[code']; } }, { key: "changeReplyMode", value: function () { var _changeReplyMode = _asyncToGenerator(_regeneratorRuntime().mark(function _callee44(form, tNum) { var _this107 = this; var pageInp, query, errFn; return _regeneratorRuntime().wrap(function _callee44$(_context52) { while (1) switch (_context52.prev = _context52.next) { case 0: if (!(!this._origInputs && !$q('input[name="hash"]', form))) { _context52.next = 5; break; } postform.subm.value = Lng.reply[lang]; pageInp = $q('input[name="page"]', form); if (tNum) { pageInp === null || pageInp === void 0 || pageInp.remove(); } else if (!pageInp) { form.insertAdjacentHTML('beforeend', '<input name="page" value="1" type="hidden">'); } return _context52.abrupt("return"); case 5: query = 'div[style="display:none"], input[style="display:none"], ' + 'span[style="display:none"], textarea[style="display:none"], ' + 'input[type="hidden"]:not(.de-input-hidden)'; if ($q('input[name="thread"]', form)) { _context52.next = 11; break; } this._origInputs = [doc.createElement('div'), postform.subm.value]; $Q(query, form).forEach(function (el) { return _this107._origInputs[0].append(el); }); _context52.next = 17; break; case 11: if (tNum) { _context52.next = 17; break; } postform.subm.value = this._origInputs[1]; $delAll(query, form); form.insertAdjacentHTML('beforeend', this._origInputs[0].innerHTML); this._origInputs = null; return _context52.abrupt("return"); case 17: errFn = function errFn() { $popup('load-form', Lng.errFormLoad[lang]); postform.closeReply(); }; $popup('load-form', Lng.loading[lang], true); _context52.next = 21; return ajaxLoad(this.getThrUrl(this.b, tNum), false).then(function (loadedDoc) { var loadedForm = $q(_this107.qForm, loadedDoc); if (!loadedForm) { errFn(); return; } postform.subm.value = $q(_this107.qFormSubm, loadedDoc).value; $delAll(query, form); $Q(query, loadedForm).forEach(function (el) { return form.append(doc.adoptNode(el)); }); closePopup('load-form'); }, errFn); case 21: case "end": return _context52.stop(); } }, _callee44, this); })); function changeReplyMode(_x31, _x32) { return _changeReplyMode.apply(this, arguments); } return changeReplyMode; }() }, { key: "fixHTML", value: function fixHTML(data, isForm) { var formEl = _superPropGet(Tinyboard, "fixHTML", this, 3)([data, isForm]); $Q('br.clear', formEl).forEach(function (brEl) { var hr = brEl.nextElementSibling; if ((hr === null || hr === void 0 ? void 0 : hr.tagName.toLowerCase()) === 'hr') { brEl.parentNode.after(hr); } brEl.remove(); }); return formEl; } }, { key: "fixVideo", value: function fixVideo(isPost, data) { var _this108 = this; return Array.from($Q('.video-container, #ytplayer', isPost ? data.el : data), function (el) { var value = [isPost ? data : _this108.getPostOfEl(el), el.id === 'ytplayer' ? el.src.match(Videos.ytReg) : ['', el.getAttribute('data-video')], true]; el.remove(); return value; }); } }, { key: "getImgRealName", value: function getImgRealName(wrap) { var el = $q('.postfilename', wrap) || $q('.unimportant > a[download]', wrap) || $q(this.qPostImgNameLink, wrap); return el.title || el.textContent; } }, { key: "getPageUrl", value: function getPageUrl(board, page) { return page > 1 ? fixBoardName(board) + page + this.docExt : fixBoardName(board); } }, { key: "getSubmitData", value: function getSubmitData(_ref53) { var error = _ref53.error, id = _ref53.id; return { error: error, postNum: id && +id }; } }, { key: "getTNum", value: function getTNum(thr) { return +$q('input[type="checkbox"]', thr).name.match(/\d+/); } }, { key: "init", value: function init() { $script('window.FormData = void 0;'); var formEl = $q(this.qForm); if (formEl) { formEl.insertAdjacentHTML('beforeend', '<input class="de-input-hidden" name="json_response" value="1" type="hidden">'); } return false; } }, { key: "isAjaxStatusOK", value: function isAjaxStatusOK(status) { return status === 200 || status === 206 || status === 400; } }, { key: "updateSubmitBtn", value: function updateSubmitBtn() {} }]); }(BaseBoard); ibEngines.push(['form[name*="postcontrols"]', Tinyboard]); var Vichan = function (_Tinyboard) { function Vichan() { var _this109; _classCallCheck(this, Vichan); for (var _len9 = arguments.length, args = new Array(_len9), _key6 = 0; _key6 < _len9; _key6++) { args[_key6] = arguments[_key6]; } _this109 = _callSuper(this, Vichan, [].concat(args)); _this109.qDelPassw = '#password'; _this109.qPostImg = '.post-image[alt]:not(.deleted)'; _this109.multiFile = true; return _this109; } _inherits(Vichan, _Tinyboard); return _createClass(Vichan, [{ key: "css", get: function get() { return "".concat(_superPropGet(Vichan, "css", this, 1), "\n\t\t\t\t#expand-all-images, #expand-all-images + .unimportant, .fileinfo > span[style*=\"nowrap;\"],\n\t\t\t\t\t.post-btn, small, .watchThread { display: none !important; }\n\t\t\t\tbody { padding: 0 5px !important; }\n\t\t\t\t.boardlist { z-index: 1 !important; }\n\t\t\t\t.fileinfo { width: 240px; }\n\t\t\t\t.multifile { width: auto !important; }"); } }, { key: "fixFileInputs", value: function fixFileInputs(el) { el.innerHTML = Array.from({ length: 5 }, function (val, i) { return "<div class=\"de-file-wrap\"".concat(i ? ' style="display: none;"' : '', ">\n\t\t\t\t<input type=\"file\" name=\"file").concat(i ? i + 1 : '', "\"></div>"); }).join(''); } }, { key: "fixHTMLHelper", value: function fixHTMLHelper(str) { return str.replace(/"(?:\/vichan)?\/player\.php\?v=([^&]+)&[^"]+"/g, '"$1"'); } }, { key: "init", value: function init() { var _$id3; _superPropGet(Vichan, "init", this, 3)([]); if (locStorage.file_dragdrop !== 'false') { locStorage.file_dragdrop = false; deWindow.location.reload(); return true; } $script('highlightReply = Function.prototype;'); setTimeout(function () { var _$id2; return (_$id2 = $id('updater')) === null || _$id2 === void 0 ? void 0 : _$id2.remove(); }, 0); (_$id3 = $id('body')) === null || _$id3 === void 0 || _$id3.removeAttribute('id'); return false; } }]); }(Tinyboard); ibEngines.push(['tr#upload', Vichan]); var TinyIB = function (_BaseBoard3) { function TinyIB() { var _this110; _classCallCheck(this, TinyIB); for (var _len10 = arguments.length, args = new Array(_len10), _key7 = 0; _key7 < _len10; _key7++) { args[_key7] = arguments[_key7]; } _this110 = _callSuper(this, TinyIB, [].concat(args)); _this110.qDelForm = $id('posts') ? '#posts' : '#delform'; _this110.qError = 'body[align=center] div, div[style="margin-top: 50px;"]'; _this110.qPostImg = 'img.thumb, video.thumb'; _this110.qPostMsg = '.message'; _this110.hasCatalog = true; return _this110; } _inherits(TinyIB, _BaseBoard3); return _createClass(TinyIB, [{ key: "css", get: function get() { return '.backlinks, .replymode { display: none; }'; } }, { key: "fixHTMLHelper", value: function fixHTMLHelper(str) { return str.replace(/="\.\.\//g, this.b ? "=\"/".concat(this.b, "/") : '="/'); } }, { key: "getCaptchaSrc", value: function getCaptchaSrc(src) { return src.replace(/\?[^?]+$|$/, '?' + Math.random()); } }, { key: "getImgWrap", value: function getImgWrap(img) { return img.parentNode.parentNode.parentNode; } }, { key: "getImgRealName", value: function getImgRealName(wrap) { var el = $q('.filesize', wrap); if (el) { var info = el.textContent.split(','); if (info.length > 2) { return info.pop().replace(')', ''); } } return _superPropGet(TinyIB, "getImgRealName", this, 3)([wrap]); } }, { key: "init", value: function init() { $Q('.message > .omittedposts').forEach(function (el) { el.insertAdjacentHTML('afterend', '<span class="abbrev">Post too long. <a href="#">Click to view.</a>'); el.remove(); }); return false; } }]); }(BaseBoard); ibEngines.push(['form[action$="imgboard.php?delete"]', TinyIB]); var Lynxchan = function (_BaseBoard4) { function Lynxchan() { var _this111; _classCallCheck(this, Lynxchan); for (var _len11 = arguments.length, args = new Array(_len11), _key8 = 0; _key8 < _len11; _key8++) { args[_key8] = arguments[_key8]; } _this111 = _callSuper(this, Lynxchan, [].concat(args)); _this111.cReply = 'innerPost'; _this111.qDelBtn = '#deleteFormButton'; _this111.qDelForm = 'form[action$="contentActions.js"]'; _this111.qError = '#errorLabel, #labelMessage'; _this111.qForm = '.form-post, form[action$="newThread.js"], form[action$="replyThread.js"]'; _this111.qFormPassw = 'input[name="password"]'; _this111.qFormRules = '.form-post > .small'; _this111.qFormSubm = '#formButton, #de-postform-submit'; _this111.qOmitted = '.labelOmission'; _this111.qOPost = '.innerOP'; _this111.qOPostEnd = '.divPosts'; _this111.qPages = '#divPages'; _this111.qPost = '.innerPost, .markedPost'; _this111.qPostHeader = '.postInfo, .de-post-btns'; _this111.qPostImg = '.imgLink > img, img[src*="/.media/"]'; _this111.qPostImgInfo = '.uploadDetails'; _this111.qPostMsg = '.divMessage'; _this111.qPostRef = '.linkQuote'; _this111.qPostSubj = '.labelSubject'; _this111.qPostsParent = '.divPosts'; _this111.qTrunc = '.contentOmissionIndicator'; _this111.firstPage = 1; _this111.formParent = 'threadId'; _this111.hasCatalog = true; _this111.jsonSubmit = true; _this111.multiFile = true; _this111._hasNewAPI = false; return _this111; } _inherits(Lynxchan, _BaseBoard4); return _createClass(Lynxchan, [{ key: "qPostImgNameLink", get: function get() { return '.originalNameLink'; } }, { key: "qThread", get: function get() { return '.opCell'; } }, { key: "css", get: function get() { return ".de-video-link + div[style=\"display: inline;\"] > .embedButton, .de-parea > hr,\n\t\t\t\t\t.divRefresh, #jsButton, .hideButton, .nameLink, #newPostFieldset, .panelBacklinks,\n\t\t\t\t\t.quoteTooltip, body > div[style^=\"display: inline;\"] { display: none !important; }\n\t\t\t\t.divPosts { margin: 0 0; }\n\t\t\t\t#formButton { display: initial !important; }\n\t\t\t\t.form-post button, .form-post input, .form-post img { width: initial; }"; } }, { key: "markupTags", get: function get() { return ['\'\'\'', '\'\'', '__', '~~', '**', '[code']; } }, { key: "captchaUpdate", value: function captchaUpdate() { $script('reloadCaptcha();'); return null; } }, { key: "changeReplyMode", value: function changeReplyMode(form, tNum) { var action = form.getAttribute('action'); form.setAttribute('action', tNum ? action.replace('newThread', 'replyThread') : action.replace('replyThread', 'newThread')); } }, { key: "fixFileInputs", value: function fixFileInputs(el) { var _$id4; var str = ' class="de-file-wrap"><input name="files" type="file"></div>'; el.innerHTML = '<div' + str + ('<div style="display: none;"' + str).repeat((+((_$id4 = $id('labelMaxFiles')) === null || _$id4 === void 0 ? void 0 : _$id4.textContent) || 3) - 1); } }, { key: "getCapParent", value: function getCapParent() { return $id('captchaDiv'); } }, { key: "getImgRealName", value: function getImgRealName(wrap) { return $q('.originalNameLink', wrap).textContent; } }, { key: "getImgSrcLink", value: function getImgSrcLink(img) { return $q('.originalNameLink', this.getImgWrap(img)); } }, { key: "getImgWrap", value: function getImgWrap(img) { return img.closest('figure'); } }, { key: "getPageUrl", value: function getPageUrl(board, page) { return fixBoardName(board) + (page > 1 ? page + this.docExt : 'index.html'); } }, { key: "getPNum", value: function getPNum(post) { return +$q('.deletionCheckBox', post).name.split('-')[2]; } }, { key: "getPostWrap", value: function getPostWrap(el, isOp) { return isOp ? el : el.parentNode; } }, { key: "getSubmitData", value: function getSubmitData(_ref54) { var status = _ref54.status, data = _ref54.data; return { error: status === 'error' ? data : null, postNum: status === 'ok' ? +data : null }; } }, { key: "getTNum", value: function getTNum(thr) { return +$q('.deletionCheckBox', thr).name.split('-')[1]; } }, { key: "init", value: function init() { $script("if(\"autoRefresh\" in window) {\n\t\t\t\t\tclearInterval(refreshTimer);\n\t\t\t\t}\n\t\t\t\tif(\"thread\" in window) {\n\t\t\t\t\tif(thread.refreshTimer) {\n\t\t\t\t\t\tclearInterval(thread.refreshTimer);\n\t\t\t\t\t\tObject.defineProperty(thread, \"startTimer\",\n\t\t\t\t\t\t\t{ value: Function.prototype, writable: false, configurable: false });\n\t\t\t\t\t}\n\t\t\t\t\tObject.defineProperty(thread, \"changeRefresh\",\n\t\t\t\t\t\t{ value: Function.prototype, writable: false, configurable: false });\n\t\t\t\t}"); var submEl = $id('formButton'); if (submEl) { this._hasNewAPI = true; submEl.insertAdjacentHTML('afterend', "<button id=\"de-postform-submit\" type=\"submit\">".concat(submEl.innerHTML, "</button>")); submEl.remove(); } var formEl = $q(this.qForm); if (formEl && !$q('td', formEl)) { var table = $aBegin($q(this.qForm), '<table><tbody></tbody></table>').firstChild; var els = $Q('#captchaDiv, #divUpload, #fieldEmail, #fieldMessage, #fieldName,' + ' #fieldPostingPassword, #fieldSubject'); for (var i = 0, len = els.length; i < len; ++i) { $bEnd(table, '<tr><th></th><td></td></tr>').lastChild.append(els[i]); } } return false; } }, { key: "isAjaxStatusOK", value: function isAjaxStatusOK(status) { return status === 200 || status === 206 || status === 400 || status === 500; } }, { key: "isIgnoreError", value: function isIgnoreError(txt) { try { var obj = JSON.parse(txt); if (obj.status === 'ok' && obj.data && (obj.data.removedThreads || obj.data.removedPosts)) { return true; } } catch (err) {} return false; } }, { key: "sendHTML5Post", value: function () { var _sendHTML5Post = _asyncToGenerator(_regeneratorRuntime().mark(function _callee47(form, data, needProgress, hasFiles) { var ajaxParams, getBase64, dataObj, files, i, len, file, cookieObj, task, url; return _regeneratorRuntime().wrap(function _callee47$(_context55) { while (1) switch (_context55.prev = _context55.next) { case 0: if (!this._hasNewAPI) { _context55.next = 4; break; } ajaxParams = { data: data, method: 'POST' }; _context55.next = 26; break; case 4: getBase64 = function () { var _ref55 = _asyncToGenerator(_regeneratorRuntime().mark(function _callee45(file) { return _regeneratorRuntime().wrap(function _callee45$(_context53) { while (1) switch (_context53.prev = _context53.next) { case 0: return _context53.abrupt("return", new Promise(function (resolve, reject) { var reader = new FileReader(); reader.readAsDataURL(file); reader.onload = function () { return resolve(reader.result); }; reader.onerror = function (err) { return reject(err); }; })); case 1: case "end": return _context53.stop(); } }, _callee45); })); return function getBase64(_x37) { return _ref55.apply(this, arguments); }; }(); dataObj = { files: [] }; files = []; data.forEach(function () { var _ref56 = _asyncToGenerator(_regeneratorRuntime().mark(function _callee46(value, key) { return _regeneratorRuntime().wrap(function _callee46$(_context54) { while (1) switch (_context54.prev = _context54.next) { case 0: if (key !== 'files') { dataObj[key] = value; } else { files.push(value); } case 1: case "end": return _context54.stop(); } }, _callee46); })); return function (_x38, _x39) { return _ref56.apply(this, arguments); }; }()); i = 0, len = files.length; case 9: if (!(i < len)) { _context55.next = 24; break; } file = files[i]; if (!file.type) { _context55.next = 21; break; } _context55.t0 = dataObj.files; _context55.t1 = "data:".concat(file.type, ";base64,"); _context55.next = 16; return getBase64(file).then(function (data) { return data.split(',')[1]; }); case 16: _context55.t2 = _context55.sent; _context55.t3 = _context55.t1.concat.call(_context55.t1, _context55.t2); _context55.t4 = file.name; _context55.t5 = { content: _context55.t3, name: _context55.t4, spoiler: false }; _context55.t0.push.call(_context55.t0, _context55.t5); case 21: ++i; _context55.next = 9; break; case 24: cookieObj = getCookies(); ajaxParams = { data: JSON.stringify({ captchaId: cookieObj.captchaid, bypassId: cookieObj.bypass, parameters: dataObj, auth: { login: cookieObj.login, hash: cookieObj.hash } }), headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, method: 'POST' }; case 26: if (needProgress && hasFiles) { ajaxParams.onprogress = getUploadFunc(); } task = getFileName(form.attributes.action.value); url = this._hasNewAPI ? "/".concat(task, "?json=1") : '/.api/' + task.replace('.js', ''); return _context55.abrupt("return", $ajax(url, ajaxParams).then(function (xhr) { return xhr.responseText; })["catch"](function (err) { return Promise.reject(err); })); case 30: case "end": return _context55.stop(); } }, _callee47, this); })); function sendHTML5Post(_x33, _x34, _x35, _x36) { return _sendHTML5Post.apply(this, arguments); } return sendHTML5Post; }() }, { key: "updateSubmitBtn", value: function updateSubmitBtn(el) { el.textContent = Lng.reply[lang]; } }]); }(BaseBoard); ibEngines.push(['form[action$="contentActions.js"]', Lynxchan]); var FoolFuuka = function (_BaseBoard5) { function FoolFuuka() { var _this112; _classCallCheck(this, FoolFuuka); for (var _len12 = arguments.length, args = new Array(_len12), _key9 = 0; _key9 < _len12; _key9++) { args[_key9] = arguments[_key9]; } _this112 = _callSuper(this, FoolFuuka, [].concat(args)); _this112.cReply = 'post_wrapper'; _this112.qDelForm = '#main'; _this112.qOmitted = '.omitted_text'; _this112.qOPostEnd = '.posts'; _this112.qPages = '.paginate > ul > li:nth-last-child(3)'; _this112.qPost = '.post[id]'; _this112.qPostHeader = 'header'; _this112.qPostImg = '.post_image, .thread_image'; _this112.qPostImgInfo = '.post_file_metadata, .thread_image_box > .post_file'; _this112.qPostMsg = '.text'; _this112.qPostRef = '.post_data > a[data-function="quote"]'; _this112.qPostSubj = '.post_title'; _this112.qPostsParent = '.posts'; _this112.docExt = ''; _this112.firstPage = 1; _this112.res = 'thread/'; return _this112; } _inherits(FoolFuuka, _BaseBoard5); return _createClass(FoolFuuka, [{ key: "qPostImgNameLink", get: function get() { return '.post_file_filename'; } }, { key: "qThread", get: function get() { return '.thread[id]'; } }, { key: "css", get: function get() { return ".backlink_list { display: none !important; }\n\t\t\t\t.de-oppost > .thread_image_box { float: left; margin: 0 20px 10px 15px; text-align: center;\n\t\t\t\t\tcolor: #bfbfbf; font-size: .8em; line-height: 150%; }"; } }, { key: "isArchived", get: function get() { return true; } }, { key: "fixHTMLHelper", value: function fixHTMLHelper(str) { return str.replace(/\/#(\d+)"/g, '#$1"').replace(/\/post\/(\d+)\/"/g, '/#$1"'); } }, { key: "getImgWrap", value: function getImgWrap(img) { return img.parentNode.parentNode.parentNode; } }, { key: "getPageUrl", value: function getPageUrl(board, page) { return fixBoardName(board) + (page > 1 ? "page/".concat(page, "/") : ''); } }, { key: "getTNum", value: function getTNum(thr) { return +thr.getAttribute('data-thread-num'); } }, { key: "init", value: function init() { defaultCfg.ajaxUpdThr = 0; var el = $q('.search_box'); if (el) { doc.body.append(el); } return false; } }, { key: "parseURL", value: function parseURL() { _superPropGet(FoolFuuka, "parseURL", this, 3)([]); this.page = +(this.b.match(/\/page\/(\d+)/) || [1, 1])[1]; this.b = this.b.replace(/\/page\/\d+/, ''); } }]); }(BaseBoard); ibEngines.push(['meta[name="generator"][content^="FoolFuuka"]', FoolFuuka]); var _0chan = function (_Kusaba) { function _0chan() { var _this113; _classCallCheck(this, _0chan); for (var _len13 = arguments.length, args = new Array(_len13), _key10 = 0; _key10 < _len13; _key10++) { args[_key10] = arguments[_key10]; } _this113 = _callSuper(this, _0chan, [].concat(args)); _this113.qDelForm = '#delform_instant'; _this113.qPostHeader = '.posthead'; _this113.captchaRu = true; _this113.formHeaders = false; _this113.hasCatalog = true; _this113.multiFile = true; return _this113; } _inherits(_0chan, _Kusaba); return _createClass(_0chan, [{ key: "captchaInit", get: function get() { $script('Captcha.init(); Captcha.initForm(document.getElementById("postform"));'); return null; } }, { key: "css", get: function get() { return ".content > hr, .extrabtns, .postbutt, .replymode { display: none; }\n\t\t\t\tform { position: initial; }"; } }, { key: "captchaUpdate", value: function captchaUpdate() { $script('var captchaTimeout = 29.5; Captcha.state = "init";'); return null; } }, { key: "fixFileInputs", value: function fixFileInputs(el) { var str = ' class="de-file-wrap"><input type="file" name="file"></div>'; el.innerHTML = '<div' + str + ('<div style="display: none;"' + str).repeat(3); } }, { key: "fixVideo", value: function fixVideo(isPost, data) { var _this114 = this; $Q('.video-embed', isPost ? data.el : data).forEach(function (el) { (isPost ? data : _this114.getPostOfEl(el)).msg.prepend($q('.de-video-link', el), doc.createElement('br')); var parent = el.parentNode; el.remove(); if (!parent.firstElementChild) { parent.remove(); } }); return []; } }, { key: "getTNum", value: function getTNum(thr) { return +thr.getAttribute('data-threadid'); } }]); }(Kusaba); ibDomains['2.0-chan.ru'] = _0chan; var Makaba = function (_BaseBoard6) { function Makaba() { var _this115; _classCallCheck(this, Makaba); for (var _len14 = arguments.length, args = new Array(_len14), _key11 = 0; _key11 < _len14; _key11++) { args[_key11] = arguments[_key11]; } _this115 = _callSuper(this, Makaba, [].concat(args)); _this115.makaba = true; _this115.cReply = 'de-reply-class'; _this115.qBan = '.post__pomyanem'; _this115.qClosed = 'use[*|href="#icon__closed"]'; _this115.qDelForm = '#posts-form, #js-posts'; _this115.qFormFile = '.postform__raw.filer input[type="file"]'; _this115.qFormRedir = null; _this115.qFormRules = '.rules'; _this115.qFormSubm = '#submit'; _this115.qFormTd = '.postform__raw'; _this115.qFormTr = '.postform__raw'; _this115.qFormTxta = '#shampoo'; _this115.qOmitted = '.thread__missed'; _this115.qOPost = '.post_type_oppost'; _this115.qPost = '.post_type_reply[data-num]'; _this115.qPostHeader = '.post__details'; _this115.qPostImg = '.post__file-preview'; _this115.qPostImgInfo = '.post__file-attr'; _this115.qPostMsg = '.post__message'; _this115.qPostName = '.post__anon, .post__email'; _this115.qPostRef = '.post__reflink:nth-child(2)'; _this115.qPostSubj = '.post__title'; _this115.qTrunc = null; _this115.formParent = 'thread'; _this115.hasArchive = true; _this115.hasCatalog = true; _this115.hasOPNum = true; _this115.hasPicWrap = true; _this115.JsonBuilder = MakabaPostsBuilder; _this115.jsonSubmit = true; _this115.markupBB = true; _this115.multiFile = true; _this115.timePattern = 'dd+nn+yy+w+hh+ii+ss'; _this115._isBeta = false; return _this115; } _inherits(Makaba, _BaseBoard6); return _createClass(Makaba, [{ key: "qFormMail", get: function get() { return 'input[name="email"]'; } }, { key: "qFormName", get: function get() { return 'input[name="name"]'; } }, { key: "qFormSubj", get: function get() { return 'input[name="subject"]'; } }, { key: "qPostImgNameLink", get: function get() { return '.file-attr > .desktop, .post__file-attr > .desktop'; } }, { key: "css", get: function get() { return ".js-post-findimg, .js-post-saveimg, .media-expand-button, .media-thumbnail, .newpost,\n\t\t\t\t\t.post__btn:not(.icon_type_active), .post__number, .post__refmap\n\t\t\t\t\t{ display: none !important; }\n\t\t\t\t._captcha-container { margin: 0 !important; }\n\t\t\t\t._captcha-keyboard-button { width: 35px !important; height: 35px !important;\n\t\t\t\t\tpadding: 0 !important; }\n\t\t\t\t._captcha-keyboard-selected-stub { display: none !important; }\n\t\t\t\t.de-fullimg-wrap-inpost { margin-right: 16px; }\n\t\t\t\t.de-refmap { margin: 0 16px 4px; }\n\t\t\t\t.de-pview > .post__details { margin-left: 4px; }\n\t\t\t\t.de-reply-class { background: var(--theme_default_postbg);\n\t\t\t\t\tborder: 1px solid var(--theme_default_border); border-radius: 3px; }\n\t\t\t\t#down-nav-arrow, #up-nav-arrow { z-index: 0; }\n\t\t\t\t.header__opts_sticky { z-index: 10; }\n\t\t\t\t.oekaki-height, .oekaki-width { width: 36px !important; }\n\t\t\t\t.post_type_hidden { opacity: unset; cursor: default; }\n\t\t\t\t.post_type_hidden .post__message:not(.de-post-hiddencontent),\n\t\t\t\t\t.post_type_hidden .post__images:not(.de-post-hiddencontent) { display: block !important; }\n\t\t\t\t.post_type_reply { max-width: 100%; }\n\t\t\t\t.postarea { display: initial !important; }\n\t\t\t\t.postform { width: auto; }\n\t\t\t\t.postform__sticker-btn, .postform__sticker-prev { bottom: " + "".concat(!Cfg.txtBtnsLoc || !Cfg.addTextBtns ? 3 : Cfg.addTextBtns === 1 ? 28 : Cfg.addTextBtns === 2 ? 19 : 25, "px !important; }\n\t\t\t\t.post__message { padding-left: 0px; margin-left: 16px; min-width: 15%; word-wrap: normal;\n\t\t\t\t\tword-break: normal; }\n\t\t\t\t").concat(Cfg.addSageBtn ? ".options__box[onclick=\"ToggleSage()\"]\n\t\t\t\t\t{ display: none !important; }" : '', "\n\t\t\t\t").concat(Cfg.addTextBtns ? '.js-postform-mu { display: none; }' : '', "\n\t\t\t\t").concat(Cfg.expandTrunc ? ".expand-large-comment,\n\t\t\t\t\tdiv[id^=\"shrinked-post\"] { display: none !important; }\n\t\t\t\t\tdiv[id^=\"original-post\"] { display: block !important; }" : '', "\n\t\t\t\t").concat(Cfg.imgNames === 2 ? ".post__filezise { display: inline !important; }\n\t\t\t\t\t.post__file-attr { margin-bottom: 1px; }" : '', "\n\t\t\t\t").concat(Cfg.noSpoilers ? '.spoiler::after { width: 0; }' : ''); } }, { key: "isArchived", get: function get() { return this.b.includes('/arch'); } }, { key: "lastPage", get: function get() { var els = $Q('.pager > a:not([class])'); var value = els ? els.length : 1; Object.defineProperty(this, 'lastPage', { value: value }); return value; } }, { key: "markupTags", get: function get() { return ['B', 'I', 'U', 'S', 'SPOILER', '', 'SUP', 'SUB']; } }, { key: "postersCount", get: function get() { var _$q11; return ((_$q11 = $q('span[title="Постеры"]')) === null || _$q11 === void 0 ? void 0 : _$q11.innerHTML.match(/\d+$/)[0]) || ''; } }, { key: "reportForm", get: function get() { var _this116 = this; var value = function value(pNum, tNum) { return $q('input[type="button"]', $popup('edit-report', "<input name=\"comment\" value=\"\" placeholder=\"".concat(pNum === tNum ? Lng.reportThr[lang] : Lng.reportPost[lang], "\" type=\"text\"> <input value=\"OK\" type=\"button\">"))).onclick = function (e) { var inpEl = e.target.previousElementSibling; if (!inpEl.value) { inpEl.classList.add('de-input-error'); return; } var formData = new FormData(); var data = { board: _this116.b, thread: tNum, post: pNum, comment: inpEl.value }; for (var key in data) { if ($hasProp(data, key)) { formData.append(key, data[key]); } } closePopup('edit-report'); $popup('report', Lng.sending[lang], true); $ajax('/user/report', { method: 'POST', data: formData, success: function success() {}, contentType: false, processData: false }).then(function (xhr) { var obj; try { obj = JSON.parse(xhr.responseText); } catch (err) {} $popup('report', obj.result === 1 ? Lng.succReported[lang] : Lng.error[lang] + ': ' + obj.error.message); }); }; }; Object.defineProperty(this, 'reportForm', { value: value }); return value; } }, { key: "captchaInit", value: function captchaInit() { $script("const loadCapFn =\n\t\t\t\t() => new EmojiCaptcha({ createWarningFn: generateWarning }).requestController();"); return null; } }, { key: "captchaUpdate", value: function captchaUpdate() { $script('loadCapFn();'); return null; } }, { key: "clearFileInputs", value: function clearFileInputs() { $delAll('.sticker-input, .postform__sticker-img'); } }, { key: "deleteTruncMsg", value: function deleteTruncMsg(post, el) { el.previousSibling.remove(); $show(el.previousSibling); el.remove(); } }, { key: "fixFileInputs", value: function fixFileInputs(el) { el.innerHTML = Array.from({ length: 8 }, function (val, i) { return "<div class=\"de-file-wrap\"".concat(i ? ' style="display: none;"' : '', ">\n\t\t\t\t<input type=\"file\" name=\"file[]\"></div>"); }).join(''); } }, { key: "getBanId", value: function getBanId(postEl) { var el = $q(this.qBan, postEl); return !el ? 0 : el.textContent.includes('предупрежден') ? 2 : 1; } }, { key: "getImgWrap", value: function getImgWrap(img) { return img.closest('figure'); } }, { key: "getJsonApiUrl", value: function getJsonApiUrl(board, tNum) { return "/".concat(board, "/res/").concat(tNum, ".json"); } }, { key: "getPNum", value: function getPNum(post) { return +post.getAttribute('data-num'); } }, { key: "getPostWrap", value: function getPostWrap(el) { return this._isBeta ? el : el.parentNode; } }, { key: "getSage", value: function getSage(post) { this.getSage = $q('span[id^="id_tag_"]') ? function (post) { return !$q('span[id^="id_tag_"], .post__ophui', post); } : _superPropGet(Makaba, "getSage", this, 1); return this.getSage(post); } }, { key: "fixHTMLHelper", value: function fixHTMLHelper(str) { return str.replace(/<a href="https?:\/\/[^"]*"([^>]*)>(https?:\/\/[^<]+)<\/a>([^<$\s\n]+)/ig, '<a href="$2$3"$1>$2$3</a>'); } }, { key: "getSubmitData", value: function getSubmitData(json) { var error = null; var postNum = null; if (json.result === 1) { postNum = +json.num; if (json.thread > 0) { postNum = +json.thread; } } else { error = Lng.error[lang] + ': ' + json.error.message; } return { error: error, postNum: postNum }; } }, { key: "handlePostClick", value: function handlePostClick(post, el, e) { var temp; var c = el.classList; if (c.contains('post__rate') || c[0] === 'like-div' || c[0] === 'dislike-div' || (temp = el.parentNode) && ((c = temp.classList).contains('post__rate') || c[0] === 'like-div' || c[0] === 'dislike-div') || (temp = temp.parentNode) && ((c = temp.className) === 'like-div' || c === 'dislike-div')) { var task = temp.id.split('-')[0]; var num = +temp.id.match(/\d+/); $ajax("/api/".concat(task, "?board=").concat(aib.b, "&num=").concat(num)).then(function (xhr) { var obj = JSON.parse(xhr.responseText); if (obj.result !== 1) { $popup('err-2chlike', Lng.error[lang] + ': ' + obj.error.message); return; } temp.classList.add("".concat(task, "-div-checked"), "post__rate_".concat(task, "d")); var countEl = $q(".".concat(task, "-count, #").concat(task, "-count").concat(num), temp); countEl.textContent = +countEl.textContent + 1; }, function () { return $popup('err-2chlike', Lng.noConnect[lang]); }); } if (el.classList.contains('expand-large-comment')) { post._getFullMsg(el, false); e.preventDefault(); e.stopPropagation(); } } }, { key: "init", value: function init() { if ($id('js-posts')) { this._isBeta = true; $Q('.thread__missed').forEach(function (el) { return el.innerHTML = el.innerHTML.replace(/ (\d+) постов/, function (m, i) { return " ".concat(i - 1, " \u043F\u043E\u0441\u0442\u043E\u0432"); }); }); } else if ($q('section.posts')) { this.cReply = 'post reply'; this.qBan = '.pomyanem'; this.qFormFile = 'tr input[type="file"]'; this.qFormRules = '.rules-area'; this.qFormTd = 'td'; this.qFormTr = 'tr'; this.qOmitted = '.mess-post'; this.qOPost = '.oppost'; this.qPost = '.post.reply[data-num]'; this.qPostHeader = '.post-details'; this.qPostImg = '.preview'; this.qPostImgInfo = '.file-attr'; this.qPostMsg = '.post-message'; this.qPostName = '.ananimas, .post-email'; this.qPostRef = '.reflink'; this.qPostSubj = '.post-title'; this.hasArchive = false; var css = this.css; Object.defineProperty(this, 'css', { configurable: true, get: function get() { return "".concat(css, "\n\t\t\t\t\t\t#ABU-alert-wait, .ABU-refmap, .fa-media-icon, .kupi-passcode-suka, .logo + hr,\n\t\t\t\t\t\t.media-expand-button, #media-thumbnail, .message-byte-len, .nav-arrows, .norm-reply,\n\t\t\t\t\t\t.postform-hr, .postpanel > :not(img), .posts > hr, .reflink::before, .thread-nav,\n\t\t\t\t\t\t.toolbar-area { display: none !important; }\n\t\t\t\t\t\t").concat(Cfg.addSageBtn ? ".box[onclick=\"ToggleSage()\"] {\n\t\t\t\t\t\t\tdisplay: none !important; }" : '', "\n\t\t\t\t\t\t").concat(Cfg.imgNames === 2 ? ".filesize { display: inline !important; }\n\t\t\t\t\t\t\t.file-attr { margin-bottom: 1px; }" : ''); } }); } $script("(function() {\n\t\t\t\tfunction fixGlobalFunc(name) {\n\t\t\t\t\tObject.defineProperty(window, name,\n\t\t\t\t\t\t{ value: Function.prototype, writable: false, configurable: false });\n\t\t\t\t}\n\t\t\t\t".concat(this._isBeta ? '' : 'fixGlobalFunc("autorefresh_start");', "\n\t\t\t\tfixGlobalFunc(\"linkremover\");\n\t\t\t\tfixGlobalFunc(\"Media\");\n\t\t\t\twindow.FormData = void 0;\n\t\t\t})();")); $Q('.autorefresh').forEach(function (el) { var inpEl = $q('input', el); if (inpEl.checked) { inpEl.click(); } }); $Q('.js-update-thread, #postbtn-favorite-bottom').forEach(function (el) { var node; while ((node = el.nextSibling) && node.title !== 'Всего постов в треде') { node.remove(); } el.remove(); }); var el = $id('shampoo'); if (el) { el.tabIndex = 1; } return false; } }, { key: "insertMarkupButtons", value: function insertMarkupButtons(postForm, el) { var formEl = Cfg.txtBtnsLoc ? $id('de-resizer-text') || postForm.txta : postForm.subm; var posEl = formEl.parentNode; posEl.insertAdjacentHTML('afterend', '<div class="postform__raw"></div>'); posEl.nextSibling.appendChild(el); } }, { key: "observeContent", value: function observeContent(checkDomains, dataPromise) { if ($q('#posts-form > .thread, #js-posts > .thread, [de-form] > .thread')) { return true; } var initObserver = new MutationObserver(function (mutations) { var _mutations$0$addedNod; if (((_mutations$0$addedNod = mutations[0].addedNodes[0]) === null || _mutations$0$addedNod === void 0 ? void 0 : _mutations$0$addedNod.className) === 'thread') { initObserver.disconnect(); runMain(checkDomains, dataPromise); } }); var el = $q('#posts-form, #js-posts, [de-form]'); if (el) { initObserver.observe(el, { childList: true }); } return false; } }, { key: "removeMarkupButtons", value: function removeMarkupButtons(el) { el === null || el === void 0 || el.parentNode.remove(); } }]); }(BaseBoard); ibDomains['2ch.hk'] = ibDomains['2ch.life'] = Makaba; var _2channel = function (_Makaba) { function _2channel() { var _this117; _classCallCheck(this, _2channel); for (var _len15 = arguments.length, args = new Array(_len15), _key12 = 0; _key12 < _len15; _key12++) { args[_key12] = arguments[_key12]; } _this117 = _callSuper(this, _2channel, [].concat(args)); _this117.qClosed = '.icon-lock'; _this117.JsonBuilder = null; return _this117; } _inherits(_2channel, _Makaba); return _createClass(_2channel, [{ key: "reportForm", get: function get() { return null; } }, { key: "captchaInit", value: function captchaInit(cap) { return this.captchaUpdate(cap); } }, { key: "captchaUpdate", value: function captchaUpdate(cap) { var url = "/api/captcha/service_id?board=".concat(this.b, "&thread=") + postform.tNum; return cap.updateHelper(url, function (xhr) { var box = $q('.captcha'); var data = xhr.responseText; try { data = JSON.parse(data); } catch (err) {} switch (data.result) { case 1: { var el = $q('.captcha__image'); var img = $q('img', el) || $aBegin(el, '<img>'); img.src = ''; img.src = "/api/captcha/image/".concat(data.id); $q('input[name="captcha_id"]').value = data.id; break; } case 2: return CancelablePromise.reject(new CancelError()); case 3: box.innerHTML = 'Вам больше не нужно вводить капчу.'; break; default: box.innerHTML = data; } $show(box); box.removeAttribute('hidden'); cap.textEl.tabIndex = 999; }); } }, { key: "fixFileInputs", value: function fixFileInputs(el) { el.innerHTML = Array.from({ length: 4 }, function (val, i) { return "<div class=\"de-file-wrap\"".concat(i ? ' style="display: none;"' : '', ">\n\t\t\t\t<input type=\"file\" name=\"formimages[]\"></div>"); }).join(''); } }, { key: "fixHTMLHelper", value: function fixHTMLHelper(str) { return str.replace(/src="[^>]+" data-src="/g, 'src="'); } }, { key: "getCapParent", value: function getCapParent() { return $q('.captcha'); } }, { key: "init", value: function init() { _superPropGet(_2channel, "init", this, 3)([]); this.qFormFile = 'input[name="formimages[]"]'; this.qFormTd = 'div[class^="freply__"]'; this.qFormTr = 'div[class^="freply__"]'; var css = this.css; Object.defineProperty(this, 'css', { configurable: true, get: function get() { return "".concat(css, "\n\t\t\t\t\t#AlertBox, .postform__checkbox.first, .postform__header, .refmap, #youtube-thumb-float\n\t\t\t\t\t\t{ display: none !important; }\n\t\t\t\t\t.de-win-open:not(#de-win-cfg) > .de-win-body { background-color: #eee !important; }\n\t\t\t\t\t.preview.lazy { opacity: 1; }"); } }); var el = $q('.captcha'); if (el) { $q('.freply__files-and-captcha').before(el); } el = $id('postform'); if (el) { el.setAttribute('action', el.getAttribute('action') + '?json=1'); } return false; } }]); }(Makaba); ibDomains['2channel.moe'] = ibDomains['2channel5xx5xchx.onion'] = _2channel; var _2chRip = function (_BaseBoard7) { function _2chRip() { var _this118; _classCallCheck(this, _2chRip); for (var _len16 = arguments.length, args = new Array(_len16), _key13 = 0; _key13 < _len16; _key13++) { args[_key13] = arguments[_key13]; } _this118 = _callSuper(this, _2chRip, [].concat(args)); _this118.captchaRu = true; _this118.jsonSubmit = true; _this118.captchaUpdPromise = null; return _this118; } _inherits(_2chRip, _BaseBoard7); return _createClass(_2chRip, [{ key: "css", get: function get() { return "small[id^=\"rfmap_\"], #submit_button, .qreply_btn { display: none; }\n\t\t\t\t#subject + div { display: inline !important; }\n\t\t\t\t.replypage .reply .reflink::before { content: \"\" }"; } }, { key: "captchaUpdate", value: function captchaUpdate(cap) { return cap.updateHelper('/cgi/captcha?task=get_id', function (_ref57) { var id = _ref57.responseText; $id('imgcaptcha').src = '/cgi/captcha?task=get_image&id=' + id; $id('captchaid').value = id; }); } }, { key: "getSubmitData", value: function getSubmitData(json) { return { error: json.message ? json.message_title + ': ' + json.message : null, postNum: json.num ? +json.num : null }; } }, { key: "init", value: function init() { $script('postFormSubmit = Function.prototype;'); $id('postform').insertAdjacentHTML('beforeend', '<input type="hidden" name="json" value="1">'); return false; } }]); }(BaseBoard); ibDomains['2ch.rip'] = ibDomains['dva-ch.net'] = _2chRip; var _410chan = function (_Kusaba2) { function _410chan() { var _this119; _classCallCheck(this, _410chan); for (var _len17 = arguments.length, args = new Array(_len17), _key14 = 0; _key14 < _len17; _key14++) { args[_key14] = arguments[_key14]; } _this119 = _callSuper(this, _410chan, [].concat(args)); _this119.qClosed = '.post-badge-locked'; _this119.qFormRedir = 'input#noko'; _this119.qPages = '.pgstbl > table > tbody > tr > td:nth-child(2)'; _this119.captchaRu = true; _this119.captchaUpdPromise = null; _this119.hasCatalog = true; _this119.markupBB = false; _this119.timePattern = 'dd+nn+yyyy++w++hh+ii+ss'; return _this119; } _inherits(_410chan, _Kusaba2); return _createClass(_410chan, [{ key: "captchaLang", get: function get() { return 0; } }, { key: "css", get: function get() { return "".concat(_superPropGet(_410chan, "css", this, 1), "\n\t\t\t\t#resizer { display: none; }\n\t\t\t\tform > span { margin-top: 5px; }\n\t\t\t\t.de-thr-hid { display: inherit; }\n\t\t\t\t.post-badge { display: inline-block !important; }\n\t\t\t\t.reflink::after { content: none !important; }\n\t\t\t\t.spoiler-image:hover::after { content: none !important; }\n\t\t\t\t.topmenu { z-index: 1; }"); } }, { key: "markupTags", get: function get() { return ['**', '*', '__', '^^', '%%', '`']; } }, { key: "captchaUpdate", value: function captchaUpdate(cap) { var _this120 = this; return cap.updateHelper("/api_adaptive.php?board=".concat(this.b), function (xhr) { if (xhr.responseText === '1') { cap.textEl.disabled = true; setTimeout(function () { return cap.textEl.value = 'проезд оплачен'; }, 0); return; } cap.textEl.disabled = false; cap.textEl.value = ''; var img = $q('img', cap.parentEl); var src = img.getAttribute('src'); img.src = ''; img.src = _this120.getCaptchaSrc(src); }); } }, { key: "getCaptchaSrc", value: function getCaptchaSrc(src) { return src.replace(/\?[^?]+$|$/, "?board=".concat(this.b, "&").concat(Math.random())); } }, { key: "getSage", value: function getSage(post) { var _$q12; return !!((_$q12 = $q('.filetitle', post)) !== null && _$q12 !== void 0 && _$q12.textContent.includes("\u21E9")); } }]); }(Kusaba); ibDomains['410chan.org'] = _410chan; var _4chan = function (_BaseBoard8) { function _4chan() { var _this121; _classCallCheck(this, _4chan); for (var _len18 = arguments.length, args = new Array(_len18), _key15 = 0; _key15 < _len18; _key15++) { args[_key15] = arguments[_key15]; } _this121 = _callSuper(this, _4chan, [].concat(args)); _this121._4chan = true; _this121.cReply = 'post reply'; _this121.qBan = 'strong[style="color: red;"]'; _this121.qClosed = '.archivedIcon, .closedIcon'; _this121.qDelBtn = '.deleteform > input[type="submit"]'; _this121.qError = '#errmsg'; _this121.qForm = 'form[name="post"]'; _this121.qFormRedir = null; _this121.qOmitted = '.summary.desktop'; _this121.qOPost = '.op'; _this121.qOPostEnd = '.replyContainer'; _this121.qPages = '.pagelist > .pages:not(.cataloglink) > a:last-of-type'; _this121.qPostHeader = '.postInfo'; _this121.qPostImg = '.fileThumb > img:not(.fileDeletedRes)'; _this121.qPostImgInfo = '.fileText'; _this121.qPostName = '.name'; _this121.qPostRef = '.postInfo > .postNum'; _this121.qPostSubj = '.subject'; _this121.anchor = '#p'; _this121.docExt = ''; _this121.firstPage = 1; _this121.formParent = 'resto'; _this121.hasCatalog = true; _this121.hasTextLinks = true; _this121.JsonBuilder = _4chanPostsBuilder; _this121.res = 'thread/'; _this121.timePattern = 'nn+dd+yy+w+hh+ii-?s?s?'; return _this121; } _inherits(_4chan, _BaseBoard8); return _createClass(_4chan, [{ key: "qFormSubj", get: function get() { return 'input[name="sub"]'; } }, { key: "qPostImgNameLink", get: function get() { return '.fileText > a'; } }, { key: "captchaUpdate", get: function get() { var value = null; if ($id('captchaFormPart')) { value = function value(cap) { var containerEl = $id('t-root'); if (!containerEl) { cap.hasCaptcha = false; return; } containerEl.insertAdjacentHTML('afterend', '<div id="t-root"></div>'); containerEl.remove(); $script('initTCaptcha();'); setTimeout(function () { cap.textEl = $id('t-resp'); cap.textEl.tabIndex = 999; cap.initTextEl(); }, 1e3); return null; }; } Object.defineProperty(this, 'captchaUpdate', { value: value }); return value; } }, { key: "css", get: function get() { return ".backlink, #blotter, .de-file-utils + .desktop, .extButton, hr.desktop, .navLinks,\n\t\t\t\t\t.postMenuBtn, #togglePostFormLink { display: none !important; }\n\t\t\t\t#bottomReportBtn { display: initial !important; }\n\t\t\t\t#g-recaptcha { height: initial; }\n\t\t\t\t.post-hidden:not(#quote-preview) input, .post-hidden:not(#quote-preview) .replyContainer,\n\t\t\t\t\t.post-hidden:not(#quote-preview) .summary, .post-hidden:not(#quote-preview) .op .file,\n\t\t\t\t\t.post-hidden:not(#quote-preview) .file, .post-hidden .wbtn, .post-hidden .postNum span,\n\t\t\t\t\t.post-hidden:not(#quote-preview) .backlink, div.post-hidden:not(#quote-preview) div.file,\n\t\t\t\t\tdiv.post-hidden:not(#quote-preview) blockquote.postMessage { display: unset; }\n\t\t\t\t.post-hidden .extButton, .post-hidden:not(#quote-preview) .postInfo { opacity: unset; }\n\t\t\t\t.postForm { display: table !important; width: auto !important; }\n\t\t\t\ttextarea { margin-right: 0 !important; }\n\t\t\t\t".concat(Cfg.widePosts ? '.sideArrows { display: none; }' : ''); } }, { key: "markupTags", get: function get() { return ['', '', '', '', $q('input[type="checkbox"][name="spoiler"]') ? '[spoiler' : '', this.b === 'g' ? '[code' : '']; } }, { key: "postersCount", get: function get() { var _$q13; var value = ((_$q13 = $q('span[class="ts-ips"]')) === null || _$q13 === void 0 ? void 0 : _$q13.innerHTML) || ''; if (!value) { $script("setTimeout(function() {\n\t\t\t\t\tdocument.getElementById(\"de-panel-info-posters\").textContent = window.unique_ips || \"\";\n\t\t\t\t}, 0)"); } return value; } }, { key: "fixDeadLinks", value: function fixDeadLinks(str) { return str.replace(/<span class="deadlink">>>(\d+)<\/span>/g, '<a class="de-ref-del deadlink" href="#p$1">>>$1</a>'); } }, { key: "fixHTMLHelper", value: function fixHTMLHelper(str) { return str.replace(/<span>([^<]+)(?:<\/?wbr>)?([^<]+)<\/span> \[<a [^>]+>Embed<\/a>\]/g, '$1$2').replace(/<\/?wbr>/g, '').replace(/( \(OP\)| →)<\/a/g, '</a').replace(/is2\.4chan/g, 'i.4cdn'); } }, { key: "fixVideo", value: function fixVideo() { return []; } }, { key: "getImgInfo", value: function getImgInfo(wrap) { var el = $q(this.qPostImgInfo, wrap); return el ? el.lastChild.textContent : ''; } }, { key: "getImgRealName", value: function getImgRealName(wrap) { var el = $q(this.qPostImgNameLink, wrap); return el ? el.title || el.parentNode.title || el.textContent : ''; } }, { key: "getJsonApiUrl", value: function getJsonApiUrl(board, tNum) { return "/".concat(board, "/thread/").concat(tNum, ".json"); } }, { key: "getImgWrap", value: function getImgWrap(img) { return img.parentNode.parentNode; } }, { key: "getPageUrl", value: function getPageUrl(board, page) { return fixBoardName(board) + (page > 1 ? page : ''); } }, { key: "getPostWrap", value: function getPostWrap(el) { return el.parentNode; } }, { key: "handlePostClick", value: function handlePostClick(post, el, e) { if (el.classList.contains('de-img-name')) { post._downloadImageByLink(el, e); } } }, { key: "reportForm", value: function reportForm(pNum) { $script("Report.open('".concat(pNum, "', '").concat(this.b, "');")); return true; } }, { key: "getSage", value: function getSage(post) { return !!$q('.id_Heaven, .useremail[href^="mailto:sage"]', post); } }, { key: "getSubmitData", value: function getSubmitData(dc) { var error = null; var postNum = null; var errEl = $q('#errmsg', dc); if (errEl) { error = errEl.innerHTML; } else { try { postNum = +$q('h1', dc).nextSibling.textContent.match(/no:(\d+)/)[1]; } catch (err) {} } return { error: error, postNum: postNum }; } }, { key: "getTNum", value: function getTNum(thr) { return +$q('input[type="checkbox"]', thr).name.match(/\d+/); } }, { key: "init", value: function init() { var _$id5; Cfg.findImgFile = 0; Cfg.txtBtnsLoc = 0; (_$id5 = $id('styleSelector')) === null || _$id5 === void 0 || _$id5.setAttribute('onchange', 'setActiveStyleSheet(this.value);'); return false; } }]); }(BaseBoard); ibDomains['4chan.org'] = ibDomains['4channel.org'] = _4chan; var _7chan = function (_Kusaba3) { function _7chan() { _classCallCheck(this, _7chan); return _callSuper(this, _7chan, arguments); } _inherits(_7chan, _Kusaba3); return _createClass(_7chan, [{ key: "init", value: function init() { return true; } }]); }(Kusaba); ibDomains['7chan.org'] = _7chan; var _8kun = function (_Vichan) { function _8kun() { _classCallCheck(this, _8kun); return _callSuper(this, _8kun, arguments); } _inherits(_8kun, _Vichan); return _createClass(_8kun, [{ key: "getEmptyFile", value: function getEmptyFile(field, name) { return { el: field, name: name, value: undefined }; } }]); }(Vichan); ibDomains['8kun.top'] = _8kun; var Archived = function (_FoolFuuka) { function Archived() { _classCallCheck(this, Archived); return _callSuper(this, Archived, arguments); } _inherits(Archived, _FoolFuuka); return _createClass(Archived, [{ key: "getImgRedirectSrc", value: function getImgRedirectSrc(url) { return $ajax(url).then(function (xhr) { return xhr.responseText.match(/<meta[^>]+url=([^"]+)">/)[1]; }); } }]); }(FoolFuuka); ibDomains['archived.moe'] = Archived; var Arhivach = function (_BaseBoard9) { function Arhivach() { var _this122; _classCallCheck(this, Arhivach); for (var _len19 = arguments.length, args = new Array(_len19), _key16 = 0; _key16 < _len19; _key16++) { args[_key16] = arguments[_key16]; } _this122 = _callSuper(this, Arhivach, [].concat(args)); _this122.cReply = 'post'; _this122.qDelBtn = null; _this122.qDelForm = 'body > .container-fluid'; _this122.qDelPassw = null; _this122.qPost = '.post[postid]:not(:first-child)'; _this122.qPostHeader = '.post_head'; _this122.qPostImg = '.post_image > img'; _this122.qPostMsg = '.post_comment_body'; _this122.qPostRef = '.post_id, .post_head > b'; _this122.qPostSubj = '.post_subject'; _this122.docExt = ''; _this122.hasOPNum = true; _this122.res = 'thread/'; return _this122; } _inherits(Arhivach, _BaseBoard9); return _createClass(Arhivach, [{ key: "qPostImgNameLink", get: function get() { return '.img_filename'; } }, { key: "qThread", get: function get() { return '.thread_inner'; } }, { key: "css", get: function get() { return ".media-expand-button, .post_replies, .post_num, .poster_sage { display: none !important; }\n\t\t\t\t.navbar-fixed-top, .thread_header_fixed { z-index: 5 !important; }\n\t\t\t\t.post { overflow-x: auto !important; }\n\t\t\t\t.thread_inner img.de-fullimg { max-width: 100% !important; max-height: 100% !important; }"; } }, { key: "isArchived", get: function get() { return true; } }, { key: "fixHTML", value: function fixHTML(data, isForm) { var formEl = _superPropGet(Arhivach, "fixHTML", this, 3)([data, isForm]); var links = $Q('.expand_image', formEl); for (var i = 0, len = links.length; i < len; ++i) { var _link$getAttribute; var link = links[i]; var href = (_link$getAttribute = link.getAttribute('onclick')) === null || _link$getAttribute === void 0 ? void 0 : _link$getAttribute.match(/(?:https?:\/|\/storage)[^']+/); if (href) { link.href = href[0]; link.removeAttribute('onclick'); } } return formEl; } }, { key: "getImgInfo", value: function getImgInfo(wrap) { return wrap.title; } }, { key: "getImgWrap", value: function getImgWrap(img) { return img.closest('a').parentNode; } }, { key: "getOp", value: function getOp(el) { return $q('.post:first-child', el); } }, { key: "getPNum", value: function getPNum(post) { return +post.getAttribute('postid'); } }, { key: "getSage", value: function getSage(post) { return !!$q('.poster_sage', post); } }, { key: "getThrUrl", value: function getThrUrl() { return $q('link[rel="canonical"]', doc.head).href; } }, { key: "getTNum", value: function getTNum(thr) { return this.getPNum(this.getOp(thr)); } }, { key: "init", value: function init() { var _this123 = this; defaultCfg.ajaxUpdThr = 0; setTimeout(function () { var delPosts = $Q('.post_deleted'); for (var i = 0, len = delPosts.length; i < len; ++i) { var post = pByNum.get(_this123.getPNum(delPosts[i])); if (post) { post.thr.deletePosts(post, false, false); } } $css(".post { background-color: ".concat(getComputedStyle($q('.post')).getPropertyValue('background-color'), " !important; }")); }, 500); return false; } }]); }(BaseBoard); ibDomains['arhivach.top'] = ibDomains['arhivach.xyz'] = ibDomains['arhivachovtj2jrp.onion'] = Arhivach; var Dobrochan = function (_Vichan2) { function Dobrochan() { _classCallCheck(this, Dobrochan); return _callSuper(this, Dobrochan, arguments); } _inherits(Dobrochan, _Vichan2); return _createClass(Dobrochan, [{ key: "css", get: function get() { return "".concat(_superPropGet(Dobrochan, "css", this, 1), "\n\t\t\t\t#de-pform input[type=\"text\"] { float: none !important; }"); } }, { key: "markupTags", get: function get() { return ['**', '*', '', '~~', '%%', '']; } }, { key: "captchaUpdate", value: function captchaUpdate() { $script('load_captcha("/vichan/inc/captcha/entrypoint.php", "abcdefghijklmnopqrstuvwxyz");'); return null; } }]); }(Vichan); ibDomains['dobrochan.net'] = Dobrochan; var Dollchan = function (_TinyIB) { function Dollchan() { var _this124; _classCallCheck(this, Dollchan); for (var _len20 = arguments.length, args = new Array(_len20), _key17 = 0; _key17 < _len20; _key17++) { args[_key17] = arguments[_key17]; } _this124 = _callSuper(this, Dollchan, [].concat(args)); _this124.qPages = '.pagelist'; _this124.markupBB = true; _this124.multiFile = true; _this124.timePattern = 'yy+nn+dd+w+hh+ii+ss'; return _this124; } _inherits(Dollchan, _TinyIB); return _createClass(Dollchan, [{ key: "captchaInit", get: function get() { var switchCaptcha = function switchCaptcha(status) { var hasPasscode = status === 'validpasscode'; $toggle($id('captchablock').lastElementChild, !hasPasscode); $toggle($id('validcaptchablock'), hasPasscode); $toggle($id('invalidcaptchablock'), status === 'invalidpasscode'); if (!hasPasscode) { var captchaInput = $id('captcha'); if (captchaInput) { captchaInput.value = ''; } } }; if (getCookies().passcode === '1') { $ajax(this.protocol + '//' + this.host + '/' + this.b + '/imgboard.php?passcode&check').then(function (xhr) { return switchCaptcha(xhr.responseText === 'OK' ? 'validpasscode' : 'invalidpasscode'); }, function () { return switchCaptcha('invalidpasscode'); }); } else { switchCaptcha('showcaptcha'); } return null; } }, { key: "fixHTMLHelper", get: function get() { return null; } }, { key: "fixFileInputs", value: function fixFileInputs(el) { var str = ' class="de-file-wrap"><input type="file" name="file[]"></div>'; el.innerHTML = '<div' + str + ('<div style="display: none;"' + str).repeat(3); } }, { key: "getImgRealName", value: function getImgRealName(wrap) { return $q('.filesize > a', wrap).textContent; } }, { key: "init", value: function init() { return false; } }]); }(TinyIB); ibDomains['dollchan.net'] = Dollchan; var Endchan = function (_Lynxchan) { function Endchan() { var _this125; _classCallCheck(this, Endchan); for (var _len21 = arguments.length, args = new Array(_len21), _key18 = 0; _key18 < _len21; _key18++) { args[_key18] = arguments[_key18]; } _this125 = _callSuper(this, Endchan, [].concat(args)); _this125.qTrunc = '.contentOmissionIndicator > p'; _this125.jsonSubmit = false; return _this125; } _inherits(Endchan, _Lynxchan); return _createClass(Endchan, [{ key: "css", get: function get() { return "".concat(_superPropGet(Endchan, "css", this, 1), "\n\t\t\t\t.bottomNav, .delLink, #expandAll, .hidePost, .hideThread, .linkLast50,\n\t\t\t\t\t.linkPreview, #modeBanner, .watchButton { display: none !important; }\n\t\t\t\t#de-main, .de-pview { font-size: 75%; }"); } }, { key: "init", value: function init() { _superPropGet(Endchan, "init", this, 3)([]); $Q('.imgLink > img[src^="/.youtube/"]').forEach(function (el) { return el.closest('figure').remove(); }); $Q('.youtube_wrapper').forEach(function (el) { var src = $q('a', el).href; $bBegin(el, "<a href=\"".concat(src, "\">").concat(src, "</a>")).nextSibling.remove(); }); this._hasNewAPI = false; return false; } }, { key: "getSubmitData", value: function getSubmitData(jsonString) { var _JSON$parse = JSON.parse(jsonString), status = _JSON$parse.status, data = _JSON$parse.data; return { error: status === 'error' ? data : null, postNum: status === 'ok' ? +data : null }; } }]); }(Lynxchan); ibDomains['endchan.net'] = ibDomains['endchan.gg'] = ibDomains['endchan.org'] = ibDomains['endchancxfbnrfgauuxlztwlckytq7rgeo5v6pc2zd4nyqo3khfam4ad.onion'] = ibDomains['enxx3byspwsdo446jujc52ucy2pf5urdbhqw3kbsfhlfjwmbpj5smdad.onion'] = ibDomains['kqrtg5wz4qbyjprujkz33gza7r73iw3ainqp1mz5zmu16symcdwy.loki'] = Endchan; var Ernstchan = function (_BaseBoard10) { function Ernstchan() { var _this126; _classCallCheck(this, Ernstchan); for (var _len22 = arguments.length, args = new Array(_len22), _key19 = 0; _key19 < _len22; _key19++) { args[_key19] = arguments[_key19]; } _this126 = _callSuper(this, Ernstchan, [].concat(args)); _this126.cReply = 'post'; _this126.qError = '.error > .info'; _this126.qFormRedir = 'input[name="gb2"][value="thread"]'; _this126.qFormSpoiler = 'input[type="checkbox"][name="spoilered"]'; _this126.qOPost = '.thread_OP'; _this126.qPages = '.pagelist > li:nth-last-child(2)'; _this126.qPost = '.thread_reply'; _this126.qPostHeader = '.post_head'; _this126.qPostMsg = '.text'; _this126.qPostSubj = '.subject'; _this126.qPostTrip = '.tripcode'; _this126.qTrunc = '.tldr'; _this126.docExt = ''; _this126.firstPage = 1; _this126.markupBB = true; _this126.multiFile = true; _this126.res = 'thread/'; return _this126; } _inherits(Ernstchan, _BaseBoard10); return _createClass(Ernstchan, [{ key: "qPostImgNameLink", get: function get() { return '.filename > a'; } }, { key: "css", get: function get() { return ".content > hr, .de-parea > hr, .de-pview > .doubledash, .sage { display: none !important }\n\t\t\t\t.de-pview > .post { margin-left: 0; border: none; }\n\t\t\t\t#de-win-reply { float:left; margin-left:2em }"; } }, { key: "fixFileInputs", value: function fixFileInputs(el) { var str = " class=\"de-file-wrap\"><input name=\"file\" type=\"file\">\n\t\t\t\t<input type=\"hidden\" name=\"spoilered\" value=\"0\">\n\t\t\t\t<input type=\"checkbox\" name=\"spoilered\" value=\"1\"></div>"; el.innerHTML = '<div' + str + ('<div style="display: none;"' + str).repeat(3); } }, { key: "getImgWrap", value: function getImgWrap(img) { return img.parentNode.parentNode.parentNode; } }, { key: "getPageUrl", value: function getPageUrl(board, page) { return page > 1 ? fixBoardName(board) + 'page/' + page : fixBoardName(board); } }, { key: "getPostElOfEl", value: function getPostElOfEl(el) { while (el && !nav.matchesSelector(el, '.post')) { el = el.parentElement; } return el.parentNode; } }]); }(BaseBoard); ibDomains['ernstchan.xyz'] = Ernstchan; var Gensokyo = function (_Kusaba4) { function Gensokyo() { var _this127; _classCallCheck(this, Gensokyo); for (var _len23 = arguments.length, args = new Array(_len23), _key20 = 0; _key20 < _len23; _key20++) { args[_key20] = arguments[_key20]; } _this127 = _callSuper(this, Gensokyo, [].concat(args)); _this127.hasRefererErr = true; return _this127; } _inherits(Gensokyo, _Kusaba4); return _createClass(Gensokyo); }(Kusaba); ibDomains['gensokyo.4otaku.org'] = Gensokyo; var Iichan = function (_BaseBoard11) { function Iichan() { var _this128; _classCallCheck(this, Iichan); for (var _len24 = arguments.length, args = new Array(_len24), _key21 = 0; _key21 < _len24; _key21++) { args[_key21] = arguments[_key21]; } _this128 = _callSuper(this, Iichan, [].concat(args)); _this128.hasArchive = true; _this128.hasCatalog = true; return _this128; } _inherits(Iichan, _BaseBoard11); return _createClass(Iichan, [{ key: "qFormMail", get: function get() { return 'input[name="nya2"]'; } }, { key: "qFormName", get: function get() { return 'td > input[name="nya1"]'; } }, { key: "qFormSubj", get: function get() { return 'input[name="nya3"]'; } }, { key: "catalogUrl", get: function get() { return "".concat(this.protocol, "//").concat(this.host, "/").concat(this.b, "/catalogue.html"); } }, { key: "css", get: function get() { return "".concat(!this.t ? '' : 'hr + #de-main { margin-top: -32px; } .logo { margin-bottom: 14px; }', "\n\t\t\t.iichan-hide-thread-btn, .iichan-quick-reply-btn, .postnum { display: none; }\n\t\t\t.replypage div[id^=\"thread\"] span.reflink::after { content: none; }"); } }, { key: "isArchived", get: function get() { return this.b.includes('/arch'); } }, { key: "stormWallFixAjax", value: function stormWallFixAjax(url, text, el, needForm, fnResult) { return this.stormWallHelper(url, text, function () { return fnResult(el); }, function (frText) { return fnResult(getAjaxResponseEl(frText, needForm)); }); } }, { key: "stormWallFixCaptcha", value: function stormWallFixCaptcha(url, img) { var _this129 = this; img.onload = img.onerror = function () { if (!(img.naturalHeight + img.naturalWidth)) { _this129.stormWallHelper(url, null, Function.prototype, function () { img.src = ''; img.src = url; }); } }; } }, { key: "stormWallFixSubmit", value: function stormWallFixSubmit(url, text, ajaxParams) { return this.stormWallHelper(url, text, function () { return $createDoc(text); }, function () { return $ajax(url, ajaxParams).then(function (xhr) { return $createDoc(xhr.responseText); }); }); } }, { key: "stormWallHelper", value: function stormWallHelper(url, text, fnOK, fnRes) { var stormWallTxt = '<script src="https://static.stormwall.pro/'; if (text !== null && !text.includes(stormWallTxt)) { return fnOK(); } return new Promise(function (resolve, reject) { var loadCounter = 0; $popup('err-stormwall', "<div>".concat(Lng.stormWallCheck[lang], "</div>") + "<iframe id=\"de-stormwall\" name=\"de-prohibited\" src=\"".concat(url, "\" width=\"500\" height=\"500\" style=\"display: none;\"></iframe>")); var frEl = $id('de-stormwall'); frEl.onload = function () { if (loadCounter++ < 1) { return; } var frText = frEl.contentWindow.document.documentElement.outerHTML; if (frText.includes(stormWallTxt)) { $show(frEl); reject(new AjaxError(0, Lng.stormWallErr[lang])); return; } closePopup('err-stormwall'); resolve(fnRes(frText)); }; }); } }, { key: "getImgRealName", value: function getImgRealName(wrap) { return $q('.filesize > em', wrap).textContent.split(',')[2] || _superPropGet(Iichan, "getImgRealName", this, 3)([wrap]); } }, { key: "init", value: function init() { defaultCfg.addSageBtn = 0; $script('highlight = Function.prototype;'); var el = $q(this.qFormSpoiler); if (el) { $hide(el = el.parentNode); el.previousSibling.remove(); } return false; } }]); }(BaseBoard); ibDomains['iichan.hk'] = ibDomains['iichan.lol'] = ibDomains['iichan.moe'] = ibDomains['ii.yakuji.moe'] = Iichan; var Ivchan = function (_BaseBoard12) { function Ivchan() { var _this130; _classCallCheck(this, Ivchan); for (var _len25 = arguments.length, args = new Array(_len25), _key22 = 0; _key22 < _len25; _key22++) { args[_key22] = arguments[_key22]; } _this130 = _callSuper(this, Ivchan, [].concat(args)); _this130.qClosed = 'img[src="/images/locked.png"]'; _this130.qDelForm = 'form[action*="delete"]'; _this130.qError = '.post-error, h2'; _this130.qFormRedir = 'select[name="goto"]'; _this130.qOmitted = '.abbrev > span:last-of-type'; _this130.qPages = '.pages > tbody > tr > td'; _this130.qPostImgInfo = '.fileinfo'; _this130.qPostMsg = '.postbody'; _this130.qPostSubj = '.replytitle'; _this130.qTrunc = '.abbrev > span:first-of-type'; _this130.anchor = '#i'; _this130.captchaRu = true; _this130.formParent = 'thread_id'; _this130.hasPicWrap = true; _this130.multiFile = true; _this130.timePattern = 'dd+m+?+?+?+?+?+yyyy++w++hh+ii-?s?s?'; return _this130; } _inherits(Ivchan, _BaseBoard12); return _createClass(Ivchan, [{ key: "css", get: function get() { return ".de-video-obj-inline { margin-left: 5px; }\n\t\t\t\t.delete > img, .popup, .reply_, .search_google, .search_iqdb { display: none; }\n\t\t\t\t.delete { background: none; }\n\t\t\t\t.delete_checkbox { position: static !important; }"; } }, { key: "deleteTruncMsg", value: function deleteTruncMsg(post, el, isInit) { var _el$previousSibling2, _el$nextSibling2; (_el$previousSibling2 = el.previousSibling) === null || _el$previousSibling2 === void 0 || _el$previousSibling2.remove(); (_el$nextSibling2 = el.nextSibling) === null || _el$nextSibling2 === void 0 || _el$nextSibling2.remove(); el.remove(); if (isInit) { post.msg.replaceWith($q('.alternate', post.el)); } else { var sRunner = new SpellsRunner(); post.updateMsg($q('.alternate', post.el), sRunner); sRunner.endSpells(); } post.msg.classList.remove('alternate'); } }, { key: "getImgSrcLink", value: function getImgSrcLink(img) { var el = img.parentNode; return el.tagName.toLowerCase() === 'a' ? el : $q('.fileinfo > a', img.previousElementSibling ? el : el.parentNode); } }, { key: "getImgWrap", value: function getImgWrap(img) { var el = img.parentNode; return el.tagName.toLowerCase() === 'a' ? (el.previousElementSibling ? el : el.parentNode).parentNode : img.previousElementSibling ? el : el.parentNode; } }, { key: "getPageUrl", value: function getPageUrl(board, page) { return fixBoardName(board) + (page > 0 ? page + this.docExt : 'index.xhtml'); } }, { key: "getTNum", value: function getTNum(thr) { return +$q('a[name]', thr).name.match(/\d+/); } }]); }(BaseBoard); ibDomains['ivchan.net'] = Ivchan; var Kohlchan = function (_Lynxchan2) { function Kohlchan() { var _this131; _classCallCheck(this, Kohlchan); for (var _len26 = arguments.length, args = new Array(_len26), _key23 = 0; _key23 < _len26; _key23++) { args[_key23] = arguments[_key23]; } _this131 = _callSuper(this, Kohlchan, [].concat(args)); _this131.kohlchan = true; _this131.qFormRules = '#rules_row'; _this131.qPostImg = '.uploadCell > a > img'; _this131.hasTextLinks = true; _this131.markupBB = true; _this131.timePattern = 'yyyy+nn+dd+hh+ii+ss'; return _this131; } _inherits(Kohlchan, _Lynxchan2); return _createClass(Kohlchan, [{ key: "css", get: function get() { return "".concat(_superPropGet(Kohlchan, "css", this, 1), "\n\t\t\t\t.extraMenuButton, #postingForm, .sage { display: none; }"); } }, { key: "fixKCUnixFilenames", get: function get() { var value = null; if (locStorage.unixFilenames === 'true') { value = function value(post) { var containerEl = $q('div.panelUploads', post.el); var imgLinks = $Q('a.imgLink:not(.unixLink)', containerEl); var timetext = new Date(containerEl.parentElement.parentElement.querySelectorAll('span.labelCreated')[0].textContent.replaceAll('-', '/')).getTime(); timetext = timetext + timetext % 999; for (var j = 0; j < imgLinks.length; j++) { var imgLink = imgLinks[j]; var parentEl = imgLink.parentElement; imgLink.href += '/' + timetext + (j === 0 && imgLinks.length === 1 ? '.' : '-' + j + '.') + $q('a.originalNameLink', parentEl.nodeName === 'SPAN' ? parentEl.parentElement : parentEl).title.split('.').pop(); imgLink.classList.add('unixLink'); } }; } Object.defineProperty(this, 'fixKCUnixFilenames', { value: value }); return value; } }, { key: "markupTags", get: function get() { return ['b', 'i', 'u', 's', 'spoiler', 'code']; } }, { key: "captchaAfterSubmit", value: function captchaAfterSubmit(data) { if (data !== '{"status":"bypassable"}') { return false; } $popup('upload', "<div>Tor / VPN / Proxy detected</div><!--\n\t\t\t\t--><div>You need a block bypass to post</div><!--\n\t\t\t\t--><div><img src=\"/captcha.js?d=".concat(new Date().toString(), "\" class=\"captchaImage\"") + " title=\"Click to reload\" onclick=\"captchaUtils.reloadCaptcha();\"><!--\n\t\t\t\t--></div><div><!--\n\t\t\t\t\t--><input type=\"button\" class=\"modalOkButton\" value=\"Send\"><!--\n\t\t\t\t\t--><input type=\"text\" class=\"modalAnswer\"><!--\n\t\t\t\t--></div>").style.cssText = 'text-align: center;'; var submitEl = $q('.modalOkButton'); var inputEl = $q('.modalAnswer'); submitEl.onclick = function () { $popup('captcha', Lng.sending[lang], true); var formData = new FormData(); formData.append('captcha', inputEl.value.trim()); $ajax('/renewBypass.js?json=1', { data: formData, method: 'POST' }).then(function (xhr) { var obj = JSON.parse(xhr.responseText); switch (obj.status) { case 'ok': case 'finish': closePopup('captcha'); $popup('upload', 'OK! You may now post.'); return; case 'hashcash': closePopup('captcha'); $popup('upload', '<a target="_blank" href=' + '"/addon.js/hashcash/?action=get">Click here to activate your bypass.</a>'); return; default: $popup('captcha', obj.data || xhr.responseText); } }, function () { return $popup('captcha', Lng.noConnect[lang]); }); }; inputEl.onkeydown = function (e) { if (e.key === 'Enter') { submitEl.click(); e.preventDefault(); } }; if (postform.isQuick) { postform.setReply(true, false); } updater.sendErrNotif(); updater.continueUpdater(); return true; } }, { key: "fixHTMLHelper", value: function fixHTMLHelper(str) { return str.replace(/imgLink/g, ''); } }, { key: "getImgRealName", value: function getImgRealName(wrap) { return $q('.originalNameLink', wrap).title; } }, { key: "getSage", value: function getSage(post) { return $q('.sage', post).hasChildNodes(); } }, { key: "init", value: function init() { if (!this.host.includes('nocsp.') && this.host.includes('kohlchan.net')) { deWindow.location.assign(deWindow.location.href.replace(/(www\.)?kohlchan\.net/, 'nocsp.kohlchan.net')); return true; } if (locStorage.autoRefreshMode !== 'false' || locStorage.convertLocalTimes !== 'false') { locStorage.autoRefreshMode = false; locStorage.convertLocalTimes = false; deWindow.location.reload(); return true; } $Q('.imgLink').forEach(function (el) { return el.className = 'de-img-link imgLink'; }); return _superPropGet(Kohlchan, "init", this, 3)([]); } }, { key: "sendHTML5Post", value: function sendHTML5Post(form, data, needProgress, hasFiles) { var oekakiEl = $id('wPaint'); if (oekakiEl !== null && oekakiEl !== void 0 && oekakiEl.hasChildNodes() && oekakiEl.style.display !== 'none') { hasFiles = true; var mime = { type: 'image/png' }; var files = [new File([new Blob([ContentLoader.getDataFromCanvas($q('.wPaint-canvas', oekakiEl))], mime)], 'oekaki.png', mime)].concat(_toConsumableArray(data.getAll('files').slice(0, -1))); data["delete"]('files'); for (var _iterator34 = _createForOfIteratorHelperLoose(files), _step34; !(_step34 = _iterator34()).done;) { var file = _step34.value; data.append('files', file); } } return _superPropGet(Kohlchan, "sendHTML5Post", this, 3)([form, data, needProgress, hasFiles]); } }]); }(Lynxchan); ibDomains['kohlchan.net'] = ibDomains['kohlchan.top'] = ibDomains['kohlchanagb7ih5g.onion'] = ibDomains['kohlchanvwpfx6hthoti5fvqsjxgcwm3tmddvpduph5fqntv5affzfqd.onion'] = ibDomains['kohlkanal.net'] = Kohlchan; var Kropyvach = function (_Vichan3) { function Kropyvach() { var _this132; _classCallCheck(this, Kropyvach); for (var _len27 = arguments.length, args = new Array(_len27), _key24 = 0; _key24 < _len27; _key24++) { args[_key24] = arguments[_key24]; } _this132 = _callSuper(this, Kropyvach, [].concat(args)); _this132.markupBB = true; return _this132; } _inherits(Kropyvach, _Vichan3); return _createClass(Kropyvach, [{ key: "css", get: function get() { return _superPropGet(Kropyvach, "css", this, 1) + (this.t ? '' : '\r\n.de-btn-reply { display: none !important; }'); } }, { key: "markupTags", get: function get() { return ['b', 'i', 'u', 's', 'spoiler', 'code']; } }]); }(Vichan); ibDomains['kropyva.ch'] = Kropyvach; var Lainchan = function (_Vichan4) { function Lainchan() { var _this133; _classCallCheck(this, Lainchan); for (var _len28 = arguments.length, args = new Array(_len28), _key25 = 0; _key25 < _len28; _key25++) { args[_key25] = arguments[_key25]; } _this133 = _callSuper(this, Lainchan, [].concat(args)); _this133.qOPost = '.op'; return _this133; } _inherits(Lainchan, _Vichan4); return _createClass(Lainchan, [{ key: "css", get: function get() { return "".concat(_superPropGet(Lainchan, "css", this, 1), "\n\t\t\t\t.sidearrows { display: none !important; }\n\t\t\t\t.bar { z-index: 1; }\n\t\t\t\t").concat(Cfg.imgNames ? '.details > a { display: none; }' : ''); } }, { key: "getImgRealName", value: function getImgRealName(wrap) { return $q('.details > a, .postfilename', wrap).textContent; } }, { key: "init", value: function init() { _superPropGet(Lainchan, "init", this, 3)([]); $Q('.files + .post.op').forEach(function (el) { return el.prepend(el.previousElementSibling); }); return false; } }]); }(Vichan); ibDomains['lainchan.org'] = Lainchan; var Niuchan = function (_Kusaba5) { function Niuchan() { _classCallCheck(this, Niuchan); return _callSuper(this, Niuchan, arguments); } _inherits(Niuchan, _Kusaba5); return _createClass(Niuchan, [{ key: "css", get: function get() { return "".concat(_superPropGet(Niuchan, "css", this, 1), "\n\t\t\t\t.replybacklinks, .resize { display: none; }"); } }]); }(Kusaba); ibDomains['niuchan.org'] = Niuchan; var Nowere = function (_BaseBoard13) { function Nowere() { _classCallCheck(this, Nowere); return _callSuper(this, Nowere, arguments); } _inherits(Nowere, _BaseBoard13); return _createClass(Nowere, [{ key: "markupTags", get: function get() { return ['**', '***', '', '^H', '', '']; } }, { key: "init", value: function init() { $script('highlight = Function.prototype;'); return false; } }]); }(BaseBoard); ibDomains['nowere.net'] = Nowere; var Ponyach = function (_BaseBoard14) { function Ponyach() { var _this134; _classCallCheck(this, Ponyach); for (var _len29 = arguments.length, args = new Array(_len29), _key26 = 0; _key26 < _len29; _key26++) { args[_key26] = arguments[_key26]; } _this134 = _callSuper(this, Ponyach, [].concat(args)); _this134.qBan = 'font[color="#FF0000"]'; _this134.qPostImgInfo = '.filesize[style="display: inline;"]'; _this134.formParent = 'replythread'; _this134.jsonSubmit = true; _this134.multiFile = true; return _this134; } _inherits(Ponyach, _BaseBoard14); return _createClass(Ponyach, [{ key: "qPostImgNameLink", get: function get() { return 'a:first-of-type'; } }, { key: "getImgInfo", value: function getImgInfo(wrap) { return wrap.textContent; } }, { key: "getImgRealName", value: function getImgRealName(wrap) { return $q('.mobile_filename_hide', wrap).textContent; } }, { key: "getImgWrap", value: function getImgWrap(img) { return $id('fs_' + img.alt); } }, { key: "getPNum", value: function getPNum(post) { return +post.getAttribute('data-num'); } }, { key: "getSubmitData", value: function getSubmitData(_ref58) { var error = _ref58.error, id = _ref58.id; return { error: error, postNum: id && +id }; } }, { key: "init", value: function init() { var el = $id('postform'); if (el) { el.setAttribute('action', el.getAttribute('action') + '?json=1'); } defaultCfg.postSameImg = 0; defaultCfg.removeEXIF = 0; return false; } }]); }(BaseBoard); ibDomains['ponyach.ru'] = Ponyach; var Ponychan = function (_Tinyboard2) { function Ponychan() { var _this135; _classCallCheck(this, Ponychan); for (var _len30 = arguments.length, args = new Array(_len30), _key27 = 0; _key27 < _len30; _key27++) { args[_key27] = arguments[_key27]; } _this135 = _callSuper(this, Ponychan, [].concat(args)); _this135.qClosed = 'img[title="Locked"]'; _this135.qOPost = '.opContainer'; _this135.jsonSubmit = false; return _this135; } _inherits(Ponychan, _Tinyboard2); return _createClass(Ponychan, [{ key: "css", get: function get() { return "".concat(_superPropGet(Ponychan, "css", this, 1), "\n\t\t\t\t.mature_thread { display: block !important; }\n\t\t\t\t.mature_warning { display: none; }\n\t\t\t\t").concat(Cfg.imgNames ? '.post-filename { display: none; }' : ''); } }, { key: "getImgRealName", value: function getImgRealName(wrap) { return $q('.post-filename', wrap).textContent; } }, { key: "init", value: function init() { _superPropGet(Ponychan, "init", this, 3)([]); $Q('img[data-mature-src]').forEach(function (el) { return el.src = el.getAttribute('data-mature-src'); }); return false; } }]); }(Tinyboard); ibDomains['ponychan.net'] = Ponychan; var Rfch = function (_Vichan5) { function Rfch() { _classCallCheck(this, Rfch); return _callSuper(this, Rfch, arguments); } _inherits(Rfch, _Vichan5); return _createClass(Rfch, [{ key: "css", get: function get() { return "".concat(_superPropGet(Rfch, "css", this, 1), "\n\t\t\t\t#coll-hide, #coll-show { display: none; }\n\t\t\t\tform[name=\"post\"], form[name=\"post\"] > table > tbody > tr:first-child\n\t\t\t\t\t{ display: block !important; }"); } }]); }(Vichan); ibDomains['rfch.rocks'] = Rfch; var Spirech = function (_Vichan6) { function Spirech() { var _this136; _classCallCheck(this, Spirech); for (var _len31 = arguments.length, args = new Array(_len31), _key28 = 0; _key28 < _len31; _key28++) { args[_key28] = arguments[_key28]; } _this136 = _callSuper(this, Spirech, [].concat(args)); _this136.qForm = 'form[name="post"], form[name="de-post"]'; _this136.qFormRules = '#post-info'; _this136.jsonSubmit = true; _this136.markupBB = true; return _this136; } _inherits(Spirech, _Vichan6); return _createClass(Spirech, [{ key: "css", get: function get() { return "".concat(_superPropGet(Spirech, "css", this, 1), "\n\t\t\t\t.favorite-button, .stylebuttons, #symbols-left + br { display: none !important; }\n\t\t\t\t#post-info { width: auto }"); } }, { key: "markupTags", get: function get() { return ['b', 'i', 'u', 's', 'spoiler', 'code', 'sup', 'sub']; } }, { key: "captchaUpdate", value: function captchaUpdate() { $script("load_captcha(\"/inc/captcha/entrypoint.php\", \"abcdefghijklmnopqrstuvwxyz\");\n\t\t\t\tactually_load_captcha(\"/inc/captcha/entrypoint.php\", \"abcdefghijklmnopqrstuvwxyz\");"); return null; } }, { key: "init", value: function init() { _superPropGet(Spirech, "init", this, 3)([]); $script('$("textarea#body").on("change input propertychange", countSymbols); countSymbols();'); $q('form[name="post"]').name = 'de-post'; } }]); }(Vichan); ibDomains['spirech.org'] = ibDomains['old52qbrspw6jivvrcjlybucxatpnzwea3oxrsw75be4ka53qfqhrnid.onion'] = Spirech; var Synch = function (_Tinyboard3) { function Synch() { var _this137; _classCallCheck(this, Synch); for (var _len32 = arguments.length, args = new Array(_len32), _key29 = 0; _key29 < _len32; _key29++) { args[_key29] = arguments[_key29]; } _this137 = _callSuper(this, Synch, [].concat(args)); _this137.qPages = '.pagination'; _this137.qPostImgInfo = '.unimportant'; _this137.markupBB = true; return _this137; } _inherits(Synch, _Tinyboard3); return _createClass(Synch, [{ key: "qPostImgNameLink", get: function get() { return '.file-info > a'; } }, { key: "css", get: function get() { return "".concat(_superPropGet(Synch, "css", this, 1), "\n\t\t\t\t.fa-sort { display: none; }\n\t\t\t\ttime::after { content: none; }"); } }, { key: "markupTags", get: function get() { return ['b', 'i', 'u', 's', 'spoiler', 'code', 'sup', 'sub']; } }, { key: "init", value: function init() { var val = '{ "simpleNavbar": true }'; if (locStorage.settings !== val) { locStorage.settings = val; deWindow.location.reload(); return true; } _superPropGet(Synch, "init", this, 3)([]); defaultCfg.timePattern = 'w+dd+m+yyyy+hh+ii+ss'; defaultCfg.timeOffset = 4; defaultCfg.correctTime = 1; return false; } }, { key: "fixHTML", value: function fixHTML(data, isForm) { var formEl = _superPropGet(Synch, "fixHTML", this, 3)([data, isForm]); var els = $Q('.btn-group', formEl); for (var i = 0, len = els.length; i < len; ++i) { els[i].replaceWith($q('a', els[i])); } return formEl; } }]); }(Tinyboard); ibDomains['syn-ch.ru'] = ibDomains['syn-ch.com'] = ibDomains['syn-ch.com.ua'] = ibDomains['syn-ch.org'] = Synch; var Warosu = function (_BaseBoard15) { function Warosu() { var _this138; _classCallCheck(this, Warosu); for (var _len33 = arguments.length, args = new Array(_len33), _key30 = 0; _key30 < _len33; _key30++) { args[_key30] = arguments[_key30]; } _this138 = _callSuper(this, Warosu, [].concat(args)); _this138.qDelForm = '.content'; _this138.qForm = '.subreply'; _this138.qFormSubm = '.g-recaptcha'; _this138.qPostImgInfo = '.fileinfo'; _this138.qPostRef = '.js'; _this138.qOPost = '.comment'; _this138.res = 'thread/'; return _this138; } _inherits(Warosu, _BaseBoard15); return _createClass(Warosu, [{ key: "css", get: function get() { return '.quoted-by { display: none !important; }'; } }, { key: "getTNum", value: function getTNum(thr) { return +$q('.comment', thr).id.match(/\d+/); } }]); }(BaseBoard); ibDomains['warosu.org'] = Warosu; var wLoc = deWindow.location; var protocol = wLoc.protocol; var domain = localData === null || localData === void 0 ? void 0 : localData.domain; if (checkDomains) { if (!domain) { var ibKeys = Object.keys(ibDomains); var i = ibKeys.length; var host = wLoc.hostname.toLowerCase(); while (i--) { domain = ibKeys[i]; if (host === domain || host.endsWith('.' + domain)) { return new ibDomains[domain](protocol, domain); } } } else if (domain in ibDomains) { return new ibDomains[domain](protocol, domain); } } if (!domain) { domain = wLoc.hostname; } if (!domain || !checkEngines) { return null; } domain = domain.match(/(?:(?:[^.]+\.)(?=org\.|net\.|com\.))?[^.]+\.[^.]+$|^\d+\.\d+\.\d+\.\d+$|localhost/)[0]; for (var _i17 = ibEngines.length - 1; _i17 >= 0; --_i17) { var _ibEngines$_i = _slicedToArray(ibEngines[_i17], 2), path = _ibEngines$_i[0], Ctor = _ibEngines$_i[1]; if ($q(path, doc)) { return new Ctor(protocol, domain); } } return null; } var DollchanAPI = { initAPI: function initAPI() { var _this139 = this; this.hasListeners = false; if (!('MessageChannel' in deWindow)) { return; } var channel = new MessageChannel(); this.port = channel.port1; this.port.onmessage = this._handleMessage; this.activeListeners = new Set(); var port = channel.port2; doc.defaultView.addEventListener('message', function (e) { if (e.data === 'de-request-api-message') { _this139.hasListeners = true; doc.defaultView.postMessage('de-answer-api-message', '*', [port]); } }); }, hasListener: function hasListener(name) { return DollchanAPI.hasListeners && DollchanAPI.activeListeners.has(name); }, notify: function notify(name, data) { if (this.hasListener(name)) { this.port.postMessage({ name: name, data: data }); } }, _handleMessage: function _handleMessage(_ref59) { var arg = _ref59.data; if (!(arg !== null && arg !== void 0 && arg.name)) { return; } var rv = null; var name = arg.name, data = arg.data; switch (name.toLowerCase()) { case 'registerapi': if (data) { rv = {}; for (var _iterator35 = _createForOfIteratorHelperLoose(data), _step35; !(_step35 = _iterator35()).done;) { var aName = _step35.value; rv[aName] = DollchanAPI._register(aName.toLowerCase()); } } break; } DollchanAPI.port.postMessage({ name: name, data: rv }); }, _register: function _register(name) { switch (name) { case 'expandmedia': case 'filechange': case 'newpost': case 'submitform': break; default: return false; } this.activeListeners.add(name); return true; } }; function checkForUpdates(_x40, _x41) { return _checkForUpdates.apply(this, arguments); } function _checkForUpdates() { _checkForUpdates = _asyncToGenerator(_regeneratorRuntime().mark(function _callee58(isManual, lastUpdateTime) { var _v$; var responseText, _yield$$ajax, v, remoteVer, currentVer, src, link, chLogLink, i, len, c, vc; return _regeneratorRuntime().wrap(function _callee58$(_context66) { while (1) switch (_context66.prev = _context66.next) { case 0: if (isManual) { _context66.next = 3; break; } if (!(Date.now() - +lastUpdateTime < [0, 1, 2, 7, 14, 30][Cfg.updDollchan] * 1e3 * 60 * 60 * 24)) { _context66.next = 3; break; } throw new Error('Itʼs not time for an update yet'); case 3: _context66.prev = 3; _context66.next = 6; return $ajax(gitRaw + 'src/modules/Wrap.js', { 'Content-Type': 'text/plain' }, true); case 6: _yield$$ajax = _context66.sent; responseText = _yield$$ajax.responseText; _context66.next = 17; break; case 10: _context66.prev = 10; _context66.t0 = _context66["catch"](3); if (!isManual) { _context66.next = 16; break; } return _context66.abrupt("return", "<div style=\"color: red; font-weigth: bold;\">".concat(Lng.noConnect[lang], "</div>")); case 16: throw new Error(Lng.noConnect[lang]); case 17: v = responseText.match(/const version = '([0-9.]+)';/); remoteVer = v === null || v === void 0 || (_v$ = v[1]) === null || _v$ === void 0 ? void 0 : _v$.split('.'); if (remoteVer) { _context66.next = 21; break; } throw new Error('Canʼt get remote version'); case 21: currentVer = version.split('.'); src = "".concat(gitRaw).concat(nav.isESNext ? 'src/Dollchan_Extension_Tools.es6' : 'Dollchan_Extension_Tools', ".user.js"); _context66.next = 25; return CfgSaver.saveObj('lastUpd', function () { return Date.now(); }); case 25: link = "<a style=\"color: blue; font-weight: bold;\" href=\"".concat(src, "\">"); chLogLink = "<a target=\"_blank\" href=\"".concat(gitWiki).concat(lang === 1 ? 'versions-en' : 'versions', "\">\r\n").concat(Lng.changeLog[lang], "<a>"); i = 0, len = Math.max(currentVer.length, remoteVer.length); case 28: if (!(i < len)) { _context66.next = 38; break; } if (!((+remoteVer[i] || 0) > (+currentVer[i] || 0))) { _context66.next = 33; break; } return _context66.abrupt("return", "".concat(link).concat(Lng.updAvail[lang].replace('%s', v[1]), "</a>").concat(chLogLink)); case 33: if (!((+remoteVer[i] || 0) < (+currentVer[i] || 0))) { _context66.next = 35; break; } return _context66.abrupt("break", 38); case 35: ++i; _context66.next = 28; break; case 38: if (!isManual) { _context66.next = 42; break; } c = responseText.match(/const commit = '([0-9abcdef]+)';/)[1]; vc = version + '.' + c; return _context66.abrupt("return", c === commit ? Lng.haveLatestCommit[lang].replace('%s', vc) : "".concat(Lng.haveLatestStable[lang].replace('%s', version), "\r\n").concat(Lng.newCommitsAvail[lang].replace('%s', "".concat(link).concat(vc, "</a>").concat(chLogLink)))); case 42: throw new Error(); case 43: case "end": return _context66.stop(); } }, _callee58, null, [[3, 10]]); })); return _checkForUpdates.apply(this, arguments); } function showDonateMsg() { var item = function item(name, value) { return "<div>- <i>".concat(name, "</i>: <i style=\"font: 14px monospace; color: green;\">").concat(value, "</i></div>"); }; $popup('donate', Lng.donateMsg[lang] + ":<br style=\"margin-bottom: 8px;\"><!--\n\t\t--><div class=\"de-logo\"><svg><use xlink:href=\"#de-symbol-panel-logo\"/></svg></div><!--\n\t\t--><div style=\"display: inline-flex; flex-direction: column; gap: 6px; vertical-align: top;\">" + item('BTC', '1BmVjk3DMPZeJUqBtqZRUCmL234Wc3Bc9Y') + item('BTC (SegWit)', 'bc1qleycjdph5v3g26ewy7x37n5a4kwegjgttpjwzw') + item('ETH (ERC20)', '0xffa96732ae8df25c34444c70c0d59c752a47aafa') + item('YooMoney RUB', '410012122418236') + item('Mastercard', '5375411208220306') + "<div>- <a href=\"https://send.monobank.ua/jar/A7Saf6YAaz\" target=\"_blank\">".concat(Lng.donateOnline[lang], "</a></div>") + '</div>'); } function initPage() { if (aib.t) { if (Cfg.rePageTitle && Thread.first) { doc.title = "/".concat(aib.b, " - ").concat(Thread.first.op.title); } if (!localData) { Cfg.stats.view++; CfgSaver.saveObj(aib.domain, function (loadedCfg) { loadedCfg.stats.view++; return loadedCfg; }); } } else { thrNavPanel.initThrNav(); } if (!localData) { updater = initThreadUpdater(doc.title, aib.t && Cfg.ajaxUpdThr && !aib.isArchived); } } function scrollPage() { if (!aib.t && Cfg.scrollToTop) { scrollTo(0, 1); return; } setTimeout(function () { var post, num; var hash = deWindow.location.hash; if (hash && (num = hash.match(/#[ip]?(\d+)$/)) && (num = +num[1]) && (post = pByNum.get(num)) && !post.isOp) { post.selectAndScrollTo(); return; } var id = 'de-scroll-' + aib.b + (aib.t || ''); var val = +sesStorage[id]; if (val && needScroll && Cfg.saveScroll) { scrollTo(0, val); sesStorage.removeItem(id); } }, 0); } function addSVGIcons() { doc.body.insertAdjacentHTML('beforeend', "\n\t<div id=\"de-svg-icons\">\n\t<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n\t<defs>\n\t\t<linearGradient id=\"de-btn-back-gradient\" x1=\"50%\" y1=\"0%\" y2=\"100%\" x2=\"50%\">\n\t\t\t<stop offset=\"0%\" stop-color=\"#A0A0A0\"/>\n\t\t\t<stop offset=\"50%\" stop-color=\"#505050\"/>\n\t\t\t<stop offset=\"100%\" stop-color=\"#A0A0A0\"/>\n\t\t</linearGradient>\n\t\t<linearGradient id=\"de-file-del-gradient\" x1=\"50%\" y1=\"10%\" x2=\"50%\" y2=\"90%\">\n\t\t\t<stop offset=\"0\" stop-color=\"#fbd\"/>\n\t\t\t<stop offset=\"50%\" stop-color=\"#f30\"/>\n\t\t</linearGradient>\n\t</defs>\n\n\t<!-- POST ICONS -->\n\t<symbol viewBox=\"0 0 16 16\" id=\"de-symbol-post-back\">\n\t\t<path class=\"de-post-btns-back\" d=\"M4 1Q1 1 1 4v8q0 3 3 3h8q3 0 3-3V4q0-3-3-3z\"/>\n\t</symbol>\n\t<symbol viewBox=\"0 0 16 16\" id=\"de-symbol-post-hide\">\n\t\t<use class=\"de-post-btns-back\" xlink:href=\"#de-symbol-post-back\"/>\n\t\t<path class=\"de-svg-stroke\" stroke-width=\"2.5\" d=\"M4.5 11.5l7-7M11.5 11.5l-7-7\"/>\n\t</symbol>\n\t<symbol viewBox=\"0 0 16 16\" id=\"de-symbol-post-unhide\">\n\t\t<use class=\"de-post-btns-back\" xlink:href=\"#de-symbol-post-back\"/>\n\t\t<path class=\"de-svg-stroke\" stroke-width=\"2\" d=\"M8 4v8M4 8h8\"/>\n\t</symbol>\n\t<symbol viewBox=\"0 0 16 16\" id=\"de-symbol-post-reply\">\n\t\t<use class=\"de-post-btns-back\" xlink:href=\"#de-symbol-post-back\"/>\n\t\t<path class=\"de-svg-fill\" d=\"M5 11c0 .8.6 1.2 1.3.7l5-3c.6-.4.6-1 0-1.5l-5-3C5.6 4 5 4.3 5 5v6z\"/>\n\t</symbol>\n\t<symbol viewBox=\"0 0 16 16\" id=\"de-symbol-post-expthr\">\n\t\t<use class=\"de-post-btns-back\" xlink:href=\"#de-symbol-post-back\"/>\n\t\t<path class=\"de-svg-fill\" d=\"M4.5 6L8 3l3.5 3H9.25v4h2.25L8 13l-3.5-3h2.25V6z\"/>\n\t</symbol>\n\t<symbol viewBox=\"0 0 16 16\" id=\"de-symbol-post-fav\">\n\t\t<use class=\"de-post-btns-back\" xlink:href=\"#de-symbol-post-back\"/>\n\t\t<path class=\"de-svg-fill\" d=\"M8 3l1.5 3 3.5.5-2.5 2.2 1 3.8-3.5-2-3.5 2 1-3.8L3 6.5 6.5 6 8 3z\"/>\n\t</symbol>\n\t<symbol viewBox=\"0 0 16 16\" id=\"de-symbol-post-stick\">\n\t\t<use class=\"de-post-btns-back\" xlink:href=\"#de-symbol-post-back\"/>\n\t\t<path class=\"de-svg-fill\" d=\"M5 5h6v6H5z\"/>\n\t</symbol>\n\t<symbol viewBox=\"0 0 16 16\" id=\"de-symbol-post-sage\">\n\t\t<use class=\"de-post-btns-back\" xlink:href=\"#de-symbol-post-back\"/>\n\t\t<path class=\"de-svg-fill\" d=\"M4 9h8l-4 4.5zm2-6h4v1H6zm0 2h4v1H6zm0 2h4v1H6z\"/>\n\t</symbol>\n\t<symbol viewBox=\"0 0 16 16\" id=\"de-symbol-post-img\">\n\t\t<use class=\"de-post-btns-back\" xlink:href=\"#de-symbol-post-back\"/>\n\t\t<circle class=\"de-svg-stroke\" stroke-width=\"2\" cx=\"7\" cy=\"7\" r=\"2.5\"/>\n\t\t<path class=\"de-svg-stroke\" stroke-width=\"2\" d=\"M9 9l3 3\"/>\n\t</symbol>\n\n\t<!-- FILE ICONS -->\n\t<symbol viewBox=\"0 0 16 16\" id=\"de-symbol-file-del\">\n\t\t<path fill=\"url(#de-file-del-gradient)\" stroke=\"#ca2900\" d=\"M4 1.3l4 4 4-4L14.8 4l-4 4 4 4-2.8 2.8-4-4-4 4L1.3 12l4-4-4-4L4 1.3z\"/>\n\t</symbol>\n\t<symbol viewBox=\"0 0 16 16\" width=\"16\" height=\"16\" id=\"de-symbol-file-rar\">\n\t\t<path stroke=\"#07ac07\" stroke-width=\"2\" d=\"M3 13h13\"/>\n\t\t<path stroke=\"#03043f\" stroke-width=\"4\" d=\"M3 10h13\"/>\n\t\t<path stroke=\"#cc5dc1\" stroke-width=\"2\" d=\"M3 7h13\"/>\n\t\t<path fill=\"#ccd0db\" d=\"M3 14l-3-3V3l3 3v8z\"/>\n\t\t<path fill=\"#666\" d=\"M3 5L0 2v1l3 3V5zm0 3L0 5v1l3 3V8zm0 3L0 8v1l3 3v-1zm0 3l-3-3v1l3 3v-1z\"/>\n\t\t<path stroke=\"#103cef\" stroke-width=\"2\" d=\"M3 10h13\"/>\n\t\t<path stroke=\"#294f1d\" d=\"M3 14.5h13\"/>\n\t\t<path fill=\"#994a95\" d=\"M13 2H0l3 3h13l-3-3z\"/>\n\t\t<path stroke=\"#7C467a\" d=\"M3 5.5h13\"/>\n\t\t<path stroke=\"#513400\" stroke-width=\"2\" d=\"M9.5 15V5\"/>\n\t\t<path fill=\"#513400\" d=\"M10.5 5l-3-3h-2l3 3h2z\"/>\n\t\t<path stroke=\"#ceab00\" stroke-width=\"4\" d=\"M7 10h5\"/>\n\t\t<path fill=\"none\" stroke=\"#222\" d=\"M8.5 9v1.5h2V9\"/>\n\t</symbol>\n\t<symbol viewBox=\"0 0 16 16\" id=\"de-symbol-file-ren\">\n\t\t<circle fill=\"#ffe888\" stroke=\"#333\" stroke-width=\".75\" cx=\"6\" cy=\"14\" r=\"1.5\"/>\n\t\t<circle fill=\"#ffe888\" stroke=\"#333\" stroke-width=\".75\" cx=\"10\" cy=\"14\" r=\"1.5\"/>\n\t\t<circle fill=\"#ffe888\" stroke=\"#333\" stroke-width=\".75\" cx=\"14\" cy=\"14\" r=\"1.5\"/>\n\t\t<path fill=\"#fcb45e\" stroke=\"#3a2200\" stroke-width=\".75\" d=\"M2 8L9.5.5l1.8 1.8-7.5 7.5L2 8z\"/>\n\t\t<path fill=\"#ff8a33\" stroke=\"#3a2200\" stroke-width=\".75\" d=\"M3.8 9.8l7.5-7.5L13 4l-7.5 7.5-1.7-1.7z\"/>\n\t\t<path fill=\"#ffe888\" stroke=\"#333\" stroke-width=\".75\" d=\"M2 8l-.5.5L1 9v3.5h3.5l1-1-1.7-1.7L2 8z\"/>\n\t\t<path stroke=\"#333\" d=\"M1 12.5L2.5 11\"/>\n\t</symbol>\n\t<symbol viewBox=\"0 0 16 16\" id=\"de-symbol-file-txt\">\n\t\t<circle fill=\"#2cabe1\" cx=\"8\" cy=\"8\" r=\"7.5\"/>\n\t\t<line stroke=\"#fff\" stroke-width=\"2\" x1=\"8\" y1=\"3\" x2=\"8\" y2=\"13\"/>\n\t\t<line stroke=\"#fff\" stroke-width=\"2\" x1=\"3\" y1=\"8\" x2=\"13\" y2=\"8\"/>\n\t</symbol>\n\n\t<!-- WINDOW ICONS -->\n\t<symbol viewBox=\"0 0 16 16\" id=\"de-symbol-win-arrow\">\n\t\t<path class=\"de-svg-stroke\" stroke-width=\"3.5\" d=\"M8 13V6\"/>\n\t\t<path class=\"de-svg-fill\" d=\"M3.5 7h9L8 2.5 3.5 7z\"/>\n\t</symbol>\n\t<symbol viewBox=\"0 0 16 16\" id=\"de-symbol-win-close\">\n\t\t<path class=\"de-svg-stroke\" stroke-width=\"2.5\" d=\"M3.5 3.5l9 9m-9 0l9-9\"/>\n\t</symbol>\n\n\t<!-- THREAD NAVIGATION ICONS -->\n\t<symbol viewBox=\"0 0 7 7\" id=\"de-symbol-thr-nav-arrow\">\n\t\t<path class=\"de-svg-fill\" d=\"M6 3.5L2 0v7z\"/>\n\t</symbol>\n\t<symbol viewBox=\"0 0 24 24\" id=\"de-symbol-thr-nav-up\">\n\t\t<path class=\"de-svg-stroke\" stroke-width=\"3\" d=\"M3 22.5l9-9 9 9M3 13.5l9-9 9 9\"/>\n\t</symbol>\n\t<symbol viewBox=\"0 0 24 24\" id=\"de-symbol-thr-nav-down\">\n\t\t<path class=\"de-svg-stroke\" stroke-width=\"3\" d=\"M3 11.5l9 9 9-9M3 2.5l9 9 9-9\"/>\n\t</symbol>\n\n\t<!-- IMAGE BUTTON ICONS -->\n\t<symbol viewBox=\"0 0 32 32\" id=\"de-symbol-img-btn-arrow\">\n\t\t<path class=\"de-svg-stroke\" stroke-width=\"8\" d=\"M0 16h20\"/>\n\t\t<path class=\"de-svg-stroke\" stroke-width=\"9\" d=\"M13 3l16 16M13 29l16-16\"/>\n\t</symbol>\n\t<symbol viewBox=\"0 0 32 32\" id=\"de-symbol-img-btn-auto\">\n\t\t<path class=\"de-svg-fill\" d=\"M13.2 26.6c-3.1 2.4-5.9.5-5.9-3.3V8.7c0-3.8 2.8-5.6 6.1-3.3l12.5 7.1c3.1 1.9 3.1 5.2 0 7.1 0-.1-12.7 7-12.7 7z\"/>\n\t</symbol>\n\t<symbol viewBox=\"0 0 32 32\" id=\"de-symbol-img-btn-rotate\">\n\t\t<path class=\"de-svg-stroke\" stroke-width=\"7\" d=\"M16 4c6.6 0 12 5.4 12 12s-5.4 12-12 12S4 22.6 4 16\"/>\n\t\t<path class=\"de-svg-fill\" d=\"M13.5 19.2L0 27V11.4z\"/>\n\t</symbol>\n\n\t<!-- MAIN PANEL -->\n\t<symbol viewBox=\"0 0 25 25\" id=\"de-symbol-panel-logo\">\n\t\t<path class=\"de-svg-fill\" d=\"M22 5h-10v16h4v-14h6z\"/>\n\t\t<path class=\"de-svg-stroke\" stroke-width=\"3\" d=\"M22 20.5H12c-2.8 0-5.7 0-5.7-4s2.8-4 5.7-4H21\"/>\n\t</symbol>\n\t<symbol viewBox=\"0 0 25 25\" id=\"de-symbol-panel-cfg\">\n\t\t<circle class=\"de-svg-stroke\" stroke-width=\"3\" cx=\"12.5\" cy=\"12.5\" r=\"6\"/>\n\t\t<path class=\"de-svg-stroke\" stroke-width=\"3\" d=\"M12.5 6.5v-3M18.5 12.5h3M12.5 18.5v3M6.5 12.5h-3M16.7 8.3L19 6M16.7 16.7L19 19M8.3 16.7L6 19M8.3 8.3L6 6\"/>\n\t</symbol>\n\t<symbol viewBox=\"0 0 25 25\" id=\"de-symbol-panel-hid\">\n\t\t<path class=\"de-svg-stroke\" stroke-width=\"4\" d=\"M6 19L19 6M6 6l13 13\"/>\n\t</symbol>\n\t<symbol viewBox=\"0 0 25 25\" id=\"de-symbol-panel-fav\">\n\t\t<path class=\"de-svg-fill\" d=\"M12.5 3.5l2.5 6 6.5.5-5 4.2 2 6.8-6-4-6 4 2-6.8-5-4.2 6.5-.5 2.5-6z\"/>\n\t</symbol>\n\t<symbol viewBox=\"0 0 25 25\" id=\"de-symbol-panel-vid\">\n\t\t<path class=\"de-svg-fill\" d=\"M12.5 4a8.5 8.5 0 1 0 0 17 8.5 8.5 0 0 0 0-17zm-1 13c-1.3 1-2.5.2-2.5-1.4V9.4C9 7.8 10.2 7 11.6 8l5.3 3c1.3.8 1.3 2.2 0 3l-5.4 3z\"/>\n\t</symbol>\n\t<symbol viewBox=\"0 0 25 25\" id=\"de-symbol-panel-refresh\">\n\t\t<path class=\"de-svg-fill\" d=\"M14 4v4.3a4.5 4.5 0 1 1-3 0V4a8.5 8.5 0 1 0 3 0z\"/>\n\t\t<path class=\"de-svg-fill\" d=\"M13 11V4h7\"/>\n\t</symbol>\n\t<symbol viewBox=\"0 0 25 25\" id=\"de-symbol-panel-arrow\">\n\t\t<path class=\"de-svg-stroke\" stroke-width=\"5\" d=\"M4 12.5h12\"/>\n\t\t<path class=\"de-svg-fill\" d=\"M14 19V6l7 6.5\"/>\n\t</symbol>\n\t<symbol viewBox=\"0 0 25 25\" id=\"de-symbol-panel-expimg\">\n\t\t<path class=\"de-svg-stroke\" stroke-width=\"2\" d=\"M20 18c0 1-1 2-2 2H7c-1 0-2-1-2-2V7c0-1 1-2 2-2h11c1 0 2 1 2 2v11z\"/>\n\t\t<path stroke-width=\"3\" d=\"M8 12.5h9\"/>\n\t\t<path d=\"M10 8v9l-5-4.5M15 17V8l5 4.5\"/>\n\t</symbol>\n\t<symbol viewBox=\"0 0 25 25\" id=\"de-symbol-panel-maskimg\">\n\t\t<path class=\"de-svg-stroke\" stroke-width=\"2\" d=\"M20 18c0 1-1 2-2 2H7c-1 0-2-1-2-2V7c0-1 1-2 2-2h11c1 0 2 1 2 2v11z\"/>\n\t\t<path d=\"M5 20L20 5M5 15.5L15.5 5M5 11l6-6M20 9.5L9.5 20M20 14l-6 6\"/>\n\t</symbol>\n\t<symbol viewBox=\"0 0 25 25\" id=\"de-symbol-panel-preimg\">\n\t\t<path class=\"de-svg-stroke\" stroke-width=\"2\" d=\"M20 18c0 1-1 2-2 2H7c-1 0-2-1-2-2V7c0-1 1-2 2-2h11c1 0 2 1 2 2v11z\"/>\n\t\t<path stroke-width=\"3\" d=\"M12.5 17V9\"/>\n\t\t<path d=\"M8 15h9l-4.5 5\"/>\n\t</symbol>\n\t<symbol viewBox=\"0 0 25 25\" id=\"de-symbol-panel-savethr\">\n\t\t<path class=\"de-svg-fill\" d=\"M18 4h-1v6H8V4H6C5 4 4 5 4 6v13c0 1 1 2 2 2h13c1 0 2-1 2-2V7l-3-3zM6 20v-8h13v8H6z\"/>\n\t\t<path class=\"de-svg-stroke\" stroke-width=\"3\" d=\"M13.5 9V4\"/>\n\t</symbol>\n\t<symbol viewBox=\"0 0 25 25\" id=\"de-symbol-panel-upd\">\n\t\t<circle cx=\"12.5\" cy=\"10.8\" r=\"4\"/>\n\t\t<path class=\"de-svg-stroke\" stroke-width=\"2\" stroke-linejoin=\"round\" d=\"M4.5 12q8-10,16 0q-8 10,-16 0z\"/>\n\t\t<path class=\"de-svg-stroke\" d=\"M11 7L9.8 5M14 7l1.2-2M11 17l-1.2 2m4.2-2l1.2 2M7 8.5L5.3 6.8M7 15.5l-1.7 1.7M18 8.5l1.7-1.7M18 15.5l1.7 1.7\"/>\n\t</symbol>\n\t<symbol viewBox=\"0 0 25 25\" id=\"de-symbol-panel-audio-off\">\n\t\t<path class=\"de-svg-fill\" d=\"M13 21V4L8 9H4v7h4l5 5z\"/>\n\t\t<path class=\"de-svg-stroke\" stroke-width=\"2\" d=\"M15 9.5l6 6m0-6l-6 6\"/>\n\t</symbol>\n\t<symbol viewBox=\"0 0 25 25\" id=\"de-symbol-panel-audio-on\">\n\t\t<path class=\"de-svg-fill\" d=\"M13 21V4L8 9H4v7h4z\"/>\n\t\t<path class=\"de-svg-stroke\" stroke-width=\"2\" d=\"M15.5 7.5c1.7 3.3 1.7 6.7 0 10m3-12.5c3 5 3 10 0 15\"/>\n\t</symbol>\n\t<symbol viewBox=\"0 0 25 25\" id=\"de-symbol-panel-catalog\">\n\t\t<path class=\"de-svg-fill\" d=\"M5 5h3v3H5zm12 0h3v3h-3zm-4 0h3v3h-3zM9 5h3v3H9zM5 9h3v3H5zm12 0h3v3h-3zm-4 0h3v3h-3zM9 9h3v3H9zm-4 4h3v3H5zm12 0h3v3h-3zm-4 0h3v3h-3zm-4 0h3v3H9zm-4 4h3v3H5zm12 0h3v3h-3zm-4 0h3v3h-3zm-4 0h3v3H9z\"/>\n\t</symbol>\n\t<symbol viewBox=\"0 0 25 25\" id=\"de-symbol-panel-enable\">\n\t\t<path class=\"de-svg-stroke\" stroke-width=\"3\" d=\"M12.5 4v8\"/>\n\t\t<path class=\"de-svg-fill\" d=\"M16 4.8v4a5 5 0 0 1-3.5 8.7A5 5 0 0 1 9 9V4.7a8.5 8.5 0 1 0 7 0z\"/>\n\t</symbol>\n\n\t<!-- MARKUP BUTTONS -->\n\t<symbol viewBox=\"0 0 23 22\" id=\"de-symbol-markup-back\">\n\t\t<path class=\"de-markup-back\" stroke-width=\"2\" d=\"M6 1q-5 0,-5 5v10q0 5,5 5h11q5 0,5 -5v-10q0 -5,-5-5z\"/>\n\t</symbol>\n\t<symbol viewBox=\"0 0 23 22\" id=\"de-symbol-markup-bold\">\n\t\t<use xlink:href=\"#de-symbol-markup-back\"/>\n\t\t<text x=\"5.5\" y=\"17\" style=\"font-family: sans-serif; font-size: 17px; font-weight: 800;\">B</text>\n\t</symbol>\n\t<symbol viewBox=\"0 0 23 22\" id=\"de-symbol-markup-italic\">\n\t\t<use xlink:href=\"#de-symbol-markup-back\"/>\n\t\t<text x=\"8\" y=\"17\" style=\"font-family: sans-serif; font-size: 17px; font-weight: 600; font-style: italic;\">i</text>\n\t</symbol>\n\t<symbol viewBox=\"0 0 23 22\" id=\"de-symbol-markup-under\">\n\t\t<use xlink:href=\"#de-symbol-markup-back\"/>\n\t\t<text x=\"6\" y=\"15\" width=\"20\" style=\"font-family: sans-serif; font-size: 17px; font-weight: 600;\">u</text>\n\t\t<path stroke=\"#444\" stroke-width=\"1.5\" d=\"M6 17H17.5\"/>\n\t</symbol>\n\t<symbol viewBox=\"0 0 23 22\" id=\"de-symbol-markup-strike\">\n\t\t<use xlink:href=\"#de-symbol-markup-back\"/>\n\t\t<text x=\"4\" y=\"17\" style=\"font-family: sans-serif; font-size: 22px; font-weight: 600; font-style: italic;\">s</text>\n\t\t<path stroke=\"#444\" d=\"M4 11H19\"/>\n\t</symbol>\n\t<symbol viewBox=\"0 0 23 22\" id=\"de-symbol-markup-spoil\">\n\t\t<use xlink:href=\"#de-symbol-markup-back\"/>\n\t\t<path stroke=\"#666\" stroke-width=\"10\" d=\"M4 11H19\"/>\n\t</symbol>\n\t<symbol viewBox=\"0 0 23 22\" id=\"de-symbol-markup-code\">\n\t\t<use xlink:href=\"#de-symbol-markup-back\"/>\n\t\t<text x=\"5\" y=\"17\" style=\"font-family: 'Lucida Console', monospace; font-size: 18px; font-weight: 600;\">C</text>\n\t</symbol>\n\t<symbol viewBox=\"0 0 23 22\" id=\"de-symbol-markup-sup\">\n\t\t<use xlink:href=\"#de-symbol-markup-back\"/>\n\t\t<text x=\"4\" y=\"15\" style=\"font-family: sans-serif; font-size: 16px; font-weight: 600;\">x</text>\n\t\t<text x=\"14\" y=\"10\" style=\"font-family: sans-serif; font-size: 8px; font-weight: 600;\">2</text>\n\t</symbol>\n\t<symbol viewBox=\"0 0 23 22\" id=\"de-symbol-markup-sub\">\n\t\t<use xlink:href=\"#de-symbol-markup-back\"/>\n\t\t<text x=\"4\" y=\"15\" style=\"font-family: sans-serif; font-size: 16px; font-weight: 600;\">x</text>\n\t\t<text x=\"14\" y=\"17\" style=\"font-family: sans-serif; font-size: 8px; font-weight: 600;\">2</text>\n\t</symbol>\n\t<symbol viewBox=\"0 0 23 22\" id=\"de-symbol-markup-quote\">\n\t\t<use xlink:href=\"#de-symbol-markup-back\"/>\n\t\t<text x=\"6\" y=\"18\" style=\"font-family: sans-serif; font-size: 20px; font-weight: 600;\">></text>\n\t</symbol>\n\n\t<!-- OTHER -->\n\t<symbol viewBox=\"0 0 16 16\" id=\"de-symbol-wait\">\n\t\t<circle fill=\"#929087\" cx=\"8\" cy=\"2\" r=\"2\"/>\n\t\t<circle fill=\"#C5C2BA\" cx=\"8\" cy=\"14\" r=\"2\"/>\n\t\t<circle fill=\"#ACAAA0\" cx=\"2\" cy=\"8\" r=\"2\"/>\n\t\t<circle fill=\"#79766C\" cx=\"14\" cy=\"8\" r=\"2\"/>\n\t\t<circle fill=\"#D2CFC6\" cx=\"12.25\" cy=\"12.25\" r=\"2\"/>\n\t\t<circle fill=\"#9F9C93\" cx=\"3.75\" cy=\"3.75\" r=\"2\"/>\n\t\t<circle fill=\"#B9B6AE\" cx=\"3.75\" cy=\"12.25\" r=\"2\"/>\n\t\t<circle fill=\"#868379\" cx=\"12.25\" cy=\"3.75\" r=\"2\"/>\n\t</symbol>\n\t<symbol viewBox=\"0 0 16 16\" id=\"de-symbol-closed\">\n\t\t<image display=\"inline\" width=\"16\" height=\"16\" xlink:href=\"data:image/gif;base64,R0lGODlhEAAQAKIAAP3rqPPOd+y6V+WmN+Dg4M7OzmZmZv///yH5BAEAAAcALAAAAAAQABAAAANCeLrWvZARUqqJkjiLj9FMcWHf6IldGZqM4zqRAcw0zXpAoO/6LfeNnS8XcAhjAIHSoFwim0wockCtUodWq+/1UiQAADs=\"/>\n\t</symbol>\n\t<symbol viewBox=\"0 0 16 16\" id=\"de-symbol-unavail\">\n\t\t<circle class=\"de-svg-stroke\" fill=\"none\" stroke-width=\"2\" cx=\"8\" cy=\"8\" r=\"5\"/>\n\t\t<path class=\"de-svg-stroke\" stroke-width=\"2\" d=\"M4 4l8 8\"/>\n\t</symbol>\n\t</svg>\n\t</div>"); } function scriptCSS() { var contentIcon = function contentIcon(id, src) { return "".concat(id, "::before { content: \"\"; display: inline-block; vertical-align: -3px; padding: 16px 16px 0 0; margin-right: 4px; background: url(").concat(src, ") no-repeat center; background-size: contain; white-space: initial; }"); }; var x = "\n\t/* Main panel */\n\t#de-panel { position: fixed; right: 0; bottom: 0; z-index: 9999; border-radius: 15px 0 0 0; cursor: default; display: flex; min-height: 25px; color: #F5F5F5; }\n\t#de-panel-logo { flex: none; margin: auto 3px auto 0; cursor: pointer; }\n\t#de-panel-buttons { flex: 0 1 auto; display: flex; flex-flow: row wrap; align-items: center; padding: 0 0 0 2px; margin: 0; border-left: 1px solid #616b86; }\n\t.de-panel-button { display: block; flex: none; margin: 0 1px; padding: 0 !important; min-width: auto; transition: all .3s ease; border: none !important; background-color: transparent !important; color: inherit !important; cursor: pointer; }\n\t.de-panel-button, #de-panel-logo, #de-panel-logo-svg, .de-panel-svg { width: 25px; height: 25px; }\n\t.de-panel-button-active { stroke: #32ff32 !important; fill: #32ff32 !important; }\n\t#de-panel-expimg, #de-panel-maskimg, #de-panel-preimg { stroke: currentColor; fill: currentColor; }\n\t#de-panel-goback { transform: rotate(180deg); will-change: transform; }\n\t#de-panel-godown { transform: rotate(90deg); will-change: transform; }\n\t#de-panel-goup { transform: rotate(-90deg); will-change: transform; }\n\t#de-panel-upd-on { fill: #32ff32; }\n\t#de-panel-upd-warn { fill: #fff441; }\n\t#de-panel-upd-off { fill: #ff3232; }\n\t#de-panel-audio-on > .de-panel-svg > .de-use-audio-off, #de-panel-audio-off > .de-panel-svg > .de-use-audio-on { display: none; }\n\t#de-panel-info { display: flex; flex: none; margin-left: 2px; font: 18px arial; }\n\t#de-panel-info > span { background-color: #fff2; margin-right: 4px; padding: 0 1px; border: 1px solid #fff3; border-radius: 4px; }\n\t#de-panel-info > span:empty { display: none; }\n\t#de-svg-icons, #de-svg-icons > svg { height: 0; width: 0; position: fixed; }\n\t.de-svg-fill { stroke: none; fill: currentColor; }\n\t.de-svg-stroke { stroke: currentColor; fill: none; }\n\tuse { fill: inherit; pointer-events: none; }\n\n\t/* Panel theme */\n\t.de-img-btn, #de-panel, .de-win-head ".concat([ '{ background: linear-gradient(to bottom, #7b849b, #616b86 8%, #121212 60%, #1f2740 100%); }', "{ background: linear-gradient(to bottom, #4b90df, #183d77 60%, #325f9e 100%); }\n\t\t#de-panel-buttons { border-color: #8fbbed; }", "{ background-color: #777; }\n\t\t#de-panel-buttons { border-color: #ccc; }", '{ background-color: rgba(0,20,80,.72); }', "{ background: none; background-color: #333; border-radius: 0 !important; }\n\t\t#de-win-reply.de-win { border-radius: 0 !important; }\n\t\t#de-panel-buttons { border-color: #666; }", "{ background: linear-gradient(to bottom, #e854ca, #8c1273 60%, #832da2 100%); }\n\t\t#de-panel-buttons { border-color: #c15dad; }"][Cfg.scriptStyle], "\n\t.de-logo { background: linear-gradient(to bottom, #7b849b, #616b86 8%, #121212 60%, #1f2740 100%) }\n\t.de-panel-svg:hover, #de-panel-logo-svg:hover { margin: -2px; width: 29px; height: 29px; color: #d0e7ff !important; }\n\t.de-panel-button:hover { background-color: rgba(255,255,255,.15) !important; box-shadow: 0 0 3px rgba(200,200,200,0.5); color: inherit !important; }\r\n"); if (Cfg.disabled) { $css(x).id = 'de-css'; return; } x += "\n\t/* Windows */\n\t.de-win .de-win-btn-toggle { transform: rotate(180deg); }\n\t.de-resizer { position: absolute; }\n\t.de-resizer-bottom { height: 6px; bottom: -3px; left: 0; right: 0; cursor: ns-resize; }\n\t.de-resizer-left { width: 6px; top: 0px; bottom: 0px; left: -3px; cursor: ew-resize; }\n\t.de-resizer-right { width: 6px; top: 0px; bottom: 0px; right: -3px; cursor: ew-resize; }\n\t.de-resizer-top { height: 6px; top: -3px; left: 0; right: 0; cursor: ns-resize; }\n\t.de-win > .de-win-head { cursor: move; }\n\t.de-win-buttons { margin: 0 2px 0 0; font-size: 0; white-space: nowrap; cursor: pointer; }\n\t.de-win-buttons > svg { transition: background .3s ease, box-shadow .3s ease; }\n\t.de-win-buttons > svg:hover { background-color: rgba(255,255,255,.2); box-shadow: 0 0 2px rgba(255,255,255,.4); color: #d0e7ff; }\n\t.de-win-inpost > .de-win-head > .de-win-buttons > svg:hover { background-color: rgba(64,64,64,.15); box-shadow: 0 0 2px rgba(64,64,64,.3); color: inherit; }\n\t#de-win-cfg { width: 355px; }\n\t#de-win-cfg, #de-win-fav, #de-win-hid, #de-win-vid { position: fixed; max-width: calc(100vw - (100vw - 100%)); max-height: calc(100vh - 25px); overflow-x: hidden; overflow-y: auto; }\n\t#de-win-cfg > .de-win-body { float: none; display: block; width: auto; min-width: 0; max-width: 100% !important; padding: 0 !important; margin: 0 !important; border: none; }\n\t#de-win-fav > .de-win-body, #de-win-hid > .de-win-body, #de-win-vid > .de-win-body { padding: 6px; border: 1px solid gray; }\n\t#de-win-hid { max-width: 60%; }\n\t.de-win-title { width: 100%; }\n\t#de-win-vid > .de-win-body { display: flex; flex-direction: column; align-items: center; }\n\t#de-win-vid .de-entry { white-space: normal; }\n\t.de-win-head { display: flex; height: 16px; padding: 2px; border-radius: 10px 10px 0 0; color: #F5F5F5; font: bold 14px/16px arial; text-align: center; cursor: default; }\n\n\t/* Settings window */\n\t.de-block { display: block; }\n\t#de-btn-spell-add { margin-left: auto; }\n\t#de-cfg-bar { display: flex; margin: 0; padding: 0; }\n\t.de-cfg-body { min-height: 355px; padding: 9px 7px 7px; margin-top: -1px; font: 13px/15px arial !important; -moz-box-sizing: content-box; box-sizing: content-box; }\n\t.de-cfg-body, #de-cfg-buttons { border: 1px solid #183d77; border-top: none; }\n\t.de-cfg-button { padding: 0 ".concat(nav.isFirefox ? '2' : '4', "px !important; margin: 0 4px; height: 21px; font: 12px arial !important; }\n\t#de-cfg-button-debug { padding: 0 2px; font: 13px/15px arial; }\n\t#de-cfg-buttons { display: flex; align-items: center; padding: 3px; }\n\t#de-cfg-buttons > label { flex: 1 0 auto; }\n\t.de-cfg-chkbox { ").concat(nav.isPresto ? '' : 'vertical-align: -1px !important; ', "margin: 2px 1px !important; }\n\t#de-cfg-info { display: flex; flex-direction: column; }\n\tinput[type=\"text\"].de-cfg-inptxt { width: auto; height: auto; min-height: 0; padding: 0 2px !important; margin: 1px 4px 1px 0 !important; font: 13px arial !important; border-width: 1px; }\n\t.de-cfg-inptxt, .de-cfg-label, .de-cfg-select { display: inline-block; width: auto; height: 19px !important; font: 13px/15px arial !important; }\n\t.de-cfg-label { padding: 0; margin: 0; }\n\t.de-cfg-needreload::after { content: \"* \"; color: red; }\n\t.de-cfg-select { padding: 0 2px; margin: 1px 0; font: 13px arial !important; float: none; appearance: auto; }\n\t.de-cfg-tab { flex: 1 0 auto; display: block !important; margin: 0 !important; float: none !important; width: auto !important; min-width: 0 !important; padding: 4px 0 !important; box-shadow: none !important; border: 1px solid #444 !important; border-radius: 4px 4px 0 0 !important; opacity: 1; font: bold 12px arial; text-align: center; cursor: default; background-image: linear-gradient(to bottom, rgba(132,132,132,.35) 0%, rgba(79,79,79,.35) 50%, rgba(40,40,40,.35) 50%, rgba(80,80,80,.35) 100%) !important; }\n\t.de-cfg-tab:hover { background-image: linear-gradient(to top, rgba(132,132,132,.35) 0%, rgba(79,79,79,.35) 50%, rgba(40,40,40,.35) 50%, rgba(80,80,80,.35) 100%) !important; }\n\t.de-cfg-tab[selected], .de-cfg-tab[selected]:hover { background-image: none !important; border-bottom: none !important; }\n\t.de-cfg-tab::").concat(nav.isFirefox ? '-moz-' : '', "selection { background: transparent; }\n\t.de-cfg-unvis { display: none !important; }\n\t.de-depend { padding-left: 17px; }\n\t#de-info-log, #de-info-stats { width: 100%; padding: 0px 7px; }\n\t#de-info-log { overflow-y: auto; border-left: 1px solid grey; }\n\t.de-info-name { flex: 1 0 auto; }\n\t.de-info-row { display: flex; }\n\t#de-info-table { display: flex; flex: 1 0 auto; }\n\t.de-spell-btn { padding: 0 4px; }\n\t#de-spell-editor { display: flex; align-items: stretch; height: 256px; padding: 2px 0; }\n\t#de-spell-panel { display: flex; }\n\t#de-spell-txt { padding: 2px !important; margin: 0; width: 100%; min-width: 0; border: none !important; outline: none !important; font: 12px courier new; ").concat(nav.isPresto ? '' : 'resize: none !important; ', "}\n\t#de-spell-rowmeter { padding: 2px 3px 0 0; overflow: hidden; min-width: 2em; background-color: #616b86; text-align: right; color: #fff; font: 12px courier new; }\n\t#de-win-cfg.de-win-fixed { z-index: 10001 !important; }\n\n\t/* Settings window theme */\n\t").concat(["#de-cfg-bar { background-color: #1f2740; }\n\t\t.de-cfg-tab { border-color: #121421 !important; }", "#de-cfg-bar { background-color: #325f9e; }\n\t\t.de-cfg-tab { border-color: #183d77 !important; }", "#de-cfg-bar, #de-spell-rowmeter { background-color: #777; }\n\t\t.de-cfg-body, #de-cfg-buttons { border-color: #444; }", "#de-cfg-bar { background-color: rgba(0,20,80,.72); }\n\t\t.de-cfg-tab { border-color: #001450 !important; }", "#de-cfg-bar { background-color: #222; }\n\t\t.de-cfg-body, #de-cfg-buttons, { border-color: #666; }\n\t\t#de-spell-rowmeter { background-color: #555; }", "#de-cfg-bar { background-color: #832da2; }\n\t\t.de-cfg-body, #de-cfg-buttons { border-color: #c125a1 !important; }\n\t\t.de-cfg-tab { border-color: #832da2 !important; }\n\t\t#de-spell-rowmeter { background-color: #844b83; }"][Cfg.scriptStyle], "\n\n\t/* Favorites window */\n\t.de-entry { display: flex !important; align-items: center; float: none !important; padding: 0 !important; margin: 1px 0 !important; min-width: 0 !important; border: none !important; font-size: 13px; overflow: hidden !important; white-space: nowrap; }\n\t.de-entry-title { flex: auto; padding-left: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n\t#de-fav-buttons, #de-hid-buttons, #de-fav-del-confirm { padding-top: 6px; }\n\t.de-fav-entries { border-top: 1px solid rgba(80,80,80,.3); }\n\t.de-fav-entries-hide, .de-fav-inf-icon:not(.de-fav-closed):not(.de-fav-unavail):not(.de-fav-wait), .de-fav-closed > .de-fav-unavail-use, .de-fav-closed > .de-fav-wait-use, .de-fav-unavail > .de-fav-closed-use, .de-fav-unavail > .de-fav-wait-use, .de-fav-wait > .de-fav-closed-use, .de-fav-wait > .de-fav-unavail-use { display: none; }\n\t.de-fav-del-btn { margin-left: 2px; cursor: pointer; }\n\t.de-fav-del-btn > svg { width: 12px; height: 12px; opacity: 0.65; vertical-align: -2px; }\n\t.de-fav-del-btn[de-checked] > svg { color: red; background-color: rgba(255,0,0,.2); border-radius: 7px; opacity: 1; }\n\t.de-fav-header { display: flex; cursor: pointer; font-size: 13px; }\n\t.de-fav-header-btn { flex: 1 0 auto; margin-right: 2px; font-size: 11px; color: inherit; text-align: right; opacity: 0.65; }\n\t.de-fav-header-link { margin-left: 2px; color: inherit; font-weight: bold; text-decoration: none; outline: none; }\n\t.de-fav-inf { flex: none; padding: 0 4px 0 10px; font: bold 14px serif; cursor: default; }\n\t.de-fav-inf-icon, .de-fav-inf-iwrap { width: 16px; height: 16px; }\n\t.de-fav-inf-icon { margin-bottom: -3px; }\n\t.de-fav-inf-new { color: #424f79; }\n\t.de-fav-inf-new::after { content: \" +\"; }\n\t.de-fav-inf-total { color: #4f7942; }\n\t.de-fav-inf-you { padding: 0 4px; margin-right: 4px; border-radius: 3px; color: #fff; background-color: #424f79; opacity: 0.65; }\n\t.de-fav-link { flex: none; margin-left: 2px; text-decoration: none; border: none; }\n\t.de-fav-table { overflow-x: hidden; overflow-y: auto; max-height: calc(100vh - 91px); }\n\t.de-fav-table-unfold > .de-fold-block > .de-fav-entries { display: initial !important; }\n\t.de-fav-unavail { color: #cf4436; }\n\t.de-fold-block { border: 1px solid rgba(120,120,120,.8); border-radius: 2px; }\n\t.de-fold-block:not(:first-child) { border-top: none; }\n\n\t/* Post panel */\n\t.de-btn-hide > .de-btn-unhide-use, .de-btn-hide-user > .de-btn-unhide-use, .de-btn-unhide > .de-btn-hide-use, .de-btn-unhide-user > .de-btn-hide-use { display: none; }\n\t.de-btn-expthr, .de-btn-fav, .de-btn-fav-sel, .de-btn-hide, .de-btn-hide-user, .de-btn-img, .de-btn-reply, .de-btn-sage, .de-btn-stick, .de-btn-stick-on, .de-btn-unhide, .de-btn-unhide-user, .de-win-btn-clear, .de-win-btn-close, .de-win-btn-toggle { margin: 0 2px 0 0 !important; cursor: pointer; width: 16px; height: 16px; vertical-align: -3px; }").concat(!postform.form && !postform.oeForm ? '.de-btn-reply { display: none; }' : '', "\n\t.de-btn-img { vertical-align: top; }\n\t.de-post-btns { margin-left: 4px; }\n\t.de-post-btns-back { fill: inherit; stroke: none; }\n\t.de-post-note:not(:empty) { color: inherit; margin: 0 4px; vertical-align: 1px; font: italic bold 12px serif; }\n\t.de-thread-note { font-style: italic; }\n\n\t/* Sauce buttons */\n\t").concat(contentIcon('.de-src-google', 'data:image/gif;base64,R0lGODlhEAAQAMQAAIy0+tHh/gJc8Qlh8UyM9H2r9/3///7//x+OfACSJy+mTZHQos3Te////f///v3HAP+uAPzWjvWTWeUTAPSdl/79/f////39/f///wAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAABgALAAAAAAQABAAAAVuICaKh2Eax6hih+W+bqoaLjXdE+UaY2vhwInrInLhdBYbDEOL3GBQS4X2gEiiUBoEAhMIBl6CpaHlvrxocaO1XUQBgsLYxUgkot7AGONS2N0WCwgCYhZFfXaJCQguDiMvC34JCoCOKlgvK49QKyEAOw=='), "\n\t").concat(contentIcon('.de-src-yandex', 'data:image/gif;base64,R0lGODlhEAAQAMQAAP////v7+/r5+fb29vHx8eLi4tnZ2dTU1NDQ0MvLy8fHx8TExPzJv/immvlXRvq0re4UEdeGhtbFxcnJyby8vKampm5ubv///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAABcALAAAAAAQABAAAAVx4CWOZCkOQKqq5uoCQhnMQuPcc2CQuc3YuQBJQHQ8BA8HkUgYDZ6Qx+ABeVoVIoL2RmhAtODmpUD23iDkdEFkaBsiEAfE3a6IDngJJALH4ycjCIJyCXCCgiQJhXuLigl2IwqSk5QUJRQLmZqaFiaeniEAOw=='), "\n\t").concat(contentIcon('.de-src-tineye', 'data:image/gif;base64,R0lGODlhEAAQAMQAAP///wAAAAwOEhg4UDZ7skGNxkuf3Vycxx4nLerw9DlSX2FnanO21Epxg4LO62KOnpXj+ZGcmb7CvbZ6RfxmAIxBCzsGAP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAABcALAAAAAAQABAAAAWlYGIUZGGc6HgkxzSRozIgdHMUx0NR5hH8v8VjeFsoDAyFpcKcQByMnIGgYDAikmxkOLQWqNAGQhAQLBC/BgSXC0QivwgAgFbjHLQ5XDKXBBRrBA80WAABRgkJPwxfDw2HCYYBfHABDSQMDgoIEgs/ZgoPDmuYEFEHmQ6jT5ckBKirEE8HCgEWJQe5ZwJjQBYRBwQMsk8RFgJkP04sVrHGNAEVEAAhADs='), "\n\t").concat(contentIcon('.de-src-saucenao', 'data:image/gif;base64,R0lGODlhEAAQAIAAAP///wAAACwAAAAAEAAQAAACJ4yPacDtvpQCkU1KT0P75i49mbSAZACd6HN2pmbBI7pe9K1+4q5KBQA7'), "\n\t").concat(contentIcon('.de-src-iqdb', 'data:image/gif;base64,R0lGODlhEAAQAMQAAP//////AP8A//8AAAD//wD/AAAA/wAAANx/hV1ISW9YWvLOd/u0T+WlTNaqcKdtMv/r1mxML7OCVoxtUbmmlfPRuKKGeHpcTvK3nEEvKGpRTCcbGU48OYVua3tkYv///yH5BAEAAB8ALAAAAAAQABAAAAW4INV5ZDcmibM0iVJRnukpmnJJDdNwnDWSk4vCNMnpGJXfwqHReDQJTuTxmEhmqoTFEtRsNhltRTFZTBKUl2IzAmeE2csFA8kcKADLl5NgSDgaGRYAFVYQABkRgAxnGhcdEJEVhxYSDhwNEQkaEhSRGBgIGBUOGBwXERkcExyeFaGjr4E8qgcHDpKgkQpRGhwZYA4Vw6CvPBOpwD0ODlMSoxcJOQ8ZyhccBxkSkRRFDw4SD1/jF5MQIQA7'), "\n\t").concat(contentIcon('.de-src-tracemoe', 'data:image/gif;base64,R0lGODlhEAAPALMAAAAAAP///9fY18HBwTg4ODw1No6PjoFnZhoBAXNGRf/V1KmRkf///wAAAAAAAAAAACH5BAEAAAwALAAAAAAQAA8AAAQ5EMhJq7046w0I9hMhBAIoiSQ4BiS1tgQrg7EceIM8UDm7S4aBwRIcYgoFjmSxQHASCkWCc6gelJkIADs='), "\n\n\t/* Posts counter */\n\t.de-post-counter { margin: 0 4px 0 2px; vertical-align: 1px; font: bold 11px tahoma; color: #4f7942; cursor: default; }\n\t.de-post-counter-deleted { color: #727579; }\n\t.de-post-counter-you { vertical-align: 1px; font: bold 11px tahoma; color: #505a7a; cursor: default; }\n\n\t/* Text markup buttons */\n\t.de-markup-back { fill: #f0f0f0; stroke: #808080; }\n\t#de-txt-panel { display: block; font-weight: bold; white-space: nowrap; cursor: pointer; }\n\t#de-txt-panel > div { display: inline-block; }\n\t#de-txt-panel > div > button { margin-right: 2px; min-width: 23px; }\n\t#de-txt-panel > div > svg { width: 23px; height: 22px; margin: 0 1px; }\r\n"); if ('animation' in doc.body.style) { x += "\n\t\t/* Show/hide animation */\n\t\t@keyframes de-open { 0% { transform: translateY(-100%); } 100% { transform: translateY(0); } }\n\t\t@keyframes de-close { 0% { transform: translateY(0); } 100% { transform: translateY(-100%); } }\n\t\t@keyframes de-blink {\n\t\t\t0%, 100% { transform: translateX(0); }\n\t\t\t10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }\n\t\t\t20%, 40%, 60%, 80% { transform: translateX(10px); }\n\t\t}\n\t\t@keyframes de-post-open-tl { from { transform: translate(-50%,-50%) scale(0); opacity: 0; } }\n\t\t@keyframes de-post-open-bl { from { transform: translate(-50%,50%) scale(0); opacity: 0; } }\n\t\t@keyframes de-post-open-tr { from { transform: translate(50%,-50%) scale(0); opacity: 0; } }\n\t\t@keyframes de-post-open-br { from { transform: translate(50%,50%) scale(0); opacity: 0; } }\n\t\t@keyframes de-post-close-tl { to { transform: translate(-50%,-50%) scale(0); opacity: 0; } }\n\t\t@keyframes de-post-close-bl { to { transform: translate(-50%,50%) scale(0); opacity: 0; } }\n\t\t@keyframes de-post-close-tr { to { transform: translate(50%,-50%) scale(0); opacity: 0; } }\n\t\t@keyframes de-post-close-br { to { transform: translate(50%,50%) scale(0); opacity: 0; } }\n\t\t@keyframes de-post-new { from { transform: translate(0,-50%) scaleY(0); opacity: 0; } }\n\t\t@keyframes de-win-open { from { transform: translate(0,50%) scaleY(0); opacity: 0; } }\n\t\t@keyframes de-win-close { to { transform: translate(0,50%) scaleY(0); opacity: 0; } }\n\t\t.de-pview-anim { animation-duration: .2s; animation-timing-function: ease-in-out; animation-fill-mode: both; }\n\t\t.de-open { animation: de-open .15s ease-out both; }\n\t\t.de-close { animation: de-close .15s ease-in both; }\n\t\t.de-blink { animation: de-blink .7s ease-in-out both; }\n\t\t.de-post-new { animation: de-post-new .2s ease-out both; }\n\t\t.de-win-open { animation: de-win-open .2s ease-out backwards; }\n\t\t.de-win-close { animation: de-win-close .2s ease-in both; }\r\n"; } else { Cfg.animation = 0; } var p = Math.max(Cfg.minImgSize || 0, 50); x += "\n\t/* Full images */\n\t.de-img-embed, .de-fullimg { border: none; outline: none; cursor: pointer; image-orientation: from-image; }\n\t.de-img-embed { max-width: 200px; max-height: 200px; }\n\t.de-fullimg { display: block; }\n\t.de-fullimg, .de-fullimg-wrap-link { flex: 0 0 auto; transition: none !important; max-width: none; max-height: none; }\n\t.de-fullimg-after { clear: left; }\n\t.de-fullimg-center { position: fixed; margin: 0 !important; z-index: 9999; background-color: #ccc; border: 1px solid black !important; -moz-box-sizing: content-box; box-sizing: content-box; }\n\t.de-fullimg-info { position: absolute; bottom: -22px; left: 50%; padding: 1px 4px; transform: translateX(-50%); background-color: rgba(64,64,64,.8); white-space: nowrap; line-height: 17px; }\n\t.de-fullimg-info > .de-btn-img { color: #fff; }\n\t.de-fullimg-link { float: none !important; display: inline-block; font: bold 12px tahoma; color: #fff !important; text-decoration: none; outline: none; }\n\t.de-fullimg-link:hover { color: #fff !important; background: rgba(64,64,64,.6); }\n\t.de-fullimg-load { position: absolute; z-index: 2; width: 50px; height: 50px; top: 50%; left: 50%; margin: -25px; }\n\t.de-fullimg-rotated { transform-origin: top left; width: auto !important; max-width: none !important; }\n\t.de-fullimg-scale { color: #fff; font: bold 12px tahoma; cursor: default; }\n\t.de-fullimg-video-hack { ".concat(nav.isWebkit && nav.isMobile ? 'width: 30px; top: 0; right: 0; color: #fff; font-size: 2em;' : 'width: 100%;', " height: calc(100% - 40px); position: absolute; z-index: 1; cursor: pointer; }\n\t.de-fullimg-wrap { position: relative; margin-bottom: 24px; }\n\t.de-fullimg-wrap-center, .de-fullimg-wrap-link, .de-fullimg-video > video { width: 100%; height: 100%; max-height: 100%; }\n\t.de-fullimg-wrap-center > .de-fullimg-wrap-link > .de-fullimg { height: 100%; }\n\t.de-fullimg-wrap-inpost { min-width: ").concat(p, "px; min-height: ").concat(p, "px; float: left; ").concat(aib.multiFile ? '' : 'margin: 2px 5px; -moz-box-sizing: border-box; box-sizing: border-box; ', " }\n\t.de-fullimg-wrap-nosize > .de-fullimg-wrap-link > .de-fullimg { opacity: 0.3; }\n\t.de-img-btn { position: fixed; top: 50%; z-index: 10000; height: 36px; width: 36px; border-radius: 10px 0 0 10px; color: #f0f0f0; cursor: pointer; }\n\t.de-img-btn > svg { height: 32px; width: 32px; margin: 2px; }\n\t#de-img-btn-auto { right: 0; margin-top: 58px; }\n\t.de-img-btn-auto-on { color: #ffe100; }\n\t#de-img-btn-next { right: 0; margin-top: -18px; }\n\t.de-img-btn-none { display: none; }\n\t#de-img-btn-prev { left: 0; margin-top: -18px; transform: scaleX(-1); }\n\t#de-img-btn-rotate { right: 0; margin-top: 20px; }\n\t.de-webm-title { color: #ffe100 !important; font: bold 12px tahoma; }\n\n\t/* Embedders */\n\t").concat(contentIcon('.de-video-link.de-ytube', 'https://youtube.com/favicon.ico'), "\n\t").concat(contentIcon('.de-video-link.de-vimeo', 'https://vimeo.com/favicon.ico'), "\n\t").concat(contentIcon('.de-img-arch', 'data:image/gif;base64,R0lGODlhEAAQALMAAF82SsxdwQMEP6+zzRA872NmZQesBylPHYBBHP///wAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAkALAAAAAAQABAAQARTMMlJaxqjiL2L51sGjCOCkGiBGWyLtC0KmPIoqUOg78i+ZwOCUOgpDIW3g3KJWC4t0ElBRqtdMr6AKRsA1qYy3JGgMR4xGpAAoRYkVDDWKx6NRgAAOw=='), "\n\t").concat(contentIcon('.de-img-audio', 'data:image/gif;base64,R0lGODlhEAAQAKIAAGya4wFLukKG4oq3802i7Bqy9P///wAAACH5BAEAAAYALAAAAAAQABAAQANBaLrcHsMN4QQYhE01OoCcQIyOYQGooKpV1GwNuAwAa9RkqTPpWqGj0YTSELg0RIYM+TjOkgba0sOaAEbGBW7HTQAAOw=='), "\n\t.de-current::after { content: \" \u25CF\"; }\n\t.de-img-arch, .de-img-audio { margin-left: 4px; color: inherit; text-decoration: none; font-weight: bold; }\n\t.de-mp3 { margin: 5px 20px; }\n\t.de-video-obj { margin: 5px 20px; white-space: nowrap; }\n\t.de-video-obj-inline { display: inline-block; }\n\t#de-video-btn-resize { padding: 0 14px 8px 0; margin: 0 8px; border: 2px solid; border-radius: 2px; }\n\t#de-video-btn-hide, #de-video-btn-prev { margin-left: auto; }\n\t#de-video-buttons { display: flex; margin-bottom: 2px; align-items: center; width: 100%; line-height: 16px; }\n\t#de-video-buttons > a:not(:hover) { color: inherit; }\n\t.de-video-expanded { width: 854px !important; height: 480px !important; }\n\t#de-video-list { padding: 0 0 4px; overflow-y: auto; width: 100%; }\n\t.de-video-refpost { margin: 0 3px; color: inherit; text-decoration: none; cursor: pointer; }\n\t.de-video-resizer::after { content: \"\u2795\"; margin: 0 -15px 0 3px; vertical-align: 6px; color: #000; font-size: 12px; cursor: pointer; }\n\t.de-video-player, .de-video-thumb { width: 100%; height: 100%; }\n\ta.de-video-player { display: inline-block; position: relative; border-spacing: 0; border: none; }\n\ta.de-video-player::after { content: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAWCAQAAACMYb/JAAAArklEQVR4AYXSr05CYRjA4cPGxjRosTijdvNJzmD1CrwAvQWugASNwGg0MoErOIVCPCMx0hmBMaAA4mPX8/2rT/i+9/1lPu0M3MtCN1OAvS+NEFkDmHqoJwcAbHzUkb9n7C5FqLynCAzdpAhLrynCRc9VnEDpKUWYpUmZIlt5nBQeY889amvGPj33HBvdt45WbAELeWyNP/qu/8dwBrDyVp9UBRi5DYXZdTLxEs77F5bCVAHlDJ1UAAAAAElFTkSuQmCC\"); position: absolute;top: 50%; left: 50%; padding: 12px 24px; margin: -22px 0 0 -32px; background-color: rgba(255,0,0,.4); border-radius: 8px; line-height: 0; }\n\ta.de-video-player:hover::after { background-color: rgba(255,0,0,.7); }\n\t.de-video-title[de-time]::after { content: \" [\" attr(de-time) \"]\"; color: red; }\n\t.de-video-title[de-time].de-current::after { content: \" [\" attr(de-time) \"] \u25CF\"; color: red; }\n\t.de-vocaroo { display: block; }\n\tvideo { background: black; }\n\n\t/* File inputs */\n\t.de-file { display: inline-block; vertical-align: top; margin: 1px; height: ").concat(p = aib.multiFile ? 90 : 130, "px; width: ").concat(p, "px; text-align: center; background-color: rgba(96,96,96,.15); border: 1px dashed grey; }\n\t.de-file > .de-file-img > div { display: flex; justify-content: center; align-items: center; height: ").concat(p, "px; cursor: pointer; }\n\t.de-file > .de-file-utils { display: none; height: 18px; margin-top: -20px; padding: 1px 0; background: rgba(64,64,64,.6); position: relative; -moz-box-sizing: initial; box-sizing: initial; }\n\t.de-file > .de-file-utils > .de-file-rarmsg { display: block; position: absolute; bottom: 20px; width: 100%; margin: 0; background: rgba(64,64,64,.6); color: #fff; }\n\t#de-file-area { margin-top: 1px; width: 275px; min-width: 100%; max-width: 100%; overflow-x: auto; overflow-y: hidden; white-space: nowrap; }\n\t.de-file-drag { background: rgba(96,96,96,.8); border: 1px solid grey; opacity: .7; }\n\t.de-file:hover:not(.de-file-drag) > .de-file-utils { display: block !important; }\n\timg.de-file-img, video.de-file-img { max-width: ").concat(p, "px; max-height: ").concat(p, "px; }\n\t.de-file-input { max-width: 300px; }\n\t.de-file-input + .de-file-utils { margin-left: 4px; }\n\t.de-file-off > .de-file-img > div::after { content: \"").concat(Lng.dropFileHere[lang], "\"; display: block; width: 80px; margin: 0 auto; font: 11px arial; opacity: .8; white-space: initial; }\n\t.de-file-rarmsg { margin: 0 2px; vertical-align: 4px; font: bold 11px tahoma; cursor: default; }\n\t.de-file-btn-del, .de-file-btn-rar, .de-file-btn-ren, .de-file-btn-txt { margin: 0 1px; width: 16px; height: 16px; cursor: pointer; }\n\t.de-file-btn-del > svg, .de-file-btn-rar > svg, .de-file-btn-ren > svg, .de-file-btn-txt > svg { width: 16px; height: 16px; }\n\t.de-file-spoil { margin: 0 3px; vertical-align: 1px; }\n\t.de-file-txt-add { margin-left: 2px; padding: 0 !important; width: 22px; font-weight: bold; }\n\t.de-file-txt-input { flex-grow: 1; border: 1px solid #9c9c9c; padding: 2px; font: 12px/16px sans-serif; }\n\t.de-file-txt-noedit { background: rgba(255,255,255,.5); cursor: pointer; }\n\t.de-file-txt-wrap { display: inline-flex; width: 100%; }\n\t.de-file-utils { display: inline-flex; float: none; align-items: center; }\n\t.de-file-wrap { display: flex; align-items: center; }\n\n\t/* Reply form */\n\t.de-parea { text-align: center; clear: both; }\n\t.de-parea-btn-close::after { content: \"").concat(Lng.hideForm[lang], "\"; }\n\t.de-parea-btn-thr::after { content: \"").concat(Lng.makeThr[lang], "\"; }\n\t.de-parea-btn-reply::after { content: \"").concat(Lng.makeReply[lang], "\"; }\n\t#de-pform > form { padding: 0; margin: 0; border: none; }\n\t#de-resizer-text { display: inline-block !important; float: none !important; padding: 5px; margin: ").concat(nav.isPresto ? '-2px -10px' : '0 0 -2px -10px', "; border-bottom: 2px solid #666; border-right: 2px solid #666; cursor: se-resize; }\n\t.de-win-inpost { float: none; clear: left; display: inline-block; width: auto; padding: 3px; margin: 2px 0; }\n\t.de-win-inpost > .de-resizer { display: none; }\n\t.de-win-inpost > .de-win-head { background: none; color: inherit; }\n\t#de-win-reply { width: auto !important; min-width: 0; padding: 0 !important; border: none !important; }\n\t#de-win-reply.de-win { position: fixed !important; padding: 0 !important; margin: 0 !important; border-radius: 10px 10px 0 0; }\n\t#de-win-reply.de-win > .de-win-body { padding: 2px 2px 0 1px; border: 1px solid gray; }\n\t#de-win-reply.de-win .de-textarea { min-width: 98% !important; resize: none !important; }\n\t#de-win-reply.de-win #de-resizer-text { display: none !important; }\n\t#de-sagebtn { display: inline-block; margin: 3px 4px 0 4px !important; cursor: pointer; }\n\t.de-textarea { display: inline-block; padding: 3px !important; min-width: 275px !important; min-height: 90px !important; resize: both; transition: none !important; }\n\n\t/* Thread navigation */\n\t#de-thr-navarrow { display: none; position: absolute; top: 50%; left: 34px; transform: translateY(-50%); width: 7px; height: 7px; }\n\t#de-thr-navpanel { color: #F5F5F5; height: 98px; width: 41px; position: fixed; top: 50%; left: 0px; padding: 0; margin: -49px 0 0; background: #777; border: 1px solid #525252; border-left: none; border-radius: 0 5px 5px 0; cursor: pointer; z-index: 1000; }\n\t.de-thr-navpanel-hidden { opacity: .7; margin-left: -34px !important; }\n\t.de-thr-navpanel-hidden > #de-thr-navarrow { display: initial; }\n\t#de-thr-navup { padding: 12px 9px 13px 8px; border-radius: 0 5px 0 0; }\n\t#de-thr-navdown { padding: 13px 9px 12px 8px; border-radius: 0 0 5px 0; }\n\t#de-thr-navup, #de-thr-navdown { width: 41px; height: 49px; -moz-box-sizing: border-box; box-sizing: border-box; }\n\t:not(.de-thr-navpanel-hidden) > #de-thr-navup:hover, :not(.de-thr-navpanel-hidden) > #de-thr-navdown:hover { background: #555; }\n\n\t/* Other */\n\t.de-abtn { text-decoration: none !important; outline: none; }\n\t.de-button { flex: none; padding: 0 ").concat(nav.isFirefox ? 2 : 4, "px !important; margin: 1px 2px; min-width: auto !iportant; height: 24px; font: 13px arial; }\n\t.de-editor { display: block; width: 600px; height: 300px; max-width: calc(100vw - 20px); font: 12px courier new; tab-size: 4; -moz-tab-size: 4; -o-tab-size: 4; }\n\t.de-hidden { float: left; overflow: hidden !important; margin: 0 !important; padding: 0 !important; border: none !important; width: 0 !important; height: 0 !important; display: inline !important; }\n\t.de-input-key { padding: 0 2px !important; margin: 0 !important; font: 13px/15px arial !important; }\n\tinput[type=\"text\"].de-input-selected { background: rgba(255,255,150,0.4) !important }\n\t.de-link-backref { text-decoration: none; }\n\t.de-link-parent { outline: 1px dotted !important; }\n\t.de-link-pview { font-weight: bold; }\n\t.de-list { padding-top: 4px; }\n\t.de-list::before { content: \"\u25CF\"; margin-right: 4px; }\n\t.de-logo { display: inline-block; margin-right: 10px; fill: inherit; color: #F5F5F5; border-radius: 80px 0 0 0; }\n\t.de-logo > svg { width: 130px; height: 130px; }\n\t.de-menu { padding: 0 !important; margin: 0 !important; width: auto !important; min-width: 0 !important; z-index: 10002; border: 1px solid grey !important; text-align: left; }\n\t.de-menu-item { display: block; padding: 3px 10px; color: inherit; text-decoration: none; font: 13px arial; white-space: nowrap; cursor: pointer; }\n\t.de-menu-item:hover { background-color: #222; color: #fff; }\n\t.de-omitted { color: grey; }\n\t.de-omitted::before { content: \"").concat(Lng.postsOmitted[lang], "\"; }\n\t.de-page-num { clear: both; }\n\t.de-popup { overflow: visible !important; clear: both !important; width: auto !important; min-width: 0pt !important; padding: 8px !important; margin: 1px !important; border: 1px solid grey !important; display: block !important; float: right !important; white-space: pre-wrap; }\n\t.de-popup-btn { display: inline-block; vertical-align: -1px; color: green; font-size: 1.5em; line-height: 16px; cursor: pointer; }\n\t.de-popup > hr { margin: 0 !important; }\n\t.de-post-hiddencontent { display: none !important; }\n\t.de-pview { position: absolute !important; width: auto; min-width: 0; z-index: 9999; border: 1px solid grey !important; margin: 0 !important; display: block !important; }\n\t.de-pview-info { padding: 3px 6px !important; }\n\t.de-ref-del::after { content: \" (Del)\"; }\n\t.de-ref-op::after { content: \" (OP)\"; }\n\t.de-refcomma:last-child { display: none; }\n\t.de-refmap { margin: 10px 4px 4px 4px; font-size: 75%; font-style: italic; }\n\t.de-refmap::before { content: \"").concat(Lng.replies[lang], " \"; }\n\t.de-replies-hide::after { content: \"").concat(Lng.hidePosts[lang], "\"; }\n\t.de-replies-show::after { content: \"").concat(Lng.showPosts[lang], "\"; }\n\t.de-thr-buttons { clear: left; margin-top: 5px; }\n\t").concat(aib.t ? '.de-thr-buttons > .de-btn-reply { display: none; }' : '', "\n\t.de-thr-collapse-link::after { content: \"").concat(Lng.collapseThr[lang], "\"; }\n\t.de-thr-hid { display: block; padding: 2px; }\n\t.de-thr-updater-link::after { content: \"").concat(Lng.getNewPosts[lang], "\"; }\n\t#de-updater-count::before { content: \": \"; }\n\t.de-viewed { color: #747488 !important; }\n\t.de-wait, .de-fav-wait , .de-fullimg-load { animation: de-wait-anim 1s linear infinite; }\n\t.de-wait { margin: 0 2px -3px 0 !important; width: 16px; height: 16px; }\n\t#de-wrapper-popup { max-width: calc(100vw - (100vw - 100%)); overflow-x: hidden !important; overflow-y: auto !important; -moz-box-sizing: border-box; box-sizing: border-box; max-height: 100vh; position: fixed; right: 0; top: 0; z-index: 9999; font: 14px arial; cursor: default; }\n\t@keyframes de-wait-anim { to { transform: rotate(360deg); } }\n\tform > hr { clear: both }\n\n\t/* Mobile devices */\n\t@media screen and (max-width: 768px) {\n\t\t.de-btn-expthr, .de-btn-fav, .de-btn-fav-sel, .de-btn-hide, .de-btn-hide-user, .de-btn-img, .de-btn-reply, .de-btn-sage, .de-btn-stick, .de-btn-stick-on, .de-btn-unhide, .de-btn-unhide-user, .de-win-btn-clear, .de-win-btn-close, .de-win-btn-toggle { width: 19px; height: 19px; vertical-align: -5px; }\n\t\t.de-video-obj { max-width: calc(100vw - 6px); margin: 5px 0; }\n\t}"); $css(x).id = 'de-css'; $css('').id = 'de-css-dynamic'; $css('').id = 'de-css-user'; updateCSS(); } function updateCSS() { var x = "\n\t.de-video-obj { width: ".concat(Cfg.YTubeWidth, "px; height: ").concat(Cfg.YTubeHeigh, "px; }\n\t.de-new-post { ").concat(nav.isPresto ? 'border-left: 4px solid rgba(107,134,97,.7); border-right: 4px solid rgba(107,134,97,.7)' : 'box-shadow: 6px 0 2px -2px rgba(107,134,97,.8), -6px 0 2px -2px rgba(107,134,97,.8)', " !important; }\n\t.de-selected, .de-input-error { ").concat(nav.isPresto ? 'border-left: 4px solid rgba(220,0,0,.7); border-right: 4px solid rgba(220,0,0,.7)' : 'box-shadow: 6px 0 2px -2px rgba(220,0,0,.8), -6px 0 2px -2px rgba(220,0,0,.8)', " !important; }\n\t").concat(Cfg.markMyPosts ? ".de-mypost { ".concat(nav.isPresto ? 'border-left: 4px solid rgba(97,107,134,.7); border-right: 4px solid rgba(97,107,134,.7)' : 'box-shadow: 6px 0 2px -2px rgba(97,107,134,.8), -6px 0 2px -2px rgba(97,107,134,.8)', " !important; }\n\t\t.de-mypost-reply:not(.de-pview) { position: relative; }\n\t\t.de-mypost-reply::before { content: \"\"; position: absolute; top: -0; bottom: 0; left: -1px; border-left: 5px dotted rgba(97,107,134,.8) !important; }") : '', "\n\t").concat(Cfg.markMyLinks ? ".de-ref-del.de-ref-you::after { content: \" (Del)(You)\"; }\n\t\t\t.de-ref-op.de-ref-you::after { content: \" (OP)(You)\"; }\n\t\t\t.de-ref-you::after { content: \" (You)\"; }" : '.de-post-counter-you { display: none; }', "\n\t").concat(Cfg.postBtnsCSS === 0 ? ".de-btn-expthr, .de-btn-fav, .de-btn-hide, .de-btn-img, .de-btn-reply, .de-btn-stick, .de-btn-unhide { fill: rgba(0,0,0,0); color: currentColor; }\n\t\t\t.de-btn-fav-sel, .de-btn-hide-user, .de-btn-sage, .de-btn-stick-on, .de-btn-unhide-user { fill: rgba(0,0,0,0); color: #F00; }" : ".de-btn-expthr, .de-btn-fav, .de-btn-hide, .de-btn-img, .de-btn-reply, .de-btn-sage, .de-btn-stick, .de-btn-unhide { color: #F5F5F5; }\n\t\t\t.de-btn-expthr, .de-btn-fav, .de-btn-fav-sel, .de-btn-hide, .de-btn-hide-user, .de-btn-img, .de-btn-reply, .de-btn-stick, .de-btn-stick-on, .de-btn-unhide, .de-btn-unhide-user { fill: ".concat(Cfg.postBtnsCSS === 1 && !nav.isPresto ? 'url(#de-btn-back-gradient)' : Cfg.postBtnsBack, "; }\n\t\t\t.de-btn-fav-sel { color: #FFE100; }\n\t\t\t.de-btn-hide-user { color: #BFFFBF; }\n\t\t\t.de-btn-sage { fill: #4B4B4B; }\n\t\t\t.de-btn-stick-on { color: #BFFFBF; }\n\t\t\t.de-btn-unhide-user { color: #FFBFBF; }"), "\n\t.de-fullimg-wrap-inpost > .de-fullimg { ").concat(Cfg.resizeImgs ? "max-width: 100%;".concat(Cfg.resizeImgs === 2 ? ' max-height: 96vh;' : '') : 'width: auto;', "; }\n\t").concat(Cfg.maskImgs ? "".concat(aib.qPostImg, ", .de-img-embed, .de-video-obj { opacity: ").concat(Cfg.maskVisib / 100, " !important; }\n\t\t\t").concat(aib.qPostImg.split(', ').join(':hover, '), ":hover, .de-img-embed:hover, .de-video-obj:hover { opacity: 1 !important; }\n\t\t\t.de-video-obj:not(.de-video-obj-inline) { clear: both; }") : '', "\n\t").concat(Cfg.imgNames === 1 ? '.de-img-name { display: inline-block; max-width: 230px; vertical-align: top; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }' : '', "\n\t").concat(Cfg.imgNames === 2 ? '.de-img-name { text-decoration: none !important; text-transform: capitalize; }' : '', "\n\t").concat(Cfg.imgNames === 3 ? '.de-img-name { display: inline-block; max-width: 230px; vertical-align: top; word-wrap: break-word; white-space: break-spaces; }' : '', "\n\t").concat(Cfg.widePosts ? '.de-reply { float: none; width: 99vw; margin-left: 0; }' : '', "\n\t").concat(aib.qPostMsg, " { max-width: ").concat(Cfg.limitPostMsg, "px; overflow-wrap: break-word; word-wrap: break-word; word-break: break-word; }\n\t").concat(Cfg.strikeHidd ? '.de-link-hid { text-decoration: line-through !important; }' : '', "\n\t").concat(Cfg.noSpoilers === 1 ? ".spoiler, s { color: #F5F5F5 !important; background-color: #888 !important; }\n\t\t\t.spoiler > a, s > a:not(:hover) { color: #F5F5F5 !important; background-color: #888 !important; }" : '', "\n\t").concat(Cfg.noSpoilers === 2 ? ".spoiler, s { color: inherit !important; }\n\t\t\t.spoiler > a, s > a:not(:hover) { color: inherit !important; }" : '', "\n\t").concat(Cfg.favFolders ? '' : ".de-fav-entries-hide { display: block; }\n\t\t.de-fav-header { display: none; }\n\t\t.de-fav-link::before { content: attr(de-host) \"/\" attr(de-board) \"/\" }", "\n\t").concat(Cfg.addSageBtn ? '' : '#de-sagebtn, ', "\n\t").concat(Cfg.delHiddPost === 1 || Cfg.delHiddPost === 3 ? '.de-thr-hid, .de-thr-hid + div + br, .de-thr-hid + div + hr, .de-thr-hid + div + br + hr, .de-thr-hid + div + div + hr, ' : '.de-thr-hid:not([style="display: none;"]) + div + br, ', "\n\t").concat(Cfg.imgNavBtns ? '' : '.de-img-btn, ', "\n\t").concat(Cfg.imgInfoLink ? '' : '.de-fullimg-info, ', "\n\t").concat(Cfg.noPostNames ? "".concat(aib.qPostName, ", ").concat(aib.qPostTrip, ", ") : '', "\n\t").concat(Cfg.noBoardRule ? "".concat(aib.qFormRules, ", ") : '', "\n\t").concat(Cfg.panelCounter ? '' : '#de-panel-info, ', "\n\t").concat(Cfg.removeHidd ? '.de-link-backref.de-link-hid, .de-link-backref.de-link-hid + .de-refcomma, ' : '', "\n\t").concat(Cfg.showHideBtn ? '' : '.de-btn-hide, ', "\n\t").concat(Cfg.showRepBtn ? '' : '.de-btn-reply, ', "\n\t").concat(Cfg.thrBtns || aib.t ? '' : '.de-thr-updater, ', "\n\t").concat(Cfg.thrBtns === 1 || Cfg.thrBtns === 2 && !aib.t ? '' : '.de-thr-buttons > svg, ', "\n\t").concat(Cfg.ajaxPosting ? '' : '.de-file-btn-rar, .de-file-btn-txt, ', "\n\t").concat(Cfg.fileInputs ? '' : '.de-file-txt-wrap, .de-file-btn-txt, ', "\n\t").concat(!aib.formHeaders && (aib.multiFile || Cfg.fileInputs !== 2) ? '#de-pform form > table > tbody > tr > td:not([colspan]):first-child, #de-pform form > table > tbody > tr > th:first-child, ' : '', "\n\tbody > hr, .postarea, .theader { display: none !important; }\r\n"); $id('de-css-dynamic').textContent = (x + aib.css).replace(/[\r\n\t]+/g, '\r\n\t'); $id('de-css-user').textContent = Cfg.userCSS ? Cfg.userCSSTxt : ''; } function runFrames() { var inf; if (typeof GM !== 'undefined') { inf = GM.info; } else { if (typeof GM_info === 'undefined') { return; } inf = GM_info; } if (!inf) { return; } var handlerName = inf.scriptHandler; if (handlerName !== 'Greasemonkey' && handlerName !== 'FireMonkey' || !deWindow.frames[0]) { return; } var deMainFuncFrame = function deMainFuncFrame(frameEl) { var fDoc = frameEl.contentDocument; if (fDoc) { var _deWindow$opera; var _deWindow = fDoc.defaultView; deMainFuncInner(_deWindow, (_deWindow$opera = _deWindow.opera) === null || _deWindow$opera === void 0 ? void 0 : _deWindow$opera.scriptStorage, _deWindow.FormData, function (x, y) { return _deWindow.scrollTo(x, y); }, _typeof(localData) === 'object' ? localData : null); } }; var _loop3 = function _loop3() { var frameEl = deWindow.frames[i].frameElement; var fDoc = frameEl.contentDocument; if (fDoc) { if (String(fDoc.defaultView.location) === 'about:blank') { frameEl.onload = function () { return deMainFuncFrame(frameEl); }; } else if (fDoc.readyState === 'loading') { fDoc.addEventListener('DOMContentLoaded', function () { return deMainFuncFrame(frameEl); }); } else { deMainFuncFrame(frameEl); } } }; for (var i = 0, len = deWindow.length; i < len; ++i) { _loop3(); } } function runMain(_x42, _x43) { return _runMain.apply(this, arguments); } function _runMain() { _runMain = _asyncToGenerator(_regeneratorRuntime().mark(function _callee59(checkDomains, dataPromise) { var _aib$init, _aib4; var formEl, _yield, _yield2, favObj, storageName, firstThr; return _regeneratorRuntime().wrap(function _callee59$(_context67) { while (1) switch (_context67.prev = _context67.next) { case 0: Logger.initLogger(); if (!(!doc.body || !aib && !(aib = getImageBoard(checkDomains, true)))) { _context67.next = 3; break; } return _context67.abrupt("return"); case 3: formEl = $q(aib.qDelForm + ', [de-form]'); if (formEl) { _context67.next = 7; break; } runFrames(); return _context67.abrupt("return"); case 7: if (!(doc.body.classList.contains('de-runned') || aib.observeContent && !aib.observeContent(checkDomains, dataPromise))) { _context67.next = 9; break; } return _context67.abrupt("return"); case 9: Logger.log('Imageboard check'); if (locStorage) { _context67.next = 14; break; } if (checkStorage()) { _context67.next = 13; break; } return _context67.abrupt("return"); case 13: initNavFuncs(); case 14: _context67.next = 16; return dataPromise || Promise.all([readFavorites(), readCfg()]); case 16: _yield = _context67.sent; _yield2 = _slicedToArray(_yield, 1); favObj = _yield2[0]; if (!(!Cfg.disabled && (_aib$init = (_aib4 = aib).init) !== null && _aib$init !== void 0 && _aib$init.call(_aib4) || !localData && doc.body.classList.contains('de-mode-local'))) { _context67.next = 21; break; } return _context67.abrupt("return"); case 21: doc.body.classList.add('de-runned'); Logger.log('Storage loading'); addSVGIcons(); if (!Cfg.disabled) { _context67.next = 28; break; } Panel.initPanel(formEl); scriptCSS(); return _context67.abrupt("return"); case 28: if ('toJSON' in Array.prototype) { delete Array.prototype.toJSON; } initStorageEvent(); DollchanAPI.initAPI(); if (localData) { aib.protocol = 'http:'; aib.host = aib.domain; aib.b = localData.b; aib.t = localData.t; aib.docExt = '.html'; } else { aib.parseURL(); } if (aib.t || !Cfg.scrollToTop) { doc.defaultView.addEventListener('beforeunload', function () { sesStorage['de-scroll-' + aib.b + (aib.t || '')] = deWindow.pageYOffset; }); } Logger.log('Init'); if (Cfg.correctTime) { dTime = new DateTime(Cfg.timePattern, Cfg.timeRPattern, Cfg.timeOffset, lang, function (rp) { return CfgSaver.save('timeRPattern', rp); }); Logger.log('Time correction'); } MyPosts.readStorage(); Logger.log('Read my posts'); $hide(doc.body); dummy = doc.createElement('div'); formEl = aib.fixHTML(formEl, true); Logger.log('Replace delform'); pByEl = new Map(); pByNum = new Map(); _context67.prev = 43; DelForm.last = DelForm.first = new DelForm(formEl, aib.page, null); if (!Thread.first) { console.error('No threads detected!'); } _context67.next = 53; break; case 48: _context67.prev = 48; _context67.t0 = _context67["catch"](43); console.error('Delform parsing error:', getErrorMessage(_context67.t0)); $show(doc.body); return _context67.abrupt("return"); case 53: Logger.log('Parse delform'); if (aib.t) { storageName = "de-last-postscount-".concat(aib.b, "-").concat(aib.t); if (sesStorage[storageName] > Thread.first.postsCount) { sesStorage.removeItem(storageName); deWindow.location.reload(); } } postform = new PostForm($q(aib.qForm)); Logger.log('Parse postform'); if (Cfg.hotKeys) { HotKeys.enableHotKeys(); Logger.log('Init keybinds'); } initPage(); Logger.log('Init page'); Panel.initPanel(formEl); Logger.log('Add panel'); embedPostMsgImages(DelForm.first.el); Logger.log('Image-links'); DelForm.first.addStuff(); readViewedPosts(); scriptCSS(); Logger.log('Apply CSS'); $show(doc.body); Logger.log('Display page'); Pages.toggleInfinityScroll(); Logger.log('Infinity scroll'); firstThr = DelForm.first.firstThr; if (firstThr) { readPostsData(firstThr.op, favObj); } Logger.log('Hide posts'); scrollPage(); Logger.log('Scroll page'); if (localData) { $Q('.de-post-removed').forEach(function (el) { var post = pByEl.get(el); if (post) { post.deletePost(false); } }); Logger.log('Local changings'); } Logger.finish(); case 79: case "end": return _context67.stop(); } }, _callee59, null, [[43, 48]]); })); return _runMain.apply(this, arguments); } function initMain() { if (window.name === 'de-prohibited') { return; } if (doc.readyState !== 'loading') { needScroll = false; runMain(true, null); return; } var dataPromise = null; if (aib = getImageBoard(true, false)) { if (!checkStorage()) { return; } initNavFuncs(); dataPromise = Promise.all([readFavorites(), readCfg()]); } needScroll = true; doc.addEventListener('onwheel' in doc.defaultView ? 'wheel' : 'mousewheel', function wFunc(e) { needScroll = false; doc.removeEventListener(e.type, wFunc); }); doc.addEventListener('DOMContentLoaded', function () { return runMain(false, dataPromise); }); } initMain(); })(window, (_window$opera = window.opera) === null || _window$opera === void 0 ? void 0 : _window$opera.scriptStorage, window.FormData, function (x, y) { return window.scrollTo(x, y); }, (typeof localData === "undefined" ? "undefined" : _typeof(localData)) === 'object' ? localData : null); },{}],406:[function(require,module,exports){ "use strict"; require('core-js/features/array/from'); require('core-js/features/array/iterator'); require('core-js/features/map'); require('core-js/features/math/clz32'); require('core-js/features/object/assign'); require('core-js/features/object/entries'); require('core-js/features/promise'); require('core-js/features/set'); require('core-js/features/string/ends-with'); require('core-js/features/string/includes'); require('core-js/features/string/repeat'); require('core-js/features/string/replace-all'); require('core-js/features/string/starts-with'); require('core-js/features/symbol'); require('element-polyfill'); require('regenerator-runtime/runtime'); },{"core-js/features/array/from":29,"core-js/features/array/iterator":30,"core-js/features/map":31,"core-js/features/math/clz32":32,"core-js/features/object/assign":33,"core-js/features/object/entries":34,"core-js/features/promise":35,"core-js/features/set":36,"core-js/features/string/ends-with":37,"core-js/features/string/includes":38,"core-js/features/string/repeat":39,"core-js/features/string/replace-all":40,"core-js/features/string/starts-with":41,"core-js/features/symbol":42,"element-polyfill":395,"regenerator-runtime/runtime":404}]},{},[406,405]); })(null);