(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.MediaSearchModule = f()}})(function(){var define,module,exports;return (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 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":101,"../internals/try-to-string":207}],2:[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":102,"../internals/try-to-string":207}],3:[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":108}],4:[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":134,"../internals/object-define-property":136,"../internals/well-known-symbol":221}],5:[function(require,module,exports){
'use strict';

var charAt = require('../internals/string-multibyte').charAt;
module.exports = function (S, index, unicode) {
  return index + (unicode ? charAt(S, index).length : 1);
};

},{"../internals/string-multibyte":179}],6:[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":143}],7:[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":107}],8:[function(require,module,exports){
'use strict';
module.exports = typeof ArrayBuffer != 'undefined' && typeof DataView != 'undefined';

},{}],9:[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":67}],10:[function(require,module,exports){
'use strict';

var NATIVE_ARRAY_BUFFER = require('../internals/array-buffer-basic-detection');
var DESCRIPTORS = require('../internals/descriptors');
var globalThis = require('../internals/global-this');
var isCallable = require('../internals/is-callable');
var isObject = require('../internals/is-object');
var hasOwn = require('../internals/has-own-property');
var classof = require('../internals/classof');
var tryToString = require('../internals/try-to-string');
var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
var defineBuiltIn = require('../internals/define-built-in');
var defineBuiltInAccessor = require('../internals/define-built-in-accessor');
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 wellKnownSymbol = require('../internals/well-known-symbol');
var uid = require('../internals/uid');
var InternalStateModule = require('../internals/internal-state');
var enforceInternalState = InternalStateModule.enforce;
var getInternalState = InternalStateModule.get;
var Int8Array = globalThis.Int8Array;
var Int8ArrayPrototype = Int8Array && Int8Array.prototype;
var Uint8ClampedArray = globalThis.Uint8ClampedArray;
var Uint8ClampedArrayPrototype = Uint8ClampedArray && Uint8ClampedArray.prototype;
var TypedArray = Int8Array && getPrototypeOf(Int8Array);
var TypedArrayPrototype = Int8ArrayPrototype && getPrototypeOf(Int8ArrayPrototype);
var ObjectPrototype = Object.prototype;
var TypeError = globalThis.TypeError;
var TO_STRING_TAG = wellKnownSymbol('toStringTag');
var TYPED_ARRAY_TAG = uid('TYPED_ARRAY_TAG');
var TYPED_ARRAY_CONSTRUCTOR = 'TypedArrayConstructor';
var NATIVE_ARRAY_BUFFER_VIEWS = NATIVE_ARRAY_BUFFER && !!setPrototypeOf && classof(globalThis.opera) !== 'Opera';
var TYPED_ARRAY_TAG_REQUIRED = false;
var NAME, Constructor, Prototype;
var TypedArrayConstructorsList = {
  Int8Array: 1,
  Uint8Array: 1,
  Uint8ClampedArray: 1,
  Int16Array: 2,
  Uint16Array: 2,
  Int32Array: 4,
  Uint32Array: 4,
  Float32Array: 4,
  Float64Array: 8
};
var BigIntArrayConstructorsList = {
  BigInt64Array: 8,
  BigUint64Array: 8
};
var isView = function isView(it) {
  if (!isObject(it)) return false;
  var klass = classof(it);
  return klass === 'DataView' || hasOwn(TypedArrayConstructorsList, klass) || hasOwn(BigIntArrayConstructorsList, klass);
};
var _getTypedArrayConstructor = function getTypedArrayConstructor(it) {
  var proto = getPrototypeOf(it);
  if (!isObject(proto)) return;
  var state = getInternalState(proto);
  return state && hasOwn(state, TYPED_ARRAY_CONSTRUCTOR) ? state[TYPED_ARRAY_CONSTRUCTOR] : _getTypedArrayConstructor(proto);
};
var isTypedArray = function isTypedArray(it) {
  if (!isObject(it)) return false;
  var klass = classof(it);
  return hasOwn(TypedArrayConstructorsList, klass) || hasOwn(BigIntArrayConstructorsList, klass);
};
var aTypedArray = function aTypedArray(it) {
  if (isTypedArray(it)) return it;
  throw new TypeError('Target is not a typed array');
};
var aTypedArrayConstructor = function aTypedArrayConstructor(C) {
  if (isCallable(C) && (!setPrototypeOf || isPrototypeOf(TypedArray, C))) return C;
  throw new TypeError(tryToString(C) + ' is not a typed array constructor');
};
var exportTypedArrayMethod = function exportTypedArrayMethod(KEY, property, forced, options) {
  if (!DESCRIPTORS) return;
  if (forced) for (var ARRAY in TypedArrayConstructorsList) {
    var TypedArrayConstructor = globalThis[ARRAY];
    if (TypedArrayConstructor && hasOwn(TypedArrayConstructor.prototype, KEY)) try {
      delete TypedArrayConstructor.prototype[KEY];
    } catch (error) {
      try {
        TypedArrayConstructor.prototype[KEY] = property;
      } catch (error2) {}
    }
  }
  if (!TypedArrayPrototype[KEY] || forced) {
    defineBuiltIn(TypedArrayPrototype, KEY, forced ? property : NATIVE_ARRAY_BUFFER_VIEWS && Int8ArrayPrototype[KEY] || property, options);
  }
};
var exportTypedArrayStaticMethod = function exportTypedArrayStaticMethod(KEY, property, forced) {
  var ARRAY, TypedArrayConstructor;
  if (!DESCRIPTORS) return;
  if (setPrototypeOf) {
    if (forced) for (ARRAY in TypedArrayConstructorsList) {
      TypedArrayConstructor = globalThis[ARRAY];
      if (TypedArrayConstructor && hasOwn(TypedArrayConstructor, KEY)) try {
        delete TypedArrayConstructor[KEY];
      } catch (error) {}
    }
    if (!TypedArray[KEY] || forced) {
      try {
        return defineBuiltIn(TypedArray, KEY, forced ? property : NATIVE_ARRAY_BUFFER_VIEWS && TypedArray[KEY] || property);
      } catch (error) {}
    } else return;
  }
  for (ARRAY in TypedArrayConstructorsList) {
    TypedArrayConstructor = globalThis[ARRAY];
    if (TypedArrayConstructor && (!TypedArrayConstructor[KEY] || forced)) {
      defineBuiltIn(TypedArrayConstructor, KEY, property);
    }
  }
};
for (NAME in TypedArrayConstructorsList) {
  Constructor = globalThis[NAME];
  Prototype = Constructor && Constructor.prototype;
  if (Prototype) enforceInternalState(Prototype)[TYPED_ARRAY_CONSTRUCTOR] = Constructor;else NATIVE_ARRAY_BUFFER_VIEWS = false;
}
for (NAME in BigIntArrayConstructorsList) {
  Constructor = globalThis[NAME];
  Prototype = Constructor && Constructor.prototype;
  if (Prototype) enforceInternalState(Prototype)[TYPED_ARRAY_CONSTRUCTOR] = Constructor;
}
if (!NATIVE_ARRAY_BUFFER_VIEWS || !isCallable(TypedArray) || TypedArray === Function.prototype) {
  TypedArray = function TypedArray() {
    throw new TypeError('Incorrect invocation');
  };
  if (NATIVE_ARRAY_BUFFER_VIEWS) for (NAME in TypedArrayConstructorsList) {
    if (globalThis[NAME]) setPrototypeOf(globalThis[NAME], TypedArray);
  }
}
if (!NATIVE_ARRAY_BUFFER_VIEWS || !TypedArrayPrototype || TypedArrayPrototype === ObjectPrototype) {
  TypedArrayPrototype = TypedArray.prototype;
  if (NATIVE_ARRAY_BUFFER_VIEWS) for (NAME in TypedArrayConstructorsList) {
    if (globalThis[NAME]) setPrototypeOf(globalThis[NAME].prototype, TypedArrayPrototype);
  }
}
if (NATIVE_ARRAY_BUFFER_VIEWS && getPrototypeOf(Uint8ClampedArrayPrototype) !== TypedArrayPrototype) {
  setPrototypeOf(Uint8ClampedArrayPrototype, TypedArrayPrototype);
}
if (DESCRIPTORS && !hasOwn(TypedArrayPrototype, TO_STRING_TAG)) {
  TYPED_ARRAY_TAG_REQUIRED = true;
  defineBuiltInAccessor(TypedArrayPrototype, TO_STRING_TAG, {
    configurable: true,
    get: function get() {
      return isObject(this) ? this[TYPED_ARRAY_TAG] : undefined;
    }
  });
  for (NAME in TypedArrayConstructorsList) if (globalThis[NAME]) {
    createNonEnumerableProperty(globalThis[NAME], TYPED_ARRAY_TAG, NAME);
  }
}
module.exports = {
  NATIVE_ARRAY_BUFFER_VIEWS: NATIVE_ARRAY_BUFFER_VIEWS,
  TYPED_ARRAY_TAG: TYPED_ARRAY_TAG_REQUIRED && TYPED_ARRAY_TAG,
  aTypedArray: aTypedArray,
  aTypedArrayConstructor: aTypedArrayConstructor,
  exportTypedArrayMethod: exportTypedArrayMethod,
  exportTypedArrayStaticMethod: exportTypedArrayStaticMethod,
  getTypedArrayConstructor: _getTypedArrayConstructor,
  isView: isView,
  isTypedArray: isTypedArray,
  TypedArray: TypedArray,
  TypedArrayPrototype: TypedArrayPrototype
};

},{"../internals/array-buffer-basic-detection":8,"../internals/classof":31,"../internals/create-non-enumerable-property":40,"../internals/define-built-in":46,"../internals/define-built-in-accessor":45,"../internals/descriptors":50,"../internals/global-this":86,"../internals/has-own-property":87,"../internals/internal-state":97,"../internals/is-callable":101,"../internals/is-object":107,"../internals/object-get-prototype-of":141,"../internals/object-is-prototype-of":143,"../internals/object-set-prototype-of":148,"../internals/try-to-string":207,"../internals/uid":213,"../internals/well-known-symbol":221}],11:[function(require,module,exports){
'use strict';

var globalThis = require('../internals/global-this');
var uncurryThis = require('../internals/function-uncurry-this');
var DESCRIPTORS = require('../internals/descriptors');
var NATIVE_ARRAY_BUFFER = require('../internals/array-buffer-basic-detection');
var FunctionName = require('../internals/function-name');
var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
var defineBuiltInAccessor = require('../internals/define-built-in-accessor');
var defineBuiltIns = require('../internals/define-built-ins');
var fails = require('../internals/fails');
var anInstance = require('../internals/an-instance');
var toIntegerOrInfinity = require('../internals/to-integer-or-infinity');
var toLength = require('../internals/to-length');
var toIndex = require('../internals/to-index');
var fround = require('../internals/math-fround');
var IEEE754 = require('../internals/ieee754');
var getPrototypeOf = require('../internals/object-get-prototype-of');
var setPrototypeOf = require('../internals/object-set-prototype-of');
var arrayFill = require('../internals/array-fill');
var arraySlice = require('../internals/array-slice');
var inheritIfRequired = require('../internals/inherit-if-required');
var copyConstructorProperties = require('../internals/copy-constructor-properties');
var setToStringTag = require('../internals/set-to-string-tag');
var InternalStateModule = require('../internals/internal-state');
var PROPER_FUNCTION_NAME = FunctionName.PROPER;
var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
var ARRAY_BUFFER = 'ArrayBuffer';
var DATA_VIEW = 'DataView';
var PROTOTYPE = 'prototype';
var WRONG_LENGTH = 'Wrong length';
var WRONG_INDEX = 'Wrong index';
var getInternalArrayBufferState = InternalStateModule.getterFor(ARRAY_BUFFER);
var getInternalDataViewState = InternalStateModule.getterFor(DATA_VIEW);
var setInternalState = InternalStateModule.set;
var NativeArrayBuffer = globalThis[ARRAY_BUFFER];
var $ArrayBuffer = NativeArrayBuffer;
var ArrayBufferPrototype = $ArrayBuffer && $ArrayBuffer[PROTOTYPE];
var $DataView = globalThis[DATA_VIEW];
var DataViewPrototype = $DataView && $DataView[PROTOTYPE];
var ObjectPrototype = Object.prototype;
var Array = globalThis.Array;
var RangeError = globalThis.RangeError;
var fill = uncurryThis(arrayFill);
var reverse = uncurryThis([].reverse);
var packIEEE754 = IEEE754.pack;
var unpackIEEE754 = IEEE754.unpack;
var packInt8 = function packInt8(number) {
  return [number & 0xFF];
};
var packInt16 = function packInt16(number) {
  return [number & 0xFF, number >> 8 & 0xFF];
};
var packInt32 = function packInt32(number) {
  return [number & 0xFF, number >> 8 & 0xFF, number >> 16 & 0xFF, number >> 24 & 0xFF];
};
var unpackInt32 = function unpackInt32(buffer) {
  return buffer[3] << 24 | buffer[2] << 16 | buffer[1] << 8 | buffer[0];
};
var packFloat32 = function packFloat32(number) {
  return packIEEE754(fround(number), 23, 4);
};
var packFloat64 = function packFloat64(number) {
  return packIEEE754(number, 52, 8);
};
var addGetter = function addGetter(Constructor, key, getInternalState) {
  defineBuiltInAccessor(Constructor[PROTOTYPE], key, {
    configurable: true,
    get: function get() {
      return getInternalState(this)[key];
    }
  });
};
var get = function get(view, count, index, isLittleEndian) {
  var store = getInternalDataViewState(view);
  var intIndex = toIndex(index);
  var boolIsLittleEndian = !!isLittleEndian;
  if (intIndex + count > store.byteLength) throw new RangeError(WRONG_INDEX);
  var bytes = store.bytes;
  var start = intIndex + store.byteOffset;
  var pack = arraySlice(bytes, start, start + count);
  return boolIsLittleEndian ? pack : reverse(pack);
};
var set = function set(view, count, index, conversion, value, isLittleEndian) {
  var store = getInternalDataViewState(view);
  var intIndex = toIndex(index);
  var pack = conversion(+value);
  var boolIsLittleEndian = !!isLittleEndian;
  if (intIndex + count > store.byteLength) throw new RangeError(WRONG_INDEX);
  var bytes = store.bytes;
  var start = intIndex + store.byteOffset;
  for (var i = 0; i < count; i++) bytes[start + i] = pack[boolIsLittleEndian ? i : count - i - 1];
};
if (!NATIVE_ARRAY_BUFFER) {
  $ArrayBuffer = function ArrayBuffer(length) {
    anInstance(this, ArrayBufferPrototype);
    var byteLength = toIndex(length);
    setInternalState(this, {
      type: ARRAY_BUFFER,
      bytes: fill(Array(byteLength), 0),
      byteLength: byteLength
    });
    if (!DESCRIPTORS) {
      this.byteLength = byteLength;
      this.detached = false;
    }
  };
  ArrayBufferPrototype = $ArrayBuffer[PROTOTYPE];
  $DataView = function DataView(buffer, byteOffset, byteLength) {
    anInstance(this, DataViewPrototype);
    anInstance(buffer, ArrayBufferPrototype);
    var bufferState = getInternalArrayBufferState(buffer);
    var bufferLength = bufferState.byteLength;
    var offset = toIntegerOrInfinity(byteOffset);
    if (offset < 0 || offset > bufferLength) throw new RangeError('Wrong offset');
    byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength);
    if (offset + byteLength > bufferLength) throw new RangeError(WRONG_LENGTH);
    setInternalState(this, {
      type: DATA_VIEW,
      buffer: buffer,
      byteLength: byteLength,
      byteOffset: offset,
      bytes: bufferState.bytes
    });
    if (!DESCRIPTORS) {
      this.buffer = buffer;
      this.byteLength = byteLength;
      this.byteOffset = offset;
    }
  };
  DataViewPrototype = $DataView[PROTOTYPE];
  if (DESCRIPTORS) {
    addGetter($ArrayBuffer, 'byteLength', getInternalArrayBufferState);
    addGetter($DataView, 'buffer', getInternalDataViewState);
    addGetter($DataView, 'byteLength', getInternalDataViewState);
    addGetter($DataView, 'byteOffset', getInternalDataViewState);
  }
  defineBuiltIns(DataViewPrototype, {
    getInt8: function getInt8(byteOffset) {
      return get(this, 1, byteOffset)[0] << 24 >> 24;
    },
    getUint8: function getUint8(byteOffset) {
      return get(this, 1, byteOffset)[0];
    },
    getInt16: function getInt16(byteOffset) {
      var bytes = get(this, 2, byteOffset, arguments.length > 1 ? arguments[1] : false);
      return (bytes[1] << 8 | bytes[0]) << 16 >> 16;
    },
    getUint16: function getUint16(byteOffset) {
      var bytes = get(this, 2, byteOffset, arguments.length > 1 ? arguments[1] : false);
      return bytes[1] << 8 | bytes[0];
    },
    getInt32: function getInt32(byteOffset) {
      return unpackInt32(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : false));
    },
    getUint32: function getUint32(byteOffset) {
      return unpackInt32(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : false)) >>> 0;
    },
    getFloat32: function getFloat32(byteOffset) {
      return unpackIEEE754(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : false), 23);
    },
    getFloat64: function getFloat64(byteOffset) {
      return unpackIEEE754(get(this, 8, byteOffset, arguments.length > 1 ? arguments[1] : false), 52);
    },
    setInt8: function setInt8(byteOffset, value) {
      set(this, 1, byteOffset, packInt8, value);
    },
    setUint8: function setUint8(byteOffset, value) {
      set(this, 1, byteOffset, packInt8, value);
    },
    setInt16: function setInt16(byteOffset, value) {
      set(this, 2, byteOffset, packInt16, value, arguments.length > 2 ? arguments[2] : false);
    },
    setUint16: function setUint16(byteOffset, value) {
      set(this, 2, byteOffset, packInt16, value, arguments.length > 2 ? arguments[2] : false);
    },
    setInt32: function setInt32(byteOffset, value) {
      set(this, 4, byteOffset, packInt32, value, arguments.length > 2 ? arguments[2] : false);
    },
    setUint32: function setUint32(byteOffset, value) {
      set(this, 4, byteOffset, packInt32, value, arguments.length > 2 ? arguments[2] : false);
    },
    setFloat32: function setFloat32(byteOffset, value) {
      set(this, 4, byteOffset, packFloat32, value, arguments.length > 2 ? arguments[2] : false);
    },
    setFloat64: function setFloat64(byteOffset, value) {
      set(this, 8, byteOffset, packFloat64, value, arguments.length > 2 ? arguments[2] : false);
    }
  });
} else {
  var INCORRECT_ARRAY_BUFFER_NAME = PROPER_FUNCTION_NAME && NativeArrayBuffer.name !== ARRAY_BUFFER;
  if (!fails(function () {
    NativeArrayBuffer(1);
  }) || !fails(function () {
    new NativeArrayBuffer(-1);
  }) || fails(function () {
    new NativeArrayBuffer();
    new NativeArrayBuffer(1.5);
    new NativeArrayBuffer(NaN);
    return NativeArrayBuffer.length !== 1 || INCORRECT_ARRAY_BUFFER_NAME && !CONFIGURABLE_FUNCTION_NAME;
  })) {
    $ArrayBuffer = function ArrayBuffer(length) {
      anInstance(this, ArrayBufferPrototype);
      return inheritIfRequired(new NativeArrayBuffer(toIndex(length)), this, $ArrayBuffer);
    };
    $ArrayBuffer[PROTOTYPE] = ArrayBufferPrototype;
    ArrayBufferPrototype.constructor = $ArrayBuffer;
    copyConstructorProperties($ArrayBuffer, NativeArrayBuffer);
  } else if (INCORRECT_ARRAY_BUFFER_NAME && CONFIGURABLE_FUNCTION_NAME) {
    createNonEnumerableProperty(NativeArrayBuffer, 'name', ARRAY_BUFFER);
  }
  if (setPrototypeOf && getPrototypeOf(DataViewPrototype) !== ObjectPrototype) {
    setPrototypeOf(DataViewPrototype, ObjectPrototype);
  }
  var testView = new $DataView(new $ArrayBuffer(2));
  var $setInt8 = uncurryThis(DataViewPrototype.setInt8);
  testView.setInt8(0, 2147483648);
  testView.setInt8(1, 2147483649);
  if (testView.getInt8(0) || !testView.getInt8(1)) defineBuiltIns(DataViewPrototype, {
    setInt8: function setInt8(byteOffset, value) {
      $setInt8(this, byteOffset, value << 24 >> 24);
    },
    setUint8: function setUint8(byteOffset, value) {
      $setInt8(this, byteOffset, value << 24 >> 24);
    }
  }, {
    unsafe: true
  });
}
setToStringTag($ArrayBuffer, ARRAY_BUFFER);
setToStringTag($DataView, DATA_VIEW);
module.exports = {
  ArrayBuffer: $ArrayBuffer,
  DataView: $DataView
};

},{"../internals/an-instance":6,"../internals/array-buffer-basic-detection":8,"../internals/array-fill":13,"../internals/array-slice":24,"../internals/copy-constructor-properties":35,"../internals/create-non-enumerable-property":40,"../internals/define-built-in-accessor":45,"../internals/define-built-ins":47,"../internals/descriptors":50,"../internals/fails":67,"../internals/function-name":76,"../internals/function-uncurry-this":79,"../internals/global-this":86,"../internals/ieee754":92,"../internals/inherit-if-required":94,"../internals/internal-state":97,"../internals/math-fround":122,"../internals/object-get-prototype-of":141,"../internals/object-set-prototype-of":148,"../internals/set-to-string-tag":173,"../internals/to-index":195,"../internals/to-integer-or-infinity":197,"../internals/to-length":198}],12:[function(require,module,exports){
'use strict';

var toObject = require('../internals/to-object');
var toAbsoluteIndex = require('../internals/to-absolute-index');
var lengthOfArrayLike = require('../internals/length-of-array-like');
var deletePropertyOrThrow = require('../internals/delete-property-or-throw');
var min = Math.min;
module.exports = [].copyWithin || function copyWithin(target, start) {
  var O = toObject(this);
  var len = lengthOfArrayLike(O);
  var to = toAbsoluteIndex(target, len);
  var from = toAbsoluteIndex(start, len);
  var end = arguments.length > 2 ? arguments[2] : undefined;
  var count = min((end === undefined ? len : toAbsoluteIndex(end, len)) - from, len - to);
  var inc = 1;
  if (from < to && to < from + count) {
    inc = -1;
    from += count - 1;
    to += count - 1;
  }
  while (count-- > 0) {
    if (from in O) O[to] = O[from];else deletePropertyOrThrow(O, to);
    to += inc;
    from += inc;
  }
  return O;
};

},{"../internals/delete-property-or-throw":49,"../internals/length-of-array-like":118,"../internals/to-absolute-index":193,"../internals/to-object":199}],13:[function(require,module,exports){
'use strict';

var toObject = require('../internals/to-object');
var toAbsoluteIndex = require('../internals/to-absolute-index');
var lengthOfArrayLike = require('../internals/length-of-array-like');
module.exports = function fill(value) {
  var O = toObject(this);
  var length = lengthOfArrayLike(O);
  var argumentsLength = arguments.length;
  var index = toAbsoluteIndex(argumentsLength > 1 ? arguments[1] : undefined, length);
  var end = argumentsLength > 2 ? arguments[2] : undefined;
  var endPos = end === undefined ? length : toAbsoluteIndex(end, length);
  while (endPos > index) O[index++] = value;
  return O;
};

},{"../internals/length-of-array-like":118,"../internals/to-absolute-index":193,"../internals/to-object":199}],14:[function(require,module,exports){
'use strict';

var $forEach = require('../internals/array-iteration').forEach;
var arrayMethodIsStrict = require('../internals/array-method-is-strict');
var STRICT_METHOD = arrayMethodIsStrict('forEach');
module.exports = !STRICT_METHOD ? function forEach(callbackfn) {
  return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
} : [].forEach;

},{"../internals/array-iteration":18,"../internals/array-method-is-strict":21}],15:[function(require,module,exports){
'use strict';

var lengthOfArrayLike = require('../internals/length-of-array-like');
module.exports = function (Constructor, list, $length) {
  var index = 0;
  var length = arguments.length > 2 ? $length : lengthOfArrayLike(list);
  var result = new Constructor(length);
  while (length > index) result[index] = list[index++];
  return result;
};

},{"../internals/length-of-array-like":118}],16:[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":28,"../internals/create-property":42,"../internals/function-bind-context":72,"../internals/function-call":75,"../internals/get-iterator":82,"../internals/get-iterator-method":81,"../internals/is-array-iterator-method":98,"../internals/is-constructor":102,"../internals/length-of-array-like":118,"../internals/to-object":199}],17:[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 createMethod(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":118,"../internals/to-absolute-index":193,"../internals/to-indexed-object":196}],18:[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 createMethod(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":27,"../internals/function-bind-context":72,"../internals/function-uncurry-this":79,"../internals/indexed-object":93,"../internals/length-of-array-like":118,"../internals/to-object":199}],19:[function(require,module,exports){
'use strict';
var apply = require('../internals/function-apply');
var toIndexedObject = require('../internals/to-indexed-object');
var toIntegerOrInfinity = require('../internals/to-integer-or-infinity');
var lengthOfArrayLike = require('../internals/length-of-array-like');
var arrayMethodIsStrict = require('../internals/array-method-is-strict');
var min = Math.min;
var $lastIndexOf = [].lastIndexOf;
var NEGATIVE_ZERO = !!$lastIndexOf && 1 / [1].lastIndexOf(1, -0) < 0;
var STRICT_METHOD = arrayMethodIsStrict('lastIndexOf');
var FORCED = NEGATIVE_ZERO || !STRICT_METHOD;
module.exports = FORCED ? function lastIndexOf(searchElement) {
  if (NEGATIVE_ZERO) return apply($lastIndexOf, this, arguments) || 0;
  var O = toIndexedObject(this);
  var length = lengthOfArrayLike(O);
  if (length === 0) return -1;
  var index = length - 1;
  if (arguments.length > 1) index = min(index, toIntegerOrInfinity(arguments[1]));
  if (index < 0) index = length + index;
  for (; index >= 0; index--) if (index in O && O[index] === searchElement) return index || 0;
  return -1;
} : $lastIndexOf;

},{"../internals/array-method-is-strict":21,"../internals/function-apply":71,"../internals/length-of-array-like":118,"../internals/to-indexed-object":196,"../internals/to-integer-or-infinity":197}],20:[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":63,"../internals/fails":67,"../internals/well-known-symbol":221}],21:[function(require,module,exports){
'use strict';

var fails = require('../internals/fails');
module.exports = function (METHOD_NAME, argument) {
  var method = [][METHOD_NAME];
  return !!method && fails(function () {
    method.call(null, argument || function () {
      return 1;
    }, 1);
  });
};

},{"../internals/fails":67}],22:[function(require,module,exports){
'use strict';

var aCallable = require('../internals/a-callable');
var toObject = require('../internals/to-object');
var IndexedObject = require('../internals/indexed-object');
var lengthOfArrayLike = require('../internals/length-of-array-like');
var $TypeError = TypeError;
var REDUCE_EMPTY = 'Reduce of empty array with no initial value';
var createMethod = function createMethod(IS_RIGHT) {
  return function (that, callbackfn, argumentsLength, memo) {
    var O = toObject(that);
    var self = IndexedObject(O);
    var length = lengthOfArrayLike(O);
    aCallable(callbackfn);
    if (length === 0 && argumentsLength < 2) throw new $TypeError(REDUCE_EMPTY);
    var index = IS_RIGHT ? length - 1 : 0;
    var i = IS_RIGHT ? -1 : 1;
    if (argumentsLength < 2) while (true) {
      if (index in self) {
        memo = self[index];
        index += i;
        break;
      }
      index += i;
      if (IS_RIGHT ? index < 0 : length <= index) {
        throw new $TypeError(REDUCE_EMPTY);
      }
    }
    for (; IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) {
      memo = callbackfn(memo, self[index], index, O);
    }
    return memo;
  };
};
module.exports = {
  left: createMethod(false),
  right: createMethod(true)
};

},{"../internals/a-callable":1,"../internals/indexed-object":93,"../internals/length-of-array-like":118,"../internals/to-object":199}],23:[function(require,module,exports){
'use strict';

var DESCRIPTORS = require('../internals/descriptors');
var isArray = require('../internals/is-array');
var $TypeError = TypeError;
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
var SILENT_ON_NON_WRITABLE_LENGTH_SET = DESCRIPTORS && !function () {
  if (this !== undefined) return true;
  try {
    Object.defineProperty([], 'length', {
      writable: false
    }).length = 1;
  } catch (error) {
    return error instanceof TypeError;
  }
}();
module.exports = SILENT_ON_NON_WRITABLE_LENGTH_SET ? function (O, length) {
  if (isArray(O) && !getOwnPropertyDescriptor(O, 'length').writable) {
    throw new $TypeError('Cannot set read only .length');
  }
  return O.length = length;
} : function (O, length) {
  return O.length = length;
};

},{"../internals/descriptors":50,"../internals/is-array":99}],24:[function(require,module,exports){
'use strict';

var uncurryThis = require('../internals/function-uncurry-this');
module.exports = uncurryThis([].slice);

},{"../internals/function-uncurry-this":79}],25:[function(require,module,exports){
'use strict';

var arraySlice = require('../internals/array-slice');
var floor = Math.floor;
var _sort = function sort(array, comparefn) {
  var length = array.length;
  if (length < 8) {
    var i = 1;
    var element, j;
    while (i < length) {
      j = i;
      element = array[i];
      while (j && comparefn(array[j - 1], element) > 0) {
        array[j] = array[--j];
      }
      if (j !== i++) array[j] = element;
    }
  } else {
    var middle = floor(length / 2);
    var left = _sort(arraySlice(array, 0, middle), comparefn);
    var right = _sort(arraySlice(array, middle), comparefn);
    var llength = left.length;
    var rlength = right.length;
    var lindex = 0;
    var rindex = 0;
    while (lindex < llength || rindex < rlength) {
      array[lindex + rindex] = lindex < llength && rindex < rlength ? comparefn(left[lindex], right[rindex]) <= 0 ? left[lindex++] : right[rindex++] : lindex < llength ? left[lindex++] : right[rindex++];
    }
  }
  return array;
};
module.exports = _sort;

},{"../internals/array-slice":24}],26:[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":99,"../internals/is-constructor":102,"../internals/is-object":107,"../internals/well-known-symbol":221}],27:[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":26}],28:[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":7,"../internals/iterator-close":113}],29:[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 next() {
      return {
        done: !!called++
      };
    },
    'return': function _return() {
      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 next() {
          return {
            done: ITERATION_SUPPORT = true
          };
        }
      };
    };
    exec(object);
  } catch (error) {}
  return ITERATION_SUPPORT;
};

},{"../internals/well-known-symbol":221}],30:[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":79}],31:[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 tryGet(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":30,"../internals/is-callable":101,"../internals/to-string-tag-support":204,"../internals/well-known-symbol":221}],32:[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 getConstructor(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 define(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 getEntry(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 _delete(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 get() {
        return getInternalState(this).size;
      }
    });
    return Constructor;
  },
  setStrong: function setStrong(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":6,"../internals/create-iter-result-object":39,"../internals/define-built-in-accessor":45,"../internals/define-built-ins":47,"../internals/descriptors":50,"../internals/function-bind-context":72,"../internals/internal-metadata":96,"../internals/internal-state":97,"../internals/is-null-or-undefined":106,"../internals/iterate":112,"../internals/iterator-define":115,"../internals/object-create":134,"../internals/set-species":172}],33:[function(require,module,exports){
'use strict';

var uncurryThis = require('../internals/function-uncurry-this');
var defineBuiltIns = require('../internals/define-built-ins');
var getWeakData = require('../internals/internal-metadata').getWeakData;
var anInstance = require('../internals/an-instance');
var anObject = require('../internals/an-object');
var isNullOrUndefined = require('../internals/is-null-or-undefined');
var isObject = require('../internals/is-object');
var iterate = require('../internals/iterate');
var ArrayIterationModule = require('../internals/array-iteration');
var hasOwn = require('../internals/has-own-property');
var InternalStateModule = require('../internals/internal-state');
var setInternalState = InternalStateModule.set;
var internalStateGetterFor = InternalStateModule.getterFor;
var find = ArrayIterationModule.find;
var findIndex = ArrayIterationModule.findIndex;
var splice = uncurryThis([].splice);
var id = 0;
var uncaughtFrozenStore = function uncaughtFrozenStore(state) {
  return state.frozen || (state.frozen = new UncaughtFrozenStore());
};
var UncaughtFrozenStore = function UncaughtFrozenStore() {
  this.entries = [];
};
var findUncaughtFrozen = function findUncaughtFrozen(store, key) {
  return find(store.entries, function (it) {
    return it[0] === key;
  });
};
UncaughtFrozenStore.prototype = {
  get: function get(key) {
    var entry = findUncaughtFrozen(this, key);
    if (entry) return entry[1];
  },
  has: function has(key) {
    return !!findUncaughtFrozen(this, key);
  },
  set: function set(key, value) {
    var entry = findUncaughtFrozen(this, key);
    if (entry) entry[1] = value;else this.entries.push([key, value]);
  },
  'delete': function _delete(key) {
    var index = findIndex(this.entries, function (it) {
      return it[0] === key;
    });
    if (~index) splice(this.entries, index, 1);
    return !!~index;
  }
};
module.exports = {
  getConstructor: function getConstructor(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) {
    var Constructor = wrapper(function (that, iterable) {
      anInstance(that, Prototype);
      setInternalState(that, {
        type: CONSTRUCTOR_NAME,
        id: id++,
        frozen: null
      });
      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 define(that, key, value) {
      var state = getInternalState(that);
      var data = getWeakData(anObject(key), true);
      if (data === true) uncaughtFrozenStore(state).set(key, value);else data[state.id] = value;
      return that;
    };
    defineBuiltIns(Prototype, {
      'delete': function _delete(key) {
        var state = getInternalState(this);
        if (!isObject(key)) return false;
        var data = getWeakData(key);
        if (data === true) return uncaughtFrozenStore(state)['delete'](key);
        return data && hasOwn(data, state.id) && delete data[state.id];
      },
      has: function has(key) {
        var state = getInternalState(this);
        if (!isObject(key)) return false;
        var data = getWeakData(key);
        if (data === true) return uncaughtFrozenStore(state).has(key);
        return data && hasOwn(data, state.id);
      }
    });
    defineBuiltIns(Prototype, IS_MAP ? {
      get: function get(key) {
        var state = getInternalState(this);
        if (isObject(key)) {
          var data = getWeakData(key);
          if (data === true) return uncaughtFrozenStore(state).get(key);
          if (data) return data[state.id];
        }
      },
      set: function set(key, value) {
        return define(this, key, value);
      }
    } : {
      add: function add(value) {
        return define(this, value, true);
      }
    });
    return Constructor;
  }
};

},{"../internals/an-instance":6,"../internals/an-object":7,"../internals/array-iteration":18,"../internals/define-built-ins":47,"../internals/function-uncurry-this":79,"../internals/has-own-property":87,"../internals/internal-metadata":96,"../internals/internal-state":97,"../internals/is-null-or-undefined":106,"../internals/is-object":107,"../internals/iterate":112}],34:[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 fixMethod(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":6,"../internals/check-correctness-of-iteration":29,"../internals/define-built-in":46,"../internals/export":66,"../internals/fails":67,"../internals/function-uncurry-this":79,"../internals/global-this":86,"../internals/inherit-if-required":94,"../internals/internal-metadata":96,"../internals/is-callable":101,"../internals/is-forced":104,"../internals/is-null-or-undefined":106,"../internals/is-object":107,"../internals/iterate":112,"../internals/set-to-string-tag":173}],35:[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":87,"../internals/object-define-property":136,"../internals/object-get-own-property-descriptor":137,"../internals/own-keys":152}],36:[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":221}],37:[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":67}],38:[function(require,module,exports){
'use strict';

var uncurryThis = require('../internals/function-uncurry-this');
var requireObjectCoercible = require('../internals/require-object-coercible');
var toString = require('../internals/to-string');
var quot = /"/g;
var replace = uncurryThis(''.replace);
module.exports = function (string, tag, attribute, value) {
  var S = toString(requireObjectCoercible(string));
  var p1 = '<' + tag;
  if (attribute !== '') p1 += ' ' + attribute + '="' + replace(toString(value), quot, '&quot;') + '"';
  return p1 + '>' + S + '</' + tag + '>';
};

},{"../internals/function-uncurry-this":79,"../internals/require-object-coercible":168,"../internals/to-string":205}],39:[function(require,module,exports){
'use strict';
module.exports = function (value, done) {
  return {
    value: value,
    done: done
  };
};

},{}],40:[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":41,"../internals/descriptors":50,"../internals/object-define-property":136}],41:[function(require,module,exports){
'use strict';

module.exports = function (bitmap, value) {
  return {
    enumerable: !(bitmap & 1),
    configurable: !(bitmap & 2),
    writable: !(bitmap & 4),
    value: value
  };
};

},{}],42:[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":41,"../internals/descriptors":50,"../internals/object-define-property":136}],43:[function(require,module,exports){
'use strict';

var uncurryThis = require('../internals/function-uncurry-this');
var fails = require('../internals/fails');
var padStart = require('../internals/string-pad').start;
var $RangeError = RangeError;
var $isFinite = isFinite;
var abs = Math.abs;
var DatePrototype = Date.prototype;
var nativeDateToISOString = DatePrototype.toISOString;
var thisTimeValue = uncurryThis(DatePrototype.getTime);
var getUTCDate = uncurryThis(DatePrototype.getUTCDate);
var getUTCFullYear = uncurryThis(DatePrototype.getUTCFullYear);
var getUTCHours = uncurryThis(DatePrototype.getUTCHours);
var getUTCMilliseconds = uncurryThis(DatePrototype.getUTCMilliseconds);
var getUTCMinutes = uncurryThis(DatePrototype.getUTCMinutes);
var getUTCMonth = uncurryThis(DatePrototype.getUTCMonth);
var getUTCSeconds = uncurryThis(DatePrototype.getUTCSeconds);
module.exports = fails(function () {
  return nativeDateToISOString.call(new Date(-5e13 - 1)) !== '0385-07-25T07:06:39.999Z';
}) || !fails(function () {
  nativeDateToISOString.call(new Date(NaN));
}) ? function toISOString() {
  if (!$isFinite(thisTimeValue(this))) throw new $RangeError('Invalid time value');
  var date = this;
  var year = getUTCFullYear(date);
  var milliseconds = getUTCMilliseconds(date);
  var sign = year < 0 ? '-' : year > 9999 ? '+' : '';
  return sign + padStart(abs(year), sign ? 6 : 4, 0) + '-' + padStart(getUTCMonth(date) + 1, 2, 0) + '-' + padStart(getUTCDate(date), 2, 0) + 'T' + padStart(getUTCHours(date), 2, 0) + ':' + padStart(getUTCMinutes(date), 2, 0) + ':' + padStart(getUTCSeconds(date), 2, 0) + '.' + padStart(milliseconds, 3, 0) + 'Z';
} : nativeDateToISOString;

},{"../internals/fails":67,"../internals/function-uncurry-this":79,"../internals/string-pad":181}],44:[function(require,module,exports){
'use strict';

var anObject = require('../internals/an-object');
var ordinaryToPrimitive = require('../internals/ordinary-to-primitive');
var $TypeError = TypeError;
module.exports = function (hint) {
  anObject(this);
  if (hint === 'string' || hint === 'default') hint = 'string';else if (hint !== 'number') throw new $TypeError('Incorrect hint');
  return ordinaryToPrimitive(this, hint);
};

},{"../internals/an-object":7,"../internals/ordinary-to-primitive":151}],45:[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":119,"../internals/object-define-property":136}],46:[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":48,"../internals/is-callable":101,"../internals/make-built-in":119,"../internals/object-define-property":136}],47:[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":46}],48:[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":86}],49:[function(require,module,exports){
'use strict';

var tryToString = require('../internals/try-to-string');
var $TypeError = TypeError;
module.exports = function (O, P) {
  if (!delete O[P]) throw new $TypeError('Cannot delete property ' + tryToString(P) + ' of ' + tryToString(O));
};

},{"../internals/try-to-string":207}],50:[function(require,module,exports){
'use strict';

var fails = require('../internals/fails');
module.exports = !fails(function () {
  return Object.defineProperty({}, 1, {
    get: function get() {
      return 7;
    }
  })[1] !== 7;
});

},{"../internals/fails":67}],51:[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":86,"../internals/is-object":107}],52:[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;
};

},{}],53:[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
};

},{}],54:[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":51}],55:[function(require,module,exports){
'use strict';
module.exports = ['constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf'];

},{}],56:[function(require,module,exports){
'use strict';

var userAgent = require('../internals/environment-user-agent');
var firefox = userAgent.match(/firefox\/(\d+)/i);
module.exports = !!firefox && +firefox[1];

},{"../internals/environment-user-agent":62}],57:[function(require,module,exports){
'use strict';

var UA = require('../internals/environment-user-agent');
module.exports = /MSIE|Trident/.test(UA);

},{"../internals/environment-user-agent":62}],58:[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":62}],59:[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":62}],60:[function(require,module,exports){
'use strict';

var ENVIRONMENT = require('../internals/environment');
module.exports = ENVIRONMENT === 'NODE';

},{"../internals/environment":65}],61:[function(require,module,exports){
'use strict';

var userAgent = require('../internals/environment-user-agent');
module.exports = /web0s(?!.*chrome)/i.test(userAgent);

},{"../internals/environment-user-agent":62}],62:[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":86}],63:[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":62,"../internals/global-this":86}],64:[function(require,module,exports){
'use strict';

var userAgent = require('../internals/environment-user-agent');
var webkit = userAgent.match(/AppleWebKit\/(\d+)\./);
module.exports = !!webkit && +webkit[1];

},{"../internals/environment-user-agent":62}],65:[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 userAgentStartsWith(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":30,"../internals/environment-user-agent":62,"../internals/global-this":86}],66:[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":35,"../internals/create-non-enumerable-property":40,"../internals/define-built-in":46,"../internals/define-global-property":48,"../internals/global-this":86,"../internals/is-forced":104,"../internals/object-get-own-property-descriptor":137}],67:[function(require,module,exports){
'use strict';

module.exports = function (exec) {
  try {
    return !!exec();
  } catch (error) {
    return true;
  }
};

},{}],68:[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":40,"../internals/define-built-in":46,"../internals/fails":67,"../internals/function-call":75,"../internals/regexp-exec":162,"../internals/well-known-symbol":221,"../modules/es.regexp.exec":348}],69:[function(require,module,exports){
'use strict';

var isArray = require('../internals/is-array');
var lengthOfArrayLike = require('../internals/length-of-array-like');
var doesNotExceedSafeInteger = require('../internals/does-not-exceed-safe-integer');
var bind = require('../internals/function-bind-context');
var _flattenIntoArray = function flattenIntoArray(target, original, source, sourceLen, start, depth, mapper, thisArg) {
  var targetIndex = start;
  var sourceIndex = 0;
  var mapFn = mapper ? bind(mapper, thisArg) : false;
  var element, elementLen;
  while (sourceIndex < sourceLen) {
    if (sourceIndex in source) {
      element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex];
      if (depth > 0 && isArray(element)) {
        elementLen = lengthOfArrayLike(element);
        targetIndex = _flattenIntoArray(target, original, element, elementLen, targetIndex, depth - 1) - 1;
      } else {
        doesNotExceedSafeInteger(targetIndex + 1);
        target[targetIndex] = element;
      }
      targetIndex++;
    }
    sourceIndex++;
  }
  return targetIndex;
};
module.exports = _flattenIntoArray;

},{"../internals/does-not-exceed-safe-integer":52,"../internals/function-bind-context":72,"../internals/is-array":99,"../internals/length-of-array-like":118}],70:[function(require,module,exports){
'use strict';

var fails = require('../internals/fails');
module.exports = !fails(function () {
  return Object.isExtensible(Object.preventExtensions({}));
});

},{"../internals/fails":67}],71:[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":73}],72:[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":1,"../internals/function-bind-native":73,"../internals/function-uncurry-this-clause":78}],73:[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":67}],74:[function(require,module,exports){
'use strict';

var uncurryThis = require('../internals/function-uncurry-this');
var aCallable = require('../internals/a-callable');
var isObject = require('../internals/is-object');
var hasOwn = require('../internals/has-own-property');
var arraySlice = require('../internals/array-slice');
var NATIVE_BIND = require('../internals/function-bind-native');
var $Function = Function;
var concat = uncurryThis([].concat);
var join = uncurryThis([].join);
var factories = {};
var construct = function construct(C, argsLength, args) {
  if (!hasOwn(factories, argsLength)) {
    var list = [];
    var i = 0;
    for (; i < argsLength; i++) list[i] = 'a[' + i + ']';
    factories[argsLength] = $Function('C,a', 'return new C(' + join(list, ',') + ')');
  }
  return factories[argsLength](C, args);
};
module.exports = NATIVE_BIND ? $Function.bind : function bind(that) {
  var F = aCallable(this);
  var Prototype = F.prototype;
  var partArgs = arraySlice(arguments, 1);
  var boundFunction = function bound() {
    var args = concat(partArgs, arraySlice(arguments));
    return this instanceof boundFunction ? construct(F, args.length, args) : F.apply(that, args);
  };
  if (isObject(Prototype)) boundFunction.prototype = Prototype;
  return boundFunction;
};

},{"../internals/a-callable":1,"../internals/array-slice":24,"../internals/function-bind-native":73,"../internals/function-uncurry-this":79,"../internals/has-own-property":87,"../internals/is-object":107}],75:[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":73}],76:[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":50,"../internals/has-own-property":87}],77:[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":1,"../internals/function-uncurry-this":79}],78:[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":30,"../internals/function-uncurry-this":79}],79:[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":73}],80:[function(require,module,exports){
'use strict';

var globalThis = require('../internals/global-this');
var isCallable = require('../internals/is-callable');
var aFunction = function aFunction(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":86,"../internals/is-callable":101}],81:[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":31,"../internals/get-method":84,"../internals/is-null-or-undefined":106,"../internals/iterators":117,"../internals/well-known-symbol":221}],82:[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":1,"../internals/an-object":7,"../internals/function-call":75,"../internals/get-iterator-method":81,"../internals/try-to-string":207}],83:[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":30,"../internals/function-uncurry-this":79,"../internals/is-array":99,"../internals/is-callable":101,"../internals/to-string":205}],84:[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":1,"../internals/is-null-or-undefined":106}],85:[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":79,"../internals/to-object":199}],86:[function(require,module,exports){
(function (global){(function (){
'use strict';

var check = function check(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 void 0 == 'object' && void 0) || function () {
  return this;
}() || Function('return this')();

}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{}],87:[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":79,"../internals/to-object":199}],88:[function(require,module,exports){
'use strict';

module.exports = {};

},{}],89:[function(require,module,exports){
'use strict';

module.exports = function (a, b) {
  try {
    arguments.length === 1 ? console.error(a) : console.error(a, b);
  } catch (error) {}
};

},{}],90:[function(require,module,exports){
'use strict';

var getBuiltIn = require('../internals/get-built-in');
module.exports = getBuiltIn('document', 'documentElement');

},{"../internals/get-built-in":80}],91:[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 get() {
      return 7;
    }
  }).a !== 7;
});

},{"../internals/descriptors":50,"../internals/document-create-element":51,"../internals/fails":67}],92:[function(require,module,exports){
'use strict';
var $Array = Array;
var abs = Math.abs;
var pow = Math.pow;
var floor = Math.floor;
var log = Math.log;
var LN2 = Math.LN2;
var pack = function pack(number, mantissaLength, bytes) {
  var buffer = $Array(bytes);
  var exponentLength = bytes * 8 - mantissaLength - 1;
  var eMax = (1 << exponentLength) - 1;
  var eBias = eMax >> 1;
  var rt = mantissaLength === 23 ? pow(2, -24) - pow(2, -77) : 0;
  var sign = number < 0 || number === 0 && 1 / number < 0 ? 1 : 0;
  var index = 0;
  var exponent, mantissa, c;
  number = abs(number);
  if (number !== number || number === Infinity) {
    mantissa = number !== number ? 1 : 0;
    exponent = eMax;
  } else {
    exponent = floor(log(number) / LN2);
    c = pow(2, -exponent);
    if (number * c < 1) {
      exponent--;
      c *= 2;
    }
    if (exponent + eBias >= 1) {
      number += rt / c;
    } else {
      number += rt * pow(2, 1 - eBias);
    }
    if (number * c >= 2) {
      exponent++;
      c /= 2;
    }
    if (exponent + eBias >= eMax) {
      mantissa = 0;
      exponent = eMax;
    } else if (exponent + eBias >= 1) {
      mantissa = (number * c - 1) * pow(2, mantissaLength);
      exponent += eBias;
    } else {
      mantissa = number * pow(2, eBias - 1) * pow(2, mantissaLength);
      exponent = 0;
    }
  }
  while (mantissaLength >= 8) {
    buffer[index++] = mantissa & 255;
    mantissa /= 256;
    mantissaLength -= 8;
  }
  exponent = exponent << mantissaLength | mantissa;
  exponentLength += mantissaLength;
  while (exponentLength > 0) {
    buffer[index++] = exponent & 255;
    exponent /= 256;
    exponentLength -= 8;
  }
  buffer[index - 1] |= sign * 128;
  return buffer;
};
var unpack = function unpack(buffer, mantissaLength) {
  var bytes = buffer.length;
  var exponentLength = bytes * 8 - mantissaLength - 1;
  var eMax = (1 << exponentLength) - 1;
  var eBias = eMax >> 1;
  var nBits = exponentLength - 7;
  var index = bytes - 1;
  var sign = buffer[index--];
  var exponent = sign & 127;
  var mantissa;
  sign >>= 7;
  while (nBits > 0) {
    exponent = exponent * 256 + buffer[index--];
    nBits -= 8;
  }
  mantissa = exponent & (1 << -nBits) - 1;
  exponent >>= -nBits;
  nBits += mantissaLength;
  while (nBits > 0) {
    mantissa = mantissa * 256 + buffer[index--];
    nBits -= 8;
  }
  if (exponent === 0) {
    exponent = 1 - eBias;
  } else if (exponent === eMax) {
    return mantissa ? NaN : sign ? -Infinity : Infinity;
  } else {
    mantissa += pow(2, mantissaLength);
    exponent -= eBias;
  }
  return (sign ? -1 : 1) * mantissa * pow(2, exponent - mantissaLength);
};
module.exports = {
  pack: pack,
  unpack: unpack
};

},{}],93:[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":30,"../internals/fails":67,"../internals/function-uncurry-this":79}],94:[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":101,"../internals/is-object":107,"../internals/object-set-prototype-of":148}],95:[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":79,"../internals/is-callable":101,"../internals/shared-store":175}],96:[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 setMetadata(it) {
  defineProperty(it, METADATA, {
    value: {
      objectID: 'O' + id++,
      weakData: {}
    }
  });
};
var fastKey = function fastKey(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 getWeakData(it, create) {
  if (!hasOwn(it, METADATA)) {
    if (!isExtensible(it)) return true;
    if (!create) return false;
    setMetadata(it);
  }
  return it[METADATA].weakData;
};
var onFreeze = function onFreeze(it) {
  if (FREEZING && REQUIRED && isExtensible(it) && !hasOwn(it, METADATA)) setMetadata(it);
  return it;
};
var enable = function enable() {
  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":66,"../internals/freezing":70,"../internals/function-uncurry-this":79,"../internals/has-own-property":87,"../internals/hidden-keys":88,"../internals/is-object":107,"../internals/object-define-property":136,"../internals/object-get-own-property-names":139,"../internals/object-get-own-property-names-external":138,"../internals/object-is-extensible":142,"../internals/uid":213}],97:[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 enforce(it) {
  return has(it) ? get(it) : set(it, {});
};
var getterFor = function getterFor(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 set(it, metadata) {
    if (store.has(it)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);
    metadata.facade = it;
    store.set(it, metadata);
    return metadata;
  };
  get = function get(it) {
    return store.get(it) || {};
  };
  has = function has(it) {
    return store.has(it);
  };
} else {
  var STATE = sharedKey('state');
  hiddenKeys[STATE] = true;
  set = function set(it, metadata) {
    if (hasOwn(it, STATE)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);
    metadata.facade = it;
    createNonEnumerableProperty(it, STATE, metadata);
    return metadata;
  };
  get = function get(it) {
    return hasOwn(it, STATE) ? it[STATE] : {};
  };
  has = function has(it) {
    return hasOwn(it, STATE);
  };
}
module.exports = {
  set: set,
  get: get,
  has: has,
  enforce: enforce,
  getterFor: getterFor
};

},{"../internals/create-non-enumerable-property":40,"../internals/global-this":86,"../internals/has-own-property":87,"../internals/hidden-keys":88,"../internals/is-object":107,"../internals/shared-key":174,"../internals/shared-store":175,"../internals/weak-map-basic-detection":218}],98:[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":117,"../internals/well-known-symbol":221}],99:[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":30}],100:[function(require,module,exports){
'use strict';

var classof = require('../internals/classof');
module.exports = function (it) {
  var klass = classof(it);
  return klass === 'BigInt64Array' || klass === 'BigUint64Array';
};

},{"../internals/classof":31}],101:[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';
};

},{}],102:[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 noop() {};
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":31,"../internals/fails":67,"../internals/function-uncurry-this":79,"../internals/get-built-in":80,"../internals/inspect-source":95,"../internals/is-callable":101}],103:[function(require,module,exports){
'use strict';

var hasOwn = require('../internals/has-own-property');
module.exports = function (descriptor) {
  return descriptor !== undefined && (hasOwn(descriptor, 'value') || hasOwn(descriptor, 'writable'));
};

},{"../internals/has-own-property":87}],104:[function(require,module,exports){
'use strict';

var fails = require('../internals/fails');
var isCallable = require('../internals/is-callable');
var replacement = /#|\.prototype\./;
var isForced = function isForced(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":67,"../internals/is-callable":101}],105:[function(require,module,exports){
'use strict';

var isObject = require('../internals/is-object');
var floor = Math.floor;
module.exports = Number.isInteger || function isInteger(it) {
  return !isObject(it) && isFinite(it) && floor(it) === it;
};

},{"../internals/is-object":107}],106:[function(require,module,exports){
'use strict';
module.exports = function (it) {
  return it === null || it === undefined;
};

},{}],107:[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":101}],108:[function(require,module,exports){
'use strict';

var isObject = require('../internals/is-object');
module.exports = function (argument) {
  return isObject(argument) || argument === null;
};

},{"../internals/is-object":107}],109:[function(require,module,exports){
'use strict';

module.exports = false;

},{}],110:[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":30,"../internals/is-object":107,"../internals/well-known-symbol":221}],111:[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":80,"../internals/is-callable":101,"../internals/object-is-prototype-of":143,"../internals/use-symbol-as-uid":215}],112:[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 Result(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 stop(condition) {
    if (iterator) iteratorClose(iterator, 'normal', condition);
    return new Result(true, condition);
  };
  var callFn = function callFn(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":7,"../internals/function-bind-context":72,"../internals/function-call":75,"../internals/get-iterator":82,"../internals/get-iterator-method":81,"../internals/is-array-iterator-method":98,"../internals/iterator-close":113,"../internals/length-of-array-like":118,"../internals/object-is-prototype-of":143,"../internals/try-to-string":207}],113:[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":7,"../internals/function-call":75,"../internals/get-method":84}],114:[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 returnThis() {
  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":41,"../internals/iterators":117,"../internals/iterators-core":116,"../internals/object-create":134,"../internals/set-to-string-tag":173}],115:[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 returnThis() {
  return this;
};
module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
  createIteratorConstructor(IteratorConstructor, NAME, next);
  var getIterationMethod = function getIterationMethod(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":40,"../internals/define-built-in":46,"../internals/export":66,"../internals/function-call":75,"../internals/function-name":76,"../internals/is-callable":101,"../internals/is-pure":109,"../internals/iterator-create-constructor":114,"../internals/iterators":117,"../internals/iterators-core":116,"../internals/object-get-prototype-of":141,"../internals/object-set-prototype-of":148,"../internals/set-to-string-tag":173,"../internals/well-known-symbol":221}],116:[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":46,"../internals/fails":67,"../internals/is-callable":101,"../internals/is-object":107,"../internals/is-pure":109,"../internals/object-create":134,"../internals/object-get-prototype-of":141,"../internals/well-known-symbol":221}],117:[function(require,module,exports){
'use strict';

module.exports = {};

},{}],118:[function(require,module,exports){
'use strict';

var toLength = require('../internals/to-length');
module.exports = function (obj) {
  return toLength(obj.length);
};

},{"../internals/to-length":198}],119:[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":50,"../internals/fails":67,"../internals/function-name":76,"../internals/function-uncurry-this":79,"../internals/has-own-property":87,"../internals/inspect-source":95,"../internals/internal-state":97,"../internals/is-callable":101}],120:[function(require,module,exports){
'use strict';
var $expm1 = Math.expm1;
var exp = Math.exp;
module.exports = !$expm1 || $expm1(10) > 22025.465794806719 || $expm1(10) < 22025.4657948067165168 || $expm1(-2e-17) !== -2e-17 ? function expm1(x) {
  var n = +x;
  return n === 0 ? n : n > -1e-6 && n < 1e-6 ? n + n * n / 2 : exp(n) - 1;
} : $expm1;

},{}],121:[function(require,module,exports){
'use strict';

var sign = require('../internals/math-sign');
var abs = Math.abs;
var EPSILON = 2.220446049250313e-16;
var INVERSE_EPSILON = 1 / EPSILON;
var roundTiesToEven = function roundTiesToEven(n) {
  return n + INVERSE_EPSILON - INVERSE_EPSILON;
};
module.exports = function (x, FLOAT_EPSILON, FLOAT_MAX_VALUE, FLOAT_MIN_VALUE) {
  var n = +x;
  var absolute = abs(n);
  var s = sign(n);
  if (absolute < FLOAT_MIN_VALUE) return s * roundTiesToEven(absolute / FLOAT_MIN_VALUE / FLOAT_EPSILON) * FLOAT_MIN_VALUE * FLOAT_EPSILON;
  var a = (1 + FLOAT_EPSILON / EPSILON) * absolute;
  var result = a - (a - absolute);
  if (result > FLOAT_MAX_VALUE || result !== result) return s * Infinity;
  return s * result;
};

},{"../internals/math-sign":125}],122:[function(require,module,exports){
'use strict';

var floatRound = require('../internals/math-float-round');
var FLOAT32_EPSILON = 1.1920928955078125e-7;
var FLOAT32_MAX_VALUE = 3.4028234663852886e+38;
var FLOAT32_MIN_VALUE = 1.1754943508222875e-38;
module.exports = Math.fround || function fround(x) {
  return floatRound(x, FLOAT32_EPSILON, FLOAT32_MAX_VALUE, FLOAT32_MIN_VALUE);
};

},{"../internals/math-float-round":121}],123:[function(require,module,exports){
'use strict';

var log = Math.log;
var LOG10E = Math.LOG10E;
module.exports = Math.log10 || function log10(x) {
  return log(x) * LOG10E;
};

},{}],124:[function(require,module,exports){
'use strict';

var log = Math.log;
module.exports = Math.log1p || function log1p(x) {
  var n = +x;
  return n > -1e-8 && n < 1e-8 ? n - n * n / 2 : log(1 + n);
};

},{}],125:[function(require,module,exports){
'use strict';
module.exports = Math.sign || function sign(x) {
  var n = +x;
  return n === 0 || n !== n ? n : n < 0 ? -1 : 1;
};

},{}],126:[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);
};

},{}],127:[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 flush() {
    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 notify() {
      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 notify() {
      then(flush);
    };
  } else if (IS_NODE) {
    notify = function notify() {
      process.nextTick(flush);
    };
  } else {
    macrotask = bind(macrotask, globalThis);
    notify = function notify() {
      macrotask(flush);
    };
  }
  microtask = function microtask(fn) {
    if (!queue.head) notify();
    queue.add(fn);
  };
}
module.exports = microtask;

},{"../internals/environment-is-ios":59,"../internals/environment-is-ios-pebble":58,"../internals/environment-is-node":60,"../internals/environment-is-webos-webkit":61,"../internals/function-bind-context":72,"../internals/global-this":86,"../internals/queue":160,"../internals/safe-get-built-in":169,"../internals/task":191}],128:[function(require,module,exports){
'use strict';

var aCallable = require('../internals/a-callable');
var $TypeError = TypeError;
var PromiseCapability = function PromiseCapability(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":1}],129:[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":110}],130:[function(require,module,exports){
'use strict';

var globalThis = require('../internals/global-this');
var globalIsFinite = globalThis.isFinite;
module.exports = Number.isFinite || function isFinite(it) {
  return typeof it == 'number' && globalIsFinite(it);
};

},{"../internals/global-this":86}],131:[function(require,module,exports){
'use strict';

var globalThis = require('../internals/global-this');
var fails = require('../internals/fails');
var uncurryThis = require('../internals/function-uncurry-this');
var toString = require('../internals/to-string');
var trim = require('../internals/string-trim').trim;
var whitespaces = require('../internals/whitespaces');
var charAt = uncurryThis(''.charAt);
var $parseFloat = globalThis.parseFloat;
var Symbol = globalThis.Symbol;
var ITERATOR = Symbol && Symbol.iterator;
var FORCED = 1 / $parseFloat(whitespaces + '-0') !== -Infinity || ITERATOR && !fails(function () {
  $parseFloat(Object(ITERATOR));
});
module.exports = FORCED ? function parseFloat(string) {
  var trimmedString = trim(toString(string));
  var result = $parseFloat(trimmedString);
  return result === 0 && charAt(trimmedString, 0) === '-' ? -0 : result;
} : $parseFloat;

},{"../internals/fails":67,"../internals/function-uncurry-this":79,"../internals/global-this":86,"../internals/string-trim":187,"../internals/to-string":205,"../internals/whitespaces":222}],132:[function(require,module,exports){
'use strict';

var globalThis = require('../internals/global-this');
var fails = require('../internals/fails');
var uncurryThis = require('../internals/function-uncurry-this');
var toString = require('../internals/to-string');
var trim = require('../internals/string-trim').trim;
var whitespaces = require('../internals/whitespaces');
var $parseInt = globalThis.parseInt;
var Symbol = globalThis.Symbol;
var ITERATOR = Symbol && Symbol.iterator;
var hex = /^[+-]?0x/i;
var exec = uncurryThis(hex.exec);
var FORCED = $parseInt(whitespaces + '08') !== 8 || $parseInt(whitespaces + '0x16') !== 22 || ITERATOR && !fails(function () {
  $parseInt(Object(ITERATOR));
});
module.exports = FORCED ? function parseInt(string, radix) {
  var S = trim(toString(string));
  return $parseInt(S, radix >>> 0 || (exec(hex, S) ? 16 : 10));
} : $parseInt;

},{"../internals/fails":67,"../internals/function-uncurry-this":79,"../internals/global-this":86,"../internals/string-trim":187,"../internals/to-string":205,"../internals/whitespaces":222}],133:[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 get() {
      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":50,"../internals/fails":67,"../internals/function-call":75,"../internals/function-uncurry-this":79,"../internals/indexed-object":93,"../internals/object-get-own-property-symbols":140,"../internals/object-keys":145,"../internals/object-property-is-enumerable":146,"../internals/to-object":199}],134:[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 EmptyConstructor() {};
var scriptTag = function scriptTag(content) {
  return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
};
var NullProtoObjectViaActiveX = function NullProtoObjectViaActiveX(activeXDocument) {
  activeXDocument.write(scriptTag(''));
  activeXDocument.close();
  var temp = activeXDocument.parentWindow.Object;
  activeXDocument = null;
  return temp;
};
var NullProtoObjectViaIFrame = function NullProtoObjectViaIFrame() {
  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 NullProtoObject() {
  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":7,"../internals/document-create-element":51,"../internals/enum-bug-keys":55,"../internals/hidden-keys":88,"../internals/html":90,"../internals/object-define-properties":135,"../internals/shared-key":174}],135:[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":7,"../internals/descriptors":50,"../internals/object-define-property":136,"../internals/object-keys":145,"../internals/to-indexed-object":196,"../internals/v8-prototype-define-bug":216}],136:[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":7,"../internals/descriptors":50,"../internals/ie8-dom-define":91,"../internals/to-property-key":203,"../internals/v8-prototype-define-bug":216}],137:[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":41,"../internals/descriptors":50,"../internals/function-call":75,"../internals/has-own-property":87,"../internals/ie8-dom-define":91,"../internals/object-property-is-enumerable":146,"../internals/to-indexed-object":196,"../internals/to-property-key":203}],138:[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 getWindowNames(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":24,"../internals/classof-raw":30,"../internals/object-get-own-property-names":139,"../internals/to-indexed-object":196}],139:[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":55,"../internals/object-keys-internal":144}],140:[function(require,module,exports){
'use strict';
exports.f = Object.getOwnPropertySymbols;

},{}],141:[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":37,"../internals/has-own-property":87,"../internals/is-callable":101,"../internals/shared-key":174,"../internals/to-object":199}],142:[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":9,"../internals/classof-raw":30,"../internals/fails":67,"../internals/is-object":107}],143:[function(require,module,exports){
'use strict';

var uncurryThis = require('../internals/function-uncurry-this');
module.exports = uncurryThis({}.isPrototypeOf);

},{"../internals/function-uncurry-this":79}],144:[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":17,"../internals/function-uncurry-this":79,"../internals/has-own-property":87,"../internals/hidden-keys":88,"../internals/to-indexed-object":196}],145:[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":55,"../internals/object-keys-internal":144}],146:[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;

},{}],147:[function(require,module,exports){
'use strict';
var IS_PURE = require('../internals/is-pure');
var globalThis = require('../internals/global-this');
var fails = require('../internals/fails');
var WEBKIT = require('../internals/environment-webkit-version');
module.exports = IS_PURE || !fails(function () {
  if (WEBKIT && WEBKIT < 535) return;
  var key = Math.random();
  __defineSetter__.call(null, key, function () {});
  delete globalThis[key];
});

},{"../internals/environment-webkit-version":64,"../internals/fails":67,"../internals/global-this":86,"../internals/is-pure":109}],148:[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":3,"../internals/function-uncurry-this-accessor":77,"../internals/is-object":107,"../internals/require-object-coercible":168}],149:[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 createMethod(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":50,"../internals/fails":67,"../internals/function-uncurry-this":79,"../internals/object-get-prototype-of":141,"../internals/object-keys":145,"../internals/object-property-is-enumerable":146,"../internals/to-indexed-object":196}],150:[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":31,"../internals/to-string-tag-support":204}],151:[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":75,"../internals/is-callable":101,"../internals/is-object":107}],152:[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":7,"../internals/function-uncurry-this":79,"../internals/get-built-in":80,"../internals/object-get-own-property-names":139,"../internals/object-get-own-property-symbols":140}],153:[function(require,module,exports){
'use strict';

var globalThis = require('../internals/global-this');
module.exports = globalThis;

},{"../internals/global-this":86}],154:[function(require,module,exports){
'use strict';

module.exports = function (exec) {
  try {
    return {
      error: false,
      value: exec()
    };
  } catch (error) {
    return {
      error: true,
      value: error
    };
  }
};

},{}],155:[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 FakePromise(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":65,"../internals/environment-v8-version":63,"../internals/global-this":86,"../internals/inspect-source":95,"../internals/is-callable":101,"../internals/is-forced":104,"../internals/is-pure":109,"../internals/promise-native-constructor":156,"../internals/well-known-symbol":221}],156:[function(require,module,exports){
'use strict';

var globalThis = require('../internals/global-this');
module.exports = globalThis.Promise;

},{"../internals/global-this":86}],157:[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":7,"../internals/is-object":107,"../internals/new-promise-capability":128}],158:[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":29,"../internals/promise-constructor-detection":155,"../internals/promise-native-constructor":156}],159:[function(require,module,exports){
'use strict';

var defineProperty = require('../internals/object-define-property').f;
module.exports = function (Target, Source, key) {
  key in Target || defineProperty(Target, key, {
    configurable: true,
    get: function get() {
      return Source[key];
    },
    set: function set(it) {
      Source[key] = it;
    }
  });
};

},{"../internals/object-define-property":136}],160:[function(require,module,exports){
'use strict';

var Queue = function Queue() {
  this.head = null;
  this.tail = null;
};
Queue.prototype = {
  add: function add(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 get() {
    var entry = this.head;
    if (entry) {
      var next = this.head = entry.next;
      if (next === null) this.tail = null;
      return entry.item;
    }
  }
};
module.exports = Queue;

},{}],161:[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":7,"../internals/classof-raw":30,"../internals/function-call":75,"../internals/is-callable":101,"../internals/regexp-exec":162}],162:[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":75,"../internals/function-uncurry-this":79,"../internals/internal-state":97,"../internals/object-create":134,"../internals/regexp-flags":163,"../internals/regexp-sticky-helpers":165,"../internals/regexp-unsupported-dot-all":166,"../internals/regexp-unsupported-ncg":167,"../internals/shared":176,"../internals/to-string":205}],163:[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":7}],164:[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":75,"../internals/has-own-property":87,"../internals/object-is-prototype-of":143,"../internals/regexp-flags":163}],165:[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":67,"../internals/global-this":86}],166:[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":67,"../internals/global-this":86}],167:[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":67,"../internals/global-this":86}],168:[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":106}],169:[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":50,"../internals/global-this":86}],170:[function(require,module,exports){
'use strict';
module.exports = Object.is || function is(x, y) {
  return x === y ? x !== 0 || 1 / x === 1 / y : x !== x && y !== y;
};

},{}],171:[function(require,module,exports){
'use strict';

var globalThis = require('../internals/global-this');
var apply = require('../internals/function-apply');
var isCallable = require('../internals/is-callable');
var ENVIRONMENT = require('../internals/environment');
var USER_AGENT = require('../internals/environment-user-agent');
var arraySlice = require('../internals/array-slice');
var validateArgumentsLength = require('../internals/validate-arguments-length');
var Function = globalThis.Function;
var WRAP = /MSIE .\./.test(USER_AGENT) || ENVIRONMENT === 'BUN' && function () {
  var version = globalThis.Bun.version.split('.');
  return version.length < 3 || version[0] === '0' && (version[1] < 3 || version[1] === '3' && version[2] === '0');
}();
module.exports = function (scheduler, hasTimeArg) {
  var firstParamIndex = hasTimeArg ? 2 : 1;
  return WRAP ? function (handler, timeout) {
    var boundArgs = validateArgumentsLength(arguments.length, 1) > firstParamIndex;
    var fn = isCallable(handler) ? handler : Function(handler);
    var params = boundArgs ? arraySlice(arguments, firstParamIndex) : [];
    var callback = boundArgs ? function () {
      apply(fn, this, params);
    } : fn;
    return hasTimeArg ? scheduler(callback, timeout) : scheduler(callback);
  } : scheduler;
};

},{"../internals/array-slice":24,"../internals/environment":65,"../internals/environment-user-agent":62,"../internals/function-apply":71,"../internals/global-this":86,"../internals/is-callable":101,"../internals/validate-arguments-length":217}],172:[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 get() {
        return this;
      }
    });
  }
};

},{"../internals/define-built-in-accessor":45,"../internals/descriptors":50,"../internals/get-built-in":80,"../internals/well-known-symbol":221}],173:[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":87,"../internals/object-define-property":136,"../internals/well-known-symbol":221}],174:[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":176,"../internals/uid":213}],175:[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":48,"../internals/global-this":86,"../internals/is-pure":109}],176:[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":175}],177:[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":2,"../internals/an-object":7,"../internals/is-null-or-undefined":106,"../internals/well-known-symbol":221}],178:[function(require,module,exports){
'use strict';

var fails = require('../internals/fails');
module.exports = function (METHOD_NAME) {
  return fails(function () {
    var test = ''[METHOD_NAME]('"');
    return test !== test.toLowerCase() || test.split('"').length > 3;
  });
};

},{"../internals/fails":67}],179:[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 createMethod(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":79,"../internals/require-object-coercible":168,"../internals/to-integer-or-infinity":197,"../internals/to-string":205}],180:[function(require,module,exports){
'use strict';
var userAgent = require('../internals/environment-user-agent');
module.exports = /Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(userAgent);

},{"../internals/environment-user-agent":62}],181:[function(require,module,exports){
'use strict';
var uncurryThis = require('../internals/function-uncurry-this');
var toLength = require('../internals/to-length');
var toString = require('../internals/to-string');
var $repeat = require('../internals/string-repeat');
var requireObjectCoercible = require('../internals/require-object-coercible');
var repeat = uncurryThis($repeat);
var stringSlice = uncurryThis(''.slice);
var ceil = Math.ceil;
var createMethod = function createMethod(IS_END) {
  return function ($this, maxLength, fillString) {
    var S = toString(requireObjectCoercible($this));
    var intMaxLength = toLength(maxLength);
    var stringLength = S.length;
    var fillStr = fillString === undefined ? ' ' : toString(fillString);
    var fillLen, stringFiller;
    if (intMaxLength <= stringLength || fillStr === '') return S;
    fillLen = intMaxLength - stringLength;
    stringFiller = repeat(fillStr, ceil(fillLen / fillStr.length));
    if (stringFiller.length > fillLen) stringFiller = stringSlice(stringFiller, 0, fillLen);
    return IS_END ? S + stringFiller : stringFiller + S;
  };
};
module.exports = {
  start: createMethod(false),
  end: createMethod(true)
};

},{"../internals/function-uncurry-this":79,"../internals/require-object-coercible":168,"../internals/string-repeat":183,"../internals/to-length":198,"../internals/to-string":205}],182:[function(require,module,exports){
'use strict';
var uncurryThis = require('../internals/function-uncurry-this');
var maxInt = 2147483647;
var base = 36;
var tMin = 1;
var tMax = 26;
var skew = 38;
var damp = 700;
var initialBias = 72;
var initialN = 128;
var delimiter = '-';
var regexNonASCII = /[^\0-\u007E]/;
var regexSeparators = /[.\u3002\uFF0E\uFF61]/g;
var OVERFLOW_ERROR = 'Overflow: input needs wider integers to process';
var baseMinusTMin = base - tMin;
var $RangeError = RangeError;
var exec = uncurryThis(regexSeparators.exec);
var floor = Math.floor;
var fromCharCode = String.fromCharCode;
var charCodeAt = uncurryThis(''.charCodeAt);
var join = uncurryThis([].join);
var push = uncurryThis([].push);
var replace = uncurryThis(''.replace);
var split = uncurryThis(''.split);
var toLowerCase = uncurryThis(''.toLowerCase);
var ucs2decode = function ucs2decode(string) {
  var output = [];
  var counter = 0;
  var length = string.length;
  while (counter < length) {
    var value = charCodeAt(string, counter++);
    if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
      var extra = charCodeAt(string, counter++);
      if ((extra & 0xFC00) === 0xDC00) {
        push(output, ((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
      } else {
        push(output, value);
        counter--;
      }
    } else {
      push(output, value);
    }
  }
  return output;
};
var digitToBasic = function digitToBasic(digit) {
  return digit + 22 + 75 * (digit < 26);
};
var adapt = function adapt(delta, numPoints, firstTime) {
  var k = 0;
  delta = firstTime ? floor(delta / damp) : delta >> 1;
  delta += floor(delta / numPoints);
  while (delta > baseMinusTMin * tMax >> 1) {
    delta = floor(delta / baseMinusTMin);
    k += base;
  }
  return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
};
var encode = function encode(input) {
  var output = [];
  input = ucs2decode(input);
  var inputLength = input.length;
  var n = initialN;
  var delta = 0;
  var bias = initialBias;
  var i, currentValue;
  for (i = 0; i < input.length; i++) {
    currentValue = input[i];
    if (currentValue < 0x80) {
      push(output, fromCharCode(currentValue));
    }
  }
  var basicLength = output.length;
  var handledCPCount = basicLength;
  if (basicLength) {
    push(output, delimiter);
  }
  while (handledCPCount < inputLength) {
    var m = maxInt;
    for (i = 0; i < input.length; i++) {
      currentValue = input[i];
      if (currentValue >= n && currentValue < m) {
        m = currentValue;
      }
    }
    var handledCPCountPlusOne = handledCPCount + 1;
    if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {
      throw new $RangeError(OVERFLOW_ERROR);
    }
    delta += (m - n) * handledCPCountPlusOne;
    n = m;
    for (i = 0; i < input.length; i++) {
      currentValue = input[i];
      if (currentValue < n && ++delta > maxInt) {
        throw new $RangeError(OVERFLOW_ERROR);
      }
      if (currentValue === n) {
        var q = delta;
        var k = base;
        while (true) {
          var t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;
          if (q < t) break;
          var qMinusT = q - t;
          var baseMinusT = base - t;
          push(output, fromCharCode(digitToBasic(t + qMinusT % baseMinusT)));
          q = floor(qMinusT / baseMinusT);
          k += base;
        }
        push(output, fromCharCode(digitToBasic(q)));
        bias = adapt(delta, handledCPCountPlusOne, handledCPCount === basicLength);
        delta = 0;
        handledCPCount++;
      }
    }
    delta++;
    n++;
  }
  return join(output, '');
};
module.exports = function (input) {
  var encoded = [];
  var labels = split(replace(toLowerCase(input), regexSeparators, "."), '.');
  var i, label;
  for (i = 0; i < labels.length; i++) {
    label = labels[i];
    push(encoded, exec(regexNonASCII, label) ? 'xn--' + encode(label) : label);
  }
  return join(encoded, '.');
};

},{"../internals/function-uncurry-this":79}],183:[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":168,"../internals/to-integer-or-infinity":197,"../internals/to-string":205}],184:[function(require,module,exports){
'use strict';

var $trimEnd = require('../internals/string-trim').end;
var forcedStringTrimMethod = require('../internals/string-trim-forced');
module.exports = forcedStringTrimMethod('trimEnd') ? function trimEnd() {
  return $trimEnd(this);
} : ''.trimEnd;

},{"../internals/string-trim":187,"../internals/string-trim-forced":185}],185:[function(require,module,exports){
'use strict';

var PROPER_FUNCTION_NAME = require('../internals/function-name').PROPER;
var fails = require('../internals/fails');
var whitespaces = require('../internals/whitespaces');
var non = "\u200B\x85\u180E";
module.exports = function (METHOD_NAME) {
  return fails(function () {
    return !!whitespaces[METHOD_NAME]() || non[METHOD_NAME]() !== non || PROPER_FUNCTION_NAME && whitespaces[METHOD_NAME].name !== METHOD_NAME;
  });
};

},{"../internals/fails":67,"../internals/function-name":76,"../internals/whitespaces":222}],186:[function(require,module,exports){
'use strict';

var $trimStart = require('../internals/string-trim').start;
var forcedStringTrimMethod = require('../internals/string-trim-forced');
module.exports = forcedStringTrimMethod('trimStart') ? function trimStart() {
  return $trimStart(this);
} : ''.trimStart;

},{"../internals/string-trim":187,"../internals/string-trim-forced":185}],187:[function(require,module,exports){
'use strict';

var uncurryThis = require('../internals/function-uncurry-this');
var requireObjectCoercible = require('../internals/require-object-coercible');
var toString = require('../internals/to-string');
var whitespaces = require('../internals/whitespaces');
var replace = uncurryThis(''.replace);
var ltrim = RegExp('^[' + whitespaces + ']+');
var rtrim = RegExp('(^|[^' + whitespaces + '])[' + whitespaces + ']+$');
var createMethod = function createMethod(TYPE) {
  return function ($this) {
    var string = toString(requireObjectCoercible($this));
    if (TYPE & 1) string = replace(string, ltrim, '');
    if (TYPE & 2) string = replace(string, rtrim, '$1');
    return string;
  };
};
module.exports = {
  start: createMethod(1),
  end: createMethod(2),
  trim: createMethod(3)
};

},{"../internals/function-uncurry-this":79,"../internals/require-object-coercible":168,"../internals/to-string":205,"../internals/whitespaces":222}],188:[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":63,"../internals/fails":67,"../internals/global-this":86}],189:[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":46,"../internals/function-call":75,"../internals/get-built-in":80,"../internals/well-known-symbol":221}],190:[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":188}],191:[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 run(id) {
  if (hasOwn(queue, id)) {
    var fn = queue[id];
    delete queue[id];
    fn();
  }
};
var runner = function runner(id) {
  return function () {
    run(id);
  };
};
var eventListener = function eventListener(event) {
  run(event.data);
};
var globalPostMessageDefer = function globalPostMessageDefer(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 defer(id) {
      process.nextTick(runner(id));
    };
  } else if (Dispatch && Dispatch.now) {
    defer = function defer(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 defer(id) {
      html.appendChild(createElement('script'))[ONREADYSTATECHANGE] = function () {
        html.removeChild(this);
        run(id);
      };
    };
  } else {
    defer = function defer(id) {
      setTimeout(runner(id), 0);
    };
  }
}
module.exports = {
  set: set,
  clear: clear
};

},{"../internals/array-slice":24,"../internals/document-create-element":51,"../internals/environment-is-ios":59,"../internals/environment-is-node":60,"../internals/fails":67,"../internals/function-apply":71,"../internals/function-bind-context":72,"../internals/global-this":86,"../internals/has-own-property":87,"../internals/html":90,"../internals/is-callable":101,"../internals/validate-arguments-length":217}],192:[function(require,module,exports){
'use strict';

var uncurryThis = require('../internals/function-uncurry-this');
module.exports = uncurryThis(1.0.valueOf);

},{"../internals/function-uncurry-this":79}],193:[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":197}],194:[function(require,module,exports){
'use strict';

var toPrimitive = require('../internals/to-primitive');
var $TypeError = TypeError;
module.exports = function (argument) {
  var prim = toPrimitive(argument, 'number');
  if (typeof prim == 'number') throw new $TypeError("Can't convert number to bigint");
  return BigInt(prim);
};

},{"../internals/to-primitive":202}],195:[function(require,module,exports){
'use strict';

var toIntegerOrInfinity = require('../internals/to-integer-or-infinity');
var toLength = require('../internals/to-length');
var $RangeError = RangeError;
module.exports = function (it) {
  if (it === undefined) return 0;
  var number = toIntegerOrInfinity(it);
  var length = toLength(number);
  if (number !== length) throw new $RangeError('Wrong length or index');
  return length;
};

},{"../internals/to-integer-or-infinity":197,"../internals/to-length":198}],196:[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":93,"../internals/require-object-coercible":168}],197:[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":126}],198:[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":197}],199:[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":168}],200:[function(require,module,exports){
'use strict';

var toPositiveInteger = require('../internals/to-positive-integer');
var $RangeError = RangeError;
module.exports = function (it, BYTES) {
  var offset = toPositiveInteger(it);
  if (offset % BYTES) throw new $RangeError('Wrong offset');
  return offset;
};

},{"../internals/to-positive-integer":201}],201:[function(require,module,exports){
'use strict';

var toIntegerOrInfinity = require('../internals/to-integer-or-infinity');
var $RangeError = RangeError;
module.exports = function (it) {
  var result = toIntegerOrInfinity(it);
  if (result < 0) throw new $RangeError("The argument can't be less than 0");
  return result;
};

},{"../internals/to-integer-or-infinity":197}],202:[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":75,"../internals/get-method":84,"../internals/is-object":107,"../internals/is-symbol":111,"../internals/ordinary-to-primitive":151,"../internals/well-known-symbol":221}],203:[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":111,"../internals/to-primitive":202}],204:[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":221}],205:[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":31}],206:[function(require,module,exports){
'use strict';

var round = Math.round;
module.exports = function (it) {
  var value = round(it);
  return value < 0 ? 0 : value > 0xFF ? 0xFF : value & 0xFF;
};

},{}],207:[function(require,module,exports){
'use strict';

var $String = String;
module.exports = function (argument) {
  try {
    return $String(argument);
  } catch (error) {
    return 'Object';
  }
};

},{}],208:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var globalThis = require('../internals/global-this');
var call = require('../internals/function-call');
var DESCRIPTORS = require('../internals/descriptors');
var TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS = require('../internals/typed-array-constructors-require-wrappers');
var ArrayBufferViewCore = require('../internals/array-buffer-view-core');
var ArrayBufferModule = require('../internals/array-buffer');
var anInstance = require('../internals/an-instance');
var createPropertyDescriptor = require('../internals/create-property-descriptor');
var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
var isIntegralNumber = require('../internals/is-integral-number');
var toLength = require('../internals/to-length');
var toIndex = require('../internals/to-index');
var toOffset = require('../internals/to-offset');
var toUint8Clamped = require('../internals/to-uint8-clamped');
var toPropertyKey = require('../internals/to-property-key');
var hasOwn = require('../internals/has-own-property');
var classof = require('../internals/classof');
var isObject = require('../internals/is-object');
var isSymbol = require('../internals/is-symbol');
var create = require('../internals/object-create');
var isPrototypeOf = require('../internals/object-is-prototype-of');
var setPrototypeOf = require('../internals/object-set-prototype-of');
var getOwnPropertyNames = require('../internals/object-get-own-property-names').f;
var typedArrayFrom = require('../internals/typed-array-from');
var forEach = require('../internals/array-iteration').forEach;
var setSpecies = require('../internals/set-species');
var defineBuiltInAccessor = require('../internals/define-built-in-accessor');
var definePropertyModule = require('../internals/object-define-property');
var getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor');
var arrayFromConstructorAndList = require('../internals/array-from-constructor-and-list');
var InternalStateModule = require('../internals/internal-state');
var inheritIfRequired = require('../internals/inherit-if-required');
var getInternalState = InternalStateModule.get;
var setInternalState = InternalStateModule.set;
var enforceInternalState = InternalStateModule.enforce;
var nativeDefineProperty = definePropertyModule.f;
var nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
var RangeError = globalThis.RangeError;
var ArrayBuffer = ArrayBufferModule.ArrayBuffer;
var ArrayBufferPrototype = ArrayBuffer.prototype;
var DataView = ArrayBufferModule.DataView;
var NATIVE_ARRAY_BUFFER_VIEWS = ArrayBufferViewCore.NATIVE_ARRAY_BUFFER_VIEWS;
var TYPED_ARRAY_TAG = ArrayBufferViewCore.TYPED_ARRAY_TAG;
var TypedArray = ArrayBufferViewCore.TypedArray;
var TypedArrayPrototype = ArrayBufferViewCore.TypedArrayPrototype;
var isTypedArray = ArrayBufferViewCore.isTypedArray;
var BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT';
var WRONG_LENGTH = 'Wrong length';
var addGetter = function addGetter(it, key) {
  defineBuiltInAccessor(it, key, {
    configurable: true,
    get: function get() {
      return getInternalState(this)[key];
    }
  });
};
var isArrayBuffer = function isArrayBuffer(it) {
  var klass;
  return isPrototypeOf(ArrayBufferPrototype, it) || (klass = classof(it)) === 'ArrayBuffer' || klass === 'SharedArrayBuffer';
};
var isTypedArrayIndex = function isTypedArrayIndex(target, key) {
  return isTypedArray(target) && !isSymbol(key) && key in target && isIntegralNumber(+key) && key >= 0;
};
var wrappedGetOwnPropertyDescriptor = function getOwnPropertyDescriptor(target, key) {
  key = toPropertyKey(key);
  return isTypedArrayIndex(target, key) ? createPropertyDescriptor(2, target[key]) : nativeGetOwnPropertyDescriptor(target, key);
};
var wrappedDefineProperty = function defineProperty(target, key, descriptor) {
  key = toPropertyKey(key);
  if (isTypedArrayIndex(target, key) && isObject(descriptor) && hasOwn(descriptor, 'value') && !hasOwn(descriptor, 'get') && !hasOwn(descriptor, 'set') && !descriptor.configurable && (!hasOwn(descriptor, 'writable') || descriptor.writable) && (!hasOwn(descriptor, 'enumerable') || descriptor.enumerable)) {
    target[key] = descriptor.value;
    return target;
  }
  return nativeDefineProperty(target, key, descriptor);
};
if (DESCRIPTORS) {
  if (!NATIVE_ARRAY_BUFFER_VIEWS) {
    getOwnPropertyDescriptorModule.f = wrappedGetOwnPropertyDescriptor;
    definePropertyModule.f = wrappedDefineProperty;
    addGetter(TypedArrayPrototype, 'buffer');
    addGetter(TypedArrayPrototype, 'byteOffset');
    addGetter(TypedArrayPrototype, 'byteLength');
    addGetter(TypedArrayPrototype, 'length');
  }
  $({
    target: 'Object',
    stat: true,
    forced: !NATIVE_ARRAY_BUFFER_VIEWS
  }, {
    getOwnPropertyDescriptor: wrappedGetOwnPropertyDescriptor,
    defineProperty: wrappedDefineProperty
  });
  module.exports = function (TYPE, wrapper, CLAMPED) {
    var BYTES = TYPE.match(/\d+/)[0] / 8;
    var CONSTRUCTOR_NAME = TYPE + (CLAMPED ? 'Clamped' : '') + 'Array';
    var GETTER = 'get' + TYPE;
    var SETTER = 'set' + TYPE;
    var NativeTypedArrayConstructor = globalThis[CONSTRUCTOR_NAME];
    var TypedArrayConstructor = NativeTypedArrayConstructor;
    var TypedArrayConstructorPrototype = TypedArrayConstructor && TypedArrayConstructor.prototype;
    var exported = {};
    var getter = function getter(that, index) {
      var data = getInternalState(that);
      return data.view[GETTER](index * BYTES + data.byteOffset, true);
    };
    var setter = function setter(that, index, value) {
      var data = getInternalState(that);
      data.view[SETTER](index * BYTES + data.byteOffset, CLAMPED ? toUint8Clamped(value) : value, true);
    };
    var addElement = function addElement(that, index) {
      nativeDefineProperty(that, index, {
        get: function get() {
          return getter(this, index);
        },
        set: function set(value) {
          return setter(this, index, value);
        },
        enumerable: true
      });
    };
    if (!NATIVE_ARRAY_BUFFER_VIEWS) {
      TypedArrayConstructor = wrapper(function (that, data, offset, $length) {
        anInstance(that, TypedArrayConstructorPrototype);
        var index = 0;
        var byteOffset = 0;
        var buffer, byteLength, length;
        if (!isObject(data)) {
          length = toIndex(data);
          byteLength = length * BYTES;
          buffer = new ArrayBuffer(byteLength);
        } else if (isArrayBuffer(data)) {
          buffer = data;
          byteOffset = toOffset(offset, BYTES);
          var $len = data.byteLength;
          if ($length === undefined) {
            if ($len % BYTES) throw new RangeError(WRONG_LENGTH);
            byteLength = $len - byteOffset;
            if (byteLength < 0) throw new RangeError(WRONG_LENGTH);
          } else {
            byteLength = toLength($length) * BYTES;
            if (byteLength + byteOffset > $len) throw new RangeError(WRONG_LENGTH);
          }
          length = byteLength / BYTES;
        } else if (isTypedArray(data)) {
          return arrayFromConstructorAndList(TypedArrayConstructor, data);
        } else {
          return call(typedArrayFrom, TypedArrayConstructor, data);
        }
        setInternalState(that, {
          buffer: buffer,
          byteOffset: byteOffset,
          byteLength: byteLength,
          length: length,
          view: new DataView(buffer)
        });
        while (index < length) addElement(that, index++);
      });
      if (setPrototypeOf) setPrototypeOf(TypedArrayConstructor, TypedArray);
      TypedArrayConstructorPrototype = TypedArrayConstructor.prototype = create(TypedArrayPrototype);
    } else if (TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS) {
      TypedArrayConstructor = wrapper(function (dummy, data, typedArrayOffset, $length) {
        anInstance(dummy, TypedArrayConstructorPrototype);
        return inheritIfRequired(function () {
          if (!isObject(data)) return new NativeTypedArrayConstructor(toIndex(data));
          if (isArrayBuffer(data)) return $length !== undefined ? new NativeTypedArrayConstructor(data, toOffset(typedArrayOffset, BYTES), $length) : typedArrayOffset !== undefined ? new NativeTypedArrayConstructor(data, toOffset(typedArrayOffset, BYTES)) : new NativeTypedArrayConstructor(data);
          if (isTypedArray(data)) return arrayFromConstructorAndList(TypedArrayConstructor, data);
          return call(typedArrayFrom, TypedArrayConstructor, data);
        }(), dummy, TypedArrayConstructor);
      });
      if (setPrototypeOf) setPrototypeOf(TypedArrayConstructor, TypedArray);
      forEach(getOwnPropertyNames(NativeTypedArrayConstructor), function (key) {
        if (!(key in TypedArrayConstructor)) {
          createNonEnumerableProperty(TypedArrayConstructor, key, NativeTypedArrayConstructor[key]);
        }
      });
      TypedArrayConstructor.prototype = TypedArrayConstructorPrototype;
    }
    if (TypedArrayConstructorPrototype.constructor !== TypedArrayConstructor) {
      createNonEnumerableProperty(TypedArrayConstructorPrototype, 'constructor', TypedArrayConstructor);
    }
    enforceInternalState(TypedArrayConstructorPrototype).TypedArrayConstructor = TypedArrayConstructor;
    if (TYPED_ARRAY_TAG) {
      createNonEnumerableProperty(TypedArrayConstructorPrototype, TYPED_ARRAY_TAG, CONSTRUCTOR_NAME);
    }
    var FORCED = TypedArrayConstructor !== NativeTypedArrayConstructor;
    exported[CONSTRUCTOR_NAME] = TypedArrayConstructor;
    $({
      global: true,
      constructor: true,
      forced: FORCED,
      sham: !NATIVE_ARRAY_BUFFER_VIEWS
    }, exported);
    if (!(BYTES_PER_ELEMENT in TypedArrayConstructor)) {
      createNonEnumerableProperty(TypedArrayConstructor, BYTES_PER_ELEMENT, BYTES);
    }
    if (!(BYTES_PER_ELEMENT in TypedArrayConstructorPrototype)) {
      createNonEnumerableProperty(TypedArrayConstructorPrototype, BYTES_PER_ELEMENT, BYTES);
    }
    setSpecies(CONSTRUCTOR_NAME);
  };
} else module.exports = function () {};

},{"../internals/an-instance":6,"../internals/array-buffer":11,"../internals/array-buffer-view-core":10,"../internals/array-from-constructor-and-list":15,"../internals/array-iteration":18,"../internals/classof":31,"../internals/create-non-enumerable-property":40,"../internals/create-property-descriptor":41,"../internals/define-built-in-accessor":45,"../internals/descriptors":50,"../internals/export":66,"../internals/function-call":75,"../internals/global-this":86,"../internals/has-own-property":87,"../internals/inherit-if-required":94,"../internals/internal-state":97,"../internals/is-integral-number":105,"../internals/is-object":107,"../internals/is-symbol":111,"../internals/object-create":134,"../internals/object-define-property":136,"../internals/object-get-own-property-descriptor":137,"../internals/object-get-own-property-names":139,"../internals/object-is-prototype-of":143,"../internals/object-set-prototype-of":148,"../internals/set-species":172,"../internals/to-index":195,"../internals/to-length":198,"../internals/to-offset":200,"../internals/to-property-key":203,"../internals/to-uint8-clamped":206,"../internals/typed-array-constructors-require-wrappers":209,"../internals/typed-array-from":211}],209:[function(require,module,exports){
'use strict';
var globalThis = require('../internals/global-this');
var fails = require('../internals/fails');
var checkCorrectnessOfIteration = require('../internals/check-correctness-of-iteration');
var NATIVE_ARRAY_BUFFER_VIEWS = require('../internals/array-buffer-view-core').NATIVE_ARRAY_BUFFER_VIEWS;
var ArrayBuffer = globalThis.ArrayBuffer;
var Int8Array = globalThis.Int8Array;
module.exports = !NATIVE_ARRAY_BUFFER_VIEWS || !fails(function () {
  Int8Array(1);
}) || !fails(function () {
  new Int8Array(-1);
}) || !checkCorrectnessOfIteration(function (iterable) {
  new Int8Array();
  new Int8Array(null);
  new Int8Array(1.5);
  new Int8Array(iterable);
}, true) || fails(function () {
  return new Int8Array(new ArrayBuffer(2), 1, undefined).length !== 1;
});

},{"../internals/array-buffer-view-core":10,"../internals/check-correctness-of-iteration":29,"../internals/fails":67,"../internals/global-this":86}],210:[function(require,module,exports){
'use strict';

var arrayFromConstructorAndList = require('../internals/array-from-constructor-and-list');
var typedArraySpeciesConstructor = require('../internals/typed-array-species-constructor');
module.exports = function (instance, list) {
  return arrayFromConstructorAndList(typedArraySpeciesConstructor(instance), list);
};

},{"../internals/array-from-constructor-and-list":15,"../internals/typed-array-species-constructor":212}],211:[function(require,module,exports){
'use strict';

var bind = require('../internals/function-bind-context');
var call = require('../internals/function-call');
var aConstructor = require('../internals/a-constructor');
var toObject = require('../internals/to-object');
var lengthOfArrayLike = require('../internals/length-of-array-like');
var getIterator = require('../internals/get-iterator');
var getIteratorMethod = require('../internals/get-iterator-method');
var isArrayIteratorMethod = require('../internals/is-array-iterator-method');
var isBigIntArray = require('../internals/is-big-int-array');
var aTypedArrayConstructor = require('../internals/array-buffer-view-core').aTypedArrayConstructor;
var toBigInt = require('../internals/to-big-int');
module.exports = function from(source) {
  var C = aConstructor(this);
  var O = toObject(source);
  var argumentsLength = arguments.length;
  var mapfn = argumentsLength > 1 ? arguments[1] : undefined;
  var mapping = mapfn !== undefined;
  var iteratorMethod = getIteratorMethod(O);
  var i, length, result, thisIsBigIntArray, value, step, iterator, next;
  if (iteratorMethod && !isArrayIteratorMethod(iteratorMethod)) {
    iterator = getIterator(O, iteratorMethod);
    next = iterator.next;
    O = [];
    while (!(step = call(next, iterator)).done) {
      O.push(step.value);
    }
  }
  if (mapping && argumentsLength > 2) {
    mapfn = bind(mapfn, arguments[2]);
  }
  length = lengthOfArrayLike(O);
  result = new (aTypedArrayConstructor(C))(length);
  thisIsBigIntArray = isBigIntArray(result);
  for (i = 0; length > i; i++) {
    value = mapping ? mapfn(O[i], i) : O[i];
    result[i] = thisIsBigIntArray ? toBigInt(value) : +value;
  }
  return result;
};

},{"../internals/a-constructor":2,"../internals/array-buffer-view-core":10,"../internals/function-bind-context":72,"../internals/function-call":75,"../internals/get-iterator":82,"../internals/get-iterator-method":81,"../internals/is-array-iterator-method":98,"../internals/is-big-int-array":100,"../internals/length-of-array-like":118,"../internals/to-big-int":194,"../internals/to-object":199}],212:[function(require,module,exports){
'use strict';

var ArrayBufferViewCore = require('../internals/array-buffer-view-core');
var speciesConstructor = require('../internals/species-constructor');
var aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor;
var getTypedArrayConstructor = ArrayBufferViewCore.getTypedArrayConstructor;
module.exports = function (originalArray) {
  return aTypedArrayConstructor(speciesConstructor(originalArray, getTypedArrayConstructor(originalArray)));
};

},{"../internals/array-buffer-view-core":10,"../internals/species-constructor":177}],213:[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":79}],214:[function(require,module,exports){
'use strict';

var fails = require('../internals/fails');
var wellKnownSymbol = require('../internals/well-known-symbol');
var DESCRIPTORS = require('../internals/descriptors');
var IS_PURE = require('../internals/is-pure');
var ITERATOR = wellKnownSymbol('iterator');
module.exports = !fails(function () {
  var url = new URL('b?a=1&b=2&c=3', 'https://a');
  var params = url.searchParams;
  var params2 = new URLSearchParams('a=1&a=2&b=3');
  var result = '';
  url.pathname = 'c%20d';
  params.forEach(function (value, key) {
    params['delete']('b');
    result += key + value;
  });
  params2['delete']('a', 2);
  params2['delete']('b', undefined);
  return IS_PURE && (!url.toJSON || !params2.has('a', 1) || params2.has('a', 2) || !params2.has('a', undefined) || params2.has('b')) || !params.size && (IS_PURE || !DESCRIPTORS) || !params.sort || url.href !== 'https://a/c%20d?a=1&c=3' || params.get('c') !== '3' || String(new URLSearchParams('?a=1')) !== 'a=1' || !params[ITERATOR] || new URL('https://a@b').username !== 'a' || new URLSearchParams(new URLSearchParams('a=b')).get('a') !== 'b' || new URL('https://тест').host !== 'xn--e1aybc' || new URL('https://a#б').hash !== '#%D0%B1' || result !== 'a1c3' || new URL('https://x', undefined).host !== 'x';
});

},{"../internals/descriptors":50,"../internals/fails":67,"../internals/is-pure":109,"../internals/well-known-symbol":221}],215:[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":188}],216:[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":50,"../internals/fails":67}],217:[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;
};

},{}],218:[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":86,"../internals/is-callable":101}],219:[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":87,"../internals/object-define-property":136,"../internals/path":153,"../internals/well-known-symbol-wrapped":220}],220:[function(require,module,exports){
'use strict';

var wellKnownSymbol = require('../internals/well-known-symbol');
exports.f = wellKnownSymbol;

},{"../internals/well-known-symbol":221}],221:[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":86,"../internals/has-own-property":87,"../internals/shared":176,"../internals/symbol-constructor-detection":188,"../internals/uid":213,"../internals/use-symbol-as-uid":215}],222:[function(require,module,exports){
'use strict';
module.exports = "\t\n\x0B\f\r \xA0\u1680\u2000\u2001\u2002" + "\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF";

},{}],223:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var globalThis = require('../internals/global-this');
var arrayBufferModule = require('../internals/array-buffer');
var setSpecies = require('../internals/set-species');
var ARRAY_BUFFER = 'ArrayBuffer';
var ArrayBuffer = arrayBufferModule[ARRAY_BUFFER];
var NativeArrayBuffer = globalThis[ARRAY_BUFFER];
$({
  global: true,
  constructor: true,
  forced: NativeArrayBuffer !== ArrayBuffer
}, {
  ArrayBuffer: ArrayBuffer
});
setSpecies(ARRAY_BUFFER);

},{"../internals/array-buffer":11,"../internals/export":66,"../internals/global-this":86,"../internals/set-species":172}],224:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var ArrayBufferViewCore = require('../internals/array-buffer-view-core');
var NATIVE_ARRAY_BUFFER_VIEWS = ArrayBufferViewCore.NATIVE_ARRAY_BUFFER_VIEWS;
$({
  target: 'ArrayBuffer',
  stat: true,
  forced: !NATIVE_ARRAY_BUFFER_VIEWS
}, {
  isView: ArrayBufferViewCore.isView
});

},{"../internals/array-buffer-view-core":10,"../internals/export":66}],225:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var uncurryThis = require('../internals/function-uncurry-this-clause');
var fails = require('../internals/fails');
var ArrayBufferModule = require('../internals/array-buffer');
var anObject = require('../internals/an-object');
var toAbsoluteIndex = require('../internals/to-absolute-index');
var toLength = require('../internals/to-length');
var speciesConstructor = require('../internals/species-constructor');
var ArrayBuffer = ArrayBufferModule.ArrayBuffer;
var DataView = ArrayBufferModule.DataView;
var DataViewPrototype = DataView.prototype;
var nativeArrayBufferSlice = uncurryThis(ArrayBuffer.prototype.slice);
var getUint8 = uncurryThis(DataViewPrototype.getUint8);
var setUint8 = uncurryThis(DataViewPrototype.setUint8);
var INCORRECT_SLICE = fails(function () {
  return !new ArrayBuffer(2).slice(1, undefined).byteLength;
});
$({
  target: 'ArrayBuffer',
  proto: true,
  unsafe: true,
  forced: INCORRECT_SLICE
}, {
  slice: function slice(start, end) {
    if (nativeArrayBufferSlice && end === undefined) {
      return nativeArrayBufferSlice(anObject(this), start);
    }
    var length = anObject(this).byteLength;
    var first = toAbsoluteIndex(start, length);
    var fin = toAbsoluteIndex(end === undefined ? length : end, length);
    var result = new (speciesConstructor(this, ArrayBuffer))(toLength(fin - first));
    var viewSource = new DataView(this);
    var viewTarget = new DataView(result);
    var index = 0;
    while (first < fin) {
      setUint8(viewTarget, index++, getUint8(viewSource, first++));
    }
    return result;
  }
});

},{"../internals/an-object":7,"../internals/array-buffer":11,"../internals/export":66,"../internals/fails":67,"../internals/function-uncurry-this-clause":78,"../internals/species-constructor":177,"../internals/to-absolute-index":193,"../internals/to-length":198}],226:[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 isConcatSpreadable(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":20,"../internals/array-species-create":27,"../internals/create-property":42,"../internals/does-not-exceed-safe-integer":52,"../internals/environment-v8-version":63,"../internals/export":66,"../internals/fails":67,"../internals/is-array":99,"../internals/is-object":107,"../internals/length-of-array-like":118,"../internals/to-object":199,"../internals/well-known-symbol":221}],227:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var copyWithin = require('../internals/array-copy-within');
var addToUnscopables = require('../internals/add-to-unscopables');
$({
  target: 'Array',
  proto: true
}, {
  copyWithin: copyWithin
});
addToUnscopables('copyWithin');

},{"../internals/add-to-unscopables":4,"../internals/array-copy-within":12,"../internals/export":66}],228:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var $every = require('../internals/array-iteration').every;
var arrayMethodIsStrict = require('../internals/array-method-is-strict');
var STRICT_METHOD = arrayMethodIsStrict('every');
$({
  target: 'Array',
  proto: true,
  forced: !STRICT_METHOD
}, {
  every: function every(callbackfn) {
    return $every(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  }
});

},{"../internals/array-iteration":18,"../internals/array-method-is-strict":21,"../internals/export":66}],229:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var fill = require('../internals/array-fill');
var addToUnscopables = require('../internals/add-to-unscopables');
$({
  target: 'Array',
  proto: true
}, {
  fill: fill
});
addToUnscopables('fill');

},{"../internals/add-to-unscopables":4,"../internals/array-fill":13,"../internals/export":66}],230:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var $filter = require('../internals/array-iteration').filter;
var arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support');
var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter');
$({
  target: 'Array',
  proto: true,
  forced: !HAS_SPECIES_SUPPORT
}, {
  filter: function filter(callbackfn) {
    return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  }
});

},{"../internals/array-iteration":18,"../internals/array-method-has-species-support":20,"../internals/export":66}],231:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var $findIndex = require('../internals/array-iteration').findIndex;
var addToUnscopables = require('../internals/add-to-unscopables');
var FIND_INDEX = 'findIndex';
var SKIPS_HOLES = true;
if (FIND_INDEX in []) Array(1)[FIND_INDEX](function () {
  SKIPS_HOLES = false;
});
$({
  target: 'Array',
  proto: true,
  forced: SKIPS_HOLES
}, {
  findIndex: function findIndex(callbackfn) {
    return $findIndex(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  }
});
addToUnscopables(FIND_INDEX);

},{"../internals/add-to-unscopables":4,"../internals/array-iteration":18,"../internals/export":66}],232:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var $find = require('../internals/array-iteration').find;
var addToUnscopables = require('../internals/add-to-unscopables');
var FIND = 'find';
var SKIPS_HOLES = true;
if (FIND in []) Array(1)[FIND](function () {
  SKIPS_HOLES = false;
});
$({
  target: 'Array',
  proto: true,
  forced: SKIPS_HOLES
}, {
  find: function find(callbackfn) {
    return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  }
});
addToUnscopables(FIND);

},{"../internals/add-to-unscopables":4,"../internals/array-iteration":18,"../internals/export":66}],233:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var flattenIntoArray = require('../internals/flatten-into-array');
var aCallable = require('../internals/a-callable');
var toObject = require('../internals/to-object');
var lengthOfArrayLike = require('../internals/length-of-array-like');
var arraySpeciesCreate = require('../internals/array-species-create');
$({
  target: 'Array',
  proto: true
}, {
  flatMap: function flatMap(callbackfn) {
    var O = toObject(this);
    var sourceLen = lengthOfArrayLike(O);
    var A;
    aCallable(callbackfn);
    A = arraySpeciesCreate(O, 0);
    A.length = flattenIntoArray(A, O, O, sourceLen, 0, 1, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
    return A;
  }
});

},{"../internals/a-callable":1,"../internals/array-species-create":27,"../internals/export":66,"../internals/flatten-into-array":69,"../internals/length-of-array-like":118,"../internals/to-object":199}],234:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var flattenIntoArray = require('../internals/flatten-into-array');
var toObject = require('../internals/to-object');
var lengthOfArrayLike = require('../internals/length-of-array-like');
var toIntegerOrInfinity = require('../internals/to-integer-or-infinity');
var arraySpeciesCreate = require('../internals/array-species-create');
$({
  target: 'Array',
  proto: true
}, {
  flat: function flat() {
    var depthArg = arguments.length ? arguments[0] : undefined;
    var O = toObject(this);
    var sourceLen = lengthOfArrayLike(O);
    var A = arraySpeciesCreate(O, 0);
    A.length = flattenIntoArray(A, O, O, sourceLen, 0, depthArg === undefined ? 1 : toIntegerOrInfinity(depthArg));
    return A;
  }
});

},{"../internals/array-species-create":27,"../internals/export":66,"../internals/flatten-into-array":69,"../internals/length-of-array-like":118,"../internals/to-integer-or-infinity":197,"../internals/to-object":199}],235:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var forEach = require('../internals/array-for-each');
$({
  target: 'Array',
  proto: true,
  forced: [].forEach !== forEach
}, {
  forEach: forEach
});

},{"../internals/array-for-each":14,"../internals/export":66}],236:[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":16,"../internals/check-correctness-of-iteration":29,"../internals/export":66}],237:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var $includes = require('../internals/array-includes').includes;
var fails = require('../internals/fails');
var addToUnscopables = require('../internals/add-to-unscopables');
var BROKEN_ON_SPARSE = fails(function () {
  return !Array(1).includes();
});
$({
  target: 'Array',
  proto: true,
  forced: BROKEN_ON_SPARSE
}, {
  includes: function includes(el) {
    return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
  }
});
addToUnscopables('includes');

},{"../internals/add-to-unscopables":4,"../internals/array-includes":17,"../internals/export":66,"../internals/fails":67}],238:[function(require,module,exports){
'use strict';
var $ = require('../internals/export');
var uncurryThis = require('../internals/function-uncurry-this-clause');
var $indexOf = require('../internals/array-includes').indexOf;
var arrayMethodIsStrict = require('../internals/array-method-is-strict');
var nativeIndexOf = uncurryThis([].indexOf);
var NEGATIVE_ZERO = !!nativeIndexOf && 1 / nativeIndexOf([1], 1, -0) < 0;
var FORCED = NEGATIVE_ZERO || !arrayMethodIsStrict('indexOf');
$({
  target: 'Array',
  proto: true,
  forced: FORCED
}, {
  indexOf: function indexOf(searchElement) {
    var fromIndex = arguments.length > 1 ? arguments[1] : undefined;
    return NEGATIVE_ZERO ? nativeIndexOf(this, searchElement, fromIndex) || 0 : $indexOf(this, searchElement, fromIndex);
  }
});

},{"../internals/array-includes":17,"../internals/array-method-is-strict":21,"../internals/export":66,"../internals/function-uncurry-this-clause":78}],239:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var isArray = require('../internals/is-array');
$({
  target: 'Array',
  stat: true
}, {
  isArray: isArray
});

},{"../internals/export":66,"../internals/is-array":99}],240:[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":4,"../internals/create-iter-result-object":39,"../internals/descriptors":50,"../internals/internal-state":97,"../internals/is-pure":109,"../internals/iterator-define":115,"../internals/iterators":117,"../internals/object-define-property":136,"../internals/to-indexed-object":196}],241:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var uncurryThis = require('../internals/function-uncurry-this');
var IndexedObject = require('../internals/indexed-object');
var toIndexedObject = require('../internals/to-indexed-object');
var arrayMethodIsStrict = require('../internals/array-method-is-strict');
var nativeJoin = uncurryThis([].join);
var ES3_STRINGS = IndexedObject !== Object;
var FORCED = ES3_STRINGS || !arrayMethodIsStrict('join', ',');
$({
  target: 'Array',
  proto: true,
  forced: FORCED
}, {
  join: function join(separator) {
    return nativeJoin(toIndexedObject(this), separator === undefined ? ',' : separator);
  }
});

},{"../internals/array-method-is-strict":21,"../internals/export":66,"../internals/function-uncurry-this":79,"../internals/indexed-object":93,"../internals/to-indexed-object":196}],242:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var lastIndexOf = require('../internals/array-last-index-of');
$({
  target: 'Array',
  proto: true,
  forced: lastIndexOf !== [].lastIndexOf
}, {
  lastIndexOf: lastIndexOf
});

},{"../internals/array-last-index-of":19,"../internals/export":66}],243:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var $map = require('../internals/array-iteration').map;
var arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support');
var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('map');
$({
  target: 'Array',
  proto: true,
  forced: !HAS_SPECIES_SUPPORT
}, {
  map: function map(callbackfn) {
    return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  }
});

},{"../internals/array-iteration":18,"../internals/array-method-has-species-support":20,"../internals/export":66}],244:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var fails = require('../internals/fails');
var isConstructor = require('../internals/is-constructor');
var createProperty = require('../internals/create-property');
var $Array = Array;
var ISNT_GENERIC = fails(function () {
  function F() {}
  return !($Array.of.call(F) instanceof F);
});
$({
  target: 'Array',
  stat: true,
  forced: ISNT_GENERIC
}, {
  of: function of() {
    var index = 0;
    var argumentsLength = arguments.length;
    var result = new (isConstructor(this) ? this : $Array)(argumentsLength);
    while (argumentsLength > index) createProperty(result, index, arguments[index++]);
    result.length = argumentsLength;
    return result;
  }
});

},{"../internals/create-property":42,"../internals/export":66,"../internals/fails":67,"../internals/is-constructor":102}],245:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var $reduceRight = require('../internals/array-reduce').right;
var arrayMethodIsStrict = require('../internals/array-method-is-strict');
var CHROME_VERSION = require('../internals/environment-v8-version');
var IS_NODE = require('../internals/environment-is-node');
var CHROME_BUG = !IS_NODE && CHROME_VERSION > 79 && CHROME_VERSION < 83;
var FORCED = CHROME_BUG || !arrayMethodIsStrict('reduceRight');
$({
  target: 'Array',
  proto: true,
  forced: FORCED
}, {
  reduceRight: function reduceRight(callbackfn) {
    return $reduceRight(this, callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined);
  }
});

},{"../internals/array-method-is-strict":21,"../internals/array-reduce":22,"../internals/environment-is-node":60,"../internals/environment-v8-version":63,"../internals/export":66}],246:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var $reduce = require('../internals/array-reduce').left;
var arrayMethodIsStrict = require('../internals/array-method-is-strict');
var CHROME_VERSION = require('../internals/environment-v8-version');
var IS_NODE = require('../internals/environment-is-node');
var CHROME_BUG = !IS_NODE && CHROME_VERSION > 79 && CHROME_VERSION < 83;
var FORCED = CHROME_BUG || !arrayMethodIsStrict('reduce');
$({
  target: 'Array',
  proto: true,
  forced: FORCED
}, {
  reduce: function reduce(callbackfn) {
    var length = arguments.length;
    return $reduce(this, callbackfn, length, length > 1 ? arguments[1] : undefined);
  }
});

},{"../internals/array-method-is-strict":21,"../internals/array-reduce":22,"../internals/environment-is-node":60,"../internals/environment-v8-version":63,"../internals/export":66}],247:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var isArray = require('../internals/is-array');
var isConstructor = require('../internals/is-constructor');
var isObject = require('../internals/is-object');
var toAbsoluteIndex = require('../internals/to-absolute-index');
var lengthOfArrayLike = require('../internals/length-of-array-like');
var toIndexedObject = require('../internals/to-indexed-object');
var createProperty = require('../internals/create-property');
var wellKnownSymbol = require('../internals/well-known-symbol');
var arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support');
var nativeSlice = require('../internals/array-slice');
var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('slice');
var SPECIES = wellKnownSymbol('species');
var $Array = Array;
var max = Math.max;
$({
  target: 'Array',
  proto: true,
  forced: !HAS_SPECIES_SUPPORT
}, {
  slice: function slice(start, end) {
    var O = toIndexedObject(this);
    var length = lengthOfArrayLike(O);
    var k = toAbsoluteIndex(start, length);
    var fin = toAbsoluteIndex(end === undefined ? length : end, length);
    var Constructor, result, n;
    if (isArray(O)) {
      Constructor = O.constructor;
      if (isConstructor(Constructor) && (Constructor === $Array || isArray(Constructor.prototype))) {
        Constructor = undefined;
      } else if (isObject(Constructor)) {
        Constructor = Constructor[SPECIES];
        if (Constructor === null) Constructor = undefined;
      }
      if (Constructor === $Array || Constructor === undefined) {
        return nativeSlice(O, k, fin);
      }
    }
    result = new (Constructor === undefined ? $Array : Constructor)(max(fin - k, 0));
    for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]);
    result.length = n;
    return result;
  }
});

},{"../internals/array-method-has-species-support":20,"../internals/array-slice":24,"../internals/create-property":42,"../internals/export":66,"../internals/is-array":99,"../internals/is-constructor":102,"../internals/is-object":107,"../internals/length-of-array-like":118,"../internals/to-absolute-index":193,"../internals/to-indexed-object":196,"../internals/well-known-symbol":221}],248:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var $some = require('../internals/array-iteration').some;
var arrayMethodIsStrict = require('../internals/array-method-is-strict');
var STRICT_METHOD = arrayMethodIsStrict('some');
$({
  target: 'Array',
  proto: true,
  forced: !STRICT_METHOD
}, {
  some: function some(callbackfn) {
    return $some(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  }
});

},{"../internals/array-iteration":18,"../internals/array-method-is-strict":21,"../internals/export":66}],249:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var uncurryThis = require('../internals/function-uncurry-this');
var aCallable = require('../internals/a-callable');
var toObject = require('../internals/to-object');
var lengthOfArrayLike = require('../internals/length-of-array-like');
var deletePropertyOrThrow = require('../internals/delete-property-or-throw');
var toString = require('../internals/to-string');
var fails = require('../internals/fails');
var internalSort = require('../internals/array-sort');
var arrayMethodIsStrict = require('../internals/array-method-is-strict');
var FF = require('../internals/environment-ff-version');
var IE_OR_EDGE = require('../internals/environment-is-ie-or-edge');
var V8 = require('../internals/environment-v8-version');
var WEBKIT = require('../internals/environment-webkit-version');
var test = [];
var nativeSort = uncurryThis(test.sort);
var push = uncurryThis(test.push);
var FAILS_ON_UNDEFINED = fails(function () {
  test.sort(undefined);
});
var FAILS_ON_NULL = fails(function () {
  test.sort(null);
});
var STRICT_METHOD = arrayMethodIsStrict('sort');
var STABLE_SORT = !fails(function () {
  if (V8) return V8 < 70;
  if (FF && FF > 3) return;
  if (IE_OR_EDGE) return true;
  if (WEBKIT) return WEBKIT < 603;
  var result = '';
  var code, chr, value, index;
  for (code = 65; code < 76; code++) {
    chr = String.fromCharCode(code);
    switch (code) {
      case 66:
      case 69:
      case 70:
      case 72:
        value = 3;
        break;
      case 68:
      case 71:
        value = 4;
        break;
      default:
        value = 2;
    }
    for (index = 0; index < 47; index++) {
      test.push({
        k: chr + index,
        v: value
      });
    }
  }
  test.sort(function (a, b) {
    return b.v - a.v;
  });
  for (index = 0; index < test.length; index++) {
    chr = test[index].k.charAt(0);
    if (result.charAt(result.length - 1) !== chr) result += chr;
  }
  return result !== 'DGBEFHACIJK';
});
var FORCED = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || !STRICT_METHOD || !STABLE_SORT;
var getSortCompare = function getSortCompare(comparefn) {
  return function (x, y) {
    if (y === undefined) return -1;
    if (x === undefined) return 1;
    if (comparefn !== undefined) return +comparefn(x, y) || 0;
    return toString(x) > toString(y) ? 1 : -1;
  };
};
$({
  target: 'Array',
  proto: true,
  forced: FORCED
}, {
  sort: function sort(comparefn) {
    if (comparefn !== undefined) aCallable(comparefn);
    var array = toObject(this);
    if (STABLE_SORT) return comparefn === undefined ? nativeSort(array) : nativeSort(array, comparefn);
    var items = [];
    var arrayLength = lengthOfArrayLike(array);
    var itemsLength, index;
    for (index = 0; index < arrayLength; index++) {
      if (index in array) push(items, array[index]);
    }
    internalSort(items, getSortCompare(comparefn));
    itemsLength = lengthOfArrayLike(items);
    index = 0;
    while (index < itemsLength) array[index] = items[index++];
    while (index < arrayLength) deletePropertyOrThrow(array, index++);
    return array;
  }
});

},{"../internals/a-callable":1,"../internals/array-method-is-strict":21,"../internals/array-sort":25,"../internals/delete-property-or-throw":49,"../internals/environment-ff-version":56,"../internals/environment-is-ie-or-edge":57,"../internals/environment-v8-version":63,"../internals/environment-webkit-version":64,"../internals/export":66,"../internals/fails":67,"../internals/function-uncurry-this":79,"../internals/length-of-array-like":118,"../internals/to-object":199,"../internals/to-string":205}],250:[function(require,module,exports){
'use strict';

var setSpecies = require('../internals/set-species');
setSpecies('Array');

},{"../internals/set-species":172}],251:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var toObject = require('../internals/to-object');
var toAbsoluteIndex = require('../internals/to-absolute-index');
var toIntegerOrInfinity = require('../internals/to-integer-or-infinity');
var lengthOfArrayLike = require('../internals/length-of-array-like');
var setArrayLength = require('../internals/array-set-length');
var doesNotExceedSafeInteger = require('../internals/does-not-exceed-safe-integer');
var arraySpeciesCreate = require('../internals/array-species-create');
var createProperty = require('../internals/create-property');
var deletePropertyOrThrow = require('../internals/delete-property-or-throw');
var arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support');
var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('splice');
var max = Math.max;
var min = Math.min;
$({
  target: 'Array',
  proto: true,
  forced: !HAS_SPECIES_SUPPORT
}, {
  splice: function splice(start, deleteCount) {
    var O = toObject(this);
    var len = lengthOfArrayLike(O);
    var actualStart = toAbsoluteIndex(start, len);
    var argumentsLength = arguments.length;
    var insertCount, actualDeleteCount, A, k, from, to;
    if (argumentsLength === 0) {
      insertCount = actualDeleteCount = 0;
    } else if (argumentsLength === 1) {
      insertCount = 0;
      actualDeleteCount = len - actualStart;
    } else {
      insertCount = argumentsLength - 2;
      actualDeleteCount = min(max(toIntegerOrInfinity(deleteCount), 0), len - actualStart);
    }
    doesNotExceedSafeInteger(len + insertCount - actualDeleteCount);
    A = arraySpeciesCreate(O, actualDeleteCount);
    for (k = 0; k < actualDeleteCount; k++) {
      from = actualStart + k;
      if (from in O) createProperty(A, k, O[from]);
    }
    A.length = actualDeleteCount;
    if (insertCount < actualDeleteCount) {
      for (k = actualStart; k < len - actualDeleteCount; k++) {
        from = k + actualDeleteCount;
        to = k + insertCount;
        if (from in O) O[to] = O[from];else deletePropertyOrThrow(O, to);
      }
      for (k = len; k > len - actualDeleteCount + insertCount; k--) deletePropertyOrThrow(O, k - 1);
    } else if (insertCount > actualDeleteCount) {
      for (k = len - actualDeleteCount; k > actualStart; k--) {
        from = k + actualDeleteCount - 1;
        to = k + insertCount - 1;
        if (from in O) O[to] = O[from];else deletePropertyOrThrow(O, to);
      }
    }
    for (k = 0; k < insertCount; k++) {
      O[k + actualStart] = arguments[k + 2];
    }
    setArrayLength(O, len - actualDeleteCount + insertCount);
    return A;
  }
});

},{"../internals/array-method-has-species-support":20,"../internals/array-set-length":23,"../internals/array-species-create":27,"../internals/create-property":42,"../internals/delete-property-or-throw":49,"../internals/does-not-exceed-safe-integer":52,"../internals/export":66,"../internals/length-of-array-like":118,"../internals/to-absolute-index":193,"../internals/to-integer-or-infinity":197,"../internals/to-object":199}],252:[function(require,module,exports){
'use strict';
var addToUnscopables = require('../internals/add-to-unscopables');
addToUnscopables('flatMap');

},{"../internals/add-to-unscopables":4}],253:[function(require,module,exports){
'use strict';
var addToUnscopables = require('../internals/add-to-unscopables');
addToUnscopables('flat');

},{"../internals/add-to-unscopables":4}],254:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var ArrayBufferModule = require('../internals/array-buffer');
var NATIVE_ARRAY_BUFFER = require('../internals/array-buffer-basic-detection');
$({
  global: true,
  constructor: true,
  forced: !NATIVE_ARRAY_BUFFER
}, {
  DataView: ArrayBufferModule.DataView
});

},{"../internals/array-buffer":11,"../internals/array-buffer-basic-detection":8,"../internals/export":66}],255:[function(require,module,exports){
'use strict';
require('../modules/es.data-view.constructor');

},{"../modules/es.data-view.constructor":254}],256:[function(require,module,exports){
'use strict';
var $ = require('../internals/export');
var uncurryThis = require('../internals/function-uncurry-this');
var $Date = Date;
var thisTimeValue = uncurryThis($Date.prototype.getTime);
$({
  target: 'Date',
  stat: true
}, {
  now: function now() {
    return thisTimeValue(new $Date());
  }
});

},{"../internals/export":66,"../internals/function-uncurry-this":79}],257:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var toISOString = require('../internals/date-to-iso-string');
$({
  target: 'Date',
  proto: true,
  forced: Date.prototype.toISOString !== toISOString
}, {
  toISOString: toISOString
});

},{"../internals/date-to-iso-string":43,"../internals/export":66}],258:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var fails = require('../internals/fails');
var toObject = require('../internals/to-object');
var toPrimitive = require('../internals/to-primitive');
var FORCED = fails(function () {
  return new Date(NaN).toJSON() !== null || Date.prototype.toJSON.call({
    toISOString: function toISOString() {
      return 1;
    }
  }) !== 1;
});
$({
  target: 'Date',
  proto: true,
  arity: 1,
  forced: FORCED
}, {
  toJSON: function toJSON(key) {
    var O = toObject(this);
    var pv = toPrimitive(O, 'number');
    return typeof pv == 'number' && !isFinite(pv) ? null : O.toISOString();
  }
});

},{"../internals/export":66,"../internals/fails":67,"../internals/to-object":199,"../internals/to-primitive":202}],259:[function(require,module,exports){
'use strict';

var hasOwn = require('../internals/has-own-property');
var defineBuiltIn = require('../internals/define-built-in');
var dateToPrimitive = require('../internals/date-to-primitive');
var wellKnownSymbol = require('../internals/well-known-symbol');
var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
var DatePrototype = Date.prototype;
if (!hasOwn(DatePrototype, TO_PRIMITIVE)) {
  defineBuiltIn(DatePrototype, TO_PRIMITIVE, dateToPrimitive);
}

},{"../internals/date-to-primitive":44,"../internals/define-built-in":46,"../internals/has-own-property":87,"../internals/well-known-symbol":221}],260:[function(require,module,exports){
'use strict';
var uncurryThis = require('../internals/function-uncurry-this');
var defineBuiltIn = require('../internals/define-built-in');
var DatePrototype = Date.prototype;
var INVALID_DATE = 'Invalid Date';
var TO_STRING = 'toString';
var nativeDateToString = uncurryThis(DatePrototype[TO_STRING]);
var thisTimeValue = uncurryThis(DatePrototype.getTime);
if (String(new Date(NaN)) !== INVALID_DATE) {
  defineBuiltIn(DatePrototype, TO_STRING, function toString() {
    var value = thisTimeValue(this);
    return value === value ? nativeDateToString(this) : INVALID_DATE;
  });
}

},{"../internals/define-built-in":46,"../internals/function-uncurry-this":79}],261:[function(require,module,exports){
'use strict';
var $ = require('../internals/export');
var bind = require('../internals/function-bind');
$({
  target: 'Function',
  proto: true,
  forced: Function.bind !== bind
}, {
  bind: bind
});

},{"../internals/export":66,"../internals/function-bind":74}],262:[function(require,module,exports){
'use strict';

var isCallable = require('../internals/is-callable');
var isObject = require('../internals/is-object');
var definePropertyModule = require('../internals/object-define-property');
var isPrototypeOf = require('../internals/object-is-prototype-of');
var wellKnownSymbol = require('../internals/well-known-symbol');
var makeBuiltIn = require('../internals/make-built-in');
var HAS_INSTANCE = wellKnownSymbol('hasInstance');
var FunctionPrototype = Function.prototype;
if (!(HAS_INSTANCE in FunctionPrototype)) {
  definePropertyModule.f(FunctionPrototype, HAS_INSTANCE, {
    value: makeBuiltIn(function (O) {
      if (!isCallable(this) || !isObject(O)) return false;
      var P = this.prototype;
      return isObject(P) ? isPrototypeOf(P, O) : O instanceof this;
    }, HAS_INSTANCE)
  });
}

},{"../internals/is-callable":101,"../internals/is-object":107,"../internals/make-built-in":119,"../internals/object-define-property":136,"../internals/object-is-prototype-of":143,"../internals/well-known-symbol":221}],263:[function(require,module,exports){
'use strict';

var DESCRIPTORS = require('../internals/descriptors');
var FUNCTION_NAME_EXISTS = require('../internals/function-name').EXISTS;
var uncurryThis = require('../internals/function-uncurry-this');
var defineBuiltInAccessor = require('../internals/define-built-in-accessor');
var FunctionPrototype = Function.prototype;
var functionToString = uncurryThis(FunctionPrototype.toString);
var nameRE = /function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/;
var regExpExec = uncurryThis(nameRE.exec);
var NAME = 'name';
if (DESCRIPTORS && !FUNCTION_NAME_EXISTS) {
  defineBuiltInAccessor(FunctionPrototype, NAME, {
    configurable: true,
    get: function get() {
      try {
        return regExpExec(nameRE, functionToString(this))[1];
      } catch (error) {
        return '';
      }
    }
  });
}

},{"../internals/define-built-in-accessor":45,"../internals/descriptors":50,"../internals/function-name":76,"../internals/function-uncurry-this":79}],264:[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 stringifyWithSymbolsFix(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 fixIllFormed(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":24,"../internals/export":66,"../internals/fails":67,"../internals/function-apply":71,"../internals/function-call":75,"../internals/function-uncurry-this":79,"../internals/get-built-in":80,"../internals/get-json-replacer-function":83,"../internals/is-callable":101,"../internals/is-symbol":111,"../internals/symbol-constructor-detection":188}],265:[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":86,"../internals/set-to-string-tag":173}],266:[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":34,"../internals/collection-strong":32}],267:[function(require,module,exports){
'use strict';
require('../modules/es.map.constructor');

},{"../modules/es.map.constructor":266}],268:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var log1p = require('../internals/math-log1p');
var $acosh = Math.acosh;
var log = Math.log;
var sqrt = Math.sqrt;
var LN2 = Math.LN2;
var FORCED = !$acosh || Math.floor($acosh(Number.MAX_VALUE)) !== 710 || $acosh(Infinity) !== Infinity;
$({
  target: 'Math',
  stat: true,
  forced: FORCED
}, {
  acosh: function acosh(x) {
    var n = +x;
    return n < 1 ? NaN : n > 94906265.62425156 ? log(n) + LN2 : log1p(n - 1 + sqrt(n - 1) * sqrt(n + 1));
  }
});

},{"../internals/export":66,"../internals/math-log1p":124}],269:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var $asinh = Math.asinh;
var log = Math.log;
var sqrt = Math.sqrt;
function asinh(x) {
  var n = +x;
  return !isFinite(n) || n === 0 ? n : n < 0 ? -asinh(-n) : log(n + sqrt(n * n + 1));
}
var FORCED = !($asinh && 1 / $asinh(0) > 0);
$({
  target: 'Math',
  stat: true,
  forced: FORCED
}, {
  asinh: asinh
});

},{"../internals/export":66}],270:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var $atanh = Math.atanh;
var log = Math.log;
var FORCED = !($atanh && 1 / $atanh(-0) < 0);
$({
  target: 'Math',
  stat: true,
  forced: FORCED
}, {
  atanh: function atanh(x) {
    var n = +x;
    return n === 0 ? n : log((1 + n) / (1 - n)) / 2;
  }
});

},{"../internals/export":66}],271:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var sign = require('../internals/math-sign');
var abs = Math.abs;
var pow = Math.pow;
$({
  target: 'Math',
  stat: true
}, {
  cbrt: function cbrt(x) {
    var n = +x;
    return sign(n) * pow(abs(n), 1 / 3);
  }
});

},{"../internals/export":66,"../internals/math-sign":125}],272:[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":66}],273:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var expm1 = require('../internals/math-expm1');
var $cosh = Math.cosh;
var abs = Math.abs;
var E = Math.E;
var FORCED = !$cosh || $cosh(710) === Infinity;
$({
  target: 'Math',
  stat: true,
  forced: FORCED
}, {
  cosh: function cosh(x) {
    var t = expm1(abs(x) - 1) + 1;
    return (t + 1 / (t * E * E)) * (E / 2);
  }
});

},{"../internals/export":66,"../internals/math-expm1":120}],274:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var expm1 = require('../internals/math-expm1');
$({
  target: 'Math',
  stat: true,
  forced: expm1 !== Math.expm1
}, {
  expm1: expm1
});

},{"../internals/export":66,"../internals/math-expm1":120}],275:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var fround = require('../internals/math-fround');
$({
  target: 'Math',
  stat: true
}, {
  fround: fround
});

},{"../internals/export":66,"../internals/math-fround":122}],276:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var $hypot = Math.hypot;
var abs = Math.abs;
var sqrt = Math.sqrt;
var FORCED = !!$hypot && $hypot(Infinity, NaN) !== Infinity;
$({
  target: 'Math',
  stat: true,
  arity: 2,
  forced: FORCED
}, {
  hypot: function hypot(value1, value2) {
    var sum = 0;
    var i = 0;
    var aLen = arguments.length;
    var larg = 0;
    var arg, div;
    while (i < aLen) {
      arg = abs(arguments[i++]);
      if (larg < arg) {
        div = larg / arg;
        sum = sum * div * div + 1;
        larg = arg;
      } else if (arg > 0) {
        div = arg / larg;
        sum += div * div;
      } else sum += arg;
    }
    return larg === Infinity ? Infinity : larg * sqrt(sum);
  }
});

},{"../internals/export":66}],277:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var fails = require('../internals/fails');
var $imul = Math.imul;
var FORCED = fails(function () {
  return $imul(0xFFFFFFFF, 5) !== -5 || $imul.length !== 2;
});
$({
  target: 'Math',
  stat: true,
  forced: FORCED
}, {
  imul: function imul(x, y) {
    var UINT16 = 0xFFFF;
    var xn = +x;
    var yn = +y;
    var xl = UINT16 & xn;
    var yl = UINT16 & yn;
    return 0 | xl * yl + ((UINT16 & xn >>> 16) * yl + xl * (UINT16 & yn >>> 16) << 16 >>> 0);
  }
});

},{"../internals/export":66,"../internals/fails":67}],278:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var log10 = require('../internals/math-log10');
$({
  target: 'Math',
  stat: true
}, {
  log10: log10
});

},{"../internals/export":66,"../internals/math-log10":123}],279:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var log1p = require('../internals/math-log1p');
$({
  target: 'Math',
  stat: true
}, {
  log1p: log1p
});

},{"../internals/export":66,"../internals/math-log1p":124}],280:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var log = Math.log;
var LN2 = Math.LN2;
$({
  target: 'Math',
  stat: true
}, {
  log2: function log2(x) {
    return log(x) / LN2;
  }
});

},{"../internals/export":66}],281:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var sign = require('../internals/math-sign');
$({
  target: 'Math',
  stat: true
}, {
  sign: sign
});

},{"../internals/export":66,"../internals/math-sign":125}],282:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var fails = require('../internals/fails');
var expm1 = require('../internals/math-expm1');
var abs = Math.abs;
var exp = Math.exp;
var E = Math.E;
var FORCED = fails(function () {
  return Math.sinh(-2e-17) !== -2e-17;
});
$({
  target: 'Math',
  stat: true,
  forced: FORCED
}, {
  sinh: function sinh(x) {
    var n = +x;
    return abs(n) < 1 ? (expm1(n) - expm1(-n)) / 2 : (exp(n - 1) - exp(-n - 1)) * (E / 2);
  }
});

},{"../internals/export":66,"../internals/fails":67,"../internals/math-expm1":120}],283:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var expm1 = require('../internals/math-expm1');
var exp = Math.exp;
$({
  target: 'Math',
  stat: true
}, {
  tanh: function tanh(x) {
    var n = +x;
    var a = expm1(n);
    var b = expm1(-n);
    return a === Infinity ? 1 : b === Infinity ? -1 : (a - b) / (exp(n) + exp(-n));
  }
});

},{"../internals/export":66,"../internals/math-expm1":120}],284:[function(require,module,exports){
'use strict';

var setToStringTag = require('../internals/set-to-string-tag');
setToStringTag(Math, 'Math', true);

},{"../internals/set-to-string-tag":173}],285:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var trunc = require('../internals/math-trunc');
$({
  target: 'Math',
  stat: true
}, {
  trunc: trunc
});

},{"../internals/export":66,"../internals/math-trunc":126}],286:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var IS_PURE = require('../internals/is-pure');
var DESCRIPTORS = require('../internals/descriptors');
var globalThis = require('../internals/global-this');
var path = require('../internals/path');
var uncurryThis = require('../internals/function-uncurry-this');
var isForced = require('../internals/is-forced');
var hasOwn = require('../internals/has-own-property');
var inheritIfRequired = require('../internals/inherit-if-required');
var isPrototypeOf = require('../internals/object-is-prototype-of');
var isSymbol = require('../internals/is-symbol');
var toPrimitive = require('../internals/to-primitive');
var fails = require('../internals/fails');
var getOwnPropertyNames = require('../internals/object-get-own-property-names').f;
var getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;
var defineProperty = require('../internals/object-define-property').f;
var thisNumberValue = require('../internals/this-number-value');
var trim = require('../internals/string-trim').trim;
var NUMBER = 'Number';
var NativeNumber = globalThis[NUMBER];
var PureNumberNamespace = path[NUMBER];
var NumberPrototype = NativeNumber.prototype;
var TypeError = globalThis.TypeError;
var stringSlice = uncurryThis(''.slice);
var charCodeAt = uncurryThis(''.charCodeAt);
var toNumeric = function toNumeric(value) {
  var primValue = toPrimitive(value, 'number');
  return typeof primValue == 'bigint' ? primValue : toNumber(primValue);
};
var toNumber = function toNumber(argument) {
  var it = toPrimitive(argument, 'number');
  var first, third, radix, maxCode, digits, length, index, code;
  if (isSymbol(it)) throw new TypeError('Cannot convert a Symbol value to a number');
  if (typeof it == 'string' && it.length > 2) {
    it = trim(it);
    first = charCodeAt(it, 0);
    if (first === 43 || first === 45) {
      third = charCodeAt(it, 2);
      if (third === 88 || third === 120) return NaN;
    } else if (first === 48) {
      switch (charCodeAt(it, 1)) {
        case 66:
        case 98:
          radix = 2;
          maxCode = 49;
          break;
        case 79:
        case 111:
          radix = 8;
          maxCode = 55;
          break;
        default:
          return +it;
      }
      digits = stringSlice(it, 2);
      length = digits.length;
      for (index = 0; index < length; index++) {
        code = charCodeAt(digits, index);
        if (code < 48 || code > maxCode) return NaN;
      }
      return parseInt(digits, radix);
    }
  }
  return +it;
};
var FORCED = isForced(NUMBER, !NativeNumber(' 0o1') || !NativeNumber('0b1') || NativeNumber('+0x1'));
var calledWithNew = function calledWithNew(dummy) {
  return isPrototypeOf(NumberPrototype, dummy) && fails(function () {
    thisNumberValue(dummy);
  });
};
var NumberWrapper = function Number(value) {
  var n = arguments.length < 1 ? 0 : NativeNumber(toNumeric(value));
  return calledWithNew(this) ? inheritIfRequired(Object(n), this, NumberWrapper) : n;
};
NumberWrapper.prototype = NumberPrototype;
if (FORCED && !IS_PURE) NumberPrototype.constructor = NumberWrapper;
$({
  global: true,
  constructor: true,
  wrap: true,
  forced: FORCED
}, {
  Number: NumberWrapper
});
var copyConstructorProperties = function copyConstructorProperties(target, source) {
  for (var keys = DESCRIPTORS ? getOwnPropertyNames(source) : ('MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' + 'EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,' + 'fromString,range').split(','), j = 0, key; keys.length > j; j++) {
    if (hasOwn(source, key = keys[j]) && !hasOwn(target, key)) {
      defineProperty(target, key, getOwnPropertyDescriptor(source, key));
    }
  }
};
if (IS_PURE && PureNumberNamespace) copyConstructorProperties(path[NUMBER], PureNumberNamespace);
if (FORCED || IS_PURE) copyConstructorProperties(path[NUMBER], NativeNumber);

},{"../internals/descriptors":50,"../internals/export":66,"../internals/fails":67,"../internals/function-uncurry-this":79,"../internals/global-this":86,"../internals/has-own-property":87,"../internals/inherit-if-required":94,"../internals/is-forced":104,"../internals/is-pure":109,"../internals/is-symbol":111,"../internals/object-define-property":136,"../internals/object-get-own-property-descriptor":137,"../internals/object-get-own-property-names":139,"../internals/object-is-prototype-of":143,"../internals/path":153,"../internals/string-trim":187,"../internals/this-number-value":192,"../internals/to-primitive":202}],287:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
$({
  target: 'Number',
  stat: true,
  nonConfigurable: true,
  nonWritable: true
}, {
  EPSILON: Math.pow(2, -52)
});

},{"../internals/export":66}],288:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var numberIsFinite = require('../internals/number-is-finite');
$({
  target: 'Number',
  stat: true
}, {
  isFinite: numberIsFinite
});

},{"../internals/export":66,"../internals/number-is-finite":130}],289:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var isIntegralNumber = require('../internals/is-integral-number');
$({
  target: 'Number',
  stat: true
}, {
  isInteger: isIntegralNumber
});

},{"../internals/export":66,"../internals/is-integral-number":105}],290:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
$({
  target: 'Number',
  stat: true
}, {
  isNaN: function isNaN(number) {
    return number !== number;
  }
});

},{"../internals/export":66}],291:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var isIntegralNumber = require('../internals/is-integral-number');
var abs = Math.abs;
$({
  target: 'Number',
  stat: true
}, {
  isSafeInteger: function isSafeInteger(number) {
    return isIntegralNumber(number) && abs(number) <= 0x1FFFFFFFFFFFFF;
  }
});

},{"../internals/export":66,"../internals/is-integral-number":105}],292:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
$({
  target: 'Number',
  stat: true,
  nonConfigurable: true,
  nonWritable: true
}, {
  MAX_SAFE_INTEGER: 0x1FFFFFFFFFFFFF
});

},{"../internals/export":66}],293:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
$({
  target: 'Number',
  stat: true,
  nonConfigurable: true,
  nonWritable: true
}, {
  MIN_SAFE_INTEGER: -0x1FFFFFFFFFFFFF
});

},{"../internals/export":66}],294:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var parseFloat = require('../internals/number-parse-float');
$({
  target: 'Number',
  stat: true,
  forced: Number.parseFloat !== parseFloat
}, {
  parseFloat: parseFloat
});

},{"../internals/export":66,"../internals/number-parse-float":131}],295:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var parseInt = require('../internals/number-parse-int');
$({
  target: 'Number',
  stat: true,
  forced: Number.parseInt !== parseInt
}, {
  parseInt: parseInt
});

},{"../internals/export":66,"../internals/number-parse-int":132}],296:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var uncurryThis = require('../internals/function-uncurry-this');
var toIntegerOrInfinity = require('../internals/to-integer-or-infinity');
var thisNumberValue = require('../internals/this-number-value');
var $repeat = require('../internals/string-repeat');
var fails = require('../internals/fails');
var $RangeError = RangeError;
var $String = String;
var floor = Math.floor;
var repeat = uncurryThis($repeat);
var stringSlice = uncurryThis(''.slice);
var nativeToFixed = uncurryThis(1.0.toFixed);
var _pow = function pow(x, n, acc) {
  return n === 0 ? acc : n % 2 === 1 ? _pow(x, n - 1, acc * x) : _pow(x * x, n / 2, acc);
};
var log = function log(x) {
  var n = 0;
  var x2 = x;
  while (x2 >= 4096) {
    n += 12;
    x2 /= 4096;
  }
  while (x2 >= 2) {
    n += 1;
    x2 /= 2;
  }
  return n;
};
var multiply = function multiply(data, n, c) {
  var index = -1;
  var c2 = c;
  while (++index < 6) {
    c2 += n * data[index];
    data[index] = c2 % 1e7;
    c2 = floor(c2 / 1e7);
  }
};
var divide = function divide(data, n) {
  var index = 6;
  var c = 0;
  while (--index >= 0) {
    c += data[index];
    data[index] = floor(c / n);
    c = c % n * 1e7;
  }
};
var dataToString = function dataToString(data) {
  var index = 6;
  var s = '';
  while (--index >= 0) {
    if (s !== '' || index === 0 || data[index] !== 0) {
      var t = $String(data[index]);
      s = s === '' ? t : s + repeat('0', 7 - t.length) + t;
    }
  }
  return s;
};
var FORCED = fails(function () {
  return nativeToFixed(0.00008, 3) !== '0.000' || nativeToFixed(0.9, 0) !== '1' || nativeToFixed(1.255, 2) !== '1.25' || nativeToFixed(1000000000000000128.0, 0) !== '1000000000000000128';
}) || !fails(function () {
  nativeToFixed({});
});
$({
  target: 'Number',
  proto: true,
  forced: FORCED
}, {
  toFixed: function toFixed(fractionDigits) {
    var number = thisNumberValue(this);
    var fractDigits = toIntegerOrInfinity(fractionDigits);
    var data = [0, 0, 0, 0, 0, 0];
    var sign = '';
    var result = '0';
    var e, z, j, k;
    if (fractDigits < 0 || fractDigits > 20) throw new $RangeError('Incorrect fraction digits');
    if (number !== number) return 'NaN';
    if (number <= -1e21 || number >= 1e21) return $String(number);
    if (number < 0) {
      sign = '-';
      number = -number;
    }
    if (number > 1e-21) {
      e = log(number * _pow(2, 69, 1)) - 69;
      z = e < 0 ? number * _pow(2, -e, 1) : number / _pow(2, e, 1);
      z *= 0x10000000000000;
      e = 52 - e;
      if (e > 0) {
        multiply(data, 0, z);
        j = fractDigits;
        while (j >= 7) {
          multiply(data, 1e7, 0);
          j -= 7;
        }
        multiply(data, _pow(10, j, 1), 0);
        j = e - 1;
        while (j >= 23) {
          divide(data, 1 << 23);
          j -= 23;
        }
        divide(data, 1 << j);
        multiply(data, 1, 1);
        divide(data, 2);
        result = dataToString(data);
      } else {
        multiply(data, 0, z);
        multiply(data, 1 << -e, 0);
        result = dataToString(data) + repeat('0', fractDigits);
      }
    }
    if (fractDigits > 0) {
      k = result.length;
      result = sign + (k <= fractDigits ? '0.' + repeat('0', fractDigits - k) + result : stringSlice(result, 0, k - fractDigits) + '.' + stringSlice(result, k - fractDigits));
    } else {
      result = sign + result;
    }
    return result;
  }
});

},{"../internals/export":66,"../internals/fails":67,"../internals/function-uncurry-this":79,"../internals/string-repeat":183,"../internals/this-number-value":192,"../internals/to-integer-or-infinity":197}],297:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var uncurryThis = require('../internals/function-uncurry-this');
var fails = require('../internals/fails');
var thisNumberValue = require('../internals/this-number-value');
var nativeToPrecision = uncurryThis(1.0.toPrecision);
var FORCED = fails(function () {
  return nativeToPrecision(1, undefined) !== '1';
}) || !fails(function () {
  nativeToPrecision({});
});
$({
  target: 'Number',
  proto: true,
  forced: FORCED
}, {
  toPrecision: function toPrecision(precision) {
    return precision === undefined ? nativeToPrecision(thisNumberValue(this)) : nativeToPrecision(thisNumberValue(this), precision);
  }
});

},{"../internals/export":66,"../internals/fails":67,"../internals/function-uncurry-this":79,"../internals/this-number-value":192}],298:[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":66,"../internals/object-assign":133}],299:[function(require,module,exports){
'use strict';
var $ = require('../internals/export');
var DESCRIPTORS = require('../internals/descriptors');
var create = require('../internals/object-create');
$({
  target: 'Object',
  stat: true,
  sham: !DESCRIPTORS
}, {
  create: create
});

},{"../internals/descriptors":50,"../internals/export":66,"../internals/object-create":134}],300:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var DESCRIPTORS = require('../internals/descriptors');
var FORCED = require('../internals/object-prototype-accessors-forced');
var aCallable = require('../internals/a-callable');
var toObject = require('../internals/to-object');
var definePropertyModule = require('../internals/object-define-property');
if (DESCRIPTORS) {
  $({
    target: 'Object',
    proto: true,
    forced: FORCED
  }, {
    __defineGetter__: function __defineGetter__(P, getter) {
      definePropertyModule.f(toObject(this), P, {
        get: aCallable(getter),
        enumerable: true,
        configurable: true
      });
    }
  });
}

},{"../internals/a-callable":1,"../internals/descriptors":50,"../internals/export":66,"../internals/object-define-property":136,"../internals/object-prototype-accessors-forced":147,"../internals/to-object":199}],301:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var DESCRIPTORS = require('../internals/descriptors');
var defineProperties = require('../internals/object-define-properties').f;
$({
  target: 'Object',
  stat: true,
  forced: Object.defineProperties !== defineProperties,
  sham: !DESCRIPTORS
}, {
  defineProperties: defineProperties
});

},{"../internals/descriptors":50,"../internals/export":66,"../internals/object-define-properties":135}],302:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var DESCRIPTORS = require('../internals/descriptors');
var defineProperty = require('../internals/object-define-property').f;
$({
  target: 'Object',
  stat: true,
  forced: Object.defineProperty !== defineProperty,
  sham: !DESCRIPTORS
}, {
  defineProperty: defineProperty
});

},{"../internals/descriptors":50,"../internals/export":66,"../internals/object-define-property":136}],303:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var DESCRIPTORS = require('../internals/descriptors');
var FORCED = require('../internals/object-prototype-accessors-forced');
var aCallable = require('../internals/a-callable');
var toObject = require('../internals/to-object');
var definePropertyModule = require('../internals/object-define-property');
if (DESCRIPTORS) {
  $({
    target: 'Object',
    proto: true,
    forced: FORCED
  }, {
    __defineSetter__: function __defineSetter__(P, setter) {
      definePropertyModule.f(toObject(this), P, {
        set: aCallable(setter),
        enumerable: true,
        configurable: true
      });
    }
  });
}

},{"../internals/a-callable":1,"../internals/descriptors":50,"../internals/export":66,"../internals/object-define-property":136,"../internals/object-prototype-accessors-forced":147,"../internals/to-object":199}],304:[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":66,"../internals/object-to-array":149}],305:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var FREEZING = require('../internals/freezing');
var fails = require('../internals/fails');
var isObject = require('../internals/is-object');
var onFreeze = require('../internals/internal-metadata').onFreeze;
var $freeze = Object.freeze;
var FAILS_ON_PRIMITIVES = fails(function () {
  $freeze(1);
});
$({
  target: 'Object',
  stat: true,
  forced: FAILS_ON_PRIMITIVES,
  sham: !FREEZING
}, {
  freeze: function freeze(it) {
    return $freeze && isObject(it) ? $freeze(onFreeze(it)) : it;
  }
});

},{"../internals/export":66,"../internals/fails":67,"../internals/freezing":70,"../internals/internal-metadata":96,"../internals/is-object":107}],306:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var iterate = require('../internals/iterate');
var createProperty = require('../internals/create-property');
$({
  target: 'Object',
  stat: true
}, {
  fromEntries: function fromEntries(iterable) {
    var obj = {};
    iterate(iterable, function (k, v) {
      createProperty(obj, k, v);
    }, {
      AS_ENTRIES: true
    });
    return obj;
  }
});

},{"../internals/create-property":42,"../internals/export":66,"../internals/iterate":112}],307:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var fails = require('../internals/fails');
var toIndexedObject = require('../internals/to-indexed-object');
var nativeGetOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;
var DESCRIPTORS = require('../internals/descriptors');
var FORCED = !DESCRIPTORS || fails(function () {
  nativeGetOwnPropertyDescriptor(1);
});
$({
  target: 'Object',
  stat: true,
  forced: FORCED,
  sham: !DESCRIPTORS
}, {
  getOwnPropertyDescriptor: function getOwnPropertyDescriptor(it, key) {
    return nativeGetOwnPropertyDescriptor(toIndexedObject(it), key);
  }
});

},{"../internals/descriptors":50,"../internals/export":66,"../internals/fails":67,"../internals/object-get-own-property-descriptor":137,"../internals/to-indexed-object":196}],308:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var DESCRIPTORS = require('../internals/descriptors');
var ownKeys = require('../internals/own-keys');
var toIndexedObject = require('../internals/to-indexed-object');
var getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor');
var createProperty = require('../internals/create-property');
$({
  target: 'Object',
  stat: true,
  sham: !DESCRIPTORS
}, {
  getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) {
    var O = toIndexedObject(object);
    var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
    var keys = ownKeys(O);
    var result = {};
    var index = 0;
    var key, descriptor;
    while (keys.length > index) {
      descriptor = getOwnPropertyDescriptor(O, key = keys[index++]);
      if (descriptor !== undefined) createProperty(result, key, descriptor);
    }
    return result;
  }
});

},{"../internals/create-property":42,"../internals/descriptors":50,"../internals/export":66,"../internals/object-get-own-property-descriptor":137,"../internals/own-keys":152,"../internals/to-indexed-object":196}],309:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var fails = require('../internals/fails');
var getOwnPropertyNames = require('../internals/object-get-own-property-names-external').f;
var FAILS_ON_PRIMITIVES = fails(function () {
  return !Object.getOwnPropertyNames(1);
});
$({
  target: 'Object',
  stat: true,
  forced: FAILS_ON_PRIMITIVES
}, {
  getOwnPropertyNames: getOwnPropertyNames
});

},{"../internals/export":66,"../internals/fails":67,"../internals/object-get-own-property-names-external":138}],310:[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":66,"../internals/fails":67,"../internals/object-get-own-property-symbols":140,"../internals/symbol-constructor-detection":188,"../internals/to-object":199}],311:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var fails = require('../internals/fails');
var toObject = require('../internals/to-object');
var nativeGetPrototypeOf = require('../internals/object-get-prototype-of');
var CORRECT_PROTOTYPE_GETTER = require('../internals/correct-prototype-getter');
var FAILS_ON_PRIMITIVES = fails(function () {
  nativeGetPrototypeOf(1);
});
$({
  target: 'Object',
  stat: true,
  forced: FAILS_ON_PRIMITIVES,
  sham: !CORRECT_PROTOTYPE_GETTER
}, {
  getPrototypeOf: function getPrototypeOf(it) {
    return nativeGetPrototypeOf(toObject(it));
  }
});

},{"../internals/correct-prototype-getter":37,"../internals/export":66,"../internals/fails":67,"../internals/object-get-prototype-of":141,"../internals/to-object":199}],312:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var $isExtensible = require('../internals/object-is-extensible');
$({
  target: 'Object',
  stat: true,
  forced: Object.isExtensible !== $isExtensible
}, {
  isExtensible: $isExtensible
});

},{"../internals/export":66,"../internals/object-is-extensible":142}],313:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
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 $isFrozen = Object.isFrozen;
var FORCED = ARRAY_BUFFER_NON_EXTENSIBLE || fails(function () {
  $isFrozen(1);
});
$({
  target: 'Object',
  stat: true,
  forced: FORCED
}, {
  isFrozen: function isFrozen(it) {
    if (!isObject(it)) return true;
    if (ARRAY_BUFFER_NON_EXTENSIBLE && classof(it) === 'ArrayBuffer') return true;
    return $isFrozen ? $isFrozen(it) : false;
  }
});

},{"../internals/array-buffer-non-extensible":9,"../internals/classof-raw":30,"../internals/export":66,"../internals/fails":67,"../internals/is-object":107}],314:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
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 $isSealed = Object.isSealed;
var FORCED = ARRAY_BUFFER_NON_EXTENSIBLE || fails(function () {
  $isSealed(1);
});
$({
  target: 'Object',
  stat: true,
  forced: FORCED
}, {
  isSealed: function isSealed(it) {
    if (!isObject(it)) return true;
    if (ARRAY_BUFFER_NON_EXTENSIBLE && classof(it) === 'ArrayBuffer') return true;
    return $isSealed ? $isSealed(it) : false;
  }
});

},{"../internals/array-buffer-non-extensible":9,"../internals/classof-raw":30,"../internals/export":66,"../internals/fails":67,"../internals/is-object":107}],315:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var is = require('../internals/same-value');
$({
  target: 'Object',
  stat: true
}, {
  is: is
});

},{"../internals/export":66,"../internals/same-value":170}],316:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var toObject = require('../internals/to-object');
var nativeKeys = require('../internals/object-keys');
var fails = require('../internals/fails');
var FAILS_ON_PRIMITIVES = fails(function () {
  nativeKeys(1);
});
$({
  target: 'Object',
  stat: true,
  forced: FAILS_ON_PRIMITIVES
}, {
  keys: function keys(it) {
    return nativeKeys(toObject(it));
  }
});

},{"../internals/export":66,"../internals/fails":67,"../internals/object-keys":145,"../internals/to-object":199}],317:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var DESCRIPTORS = require('../internals/descriptors');
var FORCED = require('../internals/object-prototype-accessors-forced');
var toObject = require('../internals/to-object');
var toPropertyKey = require('../internals/to-property-key');
var getPrototypeOf = require('../internals/object-get-prototype-of');
var getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;
if (DESCRIPTORS) {
  $({
    target: 'Object',
    proto: true,
    forced: FORCED
  }, {
    __lookupGetter__: function __lookupGetter__(P) {
      var O = toObject(this);
      var key = toPropertyKey(P);
      var desc;
      do {
        if (desc = getOwnPropertyDescriptor(O, key)) return desc.get;
      } while (O = getPrototypeOf(O));
    }
  });
}

},{"../internals/descriptors":50,"../internals/export":66,"../internals/object-get-own-property-descriptor":137,"../internals/object-get-prototype-of":141,"../internals/object-prototype-accessors-forced":147,"../internals/to-object":199,"../internals/to-property-key":203}],318:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var DESCRIPTORS = require('../internals/descriptors');
var FORCED = require('../internals/object-prototype-accessors-forced');
var toObject = require('../internals/to-object');
var toPropertyKey = require('../internals/to-property-key');
var getPrototypeOf = require('../internals/object-get-prototype-of');
var getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;
if (DESCRIPTORS) {
  $({
    target: 'Object',
    proto: true,
    forced: FORCED
  }, {
    __lookupSetter__: function __lookupSetter__(P) {
      var O = toObject(this);
      var key = toPropertyKey(P);
      var desc;
      do {
        if (desc = getOwnPropertyDescriptor(O, key)) return desc.set;
      } while (O = getPrototypeOf(O));
    }
  });
}

},{"../internals/descriptors":50,"../internals/export":66,"../internals/object-get-own-property-descriptor":137,"../internals/object-get-prototype-of":141,"../internals/object-prototype-accessors-forced":147,"../internals/to-object":199,"../internals/to-property-key":203}],319:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var isObject = require('../internals/is-object');
var onFreeze = require('../internals/internal-metadata').onFreeze;
var FREEZING = require('../internals/freezing');
var fails = require('../internals/fails');
var $preventExtensions = Object.preventExtensions;
var FAILS_ON_PRIMITIVES = fails(function () {
  $preventExtensions(1);
});
$({
  target: 'Object',
  stat: true,
  forced: FAILS_ON_PRIMITIVES,
  sham: !FREEZING
}, {
  preventExtensions: function preventExtensions(it) {
    return $preventExtensions && isObject(it) ? $preventExtensions(onFreeze(it)) : it;
  }
});

},{"../internals/export":66,"../internals/fails":67,"../internals/freezing":70,"../internals/internal-metadata":96,"../internals/is-object":107}],320:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var isObject = require('../internals/is-object');
var onFreeze = require('../internals/internal-metadata').onFreeze;
var FREEZING = require('../internals/freezing');
var fails = require('../internals/fails');
var $seal = Object.seal;
var FAILS_ON_PRIMITIVES = fails(function () {
  $seal(1);
});
$({
  target: 'Object',
  stat: true,
  forced: FAILS_ON_PRIMITIVES,
  sham: !FREEZING
}, {
  seal: function seal(it) {
    return $seal && isObject(it) ? $seal(onFreeze(it)) : it;
  }
});

},{"../internals/export":66,"../internals/fails":67,"../internals/freezing":70,"../internals/internal-metadata":96,"../internals/is-object":107}],321:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var setPrototypeOf = require('../internals/object-set-prototype-of');
$({
  target: 'Object',
  stat: true
}, {
  setPrototypeOf: setPrototypeOf
});

},{"../internals/export":66,"../internals/object-set-prototype-of":148}],322:[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":46,"../internals/object-to-string":150,"../internals/to-string-tag-support":204}],323:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var $values = require('../internals/object-to-array').values;
$({
  target: 'Object',
  stat: true
}, {
  values: function values(O) {
    return $values(O);
  }
});

},{"../internals/export":66,"../internals/object-to-array":149}],324:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var $parseFloat = require('../internals/number-parse-float');
$({
  global: true,
  forced: parseFloat !== $parseFloat
}, {
  parseFloat: $parseFloat
});

},{"../internals/export":66,"../internals/number-parse-float":131}],325:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var $parseInt = require('../internals/number-parse-int');
$({
  global: true,
  forced: parseInt !== $parseInt
}, {
  parseInt: $parseInt
});

},{"../internals/export":66,"../internals/number-parse-int":132}],326:[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":1,"../internals/export":66,"../internals/function-call":75,"../internals/iterate":112,"../internals/new-promise-capability":128,"../internals/perform":154,"../internals/promise-statics-incorrect-iteration":158}],327:[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 _catch(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":46,"../internals/export":66,"../internals/get-built-in":80,"../internals/is-callable":101,"../internals/is-pure":109,"../internals/promise-constructor-detection":155,"../internals/promise-native-constructor":156}],328:[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 isThenable(it) {
  var then;
  return isObject(it) && isCallable(then = it.then) ? then : false;
};
var callReaction = function callReaction(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 notify(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 dispatchEvent(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 onUnhandled(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 isUnhandled(state) {
  return state.rejection !== HANDLED && !state.parent;
};
var onHandleUnhandled = function onHandleUnhandled(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 bind(fn, state, unwrap) {
  return function (value) {
    fn(state, value, unwrap);
  };
};
var internalReject = function internalReject(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 internalResolve(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 OwnPromiseCapability() {
    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 newPromiseCapability(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":1,"../internals/an-instance":6,"../internals/define-built-in":46,"../internals/environment-is-node":60,"../internals/export":66,"../internals/function-call":75,"../internals/global-this":86,"../internals/host-report-errors":89,"../internals/internal-state":97,"../internals/is-callable":101,"../internals/is-object":107,"../internals/is-pure":109,"../internals/microtask":127,"../internals/new-promise-capability":128,"../internals/object-set-prototype-of":148,"../internals/perform":154,"../internals/promise-constructor-detection":155,"../internals/promise-native-constructor":156,"../internals/queue":160,"../internals/set-species":172,"../internals/set-to-string-tag":173,"../internals/species-constructor":177,"../internals/task":191}],329:[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 then() {}
  }, function () {});
});
$({
  target: 'Promise',
  proto: true,
  real: true,
  forced: NON_GENERIC
}, {
  'finally': function _finally(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":46,"../internals/export":66,"../internals/fails":67,"../internals/get-built-in":80,"../internals/is-callable":101,"../internals/is-pure":109,"../internals/promise-native-constructor":156,"../internals/promise-resolve":157,"../internals/species-constructor":177}],330:[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":326,"../modules/es.promise.catch":327,"../modules/es.promise.constructor":328,"../modules/es.promise.race":331,"../modules/es.promise.reject":332,"../modules/es.promise.resolve":333}],331:[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":1,"../internals/export":66,"../internals/function-call":75,"../internals/iterate":112,"../internals/new-promise-capability":128,"../internals/perform":154,"../internals/promise-statics-incorrect-iteration":158}],332:[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":66,"../internals/new-promise-capability":128,"../internals/promise-constructor-detection":155}],333:[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":66,"../internals/get-built-in":80,"../internals/is-pure":109,"../internals/promise-constructor-detection":155,"../internals/promise-native-constructor":156,"../internals/promise-resolve":157}],334:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var functionApply = require('../internals/function-apply');
var aCallable = require('../internals/a-callable');
var anObject = require('../internals/an-object');
var fails = require('../internals/fails');
var OPTIONAL_ARGUMENTS_LIST = !fails(function () {
  Reflect.apply(function () {});
});
$({
  target: 'Reflect',
  stat: true,
  forced: OPTIONAL_ARGUMENTS_LIST
}, {
  apply: function apply(target, thisArgument, argumentsList) {
    return functionApply(aCallable(target), thisArgument, anObject(argumentsList));
  }
});

},{"../internals/a-callable":1,"../internals/an-object":7,"../internals/export":66,"../internals/fails":67,"../internals/function-apply":71}],335:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var getBuiltIn = require('../internals/get-built-in');
var apply = require('../internals/function-apply');
var bind = require('../internals/function-bind');
var aConstructor = require('../internals/a-constructor');
var anObject = require('../internals/an-object');
var isObject = require('../internals/is-object');
var create = require('../internals/object-create');
var fails = require('../internals/fails');
var nativeConstruct = getBuiltIn('Reflect', 'construct');
var ObjectPrototype = Object.prototype;
var push = [].push;
var NEW_TARGET_BUG = fails(function () {
  function F() {}
  return !(nativeConstruct(function () {}, [], F) instanceof F);
});
var ARGS_BUG = !fails(function () {
  nativeConstruct(function () {});
});
var FORCED = NEW_TARGET_BUG || ARGS_BUG;
$({
  target: 'Reflect',
  stat: true,
  forced: FORCED,
  sham: FORCED
}, {
  construct: function construct(Target, args) {
    aConstructor(Target);
    anObject(args);
    var newTarget = arguments.length < 3 ? Target : aConstructor(arguments[2]);
    if (ARGS_BUG && !NEW_TARGET_BUG) return nativeConstruct(Target, args, newTarget);
    if (Target === newTarget) {
      switch (args.length) {
        case 0:
          return new Target();
        case 1:
          return new Target(args[0]);
        case 2:
          return new Target(args[0], args[1]);
        case 3:
          return new Target(args[0], args[1], args[2]);
        case 4:
          return new Target(args[0], args[1], args[2], args[3]);
      }
      var $args = [null];
      apply(push, $args, args);
      return new (apply(bind, Target, $args))();
    }
    var proto = newTarget.prototype;
    var instance = create(isObject(proto) ? proto : ObjectPrototype);
    var result = apply(Target, instance, args);
    return isObject(result) ? result : instance;
  }
});

},{"../internals/a-constructor":2,"../internals/an-object":7,"../internals/export":66,"../internals/fails":67,"../internals/function-apply":71,"../internals/function-bind":74,"../internals/get-built-in":80,"../internals/is-object":107,"../internals/object-create":134}],336:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var DESCRIPTORS = require('../internals/descriptors');
var anObject = require('../internals/an-object');
var toPropertyKey = require('../internals/to-property-key');
var definePropertyModule = require('../internals/object-define-property');
var fails = require('../internals/fails');
var ERROR_INSTEAD_OF_FALSE = fails(function () {
  Reflect.defineProperty(definePropertyModule.f({}, 1, {
    value: 1
  }), 1, {
    value: 2
  });
});
$({
  target: 'Reflect',
  stat: true,
  forced: ERROR_INSTEAD_OF_FALSE,
  sham: !DESCRIPTORS
}, {
  defineProperty: function defineProperty(target, propertyKey, attributes) {
    anObject(target);
    var key = toPropertyKey(propertyKey);
    anObject(attributes);
    try {
      definePropertyModule.f(target, key, attributes);
      return true;
    } catch (error) {
      return false;
    }
  }
});

},{"../internals/an-object":7,"../internals/descriptors":50,"../internals/export":66,"../internals/fails":67,"../internals/object-define-property":136,"../internals/to-property-key":203}],337:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var anObject = require('../internals/an-object');
var getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;
$({
  target: 'Reflect',
  stat: true
}, {
  deleteProperty: function deleteProperty(target, propertyKey) {
    var descriptor = getOwnPropertyDescriptor(anObject(target), propertyKey);
    return descriptor && !descriptor.configurable ? false : delete target[propertyKey];
  }
});

},{"../internals/an-object":7,"../internals/export":66,"../internals/object-get-own-property-descriptor":137}],338:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var DESCRIPTORS = require('../internals/descriptors');
var anObject = require('../internals/an-object');
var getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor');
$({
  target: 'Reflect',
  stat: true,
  sham: !DESCRIPTORS
}, {
  getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, propertyKey) {
    return getOwnPropertyDescriptorModule.f(anObject(target), propertyKey);
  }
});

},{"../internals/an-object":7,"../internals/descriptors":50,"../internals/export":66,"../internals/object-get-own-property-descriptor":137}],339:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var anObject = require('../internals/an-object');
var objectGetPrototypeOf = require('../internals/object-get-prototype-of');
var CORRECT_PROTOTYPE_GETTER = require('../internals/correct-prototype-getter');
$({
  target: 'Reflect',
  stat: true,
  sham: !CORRECT_PROTOTYPE_GETTER
}, {
  getPrototypeOf: function getPrototypeOf(target) {
    return objectGetPrototypeOf(anObject(target));
  }
});

},{"../internals/an-object":7,"../internals/correct-prototype-getter":37,"../internals/export":66,"../internals/object-get-prototype-of":141}],340:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var call = require('../internals/function-call');
var isObject = require('../internals/is-object');
var anObject = require('../internals/an-object');
var isDataDescriptor = require('../internals/is-data-descriptor');
var getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor');
var getPrototypeOf = require('../internals/object-get-prototype-of');
function get(target, propertyKey) {
  var receiver = arguments.length < 3 ? target : arguments[2];
  var descriptor, prototype;
  if (anObject(target) === receiver) return target[propertyKey];
  descriptor = getOwnPropertyDescriptorModule.f(target, propertyKey);
  if (descriptor) return isDataDescriptor(descriptor) ? descriptor.value : descriptor.get === undefined ? undefined : call(descriptor.get, receiver);
  if (isObject(prototype = getPrototypeOf(target))) return get(prototype, propertyKey, receiver);
}
$({
  target: 'Reflect',
  stat: true
}, {
  get: get
});

},{"../internals/an-object":7,"../internals/export":66,"../internals/function-call":75,"../internals/is-data-descriptor":103,"../internals/is-object":107,"../internals/object-get-own-property-descriptor":137,"../internals/object-get-prototype-of":141}],341:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
$({
  target: 'Reflect',
  stat: true
}, {
  has: function has(target, propertyKey) {
    return propertyKey in target;
  }
});

},{"../internals/export":66}],342:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var anObject = require('../internals/an-object');
var $isExtensible = require('../internals/object-is-extensible');
$({
  target: 'Reflect',
  stat: true
}, {
  isExtensible: function isExtensible(target) {
    anObject(target);
    return $isExtensible(target);
  }
});

},{"../internals/an-object":7,"../internals/export":66,"../internals/object-is-extensible":142}],343:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var ownKeys = require('../internals/own-keys');
$({
  target: 'Reflect',
  stat: true
}, {
  ownKeys: ownKeys
});

},{"../internals/export":66,"../internals/own-keys":152}],344:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var getBuiltIn = require('../internals/get-built-in');
var anObject = require('../internals/an-object');
var FREEZING = require('../internals/freezing');
$({
  target: 'Reflect',
  stat: true,
  sham: !FREEZING
}, {
  preventExtensions: function preventExtensions(target) {
    anObject(target);
    try {
      var objectPreventExtensions = getBuiltIn('Object', 'preventExtensions');
      if (objectPreventExtensions) objectPreventExtensions(target);
      return true;
    } catch (error) {
      return false;
    }
  }
});

},{"../internals/an-object":7,"../internals/export":66,"../internals/freezing":70,"../internals/get-built-in":80}],345:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var anObject = require('../internals/an-object');
var aPossiblePrototype = require('../internals/a-possible-prototype');
var objectSetPrototypeOf = require('../internals/object-set-prototype-of');
if (objectSetPrototypeOf) $({
  target: 'Reflect',
  stat: true
}, {
  setPrototypeOf: function setPrototypeOf(target, proto) {
    anObject(target);
    aPossiblePrototype(proto);
    try {
      objectSetPrototypeOf(target, proto);
      return true;
    } catch (error) {
      return false;
    }
  }
});

},{"../internals/a-possible-prototype":3,"../internals/an-object":7,"../internals/export":66,"../internals/object-set-prototype-of":148}],346:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var call = require('../internals/function-call');
var anObject = require('../internals/an-object');
var isObject = require('../internals/is-object');
var isDataDescriptor = require('../internals/is-data-descriptor');
var fails = require('../internals/fails');
var definePropertyModule = require('../internals/object-define-property');
var getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor');
var getPrototypeOf = require('../internals/object-get-prototype-of');
var createPropertyDescriptor = require('../internals/create-property-descriptor');
function set(target, propertyKey, V) {
  var receiver = arguments.length < 4 ? target : arguments[3];
  var ownDescriptor = getOwnPropertyDescriptorModule.f(anObject(target), propertyKey);
  var existingDescriptor, prototype, setter;
  if (!ownDescriptor) {
    if (isObject(prototype = getPrototypeOf(target))) {
      return set(prototype, propertyKey, V, receiver);
    }
    ownDescriptor = createPropertyDescriptor(0);
  }
  if (isDataDescriptor(ownDescriptor)) {
    if (ownDescriptor.writable === false || !isObject(receiver)) return false;
    if (existingDescriptor = getOwnPropertyDescriptorModule.f(receiver, propertyKey)) {
      if (existingDescriptor.get || existingDescriptor.set || existingDescriptor.writable === false) return false;
      existingDescriptor.value = V;
      definePropertyModule.f(receiver, propertyKey, existingDescriptor);
    } else definePropertyModule.f(receiver, propertyKey, createPropertyDescriptor(0, V));
  } else {
    setter = ownDescriptor.set;
    if (setter === undefined) return false;
    call(setter, receiver, V);
  }
  return true;
}
var MS_EDGE_BUG = fails(function () {
  var Constructor = function Constructor() {};
  var object = definePropertyModule.f(new Constructor(), 'a', {
    configurable: true
  });
  return Reflect.set(Constructor.prototype, 'a', 1, object) !== false;
});
$({
  target: 'Reflect',
  stat: true,
  forced: MS_EDGE_BUG
}, {
  set: set
});

},{"../internals/an-object":7,"../internals/create-property-descriptor":41,"../internals/export":66,"../internals/fails":67,"../internals/function-call":75,"../internals/is-data-descriptor":103,"../internals/is-object":107,"../internals/object-define-property":136,"../internals/object-get-own-property-descriptor":137,"../internals/object-get-prototype-of":141}],347:[function(require,module,exports){
'use strict';

var DESCRIPTORS = require('../internals/descriptors');
var globalThis = require('../internals/global-this');
var uncurryThis = require('../internals/function-uncurry-this');
var isForced = require('../internals/is-forced');
var inheritIfRequired = require('../internals/inherit-if-required');
var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
var create = require('../internals/object-create');
var getOwnPropertyNames = require('../internals/object-get-own-property-names').f;
var isPrototypeOf = require('../internals/object-is-prototype-of');
var isRegExp = require('../internals/is-regexp');
var toString = require('../internals/to-string');
var getRegExpFlags = require('../internals/regexp-get-flags');
var stickyHelpers = require('../internals/regexp-sticky-helpers');
var proxyAccessor = require('../internals/proxy-accessor');
var defineBuiltIn = require('../internals/define-built-in');
var fails = require('../internals/fails');
var hasOwn = require('../internals/has-own-property');
var enforceInternalState = require('../internals/internal-state').enforce;
var setSpecies = require('../internals/set-species');
var wellKnownSymbol = require('../internals/well-known-symbol');
var UNSUPPORTED_DOT_ALL = require('../internals/regexp-unsupported-dot-all');
var UNSUPPORTED_NCG = require('../internals/regexp-unsupported-ncg');
var MATCH = wellKnownSymbol('match');
var NativeRegExp = globalThis.RegExp;
var RegExpPrototype = NativeRegExp.prototype;
var SyntaxError = globalThis.SyntaxError;
var exec = uncurryThis(RegExpPrototype.exec);
var charAt = uncurryThis(''.charAt);
var replace = uncurryThis(''.replace);
var stringIndexOf = uncurryThis(''.indexOf);
var stringSlice = uncurryThis(''.slice);
var IS_NCG = /^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/;
var re1 = /a/g;
var re2 = /a/g;
var CORRECT_NEW = new NativeRegExp(re1) !== re1;
var MISSED_STICKY = stickyHelpers.MISSED_STICKY;
var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y;
var BASE_FORCED = DESCRIPTORS && (!CORRECT_NEW || MISSED_STICKY || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG || fails(function () {
  re2[MATCH] = false;
  return NativeRegExp(re1) !== re1 || NativeRegExp(re2) === re2 || String(NativeRegExp(re1, 'i')) !== '/a/i';
}));
var handleDotAll = function handleDotAll(string) {
  var length = string.length;
  var index = 0;
  var result = '';
  var brackets = false;
  var chr;
  for (; index <= length; index++) {
    chr = charAt(string, index);
    if (chr === '\\') {
      result += chr + charAt(string, ++index);
      continue;
    }
    if (!brackets && chr === '.') {
      result += '[\\s\\S]';
    } else {
      if (chr === '[') {
        brackets = true;
      } else if (chr === ']') {
        brackets = false;
      }
      result += chr;
    }
  }
  return result;
};
var handleNCG = function handleNCG(string) {
  var length = string.length;
  var index = 0;
  var result = '';
  var named = [];
  var names = create(null);
  var brackets = false;
  var ncg = false;
  var groupid = 0;
  var groupname = '';
  var chr;
  for (; index <= length; index++) {
    chr = charAt(string, index);
    if (chr === '\\') {
      chr += charAt(string, ++index);
    } else if (chr === ']') {
      brackets = false;
    } else if (!brackets) switch (true) {
      case chr === '[':
        brackets = true;
        break;
      case chr === '(':
        result += chr;
        if (stringSlice(string, index + 1, index + 3) === '?:') {
          continue;
        }
        if (exec(IS_NCG, stringSlice(string, index + 1))) {
          index += 2;
          ncg = true;
        }
        groupid++;
        continue;
      case chr === '>' && ncg:
        if (groupname === '' || hasOwn(names, groupname)) {
          throw new SyntaxError('Invalid capture group name');
        }
        names[groupname] = true;
        named[named.length] = [groupname, groupid];
        ncg = false;
        groupname = '';
        continue;
    }
    if (ncg) groupname += chr;else result += chr;
  }
  return [result, named];
};
if (isForced('RegExp', BASE_FORCED)) {
  var RegExpWrapper = function RegExp(pattern, flags) {
    var thisIsRegExp = isPrototypeOf(RegExpPrototype, this);
    var patternIsRegExp = isRegExp(pattern);
    var flagsAreUndefined = flags === undefined;
    var groups = [];
    var rawPattern = pattern;
    var rawFlags, dotAll, sticky, handled, result, state;
    if (!thisIsRegExp && patternIsRegExp && flagsAreUndefined && pattern.constructor === RegExpWrapper) {
      return pattern;
    }
    if (patternIsRegExp || isPrototypeOf(RegExpPrototype, pattern)) {
      pattern = pattern.source;
      if (flagsAreUndefined) flags = getRegExpFlags(rawPattern);
    }
    pattern = pattern === undefined ? '' : toString(pattern);
    flags = flags === undefined ? '' : toString(flags);
    rawPattern = pattern;
    if (UNSUPPORTED_DOT_ALL && 'dotAll' in re1) {
      dotAll = !!flags && stringIndexOf(flags, 's') > -1;
      if (dotAll) flags = replace(flags, /s/g, '');
    }
    rawFlags = flags;
    if (MISSED_STICKY && 'sticky' in re1) {
      sticky = !!flags && stringIndexOf(flags, 'y') > -1;
      if (sticky && UNSUPPORTED_Y) flags = replace(flags, /y/g, '');
    }
    if (UNSUPPORTED_NCG) {
      handled = handleNCG(pattern);
      pattern = handled[0];
      groups = handled[1];
    }
    result = inheritIfRequired(NativeRegExp(pattern, flags), thisIsRegExp ? this : RegExpPrototype, RegExpWrapper);
    if (dotAll || sticky || groups.length) {
      state = enforceInternalState(result);
      if (dotAll) {
        state.dotAll = true;
        state.raw = RegExpWrapper(handleDotAll(pattern), rawFlags);
      }
      if (sticky) state.sticky = true;
      if (groups.length) state.groups = groups;
    }
    if (pattern !== rawPattern) try {
      createNonEnumerableProperty(result, 'source', rawPattern === '' ? '(?:)' : rawPattern);
    } catch (error) {}
    return result;
  };
  for (var keys = getOwnPropertyNames(NativeRegExp), index = 0; keys.length > index;) {
    proxyAccessor(RegExpWrapper, NativeRegExp, keys[index++]);
  }
  RegExpPrototype.constructor = RegExpWrapper;
  RegExpWrapper.prototype = RegExpPrototype;
  defineBuiltIn(globalThis, 'RegExp', RegExpWrapper, {
    constructor: true
  });
}
setSpecies('RegExp');

},{"../internals/create-non-enumerable-property":40,"../internals/define-built-in":46,"../internals/descriptors":50,"../internals/fails":67,"../internals/function-uncurry-this":79,"../internals/global-this":86,"../internals/has-own-property":87,"../internals/inherit-if-required":94,"../internals/internal-state":97,"../internals/is-forced":104,"../internals/is-regexp":110,"../internals/object-create":134,"../internals/object-get-own-property-names":139,"../internals/object-is-prototype-of":143,"../internals/proxy-accessor":159,"../internals/regexp-get-flags":164,"../internals/regexp-sticky-helpers":165,"../internals/regexp-unsupported-dot-all":166,"../internals/regexp-unsupported-ncg":167,"../internals/set-species":172,"../internals/to-string":205,"../internals/well-known-symbol":221}],348:[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":66,"../internals/regexp-exec":162}],349:[function(require,module,exports){
'use strict';

var globalThis = require('../internals/global-this');
var DESCRIPTORS = require('../internals/descriptors');
var defineBuiltInAccessor = require('../internals/define-built-in-accessor');
var regExpFlags = require('../internals/regexp-flags');
var fails = require('../internals/fails');
var RegExp = globalThis.RegExp;
var RegExpPrototype = RegExp.prototype;
var FORCED = DESCRIPTORS && fails(function () {
  var INDICES_SUPPORT = true;
  try {
    RegExp('.', 'd');
  } catch (error) {
    INDICES_SUPPORT = false;
  }
  var O = {};
  var calls = '';
  var expected = INDICES_SUPPORT ? 'dgimsy' : 'gimsy';
  var addGetter = function addGetter(key, chr) {
    Object.defineProperty(O, key, {
      get: function get() {
        calls += chr;
        return true;
      }
    });
  };
  var pairs = {
    dotAll: 's',
    global: 'g',
    ignoreCase: 'i',
    multiline: 'm',
    sticky: 'y'
  };
  if (INDICES_SUPPORT) pairs.hasIndices = 'd';
  for (var key in pairs) addGetter(key, pairs[key]);
  var result = Object.getOwnPropertyDescriptor(RegExpPrototype, 'flags').get.call(O);
  return result !== expected || calls !== expected;
});
if (FORCED) defineBuiltInAccessor(RegExpPrototype, 'flags', {
  configurable: true,
  get: regExpFlags
});

},{"../internals/define-built-in-accessor":45,"../internals/descriptors":50,"../internals/fails":67,"../internals/global-this":86,"../internals/regexp-flags":163}],350:[function(require,module,exports){
'use strict';

var PROPER_FUNCTION_NAME = require('../internals/function-name').PROPER;
var defineBuiltIn = require('../internals/define-built-in');
var anObject = require('../internals/an-object');
var $toString = require('../internals/to-string');
var fails = require('../internals/fails');
var getRegExpFlags = require('../internals/regexp-get-flags');
var TO_STRING = 'toString';
var RegExpPrototype = RegExp.prototype;
var nativeToString = RegExpPrototype[TO_STRING];
var NOT_GENERIC = fails(function () {
  return nativeToString.call({
    source: 'a',
    flags: 'b'
  }) !== '/a/b';
});
var INCORRECT_NAME = PROPER_FUNCTION_NAME && nativeToString.name !== TO_STRING;
if (NOT_GENERIC || INCORRECT_NAME) {
  defineBuiltIn(RegExpPrototype, TO_STRING, function toString() {
    var R = anObject(this);
    var pattern = $toString(R.source);
    var flags = $toString(getRegExpFlags(R));
    return '/' + pattern + '/' + flags;
  }, {
    unsafe: true
  });
}

},{"../internals/an-object":7,"../internals/define-built-in":46,"../internals/fails":67,"../internals/function-name":76,"../internals/regexp-get-flags":164,"../internals/to-string":205}],351:[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":34,"../internals/collection-strong":32}],352:[function(require,module,exports){
'use strict';
require('../modules/es.set.constructor');

},{"../modules/es.set.constructor":351}],353:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var createHTML = require('../internals/create-html');
var forcedStringHTMLMethod = require('../internals/string-html-forced');
$({
  target: 'String',
  proto: true,
  forced: forcedStringHTMLMethod('anchor')
}, {
  anchor: function anchor(name) {
    return createHTML(this, 'a', 'name', name);
  }
});

},{"../internals/create-html":38,"../internals/export":66,"../internals/string-html-forced":178}],354:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var createHTML = require('../internals/create-html');
var forcedStringHTMLMethod = require('../internals/string-html-forced');
$({
  target: 'String',
  proto: true,
  forced: forcedStringHTMLMethod('big')
}, {
  big: function big() {
    return createHTML(this, 'big', '', '');
  }
});

},{"../internals/create-html":38,"../internals/export":66,"../internals/string-html-forced":178}],355:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var createHTML = require('../internals/create-html');
var forcedStringHTMLMethod = require('../internals/string-html-forced');
$({
  target: 'String',
  proto: true,
  forced: forcedStringHTMLMethod('blink')
}, {
  blink: function blink() {
    return createHTML(this, 'blink', '', '');
  }
});

},{"../internals/create-html":38,"../internals/export":66,"../internals/string-html-forced":178}],356:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var createHTML = require('../internals/create-html');
var forcedStringHTMLMethod = require('../internals/string-html-forced');
$({
  target: 'String',
  proto: true,
  forced: forcedStringHTMLMethod('bold')
}, {
  bold: function bold() {
    return createHTML(this, 'b', '', '');
  }
});

},{"../internals/create-html":38,"../internals/export":66,"../internals/string-html-forced":178}],357:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var codeAt = require('../internals/string-multibyte').codeAt;
$({
  target: 'String',
  proto: true
}, {
  codePointAt: function codePointAt(pos) {
    return codeAt(this, pos);
  }
});

},{"../internals/export":66,"../internals/string-multibyte":179}],358:[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":36,"../internals/export":66,"../internals/function-uncurry-this-clause":78,"../internals/is-pure":109,"../internals/not-a-regexp":129,"../internals/object-get-own-property-descriptor":137,"../internals/require-object-coercible":168,"../internals/to-length":198,"../internals/to-string":205}],359:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var createHTML = require('../internals/create-html');
var forcedStringHTMLMethod = require('../internals/string-html-forced');
$({
  target: 'String',
  proto: true,
  forced: forcedStringHTMLMethod('fixed')
}, {
  fixed: function fixed() {
    return createHTML(this, 'tt', '', '');
  }
});

},{"../internals/create-html":38,"../internals/export":66,"../internals/string-html-forced":178}],360:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var createHTML = require('../internals/create-html');
var forcedStringHTMLMethod = require('../internals/string-html-forced');
$({
  target: 'String',
  proto: true,
  forced: forcedStringHTMLMethod('fontcolor')
}, {
  fontcolor: function fontcolor(color) {
    return createHTML(this, 'font', 'color', color);
  }
});

},{"../internals/create-html":38,"../internals/export":66,"../internals/string-html-forced":178}],361:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var createHTML = require('../internals/create-html');
var forcedStringHTMLMethod = require('../internals/string-html-forced');
$({
  target: 'String',
  proto: true,
  forced: forcedStringHTMLMethod('fontsize')
}, {
  fontsize: function fontsize(size) {
    return createHTML(this, 'font', 'size', size);
  }
});

},{"../internals/create-html":38,"../internals/export":66,"../internals/string-html-forced":178}],362:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var uncurryThis = require('../internals/function-uncurry-this');
var toAbsoluteIndex = require('../internals/to-absolute-index');
var $RangeError = RangeError;
var fromCharCode = String.fromCharCode;
var $fromCodePoint = String.fromCodePoint;
var join = uncurryThis([].join);
var INCORRECT_LENGTH = !!$fromCodePoint && $fromCodePoint.length !== 1;
$({
  target: 'String',
  stat: true,
  arity: 1,
  forced: INCORRECT_LENGTH
}, {
  fromCodePoint: function fromCodePoint(x) {
    var elements = [];
    var length = arguments.length;
    var i = 0;
    var code;
    while (length > i) {
      code = +arguments[i++];
      if (toAbsoluteIndex(code, 0x10FFFF) !== code) throw new $RangeError(code + ' is not a valid code point');
      elements[i] = code < 0x10000 ? fromCharCode(code) : fromCharCode(((code -= 0x10000) >> 10) + 0xD800, code % 0x400 + 0xDC00);
    }
    return join(elements, '');
  }
});

},{"../internals/export":66,"../internals/function-uncurry-this":79,"../internals/to-absolute-index":193}],363:[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":36,"../internals/export":66,"../internals/function-uncurry-this":79,"../internals/not-a-regexp":129,"../internals/require-object-coercible":168,"../internals/to-string":205}],364:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var createHTML = require('../internals/create-html');
var forcedStringHTMLMethod = require('../internals/string-html-forced');
$({
  target: 'String',
  proto: true,
  forced: forcedStringHTMLMethod('italics')
}, {
  italics: function italics() {
    return createHTML(this, 'i', '', '');
  }
});

},{"../internals/create-html":38,"../internals/export":66,"../internals/string-html-forced":178}],365:[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":39,"../internals/internal-state":97,"../internals/iterator-define":115,"../internals/string-multibyte":179,"../internals/to-string":205}],366:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var createHTML = require('../internals/create-html');
var forcedStringHTMLMethod = require('../internals/string-html-forced');
$({
  target: 'String',
  proto: true,
  forced: forcedStringHTMLMethod('link')
}, {
  link: function link(url) {
    return createHTML(this, 'a', 'href', url);
  }
});

},{"../internals/create-html":38,"../internals/export":66,"../internals/string-html-forced":178}],367:[function(require,module,exports){
'use strict';

var call = require('../internals/function-call');
var fixRegExpWellKnownSymbolLogic = require('../internals/fix-regexp-well-known-symbol-logic');
var anObject = require('../internals/an-object');
var isNullOrUndefined = require('../internals/is-null-or-undefined');
var toLength = require('../internals/to-length');
var toString = require('../internals/to-string');
var requireObjectCoercible = require('../internals/require-object-coercible');
var getMethod = require('../internals/get-method');
var advanceStringIndex = require('../internals/advance-string-index');
var regExpExec = require('../internals/regexp-exec-abstract');
fixRegExpWellKnownSymbolLogic('match', function (MATCH, nativeMatch, maybeCallNative) {
  return [function match(regexp) {
    var O = requireObjectCoercible(this);
    var matcher = isNullOrUndefined(regexp) ? undefined : getMethod(regexp, MATCH);
    return matcher ? call(matcher, regexp, O) : new RegExp(regexp)[MATCH](toString(O));
  }, function (string) {
    var rx = anObject(this);
    var S = toString(string);
    var res = maybeCallNative(nativeMatch, rx, S);
    if (res.done) return res.value;
    if (!rx.global) return regExpExec(rx, S);
    var fullUnicode = rx.unicode;
    rx.lastIndex = 0;
    var A = [];
    var n = 0;
    var result;
    while ((result = regExpExec(rx, S)) !== null) {
      var matchStr = toString(result[0]);
      A[n] = matchStr;
      if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
      n++;
    }
    return n === 0 ? null : A;
  }];
});

},{"../internals/advance-string-index":5,"../internals/an-object":7,"../internals/fix-regexp-well-known-symbol-logic":68,"../internals/function-call":75,"../internals/get-method":84,"../internals/is-null-or-undefined":106,"../internals/regexp-exec-abstract":161,"../internals/require-object-coercible":168,"../internals/to-length":198,"../internals/to-string":205}],368:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var $padEnd = require('../internals/string-pad').end;
var WEBKIT_BUG = require('../internals/string-pad-webkit-bug');
$({
  target: 'String',
  proto: true,
  forced: WEBKIT_BUG
}, {
  padEnd: function padEnd(maxLength) {
    return $padEnd(this, maxLength, arguments.length > 1 ? arguments[1] : undefined);
  }
});

},{"../internals/export":66,"../internals/string-pad":181,"../internals/string-pad-webkit-bug":180}],369:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var $padStart = require('../internals/string-pad').start;
var WEBKIT_BUG = require('../internals/string-pad-webkit-bug');
$({
  target: 'String',
  proto: true,
  forced: WEBKIT_BUG
}, {
  padStart: function padStart(maxLength) {
    return $padStart(this, maxLength, arguments.length > 1 ? arguments[1] : undefined);
  }
});

},{"../internals/export":66,"../internals/string-pad":181,"../internals/string-pad-webkit-bug":180}],370:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var uncurryThis = require('../internals/function-uncurry-this');
var toIndexedObject = require('../internals/to-indexed-object');
var toObject = require('../internals/to-object');
var toString = require('../internals/to-string');
var lengthOfArrayLike = require('../internals/length-of-array-like');
var push = uncurryThis([].push);
var join = uncurryThis([].join);
$({
  target: 'String',
  stat: true
}, {
  raw: function raw(template) {
    var rawTemplate = toIndexedObject(toObject(template).raw);
    var literalSegments = lengthOfArrayLike(rawTemplate);
    if (!literalSegments) return '';
    var argumentsLength = arguments.length;
    var elements = [];
    var i = 0;
    while (true) {
      push(elements, toString(rawTemplate[i++]));
      if (i === literalSegments) return join(elements, '');
      if (i < argumentsLength) push(elements, toString(arguments[i]));
    }
  }
});

},{"../internals/export":66,"../internals/function-uncurry-this":79,"../internals/length-of-array-like":118,"../internals/to-indexed-object":196,"../internals/to-object":199,"../internals/to-string":205}],371:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var repeat = require('../internals/string-repeat');
$({
  target: 'String',
  proto: true
}, {
  repeat: repeat
});

},{"../internals/export":66,"../internals/string-repeat":183}],372:[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 maybeToString(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":5,"../internals/an-object":7,"../internals/fails":67,"../internals/fix-regexp-well-known-symbol-logic":68,"../internals/function-apply":71,"../internals/function-call":75,"../internals/function-uncurry-this":79,"../internals/get-method":84,"../internals/get-substitution":85,"../internals/is-callable":101,"../internals/is-null-or-undefined":106,"../internals/regexp-exec-abstract":161,"../internals/require-object-coercible":168,"../internals/to-integer-or-infinity":197,"../internals/to-length":198,"../internals/to-string":205,"../internals/well-known-symbol":221}],373:[function(require,module,exports){
'use strict';

var call = require('../internals/function-call');
var fixRegExpWellKnownSymbolLogic = require('../internals/fix-regexp-well-known-symbol-logic');
var anObject = require('../internals/an-object');
var isNullOrUndefined = require('../internals/is-null-or-undefined');
var requireObjectCoercible = require('../internals/require-object-coercible');
var sameValue = require('../internals/same-value');
var toString = require('../internals/to-string');
var getMethod = require('../internals/get-method');
var regExpExec = require('../internals/regexp-exec-abstract');
fixRegExpWellKnownSymbolLogic('search', function (SEARCH, nativeSearch, maybeCallNative) {
  return [function search(regexp) {
    var O = requireObjectCoercible(this);
    var searcher = isNullOrUndefined(regexp) ? undefined : getMethod(regexp, SEARCH);
    return searcher ? call(searcher, regexp, O) : new RegExp(regexp)[SEARCH](toString(O));
  }, function (string) {
    var rx = anObject(this);
    var S = toString(string);
    var res = maybeCallNative(nativeSearch, rx, S);
    if (res.done) return res.value;
    var previousLastIndex = rx.lastIndex;
    if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0;
    var result = regExpExec(rx, S);
    if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex;
    return result === null ? -1 : result.index;
  }];
});

},{"../internals/an-object":7,"../internals/fix-regexp-well-known-symbol-logic":68,"../internals/function-call":75,"../internals/get-method":84,"../internals/is-null-or-undefined":106,"../internals/regexp-exec-abstract":161,"../internals/require-object-coercible":168,"../internals/same-value":170,"../internals/to-string":205}],374:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var createHTML = require('../internals/create-html');
var forcedStringHTMLMethod = require('../internals/string-html-forced');
$({
  target: 'String',
  proto: true,
  forced: forcedStringHTMLMethod('small')
}, {
  small: function small() {
    return createHTML(this, 'small', '', '');
  }
});

},{"../internals/create-html":38,"../internals/export":66,"../internals/string-html-forced":178}],375:[function(require,module,exports){
'use strict';

var call = require('../internals/function-call');
var uncurryThis = require('../internals/function-uncurry-this');
var fixRegExpWellKnownSymbolLogic = require('../internals/fix-regexp-well-known-symbol-logic');
var anObject = require('../internals/an-object');
var isNullOrUndefined = require('../internals/is-null-or-undefined');
var requireObjectCoercible = require('../internals/require-object-coercible');
var speciesConstructor = require('../internals/species-constructor');
var advanceStringIndex = require('../internals/advance-string-index');
var toLength = require('../internals/to-length');
var toString = require('../internals/to-string');
var getMethod = require('../internals/get-method');
var regExpExec = require('../internals/regexp-exec-abstract');
var stickyHelpers = require('../internals/regexp-sticky-helpers');
var fails = require('../internals/fails');
var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y;
var MAX_UINT32 = 0xFFFFFFFF;
var min = Math.min;
var push = uncurryThis([].push);
var stringSlice = uncurryThis(''.slice);
var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {
  var re = /(?:)/;
  var originalExec = re.exec;
  re.exec = function () {
    return originalExec.apply(this, arguments);
  };
  var result = 'ab'.split(re);
  return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';
});
var BUGGY = 'abbc'.split(/(b)*/)[1] === 'c' || 'test'.split(/(?:)/, -1).length !== 4 || 'ab'.split(/(?:ab)*/).length !== 2 || '.'.split(/(.?)(.?)/).length !== 4 || '.'.split(/()()/).length > 1 || ''.split(/.?/).length;
fixRegExpWellKnownSymbolLogic('split', function (SPLIT, nativeSplit, maybeCallNative) {
  var internalSplit = '0'.split(undefined, 0).length ? function (separator, limit) {
    return separator === undefined && limit === 0 ? [] : call(nativeSplit, this, separator, limit);
  } : nativeSplit;
  return [function split(separator, limit) {
    var O = requireObjectCoercible(this);
    var splitter = isNullOrUndefined(separator) ? undefined : getMethod(separator, SPLIT);
    return splitter ? call(splitter, separator, O, limit) : call(internalSplit, toString(O), separator, limit);
  }, function (string, limit) {
    var rx = anObject(this);
    var S = toString(string);
    if (!BUGGY) {
      var res = maybeCallNative(internalSplit, rx, S, limit, internalSplit !== nativeSplit);
      if (res.done) return res.value;
    }
    var C = speciesConstructor(rx, RegExp);
    var unicodeMatching = rx.unicode;
    var flags = (rx.ignoreCase ? 'i' : '') + (rx.multiline ? 'm' : '') + (rx.unicode ? 'u' : '') + (UNSUPPORTED_Y ? 'g' : 'y');
    var splitter = new C(UNSUPPORTED_Y ? '^(?:' + rx.source + ')' : rx, flags);
    var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
    if (lim === 0) return [];
    if (S.length === 0) return regExpExec(splitter, S) === null ? [S] : [];
    var p = 0;
    var q = 0;
    var A = [];
    while (q < S.length) {
      splitter.lastIndex = UNSUPPORTED_Y ? 0 : q;
      var z = regExpExec(splitter, UNSUPPORTED_Y ? stringSlice(S, q) : S);
      var e;
      if (z === null || (e = min(toLength(splitter.lastIndex + (UNSUPPORTED_Y ? q : 0)), S.length)) === p) {
        q = advanceStringIndex(S, q, unicodeMatching);
      } else {
        push(A, stringSlice(S, p, q));
        if (A.length === lim) return A;
        for (var i = 1; i <= z.length - 1; i++) {
          push(A, z[i]);
          if (A.length === lim) return A;
        }
        q = p = e;
      }
    }
    push(A, stringSlice(S, p));
    return A;
  }];
}, BUGGY || !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC, UNSUPPORTED_Y);

},{"../internals/advance-string-index":5,"../internals/an-object":7,"../internals/fails":67,"../internals/fix-regexp-well-known-symbol-logic":68,"../internals/function-call":75,"../internals/function-uncurry-this":79,"../internals/get-method":84,"../internals/is-null-or-undefined":106,"../internals/regexp-exec-abstract":161,"../internals/regexp-sticky-helpers":165,"../internals/require-object-coercible":168,"../internals/species-constructor":177,"../internals/to-length":198,"../internals/to-string":205}],376:[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":36,"../internals/export":66,"../internals/function-uncurry-this-clause":78,"../internals/is-pure":109,"../internals/not-a-regexp":129,"../internals/object-get-own-property-descriptor":137,"../internals/require-object-coercible":168,"../internals/to-length":198,"../internals/to-string":205}],377:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var createHTML = require('../internals/create-html');
var forcedStringHTMLMethod = require('../internals/string-html-forced');
$({
  target: 'String',
  proto: true,
  forced: forcedStringHTMLMethod('strike')
}, {
  strike: function strike() {
    return createHTML(this, 'strike', '', '');
  }
});

},{"../internals/create-html":38,"../internals/export":66,"../internals/string-html-forced":178}],378:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var createHTML = require('../internals/create-html');
var forcedStringHTMLMethod = require('../internals/string-html-forced');
$({
  target: 'String',
  proto: true,
  forced: forcedStringHTMLMethod('sub')
}, {
  sub: function sub() {
    return createHTML(this, 'sub', '', '');
  }
});

},{"../internals/create-html":38,"../internals/export":66,"../internals/string-html-forced":178}],379:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var createHTML = require('../internals/create-html');
var forcedStringHTMLMethod = require('../internals/string-html-forced');
$({
  target: 'String',
  proto: true,
  forced: forcedStringHTMLMethod('sup')
}, {
  sup: function sup() {
    return createHTML(this, 'sup', '', '');
  }
});

},{"../internals/create-html":38,"../internals/export":66,"../internals/string-html-forced":178}],380:[function(require,module,exports){
'use strict';
require('../modules/es.string.trim-right');
var $ = require('../internals/export');
var trimEnd = require('../internals/string-trim-end');
$({
  target: 'String',
  proto: true,
  name: 'trimEnd',
  forced: ''.trimEnd !== trimEnd
}, {
  trimEnd: trimEnd
});

},{"../internals/export":66,"../internals/string-trim-end":184,"../modules/es.string.trim-right":382}],381:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var trimStart = require('../internals/string-trim-start');
$({
  target: 'String',
  proto: true,
  name: 'trimStart',
  forced: ''.trimLeft !== trimStart
}, {
  trimLeft: trimStart
});

},{"../internals/export":66,"../internals/string-trim-start":186}],382:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var trimEnd = require('../internals/string-trim-end');
$({
  target: 'String',
  proto: true,
  name: 'trimEnd',
  forced: ''.trimRight !== trimEnd
}, {
  trimRight: trimEnd
});

},{"../internals/export":66,"../internals/string-trim-end":184}],383:[function(require,module,exports){
'use strict';
require('../modules/es.string.trim-left');
var $ = require('../internals/export');
var trimStart = require('../internals/string-trim-start');
$({
  target: 'String',
  proto: true,
  name: 'trimStart',
  forced: ''.trimStart !== trimStart
}, {
  trimStart: trimStart
});

},{"../internals/export":66,"../internals/string-trim-start":186,"../modules/es.string.trim-left":381}],384:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var $trim = require('../internals/string-trim').trim;
var forcedStringTrimMethod = require('../internals/string-trim-forced');
$({
  target: 'String',
  proto: true,
  forced: forcedStringTrimMethod('trim')
}, {
  trim: function trim() {
    return $trim(this);
  }
});

},{"../internals/export":66,"../internals/string-trim":187,"../internals/string-trim-forced":185}],385:[function(require,module,exports){
'use strict';

var defineWellKnownSymbol = require('../internals/well-known-symbol-define');
defineWellKnownSymbol('asyncIterator');

},{"../internals/well-known-symbol-define":219}],386:[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 fallbackDefineProperty(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 get() {
      return nativeDefineProperty(this, 'a', {
        value: 7
      }).a;
    }
  })).a !== 7;
}) ? fallbackDefineProperty : nativeDefineProperty;
var wrap = function wrap(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 $getOwnPropertySymbols(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 setter(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 useSetter() {
    USE_SETTER = true;
  },
  useSimple: function useSimple() {
    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":7,"../internals/array-iteration":18,"../internals/create-property-descriptor":41,"../internals/define-built-in":46,"../internals/define-built-in-accessor":45,"../internals/descriptors":50,"../internals/export":66,"../internals/fails":67,"../internals/function-call":75,"../internals/function-uncurry-this":79,"../internals/global-this":86,"../internals/has-own-property":87,"../internals/hidden-keys":88,"../internals/internal-state":97,"../internals/is-pure":109,"../internals/object-create":134,"../internals/object-define-properties":135,"../internals/object-define-property":136,"../internals/object-get-own-property-descriptor":137,"../internals/object-get-own-property-names":139,"../internals/object-get-own-property-names-external":138,"../internals/object-get-own-property-symbols":140,"../internals/object-is-prototype-of":143,"../internals/object-keys":145,"../internals/object-property-is-enumerable":146,"../internals/set-to-string-tag":173,"../internals/shared":176,"../internals/shared-key":174,"../internals/symbol-constructor-detection":188,"../internals/symbol-define-to-primitive":189,"../internals/to-indexed-object":196,"../internals/to-property-key":203,"../internals/to-string":205,"../internals/uid":213,"../internals/well-known-symbol":221,"../internals/well-known-symbol-define":219,"../internals/well-known-symbol-wrapped":220}],387:[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":35,"../internals/define-built-in-accessor":45,"../internals/descriptors":50,"../internals/export":66,"../internals/function-uncurry-this":79,"../internals/global-this":86,"../internals/has-own-property":87,"../internals/is-callable":101,"../internals/object-is-prototype-of":143,"../internals/to-string":205}],388:[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 _for(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":66,"../internals/get-built-in":80,"../internals/has-own-property":87,"../internals/shared":176,"../internals/symbol-registry-detection":190,"../internals/to-string":205}],389:[function(require,module,exports){
'use strict';

var defineWellKnownSymbol = require('../internals/well-known-symbol-define');
defineWellKnownSymbol('hasInstance');

},{"../internals/well-known-symbol-define":219}],390:[function(require,module,exports){
'use strict';

var defineWellKnownSymbol = require('../internals/well-known-symbol-define');
defineWellKnownSymbol('isConcatSpreadable');

},{"../internals/well-known-symbol-define":219}],391:[function(require,module,exports){
'use strict';

var defineWellKnownSymbol = require('../internals/well-known-symbol-define');
defineWellKnownSymbol('iterator');

},{"../internals/well-known-symbol-define":219}],392:[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":264,"../modules/es.object.get-own-property-symbols":310,"../modules/es.symbol.constructor":386,"../modules/es.symbol.for":388,"../modules/es.symbol.key-for":393}],393:[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":66,"../internals/has-own-property":87,"../internals/is-symbol":111,"../internals/shared":176,"../internals/symbol-registry-detection":190,"../internals/try-to-string":207}],394:[function(require,module,exports){
'use strict';

var defineWellKnownSymbol = require('../internals/well-known-symbol-define');
defineWellKnownSymbol('match');

},{"../internals/well-known-symbol-define":219}],395:[function(require,module,exports){
'use strict';

var defineWellKnownSymbol = require('../internals/well-known-symbol-define');
defineWellKnownSymbol('replace');

},{"../internals/well-known-symbol-define":219}],396:[function(require,module,exports){
'use strict';

var defineWellKnownSymbol = require('../internals/well-known-symbol-define');
defineWellKnownSymbol('search');

},{"../internals/well-known-symbol-define":219}],397:[function(require,module,exports){
'use strict';

var defineWellKnownSymbol = require('../internals/well-known-symbol-define');
defineWellKnownSymbol('species');

},{"../internals/well-known-symbol-define":219}],398:[function(require,module,exports){
'use strict';

var defineWellKnownSymbol = require('../internals/well-known-symbol-define');
defineWellKnownSymbol('split');

},{"../internals/well-known-symbol-define":219}],399:[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":189,"../internals/well-known-symbol-define":219}],400:[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":80,"../internals/set-to-string-tag":173,"../internals/well-known-symbol-define":219}],401:[function(require,module,exports){
'use strict';

var defineWellKnownSymbol = require('../internals/well-known-symbol-define');
defineWellKnownSymbol('unscopables');

},{"../internals/well-known-symbol-define":219}],402:[function(require,module,exports){
'use strict';

var uncurryThis = require('../internals/function-uncurry-this');
var ArrayBufferViewCore = require('../internals/array-buffer-view-core');
var $ArrayCopyWithin = require('../internals/array-copy-within');
var u$ArrayCopyWithin = uncurryThis($ArrayCopyWithin);
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
exportTypedArrayMethod('copyWithin', function copyWithin(target, start) {
  return u$ArrayCopyWithin(aTypedArray(this), target, start, arguments.length > 2 ? arguments[2] : undefined);
});

},{"../internals/array-buffer-view-core":10,"../internals/array-copy-within":12,"../internals/function-uncurry-this":79}],403:[function(require,module,exports){
'use strict';

var ArrayBufferViewCore = require('../internals/array-buffer-view-core');
var $every = require('../internals/array-iteration').every;
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
exportTypedArrayMethod('every', function every(callbackfn) {
  return $every(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
});

},{"../internals/array-buffer-view-core":10,"../internals/array-iteration":18}],404:[function(require,module,exports){
'use strict';

var ArrayBufferViewCore = require('../internals/array-buffer-view-core');
var $fill = require('../internals/array-fill');
var toBigInt = require('../internals/to-big-int');
var classof = require('../internals/classof');
var call = require('../internals/function-call');
var uncurryThis = require('../internals/function-uncurry-this');
var fails = require('../internals/fails');
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
var slice = uncurryThis(''.slice);
var CONVERSION_BUG = fails(function () {
  var count = 0;
  new Int8Array(2).fill({
    valueOf: function valueOf() {
      return count++;
    }
  });
  return count !== 1;
});
exportTypedArrayMethod('fill', function fill(value) {
  var length = arguments.length;
  aTypedArray(this);
  var actualValue = slice(classof(this), 0, 3) === 'Big' ? toBigInt(value) : +value;
  return call($fill, this, actualValue, length > 1 ? arguments[1] : undefined, length > 2 ? arguments[2] : undefined);
}, CONVERSION_BUG);

},{"../internals/array-buffer-view-core":10,"../internals/array-fill":13,"../internals/classof":31,"../internals/fails":67,"../internals/function-call":75,"../internals/function-uncurry-this":79,"../internals/to-big-int":194}],405:[function(require,module,exports){
'use strict';

var ArrayBufferViewCore = require('../internals/array-buffer-view-core');
var $filter = require('../internals/array-iteration').filter;
var fromSpeciesAndList = require('../internals/typed-array-from-species-and-list');
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
exportTypedArrayMethod('filter', function filter(callbackfn) {
  var list = $filter(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  return fromSpeciesAndList(this, list);
});

},{"../internals/array-buffer-view-core":10,"../internals/array-iteration":18,"../internals/typed-array-from-species-and-list":210}],406:[function(require,module,exports){
'use strict';

var ArrayBufferViewCore = require('../internals/array-buffer-view-core');
var $findIndex = require('../internals/array-iteration').findIndex;
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
exportTypedArrayMethod('findIndex', function findIndex(predicate) {
  return $findIndex(aTypedArray(this), predicate, arguments.length > 1 ? arguments[1] : undefined);
});

},{"../internals/array-buffer-view-core":10,"../internals/array-iteration":18}],407:[function(require,module,exports){
'use strict';

var ArrayBufferViewCore = require('../internals/array-buffer-view-core');
var $find = require('../internals/array-iteration').find;
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
exportTypedArrayMethod('find', function find(predicate) {
  return $find(aTypedArray(this), predicate, arguments.length > 1 ? arguments[1] : undefined);
});

},{"../internals/array-buffer-view-core":10,"../internals/array-iteration":18}],408:[function(require,module,exports){
'use strict';

var createTypedArrayConstructor = require('../internals/typed-array-constructor');
createTypedArrayConstructor('Float32', function (init) {
  return function Float32Array(data, byteOffset, length) {
    return init(this, data, byteOffset, length);
  };
});

},{"../internals/typed-array-constructor":208}],409:[function(require,module,exports){
'use strict';

var createTypedArrayConstructor = require('../internals/typed-array-constructor');
createTypedArrayConstructor('Float64', function (init) {
  return function Float64Array(data, byteOffset, length) {
    return init(this, data, byteOffset, length);
  };
});

},{"../internals/typed-array-constructor":208}],410:[function(require,module,exports){
'use strict';

var ArrayBufferViewCore = require('../internals/array-buffer-view-core');
var $forEach = require('../internals/array-iteration').forEach;
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
exportTypedArrayMethod('forEach', function forEach(callbackfn) {
  $forEach(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
});

},{"../internals/array-buffer-view-core":10,"../internals/array-iteration":18}],411:[function(require,module,exports){
'use strict';

var TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS = require('../internals/typed-array-constructors-require-wrappers');
var exportTypedArrayStaticMethod = require('../internals/array-buffer-view-core').exportTypedArrayStaticMethod;
var typedArrayFrom = require('../internals/typed-array-from');
exportTypedArrayStaticMethod('from', typedArrayFrom, TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS);

},{"../internals/array-buffer-view-core":10,"../internals/typed-array-constructors-require-wrappers":209,"../internals/typed-array-from":211}],412:[function(require,module,exports){
'use strict';

var ArrayBufferViewCore = require('../internals/array-buffer-view-core');
var $includes = require('../internals/array-includes').includes;
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
exportTypedArrayMethod('includes', function includes(searchElement) {
  return $includes(aTypedArray(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);
});

},{"../internals/array-buffer-view-core":10,"../internals/array-includes":17}],413:[function(require,module,exports){
'use strict';

var ArrayBufferViewCore = require('../internals/array-buffer-view-core');
var $indexOf = require('../internals/array-includes').indexOf;
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
exportTypedArrayMethod('indexOf', function indexOf(searchElement) {
  return $indexOf(aTypedArray(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);
});

},{"../internals/array-buffer-view-core":10,"../internals/array-includes":17}],414:[function(require,module,exports){
'use strict';

var createTypedArrayConstructor = require('../internals/typed-array-constructor');
createTypedArrayConstructor('Int16', function (init) {
  return function Int16Array(data, byteOffset, length) {
    return init(this, data, byteOffset, length);
  };
});

},{"../internals/typed-array-constructor":208}],415:[function(require,module,exports){
'use strict';

var createTypedArrayConstructor = require('../internals/typed-array-constructor');
createTypedArrayConstructor('Int32', function (init) {
  return function Int32Array(data, byteOffset, length) {
    return init(this, data, byteOffset, length);
  };
});

},{"../internals/typed-array-constructor":208}],416:[function(require,module,exports){
'use strict';

var createTypedArrayConstructor = require('../internals/typed-array-constructor');
createTypedArrayConstructor('Int8', function (init) {
  return function Int8Array(data, byteOffset, length) {
    return init(this, data, byteOffset, length);
  };
});

},{"../internals/typed-array-constructor":208}],417:[function(require,module,exports){
'use strict';

var globalThis = require('../internals/global-this');
var fails = require('../internals/fails');
var uncurryThis = require('../internals/function-uncurry-this');
var ArrayBufferViewCore = require('../internals/array-buffer-view-core');
var ArrayIterators = require('../modules/es.array.iterator');
var wellKnownSymbol = require('../internals/well-known-symbol');
var ITERATOR = wellKnownSymbol('iterator');
var Uint8Array = globalThis.Uint8Array;
var arrayValues = uncurryThis(ArrayIterators.values);
var arrayKeys = uncurryThis(ArrayIterators.keys);
var arrayEntries = uncurryThis(ArrayIterators.entries);
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
var TypedArrayPrototype = Uint8Array && Uint8Array.prototype;
var GENERIC = !fails(function () {
  TypedArrayPrototype[ITERATOR].call([1]);
});
var ITERATOR_IS_VALUES = !!TypedArrayPrototype && TypedArrayPrototype.values && TypedArrayPrototype[ITERATOR] === TypedArrayPrototype.values && TypedArrayPrototype.values.name === 'values';
var typedArrayValues = function values() {
  return arrayValues(aTypedArray(this));
};
exportTypedArrayMethod('entries', function entries() {
  return arrayEntries(aTypedArray(this));
}, GENERIC);
exportTypedArrayMethod('keys', function keys() {
  return arrayKeys(aTypedArray(this));
}, GENERIC);
exportTypedArrayMethod('values', typedArrayValues, GENERIC || !ITERATOR_IS_VALUES, {
  name: 'values'
});
exportTypedArrayMethod(ITERATOR, typedArrayValues, GENERIC || !ITERATOR_IS_VALUES, {
  name: 'values'
});

},{"../internals/array-buffer-view-core":10,"../internals/fails":67,"../internals/function-uncurry-this":79,"../internals/global-this":86,"../internals/well-known-symbol":221,"../modules/es.array.iterator":240}],418:[function(require,module,exports){
'use strict';

var ArrayBufferViewCore = require('../internals/array-buffer-view-core');
var uncurryThis = require('../internals/function-uncurry-this');
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
var $join = uncurryThis([].join);
exportTypedArrayMethod('join', function join(separator) {
  return $join(aTypedArray(this), separator);
});

},{"../internals/array-buffer-view-core":10,"../internals/function-uncurry-this":79}],419:[function(require,module,exports){
'use strict';

var ArrayBufferViewCore = require('../internals/array-buffer-view-core');
var apply = require('../internals/function-apply');
var $lastIndexOf = require('../internals/array-last-index-of');
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
exportTypedArrayMethod('lastIndexOf', function lastIndexOf(searchElement) {
  var length = arguments.length;
  return apply($lastIndexOf, aTypedArray(this), length > 1 ? [searchElement, arguments[1]] : [searchElement]);
});

},{"../internals/array-buffer-view-core":10,"../internals/array-last-index-of":19,"../internals/function-apply":71}],420:[function(require,module,exports){
'use strict';

var ArrayBufferViewCore = require('../internals/array-buffer-view-core');
var $map = require('../internals/array-iteration').map;
var typedArraySpeciesConstructor = require('../internals/typed-array-species-constructor');
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
exportTypedArrayMethod('map', function map(mapfn) {
  return $map(aTypedArray(this), mapfn, arguments.length > 1 ? arguments[1] : undefined, function (O, length) {
    return new (typedArraySpeciesConstructor(O))(length);
  });
});

},{"../internals/array-buffer-view-core":10,"../internals/array-iteration":18,"../internals/typed-array-species-constructor":212}],421:[function(require,module,exports){
'use strict';

var ArrayBufferViewCore = require('../internals/array-buffer-view-core');
var TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS = require('../internals/typed-array-constructors-require-wrappers');
var aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor;
var exportTypedArrayStaticMethod = ArrayBufferViewCore.exportTypedArrayStaticMethod;
exportTypedArrayStaticMethod('of', function of() {
  var index = 0;
  var length = arguments.length;
  var result = new (aTypedArrayConstructor(this))(length);
  while (length > index) result[index] = arguments[index++];
  return result;
}, TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS);

},{"../internals/array-buffer-view-core":10,"../internals/typed-array-constructors-require-wrappers":209}],422:[function(require,module,exports){
'use strict';

var ArrayBufferViewCore = require('../internals/array-buffer-view-core');
var $reduceRight = require('../internals/array-reduce').right;
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
exportTypedArrayMethod('reduceRight', function reduceRight(callbackfn) {
  var length = arguments.length;
  return $reduceRight(aTypedArray(this), callbackfn, length, length > 1 ? arguments[1] : undefined);
});

},{"../internals/array-buffer-view-core":10,"../internals/array-reduce":22}],423:[function(require,module,exports){
'use strict';

var ArrayBufferViewCore = require('../internals/array-buffer-view-core');
var $reduce = require('../internals/array-reduce').left;
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
exportTypedArrayMethod('reduce', function reduce(callbackfn) {
  var length = arguments.length;
  return $reduce(aTypedArray(this), callbackfn, length, length > 1 ? arguments[1] : undefined);
});

},{"../internals/array-buffer-view-core":10,"../internals/array-reduce":22}],424:[function(require,module,exports){
'use strict';

var ArrayBufferViewCore = require('../internals/array-buffer-view-core');
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
var floor = Math.floor;
exportTypedArrayMethod('reverse', function reverse() {
  var that = this;
  var length = aTypedArray(that).length;
  var middle = floor(length / 2);
  var index = 0;
  var value;
  while (index < middle) {
    value = that[index];
    that[index++] = that[--length];
    that[length] = value;
  }
  return that;
});

},{"../internals/array-buffer-view-core":10}],425:[function(require,module,exports){
'use strict';

var globalThis = require('../internals/global-this');
var call = require('../internals/function-call');
var ArrayBufferViewCore = require('../internals/array-buffer-view-core');
var lengthOfArrayLike = require('../internals/length-of-array-like');
var toOffset = require('../internals/to-offset');
var toIndexedObject = require('../internals/to-object');
var fails = require('../internals/fails');
var RangeError = globalThis.RangeError;
var Int8Array = globalThis.Int8Array;
var Int8ArrayPrototype = Int8Array && Int8Array.prototype;
var $set = Int8ArrayPrototype && Int8ArrayPrototype.set;
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
var WORKS_WITH_OBJECTS_AND_GENERIC_ON_TYPED_ARRAYS = !fails(function () {
  var array = new Uint8ClampedArray(2);
  call($set, array, {
    length: 1,
    0: 3
  }, 1);
  return array[1] !== 3;
});
var TO_OBJECT_BUG = WORKS_WITH_OBJECTS_AND_GENERIC_ON_TYPED_ARRAYS && ArrayBufferViewCore.NATIVE_ARRAY_BUFFER_VIEWS && fails(function () {
  var array = new Int8Array(2);
  array.set(1);
  array.set('2', 1);
  return array[0] !== 0 || array[1] !== 2;
});
exportTypedArrayMethod('set', function set(arrayLike) {
  aTypedArray(this);
  var offset = toOffset(arguments.length > 1 ? arguments[1] : undefined, 1);
  var src = toIndexedObject(arrayLike);
  if (WORKS_WITH_OBJECTS_AND_GENERIC_ON_TYPED_ARRAYS) return call($set, this, src, offset);
  var length = this.length;
  var len = lengthOfArrayLike(src);
  var index = 0;
  if (len + offset > length) throw new RangeError('Wrong length');
  while (index < len) this[offset + index] = src[index++];
}, !WORKS_WITH_OBJECTS_AND_GENERIC_ON_TYPED_ARRAYS || TO_OBJECT_BUG);

},{"../internals/array-buffer-view-core":10,"../internals/fails":67,"../internals/function-call":75,"../internals/global-this":86,"../internals/length-of-array-like":118,"../internals/to-object":199,"../internals/to-offset":200}],426:[function(require,module,exports){
'use strict';

var ArrayBufferViewCore = require('../internals/array-buffer-view-core');
var typedArraySpeciesConstructor = require('../internals/typed-array-species-constructor');
var fails = require('../internals/fails');
var arraySlice = require('../internals/array-slice');
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
var FORCED = fails(function () {
  new Int8Array(1).slice();
});
exportTypedArrayMethod('slice', function slice(start, end) {
  var list = arraySlice(aTypedArray(this), start, end);
  var C = typedArraySpeciesConstructor(this);
  var index = 0;
  var length = list.length;
  var result = new C(length);
  while (length > index) result[index] = list[index++];
  return result;
}, FORCED);

},{"../internals/array-buffer-view-core":10,"../internals/array-slice":24,"../internals/fails":67,"../internals/typed-array-species-constructor":212}],427:[function(require,module,exports){
'use strict';

var ArrayBufferViewCore = require('../internals/array-buffer-view-core');
var $some = require('../internals/array-iteration').some;
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
exportTypedArrayMethod('some', function some(callbackfn) {
  return $some(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
});

},{"../internals/array-buffer-view-core":10,"../internals/array-iteration":18}],428:[function(require,module,exports){
'use strict';

var globalThis = require('../internals/global-this');
var uncurryThis = require('../internals/function-uncurry-this-clause');
var fails = require('../internals/fails');
var aCallable = require('../internals/a-callable');
var internalSort = require('../internals/array-sort');
var ArrayBufferViewCore = require('../internals/array-buffer-view-core');
var FF = require('../internals/environment-ff-version');
var IE_OR_EDGE = require('../internals/environment-is-ie-or-edge');
var V8 = require('../internals/environment-v8-version');
var WEBKIT = require('../internals/environment-webkit-version');
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
var Uint16Array = globalThis.Uint16Array;
var nativeSort = Uint16Array && uncurryThis(Uint16Array.prototype.sort);
var ACCEPT_INCORRECT_ARGUMENTS = !!nativeSort && !(fails(function () {
  nativeSort(new Uint16Array(2), null);
}) && fails(function () {
  nativeSort(new Uint16Array(2), {});
}));
var STABLE_SORT = !!nativeSort && !fails(function () {
  if (V8) return V8 < 74;
  if (FF) return FF < 67;
  if (IE_OR_EDGE) return true;
  if (WEBKIT) return WEBKIT < 602;
  var array = new Uint16Array(516);
  var expected = Array(516);
  var index, mod;
  for (index = 0; index < 516; index++) {
    mod = index % 4;
    array[index] = 515 - index;
    expected[index] = index - 2 * mod + 3;
  }
  nativeSort(array, function (a, b) {
    return (a / 4 | 0) - (b / 4 | 0);
  });
  for (index = 0; index < 516; index++) {
    if (array[index] !== expected[index]) return true;
  }
});
var getSortCompare = function getSortCompare(comparefn) {
  return function (x, y) {
    if (comparefn !== undefined) return +comparefn(x, y) || 0;
    if (y !== y) return -1;
    if (x !== x) return 1;
    if (x === 0 && y === 0) return 1 / x > 0 && 1 / y < 0 ? 1 : -1;
    return x > y;
  };
};
exportTypedArrayMethod('sort', function sort(comparefn) {
  if (comparefn !== undefined) aCallable(comparefn);
  if (STABLE_SORT) return nativeSort(this, comparefn);
  return internalSort(aTypedArray(this), getSortCompare(comparefn));
}, !STABLE_SORT || ACCEPT_INCORRECT_ARGUMENTS);

},{"../internals/a-callable":1,"../internals/array-buffer-view-core":10,"../internals/array-sort":25,"../internals/environment-ff-version":56,"../internals/environment-is-ie-or-edge":57,"../internals/environment-v8-version":63,"../internals/environment-webkit-version":64,"../internals/fails":67,"../internals/function-uncurry-this-clause":78,"../internals/global-this":86}],429:[function(require,module,exports){
'use strict';

var ArrayBufferViewCore = require('../internals/array-buffer-view-core');
var toLength = require('../internals/to-length');
var toAbsoluteIndex = require('../internals/to-absolute-index');
var typedArraySpeciesConstructor = require('../internals/typed-array-species-constructor');
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
exportTypedArrayMethod('subarray', function subarray(begin, end) {
  var O = aTypedArray(this);
  var length = O.length;
  var beginIndex = toAbsoluteIndex(begin, length);
  var C = typedArraySpeciesConstructor(O);
  return new C(O.buffer, O.byteOffset + beginIndex * O.BYTES_PER_ELEMENT, toLength((end === undefined ? length : toAbsoluteIndex(end, length)) - beginIndex));
});

},{"../internals/array-buffer-view-core":10,"../internals/to-absolute-index":193,"../internals/to-length":198,"../internals/typed-array-species-constructor":212}],430:[function(require,module,exports){
'use strict';

var globalThis = require('../internals/global-this');
var apply = require('../internals/function-apply');
var ArrayBufferViewCore = require('../internals/array-buffer-view-core');
var fails = require('../internals/fails');
var arraySlice = require('../internals/array-slice');
var Int8Array = globalThis.Int8Array;
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
var $toLocaleString = [].toLocaleString;
var TO_LOCALE_STRING_BUG = !!Int8Array && fails(function () {
  $toLocaleString.call(new Int8Array(1));
});
var FORCED = fails(function () {
  return [1, 2].toLocaleString() !== new Int8Array([1, 2]).toLocaleString();
}) || !fails(function () {
  Int8Array.prototype.toLocaleString.call([1, 2]);
});
exportTypedArrayMethod('toLocaleString', function toLocaleString() {
  return apply($toLocaleString, TO_LOCALE_STRING_BUG ? arraySlice(aTypedArray(this)) : aTypedArray(this), arraySlice(arguments));
}, FORCED);

},{"../internals/array-buffer-view-core":10,"../internals/array-slice":24,"../internals/fails":67,"../internals/function-apply":71,"../internals/global-this":86}],431:[function(require,module,exports){
'use strict';

var exportTypedArrayMethod = require('../internals/array-buffer-view-core').exportTypedArrayMethod;
var fails = require('../internals/fails');
var globalThis = require('../internals/global-this');
var uncurryThis = require('../internals/function-uncurry-this');
var Uint8Array = globalThis.Uint8Array;
var Uint8ArrayPrototype = Uint8Array && Uint8Array.prototype || {};
var arrayToString = [].toString;
var join = uncurryThis([].join);
if (fails(function () {
  arrayToString.call({});
})) {
  arrayToString = function toString() {
    return join(this);
  };
}
var IS_NOT_ARRAY_METHOD = Uint8ArrayPrototype.toString !== arrayToString;
exportTypedArrayMethod('toString', arrayToString, IS_NOT_ARRAY_METHOD);

},{"../internals/array-buffer-view-core":10,"../internals/fails":67,"../internals/function-uncurry-this":79,"../internals/global-this":86}],432:[function(require,module,exports){
'use strict';

var createTypedArrayConstructor = require('../internals/typed-array-constructor');
createTypedArrayConstructor('Uint16', function (init) {
  return function Uint16Array(data, byteOffset, length) {
    return init(this, data, byteOffset, length);
  };
});

},{"../internals/typed-array-constructor":208}],433:[function(require,module,exports){
'use strict';

var createTypedArrayConstructor = require('../internals/typed-array-constructor');
createTypedArrayConstructor('Uint32', function (init) {
  return function Uint32Array(data, byteOffset, length) {
    return init(this, data, byteOffset, length);
  };
});

},{"../internals/typed-array-constructor":208}],434:[function(require,module,exports){
'use strict';

var createTypedArrayConstructor = require('../internals/typed-array-constructor');
createTypedArrayConstructor('Uint8', function (init) {
  return function Uint8Array(data, byteOffset, length) {
    return init(this, data, byteOffset, length);
  };
});

},{"../internals/typed-array-constructor":208}],435:[function(require,module,exports){
'use strict';

var createTypedArrayConstructor = require('../internals/typed-array-constructor');
createTypedArrayConstructor('Uint8', function (init) {
  return function Uint8ClampedArray(data, byteOffset, length) {
    return init(this, data, byteOffset, length);
  };
}, true);

},{"../internals/typed-array-constructor":208}],436:[function(require,module,exports){
'use strict';

var FREEZING = require('../internals/freezing');
var globalThis = require('../internals/global-this');
var uncurryThis = require('../internals/function-uncurry-this');
var defineBuiltIns = require('../internals/define-built-ins');
var InternalMetadataModule = require('../internals/internal-metadata');
var collection = require('../internals/collection');
var collectionWeak = require('../internals/collection-weak');
var isObject = require('../internals/is-object');
var enforceInternalState = require('../internals/internal-state').enforce;
var fails = require('../internals/fails');
var NATIVE_WEAK_MAP = require('../internals/weak-map-basic-detection');
var $Object = Object;
var isArray = Array.isArray;
var isExtensible = $Object.isExtensible;
var isFrozen = $Object.isFrozen;
var isSealed = $Object.isSealed;
var freeze = $Object.freeze;
var seal = $Object.seal;
var IS_IE11 = !globalThis.ActiveXObject && 'ActiveXObject' in globalThis;
var InternalWeakMap;
var wrapper = function wrapper(init) {
  return function WeakMap() {
    return init(this, arguments.length ? arguments[0] : undefined);
  };
};
var $WeakMap = collection('WeakMap', wrapper, collectionWeak);
var WeakMapPrototype = $WeakMap.prototype;
var nativeSet = uncurryThis(WeakMapPrototype.set);
var hasMSEdgeFreezingBug = function hasMSEdgeFreezingBug() {
  return FREEZING && fails(function () {
    var frozenArray = freeze([]);
    nativeSet(new $WeakMap(), frozenArray, 1);
    return !isFrozen(frozenArray);
  });
};
if (NATIVE_WEAK_MAP) if (IS_IE11) {
  InternalWeakMap = collectionWeak.getConstructor(wrapper, 'WeakMap', true);
  InternalMetadataModule.enable();
  var nativeDelete = uncurryThis(WeakMapPrototype['delete']);
  var nativeHas = uncurryThis(WeakMapPrototype.has);
  var nativeGet = uncurryThis(WeakMapPrototype.get);
  defineBuiltIns(WeakMapPrototype, {
    'delete': function _delete(key) {
      if (isObject(key) && !isExtensible(key)) {
        var state = enforceInternalState(this);
        if (!state.frozen) state.frozen = new InternalWeakMap();
        return nativeDelete(this, key) || state.frozen['delete'](key);
      }
      return nativeDelete(this, key);
    },
    has: function has(key) {
      if (isObject(key) && !isExtensible(key)) {
        var state = enforceInternalState(this);
        if (!state.frozen) state.frozen = new InternalWeakMap();
        return nativeHas(this, key) || state.frozen.has(key);
      }
      return nativeHas(this, key);
    },
    get: function get(key) {
      if (isObject(key) && !isExtensible(key)) {
        var state = enforceInternalState(this);
        if (!state.frozen) state.frozen = new InternalWeakMap();
        return nativeHas(this, key) ? nativeGet(this, key) : state.frozen.get(key);
      }
      return nativeGet(this, key);
    },
    set: function set(key, value) {
      if (isObject(key) && !isExtensible(key)) {
        var state = enforceInternalState(this);
        if (!state.frozen) state.frozen = new InternalWeakMap();
        nativeHas(this, key) ? nativeSet(this, key, value) : state.frozen.set(key, value);
      } else nativeSet(this, key, value);
      return this;
    }
  });
} else if (hasMSEdgeFreezingBug()) {
  defineBuiltIns(WeakMapPrototype, {
    set: function set(key, value) {
      var arrayIntegrityLevel;
      if (isArray(key)) {
        if (isFrozen(key)) arrayIntegrityLevel = freeze;else if (isSealed(key)) arrayIntegrityLevel = seal;
      }
      nativeSet(this, key, value);
      if (arrayIntegrityLevel) arrayIntegrityLevel(key);
      return this;
    }
  });
}

},{"../internals/collection":34,"../internals/collection-weak":33,"../internals/define-built-ins":47,"../internals/fails":67,"../internals/freezing":70,"../internals/function-uncurry-this":79,"../internals/global-this":86,"../internals/internal-metadata":96,"../internals/internal-state":97,"../internals/is-object":107,"../internals/weak-map-basic-detection":218}],437:[function(require,module,exports){
'use strict';
require('../modules/es.weak-map.constructor');

},{"../modules/es.weak-map.constructor":436}],438:[function(require,module,exports){
'use strict';

var collection = require('../internals/collection');
var collectionWeak = require('../internals/collection-weak');
collection('WeakSet', function (init) {
  return function WeakSet() {
    return init(this, arguments.length ? arguments[0] : undefined);
  };
}, collectionWeak);

},{"../internals/collection":34,"../internals/collection-weak":33}],439:[function(require,module,exports){
'use strict';
require('../modules/es.weak-set.constructor');

},{"../modules/es.weak-set.constructor":438}],440:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var globalThis = require('../internals/global-this');
var clearImmediate = require('../internals/task').clear;
$({
  global: true,
  bind: true,
  enumerable: true,
  forced: globalThis.clearImmediate !== clearImmediate
}, {
  clearImmediate: clearImmediate
});

},{"../internals/export":66,"../internals/global-this":86,"../internals/task":191}],441:[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 forEach = require('../internals/array-for-each');
var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
var handlePrototype = function handlePrototype(CollectionPrototype) {
  if (CollectionPrototype && CollectionPrototype.forEach !== forEach) try {
    createNonEnumerableProperty(CollectionPrototype, 'forEach', forEach);
  } catch (error) {
    CollectionPrototype.forEach = forEach;
  }
};
for (var COLLECTION_NAME in DOMIterables) {
  if (DOMIterables[COLLECTION_NAME]) {
    handlePrototype(globalThis[COLLECTION_NAME] && globalThis[COLLECTION_NAME].prototype);
  }
}
handlePrototype(DOMTokenListPrototype);

},{"../internals/array-for-each":14,"../internals/create-non-enumerable-property":40,"../internals/dom-iterables":53,"../internals/dom-token-list-prototype":54,"../internals/global-this":86}],442:[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 handlePrototype(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":40,"../internals/dom-iterables":53,"../internals/dom-token-list-prototype":54,"../internals/global-this":86,"../internals/set-to-string-tag":173,"../internals/well-known-symbol":221,"../modules/es.array.iterator":240}],443:[function(require,module,exports){
'use strict';
require('../modules/web.clear-immediate');
require('../modules/web.set-immediate');

},{"../modules/web.clear-immediate":440,"../modules/web.set-immediate":445}],444:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var globalThis = require('../internals/global-this');
var microtask = require('../internals/microtask');
var aCallable = require('../internals/a-callable');
var validateArgumentsLength = require('../internals/validate-arguments-length');
var fails = require('../internals/fails');
var DESCRIPTORS = require('../internals/descriptors');
var WRONG_ARITY = fails(function () {
  return DESCRIPTORS && Object.getOwnPropertyDescriptor(globalThis, 'queueMicrotask').value.length !== 1;
});
$({
  global: true,
  enumerable: true,
  dontCallGetSet: true,
  forced: WRONG_ARITY
}, {
  queueMicrotask: function queueMicrotask(fn) {
    validateArgumentsLength(arguments.length, 1);
    microtask(aCallable(fn));
  }
});

},{"../internals/a-callable":1,"../internals/descriptors":50,"../internals/export":66,"../internals/fails":67,"../internals/global-this":86,"../internals/microtask":127,"../internals/validate-arguments-length":217}],445:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var globalThis = require('../internals/global-this');
var setTask = require('../internals/task').set;
var schedulersFix = require('../internals/schedulers-fix');
var setImmediate = globalThis.setImmediate ? schedulersFix(setTask, false) : setTask;
$({
  global: true,
  bind: true,
  enumerable: true,
  forced: globalThis.setImmediate !== setImmediate
}, {
  setImmediate: setImmediate
});

},{"../internals/export":66,"../internals/global-this":86,"../internals/schedulers-fix":171,"../internals/task":191}],446:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var globalThis = require('../internals/global-this');
var schedulersFix = require('../internals/schedulers-fix');
var setInterval = schedulersFix(globalThis.setInterval, true);
$({
  global: true,
  bind: true,
  forced: globalThis.setInterval !== setInterval
}, {
  setInterval: setInterval
});

},{"../internals/export":66,"../internals/global-this":86,"../internals/schedulers-fix":171}],447:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var globalThis = require('../internals/global-this');
var schedulersFix = require('../internals/schedulers-fix');
var setTimeout = schedulersFix(globalThis.setTimeout, true);
$({
  global: true,
  bind: true,
  forced: globalThis.setTimeout !== setTimeout
}, {
  setTimeout: setTimeout
});

},{"../internals/export":66,"../internals/global-this":86,"../internals/schedulers-fix":171}],448:[function(require,module,exports){
'use strict';
require('../modules/web.set-interval');
require('../modules/web.set-timeout');

},{"../modules/web.set-interval":446,"../modules/web.set-timeout":447}],449:[function(require,module,exports){
'use strict';
require('../modules/es.array.iterator');
require('../modules/es.string.from-code-point');
var $ = require('../internals/export');
var globalThis = require('../internals/global-this');
var safeGetBuiltIn = require('../internals/safe-get-built-in');
var getBuiltIn = require('../internals/get-built-in');
var call = require('../internals/function-call');
var uncurryThis = require('../internals/function-uncurry-this');
var DESCRIPTORS = require('../internals/descriptors');
var USE_NATIVE_URL = require('../internals/url-constructor-detection');
var defineBuiltIn = require('../internals/define-built-in');
var defineBuiltInAccessor = require('../internals/define-built-in-accessor');
var defineBuiltIns = require('../internals/define-built-ins');
var setToStringTag = require('../internals/set-to-string-tag');
var createIteratorConstructor = require('../internals/iterator-create-constructor');
var InternalStateModule = require('../internals/internal-state');
var anInstance = require('../internals/an-instance');
var isCallable = require('../internals/is-callable');
var hasOwn = require('../internals/has-own-property');
var bind = require('../internals/function-bind-context');
var classof = require('../internals/classof');
var anObject = require('../internals/an-object');
var isObject = require('../internals/is-object');
var $toString = require('../internals/to-string');
var create = require('../internals/object-create');
var createPropertyDescriptor = require('../internals/create-property-descriptor');
var getIterator = require('../internals/get-iterator');
var getIteratorMethod = require('../internals/get-iterator-method');
var createIterResultObject = require('../internals/create-iter-result-object');
var validateArgumentsLength = require('../internals/validate-arguments-length');
var wellKnownSymbol = require('../internals/well-known-symbol');
var arraySort = require('../internals/array-sort');
var ITERATOR = wellKnownSymbol('iterator');
var URL_SEARCH_PARAMS = 'URLSearchParams';
var URL_SEARCH_PARAMS_ITERATOR = URL_SEARCH_PARAMS + 'Iterator';
var setInternalState = InternalStateModule.set;
var getInternalParamsState = InternalStateModule.getterFor(URL_SEARCH_PARAMS);
var getInternalIteratorState = InternalStateModule.getterFor(URL_SEARCH_PARAMS_ITERATOR);
var nativeFetch = safeGetBuiltIn('fetch');
var NativeRequest = safeGetBuiltIn('Request');
var Headers = safeGetBuiltIn('Headers');
var RequestPrototype = NativeRequest && NativeRequest.prototype;
var HeadersPrototype = Headers && Headers.prototype;
var TypeError = globalThis.TypeError;
var encodeURIComponent = globalThis.encodeURIComponent;
var fromCharCode = String.fromCharCode;
var fromCodePoint = getBuiltIn('String', 'fromCodePoint');
var $parseInt = parseInt;
var charAt = uncurryThis(''.charAt);
var join = uncurryThis([].join);
var push = uncurryThis([].push);
var replace = uncurryThis(''.replace);
var shift = uncurryThis([].shift);
var splice = uncurryThis([].splice);
var split = uncurryThis(''.split);
var stringSlice = uncurryThis(''.slice);
var exec = uncurryThis(/./.exec);
var plus = /\+/g;
var FALLBACK_REPLACER = "\uFFFD";
var VALID_HEX = /^[0-9a-f]+$/i;
var parseHexOctet = function parseHexOctet(string, start) {
  var substr = stringSlice(string, start, start + 2);
  if (!exec(VALID_HEX, substr)) return NaN;
  return $parseInt(substr, 16);
};
var getLeadingOnes = function getLeadingOnes(octet) {
  var count = 0;
  for (var mask = 0x80; mask > 0 && (octet & mask) !== 0; mask >>= 1) {
    count++;
  }
  return count;
};
var utf8Decode = function utf8Decode(octets) {
  var codePoint = null;
  switch (octets.length) {
    case 1:
      codePoint = octets[0];
      break;
    case 2:
      codePoint = (octets[0] & 0x1F) << 6 | octets[1] & 0x3F;
      break;
    case 3:
      codePoint = (octets[0] & 0x0F) << 12 | (octets[1] & 0x3F) << 6 | octets[2] & 0x3F;
      break;
    case 4:
      codePoint = (octets[0] & 0x07) << 18 | (octets[1] & 0x3F) << 12 | (octets[2] & 0x3F) << 6 | octets[3] & 0x3F;
      break;
  }
  return codePoint > 0x10FFFF ? null : codePoint;
};
var decode = function decode(input) {
  input = replace(input, plus, ' ');
  var length = input.length;
  var result = '';
  var i = 0;
  while (i < length) {
    var decodedChar = charAt(input, i);
    if (decodedChar === '%') {
      if (charAt(input, i + 1) === '%' || i + 3 > length) {
        result += '%';
        i++;
        continue;
      }
      var octet = parseHexOctet(input, i + 1);
      if (octet !== octet) {
        result += decodedChar;
        i++;
        continue;
      }
      i += 2;
      var byteSequenceLength = getLeadingOnes(octet);
      if (byteSequenceLength === 0) {
        decodedChar = fromCharCode(octet);
      } else {
        if (byteSequenceLength === 1 || byteSequenceLength > 4) {
          result += FALLBACK_REPLACER;
          i++;
          continue;
        }
        var octets = [octet];
        var sequenceIndex = 1;
        while (sequenceIndex < byteSequenceLength) {
          i++;
          if (i + 3 > length || charAt(input, i) !== '%') break;
          var nextByte = parseHexOctet(input, i + 1);
          if (nextByte !== nextByte) {
            i += 3;
            break;
          }
          if (nextByte > 191 || nextByte < 128) break;
          push(octets, nextByte);
          i += 2;
          sequenceIndex++;
        }
        if (octets.length !== byteSequenceLength) {
          result += FALLBACK_REPLACER;
          continue;
        }
        var codePoint = utf8Decode(octets);
        if (codePoint === null) {
          result += FALLBACK_REPLACER;
        } else {
          decodedChar = fromCodePoint(codePoint);
        }
      }
    }
    result += decodedChar;
    i++;
  }
  return result;
};
var find = /[!'()~]|%20/g;
var replacements = {
  '!': '%21',
  "'": '%27',
  '(': '%28',
  ')': '%29',
  '~': '%7E',
  '%20': '+'
};
var replacer = function replacer(match) {
  return replacements[match];
};
var _serialize = function serialize(it) {
  return replace(encodeURIComponent(it), find, replacer);
};
var URLSearchParamsIterator = createIteratorConstructor(function Iterator(params, kind) {
  setInternalState(this, {
    type: URL_SEARCH_PARAMS_ITERATOR,
    target: getInternalParamsState(params).entries,
    index: 0,
    kind: kind
  });
}, URL_SEARCH_PARAMS, function next() {
  var state = getInternalIteratorState(this);
  var target = state.target;
  var index = state.index++;
  if (!target || index >= target.length) {
    state.target = null;
    return createIterResultObject(undefined, true);
  }
  var entry = target[index];
  switch (state.kind) {
    case 'keys':
      return createIterResultObject(entry.key, false);
    case 'values':
      return createIterResultObject(entry.value, false);
  }
  return createIterResultObject([entry.key, entry.value], false);
}, true);
var URLSearchParamsState = function URLSearchParamsState(init) {
  this.entries = [];
  this.url = null;
  if (init !== undefined) {
    if (isObject(init)) this.parseObject(init);else this.parseQuery(typeof init == 'string' ? charAt(init, 0) === '?' ? stringSlice(init, 1) : init : $toString(init));
  }
};
URLSearchParamsState.prototype = {
  type: URL_SEARCH_PARAMS,
  bindURL: function bindURL(url) {
    this.url = url;
    this.update();
  },
  parseObject: function parseObject(object) {
    var entries = this.entries;
    var iteratorMethod = getIteratorMethod(object);
    var iterator, next, step, entryIterator, entryNext, first, second;
    if (iteratorMethod) {
      iterator = getIterator(object, iteratorMethod);
      next = iterator.next;
      while (!(step = call(next, iterator)).done) {
        entryIterator = getIterator(anObject(step.value));
        entryNext = entryIterator.next;
        if ((first = call(entryNext, entryIterator)).done || (second = call(entryNext, entryIterator)).done || !call(entryNext, entryIterator).done) throw new TypeError('Expected sequence with length 2');
        push(entries, {
          key: $toString(first.value),
          value: $toString(second.value)
        });
      }
    } else for (var key in object) if (hasOwn(object, key)) {
      push(entries, {
        key: key,
        value: $toString(object[key])
      });
    }
  },
  parseQuery: function parseQuery(query) {
    if (query) {
      var entries = this.entries;
      var attributes = split(query, '&');
      var index = 0;
      var attribute, entry;
      while (index < attributes.length) {
        attribute = attributes[index++];
        if (attribute.length) {
          entry = split(attribute, '=');
          push(entries, {
            key: decode(shift(entry)),
            value: decode(join(entry, '='))
          });
        }
      }
    }
  },
  serialize: function serialize() {
    var entries = this.entries;
    var result = [];
    var index = 0;
    var entry;
    while (index < entries.length) {
      entry = entries[index++];
      push(result, _serialize(entry.key) + '=' + _serialize(entry.value));
    }
    return join(result, '&');
  },
  update: function update() {
    this.entries.length = 0;
    this.parseQuery(this.url.query);
  },
  updateURL: function updateURL() {
    if (this.url) this.url.update();
  }
};
var URLSearchParamsConstructor = function URLSearchParams() {
  anInstance(this, URLSearchParamsPrototype);
  var init = arguments.length > 0 ? arguments[0] : undefined;
  var state = setInternalState(this, new URLSearchParamsState(init));
  if (!DESCRIPTORS) this.size = state.entries.length;
};
var URLSearchParamsPrototype = URLSearchParamsConstructor.prototype;
defineBuiltIns(URLSearchParamsPrototype, {
  append: function append(name, value) {
    var state = getInternalParamsState(this);
    validateArgumentsLength(arguments.length, 2);
    push(state.entries, {
      key: $toString(name),
      value: $toString(value)
    });
    if (!DESCRIPTORS) this.length++;
    state.updateURL();
  },
  'delete': function _delete(name) {
    var state = getInternalParamsState(this);
    var length = validateArgumentsLength(arguments.length, 1);
    var entries = state.entries;
    var key = $toString(name);
    var $value = length < 2 ? undefined : arguments[1];
    var value = $value === undefined ? $value : $toString($value);
    var index = 0;
    while (index < entries.length) {
      var entry = entries[index];
      if (entry.key === key && (value === undefined || entry.value === value)) {
        splice(entries, index, 1);
        if (value !== undefined) break;
      } else index++;
    }
    if (!DESCRIPTORS) this.size = entries.length;
    state.updateURL();
  },
  get: function get(name) {
    var entries = getInternalParamsState(this).entries;
    validateArgumentsLength(arguments.length, 1);
    var key = $toString(name);
    var index = 0;
    for (; index < entries.length; index++) {
      if (entries[index].key === key) return entries[index].value;
    }
    return null;
  },
  getAll: function getAll(name) {
    var entries = getInternalParamsState(this).entries;
    validateArgumentsLength(arguments.length, 1);
    var key = $toString(name);
    var result = [];
    var index = 0;
    for (; index < entries.length; index++) {
      if (entries[index].key === key) push(result, entries[index].value);
    }
    return result;
  },
  has: function has(name) {
    var entries = getInternalParamsState(this).entries;
    var length = validateArgumentsLength(arguments.length, 1);
    var key = $toString(name);
    var $value = length < 2 ? undefined : arguments[1];
    var value = $value === undefined ? $value : $toString($value);
    var index = 0;
    while (index < entries.length) {
      var entry = entries[index++];
      if (entry.key === key && (value === undefined || entry.value === value)) return true;
    }
    return false;
  },
  set: function set(name, value) {
    var state = getInternalParamsState(this);
    validateArgumentsLength(arguments.length, 1);
    var entries = state.entries;
    var found = false;
    var key = $toString(name);
    var val = $toString(value);
    var index = 0;
    var entry;
    for (; index < entries.length; index++) {
      entry = entries[index];
      if (entry.key === key) {
        if (found) splice(entries, index--, 1);else {
          found = true;
          entry.value = val;
        }
      }
    }
    if (!found) push(entries, {
      key: key,
      value: val
    });
    if (!DESCRIPTORS) this.size = entries.length;
    state.updateURL();
  },
  sort: function sort() {
    var state = getInternalParamsState(this);
    arraySort(state.entries, function (a, b) {
      return a.key > b.key ? 1 : -1;
    });
    state.updateURL();
  },
  forEach: function forEach(callback) {
    var entries = getInternalParamsState(this).entries;
    var boundFunction = bind(callback, arguments.length > 1 ? arguments[1] : undefined);
    var index = 0;
    var entry;
    while (index < entries.length) {
      entry = entries[index++];
      boundFunction(entry.value, entry.key, this);
    }
  },
  keys: function keys() {
    return new URLSearchParamsIterator(this, 'keys');
  },
  values: function values() {
    return new URLSearchParamsIterator(this, 'values');
  },
  entries: function entries() {
    return new URLSearchParamsIterator(this, 'entries');
  }
}, {
  enumerable: true
});
defineBuiltIn(URLSearchParamsPrototype, ITERATOR, URLSearchParamsPrototype.entries, {
  name: 'entries'
});
defineBuiltIn(URLSearchParamsPrototype, 'toString', function toString() {
  return getInternalParamsState(this).serialize();
}, {
  enumerable: true
});
if (DESCRIPTORS) defineBuiltInAccessor(URLSearchParamsPrototype, 'size', {
  get: function size() {
    return getInternalParamsState(this).entries.length;
  },
  configurable: true,
  enumerable: true
});
setToStringTag(URLSearchParamsConstructor, URL_SEARCH_PARAMS);
$({
  global: true,
  constructor: true,
  forced: !USE_NATIVE_URL
}, {
  URLSearchParams: URLSearchParamsConstructor
});
if (!USE_NATIVE_URL && isCallable(Headers)) {
  var headersHas = uncurryThis(HeadersPrototype.has);
  var headersSet = uncurryThis(HeadersPrototype.set);
  var wrapRequestOptions = function wrapRequestOptions(init) {
    if (isObject(init)) {
      var body = init.body;
      var headers;
      if (classof(body) === URL_SEARCH_PARAMS) {
        headers = init.headers ? new Headers(init.headers) : new Headers();
        if (!headersHas(headers, 'content-type')) {
          headersSet(headers, 'content-type', 'application/x-www-form-urlencoded;charset=UTF-8');
        }
        return create(init, {
          body: createPropertyDescriptor(0, $toString(body)),
          headers: createPropertyDescriptor(0, headers)
        });
      }
    }
    return init;
  };
  if (isCallable(nativeFetch)) {
    $({
      global: true,
      enumerable: true,
      dontCallGetSet: true,
      forced: true
    }, {
      fetch: function fetch(input) {
        return nativeFetch(input, arguments.length > 1 ? wrapRequestOptions(arguments[1]) : {});
      }
    });
  }
  if (isCallable(NativeRequest)) {
    var RequestConstructor = function Request(input) {
      anInstance(this, RequestPrototype);
      return new NativeRequest(input, arguments.length > 1 ? wrapRequestOptions(arguments[1]) : {});
    };
    RequestPrototype.constructor = RequestConstructor;
    RequestConstructor.prototype = RequestPrototype;
    $({
      global: true,
      constructor: true,
      dontCallGetSet: true,
      forced: true
    }, {
      Request: RequestConstructor
    });
  }
}
module.exports = {
  URLSearchParams: URLSearchParamsConstructor,
  getState: getInternalParamsState
};

},{"../internals/an-instance":6,"../internals/an-object":7,"../internals/array-sort":25,"../internals/classof":31,"../internals/create-iter-result-object":39,"../internals/create-property-descriptor":41,"../internals/define-built-in":46,"../internals/define-built-in-accessor":45,"../internals/define-built-ins":47,"../internals/descriptors":50,"../internals/export":66,"../internals/function-bind-context":72,"../internals/function-call":75,"../internals/function-uncurry-this":79,"../internals/get-built-in":80,"../internals/get-iterator":82,"../internals/get-iterator-method":81,"../internals/global-this":86,"../internals/has-own-property":87,"../internals/internal-state":97,"../internals/is-callable":101,"../internals/is-object":107,"../internals/iterator-create-constructor":114,"../internals/object-create":134,"../internals/safe-get-built-in":169,"../internals/set-to-string-tag":173,"../internals/to-string":205,"../internals/url-constructor-detection":214,"../internals/validate-arguments-length":217,"../internals/well-known-symbol":221,"../modules/es.array.iterator":240,"../modules/es.string.from-code-point":362}],450:[function(require,module,exports){
'use strict';
require('../modules/web.url-search-params.constructor');

},{"../modules/web.url-search-params.constructor":449}],451:[function(require,module,exports){
'use strict';
require('../modules/es.string.iterator');
var $ = require('../internals/export');
var DESCRIPTORS = require('../internals/descriptors');
var USE_NATIVE_URL = require('../internals/url-constructor-detection');
var globalThis = require('../internals/global-this');
var bind = require('../internals/function-bind-context');
var uncurryThis = require('../internals/function-uncurry-this');
var defineBuiltIn = require('../internals/define-built-in');
var defineBuiltInAccessor = require('../internals/define-built-in-accessor');
var anInstance = require('../internals/an-instance');
var hasOwn = require('../internals/has-own-property');
var assign = require('../internals/object-assign');
var arrayFrom = require('../internals/array-from');
var arraySlice = require('../internals/array-slice');
var codeAt = require('../internals/string-multibyte').codeAt;
var toASCII = require('../internals/string-punycode-to-ascii');
var $toString = require('../internals/to-string');
var setToStringTag = require('../internals/set-to-string-tag');
var validateArgumentsLength = require('../internals/validate-arguments-length');
var URLSearchParamsModule = require('../modules/web.url-search-params.constructor');
var InternalStateModule = require('../internals/internal-state');
var setInternalState = InternalStateModule.set;
var getInternalURLState = InternalStateModule.getterFor('URL');
var URLSearchParams = URLSearchParamsModule.URLSearchParams;
var getInternalSearchParamsState = URLSearchParamsModule.getState;
var NativeURL = globalThis.URL;
var TypeError = globalThis.TypeError;
var parseInt = globalThis.parseInt;
var floor = Math.floor;
var pow = Math.pow;
var charAt = uncurryThis(''.charAt);
var exec = uncurryThis(/./.exec);
var join = uncurryThis([].join);
var numberToString = uncurryThis(1.0.toString);
var pop = uncurryThis([].pop);
var push = uncurryThis([].push);
var replace = uncurryThis(''.replace);
var shift = uncurryThis([].shift);
var split = uncurryThis(''.split);
var stringSlice = uncurryThis(''.slice);
var toLowerCase = uncurryThis(''.toLowerCase);
var unshift = uncurryThis([].unshift);
var INVALID_AUTHORITY = 'Invalid authority';
var INVALID_SCHEME = 'Invalid scheme';
var INVALID_HOST = 'Invalid host';
var INVALID_PORT = 'Invalid port';
var ALPHA = /[a-z]/i;
var ALPHANUMERIC = /[\d+-.a-z]/i;
var DIGIT = /\d/;
var HEX_START = /^0x/i;
var OCT = /^[0-7]+$/;
var DEC = /^\d+$/;
var HEX = /^[\da-f]+$/i;
var FORBIDDEN_HOST_CODE_POINT = /[\0\t\n\r #%/:<>?@[\\\]^|]/;
var FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT = /[\0\t\n\r #/:<>?@[\\\]^|]/;
var LEADING_C0_CONTROL_OR_SPACE = /^[\u0000-\u0020]+/;
var TRAILING_C0_CONTROL_OR_SPACE = /(^|[^\u0000-\u0020])[\u0000-\u0020]+$/;
var TAB_AND_NEW_LINE = /[\t\n\r]/g;
var EOF;
var parseIPv4 = function parseIPv4(input) {
  var parts = split(input, '.');
  var partsLength, numbers, index, part, radix, number, ipv4;
  if (parts.length && parts[parts.length - 1] === '') {
    parts.length--;
  }
  partsLength = parts.length;
  if (partsLength > 4) return input;
  numbers = [];
  for (index = 0; index < partsLength; index++) {
    part = parts[index];
    if (part === '') return input;
    radix = 10;
    if (part.length > 1 && charAt(part, 0) === '0') {
      radix = exec(HEX_START, part) ? 16 : 8;
      part = stringSlice(part, radix === 8 ? 1 : 2);
    }
    if (part === '') {
      number = 0;
    } else {
      if (!exec(radix === 10 ? DEC : radix === 8 ? OCT : HEX, part)) return input;
      number = parseInt(part, radix);
    }
    push(numbers, number);
  }
  for (index = 0; index < partsLength; index++) {
    number = numbers[index];
    if (index === partsLength - 1) {
      if (number >= pow(256, 5 - partsLength)) return null;
    } else if (number > 255) return null;
  }
  ipv4 = pop(numbers);
  for (index = 0; index < numbers.length; index++) {
    ipv4 += numbers[index] * pow(256, 3 - index);
  }
  return ipv4;
};
var parseIPv6 = function parseIPv6(input) {
  var address = [0, 0, 0, 0, 0, 0, 0, 0];
  var pieceIndex = 0;
  var compress = null;
  var pointer = 0;
  var value, length, numbersSeen, ipv4Piece, number, swaps, swap;
  var chr = function chr() {
    return charAt(input, pointer);
  };
  if (chr() === ':') {
    if (charAt(input, 1) !== ':') return;
    pointer += 2;
    pieceIndex++;
    compress = pieceIndex;
  }
  while (chr()) {
    if (pieceIndex === 8) return;
    if (chr() === ':') {
      if (compress !== null) return;
      pointer++;
      pieceIndex++;
      compress = pieceIndex;
      continue;
    }
    value = length = 0;
    while (length < 4 && exec(HEX, chr())) {
      value = value * 16 + parseInt(chr(), 16);
      pointer++;
      length++;
    }
    if (chr() === '.') {
      if (length === 0) return;
      pointer -= length;
      if (pieceIndex > 6) return;
      numbersSeen = 0;
      while (chr()) {
        ipv4Piece = null;
        if (numbersSeen > 0) {
          if (chr() === '.' && numbersSeen < 4) pointer++;else return;
        }
        if (!exec(DIGIT, chr())) return;
        while (exec(DIGIT, chr())) {
          number = parseInt(chr(), 10);
          if (ipv4Piece === null) ipv4Piece = number;else if (ipv4Piece === 0) return;else ipv4Piece = ipv4Piece * 10 + number;
          if (ipv4Piece > 255) return;
          pointer++;
        }
        address[pieceIndex] = address[pieceIndex] * 256 + ipv4Piece;
        numbersSeen++;
        if (numbersSeen === 2 || numbersSeen === 4) pieceIndex++;
      }
      if (numbersSeen !== 4) return;
      break;
    } else if (chr() === ':') {
      pointer++;
      if (!chr()) return;
    } else if (chr()) return;
    address[pieceIndex++] = value;
  }
  if (compress !== null) {
    swaps = pieceIndex - compress;
    pieceIndex = 7;
    while (pieceIndex !== 0 && swaps > 0) {
      swap = address[pieceIndex];
      address[pieceIndex--] = address[compress + swaps - 1];
      address[compress + --swaps] = swap;
    }
  } else if (pieceIndex !== 8) return;
  return address;
};
var findLongestZeroSequence = function findLongestZeroSequence(ipv6) {
  var maxIndex = null;
  var maxLength = 1;
  var currStart = null;
  var currLength = 0;
  var index = 0;
  for (; index < 8; index++) {
    if (ipv6[index] !== 0) {
      if (currLength > maxLength) {
        maxIndex = currStart;
        maxLength = currLength;
      }
      currStart = null;
      currLength = 0;
    } else {
      if (currStart === null) currStart = index;
      ++currLength;
    }
  }
  return currLength > maxLength ? currStart : maxIndex;
};
var serializeHost = function serializeHost(host) {
  var result, index, compress, ignore0;
  if (typeof host == 'number') {
    result = [];
    for (index = 0; index < 4; index++) {
      unshift(result, host % 256);
      host = floor(host / 256);
    }
    return join(result, '.');
  }
  if (typeof host == 'object') {
    result = '';
    compress = findLongestZeroSequence(host);
    for (index = 0; index < 8; index++) {
      if (ignore0 && host[index] === 0) continue;
      if (ignore0) ignore0 = false;
      if (compress === index) {
        result += index ? ':' : '::';
        ignore0 = true;
      } else {
        result += numberToString(host[index], 16);
        if (index < 7) result += ':';
      }
    }
    return '[' + result + ']';
  }
  return host;
};
var C0ControlPercentEncodeSet = {};
var fragmentPercentEncodeSet = assign({}, C0ControlPercentEncodeSet, {
  ' ': 1,
  '"': 1,
  '<': 1,
  '>': 1,
  '`': 1
});
var pathPercentEncodeSet = assign({}, fragmentPercentEncodeSet, {
  '#': 1,
  '?': 1,
  '{': 1,
  '}': 1
});
var userinfoPercentEncodeSet = assign({}, pathPercentEncodeSet, {
  '/': 1,
  ':': 1,
  ';': 1,
  '=': 1,
  '@': 1,
  '[': 1,
  '\\': 1,
  ']': 1,
  '^': 1,
  '|': 1
});
var percentEncode = function percentEncode(chr, set) {
  var code = codeAt(chr, 0);
  return code > 0x20 && code < 0x7F && !hasOwn(set, chr) ? chr : encodeURIComponent(chr);
};
var specialSchemes = {
  ftp: 21,
  file: null,
  http: 80,
  https: 443,
  ws: 80,
  wss: 443
};
var isWindowsDriveLetter = function isWindowsDriveLetter(string, normalized) {
  var second;
  return string.length === 2 && exec(ALPHA, charAt(string, 0)) && ((second = charAt(string, 1)) === ':' || !normalized && second === '|');
};
var startsWithWindowsDriveLetter = function startsWithWindowsDriveLetter(string) {
  var third;
  return string.length > 1 && isWindowsDriveLetter(stringSlice(string, 0, 2)) && (string.length === 2 || (third = charAt(string, 2)) === '/' || third === '\\' || third === '?' || third === '#');
};
var isSingleDot = function isSingleDot(segment) {
  return segment === '.' || toLowerCase(segment) === '%2e';
};
var isDoubleDot = function isDoubleDot(segment) {
  segment = toLowerCase(segment);
  return segment === '..' || segment === '%2e.' || segment === '.%2e' || segment === '%2e%2e';
};
var SCHEME_START = {};
var SCHEME = {};
var NO_SCHEME = {};
var SPECIAL_RELATIVE_OR_AUTHORITY = {};
var PATH_OR_AUTHORITY = {};
var RELATIVE = {};
var RELATIVE_SLASH = {};
var SPECIAL_AUTHORITY_SLASHES = {};
var SPECIAL_AUTHORITY_IGNORE_SLASHES = {};
var AUTHORITY = {};
var HOST = {};
var HOSTNAME = {};
var PORT = {};
var FILE = {};
var FILE_SLASH = {};
var FILE_HOST = {};
var PATH_START = {};
var PATH = {};
var CANNOT_BE_A_BASE_URL_PATH = {};
var QUERY = {};
var FRAGMENT = {};
var _URLState = function URLState(url, isBase, base) {
  var urlString = $toString(url);
  var baseState, failure, searchParams;
  if (isBase) {
    failure = this.parse(urlString);
    if (failure) throw new TypeError(failure);
    this.searchParams = null;
  } else {
    if (base !== undefined) baseState = new _URLState(base, true);
    failure = this.parse(urlString, null, baseState);
    if (failure) throw new TypeError(failure);
    searchParams = getInternalSearchParamsState(new URLSearchParams());
    searchParams.bindURL(this);
    this.searchParams = searchParams;
  }
};
_URLState.prototype = {
  type: 'URL',
  parse: function parse(input, stateOverride, base) {
    var url = this;
    var state = stateOverride || SCHEME_START;
    var pointer = 0;
    var buffer = '';
    var seenAt = false;
    var seenBracket = false;
    var seenPasswordToken = false;
    var codePoints, chr, bufferCodePoints, failure;
    input = $toString(input);
    if (!stateOverride) {
      url.scheme = '';
      url.username = '';
      url.password = '';
      url.host = null;
      url.port = null;
      url.path = [];
      url.query = null;
      url.fragment = null;
      url.cannotBeABaseURL = false;
      input = replace(input, LEADING_C0_CONTROL_OR_SPACE, '');
      input = replace(input, TRAILING_C0_CONTROL_OR_SPACE, '$1');
    }
    input = replace(input, TAB_AND_NEW_LINE, '');
    codePoints = arrayFrom(input);
    while (pointer <= codePoints.length) {
      chr = codePoints[pointer];
      switch (state) {
        case SCHEME_START:
          if (chr && exec(ALPHA, chr)) {
            buffer += toLowerCase(chr);
            state = SCHEME;
          } else if (!stateOverride) {
            state = NO_SCHEME;
            continue;
          } else return INVALID_SCHEME;
          break;
        case SCHEME:
          if (chr && (exec(ALPHANUMERIC, chr) || chr === '+' || chr === '-' || chr === '.')) {
            buffer += toLowerCase(chr);
          } else if (chr === ':') {
            if (stateOverride && (url.isSpecial() !== hasOwn(specialSchemes, buffer) || buffer === 'file' && (url.includesCredentials() || url.port !== null) || url.scheme === 'file' && !url.host)) return;
            url.scheme = buffer;
            if (stateOverride) {
              if (url.isSpecial() && specialSchemes[url.scheme] === url.port) url.port = null;
              return;
            }
            buffer = '';
            if (url.scheme === 'file') {
              state = FILE;
            } else if (url.isSpecial() && base && base.scheme === url.scheme) {
              state = SPECIAL_RELATIVE_OR_AUTHORITY;
            } else if (url.isSpecial()) {
              state = SPECIAL_AUTHORITY_SLASHES;
            } else if (codePoints[pointer + 1] === '/') {
              state = PATH_OR_AUTHORITY;
              pointer++;
            } else {
              url.cannotBeABaseURL = true;
              push(url.path, '');
              state = CANNOT_BE_A_BASE_URL_PATH;
            }
          } else if (!stateOverride) {
            buffer = '';
            state = NO_SCHEME;
            pointer = 0;
            continue;
          } else return INVALID_SCHEME;
          break;
        case NO_SCHEME:
          if (!base || base.cannotBeABaseURL && chr !== '#') return INVALID_SCHEME;
          if (base.cannotBeABaseURL && chr === '#') {
            url.scheme = base.scheme;
            url.path = arraySlice(base.path);
            url.query = base.query;
            url.fragment = '';
            url.cannotBeABaseURL = true;
            state = FRAGMENT;
            break;
          }
          state = base.scheme === 'file' ? FILE : RELATIVE;
          continue;
        case SPECIAL_RELATIVE_OR_AUTHORITY:
          if (chr === '/' && codePoints[pointer + 1] === '/') {
            state = SPECIAL_AUTHORITY_IGNORE_SLASHES;
            pointer++;
          } else {
            state = RELATIVE;
            continue;
          }
          break;
        case PATH_OR_AUTHORITY:
          if (chr === '/') {
            state = AUTHORITY;
            break;
          } else {
            state = PATH;
            continue;
          }
        case RELATIVE:
          url.scheme = base.scheme;
          if (chr === EOF) {
            url.username = base.username;
            url.password = base.password;
            url.host = base.host;
            url.port = base.port;
            url.path = arraySlice(base.path);
            url.query = base.query;
          } else if (chr === '/' || chr === '\\' && url.isSpecial()) {
            state = RELATIVE_SLASH;
          } else if (chr === '?') {
            url.username = base.username;
            url.password = base.password;
            url.host = base.host;
            url.port = base.port;
            url.path = arraySlice(base.path);
            url.query = '';
            state = QUERY;
          } else if (chr === '#') {
            url.username = base.username;
            url.password = base.password;
            url.host = base.host;
            url.port = base.port;
            url.path = arraySlice(base.path);
            url.query = base.query;
            url.fragment = '';
            state = FRAGMENT;
          } else {
            url.username = base.username;
            url.password = base.password;
            url.host = base.host;
            url.port = base.port;
            url.path = arraySlice(base.path);
            url.path.length--;
            state = PATH;
            continue;
          }
          break;
        case RELATIVE_SLASH:
          if (url.isSpecial() && (chr === '/' || chr === '\\')) {
            state = SPECIAL_AUTHORITY_IGNORE_SLASHES;
          } else if (chr === '/') {
            state = AUTHORITY;
          } else {
            url.username = base.username;
            url.password = base.password;
            url.host = base.host;
            url.port = base.port;
            state = PATH;
            continue;
          }
          break;
        case SPECIAL_AUTHORITY_SLASHES:
          state = SPECIAL_AUTHORITY_IGNORE_SLASHES;
          if (chr !== '/' || charAt(buffer, pointer + 1) !== '/') continue;
          pointer++;
          break;
        case SPECIAL_AUTHORITY_IGNORE_SLASHES:
          if (chr !== '/' && chr !== '\\') {
            state = AUTHORITY;
            continue;
          }
          break;
        case AUTHORITY:
          if (chr === '@') {
            if (seenAt) buffer = '%40' + buffer;
            seenAt = true;
            bufferCodePoints = arrayFrom(buffer);
            for (var i = 0; i < bufferCodePoints.length; i++) {
              var codePoint = bufferCodePoints[i];
              if (codePoint === ':' && !seenPasswordToken) {
                seenPasswordToken = true;
                continue;
              }
              var encodedCodePoints = percentEncode(codePoint, userinfoPercentEncodeSet);
              if (seenPasswordToken) url.password += encodedCodePoints;else url.username += encodedCodePoints;
            }
            buffer = '';
          } else if (chr === EOF || chr === '/' || chr === '?' || chr === '#' || chr === '\\' && url.isSpecial()) {
            if (seenAt && buffer === '') return INVALID_AUTHORITY;
            pointer -= arrayFrom(buffer).length + 1;
            buffer = '';
            state = HOST;
          } else buffer += chr;
          break;
        case HOST:
        case HOSTNAME:
          if (stateOverride && url.scheme === 'file') {
            state = FILE_HOST;
            continue;
          } else if (chr === ':' && !seenBracket) {
            if (buffer === '') return INVALID_HOST;
            failure = url.parseHost(buffer);
            if (failure) return failure;
            buffer = '';
            state = PORT;
            if (stateOverride === HOSTNAME) return;
          } else if (chr === EOF || chr === '/' || chr === '?' || chr === '#' || chr === '\\' && url.isSpecial()) {
            if (url.isSpecial() && buffer === '') return INVALID_HOST;
            if (stateOverride && buffer === '' && (url.includesCredentials() || url.port !== null)) return;
            failure = url.parseHost(buffer);
            if (failure) return failure;
            buffer = '';
            state = PATH_START;
            if (stateOverride) return;
            continue;
          } else {
            if (chr === '[') seenBracket = true;else if (chr === ']') seenBracket = false;
            buffer += chr;
          }
          break;
        case PORT:
          if (exec(DIGIT, chr)) {
            buffer += chr;
          } else if (chr === EOF || chr === '/' || chr === '?' || chr === '#' || chr === '\\' && url.isSpecial() || stateOverride) {
            if (buffer !== '') {
              var port = parseInt(buffer, 10);
              if (port > 0xFFFF) return INVALID_PORT;
              url.port = url.isSpecial() && port === specialSchemes[url.scheme] ? null : port;
              buffer = '';
            }
            if (stateOverride) return;
            state = PATH_START;
            continue;
          } else return INVALID_PORT;
          break;
        case FILE:
          url.scheme = 'file';
          if (chr === '/' || chr === '\\') state = FILE_SLASH;else if (base && base.scheme === 'file') {
            switch (chr) {
              case EOF:
                url.host = base.host;
                url.path = arraySlice(base.path);
                url.query = base.query;
                break;
              case '?':
                url.host = base.host;
                url.path = arraySlice(base.path);
                url.query = '';
                state = QUERY;
                break;
              case '#':
                url.host = base.host;
                url.path = arraySlice(base.path);
                url.query = base.query;
                url.fragment = '';
                state = FRAGMENT;
                break;
              default:
                if (!startsWithWindowsDriveLetter(join(arraySlice(codePoints, pointer), ''))) {
                  url.host = base.host;
                  url.path = arraySlice(base.path);
                  url.shortenPath();
                }
                state = PATH;
                continue;
            }
          } else {
            state = PATH;
            continue;
          }
          break;
        case FILE_SLASH:
          if (chr === '/' || chr === '\\') {
            state = FILE_HOST;
            break;
          }
          if (base && base.scheme === 'file' && !startsWithWindowsDriveLetter(join(arraySlice(codePoints, pointer), ''))) {
            if (isWindowsDriveLetter(base.path[0], true)) push(url.path, base.path[0]);else url.host = base.host;
          }
          state = PATH;
          continue;
        case FILE_HOST:
          if (chr === EOF || chr === '/' || chr === '\\' || chr === '?' || chr === '#') {
            if (!stateOverride && isWindowsDriveLetter(buffer)) {
              state = PATH;
            } else if (buffer === '') {
              url.host = '';
              if (stateOverride) return;
              state = PATH_START;
            } else {
              failure = url.parseHost(buffer);
              if (failure) return failure;
              if (url.host === 'localhost') url.host = '';
              if (stateOverride) return;
              buffer = '';
              state = PATH_START;
            }
            continue;
          } else buffer += chr;
          break;
        case PATH_START:
          if (url.isSpecial()) {
            state = PATH;
            if (chr !== '/' && chr !== '\\') continue;
          } else if (!stateOverride && chr === '?') {
            url.query = '';
            state = QUERY;
          } else if (!stateOverride && chr === '#') {
            url.fragment = '';
            state = FRAGMENT;
          } else if (chr !== EOF) {
            state = PATH;
            if (chr !== '/') continue;
          }
          break;
        case PATH:
          if (chr === EOF || chr === '/' || chr === '\\' && url.isSpecial() || !stateOverride && (chr === '?' || chr === '#')) {
            if (isDoubleDot(buffer)) {
              url.shortenPath();
              if (chr !== '/' && !(chr === '\\' && url.isSpecial())) {
                push(url.path, '');
              }
            } else if (isSingleDot(buffer)) {
              if (chr !== '/' && !(chr === '\\' && url.isSpecial())) {
                push(url.path, '');
              }
            } else {
              if (url.scheme === 'file' && !url.path.length && isWindowsDriveLetter(buffer)) {
                if (url.host) url.host = '';
                buffer = charAt(buffer, 0) + ':';
              }
              push(url.path, buffer);
            }
            buffer = '';
            if (url.scheme === 'file' && (chr === EOF || chr === '?' || chr === '#')) {
              while (url.path.length > 1 && url.path[0] === '') {
                shift(url.path);
              }
            }
            if (chr === '?') {
              url.query = '';
              state = QUERY;
            } else if (chr === '#') {
              url.fragment = '';
              state = FRAGMENT;
            }
          } else {
            buffer += percentEncode(chr, pathPercentEncodeSet);
          }
          break;
        case CANNOT_BE_A_BASE_URL_PATH:
          if (chr === '?') {
            url.query = '';
            state = QUERY;
          } else if (chr === '#') {
            url.fragment = '';
            state = FRAGMENT;
          } else if (chr !== EOF) {
            url.path[0] += percentEncode(chr, C0ControlPercentEncodeSet);
          }
          break;
        case QUERY:
          if (!stateOverride && chr === '#') {
            url.fragment = '';
            state = FRAGMENT;
          } else if (chr !== EOF) {
            if (chr === "'" && url.isSpecial()) url.query += '%27';else if (chr === '#') url.query += '%23';else url.query += percentEncode(chr, C0ControlPercentEncodeSet);
          }
          break;
        case FRAGMENT:
          if (chr !== EOF) url.fragment += percentEncode(chr, fragmentPercentEncodeSet);
          break;
      }
      pointer++;
    }
  },
  parseHost: function parseHost(input) {
    var result, codePoints, index;
    if (charAt(input, 0) === '[') {
      if (charAt(input, input.length - 1) !== ']') return INVALID_HOST;
      result = parseIPv6(stringSlice(input, 1, -1));
      if (!result) return INVALID_HOST;
      this.host = result;
    } else if (!this.isSpecial()) {
      if (exec(FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT, input)) return INVALID_HOST;
      result = '';
      codePoints = arrayFrom(input);
      for (index = 0; index < codePoints.length; index++) {
        result += percentEncode(codePoints[index], C0ControlPercentEncodeSet);
      }
      this.host = result;
    } else {
      input = toASCII(input);
      if (exec(FORBIDDEN_HOST_CODE_POINT, input)) return INVALID_HOST;
      result = parseIPv4(input);
      if (result === null) return INVALID_HOST;
      this.host = result;
    }
  },
  cannotHaveUsernamePasswordPort: function cannotHaveUsernamePasswordPort() {
    return !this.host || this.cannotBeABaseURL || this.scheme === 'file';
  },
  includesCredentials: function includesCredentials() {
    return this.username !== '' || this.password !== '';
  },
  isSpecial: function isSpecial() {
    return hasOwn(specialSchemes, this.scheme);
  },
  shortenPath: function shortenPath() {
    var path = this.path;
    var pathSize = path.length;
    if (pathSize && (this.scheme !== 'file' || pathSize !== 1 || !isWindowsDriveLetter(path[0], true))) {
      path.length--;
    }
  },
  serialize: function serialize() {
    var url = this;
    var scheme = url.scheme;
    var username = url.username;
    var password = url.password;
    var host = url.host;
    var port = url.port;
    var path = url.path;
    var query = url.query;
    var fragment = url.fragment;
    var output = scheme + ':';
    if (host !== null) {
      output += '//';
      if (url.includesCredentials()) {
        output += username + (password ? ':' + password : '') + '@';
      }
      output += serializeHost(host);
      if (port !== null) output += ':' + port;
    } else if (scheme === 'file') output += '//';
    output += url.cannotBeABaseURL ? path[0] : path.length ? '/' + join(path, '/') : '';
    if (query !== null) output += '?' + query;
    if (fragment !== null) output += '#' + fragment;
    return output;
  },
  setHref: function setHref(href) {
    var failure = this.parse(href);
    if (failure) throw new TypeError(failure);
    this.searchParams.update();
  },
  getOrigin: function getOrigin() {
    var scheme = this.scheme;
    var port = this.port;
    if (scheme === 'blob') try {
      return new URLConstructor(scheme.path[0]).origin;
    } catch (error) {
      return 'null';
    }
    if (scheme === 'file' || !this.isSpecial()) return 'null';
    return scheme + '://' + serializeHost(this.host) + (port !== null ? ':' + port : '');
  },
  getProtocol: function getProtocol() {
    return this.scheme + ':';
  },
  setProtocol: function setProtocol(protocol) {
    this.parse($toString(protocol) + ':', SCHEME_START);
  },
  getUsername: function getUsername() {
    return this.username;
  },
  setUsername: function setUsername(username) {
    var codePoints = arrayFrom($toString(username));
    if (this.cannotHaveUsernamePasswordPort()) return;
    this.username = '';
    for (var i = 0; i < codePoints.length; i++) {
      this.username += percentEncode(codePoints[i], userinfoPercentEncodeSet);
    }
  },
  getPassword: function getPassword() {
    return this.password;
  },
  setPassword: function setPassword(password) {
    var codePoints = arrayFrom($toString(password));
    if (this.cannotHaveUsernamePasswordPort()) return;
    this.password = '';
    for (var i = 0; i < codePoints.length; i++) {
      this.password += percentEncode(codePoints[i], userinfoPercentEncodeSet);
    }
  },
  getHost: function getHost() {
    var host = this.host;
    var port = this.port;
    return host === null ? '' : port === null ? serializeHost(host) : serializeHost(host) + ':' + port;
  },
  setHost: function setHost(host) {
    if (this.cannotBeABaseURL) return;
    this.parse(host, HOST);
  },
  getHostname: function getHostname() {
    var host = this.host;
    return host === null ? '' : serializeHost(host);
  },
  setHostname: function setHostname(hostname) {
    if (this.cannotBeABaseURL) return;
    this.parse(hostname, HOSTNAME);
  },
  getPort: function getPort() {
    var port = this.port;
    return port === null ? '' : $toString(port);
  },
  setPort: function setPort(port) {
    if (this.cannotHaveUsernamePasswordPort()) return;
    port = $toString(port);
    if (port === '') this.port = null;else this.parse(port, PORT);
  },
  getPathname: function getPathname() {
    var path = this.path;
    return this.cannotBeABaseURL ? path[0] : path.length ? '/' + join(path, '/') : '';
  },
  setPathname: function setPathname(pathname) {
    if (this.cannotBeABaseURL) return;
    this.path = [];
    this.parse(pathname, PATH_START);
  },
  getSearch: function getSearch() {
    var query = this.query;
    return query ? '?' + query : '';
  },
  setSearch: function setSearch(search) {
    search = $toString(search);
    if (search === '') {
      this.query = null;
    } else {
      if (charAt(search, 0) === '?') search = stringSlice(search, 1);
      this.query = '';
      this.parse(search, QUERY);
    }
    this.searchParams.update();
  },
  getSearchParams: function getSearchParams() {
    return this.searchParams.facade;
  },
  getHash: function getHash() {
    var fragment = this.fragment;
    return fragment ? '#' + fragment : '';
  },
  setHash: function setHash(hash) {
    hash = $toString(hash);
    if (hash === '') {
      this.fragment = null;
      return;
    }
    if (charAt(hash, 0) === '#') hash = stringSlice(hash, 1);
    this.fragment = '';
    this.parse(hash, FRAGMENT);
  },
  update: function update() {
    this.query = this.searchParams.serialize() || null;
  }
};
var URLConstructor = function URL(url) {
  var that = anInstance(this, URLPrototype);
  var base = validateArgumentsLength(arguments.length, 1) > 1 ? arguments[1] : undefined;
  var state = setInternalState(that, new _URLState(url, false, base));
  if (!DESCRIPTORS) {
    that.href = state.serialize();
    that.origin = state.getOrigin();
    that.protocol = state.getProtocol();
    that.username = state.getUsername();
    that.password = state.getPassword();
    that.host = state.getHost();
    that.hostname = state.getHostname();
    that.port = state.getPort();
    that.pathname = state.getPathname();
    that.search = state.getSearch();
    that.searchParams = state.getSearchParams();
    that.hash = state.getHash();
  }
};
var URLPrototype = URLConstructor.prototype;
var accessorDescriptor = function accessorDescriptor(getter, setter) {
  return {
    get: function get() {
      return getInternalURLState(this)[getter]();
    },
    set: setter && function (value) {
      return getInternalURLState(this)[setter](value);
    },
    configurable: true,
    enumerable: true
  };
};
if (DESCRIPTORS) {
  defineBuiltInAccessor(URLPrototype, 'href', accessorDescriptor('serialize', 'setHref'));
  defineBuiltInAccessor(URLPrototype, 'origin', accessorDescriptor('getOrigin'));
  defineBuiltInAccessor(URLPrototype, 'protocol', accessorDescriptor('getProtocol', 'setProtocol'));
  defineBuiltInAccessor(URLPrototype, 'username', accessorDescriptor('getUsername', 'setUsername'));
  defineBuiltInAccessor(URLPrototype, 'password', accessorDescriptor('getPassword', 'setPassword'));
  defineBuiltInAccessor(URLPrototype, 'host', accessorDescriptor('getHost', 'setHost'));
  defineBuiltInAccessor(URLPrototype, 'hostname', accessorDescriptor('getHostname', 'setHostname'));
  defineBuiltInAccessor(URLPrototype, 'port', accessorDescriptor('getPort', 'setPort'));
  defineBuiltInAccessor(URLPrototype, 'pathname', accessorDescriptor('getPathname', 'setPathname'));
  defineBuiltInAccessor(URLPrototype, 'search', accessorDescriptor('getSearch', 'setSearch'));
  defineBuiltInAccessor(URLPrototype, 'searchParams', accessorDescriptor('getSearchParams'));
  defineBuiltInAccessor(URLPrototype, 'hash', accessorDescriptor('getHash', 'setHash'));
}
defineBuiltIn(URLPrototype, 'toJSON', function toJSON() {
  return getInternalURLState(this).serialize();
}, {
  enumerable: true
});
defineBuiltIn(URLPrototype, 'toString', function toString() {
  return getInternalURLState(this).serialize();
}, {
  enumerable: true
});
if (NativeURL) {
  var nativeCreateObjectURL = NativeURL.createObjectURL;
  var nativeRevokeObjectURL = NativeURL.revokeObjectURL;
  if (nativeCreateObjectURL) defineBuiltIn(URLConstructor, 'createObjectURL', bind(nativeCreateObjectURL, NativeURL));
  if (nativeRevokeObjectURL) defineBuiltIn(URLConstructor, 'revokeObjectURL', bind(nativeRevokeObjectURL, NativeURL));
}
setToStringTag(URLConstructor, 'URL');
$({
  global: true,
  constructor: true,
  forced: !USE_NATIVE_URL,
  sham: !DESCRIPTORS
}, {
  URL: URLConstructor
});

},{"../internals/an-instance":6,"../internals/array-from":16,"../internals/array-slice":24,"../internals/define-built-in":46,"../internals/define-built-in-accessor":45,"../internals/descriptors":50,"../internals/export":66,"../internals/function-bind-context":72,"../internals/function-uncurry-this":79,"../internals/global-this":86,"../internals/has-own-property":87,"../internals/internal-state":97,"../internals/object-assign":133,"../internals/set-to-string-tag":173,"../internals/string-multibyte":179,"../internals/string-punycode-to-ascii":182,"../internals/to-string":205,"../internals/url-constructor-detection":214,"../internals/validate-arguments-length":217,"../modules/es.string.iterator":365,"../modules/web.url-search-params.constructor":449}],452:[function(require,module,exports){
'use strict';
require('../modules/web.url.constructor');

},{"../modules/web.url.constructor":451}],453:[function(require,module,exports){
'use strict';

var $ = require('../internals/export');
var call = require('../internals/function-call');
$({
  target: 'URL',
  proto: true,
  enumerable: true
}, {
  toJSON: function toJSON() {
    return call(URL.prototype.toString, this);
  }
});

},{"../internals/export":66,"../internals/function-call":75}],454:[function(require,module,exports){
"use strict";

var getNative = require('./_getNative'),
  root = require('./_root');
var DataView = getNative(root, 'DataView');
module.exports = DataView;

},{"./_getNative":556,"./_root":608}],455:[function(require,module,exports){
"use strict";

var hashClear = require('./_hashClear'),
  hashDelete = require('./_hashDelete'),
  hashGet = require('./_hashGet'),
  hashHas = require('./_hashHas'),
  hashSet = require('./_hashSet');
function Hash(entries) {
  var index = -1,
    length = entries == null ? 0 : entries.length;
  this.clear();
  while (++index < length) {
    var entry = entries[index];
    this.set(entry[0], entry[1]);
  }
}
Hash.prototype.clear = hashClear;
Hash.prototype['delete'] = hashDelete;
Hash.prototype.get = hashGet;
Hash.prototype.has = hashHas;
Hash.prototype.set = hashSet;
module.exports = Hash;

},{"./_hashClear":565,"./_hashDelete":566,"./_hashGet":567,"./_hashHas":568,"./_hashSet":569}],456:[function(require,module,exports){
"use strict";

var baseCreate = require('./_baseCreate'),
  baseLodash = require('./_baseLodash');
var MAX_ARRAY_LENGTH = 4294967295;
function LazyWrapper(value) {
  this.__wrapped__ = value;
  this.__actions__ = [];
  this.__dir__ = 1;
  this.__filtered__ = false;
  this.__iteratees__ = [];
  this.__takeCount__ = MAX_ARRAY_LENGTH;
  this.__views__ = [];
}
LazyWrapper.prototype = baseCreate(baseLodash.prototype);
LazyWrapper.prototype.constructor = LazyWrapper;
module.exports = LazyWrapper;

},{"./_baseCreate":483,"./_baseLodash":504}],457:[function(require,module,exports){
"use strict";

var listCacheClear = require('./_listCacheClear'),
  listCacheDelete = require('./_listCacheDelete'),
  listCacheGet = require('./_listCacheGet'),
  listCacheHas = require('./_listCacheHas'),
  listCacheSet = require('./_listCacheSet');
function ListCache(entries) {
  var index = -1,
    length = entries == null ? 0 : entries.length;
  this.clear();
  while (++index < length) {
    var entry = entries[index];
    this.set(entry[0], entry[1]);
  }
}
ListCache.prototype.clear = listCacheClear;
ListCache.prototype['delete'] = listCacheDelete;
ListCache.prototype.get = listCacheGet;
ListCache.prototype.has = listCacheHas;
ListCache.prototype.set = listCacheSet;
module.exports = ListCache;

},{"./_listCacheClear":583,"./_listCacheDelete":584,"./_listCacheGet":585,"./_listCacheHas":586,"./_listCacheSet":587}],458:[function(require,module,exports){
"use strict";

var baseCreate = require('./_baseCreate'),
  baseLodash = require('./_baseLodash');
function LodashWrapper(value, chainAll) {
  this.__wrapped__ = value;
  this.__actions__ = [];
  this.__chain__ = !!chainAll;
  this.__index__ = 0;
  this.__values__ = undefined;
}
LodashWrapper.prototype = baseCreate(baseLodash.prototype);
LodashWrapper.prototype.constructor = LodashWrapper;
module.exports = LodashWrapper;

},{"./_baseCreate":483,"./_baseLodash":504}],459:[function(require,module,exports){
"use strict";

var getNative = require('./_getNative'),
  root = require('./_root');
var Map = getNative(root, 'Map');
module.exports = Map;

},{"./_getNative":556,"./_root":608}],460:[function(require,module,exports){
"use strict";

var mapCacheClear = require('./_mapCacheClear'),
  mapCacheDelete = require('./_mapCacheDelete'),
  mapCacheGet = require('./_mapCacheGet'),
  mapCacheHas = require('./_mapCacheHas'),
  mapCacheSet = require('./_mapCacheSet');
function MapCache(entries) {
  var index = -1,
    length = entries == null ? 0 : entries.length;
  this.clear();
  while (++index < length) {
    var entry = entries[index];
    this.set(entry[0], entry[1]);
  }
}
MapCache.prototype.clear = mapCacheClear;
MapCache.prototype['delete'] = mapCacheDelete;
MapCache.prototype.get = mapCacheGet;
MapCache.prototype.has = mapCacheHas;
MapCache.prototype.set = mapCacheSet;
module.exports = MapCache;

},{"./_mapCacheClear":588,"./_mapCacheDelete":589,"./_mapCacheGet":590,"./_mapCacheHas":591,"./_mapCacheSet":592}],461:[function(require,module,exports){
"use strict";

var getNative = require('./_getNative'),
  root = require('./_root');
var Promise = getNative(root, 'Promise');
module.exports = Promise;

},{"./_getNative":556,"./_root":608}],462:[function(require,module,exports){
"use strict";

var getNative = require('./_getNative'),
  root = require('./_root');
var Set = getNative(root, 'Set');
module.exports = Set;

},{"./_getNative":556,"./_root":608}],463:[function(require,module,exports){
"use strict";

var MapCache = require('./_MapCache'),
  setCacheAdd = require('./_setCacheAdd'),
  setCacheHas = require('./_setCacheHas');
function SetCache(values) {
  var index = -1,
    length = values == null ? 0 : values.length;
  this.__data__ = new MapCache();
  while (++index < length) {
    this.add(values[index]);
  }
}
SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
SetCache.prototype.has = setCacheHas;
module.exports = SetCache;

},{"./_MapCache":460,"./_setCacheAdd":610,"./_setCacheHas":611}],464:[function(require,module,exports){
"use strict";

var ListCache = require('./_ListCache'),
  stackClear = require('./_stackClear'),
  stackDelete = require('./_stackDelete'),
  stackGet = require('./_stackGet'),
  stackHas = require('./_stackHas'),
  stackSet = require('./_stackSet');
function Stack(entries) {
  var data = this.__data__ = new ListCache(entries);
  this.size = data.size;
}
Stack.prototype.clear = stackClear;
Stack.prototype['delete'] = stackDelete;
Stack.prototype.get = stackGet;
Stack.prototype.has = stackHas;
Stack.prototype.set = stackSet;
module.exports = Stack;

},{"./_ListCache":457,"./_stackClear":617,"./_stackDelete":618,"./_stackGet":619,"./_stackHas":620,"./_stackSet":621}],465:[function(require,module,exports){
"use strict";

var root = require('./_root');
var Symbol = root.Symbol;
module.exports = Symbol;

},{"./_root":608}],466:[function(require,module,exports){
"use strict";

var root = require('./_root');
var Uint8Array = root.Uint8Array;
module.exports = Uint8Array;

},{"./_root":608}],467:[function(require,module,exports){
"use strict";

var getNative = require('./_getNative'),
  root = require('./_root');
var WeakMap = getNative(root, 'WeakMap');
module.exports = WeakMap;

},{"./_getNative":556,"./_root":608}],468:[function(require,module,exports){
"use strict";

function apply(func, thisArg, args) {
  switch (args.length) {
    case 0:
      return func.call(thisArg);
    case 1:
      return func.call(thisArg, args[0]);
    case 2:
      return func.call(thisArg, args[0], args[1]);
    case 3:
      return func.call(thisArg, args[0], args[1], args[2]);
  }
  return func.apply(thisArg, args);
}
module.exports = apply;

},{}],469:[function(require,module,exports){
"use strict";

function arrayEach(array, iteratee) {
  var index = -1,
    length = array == null ? 0 : array.length;
  while (++index < length) {
    if (iteratee(array[index], index, array) === false) {
      break;
    }
  }
  return array;
}
module.exports = arrayEach;

},{}],470:[function(require,module,exports){
"use strict";

function arrayFilter(array, predicate) {
  var index = -1,
    length = array == null ? 0 : array.length,
    resIndex = 0,
    result = [];
  while (++index < length) {
    var value = array[index];
    if (predicate(value, index, array)) {
      result[resIndex++] = value;
    }
  }
  return result;
}
module.exports = arrayFilter;

},{}],471:[function(require,module,exports){
"use strict";

var baseIndexOf = require('./_baseIndexOf');
function arrayIncludes(array, value) {
  var length = array == null ? 0 : array.length;
  return !!length && baseIndexOf(array, value, 0) > -1;
}
module.exports = arrayIncludes;

},{"./_baseIndexOf":491}],472:[function(require,module,exports){
"use strict";

var baseTimes = require('./_baseTimes'),
  isArguments = require('./isArguments'),
  isArray = require('./isArray'),
  isBuffer = require('./isBuffer'),
  isIndex = require('./_isIndex'),
  isTypedArray = require('./isTypedArray');
var objectProto = Object.prototype;
var hasOwnProperty = objectProto.hasOwnProperty;
function arrayLikeKeys(value, inherited) {
  var isArr = isArray(value),
    isArg = !isArr && isArguments(value),
    isBuff = !isArr && !isArg && isBuffer(value),
    isType = !isArr && !isArg && !isBuff && isTypedArray(value),
    skipIndexes = isArr || isArg || isBuff || isType,
    result = skipIndexes ? baseTimes(value.length, String) : [],
    length = result.length;
  for (var key in value) {
    if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && (key == 'length' || isBuff && (key == 'offset' || key == 'parent') || isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset') || isIndex(key, length)))) {
      result.push(key);
    }
  }
  return result;
}
module.exports = arrayLikeKeys;

},{"./_baseTimes":514,"./_isIndex":575,"./isArguments":647,"./isArray":648,"./isBuffer":651,"./isTypedArray":661}],473:[function(require,module,exports){
"use strict";

function arrayMap(array, iteratee) {
  var index = -1,
    length = array == null ? 0 : array.length,
    result = Array(length);
  while (++index < length) {
    result[index] = iteratee(array[index], index, array);
  }
  return result;
}
module.exports = arrayMap;

},{}],474:[function(require,module,exports){
"use strict";

function arrayPush(array, values) {
  var index = -1,
    length = values.length,
    offset = array.length;
  while (++index < length) {
    array[offset + index] = values[index];
  }
  return array;
}
module.exports = arrayPush;

},{}],475:[function(require,module,exports){
"use strict";

function arraySome(array, predicate) {
  var index = -1,
    length = array == null ? 0 : array.length;
  while (++index < length) {
    if (predicate(array[index], index, array)) {
      return true;
    }
  }
  return false;
}
module.exports = arraySome;

},{}],476:[function(require,module,exports){
"use strict";

var baseAssignValue = require('./_baseAssignValue'),
  eq = require('./eq');
function assignMergeValue(object, key, value) {
  if (value !== undefined && !eq(object[key], value) || value === undefined && !(key in object)) {
    baseAssignValue(object, key, value);
  }
}
module.exports = assignMergeValue;

},{"./_baseAssignValue":481,"./eq":634}],477:[function(require,module,exports){
"use strict";

var baseAssignValue = require('./_baseAssignValue'),
  eq = require('./eq');
var objectProto = Object.prototype;
var hasOwnProperty = objectProto.hasOwnProperty;
function assignValue(object, key, value) {
  var objValue = object[key];
  if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || value === undefined && !(key in object)) {
    baseAssignValue(object, key, value);
  }
}
module.exports = assignValue;

},{"./_baseAssignValue":481,"./eq":634}],478:[function(require,module,exports){
"use strict";

var eq = require('./eq');
function assocIndexOf(array, key) {
  var length = array.length;
  while (length--) {
    if (eq(array[length][0], key)) {
      return length;
    }
  }
  return -1;
}
module.exports = assocIndexOf;

},{"./eq":634}],479:[function(require,module,exports){
"use strict";

var copyObject = require('./_copyObject'),
  keys = require('./keys');
function baseAssign(object, source) {
  return object && copyObject(source, keys(source), object);
}
module.exports = baseAssign;

},{"./_copyObject":529,"./keys":664}],480:[function(require,module,exports){
"use strict";

var copyObject = require('./_copyObject'),
  keysIn = require('./keysIn');
function baseAssignIn(object, source) {
  return object && copyObject(source, keysIn(source), object);
}
module.exports = baseAssignIn;

},{"./_copyObject":529,"./keysIn":665}],481:[function(require,module,exports){
"use strict";

var defineProperty = require('./_defineProperty');
function baseAssignValue(object, key, value) {
  if (key == '__proto__' && defineProperty) {
    defineProperty(object, key, {
      'configurable': true,
      'enumerable': true,
      'value': value,
      'writable': true
    });
  } else {
    object[key] = value;
  }
}
module.exports = baseAssignValue;

},{"./_defineProperty":543}],482:[function(require,module,exports){
"use strict";

var Stack = require('./_Stack'),
  arrayEach = require('./_arrayEach'),
  assignValue = require('./_assignValue'),
  baseAssign = require('./_baseAssign'),
  baseAssignIn = require('./_baseAssignIn'),
  cloneBuffer = require('./_cloneBuffer'),
  copyArray = require('./_copyArray'),
  copySymbols = require('./_copySymbols'),
  copySymbolsIn = require('./_copySymbolsIn'),
  getAllKeys = require('./_getAllKeys'),
  getAllKeysIn = require('./_getAllKeysIn'),
  getTag = require('./_getTag'),
  initCloneArray = require('./_initCloneArray'),
  initCloneByTag = require('./_initCloneByTag'),
  initCloneObject = require('./_initCloneObject'),
  isArray = require('./isArray'),
  isBuffer = require('./isBuffer'),
  isMap = require('./isMap'),
  isObject = require('./isObject'),
  isSet = require('./isSet'),
  keys = require('./keys'),
  keysIn = require('./keysIn');
var CLONE_DEEP_FLAG = 1,
  CLONE_FLAT_FLAG = 2,
  CLONE_SYMBOLS_FLAG = 4;
var argsTag = '[object Arguments]',
  arrayTag = '[object Array]',
  boolTag = '[object Boolean]',
  dateTag = '[object Date]',
  errorTag = '[object Error]',
  funcTag = '[object Function]',
  genTag = '[object GeneratorFunction]',
  mapTag = '[object Map]',
  numberTag = '[object Number]',
  objectTag = '[object Object]',
  regexpTag = '[object RegExp]',
  setTag = '[object Set]',
  stringTag = '[object String]',
  symbolTag = '[object Symbol]',
  weakMapTag = '[object WeakMap]';
var arrayBufferTag = '[object ArrayBuffer]',
  dataViewTag = '[object DataView]',
  float32Tag = '[object Float32Array]',
  float64Tag = '[object Float64Array]',
  int8Tag = '[object Int8Array]',
  int16Tag = '[object Int16Array]',
  int32Tag = '[object Int32Array]',
  uint8Tag = '[object Uint8Array]',
  uint8ClampedTag = '[object Uint8ClampedArray]',
  uint16Tag = '[object Uint16Array]',
  uint32Tag = '[object Uint32Array]';
var cloneableTags = {};
cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag] = cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[setTag] = cloneableTags[stringTag] = cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false;
function baseClone(value, bitmask, customizer, key, object, stack) {
  var result,
    isDeep = bitmask & CLONE_DEEP_FLAG,
    isFlat = bitmask & CLONE_FLAT_FLAG,
    isFull = bitmask & CLONE_SYMBOLS_FLAG;
  if (customizer) {
    result = object ? customizer(value, key, object, stack) : customizer(value);
  }
  if (result !== undefined) {
    return result;
  }
  if (!isObject(value)) {
    return value;
  }
  var isArr = isArray(value);
  if (isArr) {
    result = initCloneArray(value);
    if (!isDeep) {
      return copyArray(value, result);
    }
  } else {
    var tag = getTag(value),
      isFunc = tag == funcTag || tag == genTag;
    if (isBuffer(value)) {
      return cloneBuffer(value, isDeep);
    }
    if (tag == objectTag || tag == argsTag || isFunc && !object) {
      result = isFlat || isFunc ? {} : initCloneObject(value);
      if (!isDeep) {
        return isFlat ? copySymbolsIn(value, baseAssignIn(result, value)) : copySymbols(value, baseAssign(result, value));
      }
    } else {
      if (!cloneableTags[tag]) {
        return object ? value : {};
      }
      result = initCloneByTag(value, tag, isDeep);
    }
  }
  stack || (stack = new Stack());
  var stacked = stack.get(value);
  if (stacked) {
    return stacked;
  }
  stack.set(value, result);
  if (isSet(value)) {
    value.forEach(function (subValue) {
      result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
    });
  } else if (isMap(value)) {
    value.forEach(function (subValue, key) {
      result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
    });
  }
  var keysFunc = isFull ? isFlat ? getAllKeysIn : getAllKeys : isFlat ? keysIn : keys;
  var props = isArr ? undefined : keysFunc(value);
  arrayEach(props || value, function (subValue, key) {
    if (props) {
      key = subValue;
      subValue = value[key];
    }
    assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  });
  return result;
}
module.exports = baseClone;

},{"./_Stack":464,"./_arrayEach":469,"./_assignValue":477,"./_baseAssign":479,"./_baseAssignIn":480,"./_cloneBuffer":521,"./_copyArray":528,"./_copySymbols":530,"./_copySymbolsIn":531,"./_getAllKeys":549,"./_getAllKeysIn":550,"./_getTag":561,"./_initCloneArray":570,"./_initCloneByTag":571,"./_initCloneObject":572,"./isArray":648,"./isBuffer":651,"./isMap":655,"./isObject":656,"./isSet":659,"./keys":664,"./keysIn":665}],483:[function(require,module,exports){
"use strict";

var isObject = require('./isObject');
var objectCreate = Object.create;
var baseCreate = function () {
  function object() {}
  return function (proto) {
    if (!isObject(proto)) {
      return {};
    }
    if (objectCreate) {
      return objectCreate(proto);
    }
    object.prototype = proto;
    var result = new object();
    object.prototype = undefined;
    return result;
  };
}();
module.exports = baseCreate;

},{"./isObject":656}],484:[function(require,module,exports){
"use strict";

function baseFindIndex(array, predicate, fromIndex, fromRight) {
  var length = array.length,
    index = fromIndex + (fromRight ? 1 : -1);
  while (fromRight ? index-- : ++index < length) {
    if (predicate(array[index], index, array)) {
      return index;
    }
  }
  return -1;
}
module.exports = baseFindIndex;

},{}],485:[function(require,module,exports){
"use strict";

var arrayPush = require('./_arrayPush'),
  isFlattenable = require('./_isFlattenable');
function baseFlatten(array, depth, predicate, isStrict, result) {
  var index = -1,
    length = array.length;
  predicate || (predicate = isFlattenable);
  result || (result = []);
  while (++index < length) {
    var value = array[index];
    if (depth > 0 && predicate(value)) {
      if (depth > 1) {
        baseFlatten(value, depth - 1, predicate, isStrict, result);
      } else {
        arrayPush(result, value);
      }
    } else if (!isStrict) {
      result[result.length] = value;
    }
  }
  return result;
}
module.exports = baseFlatten;

},{"./_arrayPush":474,"./_isFlattenable":574}],486:[function(require,module,exports){
"use strict";

var createBaseFor = require('./_createBaseFor');
var baseFor = createBaseFor();
module.exports = baseFor;

},{"./_createBaseFor":535}],487:[function(require,module,exports){
"use strict";

var castPath = require('./_castPath'),
  toKey = require('./_toKey');
function baseGet(object, path) {
  path = castPath(path, object);
  var index = 0,
    length = path.length;
  while (object != null && index < length) {
    object = object[toKey(path[index++])];
  }
  return index && index == length ? object : undefined;
}
module.exports = baseGet;

},{"./_castPath":519,"./_toKey":624}],488:[function(require,module,exports){
"use strict";

var arrayPush = require('./_arrayPush'),
  isArray = require('./isArray');
function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  var result = keysFunc(object);
  return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
}
module.exports = baseGetAllKeys;

},{"./_arrayPush":474,"./isArray":648}],489:[function(require,module,exports){
"use strict";

var Symbol = require('./_Symbol'),
  getRawTag = require('./_getRawTag'),
  objectToString = require('./_objectToString');
var nullTag = '[object Null]',
  undefinedTag = '[object Undefined]';
var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
function baseGetTag(value) {
  if (value == null) {
    return value === undefined ? undefinedTag : nullTag;
  }
  return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
}
module.exports = baseGetTag;

},{"./_Symbol":465,"./_getRawTag":558,"./_objectToString":602}],490:[function(require,module,exports){
"use strict";

function baseHasIn(object, key) {
  return object != null && key in Object(object);
}
module.exports = baseHasIn;

},{}],491:[function(require,module,exports){
"use strict";

var baseFindIndex = require('./_baseFindIndex'),
  baseIsNaN = require('./_baseIsNaN'),
  strictIndexOf = require('./_strictIndexOf');
function baseIndexOf(array, value, fromIndex) {
  return value === value ? strictIndexOf(array, value, fromIndex) : baseFindIndex(array, baseIsNaN, fromIndex);
}
module.exports = baseIndexOf;

},{"./_baseFindIndex":484,"./_baseIsNaN":497,"./_strictIndexOf":622}],492:[function(require,module,exports){
"use strict";

var baseGetTag = require('./_baseGetTag'),
  isObjectLike = require('./isObjectLike');
var argsTag = '[object Arguments]';
function baseIsArguments(value) {
  return isObjectLike(value) && baseGetTag(value) == argsTag;
}
module.exports = baseIsArguments;

},{"./_baseGetTag":489,"./isObjectLike":657}],493:[function(require,module,exports){
"use strict";

var baseIsEqualDeep = require('./_baseIsEqualDeep'),
  isObjectLike = require('./isObjectLike');
function baseIsEqual(value, other, bitmask, customizer, stack) {
  if (value === other) {
    return true;
  }
  if (value == null || other == null || !isObjectLike(value) && !isObjectLike(other)) {
    return value !== value && other !== other;
  }
  return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
}
module.exports = baseIsEqual;

},{"./_baseIsEqualDeep":494,"./isObjectLike":657}],494:[function(require,module,exports){
"use strict";

var Stack = require('./_Stack'),
  equalArrays = require('./_equalArrays'),
  equalByTag = require('./_equalByTag'),
  equalObjects = require('./_equalObjects'),
  getTag = require('./_getTag'),
  isArray = require('./isArray'),
  isBuffer = require('./isBuffer'),
  isTypedArray = require('./isTypedArray');
var COMPARE_PARTIAL_FLAG = 1;
var argsTag = '[object Arguments]',
  arrayTag = '[object Array]',
  objectTag = '[object Object]';
var objectProto = Object.prototype;
var hasOwnProperty = objectProto.hasOwnProperty;
function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  var objIsArr = isArray(object),
    othIsArr = isArray(other),
    objTag = objIsArr ? arrayTag : getTag(object),
    othTag = othIsArr ? arrayTag : getTag(other);
  objTag = objTag == argsTag ? objectTag : objTag;
  othTag = othTag == argsTag ? objectTag : othTag;
  var objIsObj = objTag == objectTag,
    othIsObj = othTag == objectTag,
    isSameTag = objTag == othTag;
  if (isSameTag && isBuffer(object)) {
    if (!isBuffer(other)) {
      return false;
    }
    objIsArr = true;
    objIsObj = false;
  }
  if (isSameTag && !objIsObj) {
    stack || (stack = new Stack());
    return objIsArr || isTypedArray(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  }
  if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
    var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
      othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
    if (objIsWrapped || othIsWrapped) {
      var objUnwrapped = objIsWrapped ? object.value() : object,
        othUnwrapped = othIsWrapped ? other.value() : other;
      stack || (stack = new Stack());
      return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
    }
  }
  if (!isSameTag) {
    return false;
  }
  stack || (stack = new Stack());
  return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
}
module.exports = baseIsEqualDeep;

},{"./_Stack":464,"./_equalArrays":544,"./_equalByTag":545,"./_equalObjects":546,"./_getTag":561,"./isArray":648,"./isBuffer":651,"./isTypedArray":661}],495:[function(require,module,exports){
"use strict";

var getTag = require('./_getTag'),
  isObjectLike = require('./isObjectLike');
var mapTag = '[object Map]';
function baseIsMap(value) {
  return isObjectLike(value) && getTag(value) == mapTag;
}
module.exports = baseIsMap;

},{"./_getTag":561,"./isObjectLike":657}],496:[function(require,module,exports){
"use strict";

var Stack = require('./_Stack'),
  baseIsEqual = require('./_baseIsEqual');
var COMPARE_PARTIAL_FLAG = 1,
  COMPARE_UNORDERED_FLAG = 2;
function baseIsMatch(object, source, matchData, customizer) {
  var index = matchData.length,
    length = index,
    noCustomizer = !customizer;
  if (object == null) {
    return !length;
  }
  object = Object(object);
  while (index--) {
    var data = matchData[index];
    if (noCustomizer && data[2] ? data[1] !== object[data[0]] : !(data[0] in object)) {
      return false;
    }
  }
  while (++index < length) {
    data = matchData[index];
    var key = data[0],
      objValue = object[key],
      srcValue = data[1];
    if (noCustomizer && data[2]) {
      if (objValue === undefined && !(key in object)) {
        return false;
      }
    } else {
      var stack = new Stack();
      if (customizer) {
        var result = customizer(objValue, srcValue, key, object, source, stack);
      }
      if (!(result === undefined ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) : result)) {
        return false;
      }
    }
  }
  return true;
}
module.exports = baseIsMatch;

},{"./_Stack":464,"./_baseIsEqual":493}],497:[function(require,module,exports){
"use strict";

function baseIsNaN(value) {
  return value !== value;
}
module.exports = baseIsNaN;

},{}],498:[function(require,module,exports){
"use strict";

var isFunction = require('./isFunction'),
  isMasked = require('./_isMasked'),
  isObject = require('./isObject'),
  toSource = require('./_toSource');
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
var reIsHostCtor = /^\[object .+?Constructor\]$/;
var funcProto = Function.prototype,
  objectProto = Object.prototype;
var funcToString = funcProto.toString;
var hasOwnProperty = objectProto.hasOwnProperty;
var reIsNative = RegExp('^' + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&').replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');
function baseIsNative(value) {
  if (!isObject(value) || isMasked(value)) {
    return false;
  }
  var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  return pattern.test(toSource(value));
}
module.exports = baseIsNative;

},{"./_isMasked":580,"./_toSource":625,"./isFunction":653,"./isObject":656}],499:[function(require,module,exports){
"use strict";

var getTag = require('./_getTag'),
  isObjectLike = require('./isObjectLike');
var setTag = '[object Set]';
function baseIsSet(value) {
  return isObjectLike(value) && getTag(value) == setTag;
}
module.exports = baseIsSet;

},{"./_getTag":561,"./isObjectLike":657}],500:[function(require,module,exports){
"use strict";

var baseGetTag = require('./_baseGetTag'),
  isLength = require('./isLength'),
  isObjectLike = require('./isObjectLike');
var argsTag = '[object Arguments]',
  arrayTag = '[object Array]',
  boolTag = '[object Boolean]',
  dateTag = '[object Date]',
  errorTag = '[object Error]',
  funcTag = '[object Function]',
  mapTag = '[object Map]',
  numberTag = '[object Number]',
  objectTag = '[object Object]',
  regexpTag = '[object RegExp]',
  setTag = '[object Set]',
  stringTag = '[object String]',
  weakMapTag = '[object WeakMap]';
var arrayBufferTag = '[object ArrayBuffer]',
  dataViewTag = '[object DataView]',
  float32Tag = '[object Float32Array]',
  float64Tag = '[object Float64Array]',
  int8Tag = '[object Int8Array]',
  int16Tag = '[object Int16Array]',
  int32Tag = '[object Int32Array]',
  uint8Tag = '[object Uint8Array]',
  uint8ClampedTag = '[object Uint8ClampedArray]',
  uint16Tag = '[object Uint16Array]',
  uint32Tag = '[object Uint32Array]';
var typedArrayTags = {};
typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
function baseIsTypedArray(value) {
  return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
}
module.exports = baseIsTypedArray;

},{"./_baseGetTag":489,"./isLength":654,"./isObjectLike":657}],501:[function(require,module,exports){
"use strict";

var baseMatches = require('./_baseMatches'),
  baseMatchesProperty = require('./_baseMatchesProperty'),
  identity = require('./identity'),
  isArray = require('./isArray'),
  property = require('./property');
function baseIteratee(value) {
  if (typeof value == 'function') {
    return value;
  }
  if (value == null) {
    return identity;
  }
  if (typeof value == 'object') {
    return isArray(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value);
  }
  return property(value);
}
module.exports = baseIteratee;

},{"./_baseMatches":505,"./_baseMatchesProperty":506,"./identity":646,"./isArray":648,"./property":669}],502:[function(require,module,exports){
"use strict";

var isPrototype = require('./_isPrototype'),
  nativeKeys = require('./_nativeKeys');
var objectProto = Object.prototype;
var hasOwnProperty = objectProto.hasOwnProperty;
function baseKeys(object) {
  if (!isPrototype(object)) {
    return nativeKeys(object);
  }
  var result = [];
  for (var key in Object(object)) {
    if (hasOwnProperty.call(object, key) && key != 'constructor') {
      result.push(key);
    }
  }
  return result;
}
module.exports = baseKeys;

},{"./_isPrototype":581,"./_nativeKeys":599}],503:[function(require,module,exports){
"use strict";

var isObject = require('./isObject'),
  isPrototype = require('./_isPrototype'),
  nativeKeysIn = require('./_nativeKeysIn');
var objectProto = Object.prototype;
var hasOwnProperty = objectProto.hasOwnProperty;
function baseKeysIn(object) {
  if (!isObject(object)) {
    return nativeKeysIn(object);
  }
  var isProto = isPrototype(object),
    result = [];
  for (var key in object) {
    if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
      result.push(key);
    }
  }
  return result;
}
module.exports = baseKeysIn;

},{"./_isPrototype":581,"./_nativeKeysIn":600,"./isObject":656}],504:[function(require,module,exports){
"use strict";

function baseLodash() {}
module.exports = baseLodash;

},{}],505:[function(require,module,exports){
"use strict";

var baseIsMatch = require('./_baseIsMatch'),
  getMatchData = require('./_getMatchData'),
  matchesStrictComparable = require('./_matchesStrictComparable');
function baseMatches(source) {
  var matchData = getMatchData(source);
  if (matchData.length == 1 && matchData[0][2]) {
    return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  }
  return function (object) {
    return object === source || baseIsMatch(object, source, matchData);
  };
}
module.exports = baseMatches;

},{"./_baseIsMatch":496,"./_getMatchData":555,"./_matchesStrictComparable":594}],506:[function(require,module,exports){
"use strict";

var baseIsEqual = require('./_baseIsEqual'),
  get = require('./get'),
  hasIn = require('./hasIn'),
  isKey = require('./_isKey'),
  isStrictComparable = require('./_isStrictComparable'),
  matchesStrictComparable = require('./_matchesStrictComparable'),
  toKey = require('./_toKey');
var COMPARE_PARTIAL_FLAG = 1,
  COMPARE_UNORDERED_FLAG = 2;
function baseMatchesProperty(path, srcValue) {
  if (isKey(path) && isStrictComparable(srcValue)) {
    return matchesStrictComparable(toKey(path), srcValue);
  }
  return function (object) {
    var objValue = get(object, path);
    return objValue === undefined && objValue === srcValue ? hasIn(object, path) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  };
}
module.exports = baseMatchesProperty;

},{"./_baseIsEqual":493,"./_isKey":577,"./_isStrictComparable":582,"./_matchesStrictComparable":594,"./_toKey":624,"./get":644,"./hasIn":645}],507:[function(require,module,exports){
"use strict";

var Stack = require('./_Stack'),
  assignMergeValue = require('./_assignMergeValue'),
  baseFor = require('./_baseFor'),
  baseMergeDeep = require('./_baseMergeDeep'),
  isObject = require('./isObject'),
  keysIn = require('./keysIn'),
  safeGet = require('./_safeGet');
function baseMerge(object, source, srcIndex, customizer, stack) {
  if (object === source) {
    return;
  }
  baseFor(source, function (srcValue, key) {
    stack || (stack = new Stack());
    if (isObject(srcValue)) {
      baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
    } else {
      var newValue = customizer ? customizer(safeGet(object, key), srcValue, key + '', object, source, stack) : undefined;
      if (newValue === undefined) {
        newValue = srcValue;
      }
      assignMergeValue(object, key, newValue);
    }
  }, keysIn);
}
module.exports = baseMerge;

},{"./_Stack":464,"./_assignMergeValue":476,"./_baseFor":486,"./_baseMergeDeep":508,"./_safeGet":609,"./isObject":656,"./keysIn":665}],508:[function(require,module,exports){
"use strict";

var assignMergeValue = require('./_assignMergeValue'),
  cloneBuffer = require('./_cloneBuffer'),
  cloneTypedArray = require('./_cloneTypedArray'),
  copyArray = require('./_copyArray'),
  initCloneObject = require('./_initCloneObject'),
  isArguments = require('./isArguments'),
  isArray = require('./isArray'),
  isArrayLikeObject = require('./isArrayLikeObject'),
  isBuffer = require('./isBuffer'),
  isFunction = require('./isFunction'),
  isObject = require('./isObject'),
  isPlainObject = require('./isPlainObject'),
  isTypedArray = require('./isTypedArray'),
  safeGet = require('./_safeGet'),
  toPlainObject = require('./toPlainObject');
function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  var objValue = safeGet(object, key),
    srcValue = safeGet(source, key),
    stacked = stack.get(srcValue);
  if (stacked) {
    assignMergeValue(object, key, stacked);
    return;
  }
  var newValue = customizer ? customizer(objValue, srcValue, key + '', object, source, stack) : undefined;
  var isCommon = newValue === undefined;
  if (isCommon) {
    var isArr = isArray(srcValue),
      isBuff = !isArr && isBuffer(srcValue),
      isTyped = !isArr && !isBuff && isTypedArray(srcValue);
    newValue = srcValue;
    if (isArr || isBuff || isTyped) {
      if (isArray(objValue)) {
        newValue = objValue;
      } else if (isArrayLikeObject(objValue)) {
        newValue = copyArray(objValue);
      } else if (isBuff) {
        isCommon = false;
        newValue = cloneBuffer(srcValue, true);
      } else if (isTyped) {
        isCommon = false;
        newValue = cloneTypedArray(srcValue, true);
      } else {
        newValue = [];
      }
    } else if (isPlainObject(srcValue) || isArguments(srcValue)) {
      newValue = objValue;
      if (isArguments(objValue)) {
        newValue = toPlainObject(objValue);
      } else if (!isObject(objValue) || isFunction(objValue)) {
        newValue = initCloneObject(srcValue);
      }
    } else {
      isCommon = false;
    }
  }
  if (isCommon) {
    stack.set(srcValue, newValue);
    mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
    stack['delete'](srcValue);
  }
  assignMergeValue(object, key, newValue);
}
module.exports = baseMergeDeep;

},{"./_assignMergeValue":476,"./_cloneBuffer":521,"./_cloneTypedArray":525,"./_copyArray":528,"./_initCloneObject":572,"./_safeGet":609,"./isArguments":647,"./isArray":648,"./isArrayLikeObject":650,"./isBuffer":651,"./isFunction":653,"./isObject":656,"./isPlainObject":658,"./isTypedArray":661,"./toPlainObject":677}],509:[function(require,module,exports){
"use strict";

function baseProperty(key) {
  return function (object) {
    return object == null ? undefined : object[key];
  };
}
module.exports = baseProperty;

},{}],510:[function(require,module,exports){
"use strict";

var baseGet = require('./_baseGet');
function basePropertyDeep(path) {
  return function (object) {
    return baseGet(object, path);
  };
}
module.exports = basePropertyDeep;

},{"./_baseGet":487}],511:[function(require,module,exports){
"use strict";

var identity = require('./identity'),
  overRest = require('./_overRest'),
  setToString = require('./_setToString');
function baseRest(func, start) {
  return setToString(overRest(func, start, identity), func + '');
}
module.exports = baseRest;

},{"./_overRest":604,"./_setToString":614,"./identity":646}],512:[function(require,module,exports){
"use strict";

var identity = require('./identity'),
  metaMap = require('./_metaMap');
var baseSetData = !metaMap ? identity : function (func, data) {
  metaMap.set(func, data);
  return func;
};
module.exports = baseSetData;

},{"./_metaMap":597,"./identity":646}],513:[function(require,module,exports){
"use strict";

var constant = require('./constant'),
  defineProperty = require('./_defineProperty'),
  identity = require('./identity');
var baseSetToString = !defineProperty ? identity : function (func, string) {
  return defineProperty(func, 'toString', {
    'configurable': true,
    'enumerable': false,
    'value': constant(string),
    'writable': true
  });
};
module.exports = baseSetToString;

},{"./_defineProperty":543,"./constant":632,"./identity":646}],514:[function(require,module,exports){
"use strict";

function baseTimes(n, iteratee) {
  var index = -1,
    result = Array(n);
  while (++index < n) {
    result[index] = iteratee(index);
  }
  return result;
}
module.exports = baseTimes;

},{}],515:[function(require,module,exports){
"use strict";

var Symbol = require('./_Symbol'),
  arrayMap = require('./_arrayMap'),
  isArray = require('./isArray'),
  isSymbol = require('./isSymbol');
var INFINITY = 1 / 0;
var symbolProto = Symbol ? Symbol.prototype : undefined,
  symbolToString = symbolProto ? symbolProto.toString : undefined;
function baseToString(value) {
  if (typeof value == 'string') {
    return value;
  }
  if (isArray(value)) {
    return arrayMap(value, baseToString) + '';
  }
  if (isSymbol(value)) {
    return symbolToString ? symbolToString.call(value) : '';
  }
  var result = value + '';
  return result == '0' && 1 / value == -INFINITY ? '-0' : result;
}
module.exports = baseToString;

},{"./_Symbol":465,"./_arrayMap":473,"./isArray":648,"./isSymbol":660}],516:[function(require,module,exports){
"use strict";

var trimmedEndIndex = require('./_trimmedEndIndex');
var reTrimStart = /^\s+/;
function baseTrim(string) {
  return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '') : string;
}
module.exports = baseTrim;

},{"./_trimmedEndIndex":626}],517:[function(require,module,exports){
"use strict";

function baseUnary(func) {
  return function (value) {
    return func(value);
  };
}
module.exports = baseUnary;

},{}],518:[function(require,module,exports){
"use strict";

function cacheHas(cache, key) {
  return cache.has(key);
}
module.exports = cacheHas;

},{}],519:[function(require,module,exports){
"use strict";

var isArray = require('./isArray'),
  isKey = require('./_isKey'),
  stringToPath = require('./_stringToPath'),
  toString = require('./toString');
function castPath(value, object) {
  if (isArray(value)) {
    return value;
  }
  return isKey(value, object) ? [value] : stringToPath(toString(value));
}
module.exports = castPath;

},{"./_isKey":577,"./_stringToPath":623,"./isArray":648,"./toString":678}],520:[function(require,module,exports){
"use strict";

var Uint8Array = require('./_Uint8Array');
function cloneArrayBuffer(arrayBuffer) {
  var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  return result;
}
module.exports = cloneArrayBuffer;

},{"./_Uint8Array":466}],521:[function(require,module,exports){
"use strict";

var root = require('./_root');
var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
var moduleExports = freeModule && freeModule.exports === freeExports;
var Buffer = moduleExports ? root.Buffer : undefined,
  allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;
function cloneBuffer(buffer, isDeep) {
  if (isDeep) {
    return buffer.slice();
  }
  var length = buffer.length,
    result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  buffer.copy(result);
  return result;
}
module.exports = cloneBuffer;

},{"./_root":608}],522:[function(require,module,exports){
"use strict";

var cloneArrayBuffer = require('./_cloneArrayBuffer');
function cloneDataView(dataView, isDeep) {
  var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
}
module.exports = cloneDataView;

},{"./_cloneArrayBuffer":520}],523:[function(require,module,exports){
"use strict";

var reFlags = /\w*$/;
function cloneRegExp(regexp) {
  var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  result.lastIndex = regexp.lastIndex;
  return result;
}
module.exports = cloneRegExp;

},{}],524:[function(require,module,exports){
"use strict";

var Symbol = require('./_Symbol');
var symbolProto = Symbol ? Symbol.prototype : undefined,
  symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
function cloneSymbol(symbol) {
  return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
}
module.exports = cloneSymbol;

},{"./_Symbol":465}],525:[function(require,module,exports){
"use strict";

var cloneArrayBuffer = require('./_cloneArrayBuffer');
function cloneTypedArray(typedArray, isDeep) {
  var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
}
module.exports = cloneTypedArray;

},{"./_cloneArrayBuffer":520}],526:[function(require,module,exports){
"use strict";

var nativeMax = Math.max;
function composeArgs(args, partials, holders, isCurried) {
  var argsIndex = -1,
    argsLength = args.length,
    holdersLength = holders.length,
    leftIndex = -1,
    leftLength = partials.length,
    rangeLength = nativeMax(argsLength - holdersLength, 0),
    result = Array(leftLength + rangeLength),
    isUncurried = !isCurried;
  while (++leftIndex < leftLength) {
    result[leftIndex] = partials[leftIndex];
  }
  while (++argsIndex < holdersLength) {
    if (isUncurried || argsIndex < argsLength) {
      result[holders[argsIndex]] = args[argsIndex];
    }
  }
  while (rangeLength--) {
    result[leftIndex++] = args[argsIndex++];
  }
  return result;
}
module.exports = composeArgs;

},{}],527:[function(require,module,exports){
"use strict";

var nativeMax = Math.max;
function composeArgsRight(args, partials, holders, isCurried) {
  var argsIndex = -1,
    argsLength = args.length,
    holdersIndex = -1,
    holdersLength = holders.length,
    rightIndex = -1,
    rightLength = partials.length,
    rangeLength = nativeMax(argsLength - holdersLength, 0),
    result = Array(rangeLength + rightLength),
    isUncurried = !isCurried;
  while (++argsIndex < rangeLength) {
    result[argsIndex] = args[argsIndex];
  }
  var offset = argsIndex;
  while (++rightIndex < rightLength) {
    result[offset + rightIndex] = partials[rightIndex];
  }
  while (++holdersIndex < holdersLength) {
    if (isUncurried || argsIndex < argsLength) {
      result[offset + holders[holdersIndex]] = args[argsIndex++];
    }
  }
  return result;
}
module.exports = composeArgsRight;

},{}],528:[function(require,module,exports){
"use strict";

function copyArray(source, array) {
  var index = -1,
    length = source.length;
  array || (array = Array(length));
  while (++index < length) {
    array[index] = source[index];
  }
  return array;
}
module.exports = copyArray;

},{}],529:[function(require,module,exports){
"use strict";

var assignValue = require('./_assignValue'),
  baseAssignValue = require('./_baseAssignValue');
function copyObject(source, props, object, customizer) {
  var isNew = !object;
  object || (object = {});
  var index = -1,
    length = props.length;
  while (++index < length) {
    var key = props[index];
    var newValue = customizer ? customizer(object[key], source[key], key, object, source) : undefined;
    if (newValue === undefined) {
      newValue = source[key];
    }
    if (isNew) {
      baseAssignValue(object, key, newValue);
    } else {
      assignValue(object, key, newValue);
    }
  }
  return object;
}
module.exports = copyObject;

},{"./_assignValue":477,"./_baseAssignValue":481}],530:[function(require,module,exports){
"use strict";

var copyObject = require('./_copyObject'),
  getSymbols = require('./_getSymbols');
function copySymbols(source, object) {
  return copyObject(source, getSymbols(source), object);
}
module.exports = copySymbols;

},{"./_copyObject":529,"./_getSymbols":559}],531:[function(require,module,exports){
"use strict";

var copyObject = require('./_copyObject'),
  getSymbolsIn = require('./_getSymbolsIn');
function copySymbolsIn(source, object) {
  return copyObject(source, getSymbolsIn(source), object);
}
module.exports = copySymbolsIn;

},{"./_copyObject":529,"./_getSymbolsIn":560}],532:[function(require,module,exports){
"use strict";

var root = require('./_root');
var coreJsData = root['__core-js_shared__'];
module.exports = coreJsData;

},{"./_root":608}],533:[function(require,module,exports){
"use strict";

function countHolders(array, placeholder) {
  var length = array.length,
    result = 0;
  while (length--) {
    if (array[length] === placeholder) {
      ++result;
    }
  }
  return result;
}
module.exports = countHolders;

},{}],534:[function(require,module,exports){
"use strict";

var baseRest = require('./_baseRest'),
  isIterateeCall = require('./_isIterateeCall');
function createAssigner(assigner) {
  return baseRest(function (object, sources) {
    var index = -1,
      length = sources.length,
      customizer = length > 1 ? sources[length - 1] : undefined,
      guard = length > 2 ? sources[2] : undefined;
    customizer = assigner.length > 3 && typeof customizer == 'function' ? (length--, customizer) : undefined;
    if (guard && isIterateeCall(sources[0], sources[1], guard)) {
      customizer = length < 3 ? undefined : customizer;
      length = 1;
    }
    object = Object(object);
    while (++index < length) {
      var source = sources[index];
      if (source) {
        assigner(object, source, index, customizer);
      }
    }
    return object;
  });
}
module.exports = createAssigner;

},{"./_baseRest":511,"./_isIterateeCall":576}],535:[function(require,module,exports){
"use strict";

function createBaseFor(fromRight) {
  return function (object, iteratee, keysFunc) {
    var index = -1,
      iterable = Object(object),
      props = keysFunc(object),
      length = props.length;
    while (length--) {
      var key = props[fromRight ? length : ++index];
      if (iteratee(iterable[key], key, iterable) === false) {
        break;
      }
    }
    return object;
  };
}
module.exports = createBaseFor;

},{}],536:[function(require,module,exports){
"use strict";

var createCtor = require('./_createCtor'),
  root = require('./_root');
var WRAP_BIND_FLAG = 1;
function createBind(func, bitmask, thisArg) {
  var isBind = bitmask & WRAP_BIND_FLAG,
    Ctor = createCtor(func);
  function wrapper() {
    var fn = this && this !== root && this instanceof wrapper ? Ctor : func;
    return fn.apply(isBind ? thisArg : this, arguments);
  }
  return wrapper;
}
module.exports = createBind;

},{"./_createCtor":537,"./_root":608}],537:[function(require,module,exports){
"use strict";

var baseCreate = require('./_baseCreate'),
  isObject = require('./isObject');
function createCtor(Ctor) {
  return function () {
    var args = arguments;
    switch (args.length) {
      case 0:
        return new Ctor();
      case 1:
        return new Ctor(args[0]);
      case 2:
        return new Ctor(args[0], args[1]);
      case 3:
        return new Ctor(args[0], args[1], args[2]);
      case 4:
        return new Ctor(args[0], args[1], args[2], args[3]);
      case 5:
        return new Ctor(args[0], args[1], args[2], args[3], args[4]);
      case 6:
        return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
      case 7:
        return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
    }
    var thisBinding = baseCreate(Ctor.prototype),
      result = Ctor.apply(thisBinding, args);
    return isObject(result) ? result : thisBinding;
  };
}
module.exports = createCtor;

},{"./_baseCreate":483,"./isObject":656}],538:[function(require,module,exports){
"use strict";

var apply = require('./_apply'),
  createCtor = require('./_createCtor'),
  createHybrid = require('./_createHybrid'),
  createRecurry = require('./_createRecurry'),
  getHolder = require('./_getHolder'),
  replaceHolders = require('./_replaceHolders'),
  root = require('./_root');
function createCurry(func, bitmask, arity) {
  var Ctor = createCtor(func);
  function wrapper() {
    var length = arguments.length,
      args = Array(length),
      index = length,
      placeholder = getHolder(wrapper);
    while (index--) {
      args[index] = arguments[index];
    }
    var holders = length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder ? [] : replaceHolders(args, placeholder);
    length -= holders.length;
    if (length < arity) {
      return createRecurry(func, bitmask, createHybrid, wrapper.placeholder, undefined, args, holders, undefined, undefined, arity - length);
    }
    var fn = this && this !== root && this instanceof wrapper ? Ctor : func;
    return apply(fn, this, args);
  }
  return wrapper;
}
module.exports = createCurry;

},{"./_apply":468,"./_createCtor":537,"./_createHybrid":539,"./_createRecurry":541,"./_getHolder":553,"./_replaceHolders":607,"./_root":608}],539:[function(require,module,exports){
"use strict";

var composeArgs = require('./_composeArgs'),
  composeArgsRight = require('./_composeArgsRight'),
  countHolders = require('./_countHolders'),
  createCtor = require('./_createCtor'),
  createRecurry = require('./_createRecurry'),
  getHolder = require('./_getHolder'),
  reorder = require('./_reorder'),
  replaceHolders = require('./_replaceHolders'),
  root = require('./_root');
var WRAP_BIND_FLAG = 1,
  WRAP_BIND_KEY_FLAG = 2,
  WRAP_CURRY_FLAG = 8,
  WRAP_CURRY_RIGHT_FLAG = 16,
  WRAP_ARY_FLAG = 128,
  WRAP_FLIP_FLAG = 512;
function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
  var isAry = bitmask & WRAP_ARY_FLAG,
    isBind = bitmask & WRAP_BIND_FLAG,
    isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
    isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
    isFlip = bitmask & WRAP_FLIP_FLAG,
    Ctor = isBindKey ? undefined : createCtor(func);
  function wrapper() {
    var length = arguments.length,
      args = Array(length),
      index = length;
    while (index--) {
      args[index] = arguments[index];
    }
    if (isCurried) {
      var placeholder = getHolder(wrapper),
        holdersCount = countHolders(args, placeholder);
    }
    if (partials) {
      args = composeArgs(args, partials, holders, isCurried);
    }
    if (partialsRight) {
      args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
    }
    length -= holdersCount;
    if (isCurried && length < arity) {
      var newHolders = replaceHolders(args, placeholder);
      return createRecurry(func, bitmask, createHybrid, wrapper.placeholder, thisArg, args, newHolders, argPos, ary, arity - length);
    }
    var thisBinding = isBind ? thisArg : this,
      fn = isBindKey ? thisBinding[func] : func;
    length = args.length;
    if (argPos) {
      args = reorder(args, argPos);
    } else if (isFlip && length > 1) {
      args.reverse();
    }
    if (isAry && ary < length) {
      args.length = ary;
    }
    if (this && this !== root && this instanceof wrapper) {
      fn = Ctor || createCtor(fn);
    }
    return fn.apply(thisBinding, args);
  }
  return wrapper;
}
module.exports = createHybrid;

},{"./_composeArgs":526,"./_composeArgsRight":527,"./_countHolders":533,"./_createCtor":537,"./_createRecurry":541,"./_getHolder":553,"./_reorder":606,"./_replaceHolders":607,"./_root":608}],540:[function(require,module,exports){
"use strict";

var apply = require('./_apply'),
  createCtor = require('./_createCtor'),
  root = require('./_root');
var WRAP_BIND_FLAG = 1;
function createPartial(func, bitmask, thisArg, partials) {
  var isBind = bitmask & WRAP_BIND_FLAG,
    Ctor = createCtor(func);
  function wrapper() {
    var argsIndex = -1,
      argsLength = arguments.length,
      leftIndex = -1,
      leftLength = partials.length,
      args = Array(leftLength + argsLength),
      fn = this && this !== root && this instanceof wrapper ? Ctor : func;
    while (++leftIndex < leftLength) {
      args[leftIndex] = partials[leftIndex];
    }
    while (argsLength--) {
      args[leftIndex++] = arguments[++argsIndex];
    }
    return apply(fn, isBind ? thisArg : this, args);
  }
  return wrapper;
}
module.exports = createPartial;

},{"./_apply":468,"./_createCtor":537,"./_root":608}],541:[function(require,module,exports){
"use strict";

var isLaziable = require('./_isLaziable'),
  setData = require('./_setData'),
  setWrapToString = require('./_setWrapToString');
var WRAP_BIND_FLAG = 1,
  WRAP_BIND_KEY_FLAG = 2,
  WRAP_CURRY_BOUND_FLAG = 4,
  WRAP_CURRY_FLAG = 8,
  WRAP_PARTIAL_FLAG = 32,
  WRAP_PARTIAL_RIGHT_FLAG = 64;
function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
  var isCurry = bitmask & WRAP_CURRY_FLAG,
    newHolders = isCurry ? holders : undefined,
    newHoldersRight = isCurry ? undefined : holders,
    newPartials = isCurry ? partials : undefined,
    newPartialsRight = isCurry ? undefined : partials;
  bitmask |= isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG;
  bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
  if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
    bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
  }
  var newData = [func, bitmask, thisArg, newPartials, newHolders, newPartialsRight, newHoldersRight, argPos, ary, arity];
  var result = wrapFunc.apply(undefined, newData);
  if (isLaziable(func)) {
    setData(result, newData);
  }
  result.placeholder = placeholder;
  return setWrapToString(result, func, bitmask);
}
module.exports = createRecurry;

},{"./_isLaziable":579,"./_setData":612,"./_setWrapToString":615}],542:[function(require,module,exports){
"use strict";

var baseSetData = require('./_baseSetData'),
  createBind = require('./_createBind'),
  createCurry = require('./_createCurry'),
  createHybrid = require('./_createHybrid'),
  createPartial = require('./_createPartial'),
  getData = require('./_getData'),
  mergeData = require('./_mergeData'),
  setData = require('./_setData'),
  setWrapToString = require('./_setWrapToString'),
  toInteger = require('./toInteger');
var FUNC_ERROR_TEXT = 'Expected a function';
var WRAP_BIND_FLAG = 1,
  WRAP_BIND_KEY_FLAG = 2,
  WRAP_CURRY_FLAG = 8,
  WRAP_CURRY_RIGHT_FLAG = 16,
  WRAP_PARTIAL_FLAG = 32,
  WRAP_PARTIAL_RIGHT_FLAG = 64;
var nativeMax = Math.max;
function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
  var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
  if (!isBindKey && typeof func != 'function') {
    throw new TypeError(FUNC_ERROR_TEXT);
  }
  var length = partials ? partials.length : 0;
  if (!length) {
    bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
    partials = holders = undefined;
  }
  ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
  arity = arity === undefined ? arity : toInteger(arity);
  length -= holders ? holders.length : 0;
  if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
    var partialsRight = partials,
      holdersRight = holders;
    partials = holders = undefined;
  }
  var data = isBindKey ? undefined : getData(func);
  var newData = [func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity];
  if (data) {
    mergeData(newData, data);
  }
  func = newData[0];
  bitmask = newData[1];
  thisArg = newData[2];
  partials = newData[3];
  holders = newData[4];
  arity = newData[9] = newData[9] === undefined ? isBindKey ? 0 : func.length : nativeMax(newData[9] - length, 0);
  if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
    bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
  }
  if (!bitmask || bitmask == WRAP_BIND_FLAG) {
    var result = createBind(func, bitmask, thisArg);
  } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
    result = createCurry(func, bitmask, arity);
  } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
    result = createPartial(func, bitmask, thisArg, partials);
  } else {
    result = createHybrid.apply(undefined, newData);
  }
  var setter = data ? baseSetData : setData;
  return setWrapToString(setter(result, newData), func, bitmask);
}
module.exports = createWrap;

},{"./_baseSetData":512,"./_createBind":536,"./_createCurry":538,"./_createHybrid":539,"./_createPartial":540,"./_getData":551,"./_mergeData":596,"./_setData":612,"./_setWrapToString":615,"./toInteger":674}],543:[function(require,module,exports){
"use strict";

var getNative = require('./_getNative');
var defineProperty = function () {
  try {
    var func = getNative(Object, 'defineProperty');
    func({}, '', {});
    return func;
  } catch (e) {}
}();
module.exports = defineProperty;

},{"./_getNative":556}],544:[function(require,module,exports){
"use strict";

var SetCache = require('./_SetCache'),
  arraySome = require('./_arraySome'),
  cacheHas = require('./_cacheHas');
var COMPARE_PARTIAL_FLAG = 1,
  COMPARE_UNORDERED_FLAG = 2;
function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
    arrLength = array.length,
    othLength = other.length;
  if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
    return false;
  }
  var arrStacked = stack.get(array);
  var othStacked = stack.get(other);
  if (arrStacked && othStacked) {
    return arrStacked == other && othStacked == array;
  }
  var index = -1,
    result = true,
    seen = bitmask & COMPARE_UNORDERED_FLAG ? new SetCache() : undefined;
  stack.set(array, other);
  stack.set(other, array);
  while (++index < arrLength) {
    var arrValue = array[index],
      othValue = other[index];
    if (customizer) {
      var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack);
    }
    if (compared !== undefined) {
      if (compared) {
        continue;
      }
      result = false;
      break;
    }
    if (seen) {
      if (!arraySome(other, function (othValue, othIndex) {
        if (!cacheHas(seen, othIndex) && (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
          return seen.push(othIndex);
        }
      })) {
        result = false;
        break;
      }
    } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
      result = false;
      break;
    }
  }
  stack['delete'](array);
  stack['delete'](other);
  return result;
}
module.exports = equalArrays;

},{"./_SetCache":463,"./_arraySome":475,"./_cacheHas":518}],545:[function(require,module,exports){
"use strict";

var Symbol = require('./_Symbol'),
  Uint8Array = require('./_Uint8Array'),
  eq = require('./eq'),
  equalArrays = require('./_equalArrays'),
  mapToArray = require('./_mapToArray'),
  setToArray = require('./_setToArray');
var COMPARE_PARTIAL_FLAG = 1,
  COMPARE_UNORDERED_FLAG = 2;
var boolTag = '[object Boolean]',
  dateTag = '[object Date]',
  errorTag = '[object Error]',
  mapTag = '[object Map]',
  numberTag = '[object Number]',
  regexpTag = '[object RegExp]',
  setTag = '[object Set]',
  stringTag = '[object String]',
  symbolTag = '[object Symbol]';
var arrayBufferTag = '[object ArrayBuffer]',
  dataViewTag = '[object DataView]';
var symbolProto = Symbol ? Symbol.prototype : undefined,
  symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  switch (tag) {
    case dataViewTag:
      if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
        return false;
      }
      object = object.buffer;
      other = other.buffer;
    case arrayBufferTag:
      if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
        return false;
      }
      return true;
    case boolTag:
    case dateTag:
    case numberTag:
      return eq(+object, +other);
    case errorTag:
      return object.name == other.name && object.message == other.message;
    case regexpTag:
    case stringTag:
      return object == other + '';
    case mapTag:
      var convert = mapToArray;
    case setTag:
      var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
      convert || (convert = setToArray);
      if (object.size != other.size && !isPartial) {
        return false;
      }
      var stacked = stack.get(object);
      if (stacked) {
        return stacked == other;
      }
      bitmask |= COMPARE_UNORDERED_FLAG;
      stack.set(object, other);
      var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
      stack['delete'](object);
      return result;
    case symbolTag:
      if (symbolValueOf) {
        return symbolValueOf.call(object) == symbolValueOf.call(other);
      }
  }
  return false;
}
module.exports = equalByTag;

},{"./_Symbol":465,"./_Uint8Array":466,"./_equalArrays":544,"./_mapToArray":593,"./_setToArray":613,"./eq":634}],546:[function(require,module,exports){
"use strict";

var getAllKeys = require('./_getAllKeys');
var COMPARE_PARTIAL_FLAG = 1;
var objectProto = Object.prototype;
var hasOwnProperty = objectProto.hasOwnProperty;
function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
    objProps = getAllKeys(object),
    objLength = objProps.length,
    othProps = getAllKeys(other),
    othLength = othProps.length;
  if (objLength != othLength && !isPartial) {
    return false;
  }
  var index = objLength;
  while (index--) {
    var key = objProps[index];
    if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
      return false;
    }
  }
  var objStacked = stack.get(object);
  var othStacked = stack.get(other);
  if (objStacked && othStacked) {
    return objStacked == other && othStacked == object;
  }
  var result = true;
  stack.set(object, other);
  stack.set(other, object);
  var skipCtor = isPartial;
  while (++index < objLength) {
    key = objProps[index];
    var objValue = object[key],
      othValue = other[key];
    if (customizer) {
      var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
    }
    if (!(compared === undefined ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {
      result = false;
      break;
    }
    skipCtor || (skipCtor = key == 'constructor');
  }
  if (result && !skipCtor) {
    var objCtor = object.constructor,
      othCtor = other.constructor;
    if (objCtor != othCtor && 'constructor' in object && 'constructor' in other && !(typeof objCtor == 'function' && objCtor instanceof objCtor && typeof othCtor == 'function' && othCtor instanceof othCtor)) {
      result = false;
    }
  }
  stack['delete'](object);
  stack['delete'](other);
  return result;
}
module.exports = equalObjects;

},{"./_getAllKeys":549}],547:[function(require,module,exports){
"use strict";

var flatten = require('./flatten'),
  overRest = require('./_overRest'),
  setToString = require('./_setToString');
function flatRest(func) {
  return setToString(overRest(func, undefined, flatten), func + '');
}
module.exports = flatRest;

},{"./_overRest":604,"./_setToString":614,"./flatten":635}],548:[function(require,module,exports){
(function (global){(function (){
"use strict";

var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
module.exports = freeGlobal;

}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{}],549:[function(require,module,exports){
"use strict";

var baseGetAllKeys = require('./_baseGetAllKeys'),
  getSymbols = require('./_getSymbols'),
  keys = require('./keys');
function getAllKeys(object) {
  return baseGetAllKeys(object, keys, getSymbols);
}
module.exports = getAllKeys;

},{"./_baseGetAllKeys":488,"./_getSymbols":559,"./keys":664}],550:[function(require,module,exports){
"use strict";

var baseGetAllKeys = require('./_baseGetAllKeys'),
  getSymbolsIn = require('./_getSymbolsIn'),
  keysIn = require('./keysIn');
function getAllKeysIn(object) {
  return baseGetAllKeys(object, keysIn, getSymbolsIn);
}
module.exports = getAllKeysIn;

},{"./_baseGetAllKeys":488,"./_getSymbolsIn":560,"./keysIn":665}],551:[function(require,module,exports){
"use strict";

var metaMap = require('./_metaMap'),
  noop = require('./noop');
var getData = !metaMap ? noop : function (func) {
  return metaMap.get(func);
};
module.exports = getData;

},{"./_metaMap":597,"./noop":668}],552:[function(require,module,exports){
"use strict";

var realNames = require('./_realNames');
var objectProto = Object.prototype;
var hasOwnProperty = objectProto.hasOwnProperty;
function getFuncName(func) {
  var result = func.name + '',
    array = realNames[result],
    length = hasOwnProperty.call(realNames, result) ? array.length : 0;
  while (length--) {
    var data = array[length],
      otherFunc = data.func;
    if (otherFunc == null || otherFunc == func) {
      return data.name;
    }
  }
  return result;
}
module.exports = getFuncName;

},{"./_realNames":605}],553:[function(require,module,exports){
"use strict";

function getHolder(func) {
  var object = func;
  return object.placeholder;
}
module.exports = getHolder;

},{}],554:[function(require,module,exports){
"use strict";

var isKeyable = require('./_isKeyable');
function getMapData(map, key) {
  var data = map.__data__;
  return isKeyable(key) ? data[typeof key == 'string' ? 'string' : 'hash'] : data.map;
}
module.exports = getMapData;

},{"./_isKeyable":578}],555:[function(require,module,exports){
"use strict";

var isStrictComparable = require('./_isStrictComparable'),
  keys = require('./keys');
function getMatchData(object) {
  var result = keys(object),
    length = result.length;
  while (length--) {
    var key = result[length],
      value = object[key];
    result[length] = [key, value, isStrictComparable(value)];
  }
  return result;
}
module.exports = getMatchData;

},{"./_isStrictComparable":582,"./keys":664}],556:[function(require,module,exports){
"use strict";

var baseIsNative = require('./_baseIsNative'),
  getValue = require('./_getValue');
function getNative(object, key) {
  var value = getValue(object, key);
  return baseIsNative(value) ? value : undefined;
}
module.exports = getNative;

},{"./_baseIsNative":498,"./_getValue":562}],557:[function(require,module,exports){
"use strict";

var overArg = require('./_overArg');
var getPrototype = overArg(Object.getPrototypeOf, Object);
module.exports = getPrototype;

},{"./_overArg":603}],558:[function(require,module,exports){
"use strict";

var Symbol = require('./_Symbol');
var objectProto = Object.prototype;
var hasOwnProperty = objectProto.hasOwnProperty;
var nativeObjectToString = objectProto.toString;
var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
function getRawTag(value) {
  var isOwn = hasOwnProperty.call(value, symToStringTag),
    tag = value[symToStringTag];
  try {
    value[symToStringTag] = undefined;
    var unmasked = true;
  } catch (e) {}
  var result = nativeObjectToString.call(value);
  if (unmasked) {
    if (isOwn) {
      value[symToStringTag] = tag;
    } else {
      delete value[symToStringTag];
    }
  }
  return result;
}
module.exports = getRawTag;

},{"./_Symbol":465}],559:[function(require,module,exports){
"use strict";

var arrayFilter = require('./_arrayFilter'),
  stubArray = require('./stubArray');
var objectProto = Object.prototype;
var propertyIsEnumerable = objectProto.propertyIsEnumerable;
var nativeGetSymbols = Object.getOwnPropertySymbols;
var getSymbols = !nativeGetSymbols ? stubArray : function (object) {
  if (object == null) {
    return [];
  }
  object = Object(object);
  return arrayFilter(nativeGetSymbols(object), function (symbol) {
    return propertyIsEnumerable.call(object, symbol);
  });
};
module.exports = getSymbols;

},{"./_arrayFilter":470,"./stubArray":671}],560:[function(require,module,exports){
"use strict";

var arrayPush = require('./_arrayPush'),
  getPrototype = require('./_getPrototype'),
  getSymbols = require('./_getSymbols'),
  stubArray = require('./stubArray');
var nativeGetSymbols = Object.getOwnPropertySymbols;
var getSymbolsIn = !nativeGetSymbols ? stubArray : function (object) {
  var result = [];
  while (object) {
    arrayPush(result, getSymbols(object));
    object = getPrototype(object);
  }
  return result;
};
module.exports = getSymbolsIn;

},{"./_arrayPush":474,"./_getPrototype":557,"./_getSymbols":559,"./stubArray":671}],561:[function(require,module,exports){
"use strict";

var DataView = require('./_DataView'),
  Map = require('./_Map'),
  Promise = require('./_Promise'),
  Set = require('./_Set'),
  WeakMap = require('./_WeakMap'),
  baseGetTag = require('./_baseGetTag'),
  toSource = require('./_toSource');
var mapTag = '[object Map]',
  objectTag = '[object Object]',
  promiseTag = '[object Promise]',
  setTag = '[object Set]',
  weakMapTag = '[object WeakMap]';
var dataViewTag = '[object DataView]';
var dataViewCtorString = toSource(DataView),
  mapCtorString = toSource(Map),
  promiseCtorString = toSource(Promise),
  setCtorString = toSource(Set),
  weakMapCtorString = toSource(WeakMap);
var getTag = baseGetTag;
if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map && getTag(new Map()) != mapTag || Promise && getTag(Promise.resolve()) != promiseTag || Set && getTag(new Set()) != setTag || WeakMap && getTag(new WeakMap()) != weakMapTag) {
  getTag = function getTag(value) {
    var result = baseGetTag(value),
      Ctor = result == objectTag ? value.constructor : undefined,
      ctorString = Ctor ? toSource(Ctor) : '';
    if (ctorString) {
      switch (ctorString) {
        case dataViewCtorString:
          return dataViewTag;
        case mapCtorString:
          return mapTag;
        case promiseCtorString:
          return promiseTag;
        case setCtorString:
          return setTag;
        case weakMapCtorString:
          return weakMapTag;
      }
    }
    return result;
  };
}
module.exports = getTag;

},{"./_DataView":454,"./_Map":459,"./_Promise":461,"./_Set":462,"./_WeakMap":467,"./_baseGetTag":489,"./_toSource":625}],562:[function(require,module,exports){
"use strict";

function getValue(object, key) {
  return object == null ? undefined : object[key];
}
module.exports = getValue;

},{}],563:[function(require,module,exports){
"use strict";

var reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
  reSplitDetails = /,? & /;
function getWrapDetails(source) {
  var match = source.match(reWrapDetails);
  return match ? match[1].split(reSplitDetails) : [];
}
module.exports = getWrapDetails;

},{}],564:[function(require,module,exports){
"use strict";

var castPath = require('./_castPath'),
  isArguments = require('./isArguments'),
  isArray = require('./isArray'),
  isIndex = require('./_isIndex'),
  isLength = require('./isLength'),
  toKey = require('./_toKey');
function hasPath(object, path, hasFunc) {
  path = castPath(path, object);
  var index = -1,
    length = path.length,
    result = false;
  while (++index < length) {
    var key = toKey(path[index]);
    if (!(result = object != null && hasFunc(object, key))) {
      break;
    }
    object = object[key];
  }
  if (result || ++index != length) {
    return result;
  }
  length = object == null ? 0 : object.length;
  return !!length && isLength(length) && isIndex(key, length) && (isArray(object) || isArguments(object));
}
module.exports = hasPath;

},{"./_castPath":519,"./_isIndex":575,"./_toKey":624,"./isArguments":647,"./isArray":648,"./isLength":654}],565:[function(require,module,exports){
"use strict";

var nativeCreate = require('./_nativeCreate');
function hashClear() {
  this.__data__ = nativeCreate ? nativeCreate(null) : {};
  this.size = 0;
}
module.exports = hashClear;

},{"./_nativeCreate":598}],566:[function(require,module,exports){
"use strict";

function hashDelete(key) {
  var result = this.has(key) && delete this.__data__[key];
  this.size -= result ? 1 : 0;
  return result;
}
module.exports = hashDelete;

},{}],567:[function(require,module,exports){
"use strict";

var nativeCreate = require('./_nativeCreate');
var HASH_UNDEFINED = '__lodash_hash_undefined__';
var objectProto = Object.prototype;
var hasOwnProperty = objectProto.hasOwnProperty;
function hashGet(key) {
  var data = this.__data__;
  if (nativeCreate) {
    var result = data[key];
    return result === HASH_UNDEFINED ? undefined : result;
  }
  return hasOwnProperty.call(data, key) ? data[key] : undefined;
}
module.exports = hashGet;

},{"./_nativeCreate":598}],568:[function(require,module,exports){
"use strict";

var nativeCreate = require('./_nativeCreate');
var objectProto = Object.prototype;
var hasOwnProperty = objectProto.hasOwnProperty;
function hashHas(key) {
  var data = this.__data__;
  return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
}
module.exports = hashHas;

},{"./_nativeCreate":598}],569:[function(require,module,exports){
"use strict";

var nativeCreate = require('./_nativeCreate');
var HASH_UNDEFINED = '__lodash_hash_undefined__';
function hashSet(key, value) {
  var data = this.__data__;
  this.size += this.has(key) ? 0 : 1;
  data[key] = nativeCreate && value === undefined ? HASH_UNDEFINED : value;
  return this;
}
module.exports = hashSet;

},{"./_nativeCreate":598}],570:[function(require,module,exports){
"use strict";

var objectProto = Object.prototype;
var hasOwnProperty = objectProto.hasOwnProperty;
function initCloneArray(array) {
  var length = array.length,
    result = new array.constructor(length);
  if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
    result.index = array.index;
    result.input = array.input;
  }
  return result;
}
module.exports = initCloneArray;

},{}],571:[function(require,module,exports){
"use strict";

var cloneArrayBuffer = require('./_cloneArrayBuffer'),
  cloneDataView = require('./_cloneDataView'),
  cloneRegExp = require('./_cloneRegExp'),
  cloneSymbol = require('./_cloneSymbol'),
  cloneTypedArray = require('./_cloneTypedArray');
var boolTag = '[object Boolean]',
  dateTag = '[object Date]',
  mapTag = '[object Map]',
  numberTag = '[object Number]',
  regexpTag = '[object RegExp]',
  setTag = '[object Set]',
  stringTag = '[object String]',
  symbolTag = '[object Symbol]';
var arrayBufferTag = '[object ArrayBuffer]',
  dataViewTag = '[object DataView]',
  float32Tag = '[object Float32Array]',
  float64Tag = '[object Float64Array]',
  int8Tag = '[object Int8Array]',
  int16Tag = '[object Int16Array]',
  int32Tag = '[object Int32Array]',
  uint8Tag = '[object Uint8Array]',
  uint8ClampedTag = '[object Uint8ClampedArray]',
  uint16Tag = '[object Uint16Array]',
  uint32Tag = '[object Uint32Array]';
function initCloneByTag(object, tag, isDeep) {
  var Ctor = object.constructor;
  switch (tag) {
    case arrayBufferTag:
      return cloneArrayBuffer(object);
    case boolTag:
    case dateTag:
      return new Ctor(+object);
    case dataViewTag:
      return cloneDataView(object, isDeep);
    case float32Tag:
    case float64Tag:
    case int8Tag:
    case int16Tag:
    case int32Tag:
    case uint8Tag:
    case uint8ClampedTag:
    case uint16Tag:
    case uint32Tag:
      return cloneTypedArray(object, isDeep);
    case mapTag:
      return new Ctor();
    case numberTag:
    case stringTag:
      return new Ctor(object);
    case regexpTag:
      return cloneRegExp(object);
    case setTag:
      return new Ctor();
    case symbolTag:
      return cloneSymbol(object);
  }
}
module.exports = initCloneByTag;

},{"./_cloneArrayBuffer":520,"./_cloneDataView":522,"./_cloneRegExp":523,"./_cloneSymbol":524,"./_cloneTypedArray":525}],572:[function(require,module,exports){
"use strict";

var baseCreate = require('./_baseCreate'),
  getPrototype = require('./_getPrototype'),
  isPrototype = require('./_isPrototype');
function initCloneObject(object) {
  return typeof object.constructor == 'function' && !isPrototype(object) ? baseCreate(getPrototype(object)) : {};
}
module.exports = initCloneObject;

},{"./_baseCreate":483,"./_getPrototype":557,"./_isPrototype":581}],573:[function(require,module,exports){
"use strict";

var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;
function insertWrapDetails(source, details) {
  var length = details.length;
  if (!length) {
    return source;
  }
  var lastIndex = length - 1;
  details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
  details = details.join(length > 2 ? ', ' : ' ');
  return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
}
module.exports = insertWrapDetails;

},{}],574:[function(require,module,exports){
"use strict";

var Symbol = require('./_Symbol'),
  isArguments = require('./isArguments'),
  isArray = require('./isArray');
var spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined;
function isFlattenable(value) {
  return isArray(value) || isArguments(value) || !!(spreadableSymbol && value && value[spreadableSymbol]);
}
module.exports = isFlattenable;

},{"./_Symbol":465,"./isArguments":647,"./isArray":648}],575:[function(require,module,exports){
"use strict";

var MAX_SAFE_INTEGER = 9007199254740991;
var reIsUint = /^(?:0|[1-9]\d*)$/;
function isIndex(value, length) {
  var type = typeof value;
  length = length == null ? MAX_SAFE_INTEGER : length;
  return !!length && (type == 'number' || type != 'symbol' && reIsUint.test(value)) && value > -1 && value % 1 == 0 && value < length;
}
module.exports = isIndex;

},{}],576:[function(require,module,exports){
"use strict";

var eq = require('./eq'),
  isArrayLike = require('./isArrayLike'),
  isIndex = require('./_isIndex'),
  isObject = require('./isObject');
function isIterateeCall(value, index, object) {
  if (!isObject(object)) {
    return false;
  }
  var type = typeof index;
  if (type == 'number' ? isArrayLike(object) && isIndex(index, object.length) : type == 'string' && index in object) {
    return eq(object[index], value);
  }
  return false;
}
module.exports = isIterateeCall;

},{"./_isIndex":575,"./eq":634,"./isArrayLike":649,"./isObject":656}],577:[function(require,module,exports){
"use strict";

var isArray = require('./isArray'),
  isSymbol = require('./isSymbol');
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  reIsPlainProp = /^\w*$/;
function isKey(value, object) {
  if (isArray(value)) {
    return false;
  }
  var type = typeof value;
  if (type == 'number' || type == 'symbol' || type == 'boolean' || value == null || isSymbol(value)) {
    return true;
  }
  return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object);
}
module.exports = isKey;

},{"./isArray":648,"./isSymbol":660}],578:[function(require,module,exports){
"use strict";

function isKeyable(value) {
  var type = typeof value;
  return type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean' ? value !== '__proto__' : value === null;
}
module.exports = isKeyable;

},{}],579:[function(require,module,exports){
"use strict";

var LazyWrapper = require('./_LazyWrapper'),
  getData = require('./_getData'),
  getFuncName = require('./_getFuncName'),
  lodash = require('./wrapperLodash');
function isLaziable(func) {
  var funcName = getFuncName(func),
    other = lodash[funcName];
  if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
    return false;
  }
  if (func === other) {
    return true;
  }
  var data = getData(other);
  return !!data && func === data[0];
}
module.exports = isLaziable;

},{"./_LazyWrapper":456,"./_getData":551,"./_getFuncName":552,"./wrapperLodash":679}],580:[function(require,module,exports){
"use strict";

var coreJsData = require('./_coreJsData');
var maskSrcKey = function () {
  var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  return uid ? 'Symbol(src)_1.' + uid : '';
}();
function isMasked(func) {
  return !!maskSrcKey && maskSrcKey in func;
}
module.exports = isMasked;

},{"./_coreJsData":532}],581:[function(require,module,exports){
"use strict";

var objectProto = Object.prototype;
function isPrototype(value) {
  var Ctor = value && value.constructor,
    proto = typeof Ctor == 'function' && Ctor.prototype || objectProto;
  return value === proto;
}
module.exports = isPrototype;

},{}],582:[function(require,module,exports){
"use strict";

var isObject = require('./isObject');
function isStrictComparable(value) {
  return value === value && !isObject(value);
}
module.exports = isStrictComparable;

},{"./isObject":656}],583:[function(require,module,exports){
"use strict";

function listCacheClear() {
  this.__data__ = [];
  this.size = 0;
}
module.exports = listCacheClear;

},{}],584:[function(require,module,exports){
"use strict";

var assocIndexOf = require('./_assocIndexOf');
var arrayProto = Array.prototype;
var splice = arrayProto.splice;
function listCacheDelete(key) {
  var data = this.__data__,
    index = assocIndexOf(data, key);
  if (index < 0) {
    return false;
  }
  var lastIndex = data.length - 1;
  if (index == lastIndex) {
    data.pop();
  } else {
    splice.call(data, index, 1);
  }
  --this.size;
  return true;
}
module.exports = listCacheDelete;

},{"./_assocIndexOf":478}],585:[function(require,module,exports){
"use strict";

var assocIndexOf = require('./_assocIndexOf');
function listCacheGet(key) {
  var data = this.__data__,
    index = assocIndexOf(data, key);
  return index < 0 ? undefined : data[index][1];
}
module.exports = listCacheGet;

},{"./_assocIndexOf":478}],586:[function(require,module,exports){
"use strict";

var assocIndexOf = require('./_assocIndexOf');
function listCacheHas(key) {
  return assocIndexOf(this.__data__, key) > -1;
}
module.exports = listCacheHas;

},{"./_assocIndexOf":478}],587:[function(require,module,exports){
"use strict";

var assocIndexOf = require('./_assocIndexOf');
function listCacheSet(key, value) {
  var data = this.__data__,
    index = assocIndexOf(data, key);
  if (index < 0) {
    ++this.size;
    data.push([key, value]);
  } else {
    data[index][1] = value;
  }
  return this;
}
module.exports = listCacheSet;

},{"./_assocIndexOf":478}],588:[function(require,module,exports){
"use strict";

var Hash = require('./_Hash'),
  ListCache = require('./_ListCache'),
  Map = require('./_Map');
function mapCacheClear() {
  this.size = 0;
  this.__data__ = {
    'hash': new Hash(),
    'map': new (Map || ListCache)(),
    'string': new Hash()
  };
}
module.exports = mapCacheClear;

},{"./_Hash":455,"./_ListCache":457,"./_Map":459}],589:[function(require,module,exports){
"use strict";

var getMapData = require('./_getMapData');
function mapCacheDelete(key) {
  var result = getMapData(this, key)['delete'](key);
  this.size -= result ? 1 : 0;
  return result;
}
module.exports = mapCacheDelete;

},{"./_getMapData":554}],590:[function(require,module,exports){
"use strict";

var getMapData = require('./_getMapData');
function mapCacheGet(key) {
  return getMapData(this, key).get(key);
}
module.exports = mapCacheGet;

},{"./_getMapData":554}],591:[function(require,module,exports){
"use strict";

var getMapData = require('./_getMapData');
function mapCacheHas(key) {
  return getMapData(this, key).has(key);
}
module.exports = mapCacheHas;

},{"./_getMapData":554}],592:[function(require,module,exports){
"use strict";

var getMapData = require('./_getMapData');
function mapCacheSet(key, value) {
  var data = getMapData(this, key),
    size = data.size;
  data.set(key, value);
  this.size += data.size == size ? 0 : 1;
  return this;
}
module.exports = mapCacheSet;

},{"./_getMapData":554}],593:[function(require,module,exports){
"use strict";

function mapToArray(map) {
  var index = -1,
    result = Array(map.size);
  map.forEach(function (value, key) {
    result[++index] = [key, value];
  });
  return result;
}
module.exports = mapToArray;

},{}],594:[function(require,module,exports){
"use strict";

function matchesStrictComparable(key, srcValue) {
  return function (object) {
    if (object == null) {
      return false;
    }
    return object[key] === srcValue && (srcValue !== undefined || key in Object(object));
  };
}
module.exports = matchesStrictComparable;

},{}],595:[function(require,module,exports){
"use strict";

var memoize = require('./memoize');
var MAX_MEMOIZE_SIZE = 500;
function memoizeCapped(func) {
  var result = memoize(func, function (key) {
    if (cache.size === MAX_MEMOIZE_SIZE) {
      cache.clear();
    }
    return key;
  });
  var cache = result.cache;
  return result;
}
module.exports = memoizeCapped;

},{"./memoize":666}],596:[function(require,module,exports){
"use strict";

var composeArgs = require('./_composeArgs'),
  composeArgsRight = require('./_composeArgsRight'),
  replaceHolders = require('./_replaceHolders');
var PLACEHOLDER = '__lodash_placeholder__';
var WRAP_BIND_FLAG = 1,
  WRAP_BIND_KEY_FLAG = 2,
  WRAP_CURRY_BOUND_FLAG = 4,
  WRAP_CURRY_FLAG = 8,
  WRAP_ARY_FLAG = 128,
  WRAP_REARG_FLAG = 256;
var nativeMin = Math.min;
function mergeData(data, source) {
  var bitmask = data[1],
    srcBitmask = source[1],
    newBitmask = bitmask | srcBitmask,
    isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
  var isCombo = srcBitmask == WRAP_ARY_FLAG && bitmask == WRAP_CURRY_FLAG || srcBitmask == WRAP_ARY_FLAG && bitmask == WRAP_REARG_FLAG && data[7].length <= source[8] || srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG) && source[7].length <= source[8] && bitmask == WRAP_CURRY_FLAG;
  if (!(isCommon || isCombo)) {
    return data;
  }
  if (srcBitmask & WRAP_BIND_FLAG) {
    data[2] = source[2];
    newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
  }
  var value = source[3];
  if (value) {
    var partials = data[3];
    data[3] = partials ? composeArgs(partials, value, source[4]) : value;
    data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
  }
  value = source[5];
  if (value) {
    partials = data[5];
    data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
    data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
  }
  value = source[7];
  if (value) {
    data[7] = value;
  }
  if (srcBitmask & WRAP_ARY_FLAG) {
    data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
  }
  if (data[9] == null) {
    data[9] = source[9];
  }
  data[0] = source[0];
  data[1] = newBitmask;
  return data;
}
module.exports = mergeData;

},{"./_composeArgs":526,"./_composeArgsRight":527,"./_replaceHolders":607}],597:[function(require,module,exports){
"use strict";

var WeakMap = require('./_WeakMap');
var metaMap = WeakMap && new WeakMap();
module.exports = metaMap;

},{"./_WeakMap":467}],598:[function(require,module,exports){
"use strict";

var getNative = require('./_getNative');
var nativeCreate = getNative(Object, 'create');
module.exports = nativeCreate;

},{"./_getNative":556}],599:[function(require,module,exports){
"use strict";

var overArg = require('./_overArg');
var nativeKeys = overArg(Object.keys, Object);
module.exports = nativeKeys;

},{"./_overArg":603}],600:[function(require,module,exports){
"use strict";

function nativeKeysIn(object) {
  var result = [];
  if (object != null) {
    for (var key in Object(object)) {
      result.push(key);
    }
  }
  return result;
}
module.exports = nativeKeysIn;

},{}],601:[function(require,module,exports){
"use strict";

var freeGlobal = require('./_freeGlobal');
var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
var moduleExports = freeModule && freeModule.exports === freeExports;
var freeProcess = moduleExports && freeGlobal.process;
var nodeUtil = function () {
  try {
    var types = freeModule && freeModule.require && freeModule.require('util').types;
    if (types) {
      return types;
    }
    return freeProcess && freeProcess.binding && freeProcess.binding('util');
  } catch (e) {}
}();
module.exports = nodeUtil;

},{"./_freeGlobal":548}],602:[function(require,module,exports){
"use strict";

var objectProto = Object.prototype;
var nativeObjectToString = objectProto.toString;
function objectToString(value) {
  return nativeObjectToString.call(value);
}
module.exports = objectToString;

},{}],603:[function(require,module,exports){
"use strict";

function overArg(func, transform) {
  return function (arg) {
    return func(transform(arg));
  };
}
module.exports = overArg;

},{}],604:[function(require,module,exports){
"use strict";

var apply = require('./_apply');
var nativeMax = Math.max;
function overRest(func, start, transform) {
  start = nativeMax(start === undefined ? func.length - 1 : start, 0);
  return function () {
    var args = arguments,
      index = -1,
      length = nativeMax(args.length - start, 0),
      array = Array(length);
    while (++index < length) {
      array[index] = args[start + index];
    }
    index = -1;
    var otherArgs = Array(start + 1);
    while (++index < start) {
      otherArgs[index] = args[index];
    }
    otherArgs[start] = transform(array);
    return apply(func, this, otherArgs);
  };
}
module.exports = overRest;

},{"./_apply":468}],605:[function(require,module,exports){
"use strict";

var realNames = {};
module.exports = realNames;

},{}],606:[function(require,module,exports){
"use strict";

var copyArray = require('./_copyArray'),
  isIndex = require('./_isIndex');
var nativeMin = Math.min;
function reorder(array, indexes) {
  var arrLength = array.length,
    length = nativeMin(indexes.length, arrLength),
    oldArray = copyArray(array);
  while (length--) {
    var index = indexes[length];
    array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
  }
  return array;
}
module.exports = reorder;

},{"./_copyArray":528,"./_isIndex":575}],607:[function(require,module,exports){
"use strict";

var PLACEHOLDER = '__lodash_placeholder__';
function replaceHolders(array, placeholder) {
  var index = -1,
    length = array.length,
    resIndex = 0,
    result = [];
  while (++index < length) {
    var value = array[index];
    if (value === placeholder || value === PLACEHOLDER) {
      array[index] = PLACEHOLDER;
      result[resIndex++] = index;
    }
  }
  return result;
}
module.exports = replaceHolders;

},{}],608:[function(require,module,exports){
"use strict";

var freeGlobal = require('./_freeGlobal');
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
var root = freeGlobal || freeSelf || Function('return this')();
module.exports = root;

},{"./_freeGlobal":548}],609:[function(require,module,exports){
"use strict";

function safeGet(object, key) {
  if (key === 'constructor' && typeof object[key] === 'function') {
    return;
  }
  if (key == '__proto__') {
    return;
  }
  return object[key];
}
module.exports = safeGet;

},{}],610:[function(require,module,exports){
"use strict";

var HASH_UNDEFINED = '__lodash_hash_undefined__';
function setCacheAdd(value) {
  this.__data__.set(value, HASH_UNDEFINED);
  return this;
}
module.exports = setCacheAdd;

},{}],611:[function(require,module,exports){
"use strict";

function setCacheHas(value) {
  return this.__data__.has(value);
}
module.exports = setCacheHas;

},{}],612:[function(require,module,exports){
"use strict";

var baseSetData = require('./_baseSetData'),
  shortOut = require('./_shortOut');
var setData = shortOut(baseSetData);
module.exports = setData;

},{"./_baseSetData":512,"./_shortOut":616}],613:[function(require,module,exports){
"use strict";

function setToArray(set) {
  var index = -1,
    result = Array(set.size);
  set.forEach(function (value) {
    result[++index] = value;
  });
  return result;
}
module.exports = setToArray;

},{}],614:[function(require,module,exports){
"use strict";

var baseSetToString = require('./_baseSetToString'),
  shortOut = require('./_shortOut');
var setToString = shortOut(baseSetToString);
module.exports = setToString;

},{"./_baseSetToString":513,"./_shortOut":616}],615:[function(require,module,exports){
"use strict";

var getWrapDetails = require('./_getWrapDetails'),
  insertWrapDetails = require('./_insertWrapDetails'),
  setToString = require('./_setToString'),
  updateWrapDetails = require('./_updateWrapDetails');
function setWrapToString(wrapper, reference, bitmask) {
  var source = reference + '';
  return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
}
module.exports = setWrapToString;

},{"./_getWrapDetails":563,"./_insertWrapDetails":573,"./_setToString":614,"./_updateWrapDetails":627}],616:[function(require,module,exports){
"use strict";

var HOT_COUNT = 800,
  HOT_SPAN = 16;
var nativeNow = Date.now;
function shortOut(func) {
  var count = 0,
    lastCalled = 0;
  return function () {
    var stamp = nativeNow(),
      remaining = HOT_SPAN - (stamp - lastCalled);
    lastCalled = stamp;
    if (remaining > 0) {
      if (++count >= HOT_COUNT) {
        return arguments[0];
      }
    } else {
      count = 0;
    }
    return func.apply(undefined, arguments);
  };
}
module.exports = shortOut;

},{}],617:[function(require,module,exports){
"use strict";

var ListCache = require('./_ListCache');
function stackClear() {
  this.__data__ = new ListCache();
  this.size = 0;
}
module.exports = stackClear;

},{"./_ListCache":457}],618:[function(require,module,exports){
"use strict";

function stackDelete(key) {
  var data = this.__data__,
    result = data['delete'](key);
  this.size = data.size;
  return result;
}
module.exports = stackDelete;

},{}],619:[function(require,module,exports){
"use strict";

function stackGet(key) {
  return this.__data__.get(key);
}
module.exports = stackGet;

},{}],620:[function(require,module,exports){
"use strict";

function stackHas(key) {
  return this.__data__.has(key);
}
module.exports = stackHas;

},{}],621:[function(require,module,exports){
"use strict";

var ListCache = require('./_ListCache'),
  Map = require('./_Map'),
  MapCache = require('./_MapCache');
var LARGE_ARRAY_SIZE = 200;
function stackSet(key, value) {
  var data = this.__data__;
  if (data instanceof ListCache) {
    var pairs = data.__data__;
    if (!Map || pairs.length < LARGE_ARRAY_SIZE - 1) {
      pairs.push([key, value]);
      this.size = ++data.size;
      return this;
    }
    data = this.__data__ = new MapCache(pairs);
  }
  data.set(key, value);
  this.size = data.size;
  return this;
}
module.exports = stackSet;

},{"./_ListCache":457,"./_Map":459,"./_MapCache":460}],622:[function(require,module,exports){
"use strict";

function strictIndexOf(array, value, fromIndex) {
  var index = fromIndex - 1,
    length = array.length;
  while (++index < length) {
    if (array[index] === value) {
      return index;
    }
  }
  return -1;
}
module.exports = strictIndexOf;

},{}],623:[function(require,module,exports){
"use strict";

var memoizeCapped = require('./_memoizeCapped');
var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
var reEscapeChar = /\\(\\)?/g;
var stringToPath = memoizeCapped(function (string) {
  var result = [];
  if (string.charCodeAt(0) === 46) {
    result.push('');
  }
  string.replace(rePropName, function (match, number, quote, subString) {
    result.push(quote ? subString.replace(reEscapeChar, '$1') : number || match);
  });
  return result;
});
module.exports = stringToPath;

},{"./_memoizeCapped":595}],624:[function(require,module,exports){
"use strict";

var isSymbol = require('./isSymbol');
var INFINITY = 1 / 0;
function toKey(value) {
  if (typeof value == 'string' || isSymbol(value)) {
    return value;
  }
  var result = value + '';
  return result == '0' && 1 / value == -INFINITY ? '-0' : result;
}
module.exports = toKey;

},{"./isSymbol":660}],625:[function(require,module,exports){
"use strict";

var funcProto = Function.prototype;
var funcToString = funcProto.toString;
function toSource(func) {
  if (func != null) {
    try {
      return funcToString.call(func);
    } catch (e) {}
    try {
      return func + '';
    } catch (e) {}
  }
  return '';
}
module.exports = toSource;

},{}],626:[function(require,module,exports){
"use strict";

var reWhitespace = /\s/;
function trimmedEndIndex(string) {
  var index = string.length;
  while (index-- && reWhitespace.test(string.charAt(index))) {}
  return index;
}
module.exports = trimmedEndIndex;

},{}],627:[function(require,module,exports){
"use strict";

var arrayEach = require('./_arrayEach'),
  arrayIncludes = require('./_arrayIncludes');
var WRAP_BIND_FLAG = 1,
  WRAP_BIND_KEY_FLAG = 2,
  WRAP_CURRY_FLAG = 8,
  WRAP_CURRY_RIGHT_FLAG = 16,
  WRAP_PARTIAL_FLAG = 32,
  WRAP_PARTIAL_RIGHT_FLAG = 64,
  WRAP_ARY_FLAG = 128,
  WRAP_REARG_FLAG = 256,
  WRAP_FLIP_FLAG = 512;
var wrapFlags = [['ary', WRAP_ARY_FLAG], ['bind', WRAP_BIND_FLAG], ['bindKey', WRAP_BIND_KEY_FLAG], ['curry', WRAP_CURRY_FLAG], ['curryRight', WRAP_CURRY_RIGHT_FLAG], ['flip', WRAP_FLIP_FLAG], ['partial', WRAP_PARTIAL_FLAG], ['partialRight', WRAP_PARTIAL_RIGHT_FLAG], ['rearg', WRAP_REARG_FLAG]];
function updateWrapDetails(details, bitmask) {
  arrayEach(wrapFlags, function (pair) {
    var value = '_.' + pair[0];
    if (bitmask & pair[1] && !arrayIncludes(details, value)) {
      details.push(value);
    }
  });
  return details.sort();
}
module.exports = updateWrapDetails;

},{"./_arrayEach":469,"./_arrayIncludes":471}],628:[function(require,module,exports){
"use strict";

var LazyWrapper = require('./_LazyWrapper'),
  LodashWrapper = require('./_LodashWrapper'),
  copyArray = require('./_copyArray');
function wrapperClone(wrapper) {
  if (wrapper instanceof LazyWrapper) {
    return wrapper.clone();
  }
  var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
  result.__actions__ = copyArray(wrapper.__actions__);
  result.__index__ = wrapper.__index__;
  result.__values__ = wrapper.__values__;
  return result;
}
module.exports = wrapperClone;

},{"./_LazyWrapper":456,"./_LodashWrapper":458,"./_copyArray":528}],629:[function(require,module,exports){
"use strict";

var createWrap = require('./_createWrap');
var WRAP_ARY_FLAG = 128;
function ary(func, n, guard) {
  n = guard ? undefined : n;
  n = func && n == null ? func.length : n;
  return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
}
module.exports = ary;

},{"./_createWrap":542}],630:[function(require,module,exports){
"use strict";

var baseClone = require('./_baseClone');
var CLONE_SYMBOLS_FLAG = 4;
function clone(value) {
  return baseClone(value, CLONE_SYMBOLS_FLAG);
}
module.exports = clone;

},{"./_baseClone":482}],631:[function(require,module,exports){
"use strict";

var baseClone = require('./_baseClone');
var CLONE_DEEP_FLAG = 1,
  CLONE_SYMBOLS_FLAG = 4;
function cloneDeep(value) {
  return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
}
module.exports = cloneDeep;

},{"./_baseClone":482}],632:[function(require,module,exports){
"use strict";

function constant(value) {
  return function () {
    return value;
  };
}
module.exports = constant;

},{}],633:[function(require,module,exports){
"use strict";

var createWrap = require('./_createWrap');
var WRAP_CURRY_FLAG = 8;
function curry(func, arity, guard) {
  arity = guard ? undefined : arity;
  var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  result.placeholder = curry.placeholder;
  return result;
}
curry.placeholder = {};
module.exports = curry;

},{"./_createWrap":542}],634:[function(require,module,exports){
"use strict";

function eq(value, other) {
  return value === other || value !== value && other !== other;
}
module.exports = eq;

},{}],635:[function(require,module,exports){
"use strict";

var baseFlatten = require('./_baseFlatten');
function flatten(array) {
  var length = array == null ? 0 : array.length;
  return length ? baseFlatten(array, 1) : [];
}
module.exports = flatten;

},{"./_baseFlatten":485}],636:[function(require,module,exports){
"use strict";

var mapping = require('./_mapping'),
  fallbackHolder = require('./placeholder');
var push = Array.prototype.push;
function baseArity(func, n) {
  return n == 2 ? function (a, b) {
    return func.apply(undefined, arguments);
  } : function (a) {
    return func.apply(undefined, arguments);
  };
}
function baseAry(func, n) {
  return n == 2 ? function (a, b) {
    return func(a, b);
  } : function (a) {
    return func(a);
  };
}
function cloneArray(array) {
  var length = array ? array.length : 0,
    result = Array(length);
  while (length--) {
    result[length] = array[length];
  }
  return result;
}
function createCloner(func) {
  return function (object) {
    return func({}, object);
  };
}
function flatSpread(func, start) {
  return function () {
    var length = arguments.length,
      lastIndex = length - 1,
      args = Array(length);
    while (length--) {
      args[length] = arguments[length];
    }
    var array = args[start],
      otherArgs = args.slice(0, start);
    if (array) {
      push.apply(otherArgs, array);
    }
    if (start != lastIndex) {
      push.apply(otherArgs, args.slice(start + 1));
    }
    return func.apply(this, otherArgs);
  };
}
function wrapImmutable(func, cloner) {
  return function () {
    var length = arguments.length;
    if (!length) {
      return;
    }
    var args = Array(length);
    while (length--) {
      args[length] = arguments[length];
    }
    var result = args[0] = cloner.apply(undefined, args);
    func.apply(undefined, args);
    return result;
  };
}
function baseConvert(util, name, func, options) {
  var isLib = typeof name == 'function',
    isObj = name === Object(name);
  if (isObj) {
    options = func;
    func = name;
    name = undefined;
  }
  if (func == null) {
    throw new TypeError();
  }
  options || (options = {});
  var config = {
    'cap': 'cap' in options ? options.cap : true,
    'curry': 'curry' in options ? options.curry : true,
    'fixed': 'fixed' in options ? options.fixed : true,
    'immutable': 'immutable' in options ? options.immutable : true,
    'rearg': 'rearg' in options ? options.rearg : true
  };
  var defaultHolder = isLib ? func : fallbackHolder,
    forceCurry = 'curry' in options && options.curry,
    forceFixed = 'fixed' in options && options.fixed,
    forceRearg = 'rearg' in options && options.rearg,
    pristine = isLib ? func.runInContext() : undefined;
  var helpers = isLib ? func : {
    'ary': util.ary,
    'assign': util.assign,
    'clone': util.clone,
    'curry': util.curry,
    'forEach': util.forEach,
    'isArray': util.isArray,
    'isError': util.isError,
    'isFunction': util.isFunction,
    'isWeakMap': util.isWeakMap,
    'iteratee': util.iteratee,
    'keys': util.keys,
    'rearg': util.rearg,
    'toInteger': util.toInteger,
    'toPath': util.toPath
  };
  var ary = helpers.ary,
    assign = helpers.assign,
    clone = helpers.clone,
    curry = helpers.curry,
    each = helpers.forEach,
    isArray = helpers.isArray,
    isError = helpers.isError,
    isFunction = helpers.isFunction,
    isWeakMap = helpers.isWeakMap,
    keys = helpers.keys,
    rearg = helpers.rearg,
    toInteger = helpers.toInteger,
    toPath = helpers.toPath;
  var aryMethodKeys = keys(mapping.aryMethod);
  var wrappers = {
    'castArray': function castArray(_castArray) {
      return function () {
        var value = arguments[0];
        return isArray(value) ? _castArray(cloneArray(value)) : _castArray.apply(undefined, arguments);
      };
    },
    'iteratee': function iteratee(_iteratee) {
      return function () {
        var func = arguments[0],
          arity = arguments[1],
          result = _iteratee(func, arity),
          length = result.length;
        if (config.cap && typeof arity == 'number') {
          arity = arity > 2 ? arity - 2 : 1;
          return length && length <= arity ? result : baseAry(result, arity);
        }
        return result;
      };
    },
    'mixin': function mixin(_mixin) {
      return function (source) {
        var func = this;
        if (!isFunction(func)) {
          return _mixin(func, Object(source));
        }
        var pairs = [];
        each(keys(source), function (key) {
          if (isFunction(source[key])) {
            pairs.push([key, func.prototype[key]]);
          }
        });
        _mixin(func, Object(source));
        each(pairs, function (pair) {
          var value = pair[1];
          if (isFunction(value)) {
            func.prototype[pair[0]] = value;
          } else {
            delete func.prototype[pair[0]];
          }
        });
        return func;
      };
    },
    'nthArg': function nthArg(_nthArg) {
      return function (n) {
        var arity = n < 0 ? 1 : toInteger(n) + 1;
        return curry(_nthArg(n), arity);
      };
    },
    'rearg': function rearg(_rearg) {
      return function (func, indexes) {
        var arity = indexes ? indexes.length : 0;
        return curry(_rearg(func, indexes), arity);
      };
    },
    'runInContext': function runInContext(_runInContext) {
      return function (context) {
        return baseConvert(util, _runInContext(context), options);
      };
    }
  };
  function castCap(name, func) {
    if (config.cap) {
      var indexes = mapping.iterateeRearg[name];
      if (indexes) {
        return iterateeRearg(func, indexes);
      }
      var n = !isLib && mapping.iterateeAry[name];
      if (n) {
        return iterateeAry(func, n);
      }
    }
    return func;
  }
  function castCurry(name, func, n) {
    return forceCurry || config.curry && n > 1 ? curry(func, n) : func;
  }
  function castFixed(name, func, n) {
    if (config.fixed && (forceFixed || !mapping.skipFixed[name])) {
      var data = mapping.methodSpread[name],
        start = data && data.start;
      return start === undefined ? ary(func, n) : flatSpread(func, start);
    }
    return func;
  }
  function castRearg(name, func, n) {
    return config.rearg && n > 1 && (forceRearg || !mapping.skipRearg[name]) ? rearg(func, mapping.methodRearg[name] || mapping.aryRearg[n]) : func;
  }
  function cloneByPath(object, path) {
    path = toPath(path);
    var index = -1,
      length = path.length,
      lastIndex = length - 1,
      result = clone(Object(object)),
      nested = result;
    while (nested != null && ++index < length) {
      var key = path[index],
        value = nested[key];
      if (value != null && !(isFunction(value) || isError(value) || isWeakMap(value))) {
        nested[key] = clone(index == lastIndex ? value : Object(value));
      }
      nested = nested[key];
    }
    return result;
  }
  function convertLib(options) {
    return _.runInContext.convert(options)(undefined);
  }
  function createConverter(name, func) {
    var realName = mapping.aliasToReal[name] || name,
      methodName = mapping.remap[realName] || realName,
      oldOptions = options;
    return function (options) {
      var newUtil = isLib ? pristine : helpers,
        newFunc = isLib ? pristine[methodName] : func,
        newOptions = assign(assign({}, oldOptions), options);
      return baseConvert(newUtil, realName, newFunc, newOptions);
    };
  }
  function iterateeAry(func, n) {
    return overArg(func, function (func) {
      return typeof func == 'function' ? baseAry(func, n) : func;
    });
  }
  function iterateeRearg(func, indexes) {
    return overArg(func, function (func) {
      var n = indexes.length;
      return baseArity(rearg(baseAry(func, n), indexes), n);
    });
  }
  function overArg(func, transform) {
    return function () {
      var length = arguments.length;
      if (!length) {
        return func();
      }
      var args = Array(length);
      while (length--) {
        args[length] = arguments[length];
      }
      var index = config.rearg ? 0 : length - 1;
      args[index] = transform(args[index]);
      return func.apply(undefined, args);
    };
  }
  function wrap(name, func, placeholder) {
    var result,
      realName = mapping.aliasToReal[name] || name,
      wrapped = func,
      wrapper = wrappers[realName];
    if (wrapper) {
      wrapped = wrapper(func);
    } else if (config.immutable) {
      if (mapping.mutate.array[realName]) {
        wrapped = wrapImmutable(func, cloneArray);
      } else if (mapping.mutate.object[realName]) {
        wrapped = wrapImmutable(func, createCloner(func));
      } else if (mapping.mutate.set[realName]) {
        wrapped = wrapImmutable(func, cloneByPath);
      }
    }
    each(aryMethodKeys, function (aryKey) {
      each(mapping.aryMethod[aryKey], function (otherName) {
        if (realName == otherName) {
          var data = mapping.methodSpread[realName],
            afterRearg = data && data.afterRearg;
          result = afterRearg ? castFixed(realName, castRearg(realName, wrapped, aryKey), aryKey) : castRearg(realName, castFixed(realName, wrapped, aryKey), aryKey);
          result = castCap(realName, result);
          result = castCurry(realName, result, aryKey);
          return false;
        }
      });
      return !result;
    });
    result || (result = wrapped);
    if (result == func) {
      result = forceCurry ? curry(result, 1) : function () {
        return func.apply(this, arguments);
      };
    }
    result.convert = createConverter(realName, func);
    result.placeholder = func.placeholder = placeholder;
    return result;
  }
  if (!isObj) {
    return wrap(name, func, defaultHolder);
  }
  var _ = func;
  var pairs = [];
  each(aryMethodKeys, function (aryKey) {
    each(mapping.aryMethod[aryKey], function (key) {
      var func = _[mapping.remap[key] || key];
      if (func) {
        pairs.push([key, wrap(key, func, _)]);
      }
    });
  });
  each(keys(_), function (key) {
    var func = _[key];
    if (typeof func == 'function') {
      var length = pairs.length;
      while (length--) {
        if (pairs[length][0] == key) {
          return;
        }
      }
      func.convert = createConverter(key, func);
      pairs.push([key, func]);
    }
  });
  each(pairs, function (pair) {
    _[pair[0]] = pair[1];
  });
  _.convert = convertLib;
  _.placeholder = _;
  each(keys(_), function (key) {
    each(mapping.realToAlias[key] || [], function (alias) {
      _[alias] = _[key];
    });
  });
  return _;
}
module.exports = baseConvert;

},{"./_mapping":638,"./placeholder":643}],637:[function(require,module,exports){
"use strict";

module.exports = {
  'cap': false,
  'curry': false,
  'fixed': false,
  'immutable': false,
  'rearg': false
};

},{}],638:[function(require,module,exports){
"use strict";

exports.aliasToReal = {
  'each': 'forEach',
  'eachRight': 'forEachRight',
  'entries': 'toPairs',
  'entriesIn': 'toPairsIn',
  'extend': 'assignIn',
  'extendAll': 'assignInAll',
  'extendAllWith': 'assignInAllWith',
  'extendWith': 'assignInWith',
  'first': 'head',
  'conforms': 'conformsTo',
  'matches': 'isMatch',
  'property': 'get',
  '__': 'placeholder',
  'F': 'stubFalse',
  'T': 'stubTrue',
  'all': 'every',
  'allPass': 'overEvery',
  'always': 'constant',
  'any': 'some',
  'anyPass': 'overSome',
  'apply': 'spread',
  'assoc': 'set',
  'assocPath': 'set',
  'complement': 'negate',
  'compose': 'flowRight',
  'contains': 'includes',
  'dissoc': 'unset',
  'dissocPath': 'unset',
  'dropLast': 'dropRight',
  'dropLastWhile': 'dropRightWhile',
  'equals': 'isEqual',
  'identical': 'eq',
  'indexBy': 'keyBy',
  'init': 'initial',
  'invertObj': 'invert',
  'juxt': 'over',
  'omitAll': 'omit',
  'nAry': 'ary',
  'path': 'get',
  'pathEq': 'matchesProperty',
  'pathOr': 'getOr',
  'paths': 'at',
  'pickAll': 'pick',
  'pipe': 'flow',
  'pluck': 'map',
  'prop': 'get',
  'propEq': 'matchesProperty',
  'propOr': 'getOr',
  'props': 'at',
  'symmetricDifference': 'xor',
  'symmetricDifferenceBy': 'xorBy',
  'symmetricDifferenceWith': 'xorWith',
  'takeLast': 'takeRight',
  'takeLastWhile': 'takeRightWhile',
  'unapply': 'rest',
  'unnest': 'flatten',
  'useWith': 'overArgs',
  'where': 'conformsTo',
  'whereEq': 'isMatch',
  'zipObj': 'zipObject'
};
exports.aryMethod = {
  '1': ['assignAll', 'assignInAll', 'attempt', 'castArray', 'ceil', 'create', 'curry', 'curryRight', 'defaultsAll', 'defaultsDeepAll', 'floor', 'flow', 'flowRight', 'fromPairs', 'invert', 'iteratee', 'memoize', 'method', 'mergeAll', 'methodOf', 'mixin', 'nthArg', 'over', 'overEvery', 'overSome', 'rest', 'reverse', 'round', 'runInContext', 'spread', 'template', 'trim', 'trimEnd', 'trimStart', 'uniqueId', 'words', 'zipAll'],
  '2': ['add', 'after', 'ary', 'assign', 'assignAllWith', 'assignIn', 'assignInAllWith', 'at', 'before', 'bind', 'bindAll', 'bindKey', 'chunk', 'cloneDeepWith', 'cloneWith', 'concat', 'conformsTo', 'countBy', 'curryN', 'curryRightN', 'debounce', 'defaults', 'defaultsDeep', 'defaultTo', 'delay', 'difference', 'divide', 'drop', 'dropRight', 'dropRightWhile', 'dropWhile', 'endsWith', 'eq', 'every', 'filter', 'find', 'findIndex', 'findKey', 'findLast', 'findLastIndex', 'findLastKey', 'flatMap', 'flatMapDeep', 'flattenDepth', 'forEach', 'forEachRight', 'forIn', 'forInRight', 'forOwn', 'forOwnRight', 'get', 'groupBy', 'gt', 'gte', 'has', 'hasIn', 'includes', 'indexOf', 'intersection', 'invertBy', 'invoke', 'invokeMap', 'isEqual', 'isMatch', 'join', 'keyBy', 'lastIndexOf', 'lt', 'lte', 'map', 'mapKeys', 'mapValues', 'matchesProperty', 'maxBy', 'meanBy', 'merge', 'mergeAllWith', 'minBy', 'multiply', 'nth', 'omit', 'omitBy', 'overArgs', 'pad', 'padEnd', 'padStart', 'parseInt', 'partial', 'partialRight', 'partition', 'pick', 'pickBy', 'propertyOf', 'pull', 'pullAll', 'pullAt', 'random', 'range', 'rangeRight', 'rearg', 'reject', 'remove', 'repeat', 'restFrom', 'result', 'sampleSize', 'some', 'sortBy', 'sortedIndex', 'sortedIndexOf', 'sortedLastIndex', 'sortedLastIndexOf', 'sortedUniqBy', 'split', 'spreadFrom', 'startsWith', 'subtract', 'sumBy', 'take', 'takeRight', 'takeRightWhile', 'takeWhile', 'tap', 'throttle', 'thru', 'times', 'trimChars', 'trimCharsEnd', 'trimCharsStart', 'truncate', 'union', 'uniqBy', 'uniqWith', 'unset', 'unzipWith', 'without', 'wrap', 'xor', 'zip', 'zipObject', 'zipObjectDeep'],
  '3': ['assignInWith', 'assignWith', 'clamp', 'differenceBy', 'differenceWith', 'findFrom', 'findIndexFrom', 'findLastFrom', 'findLastIndexFrom', 'getOr', 'includesFrom', 'indexOfFrom', 'inRange', 'intersectionBy', 'intersectionWith', 'invokeArgs', 'invokeArgsMap', 'isEqualWith', 'isMatchWith', 'flatMapDepth', 'lastIndexOfFrom', 'mergeWith', 'orderBy', 'padChars', 'padCharsEnd', 'padCharsStart', 'pullAllBy', 'pullAllWith', 'rangeStep', 'rangeStepRight', 'reduce', 'reduceRight', 'replace', 'set', 'slice', 'sortedIndexBy', 'sortedLastIndexBy', 'transform', 'unionBy', 'unionWith', 'update', 'xorBy', 'xorWith', 'zipWith'],
  '4': ['fill', 'setWith', 'updateWith']
};
exports.aryRearg = {
  '2': [1, 0],
  '3': [2, 0, 1],
  '4': [3, 2, 0, 1]
};
exports.iterateeAry = {
  'dropRightWhile': 1,
  'dropWhile': 1,
  'every': 1,
  'filter': 1,
  'find': 1,
  'findFrom': 1,
  'findIndex': 1,
  'findIndexFrom': 1,
  'findKey': 1,
  'findLast': 1,
  'findLastFrom': 1,
  'findLastIndex': 1,
  'findLastIndexFrom': 1,
  'findLastKey': 1,
  'flatMap': 1,
  'flatMapDeep': 1,
  'flatMapDepth': 1,
  'forEach': 1,
  'forEachRight': 1,
  'forIn': 1,
  'forInRight': 1,
  'forOwn': 1,
  'forOwnRight': 1,
  'map': 1,
  'mapKeys': 1,
  'mapValues': 1,
  'partition': 1,
  'reduce': 2,
  'reduceRight': 2,
  'reject': 1,
  'remove': 1,
  'some': 1,
  'takeRightWhile': 1,
  'takeWhile': 1,
  'times': 1,
  'transform': 2
};
exports.iterateeRearg = {
  'mapKeys': [1],
  'reduceRight': [1, 0]
};
exports.methodRearg = {
  'assignInAllWith': [1, 0],
  'assignInWith': [1, 2, 0],
  'assignAllWith': [1, 0],
  'assignWith': [1, 2, 0],
  'differenceBy': [1, 2, 0],
  'differenceWith': [1, 2, 0],
  'getOr': [2, 1, 0],
  'intersectionBy': [1, 2, 0],
  'intersectionWith': [1, 2, 0],
  'isEqualWith': [1, 2, 0],
  'isMatchWith': [2, 1, 0],
  'mergeAllWith': [1, 0],
  'mergeWith': [1, 2, 0],
  'padChars': [2, 1, 0],
  'padCharsEnd': [2, 1, 0],
  'padCharsStart': [2, 1, 0],
  'pullAllBy': [2, 1, 0],
  'pullAllWith': [2, 1, 0],
  'rangeStep': [1, 2, 0],
  'rangeStepRight': [1, 2, 0],
  'setWith': [3, 1, 2, 0],
  'sortedIndexBy': [2, 1, 0],
  'sortedLastIndexBy': [2, 1, 0],
  'unionBy': [1, 2, 0],
  'unionWith': [1, 2, 0],
  'updateWith': [3, 1, 2, 0],
  'xorBy': [1, 2, 0],
  'xorWith': [1, 2, 0],
  'zipWith': [1, 2, 0]
};
exports.methodSpread = {
  'assignAll': {
    'start': 0
  },
  'assignAllWith': {
    'start': 0
  },
  'assignInAll': {
    'start': 0
  },
  'assignInAllWith': {
    'start': 0
  },
  'defaultsAll': {
    'start': 0
  },
  'defaultsDeepAll': {
    'start': 0
  },
  'invokeArgs': {
    'start': 2
  },
  'invokeArgsMap': {
    'start': 2
  },
  'mergeAll': {
    'start': 0
  },
  'mergeAllWith': {
    'start': 0
  },
  'partial': {
    'start': 1
  },
  'partialRight': {
    'start': 1
  },
  'without': {
    'start': 1
  },
  'zipAll': {
    'start': 0
  }
};
exports.mutate = {
  'array': {
    'fill': true,
    'pull': true,
    'pullAll': true,
    'pullAllBy': true,
    'pullAllWith': true,
    'pullAt': true,
    'remove': true,
    'reverse': true
  },
  'object': {
    'assign': true,
    'assignAll': true,
    'assignAllWith': true,
    'assignIn': true,
    'assignInAll': true,
    'assignInAllWith': true,
    'assignInWith': true,
    'assignWith': true,
    'defaults': true,
    'defaultsAll': true,
    'defaultsDeep': true,
    'defaultsDeepAll': true,
    'merge': true,
    'mergeAll': true,
    'mergeAllWith': true,
    'mergeWith': true
  },
  'set': {
    'set': true,
    'setWith': true,
    'unset': true,
    'update': true,
    'updateWith': true
  }
};
exports.realToAlias = function () {
  var hasOwnProperty = Object.prototype.hasOwnProperty,
    object = exports.aliasToReal,
    result = {};
  for (var key in object) {
    var value = object[key];
    if (hasOwnProperty.call(result, value)) {
      result[value].push(key);
    } else {
      result[value] = [key];
    }
  }
  return result;
}();
exports.remap = {
  'assignAll': 'assign',
  'assignAllWith': 'assignWith',
  'assignInAll': 'assignIn',
  'assignInAllWith': 'assignInWith',
  'curryN': 'curry',
  'curryRightN': 'curryRight',
  'defaultsAll': 'defaults',
  'defaultsDeepAll': 'defaultsDeep',
  'findFrom': 'find',
  'findIndexFrom': 'findIndex',
  'findLastFrom': 'findLast',
  'findLastIndexFrom': 'findLastIndex',
  'getOr': 'get',
  'includesFrom': 'includes',
  'indexOfFrom': 'indexOf',
  'invokeArgs': 'invoke',
  'invokeArgsMap': 'invokeMap',
  'lastIndexOfFrom': 'lastIndexOf',
  'mergeAll': 'merge',
  'mergeAllWith': 'mergeWith',
  'padChars': 'pad',
  'padCharsEnd': 'padEnd',
  'padCharsStart': 'padStart',
  'propertyOf': 'get',
  'rangeStep': 'range',
  'rangeStepRight': 'rangeRight',
  'restFrom': 'rest',
  'spreadFrom': 'spread',
  'trimChars': 'trim',
  'trimCharsEnd': 'trimEnd',
  'trimCharsStart': 'trimStart',
  'zipAll': 'zip'
};
exports.skipFixed = {
  'castArray': true,
  'flow': true,
  'flowRight': true,
  'iteratee': true,
  'mixin': true,
  'rearg': true,
  'runInContext': true
};
exports.skipRearg = {
  'add': true,
  'assign': true,
  'assignIn': true,
  'bind': true,
  'bindKey': true,
  'concat': true,
  'difference': true,
  'divide': true,
  'eq': true,
  'gt': true,
  'gte': true,
  'isEqual': true,
  'lt': true,
  'lte': true,
  'matchesProperty': true,
  'merge': true,
  'multiply': true,
  'overArgs': true,
  'partial': true,
  'partialRight': true,
  'propertyOf': true,
  'random': true,
  'range': true,
  'rangeRight': true,
  'subtract': true,
  'zip': true,
  'zipObject': true,
  'zipObjectDeep': true
};

},{}],639:[function(require,module,exports){
"use strict";

module.exports = {
  'ary': require('../ary'),
  'assign': require('../_baseAssign'),
  'clone': require('../clone'),
  'curry': require('../curry'),
  'forEach': require('../_arrayEach'),
  'isArray': require('../isArray'),
  'isError': require('../isError'),
  'isFunction': require('../isFunction'),
  'isWeakMap': require('../isWeakMap'),
  'iteratee': require('../iteratee'),
  'keys': require('../_baseKeys'),
  'rearg': require('../rearg'),
  'toInteger': require('../toInteger'),
  'toPath': require('../toPath')
};

},{"../_arrayEach":469,"../_baseAssign":479,"../_baseKeys":502,"../ary":629,"../clone":630,"../curry":633,"../isArray":648,"../isError":652,"../isFunction":653,"../isWeakMap":662,"../iteratee":663,"../rearg":670,"../toInteger":674,"../toPath":676}],640:[function(require,module,exports){
"use strict";

var convert = require('./convert'),
  func = convert('cloneDeep', require('../cloneDeep'), require('./_falseOptions'));
func.placeholder = require('./placeholder');
module.exports = func;

},{"../cloneDeep":631,"./_falseOptions":637,"./convert":641,"./placeholder":643}],641:[function(require,module,exports){
"use strict";

var baseConvert = require('./_baseConvert'),
  util = require('./_util');
function convert(name, func, options) {
  return baseConvert(util, name, func, options);
}
module.exports = convert;

},{"./_baseConvert":636,"./_util":639}],642:[function(require,module,exports){
"use strict";

var convert = require('./convert'),
  func = convert('merge', require('../merge'));
func.placeholder = require('./placeholder');
module.exports = func;

},{"../merge":667,"./convert":641,"./placeholder":643}],643:[function(require,module,exports){
"use strict";

module.exports = {};

},{}],644:[function(require,module,exports){
"use strict";

var baseGet = require('./_baseGet');
function get(object, path, defaultValue) {
  var result = object == null ? undefined : baseGet(object, path);
  return result === undefined ? defaultValue : result;
}
module.exports = get;

},{"./_baseGet":487}],645:[function(require,module,exports){
"use strict";

var baseHasIn = require('./_baseHasIn'),
  hasPath = require('./_hasPath');
function hasIn(object, path) {
  return object != null && hasPath(object, path, baseHasIn);
}
module.exports = hasIn;

},{"./_baseHasIn":490,"./_hasPath":564}],646:[function(require,module,exports){
"use strict";

function identity(value) {
  return value;
}
module.exports = identity;

},{}],647:[function(require,module,exports){
"use strict";

var baseIsArguments = require('./_baseIsArguments'),
  isObjectLike = require('./isObjectLike');
var objectProto = Object.prototype;
var hasOwnProperty = objectProto.hasOwnProperty;
var propertyIsEnumerable = objectProto.propertyIsEnumerable;
var isArguments = baseIsArguments(function () {
  return arguments;
}()) ? baseIsArguments : function (value) {
  return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee');
};
module.exports = isArguments;

},{"./_baseIsArguments":492,"./isObjectLike":657}],648:[function(require,module,exports){
"use strict";

var isArray = Array.isArray;
module.exports = isArray;

},{}],649:[function(require,module,exports){
"use strict";

var isFunction = require('./isFunction'),
  isLength = require('./isLength');
function isArrayLike(value) {
  return value != null && isLength(value.length) && !isFunction(value);
}
module.exports = isArrayLike;

},{"./isFunction":653,"./isLength":654}],650:[function(require,module,exports){
"use strict";

var isArrayLike = require('./isArrayLike'),
  isObjectLike = require('./isObjectLike');
function isArrayLikeObject(value) {
  return isObjectLike(value) && isArrayLike(value);
}
module.exports = isArrayLikeObject;

},{"./isArrayLike":649,"./isObjectLike":657}],651:[function(require,module,exports){
"use strict";

var root = require('./_root'),
  stubFalse = require('./stubFalse');
var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
var moduleExports = freeModule && freeModule.exports === freeExports;
var Buffer = moduleExports ? root.Buffer : undefined;
var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
var isBuffer = nativeIsBuffer || stubFalse;
module.exports = isBuffer;

},{"./_root":608,"./stubFalse":672}],652:[function(require,module,exports){
"use strict";

var baseGetTag = require('./_baseGetTag'),
  isObjectLike = require('./isObjectLike'),
  isPlainObject = require('./isPlainObject');
var domExcTag = '[object DOMException]',
  errorTag = '[object Error]';
function isError(value) {
  if (!isObjectLike(value)) {
    return false;
  }
  var tag = baseGetTag(value);
  return tag == errorTag || tag == domExcTag || typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value);
}
module.exports = isError;

},{"./_baseGetTag":489,"./isObjectLike":657,"./isPlainObject":658}],653:[function(require,module,exports){
"use strict";

var baseGetTag = require('./_baseGetTag'),
  isObject = require('./isObject');
var asyncTag = '[object AsyncFunction]',
  funcTag = '[object Function]',
  genTag = '[object GeneratorFunction]',
  proxyTag = '[object Proxy]';
function isFunction(value) {
  if (!isObject(value)) {
    return false;
  }
  var tag = baseGetTag(value);
  return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
}
module.exports = isFunction;

},{"./_baseGetTag":489,"./isObject":656}],654:[function(require,module,exports){
"use strict";

var MAX_SAFE_INTEGER = 9007199254740991;
function isLength(value) {
  return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
}
module.exports = isLength;

},{}],655:[function(require,module,exports){
"use strict";

var baseIsMap = require('./_baseIsMap'),
  baseUnary = require('./_baseUnary'),
  nodeUtil = require('./_nodeUtil');
var nodeIsMap = nodeUtil && nodeUtil.isMap;
var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
module.exports = isMap;

},{"./_baseIsMap":495,"./_baseUnary":517,"./_nodeUtil":601}],656:[function(require,module,exports){
"use strict";

function isObject(value) {
  var type = typeof value;
  return value != null && (type == 'object' || type == 'function');
}
module.exports = isObject;

},{}],657:[function(require,module,exports){
"use strict";

function isObjectLike(value) {
  return value != null && typeof value == 'object';
}
module.exports = isObjectLike;

},{}],658:[function(require,module,exports){
"use strict";

var baseGetTag = require('./_baseGetTag'),
  getPrototype = require('./_getPrototype'),
  isObjectLike = require('./isObjectLike');
var objectTag = '[object Object]';
var funcProto = Function.prototype,
  objectProto = Object.prototype;
var funcToString = funcProto.toString;
var hasOwnProperty = objectProto.hasOwnProperty;
var objectCtorString = funcToString.call(Object);
function isPlainObject(value) {
  if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
    return false;
  }
  var proto = getPrototype(value);
  if (proto === null) {
    return true;
  }
  var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
  return typeof Ctor == 'function' && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString;
}
module.exports = isPlainObject;

},{"./_baseGetTag":489,"./_getPrototype":557,"./isObjectLike":657}],659:[function(require,module,exports){
"use strict";

var baseIsSet = require('./_baseIsSet'),
  baseUnary = require('./_baseUnary'),
  nodeUtil = require('./_nodeUtil');
var nodeIsSet = nodeUtil && nodeUtil.isSet;
var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
module.exports = isSet;

},{"./_baseIsSet":499,"./_baseUnary":517,"./_nodeUtil":601}],660:[function(require,module,exports){
"use strict";

var baseGetTag = require('./_baseGetTag'),
  isObjectLike = require('./isObjectLike');
var symbolTag = '[object Symbol]';
function isSymbol(value) {
  return typeof value == 'symbol' || isObjectLike(value) && baseGetTag(value) == symbolTag;
}
module.exports = isSymbol;

},{"./_baseGetTag":489,"./isObjectLike":657}],661:[function(require,module,exports){
"use strict";

var baseIsTypedArray = require('./_baseIsTypedArray'),
  baseUnary = require('./_baseUnary'),
  nodeUtil = require('./_nodeUtil');
var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
module.exports = isTypedArray;

},{"./_baseIsTypedArray":500,"./_baseUnary":517,"./_nodeUtil":601}],662:[function(require,module,exports){
"use strict";

var getTag = require('./_getTag'),
  isObjectLike = require('./isObjectLike');
var weakMapTag = '[object WeakMap]';
function isWeakMap(value) {
  return isObjectLike(value) && getTag(value) == weakMapTag;
}
module.exports = isWeakMap;

},{"./_getTag":561,"./isObjectLike":657}],663:[function(require,module,exports){
"use strict";

var baseClone = require('./_baseClone'),
  baseIteratee = require('./_baseIteratee');
var CLONE_DEEP_FLAG = 1;
function iteratee(func) {
  return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
}
module.exports = iteratee;

},{"./_baseClone":482,"./_baseIteratee":501}],664:[function(require,module,exports){
"use strict";

var arrayLikeKeys = require('./_arrayLikeKeys'),
  baseKeys = require('./_baseKeys'),
  isArrayLike = require('./isArrayLike');
function keys(object) {
  return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
}
module.exports = keys;

},{"./_arrayLikeKeys":472,"./_baseKeys":502,"./isArrayLike":649}],665:[function(require,module,exports){
"use strict";

var arrayLikeKeys = require('./_arrayLikeKeys'),
  baseKeysIn = require('./_baseKeysIn'),
  isArrayLike = require('./isArrayLike');
function keysIn(object) {
  return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
}
module.exports = keysIn;

},{"./_arrayLikeKeys":472,"./_baseKeysIn":503,"./isArrayLike":649}],666:[function(require,module,exports){
"use strict";

var MapCache = require('./_MapCache');
var FUNC_ERROR_TEXT = 'Expected a function';
function memoize(func, resolver) {
  if (typeof func != 'function' || resolver != null && typeof resolver != 'function') {
    throw new TypeError(FUNC_ERROR_TEXT);
  }
  var _memoized = function memoized() {
    var args = arguments,
      key = resolver ? resolver.apply(this, args) : args[0],
      cache = _memoized.cache;
    if (cache.has(key)) {
      return cache.get(key);
    }
    var result = func.apply(this, args);
    _memoized.cache = cache.set(key, result) || cache;
    return result;
  };
  _memoized.cache = new (memoize.Cache || MapCache)();
  return _memoized;
}
memoize.Cache = MapCache;
module.exports = memoize;

},{"./_MapCache":460}],667:[function(require,module,exports){
"use strict";

var baseMerge = require('./_baseMerge'),
  createAssigner = require('./_createAssigner');
var merge = createAssigner(function (object, source, srcIndex) {
  baseMerge(object, source, srcIndex);
});
module.exports = merge;

},{"./_baseMerge":507,"./_createAssigner":534}],668:[function(require,module,exports){
"use strict";

function noop() {}
module.exports = noop;

},{}],669:[function(require,module,exports){
"use strict";

var baseProperty = require('./_baseProperty'),
  basePropertyDeep = require('./_basePropertyDeep'),
  isKey = require('./_isKey'),
  toKey = require('./_toKey');
function property(path) {
  return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
}
module.exports = property;

},{"./_baseProperty":509,"./_basePropertyDeep":510,"./_isKey":577,"./_toKey":624}],670:[function(require,module,exports){
"use strict";

var createWrap = require('./_createWrap'),
  flatRest = require('./_flatRest');
var WRAP_REARG_FLAG = 256;
var rearg = flatRest(function (func, indexes) {
  return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
});
module.exports = rearg;

},{"./_createWrap":542,"./_flatRest":547}],671:[function(require,module,exports){
"use strict";

function stubArray() {
  return [];
}
module.exports = stubArray;

},{}],672:[function(require,module,exports){
"use strict";

function stubFalse() {
  return false;
}
module.exports = stubFalse;

},{}],673:[function(require,module,exports){
"use strict";

var toNumber = require('./toNumber');
var INFINITY = 1 / 0,
  MAX_INTEGER = 1.7976931348623157e+308;
function toFinite(value) {
  if (!value) {
    return value === 0 ? value : 0;
  }
  value = toNumber(value);
  if (value === INFINITY || value === -INFINITY) {
    var sign = value < 0 ? -1 : 1;
    return sign * MAX_INTEGER;
  }
  return value === value ? value : 0;
}
module.exports = toFinite;

},{"./toNumber":675}],674:[function(require,module,exports){
"use strict";

var toFinite = require('./toFinite');
function toInteger(value) {
  var result = toFinite(value),
    remainder = result % 1;
  return result === result ? remainder ? result - remainder : result : 0;
}
module.exports = toInteger;

},{"./toFinite":673}],675:[function(require,module,exports){
"use strict";

var baseTrim = require('./_baseTrim'),
  isObject = require('./isObject'),
  isSymbol = require('./isSymbol');
var NAN = 0 / 0;
var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
var reIsBinary = /^0b[01]+$/i;
var reIsOctal = /^0o[0-7]+$/i;
var freeParseInt = parseInt;
function toNumber(value) {
  if (typeof value == 'number') {
    return value;
  }
  if (isSymbol(value)) {
    return NAN;
  }
  if (isObject(value)) {
    var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
    value = isObject(other) ? other + '' : other;
  }
  if (typeof value != 'string') {
    return value === 0 ? value : +value;
  }
  value = baseTrim(value);
  var isBinary = reIsBinary.test(value);
  return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
}
module.exports = toNumber;

},{"./_baseTrim":516,"./isObject":656,"./isSymbol":660}],676:[function(require,module,exports){
"use strict";

var arrayMap = require('./_arrayMap'),
  copyArray = require('./_copyArray'),
  isArray = require('./isArray'),
  isSymbol = require('./isSymbol'),
  stringToPath = require('./_stringToPath'),
  toKey = require('./_toKey'),
  toString = require('./toString');
function toPath(value) {
  if (isArray(value)) {
    return arrayMap(value, toKey);
  }
  return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
}
module.exports = toPath;

},{"./_arrayMap":473,"./_copyArray":528,"./_stringToPath":623,"./_toKey":624,"./isArray":648,"./isSymbol":660,"./toString":678}],677:[function(require,module,exports){
"use strict";

var copyObject = require('./_copyObject'),
  keysIn = require('./keysIn');
function toPlainObject(value) {
  return copyObject(value, keysIn(value));
}
module.exports = toPlainObject;

},{"./_copyObject":529,"./keysIn":665}],678:[function(require,module,exports){
"use strict";

var baseToString = require('./_baseToString');
function toString(value) {
  return value == null ? '' : baseToString(value);
}
module.exports = toString;

},{"./_baseToString":515}],679:[function(require,module,exports){
"use strict";

var LazyWrapper = require('./_LazyWrapper'),
  LodashWrapper = require('./_LodashWrapper'),
  baseLodash = require('./_baseLodash'),
  isArray = require('./isArray'),
  isObjectLike = require('./isObjectLike'),
  wrapperClone = require('./_wrapperClone');
var objectProto = Object.prototype;
var hasOwnProperty = objectProto.hasOwnProperty;
function lodash(value) {
  if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
    if (value instanceof LodashWrapper) {
      return value;
    }
    if (hasOwnProperty.call(value, '__wrapped__')) {
      return wrapperClone(value);
    }
  }
  return new LodashWrapper(value);
}
lodash.prototype = baseLodash.prototype;
lodash.prototype.constructor = lodash;
module.exports = lodash;

},{"./_LazyWrapper":456,"./_LodashWrapper":458,"./_baseLodash":504,"./_wrapperClone":628,"./isArray":648,"./isObjectLike":657}],680:[function(require,module,exports){
"use strict";

;
(function (global, factory) {
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : global.moment = factory();
})(void 0, function () {
  'use strict';

  var hookCallback;
  function hooks() {
    return hookCallback.apply(null, arguments);
  }
  function setHookCallback(callback) {
    hookCallback = callback;
  }
  function isArray(input) {
    return input instanceof Array || Object.prototype.toString.call(input) === '[object Array]';
  }
  function isObject(input) {
    return input != null && Object.prototype.toString.call(input) === '[object Object]';
  }
  function hasOwnProp(a, b) {
    return Object.prototype.hasOwnProperty.call(a, b);
  }
  function isObjectEmpty(obj) {
    if (Object.getOwnPropertyNames) {
      return Object.getOwnPropertyNames(obj).length === 0;
    } else {
      var k;
      for (k in obj) {
        if (hasOwnProp(obj, k)) {
          return false;
        }
      }
      return true;
    }
  }
  function isUndefined(input) {
    return input === void 0;
  }
  function isNumber(input) {
    return typeof input === 'number' || Object.prototype.toString.call(input) === '[object Number]';
  }
  function isDate(input) {
    return input instanceof Date || Object.prototype.toString.call(input) === '[object Date]';
  }
  function map(arr, fn) {
    var res = [],
      i,
      arrLen = arr.length;
    for (i = 0; i < arrLen; ++i) {
      res.push(fn(arr[i], i));
    }
    return res;
  }
  function extend(a, b) {
    for (var i in b) {
      if (hasOwnProp(b, i)) {
        a[i] = b[i];
      }
    }
    if (hasOwnProp(b, 'toString')) {
      a.toString = b.toString;
    }
    if (hasOwnProp(b, 'valueOf')) {
      a.valueOf = b.valueOf;
    }
    return a;
  }
  function createUTC(input, format, locale, strict) {
    return createLocalOrUTC(input, format, locale, strict, true).utc();
  }
  function defaultParsingFlags() {
    return {
      empty: false,
      unusedTokens: [],
      unusedInput: [],
      overflow: -2,
      charsLeftOver: 0,
      nullInput: false,
      invalidEra: null,
      invalidMonth: null,
      invalidFormat: false,
      userInvalidated: false,
      iso: false,
      parsedDateParts: [],
      era: null,
      meridiem: null,
      rfc2822: false,
      weekdayMismatch: false
    };
  }
  function getParsingFlags(m) {
    if (m._pf == null) {
      m._pf = defaultParsingFlags();
    }
    return m._pf;
  }
  var some;
  if (Array.prototype.some) {
    some = Array.prototype.some;
  } else {
    some = function some(fun) {
      var t = Object(this),
        len = t.length >>> 0,
        i;
      for (i = 0; i < len; i++) {
        if (i in t && fun.call(this, t[i], i, t)) {
          return true;
        }
      }
      return false;
    };
  }
  function isValid(m) {
    var flags = null,
      parsedParts = false,
      isNowValid = m._d && !isNaN(m._d.getTime());
    if (isNowValid) {
      flags = getParsingFlags(m);
      parsedParts = some.call(flags.parsedDateParts, function (i) {
        return i != null;
      });
      isNowValid = flags.overflow < 0 && !flags.empty && !flags.invalidEra && !flags.invalidMonth && !flags.invalidWeekday && !flags.weekdayMismatch && !flags.nullInput && !flags.invalidFormat && !flags.userInvalidated && (!flags.meridiem || flags.meridiem && parsedParts);
      if (m._strict) {
        isNowValid = isNowValid && flags.charsLeftOver === 0 && flags.unusedTokens.length === 0 && flags.bigHour === undefined;
      }
    }
    if (Object.isFrozen == null || !Object.isFrozen(m)) {
      m._isValid = isNowValid;
    } else {
      return isNowValid;
    }
    return m._isValid;
  }
  function createInvalid(flags) {
    var m = createUTC(NaN);
    if (flags != null) {
      extend(getParsingFlags(m), flags);
    } else {
      getParsingFlags(m).userInvalidated = true;
    }
    return m;
  }
  var momentProperties = hooks.momentProperties = [],
    updateInProgress = false;
  function copyConfig(to, from) {
    var i,
      prop,
      val,
      momentPropertiesLen = momentProperties.length;
    if (!isUndefined(from._isAMomentObject)) {
      to._isAMomentObject = from._isAMomentObject;
    }
    if (!isUndefined(from._i)) {
      to._i = from._i;
    }
    if (!isUndefined(from._f)) {
      to._f = from._f;
    }
    if (!isUndefined(from._l)) {
      to._l = from._l;
    }
    if (!isUndefined(from._strict)) {
      to._strict = from._strict;
    }
    if (!isUndefined(from._tzm)) {
      to._tzm = from._tzm;
    }
    if (!isUndefined(from._isUTC)) {
      to._isUTC = from._isUTC;
    }
    if (!isUndefined(from._offset)) {
      to._offset = from._offset;
    }
    if (!isUndefined(from._pf)) {
      to._pf = getParsingFlags(from);
    }
    if (!isUndefined(from._locale)) {
      to._locale = from._locale;
    }
    if (momentPropertiesLen > 0) {
      for (i = 0; i < momentPropertiesLen; i++) {
        prop = momentProperties[i];
        val = from[prop];
        if (!isUndefined(val)) {
          to[prop] = val;
        }
      }
    }
    return to;
  }
  function Moment(config) {
    copyConfig(this, config);
    this._d = new Date(config._d != null ? config._d.getTime() : NaN);
    if (!this.isValid()) {
      this._d = new Date(NaN);
    }
    if (updateInProgress === false) {
      updateInProgress = true;
      hooks.updateOffset(this);
      updateInProgress = false;
    }
  }
  function isMoment(obj) {
    return obj instanceof Moment || obj != null && obj._isAMomentObject != null;
  }
  function warn(msg) {
    if (hooks.suppressDeprecationWarnings === false && typeof console !== 'undefined' && console.warn) {
      console.warn('Deprecation warning: ' + msg);
    }
  }
  function deprecate(msg, fn) {
    var firstTime = true;
    return extend(function () {
      if (hooks.deprecationHandler != null) {
        hooks.deprecationHandler(null, msg);
      }
      if (firstTime) {
        var args = [],
          arg,
          i,
          key,
          argLen = arguments.length;
        for (i = 0; i < argLen; i++) {
          arg = '';
          if (typeof arguments[i] === 'object') {
            arg += '\n[' + i + '] ';
            for (key in arguments[0]) {
              if (hasOwnProp(arguments[0], key)) {
                arg += key + ': ' + arguments[0][key] + ', ';
              }
            }
            arg = arg.slice(0, -2);
          } else {
            arg = arguments[i];
          }
          args.push(arg);
        }
        warn(msg + '\nArguments: ' + Array.prototype.slice.call(args).join('') + '\n' + new Error().stack);
        firstTime = false;
      }
      return fn.apply(this, arguments);
    }, fn);
  }
  var deprecations = {};
  function deprecateSimple(name, msg) {
    if (hooks.deprecationHandler != null) {
      hooks.deprecationHandler(name, msg);
    }
    if (!deprecations[name]) {
      warn(msg);
      deprecations[name] = true;
    }
  }
  hooks.suppressDeprecationWarnings = false;
  hooks.deprecationHandler = null;
  function isFunction(input) {
    return typeof Function !== 'undefined' && input instanceof Function || Object.prototype.toString.call(input) === '[object Function]';
  }
  function set(config) {
    var prop, i;
    for (i in config) {
      if (hasOwnProp(config, i)) {
        prop = config[i];
        if (isFunction(prop)) {
          this[i] = prop;
        } else {
          this['_' + i] = prop;
        }
      }
    }
    this._config = config;
    this._dayOfMonthOrdinalParseLenient = new RegExp((this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) + '|' + /\d{1,2}/.source);
  }
  function mergeConfigs(parentConfig, childConfig) {
    var res = extend({}, parentConfig),
      prop;
    for (prop in childConfig) {
      if (hasOwnProp(childConfig, prop)) {
        if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) {
          res[prop] = {};
          extend(res[prop], parentConfig[prop]);
          extend(res[prop], childConfig[prop]);
        } else if (childConfig[prop] != null) {
          res[prop] = childConfig[prop];
        } else {
          delete res[prop];
        }
      }
    }
    for (prop in parentConfig) {
      if (hasOwnProp(parentConfig, prop) && !hasOwnProp(childConfig, prop) && isObject(parentConfig[prop])) {
        res[prop] = extend({}, res[prop]);
      }
    }
    return res;
  }
  function Locale(config) {
    if (config != null) {
      this.set(config);
    }
  }
  var keys;
  if (Object.keys) {
    keys = Object.keys;
  } else {
    keys = function keys(obj) {
      var i,
        res = [];
      for (i in obj) {
        if (hasOwnProp(obj, i)) {
          res.push(i);
        }
      }
      return res;
    };
  }
  var defaultCalendar = {
    sameDay: '[Today at] LT',
    nextDay: '[Tomorrow at] LT',
    nextWeek: 'dddd [at] LT',
    lastDay: '[Yesterday at] LT',
    lastWeek: '[Last] dddd [at] LT',
    sameElse: 'L'
  };
  function calendar(key, mom, now) {
    var output = this._calendar[key] || this._calendar['sameElse'];
    return isFunction(output) ? output.call(mom, now) : output;
  }
  function zeroFill(number, targetLength, forceSign) {
    var absNumber = '' + Math.abs(number),
      zerosToFill = targetLength - absNumber.length,
      sign = number >= 0;
    return (sign ? forceSign ? '+' : '' : '-') + Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber;
  }
  var formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,
    localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,
    formatFunctions = {},
    formatTokenFunctions = {};
  function addFormatToken(token, padded, ordinal, callback) {
    var func = callback;
    if (typeof callback === 'string') {
      func = function func() {
        return this[callback]();
      };
    }
    if (token) {
      formatTokenFunctions[token] = func;
    }
    if (padded) {
      formatTokenFunctions[padded[0]] = function () {
        return zeroFill(func.apply(this, arguments), padded[1], padded[2]);
      };
    }
    if (ordinal) {
      formatTokenFunctions[ordinal] = function () {
        return this.localeData().ordinal(func.apply(this, arguments), token);
      };
    }
  }
  function removeFormattingTokens(input) {
    if (input.match(/\[[\s\S]/)) {
      return input.replace(/^\[|\]$/g, '');
    }
    return input.replace(/\\/g, '');
  }
  function makeFormatFunction(format) {
    var array = format.match(formattingTokens),
      i,
      length;
    for (i = 0, length = array.length; i < length; i++) {
      if (formatTokenFunctions[array[i]]) {
        array[i] = formatTokenFunctions[array[i]];
      } else {
        array[i] = removeFormattingTokens(array[i]);
      }
    }
    return function (mom) {
      var output = '',
        i;
      for (i = 0; i < length; i++) {
        output += isFunction(array[i]) ? array[i].call(mom, format) : array[i];
      }
      return output;
    };
  }
  function formatMoment(m, format) {
    if (!m.isValid()) {
      return m.localeData().invalidDate();
    }
    format = expandFormat(format, m.localeData());
    formatFunctions[format] = formatFunctions[format] || makeFormatFunction(format);
    return formatFunctions[format](m);
  }
  function expandFormat(format, locale) {
    var i = 5;
    function replaceLongDateFormatTokens(input) {
      return locale.longDateFormat(input) || input;
    }
    localFormattingTokens.lastIndex = 0;
    while (i >= 0 && localFormattingTokens.test(format)) {
      format = format.replace(localFormattingTokens, replaceLongDateFormatTokens);
      localFormattingTokens.lastIndex = 0;
      i -= 1;
    }
    return format;
  }
  var defaultLongDateFormat = {
    LTS: 'h:mm:ss A',
    LT: 'h:mm A',
    L: 'MM/DD/YYYY',
    LL: 'MMMM D, YYYY',
    LLL: 'MMMM D, YYYY h:mm A',
    LLLL: 'dddd, MMMM D, YYYY h:mm A'
  };
  function longDateFormat(key) {
    var format = this._longDateFormat[key],
      formatUpper = this._longDateFormat[key.toUpperCase()];
    if (format || !formatUpper) {
      return format;
    }
    this._longDateFormat[key] = formatUpper.match(formattingTokens).map(function (tok) {
      if (tok === 'MMMM' || tok === 'MM' || tok === 'DD' || tok === 'dddd') {
        return tok.slice(1);
      }
      return tok;
    }).join('');
    return this._longDateFormat[key];
  }
  var defaultInvalidDate = 'Invalid date';
  function invalidDate() {
    return this._invalidDate;
  }
  var defaultOrdinal = '%d',
    defaultDayOfMonthOrdinalParse = /\d{1,2}/;
  function ordinal(number) {
    return this._ordinal.replace('%d', number);
  }
  var defaultRelativeTime = {
    future: 'in %s',
    past: '%s ago',
    s: 'a few seconds',
    ss: '%d seconds',
    m: 'a minute',
    mm: '%d minutes',
    h: 'an hour',
    hh: '%d hours',
    d: 'a day',
    dd: '%d days',
    w: 'a week',
    ww: '%d weeks',
    M: 'a month',
    MM: '%d months',
    y: 'a year',
    yy: '%d years'
  };
  function relativeTime(number, withoutSuffix, string, isFuture) {
    var output = this._relativeTime[string];
    return isFunction(output) ? output(number, withoutSuffix, string, isFuture) : output.replace(/%d/i, number);
  }
  function pastFuture(diff, output) {
    var format = this._relativeTime[diff > 0 ? 'future' : 'past'];
    return isFunction(format) ? format(output) : format.replace(/%s/i, output);
  }
  var aliases = {
    D: 'date',
    dates: 'date',
    date: 'date',
    d: 'day',
    days: 'day',
    day: 'day',
    e: 'weekday',
    weekdays: 'weekday',
    weekday: 'weekday',
    E: 'isoWeekday',
    isoweekdays: 'isoWeekday',
    isoweekday: 'isoWeekday',
    DDD: 'dayOfYear',
    dayofyears: 'dayOfYear',
    dayofyear: 'dayOfYear',
    h: 'hour',
    hours: 'hour',
    hour: 'hour',
    ms: 'millisecond',
    milliseconds: 'millisecond',
    millisecond: 'millisecond',
    m: 'minute',
    minutes: 'minute',
    minute: 'minute',
    M: 'month',
    months: 'month',
    month: 'month',
    Q: 'quarter',
    quarters: 'quarter',
    quarter: 'quarter',
    s: 'second',
    seconds: 'second',
    second: 'second',
    gg: 'weekYear',
    weekyears: 'weekYear',
    weekyear: 'weekYear',
    GG: 'isoWeekYear',
    isoweekyears: 'isoWeekYear',
    isoweekyear: 'isoWeekYear',
    w: 'week',
    weeks: 'week',
    week: 'week',
    W: 'isoWeek',
    isoweeks: 'isoWeek',
    isoweek: 'isoWeek',
    y: 'year',
    years: 'year',
    year: 'year'
  };
  function normalizeUnits(units) {
    return typeof units === 'string' ? aliases[units] || aliases[units.toLowerCase()] : undefined;
  }
  function normalizeObjectUnits(inputObject) {
    var normalizedInput = {},
      normalizedProp,
      prop;
    for (prop in inputObject) {
      if (hasOwnProp(inputObject, prop)) {
        normalizedProp = normalizeUnits(prop);
        if (normalizedProp) {
          normalizedInput[normalizedProp] = inputObject[prop];
        }
      }
    }
    return normalizedInput;
  }
  var priorities = {
    date: 9,
    day: 11,
    weekday: 11,
    isoWeekday: 11,
    dayOfYear: 4,
    hour: 13,
    millisecond: 16,
    minute: 14,
    month: 8,
    quarter: 7,
    second: 15,
    weekYear: 1,
    isoWeekYear: 1,
    week: 5,
    isoWeek: 5,
    year: 1
  };
  function getPrioritizedUnits(unitsObj) {
    var units = [],
      u;
    for (u in unitsObj) {
      if (hasOwnProp(unitsObj, u)) {
        units.push({
          unit: u,
          priority: priorities[u]
        });
      }
    }
    units.sort(function (a, b) {
      return a.priority - b.priority;
    });
    return units;
  }
  var match1 = /\d/,
    match2 = /\d\d/,
    match3 = /\d{3}/,
    match4 = /\d{4}/,
    match6 = /[+-]?\d{6}/,
    match1to2 = /\d\d?/,
    match3to4 = /\d\d\d\d?/,
    match5to6 = /\d\d\d\d\d\d?/,
    match1to3 = /\d{1,3}/,
    match1to4 = /\d{1,4}/,
    match1to6 = /[+-]?\d{1,6}/,
    matchUnsigned = /\d+/,
    matchSigned = /[+-]?\d+/,
    matchOffset = /Z|[+-]\d\d:?\d\d/gi,
    matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi,
    matchTimestamp = /[+-]?\d+(\.\d{1,3})?/,
    matchWord = /[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,
    match1to2NoLeadingZero = /^[1-9]\d?/,
    match1to2HasZero = /^([1-9]\d|\d)/,
    regexes;
  regexes = {};
  function addRegexToken(token, regex, strictRegex) {
    regexes[token] = isFunction(regex) ? regex : function (isStrict, localeData) {
      return isStrict && strictRegex ? strictRegex : regex;
    };
  }
  function getParseRegexForToken(token, config) {
    if (!hasOwnProp(regexes, token)) {
      return new RegExp(unescapeFormat(token));
    }
    return regexes[token](config._strict, config._locale);
  }
  function unescapeFormat(s) {
    return regexEscape(s.replace('\\', '').replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (matched, p1, p2, p3, p4) {
      return p1 || p2 || p3 || p4;
    }));
  }
  function regexEscape(s) {
    return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
  }
  function absFloor(number) {
    if (number < 0) {
      return Math.ceil(number) || 0;
    } else {
      return Math.floor(number);
    }
  }
  function toInt(argumentForCoercion) {
    var coercedNumber = +argumentForCoercion,
      value = 0;
    if (coercedNumber !== 0 && isFinite(coercedNumber)) {
      value = absFloor(coercedNumber);
    }
    return value;
  }
  var tokens = {};
  function addParseToken(token, callback) {
    var i,
      func = callback,
      tokenLen;
    if (typeof token === 'string') {
      token = [token];
    }
    if (isNumber(callback)) {
      func = function func(input, array) {
        array[callback] = toInt(input);
      };
    }
    tokenLen = token.length;
    for (i = 0; i < tokenLen; i++) {
      tokens[token[i]] = func;
    }
  }
  function addWeekParseToken(token, callback) {
    addParseToken(token, function (input, array, config, token) {
      config._w = config._w || {};
      callback(input, config._w, config, token);
    });
  }
  function addTimeToArrayFromToken(token, input, config) {
    if (input != null && hasOwnProp(tokens, token)) {
      tokens[token](input, config._a, config, token);
    }
  }
  function isLeapYear(year) {
    return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;
  }
  var YEAR = 0,
    MONTH = 1,
    DATE = 2,
    HOUR = 3,
    MINUTE = 4,
    SECOND = 5,
    MILLISECOND = 6,
    WEEK = 7,
    WEEKDAY = 8;
  addFormatToken('Y', 0, 0, function () {
    var y = this.year();
    return y <= 9999 ? zeroFill(y, 4) : '+' + y;
  });
  addFormatToken(0, ['YY', 2], 0, function () {
    return this.year() % 100;
  });
  addFormatToken(0, ['YYYY', 4], 0, 'year');
  addFormatToken(0, ['YYYYY', 5], 0, 'year');
  addFormatToken(0, ['YYYYYY', 6, true], 0, 'year');
  addRegexToken('Y', matchSigned);
  addRegexToken('YY', match1to2, match2);
  addRegexToken('YYYY', match1to4, match4);
  addRegexToken('YYYYY', match1to6, match6);
  addRegexToken('YYYYYY', match1to6, match6);
  addParseToken(['YYYYY', 'YYYYYY'], YEAR);
  addParseToken('YYYY', function (input, array) {
    array[YEAR] = input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input);
  });
  addParseToken('YY', function (input, array) {
    array[YEAR] = hooks.parseTwoDigitYear(input);
  });
  addParseToken('Y', function (input, array) {
    array[YEAR] = parseInt(input, 10);
  });
  function daysInYear(year) {
    return isLeapYear(year) ? 366 : 365;
  }
  hooks.parseTwoDigitYear = function (input) {
    return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);
  };
  var getSetYear = makeGetSet('FullYear', true);
  function getIsLeapYear() {
    return isLeapYear(this.year());
  }
  function makeGetSet(unit, keepTime) {
    return function (value) {
      if (value != null) {
        set$1(this, unit, value);
        hooks.updateOffset(this, keepTime);
        return this;
      } else {
        return get(this, unit);
      }
    };
  }
  function get(mom, unit) {
    if (!mom.isValid()) {
      return NaN;
    }
    var d = mom._d,
      isUTC = mom._isUTC;
    switch (unit) {
      case 'Milliseconds':
        return isUTC ? d.getUTCMilliseconds() : d.getMilliseconds();
      case 'Seconds':
        return isUTC ? d.getUTCSeconds() : d.getSeconds();
      case 'Minutes':
        return isUTC ? d.getUTCMinutes() : d.getMinutes();
      case 'Hours':
        return isUTC ? d.getUTCHours() : d.getHours();
      case 'Date':
        return isUTC ? d.getUTCDate() : d.getDate();
      case 'Day':
        return isUTC ? d.getUTCDay() : d.getDay();
      case 'Month':
        return isUTC ? d.getUTCMonth() : d.getMonth();
      case 'FullYear':
        return isUTC ? d.getUTCFullYear() : d.getFullYear();
      default:
        return NaN;
    }
  }
  function set$1(mom, unit, value) {
    var d, isUTC, year, month, date;
    if (!mom.isValid() || isNaN(value)) {
      return;
    }
    d = mom._d;
    isUTC = mom._isUTC;
    switch (unit) {
      case 'Milliseconds':
        return void (isUTC ? d.setUTCMilliseconds(value) : d.setMilliseconds(value));
      case 'Seconds':
        return void (isUTC ? d.setUTCSeconds(value) : d.setSeconds(value));
      case 'Minutes':
        return void (isUTC ? d.setUTCMinutes(value) : d.setMinutes(value));
      case 'Hours':
        return void (isUTC ? d.setUTCHours(value) : d.setHours(value));
      case 'Date':
        return void (isUTC ? d.setUTCDate(value) : d.setDate(value));
      case 'FullYear':
        break;
      default:
        return;
    }
    year = value;
    month = mom.month();
    date = mom.date();
    date = date === 29 && month === 1 && !isLeapYear(year) ? 28 : date;
    void (isUTC ? d.setUTCFullYear(year, month, date) : d.setFullYear(year, month, date));
  }
  function stringGet(units) {
    units = normalizeUnits(units);
    if (isFunction(this[units])) {
      return this[units]();
    }
    return this;
  }
  function stringSet(units, value) {
    if (typeof units === 'object') {
      units = normalizeObjectUnits(units);
      var prioritized = getPrioritizedUnits(units),
        i,
        prioritizedLen = prioritized.length;
      for (i = 0; i < prioritizedLen; i++) {
        this[prioritized[i].unit](units[prioritized[i].unit]);
      }
    } else {
      units = normalizeUnits(units);
      if (isFunction(this[units])) {
        return this[units](value);
      }
    }
    return this;
  }
  function mod(n, x) {
    return (n % x + x) % x;
  }
  var indexOf;
  if (Array.prototype.indexOf) {
    indexOf = Array.prototype.indexOf;
  } else {
    indexOf = function indexOf(o) {
      var i;
      for (i = 0; i < this.length; ++i) {
        if (this[i] === o) {
          return i;
        }
      }
      return -1;
    };
  }
  function daysInMonth(year, month) {
    if (isNaN(year) || isNaN(month)) {
      return NaN;
    }
    var modMonth = mod(month, 12);
    year += (month - modMonth) / 12;
    return modMonth === 1 ? isLeapYear(year) ? 29 : 28 : 31 - modMonth % 7 % 2;
  }
  addFormatToken('M', ['MM', 2], 'Mo', function () {
    return this.month() + 1;
  });
  addFormatToken('MMM', 0, 0, function (format) {
    return this.localeData().monthsShort(this, format);
  });
  addFormatToken('MMMM', 0, 0, function (format) {
    return this.localeData().months(this, format);
  });
  addRegexToken('M', match1to2, match1to2NoLeadingZero);
  addRegexToken('MM', match1to2, match2);
  addRegexToken('MMM', function (isStrict, locale) {
    return locale.monthsShortRegex(isStrict);
  });
  addRegexToken('MMMM', function (isStrict, locale) {
    return locale.monthsRegex(isStrict);
  });
  addParseToken(['M', 'MM'], function (input, array) {
    array[MONTH] = toInt(input) - 1;
  });
  addParseToken(['MMM', 'MMMM'], function (input, array, config, token) {
    var month = config._locale.monthsParse(input, token, config._strict);
    if (month != null) {
      array[MONTH] = month;
    } else {
      getParsingFlags(config).invalidMonth = input;
    }
  });
  var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),
    defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
    MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,
    defaultMonthsShortRegex = matchWord,
    defaultMonthsRegex = matchWord;
  function localeMonths(m, format) {
    if (!m) {
      return isArray(this._months) ? this._months : this._months['standalone'];
    }
    return isArray(this._months) ? this._months[m.month()] : this._months[(this._months.isFormat || MONTHS_IN_FORMAT).test(format) ? 'format' : 'standalone'][m.month()];
  }
  function localeMonthsShort(m, format) {
    if (!m) {
      return isArray(this._monthsShort) ? this._monthsShort : this._monthsShort['standalone'];
    }
    return isArray(this._monthsShort) ? this._monthsShort[m.month()] : this._monthsShort[MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'][m.month()];
  }
  function handleStrictParse(monthName, format, strict) {
    var i,
      ii,
      mom,
      llc = monthName.toLocaleLowerCase();
    if (!this._monthsParse) {
      this._monthsParse = [];
      this._longMonthsParse = [];
      this._shortMonthsParse = [];
      for (i = 0; i < 12; ++i) {
        mom = createUTC([2000, i]);
        this._shortMonthsParse[i] = this.monthsShort(mom, '').toLocaleLowerCase();
        this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase();
      }
    }
    if (strict) {
      if (format === 'MMM') {
        ii = indexOf.call(this._shortMonthsParse, llc);
        return ii !== -1 ? ii : null;
      } else {
        ii = indexOf.call(this._longMonthsParse, llc);
        return ii !== -1 ? ii : null;
      }
    } else {
      if (format === 'MMM') {
        ii = indexOf.call(this._shortMonthsParse, llc);
        if (ii !== -1) {
          return ii;
        }
        ii = indexOf.call(this._longMonthsParse, llc);
        return ii !== -1 ? ii : null;
      } else {
        ii = indexOf.call(this._longMonthsParse, llc);
        if (ii !== -1) {
          return ii;
        }
        ii = indexOf.call(this._shortMonthsParse, llc);
        return ii !== -1 ? ii : null;
      }
    }
  }
  function localeMonthsParse(monthName, format, strict) {
    var i, mom, regex;
    if (this._monthsParseExact) {
      return handleStrictParse.call(this, monthName, format, strict);
    }
    if (!this._monthsParse) {
      this._monthsParse = [];
      this._longMonthsParse = [];
      this._shortMonthsParse = [];
    }
    for (i = 0; i < 12; i++) {
      mom = createUTC([2000, i]);
      if (strict && !this._longMonthsParse[i]) {
        this._longMonthsParse[i] = new RegExp('^' + this.months(mom, '').replace('.', '') + '$', 'i');
        this._shortMonthsParse[i] = new RegExp('^' + this.monthsShort(mom, '').replace('.', '') + '$', 'i');
      }
      if (!strict && !this._monthsParse[i]) {
        regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, '');
        this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i');
      }
      if (strict && format === 'MMMM' && this._longMonthsParse[i].test(monthName)) {
        return i;
      } else if (strict && format === 'MMM' && this._shortMonthsParse[i].test(monthName)) {
        return i;
      } else if (!strict && this._monthsParse[i].test(monthName)) {
        return i;
      }
    }
  }
  function setMonth(mom, value) {
    if (!mom.isValid()) {
      return mom;
    }
    if (typeof value === 'string') {
      if (/^\d+$/.test(value)) {
        value = toInt(value);
      } else {
        value = mom.localeData().monthsParse(value);
        if (!isNumber(value)) {
          return mom;
        }
      }
    }
    var month = value,
      date = mom.date();
    date = date < 29 ? date : Math.min(date, daysInMonth(mom.year(), month));
    void (mom._isUTC ? mom._d.setUTCMonth(month, date) : mom._d.setMonth(month, date));
    return mom;
  }
  function getSetMonth(value) {
    if (value != null) {
      setMonth(this, value);
      hooks.updateOffset(this, true);
      return this;
    } else {
      return get(this, 'Month');
    }
  }
  function getDaysInMonth() {
    return daysInMonth(this.year(), this.month());
  }
  function monthsShortRegex(isStrict) {
    if (this._monthsParseExact) {
      if (!hasOwnProp(this, '_monthsRegex')) {
        computeMonthsParse.call(this);
      }
      if (isStrict) {
        return this._monthsShortStrictRegex;
      } else {
        return this._monthsShortRegex;
      }
    } else {
      if (!hasOwnProp(this, '_monthsShortRegex')) {
        this._monthsShortRegex = defaultMonthsShortRegex;
      }
      return this._monthsShortStrictRegex && isStrict ? this._monthsShortStrictRegex : this._monthsShortRegex;
    }
  }
  function monthsRegex(isStrict) {
    if (this._monthsParseExact) {
      if (!hasOwnProp(this, '_monthsRegex')) {
        computeMonthsParse.call(this);
      }
      if (isStrict) {
        return this._monthsStrictRegex;
      } else {
        return this._monthsRegex;
      }
    } else {
      if (!hasOwnProp(this, '_monthsRegex')) {
        this._monthsRegex = defaultMonthsRegex;
      }
      return this._monthsStrictRegex && isStrict ? this._monthsStrictRegex : this._monthsRegex;
    }
  }
  function computeMonthsParse() {
    function cmpLenRev(a, b) {
      return b.length - a.length;
    }
    var shortPieces = [],
      longPieces = [],
      mixedPieces = [],
      i,
      mom,
      shortP,
      longP;
    for (i = 0; i < 12; i++) {
      mom = createUTC([2000, i]);
      shortP = regexEscape(this.monthsShort(mom, ''));
      longP = regexEscape(this.months(mom, ''));
      shortPieces.push(shortP);
      longPieces.push(longP);
      mixedPieces.push(longP);
      mixedPieces.push(shortP);
    }
    shortPieces.sort(cmpLenRev);
    longPieces.sort(cmpLenRev);
    mixedPieces.sort(cmpLenRev);
    this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
    this._monthsShortRegex = this._monthsRegex;
    this._monthsStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i');
    this._monthsShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i');
  }
  function createDate(y, m, d, h, M, s, ms) {
    var date;
    if (y < 100 && y >= 0) {
      date = new Date(y + 400, m, d, h, M, s, ms);
      if (isFinite(date.getFullYear())) {
        date.setFullYear(y);
      }
    } else {
      date = new Date(y, m, d, h, M, s, ms);
    }
    return date;
  }
  function createUTCDate(y) {
    var date, args;
    if (y < 100 && y >= 0) {
      args = Array.prototype.slice.call(arguments);
      args[0] = y + 400;
      date = new Date(Date.UTC.apply(null, args));
      if (isFinite(date.getUTCFullYear())) {
        date.setUTCFullYear(y);
      }
    } else {
      date = new Date(Date.UTC.apply(null, arguments));
    }
    return date;
  }
  function firstWeekOffset(year, dow, doy) {
    var fwd = 7 + dow - doy,
      fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7;
    return -fwdlw + fwd - 1;
  }
  function dayOfYearFromWeeks(year, week, weekday, dow, doy) {
    var localWeekday = (7 + weekday - dow) % 7,
      weekOffset = firstWeekOffset(year, dow, doy),
      dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset,
      resYear,
      resDayOfYear;
    if (dayOfYear <= 0) {
      resYear = year - 1;
      resDayOfYear = daysInYear(resYear) + dayOfYear;
    } else if (dayOfYear > daysInYear(year)) {
      resYear = year + 1;
      resDayOfYear = dayOfYear - daysInYear(year);
    } else {
      resYear = year;
      resDayOfYear = dayOfYear;
    }
    return {
      year: resYear,
      dayOfYear: resDayOfYear
    };
  }
  function weekOfYear(mom, dow, doy) {
    var weekOffset = firstWeekOffset(mom.year(), dow, doy),
      week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1,
      resWeek,
      resYear;
    if (week < 1) {
      resYear = mom.year() - 1;
      resWeek = week + weeksInYear(resYear, dow, doy);
    } else if (week > weeksInYear(mom.year(), dow, doy)) {
      resWeek = week - weeksInYear(mom.year(), dow, doy);
      resYear = mom.year() + 1;
    } else {
      resYear = mom.year();
      resWeek = week;
    }
    return {
      week: resWeek,
      year: resYear
    };
  }
  function weeksInYear(year, dow, doy) {
    var weekOffset = firstWeekOffset(year, dow, doy),
      weekOffsetNext = firstWeekOffset(year + 1, dow, doy);
    return (daysInYear(year) - weekOffset + weekOffsetNext) / 7;
  }
  addFormatToken('w', ['ww', 2], 'wo', 'week');
  addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek');
  addRegexToken('w', match1to2, match1to2NoLeadingZero);
  addRegexToken('ww', match1to2, match2);
  addRegexToken('W', match1to2, match1to2NoLeadingZero);
  addRegexToken('WW', match1to2, match2);
  addWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) {
    week[token.substr(0, 1)] = toInt(input);
  });
  function localeWeek(mom) {
    return weekOfYear(mom, this._week.dow, this._week.doy).week;
  }
  var defaultLocaleWeek = {
    dow: 0,
    doy: 6
  };
  function localeFirstDayOfWeek() {
    return this._week.dow;
  }
  function localeFirstDayOfYear() {
    return this._week.doy;
  }
  function getSetWeek(input) {
    var week = this.localeData().week(this);
    return input == null ? week : this.add((input - week) * 7, 'd');
  }
  function getSetISOWeek(input) {
    var week = weekOfYear(this, 1, 4).week;
    return input == null ? week : this.add((input - week) * 7, 'd');
  }
  addFormatToken('d', 0, 'do', 'day');
  addFormatToken('dd', 0, 0, function (format) {
    return this.localeData().weekdaysMin(this, format);
  });
  addFormatToken('ddd', 0, 0, function (format) {
    return this.localeData().weekdaysShort(this, format);
  });
  addFormatToken('dddd', 0, 0, function (format) {
    return this.localeData().weekdays(this, format);
  });
  addFormatToken('e', 0, 0, 'weekday');
  addFormatToken('E', 0, 0, 'isoWeekday');
  addRegexToken('d', match1to2);
  addRegexToken('e', match1to2);
  addRegexToken('E', match1to2);
  addRegexToken('dd', function (isStrict, locale) {
    return locale.weekdaysMinRegex(isStrict);
  });
  addRegexToken('ddd', function (isStrict, locale) {
    return locale.weekdaysShortRegex(isStrict);
  });
  addRegexToken('dddd', function (isStrict, locale) {
    return locale.weekdaysRegex(isStrict);
  });
  addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) {
    var weekday = config._locale.weekdaysParse(input, token, config._strict);
    if (weekday != null) {
      week.d = weekday;
    } else {
      getParsingFlags(config).invalidWeekday = input;
    }
  });
  addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) {
    week[token] = toInt(input);
  });
  function parseWeekday(input, locale) {
    if (typeof input !== 'string') {
      return input;
    }
    if (!isNaN(input)) {
      return parseInt(input, 10);
    }
    input = locale.weekdaysParse(input);
    if (typeof input === 'number') {
      return input;
    }
    return null;
  }
  function parseIsoWeekday(input, locale) {
    if (typeof input === 'string') {
      return locale.weekdaysParse(input) % 7 || 7;
    }
    return isNaN(input) ? null : input;
  }
  function shiftWeekdays(ws, n) {
    return ws.slice(n, 7).concat(ws.slice(0, n));
  }
  var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),
    defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
    defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
    defaultWeekdaysRegex = matchWord,
    defaultWeekdaysShortRegex = matchWord,
    defaultWeekdaysMinRegex = matchWord;
  function localeWeekdays(m, format) {
    var weekdays = isArray(this._weekdays) ? this._weekdays : this._weekdays[m && m !== true && this._weekdays.isFormat.test(format) ? 'format' : 'standalone'];
    return m === true ? shiftWeekdays(weekdays, this._week.dow) : m ? weekdays[m.day()] : weekdays;
  }
  function localeWeekdaysShort(m) {
    return m === true ? shiftWeekdays(this._weekdaysShort, this._week.dow) : m ? this._weekdaysShort[m.day()] : this._weekdaysShort;
  }
  function localeWeekdaysMin(m) {
    return m === true ? shiftWeekdays(this._weekdaysMin, this._week.dow) : m ? this._weekdaysMin[m.day()] : this._weekdaysMin;
  }
  function handleStrictParse$1(weekdayName, format, strict) {
    var i,
      ii,
      mom,
      llc = weekdayName.toLocaleLowerCase();
    if (!this._weekdaysParse) {
      this._weekdaysParse = [];
      this._shortWeekdaysParse = [];
      this._minWeekdaysParse = [];
      for (i = 0; i < 7; ++i) {
        mom = createUTC([2000, 1]).day(i);
        this._minWeekdaysParse[i] = this.weekdaysMin(mom, '').toLocaleLowerCase();
        this._shortWeekdaysParse[i] = this.weekdaysShort(mom, '').toLocaleLowerCase();
        this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase();
      }
    }
    if (strict) {
      if (format === 'dddd') {
        ii = indexOf.call(this._weekdaysParse, llc);
        return ii !== -1 ? ii : null;
      } else if (format === 'ddd') {
        ii = indexOf.call(this._shortWeekdaysParse, llc);
        return ii !== -1 ? ii : null;
      } else {
        ii = indexOf.call(this._minWeekdaysParse, llc);
        return ii !== -1 ? ii : null;
      }
    } else {
      if (format === 'dddd') {
        ii = indexOf.call(this._weekdaysParse, llc);
        if (ii !== -1) {
          return ii;
        }
        ii = indexOf.call(this._shortWeekdaysParse, llc);
        if (ii !== -1) {
          return ii;
        }
        ii = indexOf.call(this._minWeekdaysParse, llc);
        return ii !== -1 ? ii : null;
      } else if (format === 'ddd') {
        ii = indexOf.call(this._shortWeekdaysParse, llc);
        if (ii !== -1) {
          return ii;
        }
        ii = indexOf.call(this._weekdaysParse, llc);
        if (ii !== -1) {
          return ii;
        }
        ii = indexOf.call(this._minWeekdaysParse, llc);
        return ii !== -1 ? ii : null;
      } else {
        ii = indexOf.call(this._minWeekdaysParse, llc);
        if (ii !== -1) {
          return ii;
        }
        ii = indexOf.call(this._weekdaysParse, llc);
        if (ii !== -1) {
          return ii;
        }
        ii = indexOf.call(this._shortWeekdaysParse, llc);
        return ii !== -1 ? ii : null;
      }
    }
  }
  function localeWeekdaysParse(weekdayName, format, strict) {
    var i, mom, regex;
    if (this._weekdaysParseExact) {
      return handleStrictParse$1.call(this, weekdayName, format, strict);
    }
    if (!this._weekdaysParse) {
      this._weekdaysParse = [];
      this._minWeekdaysParse = [];
      this._shortWeekdaysParse = [];
      this._fullWeekdaysParse = [];
    }
    for (i = 0; i < 7; i++) {
      mom = createUTC([2000, 1]).day(i);
      if (strict && !this._fullWeekdaysParse[i]) {
        this._fullWeekdaysParse[i] = new RegExp('^' + this.weekdays(mom, '').replace('.', '\\.?') + '$', 'i');
        this._shortWeekdaysParse[i] = new RegExp('^' + this.weekdaysShort(mom, '').replace('.', '\\.?') + '$', 'i');
        this._minWeekdaysParse[i] = new RegExp('^' + this.weekdaysMin(mom, '').replace('.', '\\.?') + '$', 'i');
      }
      if (!this._weekdaysParse[i]) {
        regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, '');
        this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i');
      }
      if (strict && format === 'dddd' && this._fullWeekdaysParse[i].test(weekdayName)) {
        return i;
      } else if (strict && format === 'ddd' && this._shortWeekdaysParse[i].test(weekdayName)) {
        return i;
      } else if (strict && format === 'dd' && this._minWeekdaysParse[i].test(weekdayName)) {
        return i;
      } else if (!strict && this._weekdaysParse[i].test(weekdayName)) {
        return i;
      }
    }
  }
  function getSetDayOfWeek(input) {
    if (!this.isValid()) {
      return input != null ? this : NaN;
    }
    var day = get(this, 'Day');
    if (input != null) {
      input = parseWeekday(input, this.localeData());
      return this.add(input - day, 'd');
    } else {
      return day;
    }
  }
  function getSetLocaleDayOfWeek(input) {
    if (!this.isValid()) {
      return input != null ? this : NaN;
    }
    var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7;
    return input == null ? weekday : this.add(input - weekday, 'd');
  }
  function getSetISODayOfWeek(input) {
    if (!this.isValid()) {
      return input != null ? this : NaN;
    }
    if (input != null) {
      var weekday = parseIsoWeekday(input, this.localeData());
      return this.day(this.day() % 7 ? weekday : weekday - 7);
    } else {
      return this.day() || 7;
    }
  }
  function weekdaysRegex(isStrict) {
    if (this._weekdaysParseExact) {
      if (!hasOwnProp(this, '_weekdaysRegex')) {
        computeWeekdaysParse.call(this);
      }
      if (isStrict) {
        return this._weekdaysStrictRegex;
      } else {
        return this._weekdaysRegex;
      }
    } else {
      if (!hasOwnProp(this, '_weekdaysRegex')) {
        this._weekdaysRegex = defaultWeekdaysRegex;
      }
      return this._weekdaysStrictRegex && isStrict ? this._weekdaysStrictRegex : this._weekdaysRegex;
    }
  }
  function weekdaysShortRegex(isStrict) {
    if (this._weekdaysParseExact) {
      if (!hasOwnProp(this, '_weekdaysRegex')) {
        computeWeekdaysParse.call(this);
      }
      if (isStrict) {
        return this._weekdaysShortStrictRegex;
      } else {
        return this._weekdaysShortRegex;
      }
    } else {
      if (!hasOwnProp(this, '_weekdaysShortRegex')) {
        this._weekdaysShortRegex = defaultWeekdaysShortRegex;
      }
      return this._weekdaysShortStrictRegex && isStrict ? this._weekdaysShortStrictRegex : this._weekdaysShortRegex;
    }
  }
  function weekdaysMinRegex(isStrict) {
    if (this._weekdaysParseExact) {
      if (!hasOwnProp(this, '_weekdaysRegex')) {
        computeWeekdaysParse.call(this);
      }
      if (isStrict) {
        return this._weekdaysMinStrictRegex;
      } else {
        return this._weekdaysMinRegex;
      }
    } else {
      if (!hasOwnProp(this, '_weekdaysMinRegex')) {
        this._weekdaysMinRegex = defaultWeekdaysMinRegex;
      }
      return this._weekdaysMinStrictRegex && isStrict ? this._weekdaysMinStrictRegex : this._weekdaysMinRegex;
    }
  }
  function computeWeekdaysParse() {
    function cmpLenRev(a, b) {
      return b.length - a.length;
    }
    var minPieces = [],
      shortPieces = [],
      longPieces = [],
      mixedPieces = [],
      i,
      mom,
      minp,
      shortp,
      longp;
    for (i = 0; i < 7; i++) {
      mom = createUTC([2000, 1]).day(i);
      minp = regexEscape(this.weekdaysMin(mom, ''));
      shortp = regexEscape(this.weekdaysShort(mom, ''));
      longp = regexEscape(this.weekdays(mom, ''));
      minPieces.push(minp);
      shortPieces.push(shortp);
      longPieces.push(longp);
      mixedPieces.push(minp);
      mixedPieces.push(shortp);
      mixedPieces.push(longp);
    }
    minPieces.sort(cmpLenRev);
    shortPieces.sort(cmpLenRev);
    longPieces.sort(cmpLenRev);
    mixedPieces.sort(cmpLenRev);
    this._weekdaysRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
    this._weekdaysShortRegex = this._weekdaysRegex;
    this._weekdaysMinRegex = this._weekdaysRegex;
    this._weekdaysStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i');
    this._weekdaysShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i');
    this._weekdaysMinStrictRegex = new RegExp('^(' + minPieces.join('|') + ')', 'i');
  }
  function hFormat() {
    return this.hours() % 12 || 12;
  }
  function kFormat() {
    return this.hours() || 24;
  }
  addFormatToken('H', ['HH', 2], 0, 'hour');
  addFormatToken('h', ['hh', 2], 0, hFormat);
  addFormatToken('k', ['kk', 2], 0, kFormat);
  addFormatToken('hmm', 0, 0, function () {
    return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2);
  });
  addFormatToken('hmmss', 0, 0, function () {
    return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2) + zeroFill(this.seconds(), 2);
  });
  addFormatToken('Hmm', 0, 0, function () {
    return '' + this.hours() + zeroFill(this.minutes(), 2);
  });
  addFormatToken('Hmmss', 0, 0, function () {
    return '' + this.hours() + zeroFill(this.minutes(), 2) + zeroFill(this.seconds(), 2);
  });
  function meridiem(token, lowercase) {
    addFormatToken(token, 0, 0, function () {
      return this.localeData().meridiem(this.hours(), this.minutes(), lowercase);
    });
  }
  meridiem('a', true);
  meridiem('A', false);
  function matchMeridiem(isStrict, locale) {
    return locale._meridiemParse;
  }
  addRegexToken('a', matchMeridiem);
  addRegexToken('A', matchMeridiem);
  addRegexToken('H', match1to2, match1to2HasZero);
  addRegexToken('h', match1to2, match1to2NoLeadingZero);
  addRegexToken('k', match1to2, match1to2NoLeadingZero);
  addRegexToken('HH', match1to2, match2);
  addRegexToken('hh', match1to2, match2);
  addRegexToken('kk', match1to2, match2);
  addRegexToken('hmm', match3to4);
  addRegexToken('hmmss', match5to6);
  addRegexToken('Hmm', match3to4);
  addRegexToken('Hmmss', match5to6);
  addParseToken(['H', 'HH'], HOUR);
  addParseToken(['k', 'kk'], function (input, array, config) {
    var kInput = toInt(input);
    array[HOUR] = kInput === 24 ? 0 : kInput;
  });
  addParseToken(['a', 'A'], function (input, array, config) {
    config._isPm = config._locale.isPM(input);
    config._meridiem = input;
  });
  addParseToken(['h', 'hh'], function (input, array, config) {
    array[HOUR] = toInt(input);
    getParsingFlags(config).bigHour = true;
  });
  addParseToken('hmm', function (input, array, config) {
    var pos = input.length - 2;
    array[HOUR] = toInt(input.substr(0, pos));
    array[MINUTE] = toInt(input.substr(pos));
    getParsingFlags(config).bigHour = true;
  });
  addParseToken('hmmss', function (input, array, config) {
    var pos1 = input.length - 4,
      pos2 = input.length - 2;
    array[HOUR] = toInt(input.substr(0, pos1));
    array[MINUTE] = toInt(input.substr(pos1, 2));
    array[SECOND] = toInt(input.substr(pos2));
    getParsingFlags(config).bigHour = true;
  });
  addParseToken('Hmm', function (input, array, config) {
    var pos = input.length - 2;
    array[HOUR] = toInt(input.substr(0, pos));
    array[MINUTE] = toInt(input.substr(pos));
  });
  addParseToken('Hmmss', function (input, array, config) {
    var pos1 = input.length - 4,
      pos2 = input.length - 2;
    array[HOUR] = toInt(input.substr(0, pos1));
    array[MINUTE] = toInt(input.substr(pos1, 2));
    array[SECOND] = toInt(input.substr(pos2));
  });
  function localeIsPM(input) {
    return (input + '').toLowerCase().charAt(0) === 'p';
  }
  var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i,
    getSetHour = makeGetSet('Hours', true);
  function localeMeridiem(hours, minutes, isLower) {
    if (hours > 11) {
      return isLower ? 'pm' : 'PM';
    } else {
      return isLower ? 'am' : 'AM';
    }
  }
  var baseConfig = {
    calendar: defaultCalendar,
    longDateFormat: defaultLongDateFormat,
    invalidDate: defaultInvalidDate,
    ordinal: defaultOrdinal,
    dayOfMonthOrdinalParse: defaultDayOfMonthOrdinalParse,
    relativeTime: defaultRelativeTime,
    months: defaultLocaleMonths,
    monthsShort: defaultLocaleMonthsShort,
    week: defaultLocaleWeek,
    weekdays: defaultLocaleWeekdays,
    weekdaysMin: defaultLocaleWeekdaysMin,
    weekdaysShort: defaultLocaleWeekdaysShort,
    meridiemParse: defaultLocaleMeridiemParse
  };
  var locales = {},
    localeFamilies = {},
    globalLocale;
  function commonPrefix(arr1, arr2) {
    var i,
      minl = Math.min(arr1.length, arr2.length);
    for (i = 0; i < minl; i += 1) {
      if (arr1[i] !== arr2[i]) {
        return i;
      }
    }
    return minl;
  }
  function normalizeLocale(key) {
    return key ? key.toLowerCase().replace('_', '-') : key;
  }
  function chooseLocale(names) {
    var i = 0,
      j,
      next,
      locale,
      split;
    while (i < names.length) {
      split = normalizeLocale(names[i]).split('-');
      j = split.length;
      next = normalizeLocale(names[i + 1]);
      next = next ? next.split('-') : null;
      while (j > 0) {
        locale = loadLocale(split.slice(0, j).join('-'));
        if (locale) {
          return locale;
        }
        if (next && next.length >= j && commonPrefix(split, next) >= j - 1) {
          break;
        }
        j--;
      }
      i++;
    }
    return globalLocale;
  }
  function isLocaleNameSane(name) {
    return !!(name && name.match('^[^/\\\\]*$'));
  }
  function loadLocale(name) {
    var oldLocale = null,
      aliasedRequire;
    if (locales[name] === undefined && typeof module !== 'undefined' && module && module.exports && isLocaleNameSane(name)) {
      try {
        oldLocale = globalLocale._abbr;
        aliasedRequire = require;
        aliasedRequire('./locale/' + name);
        getSetGlobalLocale(oldLocale);
      } catch (e) {
        locales[name] = null;
      }
    }
    return locales[name];
  }
  function getSetGlobalLocale(key, values) {
    var data;
    if (key) {
      if (isUndefined(values)) {
        data = getLocale(key);
      } else {
        data = defineLocale(key, values);
      }
      if (data) {
        globalLocale = data;
      } else {
        if (typeof console !== 'undefined' && console.warn) {
          console.warn('Locale ' + key + ' not found. Did you forget to load it?');
        }
      }
    }
    return globalLocale._abbr;
  }
  function defineLocale(name, config) {
    if (config !== null) {
      var locale,
        parentConfig = baseConfig;
      config.abbr = name;
      if (locales[name] != null) {
        deprecateSimple('defineLocaleOverride', 'use moment.updateLocale(localeName, config) to change ' + 'an existing locale. moment.defineLocale(localeName, ' + 'config) should only be used for creating a new locale ' + 'See http://momentjs.com/guides/#/warnings/define-locale/ for more info.');
        parentConfig = locales[name]._config;
      } else if (config.parentLocale != null) {
        if (locales[config.parentLocale] != null) {
          parentConfig = locales[config.parentLocale]._config;
        } else {
          locale = loadLocale(config.parentLocale);
          if (locale != null) {
            parentConfig = locale._config;
          } else {
            if (!localeFamilies[config.parentLocale]) {
              localeFamilies[config.parentLocale] = [];
            }
            localeFamilies[config.parentLocale].push({
              name: name,
              config: config
            });
            return null;
          }
        }
      }
      locales[name] = new Locale(mergeConfigs(parentConfig, config));
      if (localeFamilies[name]) {
        localeFamilies[name].forEach(function (x) {
          defineLocale(x.name, x.config);
        });
      }
      getSetGlobalLocale(name);
      return locales[name];
    } else {
      delete locales[name];
      return null;
    }
  }
  function updateLocale(name, config) {
    if (config != null) {
      var locale,
        tmpLocale,
        parentConfig = baseConfig;
      if (locales[name] != null && locales[name].parentLocale != null) {
        locales[name].set(mergeConfigs(locales[name]._config, config));
      } else {
        tmpLocale = loadLocale(name);
        if (tmpLocale != null) {
          parentConfig = tmpLocale._config;
        }
        config = mergeConfigs(parentConfig, config);
        if (tmpLocale == null) {
          config.abbr = name;
        }
        locale = new Locale(config);
        locale.parentLocale = locales[name];
        locales[name] = locale;
      }
      getSetGlobalLocale(name);
    } else {
      if (locales[name] != null) {
        if (locales[name].parentLocale != null) {
          locales[name] = locales[name].parentLocale;
          if (name === getSetGlobalLocale()) {
            getSetGlobalLocale(name);
          }
        } else if (locales[name] != null) {
          delete locales[name];
        }
      }
    }
    return locales[name];
  }
  function getLocale(key) {
    var locale;
    if (key && key._locale && key._locale._abbr) {
      key = key._locale._abbr;
    }
    if (!key) {
      return globalLocale;
    }
    if (!isArray(key)) {
      locale = loadLocale(key);
      if (locale) {
        return locale;
      }
      key = [key];
    }
    return chooseLocale(key);
  }
  function listLocales() {
    return keys(locales);
  }
  function checkOverflow(m) {
    var overflow,
      a = m._a;
    if (a && getParsingFlags(m).overflow === -2) {
      overflow = a[MONTH] < 0 || a[MONTH] > 11 ? MONTH : a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH]) ? DATE : a[HOUR] < 0 || a[HOUR] > 24 || a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0) ? HOUR : a[MINUTE] < 0 || a[MINUTE] > 59 ? MINUTE : a[SECOND] < 0 || a[SECOND] > 59 ? SECOND : a[MILLISECOND] < 0 || a[MILLISECOND] > 999 ? MILLISECOND : -1;
      if (getParsingFlags(m)._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) {
        overflow = DATE;
      }
      if (getParsingFlags(m)._overflowWeeks && overflow === -1) {
        overflow = WEEK;
      }
      if (getParsingFlags(m)._overflowWeekday && overflow === -1) {
        overflow = WEEKDAY;
      }
      getParsingFlags(m).overflow = overflow;
    }
    return m;
  }
  var extendedIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,
    basicIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,
    tzRegex = /Z|[+-]\d\d(?::?\d\d)?/,
    isoDates = [['YYYYYY-MM-DD', /[+-]\d{6}-\d\d-\d\d/], ['YYYY-MM-DD', /\d{4}-\d\d-\d\d/], ['GGGG-[W]WW-E', /\d{4}-W\d\d-\d/], ['GGGG-[W]WW', /\d{4}-W\d\d/, false], ['YYYY-DDD', /\d{4}-\d{3}/], ['YYYY-MM', /\d{4}-\d\d/, false], ['YYYYYYMMDD', /[+-]\d{10}/], ['YYYYMMDD', /\d{8}/], ['GGGG[W]WWE', /\d{4}W\d{3}/], ['GGGG[W]WW', /\d{4}W\d{2}/, false], ['YYYYDDD', /\d{7}/], ['YYYYMM', /\d{6}/, false], ['YYYY', /\d{4}/, false]],
    isoTimes = [['HH:mm:ss.SSSS', /\d\d:\d\d:\d\d\.\d+/], ['HH:mm:ss,SSSS', /\d\d:\d\d:\d\d,\d+/], ['HH:mm:ss', /\d\d:\d\d:\d\d/], ['HH:mm', /\d\d:\d\d/], ['HHmmss.SSSS', /\d\d\d\d\d\d\.\d+/], ['HHmmss,SSSS', /\d\d\d\d\d\d,\d+/], ['HHmmss', /\d\d\d\d\d\d/], ['HHmm', /\d\d\d\d/], ['HH', /\d\d/]],
    aspNetJsonRegex = /^\/?Date\((-?\d+)/i,
    rfc2822 = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,
    obsOffsets = {
      UT: 0,
      GMT: 0,
      EDT: -4 * 60,
      EST: -5 * 60,
      CDT: -5 * 60,
      CST: -6 * 60,
      MDT: -6 * 60,
      MST: -7 * 60,
      PDT: -7 * 60,
      PST: -8 * 60
    };
  function configFromISO(config) {
    var i,
      l,
      string = config._i,
      match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string),
      allowTime,
      dateFormat,
      timeFormat,
      tzFormat,
      isoDatesLen = isoDates.length,
      isoTimesLen = isoTimes.length;
    if (match) {
      getParsingFlags(config).iso = true;
      for (i = 0, l = isoDatesLen; i < l; i++) {
        if (isoDates[i][1].exec(match[1])) {
          dateFormat = isoDates[i][0];
          allowTime = isoDates[i][2] !== false;
          break;
        }
      }
      if (dateFormat == null) {
        config._isValid = false;
        return;
      }
      if (match[3]) {
        for (i = 0, l = isoTimesLen; i < l; i++) {
          if (isoTimes[i][1].exec(match[3])) {
            timeFormat = (match[2] || ' ') + isoTimes[i][0];
            break;
          }
        }
        if (timeFormat == null) {
          config._isValid = false;
          return;
        }
      }
      if (!allowTime && timeFormat != null) {
        config._isValid = false;
        return;
      }
      if (match[4]) {
        if (tzRegex.exec(match[4])) {
          tzFormat = 'Z';
        } else {
          config._isValid = false;
          return;
        }
      }
      config._f = dateFormat + (timeFormat || '') + (tzFormat || '');
      configFromStringAndFormat(config);
    } else {
      config._isValid = false;
    }
  }
  function extractFromRFC2822Strings(yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) {
    var result = [untruncateYear(yearStr), defaultLocaleMonthsShort.indexOf(monthStr), parseInt(dayStr, 10), parseInt(hourStr, 10), parseInt(minuteStr, 10)];
    if (secondStr) {
      result.push(parseInt(secondStr, 10));
    }
    return result;
  }
  function untruncateYear(yearStr) {
    var year = parseInt(yearStr, 10);
    if (year <= 49) {
      return 2000 + year;
    } else if (year <= 999) {
      return 1900 + year;
    }
    return year;
  }
  function preprocessRFC2822(s) {
    return s.replace(/\([^()]*\)|[\n\t]/g, ' ').replace(/(\s\s+)/g, ' ').replace(/^\s\s*/, '').replace(/\s\s*$/, '');
  }
  function checkWeekday(weekdayStr, parsedInput, config) {
    if (weekdayStr) {
      var weekdayProvided = defaultLocaleWeekdaysShort.indexOf(weekdayStr),
        weekdayActual = new Date(parsedInput[0], parsedInput[1], parsedInput[2]).getDay();
      if (weekdayProvided !== weekdayActual) {
        getParsingFlags(config).weekdayMismatch = true;
        config._isValid = false;
        return false;
      }
    }
    return true;
  }
  function calculateOffset(obsOffset, militaryOffset, numOffset) {
    if (obsOffset) {
      return obsOffsets[obsOffset];
    } else if (militaryOffset) {
      return 0;
    } else {
      var hm = parseInt(numOffset, 10),
        m = hm % 100,
        h = (hm - m) / 100;
      return h * 60 + m;
    }
  }
  function configFromRFC2822(config) {
    var match = rfc2822.exec(preprocessRFC2822(config._i)),
      parsedArray;
    if (match) {
      parsedArray = extractFromRFC2822Strings(match[4], match[3], match[2], match[5], match[6], match[7]);
      if (!checkWeekday(match[1], parsedArray, config)) {
        return;
      }
      config._a = parsedArray;
      config._tzm = calculateOffset(match[8], match[9], match[10]);
      config._d = createUTCDate.apply(null, config._a);
      config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
      getParsingFlags(config).rfc2822 = true;
    } else {
      config._isValid = false;
    }
  }
  function configFromString(config) {
    var matched = aspNetJsonRegex.exec(config._i);
    if (matched !== null) {
      config._d = new Date(+matched[1]);
      return;
    }
    configFromISO(config);
    if (config._isValid === false) {
      delete config._isValid;
    } else {
      return;
    }
    configFromRFC2822(config);
    if (config._isValid === false) {
      delete config._isValid;
    } else {
      return;
    }
    if (config._strict) {
      config._isValid = false;
    } else {
      hooks.createFromInputFallback(config);
    }
  }
  hooks.createFromInputFallback = deprecate('value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), ' + 'which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are ' + 'discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.', function (config) {
    config._d = new Date(config._i + (config._useUTC ? ' UTC' : ''));
  });
  function defaults(a, b, c) {
    if (a != null) {
      return a;
    }
    if (b != null) {
      return b;
    }
    return c;
  }
  function currentDateArray(config) {
    var nowValue = new Date(hooks.now());
    if (config._useUTC) {
      return [nowValue.getUTCFullYear(), nowValue.getUTCMonth(), nowValue.getUTCDate()];
    }
    return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()];
  }
  function configFromArray(config) {
    var i,
      date,
      input = [],
      currentDate,
      expectedWeekday,
      yearToUse;
    if (config._d) {
      return;
    }
    currentDate = currentDateArray(config);
    if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {
      dayOfYearFromWeekInfo(config);
    }
    if (config._dayOfYear != null) {
      yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);
      if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) {
        getParsingFlags(config)._overflowDayOfYear = true;
      }
      date = createUTCDate(yearToUse, 0, config._dayOfYear);
      config._a[MONTH] = date.getUTCMonth();
      config._a[DATE] = date.getUTCDate();
    }
    for (i = 0; i < 3 && config._a[i] == null; ++i) {
      config._a[i] = input[i] = currentDate[i];
    }
    for (; i < 7; i++) {
      config._a[i] = input[i] = config._a[i] == null ? i === 2 ? 1 : 0 : config._a[i];
    }
    if (config._a[HOUR] === 24 && config._a[MINUTE] === 0 && config._a[SECOND] === 0 && config._a[MILLISECOND] === 0) {
      config._nextDay = true;
      config._a[HOUR] = 0;
    }
    config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);
    expectedWeekday = config._useUTC ? config._d.getUTCDay() : config._d.getDay();
    if (config._tzm != null) {
      config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
    }
    if (config._nextDay) {
      config._a[HOUR] = 24;
    }
    if (config._w && typeof config._w.d !== 'undefined' && config._w.d !== expectedWeekday) {
      getParsingFlags(config).weekdayMismatch = true;
    }
  }
  function dayOfYearFromWeekInfo(config) {
    var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow, curWeek;
    w = config._w;
    if (w.GG != null || w.W != null || w.E != null) {
      dow = 1;
      doy = 4;
      weekYear = defaults(w.GG, config._a[YEAR], weekOfYear(createLocal(), 1, 4).year);
      week = defaults(w.W, 1);
      weekday = defaults(w.E, 1);
      if (weekday < 1 || weekday > 7) {
        weekdayOverflow = true;
      }
    } else {
      dow = config._locale._week.dow;
      doy = config._locale._week.doy;
      curWeek = weekOfYear(createLocal(), dow, doy);
      weekYear = defaults(w.gg, config._a[YEAR], curWeek.year);
      week = defaults(w.w, curWeek.week);
      if (w.d != null) {
        weekday = w.d;
        if (weekday < 0 || weekday > 6) {
          weekdayOverflow = true;
        }
      } else if (w.e != null) {
        weekday = w.e + dow;
        if (w.e < 0 || w.e > 6) {
          weekdayOverflow = true;
        }
      } else {
        weekday = dow;
      }
    }
    if (week < 1 || week > weeksInYear(weekYear, dow, doy)) {
      getParsingFlags(config)._overflowWeeks = true;
    } else if (weekdayOverflow != null) {
      getParsingFlags(config)._overflowWeekday = true;
    } else {
      temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy);
      config._a[YEAR] = temp.year;
      config._dayOfYear = temp.dayOfYear;
    }
  }
  hooks.ISO_8601 = function () {};
  hooks.RFC_2822 = function () {};
  function configFromStringAndFormat(config) {
    if (config._f === hooks.ISO_8601) {
      configFromISO(config);
      return;
    }
    if (config._f === hooks.RFC_2822) {
      configFromRFC2822(config);
      return;
    }
    config._a = [];
    getParsingFlags(config).empty = true;
    var string = '' + config._i,
      i,
      parsedInput,
      tokens,
      token,
      skipped,
      stringLength = string.length,
      totalParsedInputLength = 0,
      era,
      tokenLen;
    tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];
    tokenLen = tokens.length;
    for (i = 0; i < tokenLen; i++) {
      token = tokens[i];
      parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];
      if (parsedInput) {
        skipped = string.substr(0, string.indexOf(parsedInput));
        if (skipped.length > 0) {
          getParsingFlags(config).unusedInput.push(skipped);
        }
        string = string.slice(string.indexOf(parsedInput) + parsedInput.length);
        totalParsedInputLength += parsedInput.length;
      }
      if (formatTokenFunctions[token]) {
        if (parsedInput) {
          getParsingFlags(config).empty = false;
        } else {
          getParsingFlags(config).unusedTokens.push(token);
        }
        addTimeToArrayFromToken(token, parsedInput, config);
      } else if (config._strict && !parsedInput) {
        getParsingFlags(config).unusedTokens.push(token);
      }
    }
    getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;
    if (string.length > 0) {
      getParsingFlags(config).unusedInput.push(string);
    }
    if (config._a[HOUR] <= 12 && getParsingFlags(config).bigHour === true && config._a[HOUR] > 0) {
      getParsingFlags(config).bigHour = undefined;
    }
    getParsingFlags(config).parsedDateParts = config._a.slice(0);
    getParsingFlags(config).meridiem = config._meridiem;
    config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);
    era = getParsingFlags(config).era;
    if (era !== null) {
      config._a[YEAR] = config._locale.erasConvertYear(era, config._a[YEAR]);
    }
    configFromArray(config);
    checkOverflow(config);
  }
  function meridiemFixWrap(locale, hour, meridiem) {
    var isPm;
    if (meridiem == null) {
      return hour;
    }
    if (locale.meridiemHour != null) {
      return locale.meridiemHour(hour, meridiem);
    } else if (locale.isPM != null) {
      isPm = locale.isPM(meridiem);
      if (isPm && hour < 12) {
        hour += 12;
      }
      if (!isPm && hour === 12) {
        hour = 0;
      }
      return hour;
    } else {
      return hour;
    }
  }
  function configFromStringAndArray(config) {
    var tempConfig,
      bestMoment,
      scoreToBeat,
      i,
      currentScore,
      validFormatFound,
      bestFormatIsValid = false,
      configfLen = config._f.length;
    if (configfLen === 0) {
      getParsingFlags(config).invalidFormat = true;
      config._d = new Date(NaN);
      return;
    }
    for (i = 0; i < configfLen; i++) {
      currentScore = 0;
      validFormatFound = false;
      tempConfig = copyConfig({}, config);
      if (config._useUTC != null) {
        tempConfig._useUTC = config._useUTC;
      }
      tempConfig._f = config._f[i];
      configFromStringAndFormat(tempConfig);
      if (isValid(tempConfig)) {
        validFormatFound = true;
      }
      currentScore += getParsingFlags(tempConfig).charsLeftOver;
      currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10;
      getParsingFlags(tempConfig).score = currentScore;
      if (!bestFormatIsValid) {
        if (scoreToBeat == null || currentScore < scoreToBeat || validFormatFound) {
          scoreToBeat = currentScore;
          bestMoment = tempConfig;
          if (validFormatFound) {
            bestFormatIsValid = true;
          }
        }
      } else {
        if (currentScore < scoreToBeat) {
          scoreToBeat = currentScore;
          bestMoment = tempConfig;
        }
      }
    }
    extend(config, bestMoment || tempConfig);
  }
  function configFromObject(config) {
    if (config._d) {
      return;
    }
    var i = normalizeObjectUnits(config._i),
      dayOrDate = i.day === undefined ? i.date : i.day;
    config._a = map([i.year, i.month, dayOrDate, i.hour, i.minute, i.second, i.millisecond], function (obj) {
      return obj && parseInt(obj, 10);
    });
    configFromArray(config);
  }
  function createFromConfig(config) {
    var res = new Moment(checkOverflow(prepareConfig(config)));
    if (res._nextDay) {
      res.add(1, 'd');
      res._nextDay = undefined;
    }
    return res;
  }
  function prepareConfig(config) {
    var input = config._i,
      format = config._f;
    config._locale = config._locale || getLocale(config._l);
    if (input === null || format === undefined && input === '') {
      return createInvalid({
        nullInput: true
      });
    }
    if (typeof input === 'string') {
      config._i = input = config._locale.preparse(input);
    }
    if (isMoment(input)) {
      return new Moment(checkOverflow(input));
    } else if (isDate(input)) {
      config._d = input;
    } else if (isArray(format)) {
      configFromStringAndArray(config);
    } else if (format) {
      configFromStringAndFormat(config);
    } else {
      configFromInput(config);
    }
    if (!isValid(config)) {
      config._d = null;
    }
    return config;
  }
  function configFromInput(config) {
    var input = config._i;
    if (isUndefined(input)) {
      config._d = new Date(hooks.now());
    } else if (isDate(input)) {
      config._d = new Date(input.valueOf());
    } else if (typeof input === 'string') {
      configFromString(config);
    } else if (isArray(input)) {
      config._a = map(input.slice(0), function (obj) {
        return parseInt(obj, 10);
      });
      configFromArray(config);
    } else if (isObject(input)) {
      configFromObject(config);
    } else if (isNumber(input)) {
      config._d = new Date(input);
    } else {
      hooks.createFromInputFallback(config);
    }
  }
  function createLocalOrUTC(input, format, locale, strict, isUTC) {
    var c = {};
    if (format === true || format === false) {
      strict = format;
      format = undefined;
    }
    if (locale === true || locale === false) {
      strict = locale;
      locale = undefined;
    }
    if (isObject(input) && isObjectEmpty(input) || isArray(input) && input.length === 0) {
      input = undefined;
    }
    c._isAMomentObject = true;
    c._useUTC = c._isUTC = isUTC;
    c._l = locale;
    c._i = input;
    c._f = format;
    c._strict = strict;
    return createFromConfig(c);
  }
  function createLocal(input, format, locale, strict) {
    return createLocalOrUTC(input, format, locale, strict, false);
  }
  var prototypeMin = deprecate('moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/', function () {
      var other = createLocal.apply(null, arguments);
      if (this.isValid() && other.isValid()) {
        return other < this ? this : other;
      } else {
        return createInvalid();
      }
    }),
    prototypeMax = deprecate('moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/', function () {
      var other = createLocal.apply(null, arguments);
      if (this.isValid() && other.isValid()) {
        return other > this ? this : other;
      } else {
        return createInvalid();
      }
    });
  function pickBy(fn, moments) {
    var res, i;
    if (moments.length === 1 && isArray(moments[0])) {
      moments = moments[0];
    }
    if (!moments.length) {
      return createLocal();
    }
    res = moments[0];
    for (i = 1; i < moments.length; ++i) {
      if (!moments[i].isValid() || moments[i][fn](res)) {
        res = moments[i];
      }
    }
    return res;
  }
  function min() {
    var args = [].slice.call(arguments, 0);
    return pickBy('isBefore', args);
  }
  function max() {
    var args = [].slice.call(arguments, 0);
    return pickBy('isAfter', args);
  }
  var now = function now() {
    return Date.now ? Date.now() : +new Date();
  };
  var ordering = ['year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', 'millisecond'];
  function isDurationValid(m) {
    var key,
      unitHasDecimal = false,
      i,
      orderLen = ordering.length;
    for (key in m) {
      if (hasOwnProp(m, key) && !(indexOf.call(ordering, key) !== -1 && (m[key] == null || !isNaN(m[key])))) {
        return false;
      }
    }
    for (i = 0; i < orderLen; ++i) {
      if (m[ordering[i]]) {
        if (unitHasDecimal) {
          return false;
        }
        if (parseFloat(m[ordering[i]]) !== toInt(m[ordering[i]])) {
          unitHasDecimal = true;
        }
      }
    }
    return true;
  }
  function isValid$1() {
    return this._isValid;
  }
  function createInvalid$1() {
    return createDuration(NaN);
  }
  function Duration(duration) {
    var normalizedInput = normalizeObjectUnits(duration),
      years = normalizedInput.year || 0,
      quarters = normalizedInput.quarter || 0,
      months = normalizedInput.month || 0,
      weeks = normalizedInput.week || normalizedInput.isoWeek || 0,
      days = normalizedInput.day || 0,
      hours = normalizedInput.hour || 0,
      minutes = normalizedInput.minute || 0,
      seconds = normalizedInput.second || 0,
      milliseconds = normalizedInput.millisecond || 0;
    this._isValid = isDurationValid(normalizedInput);
    this._milliseconds = +milliseconds + seconds * 1e3 + minutes * 6e4 + hours * 1000 * 60 * 60;
    this._days = +days + weeks * 7;
    this._months = +months + quarters * 3 + years * 12;
    this._data = {};
    this._locale = getLocale();
    this._bubble();
  }
  function isDuration(obj) {
    return obj instanceof Duration;
  }
  function absRound(number) {
    if (number < 0) {
      return Math.round(-1 * number) * -1;
    } else {
      return Math.round(number);
    }
  }
  function compareArrays(array1, array2, dontConvert) {
    var len = Math.min(array1.length, array2.length),
      lengthDiff = Math.abs(array1.length - array2.length),
      diffs = 0,
      i;
    for (i = 0; i < len; i++) {
      if (dontConvert && array1[i] !== array2[i] || !dontConvert && toInt(array1[i]) !== toInt(array2[i])) {
        diffs++;
      }
    }
    return diffs + lengthDiff;
  }
  function offset(token, separator) {
    addFormatToken(token, 0, 0, function () {
      var offset = this.utcOffset(),
        sign = '+';
      if (offset < 0) {
        offset = -offset;
        sign = '-';
      }
      return sign + zeroFill(~~(offset / 60), 2) + separator + zeroFill(~~offset % 60, 2);
    });
  }
  offset('Z', ':');
  offset('ZZ', '');
  addRegexToken('Z', matchShortOffset);
  addRegexToken('ZZ', matchShortOffset);
  addParseToken(['Z', 'ZZ'], function (input, array, config) {
    config._useUTC = true;
    config._tzm = offsetFromString(matchShortOffset, input);
  });
  var chunkOffset = /([\+\-]|\d\d)/gi;
  function offsetFromString(matcher, string) {
    var matches = (string || '').match(matcher),
      chunk,
      parts,
      minutes;
    if (matches === null) {
      return null;
    }
    chunk = matches[matches.length - 1] || [];
    parts = (chunk + '').match(chunkOffset) || ['-', 0, 0];
    minutes = +(parts[1] * 60) + toInt(parts[2]);
    return minutes === 0 ? 0 : parts[0] === '+' ? minutes : -minutes;
  }
  function cloneWithOffset(input, model) {
    var res, diff;
    if (model._isUTC) {
      res = model.clone();
      diff = (isMoment(input) || isDate(input) ? input.valueOf() : createLocal(input).valueOf()) - res.valueOf();
      res._d.setTime(res._d.valueOf() + diff);
      hooks.updateOffset(res, false);
      return res;
    } else {
      return createLocal(input).local();
    }
  }
  function getDateOffset(m) {
    return -Math.round(m._d.getTimezoneOffset());
  }
  hooks.updateOffset = function () {};
  function getSetOffset(input, keepLocalTime, keepMinutes) {
    var offset = this._offset || 0,
      localAdjust;
    if (!this.isValid()) {
      return input != null ? this : NaN;
    }
    if (input != null) {
      if (typeof input === 'string') {
        input = offsetFromString(matchShortOffset, input);
        if (input === null) {
          return this;
        }
      } else if (Math.abs(input) < 16 && !keepMinutes) {
        input = input * 60;
      }
      if (!this._isUTC && keepLocalTime) {
        localAdjust = getDateOffset(this);
      }
      this._offset = input;
      this._isUTC = true;
      if (localAdjust != null) {
        this.add(localAdjust, 'm');
      }
      if (offset !== input) {
        if (!keepLocalTime || this._changeInProgress) {
          addSubtract(this, createDuration(input - offset, 'm'), 1, false);
        } else if (!this._changeInProgress) {
          this._changeInProgress = true;
          hooks.updateOffset(this, true);
          this._changeInProgress = null;
        }
      }
      return this;
    } else {
      return this._isUTC ? offset : getDateOffset(this);
    }
  }
  function getSetZone(input, keepLocalTime) {
    if (input != null) {
      if (typeof input !== 'string') {
        input = -input;
      }
      this.utcOffset(input, keepLocalTime);
      return this;
    } else {
      return -this.utcOffset();
    }
  }
  function setOffsetToUTC(keepLocalTime) {
    return this.utcOffset(0, keepLocalTime);
  }
  function setOffsetToLocal(keepLocalTime) {
    if (this._isUTC) {
      this.utcOffset(0, keepLocalTime);
      this._isUTC = false;
      if (keepLocalTime) {
        this.subtract(getDateOffset(this), 'm');
      }
    }
    return this;
  }
  function setOffsetToParsedOffset() {
    if (this._tzm != null) {
      this.utcOffset(this._tzm, false, true);
    } else if (typeof this._i === 'string') {
      var tZone = offsetFromString(matchOffset, this._i);
      if (tZone != null) {
        this.utcOffset(tZone);
      } else {
        this.utcOffset(0, true);
      }
    }
    return this;
  }
  function hasAlignedHourOffset(input) {
    if (!this.isValid()) {
      return false;
    }
    input = input ? createLocal(input).utcOffset() : 0;
    return (this.utcOffset() - input) % 60 === 0;
  }
  function isDaylightSavingTime() {
    return this.utcOffset() > this.clone().month(0).utcOffset() || this.utcOffset() > this.clone().month(5).utcOffset();
  }
  function isDaylightSavingTimeShifted() {
    if (!isUndefined(this._isDSTShifted)) {
      return this._isDSTShifted;
    }
    var c = {},
      other;
    copyConfig(c, this);
    c = prepareConfig(c);
    if (c._a) {
      other = c._isUTC ? createUTC(c._a) : createLocal(c._a);
      this._isDSTShifted = this.isValid() && compareArrays(c._a, other.toArray()) > 0;
    } else {
      this._isDSTShifted = false;
    }
    return this._isDSTShifted;
  }
  function isLocal() {
    return this.isValid() ? !this._isUTC : false;
  }
  function isUtcOffset() {
    return this.isValid() ? this._isUTC : false;
  }
  function isUtc() {
    return this.isValid() ? this._isUTC && this._offset === 0 : false;
  }
  var aspNetRegex = /^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,
    isoRegex = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;
  function createDuration(input, key) {
    var duration = input,
      match = null,
      sign,
      ret,
      diffRes;
    if (isDuration(input)) {
      duration = {
        ms: input._milliseconds,
        d: input._days,
        M: input._months
      };
    } else if (isNumber(input) || !isNaN(+input)) {
      duration = {};
      if (key) {
        duration[key] = +input;
      } else {
        duration.milliseconds = +input;
      }
    } else if (match = aspNetRegex.exec(input)) {
      sign = match[1] === '-' ? -1 : 1;
      duration = {
        y: 0,
        d: toInt(match[DATE]) * sign,
        h: toInt(match[HOUR]) * sign,
        m: toInt(match[MINUTE]) * sign,
        s: toInt(match[SECOND]) * sign,
        ms: toInt(absRound(match[MILLISECOND] * 1000)) * sign
      };
    } else if (match = isoRegex.exec(input)) {
      sign = match[1] === '-' ? -1 : 1;
      duration = {
        y: parseIso(match[2], sign),
        M: parseIso(match[3], sign),
        w: parseIso(match[4], sign),
        d: parseIso(match[5], sign),
        h: parseIso(match[6], sign),
        m: parseIso(match[7], sign),
        s: parseIso(match[8], sign)
      };
    } else if (duration == null) {
      duration = {};
    } else if (typeof duration === 'object' && ('from' in duration || 'to' in duration)) {
      diffRes = momentsDifference(createLocal(duration.from), createLocal(duration.to));
      duration = {};
      duration.ms = diffRes.milliseconds;
      duration.M = diffRes.months;
    }
    ret = new Duration(duration);
    if (isDuration(input) && hasOwnProp(input, '_locale')) {
      ret._locale = input._locale;
    }
    if (isDuration(input) && hasOwnProp(input, '_isValid')) {
      ret._isValid = input._isValid;
    }
    return ret;
  }
  createDuration.fn = Duration.prototype;
  createDuration.invalid = createInvalid$1;
  function parseIso(inp, sign) {
    var res = inp && parseFloat(inp.replace(',', '.'));
    return (isNaN(res) ? 0 : res) * sign;
  }
  function positiveMomentsDifference(base, other) {
    var res = {};
    res.months = other.month() - base.month() + (other.year() - base.year()) * 12;
    if (base.clone().add(res.months, 'M').isAfter(other)) {
      --res.months;
    }
    res.milliseconds = +other - +base.clone().add(res.months, 'M');
    return res;
  }
  function momentsDifference(base, other) {
    var res;
    if (!(base.isValid() && other.isValid())) {
      return {
        milliseconds: 0,
        months: 0
      };
    }
    other = cloneWithOffset(other, base);
    if (base.isBefore(other)) {
      res = positiveMomentsDifference(base, other);
    } else {
      res = positiveMomentsDifference(other, base);
      res.milliseconds = -res.milliseconds;
      res.months = -res.months;
    }
    return res;
  }
  function createAdder(direction, name) {
    return function (val, period) {
      var dur, tmp;
      if (period !== null && !isNaN(+period)) {
        deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' + 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');
        tmp = val;
        val = period;
        period = tmp;
      }
      dur = createDuration(val, period);
      addSubtract(this, dur, direction);
      return this;
    };
  }
  function addSubtract(mom, duration, isAdding, updateOffset) {
    var milliseconds = duration._milliseconds,
      days = absRound(duration._days),
      months = absRound(duration._months);
    if (!mom.isValid()) {
      return;
    }
    updateOffset = updateOffset == null ? true : updateOffset;
    if (months) {
      setMonth(mom, get(mom, 'Month') + months * isAdding);
    }
    if (days) {
      set$1(mom, 'Date', get(mom, 'Date') + days * isAdding);
    }
    if (milliseconds) {
      mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding);
    }
    if (updateOffset) {
      hooks.updateOffset(mom, days || months);
    }
  }
  var add = createAdder(1, 'add'),
    subtract = createAdder(-1, 'subtract');
  function isString(input) {
    return typeof input === 'string' || input instanceof String;
  }
  function isMomentInput(input) {
    return isMoment(input) || isDate(input) || isString(input) || isNumber(input) || isNumberOrStringArray(input) || isMomentInputObject(input) || input === null || input === undefined;
  }
  function isMomentInputObject(input) {
    var objectTest = isObject(input) && !isObjectEmpty(input),
      propertyTest = false,
      properties = ['years', 'year', 'y', 'months', 'month', 'M', 'days', 'day', 'd', 'dates', 'date', 'D', 'hours', 'hour', 'h', 'minutes', 'minute', 'm', 'seconds', 'second', 's', 'milliseconds', 'millisecond', 'ms'],
      i,
      property,
      propertyLen = properties.length;
    for (i = 0; i < propertyLen; i += 1) {
      property = properties[i];
      propertyTest = propertyTest || hasOwnProp(input, property);
    }
    return objectTest && propertyTest;
  }
  function isNumberOrStringArray(input) {
    var arrayTest = isArray(input),
      dataTypeTest = false;
    if (arrayTest) {
      dataTypeTest = input.filter(function (item) {
        return !isNumber(item) && isString(input);
      }).length === 0;
    }
    return arrayTest && dataTypeTest;
  }
  function isCalendarSpec(input) {
    var objectTest = isObject(input) && !isObjectEmpty(input),
      propertyTest = false,
      properties = ['sameDay', 'nextDay', 'lastDay', 'nextWeek', 'lastWeek', 'sameElse'],
      i,
      property;
    for (i = 0; i < properties.length; i += 1) {
      property = properties[i];
      propertyTest = propertyTest || hasOwnProp(input, property);
    }
    return objectTest && propertyTest;
  }
  function getCalendarFormat(myMoment, now) {
    var diff = myMoment.diff(now, 'days', true);
    return diff < -6 ? 'sameElse' : diff < -1 ? 'lastWeek' : diff < 0 ? 'lastDay' : diff < 1 ? 'sameDay' : diff < 2 ? 'nextDay' : diff < 7 ? 'nextWeek' : 'sameElse';
  }
  function calendar$1(time, formats) {
    if (arguments.length === 1) {
      if (!arguments[0]) {
        time = undefined;
        formats = undefined;
      } else if (isMomentInput(arguments[0])) {
        time = arguments[0];
        formats = undefined;
      } else if (isCalendarSpec(arguments[0])) {
        formats = arguments[0];
        time = undefined;
      }
    }
    var now = time || createLocal(),
      sod = cloneWithOffset(now, this).startOf('day'),
      format = hooks.calendarFormat(this, sod) || 'sameElse',
      output = formats && (isFunction(formats[format]) ? formats[format].call(this, now) : formats[format]);
    return this.format(output || this.localeData().calendar(format, this, createLocal(now)));
  }
  function clone() {
    return new Moment(this);
  }
  function isAfter(input, units) {
    var localInput = isMoment(input) ? input : createLocal(input);
    if (!(this.isValid() && localInput.isValid())) {
      return false;
    }
    units = normalizeUnits(units) || 'millisecond';
    if (units === 'millisecond') {
      return this.valueOf() > localInput.valueOf();
    } else {
      return localInput.valueOf() < this.clone().startOf(units).valueOf();
    }
  }
  function isBefore(input, units) {
    var localInput = isMoment(input) ? input : createLocal(input);
    if (!(this.isValid() && localInput.isValid())) {
      return false;
    }
    units = normalizeUnits(units) || 'millisecond';
    if (units === 'millisecond') {
      return this.valueOf() < localInput.valueOf();
    } else {
      return this.clone().endOf(units).valueOf() < localInput.valueOf();
    }
  }
  function isBetween(from, to, units, inclusivity) {
    var localFrom = isMoment(from) ? from : createLocal(from),
      localTo = isMoment(to) ? to : createLocal(to);
    if (!(this.isValid() && localFrom.isValid() && localTo.isValid())) {
      return false;
    }
    inclusivity = inclusivity || '()';
    return (inclusivity[0] === '(' ? this.isAfter(localFrom, units) : !this.isBefore(localFrom, units)) && (inclusivity[1] === ')' ? this.isBefore(localTo, units) : !this.isAfter(localTo, units));
  }
  function isSame(input, units) {
    var localInput = isMoment(input) ? input : createLocal(input),
      inputMs;
    if (!(this.isValid() && localInput.isValid())) {
      return false;
    }
    units = normalizeUnits(units) || 'millisecond';
    if (units === 'millisecond') {
      return this.valueOf() === localInput.valueOf();
    } else {
      inputMs = localInput.valueOf();
      return this.clone().startOf(units).valueOf() <= inputMs && inputMs <= this.clone().endOf(units).valueOf();
    }
  }
  function isSameOrAfter(input, units) {
    return this.isSame(input, units) || this.isAfter(input, units);
  }
  function isSameOrBefore(input, units) {
    return this.isSame(input, units) || this.isBefore(input, units);
  }
  function diff(input, units, asFloat) {
    var that, zoneDelta, output;
    if (!this.isValid()) {
      return NaN;
    }
    that = cloneWithOffset(input, this);
    if (!that.isValid()) {
      return NaN;
    }
    zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4;
    units = normalizeUnits(units);
    switch (units) {
      case 'year':
        output = monthDiff(this, that) / 12;
        break;
      case 'month':
        output = monthDiff(this, that);
        break;
      case 'quarter':
        output = monthDiff(this, that) / 3;
        break;
      case 'second':
        output = (this - that) / 1e3;
        break;
      case 'minute':
        output = (this - that) / 6e4;
        break;
      case 'hour':
        output = (this - that) / 36e5;
        break;
      case 'day':
        output = (this - that - zoneDelta) / 864e5;
        break;
      case 'week':
        output = (this - that - zoneDelta) / 6048e5;
        break;
      default:
        output = this - that;
    }
    return asFloat ? output : absFloor(output);
  }
  function monthDiff(a, b) {
    if (a.date() < b.date()) {
      return -monthDiff(b, a);
    }
    var wholeMonthDiff = (b.year() - a.year()) * 12 + (b.month() - a.month()),
      anchor = a.clone().add(wholeMonthDiff, 'months'),
      anchor2,
      adjust;
    if (b - anchor < 0) {
      anchor2 = a.clone().add(wholeMonthDiff - 1, 'months');
      adjust = (b - anchor) / (anchor - anchor2);
    } else {
      anchor2 = a.clone().add(wholeMonthDiff + 1, 'months');
      adjust = (b - anchor) / (anchor2 - anchor);
    }
    return -(wholeMonthDiff + adjust) || 0;
  }
  hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ';
  hooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]';
  function toString() {
    return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ');
  }
  function toISOString(keepOffset) {
    if (!this.isValid()) {
      return null;
    }
    var utc = keepOffset !== true,
      m = utc ? this.clone().utc() : this;
    if (m.year() < 0 || m.year() > 9999) {
      return formatMoment(m, utc ? 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYYYY-MM-DD[T]HH:mm:ss.SSSZ');
    }
    if (isFunction(Date.prototype.toISOString)) {
      if (utc) {
        return this.toDate().toISOString();
      } else {
        return new Date(this.valueOf() + this.utcOffset() * 60 * 1000).toISOString().replace('Z', formatMoment(m, 'Z'));
      }
    }
    return formatMoment(m, utc ? 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYY-MM-DD[T]HH:mm:ss.SSSZ');
  }
  function inspect() {
    if (!this.isValid()) {
      return 'moment.invalid(/* ' + this._i + ' */)';
    }
    var func = 'moment',
      zone = '',
      prefix,
      year,
      datetime,
      suffix;
    if (!this.isLocal()) {
      func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';
      zone = 'Z';
    }
    prefix = '[' + func + '("]';
    year = 0 <= this.year() && this.year() <= 9999 ? 'YYYY' : 'YYYYYY';
    datetime = '-MM-DD[T]HH:mm:ss.SSS';
    suffix = zone + '[")]';
    return this.format(prefix + year + datetime + suffix);
  }
  function format(inputString) {
    if (!inputString) {
      inputString = this.isUtc() ? hooks.defaultFormatUtc : hooks.defaultFormat;
    }
    var output = formatMoment(this, inputString);
    return this.localeData().postformat(output);
  }
  function from(time, withoutSuffix) {
    if (this.isValid() && (isMoment(time) && time.isValid() || createLocal(time).isValid())) {
      return createDuration({
        to: this,
        from: time
      }).locale(this.locale()).humanize(!withoutSuffix);
    } else {
      return this.localeData().invalidDate();
    }
  }
  function fromNow(withoutSuffix) {
    return this.from(createLocal(), withoutSuffix);
  }
  function to(time, withoutSuffix) {
    if (this.isValid() && (isMoment(time) && time.isValid() || createLocal(time).isValid())) {
      return createDuration({
        from: this,
        to: time
      }).locale(this.locale()).humanize(!withoutSuffix);
    } else {
      return this.localeData().invalidDate();
    }
  }
  function toNow(withoutSuffix) {
    return this.to(createLocal(), withoutSuffix);
  }
  function locale(key) {
    var newLocaleData;
    if (key === undefined) {
      return this._locale._abbr;
    } else {
      newLocaleData = getLocale(key);
      if (newLocaleData != null) {
        this._locale = newLocaleData;
      }
      return this;
    }
  }
  var lang = deprecate('moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.', function (key) {
    if (key === undefined) {
      return this.localeData();
    } else {
      return this.locale(key);
    }
  });
  function localeData() {
    return this._locale;
  }
  var MS_PER_SECOND = 1000,
    MS_PER_MINUTE = 60 * MS_PER_SECOND,
    MS_PER_HOUR = 60 * MS_PER_MINUTE,
    MS_PER_400_YEARS = (365 * 400 + 97) * 24 * MS_PER_HOUR;
  function mod$1(dividend, divisor) {
    return (dividend % divisor + divisor) % divisor;
  }
  function localStartOfDate(y, m, d) {
    if (y < 100 && y >= 0) {
      return new Date(y + 400, m, d) - MS_PER_400_YEARS;
    } else {
      return new Date(y, m, d).valueOf();
    }
  }
  function utcStartOfDate(y, m, d) {
    if (y < 100 && y >= 0) {
      return Date.UTC(y + 400, m, d) - MS_PER_400_YEARS;
    } else {
      return Date.UTC(y, m, d);
    }
  }
  function startOf(units) {
    var time, startOfDate;
    units = normalizeUnits(units);
    if (units === undefined || units === 'millisecond' || !this.isValid()) {
      return this;
    }
    startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;
    switch (units) {
      case 'year':
        time = startOfDate(this.year(), 0, 1);
        break;
      case 'quarter':
        time = startOfDate(this.year(), this.month() - this.month() % 3, 1);
        break;
      case 'month':
        time = startOfDate(this.year(), this.month(), 1);
        break;
      case 'week':
        time = startOfDate(this.year(), this.month(), this.date() - this.weekday());
        break;
      case 'isoWeek':
        time = startOfDate(this.year(), this.month(), this.date() - (this.isoWeekday() - 1));
        break;
      case 'day':
      case 'date':
        time = startOfDate(this.year(), this.month(), this.date());
        break;
      case 'hour':
        time = this._d.valueOf();
        time -= mod$1(time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE), MS_PER_HOUR);
        break;
      case 'minute':
        time = this._d.valueOf();
        time -= mod$1(time, MS_PER_MINUTE);
        break;
      case 'second':
        time = this._d.valueOf();
        time -= mod$1(time, MS_PER_SECOND);
        break;
    }
    this._d.setTime(time);
    hooks.updateOffset(this, true);
    return this;
  }
  function endOf(units) {
    var time, startOfDate;
    units = normalizeUnits(units);
    if (units === undefined || units === 'millisecond' || !this.isValid()) {
      return this;
    }
    startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;
    switch (units) {
      case 'year':
        time = startOfDate(this.year() + 1, 0, 1) - 1;
        break;
      case 'quarter':
        time = startOfDate(this.year(), this.month() - this.month() % 3 + 3, 1) - 1;
        break;
      case 'month':
        time = startOfDate(this.year(), this.month() + 1, 1) - 1;
        break;
      case 'week':
        time = startOfDate(this.year(), this.month(), this.date() - this.weekday() + 7) - 1;
        break;
      case 'isoWeek':
        time = startOfDate(this.year(), this.month(), this.date() - (this.isoWeekday() - 1) + 7) - 1;
        break;
      case 'day':
      case 'date':
        time = startOfDate(this.year(), this.month(), this.date() + 1) - 1;
        break;
      case 'hour':
        time = this._d.valueOf();
        time += MS_PER_HOUR - mod$1(time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE), MS_PER_HOUR) - 1;
        break;
      case 'minute':
        time = this._d.valueOf();
        time += MS_PER_MINUTE - mod$1(time, MS_PER_MINUTE) - 1;
        break;
      case 'second':
        time = this._d.valueOf();
        time += MS_PER_SECOND - mod$1(time, MS_PER_SECOND) - 1;
        break;
    }
    this._d.setTime(time);
    hooks.updateOffset(this, true);
    return this;
  }
  function valueOf() {
    return this._d.valueOf() - (this._offset || 0) * 60000;
  }
  function unix() {
    return Math.floor(this.valueOf() / 1000);
  }
  function toDate() {
    return new Date(this.valueOf());
  }
  function toArray() {
    var m = this;
    return [m.year(), m.month(), m.date(), m.hour(), m.minute(), m.second(), m.millisecond()];
  }
  function toObject() {
    var m = this;
    return {
      years: m.year(),
      months: m.month(),
      date: m.date(),
      hours: m.hours(),
      minutes: m.minutes(),
      seconds: m.seconds(),
      milliseconds: m.milliseconds()
    };
  }
  function toJSON() {
    return this.isValid() ? this.toISOString() : null;
  }
  function isValid$2() {
    return isValid(this);
  }
  function parsingFlags() {
    return extend({}, getParsingFlags(this));
  }
  function invalidAt() {
    return getParsingFlags(this).overflow;
  }
  function creationData() {
    return {
      input: this._i,
      format: this._f,
      locale: this._locale,
      isUTC: this._isUTC,
      strict: this._strict
    };
  }
  addFormatToken('N', 0, 0, 'eraAbbr');
  addFormatToken('NN', 0, 0, 'eraAbbr');
  addFormatToken('NNN', 0, 0, 'eraAbbr');
  addFormatToken('NNNN', 0, 0, 'eraName');
  addFormatToken('NNNNN', 0, 0, 'eraNarrow');
  addFormatToken('y', ['y', 1], 'yo', 'eraYear');
  addFormatToken('y', ['yy', 2], 0, 'eraYear');
  addFormatToken('y', ['yyy', 3], 0, 'eraYear');
  addFormatToken('y', ['yyyy', 4], 0, 'eraYear');
  addRegexToken('N', matchEraAbbr);
  addRegexToken('NN', matchEraAbbr);
  addRegexToken('NNN', matchEraAbbr);
  addRegexToken('NNNN', matchEraName);
  addRegexToken('NNNNN', matchEraNarrow);
  addParseToken(['N', 'NN', 'NNN', 'NNNN', 'NNNNN'], function (input, array, config, token) {
    var era = config._locale.erasParse(input, token, config._strict);
    if (era) {
      getParsingFlags(config).era = era;
    } else {
      getParsingFlags(config).invalidEra = input;
    }
  });
  addRegexToken('y', matchUnsigned);
  addRegexToken('yy', matchUnsigned);
  addRegexToken('yyy', matchUnsigned);
  addRegexToken('yyyy', matchUnsigned);
  addRegexToken('yo', matchEraYearOrdinal);
  addParseToken(['y', 'yy', 'yyy', 'yyyy'], YEAR);
  addParseToken(['yo'], function (input, array, config, token) {
    var match;
    if (config._locale._eraYearOrdinalRegex) {
      match = input.match(config._locale._eraYearOrdinalRegex);
    }
    if (config._locale.eraYearOrdinalParse) {
      array[YEAR] = config._locale.eraYearOrdinalParse(input, match);
    } else {
      array[YEAR] = parseInt(input, 10);
    }
  });
  function localeEras(m, format) {
    var i,
      l,
      date,
      eras = this._eras || getLocale('en')._eras;
    for (i = 0, l = eras.length; i < l; ++i) {
      switch (typeof eras[i].since) {
        case 'string':
          date = hooks(eras[i].since).startOf('day');
          eras[i].since = date.valueOf();
          break;
      }
      switch (typeof eras[i].until) {
        case 'undefined':
          eras[i].until = +Infinity;
          break;
        case 'string':
          date = hooks(eras[i].until).startOf('day').valueOf();
          eras[i].until = date.valueOf();
          break;
      }
    }
    return eras;
  }
  function localeErasParse(eraName, format, strict) {
    var i,
      l,
      eras = this.eras(),
      name,
      abbr,
      narrow;
    eraName = eraName.toUpperCase();
    for (i = 0, l = eras.length; i < l; ++i) {
      name = eras[i].name.toUpperCase();
      abbr = eras[i].abbr.toUpperCase();
      narrow = eras[i].narrow.toUpperCase();
      if (strict) {
        switch (format) {
          case 'N':
          case 'NN':
          case 'NNN':
            if (abbr === eraName) {
              return eras[i];
            }
            break;
          case 'NNNN':
            if (name === eraName) {
              return eras[i];
            }
            break;
          case 'NNNNN':
            if (narrow === eraName) {
              return eras[i];
            }
            break;
        }
      } else if ([name, abbr, narrow].indexOf(eraName) >= 0) {
        return eras[i];
      }
    }
  }
  function localeErasConvertYear(era, year) {
    var dir = era.since <= era.until ? +1 : -1;
    if (year === undefined) {
      return hooks(era.since).year();
    } else {
      return hooks(era.since).year() + (year - era.offset) * dir;
    }
  }
  function getEraName() {
    var i,
      l,
      val,
      eras = this.localeData().eras();
    for (i = 0, l = eras.length; i < l; ++i) {
      val = this.clone().startOf('day').valueOf();
      if (eras[i].since <= val && val <= eras[i].until) {
        return eras[i].name;
      }
      if (eras[i].until <= val && val <= eras[i].since) {
        return eras[i].name;
      }
    }
    return '';
  }
  function getEraNarrow() {
    var i,
      l,
      val,
      eras = this.localeData().eras();
    for (i = 0, l = eras.length; i < l; ++i) {
      val = this.clone().startOf('day').valueOf();
      if (eras[i].since <= val && val <= eras[i].until) {
        return eras[i].narrow;
      }
      if (eras[i].until <= val && val <= eras[i].since) {
        return eras[i].narrow;
      }
    }
    return '';
  }
  function getEraAbbr() {
    var i,
      l,
      val,
      eras = this.localeData().eras();
    for (i = 0, l = eras.length; i < l; ++i) {
      val = this.clone().startOf('day').valueOf();
      if (eras[i].since <= val && val <= eras[i].until) {
        return eras[i].abbr;
      }
      if (eras[i].until <= val && val <= eras[i].since) {
        return eras[i].abbr;
      }
    }
    return '';
  }
  function getEraYear() {
    var i,
      l,
      dir,
      val,
      eras = this.localeData().eras();
    for (i = 0, l = eras.length; i < l; ++i) {
      dir = eras[i].since <= eras[i].until ? +1 : -1;
      val = this.clone().startOf('day').valueOf();
      if (eras[i].since <= val && val <= eras[i].until || eras[i].until <= val && val <= eras[i].since) {
        return (this.year() - hooks(eras[i].since).year()) * dir + eras[i].offset;
      }
    }
    return this.year();
  }
  function erasNameRegex(isStrict) {
    if (!hasOwnProp(this, '_erasNameRegex')) {
      computeErasParse.call(this);
    }
    return isStrict ? this._erasNameRegex : this._erasRegex;
  }
  function erasAbbrRegex(isStrict) {
    if (!hasOwnProp(this, '_erasAbbrRegex')) {
      computeErasParse.call(this);
    }
    return isStrict ? this._erasAbbrRegex : this._erasRegex;
  }
  function erasNarrowRegex(isStrict) {
    if (!hasOwnProp(this, '_erasNarrowRegex')) {
      computeErasParse.call(this);
    }
    return isStrict ? this._erasNarrowRegex : this._erasRegex;
  }
  function matchEraAbbr(isStrict, locale) {
    return locale.erasAbbrRegex(isStrict);
  }
  function matchEraName(isStrict, locale) {
    return locale.erasNameRegex(isStrict);
  }
  function matchEraNarrow(isStrict, locale) {
    return locale.erasNarrowRegex(isStrict);
  }
  function matchEraYearOrdinal(isStrict, locale) {
    return locale._eraYearOrdinalRegex || matchUnsigned;
  }
  function computeErasParse() {
    var abbrPieces = [],
      namePieces = [],
      narrowPieces = [],
      mixedPieces = [],
      i,
      l,
      erasName,
      erasAbbr,
      erasNarrow,
      eras = this.eras();
    for (i = 0, l = eras.length; i < l; ++i) {
      erasName = regexEscape(eras[i].name);
      erasAbbr = regexEscape(eras[i].abbr);
      erasNarrow = regexEscape(eras[i].narrow);
      namePieces.push(erasName);
      abbrPieces.push(erasAbbr);
      narrowPieces.push(erasNarrow);
      mixedPieces.push(erasName);
      mixedPieces.push(erasAbbr);
      mixedPieces.push(erasNarrow);
    }
    this._erasRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
    this._erasNameRegex = new RegExp('^(' + namePieces.join('|') + ')', 'i');
    this._erasAbbrRegex = new RegExp('^(' + abbrPieces.join('|') + ')', 'i');
    this._erasNarrowRegex = new RegExp('^(' + narrowPieces.join('|') + ')', 'i');
  }
  addFormatToken(0, ['gg', 2], 0, function () {
    return this.weekYear() % 100;
  });
  addFormatToken(0, ['GG', 2], 0, function () {
    return this.isoWeekYear() % 100;
  });
  function addWeekYearFormatToken(token, getter) {
    addFormatToken(0, [token, token.length], 0, getter);
  }
  addWeekYearFormatToken('gggg', 'weekYear');
  addWeekYearFormatToken('ggggg', 'weekYear');
  addWeekYearFormatToken('GGGG', 'isoWeekYear');
  addWeekYearFormatToken('GGGGG', 'isoWeekYear');
  addRegexToken('G', matchSigned);
  addRegexToken('g', matchSigned);
  addRegexToken('GG', match1to2, match2);
  addRegexToken('gg', match1to2, match2);
  addRegexToken('GGGG', match1to4, match4);
  addRegexToken('gggg', match1to4, match4);
  addRegexToken('GGGGG', match1to6, match6);
  addRegexToken('ggggg', match1to6, match6);
  addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (input, week, config, token) {
    week[token.substr(0, 2)] = toInt(input);
  });
  addWeekParseToken(['gg', 'GG'], function (input, week, config, token) {
    week[token] = hooks.parseTwoDigitYear(input);
  });
  function getSetWeekYear(input) {
    return getSetWeekYearHelper.call(this, input, this.week(), this.weekday() + this.localeData()._week.dow, this.localeData()._week.dow, this.localeData()._week.doy);
  }
  function getSetISOWeekYear(input) {
    return getSetWeekYearHelper.call(this, input, this.isoWeek(), this.isoWeekday(), 1, 4);
  }
  function getISOWeeksInYear() {
    return weeksInYear(this.year(), 1, 4);
  }
  function getISOWeeksInISOWeekYear() {
    return weeksInYear(this.isoWeekYear(), 1, 4);
  }
  function getWeeksInYear() {
    var weekInfo = this.localeData()._week;
    return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);
  }
  function getWeeksInWeekYear() {
    var weekInfo = this.localeData()._week;
    return weeksInYear(this.weekYear(), weekInfo.dow, weekInfo.doy);
  }
  function getSetWeekYearHelper(input, week, weekday, dow, doy) {
    var weeksTarget;
    if (input == null) {
      return weekOfYear(this, dow, doy).year;
    } else {
      weeksTarget = weeksInYear(input, dow, doy);
      if (week > weeksTarget) {
        week = weeksTarget;
      }
      return setWeekAll.call(this, input, week, weekday, dow, doy);
    }
  }
  function setWeekAll(weekYear, week, weekday, dow, doy) {
    var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy),
      date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear);
    this.year(date.getUTCFullYear());
    this.month(date.getUTCMonth());
    this.date(date.getUTCDate());
    return this;
  }
  addFormatToken('Q', 0, 'Qo', 'quarter');
  addRegexToken('Q', match1);
  addParseToken('Q', function (input, array) {
    array[MONTH] = (toInt(input) - 1) * 3;
  });
  function getSetQuarter(input) {
    return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3);
  }
  addFormatToken('D', ['DD', 2], 'Do', 'date');
  addRegexToken('D', match1to2, match1to2NoLeadingZero);
  addRegexToken('DD', match1to2, match2);
  addRegexToken('Do', function (isStrict, locale) {
    return isStrict ? locale._dayOfMonthOrdinalParse || locale._ordinalParse : locale._dayOfMonthOrdinalParseLenient;
  });
  addParseToken(['D', 'DD'], DATE);
  addParseToken('Do', function (input, array) {
    array[DATE] = toInt(input.match(match1to2)[0]);
  });
  var getSetDayOfMonth = makeGetSet('Date', true);
  addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear');
  addRegexToken('DDD', match1to3);
  addRegexToken('DDDD', match3);
  addParseToken(['DDD', 'DDDD'], function (input, array, config) {
    config._dayOfYear = toInt(input);
  });
  function getSetDayOfYear(input) {
    var dayOfYear = Math.round((this.clone().startOf('day') - this.clone().startOf('year')) / 864e5) + 1;
    return input == null ? dayOfYear : this.add(input - dayOfYear, 'd');
  }
  addFormatToken('m', ['mm', 2], 0, 'minute');
  addRegexToken('m', match1to2, match1to2HasZero);
  addRegexToken('mm', match1to2, match2);
  addParseToken(['m', 'mm'], MINUTE);
  var getSetMinute = makeGetSet('Minutes', false);
  addFormatToken('s', ['ss', 2], 0, 'second');
  addRegexToken('s', match1to2, match1to2HasZero);
  addRegexToken('ss', match1to2, match2);
  addParseToken(['s', 'ss'], SECOND);
  var getSetSecond = makeGetSet('Seconds', false);
  addFormatToken('S', 0, 0, function () {
    return ~~(this.millisecond() / 100);
  });
  addFormatToken(0, ['SS', 2], 0, function () {
    return ~~(this.millisecond() / 10);
  });
  addFormatToken(0, ['SSS', 3], 0, 'millisecond');
  addFormatToken(0, ['SSSS', 4], 0, function () {
    return this.millisecond() * 10;
  });
  addFormatToken(0, ['SSSSS', 5], 0, function () {
    return this.millisecond() * 100;
  });
  addFormatToken(0, ['SSSSSS', 6], 0, function () {
    return this.millisecond() * 1000;
  });
  addFormatToken(0, ['SSSSSSS', 7], 0, function () {
    return this.millisecond() * 10000;
  });
  addFormatToken(0, ['SSSSSSSS', 8], 0, function () {
    return this.millisecond() * 100000;
  });
  addFormatToken(0, ['SSSSSSSSS', 9], 0, function () {
    return this.millisecond() * 1000000;
  });
  addRegexToken('S', match1to3, match1);
  addRegexToken('SS', match1to3, match2);
  addRegexToken('SSS', match1to3, match3);
  var token, getSetMillisecond;
  for (token = 'SSSS'; token.length <= 9; token += 'S') {
    addRegexToken(token, matchUnsigned);
  }
  function parseMs(input, array) {
    array[MILLISECOND] = toInt(('0.' + input) * 1000);
  }
  for (token = 'S'; token.length <= 9; token += 'S') {
    addParseToken(token, parseMs);
  }
  getSetMillisecond = makeGetSet('Milliseconds', false);
  addFormatToken('z', 0, 0, 'zoneAbbr');
  addFormatToken('zz', 0, 0, 'zoneName');
  function getZoneAbbr() {
    return this._isUTC ? 'UTC' : '';
  }
  function getZoneName() {
    return this._isUTC ? 'Coordinated Universal Time' : '';
  }
  var proto = Moment.prototype;
  proto.add = add;
  proto.calendar = calendar$1;
  proto.clone = clone;
  proto.diff = diff;
  proto.endOf = endOf;
  proto.format = format;
  proto.from = from;
  proto.fromNow = fromNow;
  proto.to = to;
  proto.toNow = toNow;
  proto.get = stringGet;
  proto.invalidAt = invalidAt;
  proto.isAfter = isAfter;
  proto.isBefore = isBefore;
  proto.isBetween = isBetween;
  proto.isSame = isSame;
  proto.isSameOrAfter = isSameOrAfter;
  proto.isSameOrBefore = isSameOrBefore;
  proto.isValid = isValid$2;
  proto.lang = lang;
  proto.locale = locale;
  proto.localeData = localeData;
  proto.max = prototypeMax;
  proto.min = prototypeMin;
  proto.parsingFlags = parsingFlags;
  proto.set = stringSet;
  proto.startOf = startOf;
  proto.subtract = subtract;
  proto.toArray = toArray;
  proto.toObject = toObject;
  proto.toDate = toDate;
  proto.toISOString = toISOString;
  proto.inspect = inspect;
  if (typeof Symbol !== 'undefined' && Symbol["for"] != null) {
    proto[Symbol["for"]('nodejs.util.inspect.custom')] = function () {
      return 'Moment<' + this.format() + '>';
    };
  }
  proto.toJSON = toJSON;
  proto.toString = toString;
  proto.unix = unix;
  proto.valueOf = valueOf;
  proto.creationData = creationData;
  proto.eraName = getEraName;
  proto.eraNarrow = getEraNarrow;
  proto.eraAbbr = getEraAbbr;
  proto.eraYear = getEraYear;
  proto.year = getSetYear;
  proto.isLeapYear = getIsLeapYear;
  proto.weekYear = getSetWeekYear;
  proto.isoWeekYear = getSetISOWeekYear;
  proto.quarter = proto.quarters = getSetQuarter;
  proto.month = getSetMonth;
  proto.daysInMonth = getDaysInMonth;
  proto.week = proto.weeks = getSetWeek;
  proto.isoWeek = proto.isoWeeks = getSetISOWeek;
  proto.weeksInYear = getWeeksInYear;
  proto.weeksInWeekYear = getWeeksInWeekYear;
  proto.isoWeeksInYear = getISOWeeksInYear;
  proto.isoWeeksInISOWeekYear = getISOWeeksInISOWeekYear;
  proto.date = getSetDayOfMonth;
  proto.day = proto.days = getSetDayOfWeek;
  proto.weekday = getSetLocaleDayOfWeek;
  proto.isoWeekday = getSetISODayOfWeek;
  proto.dayOfYear = getSetDayOfYear;
  proto.hour = proto.hours = getSetHour;
  proto.minute = proto.minutes = getSetMinute;
  proto.second = proto.seconds = getSetSecond;
  proto.millisecond = proto.milliseconds = getSetMillisecond;
  proto.utcOffset = getSetOffset;
  proto.utc = setOffsetToUTC;
  proto.local = setOffsetToLocal;
  proto.parseZone = setOffsetToParsedOffset;
  proto.hasAlignedHourOffset = hasAlignedHourOffset;
  proto.isDST = isDaylightSavingTime;
  proto.isLocal = isLocal;
  proto.isUtcOffset = isUtcOffset;
  proto.isUtc = isUtc;
  proto.isUTC = isUtc;
  proto.zoneAbbr = getZoneAbbr;
  proto.zoneName = getZoneName;
  proto.dates = deprecate('dates accessor is deprecated. Use date instead.', getSetDayOfMonth);
  proto.months = deprecate('months accessor is deprecated. Use month instead', getSetMonth);
  proto.years = deprecate('years accessor is deprecated. Use year instead', getSetYear);
  proto.zone = deprecate('moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/', getSetZone);
  proto.isDSTShifted = deprecate('isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information', isDaylightSavingTimeShifted);
  function createUnix(input) {
    return createLocal(input * 1000);
  }
  function createInZone() {
    return createLocal.apply(null, arguments).parseZone();
  }
  function preParsePostFormat(string) {
    return string;
  }
  var proto$1 = Locale.prototype;
  proto$1.calendar = calendar;
  proto$1.longDateFormat = longDateFormat;
  proto$1.invalidDate = invalidDate;
  proto$1.ordinal = ordinal;
  proto$1.preparse = preParsePostFormat;
  proto$1.postformat = preParsePostFormat;
  proto$1.relativeTime = relativeTime;
  proto$1.pastFuture = pastFuture;
  proto$1.set = set;
  proto$1.eras = localeEras;
  proto$1.erasParse = localeErasParse;
  proto$1.erasConvertYear = localeErasConvertYear;
  proto$1.erasAbbrRegex = erasAbbrRegex;
  proto$1.erasNameRegex = erasNameRegex;
  proto$1.erasNarrowRegex = erasNarrowRegex;
  proto$1.months = localeMonths;
  proto$1.monthsShort = localeMonthsShort;
  proto$1.monthsParse = localeMonthsParse;
  proto$1.monthsRegex = monthsRegex;
  proto$1.monthsShortRegex = monthsShortRegex;
  proto$1.week = localeWeek;
  proto$1.firstDayOfYear = localeFirstDayOfYear;
  proto$1.firstDayOfWeek = localeFirstDayOfWeek;
  proto$1.weekdays = localeWeekdays;
  proto$1.weekdaysMin = localeWeekdaysMin;
  proto$1.weekdaysShort = localeWeekdaysShort;
  proto$1.weekdaysParse = localeWeekdaysParse;
  proto$1.weekdaysRegex = weekdaysRegex;
  proto$1.weekdaysShortRegex = weekdaysShortRegex;
  proto$1.weekdaysMinRegex = weekdaysMinRegex;
  proto$1.isPM = localeIsPM;
  proto$1.meridiem = localeMeridiem;
  function get$1(format, index, field, setter) {
    var locale = getLocale(),
      utc = createUTC().set(setter, index);
    return locale[field](utc, format);
  }
  function listMonthsImpl(format, index, field) {
    if (isNumber(format)) {
      index = format;
      format = undefined;
    }
    format = format || '';
    if (index != null) {
      return get$1(format, index, field, 'month');
    }
    var i,
      out = [];
    for (i = 0; i < 12; i++) {
      out[i] = get$1(format, i, field, 'month');
    }
    return out;
  }
  function listWeekdaysImpl(localeSorted, format, index, field) {
    if (typeof localeSorted === 'boolean') {
      if (isNumber(format)) {
        index = format;
        format = undefined;
      }
      format = format || '';
    } else {
      format = localeSorted;
      index = format;
      localeSorted = false;
      if (isNumber(format)) {
        index = format;
        format = undefined;
      }
      format = format || '';
    }
    var locale = getLocale(),
      shift = localeSorted ? locale._week.dow : 0,
      i,
      out = [];
    if (index != null) {
      return get$1(format, (index + shift) % 7, field, 'day');
    }
    for (i = 0; i < 7; i++) {
      out[i] = get$1(format, (i + shift) % 7, field, 'day');
    }
    return out;
  }
  function listMonths(format, index) {
    return listMonthsImpl(format, index, 'months');
  }
  function listMonthsShort(format, index) {
    return listMonthsImpl(format, index, 'monthsShort');
  }
  function listWeekdays(localeSorted, format, index) {
    return listWeekdaysImpl(localeSorted, format, index, 'weekdays');
  }
  function listWeekdaysShort(localeSorted, format, index) {
    return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort');
  }
  function listWeekdaysMin(localeSorted, format, index) {
    return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin');
  }
  getSetGlobalLocale('en', {
    eras: [{
      since: '0001-01-01',
      until: +Infinity,
      offset: 1,
      name: 'Anno Domini',
      narrow: 'AD',
      abbr: 'AD'
    }, {
      since: '0000-12-31',
      until: -Infinity,
      offset: 1,
      name: 'Before Christ',
      narrow: 'BC',
      abbr: 'BC'
    }],
    dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/,
    ordinal: function ordinal(number) {
      var b = number % 10,
        output = toInt(number % 100 / 10) === 1 ? 'th' : b === 1 ? 'st' : b === 2 ? 'nd' : b === 3 ? 'rd' : 'th';
      return number + output;
    }
  });
  hooks.lang = deprecate('moment.lang is deprecated. Use moment.locale instead.', getSetGlobalLocale);
  hooks.langData = deprecate('moment.langData is deprecated. Use moment.localeData instead.', getLocale);
  var mathAbs = Math.abs;
  function abs() {
    var data = this._data;
    this._milliseconds = mathAbs(this._milliseconds);
    this._days = mathAbs(this._days);
    this._months = mathAbs(this._months);
    data.milliseconds = mathAbs(data.milliseconds);
    data.seconds = mathAbs(data.seconds);
    data.minutes = mathAbs(data.minutes);
    data.hours = mathAbs(data.hours);
    data.months = mathAbs(data.months);
    data.years = mathAbs(data.years);
    return this;
  }
  function addSubtract$1(duration, input, value, direction) {
    var other = createDuration(input, value);
    duration._milliseconds += direction * other._milliseconds;
    duration._days += direction * other._days;
    duration._months += direction * other._months;
    return duration._bubble();
  }
  function add$1(input, value) {
    return addSubtract$1(this, input, value, 1);
  }
  function subtract$1(input, value) {
    return addSubtract$1(this, input, value, -1);
  }
  function absCeil(number) {
    if (number < 0) {
      return Math.floor(number);
    } else {
      return Math.ceil(number);
    }
  }
  function bubble() {
    var milliseconds = this._milliseconds,
      days = this._days,
      months = this._months,
      data = this._data,
      seconds,
      minutes,
      hours,
      years,
      monthsFromDays;
    if (!(milliseconds >= 0 && days >= 0 && months >= 0 || milliseconds <= 0 && days <= 0 && months <= 0)) {
      milliseconds += absCeil(monthsToDays(months) + days) * 864e5;
      days = 0;
      months = 0;
    }
    data.milliseconds = milliseconds % 1000;
    seconds = absFloor(milliseconds / 1000);
    data.seconds = seconds % 60;
    minutes = absFloor(seconds / 60);
    data.minutes = minutes % 60;
    hours = absFloor(minutes / 60);
    data.hours = hours % 24;
    days += absFloor(hours / 24);
    monthsFromDays = absFloor(daysToMonths(days));
    months += monthsFromDays;
    days -= absCeil(monthsToDays(monthsFromDays));
    years = absFloor(months / 12);
    months %= 12;
    data.days = days;
    data.months = months;
    data.years = years;
    return this;
  }
  function daysToMonths(days) {
    return days * 4800 / 146097;
  }
  function monthsToDays(months) {
    return months * 146097 / 4800;
  }
  function as(units) {
    if (!this.isValid()) {
      return NaN;
    }
    var days,
      months,
      milliseconds = this._milliseconds;
    units = normalizeUnits(units);
    if (units === 'month' || units === 'quarter' || units === 'year') {
      days = this._days + milliseconds / 864e5;
      months = this._months + daysToMonths(days);
      switch (units) {
        case 'month':
          return months;
        case 'quarter':
          return months / 3;
        case 'year':
          return months / 12;
      }
    } else {
      days = this._days + Math.round(monthsToDays(this._months));
      switch (units) {
        case 'week':
          return days / 7 + milliseconds / 6048e5;
        case 'day':
          return days + milliseconds / 864e5;
        case 'hour':
          return days * 24 + milliseconds / 36e5;
        case 'minute':
          return days * 1440 + milliseconds / 6e4;
        case 'second':
          return days * 86400 + milliseconds / 1000;
        case 'millisecond':
          return Math.floor(days * 864e5) + milliseconds;
        default:
          throw new Error('Unknown unit ' + units);
      }
    }
  }
  function makeAs(alias) {
    return function () {
      return this.as(alias);
    };
  }
  var asMilliseconds = makeAs('ms'),
    asSeconds = makeAs('s'),
    asMinutes = makeAs('m'),
    asHours = makeAs('h'),
    asDays = makeAs('d'),
    asWeeks = makeAs('w'),
    asMonths = makeAs('M'),
    asQuarters = makeAs('Q'),
    asYears = makeAs('y'),
    valueOf$1 = asMilliseconds;
  function clone$1() {
    return createDuration(this);
  }
  function get$2(units) {
    units = normalizeUnits(units);
    return this.isValid() ? this[units + 's']() : NaN;
  }
  function makeGetter(name) {
    return function () {
      return this.isValid() ? this._data[name] : NaN;
    };
  }
  var milliseconds = makeGetter('milliseconds'),
    seconds = makeGetter('seconds'),
    minutes = makeGetter('minutes'),
    hours = makeGetter('hours'),
    days = makeGetter('days'),
    months = makeGetter('months'),
    years = makeGetter('years');
  function weeks() {
    return absFloor(this.days() / 7);
  }
  var round = Math.round,
    thresholds = {
      ss: 44,
      s: 45,
      m: 45,
      h: 22,
      d: 26,
      w: null,
      M: 11
    };
  function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {
    return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture);
  }
  function relativeTime$1(posNegDuration, withoutSuffix, thresholds, locale) {
    var duration = createDuration(posNegDuration).abs(),
      seconds = round(duration.as('s')),
      minutes = round(duration.as('m')),
      hours = round(duration.as('h')),
      days = round(duration.as('d')),
      months = round(duration.as('M')),
      weeks = round(duration.as('w')),
      years = round(duration.as('y')),
      a = seconds <= thresholds.ss && ['s', seconds] || seconds < thresholds.s && ['ss', seconds] || minutes <= 1 && ['m'] || minutes < thresholds.m && ['mm', minutes] || hours <= 1 && ['h'] || hours < thresholds.h && ['hh', hours] || days <= 1 && ['d'] || days < thresholds.d && ['dd', days];
    if (thresholds.w != null) {
      a = a || weeks <= 1 && ['w'] || weeks < thresholds.w && ['ww', weeks];
    }
    a = a || months <= 1 && ['M'] || months < thresholds.M && ['MM', months] || years <= 1 && ['y'] || ['yy', years];
    a[2] = withoutSuffix;
    a[3] = +posNegDuration > 0;
    a[4] = locale;
    return substituteTimeAgo.apply(null, a);
  }
  function getSetRelativeTimeRounding(roundingFunction) {
    if (roundingFunction === undefined) {
      return round;
    }
    if (typeof roundingFunction === 'function') {
      round = roundingFunction;
      return true;
    }
    return false;
  }
  function getSetRelativeTimeThreshold(threshold, limit) {
    if (thresholds[threshold] === undefined) {
      return false;
    }
    if (limit === undefined) {
      return thresholds[threshold];
    }
    thresholds[threshold] = limit;
    if (threshold === 's') {
      thresholds.ss = limit - 1;
    }
    return true;
  }
  function humanize(argWithSuffix, argThresholds) {
    if (!this.isValid()) {
      return this.localeData().invalidDate();
    }
    var withSuffix = false,
      th = thresholds,
      locale,
      output;
    if (typeof argWithSuffix === 'object') {
      argThresholds = argWithSuffix;
      argWithSuffix = false;
    }
    if (typeof argWithSuffix === 'boolean') {
      withSuffix = argWithSuffix;
    }
    if (typeof argThresholds === 'object') {
      th = Object.assign({}, thresholds, argThresholds);
      if (argThresholds.s != null && argThresholds.ss == null) {
        th.ss = argThresholds.s - 1;
      }
    }
    locale = this.localeData();
    output = relativeTime$1(this, !withSuffix, th, locale);
    if (withSuffix) {
      output = locale.pastFuture(+this, output);
    }
    return locale.postformat(output);
  }
  var abs$1 = Math.abs;
  function sign(x) {
    return (x > 0) - (x < 0) || +x;
  }
  function toISOString$1() {
    if (!this.isValid()) {
      return this.localeData().invalidDate();
    }
    var seconds = abs$1(this._milliseconds) / 1000,
      days = abs$1(this._days),
      months = abs$1(this._months),
      minutes,
      hours,
      years,
      s,
      total = this.asSeconds(),
      totalSign,
      ymSign,
      daysSign,
      hmsSign;
    if (!total) {
      return 'P0D';
    }
    minutes = absFloor(seconds / 60);
    hours = absFloor(minutes / 60);
    seconds %= 60;
    minutes %= 60;
    years = absFloor(months / 12);
    months %= 12;
    s = seconds ? seconds.toFixed(3).replace(/\.?0+$/, '') : '';
    totalSign = total < 0 ? '-' : '';
    ymSign = sign(this._months) !== sign(total) ? '-' : '';
    daysSign = sign(this._days) !== sign(total) ? '-' : '';
    hmsSign = sign(this._milliseconds) !== sign(total) ? '-' : '';
    return totalSign + 'P' + (years ? ymSign + years + 'Y' : '') + (months ? ymSign + months + 'M' : '') + (days ? daysSign + days + 'D' : '') + (hours || minutes || seconds ? 'T' : '') + (hours ? hmsSign + hours + 'H' : '') + (minutes ? hmsSign + minutes + 'M' : '') + (seconds ? hmsSign + s + 'S' : '');
  }
  var proto$2 = Duration.prototype;
  proto$2.isValid = isValid$1;
  proto$2.abs = abs;
  proto$2.add = add$1;
  proto$2.subtract = subtract$1;
  proto$2.as = as;
  proto$2.asMilliseconds = asMilliseconds;
  proto$2.asSeconds = asSeconds;
  proto$2.asMinutes = asMinutes;
  proto$2.asHours = asHours;
  proto$2.asDays = asDays;
  proto$2.asWeeks = asWeeks;
  proto$2.asMonths = asMonths;
  proto$2.asQuarters = asQuarters;
  proto$2.asYears = asYears;
  proto$2.valueOf = valueOf$1;
  proto$2._bubble = bubble;
  proto$2.clone = clone$1;
  proto$2.get = get$2;
  proto$2.milliseconds = milliseconds;
  proto$2.seconds = seconds;
  proto$2.minutes = minutes;
  proto$2.hours = hours;
  proto$2.days = days;
  proto$2.weeks = weeks;
  proto$2.months = months;
  proto$2.years = years;
  proto$2.humanize = humanize;
  proto$2.toISOString = toISOString$1;
  proto$2.toString = toISOString$1;
  proto$2.toJSON = toISOString$1;
  proto$2.locale = locale;
  proto$2.localeData = localeData;
  proto$2.toIsoString = deprecate('toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)', toISOString$1);
  proto$2.lang = lang;
  addFormatToken('X', 0, 0, 'unix');
  addFormatToken('x', 0, 0, 'valueOf');
  addRegexToken('x', matchSigned);
  addRegexToken('X', matchTimestamp);
  addParseToken('X', function (input, array, config) {
    config._d = new Date(parseFloat(input) * 1000);
  });
  addParseToken('x', function (input, array, config) {
    config._d = new Date(toInt(input));
  });
  hooks.version = '2.30.1';
  setHookCallback(createLocal);
  hooks.fn = proto;
  hooks.min = min;
  hooks.max = max;
  hooks.now = now;
  hooks.utc = createUTC;
  hooks.unix = createUnix;
  hooks.months = listMonths;
  hooks.isDate = isDate;
  hooks.locale = getSetGlobalLocale;
  hooks.invalid = createInvalid;
  hooks.duration = createDuration;
  hooks.isMoment = isMoment;
  hooks.weekdays = listWeekdays;
  hooks.parseZone = createInZone;
  hooks.localeData = getLocale;
  hooks.isDuration = isDuration;
  hooks.monthsShort = listMonthsShort;
  hooks.weekdaysMin = listWeekdaysMin;
  hooks.defineLocale = defineLocale;
  hooks.updateLocale = updateLocale;
  hooks.locales = listLocales;
  hooks.weekdaysShort = listWeekdaysShort;
  hooks.normalizeUnits = normalizeUnits;
  hooks.relativeTimeRounding = getSetRelativeTimeRounding;
  hooks.relativeTimeThreshold = getSetRelativeTimeThreshold;
  hooks.calendarFormat = getCalendarFormat;
  hooks.prototype = proto;
  hooks.HTML5_FMT = {
    DATETIME_LOCAL: 'YYYY-MM-DDTHH:mm',
    DATETIME_LOCAL_SECONDS: 'YYYY-MM-DDTHH:mm:ss',
    DATETIME_LOCAL_MS: 'YYYY-MM-DDTHH:mm:ss.SSS',
    DATE: 'YYYY-MM-DD',
    TIME: 'HH:mm',
    TIME_SECONDS: 'HH:mm:ss',
    TIME_MS: 'HH:mm:ss.SSS',
    WEEK: 'GGGG-[W]WW',
    MONTH: 'YYYY-MM'
  };
  return hooks;
});

},{}],681:[function(require,module,exports){
"use strict";

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 define(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 reset(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 stop() {
      this.done = true;
      var rootEntry = this.tryEntries[0];
      var rootRecord = rootEntry.completion;
      if (rootRecord.type === "throw") {
        throw rootRecord.arg;
      }
      return this.rval;
    },
    dispatchException: function dispatchException(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 abrupt(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 complete(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 finish(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 _catch(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 delegateYield(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);
  }
}

},{}],682:[function(require,module,exports){
"use strict";

var _require = require("./person-v4"),
  PersonV4 = _require.PersonV4;
module.exports = {
  PersonV4: PersonV4
};

},{"./person-v4":683}],683:[function(require,module,exports){
"use strict";

var PersonV4 = function () {
  function PersonV4(id, fullName, firstName, lastName, isAlias, isLinked, parentId) {
    this.id = id;
    this.fullName = fullName;
    this.firstName = firstName;
    this.lastName = lastName;
    this.isAlias = isAlias;
    this.isLinked = isLinked;
    this.parentId = parentId;
    this.keywords = [];
    this.isProcessed = false;
    this.isProcessing = false;
    this.totalRiskScore = 0;
    this.reqPersonId = null;
    this.isOpen = false;
    this.isAlertShouldBeCreated = true;
    this.alertId = null;
    this.virtualClientId = null;
  }
  var _proto = PersonV4.prototype;
  _proto.getId = function getId() {
    return this.id;
  };
  _proto.getFullName = function getFullName() {
    return this.fullName;
  };
  _proto.getFirstName = function getFirstName() {
    return this.firstName;
  };
  _proto.getLastName = function getLastName() {
    return this.lastName;
  };
  _proto.getParentId = function getParentId() {
    return this.parentId;
  };
  _proto.setReqPersonId = function setReqPersonId(reqPersonId) {
    this.reqPersonId = reqPersonId;
  };
  _proto.getReqPersonId = function getReqPersonId() {
    return this.reqPersonId;
  };
  _proto.isAliasPerson = function isAliasPerson() {
    return this.isAlias;
  };
  _proto.isLinkedPerson = function isLinkedPerson() {
    return this.isLinked;
  };
  _proto.getKeywords = function getKeywords() {
    return this.keywords;
  };
  _proto.getAllKeywords = function getAllKeywords() {
    return this.fullName.split(" ").concat(this.keywords);
  };
  _proto.setIsProcessing = function setIsProcessing() {
    this.isProcessing = true;
    this.isProcessed = false;
  };
  _proto.setIsProcessed = function setIsProcessed() {
    this.isProcessing = false;
    this.isProcessed = true;
  };
  _proto.checkIsProcessed = function checkIsProcessed() {
    return this.isProcessed === true;
  };
  _proto.getTotalRiskScore = function getTotalRiskScore() {
    return this.totalRiskScore;
  };
  _proto.setOpen = function setOpen(isOpen) {
    this.isOpen = isOpen;
  };
  _proto.checkIsOpen = function checkIsOpen() {
    return this.isOpen;
  };
  _proto.setAlertShouldBeCreated = function setAlertShouldBeCreated(isAlertShouldBeCreated) {
    this.isAlertShouldBeCreated = isAlertShouldBeCreated;
  };
  _proto.checkAlertShouldBeCreated = function checkAlertShouldBeCreated() {
    return this.isAlertShouldBeCreated;
  };
  _proto.setAlertId = function setAlertId(alertId) {
    this.alertId = alertId;
  };
  _proto.getAlertId = function getAlertId() {
    return this.alertId;
  };
  _proto.setVirtualClientId = function setVirtualClientId(virtualClientId) {
    this.virtualClientId = virtualClientId;
  };
  _proto.getVirtualClientId = function getVirtualClientId() {
    return this.virtualClientId;
  };
  return PersonV4;
}();
module.exports = {
  PersonV4: PersonV4
};

},{}],684:[function(require,module,exports){
"use strict";

var _require = require("./persons-service-v4"),
  PersonsServiceV4 = _require.PersonsServiceV4;
module.exports = {
  PersonsServiceV4: PersonsServiceV4
};

},{"./persons-service-v4":685}],685:[function(require,module,exports){
"use strict";

var _require = require("../../utils/common-v4"),
  generateUUID = _require.generateUUID;
var PersonsServiceV4 = function () {
  function PersonsServiceV4() {
    this.serviceId = generateUUID();
    this.persons = [];
  }
  var _proto = PersonsServiceV4.prototype;
  _proto.getServiceId = function getServiceId() {
    return this.serviceId;
  };
  _proto.setPersonsAreProcessed = function setPersonsAreProcessed(personId) {
    (personId ? this.persons.filter(function (person) {
      return person.getParentId() === personId;
    }) : this.persons).forEach(function (person) {
      person.setIsProcessed();
    });
  };
  _proto.setPersonsAreProcessing = function setPersonsAreProcessing(personId) {
    (personId ? this.persons.filter(function (person) {
      return person.getParentId() === personId;
    }) : this.persons).forEach(function (person) {
      person.setIsProcessing();
    });
  };
  _proto.checkAllPersonsAreProcessed = function checkAllPersonsAreProcessed() {
    return this.persons.filter(function (person) {
      return person.checkIsProcessed();
    }).length === this.persons.length;
  };
  _proto.getById = function getById(personId) {
    return this.persons.find(function (person) {
      return person.getId() === personId;
    });
  };
  _proto.getAliasPersonsById = function getAliasPersonsById(personId) {
    return this.persons.filter(function (person) {
      return person.isAliasPerson() && person.getParentId() === personId;
    });
  };
  _proto.getLinkedPersonsById = function getLinkedPersonsById(personId) {
    return this.persons.filter(function (person) {
      return person.isLinkedPerson() && person.getParentId() === personId;
    });
  };
  _proto.getPersonsWithoutAliases = function getPersonsWithoutAliases() {
    return this.persons.filter(function (person) {
      return !person.isAliasPerson() && !person.isLinkedPerson();
    });
  };
  _proto.getPersons = function getPersons() {
    return this.persons;
  };
  _proto.getPersonsCount = function getPersonsCount() {
    return this.persons.length;
  };
  return PersonsServiceV4;
}();
module.exports = {
  PersonsServiceV4: PersonsServiceV4
};

},{"../../utils/common-v4":687}],686:[function(require,module,exports){
"use strict";

function AhoCorasick(keywords) {
  this._buildTables(keywords);
}
AhoCorasick.prototype._buildTables = function (keywords) {
  var gotoFn = {
    0: {}
  };
  var output = {};
  var state = 0;
  keywords.forEach(function (word) {
    var curr = 0;
    for (var i = 0; i < word.length; i++) {
      var l = word[i];
      if (gotoFn[curr] && l in gotoFn[curr]) {
        curr = gotoFn[curr][l];
      } else {
        state++;
        gotoFn[curr][l] = state;
        gotoFn[state] = {};
        curr = state;
        output[state] = [];
      }
    }
    output[curr].push(word);
  });
  var failure = {};
  var xs = [];
  for (var l in gotoFn[0]) {
    var state = gotoFn[0][l];
    failure[state] = 0;
    xs.push(state);
  }
  while (xs.length) {
    var r = xs.shift();
    for (var l in gotoFn[r]) {
      var s = gotoFn[r][l];
      xs.push(s);
      var state = failure[r];
      while (state > 0 && !(l in gotoFn[state])) {
        state = failure[state];
      }
      if (l in gotoFn[state]) {
        var fs = gotoFn[state][l];
        failure[s] = fs;
        output[s] = output[s].concat(output[fs]);
      } else {
        failure[s] = 0;
      }
    }
  }
  this.gotoFn = gotoFn;
  this.output = output;
  this.failure = failure;
};
AhoCorasick.prototype.search = function (string) {
  var state = 0;
  var results = [];
  for (var i = 0; i < string.length; i++) {
    var l = string[i];
    while (state > 0 && !(l in this.gotoFn[state])) {
      state = this.failure[state];
    }
    if (!(l in this.gotoFn[state])) {
      continue;
    }
    state = this.gotoFn[state][l];
    if (this.output[state].length) {
      var foundStrs = this.output[state];
      results.push([i, foundStrs]);
    }
  }
  return results;
};
module.exports = {
  AhoCorasick: AhoCorasick
};

},{}],687:[function(require,module,exports){
"use strict";

var generateUUID = function generateUUID() {
  var d = Date.now();
  return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (c) {
    var r = (d + Math.random() * 16) % 16 | 0;
    d = Math.floor(d / 16);
    return (c === "x" ? r : r & 0x3 | 0x8).toString(16);
  });
};
var remapIntervals = function remapIntervals(oldValue, oldMin, oldMax, newMin, newMax) {
  return (oldValue - oldMin) * (newMax - newMin) / (oldMax - oldMin) + newMin;
};
var escape = function escape(str) {
  return str.replace(/&/g, "&amp;").replace(/'/g, "&apos;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
};
var unescape = function unescape(str) {
  return str.replace(/&amp;/g, "&").replace(/&apos;/g, "'").replace(/&quot;/g, '"').replace(/&lt;/g, "<").replace(/&gt;/g, ">");
};
var getBaseApi = function getBaseApi(apiConfig) {
  var baseApi = "";
  if (apiConfig.useLocalServer) {
    var link = document.createElement("a");
    link.href = apiConfig.base;
    var hostname = window.location.host.split(":")[0];
    var port = link.port;
    baseApi = window.location.protocol + "//" + hostname + ":" + port + "/api/v1";
  } else {
    baseApi = apiConfig.base;
  }
  return baseApi;
};
var getDomain = function getDomain(linkUrl) {
  var domain = "";
  if ("true" === "true") {
    var link = document.createElement("a");
    link.href = linkUrl;
    domain = link.hostname.replace("www.", "");
  } else {
    var myURL = new URL(linkUrl);
    domain = myURL.hostname.replace("www.", "");
  }
  return domain;
};
var sortByProp = function sortByProp(objToSort, desc) {
  var sorted = [];
  Object.keys(objToSort).forEach(function (prop) {
    sorted.push([prop, objToSort[prop]]);
  });
  sorted.sort(function (a, b) {
    return a[1] - b[1];
  });
  if (desc) {
    sorted = sorted.reverse();
  }
  return sorted;
};
var getHSLHue = function getHSLHue(value) {
  return ((1 - value) * 120).toString(10);
};
var getHSLColor = function getHSLColor(value) {
  var hue = getHSLHue(value);
  return ["hsl(", hue, ",100%,50%)"].join("");
};
var hue2rgb = function hue2rgb(p, q, t) {
  if (t < 0) t += 1;
  if (t > 1) t -= 1;
  if (t < 1 / 6) return p + (q - p) * 6 * t;
  if (t < 1 / 2) return q;
  if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;
  return p;
};
var toHex = function toHex(x) {
  var hex = Math.round(x * 255).toString(16);
  return hex.length === 1 ? "0" + hex : hex;
};
var hslToHex = function hslToHex(h, s, l) {
  h /= 360;
  s /= 100;
  l /= 100;
  var r;
  var g;
  var b;
  if (s === 0) {
    r = g = b = l;
  } else {
    var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
    var p = 2 * l - q;
    r = hue2rgb(p, q, h + 1 / 3);
    g = hue2rgb(p, q, h);
    b = hue2rgb(p, q, h - 1 / 3);
  }
  return "#" + toHex(r) + toHex(g) + toHex(b);
};
var getCountersDictionary = function getCountersDictionary(oldDictionary, items) {
  var newDictionary = Object.assign({}, oldDictionary);
  items.forEach(function (key) {
    if (!newDictionary[key]) {
      newDictionary[key] = 0;
    }
    ++newDictionary[key];
  });
  return newDictionary;
};
var getTopKeysSortedByValue = function getTopKeysSortedByValue(dictionary, cnt, desc) {
  return sortByProp(dictionary, desc).slice(0, cnt).map(function (arr) {
    return arr[0];
  });
};
module.exports = {
  generateUUID: generateUUID,
  remapIntervals: remapIntervals,
  escape: escape,
  unescape: unescape,
  getBaseApi: getBaseApi,
  getDomain: getDomain,
  sortByProp: sortByProp,
  getHSLColor: getHSLColor,
  getHSLHue: getHSLHue,
  hslToHex: hslToHex,
  getCountersDictionary: getCountersDictionary,
  getTopKeysSortedByValue: getTopKeysSortedByValue
};

},{}],688:[function(require,module,exports){
"use strict";

var compareByRiskScore = function compareByRiskScore(a, b) {
  if (a.riskScore > b.riskScore) return -1;
  if (a.riskScore < b.riskScore) return 1;
  return 0;
};
var compareByMediaPyRiskScore = function compareByMediaPyRiskScore(a, b) {
  if (a.mediaPyRiskScore > b.mediaPyRiskScore) return -1;
  if (a.mediaPyRiskScore < b.mediaPyRiskScore) return 1;
  return 0;
};
var compareByPositionIdx = function compareByPositionIdx(a, b) {
  return a.getPositionIdx() - b.getPositionIdx();
};
var compareByIdx = function compareByIdx(a, b) {
  return a.occuranceIdx - b.occuranceIdx;
};
var compareByValue = function compareByValue(a, b) {
  if (a > b) return -1;
  if (a < b) return 1;
  return 0;
};
var compareByDate = function compareByDate(a, b) {
  if (new Date(a.getDate()).getTime() > new Date(b.getDate()).getTime()) return -1;
  if (new Date(a.getDate()).getTime() < new Date(b.getDate()).getTime()) return 1;
  return 0;
};
var compareByTitle = function compareByTitle(a, b) {
  if (a.getTitle() < b.getTitle()) return -1;
  if (a.getTitle() > b.getTitle()) return 1;
  return 0;
};
var compareByPriority = function compareByPriority(a, b) {
  if (a.getPriority() > b.getPriority()) return -1;
  if (a.getPriority() < b.getPriority()) return 1;
  return 0;
};
var compareByName = function compareByName(a, b) {
  var textA = a.name;
  var textB = b.name;
  return textA < textB ? -1 : textA > textB ? 1 : 0;
};
var compareByNgram = function compareByNgram(a, b) {
  var textA = a.ngram;
  var textB = b.ngram;
  return textA < textB ? -1 : textA > textB ? 1 : 0;
};
var compareByFullWord = function compareByFullWord(a, b) {
  var textA = a.full_word;
  var textB = b.full_word;
  return textA < textB ? -1 : textA > textB ? 1 : 0;
};
var compareByCount = function compareByCount(a, b) {
  if (a.count > b.count) return -1;
  if (a.count < b.count) return 1;
  return 0;
};
var compareByBaseRisk = function compareByBaseRisk(a, b) {
  if (a.base_risk > b.base_risk) return -1;
  if (a.base_risk < b.base_risk) return 1;
  return 0;
};
var compareByMediaPyGptRiskScore = function compareByMediaPyGptRiskScore(a, b) {
  if (a.gptRiskAssScore > b.gptRiskAssScore) return -1;
  if (a.gptRiskAssScore < b.gptRiskAssScore) return 1;
  return 0;
};
module.exports = {
  compareByRiskScore: compareByRiskScore,
  compareByMediaPyRiskScore: compareByMediaPyRiskScore,
  compareByPositionIdx: compareByPositionIdx,
  compareByIdx: compareByIdx,
  compareByValue: compareByValue,
  compareByDate: compareByDate,
  compareByTitle: compareByTitle,
  compareByPriority: compareByPriority,
  compareByName: compareByName,
  compareByNgram: compareByNgram,
  compareByFullWord: compareByFullWord,
  compareByCount: compareByCount,
  compareByBaseRisk: compareByBaseRisk,
  compareByMediaPyGptRiskScore: compareByMediaPyGptRiskScore
};

},{}],689:[function(require,module,exports){
"use strict";

var getCountiesKeywords = function getCountiesKeywords(personCountry, countriesConfig) {
  var countriesKeywords = "";
  var personCountries = Array.isArray(personCountry) ? [].concat(personCountry) : [personCountry];
  personCountries.forEach(function (persCountry) {
    var countryNames = [];
    var cntry = countriesConfig.find(function (ctr) {
      return ctr["alpha3"].toLowerCase() === persCountry.toLowerCase() || ctr["alpha2"].toLowerCase() === persCountry.toLowerCase() || ctr.name.toLowerCase() === persCountry.toLowerCase();
    });
    if (cntry) {
      cntry.names.forEach(function (name) {
        countryNames = countryNames.concat(Object.values(name));
      });
    }
    if (countryNames.length) {
      if (countriesKeywords && countriesKeywords.length) {
        countriesKeywords += " or ";
      }
      countriesKeywords += "(" + countryNames.join(" or ") + ")";
    }
  });
  return countriesKeywords;
};
module.exports = {
  getCountiesKeywords: getCountiesKeywords
};

},{}],690:[function(require,module,exports){
"use strict";

var elementsForRemove = ["title", "head", "link", "nav", "iframe", "script", "noscript", "footer", "video", "audio", "svg", "canvas", "form", "button", "select", "input", "blockquote"];
var separators = [" ", ",", ".", "...", "_", ";", ":", "'", "\t", "\n", "\r", '"', "!", "?", "+", "=", "(", ")", "[", "]", "{", "}", "<", ">", "\\", "/"];
var articlesPrepositions = ["as", "at", "by", "for", "in", "of", "off", "on", "out", "to", "a", "an", "the", "le", "la", "les", "un", "une", "des", "du", "de", "à", "en", "der", "die", "das", "den", "des", "dem", "ein", "eine", "einen", "auf", "aus", "for", "de", "en", "por", "con", "el", "los", "la", "les", "lo", "un", "unos", "una", "unas"];
var companySuffixes = ["ba", "da", "ga", "sa", "vb", "oc", "pj", "tp", "as", "es", "cni", "csj", "dtl", "oao", "ooo", "lcp", "clp", "ytp", "tvp", "oar", "las", "kbt", "oaz", "proc", "dnuf", "hbmg", "adtl", "csjo", "csjp", "lras", "puorg", "essius", "ynapmoc", "gnidloh", "detimil", "rentrap", "ziewhcs", "gnidart", "gnitekram", "tnemtsevni", "lanoitanretni"];
module.exports = {
  elementsForRemove: elementsForRemove,
  separators: separators,
  articlesPrepositions: articlesPrepositions,
  companySuffixes: companySuffixes
};

},{}],691:[function(require,module,exports){
"use strict";

var onlyUnique = function onlyUnique(value, index, self) {
  return self.indexOf(value) === index;
};
var onlyUniqueByName = function onlyUniqueByName(obj, index, self) {
  return self.findIndex(function (v) {
    return v.name === obj.name;
  }) === index;
};
var onlyUniqueByNgram = function onlyUniqueByNgram(obj, index, self) {
  return self.findIndex(function (v) {
    return v.ngram === obj.ngram;
  }) === index;
};
module.exports = {
  onlyUnique: onlyUnique,
  onlyUniqueByName: onlyUniqueByName,
  onlyUniqueByNgram: onlyUniqueByNgram
};

},{}],692:[function(require,module,exports){
"use strict";

var _require = require("./dictionaries-v4"),
  articlesPrepositions = _require.articlesPrepositions;
var _require2 = require("./ahocorasick"),
  AhoCorasick = _require2.AhoCorasick;
function highlightDocument(input_doc, keywords, elemName, highlightColor, namesMode, onClickFunc) {
  var lscharacters = [];
  var lsmap = {};
  var lscharacters_kw = 0;
  var localeSensitiveMap = function localeSensitiveMap(input) {
    var result = [];
    if (input.length) {
      result[input.length - 1] = "";
    }
    for (var i = 0; i < input.length; i++) {
      var symbol = input[i];
      var mapped = lsmap[symbol];
      if (mapped !== undefined) {
        result[i] = mapped;
      } else {
        var flag = true;
        for (var j = 0; j < (lscharacters_kw || lscharacters.length); j++) {
          var c = lscharacters[j];
          if (symbol.localeCompare(c, "en", {
            sensitivity: "base"
          }) === 0) {
            flag = false;
            result[i] = c;
            lsmap[symbol] = c;
            break;
          }
        }
        if (flag) {
          lscharacters.push(symbol);
          lsmap[symbol] = symbol;
          result[i] = symbol;
        }
      }
    }
    return result.join("");
  };
  if (keywords !== undefined) {
    keywords = keywords.filter(function (x) {
      return !!x;
    });
    if (!namesMode) {
      keywords = keywords.join(" ").split(" ");
      keywords = keywords.filter(function (x) {
        return x.length > 3;
      });
    }
    keywords = keywords.filter(function (x) {
      return x.length >= 2;
    });
    keywords = keywords.filter(function (x) {
      return articlesPrepositions.filter(function (prep) {
        return prep === x;
      }).length === 0;
    });
    keywords = keywords.map(function (x) {
      return x.toUpperCase();
    });
  }
  var ac = new AhoCorasick(keywords.map(localeSensitiveMap));
  lscharacters_kw = lscharacters.length;
  var highlightPieceOfText = function highlightPieceOfText(input_text) {
    var separators = [",", ".", "_", ";", "'", "\t", "\n", "\r", '"', "!", "?", "-"];
    if (!namesMode) {
      separators.push(" ");
    } else {
      separators = separators.filter(function (sep) {
        return sep !== "'";
      });
    }
    var current_splits = [{
      text: input_text,
      type: "general"
    }];
    separators.forEach(function (separator) {
      var new_splits = [];
      current_splits.forEach(function (chunk) {
        if (chunk.type == "general") {
          var spl = chunk.text.split(separator);
          for (var i = 0; i < spl.length; i++) {
            if (i > 0) {
              new_splits.push({
                text: separator,
                type: "separator"
              });
            }
            new_splits.push({
              text: spl[i],
              type: "general"
            });
          }
        } else {
          new_splits.push(chunk);
        }
      });
      current_splits = new_splits;
    });
    var new_splits = [];
    current_splits.forEach(function (chunk) {
      if (chunk.type == "general") {
        var text = chunk.text;
        var ac_result = ac.search(localeSensitiveMap(text.toUpperCase()));
        var raw_keyword_indices = [];
        ac_result.forEach(function (res) {
          var end_index = res[0];
          res[1].forEach(function (word) {
            raw_keyword_indices.push({
              begin_index: end_index - word.length + 1,
              end_index: end_index
            });
          });
        });
        raw_keyword_indices.sort(function (l, r) {
          if (l.begin_index !== r.begin_index) {
            return l.begin_index < r.begin_index ? -1 : 1;
          } else {
            return l.end_index > r.end_index ? -1 : l.end_index < r.end_index ? 1 : 0;
          }
        });
        var cur_end = -1;
        var keyword_indices = [];
        raw_keyword_indices.forEach(function (pair) {
          if (pair.begin_index > cur_end) {
            cur_end = pair.end_index;
            keyword_indices.push(pair);
          }
        });
        var offset = 0;
        if (keyword_indices.length) {
          keyword_indices.forEach(function (pair) {
            if (text.substring(0, pair.begin_index - offset).length) {
              new_splits.push({
                text: text.substring(0, pair.begin_index - offset),
                type: "general"
              });
            }
            var curkeyword = text.substring(pair.begin_index - offset, pair.end_index + 1 - offset);
            if (curkeyword.length) {
              new_splits.push({
                text: curkeyword,
                type: "prekeyword"
              });
            }
            text = text.substring(pair.end_index + 1 - offset);
            offset += pair.end_index + 1 - offset;
          });
          if (text.length) {
            new_splits.push({
              text: text,
              type: "general"
            });
          }
        } else {
          new_splits.push(chunk);
        }
      } else {
        new_splits.push(chunk);
      }
    });
    current_splits = new_splits;
    if (namesMode) {
      var names_splits = [];
      current_splits.forEach(function (chunk) {
        if (chunk.type !== "general") {
          names_splits.push(chunk);
        } else {
          var texts = chunk.text.split(" ");
          for (var i = 0; i < texts.length; i++) {
            names_splits.push({
              text: texts[i],
              type: "general"
            });
            if (i < texts.length - 1) {
              names_splits.push({
                text: " ",
                type: "separator"
              });
            }
          }
        }
      });
      current_splits = names_splits;
    }
    var check_length = function check_length(chunk_index) {
      return current_splits[chunk_index].type === "prekeyword" && current_splits[chunk_index].text.length >= 6;
    };
    var check_neighbors = function check_neighbors(chunk_index) {
      if (chunk_index > 0 && current_splits[chunk_index - 1].type == "keyword" && current_splits[chunk_index].type === "prekeyword") {
        return true;
      }
      if (chunk_index > 1 && current_splits[chunk_index - 1].type == "separator" && current_splits[chunk_index - 2].type == "keyword" && current_splits[chunk_index].type === "prekeyword") {
        return true;
      }
      if (chunk_index < current_splits.length - 1 && current_splits[chunk_index + 1].type == "keyword" && current_splits[chunk_index].type === "prekeyword") {
        return true;
      }
      if (chunk_index < current_splits.length - 2 && current_splits[chunk_index + 1].type == "separator" && current_splits[chunk_index + 2].type == "keyword" && current_splits[chunk_index].type === "prekeyword") {
        return true;
      }
      return false;
    };
    var check_left_separator = function check_left_separator(chunk_index) {
      if (current_splits[chunk_index].text.length < 3) {
        return false;
      }
      if ((chunk_index > 0 && current_splits[chunk_index - 1].type == "separator" || chunk_index === 0) && current_splits[chunk_index].type === "prekeyword") {
        return true;
      }
      return false;
    };
    var was_changed = true;
    while (was_changed) {
      was_changed = false;
      for (var j = 0; j < current_splits.length; j++) {
        if (check_length(j) || check_neighbors(j) || check_left_separator(j)) {
          current_splits[j].type = "keyword";
          was_changed = true;
        }
      }
    }
    var output_chunks = [];
    var current_text = "";
    current_splits.forEach(function (chunk) {
      if (chunk.type == "keyword") {
        if (current_text.length) {
          output_chunks.push({
            type: "text",
            text: current_text
          });
          current_text = "";
        }
        output_chunks.push(chunk);
      } else {
        current_text += chunk.text;
      }
    });
    if (current_text.length) {
      output_chunks.push({
        type: "text",
        text: current_text
      });
      current_text = "";
    }
    return output_chunks;
  };
  var treewalker = null;
  var nodeList = [];
  var iemode = false;
  try {
    treewalker = document.createTreeWalker(input_doc, NodeFilter.SHOW_TEXT);
    var currentNode = null;
    currentNode = treewalker.currentNode;
    while (currentNode) {
      nodeList.push(currentNode);
      currentNode = treewalker.nextNode();
    }
  } catch (e) {
    var _textNodesUnder = function textNodesUnder(node) {
      var all = [];
      for (var node = node.firstChild; node; node = node.nextSibling) {
        if (node.nodeType == 3) {
          all.push(node);
        } else {
          all = all.concat(_textNodesUnder(node));
        }
      }
      return all;
    };
    nodeList = [];
    nodeList = _textNodesUnder(input_doc);
    iemode = true;
  }
  for (var i = 0; i < nodeList.length; i++) {
    var current_node = nodeList[i];
    if (current_node.textContent && current_node.textContent.trim()) {
      var splits = highlightPieceOfText(current_node.textContent);
      var parent = current_node.parentNode;
      if (parent.nodeName === "a") {
        continue;
      }
      if (!splits.some(function (chunk) {
        return chunk.type === "keyword";
      })) {
        continue;
      }
      if (parent.hasAttribute("donothighlight")) {
        continue;
      }
      splits.forEach(function (chunk) {
        if (chunk.type == "keyword") {
          var elem = input_doc.createElement(elemName);
          parent.insertBefore(elem, current_node);
          var text = input_doc.createTextNode(chunk.text);
          elem.appendChild(text);
          var styleAttr = input_doc.createAttribute("style");
          if (elemName === "a" && namesMode) {
            styleAttr.value = "background-color: " + highlightColor + "; font-style:italic;";
          } else {
            styleAttr.value = "background-color: " + highlightColor;
          }
          elem.setAttributeNode(styleAttr);
          if (elemName === "a" && onClickFunc) {
            var hrefAttr = input_doc.createAttribute("href");
            hrefAttr.value = "#";
            elem.setAttributeNode(hrefAttr);
            var onClickAtt = input_doc.createAttribute("onclick");
            onClickAtt.value = onClickFunc + '("' + chunk.text + '")';
            elem.setAttributeNode(onClickAtt);
            var pepAttr = input_doc.createAttribute("donothighlight");
            elem.setAttributeNode(pepAttr);
          }
        } else {
          if (!iemode) {
            var text = input_doc.createTextNode(chunk.text);
            parent.insertBefore(text, current_node);
          } else {
            var span = input_doc.createElement("span");
            parent.insertBefore(span, current_node);
            var text = input_doc.createTextNode(chunk.text);
            span.appendChild(text);
          }
        }
      });
      parent.removeChild(current_node);
    }
  }
}
module.exports = {
  highlightDocument: highlightDocument
};

},{"./ahocorasick":686,"./dictionaries-v4":690}],693:[function(require,module,exports){
"use strict";

var makeResponseLogString = function makeResponseLogString(response) {
  return "Status: " + (response.status || "<NA>") + "; statusText: " + (response.statusText || "<NA>") + "; method: " + (response.config.method || "<NA>") + "; URL: " + (response.config.url || "<NA>") + "; xhrStatus: " + (response.xhrStatus || "<NA>") + "; withCredentials: " + response.config.withCredentials + "; data: " + (JSON.stringify(response.data) || "<NA>");
};
module.exports = {
  makeResponseLogString: makeResponseLogString
};

},{}],694:[function(require,module,exports){
"use strict";

var mapNamedEntity = function mapNamedEntity(ne) {
  return {
    alias: ne.alias,
    count: ne.count,
    db_id: ne.db_id,
    main: ne.main,
    name: Array.isArray(ne.name) && ne.name.length ? ne.name[0] : ne.name,
    occurrence: ne.occurrence,
    topics: ne.topics,
    type: ne.type_ ? ne.type_ : ne.type
  };
};
var mapRiskKeyword = function mapRiskKeyword(item) {
  return item;
};
var mapConnectionGraphItem = function mapConnectionGraphItem(ne) {
  return {
    alias: ne.alias,
    count: ne.count,
    db_id: ne.db_id,
    main: ne.main,
    name: Array.isArray(ne.name) && ne.name.length ? ne.name[0] : ne.name,
    occurrence: ne.occurrence,
    topics: ne.topics,
    type: ne.type_ ? ne.type_ : ne.type
  };
};
var mapEntityName = function mapEntityName(ne) {
  return Array.isArray(ne.name) && ne.name.length ? ne.name[0] : ne.name;
};
module.exports = {
  mapNamedEntity: mapNamedEntity,
  mapRiskKeyword: mapRiskKeyword,
  mapConnectionGraphItem: mapConnectionGraphItem,
  mapEntityName: mapEntityName
};

},{}],695:[function(require,module,exports){
"use strict";

var StopWatch = function () {
  function StopWatch(performance) {
    this.startTime = 0;
    this.stopTime = 0;
    this.running = false;
    this.performance = performance === false ? false : !!window.performance;
  }
  var _proto = StopWatch.prototype;
  _proto.currentTime = function currentTime() {
    return this.performance ? window.performance.now() : Date.now();
  };
  _proto.start = function start() {
    this.startTime = this.currentTime();
    this.running = true;
  };
  _proto.stop = function stop() {
    this.stopTime = this.currentTime();
    this.running = false;
  };
  _proto.reset = function reset() {
    this.startTime = 0;
    this.stopTime = 0;
    this.running = false;
  };
  _proto.getElapsedMilliseconds = function getElapsedMilliseconds() {
    if (this.running) {
      this.stopTime = this.currentTime();
    }
    return this.stopTime - this.startTime;
  };
  _proto.getElapsedSeconds = function getElapsedSeconds() {
    return this.getElapsedMilliseconds() / 1000;
  };
  return StopWatch;
}();
module.exports = {
  StopWatch: StopWatch
};

},{}],696:[function(require,module,exports){
"use strict";

var _require = require("./dictionaries-v4"),
  separators = _require.separators,
  companySuffixes = _require.companySuffixes;
if (!String.prototype.replaceAll) {
  String.prototype.replaceAll = function (str, newStr) {
    if (Object.prototype.toString.call(str).toLowerCase() === "[object regexp]") {
      return this.replace(str, newStr);
    }
    return this.replace(new RegExp(str, "g"), newStr);
  };
}
var reverseString = function reverseString(str) {
  return str.split("").reverse().join("");
};
var checkStringInArray = function checkStringInArray(str, arr) {
  return arr.filter(function (el) {
    return el === str;
  }).length > 0;
};
var dropCompanySuffix = function dropCompanySuffix(companyName) {
  var result = reverseString((companyName || "").trim());
  var preResult = "";
  var pattern = /[^a-zA-Z\u00C0-\u024F\u1E00-\u1EFF0-9\&\-\*\']/;
  var match = pattern.exec(result);
  while (match && match.index === 0) {
    result = result.substring(match.index + 1);
    match = pattern.exec(result);
  }
  if (!match) {
    result = "";
  } else {
    while (match) {
      var tmp = result.substring(0, match.index);
      if (!checkStringInArray(tmp.toLowerCase(), companySuffixes)) {
        preResult = "" + preResult + tmp + " ";
      }
      result = result.substring(match.index + 1);
      match = pattern.exec(result);
      while (match && match.index === 0) {
        result = result.substring(match.index + 1);
        match = pattern.exec(result);
      }
    }
    result = preResult + result;
  }
  if (!result.length) {
    result = companyName;
  } else {
    result = reverseString(result);
  }
  return result;
};
var findAllOccurances = function findAllOccurances(searchStr, str, wholeWord, partly) {
  var searchStrLen = searchStr.length;
  if (searchStrLen === 0) {
    return [];
  }
  var startIndex = 0;
  var index = 0;
  var indices = [];
  str = str.toLowerCase();
  searchStr = searchStr.toLowerCase();
  while ((index = str.indexOf(searchStr, startIndex)) > -1) {
    var shouldAdd = true;
    if (wholeWord) {
      if ((index === 0 || separators.find(function (sep) {
        return sep === str[index - 1];
      })) && index + searchStrLen < str.length && (separators.find(function (sep) {
        return sep === str[index + searchStrLen];
      }) || index + searchStrLen === str.length)) {
        shouldAdd = true;
      } else {
        shouldAdd = false;
      }
    } else if (partly) {
      shouldAdd = !!(index === 0 || separators.find(function (sep) {
        return sep === str[index - 1];
      }));
    }
    if (shouldAdd) {
      indices.push(index);
    }
    startIndex = index + searchStrLen;
  }
  return indices;
};
var levenshtein = function levenshtein(a, b) {
  if (a.length === 0) return b.length;
  if (b.length === 0) return a.length;
  if (a.length > b.length) {
    var tmp = a;
    a = b;
    b = tmp;
  }
  var i;
  var j;
  var prev;
  var val;
  var row = Array(a.length + 1);
  for (i = 0; i <= a.length; i++) {
    row[i] = i;
  }
  for (i = 1; i <= b.length; i++) {
    prev = i;
    for (j = 1; j <= a.length; j++) {
      if (b[i - 1] === a[j - 1]) {
        val = row[j - 1];
      } else {
        val = Math.min(row[j - 1] + 1, Math.min(prev + 1, row[j] + 1));
      }
      row[j - 1] = prev;
      prev = val;
    }
    row[a.length] = prev;
  }
  return row[a.length];
};
var replaceBetween = function replaceBetween(str, startIdx, endIdx, what) {
  return str.substring(0, startIdx) + what + str.substring(endIdx);
};
var getWordsCountBetween = function getWordsCountBetween(str, firstIdx, lastIdx) {
  return str.substring(firstIdx, lastIdx).trim().split(" ").length;
};
var checkSeparatorBetween = function checkSeparatorBetween(str, firstIdx, lastIdx) {
  var temp = str.substring(firstIdx, lastIdx).trim();
  return separators.filter(function (sep) {
    return sep !== " " && temp.indexOf(sep) !== -1;
  }).length > 0;
};
var getWordSynonims = function getWordSynonims(word, text, countBetween) {
  var synonims = [];
  word = word.toLowerCase();
  text = text.toLowerCase();
  if (!countBetween) {
    countBetween = 1;
  }
  (separators || []).forEach(function (sep) {
    var re = new RegExp("\\" + sep, "g");
    text = text.replace(re, " ");
  });
  var textWords = text.split(" ");
  for (var i = 0; i < textWords.length; i++) {
    if (levenshtein(word, textWords[i]) <= countBetween) {
      synonims.push(textWords[i]);
    }
  }
  return synonims;
};
var replaceManySpaces = function replaceManySpaces(text, isReplaceNewLine) {
  var result = "";
  if (isReplaceNewLine) {
    result = text.replaceAll(/\s+/g, " ").trim();
  } else {
    result = text.replaceAll(/[\t|\f|\v| ]+/g, " ").replaceAll(/\r/g, "\n").replaceAll(/[\n]+/g, "\n").replaceAll("\n", "\n\n").trim();
  }
  return result;
};
var checkPersonIsMentionedInText = function checkPersonIsMentionedInText(firstName, lastName, text) {
  var namePresented = false;
  var shouldCheckFirstName = firstName.length >= 3;
  var shouldCheckLastName = lastName.length >= 5;
  var firstNameSynonims = shouldCheckFirstName ? getWordSynonims(firstName.toLowerCase(), text.toLowerCase(), firstName.length >= 5 ? 2 : 1) : [firstName];
  var lastNameSynonims = shouldCheckLastName ? getWordSynonims(lastName.toLowerCase(), text.toLowerCase(), lastName.length >= 5 ? 2 : 1) : [lastName];
  var firstNameSynonimsOccurances = [];
  var lastNameSynonimsOccurances = [];
  firstNameSynonims.forEach(function (synonim) {
    var occurances = findAllOccurances(synonim, text, true, false);
    occurances.forEach(function (idx) {
      firstNameSynonimsOccurances.push(idx);
    });
  });
  lastNameSynonims.forEach(function (synonim) {
    var occurances = findAllOccurances(synonim, text, true, false);
    occurances.forEach(function (idx) {
      lastNameSynonimsOccurances.push(idx);
    });
  });
  for (var i = 0; i < firstNameSynonimsOccurances.length && !namePresented; i++) {
    for (var j = 0; j < lastNameSynonimsOccurances.length && !namePresented; j++) {
      if (getWordsCountBetween(text, firstNameSynonimsOccurances[i], lastNameSynonimsOccurances[j]) <= 1 && !checkSeparatorBetween(text, firstNameSynonimsOccurances[i], lastNameSynonimsOccurances[j])) {
        namePresented = true;
        break;
      }
    }
  }
  return namePresented;
};
module.exports = {
  dropCompanySuffix: dropCompanySuffix,
  findAllOccurances: findAllOccurances,
  levenshtein: levenshtein,
  reverseString: reverseString,
  replaceBetween: replaceBetween,
  getWordsCountBetween: getWordsCountBetween,
  checkSeparatorBetween: checkSeparatorBetween,
  checkStringInArray: checkStringInArray,
  getWordSynonims: getWordSynonims,
  replaceManySpaces: replaceManySpaces,
  checkPersonIsMentionedInText: checkPersonIsMentionedInText
};

},{"./dictionaries-v4":690}],697:[function(require,module,exports){
"use strict";

module.exports = {
  GOOGLE_SEARCH_TYPE: "Google Search",
  GOOGLE_NEWS_TYPE: "Google News",
  EXTRA_SOURCES_TYPE: "Extra Sources",
  STOCK_MARKETS_TYPE: "Stock Market News",
  ALEPH_OCCRP_TYPE: "Aleph OCCRP",
  OPEN_SANCTIONS_TYPE: "OpenSanctions",
  OPEN_CORPORATES_TYPE: "OpenCorporates",
  GOOGLE_SEARCH_SOURCE_CODE: "google_search",
  GOOGLE_NEWS_SOURCE_CODE: "google_news",
  EXTRA_SOURCE_SOURCE_CODE: "extra_sources",
  STOCK_MARKETS_SOURCE_CODE: "stock_markets",
  ALEPH_OCCRP_SOURCE_CODE: "aleph_occrp",
  OPEN_SANCTIONS_SOURCE_CODE: "open_sanctions",
  OPEN_CORPORATES_SOURCE_CODE: "open_corporates",
  STOCK_MARKET_SOURCE_CODE: "stock_market"
};

},{}],698:[function(require,module,exports){
"use strict";

require("core-js/modules/es.symbol.js");
require("core-js/modules/es.symbol.description.js");
require("core-js/modules/es.symbol.async-iterator.js");
require("core-js/modules/es.symbol.has-instance.js");
require("core-js/modules/es.symbol.is-concat-spreadable.js");
require("core-js/modules/es.symbol.iterator.js");
require("core-js/modules/es.symbol.match.js");
require("core-js/modules/es.symbol.replace.js");
require("core-js/modules/es.symbol.search.js");
require("core-js/modules/es.symbol.species.js");
require("core-js/modules/es.symbol.split.js");
require("core-js/modules/es.symbol.to-primitive.js");
require("core-js/modules/es.symbol.to-string-tag.js");
require("core-js/modules/es.symbol.unscopables.js");
require("core-js/modules/es.array.concat.js");
require("core-js/modules/es.array.copy-within.js");
require("core-js/modules/es.array.every.js");
require("core-js/modules/es.array.fill.js");
require("core-js/modules/es.array.filter.js");
require("core-js/modules/es.array.find.js");
require("core-js/modules/es.array.find-index.js");
require("core-js/modules/es.array.flat.js");
require("core-js/modules/es.array.flat-map.js");
require("core-js/modules/es.array.for-each.js");
require("core-js/modules/es.array.from.js");
require("core-js/modules/es.array.includes.js");
require("core-js/modules/es.array.index-of.js");
require("core-js/modules/es.array.is-array.js");
require("core-js/modules/es.array.iterator.js");
require("core-js/modules/es.array.join.js");
require("core-js/modules/es.array.last-index-of.js");
require("core-js/modules/es.array.map.js");
require("core-js/modules/es.array.of.js");
require("core-js/modules/es.array.reduce.js");
require("core-js/modules/es.array.reduce-right.js");
require("core-js/modules/es.array.slice.js");
require("core-js/modules/es.array.some.js");
require("core-js/modules/es.array.sort.js");
require("core-js/modules/es.array.species.js");
require("core-js/modules/es.array.splice.js");
require("core-js/modules/es.array.unscopables.flat.js");
require("core-js/modules/es.array.unscopables.flat-map.js");
require("core-js/modules/es.array-buffer.constructor.js");
require("core-js/modules/es.array-buffer.is-view.js");
require("core-js/modules/es.array-buffer.slice.js");
require("core-js/modules/es.data-view.js");
require("core-js/modules/es.date.now.js");
require("core-js/modules/es.date.to-iso-string.js");
require("core-js/modules/es.date.to-json.js");
require("core-js/modules/es.date.to-primitive.js");
require("core-js/modules/es.date.to-string.js");
require("core-js/modules/es.function.bind.js");
require("core-js/modules/es.function.has-instance.js");
require("core-js/modules/es.function.name.js");
require("core-js/modules/es.json.to-string-tag.js");
require("core-js/modules/es.map.js");
require("core-js/modules/es.math.acosh.js");
require("core-js/modules/es.math.asinh.js");
require("core-js/modules/es.math.atanh.js");
require("core-js/modules/es.math.cbrt.js");
require("core-js/modules/es.math.clz32.js");
require("core-js/modules/es.math.cosh.js");
require("core-js/modules/es.math.expm1.js");
require("core-js/modules/es.math.fround.js");
require("core-js/modules/es.math.hypot.js");
require("core-js/modules/es.math.imul.js");
require("core-js/modules/es.math.log10.js");
require("core-js/modules/es.math.log1p.js");
require("core-js/modules/es.math.log2.js");
require("core-js/modules/es.math.sign.js");
require("core-js/modules/es.math.sinh.js");
require("core-js/modules/es.math.tanh.js");
require("core-js/modules/es.math.to-string-tag.js");
require("core-js/modules/es.math.trunc.js");
require("core-js/modules/es.number.constructor.js");
require("core-js/modules/es.number.epsilon.js");
require("core-js/modules/es.number.is-finite.js");
require("core-js/modules/es.number.is-integer.js");
require("core-js/modules/es.number.is-nan.js");
require("core-js/modules/es.number.is-safe-integer.js");
require("core-js/modules/es.number.max-safe-integer.js");
require("core-js/modules/es.number.min-safe-integer.js");
require("core-js/modules/es.number.parse-float.js");
require("core-js/modules/es.number.parse-int.js");
require("core-js/modules/es.number.to-fixed.js");
require("core-js/modules/es.number.to-precision.js");
require("core-js/modules/es.object.assign.js");
require("core-js/modules/es.object.create.js");
require("core-js/modules/es.object.define-getter.js");
require("core-js/modules/es.object.define-properties.js");
require("core-js/modules/es.object.define-property.js");
require("core-js/modules/es.object.define-setter.js");
require("core-js/modules/es.object.entries.js");
require("core-js/modules/es.object.freeze.js");
require("core-js/modules/es.object.from-entries.js");
require("core-js/modules/es.object.get-own-property-descriptor.js");
require("core-js/modules/es.object.get-own-property-descriptors.js");
require("core-js/modules/es.object.get-own-property-names.js");
require("core-js/modules/es.object.get-prototype-of.js");
require("core-js/modules/es.object.is.js");
require("core-js/modules/es.object.is-extensible.js");
require("core-js/modules/es.object.is-frozen.js");
require("core-js/modules/es.object.is-sealed.js");
require("core-js/modules/es.object.keys.js");
require("core-js/modules/es.object.lookup-getter.js");
require("core-js/modules/es.object.lookup-setter.js");
require("core-js/modules/es.object.prevent-extensions.js");
require("core-js/modules/es.object.seal.js");
require("core-js/modules/es.object.set-prototype-of.js");
require("core-js/modules/es.object.to-string.js");
require("core-js/modules/es.object.values.js");
require("core-js/modules/es.parse-float.js");
require("core-js/modules/es.parse-int.js");
require("core-js/modules/es.promise.js");
require("core-js/modules/es.promise.finally.js");
require("core-js/modules/es.reflect.apply.js");
require("core-js/modules/es.reflect.construct.js");
require("core-js/modules/es.reflect.define-property.js");
require("core-js/modules/es.reflect.delete-property.js");
require("core-js/modules/es.reflect.get.js");
require("core-js/modules/es.reflect.get-own-property-descriptor.js");
require("core-js/modules/es.reflect.get-prototype-of.js");
require("core-js/modules/es.reflect.has.js");
require("core-js/modules/es.reflect.is-extensible.js");
require("core-js/modules/es.reflect.own-keys.js");
require("core-js/modules/es.reflect.prevent-extensions.js");
require("core-js/modules/es.reflect.set.js");
require("core-js/modules/es.reflect.set-prototype-of.js");
require("core-js/modules/es.regexp.constructor.js");
require("core-js/modules/es.regexp.exec.js");
require("core-js/modules/es.regexp.flags.js");
require("core-js/modules/es.regexp.to-string.js");
require("core-js/modules/es.set.js");
require("core-js/modules/es.string.code-point-at.js");
require("core-js/modules/es.string.ends-with.js");
require("core-js/modules/es.string.from-code-point.js");
require("core-js/modules/es.string.includes.js");
require("core-js/modules/es.string.iterator.js");
require("core-js/modules/es.string.match.js");
require("core-js/modules/es.string.pad-end.js");
require("core-js/modules/es.string.pad-start.js");
require("core-js/modules/es.string.raw.js");
require("core-js/modules/es.string.repeat.js");
require("core-js/modules/es.string.replace.js");
require("core-js/modules/es.string.search.js");
require("core-js/modules/es.string.split.js");
require("core-js/modules/es.string.starts-with.js");
require("core-js/modules/es.string.trim.js");
require("core-js/modules/es.string.trim-end.js");
require("core-js/modules/es.string.trim-start.js");
require("core-js/modules/es.string.anchor.js");
require("core-js/modules/es.string.big.js");
require("core-js/modules/es.string.blink.js");
require("core-js/modules/es.string.bold.js");
require("core-js/modules/es.string.fixed.js");
require("core-js/modules/es.string.fontcolor.js");
require("core-js/modules/es.string.fontsize.js");
require("core-js/modules/es.string.italics.js");
require("core-js/modules/es.string.link.js");
require("core-js/modules/es.string.small.js");
require("core-js/modules/es.string.strike.js");
require("core-js/modules/es.string.sub.js");
require("core-js/modules/es.string.sup.js");
require("core-js/modules/es.typed-array.float32-array.js");
require("core-js/modules/es.typed-array.float64-array.js");
require("core-js/modules/es.typed-array.int8-array.js");
require("core-js/modules/es.typed-array.int16-array.js");
require("core-js/modules/es.typed-array.int32-array.js");
require("core-js/modules/es.typed-array.uint8-array.js");
require("core-js/modules/es.typed-array.uint8-clamped-array.js");
require("core-js/modules/es.typed-array.uint16-array.js");
require("core-js/modules/es.typed-array.uint32-array.js");
require("core-js/modules/es.typed-array.copy-within.js");
require("core-js/modules/es.typed-array.every.js");
require("core-js/modules/es.typed-array.fill.js");
require("core-js/modules/es.typed-array.filter.js");
require("core-js/modules/es.typed-array.find.js");
require("core-js/modules/es.typed-array.find-index.js");
require("core-js/modules/es.typed-array.for-each.js");
require("core-js/modules/es.typed-array.from.js");
require("core-js/modules/es.typed-array.includes.js");
require("core-js/modules/es.typed-array.index-of.js");
require("core-js/modules/es.typed-array.iterator.js");
require("core-js/modules/es.typed-array.join.js");
require("core-js/modules/es.typed-array.last-index-of.js");
require("core-js/modules/es.typed-array.map.js");
require("core-js/modules/es.typed-array.of.js");
require("core-js/modules/es.typed-array.reduce.js");
require("core-js/modules/es.typed-array.reduce-right.js");
require("core-js/modules/es.typed-array.reverse.js");
require("core-js/modules/es.typed-array.set.js");
require("core-js/modules/es.typed-array.slice.js");
require("core-js/modules/es.typed-array.some.js");
require("core-js/modules/es.typed-array.sort.js");
require("core-js/modules/es.typed-array.subarray.js");
require("core-js/modules/es.typed-array.to-locale-string.js");
require("core-js/modules/es.typed-array.to-string.js");
require("core-js/modules/es.weak-map.js");
require("core-js/modules/es.weak-set.js");
require("core-js/modules/web.dom-collections.for-each.js");
require("core-js/modules/web.dom-collections.iterator.js");
require("core-js/modules/web.immediate.js");
require("core-js/modules/web.queue-microtask.js");
require("core-js/modules/web.timers.js");
require("core-js/modules/web.url.js");
require("core-js/modules/web.url.to-json.js");
require("core-js/modules/web.url-search-params.js");
require("regenerator-runtime/runtime");
var _require = require("./mediasearch-v3"),
  MediaSearchService = _require.MediaSearchService;
var _require2 = require("./media-search-v2/services/http"),
  ConfigRequestsServiceV4 = _require2.ConfigRequestsServiceV4;
module.exports = {
  MediaSearchService: MediaSearchService,
  ConfigRequestsServiceV4: ConfigRequestsServiceV4
};

},{"./media-search-v2/services/http":861,"./mediasearch-v3":909,"core-js/modules/es.array-buffer.constructor.js":223,"core-js/modules/es.array-buffer.is-view.js":224,"core-js/modules/es.array-buffer.slice.js":225,"core-js/modules/es.array.concat.js":226,"core-js/modules/es.array.copy-within.js":227,"core-js/modules/es.array.every.js":228,"core-js/modules/es.array.fill.js":229,"core-js/modules/es.array.filter.js":230,"core-js/modules/es.array.find-index.js":231,"core-js/modules/es.array.find.js":232,"core-js/modules/es.array.flat-map.js":233,"core-js/modules/es.array.flat.js":234,"core-js/modules/es.array.for-each.js":235,"core-js/modules/es.array.from.js":236,"core-js/modules/es.array.includes.js":237,"core-js/modules/es.array.index-of.js":238,"core-js/modules/es.array.is-array.js":239,"core-js/modules/es.array.iterator.js":240,"core-js/modules/es.array.join.js":241,"core-js/modules/es.array.last-index-of.js":242,"core-js/modules/es.array.map.js":243,"core-js/modules/es.array.of.js":244,"core-js/modules/es.array.reduce-right.js":245,"core-js/modules/es.array.reduce.js":246,"core-js/modules/es.array.slice.js":247,"core-js/modules/es.array.some.js":248,"core-js/modules/es.array.sort.js":249,"core-js/modules/es.array.species.js":250,"core-js/modules/es.array.splice.js":251,"core-js/modules/es.array.unscopables.flat-map.js":252,"core-js/modules/es.array.unscopables.flat.js":253,"core-js/modules/es.data-view.js":255,"core-js/modules/es.date.now.js":256,"core-js/modules/es.date.to-iso-string.js":257,"core-js/modules/es.date.to-json.js":258,"core-js/modules/es.date.to-primitive.js":259,"core-js/modules/es.date.to-string.js":260,"core-js/modules/es.function.bind.js":261,"core-js/modules/es.function.has-instance.js":262,"core-js/modules/es.function.name.js":263,"core-js/modules/es.json.to-string-tag.js":265,"core-js/modules/es.map.js":267,"core-js/modules/es.math.acosh.js":268,"core-js/modules/es.math.asinh.js":269,"core-js/modules/es.math.atanh.js":270,"core-js/modules/es.math.cbrt.js":271,"core-js/modules/es.math.clz32.js":272,"core-js/modules/es.math.cosh.js":273,"core-js/modules/es.math.expm1.js":274,"core-js/modules/es.math.fround.js":275,"core-js/modules/es.math.hypot.js":276,"core-js/modules/es.math.imul.js":277,"core-js/modules/es.math.log10.js":278,"core-js/modules/es.math.log1p.js":279,"core-js/modules/es.math.log2.js":280,"core-js/modules/es.math.sign.js":281,"core-js/modules/es.math.sinh.js":282,"core-js/modules/es.math.tanh.js":283,"core-js/modules/es.math.to-string-tag.js":284,"core-js/modules/es.math.trunc.js":285,"core-js/modules/es.number.constructor.js":286,"core-js/modules/es.number.epsilon.js":287,"core-js/modules/es.number.is-finite.js":288,"core-js/modules/es.number.is-integer.js":289,"core-js/modules/es.number.is-nan.js":290,"core-js/modules/es.number.is-safe-integer.js":291,"core-js/modules/es.number.max-safe-integer.js":292,"core-js/modules/es.number.min-safe-integer.js":293,"core-js/modules/es.number.parse-float.js":294,"core-js/modules/es.number.parse-int.js":295,"core-js/modules/es.number.to-fixed.js":296,"core-js/modules/es.number.to-precision.js":297,"core-js/modules/es.object.assign.js":298,"core-js/modules/es.object.create.js":299,"core-js/modules/es.object.define-getter.js":300,"core-js/modules/es.object.define-properties.js":301,"core-js/modules/es.object.define-property.js":302,"core-js/modules/es.object.define-setter.js":303,"core-js/modules/es.object.entries.js":304,"core-js/modules/es.object.freeze.js":305,"core-js/modules/es.object.from-entries.js":306,"core-js/modules/es.object.get-own-property-descriptor.js":307,"core-js/modules/es.object.get-own-property-descriptors.js":308,"core-js/modules/es.object.get-own-property-names.js":309,"core-js/modules/es.object.get-prototype-of.js":311,"core-js/modules/es.object.is-extensible.js":312,"core-js/modules/es.object.is-frozen.js":313,"core-js/modules/es.object.is-sealed.js":314,"core-js/modules/es.object.is.js":315,"core-js/modules/es.object.keys.js":316,"core-js/modules/es.object.lookup-getter.js":317,"core-js/modules/es.object.lookup-setter.js":318,"core-js/modules/es.object.prevent-extensions.js":319,"core-js/modules/es.object.seal.js":320,"core-js/modules/es.object.set-prototype-of.js":321,"core-js/modules/es.object.to-string.js":322,"core-js/modules/es.object.values.js":323,"core-js/modules/es.parse-float.js":324,"core-js/modules/es.parse-int.js":325,"core-js/modules/es.promise.finally.js":329,"core-js/modules/es.promise.js":330,"core-js/modules/es.reflect.apply.js":334,"core-js/modules/es.reflect.construct.js":335,"core-js/modules/es.reflect.define-property.js":336,"core-js/modules/es.reflect.delete-property.js":337,"core-js/modules/es.reflect.get-own-property-descriptor.js":338,"core-js/modules/es.reflect.get-prototype-of.js":339,"core-js/modules/es.reflect.get.js":340,"core-js/modules/es.reflect.has.js":341,"core-js/modules/es.reflect.is-extensible.js":342,"core-js/modules/es.reflect.own-keys.js":343,"core-js/modules/es.reflect.prevent-extensions.js":344,"core-js/modules/es.reflect.set-prototype-of.js":345,"core-js/modules/es.reflect.set.js":346,"core-js/modules/es.regexp.constructor.js":347,"core-js/modules/es.regexp.exec.js":348,"core-js/modules/es.regexp.flags.js":349,"core-js/modules/es.regexp.to-string.js":350,"core-js/modules/es.set.js":352,"core-js/modules/es.string.anchor.js":353,"core-js/modules/es.string.big.js":354,"core-js/modules/es.string.blink.js":355,"core-js/modules/es.string.bold.js":356,"core-js/modules/es.string.code-point-at.js":357,"core-js/modules/es.string.ends-with.js":358,"core-js/modules/es.string.fixed.js":359,"core-js/modules/es.string.fontcolor.js":360,"core-js/modules/es.string.fontsize.js":361,"core-js/modules/es.string.from-code-point.js":362,"core-js/modules/es.string.includes.js":363,"core-js/modules/es.string.italics.js":364,"core-js/modules/es.string.iterator.js":365,"core-js/modules/es.string.link.js":366,"core-js/modules/es.string.match.js":367,"core-js/modules/es.string.pad-end.js":368,"core-js/modules/es.string.pad-start.js":369,"core-js/modules/es.string.raw.js":370,"core-js/modules/es.string.repeat.js":371,"core-js/modules/es.string.replace.js":372,"core-js/modules/es.string.search.js":373,"core-js/modules/es.string.small.js":374,"core-js/modules/es.string.split.js":375,"core-js/modules/es.string.starts-with.js":376,"core-js/modules/es.string.strike.js":377,"core-js/modules/es.string.sub.js":378,"core-js/modules/es.string.sup.js":379,"core-js/modules/es.string.trim-end.js":380,"core-js/modules/es.string.trim-start.js":383,"core-js/modules/es.string.trim.js":384,"core-js/modules/es.symbol.async-iterator.js":385,"core-js/modules/es.symbol.description.js":387,"core-js/modules/es.symbol.has-instance.js":389,"core-js/modules/es.symbol.is-concat-spreadable.js":390,"core-js/modules/es.symbol.iterator.js":391,"core-js/modules/es.symbol.js":392,"core-js/modules/es.symbol.match.js":394,"core-js/modules/es.symbol.replace.js":395,"core-js/modules/es.symbol.search.js":396,"core-js/modules/es.symbol.species.js":397,"core-js/modules/es.symbol.split.js":398,"core-js/modules/es.symbol.to-primitive.js":399,"core-js/modules/es.symbol.to-string-tag.js":400,"core-js/modules/es.symbol.unscopables.js":401,"core-js/modules/es.typed-array.copy-within.js":402,"core-js/modules/es.typed-array.every.js":403,"core-js/modules/es.typed-array.fill.js":404,"core-js/modules/es.typed-array.filter.js":405,"core-js/modules/es.typed-array.find-index.js":406,"core-js/modules/es.typed-array.find.js":407,"core-js/modules/es.typed-array.float32-array.js":408,"core-js/modules/es.typed-array.float64-array.js":409,"core-js/modules/es.typed-array.for-each.js":410,"core-js/modules/es.typed-array.from.js":411,"core-js/modules/es.typed-array.includes.js":412,"core-js/modules/es.typed-array.index-of.js":413,"core-js/modules/es.typed-array.int16-array.js":414,"core-js/modules/es.typed-array.int32-array.js":415,"core-js/modules/es.typed-array.int8-array.js":416,"core-js/modules/es.typed-array.iterator.js":417,"core-js/modules/es.typed-array.join.js":418,"core-js/modules/es.typed-array.last-index-of.js":419,"core-js/modules/es.typed-array.map.js":420,"core-js/modules/es.typed-array.of.js":421,"core-js/modules/es.typed-array.reduce-right.js":422,"core-js/modules/es.typed-array.reduce.js":423,"core-js/modules/es.typed-array.reverse.js":424,"core-js/modules/es.typed-array.set.js":425,"core-js/modules/es.typed-array.slice.js":426,"core-js/modules/es.typed-array.some.js":427,"core-js/modules/es.typed-array.sort.js":428,"core-js/modules/es.typed-array.subarray.js":429,"core-js/modules/es.typed-array.to-locale-string.js":430,"core-js/modules/es.typed-array.to-string.js":431,"core-js/modules/es.typed-array.uint16-array.js":432,"core-js/modules/es.typed-array.uint32-array.js":433,"core-js/modules/es.typed-array.uint8-array.js":434,"core-js/modules/es.typed-array.uint8-clamped-array.js":435,"core-js/modules/es.weak-map.js":437,"core-js/modules/es.weak-set.js":439,"core-js/modules/web.dom-collections.for-each.js":441,"core-js/modules/web.dom-collections.iterator.js":442,"core-js/modules/web.immediate.js":443,"core-js/modules/web.queue-microtask.js":444,"core-js/modules/web.timers.js":448,"core-js/modules/web.url-search-params.js":450,"core-js/modules/web.url.js":452,"core-js/modules/web.url.to-json.js":453,"regenerator-runtime/runtime":681}],699:[function(require,module,exports){
"use strict";

var AdapterV5 = function () {
  function AdapterV5($rootScope, $http, $q) {
    this.$rootScope = $rootScope;
    this.$http = $http;
    this.$q = $q;
    this.errorLogger = null;
    this.infoLogger = null;
  }
  var _proto = AdapterV5.prototype;
  _proto.setLoggers = function setLoggers(errorLogger, infoLogger) {
    this.errorLogger = errorLogger;
    this.infoLogger = infoLogger;
  };
  _proto.destroy = function destroy() {
    this.$rootScope = null;
    this.$http = null;
    this.$q = null;
    this.errorLogger = null;
    this.infoLogger = null;
  };
  return AdapterV5;
}();
module.exports = {
  AdapterV5: AdapterV5
};

},{}],700:[function(require,module,exports){
"use strict";

var _require = require("./lexis-nexis-adapter-v6"),
  LexisNexisAdapterV6 = _require.LexisNexisAdapterV6;
var _require2 = require("./open-document-adapter-v5"),
  OpenDocumentAdapterV5 = _require2.OpenDocumentAdapterV5;
module.exports = {
  LexisNexisAdapterV6: LexisNexisAdapterV6,
  OpenDocumentAdapterV5: OpenDocumentAdapterV5
};

},{"./lexis-nexis-adapter-v6":701,"./open-document-adapter-v5":702}],701:[function(require,module,exports){
"use strict";

function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
var _require = require("../../../common/utils/comparisons-v4"),
  compareByRiskScore = _require.compareByRiskScore;
var _require2 = require("../../../common/utils/common-v4"),
  generateUUID = _require2.generateUUID;
var _require3 = require("../adapter-v5"),
  AdapterV5 = _require3.AdapterV5;
var _require4 = require("../../models/requests/lexis-nexis-search-request-v4"),
  LexisNexisSearchRequestV4 = _require4.LexisNexisSearchRequestV4;
var _require5 = require("../../models/result-items"),
  LexisNexisResultItemV4 = _require5.LexisNexisResultItemV4;
var _require6 = require("../../instances/services/http"),
  LexisNexisRequestsServiceInstance = _require6.LexisNexisRequestsServiceInstance;
var LexisNexisAdapterV6 = function (_AdapterV) {
  function LexisNexisAdapterV6($rootScope, $http, $q, fakeLoadingBar) {
    var _this;
    _this = _AdapterV.call(this, $rootScope, $http, $q) || this;
    _this.requestsService = null;
    _this.requestsPerEveryMinute = [];
    _this.startProcessTime = null;
    _this.timeouts = {};
    _this.fakeLoadingBar = fakeLoadingBar;
    _this.fakeLoadingCounter = 0;
    return _this;
  }
  _inheritsLoose(LexisNexisAdapterV6, _AdapterV);
  var _proto = LexisNexisAdapterV6.prototype;
  _proto.createLexisNexisRequest = function createLexisNexisRequest(personServiceId, person, parentPerson, searchConfig, executionId) {
    var _this$requestsService, _this$requestsService2;
    var personUrl = ((_this$requestsService = this.requestsService) == null ? void 0 : _this$requestsService.getPersonRequestQuery(searchConfig.getUrl(), person.getFullName(), person.getKeywords())) || "";
    return new LexisNexisSearchRequestV4(generateUUID(), ((_this$requestsService2 = this.requestsService) == null ? void 0 : _this$requestsService2.getRequestQuery(personUrl)) || "", personServiceId, person, parentPerson, searchConfig, (!person.isAliasPerson() ? 1 : this.ALIAS_RISKSCORE) * searchConfig.getRiskScore(), executionId, searchConfig.checkIsEarlyStop(), 0);
  };
  _proto.addRequestToCommonQueue = function addRequestToCommonQueue(newRequest) {
    if (!this.FINAL_SCORE_THRESHOLD || this.FINAL_SCORE_THRESHOLD && newRequest.getRiskScore() >= this.FINAL_SCORE_THRESHOLD) {
      LexisNexisAdapterV6.commonRequestsQueue.push(newRequest);
    } else if (newRequest.checkIsEarlyStop()) {
      LexisNexisAdapterV6.commonRequestsQueue.push(newRequest);
    }
  };
  _proto.processPersonLexisNexisRequests$ = function processPersonLexisNexisRequests$(parentPerson, personsService, personsRequestsService, callback) {
    var _this2 = this;
    var defer = this.$q.defer();
    this.getLexisNexisResults$(parentPerson, personsService, personsRequestsService, callback).then(function () {})["catch"](function (error) {
      _this2.errorLogger(error);
    })["finally"](function () {
      if (callback) {
        callback([parentPerson]);
      }
      defer.resolve(parentPerson);
    });
    return defer.promise;
  };
  _proto.processPersonBatchLexisNexisRequests$ = function processPersonBatchLexisNexisRequests$(parentPerson, batchPromisesArray, callback) {
    var _this3 = this;
    var defer = this.$q.defer();
    this.$q.all(batchPromisesArray).then(function () {})["catch"](function (error) {
      _this3.errorLogger(error);
    })["finally"](function () {
      if (callback) {
        callback([parentPerson]);
      }
      defer.resolve(parentPerson);
    });
    return defer.promise;
  };
  _proto.getLexisNexisResults$ = function getLexisNexisResults$(parentPerson, personsService, personsRequestsService, callback) {
    var _this4 = this;
    var defer = this.$q.defer();
    var executionId = generateUUID();
    var earlyStopRequests = personsRequestsService.getPersonEarlyStopRequests(parentPerson.getId());
    if (earlyStopRequests.length) {
      earlyStopRequests.forEach(function (personRequest) {
        var requestConfig = personRequest.getRequest();
        var newRequest = _this4.createLexisNexisRequest(personsService.getServiceId(), parentPerson, parentPerson, requestConfig, executionId);
        _this4.addRequestToCommonQueue(newRequest);
      });
    } else {
      var scoreRequests = personsRequestsService.getPersonScoreRequests(parentPerson.getId(), this.PERSON_PARALLEL_REQUESTS_LIMIT || 1000);
      if (scoreRequests.length) {
        scoreRequests.forEach(function (personRequest) {
          var requestConfig = personRequest.getRequest();
          var newRequest = _this4.createLexisNexisRequest(personsService.getServiceId(), parentPerson, parentPerson, requestConfig, executionId);
          _this4.addRequestToCommonQueue(newRequest);
        });
      }
    }
    if (!this.startProcessTime) {
      this.startProcessTime = new Date().getTime();
    }
    var successCallback = function successCallback() {
      defer.resolve(parentPerson);
    };
    var errorCallback = function errorCallback(error) {
      defer.reject(error);
    };
    this.processLexisNexisRequests(personsService, personsRequestsService, executionId, callback, successCallback, errorCallback);
    return defer.promise;
  };
  _proto.processLexisNexisRequests = function processLexisNexisRequests(personsService, personsRequestsService, executionId, callback, successCallback, errorCallback) {
    var _this5 = this;
    var notAlreadyProcessedRequestsCount = LexisNexisAdapterV6.commonRequestsQueue.filter(function (req) {
      return req.getExecutionId() === executionId && req.getPersonServiceId() === personsService.getServiceId() && !(req.checkIsProcessing() || req.checkIsProcessed());
    }).length;
    if (notAlreadyProcessedRequestsCount !== 0) {
      var currMinute = (new Date().getTime() - (this.startProcessTime || 0)) / (this.MILLISECONDS_IN_MINUTE || 60000);
      if (this.requestsPerEveryMinute.length <= currMinute) {
        this.requestsPerEveryMinute.push({
          startTime: new Date().getTime(),
          count: 0
        });
      }
      if (LexisNexisAdapterV6.commonRequestsQueue.filter(function (req) {
        return req.checkIsProcessing();
      }).length < this.REQUESTS_PARALLEL_LIMIT && this.requestsPerEveryMinute[this.requestsPerEveryMinute.length - 1].count < this.REQUESTS_PER_MINUTE_LIMIT) {
        var currProcessingRequestsCount = LexisNexisAdapterV6.commonRequestsQueue.filter(function (req) {
          return req.checkIsProcessing();
        }).length;
        var commonRequestsQueueLength = LexisNexisAdapterV6.commonRequestsQueue.filter(function (req) {
          return !(req.checkIsProcessing() || req.checkIsProcessed());
        }).length;
        var currIterateRequestsCount = this.REQUESTS_PARALLEL_LIMIT - commonRequestsQueueLength;
        if (currIterateRequestsCount <= 0) {
          currIterateRequestsCount = this.REQUESTS_PARALLEL_LIMIT;
        }
        var currentIterateRequests = LexisNexisAdapterV6.commonRequestsQueue.filter(function (req) {
          return req.getExecutionId() === executionId && req.getPersonServiceId() === personsService.getServiceId() && !(req.checkIsProcessing() || req.checkIsProcessed());
        }).sort(compareByRiskScore).splice(0, currIterateRequestsCount);
        currentIterateRequests.forEach(function (req) {
          req.incCounter();
          req.setProcessing(true);
          req.setProcessed(false);
        });
        if (currentIterateRequests.length > 0) {
          currentIterateRequests.forEach(function (req) {
            var _this5$requestsServic;
            _this5.requestsPerEveryMinute[_this5.requestsPerEveryMinute.length - 1].count++;
            var person = req.getPerson();
            var parentPerson = req.getParentPerson();
            var requestConfig = req.getRequestConfig();
            var requestRiskScore = req.getRiskScore();
            (_this5$requestsServic = _this5.requestsService) == null || _this5$requestsServic.getSearchResults$(req.getUrl()).then(function (results) {
              req.setProcessing(false);
              req.setProcessed(true);
              if (results.length) {
                if (!requestConfig.isResultsIgnored()) {
                  if (requestConfig.checkIsEarlyStop() && requestRiskScore >= _this5.FINAL_SCORE_THRESHOLD) {
                    results.splice(0, _this5.PERSON_DOCUMENTS_EARLY_REQUESTS_LIMIT);
                  }
                  results.forEach(function (result) {
                    var newSearchResult = LexisNexisAdapterV6.createLexisNexisResult(req, result, requestConfig, person);
                    parentPerson.addSearchResult(newSearchResult);
                  });
                  parentPerson.sortLexisNexisResults(_this5.PERSON_MAX_DOCS_COUNT);
                  parentPerson.countTotalRiskScore();
                  callback([parentPerson]);
                }
                if (parentPerson.getSearchResultsCountFromScoreReqs() >= _this5.PERSON_DOCUMENTS_SCORE_REQUESTS_LIMIT) {
                  LexisNexisAdapterV6.commonRequestsQueue = LexisNexisAdapterV6.commonRequestsQueue.filter(function (r) {
                    var flag = true;
                    if (r.getPersonServiceId() === personsService.getServiceId() && r.getExecutionId() === executionId && r.getParentPersonId() === parentPerson.getId() && r.getRiskScore() < req.getRiskScore()) {
                      flag = false;
                    }
                    return flag;
                  });
                } else {
                  personsRequestsService.getPersonScoreRequests(person.getId(), _this5.PERSON_PARALLEL_REQUESTS_LIMIT || 1000).forEach(function (personRequest) {
                    var personRequestConfig = personRequest.getRequest();
                    var newRequest = _this5.createLexisNexisRequest(personsService.getServiceId(), person, parentPerson, personRequestConfig, executionId);
                    _this5.addRequestToCommonQueue(newRequest);
                  });
                }
              } else if (requestConfig.checkIsEarlyStop()) {
                personsService.getAliasPersonsById(person.getId()).forEach(function (aliasPerson) {
                  var aliasRequestCounter = 0;
                  personsRequestsService.getPersonEarlyStopRequests(aliasPerson.getId()).forEach(function (personRequest) {
                    var personRequestConfig = personRequest.getRequest();
                    if (!_this5.ALIAS_SCORE_THRESHOLD || _this5.ALIAS_SCORE_THRESHOLD && personRequestConfig.getRiskScore() > _this5.ALIAS_SCORE_THRESHOLD) {
                      var newRequest = _this5.createLexisNexisRequest(personsService.getServiceId(), aliasPerson, parentPerson, personRequestConfig, executionId);
                      _this5.addRequestToCommonQueue(newRequest);
                      aliasRequestCounter++;
                    }
                  });
                  if (!aliasRequestCounter && _this5.GENERATE_ALIAS_RISKSCORE_REQUESTS) {
                    personsRequestsService.getPersonScoreRequests(aliasPerson.getId(), _this5.PERSON_PARALLEL_REQUESTS_LIMIT || 1000).forEach(function (personRequest) {
                      var personRequestConfig = personRequest.getRequest();
                      var newRequest = _this5.createLexisNexisRequest(personsService.getServiceId(), aliasPerson, parentPerson, personRequestConfig, executionId);
                      _this5.addRequestToCommonQueue(newRequest);
                    });
                  }
                });
              } else {
                personsRequestsService.getPersonScoreRequests(person.getId(), _this5.PERSON_PARALLEL_REQUESTS_LIMIT || 1000).forEach(function (personRequest) {
                  var personRequestConfig = personRequest.getRequest();
                  if (person.isAliasPerson() && _this5.ALIAS_SCORE_THRESHOLD) {
                    if (personRequestConfig.getRiskScore() > _this5.ALIAS_SCORE_THRESHOLD) {
                      var newRequest = _this5.createLexisNexisRequest(personsService.getServiceId(), person, parentPerson, personRequestConfig, executionId);
                      _this5.addRequestToCommonQueue(newRequest);
                    }
                  } else {
                    var _newRequest = _this5.createLexisNexisRequest(personsService.getServiceId(), person, parentPerson, personRequestConfig, executionId);
                    _this5.addRequestToCommonQueue(_newRequest);
                  }
                });
              }
            })["catch"](function (error) {
              _this5.errorLogger(error);
              var isHttpError = error.status || error.response && error.response.status;
              if (isHttpError) {
                var limitPerPeriodExceed = false;
                var limitPerDayExceed = false;
                var serviceIsUnavailable = false;
                if (!error.status) {
                  if (error.response.status.toString() === "403" || error.response.status.toString() === "429") {
                    limitPerPeriodExceed = true;
                  }
                  if (error.response.status.toString() === "503") {
                    serviceIsUnavailable = true;
                  }
                } else {
                  if (error.status.toString() === "403" || error.status.toString() === "429") {
                    limitPerPeriodExceed = true;
                  }
                  if (error.status.toString() === "503") {
                    serviceIsUnavailable = true;
                  }
                }
                if (limitPerPeriodExceed) {
                  _this5.requestsPerEveryMinute[_this5.requestsPerEveryMinute.length - 1].count = Number.MAX_VALUE;
                }
                if (req.getCounter() < _this5.REQUEST_RETRY_LIMIT_COUNT && !serviceIsUnavailable) {
                  req.setProcessing(false);
                  req.setProcessed(false);
                } else {
                  req.setProcessing(false);
                  req.setProcessed(true);
                }
              } else if (req.getCounter() < _this5.REQUEST_RETRY_LIMIT_COUNT) {
                req.setProcessing(false);
                req.setProcessed(false);
              } else {
                req.setProcessing(false);
                req.setProcessed(true);
              }
            })["finally"](function () {
              if (req.checkIsProcessed()) {
                var currRequestIdx = LexisNexisAdapterV6.commonRequestsQueue.findIndex(function (el) {
                  return el.getId() === req.getId();
                });
                if (currRequestIdx !== -1) {
                  LexisNexisAdapterV6.commonRequestsQueue.splice(currRequestIdx, 1);
                }
              }
              if (!LexisNexisAdapterV6.commonRequestsQueue.find(function (r) {
                return r.getExecutionId() === executionId && r.getPersonServiceId() === personsService.getServiceId();
              })) {
                parentPerson.sortLexisNexisResults(_this5.PERSON_MAX_DOCS_COUNT);
                parentPerson.countTotalRiskScore();
                if (callback) {
                  callback([parentPerson]);
                }
              }
              _this5.processLexisNexisRequests(personsService, personsRequestsService, executionId, callback, successCallback, errorCallback);
            });
          });
        } else {
          var timeOut = setTimeout(function () {
            clearTimeout(timeOut);
            _this5.processLexisNexisRequests(personsService, personsRequestsService, executionId, callback, successCallback, errorCallback);
          }, 5000);
        }
      } else if (this.requestsPerEveryMinute[this.requestsPerEveryMinute.length - 1].count >= this.REQUESTS_PER_MINUTE_LIMIT) {
        var currTime = new Date();
        var total = (this.MILLISECONDS_IN_MINUTE || 60000) - (currTime.getTime() - this.requestsPerEveryMinute[this.requestsPerEveryMinute.length - 1].startTime) + (this.START_AFTER_TIMEOUT_DELAY || 1000);
        if (!this.timeouts[executionId]) {
          if (this.fakeLoadingCounter === 0) {
            this.fakeLoader(0, total);
          }
          this.fakeLoadingCounter += 1;
          this.timeouts[executionId] = setTimeout(function () {
            clearTimeout(_this5.timeouts[executionId]);
            _this5.timeouts[executionId] = null;
            delete _this5.timeouts[executionId];
            _this5.fakeLoadingCounter -= 1;
            _this5.processLexisNexisRequests(personsService, personsRequestsService, executionId, callback, successCallback, errorCallback);
          }, total);
        }
      } else {
        var _timeOut = setTimeout(function () {
          clearTimeout(_timeOut);
          _this5.processLexisNexisRequests(personsService, personsRequestsService, executionId, callback, successCallback, errorCallback);
        }, 5000);
      }
    } else if (!LexisNexisAdapterV6.commonRequestsQueue.find(function (req) {
      return req.getExecutionId() === executionId && req.getPersonServiceId() === personsService.getServiceId();
    })) {
      successCallback();
    }
  };
  LexisNexisAdapterV6.createLexisNexisResult = function createLexisNexisResult(req, newResult, requestConfig, person) {
    var newSearchResult = new LexisNexisResultItemV4(newResult.title, newResult.source, newResult.date, newResult.jurisdiction, newResult.extracts, newResult.resultId, newResult.docUrl);
    newSearchResult.setRiskScore(req.getRiskScore());
    newSearchResult.setKeywords((person.getAllKeywords() || []).concat(requestConfig.getKeywords() || []));
    newSearchResult.setIsFromEarlyStop(requestConfig.checkIsEarlyStop());
    return newSearchResult;
  };
  _proto.setBaseConstants = function setBaseConstants() {
    this.PERSON_PARALLEL_REQUESTS_LIMIT = 1000;
    this.FAKE_LOADER_REQUESTS_DELAY = 500;
    this.MILLISECONDS_IN_MINUTE = 60000;
    this.START_AFTER_TIMEOUT_DELAY = 1000;
  };
  _proto.setConfigConstants = function setConfigConstants(constants) {
    this.REQUESTS_PARALLEL_LIMIT = constants.requests_parallel_limit === undefined ? 20 : constants.requests_parallel_limit;
    this.REQUESTS_PER_MINUTE_LIMIT = constants.requests_per_minute_limit === undefined ? 500 : constants.requests_per_minute_limit;
    this.PERSON_DOCUMENTS_SCORE_REQUESTS_LIMIT = constants.person_documents_all_score_requests_limit === undefined ? 10 : constants.person_documents_all_score_requests_limit;
    this.PERSON_DOCUMENTS_EARLY_REQUESTS_LIMIT = constants.person_documents_each_early_request_limit === undefined ? 10 : constants.person_documents_each_early_request_limit;
    this.PERSON_LACK_OF_DOCUMENTS_PENALTY = constants.person_lack_of_documents_penalty === undefined ? 0.9 : constants.person_lack_of_documents_penalty;
    this.PERSON_REQUIRED_MIN_DOCS_COUNT = constants.person_required_min_docs_count === undefined ? 10 : constants.person_required_min_docs_count;
    this.PERSON_MAX_DOCS_COUNT = constants.person_max_all_docs_count === undefined ? 10 : constants.person_max_all_docs_count;
    this.REQUEST_RETRY_LIMIT_COUNT = constants.request_retry_limit_count === undefined ? 3 : constants.request_retry_limit_count;
    this.ALIAS_RISKSCORE = constants.alias_riskscore === undefined ? 0.75 : constants.alias_riskscore;
    this.ALIAS_SCORE_THRESHOLD = constants.alias_score_threshold === undefined ? 0.94 : constants.alias_score_threshold;
    this.FINAL_SCORE_THRESHOLD = constants.final_score_threshold === undefined ? 0.88 : constants.final_score_threshold;
    this.GENERATE_ALIAS_RISKSCORE_REQUESTS = constants.generate_alias_riskscore_requests === undefined ? false : constants.generate_alias_riskscore_requests;
  };
  _proto.initServices = function initServices(baseUrl) {
    this.requestsService = LexisNexisRequestsServiceInstance.getNewService(this.$rootScope, this.$http, this.$q);
    this.requestsService.setUrls(baseUrl);
  };
  _proto.injectServices = function injectServices(requestsService) {
    this.requestsService = requestsService;
  };
  _proto.fakeLoader = function fakeLoader(ms, total) {
    var _this6 = this;
    if (ms <= total) {
      if (this.fakeLoadingBar) {
        if (this.fakeLoadingBar.status() === 0) {
          this.infoLogger("FakeLoader start");
          this.fakeLoadingBar.start();
        }
      }
      var timeOut = setTimeout(function () {
        clearTimeout(timeOut);
        _this6.fakeLoader(ms + (_this6.FAKE_LOADER_REQUESTS_DELAY || 500), total);
      }, this.FAKE_LOADER_REQUESTS_DELAY);
    } else if (this.fakeLoadingBar) {
      this.infoLogger("FakeLoader complete");
      this.fakeLoadingBar.complete();
    }
  };
  _proto.destroy = function destroy() {
    _AdapterV.prototype.destroy.call(this);
    this.requestsService = null;
    this.fakeLoadingBar = null;
  };
  return LexisNexisAdapterV6;
}(AdapterV5);
LexisNexisAdapterV6.commonRequestsQueue = [];
module.exports = {
  LexisNexisAdapterV6: LexisNexisAdapterV6
};

},{"../../../common/utils/common-v4":687,"../../../common/utils/comparisons-v4":688,"../../instances/services/http":711,"../../models/requests/lexis-nexis-search-request-v4":723,"../../models/result-items":724,"../adapter-v5":699}],702:[function(require,module,exports){
"use strict";

function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
var _require = require("../../../common/utils/highlight-v4"),
  highlightDocument = _require.highlightDocument;
var _require2 = require("../adapter-v5"),
  AdapterV5 = _require2.AdapterV5;
var _require3 = require("../../instances/services/http"),
  FileRequestsServiceInstance = _require3.FileRequestsServiceInstance,
  LexisNexisRequestsServiceInstance = _require3.LexisNexisRequestsServiceInstance;
var OpenDocumentAdapterV5 = function (_AdapterV) {
  function OpenDocumentAdapterV5($rootScope, $http, $q) {
    var _this;
    _this = _AdapterV.call(this, $rootScope, $http, $q) || this;
    _this.requestsService = null;
    _this.fileService = null;
    return _this;
  }
  _inheritsLoose(OpenDocumentAdapterV5, _AdapterV);
  var _proto = OpenDocumentAdapterV5.prototype;
  _proto.highlightKeywords = function highlightKeywords(document, keywords) {
    try {
      highlightDocument(document, keywords, "span", "#FFFF00", null, null);
    } catch (error) {
      this.errorLogger(error);
    }
  };
  _proto.openDocument = function openDocument(url, keywords) {
    var _this2 = this;
    if (document.implementation && !!window.XSLTProcessor) {
      var _this$requestsService;
      (_this$requestsService = this.requestsService) == null || _this$requestsService.getSearchResult$(url).then(function (data) {
        var _this2$fileService;
        (_this2$fileService = _this2.fileService) == null || _this2$fileService.getXslDoc$().then(function (xslDoc) {
          var xmlDoc = new DOMParser().parseFromString(data, "text/xml");
          var xsltProcessor = new XSLTProcessor();
          xsltProcessor.importStylesheet(xslDoc);
          var resultDocument = xsltProcessor.transformToDocument(xmlDoc);
          var resultBody = resultDocument.documentElement.getElementsByTagName("body");
          var wnd = window.open("about:blank", "", "width=800,height=600,resizable=yes,scrollbars=yes");
          if (wnd) {
            wnd.document.write($(resultBody).html());
            wnd.document.close();
            _this2.highlightKeywords(wnd.document, keywords);
            wnd.focus();
          }
        })["catch"](function (error) {
          _this2.errorLogger(error);
        });
      })["catch"](function (error) {
        _this2.errorLogger(error);
      });
    } else {
      var _this$requestsService2;
      (_this$requestsService2 = this.requestsService) == null || _this$requestsService2.getSearchResult$(url).then(function (data) {
        var _this2$fileService2;
        var xmlDoc = new DOMParser().parseFromString(data, "text/xml");
        var xslDoc = new ActiveXObject("Msxml2.FreeThreadedDOMDocument.6.0");
        xslDoc.async = false;
        xslDoc.load((_this2$fileService2 = _this2.fileService) == null ? void 0 : _this2$fileService2.xslFile);
        var template = new ActiveXObject("Msxml2.XslTemplate.6.0");
        template.stylesheet = xslDoc;
        var proc = template.createProcessor();
        proc.input = xmlDoc;
        proc.transform();
        var resultDocument = proc.output;
        var wnd = window.open("about:blank", "", "width=800,height=600,resizable=yes,scrollbars=yes");
        if (wnd) {
          wnd.document.write(resultDocument);
          wnd.document.close();
          _this2.highlightKeywords(wnd.document, keywords);
          wnd.focus();
        }
      })["catch"](function (error) {
        _this2.errorLogger(error);
      });
    }
  };
  _proto.initServices = function initServices(baseUrl) {
    this.fileService = FileRequestsServiceInstance.getNewService(this.$rootScope, this.$http, this.$q);
    this.requestsService = LexisNexisRequestsServiceInstance.getNewService(this.$rootScope, this.$http, this.$q);
    this.requestsService.setUrls(baseUrl);
  };
  _proto.injectServices = function injectServices(fileService, requestsService) {
    this.fileService = fileService;
    this.requestsService = requestsService;
  };
  _proto.destroy = function destroy() {
    _AdapterV.prototype.destroy.call(this);
    this.fileService = null;
    this.requestsService = null;
  };
  return OpenDocumentAdapterV5;
}(AdapterV5);
module.exports = {
  OpenDocumentAdapterV5: OpenDocumentAdapterV5
};

},{"../../../common/utils/highlight-v4":692,"../../instances/services/http":711,"../adapter-v5":699}],703:[function(require,module,exports){
"use strict";

var _require = require("./factories"),
  AdaptersFactoryV1 = _require.AdaptersFactoryV1,
  ServicesFactoryV1 = _require.ServicesFactoryV1;
var CommonLexisNexisAdapterV6 = function () {
  function CommonLexisNexisAdapterV6($rootScope, $http, $q, fakeLoadingBar) {
    this.$rootScope = $rootScope;
    this.$http = $http;
    this.$q = $q;
    this.lexisNexisAdapter = null;
    this.openDocumentAdapter = null;
    this.searchConfigsService = null;
    this.fakeLoadingBar = fakeLoadingBar;
    this.countriesData = [];
    this.errorLogger = null;
    this.infoLogger = null;
    this.adaptersFactory = new AdaptersFactoryV1($rootScope, $http, $q, fakeLoadingBar);
    this.servicesFactory = new ServicesFactoryV1($rootScope, $http, $q);
  }
  var _proto = CommonLexisNexisAdapterV6.prototype;
  _proto.getData$ = function getData$(personsData, callback) {
    var _this$servicesFactory;
    var deferred = this.$q.defer();
    var personsService = (_this$servicesFactory = this.servicesFactory) == null ? void 0 : _this$servicesFactory.getLexisNexisPersonsService();
    if (personsService) {
      personsService.setPersons(personsData, this.countriesData);
      var errorFinalCallback = function errorFinalCallback(error) {
        deferred.reject(error);
      };
      var successFinalCallback = function successFinalCallback(persons) {
        deferred.resolve(persons);
      };
      this.getDataByRequests$(personsService, callback, successFinalCallback, errorFinalCallback);
    } else {
      deferred.resolve([]);
    }
    return deferred.promise;
  };
  _proto.getDataByRequests$ = function getDataByRequests$(personsService, callback, successFinalCallback, errorFinalCallback) {
    var _this = this;
    var batchPersonsPromises = [];
    personsService.getPersonsWithoutAliases().forEach(function (parentPerson) {
      var _this$servicesFactory2, _this$searchConfigsSe, _this$lexisNexisAdapt;
      var batchPersonPromises = [];
      var personLexisNexisRequestsPromises = [];
      var personsRequestsService = (_this$servicesFactory2 = _this.servicesFactory) == null ? void 0 : _this$servicesFactory2.getLexisNexisPersonsRequestsService();
      personsRequestsService == null || personsRequestsService.setPersonsRequests(personsService.getPersons(), (_this$searchConfigsSe = _this.searchConfigsService) == null ? void 0 : _this$searchConfigsSe.getAllConfigs());
      var lexisNexisRequests$ = (_this$lexisNexisAdapt = _this.lexisNexisAdapter) == null ? void 0 : _this$lexisNexisAdapt.processPersonLexisNexisRequests$(parentPerson, personsService, personsRequestsService, callback);
      personLexisNexisRequestsPromises.push(lexisNexisRequests$);
      if (personLexisNexisRequestsPromises.length) {
        var _this$lexisNexisAdapt2;
        batchPersonPromises.push((_this$lexisNexisAdapt2 = _this.lexisNexisAdapter) == null ? void 0 : _this$lexisNexisAdapt2.processPersonBatchLexisNexisRequests$(parentPerson, personLexisNexisRequestsPromises, callback));
      }
      if (batchPersonPromises.length) {
        batchPersonsPromises.push(_this.processPersonBatches$(parentPerson, batchPersonPromises));
      }
    });
    if (batchPersonsPromises.length) {
      this.$q.all(batchPersonsPromises).then(function () {})["catch"](function (error) {
        _this.errorLogger(error);
      })["finally"](function () {
        personsService.getPersonsWithoutAliases().forEach(function (parentPerson) {
          parentPerson.countTotalRiskScore();
        });
        successFinalCallback(personsService.getPersonsWithoutAliases());
      });
    } else {
      successFinalCallback(personsService.getPersonsWithoutAliases());
    }
  };
  _proto.processPersonBatches$ = function processPersonBatches$(parentPerson, batchArray) {
    var _this2 = this;
    var deferred = this.$q.defer();
    if (batchArray.length) {
      this.$q.all(batchArray).then(function () {})["catch"](function (error) {
        _this2.errorLogger(error);
      })["finally"](function () {
        deferred.resolve(parentPerson);
      });
    } else {
      deferred.resolve(parentPerson);
    }
    return deferred.promise;
  };
  _proto.openDocument = function openDocument(url, keywords) {
    var _this$openDocumentAda;
    (_this$openDocumentAda = this.openDocumentAdapter) == null || _this$openDocumentAda.openDocument(url, keywords);
  };
  _proto.setCountries = function setCountries(countries) {
    this.countriesData = [].concat(countries);
  };
  _proto.initAdapters = function initAdapters(baseUrl, constants) {
    var _this$servicesFactory3, _this$adaptersFactory, _this$lexisNexisAdapt3, _this$lexisNexisAdapt4, _this$lexisNexisAdapt5, _this$servicesFactory4, _this$adaptersFactory2, _this$openDocumentAda2;
    var lexisNexisRequestsService = (_this$servicesFactory3 = this.servicesFactory) == null ? void 0 : _this$servicesFactory3.getLexisNexisRequestsService();
    lexisNexisRequestsService == null || lexisNexisRequestsService.setUrls(baseUrl);
    this.lexisNexisAdapter = (_this$adaptersFactory = this.adaptersFactory) == null ? void 0 : _this$adaptersFactory.getLexisNexisAdapter();
    (_this$lexisNexisAdapt3 = this.lexisNexisAdapter) == null || _this$lexisNexisAdapt3.injectServices(lexisNexisRequestsService);
    (_this$lexisNexisAdapt4 = this.lexisNexisAdapter) == null || _this$lexisNexisAdapt4.setBaseConstants();
    (_this$lexisNexisAdapt5 = this.lexisNexisAdapter) == null || _this$lexisNexisAdapt5.setConfigConstants(constants);
    var fileRequestsService = (_this$servicesFactory4 = this.servicesFactory) == null ? void 0 : _this$servicesFactory4.getFileRequestsService();
    this.openDocumentAdapter = (_this$adaptersFactory2 = this.adaptersFactory) == null ? void 0 : _this$adaptersFactory2.getOpenDocumentAdapter();
    (_this$openDocumentAda2 = this.openDocumentAdapter) == null || _this$openDocumentAda2.injectServices(fileRequestsService, lexisNexisRequestsService);
  };
  _proto.initServices = function initServices(configs) {
    var _this$servicesFactory5, _this$searchConfigsSe2;
    this.searchConfigsService = (_this$servicesFactory5 = this.servicesFactory) == null ? void 0 : _this$servicesFactory5.getLexisNexisSearchConfigsService();
    (_this$searchConfigsSe2 = this.searchConfigsService) == null || _this$searchConfigsSe2.setConfigs(configs);
  };
  _proto.setLoggers = function setLoggers(errorLogger, infoLogger) {
    var _this$lexisNexisAdapt6, _this$openDocumentAda3;
    this.errorLogger = errorLogger;
    this.infoLogger = infoLogger;
    (_this$lexisNexisAdapt6 = this.lexisNexisAdapter) == null || _this$lexisNexisAdapt6.setLoggers(errorLogger, infoLogger);
    (_this$openDocumentAda3 = this.openDocumentAdapter) == null || _this$openDocumentAda3.setLoggers(errorLogger, infoLogger);
  };
  _proto.destroy = function destroy() {
    var _this$adaptersFactory3, _this$servicesFactory6;
    this.$rootScope = null;
    this.$http = null;
    this.$q = null;
    this.lexisNexisAdapter = null;
    this.openDocumentAdapter = null;
    this.searchConfigsService = null;
    this.fakeLoadingBar = null;
    this.countriesData = [];
    this.errorLogger = null;
    this.infoLogger = null;
    (_this$adaptersFactory3 = this.adaptersFactory) == null || _this$adaptersFactory3.destroy();
    this.adaptersFactory = null;
    (_this$servicesFactory6 = this.servicesFactory) == null || _this$servicesFactory6.destroy();
    this.servicesFactory = null;
  };
  return CommonLexisNexisAdapterV6;
}();
module.exports = {
  CommonLexisNexisAdapterV6: CommonLexisNexisAdapterV6
};

},{"./factories":705}],704:[function(require,module,exports){
"use strict";

var _require = require("../instances/adapters/logic"),
  LexisNexisAdapterInstance = _require.LexisNexisAdapterInstance,
  OpenDocumentAdapterInstance = _require.OpenDocumentAdapterInstance;
var AdaptersFactoryV1 = function () {
  function AdaptersFactoryV1($rootScope, $http, $q, fakeLoadingBar) {
    this.lexisNexisAdapter = LexisNexisAdapterInstance.getNewAdapter($rootScope, $http, $q, fakeLoadingBar);
    this.openDocumentAdapter = OpenDocumentAdapterInstance.getNewAdapter($rootScope, $http, $q);
  }
  var _proto = AdaptersFactoryV1.prototype;
  _proto.getLexisNexisAdapter = function getLexisNexisAdapter() {
    return this.lexisNexisAdapter;
  };
  _proto.getOpenDocumentAdapter = function getOpenDocumentAdapter() {
    return this.openDocumentAdapter;
  };
  _proto.destroy = function destroy() {
    this.lexisNexisAdapter.destroy();
    this.lexisNexisAdapter = null;
    this.openDocumentAdapter.destroy();
    this.openDocumentAdapter = null;
  };
  return AdaptersFactoryV1;
}();
module.exports = {
  AdaptersFactoryV1: AdaptersFactoryV1
};

},{"../instances/adapters/logic":707}],705:[function(require,module,exports){
"use strict";

var _require = require("./adapters-v1"),
  AdaptersFactoryV1 = _require.AdaptersFactoryV1;
var _require2 = require("./services-v1"),
  ServicesFactoryV1 = _require2.ServicesFactoryV1;
module.exports = {
  AdaptersFactoryV1: AdaptersFactoryV1,
  ServicesFactoryV1: ServicesFactoryV1
};

},{"./adapters-v1":704,"./services-v1":706}],706:[function(require,module,exports){
"use strict";

var _require = require("../instances/services/http"),
  FileRequestsServiceInstance = _require.FileRequestsServiceInstance,
  LexisNexisRequestsServiceInstance = _require.LexisNexisRequestsServiceInstance;
var _require2 = require("../instances/services/logic"),
  LexisNexisPersonsRequestsServiceInstance = _require2.LexisNexisPersonsRequestsServiceInstance,
  LexisNexisPersonsServiceInstance = _require2.LexisNexisPersonsServiceInstance,
  LexisNexisSearchConfigsServiceInstance = _require2.LexisNexisSearchConfigsServiceInstance;
var ServicesFactoryV1 = function () {
  function ServicesFactoryV1($rootScope, $http, $q) {
    this.fileRequestsService = FileRequestsServiceInstance.getNewService($rootScope, $http, $q);
    this.lexisNexisRequestsService = LexisNexisRequestsServiceInstance.getNewService($rootScope, $http, $q);
    this.lexisNexisSearchConfigsService = LexisNexisSearchConfigsServiceInstance.getNewService();
  }
  var _proto = ServicesFactoryV1.prototype;
  _proto.getFileRequestsService = function getFileRequestsService() {
    return this.fileRequestsService;
  };
  _proto.getLexisNexisRequestsService = function getLexisNexisRequestsService() {
    return this.lexisNexisRequestsService;
  };
  _proto.getLexisNexisPersonsRequestsService = function getLexisNexisPersonsRequestsService() {
    return LexisNexisPersonsRequestsServiceInstance.getNewService();
  };
  _proto.getLexisNexisPersonsService = function getLexisNexisPersonsService() {
    return LexisNexisPersonsServiceInstance.getNewService();
  };
  _proto.getLexisNexisSearchConfigsService = function getLexisNexisSearchConfigsService() {
    return this.lexisNexisSearchConfigsService;
  };
  _proto.destroy = function destroy() {
    this.fileRequestsService.destroy();
    this.fileRequestsService = null;
    this.lexisNexisRequestsService.destroy();
    this.lexisNexisRequestsService = null;
    this.lexisNexisSearchConfigsService.destroy();
    this.lexisNexisSearchConfigsService = null;
  };
  return ServicesFactoryV1;
}();
module.exports = {
  ServicesFactoryV1: ServicesFactoryV1
};

},{"../instances/services/http":711,"../instances/services/logic":713}],707:[function(require,module,exports){
"use strict";

var _require = require("./lexis-nexis-adapter"),
  LexisNexisAdapterInstance = _require.LexisNexisAdapterInstance;
var _require2 = require("./open-document-adapter"),
  OpenDocumentAdapterInstance = _require2.OpenDocumentAdapterInstance;
module.exports = {
  LexisNexisAdapterInstance: LexisNexisAdapterInstance,
  OpenDocumentAdapterInstance: OpenDocumentAdapterInstance
};

},{"./lexis-nexis-adapter":708,"./open-document-adapter":709}],708:[function(require,module,exports){
"use strict";

var _require = require("../../../adapters/logic"),
  LexisNexisAdapterV6 = _require.LexisNexisAdapterV6;
var LexisNexisAdapterInstance = function () {
  function LexisNexisAdapterInstance() {
    this.lexisNexisAdapter = null;
  }
  var _proto = LexisNexisAdapterInstance.prototype;
  _proto.getAdapter = function getAdapter($rootScope, $http, $q, fakeLoadingBar) {
    if (!this.lexisNexisAdapter) {
      this.lexisNexisAdapter = new LexisNexisAdapterV6($rootScope, $http, $q, fakeLoadingBar);
    }
    return this.lexisNexisAdapter;
  };
  _proto.getNewAdapter = function getNewAdapter($rootScope, $http, $q, fakeLoadingBar) {
    return new LexisNexisAdapterV6($rootScope, $http, $q, fakeLoadingBar);
  };
  return LexisNexisAdapterInstance;
}();
module.exports = {
  LexisNexisAdapterInstance: new LexisNexisAdapterInstance()
};

},{"../../../adapters/logic":700}],709:[function(require,module,exports){
"use strict";

var _require = require("../../../adapters/logic"),
  OpenDocumentAdapterV5 = _require.OpenDocumentAdapterV5;
var OpenDocumentAdapterInstance = function () {
  function OpenDocumentAdapterInstance() {
    this.openDocumentAdapter = null;
  }
  var _proto = OpenDocumentAdapterInstance.prototype;
  _proto.getAdapter = function getAdapter($rootScope, $http, $q) {
    if (!this.openDocumentAdapter) {
      this.openDocumentAdapter = new OpenDocumentAdapterV5($rootScope, $http, $q);
    }
    return this.openDocumentAdapter;
  };
  _proto.getNewAdapter = function getNewAdapter($rootScope, $http, $q) {
    return new OpenDocumentAdapterV5($rootScope, $http, $q);
  };
  return OpenDocumentAdapterInstance;
}();
module.exports = {
  OpenDocumentAdapterInstance: new OpenDocumentAdapterInstance()
};

},{"../../../adapters/logic":700}],710:[function(require,module,exports){
"use strict";

var _require = require("../../../services/http"),
  FilesRequestsServiceV4 = _require.FilesRequestsServiceV4;
var FileRequestsServiceInstance = function () {
  function FileRequestsServiceInstance() {
    this.fileRequestsService = null;
  }
  var _proto = FileRequestsServiceInstance.prototype;
  _proto.getService = function getService($rootScope, $http, $q) {
    if (!this.fileRequestsService) {
      this.fileRequestsService = new FilesRequestsServiceV4($rootScope, $http, $q);
    }
    return this.fileRequestsService;
  };
  _proto.getNewService = function getNewService($rootScope, $http, $q) {
    return new FilesRequestsServiceV4($rootScope, $http, $q);
  };
  return FileRequestsServiceInstance;
}();
module.exports = {
  FileRequestsServiceInstance: new FileRequestsServiceInstance()
};

},{"../../../services/http":727}],711:[function(require,module,exports){
"use strict";

var _require = require("./file-requests-service"),
  FileRequestsServiceInstance = _require.FileRequestsServiceInstance;
var _require2 = require("./lexis-nexis-requests-service"),
  LexisNexisRequestsServiceInstance = _require2.LexisNexisRequestsServiceInstance;
module.exports = {
  FileRequestsServiceInstance: FileRequestsServiceInstance,
  LexisNexisRequestsServiceInstance: LexisNexisRequestsServiceInstance
};

},{"./file-requests-service":710,"./lexis-nexis-requests-service":712}],712:[function(require,module,exports){
"use strict";

var _require = require("../../../services/http"),
  LexisNexisRequestsServiceV4 = _require.LexisNexisRequestsServiceV4;
var LexisNexisRequestsServiceInstance = function () {
  function LexisNexisRequestsServiceInstance() {
    this.lexisNexisRequestsService = null;
  }
  var _proto = LexisNexisRequestsServiceInstance.prototype;
  _proto.getService = function getService($rootScope, $http, $q) {
    if (!this.lexisNexisRequestsService) {
      this.lexisNexisRequestsService = new LexisNexisRequestsServiceV4($rootScope, $http, $q);
    }
    return this.lexisNexisRequestsService;
  };
  _proto.getNewService = function getNewService($rootScope, $http, $q) {
    return new LexisNexisRequestsServiceV4($rootScope, $http, $q);
  };
  return LexisNexisRequestsServiceInstance;
}();
module.exports = {
  LexisNexisRequestsServiceInstance: new LexisNexisRequestsServiceInstance()
};

},{"../../../services/http":727}],713:[function(require,module,exports){
"use strict";

var _require = require("./lexis-nexis-persons-requests-service"),
  LexisNexisPersonsRequestsServiceInstance = _require.LexisNexisPersonsRequestsServiceInstance;
var _require2 = require("./lexis-nexis-persons-service"),
  LexisNexisPersonsServiceInstance = _require2.LexisNexisPersonsServiceInstance;
var _require3 = require("./lexis-nexis-search-configs-service"),
  LexisNexisSearchConfigsServiceInstance = _require3.LexisNexisSearchConfigsServiceInstance;
module.exports = {
  LexisNexisPersonsRequestsServiceInstance: LexisNexisPersonsRequestsServiceInstance,
  LexisNexisPersonsServiceInstance: LexisNexisPersonsServiceInstance,
  LexisNexisSearchConfigsServiceInstance: LexisNexisSearchConfigsServiceInstance
};

},{"./lexis-nexis-persons-requests-service":714,"./lexis-nexis-persons-service":715,"./lexis-nexis-search-configs-service":716}],714:[function(require,module,exports){
"use strict";

var _require = require("../../../services/logic"),
  LexisNexisPersonsRequestsServiceV4 = _require.LexisNexisPersonsRequestsServiceV4;
var LexisNexisPersonsRequestsServiceInstance = function () {
  function LexisNexisPersonsRequestsServiceInstance() {}
  var _proto = LexisNexisPersonsRequestsServiceInstance.prototype;
  _proto.getNewService = function getNewService() {
    return new LexisNexisPersonsRequestsServiceV4();
  };
  return LexisNexisPersonsRequestsServiceInstance;
}();
module.exports = {
  LexisNexisPersonsRequestsServiceInstance: new LexisNexisPersonsRequestsServiceInstance()
};

},{"../../../services/logic":730}],715:[function(require,module,exports){
"use strict";

var _require = require("../../../services/logic"),
  LexisNexisPersonsServiceV4 = _require.LexisNexisPersonsServiceV4;
var LexisNexisPersonsServiceInstance = function () {
  function LexisNexisPersonsServiceInstance() {}
  var _proto = LexisNexisPersonsServiceInstance.prototype;
  _proto.getNewService = function getNewService() {
    return new LexisNexisPersonsServiceV4();
  };
  return LexisNexisPersonsServiceInstance;
}();
module.exports = {
  LexisNexisPersonsServiceInstance: new LexisNexisPersonsServiceInstance()
};

},{"../../../services/logic":730}],716:[function(require,module,exports){
"use strict";

var _require = require("../../../services/logic"),
  LexisNexisSearchConfigsServiceV4 = _require.LexisNexisSearchConfigsServiceV4;
var LexisNexisSearchConfigsServiceInstance = function () {
  function LexisNexisSearchConfigsServiceInstance() {
    this.searchConfigsService = null;
  }
  var _proto = LexisNexisSearchConfigsServiceInstance.prototype;
  _proto.getService = function getService() {
    if (!this.searchConfigsService) {
      this.searchConfigsService = new LexisNexisSearchConfigsServiceV4();
    }
    return this.searchConfigsService;
  };
  _proto.getNewService = function getNewService() {
    return new LexisNexisSearchConfigsServiceV4();
  };
  return LexisNexisSearchConfigsServiceInstance;
}();
module.exports = {
  LexisNexisSearchConfigsServiceInstance: new LexisNexisSearchConfigsServiceInstance()
};

},{"../../../services/logic":730}],717:[function(require,module,exports){
"use strict";

var _require = require("./lexis-nexis-person-v4"),
  LexisNexisPersonV4 = _require.LexisNexisPersonV4;
module.exports = {
  LexisNexisPersonV4: LexisNexisPersonV4
};

},{"./lexis-nexis-person-v4":718}],718:[function(require,module,exports){
"use strict";

function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
var _require = require("../../../common/models"),
  PersonV4 = _require.PersonV4;
var _require2 = require("../../../common/utils/comparisons-v4"),
  compareByRiskScore = _require2.compareByRiskScore,
  compareByValue = _require2.compareByValue,
  compareByDate = _require2.compareByDate,
  compareByTitle = _require2.compareByTitle;
var LexisNexisPersonV4 = function (_PersonV) {
  function LexisNexisPersonV4(id, fullName, firstName, lastName, isAlias, isLinked, parentId) {
    var _this;
    _this = _PersonV.call(this, id, fullName, firstName, lastName, isAlias, isLinked, parentId) || this;
    _this.allLexisNexisResults = [];
    _this.lexisNexisResults = [];
    return _this;
  }
  _inheritsLoose(LexisNexisPersonV4, _PersonV);
  var _proto = LexisNexisPersonV4.prototype;
  _proto.setKeywords = function setKeywords(keywords) {
    if (keywords.length) {
      this.keywords = keywords.replace("(", "").replace(")", "").split(" or ").filter(function (k) {
        return k.trim().length;
      });
    } else {
      this.keywords = [];
    }
  };
  _proto.addSearchResult = function addSearchResult(newSearchResult) {
    var existedResult = this.allLexisNexisResults.find(function (searchResult) {
      return newSearchResult.getDocUrl() && searchResult.getDocUrl() === newSearchResult.getDocUrl() && searchResult.getResultId() === newSearchResult.getResultId();
    });
    if (!existedResult) {
      this.allLexisNexisResults.push(newSearchResult);
    } else if (existedResult.getRiskScore() < newSearchResult.getRiskScore()) {
      existedResult.setRiskScore(newSearchResult.getRiskScore());
    }
  };
  _proto.getSearchResultsCountFromScoreReqs = function getSearchResultsCountFromScoreReqs() {
    return this.allLexisNexisResults.filter(function (doc) {
      return !doc.checkIsFromEarlyStop();
    }).length;
  };
  _proto.splitSearchResultsAndSort = function splitSearchResultsAndSort(searchResults) {
    var scores = {};
    searchResults.forEach(function (doc) {
      if (scores[doc.getRiskScore()] === undefined) scores[doc.getRiskScore()] = [];
      scores[doc.getRiskScore()].push(doc);
    });
    var sortedScores = Object.keys(scores).map(function (key) {
      return parseFloat(key);
    });
    sortedScores.sort(compareByValue);
    var splittedByScore = sortedScores.map(function (key) {
      return scores[key.toString()];
    });
    var _loop = function _loop() {
      var scoresArr = splittedByScore[i];
      var resultsHasDates = scoresArr.filter(function (_doc) {
        return _doc.getDate();
      }).length === scoresArr.length;
      if (resultsHasDates) {
        scoresArr.sort(compareByDate);
        var dates = {};
        scoresArr.forEach(function (_doc) {
          var date = new Date(_doc.getDate()).toISOString().split("T")[0];
          if (dates[date] === undefined) dates[date] = [];
          dates[date].push(_doc);
        });
        var splittedByDates = Object.keys(dates).map(function (key) {
          return dates[key];
        });
        splittedByDates.forEach(function (datesArr) {
          datesArr.sort(compareByTitle);
        });
        scoresArr = [].concat.apply([], splittedByDates);
      } else {
        scoresArr.sort(compareByTitle);
      }
      splittedByScore[i] = scoresArr;
    };
    for (var i = 0; i < splittedByScore.length; i++) {
      _loop();
    }
    return [].concat.apply([], splittedByScore);
  };
  _proto.sortLexisNexisResults = function sortLexisNexisResults(searchResultsMaxCount) {
    this.allLexisNexisResults.sort(compareByRiskScore);
    this.lexisNexisResults = this.allLexisNexisResults.slice(0, searchResultsMaxCount);
    this.lexisNexisResults = this.splitSearchResultsAndSort(this.lexisNexisResults);
  };
  _proto.countTotalRiskScore = function countTotalRiskScore() {
    var maxScore = this.lexisNexisResults.length ? Math.max.apply(Math, this.lexisNexisResults.map(function (res) {
      return res.getRiskScore();
    })) : 0;
    var resultsWithMaxScoreCount = this.lexisNexisResults.filter(function (res) {
      return res.getRiskScore() === maxScore;
    }).length;
    this.totalRiskScore = maxScore + (resultsWithMaxScoreCount >= 6 ? 0.02 : resultsWithMaxScoreCount >= 3 ? 0.01 : 0);
    this.totalRiskScore = this.totalRiskScore > 1 ? 1 : this.totalRiskScore;
  };
  _proto.getTotalRiskScore = function getTotalRiskScore() {
    return this.totalRiskScore;
  };
  _proto.getLexisNexisResults = function getLexisNexisResults() {
    return this.lexisNexisResults;
  };
  _proto.getLexisNexisResultsCount = function getLexisNexisResultsCount() {
    return this.lexisNexisResults.length;
  };
  _proto.getLexisNexisResultsToPublish = function getLexisNexisResultsToPublish() {
    return this.lexisNexisResults.filter(function (searchResult) {
      return searchResult.checkShouldBePublished();
    });
  };
  return LexisNexisPersonV4;
}(PersonV4);
module.exports = {
  LexisNexisPersonV4: LexisNexisPersonV4
};

},{"../../../common/models":682,"../../../common/utils/comparisons-v4":688}],719:[function(require,module,exports){
"use strict";

var _require = require("./lexis-nexis-request-config-v4"),
  LexisNexisRequestConfigV4 = _require.LexisNexisRequestConfigV4;
module.exports = {
  LexisNexisRequestConfigV4: LexisNexisRequestConfigV4
};

},{"./lexis-nexis-request-config-v4":720}],720:[function(require,module,exports){
"use strict";

var LexisNexisRequestConfigV4 = function () {
  function LexisNexisRequestConfigV4(id, riskScore, keywords, url, earlystop, ignoreResults) {
    this.id = id;
    this.riskScore = riskScore;
    this.keywords = keywords;
    this.url = url;
    this.earlystop = earlystop;
    this.ignoreResults = ignoreResults;
  }
  var _proto = LexisNexisRequestConfigV4.prototype;
  _proto.getId = function getId() {
    return this.id;
  };
  _proto.getKeywords = function getKeywords() {
    return this.keywords;
  };
  _proto.getRiskScore = function getRiskScore() {
    return this.riskScore;
  };
  _proto.getUrl = function getUrl() {
    return this.url;
  };
  _proto.checkIsEarlyStop = function checkIsEarlyStop() {
    return this.earlystop === true;
  };
  _proto.isResultsIgnored = function isResultsIgnored() {
    return this.ignoreResults === true;
  };
  return LexisNexisRequestConfigV4;
}();
module.exports = {
  LexisNexisRequestConfigV4: LexisNexisRequestConfigV4
};

},{}],721:[function(require,module,exports){
"use strict";

var _require = require("./lexis-nexis-person-request-v4"),
  LexisNexisPersonRequestV4 = _require.LexisNexisPersonRequestV4;
var _require2 = require("./lexis-nexis-search-request-v4"),
  LexisNexisSearchRequestV4 = _require2.LexisNexisSearchRequestV4;
module.exports = {
  LexisNexisPersonRequestV4: LexisNexisPersonRequestV4,
  LexisNexisSearchRequestV4: LexisNexisSearchRequestV4
};

},{"./lexis-nexis-person-request-v4":722,"./lexis-nexis-search-request-v4":723}],722:[function(require,module,exports){
"use strict";

var _require = require("../../../common/utils/common-v4"),
  generateUUID = _require.generateUUID;
var LexisNexisPersonRequestV4 = function () {
  function LexisNexisPersonRequestV4(person, parentPerson, request) {
    this.id = generateUUID();
    this.person = person;
    this.parentPerson = parentPerson;
    this.request = request;
  }
  var _proto = LexisNexisPersonRequestV4.prototype;
  _proto.getId = function getId() {
    return this.id;
  };
  _proto.getPerson = function getPerson() {
    return this.person;
  };
  _proto.getPersonId = function getPersonId() {
    return this.person.getId();
  };
  _proto.getParentPerson = function getParentPerson() {
    return this.parentPerson;
  };
  _proto.getParentPersonId = function getParentPersonId() {
    return this.parentPerson.getId();
  };
  _proto.getRequest = function getRequest() {
    return this.request;
  };
  _proto.getRequestId = function getRequestId() {
    return this.request.getId();
  };
  _proto.getRequestRiskScore = function getRequestRiskScore() {
    return this.request.getRiskScore();
  };
  _proto.checkIsEarlyStop = function checkIsEarlyStop() {
    return this.request.checkIsEarlyStop();
  };
  return LexisNexisPersonRequestV4;
}();
module.exports = {
  LexisNexisPersonRequestV4: LexisNexisPersonRequestV4
};

},{"../../../common/utils/common-v4":687}],723:[function(require,module,exports){
"use strict";

var LexisNexisSearchRequestV4 = function () {
  function LexisNexisSearchRequestV4(id, url, personServiceId, person, parentPerson, requestConfig, riskScore, executionId, isEarlyStop, counter) {
    this.id = id;
    this.url = url;
    this.personServiceId = personServiceId;
    this.person = person;
    this.parentPerson = parentPerson;
    this.requestConfig = requestConfig;
    this.riskScore = riskScore;
    this.executionId = executionId;
    this.isEarlyStop = isEarlyStop;
    this.counter = counter;
    this.isProcessing = false;
    this.isProcessed = false;
  }
  var _proto = LexisNexisSearchRequestV4.prototype;
  _proto.getId = function getId() {
    return this.id;
  };
  _proto.getUrl = function getUrl() {
    return this.url;
  };
  _proto.getPersonServiceId = function getPersonServiceId() {
    return this.personServiceId;
  };
  _proto.getPerson = function getPerson() {
    return this.person;
  };
  _proto.getPersonId = function getPersonId() {
    return this.person.getId();
  };
  _proto.getParentPerson = function getParentPerson() {
    return this.parentPerson;
  };
  _proto.getParentPersonId = function getParentPersonId() {
    return this.parentPerson.getId();
  };
  _proto.getRequestConfig = function getRequestConfig() {
    return this.requestConfig;
  };
  _proto.getRequestConfigId = function getRequestConfigId() {
    return this.requestConfig.getId();
  };
  _proto.getRiskScore = function getRiskScore() {
    return this.riskScore;
  };
  _proto.getExecutionId = function getExecutionId() {
    return this.executionId;
  };
  _proto.checkIsEarlyStop = function checkIsEarlyStop() {
    return this.isEarlyStop;
  };
  _proto.incCounter = function incCounter() {
    this.counter++;
  };
  _proto.getCounter = function getCounter() {
    return this.counter;
  };
  _proto.setProcessing = function setProcessing(flag) {
    this.isProcessing = flag;
  };
  _proto.checkIsProcessing = function checkIsProcessing() {
    return this.isProcessing;
  };
  _proto.setProcessed = function setProcessed(flag) {
    this.isProcessed = flag;
  };
  _proto.checkIsProcessed = function checkIsProcessed() {
    return this.isProcessed;
  };
  return LexisNexisSearchRequestV4;
}();
module.exports = {
  LexisNexisSearchRequestV4: LexisNexisSearchRequestV4
};

},{}],724:[function(require,module,exports){
"use strict";

var _require = require("./lexis-nexis-result-item-v4"),
  LexisNexisResultItemV4 = _require.LexisNexisResultItemV4;
module.exports = {
  LexisNexisResultItemV4: LexisNexisResultItemV4
};

},{"./lexis-nexis-result-item-v4":725}],725:[function(require,module,exports){
"use strict";

var LexisNexisResultItemV4 = function () {
  function LexisNexisResultItemV4(title, source, date, jurisdiction, extracts, resultId, docUrl) {
    this.title = title;
    this.source = source;
    this.date = date;
    this.jurisdiction = jurisdiction;
    this.extracts = extracts;
    this.resultId = resultId;
    this.docUrl = docUrl;
    this.keywords = [];
    this.riskScore = 0;
    this.isFromEarlyStop = false;
    this.isOpen = false;
    this.isRelevant = false;
    this.isShouldBePublished = true;
  }
  var _proto = LexisNexisResultItemV4.prototype;
  _proto.getTitle = function getTitle() {
    return this.title;
  };
  _proto.getDocUrl = function getDocUrl() {
    return this.docUrl;
  };
  _proto.getSource = function getSource() {
    return this.source;
  };
  _proto.getJurisdiction = function getJurisdiction() {
    return this.jurisdiction;
  };
  _proto.getExtracts = function getExtracts() {
    return this.extracts;
  };
  _proto.getDate = function getDate() {
    return this.date;
  };
  _proto.getResultId = function getResultId() {
    return this.resultId;
  };
  _proto.setKeywords = function setKeywords(keywords) {
    this.keywords = keywords;
  };
  _proto.getKeywords = function getKeywords() {
    return this.keywords;
  };
  _proto.setRiskScore = function setRiskScore(riskScore) {
    this.riskScore = riskScore;
  };
  _proto.getRiskScore = function getRiskScore() {
    return this.riskScore;
  };
  _proto.setIsFromEarlyStop = function setIsFromEarlyStop(isFromEarlyStop) {
    this.isFromEarlyStop = isFromEarlyStop;
  };
  _proto.checkIsFromEarlyStop = function checkIsFromEarlyStop() {
    return this.isFromEarlyStop;
  };
  _proto.setRelevant = function setRelevant(isRelevant) {
    this.isRelevant = isRelevant;
  };
  _proto.checkIsRelevant = function checkIsRelevant() {
    return this.isRelevant;
  };
  _proto.setOpen = function setOpen(isOpen) {
    this.isOpen = isOpen;
  };
  _proto.checkIsOpen = function checkIsOpen() {
    return this.isOpen;
  };
  _proto.setShouldBePublished = function setShouldBePublished(shouldBePublished) {
    this.isShouldBePublished = shouldBePublished;
  };
  _proto.checkShouldBePublished = function checkShouldBePublished() {
    return this.isShouldBePublished;
  };
  return LexisNexisResultItemV4;
}();
module.exports = {
  LexisNexisResultItemV4: LexisNexisResultItemV4
};

},{}],726:[function(require,module,exports){
"use strict";

function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
var _require = require("./requests-service-v4"),
  RequestsServiceV4 = _require.RequestsServiceV4;
var FilesRequestsServiceV4 = function (_RequestsServiceV) {
  function FilesRequestsServiceV4($rootScope, $http, $q) {
    var _this;
    _this = _RequestsServiceV.call(this, $rootScope, $http, $q) || this;
    _this.xslFile = "config/transform.xsl";
    _this.countriesFile = "config/countries.js";
    _this.xslDoc = null;
    _this.countries = [];
    return _this;
  }
  _inheritsLoose(FilesRequestsServiceV4, _RequestsServiceV);
  var _proto = FilesRequestsServiceV4.prototype;
  _proto.getXslDoc$ = function getXslDoc$() {
    var _this2 = this;
    var deferred = this.$q.defer();
    if (this.xslDoc) {
      deferred.resolve(this.xslDoc);
    } else {
      this.loadXslFile$().then(function (doc) {
        _this2.xslDoc = doc;
        deferred.resolve(_this2.xslDoc);
      })["catch"](function (error) {
        deferred.reject(error);
      });
    }
    return deferred.promise;
  };
  _proto.getCountries$ = function getCountries$() {
    var _this3 = this;
    var deferred = this.$q.defer();
    if (this.countries && this.countries.length) {
      deferred.resolve(this.countries);
    } else {
      this.loadCountriesFile$().then(function (countries) {
        _this3.countries = countries;
        deferred.resolve(_this3.countries);
      })["catch"](function (error) {
        deferred.reject(error);
      });
    }
    return deferred.promise;
  };
  _proto.loadFile$ = function loadFile$(url, dataType) {
    var deferred = this.$q.defer();
    var req = {
      method: "GET",
      url: url,
      dataType: dataType
    };
    this.$http(req).then(function (resp) {
      deferred.resolve(resp.data);
    })["catch"](function (error) {
      deferred.reject(error);
    });
    return deferred.promise;
  };
  _proto.loadXslFile$ = function loadXslFile$() {
    var deferred = this.$q.defer();
    this.loadFile$(this.xslFile, "text").then(function (data) {
      deferred.resolve(new DOMParser().parseFromString(data, "text/xml"));
    })["catch"](function (error) {
      deferred.reject(error);
    });
    return deferred.promise;
  };
  _proto.loadCountriesFile$ = function loadCountriesFile$() {
    var deferred = this.$q.defer();
    this.loadFile$(this.countriesFile, "json").then(function (data) {
      deferred.resolve(data);
    })["catch"](function (error) {
      deferred.reject(error);
    });
    return deferred.promise;
  };
  return FilesRequestsServiceV4;
}(RequestsServiceV4);
module.exports = {
  FilesRequestsServiceV4: FilesRequestsServiceV4
};

},{"./requests-service-v4":729}],727:[function(require,module,exports){
"use strict";

var _require = require("./files-requests-service-v4"),
  FilesRequestsServiceV4 = _require.FilesRequestsServiceV4;
var _require2 = require("./lexis-nexis-requests-service-v4"),
  LexisNexisRequestsServiceV4 = _require2.LexisNexisRequestsServiceV4;
module.exports = {
  FilesRequestsServiceV4: FilesRequestsServiceV4,
  LexisNexisRequestsServiceV4: LexisNexisRequestsServiceV4
};

},{"./files-requests-service-v4":726,"./lexis-nexis-requests-service-v4":728}],728:[function(require,module,exports){
"use strict";

function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
var _require = require("./requests-service-v4"),
  RequestsServiceV4 = _require.RequestsServiceV4;
var _require2 = require("../../../common/utils/log-v4"),
  makeResponseLogString = _require2.makeResponseLogString;
var LexisNexisRequestsServiceV4 = function (_RequestsServiceV) {
  function LexisNexisRequestsServiceV4($rootScope, $http, $q) {
    var _this;
    _this = _RequestsServiceV.call(this, $rootScope, $http, $q) || this;
    _this.docUrl = "";
    _this.b64docUrl = "";
    return _this;
  }
  _inheritsLoose(LexisNexisRequestsServiceV4, _RequestsServiceV);
  var _proto = LexisNexisRequestsServiceV4.prototype;
  _proto.setUrls = function setUrls(baseUrl) {
    this.docUrl = baseUrl + "request/";
    this.b64docUrl = baseUrl + "base64request/";
  };
  _proto.getPersonRequestQuery = function getPersonRequestQuery(reqUrl, personName, personKeywords) {
    return personKeywords.length ? reqUrl.replace(/%PERSONS%/, personName).replace(/%PERSON_KEYWORDS%/, personKeywords.join(" ")) : reqUrl.replace(/%PERSONS%/, personName).replace(" and %PERSON_KEYWORDS%", personKeywords.join(" "));
  };
  _proto.getRequestQuery = function getRequestQuery(reqUrl) {
    return reqUrl.replace(/%Base_url%/, this.docUrl);
  };
  _proto.getSearchResults$ = function getSearchResults$(url) {
    var _this2 = this;
    var deferred = this.$q.defer();
    var req = {
      method: "GET",
      url: url
    };
    this.$http(req).then(function (resp) {
      deferred.resolve(resp.data["@odata.count"] ? LexisNexisRequestsServiceV4.parseSearchResults(resp.data.value) : []);
    })["catch"](function (error) {
      if (_this2.$rootScope) {
        if (error && error.status && (error.status.toString() === "403" || error.status.toString() === "429")) {} else {
          _this2.$rootScope.$broadcast("addToLog", makeResponseLogString(error));
          _this2.$rootScope.$broadcast("lexisNexisMessage", makeResponseLogString(error), "error");
        }
      }
      deferred.reject(error);
    });
    return deferred.promise;
  };
  LexisNexisRequestsServiceV4.parseSearchResults = function parseSearchResults(documents) {
    return documents.map(function (newDoc) {
      return {
        title: newDoc.Title,
        source: newDoc.Source,
        date: newDoc.Date,
        jurisdiction: newDoc.Jurisdiction,
        extracts: newDoc.Extracts,
        resultId: newDoc.ResultId,
        docUrl: newDoc["DocumentContent@odata.mediaReadLink"]
      };
    });
  };
  _proto.getSearchResult$ = function getSearchResult$(url) {
    var _this3 = this;
    var deferred = this.$q.defer();
    var req = {
      url: this.b64docUrl + window.btoa(url),
      method: "GET",
      dataType: "text"
    };
    this.$http(req).then(function (resp) {
      deferred.resolve(resp.data);
    })["catch"](function (error) {
      if (_this3.$rootScope) {
        _this3.$rootScope.$broadcast("addToLog", makeResponseLogString(error));
        _this3.$rootScope.$broadcast("lexisNexisMessage", makeResponseLogString(error), "error");
      }
      deferred.reject(error);
    });
    return deferred.promise;
  };
  return LexisNexisRequestsServiceV4;
}(RequestsServiceV4);
module.exports = {
  LexisNexisRequestsServiceV4: LexisNexisRequestsServiceV4
};

},{"../../../common/utils/log-v4":693,"./requests-service-v4":729}],729:[function(require,module,exports){
"use strict";

var _require = require("../../../common/utils/common-v4"),
  generateUUID = _require.generateUUID;
var RequestsServiceV4 = function () {
  function RequestsServiceV4($rootScope, $http, $q) {
    var _this = this;
    this.$rootScope = $rootScope;
    this.$http = $http;
    this.$q = $q;
    this.routeWasChanged = false;
    this.currentCancellers = [];
    if ($rootScope) {
      $rootScope.$on("$routeChangeStart", function (event, next, current) {
        _this.routeWasChanged = true;
        if (_this.currentCancellers && _this.currentCancellers.length) {
          _this.currentCancellers.forEach(function (cancellerWrapper) {
            if (cancellerWrapper && cancellerWrapper.deferred && cancellerWrapper.deferred.promise && cancellerWrapper.deferred.promise.$$state && cancellerWrapper.deferred.promise.$$state.status === 0) {
              cancellerWrapper.deferred.resolve(cancellerWrapper.objToResolve);
            }
          });
        }
      });
    }
  }
  var _proto = RequestsServiceV4.prototype;
  _proto.createDeferredCancellerWrapper = function createDeferredCancellerWrapper(objToResolve) {
    var newCancellerWrapper = {
      deferred: this.$q.defer(),
      objToResolve: objToResolve,
      id: generateUUID()
    };
    this.currentCancellers.push(newCancellerWrapper);
    if (this.routeWasChanged) {
      newCancellerWrapper.deferred.resolve(newCancellerWrapper.objToResolve);
    }
    return newCancellerWrapper;
  };
  _proto.removeDeferredCancellerWrapper = function removeDeferredCancellerWrapper(cancellerWrapper) {
    var cancellerWrapperIdx = this.currentCancellers.findIndex(function (cw) {
      return cw.id === cancellerWrapper.id;
    });
    if (cancellerWrapperIdx !== -1) {
      this.currentCancellers.splice(cancellerWrapperIdx, 1);
    }
    RequestsServiceV4.clearCancellerWrapper(cancellerWrapper);
  };
  RequestsServiceV4.clearCancellerWrapper = function clearCancellerWrapper(cancellerWrapper) {
    cancellerWrapper.deferred.promise = null;
    cancellerWrapper.deferred = null;
    cancellerWrapper.objToResolve = null;
    cancellerWrapper.id = null;
  };
  _proto.resetRouteWasChanged = function resetRouteWasChanged() {
    this.routeWasChanged = false;
    this.currentCancellers = [];
  };
  _proto.destroy = function destroy() {
    this.$rootScope = null;
    this.$http = null;
    this.$q = null;
    this.currentCancellers.forEach(function (cancellerWrapper) {
      RequestsServiceV4.clearCancellerWrapper(cancellerWrapper);
    });
    this.currentCancellers = [];
  };
  return RequestsServiceV4;
}();
module.exports = {
  RequestsServiceV4: RequestsServiceV4
};

},{"../../../common/utils/common-v4":687}],730:[function(require,module,exports){
"use strict";

var _require = require("./lexis-nexis-persons-requests-service-v4"),
  LexisNexisPersonsRequestsServiceV4 = _require.LexisNexisPersonsRequestsServiceV4;
var _require2 = require("./lexis-nexis-persons-service-v4"),
  LexisNexisPersonsServiceV4 = _require2.LexisNexisPersonsServiceV4;
var _require3 = require("./lexis-nexis-search-configs-service-v4"),
  LexisNexisSearchConfigsServiceV4 = _require3.LexisNexisSearchConfigsServiceV4;
module.exports = {
  LexisNexisPersonsRequestsServiceV4: LexisNexisPersonsRequestsServiceV4,
  LexisNexisPersonsServiceV4: LexisNexisPersonsServiceV4,
  LexisNexisSearchConfigsServiceV4: LexisNexisSearchConfigsServiceV4
};

},{"./lexis-nexis-persons-requests-service-v4":731,"./lexis-nexis-persons-service-v4":732,"./lexis-nexis-search-configs-service-v4":733}],731:[function(require,module,exports){
"use strict";

var _require = require("../../models/requests"),
  LexisNexisPersonRequestV4 = _require.LexisNexisPersonRequestV4;
var LexisNexisPersonsRequestsServiceV4 = function () {
  function LexisNexisPersonsRequestsServiceV4() {
    this.personsRequests = [];
  }
  LexisNexisPersonsRequestsServiceV4.compareByRiskScore = function compareByRiskScore(a, b) {
    if (a.getRequestRiskScore() > b.getRequestRiskScore()) return -1;
    if (a.getRequestRiskScore() < b.getRequestRiskScore()) return 1;
    return 0;
  };
  var _proto = LexisNexisPersonsRequestsServiceV4.prototype;
  _proto.setPersonsRequests = function setPersonsRequests(persons, requestConfigs) {
    var _this = this;
    persons.forEach(function (person) {
      var parentPerson = persons.find(function (p) {
        return p.getId() === person.getParentId();
      });
      if (parentPerson) {
        requestConfigs.forEach(function (requestConfig) {
          var newPersonRequest = new LexisNexisPersonRequestV4(person, parentPerson, requestConfig);
          _this.addPersonRequest(newPersonRequest);
        });
      }
    });
  };
  _proto.addPersonRequest = function addPersonRequest(personRequest) {
    this.personsRequests.push(personRequest);
  };
  _proto.getPersonEarlyStopRequests = function getPersonEarlyStopRequests(personId) {
    var personRequests = this.personsRequests.filter(function (request) {
      return request.getPersonId() === personId && request.checkIsEarlyStop();
    }).sort(LexisNexisPersonsRequestsServiceV4.compareByRiskScore);
    this.personsRequests = this.personsRequests.filter(function (request) {
      return !personRequests.find(function (personRequest) {
        return request.getId() === personRequest.getId();
      });
    });
    return personRequests;
  };
  _proto.getPersonScoreRequests = function getPersonScoreRequests(personId, requestsCount) {
    var personRequests = this.personsRequests.filter(function (request) {
      return request.getPersonId() === personId && !request.checkIsEarlyStop();
    }).sort(LexisNexisPersonsRequestsServiceV4.compareByRiskScore).splice(0, requestsCount);
    this.personsRequests = this.personsRequests.filter(function (request) {
      return !personRequests.find(function (personRequest) {
        return request.getId() === personRequest.getId();
      });
    });
    return personRequests;
  };
  _proto.removePersonRequest = function removePersonRequest(personRequest) {
    var idx = this.personsRequests.indexOf(personRequest);
    if (idx !== -1) {
      this.personsRequests.splice(idx, 1);
    }
  };
  _proto.clearAll = function clearAll() {
    this.personsRequests = [];
  };
  return LexisNexisPersonsRequestsServiceV4;
}();
module.exports = {
  LexisNexisPersonsRequestsServiceV4: LexisNexisPersonsRequestsServiceV4
};

},{"../../models/requests":721}],732:[function(require,module,exports){
"use strict";

function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
var _require = require("../../../common/utils/common-v4"),
  generateUUID = _require.generateUUID;
var _require2 = require("../../../common/utils/countries-v4"),
  getCountiesKeywords = _require2.getCountiesKeywords;
var _require3 = require("../../models/person"),
  LexisNexisPersonV4 = _require3.LexisNexisPersonV4;
var _require4 = require("../../../common/services/logic"),
  PersonsServiceV4 = _require4.PersonsServiceV4;
var LexisNexisPersonsServiceV4 = function (_PersonsServiceV) {
  function LexisNexisPersonsServiceV4() {
    return _PersonsServiceV.apply(this, arguments) || this;
  }
  _inheritsLoose(LexisNexisPersonsServiceV4, _PersonsServiceV);
  var _proto = LexisNexisPersonsServiceV4.prototype;
  _proto.setPersons = function setPersons(personsData, countriesConfig) {
    var _this = this;
    personsData.forEach(function (personData) {
      var fullName = "";
      var firstName = "";
      var lastName = "";
      var reqPersonId = null;
      var keywords = "";
      var countriesKeywords = "";
      if (personData.country) {
        countriesKeywords = getCountiesKeywords(personData.country, countriesConfig);
      }
      firstName = personData.firstname ? personData.firstname : "";
      lastName = personData.lastname ? personData.lastname : "";
      if (personData.fullname) {
        fullName = personData.fullname;
      } else {
        fullName = ((personData.firstname ? personData.firstname : "") + " " + (personData.lastname ? personData.lastname : "")).trim();
      }
      if (personData.keywords && personData.keywords.length) {
        keywords = "(" + personData.keywords.join(" or ") + ")";
      }
      if (keywords.length) {
        keywords += countriesKeywords.length ? " or " + countriesKeywords : "";
      } else {
        keywords += countriesKeywords.length ? countriesKeywords : "";
      }
      if (personData.reqPersonId) {
        reqPersonId = personData.reqPersonId;
      }
      if (fullName.trim().length) {
        var parentId = generateUUID();
        var newParentPerson = new LexisNexisPersonV4(parentId, fullName, firstName, lastName, false, false, parentId);
        newParentPerson.setKeywords(keywords);
        newParentPerson.setReqPersonId(reqPersonId);
        _this.persons.push(newParentPerson);
        var splitPersonName = fullName.split(" ");
        if (splitPersonName.length >= 3) {
          var newAliasPerson = new LexisNexisPersonV4(generateUUID(), splitPersonName[0] + " " + splitPersonName[splitPersonName.length - 1], splitPersonName[0], splitPersonName[splitPersonName.length - 1], true, false, parentId);
          newAliasPerson.setKeywords(keywords);
          _this.persons.push(newAliasPerson);
        }
      }
    });
  };
  return LexisNexisPersonsServiceV4;
}(PersonsServiceV4);
module.exports = {
  LexisNexisPersonsServiceV4: LexisNexisPersonsServiceV4
};

},{"../../../common/services/logic":684,"../../../common/utils/common-v4":687,"../../../common/utils/countries-v4":689,"../../models/person":717}],733:[function(require,module,exports){
"use strict";

var _require = require("../../../common/utils/common-v4"),
  generateUUID = _require.generateUUID;
var _require2 = require("../../utils/keywords-v4"),
  getAllKeywords = _require2.getAllKeywords;
var _require3 = require("../../models/request-configs"),
  LexisNexisRequestConfigV4 = _require3.LexisNexisRequestConfigV4;
var LexisNexisSearchConfigsServiceV4 = function () {
  function LexisNexisSearchConfigsServiceV4() {
    this.searchConfigs = [];
  }
  var _proto = LexisNexisSearchConfigsServiceV4.prototype;
  _proto.getConfigById = function getConfigById(configId) {
    return this.searchConfigs.find(function (config) {
      return config.getId() === configId;
    });
  };
  _proto.getAllConfigs = function getAllConfigs() {
    return this.searchConfigs;
  };
  _proto.setConfigs = function setConfigs(configData) {
    var _this = this;
    configData.forEach(function (element) {
      var url = element.search_url.replace(/%KEYWORDS%/, element.keywords.map(function (i) {
        return " and " + i;
      }).join(""));
      var riskScore = parseFloat(element.riskscore);
      var earlystop = element.EarlyStopRequest ? element.EarlyStopRequest : false;
      var ignoreResults = element.IgnoreResults ? element.IgnoreResults : false;
      var keywords = getAllKeywords(element.keywords);
      _this.searchConfigs.push(new LexisNexisRequestConfigV4(generateUUID(), riskScore, keywords, url, earlystop, ignoreResults));
    });
  };
  _proto.destroy = function destroy() {
    this.searchConfigs = [];
  };
  return LexisNexisSearchConfigsServiceV4;
}();
module.exports = {
  LexisNexisSearchConfigsServiceV4: LexisNexisSearchConfigsServiceV4
};

},{"../../../common/utils/common-v4":687,"../../models/request-configs":719,"../../utils/keywords-v4":734}],734:[function(require,module,exports){
"use strict";

var getAllKeywords = function getAllKeywords(keywords) {
  var splittedKeywords = [];
  keywords.forEach(function (keys) {
    if (keys !== "%PERSON_KEYWORDS%") {
      keys = keys.toLowerCase();
      if (keys[0] === "(") {
        keys = keys.slice(1);
      }
      if (keys[keys.length - 1] === ")") {
        keys = keys.slice(0, -1);
      }
      var splittedKeys = keys.split(" or ");
      splittedKeys.forEach(function (splKey) {
        splKey = splKey.replace(/"/g, "");
        if (splKey[0] === "(") {
          splKey = splKey.slice(1);
        }
        if (splKey[splKey.length - 1] === ")") {
          splKey = splKey.slice(0, -1);
        }
        splittedKeywords.push(splKey);
      });
    }
  });
  return splittedKeywords;
};
module.exports = {
  getAllKeywords: getAllKeywords
};

},{}],735:[function(require,module,exports){
"use strict";

var AdapterV1 = function () {
  function AdapterV1($rootScope, $http, $q, $timeout) {
    this.$rootScope = $rootScope;
    this.$http = $http;
    this.$q = $q;
    this.$timeout = $timeout;
    this.errorLogger = null;
    this.infoLogger = null;
  }
  var _proto = AdapterV1.prototype;
  _proto.setLoggers = function setLoggers(errorLogger, infoLogger) {
    this.errorLogger = errorLogger;
    this.infoLogger = infoLogger;
  };
  _proto.promiseWrapper = function promiseWrapper(objToResolve) {
    var defer = this.$q.defer();
    defer.resolve(objToResolve);
    return defer.promise;
  };
  _proto.batchPromisesWrapper = function batchPromisesWrapper(batchPromisesArray) {
    return batchPromisesArray.length ? this.$q.all(batchPromisesArray) : this.promiseWrapper([]);
  };
  _proto.destroy = function destroy() {
    this.$rootScope = null;
    this.$http = null;
    this.$q = null;
    this.$timeout = null;
    this.errorLogger = null;
    this.infoLogger = null;
  };
  return AdapterV1;
}();
module.exports = {
  AdapterV1: AdapterV1
};

},{}],736:[function(require,module,exports){
"use strict";

function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
var _require = require("./http-adapter-v6"),
  HttpAdapterV6 = _require.HttpAdapterV6;
var _require2 = require("../../../common/utils/mappers-v4"),
  mapEntityName = _require2.mapEntityName;
var _require3 = require("../../templates/google-nlp-response-templates"),
  getGoogleNlpDocumentEntitiesTmplt = _require3.getGoogleNlpDocumentEntitiesTmplt,
  getGoogleNlpDocumentSentimentTmplt = _require3.getGoogleNlpDocumentSentimentTmplt;
var _require4 = require("../../instances/services/utils"),
  DocumentServiceInstance = _require4.DocumentServiceInstance;
var _require5 = require("../../instances/services/http"),
  GoogleNlpRequestsServiceInstance = _require5.GoogleNlpRequestsServiceInstance;
var GoogleNlpAdapterV6 = function (_HttpAdapterV) {
  function GoogleNlpAdapterV6($rootScope, $http, $q, $timeout) {
    var _this;
    _this = _HttpAdapterV.call(this, $rootScope, $http, $q, $timeout) || this;
    _this.documentService = null;
    _this.googleNlpRequestsService = null;
    return _this;
  }
  _inheritsLoose(GoogleNlpAdapterV6, _HttpAdapterV);
  var _proto = GoogleNlpAdapterV6.prototype;
  _proto.getGoogleNlpNamedEntities$ = function getGoogleNlpNamedEntities$(searchResult) {
    var _this2 = this;
    var deferred = this.$q.defer();
    try {
      var namedEntities$ = null;
      var entitiesData = HttpAdapterV6.getResolveObject(getGoogleNlpDocumentEntitiesTmplt(null, false));
      if (!(this.USE_GOOGLE_NLP && this.googleNlpRequestsService && this.ENABLE_GOOGLE_NLP_NAMED_ENTITIES)) {
        namedEntities$ = this.promiseWrapper(HttpAdapterV6.getResolveObject(getGoogleNlpDocumentEntitiesTmplt(null, true)));
      } else if (searchResult.getMentionedPersons().length || searchResult.getMentionedOrgs().length || searchResult.getMentionedLocs().length) {
        namedEntities$ = this.promiseWrapper(HttpAdapterV6.getResolveObject(getGoogleNlpDocumentEntitiesTmplt(searchResult, true)));
      } else if (!searchResult.checkIsContentHtmlLoaded() || !searchResult.getContentElement()) {
        namedEntities$ = this.promiseWrapper(entitiesData);
      } else {
        var contentElementText = this.getContentElementText(searchResult);
        if (!contentElementText || !contentElementText.trim()) {
          namedEntities$ = this.promiseWrapper(HttpAdapterV6.getResolveObject(getGoogleNlpDocumentEntitiesTmplt(null, true)));
        } else {
          namedEntities$ = this.googleNlpRequestsService.getDocumentEntities$(contentElementText);
        }
      }
      namedEntities$.then(function (resp) {
        try {
          entitiesData.status = resp.status;
          var data = resp.data;
          if (data.named_entities && Array.isArray(data.named_entities)) {
            entitiesData.data.named_entities = data.named_entities;
          }
          entitiesData.data.language = data.language;
          entitiesData.data.isEntitiesLoaded = data.isEntitiesLoaded === undefined || data.isEntitiesLoaded === null ? true : data.isEntitiesLoaded;
        } catch (error) {
          _this2.errorLogger(error);
        }
      })["catch"](function (error) {
        _this2.errorLogger(error.error);
        entitiesData.status = error.status;
        entitiesData.data.named_entities = [];
        entitiesData.data.language = "";
        entitiesData.data.isEntitiesLoaded = true;
      })["finally"](function () {
        deferred.resolve(entitiesData);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.getGoogleNlpSentiment$ = function getGoogleNlpSentiment$(searchResult) {
    var _this3 = this;
    var deferred = this.$q.defer();
    try {
      var sentiment$ = null;
      var sentimentInfo = HttpAdapterV6.getResolveObject({
        sentiment: 0,
        isSentimentLoaded: false
      });
      if (!(this.USE_GOOGLE_NLP && this.googleNlpRequestsService && this.ENABLE_GOOGLE_NLP_COUNT_SENTIMENT)) {
        sentiment$ = this.promiseWrapper(HttpAdapterV6.getResolveObject(getGoogleNlpDocumentSentimentTmplt(null, true)));
      } else if (searchResult.checkIsSentimentLoaded()) {
        sentiment$ = this.promiseWrapper(HttpAdapterV6.getResolveObject(getGoogleNlpDocumentSentimentTmplt(searchResult, true)));
      } else if (searchResult.checkIsFromExtraSource() || searchResult.checkIsFromAlephOccrp() || searchResult.checkIsFromOpenSanctions() || searchResult.checkIsFromOpenCorporates()) {
        sentiment$ = this.promiseWrapper(HttpAdapterV6.getResolveObject(getGoogleNlpDocumentSentimentTmplt(null, true)));
      } else if (!searchResult.checkIsContentHtmlLoaded() || !searchResult.getContentElement()) {
        sentiment$ = this.promiseWrapper(HttpAdapterV6.getResolveObject(getGoogleNlpDocumentSentimentTmplt(null, false)));
      } else {
        var contentElementText = this.getContentElementText(searchResult);
        if (!contentElementText || !contentElementText.trim()) {
          sentiment$ = this.promiseWrapper(HttpAdapterV6.getResolveObject(getGoogleNlpDocumentSentimentTmplt(null, true)));
        } else {
          sentiment$ = this.googleNlpRequestsService.getDocumentSentiment$(contentElementText);
        }
      }
      sentiment$.then(function (resp) {
        try {
          sentimentInfo.status = resp.status;
          var data = resp.data;
          sentimentInfo.data.sentiment = data.sentiment && data.sentiment.score ? data.sentiment.score : 0;
          sentimentInfo.data.isSentimentLoaded = data.isSentimentLoaded === undefined || data.isSentimentLoaded === null ? true : data.isSentimentLoaded;
        } catch (error) {
          _this3.errorLogger(error);
        }
      })["catch"](function (error) {
        _this3.errorLogger(error.error);
        sentimentInfo.status = error.status;
        sentimentInfo.data.sentiment = 0;
        sentimentInfo.data.isSentimentLoaded = true;
      })["finally"](function () {
        deferred.resolve(sentimentInfo);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.getCommentGoogleNlpNamedEntities$ = function getCommentGoogleNlpNamedEntities$(contentElementText) {
    var _this4 = this;
    var deferred = this.$q.defer();
    try {
      var namedEntities$ = null;
      var entitiesNames = HttpAdapterV6.getResolveObject([]);
      if (!(this.USE_GOOGLE_NLP && this.googleNlpRequestsService && this.ENABLE_GOOGLE_NLP_NAMED_ENTITIES)) {
        namedEntities$ = this.promiseWrapper(HttpAdapterV6.getResolveObject({
          named_entities: []
        }));
      } else if (!contentElementText.trim()) {
        namedEntities$ = this.promiseWrapper(HttpAdapterV6.getResolveObject({
          named_entities: []
        }));
      } else {
        namedEntities$ = this.googleNlpRequestsService.getDocumentEntities$(contentElementText);
      }
      namedEntities$.then(function (resp) {
        try {
          entitiesNames.status = resp.status;
          var data = resp.data;
          if (data.named_entities && Array.isArray(data.named_entities)) {
            entitiesNames.data = data.named_entities.map(mapEntityName);
          }
        } catch (error) {
          _this4.errorLogger(error);
        }
      })["catch"](function (error) {
        _this4.errorLogger(error.error);
        entitiesNames.status = error.status;
        entitiesNames.data = [];
      })["finally"](function () {
        deferred.resolve(entitiesNames);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.initServices = function initServices(endpointsConfig) {
    this.googleNlpRequestsService = GoogleNlpRequestsServiceInstance.getNewService(this.$rootScope, this.$http, this.$q, this.$timeout);
    this.googleNlpRequestsService.setUrls(endpointsConfig);
    this.documentService = DocumentServiceInstance.getService();
    this.documentService.setUrls(endpointsConfig);
  };
  _proto.injectServices = function injectServices(googleNlpRequestsService, documentService) {
    this.googleNlpRequestsService = googleNlpRequestsService;
    this.documentService = documentService;
  };
  _proto.resetAdapter = function resetAdapter() {
    var _this$googleNlpReques;
    (_this$googleNlpReques = this.googleNlpRequestsService) == null || _this$googleNlpReques.resetRouteWasChanged();
  };
  _proto.setTimeouts = function setTimeouts(timeouts) {
    var _this$googleNlpReques2;
    (_this$googleNlpReques2 = this.googleNlpRequestsService) == null || _this$googleNlpReques2.setTimeouts(timeouts);
  };
  _proto.setAdapterConstants = function setAdapterConstants(constants) {
    if (constants) {
      this.USE_GOOGLE_NLP = constants.use_google_nlp;
      this.ENABLE_GOOGLE_NLP_NAMED_ENTITIES = constants.enable_google_nlp_named_entities;
      this.ENABLE_GOOGLE_NLP_COUNT_SENTIMENT = constants.enable_google_nlp_count_sentiment;
    } else {
      this.USE_GOOGLE_NLP = true;
      this.ENABLE_GOOGLE_NLP_NAMED_ENTITIES = true;
      this.ENABLE_GOOGLE_NLP_COUNT_SENTIMENT = true;
    }
  };
  _proto.destroy = function destroy() {
    _HttpAdapterV.prototype.destroy.call(this);
    this.googleNlpRequestsService = null;
  };
  return GoogleNlpAdapterV6;
}(HttpAdapterV6);
module.exports = {
  GoogleNlpAdapterV6: GoogleNlpAdapterV6
};

},{"../../../common/utils/mappers-v4":694,"../../instances/services/http":790,"../../instances/services/utils":809,"../../templates/google-nlp-response-templates":886,"./http-adapter-v6":737}],737:[function(require,module,exports){
"use strict";

function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
var _require = require("../adapter-v1"),
  AdapterV1 = _require.AdapterV1;
var HttpAdapterV6 = function (_AdapterV) {
  function HttpAdapterV6($rootScope, $http, $q, $timeout) {
    var _this;
    _this = _AdapterV.call(this, $rootScope, $http, $q, $timeout) || this;
    _this.documentService = null;
    return _this;
  }
  _inheritsLoose(HttpAdapterV6, _AdapterV);
  var _proto = HttpAdapterV6.prototype;
  _proto.getContentElementText = function getContentElementText(searchResult) {
    var contentElementText;
    try {
      contentElementText = searchResult.getContentElementText();
      if (!contentElementText) {
        var contentEl = searchResult.getContentElement();
        if (contentEl) {
          var _this$documentService;
          contentElementText = (_this$documentService = this.documentService) == null ? void 0 : _this$documentService.getInnerText(this.documentService.removeStyles(contentEl));
        }
        searchResult.setContentElementText(contentElementText || "");
      }
    } catch (error) {
      this.errorLogger(error);
    }
    return contentElementText || "";
  };
  HttpAdapterV6.getResolveObject = function getResolveObject(data) {
    return {
      data: data,
      status: -1
    };
  };
  _proto.destroy = function destroy() {
    _AdapterV.prototype.destroy.call(this);
    this.documentService = null;
  };
  return HttpAdapterV6;
}(AdapterV1);
module.exports = {
  HttpAdapterV6: HttpAdapterV6
};

},{"../adapter-v1":735}],738:[function(require,module,exports){
"use strict";

var _require = require("./google-nlp-adapter-v6"),
  GoogleNlpAdapterV6 = _require.GoogleNlpAdapterV6;
var _require2 = require("./media-py-adapter-v8"),
  MediaPyAdapterV8 = _require2.MediaPyAdapterV8;
var _require3 = require("./media-py-gpt-adapter-v1"),
  MediaPyGptAdapterV1 = _require3.MediaPyGptAdapterV1;
var _require4 = require("./media-py-llm-adapter-v1"),
  MediaPyLLMAdapterV1 = _require4.MediaPyLLMAdapterV1;
var _require5 = require("./parse-document-adapter-v6"),
  ParseDocumentAdapterV6 = _require5.ParseDocumentAdapterV6;
var _require6 = require("./scrape-adapter-v6"),
  ScrapeAdapterV6 = _require6.ScrapeAdapterV6;
module.exports = {
  GoogleNlpAdapterV6: GoogleNlpAdapterV6,
  MediaPyAdapterV8: MediaPyAdapterV8,
  MediaPyGptAdapterV1: MediaPyGptAdapterV1,
  MediaPyLLMAdapterV1: MediaPyLLMAdapterV1,
  ParseDocumentAdapterV6: ParseDocumentAdapterV6,
  ScrapeAdapterV6: ScrapeAdapterV6
};

},{"./google-nlp-adapter-v6":736,"./media-py-adapter-v8":739,"./media-py-gpt-adapter-v1":740,"./media-py-llm-adapter-v1":741,"./parse-document-adapter-v6":742,"./scrape-adapter-v6":743}],739:[function(require,module,exports){
"use strict";

function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
var _require = require("./http-adapter-v6"),
  HttpAdapterV6 = _require.HttpAdapterV6;
var _require2 = require("../../templates/media-py-response-templates"),
  getMediaPyCleanHtmlTmplt = _require2.getMediaPyCleanHtmlTmplt,
  getMediaPyNamedEntitiesTmpl = _require2.getMediaPyNamedEntitiesTmpl,
  getMediaPyCombinedSearchTmplt = _require2.getMediaPyCombinedSearchTmplt,
  getMediaPyMarkupHtmlTmplt = _require2.getMediaPyMarkupHtmlTmplt,
  getMediaPySummarizeTextTmplt = _require2.getMediaPySummarizeTextTmplt,
  getMediaPySpecialParsingTmplt = _require2.getMediaPySpecialParsingTmplt,
  getMediaPySummarizeProfileTmplt = _require2.getMediaPySummarizeProfileTmplt,
  getMediaPyConnectionsGraphTmplt = _require2.getMediaPyConnectionsGraphTmplt,
  getMediaPySpecialParsingJsonTmplt = _require2.getMediaPySpecialParsingJsonTmplt;
var _require3 = require("../../../common/utils/mappers-v4"),
  mapRiskKeyword = _require3.mapRiskKeyword,
  mapNamedEntity = _require3.mapNamedEntity,
  mapConnectionGraphItem = _require3.mapConnectionGraphItem,
  mapEntityName = _require3.mapEntityName;
var _require4 = require("../../instances/services/http"),
  MediaPyRequestsServiceInstance = _require4.MediaPyRequestsServiceInstance;
var _require5 = require("../../instances/services/utils"),
  DocumentServiceInstance = _require5.DocumentServiceInstance;
var MediaPyAdapterV8 = function (_HttpAdapterV) {
  function MediaPyAdapterV8($rootScope, $http, $q, $timeout) {
    var _this;
    _this = _HttpAdapterV.call(this, $rootScope, $http, $q, $timeout) || this;
    _this.documentService = null;
    _this.mediaPyRequestsService = null;
    return _this;
  }
  _inheritsLoose(MediaPyAdapterV8, _HttpAdapterV);
  var _proto = MediaPyAdapterV8.prototype;
  _proto.init$ = function init$() {
    var _this2 = this;
    var deferred = this.$q.defer();
    try {
      var _init$ = null;
      if (!(this.USE_MEDIA_SEARCH_PY && this.mediaPyRequestsService)) {
        _init$ = this.promiseWrapper({});
      } else {
        var _this$mediaPyRequests;
        _init$ = (_this$mediaPyRequests = this.mediaPyRequestsService) == null ? void 0 : _this$mediaPyRequests.init$();
      }
      _init$.then(function () {})["catch"](function (error) {
        _this2.errorLogger(error);
      })["finally"](function () {
        deferred.resolve();
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.getMediaPyCleanHtml$ = function getMediaPyCleanHtml$(searchResult) {
    var _this3 = this;
    var deferred = this.$q.defer();
    try {
      var contentHtml$ = null;
      var cleanHtmlData = HttpAdapterV6.getResolveObject(getMediaPyCleanHtmlTmplt(null));
      if (!(this.USE_MEDIA_SEARCH_PY && this.mediaPyRequestsService && this.ENABLE_MEDIA_PY_CLEAN_HTML)) {
        contentHtml$ = this.promiseWrapper(HttpAdapterV6.getResolveObject(getMediaPyCleanHtmlTmplt(searchResult)));
      } else if (searchResult.checkIsFromExtraSource() || searchResult.checkIsFromAlephOccrp() || searchResult.checkIsFromOpenSanctions() || searchResult.checkIsFromOpenCorporates()) {
        contentHtml$ = this.promiseWrapper(HttpAdapterV6.getResolveObject(getMediaPyCleanHtmlTmplt(searchResult)));
      } else if (searchResult.checkIsHtmlCleared() && searchResult.getContentElement() && searchResult.getContentElement() instanceof HTMLElement) {
        contentHtml$ = this.promiseWrapper(HttpAdapterV6.getResolveObject(getMediaPyCleanHtmlTmplt(searchResult)));
      } else if (!searchResult.checkIsContentHtmlLoaded()) {
        contentHtml$ = this.promiseWrapper(cleanHtmlData);
      } else {
        contentHtml$ = this.mediaPyRequestsService.cleanHtmlDocument$(searchResult.getContentHtml() || "");
      }
      contentHtml$.then(function (resp) {
        cleanHtmlData = resp;
      })["catch"](function (error) {
        _this3.errorLogger(error.error);
        cleanHtmlData.status = error.status;
      })["finally"](function () {
        deferred.resolve(cleanHtmlData);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.getMediaPyNamedEntities$ = function getMediaPyNamedEntities$(searchResult) {
    var _this4 = this;
    var deferred = this.$q.defer();
    try {
      var entitiesData = HttpAdapterV6.getResolveObject(getMediaPyNamedEntitiesTmpl(null, false));
      var namedEntities$ = null;
      if (!(this.USE_MEDIA_SEARCH_PY && this.mediaPyRequestsService && this.ENABLE_MEDIA_PY_NAMED_ENTITIES)) {
        namedEntities$ = this.promiseWrapper(HttpAdapterV6.getResolveObject(getMediaPyNamedEntitiesTmpl(searchResult, true)));
      } else if (searchResult.getMentionedPersons().length || searchResult.getMentionedOrgs().length || searchResult.getMentionedLocs().length) {
        namedEntities$ = this.promiseWrapper(HttpAdapterV6.getResolveObject(getMediaPyNamedEntitiesTmpl(searchResult, true)));
      } else if (!searchResult.checkIsContentHtmlLoaded() || !searchResult.getContentElement()) {
        namedEntities$ = this.promiseWrapper(entitiesData);
      } else {
        var contentElementText = this.getContentElementText(searchResult);
        if (!contentElementText || !contentElementText.trim()) {
          namedEntities$ = this.promiseWrapper(HttpAdapterV6.getResolveObject(getMediaPyNamedEntitiesTmpl(null, true)));
        } else {
          namedEntities$ = this.mediaPyRequestsService.getDocumentEntities$(contentElementText, searchResult.getLanguage());
        }
      }
      namedEntities$.then(function (resp) {
        try {
          entitiesData.status = resp.status;
          var data = resp.data;
          if (data.named_entities && Array.isArray(data.named_entities)) {
            entitiesData.data.named_entities = data.named_entities;
          }
          entitiesData.data.isEntitiesLoaded = data.isEntitiesLoaded === undefined || data.isEntitiesLoaded === null ? true : data.isEntitiesLoaded;
        } catch (error) {
          _this4.errorLogger(error);
        }
      })["catch"](function (error) {
        _this4.errorLogger(error.error);
        entitiesData.status = error.status;
        entitiesData.data.named_entities = [];
        entitiesData.data.isEntitiesLoaded = true;
      })["finally"](function () {
        deferred.resolve(entitiesData);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.getMediaPyAnalyzeTextInfo$ = function getMediaPyAnalyzeTextInfo$(searchResult) {
    var _this5 = this;
    var deferred = this.$q.defer();
    try {
      var analyzeTextInfoData = HttpAdapterV6.getResolveObject(getMediaPyCombinedSearchTmplt(null));
      var analyzeText$ = null;
      if (!(this.USE_MEDIA_SEARCH_PY && this.mediaPyRequestsService && this.ENABLE_MEDIA_PY_ANALYZE_TEXT)) {
        analyzeText$ = this.promiseWrapper(HttpAdapterV6.getResolveObject(getMediaPyCombinedSearchTmplt(searchResult)));
      } else if (searchResult.checkIsAnalyzed()) {
        analyzeText$ = this.promiseWrapper(HttpAdapterV6.getResolveObject(getMediaPyCombinedSearchTmplt(searchResult)));
      } else if (!searchResult.checkIsContentHtmlLoaded() || !searchResult.getContentElement()) {
        analyzeText$ = this.promiseWrapper(analyzeTextInfoData);
      } else {
        var contentElementText = this.getContentElementText(searchResult);
        if (!contentElementText || !contentElementText.trim()) {
          analyzeText$ = this.promiseWrapper(analyzeTextInfoData);
        } else {
          analyzeText$ = this.mediaPyRequestsService.combinedSearch$(contentElementText, searchResult.getExtendedPersonInfo(), searchResult.getLanguage(), searchResult.getScoreMode());
        }
      }
      analyzeText$.then(function (resp) {
        analyzeTextInfoData = resp;
      })["catch"](function (error) {
        _this5.errorLogger(error.error);
        analyzeTextInfoData.status = error.status;
      })["finally"](function () {
        deferred.resolve(analyzeTextInfoData);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.getMediaPyMarkupHtml$ = function getMediaPyMarkupHtml$(searchResult) {
    var _this6 = this;
    var deferred = this.$q.defer();
    try {
      var contentMarkupHtml$ = null;
      var markupHtmlData = HttpAdapterV6.getResolveObject(getMediaPyMarkupHtmlTmplt(null, false));
      if (!(this.USE_MEDIA_SEARCH_PY && this.mediaPyRequestsService && this.ENABLE_MEDIA_PY_MARKUP_HTML)) {
        contentMarkupHtml$ = this.promiseWrapper(markupHtmlData);
      } else if (searchResult.checkIsContentMarkupHtmlLoaded()) {
        contentMarkupHtml$ = this.promiseWrapper(HttpAdapterV6.getResolveObject(getMediaPyMarkupHtmlTmplt(searchResult, true)));
      } else if (searchResult.checkIsFromAlephOccrp()) {
        contentMarkupHtml$ = this.promiseWrapper(HttpAdapterV6.getResolveObject(getMediaPyMarkupHtmlTmplt(searchResult, false)));
      } else if (searchResult.checkIsFromOpenSanctions()) {
        contentMarkupHtml$ = this.promiseWrapper(HttpAdapterV6.getResolveObject(getMediaPyMarkupHtmlTmplt(searchResult, false)));
      } else if (!searchResult.checkIsContentHtmlLoaded() || !searchResult.getContentElement()) {
        contentMarkupHtml$ = this.promiseWrapper(markupHtmlData);
      } else {
        var contentElementText = this.getContentElementText(searchResult);
        if (!contentElementText || !contentElementText.trim()) {
          contentMarkupHtml$ = this.promiseWrapper(markupHtmlData);
        } else {
          var _this$documentService;
          var contentEl = searchResult.getContentElement();
          contentMarkupHtml$ = this.mediaPyRequestsService.markupHtmlDocument$(((_this$documentService = this.documentService) == null ? void 0 : _this$documentService.getHtmlForMarkup(contentEl)) || "", contentElementText, searchResult.getExtendedPersonInfo(), searchResult.getLanguage(), searchResult.getScoreMode(), [].concat(searchResult.getAnalyzeRiskKeywords()).map(mapRiskKeyword), [].concat(searchResult.getMentionedPersons()).concat(searchResult.getMentionedOrgs()).concat(searchResult.getMentionedLocs()).concat(searchResult.getAnalyzeRiskPersons()).concat(searchResult.getAnalyzeRiskOrgs()).map(mapNamedEntity));
        }
      }
      contentMarkupHtml$.then(function (resp) {
        markupHtmlData = resp;
      })["catch"](function (error) {
        _this6.errorLogger(error.error);
        markupHtmlData.status = error.status;
      })["finally"](function () {
        deferred.resolve(markupHtmlData);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.getMediaPyTextInfo$ = function getMediaPyTextInfo$(searchResult, mandatoryKeywords) {
    var _this7 = this;
    var deferred = this.$q.defer();
    try {
      var textInfo$ = null;
      var textInfoData = HttpAdapterV6.getResolveObject({
        mediaPyRiskScore: 0,
        isMediaPyRiskScored: false,
        mediaPySentiment: 0,
        isMediaPySentimentLoaded: false,
        mediaPyTitleRiskScore: 0,
        mediaPyNameImportance: 0,
        img: null,
        language: null,
        keywords: [],
        risk_keywords: []
      });
      if (!(this.USE_MEDIA_SEARCH_PY && this.mediaPyRequestsService && this.ENABLE_MEDIA_PY_TEXT_INFO)) {
        textInfo$ = this.promiseWrapper(HttpAdapterV6.getResolveObject({
          risk: searchResult.getRiskScore(),
          isMediaPyRiskScored: true,
          sentiment: 0,
          isMediaPySentimentLoaded: true,
          title_risk: 0,
          name_importance: 0,
          word_cloud: null,
          language: searchResult.getLanguage() ? searchResult.getLanguage() : null,
          keywords: searchResult.getAnalyzeKeywords(),
          risk_keywords: searchResult.getAnalyzeRiskKeywords()
        }));
      } else if (searchResult.checkIsFromExtraSource() || searchResult.checkIsFromAlephOccrp() || searchResult.checkIsFromOpenSanctions() || searchResult.checkIsFromOpenCorporates()) {
        textInfo$ = this.promiseWrapper(HttpAdapterV6.getResolveObject({
          risk: searchResult.getMediaPyRiskScore(),
          isMediaPyRiskScored: true,
          sentiment: 0,
          isMediaPySentimentLoaded: true,
          title_risk: 0,
          name_importance: 0,
          word_cloud: null,
          language: searchResult.getLanguage() ? searchResult.getLanguage() : null,
          keywords: searchResult.getAnalyzeKeywords(),
          risk_keywords: searchResult.getAnalyzeRiskKeywords()
        }));
      } else if (searchResult.checkIsMediaPyRiskScored() && searchResult.checkIsSentimentLoaded() && searchResult.getWordCloudImg() && searchResult.getLanguage()) {
        textInfo$ = this.promiseWrapper(HttpAdapterV6.getResolveObject({
          risk: searchResult.getMediaPyRiskScore(),
          isMediaPyRiskScored: true,
          sentiment: searchResult.getSentiment(),
          isMediaPySentimentLoaded: true,
          title_risk: searchResult.getMediaPyTitleRiskScore(),
          name_importance: searchResult.getMediaPyNameImportance(),
          word_cloud: searchResult.getWordCloudImg(),
          language: searchResult.getLanguage(),
          keywords: searchResult.getAnalyzeKeywords(),
          risk_keywords: searchResult.getAnalyzeRiskKeywords()
        }));
      } else if (!searchResult.checkIsContentHtmlLoaded() || !searchResult.getContentElement()) {
        textInfo$ = this.promiseWrapper(HttpAdapterV6.getResolveObject({
          risk: 0,
          isMediaPyRiskScored: false,
          sentiment: 0,
          isMediaPySentimentLoaded: false,
          title_risk: 0,
          name_importance: 0,
          word_cloud: null,
          language: null,
          keywords: [],
          risk_keywords: []
        }));
      } else {
        var contentElementText = this.getContentElementText(searchResult);
        if (!contentElementText || !contentElementText.trim()) {
          textInfo$ = this.promiseWrapper(HttpAdapterV6.getResolveObject({
            risk: 0,
            isMediaPyRiskScored: true,
            sentiment: 0,
            isMediaPySentimentLoaded: true,
            title_risk: 0,
            name_importance: 0,
            word_cloud: null,
            language: null,
            keywords: [],
            risk_keywords: []
          }));
        } else {
          textInfo$ = this.mediaPyRequestsService.getDocumentInfo$(searchResult.getTitle(), contentElementText, searchResult.getExtendedPersonInfo(), searchResult.getLanguage(), 450, 300, [].concat(searchResult.getAnalyzeRiskKeywords()).map(mapRiskKeyword), mandatoryKeywords && Array.isArray(mandatoryKeywords) && mandatoryKeywords.length ? [].concat(mandatoryKeywords) : [], searchResult.getScoreMode());
        }
      }
      textInfo$.then(function (resp) {
        try {
          textInfoData.status = resp.status;
          var data = resp.data;
          textInfoData.data.mediaPyRiskScore = data.risk || 0;
          textInfoData.data.isMediaPyRiskScored = data.isMediaPyRiskScored === undefined || data.isMediaPyRiskScored === null ? true : data.isMediaPyRiskScored;
          textInfoData.data.mediaPySentiment = data.sentiment || 0;
          textInfoData.data.isMediaPySentimentLoaded = data.isMediaPySentimentLoaded === undefined || data.isMediaPySentimentLoaded === null ? true : data.isMediaPySentimentLoaded;
          textInfoData.data.mediaPyTitleRiskScore = data.title_risk || 0;
          textInfoData.data.mediaPyNameImportance = data.name_importance || 0;
          textInfoData.data.img = data.word_cloud;
          textInfoData.data.language = data.language;
          textInfoData.data.keywords = data.keywords;
          textInfoData.data.risk_keywords = data.risk_keywords;
        } catch (error) {
          _this7.errorLogger(error);
        }
      })["catch"](function (error) {
        _this7.errorLogger(error.error);
        textInfoData.status = error.status;
        textInfoData.data.mediaPyRiskScore = 0;
        textInfoData.data.isMediaPyRiskScored = true;
        textInfoData.data.mediaPySentiment = 0;
        textInfoData.data.isMediaPySentimentLoaded = true;
        textInfoData.data.mediaPyTitleRiskScore = 0;
        textInfoData.data.mediaPyNameImportance = 0;
        textInfoData.data.img = null;
        textInfoData.data.language = null;
        textInfoData.data.keywords = [];
        textInfoData.data.risk_keywords = [];
      })["finally"](function () {
        deferred.resolve(textInfoData);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.getMediaPySummarizeText$ = function getMediaPySummarizeText$(searchResult) {
    var _this8 = this;
    var deferred = this.$q.defer();
    try {
      var summarizeText$ = null;
      var summaryInfoData = HttpAdapterV6.getResolveObject(getMediaPySummarizeTextTmplt(null));
      if (!(this.USE_MEDIA_SEARCH_PY && this.mediaPyRequestsService && this.ENABLE_MEDIA_PY_SUMMARIZE_TEXT)) {
        summarizeText$ = this.promiseWrapper(HttpAdapterV6.getResolveObject(getMediaPySummarizeTextTmplt(searchResult)));
      } else if (searchResult.getExtendedSummary() && searchResult.getExtendedSummaryHtml()) {
        summarizeText$ = this.promiseWrapper(HttpAdapterV6.getResolveObject(getMediaPySummarizeTextTmplt(searchResult)));
      } else if (searchResult.checkIsFromExtraSource() || searchResult.checkIsFromAlephOccrp() || searchResult.checkIsFromOpenSanctions() || searchResult.checkIsFromOpenCorporates()) {
        summarizeText$ = this.promiseWrapper(HttpAdapterV6.getResolveObject(getMediaPySummarizeTextTmplt(searchResult)));
      } else if (!searchResult.checkIsContentHtmlLoaded() || !searchResult.getContentElement()) {
        summarizeText$ = this.promiseWrapper(summaryInfoData);
      } else {
        var contentElementText = this.getContentElementText(searchResult);
        if (!contentElementText || !contentElementText.trim()) {
          summarizeText$ = this.promiseWrapper(HttpAdapterV6.getResolveObject(summaryInfoData));
        } else {
          summarizeText$ = this.mediaPyRequestsService.summarizeText$(contentElementText, searchResult.getLanguage(), [].concat(searchResult.getAnalyzeRiskKeywords()).map(mapRiskKeyword));
        }
      }
      summarizeText$.then(function (resp) {
        summaryInfoData = resp;
      })["catch"](function (error) {
        _this8.errorLogger(error.error);
        summaryInfoData.status = error.status;
      })["finally"](function () {
        deferred.resolve(summaryInfoData);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.getMediaPySpecialParsing$ = function getMediaPySpecialParsing$(searchResult, type, format, content) {
    var _this9 = this;
    var deferred = this.$q.defer();
    try {
      var specialParsing$ = null;
      var specialParsingData = HttpAdapterV6.getResolveObject(getMediaPySpecialParsingTmplt(null, false, false));
      if (!(this.USE_MEDIA_SEARCH_PY && this.mediaPyRequestsService && this.ENABLE_MEDIA_PY_SPECIAL_PARSING)) {
        specialParsing$ = this.promiseWrapper(HttpAdapterV6.getResolveObject(getMediaPySpecialParsingTmplt(searchResult, true, false)));
      } else if (!searchResult.checkIsFromExtraSource()) {
        specialParsing$ = this.promiseWrapper(specialParsingData);
      } else if (!searchResult.getSource()) {
        specialParsing$ = this.promiseWrapper(HttpAdapterV6.getResolveObject(getMediaPySpecialParsingTmplt(searchResult, searchResult.getRelevance(), false)));
      } else if (searchResult.checkIsContentMarkupHtmlLoaded()) {
        specialParsing$ = this.promiseWrapper(HttpAdapterV6.getResolveObject(getMediaPySpecialParsingTmplt(searchResult, searchResult.getRelevance(), true)));
      } else if (!searchResult.checkIsContentHtmlLoaded() || !searchResult.getContentElement()) {
        specialParsing$ = this.promiseWrapper(specialParsingData);
      } else {
        var _this$documentService2;
        specialParsing$ = this.mediaPyRequestsService.specialParsing$(((_this$documentService2 = this.documentService) == null ? void 0 : _this$documentService2.getHtmlForMarkup(searchResult.getContentElement())) || "", searchResult.getSource(), searchResult.getExtendedPersonInfo(), type, format, content);
      }
      specialParsing$.then(function (resp) {
        specialParsingData = resp;
      })["catch"](function (error) {
        _this9.errorLogger(error.error);
        specialParsingData.status = error.status;
      })["finally"](function () {
        deferred.resolve(specialParsingData);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.getMediaPySpecialParsingJson$ = function getMediaPySpecialParsingJson$(searchResult, type, format, content) {
    var _this10 = this;
    var deferred = this.$q.defer();
    try {
      var specialParsing$ = null;
      var specialParsingData = HttpAdapterV6.getResolveObject(getMediaPySpecialParsingJsonTmplt(null));
      if (!(this.USE_MEDIA_SEARCH_PY && this.mediaPyRequestsService && this.ENABLE_MEDIA_PY_SPECIAL_PARSING)) {
        specialParsing$ = this.promiseWrapper(HttpAdapterV6.getResolveObject(getMediaPySpecialParsingJsonTmplt(searchResult)));
      } else if (!searchResult.checkIsFromOpenSanctions()) {
        specialParsing$ = this.promiseWrapper(HttpAdapterV6.getResolveObject(getMediaPySpecialParsingJsonTmplt(searchResult)));
      } else if (!searchResult.checkIsContentHtmlLoaded() || !searchResult.getContentElement()) {
        specialParsing$ = this.promiseWrapper(HttpAdapterV6.getResolveObject(getMediaPySpecialParsingJsonTmplt(searchResult)));
      } else {
        specialParsing$ = this.mediaPyRequestsService.specialParsing$("", searchResult.getSource(), {
          entity: {
            name: [searchResult.getPersonFullName()]
          }
        }, type, format, content);
      }
      specialParsing$.then(function (resp) {
        specialParsingData = resp;
      })["catch"](function (error) {
        _this10.errorLogger(error.error);
        specialParsingData.status = error.status;
      })["finally"](function () {
        deferred.resolve(specialParsingData);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.getMediaPySummarizePerson$ = function getMediaPySummarizePerson$(person) {
    var _this11 = this;
    var deferred = this.$q.defer();
    try {
      var summarizePerson$ = null;
      var summaryData = HttpAdapterV6.getResolveObject(getMediaPySummarizeProfileTmplt(null));
      if (!(this.USE_MEDIA_SEARCH_PY && this.mediaPyRequestsService && this.ENABLE_MEDIA_PY_SUMMARIZE_PERSON)) {
        summarizePerson$ = this.promiseWrapper(summaryData);
      } else if (person.getExtendedSummary() && person.getExtendedSummary().length) {
        summarizePerson$ = this.promiseWrapper(HttpAdapterV6.getResolveObject(getMediaPySummarizeProfileTmplt(person)));
      } else if (!(person.getTotalResults() && person.getTotalResults().length)) {
        summarizePerson$ = this.promiseWrapper(summaryData);
      } else {
        var totalResultsTexts = person.getTotalResults().filter(function (searchResult) {
          return searchResult.checkIsFromSearchEngine() || searchResult.checkIsFromGoogleNewsRss() || searchResult.checkIsFromStockMarket();
        }).map(function (searchResult) {
          return {
            text: _this11.getContentElementText(searchResult),
            language: searchResult.getLanguage()
          };
        }).filter(function (obj) {
          return obj.text && obj.text.trim();
        });
        if (!totalResultsTexts.length) {
          summarizePerson$ = this.promiseWrapper(summaryData);
        } else {
          summarizePerson$ = this.mediaPyRequestsService.summarizePerson$(totalResultsTexts, person.getExtendedInfo());
        }
      }
      summarizePerson$.then(function (resp) {
        summaryData = resp;
      })["catch"](function (error) {
        _this11.errorLogger(error.error);
        summaryData.status = error.status;
      })["finally"](function () {
        deferred.resolve(summaryData);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.getMediaPyConnectionsGraph$ = function getMediaPyConnectionsGraph$(graphSearchResults) {
    var _this12 = this;
    var deferred = this.$q.defer();
    try {
      var connectionsGraph$ = null;
      var connectionsGraphData = HttpAdapterV6.getResolveObject(getMediaPyConnectionsGraphTmplt());
      if (!(this.USE_MEDIA_SEARCH_PY && this.mediaPyRequestsService && this.ENABLE_MEDIA_PY_CONNECTIONS_GRAPH)) {
        connectionsGraph$ = this.promiseWrapper(connectionsGraphData);
      } else if (!graphSearchResults || !graphSearchResults.length) {
        connectionsGraph$ = this.promiseWrapper(connectionsGraphData);
      } else {
        var articles = graphSearchResults.map(function (searchResult) {
          return {
            title: searchResult.getTitle(),
            source: searchResult.checkIsFromSearchEngine() || searchResult.checkIsFromGoogleNewsRss() || searchResult.checkIsFromStockMarket() ? "google" : "external",
            named_entities: [].concat(searchResult.getMentionedPersons()).concat(searchResult.getMentionedOrgs()).concat(searchResult.getMentionedLocs()).concat(searchResult.getAnalyzeRiskPersons()).concat(searchResult.getAnalyzeRiskOrgs()).map(mapConnectionGraphItem)
          };
        });
        var mainEntity = graphSearchResults[0].getExtendedPersonInfo();
        connectionsGraph$ = this.mediaPyRequestsService.connectionsGraph$(articles, mainEntity);
      }
      connectionsGraph$.then(function (resp) {
        connectionsGraphData = resp;
      })["catch"](function (error) {
        _this12.errorLogger(error.error);
        connectionsGraphData.status = error.status;
      })["finally"](function () {
        deferred.resolve(connectionsGraphData);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.getCommentMediaPyClearHtml$ = function getCommentMediaPyClearHtml$(contentHtml) {
    var _this13 = this;
    var deferred = this.$q.defer();
    try {
      var contentHtml$ = null;
      var cleanHtmlData = HttpAdapterV6.getResolveObject(getMediaPyCleanHtmlTmplt());
      if (!(this.USE_MEDIA_SEARCH_PY && this.mediaPyRequestsService && this.ENABLE_MEDIA_PY_CLEAN_HTML)) {
        contentHtml$ = this.promiseWrapper(cleanHtmlData);
      } else {
        contentHtml$ = this.mediaPyRequestsService.cleanHtmlDocument$(contentHtml);
      }
      contentHtml$.then(function (resp) {
        cleanHtmlData = resp;
      })["catch"](function (error) {
        _this13.errorLogger(error.error);
        cleanHtmlData.status = error.status;
      })["finally"](function () {
        deferred.resolve(cleanHtmlData);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.getCommentMarkupHtml$ = function getCommentMarkupHtml$(contentEl, personFullName, scoreMode) {
    var _this14 = this;
    var deferred = this.$q.defer();
    try {
      var contentMarkupHtml$ = null;
      var markupHtmlData = HttpAdapterV6.getResolveObject(getMediaPyMarkupHtmlTmplt(null, false));
      if (!(this.USE_MEDIA_SEARCH_PY && this.mediaPyRequestsService && this.ENABLE_MEDIA_PY_MARKUP_HTML)) {
        contentMarkupHtml$ = this.promiseWrapper(markupHtmlData);
      } else {
        var _this$documentService3, _this$documentService4;
        var contentElementText = (_this$documentService3 = this.documentService) == null ? void 0 : _this$documentService3.getInnerText(this.documentService.removeStyles(contentEl));
        contentMarkupHtml$ = this.mediaPyRequestsService.markupHtmlDocument$(((_this$documentService4 = this.documentService) == null ? void 0 : _this$documentService4.getHtmlForMarkup(contentEl)) || "", contentElementText || "", {
          entity: {
            name: [personFullName]
          }
        }, undefined, scoreMode, [], []);
      }
      contentMarkupHtml$.then(function (resp) {
        markupHtmlData = resp;
      })["catch"](function (error) {
        _this14.errorLogger(error.error);
        markupHtmlData.status = error.status;
      })["finally"](function () {
        deferred.resolve(markupHtmlData);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.getCommentMediaPyNamedEntities$ = function getCommentMediaPyNamedEntities$(contentElementText) {
    var _this15 = this;
    var deferred = this.$q.defer();
    try {
      var namedEntities$ = null;
      var entitiesNamesData = HttpAdapterV6.getResolveObject([]);
      if (!(this.USE_MEDIA_SEARCH_PY && this.mediaPyRequestsService && this.ENABLE_MEDIA_PY_NAMED_ENTITIES)) {
        namedEntities$ = this.promiseWrapper(HttpAdapterV6.getResolveObject(getMediaPyNamedEntitiesTmpl(null, false)));
      } else if (!contentElementText.trim()) {
        namedEntities$ = this.promiseWrapper(HttpAdapterV6.getResolveObject(getMediaPyNamedEntitiesTmpl(null, false)));
      } else {
        namedEntities$ = this.mediaPyRequestsService.getDocumentEntities$(contentElementText, undefined);
      }
      namedEntities$.then(function (resp) {
        try {
          entitiesNamesData.status = resp.status;
          var data = resp.data;
          if (data.named_entities && Array.isArray(data.named_entities)) {
            entitiesNamesData.data = data.named_entities.map(mapEntityName);
          }
        } catch (error) {
          _this15.errorLogger(error);
        }
      })["catch"](function (error) {
        _this15.errorLogger(error.error);
        entitiesNamesData.status = error.status;
      })["finally"](function () {
        deferred.resolve(entitiesNamesData);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.getMediaPyCleanHtmlFromData$ = function getMediaPyCleanHtmlFromData$(data) {
    var _this16 = this;
    var deferred = this.$q.defer();
    try {
      var contentHtml$ = null;
      var cleanHtmlData = HttpAdapterV6.getResolveObject(getMediaPyCleanHtmlTmplt(null));
      if (!(this.USE_MEDIA_SEARCH_PY && this.mediaPyRequestsService && this.ENABLE_MEDIA_PY_CLEAN_HTML)) {
        contentHtml$ = this.promiseWrapper(cleanHtmlData);
      } else {
        contentHtml$ = this.mediaPyRequestsService.cleanHtmlDocument$(data.html);
      }
      contentHtml$.then(function (resp) {
        cleanHtmlData = resp;
      })["catch"](function (error) {
        _this16.errorLogger(error.error);
        cleanHtmlData.status = error.status;
      })["finally"](function () {
        deferred.resolve(cleanHtmlData);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.getMediaPyMarkupHtmlFromData$ = function getMediaPyMarkupHtmlFromData$(data) {
    var _this17 = this;
    var deferred = this.$q.defer();
    try {
      var contentMarkupHtml$ = null;
      var markupHtmlData = HttpAdapterV6.getResolveObject({
        html: ""
      });
      if (!(this.USE_MEDIA_SEARCH_PY && this.mediaPyRequestsService && this.ENABLE_MEDIA_PY_MARKUP_HTML)) {
        contentMarkupHtml$ = this.promiseWrapper(HttpAdapterV6.getResolveObject({
          html: ""
        }));
      } else {
        contentMarkupHtml$ = this.mediaPyRequestsService.markupHtmlDocument$(data.html, data.text, {
          entity: {
            name: [data.personName]
          }
        }, data.language, data.mode, [], []);
      }
      contentMarkupHtml$.then(function (resp) {
        markupHtmlData = resp;
      })["catch"](function (error) {
        _this17.errorLogger(error.error);
        markupHtmlData.status = error.status;
      })["finally"](function () {
        deferred.resolve(markupHtmlData);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.getMediaPyWordCloudFromData$ = function getMediaPyWordCloudFromData$(wordCloudData) {
    var _this18 = this;
    var deferred = this.$q.defer();
    try {
      var textInfo$ = null;
      var textInfoData = HttpAdapterV6.getResolveObject({
        mediaPyRiskScore: 0,
        isMediaPyRiskScored: false,
        mediaPySentiment: 0,
        isMediaPySentimentLoaded: false,
        mediaPyTitleRiskScore: 0,
        mediaPyNameImportance: 0,
        img: null,
        language: null,
        keywords: [],
        risk_keywords: []
      });
      if (!(this.USE_MEDIA_SEARCH_PY && this.mediaPyRequestsService && this.ENABLE_MEDIA_PY_TEXT_INFO)) {
        textInfo$ = this.promiseWrapper(HttpAdapterV6.getResolveObject({
          risk: 0,
          isMediaPyRiskScored: true,
          sentiment: 0,
          isMediaPySentimentLoaded: true,
          title_risk: 0,
          name_importance: 0,
          word_cloud: null,
          language: null,
          keywords: [],
          risk_keywords: []
        }));
      } else {
        textInfo$ = this.mediaPyRequestsService.getDocumentInfo$(wordCloudData.title, wordCloudData.text, {
          entity: {
            name: [wordCloudData.personName]
          }
        }, wordCloudData.language, wordCloudData.width, wordCloudData.height, [], [], wordCloudData.mode);
      }
      textInfo$.then(function (resp) {
        try {
          textInfoData.status = resp.status;
          var data = resp.data;
          textInfoData.data.mediaPyRiskScore = data.risk || 0;
          textInfoData.data.isMediaPyRiskScored = data.isMediaPyRiskScored === undefined || data.isMediaPyRiskScored === null ? true : data.isMediaPyRiskScored;
          textInfoData.data.mediaPySentiment = data.sentiment || 0;
          textInfoData.data.isMediaPySentimentLoaded = data.isMediaPySentimentLoaded === undefined || data.isMediaPySentimentLoaded === null ? true : data.isMediaPySentimentLoaded;
          textInfoData.data.mediaPyTitleRiskScore = data.title_risk || 0;
          textInfoData.data.mediaPyNameImportance = data.name_importance || 0;
          textInfoData.data.img = data.word_cloud;
          textInfoData.data.language = data.language;
          textInfoData.data.keywords = data.keywords;
          textInfoData.data.risk_keywords = data.risk_keywords;
        } catch (error) {
          _this18.errorLogger(error);
        }
      })["catch"](function (error) {
        _this18.errorLogger(error.error);
        textInfoData.status = error.status;
        textInfoData.data.mediaPyRiskScore = 0;
        textInfoData.data.isMediaPyRiskScored = true;
        textInfoData.data.mediaPySentiment = 0;
        textInfoData.data.isMediaPySentimentLoaded = true;
        textInfoData.data.mediaPyTitleRiskScore = 0;
        textInfoData.data.mediaPyNameImportance = 0;
        textInfoData.data.img = null;
        textInfoData.data.language = null;
        textInfoData.data.keywords = [];
        textInfoData.data.risk_keywords = [];
      })["finally"](function () {
        deferred.resolve(textInfoData);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.initServices = function initServices(endpointsConfig) {
    this.mediaPyRequestsService = MediaPyRequestsServiceInstance.getNewService(this.$rootScope, this.$http, this.$q, this.$timeout);
    this.mediaPyRequestsService.setUrls(endpointsConfig);
    this.documentService = DocumentServiceInstance.getService();
    this.documentService.setUrls(endpointsConfig);
  };
  _proto.injectServices = function injectServices(mediaPyRequestsService, documentService) {
    this.mediaPyRequestsService = mediaPyRequestsService;
    this.documentService = documentService;
  };
  _proto.resetAdapter = function resetAdapter() {
    var _this$mediaPyRequests2;
    (_this$mediaPyRequests2 = this.mediaPyRequestsService) == null || _this$mediaPyRequests2.resetRouteWasChanged();
  };
  _proto.setTimeouts = function setTimeouts(timeouts) {
    var _this$mediaPyRequests3;
    (_this$mediaPyRequests3 = this.mediaPyRequestsService) == null || _this$mediaPyRequests3.setTimeouts(timeouts);
  };
  _proto.setAdapterConstants = function setAdapterConstants(constants) {
    if (constants) {
      this.USE_MEDIA_SEARCH_PY = constants.use_media_search_py;
      this.ENABLE_MEDIA_PY_CLEAN_HTML = constants.enable_media_py_clean_html;
      this.ENABLE_MEDIA_PY_NAMED_ENTITIES = constants.enable_media_py_named_entities;
      this.ENABLE_MEDIA_PY_ANALYZE_TEXT = constants.enable_media_py_analyze_text;
      this.ENABLE_MEDIA_PY_MARKUP_HTML = constants.enable_media_py_markup_html;
      this.ENABLE_MEDIA_PY_TEXT_INFO = constants.enable_media_py_text_info;
      this.ENABLE_MEDIA_PY_SUMMARIZE_TEXT = constants.enable_media_py_summarize_text;
      this.ENABLE_MEDIA_PY_SUMMARIZE_PERSON = constants.enable_media_py_summarize_person;
      this.ENABLE_MEDIA_PY_SPECIAL_PARSING = constants.enable_media_py_special_parsing;
      this.ENABLE_MEDIA_PY_CONNECTIONS_GRAPH = constants.enable_media_py_connections_graph;
    } else {
      this.USE_MEDIA_SEARCH_PY = true;
      this.ENABLE_MEDIA_PY_CLEAN_HTML = true;
      this.ENABLE_MEDIA_PY_NAMED_ENTITIES = true;
      this.ENABLE_MEDIA_PY_ANALYZE_TEXT = true;
      this.ENABLE_MEDIA_PY_MARKUP_HTML = true;
      this.ENABLE_MEDIA_PY_TEXT_INFO = true;
      this.ENABLE_MEDIA_PY_SUMMARIZE_TEXT = true;
      this.ENABLE_MEDIA_PY_SUMMARIZE_PERSON = true;
      this.ENABLE_MEDIA_PY_SPECIAL_PARSING = true;
      this.ENABLE_MEDIA_PY_CONNECTIONS_GRAPH = true;
    }
  };
  _proto.destroy = function destroy() {
    _HttpAdapterV.prototype.destroy.call(this);
    this.mediaPyRequestsService = null;
  };
  return MediaPyAdapterV8;
}(HttpAdapterV6);
module.exports = {
  MediaPyAdapterV8: MediaPyAdapterV8
};

},{"../../../common/utils/mappers-v4":694,"../../instances/services/http":790,"../../instances/services/utils":809,"../../templates/media-py-response-templates":889,"./http-adapter-v6":737}],740:[function(require,module,exports){
"use strict";

function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
var _require = require("./http-adapter-v6"),
  HttpAdapterV6 = _require.HttpAdapterV6;
var _require2 = require("../../templates/media-py-gpt-response-templates"),
  getMediaPyGptRiskAssesmentTmplt = _require2.getMediaPyGptRiskAssesmentTmplt,
  getMediaPyGptDocumentAnalysisTmplt = _require2.getMediaPyGptDocumentAnalysisTmplt,
  getMediaPyGptPersonSummaryTmplt = _require2.getMediaPyGptPersonSummaryTmplt,
  getMediaPyGptRelatedEntitiesTmplt = _require2.getMediaPyGptRelatedEntitiesTmplt,
  getMediaPyGptPersonMatchingTmplt = _require2.getMediaPyGptPersonMatchingTmplt,
  getMediaPyGptNegativeContextAnalysisTmplt = _require2.getMediaPyGptNegativeContextAnalysisTmplt,
  getMediaPyGptChainRiskAssesmentTmplt = _require2.getMediaPyGptChainRiskAssesmentTmplt,
  getMediaPyGptGeneralRiskAssesmentTmplt = _require2.getMediaPyGptGeneralRiskAssesmentTmplt,
  getMediaPyGptMostImportantEntitiesTmplt = _require2.getMediaPyGptMostImportantEntitiesTmplt,
  getMediaPyGptOverallPersonSummaryTmplt = _require2.getMediaPyGptOverallPersonSummaryTmplt,
  getMediaPyGptGeneralNegativeContextAnalysisTmplt = _require2.getMediaPyGptGeneralNegativeContextAnalysisTmplt,
  getMediaPyGptChainGeneralRiskAssessmentTmplt = _require2.getMediaPyGptChainGeneralRiskAssessmentTmplt,
  getMediaPyGptMostImportantKeywordsTmplt = _require2.getMediaPyGptMostImportantKeywordsTmplt,
  getMediaPyGptConnectionsGraphTmplt = _require2.getMediaPyGptConnectionsGraphTmplt,
  getMediaPyGptCheckIsPersonMatchTmplt = _require2.getMediaPyGptCheckIsPersonMatchTmplt;
var _require3 = require("../../../common/utils/mappers-v4"),
  mapConnectionGraphItem = _require3.mapConnectionGraphItem;
var _require4 = require("../../instances/services/http"),
  MediaPyGptRequestsServiceInstance = _require4.MediaPyGptRequestsServiceInstance;
var _require5 = require("../../instances/services/utils"),
  DocumentServiceInstance = _require5.DocumentServiceInstance;
var MediaPyGptAdapterV1 = function (_HttpAdapterV) {
  function MediaPyGptAdapterV1($rootScope, $http, $q, $timeout) {
    var _this;
    _this = _HttpAdapterV.call(this, $rootScope, $http, $q, $timeout) || this;
    _this.documentService = null;
    _this.mediaPyGptRequestsService = null;
    return _this;
  }
  _inheritsLoose(MediaPyGptAdapterV1, _HttpAdapterV);
  var _proto = MediaPyGptAdapterV1.prototype;
  _proto.sendMediaPyGptCheckIsPersonMatchRequest$ = function sendMediaPyGptCheckIsPersonMatchRequest$(searchResult) {
    var _this2 = this;
    var deferred = this.$q.defer();
    try {
      var request$ = null;
      var responseData = HttpAdapterV6.getResolveObject(getMediaPyGptCheckIsPersonMatchTmplt());
      if (!(this.USE_MEDIA_SEARCH_GPT && this.mediaPyGptRequestsService && this.ENABLE_MEDIA_PY_GPT_CHECK_IS_PERSON_MATCH)) {
        request$ = this.promiseWrapper(responseData);
      } else if (!searchResult.checkIsContentHtmlLoaded()) {
        request$ = this.promiseWrapper(responseData);
      } else {
        var text = searchResult.getExtendedSummary();
        if (!text) {
          text = searchResult.getContentElementText() || "";
        }
        request$ = this.mediaPyGptRequestsService.sendCheckIsPersonMatchRequest$(text, searchResult.getPersonFullName());
      }
      request$.then(function (resp) {
        responseData = resp;
      })["catch"](function (error) {
        _this2.errorLogger(error.error);
        responseData.status = error.status;
      })["finally"](function () {
        deferred.resolve(responseData);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.sendMediaPyGptRiskAssesmentRequest$ = function sendMediaPyGptRiskAssesmentRequest$(searchResult) {
    var _this3 = this;
    var deferred = this.$q.defer();
    try {
      var request$ = null;
      var responseData = HttpAdapterV6.getResolveObject(getMediaPyGptRiskAssesmentTmplt(null));
      if (!(this.USE_MEDIA_SEARCH_GPT && this.mediaPyGptRequestsService && this.ENABLE_MEDIA_GPT_RISK_ASSESMENT)) {
        request$ = this.promiseWrapper(responseData);
      } else if (searchResult.getGptRiskScore() && searchResult.getGptRiskExplanation()) {
        request$ = this.promiseWrapper(HttpAdapterV6.getResolveObject(getMediaPyGptRiskAssesmentTmplt(searchResult)));
      } else if (!searchResult.checkIsContentHtmlLoaded()) {
        request$ = this.promiseWrapper(responseData);
      } else {
        request$ = this.mediaPyGptRequestsService.sendRiskAssesmentRequest$(searchResult.getContentElementText() || "", searchResult.getPersonFullName());
      }
      request$.then(function (resp) {
        responseData = resp;
      })["catch"](function (error) {
        _this3.errorLogger(error.error);
        responseData.status = error.status;
      })["finally"](function () {
        deferred.resolve(responseData);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.sendMediaPyGptDocumentAnalysisRequest$ = function sendMediaPyGptDocumentAnalysisRequest$(searchResult) {
    var _this4 = this;
    var deferred = this.$q.defer();
    try {
      var request$ = null;
      var responseData = HttpAdapterV6.getResolveObject(getMediaPyGptDocumentAnalysisTmplt(null));
      if (!(this.USE_MEDIA_SEARCH_GPT && this.mediaPyGptRequestsService && this.ENABLE_MEDIA_GPT_DOCUMENT_ANALYSIS)) {
        request$ = this.promiseWrapper(responseData);
      } else if (searchResult.getGptDocAnalysSummary() && searchResult.getGptDocAnalysTopic()) {
        request$ = this.promiseWrapper(HttpAdapterV6.getResolveObject(getMediaPyGptDocumentAnalysisTmplt(searchResult)));
      } else if (!searchResult.checkIsContentHtmlLoaded()) {
        request$ = this.promiseWrapper(responseData);
      } else {
        request$ = this.mediaPyGptRequestsService.sendDocumentAnalysisRequest$(searchResult.getContentElementText() || "");
      }
      request$.then(function (resp) {
        responseData = resp;
      })["catch"](function (error) {
        _this4.errorLogger(error.error);
        responseData.status = error.status;
      })["finally"](function () {
        deferred.resolve(responseData);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.sendMediaPyGptPersonSummaryRequest$ = function sendMediaPyGptPersonSummaryRequest$(searchResult) {
    var _this5 = this;
    var deferred = this.$q.defer();
    try {
      var request$ = null;
      var responseData = HttpAdapterV6.getResolveObject(getMediaPyGptPersonSummaryTmplt(null));
      if (!(this.USE_MEDIA_SEARCH_GPT && this.mediaPyGptRequestsService && this.ENABLE_MEDIA_GPT_PERSON_SUMMARY)) {
        request$ = this.promiseWrapper(responseData);
      } else if (searchResult.getGptPersSumSummary() && searchResult.getGptPersSumDetails()) {
        request$ = this.promiseWrapper(HttpAdapterV6.getResolveObject(getMediaPyGptPersonSummaryTmplt(searchResult)));
      } else if (!searchResult.checkIsContentHtmlLoaded()) {
        request$ = this.promiseWrapper(responseData);
      } else {
        request$ = this.mediaPyGptRequestsService.sendPersonSummaryRequest$(searchResult.getContentElementText() || "", searchResult.getPersonFullName());
      }
      request$.then(function (resp) {
        responseData = resp;
      })["catch"](function (error) {
        _this5.errorLogger(error.error);
        responseData.status = error.status;
      })["finally"](function () {
        deferred.resolve(responseData);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.sendMediaPyGptRelatedEntitiesRequest$ = function sendMediaPyGptRelatedEntitiesRequest$(searchResult) {
    var _this6 = this;
    var deferred = this.$q.defer();
    try {
      var request$ = null;
      var responseData = HttpAdapterV6.getResolveObject(getMediaPyGptRelatedEntitiesTmplt(null));
      if (!(this.USE_MEDIA_SEARCH_GPT && this.mediaPyGptRequestsService && this.ENABLE_MEDIA_GPT_RELATED_ENTITIES)) {
        request$ = this.promiseWrapper(responseData);
      } else if (searchResult.getGptRelatedPersons() && searchResult.getGptRelatedPersons().length && searchResult.getGptRelatedOrganizations() && searchResult.getGptRelatedOrganizations().length) {
        request$ = this.promiseWrapper(HttpAdapterV6.getResolveObject(getMediaPyGptRelatedEntitiesTmplt(searchResult)));
      } else if (!searchResult.checkIsContentHtmlLoaded()) {
        request$ = this.promiseWrapper(responseData);
      } else {
        request$ = this.mediaPyGptRequestsService.sendRelatedEntitiesRequest$(searchResult.getContentElementText() || "");
      }
      request$.then(function (resp) {
        responseData = resp;
      })["catch"](function (error) {
        _this6.errorLogger(error.error);
        responseData.status = error.status;
      })["finally"](function () {
        deferred.resolve(responseData);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.sendMediaPyGptPersonMatchingRequest$ = function sendMediaPyGptPersonMatchingRequest$(searchResult, personOverallSummary) {
    var _this7 = this;
    var deferred = this.$q.defer();
    try {
      var request$ = null;
      var responseData = HttpAdapterV6.getResolveObject(getMediaPyGptPersonMatchingTmplt(null));
      if (!(this.USE_MEDIA_SEARCH_GPT && this.mediaPyGptRequestsService && this.ENABLE_MEDIA_GPT_PERSON_MATCHING)) {
        request$ = this.promiseWrapper(responseData);
      } else if (searchResult.getGptPersonIsMatch()) {
        request$ = this.promiseWrapper(HttpAdapterV6.getResolveObject(getMediaPyGptPersonMatchingTmplt(searchResult)));
      } else if (!searchResult.checkIsContentHtmlLoaded()) {
        request$ = this.promiseWrapper(responseData);
      } else {
        request$ = this.mediaPyGptRequestsService.sendPersonMatchingRequest$(personOverallSummary, searchResult.getGptPersSumSummary());
      }
      request$.then(function (resp) {
        responseData = resp;
      })["catch"](function (error) {
        _this7.errorLogger(error.error);
        responseData.status = error.status;
      })["finally"](function () {
        deferred.resolve(responseData);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.sendMediaPyGptNegativeContextAnalysisRequest$ = function sendMediaPyGptNegativeContextAnalysisRequest$(searchResult) {
    var _this8 = this;
    var deferred = this.$q.defer();
    try {
      var request$ = null;
      var responseData = HttpAdapterV6.getResolveObject(getMediaPyGptNegativeContextAnalysisTmplt(null));
      if (!(this.USE_MEDIA_SEARCH_GPT && this.mediaPyGptRequestsService && this.ENABLE_MEDIA_GPT_NEGATIVE_CONTEXT_ANALYSIS)) {
        request$ = this.promiseWrapper(responseData);
      } else if (searchResult.getGptAllegations() && searchResult.getGptAllegations().length && searchResult.getGptEvidence() && searchResult.getGptEvidence().length) {
        request$ = this.promiseWrapper(HttpAdapterV6.getResolveObject(getMediaPyGptNegativeContextAnalysisTmplt(searchResult)));
      } else if (!searchResult.checkIsContentHtmlLoaded()) {
        request$ = this.promiseWrapper(responseData);
      } else {
        request$ = this.mediaPyGptRequestsService.sendNegativeContextAnalysisRequest$(searchResult.getContentElementText() || "", searchResult.getPersonFullName());
      }
      request$.then(function (resp) {
        responseData = resp;
      })["catch"](function (error) {
        _this8.errorLogger(error.error);
        responseData.status = error.status;
      })["finally"](function () {
        deferred.resolve(responseData);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.sendMediaPyGptChainRiskAssessmentRequest$ = function sendMediaPyGptChainRiskAssessmentRequest$(searchResult) {
    var _this9 = this;
    var deferred = this.$q.defer();
    try {
      var request$ = null;
      var responseData = HttpAdapterV6.getResolveObject(getMediaPyGptChainRiskAssesmentTmplt(null));
      if (!(this.USE_MEDIA_SEARCH_GPT && this.mediaPyGptRequestsService && this.ENABLE_MEDIA_GPT_CHAIN_RISK_ASSESSMENT)) {
        request$ = this.promiseWrapper(responseData);
      } else if (searchResult.getGptAllegations() && searchResult.getGptAllegations().length && searchResult.getGptEvidence() && searchResult.getGptEvidence().length && searchResult.getGptRiskScore() && searchResult.getGptRiskExplanation()) {
        request$ = this.promiseWrapper(HttpAdapterV6.getResolveObject(getMediaPyGptChainRiskAssesmentTmplt(searchResult)));
      } else if (!searchResult.checkIsContentHtmlLoaded()) {
        request$ = this.promiseWrapper(responseData);
      } else {
        request$ = this.mediaPyGptRequestsService.sendChainRiskAssessmentRequest$(searchResult.getContentElementText() || "", searchResult.getPersonFullName());
      }
      request$.then(function (resp) {
        responseData = resp;
      })["catch"](function (error) {
        _this9.errorLogger(error.error);
        responseData.status = error.status;
      })["finally"](function () {
        deferred.resolve(responseData);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.sendMediaPyGptGeneralRiskAssesmentsRequest$ = function sendMediaPyGptGeneralRiskAssesmentsRequest$(person) {
    var _this10 = this;
    var deferred = this.$q.defer();
    try {
      var request$ = null;
      var responseData = HttpAdapterV6.getResolveObject(getMediaPyGptGeneralRiskAssesmentTmplt(null));
      if (!(this.USE_MEDIA_SEARCH_GPT && this.mediaPyGptRequestsService && this.ENABLE_MEDIA_GPT_GENERAL_RISK_ASSESMENT)) {
        request$ = this.promiseWrapper(responseData);
      } else if (person.getGptRiskScore() && person.getGptRiskExplanation()) {
        request$ = this.promiseWrapper(HttpAdapterV6.getResolveObject(getMediaPyGptGeneralRiskAssesmentTmplt(person)));
      } else if (!(person.getTotalResults() && person.getTotalResults().length)) {
        request$ = this.promiseWrapper(responseData);
      } else {
        var totalRiskAssesments = person.getTopGptRiskResults().map(function (searchResult) {
          return {
            score: searchResult.getGptRiskScore(),
            explanation: searchResult.getGptRiskExplanation()
          };
        });
        if (!totalRiskAssesments.length) {
          request$ = this.promiseWrapper(responseData);
        } else {
          request$ = this.mediaPyGptRequestsService.sendGeneralRiskAssesmentRequest$(totalRiskAssesments);
        }
      }
      request$.then(function (resp) {
        responseData = resp;
      })["catch"](function (error) {
        _this10.errorLogger(error.error);
        responseData.status = error.status;
      })["finally"](function () {
        deferred.resolve(responseData);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.sendMediaPyGptMostImportantEntitiesRequest$ = function sendMediaPyGptMostImportantEntitiesRequest$(person) {
    var _this11 = this;
    var deferred = this.$q.defer();
    try {
      var request$ = null;
      var responseData = HttpAdapterV6.getResolveObject(getMediaPyGptMostImportantEntitiesTmplt(null));
      if (!(this.USE_MEDIA_SEARCH_GPT && this.mediaPyGptRequestsService && this.ENABLE_MEDIA_GPT_MOST_IMPORTANT_ENTITIES)) {
        request$ = this.promiseWrapper(responseData);
      } else if (person.getGptMostImportantPersons() && person.getGptMostImportantPersons().length && person.getGptMostImportantOrganizations() && person.getGptMostImportantOrganizations().length) {
        request$ = this.promiseWrapper(HttpAdapterV6.getResolveObject(getMediaPyGptMostImportantEntitiesTmplt(person)));
      } else if (!(person.getTotalResults() && person.getTotalResults().length)) {
        request$ = this.promiseWrapper(responseData);
      } else {
        var topGptRiskResults = person.getTopGptRiskResults();
        var totalGptPersons = topGptRiskResults.map(function (searchResult) {
          return searchResult.getGptRelatedPersons();
        }).flat();
        var totalGptOrgs = topGptRiskResults.map(function (searchResult) {
          return searchResult.getGptRelatedOrganizations();
        }).flat();
        if (!totalGptPersons.length && !totalGptOrgs.length) {
          request$ = this.promiseWrapper(responseData);
        } else {
          request$ = this.mediaPyGptRequestsService.sendMostImportantEntitiesRequest$(totalGptPersons, totalGptOrgs);
        }
      }
      request$.then(function (resp) {
        responseData = resp;
      })["catch"](function (error) {
        _this11.errorLogger(error.error);
        responseData.status = error.status;
      })["finally"](function () {
        deferred.resolve(responseData);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.sendMediaPyGptOverallPersonSummaryRequest$ = function sendMediaPyGptOverallPersonSummaryRequest$(person) {
    var _this12 = this;
    var deferred = this.$q.defer();
    try {
      var request$ = null;
      var responseData = HttpAdapterV6.getResolveObject(getMediaPyGptOverallPersonSummaryTmplt(null));
      if (!(this.USE_MEDIA_SEARCH_GPT && this.mediaPyGptRequestsService && this.ENABLE_MEDIA_GPT_OVERALL_PERSON_SUMMARY)) {
        request$ = this.promiseWrapper(responseData);
      } else if (person.getGptOverallSummary()) {
        request$ = this.promiseWrapper(HttpAdapterV6.getResolveObject(getMediaPyGptOverallPersonSummaryTmplt(person)));
      } else if (!(person.getTotalResults() && person.getTotalResults().length)) {
        request$ = this.promiseWrapper(responseData);
      } else {
        var totalGptPersonSummaries = person.getTopGptRiskResults().map(function (searchResult) {
          return searchResult.getGptPersSumSummary();
        }).filter(function (summary) {
          return summary;
        });
        if (!totalGptPersonSummaries.length) {
          request$ = this.promiseWrapper(responseData);
        } else {
          request$ = this.mediaPyGptRequestsService.sendOverallPersonSummaryRequest$(totalGptPersonSummaries);
        }
      }
      request$.then(function (resp) {
        responseData = resp;
      })["catch"](function (error) {
        _this12.errorLogger(error.error);
        responseData.status = error.status;
      })["finally"](function () {
        deferred.resolve(responseData);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.sendMediaPyGptGeneralNegativeContextAnalysisRequest$ = function sendMediaPyGptGeneralNegativeContextAnalysisRequest$(person) {
    var _this13 = this;
    var deferred = this.$q.defer();
    try {
      var request$ = null;
      var responseData = HttpAdapterV6.getResolveObject(getMediaPyGptGeneralNegativeContextAnalysisTmplt(null));
      if (!(this.USE_MEDIA_SEARCH_GPT && this.mediaPyGptRequestsService && this.ENABLE_MEDIA_GPT_GENERAL_NEGATIVE_CONTEXT_ANALYSIS)) {
        request$ = this.promiseWrapper(responseData);
      } else if (person.getGptAllegations() && person.getGptAllegations().length && person.getGptEvidence() && person.getGptEvidence().length) {
        request$ = this.promiseWrapper(HttpAdapterV6.getResolveObject(getMediaPyGptGeneralNegativeContextAnalysisTmplt(person)));
      } else if (!(person.getTotalResults() && person.getTotalResults().length)) {
        request$ = this.promiseWrapper(responseData);
      } else {
        var totalGptAllegationsAndEvidence = person.getTopGptRiskResults().map(function (searchResult) {
          return {
            allegations: searchResult.getGptAllegations(),
            evidence: searchResult.getGptEvidence()
          };
        });
        if (!totalGptAllegationsAndEvidence.length) {
          request$ = this.promiseWrapper(responseData);
        } else {
          request$ = this.mediaPyGptRequestsService.sendGeneralNegativeContextAnalysisRequest$(totalGptAllegationsAndEvidence, person.getFullName());
        }
      }
      request$.then(function (resp) {
        responseData = resp;
      })["catch"](function (error) {
        _this13.errorLogger(error.error);
        responseData.status = error.status;
      })["finally"](function () {
        deferred.resolve(responseData);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.sendMediaPyGptChainGeneralRiskAssessmentRequest$ = function sendMediaPyGptChainGeneralRiskAssessmentRequest$(person) {
    var _this14 = this;
    var deferred = this.$q.defer();
    try {
      var request$ = null;
      var responseData = HttpAdapterV6.getResolveObject(getMediaPyGptChainGeneralRiskAssessmentTmplt(null));
      if (!(this.USE_MEDIA_SEARCH_GPT && this.mediaPyGptRequestsService && this.ENABLE_MEDIA_GPT_CHAIN_GENERAL_RISK_ASSESSMENT)) {
        request$ = this.promiseWrapper(responseData);
      } else if (person.getGptAllegations() && person.getGptAllegations().length && person.getGptEvidence() && person.getGptEvidence().length && person.getGptRiskScore() && person.getGptRiskExplanation()) {
        request$ = this.promiseWrapper(HttpAdapterV6.getResolveObject(getMediaPyGptChainGeneralRiskAssessmentTmplt(person)));
      } else if (!(person.getTotalResults() && person.getTotalResults().length)) {
        request$ = this.promiseWrapper(responseData);
      } else {
        var totalGptAllegationsAndEvidence = person.getTopGptRiskResults().map(function (searchResult) {
          return {
            allegations: searchResult.getGptAllegations(),
            evidence: searchResult.getGptEvidence(),
            score: searchResult.getGptRiskScore(),
            explanation: searchResult.getGptRiskExplanation()
          };
        });
        if (!totalGptAllegationsAndEvidence.length) {
          request$ = this.promiseWrapper(responseData);
        } else {
          request$ = this.mediaPyGptRequestsService.sendChainGeneralRiskAssessmentRequest$(totalGptAllegationsAndEvidence, person.getFullName());
        }
      }
      request$.then(function (resp) {
        responseData = resp;
      })["catch"](function (error) {
        _this14.errorLogger(error.error);
        responseData.status = error.status;
      })["finally"](function () {
        deferred.resolve(responseData);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.sendMediaPyGptMostImportantKeywordsRequest$ = function sendMediaPyGptMostImportantKeywordsRequest$(person) {
    var _this15 = this;
    var deferred = this.$q.defer();
    try {
      var request$ = null;
      var responseData = HttpAdapterV6.getResolveObject(getMediaPyGptMostImportantKeywordsTmplt(null));
      if (!(this.USE_MEDIA_SEARCH_GPT && this.mediaPyGptRequestsService && this.ENABLE_MEDIA_GPT_MOST_IMPORTANT_KEYWORDS)) {
        request$ = this.promiseWrapper(responseData);
      } else if (person.getGptMostImportantKeywords() && person.getGptMostImportantKeywords().length) {
        request$ = this.promiseWrapper(HttpAdapterV6.getResolveObject(getMediaPyGptMostImportantKeywordsTmplt(person)));
      } else if (!(person.getTotalResults() && person.getTotalResults().length)) {
        request$ = this.promiseWrapper(responseData);
      } else {
        var keywordsLists = person.getTopGptRiskResults().map(function (searchResult) {
          return searchResult.getGptDocAnalysKeywords();
        });
        if (!keywordsLists.length) {
          request$ = this.promiseWrapper(responseData);
        } else {
          request$ = this.mediaPyGptRequestsService.sendMostImportantKeywordsRequest$(keywordsLists, person.getFullName());
        }
      }
      request$.then(function (resp) {
        responseData = resp;
      })["catch"](function (error) {
        _this15.errorLogger(error.error);
        responseData.status = error.status;
      })["finally"](function () {
        deferred.resolve(responseData);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.sendMediaPyGptConnectionsGraphRequest$ = function sendMediaPyGptConnectionsGraphRequest$(graphSearchResults) {
    var _this16 = this;
    var deferred = this.$q.defer();
    try {
      var responseData = HttpAdapterV6.getResolveObject(getMediaPyGptConnectionsGraphTmplt());
      var connectionsGraph$ = null;
      if (!(this.USE_MEDIA_SEARCH_GPT && this.mediaPyGptRequestsService && this.ENABLE_MEDIA_GPT_CONNECTIONS_GRAPH)) {
        connectionsGraph$ = this.promiseWrapper(responseData);
      } else if (!graphSearchResults || !graphSearchResults.length) {
        connectionsGraph$ = this.promiseWrapper(responseData);
      } else {
        var articles = graphSearchResults.map(function (searchResult) {
          return {
            text: searchResult.getContentElementText(),
            named_entities: [].concat(searchResult.getMentionedPersons()).concat(searchResult.getMentionedOrgs()).concat(searchResult.getMentionedLocs()).concat(searchResult.getAnalyzeRiskPersons()).concat(searchResult.getAnalyzeRiskOrgs()).map(mapConnectionGraphItem)
          };
        });
        var mainEntity = graphSearchResults[0].getExtendedPersonInfo();
        connectionsGraph$ = this.mediaPyGptRequestsService.sendConnectionsGraphRequest$(articles, mainEntity && mainEntity.entity && mainEntity.entity.name ? Array.isArray(mainEntity.entity.name) ? mainEntity.entity.name[0] || "" : mainEntity.entity.name : "");
      }
      connectionsGraph$.then(function (resp) {
        responseData = resp;
      })["catch"](function (error) {
        _this16.errorLogger(error.error);
        responseData.status = error.status;
      })["finally"](function () {
        deferred.resolve(responseData);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.initServices = function initServices(endpointsConfig) {
    this.mediaPyGptRequestsService = MediaPyGptRequestsServiceInstance.getNewService(this.$rootScope, this.$http, this.$q, this.$timeout);
    this.mediaPyGptRequestsService.setUrls(endpointsConfig);
    this.documentService = DocumentServiceInstance.getService();
    this.documentService.setUrls(endpointsConfig);
  };
  _proto.injectServices = function injectServices(mediaPyGptRequestsService, documentService) {
    this.mediaPyGptRequestsService = mediaPyGptRequestsService;
    this.documentService = documentService;
  };
  _proto.resetAdapter = function resetAdapter() {
    var _this$mediaPyGptReque;
    (_this$mediaPyGptReque = this.mediaPyGptRequestsService) == null || _this$mediaPyGptReque.resetRouteWasChanged();
  };
  _proto.setTimeouts = function setTimeouts(timeouts) {
    var _this$mediaPyGptReque2;
    (_this$mediaPyGptReque2 = this.mediaPyGptRequestsService) == null || _this$mediaPyGptReque2.setTimeouts(timeouts);
  };
  _proto.setAdapterConstants = function setAdapterConstants(constants) {
    if (constants) {
      this.USE_MEDIA_SEARCH_GPT = constants.use_media_search_gpt;
      this.ENABLE_MEDIA_PY_GPT_CHECK_IS_PERSON_MATCH = constants.enable_check_is_person_match;
      this.ENABLE_MEDIA_GPT_RISK_ASSESMENT = constants.enable_risk_assessment;
      this.ENABLE_MEDIA_GPT_DOCUMENT_ANALYSIS = constants.enable_document_analysis;
      this.ENABLE_MEDIA_GPT_DOCUMENT_COMPRESSION = constants.enable_document_compression;
      this.ENABLE_MEDIA_GPT_PERSON_SUMMARY = constants.enable_person_summary;
      this.ENABLE_MEDIA_GPT_RELATED_ENTITIES = constants.enable_related_persons_and_organizations;
      this.ENABLE_MEDIA_GPT_PERSON_MATCHING = constants.enable_person_matching;
      this.ENABLE_MEDIA_GPT_NEGATIVE_CONTEXT_ANALYSIS = constants.enable_negative_context_analysis;
      this.ENABLE_MEDIA_GPT_CHAIN_RISK_ASSESSMENT = constants.enable_chain_risk_assessment;
      this.ENABLE_MEDIA_GPT_GENERAL_RISK_ASSESMENT = constants.enable_general_risk_assessment;
      this.ENABLE_MEDIA_GPT_MOST_IMPORTANT_ENTITIES = constants.enable_most_important_persons_and_organizations;
      this.ENABLE_MEDIA_GPT_OVERALL_PERSON_SUMMARY = constants.enable_overall_person_summary;
      this.ENABLE_MEDIA_GPT_GENERAL_NEGATIVE_CONTEXT_ANALYSIS = constants.enable_general_negative_context_analysis;
      this.ENABLE_MEDIA_GPT_CHAIN_GENERAL_RISK_ASSESSMENT = constants.enable_chain_general_risk_assessment;
      this.ENABLE_MEDIA_GPT_MOST_IMPORTANT_KEYWORDS = constants.enable_most_important_keywords;
      this.ENABLE_MEDIA_GPT_CONNECTIONS_GRAPH = constants.enable_connections_graph;
    } else {
      this.USE_MEDIA_SEARCH_GPT = true;
      this.ENABLE_MEDIA_PY_GPT_CHECK_IS_PERSON_MATCH = true;
      this.ENABLE_MEDIA_GPT_RISK_ASSESMENT = true;
      this.ENABLE_MEDIA_GPT_DOCUMENT_ANALYSIS = true;
      this.ENABLE_MEDIA_GPT_DOCUMENT_COMPRESSION = true;
      this.ENABLE_MEDIA_GPT_PERSON_SUMMARY = true;
      this.ENABLE_MEDIA_GPT_RELATED_ENTITIES = true;
      this.ENABLE_MEDIA_GPT_PERSON_MATCHING = true;
      this.ENABLE_MEDIA_GPT_NEGATIVE_CONTEXT_ANALYSIS = true;
      this.ENABLE_MEDIA_GPT_CHAIN_RISK_ASSESSMENT = true;
      this.ENABLE_MEDIA_GPT_GENERAL_RISK_ASSESMENT = true;
      this.ENABLE_MEDIA_GPT_MOST_IMPORTANT_ENTITIES = true;
      this.ENABLE_MEDIA_GPT_OVERALL_PERSON_SUMMARY = true;
      this.ENABLE_MEDIA_GPT_GENERAL_NEGATIVE_CONTEXT_ANALYSIS = true;
      this.ENABLE_MEDIA_GPT_CHAIN_GENERAL_RISK_ASSESSMENT = true;
      this.ENABLE_MEDIA_GPT_MOST_IMPORTANT_KEYWORDS = true;
      this.ENABLE_MEDIA_GPT_CONNECTIONS_GRAPH = true;
    }
  };
  _proto.destroy = function destroy() {
    _HttpAdapterV.prototype.destroy.call(this);
    this.mediaPyGptRequestsService = null;
  };
  return MediaPyGptAdapterV1;
}(HttpAdapterV6);
module.exports = {
  MediaPyGptAdapterV1: MediaPyGptAdapterV1
};

},{"../../../common/utils/mappers-v4":694,"../../instances/services/http":790,"../../instances/services/utils":809,"../../templates/media-py-gpt-response-templates":887,"./http-adapter-v6":737}],741:[function(require,module,exports){
"use strict";

function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
var _require = require("./http-adapter-v6"),
  HttpAdapterV6 = _require.HttpAdapterV6;
var _require2 = require("../../templates/media-py-llm-response-templates"),
  getMediaPyLLMTextAnalysisTmplt = _require2.getMediaPyLLMTextAnalysisTmplt,
  getMediaPyLLMPersonProfilingTmplt = _require2.getMediaPyLLMPersonProfilingTmplt,
  getMediaPyLLMAllegationsProfilingTmplt = _require2.getMediaPyLLMAllegationsProfilingTmplt;
var _require3 = require("../../instances/services/http"),
  MediaPyLLMRequestsServiceInstance = _require3.MediaPyLLMRequestsServiceInstance;
var _require4 = require("../../instances/services/utils"),
  DocumentServiceInstance = _require4.DocumentServiceInstance;
var MediaPyLLMAdapterV1 = function (_HttpAdapterV) {
  function MediaPyLLMAdapterV1($rootScope, $http, $q, $timeout) {
    var _this;
    _this = _HttpAdapterV.call(this, $rootScope, $http, $q, $timeout) || this;
    _this.documentService = null;
    _this.mediaPyLLMRequestsService = null;
    return _this;
  }
  _inheritsLoose(MediaPyLLMAdapterV1, _HttpAdapterV);
  var _proto = MediaPyLLMAdapterV1.prototype;
  _proto.sendMediaPyLLMTextAnalysisRequest$ = function sendMediaPyLLMTextAnalysisRequest$(searchResult) {
    var _this2 = this;
    var deferred = this.$q.defer();
    try {
      var request$ = null;
      var responseData = HttpAdapterV6.getResolveObject(getMediaPyLLMTextAnalysisTmplt(null));
      if (!(this.USE_MEDIA_PY_LLM && this.mediaPyLLMRequestsService && this.ENABLE_MEDIA_PY_LLM_TEXT_ANALYSIS)) {
        request$ = this.promiseWrapper(responseData);
      } else if (searchResult.getLLMSummary() && searchResult.getLLMShortSummary() && searchResult.getLLMPersonSummary() && searchResult.getLLMMentionedPersons() && searchResult.getLLMMentionedPersons().length && searchResult.getLLMMentionedOrgs() && searchResult.getLLMMentionedOrgs().length && searchResult.getLLMKeywords() && searchResult.getLLMKeywords().length && searchResult.getLLMSentiment() && searchResult.getLLMRiskExplanation()) {
        request$ = this.promiseWrapper(HttpAdapterV6.getResolveObject(getMediaPyLLMTextAnalysisTmplt(searchResult)));
      } else if (!searchResult.checkIsContentHtmlLoaded()) {
        request$ = this.promiseWrapper(responseData);
      } else {
        request$ = this.mediaPyLLMRequestsService.sendTextAnalysisRequest$(searchResult.getContentElementText() || "", searchResult.getPersonFullName());
      }
      request$.then(function (resp) {
        responseData = resp;
      })["catch"](function (error) {
        _this2.errorLogger(error.error);
        responseData.status = error.status;
      })["finally"](function () {
        deferred.resolve(responseData);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.sendMediaPyLLMPersonProfilingRequest$ = function sendMediaPyLLMPersonProfilingRequest$(person) {
    var _this3 = this;
    var deferred = this.$q.defer();
    try {
      var request$ = null;
      var responseData = HttpAdapterV6.getResolveObject(getMediaPyLLMPersonProfilingTmplt(null));
      if (!(this.USE_MEDIA_PY_LLM && this.mediaPyLLMRequestsService && this.ENABLE_MEDIA_PY_LLM_PERSON_PROFILING)) {
        request$ = this.promiseWrapper(responseData);
      } else if (person.getLLMOccupation() && person.getLLMAge() && person.getLLMLocation() && person.getLLMOtherDetails()) {
        request$ = this.promiseWrapper(HttpAdapterV6.getResolveObject(getMediaPyLLMPersonProfilingTmplt(person)));
      } else if (!(person.getTotalResults() && person.getTotalResults().length)) {
        request$ = this.promiseWrapper(responseData);
      } else {
        var totalLLMPersonSummaries = person.getTotalResults().filter(function (searchResult) {
          return searchResult.checkIsFromSearchEngine() || searchResult.checkIsFromGoogleNewsRss() || searchResult.checkIsFromExtraSource() || searchResult.checkIsFromStockMarket();
        }).map(function (searchResult) {
          return searchResult.getLLMPersonSummary();
        }).filter(function (summary) {
          return summary;
        });
        if (!totalLLMPersonSummaries.length) {
          request$ = this.promiseWrapper(responseData);
        } else {
          request$ = this.mediaPyLLMRequestsService.sendPersonProfilingRequest$(totalLLMPersonSummaries, person.getFullName());
        }
      }
      request$.then(function (resp) {
        responseData = resp;
      })["catch"](function (error) {
        _this3.errorLogger(error.error);
        responseData.status = error.status;
      })["finally"](function () {
        deferred.resolve(responseData);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.sendMediaPyLLMAllegationsProfilingRequest$ = function sendMediaPyLLMAllegationsProfilingRequest$(person) {
    var _this4 = this;
    var deferred = this.$q.defer();
    try {
      var request$ = null;
      var responseData = HttpAdapterV6.getResolveObject(getMediaPyLLMAllegationsProfilingTmplt(null));
      if (!(this.USE_MEDIA_PY_LLM && this.mediaPyLLMRequestsService && this.ENABLE_MEDIA_PY_LLM_ALLEGATIONS_PROFILING)) {
        request$ = this.promiseWrapper(responseData);
      } else if (person.getLLMSummary() && person.getLLMEvidence() && person.getLLMRisks() && person.getLLMConclusion()) {
        request$ = this.promiseWrapper(HttpAdapterV6.getResolveObject(getMediaPyLLMAllegationsProfilingTmplt(person)));
      } else if (!(person.getTotalResults() && person.getTotalResults().length)) {
        request$ = this.promiseWrapper(responseData);
      } else {
        var totalLLMRiskExplanations = person.getTotalResults().filter(function (searchResult) {
          return searchResult.checkIsFromSearchEngine() || searchResult.checkIsFromGoogleNewsRss() || searchResult.checkIsFromExtraSource() || searchResult.checkIsFromStockMarket();
        }).map(function (searchResult) {
          return searchResult.getLLMRiskExplanation();
        }).filter(function (riskExplanation) {
          return riskExplanation;
        });
        if (!totalLLMRiskExplanations.length) {
          request$ = this.promiseWrapper(responseData);
        } else {
          request$ = this.mediaPyLLMRequestsService.sendAllegationsProfilingRequest$(totalLLMRiskExplanations, person.getFullName());
        }
      }
      request$.then(function (resp) {
        responseData = resp;
      })["catch"](function (error) {
        _this4.errorLogger(error.error);
        responseData.status = error.status;
      })["finally"](function () {
        deferred.resolve(responseData);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.initServices = function initServices(endpointsConfig) {
    this.mediaPyLLMRequestsService = MediaPyLLMRequestsServiceInstance.getNewService(this.$rootScope, this.$http, this.$q, this.$timeout);
    this.mediaPyLLMRequestsService.setUrls(endpointsConfig);
    this.documentService = DocumentServiceInstance.getService();
    this.documentService.setUrls(endpointsConfig);
  };
  _proto.injectServices = function injectServices(mediaPyLLMRequestsService, documentService) {
    this.mediaPyLLMRequestsService = mediaPyLLMRequestsService;
    this.documentService = documentService;
  };
  _proto.resetAdapter = function resetAdapter() {
    var _this$mediaPyLLMReque;
    (_this$mediaPyLLMReque = this.mediaPyLLMRequestsService) == null || _this$mediaPyLLMReque.resetRouteWasChanged();
  };
  _proto.setTimeouts = function setTimeouts(timeouts) {
    var _this$mediaPyLLMReque2;
    (_this$mediaPyLLMReque2 = this.mediaPyLLMRequestsService) == null || _this$mediaPyLLMReque2.setTimeouts(timeouts);
  };
  _proto.setAdapterConstants = function setAdapterConstants(constants) {
    if (constants) {
      this.USE_MEDIA_PY_LLM = constants.use_media_py_llm;
      this.ENABLE_MEDIA_PY_LLM_TEXT_ANALYSIS = constants.enable_media_py_llm_text_analysis;
      this.ENABLE_MEDIA_PY_LLM_PERSON_PROFILING = constants.enable_media_py_llm_person_profiling;
      this.ENABLE_MEDIA_PY_LLM_ALLEGATIONS_PROFILING = constants.enable_media_py_llm_allegations_profiling;
    } else {
      this.USE_MEDIA_PY_LLM = true;
      this.ENABLE_MEDIA_PY_LLM_TEXT_ANALYSIS = true;
      this.ENABLE_MEDIA_PY_LLM_PERSON_PROFILING = true;
      this.ENABLE_MEDIA_PY_LLM_ALLEGATIONS_PROFILING = true;
    }
  };
  _proto.destroy = function destroy() {
    _HttpAdapterV.prototype.destroy.call(this);
    this.mediaPyLLMRequestsService = null;
  };
  return MediaPyLLMAdapterV1;
}(HttpAdapterV6);
module.exports = {
  MediaPyLLMAdapterV1: MediaPyLLMAdapterV1
};

},{"../../instances/services/http":790,"../../instances/services/utils":809,"../../templates/media-py-llm-response-templates":888,"./http-adapter-v6":737}],742:[function(require,module,exports){
"use strict";

function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
var _require = require("./http-adapter-v6"),
  HttpAdapterV6 = _require.HttpAdapterV6;
var _require2 = require("../../instances/services/http"),
  ParseDocumentRequestsServiceInstance = _require2.ParseDocumentRequestsServiceInstance;
var ParseDocumentAdapterV6 = function (_HttpAdapterV) {
  function ParseDocumentAdapterV6($rootScope, $http, $q, $timeout) {
    var _this;
    _this = _HttpAdapterV.call(this, $rootScope, $http, $q, $timeout) || this;
    _this.parseDocumentRequestsService = null;
    return _this;
  }
  _inheritsLoose(ParseDocumentAdapterV6, _HttpAdapterV);
  var _proto = ParseDocumentAdapterV6.prototype;
  _proto.getParsedDocumentInfo$ = function getParsedDocumentInfo$(formData) {
    var deferred = this.$q.defer();
    try {
      var _this$parseDocumentRe;
      (_this$parseDocumentRe = this.parseDocumentRequestsService) == null || _this$parseDocumentRe.getParsedDocumentInfo$(formData).then(function (data) {
        deferred.resolve(data);
      })["catch"](function (error) {
        deferred.reject(error);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.getParsedBinaryDocumentInfo$ = function getParsedBinaryDocumentInfo$(fileBlob, fileName) {
    var deferred = this.$q.defer();
    try {
      var _this$parseDocumentRe2;
      (_this$parseDocumentRe2 = this.parseDocumentRequestsService) == null || _this$parseDocumentRe2.getParsedBinaryDocumentInfo$(fileBlob, fileName).then(function (data) {
        deferred.resolve(data);
      })["catch"](function (error) {
        deferred.reject(error);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.initServices = function initServices(endpointsConfig) {
    this.parseDocumentRequestsService = ParseDocumentRequestsServiceInstance.getNewService(this.$rootScope, this.$http, this.$q, this.$timeout);
    this.parseDocumentRequestsService.setUrls(endpointsConfig);
  };
  _proto.injectServices = function injectServices(parseDocumentRequestsService) {
    this.parseDocumentRequestsService = parseDocumentRequestsService;
  };
  _proto.resetAdapter = function resetAdapter() {
    var _this$parseDocumentRe3;
    (_this$parseDocumentRe3 = this.parseDocumentRequestsService) == null || _this$parseDocumentRe3.resetRouteWasChanged();
  };
  _proto.setTimeouts = function setTimeouts(timeouts) {
    var _this$parseDocumentRe4;
    (_this$parseDocumentRe4 = this.parseDocumentRequestsService) == null || _this$parseDocumentRe4.setTimeouts(timeouts);
  };
  _proto.destroy = function destroy() {
    _HttpAdapterV.prototype.destroy.call(this);
    this.parseDocumentRequestsService = null;
  };
  return ParseDocumentAdapterV6;
}(HttpAdapterV6);
module.exports = {
  ParseDocumentAdapterV6: ParseDocumentAdapterV6
};

},{"../../instances/services/http":790,"./http-adapter-v6":737}],743:[function(require,module,exports){
"use strict";

function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
var _require = require("./http-adapter-v6"),
  HttpAdapterV6 = _require.HttpAdapterV6;
var _require2 = require("../../templates/scrape-response-tmplt"),
  getScrapeTmplt = _require2.getScrapeTmplt;
var _require3 = require("../../instances/services/http/scrape-requests-service"),
  ScrapeRequestsServiceInstance = _require3.ScrapeRequestsServiceInstance;
var ScrapeAdapterV6 = function (_HttpAdapterV) {
  function ScrapeAdapterV6($rootScope, $http, $q, $timeout) {
    var _this;
    _this = _HttpAdapterV.call(this, $rootScope, $http, $q, $timeout) || this;
    _this.scrapeRequestsService = null;
    return _this;
  }
  _inheritsLoose(ScrapeAdapterV6, _HttpAdapterV);
  var _proto = ScrapeAdapterV6.prototype;
  _proto.getDocumentHtml$ = function getDocumentHtml$(searchResult) {
    var _this2 = this;
    var deferred = this.$q.defer();
    try {
      var contentHtmlPromise$ = null;
      var resultData = HttpAdapterV6.getResolveObject(getScrapeTmplt(null));
      if (searchResult.checkIsContentHtmlLoaded()) {
        contentHtmlPromise$ = this.promiseWrapper(HttpAdapterV6.getResolveObject(getScrapeTmplt(searchResult)));
      } else {
        var _this$scrapeRequestsS;
        contentHtmlPromise$ = (_this$scrapeRequestsS = this.scrapeRequestsService) == null ? void 0 : _this$scrapeRequestsS.getDocument$(searchResult.getLinkUrl(), false);
      }
      contentHtmlPromise$.then(function (resp) {
        deferred.resolve(resp);
      })["catch"](function () {
        var _this2$scrapeRequests;
        (_this2$scrapeRequests = _this2.scrapeRequestsService) == null || _this2$scrapeRequests.getDocument$(searchResult.getLinkUrl(), true).then(function (resp) {
          resultData = resp;
        })["catch"](function (error) {
          _this2.errorLogger(error.error);
          resultData.status = error.status;
          resultData.data.data = undefined;
          resultData.data.linkUrl = searchResult.getLinkUrl();
        })["finally"](function () {
          deferred.resolve(resultData);
        });
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.getExtraSourceDocumentHtml$ = function getExtraSourceDocumentHtml$(searchResult) {
    var _this3 = this;
    var deferred = this.$q.defer();
    try {
      var contentHtml$ = null;
      var resultData = HttpAdapterV6.getResolveObject(getScrapeTmplt(null));
      if (searchResult.checkIsContentHtmlLoaded()) {
        contentHtml$ = this.promiseWrapper(HttpAdapterV6.getResolveObject(getScrapeTmplt(searchResult)));
      } else {
        var _this$scrapeRequestsS2;
        contentHtml$ = (_this$scrapeRequestsS2 = this.scrapeRequestsService) == null ? void 0 : _this$scrapeRequestsS2.getExtraSourceDocument$(searchResult.getLinkUrl());
      }
      contentHtml$.then(function (resp) {
        resultData = resp;
      })["catch"](function (error) {
        _this3.errorLogger(error.error);
        resultData.status = error.status;
        resultData.data.data = undefined;
        resultData.data.linkUrl = searchResult.getLinkUrl();
      })["finally"](function () {
        deferred.resolve(resultData);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.getAlephOccrpDocumentHtml$ = function getAlephOccrpDocumentHtml$(searchResult) {
    var _this4 = this;
    var deferred = this.$q.defer();
    try {
      var contentHtml$ = null;
      var resultData = HttpAdapterV6.getResolveObject(getScrapeTmplt(null));
      if (searchResult.checkIsContentHtmlLoaded()) {
        contentHtml$ = this.promiseWrapper(HttpAdapterV6.getResolveObject(getScrapeTmplt(searchResult)));
      } else {
        var _this$scrapeRequestsS3;
        contentHtml$ = (_this$scrapeRequestsS3 = this.scrapeRequestsService) == null ? void 0 : _this$scrapeRequestsS3.getAlephOccrpDocument$(searchResult.getLinkUrl());
      }
      contentHtml$.then(function (resp) {
        resultData = resp;
      })["catch"](function (error) {
        _this4.errorLogger(error.error);
        resultData.status = error.status;
        resultData.data.data = undefined;
        resultData.data.linkUrl = searchResult.getLinkUrl();
      })["finally"](function () {
        deferred.resolve(resultData);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.getOpenSanctionsDocumentHtml$ = function getOpenSanctionsDocumentHtml$(searchResult) {
    var _this5 = this;
    var deferred = this.$q.defer();
    try {
      var contentHtml$ = null;
      var resultData = HttpAdapterV6.getResolveObject(getScrapeTmplt(null));
      if (searchResult.checkIsContentHtmlLoaded()) {
        contentHtml$ = this.promiseWrapper(HttpAdapterV6.getResolveObject(getScrapeTmplt(searchResult)));
      } else {
        var _this$scrapeRequestsS4;
        contentHtml$ = (_this$scrapeRequestsS4 = this.scrapeRequestsService) == null ? void 0 : _this$scrapeRequestsS4.getOpenSanctionsDocument$(searchResult.getLinkUrl());
      }
      contentHtml$.then(function (resp) {
        resultData = resp;
      })["catch"](function (error) {
        _this5.errorLogger(error.error);
        resultData.status = error.status;
        resultData.data.data = undefined;
        resultData.data.linkUrl = searchResult.getLinkUrl();
      })["finally"](function () {
        deferred.resolve(resultData);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.getOpenSanctionsDocumentJson$ = function getOpenSanctionsDocumentJson$(searchResult) {
    var _this6 = this;
    var deferred = this.$q.defer();
    try {
      var _this$scrapeRequestsS5;
      var documentJson$ = null;
      var resultData = HttpAdapterV6.getResolveObject({});
      documentJson$ = (_this$scrapeRequestsS5 = this.scrapeRequestsService) == null ? void 0 : _this$scrapeRequestsS5.getOpenSanctionsDocumentJson$(searchResult.getEntityId());
      documentJson$.then(function (resp) {
        resultData = resp;
      })["catch"](function (error) {
        _this6.errorLogger(error.error);
        resultData.status = error.status;
      })["finally"](function () {
        deferred.resolve(resultData);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.getOpenCorporatesDocumentHtml$ = function getOpenCorporatesDocumentHtml$(searchResult) {
    var _this7 = this;
    var deferred = this.$q.defer();
    try {
      var contentHtml$ = null;
      var resultData = HttpAdapterV6.getResolveObject(getScrapeTmplt(null));
      if (searchResult.checkIsContentHtmlLoaded()) {
        contentHtml$ = this.promiseWrapper(HttpAdapterV6.getResolveObject(getScrapeTmplt(searchResult)));
      } else {
        var _this$scrapeRequestsS6;
        contentHtml$ = (_this$scrapeRequestsS6 = this.scrapeRequestsService) == null ? void 0 : _this$scrapeRequestsS6.getOpenCorporatesDocument$(searchResult.getLinkUrl());
      }
      contentHtml$.then(function (resp) {
        resultData = resp;
      })["catch"](function (error) {
        _this7.errorLogger(error.error);
        resultData.status = error.status;
        resultData.data.data = undefined;
        resultData.data.linkUrl = searchResult.getLinkUrl();
      })["finally"](function () {
        deferred.resolve(resultData);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.getDocumentHtmlFromUrl$ = function getDocumentHtmlFromUrl$(linkUrl) {
    var _this8 = this;
    var deferred = this.$q.defer();
    try {
      var _this$scrapeRequestsS7;
      var resultData = HttpAdapterV6.getResolveObject(getScrapeTmplt(null));
      (_this$scrapeRequestsS7 = this.scrapeRequestsService) == null || _this$scrapeRequestsS7.getDocument$(linkUrl, false).then(function (resp) {
        deferred.resolve(resp);
      })["catch"](function () {
        var _this8$scrapeRequests;
        (_this8$scrapeRequests = _this8.scrapeRequestsService) == null || _this8$scrapeRequests.getDocument$(linkUrl, true).then(function (resp) {
          resultData = resp;
        })["catch"](function (error) {
          _this8.errorLogger(error.error);
          resultData.status = error.status;
          resultData.data.data = undefined;
          resultData.data.linkUrl = linkUrl;
        })["finally"](function () {
          deferred.resolve(resultData);
        });
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.getExtraSourceDocumentHtmlFromUrl$ = function getExtraSourceDocumentHtmlFromUrl$(linkUrl) {
    var _this9 = this;
    var deferred = this.$q.defer();
    try {
      var _this$scrapeRequestsS8;
      var resultData = HttpAdapterV6.getResolveObject(getScrapeTmplt(null));
      (_this$scrapeRequestsS8 = this.scrapeRequestsService) == null || _this$scrapeRequestsS8.getExtraSourceDocument$(linkUrl).then(function (resp) {
        resultData = resp;
      })["catch"](function (error) {
        _this9.errorLogger(error.error);
        resultData.status = error.status;
        resultData.data.data = undefined;
        resultData.data.linkUrl = linkUrl;
      })["finally"](function () {
        deferred.resolve(resultData);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.getAlephOccrpDocumentHtmlFromUrl$ = function getAlephOccrpDocumentHtmlFromUrl$(linkUrl) {
    var _this10 = this;
    var deferred = this.$q.defer();
    try {
      var _this$scrapeRequestsS9;
      var resultData = HttpAdapterV6.getResolveObject(getScrapeTmplt(null));
      (_this$scrapeRequestsS9 = this.scrapeRequestsService) == null || _this$scrapeRequestsS9.getAlephOccrpDocument$(linkUrl).then(function (resp) {
        resultData = resp;
      })["catch"](function (error) {
        _this10.errorLogger(error.error);
        resultData.status = error.status;
        resultData.data.data = undefined;
        resultData.data.linkUrl = linkUrl;
      })["finally"](function () {
        deferred.resolve(resultData);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.getOpenSanctionsDocumentHtmlFromUrl$ = function getOpenSanctionsDocumentHtmlFromUrl$(linkUrl) {
    var _this11 = this;
    var deferred = this.$q.defer();
    try {
      var _this$scrapeRequestsS10;
      var resultData = HttpAdapterV6.getResolveObject(getScrapeTmplt(null));
      (_this$scrapeRequestsS10 = this.scrapeRequestsService) == null || _this$scrapeRequestsS10.getOpenSanctionsDocument$(linkUrl).then(function (resp) {
        resultData = resp;
      })["catch"](function (error) {
        _this11.errorLogger(error.error);
        resultData.status = error.status;
        resultData.data.data = undefined;
        resultData.data.linkUrl = linkUrl;
      })["finally"](function () {
        deferred.resolve(resultData);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.getOpenCorporatesDocumentHtmlFromUrl$ = function getOpenCorporatesDocumentHtmlFromUrl$(linkUrl) {
    var _this12 = this;
    var deferred = this.$q.defer();
    try {
      var _this$scrapeRequestsS11;
      var resultData = HttpAdapterV6.getResolveObject(getScrapeTmplt(null));
      (_this$scrapeRequestsS11 = this.scrapeRequestsService) == null || _this$scrapeRequestsS11.getOpenCorporatesDocument$(linkUrl).then(function (resp) {
        resultData = resp;
      })["catch"](function (error) {
        _this12.errorLogger(error.error);
        resultData.status = error.status;
        resultData.data.data = undefined;
        resultData.data.linkUrl = linkUrl;
      })["finally"](function () {
        deferred.resolve(resultData);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.initServices = function initServices(endpointsConfig) {
    this.scrapeRequestsService = ScrapeRequestsServiceInstance.getNewService(this.$rootScope, this.$http, this.$q, this.$timeout);
    this.scrapeRequestsService.setUrls(endpointsConfig);
  };
  _proto.injectServices = function injectServices(scrapeRequestsService) {
    this.scrapeRequestsService = scrapeRequestsService;
  };
  _proto.resetAdapter = function resetAdapter() {
    var _this$scrapeRequestsS12;
    (_this$scrapeRequestsS12 = this.scrapeRequestsService) == null || _this$scrapeRequestsS12.resetRouteWasChanged();
  };
  _proto.setTimeouts = function setTimeouts(timeouts) {
    var _this$scrapeRequestsS13;
    (_this$scrapeRequestsS13 = this.scrapeRequestsService) == null || _this$scrapeRequestsS13.setTimeouts(timeouts);
  };
  _proto.destroy = function destroy() {
    _HttpAdapterV.prototype.destroy.call(this);
    this.scrapeRequestsService = null;
  };
  return ScrapeAdapterV6;
}(HttpAdapterV6);
module.exports = {
  ScrapeAdapterV6: ScrapeAdapterV6
};

},{"../../instances/services/http/scrape-requests-service":797,"../../templates/scrape-response-tmplt":890,"./http-adapter-v6":737}],744:[function(require,module,exports){
"use strict";

var _require = require("./open-document-adapter-v1"),
  OpenDocumentAdapterV1 = _require.OpenDocumentAdapterV1;
module.exports = {
  OpenDocumentAdapterV1: OpenDocumentAdapterV1
};

},{"./open-document-adapter-v1":745}],745:[function(require,module,exports){
"use strict";

function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
var _require = require("../adapter-v1"),
  AdapterV1 = _require.AdapterV1;
var _require2 = require("../../../media-search/models/result-items-v5/match-result-item-v5"),
  MatchResultItemV5 = _require2.MatchResultItemV5;
var _require3 = require("../../../media-search/models/result-items-v5/search-engine-result-item-v5"),
  SearchEngineResultItemV5 = _require3.SearchEngineResultItemV5;
var _require4 = require("../../../media-search/models/result-items-v5/google-news-result-item-v5"),
  GoogleNewsRssResultItemV5 = _require4.GoogleNewsRssResultItemV5;
var _require5 = require("../../../media-search/models/result-items-v5/extra-source-result-item-v5"),
  ExtraSourceResultItemV5 = _require5.ExtraSourceResultItemV5;
var _require6 = require("../../../media-search/models/result-items-v5/stock-market-result-item-v5"),
  StockMarketResultItemV5 = _require6.StockMarketResultItemV5;
var _require7 = require("../../../media-search/models/result-items-v5/aleph-occrp-result-item-v5"),
  AlephOccrpResultItemV5 = _require7.AlephOccrpResultItemV5;
var _require8 = require("../../../media-search/models/result-items-v5/open-sanctions-result-item-v5"),
  OpenSanctionsResultItemV5 = _require8.OpenSanctionsResultItemV5;
var _require9 = require("../../../media-search/models/result-items-v5/open-corporates-result-item-v5"),
  OpenCorporatesResultItemV5 = _require9.OpenCorporatesResultItemV5;
var _require10 = require("../../models/result-items"),
  AlephOccrpResultItemV1 = _require10.AlephOccrpResultItemV1,
  ExtraSourceResultItemV1 = _require10.ExtraSourceResultItemV1,
  GoogleNewsRssResultItemV1 = _require10.GoogleNewsRssResultItemV1,
  MatchResultItemV1 = _require10.MatchResultItemV1,
  OpenCorporatesResultItemV1 = _require10.OpenCorporatesResultItemV1,
  OpenSanctionsResultItemV1 = _require10.OpenSanctionsResultItemV1,
  SearchEngineResultItemV1 = _require10.SearchEngineResultItemV1,
  StockMarketResultItemV1 = _require10.StockMarketResultItemV1;
var _require11 = require("../../instances/services/utils"),
  DocumentServiceInstance = _require11.DocumentServiceInstance,
  HighlightServiceInstance = _require11.HighlightServiceInstance,
  NewTabWindowServiceInstance = _require11.NewTabWindowServiceInstance;
var _require12 = require("../../instances/adapters/processing"),
  ProcessingAdapterInstance = _require12.ProcessingAdapterInstance;
var _require13 = require("../../instances/adapters/scoring"),
  RiskScoringAdapterInstance = _require13.RiskScoringAdapterInstance;
var _require14 = require("../../../constants/source-types"),
  EXTRA_SOURCE_SOURCE_CODE = _require14.EXTRA_SOURCE_SOURCE_CODE;
var _require15 = require("../../services/utils"),
  NewTabWindowServiceV1 = _require15.NewTabWindowServiceV1;
var OpenDocumentAdapterV1 = function (_AdapterV) {
  function OpenDocumentAdapterV1($rootScope, $http, $q, $timeout) {
    var _this;
    _this = _AdapterV.call(this, $rootScope, $http, $q, $timeout) || this;
    _this.documentService = null;
    _this.newTabWindowService = null;
    _this.highlightService = null;
    _this.processingAdapter = null;
    _this.riskScoreCountAdapter = null;
    return _this;
  }
  _inheritsLoose(OpenDocumentAdapterV1, _AdapterV);
  var _proto = OpenDocumentAdapterV1.prototype;
  _proto.openDocument = function openDocument(searchResult, mandatoryKeywords) {
    var _this2 = this;
    if (searchResult instanceof MatchResultItemV5 || searchResult instanceof MatchResultItemV1) {
      NewTabWindowServiceV1.openNewTab(searchResult.getLinkUrl() || "");
      return;
    }
    if (searchResult instanceof SearchEngineResultItemV1 || searchResult instanceof GoogleNewsRssResultItemV1 || searchResult instanceof StockMarketResultItemV1 || searchResult instanceof ExtraSourceResultItemV1 || searchResult instanceof AlephOccrpResultItemV1 || searchResult instanceof OpenSanctionsResultItemV1 || searchResult instanceof OpenCorporatesResultItemV1 || searchResult instanceof SearchEngineResultItemV5 || searchResult instanceof GoogleNewsRssResultItemV5 || searchResult instanceof StockMarketResultItemV5 || searchResult instanceof ExtraSourceResultItemV5 || searchResult instanceof AlephOccrpResultItemV5 || searchResult instanceof OpenSanctionsResultItemV5 || searchResult instanceof OpenCorporatesResultItemV5) {
      var _this$processingAdapt;
      (_this$processingAdapt = this.processingAdapter) == null || _this$processingAdapt.loadAndSetDocumentHtml$(searchResult).then(function () {})["catch"](function (error) {
        _this2.errorLogger(error);
      })["finally"](function () {
        searchResult.incTryLoadCounter();
        if (searchResult.checkIsContentHtmlLoaded()) {
          var _this2$processingAdap;
          (_this2$processingAdap = _this2.processingAdapter) == null || _this2$processingAdap.loadAndSetCleanHtml$(searchResult).then(function () {})["catch"](function (error) {
            _this2.errorLogger(error);
          })["finally"](function () {
            var _this2$processingAdap2;
            if (!searchResult.checkIsFromExtraSource() && !searchResult.checkIsFromAlephOccrp() && !searchResult.checkIsFromOpenSanctions() && !searchResult.checkIsFromOpenCorporates()) {
              var _this2$riskScoreCount;
              (_this2$riskScoreCount = _this2.riskScoreCountAdapter) == null || _this2$riskScoreCount.countRiskScore(searchResult);
            }
            (_this2$processingAdap2 = _this2.processingAdapter) == null || _this2$processingAdap2.loadAndSetTextInfo$(searchResult, mandatoryKeywords).then(function () {})["catch"](function (error) {
              _this2.errorLogger(error);
            })["finally"](function () {
              var _this2$processingAdap3;
              if (!searchResult.checkIsFromExtraSource() && !searchResult.checkIsFromAlephOccrp() && !searchResult.checkIsFromOpenSanctions() && !searchResult.checkIsFromOpenCorporates()) {
                searchResult.setTotalSentimentRiskScore();
              }
              (_this2$processingAdap3 = _this2.processingAdapter) == null || _this2$processingAdap3.loadAndSetSpecialParsingInfo$(searchResult, "search_results", "html", "").then(function () {})["catch"](function (error) {
                _this2.errorLogger(error);
              })["finally"](function () {
                var _this2$processingAdap4;
                (_this2$processingAdap4 = _this2.processingAdapter) == null || _this2$processingAdap4.loadAndSetAnalyzeInfo$(searchResult).then(function () {})["catch"](function (error) {
                  _this2.errorLogger(error);
                })["finally"](function () {
                  var _this2$processingAdap5;
                  (_this2$processingAdap5 = _this2.processingAdapter) == null || _this2$processingAdap5.loadAndSetTopicInfo$(searchResult).then(function () {})["catch"](function (error) {
                    _this2.errorLogger(error);
                  })["finally"](function () {
                    var _this2$processingAdap6;
                    (_this2$processingAdap6 = _this2.processingAdapter) == null || _this2$processingAdap6.loadAndSetMentionedEntities$(searchResult).then(function () {})["catch"](function (error) {
                      _this2.errorLogger(error);
                    })["finally"](function () {
                      var _this2$processingAdap7;
                      (_this2$processingAdap7 = _this2.processingAdapter) == null || _this2$processingAdap7.loadAndSetMarkupHtml$(searchResult).then(function () {})["catch"](function (error) {
                        _this2.errorLogger(error);
                      })["finally"](function () {
                        if (searchResult.getContentMarkupHtml()) {
                          var _this2$newTabWindowSe;
                          (_this2$newTabWindowSe = _this2.newTabWindowService) == null || _this2$newTabWindowSe.openBlankWindow(searchResult.getContentMarkupElement() || "<div>No content</div>", searchResult.getPersonId(), searchResult.getId(), searchResult.getItemId(), "");
                        } else {
                          var _this2$highlightServi, _this2$highlightServi2, _this2$newTabWindowSe2;
                          (_this2$highlightServi = _this2.highlightService) == null || _this2$highlightServi.highlightEntities(searchResult);
                          (_this2$highlightServi2 = _this2.highlightService) == null || _this2$highlightServi2.highlightKeywords(searchResult);
                          (_this2$newTabWindowSe2 = _this2.newTabWindowService) == null || _this2$newTabWindowSe2.openBlankWindow(searchResult.getContentElement() || "<div>No content</div>", searchResult.getPersonId(), searchResult.getId(), searchResult.getItemId(), "");
                        }
                      });
                    });
                  });
                });
              });
            });
          });
        } else {
          var _this2$newTabWindowSe3;
          (_this2$newTabWindowSe3 = _this2.newTabWindowService) == null || _this2$newTabWindowSe3.openBlankWindow(searchResult.getContentElement() || "<div>No content</div>", searchResult.getPersonId(), searchResult.getId(), searchResult.getItemId(), "");
        }
      });
    }
  };
  _proto.openCommentDocument = function openCommentDocument(url, contentElHtml, contentMarkupElHtml, personFullName, isEntitiesLoaded, isEntitiesHighlighted, entityNames, isKeywordsHighlighted, keywords, type, scoreMode) {
    var _loadHtml$,
      _this3 = this;
    if (contentMarkupElHtml) {
      var _this$documentService, _this$newTabWindowSer;
      var contentEl = (_this$documentService = this.documentService) == null ? void 0 : _this$documentService.getElementFromHtml(contentMarkupElHtml);
      (_this$newTabWindowSer = this.newTabWindowService) == null || _this$newTabWindowSer.openBlankWindow(contentEl, "", "", "", "");
      return;
    }
    var contentHtml = null;
    var loadHtml$ = null;
    if (contentElHtml) {
      loadHtml$ = this.promiseWrapper(contentElHtml);
    } else {
      var _this$processingAdapt2;
      loadHtml$ = (_this$processingAdapt2 = this.processingAdapter) == null ? void 0 : _this$processingAdapt2.loadDocumentHtmlFromUrl$(url, type);
    }
    (_loadHtml$ = loadHtml$) == null || _loadHtml$.then(function (html) {
      if (html && html.length) {
        contentHtml = html;
      }
    })["catch"](function (error) {
      _this3.errorLogger(error);
    })["finally"](function () {
      if (contentHtml) {
        var _this3$processingAdap;
        var clearHtmlData = {};
        (_this3$processingAdap = _this3.processingAdapter) == null || _this3$processingAdap.getCommentClearHtml$(contentHtml, type).then(function (resp) {
          clearHtmlData = resp.data;
        })["catch"](function (error) {
          _this3.errorLogger(error);
        })["finally"](function () {
          var _this3$documentServic, _this3$processingAdap2;
          var contentEl = (_this3$documentServic = _this3.documentService) == null ? void 0 : _this3$documentServic.createElementFromHtml(clearHtmlData.html && clearHtmlData.html.length ? clearHtmlData.html : contentHtml, url, type);
          var commentMarkupElHtml = null;
          (_this3$processingAdap2 = _this3.processingAdapter) == null || _this3$processingAdap2.getCommentMarkupHtml$(contentEl, personFullName, scoreMode, type).then(function (resp) {
            commentMarkupElHtml = resp.data.html;
          })["catch"](function (error) {
            _this3.errorLogger(error);
          })["finally"](function () {
            if (commentMarkupElHtml) {
              var _this3$documentServic2, _this3$newTabWindowSe;
              contentEl = (_this3$documentServic2 = _this3.documentService) == null ? void 0 : _this3$documentServic2.getElementFromHtml(commentMarkupElHtml);
              (_this3$newTabWindowSe = _this3.newTabWindowService) == null || _this3$newTabWindowSe.openBlankWindow(contentEl, "", "", "", "");
            } else {
              var _this3$documentServic3, _namedEntities$;
              var doc = (_this3$documentServic3 = _this3.documentService) == null ? void 0 : _this3$documentServic3.getDocumentForHighlighting(contentEl, "highlighting");
              var namedEntities$ = null;
              if (isEntitiesLoaded) {
                namedEntities$ = _this3.promiseWrapper({
                  data: [].concat(entityNames)
                });
              } else {
                var _this3$documentServic4, _this3$documentServic5, _this3$processingAdap3;
                var contentElementText = (_this3$documentServic4 = _this3.documentService) == null ? void 0 : _this3$documentServic4.getInnerText((_this3$documentServic5 = _this3.documentService) == null ? void 0 : _this3$documentServic5.removeStyles(contentEl));
                namedEntities$ = (_this3$processingAdap3 = _this3.processingAdapter) == null ? void 0 : _this3$processingAdap3.getCommentNamedEntities$(contentElementText || "");
              }
              (_namedEntities$ = namedEntities$) == null || _namedEntities$.then(function (resp) {
                if (!isEntitiesHighlighted) {
                  var _this3$highlightServi;
                  (_this3$highlightServi = _this3.highlightService) == null || _this3$highlightServi.highlightDocument(doc, resp.data, "a", "#ffcc66", true, "passNameToParent");
                }
              })["catch"](function (error) {
                _this3.errorLogger(error);
              })["finally"](function () {
                var _this3$newTabWindowSe2;
                if (!isKeywordsHighlighted && type !== EXTRA_SOURCE_SOURCE_CODE) {
                  var _this3$highlightServi2;
                  (_this3$highlightServi2 = _this3.highlightService) == null || _this3$highlightServi2.highlightDocument(doc, keywords, "span", "#FFFF00", false, "");
                }
                contentEl = doc == null ? void 0 : doc.getElementById("highlighting");
                (_this3$newTabWindowSe2 = _this3.newTabWindowService) == null || _this3$newTabWindowSe2.openBlankWindow(contentEl, "", "", "", "");
              });
            }
          });
        });
      } else {
        var _this3$newTabWindowSe3;
        (_this3$newTabWindowSe3 = _this3.newTabWindowService) == null || _this3$newTabWindowSe3.openBlankWindow("<div>No content</div>", "", "", "", "");
      }
    });
  };
  _proto.initServices = function initServices(endpointsConfig) {
    this.documentService = DocumentServiceInstance.getService();
    this.documentService.setUrls(endpointsConfig);
    this.newTabWindowService = NewTabWindowServiceInstance.getService();
    this.newTabWindowService.setUrls(endpointsConfig);
    this.highlightService = HighlightServiceInstance.getService();
    this.highlightService.initServices(endpointsConfig);
  };
  _proto.injectServices = function injectServices(documentService, newTabWindowService, highlightService) {
    this.documentService = documentService;
    this.newTabWindowService = newTabWindowService;
    this.highlightService = highlightService;
  };
  _proto.initAdapters = function initAdapters(endpointsConfig) {
    this.processingAdapter = ProcessingAdapterInstance.getNewAdapter(this.$rootScope, this.$http, this.$q, this.$timeout);
    this.processingAdapter.initServices(endpointsConfig);
    this.processingAdapter.initAdapters(endpointsConfig);
    this.riskScoreCountAdapter = RiskScoringAdapterInstance.getNewAdapter();
  };
  _proto.injectAdapters = function injectAdapters(processingAdapter, riskScoreCountAdapter) {
    this.processingAdapter = processingAdapter;
    this.riskScoreCountAdapter = riskScoreCountAdapter;
  };
  _proto.resetAdapter = function resetAdapter() {
    var _this$processingAdapt3;
    (_this$processingAdapt3 = this.processingAdapter) == null || _this$processingAdapt3.resetAdapter();
  };
  _proto.setTimeouts = function setTimeouts(timeouts) {
    var _this$processingAdapt4;
    (_this$processingAdapt4 = this.processingAdapter) == null || _this$processingAdapt4.setTimeouts(timeouts);
  };
  _proto.setAdapterConstants = function setAdapterConstants(constants) {
    var _this$processingAdapt5;
    (_this$processingAdapt5 = this.processingAdapter) == null || _this$processingAdapt5.setAdapterConstants(constants);
  };
  _proto.setLoggers = function setLoggers(errorLogger, infoLogger) {
    var _this$processingAdapt6;
    this.errorLogger = errorLogger;
    this.infoLogger = infoLogger;
    (_this$processingAdapt6 = this.processingAdapter) == null || _this$processingAdapt6.setLoggers(errorLogger, infoLogger);
  };
  _proto.destroy = function destroy() {
    _AdapterV.prototype.destroy.call(this);
    this.documentService = null;
    this.newTabWindowService = null;
    this.highlightService = null;
    this.processingAdapter = null;
    this.riskScoreCountAdapter = null;
  };
  return OpenDocumentAdapterV1;
}(AdapterV1);
module.exports = {
  OpenDocumentAdapterV1: OpenDocumentAdapterV1
};

},{"../../../constants/source-types":697,"../../../media-search/models/result-items-v5/aleph-occrp-result-item-v5":894,"../../../media-search/models/result-items-v5/extra-source-result-item-v5":898,"../../../media-search/models/result-items-v5/google-news-result-item-v5":899,"../../../media-search/models/result-items-v5/match-result-item-v5":900,"../../../media-search/models/result-items-v5/open-corporates-result-item-v5":902,"../../../media-search/models/result-items-v5/open-sanctions-result-item-v5":903,"../../../media-search/models/result-items-v5/search-engine-result-item-v5":905,"../../../media-search/models/result-items-v5/stock-market-result-item-v5":907,"../../instances/adapters/processing":772,"../../instances/adapters/scoring":774,"../../instances/services/utils":809,"../../models/result-items":842,"../../services/utils":884,"../adapter-v1":735}],746:[function(require,module,exports){
"use strict";

var _require = require("./processing-adapter-v1"),
  ProcessingAdapterV1 = _require.ProcessingAdapterV1;
module.exports = {
  ProcessingAdapterV1: ProcessingAdapterV1
};

},{"./processing-adapter-v1":747}],747:[function(require,module,exports){
"use strict";

function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
var _require = require("../adapter-v1"),
  AdapterV1 = _require.AdapterV1;
var _require2 = require("../../../common/utils/mappers-v4"),
  mapEntityName = _require2.mapEntityName;
var _require3 = require("../../../common/utils/stopwatch"),
  StopWatch = _require3.StopWatch;
var _require4 = require("../../instances/services/utils"),
  DocumentServiceInstance = _require4.DocumentServiceInstance,
  HighlightServiceInstance = _require4.HighlightServiceInstance;
var _require5 = require("../../instances/adapters/http"),
  ScrapeAdapterInstance = _require5.ScrapeAdapterInstance,
  MediaPyAdapterInstance = _require5.MediaPyAdapterInstance,
  MediaPyGptAdapterInstance = _require5.MediaPyGptAdapterInstance,
  MediaPyLLMAdapterInstance = _require5.MediaPyLLMAdapterInstance,
  GoogleNlpAdapterInstance = _require5.GoogleNlpAdapterInstance;
var _require6 = require("../../instances/adapters/scoring"),
  RiskScoringAdapterInstance = _require6.RiskScoringAdapterInstance;
var _require7 = require("../../../constants/source-types"),
  GOOGLE_SEARCH_SOURCE_CODE = _require7.GOOGLE_SEARCH_SOURCE_CODE,
  GOOGLE_NEWS_SOURCE_CODE = _require7.GOOGLE_NEWS_SOURCE_CODE,
  EXTRA_SOURCE_SOURCE_CODE = _require7.EXTRA_SOURCE_SOURCE_CODE,
  STOCK_MARKETS_SOURCE_CODE = _require7.STOCK_MARKETS_SOURCE_CODE,
  ALEPH_OCCRP_SOURCE_CODE = _require7.ALEPH_OCCRP_SOURCE_CODE,
  OPEN_SANCTIONS_SOURCE_CODE = _require7.OPEN_SANCTIONS_SOURCE_CODE;
var ProcessingAdapterV1 = function (_AdapterV) {
  function ProcessingAdapterV1($rootScope, $http, $q, $timeout) {
    var _this;
    _this = _AdapterV.call(this, $rootScope, $http, $q, $timeout) || this;
    _this.documentService = null;
    _this.highlightService = null;
    _this.scrapeAdapter = null;
    _this.mediaPyAdapter = null;
    _this.mediaPyGptAdapter = null;
    _this.mediaPyLLMAdapter = null;
    _this.googleNlpAdapter = null;
    _this.riskScoreCountAdapter = null;
    return _this;
  }
  _inheritsLoose(ProcessingAdapterV1, _AdapterV);
  var _proto = ProcessingAdapterV1.prototype;
  _proto.createElement = function createElement(searchResult) {
    var _this$documentService;
    var contentEl = (_this$documentService = this.documentService) == null ? void 0 : _this$documentService.createElementFromHtml(searchResult.getContentHtml() || "", searchResult.getLinkUrl(), searchResult.getType());
    return contentEl;
  };
  _proto.getElementText = function getElementText(searchResult) {
    var contentElementText;
    try {
      var _this$documentService2, _this$documentService3;
      contentElementText = (_this$documentService2 = this.documentService) == null ? void 0 : _this$documentService2.getInnerText((_this$documentService3 = this.documentService) == null ? void 0 : _this$documentService3.removeStyles(searchResult.getContentElement()));
    } catch (error) {
      this.errorLogger(error);
    }
    return contentElementText || "";
  };
  _proto.logStartLoadResult = function logStartLoadResult(requestObject, linkUrl, idx, totalCount) {
    var msg = "Start load and process current document HTML:\n";
    msg += "\t- URL: '" + linkUrl + "'\n";
    msg += "\t" + ("- Request Object Id: '" + (requestObject ? requestObject.getId() : "") + "'") + "\n";
    if (idx !== null && idx !== undefined && totalCount !== null && totalCount !== undefined) {
      msg += "\t- " + (idx + 1).toString() + "/" + totalCount.toString();
    }
    this.infoLogger(msg);
  };
  _proto.logFinishLoadResult = function logFinishLoadResult(requestObject, linkUrl, idx, totalCount) {
    var msg = "Finish load and process current document HTML:\n";
    msg += "\t- URL: '" + linkUrl + "'\n";
    msg += "\t" + ("- Request Object Id: '" + (requestObject ? requestObject.getId() : "") + "'") + "\n";
    if (idx !== null && idx !== undefined && totalCount !== null && totalCount !== undefined) {
      msg += "\t- " + (idx + 1).toString() + "/" + totalCount.toString();
    }
    this.infoLogger(msg);
  };
  _proto.loadAndSetDocumentHtml$ = function loadAndSetDocumentHtml$(searchResult) {
    var _this2 = this;
    var deferred = this.$q.defer();
    try {
      this.infoLogger("Start load and set HTML for search result with URL = '" + searchResult.getLinkUrl() + "'...");
      var stopWatch = new StopWatch(undefined);
      stopWatch.start();
      var httpRespStatusCode = -1;
      var getDocument$ = null;
      if (searchResult.checkIsFromExtraSource()) {
        var _this$scrapeAdapter;
        getDocument$ = (_this$scrapeAdapter = this.scrapeAdapter) == null ? void 0 : _this$scrapeAdapter.getExtraSourceDocumentHtml$(searchResult);
      } else if (searchResult.checkIsFromAlephOccrp() && searchResult.checkIsDocumentType()) {
        var _this$scrapeAdapter2;
        getDocument$ = (_this$scrapeAdapter2 = this.scrapeAdapter) == null ? void 0 : _this$scrapeAdapter2.getDocumentHtml$(searchResult);
      } else if (searchResult.checkIsFromAlephOccrp() && !searchResult.checkIsDocumentType()) {
        var _this$scrapeAdapter3;
        getDocument$ = (_this$scrapeAdapter3 = this.scrapeAdapter) == null ? void 0 : _this$scrapeAdapter3.getAlephOccrpDocumentHtml$(searchResult);
      } else if (searchResult.checkIsFromOpenSanctions()) {
        var _this$scrapeAdapter4;
        getDocument$ = (_this$scrapeAdapter4 = this.scrapeAdapter) == null ? void 0 : _this$scrapeAdapter4.getOpenSanctionsDocumentHtml$(searchResult);
      } else if (searchResult.checkIsFromOpenCorporates()) {
        var _this$scrapeAdapter5;
        getDocument$ = (_this$scrapeAdapter5 = this.scrapeAdapter) == null ? void 0 : _this$scrapeAdapter5.getOpenCorporatesDocumentHtml$(searchResult);
      } else {
        var _this$scrapeAdapter6;
        getDocument$ = (_this$scrapeAdapter6 = this.scrapeAdapter) == null ? void 0 : _this$scrapeAdapter6.getDocumentHtml$(searchResult);
      }
      getDocument$.then(function (resp) {
        try {
          httpRespStatusCode = resp.status;
          var data = resp.data.data;
          if (data && data.length) {
            searchResult.setContentHtml(data);
          } else {
            searchResult.setContentHtml(undefined);
          }
        } catch (error) {
          _this2.errorLogger(error);
        }
      })["catch"](function (error) {
        _this2.errorLogger(error);
        httpRespStatusCode = -2;
      })["finally"](function () {
        stopWatch.stop();
        searchResult.setPerformanceMetric("get", "load", httpRespStatusCode, stopWatch.getElapsedMilliseconds(), null);
        _this2.infoLogger("Finish load and set HTML for search result with URL = '" + searchResult.getLinkUrl() + "'. Time: " + stopWatch.getElapsedMilliseconds() + " ms");
        deferred.resolve(searchResult);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.loadOpenSanctionsJson$ = function loadOpenSanctionsJson$(searchResult) {
    var _this3 = this;
    var deferred = this.$q.defer();
    try {
      this.infoLogger("Start load OpenSanctions JSON for search result with URL = '" + searchResult.getLinkUrl() + "'...");
      var resultJson = {};
      var stopWatch = new StopWatch(undefined);
      stopWatch.start();
      var getOpenSanctionsJson$ = null;
      if (searchResult.checkIsFromOpenSanctions()) {
        var _this$scrapeAdapter7;
        getOpenSanctionsJson$ = (_this$scrapeAdapter7 = this.scrapeAdapter) == null ? void 0 : _this$scrapeAdapter7.getOpenSanctionsDocumentJson$(searchResult);
      } else {
        getOpenSanctionsJson$ = this.promiseWrapper({});
      }
      getOpenSanctionsJson$.then(function (resp) {
        resultJson = resp.data;
      })["catch"](function (error) {
        _this3.errorLogger(error);
      })["finally"](function () {
        stopWatch.stop();
        _this3.infoLogger("Finish load OpenSanctions JSON for search result with URL = '" + searchResult.getLinkUrl() + "'. Time: " + stopWatch.getElapsedMilliseconds() + " ms");
        deferred.resolve(resultJson);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.loadAndSetCleanHtml$ = function loadAndSetCleanHtml$(searchResult) {
    var _this4 = this;
    var deferred = this.$q.defer();
    try {
      var _this$mediaPyAdapter;
      this.infoLogger("Start load and set cleared HTML for search result with URL = '" + searchResult.getLinkUrl() + "'...");
      var clearHtmlData = {};
      var stopWatch = new StopWatch(undefined);
      stopWatch.start();
      var httpRespStatusCode = -1;
      (_this$mediaPyAdapter = this.mediaPyAdapter) == null || _this$mediaPyAdapter.getMediaPyCleanHtml$(searchResult).then(function (resp) {
        httpRespStatusCode = resp.status;
        clearHtmlData = resp.data;
      })["catch"](function (error) {
        _this4.errorLogger(error);
        httpRespStatusCode = -2;
      })["finally"](function () {
        try {
          if (!searchResult.checkIsHtmlCleared() || !(searchResult.getContentElement() && searchResult.getContentElement() instanceof HTMLElement)) {
            var _this4$documentServic;
            var contentHtml = clearHtmlData.html && clearHtmlData.html.length ? clearHtmlData.html : searchResult.getContentHtml();
            var contentEl = (_this4$documentServic = _this4.documentService) == null ? void 0 : _this4$documentServic.createElementFromHtml(contentHtml, searchResult.getLinkUrl(), searchResult.getType());
            searchResult.setContentElement(contentEl);
            var contentElementText;
            if (clearHtmlData.text) {
              contentElementText = clearHtmlData.text;
            } else {
              var _this4$documentServic2, _this4$documentServic3;
              contentElementText = (_this4$documentServic2 = _this4.documentService) == null ? void 0 : _this4$documentServic2.getInnerText((_this4$documentServic3 = _this4.documentService) == null ? void 0 : _this4$documentServic3.removeStyles(contentEl));
            }
            searchResult.setContentElementText(contentElementText || "");
            searchResult.setLanguage(clearHtmlData.language);
            searchResult.setHtmlCleared(true);
          }
        } catch (error) {
          _this4.errorLogger(error);
        }
        stopWatch.stop();
        searchResult.setPerformanceMetric("mediaPy", "cleanHtml", httpRespStatusCode, stopWatch.getElapsedMilliseconds(), null);
        _this4.infoLogger("Finish load and set cleared HTML for search result with URL = '" + searchResult.getLinkUrl() + "'. Time: " + stopWatch.getElapsedMilliseconds() + " ms");
        deferred.resolve(searchResult);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.loadAndSetTextInfo$ = function loadAndSetTextInfo$(searchResult, mandatoryKeywords) {
    var _this5 = this;
    var deferred = this.$q.defer();
    try {
      var _this$mediaPyAdapter2;
      this.infoLogger("Start load and set text info for search result with URL = '" + searchResult.getLinkUrl() + "'...");
      var stopWatch = new StopWatch(undefined);
      stopWatch.start();
      var httpRespStatusCode = -1;
      (_this$mediaPyAdapter2 = this.mediaPyAdapter) == null || _this$mediaPyAdapter2.getMediaPyTextInfo$(searchResult, mandatoryKeywords).then(function (resp) {
        try {
          httpRespStatusCode = resp.status;
          var mediaPyTextInfo = resp.data;
          searchResult.setMediaPyRiskScore(mediaPyTextInfo.mediaPyRiskScore);
          searchResult.setMediaPyRiskScored(mediaPyTextInfo.isMediaPyRiskScored);
          searchResult.setMediaPyRiskScoreColor(mediaPyTextInfo.mediaPyRiskScore, true);
          searchResult.setSentiment(mediaPyTextInfo.mediaPySentiment);
          searchResult.setSentimentLoaded(mediaPyTextInfo.isMediaPySentimentLoaded);
          searchResult.setMediaPyTitleRiskScore(mediaPyTextInfo.mediaPyTitleRiskScore);
          searchResult.setMediaPyTitleRiskScoreColor(mediaPyTextInfo.mediaPyTitleRiskScore, true);
          searchResult.setMediaPyNameImportance(mediaPyTextInfo.mediaPyNameImportance);
          searchResult.setMediaPyNameImportanceColor(mediaPyTextInfo.mediaPyNameImportance, true);
          searchResult.setWordCloudImg(mediaPyTextInfo.img);
          searchResult.setLanguage(mediaPyTextInfo.language);
          searchResult.setAnalyzeItems(mediaPyTextInfo.keywords, "keywords");
          searchResult.setAnalyzeItems(mediaPyTextInfo.risk_keywords, "riskKeywords");
        } catch (error) {
          _this5.errorLogger(error);
          httpRespStatusCode = -2;
        }
      })["catch"](function (error) {
        _this5.errorLogger(error);
      })["finally"](function () {
        stopWatch.stop();
        searchResult.setPerformanceMetric("mediaPy", "textInfo", httpRespStatusCode, stopWatch.getElapsedMilliseconds(), null);
        _this5.infoLogger("Finish load and set text info for search result with URL = '" + searchResult.getLinkUrl() + "'. Time: " + stopWatch.getElapsedMilliseconds() + " ms");
        deferred.resolve(searchResult);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.loadAndSetMentionedEntities$ = function loadAndSetMentionedEntities$(searchResult) {
    var _this6 = this;
    var deferred = this.$q.defer();
    try {
      var _this$mediaPyAdapter3, _this$googleNlpAdapte;
      this.infoLogger("Start load and set mentioned entities for search result with URL = '" + searchResult.getLinkUrl() + "'...");
      var stopWatch = new StopWatch(undefined);
      stopWatch.start();
      var httpRespStatusCode = -1;
      var namedEntities$ = this.USE_MEDIA_SEARCH_PY ? (_this$mediaPyAdapter3 = this.mediaPyAdapter) == null ? void 0 : _this$mediaPyAdapter3.getMediaPyNamedEntities$(searchResult) : (_this$googleNlpAdapte = this.googleNlpAdapter) == null ? void 0 : _this$googleNlpAdapte.getGoogleNlpNamedEntities$(searchResult);
      namedEntities$.then(function (resp) {
        try {
          httpRespStatusCode = resp.status;
          var namedEntitiesData = resp.data;
          searchResult.setMentionedEntities(namedEntitiesData.named_entities);
          searchResult.setEntityNames((namedEntitiesData.named_entities || []).map(mapEntityName));
          searchResult.setEntitiesLoaded(namedEntitiesData.isEntitiesLoaded);
          if (namedEntitiesData.language) {
            searchResult.setLanguage(namedEntitiesData.language);
          }
        } catch (error) {
          _this6.errorLogger(error);
        }
      })["catch"](function (error) {
        _this6.errorLogger(error);
        httpRespStatusCode = -2;
      })["finally"](function () {
        stopWatch.stop();
        searchResult.setPerformanceMetric("mediaPy", "entities", httpRespStatusCode, stopWatch.getElapsedMilliseconds(), null);
        _this6.infoLogger("Finish load and set mentioned entities for search result with URL = '" + searchResult.getLinkUrl() + "'. Time: " + stopWatch.getElapsedMilliseconds() + " ms");
        deferred.resolve(searchResult);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.loadAndSetAnalyzeInfo$ = function loadAndSetAnalyzeInfo$(searchResult) {
    var _this7 = this;
    var deferred = this.$q.defer();
    try {
      var _this$mediaPyAdapter4;
      this.infoLogger("Start load and set analyze info for search result with URL = '" + searchResult.getLinkUrl() + "'...");
      var stopWatch = new StopWatch(undefined);
      stopWatch.start();
      var httpRespStatusCode = -1;
      (_this$mediaPyAdapter4 = this.mediaPyAdapter) == null || _this$mediaPyAdapter4.getMediaPyAnalyzeTextInfo$(searchResult).then(function (resp) {
        try {
          httpRespStatusCode = resp.status;
          var analyzeTextInfoData = resp.data;
          searchResult.setAnalyzeItems(analyzeTextInfoData.ngrams, "ngrams");
          searchResult.setAnalyzeItems(analyzeTextInfoData.keywords, "keywords");
          searchResult.setAnalyzeItems(analyzeTextInfoData.risk_keywords, "riskKeywords");
          searchResult.setAnalyzeRiskEntities(analyzeTextInfoData.named_entities);
          searchResult.setMentionedEntities(analyzeTextInfoData.named_entities);
          searchResult.setIsAnalyzed(true);
          searchResult.setEntityNames((analyzeTextInfoData.named_entities || []).map(mapEntityName));
          searchResult.setEntitiesLoaded(true);
        } catch (error) {
          _this7.errorLogger(error);
        }
      })["catch"](function (error) {
        _this7.errorLogger(error);
        httpRespStatusCode = -2;
      })["finally"](function () {
        stopWatch.stop();
        searchResult.setPerformanceMetric("mediaPy", "analyzeText", httpRespStatusCode, stopWatch.getElapsedMilliseconds(), null);
        _this7.infoLogger("Finish load and set analyze info for search result with URL = '" + searchResult.getLinkUrl() + "'. Time: " + stopWatch.getElapsedMilliseconds() + " ms");
        deferred.resolve(searchResult);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.loadAndSetSpecialParsingInfo$ = function loadAndSetSpecialParsingInfo$(searchResult, type, format, content) {
    var _this8 = this;
    var deferred = this.$q.defer();
    try {
      var _this$mediaPyAdapter5;
      this.infoLogger("Start load and set special parsing info for search result with URL = '" + searchResult.getLinkUrl() + "'...");
      var stopWatch = new StopWatch(undefined);
      stopWatch.start();
      var httpRespStatusCode = -1;
      (_this$mediaPyAdapter5 = this.mediaPyAdapter) == null || _this$mediaPyAdapter5.getMediaPySpecialParsing$(searchResult, type, format, content).then(function (resp) {
        try {
          httpRespStatusCode = resp.status;
          var specialParsingData = resp.data;
          if (searchResult.checkIsFromExtraSource()) {
            if (!searchResult.getContentMarkupHtml() || !(searchResult.getContentMarkupElement() && searchResult.getContentMarkupElement() instanceof HTMLElement)) {
              var _this8$documentServic;
              var contentHtml = specialParsingData.html && specialParsingData.html.length ? specialParsingData.html : searchResult.getContentHtml();
              searchResult.setContentMarkupHtml(contentHtml);
              var contentEl = (_this8$documentServic = _this8.documentService) == null ? void 0 : _this8$documentServic.createElementFromMarkupHtml(contentHtml, searchResult.getLinkUrl(), searchResult.getContentElement());
              searchResult.setContentMarkupElement(contentEl);
            }
            searchResult.setMediaPyRiskScore(specialParsingData.risk);
            searchResult.setMediaPyRiskScored(true);
            searchResult.setMediaPyRiskScoreColor(specialParsingData.risk, true);
            searchResult.setExtendedSummary(specialParsingData.summary);
            searchResult.setExtendedSummaryHtml(specialParsingData.summary);
            searchResult.setRelevance(specialParsingData.relevance);
            searchResult.setAnalyzeItems(specialParsingData.keywords, "keywords");
            searchResult.setAnalyzeRiskEntities(specialParsingData.named_entities);
            searchResult.setMentionedEntities(specialParsingData.named_entities);
            searchResult.setIsAnalyzed(true);
            searchResult.setEntityNames((specialParsingData.named_entities || []).map(mapEntityName));
            searchResult.setEntitiesLoaded(true);
          }
        } catch (error) {
          _this8.errorLogger(error);
        }
      })["catch"](function (error) {
        _this8.errorLogger(error);
        httpRespStatusCode = -2;
      })["finally"](function () {
        stopWatch.stop();
        searchResult.setPerformanceMetric("mediaPy", "specialParsing", httpRespStatusCode, stopWatch.getElapsedMilliseconds(), null);
        _this8.infoLogger("Finish load and set special parsing info for search result with URL = '" + searchResult.getLinkUrl() + "'. Time: " + stopWatch.getElapsedMilliseconds() + " ms");
        deferred.resolve(searchResult);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.loadSpecialParsingInfoJson$ = function loadSpecialParsingInfoJson$(searchResult, type, format, content) {
    var _this9 = this;
    var deferred = this.$q.defer();
    try {
      var _this$mediaPyAdapter6;
      this.infoLogger("Start load and set special parsing info (JSON) for search result with URL = '" + searchResult.getLinkUrl() + "'...");
      var stopWatch = new StopWatch(undefined);
      stopWatch.start();
      var jsonEntityInfo = {};
      (_this$mediaPyAdapter6 = this.mediaPyAdapter) == null || _this$mediaPyAdapter6.getMediaPySpecialParsingJson$(searchResult, type, format, content).then(function (resp) {
        stopWatch.stop();
        if (searchResult.checkIsFromOpenSanctions()) {
          jsonEntityInfo = resp.data;
        }
      })["catch"](function (error) {
        _this9.errorLogger(error);
      })["finally"](function () {
        _this9.infoLogger("Finish load and set special parsing info (JSON) for search result with URL = '" + searchResult.getLinkUrl() + "'. Time: " + stopWatch.getElapsedMilliseconds() + " ms");
        deferred.resolve(jsonEntityInfo);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.loadAndSetTopicInfo$ = function loadAndSetTopicInfo$(searchResult) {
    var deferred = this.$q.defer();
    deferred.resolve(searchResult);
    return deferred.promise;
  };
  _proto.loadAndSetMarkupHtml$ = function loadAndSetMarkupHtml$(searchResult) {
    var _this10 = this;
    var deferred = this.$q.defer();
    try {
      var _this$mediaPyAdapter7;
      this.infoLogger("Start load and set markup HTML for search result with URL = '" + searchResult.getLinkUrl() + "'...");
      var stopWatch = new StopWatch(undefined);
      stopWatch.start();
      var httpRespStatusCode = -1;
      (_this$mediaPyAdapter7 = this.mediaPyAdapter) == null || _this$mediaPyAdapter7.getMediaPyMarkupHtml$(searchResult).then(function (resp) {
        try {
          httpRespStatusCode = resp.status;
          var markupHtmlData = resp.data;
          if (markupHtmlData.html) {
            searchResult.setContentMarkupHtml(markupHtmlData.html);
          }
        } catch (error) {
          _this10.errorLogger(error);
        }
      })["catch"](function (error) {
        _this10.errorLogger(error);
        httpRespStatusCode = -2;
      })["finally"](function () {
        try {
          if (searchResult.getContentMarkupHtml()) {
            if (!(searchResult.getContentMarkupElement() && searchResult.getContentMarkupElement() instanceof HTMLElement)) {
              var _this10$documentServi;
              var contentEl = (_this10$documentServi = _this10.documentService) == null ? void 0 : _this10$documentServi.createElementFromMarkupHtml(searchResult.getContentMarkupHtml() || "", searchResult.getLinkUrl(), !searchResult.checkIsFromAlephOccrp() ? searchResult.getContentElement() : null);
              searchResult.setContentMarkupElement(contentEl);
            }
          }
        } catch (error) {
          _this10.errorLogger(error);
        }
        stopWatch.stop();
        searchResult.setPerformanceMetric("mediaPy", "markup", httpRespStatusCode, stopWatch.getElapsedMilliseconds(), null);
        _this10.infoLogger("Finish load and set markup HTML for search result with URL = '" + searchResult.getLinkUrl() + "'. Time: " + stopWatch.getElapsedMilliseconds() + " ms");
        deferred.resolve(searchResult);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.loadAndSetExtendedSummary$ = function loadAndSetExtendedSummary$(searchResult) {
    var _this11 = this;
    var deferred = this.$q.defer();
    try {
      var _this$mediaPyAdapter8;
      this.infoLogger("Start load and set extended summary for search result with URL = '" + searchResult.getLinkUrl() + "'...");
      var stopWatch = new StopWatch(undefined);
      stopWatch.start();
      var httpRespStatusCode = -1;
      (_this$mediaPyAdapter8 = this.mediaPyAdapter) == null || _this$mediaPyAdapter8.getMediaPySummarizeText$(searchResult).then(function (resp) {
        try {
          httpRespStatusCode = resp.status;
          var summaryData = resp.data;
          searchResult.setExtendedSummary(summaryData.summary);
          searchResult.setExtendedSummaryHtml(summaryData.marked_summary);
        } catch (error) {
          _this11.errorLogger(error);
        }
      })["catch"](function (error) {
        _this11.errorLogger(error);
        httpRespStatusCode = -2;
      })["finally"](function () {
        stopWatch.stop();
        searchResult.setPerformanceMetric("mediaPy", "summarizeText", httpRespStatusCode, stopWatch.getElapsedMilliseconds(), null);
        _this11.infoLogger("Finish load and set extended summary for search result with URL = '" + searchResult.getLinkUrl() + "'. Time: " + stopWatch.getElapsedMilliseconds() + " ms");
        deferred.resolve(searchResult);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.loadAndSetCheckIsPersonMatch$ = function loadAndSetCheckIsPersonMatch$(searchResult) {
    var _this12 = this;
    var deferred = this.$q.defer();
    try {
      var _this$mediaPyGptAdapt;
      this.infoLogger("Start check person is match in search result with URL = '" + searchResult.getLinkUrl() + "'...");
      var stopWatch = new StopWatch(undefined);
      stopWatch.start();
      var httpRespStatusCode = -1;
      var usageInfo = null;
      (_this$mediaPyGptAdapt = this.mediaPyGptAdapter) == null || _this$mediaPyGptAdapt.sendMediaPyGptCheckIsPersonMatchRequest$(searchResult).then(function (resp) {
        try {
          httpRespStatusCode = resp.status;
          var data = resp.data;
          if (!data.response.error) {
            searchResult.setGptIsPersonMatch(data.response.is_match);
          }
          usageInfo = data.usage_info;
        } catch (error) {
          _this12.errorLogger(error);
        }
      })["catch"](function (error) {
        _this12.errorLogger(error);
        httpRespStatusCode = -2;
      })["finally"](function () {
        stopWatch.stop();
        searchResult.setPerformanceMetric("mediaPyGpt", "checkIsPersonMatch", httpRespStatusCode, stopWatch.getElapsedMilliseconds(), usageInfo);
        _this12.infoLogger("Finish check person is match in search result with URL = '" + searchResult.getLinkUrl() + "'. Time: " + stopWatch.getElapsedMilliseconds() + " ms");
        deferred.resolve(searchResult);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.loadAndSetGptRiskAssesment$ = function loadAndSetGptRiskAssesment$(searchResult) {
    var _this13 = this;
    var deferred = this.$q.defer();
    try {
      var _this$mediaPyGptAdapt2;
      this.infoLogger("Start load and set extended GPT risk assesment for search result with URL = '" + searchResult.getLinkUrl() + "'...");
      var stopWatch = new StopWatch(undefined);
      stopWatch.start();
      var httpRespStatusCode = -1;
      var usageInfo = null;
      (_this$mediaPyGptAdapt2 = this.mediaPyGptAdapter) == null || _this$mediaPyGptAdapt2.sendMediaPyGptRiskAssesmentRequest$(searchResult).then(function (resp) {
        try {
          httpRespStatusCode = resp.status;
          var data = resp.data;
          if (!data.response.error) {
            searchResult.setGptRiskScore(data.response.score);
            searchResult.setGptRiskExplanation(data.response.explanation);
          }
          usageInfo = data.usage_info;
        } catch (error) {
          _this13.errorLogger(error);
        }
      })["catch"](function (error) {
        _this13.errorLogger(error);
        httpRespStatusCode = -2;
      })["finally"](function () {
        stopWatch.stop();
        searchResult.setPerformanceMetric("mediaPyGpt", "riskAssesment", httpRespStatusCode, stopWatch.getElapsedMilliseconds(), usageInfo);
        _this13.infoLogger("Finish load and set extended GPT risk assesment for search result with URL = '" + searchResult.getLinkUrl() + "'. Time: " + stopWatch.getElapsedMilliseconds() + " ms");
        deferred.resolve(searchResult);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.loadAndSetGptDocumentAnalysis$ = function loadAndSetGptDocumentAnalysis$(searchResult) {
    var _this14 = this;
    var deferred = this.$q.defer();
    try {
      var _this$mediaPyGptAdapt3;
      this.infoLogger("Start load and set extended GPT document analysis for search result with URL = '" + searchResult.getLinkUrl() + "'...");
      var stopWatch = new StopWatch(undefined);
      stopWatch.start();
      var httpRespStatusCode = -1;
      var usageInfo = null;
      (_this$mediaPyGptAdapt3 = this.mediaPyGptAdapter) == null || _this$mediaPyGptAdapt3.sendMediaPyGptDocumentAnalysisRequest$(searchResult).then(function (resp) {
        try {
          httpRespStatusCode = resp.status;
          var data = resp.data;
          if (!data.response.error) {
            searchResult.setGptDocAnalysSummary(data.response.summary);
            searchResult.setGptDocAnalysSentiment(data.response.sentiment);
            searchResult.setGptDocAnalysTopic(data.response.topic);
            searchResult.setGptDocAnalysKeywords(data.response.keywords);
            searchResult.setGptDocAnalysPubType(data.response.publication_type);
          }
          usageInfo = data.usage_info;
        } catch (error) {
          _this14.errorLogger(error);
        }
      })["catch"](function (error) {
        _this14.errorLogger(error);
        httpRespStatusCode = -2;
      })["finally"](function () {
        stopWatch.stop();
        searchResult.setPerformanceMetric("mediaPyGpt", "documentAnalysis", httpRespStatusCode, stopWatch.getElapsedMilliseconds(), usageInfo);
        _this14.infoLogger("Finish load and set extended GPT document analysis for search result with URL = '" + searchResult.getLinkUrl() + "'. Time: " + stopWatch.getElapsedMilliseconds() + " ms");
        deferred.resolve(searchResult);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.loadAndSetGptPersonSummary$ = function loadAndSetGptPersonSummary$(searchResult) {
    var _this15 = this;
    var deferred = this.$q.defer();
    try {
      var _this$mediaPyGptAdapt4;
      this.infoLogger("Start load and set GPT person summary for search result with URL = '" + searchResult.getLinkUrl() + "'...");
      var stopWatch = new StopWatch(undefined);
      stopWatch.start();
      var httpRespStatusCode = -1;
      var usageInfo = null;
      (_this$mediaPyGptAdapt4 = this.mediaPyGptAdapter) == null || _this$mediaPyGptAdapt4.sendMediaPyGptPersonSummaryRequest$(searchResult).then(function (resp) {
        try {
          httpRespStatusCode = resp.status;
          var data = resp.data;
          if (!data.response.error) {
            searchResult.setGptPersSumSummary(data.response.summary);
            searchResult.setGptPersSumDetails(data.response.details);
          }
          usageInfo = data.usage_info;
        } catch (error) {
          _this15.errorLogger(error);
        }
      })["catch"](function (error) {
        _this15.errorLogger(error);
        httpRespStatusCode = -2;
      })["finally"](function () {
        stopWatch.stop();
        searchResult.setPerformanceMetric("mediaPyGpt", "personSummary", httpRespStatusCode, stopWatch.getElapsedMilliseconds(), usageInfo);
        _this15.infoLogger("Finish load and set GPT person summary for search result with URL = '" + searchResult.getLinkUrl() + "'. Time: " + stopWatch.getElapsedMilliseconds() + " ms");
        deferred.resolve(searchResult);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.loadAndSetGptRelatedEntities$ = function loadAndSetGptRelatedEntities$(searchResult) {
    var _this16 = this;
    var deferred = this.$q.defer();
    try {
      var _this$mediaPyGptAdapt5;
      this.infoLogger("Start load and set GPT related entities for search result with URL = '" + searchResult.getLinkUrl() + "'...");
      var stopWatch = new StopWatch(undefined);
      stopWatch.start();
      var httpRespStatusCode = -1;
      var usageInfo = null;
      (_this$mediaPyGptAdapt5 = this.mediaPyGptAdapter) == null || _this$mediaPyGptAdapt5.sendMediaPyGptRelatedEntitiesRequest$(searchResult).then(function (resp) {
        try {
          httpRespStatusCode = resp.status;
          var data = resp.data;
          if (!data.response.error) {
            searchResult.setGptRelatedItems(data.response.persons, "persons");
            searchResult.setGptRelatedItems(data.response.organizations, "orgs");
          }
          usageInfo = data.usage_info;
        } catch (error) {
          _this16.errorLogger(error);
        }
      })["catch"](function (error) {
        _this16.errorLogger(error);
        httpRespStatusCode = -2;
      })["finally"](function () {
        stopWatch.stop();
        searchResult.setPerformanceMetric("mediaPyGpt", "relatedEntities", httpRespStatusCode, stopWatch.getElapsedMilliseconds(), usageInfo);
        _this16.infoLogger("Finish load and set GPT related entities for search result with URL = '" + searchResult.getLinkUrl() + "'. Time: " + stopWatch.getElapsedMilliseconds() + " ms");
        deferred.resolve(searchResult);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.loadAndSetGptPersonMatching$ = function loadAndSetGptPersonMatching$(searchResult, personOverallSummary) {
    var _this17 = this;
    var deferred = this.$q.defer();
    try {
      var _this$mediaPyGptAdapt6;
      this.infoLogger("Start load and set GPT person matching for search result with URL = '" + searchResult.getLinkUrl() + "'...");
      var stopWatch = new StopWatch(undefined);
      stopWatch.start();
      var httpRespStatusCode = -1;
      var usageInfo = null;
      (_this$mediaPyGptAdapt6 = this.mediaPyGptAdapter) == null || _this$mediaPyGptAdapt6.sendMediaPyGptPersonMatchingRequest$(searchResult, personOverallSummary).then(function (resp) {
        try {
          httpRespStatusCode = resp.status;
          var data = resp.data;
          if (!data.response.error) {
            searchResult.setGptPersonIsMatch(data.response.is_match);
          }
          usageInfo = data.usage_info;
        } catch (error) {
          _this17.errorLogger(error);
        }
      })["catch"](function (error) {
        _this17.errorLogger(error);
        httpRespStatusCode = -2;
      })["finally"](function () {
        stopWatch.stop();
        searchResult.setPerformanceMetric("mediaPyGpt", "personMatching", httpRespStatusCode, stopWatch.getElapsedMilliseconds(), usageInfo);
        _this17.infoLogger("Finish load and set GPT person matching for search result with URL = '" + searchResult.getLinkUrl() + "'. Time: " + stopWatch.getElapsedMilliseconds() + " ms");
        deferred.resolve(searchResult);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.loadAndSetGptNegativeContextAnalysis$ = function loadAndSetGptNegativeContextAnalysis$(searchResult) {
    var _this18 = this;
    var deferred = this.$q.defer();
    try {
      var _this$mediaPyGptAdapt7;
      this.infoLogger("Start load and set GPT negative context analysis for search result with URL = '" + searchResult.getLinkUrl() + "'...");
      var stopWatch = new StopWatch(undefined);
      stopWatch.start();
      var httpRespStatusCode = -1;
      var usageInfo = null;
      (_this$mediaPyGptAdapt7 = this.mediaPyGptAdapter) == null || _this$mediaPyGptAdapt7.sendMediaPyGptNegativeContextAnalysisRequest$(searchResult).then(function (resp) {
        try {
          httpRespStatusCode = resp.status;
          var data = resp.data;
          if (!data.response.error) {
            searchResult.setGptAllegations(data.response.allegations);
            searchResult.setGptEvidence(data.response.evidence);
          }
          usageInfo = data.usage_info;
        } catch (error) {
          _this18.errorLogger(error);
        }
      })["catch"](function (error) {
        _this18.errorLogger(error);
        httpRespStatusCode = -2;
      })["finally"](function () {
        stopWatch.stop();
        searchResult.setPerformanceMetric("mediaPyGpt", "negativeContextAnalysis", httpRespStatusCode, stopWatch.getElapsedMilliseconds(), usageInfo);
        _this18.infoLogger("Finish load and set GPT negative context analysis for search result with URL = '" + searchResult.getLinkUrl() + "'. Time: " + stopWatch.getElapsedMilliseconds() + " ms");
        deferred.resolve(searchResult);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.loadAndSetChainRiskAssessment$ = function loadAndSetChainRiskAssessment$(searchResult) {
    var _this19 = this;
    var deferred = this.$q.defer();
    try {
      var _this$mediaPyGptAdapt8;
      this.infoLogger("Start load and set GPT chain risk assessment for search result with URL = '" + searchResult.getLinkUrl() + "'...");
      var stopWatch = new StopWatch(undefined);
      stopWatch.start();
      var httpRespStatusCode = -1;
      var usageInfo = null;
      (_this$mediaPyGptAdapt8 = this.mediaPyGptAdapter) == null || _this$mediaPyGptAdapt8.sendMediaPyGptChainRiskAssessmentRequest$(searchResult).then(function (resp) {
        try {
          httpRespStatusCode = resp.status;
          var data = resp.data;
          if (!data.response.error) {
            searchResult.setGptAllegations(data.response.allegations);
            searchResult.setGptEvidence(data.response.evidence);
            searchResult.setGptRiskScore(data.response.score);
            searchResult.setGptRiskExplanation(data.response.explanation);
          }
          usageInfo = data.usage_info;
        } catch (error) {
          _this19.errorLogger(error);
        }
      })["catch"](function (error) {
        _this19.errorLogger(error);
        httpRespStatusCode = -2;
      })["finally"](function () {
        stopWatch.stop();
        searchResult.setPerformanceMetric("mediaPyGpt", "chainRiskAssessment", httpRespStatusCode, stopWatch.getElapsedMilliseconds(), usageInfo);
        _this19.infoLogger("Finish load and set GPT chain risk assessment for search result with URL = '" + searchResult.getLinkUrl() + "'. Time: " + stopWatch.getElapsedMilliseconds() + " ms");
        deferred.resolve(searchResult);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.loadAndSetLLMTextAnalysis$ = function loadAndSetLLMTextAnalysis$(searchResult) {
    var _this20 = this;
    var deferred = this.$q.defer();
    try {
      var _this$mediaPyLLMAdapt;
      this.infoLogger("Start load and set LLM text analysis for search result with URL = '" + searchResult.getLinkUrl() + "'...");
      var stopWatch = new StopWatch(undefined);
      stopWatch.start();
      var httpRespStatusCode = -1;
      (_this$mediaPyLLMAdapt = this.mediaPyLLMAdapter) == null || _this$mediaPyLLMAdapt.sendMediaPyLLMTextAnalysisRequest$(searchResult).then(function (resp) {
        try {
          httpRespStatusCode = resp.status;
          var data = resp.data;
          searchResult.setLLMSummary(data.summary);
          searchResult.setLLMShortSummary(data.short_summary);
          searchResult.setLLMPersonSummary(data.person_summary);
          searchResult.setLLMmentionedEntities(data.people, "persons");
          searchResult.setLLMmentionedEntities(data.organizations, "orgs");
          searchResult.setLLMKeywords(data.keywords);
          searchResult.setLLMSentiment(data.sentiment);
          searchResult.setLLMRiskLevel(data.risk_level);
          searchResult.setLLMRiskExplanation(data.risk_explanation);
        } catch (error) {
          _this20.errorLogger(error);
        }
      })["catch"](function (error) {
        _this20.errorLogger(error);
        httpRespStatusCode = -2;
      })["finally"](function () {
        stopWatch.stop();
        searchResult.setPerformanceMetric("mediaPyLLM", "textAnalysis", httpRespStatusCode, stopWatch.getElapsedMilliseconds(), null);
        _this20.infoLogger("Finish load and set LLM text analysis for search result with URL = '" + searchResult.getLinkUrl() + "'. Time: " + stopWatch.getElapsedMilliseconds() + " ms");
        deferred.resolve(searchResult);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.loadAndSetGptInformation$ = function loadAndSetGptInformation$(searchResult) {
    var _this21 = this;
    var deferred = this.$q.defer();
    try {
      var stopWatch = new StopWatch(undefined);
      stopWatch.start();
      var batchPromisesArray = [this.loadAndSetChainRiskAssessment$(searchResult), this.loadAndSetGptDocumentAnalysis$(searchResult), this.loadAndSetGptPersonSummary$(searchResult), this.loadAndSetGptRelatedEntities$(searchResult)];
      this.batchPromisesWrapper(batchPromisesArray).then(function () {})["catch"](function (error) {
        _this21.errorLogger(error);
      })["finally"](function () {
        stopWatch.stop();
        searchResult.setPerformanceMetric("mediaPyGpt", "total", -1, stopWatch.getElapsedMilliseconds(), null);
        deferred.resolve(searchResult);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.loadAndSetPersonExtendedSummary$ = function loadAndSetPersonExtendedSummary$(person) {
    var _this22 = this;
    var deferred = this.$q.defer();
    try {
      var _this$mediaPyAdapter9;
      this.infoLogger("Start load and set person extended summary for person with full name = '" + person.getFullName() + "'...");
      var stopWatch = new StopWatch(undefined);
      stopWatch.start();
      var httpRespStatusCode = -1;
      (_this$mediaPyAdapter9 = this.mediaPyAdapter) == null || _this$mediaPyAdapter9.getMediaPySummarizePerson$(person).then(function (resp) {
        try {
          httpRespStatusCode = resp.status;
          var data = resp.data;
          person.setExtendedSummary(data.summary);
        } catch (error) {
          _this22.errorLogger(error);
        }
      })["catch"](function (error) {
        _this22.errorLogger(error);
        httpRespStatusCode = -2;
      })["finally"](function () {
        stopWatch.stop();
        person.setPerformanceMetric("mediaPy", "summarize", httpRespStatusCode, stopWatch.getElapsedMilliseconds(), null);
        _this22.infoLogger("Finish load and set person extended summary for person with full name = '" + person.getFullName() + "'. Time: " + stopWatch.getElapsedMilliseconds() + " ms");
        deferred.resolve(person);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.loadAndSetPersonGptSearchResultsInformation$ = function loadAndSetPersonGptSearchResultsInformation$(person, callback) {
    var _this23 = this;
    var deferred = this.$q.defer();
    try {
      this.infoLogger("Start load and set person GPT search results information for person with full name = '" + person.getFullName() + "'...");
      var stopWatch = new StopWatch(undefined);
      stopWatch.start();
      var batchPromisesArray = person.getTopGptRiskResults().map(function (searchResult) {
        return _this23.loadAndSetGptInformation$(searchResult);
      });
      this.batchPromisesWrapper(batchPromisesArray).then(function () {})["catch"](function (error) {
        _this23.errorLogger(error);
      })["finally"](function () {
        stopWatch.stop();
        person.setPerformanceMetric("mediaPyGpt", "processResults", -1, stopWatch.getElapsedMilliseconds(), null);
        _this23.infoLogger("Finish load and set person GPT search results information for person with full name = '" + person.getFullName() + "'. Time: " + stopWatch.getElapsedMilliseconds() + " ms");
        callback([person]);
        deferred.resolve(person);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.loadAndSetPersonGptGeneralRiskAssesment$ = function loadAndSetPersonGptGeneralRiskAssesment$(person) {
    var _this24 = this;
    var deferred = this.$q.defer();
    try {
      var _this$mediaPyGptAdapt9;
      this.infoLogger("Start load and set person GPT general risk assessment for person with full name = '" + person.getFullName() + "'...");
      var stopWatch = new StopWatch(undefined);
      stopWatch.start();
      var httpRespStatusCode = -1;
      var usageInfo = null;
      (_this$mediaPyGptAdapt9 = this.mediaPyGptAdapter) == null || _this$mediaPyGptAdapt9.sendMediaPyGptGeneralRiskAssesmentsRequest$(person).then(function (resp) {
        try {
          httpRespStatusCode = resp.status;
          var data = resp.data;
          if (!data.response.error) {
            person.setGptRiskScore(data.response.score);
            person.setGptRiskExplanation(data.response.explanation);
          }
          usageInfo = data.usage_info;
        } catch (error) {
          _this24.errorLogger(error);
        }
      })["catch"](function (error) {
        _this24.errorLogger(error);
        httpRespStatusCode = -2;
      })["finally"](function () {
        stopWatch.stop();
        person.setPerformanceMetric("mediaPyGpt", "generalRiskAssessment", httpRespStatusCode, stopWatch.getElapsedMilliseconds(), usageInfo);
        _this24.infoLogger("Finish load and set person GPT general risk assessment for person with full name = '" + person.getFullName() + "'. Time: " + stopWatch.getElapsedMilliseconds() + " ms");
        deferred.resolve(person);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.loadAndSetPersonGptMostImportantEntities$ = function loadAndSetPersonGptMostImportantEntities$(person) {
    var _this25 = this;
    var deferred = this.$q.defer();
    try {
      var _this$mediaPyGptAdapt10;
      this.infoLogger("Start load and set person GPT most important entities for person with full name = '" + person.getFullName() + "'...");
      var stopWatch = new StopWatch(undefined);
      stopWatch.start();
      var httpRespStatusCode = -1;
      var usageInfo = null;
      (_this$mediaPyGptAdapt10 = this.mediaPyGptAdapter) == null || _this$mediaPyGptAdapt10.sendMediaPyGptMostImportantEntitiesRequest$(person).then(function (resp) {
        try {
          httpRespStatusCode = resp.status;
          var data = resp.data;
          if (!data.response.error) {
            person.setGptRelatedItems(data.response.most_important_persons, "persons");
            person.setGptRelatedItems(data.response.most_important_organizations, "orgs");
          }
          usageInfo = data.usage_info;
        } catch (error) {
          _this25.errorLogger(error);
        }
      })["catch"](function (error) {
        _this25.errorLogger(error);
        httpRespStatusCode = -2;
      })["finally"](function () {
        stopWatch.stop();
        person.setPerformanceMetric("mediaPyGpt", "mostImportantEntities", httpRespStatusCode, stopWatch.getElapsedMilliseconds(), usageInfo);
        _this25.infoLogger("Finish load and set person GPT most important entities for person with full name = '" + person.getFullName() + "'. Time: " + stopWatch.getElapsedMilliseconds() + " ms");
        deferred.resolve(person);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.loadAndSetPersonGptOverallSummary$ = function loadAndSetPersonGptOverallSummary$(person) {
    var _this26 = this;
    var deferred = this.$q.defer();
    try {
      var _this$mediaPyGptAdapt11;
      this.infoLogger("Start load and set person GPT overall summary for person with full name = '" + person.getFullName() + "'...");
      var stopWatch = new StopWatch(undefined);
      stopWatch.start();
      var httpRespStatusCode = -1;
      var usageInfo = null;
      (_this$mediaPyGptAdapt11 = this.mediaPyGptAdapter) == null || _this$mediaPyGptAdapt11.sendMediaPyGptOverallPersonSummaryRequest$(person).then(function (resp) {
        try {
          httpRespStatusCode = resp.status;
          var data = resp.data;
          if (!data.response.error) {
            person.setGptOverallSummary(data.response.overall_summary);
            person.setGptOverallOccupation(data.response.occupation);
            person.setGptOverallAge(data.response.age);
            person.setGptOverallLocation(data.response.location);
          }
          usageInfo = data.usage_info;
        } catch (error) {
          _this26.errorLogger(error);
        }
      })["catch"](function (error) {
        _this26.errorLogger(error);
        httpRespStatusCode = -2;
      })["finally"](function () {
        stopWatch.stop();
        person.setPerformanceMetric("mediaPyGpt", "overallSummary", httpRespStatusCode, stopWatch.getElapsedMilliseconds(), usageInfo);
        _this26.infoLogger("Finish load and set person GPT overall summary for person with full name = '" + person.getFullName() + "'. Time: " + stopWatch.getElapsedMilliseconds() + " ms");
        deferred.resolve(person);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.loadAndSetPersonGeneralNegativeContextAnalysis$ = function loadAndSetPersonGeneralNegativeContextAnalysis$(person) {
    var _this27 = this;
    var deferred = this.$q.defer();
    try {
      var _this$mediaPyGptAdapt12;
      this.infoLogger("Start load and set person GPT general negative context analysis for person with full name = '" + person.getFullName() + "'...");
      var stopWatch = new StopWatch(undefined);
      stopWatch.start();
      var httpRespStatusCode = -1;
      var usageInfo = null;
      (_this$mediaPyGptAdapt12 = this.mediaPyGptAdapter) == null || _this$mediaPyGptAdapt12.sendMediaPyGptGeneralNegativeContextAnalysisRequest$(person).then(function (resp) {
        try {
          httpRespStatusCode = resp.status;
          var data = resp.data;
          if (!data.response.error) {
            person.setGptAllegations(data.response.allegations);
            person.setGptEvidence(data.response.evidence);
            person.setGptPotentialRisks(data.response.potential_risks);
            person.setGptMitigationFactors(data.response.mitigation_factors);
            person.setGptConclusion(data.response.conclusion);
          }
          usageInfo = data.usage_info;
        } catch (error) {
          _this27.errorLogger(error);
        }
      })["catch"](function (error) {
        _this27.errorLogger(error);
        httpRespStatusCode = -2;
      })["finally"](function () {
        stopWatch.stop();
        person.setPerformanceMetric("mediaPyGpt", "negativeContextAnalysis", httpRespStatusCode, stopWatch.getElapsedMilliseconds(), usageInfo);
        _this27.infoLogger("Finish load and set person GPT general negative context analysis for person with full name = '" + person.getFullName() + "'. Time: " + stopWatch.getElapsedMilliseconds() + " ms");
        deferred.resolve(person);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.loadAndSetPersonGptChainGeneralRiskAssessment$ = function loadAndSetPersonGptChainGeneralRiskAssessment$(person) {
    var _this28 = this;
    var deferred = this.$q.defer();
    try {
      var _this$mediaPyGptAdapt13;
      this.infoLogger("Start load and set person GPT chain general risk assessment for person with full name = '" + person.getFullName() + "'...");
      var stopWatch = new StopWatch(undefined);
      stopWatch.start();
      var httpRespStatusCode = -1;
      var usageInfo = null;
      (_this$mediaPyGptAdapt13 = this.mediaPyGptAdapter) == null || _this$mediaPyGptAdapt13.sendMediaPyGptChainGeneralRiskAssessmentRequest$(person).then(function (resp) {
        try {
          httpRespStatusCode = resp.status;
          var data = resp.data;
          if (!data.response.error) {
            person.setGptAllegations(data.response.allegations);
            person.setGptEvidence(data.response.evidence);
            person.setGptPotentialRisks(data.response.potential_risks);
            person.setGptMitigationFactors(data.response.mitigation_factors);
            person.setGptRiskScore(data.response.score);
            person.setGptRiskExplanation(data.response.explanation);
            person.setGptConclusion(data.response.conclusion);
          }
          usageInfo = data.usage_info;
        } catch (error) {
          _this28.errorLogger(error);
        }
      })["catch"](function (error) {
        _this28.errorLogger(error);
        httpRespStatusCode = -2;
      })["finally"](function () {
        stopWatch.stop();
        person.setPerformanceMetric("mediaPyGpt", "chainGeneralRiskAssessment", httpRespStatusCode, stopWatch.getElapsedMilliseconds(), usageInfo);
        _this28.infoLogger("Finish load and set person GPT chain general risk assessment for person with full name = '" + person.getFullName() + "'. Time: " + stopWatch.getElapsedMilliseconds() + " ms");
        deferred.resolve(person);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.loadAndSetPersonGptMostImportantKeywords$ = function loadAndSetPersonGptMostImportantKeywords$(person) {
    var _this29 = this;
    var deferred = this.$q.defer();
    try {
      var _this$mediaPyGptAdapt14;
      this.infoLogger("Start load and set person GPT most important keywords for person with full name = '" + person.getFullName() + "'...");
      var stopWatch = new StopWatch(undefined);
      stopWatch.start();
      var httpRespStatusCode = -1;
      var usageInfo = null;
      (_this$mediaPyGptAdapt14 = this.mediaPyGptAdapter) == null || _this$mediaPyGptAdapt14.sendMediaPyGptMostImportantKeywordsRequest$(person).then(function (resp) {
        try {
          httpRespStatusCode = resp.status;
          var data = resp.data;
          if (!data.response.error) {
            person.setGptMostImportantkeywords(data.response.keywords);
          }
          usageInfo = data.usage_info;
        } catch (error) {
          _this29.errorLogger(error);
        }
      })["catch"](function (error) {
        _this29.errorLogger(error);
        httpRespStatusCode = -2;
      })["finally"](function () {
        stopWatch.stop();
        person.setPerformanceMetric("mediaPyGpt", "mostImportantKeywords", httpRespStatusCode, stopWatch.getElapsedMilliseconds(), usageInfo);
        _this29.infoLogger("Finish load and set person GPT most important keywords for person with full name = '" + person.getFullName() + "'. Time: " + stopWatch.getElapsedMilliseconds() + " ms");
        deferred.resolve(person);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.loadAndSetPersonLLMPersonProfiling$ = function loadAndSetPersonLLMPersonProfiling$(person) {
    var _this30 = this;
    var deferred = this.$q.defer();
    try {
      var _this$mediaPyLLMAdapt2;
      this.infoLogger("Start load and set LLM person profiling information for person with full name = '" + person.getFullName() + "'...");
      var stopWatch = new StopWatch(undefined);
      stopWatch.start();
      var httpRespStatusCode = -1;
      (_this$mediaPyLLMAdapt2 = this.mediaPyLLMAdapter) == null || _this$mediaPyLLMAdapt2.sendMediaPyLLMPersonProfilingRequest$(person).then(function (resp) {
        try {
          httpRespStatusCode = resp.status;
          var data = resp.data;
          person.setLLMOccupation(data.occupation);
          person.setLLMAge(data.age);
          person.setLLMLocation(data.location);
          person.setLLMOtherDetails(data.other_details);
        } catch (error) {
          _this30.errorLogger(error);
        }
      })["catch"](function (error) {
        _this30.errorLogger(error);
        httpRespStatusCode = -2;
      })["finally"](function () {
        stopWatch.stop();
        person.setPerformanceMetric("mediaPyLLM", "personProfiling", httpRespStatusCode, stopWatch.getElapsedMilliseconds(), null);
        _this30.infoLogger("Finish load and set LLM person profiling information for person with full name = '" + person.getFullName() + "'. Time: " + stopWatch.getElapsedMilliseconds() + " ms");
        deferred.resolve(person);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.loadAndSetPersonLLMAllegationsProfiling$ = function loadAndSetPersonLLMAllegationsProfiling$(person) {
    var _this31 = this;
    var deferred = this.$q.defer();
    try {
      var _this$mediaPyLLMAdapt3;
      this.infoLogger("Start load and set LLM allegations profiling information for person with full name = '" + person.getFullName() + "'...");
      var stopWatch = new StopWatch(undefined);
      stopWatch.start();
      var httpRespStatusCode = -1;
      (_this$mediaPyLLMAdapt3 = this.mediaPyLLMAdapter) == null || _this$mediaPyLLMAdapt3.sendMediaPyLLMAllegationsProfilingRequest$(person).then(function (resp) {
        try {
          httpRespStatusCode = resp.status;
          var data = resp.data;
          person.setLLMSummary(data.summary);
          person.setLLMEvidence(data.evidence);
          person.setLLMRisks(data.risks);
          person.setLLMConclusion(data.conclusion);
        } catch (error) {
          _this31.errorLogger(error);
        }
      })["catch"](function (error) {
        _this31.errorLogger(error);
        httpRespStatusCode = -2;
      })["finally"](function () {
        stopWatch.stop();
        person.setPerformanceMetric("mediaPyLLM", "allegationsProfiling", httpRespStatusCode, stopWatch.getElapsedMilliseconds(), null);
        _this31.infoLogger("Finish load and set LLM allegations profiling information for person with full name = '" + person.getFullName() + "'. Time: " + stopWatch.getElapsedMilliseconds() + " ms");
        deferred.resolve(person);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.loadAndSetPersonGptInformation$ = function loadAndSetPersonGptInformation$(person, callback) {
    var _this32 = this;
    var deferred = this.$q.defer();
    try {
      this.infoLogger("Start load and set person GPT information for person with full name = '" + person.getFullName() + "'...");
      var stopWatch = new StopWatch(undefined);
      stopWatch.start();
      var batchPromisesArray = [this.loadAndSetPersonGptMostImportantEntities$(person), this.loadAndSetPersonGptOverallSummary$(person), this.loadAndSetPersonGeneralNegativeContextAnalysis$(person), this.loadAndSetPersonGptChainGeneralRiskAssessment$(person), this.loadAndSetPersonGptMostImportantKeywords$(person)];
      this.batchPromisesWrapper(batchPromisesArray).then(function () {})["catch"](function (error) {
        _this32.errorLogger(error);
      })["finally"](function () {
        try {
          person.setGptRelatedTopics();
        } catch (error) {
          _this32.errorLogger(error);
        }
        stopWatch.stop();
        _this32.infoLogger("Finish load and set person GPT information for person with full name = '" + person.getFullName() + "'. Time: " + stopWatch.getElapsedMilliseconds() + " ms");
        callback([person]);
        deferred.resolve(person);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.loadAndSetPersonLLMInformation$ = function loadAndSetPersonLLMInformation$(person, callback) {
    var _this33 = this;
    var deferred = this.$q.defer();
    try {
      this.infoLogger("Start load and set person LLM information for person with full name = '" + person.getFullName() + "'...");
      var stopWatch = new StopWatch(undefined);
      stopWatch.start();
      var batchPromisesArray = [this.loadAndSetPersonLLMPersonProfiling$(person), this.loadAndSetPersonLLMAllegationsProfiling$(person)];
      this.batchPromisesWrapper(batchPromisesArray).then(function () {})["catch"](function (error) {
        _this33.errorLogger(error);
      })["finally"](function () {
        stopWatch.stop();
        person.setPerformanceMetric("mediaPyLLM", "total", -1, stopWatch.getElapsedMilliseconds(), null);
        _this33.infoLogger("Finish load and set person LLM information for person with full name = '" + person.getFullName() + "'. Time: " + stopWatch.getElapsedMilliseconds() + " ms");
        callback([person]);
        deferred.resolve(person);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.loadAndSetPersonGptMatching$ = function loadAndSetPersonGptMatching$(person, callback) {
    var _this34 = this;
    var deferred = this.$q.defer();
    try {
      this.infoLogger("Start load and set person GPT matching for person with full name = '" + person.getFullName() + "'...");
      var stopWatch = new StopWatch(undefined);
      stopWatch.start();
      var batchPromisesArray = person.getTopGptRiskResults().map(function (searchResult) {
        return _this34.loadAndSetGptPersonMatching$(searchResult, person.getGptOverallSummary());
      });
      this.batchPromisesWrapper(batchPromisesArray).then(function () {})["catch"](function (error) {
        _this34.errorLogger(error);
      })["finally"](function () {
        stopWatch.stop();
        person.setPerformanceMetric("mediaPyGpt", "personMatching", -1, stopWatch.getElapsedMilliseconds(), null);
        _this34.infoLogger("Finish load and set person GPT matching for person with full name = '" + person.getFullName() + "'. Time: " + stopWatch.getElapsedMilliseconds() + " ms");
        callback([person]);
        deferred.resolve(person);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.loadDocument$ = function loadDocument$(searchResult, mandatoryKeywords, requestObject, idx, totalResultsCount) {
    var _this35 = this;
    var deferred = this.$q.defer();
    try {
      this.logStartLoadResult(requestObject, searchResult.getLinkUrl(), idx, totalResultsCount);
      this.loadAndSetDocumentHtml$(searchResult).then(function () {})["catch"](function (error) {
        _this35.errorLogger(error);
      })["finally"](function () {
        searchResult.incTryLoadCounter();
        if (!searchResult.checkIsContentHtmlLoaded()) {
          deferred.resolve(searchResult);
        } else {
          _this35.loadAndSetCleanHtml$(searchResult).then(function () {})["catch"](function (error) {
            _this35.errorLogger(error);
          })["finally"](function () {
            try {
              if (!searchResult.checkIsFromExtraSource() && !searchResult.checkIsFromAlephOccrp() && !searchResult.checkIsFromOpenSanctions() && !searchResult.checkIsFromOpenCorporates()) {
                var _this35$riskScoreCoun;
                (_this35$riskScoreCoun = _this35.riskScoreCountAdapter) == null || _this35$riskScoreCoun.countRiskScore(searchResult);
              }
            } catch (error) {
              _this35.errorLogger(error);
            }
            _this35.loadAndSetTextInfo$(searchResult, mandatoryKeywords).then(function () {})["catch"](function (error) {
              _this35.errorLogger(error);
            })["finally"](function () {
              try {
                if (!searchResult.checkIsFromExtraSource() && !searchResult.checkIsFromAlephOccrp() && !searchResult.checkIsFromOpenSanctions() && !searchResult.checkIsFromOpenCorporates()) {
                  searchResult.setTotalSentimentRiskScore();
                }
              } catch (error) {
                _this35.errorLogger(error);
              }
              _this35.logFinishLoadResult(requestObject, searchResult.getLinkUrl(), idx, totalResultsCount);
              deferred.resolve(searchResult);
            });
          });
        }
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.loadDocumentHtmlFromUrl$ = function loadDocumentHtmlFromUrl$(linkUrl, type) {
    var _this36 = this;
    var deferred = this.$q.defer();
    try {
      this.infoLogger("Start load HTML from URL = '" + linkUrl + "'...");
      var docHtml = "";
      var getDocument$ = null;
      if (type === GOOGLE_SEARCH_SOURCE_CODE || type === GOOGLE_NEWS_SOURCE_CODE || type === STOCK_MARKETS_SOURCE_CODE) {
        var _this$scrapeAdapter8;
        getDocument$ = (_this$scrapeAdapter8 = this.scrapeAdapter) == null ? void 0 : _this$scrapeAdapter8.getDocumentHtmlFromUrl$(linkUrl);
      } else if (type === EXTRA_SOURCE_SOURCE_CODE) {
        var _this$scrapeAdapter9;
        getDocument$ = (_this$scrapeAdapter9 = this.scrapeAdapter) == null ? void 0 : _this$scrapeAdapter9.getExtraSourceDocumentHtmlFromUrl$(linkUrl);
      } else if (type === ALEPH_OCCRP_SOURCE_CODE) {
        var _this$scrapeAdapter10;
        getDocument$ = (_this$scrapeAdapter10 = this.scrapeAdapter) == null ? void 0 : _this$scrapeAdapter10.getAlephOccrpDocumentHtmlFromUrl$(linkUrl);
      } else if (type === OPEN_SANCTIONS_SOURCE_CODE) {
        var _this$scrapeAdapter11;
        getDocument$ = (_this$scrapeAdapter11 = this.scrapeAdapter) == null ? void 0 : _this$scrapeAdapter11.getOpenSanctionsDocumentHtmlFromUrl$(linkUrl);
      } else {
        var _this$scrapeAdapter12;
        getDocument$ = (_this$scrapeAdapter12 = this.scrapeAdapter) == null ? void 0 : _this$scrapeAdapter12.getOpenCorporatesDocumentHtmlFromUrl$(linkUrl);
      }
      getDocument$.then(function (resp) {
        docHtml = resp.data.data;
      })["catch"](function (error) {
        _this36.errorLogger(error);
      })["finally"](function () {
        _this36.infoLogger("Finish load HTML from URL = '" + linkUrl + "'");
        deferred.resolve(docHtml);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.loadCleanHtmlFromData$ = function loadCleanHtmlFromData$(data) {
    var _this37 = this;
    var deferred = this.$q.defer();
    try {
      var _this$mediaPyAdapter10;
      var clearHtmlData = {};
      (_this$mediaPyAdapter10 = this.mediaPyAdapter) == null || _this$mediaPyAdapter10.getMediaPyCleanHtmlFromData$(data).then(function (resp) {
        clearHtmlData = resp.data;
      })["catch"](function (error) {
        _this37.errorLogger(error);
      })["finally"](function () {
        var contentHtml = "";
        var contentElementText;
        try {
          var _this37$documentServi;
          contentHtml = clearHtmlData.html && clearHtmlData.html.length ? clearHtmlData.html : data.html;
          var contentEl = (_this37$documentServi = _this37.documentService) == null ? void 0 : _this37$documentServi.createElementFromHtml(contentHtml, data.url, data.type);
          if (clearHtmlData.text) {
            contentElementText = clearHtmlData.text;
          } else {
            var _this37$documentServi2, _this37$documentServi3;
            contentElementText = (_this37$documentServi2 = _this37.documentService) == null ? void 0 : _this37$documentServi2.getInnerText((_this37$documentServi3 = _this37.documentService) == null ? void 0 : _this37$documentServi3.removeStyles(contentEl));
          }
        } catch (error) {
          _this37.errorLogger(error);
        }
        deferred.resolve({
          html: contentHtml,
          text: contentElementText || "",
          language: clearHtmlData.language
        });
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.getMarkupHtmlFromData$ = function getMarkupHtmlFromData$(data) {
    var _this38 = this;
    var deferred = this.$q.defer();
    try {
      var _this$mediaPyAdapter11;
      var markupHtml = "";
      (_this$mediaPyAdapter11 = this.mediaPyAdapter) == null || _this$mediaPyAdapter11.getMediaPyMarkupHtmlFromData$(data).then(function (resp) {
        markupHtml = resp.data.html;
      })["catch"](function (error) {
        _this38.errorLogger(error);
      })["finally"](function () {
        deferred.resolve(markupHtml);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.getWordCloudFromData$ = function getWordCloudFromData$(data) {
    var _this39 = this;
    var deferred = this.$q.defer();
    try {
      var _this$mediaPyAdapter12;
      var wordCloud = "";
      (_this$mediaPyAdapter12 = this.mediaPyAdapter) == null || _this$mediaPyAdapter12.getMediaPyWordCloudFromData$(data).then(function (resp) {
        wordCloud = resp.data.img;
      })["catch"](function (error) {
        _this39.errorLogger(error);
      })["finally"](function () {
        deferred.resolve(wordCloud);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.getConnectionsGraph$ = function getConnectionsGraph$(graphSearchResults) {
    var _this40 = this;
    var deferred = this.$q.defer();
    try {
      var _this$mediaPyAdapter13;
      this.infoLogger("Start load connections graph...");
      var connectionsGraphInfo = {
        graph: {
          edges: [],
          vertices: []
        }
      };
      (_this$mediaPyAdapter13 = this.mediaPyAdapter) == null || _this$mediaPyAdapter13.getMediaPyConnectionsGraph$(graphSearchResults).then(function (resp) {
        connectionsGraphInfo = resp.data;
      })["catch"](function (error) {
        _this40.errorLogger(error);
      })["finally"](function () {
        _this40.infoLogger("Finish load connections graph");
        deferred.resolve(connectionsGraphInfo);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.getGptConnectionsGraph$ = function getGptConnectionsGraph$(graphSearchResults) {
    var _this41 = this;
    var deferred = this.$q.defer();
    try {
      var _this$mediaPyGptAdapt15;
      this.infoLogger("Start load GPT connections graph...");
      var connectionsGraphInfo = {
        graph: {
          edges: [],
          vertices: []
        }
      };
      (_this$mediaPyGptAdapt15 = this.mediaPyGptAdapter) == null || _this$mediaPyGptAdapt15.sendMediaPyGptConnectionsGraphRequest$(graphSearchResults).then(function (resp) {
        var data = resp.data;
        if (!data.response.error) {
          connectionsGraphInfo = data.response;
        }
      })["catch"](function (error) {
        _this41.errorLogger(error);
      })["finally"](function () {
        _this41.infoLogger("Finish load GPT connections graph");
        deferred.resolve(connectionsGraphInfo);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.getCommentClearHtml$ = function getCommentClearHtml$(contentHtml, type) {
    var clearHtml$ = null;
    if (type === EXTRA_SOURCE_SOURCE_CODE) {
      clearHtml$ = this.promiseWrapper({
        data: {
          html: contentHtml,
          text: ""
        }
      });
    } else {
      var _this$mediaPyAdapter14;
      clearHtml$ = (_this$mediaPyAdapter14 = this.mediaPyAdapter) == null ? void 0 : _this$mediaPyAdapter14.getCommentMediaPyClearHtml$(contentHtml);
    }
    return clearHtml$;
  };
  _proto.getCommentMarkupHtml$ = function getCommentMarkupHtml$(contentEl, personFullName, scoreMode, type) {
    var markupHtml$ = null;
    if (type === EXTRA_SOURCE_SOURCE_CODE) {
      markupHtml$ = this.promiseWrapper({
        data: {
          html: undefined
        }
      });
    } else {
      var _this$mediaPyAdapter15;
      markupHtml$ = (_this$mediaPyAdapter15 = this.mediaPyAdapter) == null ? void 0 : _this$mediaPyAdapter15.getCommentMarkupHtml$(contentEl, personFullName, scoreMode);
    }
    return markupHtml$;
  };
  _proto.getCommentNamedEntities$ = function getCommentNamedEntities$(contentElementText) {
    var _this$mediaPyAdapter16, _this$googleNlpAdapte2;
    var namedEntities$ = this.USE_MEDIA_SEARCH_PY ? (_this$mediaPyAdapter16 = this.mediaPyAdapter) == null ? void 0 : _this$mediaPyAdapter16.getCommentMediaPyNamedEntities$(contentElementText) : (_this$googleNlpAdapte2 = this.googleNlpAdapter) == null ? void 0 : _this$googleNlpAdapte2.getCommentGoogleNlpNamedEntities$(contentElementText);
    return namedEntities$;
  };
  _proto.initServices = function initServices(endpointsConfig) {
    this.documentService = DocumentServiceInstance.getService();
    this.documentService.setUrls(endpointsConfig);
    this.highlightService = HighlightServiceInstance.getService();
    this.highlightService.initServices(endpointsConfig);
  };
  _proto.injectServices = function injectServices(documentService, highlightService) {
    this.documentService = documentService;
    this.highlightService = highlightService;
  };
  _proto.initAdapters = function initAdapters(endpointsConfig) {
    this.scrapeAdapter = ScrapeAdapterInstance.getNewAdapter(this.$rootScope, this.$http, this.$q, this.$timeout);
    this.scrapeAdapter.initServices(endpointsConfig);
    this.mediaPyAdapter = MediaPyAdapterInstance.getNewAdapter(this.$rootScope, this.$http, this.$q, this.$timeout);
    this.mediaPyAdapter.initServices(endpointsConfig);
    this.mediaPyGptAdapter = MediaPyGptAdapterInstance.getNewAdapter(this.$rootScope, this.$http, this.$q, this.$timeout);
    this.mediaPyGptAdapter.initServices(endpointsConfig);
    this.mediaPyLLMAdapter = MediaPyLLMAdapterInstance.getNewAdapter(this.$rootScope, this.$http, this.$q, this.$timeout);
    this.mediaPyLLMAdapter.initServices(endpointsConfig);
    this.googleNlpAdapter = GoogleNlpAdapterInstance.getNewAdapter(this.$rootScope, this.$http, this.$q, this.$timeout);
    this.googleNlpAdapter.initServices(endpointsConfig);
    this.riskScoreCountAdapter = RiskScoringAdapterInstance.getNewAdapter();
  };
  _proto.resetAdapter = function resetAdapter() {
    var _this$scrapeAdapter13, _this$mediaPyAdapter17, _this$mediaPyGptAdapt16, _this$mediaPyLLMAdapt4, _this$googleNlpAdapte3;
    (_this$scrapeAdapter13 = this.scrapeAdapter) == null || _this$scrapeAdapter13.resetAdapter();
    (_this$mediaPyAdapter17 = this.mediaPyAdapter) == null || _this$mediaPyAdapter17.resetAdapter();
    (_this$mediaPyGptAdapt16 = this.mediaPyGptAdapter) == null || _this$mediaPyGptAdapt16.resetAdapter();
    (_this$mediaPyLLMAdapt4 = this.mediaPyLLMAdapter) == null || _this$mediaPyLLMAdapt4.resetAdapter();
    (_this$googleNlpAdapte3 = this.googleNlpAdapter) == null || _this$googleNlpAdapte3.resetAdapter();
  };
  _proto.injectAdapters = function injectAdapters(scrapeAdapter, mediaPyAdapter, mediaPyGptAdapter, mediaPyLLMAdapter, googleNlpAdapter, riskScoreCountAdapter) {
    this.scrapeAdapter = scrapeAdapter;
    this.mediaPyAdapter = mediaPyAdapter;
    this.mediaPyGptAdapter = mediaPyGptAdapter;
    this.mediaPyLLMAdapter = mediaPyLLMAdapter;
    this.googleNlpAdapter = googleNlpAdapter;
    this.riskScoreCountAdapter = riskScoreCountAdapter;
  };
  _proto.setLoggers = function setLoggers(errorLogger, infoLogger) {
    var _this$scrapeAdapter14, _this$mediaPyAdapter18, _this$mediaPyGptAdapt17, _this$mediaPyLLMAdapt5, _this$googleNlpAdapte4;
    this.errorLogger = errorLogger;
    this.infoLogger = infoLogger;
    (_this$scrapeAdapter14 = this.scrapeAdapter) == null || _this$scrapeAdapter14.setLoggers(errorLogger, infoLogger);
    (_this$mediaPyAdapter18 = this.mediaPyAdapter) == null || _this$mediaPyAdapter18.setLoggers(errorLogger, infoLogger);
    (_this$mediaPyGptAdapt17 = this.mediaPyGptAdapter) == null || _this$mediaPyGptAdapt17.setLoggers(errorLogger, infoLogger);
    (_this$mediaPyLLMAdapt5 = this.mediaPyLLMAdapter) == null || _this$mediaPyLLMAdapt5.setLoggers(errorLogger, infoLogger);
    (_this$googleNlpAdapte4 = this.googleNlpAdapter) == null || _this$googleNlpAdapte4.setLoggers(errorLogger, infoLogger);
  };
  _proto.setTimeouts = function setTimeouts(timeouts) {
    var _this$scrapeAdapter15, _this$mediaPyAdapter19, _this$mediaPyGptAdapt18, _this$mediaPyLLMAdapt6, _this$googleNlpAdapte5;
    (_this$scrapeAdapter15 = this.scrapeAdapter) == null || _this$scrapeAdapter15.setTimeouts(timeouts);
    (_this$mediaPyAdapter19 = this.mediaPyAdapter) == null || _this$mediaPyAdapter19.setTimeouts(timeouts);
    (_this$mediaPyGptAdapt18 = this.mediaPyGptAdapter) == null || _this$mediaPyGptAdapt18.setTimeouts(timeouts);
    (_this$mediaPyLLMAdapt6 = this.mediaPyLLMAdapter) == null || _this$mediaPyLLMAdapt6.setTimeouts(timeouts);
    (_this$googleNlpAdapte5 = this.googleNlpAdapter) == null || _this$googleNlpAdapte5.setTimeouts(timeouts);
  };
  _proto.setAdapterConstants = function setAdapterConstants(constants) {
    var _this$mediaPyAdapter20, _this$mediaPyGptAdapt19, _this$mediaPyLLMAdapt7, _this$googleNlpAdapte6;
    if (constants) {
      this.USE_MEDIA_SEARCH_PY = constants.use_media_search_py;
      this.USE_MEDIA_SEARCH_GPT = constants.use_media_search_gpt;
      this.USE_MEDIA_PY_LLM = constants.use_media_py_llm;
      this.USE_GOOGLE_NLP = constants.use_google_nlp;
    } else {
      this.USE_MEDIA_SEARCH_PY = true;
      this.USE_MEDIA_SEARCH_GPT = true;
      this.USE_MEDIA_PY_LLM = true;
      this.USE_GOOGLE_NLP = true;
    }
    (_this$mediaPyAdapter20 = this.mediaPyAdapter) == null || _this$mediaPyAdapter20.setAdapterConstants(constants);
    (_this$mediaPyGptAdapt19 = this.mediaPyGptAdapter) == null || _this$mediaPyGptAdapt19.setAdapterConstants(constants);
    (_this$mediaPyLLMAdapt7 = this.mediaPyLLMAdapter) == null || _this$mediaPyLLMAdapt7.setAdapterConstants(constants);
    (_this$googleNlpAdapte6 = this.googleNlpAdapter) == null || _this$googleNlpAdapte6.setAdapterConstants(constants);
  };
  _proto.destroy = function destroy() {
    _AdapterV.prototype.destroy.call(this);
    this.documentService = null;
    this.highlightService = null;
    this.scrapeAdapter = null;
    this.mediaPyAdapter = null;
    this.mediaPyGptAdapter = null;
    this.mediaPyLLMAdapter = null;
    this.googleNlpAdapter = null;
    this.riskScoreCountAdapter = null;
  };
  return ProcessingAdapterV1;
}(AdapterV1);
module.exports = {
  ProcessingAdapterV1: ProcessingAdapterV1
};

},{"../../../common/utils/mappers-v4":694,"../../../common/utils/stopwatch":695,"../../../constants/source-types":697,"../../instances/adapters/http":764,"../../instances/adapters/scoring":774,"../../instances/services/utils":809,"../adapter-v1":735}],748:[function(require,module,exports){
"use strict";

var _require = require("./riskscoring-adapter-v1"),
  RiskScoringAdapterV1 = _require.RiskScoringAdapterV1;
module.exports = {
  RiskScoringAdapterV1: RiskScoringAdapterV1
};

},{"./riskscoring-adapter-v1":749}],749:[function(require,module,exports){
"use strict";

var _require = require("../../models/request-configs"),
  SearchEngineRequestConfigV5 = _require.SearchEngineRequestConfigV5;
var _require2 = require("../../instances/services/requests"),
  MediaSearchEngineServiceInstance = _require2.MediaSearchEngineServiceInstance;
var _require3 = require("../../instances/services/scoring"),
  MediaSearchRiskScoringInstance = _require3.MediaSearchRiskScoringInstance;
var _require4 = require("../../instances/services/utils"),
  DocumentServiceInstance = _require4.DocumentServiceInstance;
var RiskScoringAdapterV1 = function () {
  function RiskScoringAdapterV1() {
    this.riskScoreCountService = null;
    this.mediaSearchEngineService = null;
    this.documentService = null;
    this.scoreTypeServices = {};
  }
  var _proto = RiskScoringAdapterV1.prototype;
  _proto.getSearchConfigFromGroupRequests = function getSearchConfigFromGroupRequests(requestObjectId, groupObjectId, scoreMode) {
    var searchConfig = null;
    var scoreTypeService = this.scoreTypeServices[scoreMode];
    if (scoreTypeService) {
      var groupObject = scoreTypeService.groupRequestsConfigService.getById(groupObjectId);
      if (groupObject) {
        var requestObject = groupObject.getById(requestObjectId);
        if (requestObject && requestObject instanceof SearchEngineRequestConfigV5) {
          searchConfig = requestObject.getSearchConfig();
        }
      }
    }
    return searchConfig;
  };
  _proto.getSearchConfigFromSeparateRequests = function getSearchConfigFromSeparateRequests(requestObjectId, scoreMode) {
    var searchConfig = null;
    var scoreTypeService = this.scoreTypeServices[scoreMode];
    if (scoreTypeService) {
      var requestObject = scoreTypeService.separateRequestsConfigService.getById(requestObjectId);
      if (requestObject && requestObject instanceof SearchEngineRequestConfigV5) {
        searchConfig = requestObject.getSearchConfig();
      }
    }
    return searchConfig;
  };
  _proto.countRiskScore = function countRiskScore(searchResult) {
    if (searchResult.checkIsRiskScored()) {
      return;
    }
    if (searchResult.checkIsFromExtraSource() || searchResult.checkIsFromAlephOccrp() || searchResult.checkIsFromOpenSanctions() || searchResult.checkIsFromOpenCorporates()) {
      return;
    }
    if (!searchResult.checkIsContentHtmlLoaded()) {
      return;
    }
    if (!searchResult.getContentHtml()) {
      searchResult.setRiskScore(this.RESULT_NOT_AVAILABLE_RISKSCORE);
    } else {
      var _this$riskScoreCountS, _this$riskScoreCountS2, _this$riskScoreCountS3;
      var contentEl = searchResult.getContentElement();
      if (!contentEl) {
        var _this$documentService;
        contentEl = (_this$documentService = this.documentService) == null ? void 0 : _this$documentService.createElementFromHtml(searchResult.getContentHtml() || "", searchResult.getLinkUrl(), searchResult.getType());
        searchResult.setContentElement(contentEl);
      }
      var contentElementText = searchResult.getContentElementText();
      if (!contentElementText) {
        var _this$documentService2, _this$documentService3;
        contentElementText = (_this$documentService2 = this.documentService) == null ? void 0 : _this$documentService2.getInnerText((_this$documentService3 = this.documentService) == null ? void 0 : _this$documentService3.removeStyles(contentEl));
        searchResult.setContentElementText(contentElementText);
      }
      var searchKeywordsConfigs = [];
      var bannedKeywordsConfigs = [];
      var scoreDecreaseKeywordsConfigs = [];
      if (searchResult.checkIsFromSearchEngine()) {
        var searchConfig = null;
        if (searchResult.getRequestObjectId() && searchResult.getGroupObjectId()) {
          searchConfig = this.getSearchConfigFromGroupRequests(searchResult.getRequestObjectId(), searchResult.getGroupObjectId(), searchResult.getScoreMode());
        } else {
          searchConfig = this.getSearchConfigFromSeparateRequests(searchResult.getRequestObjectId(), searchResult.getScoreMode());
        }
        if (searchConfig) {
          var _this$mediaSearchEngi, _this$mediaSearchEngi2, _this$mediaSearchEngi3;
          searchKeywordsConfigs = ((_this$mediaSearchEngi = this.mediaSearchEngineService) == null ? void 0 : _this$mediaSearchEngi.getAllKeywords(searchConfig)) || [];
          bannedKeywordsConfigs = ((_this$mediaSearchEngi2 = this.mediaSearchEngineService) == null ? void 0 : _this$mediaSearchEngi2.getAllBannedKeywords(searchConfig)) || [];
          scoreDecreaseKeywordsConfigs = ((_this$mediaSearchEngi3 = this.mediaSearchEngineService) == null ? void 0 : _this$mediaSearchEngi3.getAllScoreDecreaseKeywords(searchConfig)) || [];
        }
      } else {
        var _this$mediaSearchEngi4, _this$mediaSearchEngi5, _this$mediaSearchEngi6;
        searchKeywordsConfigs = ((_this$mediaSearchEngi4 = this.mediaSearchEngineService) == null ? void 0 : _this$mediaSearchEngi4.getAllKeywords(null)) || [];
        bannedKeywordsConfigs = ((_this$mediaSearchEngi5 = this.mediaSearchEngineService) == null ? void 0 : _this$mediaSearchEngi5.getAllBannedKeywords(null)) || [];
        scoreDecreaseKeywordsConfigs = ((_this$mediaSearchEngi6 = this.mediaSearchEngineService) == null ? void 0 : _this$mediaSearchEngi6.getAllScoreDecreaseKeywords(null)) || [];
      }
      var totalDocumentRiskScore = (_this$riskScoreCountS = this.riskScoreCountService) == null ? void 0 : _this$riskScoreCountS.countTotalRiskScore(contentElementText || "", searchResult.getPersonFullName(), searchResult.getPersonSynonims(), searchResult.checkIsCompany(), searchResult.getPersonKeywords(), searchKeywordsConfigs, bannedKeywordsConfigs, scoreDecreaseKeywordsConfigs);
      var isPersonNamePresented = (_this$riskScoreCountS2 = this.riskScoreCountService) == null ? void 0 : _this$riskScoreCountS2.checkPersonNamePresented(contentElementText || "", searchResult.getPersonFullName(), searchResult.getPersonSynonims(), searchResult.checkIsCompany());
      var isFullPersonNamePresented = (_this$riskScoreCountS3 = this.riskScoreCountService) == null ? void 0 : _this$riskScoreCountS3.checkFullPersonNamePresented(contentElementText || "", searchResult.getPersonFullName());
      searchResult.setPersonNamePresented(!!isPersonNamePresented);
      if (isPersonNamePresented) {
        searchResult.setTotalRiskScore(totalDocumentRiskScore || 0, !!isFullPersonNamePresented);
      } else {
        searchResult.setRiskScore(this.RESULT_WITHOUT_PERSON_NAME_RISKSCORE);
      }
    }
    searchResult.setRiskScored(true);
  };
  _proto.initServices = function initServices(excludedNameParts) {
    this.riskScoreCountService = MediaSearchRiskScoringInstance.getService();
    this.riskScoreCountService.setExcludedNameParts(excludedNameParts);
    this.mediaSearchEngineService = MediaSearchEngineServiceInstance.getNewService();
    this.documentService = DocumentServiceInstance.getService();
  };
  _proto.injectServices = function injectServices(riskScoreCountService, mediaSearchEngineService, documentService) {
    this.riskScoreCountService = riskScoreCountService;
    this.mediaSearchEngineService = mediaSearchEngineService;
    this.documentService = documentService;
  };
  _proto.injectScoreTypeSerice = function injectScoreTypeSerice(scoreType, scoreTypeService) {
    this.scoreTypeServices[scoreType] = scoreTypeService;
  };
  _proto.setAdapterConstants = function setAdapterConstants(constants) {
    this.RESULT_NOT_AVAILABLE_RISKSCORE = constants.result_not_available_riskscore === undefined ? 0.1 : constants.result_not_available_riskscore;
    this.RESULT_WITHOUT_PERSON_NAME_RISKSCORE = constants.result_without_person_name_riskscore === undefined ? 0.1 : constants.result_without_person_name_riskscore;
  };
  _proto.destroy = function destroy() {
    var _this = this;
    this.riskScoreCountService = null;
    this.mediaSearchEngineService = null;
    this.documentService = null;
    Object.keys(this.scoreTypeServices).forEach(function (key) {
      _this.scoreTypeServices[key] = null;
    });
  };
  return RiskScoringAdapterV1;
}();
module.exports = {
  RiskScoringAdapterV1: RiskScoringAdapterV1
};

},{"../../instances/services/requests":802,"../../instances/services/scoring":805,"../../instances/services/utils":809,"../../models/request-configs":822}],750:[function(require,module,exports){
"use strict";

function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
var _require = require("./search-adapter-v1"),
  SearchAdapterV1 = _require.SearchAdapterV1;
var _require2 = require("../../models/result-items"),
  AlephOccrpResultItemV1 = _require2.AlephOccrpResultItemV1;
var _require3 = require("../../../constants/source-types"),
  ALEPH_OCCRP_TYPE = _require3.ALEPH_OCCRP_TYPE,
  ALEPH_OCCRP_SOURCE_CODE = _require3.ALEPH_OCCRP_SOURCE_CODE;
var _require4 = require("../../instances/adapters/processing"),
  ProcessingAdapterInstance = _require4.ProcessingAdapterInstance;
var _require5 = require("../../instances/services/http"),
  AlephOccrpRequestsServiceInstance = _require5.AlephOccrpRequestsServiceInstance;
var AlephOccrpAdapterV1 = function (_SearchAdapterV) {
  function AlephOccrpAdapterV1($rootScope, $http, $q, $timeout) {
    var _this;
    _this = _SearchAdapterV.call(this, $rootScope, $http, $q, $timeout, ALEPH_OCCRP_TYPE, ALEPH_OCCRP_SOURCE_CODE) || this;
    _this.alephOccrpRequestsService = null;
    return _this;
  }
  _inheritsLoose(AlephOccrpAdapterV1, _SearchAdapterV);
  var _proto = AlephOccrpAdapterV1.prototype;
  _proto.initServices = function initServices(endpointsConfig) {
    this.alephOccrpRequestsService = AlephOccrpRequestsServiceInstance.getNewService(this.$rootScope, this.$http, this.$q, this.$timeout);
    this.alephOccrpRequestsService.setUrls(endpointsConfig);
  };
  _proto.injectServices = function injectServices(alephOccrpRequestsService) {
    this.alephOccrpRequestsService = alephOccrpRequestsService;
  };
  _proto.initAdapters = function initAdapters() {
    this.processingAdapter = ProcessingAdapterInstance.getNewAdapter(this.$rootScope, this.$http, this.$q, this.$timeout);
  };
  _proto.injectAdapters = function injectAdapters(processingAdapter) {
    this.processingAdapter = processingAdapter;
  };
  _proto.resetAdapter = function resetAdapter() {
    var _this$processingAdapt, _this$alephOccrpReque;
    (_this$processingAdapt = this.processingAdapter) == null || _this$processingAdapt.resetAdapter();
    (_this$alephOccrpReque = this.alephOccrpRequestsService) == null || _this$alephOccrpReque.resetRouteWasChanged();
  };
  _proto.setTimeouts = function setTimeouts(timeouts) {
    var _this$alephOccrpReque2;
    (_this$alephOccrpReque2 = this.alephOccrpRequestsService) == null || _this$alephOccrpReque2.setTimeouts(timeouts);
  };
  _proto.setAdapterConstants = function setAdapterConstants(constants) {
    this.setCommonAdapterConstants(constants);
    this.SINGLE_RESULTS_COUNT = constants.single_processing && constants.single_processing.count_of_results ? constants.single_processing.count_of_results : 15;
    this.BATCH_RESULTS_COUNT = constants.batch_processing && constants.batch_processing.count_of_results ? constants.batch_processing.count_of_results : 5;
  };
  _proto.performPersonRequest$ = function performPersonRequest$(parentPerson, personsService, dateFrom, dateTo, isAddWithoutDate, languages, isBatch, scoreMode, requestObject, groupObject, callback) {
    var _this2 = this;
    var deferred = this.$q.defer();
    try {
      var getResults$ = this.getResults$(parentPerson, personsService, dateFrom, dateTo, isAddWithoutDate, languages, isBatch, scoreMode, requestObject, groupObject, callback);
      var loadResults = this.loadPersonResults.bind(this);
      this.processPersonRequest$(parentPerson, isBatch, requestObject, groupObject, getResults$, loadResults, callback).then(function () {})["catch"](function (error) {
        _this2.errorLogger(error);
      })["finally"](function () {
        deferred.resolve(parentPerson);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.getResults$ = function getResults$(parentPerson, personsService, dateFrom, dateTo, isAddWithoutDate, languages, isBatch, scoreMode, requestObject, groupObject, callback) {
    var _this3 = this;
    var deferred = this.$q.defer();
    try {
      var getSinglePersonResults$ = function getSinglePersonResults$(person) {
        return _this3.getSinglePersonResults$(person, dateFrom, dateTo, isAddWithoutDate, languages, scoreMode, requestObject, groupObject);
      };
      this.getAllParentPersonResults$(parentPerson, personsService, getSinglePersonResults$).then(function () {})["catch"](function (error) {
        _this3.errorLogger(error);
      })["finally"](function () {
        deferred.resolve(parentPerson);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.getSinglePersonResults$ = function getSinglePersonResults$(person, dateFrom, dateTo, isAddWithoutDate, languages, scoreMode, requestObject, groupObject) {
    var _this4 = this;
    var deferred = this.$q.defer();
    try {
      var _this$alephOccrpReque3;
      var mappedResults = [];
      var getResultsRequest$ = (_this$alephOccrpReque3 = this.alephOccrpRequestsService) == null ? void 0 : _this$alephOccrpReque3.getAlephOccrpResults$(person.getFullName(), person.getFirstName(), person.getLastName(), person.checkIsCompany(), false, dateFrom, dateTo, languages);
      this.getPersonResults$(getResultsRequest$).then(function (resp) {
        try {
          var results = resp;
          (results[0] || []).forEach(function (personResult) {
            var newAlephOccrpResult = _this4.createResult(personResult, person, requestObject ? requestObject.getId() : null, groupObject ? groupObject.getId() : null, isAddWithoutDate, scoreMode);
            if (newAlephOccrpResult) {
              mappedResults.push(newAlephOccrpResult);
            }
          });
        } catch (error) {
          _this4.errorLogger(error);
        }
      })["catch"](function (error) {
        _this4.errorLogger(error);
      })["finally"](function () {
        deferred.resolve(mappedResults);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.loadPersonResults = function loadPersonResults(parentPerson, isBatch, requestObject, groupObject, callback, successCallback, errorCallback) {
    var _this5 = this;
    try {
      parentPerson.filterLoadedRequestObjectResults(requestObject ? requestObject.getId() : null, this.getAdapterSourceCode());
      var showResultsCount = 0;
      var highRiskScore = 0;
      if (groupObject) {
        showResultsCount = groupObject.getMaxResultsCount();
        highRiskScore = groupObject.getMinRiskScore();
      } else {
        showResultsCount = !isBatch ? this.SINGLE_RESULTS_COUNT : this.BATCH_RESULTS_COUNT;
        highRiskScore = 0;
      }
      var topResults = parentPerson.getResultsForLoad(this.getAdapterSourceCode(), requestObject ? requestObject.getId() : null, groupObject ? groupObject.getId() : null, showResultsCount, highRiskScore, 0, 0);
      parentPerson.setTotalResults();
      if (callback) {
        callback([parentPerson]);
      }
      var batchPromiseArray = [];
      topResults.forEach(function (alephOccrpResult, idx) {
        var _this5$processingAdap;
        batchPromiseArray.push((_this5$processingAdap = _this5.processingAdapter) == null ? void 0 : _this5$processingAdap.loadDocument$(alephOccrpResult, [], requestObject, idx, topResults.length));
      });
      batchPromiseArray = batchPromiseArray.filter(function (p) {
        return p;
      });
      this.logStartLoadResults(parentPerson, requestObject, topResults.length);
      if (batchPromiseArray.length) {
        this.$q.all(batchPromiseArray).then(function () {})["catch"](function (error) {
          _this5.errorLogger(error);
        })["finally"](function () {
          _this5.loadPersonResults(parentPerson, isBatch, requestObject, groupObject, callback, successCallback, errorCallback);
        });
      } else {
        successCallback(parentPerson);
      }
    } catch (error) {
      this.errorLogger(error);
      errorCallback(error);
    }
  };
  _proto.createResult = function createResult(personResult, person, requestObjectId, groupObjectId, isAddWithoutDate, scoreMode) {
    var newAlephOccrpResult = null;
    try {
      if (!personResult.date && !isAddWithoutDate) {
        return newAlephOccrpResult;
      }
      newAlephOccrpResult = new AlephOccrpResultItemV1(personResult.title, personResult.summary, personResult.link, personResult.date, this.getAdapterSourceCode());
      newAlephOccrpResult.setLanguage(personResult.language);
      newAlephOccrpResult.setEntityType(personResult.type);
      newAlephOccrpResult.setExtendedSummary(personResult.summary);
      newAlephOccrpResult.setExtendedSummaryHtml(personResult.summary);
      if (personResult.htmlContent && personResult.htmlContent.length) {
        var _this$processingAdapt2, _this$processingAdapt3;
        newAlephOccrpResult.setContentHtml(personResult.htmlContent);
        var contentElement = (_this$processingAdapt2 = this.processingAdapter) == null ? void 0 : _this$processingAdapt2.createElement(newAlephOccrpResult);
        newAlephOccrpResult.setContentElement(contentElement);
        var contentElementText = (_this$processingAdapt3 = this.processingAdapter) == null ? void 0 : _this$processingAdapt3.getElementText(newAlephOccrpResult);
        newAlephOccrpResult.setContentElementText(contentElementText);
        newAlephOccrpResult.setHtmlCleared(true);
      }
      newAlephOccrpResult.setPersonInfo(person);
      newAlephOccrpResult.setExtendedPersonInfo(person.getExtendedInfo());
      newAlephOccrpResult.setItemInfo(person.getItemId());
      newAlephOccrpResult.setGroupInfo(requestObjectId, groupObjectId);
      newAlephOccrpResult.setScoreMode(scoreMode);
      newAlephOccrpResult.setRiskScore(personResult.riskscore || 0.5);
      newAlephOccrpResult.setRiskScored(true);
      newAlephOccrpResult.setMediaPyRiskScore(personResult.riskscore || 0.5);
      newAlephOccrpResult.setMediaPyRiskScored(true);
      newAlephOccrpResult.setMediaPyRiskScoreColor(personResult.riskscore || 0.5, false);
      newAlephOccrpResult.setSentiment(0);
      newAlephOccrpResult.setSentimentLoaded(true);
      newAlephOccrpResult.setMediaPyTitleRiskScore(0);
      newAlephOccrpResult.setMediaPyTitleRiskScoreColor(0, false);
      newAlephOccrpResult.setMediaPyNameImportance(0);
      newAlephOccrpResult.setMediaPyNameImportanceColor(0, false);
      newAlephOccrpResult.setKeywordsHighlighted(true);
    } catch (error) {
      this.errorLogger(error);
    }
    return newAlephOccrpResult;
  };
  _proto.destroy = function destroy() {
    _SearchAdapterV.prototype.destroy.call(this);
    this.alephOccrpRequestsService = null;
  };
  return AlephOccrpAdapterV1;
}(SearchAdapterV1);
module.exports = {
  AlephOccrpAdapterV1: AlephOccrpAdapterV1
};

},{"../../../constants/source-types":697,"../../instances/adapters/processing":772,"../../instances/services/http":790,"../../models/result-items":842,"./search-adapter-v1":756}],751:[function(require,module,exports){
"use strict";

function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
var _require = require("../../../common/utils/mappers-v4"),
  mapEntityName = _require.mapEntityName;
var _require2 = require("./search-adapter-v1"),
  SearchAdapterV1 = _require2.SearchAdapterV1;
var _require3 = require("../../models/result-items"),
  ExtraSourceResultItemV1 = _require3.ExtraSourceResultItemV1;
var _require4 = require("../../../constants/source-types"),
  EXTRA_SOURCES_TYPE = _require4.EXTRA_SOURCES_TYPE,
  EXTRA_SOURCE_SOURCE_CODE = _require4.EXTRA_SOURCE_SOURCE_CODE;
var _require5 = require("../../instances/adapters/processing"),
  ProcessingAdapterInstance = _require5.ProcessingAdapterInstance;
var _require6 = require("../../instances/services/http"),
  ExtraSourcesRequestsServiceInstance = _require6.ExtraSourcesRequestsServiceInstance;
var ExtraSourcesAdapterV1 = function (_SearchAdapterV) {
  function ExtraSourcesAdapterV1($rootScope, $http, $q, $timeout) {
    var _this;
    _this = _SearchAdapterV.call(this, $rootScope, $http, $q, $timeout, EXTRA_SOURCES_TYPE, EXTRA_SOURCE_SOURCE_CODE) || this;
    _this.extraSourcesRequestsService = null;
    return _this;
  }
  _inheritsLoose(ExtraSourcesAdapterV1, _SearchAdapterV);
  var _proto = ExtraSourcesAdapterV1.prototype;
  _proto.initServices = function initServices(endpointsConfig) {
    this.extraSourcesRequestsService = ExtraSourcesRequestsServiceInstance.getNewService(this.$rootScope, this.$http, this.$q, this.$timeout);
    this.extraSourcesRequestsService.setUrls(endpointsConfig);
  };
  _proto.injectServices = function injectServices(extraSourcesRequestsService) {
    this.extraSourcesRequestsService = extraSourcesRequestsService;
  };
  _proto.initAdapters = function initAdapters() {
    this.processingAdapter = ProcessingAdapterInstance.getNewAdapter(this.$rootScope, this.$http, this.$q, this.$timeout);
  };
  _proto.injectAdapters = function injectAdapters(processingAdapter) {
    this.processingAdapter = processingAdapter;
  };
  _proto.resetAdapter = function resetAdapter() {
    var _this$processingAdapt, _this$extraSourcesReq;
    (_this$processingAdapt = this.processingAdapter) == null || _this$processingAdapt.resetAdapter();
    (_this$extraSourcesReq = this.extraSourcesRequestsService) == null || _this$extraSourcesReq.resetRouteWasChanged();
  };
  _proto.setTimeouts = function setTimeouts(timeouts) {
    var _this$extraSourcesReq2;
    (_this$extraSourcesReq2 = this.extraSourcesRequestsService) == null || _this$extraSourcesReq2.setTimeouts(timeouts);
  };
  _proto.setAdapterConstants = function setAdapterConstants(constants) {
    this.setCommonAdapterConstants(constants);
    this.SINGLE_SPECIAL_PARSING = constants.single_processing && constants.single_processing.special_parsing_after_search ? constants.single_processing.special_parsing_after_search : false;
    this.BATCH_SPECIAL_PARSING = constants.batch_processing && constants.batch_processing.special_parsing_after_search ? constants.batch_processing.special_parsing_after_search : false;
  };
  _proto.performPersonRequest$ = function performPersonRequest$(parentPerson, personsService, sites, isBatch, scoreMode, requestObject, groupObject, callback) {
    var _this2 = this;
    var deferred = this.$q.defer();
    try {
      var getResults$ = this.getResults$(parentPerson, personsService, sites, isBatch, scoreMode, requestObject, groupObject, callback);
      var loadResults = this.loadPersonResults.bind(this);
      this.processPersonRequest$(parentPerson, isBatch, requestObject, groupObject, getResults$, loadResults, callback).then(function () {})["catch"](function (error) {
        _this2.errorLogger(error);
      })["finally"](function () {
        deferred.resolve(parentPerson);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.getResults$ = function getResults$(parentPerson, personsService, sites, isBatch, scoreMode, requestObject, groupObject, callback) {
    var _this3 = this;
    var deferred = this.$q.defer();
    try {
      var getSinglePersonResults$ = function getSinglePersonResults$(person) {
        return _this3.getSinglePersonResults$(person, sites, isBatch, scoreMode, requestObject, groupObject);
      };
      this.getAllParentPersonResults$(parentPerson, personsService, getSinglePersonResults$).then(function () {})["catch"](function (error) {
        _this3.errorLogger(error);
      })["finally"](function () {
        deferred.resolve(parentPerson);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.getSinglePersonResults$ = function getSinglePersonResults$(person, sites, isBatch, scoreMode, requestObject, groupObject) {
    var _this4 = this;
    var deferred = this.$q.defer();
    try {
      var _this$extraSourcesReq3;
      var mappedResults = [];
      var getResultsRequest$ = (_this$extraSourcesReq3 = this.extraSourcesRequestsService) == null ? void 0 : _this$extraSourcesReq3.getExtraSearchResults$(person.getFullName(), person.getFirstName(), person.getLastName(), person.checkIsCompany(), isBatch, sites);
      this.getPersonResults$(getResultsRequest$).then(function (resp) {
        try {
          var results = resp;
          (results[0] || []).forEach(function (personResult) {
            if (personResult.error && personResult.error.errorMsg) {
              if (personResult.error.errorType !== "timeout_error") {
                _this4.errorLogger(personResult.error);
              }
            } else {
              var newExtraSourceResult = _this4.createResult(personResult.data, person, requestObject ? requestObject.getId() : null, groupObject ? groupObject.getId() : null, scoreMode);
              if (newExtraSourceResult) {
                mappedResults.push(newExtraSourceResult);
              }
            }
          });
        } catch (error) {
          _this4.errorLogger(error);
        }
      })["catch"](function (error) {
        _this4.errorLogger(error);
      })["finally"](function () {
        deferred.resolve(mappedResults);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.loadPersonResults = function loadPersonResults(parentPerson, isBatch, requestObject, groupObject, callback, successCallback, errorCallback) {
    var _this5 = this;
    try {
      parentPerson.filterLoadedRequestObjectResults(requestObject ? requestObject.getId() : null, this.getAdapterSourceCode());
      var topResults = parentPerson.getResultsForLoad(this.getAdapterSourceCode(), requestObject ? requestObject.getId() : null, groupObject ? groupObject.getId() : null, 0, 0, 0, 0);
      parentPerson.setTotalResults();
      if (callback) {
        callback([parentPerson]);
      }
      var batchPromiseArray = [];
      topResults.forEach(function (extraSourceResult, idx) {
        var _this5$processingAdap;
        batchPromiseArray.push((_this5$processingAdap = _this5.processingAdapter) == null ? void 0 : _this5$processingAdap.loadDocument$(extraSourceResult, [], requestObject, idx, topResults.length));
      });
      batchPromiseArray = batchPromiseArray.filter(function (p) {
        return p;
      });
      this.logStartLoadResults(parentPerson, requestObject, topResults.length);
      if (batchPromiseArray.length) {
        this.$q.all(batchPromiseArray).then(function () {})["catch"](function (error) {
          _this5.errorLogger(error);
        })["finally"](function () {
          _this5.loadPersonResults(parentPerson, isBatch, requestObject, groupObject, callback, successCallback, errorCallback);
        });
      } else {
        successCallback(parentPerson);
      }
    } catch (error) {
      this.errorLogger(error);
      errorCallback(error);
    }
  };
  _proto.createResult = function createResult(personResult, person, requestObjectId, groupObjectId, scoreMode) {
    var newExtraSourceResult = null;
    try {
      newExtraSourceResult = new ExtraSourceResultItemV1(person.getFullName() + " (" + personResult.title + ")", personResult.summary, personResult.link, personResult.source, this.getAdapterSourceCode());
      newExtraSourceResult.setLanguage(personResult.language);
      if (personResult.htmlContent && personResult.htmlContent.length) {
        var _this$processingAdapt2, _this$processingAdapt3;
        newExtraSourceResult.setContentHtml(personResult.htmlContent);
        var contentElement = (_this$processingAdapt2 = this.processingAdapter) == null ? void 0 : _this$processingAdapt2.createElement(newExtraSourceResult);
        newExtraSourceResult.setContentElement(contentElement);
        var contentElementText = (_this$processingAdapt3 = this.processingAdapter) == null ? void 0 : _this$processingAdapt3.getElementText(newExtraSourceResult);
        newExtraSourceResult.setContentElementText(contentElementText);
        newExtraSourceResult.setHtmlCleared(true);
      }
      newExtraSourceResult.setPersonInfo(person);
      newExtraSourceResult.setExtendedPersonInfo(person.getExtendedInfo());
      newExtraSourceResult.setItemInfo(person.getItemId());
      newExtraSourceResult.setGroupInfo(requestObjectId, groupObjectId);
      newExtraSourceResult.setScoreMode(scoreMode);
      newExtraSourceResult.setMentionedEntities(personResult.named_entities);
      var entityNames = (personResult.named_entities || []).map(mapEntityName);
      newExtraSourceResult.setEntityNames(entityNames);
      if (entityNames.length) {
        newExtraSourceResult.setEntitiesLoaded(true);
      }
      newExtraSourceResult.setRiskScore(personResult.riskscore || 0.5);
      newExtraSourceResult.setRiskScored(true);
      newExtraSourceResult.setMediaPyRiskScore(personResult.riskscore || 0.5);
      newExtraSourceResult.setMediaPyRiskScored(false);
      newExtraSourceResult.setMediaPyRiskScoreColor(personResult.riskscore || 0.5, false);
      newExtraSourceResult.setSentiment(0);
      newExtraSourceResult.setSentimentLoaded(true);
      newExtraSourceResult.setMediaPyTitleRiskScore(0);
      newExtraSourceResult.setMediaPyTitleRiskScoreColor(0, false);
      newExtraSourceResult.setMediaPyNameImportance(0);
      newExtraSourceResult.setMediaPyNameImportanceColor(0, false);
      newExtraSourceResult.setKeywordsHighlighted(true);
    } catch (error) {
      this.errorLogger(error);
    }
    return newExtraSourceResult;
  };
  _proto.destroy = function destroy() {
    _SearchAdapterV.prototype.destroy.call(this);
    this.extraSourcesRequestsService = null;
  };
  return ExtraSourcesAdapterV1;
}(SearchAdapterV1);
module.exports = {
  ExtraSourcesAdapterV1: ExtraSourcesAdapterV1
};

},{"../../../common/utils/mappers-v4":694,"../../../constants/source-types":697,"../../instances/adapters/processing":772,"../../instances/services/http":790,"../../models/result-items":842,"./search-adapter-v1":756}],752:[function(require,module,exports){
"use strict";

function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
var _require = require("./search-adapter-v1"),
  SearchAdapterV1 = _require.SearchAdapterV1;
var _require2 = require("../../models/result-items"),
  GoogleNewsRssResultItemV1 = _require2.GoogleNewsRssResultItemV1;
var _require3 = require("../../../constants/source-types"),
  GOOGLE_NEWS_TYPE = _require3.GOOGLE_NEWS_TYPE,
  GOOGLE_NEWS_SOURCE_CODE = _require3.GOOGLE_NEWS_SOURCE_CODE;
var _require4 = require("../../instances/adapters/processing"),
  ProcessingAdapterInstance = _require4.ProcessingAdapterInstance;
var _require5 = require("../../instances/services/http"),
  GoogleNewsRequestsServiceInstance = _require5.GoogleNewsRequestsServiceInstance;
var _require6 = require("../../instances/services/requests"),
  MediaSearchEngineServiceInstance = _require6.MediaSearchEngineServiceInstance;
var GoogleNewsAdapterV1 = function (_SearchAdapterV) {
  function GoogleNewsAdapterV1($rootScope, $http, $q, $timeout) {
    var _this;
    _this = _SearchAdapterV.call(this, $rootScope, $http, $q, $timeout, GOOGLE_NEWS_TYPE, GOOGLE_NEWS_SOURCE_CODE) || this;
    _this.googleNewsRssRequestsService = null;
    _this.mediaSearchEngineService = null;
    return _this;
  }
  _inheritsLoose(GoogleNewsAdapterV1, _SearchAdapterV);
  var _proto = GoogleNewsAdapterV1.prototype;
  _proto.initServices = function initServices(endpointsConfig) {
    this.googleNewsRssRequestsService = GoogleNewsRequestsServiceInstance.getNewService(this.$rootScope, this.$http, this.$q, this.$timeout);
    this.googleNewsRssRequestsService.setUrls(endpointsConfig);
    this.mediaSearchEngineService = MediaSearchEngineServiceInstance.getNewService();
  };
  _proto.injectServices = function injectServices(googleNewsRssRequestsService, mediaSearchEngineService) {
    this.googleNewsRssRequestsService = googleNewsRssRequestsService;
    this.mediaSearchEngineService = mediaSearchEngineService;
  };
  _proto.initAdapters = function initAdapters() {
    this.processingAdapter = ProcessingAdapterInstance.getNewAdapter(this.$rootScope, this.$http, this.$q, this.$timeout);
  };
  _proto.injectAdapters = function injectAdapters(processingAdapter) {
    this.processingAdapter = processingAdapter;
  };
  _proto.resetAdapter = function resetAdapter() {
    var _this$processingAdapt, _this$googleNewsRssRe;
    (_this$processingAdapt = this.processingAdapter) == null || _this$processingAdapt.resetAdapter();
    (_this$googleNewsRssRe = this.googleNewsRssRequestsService) == null || _this$googleNewsRssRe.resetRouteWasChanged();
  };
  _proto.setTimeouts = function setTimeouts(timeouts) {
    var _this$googleNewsRssRe2;
    (_this$googleNewsRssRe2 = this.googleNewsRssRequestsService) == null || _this$googleNewsRssRe2.setTimeouts(timeouts);
  };
  _proto.setAdapterConstants = function setAdapterConstants(constants) {
    this.setCommonAdapterConstants(constants);
    this.SINGLE_RESULTS_COUNT = constants.single_processing && constants.single_processing.count_of_results_for_each_language ? constants.single_processing.count_of_results_for_each_language : 15;
    this.BATCH_RESULTS_COUNT = constants.batch_processing && constants.batch_processing.count_of_results_for_each_language ? constants.batch_processing.count_of_results_for_each_language : 5;
  };
  _proto.performPersonRequest$ = function performPersonRequest$(parentPerson, personsService, dateFrom, dateTo, isAddWithoutDate, languages, isBatch, scoreMode, requestObject, groupObject, callback) {
    var _this2 = this;
    var deferred = this.$q.defer();
    try {
      var getResults$ = this.getResults$(parentPerson, personsService, dateFrom, dateTo, isAddWithoutDate, languages, isBatch, scoreMode, requestObject, groupObject, callback);
      var loadResults = this.loadPersonResults.bind(this);
      this.processPersonRequest$(parentPerson, isBatch, requestObject, groupObject, getResults$, loadResults, callback).then(function () {})["catch"](function (error) {
        _this2.errorLogger(error);
      })["finally"](function () {
        deferred.resolve(parentPerson);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.getResults$ = function getResults$(parentPerson, personsService, dateFrom, dateTo, isAddWithoutDate, languages, isBatch, scoreMode, requestObject, groupObject, callback) {
    var _this3 = this;
    var deferred = this.$q.defer();
    try {
      var getSinglePersonResults$ = function getSinglePersonResults$(person) {
        return _this3.getSinglePersonResults$(person, dateFrom, dateTo, isAddWithoutDate, languages, scoreMode, requestObject, groupObject);
      };
      this.getAllParentPersonResults$(parentPerson, personsService, getSinglePersonResults$).then(function () {})["catch"](function (error) {
        _this3.errorLogger(error);
      })["finally"](function () {
        deferred.resolve(parentPerson);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.getSinglePersonResults$ = function getSinglePersonResults$(person, dateFrom, dateTo, isAddWithoutDate, languages, scoreMode, requestObject, groupObject) {
    var _this4 = this;
    var deferred = this.$q.defer();
    try {
      var _this$googleNewsRssRe3, _this$mediaSearchEngi, _this$mediaSearchEngi2;
      var mappedResults = [];
      var getResultsRequest$ = (_this$googleNewsRssRe3 = this.googleNewsRssRequestsService) == null ? void 0 : _this$googleNewsRssRe3.getGoogleNewsRssResults$(person.getFullName(), person.getFirstName(), person.getLastName(), person.checkIsCompany(), false, dateFrom, dateTo, languages, ((_this$mediaSearchEngi = this.mediaSearchEngineService) == null ? void 0 : _this$mediaSearchEngi.getMandatoryAdditionalKeywords()) || [], ((_this$mediaSearchEngi2 = this.mediaSearchEngineService) == null ? void 0 : _this$mediaSearchEngi2.getOptionalAdditionalKeywords()) || []);
      this.getPersonResults$(getResultsRequest$).then(function (resp) {
        try {
          var results = resp;
          (results[0] || []).forEach(function (personResult) {
            var newGoogleNewsRssResult = _this4.createResult(personResult, person, requestObject ? requestObject.getId() : null, groupObject ? groupObject.getId() : null, isAddWithoutDate, scoreMode);
            if (newGoogleNewsRssResult) {
              mappedResults.push(newGoogleNewsRssResult);
            }
          });
        } catch (error) {
          _this4.errorLogger(error);
        }
      })["catch"](function (error) {
        _this4.errorLogger(error);
      })["finally"](function () {
        deferred.resolve(mappedResults);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.loadPersonResults = function loadPersonResults(parentPerson, isBatch, requestObject, groupObject, callback, successCallback, errorCallback) {
    var _this5 = this;
    try {
      parentPerson.filterLoadedRequestObjectResults(requestObject ? requestObject.getId() : null, this.getAdapterSourceCode());
      var showResultsCount = 0;
      var highRiskScore = 0;
      if (groupObject) {
        showResultsCount = groupObject.getMaxResultsCount();
        highRiskScore = groupObject.getMinRiskScore();
      } else {
        showResultsCount = !isBatch ? this.SINGLE_RESULTS_COUNT : this.BATCH_RESULTS_COUNT;
        highRiskScore = 0;
      }
      var topResults = parentPerson.getResultsForLoad(this.getAdapterSourceCode(), requestObject ? requestObject.getId() : null, groupObject ? groupObject.getId() : null, showResultsCount, highRiskScore, 0, 0);
      parentPerson.setTotalResults();
      if (callback) {
        callback([parentPerson]);
      }
      var batchPromiseArray = [];
      topResults.forEach(function (googleNewsResult, idx) {
        var _this5$processingAdap, _this5$mediaSearchEng;
        batchPromiseArray.push((_this5$processingAdap = _this5.processingAdapter) == null ? void 0 : _this5$processingAdap.loadDocument$(googleNewsResult, ((_this5$mediaSearchEng = _this5.mediaSearchEngineService) == null ? void 0 : _this5$mediaSearchEng.getMandatoryAdditionalKeywords()) || [], requestObject, idx, topResults.length));
      });
      batchPromiseArray = batchPromiseArray.filter(function (p) {
        return p;
      });
      this.logStartLoadResults(parentPerson, requestObject, topResults.length);
      if (batchPromiseArray.length) {
        this.$q.all(batchPromiseArray).then(function () {})["catch"](function (error) {
          _this5.errorLogger(error);
        })["finally"](function () {
          _this5.loadPersonResults(parentPerson, isBatch, requestObject, groupObject, callback, successCallback, errorCallback);
        });
      } else {
        successCallback(parentPerson);
      }
    } catch (error) {
      this.errorLogger(error);
      errorCallback(error);
    }
  };
  _proto.createResult = function createResult(personResult, person, requestObjectId, groupObjectId, isAddWithoutDate, scoreMode) {
    var newGoogleNewsRssResult = null;
    try {
      var _this$mediaSearchEngi3, _this$mediaSearchEngi4, _this$mediaSearchEngi5, _this$mediaSearchEngi6, _this$mediaSearchEngi7;
      if ((_this$mediaSearchEngi3 = this.mediaSearchEngineService) != null && _this$mediaSearchEngi3.checkSiteIsExcluded(personResult.linkUrl || "") || (_this$mediaSearchEngi4 = this.mediaSearchEngineService) != null && _this$mediaSearchEngi4.checkTitleHasBannedKeywords(personResult.title || "") || (_this$mediaSearchEngi5 = this.mediaSearchEngineService) != null && _this$mediaSearchEngi5.checkSummaryHasBannedKeywords(personResult.title || "", personResult.description || "") || (_this$mediaSearchEngi6 = this.mediaSearchEngineService) != null && _this$mediaSearchEngi6.checkTitleOrDescriptionContainsBannedCharacters(personResult.title || "", personResult.description || "")) {
        return newGoogleNewsRssResult;
      }
      if ((personResult.linkUrl || "").endsWith(".xml")) {
        return newGoogleNewsRssResult;
      }
      if (!personResult.date && !isAddWithoutDate) {
        return newGoogleNewsRssResult;
      }
      newGoogleNewsRssResult = new GoogleNewsRssResultItemV1(personResult.title, personResult.summary, personResult.link, personResult.date, this.getAdapterSourceCode());
      newGoogleNewsRssResult.setLanguage(personResult.language);
      if (personResult.htmlContent && personResult.htmlContent.length) {
        newGoogleNewsRssResult.setContentHtml(personResult.htmlContent);
      }
      newGoogleNewsRssResult.setKeywords((((_this$mediaSearchEngi7 = this.mediaSearchEngineService) == null ? void 0 : _this$mediaSearchEngi7.getAllKeywords(null)) || []).map(function (keywordConfig) {
        return keywordConfig.getKeyword();
      }));
      newGoogleNewsRssResult.setPersonInfo(person);
      newGoogleNewsRssResult.setExtendedPersonInfo(person.getExtendedInfo());
      newGoogleNewsRssResult.setItemInfo(person.getItemId());
      newGoogleNewsRssResult.setGroupInfo(requestObjectId, groupObjectId);
      newGoogleNewsRssResult.setScoreMode(scoreMode);
      newGoogleNewsRssResult.setRiskScore(0.5);
      newGoogleNewsRssResult.setRiskScored(false);
      newGoogleNewsRssResult.setMediaPyRiskScore(0.5);
      newGoogleNewsRssResult.setMediaPyRiskScored(false);
      newGoogleNewsRssResult.setMediaPyRiskScoreColor(0.5, false);
      newGoogleNewsRssResult.setSentiment(0);
      newGoogleNewsRssResult.setSentimentLoaded(false);
      newGoogleNewsRssResult.setMediaPyTitleRiskScore(0);
      newGoogleNewsRssResult.setMediaPyTitleRiskScoreColor(0, false);
      newGoogleNewsRssResult.setMediaPyNameImportance(0);
      newGoogleNewsRssResult.setMediaPyNameImportanceColor(0, false);
      var personNameSynonims = newGoogleNewsRssResult.getPersonSynonimsFromSummary();
      if (personNameSynonims.length) {
        newGoogleNewsRssResult.setPersonSynonims(personNameSynonims);
      }
    } catch (error) {
      this.errorLogger(error);
    }
    return newGoogleNewsRssResult;
  };
  _proto.destroy = function destroy() {
    _SearchAdapterV.prototype.destroy.call(this);
    this.googleNewsRssRequestsService = null;
    this.mediaSearchEngineService = null;
  };
  return GoogleNewsAdapterV1;
}(SearchAdapterV1);
module.exports = {
  GoogleNewsAdapterV1: GoogleNewsAdapterV1
};

},{"../../../constants/source-types":697,"../../instances/adapters/processing":772,"../../instances/services/http":790,"../../instances/services/requests":802,"../../models/result-items":842,"./search-adapter-v1":756}],753:[function(require,module,exports){
"use strict";

var _require = require("./aleph-occrp-adapter-v1"),
  AlephOccrpAdapterV1 = _require.AlephOccrpAdapterV1;
var _require2 = require("./extra-sources-adapter-v1"),
  ExtraSourcesAdapterV1 = _require2.ExtraSourcesAdapterV1;
var _require3 = require("./google-news-adapter-v1"),
  GoogleNewsAdapterV1 = _require3.GoogleNewsAdapterV1;
var _require4 = require("./open-corporates-adapter-v1"),
  OpenCorporatesAdapterV1 = _require4.OpenCorporatesAdapterV1;
var _require5 = require("./open-sanctions-adapter-v1"),
  OpenSanctionsAdapterV1 = _require5.OpenSanctionsAdapterV1;
var _require6 = require("./search-engine-adapter-v1"),
  SearchEngineAdapterV1 = _require6.SearchEngineAdapterV1;
var _require7 = require("./stock-markets-adapter-v1"),
  StockMarketsAdapterV1 = _require7.StockMarketsAdapterV1;
module.exports = {
  AlephOccrpAdapterV1: AlephOccrpAdapterV1,
  ExtraSourcesAdapterV1: ExtraSourcesAdapterV1,
  GoogleNewsAdapterV1: GoogleNewsAdapterV1,
  OpenCorporatesAdapterV1: OpenCorporatesAdapterV1,
  OpenSanctionsAdapterV1: OpenSanctionsAdapterV1,
  SearchEngineAdapterV1: SearchEngineAdapterV1,
  StockMarketsAdapterV1: StockMarketsAdapterV1
};

},{"./aleph-occrp-adapter-v1":750,"./extra-sources-adapter-v1":751,"./google-news-adapter-v1":752,"./open-corporates-adapter-v1":754,"./open-sanctions-adapter-v1":755,"./search-engine-adapter-v1":757,"./stock-markets-adapter-v1":758}],754:[function(require,module,exports){
"use strict";

function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
var _require = require("./search-adapter-v1"),
  SearchAdapterV1 = _require.SearchAdapterV1;
var _require2 = require("../../models/result-items"),
  OpenCorporatesResultItemV1 = _require2.OpenCorporatesResultItemV1;
var _require3 = require("../../../constants/source-types"),
  OPEN_CORPORATES_TYPE = _require3.OPEN_CORPORATES_TYPE,
  OPEN_CORPORATES_SOURCE_CODE = _require3.OPEN_CORPORATES_SOURCE_CODE;
var _require4 = require("../../instances/adapters/processing"),
  ProcessingAdapterInstance = _require4.ProcessingAdapterInstance;
var _require5 = require("../../instances/services/http"),
  OpenCorporatesRequestsServiceInstance = _require5.OpenCorporatesRequestsServiceInstance;
var OpenCorporatesAdapterV1 = function (_SearchAdapterV) {
  function OpenCorporatesAdapterV1($rootScope, $http, $q, $timeout) {
    var _this;
    _this = _SearchAdapterV.call(this, $rootScope, $http, $q, $timeout, OPEN_CORPORATES_TYPE, OPEN_CORPORATES_SOURCE_CODE) || this;
    _this.openCorporatesRequestsService = null;
    return _this;
  }
  _inheritsLoose(OpenCorporatesAdapterV1, _SearchAdapterV);
  var _proto = OpenCorporatesAdapterV1.prototype;
  _proto.initServices = function initServices(endpointsConfig) {
    this.openCorporatesRequestsService = OpenCorporatesRequestsServiceInstance.getNewService(this.$rootScope, this.$http, this.$q, this.$timeout);
    this.openCorporatesRequestsService.setUrls(endpointsConfig);
  };
  _proto.injectServices = function injectServices(openCorporatesRequestsService) {
    this.openCorporatesRequestsService = openCorporatesRequestsService;
  };
  _proto.initAdapters = function initAdapters() {
    this.processingAdapter = ProcessingAdapterInstance.getNewAdapter(this.$rootScope, this.$http, this.$q, this.$timeout);
  };
  _proto.injectAdapters = function injectAdapters(processingAdapter) {
    this.processingAdapter = processingAdapter;
  };
  _proto.resetAdapter = function resetAdapter() {
    var _this$processingAdapt, _this$openCorporatesR;
    (_this$processingAdapt = this.processingAdapter) == null || _this$processingAdapt.resetAdapter();
    (_this$openCorporatesR = this.openCorporatesRequestsService) == null || _this$openCorporatesR.resetRouteWasChanged();
  };
  _proto.setTimeouts = function setTimeouts(timeouts) {
    var _this$openCorporatesR2;
    (_this$openCorporatesR2 = this.openCorporatesRequestsService) == null || _this$openCorporatesR2.setTimeouts(timeouts);
  };
  _proto.setAdapterConstants = function setAdapterConstants(constants) {
    this.setCommonAdapterConstants(constants);
    this.SINGLE_RESULTS_COUNT = constants.single_processing && constants.single_processing.count_of_results ? constants.single_processing.count_of_results : 15;
    this.BATCH_RESULTS_COUNT = constants.batch_processing && constants.batch_processing.count_of_results ? constants.batch_processing.count_of_results : 5;
  };
  _proto.performPersonRequest$ = function performPersonRequest$(parentPerson, personsService, dateFrom, dateTo, isAddWithoutDate, languages, isBatch, scoreMode, requestObject, groupObject, callback) {
    var _this2 = this;
    var deferred = this.$q.defer();
    try {
      var getResults$ = this.getResults$(parentPerson, personsService, dateFrom, dateTo, isAddWithoutDate, languages, isBatch, scoreMode, requestObject, groupObject, callback);
      var loadResults = this.loadPersonResults.bind(this);
      this.processPersonRequest$(parentPerson, isBatch, requestObject, groupObject, getResults$, loadResults, callback).then(function () {})["catch"](function (error) {
        _this2.errorLogger(error);
      })["finally"](function () {
        deferred.resolve(parentPerson);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.getResults$ = function getResults$(parentPerson, personsService, dateFrom, dateTo, isAddWithoutDate, languages, isBatch, scoreMode, requestObject, groupObject, callback) {
    var _this3 = this;
    var deferred = this.$q.defer();
    try {
      var getSinglePersonResults$ = function getSinglePersonResults$(person) {
        return _this3.getSinglePersonResults$(person, dateFrom, dateTo, isAddWithoutDate, languages, scoreMode, requestObject, groupObject);
      };
      this.getAllParentPersonResults$(parentPerson, personsService, getSinglePersonResults$).then(function () {})["catch"](function (error) {
        _this3.errorLogger(error);
      })["finally"](function () {
        deferred.resolve(parentPerson);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.getSinglePersonResults$ = function getSinglePersonResults$(person, dateFrom, dateTo, isAddWithoutDate, languages, scoreMode, requestObject, groupObject) {
    var _this4 = this;
    var deferred = this.$q.defer();
    try {
      var _this$openCorporatesR3;
      var mappedResults = [];
      var getResultsRequest$ = (_this$openCorporatesR3 = this.openCorporatesRequestsService) == null ? void 0 : _this$openCorporatesR3.getOpenCorporatesResults$(person.getFullName(), person.checkIsCompany() ? "company" : "person");
      this.getPersonResults$(getResultsRequest$).then(function (resp) {
        try {
          var results = resp;
          (results[0] || []).forEach(function (personResult) {
            var newOpenCorporatesResult = _this4.createResult(personResult, person, requestObject ? requestObject.getId() : null, groupObject ? groupObject.getId() : null, isAddWithoutDate, scoreMode);
            if (newOpenCorporatesResult) {
              mappedResults.push(newOpenCorporatesResult);
            }
          });
        } catch (error) {
          _this4.errorLogger(error);
        }
      })["catch"](function (error) {
        _this4.errorLogger(error);
      })["finally"](function () {
        deferred.resolve(mappedResults);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.loadPersonResults = function loadPersonResults(parentPerson, isBatch, requestObject, groupObject, callback, successCallback, errorCallback) {
    var _this5 = this;
    try {
      parentPerson.filterLoadedRequestObjectResults(requestObject ? requestObject.getId() : null, this.getAdapterSourceCode());
      var showResultsCount = 0;
      var highRiskScore = 0;
      if (groupObject) {
        showResultsCount = groupObject.getMaxResultsCount();
        highRiskScore = groupObject.getMinRiskScore();
      } else {
        showResultsCount = !isBatch ? this.SINGLE_RESULTS_COUNT : this.BATCH_RESULTS_COUNT;
        highRiskScore = 0;
      }
      var topResults = parentPerson.getResultsForLoad(this.getAdapterSourceCode(), requestObject ? requestObject.getId() : null, groupObject ? groupObject.getId() : null, showResultsCount, highRiskScore, 0, 0);
      parentPerson.setTotalResults();
      if (callback) {
        callback([parentPerson]);
      }
      var batchPromiseArray = [];
      topResults.forEach(function (openCorporatesResult, idx) {
        var _this5$processingAdap;
        batchPromiseArray.push((_this5$processingAdap = _this5.processingAdapter) == null ? void 0 : _this5$processingAdap.loadDocument$(openCorporatesResult, [], requestObject, idx, topResults.length));
      });
      batchPromiseArray = batchPromiseArray.filter(function (p) {
        return p;
      });
      this.logStartLoadResults(parentPerson, requestObject, topResults.length);
      if (batchPromiseArray.length) {
        this.$q.all(batchPromiseArray).then(function () {})["catch"](function (error) {
          _this5.errorLogger(error);
        })["finally"](function () {
          _this5.loadPersonResults(parentPerson, isBatch, requestObject, groupObject, callback, successCallback, errorCallback);
        });
      } else {
        successCallback(parentPerson);
      }
    } catch (error) {
      this.errorLogger(error);
      errorCallback(error);
    }
  };
  _proto.createResult = function createResult(personResult, person, requestObjectId, groupObjectId, isAddWithoutDate, scoreMode) {
    var newOpenCorporatesResult = null;
    try {
      newOpenCorporatesResult = new OpenCorporatesResultItemV1(personResult.title, personResult.summary, personResult.link, this.getAdapterSourceCode());
      newOpenCorporatesResult.setLanguage(personResult.language);
      newOpenCorporatesResult.setEntityType(personResult.type);
      newOpenCorporatesResult.setExtendedSummary(personResult.summary);
      newOpenCorporatesResult.setExtendedSummaryHtml(personResult.summary);
      if (personResult.htmlContent && personResult.htmlContent.length) {
        var _this$processingAdapt2, _this$processingAdapt3;
        newOpenCorporatesResult.setContentHtml(personResult.htmlContent);
        var contentElement = (_this$processingAdapt2 = this.processingAdapter) == null ? void 0 : _this$processingAdapt2.createElement(newOpenCorporatesResult);
        newOpenCorporatesResult.setContentElement(contentElement);
        var contentElementText = (_this$processingAdapt3 = this.processingAdapter) == null ? void 0 : _this$processingAdapt3.getElementText(newOpenCorporatesResult);
        newOpenCorporatesResult.setContentElementText(contentElementText);
        newOpenCorporatesResult.setHtmlCleared(true);
      }
      newOpenCorporatesResult.setPersonInfo(person);
      newOpenCorporatesResult.setExtendedPersonInfo(person.getExtendedInfo());
      newOpenCorporatesResult.setItemInfo(person.getItemId());
      newOpenCorporatesResult.setGroupInfo(requestObjectId, groupObjectId);
      newOpenCorporatesResult.setScoreMode(scoreMode);
      newOpenCorporatesResult.setRiskScore(personResult.riskscore || 0.5);
      newOpenCorporatesResult.setRiskScored(true);
      newOpenCorporatesResult.setMediaPyRiskScore(personResult.riskscore || 0.5);
      newOpenCorporatesResult.setMediaPyRiskScored(false);
      newOpenCorporatesResult.setMediaPyRiskScoreColor(personResult.riskscore || 0.5, false);
      newOpenCorporatesResult.setSentiment(0);
      newOpenCorporatesResult.setSentimentLoaded(true);
      newOpenCorporatesResult.setMediaPyTitleRiskScore(0);
      newOpenCorporatesResult.setMediaPyTitleRiskScoreColor(0, false);
      newOpenCorporatesResult.setMediaPyNameImportance(0);
      newOpenCorporatesResult.setMediaPyNameImportanceColor(0, false);
      newOpenCorporatesResult.setKeywordsHighlighted(true);
    } catch (error) {
      this.errorLogger(error);
    }
    return newOpenCorporatesResult;
  };
  _proto.destroy = function destroy() {
    _SearchAdapterV.prototype.destroy.call(this);
    this.openCorporatesRequestsService = null;
  };
  return OpenCorporatesAdapterV1;
}(SearchAdapterV1);
module.exports = {
  OpenCorporatesAdapterV1: OpenCorporatesAdapterV1
};

},{"../../../constants/source-types":697,"../../instances/adapters/processing":772,"../../instances/services/http":790,"../../models/result-items":842,"./search-adapter-v1":756}],755:[function(require,module,exports){
"use strict";

function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
var _require = require("./search-adapter-v1"),
  SearchAdapterV1 = _require.SearchAdapterV1;
var _require2 = require("../../models/result-items"),
  OpenSanctionsResultItemV1 = _require2.OpenSanctionsResultItemV1;
var _require3 = require("../../../constants/source-types"),
  OPEN_SANCTIONS_TYPE = _require3.OPEN_SANCTIONS_TYPE,
  OPEN_SANCTIONS_SOURCE_CODE = _require3.OPEN_SANCTIONS_SOURCE_CODE;
var _require4 = require("../../instances/adapters/processing"),
  ProcessingAdapterInstance = _require4.ProcessingAdapterInstance;
var _require5 = require("../../instances/services/http"),
  OpenSanctionsRequestsServiceInstance = _require5.OpenSanctionsRequestsServiceInstance;
var OpenSanctionsAdapterV1 = function (_SearchAdapterV) {
  function OpenSanctionsAdapterV1($rootScope, $http, $q, $timeout) {
    var _this;
    _this = _SearchAdapterV.call(this, $rootScope, $http, $q, $timeout, OPEN_SANCTIONS_TYPE, OPEN_SANCTIONS_SOURCE_CODE) || this;
    _this.openSanctionsRequestsService = null;
    return _this;
  }
  _inheritsLoose(OpenSanctionsAdapterV1, _SearchAdapterV);
  var _proto = OpenSanctionsAdapterV1.prototype;
  _proto.initServices = function initServices(endpointsConfig) {
    this.openSanctionsRequestsService = OpenSanctionsRequestsServiceInstance.getNewService(this.$rootScope, this.$http, this.$q, this.$timeout);
    this.openSanctionsRequestsService.setUrls(endpointsConfig);
  };
  _proto.injectServices = function injectServices(openSanctionsRequestsService) {
    this.openSanctionsRequestsService = openSanctionsRequestsService;
  };
  _proto.initAdapters = function initAdapters() {
    this.processingAdapter = ProcessingAdapterInstance.getNewAdapter(this.$rootScope, this.$http, this.$q, this.$timeout);
  };
  _proto.injectAdapters = function injectAdapters(processingAdapter) {
    this.processingAdapter = processingAdapter;
  };
  _proto.resetAdapter = function resetAdapter() {
    var _this$processingAdapt, _this$openSanctionsRe;
    (_this$processingAdapt = this.processingAdapter) == null || _this$processingAdapt.resetAdapter();
    (_this$openSanctionsRe = this.openSanctionsRequestsService) == null || _this$openSanctionsRe.resetRouteWasChanged();
  };
  _proto.setTimeouts = function setTimeouts(timeouts) {
    var _this$openSanctionsRe2;
    (_this$openSanctionsRe2 = this.openSanctionsRequestsService) == null || _this$openSanctionsRe2.setTimeouts(timeouts);
  };
  _proto.setAdapterConstants = function setAdapterConstants(constants) {
    this.setCommonAdapterConstants(constants);
    this.SINGLE_RESULTS_COUNT = constants.single_processing && constants.single_processing.count_of_results ? constants.single_processing.count_of_results : 15;
    this.SINGLE_SPECIAL_PARSING = constants.single_processing && constants.single_processing.special_parsing_after_search ? constants.single_processing.special_parsing_after_search : false;
    this.SINGLE_JSON_INFO = constants.single_processing && constants.single_processing.get_json_info_after_search ? constants.single_processing.get_json_info_after_search : false;
    this.SINGLE_SPECIAL_PARSING_JSON = constants.single_processing && constants.single_processing.special_parsing_json_after_search ? constants.single_processing.special_parsing_json_after_search : false;
    this.BATCH_RESULTS_COUNT = constants.batch_processing && constants.batch_processing.count_of_results ? constants.batch_processing.count_of_results : 5;
    this.BATCH_SPECIAL_PARSING = constants.batch_processing && constants.batch_processing.special_parsing_after_search ? constants.batch_processing.special_parsing_after_search : false;
    this.BATCH_JSON_INFO = constants.batch_processing && constants.batch_processing.get_json_info_after_search ? constants.batch_processing.get_json_info_after_search : false;
    this.BATCH_SPECIAL_PARSING_JSON = constants.batch_processing && constants.batch_processing.special_parsing_json_after_search ? constants.batch_processing.special_parsing_json_after_search : false;
  };
  _proto.performPersonRequest$ = function performPersonRequest$(parentPerson, personsService, dateFrom, dateTo, isAddWithoutDate, languages, isBatch, scoreMode, requestObject, groupObject, callback) {
    var _this2 = this;
    var deferred = this.$q.defer();
    try {
      var getResults$ = this.getResults$(parentPerson, personsService, dateFrom, dateTo, isAddWithoutDate, languages, isBatch, scoreMode, requestObject, groupObject, callback);
      var loadResults = this.loadPersonResults.bind(this);
      this.processPersonRequest$(parentPerson, isBatch, requestObject, groupObject, getResults$, loadResults, callback).then(function () {})["catch"](function (error) {
        _this2.errorLogger(error);
      })["finally"](function () {
        deferred.resolve(parentPerson);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.getResults$ = function getResults$(parentPerson, personsService, dateFrom, dateTo, isAddWithoutDate, languages, isBatch, scoreMode, requestObject, groupObject, callback) {
    var _this3 = this;
    var deferred = this.$q.defer();
    try {
      var getSinglePersonResults$ = function getSinglePersonResults$(person) {
        return _this3.getSinglePersonResults$(person, dateFrom, dateTo, isAddWithoutDate, languages, scoreMode, requestObject, groupObject);
      };
      this.getAllParentPersonResults$(parentPerson, personsService, getSinglePersonResults$).then(function () {})["catch"](function (error) {
        _this3.errorLogger(error);
      })["finally"](function () {
        deferred.resolve(parentPerson);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.getSinglePersonResults$ = function getSinglePersonResults$(person, dateFrom, dateTo, isAddWithoutDate, languages, scoreMode, requestObject, groupObject) {
    var _this4 = this;
    var deferred = this.$q.defer();
    try {
      var _this$openSanctionsRe3;
      var mappedResults = [];
      var getResultsRequest$ = (_this$openSanctionsRe3 = this.openSanctionsRequestsService) == null ? void 0 : _this$openSanctionsRe3.getOpenSanctionsResults$(person.getFullName());
      this.getPersonResults$(getResultsRequest$).then(function (resp) {
        try {
          var results = resp;
          (results[0] || []).forEach(function (personResult) {
            var newOpenSanctionsResult = _this4.createResult(personResult, person, requestObject ? requestObject.getId() : null, groupObject ? groupObject.getId() : null, isAddWithoutDate, scoreMode);
            if (newOpenSanctionsResult) {
              mappedResults.push(newOpenSanctionsResult);
            }
          });
        } catch (error) {
          _this4.errorLogger(error);
        }
      })["catch"](function (error) {
        _this4.errorLogger(error);
      })["finally"](function () {
        deferred.resolve(mappedResults);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.loadPersonResults = function loadPersonResults(parentPerson, isBatch, requestObject, groupObject, callback, successCallback, errorCallback) {
    var _this5 = this;
    try {
      parentPerson.filterLoadedRequestObjectResults(requestObject ? requestObject.getId() : null, this.getAdapterSourceCode());
      var showResultsCount = 0;
      var highRiskScore = 0;
      if (groupObject) {
        showResultsCount = groupObject.getMaxResultsCount();
        highRiskScore = groupObject.getMinRiskScore();
      } else {
        showResultsCount = !isBatch ? this.SINGLE_RESULTS_COUNT : this.BATCH_RESULTS_COUNT;
        highRiskScore = 0;
      }
      var topResults = parentPerson.getResultsForLoad(this.getAdapterSourceCode(), requestObject ? requestObject.getId() : null, groupObject ? groupObject.getId() : null, showResultsCount, highRiskScore, 0, 0);
      parentPerson.setTotalResults();
      if (callback) {
        callback([parentPerson]);
      }
      var batchPromiseArray = [];
      topResults.forEach(function (openSanctionsResult, idx) {
        var _this5$processingAdap;
        batchPromiseArray.push((_this5$processingAdap = _this5.processingAdapter) == null ? void 0 : _this5$processingAdap.loadDocument$(openSanctionsResult, [], requestObject, idx, topResults.length));
      });
      batchPromiseArray = batchPromiseArray.filter(function (p) {
        return p;
      });
      this.logStartLoadResults(parentPerson, requestObject, topResults.length);
      if (batchPromiseArray.length) {
        this.$q.all(batchPromiseArray).then(function () {})["catch"](function (error) {
          _this5.errorLogger(error);
        })["finally"](function () {
          _this5.loadPersonResults(parentPerson, isBatch, requestObject, groupObject, callback, successCallback, errorCallback);
        });
      } else {
        successCallback(parentPerson);
      }
    } catch (error) {
      this.errorLogger(error);
      errorCallback(error);
    }
  };
  _proto.createResult = function createResult(personResult, person, requestObjectId, groupObjectId, isAddWithoutDate, scoreMode) {
    var newOpenSanctionsResult = null;
    try {
      newOpenSanctionsResult = new OpenSanctionsResultItemV1(personResult.title, personResult.summary, personResult.link, this.getAdapterSourceCode());
      newOpenSanctionsResult.setLanguage(personResult.language);
      newOpenSanctionsResult.setEntityType(personResult.type);
      newOpenSanctionsResult.setEntityId(personResult.id);
      newOpenSanctionsResult.setExtendedSummary(personResult.summary);
      newOpenSanctionsResult.setExtendedSummaryHtml(personResult.summary);
      if (personResult.htmlContent && personResult.htmlContent.length) {
        var _this$processingAdapt2, _this$processingAdapt3;
        newOpenSanctionsResult.setContentHtml(personResult.htmlContent);
        var contentElement = (_this$processingAdapt2 = this.processingAdapter) == null ? void 0 : _this$processingAdapt2.createElement(newOpenSanctionsResult);
        newOpenSanctionsResult.setContentElement(contentElement);
        var contentElementText = (_this$processingAdapt3 = this.processingAdapter) == null ? void 0 : _this$processingAdapt3.getElementText(newOpenSanctionsResult);
        newOpenSanctionsResult.setContentElementText(contentElementText);
        newOpenSanctionsResult.setHtmlCleared(true);
      }
      newOpenSanctionsResult.setPersonInfo(person);
      newOpenSanctionsResult.setExtendedPersonInfo(person.getExtendedInfo());
      newOpenSanctionsResult.setItemInfo(person.getItemId());
      newOpenSanctionsResult.setGroupInfo(requestObjectId, groupObjectId);
      newOpenSanctionsResult.setScoreMode(scoreMode);
      newOpenSanctionsResult.setRiskScore(personResult.riskscore || 0.5);
      newOpenSanctionsResult.setRiskScored(true);
      newOpenSanctionsResult.setMediaPyRiskScore(personResult.riskscore || 0.5);
      newOpenSanctionsResult.setMediaPyRiskScored(false);
      newOpenSanctionsResult.setMediaPyRiskScoreColor(personResult.riskscore || 0.5, false);
      newOpenSanctionsResult.setSentiment(0);
      newOpenSanctionsResult.setSentimentLoaded(true);
      newOpenSanctionsResult.setMediaPyTitleRiskScore(0);
      newOpenSanctionsResult.setMediaPyTitleRiskScoreColor(0, false);
      newOpenSanctionsResult.setMediaPyNameImportance(0);
      newOpenSanctionsResult.setMediaPyNameImportanceColor(0, false);
      newOpenSanctionsResult.setKeywordsHighlighted(true);
    } catch (error) {
      this.errorLogger(error);
    }
    return newOpenSanctionsResult;
  };
  _proto.destroy = function destroy() {
    _SearchAdapterV.prototype.destroy.call(this);
    this.openSanctionsRequestsService = null;
  };
  return OpenSanctionsAdapterV1;
}(SearchAdapterV1);
module.exports = {
  OpenSanctionsAdapterV1: OpenSanctionsAdapterV1
};

},{"../../../constants/source-types":697,"../../instances/adapters/processing":772,"../../instances/services/http":790,"../../models/result-items":842,"./search-adapter-v1":756}],756:[function(require,module,exports){
"use strict";

function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
var _require = require("../adapter-v1"),
  AdapterV1 = _require.AdapterV1;
var _require2 = require("../../../common/utils/stopwatch"),
  StopWatch = _require2.StopWatch;
var SearchAdapterV1 = function (_AdapterV) {
  function SearchAdapterV1($rootScope, $http, $q, $timeout, adapterType, adapterSourceCode) {
    var _this;
    _this = _AdapterV.call(this, $rootScope, $http, $q, $timeout) || this;
    _this.adapterType = adapterType;
    _this.adapterSourceCode = adapterSourceCode;
    _this.processingAdapter = null;
    return _this;
  }
  _inheritsLoose(SearchAdapterV1, _AdapterV);
  var _proto = SearchAdapterV1.prototype;
  _proto.getAdapterSourceCode = function getAdapterSourceCode() {
    return this.adapterSourceCode;
  };
  _proto.setCommonAdapterConstants = function setCommonAdapterConstants(constants) {
    this.SINGLE_LOAD_RESULTS = constants.single_processing && constants.single_processing.load_and_score_documents_after_search ? constants.single_processing.load_and_score_documents_after_search : false;
    this.SINGLE_ANALYZE_TEXT = constants.single_processing && constants.single_processing.analyze_text_after_search ? constants.single_processing.analyze_text_after_search : false;
    this.SINGLE_MENTIONED_ENTITIES = constants.single_processing && constants.single_processing.get_mentioned_entities_after_search ? constants.single_processing.get_mentioned_entities_after_search : false;
    this.SINGLE_SUMMARIZE_TEXT = constants.single_processing && constants.single_processing.summarize_text_after_search ? constants.single_processing.summarize_text_after_search : false;
    this.SINGLE_ANALYZE_TOPIC = constants.single_processing && constants.single_processing.analyze_topic_after_search ? constants.single_processing.analyze_topic_after_search : false;
    this.SINGLE_LLM_TEXT_ANALYSIS = constants.single_processing && constants.single_processing.llm_text_analysis_after_search ? constants.single_processing.llm_text_analysis_after_search : false;
    this.BATCH_LOAD_RESULTS = constants.batch_processing && constants.batch_processing.load_and_score_documents_after_search ? constants.batch_processing.load_and_score_documents_after_search : false;
    this.BATCH_ANALYZE_TEXT = constants.batch_processing && constants.batch_processing.analyze_text_after_search ? constants.batch_processing.analyze_text_after_search : false;
    this.BATCH_MENTIONED_ENTITIES = constants.batch_processing && constants.batch_processing.get_mentioned_entities_after_search ? constants.batch_processing.get_mentioned_entities_after_search : false;
    this.BATCH_SUMMARIZE_TEXT = constants.batch_processing && constants.batch_processing.summarize_text_after_search ? constants.batch_processing.summarize_text_after_search : false;
    this.BATCH_ANALYZE_TOPIC = constants.batch_processing && constants.batch_processing.analyze_topic_after_search ? constants.batch_processing.analyze_topic_after_search : false;
    this.BATCH_LLM_TEXT_ANALYSIS = constants.batch_processing && constants.batch_processing.llm_text_analysis_after_search ? constants.batch_processing.llm_text_analysis_after_search : false;
  };
  _proto.setPersonTotalResults = function setPersonTotalResults(parentPerson, isFinal, typesToFilter) {
    try {
      parentPerson.filterTotalResults(isFinal, typesToFilter, null, null, true, true, []);
      parentPerson.countTotalRiskScore();
    } catch (error) {
      this.errorLogger(error);
    }
  };
  _proto.processPersonRequest$ = function processPersonRequest$(parentPerson, isBatch, requestObject, groupObject, getResults$, loadResults, callback) {
    var _this2 = this;
    var deferred = this.$q.defer();
    try {
      this.logStartGetResults(parentPerson, requestObject);
      var processResultsStopWatch = new StopWatch(undefined);
      var getResultsStopWatch = new StopWatch(undefined);
      processResultsStopWatch.start();
      getResultsStopWatch.start();
      getResults$.then(function () {})["catch"](function (error) {
        _this2.errorLogger(error);
      })["finally"](function () {
        getResultsStopWatch.stop();
        parentPerson.addPerformanceMetric(_this2.getAdapterSourceCode(), "getResults", getResultsStopWatch.getElapsedMilliseconds());
        _this2.logFinishGetResults(parentPerson, requestObject);
        parentPerson.setResults(_this2.getAdapterSourceCode(), isBatch ? _this2.BATCH_RESULTS_COUNT : _this2.SINGLE_RESULTS_COUNT);
        var shouldLoadResults = !isBatch ? _this2.SINGLE_LOAD_RESULTS : _this2.BATCH_LOAD_RESULTS;
        var promise$ = shouldLoadResults ? _this2.loadPersonResults$(parentPerson, isBatch, requestObject, groupObject, loadResults, callback) : _this2.promiseWrapper(parentPerson);
        promise$.then(function () {})["catch"](function (error) {
          _this2.errorLogger(error);
        })["finally"](function () {
          _this2.logFinishLoadResults(parentPerson, requestObject);
          var analyzeRequestResultsPromise$ = shouldLoadResults ? _this2.analyzeRequestResults$(parentPerson, isBatch, requestObject, groupObject, callback) : _this2.promiseWrapper(parentPerson);
          analyzeRequestResultsPromise$.then(function () {})["catch"](function (error) {
            _this2.errorLogger(error);
          })["finally"](function () {
            var analyzeLLMRequestResultsPromise$ = shouldLoadResults ? _this2.analyzeLLMRequestResults$(parentPerson, isBatch, requestObject, groupObject, callback) : _this2.promiseWrapper(parentPerson);
            analyzeLLMRequestResultsPromise$.then(function () {})["catch"](function (error) {
              _this2.errorLogger(error);
            })["finally"](function () {
              parentPerson.setTotalResults();
              if (callback) {
                callback([parentPerson]);
              }
              processResultsStopWatch.stop();
              parentPerson.addPerformanceMetric(_this2.getAdapterSourceCode(), "processResults", processResultsStopWatch.getElapsedMilliseconds());
              deferred.resolve(parentPerson);
            });
          });
        });
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.performPersonBatchRequests$ = function performPersonBatchRequests$(parentPerson, batchPromisesArray, isBatch, callback) {
    var _this3 = this;
    var deferred = this.$q.defer();
    try {
      var shouldLoadResults = !isBatch ? this.SINGLE_LOAD_RESULTS : this.BATCH_LOAD_RESULTS;
      this.logStartSendBatchRequests(parentPerson);
      this.batchPromisesWrapper(batchPromisesArray).then(function () {})["catch"](function (error) {
        _this3.errorLogger(error);
      })["finally"](function () {
        var _typesToFilter;
        _this3.logFinishSendBatchRequests(parentPerson);
        var typesToFilter = (_typesToFilter = {}, _typesToFilter[_this3.getAdapterSourceCode()] = shouldLoadResults, _typesToFilter);
        _this3.setPersonTotalResults(parentPerson, false, typesToFilter);
        if (callback) {
          callback([parentPerson]);
        }
        deferred.resolve(parentPerson);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.getAllParentPersonResults$ = function getAllParentPersonResults$(parentPerson, personsService, getSinglePersonResults$) {
    var _this4 = this;
    var deferred = this.$q.defer();
    getSinglePersonResults$(parentPerson).then(function (mappedResults) {
      try {
        mappedResults.forEach(function (mappedResult) {
          parentPerson.addTypeResult(mappedResult, _this4.getAdapterSourceCode());
        });
      } catch (error) {
        _this4.errorLogger(error);
      }
    })["catch"](function (error) {
      _this4.errorLogger(error);
    })["finally"](function () {
      var linkedPersons = personsService.getLinkedPersonsById(parentPerson.getId());
      var aliasPersons = personsService.getAliasPersonsById(parentPerson.getId());
      _this4.getMultiplePersonsResults$(linkedPersons, getSinglePersonResults$).then(function (mappedResults) {
        try {
          mappedResults.forEach(function (mappedResult) {
            parentPerson.addTypeResult(mappedResult, _this4.getAdapterSourceCode());
          });
        } catch (error) {
          _this4.errorLogger(error);
        }
      })["catch"](function (error) {
        _this4.errorLogger(error);
      })["finally"](function () {
        _this4.getMultiplePersonsResults$(aliasPersons, getSinglePersonResults$).then(function (mappedResults) {
          try {
            mappedResults.forEach(function (mappedResult) {
              parentPerson.addTypeResult(mappedResult, _this4.getAdapterSourceCode());
            });
          } catch (error) {
            _this4.errorLogger(error);
          }
        })["catch"](function (error) {
          _this4.errorLogger(error);
        })["finally"](function () {
          deferred.resolve(parentPerson);
        });
      });
    });
    return deferred.promise;
  };
  _proto.getMultiplePersonsResults$ = function getMultiplePersonsResults$(persons, getSinglePersonResults$) {
    var _this5 = this;
    var deferred = this.$q.defer();
    try {
      var totalMappedResults = [];
      if (persons.length) {
        var personsCount = persons.length;
        var processedPersonsCount = 0;
        persons.forEach(function (person) {
          getSinglePersonResults$(person).then(function (mappedResults) {
            mappedResults.forEach(function (mappedResult) {
              totalMappedResults.push(mappedResult);
            });
          })["catch"](function (error) {
            _this5.errorLogger(error);
          })["finally"](function () {
            ++processedPersonsCount;
            if (processedPersonsCount === personsCount) {
              deferred.resolve(totalMappedResults);
            }
          });
        });
      } else {
        deferred.resolve(totalMappedResults);
      }
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.getPersonResults$ = function getPersonResults$(getResultsRequest$) {
    var _this6 = this;
    var deferred = this.$q.defer();
    try {
      var resultsArray = [];
      var batchPromiseArray = [getResultsRequest$];
      this.$q.all(batchPromiseArray).then(function (resp) {
        resultsArray = resultsArray.concat((resp || []).map(function (r) {
          return r.data;
        }).filter(function (d) {
          return d && d.length;
        }));
      })["catch"](function (error) {
        _this6.errorLogger(error);
      })["finally"](function () {
        deferred.resolve(resultsArray);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.loadBatchPersonResults$ = function loadBatchPersonResults$(parentPerson, isBatch, requestObject, groupObject, callback) {
    var loadResults = this.loadPersonResults.bind(this);
    return this.loadPersonResults$(parentPerson, isBatch, requestObject, groupObject, loadResults, callback);
  };
  _proto.loadPersonResults$ = function loadPersonResults$(parentPerson, isBatch, requestObject, groupObject, loadResults, callback) {
    var deferred = this.$q.defer();
    try {
      var successCallback = function successCallback(data) {
        deferred.resolve(data);
      };
      var errorCallback = function errorCallback(error) {
        deferred.reject(error);
      };
      loadResults(parentPerson, isBatch, requestObject, groupObject, callback, successCallback, errorCallback);
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.analyzeRequestResults$ = function analyzeRequestResults$(parentPerson, isBatch, requestObject, groupObject, callback) {
    var _this7 = this;
    var deferred = this.$q.defer();
    try {
      var batchPromisesArray = [];
      parentPerson.getRequestGroupResults(requestObject ? requestObject.getId() : null, groupObject ? groupObject.getId() : null).filter(function (searchResult) {
        return searchResult.getType() === _this7.getAdapterSourceCode();
      }).forEach(function (searchResult) {
        batchPromisesArray.push(_this7.analyzeSingleResult$(searchResult, isBatch));
      });
      this.batchPromisesWrapper(batchPromisesArray).then(function () {})["catch"](function (error) {
        _this7.errorLogger(error);
      })["finally"](function () {
        deferred.resolve(parentPerson);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.analyzeLLMRequestResults$ = function analyzeLLMRequestResults$(parentPerson, isBatch, requestObject, groupObject, callback) {
    var _this8 = this;
    var deferred = this.$q.defer();
    try {
      var batchPromisesArray = [];
      parentPerson.getRequestGroupResults(requestObject ? requestObject.getId() : null, groupObject ? groupObject.getId() : null).filter(function (searchResult) {
        return searchResult.getType() === _this8.getAdapterSourceCode();
      }).forEach(function (searchResult) {
        batchPromisesArray.push(_this8.analyzeLLMSingleResult$(searchResult, isBatch));
      });
      this.batchPromisesWrapper(batchPromisesArray).then(function () {})["catch"](function (error) {
        _this8.errorLogger(error);
      })["finally"](function () {
        deferred.resolve(parentPerson);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.analyzeSingleResult$ = function analyzeSingleResult$(searchResult, isBatch) {
    var deferred = this.$q.defer();
    try {
      var stopWatch = new StopWatch(undefined);
      stopWatch.start();
      var promisesChain = [];
      if (!isBatch ? this.SINGLE_ANALYZE_TEXT : this.BATCH_ANALYZE_TEXT) {
        var _this$processingAdapt;
        promisesChain.push((_this$processingAdapt = this.processingAdapter) == null ? void 0 : _this$processingAdapt.loadAndSetAnalyzeInfo$(searchResult));
      }
      if (!isBatch ? this.SINGLE_ANALYZE_TOPIC : this.BATCH_ANALYZE_TOPIC) {
        var _this$processingAdapt2;
        promisesChain.push((_this$processingAdapt2 = this.processingAdapter) == null ? void 0 : _this$processingAdapt2.loadAndSetTopicInfo$(searchResult));
      }
      if (!isBatch ? this.SINGLE_MENTIONED_ENTITIES : this.BATCH_MENTIONED_ENTITIES) {
        var _this$processingAdapt3;
        promisesChain.push((_this$processingAdapt3 = this.processingAdapter) == null ? void 0 : _this$processingAdapt3.loadAndSetMentionedEntities$(searchResult));
      }
      if (!isBatch ? this.SINGLE_SUMMARIZE_TEXT : this.BATCH_SUMMARIZE_TEXT) {
        var _this$processingAdapt4;
        promisesChain.push((_this$processingAdapt4 = this.processingAdapter) == null ? void 0 : _this$processingAdapt4.loadAndSetExtendedSummary$(searchResult));
      }
      var successCallback = function successCallback(data) {
        stopWatch.stop();
        searchResult.setPerformanceMetric("mediaPy", "total", -1, stopWatch.getElapsedMilliseconds(), null);
        deferred.resolve(data);
      };
      var errorCallback = function errorCallback(error) {
        stopWatch.stop();
        searchResult.setPerformanceMetric("mediaPy", "total", -1, stopWatch.getElapsedMilliseconds(), null);
        deferred.reject(error);
      };
      promisesChain = promisesChain.filter(function (p) {
        return p;
      });
      if (promisesChain.length) {
        this.analyzeSingleResultRecursive(searchResult, promisesChain, 0, successCallback, errorCallback);
      } else {
        successCallback(searchResult);
      }
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.analyzeLLMSingleResult$ = function analyzeLLMSingleResult$(searchResult, isBatch) {
    var _this9 = this;
    var deferred = this.$q.defer();
    try {
      var stopWatch = new StopWatch(undefined);
      stopWatch.start();
      var batchPromisesArray = [];
      if (!isBatch ? this.SINGLE_LLM_TEXT_ANALYSIS : this.BATCH_LLM_TEXT_ANALYSIS) {
        var _this$processingAdapt5;
        batchPromisesArray.push((_this$processingAdapt5 = this.processingAdapter) == null ? void 0 : _this$processingAdapt5.loadAndSetLLMTextAnalysis$(searchResult));
      }
      this.batchPromisesWrapper(batchPromisesArray).then(function () {})["catch"](function (error) {
        _this9.errorLogger(error);
      })["finally"](function () {
        stopWatch.stop();
        searchResult.setPerformanceMetric("mediaPyLLM", "total", -1, stopWatch.getElapsedMilliseconds(), null);
        deferred.resolve(searchResult);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.analyzeSingleResultRecursive = function analyzeSingleResultRecursive(searchResult, promisesChain, currIdx, successCallback, errorCallback) {
    var _this10 = this;
    promisesChain[currIdx].then(function () {})["catch"](function (error) {
      _this10.errorLogger(error);
    })["finally"](function () {
      ++currIdx;
      if (currIdx === promisesChain.length) {
        successCallback(searchResult);
      } else {
        _this10.analyzeSingleResultRecursive(searchResult, promisesChain, currIdx, successCallback, errorCallback);
      }
    });
  };
  _proto.logStartGetResults = function logStartGetResults(parentPerson, requestObject) {
    var msg = "Start get " + this.adapterType + " results:\n";
    msg += "\t- Person Name: '" + parentPerson.getFullName() + "'\n";
    msg += "\t- Person Id: '" + parentPerson.getId() + "'\n";
    msg += "\t" + ("- Request Object Id: '" + (requestObject ? requestObject.getId() : "") + "'");
    this.infoLogger(msg);
  };
  _proto.logFinishGetResults = function logFinishGetResults(parentPerson, requestObject) {
    var msg = "Finish get " + this.adapterType + " results:\n";
    msg += "\t- Person Name: '" + parentPerson.getFullName() + "'\n";
    msg += "\t- Person Id: '" + parentPerson.getId() + "'\n";
    msg += "\t" + ("- Request Object Id: '" + (requestObject ? requestObject.getId() : "") + "'");
    this.infoLogger(msg);
  };
  _proto.logStartSendBatchRequests = function logStartSendBatchRequests(parentPerson) {
    var msg = "Start perform " + this.adapterType + " requests in batch:\n";
    msg += "\t- Person Name: '" + parentPerson.getFullName() + "'\n";
    msg += "\t- Person Id: '" + parentPerson.getId() + "'";
    this.infoLogger(msg);
  };
  _proto.logFinishSendBatchRequests = function logFinishSendBatchRequests(parentPerson) {
    var msg = "Finish perform " + this.adapterType + " requests in batch:\n";
    msg += "\t- Person Name: '" + parentPerson.getFullName() + "'\n";
    msg += "\t- Person Id: '" + parentPerson.getId() + "'";
    this.infoLogger(msg);
  };
  _proto.logStartLoadResults = function logStartLoadResults(parentPerson, requestObject, resultsCount) {
    var msg = "Start load next " + this.adapterType + " results:\n";
    msg += "\t- Person Name: '" + parentPerson.getFullName() + "'\n";
    msg += "\t- Person Id: '" + parentPerson.getId() + "'\n";
    msg += "\t" + ("- Request Object Id: '" + (requestObject ? requestObject.getId() : "") + "'") + "\n";
    msg += "\t- Results Count: " + resultsCount.toString();
    this.infoLogger(msg);
  };
  _proto.logFinishLoadResults = function logFinishLoadResults(parentPerson, requestObject) {
    var msg = "Finish load all needed " + this.adapterType + " results:\n";
    msg += "\t- Person Name: '" + parentPerson.getFullName() + "'\n";
    msg += "\t- Person Id: '" + parentPerson.getId() + "'\n";
    msg += "\t" + ("- Request Object Id: '" + (requestObject ? requestObject.getId() : "") + "'") + "\n";
    this.infoLogger(msg);
  };
  _proto.destroy = function destroy() {
    _AdapterV.prototype.destroy.call(this);
    this.processingAdapter = null;
  };
  return SearchAdapterV1;
}(AdapterV1);
module.exports = {
  SearchAdapterV1: SearchAdapterV1
};

},{"../../../common/utils/stopwatch":695,"../adapter-v1":735}],757:[function(require,module,exports){
"use strict";

var _SearchEngineAdapterV;
function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
var _require = require("../../../common/utils/common-v4"),
  generateUUID = _require.generateUUID;
var _require2 = require("../../../common/utils/filters-v4"),
  onlyUnique = _require2.onlyUnique;
var _require3 = require("../../../common/utils/comparisons-v4"),
  compareByRiskScore = _require3.compareByRiskScore;
var _require4 = require("../../utils/utils"),
  findTotalResultsRiskScoreAdditive = _require4.findTotalResultsRiskScoreAdditive,
  getPublicationYearRiskScoreAdditive = _require4.getPublicationYearRiskScoreAdditive,
  getPublicationDate = _require4.getPublicationDate,
  removeDatePart = _require4.removeDatePart;
var _require5 = require("../../models/requests"),
  MediaSearchRequestV1 = _require5.MediaSearchRequestV1;
var _require6 = require("./search-adapter-v1"),
  SearchAdapterV1 = _require6.SearchAdapterV1;
var _require7 = require("../../models/result-items"),
  SearchEngineResultItemV1 = _require7.SearchEngineResultItemV1;
var _require8 = require("../../../constants/source-types"),
  GOOGLE_SEARCH_TYPE = _require8.GOOGLE_SEARCH_TYPE,
  GOOGLE_SEARCH_SOURCE_CODE = _require8.GOOGLE_SEARCH_SOURCE_CODE;
var _require9 = require("../../instances/adapters/processing"),
  ProcessingAdapterInstance = _require9.ProcessingAdapterInstance;
var _require10 = require("../../instances/services/http"),
  GoogleSearchRequestsServiceInstance = _require10.GoogleSearchRequestsServiceInstance;
var _require11 = require("../../instances/services/requests"),
  MediaSearchEngineServiceInstance = _require11.MediaSearchEngineServiceInstance;
var _require12 = require("../../models/request-configs/search-engine"),
  SearchEngineRequestTmpltDetailsConfigV5 = _require12.SearchEngineRequestTmpltDetailsConfigV5;
var SearchEngineAdapterV1 = function (_SearchAdapterV) {
  function SearchEngineAdapterV1($rootScope, $http, $q, $timeout, fakeLoadingBar) {
    var _this;
    _this = _SearchAdapterV.call(this, $rootScope, $http, $q, $timeout, GOOGLE_SEARCH_TYPE, GOOGLE_SEARCH_SOURCE_CODE) || this;
    _this.searchEngineRequestsService = null;
    _this.mediaSearchEngineService = null;
    _this.startProcessTime = null;
    _this.timeouts = {};
    _this.fakeLoadingBar = fakeLoadingBar;
    _this.fakeLoadingCounter = 0;
    _this.isGoogle = false;
    _this.isBing = false;
    return _this;
  }
  _inheritsLoose(SearchEngineAdapterV1, _SearchAdapterV);
  var _proto = SearchEngineAdapterV1.prototype;
  _proto.setSearchEngine = function setSearchEngine(isGoogle, isBing) {
    this.isGoogle = isGoogle;
    this.isBing = isBing;
  };
  _proto.setBaseConstants = function setBaseConstants() {
    this.PERSON_PARALLEL_REQUESTS_LIMIT = 1000;
    this.FAKE_LOADER_REQUESTS_DELAY = 500;
    this.MILLISECONDS_IN_MINUTE = 60000;
    this.MILLISECONDS_IN_SECOND = 1000;
    this.START_AFTER_TIMEOUT_DELAY = 1000;
  };
  _proto.initServices = function initServices(endpointsConfig) {
    this.searchEngineRequestsService = GoogleSearchRequestsServiceInstance.getNewService(this.$rootScope, this.$http, this.$q, this.$timeout);
    this.searchEngineRequestsService.setUrls(endpointsConfig);
    this.mediaSearchEngineService = MediaSearchEngineServiceInstance.getNewService();
  };
  _proto.injectServices = function injectServices(searchEngineRequestsService, mediaSearchEngineService) {
    this.searchEngineRequestsService = searchEngineRequestsService;
    this.mediaSearchEngineService = mediaSearchEngineService;
  };
  _proto.initAdapters = function initAdapters() {
    this.processingAdapter = ProcessingAdapterInstance.getNewAdapter(this.$rootScope, this.$http, this.$q, this.$timeout);
  };
  _proto.injectAdapters = function injectAdapters(processingAdapter) {
    this.processingAdapter = processingAdapter;
  };
  _proto.resetAdapter = function resetAdapter() {
    var _this$processingAdapt, _this$searchEngineReq;
    (_this$processingAdapt = this.processingAdapter) == null || _this$processingAdapt.resetAdapter();
    (_this$searchEngineReq = this.searchEngineRequestsService) == null || _this$searchEngineReq.resetRouteWasChanged();
  };
  _proto.setTimeouts = function setTimeouts(timeouts) {
    var _this$searchEngineReq2;
    (_this$searchEngineReq2 = this.searchEngineRequestsService) == null || _this$searchEngineReq2.setTimeouts(timeouts);
  };
  _proto.setCommonConfigConstants = function setCommonConfigConstants(constants) {
    this.EXACT_PERSON_NAME = constants.exact_person_name_mandatory === undefined ? false : constants.exact_person_name_mandatory;
    this.REQUESTS_PARALLEL_LIMIT = constants.requests_parallel_limit === undefined ? 20 : constants.requests_parallel_limit;
    this.REQUEST_RETRY_LIMIT_COUNT = constants.request_retry_limit_count === undefined ? 3 : constants.request_retry_limit_count;
    this.PERSON_ALIAS_RISKSCORE = constants.person_alias_riskscore === undefined ? 0.95 : constants.person_alias_riskscore;
    this.COMPANY_ALIAS_RISKSCORE = constants.company_alias_riskscore === undefined ? 0.85 : constants.company_alias_riskscore;
    this.FINAL_SCORE_THRESHOLD = constants.final_score_threshold === undefined ? 0.75 : constants.final_score_threshold;
    this.INCLUDE_RESULTS_WITHOUT_KEYWORDS = constants.include_results_without_keywords === undefined ? false : constants.include_results_without_keywords;
    this.RESULT_WITHOUT_KEYWORDS_RISKSCORE = constants.result_without_keywords_riskscore === undefined ? 0.1 : constants.result_without_keywords_riskscore;
    if (this.isGoogle) {
      this.REQUESTS_PER_PERIOD_LIMIT = constants.requests_per_minute_limit === undefined ? 120 : constants.requests_per_minute_limit;
    }
    if (this.isBing) {
      this.REQUESTS_PER_PERIOD_LIMIT = constants.requests_per_second_limit === undefined ? 3 : constants.requests_per_second_limit;
    }
  };
  _proto.setSingleConfigConstants = function setSingleConfigConstants(constants) {
    this.SINGLE_GET_SORTED_BY_DATE_RESULTS = constants.single_processing && constants.single_processing.get_sorted_by_date_results ? constants.single_processing.get_sorted_by_date_results : false;
    this.SINGLE_MAX_PAGED_RESULTS_COUNT = constants.single_processing && constants.single_processing.max_paged_results_count ? constants.single_processing.max_paged_results_count : 40;
    this.SINGLE_MIN_LOADED_RESULTS_COUNT = constants.single_processing && constants.single_processing.min_loaded_results_count ? constants.single_processing.min_loaded_results_count : 10;
    this.SINGLE_MAX_LOADED_RESULTS_COUNT = constants.single_processing && constants.single_processing.max_loaded_results_count ? constants.single_processing.max_loaded_results_count : 40;
    this.SINGLE_PERSON_SHOW_MAX_RESULTS_COUNT = constants.single_processing && constants.single_processing.person_show_max_results_count ? constants.single_processing.person_show_max_results_count : 10;
    this.SINGLE_PERSON_MAX_TOTAL_REQUESTS_COUNT = constants.single_processing && constants.single_processing.max_total_requests_count ? constants.single_processing.max_total_requests_count : Number.MAX_SAFE_INTEGER;
  };
  _proto.setBatchConfigConstants = function setBatchConfigConstants(constants) {
    this.BATCH_GET_SORTED_BY_DATE_RESULTS = constants.batch_processing && constants.batch_processing.get_sorted_by_date_results ? constants.batch_processing.get_sorted_by_date_results : false;
    this.BATCH_MAX_PAGED_RESULTS_COUNT = constants.batch_processing && constants.batch_processing.max_paged_results_count ? constants.batch_processing.max_paged_results_count : 10;
    this.BATCH_MIN_LOADED_RESULTS_COUNT = constants.batch_processing && constants.batch_processing.min_loaded_results_count ? constants.batch_processing.min_loaded_results_count : 10;
    this.BATCH_MAX_LOADED_RESULTS_COUNT = constants.batch_processing && constants.batch_processing.max_loaded_results_count ? constants.batch_processing.max_loaded_results_count : 10;
    this.BATCH_PERSON_SHOW_MAX_RESULTS_COUNT = constants.batch_processing && constants.batch_processing.person_show_max_results_count ? constants.batch_processing.person_show_max_results_count : 10;
    this.BATCH_PERSON_MAX_TOTAL_REQUESTS_COUNT = constants.batch_processing && constants.batch_processing.max_total_requests_count ? constants.batch_processing.max_total_requests_count : Number.MAX_SAFE_INTEGER;
  };
  _proto.setSearchEngineConfigConstants = function setSearchEngineConfigConstants(constants) {
    this.setCommonConfigConstants(constants);
    this.setCommonAdapterConstants(constants);
    this.setSingleConfigConstants(constants);
    this.setBatchConfigConstants(constants);
    this.totalRequestResultsCountRiskScoreAdditive = constants.total_request_results_count_riskscore_additive ? constants.total_request_results_count_riskscore_additive : [];
  };
  _proto.setAdapterConstants = function setAdapterConstants(config) {
    if (this.isGoogle && config.common && config.common.google_search) {
      this.setSearchEngineConfigConstants(config.common.google_search.adapter);
    }
    if (this.isBing && config.common && config.common.bing_search) {
      this.setSearchEngineConfigConstants(config.common.bing_search.adapter);
    }
  };
  _proto.createSearchEngineRequest = function createSearchEngineRequest(personServiceId, person, parentPerson, searchConfig, isWithCountiesKeywords, offset, sortBy, dateFrom, dateTo, languages, scoreMode, userCountry, requestObjectId, groupObjectId, executionId) {
    var _this$searchEngineReq5, _this$searchEngineReq6;
    if (!offset) {
      offset = 0;
    }
    if (!sortBy) {
      sortBy = "relevancy";
    }
    var requestQuery = "";
    if (searchConfig instanceof SearchEngineRequestTmpltDetailsConfigV5) {
      var _this$searchEngineReq3;
      requestQuery = ((_this$searchEngineReq3 = this.searchEngineRequestsService) == null ? void 0 : _this$searchEngineReq3.getCompanyRequestQuery(person.getFullName(), this.EXACT_PERSON_NAME, searchConfig.getRequestTmplt())) || "";
    } else {
      var _this$searchEngineReq4, _this$mediaSearchEngi;
      var personQuery = ((_this$searchEngineReq4 = this.searchEngineRequestsService) == null ? void 0 : _this$searchEngineReq4.getPersonRequestQuery(person.getFullName(), this.EXACT_PERSON_NAME, person.getKeywords(), isWithCountiesKeywords ? person.getCountriesKeywords() : "")) || "";
      var allQueryParts = ((_this$mediaSearchEngi = this.mediaSearchEngineService) == null ? void 0 : _this$mediaSearchEngi.getAllQueryParts(searchConfig)) || "";
      requestQuery = personQuery + (allQueryParts && allQueryParts.length ? " AND " + allQueryParts : "");
    }
    return new MediaSearchRequestV1(((_this$searchEngineReq5 = this.searchEngineRequestsService) == null ? void 0 : _this$searchEngineReq5.getBaseRequestQuery(requestQuery, dateFrom, dateTo, (languages || []).length ? languages : searchConfig.getLanguages(), userCountry)) || "", ((_this$searchEngineReq6 = this.searchEngineRequestsService) == null ? void 0 : _this$searchEngineReq6.getRequestQuery(requestQuery, dateFrom, dateTo, (languages || []).length ? languages : searchConfig.getLanguages(), userCountry, offset, sortBy)) || "", personServiceId, person, parentPerson, searchConfig, sortBy, offset, (!person.isAliasPerson() ? 1 : person.checkIsCompany() ? this.COMPANY_ALIAS_RISKSCORE : this.PERSON_ALIAS_RISKSCORE) * searchConfig.getRiskScore(), isWithCountiesKeywords, executionId, requestObjectId, groupObjectId, scoreMode, userCountry, 0);
  };
  _proto.addRequestToCommonQueue = function addRequestToCommonQueue(newRequest, isBatch) {
    if (!this.FINAL_SCORE_THRESHOLD || this.FINAL_SCORE_THRESHOLD && newRequest.getRiskScore() >= this.FINAL_SCORE_THRESHOLD) {
      if (!this.checkAlreadyProcessingOrProcessedRequestsCount(newRequest.getPersonServiceId(), isBatch, newRequest.getParentPersonId())) {
        SearchEngineAdapterV1.commonRequestsQueue.push(newRequest);
      }
    }
  };
  _proto.performPersonRequest$ = function performPersonRequest$(parentPerson, personsService, requestConfigId, personsRequestsService, dateFrom, dateTo, isAddWithoutDate, languages, userCountry, isBatch, scoreMode, requestObject, groupObject, callback, googleRequestCb) {
    var _this2 = this;
    var deferred = this.$q.defer();
    try {
      var getResults$ = this.getResults$(parentPerson, personsService, requestConfigId, personsRequestsService, dateFrom, dateTo, isAddWithoutDate, languages, userCountry, isBatch, scoreMode, callback, googleRequestCb);
      var loadResults = this.loadPersonResults.bind(this);
      this.processPersonRequest$(parentPerson, isBatch, requestObject, groupObject, getResults$, loadResults, callback).then(function () {})["catch"](function (error) {
        _this2.errorLogger(error);
      })["finally"](function () {
        deferred.resolve(parentPerson);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.getResults$ = function getResults$(parentPerson, personsService, requestConfigId, personsRequestsService, dateFrom, dateTo, isAddWithoutDate, languages, userCountry, isBatch, scoreMode, callback, googleRequestCb) {
    var _this3 = this;
    var deferred = this.$q.defer();
    try {
      var executionId = generateUUID();
      personsRequestsService.getPersonRequests(parentPerson.getId(), requestConfigId, Number.MAX_SAFE_INTEGER).forEach(function (personRequest) {
        var personRequestConfig = personRequest.getRequest();
        if (personRequestConfig) {
          var newRelevancyRequest = _this3.createSearchEngineRequest(personsService.getServiceId(), parentPerson, parentPerson, personRequestConfig, !!(parentPerson.getCountriesKeywords() && !isBatch), 0, "relevancy", dateFrom, dateTo, languages, scoreMode, userCountry, personRequest.getRequestObjectId(), personRequest.getGroupObjectId(), executionId);
          _this3.addRequestToCommonQueue(newRelevancyRequest, isBatch);
          if (_this3.isGoogle && (isBatch ? _this3.BATCH_GET_SORTED_BY_DATE_RESULTS : _this3.SINGLE_GET_SORTED_BY_DATE_RESULTS)) {
            var newDateRequest = _this3.createSearchEngineRequest(personsService.getServiceId(), parentPerson, parentPerson, personRequestConfig, !!(parentPerson.getCountriesKeywords() && !isBatch), 0, "date", dateFrom, dateTo, languages, scoreMode, userCountry, personRequest.getRequestObjectId(), personRequest.getGroupObjectId(), executionId);
            _this3.addRequestToCommonQueue(newDateRequest, isBatch);
          }
        }
        personRequest.clear();
      });
      personsService.getLinkedPersonsById(parentPerson.getId()).forEach(function (linkedPerson) {
        personsRequestsService.getPersonRequests(linkedPerson.getId(), requestConfigId, Number.MAX_SAFE_INTEGER).forEach(function (personRequest) {
          var personRequestConfig = personRequest.getRequest();
          if (personRequestConfig) {
            var newRelevancyRequest = _this3.createSearchEngineRequest(personsService.getServiceId(), linkedPerson, parentPerson, personRequestConfig, !!(linkedPerson.getCountriesKeywords() && !isBatch), 0, "relevancy", dateFrom, dateTo, languages, scoreMode, userCountry, personRequest.getRequestObjectId(), personRequest.getGroupObjectId(), executionId);
            _this3.addRequestToCommonQueue(newRelevancyRequest, isBatch);
            if (_this3.isGoogle && (isBatch ? _this3.BATCH_GET_SORTED_BY_DATE_RESULTS : _this3.SINGLE_GET_SORTED_BY_DATE_RESULTS)) {
              var newDateRequest = _this3.createSearchEngineRequest(personsService.getServiceId(), linkedPerson, parentPerson, personRequestConfig, !!(linkedPerson.getCountriesKeywords() && !isBatch), 0, "date", dateFrom, dateTo, languages, scoreMode, userCountry, personRequest.getRequestObjectId(), personRequest.getGroupObjectId(), executionId);
              _this3.addRequestToCommonQueue(newDateRequest, isBatch);
            }
          }
          personRequest.clear();
        });
      });
      if (!this.startProcessTime) {
        this.startProcessTime = new Date().getTime();
      }
      var successCallback = function successCallback() {
        personsRequestsService.clearAll();
        deferred.resolve(parentPerson);
      };
      var errorCallback = function errorCallback(error) {
        deferred.reject(error);
      };
      this.processSearchEngineRequests(personsService, personsRequestsService, executionId, isBatch, dateFrom, dateTo, isAddWithoutDate, languages, callback, googleRequestCb, successCallback, errorCallback);
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.processSearchEngineRequests = function processSearchEngineRequests(personsService, personsRequestsService, executionId, isBatch, dateFrom, dateTo, isAddWithoutDate, languages, callback, googleRequestCb, successCallback, errorCallback) {
    var _this4 = this;
    var callMethodId = generateUUID();
    this.infoLogger("MethodId = " + callMethodId + ". " + ("Start new iteration of 'processSearchEngineRequests' method with executionId = " + executionId));
    var notAlreadyProcessedRequestsCount = SearchEngineAdapterV1.commonRequestsQueue.filter(function (req) {
      return req.getExecutionId() === executionId && req.getPersonServiceId() === personsService.getServiceId() && !(req.checkIsProcessing() || req.checkIsProcessed());
    }).length;
    this.infoLogger("MethodId = " + callMethodId + ". " + ("There are " + notAlreadyProcessedRequestsCount + " not already processed requests in queue with executionId = " + executionId));
    if (notAlreadyProcessedRequestsCount !== 0) {
      var currPeriod = (new Date().getTime() - (this.startProcessTime || 0)) / (this.isGoogle ? this.MILLISECONDS_IN_MINUTE || 60000 : this.MILLISECONDS_IN_SECOND || 1000);
      if (SearchEngineAdapterV1.requestsPerEveryPeriod.length <= currPeriod) {
        SearchEngineAdapterV1.requestsPerEveryPeriod.push({
          startTime: new Date().getTime(),
          count: 0
        });
      }
      this.infoLogger("MethodId = " + callMethodId + ". " + ("There are " + SearchEngineAdapterV1.requestsPerEveryPeriod[SearchEngineAdapterV1.requestsPerEveryPeriod.length - 1].count + " requests that were be performed during last period with executionId = " + executionId));
      if (SearchEngineAdapterV1.commonRequestsQueue.filter(function (req) {
        return req.checkIsProcessing();
      }).length < this.REQUESTS_PARALLEL_LIMIT && SearchEngineAdapterV1.requestsPerEveryPeriod[SearchEngineAdapterV1.requestsPerEveryPeriod.length - 1].count < this.REQUESTS_PER_PERIOD_LIMIT) {
        var currProcessingRequestsCount = SearchEngineAdapterV1.commonRequestsQueue.filter(function (req) {
          return req.checkIsProcessing();
        }).length;
        var commonRequestsQueueLength = SearchEngineAdapterV1.commonRequestsQueue.filter(function (req) {
          return !(req.checkIsProcessing() || req.checkIsProcessed());
        }).length;
        var currIterateRequestsCount = this.REQUESTS_PARALLEL_LIMIT - commonRequestsQueueLength;
        if (currIterateRequestsCount <= 0) {
          currIterateRequestsCount = this.REQUESTS_PARALLEL_LIMIT;
        }
        this.infoLogger("MethodId = " + callMethodId + ". " + ("There are " + currProcessingRequestsCount + " already processing requests ") + ("and " + currIterateRequestsCount + " maximum requests to process in current iteration with executionId = " + executionId));
        var currentIterateRequests = this.getCurrentIterationsRequests(personsService, executionId, isBatch, currIterateRequestsCount);
        this.infoLogger("MethodId = " + callMethodId + ". " + ("Got " + currentIterateRequests.length + " requests to process in current iteration with executionId = " + executionId));
        currentIterateRequests.forEach(function (req) {
          req.incCounter();
          req.setProcessing(true);
          req.setProcessed(false);
        });
        if (currentIterateRequests.length > 0) {
          currentIterateRequests.forEach(function (req) {
            var _this4$searchEngineRe;
            SearchEngineAdapterV1.requestsPerEveryPeriod[SearchEngineAdapterV1.requestsPerEveryPeriod.length - 1].count++;
            var logMsg = "MethodId = " + callMethodId + ". " + ("Current number of request that will be started now: " + SearchEngineAdapterV1.requestsPerEveryPeriod[SearchEngineAdapterV1.requestsPerEveryPeriod.length - 1].count + ". Request URL: " + req.getUrl());
            _this4.infoLogger(logMsg);
            var person = req.getPerson();
            var parentPerson = req.getParentPerson();
            var requestConfig = req.getRequestConfig();
            var requestRiskScore = req.getRiskScore();
            var isRequestWithCountries = req.checkIsWithCountiesKeywords();
            var requestSortBy = req.getSortBy();
            var requestOffset = req.getOffset();
            var requestRequestObjectId = req.getRequestObjectId();
            var requestGroupObjectId = req.getGroupObjectId();
            var requestScoreMode = req.getScoreMode();
            var requestUserCountry = req.getUserCountry();
            _this4.infoLogger("MethodId = " + callMethodId + ". " + ("Start send Google Search request with URL = " + req.getUrl()));
            var dataResultsCount = 0;
            req.setStartTime(Date.now());
            (_this4$searchEngineRe = _this4.searchEngineRequestsService) == null || _this4$searchEngineRe.getParsedSearchResults$(req.getUrl()).then(function (data) {
              googleRequestCb();
              req.setProcessing(false);
              req.setProcessed(true);
              if (person != null && person.isAliasPerson()) {
                parentPerson == null || parentPerson.addAliasPersonGoogleSearchRequest(person, req.getBaseUrl(), "200", req.getSortBy());
              } else if (person != null && person.isLinkedPerson()) {
                parentPerson == null || parentPerson.addLinkedPersonGoogleSearchRequest(person, req.getBaseUrl(), "200", req.getSortBy());
              } else {
                parentPerson == null || parentPerson.addMainPersonGoogleSearchRequest(req.getBaseUrl(), "200", req.getSortBy());
              }
              if ((data.results || []).length && requestRiskScore >= _this4.FINAL_SCORE_THRESHOLD) {
                dataResultsCount = data.totalResultsCount;
                var totalResultsCountRiskScoreAdditive = findTotalResultsRiskScoreAdditive(_this4.totalRequestResultsCountRiskScoreAdditive, data.totalResultsCount);
                var newCreatedResults = [];
                (data.results || []).forEach(function (newSearchResult, idx) {
                  if (requestConfig && person) {
                    var newCreatedResult = _this4.createResult(req, newSearchResult, idx, requestConfig, person, requestRequestObjectId, requestGroupObjectId, isAddWithoutDate, requestScoreMode);
                    if (newCreatedResult != null) {
                      newCreatedResults.push(newCreatedResult);
                    }
                  }
                });
                newCreatedResults.forEach(function (newCreatedResult) {
                  if (requestConfig && _this4.checkSearchEngineResultShouldAdd(newCreatedResult, requestConfig)) {
                    var pubYearRiskScoreAdditive = getPublicationYearRiskScoreAdditive(newCreatedResult.getDate());
                    newCreatedResult.setRiskScoreAdditives(totalResultsCountRiskScoreAdditive, pubYearRiskScoreAdditive);
                    parentPerson == null || parentPerson.addSearchEngineResult(newCreatedResult);
                  }
                });
                parentPerson == null || parentPerson.prependSortedResults();
                parentPerson == null || parentPerson.setResults(_this4.getAdapterSourceCode(), isBatch ? _this4.BATCH_PERSON_SHOW_MAX_RESULTS_COUNT : _this4.SINGLE_PERSON_SHOW_MAX_RESULTS_COUNT);
                parentPerson == null || parentPerson.setTotalResults();
                if (callback) {
                  callback([parentPerson]);
                }
              }
              if (parentPerson && _this4.checkAlreadyProcessingOrProcessedRequestsCount(personsService.getServiceId(), isBatch, parentPerson == null ? void 0 : parentPerson.getId())) {
                SearchEngineAdapterV1.commonRequestsQueue = SearchEngineAdapterV1.commonRequestsQueue.filter(function (r) {
                  var flag = true;
                  if (r.getPersonServiceId() === personsService.getServiceId() && r.getParentPersonId() === (parentPerson == null ? void 0 : parentPerson.getId()) && !(r.checkIsProcessing() || r.checkIsProcessed())) {
                    flag = false;
                  }
                  return flag;
                });
              } else {
                var totalResultsCount = data.totalResultsCount;
                var nextPageStartIdx = _this4.getNextPageStartIdx(requestOffset);
                if (totalResultsCount > 10 && nextPageStartIdx < (!isBatch ? _this4.SINGLE_MAX_PAGED_RESULTS_COUNT : _this4.BATCH_MAX_PAGED_RESULTS_COUNT) && (_this4.isGoogle ? nextPageStartIdx - 1 < 100 : true)) {
                  if (person && parentPerson && requestConfig) {
                    var newRequest = _this4.createSearchEngineRequest(personsService.getServiceId(), person, parentPerson, requestConfig, isRequestWithCountries, nextPageStartIdx, requestSortBy, dateFrom, dateTo, languages, requestScoreMode, requestUserCountry, requestRequestObjectId, requestGroupObjectId, executionId);
                    _this4.addRequestToCommonQueue(newRequest, isBatch);
                  }
                } else if (((parentPerson == null ? void 0 : parentPerson.getAllTypeResults(_this4.getAdapterSourceCode())) || 0) >= (!isBatch ? _this4.SINGLE_PERSON_SHOW_MAX_RESULTS_COUNT : _this4.BATCH_PERSON_SHOW_MAX_RESULTS_COUNT)) {
                  if (parentPerson && !personsService.getLinkedPersonsById(parentPerson.getId()).length) {
                    SearchEngineAdapterV1.commonRequestsQueue = SearchEngineAdapterV1.commonRequestsQueue.filter(function (r) {
                      var flag = true;
                      if (r.getPersonServiceId() === personsService.getServiceId() && r.getParentPersonId() === (parentPerson == null ? void 0 : parentPerson.getId()) && !(r.checkIsProcessing() || r.checkIsProcessed()) && r.getRiskScore() < requestRiskScore) {
                        flag = false;
                      }
                      return flag;
                    });
                  }
                } else if (isRequestWithCountries) {
                  if (requestSortBy === "relevancy") {
                    if (person && parentPerson && requestConfig) {
                      var _newRequest = _this4.createSearchEngineRequest(personsService.getServiceId(), person, parentPerson, requestConfig, false, 0, "relevancy", dateFrom, dateTo, languages, requestScoreMode, requestUserCountry, requestRequestObjectId, requestGroupObjectId, executionId);
                      _this4.addRequestToCommonQueue(_newRequest, isBatch);
                    }
                  }
                  if (requestSortBy === "date" && _this4.isGoogle && (isBatch ? _this4.BATCH_GET_SORTED_BY_DATE_RESULTS : _this4.SINGLE_GET_SORTED_BY_DATE_RESULTS)) {
                    if (person && parentPerson && requestConfig) {
                      var _newRequest2 = _this4.createSearchEngineRequest(personsService.getServiceId(), person, parentPerson, requestConfig, false, 0, "date", dateFrom, dateTo, languages, requestScoreMode, requestUserCountry, requestRequestObjectId, requestGroupObjectId, executionId);
                      _this4.addRequestToCommonQueue(_newRequest2, isBatch);
                    }
                  }
                } else if (person && requestConfig) {
                  personsService.getAliasPersonsById(person.getId()).forEach(function (aliasPerson) {
                    personsRequestsService.getPersonRequests(aliasPerson.getId(), requestConfig.getId(), Number.MAX_SAFE_INTEGER).forEach(function (personRequest) {
                      var personRequestConfig = personRequest.getRequest();
                      if (parentPerson && personRequestConfig) {
                        var _newRequest3 = _this4.createSearchEngineRequest(personsService.getServiceId(), aliasPerson, parentPerson, personRequestConfig, !!(person.getCountriesKeywords() && !isBatch), 0, "relevancy", dateFrom, dateTo, languages, requestScoreMode, requestUserCountry, personRequest.getRequestObjectId(), personRequest.getGroupObjectId(), executionId);
                        _this4.addRequestToCommonQueue(_newRequest3, isBatch);
                        if (_this4.isGoogle && (isBatch ? _this4.BATCH_GET_SORTED_BY_DATE_RESULTS : _this4.SINGLE_GET_SORTED_BY_DATE_RESULTS)) {
                          var newDateRequest = _this4.createSearchEngineRequest(personsService.getServiceId(), aliasPerson, parentPerson, personRequestConfig, !!(person.getCountriesKeywords() && !isBatch), 0, "date", dateFrom, dateTo, languages, requestScoreMode, requestUserCountry, personRequest.getRequestObjectId(), personRequest.getGroupObjectId(), executionId);
                          _this4.addRequestToCommonQueue(newDateRequest, isBatch);
                        }
                      }
                      personRequest.clear();
                    });
                  });
                }
              }
            })["catch"](function (error) {
              _this4.errorLogger(error);
              var isHttpError = error.status || error.response && error.response.status;
              if (isHttpError) {
                var statusCode = !error.status ? error.response.status.toString() : error.status.toString();
                if (person != null && person.isAliasPerson()) {
                  parentPerson == null || parentPerson.addAliasPersonGoogleSearchRequest(person, req.getBaseUrl(), statusCode, req.getSortBy());
                } else if (person != null && person.isLinkedPerson()) {
                  parentPerson == null || parentPerson.addLinkedPersonGoogleSearchRequest(person, req.getBaseUrl(), statusCode, req.getSortBy());
                } else {
                  parentPerson == null || parentPerson.addMainPersonGoogleSearchRequest(req.getBaseUrl(), statusCode, req.getSortBy());
                }
                var limitPerPeriodExceed = false;
                var limitPerDayExceed = false;
                var serviceIsUnavailable = false;
                if (!error.status) {
                  if (error.response.status.toString() === "403" || error.response.status.toString() === "429") {
                    limitPerPeriodExceed = true;
                    if (error.response.data && error.response.data.error && error.response.data.error.message && error.response.data.error.message.indexOf("Queries per day") !== -1) {
                      limitPerDayExceed = true;
                    }
                  }
                  if (error.response.status.toString() === "503") {
                    serviceIsUnavailable = true;
                  }
                } else {
                  if (error.status.toString() === "403" || error.status.toString() === "429") {
                    limitPerPeriodExceed = true;
                    if (error.data && error.data.error && error.data.error.message && error.data.error.message.indexOf("Queries per day") !== -1) {
                      limitPerDayExceed = true;
                    }
                  }
                  if (error.status.toString() === "503") {
                    serviceIsUnavailable = true;
                  }
                }
                if (limitPerDayExceed) {
                  req.setProcessing(false);
                  req.setProcessed(true);
                } else {
                  if (limitPerPeriodExceed) {
                    SearchEngineAdapterV1.requestsPerEveryPeriod[SearchEngineAdapterV1.requestsPerEveryPeriod.length - 1].count = Number.MAX_VALUE;
                  }
                  if (req.getCounter() < _this4.REQUEST_RETRY_LIMIT_COUNT && !serviceIsUnavailable) {
                    req.setProcessing(false);
                    req.setProcessed(false);
                  } else {
                    req.setProcessing(false);
                    req.setProcessed(true);
                  }
                }
                if (limitPerDayExceed) {
                  parentPerson == null || parentPerson.setGoogleSearchApiDayLimitExceed(true);
                }
              } else if (req.getCounter() < _this4.REQUEST_RETRY_LIMIT_COUNT) {
                req.setProcessing(false);
                req.setProcessed(false);
              } else {
                req.setProcessing(false);
                req.setProcessed(true);
              }
            })["finally"](function () {
              _this4.infoLogger("MethodId = " + callMethodId + ". " + ("Finish send Google Search request with URL = " + req.getUrl() + ". ") + ("Found results count: " + dataResultsCount));
              if (req.checkIsProcessed()) {
                var currRequestIdx = SearchEngineAdapterV1.commonRequestsQueue.findIndex(function (el) {
                  return el.getId() === req.getId();
                });
                if (currRequestIdx !== -1) {
                  SearchEngineAdapterV1.commonRequestsQueue.splice(currRequestIdx, 1);
                }
              }
              if (req.checkIsProcessed()) {
                req.setFinishTime(Date.now());
                SearchEngineAdapterV1.processedRequests.push(req);
              }
              if (!SearchEngineAdapterV1.commonRequestsQueue.find(function (r) {
                return r.getExecutionId() === executionId && r.getPersonServiceId() === personsService.getServiceId() && r.getParentPersonId() === (parentPerson == null ? void 0 : parentPerson.getId());
              })) {
                parentPerson == null || parentPerson.prependSortedResults();
                parentPerson == null || parentPerson.setResults(_this4.getAdapterSourceCode(), isBatch ? _this4.BATCH_PERSON_SHOW_MAX_RESULTS_COUNT : _this4.SINGLE_PERSON_SHOW_MAX_RESULTS_COUNT);
                parentPerson == null || parentPerson.setTotalResults();
                if (callback) {
                  callback([parentPerson]);
                }
              }
              _this4.processSearchEngineRequests(personsService, personsRequestsService, executionId, isBatch, dateFrom, dateTo, isAddWithoutDate, languages, callback, googleRequestCb, successCallback, errorCallback);
            });
          });
        } else {
          var timeOut = setTimeout(function () {
            clearTimeout(timeOut);
            _this4.processSearchEngineRequests(personsService, personsRequestsService, executionId, isBatch, dateFrom, dateTo, isAddWithoutDate, languages, callback, googleRequestCb, successCallback, errorCallback);
          }, 5000);
        }
      } else if (SearchEngineAdapterV1.requestsPerEveryPeriod[SearchEngineAdapterV1.requestsPerEveryPeriod.length - 1].count >= this.REQUESTS_PER_PERIOD_LIMIT) {
        var currTime = new Date();
        var total = (this.isGoogle ? this.MILLISECONDS_IN_MINUTE || 60000 : this.MILLISECONDS_IN_SECOND || 1000) - (currTime.getTime() - SearchEngineAdapterV1.requestsPerEveryPeriod[SearchEngineAdapterV1.requestsPerEveryPeriod.length - 1].startTime) + (this.START_AFTER_TIMEOUT_DELAY || 1000);
        this.infoLogger("MethodId = " + callMethodId + ". " + ("Limit for requests per minute was reached with executionId = " + executionId));
        if (!this.timeouts[executionId]) {
          this.infoLogger("MethodId = " + callMethodId + ". " + ("Timeout for executionId = " + executionId + " was not already set"));
          if (this.fakeLoadingCounter === 0) {
            this.fakeLoader(0, total);
          }
          this.fakeLoadingCounter += 1;
          this.infoLogger("MethodId = " + callMethodId + ". " + ("Start set timeout in " + total + " ms for executionId = " + executionId));
          this.timeouts[executionId] = setTimeout(function () {
            clearTimeout(_this4.timeouts[executionId]);
            _this4.timeouts[executionId] = null;
            delete _this4.timeouts[executionId];
            _this4.fakeLoadingCounter -= 1;
            _this4.infoLogger("MethodId = " + callMethodId + ". " + ("Start new iteration of 'processSearchEngineRequests' after timeout in " + total + " ms for executionId = " + executionId));
            _this4.processSearchEngineRequests(personsService, personsRequestsService, executionId, isBatch, dateFrom, dateTo, isAddWithoutDate, languages, callback, googleRequestCb, successCallback, errorCallback);
          }, total);
          this.infoLogger("MethodId = " + callMethodId + ". " + ("Timeout in " + total + " ms for executionId = " + executionId + " was set"));
        } else {
          this.infoLogger("MethodId = " + callMethodId + ". " + ("Timeout for executionId = " + executionId + " was already set"));
        }
      } else {
        var _timeOut = setTimeout(function () {
          clearTimeout(_timeOut);
          _this4.processSearchEngineRequests(personsService, personsRequestsService, executionId, isBatch, dateFrom, dateTo, isAddWithoutDate, languages, callback, googleRequestCb, successCallback, errorCallback);
        }, 5000);
      }
    } else if (!SearchEngineAdapterV1.commonRequestsQueue.find(function (req) {
      return req.getExecutionId() === executionId && req.getPersonServiceId() === personsService.getServiceId();
    })) {
      this.infoLogger("MethodId = " + callMethodId + ". " + ("Finish processing requests with executionId = " + executionId));
      SearchEngineAdapterV1.clearProcessedPersonRequests(personsService.getServiceId(), executionId);
      successCallback();
    } else {}
  };
  _proto.getCurrentIterationsRequests = function getCurrentIterationsRequests(personsService, executionId, isBatch, currIterateRequestsCount) {
    var _this5 = this;
    var currentIterateRequests = [];
    SearchEngineAdapterV1.commonRequestsQueue.filter(function (req) {
      return req.getExecutionId() === executionId && req.getPersonServiceId() === personsService.getServiceId();
    }).map(function (req) {
      return req.getParentPersonId();
    }).filter(onlyUnique).forEach(function (parentPersonId) {
      var parentPersonRequests = SearchEngineAdapterV1.commonRequestsQueue.filter(function (req) {
        return req.getExecutionId() === executionId && req.getPersonServiceId() === personsService.getServiceId() && !(req.checkIsProcessing() || req.checkIsProcessed()) && req.getParentPersonId() === parentPersonId;
      });
      var alreadyProcessedOrProcessingPersonRequests = SearchEngineAdapterV1.getTotalProcessingOrProcessedPersonRequests(personsService.getServiceId(), parentPersonId);
      var maxPersonRequestsCount = !isBatch ? _this5.SINGLE_PERSON_MAX_TOTAL_REQUESTS_COUNT : _this5.BATCH_PERSON_MAX_TOTAL_REQUESTS_COUNT;
      var availableRequestsCount = alreadyProcessedOrProcessingPersonRequests.length >= maxPersonRequestsCount ? 0 : maxPersonRequestsCount - alreadyProcessedOrProcessingPersonRequests.length;
      if (availableRequestsCount) {
        currentIterateRequests = currentIterateRequests.concat(parentPersonRequests.sort(compareByRiskScore).splice(0, availableRequestsCount));
      }
    });
    currentIterateRequests = currentIterateRequests.sort(compareByRiskScore).splice(0, currIterateRequestsCount);
    return currentIterateRequests;
  };
  _proto.checkAlreadyProcessingOrProcessedRequestsCount = function checkAlreadyProcessingOrProcessedRequestsCount(personsServiceId, isBatch, parentPersonId) {
    var alreadyProcessedOrProcessingPersonRequests = SearchEngineAdapterV1.getTotalProcessingOrProcessedPersonRequests(personsServiceId, parentPersonId);
    var maxPersonRequestsCount = !isBatch ? this.SINGLE_PERSON_MAX_TOTAL_REQUESTS_COUNT : this.BATCH_PERSON_MAX_TOTAL_REQUESTS_COUNT;
    return alreadyProcessedOrProcessingPersonRequests.length >= maxPersonRequestsCount;
  };
  SearchEngineAdapterV1.getTotalProcessingOrProcessedPersonRequests = function getTotalProcessingOrProcessedPersonRequests(personsServiceId, parentPersonId) {
    return SearchEngineAdapterV1.commonRequestsQueue.concat(SearchEngineAdapterV1.processedRequests).filter(function (req) {
      return req.getPersonServiceId() === personsServiceId && (req.checkIsProcessing() || req.checkIsProcessed()) && req.getParentPersonId() === parentPersonId;
    });
  };
  SearchEngineAdapterV1.clearProcessedPersonRequests = function clearProcessedPersonRequests(personsServiceId, executionId) {
    var processedRequests = SearchEngineAdapterV1.processedRequests.filter(function (req) {
      return req.getPersonServiceId() === personsServiceId && req.getExecutionId() === executionId;
    });
    processedRequests.forEach(function (req) {
      req.clear();
    });
  };
  SearchEngineAdapterV1.removeProcessedRequests = function removeProcessedRequests(personsServiceId, executionId) {
    SearchEngineAdapterV1.processedRequests = SearchEngineAdapterV1.processedRequests.filter(function (req) {
      var flag = true;
      if (req.getPersonServiceId() === personsServiceId && (executionId ? req.getExecutionId() === executionId : true)) {
        flag = false;
      }
      return flag;
    });
  };
  _proto.loadPersonResults = function loadPersonResults(parentPerson, isBatch, requestObject, groupObject, callback, successCallback, errorCallback) {
    var _this6 = this;
    try {
      parentPerson.filterLoadedRequestObjectResults(requestObject ? requestObject.getId() : null, this.getAdapterSourceCode());
      var showResultsCount = 0;
      var minHighRiskScoreResultsCount = 0;
      var highRiskScore = 0;
      var maxHighRiskScoreResultsCount = 0;
      if (groupObject) {
        showResultsCount = groupObject.getMaxResultsCount();
        minHighRiskScoreResultsCount = groupObject.getMaxResultsCount();
        highRiskScore = groupObject.getMinRiskScore();
        maxHighRiskScoreResultsCount = groupObject.getMaxResultsCount();
      } else {
        showResultsCount = !isBatch ? this.SINGLE_PERSON_SHOW_MAX_RESULTS_COUNT : this.BATCH_PERSON_SHOW_MAX_RESULTS_COUNT;
        minHighRiskScoreResultsCount = !isBatch ? this.SINGLE_MIN_LOADED_RESULTS_COUNT : this.BATCH_MIN_LOADED_RESULTS_COUNT;
        highRiskScore = 0.7;
        maxHighRiskScoreResultsCount = !isBatch ? this.SINGLE_MAX_LOADED_RESULTS_COUNT : this.BATCH_MAX_LOADED_RESULTS_COUNT;
      }
      var topResults = parentPerson.getResultsForLoad(this.getAdapterSourceCode(), requestObject ? requestObject.getId() : null, groupObject ? groupObject.getId() : null, showResultsCount, highRiskScore, minHighRiskScoreResultsCount, maxHighRiskScoreResultsCount);
      parentPerson.setTotalResults();
      if (callback) {
        callback([parentPerson]);
      }
      var batchPromiseArray = [];
      topResults.forEach(function (topResult, idx) {
        var _this6$processingAdap, _this6$mediaSearchEng;
        batchPromiseArray.push((_this6$processingAdap = _this6.processingAdapter) == null ? void 0 : _this6$processingAdap.loadDocument$(topResult, ((_this6$mediaSearchEng = _this6.mediaSearchEngineService) == null ? void 0 : _this6$mediaSearchEng.getMandatoryAdditionalKeywords()) || [], requestObject, idx, topResults.length));
      });
      batchPromiseArray = batchPromiseArray.filter(function (p) {
        return p;
      });
      this.logStartLoadResults(parentPerson, requestObject, topResults.length);
      if (batchPromiseArray.length) {
        this.$q.all(batchPromiseArray).then(function () {})["catch"](function (error) {
          _this6.errorLogger(error);
        })["finally"](function () {
          _this6.loadPersonResults(parentPerson, isBatch, requestObject, groupObject, callback, successCallback, errorCallback);
        });
      } else {
        successCallback(parentPerson);
      }
    } catch (error) {
      this.errorLogger(error);
      errorCallback(error);
    }
  };
  _proto.checkSearchEngineResultShouldAdd = function checkSearchEngineResultShouldAdd(newCreatedResult, searchConfig) {
    var shouldAdd = false;
    try {
      if (newCreatedResult.checkPersonIsMentionedInSummary(this.EXACT_PERSON_NAME)) {
        if (searchConfig instanceof SearchEngineRequestTmpltDetailsConfigV5) {
          shouldAdd = true;
        } else {
          var newCreatedResultSummaryKeywords = newCreatedResult.getSummaryKeywords(newCreatedResult.getKeywords());
          if (newCreatedResultSummaryKeywords.length) {
            shouldAdd = true;
          } else if (this.INCLUDE_RESULTS_WITHOUT_KEYWORDS) {
            newCreatedResult.setRiskScore(this.RESULT_WITHOUT_KEYWORDS_RISKSCORE);
            shouldAdd = true;
          }
        }
      }
    } catch (error) {
      this.errorLogger(error);
    }
    return shouldAdd;
  };
  _proto.createResult = function createResult(req, newSearchResult, idx, searchConfig, person, requestObjectId, groupObjectId, isAddWithoutDate, scoreMode) {
    var newCreatedResult = null;
    try {
      var _this$mediaSearchEngi2, _this$mediaSearchEngi3, _this$mediaSearchEngi4, _this$mediaSearchEngi5, _this$mediaSearchEngi6;
      if ((_this$mediaSearchEngi2 = this.mediaSearchEngineService) != null && _this$mediaSearchEngi2.checkSiteIsExcluded(newSearchResult.linkUrl || "") || (_this$mediaSearchEngi3 = this.mediaSearchEngineService) != null && _this$mediaSearchEngi3.checkTitleHasBannedKeywords(newSearchResult.title || "") || (_this$mediaSearchEngi4 = this.mediaSearchEngineService) != null && _this$mediaSearchEngi4.checkSummaryHasBannedKeywords(newSearchResult.title || "", newSearchResult.description || "") || (_this$mediaSearchEngi5 = this.mediaSearchEngineService) != null && _this$mediaSearchEngi5.checkTitleOrDescriptionContainsBannedCharacters(newSearchResult.title || "", newSearchResult.description || "")) {
        return newCreatedResult;
      }
      if ((newSearchResult.linkUrl || "").endsWith(".xml")) {
        return newCreatedResult;
      }
      var pubDate = getPublicationDate(newSearchResult.descriptionHtml || "");
      if (!pubDate && !isAddWithoutDate) {
        return newCreatedResult;
      }
      var clearedDescriptionHtml = newSearchResult.descriptionHtml || "";
      if (pubDate !== null) {
        clearedDescriptionHtml = removeDatePart(clearedDescriptionHtml);
      }
      newCreatedResult = new SearchEngineResultItemV1(newSearchResult.title || "", newSearchResult.titleHtml || "", newSearchResult.description || "", clearedDescriptionHtml, newSearchResult.linkUrl || "", pubDate, this.getAdapterSourceCode());
      newCreatedResult.setRequestInfo(req.getRiskScore(), searchConfig.getId(), req.getSortBy(), this.getSearchResultPositionIdx(req.getOffset(), idx));
      newCreatedResult.setKeywords((((_this$mediaSearchEngi6 = this.mediaSearchEngineService) == null ? void 0 : _this$mediaSearchEngi6.getAllKeywords(searchConfig)) || []).map(function (keywordConfig) {
        return keywordConfig.getKeyword();
      }));
      newCreatedResult.setPersonInfo(person);
      newCreatedResult.setExtendedPersonInfo(person.getExtendedInfo());
      newCreatedResult.setItemInfo(person.getItemId());
      newCreatedResult.setGroupInfo(requestObjectId, groupObjectId);
      newCreatedResult.setScoreMode(scoreMode);
      newCreatedResult.setMediaPyRiskScore(req.getRiskScore());
      newCreatedResult.setMediaPyRiskScored(false);
      newCreatedResult.setMediaPyRiskScoreColor(req.getRiskScore(), false);
      newCreatedResult.setSentiment(0);
      newCreatedResult.setSentimentLoaded(false);
      newCreatedResult.setMediaPyTitleRiskScore(0);
      newCreatedResult.setMediaPyTitleRiskScoreColor(0, false);
      newCreatedResult.setMediaPyNameImportance(0);
      newCreatedResult.setMediaPyNameImportanceColor(0, false);
      var personNameSynonims = newCreatedResult.getPersonSynonimsFromSummary();
      if (!this.EXACT_PERSON_NAME && personNameSynonims.length) {
        newCreatedResult.setPersonSynonims(personNameSynonims);
      }
    } catch (error) {
      this.errorLogger(error);
    }
    return newCreatedResult;
  };
  _proto.getSearchResultPositionIdx = function getSearchResultPositionIdx(requestOffset, idx) {
    var positionIdx = 0;
    if (this.isGoogle) {
      positionIdx = (requestOffset > 0 ? requestOffset - 1 : requestOffset) + idx + 1;
    }
    if (this.isBing) {
      positionIdx = requestOffset + idx + 1;
    }
    return positionIdx;
  };
  _proto.getNextPageStartIdx = function getNextPageStartIdx(requestOffset) {
    var nextPageStartIdx = 0;
    if (this.isGoogle) {
      if (requestOffset === 0) {
        nextPageStartIdx = 11;
      } else {
        nextPageStartIdx = requestOffset + 10;
      }
    }
    if (this.isBing) {
      nextPageStartIdx = requestOffset + 10;
    }
    return nextPageStartIdx;
  };
  _proto.fakeLoader = function fakeLoader(ms, total) {
    var _this7 = this;
    if (ms <= total) {
      if (this.fakeLoadingBar) {
        if (this.fakeLoadingBar.status() === 0) {
          this.infoLogger("FakeLoader start");
          this.fakeLoadingBar.start();
        }
      }
      var timeOut = setTimeout(function () {
        clearTimeout(timeOut);
        _this7.fakeLoader(ms + (_this7.FAKE_LOADER_REQUESTS_DELAY || 500), total);
      }, this.FAKE_LOADER_REQUESTS_DELAY);
    } else if (this.fakeLoadingBar) {
      this.infoLogger("FakeLoader complete");
      this.fakeLoadingBar.complete();
    }
  };
  _proto.addAlertItemIdToLinkAnalys = function addAlertItemIdToLinkAnalys(alertItemId, parentPersonId, searchResultId, linkAnalysServiceId) {};
  _proto.destroy = function destroy() {
    _SearchAdapterV.prototype.destroy.call(this);
    this.searchEngineRequestsService = null;
    this.mediaSearchEngineService = null;
  };
  return SearchEngineAdapterV1;
}(SearchAdapterV1);
_SearchEngineAdapterV = SearchEngineAdapterV1;
SearchEngineAdapterV1.commonRequestsQueue = [];
SearchEngineAdapterV1.processedRequests = [];
SearchEngineAdapterV1.requestsPerEveryPeriod = [];
SearchEngineAdapterV1.periodRequestsRemoveInterval = setInterval(function () {
  var timeBeforeLastHour = Date.now() - 60 * 60 * 1000;
  _SearchEngineAdapterV.requestsPerEveryPeriod = _SearchEngineAdapterV.requestsPerEveryPeriod.filter(function (elem) {
    var flag = true;
    if (elem.startTime <= timeBeforeLastHour) {
      flag = false;
    }
    return flag;
  });
}, 60 * 60 * 1000);
SearchEngineAdapterV1.processedRequestsRemoveInterval = setInterval(function () {
  var timeBefore = Date.now() - 10 * 60 * 1000;
  _SearchEngineAdapterV.processedRequests = _SearchEngineAdapterV.processedRequests.filter(function (req) {
    var flag = true;
    if (req.getStartTime() && req.getFinishTime() && req.getFinishTime() <= timeBefore) {
      flag = false;
    }
    return flag;
  });
}, 10 * 60 * 1000);
module.exports = {
  SearchEngineAdapterV1: SearchEngineAdapterV1
};

},{"../../../common/utils/common-v4":687,"../../../common/utils/comparisons-v4":688,"../../../common/utils/filters-v4":691,"../../../constants/source-types":697,"../../instances/adapters/processing":772,"../../instances/services/http":790,"../../instances/services/requests":802,"../../models/request-configs/search-engine":828,"../../models/requests":834,"../../models/result-items":842,"../../utils/utils":891,"./search-adapter-v1":756}],758:[function(require,module,exports){
"use strict";

function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
var _require = require("./search-adapter-v1"),
  SearchAdapterV1 = _require.SearchAdapterV1;
var _require2 = require("../../models/result-items"),
  StockMarketResultItemV1 = _require2.StockMarketResultItemV1;
var _require3 = require("../../../constants/source-types"),
  STOCK_MARKETS_TYPE = _require3.STOCK_MARKETS_TYPE,
  STOCK_MARKETS_SOURCE_CODE = _require3.STOCK_MARKETS_SOURCE_CODE;
var _require4 = require("../../instances/adapters/processing"),
  ProcessingAdapterInstance = _require4.ProcessingAdapterInstance;
var _require5 = require("../../instances/services/http"),
  StockMarketsRequestsServiceInstance = _require5.StockMarketsRequestsServiceInstance;
var _require6 = require("../../instances/services/requests"),
  MediaSearchEngineServiceInstance = _require6.MediaSearchEngineServiceInstance;
var StockMarketsAdapterV1 = function (_SearchAdapterV) {
  function StockMarketsAdapterV1($rootScope, $http, $q, $timeout) {
    var _this;
    _this = _SearchAdapterV.call(this, $rootScope, $http, $q, $timeout, STOCK_MARKETS_TYPE, STOCK_MARKETS_SOURCE_CODE) || this;
    _this.stockMarketRequestsService = null;
    _this.mediaSearchEngineService = null;
    return _this;
  }
  _inheritsLoose(StockMarketsAdapterV1, _SearchAdapterV);
  var _proto = StockMarketsAdapterV1.prototype;
  _proto.initServices = function initServices(endpointsConfig) {
    this.stockMarketRequestsService = StockMarketsRequestsServiceInstance.getNewService(this.$rootScope, this.$http, this.$q, this.$timeout);
    this.stockMarketRequestsService.setUrls(endpointsConfig);
    this.mediaSearchEngineService = MediaSearchEngineServiceInstance.getNewService();
  };
  _proto.injectServices = function injectServices(stockMarketRequestsService, mediaSearchEngineService) {
    this.stockMarketRequestsService = stockMarketRequestsService;
    this.mediaSearchEngineService = mediaSearchEngineService;
  };
  _proto.initAdapters = function initAdapters() {
    this.processingAdapter = ProcessingAdapterInstance.getNewAdapter(this.$rootScope, this.$http, this.$q, this.$timeout);
  };
  _proto.injectAdapters = function injectAdapters(processingAdapter) {
    this.processingAdapter = processingAdapter;
  };
  _proto.resetAdapter = function resetAdapter() {
    var _this$processingAdapt, _this$stockMarketRequ;
    (_this$processingAdapt = this.processingAdapter) == null || _this$processingAdapt.resetAdapter();
    (_this$stockMarketRequ = this.stockMarketRequestsService) == null || _this$stockMarketRequ.resetRouteWasChanged();
  };
  _proto.setTimeouts = function setTimeouts(timeouts) {
    var _this$stockMarketRequ2;
    (_this$stockMarketRequ2 = this.stockMarketRequestsService) == null || _this$stockMarketRequ2.setTimeouts(timeouts);
  };
  _proto.setAdapterConstants = function setAdapterConstants(constants) {
    this.setCommonAdapterConstants(constants);
    this.SINGLE_INCLUDE_TO_DATE_SEARCH_RESULTS = constants.single_processing && constants.single_processing.include_to_date_search_results ? constants.single_processing.include_to_date_search_results : false;
    this.BATCH_INCLUDE_TO_DATE_SEARCH_RESULTS = constants.batch_processing && constants.batch_processing.include_to_date_search_results ? constants.batch_processing.include_to_date_search_results : false;
  };
  _proto.performPersonRequest$ = function performPersonRequest$(parentPerson, personsService, sites, isBatch, scoreMode, requestObject, groupObject, callback) {
    var _this2 = this;
    var deferred = this.$q.defer();
    try {
      var getResults$ = this.getResults$(parentPerson, personsService, sites, isBatch, scoreMode, requestObject, groupObject, callback);
      var loadResults = this.loadPersonResults.bind(this);
      this.processPersonRequest$(parentPerson, isBatch, requestObject, groupObject, getResults$, loadResults, callback).then(function () {})["catch"](function (error) {
        _this2.errorLogger(error);
      })["finally"](function () {
        deferred.resolve(parentPerson);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.getResults$ = function getResults$(parentPerson, personsService, sites, isBatch, scoreMode, requestObject, groupObject, callback) {
    var _this3 = this;
    var deferred = this.$q.defer();
    try {
      var getSinglePersonResults$ = function getSinglePersonResults$(person) {
        return _this3.getSinglePersonResults$(person, sites, isBatch, scoreMode, requestObject, groupObject);
      };
      this.getAllParentPersonResults$(parentPerson, personsService, getSinglePersonResults$).then(function () {})["catch"](function (error) {
        _this3.errorLogger(error);
      })["finally"](function () {
        deferred.resolve(parentPerson);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.getSinglePersonResults$ = function getSinglePersonResults$(person, sites, isBatch, scoreMode, requestObject, groupObject) {
    var _this4 = this;
    var deferred = this.$q.defer();
    try {
      var _this$stockMarketRequ3;
      var mappedResults = [];
      var getResultsRequest$ = (_this$stockMarketRequ3 = this.stockMarketRequestsService) == null ? void 0 : _this$stockMarketRequ3.getStockMarketResults$(person.getFullName(), isBatch, sites);
      this.getPersonResults$(getResultsRequest$).then(function (resp) {
        try {
          var results = resp;
          (results[0] || []).forEach(function (personResult) {
            if (personResult.error && personResult.error.errorMsg) {
              if (personResult.error.errorType !== "timeout_error") {
                _this4.errorLogger(personResult.error);
              }
            } else {
              (personResult.data || []).forEach(function (data) {
                var newStockMarketResult = _this4.createResult(data, person, requestObject ? requestObject.getId() : null, groupObject ? groupObject.getId() : null, scoreMode);
                if (newStockMarketResult) {
                  mappedResults.push(newStockMarketResult);
                }
              });
            }
          });
        } catch (error) {
          _this4.errorLogger(error);
        }
      })["catch"](function (error) {
        _this4.errorLogger(error);
      })["finally"](function () {
        deferred.resolve(mappedResults);
      });
    } catch (error) {
      this.errorLogger(error);
      deferred.reject(error);
    }
    return deferred.promise;
  };
  _proto.loadPersonResults = function loadPersonResults(parentPerson, isBatch, requestObject, groupObject, callback, successCallback, errorCallback) {
    var _this5 = this;
    try {
      parentPerson.filterLoadedRequestObjectResults(requestObject ? requestObject.getId() : null, this.getAdapterSourceCode());
      var showResultsCount = 0;
      var highRiskScore = 0;
      if (groupObject) {
        showResultsCount = groupObject.getMaxResultsCount();
        highRiskScore = groupObject.getMinRiskScore();
      } else {
        showResultsCount = Number.MAX_SAFE_INTEGER;
        highRiskScore = 0;
      }
      var topResults = parentPerson.getResultsForLoad(this.getAdapterSourceCode(), requestObject ? requestObject.getId() : null, groupObject ? groupObject.getId() : null, showResultsCount, highRiskScore, 0, 0);
      parentPerson.setTotalResults();
      if (callback) {
        callback([parentPerson]);
      }
      var batchPromiseArray = [];
      topResults.forEach(function (stockMarketResult, idx) {
        var _this5$processingAdap, _this5$mediaSearchEng;
        batchPromiseArray.push((_this5$processingAdap = _this5.processingAdapter) == null ? void 0 : _this5$processingAdap.loadDocument$(stockMarketResult, ((_this5$mediaSearchEng = _this5.mediaSearchEngineService) == null ? void 0 : _this5$mediaSearchEng.getMandatoryAdditionalKeywords()) || [], requestObject, idx, topResults.length));
      });
      batchPromiseArray = batchPromiseArray.filter(function (p) {
        return p;
      });
      this.logStartLoadResults(parentPerson, requestObject, topResults.length);
      if (batchPromiseArray.length) {
        this.$q.all(batchPromiseArray).then(function () {})["catch"](function (error) {
          _this5.errorLogger(error);
        })["finally"](function () {
          _this5.loadPersonResults(parentPerson, isBatch, requestObject, groupObject, callback, successCallback, errorCallback);
        });
      } else {
        successCallback(parentPerson);
      }
    } catch (error) {
      this.errorLogger(error);
      errorCallback(error);
    }
  };
  _proto.createResult = function createResult(personResult, person, requestObjectId, groupObjectId, scoreMode) {
    var newStockMarketResult = null;
    try {
      var _this$mediaSearchEngi;
      newStockMarketResult = new StockMarketResultItemV1(personResult.title, personResult.source, personResult.link, this.getAdapterSourceCode());
      if (personResult.htmlContent && personResult.htmlContent.length) {
        newStockMarketResult.setContentHtml(personResult.htmlContent);
      }
      newStockMarketResult.setKeywords((((_this$mediaSearchEngi = this.mediaSearchEngineService) == null ? void 0 : _this$mediaSearchEngi.getAllKeywords(null)) || []).map(function (keywordConfig) {
        return keywordConfig.getKeyword();
      }));
      newStockMarketResult.setPersonInfo(person);
      newStockMarketResult.setExtendedPersonInfo(person.getExtendedInfo());
      newStockMarketResult.setItemInfo(person.getItemId());
      newStockMarketResult.setGroupInfo(requestObjectId, groupObjectId);
      newStockMarketResult.setScoreMode(scoreMode);
      newStockMarketResult.setRiskScore(0.5);
      newStockMarketResult.setMediaPyRiskScore(0.5);
      newStockMarketResult.setMediaPyRiskScored(false);
      newStockMarketResult.setMediaPyRiskScoreColor(0.5, false);
      newStockMarketResult.setSentiment(0);
      newStockMarketResult.setSentimentLoaded(false);
      newStockMarketResult.setMediaPyTitleRiskScore(0);
      newStockMarketResult.setMediaPyTitleRiskScoreColor(0, false);
      newStockMarketResult.setMediaPyNameImportance(0);
      newStockMarketResult.setMediaPyNameImportanceColor(0, false);
      var personNameSynonims = newStockMarketResult.getPersonSynonimsFromSummary();
      if (personNameSynonims.length) {
        newStockMarketResult.setPersonSynonims(personNameSynonims);
      }
    } catch (error) {
      this.errorLogger(error);
    }
    return newStockMarketResult;
  };
  _proto.destroy = function destroy() {
    _SearchAdapterV.prototype.destroy.call(this);
    this.stockMarketRequestsService = null;
  };
  return StockMarketsAdapterV1;
}(SearchAdapterV1);
module.exports = {
  StockMarketsAdapterV1: StockMarketsAdapterV1
};

},{"../../../constants/source-types":697,"../../instances/adapters/processing":772,"../../instances/services/http":790,"../../instances/services/requests":802,"../../models/result-items":842,"./search-adapter-v1":756}],759:[function(require,module,exports){
"use strict";

var _require = require("../common/utils/filters-v4"),
  onlyUnique = _require.onlyUnique;
var _require2 = require("../common/utils/stopwatch"),
  StopWatch = _require2.StopWatch;
var _require3 = require("../constants/source-types"),
  GOOGLE_SEARCH_SOURCE_CODE = _require3.GOOGLE_SEARCH_SOURCE_CODE,
  GOOGLE_NEWS_SOURCE_CODE = _require3.GOOGLE_NEWS_SOURCE_CODE,
  EXTRA_SOURCE_SOURCE_CODE = _require3.EXTRA_SOURCE_SOURCE_CODE,
  STOCK_MARKETS_SOURCE_CODE = _require3.STOCK_MARKETS_SOURCE_CODE,
  ALEPH_OCCRP_SOURCE_CODE = _require3.ALEPH_OCCRP_SOURCE_CODE,
  OPEN_SANCTIONS_SOURCE_CODE = _require3.OPEN_SANCTIONS_SOURCE_CODE,
  OPEN_CORPORATES_SOURCE_CODE = _require3.OPEN_CORPORATES_SOURCE_CODE;
var _require4 = require("./factories"),
  AdaptersFactoryV1 = _require4.AdaptersFactoryV1,
  ServicesFactoryV1 = _require4.ServicesFactoryV1;
var CommonMediaSearchAdapterV1 = function () {
  function CommonMediaSearchAdapterV1($rootScope, $http, $q, $timeout, fakeLoadingBar) {
    this.$rootScope = $rootScope;
    this.$http = $http;
    this.$q = $q;
    this.$timeout = $timeout;
    this.configRequestsService = null;
    this.mediaSearchEngineService = null;
    this.scoreTypeServices = [];
    this.documentService = null;
    this.searchEngineAdapter = null;
    this.googleNewsAdapter = null;
    this.extraSourcesAdapter = null;
    this.stockMarketsAdapter = null;
    this.alephOccrpAdapter = null;
    this.openSanctionsAdapter = null;
    this.openCorporatesAdapter = null;
    this.allSearchAdapers = [];
    this.parseDocumentAdapter = null;
    this.openDocumentAdapter = null;
    this.processingAdapter = null;
    this.mediaSearchRiskScoreCountAdapter = null;
    this.fakeLoadingBar = fakeLoadingBar;
    this.countriesData = [];
    this.isProcessingAliasPersonsEnabled = true;
    this.isProcessingLinkedPersonsEnabled = true;
    this.errorLogger = null;
    this.infoLogger = null;
    this.adaptersFactory = new AdaptersFactoryV1($rootScope, $http, $q, $timeout, fakeLoadingBar);
    this.servicesFactory = new ServicesFactoryV1($rootScope, $http, $q, $timeout);
  }
  var _proto = CommonMediaSearchAdapterV1.prototype;
  _proto.initServices = function initServices(endpointsConfig) {
    this.configRequestsService = this.servicesFactory.getConfigRequestsService();
    this.configRequestsService.setUrls(endpointsConfig);
    this.mediaSearchEngineService = this.servicesFactory.getMediaSearchEngineService();
    this.scoreTypeServices = [];
    this.documentService = this.servicesFactory.getDocumentSerice();
    this.documentService.setUrls(endpointsConfig);
  };
  _proto.initAdapters = function initAdapters(endpointsConfig, fakeLoadingBar) {
    var riskScoreCountService = this.servicesFactory.getMediaSearchRiskScoreCountService();
    this.mediaSearchRiskScoreCountAdapter = this.adaptersFactory.getRiskScoringAdapter();
    this.mediaSearchRiskScoreCountAdapter.injectServices(riskScoreCountService, this.mediaSearchEngineService, this.documentService);
    var highlightService = this.servicesFactory.getHighlightSerice();
    highlightService.injectServices(this.documentService);
    var newTabWindowService = this.servicesFactory.getNewTabWindowService();
    newTabWindowService.setUrls(endpointsConfig);
    var scrapeRequestsService = this.servicesFactory.getScrapeRequestsService();
    scrapeRequestsService.setUrls(endpointsConfig);
    var scrapeAdapter = this.adaptersFactory.getScrapeAdapter();
    scrapeAdapter.injectServices(scrapeRequestsService);
    var mediaPyRequestsService = this.servicesFactory.getMediaPyRequestsService();
    mediaPyRequestsService.setUrls(endpointsConfig);
    var mediaPyAdapter = this.adaptersFactory.getMediaPyAdapter();
    mediaPyAdapter.injectServices(mediaPyRequestsService, this.documentService);
    var mediaPyGptRequestsService = this.servicesFactory.getMediaPyGptRequestsService();
    mediaPyGptRequestsService.setUrls(endpointsConfig);
    var mediaPyGptAdapter = this.adaptersFactory.getMediaPyGptAdapter();
    mediaPyGptAdapter.injectServices(mediaPyGptRequestsService, this.documentService);
    var mediaPyLLMRequestsService = this.servicesFactory.getMediaPyLLMRequestsService();
    mediaPyLLMRequestsService.setUrls(endpointsConfig);
    var mediaPyLLMAdapter = this.adaptersFactory.getMediaPyLLMAdapter();
    mediaPyLLMAdapter.injectServices(mediaPyLLMRequestsService, this.documentService);
    var googleNlpRequestsService = this.servicesFactory.getGoogleNlpRequestsService();
    googleNlpRequestsService.setUrls(endpointsConfig);
    var googleNlpAdapter = this.adaptersFactory.getGoogleNlpAdapter();
    googleNlpAdapter.injectServices(googleNlpRequestsService, this.documentService);
    this.processingAdapter = this.adaptersFactory.getProcessingAdapter();
    this.processingAdapter.injectServices(this.documentService, highlightService);
    this.processingAdapter.injectAdapters(scrapeAdapter, mediaPyAdapter, mediaPyGptAdapter, mediaPyLLMAdapter, googleNlpAdapter, this.mediaSearchRiskScoreCountAdapter);
    var googleSearchRequestService = this.servicesFactory.getGoogleSearchRequestsService();
    googleSearchRequestService.setUrls(endpointsConfig);
    this.searchEngineAdapter = this.adaptersFactory.getSearchEngineAdapter();
    this.searchEngineAdapter.injectServices(googleSearchRequestService, this.mediaSearchEngineService);
    this.searchEngineAdapter.injectAdapters(this.processingAdapter);
    var googleNewsRequestsService = this.servicesFactory.getGoogleNewsRequestsService();
    googleNewsRequestsService.setUrls(endpointsConfig);
    this.googleNewsAdapter = this.adaptersFactory.getGoogleNewsAdapter();
    this.googleNewsAdapter.injectServices(googleNewsRequestsService, this.mediaSearchEngineService);
    this.googleNewsAdapter.injectAdapters(this.processingAdapter);
    var extraSourcesRequestsService = this.servicesFactory.getExtraSourcesRequestsService();
    extraSourcesRequestsService.setUrls(endpointsConfig);
    this.extraSourcesAdapter = this.adaptersFactory.getExtraSourcesAdapter();
    this.extraSourcesAdapter.injectServices(extraSourcesRequestsService);
    this.extraSourcesAdapter.injectAdapters(this.processingAdapter);
    var stockMarketsRequestsService = this.servicesFactory.getStockMarketsRequestsService();
    stockMarketsRequestsService.setUrls(endpointsConfig);
    this.stockMarketsAdapter = this.adaptersFactory.getStockMarketsAdapter();
    this.stockMarketsAdapter.injectServices(stockMarketsRequestsService, this.mediaSearchEngineService);
    this.stockMarketsAdapter.injectAdapters(this.processingAdapter);
    var alephOccrpRequestsService = this.servicesFactory.getAlephOccrpRequestsService();
    alephOccrpRequestsService.setUrls(endpointsConfig);
    this.alephOccrpAdapter = this.adaptersFactory.getAlephOccrpAdapter();
    this.alephOccrpAdapter.injectServices(alephOccrpRequestsService);
    this.alephOccrpAdapter.injectAdapters(this.processingAdapter);
    var openSanctionsRequestsService = this.servicesFactory.getOpenSanctionsRequestsService();
    openSanctionsRequestsService.setUrls(endpointsConfig);
    this.openSanctionsAdapter = this.adaptersFactory.getOpenSanctionsAdapter();
    this.openSanctionsAdapter.injectServices(openSanctionsRequestsService);
    this.openSanctionsAdapter.injectAdapters(this.processingAdapter);
    var openCorporatesRequestsService = this.servicesFactory.getOpenCorporatesRequestsService();
    openCorporatesRequestsService.setUrls(endpointsConfig);
    this.openCorporatesAdapter = this.adaptersFactory.getOpenCorporatesAdapter();
    this.openCorporatesAdapter.injectServices(openCorporatesRequestsService);
    this.openCorporatesAdapter.injectAdapters(this.processingAdapter);
    this.allSearchAdapers = [this.searchEngineAdapter, this.googleNewsAdapter, this.extraSourcesAdapter, this.stockMarketsAdapter, this.alephOccrpAdapter, this.openCorporatesAdapter, this.openSanctionsAdapter];
    var parseDocumentRequestsService = this.servicesFactory.getParseDocumentRequestsService();
    parseDocumentRequestsService.setUrls(endpointsConfig);
    this.parseDocumentAdapter = this.adaptersFactory.getParseDocumentAdapter();
    this.parseDocumentAdapter.injectServices(parseDocumentRequestsService);
    this.openDocumentAdapter = this.adaptersFactory.getOpenDocumentAdapter();
    this.openDocumentAdapter.injectServices(this.documentService, newTabWindowService, highlightService);
    this.openDocumentAdapter.injectAdapters(this.processingAdapter, this.mediaSearchRiskScoreCountAdapter);
  };
  _proto.setSearchEngine = function setSearchEngine(isGoogle, isBing) {
    var _this$searchEngineAda;
    (_this$searchEngineAda = this.searchEngineAdapter) == null || _this$searchEngineAda.setSearchEngine(isGoogle, isBing);
  };
  _proto.setCountries = function setCountries(countries) {
    this.countriesData = [].concat(countries);
  };
  _proto.setExcludedNameParts = function setExcludedNameParts(excludedNameParts) {
    var riskScoreCountService = this.servicesFactory.getMediaSearchRiskScoreCountService();
    riskScoreCountService.setExcludedNameParts(excludedNameParts);
  };
  _proto.setLoggers = function setLoggers(errorLogger, infoLogger) {
    var _this$searchEngineAda2, _this$googleNewsAdapt, _this$extraSourcesAda, _this$stockMarketsAda, _this$alephOccrpAdapt, _this$openSanctionsAd, _this$openCorporatesA, _this$openDocumentAda;
    this.errorLogger = errorLogger;
    this.infoLogger = infoLogger;
    (_this$searchEngineAda2 = this.searchEngineAdapter) == null || _this$searchEngineAda2.setLoggers(errorLogger, infoLogger);
    (_this$googleNewsAdapt = this.googleNewsAdapter) == null || _this$googleNewsAdapt.setLoggers(errorLogger, infoLogger);
    (_this$extraSourcesAda = this.extraSourcesAdapter) == null || _this$extraSourcesAda.setLoggers(errorLogger, infoLogger);
    (_this$stockMarketsAda = this.stockMarketsAdapter) == null || _this$stockMarketsAda.setLoggers(errorLogger, infoLogger);
    (_this$alephOccrpAdapt = this.alephOccrpAdapter) == null || _this$alephOccrpAdapt.setLoggers(errorLogger, infoLogger);
    (_this$openSanctionsAd = this.openSanctionsAdapter) == null || _this$openSanctionsAd.setLoggers(errorLogger, infoLogger);
    (_this$openCorporatesA = this.openCorporatesAdapter) == null || _this$openCorporatesA.setLoggers(errorLogger, infoLogger);
    (_this$openDocumentAda = this.openDocumentAdapter) == null || _this$openDocumentAda.setLoggers(errorLogger, infoLogger);
  };
  _proto.setLinkedAliasPersonsSettings = function setLinkedAliasPersonsSettings(isProcessingAliasPersonsEnabled, isProcessingLinkedPersonsEnabled) {
    if (isProcessingAliasPersonsEnabled !== undefined && isProcessingAliasPersonsEnabled !== null) {
      this.isProcessingAliasPersonsEnabled = isProcessingAliasPersonsEnabled;
    }
    if (isProcessingLinkedPersonsEnabled !== undefined && isProcessingLinkedPersonsEnabled !== null) {
      this.isProcessingLinkedPersonsEnabled = isProcessingLinkedPersonsEnabled;
    }
  };
  _proto.initFromConfig$ = function initFromConfig$() {
    var _this$configRequestsS,
      _this = this;
    var deferred = this.$q.defer();
    (_this$configRequestsS = this.configRequestsService) == null || _this$configRequestsS.getConfig$().then(function (config) {
      var _this$searchEngineAda3, _this$searchEngineAda4;
      (_this$searchEngineAda3 = _this.searchEngineAdapter) == null || _this$searchEngineAda3.setBaseConstants();
      (_this$searchEngineAda4 = _this.searchEngineAdapter) == null || _this$searchEngineAda4.setAdapterConstants(config);
      if (config && config.common && config.common.google_search) {
        var _this$mediaSearchEngi, _this$mediaSearchRisk;
        (_this$mediaSearchEngi = _this.mediaSearchEngineService) == null || _this$mediaSearchEngi.parseConfigData(config.common.google_search.engine);
        (_this$mediaSearchRisk = _this.mediaSearchRiskScoreCountAdapter) == null || _this$mediaSearchRisk.setAdapterConstants(config.common.google_search.adapter);
      }
      if (config && config.common && config.common.bing_search) {
        var _this$mediaSearchEngi2, _this$mediaSearchRisk2;
        (_this$mediaSearchEngi2 = _this.mediaSearchEngineService) == null || _this$mediaSearchEngi2.parseConfigData(config.common.bing_search.engine);
        (_this$mediaSearchRisk2 = _this.mediaSearchRiskScoreCountAdapter) == null || _this$mediaSearchRisk2.setAdapterConstants(config.common.bing_search.adapter);
      }
      if (config && config.common && config.common.google_news_rss) {
        var _this$googleNewsAdapt2;
        (_this$googleNewsAdapt2 = _this.googleNewsAdapter) == null || _this$googleNewsAdapt2.setAdapterConstants(config.common.google_news_rss.adapter);
      }
      if (config && config.common && config.common.extra_search) {
        var _this$extraSourcesAda2;
        (_this$extraSourcesAda2 = _this.extraSourcesAdapter) == null || _this$extraSourcesAda2.setAdapterConstants(config.common.extra_search.adapter);
      }
      if (config && config.common && config.common.stock_market_search) {
        var _this$stockMarketsAda2;
        (_this$stockMarketsAda2 = _this.stockMarketsAdapter) == null || _this$stockMarketsAda2.setAdapterConstants(config.common.stock_market_search.adapter);
      }
      if (config && config.common && config.common.aleph_occrp) {
        var _this$alephOccrpAdapt2;
        (_this$alephOccrpAdapt2 = _this.alephOccrpAdapter) == null || _this$alephOccrpAdapt2.setAdapterConstants(config.common.aleph_occrp.adapter);
      }
      if (config && config.common && config.common.open_sanctions) {
        var _this$openSanctionsAd2;
        (_this$openSanctionsAd2 = _this.openSanctionsAdapter) == null || _this$openSanctionsAd2.setAdapterConstants(config.common.open_sanctions.adapter);
      }
      if (config && config.common && config.common.open_corporates) {
        var _this$openCorporatesA2;
        (_this$openCorporatesA2 = _this.openCorporatesAdapter) == null || _this$openCorporatesA2.setAdapterConstants(config.common.open_corporates.adapter);
      }
      if (config && config.common && config.common.search_services_settings) {
        var _this$openDocumentAda2;
        (_this$openDocumentAda2 = _this.openDocumentAdapter) == null || _this$openDocumentAda2.setAdapterConstants(config.common.search_services_settings);
      }
      if (config && config.common && config.common.timeouts) {
        var _this$searchEngineAda5, _this$googleNewsAdapt3, _this$extraSourcesAda3, _this$stockMarketsAda3, _this$alephOccrpAdapt3, _this$openSanctionsAd3, _this$openCorporatesA3, _this$openDocumentAda3, _this$parseDocumentAd;
        (_this$searchEngineAda5 = _this.searchEngineAdapter) == null || _this$searchEngineAda5.setTimeouts(config.common.timeouts);
        (_this$googleNewsAdapt3 = _this.googleNewsAdapter) == null || _this$googleNewsAdapt3.setTimeouts(config.common.timeouts);
        (_this$extraSourcesAda3 = _this.extraSourcesAdapter) == null || _this$extraSourcesAda3.setTimeouts(config.common.timeouts);
        (_this$stockMarketsAda3 = _this.stockMarketsAdapter) == null || _this$stockMarketsAda3.setTimeouts(config.common.timeouts);
        (_this$alephOccrpAdapt3 = _this.alephOccrpAdapter) == null || _this$alephOccrpAdapt3.setTimeouts(config.common.timeouts);
        (_this$openSanctionsAd3 = _this.openSanctionsAdapter) == null || _this$openSanctionsAd3.setTimeouts(config.common.timeouts);
        (_this$openCorporatesA3 = _this.openCorporatesAdapter) == null || _this$openCorporatesA3.setTimeouts(config.common.timeouts);
        (_this$openDocumentAda3 = _this.openDocumentAdapter) == null || _this$openDocumentAda3.setTimeouts(config.common.timeouts);
        (_this$parseDocumentAd = _this.parseDocumentAdapter) == null || _this$parseDocumentAd.setTimeouts(config.common.timeouts);
      }
      if (config && config.common && config.common.search_services_settings) {
        _this.setAdaptersConstants(config.common.search_services_settings);
      }
      ["criminals", "companies", "esg"].forEach(function (scoreType) {
        if (config[scoreType]) {
          var _this$mediaSearchRisk3;
          var newScoreTypeService = _this.servicesFactory.getMediaSearchScoreTypeService(scoreType);
          if (config[scoreType].groups_of_requests && config[scoreType].groups_of_requests.adapter && config[scoreType].groups_of_requests.adapter.groups) {
            newScoreTypeService.setGroupRequests(config[scoreType].groups_of_requests.adapter.groups);
          }
          if (config[scoreType].separate_requests && config[scoreType].separate_requests.adapter && config[scoreType].separate_requests.adapter.requests) {
            newScoreTypeService.setSeparateRequests(config[scoreType].separate_requests.adapter.requests);
          }
          (_this$mediaSearchRisk3 = _this.mediaSearchRiskScoreCountAdapter) == null || _this$mediaSearchRisk3.injectScoreTypeSerice(scoreType, newScoreTypeService);
          _this.scoreTypeServices.push(newScoreTypeService);
        }
      });
      if (_this.USE_MEDIA_SEARCH_PY) {
        var _this$processingAdapt;
        (_this$processingAdapt = _this.processingAdapter) == null || (_this$processingAdapt = _this$processingAdapt.mediaPyAdapter) == null || _this$processingAdapt.init$().then(function () {})["catch"](function (error) {
          _this.errorLogger(error);
        })["finally"](function () {
          deferred.resolve();
        });
      } else {
        deferred.resolve();
      }
    })["catch"](function (error) {
      deferred.reject(error);
    });
    return deferred.promise;
  };
  _proto.setAdaptersConstants = function setAdaptersConstants(constants) {
    if (constants) {
      this.ENABLE_GOOGLE_SEARCH = constants.enable_google_search;
      this.ENABLE_EXTRA_SEARCH_SOURCES = constants.enable_extra_search_sources;
      this.ENABLE_GOOGLE_NEWS_RSS = constants.enable_google_news_rss;
      this.ENABLE_STOCK_MARKET_NEWS = constants.enable_stock_market_news;
      this.ENABLE_ALEPH_OCCRP = constants.enable_aleph_occrp;
      this.ENABLE_OPEN_SANCTIONS = constants.enable_open_sanctions;
      this.ENABLE_OPEN_CORPORATES = constants.enable_open_corporates;
      this.USE_MEDIA_SEARCH_PY = constants.use_media_search_py;
      this.ENABLE_MEDIA_PY_TEXT_INFO = constants.enable_media_py_text_info;
      this.USE_MEDIA_SEARCH_GPT = constants.use_media_search_gpt;
    } else {
      this.ENABLE_GOOGLE_SEARCH = true;
      this.ENABLE_EXTRA_SEARCH_SOURCES = true;
      this.ENABLE_GOOGLE_NEWS_RSS = true;
      this.ENABLE_STOCK_MARKET_NEWS = true;
      this.ENABLE_ALEPH_OCCRP = true;
      this.ENABLE_OPEN_SANCTIONS = true;
      this.ENABLE_OPEN_CORPORATES = true;
      this.USE_MEDIA_SEARCH_PY = true;
      this.ENABLE_MEDIA_PY_TEXT_INFO = true;
      this.USE_MEDIA_SEARCH_GPT = true;
    }
  };
  _proto.resetAdapters = function resetAdapters() {
    var _this$searchEngineAda6, _this$googleNewsAdapt4, _this$extraSourcesAda4, _this$stockMarketsAda4, _this$alephOccrpAdapt4, _this$openSanctionsAd4, _this$openCorporatesA4, _this$parseDocumentAd2, _this$openDocumentAda4;
    (_this$searchEngineAda6 = this.searchEngineAdapter) == null || _this$searchEngineAda6.resetAdapter();
    (_this$googleNewsAdapt4 = this.googleNewsAdapter) == null || _this$googleNewsAdapt4.resetAdapter();
    (_this$extraSourcesAda4 = this.extraSourcesAdapter) == null || _this$extraSourcesAda4.resetAdapter();
    (_this$stockMarketsAda4 = this.stockMarketsAdapter) == null || _this$stockMarketsAda4.resetAdapter();
    (_this$alephOccrpAdapt4 = this.alephOccrpAdapter) == null || _this$alephOccrpAdapt4.resetAdapter();
    (_this$openSanctionsAd4 = this.openSanctionsAdapter) == null || _this$openSanctionsAd4.resetAdapter();
    (_this$openCorporatesA4 = this.openCorporatesAdapter) == null || _this$openCorporatesA4.resetAdapter();
    (_this$parseDocumentAd2 = this.parseDocumentAdapter) == null || _this$parseDocumentAd2.resetAdapter();
    (_this$openDocumentAda4 = this.openDocumentAdapter) == null || _this$openDocumentAda4.resetAdapter();
  };
  _proto.resetServices = function resetServices() {
    var _this$configRequestsS2;
    (_this$configRequestsS2 = this.configRequestsService) == null || _this$configRequestsS2.resetRouteWasChanged();
  };
  _proto.setPersonTotalResults = function setPersonTotalResults(parentPerson, isFinal, typesToFilter) {
    parentPerson.filterTotalResults(isFinal, typesToFilter, null, null, true, true, []);
    parentPerson.countTotalRiskScore();
  };
  _proto.getScoreTypeServiceByType = function getScoreTypeServiceByType(scoreMode) {
    return this.scoreTypeServices.find(function (service) {
      return service.getScoreType() === scoreMode;
    });
  };
  _proto.getObjectWithFiltersInfo = function getObjectWithFiltersInfo(dateFrom, dateTo, languages, requestConfig) {
    var filteredLanguages = [];
    var requestLanguages = requestConfig.getExpectedLanguages();
    if (languages && languages.length) {
      var tempLanguages = [].concat(languages);
      if (requestLanguages && requestLanguages.length) {
        tempLanguages = tempLanguages.filter(function (lang) {
          return requestLanguages.find(function (requestLang) {
            return requestLang === lang.google_news_rss_value;
          });
        });
      }
      filteredLanguages = tempLanguages.map(function (lang) {
        return lang.google_news_rss_value;
      });
    } else {
      filteredLanguages = requestLanguages;
    }
    var filteredDateFrom = dateFrom || requestConfig.getAfterDate();
    var filteredDateTo = dateTo || requestConfig.getBeforeDate();
    return {
      filteredDateFrom: filteredDateFrom,
      filteredDateTo: filteredDateTo,
      filteredLanguages: filteredLanguages
    };
  };
  _proto.getGoogleSearchLanguageCodes = function getGoogleSearchLanguageCodes(languages) {
    return (languages || []).map(function (lang) {
      return "lang_" + lang;
    });
  };
  _proto.checkSourceEnabled = function checkSourceEnabled(sources, sourceCode) {
    return !(sources || []).length ? true : sources.find(function (s) {
      return s === sourceCode;
    }) !== undefined;
  };
  _proto.getEnabledSourcesSettingObject = function getEnabledSourcesSettingObject(sources) {
    var _ref;
    return _ref = {}, _ref[GOOGLE_SEARCH_SOURCE_CODE] = {
      isSourceEnabled: this.checkSourceEnabled(sources, GOOGLE_SEARCH_SOURCE_CODE),
      configSourceEnabled: this.ENABLE_GOOGLE_SEARCH
    }, _ref[GOOGLE_NEWS_SOURCE_CODE] = {
      isSourceEnabled: this.checkSourceEnabled(sources, GOOGLE_NEWS_SOURCE_CODE),
      configSourceEnabled: this.ENABLE_GOOGLE_NEWS_RSS
    }, _ref[EXTRA_SOURCE_SOURCE_CODE] = {
      isSourceEnabled: this.checkSourceEnabled(sources, EXTRA_SOURCE_SOURCE_CODE),
      configSourceEnabled: this.ENABLE_EXTRA_SEARCH_SOURCES
    }, _ref[ALEPH_OCCRP_SOURCE_CODE] = {
      isSourceEnabled: this.checkSourceEnabled(sources, ALEPH_OCCRP_SOURCE_CODE),
      configSourceEnabled: this.ENABLE_ALEPH_OCCRP
    }, _ref[STOCK_MARKETS_SOURCE_CODE] = {
      isSourceEnabled: this.checkSourceEnabled(sources, STOCK_MARKETS_SOURCE_CODE),
      configSourceEnabled: this.ENABLE_STOCK_MARKET_NEWS
    }, _ref[OPEN_SANCTIONS_SOURCE_CODE] = {
      isSourceEnabled: this.checkSourceEnabled(sources, OPEN_SANCTIONS_SOURCE_CODE),
      configSourceEnabled: this.ENABLE_OPEN_SANCTIONS
    }, _ref[OPEN_CORPORATES_SOURCE_CODE] = {
      isSourceEnabled: this.checkSourceEnabled(sources, OPEN_CORPORATES_SOURCE_CODE),
      configSourceEnabled: this.ENABLE_OPEN_CORPORATES
    }, _ref;
  };
  _proto.getBatchPersonsPromises = function getBatchPersonsPromises(enabledSourcesSettings, personsService, groupObject, searchEngineRequestConfigs, googleNewsRequestConfigs, extraSourcesRequestConfigs, stockMarketRequestConfigs, alephOccrpRequestConfigs, openCorporatesRequestConfigs, openSanctionsRequestConfigs, dateFrom, dateTo, isAddWithoutDate, languages, scoreMode, userCountry, isBatch, callback, googleRequestCb) {
    var _this2 = this;
    var batchPersonsPromises = [];
    personsService.getPersonsWithoutAliases().forEach(function (parentPerson) {
      var batchPersonPromises = [];
      var searchEngineBatchPersonPromise$ = _this2.getSearchEngineBatchPersonPromise$(enabledSourcesSettings[GOOGLE_SEARCH_SOURCE_CODE], searchEngineRequestConfigs, groupObject, dateFrom, dateTo, languages, personsService, parentPerson, isAddWithoutDate, userCountry, isBatch, scoreMode, callback, googleRequestCb);
      if (searchEngineBatchPersonPromise$) {
        batchPersonPromises.push(searchEngineBatchPersonPromise$);
      }
      var googleNewsBatchPersonPromise$ = _this2.getGoogleNewsBatchPersonPromise$(enabledSourcesSettings[GOOGLE_NEWS_SOURCE_CODE], googleNewsRequestConfigs, groupObject, dateFrom, dateTo, languages, personsService, parentPerson, isAddWithoutDate, isBatch, scoreMode, callback);
      if (googleNewsBatchPersonPromise$) {
        batchPersonPromises.push(googleNewsBatchPersonPromise$);
      }
      var extraSourcesBatchPersonPromise$ = _this2.getExtraSourcesBatchPersonPromise$(enabledSourcesSettings[EXTRA_SOURCE_SOURCE_CODE], extraSourcesRequestConfigs, groupObject, personsService, parentPerson, isBatch, scoreMode, callback);
      if (extraSourcesBatchPersonPromise$) {
        batchPersonPromises.push(extraSourcesBatchPersonPromise$);
      }
      var stockMarketsBatchPersonPromise$ = _this2.getStockMarketsBatchPersonPromise$(enabledSourcesSettings[STOCK_MARKETS_SOURCE_CODE], stockMarketRequestConfigs, groupObject, personsService, parentPerson, isAddWithoutDate, isBatch, scoreMode, callback);
      if (stockMarketsBatchPersonPromise$) {
        batchPersonPromises.push(stockMarketsBatchPersonPromise$);
      }
      var alephOccrpBatchPersonPromise$ = _this2.getAlephOccrpBatchPersonPromise$(enabledSourcesSettings[ALEPH_OCCRP_SOURCE_CODE], alephOccrpRequestConfigs, groupObject, dateFrom, dateTo, languages, personsService, parentPerson, isAddWithoutDate, isBatch, scoreMode, callback);
      if (alephOccrpBatchPersonPromise$) {
        batchPersonPromises.push(alephOccrpBatchPersonPromise$);
      }
      var openCorporatesBatchPersonPromise$ = _this2.getOpenCorporatesBatchPersonPromise$(enabledSourcesSettings[OPEN_CORPORATES_SOURCE_CODE], openCorporatesRequestConfigs, groupObject, dateFrom, dateTo, languages, personsService, parentPerson, isAddWithoutDate, isBatch, scoreMode, callback);
      if (openCorporatesBatchPersonPromise$) {
        batchPersonPromises.push(openCorporatesBatchPersonPromise$);
      }
      var openSanctionsBatchPersonPromise$ = _this2.getOpenSanctionsBatchPersonPromise$(enabledSourcesSettings[OPEN_SANCTIONS_SOURCE_CODE], openSanctionsRequestConfigs, groupObject, dateFrom, dateTo, languages, personsService, parentPerson, isAddWithoutDate, isBatch, scoreMode, callback);
      if (openSanctionsBatchPersonPromise$) {
        batchPersonPromises.push(openSanctionsBatchPersonPromise$);
      }
      if (batchPersonPromises.length) {
        batchPersonsPromises.push(_this2.processPersonBatches$(parentPerson, batchPersonPromises));
      }
    });
    return batchPersonsPromises;
  };
  _proto.processPersonsAfterSearch = function processPersonsAfterSearch(personsService, groupObject, searchEngineRequestConfigs, googleNewsRequestConfigs, extraSourcesRequestConfigs, stockMarketRequestConfigs, alephOccrpRequestConfigs, openCorporatesRequestConfigs, openSanctionsRequestConfigs, dateFrom, dateTo, isAddWithoutDate, languages, scoreMode, userCountry, isBatch, callback) {
    var _this$stockMarketsAda5,
      _this$stockMarketsAda6,
      _this3 = this;
    var isAddWithoutDateStockMarketResults = isAddWithoutDate || (isBatch ? (_this$stockMarketsAda5 = this.stockMarketsAdapter) == null ? void 0 : _this$stockMarketsAda5.BATCH_INCLUDE_TO_DATE_SEARCH_RESULTS : (_this$stockMarketsAda6 = this.stockMarketsAdapter) == null ? void 0 : _this$stockMarketsAda6.SINGLE_INCLUDE_TO_DATE_SEARCH_RESULTS);
    personsService.getPersonsWithoutAliases().forEach(function (parentPerson) {
      var _configObj;
      [].concat(searchEngineRequestConfigs).concat(googleNewsRequestConfigs).concat(stockMarketRequestConfigs).concat(alephOccrpRequestConfigs).concat(openCorporatesRequestConfigs).concat(openSanctionsRequestConfigs).forEach(function (requestObject) {
        var filtersInfoObject = _this3.getObjectWithFiltersInfo(dateFrom, dateTo, languages, requestObject);
        parentPerson.filterRequestObjectResults(requestObject.getId(), filtersInfoObject.filteredDateFrom, filtersInfoObject.filteredDateTo, isAddWithoutDate, isAddWithoutDateStockMarketResults, _this3.USE_MEDIA_SEARCH_PY && _this3.ENABLE_MEDIA_PY_TEXT_INFO ? filtersInfoObject.filteredLanguages : []);
      });
      if (groupObject) {
        parentPerson.filterGroupObjectResults(groupObject.getId(), groupObject.getMaxResultsCount(), groupObject.getMinRiskScore());
      }
      var configObj = (_configObj = {}, _configObj[GOOGLE_SEARCH_SOURCE_CODE] = _this3.ENABLE_GOOGLE_SEARCH, _configObj[GOOGLE_NEWS_SOURCE_CODE] = _this3.ENABLE_GOOGLE_NEWS_RSS, _configObj[STOCK_MARKETS_SOURCE_CODE] = _this3.ENABLE_STOCK_MARKET_NEWS, _configObj[ALEPH_OCCRP_SOURCE_CODE] = _this3.ENABLE_ALEPH_OCCRP, _configObj[OPEN_SANCTIONS_SOURCE_CODE] = _this3.ENABLE_OPEN_SANCTIONS, _configObj[OPEN_CORPORATES_SOURCE_CODE] = _this3.ENABLE_OPEN_CORPORATES, _configObj);
      var typesToFilter = _this3.getTypesToFilterPersonResults(configObj, isBatch);
      parentPerson.filterTotalResults(true, typesToFilter, null, null, true, true, []);
      parentPerson.countTotalRiskScore();
    });
  };
  _proto.getData$ = function getData$(personsData, additionalKeywords, dateFrom, dateTo, isAddWithoutDate, languages, sources, scoreMode, fastProcessing, userCountry, isBatch, personId, searchResultId, linkAnalysServiceId, callback, googleRequestCb) {
    var _this$mediaSearchEngi3;
    var deferred = this.$q.defer();
    (_this$mediaSearchEngi3 = this.mediaSearchEngineService) == null || _this$mediaSearchEngi3.addAdditionalKeywords(additionalKeywords || []);
    var personsService = this.servicesFactory.getMediaSearchPersonsService();
    personsService.setPersons(personsData, this.countriesData, this.isProcessingAliasPersonsEnabled, this.isProcessingLinkedPersonsEnabled);
    var successFinalCallback = function successFinalCallback(persons) {
      deferred.resolve(persons);
    };
    var errorFinalCallback = function errorFinalCallback(error) {
      deferred.reject(error);
    };
    var scoreTypeService = this.getScoreTypeServiceByType(scoreMode);
    if (scoreTypeService) {
      var _scoreTypeService$gro;
      if ((_scoreTypeService$gro = scoreTypeService.groupRequestsConfigService) != null && _scoreTypeService$gro.getAllGroups().length) {
        scoreTypeService.addAdditionalKeywordsRequest(additionalKeywords || [], true, false);
        this.getDataByGroupsRequests(personsService, dateFrom, dateTo, isAddWithoutDate, languages, sources, scoreMode, fastProcessing, userCountry, isBatch, callback, googleRequestCb, successFinalCallback, errorFinalCallback);
      } else {
        scoreTypeService.addAdditionalKeywordsRequest(additionalKeywords || [], false, true);
        this.getDataBySeparateRequests(personsService, dateFrom, dateTo, isAddWithoutDate, languages, sources, scoreMode, fastProcessing, userCountry, isBatch, callback, googleRequestCb, successFinalCallback, errorFinalCallback);
      }
    } else {
      deferred.resolve(personsService.getPersonsWithoutAliases());
    }
    return deferred.promise;
  };
  _proto.getSearchEngineBatchPersonPromise$ = function getSearchEngineBatchPersonPromise$(settingsObj, requestObjects, groupObject, dateFrom, dateTo, languages, personsService, parentPerson, isAddWithoutDate, userCountry, isBatch, scoreMode, callback, googleRequestCb) {
    var _this4 = this;
    var processPersonBatchRequests$ = null;
    if (settingsObj.isSourceEnabled && settingsObj.configSourceEnabled && requestObjects.length) {
      var personRequestsPromises = [];
      requestObjects.forEach(function (requestObject) {
        var filtersInfoObject = _this4.getObjectWithFiltersInfo(dateFrom, dateTo, languages, requestObject);
        if (languages && languages.length && !filtersInfoObject.filteredLanguages.length) {
          return;
        }
        var personsRequestsService = _this4.servicesFactory.getMediaSearchPersonsRequestsService();
        var searchConfig = requestObject.getSearchConfig();
        if (searchConfig) {
          var _this4$searchEngineAd;
          personsRequestsService.setPersonsRequests(personsService.getPersons(), [searchConfig], requestObject, groupObject);
          var requestsPromise$ = (_this4$searchEngineAd = _this4.searchEngineAdapter) == null ? void 0 : _this4$searchEngineAd.performPersonRequest$(parentPerson, personsService, searchConfig.getId(), personsRequestsService, filtersInfoObject.filteredDateFrom, filtersInfoObject.filteredDateTo, isAddWithoutDate, _this4.getGoogleSearchLanguageCodes(filtersInfoObject.filteredLanguages), userCountry, isBatch, scoreMode, requestObject, groupObject, callback, googleRequestCb);
          personRequestsPromises.push(requestsPromise$);
        }
      });
      if (personRequestsPromises.length) {
        var _this$searchEngineAda7;
        processPersonBatchRequests$ = (_this$searchEngineAda7 = this.searchEngineAdapter) == null ? void 0 : _this$searchEngineAda7.performPersonBatchRequests$(parentPerson, personRequestsPromises, isBatch, callback);
      }
    }
    return processPersonBatchRequests$;
  };
  _proto.getGoogleNewsBatchPersonPromise$ = function getGoogleNewsBatchPersonPromise$(settingsObj, requestObjects, groupObject, dateFrom, dateTo, languages, personsService, parentPerson, isAddWithoutDate, isBatch, scoreMode, callback) {
    var _this5 = this;
    var processPersonBatchRequests$ = null;
    if (settingsObj.isSourceEnabled && settingsObj.configSourceEnabled && requestObjects.length) {
      var personRequestsPromises = [];
      requestObjects.forEach(function (requestObject) {
        var _this5$googleNewsAdap;
        var filtersInfoObject = _this5.getObjectWithFiltersInfo(dateFrom, dateTo, languages, requestObject);
        if (languages && languages.length && !filtersInfoObject.filteredLanguages.length) {
          return;
        }
        var requestsPromise$ = (_this5$googleNewsAdap = _this5.googleNewsAdapter) == null ? void 0 : _this5$googleNewsAdap.performPersonRequest$(parentPerson, personsService, filtersInfoObject.filteredDateFrom, filtersInfoObject.filteredDateTo, isAddWithoutDate, filtersInfoObject.filteredLanguages, isBatch, scoreMode, requestObject, groupObject, callback);
        personRequestsPromises.push(requestsPromise$);
      });
      if (personRequestsPromises.length) {
        var _this$googleNewsAdapt5;
        processPersonBatchRequests$ = (_this$googleNewsAdapt5 = this.googleNewsAdapter) == null ? void 0 : _this$googleNewsAdapt5.performPersonBatchRequests$(parentPerson, personRequestsPromises, isBatch, callback);
      }
    }
    return processPersonBatchRequests$;
  };
  _proto.getExtraSourcesBatchPersonPromise$ = function getExtraSourcesBatchPersonPromise$(settingsObj, requestObjects, groupObject, personsService, parentPerson, isBatch, scoreMode, callback) {
    var _this6 = this;
    var processPersonBatchRequests$ = null;
    if (settingsObj.isSourceEnabled && settingsObj.configSourceEnabled && requestObjects.length) {
      var personRequestsPromises = [];
      requestObjects.forEach(function (requestObject) {
        var _this6$extraSourcesAd;
        var requestsPromise$ = (_this6$extraSourcesAd = _this6.extraSourcesAdapter) == null ? void 0 : _this6$extraSourcesAd.performPersonRequest$(parentPerson, personsService, requestObject.getSites(), isBatch, scoreMode, requestObject, groupObject, callback);
        personRequestsPromises.push(requestsPromise$);
      });
      if (personRequestsPromises.length) {
        var _this$extraSourcesAda5;
        processPersonBatchRequests$ = (_this$extraSourcesAda5 = this.extraSourcesAdapter) == null ? void 0 : _this$extraSourcesAda5.performPersonBatchRequests$(parentPerson, personRequestsPromises, isBatch, callback);
      }
    }
    return processPersonBatchRequests$;
  };
  _proto.getStockMarketsBatchPersonPromise$ = function getStockMarketsBatchPersonPromise$(settingsObj, requestObjects, groupObject, personsService, parentPerson, isAddWithoutDate, isBatch, scoreMode, callback) {
    var _this$stockMarketsAda7,
      _this$stockMarketsAda8,
      _this7 = this;
    var processPersonBatchRequests$ = null;
    if (settingsObj.isSourceEnabled && settingsObj.configSourceEnabled && requestObjects.length && (isAddWithoutDate || (isBatch ? (_this$stockMarketsAda7 = this.stockMarketsAdapter) == null ? void 0 : _this$stockMarketsAda7.BATCH_INCLUDE_TO_DATE_SEARCH_RESULTS : (_this$stockMarketsAda8 = this.stockMarketsAdapter) == null ? void 0 : _this$stockMarketsAda8.SINGLE_INCLUDE_TO_DATE_SEARCH_RESULTS))) {
      var personRequestsPromises = [];
      requestObjects.forEach(function (requestObject) {
        var _this7$stockMarketsAd;
        var requestsPromise$ = (_this7$stockMarketsAd = _this7.stockMarketsAdapter) == null ? void 0 : _this7$stockMarketsAd.performPersonRequest$(parentPerson, personsService, requestObject.getSites(), isBatch, scoreMode, requestObject, groupObject, callback);
        personRequestsPromises.push(requestsPromise$);
      });
      if (personRequestsPromises.length) {
        var _this$stockMarketsAda9;
        processPersonBatchRequests$ = (_this$stockMarketsAda9 = this.stockMarketsAdapter) == null ? void 0 : _this$stockMarketsAda9.performPersonBatchRequests$(parentPerson, personRequestsPromises, isBatch, callback);
      }
    }
    return processPersonBatchRequests$;
  };
  _proto.getAlephOccrpBatchPersonPromise$ = function getAlephOccrpBatchPersonPromise$(settingsObj, requestObjects, groupObject, dateFrom, dateTo, languages, personsService, parentPerson, isAddWithoutDate, isBatch, scoreMode, callback) {
    var _this8 = this;
    var processPersonBatchRequests$ = null;
    if (settingsObj.isSourceEnabled && settingsObj.configSourceEnabled && requestObjects.length) {
      var personRequestsPromises = [];
      requestObjects.forEach(function (requestObject) {
        var _this8$alephOccrpAdap;
        var filtersInfoObject = _this8.getObjectWithFiltersInfo(dateFrom, dateTo, languages, requestObject);
        if (languages && languages.length && !filtersInfoObject.filteredLanguages.length) {
          return;
        }
        var requestsPromise$ = (_this8$alephOccrpAdap = _this8.alephOccrpAdapter) == null ? void 0 : _this8$alephOccrpAdap.performPersonRequest$(parentPerson, personsService, filtersInfoObject.filteredDateFrom, filtersInfoObject.filteredDateTo, isAddWithoutDate, filtersInfoObject.filteredLanguages, isBatch, scoreMode, requestObject, groupObject, callback);
        personRequestsPromises.push(requestsPromise$);
      });
      if (personRequestsPromises.length) {
        var _this$alephOccrpAdapt5;
        processPersonBatchRequests$ = (_this$alephOccrpAdapt5 = this.alephOccrpAdapter) == null ? void 0 : _this$alephOccrpAdapt5.performPersonBatchRequests$(parentPerson, personRequestsPromises, isBatch, callback);
      }
    }
    return processPersonBatchRequests$;
  };
  _proto.getOpenCorporatesBatchPersonPromise$ = function getOpenCorporatesBatchPersonPromise$(settingsObj, requestObjects, groupObject, dateFrom, dateTo, languages, personsService, parentPerson, isAddWithoutDate, isBatch, scoreMode, callback) {
    var _this9 = this;
    var processPersonBatchRequests$ = null;
    if (settingsObj.isSourceEnabled && settingsObj.configSourceEnabled && requestObjects.length) {
      var personRequestsPromises = [];
      requestObjects.forEach(function (requestObject) {
        var _this9$openCorporates;
        var filtersInfoObject = _this9.getObjectWithFiltersInfo(dateFrom, dateTo, languages, requestObject);
        if (languages && languages.length && !filtersInfoObject.filteredLanguages.length) {
          return;
        }
        var requestsPromise$ = (_this9$openCorporates = _this9.openCorporatesAdapter) == null ? void 0 : _this9$openCorporates.performPersonRequest$(parentPerson, personsService, filtersInfoObject.filteredDateFrom, filtersInfoObject.filteredDateTo, isAddWithoutDate, filtersInfoObject.filteredLanguages, isBatch, scoreMode, requestObject, groupObject, callback);
        personRequestsPromises.push(requestsPromise$);
      });
      if (personRequestsPromises.length) {
        var _this$openCorporatesA5;
        processPersonBatchRequests$ = (_this$openCorporatesA5 = this.openCorporatesAdapter) == null ? void 0 : _this$openCorporatesA5.performPersonBatchRequests$(parentPerson, personRequestsPromises, isBatch, callback);
      }
    }
    return processPersonBatchRequests$;
  };
  _proto.getOpenSanctionsBatchPersonPromise$ = function getOpenSanctionsBatchPersonPromise$(settingsObj, requestObjects, groupObject, dateFrom, dateTo, languages, personsService, parentPerson, isAddWithoutDate, isBatch, scoreMode, callback) {
    var _this10 = this;
    var processPersonBatchRequests$ = null;
    if (settingsObj.isSourceEnabled && settingsObj.configSourceEnabled && requestObjects.length) {
      var personRequestsPromises = [];
      requestObjects.forEach(function (requestObject) {
        var _this10$openSanctions;
        var filtersInfoObject = _this10.getObjectWithFiltersInfo(dateFrom, dateTo, languages, requestObject);
        if (languages && languages.length && !filtersInfoObject.filteredLanguages.length) {
          return;
        }
        var requestsPromise$ = (_this10$openSanctions = _this10.openSanctionsAdapter) == null ? void 0 : _this10$openSanctions.performPersonRequest$(parentPerson, personsService, filtersInfoObject.filteredDateFrom, filtersInfoObject.filteredDateTo, isAddWithoutDate, filtersInfoObject.filteredLanguages, isBatch, scoreMode, requestObject, groupObject, callback);
        personRequestsPromises.push(requestsPromise$);
      });
      if (personRequestsPromises.length) {
        var _this$openSanctionsAd5;
        processPersonBatchRequests$ = (_this$openSanctionsAd5 = this.openSanctionsAdapter) == null ? void 0 : _this$openSanctionsAd5.performPersonBatchRequests$(parentPerson, personRequestsPromises, isBatch, callback);
      }
    }
    return processPersonBatchRequests$;
  };
  _proto.getTypesToFilterPersonResults = function getTypesToFilterPersonResults(sourcesConfigSettings, isBatch) {
    var _this11 = this;
    var typesToFilter = {};
    Object.keys(sourcesConfigSettings).forEach(function (sourceType) {
      var searchAdapter = _this11.allSearchAdapers.find(function (asa) {
        return asa.getAdapterSourceCode() === sourceType;
      });
      if (searchAdapter) {
        typesToFilter[sourceType] = sourcesConfigSettings[sourceType] && (!isBatch ? searchAdapter.SINGLE_LOAD_RESULTS : searchAdapter.BATCH_LOAD_RESULTS);
      }
    });
    return typesToFilter;
  };
  _proto.getDataByGroupsRequests = function getDataByGroupsRequests(personsService, dateFrom, dateTo, isAddWithoutDate, languages, sources, scoreMode, fastProcessing, userCountry, isBatch, callback, googleRequestCb, successFinalCallback, errorFinalCallback) {
    var _scoreTypeService$gro2;
    var scoreTypeService = this.getScoreTypeServiceByType(scoreMode);
    var allGroupObjects = scoreTypeService == null || (_scoreTypeService$gro2 = scoreTypeService.groupRequestsConfigService) == null ? void 0 : _scoreTypeService$gro2.getAllGroups();
    if (allGroupObjects && allGroupObjects.length) {
      this.getDataByGroupRequests(personsService, dateFrom, dateTo, isAddWithoutDate, languages, sources, scoreMode, fastProcessing, userCountry, isBatch, callback, googleRequestCb, successFinalCallback, errorFinalCallback, allGroupObjects, 0);
    } else {
      successFinalCallback(personsService.getPersonsWithoutAliases());
    }
  };
  _proto.getDataByGroupRequests = function getDataByGroupRequests(personsService, dateFrom, dateTo, isAddWithoutDate, languages, sources, scoreMode, fastProcessing, userCountry, isBatch, callback, googleRequestCb, successFinalCallback, errorFinalCallback, allGroupObjects, currIdx) {
    var _this12 = this;
    var enabledSourcesSettings = this.getEnabledSourcesSettingObject(sources);
    var groupObject = allGroupObjects[currIdx];
    var groupSearchEngineRequestObjects = groupObject.getAllRequestsByType(GOOGLE_SEARCH_SOURCE_CODE, isBatch, fastProcessing);
    var groupGoogleNewsRequestObjects = groupObject.getAllRequestsByType(GOOGLE_NEWS_SOURCE_CODE, isBatch, fastProcessing);
    var groupExtraSourcesRequestObjects = groupObject.getAllRequestsByType(EXTRA_SOURCE_SOURCE_CODE, isBatch, fastProcessing);
    var groupStockMarketRequestObjects = groupObject.getAllRequestsByType(STOCK_MARKETS_SOURCE_CODE, isBatch, fastProcessing);
    var groupAlephOccrpRequestObjects = groupObject.getAllRequestsByType(ALEPH_OCCRP_SOURCE_CODE, isBatch, fastProcessing);
    var groupOpenCorporatesRequestObjects = groupObject.getAllRequestsByType(OPEN_CORPORATES_SOURCE_CODE, isBatch, fastProcessing);
    var groupOpenSanctionsRequestObjects = groupObject.getAllRequestsByType(OPEN_SANCTIONS_SOURCE_CODE, isBatch, fastProcessing);
    var batchPersonsPromises = this.getBatchPersonsPromises(enabledSourcesSettings, personsService, groupObject, groupSearchEngineRequestObjects, groupGoogleNewsRequestObjects, groupExtraSourcesRequestObjects, groupStockMarketRequestObjects, groupAlephOccrpRequestObjects, groupOpenCorporatesRequestObjects, groupOpenSanctionsRequestObjects, dateFrom, dateTo, isAddWithoutDate, languages, scoreMode, userCountry, isBatch, callback, googleRequestCb);
    ++currIdx;
    if (batchPersonsPromises.length) {
      this.$q.all(batchPersonsPromises).then(function () {})["catch"](function (error) {
        _this12.errorLogger(error);
      })["finally"](function () {
        _this12.processPersonsAfterSearch(personsService, groupObject, groupSearchEngineRequestObjects, groupGoogleNewsRequestObjects, groupExtraSourcesRequestObjects, groupStockMarketRequestObjects, groupAlephOccrpRequestObjects, groupOpenCorporatesRequestObjects, groupOpenSanctionsRequestObjects, dateFrom, dateTo, isAddWithoutDate, languages, scoreMode, userCountry, isBatch, callback);
        var isResultsCountEnough = true;
        if (personsService.getPersonsWithoutAliases().find(function (parentPerson) {
          return parentPerson.getRequestsGroupResultsCount(groupObject.getId()) < groupObject.getResultsCount();
        })) {
          isResultsCountEnough = false;
        } else {
          isResultsCountEnough = true;
        }
        if (isResultsCountEnough || currIdx === allGroupObjects.length) {
          successFinalCallback(personsService.getPersonsWithoutAliases());
        } else {
          _this12.getDataByGroupRequests(personsService, dateFrom, dateTo, isAddWithoutDate, languages, sources, scoreMode, fastProcessing, userCountry, isBatch, callback, googleRequestCb, successFinalCallback, errorFinalCallback, allGroupObjects, currIdx);
        }
      });
    } else if (currIdx === allGroupObjects.length) {
      successFinalCallback(personsService.getPersonsWithoutAliases());
    } else {
      this.getDataByGroupRequests(personsService, dateFrom, dateTo, isAddWithoutDate, languages, sources, scoreMode, fastProcessing, userCountry, isBatch, callback, googleRequestCb, successFinalCallback, errorFinalCallback, allGroupObjects, currIdx);
    }
  };
  _proto.getDataBySeparateRequests = function getDataBySeparateRequests(personsService, dateFrom, dateTo, isAddWithoutDate, languages, sources, scoreMode, fastProcessing, userCountry, isBatch, callback, googleRequestCb, successFinalCallback, errorFinalCallback) {
    var _scoreTypeService$sep,
      _scoreTypeService$sep2,
      _scoreTypeService$sep3,
      _scoreTypeService$sep4,
      _scoreTypeService$sep5,
      _scoreTypeService$sep6,
      _scoreTypeService$sep7,
      _this13 = this;
    var scoreTypeService = this.getScoreTypeServiceByType(scoreMode);
    var enabledSourcesSettings = this.getEnabledSourcesSettingObject(sources);
    var searchEngineRequestConfigs = (scoreTypeService == null || (_scoreTypeService$sep = scoreTypeService.separateRequestsConfigService) == null ? void 0 : _scoreTypeService$sep.getAllRequestsByType(GOOGLE_SEARCH_SOURCE_CODE, isBatch, fastProcessing)) || [];
    var googleNewsRequestConfigs = (scoreTypeService == null || (_scoreTypeService$sep2 = scoreTypeService.separateRequestsConfigService) == null ? void 0 : _scoreTypeService$sep2.getAllRequestsByType(GOOGLE_NEWS_SOURCE_CODE, isBatch, fastProcessing)) || [];
    var extraSourcesRequestConfigs = (scoreTypeService == null || (_scoreTypeService$sep3 = scoreTypeService.separateRequestsConfigService) == null ? void 0 : _scoreTypeService$sep3.getAllRequestsByType(EXTRA_SOURCE_SOURCE_CODE, isBatch, fastProcessing)) || [];
    var stockMarketRequestConfigs = (scoreTypeService == null || (_scoreTypeService$sep4 = scoreTypeService.separateRequestsConfigService) == null ? void 0 : _scoreTypeService$sep4.getAllRequestsByType(STOCK_MARKETS_SOURCE_CODE, isBatch, fastProcessing)) || [];
    var alephOccrpRequestConfigs = (scoreTypeService == null || (_scoreTypeService$sep5 = scoreTypeService.separateRequestsConfigService) == null ? void 0 : _scoreTypeService$sep5.getAllRequestsByType(ALEPH_OCCRP_SOURCE_CODE, isBatch, fastProcessing)) || [];
    var openSanctionsRequestConfigs = (scoreTypeService == null || (_scoreTypeService$sep6 = scoreTypeService.separateRequestsConfigService) == null ? void 0 : _scoreTypeService$sep6.getAllRequestsByType(OPEN_SANCTIONS_SOURCE_CODE, isBatch, fastProcessing)) || [];
    var openCorporatesRequestConfigs = (scoreTypeService == null || (_scoreTypeService$sep7 = scoreTypeService.separateRequestsConfigService) == null ? void 0 : _scoreTypeService$sep7.getAllRequestsByType(OPEN_CORPORATES_SOURCE_CODE, isBatch, fastProcessing)) || [];
    var batchPersonOpenSanctionsPromises = [];
    personsService.getPersonsWithoutAliases().forEach(function (parentPerson) {
      var batchPersonPromises = [];
      var openSanctionsBatchPersonPromise$ = _this13.getOpenSanctionsBatchPersonPromise$(enabledSourcesSettings[OPEN_SANCTIONS_SOURCE_CODE], openSanctionsRequestConfigs, null, dateFrom, dateTo, languages, personsService, parentPerson, isAddWithoutDate, isBatch, scoreMode, callback);
      if (openSanctionsBatchPersonPromise$) {
        batchPersonPromises.push(openSanctionsBatchPersonPromise$);
      }
      if (batchPersonPromises.length) {
        batchPersonOpenSanctionsPromises.push(_this13.processPersonBatches$(parentPerson, batchPersonPromises));
      }
    });
    this.batchPromisesWrapper(batchPersonOpenSanctionsPromises).then(function () {})["catch"](function (error) {
      _this13.errorLogger(error);
    })["finally"](function () {
      var batchPersonsPromises = _this13.getBatchPersonsPromises(enabledSourcesSettings, personsService, null, searchEngineRequestConfigs, googleNewsRequestConfigs, extraSourcesRequestConfigs, stockMarketRequestConfigs, alephOccrpRequestConfigs, openCorporatesRequestConfigs, [], dateFrom, dateTo, isAddWithoutDate, languages, scoreMode, userCountry, isBatch, callback, googleRequestCb);
      if (batchPersonsPromises.length) {
        _this13.$q.all(batchPersonsPromises).then(function () {})["catch"](function (error) {
          _this13.errorLogger(error);
        })["finally"](function () {
          _this13.processPersonsAfterSearch(personsService, null, searchEngineRequestConfigs, googleNewsRequestConfigs, extraSourcesRequestConfigs, stockMarketRequestConfigs, alephOccrpRequestConfigs, openCorporatesRequestConfigs, openSanctionsRequestConfigs, dateFrom, dateTo, isAddWithoutDate, languages, scoreMode, userCountry, isBatch, callback);
          successFinalCallback(personsService.getPersonsWithoutAliases());
        });
      } else {
        successFinalCallback(personsService.getPersonsWithoutAliases());
      }
    });
  };
  _proto.processPersonBatches$ = function processPersonBatches$(parentPerson, batchPromisesArray) {
    var _this14 = this;
    var deferred = this.$q.defer();
    this.batchPromisesWrapper(batchPromisesArray).then(function () {})["catch"](function (error) {
      _this14.errorLogger(error);
    })["finally"](function () {
      deferred.resolve(parentPerson);
    });
    return deferred.promise;
  };
  _proto.getDataForBatchPerson$ = function getDataForBatchPerson$(parentPerson) {
    var _this$searchEngineAda8,
      _this$searchEngineAda9,
      _this$googleNewsAdapt6,
      _this$googleNewsAdapt7,
      _this$stockMarketsAda10,
      _this$stockMarketsAda11,
      _this$extraSourcesAda6,
      _this$extraSourcesAda7,
      _this$alephOccrpAdapt6,
      _this$alephOccrpAdapt7,
      _this$openCorporatesA6,
      _this$openCorporatesA7,
      _this$openSanctionsAd6,
      _this$openSanctionsAd7,
      _this15 = this;
    var deferred = this.$q.defer();
    var batchPromises = [];
    if (this.ENABLE_GOOGLE_SEARCH && !((_this$searchEngineAda8 = this.searchEngineAdapter) != null && _this$searchEngineAda8.BATCH_LOAD_RESULTS) && (_this$searchEngineAda9 = this.searchEngineAdapter) != null && _this$searchEngineAda9.SINGLE_LOAD_RESULTS) {
      var _this$searchEngineAda10;
      batchPromises.push((_this$searchEngineAda10 = this.searchEngineAdapter) == null ? void 0 : _this$searchEngineAda10.loadBatchPersonResults$(parentPerson, false, null, null, null));
    }
    if (this.ENABLE_GOOGLE_NEWS_RSS && !((_this$googleNewsAdapt6 = this.googleNewsAdapter) != null && _this$googleNewsAdapt6.BATCH_LOAD_RESULTS) && (_this$googleNewsAdapt7 = this.googleNewsAdapter) != null && _this$googleNewsAdapt7.SINGLE_LOAD_RESULTS) {
      var _this$googleNewsAdapt8;
      batchPromises.push((_this$googleNewsAdapt8 = this.googleNewsAdapter) == null ? void 0 : _this$googleNewsAdapt8.loadBatchPersonResults$(parentPerson, false, null, null, null));
    }
    if (this.ENABLE_STOCK_MARKET_NEWS && !((_this$stockMarketsAda10 = this.stockMarketsAdapter) != null && _this$stockMarketsAda10.BATCH_LOAD_RESULTS) && (_this$stockMarketsAda11 = this.stockMarketsAdapter) != null && _this$stockMarketsAda11.SINGLE_LOAD_RESULTS) {
      var _this$stockMarketsAda12;
      batchPromises.push((_this$stockMarketsAda12 = this.stockMarketsAdapter) == null ? void 0 : _this$stockMarketsAda12.loadBatchPersonResults$(parentPerson, false, null, null, null));
    }
    if (this.ENABLE_EXTRA_SEARCH_SOURCES && !((_this$extraSourcesAda6 = this.extraSourcesAdapter) != null && _this$extraSourcesAda6.BATCH_LOAD_RESULTS) && (_this$extraSourcesAda7 = this.extraSourcesAdapter) != null && _this$extraSourcesAda7.SINGLE_LOAD_RESULTS) {
      var _this$extraSourcesAda8;
      batchPromises.push((_this$extraSourcesAda8 = this.extraSourcesAdapter) == null ? void 0 : _this$extraSourcesAda8.loadBatchPersonResults$(parentPerson, false, null, null, null));
    }
    if (this.ENABLE_ALEPH_OCCRP && !((_this$alephOccrpAdapt6 = this.alephOccrpAdapter) != null && _this$alephOccrpAdapt6.BATCH_LOAD_RESULTS) && (_this$alephOccrpAdapt7 = this.alephOccrpAdapter) != null && _this$alephOccrpAdapt7.SINGLE_LOAD_RESULTS) {
      var _this$alephOccrpAdapt8;
      batchPromises.push((_this$alephOccrpAdapt8 = this.alephOccrpAdapter) == null ? void 0 : _this$alephOccrpAdapt8.loadBatchPersonResults$(parentPerson, false, null, null, null));
    }
    if (this.ENABLE_OPEN_CORPORATES && !((_this$openCorporatesA6 = this.openCorporatesAdapter) != null && _this$openCorporatesA6.BATCH_LOAD_RESULTS) && (_this$openCorporatesA7 = this.openCorporatesAdapter) != null && _this$openCorporatesA7.SINGLE_LOAD_RESULTS) {
      var _this$openCorporatesA8;
      batchPromises.push((_this$openCorporatesA8 = this.openCorporatesAdapter) == null ? void 0 : _this$openCorporatesA8.loadBatchPersonResults$(parentPerson, false, null, null, null));
    }
    if (this.ENABLE_OPEN_SANCTIONS && !((_this$openSanctionsAd6 = this.openSanctionsAdapter) != null && _this$openSanctionsAd6.BATCH_LOAD_RESULTS) && (_this$openSanctionsAd7 = this.openSanctionsAdapter) != null && _this$openSanctionsAd7.SINGLE_LOAD_RESULTS) {
      var _this$openSanctionsAd8;
      batchPromises.push((_this$openSanctionsAd8 = this.openSanctionsAdapter) == null ? void 0 : _this$openSanctionsAd8.loadBatchPersonResults$(parentPerson, false, null, null, null));
    }
    batchPromises = batchPromises.filter(function (p) {
      return p;
    });
    if (batchPromises.length) {
      this.$q.all(batchPromises).then(function () {})["catch"](function (error) {
        _this15.errorLogger(error);
      })["finally"](function () {
        var _this15$setPersonTota, _configSettings;
        _this15.setPersonTotalResults(parentPerson, true, (_this15$setPersonTota = {}, _this15$setPersonTota[GOOGLE_SEARCH_SOURCE_CODE] = true, _this15$setPersonTota[GOOGLE_NEWS_SOURCE_CODE] = true, _this15$setPersonTota[STOCK_MARKETS_SOURCE_CODE] = true, _this15$setPersonTota[ALEPH_OCCRP_SOURCE_CODE] = true, _this15$setPersonTota[OPEN_SANCTIONS_SOURCE_CODE] = true, _this15$setPersonTota[OPEN_CORPORATES_SOURCE_CODE] = true, _this15$setPersonTota));
        var batchPromisesArray = [];
        var configSettings = (_configSettings = {}, _configSettings[GOOGLE_SEARCH_SOURCE_CODE] = _this15.ENABLE_GOOGLE_SEARCH, _configSettings[GOOGLE_NEWS_SOURCE_CODE] = _this15.ENABLE_GOOGLE_NEWS_RSS, _configSettings[EXTRA_SOURCE_SOURCE_CODE] = _this15.ENABLE_EXTRA_SEARCH_SOURCES, _configSettings[STOCK_MARKETS_SOURCE_CODE] = _this15.ENABLE_STOCK_MARKET_NEWS, _configSettings[ALEPH_OCCRP_SOURCE_CODE] = _this15.ENABLE_ALEPH_OCCRP, _configSettings[OPEN_CORPORATES_SOURCE_CODE] = _this15.ENABLE_OPEN_CORPORATES, _configSettings[OPEN_SANCTIONS_SOURCE_CODE] = _this15.ENABLE_OPEN_SANCTIONS, _configSettings);
        Object.keys(configSettings).forEach(function (sourceType) {
          if (configSettings[sourceType]) {
            var searchAdapter = _this15.allSearchAdapers.find(function (asa) {
              return asa.getAdapterSourceCode() === sourceType;
            });
            if (searchAdapter && (!searchAdapter.BATCH_LOAD_RESULTS || !searchAdapter.BATCH_ANALYZE_TEXT || !searchAdapter.BATCH_MENTIONED_ENTITIES || !searchAdapter.BATCH_SUMMARIZE_TEXT)) {
              batchPromisesArray.push(searchAdapter.analyzeRequestResults$(parentPerson, false, null, null, function () {}));
            }
          }
        });
        _this15.batchPromisesWrapper(batchPromisesArray).then(function () {})["catch"](function (error) {
          _this15.errorLogger(error);
        })["finally"](function () {
          deferred.resolve(parentPerson);
        });
      });
    } else {
      deferred.resolve(parentPerson);
    }
    return deferred.promise;
  };
  _proto.openDocument = function openDocument(searchResult) {
    var _this$openDocumentAda5;
    (_this$openDocumentAda5 = this.openDocumentAdapter) == null || _this$openDocumentAda5.openDocument(searchResult, []);
  };
  _proto.openCommentDocument = function openCommentDocument(data) {
    var _this$openDocumentAda6;
    var type = "";
    if (data.isFromExtraSource) type = EXTRA_SOURCE_SOURCE_CODE;
    if (data.isFromGoogleNewsRss) type = GOOGLE_NEWS_SOURCE_CODE;
    if (data.isFromStockMarket) type = STOCK_MARKETS_SOURCE_CODE;
    if (data.isFromAlephOccrp) type = ALEPH_OCCRP_SOURCE_CODE;
    if (data.isFromOpenSanctions) type = OPEN_SANCTIONS_SOURCE_CODE;
    if (data.isFromOpenCorporates) type = OPEN_CORPORATES_SOURCE_CODE;
    (_this$openDocumentAda6 = this.openDocumentAdapter) == null || _this$openDocumentAda6.openCommentDocument(data.url, data.contentElHtml, data.contentMarkupElHtml, data.personFullName, data.isEntitiesLoaded, data.isEntitiesHighlighted, data.entityNames, data.isKeywordsHighlighted, data.keywords, type, data.scoreMode);
  };
  _proto.loadPersonsExtendedSummary$ = function loadPersonsExtendedSummary$(persons, isBatch, callback) {
    var _this16 = this;
    var deferred = this.$q.defer();
    var batchPromisesArray = [];
    var resultsWereLoaded = !isBatch ? this.allSearchAdapers.find(function (asa) {
      return asa.SINGLE_LOAD_RESULTS === true;
    }) !== undefined : this.allSearchAdapers.find(function (asa) {
      return asa.BATCH_LOAD_RESULTS === true;
    }) !== undefined;
    if (resultsWereLoaded) {
      persons.forEach(function (person) {
        var _this16$processingAda;
        batchPromisesArray.push((_this16$processingAda = _this16.processingAdapter) == null ? void 0 : _this16$processingAda.loadAndSetPersonExtendedSummary$(person));
      });
    }
    this.batchPromisesWrapper(batchPromisesArray).then(function () {})["catch"](function (error) {
      _this16.errorLogger(error);
    })["finally"](function () {
      callback(persons);
      deferred.resolve(persons);
    });
    return deferred.promise;
  };
  _proto.loadPersonsGptInformation$ = function loadPersonsGptInformation$(persons, isBatch, callback) {
    var _this17 = this;
    var deferred = this.$q.defer();
    var batchPromisesArray = [];
    var resultsWereLoaded = !isBatch ? this.allSearchAdapers.find(function (asa) {
      return asa.SINGLE_LOAD_RESULTS === true;
    }) !== undefined : this.allSearchAdapers.find(function (asa) {
      return asa.BATCH_LOAD_RESULTS === true;
    }) !== undefined;
    if (resultsWereLoaded) {
      persons.forEach(function (person) {
        batchPromisesArray.push(_this17.loadPersonGptInformation$(person, callback));
      });
    }
    this.batchPromisesWrapper(batchPromisesArray).then(function () {})["catch"](function (error) {
      _this17.errorLogger(error);
    })["finally"](function () {
      deferred.resolve(persons);
    });
    return deferred.promise;
  };
  _proto.loadPersonsLLMInformation$ = function loadPersonsLLMInformation$(persons, isBatch, callback) {
    var _this18 = this;
    var deferred = this.$q.defer();
    var batchPromisesArray = [];
    var resultsWereLoaded = !isBatch ? this.allSearchAdapers.find(function (asa) {
      return asa.SINGLE_LOAD_RESULTS === true;
    }) !== undefined : this.allSearchAdapers.find(function (asa) {
      return asa.BATCH_LOAD_RESULTS === true;
    }) !== undefined;
    if (resultsWereLoaded) {
      persons.forEach(function (person) {
        batchPromisesArray.push(_this18.loadPersonLLMInformation$(person, callback));
      });
    }
    this.batchPromisesWrapper(batchPromisesArray).then(function () {})["catch"](function (error) {
      _this18.errorLogger(error);
    })["finally"](function () {
      deferred.resolve(persons);
    });
    return deferred.promise;
  };
  _proto.loadPersonsLinkedGraphs$ = function loadPersonsLinkedGraphs$(persons, isBatch, callback) {
    var _this19 = this;
    var deferred = this.$q.defer();
    var batchPromisesArray = [];
    persons.forEach(function (person) {
      batchPromisesArray.push(_this19.loadPersonLinkedGraph$(person, callback));
    });
    this.batchPromisesWrapper(batchPromisesArray).then(function () {})["catch"](function (error) {
      _this19.errorLogger(error);
    })["finally"](function () {
      deferred.resolve(persons);
    });
    return deferred.promise;
  };
  _proto.loadPersonGptInformation$ = function loadPersonGptInformation$(person, callback) {
    var _this$processingAdapt2,
      _this20 = this;
    var deferred = this.$q.defer();
    person.setTopGptRiskResults(20);
    var stopWatch = new StopWatch(undefined);
    stopWatch.start();
    (_this$processingAdapt2 = this.processingAdapter) == null || _this$processingAdapt2.loadAndSetPersonGptSearchResultsInformation$(person, callback).then(function () {})["catch"](function (error) {
      _this20.errorLogger(error);
    })["finally"](function () {
      var _this20$processingAda;
      (_this20$processingAda = _this20.processingAdapter) == null || _this20$processingAda.loadAndSetPersonGptInformation$(person, callback).then(function () {})["catch"](function (error) {
        _this20.errorLogger(error);
      })["finally"](function () {
        var _this20$processingAda2;
        (_this20$processingAda2 = _this20.processingAdapter) == null || _this20$processingAda2.loadAndSetPersonGptMatching$(person, callback).then(function () {})["catch"](function (error) {
          _this20.errorLogger(error);
        })["finally"](function () {
          stopWatch.stop();
          person.setPerformanceMetric("mediaPyGpt", "total", -1, stopWatch.getElapsedMilliseconds(), null);
          deferred.resolve(person);
        });
      });
    });
    return deferred.promise;
  };
  _proto.loadPersonLLMInformation$ = function loadPersonLLMInformation$(person, callback) {
    var _this$processingAdapt3,
      _this21 = this;
    var deferred = this.$q.defer();
    var stopWatch = new StopWatch(undefined);
    stopWatch.start();
    (_this$processingAdapt3 = this.processingAdapter) == null || _this$processingAdapt3.loadAndSetPersonLLMInformation$(person, callback).then(function () {})["catch"](function (error) {
      _this21.errorLogger(error);
    })["finally"](function () {
      stopWatch.stop();
      person.setPerformanceMetric("mediaPyLLM", "total", -1, stopWatch.getElapsedMilliseconds(), null);
      deferred.resolve(person);
    });
    return deferred.promise;
  };
  _proto.loadPersonLinkedGraph$ = function loadPersonLinkedGraph$(person, callback) {
    var _this$processingAdapt4,
      _this22 = this;
    var deferred = this.$q.defer();
    person.setTopGptRiskResults(20);
    var graphSearchResults = person.getTopGptRiskResults().slice(0, 5);
    var graphInfo = {
      edges: [],
      vertices: []
    };
    (_this$processingAdapt4 = this.processingAdapter) == null || _this$processingAdapt4.getGptConnectionsGraph$(graphSearchResults).then(function (resp) {
      graphInfo = resp.graph;
    })["catch"](function (error) {
      _this22.errorLogger(error);
    })["finally"](function () {
      person.setGptGraph(graphInfo);
      deferred.resolve(person);
    });
    return deferred.promise;
  };
  _proto.loadDocumentExtendedSummary$ = function loadDocumentExtendedSummary$(searchResult) {
    var _this$processingAdapt5,
      _this23 = this;
    var deferred = this.$q.defer();
    (_this$processingAdapt5 = this.processingAdapter) == null || _this$processingAdapt5.loadAndSetExtendedSummary$(searchResult).then(function () {})["catch"](function (error) {
      _this23.errorLogger(error);
    })["finally"](function () {
      deferred.resolve(searchResult);
    });
    return deferred.promise;
  };
  _proto.loadTopicInfo$ = function loadTopicInfo$(searchResult) {
    var _this$processingAdapt6,
      _this24 = this;
    var deferred = this.$q.defer();
    (_this$processingAdapt6 = this.processingAdapter) == null || _this$processingAdapt6.loadAndSetTopicInfo$(searchResult).then(function () {})["catch"](function (error) {
      _this24.errorLogger(error);
    })["finally"](function () {
      deferred.resolve(searchResult);
    });
    return deferred.promise;
  };
  _proto.getMarkupHtmlFromData$ = function getMarkupHtmlFromData$(requestData) {
    var _this$processingAdapt7,
      _this25 = this;
    var deferred = this.$q.defer();
    (_this$processingAdapt7 = this.processingAdapter) == null || _this$processingAdapt7.loadDocumentHtmlFromUrl$(requestData.url, requestData.type).then(function (html) {
      var _this25$processingAda;
      var cleanHtmlData = {
        url: requestData.url,
        html: html,
        type: requestData.type
      };
      (_this25$processingAda = _this25.processingAdapter) == null || _this25$processingAda.loadCleanHtmlFromData$(cleanHtmlData).then(function (data) {
        var _this25$processingAda2;
        var markupHtmlData = {
          html: data.html,
          text: data.text,
          language: data.language,
          personName: requestData.personName,
          mode: requestData.mode
        };
        (_this25$processingAda2 = _this25.processingAdapter) == null || _this25$processingAda2.getMarkupHtmlFromData$(markupHtmlData).then(function (markupHtml) {
          deferred.resolve(markupHtml);
        })["catch"](function (error) {
          _this25.errorLogger(error);
          deferred.reject(error);
        });
      })["catch"](function (error) {
        _this25.errorLogger(error);
        deferred.reject(error);
      });
    })["catch"](function (error) {
      _this25.errorLogger(error);
      deferred.reject(error);
    });
    return deferred.promise;
  };
  _proto.getWordCloudFromData$ = function getWordCloudFromData$(requestData) {
    var _this$processingAdapt8,
      _this26 = this;
    var deferred = this.$q.defer();
    (_this$processingAdapt8 = this.processingAdapter) == null || _this$processingAdapt8.loadDocumentHtmlFromUrl$(requestData.url, requestData.type).then(function (html) {
      var _this26$documentServi, _this26$processingAda;
      var title = (_this26$documentServi = _this26.documentService) == null ? void 0 : _this26$documentServi.getTitleFromHtml(html);
      var cleanHtmlData = {
        url: requestData.url,
        html: html,
        type: requestData.type
      };
      (_this26$processingAda = _this26.processingAdapter) == null || _this26$processingAda.loadCleanHtmlFromData$(cleanHtmlData).then(function (data) {
        var _this26$processingAda2;
        var wordCloudData = {
          title: title,
          text: data.text,
          language: data.language,
          personName: requestData.personName,
          mode: requestData.mode,
          width: requestData.width,
          height: requestData.height
        };
        (_this26$processingAda2 = _this26.processingAdapter) == null || _this26$processingAda2.getWordCloudFromData$(wordCloudData).then(function (img) {
          deferred.resolve(img);
        })["catch"](function (error) {
          _this26.errorLogger(error);
          deferred.reject(error);
        });
      })["catch"](function (error) {
        _this26.errorLogger(error);
        deferred.reject(error);
      });
    })["catch"](function (error) {
      _this26.errorLogger(error);
      deferred.reject(error);
    });
    return deferred.promise;
  };
  _proto.getConnectionsGraph$ = function getConnectionsGraph$(graphSearchResults) {
    var _this$processingAdapt9,
      _this27 = this;
    var deferred = this.$q.defer();
    (_this$processingAdapt9 = this.processingAdapter) == null || _this$processingAdapt9.getConnectionsGraph$(graphSearchResults.filter(function (searchResult) {
      return !searchResult.checkIsFromMatch();
    })).then(function (graphInfo) {
      deferred.resolve(graphInfo);
    })["catch"](function (error) {
      _this27.errorLogger(error);
      deferred.reject(error);
    });
    return deferred.promise;
  };
  _proto.getGptConnectionsGraph$ = function getGptConnectionsGraph$(graphSearchResults) {
    var _this$processingAdapt10,
      _this28 = this;
    var deferred = this.$q.defer();
    (_this$processingAdapt10 = this.processingAdapter) == null || _this$processingAdapt10.getGptConnectionsGraph$(graphSearchResults.filter(function (searchResult) {
      return !searchResult.checkIsFromMatch();
    })).then(function (graphInfo) {
      deferred.resolve(graphInfo);
    })["catch"](function (error) {
      _this28.errorLogger(error);
      deferred.reject(error);
    });
    return deferred.promise;
  };
  _proto.promiseWrapper = function promiseWrapper(objToResolve) {
    var defer = this.$q.defer();
    defer.resolve(objToResolve);
    return defer.promise;
  };
  _proto.batchPromisesWrapper = function batchPromisesWrapper(batchPromisesArray) {
    return batchPromisesArray.length ? this.$q.all(batchPromisesArray) : this.promiseWrapper([]);
  };
  _proto.setAlertPublication = function setAlertPublication(persons, scoreMode, fastProcessing, isBatch, createAlertsOnlyIfKeywordsAppear, minTotalRiskScore, minResultsCount) {
    var _this29 = this;
    var allKeywords = [];
    if (createAlertsOnlyIfKeywordsAppear) {
      var scoreTypeService = this.getScoreTypeServiceByType(scoreMode);
      if (scoreTypeService) {
        var _scoreTypeService$gro3;
        if ((_scoreTypeService$gro3 = scoreTypeService.groupRequestsConfigService) != null && _scoreTypeService$gro3.getAllGroups().length) {
          var allGroupObjects = scoreTypeService.groupRequestsConfigService.getAllGroups();
          for (var i = 0; i < allGroupObjects.length; i++) {
            var groupObject = allGroupObjects[i];
            var groupSearchEngineRequestObjects = groupObject.getAllRequestsByType(GOOGLE_SEARCH_SOURCE_CODE, isBatch, fastProcessing);
            groupSearchEngineRequestObjects.forEach(function (requestObject) {
              var searchConfig = requestObject.getSearchConfig();
              allKeywords = allKeywords.concat(_this29.mediaSearchEngineService.getAllKeywords(searchConfig).map(function (keywordConfig) {
                return keywordConfig.getKeyword();
              }));
            });
          }
        } else {
          var _scoreTypeService$sep8;
          var searchEngineRequestConfigs = ((_scoreTypeService$sep8 = scoreTypeService.separateRequestsConfigService) == null ? void 0 : _scoreTypeService$sep8.getAllRequestsByType(GOOGLE_SEARCH_SOURCE_CODE, isBatch, fastProcessing)) || [];
          searchEngineRequestConfigs.forEach(function (requestObject) {
            var _this29$mediaSearchEn;
            var searchConfig = requestObject.getSearchConfig();
            allKeywords = allKeywords.concat((_this29$mediaSearchEn = _this29.mediaSearchEngineService) == null ? void 0 : _this29$mediaSearchEn.getAllKeywords(searchConfig).map(function (keywordConfig) {
              return keywordConfig.getKeyword();
            }));
          });
        }
      }
      allKeywords = allKeywords.filter(onlyUnique);
    }
    persons.forEach(function (person) {
      var areSearchResultsWithKeywordsPresented = false;
      if (allKeywords.length) {
        var personTotalResults = person.getTotalResults().filter(function (searchResult) {
          return searchResult.checkIsFromSearchEngine() || searchResult.checkIsFromGoogleNewsRss() || searchResult.checkIsFromStockMarket();
        });
        for (var _i = 0; _i < personTotalResults.length; _i++) {
          var searchResult = personTotalResults[_i];
          var isContentTextContainKeywords = false;
          var contentElementText = (searchResult.getContentElementText() || "").toLowerCase();
          if (contentElementText) {
            for (var j = 0; j < allKeywords.length; j++) {
              var keyword = allKeywords[j];
              if (contentElementText.indexOf(keyword.toLowerCase()) > -1) {
                isContentTextContainKeywords = true;
                break;
              }
            }
          }
          if (isContentTextContainKeywords) {
            areSearchResultsWithKeywordsPresented = true;
            break;
          }
        }
      } else {
        areSearchResultsWithKeywordsPresented = true;
      }
      var minResultsCountConditionIsMet = person.getTotalResultsCount() >= minResultsCount;
      var minTotalRiskScoreConditionIsMet = person.getTotalRiskScore() >= minTotalRiskScore;
      person.setAlertShouldBeCreated(areSearchResultsWithKeywordsPresented && minResultsCountConditionIsMet && minTotalRiskScoreConditionIsMet);
    });
  };
  _proto.addAlertItemIdToLinkAnalys = function addAlertItemIdToLinkAnalys(alertItemId, parentPersonId, searchResultId, linkAnalysServiceId) {};
  _proto.destroy = function destroy() {
    this.$rootScope = null;
    this.$http = null;
    this.$q = null;
    this.$timeout = null;
    this.configRequestsService = null;
    this.mediaSearchEngineService = null;
    this.scoreTypeServices = [];
    this.documentService = null;
    this.searchEngineAdapter = null;
    this.googleNewsAdapter = null;
    this.extraSourcesAdapter = null;
    this.stockMarketsAdapter = null;
    this.alephOccrpAdapter = null;
    this.openSanctionsAdapter = null;
    this.openCorporatesAdapter = null;
    this.allSearchAdapers = [];
    this.parseDocumentAdapter = null;
    this.openDocumentAdapter = null;
    this.processingAdapter = null;
    this.mediaSearchRiskScoreCountAdapter = null;
    this.fakeLoadingBar = null;
    this.countriesData = [];
    this.isProcessingAliasPersonsEnabled = true;
    this.isProcessingLinkedPersonsEnabled = true;
    this.errorLogger = null;
    this.infoLogger = null;
    this.adaptersFactory.destroy();
    this.adaptersFactory = null;
    this.servicesFactory.destroy();
    this.servicesFactory = null;
  };
  return CommonMediaSearchAdapterV1;
}();
module.exports = {
  CommonMediaSearchAdapterV1: CommonMediaSearchAdapterV1
};

},{"../common/utils/filters-v4":691,"../common/utils/stopwatch":695,"../constants/source-types":697,"./factories":761}],760:[function(require,module,exports){
"use strict";

var _require = require("../instances/adapters/http"),
  GoogleNlpAdapterInstance = _require.GoogleNlpAdapterInstance,
  MediaPyAdapterInstance = _require.MediaPyAdapterInstance,
  MediaPyGptAdapterInstance = _require.MediaPyGptAdapterInstance,
  MediaPyLLMAdapterInstance = _require.MediaPyLLMAdapterInstance,
  ParseDocumentAdapterInstance = _require.ParseDocumentAdapterInstance,
  ScrapeAdapterInstance = _require.ScrapeAdapterInstance;
var _require2 = require("../instances/adapters/open"),
  OpenDocumentAdapterInstance = _require2.OpenDocumentAdapterInstance;
var _require3 = require("../instances/adapters/processing"),
  ProcessingAdapterInstance = _require3.ProcessingAdapterInstance;
var _require4 = require("../instances/adapters/scoring"),
  RiskScoringAdapterInstance = _require4.RiskScoringAdapterInstance;
var _require5 = require("../instances/adapters/search"),
  AlephOccrpAdapterInstance = _require5.AlephOccrpAdapterInstance,
  ExtraSourcesAdapterInstance = _require5.ExtraSourcesAdapterInstance,
  GoogleNewsAdapterInstance = _require5.GoogleNewsAdapterInstance,
  OpenCorporatesAdapterInstance = _require5.OpenCorporatesAdapterInstance,
  OpenSanctionsAdapterInstance = _require5.OpenSanctionsAdapterInstance,
  SearchEngineAdapterInstance = _require5.SearchEngineAdapterInstance,
  StockMarketsAdapterInstance = _require5.StockMarketsAdapterInstance;
var AdaptersFactoryV1 = function () {
  function AdaptersFactoryV1($rootScope, $http, $q, $timeout, fakeLoadingBar) {
    this.googleNlpAdapter = GoogleNlpAdapterInstance.getNewAdapter($rootScope, $http, $q, $timeout);
    this.mediaPyAdapter = MediaPyAdapterInstance.getNewAdapter($rootScope, $http, $q, $timeout);
    this.mediaPyGptAdapter = MediaPyGptAdapterInstance.getNewAdapter($rootScope, $http, $q, $timeout);
    this.mediaPyLLMAdapter = MediaPyLLMAdapterInstance.getNewAdapter($rootScope, $http, $q, $timeout);
    this.parseDocumentAdapter = ParseDocumentAdapterInstance.getNewAdapter($rootScope, $http, $q, $timeout);
    this.scrapeAdapter = ScrapeAdapterInstance.getNewAdapter($rootScope, $http, $q, $timeout);
    this.openDocumentAdapter = OpenDocumentAdapterInstance.getNewAdapter($rootScope, $http, $q, $timeout);
    this.processingAdapter = ProcessingAdapterInstance.getNewAdapter($rootScope, $http, $q, $timeout);
    this.riskScoringAdapter = RiskScoringAdapterInstance.getNewAdapter();
    this.alephOccrpAdapter = AlephOccrpAdapterInstance.getNewAdapter($rootScope, $http, $q, $timeout);
    this.extraSourcesAdapter = ExtraSourcesAdapterInstance.getNewAdapter($rootScope, $http, $q, $timeout);
    this.googleNewsAdapter = GoogleNewsAdapterInstance.getNewAdapter($rootScope, $http, $q, $timeout);
    this.openCorporatesAdapter = OpenCorporatesAdapterInstance.getNewAdapter($rootScope, $http, $q, $timeout);
    this.openSanctionsAdapter = OpenSanctionsAdapterInstance.getNewAdapter($rootScope, $http, $q, $timeout);
    this.searchEngineAdapter = SearchEngineAdapterInstance.getNewAdapter($rootScope, $http, $q, $timeout, fakeLoadingBar);
    this.stockMarketsAdapter = StockMarketsAdapterInstance.getNewAdapter($rootScope, $http, $q, $timeout);
  }
  var _proto = AdaptersFactoryV1.prototype;
  _proto.getGoogleNlpAdapter = function getGoogleNlpAdapter() {
    return this.googleNlpAdapter;
  };
  _proto.getMediaPyAdapter = function getMediaPyAdapter() {
    return this.mediaPyAdapter;
  };
  _proto.getMediaPyGptAdapter = function getMediaPyGptAdapter() {
    return this.mediaPyGptAdapter;
  };
  _proto.getMediaPyLLMAdapter = function getMediaPyLLMAdapter() {
    return this.mediaPyLLMAdapter;
  };
  _proto.getParseDocumentAdapter = function getParseDocumentAdapter() {
    return this.parseDocumentAdapter;
  };
  _proto.getScrapeAdapter = function getScrapeAdapter() {
    return this.scrapeAdapter;
  };
  _proto.getOpenDocumentAdapter = function getOpenDocumentAdapter() {
    return this.openDocumentAdapter;
  };
  _proto.getProcessingAdapter = function getProcessingAdapter() {
    return this.processingAdapter;
  };
  _proto.getRiskScoringAdapter = function getRiskScoringAdapter() {
    return this.riskScoringAdapter;
  };
  _proto.getAlephOccrpAdapter = function getAlephOccrpAdapter() {
    return this.alephOccrpAdapter;
  };
  _proto.getExtraSourcesAdapter = function getExtraSourcesAdapter() {
    return this.extraSourcesAdapter;
  };
  _proto.getGoogleNewsAdapter = function getGoogleNewsAdapter() {
    return this.googleNewsAdapter;
  };
  _proto.getOpenCorporatesAdapter = function getOpenCorporatesAdapter() {
    return this.openCorporatesAdapter;
  };
  _proto.getOpenSanctionsAdapter = function getOpenSanctionsAdapter() {
    return this.openSanctionsAdapter;
  };
  _proto.getSearchEngineAdapter = function getSearchEngineAdapter() {
    return this.searchEngineAdapter;
  };
  _proto.getStockMarketsAdapter = function getStockMarketsAdapter() {
    return this.stockMarketsAdapter;
  };
  _proto.destroy = function destroy() {
    this.googleNlpAdapter.destroy();
    this.googleNlpAdapter = null;
    this.mediaPyAdapter.destroy();
    this.mediaPyAdapter = null;
    this.mediaPyGptAdapter.destroy();
    this.mediaPyGptAdapter = null;
    this.mediaPyLLMAdapter.destroy();
    this.mediaPyLLMAdapter = null;
    this.parseDocumentAdapter.destroy();
    this.parseDocumentAdapter = null;
    this.openDocumentAdapter.destroy();
    this.openDocumentAdapter = null;
    this.processingAdapter.destroy();
    this.processingAdapter = null;
    this.scrapeAdapter.destroy();
    this.scrapeAdapter = null;
    this.alephOccrpAdapter.destroy();
    this.alephOccrpAdapter = null;
    this.extraSourcesAdapter.destroy();
    this.extraSourcesAdapter = null;
    this.googleNewsAdapter.destroy();
    this.googleNewsAdapter = null;
    this.stockMarketsAdapter.destroy();
    this.stockMarketsAdapter = null;
    this.openCorporatesAdapter.destroy();
    this.openCorporatesAdapter = null;
    this.openSanctionsAdapter.destroy();
    this.openSanctionsAdapter = null;
    this.searchEngineAdapter.destroy();
    this.searchEngineAdapter = null;
    this.riskScoringAdapter.destroy();
    this.riskScoringAdapter = null;
  };
  return AdaptersFactoryV1;
}();
module.exports = {
  AdaptersFactoryV1: AdaptersFactoryV1
};

},{"../instances/adapters/http":764,"../instances/adapters/open":770,"../instances/adapters/processing":772,"../instances/adapters/scoring":774,"../instances/adapters/search":779}],761:[function(require,module,exports){
arguments[4][705][0].apply(exports,arguments)
},{"./adapters-v1":760,"./services-v1":762,"dup":705}],762:[function(require,module,exports){
"use strict";

var _require = require("../instances/services/http"),
  AlephOccrpRequestsServiceInstance = _require.AlephOccrpRequestsServiceInstance,
  ConfigRequestsServiceInstance = _require.ConfigRequestsServiceInstance,
  ExtraSourcesRequestsServiceInstance = _require.ExtraSourcesRequestsServiceInstance,
  GoogleNewsRequestsServiceInstance = _require.GoogleNewsRequestsServiceInstance,
  GoogleNlpRequestsServiceInstance = _require.GoogleNlpRequestsServiceInstance,
  GoogleSearchRequestsServiceInstance = _require.GoogleSearchRequestsServiceInstance,
  MediaPyGptRequestsServiceInstance = _require.MediaPyGptRequestsServiceInstance,
  MediaPyLLMRequestsServiceInstance = _require.MediaPyLLMRequestsServiceInstance,
  MediaPyRequestsServiceInstance = _require.MediaPyRequestsServiceInstance,
  OpenCorporatesRequestsServiceInstance = _require.OpenCorporatesRequestsServiceInstance,
  OpenSanctionsRequestsServiceInstance = _require.OpenSanctionsRequestsServiceInstance,
  ParseDocumentRequestsServiceInstance = _require.ParseDocumentRequestsServiceInstance,
  ScrapeRequestsServiceInstance = _require.ScrapeRequestsServiceInstance,
  StockMarketsRequestsServiceInstance = _require.StockMarketsRequestsServiceInstance;
var _require2 = require("../instances/services/persons"),
  MediaSearchPersonsRequestsServiceInstance = _require2.MediaSearchPersonsRequestsServiceInstance,
  MediaSearchPersonsServiceInstance = _require2.MediaSearchPersonsServiceInstance;
var _require3 = require("../instances/services/requests"),
  MediaSearchEngineServiceInstance = _require3.MediaSearchEngineServiceInstance,
  MediaSearchScoreTypeServiceInstance = _require3.MediaSearchScoreTypeServiceInstance;
var _require4 = require("../instances/services/scoring"),
  MediaSearchRiskScoringInstance = _require4.MediaSearchRiskScoringInstance;
var _require5 = require("../instances/services/utils"),
  DocumentServiceInstance = _require5.DocumentServiceInstance,
  HighlightServiceInstance = _require5.HighlightServiceInstance,
  NewTabWindowServiceInstance = _require5.NewTabWindowServiceInstance;
var ServicesFactoryV1 = function () {
  function ServicesFactoryV1($rootScope, $http, $q, $timeout) {
    this.alephOccrpRequestsService = AlephOccrpRequestsServiceInstance.getNewService($rootScope, $http, $q, $timeout);
    this.configRequestsService = ConfigRequestsServiceInstance.getNewService($rootScope, $http, $q, $timeout);
    this.extraSourcesRequestsService = ExtraSourcesRequestsServiceInstance.getNewService($rootScope, $http, $q, $timeout);
    this.googleNewsRequestsService = GoogleNewsRequestsServiceInstance.getNewService($rootScope, $http, $q, $timeout);
    this.googleNlpRequestsService = GoogleNlpRequestsServiceInstance.getNewService($rootScope, $http, $q, $timeout);
    this.googleSearchRequestsService = GoogleSearchRequestsServiceInstance.getNewService($rootScope, $http, $q, $timeout);
    this.mediaPyGptRequestsService = MediaPyGptRequestsServiceInstance.getNewService($rootScope, $http, $q, $timeout);
    this.mediaPyLLMRequestsService = MediaPyLLMRequestsServiceInstance.getNewService($rootScope, $http, $q, $timeout);
    this.mediaPyRequestsService = MediaPyRequestsServiceInstance.getNewService($rootScope, $http, $q, $timeout);
    this.openCorporatesRequestsService = OpenCorporatesRequestsServiceInstance.getNewService($rootScope, $http, $q, $timeout);
    this.openSanctionsRequestsService = OpenSanctionsRequestsServiceInstance.getNewService($rootScope, $http, $q, $timeout);
    this.parseDocumentRequestsService = ParseDocumentRequestsServiceInstance.getNewService($rootScope, $http, $q, $timeout);
    this.scrapeRequestsService = ScrapeRequestsServiceInstance.getNewService($rootScope, $http, $q, $timeout);
    this.stockMarketsRequestsService = StockMarketsRequestsServiceInstance.getNewService($rootScope, $http, $q, $timeout);
    this.scoreTypeServices = {};
  }
  var _proto = ServicesFactoryV1.prototype;
  _proto.getAlephOccrpRequestsService = function getAlephOccrpRequestsService() {
    return this.alephOccrpRequestsService;
  };
  _proto.getConfigRequestsService = function getConfigRequestsService() {
    return this.configRequestsService;
  };
  _proto.getExtraSourcesRequestsService = function getExtraSourcesRequestsService() {
    return this.extraSourcesRequestsService;
  };
  _proto.getGoogleNewsRequestsService = function getGoogleNewsRequestsService() {
    return this.googleNewsRequestsService;
  };
  _proto.getGoogleNlpRequestsService = function getGoogleNlpRequestsService() {
    return this.googleNlpRequestsService;
  };
  _proto.getGoogleSearchRequestsService = function getGoogleSearchRequestsService() {
    return this.googleSearchRequestsService;
  };
  _proto.getMediaPyGptRequestsService = function getMediaPyGptRequestsService() {
    return this.mediaPyGptRequestsService;
  };
  _proto.getMediaPyLLMRequestsService = function getMediaPyLLMRequestsService() {
    return this.mediaPyLLMRequestsService;
  };
  _proto.getMediaPyRequestsService = function getMediaPyRequestsService() {
    return this.mediaPyRequestsService;
  };
  _proto.getOpenCorporatesRequestsService = function getOpenCorporatesRequestsService() {
    return this.openCorporatesRequestsService;
  };
  _proto.getOpenSanctionsRequestsService = function getOpenSanctionsRequestsService() {
    return this.openSanctionsRequestsService;
  };
  _proto.getParseDocumentRequestsService = function getParseDocumentRequestsService() {
    return this.parseDocumentRequestsService;
  };
  _proto.getScrapeRequestsService = function getScrapeRequestsService() {
    return this.scrapeRequestsService;
  };
  _proto.getStockMarketsRequestsService = function getStockMarketsRequestsService() {
    return this.stockMarketsRequestsService;
  };
  _proto.getMediaSearchPersonsRequestsService = function getMediaSearchPersonsRequestsService() {
    return MediaSearchPersonsRequestsServiceInstance.getNewService();
  };
  _proto.getMediaSearchPersonsService = function getMediaSearchPersonsService() {
    return MediaSearchPersonsServiceInstance.getNewService();
  };
  _proto.getMediaSearchEngineService = function getMediaSearchEngineService() {
    return MediaSearchEngineServiceInstance.getNewService();
  };
  _proto.getMediaSearchScoreTypeService = function getMediaSearchScoreTypeService(scoreType) {
    if (!this.scoreTypeServices[scoreType]) {
      this.scoreTypeServices[scoreType] = MediaSearchScoreTypeServiceInstance.getNewService(scoreType);
    }
    return this.scoreTypeServices[scoreType];
  };
  _proto.getMediaSearchRiskScoreCountService = function getMediaSearchRiskScoreCountService() {
    return MediaSearchRiskScoringInstance.getService();
  };
  _proto.getDocumentSerice = function getDocumentSerice() {
    return DocumentServiceInstance.getService();
  };
  _proto.getHighlightSerice = function getHighlightSerice() {
    return HighlightServiceInstance.getService();
  };
  _proto.getNewTabWindowService = function getNewTabWindowService() {
    return NewTabWindowServiceInstance.getService();
  };
  _proto.destroy = function destroy() {
    var _this = this;
    this.configRequestsService.destroy();
    this.configRequestsService = null;
    this.alephOccrpRequestsService.destroy();
    this.alephOccrpRequestsService = null;
    this.extraSourcesRequestsService.destroy();
    this.extraSourcesRequestsService = null;
    this.googleNewsRequestsService.destroy();
    this.googleNewsRequestsService = null;
    this.stockMarketsRequestsService.destroy();
    this.stockMarketsRequestsService = null;
    this.openCorporatesRequestsService.destroy();
    this.openCorporatesRequestsService = null;
    this.openSanctionsRequestsService.destroy();
    this.openSanctionsRequestsService = null;
    this.googleSearchRequestsService.destroy();
    this.googleSearchRequestsService = null;
    this.googleNlpRequestsService.destroy();
    this.googleNlpRequestsService = null;
    this.mediaPyRequestsService.destroy();
    this.mediaPyRequestsService = null;
    this.mediaPyGptRequestsService.destroy();
    this.mediaPyGptRequestsService = null;
    this.mediaPyLLMRequestsService.destroy();
    this.mediaPyLLMRequestsService = null;
    this.parseDocumentRequestsService.destroy();
    this.parseDocumentRequestsService = null;
    this.scrapeRequestsService.destroy();
    this.scrapeRequestsService = null;
    Object.keys(this.scoreTypeServices).forEach(function (key) {
      var _this$scoreTypeServic;
      (_this$scoreTypeServic = _this.scoreTypeServices[key]) == null || _this$scoreTypeServic.destroy();
      _this.scoreTypeServices[key] = null;
    });
  };
  return ServicesFactoryV1;
}();
module.exports = {
  ServicesFactoryV1: ServicesFactoryV1
};

},{"../instances/services/http":790,"../instances/services/persons":799,"../instances/services/requests":802,"../instances/services/scoring":805,"../instances/services/utils":809}],763:[function(require,module,exports){
"use strict";

var _require = require("../../../adapters/http"),
  GoogleNlpAdapterV6 = _require.GoogleNlpAdapterV6;
var GoogleNlpAdapterInstance = function () {
  function GoogleNlpAdapterInstance() {
    this.adapter = null;
  }
  var _proto = GoogleNlpAdapterInstance.prototype;
  _proto.getAdapter = function getAdapter($rootScope, $http, $q, $timeout) {
    if (!this.adapter) {
      this.adapter = new GoogleNlpAdapterV6($rootScope, $http, $q, $timeout);
    }
    return this.adapter;
  };
  _proto.getNewAdapter = function getNewAdapter($rootScope, $http, $q, $timeout) {
    return new GoogleNlpAdapterV6($rootScope, $http, $q, $timeout);
  };
  return GoogleNlpAdapterInstance;
}();
module.exports = {
  GoogleNlpAdapterInstance: new GoogleNlpAdapterInstance()
};

},{"../../../adapters/http":738}],764:[function(require,module,exports){
"use strict";

var _require = require("./google-nlp-adapter"),
  GoogleNlpAdapterInstance = _require.GoogleNlpAdapterInstance;
var _require2 = require("./media-py-adapter"),
  MediaPyAdapterInstance = _require2.MediaPyAdapterInstance;
var _require3 = require("./media-py-gpt-adapter"),
  MediaPyGptAdapterInstance = _require3.MediaPyGptAdapterInstance;
var _require4 = require("./media-py-llm-adapter"),
  MediaPyLLMAdapterInstance = _require4.MediaPyLLMAdapterInstance;
var _require5 = require("./parse-document-adapter"),
  ParseDocumentAdapterInstance = _require5.ParseDocumentAdapterInstance;
var _require6 = require("./scrape-adapter"),
  ScrapeAdapterInstance = _require6.ScrapeAdapterInstance;
module.exports = {
  GoogleNlpAdapterInstance: GoogleNlpAdapterInstance,
  MediaPyAdapterInstance: MediaPyAdapterInstance,
  MediaPyGptAdapterInstance: MediaPyGptAdapterInstance,
  MediaPyLLMAdapterInstance: MediaPyLLMAdapterInstance,
  ParseDocumentAdapterInstance: ParseDocumentAdapterInstance,
  ScrapeAdapterInstance: ScrapeAdapterInstance
};

},{"./google-nlp-adapter":763,"./media-py-adapter":765,"./media-py-gpt-adapter":766,"./media-py-llm-adapter":767,"./parse-document-adapter":768,"./scrape-adapter":769}],765:[function(require,module,exports){
"use strict";

var _require = require("../../../adapters/http"),
  MediaPyAdapterV8 = _require.MediaPyAdapterV8;
var MediaPyAdapterInstance = function () {
  function MediaPyAdapterInstance() {
    this.adapter = null;
  }
  var _proto = MediaPyAdapterInstance.prototype;
  _proto.getAdapter = function getAdapter($rootScope, $http, $q, $timeout) {
    if (!this.adapter) {
      this.adapter = new MediaPyAdapterV8($rootScope, $http, $q, $timeout);
    }
    return this.adapter;
  };
  _proto.getNewAdapter = function getNewAdapter($rootScope, $http, $q, $timeout) {
    return new MediaPyAdapterV8($rootScope, $http, $q, $timeout);
  };
  return MediaPyAdapterInstance;
}();
module.exports = {
  MediaPyAdapterInstance: new MediaPyAdapterInstance()
};

},{"../../../adapters/http":738}],766:[function(require,module,exports){
"use strict";

var _require = require("../../../adapters/http"),
  MediaPyGptAdapterV1 = _require.MediaPyGptAdapterV1;
var MediaPyGptAdapterInstance = function () {
  function MediaPyGptAdapterInstance() {
    this.adapter = null;
  }
  var _proto = MediaPyGptAdapterInstance.prototype;
  _proto.getAdapter = function getAdapter($rootScope, $http, $q, $timeout) {
    if (!this.adapter) {
      this.adapter = new MediaPyGptAdapterV1($rootScope, $http, $q, $timeout);
    }
    return this.adapter;
  };
  _proto.getNewAdapter = function getNewAdapter($rootScope, $http, $q, $timeout) {
    return new MediaPyGptAdapterV1($rootScope, $http, $q, $timeout);
  };
  return MediaPyGptAdapterInstance;
}();
module.exports = {
  MediaPyGptAdapterInstance: new MediaPyGptAdapterInstance()
};

},{"../../../adapters/http":738}],767:[function(require,module,exports){
"use strict";

var _require = require("../../../adapters/http"),
  MediaPyLLMAdapterV1 = _require.MediaPyLLMAdapterV1;
var MediaPyLLMAdapterInstance = function () {
  function MediaPyLLMAdapterInstance() {
    this.adapter = null;
  }
  var _proto = MediaPyLLMAdapterInstance.prototype;
  _proto.getAdapter = function getAdapter($rootScope, $http, $q, $timeout) {
    if (!this.adapter) {
      this.adapter = new MediaPyLLMAdapterV1($rootScope, $http, $q, $timeout);
    }
    return this.adapter;
  };
  _proto.getNewAdapter = function getNewAdapter($rootScope, $http, $q, $timeout) {
    return new MediaPyLLMAdapterV1($rootScope, $http, $q, $timeout);
  };
  return MediaPyLLMAdapterInstance;
}();
module.exports = {
  MediaPyLLMAdapterInstance: new MediaPyLLMAdapterInstance()
};

},{"../../../adapters/http":738}],768:[function(require,module,exports){
"use strict";

var _require = require("../../../adapters/http"),
  ParseDocumentAdapterV6 = _require.ParseDocumentAdapterV6;
var ParseDocumentAdapterInstance = function () {
  function ParseDocumentAdapterInstance() {
    this.adapter = null;
  }
  var _proto = ParseDocumentAdapterInstance.prototype;
  _proto.getAdapter = function getAdapter($rootScope, $http, $q, $timeout) {
    if (!this.adapter) {
      this.adapter = new ParseDocumentAdapterV6($rootScope, $http, $q, $timeout);
    }
    return this.adapter;
  };
  _proto.getNewAdapter = function getNewAdapter($rootScope, $http, $q, $timeout) {
    return new ParseDocumentAdapterV6($rootScope, $http, $q, $timeout);
  };
  return ParseDocumentAdapterInstance;
}();
module.exports = {
  ParseDocumentAdapterInstance: new ParseDocumentAdapterInstance()
};

},{"../../../adapters/http":738}],769:[function(require,module,exports){
"use strict";

var _require = require("../../../adapters/http"),
  ScrapeAdapterV6 = _require.ScrapeAdapterV6;
var ScrapeAdapterInstance = function () {
  function ScrapeAdapterInstance() {
    this.adapter = null;
  }
  var _proto = ScrapeAdapterInstance.prototype;
  _proto.getAdapter = function getAdapter($rootScope, $http, $q, $timeout) {
    if (!this.adapter) {
      this.adapter = new ScrapeAdapterV6($rootScope, $http, $q, $timeout);
    }
    return this.adapter;
  };
  _proto.getNewAdapter = function getNewAdapter($rootScope, $http, $q, $timeout) {
    return new ScrapeAdapterV6($rootScope, $http, $q, $timeout);
  };
  return ScrapeAdapterInstance;
}();
module.exports = {
  ScrapeAdapterInstance: new ScrapeAdapterInstance()
};

},{"../../../adapters/http":738}],770:[function(require,module,exports){
"use strict";

var _require = require("./open-document-adapter"),
  OpenDocumentAdapterInstance = _require.OpenDocumentAdapterInstance;
module.exports = {
  OpenDocumentAdapterInstance: OpenDocumentAdapterInstance
};

},{"./open-document-adapter":771}],771:[function(require,module,exports){
"use strict";

var _require = require("../../../adapters/open"),
  OpenDocumentAdapterV1 = _require.OpenDocumentAdapterV1;
var OpenDocumentAdapterInstance = function () {
  function OpenDocumentAdapterInstance() {
    this.adapter = null;
  }
  var _proto = OpenDocumentAdapterInstance.prototype;
  _proto.getAdapter = function getAdapter($rootScope, $http, $q, $timeout) {
    if (!this.adapter) {
      this.adapter = new OpenDocumentAdapterV1($rootScope, $http, $q, $timeout);
    }
    return this.adapter;
  };
  _proto.getNewAdapter = function getNewAdapter($rootScope, $http, $q, $timeout) {
    return new OpenDocumentAdapterV1($rootScope, $http, $q, $timeout);
  };
  return OpenDocumentAdapterInstance;
}();
module.exports = {
  OpenDocumentAdapterInstance: new OpenDocumentAdapterInstance()
};

},{"../../../adapters/open":744}],772:[function(require,module,exports){
"use strict";

var _require = require("./processing-adapter"),
  ProcessingAdapterInstance = _require.ProcessingAdapterInstance;
module.exports = {
  ProcessingAdapterInstance: ProcessingAdapterInstance
};

},{"./processing-adapter":773}],773:[function(require,module,exports){
"use strict";

var _require = require("../../../adapters/processing"),
  ProcessingAdapterV1 = _require.ProcessingAdapterV1;
var ProcessingAdapterInstance = function () {
  function ProcessingAdapterInstance() {
    this.adapter = null;
  }
  var _proto = ProcessingAdapterInstance.prototype;
  _proto.getAdapter = function getAdapter($rootScope, $http, $q, $timeout) {
    if (!this.adapter) {
      this.adapter = new ProcessingAdapterV1($rootScope, $http, $q, $timeout);
    }
    return this.adapter;
  };
  _proto.getNewAdapter = function getNewAdapter($rootScope, $http, $q, $timeout) {
    return new ProcessingAdapterV1($rootScope, $http, $q, $timeout);
  };
  return ProcessingAdapterInstance;
}();
module.exports = {
  ProcessingAdapterInstance: new ProcessingAdapterInstance()
};

},{"../../../adapters/processing":746}],774:[function(require,module,exports){
"use strict";

var _require = require("./riskscoring-adapter"),
  RiskScoringAdapterInstance = _require.RiskScoringAdapterInstance;
module.exports = {
  RiskScoringAdapterInstance: RiskScoringAdapterInstance
};

},{"./riskscoring-adapter":775}],775:[function(require,module,exports){
"use strict";

var _require = require("../../../adapters/scoring"),
  RiskScoringAdapterV1 = _require.RiskScoringAdapterV1;
var RiskScoringAdapterInstance = function () {
  function RiskScoringAdapterInstance() {
    this.adapter = null;
  }
  var _proto = RiskScoringAdapterInstance.prototype;
  _proto.getAdapter = function getAdapter() {
    if (!this.adapter) {
      this.adapter = new RiskScoringAdapterV1();
    }
    return this.adapter;
  };
  _proto.getNewAdapter = function getNewAdapter() {
    return new RiskScoringAdapterV1();
  };
  return RiskScoringAdapterInstance;
}();
module.exports = {
  RiskScoringAdapterInstance: new RiskScoringAdapterInstance()
};

},{"../../../adapters/scoring":748}],776:[function(require,module,exports){
"use strict";

var _require = require("../../../adapters/search"),
  AlephOccrpAdapterV1 = _require.AlephOccrpAdapterV1;
var AlephOccrpAdapterInstance = function () {
  function AlephOccrpAdapterInstance() {
    this.adapter = null;
  }
  var _proto = AlephOccrpAdapterInstance.prototype;
  _proto.getAdapter = function getAdapter($rootScope, $http, $q, $timeout) {
    if (!this.adapter) {
      this.adapter = new AlephOccrpAdapterV1($rootScope, $http, $q, $timeout);
    }
    return this.adapter;
  };
  _proto.getNewAdapter = function getNewAdapter($rootScope, $http, $q, $timeout) {
    return new AlephOccrpAdapterV1($rootScope, $http, $q, $timeout);
  };
  return AlephOccrpAdapterInstance;
}();
module.exports = {
  AlephOccrpAdapterInstance: new AlephOccrpAdapterInstance()
};

},{"../../../adapters/search":753}],777:[function(require,module,exports){
"use strict";

var _require = require("../../../adapters/search"),
  ExtraSourcesAdapterV1 = _require.ExtraSourcesAdapterV1;
var ExtraSourcesAdapterInstance = function () {
  function ExtraSourcesAdapterInstance() {
    this.adapter = null;
  }
  var _proto = ExtraSourcesAdapterInstance.prototype;
  _proto.getAdapter = function getAdapter($rootScope, $http, $q, $timeout) {
    if (!this.adapter) {
      this.adapter = new ExtraSourcesAdapterV1($rootScope, $http, $q, $timeout);
    }
    return this.adapter;
  };
  _proto.getNewAdapter = function getNewAdapter($rootScope, $http, $q, $timeout) {
    return new ExtraSourcesAdapterV1($rootScope, $http, $q, $timeout);
  };
  return ExtraSourcesAdapterInstance;
}();
module.exports = {
  ExtraSourcesAdapterInstance: new ExtraSourcesAdapterInstance()
};

},{"../../../adapters/search":753}],778:[function(require,module,exports){
"use strict";

var _require = require("../../../adapters/search"),
  GoogleNewsAdapterV1 = _require.GoogleNewsAdapterV1;
var GoogleNewsAdapterInstance = function () {
  function GoogleNewsAdapterInstance() {
    this.adapter = null;
  }
  var _proto = GoogleNewsAdapterInstance.prototype;
  _proto.getAdapter = function getAdapter($rootScope, $http, $q, $timeout) {
    if (!this.adapter) {
      this.adapter = new GoogleNewsAdapterV1($rootScope, $http, $q, $timeout);
    }
    return this.adapter;
  };
  _proto.getNewAdapter = function getNewAdapter($rootScope, $http, $q, $timeout) {
    return new GoogleNewsAdapterV1($rootScope, $http, $q, $timeout);
  };
  return GoogleNewsAdapterInstance;
}();
module.exports = {
  GoogleNewsAdapterInstance: new GoogleNewsAdapterInstance()
};

},{"../../../adapters/search":753}],779:[function(require,module,exports){
"use strict";

var _require = require("./aleph-occrp-adapter"),
  AlephOccrpAdapterInstance = _require.AlephOccrpAdapterInstance;
var _require2 = require("./extra-sources-adapter"),
  ExtraSourcesAdapterInstance = _require2.ExtraSourcesAdapterInstance;
var _require3 = require("./google-news-adapter"),
  GoogleNewsAdapterInstance = _require3.GoogleNewsAdapterInstance;
var _require4 = require("./open-corporates-adapter"),
  OpenCorporatesAdapterInstance = _require4.OpenCorporatesAdapterInstance;
var _require5 = require("./open-sanctions-adapter"),
  OpenSanctionsAdapterInstance = _require5.OpenSanctionsAdapterInstance;
var _require6 = require("./search-engine-adapter"),
  SearchEngineAdapterInstance = _require6.SearchEngineAdapterInstance;
var _require7 = require("./stock-markets-adapter"),
  StockMarketsAdapterInstance = _require7.StockMarketsAdapterInstance;
module.exports = {
  AlephOccrpAdapterInstance: AlephOccrpAdapterInstance,
  ExtraSourcesAdapterInstance: ExtraSourcesAdapterInstance,
  GoogleNewsAdapterInstance: GoogleNewsAdapterInstance,
  OpenCorporatesAdapterInstance: OpenCorporatesAdapterInstance,
  OpenSanctionsAdapterInstance: OpenSanctionsAdapterInstance,
  SearchEngineAdapterInstance: SearchEngineAdapterInstance,
  StockMarketsAdapterInstance: StockMarketsAdapterInstance
};

},{"./aleph-occrp-adapter":776,"./extra-sources-adapter":777,"./google-news-adapter":778,"./open-corporates-adapter":780,"./open-sanctions-adapter":781,"./search-engine-adapter":782,"./stock-markets-adapter":783}],780:[function(require,module,exports){
"use strict";

var _require = require("../../../adapters/search"),
  OpenCorporatesAdapterV1 = _require.OpenCorporatesAdapterV1;
var OpenCorporatesAdapterInstance = function () {
  function OpenCorporatesAdapterInstance() {
    this.adapter = null;
  }
  var _proto = OpenCorporatesAdapterInstance.prototype;
  _proto.getAdapter = function getAdapter($rootScope, $http, $q, $timeout) {
    if (!this.adapter) {
      this.adapter = new OpenCorporatesAdapterV1($rootScope, $http, $q, $timeout);
    }
    return this.adapter;
  };
  _proto.getNewAdapter = function getNewAdapter($rootScope, $http, $q, $timeout) {
    return new OpenCorporatesAdapterV1($rootScope, $http, $q, $timeout);
  };
  return OpenCorporatesAdapterInstance;
}();
module.exports = {
  OpenCorporatesAdapterInstance: new OpenCorporatesAdapterInstance()
};

},{"../../../adapters/search":753}],781:[function(require,module,exports){
"use strict";

var _require = require("../../../adapters/search"),
  OpenSanctionsAdapterV1 = _require.OpenSanctionsAdapterV1;
var OpenSanctionsAdapterInstance = function () {
  function OpenSanctionsAdapterInstance() {
    this.adapter = null;
  }
  var _proto = OpenSanctionsAdapterInstance.prototype;
  _proto.getAdapter = function getAdapter($rootScope, $http, $q, $timeout) {
    if (!this.adapter) {
      this.adapter = new OpenSanctionsAdapterV1($rootScope, $http, $q, $timeout);
    }
    return this.adapter;
  };
  _proto.getNewAdapter = function getNewAdapter($rootScope, $http, $q, $timeout) {
    return new OpenSanctionsAdapterV1($rootScope, $http, $q, $timeout);
  };
  return OpenSanctionsAdapterInstance;
}();
module.exports = {
  OpenSanctionsAdapterInstance: new OpenSanctionsAdapterInstance()
};

},{"../../../adapters/search":753}],782:[function(require,module,exports){
"use strict";

var _require = require("../../../adapters/search"),
  SearchEngineAdapterV1 = _require.SearchEngineAdapterV1;
var SearchEngineAdapterInstance = function () {
  function SearchEngineAdapterInstance() {
    this.adapter = null;
  }
  var _proto = SearchEngineAdapterInstance.prototype;
  _proto.getAdapter = function getAdapter($rootScope, $http, $q, $timeout, fakeLoadingBar) {
    if (!this.adapter) {
      this.adapter = new SearchEngineAdapterV1($rootScope, $http, $q, $timeout, fakeLoadingBar);
    }
    return this.adapter;
  };
  _proto.getNewAdapter = function getNewAdapter($rootScope, $http, $q, $timeout, fakeLoadingBar) {
    return new SearchEngineAdapterV1($rootScope, $http, $q, $timeout, fakeLoadingBar);
  };
  return SearchEngineAdapterInstance;
}();
module.exports = {
  SearchEngineAdapterInstance: new SearchEngineAdapterInstance()
};

},{"../../../adapters/search":753}],783:[function(require,module,exports){
"use strict";

var _require = require("../../../adapters/search"),
  StockMarketsAdapterV1 = _require.StockMarketsAdapterV1;
var StockMarketsAdapterInstance = function () {
  function StockMarketsAdapterInstance() {
    this.adapter = null;
  }
  var _proto = StockMarketsAdapterInstance.prototype;
  _proto.getAdapter = function getAdapter($rootScope, $http, $q, $timeout) {
    if (!this.adapter) {
      this.adapter = new StockMarketsAdapterV1($rootScope, $http, $q, $timeout);
    }
    return this.adapter;
  };
  _proto.getNewAdapter = function getNewAdapter($rootScope, $http, $q, $timeout) {
    return new StockMarketsAdapterV1($rootScope, $http, $q, $timeout);
  };
  return StockMarketsAdapterInstance;
}();
module.exports = {
  StockMarketsAdapterInstance: new StockMarketsAdapterInstance()
};

},{"../../../adapters/search":753}],784:[function(require,module,exports){
"use strict";

var _require = require("../../../services/http"),
  AlephOccrpRequestsServiceV4 = _require.AlephOccrpRequestsServiceV4;
var AlephOccrpRequestsServiceInstance = function () {
  function AlephOccrpRequestsServiceInstance() {
    this.service = null;
  }
  var _proto = AlephOccrpRequestsServiceInstance.prototype;
  _proto.getService = function getService($rootScope, $http, $q, $timeout) {
    if (!this.service) {
      this.service = new AlephOccrpRequestsServiceV4($rootScope, $http, $q, $timeout);
    }
    return this.service;
  };
  _proto.getNewService = function getNewService($rootScope, $http, $q, $timeout) {
    return new AlephOccrpRequestsServiceV4($rootScope, $http, $q, $timeout);
  };
  return AlephOccrpRequestsServiceInstance;
}();
module.exports = {
  AlephOccrpRequestsServiceInstance: new AlephOccrpRequestsServiceInstance()
};

},{"../../../services/http":861}],785:[function(require,module,exports){
"use strict";

var _require = require("../../../services/http"),
  ConfigRequestsServiceV4 = _require.ConfigRequestsServiceV4;
var ConfigRequestsServiceInstance = function () {
  function ConfigRequestsServiceInstance() {
    this.service = null;
  }
  var _proto = ConfigRequestsServiceInstance.prototype;
  _proto.getService = function getService($rootScope, $http, $q, $timeout) {
    if (!this.service) {
      this.service = new ConfigRequestsServiceV4($rootScope, $http, $q, $timeout);
    }
    return this.service;
  };
  _proto.getNewService = function getNewService($rootScope, $http, $q, $timeout) {
    return new ConfigRequestsServiceV4($rootScope, $http, $q, $timeout);
  };
  return ConfigRequestsServiceInstance;
}();
module.exports = {
  ConfigRequestsServiceInstance: new ConfigRequestsServiceInstance()
};

},{"../../../services/http":861}],786:[function(require,module,exports){
"use strict";

var _require = require("../../../services/http"),
  ExtraSourcesRequestsServiceV4 = _require.ExtraSourcesRequestsServiceV4;
var ExtraSourcesRequestsServiceInstance = function () {
  function ExtraSourcesRequestsServiceInstance() {
    this.service = null;
  }
  var _proto = ExtraSourcesRequestsServiceInstance.prototype;
  _proto.getService = function getService($rootScope, $http, $q, $timeout) {
    if (!this.service) {
      this.service = new ExtraSourcesRequestsServiceV4($rootScope, $http, $q, $timeout);
    }
    return this.service;
  };
  _proto.getNewService = function getNewService($rootScope, $http, $q, $timeout) {
    return new ExtraSourcesRequestsServiceV4($rootScope, $http, $q, $timeout);
  };
  return ExtraSourcesRequestsServiceInstance;
}();
module.exports = {
  ExtraSourcesRequestsServiceInstance: new ExtraSourcesRequestsServiceInstance()
};

},{"../../../services/http":861}],787:[function(require,module,exports){
"use strict";

var _require = require("../../../services/http"),
  GoogleNewsRssRequestsServiceV4 = _require.GoogleNewsRssRequestsServiceV4;
var GoogleNewsRequestsServiceInstance = function () {
  function GoogleNewsRequestsServiceInstance() {
    this.service = null;
  }
  var _proto = GoogleNewsRequestsServiceInstance.prototype;
  _proto.getService = function getService($rootScope, $http, $q, $timeout) {
    if (!this.service) {
      this.service = new GoogleNewsRssRequestsServiceV4($rootScope, $http, $q, $timeout);
    }
    return this.service;
  };
  _proto.getNewService = function getNewService($rootScope, $http, $q, $timeout) {
    return new GoogleNewsRssRequestsServiceV4($rootScope, $http, $q, $timeout);
  };
  return GoogleNewsRequestsServiceInstance;
}();
module.exports = {
  GoogleNewsRequestsServiceInstance: new GoogleNewsRequestsServiceInstance()
};

},{"../../../services/http":861}],788:[function(require,module,exports){
"use strict";

var _require = require("../../../services/http"),
  GoogleNlpRequestsServiceV4 = _require.GoogleNlpRequestsServiceV4;
var GoogleNlpRequestsServiceInstance = function () {
  function GoogleNlpRequestsServiceInstance() {
    this.service = null;
  }
  var _proto = GoogleNlpRequestsServiceInstance.prototype;
  _proto.getService = function getService($rootScope, $http, $q, $timeout) {
    if (!this.service) {
      this.service = new GoogleNlpRequestsServiceV4($rootScope, $http, $q, $timeout);
    }
    return this.service;
  };
  _proto.getNewService = function getNewService($rootScope, $http, $q, $timeout) {
    return new GoogleNlpRequestsServiceV4($rootScope, $http, $q, $timeout);
  };
  return GoogleNlpRequestsServiceInstance;
}();
module.exports = {
  GoogleNlpRequestsServiceInstance: new GoogleNlpRequestsServiceInstance()
};

},{"../../../services/http":861}],789:[function(require,module,exports){
"use strict";

var _require = require("../../../services/http"),
  GoogleSearchRequestsServiceV4 = _require.GoogleSearchRequestsServiceV4;
var GoogleSearchRequestsServiceInstance = function () {
  function GoogleSearchRequestsServiceInstance() {
    this.service = null;
  }
  var _proto = GoogleSearchRequestsServiceInstance.prototype;
  _proto.getService = function getService($rootScope, $http, $q, $timeout) {
    if (!this.service) {
      this.service = new GoogleSearchRequestsServiceV4($rootScope, $http, $q, $timeout);
    }
    return this.service;
  };
  _proto.getNewService = function getNewService($rootScope, $http, $q, $timeout) {
    return new GoogleSearchRequestsServiceV4($rootScope, $http, $q, $timeout);
  };
  return GoogleSearchRequestsServiceInstance;
}();
module.exports = {
  GoogleSearchRequestsServiceInstance: new GoogleSearchRequestsServiceInstance()
};

},{"../../../services/http":861}],790:[function(require,module,exports){
"use strict";

var _require = require("./aleph-occrp-requests-service"),
  AlephOccrpRequestsServiceInstance = _require.AlephOccrpRequestsServiceInstance;
var _require2 = require("./config-requests-service"),
  ConfigRequestsServiceInstance = _require2.ConfigRequestsServiceInstance;
var _require3 = require("./extra-sources-requests-service"),
  ExtraSourcesRequestsServiceInstance = _require3.ExtraSourcesRequestsServiceInstance;
var _require4 = require("./google-news-requests-service"),
  GoogleNewsRequestsServiceInstance = _require4.GoogleNewsRequestsServiceInstance;
var _require5 = require("./google-nlp-requests-service"),
  GoogleNlpRequestsServiceInstance = _require5.GoogleNlpRequestsServiceInstance;
var _require6 = require("./google-search-requests-service"),
  GoogleSearchRequestsServiceInstance = _require6.GoogleSearchRequestsServiceInstance;
var _require7 = require("./media-py-gpt-requests-service"),
  MediaPyGptRequestsServiceInstance = _require7.MediaPyGptRequestsServiceInstance;
var _require8 = require("./media-py-llm-requests-service"),
  MediaPyLLMRequestsServiceInstance = _require8.MediaPyLLMRequestsServiceInstance;
var _require9 = require("./media-py-requests-service"),
  MediaPyRequestsServiceInstance = _require9.MediaPyRequestsServiceInstance;
var _require10 = require("./open-corporates-requests-service"),
  OpenCorporatesRequestsServiceInstance = _require10.OpenCorporatesRequestsServiceInstance;
var _require11 = require("./open-sanctions-requests-service"),
  OpenSanctionsRequestsServiceInstance = _require11.OpenSanctionsRequestsServiceInstance;
var _require12 = require("./parse-document-requests-service"),
  ParseDocumentRequestsServiceInstance = _require12.ParseDocumentRequestsServiceInstance;
var _require13 = require("./scrape-requests-service"),
  ScrapeRequestsServiceInstance = _require13.ScrapeRequestsServiceInstance;
var _require14 = require("./stock-market-requests-service"),
  StockMarketsRequestsServiceInstance = _require14.StockMarketsRequestsServiceInstance;
module.exports = {
  AlephOccrpRequestsServiceInstance: AlephOccrpRequestsServiceInstance,
  ConfigRequestsServiceInstance: ConfigRequestsServiceInstance,
  ExtraSourcesRequestsServiceInstance: ExtraSourcesRequestsServiceInstance,
  GoogleNewsRequestsServiceInstance: GoogleNewsRequestsServiceInstance,
  GoogleNlpRequestsServiceInstance: GoogleNlpRequestsServiceInstance,
  GoogleSearchRequestsServiceInstance: GoogleSearchRequestsServiceInstance,
  MediaPyGptRequestsServiceInstance: MediaPyGptRequestsServiceInstance,
  MediaPyLLMRequestsServiceInstance: MediaPyLLMRequestsServiceInstance,
  MediaPyRequestsServiceInstance: MediaPyRequestsServiceInstance,
  OpenCorporatesRequestsServiceInstance: OpenCorporatesRequestsServiceInstance,
  OpenSanctionsRequestsServiceInstance: OpenSanctionsRequestsServiceInstance,
  ParseDocumentRequestsServiceInstance: ParseDocumentRequestsServiceInstance,
  ScrapeRequestsServiceInstance: ScrapeRequestsServiceInstance,
  StockMarketsRequestsServiceInstance: StockMarketsRequestsServiceInstance
};

},{"./aleph-occrp-requests-service":784,"./config-requests-service":785,"./extra-sources-requests-service":786,"./google-news-requests-service":787,"./google-nlp-requests-service":788,"./google-search-requests-service":789,"./media-py-gpt-requests-service":791,"./media-py-llm-requests-service":792,"./media-py-requests-service":793,"./open-corporates-requests-service":794,"./open-sanctions-requests-service":795,"./parse-document-requests-service":796,"./scrape-requests-service":797,"./stock-market-requests-service":798}],791:[function(require,module,exports){
"use strict";

var _require = require("../../../services/http"),
  MediaPyGptRequestsServiceV1 = _require.MediaPyGptRequestsServiceV1;
var MediaPyGptRequestsServiceInstance = function () {
  function MediaPyGptRequestsServiceInstance() {
    this.service = null;
  }
  var _proto = MediaPyGptRequestsServiceInstance.prototype;
  _proto.getService = function getService($rootScope, $http, $q, $timeout) {
    if (!this.service) {
      this.service = new MediaPyGptRequestsServiceV1($rootScope, $http, $q, $timeout);
    }
    return this.service;
  };
  _proto.getNewService = function getNewService($rootScope, $http, $q, $timeout) {
    return new MediaPyGptRequestsServiceV1($rootScope, $http, $q, $timeout);
  };
  return MediaPyGptRequestsServiceInstance;
}();
module.exports = {
  MediaPyGptRequestsServiceInstance: new MediaPyGptRequestsServiceInstance()
};

},{"../../../services/http":861}],792:[function(require,module,exports){
"use strict";

var _require = require("../../../services/http"),
  MediaPyLLMRequestsServiceV1 = _require.MediaPyLLMRequestsServiceV1;
var MediaPyLLMRequestsServiceInstance = function () {
  function MediaPyLLMRequestsServiceInstance() {
    this.service = null;
  }
  var _proto = MediaPyLLMRequestsServiceInstance.prototype;
  _proto.getService = function getService($rootScope, $http, $q, $timeout) {
    if (!this.service) {
      this.service = new MediaPyLLMRequestsServiceV1($rootScope, $http, $q, $timeout);
    }
    return this.service;
  };
  _proto.getNewService = function getNewService($rootScope, $http, $q, $timeout) {
    return new MediaPyLLMRequestsServiceV1($rootScope, $http, $q, $timeout);
  };
  return MediaPyLLMRequestsServiceInstance;
}();
module.exports = {
  MediaPyLLMRequestsServiceInstance: new MediaPyLLMRequestsServiceInstance()
};

},{"../../../services/http":861}],793:[function(require,module,exports){
"use strict";

var _require = require("../../../services/http"),
  MediaPyRequestsServiceV6 = _require.MediaPyRequestsServiceV6;
var MediaPyRequestsServiceInstance = function () {
  function MediaPyRequestsServiceInstance() {
    this.service = null;
  }
  var _proto = MediaPyRequestsServiceInstance.prototype;
  _proto.getService = function getService($rootScope, $http, $q, $timeout) {
    if (!this.service) {
      this.service = new MediaPyRequestsServiceV6($rootScope, $http, $q, $timeout);
    }
    return this.service;
  };
  _proto.getNewService = function getNewService($rootScope, $http, $q, $timeout) {
    return new MediaPyRequestsServiceV6($rootScope, $http, $q, $timeout);
  };
  return MediaPyRequestsServiceInstance;
}();
module.exports = {
  MediaPyRequestsServiceInstance: new MediaPyRequestsServiceInstance()
};

},{"../../../services/http":861}],794:[function(require,module,exports){
"use strict";

var _require = require("../../../services/http"),
  OpenCorporatesRequestsServiceV4 = _require.OpenCorporatesRequestsServiceV4;
var OpenCorporatesRequestsServiceInstance = function () {
  function OpenCorporatesRequestsServiceInstance() {
    this.service = null;
  }
  var _proto = OpenCorporatesRequestsServiceInstance.prototype;
  _proto.getService = function getService($rootScope, $http, $q, $timeout) {
    if (!this.service) {
      this.service = new OpenCorporatesRequestsServiceV4($rootScope, $http, $q, $timeout);
    }
    return this.service;
  };
  _proto.getNewService = function getNewService($rootScope, $http, $q, $timeout) {
    return new OpenCorporatesRequestsServiceV4($rootScope, $http, $q, $timeout);
  };
  return OpenCorporatesRequestsServiceInstance;
}();
module.exports = {
  OpenCorporatesRequestsServiceInstance: new OpenCorporatesRequestsServiceInstance()
};

},{"../../../services/http":861}],795:[function(require,module,exports){
"use strict";

var _require = require("../../../services/http"),
  OpenSanctionsRequestsServiceV4 = _require.OpenSanctionsRequestsServiceV4;
var OpenSanctionsRequestsServiceInstance = function () {
  function OpenSanctionsRequestsServiceInstance() {
    this.service = null;
  }
  var _proto = OpenSanctionsRequestsServiceInstance.prototype;
  _proto.getService = function getService($rootScope, $http, $q, $timeout) {
    if (!this.service) {
      this.service = new OpenSanctionsRequestsServiceV4($rootScope, $http, $q, $timeout);
    }
    return this.service;
  };
  _proto.getNewService = function getNewService($rootScope, $http, $q, $timeout) {
    return new OpenSanctionsRequestsServiceV4($rootScope, $http, $q, $timeout);
  };
  return OpenSanctionsRequestsServiceInstance;
}();
module.exports = {
  OpenSanctionsRequestsServiceInstance: new OpenSanctionsRequestsServiceInstance()
};

},{"../../../services/http":861}],796:[function(require,module,exports){
"use strict";

var _require = require("../../../services/http"),
  ParseDocumentRequestsServiceV4 = _require.ParseDocumentRequestsServiceV4;
var ParseDocumentRequestsServiceInstance = function () {
  function ParseDocumentRequestsServiceInstance() {
    this.service = null;
  }
  var _proto = ParseDocumentRequestsServiceInstance.prototype;
  _proto.getService = function getService($rootScope, $http, $q, $timeout) {
    if (!this.service) {
      this.service = new ParseDocumentRequestsServiceV4($rootScope, $http, $q, $timeout);
    }
    return this.service;
  };
  _proto.getNewService = function getNewService($rootScope, $http, $q, $timeout) {
    return new ParseDocumentRequestsServiceV4($rootScope, $http, $q, $timeout);
  };
  return ParseDocumentRequestsServiceInstance;
}();
module.exports = {
  ParseDocumentRequestsServiceInstance: new ParseDocumentRequestsServiceInstance()
};

},{"../../../services/http":861}],797:[function(require,module,exports){
"use strict";

var _require = require("../../../services/http"),
  ScrapeRequestsServiceV4 = _require.ScrapeRequestsServiceV4;
var ScrapeRequestsServiceInstance = function () {
  function ScrapeRequestsServiceInstance() {
    this.service = null;
  }
  var _proto = ScrapeRequestsServiceInstance.prototype;
  _proto.getService = function getService($rootScope, $http, $q, $timeout) {
    if (!this.service) {
      this.service = new ScrapeRequestsServiceV4($rootScope, $http, $q, $timeout);
    }
    return this.service;
  };
  _proto.getNewService = function getNewService($rootScope, $http, $q, $timeout) {
    return new ScrapeRequestsServiceV4($rootScope, $http, $q, $timeout);
  };
  return ScrapeRequestsServiceInstance;
}();
module.exports = {
  ScrapeRequestsServiceInstance: new ScrapeRequestsServiceInstance()
};

},{"../../../services/http":861}],798:[function(require,module,exports){
"use strict";

var _require = require("../../../services/http"),
  StockMarketRequestsServiceV4 = _require.StockMarketRequestsServiceV4;
var StockMarketsRequestsServiceInstance = function () {
  function StockMarketsRequestsServiceInstance() {
    this.service = null;
  }
  var _proto = StockMarketsRequestsServiceInstance.prototype;
  _proto.getService = function getService($rootScope, $http, $q, $timeout) {
    if (!this.service) {
      this.service = new StockMarketRequestsServiceV4($rootScope, $http, $q, $timeout);
    }
    return this.service;
  };
  _proto.getNewService = function getNewService($rootScope, $http, $q, $timeout) {
    return new StockMarketRequestsServiceV4($rootScope, $http, $q, $timeout);
  };
  return StockMarketsRequestsServiceInstance;
}();
module.exports = {
  StockMarketsRequestsServiceInstance: new StockMarketsRequestsServiceInstance()
};

},{"../../../services/http":861}],799:[function(require,module,exports){
"use strict";

var _require = require("./media-search-persons-requests-service"),
  MediaSearchPersonsRequestsServiceInstance = _require.MediaSearchPersonsRequestsServiceInstance;
var _require2 = require("./media-search-persons-service"),
  MediaSearchPersonsServiceInstance = _require2.MediaSearchPersonsServiceInstance;
module.exports = {
  MediaSearchPersonsRequestsServiceInstance: MediaSearchPersonsRequestsServiceInstance,
  MediaSearchPersonsServiceInstance: MediaSearchPersonsServiceInstance
};

},{"./media-search-persons-requests-service":800,"./media-search-persons-service":801}],800:[function(require,module,exports){
"use strict";

var _require = require("../../../services/persons"),
  MediaSearchPersonsRequestsServiceV1 = _require.MediaSearchPersonsRequestsServiceV1;
var MediaSearchPersonsRequestsServiceInstance = function () {
  function MediaSearchPersonsRequestsServiceInstance() {}
  var _proto = MediaSearchPersonsRequestsServiceInstance.prototype;
  _proto.getNewService = function getNewService() {
    return new MediaSearchPersonsRequestsServiceV1();
  };
  return MediaSearchPersonsRequestsServiceInstance;
}();
module.exports = {
  MediaSearchPersonsRequestsServiceInstance: new MediaSearchPersonsRequestsServiceInstance()
};

},{"../../../services/persons":872}],801:[function(require,module,exports){
"use strict";

var _require = require("../../../services/persons"),
  MediaSearchPersonsServiceV1 = _require.MediaSearchPersonsServiceV1;
var MediaSearchPersonsServiceInstance = function () {
  function MediaSearchPersonsServiceInstance() {}
  var _proto = MediaSearchPersonsServiceInstance.prototype;
  _proto.getNewService = function getNewService() {
    return new MediaSearchPersonsServiceV1();
  };
  return MediaSearchPersonsServiceInstance;
}();
module.exports = {
  MediaSearchPersonsServiceInstance: new MediaSearchPersonsServiceInstance()
};

},{"../../../services/persons":872}],802:[function(require,module,exports){
"use strict";

var _require = require("./media-search-engine-service"),
  MediaSearchEngineServiceInstance = _require.MediaSearchEngineServiceInstance;
var _require2 = require("./media-search-score-type-service"),
  MediaSearchScoreTypeServiceInstance = _require2.MediaSearchScoreTypeServiceInstance;
module.exports = {
  MediaSearchEngineServiceInstance: MediaSearchEngineServiceInstance,
  MediaSearchScoreTypeServiceInstance: MediaSearchScoreTypeServiceInstance
};

},{"./media-search-engine-service":803,"./media-search-score-type-service":804}],803:[function(require,module,exports){
"use strict";

var _require = require("../../../services/requests"),
  MediaSearchEngineServiceV5 = _require.MediaSearchEngineServiceV5;
var MediaSearchEngineServiceInstance = function () {
  function MediaSearchEngineServiceInstance() {
    this.service = null;
  }
  var _proto = MediaSearchEngineServiceInstance.prototype;
  _proto.getService = function getService() {
    if (!this.service) {
      this.service = new MediaSearchEngineServiceV5();
    }
    return this.service;
  };
  _proto.getNewService = function getNewService() {
    return new MediaSearchEngineServiceV5();
  };
  return MediaSearchEngineServiceInstance;
}();
module.exports = {
  MediaSearchEngineServiceInstance: new MediaSearchEngineServiceInstance()
};

},{"../../../services/requests":876}],804:[function(require,module,exports){
"use strict";

var _require = require("../../../services/requests"),
  MediaSearchScoreTypeServiceV4 = _require.MediaSearchScoreTypeServiceV4;
var MediaSearchScoreTypeServiceInstance = function () {
  function MediaSearchScoreTypeServiceInstance() {
    this.services = {};
  }
  var _proto = MediaSearchScoreTypeServiceInstance.prototype;
  _proto.getService = function getService(scoreType) {
    if (!this.services[scoreType]) {
      this.services[scoreType] = new MediaSearchScoreTypeServiceV4(scoreType);
    }
    return this.services[scoreType];
  };
  _proto.getNewService = function getNewService(scoreType) {
    return new MediaSearchScoreTypeServiceV4(scoreType);
  };
  return MediaSearchScoreTypeServiceInstance;
}();
module.exports = {
  MediaSearchScoreTypeServiceInstance: new MediaSearchScoreTypeServiceInstance()
};

},{"../../../services/requests":876}],805:[function(require,module,exports){
"use strict";

var _require = require("./riskscoring-service"),
  MediaSearchRiskScoringInstance = _require.MediaSearchRiskScoringInstance;
module.exports = {
  MediaSearchRiskScoringInstance: MediaSearchRiskScoringInstance
};

},{"./riskscoring-service":806}],806:[function(require,module,exports){
"use strict";

var _require = require("../../../services/scoring"),
  MediaSearchRiskScoreCountService = _require.MediaSearchRiskScoreCountService;
var MediaSearchRiskScoringInstance = function () {
  function MediaSearchRiskScoringInstance() {
    this.service = null;
  }
  var _proto = MediaSearchRiskScoringInstance.prototype;
  _proto.getService = function getService() {
    if (!this.service) {
      this.service = new MediaSearchRiskScoreCountService();
    }
    return this.service;
  };
  _proto.getNewService = function getNewService() {
    return new MediaSearchRiskScoreCountService();
  };
  return MediaSearchRiskScoringInstance;
}();
module.exports = {
  MediaSearchRiskScoringInstance: new MediaSearchRiskScoringInstance()
};

},{"../../../services/scoring":880}],807:[function(require,module,exports){
"use strict";

var _require = require("../../../services/utils/document-service-v1"),
  DocumentServiceV1 = _require.DocumentServiceV1;
var DocumentServiceInstance = function () {
  function DocumentServiceInstance() {
    this.service = null;
  }
  var _proto = DocumentServiceInstance.prototype;
  _proto.getService = function getService() {
    if (!this.service) {
      this.service = new DocumentServiceV1();
    }
    return this.service;
  };
  _proto.getNewService = function getNewService() {
    return new DocumentServiceV1();
  };
  return DocumentServiceInstance;
}();
module.exports = {
  DocumentServiceInstance: new DocumentServiceInstance()
};

},{"../../../services/utils/document-service-v1":882}],808:[function(require,module,exports){
"use strict";

var _require = require("../../../services/utils/highlight-service-v1"),
  HighlightServiceV1 = _require.HighlightServiceV1;
var HighlightServiceInstance = function () {
  function HighlightServiceInstance() {
    this.service = null;
  }
  var _proto = HighlightServiceInstance.prototype;
  _proto.getService = function getService() {
    if (!this.service) {
      this.service = new HighlightServiceV1();
    }
    return this.service;
  };
  _proto.getNewService = function getNewService() {
    return new HighlightServiceV1();
  };
  return HighlightServiceInstance;
}();
module.exports = {
  HighlightServiceInstance: new HighlightServiceInstance()
};

},{"../../../services/utils/highlight-service-v1":883}],809:[function(require,module,exports){
"use strict";

var _require = require("./document-service"),
  DocumentServiceInstance = _require.DocumentServiceInstance;
var _require2 = require("./highlight-service"),
  HighlightServiceInstance = _require2.HighlightServiceInstance;
var _require3 = require("./new-tab-window-service"),
  NewTabWindowServiceInstance = _require3.NewTabWindowServiceInstance;
module.exports = {
  DocumentServiceInstance: DocumentServiceInstance,
  HighlightServiceInstance: HighlightServiceInstance,
  NewTabWindowServiceInstance: NewTabWindowServiceInstance
};

},{"./document-service":807,"./highlight-service":808,"./new-tab-window-service":810}],810:[function(require,module,exports){
"use strict";

var _require = require("../../../services/utils/new-tab-window-service-v1"),
  NewTabWindowServiceV1 = _require.NewTabWindowServiceV1;
var NewTabWindowServiceInstance = function () {
  function NewTabWindowServiceInstance() {
    this.service = null;
  }
  var _proto = NewTabWindowServiceInstance.prototype;
  _proto.getService = function getService() {
    if (!this.service) {
      this.service = new NewTabWindowServiceV1();
    }
    return this.service;
  };
  _proto.getNewService = function getNewService() {
    return new NewTabWindowServiceV1();
  };
  return NewTabWindowServiceInstance;
}();
module.exports = {
  NewTabWindowServiceInstance: new NewTabWindowServiceInstance()
};

},{"../../../services/utils/new-tab-window-service-v1":885}],811:[function(require,module,exports){
"use strict";

var _require = require("./search-engine-keyword-config-v4"),
  SearchEngineKeywordConfigV4 = _require.SearchEngineKeywordConfigV4;
module.exports = {
  SearchEngineKeywordConfigV4: SearchEngineKeywordConfigV4
};

},{"./search-engine-keyword-config-v4":813}],812:[function(require,module,exports){
"use strict";

var KeywordConfigV4 = function () {
  function KeywordConfigV4(keyword, riskScore) {
    this.keyword = keyword;
    this.riskScore = riskScore;
  }
  var _proto = KeywordConfigV4.prototype;
  _proto.getKeyword = function getKeyword() {
    return this.keyword;
  };
  _proto.getRiskScore = function getRiskScore() {
    return this.riskScore;
  };
  return KeywordConfigV4;
}();
module.exports = {
  KeywordConfigV4: KeywordConfigV4
};

},{}],813:[function(require,module,exports){
"use strict";

function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
var _require = require("./keyword-config-v4"),
  KeywordConfigV4 = _require.KeywordConfigV4;
var SearchEngineKeywordConfigV4 = function (_KeywordConfigV) {
  function SearchEngineKeywordConfigV4(keyword, riskScore, isMandatory) {
    var _this;
    _this = _KeywordConfigV.call(this, keyword, riskScore) || this;
    _this.isMandatory = isMandatory;
    return _this;
  }
  _inheritsLoose(SearchEngineKeywordConfigV4, _KeywordConfigV);
  var _proto = SearchEngineKeywordConfigV4.prototype;
  _proto.checkIsMandatory = function checkIsMandatory() {
    return this.isMandatory;
  };
  return SearchEngineKeywordConfigV4;
}(KeywordConfigV4);
module.exports = {
  SearchEngineKeywordConfigV4: SearchEngineKeywordConfigV4
};

},{"./keyword-config-v4":812}],814:[function(require,module,exports){
"use strict";

function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
var _require = require("../../../common/models"),
  PersonV4 = _require.PersonV4;
var _require2 = require("../result-items"),
  ExtraSourceResultItemV1 = _require2.ExtraSourceResultItemV1,
  MatchResultItemV1 = _require2.MatchResultItemV1;
var _require3 = require("../../../common/utils/filters-v4"),
  onlyUnique = _require3.onlyUnique;
var _require4 = require("../../../common/utils/comparisons-v4"),
  compareByMediaPyRiskScore = _require4.compareByMediaPyRiskScore,
  compareByPositionIdx = _require4.compareByPositionIdx,
  compareByValue = _require4.compareByValue,
  compareByDate = _require4.compareByDate,
  compareByTitle = _require4.compareByTitle;
var _require5 = require("../../../constants/source-types"),
  GOOGLE_SEARCH_SOURCE_CODE = _require5.GOOGLE_SEARCH_SOURCE_CODE,
  GOOGLE_NEWS_SOURCE_CODE = _require5.GOOGLE_NEWS_SOURCE_CODE,
  EXTRA_SOURCE_SOURCE_CODE = _require5.EXTRA_SOURCE_SOURCE_CODE,
  STOCK_MARKETS_SOURCE_CODE = _require5.STOCK_MARKETS_SOURCE_CODE,
  ALEPH_OCCRP_SOURCE_CODE = _require5.ALEPH_OCCRP_SOURCE_CODE,
  OPEN_CORPORATES_SOURCE_CODE = _require5.OPEN_CORPORATES_SOURCE_CODE,
  OPEN_SANCTIONS_SOURCE_CODE = _require5.OPEN_SANCTIONS_SOURCE_CODE;
var BasePersonV1 = function (_PersonV) {
  function BasePersonV1(id, fullName, firstName, lastName, isAlias, isLinked, parentId, isCompany, itemId) {
    var _this$results, _this$performanceMetr;
    var _this;
    _this = _PersonV.call(this, id, fullName, firstName, lastName, isAlias, isLinked, parentId) || this;
    _this.isCompany = isCompany;
    _this.itemId = itemId;
    _this.countriesKeywords = "";
    _this.results = (_this$results = {}, _this$results[GOOGLE_SEARCH_SOURCE_CODE] = {
      all: [],
      filtered: []
    }, _this$results[GOOGLE_NEWS_SOURCE_CODE] = {
      all: [],
      filtered: []
    }, _this$results[EXTRA_SOURCE_SOURCE_CODE] = {
      all: [],
      filtered: []
    }, _this$results[STOCK_MARKETS_SOURCE_CODE] = {
      all: [],
      filtered: []
    }, _this$results[ALEPH_OCCRP_SOURCE_CODE] = {
      all: [],
      filtered: []
    }, _this$results[OPEN_SANCTIONS_SOURCE_CODE] = {
      all: [],
      filtered: []
    }, _this$results[OPEN_CORPORATES_SOURCE_CODE] = {
      all: [],
      filtered: []
    }, _this$results);
    _this.prependedSortedResults = [];
    _this.relevantResults = [];
    _this.matchPersonResults = [];
    _this.totalResults = [];
    _this.extendedSummary = [];
    _this.extendedInfo = {
      openSanctionsInfo: {
        entity: {
          name: [fullName],
          type: isCompany ? "ORG" : "PER"
        }
      }
    };
    _this.performanceMetrics = (_this$performanceMetr = {}, _this$performanceMetr[GOOGLE_SEARCH_SOURCE_CODE] = {
      getResults: [],
      processResults: []
    }, _this$performanceMetr[GOOGLE_NEWS_SOURCE_CODE] = {
      getResults: [],
      processResults: []
    }, _this$performanceMetr[EXTRA_SOURCE_SOURCE_CODE] = {
      getResults: [],
      processResults: []
    }, _this$performanceMetr[STOCK_MARKETS_SOURCE_CODE] = {
      getResults: [],
      processResults: []
    }, _this$performanceMetr[ALEPH_OCCRP_SOURCE_CODE] = {
      getResults: [],
      processResults: []
    }, _this$performanceMetr[OPEN_SANCTIONS_SOURCE_CODE] = {
      getResults: [],
      processResults: []
    }, _this$performanceMetr[OPEN_CORPORATES_SOURCE_CODE] = {
      getResults: [],
      processResults: []
    }, _this$performanceMetr.mediaPy = {
      summarize: {}
    }, _this$performanceMetr.mediaPyGpt = {
      generalRiskAssessment: {},
      mostImportantEntities: {},
      overallSummary: {},
      negativeContextAnalysis: {},
      chainGeneralRiskAssessment: {},
      mostImportantKeywords: {},
      personMatching: {},
      processResults: {},
      total: {}
    }, _this$performanceMetr.mediaPyLLM = {
      personProfiling: {},
      allegationsProfiling: {},
      total: {}
    }, _this$performanceMetr);
    _this.requestsStatistic = {
      mainPerson: {
        id: id,
        fullName: fullName,
        googleSearchRequests: {}
      },
      linkedPersons: [],
      aliasPersons: [],
      total: {}
    };
    _this.isGoogleSearchApiDayLimitExceed = false;
    _this.__version__ = "1.0";
    return _this;
  }
  _inheritsLoose(BasePersonV1, _PersonV);
  var _proto = BasePersonV1.prototype;
  _proto.getRequestsStatistic = function getRequestsStatistic() {
    return this.requestsStatistic;
  };
  _proto.addMainPersonGoogleSearchRequest = function addMainPersonGoogleSearchRequest(url, statusCode, sortBy) {
    if (this && this.requestsStatistic && this.requestsStatistic.mainPerson && this.requestsStatistic.mainPerson.googleSearchRequests) {
      if (!this.requestsStatistic.mainPerson.googleSearchRequests[statusCode]) {
        this.requestsStatistic.mainPerson.googleSearchRequests[statusCode] = [];
      }
      var statusCodeRequests = this.requestsStatistic.mainPerson.googleSearchRequests[statusCode];
      var requestStat = statusCodeRequests.find(function (req) {
        return req.url === url;
      });
      if (requestStat) {
        if (!requestStat[sortBy]) {
          requestStat[sortBy] = 0;
        }
        requestStat[sortBy] += 1;
      } else {
        var _requestStat;
        requestStat = (_requestStat = {
          url: url
        }, _requestStat[sortBy] = 1, _requestStat);
        statusCodeRequests.push(requestStat);
      }
    }
    if (this && this.requestsStatistic && this.requestsStatistic.total) {
      if (!this.requestsStatistic.total[statusCode]) {
        this.requestsStatistic.total[statusCode] = 0;
      }
      this.requestsStatistic.total[statusCode] += 1;
    }
  };
  _proto.addLinkedPersonGoogleSearchRequest = function addLinkedPersonGoogleSearchRequest(linkedPerson, url, statusCode, sortBy) {
    if (this && this.requestsStatistic && this.requestsStatistic.linkedPersons) {
      var linkedPersonStat = this.requestsStatistic.linkedPersons.find(function (lp) {
        return lp.id === linkedPerson.getId();
      });
      if (!linkedPersonStat) {
        linkedPersonStat = {
          id: linkedPerson.getId(),
          fullName: linkedPerson.getFullName(),
          googleSearchRequests: {}
        };
        this.requestsStatistic.linkedPersons.push(linkedPersonStat);
      }
      if (!linkedPersonStat.googleSearchRequests[statusCode]) {
        linkedPersonStat.googleSearchRequests[statusCode] = [];
      }
      var statusCodeRequests = linkedPersonStat.googleSearchRequests[statusCode];
      var requestStat = statusCodeRequests.find(function (req) {
        return req.url === url;
      });
      if (requestStat) {
        if (!requestStat[sortBy]) {
          requestStat[sortBy] = 0;
        }
        requestStat[sortBy] += 1;
      } else {
        var _requestStat2;
        requestStat = (_requestStat2 = {
          url: url
        }, _requestStat2[sortBy] = 1, _requestStat2);
        statusCodeRequests.push(requestStat);
      }
    }
    if (this && this.requestsStatistic && this.requestsStatistic.total) {
      if (!this.requestsStatistic.total[statusCode]) {
        this.requestsStatistic.total[statusCode] = 0;
      }
      this.requestsStatistic.total[statusCode] += 1;
    }
  };
  _proto.addAliasPersonGoogleSearchRequest = function addAliasPersonGoogleSearchRequest(aliasPerson, url, statusCode, sortBy) {
    if (this && this.requestsStatistic && this.requestsStatistic.aliasPersons) {
      var aliasPersonStat = this.requestsStatistic.aliasPersons.find(function (lp) {
        return lp.id === aliasPerson.getId();
      });
      if (!aliasPersonStat) {
        aliasPersonStat = {
          id: aliasPerson.getId(),
          fullName: aliasPerson.getFullName(),
          googleSearchRequests: {}
        };
        this.requestsStatistic.aliasPersons.push(aliasPersonStat);
      }
      if (!aliasPersonStat.googleSearchRequests[statusCode]) {
        aliasPersonStat.googleSearchRequests[statusCode] = [];
      }
      var statusCodeRequests = aliasPersonStat.googleSearchRequests[statusCode];
      var requestStat = statusCodeRequests.find(function (req) {
        return req.url === url;
      });
      if (requestStat) {
        if (!requestStat[sortBy]) {
          requestStat[sortBy] = 0;
        }
        requestStat[sortBy] += 1;
      } else {
        var _requestStat3;
        requestStat = (_requestStat3 = {
          url: url
        }, _requestStat3[sortBy] = 1, _requestStat3);
        statusCodeRequests.push(requestStat);
      }
    }
    if (this && this.requestsStatistic && this.requestsStatistic.total) {
      if (!this.requestsStatistic.total[statusCode]) {
        this.requestsStatistic.total[statusCode] = 0;
      }
      this.requestsStatistic.total[statusCode] += 1;
    }
  };
  _proto.getTotalGoogleSearchRequestsCount = function getTotalGoogleSearchRequestsCount() {
    return this.requestsStatistic.total["200"];
  };
  _proto.addPerformanceMetric = function addPerformanceMetric(sourceType, metricType, elapsedTime) {
    if (this.performanceMetrics && this.performanceMetrics[sourceType] && this.performanceMetrics[sourceType][metricType]) {
      this.performanceMetrics[sourceType][metricType].push(elapsedTime);
    }
  };
  _proto.setPerformanceMetric = function setPerformanceMetric(sourceType, metricType, httpRespStatusCode, elapsedTime, usageInfo) {
    if (this.performanceMetrics && this.performanceMetrics[sourceType] && this.performanceMetrics[sourceType][metricType] && !this.performanceMetrics[sourceType][metricType][httpRespStatusCode]) {
      this.performanceMetrics[sourceType][metricType][httpRespStatusCode] = {
        usageInfo: usageInfo,
        time: elapsedTime
      };
    }
  };
  _proto.getPerformanceMetrics = function getPerformanceMetrics() {
    return this.performanceMetrics;
  };
  _proto.setKeywords = function setKeywords(keywords) {
    this.keywords = keywords;
  };
  _proto.setCountriesKeywords = function setCountriesKeywords(countriesKeywords) {
    this.countriesKeywords = countriesKeywords;
  };
  _proto.getCountriesKeywords = function getCountriesKeywords() {
    return this.countriesKeywords;
  };
  _proto.getItemId = function getItemId() {
    return this.itemId;
  };
  _proto.checkIsCompany = function checkIsCompany() {
    return this.isCompany === true;
  };
  _proto.setGoogleSearchApiDayLimitExceed = function setGoogleSearchApiDayLimitExceed(flag) {
    this.isGoogleSearchApiDayLimitExceed = flag;
  };
  _proto.checkGoogleSearchApiDayLimitExceed = function checkGoogleSearchApiDayLimitExceed() {
    return this.isGoogleSearchApiDayLimitExceed;
  };
  _proto.setExtendedInfo = function setExtendedInfo(openSanctionsInfo) {
    if (openSanctionsInfo && openSanctionsInfo.entity && openSanctionsInfo.entity.name) {
      this.extendedInfo.openSanctionsInfo = openSanctionsInfo;
    }
  };
  _proto.getExtendedInfo = function getExtendedInfo() {
    return this.extendedInfo.openSanctionsInfo;
  };
  _proto.splitSearchResultsAndSort = function splitSearchResultsAndSort(searchResults) {
    var scores = {};
    searchResults.forEach(function (doc) {
      if (scores[doc.getMediaPyRiskScore()] === undefined) scores[doc.getMediaPyRiskScore()] = [];
      scores[doc.getMediaPyRiskScore()].push(doc);
    });
    var sortedScores = Object.keys(scores).map(function (key) {
      return parseFloat(key);
    });
    sortedScores.sort(compareByValue);
    var splittedByScore = sortedScores.map(function (key) {
      return scores[key.toString()];
    });
    var _loop = function _loop() {
      var scoresArr = splittedByScore[i];
      var resultsHasDates = scoresArr.filter(function (doc) {
        return doc.getDate();
      }).length === scoresArr.length;
      if (resultsHasDates) {
        scoresArr.sort(compareByDate);
        var dates = {};
        scoresArr.forEach(function (_doc) {
          var date = new Date(_doc.getDate()).toISOString().split("T")[0];
          if (dates[date] === undefined) {
            dates[date] = [];
          }
          dates[date].push(_doc);
        });
        var splittedByDates = Object.keys(dates).map(function (key) {
          return dates[key];
        });
        splittedByDates.forEach(function (datesArr) {
          datesArr.sort(compareByTitle);
        });
        scoresArr = [].concat.apply([], splittedByDates);
      } else {
        scoresArr.sort(compareByTitle);
      }
      splittedByScore[i] = scoresArr;
    };
    for (var i = 0; i < splittedByScore.length; i++) {
      _loop();
    }
    return [].concat.apply([], splittedByScore);
  };
  _proto.getAllTypeResults = function getAllTypeResults(type) {
    return this.results[type].all;
  };
  _proto.getTotalResults = function getTotalResults() {
    return this.totalResults;
  };
  _proto.getTotalResultsCount = function getTotalResultsCount() {
    return this.totalResults.length;
  };
  _proto.getTotalResultsToPublish = function getTotalResultsToPublish() {
    return this.totalResults.filter(function (searchResult) {
      return searchResult.checkShouldBePublished();
    });
  };
  _proto.checkTotalResultsContainOnlyShab = function checkTotalResultsContainOnlyShab() {
    var shabResults = this.totalResults.filter(function (searchResult) {
      return searchResult instanceof ExtraSourceResultItemV1 && searchResult.checkIsShabResult();
    });
    return this.totalResults.length === shabResults.length;
  };
  _proto.setTotalResultsBaseOnGptRiskScore = function setTotalResultsBaseOnGptRiskScore() {
    this.totalResults.filter(function (searchResult) {
      return searchResult.checkShouldBePublished();
    }).forEach(function (searchResult) {
      if (!(searchResult instanceof MatchResultItemV1) && searchResult.getGptRiskScore() > 0) {
        if (searchResult.getGptRiskScore() < 2) {
          searchResult.setShouldBePublished(false);
        } else {
          searchResult.remapGptRiskScoreToMediaPyRiskScore();
        }
      }
    });
  };
  _proto.setShabResultsRiskScore = function setShabResultsRiskScore(riskScore) {
    this.totalResults.filter(function (searchResult) {
      return searchResult instanceof ExtraSourceResultItemV1 && searchResult.checkIsShabResult();
    }).forEach(function (searchResult) {
      searchResult.setRiskScore(riskScore);
      searchResult.setMediaPyRiskScore(riskScore);
      searchResult.setMediaPyRiskScoreColor(riskScore, false);
    });
  };
  _proto.addTypeResult = function addTypeResult(newResult, type) {
    if (type === GOOGLE_SEARCH_SOURCE_CODE) {
      this.addSearchEngineResult(newResult);
    } else if (type === GOOGLE_NEWS_SOURCE_CODE) {
      this.addGoogleNewsRssResult(newResult);
    } else {
      var existedResult = this.results[type].all.find(function (searchResult) {
        return searchResult.getLinkUrl().toLowerCase() === newResult.getLinkUrl().toLowerCase() && searchResult.getTitle().toLowerCase() === newResult.getTitle().toLowerCase();
      });
      if (!existedResult) {
        this.results[type].all.push(newResult);
      }
    }
  };
  _proto.addSearchEngineResult = function addSearchEngineResult(newResult) {
    var _this2 = this;
    var alreadyExistedGoogleNewsResult = this.results[GOOGLE_NEWS_SOURCE_CODE].all.find(function (searchResult) {
      return searchResult.getLinkUrl().toLowerCase() === newResult.getLinkUrl().toLowerCase() && searchResult.getTitle().toLowerCase() === newResult.getTitle().toLowerCase();
    });
    if (alreadyExistedGoogleNewsResult) {
      return;
    }
    var alreadyExistedResult = this.results[GOOGLE_SEARCH_SOURCE_CODE].all.find(function (searchResult) {
      return searchResult.getLinkUrl().toLowerCase() === newResult.getLinkUrl().toLowerCase() && searchResult.getTitle().toLowerCase() === newResult.getTitle().toLowerCase();
    });
    if (!alreadyExistedResult) {
      this.results[GOOGLE_SEARCH_SOURCE_CODE].all.push(newResult);
    } else {
      var existedResults = this.results[GOOGLE_SEARCH_SOURCE_CODE].all.filter(function (searchResult) {
        return searchResult.getLinkUrl().toLowerCase() === newResult.getLinkUrl().toLowerCase() && searchResult.getTitle().toLowerCase() === newResult.getTitle().toLowerCase();
      });
      if (existedResults.find(function (searchResult) {
        return searchResult.getSearchConfigId() !== newResult.getSearchConfigId() && searchResult.getRequestRiskScore() >= newResult.getRequestRiskScore() || searchResult.getSearchConfigId() === newResult.getSearchConfigId() && searchResult.getSortBy() === newResult.getSortBy();
      })) {} else {
        existedResults.forEach(function (searchResult) {
          if (searchResult.getSearchConfigId() !== newResult.getSearchConfigId() && searchResult.getRequestRiskScore() <= newResult.getRequestRiskScore()) {
            var idx = _this2.results[GOOGLE_SEARCH_SOURCE_CODE].all.findIndex(function (res) {
              return res.getId() === searchResult.getId();
            });
            if (idx !== -1) {
              _this2.results[GOOGLE_SEARCH_SOURCE_CODE].all.splice(idx, 1);
            }
          }
        });
        this.results[GOOGLE_SEARCH_SOURCE_CODE].all.push(newResult);
      }
    }
  };
  _proto.addGoogleNewsRssResult = function addGoogleNewsRssResult(newResult) {
    var alreadyExistedSearchEngineResult = this.results[GOOGLE_SEARCH_SOURCE_CODE].all.find(function (searchResult) {
      return searchResult.getLinkUrl().toLowerCase() === newResult.getLinkUrl().toLowerCase() && searchResult.getTitle().toLowerCase() === newResult.getTitle().toLowerCase();
    });
    if (alreadyExistedSearchEngineResult) {
      return;
    }
    var existedResult = this.results[GOOGLE_NEWS_SOURCE_CODE].all.find(function (searchResult) {
      return searchResult.getLinkUrl().toLowerCase() === newResult.getLinkUrl().toLowerCase() && searchResult.getTitle().toLowerCase() === newResult.getTitle().toLowerCase();
    });
    if (!existedResult) {
      this.results[GOOGLE_NEWS_SOURCE_CODE].all.push(newResult);
    }
  };
  _proto.addRelevantResult = function addRelevantResult(newResult) {
    var existedResult = this.relevantResults.find(function (searchResult) {
      return searchResult.getLinkUrl() === newResult.getLinkUrl() && searchResult.getTitle() === newResult.getTitle();
    });
    if (!existedResult) {
      this.relevantResults.push(newResult);
    }
  };
  _proto.removeRelevantResult = function removeRelevantResult(id) {
    var idx = this.relevantResults.findIndex(function (res) {
      return res.getId() === id;
    });
    if (idx !== -1) {
      this.relevantResults.splice(idx, 1);
    }
  };
  _proto.addMatchPersonResult = function addMatchPersonResult(newResult) {
    var existedResult = this.matchPersonResults.find(function (searchResult) {
      return searchResult.getLinkUrl() === newResult.getLinkUrl() && searchResult.getTitle() === newResult.getTitle() && searchResult.getDescription() === newResult.getDescription();
    });
    if (!existedResult) {
      this.matchPersonResults.push(newResult);
    }
  };
  _proto.prependSortedResults = function prependSortedResults() {
    var resultsInfoArray = [];
    var allSearchEngineResults = [].concat(this.results[GOOGLE_SEARCH_SOURCE_CODE].all);
    allSearchEngineResults.forEach(function (searchResult) {
      if (!resultsInfoArray.find(function (resultInfo) {
        return resultInfo.searchConfigId === searchResult.getSearchConfigId();
      })) {
        resultsInfoArray.push({
          searchConfigId: searchResult.getSearchConfigId(),
          resultsInBoth: [],
          sortedByRelevancy: [],
          sortedByDate: []
        });
      }
    });
    resultsInfoArray.forEach(function (resultInfo) {
      var sortedByRelevancy = allSearchEngineResults.filter(function (res) {
        return res.getSearchConfigId() === resultInfo.searchConfigId && res.getSortBy() === "relevancy";
      });
      var sortedByDate = allSearchEngineResults.filter(function (res) {
        return res.getSearchConfigId() === resultInfo.searchConfigId && res.getSortBy() === "date";
      });
      var resultsInBothArrays = [];
      sortedByRelevancy.forEach(function (relevantResult) {
        (sortedByDate || []).forEach(function (dateResult) {
          if (relevantResult.getTitle() === dateResult.getTitle() && relevantResult.getLinkUrl() === dateResult.getLinkUrl()) {
            resultsInBothArrays.push(relevantResult);
          }
        });
      });
      resultsInBothArrays.forEach(function (bothResult) {
        var result = sortedByDate.find(function (dateResult) {
          return bothResult.getTitle() === dateResult.getTitle() && bothResult.getLinkUrl() === dateResult.getLinkUrl();
        });
        if (result) {
          bothResult.setDescription(result.getDescription());
          bothResult.setDescriptionHtml(result.getDescriptionHtml());
          bothResult.setDate(result.getDate());
        }
      });
      resultInfo.resultsInBoth = resultsInBothArrays.sort(compareByPositionIdx);
      resultInfo.sortedByRelevancy = sortedByRelevancy.filter(function (relevantResult) {
        return resultsInBothArrays.filter(function (bothResult) {
          return relevantResult.getTitle() === bothResult.getTitle() && relevantResult.getLinkUrl() === bothResult.getLinkUrl();
        }).length === 0;
      }).sort(compareByPositionIdx);
      resultInfo.sortedByDate = sortedByDate.filter(function (dateResult) {
        return resultsInBothArrays.filter(function (bothResult) {
          return dateResult.getTitle() === bothResult.getTitle() && dateResult.getLinkUrl() === bothResult.getLinkUrl();
        }).length === 0;
      }).sort(compareByPositionIdx);
    });
    var prependedSortedResults = [];
    var tempBothArray = [];
    resultsInfoArray.forEach(function (resultInfo) {
      tempBothArray = tempBothArray.concat(resultInfo.resultsInBoth);
    });
    prependedSortedResults = prependedSortedResults.concat(tempBothArray.sort(compareByPositionIdx));
    var tempRelArray = [];
    resultsInfoArray.forEach(function (resultInfo) {
      tempRelArray = tempRelArray.concat(resultInfo.sortedByRelevancy);
    });
    prependedSortedResults = prependedSortedResults.concat(tempRelArray.sort(compareByPositionIdx));
    var tempDateArray = [];
    resultsInfoArray.forEach(function (resultInfo) {
      tempDateArray = tempDateArray.concat(resultInfo.sortedByDate);
    });
    prependedSortedResults = prependedSortedResults.concat(tempDateArray.sort(compareByPositionIdx));
    this.prependedSortedResults = prependedSortedResults;
  };
  _proto.setResults = function setResults(type, topCnt) {
    var neededResults = [];
    if (type === GOOGLE_SEARCH_SOURCE_CODE) {
      neededResults = [].concat(this.prependedSortedResults);
      var alreadyFilteredResults = [].concat(this.results[GOOGLE_SEARCH_SOURCE_CODE].filtered);
      var alreadyFilteredResultsCount = alreadyFilteredResults.length;
      if (alreadyFilteredResultsCount) {
        neededResults = neededResults.filter(function (searchResult) {
          return !alreadyFilteredResults.find(function (filteredResult) {
            return filteredResult.getId() === searchResult.getId();
          });
        });
      }
      var neededResultsCnt = topCnt - alreadyFilteredResultsCount;
      if (neededResultsCnt > 0) {
        neededResults = neededResults.slice(0, neededResultsCnt);
      }
    } else if (type === GOOGLE_NEWS_SOURCE_CODE) {
      var allGoogleNewsResults = [].concat(this.results[GOOGLE_NEWS_SOURCE_CODE].all);
      var differentLanguages = allGoogleNewsResults.map(function (result) {
        return result.getLanguage();
      }).filter(onlyUnique);
      differentLanguages.forEach(function (lang) {
        var currLanguageResults = allGoogleNewsResults.filter(function (result) {
          return result.getLanguage() === lang;
        });
        neededResults = neededResults.concat(currLanguageResults.slice(0, topCnt));
      });
      var _alreadyFilteredResults = [].concat(this.results[GOOGLE_NEWS_SOURCE_CODE].filtered);
      var _alreadyFilteredResultsCount = _alreadyFilteredResults.length;
      if (_alreadyFilteredResultsCount) {
        neededResults = neededResults.filter(function (searchResult) {
          return !_alreadyFilteredResults.find(function (filteredResult) {
            return filteredResult.getId() === searchResult.getId();
          });
        });
      }
    } else {
      neededResults = [].concat(this.results[type].all);
      var _alreadyFilteredResults2 = [].concat(this.results[type].filtered);
      var _alreadyFilteredResultsCount2 = _alreadyFilteredResults2.length;
      if (_alreadyFilteredResultsCount2) {
        neededResults = neededResults.filter(function (searchResult) {
          return !_alreadyFilteredResults2.find(function (filteredResult) {
            return filteredResult.getId() === searchResult.getId();
          });
        });
      }
      var _neededResultsCnt = topCnt - _alreadyFilteredResultsCount2;
      if (_neededResultsCnt > 0) {
        neededResults = neededResults.slice(0, _neededResultsCnt);
      }
    }
    this.results[type].filtered = [].concat(this.results[type].filtered).concat(neededResults);
  };
  _proto.countTotalRiskScore = function countTotalRiskScore() {
    var _this3 = this;
    var resultsForScore = [];
    Object.keys(this.results).forEach(function (type) {
      resultsForScore = resultsForScore.concat(_this3.results[type].filtered);
    });
    var maxScore = resultsForScore.length ? Math.max.apply(Math, resultsForScore.map(function (res) {
      return res.getMediaPyRiskScore();
    })) : 0;
    var resultsWithMaxScoreCount = resultsForScore.filter(function (res) {
      return res.getMediaPyRiskScore() === maxScore;
    }).length;
    this.totalRiskScore = maxScore + (resultsWithMaxScoreCount >= 6 ? 0.02 : resultsWithMaxScoreCount >= 3 ? 0.01 : 0);
    this.totalRiskScore = this.totalRiskScore > 1 ? 1 : this.totalRiskScore;
  };
  _proto.getRequestsGroupResultsCount = function getRequestsGroupResultsCount(groupObjectId) {
    var _this4 = this;
    var groupResults = [];
    Object.keys(this.results).forEach(function (type) {
      groupResults = groupResults.concat(_this4.results[type].filtered);
    });
    return groupResults.filter(function (searchResult) {
      return searchResult.getGroupObjectId() === groupObjectId;
    }).length;
  };
  _proto.getRequestGroupResults = function getRequestGroupResults(requestObjectId, groupObjectId) {
    return this.totalResults.filter(function (searchResult) {
      return (requestObjectId ? searchResult.getRequestObjectId() === requestObjectId : true) && (groupObjectId ? searchResult.getGroupObjectId() === groupObjectId : true);
    });
  };
  _proto.getResultsForLoad = function getResultsForLoad(type, requestObjectId, groupObjectId, topResultsCount, highRiskScore, minHighRiskScoreResultsCount, maxHighRiskScoreResultsCount) {
    var _this5 = this;
    var topResults = [];
    if (type === GOOGLE_SEARCH_SOURCE_CODE) {
      topResults = this.getSearchEngineResultsForLoad(requestObjectId, groupObjectId, topResultsCount, highRiskScore, minHighRiskScoreResultsCount, maxHighRiskScoreResultsCount);
    } else if (type === GOOGLE_NEWS_SOURCE_CODE) {
      topResults = this.getGoogleNewsResultsForLoad(requestObjectId, groupObjectId, topResultsCount, highRiskScore);
    } else if (type === EXTRA_SOURCE_SOURCE_CODE) {
      topResults = this.getExtraSourcesResultsForLoad(requestObjectId, groupObjectId);
    } else {
      var groupFilteredResults = this.results[type].all.filter(function (searchResult) {
        return groupObjectId ? searchResult.getGroupObjectId() === groupObjectId : true;
      });
      var alreadyLoadedGroupResults = groupFilteredResults.filter(function (searchResult) {
        return searchResult.checkIsContentHtmlLoaded() && searchResult.checkIsMediaPyRiskScored() && searchResult.getMediaPyRiskScore() >= highRiskScore;
      });
      if (alreadyLoadedGroupResults.length < topResultsCount) {
        var neededCount = topResultsCount - alreadyLoadedGroupResults.length;
        groupFilteredResults.forEach(function (searchResult) {
          if ((!searchResult.checkIsContentHtmlLoaded() && searchResult.getTryLoadCounter() < 1 || searchResult.getContentHtml() && !searchResult.checkIsMediaPyRiskScored()) && (groupObjectId ? searchResult.getGroupObjectId() === groupObjectId : true) && (requestObjectId ? searchResult.getRequestObjectId() === requestObjectId : true) && neededCount > 0) {
            _this5.results[type].filtered.push(searchResult);
            topResults.push(searchResult);
            neededCount--;
          }
        });
      }
    }
    return topResults;
  };
  _proto.getSearchEngineResultsForLoad = function getSearchEngineResultsForLoad(requestObjectId, groupObjectId, showResultsCount, highRiskScore, minHighRiskScoreResultsCount, maxHighRiskScoreResultsCount) {
    var _this6 = this;
    var topResults = [];
    var totalFilteredSearchResults = this.filterResultsByName(this.results[GOOGLE_SEARCH_SOURCE_CODE].filtered, true);
    var groupFilteredSearchResults = totalFilteredSearchResults.filter(function (searchResult) {
      return groupObjectId ? searchResult.getGroupObjectId() === groupObjectId : true;
    });
    var searchResultsCount = groupFilteredSearchResults.length;
    if (searchResultsCount < showResultsCount) {
      var neededCount = showResultsCount - searchResultsCount;
      this.prependedSortedResults.forEach(function (sortedResult) {
        if (!sortedResult.checkIsContentHtmlLoaded() && sortedResult.getTryLoadCounter() < 1 && (groupObjectId ? sortedResult.getGroupObjectId() === groupObjectId : true) && (requestObjectId ? sortedResult.getRequestObjectId() === requestObjectId : true) && neededCount > 0) {
          _this6.results[GOOGLE_SEARCH_SOURCE_CODE].filtered.push(sortedResult);
          topResults.push(sortedResult);
          neededCount--;
        }
      });
    }
    if (topResults.length === 0) {
      var topHighRiskScoreResultsCount = this.results[GOOGLE_SEARCH_SOURCE_CODE].filtered.filter(function (searchResult) {
        return searchResult.getMediaPyRiskScore() >= highRiskScore && (groupObjectId ? searchResult.getGroupObjectId() === groupObjectId : true);
      }).length;
      var alreadyLoadedResultsCount = this.prependedSortedResults.filter(function (prependedResult) {
        return prependedResult.checkIsContentHtmlLoaded() && (groupObjectId ? prependedResult.getGroupObjectId() === groupObjectId : true);
      }).length;
      if (topHighRiskScoreResultsCount < minHighRiskScoreResultsCount && alreadyLoadedResultsCount < maxHighRiskScoreResultsCount) {
        var _neededCount = minHighRiskScoreResultsCount - topHighRiskScoreResultsCount;
        this.prependedSortedResults.forEach(function (sortedResult) {
          if (!sortedResult.checkIsContentHtmlLoaded() && sortedResult.getTryLoadCounter() < 1 && (groupObjectId ? sortedResult.getGroupObjectId() === groupObjectId : true) && (requestObjectId ? sortedResult.getRequestObjectId() === requestObjectId : true) && _neededCount > 0) {
            _this6.results[GOOGLE_SEARCH_SOURCE_CODE].filtered.push(sortedResult);
            topResults.push(sortedResult);
            _neededCount--;
          }
        });
      }
    }
    return topResults;
  };
  _proto.getGoogleNewsResultsForLoad = function getGoogleNewsResultsForLoad(requestObjectId, groupObjectId, topResultsCount, highRiskScore) {
    var _this7 = this;
    var topResults = [];
    var resultsCountPerEachLang = 0;
    var differentLanguages = this.results[GOOGLE_NEWS_SOURCE_CODE].all.filter(function (searchResult) {
      return groupObjectId ? searchResult.getGroupObjectId() === groupObjectId : true;
    }).map(function (searchResult) {
      return searchResult.getLanguage();
    }).filter(onlyUnique);
    if (groupObjectId) {
      var diffLangCount = differentLanguages.length;
      resultsCountPerEachLang = Math.floor(topResultsCount / (diffLangCount || 1));
    } else {
      resultsCountPerEachLang = topResultsCount;
    }
    differentLanguages.forEach(function (lang) {
      var resultsFilteredByLang = _this7.results[GOOGLE_NEWS_SOURCE_CODE].all.filter(function (searchResult) {
        return searchResult.getLanguage() === lang && (groupObjectId ? searchResult.getGroupObjectId() === groupObjectId : true);
      });
      var alreadyLoadedLangResults = resultsFilteredByLang.filter(function (searchResult) {
        return searchResult.checkIsContentHtmlLoaded() && searchResult.checkIsPersonNamePresented() && searchResult.checkIsMediaPyRiskScored() && searchResult.getMediaPyRiskScore() >= highRiskScore;
      });
      if (alreadyLoadedLangResults.length < resultsCountPerEachLang) {
        var neededCount = resultsCountPerEachLang - alreadyLoadedLangResults.length;
        resultsFilteredByLang.forEach(function (searchResult) {
          if ((!searchResult.checkIsContentHtmlLoaded() && searchResult.getTryLoadCounter() < 1 || searchResult.getContentHtml() && !searchResult.checkIsMediaPyRiskScored()) && (groupObjectId ? searchResult.getGroupObjectId() === groupObjectId : true) && (requestObjectId ? searchResult.getRequestObjectId() === requestObjectId : true) && neededCount > 0) {
            _this7.results[GOOGLE_NEWS_SOURCE_CODE].filtered.push(searchResult);
            topResults.push(searchResult);
            neededCount--;
          }
        });
      }
    });
    return topResults;
  };
  _proto.getExtraSourcesResultsForLoad = function getExtraSourcesResultsForLoad(requestObjectId, groupObjectId) {
    var _this8 = this;
    var topResults = [];
    var groupFilteredResults = this.results[EXTRA_SOURCE_SOURCE_CODE].all.filter(function (searchResult) {
      return groupObjectId ? searchResult.getGroupObjectId() === groupObjectId : true;
    });
    var alreadyLoadedGroupResults = groupFilteredResults.filter(function (searchResult) {
      return searchResult.checkIsContentHtmlLoaded() && searchResult.checkIsMediaPyRiskScored();
    });
    var topResultsCount = groupFilteredResults.length;
    if (alreadyLoadedGroupResults.length < topResultsCount) {
      var neededCount = topResultsCount - alreadyLoadedGroupResults.length;
      groupFilteredResults.forEach(function (searchResult) {
        if ((!searchResult.checkIsContentHtmlLoaded() || searchResult.getContentHtml() && !searchResult.checkIsMediaPyRiskScored()) && (groupObjectId ? searchResult.getGroupObjectId() === groupObjectId : true) && (requestObjectId ? searchResult.getRequestObjectId() === requestObjectId : true) && neededCount > 0) {
          _this8.results[EXTRA_SOURCE_SOURCE_CODE].filtered.push(searchResult);
          topResults.push(searchResult);
          neededCount--;
        }
      });
    }
    return topResults;
  };
  _proto.filterResultsByName = function filterResultsByName(searchResults, withName) {
    return searchResults.filter(function (searchResult) {
      return searchResult.checkIsContentHtmlLoaded() && searchResult.checkIsMediaPyRiskScored() && (withName ? searchResult.checkIsPersonNamePresented() : true);
    });
  };
  _proto.filterLoadedRequestObjectResults = function filterLoadedRequestObjectResults(requestObjectId, currType) {
    var _this9 = this;
    Object.keys(this.results).forEach(function (type) {
      if (type === currType) {
        var groupRequestResults = [];
        if (requestObjectId) {
          groupRequestResults = _this9.results[type].filtered.filter(function (searchResult) {
            return searchResult.getRequestObjectId() === requestObjectId;
          });
          _this9.results[type].filtered = _this9.results[type].filtered.filter(function (searchResult) {
            return searchResult.getRequestObjectId() !== requestObjectId;
          });
        } else {
          groupRequestResults = [].concat(_this9.results[type].filtered);
          _this9.results[type].filtered = [];
        }
        if (type === GOOGLE_SEARCH_SOURCE_CODE || type === GOOGLE_NEWS_SOURCE_CODE) {
          groupRequestResults = _this9.filterResultsByName(groupRequestResults, true);
        } else {
          groupRequestResults = _this9.filterResultsByName(groupRequestResults, false);
        }
        _this9.results[type].filtered = [].concat(_this9.results[type].filtered).concat(groupRequestResults);
      }
    });
  };
  _proto.filterRequestObjectResults = function filterRequestObjectResults(requestObjectId, dateFrom, dateTo, isAddWithoutDate, isAddWithoutDateStockMarketResults, languages) {
    var _this10 = this;
    Object.keys(this.results).forEach(function (type) {
      var groupRequestResults = _this10.results[type].filtered.filter(function (searchResult) {
        return searchResult.getRequestObjectId() === requestObjectId;
      });
      _this10.results[type].filtered = _this10.results[type].filtered.filter(function (searchResult) {
        return searchResult.getRequestObjectId() !== requestObjectId;
      });
      if (dateFrom || dateTo) {
        if (type === GOOGLE_SEARCH_SOURCE_CODE || type === GOOGLE_NEWS_SOURCE_CODE || type === ALEPH_OCCRP_SOURCE_CODE) {
          groupRequestResults = groupRequestResults.filter(function (searchResult) {
            return !searchResult.getDate() || searchResult.getDate() && (dateFrom ? searchResult.getDate() >= dateFrom : true) && (dateTo ? searchResult.getDate() <= dateTo : true);
          });
        }
      }
      if (!isAddWithoutDate) {
        if (type === GOOGLE_SEARCH_SOURCE_CODE || type === GOOGLE_NEWS_SOURCE_CODE) {
          groupRequestResults = groupRequestResults.filter(function (searchResult) {
            return searchResult.getDate();
          });
        }
        if (type === ALEPH_OCCRP_SOURCE_CODE) {
          groupRequestResults = groupRequestResults.filter(function (searchResult) {
            return !searchResult.checkIsDocumentType() || searchResult.checkIsDocumentType() && searchResult.getDate();
          });
        }
      }
      if (!isAddWithoutDateStockMarketResults) {
        if (type === STOCK_MARKETS_SOURCE_CODE) {
          groupRequestResults = groupRequestResults.filter(function (searchResult) {
            return searchResult.getDate();
          });
        }
      }
      if (languages && languages.length) {
        if (type === GOOGLE_SEARCH_SOURCE_CODE || type === GOOGLE_NEWS_SOURCE_CODE || type === ALEPH_OCCRP_SOURCE_CODE) {
          groupRequestResults = groupRequestResults.filter(function (searchResult) {
            return !searchResult.getLanguage() || searchResult.getLanguage() && languages.find(function (language) {
              return language === searchResult.getLanguage();
            });
          });
        }
      }
      _this10.results[type].filtered = [].concat(_this10.results[type].filtered).concat(groupRequestResults);
    });
  };
  _proto.filterGroupObjectResults = function filterGroupObjectResults(groupObjectId, maxResultsCount, minRiskScore) {
    var _this11 = this;
    var allRequestsGroupResults = [];
    Object.keys(this.results).forEach(function (type) {
      var groupRequestResults = _this11.results[type].filtered.filter(function (searchResult) {
        return searchResult.getGroupObjectId() === groupObjectId && Math.abs(searchResult.getMediaPyRiskScore()) >= minRiskScore;
      });
      _this11.results[type].filtered = _this11.results[type].filtered.filter(function (searchResult) {
        return searchResult.getGroupObjectId() !== groupObjectId;
      });
      allRequestsGroupResults = allRequestsGroupResults.concat(groupRequestResults);
    });
    allRequestsGroupResults.sort(compareByMediaPyRiskScore);
    allRequestsGroupResults = allRequestsGroupResults.slice(0, maxResultsCount);
    Object.keys(this.results).forEach(function (type) {
      _this11.results[type].filtered = _this11.results[type].filtered.concat(allRequestsGroupResults.filter(function (searchResult) {
        return searchResult.getType() === type;
      }));
    });
  };
  _proto.setTotalResults = function setTotalResults() {
    var _this12 = this;
    var newTotalResults = [];
    Object.keys(this.results).forEach(function (type) {
      newTotalResults = newTotalResults.concat(_this12.results[type].filtered);
    });
    newTotalResults.sort(compareByMediaPyRiskScore);
    newTotalResults = this.splitSearchResultsAndSort(newTotalResults);
    newTotalResults = newTotalResults.concat(this.relevantResults).concat(this.matchPersonResults);
    this.totalResults = newTotalResults;
  };
  _proto.resetFiltersToResults = function resetFiltersToResults() {
    this.setTotalResults();
  };
  _proto.filterTotalResults = function filterTotalResults(isFinal, typesToFilter, dateFrom, dateTo, isAddWithoutDate, isAddWithoutDateStockMarketResults, languages) {
    var _this13 = this;
    var newTotalResults = [];
    Object.keys(this.results).forEach(function (type) {
      if (typesToFilter[type]) {
        if (type === GOOGLE_SEARCH_SOURCE_CODE || type === GOOGLE_NEWS_SOURCE_CODE) {
          _this13.results[type].filtered = _this13.filterResultsByName(_this13.results[type].filtered, true);
        } else {
          _this13.results[type].filtered = _this13.filterResultsByName(_this13.results[type].filtered, false);
        }
      }
      if (isFinal) {
        if (dateFrom || dateTo) {
          if (type === GOOGLE_SEARCH_SOURCE_CODE || type === GOOGLE_NEWS_SOURCE_CODE || type === ALEPH_OCCRP_SOURCE_CODE) {
            _this13.results[type].filtered = _this13.results[type].filtered.filter(function (searchResult) {
              return !searchResult.getDate() || searchResult.getDate() && (dateFrom ? searchResult.getDate() >= dateFrom : true) && (dateTo ? searchResult.getDate() <= dateTo : true);
            });
          }
        }
        if (!isAddWithoutDate) {
          if (type === GOOGLE_SEARCH_SOURCE_CODE || type === GOOGLE_NEWS_SOURCE_CODE) {
            _this13.results[type].filtered = _this13.results[type].filtered.filter(function (searchResult) {
              return searchResult.getDate();
            });
          }
          if (type === ALEPH_OCCRP_SOURCE_CODE) {
            _this13.results[type].filtered = _this13.results[type].filtered.filter(function (searchResult) {
              return !searchResult.checkIsDocumentType() || searchResult.checkIsDocumentType() && searchResult.getDate();
            });
          }
        }
        if (!isAddWithoutDateStockMarketResults) {
          if (type === STOCK_MARKETS_SOURCE_CODE) {
            _this13.results[type].filtered = _this13.results[type].filtered.filter(function (searchResult) {
              return searchResult.getDate();
            });
          }
        }
      }
      if (isFinal) {
        if (languages && languages.length) {
          if (type === GOOGLE_SEARCH_SOURCE_CODE || type === GOOGLE_NEWS_SOURCE_CODE || type === ALEPH_OCCRP_SOURCE_CODE) {
            if (typesToFilter[type]) {
              newTotalResults = newTotalResults.concat(_this13.results[type].filtered.filter(function (searchResult) {
                return searchResult.getLanguage() && languages.find(function (language) {
                  return language === searchResult.getLanguage();
                }) !== undefined;
              }));
            } else {
              newTotalResults = newTotalResults.concat(_this13.results[type].filtered);
            }
          } else {
            newTotalResults = newTotalResults.concat(_this13.results[type].filtered);
          }
        } else {
          newTotalResults = newTotalResults.concat(_this13.results[type].filtered);
        }
      } else {
        newTotalResults = newTotalResults.concat(_this13.results[type].filtered);
      }
    });
    newTotalResults.sort(compareByMediaPyRiskScore);
    newTotalResults = this.splitSearchResultsAndSort(newTotalResults);
    newTotalResults = [].concat(newTotalResults).concat(this.relevantResults).concat(this.matchPersonResults);
    this.totalResults = newTotalResults;
  };
  _proto.applyFiltersToResults = function applyFiltersToResults(dateFrom, dateTo, isAddWithoutDate, languages, sources) {
    var _this14 = this;
    this.totalResults = [];
    this.totalResults = [].concat(this.results[GOOGLE_SEARCH_SOURCE_CODE].filtered).concat(this.results[GOOGLE_NEWS_SOURCE_CODE].filtered).concat(this.results[STOCK_MARKETS_SOURCE_CODE].filtered).concat(this.results[ALEPH_OCCRP_SOURCE_CODE].filtered);
    if (dateFrom || dateTo) {
      this.totalResults = this.totalResults.filter(function (searchResult) {
        return !searchResult.getDate() || searchResult.getDate() && (dateFrom ? searchResult.getDate() >= dateFrom : true) && (dateTo ? searchResult.getDate() <= dateTo : true);
      });
    }
    if (!isAddWithoutDate) {
      this.totalResults = this.totalResults.filter(function (searchResult) {
        return searchResult.getDate();
      });
    }
    if (languages && languages.length) {
      this.totalResults = this.totalResults.filter(function (searchResult) {
        return searchResult.getLanguage() && languages.find(function (language) {
          return language === searchResult.getLanguage();
        }) !== undefined;
      });
    }
    this.totalResults = this.totalResults.concat(this.results[EXTRA_SOURCE_SOURCE_CODE].filtered).concat(this.results[OPEN_CORPORATES_SOURCE_CODE].filtered).concat(this.results[OPEN_SANCTIONS_SOURCE_CODE].filtered);
    if ((sources || []).length) {
      var tempTotalResults = [];
      (sources || []).forEach(function (source) {
        tempTotalResults = tempTotalResults.concat(_this14.totalResults.filter(function (searchResult) {
          return searchResult.getType() === source;
        }));
      });
      this.totalResults = tempTotalResults;
    }
    this.totalResults.sort(compareByMediaPyRiskScore);
    this.totalResults = this.splitSearchResultsAndSort(this.totalResults);
    this.totalResults = this.totalResults.concat(this.relevantResults).concat(this.matchPersonResults);
  };
  return BasePersonV1;
}(PersonV4);
module.exports = {
  BasePersonV1: BasePersonV1
};

},{"../../../common/models":682,"../../../common/utils/comparisons-v4":688,"../../../common/utils/filters-v4":691,"../../../constants/source-types":697,"../result-items":842}],815:[function(require,module,exports){
"use strict";

var _require = require("./base-person-v1"),
  BasePersonV1 = _require.BasePersonV1;
var _require2 = require("./media-py-gpt-person-v1"),
  MediaPyGptPersonV1 = _require2.MediaPyGptPersonV1;
var _require3 = require("./media-py-llm-person-v1"),
  MediaPyLLMPersonV1 = _require3.MediaPyLLMPersonV1;
module.exports = {
  BasePersonV1: BasePersonV1,
  MediaPyGptPersonV1: MediaPyGptPersonV1,
  MediaPyLLMPersonV1: MediaPyLLMPersonV1
};

},{"./base-person-v1":814,"./media-py-gpt-person-v1":816,"./media-py-llm-person-v1":817}],816:[function(require,module,exports){
"use strict";

function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
var _require = require("../../../common/utils/common-v4"),
  remapIntervals = _require.remapIntervals;
var _require2 = require("../../../common/utils/comparisons-v4"),
  compareByMediaPyGptRiskScore = _require2.compareByMediaPyGptRiskScore,
  compareByValue = _require2.compareByValue;
var _require3 = require("../../../common/utils/filters-v4"),
  onlyUnique = _require3.onlyUnique;
var _require4 = require("./media-py-llm-person-v1"),
  MediaPyLLMPersonV1 = _require4.MediaPyLLMPersonV1;
var MediaPyGptPersonV1 = function (_MediaPyLLMPersonV) {
  function MediaPyGptPersonV1(id, fullName, firstName, lastName, isAlias, isLinked, parentId, isCompany, itemId) {
    var _this;
    _this = _MediaPyLLMPersonV.call(this, id, fullName, firstName, lastName, isAlias, isLinked, parentId, isCompany, itemId) || this;
    _this.gptRelatedItems = {
      persons: {
        items: [],
        topCnt: 5
      },
      orgs: {
        items: [],
        topCnt: 5
      }
    };
    _this.gptRelatedTopics = [];
    _this.topGptRelatedTopicsCount = 5;
    _this.gptGeneralRiskAssScore = 0;
    _this.gptGeneralRiskAssExplanation = "";
    _this.gptOverallSumSummary = "";
    _this.gptOverallSumOccupation = "";
    _this.gptOverallSumAge = "";
    _this.gptOverallSumLocation = "";
    _this.gptAllegations = [];
    _this.gptEvidence = [];
    _this.gptPotentialRisks = [];
    _this.gptMitigationFactors = [];
    _this.gptConclusion = "";
    _this.gptMostImportantKeywords = [];
    _this.gptGraph = {
      edges: [],
      vertices: []
    };
    _this.topGptRiskResults = [];
    _this.isMediaPyGptInfoLoading = true;
    _this.isMediaPyGptInfoLoaded = false;
    return _this;
  }
  _inheritsLoose(MediaPyGptPersonV1, _MediaPyLLMPersonV);
  var _proto = MediaPyGptPersonV1.prototype;
  _proto.setGptRiskScore = function setGptRiskScore(riskScore) {
    this.gptGeneralRiskAssScore = riskScore;
  };
  _proto.getGptRiskScore = function getGptRiskScore() {
    return this.gptGeneralRiskAssScore;
  };
  _proto.setGptRiskExplanation = function setGptRiskExplanation(explanation) {
    this.gptGeneralRiskAssExplanation = explanation;
  };
  _proto.getGptRiskExplanation = function getGptRiskExplanation() {
    return this.gptGeneralRiskAssExplanation;
  };
  _proto.setGptRelatedItems = function setGptRelatedItems(items, type) {
    this.gptRelatedItems[type].items = [].concat(items || []).filter(onlyUnique).sort(compareByValue);
  };
  _proto.getGptRelatedItems = function getGptRelatedItems(type) {
    return this.gptRelatedItems[type].items;
  };
  _proto.setTopGptRelatedItemsCount = function setTopGptRelatedItemsCount(topCnt, type) {
    this.gptRelatedItems[type].topCnt = topCnt;
  };
  _proto.setGptRelatedTopics = function setGptRelatedTopics() {
    var topGptRiskResults = this.getTopGptRiskResults();
    topGptRiskResults.sort(compareByMediaPyGptRiskScore);
    this.gptRelatedTopics = topGptRiskResults.map(function (searchResult) {
      return searchResult.getGptDocAnalysTopic();
    }).filter(function (topic) {
      return topic;
    }).filter(onlyUnique);
  };
  _proto.getGptRelatedTopics = function getGptRelatedTopics() {
    return this.gptRelatedTopics;
  };
  _proto.setTopGptRelatedTopicsCount = function setTopGptRelatedTopicsCount(topCount) {
    this.topGptRelatedTopicsCount = topCount;
  };
  _proto.setGptOverallSummary = function setGptOverallSummary(summary) {
    this.gptOverallSumSummary = summary;
  };
  _proto.getGptOverallSummary = function getGptOverallSummary() {
    return this.gptOverallSumSummary;
  };
  _proto.setGptOverallOccupation = function setGptOverallOccupation(occupation) {
    this.gptOverallSumOccupation = occupation;
  };
  _proto.getGptOverallOccupation = function getGptOverallOccupation() {
    return this.gptOverallSumOccupation;
  };
  _proto.setGptOverallAge = function setGptOverallAge(age) {
    this.gptOverallSumAge = age;
  };
  _proto.getGptOverallAge = function getGptOverallAge() {
    return this.gptOverallSumAge;
  };
  _proto.setGptOverallLocation = function setGptOverallLocation(location) {
    this.gptOverallSumLocation = location;
  };
  _proto.getGptOverallLocation = function getGptOverallLocation() {
    return this.gptOverallSumLocation;
  };
  _proto.setGptAllegations = function setGptAllegations(allegations) {
    this.gptAllegations = [].concat(allegations || []);
  };
  _proto.getGptAllegations = function getGptAllegations() {
    return this.gptAllegations;
  };
  _proto.setGptEvidence = function setGptEvidence(evidence) {
    this.gptEvidence = [].concat(evidence || []);
  };
  _proto.getGptEvidence = function getGptEvidence() {
    return this.gptEvidence;
  };
  _proto.setGptPotentialRisks = function setGptPotentialRisks(potentialRisks) {
    this.gptPotentialRisks = [].concat(potentialRisks || []);
  };
  _proto.getGptPotentialRisks = function getGptPotentialRisks() {
    return this.gptPotentialRisks;
  };
  _proto.setGptMitigationFactors = function setGptMitigationFactors(mitigationFactors) {
    this.gptMitigationFactors = [].concat(mitigationFactors || []);
  };
  _proto.getGptMitigationFactors = function getGptMitigationFactors() {
    return this.gptMitigationFactors;
  };
  _proto.setGptConclusion = function setGptConclusion(conclusion) {
    this.gptConclusion = conclusion;
  };
  _proto.getGptConclusion = function getGptConclusion() {
    return this.gptConclusion;
  };
  _proto.setGptMostImportantkeywords = function setGptMostImportantkeywords(keywords) {
    this.gptMostImportantKeywords = [].concat(keywords || []).filter(onlyUnique).sort(compareByValue);
  };
  _proto.getGptMostImportantKeywords = function getGptMostImportantKeywords() {
    return this.gptMostImportantKeywords;
  };
  _proto.setTopGptRiskResults = function setTopGptRiskResults(count) {
    if (!this.topGptRiskResults.length) {
      this.topGptRiskResults = this.totalResults.filter(function (tr) {
        return !tr.checkIsFromMatch();
      }).slice(0, count);
    }
  };
  _proto.getTopGptRiskResults = function getTopGptRiskResults() {
    return this.topGptRiskResults;
  };
  _proto.getGptMostImportantPersons = function getGptMostImportantPersons() {
    return this.gptRelatedItems.persons.items;
  };
  _proto.getGptMostImportantOrganizations = function getGptMostImportantOrganizations() {
    return this.gptRelatedItems.orgs.items;
  };
  _proto.setGptGraph = function setGptGraph(graphInfo) {
    this.gptGraph = graphInfo;
  };
  _proto.getGptGraph = function getGptGraph() {
    return this.gptGraph;
  };
  _proto.remapGptRiskScoreToMediaPyRiskScore = function remapGptRiskScoreToMediaPyRiskScore() {
    var gptRiskScore = this.getGptRiskScore();
    if (gptRiskScore >= 2) {
      var remapRiskScore = remapIntervals(gptRiskScore, 2, 10, 0.8, 1);
      this.totalRiskScore = remapRiskScore;
    }
  };
  _proto.setMediaPyGptInfoLoaded = function setMediaPyGptInfoLoaded(flag) {
    this.isMediaPyGptInfoLoading = false;
    this.isMediaPyGptInfoLoaded = flag;
  };
  return MediaPyGptPersonV1;
}(MediaPyLLMPersonV1);
module.exports = {
  MediaPyGptPersonV1: MediaPyGptPersonV1
};

},{"../../../common/utils/common-v4":687,"../../../common/utils/comparisons-v4":688,"../../../common/utils/filters-v4":691,"./media-py-llm-person-v1":817}],817:[function(require,module,exports){
"use strict";

function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
var _require = require("./media-py-person-v1"),
  MediaPyPersonV1 = _require.MediaPyPersonV1;
var MediaPyLLMPersonV1 = function (_MediaPyPersonV) {
  function MediaPyLLMPersonV1(id, fullName, firstName, lastName, isAlias, isLinked, parentId, isCompany, itemId) {
    var _this;
    _this = _MediaPyPersonV.call(this, id, fullName, firstName, lastName, isAlias, isLinked, parentId, isCompany, itemId) || this;
    _this.llmOccupation = "";
    _this.llmAge = "";
    _this.llmLocation = "";
    _this.llmOtherDetails = "";
    _this.llmSummary = "";
    _this.llmEvidence = "";
    _this.llmRisks = "";
    _this.llmConclusion = "";
    return _this;
  }
  _inheritsLoose(MediaPyLLMPersonV1, _MediaPyPersonV);
  var _proto = MediaPyLLMPersonV1.prototype;
  _proto.setLLMOccupation = function setLLMOccupation(occupation) {
    this.llmOccupation = occupation;
  };
  _proto.getLLMOccupation = function getLLMOccupation() {
    return this.llmOccupation;
  };
  _proto.setLLMAge = function setLLMAge(age) {
    this.llmAge = age;
  };
  _proto.getLLMAge = function getLLMAge() {
    return this.llmAge;
  };
  _proto.setLLMLocation = function setLLMLocation(location) {
    this.llmLocation = location;
  };
  _proto.getLLMLocation = function getLLMLocation() {
    return this.llmLocation;
  };
  _proto.setLLMOtherDetails = function setLLMOtherDetails(otherDetails) {
    this.llmOtherDetails = otherDetails;
  };
  _proto.getLLMOtherDetails = function getLLMOtherDetails() {
    return this.llmOtherDetails;
  };
  _proto.setLLMSummary = function setLLMSummary(summary) {
    this.llmSummary = summary;
  };
  _proto.getLLMSummary = function getLLMSummary() {
    return this.llmSummary;
  };
  _proto.setLLMEvidence = function setLLMEvidence(evidence) {
    this.llmEvidence = evidence;
  };
  _proto.getLLMEvidence = function getLLMEvidence() {
    return this.llmEvidence;
  };
  _proto.setLLMRisks = function setLLMRisks(risks) {
    this.llmRisks = risks;
  };
  _proto.getLLMRisks = function getLLMRisks() {
    return this.llmRisks;
  };
  _proto.setLLMConclusion = function setLLMConclusion(conclusion) {
    this.llmConclusion = conclusion;
  };
  _proto.getLLMConclusion = function getLLMConclusion() {
    return this.llmConclusion;
  };
  return MediaPyLLMPersonV1;
}(MediaPyPersonV1);
module.exports = {
  MediaPyLLMPersonV1: MediaPyLLMPersonV1
};

},{"./media-py-person-v1":818}],818:[function(require,module,exports){
"use strict";

function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
var _require = require("./base-person-v1"),
  BasePersonV1 = _require.BasePersonV1;
var _require2 = require("../../../common/utils/filters-v4"),
  onlyUnique = _require2.onlyUnique,
  onlyUniqueByName = _require2.onlyUniqueByName;
var _require3 = require("../../../common/utils/common-v4"),
  getCountersDictionary = _require3.getCountersDictionary,
  getTopKeysSortedByValue = _require3.getTopKeysSortedByValue;
var _require4 = require("../../../media-search/constants/source-types"),
  GOOGLE_SEARCH_SOURCE_CODE = _require4.GOOGLE_SEARCH_SOURCE_CODE,
  GOOGLE_NEWS_SOURCE_CODE = _require4.GOOGLE_NEWS_SOURCE_CODE,
  EXTRA_SOURCE_SOURCE_CODE = _require4.EXTRA_SOURCE_SOURCE_CODE,
  STOCK_MARKETS_SOURCE_CODE = _require4.STOCK_MARKETS_SOURCE_CODE,
  ALEPH_OCCRP_SOURCE_CODE = _require4.ALEPH_OCCRP_SOURCE_CODE,
  OPEN_CORPORATES_SOURCE_CODE = _require4.OPEN_CORPORATES_SOURCE_CODE,
  OPEN_SANCTIONS_SOURCE_CODE = _require4.OPEN_SANCTIONS_SOURCE_CODE;
var MediaPyPersonV1 = function (_BasePersonV) {
  function MediaPyPersonV1(id, fullName, firstName, lastName, isAlias, isLinked, parentId, isCompany, itemId) {
    var _this;
    _this = _BasePersonV.call(this, id, fullName, firstName, lastName, isAlias, isLinked, parentId, isCompany, itemId) || this;
    _this.extendedSummary = [];
    _this.mostCommonMentionedItems = {
      persons: {
        items: [],
        topCnt: 5
      },
      orgs: {
        items: [],
        topCnt: 5
      },
      locs: {
        items: [],
        topCnt: 5
      }
    };
    _this.mostCommonItems = {
      ngrams: [],
      keywords: [],
      riskPersons: [],
      riskOrgs: []
    };
    _this.allRiskItems = {
      persons: [],
      orgs: []
    };
    _this.isMediaPyInfoLoading = true;
    _this.isMediaPyInfoLoaded = false;
    return _this;
  }
  _inheritsLoose(MediaPyPersonV1, _BasePersonV);
  var _proto = MediaPyPersonV1.prototype;
  _proto.setExtendedSummary = function setExtendedSummary(extendedSummary) {
    var extendedSummaryArray = [];
    if (Array.isArray(extendedSummary)) {
      extendedSummaryArray = extendedSummary.filter(onlyUnique);
    } else if (typeof extendedSummary === "string" || extendedSummary instanceof String) {
      extendedSummaryArray = [extendedSummary];
    } else {
      extendedSummaryArray = [];
    }
    this.extendedSummary = extendedSummaryArray;
  };
  _proto.getExtendedSummary = function getExtendedSummary() {
    return this.extendedSummary;
  };
  _proto.setMostCommonItems = function setMostCommonItems(items, type) {
    this.mostCommonItems[type] = [].concat(items);
  };
  _proto.getMostCommonItems = function getMostCommonItems(type) {
    return this.mostCommonItems[type];
  };
  _proto.setAllRiskItems = function setAllRiskItems(items, type) {
    this.allRiskItems[type] = [].concat(items);
  };
  _proto.getAllRiskItems = function getAllRiskItems(type) {
    return this.allRiskItems[type];
  };
  _proto.setMostCommonMentionedItems = function setMostCommonMentionedItems(items, type) {
    this.mostCommonMentionedItems[type].items = [].concat(items);
  };
  _proto.getMostCommonMentionedItems = function getMostCommonMentionedItems(type) {
    return this.mostCommonMentionedItems[type].items;
  };
  _proto.setTopMentionedItemsCount = function setTopMentionedItemsCount(topCnt, type) {
    this.mostCommonMentionedItems[type].topCnt = topCnt;
  };
  _proto.setSummaryInfo = function setSummaryInfo() {
    var personTotalResults = this.getTotalResults().filter(function (searchResult) {
      return searchResult.getType() === GOOGLE_SEARCH_SOURCE_CODE || searchResult.getType() === GOOGLE_NEWS_SOURCE_CODE || searchResult.getType() === STOCK_MARKETS_SOURCE_CODE || searchResult.getType() === ALEPH_OCCRP_SOURCE_CODE || searchResult.getType() === OPEN_SANCTIONS_SOURCE_CODE || searchResult.getType() === OPEN_CORPORATES_SOURCE_CODE;
    });
    var extraSourcesResults = this.getTotalResults().filter(function (searchResult) {
      return searchResult.getType() === EXTRA_SOURCE_SOURCE_CODE;
    });
    var mostCommonNgrams = {};
    var mostCommonKeywords = {};
    var mostCommonRiskPersons = {};
    var mostCommonRiskOrganizations = {};
    var riskPersonsKeyValueObj = {};
    var riskOrgsKeyValueObj = {};
    var mostCommonMentionedPersons = {};
    var mostCommonMentionedOrgs = {};
    var mostCommonMentionedLocs = {};
    personTotalResults.forEach(function (searchResult) {
      var mediaPyRiskScoreAbs = Math.abs(searchResult.getMediaPyRiskScore());
      searchResult.getAnalyzeItems("ngrams").forEach(function (ngramObj) {
        var key = ngramObj.ngram;
        if (!mostCommonNgrams[key]) {
          mostCommonNgrams[key] = ngramObj.count * mediaPyRiskScoreAbs;
        } else {
          mostCommonNgrams[key] += ngramObj.count * mediaPyRiskScoreAbs;
        }
      });
      mostCommonKeywords = getCountersDictionary(mostCommonKeywords, searchResult.getAnalyzeItems("keywords"));
      mostCommonRiskPersons = getCountersDictionary(mostCommonRiskPersons, searchResult.getAnalyzeItems("riskPersons").map(function (personObj) {
        return personObj.name;
      }));
      mostCommonRiskOrganizations = getCountersDictionary(mostCommonRiskOrganizations, searchResult.getAnalyzeItems("riskOrgs").map(function (orgObj) {
        return orgObj.name;
      }));
      searchResult.getAnalyzeItems("riskPersons").forEach(function (personObj) {
        var key = personObj.name;
        if (!riskPersonsKeyValueObj[key]) {
          riskPersonsKeyValueObj[key] = personObj;
        }
      });
      searchResult.getAnalyzeItems("riskOrgs").forEach(function (orgObj) {
        var key = orgObj.name;
        if (!riskOrgsKeyValueObj[key]) {
          riskOrgsKeyValueObj[key] = orgObj;
        }
      });
      mostCommonMentionedPersons = getCountersDictionary(mostCommonMentionedPersons, searchResult.getMentionedItems("persons").map(function (mentPers) {
        return mentPers.name;
      }));
      mostCommonMentionedOrgs = getCountersDictionary(mostCommonMentionedOrgs, searchResult.getMentionedItems("orgs").map(function (mentOrg) {
        return mentOrg.name;
      }));
      mostCommonMentionedLocs = getCountersDictionary(mostCommonMentionedLocs, searchResult.getMentionedItems("locs").map(function (mentLoc) {
        return mentLoc.name;
      }));
    });
    var N = 15;
    var sortedNgrams = getTopKeysSortedByValue(mostCommonNgrams, N, true);
    this.setMostCommonItems(sortedNgrams, "ngrams");
    var sortedKeywords = getTopKeysSortedByValue(mostCommonKeywords, N, true);
    this.setMostCommonItems(sortedKeywords, "keywords");
    var topPersonNames = getTopKeysSortedByValue(mostCommonRiskPersons, N, true);
    var sortedRiskPersons = topPersonNames.map(function (personName) {
      return {
        name: riskPersonsKeyValueObj[personName].name,
        db_id: riskPersonsKeyValueObj[personName].db_id
      };
    });
    var totalExtraSourcesRiskPersons = [].concat.apply([], extraSourcesResults.map(function (searchResult) {
      return searchResult.getAnalyzeItems("riskPersons");
    }));
    this.setMostCommonItems(totalExtraSourcesRiskPersons.concat(sortedRiskPersons).filter(onlyUniqueByName), "riskPersons");
    var topOrgNames = getTopKeysSortedByValue(mostCommonRiskOrganizations, N, true);
    var sortedRiskOrgs = topOrgNames.map(function (orgName) {
      return {
        name: riskOrgsKeyValueObj[orgName].name,
        db_id: riskOrgsKeyValueObj[orgName].db_id
      };
    });
    var totalExtraSourcesRiskOrgs = [].concat.apply([], extraSourcesResults.map(function (searchResult) {
      return searchResult.getAnalyzeItems("riskOrgs");
    }));
    this.setMostCommonItems(totalExtraSourcesRiskOrgs.concat(sortedRiskOrgs).filter(onlyUniqueByName), "riskOrgs");
    this.setAllRiskItems(Object.values(riskPersonsKeyValueObj).concat(totalExtraSourcesRiskPersons), "persons");
    this.setAllRiskItems(Object.values(riskOrgsKeyValueObj).concat(totalExtraSourcesRiskOrgs), "orgs");
    var topMentionedPersons = getTopKeysSortedByValue(mostCommonMentionedPersons, 15, true);
    var topMentionedExtraSourcesPersons = [].concat.apply([], extraSourcesResults.map(function (searchResult) {
      return searchResult.getMentionedItems("persons").map(function (item) {
        return item.name;
      });
    }));
    var totalMentionedPersons = topMentionedExtraSourcesPersons.concat(topMentionedPersons).filter(onlyUnique);
    var topMentionedOrgs = getTopKeysSortedByValue(mostCommonMentionedOrgs, 15, true);
    var topMentionedExtraSourcesOrgs = [].concat.apply([], extraSourcesResults.map(function (searchResult) {
      return searchResult.getMentionedItems("orgs").map(function (item) {
        return item.name;
      });
    }));
    var totalMentionedOrgs = topMentionedExtraSourcesOrgs.concat(topMentionedOrgs).filter(onlyUnique);
    var topMentionedLocs = getTopKeysSortedByValue(mostCommonMentionedLocs, 15, true);
    var totalMentionedExtraSourcesLocs = [].concat.apply([], extraSourcesResults.map(function (searchResult) {
      return searchResult.getMentionedItems("locs").map(function (item) {
        return item.name;
      });
    }));
    var totalMentionedLocs = totalMentionedExtraSourcesLocs.concat(topMentionedLocs).filter(onlyUnique);
    this.setMostCommonMentionedItems(totalMentionedPersons, "persons");
    this.setMostCommonMentionedItems(totalMentionedOrgs, "orgs");
    this.setMostCommonMentionedItems(totalMentionedLocs, "locs");
  };
  _proto.setMediaPyInfoLoaded = function setMediaPyInfoLoaded(flag) {
    this.isMediaPyInfoLoading = false;
    this.isMediaPyInfoLoaded = flag;
  };
  return MediaPyPersonV1;
}(BasePersonV1);
module.exports = {
  MediaPyPersonV1: MediaPyPersonV1
};

},{"../../../common/utils/common-v4":687,"../../../common/utils/filters-v4":691,"../../../media-search/constants/source-types":892,"./base-person-v1":814}],819:[function(require,module,exports){
"use strict";

function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
var _require = require("./request-config-v5"),
  RequestConfigV5 = _require.RequestConfigV5;
var AlephOccrpRequestConfigV5 = function (_RequestConfigV) {
  function AlephOccrpRequestConfigV5() {
    return _RequestConfigV.apply(this, arguments) || this;
  }
  _inheritsLoose(AlephOccrpRequestConfigV5, _RequestConfigV);
  return AlephOccrpRequestConfigV5;
}(RequestConfigV5);
module.exports = {
  AlephOccrpRequestConfigV5: AlephOccrpRequestConfigV5
};

},{"./request-config-v5":825}],820:[function(require,module,exports){
"use strict";

function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
var _require = require("./request-config-v5"),
  RequestConfigV5 = _require.RequestConfigV5;
var ExtraSourceRequestConfigV5 = function (_RequestConfigV) {
  function ExtraSourceRequestConfigV5(type, isSingleProcessing, isBatchProcessing, isFastProcessing, sites, after, before) {
    var _this;
    _this = _RequestConfigV.call(this, type, isSingleProcessing, isBatchProcessing, isFastProcessing, [], after, before) || this;
    _this.sites = sites || [];
    return _this;
  }
  _inheritsLoose(ExtraSourceRequestConfigV5, _RequestConfigV);
  var _proto = ExtraSourceRequestConfigV5.prototype;
  _proto.getSites = function getSites() {
    return this.sites;
  };
  return ExtraSourceRequestConfigV5;
}(RequestConfigV5);
module.exports = {
  ExtraSourceRequestConfigV5: ExtraSourceRequestConfigV5
};

},{"./request-config-v5":825}],821:[function(require,module,exports){
"use strict";

function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
var _require = require("./request-config-v5"),
  RequestConfigV5 = _require.RequestConfigV5;
var GoogleNewsRequestConfigV5 = function (_RequestConfigV) {
  function GoogleNewsRequestConfigV5() {
    return _RequestConfigV.apply(this, arguments) || this;
  }
  _inheritsLoose(GoogleNewsRequestConfigV5, _RequestConfigV);
  return GoogleNewsRequestConfigV5;
}(RequestConfigV5);
module.exports = {
  GoogleNewsRequestConfigV5: GoogleNewsRequestConfigV5
};

},{"./request-config-v5":825}],822:[function(require,module,exports){
"use strict";

var _require = require("./aleph-occrp-request-config-v5"),
  AlephOccrpRequestConfigV5 = _require.AlephOccrpRequestConfigV5;
var _require2 = require("./extra-source-request-config-v5"),
  ExtraSourceRequestConfigV5 = _require2.ExtraSourceRequestConfigV5;
var _require3 = require("./google-news-request-config-v5"),
  GoogleNewsRequestConfigV5 = _require3.GoogleNewsRequestConfigV5;
var _require4 = require("./open-corporates-request-config-v5"),
  OpenCorporatesRequestConfigV5 = _require4.OpenCorporatesRequestConfigV5;
var _require5 = require("./open-sanctions-request-config-v5"),
  OpenSanctionsRequestConfigV5 = _require5.OpenSanctionsRequestConfigV5;
var _require6 = require("./requests-group-config-v5"),
  RequestsGroupConfigV5 = _require6.RequestsGroupConfigV5;
var _require7 = require("./search-engine-request-config-v5"),
  SearchEngineRequestConfigV5 = _require7.SearchEngineRequestConfigV5;
var _require8 = require("./stock-market-request-config-v5"),
  StockMarketRequestConfigV5 = _require8.StockMarketRequestConfigV5;
module.exports = {
  AlephOccrpRequestConfigV5: AlephOccrpRequestConfigV5,
  ExtraSourceRequestConfigV5: ExtraSourceRequestConfigV5,
  GoogleNewsRequestConfigV5: GoogleNewsRequestConfigV5,
  OpenCorporatesRequestConfigV5: OpenCorporatesRequestConfigV5,
  OpenSanctionsRequestConfigV5: OpenSanctionsRequestConfigV5,
  SearchEngineRequestConfigV5: SearchEngineRequestConfigV5,
  StockMarketRequestConfigV5: StockMarketRequestConfigV5,
  RequestsGroupConfigV5: RequestsGroupConfigV5
};

},{"./aleph-occrp-request-config-v5":819,"./extra-source-request-config-v5":820,"./google-news-request-config-v5":821,"./open-corporates-request-config-v5":823,"./open-sanctions-request-config-v5":824,"./requests-group-config-v5":826,"./search-engine-request-config-v5":827,"./stock-market-request-config-v5":833}],823:[function(require,module,exports){
"use strict";

function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
var _require = require("./request-config-v5"),
  RequestConfigV5 = _require.RequestConfigV5;
var OpenCorporatesRequestConfigV5 = function (_RequestConfigV) {
  function OpenCorporatesRequestConfigV5() {
    return _RequestConfigV.apply(this, arguments) || this;
  }
  _inheritsLoose(OpenCorporatesRequestConfigV5, _RequestConfigV);
  return OpenCorporatesRequestConfigV5;
}(RequestConfigV5);
module.exports = {
  OpenCorporatesRequestConfigV5: OpenCorporatesRequestConfigV5
};

},{"./request-config-v5":825}],824:[function(require,module,exports){
"use strict";

function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
var _require = require("./request-config-v5"),
  RequestConfigV5 = _require.RequestConfigV5;
var OpenSanctionsRequestConfigV5 = function (_RequestConfigV) {
  function OpenSanctionsRequestConfigV5() {
    return _RequestConfigV.apply(this, arguments) || this;
  }
  _inheritsLoose(OpenSanctionsRequestConfigV5, _RequestConfigV);
  return OpenSanctionsRequestConfigV5;
}(RequestConfigV5);
module.exports = {
  OpenSanctionsRequestConfigV5: OpenSanctionsRequestConfigV5
};

},{"./request-config-v5":825}],825:[function(require,module,exports){
"use strict";

var moment = require("moment");
var _require = require("../../../common/utils/common-v4"),
  generateUUID = _require.generateUUID;
var RequestConfigV5 = function () {
  function RequestConfigV5(type, isSingleProcessing, isBatchProcessing, isFastProcessing, expectedLanguages, after, before) {
    this.id = generateUUID();
    this.type = type;
    this.isSingleProcessing = isSingleProcessing;
    this.isBatchProcessing = isBatchProcessing;
    this.isFastProcessing = isFastProcessing;
    this.expectedLanguages = expectedLanguages || [];
    this.after = null;
    this.before = null;
    var parsedDate = null;
    if (after) {
      try {
        parsedDate = moment(after);
      } catch (e) {}
      this.after = parsedDate ? parsedDate.toDate() : null;
    }
    if (before) {
      try {
        parsedDate = moment(before);
      } catch (e) {}
      this.before = parsedDate ? parsedDate.toDate() : null;
    }
  }
  var _proto = RequestConfigV5.prototype;
  _proto.getId = function getId() {
    return this.id;
  };
  _proto.getType = function getType() {
    return this.type;
  };
  _proto.checkIsSingleProcessing = function checkIsSingleProcessing() {
    return this.isSingleProcessing;
  };
  _proto.checkIsBatchProcessing = function checkIsBatchProcessing() {
    return this.isBatchProcessing;
  };
  _proto.checkIsFastProcessing = function checkIsFastProcessing() {
    return this.isFastProcessing;
  };
  _proto.getBeforeDate = function getBeforeDate() {
    return this.before;
  };
  _proto.getAfterDate = function getAfterDate() {
    return this.after;
  };
  _proto.getExpectedLanguages = function getExpectedLanguages() {
    return this.expectedLanguages;
  };
  _proto.destroy = function destroy() {};
  return RequestConfigV5;
}();
module.exports = {
  RequestConfigV5: RequestConfigV5
};

},{"../../../common/utils/common-v4":687,"moment":680}],826:[function(require,module,exports){
"use strict";

var _require = require("../../../common/utils/common-v4"),
  generateUUID = _require.generateUUID;
var _require2 = require("./extra-source-request-config-v5"),
  ExtraSourceRequestConfigV5 = _require2.ExtraSourceRequestConfigV5;
var _require3 = require("./stock-market-request-config-v5"),
  StockMarketRequestConfigV5 = _require3.StockMarketRequestConfigV5;
var _require4 = require("./google-news-request-config-v5"),
  GoogleNewsRequestConfigV5 = _require4.GoogleNewsRequestConfigV5;
var _require5 = require("./search-engine-request-config-v5"),
  SearchEngineRequestConfigV5 = _require5.SearchEngineRequestConfigV5;
var _require6 = require("./aleph-occrp-request-config-v5"),
  AlephOccrpRequestConfigV5 = _require6.AlephOccrpRequestConfigV5;
var _require7 = require("./open-sanctions-request-config-v5"),
  OpenSanctionsRequestConfigV5 = _require7.OpenSanctionsRequestConfigV5;
var _require8 = require("./open-corporates-request-config-v5"),
  OpenCorporatesRequestConfigV5 = _require8.OpenCorporatesRequestConfigV5;
var _require9 = require("../../../constants/source-types"),
  GOOGLE_SEARCH_SOURCE_CODE = _require9.GOOGLE_SEARCH_SOURCE_CODE,
  GOOGLE_NEWS_SOURCE_CODE = _require9.GOOGLE_NEWS_SOURCE_CODE,
  EXTRA_SOURCE_SOURCE_CODE = _require9.EXTRA_SOURCE_SOURCE_CODE,
  STOCK_MARKETS_SOURCE_CODE = _require9.STOCK_MARKETS_SOURCE_CODE,
  ALEPH_OCCRP_SOURCE_CODE = _require9.ALEPH_OCCRP_SOURCE_CODE,
  OPEN_SANCTIONS_SOURCE_CODE = _require9.OPEN_SANCTIONS_SOURCE_CODE,
  OPEN_CORPORATES_SOURCE_CODE = _require9.OPEN_CORPORATES_SOURCE_CODE,
  STOCK_MARKET_SOURCE_CODE = _require9.STOCK_MARKET_SOURCE_CODE;
var RequestsGroupConfigV5 = function () {
  function RequestsGroupConfigV5(priority, resultsCount, maxResultsCount, minRiskScore) {
    this.id = generateUUID();
    this.requests = [];
    this.priority = priority;
    this.resultsCount = resultsCount;
    this.maxResultsCount = maxResultsCount;
    this.minRiskScore = minRiskScore;
  }
  var _proto = RequestsGroupConfigV5.prototype;
  _proto.setRequests = function setRequests(requestsConfigs) {
    var _this = this;
    (requestsConfigs || []).forEach(function (requestConfig) {
      var newGroupRequest = null;
      switch (requestConfig.type) {
        case GOOGLE_SEARCH_SOURCE_CODE:
          newGroupRequest = new SearchEngineRequestConfigV5(GOOGLE_SEARCH_SOURCE_CODE, requestConfig.single_processing, requestConfig.batch_processing, requestConfig.fast_processing, requestConfig.expected_result_languages, requestConfig.request, [], requestConfig.after, requestConfig.before);
          break;
        case EXTRA_SOURCE_SOURCE_CODE:
          newGroupRequest = new ExtraSourceRequestConfigV5(EXTRA_SOURCE_SOURCE_CODE, requestConfig.single_processing, requestConfig.batch_processing, requestConfig.fast_processing, requestConfig.sites, requestConfig.after, requestConfig.before);
          break;
        case STOCK_MARKET_SOURCE_CODE:
          newGroupRequest = new StockMarketRequestConfigV5(STOCK_MARKETS_SOURCE_CODE, requestConfig.single_processing, requestConfig.batch_processing, requestConfig.fast_processing, requestConfig.sites, requestConfig.after, requestConfig.before);
          break;
        case STOCK_MARKETS_SOURCE_CODE:
          newGroupRequest = new StockMarketRequestConfigV5(STOCK_MARKETS_SOURCE_CODE, requestConfig.single_processing, requestConfig.batch_processing, requestConfig.fast_processing, requestConfig.sites, requestConfig.after, requestConfig.before);
          break;
        case GOOGLE_NEWS_SOURCE_CODE:
          newGroupRequest = new GoogleNewsRequestConfigV5(GOOGLE_NEWS_SOURCE_CODE, requestConfig.single_processing, requestConfig.batch_processing, requestConfig.fast_processing, requestConfig.expected_result_languages, requestConfig.after, requestConfig.before);
          break;
        case ALEPH_OCCRP_SOURCE_CODE:
          newGroupRequest = new AlephOccrpRequestConfigV5(ALEPH_OCCRP_SOURCE_CODE, requestConfig.single_processing, requestConfig.batch_processing, requestConfig.fast_processing, requestConfig.expected_result_languages, requestConfig.after, requestConfig.before);
          break;
        case OPEN_SANCTIONS_SOURCE_CODE:
          newGroupRequest = new OpenSanctionsRequestConfigV5(OPEN_SANCTIONS_SOURCE_CODE, requestConfig.single_processing, requestConfig.batch_processing, requestConfig.fast_processing, requestConfig.expected_result_languages, requestConfig.after, requestConfig.before);
          break;
        case OPEN_CORPORATES_SOURCE_CODE:
          newGroupRequest = new OpenCorporatesRequestConfigV5(OPEN_CORPORATES_SOURCE_CODE, requestConfig.single_processing, requestConfig.batch_processing, requestConfig.fast_processing, requestConfig.expected_result_languages, requestConfig.after, requestConfig.before);
          break;
        default:
          break;
      }
      if (newGroupRequest != null) {
        _this.requests.push(newGroupRequest);
      }
    });
  };
  _proto.addAdditionalKeywordsRequest = function addAdditionalKeywordsRequest(additionalKeywords) {
    if (additionalKeywords && additionalKeywords.length) {
      var newGroupRequest = new SearchEngineRequestConfigV5(GOOGLE_SEARCH_SOURCE_CODE, true, false, true, ["en", "de", "fr", "es", "it"], null, additionalKeywords, "", "");
      this.requests.push(newGroupRequest);
    }
  };
  _proto.getId = function getId() {
    return this.id;
  };
  _proto.getPriority = function getPriority() {
    return this.priority;
  };
  _proto.getResultsCount = function getResultsCount() {
    return this.resultsCount;
  };
  _proto.getMaxResultsCount = function getMaxResultsCount() {
    return this.maxResultsCount;
  };
  _proto.getMinRiskScore = function getMinRiskScore() {
    return this.minRiskScore;
  };
  _proto.getById = function getById(requestObjectId) {
    return this.requests.find(function (request) {
      return request.getId() === requestObjectId;
    });
  };
  _proto.getAllRequests = function getAllRequests() {
    return this.requests;
  };
  _proto.getAllRequestsByType = function getAllRequestsByType(type, isBatch, fastProcessing) {
    return this.requests.filter(function (request) {
      return request.getType() === type && (fastProcessing ? request.checkIsFastProcessing() : true) && (isBatch ? request.checkIsBatchProcessing() : request.checkIsSingleProcessing());
    });
  };
  _proto.destroy = function destroy() {
    this.requests.forEach(function (req) {
      req.destroy();
    });
    this.requests = [];
  };
  return RequestsGroupConfigV5;
}();
module.exports = {
  RequestsGroupConfigV5: RequestsGroupConfigV5
};

},{"../../../common/utils/common-v4":687,"../../../constants/source-types":697,"./aleph-occrp-request-config-v5":819,"./extra-source-request-config-v5":820,"./google-news-request-config-v5":821,"./open-corporates-request-config-v5":823,"./open-sanctions-request-config-v5":824,"./search-engine-request-config-v5":827,"./stock-market-request-config-v5":833}],827:[function(require,module,exports){
"use strict";

function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
var _require = require("./request-config-v5"),
  RequestConfigV5 = _require.RequestConfigV5;
var _require2 = require("./search-engine"),
  SearchEngineRequestKeywordsDetailsConfigV5 = _require2.SearchEngineRequestKeywordsDetailsConfigV5,
  SearchEngineRequestTmpltDetailsConfigV5 = _require2.SearchEngineRequestTmpltDetailsConfigV5,
  SearchEngineRequestAdditionalKeywordsConfigV5 = _require2.SearchEngineRequestAdditionalKeywordsConfigV5;
var SearchEngineRequestConfigV5 = function (_RequestConfigV) {
  function SearchEngineRequestConfigV5(type, isSingleProcessing, isBatchProcessing, isFastProcessing, expectedResultLanguages, request, additionalKeywords, after, before) {
    var _this;
    _this = _RequestConfigV.call(this, type, isSingleProcessing, isBatchProcessing, isFastProcessing, expectedResultLanguages, after, before) || this;
    _this.searchConfig = null;
    if (request) {
      if (request.request_parts) {
        _this.searchConfig = new SearchEngineRequestKeywordsDetailsConfigV5();
        _this.searchConfig.init(request.request_parts);
        _this.searchConfig.setKeywords(request.specific_keywords || [], request.banned_keywords || [], request.score_decrease_keywords || []);
        _this.searchConfig.setLanguages(request.languages || []);
      }
      if (request.request) {
        _this.searchConfig = new SearchEngineRequestTmpltDetailsConfigV5();
        _this.searchConfig.init(request.request, request.riskscore);
        _this.searchConfig.setKeywords(request.specific_keywords || [], request.banned_keywords || [], request.score_decrease_keywords || []);
        _this.searchConfig.setLanguages(request.languages || []);
      }
    }
    if (additionalKeywords && additionalKeywords.length) {
      _this.searchConfig = new SearchEngineRequestAdditionalKeywordsConfigV5();
      _this.searchConfig.init(additionalKeywords);
      _this.searchConfig.setKeywords([], [], []);
      _this.searchConfig.setLanguages([]);
    }
    return _this;
  }
  _inheritsLoose(SearchEngineRequestConfigV5, _RequestConfigV);
  var _proto = SearchEngineRequestConfigV5.prototype;
  _proto.getSearchConfig = function getSearchConfig() {
    return this.searchConfig;
  };
  _proto.destroy = function destroy() {
    var _this$searchConfig;
    (_this$searchConfig = this.searchConfig) == null || _this$searchConfig.destroy();
    this.searchConfig = null;
  };
  return SearchEngineRequestConfigV5;
}(RequestConfigV5);
module.exports = {
  SearchEngineRequestConfigV5: SearchEngineRequestConfigV5
};

},{"./request-config-v5":825,"./search-engine":828}],828:[function(require,module,exports){
"use strict";

var _require = require("./search-engine-request-addit-keywords-config-v5"),
  SearchEngineRequestAdditionalKeywordsConfigV5 = _require.SearchEngineRequestAdditionalKeywordsConfigV5;
var _require2 = require("./search-engine-request-details-config-v5"),
  SearchEngineRequestDetailsConfigV5 = _require2.SearchEngineRequestDetailsConfigV5;
var _require3 = require("./search-engine-request-keywords-details-config-v5"),
  SearchEngineRequestKeywordsDetailsConfigV5 = _require3.SearchEngineRequestKeywordsDetailsConfigV5;
var _require4 = require("./search-engine-request-tmplt-details-config-v5"),
  SearchEngineRequestTmpltDetailsConfigV5 = _require4.SearchEngineRequestTmpltDetailsConfigV5;
module.exports = {
  SearchEngineRequestAdditionalKeywordsConfigV5: SearchEngineRequestAdditionalKeywordsConfigV5,
  SearchEngineRequestDetailsConfigV5: SearchEngineRequestDetailsConfigV5,
  SearchEngineRequestKeywordsDetailsConfigV5: SearchEngineRequestKeywordsDetailsConfigV5,
  SearchEngineRequestTmpltDetailsConfigV5: SearchEngineRequestTmpltDetailsConfigV5
};

},{"./search-engine-request-addit-keywords-config-v5":829,"./search-engine-request-details-config-v5":830,"./search-engine-request-keywords-details-config-v5":831,"./search-engine-request-tmplt-details-config-v5":832}],829:[function(require,module,exports){
"use strict";

function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
var _require = require("./search-engine-request-details-config-v5"),
  SearchEngineRequestDetailsConfigV5 = _require.SearchEngineRequestDetailsConfigV5;
var _require2 = require("../../keywords"),
  SearchEngineKeywordConfigV4 = _require2.SearchEngineKeywordConfigV4;
var SearchEngineRequestAdditionalKeywordsConfigV5 = function (_SearchEngineRequestD) {
  function SearchEngineRequestAdditionalKeywordsConfigV5() {
    var _this;
    _this = _SearchEngineRequestD.call(this) || this;
    _this.mandatoryKeywords = [];
    _this.optionalKeywords = [];
    _this.commonKeywords = [];
    return _this;
  }
  _inheritsLoose(SearchEngineRequestAdditionalKeywordsConfigV5, _SearchEngineRequestD);
  var _proto = SearchEngineRequestAdditionalKeywordsConfigV5.prototype;
  _proto.init = function init(additionalKeywords) {
    var _this2 = this;
    (additionalKeywords || []).filter(function (addKeyword) {
      return !Number.isNaN(parseFloat(addKeyword.riskscore));
    }).forEach(function (addKeyword) {
      var newKeywordConfig = new SearchEngineKeywordConfigV4(addKeyword.keyword, parseFloat(addKeyword.riskscore), addKeyword.type === "mandatory");
      if (newKeywordConfig.checkIsMandatory()) {
        _this2.mandatoryKeywords.push(newKeywordConfig);
      } else {
        _this2.optionalKeywords.push(newKeywordConfig);
      }
      _this2.commonKeywords.push(newKeywordConfig);
    });
    this.setRiskScore(1);
  };
  _proto.getAllKeywords = function getAllKeywords() {
    return this.commonKeywords.concat(this.specificKeywords);
  };
  _proto.getCombinedKeywordsQueryPart = function getCombinedKeywordsQueryPart() {
    var queryPart = "";
    var mandatoryKeywordsPart = "";
    var optionalKeywordsPart = "";
    if (this.mandatoryKeywords.length) {
      var partKeywords = this.mandatoryKeywords.map(function (keywordConfig) {
        return keywordConfig.getKeyword().split(" ").length > 1 ? "\"" + keywordConfig.getKeyword() + "\"" : keywordConfig.getKeyword();
      });
      mandatoryKeywordsPart += "(" + partKeywords.join(" AND ") + ")";
    }
    if (this.optionalKeywords.length) {
      var _partKeywords = this.optionalKeywords.map(function (keywordConfig) {
        return keywordConfig.getKeyword().split(" ").length > 1 ? "\"" + keywordConfig.getKeyword() + "\"" : keywordConfig.getKeyword();
      });
      optionalKeywordsPart += "(" + _partKeywords.join(" OR ") + ")";
    }
    if (mandatoryKeywordsPart.length && optionalKeywordsPart.length) {
      queryPart = mandatoryKeywordsPart + " AND " + optionalKeywordsPart;
    } else if (mandatoryKeywordsPart.length) {
      queryPart = mandatoryKeywordsPart;
    } else {
      queryPart = optionalKeywordsPart;
    }
    return queryPart;
  };
  _proto.destroy = function destroy() {
    _SearchEngineRequestD.prototype.destroy.call(this);
    this.mandatoryKeywords = [];
    this.optionalKeywords = [];
    this.commonKeywords = [];
  };
  return SearchEngineRequestAdditionalKeywordsConfigV5;
}(SearchEngineRequestDetailsConfigV5);
module.exports = {
  SearchEngineRequestAdditionalKeywordsConfigV5: SearchEngineRequestAdditionalKeywordsConfigV5
};

},{"../../keywords":811,"./search-engine-request-details-config-v5":830}],830:[function(require,module,exports){
"use strict";

var _require = require("../../../../common/utils/common-v4"),
  generateUUID = _require.generateUUID;
var _require2 = require("../../keywords"),
  SearchEngineKeywordConfigV4 = _require2.SearchEngineKeywordConfigV4;
var SearchEngineRequestDetailsConfigV5 = function () {
  function SearchEngineRequestDetailsConfigV5() {
    this.id = generateUUID();
    this.specificKeywords = [];
    this.bannedKeywords = [];
    this.scoreDecreaseKeywords = [];
    this.riskScore = 0;
    this.languages = [];
  }
  var _proto = SearchEngineRequestDetailsConfigV5.prototype;
  _proto.getId = function getId() {
    return this.id;
  };
  _proto.setKeywords = function setKeywords(specificKeywords, bannedKeywords, scoreDecreaseKeywords) {
    var _this = this;
    (specificKeywords || []).forEach(function (config) {
      (config.keywords || []).forEach(function (specKeyword) {
        var newKeywordConfig = new SearchEngineKeywordConfigV4(specKeyword, config.riskscore || 0.5, false);
        _this.specificKeywords.push(newKeywordConfig);
      });
    });
    (bannedKeywords || []).forEach(function (config) {
      (config.keywords || []).forEach(function (bannedKeyword) {
        var newKeywordConfig = new SearchEngineKeywordConfigV4(bannedKeyword, config.riskscore || 0.5, false);
        _this.bannedKeywords.push(newKeywordConfig);
      });
    });
    (scoreDecreaseKeywords || []).forEach(function (decreaseKeyword) {
      var newKeywordConfig = new SearchEngineKeywordConfigV4(decreaseKeyword, 0, false);
      _this.scoreDecreaseKeywords.push(newKeywordConfig);
    });
  };
  _proto.getAllKeywords = function getAllKeywords() {
    return this.specificKeywords;
  };
  _proto.getBannedKeywords = function getBannedKeywords() {
    return this.bannedKeywords;
  };
  _proto.getScoreDecreaseKeywords = function getScoreDecreaseKeywords() {
    return this.scoreDecreaseKeywords;
  };
  _proto.setRiskScore = function setRiskScore(riskScore) {
    this.riskScore = riskScore;
  };
  _proto.getRiskScore = function getRiskScore() {
    return this.riskScore;
  };
  _proto.setLanguages = function setLanguages(languages) {
    this.languages = languages;
  };
  _proto.getLanguages = function getLanguages() {
    return this.languages;
  };
  _proto.destroy = function destroy() {
    this.id = "";
    this.specificKeywords = [];
    this.bannedKeywords = [];
    this.scoreDecreaseKeywords = [];
    this.riskScore = 0;
    this.languages = [];
  };
  return SearchEngineRequestDetailsConfigV5;
}();
module.exports = {
  SearchEngineRequestDetailsConfigV5: SearchEngineRequestDetailsConfigV5
};

},{"../../../../common/utils/common-v4":687,"../../keywords":811}],831:[function(require,module,exports){
"use strict";

function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
var _require = require("./search-engine-request-details-config-v5"),
  SearchEngineRequestDetailsConfigV5 = _require.SearchEngineRequestDetailsConfigV5;
var _require2 = require("../../keywords"),
  SearchEngineKeywordConfigV4 = _require2.SearchEngineKeywordConfigV4;
var SearchEngineRequestKeywordsDetailsConfigV5 = function (_SearchEngineRequestD) {
  function SearchEngineRequestKeywordsDetailsConfigV5() {
    var _this;
    _this = _SearchEngineRequestD.call(this) || this;
    _this.partsConfigs = [];
    _this.commonKeywords = [];
    return _this;
  }
  _inheritsLoose(SearchEngineRequestKeywordsDetailsConfigV5, _SearchEngineRequestD);
  var _proto = SearchEngineRequestKeywordsDetailsConfigV5.prototype;
  _proto.init = function init(partsConfigs) {
    var _this2 = this;
    (partsConfigs || []).forEach(function (part) {
      if (part && part.optional_keywords && Array.isArray(part.optional_keywords) && part.optional_keywords.length) {
        _this2.partsConfigs.push(part);
      }
    });
    this.partsConfigs.forEach(function (partConfig) {
      (partConfig.optional_keywords || []).forEach(function (optionalPart) {
        (optionalPart.keywords || []).forEach(function (keyword) {
          var newKeywordConfig = new SearchEngineKeywordConfigV4(keyword, optionalPart.riskscore || 0.5, false);
          _this2.commonKeywords.push(newKeywordConfig);
        });
      });
    });
    var allKeywordsCount = 0;
    var allPartsConfigScore = 0;
    this.partsConfigs.forEach(function (partConfig) {
      (partConfig.optional_keywords || []).forEach(function (optionalPart) {
        allPartsConfigScore += (optionalPart.keywords || []).length * (optionalPart.riskscore || 0.5);
        allKeywordsCount += (optionalPart.keywords || []).length;
      });
    });
    this.setRiskScore(allPartsConfigScore / (allKeywordsCount || 1));
  };
  _proto.getAllKeywords = function getAllKeywords() {
    return this.commonKeywords.concat(this.specificKeywords);
  };
  _proto.getCombinedKeywordsQueryPart = function getCombinedKeywordsQueryPart() {
    return this.partsConfigs.map(function (partConfig) {
      var allPartKeywords = [];
      partConfig.optional_keywords.forEach(function (optionalPart) {
        allPartKeywords = allPartKeywords.concat(optionalPart.keywords);
      });
      var partKeywords = allPartKeywords.map(function (keyword) {
        return keyword.split(" ").length > 1 ? "\"" + keyword + "\"" : keyword;
      });
      return "(" + partKeywords.join(" OR ") + ")";
    }).join(" AND ");
  };
  _proto.destroy = function destroy() {
    _SearchEngineRequestD.prototype.destroy.call(this);
    this.partsConfigs = [];
    this.commonKeywords = [];
  };
  return SearchEngineRequestKeywordsDetailsConfigV5;
}(SearchEngineRequestDetailsConfigV5);
module.exports = {
  SearchEngineRequestKeywordsDetailsConfigV5: SearchEngineRequestKeywordsDetailsConfigV5
};

},{"../../keywords":811,"./search-engine-request-details-config-v5":830}],832:[function(require,module,exports){
"use strict";

function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
var _require = require("./search-engine-request-details-config-v5"),
  SearchEngineRequestDetailsConfigV5 = _require.SearchEngineRequestDetailsConfigV5;
var SearchEngineRequestTmpltDetailsConfigV5 = function (_SearchEngineRequestD) {
  function SearchEngineRequestTmpltDetailsConfigV5() {
    var _this;
    _this = _SearchEngineRequestD.call(this) || this;
    _this.requestTmplt = "";
    return _this;
  }
  _inheritsLoose(SearchEngineRequestTmpltDetailsConfigV5, _SearchEngineRequestD);
  var _proto = SearchEngineRequestTmpltDetailsConfigV5.prototype;
  _proto.init = function init(requestTmplt, requestRiskScore) {
    this.requestTmplt = requestTmplt || "";
    this.setRiskScore(requestRiskScore || 0.5);
  };
  _proto.getAllKeywords = function getAllKeywords() {
    return this.specificKeywords;
  };
  _proto.getRequestTmplt = function getRequestTmplt() {
    return this.requestTmplt;
  };
  _proto.destroy = function destroy() {
    _SearchEngineRequestD.prototype.destroy.call(this);
    this.requestTmplt = "";
  };
  return SearchEngineRequestTmpltDetailsConfigV5;
}(SearchEngineRequestDetailsConfigV5);
module.exports = {
  SearchEngineRequestTmpltDetailsConfigV5: SearchEngineRequestTmpltDetailsConfigV5
};

},{"./search-engine-request-details-config-v5":830}],833:[function(require,module,exports){
"use strict";

function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
var _require = require("./request-config-v5"),
  RequestConfigV5 = _require.RequestConfigV5;
var StockMarketRequestConfigV5 = function (_RequestConfigV) {
  function StockMarketRequestConfigV5(type, isSingleProcessing, isBatchProcessing, isFastProcessing, sites, after, before) {
    var _this;
    _this = _RequestConfigV.call(this, type, isSingleProcessing, isBatchProcessing, isFastProcessing, [], after, before) || this;
    _this.sites = sites || [];
    return _this;
  }
  _inheritsLoose(StockMarketRequestConfigV5, _RequestConfigV);
  var _proto = StockMarketRequestConfigV5.prototype;
  _proto.getSites = function getSites() {
    return this.sites;
  };
  return StockMarketRequestConfigV5;
}(RequestConfigV5);
module.exports = {
  StockMarketRequestConfigV5: StockMarketRequestConfigV5
};

},{"./request-config-v5":825}],834:[function(require,module,exports){
"use strict";

var _require = require("./media-search-person-request-v1"),
  MediaSearchPersonRequestV1 = _require.MediaSearchPersonRequestV1;
var _require2 = require("./media-search-request-v1"),
  MediaSearchRequestV1 = _require2.MediaSearchRequestV1;
module.exports = {
  MediaSearchPersonRequestV1: MediaSearchPersonRequestV1,
  MediaSearchRequestV1: MediaSearchRequestV1
};

},{"./media-search-person-request-v1":835,"./media-search-request-v1":836}],835:[function(require,module,exports){
"use strict";

var _require = require("../../../common/utils/common-v4"),
  generateUUID = _require.generateUUID;
var MediaSearchPersonRequestV1 = function () {
  function MediaSearchPersonRequestV1(person, parentPerson, requestConfig, requestObject, groupObject) {
    this.id = generateUUID();
    this.person = person;
    this.parentPerson = parentPerson;
    this.requestConfig = requestConfig;
    this.requestObject = requestObject;
    this.groupObject = groupObject;
  }
  var _proto = MediaSearchPersonRequestV1.prototype;
  _proto.getId = function getId() {
    return this.id;
  };
  _proto.getPerson = function getPerson() {
    return this.person;
  };
  _proto.getPersonId = function getPersonId() {
    var _this$person;
    return (_this$person = this.person) == null ? void 0 : _this$person.getId();
  };
  _proto.getParentPerson = function getParentPerson() {
    return this.parentPerson;
  };
  _proto.getParentPersonId = function getParentPersonId() {
    var _this$parentPerson;
    return (_this$parentPerson = this.parentPerson) == null ? void 0 : _this$parentPerson.getId();
  };
  _proto.getRequest = function getRequest() {
    return this.requestConfig;
  };
  _proto.getRequestId = function getRequestId() {
    var _this$requestConfig;
    return (_this$requestConfig = this.requestConfig) == null ? void 0 : _this$requestConfig.getId();
  };
  _proto.getRequestRiskScore = function getRequestRiskScore() {
    var _this$requestConfig2;
    return (_this$requestConfig2 = this.requestConfig) == null ? void 0 : _this$requestConfig2.getRiskScore();
  };
  _proto.getRequestObject = function getRequestObject() {
    return this.requestObject;
  };
  _proto.getRequestObjectId = function getRequestObjectId() {
    return this.requestObject ? this.requestObject.getId() : null;
  };
  _proto.getGroupObject = function getGroupObject() {
    return this.groupObject;
  };
  _proto.getGroupObjectId = function getGroupObjectId() {
    return this.groupObject ? this.groupObject.getId() : null;
  };
  _proto.clear = function clear() {
    this.person = null;
    this.parentPerson = null;
    this.requestConfig = null;
    this.requestObject = null;
    this.groupObject = null;
  };
  return MediaSearchPersonRequestV1;
}();
module.exports = {
  MediaSearchPersonRequestV1: MediaSearchPersonRequestV1
};

},{"../../../common/utils/common-v4":687}],836:[function(require,module,exports){
"use strict";

var _require = require("../../../common/utils/common-v4"),
  generateUUID = _require.generateUUID;
var MediaSearchRequestV1 = function () {
  function MediaSearchRequestV1(baseUrl, url, personServiceId, person, parentPerson, requestConfig, sortBy, offset, riskScore, isWithCountiesKeywords, executionId, requestObjectId, groupObjectId, scoreMode, userCountry, counter) {
    this.id = generateUUID();
    this.baseUrl = baseUrl;
    this.url = url;
    this.personServiceId = personServiceId;
    this.person = person;
    this.parentPerson = parentPerson;
    this.requestConfig = requestConfig;
    this.sortBy = sortBy;
    this.offset = offset;
    this.riskScore = riskScore;
    this.isWithCountiesKeywords = isWithCountiesKeywords;
    this.executionId = executionId;
    this.requestObjectId = requestObjectId;
    this.groupObjectId = groupObjectId;
    this.scoreMode = scoreMode;
    this.userCountry = userCountry;
    this.counter = counter;
    this.isProcessing = false;
    this.isProcessed = false;
    this.personId = person.getId();
    this.parentPersonId = parentPerson.getId();
    this.requestConfigId = requestConfig.getId();
    this.startTime = 0;
    this.finishTime = 0;
  }
  var _proto = MediaSearchRequestV1.prototype;
  _proto.getId = function getId() {
    return this.id;
  };
  _proto.getBaseUrl = function getBaseUrl() {
    return this.baseUrl;
  };
  _proto.getUrl = function getUrl() {
    return this.url;
  };
  _proto.getPersonServiceId = function getPersonServiceId() {
    return this.personServiceId;
  };
  _proto.getPerson = function getPerson() {
    return this.person;
  };
  _proto.getPersonId = function getPersonId() {
    return this.personId;
  };
  _proto.getParentPerson = function getParentPerson() {
    return this.parentPerson;
  };
  _proto.getParentPersonId = function getParentPersonId() {
    return this.parentPersonId;
  };
  _proto.getRequestConfig = function getRequestConfig() {
    return this.requestConfig;
  };
  _proto.getRequestConfigId = function getRequestConfigId() {
    return this.requestConfigId;
  };
  _proto.getSortBy = function getSortBy() {
    return this.sortBy;
  };
  _proto.getOffset = function getOffset() {
    return this.offset;
  };
  _proto.getRiskScore = function getRiskScore() {
    return this.riskScore;
  };
  _proto.checkIsWithCountiesKeywords = function checkIsWithCountiesKeywords() {
    return this.isWithCountiesKeywords;
  };
  _proto.getExecutionId = function getExecutionId() {
    return this.executionId;
  };
  _proto.getRequestObjectId = function getRequestObjectId() {
    return this.requestObjectId;
  };
  _proto.getGroupObjectId = function getGroupObjectId() {
    return this.groupObjectId;
  };
  _proto.getScoreMode = function getScoreMode() {
    return this.scoreMode;
  };
  _proto.getUserCountry = function getUserCountry() {
    return this.userCountry;
  };
  _proto.incCounter = function incCounter() {
    this.counter++;
  };
  _proto.getCounter = function getCounter() {
    return this.counter;
  };
  _proto.setProcessing = function setProcessing(flag) {
    this.isProcessing = flag;
  };
  _proto.checkIsProcessing = function checkIsProcessing() {
    return this.isProcessing;
  };
  _proto.setProcessed = function setProcessed(flag) {
    this.isProcessed = flag;
  };
  _proto.checkIsProcessed = function checkIsProcessed() {
    return this.isProcessed;
  };
  _proto.setStartTime = function setStartTime(dateTime) {
    this.startTime = dateTime;
  };
  _proto.getStartTime = function getStartTime() {
    return this.startTime;
  };
  _proto.setFinishTime = function setFinishTime(dateTime) {
    this.finishTime = dateTime;
  };
  _proto.getFinishTime = function getFinishTime() {
    return this.finishTime;
  };
  _proto.clear = function clear() {
    this.person = null;
    this.parentPerson = null;
    this.requestConfig = null;
  };
  return MediaSearchRequestV1;
}();
module.exports = {
  MediaSearchRequestV1: MediaSearchRequestV1
};

},{"../../../common/utils/common-v4":687}],837:[function(require,module,exports){
"use strict";

function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
var moment = require("moment");
var _require = require("./media-py-gpt-result-item-v1"),
  MediaPyGptResultItemV1 = _require.MediaPyGptResultItemV1;
var AlephOccrpResultItemV1 = function (_MediaPyGptResultItem) {
  function AlephOccrpResultItemV1(title, description, linkUrl, date, type) {
    var _this;
    _this = _MediaPyGptResultItem.call(this, title, title, description, description, linkUrl, null, type) || this;
    _this.entityType = "";
    var parsedDate = null;
    if (date) {
      try {
        parsedDate = moment(date);
      } catch (e) {}
    }
    _this.date = parsedDate ? parsedDate.toDate() : null;
    return _this;
  }
  _inheritsLoose(AlephOccrpResultItemV1, _MediaPyGptResultItem);
  var _proto = AlephOccrpResultItemV1.prototype;
  _proto.setEntityType = function setEntityType(type) {
    this.entityType = type;
  };
  _proto.checkIsPersonType = function checkIsPersonType() {
    return this.entityType === "Person";
  };
  _proto.checkIsDocumentType = function checkIsDocumentType() {
    return this.entityType === "Document";
  };
  _proto.checkIsCompanyType = function checkIsCompanyType() {
    return this.entityType === "Company";
  };
  _proto.setTotalRiskScore = function setTotalRiskScore(totalRiskScore, isPersonNamePresented) {
    var riskScore = totalRiskScore;
    if (isPersonNamePresented) {
      riskScore += 0.05;
    } else {
      riskScore -= 0.1;
    }
    this.setRiskScore(riskScore);
    this.setInitialRiskScore(riskScore);
  };
  return AlephOccrpResultItemV1;
}(MediaPyGptResultItemV1);
module.exports = {
  AlephOccrpResultItemV1: AlephOccrpResultItemV1
};

},{"./media-py-gpt-result-item-v1":845,"moment":680}],838:[function(require,module,exports){
"use strict";

var _require = require("../../../common/utils/common-v4"),
  generateUUID = _require.generateUUID,
  getDomain = _require.getDomain;
var _require2 = require("../../../constants/source-types"),
  GOOGLE_SEARCH_SOURCE_CODE = _require2.GOOGLE_SEARCH_SOURCE_CODE,
  GOOGLE_NEWS_SOURCE_CODE = _require2.GOOGLE_NEWS_SOURCE_CODE,
  EXTRA_SOURCE_SOURCE_CODE = _require2.EXTRA_SOURCE_SOURCE_CODE,
  STOCK_MARKETS_SOURCE_CODE = _require2.STOCK_MARKETS_SOURCE_CODE,
  ALEPH_OCCRP_SOURCE_CODE = _require2.ALEPH_OCCRP_SOURCE_CODE,
  OPEN_SANCTIONS_SOURCE_CODE = _require2.OPEN_SANCTIONS_SOURCE_CODE,
  OPEN_CORPORATES_SOURCE_CODE = _require2.OPEN_CORPORATES_SOURCE_CODE;
var BaseResultItemV1 = function () {
  function BaseResultItemV1(title, titleHtml, description, descriptionHtml, linkUrl, date, type) {
    this.id = generateUUID();
    this.title = title;
    this.titleHtml = titleHtml;
    this.description = description;
    this.descriptionHtml = descriptionHtml;
    this.linkUrl = linkUrl;
    this.date = date;
    this.type = type;
    this.isFromSearchEngine = type === GOOGLE_SEARCH_SOURCE_CODE;
    this.isFromGoogleNewsRss = type === GOOGLE_NEWS_SOURCE_CODE;
    this.isFromStockMarket = type === STOCK_MARKETS_SOURCE_CODE;
    this.isFromExtraSource = type === EXTRA_SOURCE_SOURCE_CODE;
    this.isFromAlephOccrp = type === ALEPH_OCCRP_SOURCE_CODE;
    this.isFromOpenSanctions = type === OPEN_SANCTIONS_SOURCE_CODE;
    this.isFromOpenCorporates = type === OPEN_CORPORATES_SOURCE_CODE;
    this.isFromMatch = false;
    this.isFromRelevant = false;
    this.domain = getDomain(linkUrl);
    this.itemInfo = {
      itemId: ""
    };
    this.isOpen = false;
    this.isRelevant = false;
    this.isSelectedForGraph = false;
    this.initialRiskScore = 0;
    this.riskScore = 0;
    this.isRiskScored = false;
    this.language = null;
    this.tryLoadCounter = 0;
    this.isShouldBePublished = true;
    this.performanceMetrics = {
      get: {
        load: {}
      },
      mediaPy: {
        cleanHtml: {},
        textInfo: {},
        entities: {},
        analyzeText: {},
        specialParsing: {},
        markup: {},
        summarizeText: {},
        classifyText: {},
        total: {}
      },
      mediaPyGpt: {
        checkIsPersonMatch: {},
        riskAssesment: {},
        documentAnalysis: {},
        documentCompression: {},
        personSummary: {},
        relatedEntities: {},
        personMatching: {},
        negativeContextAnalysis: {},
        chainRiskAssessment: {},
        total: {}
      },
      mediaPyLLM: {
        textAnalysis: {},
        total: {}
      }
    };
    this.__version__ = "1.0";
  }
  var _proto = BaseResultItemV1.prototype;
  _proto.setPerformanceMetric = function setPerformanceMetric(sourceType, metricType, httpRespStatusCode, elapsedTime, usageInfo) {
    if (this.performanceMetrics && this.performanceMetrics[sourceType] && this.performanceMetrics[sourceType][metricType] && !this.performanceMetrics[sourceType][metricType][httpRespStatusCode]) {
      this.performanceMetrics[sourceType][metricType][httpRespStatusCode] = {
        usageInfo: usageInfo,
        time: elapsedTime
      };
    }
  };
  _proto.getPerformanceMetrics = function getPerformanceMetrics() {
    return this.performanceMetrics;
  };
  _proto.clearPerformanceMetrics = function clearPerformanceMetrics() {
    var _this = this;
    Object.keys(this.performanceMetrics).forEach(function (sourceType) {
      Object.keys(_this.performanceMetrics[sourceType]).forEach(function (metricType) {
        Object.keys(_this.performanceMetrics[sourceType][metricType]).forEach(function (httpRespStatusCode) {
          Object.keys(_this.performanceMetrics[sourceType][metricType][httpRespStatusCode]).forEach(function (reqInfo) {
            delete _this.performanceMetrics[sourceType][metricType][httpRespStatusCode][reqInfo];
          });
          delete _this.performanceMetrics[sourceType][metricType][httpRespStatusCode];
        });
        delete _this.performanceMetrics[sourceType][metricType];
      });
      delete _this.performanceMetrics[sourceType];
    });
    this.performanceMetrics = {};
  };
  _proto.getType = function getType() {
    return this.type;
  };
  _proto.getId = function getId() {
    return this.id;
  };
  _proto.getTitle = function getTitle() {
    return this.title;
  };
  _proto.getTitleHtml = function getTitleHtml() {
    return this.titleHtml;
  };
  _proto.setDescription = function setDescription(description) {
    this.description = description;
  };
  _proto.getDescription = function getDescription() {
    return this.description;
  };
  _proto.setDescriptionHtml = function setDescriptionHtml(descriptionHtml) {
    this.descriptionHtml = descriptionHtml;
  };
  _proto.getDescriptionHtml = function getDescriptionHtml() {
    return this.descriptionHtml;
  };
  _proto.getLinkUrl = function getLinkUrl() {
    return this.linkUrl;
  };
  _proto.getDomain = function getDomain() {
    return this.domain;
  };
  _proto.getDate = function getDate() {
    return this.date;
  };
  _proto.setDate = function setDate(date) {
    this.date = date;
  };
  _proto.setLanguage = function setLanguage(language) {
    this.language = language;
  };
  _proto.getLanguage = function getLanguage() {
    return this.language;
  };
  _proto.getTryLoadCounter = function getTryLoadCounter() {
    return this.tryLoadCounter;
  };
  _proto.incTryLoadCounter = function incTryLoadCounter() {
    this.tryLoadCounter++;
  };
  _proto.setRelevant = function setRelevant(isRelevant) {
    this.isRelevant = isRelevant;
  };
  _proto.checkIsRelevant = function checkIsRelevant() {
    return this.isRelevant;
  };
  _proto.setOpen = function setOpen(isOpen) {
    this.isOpen = isOpen;
  };
  _proto.checkIsOpen = function checkIsOpen() {
    return this.isOpen;
  };
  _proto.setInitialRiskScore = function setInitialRiskScore(initialRiskScore) {
    this.initialRiskScore = initialRiskScore > 1 ? 1 : initialRiskScore < 0 ? 0 : initialRiskScore;
  };
  _proto.getInitialRiskScore = function getInitialRiskScore() {
    return this.initialRiskScore;
  };
  _proto.setRiskScore = function setRiskScore(riskScore) {
    this.riskScore = riskScore > 1 ? 1 : riskScore < 0 ? 0 : riskScore;
  };
  _proto.getRiskScore = function getRiskScore() {
    return this.riskScore;
  };
  _proto.setRiskScored = function setRiskScored(flag) {
    this.isRiskScored = flag;
  };
  _proto.checkIsRiskScored = function checkIsRiskScored() {
    return this.isRiskScored;
  };
  _proto.setItemInfo = function setItemInfo(itemId) {
    this.itemInfo.itemId = itemId;
  };
  _proto.getItemId = function getItemId() {
    return this.itemInfo.itemId;
  };
  _proto.setShouldBePublished = function setShouldBePublished(shouldBePublished) {
    this.isShouldBePublished = shouldBePublished;
  };
  _proto.checkShouldBePublished = function checkShouldBePublished() {
    return this.isShouldBePublished;
  };
  _proto.checkIsFromSearchEngine = function checkIsFromSearchEngine() {
    return this.type === GOOGLE_SEARCH_SOURCE_CODE;
  };
  _proto.checkIsFromGoogleNewsRss = function checkIsFromGoogleNewsRss() {
    return this.type === GOOGLE_NEWS_SOURCE_CODE;
  };
  _proto.checkIsFromExtraSource = function checkIsFromExtraSource() {
    return this.type === EXTRA_SOURCE_SOURCE_CODE;
  };
  _proto.checkIsFromStockMarket = function checkIsFromStockMarket() {
    return this.type === STOCK_MARKETS_SOURCE_CODE;
  };
  _proto.checkIsFromAlephOccrp = function checkIsFromAlephOccrp() {
    return this.type === ALEPH_OCCRP_SOURCE_CODE;
  };
  _proto.checkIsFromOpenSanctions = function checkIsFromOpenSanctions() {
    return this.type === OPEN_SANCTIONS_SOURCE_CODE;
  };
  _proto.checkIsFromOpenCorporates = function checkIsFromOpenCorporates() {
    return this.type === OPEN_CORPORATES_SOURCE_CODE;
  };
  _proto.checkIsFromMatch = function checkIsFromMatch() {
    return this.isFromMatch;
  };
  _proto.setFromRelevant = function setFromRelevant(isFromRelevant) {
    this.isFromRelevant = isFromRelevant;
  };
  _proto.checkIsFromRelevant = function checkIsFromRelevant() {
    return this.isFromRelevant;
  };
  return BaseResultItemV1;
}();
module.exports = {
  BaseResultItemV1: BaseResultItemV1
};

},{"../../../common/utils/common-v4":687,"../../../constants/source-types":697}],839:[function(require,module,exports){
"use strict";

function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
var _require = require("./base-result-item-v1"),
  BaseResultItemV1 = _require.BaseResultItemV1;
var ContentResultItemV1 = function (_BaseResultItemV) {
  function ContentResultItemV1(title, titleHtml, description, descriptionHtml, linkUrl, date, type) {
    var _this;
    _this = _BaseResultItemV.call(this, title, titleHtml, description, descriptionHtml, linkUrl, date, type) || this;
    _this.contentHtml = undefined;
    _this.contentElement = undefined;
    _this.contentElementText = undefined;
    return _this;
  }
  _inheritsLoose(ContentResultItemV1, _BaseResultItemV);
  var _proto = ContentResultItemV1.prototype;
  _proto.setContentHtml = function setContentHtml(contentHtml) {
    this.contentHtml = contentHtml;
  };
  _proto.getContentHtml = function getContentHtml() {
    return this.contentHtml;
  };
  _proto.checkIsContentHtmlLoaded = function checkIsContentHtmlLoaded() {
    return this.contentHtml !== undefined && this.contentHtml !== null;
  };
  _proto.setContentElement = function setContentElement(contentElement) {
    this.contentElement = contentElement;
  };
  _proto.getContentElement = function getContentElement() {
    return this.contentElement;
  };
  _proto.setContentElementText = function setContentElementText(contentElementText) {
    this.contentElementText = contentElementText;
  };
  _proto.getContentElementText = function getContentElementText() {
    return this.contentElementText;
  };
  return ContentResultItemV1;
}(BaseResultItemV1);
module.exports = {
  ContentResultItemV1: ContentResultItemV1
};

},{"./base-result-item-v1":838}],840:[function(require,module,exports){
"use strict";

function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
var _require = require("./media-py-gpt-result-item-v1"),
  MediaPyGptResultItemV1 = _require.MediaPyGptResultItemV1;
var ExtraSourceResultItemV1 = function (_MediaPyGptResultItem) {
  function ExtraSourceResultItemV1(title, description, linkUrl, source, type) {
    var _this;
    _this = _MediaPyGptResultItem.call(this, title, title, description, description, linkUrl, null, type) || this;
    _this.source = source;
    _this.relevance = true;
    return _this;
  }
  _inheritsLoose(ExtraSourceResultItemV1, _MediaPyGptResultItem);
  var _proto = ExtraSourceResultItemV1.prototype;
  _proto.getSource = function getSource() {
    return this.source;
  };
  _proto.setRelevance = function setRelevance(relevance) {
    this.relevance = relevance;
  };
  _proto.getRelevance = function getRelevance() {
    return this.relevance;
  };
  _proto.checkIsShabResult = function checkIsShabResult() {
    return this.source === "shab";
  };
  return ExtraSourceResultItemV1;
}(MediaPyGptResultItemV1);
module.exports = {
  ExtraSourceResultItemV1: ExtraSourceResultItemV1
};

},{"./media-py-gpt-result-item-v1":845}],841:[function(require,module,exports){
"use strict";

function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
var moment = require("moment");
var _require = require("./media-py-gpt-result-item-v1"),
  MediaPyGptResultItemV1 = _require.MediaPyGptResultItemV1;
var GoogleNewsRssResultItemV1 = function (_MediaPyGptResultItem) {
  function GoogleNewsRssResultItemV1(title, description, linkUrl, date, type) {
    var _this;
    _this = _MediaPyGptResultItem.call(this, title, title, description, description, linkUrl, null, type) || this;
    var parsedDate = null;
    if (date) {
      try {
        parsedDate = moment(date);
      } catch (e) {}
    }
    _this.date = parsedDate ? parsedDate.toDate() : null;
    return _this;
  }
  _inheritsLoose(GoogleNewsRssResultItemV1, _MediaPyGptResultItem);
  var _proto = GoogleNewsRssResultItemV1.prototype;
  _proto.setTotalRiskScore = function setTotalRiskScore(totalRiskScore, isPersonNamePresented) {
    var riskScore = totalRiskScore;
    if (isPersonNamePresented) {
      riskScore += 0.05;
    } else {
      riskScore -= 0.1;
    }
    this.setRiskScore(riskScore);
    this.setInitialRiskScore(riskScore);
  };
  return GoogleNewsRssResultItemV1;
}(MediaPyGptResultItemV1);
module.exports = {
  GoogleNewsRssResultItemV1: GoogleNewsRssResultItemV1
};

},{"./media-py-gpt-result-item-v1":845,"moment":680}],842:[function(require,module,exports){
"use strict";

var _require = require("./aleph-occrp-result-item-v1"),
  AlephOccrpResultItemV1 = _require.AlephOccrpResultItemV1;
var _require2 = require("./extra-source-result-item-v1"),
  ExtraSourceResultItemV1 = _require2.ExtraSourceResultItemV1;
var _require3 = require("./google-news-result-item-v1"),
  GoogleNewsRssResultItemV1 = _require3.GoogleNewsRssResultItemV1;
var _require4 = require("./match-result-item-v1"),
  MatchResultItemV1 = _require4.MatchResultItemV1;
var _require5 = require("./open-corporates-result-item-v1"),
  OpenCorporatesResultItemV1 = _require5.OpenCorporatesResultItemV1;
var _require6 = require("./open-sanctions-result-item-v1"),
  OpenSanctionsResultItemV1 = _require6.OpenSanctionsResultItemV1;
var _require7 = require("./search-engine-result-item-v1"),
  SearchEngineResultItemV1 = _require7.SearchEngineResultItemV1;
var _require8 = require("./stock-market-result-item-v1"),
  StockMarketResultItemV1 = _require8.StockMarketResultItemV1;
var _require9 = require("./media-py-gpt-result-item-v1"),
  MediaPyGptResultItemV1 = _require9.MediaPyGptResultItemV1;
var _require10 = require("./media-py-llm-result-item-v1"),
  MediaPyLLMResultItemV1 = _require10.MediaPyLLMResultItemV1;
module.exports = {
  AlephOccrpResultItemV1: AlephOccrpResultItemV1,
  ExtraSourceResultItemV1: ExtraSourceResultItemV1,
  GoogleNewsRssResultItemV1: GoogleNewsRssResultItemV1,
  MatchResultItemV1: MatchResultItemV1,
  OpenCorporatesResultItemV1: OpenCorporatesResultItemV1,
  OpenSanctionsResultItemV1: OpenSanctionsResultItemV1,
  SearchEngineResultItemV1: SearchEngineResultItemV1,
  StockMarketResultItemV1: StockMarketResultItemV1,
  MediaPyGptResultItemV1: MediaPyGptResultItemV1,
  MediaPyLLMResultItemV1: MediaPyLLMResultItemV1
};

},{"./aleph-occrp-result-item-v1":837,"./extra-source-result-item-v1":840,"./google-news-result-item-v1":841,"./match-result-item-v1":843,"./media-py-gpt-result-item-v1":845,"./media-py-llm-result-item-v1":846,"./open-corporates-result-item-v1":848,"./open-sanctions-result-item-v1":849,"./search-engine-result-item-v1":851,"./stock-market-result-item-v1":853}],843:[function(require,module,exports){
"use strict";

function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
var _require = require("./media-py-result-item-v1"),
  MediaPyResultItemV1 = _require.MediaPyResultItemV1;
var MatchResultItemV1 = function (_MediaPyResultItemV) {
  function MatchResultItemV1(title, description, linkUrl) {
    var _this;
    _this = _MediaPyResultItemV.call(this, title, title, description, description, linkUrl, null, "") || this;
    _this.isFromMatch = true;
    _this.matchItem = null;
    return _this;
  }
  _inheritsLoose(MatchResultItemV1, _MediaPyResultItemV);
  MatchResultItemV1.fromMatchPerson = function fromMatchPerson(data) {
    var firstName = data.matchItem.list["First_Name"] || "";
    var lastName = data.matchItem.list["Last_Name"] || "";
    var linkUrl = data.linkUrl + "&matchid=" + data.matchItem.id;
    var riskScore = data.matchItem["Similarity"] || 0;
    var description = data.matchItem.list["Case"] || "";
    if (data.matchItem.list["Function"]) {
      data.matchItem.list["Function"].split("; OTHER FUNCTION: ").forEach(function (row) {
        var func = ((row.split(" CATEGORY: ")[0] || "").split(" NOT IN CHARGE SINCE: ")[0] || "").trim();
        var category = (row.split(" CATEGORY: ")[1] || "").trim();
        var notInCharge = ((row.split(" CATEGORY: ")[0] || "").split(" NOT IN CHARGE SINCE: ")[1] || "").trim();
        if (description) {
          description += "\n\n";
        }
        description += func;
        description += "\n" + category;
        description += "\n" + notInCharge;
      });
    }
    var newMatchResult = new MatchResultItemV1(firstName + " " + lastName, description, linkUrl);
    newMatchResult.setRiskScore(riskScore);
    newMatchResult.setRiskScored(true);
    newMatchResult.setMediaPyRiskScore(riskScore);
    newMatchResult.setMediaPyRiskScored(true);
    newMatchResult.setMediaPyRiskScoreColor(riskScore, false);
    newMatchResult.setSentiment(0);
    newMatchResult.setSentimentLoaded(true);
    newMatchResult.setMediaPyTitleRiskScore(0);
    newMatchResult.setMediaPyTitleRiskScoreColor(0, false);
    newMatchResult.setMediaPyNameImportance(0);
    newMatchResult.setMediaPyNameImportanceColor(0, false);
    newMatchResult.setMatchItem(data.matchItem.list);
    return newMatchResult;
  };
  var _proto = MatchResultItemV1.prototype;
  _proto.setMatchItem = function setMatchItem(matchItem) {
    this.matchItem = matchItem;
  };
  _proto.getMatchItem = function getMatchItem() {
    return this.matchItem;
  };
  return MatchResultItemV1;
}(MediaPyResultItemV1);
module.exports = {
  MatchResultItemV1: MatchResultItemV1
};

},{"./media-py-result-item-v1":847}],844:[function(require,module,exports){
"use strict";

function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
var _require = require("../../../common/utils/comparisons-v4"),
  compareByName = _require.compareByName,
  compareByCount = _require.compareByCount,
  compareByBaseRisk = _require.compareByBaseRisk;
var _require2 = require("../../../common/utils/filters-v4"),
  onlyUnique = _require2.onlyUnique,
  onlyUniqueByName = _require2.onlyUniqueByName,
  onlyUniqueByNgram = _require2.onlyUniqueByNgram;
var _require3 = require("../../../common/utils/mappers-v4"),
  mapNamedEntity = _require3.mapNamedEntity;
var _require4 = require("./media-py-result-item-v1"),
  MediaPyResultItemV1 = _require4.MediaPyResultItemV1;
var MediaPyAnalyzeResultItemV1 = function (_MediaPyResultItemV) {
  function MediaPyAnalyzeResultItemV1(title, titleHtml, description, descriptionHtml, linkUrl, date, type) {
    var _this;
    _this = _MediaPyResultItemV.call(this, title, titleHtml, description, descriptionHtml, linkUrl, date, type) || this;
    _this.analyzeItems = {
      ngrams: [],
      keywords: [],
      riskKeywords: [],
      riskPersons: [],
      riskOrgs: []
    };
    _this.mentionedItems = {
      persons: {
        items: [],
        topCnt: 5
      },
      orgs: {
        items: [],
        topCnt: 5
      },
      locs: {
        items: [],
        topCnt: 5
      }
    };
    _this.isAnalyzed = false;
    _this.analyzeTopic = undefined;
    _this.analyzeTopicProbe = 0;
    return _this;
  }
  _inheritsLoose(MediaPyAnalyzeResultItemV1, _MediaPyResultItemV);
  var _proto = MediaPyAnalyzeResultItemV1.prototype;
  _proto.setIsAnalyzed = function setIsAnalyzed(isAnalyzed) {
    this.isAnalyzed = isAnalyzed;
  };
  _proto.checkIsAnalyzed = function checkIsAnalyzed() {
    return this.isAnalyzed;
  };
  _proto.setAnalyzeItems = function setAnalyzeItems(items, type) {
    if (type === "ngrams") {
      this.analyzeItems[type] = [].concat(items || []).filter(onlyUniqueByNgram).sort(compareByCount);
    }
    if (type === "keywords") {
      this.analyzeItems[type] = [].concat(items || []).filter(onlyUnique);
    }
    if (type === "riskKeywords") {
      this.analyzeItems[type] = [].concat(items || []).sort(compareByBaseRisk);
    }
    if (type === "riskPersons" || type === "riskOrgs") {
      this.analyzeItems[type] = [].concat(items || []).filter(onlyUniqueByName).sort(compareByName);
    }
  };
  _proto.getAnalyzeItems = function getAnalyzeItems(type) {
    return this.analyzeItems[type];
  };
  _proto.setAnalyzeRiskEntities = function setAnalyzeRiskEntities(riskEntities) {
    var parsedRiskEntities = (riskEntities || []).filter(function (ne) {
      return ne.db_id;
    }).map(mapNamedEntity);
    this.setAnalyzeRiskPersons(parsedRiskEntities);
    this.setAnalyzeRiskOrgs(parsedRiskEntities);
  };
  _proto.setAnalyzeRiskPersons = function setAnalyzeRiskPersons(riskEntities) {
    var riskPersons = [].concat(riskEntities || []).filter(function (entity) {
      return entity.label === "PERSON" || entity.type === "PERSON" || entity.label === "PER" || entity.type === "PER";
    });
    this.setAnalyzeItems(riskPersons, "riskPersons");
  };
  _proto.setAnalyzeRiskOrgs = function setAnalyzeRiskOrgs(riskEntities) {
    var riskOrgs = [].concat(riskEntities || []).filter(function (entity) {
      return entity.label === "ORG" || entity.type === "ORG" || entity.label === "ORGANIZATION" || entity.type === "ORGANIZATION";
    });
    this.setAnalyzeItems(riskOrgs, "riskOrgs");
  };
  _proto.setAnalyzeTopicInfo = function setAnalyzeTopicInfo(data) {
    this.analyzeTopic = null;
    this.analyzeTopicProbe = 0;
    if (data && data.topic) {
      this.analyzeTopic = data.topic;
    }
    if (data && data.topic_prob) {
      this.analyzeTopicProbe = data.topic_prob;
    }
  };
  _proto.checkIsTopicAnalyzed = function checkIsTopicAnalyzed() {
    return this.analyzeTopic !== undefined;
  };
  _proto.getAnalyzeTopic = function getAnalyzeTopic() {
    return this.analyzeTopic;
  };
  _proto.getAnalyzeTopicProbe = function getAnalyzeTopicProbe() {
    return this.analyzeTopicProbe;
  };
  _proto.setMentionedItems = function setMentionedItems(items, type) {
    this.mentionedItems[type].items = [].concat(items || []).filter(onlyUniqueByName).sort(compareByCount);
  };
  _proto.getMentionedItems = function getMentionedItems(type) {
    return this.mentionedItems[type].items;
  };
  _proto.setMentionedEntities = function setMentionedEntities(namedEntities) {
    var mentionedPersons = [];
    var mentionedOrgs = [];
    var mentionedLocs = [];
    var parsedNamedEntities = (namedEntities || []).filter(function (ne) {
      return !ne.db_id;
    }).map(mapNamedEntity);
    parsedNamedEntities.forEach(function (ne) {
      if (ne.label === "PERSON" || ne.type === "PERSON" || ne.label === "PER" || ne.type === "PER") {
        mentionedPersons.push(ne);
      }
      if (ne.label === "ORG" || ne.type === "ORG" || ne.label === "ORGANIZATION" || ne.type === "ORGANIZATION") {
        mentionedOrgs.push(ne);
      }
      if (ne.label === "GPE" || ne.type === "GPE" || ne.label === "LOC" || ne.type === "LOC" || ne.label === "LOCATION" || ne.type === "LOCATION") {
        mentionedLocs.push(ne);
      }
    });
    this.setMentionedItems(mentionedPersons, "persons");
    this.setMentionedItems(mentionedOrgs, "orgs");
    this.setMentionedItems(mentionedLocs, "locs");
  };
  _proto.setTopMentionedItemsCount = function setTopMentionedItemsCount(topCnt, type) {
    this.mentionedItems[type].topCnt = topCnt;
  };
  _proto.getMentionedPersons = function getMentionedPersons() {
    return this.mentionedItems.persons.items;
  };
  _proto.getMentionedOrgs = function getMentionedOrgs() {
    return this.mentionedItems.orgs.items;
  };
  _proto.getMentionedLocs = function getMentionedLocs() {
    return this.mentionedItems.locs.items;
  };
  _proto.getAnalyzeNgrams = function getAnalyzeNgrams() {
    return this.analyzeItems.ngrams;
  };
  _proto.getAnalyzeRiskKeywords = function getAnalyzeRiskKeywords() {
    return this.analyzeItems.riskKeywords;
  };
  _proto.getAnalyzeKeywords = function getAnalyzeKeywords() {
    return this.analyzeItems.keywords;
  };
  _proto.getAnalyzeRiskPersons = function getAnalyzeRiskPersons() {
    return this.analyzeItems.riskPersons;
  };
  _proto.getAnalyzeRiskOrgs = function getAnalyzeRiskOrgs() {
    return this.analyzeItems.riskOrgs;
  };
  return MediaPyAnalyzeResultItemV1;
}(MediaPyResultItemV1);
module.exports = {
  MediaPyAnalyzeResultItemV1: MediaPyAnalyzeResultItemV1
};

},{"../../../common/utils/comparisons-v4":688,"../../../common/utils/filters-v4":691,"../../../common/utils/mappers-v4":694,"./media-py-result-item-v1":847}],845:[function(require,module,exports){
"use strict";

function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
var _require = require("../../../common/utils/common-v4"),
  remapIntervals = _require.remapIntervals;
var _require2 = require("../../../common/utils/comparisons-v4"),
  compareByValue = _require2.compareByValue;
var _require3 = require("../../../common/utils/filters-v4"),
  onlyUnique = _require3.onlyUnique;
var _require4 = require("./media-py-llm-result-item-v1"),
  MediaPyLLMResultItemV1 = _require4.MediaPyLLMResultItemV1;
var MediaPyGptResultItemV1 = function (_MediaPyLLMResultItem) {
  function MediaPyGptResultItemV1(title, titleHtml, description, descriptionHtml, linkUrl, date, type) {
    var _this;
    _this = _MediaPyLLMResultItem.call(this, title, titleHtml, description, descriptionHtml, linkUrl, date, type) || this;
    _this.gptRiskAssScore = 0;
    _this.gptRiskAssExplanation = "";
    _this.gptDocAnalysSummary = "";
    _this.gptDocAnalysSentiment = "";
    _this.gptDocAnalysTopic = "";
    _this.gptDocAnalysKeywords = [];
    _this.gptDocAnalysPubType = "";
    _this.gptPersSumSummary = "";
    _this.gptPersSumDetails = {
      age: "",
      connections: [],
      countryOfResidence: "",
      occupation: "",
      personalCharacteristics: [],
      position: "",
      propertyOwnership: "",
      timePeriod: ""
    };
    _this.gptRelatedItems = {
      persons: {
        items: [],
        topCnt: 5
      },
      orgs: {
        items: [],
        topCnt: 5
      }
    };
    _this.gptPersonMatchIsMatch = false;
    _this.gptIsPersonMatch = true;
    _this.gptAllegations = [];
    _this.gptEvidence = [];
    return _this;
  }
  _inheritsLoose(MediaPyGptResultItemV1, _MediaPyLLMResultItem);
  var _proto = MediaPyGptResultItemV1.prototype;
  _proto.setGptRiskScore = function setGptRiskScore(riskScore) {
    this.gptRiskAssScore = riskScore;
  };
  _proto.getGptRiskScore = function getGptRiskScore() {
    return this.gptRiskAssScore;
  };
  _proto.setGptRiskExplanation = function setGptRiskExplanation(riskExplanation) {
    this.gptRiskAssExplanation = riskExplanation;
  };
  _proto.getGptRiskExplanation = function getGptRiskExplanation() {
    return this.gptRiskAssExplanation;
  };
  _proto.setGptDocAnalysSummary = function setGptDocAnalysSummary(summary) {
    this.gptDocAnalysSummary = summary;
  };
  _proto.getGptDocAnalysSummary = function getGptDocAnalysSummary() {
    return this.gptDocAnalysSummary;
  };
  _proto.setGptDocAnalysSentiment = function setGptDocAnalysSentiment(sentiment) {
    this.gptDocAnalysSentiment = sentiment;
  };
  _proto.getGptDocAnalysSentiment = function getGptDocAnalysSentiment() {
    return this.gptDocAnalysSentiment;
  };
  _proto.setGptDocAnalysTopic = function setGptDocAnalysTopic(topic) {
    this.gptDocAnalysTopic = topic;
  };
  _proto.getGptDocAnalysTopic = function getGptDocAnalysTopic() {
    return this.gptDocAnalysTopic;
  };
  _proto.setGptDocAnalysKeywords = function setGptDocAnalysKeywords(keywords) {
    this.gptDocAnalysKeywords = [].concat(keywords || []).filter(onlyUnique).sort(compareByValue);
  };
  _proto.getGptDocAnalysKeywords = function getGptDocAnalysKeywords() {
    return this.gptDocAnalysKeywords;
  };
  _proto.setGptDocAnalysPubType = function setGptDocAnalysPubType(pubType) {
    this.gptDocAnalysPubType = pubType;
  };
  _proto.getGptDocAnalysPubType = function getGptDocAnalysPubType() {
    return this.gptDocAnalysPubType;
  };
  _proto.setGptPersSumSummary = function setGptPersSumSummary(summary) {
    this.gptPersSumSummary = summary;
  };
  _proto.getGptPersSumSummary = function getGptPersSumSummary() {
    return this.gptPersSumSummary;
  };
  _proto.setGptPersSumDetails = function setGptPersSumDetails(details) {
    this.gptPersSumDetails.age = details.age || "";
    this.gptPersSumDetails.connections = details.connections || [];
    this.gptPersSumDetails.countryOfResidence = details.country_of_residence || "";
    this.gptPersSumDetails.occupation = details.occupation || "";
    this.gptPersSumDetails.personalCharacteristics = details.personal_characteristics || [];
    this.gptPersSumDetails.position = details.position || "";
    this.gptPersSumDetails.propertyOwnership = details.property_ownership || "";
    this.gptPersSumDetails.timePeriod = details.time_period || "";
  };
  _proto.getGptPersSumDetails = function getGptPersSumDetails() {
    return this.gptPersSumDetails;
  };
  _proto.setGptRelatedItems = function setGptRelatedItems(items, type) {
    this.gptRelatedItems[type].items = [].concat(items || []).filter(onlyUnique).sort(compareByValue);
  };
  _proto.getGptRelatedItems = function getGptRelatedItems(type) {
    return this.gptRelatedItems[type].items;
  };
  _proto.setGptPersonIsMatch = function setGptPersonIsMatch(isMatch) {
    this.gptPersonMatchIsMatch = isMatch;
  };
  _proto.getGptPersonIsMatch = function getGptPersonIsMatch() {
    return this.gptPersonMatchIsMatch;
  };
  _proto.setGptIsPersonMatch = function setGptIsPersonMatch(isMatch) {
    this.gptIsPersonMatch = isMatch;
  };
  _proto.getGptIsPersonMatch = function getGptIsPersonMatch() {
    return this.gptIsPersonMatch;
  };
  _proto.setGptAllegations = function setGptAllegations(allegations) {
    this.gptAllegations = [].concat(allegations || []);
  };
  _proto.getGptAllegations = function getGptAllegations() {
    return this.gptAllegations;
  };
  _proto.setGptEvidence = function setGptEvidence(evidence) {
    this.gptEvidence = [].concat(evidence || []);
  };
  _proto.getGptEvidence = function getGptEvidence() {
    return this.gptEvidence;
  };
  _proto.setTopGptRelatedItemsCount = function setTopGptRelatedItemsCount(topCnt, type) {
    this.gptRelatedItems[type].topCnt = topCnt;
  };
  _proto.getGptRelatedPersons = function getGptRelatedPersons() {
    return this.gptRelatedItems.persons.items;
  };
  _proto.getGptRelatedOrganizations = function getGptRelatedOrganizations() {
    return this.gptRelatedItems.orgs.items;
  };
  _proto.remapGptRiskScoreToMediaPyRiskScore = function remapGptRiskScoreToMediaPyRiskScore() {
    var gptRiskScore = this.getGptRiskScore();
    if (gptRiskScore >= 2) {
      var remapRiskScore = remapIntervals(gptRiskScore, 2, 10, 0.8, 1);
      this.setMediaPyRiskScore(remapRiskScore);
      this.setMediaPyRiskScoreColor(remapRiskScore, false);
    }
  };
  return MediaPyGptResultItemV1;
}(MediaPyLLMResultItemV1);
module.exports = {
  MediaPyGptResultItemV1: MediaPyGptResultItemV1
};

},{"../../../common/utils/common-v4":687,"../../../common/utils/comparisons-v4":688,"../../../common/utils/filters-v4":691,"./media-py-llm-result-item-v1":846}],846:[function(require,module,exports){
"use strict";

function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
var _require = require("../../../common/utils/comparisons-v4"),
  compareByValue = _require.compareByValue;
var _require2 = require("../../../common/utils/filters-v4"),
  onlyUnique = _require2.onlyUnique;
var _require3 = require("./person-info-result-item-v1"),
  PersonInfoResultItemV1 = _require3.PersonInfoResultItemV1;
var MediaPyLLMResultItemV1 = function (_PersonInfoResultItem) {
  function MediaPyLLMResultItemV1(title, titleHtml, description, descriptionHtml, linkUrl, date, type) {
    var _this;
    _this = _PersonInfoResultItem.call(this, title, titleHtml, description, descriptionHtml, linkUrl, date, type) || this;
    _this.llmSummary = "";
    _this.llmShortSummary = "";
    _this.llmPersonSummary = "";
    _this.llmMentionedEntities = {
      persons: {
        items: [],
        topCnt: 5
      },
      orgs: {
        items: [],
        topCnt: 5
      }
    };
    _this.llmKeywords = [];
    _this.llmSentiment = "";
    _this.llmRiskLevel = 0;
    _this.llmRiskExplanation = "";
    return _this;
  }
  _inheritsLoose(MediaPyLLMResultItemV1, _PersonInfoResultItem);
  var _proto = MediaPyLLMResultItemV1.prototype;
  _proto.setLLMSummary = function setLLMSummary(summary) {
    this.llmSummary = summary;
  };
  _proto.getLLMSummary = function getLLMSummary() {
    return this.llmSummary;
  };
  _proto.setLLMShortSummary = function setLLMShortSummary(shortSummary) {
    this.llmShortSummary = shortSummary;
  };
  _proto.getLLMShortSummary = function getLLMShortSummary() {
    return this.llmShortSummary;
  };
  _proto.setLLMPersonSummary = function setLLMPersonSummary(personSummary) {
    this.llmPersonSummary = personSummary;
  };
  _proto.getLLMPersonSummary = function getLLMPersonSummary() {
    return this.llmPersonSummary;
  };
  _proto.setLLMmentionedEntities = function setLLMmentionedEntities(entities, type) {
    this.llmMentionedEntities[type].items = [].concat(entities || []).filter(onlyUnique);
  };
  _proto.getLLMMentionedEntities = function getLLMMentionedEntities(type) {
    return this.llmMentionedEntities[type].items;
  };
  _proto.setTopLLMMentionedEntitiesCount = function setTopLLMMentionedEntitiesCount(topCnt, type) {
    this.llmMentionedEntities[type].topCnt = topCnt;
  };
  _proto.getLLMMentionedPersons = function getLLMMentionedPersons() {
    return this.llmMentionedEntities.persons.items;
  };
  _proto.getLLMMentionedOrgs = function getLLMMentionedOrgs() {
    return this.llmMentionedEntities.orgs.items;
  };
  _proto.setLLMKeywords = function setLLMKeywords(keywords) {
    this.llmKeywords = [].concat(keywords || []).filter(onlyUnique).sort(compareByValue);
  };
  _proto.getLLMKeywords = function getLLMKeywords() {
    return this.llmKeywords;
  };
  _proto.setLLMSentiment = function setLLMSentiment(sentiment) {
    this.llmSentiment = sentiment;
  };
  _proto.getLLMSentiment = function getLLMSentiment() {
    return this.llmSentiment;
  };
  _proto.setLLMRiskLevel = function setLLMRiskLevel(riskLevel) {
    this.llmRiskLevel = riskLevel;
  };
  _proto.getLLMRiskLevel = function getLLMRiskLevel() {
    return this.llmRiskLevel;
  };
  _proto.setLLMRiskExplanation = function setLLMRiskExplanation(riskExplanation) {
    this.llmRiskExplanation = riskExplanation;
  };
  _proto.getLLMRiskExplanation = function getLLMRiskExplanation() {
    return this.llmRiskExplanation;
  };
  return MediaPyLLMResultItemV1;
}(PersonInfoResultItemV1);
module.exports = {
  MediaPyLLMResultItemV1: MediaPyLLMResultItemV1
};

},{"../../../common/utils/comparisons-v4":688,"../../../common/utils/filters-v4":691,"./person-info-result-item-v1":850}],847:[function(require,module,exports){
"use strict";

function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
var _require = require("./content-result-item-v1"),
  ContentResultItemV1 = _require.ContentResultItemV1;
var _require2 = require("../../../common/utils/common-v4"),
  remapIntervals = _require2.remapIntervals,
  getHSLHue = _require2.getHSLHue,
  hslToHex = _require2.hslToHex;
var MediaPyResultItemV1 = function (_ContentResultItemV) {
  function MediaPyResultItemV1(title, titleHtml, description, descriptionHtml, linkUrl, date, type) {
    var _this;
    _this = _ContentResultItemV.call(this, title, titleHtml, description, descriptionHtml, linkUrl, date, type) || this;
    _this.contentMarkupHtml = undefined;
    _this.contentMarkupElement = undefined;
    _this.isHtmlCleared = false;
    _this.entityNames = [];
    _this.areEntitiesLoaded = false;
    _this.areEntitiesHighlighted = false;
    _this.keywords = [];
    _this.areKeywordsHighlighted = false;
    _this.extendedSummary = "";
    _this.extendedSummaryHtml = "";
    _this.mediaPyRiskScore = 0;
    _this.isMediaPyRiskScored = false;
    _this.mediaPyRiskScoreColor = "#ffff00";
    _this.sentiment = 0;
    _this.isSentimentLoaded = false;
    _this.mediaPyTitleRiskScore = 0;
    _this.mediaPyTitleRiskScoreColor = "#ffff00";
    _this.mediaPyNameImportance = 0;
    _this.mediaPyNameImportanceColor = "#ffff00";
    _this.wordCloudImgBase64 = null;
    return _this;
  }
  _inheritsLoose(MediaPyResultItemV1, _ContentResultItemV);
  var _proto = MediaPyResultItemV1.prototype;
  _proto.setContentMarkupHtml = function setContentMarkupHtml(contentMarkupHtml) {
    this.contentMarkupHtml = contentMarkupHtml;
  };
  _proto.getContentMarkupHtml = function getContentMarkupHtml() {
    return this.contentMarkupHtml;
  };
  _proto.checkIsContentMarkupHtmlLoaded = function checkIsContentMarkupHtmlLoaded() {
    return this.contentMarkupHtml !== undefined && this.contentMarkupHtml !== null;
  };
  _proto.setContentMarkupElement = function setContentMarkupElement(contentMarkupElement) {
    this.contentMarkupElement = contentMarkupElement;
  };
  _proto.getContentMarkupElement = function getContentMarkupElement() {
    return this.contentMarkupElement;
  };
  _proto.setHtmlCleared = function setHtmlCleared(flag) {
    this.isHtmlCleared = flag;
  };
  _proto.checkIsHtmlCleared = function checkIsHtmlCleared() {
    return this.isHtmlCleared;
  };
  _proto.setEntityNames = function setEntityNames(entityNames) {
    this.entityNames = entityNames;
  };
  _proto.getEntityNames = function getEntityNames() {
    return this.entityNames;
  };
  _proto.setEntitiesLoaded = function setEntitiesLoaded(flag) {
    this.areEntitiesLoaded = flag;
  };
  _proto.checkAreEntitiesLoaded = function checkAreEntitiesLoaded() {
    return this.areEntitiesLoaded;
  };
  _proto.setEntitiesHighlighted = function setEntitiesHighlighted(flag) {
    this.areEntitiesHighlighted = flag;
  };
  _proto.checkAreEntitiesHighlighted = function checkAreEntitiesHighlighted() {
    return this.areEntitiesHighlighted;
  };
  _proto.setKeywords = function setKeywords(keywords) {
    this.keywords = keywords;
  };
  _proto.getKeywords = function getKeywords() {
    return this.keywords;
  };
  _proto.setKeywordsHighlighted = function setKeywordsHighlighted(flag) {
    this.areKeywordsHighlighted = flag;
  };
  _proto.checkAreKeywordsHighlighted = function checkAreKeywordsHighlighted() {
    return this.areKeywordsHighlighted;
  };
  _proto.setExtendedSummary = function setExtendedSummary(extendedSummary) {
    this.extendedSummary = extendedSummary;
  };
  _proto.getExtendedSummary = function getExtendedSummary() {
    return this.extendedSummary;
  };
  _proto.setExtendedSummaryHtml = function setExtendedSummaryHtml(extendedSummaryHtml) {
    this.extendedSummaryHtml = extendedSummaryHtml;
  };
  _proto.getExtendedSummaryHtml = function getExtendedSummaryHtml() {
    return this.extendedSummaryHtml;
  };
  _proto.setMediaPyRiskScore = function setMediaPyRiskScore(mediaPyRiskScore) {
    this.mediaPyRiskScore = mediaPyRiskScore > 1 ? 1 : mediaPyRiskScore < -1 ? -1 : mediaPyRiskScore;
  };
  _proto.getMediaPyRiskScore = function getMediaPyRiskScore() {
    return this.mediaPyRiskScore;
  };
  _proto.setMediaPyRiskScoreColor = function setMediaPyRiskScoreColor(mediaPyRiskScore, withRemap) {
    var newValue = withRemap ? remapIntervals(mediaPyRiskScore, -1, 1, 0, 1) : mediaPyRiskScore;
    var hue = getHSLHue(newValue);
    this.mediaPyRiskScoreColor = hslToHex(parseInt(hue, 10), 100, 50);
  };
  _proto.setMediaPyTitleRiskScore = function setMediaPyTitleRiskScore(mediaPyTitleRiskScore) {
    this.mediaPyTitleRiskScore = mediaPyTitleRiskScore > 1 ? 1 : mediaPyTitleRiskScore < -1 ? -1 : mediaPyTitleRiskScore;
  };
  _proto.getMediaPyTitleRiskScore = function getMediaPyTitleRiskScore() {
    return this.mediaPyTitleRiskScore;
  };
  _proto.setMediaPyTitleRiskScoreColor = function setMediaPyTitleRiskScoreColor(mediaPyTitleRiskScore, withRemap) {
    var newValue = withRemap ? remapIntervals(mediaPyTitleRiskScore, -1, 1, 0, 1) : mediaPyTitleRiskScore;
    var hue = getHSLHue(newValue);
    this.mediaPyTitleRiskScoreColor = hslToHex(parseInt(hue, 10), 100, 50);
  };
  _proto.setMediaPyNameImportance = function setMediaPyNameImportance(mediaPyNameImportance) {
    this.mediaPyNameImportance = mediaPyNameImportance > 1 ? 1 : mediaPyNameImportance < -1 ? -1 : mediaPyNameImportance;
  };
  _proto.getMediaPyNameImportance = function getMediaPyNameImportance() {
    return this.mediaPyNameImportance;
  };
  _proto.setMediaPyNameImportanceColor = function setMediaPyNameImportanceColor(mediaPyNameImportance, withRemap) {
    var newValue = withRemap ? remapIntervals(mediaPyNameImportance, -1, 1, 0, 1) : mediaPyNameImportance;
    var hue = getHSLHue(newValue);
    this.mediaPyNameImportanceColor = hslToHex(parseInt(hue, 10), 100, 50);
  };
  _proto.setSentiment = function setSentiment(sentiment) {
    this.sentiment = sentiment;
  };
  _proto.getSentiment = function getSentiment() {
    return this.sentiment;
  };
  _proto.setMediaPyRiskScored = function setMediaPyRiskScored(flag) {
    this.isMediaPyRiskScored = flag;
  };
  _proto.checkIsMediaPyRiskScored = function checkIsMediaPyRiskScored() {
    return this.isMediaPyRiskScored;
  };
  _proto.setSentimentLoaded = function setSentimentLoaded(flag) {
    this.isSentimentLoaded = flag;
  };
  _proto.checkIsSentimentLoaded = function checkIsSentimentLoaded() {
    return this.isSentimentLoaded;
  };
  _proto.setWordCloudImg = function setWordCloudImg(base64Data) {
    this.wordCloudImgBase64 = base64Data;
  };
  _proto.getWordCloudImg = function getWordCloudImg() {
    return this.wordCloudImgBase64;
  };
  _proto.setTotalSentimentRiskScore = function setTotalSentimentRiskScore() {
    var riskScore = this.initialRiskScore;
    if (this.sentiment >= 0) {
      var halfScoreToZero = (riskScore - 0) / 2;
      riskScore -= halfScoreToZero * this.sentiment;
    } else if (this.sentiment <= -0.5) {
      var halfScoreToOne = (1 - riskScore) / 2;
      riskScore += halfScoreToOne * remapIntervals(Math.abs(this.sentiment), 0.5, 1, 0, 1);
    }
    this.setRiskScore(riskScore);
  };
  return MediaPyResultItemV1;
}(ContentResultItemV1);
module.exports = {
  MediaPyResultItemV1: MediaPyResultItemV1
};

},{"../../../common/utils/common-v4":687,"./content-result-item-v1":839}],848:[function(require,module,exports){
"use strict";

function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
var _require = require("./media-py-gpt-result-item-v1"),
  MediaPyGptResultItemV1 = _require.MediaPyGptResultItemV1;
var OpenCorporatesResultItemV1 = function (_MediaPyGptResultItem) {
  function OpenCorporatesResultItemV1(title, description, linkUrl, type) {
    var _this;
    _this = _MediaPyGptResultItem.call(this, title, title, description, description, linkUrl, null, type) || this;
    _this.entityType = "";
    return _this;
  }
  _inheritsLoose(OpenCorporatesResultItemV1, _MediaPyGptResultItem);
  var _proto = OpenCorporatesResultItemV1.prototype;
  _proto.setEntityType = function setEntityType(type) {
    this.entityType = type;
  };
  _proto.checkIsPersonType = function checkIsPersonType() {
    return this.entityType === "Person";
  };
  _proto.checkIsDocumentType = function checkIsDocumentType() {
    return this.entityType === "Document";
  };
  _proto.checkIsCompanyType = function checkIsCompanyType() {
    return this.entityType === "Company";
  };
  _proto.setTotalRiskScore = function setTotalRiskScore(totalRiskScore, isPersonNamePresented) {
    var riskScore = totalRiskScore;
    if (isPersonNamePresented) {
      riskScore += 0.05;
    } else {
      riskScore -= 0.1;
    }
    this.setRiskScore(riskScore);
    this.setInitialRiskScore(riskScore);
  };
  return OpenCorporatesResultItemV1;
}(MediaPyGptResultItemV1);
module.exports = {
  OpenCorporatesResultItemV1: OpenCorporatesResultItemV1
};

},{"./media-py-gpt-result-item-v1":845}],849:[function(require,module,exports){
"use strict";

function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
var _require = require("./media-py-gpt-result-item-v1"),
  MediaPyGptResultItemV1 = _require.MediaPyGptResultItemV1;
var OpenSanctionsResultItemV1 = function (_MediaPyGptResultItem) {
  function OpenSanctionsResultItemV1(title, description, linkUrl, type) {
    var _this;
    _this = _MediaPyGptResultItem.call(this, title, title, description, description, linkUrl, null, type) || this;
    _this.entityType = "";
    _this.entityId = "";
    _this.source = "opensanctions";
    _this.relevance = true;
    return _this;
  }
  _inheritsLoose(OpenSanctionsResultItemV1, _MediaPyGptResultItem);
  var _proto = OpenSanctionsResultItemV1.prototype;
  _proto.getSource = function getSource() {
    return this.source;
  };
  _proto.setRelevance = function setRelevance(relevance) {
    this.relevance = relevance;
  };
  _proto.getRelevance = function getRelevance() {
    return this.relevance;
  };
  _proto.setEntityType = function setEntityType(type) {
    this.entityType = type;
  };
  _proto.checkIsPersonType = function checkIsPersonType() {
    return this.entityType === "Person";
  };
  _proto.checkIsDocumentType = function checkIsDocumentType() {
    return this.entityType === "Document";
  };
  _proto.checkIsCompanyType = function checkIsCompanyType() {
    return this.entityType === "Company";
  };
  _proto.setEntityId = function setEntityId(id) {
    this.entityId = id;
  };
  _proto.getEntityId = function getEntityId() {
    return this.entityId;
  };
  _proto.setTotalRiskScore = function setTotalRiskScore(totalRiskScore, isPersonNamePresented) {
    var riskScore = totalRiskScore;
    if (isPersonNamePresented) {
      riskScore += 0.05;
    } else {
      riskScore -= 0.1;
    }
    this.setRiskScore(riskScore);
    this.setInitialRiskScore(riskScore);
  };
  return OpenSanctionsResultItemV1;
}(MediaPyGptResultItemV1);
module.exports = {
  OpenSanctionsResultItemV1: OpenSanctionsResultItemV1
};

},{"./media-py-gpt-result-item-v1":845}],850:[function(require,module,exports){
"use strict";

function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
var _require = require("../../../common/utils/strings-v4"),
  checkPersonIsMentionedInText = _require.checkPersonIsMentionedInText,
  getWordSynonims = _require.getWordSynonims;
var _require2 = require("../../../common/utils/filters-v4"),
  onlyUnique = _require2.onlyUnique;
var _require3 = require("./source-result-item-v1"),
  SourceResultItemV1 = _require3.SourceResultItemV1;
var PersonInfoResultItemV1 = function (_SourceResultItemV) {
  function PersonInfoResultItemV1(title, titleHtml, description, descriptionHtml, linkUrl, date, type) {
    var _this;
    _this = _SourceResultItemV.call(this, title, titleHtml, description, descriptionHtml, linkUrl, date, type) || this;
    _this.personInfo = {
      personId: "",
      firstName: "",
      lastName: "",
      fullName: "",
      isCompany: false,
      keywords: [],
      synonims: []
    };
    _this.extendedPersonInfo = {
      openSanctionsInfo: {
        entity: {
          name: []
        }
      }
    };
    _this.isPersonNamePresented = false;
    return _this;
  }
  _inheritsLoose(PersonInfoResultItemV1, _SourceResultItemV);
  var _proto = PersonInfoResultItemV1.prototype;
  _proto.setExtendedPersonInfo = function setExtendedPersonInfo(openSanctionsInfo) {
    this.extendedPersonInfo.openSanctionsInfo = openSanctionsInfo;
  };
  _proto.getExtendedPersonInfo = function getExtendedPersonInfo() {
    return this.extendedPersonInfo.openSanctionsInfo;
  };
  _proto.setPersonInfo = function setPersonInfo(person) {
    this.personInfo.personId = person.getId();
    this.personInfo.firstName = person.getFirstName();
    this.personInfo.lastName = person.getLastName();
    this.personInfo.fullName = person.getFullName();
    this.personInfo.isCompany = person.checkIsCompany();
    this.personInfo.keywords = person.getKeywords();
    this.personInfo.synonims = [];
  };
  _proto.getPersonId = function getPersonId() {
    return this.personInfo.personId;
  };
  _proto.getPersonFirstName = function getPersonFirstName() {
    return this.personInfo.firstName;
  };
  _proto.getPersonLastName = function getPersonLastName() {
    return this.personInfo.lastName;
  };
  _proto.getPersonFullName = function getPersonFullName() {
    return this.personInfo.fullName;
  };
  _proto.checkIsCompany = function checkIsCompany() {
    return this.personInfo.isCompany;
  };
  _proto.getPersonKeywords = function getPersonKeywords() {
    return this.personInfo.keywords;
  };
  _proto.setPersonSynonims = function setPersonSynonims(personSynonims) {
    this.personInfo.synonims = personSynonims;
  };
  _proto.getPersonSynonims = function getPersonSynonims() {
    return this.personInfo.synonims;
  };
  _proto.checkPersonIsMentionedInSummary = function checkPersonIsMentionedInSummary(isExactPersonName) {
    var isPersonNamePresented = false;
    var firstName = this.getPersonFirstName().toLowerCase();
    var lastName = this.getPersonLastName().toLowerCase();
    var fullName = this.getPersonFullName().toLowerCase();
    var title = this.title.toLowerCase();
    var description = this.description.toLowerCase();
    if (isExactPersonName) {
      isPersonNamePresented = title.indexOf(fullName.toLowerCase()) > -1 || description.indexOf(fullName.toLowerCase()) > -1 || title.indexOf(firstName.toLowerCase()) > -1 || description.indexOf(firstName.toLowerCase()) > -1 || title.indexOf(lastName.toLowerCase()) > -1 || description.indexOf(lastName.toLowerCase()) > -1;
    } else {
      isPersonNamePresented = title.indexOf(fullName) > -1 || description.indexOf(fullName) > -1;
      if (!isPersonNamePresented && firstName !== lastName) {
        isPersonNamePresented = checkPersonIsMentionedInText(firstName, lastName, title) || checkPersonIsMentionedInText(firstName, lastName, description);
      }
    }
    return isPersonNamePresented;
  };
  _proto.getPersonSynonimsFromSummary = function getPersonSynonimsFromSummary() {
    var firstName = this.getPersonFirstName().toLowerCase();
    var lastName = this.getPersonLastName().toLowerCase();
    var title = this.title.toLowerCase();
    var description = this.description.toLowerCase();
    var shouldCheckFirstName = firstName.length >= 3;
    var shouldCheckLastName = lastName.length >= 5;
    var synonims = [];
    if (shouldCheckFirstName) {
      synonims = synonims.concat(getWordSynonims(firstName, title, firstName.length >= 5 ? 2 : 1)).concat(getWordSynonims(firstName, description, firstName.length >= 5 ? 2 : 1));
    }
    if (shouldCheckLastName) {
      synonims = synonims.concat(getWordSynonims(lastName, title, lastName.length >= 5 ? 2 : 1)).concat(getWordSynonims(lastName, description, lastName.length >= 5 ? 2 : 1));
    }
    return synonims.filter(onlyUnique);
  };
  _proto.setPersonNamePresented = function setPersonNamePresented(isPersonNamePresented) {
    this.isPersonNamePresented = isPersonNamePresented;
  };
  _proto.checkIsPersonNamePresented = function checkIsPersonNamePresented() {
    return this.isPersonNamePresented;
  };
  return PersonInfoResultItemV1;
}(SourceResultItemV1);
module.exports = {
  PersonInfoResultItemV1: PersonInfoResultItemV1
};

},{"../../../common/utils/filters-v4":691,"../../../common/utils/strings-v4":696,"./source-result-item-v1":852}],851:[function(require,module,exports){
"use strict";

function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
var _require = require("./media-py-gpt-result-item-v1"),
  MediaPyGptResultItemV1 = _require.MediaPyGptResultItemV1;
var SearchEngineResultItemV1 = function (_MediaPyGptResultItem) {
  function SearchEngineResultItemV1(title, titleHtml, description, descriptionHtml, linkUrl, date, type) {
    var _this;
    _this = _MediaPyGptResultItem.call(this, title, titleHtml, description, descriptionHtml, linkUrl, date, type) || this;
    _this.requestInfo = {
      requestRiskScore: 0,
      searchConfigId: "",
      sortBy: "",
      positionIdx: 0
    };
    _this.totalResultsCountRiskScoreAdditive = 0;
    _this.pubYearRiskScoreAdditive = 0;
    return _this;
  }
  _inheritsLoose(SearchEngineResultItemV1, _MediaPyGptResultItem);
  var _proto = SearchEngineResultItemV1.prototype;
  _proto.setRequestInfo = function setRequestInfo(requestRiskScore, searchConfigId, sortBy, positionIdx) {
    this.requestInfo.requestRiskScore = requestRiskScore;
    this.requestInfo.searchConfigId = searchConfigId;
    this.requestInfo.sortBy = sortBy;
    this.requestInfo.positionIdx = positionIdx;
    this.setRiskScore(requestRiskScore);
    this.setInitialRiskScore(requestRiskScore);
  };
  _proto.getRequestRiskScore = function getRequestRiskScore() {
    return this.requestInfo.requestRiskScore;
  };
  _proto.getSearchConfigId = function getSearchConfigId() {
    return this.requestInfo.searchConfigId;
  };
  _proto.getSortBy = function getSortBy() {
    return this.requestInfo.sortBy;
  };
  _proto.getPositionIdx = function getPositionIdx() {
    return this.requestInfo.positionIdx;
  };
  _proto.setRiskScoreAdditives = function setRiskScoreAdditives(totalResultsCountRiskScoreAdditive, pubYearRiskScoreAdditive) {
    this.totalResultsCountRiskScoreAdditive = totalResultsCountRiskScoreAdditive;
    this.pubYearRiskScoreAdditive = pubYearRiskScoreAdditive;
  };
  _proto.getSummaryKeywords = function getSummaryKeywords(allKeywords) {
    var title = this.title.toLowerCase();
    var description = this.description.toLowerCase();
    return allKeywords.filter(function (keyword) {
      return title.indexOf(keyword.toLowerCase()) > -1 || description.indexOf(keyword.toLowerCase()) > -1;
    });
  };
  _proto.setTotalRiskScore = function setTotalRiskScore(totalRiskScore, isPersonNamePresented) {
    var riskScore = totalRiskScore + (this.totalResultsCountRiskScoreAdditive ? this.totalResultsCountRiskScoreAdditive : 0) + (this.pubYearRiskScoreAdditive ? this.pubYearRiskScoreAdditive : 0);
    if (isPersonNamePresented) {
      riskScore += 0.05;
    } else {
      riskScore -= 0.1;
    }
    this.setRiskScore(riskScore);
    this.setInitialRiskScore(riskScore);
  };
  return SearchEngineResultItemV1;
}(MediaPyGptResultItemV1);
module.exports = {
  SearchEngineResultItemV1: SearchEngineResultItemV1
};

},{"./media-py-gpt-result-item-v1":845}],852:[function(require,module,exports){
"use strict";

function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
var _require = require("./media-py-analyze-result-item-v1"),
  MediaPyAnalyzeResultItemV1 = _require.MediaPyAnalyzeResultItemV1;
var SourceResultItemV1 = function (_MediaPyAnalyzeResult) {
  function SourceResultItemV1(title, titleHtml, description, descriptionHtml, linkUrl, date, type) {
    var _this;
    _this = _MediaPyAnalyzeResult.call(this, title, titleHtml, description, descriptionHtml, linkUrl, date, type) || this;
    _this.groupInfo = {
      requestObjectId: "",
      groupObjectId: ""
    };
    _this.scoreMode = null;
    return _this;
  }
  _inheritsLoose(SourceResultItemV1, _MediaPyAnalyzeResult);
  var _proto = SourceResultItemV1.prototype;
  _proto.setGroupInfo = function setGroupInfo(requestObjectId, groupObjectId) {
    this.groupInfo.requestObjectId = requestObjectId;
    this.groupInfo.groupObjectId = groupObjectId;
  };
  _proto.setScoreMode = function setScoreMode(scoreMode) {
    this.scoreMode = scoreMode;
  };
  _proto.getScoreMode = function getScoreMode() {
    return this.scoreMode;
  };
  _proto.getRequestObjectId = function getRequestObjectId() {
    return this.groupInfo.requestObjectId;
  };
  _proto.getGroupObjectId = function getGroupObjectId() {
    return this.groupInfo.groupObjectId;
  };
  return SourceResultItemV1;
}(MediaPyAnalyzeResultItemV1);
module.exports = {
  SourceResultItemV1: SourceResultItemV1
};

},{"./media-py-analyze-result-item-v1":844}],853:[function(require,module,exports){
"use strict";

function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
var _require = require("./media-py-gpt-result-item-v1"),
  MediaPyGptResultItemV1 = _require.MediaPyGptResultItemV1;
var StockMarketResultItemV1 = function (_MediaPyGptResultItem) {
  function StockMarketResultItemV1(title, description, linkUrl, type) {
    return _MediaPyGptResultItem.call(this, title, title, description, description, linkUrl, null, type) || this;
  }
  _inheritsLoose(StockMarketResultItemV1, _MediaPyGptResultItem);
  var _proto = StockMarketResultItemV1.prototype;
  _proto.setTotalRiskScore = function setTotalRiskScore(totalRiskScore, isPersonNamePresented) {
    var riskScore = totalRiskScore;
    if (isPersonNamePresented) {
      riskScore += 0.05;
    } else {
      riskScore -= 0.1;
    }
    this.setRiskScore(riskScore);
    this.setInitialRiskScore(riskScore);
  };
  return StockMarketResultItemV1;
}(MediaPyGptResultItemV1);
module.exports = {
  StockMarketResultItemV1: StockMarketResultItemV1
};

},{"./media-py-gpt-result-item-v1":845}],854:[function(require,module,exports){
"use strict";

function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
var _require = require("./requests-service-v4"),
  RequestsServiceV4 = _require.RequestsServiceV4;
var _require2 = require("../../../common/utils/common-v4"),
  getBaseApi = _require2.getBaseApi;
var AlephOccrpRequestsServiceV4 = function (_RequestsServiceV) {
  function AlephOccrpRequestsServiceV4($rootScope, $http, $q, $timeout) {
    var _this;
    _this = _RequestsServiceV.call(this, $rootScope, $http, $q, $timeout) || this;
    _this.getAlephOccrpResultsUrl = "";
    _this.DEFAULT_ALL_RESULTS_TIMEOUT = 240000;
    return _this;
  }
  _inheritsLoose(AlephOccrpRequestsServiceV4, _RequestsServiceV);
  var _proto = AlephOccrpRequestsServiceV4.prototype;
  _proto.setUrls = function setUrls(apiConfig) {
    this.getAlephOccrpResultsUrl = getBaseApi(apiConfig) + apiConfig.get_aleph_occrp_results;
  };
  _proto.setTimeouts = function setTimeouts(timeouts) {
    if (timeouts.aleph_occrp_all_results) this.DEFAULT_ALL_RESULTS_TIMEOUT = timeouts.aleph_occrp_all_results;
  };
  _proto.getAlephOccrpResults$ = function getAlephOccrpResults$(personName, firstName, lastName, isCompany, shouldGetContent, dateFrom, dateTo, languages) {
    var _this2 = this;
    var deferred = this.$q.defer();
    var cancelledResolveObject = RequestsServiceV4.getCancelledResolveObject([]);
    var cancellerWrapper = this.createDeferredCancellerWrapper(cancelledResolveObject);
    var timeoutPromise = this.createTimeoutPromise(cancellerWrapper, this.DEFAULT_ALL_RESULTS_TIMEOUT);
    var req = {
      method: "POST",
      url: this.getAlephOccrpResultsUrl,
      data: {
        personName: personName,
        firstName: firstName,
        lastName: lastName,
        isCompany: isCompany,
        shouldGetContent: shouldGetContent,
        dateFrom: dateFrom,
        dateTo: dateTo,
        languages: languages
      },
      timeout: cancellerWrapper == null ? void 0 : cancellerWrapper.deferred.promise
    };
    this.$http(req).then(function (resp) {
      _this2.$timeout.cancel(timeoutPromise);
      _this2.removeDeferredCancellerWrapper(cancellerWrapper);
      deferred.resolve(RequestsServiceV4.getRespDataWithStatus(resp));
    })["catch"](function (error) {
      _this2.$timeout.cancel(timeoutPromise);
      _this2.removeDeferredCancellerWrapper(cancellerWrapper);
      if (RequestsServiceV4.checkRequestCancelledError(error)) {
        deferred.resolve(cancelledResolveObject);
      } else {
        deferred.reject(RequestsServiceV4.getErrorWithStatus(error));
      }
    });
    return deferred.promise;
  };
  return AlephOccrpRequestsServiceV4;
}(RequestsServiceV4);
module.exports = {
  AlephOccrpRequestsServiceV4: AlephOccrpRequestsServiceV4
};

},{"../../../common/utils/common-v4":687,"./requests-service-v4":868}],855:[function(require,module,exports){
"use strict";

function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
var _require = require("./search-engine-requests-service-v4"),
  SearchEngineRequestsServiceV4 = _require.SearchEngineRequestsServiceV4;
var BingSearchRequestsServiceV4 = function (_SearchEngineRequests) {
  function BingSearchRequestsServiceV4($rootScope, $http, $q, $timeout) {
    return _SearchEngineRequests.call(this, $rootScope, $http, $q, $timeout, false, true) || this;
  }
  _inheritsLoose(BingSearchRequestsServiceV4, _SearchEngineRequests);
  var _proto = BingSearchRequestsServiceV4.prototype;
  _proto.getBaseRequestQuery = function getBaseRequestQuery(query, count) {
    return "q=" + encodeURIComponent(query) + "&" + ("count=" + (count || 10) + "&") + "textDecorations=true&" + "textFormat=HTML";
  };
  _proto.getRequestQuery = function getRequestQuery(query, count, offset) {
    return "q=" + encodeURIComponent(query) + "&" + ("count=" + (count || 10) + "&") + ("offset=" + (offset || 0) + "&") + "textDecorations=true&" + "textFormat=HTML";
  };
  _proto.getParsedSearchResults$ = function getParsedSearchResults$(url) {
    var _this = this;
    var deferred = this.$q.defer();
    this.getSearchResults$(url).then(function (resp) {
      var totalResultsCount = 0;
      var results = [];
      var type = "";
      var resultData = {};
      var data = resp.data;
      if (typeof data === "string" || data instanceof String) {
        resultData = {
          totalResultsCount: 0,
          results: []
        };
      } else if (_this.demoMode) {
        resultData = {
          totalResultsCount: data.data.totalResultsCount,
          results: data.data.items || []
        };
      } else {
        if (data) {
          type = data["_type"];
          switch (data["_type"]) {
            case "News":
              totalResultsCount = data.totalEstimatedMatches ? data.totalEstimatedMatches : 0;
              results = data.value || [];
              break;
            case "SearchResponse":
              totalResultsCount = data.webPages && data.webPages.totalEstimatedMatches ? data.webPages.totalEstimatedMatches : 0;
              results = data.webPages && data.webPages.value ? data.webPages.value : [];
              break;
            default:
              break;
          }
        }
        resultData = {
          totalResultsCount: totalResultsCount,
          results: BingSearchRequestsServiceV4.parseSearchResults(type, results)
        };
      }
      deferred.resolve(resultData);
    })["catch"](function (error) {
      deferred.reject(error);
    });
    return deferred.promise;
  };
  BingSearchRequestsServiceV4.parseSearchResults = function parseSearchResults(type, results) {
    return results.map(function (result) {
      var parsedObj = {
        title: result.name,
        titleHtml: result.name,
        linkUrl: result.url
      };
      switch (type) {
        case "News":
          parsedObj.description = result.description || "";
          parsedObj.descriptionHtml = result.description || "";
          parsedObj.date = result.datePublished || "";
          break;
        case "SearchResponse":
          parsedObj.description = result.snippet || "";
          parsedObj.descriptionHtml = result.snippet || "";
          break;
        default:
          break;
      }
      return parsedObj;
    });
  };
  return BingSearchRequestsServiceV4;
}(SearchEngineRequestsServiceV4);
module.exports = {
  BingSearchRequestsServiceV4: BingSearchRequestsServiceV4
};

},{"./search-engine-requests-service-v4":870}],856:[function(require,module,exports){
"use strict";

function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
var _require = require("./requests-service-v4"),
  RequestsServiceV4 = _require.RequestsServiceV4;
var _require2 = require("../../../common/utils/common-v4"),
  getBaseApi = _require2.getBaseApi;
var ConfigRequestsServiceV4 = function (_RequestsServiceV) {
  function ConfigRequestsServiceV4($rootScope, $http, $q, $timeout) {
    var _this;
    _this = _RequestsServiceV.call(this, $rootScope, $http, $q, $timeout) || this;
    _this.configUrl = "";
    return _this;
  }
  _inheritsLoose(ConfigRequestsServiceV4, _RequestsServiceV);
  var _proto = ConfigRequestsServiceV4.prototype;
  _proto.setUrls = function setUrls(apiConfig) {
    this.configUrl = getBaseApi(apiConfig) + apiConfig.config;
  };
  _proto.setTimeouts = function setTimeouts(timeouts) {};
  _proto.getConfig$ = function getConfig$() {
    var deferred = this.$q.defer();
    var req = {
      method: "GET",
      url: this.configUrl
    };
    this.$http(req).then(function (resp) {
      deferred.resolve(resp.data);
    })["catch"](function (error) {
      deferred.reject(error);
    });
    return deferred.promise;
  };
  return ConfigRequestsServiceV4;
}(RequestsServiceV4);
module.exports = {
  ConfigRequestsServiceV4: ConfigRequestsServiceV4
};

},{"../../../common/utils/common-v4":687,"./requests-service-v4":868}],857:[function(require,module,exports){
"use strict";

function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
var _require = require("./requests-service-v4"),
  RequestsServiceV4 = _require.RequestsServiceV4;
var _require2 = require("../../../common/utils/common-v4"),
  getBaseApi = _require2.getBaseApi;
var ExtraSourcesRequestsServiceV4 = function (_RequestsServiceV) {
  function ExtraSourcesRequestsServiceV4($rootScope, $http, $q, $timeout) {
    var _this;
    _this = _RequestsServiceV.call(this, $rootScope, $http, $q, $timeout) || this;
    _this.getExtraSearchResultsUrl = "";
    _this.getExtraSearchResultUrl = "";
    _this.DEFAULT_ALL_RESULTS_TIMEOUT = 240000;
    _this.DEFAULT_SINGLE_RESULT_TIMEOUT = 240000;
    return _this;
  }
  _inheritsLoose(ExtraSourcesRequestsServiceV4, _RequestsServiceV);
  var _proto = ExtraSourcesRequestsServiceV4.prototype;
  _proto.setUrls = function setUrls(apiConfig) {
    var baseApi = getBaseApi(apiConfig);
    this.getExtraSearchResultsUrl = baseApi + apiConfig.get_extra_search_results;
    this.getExtraSearchResultUrl = baseApi + apiConfig.get_extra_search_result;
  };
  _proto.setTimeouts = function setTimeouts(timeouts) {
    if (timeouts.extra_sources_all_results) this.DEFAULT_ALL_RESULTS_TIMEOUT = timeouts.extra_sources_all_results;
    if (timeouts.extra_sources_single_result) {
      this.DEFAULT_SINGLE_RESULT_TIMEOUT = timeouts.extra_sources_single_result;
    }
  };
  _proto.getExtraSearchResults$ = function getExtraSearchResults$(personName, firstName, lastName, isCompany, isBatch, sites) {
    var _this2 = this;
    var deferred = this.$q.defer();
    var cancelledResolveObject = RequestsServiceV4.getCancelledResolveObject([]);
    var cancellerWrapper = this.createDeferredCancellerWrapper(cancelledResolveObject);
    var timeoutPromise = this.createTimeoutPromise(cancellerWrapper, this.DEFAULT_ALL_RESULTS_TIMEOUT);
    var req = {
      method: "POST",
      url: this.getExtraSearchResultsUrl,
      data: {
        personName: personName,
        firstName: firstName,
        lastName: lastName,
        isCompany: isCompany,
        isBatch: isBatch,
        sites: sites
      },
      timeout: cancellerWrapper == null ? void 0 : cancellerWrapper.deferred.promise
    };
    this.$http(req).then(function (resp) {
      _this2.$timeout.cancel(timeoutPromise);
      _this2.removeDeferredCancellerWrapper(cancellerWrapper);
      deferred.resolve(RequestsServiceV4.getRespDataWithStatus(resp));
    })["catch"](function (error) {
      _this2.$timeout.cancel(timeoutPromise);
      _this2.removeDeferredCancellerWrapper(cancellerWrapper);
      if (RequestsServiceV4.checkRequestCancelledError(error)) {
        deferred.resolve(cancelledResolveObject);
      } else {
        deferred.reject(RequestsServiceV4.getErrorWithStatus(error));
      }
    });
    return deferred.promise;
  };
  return ExtraSourcesRequestsServiceV4;
}(RequestsServiceV4);
module.exports = {
  ExtraSourcesRequestsServiceV4: ExtraSourcesRequestsServiceV4
};

},{"../../../common/utils/common-v4":687,"./requests-service-v4":868}],858:[function(require,module,exports){
"use strict";

function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
var _require = require("./requests-service-v4"),
  RequestsServiceV4 = _require.RequestsServiceV4;
var _require2 = require("../../../common/utils/common-v4"),
  getBaseApi = _require2.getBaseApi;
var GoogleNewsRssRequestsServiceV4 = function (_RequestsServiceV) {
  function GoogleNewsRssRequestsServiceV4($rootScope, $http, $q, $timeout) {
    var _this;
    _this = _RequestsServiceV.call(this, $rootScope, $http, $q, $timeout) || this;
    _this.getGoogleNewsRssResultsUrl = "";
    _this.DEFAULT_ALL_RESULTS_TIMEOUT = 120000;
    return _this;
  }
  _inheritsLoose(GoogleNewsRssRequestsServiceV4, _RequestsServiceV);
  var _proto = GoogleNewsRssRequestsServiceV4.prototype;
  _proto.setUrls = function setUrls(apiConfig) {
    this.getGoogleNewsRssResultsUrl = getBaseApi(apiConfig) + apiConfig.get_google_news_rss_results;
  };
  _proto.setTimeouts = function setTimeouts(timeouts) {
    if (timeouts.google_news_rss_all_results) this.DEFAULT_ALL_RESULTS_TIMEOUT = timeouts.google_news_rss_all_results;
  };
  _proto.getGoogleNewsRssResults$ = function getGoogleNewsRssResults$(personName, firstName, lastName, isCompany, shouldGetContent, dateFrom, dateTo, languages, mandatoryKeywords, optionalKeywords) {
    var _this2 = this;
    var deferred = this.$q.defer();
    var cancelledResolveObject = RequestsServiceV4.getCancelledResolveObject([]);
    var cancellerWrapper = this.createDeferredCancellerWrapper(cancelledResolveObject);
    var timeoutPromise = this.createTimeoutPromise(cancellerWrapper, this.DEFAULT_ALL_RESULTS_TIMEOUT);
    var req = {
      method: "POST",
      url: this.getGoogleNewsRssResultsUrl,
      data: {
        personName: personName,
        firstName: firstName,
        lastName: lastName,
        isCompany: isCompany,
        shouldGetContent: shouldGetContent,
        dateFrom: dateFrom,
        dateTo: dateTo,
        languages: languages,
        mandatoryKeywords: mandatoryKeywords,
        optionalKeywords: optionalKeywords
      },
      timeout: cancellerWrapper == null ? void 0 : cancellerWrapper.deferred.promise
    };
    this.$http(req).then(function (resp) {
      _this2.$timeout.cancel(timeoutPromise);
      _this2.removeDeferredCancellerWrapper(cancellerWrapper);
      deferred.resolve(RequestsServiceV4.getRespDataWithStatus(resp));
    })["catch"](function (error) {
      _this2.$timeout.cancel(timeoutPromise);
      _this2.removeDeferredCancellerWrapper(cancellerWrapper);
      if (RequestsServiceV4.checkRequestCancelledError(error)) {
        deferred.resolve(cancelledResolveObject);
      } else {
        deferred.reject(RequestsServiceV4.getErrorWithStatus(error));
      }
    });
    return deferred.promise;
  };
  return GoogleNewsRssRequestsServiceV4;
}(RequestsServiceV4);
module.exports = {
  GoogleNewsRssRequestsServiceV4: GoogleNewsRssRequestsServiceV4
};

},{"../../../common/utils/common-v4":687,"./requests-service-v4":868}],859:[function(require,module,exports){
"use strict";

function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
var _require = require("./requests-service-v4"),
  RequestsServiceV4 = _require.RequestsServiceV4;
var _require2 = require("../../../common/utils/common-v4"),
  getBaseApi = _require2.getBaseApi;
var _require3 = require("../../templates/google-nlp-response-templates"),
  getGoogleNlpDocumentEntitiesTmplt = _require3.getGoogleNlpDocumentEntitiesTmplt,
  getGoogleNlpDocumentInfoTmplt = _require3.getGoogleNlpDocumentInfoTmplt,
  getGoogleNlpDocumentSentimentTmplt = _require3.getGoogleNlpDocumentSentimentTmplt;
var GoogleNlpRequestsServiceV4 = function (_RequestsServiceV) {
  function GoogleNlpRequestsServiceV4($rootScope, $http, $q, $timeout) {
    var _this;
    _this = _RequestsServiceV.call(this, $rootScope, $http, $q, $timeout) || this;
    _this.recognizeEntitiesUrl = "";
    _this.analyzeSentimentUrl = "";
    _this.annotateTextUrl = "";
    _this.DEFAULT_ENTITIES_TIMEOUT = 120000;
    _this.DEFAULT_SENTIMENT_TIMEOUT = 120000;
    _this.DEFAULT_INFO_TIMEOUT = 120000;
    return _this;
  }
  _inheritsLoose(GoogleNlpRequestsServiceV4, _RequestsServiceV);
  var _proto = GoogleNlpRequestsServiceV4.prototype;
  _proto.setUrls = function setUrls(apiConfig) {
    var baseApi = getBaseApi(apiConfig);
    this.recognizeEntitiesUrl = baseApi + apiConfig.analyze_entities;
    this.analyzeSentimentUrl = baseApi + apiConfig.analyze_sentiment;
    this.annotateTextUrl = baseApi + apiConfig.annotate_text;
  };
  _proto.setTimeouts = function setTimeouts(timeouts) {
    if (timeouts.google_nlp_get_entities) this.DEFAULT_ENTITIES_TIMEOUT = timeouts.google_nlp_get_entities;
    if (timeouts.google_nlp_get_sentiment) {
      this.DEFAULT_SENTIMENT_TIMEOUT = timeouts.google_nlp_get_sentiment;
    }
    if (timeouts.google_nlp_get_info) {
      this.DEFAULT_INFO_TIMEOUT = timeouts.google_nlp_get_info;
    }
  };
  _proto.getDocumentEntities$ = function getDocumentEntities$(text) {
    var service = this;
    var deferred = this.$q.defer();
    var cancelledResolveObject = RequestsServiceV4.getCancelledResolveObject(getGoogleNlpDocumentEntitiesTmplt(null, false));
    var cancellerWrapper = this.createDeferredCancellerWrapper(cancelledResolveObject);
    var timeoutPromise = this.createTimeoutPromise(cancellerWrapper, service.DEFAULT_ENTITIES_TIMEOUT);
    var req = {
      method: "POST",
      url: this.recognizeEntitiesUrl,
      data: {
        text: text
      },
      timeout: cancellerWrapper == null ? void 0 : cancellerWrapper.deferred.promise
    };
    this.$http(req).then(function (resp) {
      service.$timeout.cancel(timeoutPromise);
      service.removeDeferredCancellerWrapper(cancellerWrapper);
      deferred.resolve(RequestsServiceV4.getRespDataWithStatus(resp));
    })["catch"](function (error) {
      service.$timeout.cancel(timeoutPromise);
      service.removeDeferredCancellerWrapper(cancellerWrapper);
      if (RequestsServiceV4.checkRequestCancelledError(error)) {
        deferred.resolve(cancelledResolveObject);
      } else {
        deferred.reject(RequestsServiceV4.getErrorWithStatus(error));
      }
    });
    return deferred.promise;
  };
  _proto.getDocumentInfo$ = function getDocumentInfo$(text) {
    var _this2 = this;
    var deferred = this.$q.defer();
    var cancelledResolveObject = RequestsServiceV4.getCancelledResolveObject(getGoogleNlpDocumentInfoTmplt());
    var cancellerWrapper = this.createDeferredCancellerWrapper(cancelledResolveObject);
    var timeoutPromise = this.createTimeoutPromise(cancellerWrapper, this.DEFAULT_INFO_TIMEOUT);
    var req = {
      method: "POST",
      url: this.annotateTextUrl,
      data: {
        text: text
      },
      timeout: cancellerWrapper == null ? void 0 : cancellerWrapper.deferred.promise
    };
    this.$http(req).then(function (resp) {
      _this2.$timeout.cancel(timeoutPromise);
      _this2.removeDeferredCancellerWrapper(cancellerWrapper);
      deferred.resolve(RequestsServiceV4.getRespDataWithStatus(resp));
    })["catch"](function (error) {
      _this2.$timeout.cancel(timeoutPromise);
      _this2.removeDeferredCancellerWrapper(cancellerWrapper);
      if (RequestsServiceV4.checkRequestCancelledError(error)) {
        deferred.resolve(cancelledResolveObject);
      } else {
        deferred.reject(RequestsServiceV4.getErrorWithStatus(error));
      }
    });
    return deferred.promise;
  };
  _proto.getDocumentSentiment$ = function getDocumentSentiment$(text) {
    var _this3 = this;
    var deferred = this.$q.defer();
    var cancelledResolveObject = RequestsServiceV4.getCancelledResolveObject(getGoogleNlpDocumentSentimentTmplt(null, false));
    var cancellerWrapper = this.createDeferredCancellerWrapper(cancelledResolveObject);
    var timeoutPromise = this.createTimeoutPromise(cancellerWrapper, this.DEFAULT_SENTIMENT_TIMEOUT);
    var req = {
      method: "POST",
      url: this.analyzeSentimentUrl,
      data: {
        text: text
      },
      timeout: cancellerWrapper == null ? void 0 : cancellerWrapper.deferred.promise
    };
    this.$http(req).then(function (resp) {
      _this3.$timeout.cancel(timeoutPromise);
      _this3.removeDeferredCancellerWrapper(cancellerWrapper);
      deferred.resolve(RequestsServiceV4.getRespDataWithStatus(resp));
    })["catch"](function (error) {
      _this3.$timeout.cancel(timeoutPromise);
      _this3.removeDeferredCancellerWrapper(cancellerWrapper);
      if (RequestsServiceV4.checkRequestCancelledError(error)) {
        deferred.resolve(cancelledResolveObject);
      } else {
        deferred.reject(RequestsServiceV4.getErrorWithStatus(error));
      }
    });
    return deferred.promise;
  };
  return GoogleNlpRequestsServiceV4;
}(RequestsServiceV4);
module.exports = {
  GoogleNlpRequestsServiceV4: GoogleNlpRequestsServiceV4
};

},{"../../../common/utils/common-v4":687,"../../templates/google-nlp-response-templates":886,"./requests-service-v4":868}],860:[function(require,module,exports){
"use strict";

function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
var _require = require("./search-engine-requests-service-v4"),
  SearchEngineRequestsServiceV4 = _require.SearchEngineRequestsServiceV4;
var GoogleSearchRequestsServiceV4 = function (_SearchEngineRequests) {
  function GoogleSearchRequestsServiceV4($rootScope, $http, $q, $timeout) {
    return _SearchEngineRequests.call(this, $rootScope, $http, $q, $timeout, true, false) || this;
  }
  _inheritsLoose(GoogleSearchRequestsServiceV4, _SearchEngineRequests);
  var _proto = GoogleSearchRequestsServiceV4.prototype;
  _proto.getBaseRequestQuery = function getBaseRequestQuery(query, dateFrom, dateTo, languages, userCountry) {
    var q = query;
    if (dateFrom) {
      q += (q ? " " : "") + "after:" + dateFrom.getFullYear() + "-" + ("0" + (dateFrom.getMonth() + 1)).slice(-2).toString() + "-" + ("0" + dateFrom.getDate()).slice(-2).toString();
    }
    if (dateTo) {
      q += (q ? " " : "") + "before:" + dateTo.getFullYear() + "-" + ("0" + (dateTo.getMonth() + 1)).slice(-2).toString() + "-" + ("0" + dateTo.getDate()).slice(-2).toString();
    }
    var requestQuery = "q=" + encodeURIComponent(q);
    if (languages && languages.length) {
      requestQuery += "&" + ("lr=" + (languages.length > 1 ? "(" + languages.join("|") + ")" : languages[0]));
    }
    if (userCountry) {
      requestQuery += "&gl=" + userCountry.toLowerCase();
    }
    return requestQuery;
  };
  _proto.getRequestQuery = function getRequestQuery(query, dateFrom, dateTo, languages, userCountry, offset, sortBy) {
    var q = query;
    if (dateFrom) {
      q += (q ? " " : "") + "after:" + dateFrom.getFullYear() + "-" + ("0" + (dateFrom.getMonth() + 1)).slice(-2).toString() + "-" + ("0" + dateFrom.getDate()).slice(-2).toString();
    }
    if (dateTo) {
      q += (q ? " " : "") + "before:" + dateTo.getFullYear() + "-" + ("0" + (dateTo.getMonth() + 1)).slice(-2).toString() + "-" + ("0" + dateTo.getDate()).slice(-2).toString();
    }
    var requestQuery = "q=" + encodeURIComponent(q);
    if (languages && languages.length) {
      requestQuery += "&" + ("lr=" + (languages.length > 1 ? "(" + languages.join("|") + ")" : languages[0]));
    }
    if (userCountry) {
      requestQuery += "&gl=" + userCountry.toLowerCase();
    }
    if (sortBy === "date") {
      requestQuery += "&sort=date";
    }
    requestQuery += "&start=" + offset;
    return requestQuery;
  };
  _proto.getParsedSearchResults$ = function getParsedSearchResults$(url) {
    var _this = this;
    var deferred = this.$q.defer();
    this.getSearchResults$(url).then(function (resp) {
      var resultData = {};
      var data = resp.data;
      if (typeof data === "string" || data instanceof String) {
        resultData = {
          totalResultsCount: 0,
          results: []
        };
      } else if (_this.demoMode) {
        resultData = {
          totalResultsCount: data.data.totalResultsCount,
          results: data.data.items || []
        };
      } else {
        resultData = {
          totalResultsCount: data && data.searchInformation ? parseInt(data.searchInformation.totalResults, 10) : 0,
          results: data && data.items ? GoogleSearchRequestsServiceV4.parseSearchResults(data.items) : []
        };
      }
      deferred.resolve(resultData);
    })["catch"](function (error) {
      deferred.reject(error);
    });
    return deferred.promise;
  };
  GoogleSearchRequestsServiceV4.parseSearchResults = function parseSearchResults(results) {
    return results.map(function (result) {
      return {
        title: result.title,
        titleHtml: result.htmlTitle,
        description: result.snippet,
        descriptionHtml: result.htmlSnippet,
        linkUrl: result.link
      };
    });
  };
  return GoogleSearchRequestsServiceV4;
}(SearchEngineRequestsServiceV4);
module.exports = {
  GoogleSearchRequestsServiceV4: GoogleSearchRequestsServiceV4
};

},{"./search-engine-requests-service-v4":870}],861:[function(require,module,exports){
"use strict";

var _require = require("./aleph-occrp-requests-service-v4"),
  AlephOccrpRequestsServiceV4 = _require.AlephOccrpRequestsServiceV4;
var _require2 = require("./bing-search-equests-service-v4"),
  BingSearchRequestsServiceV4 = _require2.BingSearchRequestsServiceV4;
var _require3 = require("./config-requests-service-v4"),
  ConfigRequestsServiceV4 = _require3.ConfigRequestsServiceV4;
var _require4 = require("./extra-sources-requests-service-v4"),
  ExtraSourcesRequestsServiceV4 = _require4.ExtraSourcesRequestsServiceV4;
var _require5 = require("./google-news-rss-requests-service-v4"),
  GoogleNewsRssRequestsServiceV4 = _require5.GoogleNewsRssRequestsServiceV4;
var _require6 = require("./google-nlp-requests-service-v4"),
  GoogleNlpRequestsServiceV4 = _require6.GoogleNlpRequestsServiceV4;
var _require7 = require("./google-search-requests-service-v4"),
  GoogleSearchRequestsServiceV4 = _require7.GoogleSearchRequestsServiceV4;
var _require8 = require("./media-py-gpt-requests-service-v1"),
  MediaPyGptRequestsServiceV1 = _require8.MediaPyGptRequestsServiceV1;
var _require9 = require("./media-py-llm-requests-service-v1"),
  MediaPyLLMRequestsServiceV1 = _require9.MediaPyLLMRequestsServiceV1;
var _require10 = require("./media-py-requests-service-v6"),
  MediaPyRequestsServiceV6 = _require10.MediaPyRequestsServiceV6;
var _require11 = require("./open-corporates-requests-service-v4"),
  OpenCorporatesRequestsServiceV4 = _require11.OpenCorporatesRequestsServiceV4;
var _require12 = require("./open-sanctions-requests-service-v4"),
  OpenSanctionsRequestsServiceV4 = _require12.OpenSanctionsRequestsServiceV4;
var _require13 = require("./parse-document-requests-service-v4"),
  ParseDocumentRequestsServiceV4 = _require13.ParseDocumentRequestsServiceV4;
var _require14 = require("./scrape-requests-service-v4"),
  ScrapeRequestsServiceV4 = _require14.ScrapeRequestsServiceV4;
var _require15 = require("./stock-market-requests-service-v4"),
  StockMarketRequestsServiceV4 = _require15.StockMarketRequestsServiceV4;
module.exports = {
  AlephOccrpRequestsServiceV4: AlephOccrpRequestsServiceV4,
  BingSearchRequestsServiceV4: BingSearchRequestsServiceV4,
  ConfigRequestsServiceV4: ConfigRequestsServiceV4,
  ExtraSourcesRequestsServiceV4: ExtraSourcesRequestsServiceV4,
  GoogleNewsRssRequestsServiceV4: GoogleNewsRssRequestsServiceV4,
  GoogleNlpRequestsServiceV4: GoogleNlpRequestsServiceV4,
  GoogleSearchRequestsServiceV4: GoogleSearchRequestsServiceV4,
  MediaPyGptRequestsServiceV1: MediaPyGptRequestsServiceV1,
  MediaPyLLMRequestsServiceV1: MediaPyLLMRequestsServiceV1,
  MediaPyRequestsServiceV6: MediaPyRequestsServiceV6,
  OpenCorporatesRequestsServiceV4: OpenCorporatesRequestsServiceV4,
  OpenSanctionsRequestsServiceV4: OpenSanctionsRequestsServiceV4,
  ParseDocumentRequestsServiceV4: ParseDocumentRequestsServiceV4,
  ScrapeRequestsServiceV4: ScrapeRequestsServiceV4,
  StockMarketRequestsServiceV4: StockMarketRequestsServiceV4
};

},{"./aleph-occrp-requests-service-v4":854,"./bing-search-equests-service-v4":855,"./config-requests-service-v4":856,"./extra-sources-requests-service-v4":857,"./google-news-rss-requests-service-v4":858,"./google-nlp-requests-service-v4":859,"./google-search-requests-service-v4":860,"./media-py-gpt-requests-service-v1":862,"./media-py-llm-requests-service-v1":863,"./media-py-requests-service-v6":864,"./open-corporates-requests-service-v4":865,"./open-sanctions-requests-service-v4":866,"./parse-document-requests-service-v4":867,"./scrape-requests-service-v4":869,"./stock-market-requests-service-v4":871}],862:[function(require,module,exports){
"use strict";

function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
var _require = require("./requests-service-v4"),
  RequestsServiceV4 = _require.RequestsServiceV4;
var _require2 = require("../../../common/utils/common-v4"),
  getBaseApi = _require2.getBaseApi;
var _require3 = require("../../templates/media-py-gpt-response-templates"),
  getMediaPyGptRiskAssesmentTmplt = _require3.getMediaPyGptRiskAssesmentTmplt,
  getMediaPyGptDocumentAnalysisTmplt = _require3.getMediaPyGptDocumentAnalysisTmplt,
  getMediaPyGptDocumentCompressionTmplt = _require3.getMediaPyGptDocumentCompressionTmplt,
  getMediaPyGptPersonSummaryTmplt = _require3.getMediaPyGptPersonSummaryTmplt,
  getMediaPyGptRelatedEntitiesTmplt = _require3.getMediaPyGptRelatedEntitiesTmplt,
  getMediaPyGptPersonMatchingTmplt = _require3.getMediaPyGptPersonMatchingTmplt,
  getMediaPyGptNegativeContextAnalysisTmplt = _require3.getMediaPyGptNegativeContextAnalysisTmplt,
  getMediaPyGptChainRiskAssesmentTmplt = _require3.getMediaPyGptChainRiskAssesmentTmplt,
  getMediaPyGptGeneralRiskAssesmentTmplt = _require3.getMediaPyGptGeneralRiskAssesmentTmplt,
  getMediaPyGptMostImportantEntitiesTmplt = _require3.getMediaPyGptMostImportantEntitiesTmplt,
  getMediaPyGptOverallPersonSummaryTmplt = _require3.getMediaPyGptOverallPersonSummaryTmplt,
  getMediaPyGptGeneralNegativeContextAnalysisTmplt = _require3.getMediaPyGptGeneralNegativeContextAnalysisTmplt,
  getMediaPyGptChainGeneralRiskAssessmentTmplt = _require3.getMediaPyGptChainGeneralRiskAssessmentTmplt,
  getMediaPyGptMostImportantKeywordsTmplt = _require3.getMediaPyGptMostImportantKeywordsTmplt,
  getMediaPyGptConnectionsGraphTmplt = _require3.getMediaPyGptConnectionsGraphTmplt,
  getMediaPyGptCheckIsPersonMatchTmplt = _require3.getMediaPyGptCheckIsPersonMatchTmplt;
var MediaPyGptRequestsServiceV1 = function (_RequestsServiceV) {
  function MediaPyGptRequestsServiceV1($rootScope, $http, $q, $timeout) {
    var _this;
    _this = _RequestsServiceV.call(this, $rootScope, $http, $q, $timeout) || this;
    _this.mediaPyGptUrl = "";
    _this.DEFAULT_MEDIA_PY_GPT_TIMEOUT = 240000;
    return _this;
  }
  _inheritsLoose(MediaPyGptRequestsServiceV1, _RequestsServiceV);
  var _proto = MediaPyGptRequestsServiceV1.prototype;
  _proto.setUrls = function setUrls(apiConfig) {
    this.mediaPyGptUrl = getBaseApi(apiConfig) + apiConfig.media_py_gpt;
  };
  _proto.setTimeouts = function setTimeouts(timeouts) {
    if (timeouts.media_search_py_gpt_process) {
      this.DEFAULT_MEDIA_PY_GPT_TIMEOUT = timeouts.media_search_py_gpt_process;
    }
  };
  _proto.getUrl = function getUrl(operationType) {
    return this.mediaPyGptUrl;
  };
  MediaPyGptRequestsServiceV1.getQueryParams = function getQueryParams(operationType) {
    return {
      operationType: operationType
    };
  };
  _proto.sendCheckIsPersonMatchRequest$ = function sendCheckIsPersonMatchRequest$(text, name) {
    var _this2 = this;
    var deferred = this.$q.defer();
    var cancelledResolveObject = RequestsServiceV4.getCancelledResolveObject(getMediaPyGptCheckIsPersonMatchTmplt());
    var cancellerWrapper = this.createDeferredCancellerWrapper(cancelledResolveObject);
    var timeoutPromise = this.createTimeoutPromise(cancellerWrapper, this.DEFAULT_MEDIA_PY_GPT_TIMEOUT);
    var req = {
      method: "POST",
      url: this.getUrl("person_match"),
      params: MediaPyGptRequestsServiceV1.getQueryParams("person_match"),
      data: {
        input_data: {
          text: text,
          name: name
        }
      },
      timeout: cancellerWrapper == null ? void 0 : cancellerWrapper.deferred.promise
    };
    this.$http(req).then(function (resp) {
      _this2.$timeout.cancel(timeoutPromise);
      _this2.removeDeferredCancellerWrapper(cancellerWrapper);
      deferred.resolve(RequestsServiceV4.getRespDataWithStatus(resp));
    })["catch"](function (error) {
      _this2.$timeout.cancel(timeoutPromise);
      _this2.removeDeferredCancellerWrapper(cancellerWrapper);
      if (RequestsServiceV4.checkRequestCancelledError(error)) {
        deferred.resolve(cancelledResolveObject);
      } else {
        deferred.reject(RequestsServiceV4.getErrorWithStatus(error));
      }
    });
    return deferred.promise;
  };
  _proto.sendRiskAssesmentRequest$ = function sendRiskAssesmentRequest$(text, name) {
    var _this3 = this;
    var deferred = this.$q.defer();
    var cancelledResolveObject = RequestsServiceV4.getCancelledResolveObject(getMediaPyGptRiskAssesmentTmplt(null));
    var cancellerWrapper = this.createDeferredCancellerWrapper(cancelledResolveObject);
    var timeoutPromise = this.createTimeoutPromise(cancellerWrapper, this.DEFAULT_MEDIA_PY_GPT_TIMEOUT);
    var req = {
      method: "POST",
      url: this.getUrl("risk_assessment"),
      params: MediaPyGptRequestsServiceV1.getQueryParams("risk_assessment"),
      data: {
        input_data: {
          text: text,
          name: name
        }
      },
      timeout: cancellerWrapper == null ? void 0 : cancellerWrapper.deferred.promise
    };
    this.$http(req).then(function (resp) {
      _this3.$timeout.cancel(timeoutPromise);
      _this3.removeDeferredCancellerWrapper(cancellerWrapper);
      deferred.resolve(RequestsServiceV4.getRespDataWithStatus(resp));
    })["catch"](function (error) {
      _this3.$timeout.cancel(timeoutPromise);
      _this3.removeDeferredCancellerWrapper(cancellerWrapper);
      if (RequestsServiceV4.checkRequestCancelledError(error)) {
        deferred.resolve(cancelledResolveObject);
      } else {
        deferred.reject(RequestsServiceV4.getErrorWithStatus(error));
      }
    });
    return deferred.promise;
  };
  _proto.sendDocumentAnalysisRequest$ = function sendDocumentAnalysisRequest$(text) {
    var _this4 = this;
    var deferred = this.$q.defer();
    var cancelledResolveObject = RequestsServiceV4.getCancelledResolveObject(getMediaPyGptDocumentAnalysisTmplt(null));
    var cancellerWrapper = this.createDeferredCancellerWrapper(cancelledResolveObject);
    var timeoutPromise = this.createTimeoutPromise(cancellerWrapper, this.DEFAULT_MEDIA_PY_GPT_TIMEOUT);
    var req = {
      method: "POST",
      url: this.getUrl("document_analysis"),
      params: MediaPyGptRequestsServiceV1.getQueryParams("document_analysis"),
      data: {
        input_data: {
          text: text
        }
      },
      timeout: cancellerWrapper == null ? void 0 : cancellerWrapper.deferred.promise
    };
    this.$http(req).then(function (resp) {
      _this4.$timeout.cancel(timeoutPromise);
      _this4.removeDeferredCancellerWrapper(cancellerWrapper);
      deferred.resolve(RequestsServiceV4.getRespDataWithStatus(resp));
    })["catch"](function (error) {
      _this4.$timeout.cancel(timeoutPromise);
      _this4.removeDeferredCancellerWrapper(cancellerWrapper);
      if (RequestsServiceV4.checkRequestCancelledError(error)) {
        deferred.resolve(cancelledResolveObject);
      } else {
        deferred.reject(RequestsServiceV4.getErrorWithStatus(error));
      }
    });
    return deferred.promise;
  };
  _proto.sendDocumentCompressionRequest$ = function sendDocumentCompressionRequest$(text, name) {
    var _this5 = this;
    var deferred = this.$q.defer();
    var cancelledResolveObject = RequestsServiceV4.getCancelledResolveObject(getMediaPyGptDocumentCompressionTmplt());
    var cancellerWrapper = this.createDeferredCancellerWrapper(cancelledResolveObject);
    var timeoutPromise = this.createTimeoutPromise(cancellerWrapper, this.DEFAULT_MEDIA_PY_GPT_TIMEOUT);
    var req = {
      method: "POST",
      url: this.getUrl("document_compression"),
      params: MediaPyGptRequestsServiceV1.getQueryParams("document_compression"),
      data: {
        input_data: {
          text: text,
          name: name
        }
      },
      timeout: cancellerWrapper == null ? void 0 : cancellerWrapper.deferred.promise
    };
    this.$http(req).then(function (resp) {
      _this5.$timeout.cancel(timeoutPromise);
      _this5.removeDeferredCancellerWrapper(cancellerWrapper);
      deferred.resolve(RequestsServiceV4.getRespDataWithStatus(resp));
    })["catch"](function (error) {
      _this5.$timeout.cancel(timeoutPromise);
      _this5.removeDeferredCancellerWrapper(cancellerWrapper);
      if (RequestsServiceV4.checkRequestCancelledError(error)) {
        deferred.resolve(cancelledResolveObject);
      } else {
        deferred.reject(RequestsServiceV4.getErrorWithStatus(error));
      }
    });
    return deferred.promise;
  };
  _proto.sendPersonSummaryRequest$ = function sendPersonSummaryRequest$(text, name) {
    var _this6 = this;
    var deferred = this.$q.defer();
    var cancelledResolveObject = RequestsServiceV4.getCancelledResolveObject(getMediaPyGptPersonSummaryTmplt(null));
    var cancellerWrapper = this.createDeferredCancellerWrapper(cancelledResolveObject);
    var timeoutPromise = this.createTimeoutPromise(cancellerWrapper, this.DEFAULT_MEDIA_PY_GPT_TIMEOUT);
    var req = {
      method: "POST",
      url: this.getUrl("person_summary"),
      params: MediaPyGptRequestsServiceV1.getQueryParams("person_summary"),
      data: {
        input_data: {
          text: text,
          name: name
        }
      },
      timeout: cancellerWrapper == null ? void 0 : cancellerWrapper.deferred.promise
    };
    this.$http(req).then(function (resp) {
      _this6.$timeout.cancel(timeoutPromise);
      _this6.removeDeferredCancellerWrapper(cancellerWrapper);
      deferred.resolve(RequestsServiceV4.getRespDataWithStatus(resp));
    })["catch"](function (error) {
      _this6.$timeout.cancel(timeoutPromise);
      _this6.removeDeferredCancellerWrapper(cancellerWrapper);
      if (RequestsServiceV4.checkRequestCancelledError(error)) {
        deferred.resolve(cancelledResolveObject);
      } else {
        deferred.reject(RequestsServiceV4.getErrorWithStatus(error));
      }
    });
    return deferred.promise;
  };
  _proto.sendRelatedEntitiesRequest$ = function sendRelatedEntitiesRequest$(text) {
    var _this7 = this;
    var deferred = this.$q.defer();
    var cancelledResolveObject = RequestsServiceV4.getCancelledResolveObject(getMediaPyGptRelatedEntitiesTmplt(null));
    var cancellerWrapper = this.createDeferredCancellerWrapper(cancelledResolveObject);
    var timeoutPromise = this.createTimeoutPromise(cancellerWrapper, this.DEFAULT_MEDIA_PY_GPT_TIMEOUT);
    var req = {
      method: "POST",
      url: this.getUrl("related_persons_and_organizations"),
      params: MediaPyGptRequestsServiceV1.getQueryParams("related_persons_and_organizations"),
      data: {
        input_data: {
          text: text
        }
      },
      timeout: cancellerWrapper == null ? void 0 : cancellerWrapper.deferred.promise
    };
    this.$http(req).then(function (resp) {
      _this7.$timeout.cancel(timeoutPromise);
      _this7.removeDeferredCancellerWrapper(cancellerWrapper);
      deferred.resolve(RequestsServiceV4.getRespDataWithStatus(resp));
    })["catch"](function (error) {
      _this7.$timeout.cancel(timeoutPromise);
      _this7.removeDeferredCancellerWrapper(cancellerWrapper);
      if (RequestsServiceV4.checkRequestCancelledError(error)) {
        deferred.resolve(cancelledResolveObject);
      } else {
        deferred.reject(RequestsServiceV4.getErrorWithStatus(error));
      }
    });
    return deferred.promise;
  };
  _proto.sendPersonMatchingRequest$ = function sendPersonMatchingRequest$(generalSummary, summary) {
    var _this8 = this;
    var deferred = this.$q.defer();
    var cancelledResolveObject = RequestsServiceV4.getCancelledResolveObject(getMediaPyGptPersonMatchingTmplt(null));
    var cancellerWrapper = this.createDeferredCancellerWrapper(cancelledResolveObject);
    var timeoutPromise = this.createTimeoutPromise(cancellerWrapper, this.DEFAULT_MEDIA_PY_GPT_TIMEOUT);
    var req = {
      method: "POST",
      url: this.getUrl("person_matching"),
      params: MediaPyGptRequestsServiceV1.getQueryParams("person_matching"),
      data: {
        input_data: {
          general_summary: generalSummary,
          summary: summary
        }
      },
      timeout: cancellerWrapper == null ? void 0 : cancellerWrapper.deferred.promise
    };
    this.$http(req).then(function (resp) {
      _this8.$timeout.cancel(timeoutPromise);
      _this8.removeDeferredCancellerWrapper(cancellerWrapper);
      deferred.resolve(RequestsServiceV4.getRespDataWithStatus(resp));
    })["catch"](function (error) {
      _this8.$timeout.cancel(timeoutPromise);
      _this8.removeDeferredCancellerWrapper(cancellerWrapper);
      if (RequestsServiceV4.checkRequestCancelledError(error)) {
        deferred.resolve(cancelledResolveObject);
      } else {
        deferred.reject(RequestsServiceV4.getErrorWithStatus(error));
      }
    });
    return deferred.promise;
  };
  _proto.sendNegativeContextAnalysisRequest$ = function sendNegativeContextAnalysisRequest$(text, name) {
    var _this9 = this;
    var deferred = this.$q.defer();
    var cancelledResolveObject = RequestsServiceV4.getCancelledResolveObject(getMediaPyGptNegativeContextAnalysisTmplt(null));
    var cancellerWrapper = this.createDeferredCancellerWrapper(cancelledResolveObject);
    var timeoutPromise = this.createTimeoutPromise(cancellerWrapper, this.DEFAULT_MEDIA_PY_GPT_TIMEOUT);
    var req = {
      method: "POST",
      url: this.getUrl("negative_context_analysis"),
      params: MediaPyGptRequestsServiceV1.getQueryParams("negative_context_analysis"),
      data: {
        input_data: {
          text: text,
          name: name
        }
      },
      timeout: cancellerWrapper == null ? void 0 : cancellerWrapper.deferred.promise
    };
    this.$http(req).then(function (resp) {
      _this9.$timeout.cancel(timeoutPromise);
      _this9.removeDeferredCancellerWrapper(cancellerWrapper);
      deferred.resolve(RequestsServiceV4.getRespDataWithStatus(resp));
    })["catch"](function (error) {
      _this9.$timeout.cancel(timeoutPromise);
      _this9.removeDeferredCancellerWrapper(cancellerWrapper);
      if (RequestsServiceV4.checkRequestCancelledError(error)) {
        deferred.resolve(cancelledResolveObject);
      } else {
        deferred.reject(RequestsServiceV4.getErrorWithStatus(error));
      }
    });
    return deferred.promise;
  };
  _proto.sendChainRiskAssessmentRequest$ = function sendChainRiskAssessmentRequest$(text, name) {
    var _this10 = this;
    var deferred = this.$q.defer();
    var cancelledResolveObject = RequestsServiceV4.getCancelledResolveObject(getMediaPyGptChainRiskAssesmentTmplt(null));
    var cancellerWrapper = this.createDeferredCancellerWrapper(cancelledResolveObject);
    var timeoutPromise = this.createTimeoutPromise(cancellerWrapper, this.DEFAULT_MEDIA_PY_GPT_TIMEOUT);
    var req = {
      method: "POST",
      url: this.getUrl("chain_risk_assessment"),
      params: MediaPyGptRequestsServiceV1.getQueryParams("chain_risk_assessment"),
      data: {
        input_data: {
          text: text,
          name: name
        }
      },
      timeout: cancellerWrapper == null ? void 0 : cancellerWrapper.deferred.promise
    };
    this.$http(req).then(function (resp) {
      _this10.$timeout.cancel(timeoutPromise);
      _this10.removeDeferredCancellerWrapper(cancellerWrapper);
      deferred.resolve(RequestsServiceV4.getRespDataWithStatus(resp));
    })["catch"](function (error) {
      _this10.$timeout.cancel(timeoutPromise);
      _this10.removeDeferredCancellerWrapper(cancellerWrapper);
      if (RequestsServiceV4.checkRequestCancelledError(error)) {
        deferred.resolve(cancelledResolveObject);
      } else {
        deferred.reject(RequestsServiceV4.getErrorWithStatus(error));
      }
    });
    return deferred.promise;
  };
  _proto.sendGeneralRiskAssesmentRequest$ = function sendGeneralRiskAssesmentRequest$(riskAssesments) {
    var _this11 = this;
    var deferred = this.$q.defer();
    var cancelledResolveObject = RequestsServiceV4.getCancelledResolveObject(getMediaPyGptGeneralRiskAssesmentTmplt(null));
    var cancellerWrapper = this.createDeferredCancellerWrapper(cancelledResolveObject);
    var timeoutPromise = this.createTimeoutPromise(cancellerWrapper, this.DEFAULT_MEDIA_PY_GPT_TIMEOUT);
    var req = {
      method: "POST",
      url: this.getUrl("general_risk_assessment"),
      params: MediaPyGptRequestsServiceV1.getQueryParams("general_risk_assessment"),
      data: {
        input_data: {
          risk_assessments: riskAssesments
        }
      },
      timeout: cancellerWrapper == null ? void 0 : cancellerWrapper.deferred.promise
    };
    this.$http(req).then(function (resp) {
      _this11.$timeout.cancel(timeoutPromise);
      _this11.removeDeferredCancellerWrapper(cancellerWrapper);
      deferred.resolve(RequestsServiceV4.getRespDataWithStatus(resp));
    })["catch"](function (error) {
      _this11.$timeout.cancel(timeoutPromise);
      _this11.removeDeferredCancellerWrapper(cancellerWrapper);
      if (RequestsServiceV4.checkRequestCancelledError(error)) {
        deferred.resolve(cancelledResolveObject);
      } else {
        deferred.reject(RequestsServiceV4.getErrorWithStatus(error));
      }
    });
    return deferred.promise;
  };
  _proto.sendMostImportantEntitiesRequest$ = function sendMostImportantEntitiesRequest$(persons, organizations) {
    var _this12 = this;
    var deferred = this.$q.defer();
    var cancelledResolveObject = RequestsServiceV4.getCancelledResolveObject(getMediaPyGptMostImportantEntitiesTmplt(null));
    var cancellerWrapper = this.createDeferredCancellerWrapper(cancelledResolveObject);
    var timeoutPromise = this.createTimeoutPromise(cancellerWrapper, this.DEFAULT_MEDIA_PY_GPT_TIMEOUT);
    var req = {
      method: "POST",
      url: this.getUrl("most_important_persons_and_organizations"),
      params: MediaPyGptRequestsServiceV1.getQueryParams("most_important_persons_and_organizations"),
      data: {
        input_data: {
          persons: persons,
          organizations: organizations
        }
      },
      timeout: cancellerWrapper == null ? void 0 : cancellerWrapper.deferred.promise
    };
    this.$http(req).then(function (resp) {
      _this12.$timeout.cancel(timeoutPromise);
      _this12.removeDeferredCancellerWrapper(cancellerWrapper);
      deferred.resolve(RequestsServiceV4.getRespDataWithStatus(resp));
    })["catch"](function (error) {
      _this12.$timeout.cancel(timeoutPromise);
      _this12.removeDeferredCancellerWrapper(cancellerWrapper);
      if (RequestsServiceV4.checkRequestCancelledError(error)) {
        deferred.resolve(cancelledResolveObject);
      } else {
        deferred.reject(RequestsServiceV4.getErrorWithStatus(error));
      }
    });
    return deferred.promise;
  };
  _proto.sendOverallPersonSummaryRequest$ = function sendOverallPersonSummaryRequest$(personSummaries) {
    var _this13 = this;
    var deferred = this.$q.defer();
    var cancelledResolveObject = RequestsServiceV4.getCancelledResolveObject(getMediaPyGptOverallPersonSummaryTmplt(null));
    var cancellerWrapper = this.createDeferredCancellerWrapper(cancelledResolveObject);
    var timeoutPromise = this.createTimeoutPromise(cancellerWrapper, this.DEFAULT_MEDIA_PY_GPT_TIMEOUT);
    var req = {
      method: "POST",
      url: this.getUrl("overall_person_summary"),
      params: MediaPyGptRequestsServiceV1.getQueryParams("overall_person_summary"),
      data: {
        input_data: {
          person_summaries: personSummaries
        }
      },
      timeout: cancellerWrapper == null ? void 0 : cancellerWrapper.deferred.promise
    };
    this.$http(req).then(function (resp) {
      _this13.$timeout.cancel(timeoutPromise);
      _this13.removeDeferredCancellerWrapper(cancellerWrapper);
      deferred.resolve(RequestsServiceV4.getRespDataWithStatus(resp));
    })["catch"](function (error) {
      _this13.$timeout.cancel(timeoutPromise);
      _this13.removeDeferredCancellerWrapper(cancellerWrapper);
      if (RequestsServiceV4.checkRequestCancelledError(error)) {
        deferred.resolve(cancelledResolveObject);
      } else {
        deferred.reject(RequestsServiceV4.getErrorWithStatus(error));
      }
    });
    return deferred.promise;
  };
  _proto.sendGeneralNegativeContextAnalysisRequest$ = function sendGeneralNegativeContextAnalysisRequest$(allegationsAndEvidence, name) {
    var _this14 = this;
    var deferred = this.$q.defer();
    var cancelledResolveObject = RequestsServiceV4.getCancelledResolveObject(getMediaPyGptGeneralNegativeContextAnalysisTmplt(null));
    var cancellerWrapper = this.createDeferredCancellerWrapper(cancelledResolveObject);
    var timeoutPromise = this.createTimeoutPromise(cancellerWrapper, this.DEFAULT_MEDIA_PY_GPT_TIMEOUT);
    var req = {
      method: "POST",
      url: this.getUrl("general_negative_context_analysis"),
      params: MediaPyGptRequestsServiceV1.getQueryParams("general_negative_context_analysis"),
      data: {
        input_data: {
          allegations_and_evidence: allegationsAndEvidence,
          name: name
        }
      },
      timeout: cancellerWrapper == null ? void 0 : cancellerWrapper.deferred.promise
    };
    this.$http(req).then(function (resp) {
      _this14.$timeout.cancel(timeoutPromise);
      _this14.removeDeferredCancellerWrapper(cancellerWrapper);
      deferred.resolve(RequestsServiceV4.getRespDataWithStatus(resp));
    })["catch"](function (error) {
      _this14.$timeout.cancel(timeoutPromise);
      _this14.removeDeferredCancellerWrapper(cancellerWrapper);
      if (RequestsServiceV4.checkRequestCancelledError(error)) {
        deferred.resolve(cancelledResolveObject);
      } else {
        deferred.reject(RequestsServiceV4.getErrorWithStatus(error));
      }
    });
    return deferred.promise;
  };
  _proto.sendChainGeneralRiskAssessmentRequest$ = function sendChainGeneralRiskAssessmentRequest$(allegationsAndEvidence, name) {
    var _this15 = this;
    var deferred = this.$q.defer();
    var cancelledResolveObject = RequestsServiceV4.getCancelledResolveObject(getMediaPyGptChainGeneralRiskAssessmentTmplt(null));
    var cancellerWrapper = this.createDeferredCancellerWrapper(cancelledResolveObject);
    var timeoutPromise = this.createTimeoutPromise(cancellerWrapper, this.DEFAULT_MEDIA_PY_GPT_TIMEOUT);
    var req = {
      method: "POST",
      url: this.getUrl("chain_general_risk_assessment"),
      params: MediaPyGptRequestsServiceV1.getQueryParams("chain_general_risk_assessment"),
      data: {
        input_data: {
          allegations_and_evidence: allegationsAndEvidence,
          name: name
        }
      },
      timeout: cancellerWrapper == null ? void 0 : cancellerWrapper.deferred.promise
    };
    this.$http(req).then(function (resp) {
      _this15.$timeout.cancel(timeoutPromise);
      _this15.removeDeferredCancellerWrapper(cancellerWrapper);
      deferred.resolve(RequestsServiceV4.getRespDataWithStatus(resp));
    })["catch"](function (error) {
      _this15.$timeout.cancel(timeoutPromise);
      _this15.removeDeferredCancellerWrapper(cancellerWrapper);
      if (RequestsServiceV4.checkRequestCancelledError(error)) {
        deferred.resolve(cancelledResolveObject);
      } else {
        deferred.reject(RequestsServiceV4.getErrorWithStatus(error));
      }
    });
    return deferred.promise;
  };
  _proto.sendMostImportantKeywordsRequest$ = function sendMostImportantKeywordsRequest$(keywordsLists, name) {
    var _this16 = this;
    var deferred = this.$q.defer();
    var cancelledResolveObject = RequestsServiceV4.getCancelledResolveObject(getMediaPyGptMostImportantKeywordsTmplt(null));
    var cancellerWrapper = this.createDeferredCancellerWrapper(cancelledResolveObject);
    var timeoutPromise = this.createTimeoutPromise(cancellerWrapper, this.DEFAULT_MEDIA_PY_GPT_TIMEOUT);
    var req = {
      method: "POST",
      url: this.getUrl("most_important_keywords"),
      params: MediaPyGptRequestsServiceV1.getQueryParams("most_important_keywords"),
      data: {
        input_data: {
          keywords_lists: keywordsLists,
          name: name
        }
      },
      timeout: cancellerWrapper == null ? void 0 : cancellerWrapper.deferred.promise
    };
    this.$http(req).then(function (resp) {
      _this16.$timeout.cancel(timeoutPromise);
      _this16.removeDeferredCancellerWrapper(cancellerWrapper);
      deferred.resolve(RequestsServiceV4.getRespDataWithStatus(resp));
    })["catch"](function (error) {
      _this16.$timeout.cancel(timeoutPromise);
      _this16.removeDeferredCancellerWrapper(cancellerWrapper);
      if (RequestsServiceV4.checkRequestCancelledError(error)) {
        deferred.resolve(cancelledResolveObject);
      } else {
        deferred.reject(RequestsServiceV4.getErrorWithStatus(error));
      }
    });
    return deferred.promise;
  };
  _proto.sendConnectionsGraphRequest$ = function sendConnectionsGraphRequest$(articles, entityName) {
    var _this17 = this;
    var deferred = this.$q.defer();
    var cancelledResolveObject = RequestsServiceV4.getCancelledResolveObject(getMediaPyGptConnectionsGraphTmplt());
    var cancellerWrapper = this.createDeferredCancellerWrapper(cancelledResolveObject);
    var timeoutPromise = this.createTimeoutPromise(cancellerWrapper, this.DEFAULT_MEDIA_PY_GPT_TIMEOUT);
    var req = {
      method: "POST",
      url: this.getUrl("relations_graph"),
      params: MediaPyGptRequestsServiceV1.getQueryParams("relations_graph"),
      data: {
        input_data: {
          articles: articles,
          name: entityName
        }
      },
      timeout: cancellerWrapper == null ? void 0 : cancellerWrapper.deferred.promise
    };
    this.$http(req).then(function (resp) {
      _this17.$timeout.cancel(timeoutPromise);
      _this17.removeDeferredCancellerWrapper(cancellerWrapper);
      deferred.resolve(RequestsServiceV4.getRespDataWithStatus(resp));
    })["catch"](function (error) {
      _this17.$timeout.cancel(timeoutPromise);
      _this17.removeDeferredCancellerWrapper(cancellerWrapper);
      if (RequestsServiceV4.checkRequestCancelledError(error)) {
        deferred.resolve(cancelledResolveObject);
      } else {
        deferred.reject(RequestsServiceV4.getErrorWithStatus(error));
      }
    });
    return deferred.promise;
  };
  return MediaPyGptRequestsServiceV1;
}(RequestsServiceV4);
module.exports = {
  MediaPyGptRequestsServiceV1: MediaPyGptRequestsServiceV1
};

},{"../../../common/utils/common-v4":687,"../../templates/media-py-gpt-response-templates":887,"./requests-service-v4":868}],863:[function(require,module,exports){
"use strict";

function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
var _require = require("./requests-service-v4"),
  RequestsServiceV4 = _require.RequestsServiceV4;
var _require2 = require("../../../common/utils/common-v4"),
  getBaseApi = _require2.getBaseApi;
var _require3 = require("../../templates/media-py-llm-response-templates"),
  getMediaPyLLMTextAnalysisTmplt = _require3.getMediaPyLLMTextAnalysisTmplt,
  getMediaPyLLMAllegationsProfilingTmplt = _require3.getMediaPyLLMAllegationsProfilingTmplt,
  getMediaPyLLMPersonProfilingTmplt = _require3.getMediaPyLLMPersonProfilingTmplt;
var MediaPyLLMRequestsServiceV1 = function (_RequestsServiceV) {
  function MediaPyLLMRequestsServiceV1($rootScope, $http, $q, $timeout) {
    var _this;
    _this = _RequestsServiceV.call(this, $rootScope, $http, $q, $timeout) || this;
    _this.textAnalysisUrl = "";
    _this.personProfilingUrl = "";
    _this.allegationsProfilingUrl = "";
    _this.DEFAULT_TEXT_ANALYSIS_TIMEOUT = 120000;
    _this.DEFAULT_PERSON_PROFILING_TIMEOUT = 120000;
    _this.DEFAULT_ALLEGATIONS_PROFILING_TIMEOUT = 120000;
    return _this;
  }
  _inheritsLoose(MediaPyLLMRequestsServiceV1, _RequestsServiceV);
  var _proto = MediaPyLLMRequestsServiceV1.prototype;
  _proto.setUrls = function setUrls(apiConfig) {
    var baseApi = getBaseApi(apiConfig);
    this.textAnalysisUrl = baseApi + apiConfig.llm_analysis_text;
    this.personProfilingUrl = baseApi + apiConfig.llm_profiling_person;
    this.allegationsProfilingUrl = baseApi + apiConfig.llm_profiling_allegations;
  };
  _proto.setTimeouts = function setTimeouts(timeouts) {
    if (timeouts.llm_analysis_text) {
      this.DEFAULT_TEXT_ANALYSIS_TIMEOUT = timeouts.llm_analysis_text;
    }
    if (timeouts.llm_profiling_person) {
      this.DEFAULT_PERSON_PROFILING_TIMEOUT = timeouts.llm_profiling_person;
    }
    if (timeouts.llm_profiling_allegations) {
      this.DEFAULT_ALLEGATIONS_PROFILING_TIMEOUT = timeouts.llm_profiling_allegations;
    }
  };
  _proto.sendTextAnalysisRequest$ = function sendTextAnalysisRequest$(text, personName) {
    var _this2 = this;
    var deferred = this.$q.defer();
    var cancelledResolveObject = RequestsServiceV4.getCancelledResolveObject(getMediaPyLLMTextAnalysisTmplt(null));
    var cancellerWrapper = this.createDeferredCancellerWrapper(cancelledResolveObject);
    var timeoutPromise = this.createTimeoutPromise(cancellerWrapper, this.DEFAULT_TEXT_ANALYSIS_TIMEOUT);
    var req = {
      method: "POST",
      url: this.textAnalysisUrl,
      data: {
        text: text,
        person_name: personName
      },
      timeout: cancellerWrapper == null ? void 0 : cancellerWrapper.deferred.promise
    };
    this.$http(req).then(function (resp) {
      _this2.$timeout.cancel(timeoutPromise);
      _this2.removeDeferredCancellerWrapper(cancellerWrapper);
      deferred.resolve(RequestsServiceV4.getRespDataWithStatus(resp));
    })["catch"](function (error) {
      _this2.$timeout.cancel(timeoutPromise);
      _this2.removeDeferredCancellerWrapper(cancellerWrapper);
      if (RequestsServiceV4.checkRequestCancelledError(error)) {
        deferred.resolve(cancelledResolveObject);
      } else {
        deferred.reject(RequestsServiceV4.getErrorWithStatus(error));
      }
    });
    return deferred.promise;
  };
  _proto.sendPersonProfilingRequest$ = function sendPersonProfilingRequest$(personSummaries, personName) {
    var _this3 = this;
    var deferred = this.$q.defer();
    var cancelledResolveObject = RequestsServiceV4.getCancelledResolveObject(getMediaPyLLMPersonProfilingTmplt(null));
    var cancellerWrapper = this.createDeferredCancellerWrapper(cancelledResolveObject);
    var timeoutPromise = this.createTimeoutPromise(cancellerWrapper, this.DEFAULT_PERSON_PROFILING_TIMEOUT);
    var req = {
      method: "POST",
      url: this.personProfilingUrl,
      data: {
        summaries: personSummaries.map(function (summary) {
          return {
            text: summary
          };
        }),
        person_name: personName
      },
      timeout: cancellerWrapper == null ? void 0 : cancellerWrapper.deferred.promise
    };
    this.$http(req).then(function (resp) {
      _this3.$timeout.cancel(timeoutPromise);
      _this3.removeDeferredCancellerWrapper(cancellerWrapper);
      deferred.resolve(RequestsServiceV4.getRespDataWithStatus(resp));
    })["catch"](function (error) {
      _this3.$timeout.cancel(timeoutPromise);
      _this3.removeDeferredCancellerWrapper(cancellerWrapper);
      if (RequestsServiceV4.checkRequestCancelledError(error)) {
        deferred.resolve(cancelledResolveObject);
      } else {
        deferred.reject(RequestsServiceV4.getErrorWithStatus(error));
      }
    });
    return deferred.promise;
  };
  _proto.sendAllegationsProfilingRequest$ = function sendAllegationsProfilingRequest$(riskExplanations, personName) {
    var _this4 = this;
    var deferred = this.$q.defer();
    var cancelledResolveObject = RequestsServiceV4.getCancelledResolveObject(getMediaPyLLMAllegationsProfilingTmplt(null));
    var cancellerWrapper = this.createDeferredCancellerWrapper(cancelledResolveObject);
    var timeoutPromise = this.createTimeoutPromise(cancellerWrapper, this.DEFAULT_ALLEGATIONS_PROFILING_TIMEOUT);
    var req = {
      method: "POST",
      url: this.allegationsProfilingUrl,
      data: {
        allegations: riskExplanations.map(function (explanation) {
          return {
            text: explanation
          };
        }),
        person_name: personName
      },
      timeout: cancellerWrapper == null ? void 0 : cancellerWrapper.deferred.promise
    };
    this.$http(req).then(function (resp) {
      _this4.$timeout.cancel(timeoutPromise);
      _this4.removeDeferredCancellerWrapper(cancellerWrapper);
      deferred.resolve(RequestsServiceV4.getRespDataWithStatus(resp));
    })["catch"](function (error) {
      _this4.$timeout.cancel(timeoutPromise);
      _this4.removeDeferredCancellerWrapper(cancellerWrapper);
      if (RequestsServiceV4.checkRequestCancelledError(error)) {
        deferred.resolve(cancelledResolveObject);
      } else {
        deferred.reject(RequestsServiceV4.getErrorWithStatus(error));
      }
    });
    return deferred.promise;
  };
  return MediaPyLLMRequestsServiceV1;
}(RequestsServiceV4);
module.exports = {
  MediaPyLLMRequestsServiceV1: MediaPyLLMRequestsServiceV1
};

},{"../../../common/utils/common-v4":687,"../../templates/media-py-llm-response-templates":888,"./requests-service-v4":868}],864:[function(require,module,exports){
"use strict";

function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
var _require = require("./requests-service-v4"),
  RequestsServiceV4 = _require.RequestsServiceV4;
var _require2 = require("../../../common/utils/common-v4"),
  getBaseApi = _require2.getBaseApi;
var _require3 = require("../../templates/media-py-response-templates"),
  getMediaPyCleanHtmlTmplt = _require3.getMediaPyCleanHtmlTmplt,
  getMediaPyNamedEntitiesTmpl = _require3.getMediaPyNamedEntitiesTmpl,
  getMediaPyCombinedSearchTmplt = _require3.getMediaPyCombinedSearchTmplt,
  getMediaPyMarkupHtmlTmplt = _require3.getMediaPyMarkupHtmlTmplt,
  getMediaPyCombinedNlpTmplt = _require3.getMediaPyCombinedNlpTmplt,
  getMediaPySummarizeTextTmplt = _require3.getMediaPySummarizeTextTmplt,
  getMediaPySpecialParsingTmplt = _require3.getMediaPySpecialParsingTmplt,
  getMediaPySummarizeProfileTmplt = _require3.getMediaPySummarizeProfileTmplt,
  getMediaPyConnectionsGraphTmplt = _require3.getMediaPyConnectionsGraphTmplt;
var MediaPyRequestsServiceV6 = function (_RequestsServiceV) {
  function MediaPyRequestsServiceV6($rootScope, $http, $q, $timeout) {
    var _this;
    _this = _RequestsServiceV.call(this, $rootScope, $http, $q, $timeout) || this;
    _this.parseArticleUrl = "";
    _this.recognizeEntitiesUrl = "";
    _this.combinedSearchUrl = "";
    _this.markupHtmlUrl = "";
    _this.combinedNlpUrl = "";
    _this.summarizeTextUrl = "";
    _this.specialParsingUrl = "";
    _this.connectionsGraphUrl = "";
    _this.summarizeMultipleTextsUrl = "";
    _this.DEFAULT_PARSE_ARTICLE_TIMEOUT = 120000;
    _this.DEFAULT_RECOGNIZE_ENTITIES_TIMEOUT = 120000;
    _this.DEFAULT_COMBINED_SEARCH_TIMEOUT = 120000;
    _this.DEFAULT_MARKUP_HTML_TIMEOUT = 120000;
    _this.DEFAULT_COMBINED_NLP_TIMEOUT = 120000;
    _this.DEFAULT_SUMMARIZE_TEXT_TIMEOUT = 120000;
    _this.DEFAULT_SPECIAL_PARSING_TIMEOUT = 120000;
    _this.DEFAULT_CONNECTIONS_GRAPH_TIMEOUT = 120000;
    _this.DEFAULT_SUMMARIZE_MULTIPLE_TEXTS_TIMEOUT = 120000;
    return _this;
  }
  _inheritsLoose(MediaPyRequestsServiceV6, _RequestsServiceV);
  var _proto = MediaPyRequestsServiceV6.prototype;
  _proto.setUrls = function setUrls(apiConfig) {
    var baseApi = getBaseApi(apiConfig);
    this.parseArticleUrl = baseApi + apiConfig.parse_article_py;
    this.recognizeEntitiesUrl = baseApi + apiConfig.recognize_entities_py;
    this.combinedSearchUrl = baseApi + apiConfig.combined_search_py;
    this.markupHtmlUrl = baseApi + apiConfig.markup_html_py;
    this.combinedNlpUrl = baseApi + apiConfig.combined_nlp_py;
    this.summarizeTextUrl = baseApi + apiConfig.summarize_text_py;
    this.specialParsingUrl = baseApi + apiConfig.special_parsing_py;
    this.connectionsGraphUrl = baseApi + apiConfig.connections_graph_py;
    this.summarizeMultipleTextsUrl = baseApi + apiConfig.summarize_multiple_texts_py;
  };
  _proto.setTimeouts = function setTimeouts(timeouts) {
    if (timeouts.media_search_py_parse_article) {
      this.DEFAULT_PARSE_ARTICLE_TIMEOUT = timeouts.media_search_py_parse_article;
    }
    if (timeouts.media_search_py_recognize_entities) {
      this.DEFAULT_RECOGNIZE_ENTITIES_TIMEOUT = timeouts.media_search_py_recognize_entities;
    }
    if (timeouts.media_search_py_combined_search) {
      this.DEFAULT_COMBINED_SEARCH_TIMEOUT = timeouts.media_search_py_combined_search;
    }
    if (timeouts.media_search_py_markup_html) {
      this.DEFAULT_MARKUP_HTML_TIMEOUT = timeouts.media_search_py_markup_html;
    }
    if (timeouts.media_search_py_combined_nlp) {
      this.DEFAULT_COMBINED_NLP_TIMEOUT = timeouts.media_search_py_combined_nlp;
    }
    if (timeouts.media_search_py_summarize_text) {
      this.DEFAULT_SUMMARIZE_TEXT_TIMEOUT = timeouts.media_search_py_summarize_text;
    }
    if (timeouts.media_search_py_special_parsing) {
      this.DEFAULT_SPECIAL_PARSING_TIMEOUT = timeouts.media_search_py_special_parsing;
    }
    if (timeouts.media_search_py_connections_graph) {
      this.DEFAULT_CONNECTIONS_GRAPH_TIMEOUT = timeouts.media_search_py_connections_graph;
    }
    if (timeouts.media_search_py_summarize_multiple_texts) {
      this.DEFAULT_SUMMARIZE_MULTIPLE_TEXTS_TIMEOUT = timeouts.media_search_py_summarize_multiple_texts;
    }
  };
  _proto.init$ = function init$() {
    var deferred = this.$q.defer();
    var req = {
      method: "POST",
      url: this.recognizeEntitiesUrl,
      data: {
        article: {
          text: "Vladimir Putin",
          language: "en"
        }
      }
    };
    this.$http(req).then(function (resp) {
      deferred.resolve(resp.data);
    })["catch"](function (error) {
      deferred.reject(error);
    });
    return deferred.promise;
  };
  _proto.cleanHtmlDocument$ = function cleanHtmlDocument$(html) {
    var _this2 = this;
    var deferred = this.$q.defer();
    var cancelledResolveObject = RequestsServiceV4.getCancelledResolveObject(getMediaPyCleanHtmlTmplt(null));
    var cancellerWrapper = this.createDeferredCancellerWrapper(cancelledResolveObject);
    var timeoutPromise = this.createTimeoutPromise(cancellerWrapper, this.DEFAULT_PARSE_ARTICLE_TIMEOUT);
    var req = {
      method: "POST",
      url: this.parseArticleUrl,
      data: {
        article: {
          html: html
        }
      },
      timeout: cancellerWrapper == null ? void 0 : cancellerWrapper.deferred.promise
    };
    this.$http(req).then(function (resp) {
      _this2.$timeout.cancel(timeoutPromise);
      _this2.removeDeferredCancellerWrapper(cancellerWrapper);
      deferred.resolve(RequestsServiceV4.getRespDataWithStatus(resp));
    })["catch"](function (error) {
      _this2.$timeout.cancel(timeoutPromise);
      _this2.removeDeferredCancellerWrapper(cancellerWrapper);
      if (RequestsServiceV4.checkRequestCancelledError(error)) {
        deferred.resolve(cancelledResolveObject);
      } else {
        deferred.reject(RequestsServiceV4.getErrorWithStatus(error));
      }
    });
    return deferred.promise;
  };
  _proto.getDocumentEntities$ = function getDocumentEntities$(text, language) {
    var _this3 = this;
    var deferred = this.$q.defer();
    var cancelledResolveObject = RequestsServiceV4.getCancelledResolveObject(getMediaPyNamedEntitiesTmpl(null, false));
    var cancellerWrapper = this.createDeferredCancellerWrapper(cancelledResolveObject);
    var timeoutPromise = this.createTimeoutPromise(cancellerWrapper, this.DEFAULT_RECOGNIZE_ENTITIES_TIMEOUT);
    var req = {
      method: "POST",
      url: this.recognizeEntitiesUrl,
      data: {
        article: {
          text: text,
          language: language
        }
      },
      timeout: cancellerWrapper == null ? void 0 : cancellerWrapper.deferred.promise
    };
    this.$http(req).then(function (resp) {
      _this3.$timeout.cancel(timeoutPromise);
      _this3.removeDeferredCancellerWrapper(cancellerWrapper);
      deferred.resolve(RequestsServiceV4.getRespDataWithStatus(resp));
    })["catch"](function (error) {
      _this3.$timeout.cancel(timeoutPromise);
      _this3.removeDeferredCancellerWrapper(cancellerWrapper);
      if (RequestsServiceV4.checkRequestCancelledError(error)) {
        deferred.resolve(cancelledResolveObject);
      } else {
        deferred.reject(RequestsServiceV4.getErrorWithStatus(error));
      }
    });
    return deferred.promise;
  };
  _proto.combinedSearch$ = function combinedSearch$(text, entityObj, language, mode) {
    var _this4 = this;
    var deferred = this.$q.defer();
    var cancelledResolveObject = RequestsServiceV4.getCancelledResolveObject(getMediaPyCombinedSearchTmplt(null));
    var cancellerWrapper = this.createDeferredCancellerWrapper(cancelledResolveObject);
    var timeoutPromise = this.createTimeoutPromise(cancellerWrapper, this.DEFAULT_COMBINED_SEARCH_TIMEOUT);
    var req = {
      method: "POST",
      url: this.combinedSearchUrl,
      data: {
        article: {
          text: text,
          language: language,
          dict: mode
        },
        entity: entityObj.entity
      },
      timeout: cancellerWrapper == null ? void 0 : cancellerWrapper.deferred.promise
    };
    this.$http(req).then(function (resp) {
      _this4.$timeout.cancel(timeoutPromise);
      _this4.removeDeferredCancellerWrapper(cancellerWrapper);
      deferred.resolve(RequestsServiceV4.getRespDataWithStatus(resp));
    })["catch"](function (error) {
      _this4.$timeout.cancel(timeoutPromise);
      _this4.removeDeferredCancellerWrapper(cancellerWrapper);
      if (RequestsServiceV4.checkRequestCancelledError(error)) {
        deferred.resolve(cancelledResolveObject);
      } else {
        deferred.reject(RequestsServiceV4.getErrorWithStatus(error));
      }
    });
    return deferred.promise;
  };
  _proto.markupHtmlDocument$ = function markupHtmlDocument$(html, text, entityObj, language, mode, riskKeywords, namedEntities) {
    var _this5 = this;
    var deferred = this.$q.defer();
    var cancelledResolveObject = RequestsServiceV4.getCancelledResolveObject(getMediaPyMarkupHtmlTmplt(null, true));
    var cancellerWrapper = this.createDeferredCancellerWrapper(cancelledResolveObject);
    var timeoutPromise = this.createTimeoutPromise(cancellerWrapper, this.DEFAULT_MARKUP_HTML_TIMEOUT);
    var req = {
      method: "POST",
      url: this.markupHtmlUrl,
      data: {
        article: {
          html: html,
          text: text,
          language: language,
          dict: mode,
          risk_keywords: riskKeywords,
          named_entities: namedEntities
        },
        entity: entityObj.entity
      },
      timeout: cancellerWrapper == null ? void 0 : cancellerWrapper.deferred.promise
    };
    this.$http(req).then(function (resp) {
      _this5.$timeout.cancel(timeoutPromise);
      _this5.removeDeferredCancellerWrapper(cancellerWrapper);
      deferred.resolve(RequestsServiceV4.getRespDataWithStatus(resp));
    })["catch"](function (error) {
      _this5.$timeout.cancel(timeoutPromise);
      _this5.removeDeferredCancellerWrapper(cancellerWrapper);
      if (RequestsServiceV4.checkRequestCancelledError(error)) {
        deferred.resolve(cancelledResolveObject);
      } else {
        deferred.reject(RequestsServiceV4.getErrorWithStatus(error));
      }
    });
    return deferred.promise;
  };
  _proto.getDocumentInfo$ = function getDocumentInfo$(title, text, entityObj, language, width, height, riskKeywords, mandatoryKeywords, mode) {
    var _this6 = this;
    var deferred = this.$q.defer();
    var cancelledResolveObject = RequestsServiceV4.getCancelledResolveObject(getMediaPyCombinedNlpTmplt());
    var cancellerWrapper = this.createDeferredCancellerWrapper(cancelledResolveObject);
    var timeoutPromise = this.createTimeoutPromise(cancellerWrapper, this.DEFAULT_COMBINED_NLP_TIMEOUT);
    var req = {
      method: "POST",
      url: this.combinedNlpUrl,
      data: {
        article: {
          text: text,
          title: title,
          language: language,
          width: width,
          height: height,
          risk_keywords: riskKeywords,
          mandatory_keywords: mandatoryKeywords,
          dict: mode
        },
        entity: entityObj.entity
      },
      timeout: cancellerWrapper == null ? void 0 : cancellerWrapper.deferred.promise
    };
    this.$http(req).then(function (resp) {
      _this6.$timeout.cancel(timeoutPromise);
      _this6.removeDeferredCancellerWrapper(cancellerWrapper);
      deferred.resolve(RequestsServiceV4.getRespDataWithStatus(resp));
    })["catch"](function (error) {
      _this6.$timeout.cancel(timeoutPromise);
      _this6.removeDeferredCancellerWrapper(cancellerWrapper);
      if (RequestsServiceV4.checkRequestCancelledError(error)) {
        deferred.resolve(cancelledResolveObject);
      } else {
        deferred.reject(RequestsServiceV4.getErrorWithStatus(error));
      }
    });
    return deferred.promise;
  };
  _proto.summarizeText$ = function summarizeText$(text, language, riskKeywords) {
    var _this7 = this;
    var deferred = this.$q.defer();
    var cancelledResolveObject = RequestsServiceV4.getCancelledResolveObject(getMediaPySummarizeTextTmplt(null));
    var cancellerWrapper = this.createDeferredCancellerWrapper(cancelledResolveObject);
    var timeoutPromise = this.createTimeoutPromise(cancellerWrapper, this.DEFAULT_SUMMARIZE_TEXT_TIMEOUT);
    var req = {
      method: "POST",
      url: this.summarizeTextUrl,
      data: {
        article: {
          text: text,
          language: language,
          risk_keywords: riskKeywords
        }
      },
      timeout: cancellerWrapper == null ? void 0 : cancellerWrapper.deferred.promise
    };
    this.$http(req).then(function (resp) {
      _this7.$timeout.cancel(timeoutPromise);
      _this7.removeDeferredCancellerWrapper(cancellerWrapper);
      deferred.resolve(RequestsServiceV4.getRespDataWithStatus(resp));
    })["catch"](function (error) {
      _this7.$timeout.cancel(timeoutPromise);
      _this7.removeDeferredCancellerWrapper(cancellerWrapper);
      if (RequestsServiceV4.checkRequestCancelledError(error)) {
        deferred.resolve(cancelledResolveObject);
      } else {
        deferred.reject(RequestsServiceV4.getErrorWithStatus(error));
      }
    });
    return deferred.promise;
  };
  _proto.specialParsing$ = function specialParsing$(html, source, entityObj, type, format, content) {
    var _this8 = this;
    var deferred = this.$q.defer();
    var cancelledResolveObject = RequestsServiceV4.getCancelledResolveObject(getMediaPySpecialParsingTmplt(null));
    var cancellerWrapper = this.createDeferredCancellerWrapper(cancelledResolveObject);
    var timeoutPromise = this.createTimeoutPromise(cancellerWrapper, this.DEFAULT_SPECIAL_PARSING_TIMEOUT);
    var req = {
      method: "POST",
      url: this.specialParsingUrl,
      data: {
        article: {
          html: html,
          source: source,
          type: source === "opensanctions" ? type : "",
          format: source === "opensanctions" ? format : "",
          content: source === "opensanctions" ? content : ""
        },
        entity: entityObj.entity
      },
      timeout: cancellerWrapper == null ? void 0 : cancellerWrapper.deferred.promise
    };
    this.$http(req).then(function (resp) {
      _this8.$timeout.cancel(timeoutPromise);
      _this8.removeDeferredCancellerWrapper(cancellerWrapper);
      deferred.resolve(RequestsServiceV4.getRespDataWithStatus(resp));
    })["catch"](function (error) {
      _this8.$timeout.cancel(timeoutPromise);
      _this8.removeDeferredCancellerWrapper(cancellerWrapper);
      if (RequestsServiceV4.checkRequestCancelledError(error)) {
        deferred.resolve(cancelledResolveObject);
      } else {
        deferred.reject(RequestsServiceV4.getErrorWithStatus(error));
      }
    });
    return deferred.promise;
  };
  _proto.summarizePerson$ = function summarizePerson$(textObjectsArray, entityObj) {
    var _this9 = this;
    var deferred = this.$q.defer();
    var cancelledResolveObject = RequestsServiceV4.getCancelledResolveObject(getMediaPySummarizeProfileTmplt(null));
    var cancellerWrapper = this.createDeferredCancellerWrapper(cancelledResolveObject);
    var timeoutPromise = this.createTimeoutPromise(cancellerWrapper, this.DEFAULT_SUMMARIZE_MULTIPLE_TEXTS_TIMEOUT);
    var req = {
      method: "POST",
      url: this.summarizeMultipleTextsUrl,
      data: {
        article: textObjectsArray,
        entity: entityObj.entity
      },
      timeout: cancellerWrapper == null ? void 0 : cancellerWrapper.deferred.promise
    };
    this.$http(req).then(function (resp) {
      _this9.$timeout.cancel(timeoutPromise);
      _this9.removeDeferredCancellerWrapper(cancellerWrapper);
      deferred.resolve(RequestsServiceV4.getRespDataWithStatus(resp));
    })["catch"](function (error) {
      _this9.$timeout.cancel(timeoutPromise);
      _this9.removeDeferredCancellerWrapper(cancellerWrapper);
      if (RequestsServiceV4.checkRequestCancelledError(error)) {
        deferred.resolve(cancelledResolveObject);
      } else {
        deferred.reject(RequestsServiceV4.getErrorWithStatus(error));
      }
    });
    return deferred.promise;
  };
  _proto.connectionsGraph$ = function connectionsGraph$(articles, entityObj) {
    var _this10 = this;
    var deferred = this.$q.defer();
    var cancelledResolveObject = RequestsServiceV4.getCancelledResolveObject(getMediaPyConnectionsGraphTmplt());
    var cancellerWrapper = this.createDeferredCancellerWrapper(cancelledResolveObject);
    var timeoutPromise = this.createTimeoutPromise(cancellerWrapper, this.DEFAULT_CONNECTIONS_GRAPH_TIMEOUT);
    var req = {
      method: "POST",
      url: this.connectionsGraphUrl,
      data: {
        article: articles,
        entity: entityObj.entity
      },
      timeout: cancellerWrapper == null ? void 0 : cancellerWrapper.deferred.promise
    };
    this.$http(req).then(function (resp) {
      _this10.$timeout.cancel(timeoutPromise);
      _this10.removeDeferredCancellerWrapper(cancellerWrapper);
      deferred.resolve(RequestsServiceV4.getRespDataWithStatus(resp));
    })["catch"](function (error) {
      _this10.$timeout.cancel(timeoutPromise);
      _this10.removeDeferredCancellerWrapper(cancellerWrapper);
      if (RequestsServiceV4.checkRequestCancelledError(error)) {
        deferred.resolve(cancelledResolveObject);
      } else {
        deferred.reject(RequestsServiceV4.getErrorWithStatus(error));
      }
    });
    return deferred.promise;
  };
  return MediaPyRequestsServiceV6;
}(RequestsServiceV4);
module.exports = {
  MediaPyRequestsServiceV6: MediaPyRequestsServiceV6
};

},{"../../../common/utils/common-v4":687,"../../templates/media-py-response-templates":889,"./requests-service-v4":868}],865:[function(require,module,exports){
"use strict";

function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
var _require = require("./requests-service-v4"),
  RequestsServiceV4 = _require.RequestsServiceV4;
var _require2 = require("../../../common/utils/common-v4"),
  getBaseApi = _require2.getBaseApi;
var OpenCorporatesRequestsServiceV4 = function (_RequestsServiceV) {
  function OpenCorporatesRequestsServiceV4($rootScope, $http, $q, $timeout) {
    var _this;
    _this = _RequestsServiceV.call(this, $rootScope, $http, $q, $timeout) || this;
    _this.getOpenCorporatesResultsUrl = "";
    _this.getOpenCorporatesResultUrl = "";
    _this.DEFAULT_ALL_RESULTS_TIMEOUT = 120000;
    _this.DEFAULT_SINGLE_RESULT_TIMEOUT = 120000;
    return _this;
  }
  _inheritsLoose(OpenCorporatesRequestsServiceV4, _RequestsServiceV);
  var _proto = OpenCorporatesRequestsServiceV4.prototype;
  _proto.setUrls = function setUrls(apiConfig) {
    var baseApi = getBaseApi(apiConfig);
    this.getOpenCorporatesResultsUrl = baseApi + apiConfig.get_open_corporates_results;
    this.getOpenCorporatesResultUrl = baseApi + apiConfig.get_open_corporates_result;
  };
  _proto.setTimeouts = function setTimeouts(timeouts) {
    if (timeouts.open_corporates_all_results) {
      this.DEFAULT_ALL_RESULTS_TIMEOUT = timeouts.open_corporates_all_results;
    }
    if (timeouts.open_corporates_single_result) {
      this.DEFAULT_SINGLE_RESULT_TIMEOUT = timeouts.open_corporates_single_result;
    }
  };
  _proto.getOpenCorporatesResults$ = function getOpenCorporatesResults$(personName, type) {
    var _this2 = this;
    var deferred = this.$q.defer();
    var cancelledResolveObject = RequestsServiceV4.getCancelledResolveObject([]);
    var cancellerWrapper = this.createDeferredCancellerWrapper(cancelledResolveObject);
    var timeoutPromise = this.createTimeoutPromise(cancellerWrapper, this.DEFAULT_ALL_RESULTS_TIMEOUT);
    var req = {
      method: "POST",
      url: this.getOpenCorporatesResultsUrl,
      data: {
        personName: personName,
        type: type
      },
      timeout: cancellerWrapper == null ? void 0 : cancellerWrapper.deferred.promise
    };
    this.$http(req).then(function (resp) {
      _this2.$timeout.cancel(timeoutPromise);
      _this2.removeDeferredCancellerWrapper(cancellerWrapper);
      deferred.resolve(RequestsServiceV4.getRespDataWithStatus(resp));
    })["catch"](function (error) {
      _this2.$timeout.cancel(timeoutPromise);
      _this2.removeDeferredCancellerWrapper(cancellerWrapper);
      if (RequestsServiceV4.checkRequestCancelledError(error)) {
        deferred.resolve(cancelledResolveObject);
      } else {
        deferred.reject(RequestsServiceV4.getErrorWithStatus(error));
      }
    });
    return deferred.promise;
  };
  return OpenCorporatesRequestsServiceV4;
}(RequestsServiceV4);
module.exports = {
  OpenCorporatesRequestsServiceV4: OpenCorporatesRequestsServiceV4
};

},{"../../../common/utils/common-v4":687,"./requests-service-v4":868}],866:[function(require,module,exports){
"use strict";

function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
var _require = require("./requests-service-v4"),
  RequestsServiceV4 = _require.RequestsServiceV4;
var _require2 = require("../../../common/utils/common-v4"),
  getBaseApi = _require2.getBaseApi;
var OpenSanctionsRequestsServiceV4 = function (_RequestsServiceV) {
  function OpenSanctionsRequestsServiceV4($rootScope, $http, $q, $timeout) {
    var _this;
    _this = _RequestsServiceV.call(this, $rootScope, $http, $q, $timeout) || this;
    _this.getOpenSanctionsResultsUrl = "";
    _this.getOpenSanctionsResultUrl = "";
    _this.getOpenSanctionsResultJsonUrl = "";
    _this.DEFAULT_ALL_RESULTS_TIMEOUT = 120000;
    _this.DEFAULT_SINGLE_RESULT_TIMEOUT = 120000;
    return _this;
  }
  _inheritsLoose(OpenSanctionsRequestsServiceV4, _RequestsServiceV);
  var _proto = OpenSanctionsRequestsServiceV4.prototype;
  _proto.setUrls = function setUrls(apiConfig) {
    var baseApi = getBaseApi(apiConfig);
    this.getOpenSanctionsResultsUrl = baseApi + apiConfig.get_open_sanctions_results;
    this.getOpenSanctionsResultUrl = baseApi + apiConfig.get_open_sanctions_result;
    this.getOpenSanctionsResultJsonUrl = baseApi + apiConfig.get_open_sanctions_result_json;
  };
  _proto.setTimeouts = function setTimeouts(timeouts) {
    if (timeouts.open_sanctions_all_results) {
      this.DEFAULT_ALL_RESULTS_TIMEOUT = timeouts.open_sanctions_all_results;
    }
    if (timeouts.open_sanctions_single_result) {
      this.DEFAULT_SINGLE_RESULT_TIMEOUT = timeouts.open_sanctions_single_result;
    }
  };
  _proto.getOpenSanctionsResults$ = function getOpenSanctionsResults$(personName) {
    var _this2 = this;
    var deferred = this.$q.defer();
    var cancelledResolveObject = RequestsServiceV4.getCancelledResolveObject([]);
    var cancellerWrapper = this.createDeferredCancellerWrapper(cancelledResolveObject);
    var timeoutPromise = this.createTimeoutPromise(cancellerWrapper, this.DEFAULT_ALL_RESULTS_TIMEOUT);
    var req = {
      method: "POST",
      url: this.getOpenSanctionsResultsUrl,
      data: {
        personName: personName
      },
      timeout: cancellerWrapper == null ? void 0 : cancellerWrapper.deferred.promise
    };
    this.$http(req).then(function (resp) {
      _this2.$timeout.cancel(timeoutPromise);
      _this2.removeDeferredCancellerWrapper(cancellerWrapper);
      deferred.resolve(RequestsServiceV4.getRespDataWithStatus(resp));
    })["catch"](function (error) {
      _this2.$timeout.cancel(timeoutPromise);
      _this2.removeDeferredCancellerWrapper(cancellerWrapper);
      if (RequestsServiceV4.checkRequestCancelledError(error)) {
        deferred.resolve(cancelledResolveObject);
      } else {
        deferred.reject(RequestsServiceV4.getErrorWithStatus(error));
      }
    });
    return deferred.promise;
  };
  return OpenSanctionsRequestsServiceV4;
}(RequestsServiceV4);
module.exports = {
  OpenSanctionsRequestsServiceV4: OpenSanctionsRequestsServiceV4
};

},{"../../../common/utils/common-v4":687,"./requests-service-v4":868}],867:[function(require,module,exports){
"use strict";

function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
var _require = require("./requests-service-v4"),
  RequestsServiceV4 = _require.RequestsServiceV4;
var _require2 = require("../../../common/utils/common-v4"),
  getBaseApi = _require2.getBaseApi;
var ParseDocumentRequestsServiceV4 = function (_RequestsServiceV) {
  function ParseDocumentRequestsServiceV4($rootScope, $http, $q, $timeout) {
    var _this;
    _this = _RequestsServiceV.call(this, $rootScope, $http, $q, $timeout) || this;
    _this.parseDocumentUrl = "";
    _this.parseBinaryDocumentUrl = "";
    _this.DEFAULT_PARSE_TIMEOUT = 300000;
    _this.DEFAULT_PARSE_BINARY_TIMEOUT = 300000;
    return _this;
  }
  _inheritsLoose(ParseDocumentRequestsServiceV4, _RequestsServiceV);
  var _proto = ParseDocumentRequestsServiceV4.prototype;
  _proto.setUrls = function setUrls(apiConfig) {
    var baseApi = getBaseApi(apiConfig);
    this.parseDocumentUrl = baseApi + apiConfig.parse_document;
    this.parseBinaryDocumentUrl = baseApi + apiConfig.parse_binary_document;
  };
  _proto.setTimeouts = function setTimeouts(timeouts) {
    if (timeouts.parse_document) {
      this.DEFAULT_PARSE_TIMEOUT = timeouts.parse_document;
    }
    if (timeouts.parse_binary_document) {
      this.DEFAULT_PARSE_BINARY_TIMEOUT = timeouts.parse_binary_document;
    }
  };
  _proto.getParsedDocumentInfo$ = function getParsedDocumentInfo$(formData) {
    var _this2 = this;
    var deferred = this.$q.defer();
    var cancelledResolveObject = RequestsServiceV4.getCancelledResolveObject({});
    var cancellerWrapper = this.createDeferredCancellerWrapper(cancelledResolveObject);
    var timeoutPromise = this.createTimeoutPromise(cancellerWrapper, this.DEFAULT_PARSE_TIMEOUT);
    var req = {
      method: "POST",
      url: this.parseDocumentUrl,
      data: formData,
      headers: {
        "Content-Type": undefined
      },
      timeout: cancellerWrapper == null ? void 0 : cancellerWrapper.deferred.promise
    };
    this.$http(req).then(function (resp) {
      _this2.$timeout.cancel(timeoutPromise);
      _this2.removeDeferredCancellerWrapper(cancellerWrapper);
      deferred.resolve(RequestsServiceV4.getRespDataWithStatus(resp));
    })["catch"](function (error) {
      _this2.$timeout.cancel(timeoutPromise);
      _this2.removeDeferredCancellerWrapper(cancellerWrapper);
      if (RequestsServiceV4.checkRequestCancelledError(error)) {
        deferred.resolve(cancelledResolveObject);
      } else {
        deferred.reject(RequestsServiceV4.getErrorWithStatus(error));
      }
    });
    return deferred.promise;
  };
  _proto.getParsedBinaryDocumentInfo$ = function getParsedBinaryDocumentInfo$(fileBlob, fileName) {
    var _this3 = this;
    var deferred = this.$q.defer();
    var cancelledResolveObject = RequestsServiceV4.getCancelledResolveObject({});
    var cancellerWrapper = this.createDeferredCancellerWrapper(cancelledResolveObject);
    var timeoutPromise = this.createTimeoutPromise(cancellerWrapper, this.DEFAULT_PARSE_BINARY_TIMEOUT);
    var req = {
      method: "POST",
      url: this.parseBinaryDocumentUrl + "?fileName=" + fileName,
      data: fileBlob,
      headers: {
        "Content-Type": undefined
      },
      timeout: cancellerWrapper == null ? void 0 : cancellerWrapper.deferred.promise
    };
    this.$http(req).then(function (resp) {
      _this3.$timeout.cancel(timeoutPromise);
      _this3.removeDeferredCancellerWrapper(cancellerWrapper);
      deferred.resolve(RequestsServiceV4.getRespDataWithStatus(resp));
    })["catch"](function (error) {
      _this3.$timeout.cancel(timeoutPromise);
      _this3.removeDeferredCancellerWrapper(cancellerWrapper);
      if (RequestsServiceV4.checkRequestCancelledError(error)) {
        deferred.resolve(cancelledResolveObject);
      } else {
        deferred.reject(RequestsServiceV4.getErrorWithStatus(error));
      }
    });
    return deferred.promise;
  };
  return ParseDocumentRequestsServiceV4;
}(RequestsServiceV4);
module.exports = {
  ParseDocumentRequestsServiceV4: ParseDocumentRequestsServiceV4
};

},{"../../../common/utils/common-v4":687,"./requests-service-v4":868}],868:[function(require,module,exports){
"use strict";

var _require = require("../../../common/utils/common-v4"),
  generateUUID = _require.generateUUID;
var RequestsServiceV4 = function () {
  function RequestsServiceV4($rootScope, $http, $q, $timeout) {
    var _this = this;
    this.$rootScope = $rootScope;
    this.$http = $http;
    this.$q = $q;
    this.$timeout = $timeout;
    this.routeWasChanged = false;
    this.currentCancellers = [];
    if ($rootScope) {
      $rootScope.$on("$routeChangeStart", function (event, next, current) {
        _this.routeWasChanged = true;
        if (_this.currentCancellers && _this.currentCancellers.length) {
          _this.currentCancellers.forEach(function (cancellerWrapper) {
            if (cancellerWrapper && cancellerWrapper.deferred && cancellerWrapper.deferred.promise && cancellerWrapper.deferred.promise.$$state && cancellerWrapper.deferred.promise.$$state.status === 0) {
              cancellerWrapper.deferred.resolve(cancellerWrapper.objToResolve);
            }
          });
        }
      });
    }
  }
  var _proto = RequestsServiceV4.prototype;
  _proto.createDeferredCancellerWrapper = function createDeferredCancellerWrapper(objToResolve) {
    if ("true" !== "true") {
      return undefined;
    }
    var newCancellerWrapper = {
      deferred: this.$q.defer(),
      objToResolve: objToResolve,
      id: generateUUID()
    };
    this.currentCancellers.push(newCancellerWrapper);
    if (this.routeWasChanged) {
      newCancellerWrapper.deferred.resolve(newCancellerWrapper.objToResolve);
    }
    return newCancellerWrapper;
  };
  _proto.createTimeoutPromise = function createTimeoutPromise(cancellerWrapper, defaultTimeout) {
    if (!cancellerWrapper) {
      return undefined;
    }
    return this.$timeout(function () {
      if (cancellerWrapper && cancellerWrapper.deferred && cancellerWrapper.deferred.promise && cancellerWrapper.deferred.promise.$$state && cancellerWrapper.deferred.promise.$$state.status === 0) {
        cancellerWrapper.deferred.resolve(cancellerWrapper.objToResolve);
      }
    }, defaultTimeout);
  };
  _proto.removeDeferredCancellerWrapper = function removeDeferredCancellerWrapper(cancellerWrapper) {
    if (cancellerWrapper) {
      var cancellerWrapperIdx = this.currentCancellers.findIndex(function (cw) {
        return cw.id === cancellerWrapper.id;
      });
      if (cancellerWrapperIdx !== -1) {
        this.currentCancellers.splice(cancellerWrapperIdx, 1);
      }
      RequestsServiceV4.clearCancellerWrapper(cancellerWrapper);
    }
  };
  RequestsServiceV4.clearCancellerWrapper = function clearCancellerWrapper(cancellerWrapper) {
    if (cancellerWrapper) {
      cancellerWrapper.deferred.promise = null;
      cancellerWrapper.deferred = null;
      cancellerWrapper.objToResolve = null;
      cancellerWrapper.id = null;
    }
  };
  _proto.resetRouteWasChanged = function resetRouteWasChanged() {
    this.routeWasChanged = false;
    this.currentCancellers = [];
  };
  RequestsServiceV4.getCancelledResolveObject = function getCancelledResolveObject(data) {
    var cancelledObject = {
      data: data,
      status: 408
    };
    return cancelledObject;
  };
  RequestsServiceV4.getRespDataWithStatus = function getRespDataWithStatus(resp) {
    var respData = {
      data: resp.data,
      status: resp.status
    };
    return respData;
  };
  RequestsServiceV4.getErrorWithStatus = function getErrorWithStatus(error) {
    var errorData = {
      error: error,
      status: RequestsServiceV4.getErrorStatus(error)
    };
    return errorData;
  };
  RequestsServiceV4.checkRequestCancelledError = function checkRequestCancelledError(error) {
    return error && (error.message === "canceled" || error.message === "socket hang up" || error.xhrStatus === "abort");
  };
  RequestsServiceV4.getErrorStatus = function getErrorStatus(error) {
    return error.isAxiosError && error.response ? error.response.status || 500 : error.status || 500;
  };
  _proto.destroy = function destroy() {
    this.$rootScope = null;
    this.$http = null;
    this.$q = null;
    this.$timeout = null;
    this.currentCancellers.forEach(function (cancellerWrapper) {
      RequestsServiceV4.clearCancellerWrapper(cancellerWrapper);
    });
    this.currentCancellers = [];
  };
  return RequestsServiceV4;
}();
module.exports = {
  RequestsServiceV4: RequestsServiceV4
};

},{"../../../common/utils/common-v4":687}],869:[function(require,module,exports){
"use strict";

function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
var _require = require("./requests-service-v4"),
  RequestsServiceV4 = _require.RequestsServiceV4;
var _require2 = require("../../../common/utils/common-v4"),
  getBaseApi = _require2.getBaseApi;
var ScrapeRequestsServiceV4 = function (_RequestsServiceV) {
  function ScrapeRequestsServiceV4($rootScope, $http, $q, $timeout) {
    var _this;
    _this = _RequestsServiceV.call(this, $rootScope, $http, $q, $timeout) || this;
    _this.getSearchResultUrl = "";
    _this.getExtraSourceResultUrl = "";
    _this.getAlephOccrpResultUrl = "";
    _this.getOpenSanctionsResultUrl = "";
    _this.getOpenSanctionsResultJsonUrl = "";
    _this.getOpenCorporatesResultUrl = "";
    _this.DEFAULT_SINGLE_RESULT_TIMEOUT = 240000;
    _this.DEFAULT_EXTRA_SOURCE_SINGLE_RESULT_TIMEOUT = 240000;
    _this.DEFAULT_ALEPH_OCCRP_SINGLE_RESULT_TIMEOUT = 240000;
    _this.DEFAULT_OPEN_SANCTIONS_SINGLE_RESULT_TIMEOUT = 240000;
    _this.DEFAULT_OPEN_CORPORATES_SINGLE_RESULT_TIMEOUT = 240000;
    return _this;
  }
  _inheritsLoose(ScrapeRequestsServiceV4, _RequestsServiceV);
  var _proto = ScrapeRequestsServiceV4.prototype;
  _proto.setUrls = function setUrls(apiConfig) {
    var baseApi = getBaseApi(apiConfig);
    this.getSearchResultUrl = baseApi + apiConfig.get_search_result;
    this.getExtraSourceResultUrl = baseApi + apiConfig.get_extra_search_result;
    this.getAlephOccrpResultUrl = baseApi + apiConfig.get_aleph_occrp_result;
    this.getOpenSanctionsResultUrl = baseApi + apiConfig.get_open_sanctions_result;
    this.getOpenSanctionsResultJsonUrl = baseApi + apiConfig.get_open_sanctions_result_json;
    this.getOpenCorporatesResultUrl = baseApi + apiConfig.get_open_corporates_result;
  };
  _proto.setTimeouts = function setTimeouts(timeouts) {
    if (timeouts.google_search_single_result) {
      this.DEFAULT_SINGLE_RESULT_TIMEOUT = timeouts.google_search_single_result;
    }
    if (timeouts.extra_sources_single_result) {
      this.DEFAULT_EXTRA_SOURCE_SINGLE_RESULT_TIMEOUT = timeouts.extra_sources_single_result;
    }
    if (timeouts.aleph_occrp_single_result) {
      this.DEFAULT_ALEPH_OCCRP_SINGLE_RESULT_TIMEOUT = timeouts.aleph_occrp_single_result;
    }
    if (timeouts.open_sanctions_single_result) {
      this.DEFAULT_OPEN_SANCTIONS_SINGLE_RESULT_TIMEOUT = timeouts.open_sanctions_single_result;
    }
    if (timeouts.open_corporates_single_result) {
      this.DEFAULT_OPEN_CORPORATES_SINGLE_RESULT_TIMEOUT = timeouts.open_corporates_single_result;
    }
  };
  _proto.getDocument$ = function getDocument$(url, fromCache) {
    var _this2 = this;
    var deferred = this.$q.defer();
    var cancelledResolveObject = RequestsServiceV4.getCancelledResolveObject({
      data: undefined,
      linkUrl: url
    });
    var cancellerWrapper = this.createDeferredCancellerWrapper(cancelledResolveObject);
    var timeoutPromise = this.createTimeoutPromise(cancellerWrapper, this.DEFAULT_SINGLE_RESULT_TIMEOUT);
    var req = {
      method: "POST",
      url: this.getSearchResultUrl,
      data: {
        url: url,
        fromCache: fromCache
      },
      timeout: cancellerWrapper == null ? void 0 : cancellerWrapper.deferred.promise
    };
    this.$http(req).then(function (resp) {
      _this2.$timeout.cancel(timeoutPromise);
      _this2.removeDeferredCancellerWrapper(cancellerWrapper);
      var contentType = "";
      if (typeof resp.headers === "function") {
        contentType = resp.headers("Content-Type");
      } else {
        contentType = resp.headers["content-type"];
      }
      if (contentType.indexOf("application/xml") !== -1 || contentType.indexOf("application/xhtml+xml") !== -1 || contentType.indexOf("text/xml") !== -1) {
        deferred.resolve({
          data: {
            data: undefined,
            linkUrl: url
          },
          status: resp.status
        });
      } else {
        deferred.resolve({
          data: {
            data: resp.data,
            linkUrl: url
          },
          status: resp.status
        });
      }
    })["catch"](function (error) {
      _this2.$timeout.cancel(timeoutPromise);
      _this2.removeDeferredCancellerWrapper(cancellerWrapper);
      if (RequestsServiceV4.checkRequestCancelledError(error)) {
        deferred.resolve(cancelledResolveObject);
      } else {
        deferred.reject({
          data: {
            data: undefined,
            linkUrl: url
          },
          error: error,
          status: RequestsServiceV4.getErrorStatus(error)
        });
      }
    });
    return deferred.promise;
  };
  _proto.getExtraSourceDocument$ = function getExtraSourceDocument$(url) {
    var _this3 = this;
    var deferred = this.$q.defer();
    var cancelledResolveObject = RequestsServiceV4.getCancelledResolveObject({
      data: undefined,
      linkUrl: url
    });
    var cancellerWrapper = this.createDeferredCancellerWrapper(cancelledResolveObject);
    var timeoutPromise = this.createTimeoutPromise(cancellerWrapper, this.DEFAULT_EXTRA_SOURCE_SINGLE_RESULT_TIMEOUT);
    var req = {
      method: "POST",
      url: this.getExtraSourceResultUrl,
      data: {
        url: url
      },
      timeout: cancellerWrapper == null ? void 0 : cancellerWrapper.deferred.promise
    };
    this.$http(req).then(function (resp) {
      _this3.$timeout.cancel(timeoutPromise);
      _this3.removeDeferredCancellerWrapper(cancellerWrapper);
      deferred.resolve({
        data: {
          data: resp.data,
          linkUrl: url
        },
        status: resp.status
      });
    })["catch"](function (error) {
      _this3.$timeout.cancel(timeoutPromise);
      _this3.removeDeferredCancellerWrapper(cancellerWrapper);
      if (RequestsServiceV4.checkRequestCancelledError(error)) {
        deferred.resolve(cancelledResolveObject);
      } else {
        deferred.reject({
          data: {
            data: undefined,
            linkUrl: url
          },
          error: error,
          status: RequestsServiceV4.getErrorStatus(error)
        });
      }
    });
    return deferred.promise;
  };
  _proto.getAlephOccrpDocument$ = function getAlephOccrpDocument$(url) {
    var _this4 = this;
    var deferred = this.$q.defer();
    var cancelledResolveObject = RequestsServiceV4.getCancelledResolveObject({
      data: undefined,
      linkUrl: url
    });
    var cancellerWrapper = this.createDeferredCancellerWrapper(cancelledResolveObject);
    var timeoutPromise = this.createTimeoutPromise(cancellerWrapper, this.DEFAULT_ALEPH_OCCRP_SINGLE_RESULT_TIMEOUT);
    var req = {
      method: "POST",
      url: this.getAlephOccrpResultUrl,
      data: {
        url: url
      },
      timeout: cancellerWrapper == null ? void 0 : cancellerWrapper.deferred.promise
    };
    this.$http(req).then(function (resp) {
      _this4.$timeout.cancel(timeoutPromise);
      _this4.removeDeferredCancellerWrapper(cancellerWrapper);
      deferred.resolve({
        data: {
          data: resp.data,
          linkUrl: url
        },
        status: resp.status
      });
    })["catch"](function (error) {
      _this4.$timeout.cancel(timeoutPromise);
      _this4.removeDeferredCancellerWrapper(cancellerWrapper);
      if (RequestsServiceV4.checkRequestCancelledError(error)) {
        deferred.resolve(cancelledResolveObject);
      } else {
        deferred.reject({
          data: {
            data: undefined,
            linkUrl: url
          },
          error: error,
          status: RequestsServiceV4.getErrorStatus(error)
        });
      }
    });
    return deferred.promise;
  };
  _proto.getOpenSanctionsDocument$ = function getOpenSanctionsDocument$(url) {
    var _this5 = this;
    var deferred = this.$q.defer();
    var cancelledResolveObject = RequestsServiceV4.getCancelledResolveObject({
      data: undefined,
      linkUrl: url
    });
    var cancellerWrapper = this.createDeferredCancellerWrapper(cancelledResolveObject);
    var timeoutPromise = this.createTimeoutPromise(cancellerWrapper, this.DEFAULT_OPEN_SANCTIONS_SINGLE_RESULT_TIMEOUT);
    var req = {
      method: "POST",
      url: this.getOpenSanctionsResultUrl,
      data: {
        url: url
      },
      timeout: cancellerWrapper == null ? void 0 : cancellerWrapper.deferred.promise
    };
    this.$http(req).then(function (resp) {
      _this5.$timeout.cancel(timeoutPromise);
      _this5.removeDeferredCancellerWrapper(cancellerWrapper);
      deferred.resolve({
        data: {
          data: resp.data,
          linkUrl: url
        },
        status: resp.status
      });
    })["catch"](function (error) {
      _this5.$timeout.cancel(timeoutPromise);
      _this5.removeDeferredCancellerWrapper(cancellerWrapper);
      if (RequestsServiceV4.checkRequestCancelledError(error)) {
        deferred.resolve(cancelledResolveObject);
      } else {
        deferred.reject({
          data: {
            data: undefined,
            linkUrl: url
          },
          error: error,
          status: RequestsServiceV4.getErrorStatus(error)
        });
      }
    });
    return deferred.promise;
  };
  _proto.getOpenSanctionsDocumentJson$ = function getOpenSanctionsDocumentJson$(id) {
    var _this6 = this;
    var deferred = this.$q.defer();
    var cancelledResolveObject = RequestsServiceV4.getCancelledResolveObject({});
    var cancellerWrapper = this.createDeferredCancellerWrapper(cancelledResolveObject);
    var timeoutPromise = this.createTimeoutPromise(cancellerWrapper, this.DEFAULT_OPEN_SANCTIONS_SINGLE_RESULT_TIMEOUT);
    var req = {
      method: "POST",
      url: this.getOpenSanctionsResultJsonUrl,
      data: {
        id: id
      },
      timeout: cancellerWrapper == null ? void 0 : cancellerWrapper.deferred.promise
    };
    this.$http(req).then(function (resp) {
      _this6.$timeout.cancel(timeoutPromise);
      _this6.removeDeferredCancellerWrapper(cancellerWrapper);
      deferred.resolve(RequestsServiceV4.getRespDataWithStatus(resp));
    })["catch"](function (error) {
      _this6.$timeout.cancel(timeoutPromise);
      _this6.removeDeferredCancellerWrapper(cancellerWrapper);
      if (RequestsServiceV4.checkRequestCancelledError(error)) {
        deferred.resolve(cancelledResolveObject);
      } else {
        deferred.reject(RequestsServiceV4.getErrorWithStatus(error));
      }
    });
    return deferred.promise;
  };
  _proto.getOpenCorporatesDocument$ = function getOpenCorporatesDocument$(url) {
    var _this7 = this;
    var deferred = this.$q.defer();
    var cancelledResolveObject = RequestsServiceV4.getCancelledResolveObject({
      data: undefined,
      linkUrl: url
    });
    var cancellerWrapper = this.createDeferredCancellerWrapper(cancelledResolveObject);
    var timeoutPromise = this.createTimeoutPromise(cancellerWrapper, this.DEFAULT_OPEN_CORPORATES_SINGLE_RESULT_TIMEOUT);
    var req = {
      method: "POST",
      url: this.getOpenCorporatesResultUrl,
      data: {
        url: url
      },
      timeout: cancellerWrapper == null ? void 0 : cancellerWrapper.deferred.promise
    };
    this.$http(req).then(function (resp) {
      _this7.$timeout.cancel(timeoutPromise);
      _this7.removeDeferredCancellerWrapper(cancellerWrapper);
      deferred.resolve({
        data: {
          data: resp.data,
          linkUrl: url
        },
        status: resp.status
      });
    })["catch"](function (error) {
      _this7.$timeout.cancel(timeoutPromise);
      _this7.removeDeferredCancellerWrapper(cancellerWrapper);
      if (RequestsServiceV4.checkRequestCancelledError(error)) {
        deferred.resolve(cancelledResolveObject);
      } else {
        deferred.reject({
          data: {
            data: undefined,
            linkUrl: url
          },
          error: error,
          status: RequestsServiceV4.getErrorStatus(error)
        });
      }
    });
    return deferred.promise;
  };
  return ScrapeRequestsServiceV4;
}(RequestsServiceV4);
module.exports = {
  ScrapeRequestsServiceV4: ScrapeRequestsServiceV4
};

},{"../../../common/utils/common-v4":687,"./requests-service-v4":868}],870:[function(require,module,exports){
"use strict";

function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
var _require = require("./requests-service-v4"),
  RequestsServiceV4 = _require.RequestsServiceV4;
var _require2 = require("../../../common/utils/common-v4"),
  getBaseApi = _require2.getBaseApi;
var _require3 = require("../../../common/utils/log-v4"),
  makeResponseLogString = _require3.makeResponseLogString;
var SearchEngineRequestsServiceV4 = function (_RequestsServiceV) {
  function SearchEngineRequestsServiceV4($rootScope, $http, $q, $timeout, isGoogle, isBing) {
    var _this;
    _this = _RequestsServiceV.call(this, $rootScope, $http, $q, $timeout) || this;
    _this.isGoogle = isGoogle;
    _this.isBing = isBing;
    _this.demoMode = false;
    _this.getSearchResultsUrl = "";
    _this.DEFAULT_ALL_RESULTS_TIMEOUT = 30000;
    return _this;
  }
  _inheritsLoose(SearchEngineRequestsServiceV4, _RequestsServiceV);
  var _proto = SearchEngineRequestsServiceV4.prototype;
  _proto.setDemoMode = function setDemoMode(mode) {
    this.demoMode = mode;
  };
  _proto.setUrls = function setUrls(apiConfig) {
    this.getSearchResultsUrl = getBaseApi(apiConfig) + apiConfig.get_search_results;
  };
  _proto.setTimeouts = function setTimeouts(timeouts) {
    if (timeouts.google_search_all_results) {
      this.DEFAULT_ALL_RESULTS_TIMEOUT = timeouts.google_search_all_results;
    }
  };
  _proto.getEngineName = function getEngineName() {
    var engineName = "";
    if (this.isGoogle) {
      engineName = "google";
    }
    if (this.isBing) {
      engineName = "bing";
    }
    return engineName;
  };
  _proto.getEngineErrorMessageName = function getEngineErrorMessageName() {
    var messageName = "";
    if (this.isGoogle) {
      messageName = "googleSearchMessage";
    }
    if (this.isBing) {
      messageName = "bingSearchMessage";
    }
    return messageName;
  };
  _proto.getPersonRequestQuery = function getPersonRequestQuery(personName, exactPersonName, personKeywords, countriesKeywords) {
    var requestQuery = "";
    if (exactPersonName) {
      requestQuery = "\"" + personName + "\"";
    } else {
      requestQuery = personName;
    }
    if (countriesKeywords && countriesKeywords.length) {
      requestQuery = requestQuery + " AND " + countriesKeywords;
    }
    if (personKeywords && Array.isArray(personKeywords)) {
      requestQuery += personKeywords.length ? " AND (" + personKeywords.join(" OR ") + ")" : "";
    } else {
      requestQuery += personKeywords ? " AND (" + personKeywords.split(" ").join(" OR ") + ")" : "";
    }
    return requestQuery.trim();
  };
  _proto.getCompanyRequestQuery = function getCompanyRequestQuery(personName, exactPersonName, requestTmplt) {
    return requestTmplt.replace("%COMPANY_NAME%", exactPersonName ? "\"" + personName + "\"" : personName).trim();
  };
  _proto.getSearchResults$ = function getSearchResults$(queryString) {
    var _this2 = this;
    var deferred = this.$q.defer();
    var cancelledResolveObject = RequestsServiceV4.getCancelledResolveObject({});
    var cancellerWrapper = this.createDeferredCancellerWrapper(cancelledResolveObject);
    var timeoutPromise = this.createTimeoutPromise(cancellerWrapper, this.DEFAULT_ALL_RESULTS_TIMEOUT);
    var req = {
      method: "POST",
      url: this.getSearchResultsUrl,
      data: {
        engine: this.getEngineName(),
        query: queryString
      },
      timeout: cancellerWrapper == null ? void 0 : cancellerWrapper.deferred.promise
    };
    this.$http(req).then(function (resp) {
      _this2.$timeout.cancel(timeoutPromise);
      _this2.removeDeferredCancellerWrapper(cancellerWrapper);
      deferred.resolve(RequestsServiceV4.getRespDataWithStatus(resp));
    })["catch"](function (error) {
      _this2.$timeout.cancel(timeoutPromise);
      _this2.removeDeferredCancellerWrapper(cancellerWrapper);
      if (_this2.$rootScope) {
        if (error && error.status && (error.status.toString() === "403" || error.status.toString() === "429")) {} else {
          _this2.$rootScope.$broadcast("addToLog", makeResponseLogString(error));
          _this2.$rootScope.$broadcast(_this2.getEngineErrorMessageName(), makeResponseLogString(error), "error");
        }
      }
      if (RequestsServiceV4.checkRequestCancelledError(error)) {
        deferred.resolve(cancelledResolveObject);
      } else {
        deferred.reject(RequestsServiceV4.getErrorWithStatus(error));
      }
    });
    return deferred.promise;
  };
  return SearchEngineRequestsServiceV4;
}(RequestsServiceV4);
module.exports = {
  SearchEngineRequestsServiceV4: SearchEngineRequestsServiceV4
};

},{"../../../common/utils/common-v4":687,"../../../common/utils/log-v4":693,"./requests-service-v4":868}],871:[function(require,module,exports){
"use strict";

function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
var _require = require("./requests-service-v4"),
  RequestsServiceV4 = _require.RequestsServiceV4;
var _require2 = require("../../../common/utils/common-v4"),
  getBaseApi = _require2.getBaseApi;
var StockMarketRequestsServiceV4 = function (_RequestsServiceV) {
  function StockMarketRequestsServiceV4($rootScope, $http, $q, $timeout) {
    var _this;
    _this = _RequestsServiceV.call(this, $rootScope, $http, $q, $timeout) || this;
    _this.getStockMarketResultsUrl = "";
    _this.DEFAULT_ALL_RESULTS_TIMEOUT = 240000;
    return _this;
  }
  _inheritsLoose(StockMarketRequestsServiceV4, _RequestsServiceV);
  var _proto = StockMarketRequestsServiceV4.prototype;
  _proto.setUrls = function setUrls(apiConfig) {
    this.getStockMarketResultsUrl = getBaseApi(apiConfig) + apiConfig.get_stock_market_results;
  };
  _proto.setTimeouts = function setTimeouts(timeouts) {
    if (timeouts.stock_market_all_results) {
      this.DEFAULT_ALL_RESULTS_TIMEOUT = timeouts.stock_market_all_results;
    }
  };
  _proto.getStockMarketResults$ = function getStockMarketResults$(companyName, isBatch, sites) {
    var _this2 = this;
    var deferred = this.$q.defer();
    var cancelledResolveObject = RequestsServiceV4.getCancelledResolveObject([]);
    var cancellerWrapper = this.createDeferredCancellerWrapper(cancelledResolveObject);
    var timeoutPromise = this.createTimeoutPromise(cancellerWrapper, this.DEFAULT_ALL_RESULTS_TIMEOUT);
    var req = {
      method: "POST",
      url: this.getStockMarketResultsUrl,
      data: {
        companyName: companyName,
        sites: sites,
        isBatch: isBatch
      },
      timeout: cancellerWrapper == null ? void 0 : cancellerWrapper.deferred.promise
    };
    this.$http(req).then(function (resp) {
      _this2.$timeout.cancel(timeoutPromise);
      _this2.removeDeferredCancellerWrapper(cancellerWrapper);
      deferred.resolve(RequestsServiceV4.getRespDataWithStatus(resp));
    })["catch"](function (error) {
      _this2.$timeout.cancel(timeoutPromise);
      _this2.removeDeferredCancellerWrapper(cancellerWrapper);
      if (RequestsServiceV4.checkRequestCancelledError(error)) {
        deferred.resolve(cancelledResolveObject);
      } else {
        deferred.reject(RequestsServiceV4.getErrorWithStatus(error));
      }
    });
    return deferred.promise;
  };
  return StockMarketRequestsServiceV4;
}(RequestsServiceV4);
module.exports = {
  StockMarketRequestsServiceV4: StockMarketRequestsServiceV4
};

},{"../../../common/utils/common-v4":687,"./requests-service-v4":868}],872:[function(require,module,exports){
"use strict";

var _require = require("./media-search-persons-requests-service-v1"),
  MediaSearchPersonsRequestsServiceV1 = _require.MediaSearchPersonsRequestsServiceV1;
var _require2 = require("./media-search-persons-service-v1"),
  MediaSearchPersonsServiceV1 = _require2.MediaSearchPersonsServiceV1;
module.exports = {
  MediaSearchPersonsRequestsServiceV1: MediaSearchPersonsRequestsServiceV1,
  MediaSearchPersonsServiceV1: MediaSearchPersonsServiceV1
};

},{"./media-search-persons-requests-service-v1":873,"./media-search-persons-service-v1":874}],873:[function(require,module,exports){
"use strict";

var _require = require("../../models/requests"),
  MediaSearchPersonRequestV1 = _require.MediaSearchPersonRequestV1;
var MediaSearchPersonsRequestsServiceV1 = function () {
  function MediaSearchPersonsRequestsServiceV1() {
    this.personsRequests = [];
  }
  MediaSearchPersonsRequestsServiceV1.compareByRiskScore = function compareByRiskScore(a, b) {
    if ((a.getRequestRiskScore() || 0) > (b.getRequestRiskScore() || 0)) {
      return -1;
    }
    if ((a.getRequestRiskScore() || 0) < (b.getRequestRiskScore() || 0)) {
      return 1;
    }
    return 0;
  };
  var _proto = MediaSearchPersonsRequestsServiceV1.prototype;
  _proto.setPersonsRequests = function setPersonsRequests(persons, requestConfigs, requestObject, groupObject) {
    var _this = this;
    persons.forEach(function (person) {
      var parentPerson = persons.find(function (p) {
        return p.getId() === person.getParentId();
      });
      if (parentPerson) {
        requestConfigs.forEach(function (requestConfig) {
          var newPersonRequest = new MediaSearchPersonRequestV1(person, parentPerson, requestConfig, requestObject, groupObject);
          _this.addPersonRequest(newPersonRequest);
        });
      }
    });
  };
  _proto.addPersonRequest = function addPersonRequest(personRequest) {
    this.personsRequests.push(personRequest);
  };
  _proto.getPersonRequests = function getPersonRequests(personId, requestId, requestsCount) {
    var personRequests = this.personsRequests.filter(function (request) {
      return request.getPersonId() === personId && (requestId ? request.getRequestId() === requestId : true);
    }).sort(MediaSearchPersonsRequestsServiceV1.compareByRiskScore).splice(0, requestsCount);
    this.personsRequests = this.personsRequests.filter(function (request) {
      return !personRequests.find(function (personRequest) {
        return request.getId() === personRequest.getId();
      });
    });
    return personRequests;
  };
  _proto.removePersonRequest = function removePersonRequest(personRequest) {
    var idx = this.personsRequests.indexOf(personRequest);
    if (idx !== -1) {
      this.personsRequests.splice(idx, 1);
    }
  };
  _proto.clearAll = function clearAll() {
    this.personsRequests = [];
  };
  return MediaSearchPersonsRequestsServiceV1;
}();
module.exports = {
  MediaSearchPersonsRequestsServiceV1: MediaSearchPersonsRequestsServiceV1
};

},{"../../models/requests":834}],874:[function(require,module,exports){
"use strict";

function _inheritsLoose(t, o) { t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
var _require = require("../../../common/utils/common-v4"),
  generateUUID = _require.generateUUID;
var _require2 = require("../../../common/utils/countries-v4"),
  getCountiesKeywords = _require2.getCountiesKeywords;
var _require3 = require("../../../common/utils/strings-v4"),
  dropCompanySuffix = _require3.dropCompanySuffix;
var _require4 = require("../../models/person"),
  MediaPyGptPersonV1 = _require4.MediaPyGptPersonV1;
var _require5 = require("../../../common/services/logic"),
  PersonsServiceV4 = _require5.PersonsServiceV4;
var MediaSearchPersonsServiceV1 = function (_PersonsServiceV) {
  function MediaSearchPersonsServiceV1() {
    var _this;
    _this = _PersonsServiceV.call(this) || this;
    _this.namePairSeparators = ["and/or", "und/oder", "et/ou", "e/o", " + "];
    return _this;
  }
  _inheritsLoose(MediaSearchPersonsServiceV1, _PersonsServiceV);
  var _proto = MediaSearchPersonsServiceV1.prototype;
  _proto.getFixedFullName = function getFixedFullName(firstName, lastName, fullName) {
    if (!fullName) {
      return fullName;
    }
    this.namePairSeparators.forEach(function (sep) {
      var sepIdx = (fullName || "").indexOf(sep);
      if (sepIdx !== -1) {
        fullName = fullName.slice(0, sepIdx);
      }
    });
    fullName = fullName.trim();
    var splittedFullNameParts = fullName.split(" ");
    var firstNameInitial = (firstName || "").length ? firstName[0] + "." : "";
    if (splittedFullNameParts.length && splittedFullNameParts[splittedFullNameParts.length - 1] === firstNameInitial) {
      splittedFullNameParts[splittedFullNameParts.length - 1] = firstName;
    }
    return splittedFullNameParts.join(" ");
  };
  _proto.setPersons = function setPersons(personsData, countriesConfig, isProcessingAliasPersonsEnabled, isProcessingLinkedPersonsEnabled) {
    var _this2 = this;
    personsData.forEach(function (personData) {
      var fullName = "";
      var firstName = "";
      var lastName = "";
      var isCompany = false;
      var reqPersonId = null;
      var keywords = [];
      var countriesKeywords = "";
      var itemId = null;
      if (personData.country) {
        countriesKeywords = getCountiesKeywords(personData.country, countriesConfig);
      }
      if (personData.city) {
        countriesKeywords = personData.city + " " + countriesKeywords;
      }
      firstName = personData.firstname ? personData.firstname : "";
      lastName = personData.lastname ? personData.lastname : "";
      if (personData.fullname) {
        fullName = _this2.getFixedFullName(personData.firstname, personData.lastname, personData.fullname);
      } else {
        fullName = ((personData.firstname ? personData.firstname : "") + " " + (personData.lastname ? personData.lastname : "")).trim();
      }
      if (personData.firstname) {
        isCompany = false;
      } else {
        isCompany = true;
      }
      if (personData.keywords && personData.keywords.length) {
        keywords = personData.keywords;
      }
      if (personData.itemId) {
        itemId = personData.itemId;
      }
      if (personData.reqPersonId) {
        reqPersonId = personData.reqPersonId;
      }
      var isSuffixDropped = false;
      var droppedCompanySuffix = dropCompanySuffix(fullName);
      if (droppedCompanySuffix.length !== fullName.length) {
        isSuffixDropped = true;
        isCompany = true;
      }
      if (fullName.trim().length) {
        var parentId = generateUUID();
        var newParentPerson = new MediaPyGptPersonV1(parentId, fullName, firstName, lastName, false, false, parentId, isCompany, itemId);
        newParentPerson.setKeywords(keywords);
        newParentPerson.setCountriesKeywords(countriesKeywords);
        newParentPerson.setReqPersonId(reqPersonId);
        _this2.persons.push(newParentPerson);
        if (isProcessingLinkedPersonsEnabled && personData.additionalNames && Array.isArray(personData.additionalNames) && personData.additionalNames.length) {
          personData.additionalNames.forEach(function (addName) {
            var newAdditionalPerson = new MediaPyGptPersonV1(generateUUID(), addName, "", "", false, true, parentId, isCompany, itemId);
            newAdditionalPerson.setKeywords(keywords);
            newAdditionalPerson.setCountriesKeywords(countriesKeywords);
            _this2.persons.push(newAdditionalPerson);
          });
        }
        var splittedPersonName = droppedCompanySuffix.split(" ");
        if (isProcessingAliasPersonsEnabled && (isCompany && isSuffixDropped || splittedPersonName.length >= 3)) {
          var aliasFirstName = "";
          var aliasLastName = "";
          var aliasFullName = "";
          if (isCompany && isSuffixDropped) {
            if (splittedPersonName.length >= 2) {
              aliasFirstName = [].concat(splittedPersonName).slice(0, -1).join(" ");
            } else {
              aliasFirstName = "";
            }
            aliasLastName = splittedPersonName[splittedPersonName.length - 1];
          } else if (firstName && lastName && fullName.indexOf(firstName) !== 0) {
            var splittedFirstName = firstName.split(" ");
            var splittedLastName = lastName.split(" ");
            aliasFirstName = splittedFirstName[0];
            aliasLastName = splittedLastName[0];
          } else {
            aliasFirstName = splittedPersonName[0];
            aliasLastName = splittedPersonName[splittedPersonName.length - 1];
          }
          aliasFullName = (aliasFirstName + " " + aliasLastName).trim();
          var newAliasPerson = new MediaPyGptPersonV1(generateUUID(), aliasFullName, aliasFirstName, aliasLastName, true, false, parentId, isCompany, itemId);
          newAliasPerson.setKeywords(keywords);
          newAliasPerson.setCountriesKeywords(countriesKeywords);
          _this2.persons.push(newAliasPerson);
        }
      }
    });
  };
  return MediaSearchPersonsServiceV1;
}(PersonsServiceV4);
module.exports = {
  MediaSearchPersonsServiceV1: MediaSearchPersonsServiceV1
};

},{"../../../common/services/logic":684,"../../../common/utils/common-v4":687,"../../../common/utils/countries-v4":689,"../../../common/utils/strings-v4":696,"../../models/person":815}],875:[function(require,module,exports){
"use strict";

var _require = require("../../../common/utils/comparisons-v4"),
  compareByPriority = _require.compareByPriority;
var _require2 = require("../../models/request-configs"),
  RequestsGroupConfigV5 = _require2.RequestsGroupConfigV5,
  SearchEngineRequestConfigV5 = _require2.SearchEngineRequestConfigV5;
var _require3 = require("../../models/request-configs/search-engine"),
  SearchEngineRequestAdditionalKeywordsConfigV5 = _require3.SearchEngineRequestAdditionalKeywordsConfigV5;
var GroupRequestsConfigServiceV5 = function () {
  function GroupRequestsConfigServiceV5() {
    this.groupsConfigs = [];
  }
  var _proto = GroupRequestsConfigServiceV5.prototype;
  _proto.parseConfigData = function parseConfigData(configs) {
    var _this = this;
    (configs || []).forEach(function (config) {
      var newRequestsGroupConfig = new RequestsGroupConfigV5(config.priority, config.count_of_results, config.max_count_of_results, config.min_result_riskscore);
      newRequestsGroupConfig.setRequests(config.requests);
      _this.groupsConfigs.push(newRequestsGroupConfig);
    });
  };
  _proto.createGroupFromAdditionalKeywords = function createGroupFromAdditionalKeywords(additionalKeywords) {
    this.groupsConfigs = this.groupsConfigs.filter(function (groupConfig) {
      return !(groupConfig.getAllRequests().length === 1 && groupConfig.getAllRequests()[0] instanceof SearchEngineRequestConfigV5 && groupConfig.getAllRequests()[0].getSearchConfig() instanceof SearchEngineRequestAdditionalKeywordsConfigV5);
    });
    if (additionalKeywords && additionalKeywords.length) {
      var newRequestsGroupConfig = new RequestsGroupConfigV5(1000, 100, 100, 0);
      newRequestsGroupConfig.addAdditionalKeywordsRequest(additionalKeywords);
      this.groupsConfigs.push(newRequestsGroupConfig);
    }
  };
  _proto.getById = function getById(groupObjectId) {
    return this.groupsConfigs.find(function (config) {
      return config.getId() === groupObjectId;
    });
  };
  _proto.getAllGroups = function getAllGroups() {
    return this.groupsConfigs.sort(compareByPriority);
  };
  _proto.destroy = function destroy() {
    this.groupsConfigs.forEach(function (groupConfig) {
      groupConfig.destroy();
    });
    this.groupsConfigs = [];
  };
  return GroupRequestsConfigServiceV5;
}();
module.exports = {
  GroupRequestsConfigServiceV5: GroupRequestsConfigServiceV5
};

},{"../../../common/utils/comparisons-v4":688,"../../models/request-configs":822,"../../models/request-configs/search-engine":828}],876:[function(require,module,exports){
"use strict";

var _require = require("./group-requests-config-service-v5"),
  GroupRequestsConfigServiceV5 = _require.GroupRequestsConfigServiceV5;
var _require2 = require("./media-search-engine-service-v5"),
  MediaSearchEngineServiceV5 = _require2.MediaSearchEngineServiceV5;
var _require3 = require("./media-search-score-type-service-v4"),
  MediaSearchScoreTypeServiceV4 = _require3.MediaSearchScoreTypeServiceV4;
var _require4 = require("./separate-requests-config-service-v5"),
  SeparateRequestsConfigServiceV5 = _require4.SeparateRequestsConfigServiceV5;
module.exports = {
  GroupRequestsConfigServiceV5: GroupRequestsConfigServiceV5,
  MediaSearchEngineServiceV5: MediaSearchEngineServiceV5,
  MediaSearchScoreTypeServiceV4: MediaSearchScoreTypeServiceV4,
  SeparateRequestsConfigServiceV5: SeparateRequestsConfigServiceV5
};

},{"./group-requests-config-service-v5":875,"./media-search-engine-service-v5":877,"./media-search-score-type-service-v4":878,"./separate-requests-config-service-v5":879}],877:[function(require,module,exports){
"use strict";

var _require = require("../../../common/utils/comparisons-v4"),
  compareByRiskScore = _require.compareByRiskScore;
var _require2 = require("../../models/keywords"),
  SearchEngineKeywordConfigV4 = _require2.SearchEngineKeywordConfigV4;
var _require3 = require("../../models/request-configs/search-engine"),
  SearchEngineRequestKeywordsDetailsConfigV5 = _require3.SearchEngineRequestKeywordsDetailsConfigV5,
  SearchEngineRequestAdditionalKeywordsConfigV5 = _require3.SearchEngineRequestAdditionalKeywordsConfigV5;
var MediaSearchEngineServiceV5 = function () {
  function MediaSearchEngineServiceV5() {
    this.excludeFiles = false;
    this.fileExtensionsExclude = [];
    this.excludedSites = [];
    this.enableAroundCount = false;
    this.nameAroundKeywordsCount = 0;
    this.commonSpecificKeywords = [];
    this.commonBannedKeywords = [];
    this.commonScoreDecreaseKeywords = [];
    this.commonBannedTitleKeywords = [];
    this.additionalKeywords = [];
  }
  var _proto = MediaSearchEngineServiceV5.prototype;
  _proto.parseConfigData = function parseConfigData(config) {
    var _this = this;
    this.excludeFiles = config.common.excludeFiles || false;
    this.fileExtensionsExclude = config.common.fileExtensionsExclude || [];
    this.excludedSites = config.common.excludedSites || [];
    this.enableAroundCount = config.common.enableAroundCount || false;
    this.nameAroundKeywordsCount = config.common.nameAroundKeywordsCount || 10;
    (config.keywords && config.keywords.common_specific_keywords ? config.keywords.common_specific_keywords : []).forEach(function (keywordsConfig) {
      (keywordsConfig.keywords || []).forEach(function (commonSpecKeyword) {
        var newKeywordConfig = new SearchEngineKeywordConfigV4(commonSpecKeyword, keywordsConfig.riskscore || 0.5, false);
        _this.commonSpecificKeywords.push(newKeywordConfig);
      });
    });
    (config.keywords && config.keywords.common_banned_keywords ? config.keywords.common_banned_keywords : []).forEach(function (keywordsConfig) {
      (keywordsConfig.keywords || []).forEach(function (bannedKeyword) {
        var newKeywordConfig = new SearchEngineKeywordConfigV4(bannedKeyword, keywordsConfig.riskscore || 0.5, false);
        _this.commonBannedKeywords.push(newKeywordConfig);
      });
    });
    (config.keywords && config.keywords.common_score_decrease_keywords ? config.keywords.common_score_decrease_keywords : []).forEach(function (decreaseKeyword) {
      var newKeywordConfig = new SearchEngineKeywordConfigV4(decreaseKeyword, 0.5, false);
      _this.commonScoreDecreaseKeywords.push(newKeywordConfig);
    });
    (config.keywords && config.keywords.common_banned_title_keywords ? config.keywords.common_banned_title_keywords : []).forEach(function (bannedTitleKeyword) {
      var newKeywordConfig = new SearchEngineKeywordConfigV4(bannedTitleKeyword, 0.5, false);
      _this.commonBannedTitleKeywords.push(newKeywordConfig);
    });
  };
  _proto.addAdditionalKeywords = function addAdditionalKeywords(additionalKeywords) {
    this.additionalKeywords = (additionalKeywords || []).filter(function (addKeyword) {
      return !Number.isNaN(parseFloat(addKeyword.riskscore));
    }).map(function (addKeyword) {
      return new SearchEngineKeywordConfigV4(addKeyword.keyword, parseFloat(addKeyword.riskscore), addKeyword.type === "mandatory");
    });
  };
  _proto.getAroundQueryPart = function getAroundQueryPart() {
    return this.enableAroundCount && this.nameAroundKeywordsCount ? "AROUND(" + this.nameAroundKeywordsCount + ")" : "";
  };
  _proto.getCombinedKeywordsQueryPart = function getCombinedKeywordsQueryPart(searchConfig) {
    var queryPart = "";
    if (searchConfig instanceof SearchEngineRequestKeywordsDetailsConfigV5) {
      queryPart = searchConfig.getCombinedKeywordsQueryPart();
    }
    if (searchConfig instanceof SearchEngineRequestAdditionalKeywordsConfigV5) {
      queryPart = searchConfig.getCombinedKeywordsQueryPart();
    }
    if (!(searchConfig instanceof SearchEngineRequestAdditionalKeywordsConfigV5)) {
      var mandatoryKeywordsPart = this.additionalKeywords.filter(function (addKeyword) {
        return addKeyword.checkIsMandatory();
      }).map(function (keywordConfig) {
        return keywordConfig.getKeyword().split(" ").length > 1 ? "\"" + keywordConfig.getKeyword() + "\"" : keywordConfig.getKeyword();
      }).join(" AND ");
      queryPart += mandatoryKeywordsPart.length ? (queryPart.length ? " AND " : "") + mandatoryKeywordsPart : "";
      var optionalKeywordsPart = this.additionalKeywords.filter(function (addKeyword) {
        return !addKeyword.checkIsMandatory();
      }).map(function (keywordConfig) {
        return keywordConfig.getKeyword().split(" ").length > 1 ? "\"" + keywordConfig.getKeyword() + "\"" : keywordConfig.getKeyword();
      }).join(" OR ");
      queryPart += optionalKeywordsPart.length ? (queryPart.length ? " OR " : "") + "(" + optionalKeywordsPart + ")" : "";
    }
    return queryPart;
  };
  _proto.getExcludedKeywordsQueryPart = function getExcludedKeywordsQueryPart(searchConfig) {
    return this.filterUniqueKeywords(this.commonBannedKeywords.concat(searchConfig.getBannedKeywords())).map(function (bk) {
      return bk.getKeyword().split(" ").length > 1 ? "-\"" + bk.getKeyword() + "\"" : "-" + bk.getKeyword();
    }).join(" ");
  };
  _proto.getExcludedFileTypesQueryPart = function getExcludedFileTypesQueryPart() {
    return this.excludeFiles ? this.fileExtensionsExclude.map(function (extension) {
      return "-filetype:" + extension;
    }).join(" ") : "";
  };
  _proto.getExcludedSitesQueryPart = function getExcludedSitesQueryPart() {
    return this.excludedSites.slice(0, 30).map(function (site) {
      return "-inurl:" + site;
    }).join(" ");
  };
  _proto.getAllQueryParts = function getAllQueryParts(searchConfig) {
    var queryPart = "";
    var aroundQueryPart = this.getAroundQueryPart();
    var combinedKeywordsQueryPart = this.getCombinedKeywordsQueryPart(searchConfig);
    var excludedKeywordsQueryPart = this.getExcludedKeywordsQueryPart(searchConfig);
    var excludedSitesQueryPart = this.getExcludedSitesQueryPart();
    var excludedFileTypesQueryPart = this.getExcludedFileTypesQueryPart();
    if (aroundQueryPart) {
      queryPart += (queryPart ? " " : "") + aroundQueryPart;
    }
    if (combinedKeywordsQueryPart) {
      queryPart += (queryPart ? " " : "") + combinedKeywordsQueryPart;
    }
    if (excludedFileTypesQueryPart) {
      queryPart += (queryPart ? " " : "") + excludedFileTypesQueryPart;
    }
    if (excludedKeywordsQueryPart) {
      queryPart += (queryPart ? " " : "") + excludedKeywordsQueryPart;
    }
    if (excludedSitesQueryPart) {
      queryPart += (queryPart ? " " : "") + excludedSitesQueryPart;
    }
    return queryPart.trim();
  };
  _proto.filterUniqueKeywords = function filterUniqueKeywords(keywordConfigs) {
    keywordConfigs.sort(compareByRiskScore);
    var finalResults = [];
    keywordConfigs.forEach(function (keywordCondig) {
      var existedKeyword = finalResults.find(function (finalRes) {
        return finalRes.getKeyword() === keywordCondig.getKeyword();
      });
      if (!existedKeyword) {
        finalResults.push(keywordCondig);
      }
    });
    return finalResults;
  };
  _proto.getMandatoryAdditionalKeywords = function getMandatoryAdditionalKeywords() {
    return this.additionalKeywords.filter(function (addKeyword) {
      return addKeyword.checkIsMandatory();
    }).map(function (addKeyword) {
      return addKeyword.getKeyword();
    });
  };
  _proto.getOptionalAdditionalKeywords = function getOptionalAdditionalKeywords() {
    return this.additionalKeywords.filter(function (addKeyword) {
      return !addKeyword.checkIsMandatory();
    }).map(function (addKeyword) {
      return addKeyword.getKeyword();
    });
  };
  _proto.getAllKeywords = function getAllKeywords(searchConfig) {
    return this.filterUniqueKeywords(this.commonSpecificKeywords.concat(searchConfig ? searchConfig.getAllKeywords() : []).concat(this.additionalKeywords));
  };
  _proto.getAllBannedKeywords = function getAllBannedKeywords(searchConfig) {
    return this.filterUniqueKeywords(this.commonBannedKeywords.concat(searchConfig ? searchConfig.getBannedKeywords() : []));
  };
  _proto.getAllScoreDecreaseKeywords = function getAllScoreDecreaseKeywords(searchConfig) {
    return this.filterUniqueKeywords(this.commonScoreDecreaseKeywords.concat(searchConfig ? searchConfig.getScoreDecreaseKeywords() : []));
  };
  _proto.checkSiteIsExcluded = function checkSiteIsExcluded(linkUrl) {
    return (this.excludedSites || []).filter(function (site) {
      return linkUrl.indexOf(site) !== -1;
    }).length > 0;
  };
  _proto.checkTitleHasBannedKeywords = function checkTitleHasBannedKeywords(title) {
    title = title.toLowerCase();
    return (this.commonBannedTitleKeywords || []).filter(function (bk) {
      return title.indexOf(bk.getKeyword().toLowerCase()) !== -1;
    }).length > 0;
  };
  _proto.checkSummaryHasBannedKeywords = function checkSummaryHasBannedKeywords(title, description) {
    title = title.toLowerCase();
    description = description.toLowerCase();
    return (this.commonBannedKeywords || []).filter(function (bk) {
      return title.indexOf(bk.getKeyword().toLowerCase()) > -1 || description.indexOf(bk.getKeyword().toLowerCase()) > -1;
    }).length > 0;
  };
  _proto.checkTitleOrDescriptionContainsBannedCharacters = function checkTitleOrDescriptionContainsBannedCharacters(title, description) {
    return !!(title || "").match(/[\u0E00-\u0E7F\u3040-\u30ff\u3400-\u4dbf\u4e00-\u9fff\uf900-\ufaff\uff66-\uff9f]/) || !!(description || "").match(/[\u0E00-\u0E7F\u3040-\u30ff\u3400-\u4dbf\u4e00-\u9fff\uf900-\ufaff\uff66-\uff9f]/);
  };
  _proto.destroy = function destroy() {
    this.excludeFiles = false;
    this.fileExtensionsExclude = [];
    this.excludedSites = [];
    this.enableAroundCount = false;
    this.nameAroundKeywordsCount = 0;
    this.commonSpecificKeywords = [];
    this.commonBannedKeywords = [];
    this.commonScoreDecreaseKeywords = [];
    this.commonBannedTitleKeywords = [];
    this.additionalKeywords = [];
  };
  return MediaSearchEngineServiceV5;
}();
module.exports = {
  MediaSearchEngineServiceV5: MediaSearchEngineServiceV5
};

},{"../../../common/utils/comparisons-v4":688,"../../models/keywords":811,"../../models/request-configs/search-engine":828}],878:[function(require,module,exports){
"use strict";

var _require = require("./group-requests-config-service-v5"),
  GroupRequestsConfigServiceV5 = _require.GroupRequestsConfigServiceV5;
var _require2 = require("./separate-requests-config-service-v5"),
  SeparateRequestsConfigServiceV5 = _require2.SeparateRequestsConfigServiceV5;
var MediaSearchScoreTypeServiceV4 = function () {
  function MediaSearchScoreTypeServiceV4(scoreType) {
    this.scoreType = scoreType;
    this.groupRequestsConfigService = null;
    this.separateRequestsConfigService = null;
  }
  var _proto = MediaSearchScoreTypeServiceV4.prototype;
  _proto.setGroupRequests = function setGroupRequests(configs) {
    this.groupRequestsConfigService = new GroupRequestsConfigServiceV5();
    this.groupRequestsConfigService.parseConfigData(configs);
  };
  _proto.setSeparateRequests = function setSeparateRequests(configs) {
    this.separateRequestsConfigService = new SeparateRequestsConfigServiceV5();
    this.separateRequestsConfigService.parseConfigData(configs);
  };
  _proto.getScoreType = function getScoreType() {
    return this.scoreType;
  };
  _proto.addAdditionalKeywordsRequest = function addAdditionalKeywordsRequest(additionalKeywords, addToGroups, addToSeparates) {
    if (this.groupRequestsConfigService && addToGroups) {
      this.groupRequestsConfigService.createGroupFromAdditionalKeywords(additionalKeywords);
    }
    if (this.separateRequestsConfigService && addToSeparates) {
      this.separateRequestsConfigService.addAdditionalKeywordsRequest(additionalKeywords);
    }
  };
  _proto.destroy = function destroy() {
    var _this$groupRequestsCo, _this$separateRequest;
    (_this$groupRequestsCo = this.groupRequestsConfigService) == null || _this$groupRequestsCo.destroy();
    this.groupRequestsConfigService = null;
    (_this$separateRequest = this.separateRequestsConfigService) == null || _this$separateRequest.destroy();
    this.separateRequestsConfigService = null;
  };
  return MediaSearchScoreTypeServiceV4;
}();
module.exports = {
  MediaSearchScoreTypeServiceV4: MediaSearchScoreTypeServiceV4
};

},{"./group-requests-config-service-v5":875,"./separate-requests-config-service-v5":879}],879:[function(require,module,exports){
"use strict";

var _require = require("../../models/request-configs"),
  AlephOccrpRequestConfigV5 = _require.AlephOccrpRequestConfigV5,
  ExtraSourceRequestConfigV5 = _require.ExtraSourceRequestConfigV5,
  GoogleNewsRequestConfigV5 = _require.GoogleNewsRequestConfigV5,
  OpenCorporatesRequestConfigV5 = _require.OpenCorporatesRequestConfigV5,
  OpenSanctionsRequestConfigV5 = _require.OpenSanctionsRequestConfigV5,
  SearchEngineRequestConfigV5 = _require.SearchEngineRequestConfigV5,
  StockMarketRequestConfigV5 = _require.StockMarketRequestConfigV5;
var _require2 = require("../../models/request-configs/search-engine"),
  SearchEngineRequestAdditionalKeywordsConfigV5 = _require2.SearchEngineRequestAdditionalKeywordsConfigV5;
var _require3 = require("../../../constants/source-types"),
  GOOGLE_SEARCH_SOURCE_CODE = _require3.GOOGLE_SEARCH_SOURCE_CODE,
  GOOGLE_NEWS_SOURCE_CODE = _require3.GOOGLE_NEWS_SOURCE_CODE,
  EXTRA_SOURCE_SOURCE_CODE = _require3.EXTRA_SOURCE_SOURCE_CODE,
  STOCK_MARKETS_SOURCE_CODE = _require3.STOCK_MARKETS_SOURCE_CODE,
  ALEPH_OCCRP_SOURCE_CODE = _require3.ALEPH_OCCRP_SOURCE_CODE,
  OPEN_SANCTIONS_SOURCE_CODE = _require3.OPEN_SANCTIONS_SOURCE_CODE,
  OPEN_CORPORATES_SOURCE_CODE = _require3.OPEN_CORPORATES_SOURCE_CODE,
  STOCK_MARKET_SOURCE_CODE = _require3.STOCK_MARKET_SOURCE_CODE;
var SeparateRequestsConfigServiceV5 = function () {
  function SeparateRequestsConfigServiceV5() {
    this.requestsConfigs = [];
  }
  var _proto = SeparateRequestsConfigServiceV5.prototype;
  _proto.parseConfigData = function parseConfigData(requestsConfigs) {
    var _this = this;
    (requestsConfigs || []).forEach(function (requestConfig) {
      var newRequestConfig = null;
      switch (requestConfig.type) {
        case GOOGLE_SEARCH_SOURCE_CODE:
          newRequestConfig = new SearchEngineRequestConfigV5(GOOGLE_SEARCH_SOURCE_CODE, requestConfig.single_processing, requestConfig.batch_processing, requestConfig.fast_processing, requestConfig.expected_result_languages, requestConfig.request, [], requestConfig.after, requestConfig.before);
          break;
        case EXTRA_SOURCE_SOURCE_CODE:
          newRequestConfig = new ExtraSourceRequestConfigV5(EXTRA_SOURCE_SOURCE_CODE, requestConfig.single_processing, requestConfig.batch_processing, requestConfig.fast_processing, requestConfig.sites, requestConfig.after, requestConfig.before);
          break;
        case STOCK_MARKET_SOURCE_CODE:
          newRequestConfig = new StockMarketRequestConfigV5(STOCK_MARKETS_SOURCE_CODE, requestConfig.single_processing, requestConfig.batch_processing, requestConfig.fast_processing, requestConfig.sites, requestConfig.after, requestConfig.before);
          break;
        case STOCK_MARKETS_SOURCE_CODE:
          newRequestConfig = new StockMarketRequestConfigV5(STOCK_MARKETS_SOURCE_CODE, requestConfig.single_processing, requestConfig.batch_processing, requestConfig.fast_processing, requestConfig.sites, requestConfig.after, requestConfig.before);
          break;
        case GOOGLE_NEWS_SOURCE_CODE:
          newRequestConfig = new GoogleNewsRequestConfigV5(GOOGLE_NEWS_SOURCE_CODE, requestConfig.single_processing, requestConfig.batch_processing, requestConfig.fast_processing, requestConfig.expected_result_languages, requestConfig.after, requestConfig.before);
          break;
        case ALEPH_OCCRP_SOURCE_CODE:
          newRequestConfig = new AlephOccrpRequestConfigV5(ALEPH_OCCRP_SOURCE_CODE, requestConfig.single_processing, requestConfig.batch_processing, requestConfig.fast_processing, requestConfig.expected_result_languages, requestConfig.after, requestConfig.before);
          break;
        case OPEN_SANCTIONS_SOURCE_CODE:
          newRequestConfig = new OpenSanctionsRequestConfigV5(OPEN_SANCTIONS_SOURCE_CODE, requestConfig.single_processing, requestConfig.batch_processing, requestConfig.fast_processing, requestConfig.expected_result_languages, requestConfig.after, requestConfig.before);
          break;
        case OPEN_CORPORATES_SOURCE_CODE:
          newRequestConfig = new OpenCorporatesRequestConfigV5(OPEN_CORPORATES_SOURCE_CODE, requestConfig.single_processing, requestConfig.batch_processing, requestConfig.fast_processing, requestConfig.expected_result_languages, requestConfig.after, requestConfig.before);
          break;
        default:
          break;
      }
      if (newRequestConfig != null) {
        _this.requestsConfigs.push(newRequestConfig);
      }
    });
  };
  _proto.addAdditionalKeywordsRequest = function addAdditionalKeywordsRequest(additionalKeywords) {
    this.requestsConfigs = this.requestsConfigs.filter(function (requestConfig) {
      return !(requestConfig instanceof SearchEngineRequestConfigV5 && requestConfig.getSearchConfig() instanceof SearchEngineRequestAdditionalKeywordsConfigV5);
    });
    if (additionalKeywords && additionalKeywords.length) {
      var newRequestConfig = new SearchEngineRequestConfigV5(GOOGLE_SEARCH_SOURCE_CODE, true, false, true, ["en", "de", "fr", "es", "it"], null, additionalKeywords, "", "");
      this.requestsConfigs.push(newRequestConfig);
    }
  };
  _proto.getById = function getById(requestObjectId) {
    return this.requestsConfigs.find(function (config) {
      return config.getId() === requestObjectId;
    });
  };
  _proto.getAllRequestsByType = function getAllRequestsByType(type, isBatch, fastProcessing) {
    return this.requestsConfigs.filter(function (request) {
      return request.getType() === type && (fastProcessing ? request.checkIsFastProcessing() : true) && (isBatch ? request.checkIsBatchProcessing() : request.checkIsSingleProcessing());
    });
  };
  _proto.destroy = function destroy() {
    this.requestsConfigs.forEach(function (req) {
      req.destroy();
    });
    this.requestsConfigs = [];
  };
  return SeparateRequestsConfigServiceV5;
}();
module.exports = {
  SeparateRequestsConfigServiceV5: SeparateRequestsConfigServiceV5
};

},{"../../../constants/source-types":697,"../../models/request-configs":822,"../../models/request-configs/search-engine":828}],880:[function(require,module,exports){
"use strict";

var _require = require("./media-search-riskscoring-service-v1"),
  MediaSearchRiskScoreCountService = _require.MediaSearchRiskScoreCountService;
module.exports = {
  MediaSearchRiskScoreCountService: MediaSearchRiskScoreCountService
};

},{"./media-search-riskscoring-service-v1":881}],881:[function(require,module,exports){
"use strict";

var _require = require("../../../common/utils/common-v4"),
  remapIntervals = _require.remapIntervals;
var _require2 = require("../../../common/utils/filters-v4"),
  onlyUnique = _require2.onlyUnique;
var _require3 = require("../../../common/utils/strings-v4"),
  dropCompanySuffix = _require3.dropCompanySuffix,
  findAllOccurances = _require3.findAllOccurances,
  getWordsCountBetween = _require3.getWordsCountBetween,
  replaceManySpaces = _require3.replaceManySpaces;
var _require4 = require("../../../common/utils/comparisons-v4"),
  compareByIdx = _require4.compareByIdx;
var _require5 = require("../../../common/utils/dictionaries-v4"),
  separators = _require5.separators;
var MediaSearchRiskScoreCountService = function () {
  function MediaSearchRiskScoreCountService() {
    this.excludedNameParts = [];
  }
  var _proto = MediaSearchRiskScoreCountService.prototype;
  _proto.setExcludedNameParts = function setExcludedNameParts(excludedNameParts) {
    this.excludedNameParts = excludedNameParts || [];
  };
  _proto.checkFullPersonNamePresented = function checkFullPersonNamePresented(allText, personName) {
    return allText.toLowerCase().indexOf(personName.toLowerCase()) !== -1;
  };
  _proto.checkPersonNamePresented = function checkPersonNamePresented(allText, personName, personSynonims, isCompany) {
    var allPersonNameOccurances = this.getAllPersonNameOccurances(allText, personName, personSynonims, isCompany);
    var isPersonNamePresented = allPersonNameOccurances.find(function (personNameObj) {
      return personNameObj.occurances.length > 0;
    });
    return isPersonNamePresented !== null && isPersonNamePresented !== undefined;
  };
  _proto.getAllPersonNameOccurances = function getAllPersonNameOccurances(allText, personName, personSynonims, isCompany) {
    var allPersonNameOccurances = [];
    var fullPersonNameOccurances = findAllOccurances(personName, allText, true, false);
    allPersonNameOccurances.push({
      name: personName,
      occurances: fullPersonNameOccurances
    });
    var personNameParts = [];
    if (isCompany) {
      personNameParts = personName.split(" ");
      (this.excludedNameParts || []).forEach(function (exPart) {
        personNameParts = personNameParts.filter(function (namePart) {
          return namePart.trim().toLowerCase() !== exPart.trim().toLowerCase();
        });
      });
      var companyAlias = dropCompanySuffix(personName);
      if (!personNameParts.find(function (namePart) {
        return namePart.trim().toLowerCase() === companyAlias.trim().toLowerCase();
      })) {
        personNameParts.push(companyAlias);
      }
    } else {
      var parts = personName.split(" ");
      personNameParts = [parts[parts.length - 1]];
      if (parts.length >= 3) {
        personNameParts.push(parts[0] + " " + parts[parts.length - 1]);
      }
    }
    personNameParts = personNameParts.concat(personSynonims);
    personNameParts.filter(onlyUnique);
    personNameParts.forEach(function (namePart) {
      if (!allPersonNameOccurances.find(function (nameOcc) {
        return nameOcc.name === namePart;
      })) {
        var namePartObj = {
          name: namePart,
          occurances: []
        };
        var namePartOccurances = findAllOccurances(namePart, allText, true, false);
        var _loop = function _loop() {
          var currNamePartIdx = namePartOccurances[i];
          var intersections = fullPersonNameOccurances.filter(function (fullNameIdx) {
            return currNamePartIdx >= fullNameIdx && currNamePartIdx + namePart.length <= fullNameIdx + personName.length;
          });
          if (!intersections.length) {
            namePartObj.occurances.push(currNamePartIdx);
          }
        };
        for (var i = 0; i < namePartOccurances.length; i++) {
          _loop();
        }
        allPersonNameOccurances.push(namePartObj);
      }
    });
    return allPersonNameOccurances;
  };
  _proto.getKeywordOccurances = function getKeywordOccurances(allText, keywordsConfigs) {
    var keywordsOccurances = [];
    keywordsConfigs.forEach(function (keywordConfig) {
      var keyword = keywordConfig.keyword.toLowerCase();
      var keywordOccurances = findAllOccurances(keyword, allText, false, true);
      if (keywordOccurances && keywordOccurances.length) {
        keywordsOccurances.push({
          keyword: keyword,
          occurances: keywordOccurances,
          riskScore: keywordConfig.riskScore || 0
        });
      }
    });
    return keywordsOccurances;
  };
  _proto.getTextForSentimentScore = function getTextForSentimentScore(documentText, personName, personSynonims, isCompany) {
    var allText = replaceManySpaces(documentText.trim(), false);
    var allPersonNameOccurances = this.getAllPersonNameOccurances(allText, personName, personSynonims, isCompany);
    var sortedNameOccurances = [];
    allPersonNameOccurances.forEach(function (namePartObj) {
      var name = namePartObj.name;
      namePartObj.occurances.forEach(function (occuranceIdx) {
        sortedNameOccurances.push({
          name: name,
          occuranceIdx: occuranceIdx
        });
      });
    });
    sortedNameOccurances.sort(compareByIdx);
    var textParts = [];
    sortedNameOccurances.forEach(function (nameOccurance) {
      var nameIdx = nameOccurance.occuranceIdx;
      var startIdx = nameIdx - 1000 >= 0 ? nameIdx - 1000 : 0;
      var endIdx = nameIdx + 1000 - 1;
      var txtPartIntersection = textParts.find(function (textPart) {
        return textPart.startIdx <= startIdx && textPart.endIdx >= startIdx;
      });
      if (txtPartIntersection) {
        txtPartIntersection.endIdx = endIdx;
      } else {
        textParts.push({
          startIdx: startIdx,
          nameIdx: nameIdx,
          endIdx: endIdx
        });
      }
    });
    var textPartsStr = "";
    textParts.forEach(function (textPart, idx) {
      if (idx === 0 || idx === textParts.length) {
        textPartsStr += allText.substring(textPart.startIdx, textPart.endIdx);
      } else {
        textPartsStr += " ... " + allText.substring(textPart.startIdx, textPart.endIdx) + " ... ";
      }
    });
    return textPartsStr;
  };
  _proto.getRiskScoreKeywordsSumm = function getRiskScoreKeywordsSumm(allKeywordOccurances) {
    var summ = 0;
    allKeywordOccurances.forEach(function (keywordOccurances) {
      (keywordOccurances.occurances || []).forEach(function (occurance, idx) {
        summ += keywordOccurances.riskScore * Math.exp(-idx / 5);
      });
    });
    return summ;
  };
  _proto.countRiskScoreByKeywords = function countRiskScoreByKeywords(allKeywordOccurances) {
    var summ = this.getRiskScoreKeywordsSumm(allKeywordOccurances);
    return 0.25 * Math.abs(summ) / (1 + 0.25 * Math.abs(summ));
  };
  _proto.countRiskScoreByNames = function countRiskScoreByNames(allText, allWordsCount, allPersonNameOccurances) {
    var coeff = 0.2;
    var firstPart = 0;
    var secondPart = 0;
    var summ = 0;
    var currNameCount = 0;
    var namesCount = allPersonNameOccurances.reduce(function (a, b) {
      return a + (b.occurances || []).length;
    }, 0);
    for (var i = 0; i < allPersonNameOccurances.length; i++) {
      for (var j = 0; j < allPersonNameOccurances[i].occurances.length; j++) {
        currNameCount++;
        var currNamePosition = getWordsCountBetween(allText, 0, allPersonNameOccurances[i].occurances[j]);
        summ += Math.pow(currNamePosition / (allWordsCount + 1) - currNameCount / (namesCount + 1), 2);
      }
    }
    firstPart = 1 - Math.exp(-coeff * namesCount);
    secondPart = 1 - Math.sqrt(summ / (namesCount || 1));
    return firstPart * secondPart;
  };
  _proto.countRiskScoreByNamesAndKeywords = function countRiskScoreByNamesAndKeywords(allText, allWordsCount, allKeywordOccurances, allPersonNameOccurances) {
    var result = 0;
    var riskScoreKeywordsOccurances = allKeywordOccurances.filter(function (keywordOccurance) {
      return keywordOccurance.riskScore;
    });
    var totalKeywordsOccurancesCount = riskScoreKeywordsOccurances.reduce(function (a, b) {
      return a + (b.occurances || []).length;
    }, 0);
    var totalNameOccurancesCount = allPersonNameOccurances.reduce(function (a, b) {
      return a + (b.occurances || []).length;
    }, 0);
    if (totalKeywordsOccurancesCount === 0 || totalNameOccurancesCount === 0) {
      result = 0;
    } else if (totalKeywordsOccurancesCount > 30 && totalNameOccurancesCount > 30) {
      result = 0.7;
    } else {
      var aggregatedKeywordsScores = [];
      var sortDesc = function sortDesc(a, b) {
        return b - a;
      };
      var max_w = 0.9;
      var min_sum_w = 0;
      var dec_koef = 3;
      riskScoreKeywordsOccurances.forEach(function (keywordOccurance) {
        var riskScore = keywordOccurance.riskScore;
        (keywordOccurance.occurances || []).forEach(function (occuranceIdx) {
          var normalizedScores = [];
          allPersonNameOccurances.forEach(function (namePartOccurance) {
            var name = namePartOccurance.name;
            (namePartOccurance.occurances || []).forEach(function (namePartIdx) {
              var wordsCountBetween = getWordsCountBetween(allText, namePartIdx + name.length, occuranceIdx);
              var norma = (wordsCountBetween || 1) / allWordsCount;
              normalizedScores.push(riskScore * norma);
            });
          });
          normalizedScores = normalizedScores.sort(sortDesc).slice(0, 5);
          var summOfWeights = 0;
          var aggregated = 0;
          normalizedScores.forEach(function (normalizedScore, idx) {
            var decCoeff = max_w / Math.pow(dec_koef, idx);
            aggregated += normalizedScore * decCoeff;
            summOfWeights += decCoeff;
          });
          aggregatedKeywordsScores.push({
            keyword: keywordOccurance.keyword,
            score: aggregated / (summOfWeights > min_sum_w ? summOfWeights : min_sum_w)
          });
        });
      });
      var sortKeywordsDesc = function sortKeywordsDesc(a, b) {
        return b.score - a.score;
      };
      aggregatedKeywordsScores.sort(sortKeywordsDesc);
      max_w = 0.6;
      min_sum_w = 0;
      dec_koef = 2;
      var summOfWeights = 0;
      var aggregated = 0;
      aggregatedKeywordsScores.forEach(function (keywordScore, idx, array) {
        var countBefore = array.filter(function (item, itemIdx) {
          return item.keyword === keywordScore.keyword && itemIdx < idx;
        }).length;
        if (countBefore < 5) {
          var decCoeff = max_w / Math.pow(dec_koef, idx + countBefore);
          aggregated += keywordScore.score * decCoeff;
          summOfWeights += decCoeff;
        }
      });
      result = aggregated / (summOfWeights > min_sum_w ? summOfWeights : min_sum_w);
    }
    return result;
  };
  _proto.countTotalRiskScore = function countTotalRiskScore(documentText, personName, personSynonims, isCompany, personKeywords, searchConfigKeywords, bannedKeywordsConfigs, scoreDecreaseKeywordsConfigs) {
    var allText = documentText.trim();
    separators.forEach(function (sep) {
      var re = new RegExp("\\" + sep, "g");
      allText = allText.replace(re, " ");
    });
    allText = replaceManySpaces(allText, true);
    var allPersonNameOccurances = this.getAllPersonNameOccurances(allText, personName, personSynonims, isCompany);
    var allKeywordOccurances = this.getKeywordOccurances(allText, personKeywords.map(function (keyword) {
      return {
        keyword: keyword,
        riskScore: 0
      };
    }));
    allKeywordOccurances = allKeywordOccurances.concat(this.getKeywordOccurances(allText, searchConfigKeywords));
    var bannedKeywordOccurances = this.getKeywordOccurances(allText, bannedKeywordsConfigs);
    var scoreDecreaseKeywordsOccurances = this.getKeywordOccurances(allText, scoreDecreaseKeywordsConfigs);
    var allWordsCount = allText.split(" ").length;
    var keywordsRiskScore = this.countRiskScoreByKeywords(allKeywordOccurances);
    keywordsRiskScore = remapIntervals(keywordsRiskScore, 0, 1, 0.5, 1);
    var namePartsOccurancesRiskScore = this.countRiskScoreByNames(allText, allWordsCount, allPersonNameOccurances);
    namePartsOccurancesRiskScore = remapIntervals(namePartsOccurancesRiskScore, 0, 1, 0.5, 1);
    var keywordsNamesRiskScore = this.countRiskScoreByNamesAndKeywords(allText, allWordsCount, allKeywordOccurances, allPersonNameOccurances);
    keywordsNamesRiskScore = remapIntervals(keywordsNamesRiskScore, 0, 1, 0.5, 1);
    var bannedKeywordsRiskScore = this.countRiskScoreByKeywords(bannedKeywordOccurances);
    var totalRiskScore = (keywordsRiskScore * 0.25 + keywordsNamesRiskScore * 0.25 + namePartsOccurancesRiskScore * 0.5) * (1 - bannedKeywordsRiskScore);
    var isScoreDecreaseKeywordsPresented = scoreDecreaseKeywordsOccurances.filter(function (scoreDecreaseObj) {
      return scoreDecreaseObj.occurances.length > 0;
    }).length > 0;
    if (isScoreDecreaseKeywordsPresented) {
      totalRiskScore -= 0.05;
    }
    return totalRiskScore;
  };
  return MediaSearchRiskScoreCountService;
}();
module.exports = {
  MediaSearchRiskScoreCountService: MediaSearchRiskScoreCountService
};

},{"../../../common/utils/common-v4":687,"../../../common/utils/comparisons-v4":688,"../../../common/utils/dictionaries-v4":690,"../../../common/utils/filters-v4":691,"../../../common/utils/strings-v4":696}],882:[function(require,module,exports){
"use strict";

var _require = require("../../../common/utils/common-v4"),
  getBaseApi = _require.getBaseApi;
var _require2 = require("../../../common/utils/dictionaries-v4"),
  elementsForRemove = _require2.elementsForRemove;
var _require3 = require("../../../constants/source-types"),
  ALEPH_OCCRP_SOURCE_CODE = _require3.ALEPH_OCCRP_SOURCE_CODE,
  OPEN_SANCTIONS_SOURCE_CODE = _require3.OPEN_SANCTIONS_SOURCE_CODE,
  OPEN_CORPORATES_SOURCE_CODE = _require3.OPEN_CORPORATES_SOURCE_CODE,
  EXTRA_SOURCE_SOURCE_CODE = _require3.EXTRA_SOURCE_SOURCE_CODE;
var DocumentServiceV1 = function () {
  function DocumentServiceV1() {
    this.dbPediaUrl = "";
  }
  var _proto = DocumentServiceV1.prototype;
  _proto.setUrls = function setUrls(apiConfig) {
    this.dbPediaUrl = getBaseApi(apiConfig) + apiConfig.dbpedia;
  };
  _proto.parseHtmlFromString = function parseHtmlFromString(contentHtml) {
    return new DOMParser().parseFromString(contentHtml, "text/html");
  };
  _proto.getTitleFromHtml = function getTitleFromHtml(contentHtml) {
    return this.parseHtmlFromString(contentHtml).title;
  };
  _proto.getImgAbsLink = function getImgAbsLink(linkUrl, imageLink) {
    if (imageLink.indexOf("./") === 0 || imageLink.indexOf("../") === 0) {
      if (linkUrl.indexOf("rupep") !== -1) {
        imageLink = imageLink.replace("..", "https://rupep.org/static");
      } else {
        return imageLink;
      }
    }
    if (imageLink.indexOf("http") === 0 || imageLink.indexOf("https") === 0) {
      return imageLink;
    }
    if (imageLink.indexOf("/") === 0) {
      imageLink = imageLink.substring(1);
    }
    var tempLink = document.createElement("a");
    tempLink.href = linkUrl;
    var rootPath = tempLink.protocol + "//" + tempLink.host + "/";
    return rootPath + imageLink;
  };
  _proto.replaceDomainInLinks = function replaceDomainInLinks(newHTMLDocument, linkUrl) {
    var _this = this;
    var links = newHTMLDocument.getElementsByTagName("a");
    var images = newHTMLDocument.getElementsByTagName("img");
    var styles = newHTMLDocument.getElementsByTagName("style");
    var linksMaxCountConstraint = links.length > 250 ? 250 : links.length;
    for (var i = 0; i < linksMaxCountConstraint; i++) {
      if (links[i].classList.contains("named_entity") || links[i].classList.contains("keyword") || links[i].classList.contains("risk_entity_info") || links[i].classList.contains("main_person")) {} else {
        links[i].style.backgroundColor = "inherit";
      }
    }
    if (linkUrl) {
      var host = window.location.host;
      var tempLink = document.createElement("a");
      tempLink.href = linkUrl;
      for (var _i = 0; _i < linksMaxCountConstraint; _i++) {
        if (links[_i].host === host) {
          var currLinkHref = links[_i].getAttribute("href");
          if (currLinkHref && currLinkHref !== "/" && currLinkHref !== "#") {
            links[_i].protocol = tempLink.protocol;
            links[_i].hostname = tempLink.hostname;
            links[_i].host = tempLink.host;
            links[_i].port = tempLink.port;
            var newHref = links[_i].href;
            links[_i].setAttribute("href", newHref);
          }
        }
      }
      for (var _i2 = 0; _i2 < images.length; _i2++) {
        var imgSrc = images[_i2].getAttribute("src");
        if (imgSrc) {
          var absImgLink = this.getImgAbsLink(linkUrl, imgSrc);
          images[_i2].setAttribute("src", absImgLink);
        }
      }
      var imgUrlRegex = /url\((['|"]?)(.*?\.(gif|png|jpg|jpeg){1})(['|"]?)\)/gi;
      for (var _i3 = 0; _i3 < styles.length; _i3++) {
        var innerCssText = styles[_i3].innerHTML;
        var newInnerCssText = innerCssText.replace(imgUrlRegex, function (match, token) {
          var oldLink = match.substring("url(".length, match.length - 1);
          if (oldLink[0] === '"' || oldLink[0] === "'") {
            oldLink = oldLink.substring(1);
          }
          if (oldLink[oldLink.length - 1] === '"' || oldLink[oldLink.length - 1] === "'") {
            oldLink = oldLink.substring(0, oldLink.length - 1);
          }
          return "url(\"" + _this.getImgAbsLink(linkUrl, oldLink) + "\")";
        });
        styles[_i3].innerHTML = newInnerCssText;
      }
    }
  };
  _proto.createElementFromHtml = function createElementFromHtml(contentHtml, linkUrl, type) {
    if (type === EXTRA_SOURCE_SOURCE_CODE) {
      contentHtml = contentHtml.replace(/[\u200B-\u200D\uFEFF]/g, "");
    }
    var parsedHtmlDocument = this.parseHtmlFromString(contentHtml);
    var parsedStylesElements = [];
    if (type === EXTRA_SOURCE_SOURCE_CODE || type === ALEPH_OCCRP_SOURCE_CODE || type === OPEN_CORPORATES_SOURCE_CODE || type === OPEN_SANCTIONS_SOURCE_CODE) {
      parsedStylesElements = parsedHtmlDocument.documentElement.getElementsByTagName("style");
    }
    var parsedDocumentBody = parsedHtmlDocument.documentElement.getElementsByTagName("body")[0];
    var bodyInnerHTML = parsedDocumentBody.innerHTML || "";
    var newHTMLDocument = document.implementation.createHTMLDocument("preview");
    var newBody = document.createElementNS("http://www.w3.org/1999/xhtml", "body");
    newHTMLDocument.documentElement.appendChild(newBody);
    var divEl = newHTMLDocument.createElement("div");
    divEl.innerHTML = bodyInnerHTML;
    for (var i = 0; i < parsedStylesElements.length; i++) {
      var newStyleNode = newHTMLDocument.importNode(parsedStylesElements[i], true);
      divEl.appendChild(newStyleNode);
    }
    newHTMLDocument.body.appendChild(divEl);
    var elemsForRemove = [].concat(elementsForRemove);
    if (type === EXTRA_SOURCE_SOURCE_CODE) {
      elemsForRemove = elemsForRemove.filter(function (elem) {
        return elem !== "ul" && elem !== "ol";
      });
    }
    elemsForRemove.forEach(function (elName) {
      var elements = newHTMLDocument.getElementsByTagName(elName);
      while (elements.length) {
        var currElement = elements[0];
        if (currElement && currElement.parentNode) {
          var parent = currElement.parentNode;
          parent.removeChild(currElement);
        }
      }
    });
    if ("true" === "true") {
      this.replaceDomainInLinks(newHTMLDocument, linkUrl);
    }
    return divEl;
  };
  _proto.createElementFromMarkupHtml = function createElementFromMarkupHtml(contentHtml, linkUrl, baseContentElement) {
    var parsedHtmlDocument = this.parseHtmlFromString(contentHtml);
    var parsedDocumentBody = parsedHtmlDocument.documentElement.getElementsByTagName("body")[0];
    var bodyInnerHTML = parsedDocumentBody.innerHTML || "";
    var newHTMLDocument = document.implementation.createHTMLDocument("preview");
    var newBody = document.createElementNS("http://www.w3.org/1999/xhtml", "body");
    newHTMLDocument.documentElement.appendChild(newBody);
    var divEl = newHTMLDocument.createElement("div");
    divEl.innerHTML = bodyInnerHTML;
    if (baseContentElement) {
      var stylesElements = baseContentElement.getElementsByTagName("style");
      for (var i = 0; i < stylesElements.length; i++) {
        var newStyleNode = newHTMLDocument.importNode(stylesElements[i], true);
        divEl.appendChild(newStyleNode);
      }
    }
    newHTMLDocument.body.appendChild(divEl);
    if ("true" === "true") {
      this.replaceDomainInLinks(newHTMLDocument, linkUrl);
    }
    return divEl;
  };
  _proto.getInnerText = function getInnerText(contentElement) {
    var innerText = "";
    var nodeList = [];
    try {
      var treewalker = document.createTreeWalker(contentElement, NodeFilter.SHOW_TEXT, null);
      var currentNode = null;
      currentNode = treewalker.currentNode;
      while (currentNode) {
        if (!currentNode.childElementCount) {
          nodeList.push(currentNode);
        }
        currentNode = treewalker.nextNode();
      }
    } catch (e) {
      nodeList = [];
      var _textNodesUnder = function textNodesUnder(outerNode) {
        var all = [];
        for (var node = outerNode.firstChild; node; node = node.nextSibling) {
          if (node.nodeType === 3) {
            all.push(node);
          } else {
            all = all.concat(_textNodesUnder(node));
          }
        }
        return all;
      };
      nodeList = _textNodesUnder(contentElement);
    }
    nodeList = nodeList.filter(function (node) {
      return node.textContent && node.textContent.replaceAll(/\s+/g, " ").trim();
    });
    for (var i = 0; i < nodeList.length; i++) {
      var node = nodeList[i];
      innerText += node.textContent.replaceAll(/[\t|\f|\v| ]+/g, " ").replaceAll(/\r/g, "\n");
      if (node.nextSibling && i + 1 < nodeList.length && node.nextSibling.textContent === nodeList[i + 1].textContent) {} else if (i + 1 < nodeList.length && nodeList[i + 1].previousSibling && nodeList[i + 1].previousSibling.textContent === node.textContent) {} else {
        innerText += "\n";
      }
    }
    return innerText;
  };
  _proto.removeStyles = function removeStyles(contentElement) {
    var newHTMLDocument = document.implementation.createHTMLDocument("preview");
    var newBody = document.createElementNS("http://www.w3.org/1999/xhtml", "body");
    newHTMLDocument.documentElement.appendChild(newBody);
    var divEl = newHTMLDocument.createElement("div");
    divEl.innerHTML = contentElement.innerHTML;
    newHTMLDocument.body.appendChild(divEl);
    var elements = newHTMLDocument.getElementsByTagName("style");
    while (elements.length) {
      var currElement = elements[0];
      if (currElement && currElement.parentNode) {
        var parent = currElement.parentNode;
        parent.removeChild(currElement);
      }
    }
    return divEl;
  };
  _proto.getDocumentForHighlighting = function getDocumentForHighlighting(contentElement, highlightedElementId) {
    var newHTMLDocument = document.implementation.createHTMLDocument("preview");
    var newBody = document.createElementNS("http://www.w3.org/1999/xhtml", "body");
    newHTMLDocument.documentElement.appendChild(newBody);
    var newNode = newHTMLDocument.importNode(contentElement, true);
    newNode.setAttribute("id", highlightedElementId);
    newBody.appendChild(newNode);
    return newHTMLDocument;
  };
  _proto.getHtmlForMarkup = function getHtmlForMarkup(contentElement) {
    var newHTMLDocument = document.implementation.createHTMLDocument("preview");
    var newBody = document.createElementNS("http://www.w3.org/1999/xhtml", "body");
    newHTMLDocument.documentElement.appendChild(newBody);
    var contentElementWithoutStyles = this.removeStyles(contentElement);
    var newNode = newHTMLDocument.importNode(contentElementWithoutStyles, true);
    newBody.appendChild(newNode);
    return new XMLSerializer().serializeToString(newHTMLDocument);
  };
  _proto.getElementFromHtml = function getElementFromHtml(contentHtml) {
    var newHTMLDocument = document.implementation.createHTMLDocument("preview");
    var contentEl = newHTMLDocument.createElement("div");
    contentEl.innerHTML = contentHtml;
    return contentEl;
  };
  _proto.createAnalyzeDocumentElement = function createAnalyzeDocumentElement(contentHtml, risk, sentiment, imgSrc) {
    var newHTMLDocument = this.parseHtmlFromString(contentHtml);
    var newBody = newHTMLDocument.documentElement.getElementsByTagName("body")[0];
    var jqueryScript = newHTMLDocument.createElement("script");
    jqueryScript.type = "text/javascript";
    jqueryScript.src = "jquery-3.6.0.min.js";
    newBody.appendChild(jqueryScript);
    var authTokenScript = newHTMLDocument.createElement("script");
    authTokenScript.type = "text/javascript";
    authTokenScript.text = "var authToken = '" + localStorage.getItem("access_token") + "';\n" + ("var dbPediaUrl = '" + this.dbPediaUrl + "';");
    newBody.appendChild(authTokenScript);
    var modalScript = newHTMLDocument.createElement("script");
    modalScript.type = "text/javascript";
    modalScript.src = "modal.js";
    newBody.appendChild(modalScript);
    var tooltipCss = newHTMLDocument.createElement("link");
    tooltipCss.rel = "stylesheet";
    tooltipCss.href = "modal.css";
    newBody.appendChild(tooltipCss);
    var divCenter = {
      margin: "auto",
      width: "50%"
    };
    var paragraphCenter = {
      "text-align": "center"
    };
    var imgCenter = {
      display: "block",
      "margin-left": "auto",
      "margin-right": "auto"
    };
    if (imgSrc) {
      var xml = imgSrc.replace(/#/g, "%23");
      var img = new Image();
      img.src = "data:image/svg+xml;charset=utf-8," + xml;
      var imgDivElem = newHTMLDocument.createElement("div");
      $(img).appendTo(imgDivElem);
      $(img).css(imgCenter);
      $(newBody).prepend(imgDivElem);
    }
    var sentimentElem = newHTMLDocument.createElement("p");
    $(sentimentElem).html("<span style='font-weight: bold'>Sentiment: </span>" + ("<span>" + sentiment.toFixed(2) + "</span>"));
    $(sentimentElem).css(paragraphCenter);
    $(newBody).prepend(sentimentElem);
    var riskElem = newHTMLDocument.createElement("p");
    $(riskElem).html("<span style='font-weight: bold'>Riskscore: </span>" + ("<span class='value'>" + risk.toFixed(2) + "</span>"));
    $(riskElem).find(".value").css({
      "background-color": risk < 0.7 ? "#016450" : risk <= 0.8 ? "#FFFF00" : "#91003f",
      color: risk >= 0.7 && risk <= 0.8 ? "black" : "white"
    });
    $(riskElem).css(paragraphCenter);
    $(newBody).prepend(riskElem);
    var tooltipElem = newHTMLDocument.createElement("div");
    $(tooltipElem).html('<img src="" width="450px" height="300px" />');
    $(tooltipElem).attr("id", "modalTooltip");
    $(tooltipElem).addClass("tooltip-img");
    $(tooltipElem).css("display", "none");
    $(newBody).append(tooltipElem);
    var bodyInnerHtml = newBody.innerHTML;
    var contentEl = newHTMLDocument.createElement("div");
    contentEl.innerHTML = bodyInnerHtml;
    return contentEl;
  };
  return DocumentServiceV1;
}();
module.exports = {
  DocumentServiceV1: DocumentServiceV1
};

},{"../../../common/utils/common-v4":687,"../../../common/utils/dictionaries-v4":690,"../../../constants/source-types":697}],883:[function(require,module,exports){
"use strict";

var _require = require("../../instances/services/utils/document-service"),
  DocumentServiceInstance = _require.DocumentServiceInstance;
var _require2 = require("../../../common/utils/highlight-v4"),
  _highlightDocument = _require2.highlightDocument;
var HighlightServiceV1 = function () {
  function HighlightServiceV1() {
    this.documentService = null;
  }
  var _proto = HighlightServiceV1.prototype;
  _proto.highlightDocument = function highlightDocument(doc, keywords, elemName, highlightColor, namesMode, onClickFunc) {
    _highlightDocument(doc, keywords, elemName, highlightColor, namesMode, onClickFunc);
  };
  _proto.highlightEntities = function highlightEntities(searchResult) {
    var _this$documentService;
    if (searchResult.checkAreEntitiesHighlighted()) {
      return;
    }
    var contentElement = searchResult.getContentElement();
    var doc = (_this$documentService = this.documentService) == null ? void 0 : _this$documentService.getDocumentForHighlighting(contentElement, "highlighting");
    _highlightDocument(doc, searchResult.getEntityNames(), "a", "#ffcc66", true, "passNameToParent");
    searchResult.setContentElement(doc == null ? void 0 : doc.getElementById("highlighting"));
    searchResult.setEntitiesHighlighted(true);
  };
  _proto.highlightKeywords = function highlightKeywords(searchResult) {
    var _this$documentService2;
    if (searchResult.checkAreKeywordsHighlighted()) {
      return;
    }
    if (searchResult.checkIsFromExtraSource() || searchResult.checkIsFromAlephOccrp() || searchResult.checkIsFromOpenSanctions() || searchResult.checkIsFromOpenCorporates()) {
      return;
    }
    var contentElement = searchResult.getContentElement();
    var doc = (_this$documentService2 = this.documentService) == null ? void 0 : _this$documentService2.getDocumentForHighlighting(contentElement, "highlighting");
    var keywords = [].concat(searchResult.getPersonFullName().split(" ")).concat(searchResult.getPersonSynonims()).concat(searchResult.getPersonKeywords()).concat(searchResult.getKeywords());
    _highlightDocument(doc, keywords, "span", "#FFFF00", false, "");
    searchResult.setContentElement(doc == null ? void 0 : doc.getElementById("highlighting"));
    searchResult.setKeywordsHighlighted(true);
  };
  _proto.initServices = function initServices(apiConfig) {
    this.documentService = DocumentServiceInstance.getService();
    this.documentService.setUrls(apiConfig);
  };
  _proto.injectServices = function injectServices(documentService) {
    this.documentService = documentService;
  };
  return HighlightServiceV1;
}();
module.exports = {
  HighlightServiceV1: HighlightServiceV1
};

},{"../../../common/utils/highlight-v4":692,"../../instances/services/utils/document-service":807}],884:[function(require,module,exports){
"use strict";

var _require = require("./document-service-v1"),
  DocumentServiceV1 = _require.DocumentServiceV1;
var _require2 = require("./highlight-service-v1"),
  HighlightServiceV1 = _require2.HighlightServiceV1;
var _require3 = require("./new-tab-window-service-v1"),
  NewTabWindowServiceV1 = _require3.NewTabWindowServiceV1;
module.exports = {
  DocumentServiceV1: DocumentServiceV1,
  HighlightServiceV1: HighlightServiceV1,
  NewTabWindowServiceV1: NewTabWindowServiceV1
};

},{"./document-service-v1":882,"./highlight-service-v1":883,"./new-tab-window-service-v1":885}],885:[function(require,module,exports){
(function (global){(function (){
"use strict";

var _require = require("../../../common/utils/common-v4"),
  getBaseApi = _require.getBaseApi;
var NewTabWindowServiceV1 = function () {
  function NewTabWindowServiceV1() {
    this.dbPediaUrl = "";
    var window = "true" === "false" ? null : global;
    if (window && !window.openNameCheckTab) {
      window.openNameCheckTab = function (name, id, personId, searchResultId, linkAnalysServiceId) {
        if (window.MediaSearchStandalone && window.MediaSearchStandalone.isStandAlone) {
          return;
        }
        var url = NewTabWindowServiceV1.getNamecheckUrl(name, id, personId, searchResultId, linkAnalysServiceId);
        NewTabWindowServiceV1.openNewTab(url);
      };
    }
    if (window && !window.openGoogleSearchTab) {
      window.openGoogleSearchTab = function (name, id, personId, searchResultId, linkAnalysServiceId) {
        var url = NewTabWindowServiceV1.getGoogleSearchUrl(name, id, personId, searchResultId, linkAnalysServiceId);
        NewTabWindowServiceV1.openNewTab(url);
      };
    }
    if (window && !window.openListObjectTab) {
      window.openListObjectTab = function (objectId) {
        if (objectId) {
          var url = NewTabWindowServiceV1.getListObjectUrl(Array.isArray(objectId) ? objectId[0] : objectId);
          NewTabWindowServiceV1.openNewTab(url);
        }
      };
    }
  }
  var _proto = NewTabWindowServiceV1.prototype;
  _proto.setUrls = function setUrls(apiConfig) {
    this.dbPediaUrl = getBaseApi(apiConfig) + apiConfig.dbpedia;
  };
  NewTabWindowServiceV1.getNamecheckUrl = function getNamecheckUrl(name, itemId, personId, searchResultId, linkAnalysServiceId) {
    var host = window.location.host;
    var protocol = window.location.protocol;
    return protocol + "//" + host + "/#/namecheck?auto=true" + ("" + (name ? "&name=" + encodeURIComponent(name) : "")) + ("" + (itemId ? "&itemId=" + encodeURIComponent(itemId) : "") + (personId ? "&personId=" + encodeURIComponent(personId) : "") + (searchResultId ? "&searchResultId=" + encodeURIComponent(searchResultId) : "") + (linkAnalysServiceId ? "&linkAnalysServiceId=" + encodeURIComponent(linkAnalysServiceId) : ""));
  };
  NewTabWindowServiceV1.getGoogleSearchUrl = function getGoogleSearchUrl(name, itemId, personId, searchResultId, linkAnalysServiceId) {
    var host = window.location.host;
    var protocol = window.location.protocol;
    return protocol + "//" + host + "/#/google?auto=true" + ("" + (name ? "&name=" + encodeURIComponent(name) : "")) + ("" + (itemId ? "&itemId=" + encodeURIComponent(itemId) : "") + (personId ? "&personId=" + encodeURIComponent(personId) : "") + (searchResultId ? "&searchResultId=" + encodeURIComponent(searchResultId) : "") + (linkAnalysServiceId ? "&linkAnalysServiceId=" + encodeURIComponent(linkAnalysServiceId) : ""));
  };
  NewTabWindowServiceV1.getListObjectUrl = function getListObjectUrl(objectId) {
    var host = window.location.host;
    var protocol = window.location.protocol;
    return protocol + "//" + host + "/#/objects/list/" + objectId;
  };
  NewTabWindowServiceV1.openNewTab = function openNewTab(url) {
    var newTab = window.open(url, "_blank");
    if (newTab) {
      newTab.blur();
    }
    window.focus();
  };
  _proto.openBlankWindow = function openBlankWindow(element, personId, searchResultId, itemId, linkAnalysServiceId) {
    var wnd = window.open("about:blank", "", "width=800,height=600,resizable=yes,scrollbars=yes");
    if (!wnd) {
      return;
    }
    try {
      var $ulMenu = $("<ul class='menu' id='actionMenu'></ul>");
      $ulMenu.append($("<li id='namecheckItem'>").append($("<span>").append("Check against Sanction, Black & PEP lists")));
      $ulMenu.append($("<li id='googleCheckItem'>").append($("<span>").append("Run media search with Google")));
      $(element).append($ulMenu);
      $(element).find("div[id*='_modal_outer_']").css("display", "none");
      $(element).find("div.block-ui-container").css("display", "none");
      wnd.document.write($(element).html());
      var hh = wnd.document.getElementsByTagName("head")[0];
      var jqueryScript = wnd.document.createElement("script");
      jqueryScript.type = "text/javascript";
      jqueryScript.src = "config/media_search/jquery-3.6.0.min.js";
      hh.appendChild(jqueryScript);
      var authTokenScript = wnd.document.createElement("script");
      authTokenScript.type = "text/javascript";
      authTokenScript.text = "var authToken = '" + localStorage.getItem("access_token") + "';\n" + ("var dbPediaUrl = '" + this.dbPediaUrl + "';");
      hh.appendChild(authTokenScript);
      var modalScript = wnd.document.createElement("script");
      modalScript.type = "text/javascript";
      modalScript.src = "config/media_search/modal.js";
      hh.appendChild(modalScript);
      var tooltipCss = wnd.document.createElement("link");
      tooltipCss.rel = "stylesheet";
      tooltipCss.href = "config/media_search/modal.css";
      hh.appendChild(tooltipCss);
      var body = wnd.document.documentElement.getElementsByTagName("body")[0];
      var tooltipElem = wnd.document.createElement("div");
      $(tooltipElem).html('<img src="" width="450px" height="300px" />');
      $(tooltipElem).attr("id", "modalTooltip");
      $(tooltipElem).addClass("tooltip-img");
      $(tooltipElem).css("display", "none");
      $(body).append(tooltipElem);
      try {
        var style = wnd.document.createElement("style");
        style.type = "text/css";
        var css = "ul.menu {" + "   display: none;" + "   list-style: none;" + "   box-shadow: 0px 0px 4px rgba(0,0,0,.5);" + "   margin: 0;" + "   padding: 0;" + "   border-radius: 5px;" + "   position: absolute; " + "   background: #fff;" + "}" + "ul.menu li {" + "   height: 15px;" + "   margin: 5px;" + "   padding: 2px 5px;" + "   cursor: pointer;" + "}" + "ul.menu li:not(:last-child) {" + "   padding-bottom: 10px; " + "   border-bottom: 1px solid black;" + "}";
        if (style.styleSheet) {
          style.styleSheet.cssText = css;
        } else {
          style.appendChild(wnd.document.createTextNode(css));
        }
        hh.appendChild(style);
      } catch (error) {}
      try {
        var ss = wnd.document.createElement("script");
        var scr = "function passNameToParent(name) { window.opener.openNameCheckTab(name, " + (itemId ? "'" + itemId + "'" : "null") + ", " + (personId ? "'" + personId + "'" : "null") + ", " + (searchResultId ? "'" + searchResultId + "'" : "null") + ", " + (linkAnalysServiceId ? "'" + linkAnalysServiceId + "'" : "null") + "); window.opener.openGoogleSearchTab(name, " + (itemId ? "'" + itemId + "'" : "null") + ", " + (personId ? "'" + personId + "'" : "null") + ", " + (searchResultId ? "'" + searchResultId + "'" : "null") + ", " + (linkAnalysServiceId ? "'" + linkAnalysServiceId + "'" : "null") + "); }";
        ss.text = scr;
        hh.appendChild(ss);
      } catch (error) {}
      try {
        var _ss = wnd.document.createElement("script");
        var _scr = "function passObjectIdToParent(objectId) { window.opener.openListObjectTab(objectId); }";
        _ss.text = _scr;
        hh.appendChild(_ss);
      } catch (error) {}
      try {
        var ss2 = wnd.document.createElement("script");
        var scr2 = "var pageX; var pageY; var selectedText = '';\n" + "var ulWidth = 296; var ulHeight = 64; var ulMenu = null;\n" + "function getSelectedText() { \n" + "   var selectedText = ''; \n" + "   if (window.getSelection) { \n" + "     selectedText = window.getSelection().toString(); \n" + "   }\n" + "   else if (document.getSelection) { \n" + "       selectedText = document.getSelection().toString(); \n" + "   } \n" + "   else if (document.selection) { \n" + "       selectedText = document.selection.createRange().text;\n" + "   }\n" + "   return selectedText; \n" + "}\n" + "document.addEventListener('DOMContentLoaded', function(event) { \n" + "   ulMenu = document.getElementById('actionMenu');\n" + "   var nameChk = document.getElementById('namecheckItem');\n" + "   var googleChk = document.getElementById('googleCheckItem');\n" + "   nameChk.onmousedown = function(e) {\n" + "       e.preventDefault();\n" + "       e.stopPropagation();\n" + "   };\n" + "   googleChk.onmousedown = function(e) {\n" + "       e.preventDefault();\n" + "       e.stopPropagation();\n" + "   };\n" + "   nameChk.onclick = function(e) {\n" + "       if (selectedText) {\n" + ("          window.opener.openNameCheckTab(selectedText," + (itemId ? "'" + itemId + "'" : "null") + ", " + (personId ? "'" + personId + "'" : "null") + ", " + (searchResultId ? "'" + searchResultId + "'" : "null") + ", " + (linkAnalysServiceId ? "'" + linkAnalysServiceId + "'" : "null") + ");\n") + "       }\n" + "   };\n" + "   googleChk.onclick = function(e) {\n" + "       if (selectedText) {\n" + ("          window.opener.openGoogleSearchTab(selectedText, " + (itemId ? "'" + itemId + "'" : "null") + ", " + (personId ? "'" + personId + "'" : "null") + ", " + (searchResultId ? "'" + searchResultId + "'" : "null") + ", " + (linkAnalysServiceId ? "'" + linkAnalysServiceId + "'" : "null") + ");\n") + "       }\n" + "   };\n" + "});\n" + "   document.onmouseup = function(e) {\n" + "     var currSelectedText = getSelectedText();\n" + "     if(currSelectedText && currSelectedText.trim()){\n" + "             selectedText = currSelectedText;\n" + "             var xPos = e.pageX;\n" + "             var yPos = e.pageY;\n" + "             var width = document.documentElement.clientWidth;\n" + "             var height = document.documentElement.clientHeight;\n" + "             ulMenu.style.width = ulWidth;\n" + "             ulMenu.style.height = ulHeight;\n" + "             ulMenu.style.top = null;\n" + "             ulMenu.style.right = null;\n" + "             ulMenu.style.bottom = null;\n" + "             ulMenu.style.left = null;\n" + "             if (xPos + ulWidth >= width) {\n" + "                 ulMenu.style.right = width - xPos - 15;\n" + "             } else {\n" + "                 ulMenu.style.left = xPos - 15;\n" + "             }\n" + "             if (yPos + ulHeight >= height) {\n" + "                 ulMenu.style.top = yPos - ulHeight - 5;\n" + "             } else {\n" + "                 ulMenu.style.top = yPos + 5;\n" + "             }\n" + "             ulMenu.style.display = 'block';\n" + "     } else {\n" + "           ulMenu.style.display = 'none';" + "     }\n" + "   };\n" + "   document.onmousedown = function(e) {\n" + "       ulMenu.style.display = 'none';\n" + "       pageX = e.pageX;\n" + "       pageY = e.pageY;\n" + "   };\n";
        ss2.text = scr2;
        hh.appendChild(ss2);
      } catch (error) {}
      wnd.document.close();
      wnd.focus();
    } catch (error) {}
  };
  return NewTabWindowServiceV1;
}();
module.exports = {
  NewTabWindowServiceV1: NewTabWindowServiceV1
};

}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"../../../common/utils/common-v4":687}],886:[function(require,module,exports){
"use strict";

var getGoogleNlpDocumentEntitiesTmplt = function getGoogleNlpDocumentEntitiesTmplt(searchResult, isEntitiesLoaded) {
  var tmplt = {
    named_entities: [],
    language: null,
    isEntitiesLoaded: isEntitiesLoaded
  };
  if (searchResult) {
    tmplt = {
      named_entities: [].concat(searchResult.getMentionedPersons()).concat(searchResult.getMentionedOrgs()).concat(searchResult.getMentionedLocs()),
      language: searchResult.getLanguage(),
      isEntitiesLoaded: isEntitiesLoaded
    };
  }
  return tmplt;
};
var getGoogleNlpDocumentInfoTmplt = function getGoogleNlpDocumentInfoTmplt() {
  return {
    named_entities: [],
    sentiment: {
      score: 0
    }
  };
};
var getGoogleNlpDocumentSentimentTmplt = function getGoogleNlpDocumentSentimentTmplt(searchResult, isSentimentLoaded) {
  var tmplt = {
    sentiment: {
      score: 0
    },
    isSentimentLoaded: isSentimentLoaded
  };
  if (searchResult) {
    tmplt = {
      sentiment: {
        score: searchResult.getSentiment()
      },
      isSentimentLoaded: isSentimentLoaded
    };
  }
  return tmplt;
};
module.exports = {
  getGoogleNlpDocumentEntitiesTmplt: getGoogleNlpDocumentEntitiesTmplt,
  getGoogleNlpDocumentInfoTmplt: getGoogleNlpDocumentInfoTmplt,
  getGoogleNlpDocumentSentimentTmplt: getGoogleNlpDocumentSentimentTmplt
};

},{}],887:[function(require,module,exports){
"use strict";

var getMediaPyGptCheckIsPersonMatchTmplt = function getMediaPyGptCheckIsPersonMatchTmplt() {
  return {
    response: {
      is_match: true
    }
  };
};
var getMediaPyGptRiskAssesmentTmplt = function getMediaPyGptRiskAssesmentTmplt(searchResult) {
  var tmplt = {
    response: {
      score: 0,
      explanation: ""
    }
  };
  if (searchResult) {
    tmplt = {
      response: {
        score: searchResult.getGptRiskScore(),
        explanation: searchResult.getGptRiskExplanation()
      }
    };
  }
  return tmplt;
};
var getMediaPyGptDocumentAnalysisTmplt = function getMediaPyGptDocumentAnalysisTmplt(searchResult) {
  var tmplt = {
    response: {
      summary: "",
      sentiment: "",
      topic: "",
      keywords: [],
      publication_type: ""
    }
  };
  if (searchResult) {
    tmplt = {
      response: {
        summary: searchResult.getGptDocAnalysSummary(),
        sentiment: searchResult.getGptDocAnalysSentiment(),
        topic: searchResult.getGptDocAnalysTopic(),
        keywords: searchResult.getGptDocAnalysKeywords(),
        publication_type: searchResult.getGptDocAnalysPubType()
      }
    };
  }
  return tmplt;
};
var getMediaPyGptDocumentCompressionTmplt = function getMediaPyGptDocumentCompressionTmplt() {
  return {
    compressed_text: ""
  };
};
var getMediaPyGptPersonSummaryTmplt = function getMediaPyGptPersonSummaryTmplt(searchResult) {
  var tmplt = {
    response: {
      summary: "",
      details: {
        age: "",
        connections: [],
        country_of_residence: "",
        occupation: "",
        personal_characteristics: [],
        position: "",
        property_ownership: "",
        time_period: ""
      }
    }
  };
  if (searchResult) {
    var personSumDetails = searchResult.getGptPersSumDetails();
    tmplt = {
      response: {
        summary: searchResult.getGptPersSumSummary(),
        details: {
          age: personSumDetails.age,
          connections: personSumDetails.connections,
          country_of_residence: personSumDetails.countryOfResidence,
          occupation: personSumDetails.occupation,
          personal_characteristics: personSumDetails.personalCharacteristics,
          position: "",
          property_ownership: "",
          time_period: ""
        }
      }
    };
  }
  return tmplt;
};
var getMediaPyGptRelatedEntitiesTmplt = function getMediaPyGptRelatedEntitiesTmplt(searchResult) {
  var tmplt = {
    response: {
      persons: [],
      organizations: []
    }
  };
  if (searchResult) {
    tmplt = {
      response: {
        persons: searchResult.getGptRelatedPersons(),
        organizations: searchResult.getGptRelatedOrganizations()
      }
    };
  }
  return tmplt;
};
var getMediaPyGptPersonMatchingTmplt = function getMediaPyGptPersonMatchingTmplt(searchResult) {
  var tmplt = {
    response: {
      is_match: false
    }
  };
  if (searchResult) {
    tmplt = {
      response: {
        is_match: searchResult.getGptPersonIsMatch()
      }
    };
  }
  return tmplt;
};
var getMediaPyGptNegativeContextAnalysisTmplt = function getMediaPyGptNegativeContextAnalysisTmplt(searchResult) {
  var tmplt = {
    response: {
      allegations: [],
      evidence: []
    }
  };
  if (searchResult) {
    tmplt = {
      response: {
        allegations: searchResult.getGptAllegations(),
        evidence: searchResult.getGptEvidence()
      }
    };
  }
  return tmplt;
};
var getMediaPyGptChainRiskAssesmentTmplt = function getMediaPyGptChainRiskAssesmentTmplt(searchResult) {
  var tmplt = {
    response: {
      allegations: [],
      evidence: [],
      score: 0,
      explanation: ""
    }
  };
  if (searchResult) {
    tmplt = {
      response: {
        allegations: searchResult.getGptAllegations(),
        evidence: searchResult.getGptEvidence(),
        score: searchResult.getGptRiskScore(),
        explanation: searchResult.getGptRiskExplanation()
      }
    };
  }
  return tmplt;
};
var getMediaPyGptGeneralRiskAssesmentTmplt = function getMediaPyGptGeneralRiskAssesmentTmplt(person) {
  var tmplt = {
    response: {
      score: 0,
      explanation: ""
    }
  };
  if (person) {
    tmplt = {
      response: {
        score: person.getGptRiskScore(),
        explanation: person.getGptRiskExplanation()
      }
    };
  }
  return tmplt;
};
var getMediaPyGptMostImportantEntitiesTmplt = function getMediaPyGptMostImportantEntitiesTmplt(person) {
  var tmplt = {
    response: {
      most_important_persons: [],
      most_important_organizations: []
    }
  };
  if (person) {
    tmplt = {
      response: {
        most_important_persons: person.getGptMostImportantPersons(),
        most_important_organizations: person.getGptMostImportantOrganizations()
      }
    };
  }
  return tmplt;
};
var getMediaPyGptOverallPersonSummaryTmplt = function getMediaPyGptOverallPersonSummaryTmplt(person) {
  var tmplt = {
    response: {
      overall_summary: "",
      occupation: "",
      age: "",
      location: ""
    }
  };
  if (person) {
    tmplt = {
      response: {
        overall_summary: person.getGptOverallSummary(),
        occupation: person.getGptOverallOccupation(),
        age: person.getGptOverallAge(),
        location: person.getGptOverallLocation()
      }
    };
  }
  return tmplt;
};
var getMediaPyGptGeneralNegativeContextAnalysisTmplt = function getMediaPyGptGeneralNegativeContextAnalysisTmplt(person) {
  var tmplt = {
    response: {
      allegations: [],
      evidence: [],
      potential_risks: [],
      mitigation_factors: [],
      conclusion: ""
    }
  };
  if (person) {
    tmplt = {
      response: {
        allegations: person.getGptAllegations(),
        evidence: person.getGptEvidence(),
        potential_risks: person.getGptPotentialRisks(),
        mitigation_factors: person.getGptMitigationFactors(),
        conclusion: person.getGptConclusion()
      }
    };
  }
  return tmplt;
};
var getMediaPyGptChainGeneralRiskAssessmentTmplt = function getMediaPyGptChainGeneralRiskAssessmentTmplt(person) {
  var tmplt = {
    response: {
      allegations: [],
      evidence: [],
      potential_risks: [],
      mitigation_factors: [],
      conclusion: "",
      score: 0,
      explanation: ""
    }
  };
  if (person) {
    tmplt = {
      response: {
        allegations: person.getGptAllegations(),
        evidence: person.getGptEvidence(),
        potential_risks: person.getGptPotentialRisks(),
        mitigation_factors: person.getGptMitigationFactors(),
        conclusion: person.getGptConclusion(),
        score: person.getGptRiskScore(),
        explanation: person.getGptRiskExplanation()
      }
    };
  }
  return tmplt;
};
var getMediaPyGptMostImportantKeywordsTmplt = function getMediaPyGptMostImportantKeywordsTmplt(person) {
  var tmplt = {
    response: {
      keywords: []
    }
  };
  if (person) {
    tmplt = {
      response: {
        keywords: person.getGptMostImportantKeywords()
      }
    };
  }
  return tmplt;
};
var getMediaPyGptConnectionsGraphTmplt = function getMediaPyGptConnectionsGraphTmplt() {
  return {
    response: {
      graph: {
        vertices: [],
        edges: []
      }
    }
  };
};
module.exports = {
  getMediaPyGptCheckIsPersonMatchTmplt: getMediaPyGptCheckIsPersonMatchTmplt,
  getMediaPyGptRiskAssesmentTmplt: getMediaPyGptRiskAssesmentTmplt,
  getMediaPyGptDocumentAnalysisTmplt: getMediaPyGptDocumentAnalysisTmplt,
  getMediaPyGptDocumentCompressionTmplt: getMediaPyGptDocumentCompressionTmplt,
  getMediaPyGptPersonSummaryTmplt: getMediaPyGptPersonSummaryTmplt,
  getMediaPyGptRelatedEntitiesTmplt: getMediaPyGptRelatedEntitiesTmplt,
  getMediaPyGptPersonMatchingTmplt: getMediaPyGptPersonMatchingTmplt,
  getMediaPyGptNegativeContextAnalysisTmplt: getMediaPyGptNegativeContextAnalysisTmplt,
  getMediaPyGptChainRiskAssesmentTmplt: getMediaPyGptChainRiskAssesmentTmplt,
  getMediaPyGptGeneralRiskAssesmentTmplt: getMediaPyGptGeneralRiskAssesmentTmplt,
  getMediaPyGptMostImportantEntitiesTmplt: getMediaPyGptMostImportantEntitiesTmplt,
  getMediaPyGptOverallPersonSummaryTmplt: getMediaPyGptOverallPersonSummaryTmplt,
  getMediaPyGptGeneralNegativeContextAnalysisTmplt: getMediaPyGptGeneralNegativeContextAnalysisTmplt,
  getMediaPyGptChainGeneralRiskAssessmentTmplt: getMediaPyGptChainGeneralRiskAssessmentTmplt,
  getMediaPyGptMostImportantKeywordsTmplt: getMediaPyGptMostImportantKeywordsTmplt,
  getMediaPyGptConnectionsGraphTmplt: getMediaPyGptConnectionsGraphTmplt
};

},{}],888:[function(require,module,exports){
"use strict";

var getMediaPyLLMTextAnalysisTmplt = function getMediaPyLLMTextAnalysisTmplt(searchResult) {
  var tmplt = {
    summary: "",
    short_summary: "",
    person_summary: "",
    people: [],
    organizations: [],
    keywords: [],
    sentiment: "",
    risk_level: 0,
    risk_explanation: ""
  };
  if (searchResult) {
    tmplt = {
      summary: searchResult.getLLMSummary(),
      short_summary: searchResult.getLLMShortSummary(),
      person_summary: searchResult.getLLMPersonSummary(),
      people: searchResult.getLLMMentionedPersons(),
      organizations: searchResult.getLLMMentionedOrgs(),
      keywords: searchResult.getLLMKeywords(),
      sentiment: searchResult.getLLMSentiment(),
      risk_level: searchResult.getLLMRiskLevel(),
      risk_explanation: searchResult.getLLMRiskExplanation()
    };
  }
  return tmplt;
};
var getMediaPyLLMPersonProfilingTmplt = function getMediaPyLLMPersonProfilingTmplt(person) {
  var tmplt = {
    occupation: "",
    age: "",
    location: "",
    other_details: ""
  };
  if (person) {
    tmplt = {
      occupation: person.getLLMOccupation(),
      age: person.getLLMAge(),
      location: person.getLLMLocation(),
      other_details: person.getLLMOtherDetails()
    };
  }
  return tmplt;
};
var getMediaPyLLMAllegationsProfilingTmplt = function getMediaPyLLMAllegationsProfilingTmplt(person) {
  var tmplt = {
    summary: "",
    evidence: "",
    risks: "",
    conclusion: ""
  };
  if (person) {
    tmplt = {
      summary: person.getLLMSummary(),
      evidence: person.getLLMEvidence(),
      risks: person.getLLMRisks(),
      conclusion: person.getLLMConclusion()
    };
  }
  return tmplt;
};
module.exports = {
  getMediaPyLLMTextAnalysisTmplt: getMediaPyLLMTextAnalysisTmplt,
  getMediaPyLLMPersonProfilingTmplt: getMediaPyLLMPersonProfilingTmplt,
  getMediaPyLLMAllegationsProfilingTmplt: getMediaPyLLMAllegationsProfilingTmplt
};

},{}],889:[function(require,module,exports){
"use strict";

var getMediaPyCleanHtmlTmplt = function getMediaPyCleanHtmlTmplt(searchResult) {
  var tmplt = {
    html: "",
    text: "",
    title: "",
    publish_date: "",
    authors: [],
    language: null
  };
  if (searchResult) {
    tmplt = {
      html: searchResult.getContentHtml(),
      text: searchResult.getContentElementText(),
      title: searchResult.getTitle(),
      publish_date: searchResult.getDate(),
      authors: [],
      language: searchResult.getLanguage()
    };
  }
  return tmplt;
};
var getMediaPyNamedEntitiesTmpl = function getMediaPyNamedEntitiesTmpl(searchResult, isEntitiesLoaded) {
  var tmplt = {
    named_entities: [],
    isEntitiesLoaded: isEntitiesLoaded
  };
  if (searchResult) {
    tmplt = {
      named_entities: [].concat(searchResult.getMentionedPersons()).concat(searchResult.getMentionedOrgs()).concat(searchResult.getMentionedLocs()),
      isEntitiesLoaded: isEntitiesLoaded
    };
  }
  return tmplt;
};
var getMediaPyCombinedSearchTmplt = function getMediaPyCombinedSearchTmplt(searchResult) {
  var tmplt = {
    ngrams: [],
    risk_keywords: [],
    keywords: [],
    risk_entities: [],
    named_entities: [],
    language: null
  };
  if (searchResult) {
    tmplt = {
      ngrams: searchResult.getAnalyzeNgrams(),
      risk_keywords: searchResult.getAnalyzeRiskKeywords(),
      keywords: searchResult.getAnalyzeKeywords(),
      risk_entities: [].concat(searchResult.getAnalyzeRiskPersons()).concat(searchResult.getAnalyzeRiskOrgs()),
      named_entities: [].concat(searchResult.getMentionedPersons()).concat(searchResult.getMentionedOrgs()).concat(searchResult.getMentionedLocs()).concat(searchResult.getAnalyzeRiskPersons()).concat(searchResult.getAnalyzeRiskOrgs()),
      language: searchResult.getLanguage()
    };
  }
  return tmplt;
};
var getMediaPyMarkupHtmlTmplt = function getMediaPyMarkupHtmlTmplt(searchResult, isMarkup) {
  var tmplt = {
    html: undefined
  };
  if (searchResult) {
    tmplt = {
      html: isMarkup ? searchResult.getContentMarkupHtml() : searchResult.getContentHtml()
    };
  }
  return tmplt;
};
var getMediaPyCombinedNlpTmplt = function getMediaPyCombinedNlpTmplt() {
  return {
    risk: 0,
    risk_keywords: [],
    language: null,
    sentiment: 0,
    word_cloud: "",
    keywords: [],
    name_in_text: []
  };
};
var getMediaPySummarizeTextTmplt = function getMediaPySummarizeTextTmplt(searchResult) {
  var tmplt = {
    summary: "",
    marked_summary: ""
  };
  if (searchResult) {
    tmplt = {
      summary: searchResult.getExtendedSummary(),
      marked_summary: searchResult.getExtendedSummaryHtml()
    };
  }
  return tmplt;
};
var getMediaPySpecialParsingTmplt = function getMediaPySpecialParsingTmplt(searchResult, isRelevance, isMarkup) {
  var tmplt = {
    html: "",
    summary: "",
    keywords: [],
    named_entities: [],
    relevance: isRelevance,
    risk: 0
  };
  if (searchResult) {
    tmplt = {
      html: isMarkup ? searchResult.getContentMarkupHtml() : searchResult.getContentHtml(),
      summary: isMarkup ? searchResult.getExtendedSummary() : searchResult.getDescription(),
      keywords: searchResult.getAnalyzeKeywords(),
      named_entities: [].concat(searchResult.getMentionedPersons()).concat(searchResult.getMentionedOrgs()).concat(searchResult.getMentionedLocs()).concat(searchResult.getAnalyzeRiskPersons()).concat(searchResult.getAnalyzeRiskOrgs()),
      relevance: isRelevance,
      risk: searchResult.getMediaPyRiskScore()
    };
  }
  return tmplt;
};
var getMediaPySpecialParsingJsonTmplt = function getMediaPySpecialParsingJsonTmplt(searchResult) {
  var tmplt = {
    entity: {
      name: []
    }
  };
  if (searchResult) {
    tmplt = {
      entity: {
        name: [searchResult.getPersonFullName()]
      }
    };
  }
  return tmplt;
};
var getMediaPySummarizeProfileTmplt = function getMediaPySummarizeProfileTmplt(person) {
  var tmplt = {
    summary: []
  };
  if (person) {
    tmplt = {
      summary: person.getExtendedSummary()
    };
  }
  return tmplt;
};
var getMediaPyConnectionsGraphTmplt = function getMediaPyConnectionsGraphTmplt() {
  return {
    graph: {
      edges: [],
      vertices: []
    }
  };
};
module.exports = {
  getMediaPyCleanHtmlTmplt: getMediaPyCleanHtmlTmplt,
  getMediaPyNamedEntitiesTmpl: getMediaPyNamedEntitiesTmpl,
  getMediaPyCombinedSearchTmplt: getMediaPyCombinedSearchTmplt,
  getMediaPyMarkupHtmlTmplt: getMediaPyMarkupHtmlTmplt,
  getMediaPyCombinedNlpTmplt: getMediaPyCombinedNlpTmplt,
  getMediaPySummarizeTextTmplt: getMediaPySummarizeTextTmplt,
  getMediaPySpecialParsingTmplt: getMediaPySpecialParsingTmplt,
  getMediaPySummarizeProfileTmplt: getMediaPySummarizeProfileTmplt,
  getMediaPyConnectionsGraphTmplt: getMediaPyConnectionsGraphTmplt,
  getMediaPySpecialParsingJsonTmplt: getMediaPySpecialParsingJsonTmplt
};

},{}],890:[function(require,module,exports){
"use strict";

var getScrapeTmplt = function getScrapeTmplt(searchResult) {
  var tmplt = {
    data: undefined,
    linkUrl: ""
  };
  if (searchResult) {
    tmplt = {
      data: searchResult.getContentHtml(),
      linkUrl: searchResult.getLinkUrl()
    };
  }
  return tmplt;
};
module.exports = {
  getScrapeTmplt: getScrapeTmplt
};

},{}],891:[function(require,module,exports){
"use strict";

var findTotalResultsRiskScoreAdditive = function findTotalResultsRiskScoreAdditive(riskScoreAdditives, totalResultsCount) {
  var riskScoreAdditive = 0;
  var configs = riskScoreAdditives.filter(function (config) {
    return config.results_count <= totalResultsCount;
  });
  if (configs && configs.length) {
    var maxConfig = configs.reduce(function (prev, current) {
      return prev.results_count > current.results_count ? prev : current;
    });
    riskScoreAdditive = maxConfig.additive;
  }
  return riskScoreAdditive;
};
var getPublicationYearRiskScoreAdditive = function getPublicationYearRiskScoreAdditive(pubDate) {
  var riskScoreAdditive = 0;
  try {
    if (pubDate) {
      var pubYear = pubDate.getFullYear();
      var nowYear = new Date().getFullYear();
      if (nowYear - pubYear < 2) {
        if (nowYear - pubYear === 0) {
          riskScoreAdditive = 2 * 0.005;
        } else {
          riskScoreAdditive = 0.005;
        }
      } else {
        riskScoreAdditive = -(nowYear - pubYear - 1) * 0.005;
      }
    }
  } catch (error) {}
  return riskScoreAdditive;
};
var getPublicationDate = function getPublicationDate(descriptionHtml) {
  var pubDate = null;
  try {
    var description = "" + descriptionHtml;
    var splittedByEllipsis = (description || "").split("...");
    if (splittedByEllipsis.length) {
      var testPubDateSubstr = splittedByEllipsis[0];
      var yearMatch = testPubDateSubstr.match(/\b(19|20)\d{2}\b/);
      if (yearMatch && yearMatch.length && parseInt(yearMatch[0], 10)) {
        var yearIdx = description.indexOf(yearMatch[0]);
        var delimiterIdx = description.indexOf("<b>...</b>");
        if (delimiterIdx !== -1 && yearIdx < delimiterIdx) {
          var pubYear = parseInt(yearMatch[0], 10);
          var pubMonth = null;
          var pubDay = null;
          var dayMonthSubstr = testPubDateSubstr.split(",")[0];
          if (dayMonthSubstr) {
            switch (dayMonthSubstr.split(" ")[0]) {
              case "Jan":
                pubMonth = 0;
                break;
              case "Feb":
                pubMonth = 1;
                break;
              case "Mar":
                pubMonth = 2;
                break;
              case "Apr":
                pubMonth = 3;
                break;
              case "May":
                pubMonth = 4;
                break;
              case "Jun":
                pubMonth = 5;
                break;
              case "Jul":
                pubMonth = 6;
                break;
              case "Aug":
                pubMonth = 7;
                break;
              case "Sep":
                pubMonth = 8;
                break;
              case "Oct":
                pubMonth = 9;
                break;
              case "Nov":
                pubMonth = 10;
                break;
              case "Dec":
                pubMonth = 11;
                break;
              default:
                break;
            }
            pubDay = parseInt(dayMonthSubstr.split(" ")[1], 10);
          }
          if (pubMonth !== null && pubDay !== null) {
            pubDate = new Date(pubYear, pubMonth, pubDay);
          } else {
            pubDate = new Date(pubYear);
          }
        }
      } else {
        var agoIdx = splittedByEllipsis[0].indexOf("ago");
        if (agoIdx !== -1) {
          var timeSubstr = splittedByEllipsis[0].substring(0, agoIdx).trim();
          pubDate = new Date();
          if (timeSubstr.split(" ")[1] === "days" || timeSubstr.split(" ")[1] === "day") {
            var daysCount = parseInt(timeSubstr.split(" ")[0], 10);
            pubDate.setDate(pubDate.getDate() - daysCount);
          }
          if (timeSubstr.split(" ")[1] === "hours" || timeSubstr.split(" ")[1] === "hour") {
            var hoursCount = parseInt(timeSubstr.split(" ")[0], 10);
            pubDate.setHours(pubDate.getHours() - hoursCount);
          }
        }
      }
    }
  } catch (error) {}
  return pubDate;
};
var removeDatePart = function removeDatePart(descriptionHtml) {
  var clearedDescriptionHtml = "" + descriptionHtml;
  try {
    var splittedByDate = (clearedDescriptionHtml || "").split("<b>...</b>");
    if (splittedByDate.length > 1) {
      splittedByDate.shift();
      clearedDescriptionHtml = splittedByDate.join("").trim();
    }
  } catch (error) {}
  return clearedDescriptionHtml;
};
module.exports = {
  findTotalResultsRiskScoreAdditive: findTotalResultsRiskScoreAdditive,
  getPublicationYearRiskScoreAdditive: getPublicationYearRiskScoreAdditive,
  getPublicationDate: getPublicationDate,
  removeDatePart: removeDatePart
};

},{}],892:[function(require,module,exports){
arguments[4][697][0].apply(exports,arguments)
},{"dup":697}],893:[function(require,module,exports){
"use strict";

var _require = require("../../common/utils/common-v4"),
  sortByProp = _require.sortByProp;
var _require2 = require("../../common/utils/filters-v4"),
  onlyUnique = _require2.onlyUnique,
  onlyUniqueByName = _require2.onlyUniqueByName;
var _require3 = require("../../common/utils/comparisons-v4"),
  compareByMediaPyRiskScore = _require3.compareByMediaPyRiskScore,
  compareByPositionIdx = _require3.compareByPositionIdx,
  compareByValue = _require3.compareByValue,
  compareByDate = _require3.compareByDate,
  compareByTitle = _require3.compareByTitle,
  compareByName = _require3.compareByName,
  compareByNgram = _require3.compareByNgram,
  compareByFullWord = _require3.compareByFullWord,
  compareByMediaPyGptRiskScore = _require3.compareByMediaPyGptRiskScore;
var _require4 = require("../../common/models/person-v4"),
  PersonV4 = _require4.PersonV4;
var _require5 = require("../constants/source-types"),
  GOOGLE_SEARCH_SOURCE_CODE = _require5.GOOGLE_SEARCH_SOURCE_CODE,
  GOOGLE_NEWS_SOURCE_CODE = _require5.GOOGLE_NEWS_SOURCE_CODE,
  EXTRA_SOURCE_SOURCE_CODE = _require5.EXTRA_SOURCE_SOURCE_CODE,
  STOCK_MARKETS_SOURCE_CODE = _require5.STOCK_MARKETS_SOURCE_CODE,
  ALEPH_OCCRP_SOURCE_CODE = _require5.ALEPH_OCCRP_SOURCE_CODE,
  OPEN_SANCTIONS_SOURCE_CODE = _require5.OPEN_SANCTIONS_SOURCE_CODE,
  OPEN_CORPORATES_SOURCE_CODE = _require5.OPEN_CORPORATES_SOURCE_CODE;
function MediaSearchPersonV5(id, fullName, firstName, lastName, isAlias, isLinked, parentId, isCompany, itemId) {
  PersonV4.call(this, id, fullName, firstName, lastName, isAlias, isLinked, parentId);
  this.isCompany = isCompany;
  this.itemId = itemId;
  this.countriesKeywords = [];
  this.allSearchEngineResults = [];
  this.filteredSearchEngineResults = [];
  this.prependedSortedResults = [];
  this.allGoogleNewsResults = [];
  this.filteredGoogleNewsResults = [];
  this.allExtraSourcesResults = [];
  this.filteredExtraSourcesResults = [];
  this.allStockMarketResults = [];
  this.filteredStockMarketResults = [];
  this.allAlephOccrpResults = [];
  this.filteredAlephOccrpResults = [];
  this.allOpenSanctionsResults = [];
  this.filteredOpenSanctionsResults = [];
  this.allOpenCorporatesResults = [];
  this.filteredOpenCorporatesResults = [];
  this.relevantResults = [];
  this.matchPersonResults = [];
  this.totalResults = [];
  this.extendedSummary = [];
  this.extendedInfo = {
    openSanctionsInfo: {
      entity: {
        name: [fullName],
        type: isCompany ? "ORG" : "PER"
      }
    }
  };
  this.mostCommonNgrams = [];
  this.mostCommonKeywords = [];
  this.mostCommonRiskPersons = [];
  this.mostCommonRiskOrgs = [];
  this.allRiskPersons = [];
  this.allRiskOrgs = [];
  this.mostCommonMentionedPersons = [];
  this.mostCommonMentionedOrgs = [];
  this.mostCommonMentionedLocs = [];
  this.topMentionedPersonsCount = 5;
  this.topMentionedOrgsCount = 5;
  this.topMentionedLocsCount = 5;
  this.gptGeneralRiskAssScore = 0;
  this.gptGeneralRiskAssExplanation = "";
  this.topGptRelatedEntitiesPersonsCount = 5;
  this.topGptRelatedEntitiesOrgsCount = 5;
  this.topGptRelatedTopicsCount = 5;
  this.gptMostImportantEntitiesPersons = [];
  this.gptMostImportantEntitiesOrgs = [];
  this.gptOverallSumSummary = "";
  this.gptOverallSumOccupation = "";
  this.gptOverallSumAge = "";
  this.gptOverallSumLocation = "";
  this.gptAllegations = [];
  this.gptEvidence = [];
  this.gptPotentialRisks = [];
  this.gptMitigationFactors = [];
  this.gptConclusion = "";
  this.gptMostImportantKeywords = [];
  this.gptRelatedTopics = [];
  this.performanceMetrics = {
    googleSearch: {
      getResults: [],
      processResults: []
    },
    googleNews: {
      getResults: [],
      processResults: []
    },
    extraSources: {
      getResults: [],
      processResults: []
    },
    stockMarkets: {
      getResults: [],
      processResults: []
    },
    alephOccrp: {
      getResults: [],
      processResults: []
    },
    openSanctions: {
      getResults: [],
      processResults: []
    },
    openCorporates: {
      getResults: [],
      processResults: []
    }
  };
  this.requestsStatistic = {
    mainPerson: {
      id: id,
      fullName: fullName,
      googleSearchRequests: {}
    },
    linkedPersons: [],
    aliasPersons: [],
    total: {}
  };
  this.isGoogleSearchApiDayLimitExceed = false;
  this.isAlertShouldBeCreated = true;
}
MediaSearchPersonV5.prototype = Object.create(PersonV4.prototype);
MediaSearchPersonV5.prototype.constructor = MediaSearchPersonV5;
MediaSearchPersonV5.prototype.getRequestsStatistic = function () {
  return this.requestsStatistic;
};
MediaSearchPersonV5.prototype.addMainPersonGoogleSearchRequest = function (url, statusCode, sortBy) {
  var person = this;
  if (person && person.requestsStatistic && person.requestsStatistic.mainPerson && person.requestsStatistic.mainPerson.googleSearchRequests) {
    if (!person.requestsStatistic.mainPerson.googleSearchRequests[statusCode]) {
      person.requestsStatistic.mainPerson.googleSearchRequests[statusCode] = [];
    }
    var statusCodeRequests = person.requestsStatistic.mainPerson.googleSearchRequests[statusCode];
    var requestStat = statusCodeRequests.find(function (req) {
      return req.url === url;
    });
    if (requestStat) {
      if (!requestStat[sortBy]) {
        requestStat[sortBy] = 1;
      } else {
        requestStat[sortBy] += 1;
      }
    } else {
      requestStat = {};
      requestStat["url"] = url;
      requestStat[sortBy] = 1;
      statusCodeRequests.push(requestStat);
    }
  }
  if (person && person.requestsStatistic && person.requestsStatistic.total) {
    if (!person.requestsStatistic.total[statusCode]) {
      person.requestsStatistic.total[statusCode] = 0;
    }
    person.requestsStatistic.total[statusCode] += 1;
  }
};
MediaSearchPersonV5.prototype.addLinkedPersonGoogleSearchRequest = function (linkedPerson, url, statusCode, sortBy) {
  var person = this;
  if (person && person.requestsStatistic && person.requestsStatistic.linkedPersons) {
    var linkedPersonStat = person.requestsStatistic.linkedPersons.find(function (lp) {
      return lp.id === linkedPerson.getId();
    });
    if (!linkedPersonStat) {
      linkedPersonStat = {
        id: linkedPerson.getId(),
        fullName: linkedPerson.getFullName(),
        googleSearchRequests: {}
      };
      person.requestsStatistic.linkedPersons.push(linkedPersonStat);
    }
    if (!linkedPersonStat.googleSearchRequests[statusCode]) {
      linkedPersonStat.googleSearchRequests[statusCode] = [];
    }
    var statusCodeRequests = linkedPersonStat.googleSearchRequests[statusCode];
    var requestStat = statusCodeRequests.find(function (req) {
      return req.url === url;
    });
    if (requestStat) {
      if (!requestStat[sortBy]) {
        requestStat[sortBy] = 1;
      } else {
        requestStat[sortBy] += 1;
      }
    } else {
      requestStat = {};
      requestStat["url"] = url;
      requestStat[sortBy] = 1;
      statusCodeRequests.push(requestStat);
    }
  }
  if (person && person.requestsStatistic && person.requestsStatistic.total) {
    if (!person.requestsStatistic.total[statusCode]) {
      person.requestsStatistic.total[statusCode] = 0;
    }
    person.requestsStatistic.total[statusCode] += 1;
  }
};
MediaSearchPersonV5.prototype.addAliasPersonGoogleSearchRequest = function (aliasPerson, url, statusCode, sortBy) {
  var person = this;
  if (person && person.requestsStatistic && person.requestsStatistic.aliasPersons) {
    var aliasPersonStat = person.requestsStatistic.aliasPersons.find(function (lp) {
      return lp.id === aliasPerson.getId();
    });
    if (!aliasPersonStat) {
      aliasPersonStat = {
        id: aliasPerson.getId(),
        fullName: aliasPerson.getFullName(),
        googleSearchRequests: {}
      };
      person.requestsStatistic.aliasPersons.push(aliasPersonStat);
    }
    if (!aliasPersonStat.googleSearchRequests[statusCode]) {
      aliasPersonStat.googleSearchRequests[statusCode] = [];
    }
    var statusCodeRequests = aliasPersonStat.googleSearchRequests[statusCode];
    var requestStat = statusCodeRequests.find(function (req) {
      return req.url === url;
    });
    if (requestStat) {
      if (!requestStat[sortBy]) {
        requestStat[sortBy] = 1;
      } else {
        requestStat[sortBy] += 1;
      }
    } else {
      requestStat = {};
      requestStat["url"] = url;
      requestStat[sortBy] = 1;
      statusCodeRequests.push(requestStat);
    }
  }
  if (person && person.requestsStatistic && person.requestsStatistic.total) {
    if (!person.requestsStatistic.total[statusCode]) {
      person.requestsStatistic.total[statusCode] = 0;
    }
    person.requestsStatistic.total[statusCode] += 1;
  }
};
MediaSearchPersonV5.prototype.getTotalGoogleSearchRequestsCount = function () {
  return this.requestsStatistic.total["200"];
};
MediaSearchPersonV5.prototype.addPerformanceMetric = function (sourceType, metricType, elapsedTime) {
  this.performanceMetrics[sourceType][metricType].push(elapsedTime);
};
MediaSearchPersonV5.prototype.getPerformanceMetrics = function () {
  return this.performanceMetrics;
};
MediaSearchPersonV5.prototype.setKeywords = function (keywords) {
  this.keywords = keywords;
};
MediaSearchPersonV5.prototype.setCountriesKeywords = function (countriesKeywords) {
  this.countriesKeywords = countriesKeywords;
};
MediaSearchPersonV5.prototype.getCountriesKeywords = function () {
  return this.countriesKeywords;
};
MediaSearchPersonV5.prototype.getItemId = function () {
  return this.itemId;
};
MediaSearchPersonV5.prototype.checkIsCompany = function () {
  return this.isCompany === true;
};
MediaSearchPersonV5.prototype.setGoogleSearchApiDayLimitExceed = function (flag) {
  this.isGoogleSearchApiDayLimitExceed = flag;
};
MediaSearchPersonV5.prototype.checkGoogleSearchApiDayLimitExceed = function () {
  return this.isGoogleSearchApiDayLimitExceed;
};
MediaSearchPersonV5.prototype.setExtendedSummary = function (extendedSummary) {
  var extendedSummaryArray = [];
  if (Array.isArray(extendedSummary)) {
    extendedSummaryArray = extendedSummary.filter(onlyUnique);
  } else if (typeof extendedSummary === "string" || extendedSummary instanceof String) {
    extendedSummaryArray = [extendedSummary];
  } else {
    extendedSummaryArray = [];
  }
  this.extendedSummary = extendedSummaryArray;
};
MediaSearchPersonV5.prototype.getExtendedSummary = function () {
  return this.extendedSummary;
};
MediaSearchPersonV5.prototype.setExtendedInfo = function (openSanctionsInfo) {
  if (openSanctionsInfo && openSanctionsInfo.entity && openSanctionsInfo.entity.name) {
    this.extendedInfo.openSanctionsInfo = openSanctionsInfo;
  }
};
MediaSearchPersonV5.prototype.getExtendedInfo = function () {
  return this.extendedInfo.openSanctionsInfo;
};
MediaSearchPersonV5.prototype.setMostCommonNgrams = function (mostCommonNgrams) {
  this.mostCommonNgrams = [].concat(mostCommonNgrams);
};
MediaSearchPersonV5.prototype.getMostCommonNgrams = function () {
  return this.mostCommonNgrams;
};
MediaSearchPersonV5.prototype.setMostCommonKeywords = function (mostCommonKeywords) {
  this.mostCommonKeywords = [].concat(mostCommonKeywords);
};
MediaSearchPersonV5.prototype.getMostCommonKeywords = function () {
  return this.mostCommonKeywords;
};
MediaSearchPersonV5.prototype.setMostCommonRiskPersons = function (mostCommonRiskPersons) {
  this.mostCommonRiskPersons = [].concat(mostCommonRiskPersons);
};
MediaSearchPersonV5.prototype.getMostCommonRiskPersons = function () {
  return this.mostCommonRiskPersons;
};
MediaSearchPersonV5.prototype.setMostCommonRiskOrgs = function (mostCommonRiskOrganizations) {
  this.mostCommonRiskOrgs = [].concat(mostCommonRiskOrganizations);
};
MediaSearchPersonV5.prototype.getMostCommonRiskOrgs = function () {
  return this.mostCommonRiskOrgs;
};
MediaSearchPersonV5.prototype.setAllRiskPersons = function (allRiskPersons) {
  this.allRiskPersons = [].concat(allRiskPersons);
};
MediaSearchPersonV5.prototype.getAllRiskPersons = function () {
  return this.allRiskPersons;
};
MediaSearchPersonV5.prototype.setAllRiskOrgs = function (allRiskOrgs) {
  this.allRiskOrgs = [].concat(allRiskOrgs);
};
MediaSearchPersonV5.prototype.getAllRiskOrgs = function () {
  return this.allRiskOrgs;
};
MediaSearchPersonV5.prototype.setMostCommonMentionedPersons = function (mostCommonMentionedPersons) {
  this.mostCommonMentionedPersons = [].concat(mostCommonMentionedPersons);
};
MediaSearchPersonV5.prototype.getMostCommonMentionedPersons = function () {
  return this.mostCommonMentionedPersons;
};
MediaSearchPersonV5.prototype.setMostCommonMentionedOrgs = function (mostCommonMentionedOrgs) {
  this.mostCommonMentionedOrgs = [].concat(mostCommonMentionedOrgs);
};
MediaSearchPersonV5.prototype.getMostCommonMentionedOrgs = function () {
  return this.mostCommonMentionedOrgs;
};
MediaSearchPersonV5.prototype.setMostCommonMentionedLocs = function (mostCommonMentionedLocs) {
  this.mostCommonMentionedLocs = [].concat(mostCommonMentionedLocs);
};
MediaSearchPersonV5.prototype.getMostCommonMentionedLocs = function () {
  return this.mostCommonMentionedLocs;
};
MediaSearchPersonV5.prototype.setTopMentionedPersonsCount = function (topCount) {
  this.topMentionedPersonsCount = topCount;
};
MediaSearchPersonV5.prototype.setTopMentionedOrgsCount = function (topCount) {
  this.topMentionedOrgsCount = topCount;
};
MediaSearchPersonV5.prototype.setTopMentionedLocsCount = function (topCount) {
  this.topMentionedLocsCount = topCount;
};
MediaSearchPersonV5.prototype.setSummaryInfo = function () {
  var person = this;
  var personTotalResults = person.getTotalResults().filter(function (searchResult) {
    return searchResult.checkIsFromSearchEngine() || searchResult.checkIsFromGoogleNewsRss() || searchResult.checkIsFromStockMarket() || searchResult.checkIsFromAlephOccrp() || searchResult.checkIsFromOpenSanctions() || searchResult.checkIsFromOpenCorporates();
  });
  var extraSourcesResults = person.getTotalResults().filter(function (searchResult) {
    return searchResult.checkIsFromExtraSource();
  });
  var mostCommonNgrams = {};
  var mostCommonKeywords = {};
  var mostCommonRiskPersons = {};
  var mostCommonRiskOrganizations = {};
  var riskPersonsKeyValueObj = {};
  var riskOrgsKeyValueObj = {};
  var mostCommonMentionedPersons = {};
  var mostCommonMentionedOrgs = {};
  var mostCommonMentionedLocs = {};
  personTotalResults.forEach(function (searchResult) {
    var mediaPyRiskScoreAbs = Math.abs(searchResult.getMediaPyRiskScore());
    var ngrams = searchResult.getAnalyzeNgrams();
    try {
      ngrams.forEach(function (ngramObj) {
        var key = ngramObj.ngram;
        if (!mostCommonNgrams[key]) {
          mostCommonNgrams[key] = ngramObj.count * mediaPyRiskScoreAbs;
        } else {
          mostCommonNgrams[key] += ngramObj.count * mediaPyRiskScoreAbs;
        }
      });
    } catch (error) {}
    var keywords = searchResult.getAnalyzeKeywords();
    try {
      keywords.forEach(function (key) {
        if (!mostCommonKeywords[key]) {
          mostCommonKeywords[key] = 1;
        } else {
          ++mostCommonKeywords[key];
        }
      });
    } catch (error) {}
    var riskPersons = searchResult.getAnalyzeRiskPersons();
    try {
      riskPersons.forEach(function (personObj) {
        var key = personObj.name;
        if (!mostCommonRiskPersons[key]) {
          mostCommonRiskPersons[key] = 1;
        } else {
          ++mostCommonRiskPersons[key];
        }
        if (!riskPersonsKeyValueObj[key]) {
          riskPersonsKeyValueObj[key] = personObj;
        }
      });
    } catch (error) {}
    var riskOrgs = searchResult.getAnalyzeRiskOrgs();
    try {
      riskOrgs.forEach(function (orgObj) {
        var key = orgObj.name;
        if (!mostCommonRiskOrganizations[key]) {
          mostCommonRiskOrganizations[key] = 1;
        } else {
          ++mostCommonRiskOrganizations[key];
        }
        if (!riskOrgsKeyValueObj[key]) {
          riskOrgsKeyValueObj[key] = orgObj;
        }
      });
    } catch (error) {}
    var mentionedPersons = searchResult.getMentionedPersons();
    try {
      mentionedPersons.forEach(function (mentPers) {
        var key = mentPers.name;
        if (!mostCommonMentionedPersons[key]) {
          mostCommonMentionedPersons[key] = 1;
        } else {
          ++mostCommonMentionedPersons[key];
        }
      });
    } catch (error) {}
    var mentionedOrgs = searchResult.getMentionedOrgs();
    try {
      mentionedOrgs.forEach(function (mentOrg) {
        var key = mentOrg.name;
        if (!mostCommonMentionedOrgs[key]) {
          mostCommonMentionedOrgs[key] = 1;
        } else {
          ++mostCommonMentionedOrgs[key];
        }
      });
    } catch (error) {}
    var mentionedLocs = searchResult.getMentionedLocs();
    try {
      mentionedLocs.forEach(function (mentLoc) {
        var key = mentLoc.name;
        if (!mostCommonMentionedLocs[key]) {
          mostCommonMentionedLocs[key] = 1;
        } else {
          ++mostCommonMentionedLocs[key];
        }
      });
    } catch (error) {}
  });
  var sortedNgrams = sortByProp(mostCommonNgrams, true).slice(0, 15).map(function (arr) {
    return arr[0];
  });
  var sortedKeywords = sortByProp(mostCommonKeywords, true).slice(0, 15).map(function (arr) {
    return arr[0];
  });
  var topPersonNames = sortByProp(mostCommonRiskPersons, true).slice(0, 15).map(function (arr) {
    return arr[0];
  });
  var topOrgNames = sortByProp(mostCommonRiskOrganizations, true).slice(0, 15).map(function (arr) {
    return arr[0];
  });
  var sortedRiskPersons = topPersonNames.map(function (personName) {
    return {
      name: riskPersonsKeyValueObj[personName].name,
      db_id: riskPersonsKeyValueObj[personName].db_id
    };
  });
  var totalExtraSourcesRiskPersons = [].concat.apply([], extraSourcesResults.map(function (searchResult) {
    return searchResult.getAnalyzeRiskPersons();
  }));
  var sortedRiskOrgs = topOrgNames.map(function (orgName) {
    return {
      name: riskOrgsKeyValueObj[orgName].name,
      db_id: riskOrgsKeyValueObj[orgName].db_id
    };
  });
  var totalExtraSourcesRiskOrgs = [].concat.apply([], extraSourcesResults.map(function (searchResult) {
    return searchResult.getAnalyzeRiskOrgs();
  }));
  person.setMostCommonNgrams(sortedNgrams);
  person.setMostCommonKeywords(sortedKeywords);
  person.setMostCommonRiskPersons(totalExtraSourcesRiskPersons.concat(sortedRiskPersons).filter(onlyUniqueByName));
  person.setMostCommonRiskOrgs(totalExtraSourcesRiskOrgs.concat(sortedRiskOrgs).filter(onlyUniqueByName));
  person.setAllRiskPersons(Object.values(riskPersonsKeyValueObj).concat(totalExtraSourcesRiskPersons));
  person.setAllRiskOrgs(Object.values(riskOrgsKeyValueObj).concat(totalExtraSourcesRiskOrgs));
  var topMentionedPersons = sortByProp(mostCommonMentionedPersons, true).slice(0, 15).map(function (arr) {
    return arr[0];
  });
  var topMentionedExtraSourcesPersons = [].concat.apply([], extraSourcesResults.map(function (searchResult) {
    return searchResult.getMentionedPersons().map(function (mentionedPerson) {
      return mentionedPerson.name;
    });
  }));
  var totalMentionedPersons = topMentionedExtraSourcesPersons.concat(topMentionedPersons).filter(onlyUnique);
  var topMentionedOrgs = sortByProp(mostCommonMentionedOrgs, true).slice(0, 15).map(function (arr) {
    return arr[0];
  });
  var topMentionedExtraSourcesOrgs = [].concat.apply([], extraSourcesResults.map(function (searchResult) {
    return searchResult.getMentionedOrgs().map(function (mentionedPerson) {
      return mentionedPerson.name;
    });
  }));
  var totalMentionedOrgs = topMentionedExtraSourcesOrgs.concat(topMentionedOrgs).filter(onlyUnique);
  var topMentionedLocs = sortByProp(mostCommonMentionedLocs, true).slice(0, 15).map(function (arr) {
    return arr[0];
  });
  var totalMentionedExtraSourcesLocs = [].concat.apply([], extraSourcesResults.map(function (searchResult) {
    return searchResult.getMentionedLocs().map(function (mentionedPerson) {
      return mentionedPerson.name;
    });
  }));
  var totalMentionedLocs = totalMentionedExtraSourcesLocs.concat(topMentionedLocs).filter(onlyUnique);
  person.setMostCommonMentionedPersons(totalMentionedPersons);
  person.setMostCommonMentionedOrgs(totalMentionedOrgs);
  person.setMostCommonMentionedLocs(totalMentionedLocs);
};
MediaSearchPersonV5.prototype.setGptRiskScore = function (riskScore) {
  this.gptGeneralRiskAssScore = riskScore;
};
MediaSearchPersonV5.prototype.getGptRiskScore = function () {
  return this.gptGeneralRiskAssScore;
};
MediaSearchPersonV5.prototype.setGptRiskExplanation = function (explanation) {
  this.gptGeneralRiskAssExplanation = explanation;
};
MediaSearchPersonV5.prototype.getGptRiskExplanation = function () {
  return this.gptGeneralRiskAssExplanation;
};
MediaSearchPersonV5.prototype.setGptMostImportantPersons = function (persons) {
  this.gptMostImportantEntitiesPersons = [].concat(persons || []).filter(onlyUnique).sort(compareByValue);
};
MediaSearchPersonV5.prototype.getGptMostImportantPersons = function () {
  return this.gptMostImportantEntitiesPersons;
};
MediaSearchPersonV5.prototype.setGptMostImportantOrganizations = function (organizations) {
  this.gptMostImportantEntitiesOrgs = [].concat(organizations || []).filter(onlyUnique).sort(compareByValue);
};
MediaSearchPersonV5.prototype.getGptMostImportantOrganizations = function () {
  return this.gptMostImportantEntitiesOrgs;
};
MediaSearchPersonV5.prototype.setGptRelatedItems = function (items, type) {
  if (type === "persons") {
    this.setGptMostImportantPersons(items);
  }
  if (type === "orgs") {
    this.setGptMostImportantOrganizations(items);
  }
};
MediaSearchPersonV5.prototype.setGptOverallSummary = function (summary) {
  this.gptOverallSumSummary = summary;
};
MediaSearchPersonV5.prototype.getGptOverallSummary = function () {
  return this.gptOverallSumSummary;
};
MediaSearchPersonV5.prototype.setGptOverallOccupation = function (occupation) {
  this.gptOverallSumOccupation = occupation;
};
MediaSearchPersonV5.prototype.getGptOverallOccupation = function () {
  return this.gptOverallSumOccupation;
};
MediaSearchPersonV5.prototype.setGptOverallAge = function (age) {
  this.gptOverallSumAge = age;
};
MediaSearchPersonV5.prototype.getGptOverallAge = function () {
  return this.gptOverallSumAge;
};
MediaSearchPersonV5.prototype.setGptOverallLocation = function (location) {
  this.gptOverallSumLocation = location;
};
MediaSearchPersonV5.prototype.getGptOverallLocation = function () {
  return this.gptOverallSumLocation;
};
MediaSearchPersonV5.prototype.setGptAllegations = function (allegations) {
  this.gptAllegations = [].concat(allegations || []);
};
MediaSearchPersonV5.prototype.getGptAllegations = function () {
  return this.gptAllegations;
};
MediaSearchPersonV5.prototype.setGptEvidence = function (evidence) {
  this.gptEvidence = [].concat(evidence || []);
};
MediaSearchPersonV5.prototype.getGptEvidence = function () {
  return this.gptEvidence;
};
MediaSearchPersonV5.prototype.setGptPotentialRisks = function (potentialRisks) {
  this.gptPotentialRisks = [].concat(potentialRisks || []);
};
MediaSearchPersonV5.prototype.getGptPotentialRisks = function () {
  return this.gptPotentialRisks;
};
MediaSearchPersonV5.prototype.setGptMitigationFactors = function (mitigationFactors) {
  this.gptMitigationFactors = [].concat(mitigationFactors || []);
};
MediaSearchPersonV5.prototype.getGptMitigationFactors = function () {
  return this.gptMitigationFactors;
};
MediaSearchPersonV5.prototype.setGptConclusion = function (conclusion) {
  this.gptConclusion = conclusion;
};
MediaSearchPersonV5.prototype.getGptConclusion = function () {
  return this.gptConclusion;
};
MediaSearchPersonV5.prototype.setGptRelatedTopics = function (count) {
  var topGptRiskResults = this.getTopGptRiskResults(count);
  topGptRiskResults.sort(compareByMediaPyGptRiskScore);
  this.gptRelatedTopics = topGptRiskResults.map(function (searchResult) {
    return searchResult.getGptDocAnalysTopic();
  }).filter(function (topic) {
    return topic;
  }).filter(onlyUnique);
};
MediaSearchPersonV5.prototype.getGptRelatedTopics = function () {
  return this.gptRelatedTopics;
};
MediaSearchPersonV5.prototype.setGptMostImportantkeywords = function (keywords) {
  this.gptMostImportantKeywords = [].concat(keywords || []).filter(onlyUnique).sort(compareByValue);
};
MediaSearchPersonV5.prototype.getGptMostImportantKeywords = function () {
  return this.gptMostImportantKeywords;
};
MediaSearchPersonV5.prototype.setTopGptRelatedEntitiesPersonsCount = function (topCount) {
  this.topGptRelatedEntitiesPersonsCount = topCount;
};
MediaSearchPersonV5.prototype.setTopGptRelatedEntitiesOrgsCount = function (topCount) {
  this.topGptRelatedEntitiesOrgsCount = topCount;
};
MediaSearchPersonV5.prototype.setTopGptRelatedTopicsCount = function (topCount) {
  this.topGptRelatedTopicsCount = topCount;
};
MediaSearchPersonV5.prototype.splitSearchResultsAndSort = function (searchResults) {
  var scores = {};
  searchResults.forEach(function (doc) {
    if (scores[doc.getMediaPyRiskScore()] === undefined) scores[doc.getMediaPyRiskScore()] = [];
    scores[doc.getMediaPyRiskScore()].push(doc);
  });
  var sortedScores = Object.keys(scores).map(function (key) {
    return parseFloat(key);
  });
  sortedScores.sort(compareByValue);
  var splittedByScore = sortedScores.map(function (key) {
    return scores[key.toString()];
  });
  for (var i = 0; i < splittedByScore.length; i++) {
    var scoresArr = splittedByScore[i];
    var resultsHasDates = scoresArr.filter(function (_doc) {
      return _doc.getDate();
    }).length === scoresArr.length;
    if (resultsHasDates) {
      scoresArr.sort(compareByDate);
      var dates = {};
      scoresArr.forEach(function (_doc) {
        var date = new Date(_doc.getDate()).toISOString().split("T")[0];
        if (dates[date] === undefined) dates[date] = [];
        dates[date].push(_doc);
      });
      var splittedByDates = Object.keys(dates).map(function (key) {
        return dates[key];
      });
      splittedByDates.forEach(function (datesArr) {
        datesArr.sort(compareByTitle);
      });
      scoresArr = [].concat.apply([], splittedByDates);
    } else {
      scoresArr.sort(compareByTitle);
    }
  }
  var merged = [].concat.apply([], splittedByScore);
  return merged;
};
MediaSearchPersonV5.prototype.getAllSearchEngineResults = function () {
  return this.allSearchEngineResults;
};
MediaSearchPersonV5.prototype.getAllSearchEngineResultsCount = function () {
  return this.allSearchEngineResults.length;
};
MediaSearchPersonV5.prototype.getAllGoogleNewsResults = function () {
  return this.allGoogleNewsResults;
};
MediaSearchPersonV5.prototype.getAllExtraSourcesResults = function () {
  return this.allExtraSourcesResults;
};
MediaSearchPersonV5.prototype.getAllStockMarketResults = function () {
  return this.allStockMarketResults;
};
MediaSearchPersonV5.prototype.getAllAlephOccrpResults = function () {
  return this.allAlephOccrpResults;
};
MediaSearchPersonV5.prototype.getAllOpenSanctionsResults = function () {
  return this.allOpenSanctionsResults;
};
MediaSearchPersonV5.prototype.getAllOpenCorporatesResults = function () {
  return this.allOpenCorporatesResults;
};
MediaSearchPersonV5.prototype.getTotalResults = function () {
  return this.totalResults;
};
MediaSearchPersonV5.prototype.getTotalResultsCount = function () {
  return this.totalResults.length;
};
MediaSearchPersonV5.prototype.getTotalResultsToPublish = function () {
  return this.totalResults.filter(function (searchResult) {
    return searchResult.checkShouldBePublished();
  });
};
MediaSearchPersonV5.prototype.addSearchEngineResult = function (newSearchResult) {
  var person = this;
  var alreadyExistedGoogleNewsResult = person.allGoogleNewsResults.find(function (searchResult) {
    return searchResult.getLinkUrl().toLowerCase() === newSearchResult.getLinkUrl().toLowerCase() && searchResult.getTitle().toLowerCase() === newSearchResult.getTitle().toLowerCase();
  });
  if (alreadyExistedGoogleNewsResult) {
    return;
  }
  var alreadyExistedResult = person.allSearchEngineResults.find(function (searchResult) {
    return searchResult.getLinkUrl().toLowerCase() === newSearchResult.getLinkUrl().toLowerCase() && searchResult.getTitle().toLowerCase() === newSearchResult.getTitle().toLowerCase();
  });
  if (!alreadyExistedResult) {
    person.allSearchEngineResults.push(newSearchResult);
  } else {
    var existedResults = person.allSearchEngineResults.filter(function (searchResult) {
      return searchResult.getLinkUrl().toLowerCase() === newSearchResult.getLinkUrl().toLowerCase() && searchResult.getTitle().toLowerCase() === newSearchResult.getTitle().toLowerCase();
    });
    if (existedResults.find(function (searchResult) {
      return searchResult.getSearchConfigId() !== newSearchResult.getSearchConfigId() && searchResult.getRequestRiskScore() >= newSearchResult.getRequestRiskScore() || searchResult.getSearchConfigId() === newSearchResult.getSearchConfigId() && searchResult.getSortBy() === newSearchResult.getSortBy();
    })) {} else {
      existedResults.forEach(function (searchResult) {
        if (searchResult.getSearchConfigId() !== newSearchResult.getSearchConfigId() && searchResult.getRequestRiskScore() <= newSearchResult.getRequestRiskScore()) {
          var idx = person.allSearchEngineResults.findIndex(function (res) {
            return res.getId() === searchResult.getId();
          });
          if (idx !== -1) {
            person.allSearchEngineResults.splice(idx, 1);
          }
        }
      });
      person.allSearchEngineResults.push(newSearchResult);
    }
  }
};
MediaSearchPersonV5.prototype.addGoogleNewsRssResult = function (newGoogleNewsRssResult) {
  var person = this;
  var alreadyExistedSearchEngineResult = person.allSearchEngineResults.find(function (searchResult) {
    return searchResult.getLinkUrl().toLowerCase() === newGoogleNewsRssResult.getLinkUrl().toLowerCase() && searchResult.getTitle().toLowerCase() === newGoogleNewsRssResult.getTitle().toLowerCase();
  });
  if (alreadyExistedSearchEngineResult) {
    return;
  }
  var existedResult = this.allGoogleNewsResults.find(function (searchResult) {
    return searchResult.getLinkUrl().toLowerCase() === newGoogleNewsRssResult.getLinkUrl().toLowerCase() && searchResult.getTitle().toLowerCase() === newGoogleNewsRssResult.getTitle().toLowerCase();
  });
  if (!existedResult) {
    this.allGoogleNewsResults.push(newGoogleNewsRssResult);
  }
};
MediaSearchPersonV5.prototype.addStockMarketResult = function (newStockMarketResult) {
  var existedResult = this.allStockMarketResults.find(function (searchResult) {
    return searchResult.getLinkUrl().toLowerCase() === newStockMarketResult.getLinkUrl().toLowerCase() && searchResult.getTitle().toLowerCase() === newStockMarketResult.getTitle().toLowerCase();
  });
  if (!existedResult) {
    this.allStockMarketResults.push(newStockMarketResult);
  }
};
MediaSearchPersonV5.prototype.addExtraSourceResult = function (newExtraSourceResult) {
  var existedResult = this.allExtraSourcesResults.find(function (searchResult) {
    return searchResult.getLinkUrl() === newExtraSourceResult.getLinkUrl() && searchResult.getTitle() === newExtraSourceResult.getTitle();
  });
  if (!existedResult) {
    this.allExtraSourcesResults.push(newExtraSourceResult);
  }
};
MediaSearchPersonV5.prototype.addAlephOccrpResult = function (newAlephOccrpResult) {
  var existedResult = this.allAlephOccrpResults.find(function (searchResult) {
    return searchResult.getLinkUrl().toLowerCase() === newAlephOccrpResult.getLinkUrl().toLowerCase() && searchResult.getTitle().toLowerCase() === newAlephOccrpResult.getTitle().toLowerCase();
  });
  if (!existedResult) {
    this.allAlephOccrpResults.push(newAlephOccrpResult);
  }
};
MediaSearchPersonV5.prototype.addOpenSanctionsResult = function (newOpenSanctionsResult) {
  var existedResult = this.allOpenSanctionsResults.find(function (searchResult) {
    return searchResult.getLinkUrl().toLowerCase() === newOpenSanctionsResult.getLinkUrl().toLowerCase() && searchResult.getTitle().toLowerCase() === newOpenSanctionsResult.getTitle().toLowerCase();
  });
  if (!existedResult) {
    this.allOpenSanctionsResults.push(newOpenSanctionsResult);
  }
};
MediaSearchPersonV5.prototype.addOpenCorporatesResult = function (newOpenCorporatesResult) {
  var existedResult = this.allOpenCorporatesResults.find(function (searchResult) {
    return searchResult.getLinkUrl().toLowerCase() === newOpenCorporatesResult.getLinkUrl().toLowerCase() && searchResult.getTitle().toLowerCase() === newOpenCorporatesResult.getTitle().toLowerCase();
  });
  if (!existedResult) {
    this.allOpenCorporatesResults.push(newOpenCorporatesResult);
  }
};
MediaSearchPersonV5.prototype.getRelevantResult = function (id) {
  return this.relevantResults.find(function (res) {
    return res.getId() === id;
  });
};
MediaSearchPersonV5.prototype.addRelevantResult = function (newSearchResult) {
  var existedResult = this.relevantResults.find(function (searchResult) {
    return searchResult.getLinkUrl() === newSearchResult.getLinkUrl() && searchResult.getTitle() === newSearchResult.getTitle();
  });
  if (!existedResult) {
    this.relevantResults.push(newSearchResult);
  }
};
MediaSearchPersonV5.prototype.removeRelevantResult = function (id) {
  var idx = this.relevantResults.findIndex(function (res) {
    return res.getId() === id;
  });
  if (idx !== -1) {
    this.relevantResults.splice(idx, 1);
  }
};
MediaSearchPersonV5.prototype.addMatchPersonResult = function (newSearchResult) {
  var existedResult = this.matchPersonResults.find(function (searchResult) {
    return searchResult.getLinkUrl() === newSearchResult.getLinkUrl() && searchResult.getTitle() === newSearchResult.getTitle() && searchResult.getDescription() === newSearchResult.getDescription();
  });
  if (!existedResult) {
    this.matchPersonResults.push(newSearchResult);
  }
};
MediaSearchPersonV5.prototype.prependSortedResults = function () {
  var person = this;
  var resultsInfoArray = [];
  var allSearchEngineResults = [].concat(person.allSearchEngineResults);
  allSearchEngineResults.forEach(function (searchResult) {
    if (!resultsInfoArray.find(function (resultInfo) {
      return resultInfo.searchConfigId === searchResult.getSearchConfigId();
    })) {
      resultsInfoArray.push({
        searchConfigId: searchResult.getSearchConfigId(),
        resultsInBoth: [],
        sortedByRelevancy: [],
        sortedByDate: []
      });
    }
  });
  resultsInfoArray.forEach(function (resultInfo) {
    var sortedByRelevancy = allSearchEngineResults.filter(function (res) {
      return res.getSearchConfigId() === resultInfo.searchConfigId && res.getSortBy() === "relevancy";
    });
    var sortedByDate = allSearchEngineResults.filter(function (res) {
      return res.getSearchConfigId() === resultInfo.searchConfigId && res.getSortBy() === "date";
    });
    var resultsInBothArrays = [];
    (sortedByRelevancy || []).forEach(function (relevantResult) {
      (sortedByDate || []).forEach(function (dateResult) {
        if (relevantResult.getTitle() === dateResult.getTitle() && relevantResult.getLinkUrl() === dateResult.getLinkUrl()) {
          resultsInBothArrays.push(relevantResult);
        }
      });
    });
    resultsInBothArrays.forEach(function (bothResult) {
      var result = sortedByDate.find(function (dateResult) {
        return bothResult.getTitle() === dateResult.getTitle() && bothResult.getLinkUrl() === dateResult.getLinkUrl();
      });
      if (result) {
        bothResult.setDescription(result.getDescription());
        bothResult.setDescriptionHtml(result.getDescriptionHtml());
        bothResult.setDate(result.getDate());
      }
    });
    resultInfo.resultsInBoth = resultsInBothArrays.sort(compareByPositionIdx);
    resultInfo.sortedByRelevancy = sortedByRelevancy.filter(function (relevantResult) {
      return resultsInBothArrays.filter(function (bothResult) {
        return relevantResult.getTitle() === bothResult.getTitle() && relevantResult.getLinkUrl() === bothResult.getLinkUrl();
      }).length === 0;
    }).sort(compareByPositionIdx);
    resultInfo.sortedByDate = sortedByDate.filter(function (dateResult) {
      return resultsInBothArrays.filter(function (bothResult) {
        return dateResult.getTitle() === bothResult.getTitle() && dateResult.getLinkUrl() === bothResult.getLinkUrl();
      }).length === 0;
    }).sort(compareByPositionIdx);
  });
  var prependedSortedResults = [];
  var tempBothArray = [];
  resultsInfoArray.forEach(function (resultInfo) {
    tempBothArray = tempBothArray.concat(resultInfo.resultsInBoth);
  });
  prependedSortedResults = prependedSortedResults.concat(tempBothArray.sort(compareByPositionIdx));
  var tempRelArray = [];
  resultsInfoArray.forEach(function (resultInfo) {
    tempRelArray = tempRelArray.concat(resultInfo.sortedByRelevancy);
  });
  prependedSortedResults = prependedSortedResults.concat(tempRelArray.sort(compareByPositionIdx));
  var tempDateArray = [];
  resultsInfoArray.forEach(function (resultInfo) {
    tempDateArray = tempDateArray.concat(resultInfo.sortedByDate);
  });
  prependedSortedResults = prependedSortedResults.concat(tempDateArray.sort(compareByPositionIdx));
  person.prependedSortedResults = [].concat(prependedSortedResults);
};
MediaSearchPersonV5.prototype.setSearchEngineResultsFromPrepended = function (searchResultsMaxCount) {
  var person = this;
  var searchEngineResults = [].concat(person.prependedSortedResults);
  var alreadyFilteredResults = [].concat(person.filteredSearchEngineResults);
  var alreadyFilteredResultsCount = alreadyFilteredResults.length;
  if (alreadyFilteredResultsCount) {
    searchEngineResults = searchEngineResults.filter(function (searchResult) {
      return !alreadyFilteredResults.find(function (filteredResult) {
        return filteredResult.getId() === searchResult.getId();
      });
    });
  }
  searchEngineResults = searchEngineResults.slice(0, searchResultsMaxCount - alreadyFilteredResultsCount);
  person.filteredSearchEngineResults = [].concat(person.filteredSearchEngineResults).concat(searchEngineResults);
};
MediaSearchPersonV5.prototype.setGoogleNewsResults = function (topResultsCount) {
  var person = this;
  var allGoogleNewsResults = [].concat(person.allGoogleNewsResults);
  var googleNewsResults = [];
  var differentLanguages = allGoogleNewsResults.map(function (result) {
    return result.getLanguage();
  }).filter(onlyUnique);
  differentLanguages.forEach(function (lang) {
    var currLanguageResults = allGoogleNewsResults.filter(function (result) {
      return result.getLanguage() === lang;
    });
    googleNewsResults = googleNewsResults.concat(currLanguageResults.slice(0, topResultsCount));
  });
  var alreadyFilteredResults = [].concat(person.filteredGoogleNewsResults);
  var alreadyFilteredResultsCount = alreadyFilteredResults.length;
  if (alreadyFilteredResultsCount) {
    googleNewsResults = googleNewsResults.filter(function (searchResult) {
      return !alreadyFilteredResults.find(function (filteredResult) {
        return filteredResult.getId() === searchResult.getId();
      });
    });
  }
  person.filteredGoogleNewsResults = [].concat(person.filteredGoogleNewsResults).concat(googleNewsResults);
};
MediaSearchPersonV5.prototype.setStockMarketResults = function () {
  var person = this;
  var stockMarketResults = [].concat(person.allStockMarketResults);
  var alreadyFilteredResults = [].concat(person.filteredStockMarketResults);
  var alreadyFilteredResultsCount = alreadyFilteredResults.length;
  if (alreadyFilteredResultsCount) {
    stockMarketResults = stockMarketResults.filter(function (searchResult) {
      return !alreadyFilteredResults.find(function (filteredResult) {
        return filteredResult.getId() === searchResult.getId();
      });
    });
  }
  person.filteredStockMarketResults = [].concat(person.filteredStockMarketResults).concat(stockMarketResults);
};
MediaSearchPersonV5.prototype.setExtraSourcesResults = function () {
  var person = this;
  var extraSourcesResults = [].concat(person.allExtraSourcesResults);
  var alreadyFilteredResults = [].concat(person.filteredExtraSourcesResults);
  var alreadyFilteredResultsCount = alreadyFilteredResults.length;
  if (alreadyFilteredResultsCount) {
    extraSourcesResults = extraSourcesResults.filter(function (searchResult) {
      return !alreadyFilteredResults.find(function (filteredResult) {
        return filteredResult.getId() === searchResult.getId();
      });
    });
  }
  person.filteredExtraSourcesResults = [].concat(person.filteredExtraSourcesResults).concat(extraSourcesResults);
};
MediaSearchPersonV5.prototype.setAlephOccrpResults = function () {
  var person = this;
  var alephOccrpResults = [].concat(person.allAlephOccrpResults);
  var alreadyFilteredResults = [].concat(person.filteredAlephOccrpResults);
  var alreadyFilteredResultsCount = alreadyFilteredResults.length;
  if (alreadyFilteredResultsCount) {
    alephOccrpResults = alephOccrpResults.filter(function (searchResult) {
      return !alreadyFilteredResults.find(function (filteredResult) {
        return filteredResult.getId() === searchResult.getId();
      });
    });
  }
  person.filteredAlephOccrpResults = [].concat(person.filteredAlephOccrpResults).concat(alephOccrpResults);
};
MediaSearchPersonV5.prototype.setOpenSanctionsResults = function () {
  var person = this;
  var openSanctionsResults = [].concat(person.allOpenSanctionsResults);
  var alreadyFilteredResults = [].concat(person.filteredOpenSanctionsResults);
  var alreadyFilteredResultsCount = alreadyFilteredResults.length;
  if (alreadyFilteredResultsCount) {
    openSanctionsResults = openSanctionsResults.filter(function (searchResult) {
      return !alreadyFilteredResults.find(function (filteredResult) {
        return filteredResult.getId() === searchResult.getId();
      });
    });
  }
  person.filteredOpenSanctionsResults = [].concat(person.filteredOpenSanctionsResults).concat(openSanctionsResults);
};
MediaSearchPersonV5.prototype.setOpenCorporatesResults = function () {
  var person = this;
  var openCorporatesResults = [].concat(person.allOpenCorporatesResults);
  var alreadyFilteredResults = [].concat(person.filteredOpenCorporatesResults);
  var alreadyFilteredResultsCount = alreadyFilteredResults.length;
  if (alreadyFilteredResultsCount) {
    openCorporatesResults = openCorporatesResults.filter(function (searchResult) {
      return !alreadyFilteredResults.find(function (filteredResult) {
        return filteredResult.getId() === searchResult.getId();
      });
    });
  }
  person.filteredOpenCorporatesResults = [].concat(person.filteredOpenCorporatesResults).concat(openCorporatesResults);
};
MediaSearchPersonV5.prototype.countTotalRiskScore = function () {
  var resultsForScore = [].concat(this.filteredSearchEngineResults).concat(this.filteredGoogleNewsResults).concat(this.filteredExtraSourcesResults).concat(this.filteredStockMarketResults).concat(this.filteredAlephOccrpResults).concat(this.filteredOpenSanctionsResults).concat(this.filteredOpenCorporatesResults);
  var maxScore = resultsForScore.length ? Math.max.apply(Math, resultsForScore.map(function (res) {
    return res.getMediaPyRiskScore();
  })) : 0;
  var resultsWithMaxScoreCount = resultsForScore.filter(function (res) {
    return res.getMediaPyRiskScore() === maxScore;
  }).length;
  this.totalRiskScore = maxScore + (resultsWithMaxScoreCount >= 6 ? 0.02 : resultsWithMaxScoreCount >= 3 ? 0.01 : 0);
  this.totalRiskScore = this.totalRiskScore > 1 ? 1 : this.totalRiskScore;
};
MediaSearchPersonV5.prototype.filterResultWithName = function (searchResults) {
  var filteredResults = [].concat(searchResults).filter(function (searchResult) {
    return searchResult.checkIsContentHtmlLoaded() && searchResult.checkIsPersonNamePresented() && searchResult.checkIsMediaPyRiskScored();
  });
  return filteredResults;
};
MediaSearchPersonV5.prototype.filterResultsWithoutName = function (searchResults) {
  var filteredResults = [].concat(searchResults).filter(function (searchResult) {
    return searchResult.checkIsContentHtmlLoaded() && searchResult.checkIsMediaPyRiskScored();
  });
  return filteredResults;
};
MediaSearchPersonV5.prototype.filterLoadedRequestObjectResults = function (requestObjectId, sourceType) {
  var groupRequestSearchEngineResults = [];
  var groupRequestGoogleNewsResults = [];
  var groupRequestStockMarketResults = [];
  var groupRequestExtraSourcesResults = [];
  var groupRequestAlephOccrpResults = [];
  var groupRequestOpenSanctionsResults = [];
  var groupRequestOpenCorporatesResults = [];
  if (requestObjectId) {
    groupRequestSearchEngineResults = this.filteredSearchEngineResults.filter(function (searchResult) {
      return searchResult.getRequestObjectId() === requestObjectId;
    });
    this.filteredSearchEngineResults = this.filteredSearchEngineResults.filter(function (searchResult) {
      return searchResult.getRequestObjectId() !== requestObjectId;
    });
    groupRequestGoogleNewsResults = this.filteredGoogleNewsResults.filter(function (searchResult) {
      return searchResult.getRequestObjectId() === requestObjectId;
    });
    this.filteredGoogleNewsResults = this.filteredGoogleNewsResults.filter(function (searchResult) {
      return searchResult.getRequestObjectId() !== requestObjectId;
    });
    groupRequestStockMarketResults = this.filteredStockMarketResults.filter(function (searchResult) {
      return searchResult.getRequestObjectId() === requestObjectId;
    });
    this.filteredStockMarketResults = this.filteredStockMarketResults.filter(function (searchResult) {
      return searchResult.getRequestObjectId() !== requestObjectId;
    });
    groupRequestExtraSourcesResults = this.filteredExtraSourcesResults.filter(function (searchResult) {
      return searchResult.getRequestObjectId() === requestObjectId;
    });
    this.filteredExtraSourcesResults = this.filteredExtraSourcesResults.filter(function (searchResult) {
      return searchResult.getRequestObjectId() !== requestObjectId;
    });
    groupRequestAlephOccrpResults = this.filteredAlephOccrpResults.filter(function (searchResult) {
      return searchResult.getRequestObjectId() === requestObjectId;
    });
    this.filteredAlephOccrpResults = this.filteredAlephOccrpResults.filter(function (searchResult) {
      return searchResult.getRequestObjectId() !== requestObjectId;
    });
    groupRequestOpenSanctionsResults = this.filteredOpenSanctionsResults.filter(function (searchResult) {
      return searchResult.getRequestObjectId() === requestObjectId;
    });
    this.filteredOpenSanctionsResults = this.filteredOpenSanctionsResults.filter(function (searchResult) {
      return searchResult.getRequestObjectId() !== requestObjectId;
    });
    groupRequestOpenCorporatesResults = this.filteredOpenCorporatesResults.filter(function (searchResult) {
      return searchResult.getRequestObjectId() === requestObjectId;
    });
    this.filteredOpenCorporatesResults = this.filteredOpenCorporatesResults.filter(function (searchResult) {
      return searchResult.getRequestObjectId() !== requestObjectId;
    });
  } else {
    if (sourceType === GOOGLE_SEARCH_SOURCE_CODE) {
      groupRequestSearchEngineResults = [].concat(this.filteredSearchEngineResults);
      this.filteredSearchEngineResults = [];
    }
    if (sourceType === GOOGLE_NEWS_SOURCE_CODE) {
      groupRequestGoogleNewsResults = [].concat(this.filteredGoogleNewsResults);
      this.filteredGoogleNewsResults = [];
    }
    if (sourceType === STOCK_MARKETS_SOURCE_CODE) {
      groupRequestStockMarketResults = [].concat(this.filteredStockMarketResults);
      this.filteredStockMarketResults = [];
    }
    if (sourceType === EXTRA_SOURCE_SOURCE_CODE) {
      groupRequestExtraSourcesResults = [].concat(this.filteredExtraSourcesResults);
      this.filteredExtraSourcesResults = [];
    }
    if (sourceType === ALEPH_OCCRP_SOURCE_CODE) {
      groupRequestAlephOccrpResults = [].concat(this.filteredAlephOccrpResults);
      this.filteredAlephOccrpResults = [];
    }
    if (sourceType === OPEN_SANCTIONS_SOURCE_CODE) {
      groupRequestOpenSanctionsResults = [].concat(this.filteredOpenSanctionsResults);
      this.filteredOpenSanctionsResults = [];
    }
    if (sourceType === OPEN_CORPORATES_SOURCE_CODE) {
      groupRequestOpenCorporatesResults = [].concat(this.filteredOpenCorporatesResults);
      this.filteredOpenCorporatesResults = [];
    }
  }
  groupRequestSearchEngineResults = this.filterResultWithName(groupRequestSearchEngineResults);
  groupRequestGoogleNewsResults = this.filterResultWithName(groupRequestGoogleNewsResults);
  groupRequestStockMarketResults = this.filterResultsWithoutName(groupRequestStockMarketResults);
  groupRequestExtraSourcesResults = this.filterResultsWithoutName(groupRequestExtraSourcesResults);
  groupRequestAlephOccrpResults = this.filterResultsWithoutName(groupRequestAlephOccrpResults);
  groupRequestOpenSanctionsResults = this.filterResultsWithoutName(groupRequestOpenSanctionsResults);
  groupRequestOpenCorporatesResults = this.filterResultsWithoutName(groupRequestOpenCorporatesResults);
  this.filteredSearchEngineResults = [].concat(this.filteredSearchEngineResults).concat(groupRequestSearchEngineResults);
  this.filteredGoogleNewsResults = [].concat(this.filteredGoogleNewsResults).concat(groupRequestGoogleNewsResults);
  this.filteredStockMarketResults = [].concat(this.filteredStockMarketResults).concat(groupRequestStockMarketResults);
  this.filteredExtraSourcesResults = [].concat(this.filteredExtraSourcesResults).concat(groupRequestExtraSourcesResults);
  this.filteredAlephOccrpResults = [].concat(this.filteredAlephOccrpResults).concat(groupRequestAlephOccrpResults);
  this.filteredOpenSanctionsResults = [].concat(this.filteredOpenSanctionsResults).concat(groupRequestOpenSanctionsResults);
  this.filteredOpenCorporatesResults = [].concat(this.filteredOpenCorporatesResults).concat(groupRequestOpenCorporatesResults);
};
MediaSearchPersonV5.prototype.filterRequestObjectResults = function (requestObjectId, dateFrom, dateTo, isAddWithoutDate, isAddWithoutDateStockMarketResults, languages) {
  var groupRequestSearchEngineResults = this.filteredSearchEngineResults.filter(function (searchResult) {
    return searchResult.getRequestObjectId() === requestObjectId;
  });
  this.filteredSearchEngineResults = this.filteredSearchEngineResults.filter(function (searchResult) {
    return searchResult.getRequestObjectId() !== requestObjectId;
  });
  var groupRequestGoogleNewsResults = this.filteredGoogleNewsResults.filter(function (searchResult) {
    return searchResult.getRequestObjectId() === requestObjectId;
  });
  this.filteredGoogleNewsResults = this.filteredGoogleNewsResults.filter(function (searchResult) {
    return searchResult.getRequestObjectId() !== requestObjectId;
  });
  var groupRequestStockMarketResults = this.filteredStockMarketResults.filter(function (searchResult) {
    return searchResult.getRequestObjectId() === requestObjectId;
  });
  this.filteredStockMarketResults = this.filteredStockMarketResults.filter(function (searchResult) {
    return searchResult.getRequestObjectId() !== requestObjectId;
  });
  var groupRequestAlephOccrpResults = this.filteredAlephOccrpResults.filter(function (searchResult) {
    return searchResult.getRequestObjectId() === requestObjectId;
  });
  this.filteredAlephOccrpResults = this.filteredAlephOccrpResults.filter(function (searchResult) {
    return searchResult.getRequestObjectId() !== requestObjectId;
  });
  var groupRequestOpenSanctionsResults = this.filteredOpenSanctionsResults.filter(function (searchResult) {
    return searchResult.getRequestObjectId() === requestObjectId;
  });
  this.filteredOpenSanctionsResults = this.filteredOpenSanctionsResults.filter(function (searchResult) {
    return searchResult.getRequestObjectId() !== requestObjectId;
  });
  var groupRequestOpenCorporatesResults = this.filteredOpenCorporatesResults.filter(function (searchResult) {
    return searchResult.getRequestObjectId() === requestObjectId;
  });
  this.filteredOpenCorporatesResults = this.filteredOpenCorporatesResults.filter(function (searchResult) {
    return searchResult.getRequestObjectId() !== requestObjectId;
  });
  if (dateFrom && dateTo) {
    groupRequestSearchEngineResults = groupRequestSearchEngineResults.filter(function (searchResult) {
      return !searchResult.getDate() || searchResult.getDate() && searchResult.getDate() >= dateFrom && searchResult.getDate() <= dateTo;
    });
    groupRequestGoogleNewsResults = groupRequestGoogleNewsResults.filter(function (searchResult) {
      return !searchResult.getDate() || searchResult.getDate() && searchResult.getDate() >= dateFrom && searchResult.getDate() <= dateTo;
    });
    groupRequestAlephOccrpResults = groupRequestAlephOccrpResults.filter(function (searchResult) {
      return !searchResult.getDate() || searchResult.getDate() && searchResult.getDate() >= dateFrom && searchResult.getDate() <= dateTo;
    });
  } else if (dateFrom) {
    groupRequestSearchEngineResults = groupRequestSearchEngineResults.filter(function (searchResult) {
      return !searchResult.getDate() || searchResult.getDate() && searchResult.getDate() >= dateFrom;
    });
    groupRequestGoogleNewsResults = groupRequestGoogleNewsResults.filter(function (searchResult) {
      return !searchResult.getDate() || searchResult.getDate() && searchResult.getDate() >= dateFrom;
    });
    groupRequestAlephOccrpResults = groupRequestAlephOccrpResults.filter(function (searchResult) {
      return !searchResult.getDate() || searchResult.getDate() && searchResult.getDate() >= dateFrom;
    });
  } else if (dateTo) {
    groupRequestSearchEngineResults = groupRequestSearchEngineResults.filter(function (searchResult) {
      return !searchResult.getDate() || searchResult.getDate() && searchResult.getDate() <= dateTo;
    });
    groupRequestGoogleNewsResults = groupRequestGoogleNewsResults.filter(function (searchResult) {
      return !searchResult.getDate() || searchResult.getDate() && searchResult.getDate() <= dateTo;
    });
    groupRequestAlephOccrpResults = groupRequestAlephOccrpResults.filter(function (searchResult) {
      return !searchResult.getDate() || searchResult.getDate() && searchResult.getDate() <= dateTo;
    });
  }
  if (!isAddWithoutDate) {
    groupRequestSearchEngineResults = groupRequestSearchEngineResults.filter(function (searchResult) {
      return searchResult.getDate();
    });
    groupRequestGoogleNewsResults = groupRequestGoogleNewsResults.filter(function (searchResult) {
      return searchResult.getDate();
    });
    groupRequestAlephOccrpResults = groupRequestAlephOccrpResults.filter(function (searchResult) {
      return !searchResult.checkIsDocumentType() || searchResult.checkIsDocumentType() && searchResult.getDate();
    });
  }
  if (!isAddWithoutDateStockMarketResults) {
    groupRequestStockMarketResults = groupRequestStockMarketResults.filter(function (searchResult) {
      return searchResult.getDate();
    });
  }
  if (languages && languages.length) {
    groupRequestSearchEngineResults = groupRequestSearchEngineResults.filter(function (searchResult) {
      return !searchResult.getLanguage() || searchResult.getLanguage() && languages.find(function (language) {
        return language === searchResult.getLanguage();
      });
    });
    groupRequestGoogleNewsResults = groupRequestGoogleNewsResults.filter(function (searchResult) {
      return !searchResult.getLanguage() || searchResult.getLanguage() && languages.find(function (language) {
        return language === searchResult.getLanguage();
      });
    });
    groupRequestAlephOccrpResults = groupRequestAlephOccrpResults.filter(function (searchResult) {
      return !searchResult.getLanguage() || searchResult.getLanguage() && languages.find(function (language) {
        return language === searchResult.getLanguage();
      });
    });
  }
  this.filteredSearchEngineResults = [].concat(this.filteredSearchEngineResults).concat(groupRequestSearchEngineResults);
  this.filteredGoogleNewsResults = [].concat(this.filteredGoogleNewsResults).concat(groupRequestGoogleNewsResults);
  this.filteredStockMarketResults = [].concat(this.filteredStockMarketResults).concat(groupRequestStockMarketResults);
  this.filteredAlephOccrpResults = [].concat(this.filteredAlephOccrpResults).concat(groupRequestAlephOccrpResults);
  this.filteredOpenSanctionsResults = [].concat(this.filteredOpenSanctionsResults).concat(groupRequestOpenSanctionsResults);
  this.filteredOpenCorporatesResults = [].concat(this.filteredOpenCorporatesResults).concat(groupRequestOpenCorporatesResults);
};
MediaSearchPersonV5.prototype.filterGroupObjectResults = function (groupObjectId, maxResultsCount, minRiskScore) {
  var requestsGroupSearchEngineResults = this.filteredSearchEngineResults.filter(function (searchResult) {
    return searchResult.getGroupObjectId() === groupObjectId && Math.abs(searchResult.getMediaPyRiskScore()) >= minRiskScore;
  });
  this.filteredSearchEngineResults = this.filteredSearchEngineResults.filter(function (searchResult) {
    return searchResult.getGroupObjectId() !== groupObjectId;
  });
  var requestsGroupGoogleNewsResults = this.filteredGoogleNewsResults.filter(function (searchResult) {
    return searchResult.getGroupObjectId() === groupObjectId && Math.abs(searchResult.getMediaPyRiskScore()) >= minRiskScore;
  });
  this.filteredGoogleNewsResults = this.filteredGoogleNewsResults.filter(function (searchResult) {
    return searchResult.getGroupObjectId() !== groupObjectId;
  });
  var requestsGroupStockMarketResults = this.filteredStockMarketResults.filter(function (searchResult) {
    return searchResult.getGroupObjectId() === groupObjectId && Math.abs(searchResult.getMediaPyRiskScore()) >= minRiskScore;
  });
  this.filteredStockMarketResults = this.filteredStockMarketResults.filter(function (searchResult) {
    return searchResult.getGroupObjectId() !== groupObjectId;
  });
  var requestsGroupExtraSourcesResults = this.filteredExtraSourcesResults.filter(function (searchResult) {
    return searchResult.getGroupObjectId() === groupObjectId && Math.abs(searchResult.getMediaPyRiskScore()) >= minRiskScore;
  });
  this.filteredExtraSourcesResults = this.filteredExtraSourcesResults.filter(function (searchResult) {
    return searchResult.getGroupObjectId() !== groupObjectId;
  });
  var requestsGroupAlephOccrpResults = this.filteredAlephOccrpResults.filter(function (searchResult) {
    return searchResult.getGroupObjectId() === groupObjectId && Math.abs(searchResult.getMediaPyRiskScore()) >= minRiskScore;
  });
  this.filteredAlephOccrpResults = this.filteredAlephOccrpResults.filter(function (searchResult) {
    return searchResult.getGroupObjectId() !== groupObjectId;
  });
  var requestsGroupOpenSanctionsResults = this.filteredOpenSanctionsResults.filter(function (searchResult) {
    return searchResult.getGroupObjectId() === groupObjectId && Math.abs(searchResult.getMediaPyRiskScore()) >= minRiskScore;
  });
  this.filteredOpenSanctionsResults = this.filteredOpenSanctionsResults.filter(function (searchResult) {
    return searchResult.getGroupObjectId() !== groupObjectId;
  });
  var requestsGroupOpenCorporatesResults = this.filteredOpenCorporatesResults.filter(function (searchResult) {
    return searchResult.getGroupObjectId() === groupObjectId && Math.abs(searchResult.getMediaPyRiskScore()) >= minRiskScore;
  });
  this.filteredOpenCorporatesResults = this.filteredOpenCorporatesResults.filter(function (searchResult) {
    return searchResult.getGroupObjectId() !== groupObjectId;
  });
  var allRequestsGroupResults = [].concat(requestsGroupSearchEngineResults).concat(requestsGroupGoogleNewsResults).concat(requestsGroupExtraSourcesResults).concat(requestsGroupStockMarketResults).concat(requestsGroupAlephOccrpResults).concat(requestsGroupOpenSanctionsResults).concat(requestsGroupOpenCorporatesResults);
  allRequestsGroupResults.sort(compareByMediaPyRiskScore);
  allRequestsGroupResults = allRequestsGroupResults.slice(0, maxResultsCount);
  this.filteredSearchEngineResults = this.filteredSearchEngineResults.concat(allRequestsGroupResults.filter(function (searchResult) {
    return searchResult.checkIsFromSearchEngine();
  }));
  this.filteredGoogleNewsResults = this.filteredGoogleNewsResults.concat(allRequestsGroupResults.filter(function (searchResult) {
    return searchResult.checkIsFromGoogleNewsRss();
  }));
  this.filteredStockMarketResults = this.filteredStockMarketResults.concat(allRequestsGroupResults.filter(function (searchResult) {
    return searchResult.checkIsFromStockMarket();
  }));
  this.filteredExtraSourcesResults = this.filteredExtraSourcesResults.concat(allRequestsGroupResults.filter(function (searchResult) {
    return searchResult.checkIsFromExtraSource();
  }));
  this.filteredAlephOccrpResults = this.filteredAlephOccrpResults.concat(allRequestsGroupResults.filter(function (searchResult) {
    return searchResult.checkIsFromAlephOccrp();
  }));
  this.filteredOpenSanctionsResults = this.filteredOpenSanctionsResults.concat(allRequestsGroupResults.filter(function (searchResult) {
    return searchResult.checkIsFromOpenSanctions();
  }));
  this.filteredOpenCorporatesResults = this.filteredOpenCorporatesResults.concat(allRequestsGroupResults.filter(function (searchResult) {
    return searchResult.checkIsFromOpenCorporates();
  }));
};
MediaSearchPersonV5.prototype.getRequestsGroupResultsCount = function (groupObjectId) {
  var groupResultsCount = [].concat(this.filteredSearchEngineResults).concat(this.filteredGoogleNewsResults).concat(this.filteredExtraSourcesResults).concat(this.filteredStockMarketResults).concat(this.filteredAlephOccrpResults).concat(this.filteredOpenSanctionsResults).concat(this.filteredOpenCorporatesResults).filter(function (searchResult) {
    return searchResult.getGroupObjectId() === groupObjectId;
  }).length;
  return groupResultsCount;
};
MediaSearchPersonV5.prototype.getRequestGroupResults = function (requestObjectId, groupObjectId) {
  var requestObjectResults = this.totalResults.filter(function (searchResult) {
    return (requestObjectId ? searchResult.getRequestObjectId() === requestObjectId : true) && (groupObjectId ? searchResult.getGroupObjectId() === groupObjectId : true);
  });
  return requestObjectResults;
};
MediaSearchPersonV5.prototype.filterTotalResults = function (isFinal, isFilterSearchResults, isFilterGoogleNewsResults, isFilterStockMarketResults, isFilterAlephOccrpResults, isFilterOpenSanctionsResults, isFilterOpenCorporatesResults, dateFrom, dateTo, isAddWithoutDate, isAddWithoutDateStockMarketResults, languages) {
  var newTotalResults = [];
  if (isFinal) {
    if (isFilterSearchResults) {
      this.filteredSearchEngineResults = this.filterResultWithName(this.filteredSearchEngineResults);
    }
    if (isFilterGoogleNewsResults) {
      this.filteredGoogleNewsResults = this.filterResultWithName(this.filteredGoogleNewsResults);
    }
    if (isFilterStockMarketResults) {
      this.filteredStockMarketResults = this.filterResultsWithoutName(this.filteredStockMarketResults);
    }
    if (isFilterAlephOccrpResults) {
      this.filteredAlephOccrpResults = this.filterResultsWithoutName(this.filteredAlephOccrpResults);
    }
    if (isFilterOpenSanctionsResults) {
      this.filteredOpenSanctionsResults = this.filterResultsWithoutName(this.filteredOpenSanctionsResults);
    }
    if (isFilterOpenCorporatesResults) {
      this.filteredOpenCorporatesResults = this.filterResultsWithoutName(this.filteredOpenCorporatesResults);
    }
    if (dateFrom && dateTo) {
      this.filteredSearchEngineResults = this.filteredSearchEngineResults.filter(function (searchResult) {
        return !searchResult.getDate() || searchResult.getDate() && searchResult.getDate() >= dateFrom && searchResult.getDate() <= dateTo;
      });
      this.filteredGoogleNewsResults = this.filteredGoogleNewsResults.filter(function (searchResult) {
        return !searchResult.getDate() || searchResult.getDate() && searchResult.getDate() >= dateFrom && searchResult.getDate() <= dateTo;
      });
      this.filteredAlephOccrpResults = this.filteredAlephOccrpResults.filter(function (searchResult) {
        return !searchResult.getDate() || searchResult.getDate() && searchResult.getDate() >= dateFrom && searchResult.getDate() <= dateTo;
      });
    } else {
      if (dateFrom) {
        this.filteredSearchEngineResults = this.filteredSearchEngineResults.filter(function (searchResult) {
          return !searchResult.getDate() || searchResult.getDate() && searchResult.getDate() >= dateFrom;
        });
        this.filteredGoogleNewsResults = this.filteredGoogleNewsResults.filter(function (searchResult) {
          return !searchResult.getDate() || searchResult.getDate() && searchResult.getDate() >= dateFrom;
        });
        this.filteredAlephOccrpResults = this.filteredAlephOccrpResults.filter(function (searchResult) {
          return !searchResult.getDate() || searchResult.getDate() && searchResult.getDate() >= dateFrom;
        });
      } else {
        if (dateTo) {
          this.filteredSearchEngineResults = this.filteredSearchEngineResults.filter(function (searchResult) {
            return !searchResult.getDate() || searchResult.getDate() && searchResult.getDate() <= dateTo;
          });
          this.filteredGoogleNewsResults = this.filteredGoogleNewsResults.filter(function (searchResult) {
            return !searchResult.getDate() || searchResult.getDate() && searchResult.getDate() <= dateTo;
          });
          this.filteredAlephOccrpResults = this.filteredAlephOccrpResults.filter(function (searchResult) {
            return !searchResult.getDate() || searchResult.getDate() && searchResult.getDate() <= dateTo;
          });
        }
      }
    }
    if (!isAddWithoutDate) {
      this.filteredSearchEngineResults = this.filteredSearchEngineResults.filter(function (searchResult) {
        return searchResult.getDate();
      });
      this.filteredGoogleNewsResults = this.filteredGoogleNewsResults.filter(function (searchResult) {
        return searchResult.getDate();
      });
      this.filteredAlephOccrpResults = this.filteredAlephOccrpResults.filter(function (searchResult) {
        return !searchResult.checkIsDocumentType() || searchResult.checkIsDocumentType() && searchResult.getDate();
      });
    }
    if (!isAddWithoutDateStockMarketResults) {
      this.filteredStockMarketResults = this.filteredStockMarketResults.filter(function (searchResult) {
        return searchResult.getDate();
      });
    }
  } else {
    if (isFilterSearchResults) {
      this.filteredSearchEngineResults = this.filterResultWithName(this.filteredSearchEngineResults);
    }
    if (isFilterGoogleNewsResults) {
      this.filteredGoogleNewsResults = this.filterResultWithName(this.filteredGoogleNewsResults);
    }
    if (isFilterStockMarketResults) {
      this.filteredStockMarketResults = this.filterResultsWithoutName(this.filteredStockMarketResults);
    }
    if (isFilterAlephOccrpResults) {
      this.filteredAlephOccrpResults = this.filterResultsWithoutName(this.filteredAlephOccrpResults);
    }
    if (isFilterOpenSanctionsResults) {
      this.filteredOpenSanctionsResults = this.filterResultsWithoutName(this.filteredOpenSanctionsResults);
    }
    if (isFilterOpenCorporatesResults) {
      this.filteredOpenCorporatesResults = this.filterResultsWithoutName(this.filteredOpenCorporatesResults);
    }
  }
  if (isFinal) {
    if (languages && languages.length) {
      if (isFilterSearchResults) {
        newTotalResults = newTotalResults.concat(this.filteredSearchEngineResults.filter(function (searchResult) {
          return searchResult.getLanguage() && languages.find(function (language) {
            return language === searchResult.getLanguage();
          }) !== undefined;
        }));
      } else {
        newTotalResults = newTotalResults.concat(this.filteredSearchEngineResults);
      }
      if (isFilterGoogleNewsResults) {
        newTotalResults = newTotalResults.concat(this.filteredGoogleNewsResults.filter(function (searchResult) {
          return searchResult.getLanguage() && languages.find(function (language) {
            return language === searchResult.getLanguage();
          }) !== undefined;
        }));
      } else {
        newTotalResults = newTotalResults.concat(this.filteredGoogleNewsResults);
      }
      if (isFilterAlephOccrpResults) {
        newTotalResults = newTotalResults.concat(this.filteredAlephOccrpResults.filter(function (searchResult) {
          return searchResult.getLanguage() && languages.find(function (language) {
            return language === searchResult.getLanguage();
          }) !== undefined;
        }));
      } else {
        newTotalResults = newTotalResults.concat(this.filteredAlephOccrpResults);
      }
    } else {
      newTotalResults = newTotalResults.concat(this.filteredSearchEngineResults).concat(this.filteredGoogleNewsResults).concat(this.filteredAlephOccrpResults);
    }
  } else {
    newTotalResults = newTotalResults.concat(this.filteredSearchEngineResults).concat(this.filteredGoogleNewsResults).concat(this.filteredAlephOccrpResults);
  }
  newTotalResults = newTotalResults.concat(this.filteredStockMarketResults).concat(this.filteredExtraSourcesResults).concat(this.filteredOpenSanctionsResults).concat(this.filteredOpenCorporatesResults);
  newTotalResults.sort(compareByMediaPyRiskScore);
  newTotalResults = this.splitSearchResultsAndSort(newTotalResults);
  newTotalResults = [].concat(newTotalResults).concat(this.relevantResults).concat(this.matchPersonResults);
  this.totalResults = newTotalResults;
};
MediaSearchPersonV5.prototype.applyFiltersToResults = function (dateFrom, dateTo, isAddWithoutDate, languages, sources) {
  var person = this;
  this.totalResults = [];
  this.totalResults = [].concat(this.filteredSearchEngineResults).concat(this.filteredGoogleNewsResults).concat(this.filteredStockMarketResults).concat(this.filteredAlephOccrpResults);
  if (dateFrom && dateTo) {
    this.totalResults = this.totalResults.filter(function (searchResult) {
      return !searchResult.getDate() || searchResult.getDate() && searchResult.getDate() >= dateFrom && searchResult.getDate() <= dateTo;
    });
  } else if (dateFrom) {
    this.totalResults = this.totalResults.filter(function (searchResult) {
      return !searchResult.getDate() || searchResult.getDate() && searchResult.getDate() >= dateFrom;
    });
  } else if (dateTo) {
    this.totalResults = this.totalResults.filter(function (searchResult) {
      return !searchResult.getDate() || searchResult.getDate() && searchResult.getDate() <= dateTo;
    });
  }
  if (!isAddWithoutDate) {
    this.totalResults = this.totalResults.filter(function (searchResult) {
      return searchResult.getDate();
    });
  }
  if (languages && languages.length) {
    this.totalResults = this.totalResults.filter(function (searchResult) {
      return searchResult.getLanguage() && languages.find(function (language) {
        return language === searchResult.getLanguage();
      }) !== undefined;
    });
  }
  this.totalResults = this.totalResults.concat(this.filteredExtraSourcesResults).concat(this.filteredOpenSanctionsResults).concat(this.filteredOpenCorporatesResults);
  if ((sources || []).length) {
    var tempTotalResults = [];
    (sources || []).forEach(function (source) {
      if (source === GOOGLE_SEARCH_SOURCE_CODE) {
        tempTotalResults = tempTotalResults.concat(person.totalResults.filter(function (searchResult) {
          return searchResult.checkIsFromSearchEngine();
        }));
      }
      if (source === GOOGLE_NEWS_SOURCE_CODE) {
        tempTotalResults = tempTotalResults.concat(person.totalResults.filter(function (searchResult) {
          return searchResult.checkIsFromGoogleNewsRss();
        }));
      }
      if (source === EXTRA_SOURCE_SOURCE_CODE) {
        tempTotalResults = tempTotalResults.concat(person.totalResults.filter(function (searchResult) {
          return searchResult.checkIsFromExtraSource();
        }));
      }
      if (source === STOCK_MARKETS_SOURCE_CODE) {
        tempTotalResults = tempTotalResults.concat(person.totalResults.filter(function (searchResult) {
          return searchResult.checkIsFromStockMarket();
        }));
      }
      if (source === ALEPH_OCCRP_SOURCE_CODE) {
        tempTotalResults = tempTotalResults.concat(person.totalResults.filter(function (searchResult) {
          return searchResult.checkIsFromAlephOccrp();
        }));
      }
      if (source === OPEN_SANCTIONS_SOURCE_CODE) {
        tempTotalResults = tempTotalResults.concat(person.totalResults.filter(function (searchResult) {
          return searchResult.checkIsFromOpenSanctions();
        }));
      }
      if (source === OPEN_CORPORATES_SOURCE_CODE) {
        tempTotalResults = tempTotalResults.concat(person.totalResults.filter(function (searchResult) {
          return searchResult.checkIsFromOpenCorporates();
        }));
      }
    });
    person.totalResults = tempTotalResults;
  }
  this.totalResults.sort(compareByMediaPyRiskScore);
  this.totalResults = this.splitSearchResultsAndSort(this.totalResults);
  this.totalResults = this.totalResults.concat(this.relevantResults).concat(this.matchPersonResults);
};
MediaSearchPersonV5.prototype.setTotalResults = function () {
  var newTotalResults = [].concat(this.filteredSearchEngineResults).concat(this.filteredGoogleNewsResults).concat(this.filteredStockMarketResults).concat(this.filteredExtraSourcesResults).concat(this.filteredAlephOccrpResults).concat(this.filteredOpenSanctionsResults).concat(this.filteredOpenCorporatesResults);
  newTotalResults.sort(compareByMediaPyRiskScore);
  newTotalResults = this.splitSearchResultsAndSort(newTotalResults);
  newTotalResults = newTotalResults.concat(this.relevantResults).concat(this.matchPersonResults);
  this.totalResults = newTotalResults;
};
MediaSearchPersonV5.prototype.resetFiltersToResults = function () {
  this.setTotalResults();
};
MediaSearchPersonV5.prototype.getSearchEngineResultsForLoad = function (requestObjectId, groupObjectId, showResultsCount, minHighRiskScoreResultsCount, highRiskScore, maxHighRiskScoreResultsCount) {
  var person = this;
  var topResults = [];
  var totalFilteredSearchResults = person.filterResultWithName(person.filteredSearchEngineResults);
  var groupFilteredSearchResults = totalFilteredSearchResults.filter(function (searchResult) {
    return groupObjectId ? searchResult.getGroupObjectId() === groupObjectId : true;
  });
  var searchResultsCount = groupFilteredSearchResults.length;
  if (searchResultsCount < showResultsCount) {
    var neededCount = showResultsCount - searchResultsCount;
    person.prependedSortedResults.forEach(function (sortedResult) {
      if (!sortedResult.checkIsContentHtmlLoaded() && sortedResult.getTryLoadCounter() < 1 && (groupObjectId ? sortedResult.getGroupObjectId() === groupObjectId : true) && (requestObjectId ? sortedResult.getRequestObjectId() === requestObjectId : true) && neededCount > 0) {
        person.filteredSearchEngineResults.push(sortedResult);
        topResults.push(sortedResult);
        neededCount--;
      }
    });
  }
  if (topResults.length === 0) {
    var topHighRiskScoreResultsCount = person.filteredSearchEngineResults.filter(function (searchResult) {
      return searchResult.getMediaPyRiskScore() >= highRiskScore && (groupObjectId ? searchResult.getGroupObjectId() === groupObjectId : true);
    }).length;
    var alreadyLoadedResultsCount = person.prependedSortedResults.filter(function (prependedResult) {
      return prependedResult.checkIsContentHtmlLoaded() && (groupObjectId ? prependedResult.getGroupObjectId() === groupObjectId : true);
    }).length;
    if (topHighRiskScoreResultsCount < minHighRiskScoreResultsCount && alreadyLoadedResultsCount < maxHighRiskScoreResultsCount) {
      var neededCount = minHighRiskScoreResultsCount - topHighRiskScoreResultsCount;
      person.prependedSortedResults.forEach(function (sortedResult) {
        if (!sortedResult.checkIsContentHtmlLoaded() && sortedResult.getTryLoadCounter() < 1 && (groupObjectId ? sortedResult.getGroupObjectId() === groupObjectId : true) && (requestObjectId ? sortedResult.getRequestObjectId() === requestObjectId : true) && neededCount > 0) {
          person.filteredSearchEngineResults.push(sortedResult);
          topResults.push(sortedResult);
          neededCount--;
        }
      });
    }
  }
  return topResults;
};
MediaSearchPersonV5.prototype.getGoogleNewsResultsForLoad = function (requestObjectId, groupObjectId, topResultsCount, highRiskScore) {
  var person = this;
  var topResults = [];
  var resultsCountPerEachLang = 0;
  var differentLanguages = person.allGoogleNewsResults.filter(function (searchResult) {
    return groupObjectId ? searchResult.getGroupObjectId() === groupObjectId : true;
  }).map(function (searchResult) {
    return searchResult.getLanguage();
  }).filter(onlyUnique);
  if (groupObjectId) {
    var diffLangCount = differentLanguages.length;
    resultsCountPerEachLang = Math.floor(topResultsCount / (diffLangCount ? diffLangCount : 1));
  } else {
    resultsCountPerEachLang = topResultsCount;
  }
  differentLanguages.forEach(function (lang) {
    var resultsFilteredByLang = person.allGoogleNewsResults.filter(function (searchResult) {
      return searchResult.getLanguage() === lang && (groupObjectId ? searchResult.getGroupObjectId() === groupObjectId : true);
    });
    var alreadyLoadedLangResults = resultsFilteredByLang.filter(function (searchResult) {
      return searchResult.checkIsContentHtmlLoaded() && searchResult.checkIsPersonNamePresented() && searchResult.checkIsMediaPyRiskScored() && searchResult.getMediaPyRiskScore() >= highRiskScore;
    });
    if (alreadyLoadedLangResults.length < resultsCountPerEachLang) {
      var neededCount = resultsCountPerEachLang - alreadyLoadedLangResults.length;
      resultsFilteredByLang.forEach(function (searchResult) {
        if ((!searchResult.checkIsContentHtmlLoaded() && searchResult.getTryLoadCounter() < 1 || searchResult.getContentHtml() && !searchResult.checkIsMediaPyRiskScored()) && (groupObjectId ? searchResult.getGroupObjectId() === groupObjectId : true) && (requestObjectId ? searchResult.getRequestObjectId() === requestObjectId : true) && neededCount > 0) {
          person.filteredGoogleNewsResults.push(searchResult);
          topResults.push(searchResult);
          neededCount--;
        }
      });
    }
  });
  return topResults;
};
MediaSearchPersonV5.prototype.getStockMarketResultsForLoad = function (requestObjectId, groupObjectId, topResultsCount, highRiskScore) {
  var person = this;
  var topResults = [];
  var groupFilteredResults = person.allStockMarketResults.filter(function (searchResult) {
    return groupObjectId ? searchResult.getGroupObjectId() === groupObjectId : true;
  });
  var alreadyLoadedGroupResults = groupFilteredResults.filter(function (searchResult) {
    return searchResult.checkIsContentHtmlLoaded() && searchResult.checkIsMediaPyRiskScored() && searchResult.getMediaPyRiskScore() >= highRiskScore;
  });
  if (alreadyLoadedGroupResults.length < topResultsCount) {
    var neededCount = topResultsCount - alreadyLoadedGroupResults.length;
    groupFilteredResults.forEach(function (searchResult) {
      if ((!searchResult.checkIsContentHtmlLoaded() && searchResult.getTryLoadCounter() < 1 || searchResult.getContentHtml() && !searchResult.checkIsMediaPyRiskScored()) && (groupObjectId ? searchResult.getGroupObjectId() === groupObjectId : true) && (requestObjectId ? searchResult.getRequestObjectId() === requestObjectId : true) && neededCount > 0) {
        person.filteredStockMarketResults.push(searchResult);
        topResults.push(searchResult);
        neededCount--;
      }
    });
  }
  return topResults;
};
MediaSearchPersonV5.prototype.getExtraSourcesResultsForLoad = function (requestObjectId, groupObjectId) {
  var person = this;
  var topResults = [];
  var groupFilteredResults = person.allExtraSourcesResults.filter(function (searchResult) {
    return groupObjectId ? searchResult.getGroupObjectId() === groupObjectId : true;
  });
  var alreadyLoadedGroupResults = groupFilteredResults.filter(function (searchResult) {
    return searchResult.checkIsContentHtmlLoaded() && searchResult.checkIsMediaPyRiskScored();
  });
  var topResultsCount = groupFilteredResults.length;
  if (alreadyLoadedGroupResults.length < topResultsCount) {
    var neededCount = topResultsCount - alreadyLoadedGroupResults.length;
    groupFilteredResults.forEach(function (searchResult) {
      if ((!searchResult.checkIsContentHtmlLoaded() || searchResult.getContentHtml() && !searchResult.checkIsMediaPyRiskScored()) && (groupObjectId ? searchResult.getGroupObjectId() === groupObjectId : true) && (requestObjectId ? searchResult.getRequestObjectId() === requestObjectId : true) && neededCount > 0) {
        person.filteredExtraSourcesResults.push(searchResult);
        topResults.push(searchResult);
        neededCount--;
      }
    });
  }
  return topResults;
};
MediaSearchPersonV5.prototype.getAlephOccrpResultsForLoad = function (requestObjectId, groupObjectId, topResultsCount, highRiskScore) {
  var person = this;
  var topResults = [];
  var groupFilteredResults = person.allAlephOccrpResults.filter(function (searchResult) {
    return groupObjectId ? searchResult.getGroupObjectId() === groupObjectId : true;
  });
  var alreadyLoadedGroupResults = groupFilteredResults.filter(function (searchResult) {
    return searchResult.checkIsContentHtmlLoaded() && searchResult.checkIsMediaPyRiskScored() && searchResult.getMediaPyRiskScore() >= highRiskScore;
  });
  if (alreadyLoadedGroupResults.length < topResultsCount) {
    var neededCount = topResultsCount - alreadyLoadedGroupResults.length;
    groupFilteredResults.forEach(function (searchResult) {
      if ((!searchResult.checkIsContentHtmlLoaded() && searchResult.getTryLoadCounter() < 1 || searchResult.getContentHtml() && !searchResult.checkIsMediaPyRiskScored()) && (groupObjectId ? searchResult.getGroupObjectId() === groupObjectId : true) && (requestObjectId ? searchResult.getRequestObjectId() === requestObjectId : true) && neededCount > 0) {
        person.filteredAlephOccrpResults.push(searchResult);
        topResults.push(searchResult);
        neededCount--;
      }
    });
  }
  return topResults;
};
MediaSearchPersonV5.prototype.getOpenSanctionsResultsForLoad = function (requestObjectId, groupObjectId, topResultsCount, highRiskScore) {
  var person = this;
  var topResults = [];
  var groupFilteredResults = person.allOpenSanctionsResults.filter(function (searchResult) {
    return groupObjectId ? searchResult.getGroupObjectId() === groupObjectId : true;
  });
  var alreadyLoadedGroupResults = groupFilteredResults.filter(function (searchResult) {
    return searchResult.checkIsContentHtmlLoaded() && searchResult.checkIsMediaPyRiskScored() && searchResult.getMediaPyRiskScore() >= highRiskScore;
  });
  if (alreadyLoadedGroupResults.length < topResultsCount) {
    var neededCount = topResultsCount - alreadyLoadedGroupResults.length;
    groupFilteredResults.forEach(function (searchResult) {
      if ((!searchResult.checkIsContentHtmlLoaded() && searchResult.getTryLoadCounter() < 1 || searchResult.getContentHtml() && !searchResult.checkIsMediaPyRiskScored()) && (groupObjectId ? searchResult.getGroupObjectId() === groupObjectId : true) && (requestObjectId ? searchResult.getRequestObjectId() === requestObjectId : true) && neededCount > 0) {
        person.filteredOpenSanctionsResults.push(searchResult);
        topResults.push(searchResult);
        neededCount--;
      }
    });
  }
  return topResults;
};
MediaSearchPersonV5.prototype.getOpenCorporatesResultsForLoad = function (requestObjectId, groupObjectId, topResultsCount, highRiskScore) {
  var person = this;
  var topResults = [];
  var groupFilteredResults = person.allOpenCorporatesResults.filter(function (searchResult) {
    return groupObjectId ? searchResult.getGroupObjectId() === groupObjectId : true;
  });
  var alreadyLoadedGroupResults = groupFilteredResults.filter(function (searchResult) {
    return searchResult.checkIsContentHtmlLoaded() && searchResult.checkIsMediaPyRiskScored() && searchResult.getMediaPyRiskScore() >= highRiskScore;
  });
  if (alreadyLoadedGroupResults.length < topResultsCount) {
    var neededCount = topResultsCount - alreadyLoadedGroupResults.length;
    groupFilteredResults.forEach(function (searchResult) {
      if ((!searchResult.checkIsContentHtmlLoaded() && searchResult.getTryLoadCounter() < 1 || searchResult.getContentHtml() && !searchResult.checkIsMediaPyRiskScored()) && (groupObjectId ? searchResult.getGroupObjectId() === groupObjectId : true) && (requestObjectId ? searchResult.getRequestObjectId() === requestObjectId : true) && neededCount > 0) {
        person.filteredOpenCorporatesResults.push(searchResult);
        topResults.push(searchResult);
        neededCount--;
      }
    });
  }
  return topResults;
};
MediaSearchPersonV5.prototype.getTopGptRiskResults = function (count) {
  var topResults = this.totalResults.slice(0, count);
  return topResults;
};
MediaSearchPersonV5.prototype.setAlertShouldBeCreated = function (isAlertShouldBeCreated) {
  this.isAlertShouldBeCreated = isAlertShouldBeCreated;
};
MediaSearchPersonV5.prototype.checkAlertShouldBeCreated = function () {
  return this.isAlertShouldBeCreated;
};
module.exports = {
  MediaSearchPersonV5: MediaSearchPersonV5
};

},{"../../common/models/person-v4":683,"../../common/utils/common-v4":687,"../../common/utils/comparisons-v4":688,"../../common/utils/filters-v4":691,"../constants/source-types":892}],894:[function(require,module,exports){
"use strict";

var moment = require("moment");
var _require = require("./media-py-gpt-result-item-v1"),
  MediaPyGptResultItemV1 = _require.MediaPyGptResultItemV1;
function AlephOccrpResultItemV5(title, description, linkUrl, date) {
  MediaPyGptResultItemV1.call(this, title, title, description, description, linkUrl, null);
  this.isFromAlephOccrp = true;
  this.type = "";
  var parsedDate = null;
  if (date) {
    try {
      parsedDate = moment(date);
    } catch (e) {}
  }
  this.date = parsedDate ? parsedDate.toDate() : null;
}
AlephOccrpResultItemV5.prototype = Object.create(MediaPyGptResultItemV1.prototype);
AlephOccrpResultItemV5.prototype.constructor = AlephOccrpResultItemV5;
AlephOccrpResultItemV5.prototype.setType = function (type) {
  this.type = type;
};
AlephOccrpResultItemV5.prototype.checkIsPersonType = function () {
  return this.type === "Person";
};
AlephOccrpResultItemV5.prototype.checkIsDocumentType = function () {
  return this.type === "Document";
};
AlephOccrpResultItemV5.prototype.checkIsCompanyType = function () {
  return this.type === "Company";
};
AlephOccrpResultItemV5.prototype.setTotalRiskScore = function (totalRiskScore, isPersonNamePresented) {
  var riskScore = totalRiskScore;
  if (isPersonNamePresented) {
    riskScore += 0.05;
  } else {
    riskScore -= 0.1;
  }
  this.setRiskScore(riskScore);
  this.setInitialRiskScore(riskScore);
};
module.exports = {
  AlephOccrpResultItemV5: AlephOccrpResultItemV5
};

},{"./media-py-gpt-result-item-v1":901,"moment":680}],895:[function(require,module,exports){
"use strict";

var _require = require("../../../common/utils/comparisons-v4"),
  compareByName = _require.compareByName,
  compareByNgram = _require.compareByNgram,
  compareByFullWord = _require.compareByFullWord,
  compareByCount = _require.compareByCount,
  compareByBaseRisk = _require.compareByBaseRisk;
var _require2 = require("../../../common/utils/filters-v4"),
  onlyUnique = _require2.onlyUnique,
  onlyUniqueByName = _require2.onlyUniqueByName,
  onlyUniqueByNgram = _require2.onlyUniqueByNgram;
var _require3 = require("../../../common/utils/mappers-v4"),
  mapNamedEntity = _require3.mapNamedEntity;
var _require4 = require("./person-info-result-item-v5"),
  PersonInfoResultItemV5 = _require4.PersonInfoResultItemV5;
function AnalyzeInfoResultItemV6(title, titleHtml, description, descriptionHtml, linkUrl, date) {
  PersonInfoResultItemV5.call(this, title, titleHtml, description, descriptionHtml, linkUrl, date);
  this.analyzeNgrams = [];
  this.analyzeKeywords = [];
  this.analyzeRiskKeywords = [];
  this.analyzeRiskPersons = [];
  this.analyzeRiskOrgs = [];
  this.isAnalyzed = false;
  this.mentionedPersons = [];
  this.mentionedOrgs = [];
  this.mentionedLocs = [];
  this.analyzeTopic = undefined;
  this.analyzeTopicProbe = 0;
  this.topMentionedPersonsCount = 5;
  this.topMentionedOrgsCount = 5;
  this.topMentionedLocsCount = 5;
}
AnalyzeInfoResultItemV6.prototype = Object.create(PersonInfoResultItemV5.prototype);
AnalyzeInfoResultItemV6.prototype.constructor = AnalyzeInfoResultItemV6;
AnalyzeInfoResultItemV6.prototype.setIsAnalyzed = function (isAnalyzed) {
  this.isAnalyzed = isAnalyzed;
};
AnalyzeInfoResultItemV6.prototype.checkIsAnalyzed = function () {
  return this.isAnalyzed;
};
AnalyzeInfoResultItemV6.prototype.setAnalyzeNgrams = function (ngrams) {
  this.analyzeNgrams = [].concat(ngrams || []).filter(onlyUniqueByNgram).sort(compareByCount);
};
AnalyzeInfoResultItemV6.prototype.getAnalyzeNgrams = function () {
  return this.analyzeNgrams;
};
AnalyzeInfoResultItemV6.prototype.setAnalyzeKeywords = function (keywords) {
  this.analyzeKeywords = [].concat(keywords || []).filter(onlyUnique);
};
AnalyzeInfoResultItemV6.prototype.getAnalyzeKeywords = function () {
  return this.analyzeKeywords;
};
AnalyzeInfoResultItemV6.prototype.setAnalyzeRiskKeywords = function (risk_keywords) {
  this.analyzeRiskKeywords = [].concat(risk_keywords || []).sort(compareByBaseRisk);
};
AnalyzeInfoResultItemV6.prototype.getAnalyzeRiskKeywords = function () {
  return this.analyzeRiskKeywords;
};
AnalyzeInfoResultItemV6.prototype.setAnalyzeRiskEntities = function (risk_entities) {
  var parsedRiskEntities = (risk_entities || []).filter(function (ne) {
    return ne.db_id;
  }).map(mapNamedEntity);
  this.setAnalyzeRiskPersons(parsedRiskEntities);
  this.setAnalyzeRiskOrgs(parsedRiskEntities);
};
AnalyzeInfoResultItemV6.prototype.setAnalyzeRiskPersons = function (risk_entities) {
  this.analyzeRiskPersons = [].concat(risk_entities || []).filter(function (entity) {
    return entity.label === "PERSON" || entity.type === "PERSON" || entity.label === "PER" || entity.type === "PER";
  }).filter(onlyUniqueByName).sort(compareByName);
};
AnalyzeInfoResultItemV6.prototype.getAnalyzeRiskPersons = function () {
  return this.analyzeRiskPersons;
};
AnalyzeInfoResultItemV6.prototype.setAnalyzeRiskOrgs = function (risk_entities) {
  this.analyzeRiskOrgs = [].concat(risk_entities || []).filter(function (entity) {
    return entity.label === "ORG" || entity.type === "ORG" || entity.label === "ORGANIZATION" || entity.type === "ORGANIZATION";
  }).filter(onlyUniqueByName).sort(compareByName);
};
AnalyzeInfoResultItemV6.prototype.getAnalyzeRiskOrgs = function () {
  return this.analyzeRiskOrgs;
};
AnalyzeInfoResultItemV6.prototype.setAnalyzeTopicInfo = function (data) {
  this.analyzeTopic = null;
  this.analyzeTopicProbe = 0;
  if (data && data.topic) {
    this.analyzeTopic = data.topic;
  }
  if (data && data.topic_prob) {
    this.analyzeTopicProbe = data.topic_prob;
  }
};
AnalyzeInfoResultItemV6.prototype.checkIsTopicAnalyzed = function () {
  return this.analyzeTopic !== undefined;
};
AnalyzeInfoResultItemV6.prototype.getAnalyzeTopic = function () {
  return this.analyzeTopic;
};
AnalyzeInfoResultItemV6.prototype.getAnalyzeTopicProbe = function () {
  return this.analyzeTopicProbe;
};
AnalyzeInfoResultItemV6.prototype.setMentionedEntities = function (named_entities) {
  var mentionedPersons = [];
  var mentionedOrgs = [];
  var mentionedLocs = [];
  var parsedNamedEntities = (named_entities || []).filter(function (ne) {
    return !ne.db_id;
  }).map(mapNamedEntity);
  parsedNamedEntities.forEach(function (ne) {
    if (ne.label === "PERSON" || ne.type === "PERSON" || ne.label === "PER" || ne.type === "PER") {
      mentionedPersons.push(ne);
    }
    if (ne.label === "ORG" || ne.type === "ORG" || ne.label === "ORGANIZATION" || ne.type === "ORGANIZATION") {
      mentionedOrgs.push(ne);
    }
    if (ne.label === "GPE" || ne.type === "GPE" || ne.label === "LOC" || ne.type === "LOC" || ne.label === "LOCATION" || ne.type === "LOCATION") {
      mentionedLocs.push(ne);
    }
  });
  this.setMentionedPersons(mentionedPersons);
  this.setMentionedOrgs(mentionedOrgs);
  this.setMentionedLocs(mentionedLocs);
};
AnalyzeInfoResultItemV6.prototype.setMentionedPersons = function (mentionedPersons) {
  this.mentionedPersons = [].concat(mentionedPersons || []).filter(onlyUniqueByName).sort(compareByCount);
};
AnalyzeInfoResultItemV6.prototype.getMentionedPersons = function () {
  return this.mentionedPersons;
};
AnalyzeInfoResultItemV6.prototype.setMentionedOrgs = function (mentionedOrgs) {
  this.mentionedOrgs = [].concat(mentionedOrgs || []).filter(onlyUniqueByName).sort(compareByCount);
};
AnalyzeInfoResultItemV6.prototype.getMentionedOrgs = function () {
  return this.mentionedOrgs;
};
AnalyzeInfoResultItemV6.prototype.setMentionedLocs = function (mentionedLocs) {
  this.mentionedLocs = [].concat(mentionedLocs || []).filter(onlyUniqueByName).sort(compareByCount);
};
AnalyzeInfoResultItemV6.prototype.getMentionedLocs = function () {
  return this.mentionedLocs;
};
AnalyzeInfoResultItemV6.prototype.setTopMentionedPersonsCount = function (topCount) {
  this.topMentionedPersonsCount = topCount;
};
AnalyzeInfoResultItemV6.prototype.setTopMentionedOrgsCount = function (topCount) {
  this.topMentionedOrgsCount = topCount;
};
AnalyzeInfoResultItemV6.prototype.setTopMentionedLocsCount = function (topCount) {
  this.topMentionedLocsCount = topCount;
};
AnalyzeInfoResultItemV6.prototype.setAnalyzeItems = function (items, type) {
  if (type === "keywords") {
    this.setAnalyzeKeywords(items);
  }
  if (type === "riskKeywords") {
    this.setAnalyzeRiskKeywords(items);
  }
  if (type === "ngrams") {
    this.setAnalyzeNgrams(items);
  }
};
module.exports = {
  AnalyzeInfoResultItemV6: AnalyzeInfoResultItemV6
};

},{"../../../common/utils/comparisons-v4":688,"../../../common/utils/filters-v4":691,"../../../common/utils/mappers-v4":694,"./person-info-result-item-v5":904}],896:[function(require,module,exports){
"use strict";

var _require = require("../../../common/utils/common-v4"),
  generateUUID = _require.generateUUID,
  remapIntervals = _require.remapIntervals,
  getDomain = _require.getDomain,
  getHSLHue = _require.getHSLHue,
  hslToHex = _require.hslToHex;
var _require2 = require("../../../constants/source-types"),
  GOOGLE_SEARCH_SOURCE_CODE = _require2.GOOGLE_SEARCH_SOURCE_CODE,
  GOOGLE_NEWS_SOURCE_CODE = _require2.GOOGLE_NEWS_SOURCE_CODE,
  EXTRA_SOURCE_SOURCE_CODE = _require2.EXTRA_SOURCE_SOURCE_CODE,
  STOCK_MARKETS_SOURCE_CODE = _require2.STOCK_MARKETS_SOURCE_CODE,
  ALEPH_OCCRP_SOURCE_CODE = _require2.ALEPH_OCCRP_SOURCE_CODE,
  OPEN_CORPORATES_SOURCE_CODE = _require2.OPEN_CORPORATES_SOURCE_CODE,
  OPEN_SANCTIONS_SOURCE_CODE = _require2.OPEN_SANCTIONS_SOURCE_CODE;
function BaseResultItemV5(title, titleHtml, description, descriptionHtml, linkUrl, date) {
  this.id = generateUUID();
  this.title = title;
  this.titleHtml = titleHtml;
  this.description = description;
  this.descriptionHtml = descriptionHtml;
  this.linkUrl = linkUrl;
  this.date = date;
  this.extendedSummary = "";
  this.extendedSummaryHtml = "";
  this.domain = getDomain(linkUrl);
  this.initialRiskScore = 0;
  this.riskScore = 0;
  this.isRiskScored = false;
  this.mediaPyRiskScore = 0;
  this.isMediaPyRiskScored = false;
  this.mediaPyRiskScoreColor = "#ffff00";
  this.sentiment = 0;
  this.isSentimentLoaded = false;
  this.mediaPyTitleRiskScore = 0;
  this.mediaPyTitleRiskScoreColor = "#ffff00";
  this.mediaPyNameImportance = 0;
  this.mediaPyNameImportanceColor = "#ffff00";
  this.wordCloudImgBase64 = null;
  this.language = null;
  this.isFromSearchEngine = false;
  this.isFromGoogleNewsRss = false;
  this.isFromStockMarket = false;
  this.isFromExtraSource = false;
  this.isFromAlephOccrp = false;
  this.isFromOpenSanctions = false;
  this.isFromOpenCorporates = false;
  this.isFromMatch = false;
  this.isFromRelevant = false;
  this.itemInfo = {
    itemId: ""
  };
  this.isOpen = false;
  this.isRelevant = false;
  this.tryLoadCounter = 0;
  this.isShouldBePublished = true;
  this.performanceMetrics = {
    get: {
      load: 0
    },
    mediaPy: {
      entities: 0,
      textInfo: 0,
      markup: 0,
      cleanHtml: 0,
      analyzeText: 0,
      summarizeText: 0,
      classifyText: 0,
      specialParsing: 0
    },
    mediaPyGpt: {
      riskAssesment: 0,
      documentAnalysis: 0,
      documentCompression: 0,
      personSummary: 0,
      relatedEntities: 0,
      personMatching: 0,
      negativeContextAnalysis: 0
    }
  };
}
BaseResultItemV5.prototype.setPerformanceMetric = function (sourceType, metricType, elapsedTime) {
  if (this.performanceMetrics && this.performanceMetrics[sourceType] && this.performanceMetrics[sourceType][metricType] === 0) {
    this.performanceMetrics[sourceType][metricType] = elapsedTime;
  }
};
BaseResultItemV5.prototype.getPerformanceMetrics = function () {
  return this.performanceMetrics;
};
BaseResultItemV5.prototype.clearPerformanceMetrics = function () {
  this.performanceMetrics = null;
};
BaseResultItemV5.prototype.getId = function () {
  return this.id;
};
BaseResultItemV5.prototype.getTitle = function () {
  return this.title;
};
BaseResultItemV5.prototype.getTitleHtml = function () {
  return this.titleHtml;
};
BaseResultItemV5.prototype.setDescription = function (description) {
  this.description = description;
};
BaseResultItemV5.prototype.getDescription = function () {
  return this.description;
};
BaseResultItemV5.prototype.setDescriptionHtml = function (descriptionHtml) {
  this.descriptionHtml = descriptionHtml;
};
BaseResultItemV5.prototype.getDescriptionHtml = function () {
  return this.descriptionHtml;
};
BaseResultItemV5.prototype.getLinkUrl = function () {
  return this.linkUrl;
};
BaseResultItemV5.prototype.getDomain = function () {
  return this.domain;
};
BaseResultItemV5.prototype.getDate = function () {
  return this.date;
};
BaseResultItemV5.prototype.setDate = function (date) {
  this.date = date;
};
BaseResultItemV5.prototype.setInitialRiskScore = function (initialRiskScore) {
  this.initialRiskScore = initialRiskScore > 1 ? 1 : initialRiskScore < 0 ? 0 : initialRiskScore;
};
BaseResultItemV5.prototype.getInitialRiskScore = function () {
  return this.initialRiskScore;
};
BaseResultItemV5.prototype.setRiskScore = function (riskScore) {
  this.riskScore = riskScore > 1 ? 1 : riskScore < 0 ? 0 : riskScore;
};
BaseResultItemV5.prototype.getRiskScore = function () {
  return this.riskScore;
};
BaseResultItemV5.prototype.setMediaPyRiskScore = function (mediaPyRiskScore) {
  this.mediaPyRiskScore = mediaPyRiskScore > 1 ? 1 : mediaPyRiskScore < -1 ? -1 : mediaPyRiskScore;
};
BaseResultItemV5.prototype.getMediaPyRiskScore = function () {
  return this.mediaPyRiskScore;
};
BaseResultItemV5.prototype.setMediaPyRiskScoreColor = function (mediaPyRiskScore) {
  var newValue = remapIntervals(mediaPyRiskScore, -1, 1, 0, 1);
  var hue = getHSLHue(newValue);
  this.mediaPyRiskScoreColor = hslToHex(hue, 100, 50);
};
BaseResultItemV5.prototype.setMediaPyTitleRiskScore = function (mediaPyTitleRiskScore) {
  this.mediaPyTitleRiskScore = mediaPyTitleRiskScore > 1 ? 1 : mediaPyTitleRiskScore < -1 ? -1 : mediaPyTitleRiskScore;
};
BaseResultItemV5.prototype.getMediaPyTitleRiskScore = function () {
  return this.mediaPyTitleRiskScore;
};
BaseResultItemV5.prototype.setMediaPyTitleRiskScoreColor = function (mediaPyTitleRiskScore) {
  var newValue = remapIntervals(mediaPyTitleRiskScore, -1, 1, 0, 1);
  var hue = getHSLHue(newValue);
  this.mediaPyTitleRiskScoreColor = hslToHex(hue, 100, 50);
};
BaseResultItemV5.prototype.setMediaPyNameImportance = function (mediaPyNameImportance) {
  this.mediaPyNameImportance = mediaPyNameImportance > 1 ? 1 : mediaPyNameImportance < -1 ? -1 : mediaPyNameImportance;
};
BaseResultItemV5.prototype.getMediaPyNameImportance = function () {
  return this.mediaPyNameImportance;
};
BaseResultItemV5.prototype.setMediaPyNameImportanceColor = function (nameImportance) {
  var newValue = remapIntervals(nameImportance, -1, 1, 0, 1);
  var hue = getHSLHue(newValue);
  this.mediaPyNameImportanceColor = hslToHex(hue, 100, 50);
};
BaseResultItemV5.prototype.setSentiment = function (sentiment) {
  this.sentiment = sentiment;
};
BaseResultItemV5.prototype.getSentiment = function () {
  return this.sentiment;
};
BaseResultItemV5.prototype.setRiskScored = function (flag) {
  this.isRiskScored = flag;
};
BaseResultItemV5.prototype.checkIsRiskScored = function () {
  return this.isRiskScored;
};
BaseResultItemV5.prototype.setMediaPyRiskScored = function (flag) {
  this.isMediaPyRiskScored = flag;
};
BaseResultItemV5.prototype.checkIsMediaPyRiskScored = function () {
  return this.isMediaPyRiskScored;
};
BaseResultItemV5.prototype.setSentimentLoaded = function (flag) {
  this.isSentimentLoaded = flag;
};
BaseResultItemV5.prototype.checkIsSentimentLoaded = function () {
  return this.isSentimentLoaded;
};
BaseResultItemV5.prototype.setExtendedSummary = function (extendedSummary) {
  this.extendedSummary = extendedSummary;
};
BaseResultItemV5.prototype.getExtendedSummary = function () {
  return this.extendedSummary;
};
BaseResultItemV5.prototype.setExtendedSummaryHtml = function (extendedSummaryHtml) {
  this.extendedSummaryHtml = extendedSummaryHtml;
};
BaseResultItemV5.prototype.getExtendedSummaryHtml = function () {
  return this.extendedSummaryHtml;
};
BaseResultItemV5.prototype.setFromSource = function (isFromSearchEngine, isFromGoogleNewsRss, isFromExtraSource, isFromStockMarket, isFromAlephOccrp, isFromOpenSanctions, isFromOpenCorporates, isFromMatch) {
  this.isFromSearchEngine = isFromSearchEngine;
  this.isFromGoogleNewsRss = isFromGoogleNewsRss;
  this.isFromExtraSource = isFromExtraSource;
  this.isFromStockMarket = isFromStockMarket;
  this.isFromAlephOccrp = isFromAlephOccrp;
  this.isFromOpenSanctions = isFromOpenSanctions;
  this.isFromOpenCorporates = isFromOpenCorporates;
  this.isFromMatch = isFromMatch;
};
BaseResultItemV5.prototype.checkIsFromSearchEngine = function () {
  return this.isFromSearchEngine;
};
BaseResultItemV5.prototype.checkIsFromGoogleNewsRss = function () {
  return this.isFromGoogleNewsRss;
};
BaseResultItemV5.prototype.checkIsFromExtraSource = function () {
  return this.isFromExtraSource;
};
BaseResultItemV5.prototype.checkIsFromStockMarket = function () {
  return this.isFromStockMarket;
};
BaseResultItemV5.prototype.checkIsFromAlephOccrp = function () {
  return this.isFromAlephOccrp;
};
BaseResultItemV5.prototype.checkIsFromOpenSanctions = function () {
  return this.isFromOpenSanctions;
};
BaseResultItemV5.prototype.checkIsFromOpenCorporates = function () {
  return this.isFromOpenCorporates;
};
BaseResultItemV5.prototype.checkIsFromMatch = function () {
  return this.isFromMatch;
};
BaseResultItemV5.prototype.setFromRelevant = function (isFromRelevant) {
  this.isFromRelevant = isFromRelevant;
};
BaseResultItemV5.prototype.checkIsFromRelevant = function () {
  return this.isFromRelevant;
};
BaseResultItemV5.prototype.setWordCloudImg = function (base64Data) {
  this.wordCloudImgBase64 = base64Data;
};
BaseResultItemV5.prototype.getWordCloudImg = function () {
  return this.wordCloudImgBase64;
};
BaseResultItemV5.prototype.setLanguage = function (language) {
  this.language = language;
};
BaseResultItemV5.prototype.getLanguage = function () {
  return this.language;
};
BaseResultItemV5.prototype.getTryLoadCounter = function () {
  return this.tryLoadCounter;
};
BaseResultItemV5.prototype.incTryLoadCounter = function () {
  this.tryLoadCounter++;
};
BaseResultItemV5.prototype.setRelevant = function (isRelevant) {
  this.isRelevant = isRelevant;
};
BaseResultItemV5.prototype.checkIsRelevant = function () {
  return this.isRelevant;
};
BaseResultItemV5.prototype.setOpen = function (isOpen) {
  this.isOpen = isOpen;
};
BaseResultItemV5.prototype.checkIsOpen = function () {
  return this.isOpen;
};
BaseResultItemV5.prototype.setTotalSentimentRiskScore = function () {
  var riskScore = this.initialRiskScore;
  if (this.sentiment >= 0) {
    var halfScoreToZero = (riskScore - 0) / 2;
    riskScore = riskScore - halfScoreToZero * this.sentiment;
  } else {
    if (this.sentiment <= -0.5) {
      var halfScoreToOne = (1 - riskScore) / 2;
      riskScore = riskScore + halfScoreToOne * remapIntervals(Math.abs(this.sentiment), 0.5, 1, 0, 1);
    }
  }
  this.setRiskScore(riskScore);
};
BaseResultItemV5.prototype.setItemInfo = function (itemId) {
  this.itemInfo.itemId = itemId;
};
BaseResultItemV5.prototype.getItemId = function () {
  return this.itemInfo.itemId;
};
BaseResultItemV5.prototype.setShouldBePublished = function (shouldBePublished) {
  this.isShouldBePublished = shouldBePublished;
};
BaseResultItemV5.prototype.checkShouldBePublished = function () {
  return this.isShouldBePublished;
};
BaseResultItemV5.prototype.getType = function () {
  if (this.isFromSearchEngine) return GOOGLE_SEARCH_SOURCE_CODE;
  if (this.isFromGoogleNewsRss) return GOOGLE_NEWS_SOURCE_CODE;
  if (this.isFromExtraSource) return EXTRA_SOURCE_SOURCE_CODE;
  if (this.isFromAlephOccrp) return ALEPH_OCCRP_SOURCE_CODE;
  if (this.isFromStockMarket) return STOCK_MARKETS_SOURCE_CODE;
  if (this.isFromOpenCorporates) return OPEN_CORPORATES_SOURCE_CODE;
  if (this.isFromOpenSanctions) return OPEN_SANCTIONS_SOURCE_CODE;
};
module.exports = {
  BaseResultItemV5: BaseResultItemV5
};

},{"../../../common/utils/common-v4":687,"../../../constants/source-types":697}],897:[function(require,module,exports){
"use strict";

var _require = require("./source-result-item-v5"),
  SourceResultItemV5 = _require.SourceResultItemV5;
function DocumentInfoResultItemV5(title, titleHtml, description, descriptionHtml, linkUrl, date) {
  SourceResultItemV5.call(this, title, titleHtml, description, descriptionHtml, linkUrl, date);
  this.contentHtml = undefined;
  this.contentElement = undefined;
  this.contentElementText = undefined;
  this.contentMarkupHtml = undefined;
  this.contentMarkupElement = undefined;
  this.isHtmlCleared = false;
  this.entityNames = [];
  this.areEntitiesLoaded = false;
  this.areEntitiesHighlighted = false;
  this.keywords = [];
  this.areKeywordsHighlighted = false;
}
DocumentInfoResultItemV5.prototype = Object.create(SourceResultItemV5.prototype);
DocumentInfoResultItemV5.prototype.constructor = DocumentInfoResultItemV5;
DocumentInfoResultItemV5.prototype.setContentHtml = function (contentHtml) {
  this.contentHtml = contentHtml;
};
DocumentInfoResultItemV5.prototype.getContentHtml = function () {
  return this.contentHtml;
};
DocumentInfoResultItemV5.prototype.checkIsContentHtmlLoaded = function () {
  return this.contentHtml !== undefined && this.contentHtml !== null;
};
DocumentInfoResultItemV5.prototype.setContentElement = function (contentElement) {
  this.contentElement = contentElement;
};
DocumentInfoResultItemV5.prototype.getContentElement = function () {
  return this.contentElement;
};
DocumentInfoResultItemV5.prototype.setContentElementText = function (contentElementText) {
  this.contentElementText = contentElementText;
};
DocumentInfoResultItemV5.prototype.getContentElementText = function () {
  return this.contentElementText;
};
DocumentInfoResultItemV5.prototype.setContentMarkupHtml = function (contentMarkupHtml) {
  this.contentMarkupHtml = contentMarkupHtml;
};
DocumentInfoResultItemV5.prototype.getContentMarkupHtml = function () {
  return this.contentMarkupHtml;
};
DocumentInfoResultItemV5.prototype.checkIsContentMarkupHtmlLoaded = function () {
  return this.contentMarkupHtml !== undefined && this.contentMarkupHtml !== null;
};
DocumentInfoResultItemV5.prototype.setContentMarkupElement = function (contentMarkupElement) {
  this.contentMarkupElement = contentMarkupElement;
};
DocumentInfoResultItemV5.prototype.getContentMarkupElement = function () {
  return this.contentMarkupElement;
};
DocumentInfoResultItemV5.prototype.setHtmlCleared = function (flag) {
  this.isHtmlCleared = flag;
};
DocumentInfoResultItemV5.prototype.checkIsHtmlCleared = function () {
  return this.isHtmlCleared;
};
DocumentInfoResultItemV5.prototype.setEntityNames = function (entityNames) {
  this.entityNames = entityNames;
};
DocumentInfoResultItemV5.prototype.getEntityNames = function () {
  return this.entityNames;
};
DocumentInfoResultItemV5.prototype.setEntitiesLoaded = function (flag) {
  this.areEntitiesLoaded = flag;
};
DocumentInfoResultItemV5.prototype.checkAreEntitiesLoaded = function () {
  return this.areEntitiesLoaded;
};
DocumentInfoResultItemV5.prototype.setEntitiesHighlighted = function (flag) {
  this.areEntitiesHighlighted = flag;
};
DocumentInfoResultItemV5.prototype.checkAreEntitiesHighlighted = function () {
  return this.areEntitiesHighlighted;
};
DocumentInfoResultItemV5.prototype.setKeywords = function (keywords) {
  this.keywords = keywords;
};
DocumentInfoResultItemV5.prototype.getKeywords = function () {
  return this.keywords;
};
DocumentInfoResultItemV5.prototype.setKeywordsHighlighted = function (flag) {
  this.areKeywordsHighlighted = flag;
};
DocumentInfoResultItemV5.prototype.checkAreKeywordsHighlighted = function () {
  return this.areKeywordsHighlighted;
};
module.exports = {
  DocumentInfoResultItemV5: DocumentInfoResultItemV5
};

},{"./source-result-item-v5":906}],898:[function(require,module,exports){
"use strict";

var _require = require("./media-py-gpt-result-item-v1"),
  MediaPyGptResultItemV1 = _require.MediaPyGptResultItemV1;
function ExtraSourceResultItemV5(title, description, linkUrl, source) {
  MediaPyGptResultItemV1.call(this, title, title, description, description, linkUrl, null);
  this.source = source;
  this.isFromExtraSource = true;
  this.relevance = true;
}
ExtraSourceResultItemV5.prototype = Object.create(MediaPyGptResultItemV1.prototype);
ExtraSourceResultItemV5.prototype.constructor = ExtraSourceResultItemV5;
ExtraSourceResultItemV5.prototype.getSource = function () {
  return this.source;
};
ExtraSourceResultItemV5.prototype.setRelevance = function (relevance) {
  this.relevance = relevance;
};
ExtraSourceResultItemV5.prototype.getRelevance = function () {
  return this.relevance;
};
module.exports = {
  ExtraSourceResultItemV5: ExtraSourceResultItemV5
};

},{"./media-py-gpt-result-item-v1":901}],899:[function(require,module,exports){
"use strict";

var moment = require("moment");
var _require = require("./media-py-gpt-result-item-v1"),
  MediaPyGptResultItemV1 = _require.MediaPyGptResultItemV1;
function GoogleNewsRssResultItemV5(title, description, linkUrl, date) {
  MediaPyGptResultItemV1.call(this, title, title, description, description, linkUrl, null);
  this.isFromGoogleNewsRss = true;
  var parsedDate = null;
  if (date) {
    try {
      parsedDate = moment(date);
    } catch (e) {}
  }
  this.date = parsedDate ? parsedDate.toDate() : null;
}
GoogleNewsRssResultItemV5.prototype = Object.create(MediaPyGptResultItemV1.prototype);
GoogleNewsRssResultItemV5.prototype.constructor = GoogleNewsRssResultItemV5;
GoogleNewsRssResultItemV5.prototype.setTotalRiskScore = function (totalRiskScore, isPersonNamePresented) {
  var riskScore = totalRiskScore;
  if (isPersonNamePresented) {
    riskScore += 0.05;
  } else {
    riskScore -= 0.1;
  }
  this.setRiskScore(riskScore);
  this.setInitialRiskScore(riskScore);
};
module.exports = {
  GoogleNewsRssResultItemV5: GoogleNewsRssResultItemV5
};

},{"./media-py-gpt-result-item-v1":901,"moment":680}],900:[function(require,module,exports){
"use strict";

var _require = require("./base-result-item-v5"),
  BaseResultItemV5 = _require.BaseResultItemV5;
function MatchResultItemV5(title, description, linkUrl) {
  BaseResultItemV5.call(this, title, title, description, description, linkUrl, null);
  this.isFromMatch = true;
  this.matchItem = null;
}
MatchResultItemV5.prototype = Object.create(BaseResultItemV5.prototype);
MatchResultItemV5.prototype.constructor = MatchResultItemV5;
MatchResultItemV5.prototype.setMatchItem = function (matchItem) {
  this.matchItem = matchItem;
};
MatchResultItemV5.prototype.getMatchItem = function () {
  return this.matchItem;
};
MatchResultItemV5.fromMatchPerson = function (data) {
  var firstName = data.matchItem.list["First_Name"] || "";
  var lastName = data.matchItem.list["Last_Name"] || "";
  var linkUrl = data.linkUrl + "&matchid=" + data.matchItem.id;
  var riskScore = data.matchItem["Similarity"] || 0;
  var description = data.matchItem.list["Case"] || "";
  if (data.matchItem.list["Function"]) {
    data.matchItem.list["Function"].split("; OTHER FUNCTION: ").forEach(function (row) {
      var func = ((row.split(" CATEGORY: ")[0] || "").split(" NOT IN CHARGE SINCE: ")[0] || "").trim();
      var category = (row.split(" CATEGORY: ")[1] || "").trim();
      var notInCharge = ((row.split(" CATEGORY: ")[0] || "").split(" NOT IN CHARGE SINCE: ")[1] || "").trim();
      if (description) {
        description += "\n\n";
      }
      description += func;
      description += "\n" + category;
      description += "\n" + notInCharge;
    });
  }
  var newMatchResult = new MatchResultItemV5(firstName + " " + lastName, description, linkUrl);
  newMatchResult.setRiskScore(riskScore);
  newMatchResult.setRiskScored(true);
  newMatchResult.setMediaPyRiskScore(riskScore);
  newMatchResult.setMediaPyRiskScored(true);
  newMatchResult.setMediaPyRiskScoreColor(riskScore);
  newMatchResult.setSentiment(0);
  newMatchResult.setSentimentLoaded(true);
  newMatchResult.setMediaPyTitleRiskScore(0);
  newMatchResult.setMediaPyTitleRiskScoreColor(0);
  newMatchResult.setMediaPyNameImportance(0);
  newMatchResult.setMediaPyNameImportanceColor(0);
  newMatchResult.setMatchItem(data.matchItem.list);
  return newMatchResult;
};
module.exports = {
  MatchResultItemV5: MatchResultItemV5
};

},{"./base-result-item-v5":896}],901:[function(require,module,exports){
"use strict";

var _require = require("../../../common/utils/comparisons-v4"),
  compareByValue = _require.compareByValue;
var _require2 = require("../../../common/utils/filters-v4"),
  onlyUnique = _require2.onlyUnique;
var _require3 = require("./analyze-info-result-item-v6"),
  AnalyzeInfoResultItemV6 = _require3.AnalyzeInfoResultItemV6;
function MediaPyGptResultItemV1(title, titleHtml, description, descriptionHtml, linkUrl, date) {
  AnalyzeInfoResultItemV6.call(this, title, titleHtml, description, descriptionHtml, linkUrl, date);
  this.gptRiskAssScore = 0;
  this.gptRiskAssExplanation = "";
  this.gptDocAnalysSummary = "";
  this.gptDocAnalysSentiment = "";
  this.gptDocAnalysTopic = "";
  this.gptDocAnalysKeywords = [];
  this.gptDocAnalysPubType = "";
  this.gptPersSumSummary = "";
  this.gptPersSumDetails = "";
  this.gptRelatedEntitiesPersons = [];
  this.gptRelatedEntitiesOrgs = [];
  this.gptPersonMatchIsMatch = false;
  this.gptAllegations = [];
  this.gptEvidence = [];
  this.topGptRelatedEntitiesPersonsCount = 5;
  this.topGptRelatedEntitiesOrgsCount = 5;
}
MediaPyGptResultItemV1.prototype = Object.create(AnalyzeInfoResultItemV6.prototype);
MediaPyGptResultItemV1.prototype.constructor = MediaPyGptResultItemV1;
MediaPyGptResultItemV1.prototype.setGptRiskScore = function (riskScore) {
  this.gptRiskAssScore = riskScore;
};
MediaPyGptResultItemV1.prototype.getGptRiskScore = function () {
  return this.gptRiskAssScore;
};
MediaPyGptResultItemV1.prototype.setGptRiskExplanation = function (riskExplanation) {
  this.gptRiskAssExplanation = riskExplanation;
};
MediaPyGptResultItemV1.prototype.getGptRiskExplanation = function () {
  return this.gptRiskAssExplanation;
};
MediaPyGptResultItemV1.prototype.setGptDocAnalysSummary = function (summary) {
  this.gptDocAnalysSummary = summary;
};
MediaPyGptResultItemV1.prototype.getGptDocAnalysSummary = function () {
  return this.gptDocAnalysSummary;
};
MediaPyGptResultItemV1.prototype.setGptDocAnalysSentiment = function (sentiment) {
  this.gptDocAnalysSentiment = sentiment;
};
MediaPyGptResultItemV1.prototype.getGptDocAnalysSentiment = function () {
  return this.gptDocAnalysSentiment;
};
MediaPyGptResultItemV1.prototype.setGptDocAnalysTopic = function (topic) {
  this.gptDocAnalysTopic = topic;
};
MediaPyGptResultItemV1.prototype.getGptDocAnalysTopic = function () {
  return this.gptDocAnalysTopic;
};
MediaPyGptResultItemV1.prototype.setGptDocAnalysKeywords = function (keywords) {
  this.gptDocAnalysKeywords = [].concat(keywords || []).filter(onlyUnique).sort(compareByValue);
};
MediaPyGptResultItemV1.prototype.getGptDocAnalysKeywords = function () {
  return this.gptDocAnalysKeywords;
};
MediaPyGptResultItemV1.prototype.setGptDocAnalysPubType = function (pubType) {
  this.gptDocAnalysPubType = pubType;
};
MediaPyGptResultItemV1.prototype.getGptDocAnalysPubType = function () {
  return this.gptDocAnalysPubType;
};
MediaPyGptResultItemV1.prototype.setGptPersSumSummary = function (summary) {
  this.gptPersSumSummary = summary;
};
MediaPyGptResultItemV1.prototype.getGptPersSumSummary = function () {
  return this.gptPersSumSummary;
};
MediaPyGptResultItemV1.prototype.setGptPersSumDetails = function (details) {
  this.gptPersSumDetails = details;
};
MediaPyGptResultItemV1.prototype.getGptPersSumDetails = function () {
  return this.gptPersSumDetails;
};
MediaPyGptResultItemV1.prototype.setGptRelatedPersons = function (persons) {
  this.gptRelatedEntitiesPersons = [].concat(persons || []).filter(onlyUnique).sort(compareByValue);
};
MediaPyGptResultItemV1.prototype.getGptRelatedPersons = function () {
  return this.gptRelatedEntitiesPersons;
};
MediaPyGptResultItemV1.prototype.setGptRelatedOrganizations = function (organizations) {
  this.gptRelatedEntitiesOrgs = [].concat(organizations || []).filter(onlyUnique).sort(compareByValue);
};
MediaPyGptResultItemV1.prototype.getGptRelatedOrganizations = function () {
  return this.gptRelatedEntitiesOrgs;
};
MediaPyGptResultItemV1.prototype.setGptPersonIsMatch = function (isMatch) {
  this.gptPersonMatchIsMatch = isMatch;
};
MediaPyGptResultItemV1.prototype.getGptPersonIsMatch = function () {
  return this.gptPersonMatchIsMatch;
};
MediaPyGptResultItemV1.prototype.setGptAllegations = function (allegations) {
  this.gptAllegations = [].concat(allegations || []);
};
MediaPyGptResultItemV1.prototype.getGptAllegations = function () {
  return this.gptAllegations;
};
MediaPyGptResultItemV1.prototype.setGptEvidence = function (evidence) {
  this.gptEvidence = [].concat(evidence || []);
};
MediaPyGptResultItemV1.prototype.getGptEvidence = function () {
  return this.gptEvidence;
};
MediaPyGptResultItemV1.prototype.setTopGptRelatedEntitiesPersonsCount = function (topCount) {
  this.topGptRelatedEntitiesPersonsCount = topCount;
};
MediaPyGptResultItemV1.prototype.setTopGptRelatedEntitiesOrgsCount = function (topCount) {
  this.topGptRelatedEntitiesOrgsCount = topCount;
};
MediaPyGptResultItemV1.prototype.setGptRelatedItems = function (items, type) {
  if (type === "persons") {
    this.setGptRelatedPersons(items);
  }
  if (type === "orgs") {
    this.setGptRelatedOrganizations(items);
  }
};
module.exports = {
  MediaPyGptResultItemV1: MediaPyGptResultItemV1
};

},{"../../../common/utils/comparisons-v4":688,"../../../common/utils/filters-v4":691,"./analyze-info-result-item-v6":895}],902:[function(require,module,exports){
"use strict";

var _require = require("./media-py-gpt-result-item-v1"),
  MediaPyGptResultItemV1 = _require.MediaPyGptResultItemV1;
function OpenCorporatesResultItemV5(title, description, linkUrl) {
  MediaPyGptResultItemV1.call(this, title, title, description, description, linkUrl, null);
  this.isFromOpenCorporates = true;
  this.type = "";
}
OpenCorporatesResultItemV5.prototype = Object.create(MediaPyGptResultItemV1.prototype);
OpenCorporatesResultItemV5.prototype.constructor = OpenCorporatesResultItemV5;
OpenCorporatesResultItemV5.prototype.setType = function (type) {
  this.type = type;
};
OpenCorporatesResultItemV5.prototype.checkIsPersonType = function () {
  return this.type === "Person";
};
OpenCorporatesResultItemV5.prototype.checkIsDocumentType = function () {
  return this.type === "Document";
};
OpenCorporatesResultItemV5.prototype.checkIsCompanyType = function () {
  return this.type === "Company";
};
OpenCorporatesResultItemV5.prototype.setTotalRiskScore = function (totalRiskScore, isPersonNamePresented) {
  var riskScore = totalRiskScore;
  if (isPersonNamePresented) {
    riskScore += 0.05;
  } else {
    riskScore -= 0.1;
  }
  this.setRiskScore(riskScore);
  this.setInitialRiskScore(riskScore);
};
module.exports = {
  OpenCorporatesResultItemV5: OpenCorporatesResultItemV5
};

},{"./media-py-gpt-result-item-v1":901}],903:[function(require,module,exports){
"use strict";

var _require = require("./media-py-gpt-result-item-v1"),
  MediaPyGptResultItemV1 = _require.MediaPyGptResultItemV1;
function OpenSanctionsResultItemV5(title, description, linkUrl) {
  MediaPyGptResultItemV1.call(this, title, title, description, description, linkUrl, null);
  this.isFromOpenSanctions = true;
  this.type = "";
  this.entityId = "";
  this.source = "opensanctions";
  this.relevance = true;
}
OpenSanctionsResultItemV5.prototype = Object.create(MediaPyGptResultItemV1.prototype);
OpenSanctionsResultItemV5.prototype.constructor = OpenSanctionsResultItemV5;
OpenSanctionsResultItemV5.prototype.getSource = function () {
  return this.source;
};
OpenSanctionsResultItemV5.prototype.setRelevance = function (relevance) {
  this.relevance = relevance;
};
OpenSanctionsResultItemV5.prototype.getRelevance = function () {
  return this.relevance;
};
OpenSanctionsResultItemV5.prototype.setType = function (type) {
  this.type = type;
};
OpenSanctionsResultItemV5.prototype.checkIsPersonType = function () {
  return this.type === "Person";
};
OpenSanctionsResultItemV5.prototype.checkIsDocumentType = function () {
  return this.type === "Document";
};
OpenSanctionsResultItemV5.prototype.checkIsCompanyType = function () {
  return this.type === "Company";
};
OpenSanctionsResultItemV5.prototype.setEntityId = function (id) {
  this.entityId = id;
};
OpenSanctionsResultItemV5.prototype.getEntityId = function () {
  return this.entityId;
};
OpenSanctionsResultItemV5.prototype.setTotalRiskScore = function (totalRiskScore, isPersonNamePresented) {
  var riskScore = totalRiskScore;
  if (isPersonNamePresented) {
    riskScore += 0.05;
  } else {
    riskScore -= 0.1;
  }
  this.setRiskScore(riskScore);
  this.setInitialRiskScore(riskScore);
};
module.exports = {
  OpenSanctionsResultItemV5: OpenSanctionsResultItemV5
};

},{"./media-py-gpt-result-item-v1":901}],904:[function(require,module,exports){
"use strict";

var _require = require("../../../common/utils/strings-v4"),
  checkPersonIsMentionedInText = _require.checkPersonIsMentionedInText,
  getWordSynonims = _require.getWordSynonims;
var _require2 = require("../../../common/utils/filters-v4"),
  onlyUnique = _require2.onlyUnique;
var _require3 = require("./document-info-result-item-v5"),
  DocumentInfoResultItemV5 = _require3.DocumentInfoResultItemV5;
function PersonInfoResultItemV5(title, titleHtml, description, descriptionHtml, linkUrl, date) {
  DocumentInfoResultItemV5.call(this, title, titleHtml, description, descriptionHtml, linkUrl, date);
  this.personInfo = {
    personId: "",
    firstName: "",
    lastName: "",
    fullName: "",
    isCompany: false,
    synonims: [],
    keywords: []
  };
  this.extendedPersonInfo = {
    openSanctionsInfo: {
      entity: {
        name: []
      }
    }
  };
  this.isPersonNamePresented = false;
}
PersonInfoResultItemV5.prototype = Object.create(DocumentInfoResultItemV5.prototype);
PersonInfoResultItemV5.prototype.constructor = PersonInfoResultItemV5;
PersonInfoResultItemV5.prototype.setExtendedPersonInfo = function (openSanctionsInfo) {
  this.extendedPersonInfo.openSanctionsInfo = openSanctionsInfo;
};
PersonInfoResultItemV5.prototype.getExtendedPersonInfo = function () {
  return this.extendedPersonInfo.openSanctionsInfo;
};
PersonInfoResultItemV5.prototype.setPersonInfo = function (personId, firstName, lastName, fullName, isCompany, keywords) {
  this.personInfo.personId = personId;
  this.personInfo.firstName = firstName;
  this.personInfo.lastName = lastName;
  this.personInfo.fullName = fullName;
  this.personInfo.isCompany = isCompany;
  this.personInfo.keywords = keywords;
  this.personInfo.synonims = [];
};
PersonInfoResultItemV5.prototype.getPersonId = function () {
  return this.personInfo.personId;
};
PersonInfoResultItemV5.prototype.getPersonFirstName = function () {
  return this.personInfo.firstName;
};
PersonInfoResultItemV5.prototype.getPersonLastName = function () {
  return this.personInfo.lastName;
};
PersonInfoResultItemV5.prototype.getPersonFullName = function () {
  return this.personInfo.fullName;
};
PersonInfoResultItemV5.prototype.checkIsCompany = function () {
  return this.personInfo.isCompany;
};
PersonInfoResultItemV5.prototype.getPersonKeywords = function () {
  return this.personInfo.keywords;
};
PersonInfoResultItemV5.prototype.setPersonSynonims = function (personSynonims) {
  this.personInfo.synonims = personSynonims;
};
PersonInfoResultItemV5.prototype.getPersonSynonims = function () {
  return this.personInfo.synonims;
};
PersonInfoResultItemV5.prototype.checkPersonIsMentionedInSummary = function (isExactPersonName) {
  var isPersonNamePresented = false;
  var firstName = this.getPersonFirstName().toLowerCase();
  var lastName = this.getPersonLastName().toLowerCase();
  var fullName = this.getPersonFullName().toLowerCase();
  var title = this.title.toLowerCase();
  var description = this.description.toLowerCase();
  if (isExactPersonName) {
    isPersonNamePresented = title.indexOf(fullName.toLowerCase()) > -1 || description.indexOf(fullName.toLowerCase()) > -1 || title.indexOf(firstName.toLowerCase()) > -1 || description.indexOf(firstName.toLowerCase()) > -1 || title.indexOf(lastName.toLowerCase()) > -1 || description.indexOf(lastName.toLowerCase()) > -1;
  } else {
    isPersonNamePresented = title.indexOf(fullName) > -1 || description.indexOf(fullName) > -1;
    if (!isPersonNamePresented && firstName != lastName) {
      isPersonNamePresented = checkPersonIsMentionedInText(firstName, lastName, title) || checkPersonIsMentionedInText(firstName, lastName, description);
    }
  }
  return isPersonNamePresented;
};
PersonInfoResultItemV5.prototype.getPersonSynonimsFromSummary = function () {
  var firstName = this.getPersonFirstName().toLowerCase();
  var lastName = this.getPersonLastName().toLowerCase();
  var title = this.title.toLowerCase();
  var description = this.description.toLowerCase();
  var shouldCheckFirstName = firstName.length >= 3;
  var shouldCheckLastName = lastName.length >= 5;
  var synonims = [];
  if (shouldCheckFirstName) {
    synonims = synonims.concat(getWordSynonims(firstName, title, firstName.length >= 5 ? 2 : 1)).concat(getWordSynonims(firstName, description, firstName.length >= 5 ? 2 : 1));
  }
  if (shouldCheckLastName) {
    synonims = synonims.concat(getWordSynonims(lastName, title, lastName.length >= 5 ? 2 : 1)).concat(getWordSynonims(lastName, description, lastName.length >= 5 ? 2 : 1));
  }
  synonims = synonims.filter(onlyUnique);
  return synonims;
};
PersonInfoResultItemV5.prototype.setPersonNamePresented = function (isPersonNamePresented) {
  this.isPersonNamePresented = isPersonNamePresented;
};
PersonInfoResultItemV5.prototype.checkIsPersonNamePresented = function () {
  return this.isPersonNamePresented;
};
module.exports = {
  PersonInfoResultItemV5: PersonInfoResultItemV5
};

},{"../../../common/utils/filters-v4":691,"../../../common/utils/strings-v4":696,"./document-info-result-item-v5":897}],905:[function(require,module,exports){
"use strict";

var _require = require("./media-py-gpt-result-item-v1"),
  MediaPyGptResultItemV1 = _require.MediaPyGptResultItemV1;
function SearchEngineResultItemV5(title, titleHtml, description, descriptionHtml, linkUrl, date) {
  MediaPyGptResultItemV1.call(this, title, titleHtml, description, descriptionHtml, linkUrl, date);
  this.isFromSearchEngine = true;
  this.requestInfo = {
    requestRiskScore: 0,
    searchConfigId: 0,
    sortBy: "",
    positionIdx: 0
  };
  this.totalResultsCountRiskScoreAdditive = 0;
  this.pubYearRiskScoreAdditive = 0;
}
SearchEngineResultItemV5.prototype = Object.create(MediaPyGptResultItemV1.prototype);
SearchEngineResultItemV5.prototype.constructor = SearchEngineResultItemV5;
SearchEngineResultItemV5.prototype.setRequestInfo = function (requestRiskScore, searchConfigId, sortBy, positionIdx) {
  this.requestInfo.requestRiskScore = requestRiskScore;
  this.requestInfo.searchConfigId = searchConfigId;
  this.requestInfo.sortBy = sortBy;
  this.requestInfo.positionIdx = positionIdx;
  this.setRiskScore(requestRiskScore);
  this.setInitialRiskScore(requestRiskScore);
};
SearchEngineResultItemV5.prototype.getRequestRiskScore = function () {
  return this.requestInfo.requestRiskScore;
};
SearchEngineResultItemV5.prototype.getSearchConfigId = function () {
  return this.requestInfo.searchConfigId;
};
SearchEngineResultItemV5.prototype.getSortBy = function () {
  return this.requestInfo.sortBy;
};
SearchEngineResultItemV5.prototype.getPositionIdx = function () {
  return this.requestInfo.positionIdx;
};
SearchEngineResultItemV5.prototype.setRiskScoreAdditives = function (totalResultsCountRiskScoreAdditive, pubYearRiskScoreAdditive) {
  this.totalResultsCountRiskScoreAdditive = totalResultsCountRiskScoreAdditive;
  this.pubYearRiskScoreAdditive = pubYearRiskScoreAdditive;
};
SearchEngineResultItemV5.prototype.getSummaryKeywords = function (allKeywords) {
  var title = this.title.toLowerCase();
  var description = this.description.toLowerCase();
  var summaryKeywords = allKeywords.filter(function (keyword) {
    return title.indexOf(keyword.toLowerCase()) > -1 || description.indexOf(keyword.toLowerCase()) > -1;
  });
  return summaryKeywords;
};
SearchEngineResultItemV5.prototype.setTotalRiskScore = function (totalRiskScore, isPersonNamePresented) {
  var riskScore = totalRiskScore + (this.totalResultsCountRiskScoreAdditive ? this.totalResultsCountRiskScoreAdditive : 0) + (this.pubYearRiskScoreAdditive ? this.pubYearRiskScoreAdditive : 0);
  if (isPersonNamePresented) {
    riskScore += 0.05;
  } else {
    riskScore -= 0.1;
  }
  this.setRiskScore(riskScore);
  this.setInitialRiskScore(riskScore);
};
module.exports = {
  SearchEngineResultItemV5: SearchEngineResultItemV5
};

},{"./media-py-gpt-result-item-v1":901}],906:[function(require,module,exports){
"use strict";

var _require = require("./base-result-item-v5"),
  BaseResultItemV5 = _require.BaseResultItemV5;
function SourceResultItemV5(title, titleHtml, description, descriptionHtml, linkUrl, date) {
  BaseResultItemV5.call(this, title, titleHtml, description, descriptionHtml, linkUrl, date);
  this.groupInfo = {
    requestObjectId: "",
    groupObjectId: ""
  };
  this.scoreMode = null;
}
SourceResultItemV5.prototype = Object.create(BaseResultItemV5.prototype);
SourceResultItemV5.prototype.constructor = SourceResultItemV5;
SourceResultItemV5.prototype.setGroupInfo = function (requestObjectId, groupObjectId) {
  this.groupInfo.requestObjectId = requestObjectId;
  this.groupInfo.groupObjectId = groupObjectId;
};
SourceResultItemV5.prototype.setScoreMode = function (scoreMode) {
  this.scoreMode = scoreMode;
};
SourceResultItemV5.prototype.getScoreMode = function () {
  return this.scoreMode;
};
SourceResultItemV5.prototype.getRequestObjectId = function () {
  return this.groupInfo.requestObjectId;
};
SourceResultItemV5.prototype.getGroupObjectId = function () {
  return this.groupInfo.groupObjectId;
};
module.exports = {
  SourceResultItemV5: SourceResultItemV5
};

},{"./base-result-item-v5":896}],907:[function(require,module,exports){
"use strict";

var _require = require("./media-py-gpt-result-item-v1"),
  MediaPyGptResultItemV1 = _require.MediaPyGptResultItemV1;
function StockMarketResultItemV5(title, description, linkUrl) {
  MediaPyGptResultItemV1.call(this, title, title, description, description, linkUrl, null);
  this.isFromStockMarket = true;
}
StockMarketResultItemV5.prototype = Object.create(MediaPyGptResultItemV1.prototype);
StockMarketResultItemV5.prototype.constructor = StockMarketResultItemV5;
StockMarketResultItemV5.prototype.setTotalRiskScore = function (totalRiskScore, isPersonNamePresented) {
  var riskScore = totalRiskScore;
  if (isPersonNamePresented) {
    riskScore += 0.05;
  } else {
    riskScore -= 0.1;
  }
  this.setRiskScore(riskScore);
  this.setInitialRiskScore(riskScore);
};
module.exports = {
  StockMarketResultItemV5: StockMarketResultItemV5
};

},{"./media-py-gpt-result-item-v1":901}],908:[function(require,module,exports){
"use strict";

var getNodeIconPath = function getNodeIconPath(type) {
  var iconPath = "";
  if (type === "PER") {
    iconPath = "/config/3types_of_lists/info4c/images/client.png";
  }
  if (type === "ORG") {
    iconPath = "/config/3types_of_lists/info4c/images/building.png";
  }
  if (type === "LOC") {
    iconPath = "/config/3types_of_lists/info4c/images/location.jpg";
  }
  if (type === "TITLE") {
    iconPath = "/config/3types_of_lists/info4c/images/contract.jpg";
  }
  if (!iconPath) {
    iconPath = "/config/3types_of_lists/info4c/images/client.png";
  }
  return iconPath;
};
var getName = function getName(nameObj) {
  var name = "";
  if (typeof nameObj === "string" || nameObj instanceof String) {
    name = nameObj;
  } else {
    name = (nameObj || []).sort(function (a, b) {
      return b.length - a.length;
    })[0];
  }
  return name;
};
var getDbId = function getDbId(db_id) {
  var dbId = null;
  if (db_id === null || db_id === undefined) {
    return dbId;
  }
  if (Array.isArray(db_id) && db_id.length) {
    dbId = db_id[0];
  } else {
    dbId = db_id;
  }
  return dbId;
};
var getNodeKey = function getNodeKey(prefix, id, title) {
  return (prefix || "node") + ":" + id + ":" + title;
};
var getEdgeId = function getEdgeId(itemOne, itemTwo) {
  return itemOne + "---" + itemTwo;
};
var findNodeById = function findNodeById(sigmaGraph, id) {
  return sigmaGraph.nodes.find(function (node) {
    return node.id === id;
  });
};
var findEdgeById = function findEdgeById(sigmaGraph, edgeId) {
  return sigmaGraph.edges.find(function (edge) {
    return edge.id === edgeId;
  });
};
var findEdgesByNodeId = function findEdgesByNodeId(sigmaGraph, nodeId) {
  return sigmaGraph.edges.filter(function (edge) {
    return edge.nIds.find(function (nId) {
      return nId === nodeId;
    });
  });
};
var createEdge = function createEdge(itemOneKey, itemTwoKey, label) {
  return {
    id: getEdgeId(itemOneKey, itemTwoKey),
    label: label,
    dashed: false,
    similarity: 9,
    nIds: [itemOneKey, itemTwoKey],
    hidden: false
  };
};
var createNode = function createNode(vertice) {
  var iconPath = getNodeIconPath(vertice.type);
  var verticeTitle = getName(vertice.name);
  var dbId = getDbId(vertice.db_id);
  return {
    data: {
      title: verticeTitle,
      db_id: dbId,
      name: vertice.name,
      type: vertice.type || "node",
      count: vertice.count ? vertice.count : 1
    },
    icon: iconPath,
    key: getNodeKey(vertice.type, vertice.id, verticeTitle),
    label: verticeTitle,
    type: vertice.type || "node",
    id: vertice.id,
    hidden: false
  };
};
var getSigmaGraph = function getSigmaGraph(graphData, parentPerson, graphType) {
  if (!graphType) {
    graphType = "standard";
  }
  var sigmaGraph = {
    edges: [],
    nodes: []
  };
  (graphData.vertices || []).forEach(function (vertice) {
    sigmaGraph.nodes.push(createNode(vertice));
  });
  (graphData.edges || []).forEach(function (edge) {
    var entityOneId = edge.pair[0];
    var entityTwoId = edge.pair[1];
    var nodeOne = findNodeById(sigmaGraph, entityOneId);
    var nodeTwo = findNodeById(sigmaGraph, entityTwoId);
    var existedEdge = null;
    if (!existedEdge) {
      existedEdge = findEdgeById(sigmaGraph, getEdgeId(nodeOne.key, nodeTwo.key));
    }
    if (!existedEdge) {
      existedEdge = findEdgeById(sigmaGraph, getEdgeId(nodeTwo.key, nodeOne.key));
    }
    if (!existedEdge) {
      existedEdge = createEdge(nodeOne.key, nodeTwo.key, edge.edge ? Array.isArray(edge.edge) ? edge.edge.join(". ") : edge.edge : "");
      sigmaGraph.edges.push(existedEdge);
    }
  });
  sigmaGraph.nodes.forEach(function (node) {
    if (graphType === "standard" && node.data.count === 1 && node.type !== "TITLE") {
      node.hidden = true;
    }
    if (node.hidden) {
      var edgesToHide = findEdgesByNodeId(sigmaGraph, node.key);
      edgesToHide.forEach(function (edge) {
        edge.hidden = true;
      });
    }
  });
  return sigmaGraph;
};
module.exports = {
  getSigmaGraph: getSigmaGraph
};

},{}],909:[function(require,module,exports){
(function (global){(function (){
"use strict";

var cloneDeep = require("lodash/fp/cloneDeep");
var merge = require("lodash/fp/merge");
var _require = require("./constants/source-types"),
  GOOGLE_SEARCH_SOURCE_CODE = _require.GOOGLE_SEARCH_SOURCE_CODE,
  GOOGLE_NEWS_SOURCE_CODE = _require.GOOGLE_NEWS_SOURCE_CODE,
  EXTRA_SOURCE_SOURCE_CODE = _require.EXTRA_SOURCE_SOURCE_CODE,
  STOCK_MARKETS_SOURCE_CODE = _require.STOCK_MARKETS_SOURCE_CODE,
  ALEPH_OCCRP_SOURCE_CODE = _require.ALEPH_OCCRP_SOURCE_CODE,
  OPEN_CORPORATES_SOURCE_CODE = _require.OPEN_CORPORATES_SOURCE_CODE,
  OPEN_SANCTIONS_SOURCE_CODE = _require.OPEN_SANCTIONS_SOURCE_CODE;
var _require2 = require("./mediasearch-graph"),
  getSigmaGraph = _require2.getSigmaGraph;
var _require3 = require("./media-search/models/result-items-v5/match-result-item-v5"),
  MatchResultItemV5 = _require3.MatchResultItemV5;
var _require4 = require("./media-search/models/result-items-v5/search-engine-result-item-v5"),
  SearchEngineResultItemV5 = _require4.SearchEngineResultItemV5;
var _require5 = require("./media-search/models/result-items-v5/google-news-result-item-v5"),
  GoogleNewsRssResultItemV5 = _require5.GoogleNewsRssResultItemV5;
var _require6 = require("./media-search/models/result-items-v5/stock-market-result-item-v5"),
  StockMarketResultItemV5 = _require6.StockMarketResultItemV5;
var _require7 = require("./media-search/models/result-items-v5/extra-source-result-item-v5"),
  ExtraSourceResultItemV5 = _require7.ExtraSourceResultItemV5;
var _require8 = require("./media-search/models/result-items-v5/aleph-occrp-result-item-v5"),
  AlephOccrpResultItemV5 = _require8.AlephOccrpResultItemV5;
var _require9 = require("./media-search/models/result-items-v5/open-sanctions-result-item-v5"),
  OpenSanctionsResultItemV5 = _require9.OpenSanctionsResultItemV5;
var _require10 = require("./media-search/models/result-items-v5/open-corporates-result-item-v5"),
  OpenCorporatesResultItemV5 = _require10.OpenCorporatesResultItemV5;
var _require11 = require("./media-search-v2/models/result-items"),
  AlephOccrpResultItemV1 = _require11.AlephOccrpResultItemV1,
  ExtraSourceResultItemV1 = _require11.ExtraSourceResultItemV1,
  GoogleNewsRssResultItemV1 = _require11.GoogleNewsRssResultItemV1,
  MatchResultItemV1 = _require11.MatchResultItemV1,
  OpenCorporatesResultItemV1 = _require11.OpenCorporatesResultItemV1,
  OpenSanctionsResultItemV1 = _require11.OpenSanctionsResultItemV1,
  SearchEngineResultItemV1 = _require11.SearchEngineResultItemV1,
  StockMarketResultItemV1 = _require11.StockMarketResultItemV1;
var _require12 = require("./media-search/models/media-search-person-v5"),
  MediaSearchPersonV5 = _require12.MediaSearchPersonV5;
var _require13 = require("./media-search-v2/models/person"),
  MediaPyGptPersonV1 = _require13.MediaPyGptPersonV1;
var _require14 = require("./lexis-nexis/common-adapter-v6"),
  CommonLexisNexisAdapterV6 = _require14.CommonLexisNexisAdapterV6;
var _require15 = require("./media-search-v2/common-adapter-v1"),
  CommonMediaSearchAdapterV1 = _require15.CommonMediaSearchAdapterV1;
var MediaSearchService = function () {
  function MediaSearchService($rootScope, $http, $q, $timeout, cfpLoadingBar, API_BASE, ConfigService, UserService, DataService, $filter, $uibModal) {
    this.$rootScope = $rootScope;
    this.$http = $http;
    this.$q = $q;
    this.$timeout = $timeout;
    this.cfpLoadingBar = cfpLoadingBar;
    this.API_BASE = API_BASE;
    this.ConfigService = ConfigService;
    this.UserService = UserService;
    this.DataService = DataService;
    this.$filter = $filter;
    this.$uibModal = $uibModal;
    this.adapters = {
      lexisNexis: {
        adapter: null,
        defer: null,
        loading: false,
        loaded: false
      },
      google: {
        adapter: null,
        defer: null,
        loading: false,
        loaded: false
      },
      bing: {
        adapter: null,
        defer: null,
        loading: false,
        loaded: false
      }
    };
    this.config = null;
    this.userConfig = null;
    this.errorLogger = null;
    this.infoLogger = null;
    this.logSearchRequestDetails = false;
    this.angular = "true" === "false" ? null : global.angular;
  }
  var _proto = MediaSearchService.prototype;
  _proto.setLoggers = function setLoggers(errorLogger, infoLogger) {
    this.errorLogger = errorLogger;
    this.infoLogger = infoLogger;
  };
  _proto.setLogLevels = function setLogLevels(logSearchRequestDetails) {
    this.logSearchRequestDetails = logSearchRequestDetails;
  };
  _proto.logError = function logError(error) {
    if (this.errorLogger) {
      this.errorLogger(error);
    } else if (error && error.xhrStatus === "abort") {} else {
      console.error(error);
    }
  };
  _proto.logInfo = function logInfo(infoMsg) {
    if (!this.logSearchRequestDetails) {
      return;
    }
    if (this.infoLogger) {
      this.infoLogger(infoMsg);
    } else {
      console.log(infoMsg);
    }
  };
  _proto.promiseWrapper = function promiseWrapper(objToResolve) {
    var defer = this.$q.defer();
    defer.resolve(objToResolve);
    return defer.promise;
  };
  _proto.resetService = function resetService() {
    var _this = this;
    this.config = null;
    this.userConfig = null;
    this.ConfigService.get().then(function (config) {
      _this.config = config;
    })["catch"](function (error) {
      _this.logError(error);
    });
    this.ConfigService.getUserConfig().then(function (userConfig) {
      _this.userConfig = userConfig;
    })["catch"](function (error) {
      _this.logError(error);
    });
    this.adapters = {
      lexisNexis: {
        adapter: null,
        defer: null,
        loading: false,
        loaded: false
      },
      google: {
        adapter: null,
        defer: null,
        loading: false,
        loaded: false
      },
      bing: {
        adapter: null,
        defer: null,
        loading: false,
        loaded: false
      }
    };
  };
  _proto.resetState = function resetState(state) {
    var _this2 = this;
    state.lexisNexisClicked = false;
    state.googleSearchClicked = false;
    state.bingSearchClicked = false;
    state.lexisNexisEnabled = false;
    state.googleSearchEnabled = false;
    state.bingSearchEnabled = false;
    var necessaryRoles = ["superuser", "orgadmin", "mediasearcher"];
    this.UserService.get().then(function () {
      _this2.ConfigService.getUserConfig().then(function (config) {
        state.lexisNexisEnabled = !!(config && config.lexisnexis && _this2.UserService.isInRoles(necessaryRoles));
        state.googleSearchEnabled = !!(config && config.search_ner_services && config.search_ner_services.google && config.search_ner_services.avIsAccessEnabled && _this2.UserService.isInRoles(necessaryRoles));
        state.bingSearchEnabled = !!(config && config.search_ner_services && config.search_ner_services.bing && config.search_ner_services.avIsAccessEnabled && _this2.UserService.isInRoles(necessaryRoles));
      })["catch"](function (error) {
        _this2.logError(error);
      });
    })["catch"](function (error) {
      _this2.logError(error);
    });
  };
  MediaSearchService.getSearchEngineName = function getSearchEngineName(searchEngine) {
    return searchEngine === "google" ? "MediaSearch" : searchEngine === "lexis-nexis" ? "LexisNexis" : "Bing Search";
  };
  MediaSearchService.getMessageViewModalTmpltPath = function getMessageViewModalTmpltPath(searchEngine) {
    return searchEngine === "google" ? "views/modals/google-search-message.html" : searchEngine === "lexis-nexis" ? "views/modals/lexis-nexis-message.html" : "views/modals/bing-search-message.html";
  };
  MediaSearchService.getErrorMessage = function getErrorMessage(searchEngine, error) {
    var searchEngineName = MediaSearchService.getSearchEngineName(searchEngine);
    return error.xhrStatus !== null && error.xhrStatus !== undefined && error.statusText !== null && error.statusText !== undefined && !error.message ? "An error occured during performing request to get " + searchEngineName + " configuration or search information. Please, check connection to the server" : error.message;
  };
  _proto.fillLexisNexis = function fillLexisNexis(item, type, stateobj) {
    var _this3 = this;
    var propName = "lexisnexisdict";
    var searchDict = {
      firstname: "",
      lastname: "",
      fullname: "",
      country: "",
      city: "",
      keywords: [],
      riskscore: 0,
      itemId: undefined
    };
    var getSearchDict$ = null;
    if (type === "alert" && item.category === "profiling" && item.transaction && Object.keys(item.transaction).length) {
      getSearchDict$ = this.getDatamartSearchDict$(item);
    } else if (type === "alert" && item.category === "online" && item.subtype === "<payments>") {
      getSearchDict$ = this.promiseWrapper(this.getPaymentsAlertsSearchDict(item));
    } else {
      getSearchDict$ = this.promiseWrapper(this.getStandardSearchDict(item));
    }
    getSearchDict$.then(function (data) {
      searchDict = data;
    })["catch"](function (error) {
      _this3.logError(error);
    })["finally"](function () {
      item[propName] = [searchDict];
      if (searchDict.firstname || searchDict.lastname || searchDict.fullname) {
        _this3.DataService.createObject("audit", {
          username: stateobj.currentUser.username,
          orgclient: MediaSearchService.getAuditOrgClient(stateobj),
          object_id: item.id,
          object_type: type,
          object_category: item.category,
          action: "LEXISNEXIS",
          remark: (searchDict.firstname + " " + searchDict.lastname + " " + searchDict.fullname + " " + (Array.isArray(searchDict.country) ? searchDict.country.length ? "(" + searchDict.country.join(", ") + ")" : "" : searchDict.country ? "(" + searchDict.country + ")" : "")).trim(),
          human_interacted: true
        }).then(function (auditObj) {
          item.lexis_nexis_audit_obj = auditObj;
        })["catch"](function (error) {
          _this3.logError(error);
        });
      }
    });
  };
  _proto.fillSearchEngine = function fillSearchEngine(searchEngine, item, type, stateobj) {
    var _this4 = this;
    var propName = searchEngine + "searchdict";
    var searchDict = {
      firstname: "",
      lastname: "",
      fullname: "",
      country: "",
      city: "",
      keywords: [],
      riskscore: 0,
      itemId: undefined
    };
    var getSearchDict$ = null;
    if (type === "alert" && item.category === "profiling" && item.transaction && Object.keys(item.transaction).length) {
      getSearchDict$ = this.getDatamartSearchDict$(item);
    } else if (type === "alert" && item.category === "online" && item.subtype === "<payments>") {
      getSearchDict$ = this.promiseWrapper(this.getPaymentsAlertsSearchDict(item));
    } else {
      getSearchDict$ = this.promiseWrapper(this.getStandardSearchDict(item));
    }
    getSearchDict$.then(function (data) {
      searchDict = data;
    })["catch"](function (error) {
      _this4.logError(error);
    })["finally"](function () {
      item[propName] = [searchDict];
      if (searchDict.firstname || searchDict.lastname || searchDict.fullname) {
        _this4.DataService.createObject("audit", {
          username: stateobj.currentUser.username,
          orgclient: MediaSearchService.getAuditOrgClient(stateobj),
          object_id: item.id,
          object_type: type,
          object_category: item.category,
          action: "GOOGLESEARCH",
          remark: (searchDict.firstname + " " + searchDict.lastname + " " + searchDict.fullname + " " + (Array.isArray(searchDict.country) ? searchDict.country.length ? "(" + searchDict.country.join(", ") + ")" : "" : searchDict.country ? "(" + searchDict.country + ")" : "")).trim(),
          human_interacted: true
        }).then(function (auditObj) {
          item.media_search_audit_obj = auditObj;
        })["catch"](function (error) {
          _this4.logError(error);
        });
      }
    });
  };
  _proto.fillDefaultSearchEngine = function fillDefaultSearchEngine(searchEngine, item, searchDict, stateobj) {
    var _this5 = this;
    var propName = searchEngine + "searchdict";
    item[propName] = [searchDict];
    if (searchDict.firstname || searchDict.lastname || searchDict.fullname) {
      this.DataService.createObject("audit", {
        username: stateobj.currentUser.username,
        orgclient: MediaSearchService.getAuditOrgClient(stateobj),
        object_id: null,
        object_type: null,
        object_category: null,
        action: "GOOGLESEARCH",
        remark: (searchDict.firstname + " " + searchDict.lastname + " " + (Array.isArray(searchDict.country) ? searchDict.country.length ? "(" + searchDict.country.join(", ") + ")" : "" : searchDict.country ? "(" + searchDict.country + ")" : "")).trim(),
        human_interacted: true
      }).then(function (auditObj) {
        item.media_search_audit_obj = auditObj;
      })["catch"](function (error) {
        _this5.logError(error);
      });
    }
  };
  _proto.getDatamartSearchDict$ = function getDatamartSearchDict$(alert) {
    var _this6 = this;
    var defer = this.$q.defer();
    var searchdict = {
      firstname: "",
      lastname: "",
      fullname: "",
      country: "",
      city: "",
      keywords: [],
      riskscore: 0,
      itemId: undefined
    };
    searchdict.keywords = [];
    searchdict.riskscore = alert.Similarity;
    searchdict.itemId = alert.id;
    if (this.DataService.getDatamart) {
      this.DataService.getDatamart({
        filter: {
          F_CUSTOMER_ID: alert.transaction.F_CUSTOMER_ID,
          USERBK_NR: alert.transaction.F_BANK_ID || alert.transaction.USERBK_NR
        }
      }).then(function (response) {
        if (response && Array.isArray(response) && response[0] && response[0].faf_mbdata_clients && response[0].faf_mbdata_clients.length) {
          var clientInfo = response[0].faf_mbdata_clients[0];
          searchdict.firstname = MediaSearchService.getField(clientInfo, ["VORNAME"], false);
          searchdict.lastname = MediaSearchService.getField(clientInfo, ["NAME_1"], false);
          searchdict.fullname = MediaSearchService.getField(clientInfo, ["KD_BEZ"], false);
          searchdict.country = MediaSearchService.getField(clientInfo, ["LAND_LNR_NAT_BEZ", "ISO_LAND_CODE_NAT"], true);
        }
        defer.resolve(searchdict);
      })["catch"](function (error) {
        _this6.logError(error);
        defer.resolve(searchdict);
      });
    } else {
      defer.resolve(searchdict);
    }
    return defer.promise;
  };
  _proto.getCounterPartySearchDict = function getCounterPartySearchDict(item) {
    var searchDict = {
      firstname: "",
      lastname: "",
      fullname: "",
      country: "",
      city: "",
      keywords: [],
      riskscore: 0,
      itemId: undefined
    };
    searchDict.keywords = [];
    searchDict.riskscore = item.Similarity;
    searchDict.itemId = item.id;
    searchDict.fullname = MediaSearchService.getField(item, ["transaction.CounterpartyName"], false);
    return searchDict;
  };
  _proto.getStandardSearchDict = function getStandardSearchDict(item) {
    var searchDict = {
      firstname: "",
      lastname: "",
      fullname: "",
      country: "",
      city: "",
      keywords: [],
      riskscore: 0,
      itemId: undefined
    };
    searchDict.keywords = [];
    searchDict.riskscore = item.Similarity;
    searchDict.itemId = item.id;
    searchDict.firstname = MediaSearchService.getField(item, ["query.virtual_client.FIRSTNAME", "virtual_client.FIRSTNAME", "client.FIRSTNAME", "FIRSTNAME", "First_Name", "CustomerFirstName"], false);
    searchDict.lastname = MediaSearchService.getField(item, ["query.virtual_client.LASTNAME", "virtual_client.LASTNAME", "client.LASTNAME", "LASTNAME", "Last_Name", "CustomerLastName"], false);
    searchDict.fullname = MediaSearchService.getField(item, ["query.virtual_client.FULLNAME", "virtual_client.FULLNAME", "client.FULLNAME", "query.virtual_client.Additional_Name1", "virtual_client.Additional_Name1", "client.add_name", "FULLNAME", "Full_Name", "CustomerFullName"], false);
    if (!searchDict.firstname && !searchDict.lastname && !searchDict.fullname) {
      if (item.reason && item.reason.matches && item.reason.matches.length && item.reason.matches[0].list) {
        searchDict.firstname = MediaSearchService.getField(item, ["reason.matches[0].list.First_Name"], false);
        searchDict.lastname = MediaSearchService.getField(item, ["reason.matches[0].list.Last_Name"], false);
        searchDict.fullname = MediaSearchService.getField(item, ["reason.matches[0].list.Full_Name"], false);
      }
    }
    searchDict.country = MediaSearchService.getField(item, ["query.virtual_client.ADDR_COUNTRY", "virtual_client.ADDR_COUNTRY", "client.ADDR_COUNTRY", "ADDR_COUNTRY", "Country"], true);
    searchDict.city = MediaSearchService.getField(item, ["query.virtual_client.ADDR_CITY", "virtual_client.ADDR_CITY", "client.ADDR_CITY", "ADDR_CITY"], false);
    return searchDict;
  };
  _proto.getPaymentsAlertsSearchDict = function getPaymentsAlertsSearchDict(item) {
    var searchDict = {
      firstname: "",
      lastname: "",
      fullname: "",
      country: "",
      city: "",
      keywords: [],
      riskscore: 0,
      itemId: undefined
    };
    searchDict.keywords = [];
    searchDict.riskscore = item.Similarity;
    searchDict.itemId = item.id;
    searchDict.firstname = MediaSearchService.getField(item, ["query.virtual_client.FIRSTNAME", "virtual_client.FIRSTNAME", "client.FIRSTNAME", "FIRSTNAME", "First_Name"], false);
    searchDict.lastname = MediaSearchService.getField(item, ["query.virtual_client.LASTNAME", "virtual_client.LASTNAME", "client.LASTNAME", "LASTNAME", "Last_Name"], false);
    searchDict.fullname = MediaSearchService.getField(item, ["query.virtual_client.FULLNAME", "virtual_client.FULLNAME", "client.FULLNAME", "query.virtual_client.Additional_Name1", "virtual_client.Additional_Name1", "client.add_name", "FULLNAME", "Full_Name"], false);
    if (!searchDict.firstname && !searchDict.lastname && !searchDict.fullname) {
      if (item.reason && item.reason.matches && item.reason.matches.length && item.reason.matches[0].list) {
        searchDict.firstname = MediaSearchService.getField(item, ["reason.matches[0].list.First_Name"], false);
        searchDict.lastname = MediaSearchService.getField(item, ["reason.matches[0].list.Last_Name"], false);
        searchDict.fullname = MediaSearchService.getField(item, ["reason.matches[0].list.Full_Name"], false);
      }
    }
    searchDict.country = MediaSearchService.getField(item, ["query.virtual_client.ADDR_COUNTRY", "virtual_client.ADDR_COUNTRY", "client.ADDR_COUNTRY", "ADDR_COUNTRY", "Country"], true);
    searchDict.city = MediaSearchService.getField(item, ["query.virtual_client.ADDR_CITY", "virtual_client.ADDR_CITY", "client.ADDR_CITY", "ADDR_CITY"], false);
    return searchDict;
  };
  _proto.initLexisNexis$ = function initLexisNexis$() {
    var _this7 = this;
    if (!this.adapters.lexisNexis.defer) {
      this.adapters.lexisNexis.defer = this.$q.defer();
    }
    if (this.adapters.lexisNexis.loaded) {
      this.adapters.lexisNexis.defer.resolve();
    } else if (!this.adapters.lexisNexis.loading) {
      this.adapters.lexisNexis.loading = true;
      this.$q.all([this.ConfigService.get(), this.ConfigService.getUserConfig()]).then(function (results) {
        if (!_this7.config) {
          _this7.config = results[0];
        }
        if (!_this7.userConfig) {
          _this7.userConfig = results[1];
        }
        var lexisNexisBaseUrl = _this7.API_BASE + "/lexisnexis/";
        try {
          var newCommonLexisNexisAdapter = null;
          if (_this7.userConfig && _this7.userConfig.lexisnexis) {
            newCommonLexisNexisAdapter = new CommonLexisNexisAdapterV6(_this7.$rootScope, _this7.$http, _this7.$q, _this7.cfpLoadingBar);
            newCommonLexisNexisAdapter.setCountries(_this7.config.countries || []);
            newCommonLexisNexisAdapter.initAdapters(lexisNexisBaseUrl, _this7.userConfig.lexisnexis.constants || {});
            newCommonLexisNexisAdapter.initServices(_this7.userConfig.lexisnexis.urls);
            newCommonLexisNexisAdapter.setLoggers(_this7.logError.bind(_this7), _this7.logInfo.bind(_this7));
          }
          _this7.adapters.lexisNexis.adapter = newCommonLexisNexisAdapter;
          _this7.adapters.lexisNexis.loading = false;
          _this7.adapters.lexisNexis.loaded = true;
          _this7.adapters.lexisNexis.defer.resolve();
        } catch (error) {
          _this7.adapters.lexisNexis.adapter = null;
          _this7.adapters.lexisNexis.loading = false;
          _this7.adapters.lexisNexis.loaded = false;
          _this7.adapters.lexisNexis.defer.reject(error);
        }
      })["catch"](function (error) {
        _this7.adapters.lexisNexis.adapter = null;
        _this7.adapters.lexisNexis.loading = false;
        _this7.adapters.lexisNexis.loaded = false;
        _this7.adapters.lexisNexis.defer.reject(error);
      });
    }
    return this.adapters.lexisNexis.defer.promise;
  };
  _proto.initSearchEngine$ = function initSearchEngine$(searchEngine) {
    var _this8 = this;
    if (!this.adapters[searchEngine].defer) {
      this.adapters[searchEngine].defer = this.$q.defer();
    }
    if (this.adapters[searchEngine].loaded) {
      this.adapters[searchEngine].defer.resolve();
    } else if (!this.adapters[searchEngine].loading) {
      this.adapters[searchEngine].loading = true;
      this.$q.all([this.ConfigService.get(), this.ConfigService.getUserConfig()]).then(function (results) {
        if (!_this8.config) {
          _this8.config = results[0];
        }
        if (!_this8.userConfig) {
          _this8.userConfig = results[1];
        }
        try {
          var newMediaSearchAdapter = null;
          if (_this8.userConfig && _this8.userConfig.search_ner_services && _this8.userConfig.search_ner_services.api && _this8.userConfig.search_ner_services[searchEngine]) {
            newMediaSearchAdapter = new CommonMediaSearchAdapterV1(_this8.$rootScope, _this8.$http, _this8.$q, _this8.$timeout, _this8.cfpLoadingBar);
            newMediaSearchAdapter.initServices(_this8.userConfig.search_ner_services.api);
            newMediaSearchAdapter.initAdapters(_this8.userConfig.search_ner_services.api, _this8.cfpLoadingBar);
            newMediaSearchAdapter.setSearchEngine(searchEngine === "google", searchEngine === "bing");
            newMediaSearchAdapter.setCountries(_this8.config.countries || []);
            newMediaSearchAdapter.setExcludedNameParts(_this8.userConfig.search_ner_services.excluded_name_parts);
            newMediaSearchAdapter.setLoggers(_this8.logError.bind(_this8), _this8.logInfo.bind(_this8));
            newMediaSearchAdapter.setLinkedAliasPersonsSettings(_this8.userConfig.search_ner_services.isProcessingAliasPersonsEnabled, _this8.userConfig.search_ner_services.isProcessingLinkedPersonsEnabled);
          }
          if (newMediaSearchAdapter) {
            newMediaSearchAdapter.initFromConfig$().then(function () {
              _this8.adapters[searchEngine].adapter = newMediaSearchAdapter;
              _this8.adapters[searchEngine].loading = false;
              _this8.adapters[searchEngine].loaded = true;
              _this8.adapters[searchEngine].defer.resolve();
            })["catch"](function (error) {
              _this8.adapters[searchEngine].adapter = null;
              _this8.adapters[searchEngine].loading = false;
              _this8.adapters[searchEngine].loaded = false;
              _this8.adapters[searchEngine].defer.reject(error);
            });
          } else {
            _this8.adapters[searchEngine].adapter = null;
            _this8.adapters[searchEngine].loading = false;
            _this8.adapters[searchEngine].loaded = true;
            _this8.adapters[searchEngine].defer.resolve();
          }
        } catch (error) {
          _this8.adapters[searchEngine].adapter = null;
          _this8.adapters[searchEngine].loading = false;
          _this8.adapters[searchEngine].loaded = false;
          _this8.adapters[searchEngine].defer.reject(error);
        }
      })["catch"](function (error) {
        _this8.adapters[searchEngine].adapter = null;
        _this8.adapters[searchEngine].loading = false;
        _this8.adapters[searchEngine].loaded = false;
        _this8.adapters[searchEngine].defer.reject(error);
      });
    }
    return this.adapters[searchEngine].defer.promise;
  };
  _proto.lexisNexisWrapper = function lexisNexisWrapper(resultsDefer, onSuccessCallback) {
    var _this9 = this;
    var serviceInit$ = this.adapters.lexisNexis.loaded ? this.promiseWrapper({}) : this.initLexisNexis$();
    serviceInit$.then(function () {
      if (_this9.adapters.lexisNexis.loaded && _this9.adapters.lexisNexis.adapter) {
        onSuccessCallback(resultsDefer);
      } else {
        var message = MediaSearchService.getSearchEngineName("lexis-nexis") + " disabled";
        _this9.logError(new Error(message));
        if (resultsDefer) {
          resultsDefer.reject(message);
        }
      }
    })["catch"](function (error) {
      _this9.logError(error);
      _this9.showMessage(MediaSearchService.getErrorMessage("lexis-nexis", error), "error", MediaSearchService.getMessageViewModalTmpltPath("lexis-nexis"));
      if (resultsDefer) {
        resultsDefer.reject(error);
      }
    });
  };
  _proto.searchEngineWrapper = function searchEngineWrapper(searchEngine, resultsDefer, onSuccessCallback) {
    var _this10 = this;
    var serviceInit$ = this.adapters[searchEngine].loaded ? this.promiseWrapper({}) : this.initSearchEngine$(searchEngine);
    serviceInit$.then(function () {
      if (_this10.adapters[searchEngine].loaded && _this10.adapters[searchEngine].adapter) {
        onSuccessCallback(resultsDefer);
      } else {
        var message = MediaSearchService.getSearchEngineName(searchEngine) + " disabled";
        _this10.logError(new Error(message));
        if (resultsDefer) {
          resultsDefer.reject(message);
        }
      }
    })["catch"](function (error) {
      _this10.logError(error);
      _this10.showMessage(MediaSearchService.getErrorMessage(searchEngine, error), "error", MediaSearchService.getMessageViewModalTmpltPath(searchEngine));
      if (resultsDefer) {
        resultsDefer.reject(error);
      }
    });
  };
  _proto.getLexisNexisResults = function getLexisNexisResults(personsData, callback) {
    var _this11 = this;
    var defer = this.$q.defer();
    var onSuccessCallback = function onSuccessCallback(resultsDefer) {
      if (!personsData || !Array.isArray(personsData) || !personsData.length) {
        resultsDefer.resolve([]);
      } else {
        _this11.adapters.lexisNexis.adapter.getData$(personsData, callback).then(function (data) {
          resultsDefer.resolve(data);
        })["catch"](function (error) {
          _this11.logError(error);
          resultsDefer.reject(error);
        });
      }
    };
    this.lexisNexisWrapper(defer, onSuccessCallback);
    return defer.promise;
  };
  _proto.initMediaPy = function initMediaPy(searchEngine) {
    var defer = this.$q.defer();
    var onSuccessCallback = function onSuccessCallback(resultsDefer) {
      resultsDefer.resolve({});
    };
    this.searchEngineWrapper(searchEngine, defer, onSuccessCallback);
    return defer.promise;
  };
  _proto.checkMediaPyGptEnabled = function checkMediaPyGptEnabled(searchEngine) {
    var _this12 = this;
    var defer = this.$q.defer();
    var onSuccessCallback = function onSuccessCallback(resultsDefer) {
      resultsDefer.resolve(_this12.adapters[searchEngine].adapter.USE_MEDIA_SEARCH_GPT);
    };
    this.searchEngineWrapper(searchEngine, defer, onSuccessCallback);
    return defer.promise;
  };
  _proto.getSearchEngineResults = function getSearchEngineResults(searchEngine, personsData, additionalKeywords, date, resultsWithoutDate, languages, sources, scoreMode, fastProcessing, userCountry, isBatch, personId, searchResultId, linkAnalysServiceId, callback, googleRequestCb) {
    var _this13 = this;
    var defer = this.$q.defer();
    var onSuccessCallback = function onSuccessCallback(resultsDefer) {
      var dateFrom = null;
      var dateTo = null;
      if (date) {
        var spl = date.split(":");
        if (spl[0].length > 0) {
          dateFrom = MediaSearchService.getDateFromString(spl[0]);
          dateFrom.setHours(0);
          dateFrom.setMinutes(0);
          dateFrom.setSeconds(0);
        }
        if (spl[1].length > 0) {
          dateTo = MediaSearchService.getDateFromString(spl[1]);
          dateTo.setHours(23);
          dateTo.setMinutes(59);
          dateTo.setSeconds(59);
        }
      }
      var sourcesValues = (sources || []).map(function (source) {
        return source.value;
      });
      if (!googleRequestCb) {
        googleRequestCb = function googleRequestCb() {};
      }
      _this13.adapters[searchEngine].adapter.resetServices();
      _this13.adapters[searchEngine].adapter.resetAdapters();
      if (!personsData || !Array.isArray(personsData) || !personsData.length) {
        resultsDefer.resolve([]);
      } else {
        _this13.adapters[searchEngine].adapter.getData$(personsData, additionalKeywords, dateFrom, dateTo, resultsWithoutDate, languages, sourcesValues, scoreMode || "criminals", fastProcessing, userCountry !== "?" ? userCountry : null, isBatch, personId, searchResultId, linkAnalysServiceId, callback, googleRequestCb).then(function (persons) {
          if ("true" === "true") {
            _this13.setPersonsAnalyzeInfo(searchEngine, persons, isBatch, callback).then(function () {
              _this13.summarizePersons(searchEngine, persons, isBatch, callback).then(function () {
                persons.forEach(function (person) {
                  person.setMediaPyInfoLoaded(true);
                });
                _this13.sendPersonsGptRequests(searchEngine, persons, isBatch, callback).then(function () {
                  persons.forEach(function (person) {
                    person.setMediaPyGptInfoLoaded(true);
                  });
                  _this13.sendPersonsLLMRequests(searchEngine, persons, isBatch, callback).then(function () {
                    resultsDefer.resolve(persons);
                  })["catch"](function (error) {
                    _this13.logError(error);
                    resultsDefer.reject(error);
                  });
                })["catch"](function (error) {
                  _this13.logError(error);
                  resultsDefer.reject(error);
                });
              })["catch"](function (error) {
                _this13.logError(error);
                resultsDefer.reject(error);
              });
            })["catch"](function (error) {
              _this13.logError(error);
              resultsDefer.reject(error);
            });
          } else {
            resultsDefer.resolve(persons);
          }
        })["catch"](function (error) {
          _this13.logError(error);
          resultsDefer.reject(error);
        });
      }
    };
    this.searchEngineWrapper(searchEngine, defer, onSuccessCallback);
    return defer.promise;
  };
  _proto.getBatchPersonResults = function getBatchPersonResults(searchEngine, person, scoreMode) {
    var _this14 = this;
    var defer = this.$q.defer();
    var onSuccessCallback = function onSuccessCallback(resultsDefer) {
      _this14.adapters[searchEngine].adapter.resetServices();
      _this14.adapters[searchEngine].adapter.resetAdapters();
      var callback = function callback() {};
      _this14.adapters[searchEngine].adapter.getDataForBatchPerson$(person, scoreMode).then(function () {
        if ("true" === "true") {
          _this14.setPersonsAnalyzeInfo(searchEngine, [person], false, callback).then(function () {
            _this14.summarizePersons(searchEngine, [person], false, callback).then(function () {
              [person].forEach(function (pers) {
                pers.setMediaPyInfoLoaded(true);
              });
              _this14.sendPersonsGptRequests(searchEngine, [person], false, callback).then(function () {
                [person].forEach(function (pers) {
                  pers.setMediaPyGptInfoLoaded(true);
                });
                _this14.sendPersonsLLMRequests(searchEngine, [person], false, callback).then(function () {
                  resultsDefer.resolve(person);
                })["catch"](function (error) {
                  _this14.logError(error);
                  resultsDefer.reject(error);
                });
              })["catch"](function (error) {
                _this14.logError(error);
                resultsDefer.reject(error);
              });
            })["catch"](function (error) {
              _this14.logError(error);
              resultsDefer.reject(error);
            });
          })["catch"](function (error) {
            _this14.logError(error);
            resultsDefer.reject(error);
          });
        } else {
          resultsDefer.resolve(person);
        }
      })["catch"](function (error) {
        _this14.logError(error);
        resultsDefer.reject(error);
      });
    };
    this.searchEngineWrapper(searchEngine, defer, onSuccessCallback);
    return defer.promise;
  };
  _proto.setPersonsAnalyzeInfo = function setPersonsAnalyzeInfo(searchEngine, personsData, isBatch, callback) {
    var defer = this.$q.defer();
    var onSuccessCallback = function onSuccessCallback(resultsDefer) {
      if (!callback) {
        callback = function callback() {};
      }
      if (!personsData || !Array.isArray(personsData) || !personsData.length) {
        resultsDefer.resolve([]);
      } else {
        personsData.forEach(function (person) {
          person.setSummaryInfo();
        });
        callback(personsData);
        resultsDefer.resolve(personsData);
      }
    };
    this.searchEngineWrapper(searchEngine, defer, onSuccessCallback);
    return defer.promise;
  };
  _proto.summarizePersons = function summarizePersons(searchEngine, personsData, isBatch, callback) {
    var _this15 = this;
    var defer = this.$q.defer();
    var onSuccessCallback = function onSuccessCallback(resultsDefer) {
      if (!callback) {
        callback = function callback() {};
      }
      if (!personsData || !Array.isArray(personsData) || !personsData.length) {
        resultsDefer.resolve([]);
      } else {
        _this15.adapters[searchEngine].adapter.loadPersonsExtendedSummary$(personsData, isBatch, callback).then(function (persons) {
          resultsDefer.resolve(persons);
        })["catch"](function (error) {
          _this15.logError(error);
          resultsDefer.reject(error);
        });
      }
    };
    this.searchEngineWrapper(searchEngine, defer, onSuccessCallback);
    return defer.promise;
  };
  _proto.sendPersonsGptRequests = function sendPersonsGptRequests(searchEngine, personsData, isBatch, callback) {
    var _this16 = this;
    var defer = this.$q.defer();
    var onSuccessCallback = function onSuccessCallback(resultsDefer) {
      if (!callback) {
        callback = function callback() {};
      }
      if (!personsData || !Array.isArray(personsData) || !personsData.length) {
        resultsDefer.resolve([]);
      } else {
        _this16.adapters[searchEngine].adapter.loadPersonsGptInformation$(personsData, isBatch, callback).then(function (persons) {
          resultsDefer.resolve(persons);
        })["catch"](function (error) {
          _this16.logError(error);
          resultsDefer.reject(error);
        });
      }
    };
    this.searchEngineWrapper(searchEngine, defer, onSuccessCallback);
    return defer.promise;
  };
  _proto.sendPersonsLLMRequests = function sendPersonsLLMRequests(searchEngine, personsData, isBatch, callback) {
    var _this17 = this;
    var defer = this.$q.defer();
    var onSuccessCallback = function onSuccessCallback(resultsDefer) {
      if (!callback) {
        callback = function callback() {};
      }
      if (!personsData || !Array.isArray(personsData) || !personsData.length) {
        resultsDefer.resolve([]);
      } else {
        _this17.adapters[searchEngine].adapter.loadPersonsLLMInformation$(personsData, isBatch, callback).then(function (persons) {
          resultsDefer.resolve(persons);
        })["catch"](function (error) {
          _this17.logError(error);
          resultsDefer.reject(error);
        });
      }
    };
    this.searchEngineWrapper(searchEngine, defer, onSuccessCallback);
    return defer.promise;
  };
  _proto.sendPersonsGptLinkGraphsRequests = function sendPersonsGptLinkGraphsRequests(searchEngine, personsData, isBatch, callback) {
    var _this18 = this;
    var defer = this.$q.defer();
    var onSuccessCallback = function onSuccessCallback(resultsDefer) {
      if (!callback) {
        callback = function callback() {};
      }
      if (!personsData || !Array.isArray(personsData) || !personsData.length) {
        resultsDefer.resolve([]);
      } else {
        _this18.adapters[searchEngine].adapter.loadPersonsLinkedGraphs$(personsData, isBatch, callback).then(function (persons) {
          resultsDefer.resolve(persons);
        })["catch"](function (error) {
          _this18.logError(error);
          resultsDefer.reject(error);
        });
      }
    };
    this.searchEngineWrapper(searchEngine, defer, onSuccessCallback);
    return defer.promise;
  };
  _proto.setAlertPublication = function setAlertPublication(searchEngine, personsData, scoreMode, fastProcessing, isBatch, createAlertsOnlyIfKeywordsAppear, minTotalRiskScore, minResultsCount) {
    var _this19 = this;
    var defer = this.$q.defer();
    var onSuccessCallback = function onSuccessCallback(resultsDefer) {
      if (!personsData || !Array.isArray(personsData) || !personsData.length) {
        resultsDefer.resolve([]);
      } else {
        _this19.adapters[searchEngine].adapter.setAlertPublication(personsData, scoreMode, fastProcessing, isBatch, createAlertsOnlyIfKeywordsAppear, minTotalRiskScore, minResultsCount);
        resultsDefer.resolve(personsData);
      }
    };
    this.searchEngineWrapper(searchEngine, defer, onSuccessCallback);
    return defer.promise;
  };
  _proto.getMarkupHtml = function getMarkupHtml(searchEngine, dataForMarkup) {
    var _this20 = this;
    var defer = this.$q.defer();
    var onSuccessCallback = function onSuccessCallback(resultsDefer) {
      _this20.adapters[searchEngine].adapter.getMarkupHtmlFromData$(dataForMarkup).then(function (markupHtml) {
        resultsDefer.resolve(markupHtml);
      })["catch"](function (error) {
        _this20.logError(error);
        resultsDefer.reject(error);
      });
    };
    this.searchEngineWrapper(searchEngine, defer, onSuccessCallback);
    return defer.promise;
  };
  _proto.getWordCloud = function getWordCloud(searchEngine, dataForWordCloud) {
    var _this21 = this;
    var defer = this.$q.defer();
    var onSuccessCallback = function onSuccessCallback(resultsDefer) {
      _this21.adapters[searchEngine].adapter.getWordCloudFromData$(dataForWordCloud).then(function (wordCloudImgData) {
        resultsDefer.resolve(wordCloudImgData);
      })["catch"](function (error) {
        _this21.logError(error);
        resultsDefer.reject(error);
      });
    };
    this.searchEngineWrapper(searchEngine, defer, onSuccessCallback);
    return defer.promise;
  };
  _proto.getConnectionsGraph = function getConnectionsGraph(searchEngine, graphSearchResults, graphType) {
    var _this22 = this;
    var defer = this.$q.defer();
    var onSuccessCallback = function onSuccessCallback(resultsDefer) {
      if (!graphType) {
        graphType = "standard";
      }
      _this22.adapters[searchEngine].adapter.resetServices();
      _this22.adapters[searchEngine].adapter.resetAdapters();
      var promise$ = graphType === "standard" ? _this22.adapters[searchEngine].adapter.getConnectionsGraph$(graphSearchResults) : _this22.adapters[searchEngine].adapter.getGptConnectionsGraph$(graphSearchResults);
      promise$.then(function (graphInfo) {
        resultsDefer.resolve(graphInfo.graph);
      })["catch"](function (error) {
        _this22.logError(error);
        resultsDefer.reject(error);
      });
    };
    this.searchEngineWrapper(searchEngine, defer, onSuccessCallback);
    return defer.promise;
  };
  _proto.convertGraphDataToSigma = function convertGraphDataToSigma(graphData, parentPerson, graphType) {
    return getSigmaGraph(graphData, parentPerson, graphType);
  };
  _proto.expandCollapseResults = function expandCollapseResults(searchEngine, person, flag) {
    var _this23 = this;
    person.getTotalResults().forEach(function (searchResult) {
      _this23.expandCollapseResult(searchEngine, searchResult, flag);
    });
  };
  _proto.expandCollapseResult = function expandCollapseResult(searchEngine, searchResult, flag) {
    var _this24 = this;
    if (flag === undefined || flag === null) {
      searchResult.setOpen(!searchResult.checkIsOpen());
    } else {
      searchResult.setOpen(flag);
    }
    if (!searchResult.checkIsOpen()) {
      return;
    }
    var onSuccessCallback = function onSuccessCallback(resultsDefer) {
      if (searchResult instanceof SearchEngineResultItemV5 || searchResult instanceof GoogleNewsRssResultItemV5 || searchResult instanceof StockMarketResultItemV5 || searchResult instanceof ExtraSourceResultItemV5 || searchResult instanceof AlephOccrpResultItemV5 || searchResult instanceof OpenSanctionsResultItemV5 || searchResult instanceof OpenCorporatesResultItemV5 || searchResult instanceof SearchEngineResultItemV1 || searchResult instanceof GoogleNewsRssResultItemV1 || searchResult instanceof StockMarketResultItemV1 || searchResult instanceof ExtraSourceResultItemV1 || searchResult instanceof AlephOccrpResultItemV1 || searchResult instanceof OpenSanctionsResultItemV1 || searchResult instanceof OpenCorporatesResultItemV1) {
        _this24.adapters[searchEngine].adapter.loadDocumentExtendedSummary$(searchResult).then(function () {})["catch"](function (error) {
          _this24.logError(error);
        })["finally"](function () {
          _this24.adapters[searchEngine].adapter.loadTopicInfo$(searchResult).then(function () {})["catch"](function (error) {
            _this24.logError(error);
          })["finally"](function () {});
        });
      }
    };
    this.searchEngineWrapper(searchEngine, null, onSuccessCallback);
  };
  _proto.openLexisNexisSearchResult = function openLexisNexisSearchResult(url, isBase64, keywords) {
    var _this25 = this;
    var onSuccessCallback = function onSuccessCallback(resultsDefer) {
      try {
        if (isBase64) {
          url = window.atob(url);
        }
        _this25.adapters.lexisNexis.adapter.openDocument(url, keywords);
      } catch (error) {
        _this25.logError(error);
      }
    };
    this.lexisNexisWrapper(null, onSuccessCallback);
  };
  _proto.openSearchEngineResult = function openSearchEngineResult(searchEngine, searchResult, isBase64) {
    var _this26 = this;
    var onSuccessCallback = function onSuccessCallback(resultsDefer) {
      try {
        _this26.adapters[searchEngine].adapter.resetServices();
        _this26.adapters[searchEngine].adapter.resetAdapters();
        var isMatchResult = searchResult instanceof MatchResultItemV5 || searchResult instanceof MatchResultItemV1;
        if (!isMatchResult) {
          _this26.adapters[searchEngine].adapter.openDocument(searchResult);
        } else {
          _this26.viewMatchInfo(searchEngine, searchResult.getMatchItem());
        }
      } catch (error) {
        _this26.logError(error);
      }
    };
    this.searchEngineWrapper(searchEngine, null, onSuccessCallback);
  };
  _proto.openSearchEngineCommentResult = function openSearchEngineCommentResult(searchEngine, data) {
    var _this27 = this;
    var onSuccessCallback = function onSuccessCallback(resultsDefer) {
      try {
        _this27.adapters[searchEngine].adapter.resetServices();
        _this27.adapters[searchEngine].adapter.resetAdapters();
        if (data.isMatchItem && data.matchItem) {
          _this27.viewMatchInfo(searchEngine, data.matchItem);
        } else if (data.contentElHtml !== undefined && data.contentElHtml !== null && data.contentMarkupElHtml !== undefined && data.contentMarkupElHtml !== null) {
          _this27.adapters[searchEngine].adapter.openCommentDocument(data);
        } else if (data.isFromMatch && data.matchItem) {
          _this27.viewMatchInfo(searchEngine, data.matchItem);
        } else {
          var mediaSearchResult = _this27.objToMediaSearchResult(data);
          if (!(mediaSearchResult instanceof MatchResultItemV5 || mediaSearchResult instanceof MatchResultItemV1)) {
            _this27.adapters[searchEngine].adapter.openDocument(mediaSearchResult);
          } else {
            _this27.viewMatchInfo(searchEngine, mediaSearchResult.getMatchItem());
          }
        }
      } catch (error) {
        _this27.logError(error);
      }
    };
    this.searchEngineWrapper(searchEngine, null, onSuccessCallback);
  };
  _proto.addRelevantResults = function addRelevantResults(data, outerdata) {
    var person = outerdata.find(function (pers) {
      return pers.itemId === data.itemId;
    });
    if (person) {
      data.searchResults.forEach(function (searchResult) {
        var relevantSearchResult = Object.assign({}, searchResult);
        if (relevantSearchResult.__version__) {
          if (relevantSearchResult.type === GOOGLE_SEARCH_SOURCE_CODE) {
            relevantSearchResult.__proto__ = SearchEngineResultItemV1.prototype;
          }
          if (relevantSearchResult.type === GOOGLE_NEWS_SOURCE_CODE) {
            relevantSearchResult.__proto__ = GoogleNewsRssResultItemV1.prototype;
          }
          if (relevantSearchResult.type === STOCK_MARKETS_SOURCE_CODE) {
            relevantSearchResult.__proto__ = StockMarketResultItemV1.prototype;
          }
          if (relevantSearchResult.type === EXTRA_SOURCE_SOURCE_CODE) {
            relevantSearchResult.__proto__ = ExtraSourceResultItemV1.prototype;
          }
          if (relevantSearchResult.type === ALEPH_OCCRP_SOURCE_CODE) {
            relevantSearchResult.__proto__ = AlephOccrpResultItemV1.prototype;
          }
          if (relevantSearchResult.type === OPEN_SANCTIONS_SOURCE_CODE) {
            relevantSearchResult.__proto__ = OpenSanctionsResultItemV1.prototype;
          }
          if (relevantSearchResult.type === OPEN_CORPORATES_SOURCE_CODE) {
            relevantSearchResult.__proto__ = OpenCorporatesResultItemV1.prototype;
          }
          if (relevantSearchResult.isFromMatch) {
            relevantSearchResult.__proto__ = MatchResultItemV1.prototype;
          }
        } else {
          if (relevantSearchResult.isFromSearchEngine) {
            relevantSearchResult.__proto__ = SearchEngineResultItemV5.prototype;
          }
          if (relevantSearchResult.isFromGoogleNewsRss) {
            relevantSearchResult.__proto__ = GoogleNewsRssResultItemV5.prototype;
          }
          if (relevantSearchResult.isFromStockMarket) {
            relevantSearchResult.__proto__ = StockMarketResultItemV5.prototype;
          }
          if (relevantSearchResult.isFromExtraSource) {
            relevantSearchResult.__proto__ = ExtraSourceResultItemV5.prototype;
          }
          if (relevantSearchResult.isFromAlephOccrp) {
            relevantSearchResult.__proto__ = AlephOccrpResultItemV5.prototype;
          }
          if (relevantSearchResult.isFromOpenSanctions) {
            relevantSearchResult.__proto__ = OpenSanctionsResultItemV5.prototype;
          }
          if (relevantSearchResult.isFromOpenCorporates) {
            relevantSearchResult.__proto__ = OpenCorporatesResultItemV5.prototype;
          }
          if (relevantSearchResult.isFromMatch) {
            relevantSearchResult.__proto__ = MatchResultItemV5.prototype;
          }
        }
        relevantSearchResult.setFromRelevant(true);
        relevantSearchResult.setEntitiesHighlighted(false);
        if (!relevantSearchResult.checkIsFromExtraSource() && !relevantSearchResult.checkIsFromAlephOccrp() && !relevantSearchResult.checkIsFromOpenSanctions() && !relevantSearchResult.checkIsFromOpenCorporates()) {
          relevantSearchResult.setKeywordsHighlighted(false);
        }
        if (relevantSearchResult.checkIsRelevant()) {
          relevantSearchResult.setRelevant(false);
          person.addRelevantResult(relevantSearchResult);
        } else {
          person.removeRelevantResult(relevantSearchResult.id);
        }
        person.setTotalResults();
      });
    }
  };
  _proto.addMatchResult = function addMatchResult(data, outerdata) {
    var person = outerdata.find(function (pers) {
      return pers.itemId === data.itemId;
    });
    if (person) {
      var newResult = MatchResultItemV1.fromMatchPerson(data);
      person.addMatchPersonResult(newResult);
      person.setTotalResults();
    }
  };
  _proto.analyzeDocument = function analyzeDocument(searchEngine, formData) {
    var defer = this.$q.defer();
    var onSuccessCallback = function onSuccessCallback(resultsDefer) {};
    this.searchEngineWrapper(searchEngine, defer, onSuccessCallback);
    return defer.promise;
  };
  _proto.analyzeBinaryDocument = function analyzeBinaryDocument(fileBlob, fileName, searchEngine) {
    var defer = this.$q.defer();
    var onSuccessCallback = function onSuccessCallback(resultsDefer) {};
    this.searchEngineWrapper(searchEngine, defer, onSuccessCallback);
    return defer.promise;
  };
  _proto.openNamecheckMediaSearchTabs = function openNamecheckMediaSearchTabs(searchEngine, fullName, itemId, personId, searchResultId) {
    var onSuccessCallback = function onSuccessCallback(resultsDefer) {
      if (window && window.openNameCheckTab) {
        window.openNameCheckTab(fullName, itemId, personId, searchResultId, null);
      }
      if (window && window.openGoogleSearchTab) {
        window.openGoogleSearchTab(fullName, itemId, personId, searchResultId, null);
      }
    };
    this.searchEngineWrapper(searchEngine, null, onSuccessCallback);
  };
  _proto.loadListItemById = function loadListItemById(searchEngine, id) {
    var _this28 = this;
    if (id && id !== -1) {
      this.DataService.getObject("list", Array.isArray(id) ? id[0] : id).then(function (object) {
        _this28.viewMatchInfo(searchEngine, object);
      })["catch"](function (error) {
        _this28.logError(error);
      });
    }
  };
  _proto.addCommentToObj = function addCommentToObj(type, object, comment, fileStorage) {
    if (comment.files) {
      var files = comment.files;
      delete comment.files;
      return this.DataService.addComment(type, object, comment, files.map(function (i) {
        return fileStorage[i];
      }));
    }
    return this.DataService.addComment(type, object, comment, undefined);
  };
  MediaSearchService.getCommentIdFromItem = function getCommentIdFromItem(item, text) {
    var itemCommentsId = null;
    if (item.comments && item.comments.length > 0) {
      for (var i = 0; i < item.comments.length; i++) {
        if (item.comments[i].text && item.comments[i].text === text) {
          itemCommentsId = item.comments[i].id;
          break;
        }
      }
    }
    return itemCommentsId;
  };
  MediaSearchService.replaceVirtualClientWithAlert = function replaceVirtualClientWithAlert(virtualClientsList, alertsList) {
    for (var i = 0; i < (virtualClientsList || []).length; i++) {
      var vcItem = virtualClientsList[i];
      virtualClientsList[i] = null;
      if (vcItem.id) {
        for (var j = 0; j < (alertsList || []).length; j++) {
          var alertItem = alertsList[j];
          if (alertItem && alertItem.query && alertItem.query.virtual_client && alertItem.query.virtual_client.id === vcItem.id && alertItem.id) {
            virtualClientsList[i] = alertItem;
          }
        }
      }
    }
  };
  _proto.mapSearchEnginePerson = function mapSearchEnginePerson(person) {
    var newPerson = "true" === "true" ? this.angular.copy(person) : cloneDeep(person);
    var propsForClear = ["id", "isAlias", "isLinked", "parentId", "isProcessed", "isProcessing", "reqPersonId", "isAlertShouldBeCreated", "alertId", "virtualClientId", "itemId", "requestsStatistic", "isGoogleSearchApiDayLimitExceed", "allSearchEngineResults", "filteredSearchEngineResults", "prependedSortedResults", "allGoogleNewsResults", "filteredGoogleNewsResults", "allExtraSourcesResults", "filteredExtraSourcesResults", "allStockMarketResults", "filteredStockMarketResults", "allAlephOccrpResults", "filteredAlephOccrpResults", "allOpenSanctionsResults", "filteredOpenSanctionsResults", "allOpenCorporatesResults", "filteredOpenCorporatesResults", "relevantResults", "matchPersonResults", "results", "topGptRiskResults", "gptGraph", "performanceMetrics"];
    propsForClear.forEach(function (prop) {
      if (Array.isArray(newPerson[prop])) {
        newPerson[prop] = [];
      } else {
        newPerson[prop] = null;
      }
      delete newPerson[prop];
    });
    newPerson.setTopMentionedItemsCount(5, "persons");
    newPerson.setTopMentionedItemsCount(5, "orgs");
    newPerson.setTopMentionedItemsCount(5, "locs");
    newPerson.setTopGptRelatedItemsCount(5, "persons");
    newPerson.setTopGptRelatedItemsCount(5, "orgs");
    newPerson.setMediaPyInfoLoaded(true);
    newPerson.setMediaPyGptInfoLoaded(true);
    return newPerson;
  };
  _proto.mapSearchEngineResult = function mapSearchEngineResult(searchResult, isLightVersion) {
    var newResult = "true" === "true" ? this.angular.copy(searchResult) : cloneDeep(searchResult);
    newResult.setRelevant(false);
    newResult.setOpen(false);
    var propsForClear = ["id", "isRelevant", "isOpen", "isSelectedForGraph", "tryLoadCounter", "isShouldBePublished", "contentElement", "contentMarkupElement", "keywords", "groupInfo", "requestInfo", "totalResultsCountRiskScoreAdditive", "pubYearRiskScoreAdditive", "performanceMetrics"];
    if (isLightVersion) {
      var extraProps = ["description", "descriptionHtml", "domain", "isOpen", "date", "contentMarkupHtml", "extendedSummary", "extendedSummaryHtml", "isMediaPyRiskScored", "mediaPyRiskScore", "mediaPyRiskScoreColor", "mediaPyTitleRiskScore", "mediaPyTitleRiskScoreColor", "mediaPyNameImportance", "mediaPyNameImportanceColor", "isSentimentLoaded", "sentiment", "wordCloudImgBase64", "gptRiskAssScore", "gptRiskAssExplanation", "gptDocAnalysSummary", "gptDocAnalysSentiment", "gptDocAnalysTopic", "gptDocAnalysKeywords", "gptDocAnalysPubType", "gptPersSumSummary", "gptPersSumDetails", "gptRelatedItems", "gptPersonMatchIsMatch", "gptAllegations", "gptEvidence", "llmSummary", "llmShortSummary", "llmPersonSummary", "llmMentionedEntities", "llmKeywords", "llmSentiment", "llmRiskLevel", "llmRiskExplanation"];
      propsForClear = propsForClear.concat(extraProps);
    }
    propsForClear.forEach(function (prop) {
      if (Array.isArray(newResult[prop])) {
        newResult[prop] = [];
      } else {
        newResult[prop] = null;
      }
      delete newResult[prop];
    });
    if (!isLightVersion) {
      if (!(newResult instanceof MatchResultItemV1)) {
        newResult.setTopMentionedItemsCount(5, "persons");
        newResult.setTopMentionedItemsCount(5, "orgs");
        newResult.setTopMentionedItemsCount(5, "locs");
        newResult.setTopGptRelatedItemsCount(5, "persons");
        newResult.setTopGptRelatedItemsCount(5, "orgs");
        newResult.setTopLLMMentionedEntitiesCount(5, "persons");
        newResult.setTopLLMMentionedEntitiesCount(5, "orgs");
      }
    }
    if (newResult.getContentElement && newResult.getContentElement()) {
      newResult.setContentElement(undefined);
    }
    if (newResult.getContentMarkupElement && newResult.getContentMarkupElement()) {
      newResult.setContentMarkupElement(undefined);
    }
    return newResult;
  };
  _proto.objectToSearchEnginePerson = function objectToSearchEnginePerson(obj) {
    var _this29 = this;
    var searchEnginePerson = Object.assign({}, obj);
    if (searchEnginePerson.__version__) {
      searchEnginePerson.__proto__ = MediaPyGptPersonV1.prototype;
    } else {
      searchEnginePerson.__proto__ = MediaSearchPersonV5.prototype;
    }
    Object.keys(searchEnginePerson.results || {}).forEach(function (key) {
      searchEnginePerson.results[key].all = (searchEnginePerson.results[key].all || []).map(_this29.objToMediaSearchResult);
      searchEnginePerson.results[key].filtered = (searchEnginePerson.results[key].filtered || []).map(_this29.objToMediaSearchResult);
    });
    searchEnginePerson.prependedSortedResults = (searchEnginePerson.prependedSortedResults || []).map(this.objToMediaSearchResult);
    searchEnginePerson.relevantResults = (searchEnginePerson.relevantResults || []).map(this.objToMediaSearchResult);
    searchEnginePerson.matchPersonResults = (searchEnginePerson.matchPersonResults || []).map(this.objToMediaSearchResult);
    searchEnginePerson.totalResults = searchEnginePerson.totalResults.map(this.objToMediaSearchResult);
    return searchEnginePerson;
  };
  _proto.objToMediaSearchResult = function objToMediaSearchResult(obj) {
    var mediaSearchResult = Object.assign({}, obj);
    if (mediaSearchResult.__version__) {
      if (mediaSearchResult.type === GOOGLE_SEARCH_SOURCE_CODE) {
        mediaSearchResult.__proto__ = SearchEngineResultItemV1.prototype;
      }
      if (mediaSearchResult.type === GOOGLE_NEWS_SOURCE_CODE) {
        mediaSearchResult.__proto__ = GoogleNewsRssResultItemV1.prototype;
      }
      if (mediaSearchResult.type === STOCK_MARKETS_SOURCE_CODE) {
        mediaSearchResult.__proto__ = StockMarketResultItemV1.prototype;
      }
      if (mediaSearchResult.type === EXTRA_SOURCE_SOURCE_CODE) {
        mediaSearchResult.__proto__ = ExtraSourceResultItemV1.prototype;
      }
      if (mediaSearchResult.type === ALEPH_OCCRP_SOURCE_CODE) {
        mediaSearchResult.__proto__ = AlephOccrpResultItemV1.prototype;
      }
      if (mediaSearchResult.type === OPEN_SANCTIONS_SOURCE_CODE) {
        mediaSearchResult.__proto__ = OpenSanctionsResultItemV1.prototype;
      }
      if (mediaSearchResult.type === OPEN_CORPORATES_SOURCE_CODE) {
        mediaSearchResult.__proto__ = OpenCorporatesResultItemV1.prototype;
      }
      if (mediaSearchResult.isFromMatch) {
        mediaSearchResult.__proto__ = MatchResultItemV1.prototype;
      }
    } else {
      if (mediaSearchResult.isFromSearchEngine) {
        mediaSearchResult.__proto__ = SearchEngineResultItemV5.prototype;
      }
      if (mediaSearchResult.isFromGoogleNewsRss) {
        mediaSearchResult.__proto__ = GoogleNewsRssResultItemV5.prototype;
      }
      if (mediaSearchResult.isFromStockMarket) {
        mediaSearchResult.__proto__ = StockMarketResultItemV5.prototype;
      }
      if (mediaSearchResult.isFromExtraSource) {
        mediaSearchResult.__proto__ = ExtraSourceResultItemV5.prototype;
      }
      if (mediaSearchResult.isFromAlephOccrp) {
        mediaSearchResult.__proto__ = AlephOccrpResultItemV5.prototype;
      }
      if (mediaSearchResult.isFromOpenSanctions) {
        mediaSearchResult.__proto__ = OpenSanctionsResultItemV5.prototype;
      }
      if (mediaSearchResult.isFromOpenCorporates) {
        mediaSearchResult.__proto__ = OpenCorporatesResultItemV5.prototype;
      }
      if (mediaSearchResult.isFromMatch) {
        mediaSearchResult.__proto__ = MatchResultItemV5.prototype;
      }
    }
    return mediaSearchResult;
  };
  _proto.mapSearchEnginePersonToAttachData = function mapSearchEnginePersonToAttachData(person, checkRelevancy) {
    var _this30 = this;
    var currPerson = this.mapSearchEnginePerson(person);
    var mappedResults = currPerson.getTotalResults().filter(function (currResult) {
      return checkRelevancy ? currResult.checkIsRelevant() : true;
    }).filter(function (currResult) {
      return currResult.checkShouldBePublished && currResult.checkShouldBePublished();
    }).map(function (currResult) {
      return _this30.mapSearchEngineResult(currResult, false);
    });
    currPerson.totalResults = mappedResults;
    return currPerson;
  };
  _proto.lexisNexisResultToObj = function lexisNexisResultToObj(lexisNexisResult) {
    return {
      url: lexisNexisResult.getDocUrl(),
      keywords: lexisNexisResult.getKeywords()
    };
  };
  _proto.publishSearchResults = function publishSearchResults(items, type, checkRelevancy, searchType, logRequestMetrics) {
    var _this31 = this;
    var publishResultsDefer = this.$q.defer();
    var allcomments = [];
    var allcommentitems = [];
    var updcomments = [];
    var updcommentsitems = [];
    var allupdates = [];
    var allupdsobjs = [];
    var allupdplaces = [];
    var allCommentsFinal = [];
    var allCommentItemsFinal = [];
    var fileStorage = [];
    for (var i = 0; i < (items || []).length; i++) {
      var item = items[i];
      if (!item[searchType]) {
        continue;
      }
      var rule = {
        Rule: "Adverse media check",
        Score: 0.9,
        listEntryId: item.listEntryId
      };
      var allResultsCounter = 0;
      var relevantResultsCounter = 0;
      for (var j = 0; j < item[searchType].length; j++) {
        var currPerson = item[searchType][j];
        if (!rule.firstname) {
          rule.firstname = currPerson.getFirstName();
        }
        if (!rule.lastname) {
          rule.lastname = currPerson.getLastName();
        }
        if (!rule.firstname && !rule.lastname) {
          rule.lastname = currPerson.getFullName();
        }
        if (rule.Score < currPerson.getTotalRiskScore()) {
          rule.Score = currPerson.getTotalRiskScore();
        }
        var resultsProp = searchType === "lexisnexis" ? "lexisNexisResults" : "totalResults";
        for (var k = 0; k < (currPerson[resultsProp] || []).length; k++) {
          var currentResult = currPerson[resultsProp][k];
          ++allResultsCounter;
          if (checkRelevancy && !currentResult.checkIsRelevant()) {
            continue;
          }
          if (currentResult.checkShouldBePublished && !currentResult.checkShouldBePublished()) {
            continue;
          }
          ++relevantResultsCounter;
          var comment = {
            category: "comment",
            date: new Date().getTime(),
            text: "[Adverse media check] " + currentResult.getTitle() + (currentResult.checkIsFromMatch && currentResult.checkIsFromMatch() ? " (related search)" : "")
          };
          var attachData = searchType === "lexisnexis" ? JSON.stringify(currentResult) : JSON.stringify(this.mapSearchEngineResult(currentResult, true));
          comment.files = [fileStorage.length];
          fileStorage.push(this.DataService.blobToFile(new Blob([attachData], {
            type: "application/json"
          }), "mediasearch." + searchType));
          if (MediaSearchService.getCommentIdFromItem(item, comment.text) == null) {
            allcomments.push(comment);
            allcommentitems.push(item);
          } else {
            comment.id = MediaSearchService.getCommentIdFromItem(item, comment.text);
            updcomments.push(comment);
            updcommentsitems.push(item);
          }
        }
      }
      var update = {};
      if (type === "alert") {
        update = {
          id: item.id,
          reason: {
            rules: [rule]
          }
        };
      } else {
        update = {
          query: {
            virtual_client: {
              id: item.id
            },
            isFromListEntry: item.listEntryId !== undefined && item.listEntryId !== null
          },
          reason: {
            rules: [rule]
          }
        };
      }
      var infoText = "Adverse media check was performed on " + this.$filter("formatTimestamp")(new Date().getTime()) + ", " + relevantResultsCounter + " documents of " + allResultsCounter + " were added";
      rule.Message = infoText;
      if (relevantResultsCounter) {
        if (item.Status === "Closed") {
          update.Status = "In process";
        }
      }
      allupdates.push(update);
      allupdsobjs.push(item);
      allupdplaces.push(i);
      var commonComment = {
        category: "comment",
        text: infoText
      };
      if (searchType !== "lexisnexis") {
        var totalPersonsResults = [];
        for (var _j = 0; _j < (item[searchType] || []).length; _j++) {
          var mappedPerson = this.mapSearchEnginePersonToAttachData(item[searchType][_j], checkRelevancy);
          totalPersonsResults.push(mappedPerson);
        }
        var _attachData = JSON.stringify(totalPersonsResults);
        commonComment.files = [fileStorage.length];
        fileStorage.push(this.DataService.blobToFile(new Blob([_attachData], {
          type: "application/json"
        }), "mediasearch.total_" + searchType));
      }
      allCommentsFinal.push(commonComment);
      allCommentItemsFinal.push(item);
    }
    var promises = [];
    for (var _i = 0; _i < allupdates.length; _i++) {
      if (type === "alert") {
        promises.push(this.wrapPromiseWithTimeout(this.DataService.updateObject("alert", allupdsobjs[_i], allupdates[_i], undefined)));
      } else {
        promises.push(this.wrapPromiseWithTimeout(this.DataService.createObject("alert", allupdates[_i])));
      }
    }
    this.$q.all(promises).then(function (results) {
      var promisesComments = [];
      var allCommentsVC = [];
      var allCommentItemsVC = [];
      if (type !== "alert") {
        if ("true" === "true") {
          allCommentsVC = _this31.angular.copy(allcomments.concat(updcomments));
          allCommentItemsVC = _this31.angular.copy(allcommentitems.concat(updcommentsitems));
        } else {
          allCommentsVC = cloneDeep(allcomments.concat(updcomments));
          allCommentItemsVC = cloneDeep(allcommentitems.concat(updcommentsitems));
        }
        MediaSearchService.replaceVirtualClientWithAlert(allCommentItemsVC, results);
      }
      var sendtype = type !== "alert" ? "virtual_client" : "alert";
      for (var _i2 = 0; _i2 < allcomments.length; _i2++) {
        if (allcommentitems[_i2]) {
          promisesComments.push(_this31.addCommentToObj(sendtype, allcommentitems[_i2], allcomments[_i2], fileStorage));
        }
      }
      for (var _i3 = 0; _i3 < updcomments.length; _i3++) {
        if (updcommentsitems[_i3]) {
          promisesComments.push(_this31.wrapPromiseWithTimeout(_this31.DataService.updateComment(sendtype, updcommentsitems[_i3], updcomments[_i3])));
        }
      }
      for (var _i4 = 0; _i4 < allCommentsVC.length; _i4++) {
        if (type !== "alert" && allCommentItemsVC[_i4]) {
          promisesComments.push(_this31.addCommentToObj("alert", allCommentItemsVC[_i4], allCommentsVC[_i4], fileStorage));
        }
      }
      _this31.$q.all(promisesComments).then(function () {
        var promisesFinal = [];
        var allCommentItemsFinalVC = [];
        if (type !== "alert") {
          if ("true" === "true") {
            allCommentItemsFinalVC = _this31.angular.copy(allCommentItemsFinal);
          } else {
            allCommentItemsFinalVC = cloneDeep(allCommentItemsFinal);
          }
          MediaSearchService.replaceVirtualClientWithAlert(allCommentItemsFinal, results);
        }
        for (var _i5 = 0; _i5 < allCommentsFinal.length; _i5++) {
          allCommentsFinal[_i5].date = new Date().getTime();
          var vccomment = null;
          if ("true" === "true") {
            vccomment = _this31.angular.copy(allCommentsFinal[_i5]);
          } else {
            vccomment = cloneDeep(allCommentsFinal[_i5]);
          }
          if (allCommentItemsFinal[_i5]) {
            promisesFinal.push(_this31.addCommentToObj("alert", allCommentItemsFinal[_i5], allCommentsFinal[_i5], fileStorage));
            vccomment.text = vccomment.text + " (<a href=\"/#/All/alert/" + allCommentItemsFinal[_i5].id + "\">" + allCommentItemsFinal[_i5].id + "</a>)";
          }
          if (type !== "alert") {
            promisesFinal.push(_this31.addCommentToObj("virtual_client", allCommentItemsFinalVC[_i5], vccomment, fileStorage));
          }
        }
        _this31.$q.all(promisesFinal).then(function () {
          for (var _i6 = 0; _i6 < results.length; _i6++) {
            if (type === "alert") {
              if ("true" === "true") {
                _this31.angular.merge(items[allupdplaces[_i6]], results[_i6]);
              } else {
                merge(items[allupdplaces[_i6]], results[_i6]);
              }
            }
          }
          var message = (searchType === "lexisnexis" ? "LexisNexis" : searchType === "googlesearch" ? "MediaSearch" : "BingSearch") + " publication completed!";
          publishResultsDefer.resolve({
            alertId: results[0].id,
            message: message
          });
        })["catch"](function (error) {
          _this31.logError(error);
          publishResultsDefer.reject(error);
        });
      })["catch"](function (error) {
        _this31.logError(error);
        publishResultsDefer.reject(error);
      });
    })["catch"](function (error) {
      _this31.logError(error);
      publishResultsDefer.reject(error);
    });
    return publishResultsDefer.promise;
  };
  _proto.addResultsAttach = function addResultsAttach(item) {
    var _this32 = this;
    try {
      if (item && item.lexis_nexis_audit_obj) {
        var attachData = JSON.stringify(item.lexisnexis);
        var comment = {
          category: "comment",
          date: new Date().getTime()
        };
        comment.text = "[Adverse media check] Results";
        var mediaSearchList = this.DataService.blobToFile(new Blob([attachData], {
          type: "application/json"
        }), "mediasearch.lexisnexislist");
        this.DataService.addComment("audit", item.lexis_nexis_audit_obj, comment, [mediaSearchList]).then(function () {})["catch"](function (error) {
          _this32.logError(error);
        });
      }
      if (item && item.media_search_audit_obj) {
        var totalPersonsResults = [];
        for (var j = 0; j < (item.googlesearch || []).length; j++) {
          var mappedPerson = this.mapSearchEnginePersonToAttachData(item.googlesearch[j], false);
          totalPersonsResults.push(mappedPerson);
        }
        var _attachData2 = JSON.stringify(totalPersonsResults);
        var _comment = {
          category: "comment",
          date: new Date().getTime()
        };
        _comment.text = "[Adverse media check] Results";
        var _mediaSearchList = this.DataService.blobToFile(new Blob([_attachData2], {
          type: "application/json"
        }), "mediasearch.googlesearchlist");
        this.DataService.addComment("audit", item.media_search_audit_obj, _comment, [_mediaSearchList]).then(function () {})["catch"](function (error) {
          _this32.logError(error);
        });
      }
    } catch (error) {
      this.logError(error);
    }
  };
  _proto.installTriggersOnScope = function installTriggersOnScope(scope, vm, omitFinishedChecking, itemFun) {
    var _this33 = this;
    scope.$on("lexisNexisThrottleMessage", function (event, data) {
      _this33.showMessage(data.ErrorDescription + " Total: " + data.ThrottleLimits + ". Remaining " + data.ThrottleRemaining, "error", MediaSearchService.getMessageViewModalTmpltPath("lexis-nexis"));
    });
    scope.$on("googleSearchThrottleMessage", function (event, data) {
      _this33.showMessage(data.message, "error", MediaSearchService.getMessageViewModalTmpltPath("google"));
    });
    scope.$on("bingSearchThrottleMessage", function (event, data) {
      _this33.showMessage((data.message || "") + " " + (data.moreDetails || ""), "error", MediaSearchService.getMessageViewModalTmpltPath("bing"));
    });
    vm.publishingLexisNexisDisabled = true;
    vm.publishingGoogleDisabled = true;
    vm.publishingBingDisabled = true;
    if (!omitFinishedChecking) {
      scope.$on("LexisNexisFinished", function (event, data) {
        if (data && data.itemId && vm.id && data.itemId.toString() === vm.id.toString()) {
          var item = null;
          if (itemFun) {
            item = itemFun();
          }
          _this33.addResultsAttach(item);
          vm.publishingLexisNexisDisabled = false;
        }
      });
      scope.$on("GoogleSearchFinished", function (event, data) {
        if (data && data.itemId && vm.id && data.itemId.toString() === vm.id.toString()) {
          var item = null;
          if (itemFun) {
            item = itemFun();
          }
          _this33.addResultsAttach(item);
          vm.publishingGoogleDisabled = false;
          vm.loadingMediaSearchResults = false;
        }
      });
      scope.$on("BingSearchFinished", function (event, data) {
        if (data && data.itemId && vm.id && data.itemId.toString() === vm.id.toString()) {
          vm.publishingBingDisabled = false;
        }
      });
    }
  };
  _proto.initCommonProperties = function initCommonProperties(vm) {
    vm.loaderSrc = "config/loader.gif";
    vm.searchBtnClicked = false;
    vm.loadingMediaSearchResults = false;
    vm.publishingResults = false;
    vm.elastic_timers = {};
  };
  _proto.initCountriesPropertiesActions = function initCountriesPropertiesActions(vm) {
    var _this34 = this;
    vm.country = "?";
    vm.userCountry = "?";
    this.ConfigService.get().then(function () {
      vm.countries = [{
        name: _this34.$filter("translate")("NAME_CHECK_EMPTY_COUNTRY"),
        alpha2: "?",
        alpha3: "?"
      }];
    })["catch"](function (error) {
      _this34.logError(error);
    });
    vm.loadCountries = function () {
      var deferred = _this34.$q.defer();
      _this34.ConfigService.getUserConfig().then(function (config) {
        deferred.resolve(config.countries.map(function (cnt) {
          return {
            name: cnt.name,
            alpha2: cnt.alpha2
          };
        }));
      })["catch"](function (error) {
        deferred.reject(error);
      });
      return deferred.promise;
    };
  };
  _proto.initModeProperties = function initModeProperties(vm) {
    var _this35 = this;
    vm.fastProcessing = false;
    this.ConfigService.get().then(function () {
      vm.scoreModes = [{
        label: _this35.$filter("translate")("MEDIA_SEARCH_CRIMINAL_PERSONS"),
        value: "criminals"
      }, {
        label: _this35.$filter("translate")("MEDIA_SEARCH_COMPANIES"),
        value: "companies"
      }, {
        label: _this35.$filter("translate")("MEDIA_SEARCH_ESG"),
        value: "esg"
      }];
      vm.scoreMode = vm.scoreModes.find(function (scoreMode) {
        return scoreMode.value === "criminals";
      }).value;
    })["catch"](function (error) {
      _this35.logError(error);
    });
  };
  _proto.initFilterDatePropertiesActions = function initFilterDatePropertiesActions(vm) {
    var _this36 = this;
    vm.date = "";
    vm.showResultsWithoutDate = true;
    var today = new Date();
    this.ConfigService.get().then(function () {
      vm.datePeriods = [{
        label: _this36.$filter("translate")("LAST_DAY"),
        dateFrom: MediaSearchService.getDaysOffset(today, -1).getTime(),
        dateTo: today.getTime()
      }, {
        label: _this36.$filter("translate")("LAST_WEEK"),
        dateFrom: MediaSearchService.getDaysOffset(today, -7).getTime(),
        dateTo: today.getTime()
      }, {
        label: _this36.$filter("translate")("LAST_MONTH"),
        dateFrom: MediaSearchService.getMonthsOffset(today, -1).getTime(),
        dateTo: today.getTime()
      }, {
        label: _this36.$filter("translate")("LAST_THREE_MONTH"),
        dateFrom: MediaSearchService.getMonthsOffset(today, -3).getTime(),
        dateTo: today.getTime()
      }, {
        label: _this36.$filter("translate")("LAST_SIX_MONTHS"),
        dateFrom: MediaSearchService.getMonthsOffset(today, -6).getTime(),
        dateTo: today.getTime()
      }, {
        label: _this36.$filter("translate")("LAST_YEAR"),
        dateFrom: MediaSearchService.getYearsOffset(today, -1).getTime(),
        dateTo: today.getTime()
      }];
    })["catch"](function (error) {
      _this36.logError(error);
    });
    vm.selectPeriod = function (period) {
      vm.date = [moment(period.dateFrom).format("YYYYMMDDHHmmss"), moment(period.dateTo).format("YYYYMMDDHHmmss")].join(":");
    };
  };
  _proto.initFilterPropertiesActions = function initFilterPropertiesActions(vm) {
    vm.applyFiltersToResults = function () {
      if (!vm.item || !vm.item.googlesearch || !vm.item.googlesearch[0]) {
        return;
      }
      var dateFrom = null;
      var dateTo = null;
      if (vm.date) {
        var spl = vm.date.split(":");
        if (spl[0].length > 0) {
          dateFrom = MediaSearchService.getDateFromString(spl[0]);
        }
        if (spl[1].length > 0) {
          dateTo = MediaSearchService.getDateFromString(spl[1]);
        }
      }
      var languagesCodes = vm.selectedLanguagesConfigs.map(function (lang) {
        return lang.google_news_rss_value;
      });
      var sourcesValues = vm.selectedSourcesConfigs.map(function (source) {
        return source.value;
      });
      var person = vm.item.googlesearch[0];
      if (person) {
        person.applyFiltersToResults(dateFrom, dateTo, vm.showResultsWithoutDate, languagesCodes, sourcesValues);
      }
    };
    vm.resetFilters = function () {
      vm.date = "";
      vm.showResultsWithoutDate = true;
      vm.selectedLanguagesLabels = [];
      vm.selectedLanguagesConfigs = [];
      vm.selectedSourcesLabels = [];
      vm.selectedSourcesConfigs = [];
      if (!vm.item || !vm.item.googlesearch || !vm.item.googlesearch[0]) {
        return;
      }
      var person = vm.item.googlesearch[0];
      if (person) {
        person.resetFiltersToResults();
      }
    };
  };
  _proto.initKeywordsPropertiesActions = function initKeywordsPropertiesActions(vm) {
    var _this37 = this;
    vm.additionalKeywordsConfigs = [];
    vm.additionalKeywords = [];
    vm.mandatoryKeywords = [];
    vm.optionalKeywords = [];
    vm.initAdditionalKeywords = function () {
      vm.additionalKeywords = [];
      vm.mandatoryKeywords = [];
      vm.optionalKeywords = [];
      try {
        if (localStorage.getItem("additionalKeywords")) {
          vm.additionalKeywords = JSON.parse(localStorage.getItem("additionalKeywords"));
        }
      } catch (error) {
        _this37.logError(error);
      }
    };
    vm.updateAdditionalKeywords = function () {
      vm.additionalKeywords = (vm.additionalKeywords || []).concat(vm.optionalKeywords).concat(vm.mandatoryKeywords).filter(MediaSearchService.onlyUnique);
      localStorage.setItem("additionalKeywords", JSON.stringify(vm.additionalKeywords));
    };
    vm.elasticKeywordsQueryFactory = function (keywordsType) {
      return function (query) {
        var preResults = [];
        var unify = function unify(addition) {
          if (addition && addition.filter !== undefined) {
            preResults = preResults.concat(addition.filter(function (item) {
              return preResults.indexOf(item) === -1;
            }));
          }
        };
        vm.elastic_timers[keywordsType] = new Date();
        var myTimer = vm.elastic_timers[keywordsType];
        if (query.term && query.term.indexOf(";") === -1) {
          var searchStr = query.term.toLowerCase();
          this.$timeout(function () {
            if (myTimer !== vm.elastic_timers[keywordsType]) {
              return;
            }
            var filteredKeywords = vm.additionalKeywords.filter(function (keyword) {
              return searchStr === " " || searchStr === "" ? true : keyword.toLowerCase().indexOf(searchStr) !== -1;
            });
            if (filteredKeywords.length) {
              var insertItem = true;
              var results = filteredKeywords.map(function (keyword) {
                if (keyword === searchStr) {
                  insertItem = false;
                }
                return {
                  id: keyword,
                  text: keyword
                };
              });
              if (insertItem && searchStr.trim().length) {
                results = [{
                  id: searchStr,
                  text: searchStr
                }].concat(results);
              }
              query.callback({
                results: results
              });
            } else {
              unify([searchStr]);
              query.callback({
                results: preResults.map(function (item) {
                  return {
                    id: item,
                    text: "" + item
                  };
                })
              });
            }
          }, 300);
        } else {
          if (!query.term.trim()) {
            preResults = [].concat(vm.additionalKeywords);
          } else if (query.term.indexOf(";") !== -1) {
            unify([query.term]);
          }
          unify(vm[keywordsType]);
          query.callback({
            results: preResults.map(function (item) {
              return {
                id: item,
                text: "" + item
              };
            })
          });
        }
      };
    };
  };
  _proto.initLanguagesPropertiesActions = function initLanguagesPropertiesActions(vm) {
    var _this38 = this;
    vm.allLanguagesLabels = [];
    vm.allLanguagesConfigs = [];
    vm.selectedLanguagesLabels = [];
    vm.selectedLanguagesConfigs = [];
    this.ConfigService.getUserConfig().then(function (config) {
      if (config && config.search_ner_services && config.search_ner_services.languages) {
        vm.allLanguagesConfigs = [].concat(config.search_ner_services.languages);
      }
      vm.allLanguagesLabels = vm.allLanguagesConfigs.map(function (language) {
        return language.label;
      });
    })["catch"](function (error) {
      _this38.logError(error);
    });
    vm.initLanguages = function () {
      vm.selectedLanguagesLabels = [];
      vm.selectedLanguagesConfigs = [];
    };
    vm.updateLanguages = function () {
      if (vm.selectedLanguagesLabels && vm.selectedLanguagesLabels.length) {
        vm.selectedLanguagesConfigs = vm.allLanguagesConfigs.filter(function (config) {
          return vm.selectedLanguagesLabels.find(function (label) {
            return label === config.label;
          }) !== undefined;
        });
      } else {
        vm.selectedLanguagesConfigs = [];
      }
    };
    vm.elasticLanguageQueryFactory = function (type) {
      return function (query) {
        var preResults = [];
        var unify = function unify(addition) {
          if (addition && addition.filter !== undefined) {
            preResults = preResults.concat(addition.filter(function (item) {
              return preResults.indexOf(item) === -1;
            }));
          }
        };
        vm.elastic_timers[type] = new Date();
        var myTimer = vm.elastic_timers[type];
        if (query.term && query.term.indexOf(";") === -1) {
          var searchStr = query.term.toLowerCase();
          this.$timeout(function () {
            if (myTimer !== vm.elastic_timers[type]) {
              return;
            }
            var filteredLanguages = vm.allLanguagesLabels.filter(function (language) {
              return searchStr === " " || searchStr === "" ? true : language.toLowerCase().indexOf(searchStr) !== -1;
            });
            if (filteredLanguages.length) {
              var insertTerm = false;
              var results = filteredLanguages.map(function (language) {
                if (language === searchStr) {
                  insertTerm = false;
                }
                return {
                  id: language,
                  text: language
                };
              });
              query.callback({
                results: results
              });
            } else {
              query.callback({
                results: preResults.map(function (item) {
                  return {
                    id: item,
                    text: "" + item
                  };
                })
              });
            }
          }, 300);
        } else {
          if (!query.term.trim()) {
            preResults = [].concat(vm.allLanguagesLabels);
          } else if (query.term.indexOf(";") !== -1) {}
          unify(vm.allLanguagesLabels);
          query.callback({
            results: preResults.map(function (item) {
              return {
                id: item,
                text: "" + item
              };
            })
          });
        }
      };
    };
  };
  _proto.initSearchSourcesPropertiesActions = function initSearchSourcesPropertiesActions(vm) {
    var _this39 = this;
    vm.allSourcesLabels = [];
    vm.allSourcesConfigs = [];
    vm.selectedSourcesLabels = [];
    vm.selectedSourcesConfigs = [];
    this.ConfigService.getUserConfig().then(function (config) {
      if (config && config.search_ner_services && config.search_ner_services.sources) {
        vm.allSourcesConfigs = [].concat(config.search_ner_services.sources);
      }
      vm.allSourcesLabels = vm.allSourcesConfigs.map(function (source) {
        return source.label;
      });
    })["catch"](function (error) {
      _this39.logError(error);
    });
    vm.initSources = function () {
      vm.selectedSourcesLabels = [];
      vm.selectedSourcesConfigs = [];
    };
    vm.updateSources = function () {
      if (vm.selectedSourcesLabels && vm.selectedSourcesLabels.length) {
        vm.selectedSourcesConfigs = vm.allSourcesConfigs.filter(function (config) {
          return vm.selectedSourcesLabels.find(function (label) {
            return label === config.label;
          }) !== undefined;
        });
      } else {
        vm.selectedSourcesConfigs = [];
      }
    };
    vm.elasticSourceQueryFactory = function (type) {
      return function (query) {
        var preResults = [];
        var unify = function unify(addition) {
          if (addition && addition.filter !== undefined) {
            preResults = preResults.concat(addition.filter(function (item) {
              return preResults.indexOf(item) === -1;
            }));
          }
        };
        vm.elastic_timers[type] = new Date();
        var myTimer = vm.elastic_timers[type];
        if (query.term && query.term.indexOf(";") === -1) {
          var searchStr = query.term.toLowerCase();
          this.$timeout(function () {
            if (myTimer !== vm.elastic_timers[type]) {
              return;
            }
            var filteredSources = vm.allSourcesLabels.filter(function (language) {
              return searchStr === " " || searchStr === "" ? true : language.toLowerCase().indexOf(searchStr) !== -1;
            });
            if (filteredSources.length) {
              var insertTerm = false;
              var results = filteredSources.map(function (source) {
                if (source === searchStr) {
                  insertTerm = false;
                }
                return {
                  id: source,
                  text: source
                };
              });
              query.callback({
                results: results
              });
            } else {
              query.callback({
                results: preResults.map(function (item) {
                  return {
                    id: item,
                    text: "" + item
                  };
                })
              });
            }
          }, 300);
        } else {
          if (!query.term.trim()) {
            preResults = [].concat(vm.allSourcesLabels);
          } else if (query.term.indexOf(";") !== -1) {}
          unify(vm.allSourcesLabels);
          query.callback({
            results: preResults.map(function (item) {
              return {
                id: item,
                text: "" + item
              };
            })
          });
        }
      };
    };
  };
  _proto.initExpandCollapseMethods = function initExpandCollapseMethods(vm, itemFun) {
    var _this40 = this;
    vm.GoogleSearchExpandCollapse = function (flag) {
      var item = null;
      if (itemFun) {
        item = itemFun();
      }
      if (!item) {
        return;
      }
      var _item = item,
        googlesearch = _item.googlesearch;
      if (googlesearch) {
        for (var j in googlesearch) {
          var ln = googlesearch[j];
          ln.setOpen(flag);
          _this40.expandCollapseResults("google", ln, flag);
        }
      }
    };
    vm.BingSearchExpandCollapse = function (flag) {
      var item = null;
      if (itemFun) {
        item = itemFun();
      }
      if (!item) {
        return;
      }
      var _item2 = item,
        bingsearch = _item2.bingsearch;
      if (bingsearch) {
        for (var j in bingsearch) {
          var ln = bingsearch[j];
          ln.setOpen(flag);
          _this40.expandCollapseResults("bing", ln, flag);
        }
      }
    };
    vm.LexisNexisExpandCollapse = function (flag) {
      var item = null;
      if (itemFun) {
        item = itemFun();
      }
      if (!item) {
        return;
      }
      var _item3 = item,
        lexisnexis = _item3.lexisnexis;
      if (lexisnexis) {
        for (var j in lexisnexis) {
          var ln = lexisnexis[j];
          ln.setOpen(flag);
        }
      }
    };
  };
  _proto.showMoreMentionedItems = function showMoreMentionedItems($event, item, type) {
    $event.stopPropagation();
    $event.preventDefault();
    if (item.__version__) {
      if (type === "persons") {
        item.setTopMentionedItemsCount(item.getMentionedItems("persons").length, "persons");
      }
      if (type === "orgs") {
        item.setTopMentionedItemsCount(item.getMentionedItems("orgs").length, "orgs");
      }
      if (type === "locations") {
        item.setTopMentionedItemsCount(item.getMentionedItems("locs").length, "locs");
      }
    } else {
      if (type === "persons") {
        item.setTopMentionedPersonsCount(item.getMentionedPersons().length);
      }
      if (type === "orgs") {
        item.setTopMentionedOrgsCount(item.getMentionedOrgs().length);
      }
      if (type === "locations") {
        item.setTopMentionedLocsCount(item.getMentionedLocs().length);
      }
    }
  };
  _proto.showMoreGptRelatedEntities = function showMoreGptRelatedEntities($event, item, type) {
    $event.stopPropagation();
    $event.preventDefault();
    if (type === "persons") {
      if (item instanceof MediaSearchPersonV5) {
        item.setTopGptRelatedEntitiesPersonsCount(item.getGptMostImportantPersons().length);
      } else if (item instanceof MediaPyGptPersonV1) {
        item.setTopGptRelatedItemsCount(item.getGptRelatedItems("persons").length, "persons");
      } else {
        item.setTopGptRelatedItemsCount(item.getGptRelatedItems("persons").length, "persons");
      }
    }
    if (type === "orgs") {
      if (item instanceof MediaSearchPersonV5) {
        item.setTopGptRelatedEntitiesOrgsCount(item.getGptMostImportantOrganizations().length);
      } else if (item instanceof MediaPyGptPersonV1) {
        item.setTopGptRelatedItemsCount(item.getGptRelatedItems("orgs").length, "orgs");
      } else {
        item.setTopGptRelatedItemsCount(item.getGptRelatedItems("orgs").length, "orgs");
      }
    }
    if (type === "topics") {
      if (item instanceof MediaSearchPersonV5) {
        item.setTopGptRelatedTopicsCount(item.getGptRelatedTopics().length);
      } else if (item instanceof MediaPyGptPersonV1) {
        item.setTopGptRelatedTopicsCount(item.getGptRelatedTopics().length);
      }
    }
  };
  _proto.showMoreLLMMentionedItems = function showMoreLLMMentionedItems($event, item, type) {
    $event.stopPropagation();
    $event.preventDefault();
    if (type === "persons") {
      item.setTopLLMMentionedEntitiesCount(item.getLLMMentionedEntities("persons").length, "persons");
    }
    if (type === "orgs") {
      item.setTopLLMMentionedEntitiesCount(item.getLLMMentionedEntities("orgs").length, "orgs");
    }
  };
  _proto.showMoreAssociatedItems = function showMoreAssociatedItems($event, person, type) {
    $event.stopPropagation();
    $event.preventDefault();
    if (person.__version__) {
      if (type === "persons") {
        person.setTopMentionedItemsCount(person.getMostCommonMentionedItems("persons").length, "persons");
      }
      if (type === "orgs") {
        person.setTopMentionedItemsCount(person.getMostCommonMentionedItems("orgs").length, "orgs");
      }
      if (type === "locations") {
        person.setTopMentionedItemsCount(person.getMostCommonMentionedItems("locs").length, "locs");
      }
    } else {
      if (type === "persons") {
        person.setTopMentionedPersonsCount(person.getMostCommonMentionedPersons().length);
      }
      if (type === "orgs") {
        person.setTopMentionedOrgsCount(person.getMostCommonMentionedOrgs().length);
      }
      if (type === "locations") {
        person.setTopMentionedLocsCount(person.getMostCommonMentionedLocs().length);
      }
    }
  };
  _proto.setItemCountry = function setItemCountry(vm, item) {
    var _this41 = this;
    vm.loadCountries().then(function (countries) {
      vm.countries = vm.countries.concat(countries);
      var countryArray = MediaSearchService.getField(item, ["query.virtual_client.ADDR_COUNTRY", "virtual_client.ADDR_COUNTRY", "client.ADDR_COUNTRY", "ADDR_COUNTRY", "Country"], true);
      if (countryArray && Array.isArray(countryArray) && countryArray.length) {
        var _loop = function _loop(i) {
          var country = vm.countries.find(function (ctr) {
            return (ctr.alpha3 || "").toLowerCase() === countryArray[i].toLowerCase() || (ctr.alpha2 || "").toLowerCase() === countryArray[i].toLowerCase() || (ctr.name || "").toLowerCase() === countryArray[i].toLowerCase();
          });
          if (country) {
            vm.country = country.alpha2;
            return 1;
          }
        };
        for (var i = 0; i < countryArray.length; i++) {
          if (_loop(i)) break;
        }
      }
    })["catch"](function (error) {
      _this41.logError(error);
    });
  };
  _proto.resetFormData = function resetFormData(vm) {
    if (vm.initAdditionalKeywords) {
      vm.initAdditionalKeywords();
    }
    if (vm.initLanguages) {
      vm.initLanguages();
    }
    vm.date = "";
    vm.showResultsWithoutDate = true;
  };
  _proto.showMessage = function showMessage(text, type, tmplt) {
    var _this42 = this;
    if (this.$uibModal) {
      this.$uibModal.open({
        templateUrl: "views/modals/details-modal.html",
        controller: "DetailsModalCtrl",
        controllerAs: "detailsModal",
        size: "lg",
        resolve: {
          item: function item() {
            return {
              type: type,
              text: text
            };
          },
          itemType: function itemType() {
            return "";
          },
          config: function config() {
            return _this42.userConfig;
          },
          viewTemplate: function viewTemplate() {
            return tmplt;
          },
          aux: function aux() {
            return null;
          }
        }
      });
    }
  };
  _proto.viewMatchInfo = function viewMatchInfo(searchEngine, _item4) {
    var _this43 = this;
    if (this.$uibModal) {
      var serviceInit$ = null;
      if (this.adapters[searchEngine].loaded) {
        serviceInit$ = this.promiseWrapper({});
      } else {
        serviceInit$ = this.initSearchEngine$(searchEngine);
      }
      serviceInit$.then(function () {
        _this43.$uibModal.open({
          templateUrl: "views/modals/details-modal.html",
          controller: "DetailsModalCtrl",
          controllerAs: "detailsModal",
          size: "lg",
          resolve: {
            item: function item() {
              return _item4;
            },
            itemType: function itemType() {
              return "list";
            },
            config: function config() {
              return _this43.userConfig;
            },
            viewTemplate: function viewTemplate() {
              return _this43.userConfig.types.list.view.details;
            },
            aux: function aux() {
              return null;
            }
          }
        });
      })["catch"](function (error) {
        _this43.logError(error);
      });
    }
  };
  _proto.addAlertItemIdToLinkAnalys = function addAlertItemIdToLinkAnalys(alertItemId, parentPersonId, searchResultId, linkAnalysServiceId) {};
  _proto.destroy = function destroy() {
    this.$rootScope = null;
    this.$http = null;
    this.$q = null;
    this.$timeout = null;
    this.cfpLoadingBar = null;
    this.API_BASE = "";
    this.ConfigService = null;
    this.UserService = null;
    this.DataService = null;
    this.$filter = null;
    this.$uibModal = null;
    if (this.adapters.lexisNexis.adapter) {
      this.adapters.lexisNexis.adapter.destroy();
    }
    if (this.adapters.google.adapter) {
      this.adapters.google.adapter.destroy();
    }
    this.adapters = {
      lexisNexis: {
        adapter: null,
        defer: null,
        loading: false,
        loaded: false
      },
      google: {
        adapter: null,
        defer: null,
        loading: false,
        loaded: false
      },
      bing: {
        adapter: null,
        defer: null,
        loading: false,
        loaded: false
      }
    };
    this.config = null;
    this.userConfig = null;
    this.errorLogger = null;
    this.infoLogger = null;
  };
  _proto.wrapPromiseWithTimeout = function wrapPromiseWithTimeout(innerPromise$) {
    var defer = this.$q.defer();
    var timeout = MediaSearchService.randomIntFromInterval(0, 2000);
    var promiseTimeout = setTimeout(function () {
      clearTimeout(promiseTimeout);
      innerPromise$.then(function (resp) {
        defer.resolve(resp);
      })["catch"](function (error) {
        defer.reject(error);
      });
    }, timeout);
    return defer.promise;
  };
  MediaSearchService.getField = function getField(item, sources, isResultArray) {
    var result = [];
    sources.forEach(function (source) {
      var jsonResult = [];
      try {
        jsonResult = JSONPath({
          path: source,
          json: item
        });
      } catch (error) {}
      result = result.concat(jsonResult);
    });
    result = result.filter(function (r) {
      return r;
    }).filter(MediaSearchService.onlyUnique).filter(function (r) {
      return !MediaSearchService.isNumeric((r || "").toString());
    });
    if (isResultArray) {
      return result;
    }
    return result.join(" ");
  };
  MediaSearchService.getDateFromString = function getDateFromString(str) {
    return new Date(parseInt(str.substring(0, 4), 10), parseInt(str.substring(4, 6), 10) - 1, parseInt(str.substring(6, 8), 10));
  };
  MediaSearchService.getDaysOffset = function getDaysOffset(initDate, n) {
    var date = new Date(initDate);
    date.setDate(date.getDate() + n);
    date.setHours(0, 0, 0, 0);
    return date;
  };
  MediaSearchService.getMonthsOffset = function getMonthsOffset(initDate, n) {
    var date = new Date(initDate);
    date.setMonth(date.getMonth() + n);
    date.setHours(0, 0, 0, 0);
    return date;
  };
  MediaSearchService.getYearsOffset = function getYearsOffset(initDate, n) {
    var date = new Date(initDate);
    date.setFullYear(date.getFullYear() + n);
    date.setHours(0, 0, 0, 0);
    return date;
  };
  MediaSearchService.randomIntFromInterval = function randomIntFromInterval(min, max) {
    return Math.floor(Math.random() * (max - min + 1) + min);
  };
  MediaSearchService.onlyUnique = function onlyUnique(value, index, self) {
    return self.indexOf(value) === index;
  };
  MediaSearchService.isNumeric = function isNumeric(str) {
    if (typeof str !== "string") return false;
    return !isNaN(str) && !isNaN(parseFloat(str));
  };
  MediaSearchService.getAuditOrgClient = function getAuditOrgClient(vm) {
    if (vm.userOrgClient && vm.userOrgClient !== "?") {
      return vm.userOrgClient;
    }
    return (vm.currentUser.orgClients || []).length ? vm.currentUser.orgClients[0] || "" : "";
  };
  return MediaSearchService;
}();
module.exports = {
  MediaSearchService: MediaSearchService
};

}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"./constants/source-types":697,"./lexis-nexis/common-adapter-v6":703,"./media-search-v2/common-adapter-v1":759,"./media-search-v2/models/person":815,"./media-search-v2/models/result-items":842,"./media-search/models/media-search-person-v5":893,"./media-search/models/result-items-v5/aleph-occrp-result-item-v5":894,"./media-search/models/result-items-v5/extra-source-result-item-v5":898,"./media-search/models/result-items-v5/google-news-result-item-v5":899,"./media-search/models/result-items-v5/match-result-item-v5":900,"./media-search/models/result-items-v5/open-corporates-result-item-v5":902,"./media-search/models/result-items-v5/open-sanctions-result-item-v5":903,"./media-search/models/result-items-v5/search-engine-result-item-v5":905,"./media-search/models/result-items-v5/stock-market-result-item-v5":907,"./mediasearch-graph":908,"lodash/fp/cloneDeep":640,"lodash/fp/merge":642}]},{},[698])(698)
});
