react-tooltip 4.2.21 → 4.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -2,6 +2,32 @@ import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { v4 } from 'uuid';
4
4
 
5
+ function ownKeys$2(object, enumerableOnly) {
6
+ var keys = Object.keys(object);
7
+
8
+ if (Object.getOwnPropertySymbols) {
9
+ var symbols = Object.getOwnPropertySymbols(object);
10
+ enumerableOnly && (symbols = symbols.filter(function (sym) {
11
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
12
+ })), keys.push.apply(keys, symbols);
13
+ }
14
+
15
+ return keys;
16
+ }
17
+
18
+ function _objectSpread2(target) {
19
+ for (var i = 1; i < arguments.length; i++) {
20
+ var source = null != arguments[i] ? arguments[i] : {};
21
+ i % 2 ? ownKeys$2(Object(source), !0).forEach(function (key) {
22
+ _defineProperty(target, key, source[key]);
23
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$2(Object(source)).forEach(function (key) {
24
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
25
+ });
26
+ }
27
+
28
+ return target;
29
+ }
30
+
5
31
  function _classCallCheck(instance, Constructor) {
6
32
  if (!(instance instanceof Constructor)) {
7
33
  throw new TypeError("Cannot call a class as a function");
@@ -21,6 +47,9 @@ function _defineProperties(target, props) {
21
47
  function _createClass(Constructor, protoProps, staticProps) {
22
48
  if (protoProps) _defineProperties(Constructor.prototype, protoProps);
23
49
  if (staticProps) _defineProperties(Constructor, staticProps);
50
+ Object.defineProperty(Constructor, "prototype", {
51
+ writable: false
52
+ });
24
53
  return Constructor;
25
54
  }
26
55
 
@@ -40,7 +69,7 @@ function _defineProperty(obj, key, value) {
40
69
  }
41
70
 
42
71
  function _extends() {
43
- _extends = Object.assign || function (target) {
72
+ _extends = Object.assign ? Object.assign.bind() : function (target) {
44
73
  for (var i = 1; i < arguments.length; i++) {
45
74
  var source = arguments[i];
46
75
 
@@ -53,44 +82,9 @@ function _extends() {
53
82
 
54
83
  return target;
55
84
  };
56
-
57
85
  return _extends.apply(this, arguments);
58
86
  }
59
87
 
60
- function ownKeys(object, enumerableOnly) {
61
- var keys = Object.keys(object);
62
-
63
- if (Object.getOwnPropertySymbols) {
64
- var symbols = Object.getOwnPropertySymbols(object);
65
- if (enumerableOnly) symbols = symbols.filter(function (sym) {
66
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
67
- });
68
- keys.push.apply(keys, symbols);
69
- }
70
-
71
- return keys;
72
- }
73
-
74
- function _objectSpread2(target) {
75
- for (var i = 1; i < arguments.length; i++) {
76
- var source = arguments[i] != null ? arguments[i] : {};
77
-
78
- if (i % 2) {
79
- ownKeys(Object(source), true).forEach(function (key) {
80
- _defineProperty(target, key, source[key]);
81
- });
82
- } else if (Object.getOwnPropertyDescriptors) {
83
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
84
- } else {
85
- ownKeys(Object(source)).forEach(function (key) {
86
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
87
- });
88
- }
89
- }
90
-
91
- return target;
92
- }
93
-
94
88
  function _inherits(subClass, superClass) {
95
89
  if (typeof superClass !== "function" && superClass !== null) {
96
90
  throw new TypeError("Super expression must either be null or a function");
@@ -103,25 +97,40 @@ function _inherits(subClass, superClass) {
103
97
  configurable: true
104
98
  }
105
99
  });
100
+ Object.defineProperty(subClass, "prototype", {
101
+ writable: false
102
+ });
106
103
  if (superClass) _setPrototypeOf(subClass, superClass);
107
104
  }
108
105
 
109
106
  function _getPrototypeOf(o) {
110
- _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
107
+ _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
111
108
  return o.__proto__ || Object.getPrototypeOf(o);
112
109
  };
113
110
  return _getPrototypeOf(o);
114
111
  }
115
112
 
116
113
  function _setPrototypeOf(o, p) {
117
- _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
114
+ _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
118
115
  o.__proto__ = p;
119
116
  return o;
120
117
  };
121
-
122
118
  return _setPrototypeOf(o, p);
123
119
  }
124
120
 
121
+ function _isNativeReflectConstruct() {
122
+ if (typeof Reflect === "undefined" || !Reflect.construct) return false;
123
+ if (Reflect.construct.sham) return false;
124
+ if (typeof Proxy === "function") return true;
125
+
126
+ try {
127
+ Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
128
+ return true;
129
+ } catch (e) {
130
+ return false;
131
+ }
132
+ }
133
+
125
134
  function _assertThisInitialized(self) {
126
135
  if (self === void 0) {
127
136
  throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
@@ -133,1273 +142,902 @@ function _assertThisInitialized(self) {
133
142
  function _possibleConstructorReturn(self, call) {
134
143
  if (call && (typeof call === "object" || typeof call === "function")) {
135
144
  return call;
145
+ } else if (call !== void 0) {
146
+ throw new TypeError("Derived constructors may only return object or undefined");
136
147
  }
137
148
 
138
149
  return _assertThisInitialized(self);
139
150
  }
140
151
 
141
- var CONSTANT = {
142
- GLOBAL: {
143
- HIDE: '__react_tooltip_hide_event',
144
- REBUILD: '__react_tooltip_rebuild_event',
145
- SHOW: '__react_tooltip_show_event'
146
- }
147
- };
148
-
149
- /**
150
- * Static methods for react-tooltip
151
- */
152
+ function _createSuper(Derived) {
153
+ var hasNativeReflectConstruct = _isNativeReflectConstruct();
152
154
 
153
- var dispatchGlobalEvent = function dispatchGlobalEvent(eventName, opts) {
154
- // Compatible with IE
155
- // @see http://stackoverflow.com/questions/26596123/internet-explorer-9-10-11-event-constructor-doesnt-work
156
- // @see https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent
157
- var event;
155
+ return function _createSuperInternal() {
156
+ var Super = _getPrototypeOf(Derived),
157
+ result;
158
158
 
159
- if (typeof window.CustomEvent === 'function') {
160
- event = new window.CustomEvent(eventName, {
161
- detail: opts
162
- });
163
- } else {
164
- event = document.createEvent('Event');
165
- event.initEvent(eventName, false, true, opts);
166
- }
159
+ if (hasNativeReflectConstruct) {
160
+ var NewTarget = _getPrototypeOf(this).constructor;
167
161
 
168
- window.dispatchEvent(event);
169
- };
162
+ result = Reflect.construct(Super, arguments, NewTarget);
163
+ } else {
164
+ result = Super.apply(this, arguments);
165
+ }
170
166
 
171
- function staticMethods (target) {
172
- /**
173
- * Hide all tooltip
174
- * @trigger ReactTooltip.hide()
175
- */
176
- target.hide = function (target) {
177
- dispatchGlobalEvent(CONSTANT.GLOBAL.HIDE, {
178
- target: target
179
- });
167
+ return _possibleConstructorReturn(this, result);
180
168
  };
181
- /**
182
- * Rebuild all tooltip
183
- * @trigger ReactTooltip.rebuild()
184
- */
169
+ }
185
170
 
171
+ function _unsupportedIterableToArray(o, minLen) {
172
+ if (!o) return;
173
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
174
+ var n = Object.prototype.toString.call(o).slice(8, -1);
175
+ if (n === "Object" && o.constructor) n = o.constructor.name;
176
+ if (n === "Map" || n === "Set") return Array.from(o);
177
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
178
+ }
186
179
 
187
- target.rebuild = function () {
188
- dispatchGlobalEvent(CONSTANT.GLOBAL.REBUILD);
189
- };
190
- /**
191
- * Show specific tooltip
192
- * @trigger ReactTooltip.show()
193
- */
180
+ function _arrayLikeToArray(arr, len) {
181
+ if (len == null || len > arr.length) len = arr.length;
194
182
 
183
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
195
184
 
196
- target.show = function (target) {
197
- dispatchGlobalEvent(CONSTANT.GLOBAL.SHOW, {
198
- target: target
199
- });
200
- };
185
+ return arr2;
186
+ }
201
187
 
202
- target.prototype.globalRebuild = function () {
203
- if (this.mount) {
204
- this.unbindListener();
205
- this.bindListener();
206
- }
207
- };
188
+ function _createForOfIteratorHelper(o, allowArrayLike) {
189
+ var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
208
190
 
209
- target.prototype.globalShow = function (event) {
210
- if (this.mount) {
211
- var hasTarget = event && event.detail && event.detail.target && true || false; // Create a fake event, specific show will limit the type to `solid`
212
- // only `float` type cares e.clientX e.clientY
191
+ if (!it) {
192
+ if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
193
+ if (it) o = it;
194
+ var i = 0;
213
195
 
214
- this.showTooltip({
215
- currentTarget: hasTarget && event.detail.target
216
- }, true);
196
+ var F = function () {};
197
+
198
+ return {
199
+ s: F,
200
+ n: function () {
201
+ if (i >= o.length) return {
202
+ done: true
203
+ };
204
+ return {
205
+ done: false,
206
+ value: o[i++]
207
+ };
208
+ },
209
+ e: function (e) {
210
+ throw e;
211
+ },
212
+ f: F
213
+ };
217
214
  }
218
- };
219
215
 
220
- target.prototype.globalHide = function (event) {
221
- if (this.mount) {
222
- var hasTarget = event && event.detail && event.detail.target && true || false;
223
- this.hideTooltip({
224
- currentTarget: hasTarget && event.detail.target
225
- }, hasTarget);
216
+ throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
217
+ }
218
+
219
+ var normalCompletion = true,
220
+ didErr = false,
221
+ err;
222
+ return {
223
+ s: function () {
224
+ it = it.call(o);
225
+ },
226
+ n: function () {
227
+ var step = it.next();
228
+ normalCompletion = step.done;
229
+ return step;
230
+ },
231
+ e: function (e) {
232
+ didErr = true;
233
+ err = e;
234
+ },
235
+ f: function () {
236
+ try {
237
+ if (!normalCompletion && it.return != null) it.return();
238
+ } finally {
239
+ if (didErr) throw err;
240
+ }
226
241
  }
227
242
  };
228
243
  }
229
244
 
230
- /**
231
- * Events that should be bound to the window
232
- */
233
- function windowListener (target) {
234
- target.prototype.bindWindowEvents = function (resizeHide) {
235
- // ReactTooltip.hide
236
- window.removeEventListener(CONSTANT.GLOBAL.HIDE, this.globalHide);
237
- window.addEventListener(CONSTANT.GLOBAL.HIDE, this.globalHide, false); // ReactTooltip.rebuild
245
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
238
246
 
239
- window.removeEventListener(CONSTANT.GLOBAL.REBUILD, this.globalRebuild);
240
- window.addEventListener(CONSTANT.GLOBAL.REBUILD, this.globalRebuild, false); // ReactTooltip.show
247
+ var check = function (it) {
248
+ return it && it.Math == Math && it;
249
+ };
241
250
 
242
- window.removeEventListener(CONSTANT.GLOBAL.SHOW, this.globalShow);
243
- window.addEventListener(CONSTANT.GLOBAL.SHOW, this.globalShow, false); // Resize
251
+ // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
252
+ var global$a =
253
+ // eslint-disable-next-line es-x/no-global-this -- safe
254
+ check(typeof globalThis == 'object' && globalThis) ||
255
+ check(typeof window == 'object' && window) ||
256
+ // eslint-disable-next-line no-restricted-globals -- safe
257
+ check(typeof self == 'object' && self) ||
258
+ check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
259
+ // eslint-disable-next-line no-new-func -- fallback
260
+ (function () { return this; })() || Function('return this')();
244
261
 
245
- if (resizeHide) {
246
- window.removeEventListener('resize', this.onWindowResize);
247
- window.addEventListener('resize', this.onWindowResize, false);
248
- }
249
- };
262
+ var objectGetOwnPropertyDescriptor = {};
250
263
 
251
- target.prototype.unbindWindowEvents = function () {
252
- window.removeEventListener(CONSTANT.GLOBAL.HIDE, this.globalHide);
253
- window.removeEventListener(CONSTANT.GLOBAL.REBUILD, this.globalRebuild);
254
- window.removeEventListener(CONSTANT.GLOBAL.SHOW, this.globalShow);
255
- window.removeEventListener('resize', this.onWindowResize);
256
- };
257
- /**
258
- * invoked by resize event of window
259
- */
264
+ var fails$9 = function (exec) {
265
+ try {
266
+ return !!exec();
267
+ } catch (error) {
268
+ return true;
269
+ }
270
+ };
260
271
 
272
+ var fails$8 = fails$9;
261
273
 
262
- target.prototype.onWindowResize = function () {
263
- if (!this.mount) return;
264
- this.hideTooltip();
265
- };
266
- }
274
+ // Detect IE8's incomplete defineProperty implementation
275
+ var descriptors = !fails$8(function () {
276
+ // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
277
+ return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
278
+ });
267
279
 
268
- /**
269
- * Custom events to control showing and hiding of tooltip
270
- *
271
- * @attributes
272
- * - `event` {String}
273
- * - `eventOff` {String}
274
- */
275
- var checkStatus = function checkStatus(dataEventOff, e) {
276
- var show = this.state.show;
277
- var id = this.props.id;
278
- var isCapture = this.isCapture(e.currentTarget);
279
- var currentItem = e.currentTarget.getAttribute('currentItem');
280
- if (!isCapture) e.stopPropagation();
280
+ var fails$7 = fails$9;
281
281
 
282
- if (show && currentItem === 'true') {
283
- if (!dataEventOff) this.hideTooltip(e);
284
- } else {
285
- e.currentTarget.setAttribute('currentItem', 'true');
286
- setUntargetItems(e.currentTarget, this.getTargetArray(id));
287
- this.showTooltip(e);
288
- }
289
- };
282
+ var functionBindNative = !fails$7(function () {
283
+ // eslint-disable-next-line es-x/no-function-prototype-bind -- safe
284
+ var test = (function () { /* empty */ }).bind();
285
+ // eslint-disable-next-line no-prototype-builtins -- safe
286
+ return typeof test != 'function' || test.hasOwnProperty('prototype');
287
+ });
290
288
 
291
- var setUntargetItems = function setUntargetItems(currentTarget, targetArray) {
292
- for (var i = 0; i < targetArray.length; i++) {
293
- if (currentTarget !== targetArray[i]) {
294
- targetArray[i].setAttribute('currentItem', 'false');
295
- } else {
296
- targetArray[i].setAttribute('currentItem', 'true');
297
- }
298
- }
299
- };
289
+ var NATIVE_BIND$2 = functionBindNative;
300
290
 
301
- var customListeners = {
302
- id: '9b69f92e-d3fe-498b-b1b4-c5e63a51b0cf',
303
- set: function set(target, event, listener) {
304
- if (this.id in target) {
305
- var map = target[this.id];
306
- map[event] = listener;
307
- } else {
308
- // this is workaround for WeakMap, which is not supported in older browsers, such as IE
309
- Object.defineProperty(target, this.id, {
310
- configurable: true,
311
- value: _defineProperty({}, event, listener)
312
- });
313
- }
314
- },
315
- get: function get(target, event) {
316
- var map = target[this.id];
291
+ var call$4 = Function.prototype.call;
317
292
 
318
- if (map !== undefined) {
319
- return map[event];
320
- }
321
- }
293
+ var functionCall = NATIVE_BIND$2 ? call$4.bind(call$4) : function () {
294
+ return call$4.apply(call$4, arguments);
322
295
  };
323
- function customEvent (target) {
324
- target.prototype.isCustomEvent = function (ele) {
325
- var event = this.state.event;
326
- return event || !!ele.getAttribute('data-event');
327
- };
328
- /* Bind listener for custom event */
329
296
 
297
+ var objectPropertyIsEnumerable = {};
330
298
 
331
- target.prototype.customBindListener = function (ele) {
332
- var _this = this;
299
+ var $propertyIsEnumerable = {}.propertyIsEnumerable;
300
+ // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
301
+ var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
333
302
 
334
- var _this$state = this.state,
335
- event = _this$state.event,
336
- eventOff = _this$state.eventOff;
337
- var dataEvent = ele.getAttribute('data-event') || event;
338
- var dataEventOff = ele.getAttribute('data-event-off') || eventOff;
339
- dataEvent.split(' ').forEach(function (event) {
340
- ele.removeEventListener(event, customListeners.get(ele, event));
341
- var customListener = checkStatus.bind(_this, dataEventOff);
342
- customListeners.set(ele, event, customListener);
343
- ele.addEventListener(event, customListener, false);
344
- });
303
+ // Nashorn ~ JDK8 bug
304
+ var NASHORN_BUG = getOwnPropertyDescriptor$1 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
345
305
 
346
- if (dataEventOff) {
347
- dataEventOff.split(' ').forEach(function (event) {
348
- ele.removeEventListener(event, _this.hideTooltip);
349
- ele.addEventListener(event, _this.hideTooltip, false);
350
- });
351
- }
306
+ // `Object.prototype.propertyIsEnumerable` method implementation
307
+ // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
308
+ objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
309
+ var descriptor = getOwnPropertyDescriptor$1(this, V);
310
+ return !!descriptor && descriptor.enumerable;
311
+ } : $propertyIsEnumerable;
312
+
313
+ var createPropertyDescriptor$2 = function (bitmap, value) {
314
+ return {
315
+ enumerable: !(bitmap & 1),
316
+ configurable: !(bitmap & 2),
317
+ writable: !(bitmap & 4),
318
+ value: value
352
319
  };
353
- /* Unbind listener for custom event */
320
+ };
354
321
 
322
+ var NATIVE_BIND$1 = functionBindNative;
355
323
 
356
- target.prototype.customUnbindListener = function (ele) {
357
- var _this$state2 = this.state,
358
- event = _this$state2.event,
359
- eventOff = _this$state2.eventOff;
360
- var dataEvent = event || ele.getAttribute('data-event');
361
- var dataEventOff = eventOff || ele.getAttribute('data-event-off');
362
- ele.removeEventListener(dataEvent, customListeners.get(ele, event));
363
- if (dataEventOff) ele.removeEventListener(dataEventOff, this.hideTooltip);
364
- };
365
- }
324
+ var FunctionPrototype$1 = Function.prototype;
325
+ var bind$2 = FunctionPrototype$1.bind;
326
+ var call$3 = FunctionPrototype$1.call;
327
+ var uncurryThis$c = NATIVE_BIND$1 && bind$2.bind(call$3, call$3);
366
328
 
367
- /**
368
- * Util method to judge if it should follow capture model
369
- */
370
- function isCapture (target) {
371
- target.prototype.isCapture = function (currentTarget) {
372
- return currentTarget && currentTarget.getAttribute('data-iscapture') === 'true' || this.props.isCapture || false;
329
+ var functionUncurryThis = NATIVE_BIND$1 ? function (fn) {
330
+ return fn && uncurryThis$c(fn);
331
+ } : function (fn) {
332
+ return fn && function () {
333
+ return call$3.apply(fn, arguments);
373
334
  };
374
- }
335
+ };
375
336
 
376
- /**
377
- * Util method to get effect
378
- */
379
- function getEffect (target) {
380
- target.prototype.getEffect = function (currentTarget) {
381
- var dataEffect = currentTarget.getAttribute('data-effect');
382
- return dataEffect || this.props.effect || 'float';
383
- };
384
- }
337
+ var uncurryThis$b = functionUncurryThis;
385
338
 
386
- /**
387
- * Util method to get effect
388
- */
339
+ var toString$1 = uncurryThis$b({}.toString);
340
+ var stringSlice = uncurryThis$b(''.slice);
389
341
 
390
- var makeProxy = function makeProxy(e) {
391
- var proxy = {};
342
+ var classofRaw$1 = function (it) {
343
+ return stringSlice(toString$1(it), 8, -1);
344
+ };
392
345
 
393
- for (var key in e) {
394
- if (typeof e[key] === 'function') {
395
- proxy[key] = e[key].bind(e);
396
- } else {
397
- proxy[key] = e[key];
398
- }
399
- }
346
+ var uncurryThis$a = functionUncurryThis;
347
+ var fails$6 = fails$9;
348
+ var classof$3 = classofRaw$1;
400
349
 
401
- return proxy;
402
- };
350
+ var $Object$3 = Object;
351
+ var split = uncurryThis$a(''.split);
403
352
 
404
- var bodyListener = function bodyListener(callback, options, e) {
405
- var _options$respectEffec = options.respectEffect,
406
- respectEffect = _options$respectEffec === void 0 ? false : _options$respectEffec,
407
- _options$customEvent = options.customEvent,
408
- customEvent = _options$customEvent === void 0 ? false : _options$customEvent;
409
- var id = this.props.id;
410
- var tip = e.target.getAttribute('data-tip') || null;
411
- var forId = e.target.getAttribute('data-for') || null;
412
- var target = e.target;
353
+ // fallback for non-array-like ES3 and non-enumerable old V8 strings
354
+ var indexedObject = fails$6(function () {
355
+ // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
356
+ // eslint-disable-next-line no-prototype-builtins -- safe
357
+ return !$Object$3('z').propertyIsEnumerable(0);
358
+ }) ? function (it) {
359
+ return classof$3(it) == 'String' ? split(it, '') : $Object$3(it);
360
+ } : $Object$3;
413
361
 
414
- if (this.isCustomEvent(target) && !customEvent) {
415
- return;
416
- }
362
+ var $TypeError$5 = TypeError;
417
363
 
418
- var isTargetBelongsToTooltip = id == null && forId == null || forId === id;
364
+ // `RequireObjectCoercible` abstract operation
365
+ // https://tc39.es/ecma262/#sec-requireobjectcoercible
366
+ var requireObjectCoercible$2 = function (it) {
367
+ if (it == undefined) throw $TypeError$5("Can't call method on " + it);
368
+ return it;
369
+ };
419
370
 
420
- if (tip != null && (!respectEffect || this.getEffect(target) === 'float') && isTargetBelongsToTooltip) {
421
- var proxy = makeProxy(e);
422
- proxy.currentTarget = target;
423
- callback(proxy);
424
- }
371
+ // toObject with fallback for non-array-like ES3 strings
372
+ var IndexedObject$1 = indexedObject;
373
+ var requireObjectCoercible$1 = requireObjectCoercible$2;
374
+
375
+ var toIndexedObject$4 = function (it) {
376
+ return IndexedObject$1(requireObjectCoercible$1(it));
425
377
  };
426
378
 
427
- var findCustomEvents = function findCustomEvents(targetArray, dataAttribute) {
428
- var events = {};
429
- targetArray.forEach(function (target) {
430
- var event = target.getAttribute(dataAttribute);
431
- if (event) event.split(' ').forEach(function (event) {
432
- return events[event] = true;
433
- });
434
- });
435
- return events;
379
+ // `IsCallable` abstract operation
380
+ // https://tc39.es/ecma262/#sec-iscallable
381
+ var isCallable$c = function (argument) {
382
+ return typeof argument == 'function';
436
383
  };
437
384
 
438
- var getBody = function getBody() {
439
- return document.getElementsByTagName('body')[0];
385
+ var isCallable$b = isCallable$c;
386
+
387
+ var isObject$6 = function (it) {
388
+ return typeof it == 'object' ? it !== null : isCallable$b(it);
440
389
  };
441
390
 
442
- function bodyMode (target) {
443
- target.prototype.isBodyMode = function () {
444
- return !!this.props.bodyMode;
445
- };
391
+ var global$9 = global$a;
392
+ var isCallable$a = isCallable$c;
446
393
 
447
- target.prototype.bindBodyListener = function (targetArray) {
448
- var _this = this;
394
+ var aFunction = function (argument) {
395
+ return isCallable$a(argument) ? argument : undefined;
396
+ };
449
397
 
450
- var _this$state = this.state,
451
- event = _this$state.event,
452
- eventOff = _this$state.eventOff,
453
- possibleCustomEvents = _this$state.possibleCustomEvents,
454
- possibleCustomEventsOff = _this$state.possibleCustomEventsOff;
455
- var body = getBody();
456
- var customEvents = findCustomEvents(targetArray, 'data-event');
457
- var customEventsOff = findCustomEvents(targetArray, 'data-event-off');
458
- if (event != null) customEvents[event] = true;
459
- if (eventOff != null) customEventsOff[eventOff] = true;
460
- possibleCustomEvents.split(' ').forEach(function (event) {
461
- return customEvents[event] = true;
462
- });
463
- possibleCustomEventsOff.split(' ').forEach(function (event) {
464
- return customEventsOff[event] = true;
465
- });
466
- this.unbindBodyListener(body);
467
- var listeners = this.bodyModeListeners = {};
398
+ var getBuiltIn$5 = function (namespace, method) {
399
+ return arguments.length < 2 ? aFunction(global$9[namespace]) : global$9[namespace] && global$9[namespace][method];
400
+ };
468
401
 
469
- if (event == null) {
470
- listeners.mouseover = bodyListener.bind(this, this.showTooltip, {});
471
- listeners.mousemove = bodyListener.bind(this, this.updateTooltip, {
472
- respectEffect: true
473
- });
474
- listeners.mouseout = bodyListener.bind(this, this.hideTooltip, {});
475
- }
402
+ var uncurryThis$9 = functionUncurryThis;
476
403
 
477
- for (var _event in customEvents) {
478
- listeners[_event] = bodyListener.bind(this, function (e) {
479
- var targetEventOff = e.currentTarget.getAttribute('data-event-off') || eventOff;
480
- checkStatus.call(_this, targetEventOff, e);
481
- }, {
482
- customEvent: true
483
- });
484
- }
404
+ var objectIsPrototypeOf = uncurryThis$9({}.isPrototypeOf);
485
405
 
486
- for (var _event2 in customEventsOff) {
487
- listeners[_event2] = bodyListener.bind(this, this.hideTooltip, {
488
- customEvent: true
489
- });
490
- }
406
+ var getBuiltIn$4 = getBuiltIn$5;
491
407
 
492
- for (var _event3 in listeners) {
493
- body.addEventListener(_event3, listeners[_event3]);
494
- }
495
- };
408
+ var engineUserAgent = getBuiltIn$4('navigator', 'userAgent') || '';
496
409
 
497
- target.prototype.unbindBodyListener = function (body) {
498
- body = body || getBody();
499
- var listeners = this.bodyModeListeners;
410
+ var global$8 = global$a;
411
+ var userAgent = engineUserAgent;
500
412
 
501
- for (var event in listeners) {
502
- body.removeEventListener(event, listeners[event]);
503
- }
504
- };
413
+ var process = global$8.process;
414
+ var Deno = global$8.Deno;
415
+ var versions = process && process.versions || Deno && Deno.version;
416
+ var v8 = versions && versions.v8;
417
+ var match, version;
418
+
419
+ if (v8) {
420
+ match = v8.split('.');
421
+ // in old Chrome, versions of V8 isn't V8 = Chrome / 10
422
+ // but their correct versions are not interesting for us
423
+ version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
505
424
  }
506
425
 
507
- /**
508
- * Tracking target removing from DOM.
509
- * It's necessary to hide tooltip when it's target disappears.
510
- * Otherwise, the tooltip would be shown forever until another target
511
- * is triggered.
512
- *
513
- * If MutationObserver is not available, this feature just doesn't work.
514
- */
515
- // https://hacks.mozilla.org/2012/05/dom-mutationobserver-reacting-to-dom-changes-without-killing-browser-performance/
516
- var getMutationObserverClass = function getMutationObserverClass() {
517
- return window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver;
518
- };
426
+ // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
427
+ // so check `userAgent` even if `.v8` exists, but 0
428
+ if (!version && userAgent) {
429
+ match = userAgent.match(/Edge\/(\d+)/);
430
+ if (!match || match[1] >= 74) {
431
+ match = userAgent.match(/Chrome\/(\d+)/);
432
+ if (match) version = +match[1];
433
+ }
434
+ }
519
435
 
520
- function trackRemoval (target) {
521
- target.prototype.bindRemovalTracker = function () {
522
- var _this = this;
436
+ var engineV8Version = version;
523
437
 
524
- var MutationObserver = getMutationObserverClass();
525
- if (MutationObserver == null) return;
526
- var observer = new MutationObserver(function (mutations) {
527
- for (var m1 = 0; m1 < mutations.length; m1++) {
528
- var mutation = mutations[m1];
438
+ /* eslint-disable es-x/no-symbol -- required for testing */
529
439
 
530
- for (var m2 = 0; m2 < mutation.removedNodes.length; m2++) {
531
- var element = mutation.removedNodes[m2];
440
+ var V8_VERSION = engineV8Version;
441
+ var fails$5 = fails$9;
532
442
 
533
- if (element === _this.state.currentTarget) {
534
- _this.hideTooltip();
443
+ // eslint-disable-next-line es-x/no-object-getownpropertysymbols -- required for testing
444
+ var nativeSymbol = !!Object.getOwnPropertySymbols && !fails$5(function () {
445
+ var symbol = Symbol();
446
+ // Chrome 38 Symbol has incorrect toString conversion
447
+ // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
448
+ return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
449
+ // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
450
+ !Symbol.sham && V8_VERSION && V8_VERSION < 41;
451
+ });
535
452
 
536
- return;
537
- }
538
- }
539
- }
540
- });
541
- observer.observe(window.document, {
542
- childList: true,
543
- subtree: true
544
- });
545
- this.removalTracker = observer;
546
- };
453
+ /* eslint-disable es-x/no-symbol -- required for testing */
547
454
 
548
- target.prototype.unbindRemovalTracker = function () {
549
- if (this.removalTracker) {
550
- this.removalTracker.disconnect();
551
- this.removalTracker = null;
552
- }
553
- };
554
- }
455
+ var NATIVE_SYMBOL$1 = nativeSymbol;
555
456
 
556
- /**
557
- * Calculate the position of tooltip
558
- *
559
- * @params
560
- * - `e` {Event} the event of current mouse
561
- * - `target` {Element} the currentTarget of the event
562
- * - `node` {DOM} the react-tooltip object
563
- * - `place` {String} top / right / bottom / left
564
- * - `effect` {String} float / solid
565
- * - `offset` {Object} the offset to default position
566
- *
567
- * @return {Object}
568
- * - `isNewState` {Bool} required
569
- * - `newState` {Object}
570
- * - `position` {Object} {left: {Number}, top: {Number}}
571
- */
572
- function getPosition (e, target, node, place, desiredPlace, effect, offset) {
573
- var _getDimensions = getDimensions(node),
574
- tipWidth = _getDimensions.width,
575
- tipHeight = _getDimensions.height;
457
+ var useSymbolAsUid = NATIVE_SYMBOL$1
458
+ && !Symbol.sham
459
+ && typeof Symbol.iterator == 'symbol';
576
460
 
577
- var _getDimensions2 = getDimensions(target),
578
- targetWidth = _getDimensions2.width,
579
- targetHeight = _getDimensions2.height;
461
+ var getBuiltIn$3 = getBuiltIn$5;
462
+ var isCallable$9 = isCallable$c;
463
+ var isPrototypeOf = objectIsPrototypeOf;
464
+ var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
580
465
 
581
- var _getCurrentOffset = getCurrentOffset(e, target, effect),
582
- mouseX = _getCurrentOffset.mouseX,
583
- mouseY = _getCurrentOffset.mouseY;
466
+ var $Object$2 = Object;
584
467
 
585
- var defaultOffset = getDefaultPosition(effect, targetWidth, targetHeight, tipWidth, tipHeight);
468
+ var isSymbol$2 = USE_SYMBOL_AS_UID$1 ? function (it) {
469
+ return typeof it == 'symbol';
470
+ } : function (it) {
471
+ var $Symbol = getBuiltIn$3('Symbol');
472
+ return isCallable$9($Symbol) && isPrototypeOf($Symbol.prototype, $Object$2(it));
473
+ };
586
474
 
587
- var _calculateOffset = calculateOffset(offset),
588
- extraOffsetX = _calculateOffset.extraOffsetX,
589
- extraOffsetY = _calculateOffset.extraOffsetY;
475
+ var $String$1 = String;
590
476
 
591
- var windowWidth = window.innerWidth;
592
- var windowHeight = window.innerHeight;
477
+ var tryToString$1 = function (argument) {
478
+ try {
479
+ return $String$1(argument);
480
+ } catch (error) {
481
+ return 'Object';
482
+ }
483
+ };
593
484
 
594
- var _getParent = getParent(node),
595
- parentTop = _getParent.parentTop,
596
- parentLeft = _getParent.parentLeft; // Get the edge offset of the tooltip
485
+ var isCallable$8 = isCallable$c;
486
+ var tryToString = tryToString$1;
597
487
 
488
+ var $TypeError$4 = TypeError;
598
489
 
599
- var getTipOffsetLeft = function getTipOffsetLeft(place) {
600
- var offsetX = defaultOffset[place].l;
601
- return mouseX + offsetX + extraOffsetX;
602
- };
490
+ // `Assert: IsCallable(argument) is true`
491
+ var aCallable$2 = function (argument) {
492
+ if (isCallable$8(argument)) return argument;
493
+ throw $TypeError$4(tryToString(argument) + ' is not a function');
494
+ };
603
495
 
604
- var getTipOffsetRight = function getTipOffsetRight(place) {
605
- var offsetX = defaultOffset[place].r;
606
- return mouseX + offsetX + extraOffsetX;
607
- };
496
+ var aCallable$1 = aCallable$2;
608
497
 
609
- var getTipOffsetTop = function getTipOffsetTop(place) {
610
- var offsetY = defaultOffset[place].t;
611
- return mouseY + offsetY + extraOffsetY;
612
- };
498
+ // `GetMethod` abstract operation
499
+ // https://tc39.es/ecma262/#sec-getmethod
500
+ var getMethod$1 = function (V, P) {
501
+ var func = V[P];
502
+ return func == null ? undefined : aCallable$1(func);
503
+ };
613
504
 
614
- var getTipOffsetBottom = function getTipOffsetBottom(place) {
615
- var offsetY = defaultOffset[place].b;
616
- return mouseY + offsetY + extraOffsetY;
617
- }; //
618
- // Functions to test whether the tooltip's sides are inside
619
- // the client window for a given orientation p
620
- //
621
- // _____________
622
- // | | <-- Right side
623
- // | p = 'left' |\
624
- // | |/ |\
625
- // |_____________| |_\ <-- Mouse
626
- // / \ |
627
- // |
628
- // |
629
- // Bottom side
630
- //
505
+ var call$2 = functionCall;
506
+ var isCallable$7 = isCallable$c;
507
+ var isObject$5 = isObject$6;
631
508
 
509
+ var $TypeError$3 = TypeError;
632
510
 
633
- var outsideLeft = function outsideLeft(p) {
634
- return getTipOffsetLeft(p) < 0;
635
- };
511
+ // `OrdinaryToPrimitive` abstract operation
512
+ // https://tc39.es/ecma262/#sec-ordinarytoprimitive
513
+ var ordinaryToPrimitive$1 = function (input, pref) {
514
+ var fn, val;
515
+ if (pref === 'string' && isCallable$7(fn = input.toString) && !isObject$5(val = call$2(fn, input))) return val;
516
+ if (isCallable$7(fn = input.valueOf) && !isObject$5(val = call$2(fn, input))) return val;
517
+ if (pref !== 'string' && isCallable$7(fn = input.toString) && !isObject$5(val = call$2(fn, input))) return val;
518
+ throw $TypeError$3("Can't convert object to primitive value");
519
+ };
636
520
 
637
- var outsideRight = function outsideRight(p) {
638
- return getTipOffsetRight(p) > windowWidth;
639
- };
521
+ var shared$3 = {exports: {}};
640
522
 
641
- var outsideTop = function outsideTop(p) {
642
- return getTipOffsetTop(p) < 0;
643
- };
523
+ var global$7 = global$a;
644
524
 
645
- var outsideBottom = function outsideBottom(p) {
646
- return getTipOffsetBottom(p) > windowHeight;
647
- }; // Check whether the tooltip with orientation p is completely inside the client window
525
+ // eslint-disable-next-line es-x/no-object-defineproperty -- safe
526
+ var defineProperty$2 = Object.defineProperty;
648
527
 
528
+ var defineGlobalProperty$3 = function (key, value) {
529
+ try {
530
+ defineProperty$2(global$7, key, { value: value, configurable: true, writable: true });
531
+ } catch (error) {
532
+ global$7[key] = value;
533
+ } return value;
534
+ };
649
535
 
650
- var outside = function outside(p) {
651
- return outsideLeft(p) || outsideRight(p) || outsideTop(p) || outsideBottom(p);
652
- };
536
+ var global$6 = global$a;
537
+ var defineGlobalProperty$2 = defineGlobalProperty$3;
653
538
 
654
- var inside = function inside(p) {
655
- return !outside(p);
656
- };
539
+ var SHARED = '__core-js_shared__';
540
+ var store$3 = global$6[SHARED] || defineGlobalProperty$2(SHARED, {});
657
541
 
658
- var placesList = ['top', 'bottom', 'left', 'right'];
659
- var insideList = [];
542
+ var sharedStore = store$3;
660
543
 
661
- for (var i = 0; i < 4; i++) {
662
- var p = placesList[i];
544
+ var store$2 = sharedStore;
663
545
 
664
- if (inside(p)) {
665
- insideList.push(p);
666
- }
667
- }
546
+ (shared$3.exports = function (key, value) {
547
+ return store$2[key] || (store$2[key] = value !== undefined ? value : {});
548
+ })('versions', []).push({
549
+ version: '3.24.1',
550
+ mode: 'global',
551
+ copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
552
+ license: 'https://github.com/zloirock/core-js/blob/v3.24.1/LICENSE',
553
+ source: 'https://github.com/zloirock/core-js'
554
+ });
668
555
 
669
- var isNewState = false;
670
- var newPlace;
671
- var shouldUpdatePlace = desiredPlace !== place;
556
+ var requireObjectCoercible = requireObjectCoercible$2;
672
557
 
673
- if (inside(desiredPlace) && shouldUpdatePlace) {
674
- isNewState = true;
675
- newPlace = desiredPlace;
676
- } else if (insideList.length > 0 && outside(desiredPlace) && outside(place)) {
677
- isNewState = true;
678
- newPlace = insideList[0];
679
- }
558
+ var $Object$1 = Object;
680
559
 
681
- if (isNewState) {
682
- return {
683
- isNewState: true,
684
- newState: {
685
- place: newPlace
686
- }
687
- };
688
- }
560
+ // `ToObject` abstract operation
561
+ // https://tc39.es/ecma262/#sec-toobject
562
+ var toObject$2 = function (argument) {
563
+ return $Object$1(requireObjectCoercible(argument));
564
+ };
689
565
 
690
- return {
691
- isNewState: false,
692
- position: {
693
- left: parseInt(getTipOffsetLeft(place) - parentLeft, 10),
694
- top: parseInt(getTipOffsetTop(place) - parentTop, 10)
695
- }
696
- };
697
- }
566
+ var uncurryThis$8 = functionUncurryThis;
567
+ var toObject$1 = toObject$2;
698
568
 
699
- var getDimensions = function getDimensions(node) {
700
- var _node$getBoundingClie = node.getBoundingClientRect(),
701
- height = _node$getBoundingClie.height,
702
- width = _node$getBoundingClie.width;
569
+ var hasOwnProperty = uncurryThis$8({}.hasOwnProperty);
703
570
 
704
- return {
705
- height: parseInt(height, 10),
706
- width: parseInt(width, 10)
707
- };
708
- }; // Get current mouse offset
571
+ // `HasOwnProperty` abstract operation
572
+ // https://tc39.es/ecma262/#sec-hasownproperty
573
+ // eslint-disable-next-line es-x/no-object-hasown -- safe
574
+ var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
575
+ return hasOwnProperty(toObject$1(it), key);
576
+ };
709
577
 
578
+ var uncurryThis$7 = functionUncurryThis;
710
579
 
711
- var getCurrentOffset = function getCurrentOffset(e, currentTarget, effect) {
712
- var boundingClientRect = currentTarget.getBoundingClientRect();
713
- var targetTop = boundingClientRect.top;
714
- var targetLeft = boundingClientRect.left;
580
+ var id = 0;
581
+ var postfix = Math.random();
582
+ var toString = uncurryThis$7(1.0.toString);
715
583
 
716
- var _getDimensions3 = getDimensions(currentTarget),
717
- targetWidth = _getDimensions3.width,
718
- targetHeight = _getDimensions3.height;
584
+ var uid$2 = function (key) {
585
+ return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);
586
+ };
719
587
 
720
- if (effect === 'float') {
721
- return {
722
- mouseX: e.clientX,
723
- mouseY: e.clientY
724
- };
725
- }
588
+ var global$5 = global$a;
589
+ var shared$2 = shared$3.exports;
590
+ var hasOwn$6 = hasOwnProperty_1;
591
+ var uid$1 = uid$2;
592
+ var NATIVE_SYMBOL = nativeSymbol;
593
+ var USE_SYMBOL_AS_UID = useSymbolAsUid;
726
594
 
727
- return {
728
- mouseX: targetLeft + targetWidth / 2,
729
- mouseY: targetTop + targetHeight / 2
730
- };
731
- }; // List all possibility of tooltip final offset
732
- // This is useful in judging if it is necessary for tooltip to switch position when out of window
595
+ var WellKnownSymbolsStore = shared$2('wks');
596
+ var Symbol$1 = global$5.Symbol;
597
+ var symbolFor = Symbol$1 && Symbol$1['for'];
598
+ var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid$1;
733
599
 
600
+ var wellKnownSymbol$5 = function (name) {
601
+ if (!hasOwn$6(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) {
602
+ var description = 'Symbol.' + name;
603
+ if (NATIVE_SYMBOL && hasOwn$6(Symbol$1, name)) {
604
+ WellKnownSymbolsStore[name] = Symbol$1[name];
605
+ } else if (USE_SYMBOL_AS_UID && symbolFor) {
606
+ WellKnownSymbolsStore[name] = symbolFor(description);
607
+ } else {
608
+ WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
609
+ }
610
+ } return WellKnownSymbolsStore[name];
611
+ };
734
612
 
735
- var getDefaultPosition = function getDefaultPosition(effect, targetWidth, targetHeight, tipWidth, tipHeight) {
736
- var top;
737
- var right;
738
- var bottom;
739
- var left;
740
- var disToMouse = 3;
741
- var triangleHeight = 2;
742
- var cursorHeight = 12; // Optimize for float bottom only, cause the cursor will hide the tooltip
613
+ var call$1 = functionCall;
614
+ var isObject$4 = isObject$6;
615
+ var isSymbol$1 = isSymbol$2;
616
+ var getMethod = getMethod$1;
617
+ var ordinaryToPrimitive = ordinaryToPrimitive$1;
618
+ var wellKnownSymbol$4 = wellKnownSymbol$5;
743
619
 
744
- if (effect === 'float') {
745
- top = {
746
- l: -(tipWidth / 2),
747
- r: tipWidth / 2,
748
- t: -(tipHeight + disToMouse + triangleHeight),
749
- b: -disToMouse
750
- };
751
- bottom = {
752
- l: -(tipWidth / 2),
753
- r: tipWidth / 2,
754
- t: disToMouse + cursorHeight,
755
- b: tipHeight + disToMouse + triangleHeight + cursorHeight
756
- };
757
- left = {
758
- l: -(tipWidth + disToMouse + triangleHeight),
759
- r: -disToMouse,
760
- t: -(tipHeight / 2),
761
- b: tipHeight / 2
762
- };
763
- right = {
764
- l: disToMouse,
765
- r: tipWidth + disToMouse + triangleHeight,
766
- t: -(tipHeight / 2),
767
- b: tipHeight / 2
768
- };
769
- } else if (effect === 'solid') {
770
- top = {
771
- l: -(tipWidth / 2),
772
- r: tipWidth / 2,
773
- t: -(targetHeight / 2 + tipHeight + triangleHeight),
774
- b: -(targetHeight / 2)
775
- };
776
- bottom = {
777
- l: -(tipWidth / 2),
778
- r: tipWidth / 2,
779
- t: targetHeight / 2,
780
- b: targetHeight / 2 + tipHeight + triangleHeight
781
- };
782
- left = {
783
- l: -(tipWidth + targetWidth / 2 + triangleHeight),
784
- r: -(targetWidth / 2),
785
- t: -(tipHeight / 2),
786
- b: tipHeight / 2
787
- };
788
- right = {
789
- l: targetWidth / 2,
790
- r: tipWidth + targetWidth / 2 + triangleHeight,
791
- t: -(tipHeight / 2),
792
- b: tipHeight / 2
793
- };
794
- }
620
+ var $TypeError$2 = TypeError;
621
+ var TO_PRIMITIVE = wellKnownSymbol$4('toPrimitive');
795
622
 
796
- return {
797
- top: top,
798
- bottom: bottom,
799
- left: left,
800
- right: right
801
- };
802
- }; // Consider additional offset into position calculation
623
+ // `ToPrimitive` abstract operation
624
+ // https://tc39.es/ecma262/#sec-toprimitive
625
+ var toPrimitive$1 = function (input, pref) {
626
+ if (!isObject$4(input) || isSymbol$1(input)) return input;
627
+ var exoticToPrim = getMethod(input, TO_PRIMITIVE);
628
+ var result;
629
+ if (exoticToPrim) {
630
+ if (pref === undefined) pref = 'default';
631
+ result = call$1(exoticToPrim, input, pref);
632
+ if (!isObject$4(result) || isSymbol$1(result)) return result;
633
+ throw $TypeError$2("Can't convert object to primitive value");
634
+ }
635
+ if (pref === undefined) pref = 'number';
636
+ return ordinaryToPrimitive(input, pref);
637
+ };
803
638
 
639
+ var toPrimitive = toPrimitive$1;
640
+ var isSymbol = isSymbol$2;
804
641
 
805
- var calculateOffset = function calculateOffset(offset) {
806
- var extraOffsetX = 0;
807
- var extraOffsetY = 0;
642
+ // `ToPropertyKey` abstract operation
643
+ // https://tc39.es/ecma262/#sec-topropertykey
644
+ var toPropertyKey$2 = function (argument) {
645
+ var key = toPrimitive(argument, 'string');
646
+ return isSymbol(key) ? key : key + '';
647
+ };
808
648
 
809
- if (Object.prototype.toString.apply(offset) === '[object String]') {
810
- offset = JSON.parse(offset.toString().replace(/'/g, '"'));
811
- }
649
+ var global$4 = global$a;
650
+ var isObject$3 = isObject$6;
812
651
 
813
- for (var key in offset) {
814
- if (key === 'top') {
815
- extraOffsetY -= parseInt(offset[key], 10);
816
- } else if (key === 'bottom') {
817
- extraOffsetY += parseInt(offset[key], 10);
818
- } else if (key === 'left') {
819
- extraOffsetX -= parseInt(offset[key], 10);
820
- } else if (key === 'right') {
821
- extraOffsetX += parseInt(offset[key], 10);
822
- }
823
- }
652
+ var document$1 = global$4.document;
653
+ // typeof document.createElement is 'object' in old IE
654
+ var EXISTS$1 = isObject$3(document$1) && isObject$3(document$1.createElement);
824
655
 
825
- return {
826
- extraOffsetX: extraOffsetX,
827
- extraOffsetY: extraOffsetY
828
- };
829
- }; // Get the offset of the parent elements
656
+ var documentCreateElement$1 = function (it) {
657
+ return EXISTS$1 ? document$1.createElement(it) : {};
658
+ };
830
659
 
660
+ var DESCRIPTORS$7 = descriptors;
661
+ var fails$4 = fails$9;
662
+ var createElement = documentCreateElement$1;
831
663
 
832
- var getParent = function getParent(currentTarget) {
833
- var currentParent = currentTarget;
664
+ // Thanks to IE8 for its funny defineProperty
665
+ var ie8DomDefine = !DESCRIPTORS$7 && !fails$4(function () {
666
+ // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
667
+ return Object.defineProperty(createElement('div'), 'a', {
668
+ get: function () { return 7; }
669
+ }).a != 7;
670
+ });
834
671
 
835
- while (currentParent) {
836
- var computedStyle = window.getComputedStyle(currentParent); // transform and will-change: transform change the containing block
837
- // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_Block
672
+ var DESCRIPTORS$6 = descriptors;
673
+ var call = functionCall;
674
+ var propertyIsEnumerableModule = objectPropertyIsEnumerable;
675
+ var createPropertyDescriptor$1 = createPropertyDescriptor$2;
676
+ var toIndexedObject$3 = toIndexedObject$4;
677
+ var toPropertyKey$1 = toPropertyKey$2;
678
+ var hasOwn$5 = hasOwnProperty_1;
679
+ var IE8_DOM_DEFINE$1 = ie8DomDefine;
838
680
 
839
- if (computedStyle.getPropertyValue('transform') !== 'none' || computedStyle.getPropertyValue('will-change') === 'transform') break;
840
- currentParent = currentParent.parentElement;
841
- }
681
+ // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
682
+ var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
842
683
 
843
- var parentTop = currentParent && currentParent.getBoundingClientRect().top || 0;
844
- var parentLeft = currentParent && currentParent.getBoundingClientRect().left || 0;
845
- return {
846
- parentTop: parentTop,
847
- parentLeft: parentLeft
848
- };
684
+ // `Object.getOwnPropertyDescriptor` method
685
+ // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
686
+ objectGetOwnPropertyDescriptor.f = DESCRIPTORS$6 ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
687
+ O = toIndexedObject$3(O);
688
+ P = toPropertyKey$1(P);
689
+ if (IE8_DOM_DEFINE$1) try {
690
+ return $getOwnPropertyDescriptor$1(O, P);
691
+ } catch (error) { /* empty */ }
692
+ if (hasOwn$5(O, P)) return createPropertyDescriptor$1(!call(propertyIsEnumerableModule.f, O, P), O[P]);
849
693
  };
850
694
 
851
- /**
852
- * To get the tooltip content
853
- * it may comes from data-tip or this.props.children
854
- * it should support multiline
855
- *
856
- * @params
857
- * - `tip` {String} value of data-tip
858
- * - `children` {ReactElement} this.props.children
859
- * - `multiline` {Any} could be Bool(true/false) or String('true'/'false')
860
- *
861
- * @return
862
- * - String or react component
863
- */
864
- function getTipContent (tip, children, getContent, multiline) {
865
- if (children) return children;
866
- if (getContent !== undefined && getContent !== null) return getContent; // getContent can be 0, '', etc.
695
+ var objectDefineProperty = {};
867
696
 
868
- if (getContent === null) return null; // Tip not exist and children is null or undefined
697
+ var DESCRIPTORS$5 = descriptors;
698
+ var fails$3 = fails$9;
869
699
 
870
- var regexp = /<br\s*\/?>/;
700
+ // V8 ~ Chrome 36-
701
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3334
702
+ var v8PrototypeDefineBug = DESCRIPTORS$5 && fails$3(function () {
703
+ // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
704
+ return Object.defineProperty(function () { /* empty */ }, 'prototype', {
705
+ value: 42,
706
+ writable: false
707
+ }).prototype != 42;
708
+ });
871
709
 
872
- if (!multiline || multiline === 'false' || !regexp.test(tip)) {
873
- // No trim(), so that user can keep their input
874
- return tip;
875
- } // Multiline tooltip content
710
+ var isObject$2 = isObject$6;
876
711
 
712
+ var $String = String;
713
+ var $TypeError$1 = TypeError;
877
714
 
878
- return tip.split(regexp).map(function (d, i) {
879
- return React.createElement("span", {
880
- key: i,
881
- className: "multi-line"
882
- }, d);
883
- });
884
- }
885
-
886
- /**
887
- * Support aria- and role in ReactTooltip
888
- *
889
- * @params props {Object}
890
- * @return {Object}
891
- */
892
- function parseAria(props) {
893
- var ariaObj = {};
894
- Object.keys(props).filter(function (prop) {
895
- // aria-xxx and role is acceptable
896
- return /(^aria-\w+$|^role$)/.test(prop);
897
- }).forEach(function (prop) {
898
- ariaObj[prop] = props[prop];
899
- });
900
- return ariaObj;
901
- }
902
-
903
- /**
904
- * Convert nodelist to array
905
- * @see https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/core/createArrayFromMixed.js#L24
906
- * NodeLists are functions in Safari
907
- */
908
- function nodeListToArray (nodeList) {
909
- var length = nodeList.length;
910
-
911
- if (nodeList.hasOwnProperty) {
912
- return Array.prototype.slice.call(nodeList);
913
- }
914
-
915
- return new Array(length).fill().map(function (index) {
916
- return nodeList[index];
917
- });
918
- }
919
-
920
- function generateUUID() {
921
- return 't' + v4();
922
- }
923
-
924
- var baseCss = ".__react_component_tooltip {\n border-radius: 3px;\n display: inline-block;\n font-size: 13px;\n left: -999em;\n opacity: 0;\n padding: 8px 21px;\n position: fixed;\n pointer-events: none;\n transition: opacity 0.3s ease-out;\n top: -999em;\n visibility: hidden;\n z-index: 999;\n}\n.__react_component_tooltip.allow_hover, .__react_component_tooltip.allow_click {\n pointer-events: auto;\n}\n.__react_component_tooltip::before, .__react_component_tooltip::after {\n content: \"\";\n width: 0;\n height: 0;\n position: absolute;\n}\n.__react_component_tooltip.show {\n opacity: 0.9;\n margin-top: 0;\n margin-left: 0;\n visibility: visible;\n}\n.__react_component_tooltip.place-top::before {\n border-left: 10px solid transparent;\n border-right: 10px solid transparent;\n bottom: -8px;\n left: 50%;\n margin-left: -10px;\n}\n.__react_component_tooltip.place-bottom::before {\n border-left: 10px solid transparent;\n border-right: 10px solid transparent;\n top: -8px;\n left: 50%;\n margin-left: -10px;\n}\n.__react_component_tooltip.place-left::before {\n border-top: 6px solid transparent;\n border-bottom: 6px solid transparent;\n right: -8px;\n top: 50%;\n margin-top: -5px;\n}\n.__react_component_tooltip.place-right::before {\n border-top: 6px solid transparent;\n border-bottom: 6px solid transparent;\n left: -8px;\n top: 50%;\n margin-top: -5px;\n}\n.__react_component_tooltip .multi-line {\n display: block;\n padding: 2px 0;\n text-align: center;\n}";
925
-
926
- /**
927
- * Default pop-up style values (text color, background color).
928
- */
929
- var defaultColors = {
930
- dark: {
931
- text: '#fff',
932
- background: '#222',
933
- border: 'transparent',
934
- arrow: '#222'
935
- },
936
- success: {
937
- text: '#fff',
938
- background: '#8DC572',
939
- border: 'transparent',
940
- arrow: '#8DC572'
941
- },
942
- warning: {
943
- text: '#fff',
944
- background: '#F0AD4E',
945
- border: 'transparent',
946
- arrow: '#F0AD4E'
947
- },
948
- error: {
949
- text: '#fff',
950
- background: '#BE6464',
951
- border: 'transparent',
952
- arrow: '#BE6464'
953
- },
954
- info: {
955
- text: '#fff',
956
- background: '#337AB7',
957
- border: 'transparent',
958
- arrow: '#337AB7'
959
- },
960
- light: {
961
- text: '#222',
962
- background: '#fff',
963
- border: 'transparent',
964
- arrow: '#fff'
965
- }
966
- };
967
- function getDefaultPopupColors(type) {
968
- return defaultColors[type] ? _objectSpread2({}, defaultColors[type]) : undefined;
969
- }
970
-
971
- /**
972
- * Generates the specific tooltip style for use on render.
973
- */
974
-
975
- function generateTooltipStyle(uuid, customColors, type, hasBorder) {
976
- return generateStyle(uuid, getPopupColors(customColors, type, hasBorder));
977
- }
978
- /**
979
- * Generates the tooltip style rules based on the element-specified "data-type" property.
980
- */
981
-
982
- function generateStyle(uuid, colors) {
983
- var textColor = colors.text;
984
- var backgroundColor = colors.background;
985
- var borderColor = colors.border;
986
- var arrowColor = colors.arrow;
987
- return "\n \t.".concat(uuid, " {\n\t color: ").concat(textColor, ";\n\t background: ").concat(backgroundColor, ";\n\t border: 1px solid ").concat(borderColor, ";\n \t}\n\n \t.").concat(uuid, ".place-top {\n margin-top: -10px;\n }\n .").concat(uuid, ".place-top::before {\n border-top: 8px solid ").concat(borderColor, ";\n }\n .").concat(uuid, ".place-top::after {\n border-left: 8px solid transparent;\n border-right: 8px solid transparent;\n bottom: -6px;\n left: 50%;\n margin-left: -8px;\n border-top-color: ").concat(arrowColor, ";\n border-top-style: solid;\n border-top-width: 6px;\n }\n\n .").concat(uuid, ".place-bottom {\n margin-top: 10px;\n }\n .").concat(uuid, ".place-bottom::before {\n border-bottom: 8px solid ").concat(borderColor, ";\n }\n .").concat(uuid, ".place-bottom::after {\n border-left: 8px solid transparent;\n border-right: 8px solid transparent;\n top: -6px;\n left: 50%;\n margin-left: -8px;\n border-bottom-color: ").concat(arrowColor, ";\n border-bottom-style: solid;\n border-bottom-width: 6px;\n }\n\n .").concat(uuid, ".place-left {\n margin-left: -10px;\n }\n .").concat(uuid, ".place-left::before {\n border-left: 8px solid ").concat(borderColor, ";\n }\n .").concat(uuid, ".place-left::after {\n border-top: 5px solid transparent;\n border-bottom: 5px solid transparent;\n right: -6px;\n top: 50%;\n margin-top: -4px;\n border-left-color: ").concat(arrowColor, ";\n border-left-style: solid;\n border-left-width: 6px;\n }\n\n .").concat(uuid, ".place-right {\n margin-left: 10px;\n }\n .").concat(uuid, ".place-right::before {\n border-right: 8px solid ").concat(borderColor, ";\n }\n .").concat(uuid, ".place-right::after {\n border-top: 5px solid transparent;\n border-bottom: 5px solid transparent;\n left: -6px;\n top: 50%;\n margin-top: -4px;\n border-right-color: ").concat(arrowColor, ";\n border-right-style: solid;\n border-right-width: 6px;\n }\n ");
988
- }
989
-
990
- function getPopupColors(customColors, type, hasBorder) {
991
- var textColor = customColors.text;
992
- var backgroundColor = customColors.background;
993
- var borderColor = customColors.border;
994
- var arrowColor = customColors.arrow ? customColors.arrow : customColors.background;
995
- var colors = getDefaultPopupColors(type);
996
-
997
- if (textColor) {
998
- colors.text = textColor;
999
- }
1000
-
1001
- if (backgroundColor) {
1002
- colors.background = backgroundColor;
1003
- }
1004
-
1005
- if (hasBorder) {
1006
- if (borderColor) {
1007
- colors.border = borderColor;
1008
- } else {
1009
- colors.border = type === 'light' ? 'black' : 'white';
1010
- }
1011
- }
1012
-
1013
- if (arrowColor) {
1014
- colors.arrow = arrowColor;
1015
- }
1016
-
1017
- return colors;
1018
- }
1019
-
1020
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
1021
-
1022
- function createCommonjsModule(fn, module) {
1023
- return module = { exports: {} }, fn(module, module.exports), module.exports;
1024
- }
1025
-
1026
- var check = function (it) {
1027
- return it && it.Math == Math && it;
1028
- };
1029
-
1030
- // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
1031
- var global_1 =
1032
- // eslint-disable-next-line es/no-global-this -- safe
1033
- check(typeof globalThis == 'object' && globalThis) ||
1034
- check(typeof window == 'object' && window) ||
1035
- // eslint-disable-next-line no-restricted-globals -- safe
1036
- check(typeof self == 'object' && self) ||
1037
- check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
1038
- // eslint-disable-next-line no-new-func -- fallback
1039
- (function () { return this; })() || Function('return this')();
1040
-
1041
- var fails = function (exec) {
1042
- try {
1043
- return !!exec();
1044
- } catch (error) {
1045
- return true;
1046
- }
1047
- };
1048
-
1049
- // Detect IE8's incomplete defineProperty implementation
1050
- var descriptors = !fails(function () {
1051
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
1052
- return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
1053
- });
1054
-
1055
- var $propertyIsEnumerable = {}.propertyIsEnumerable;
1056
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
1057
- var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
1058
-
1059
- // Nashorn ~ JDK8 bug
1060
- var NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1);
1061
-
1062
- // `Object.prototype.propertyIsEnumerable` method implementation
1063
- // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
1064
- var f = NASHORN_BUG ? function propertyIsEnumerable(V) {
1065
- var descriptor = getOwnPropertyDescriptor(this, V);
1066
- return !!descriptor && descriptor.enumerable;
1067
- } : $propertyIsEnumerable;
1068
-
1069
- var objectPropertyIsEnumerable = {
1070
- f: f
1071
- };
1072
-
1073
- var createPropertyDescriptor = function (bitmap, value) {
1074
- return {
1075
- enumerable: !(bitmap & 1),
1076
- configurable: !(bitmap & 2),
1077
- writable: !(bitmap & 4),
1078
- value: value
1079
- };
1080
- };
1081
-
1082
- var toString = {}.toString;
1083
-
1084
- var classofRaw = function (it) {
1085
- return toString.call(it).slice(8, -1);
1086
- };
1087
-
1088
- var split = ''.split;
1089
-
1090
- // fallback for non-array-like ES3 and non-enumerable old V8 strings
1091
- var indexedObject = fails(function () {
1092
- // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
1093
- // eslint-disable-next-line no-prototype-builtins -- safe
1094
- return !Object('z').propertyIsEnumerable(0);
1095
- }) ? function (it) {
1096
- return classofRaw(it) == 'String' ? split.call(it, '') : Object(it);
1097
- } : Object;
1098
-
1099
- // `RequireObjectCoercible` abstract operation
1100
- // https://tc39.es/ecma262/#sec-requireobjectcoercible
1101
- var requireObjectCoercible = function (it) {
1102
- if (it == undefined) throw TypeError("Can't call method on " + it);
1103
- return it;
1104
- };
1105
-
1106
- // toObject with fallback for non-array-like ES3 strings
1107
-
1108
-
1109
-
1110
- var toIndexedObject = function (it) {
1111
- return indexedObject(requireObjectCoercible(it));
1112
- };
1113
-
1114
- var isObject = function (it) {
1115
- return typeof it === 'object' ? it !== null : typeof it === 'function';
1116
- };
1117
-
1118
- // `ToPrimitive` abstract operation
1119
- // https://tc39.es/ecma262/#sec-toprimitive
1120
- // instead of the ES6 spec version, we didn't implement @@toPrimitive case
1121
- // and the second argument - flag - preferred type is a string
1122
- var toPrimitive = function (input, PREFERRED_STRING) {
1123
- if (!isObject(input)) return input;
1124
- var fn, val;
1125
- if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
1126
- if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val;
1127
- if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
1128
- throw TypeError("Can't convert object to primitive value");
1129
- };
1130
-
1131
- // `ToObject` abstract operation
1132
- // https://tc39.es/ecma262/#sec-toobject
1133
- var toObject = function (argument) {
1134
- return Object(requireObjectCoercible(argument));
1135
- };
1136
-
1137
- var hasOwnProperty = {}.hasOwnProperty;
1138
-
1139
- var has = function hasOwn(it, key) {
1140
- return hasOwnProperty.call(toObject(it), key);
1141
- };
1142
-
1143
- var document$1 = global_1.document;
1144
- // typeof document.createElement is 'object' in old IE
1145
- var EXISTS = isObject(document$1) && isObject(document$1.createElement);
1146
-
1147
- var documentCreateElement = function (it) {
1148
- return EXISTS ? document$1.createElement(it) : {};
1149
- };
1150
-
1151
- // Thank's IE8 for his funny defineProperty
1152
- var ie8DomDefine = !descriptors && !fails(function () {
1153
- // eslint-disable-next-line es/no-object-defineproperty -- requied for testing
1154
- return Object.defineProperty(documentCreateElement('div'), 'a', {
1155
- get: function () { return 7; }
1156
- }).a != 7;
1157
- });
1158
-
1159
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
1160
- var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
1161
-
1162
- // `Object.getOwnPropertyDescriptor` method
1163
- // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
1164
- var f$1 = descriptors ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
1165
- O = toIndexedObject(O);
1166
- P = toPrimitive(P, true);
1167
- if (ie8DomDefine) try {
1168
- return $getOwnPropertyDescriptor(O, P);
1169
- } catch (error) { /* empty */ }
1170
- if (has(O, P)) return createPropertyDescriptor(!objectPropertyIsEnumerable.f.call(O, P), O[P]);
1171
- };
1172
-
1173
- var objectGetOwnPropertyDescriptor = {
1174
- f: f$1
715
+ // `Assert: Type(argument) is Object`
716
+ var anObject$4 = function (argument) {
717
+ if (isObject$2(argument)) return argument;
718
+ throw $TypeError$1($String(argument) + ' is not an object');
1175
719
  };
1176
720
 
1177
- var anObject = function (it) {
1178
- if (!isObject(it)) {
1179
- throw TypeError(String(it) + ' is not an object');
1180
- } return it;
1181
- };
721
+ var DESCRIPTORS$4 = descriptors;
722
+ var IE8_DOM_DEFINE = ie8DomDefine;
723
+ var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug;
724
+ var anObject$3 = anObject$4;
725
+ var toPropertyKey = toPropertyKey$2;
1182
726
 
1183
- // eslint-disable-next-line es/no-object-defineproperty -- safe
727
+ var $TypeError = TypeError;
728
+ // eslint-disable-next-line es-x/no-object-defineproperty -- safe
1184
729
  var $defineProperty = Object.defineProperty;
730
+ // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
731
+ var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
732
+ var ENUMERABLE = 'enumerable';
733
+ var CONFIGURABLE$1 = 'configurable';
734
+ var WRITABLE = 'writable';
1185
735
 
1186
736
  // `Object.defineProperty` method
1187
737
  // https://tc39.es/ecma262/#sec-object.defineproperty
1188
- var f$2 = descriptors ? $defineProperty : function defineProperty(O, P, Attributes) {
1189
- anObject(O);
1190
- P = toPrimitive(P, true);
1191
- anObject(Attributes);
1192
- if (ie8DomDefine) try {
738
+ objectDefineProperty.f = DESCRIPTORS$4 ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O, P, Attributes) {
739
+ anObject$3(O);
740
+ P = toPropertyKey(P);
741
+ anObject$3(Attributes);
742
+ if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
743
+ var current = $getOwnPropertyDescriptor(O, P);
744
+ if (current && current[WRITABLE]) {
745
+ O[P] = Attributes.value;
746
+ Attributes = {
747
+ configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
748
+ enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
749
+ writable: false
750
+ };
751
+ }
752
+ } return $defineProperty(O, P, Attributes);
753
+ } : $defineProperty : function defineProperty(O, P, Attributes) {
754
+ anObject$3(O);
755
+ P = toPropertyKey(P);
756
+ anObject$3(Attributes);
757
+ if (IE8_DOM_DEFINE) try {
1193
758
  return $defineProperty(O, P, Attributes);
1194
759
  } catch (error) { /* empty */ }
1195
- if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');
760
+ if ('get' in Attributes || 'set' in Attributes) throw $TypeError('Accessors not supported');
1196
761
  if ('value' in Attributes) O[P] = Attributes.value;
1197
762
  return O;
1198
763
  };
1199
764
 
1200
- var objectDefineProperty = {
1201
- f: f$2
1202
- };
765
+ var DESCRIPTORS$3 = descriptors;
766
+ var definePropertyModule$3 = objectDefineProperty;
767
+ var createPropertyDescriptor = createPropertyDescriptor$2;
1203
768
 
1204
- var createNonEnumerableProperty = descriptors ? function (object, key, value) {
1205
- return objectDefineProperty.f(object, key, createPropertyDescriptor(1, value));
769
+ var createNonEnumerableProperty$2 = DESCRIPTORS$3 ? function (object, key, value) {
770
+ return definePropertyModule$3.f(object, key, createPropertyDescriptor(1, value));
1206
771
  } : function (object, key, value) {
1207
772
  object[key] = value;
1208
773
  return object;
1209
774
  };
1210
775
 
1211
- var setGlobal = function (key, value) {
1212
- try {
1213
- createNonEnumerableProperty(global_1, key, value);
1214
- } catch (error) {
1215
- global_1[key] = value;
1216
- } return value;
1217
- };
776
+ var makeBuiltIn$2 = {exports: {}};
1218
777
 
1219
- var SHARED = '__core-js_shared__';
1220
- var store = global_1[SHARED] || setGlobal(SHARED, {});
778
+ var DESCRIPTORS$2 = descriptors;
779
+ var hasOwn$4 = hasOwnProperty_1;
780
+
781
+ var FunctionPrototype = Function.prototype;
782
+ // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
783
+ var getDescriptor = DESCRIPTORS$2 && Object.getOwnPropertyDescriptor;
784
+
785
+ var EXISTS = hasOwn$4(FunctionPrototype, 'name');
786
+ // additional protection from minified / mangled / dropped function names
787
+ var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
788
+ var CONFIGURABLE = EXISTS && (!DESCRIPTORS$2 || (DESCRIPTORS$2 && getDescriptor(FunctionPrototype, 'name').configurable));
1221
789
 
1222
- var sharedStore = store;
790
+ var functionName = {
791
+ EXISTS: EXISTS,
792
+ PROPER: PROPER,
793
+ CONFIGURABLE: CONFIGURABLE
794
+ };
795
+
796
+ var uncurryThis$6 = functionUncurryThis;
797
+ var isCallable$6 = isCallable$c;
798
+ var store$1 = sharedStore;
1223
799
 
1224
- var functionToString = Function.toString;
800
+ var functionToString = uncurryThis$6(Function.toString);
1225
801
 
1226
- // this helper broken in `3.4.1-3.4.4`, so we can't use `shared` helper
1227
- if (typeof sharedStore.inspectSource != 'function') {
1228
- sharedStore.inspectSource = function (it) {
1229
- return functionToString.call(it);
802
+ // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
803
+ if (!isCallable$6(store$1.inspectSource)) {
804
+ store$1.inspectSource = function (it) {
805
+ return functionToString(it);
1230
806
  };
1231
807
  }
1232
808
 
1233
- var inspectSource = sharedStore.inspectSource;
809
+ var inspectSource$3 = store$1.inspectSource;
1234
810
 
1235
- var WeakMap = global_1.WeakMap;
811
+ var global$3 = global$a;
812
+ var isCallable$5 = isCallable$c;
813
+ var inspectSource$2 = inspectSource$3;
1236
814
 
1237
- var nativeWeakMap = typeof WeakMap === 'function' && /native code/.test(inspectSource(WeakMap));
1238
-
1239
- var shared = createCommonjsModule(function (module) {
1240
- (module.exports = function (key, value) {
1241
- return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
1242
- })('versions', []).push({
1243
- version: '3.12.1',
1244
- mode: 'global',
1245
- copyright: '© 2021 Denis Pushkarev (zloirock.ru)'
1246
- });
1247
- });
815
+ var WeakMap$1 = global$3.WeakMap;
1248
816
 
1249
- var id = 0;
1250
- var postfix = Math.random();
817
+ var nativeWeakMap = isCallable$5(WeakMap$1) && /native code/.test(inspectSource$2(WeakMap$1));
1251
818
 
1252
- var uid = function (key) {
1253
- return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);
1254
- };
819
+ var shared$1 = shared$3.exports;
820
+ var uid = uid$2;
1255
821
 
1256
- var keys = shared('keys');
822
+ var keys = shared$1('keys');
1257
823
 
1258
- var sharedKey = function (key) {
824
+ var sharedKey$2 = function (key) {
1259
825
  return keys[key] || (keys[key] = uid(key));
1260
826
  };
1261
827
 
1262
- var hiddenKeys = {};
828
+ var hiddenKeys$4 = {};
829
+
830
+ var NATIVE_WEAK_MAP = nativeWeakMap;
831
+ var global$2 = global$a;
832
+ var uncurryThis$5 = functionUncurryThis;
833
+ var isObject$1 = isObject$6;
834
+ var createNonEnumerableProperty$1 = createNonEnumerableProperty$2;
835
+ var hasOwn$3 = hasOwnProperty_1;
836
+ var shared = sharedStore;
837
+ var sharedKey$1 = sharedKey$2;
838
+ var hiddenKeys$3 = hiddenKeys$4;
1263
839
 
1264
840
  var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
1265
- var WeakMap$1 = global_1.WeakMap;
1266
- var set, get, has$1;
841
+ var TypeError$1 = global$2.TypeError;
842
+ var WeakMap = global$2.WeakMap;
843
+ var set, get, has;
1267
844
 
1268
845
  var enforce = function (it) {
1269
- return has$1(it) ? get(it) : set(it, {});
846
+ return has(it) ? get(it) : set(it, {});
1270
847
  };
1271
848
 
1272
849
  var getterFor = function (TYPE) {
1273
850
  return function (it) {
1274
851
  var state;
1275
- if (!isObject(it) || (state = get(it)).type !== TYPE) {
1276
- throw TypeError('Incompatible receiver, ' + TYPE + ' required');
852
+ if (!isObject$1(it) || (state = get(it)).type !== TYPE) {
853
+ throw TypeError$1('Incompatible receiver, ' + TYPE + ' required');
1277
854
  } return state;
1278
855
  };
1279
856
  };
1280
857
 
1281
- if (nativeWeakMap || sharedStore.state) {
1282
- var store$1 = sharedStore.state || (sharedStore.state = new WeakMap$1());
1283
- var wmget = store$1.get;
1284
- var wmhas = store$1.has;
1285
- var wmset = store$1.set;
858
+ if (NATIVE_WEAK_MAP || shared.state) {
859
+ var store = shared.state || (shared.state = new WeakMap());
860
+ var wmget = uncurryThis$5(store.get);
861
+ var wmhas = uncurryThis$5(store.has);
862
+ var wmset = uncurryThis$5(store.set);
1286
863
  set = function (it, metadata) {
1287
- if (wmhas.call(store$1, it)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);
864
+ if (wmhas(store, it)) throw new TypeError$1(OBJECT_ALREADY_INITIALIZED);
1288
865
  metadata.facade = it;
1289
- wmset.call(store$1, it, metadata);
866
+ wmset(store, it, metadata);
1290
867
  return metadata;
1291
868
  };
1292
869
  get = function (it) {
1293
- return wmget.call(store$1, it) || {};
870
+ return wmget(store, it) || {};
1294
871
  };
1295
- has$1 = function (it) {
1296
- return wmhas.call(store$1, it);
872
+ has = function (it) {
873
+ return wmhas(store, it);
1297
874
  };
1298
875
  } else {
1299
- var STATE = sharedKey('state');
1300
- hiddenKeys[STATE] = true;
876
+ var STATE = sharedKey$1('state');
877
+ hiddenKeys$3[STATE] = true;
1301
878
  set = function (it, metadata) {
1302
- if (has(it, STATE)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);
879
+ if (hasOwn$3(it, STATE)) throw new TypeError$1(OBJECT_ALREADY_INITIALIZED);
1303
880
  metadata.facade = it;
1304
- createNonEnumerableProperty(it, STATE, metadata);
881
+ createNonEnumerableProperty$1(it, STATE, metadata);
1305
882
  return metadata;
1306
883
  };
1307
884
  get = function (it) {
1308
- return has(it, STATE) ? it[STATE] : {};
885
+ return hasOwn$3(it, STATE) ? it[STATE] : {};
1309
886
  };
1310
- has$1 = function (it) {
1311
- return has(it, STATE);
887
+ has = function (it) {
888
+ return hasOwn$3(it, STATE);
1312
889
  };
1313
890
  }
1314
891
 
1315
892
  var internalState = {
1316
893
  set: set,
1317
894
  get: get,
1318
- has: has$1,
895
+ has: has,
1319
896
  enforce: enforce,
1320
897
  getterFor: getterFor
1321
898
  };
1322
899
 
1323
- var redefine = createCommonjsModule(function (module) {
1324
- var getInternalState = internalState.get;
1325
- var enforceInternalState = internalState.enforce;
1326
- var TEMPLATE = String(String).split('String');
900
+ var fails$2 = fails$9;
901
+ var isCallable$4 = isCallable$c;
902
+ var hasOwn$2 = hasOwnProperty_1;
903
+ var DESCRIPTORS$1 = descriptors;
904
+ var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
905
+ var inspectSource$1 = inspectSource$3;
906
+ var InternalStateModule = internalState;
1327
907
 
1328
- (module.exports = function (O, key, value, options) {
1329
- var unsafe = options ? !!options.unsafe : false;
1330
- var simple = options ? !!options.enumerable : false;
1331
- var noTargetGet = options ? !!options.noTargetGet : false;
1332
- var state;
1333
- if (typeof value == 'function') {
1334
- if (typeof key == 'string' && !has(value, 'name')) {
1335
- createNonEnumerableProperty(value, 'name', key);
1336
- }
1337
- state = enforceInternalState(value);
1338
- if (!state.source) {
1339
- state.source = TEMPLATE.join(typeof key == 'string' ? key : '');
1340
- }
1341
- }
1342
- if (O === global_1) {
1343
- if (simple) O[key] = value;
1344
- else setGlobal(key, value);
1345
- return;
1346
- } else if (!unsafe) {
1347
- delete O[key];
1348
- } else if (!noTargetGet && O[key]) {
1349
- simple = true;
1350
- }
1351
- if (simple) O[key] = value;
1352
- else createNonEnumerableProperty(O, key, value);
1353
- // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
1354
- })(Function.prototype, 'toString', function toString() {
1355
- return typeof this == 'function' && getInternalState(this).source || inspectSource(this);
1356
- });
908
+ var enforceInternalState = InternalStateModule.enforce;
909
+ var getInternalState = InternalStateModule.get;
910
+ // eslint-disable-next-line es-x/no-object-defineproperty -- safe
911
+ var defineProperty$1 = Object.defineProperty;
912
+
913
+ var CONFIGURABLE_LENGTH = DESCRIPTORS$1 && !fails$2(function () {
914
+ return defineProperty$1(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
1357
915
  });
1358
916
 
1359
- var path = global_1;
917
+ var TEMPLATE = String(String).split('String');
1360
918
 
1361
- var aFunction = function (variable) {
1362
- return typeof variable == 'function' ? variable : undefined;
919
+ var makeBuiltIn$1 = makeBuiltIn$2.exports = function (value, name, options) {
920
+ if (String(name).slice(0, 7) === 'Symbol(') {
921
+ name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
922
+ }
923
+ if (options && options.getter) name = 'get ' + name;
924
+ if (options && options.setter) name = 'set ' + name;
925
+ if (!hasOwn$2(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {
926
+ if (DESCRIPTORS$1) defineProperty$1(value, 'name', { value: name, configurable: true });
927
+ else value.name = name;
928
+ }
929
+ if (CONFIGURABLE_LENGTH && options && hasOwn$2(options, 'arity') && value.length !== options.arity) {
930
+ defineProperty$1(value, 'length', { value: options.arity });
931
+ }
932
+ try {
933
+ if (options && hasOwn$2(options, 'constructor') && options.constructor) {
934
+ if (DESCRIPTORS$1) defineProperty$1(value, 'prototype', { writable: false });
935
+ // in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable
936
+ } else if (value.prototype) value.prototype = undefined;
937
+ } catch (error) { /* empty */ }
938
+ var state = enforceInternalState(value);
939
+ if (!hasOwn$2(state, 'source')) {
940
+ state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
941
+ } return value;
1363
942
  };
1364
943
 
1365
- var getBuiltIn = function (namespace, method) {
1366
- return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global_1[namespace])
1367
- : path[namespace] && path[namespace][method] || global_1[namespace] && global_1[namespace][method];
944
+ // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
945
+ // eslint-disable-next-line no-extend-native -- required
946
+ Function.prototype.toString = makeBuiltIn$1(function toString() {
947
+ return isCallable$4(this) && getInternalState(this).source || inspectSource$1(this);
948
+ }, 'toString');
949
+
950
+ var isCallable$3 = isCallable$c;
951
+ var definePropertyModule$2 = objectDefineProperty;
952
+ var makeBuiltIn = makeBuiltIn$2.exports;
953
+ var defineGlobalProperty$1 = defineGlobalProperty$3;
954
+
955
+ var defineBuiltIn$1 = function (O, key, value, options) {
956
+ if (!options) options = {};
957
+ var simple = options.enumerable;
958
+ var name = options.name !== undefined ? options.name : key;
959
+ if (isCallable$3(value)) makeBuiltIn(value, name, options);
960
+ if (options.global) {
961
+ if (simple) O[key] = value;
962
+ else defineGlobalProperty$1(key, value);
963
+ } else {
964
+ try {
965
+ if (!options.unsafe) delete O[key];
966
+ else if (O[key]) simple = true;
967
+ } catch (error) { /* empty */ }
968
+ if (simple) O[key] = value;
969
+ else definePropertyModule$2.f(O, key, {
970
+ value: value,
971
+ enumerable: false,
972
+ configurable: !options.nonConfigurable,
973
+ writable: !options.nonWritable
974
+ });
975
+ } return O;
1368
976
  };
1369
977
 
978
+ var objectGetOwnPropertyNames = {};
979
+
1370
980
  var ceil = Math.ceil;
1371
981
  var floor = Math.floor;
1372
982
 
1373
- // `ToInteger` abstract operation
1374
- // https://tc39.es/ecma262/#sec-tointeger
1375
- var toInteger = function (argument) {
1376
- return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);
983
+ // `Math.trunc` method
984
+ // https://tc39.es/ecma262/#sec-math.trunc
985
+ // eslint-disable-next-line es-x/no-math-trunc -- safe
986
+ var mathTrunc = Math.trunc || function trunc(x) {
987
+ var n = +x;
988
+ return (n > 0 ? floor : ceil)(n);
1377
989
  };
1378
990
 
1379
- var min = Math.min;
991
+ var trunc = mathTrunc;
1380
992
 
1381
- // `ToLength` abstract operation
1382
- // https://tc39.es/ecma262/#sec-tolength
1383
- var toLength = function (argument) {
1384
- return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
993
+ // `ToIntegerOrInfinity` abstract operation
994
+ // https://tc39.es/ecma262/#sec-tointegerorinfinity
995
+ var toIntegerOrInfinity$2 = function (argument) {
996
+ var number = +argument;
997
+ // eslint-disable-next-line no-self-compare -- NaN check
998
+ return number !== number || number === 0 ? 0 : trunc(number);
1385
999
  };
1386
1000
 
1001
+ var toIntegerOrInfinity$1 = toIntegerOrInfinity$2;
1002
+
1387
1003
  var max = Math.max;
1388
1004
  var min$1 = Math.min;
1389
1005
 
1390
1006
  // Helper for a popular repeating case of the spec:
1391
1007
  // Let integer be ? ToInteger(index).
1392
1008
  // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
1393
- var toAbsoluteIndex = function (index, length) {
1394
- var integer = toInteger(index);
1009
+ var toAbsoluteIndex$1 = function (index, length) {
1010
+ var integer = toIntegerOrInfinity$1(index);
1395
1011
  return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
1396
1012
  };
1397
1013
 
1014
+ var toIntegerOrInfinity = toIntegerOrInfinity$2;
1015
+
1016
+ var min = Math.min;
1017
+
1018
+ // `ToLength` abstract operation
1019
+ // https://tc39.es/ecma262/#sec-tolength
1020
+ var toLength$1 = function (argument) {
1021
+ return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
1022
+ };
1023
+
1024
+ var toLength = toLength$1;
1025
+
1026
+ // `LengthOfArrayLike` abstract operation
1027
+ // https://tc39.es/ecma262/#sec-lengthofarraylike
1028
+ var lengthOfArrayLike$2 = function (obj) {
1029
+ return toLength(obj.length);
1030
+ };
1031
+
1032
+ var toIndexedObject$2 = toIndexedObject$4;
1033
+ var toAbsoluteIndex = toAbsoluteIndex$1;
1034
+ var lengthOfArrayLike$1 = lengthOfArrayLike$2;
1035
+
1398
1036
  // `Array.prototype.{ indexOf, includes }` methods implementation
1399
- var createMethod = function (IS_INCLUDES) {
1037
+ var createMethod$1 = function (IS_INCLUDES) {
1400
1038
  return function ($this, el, fromIndex) {
1401
- var O = toIndexedObject($this);
1402
- var length = toLength(O.length);
1039
+ var O = toIndexedObject$2($this);
1040
+ var length = lengthOfArrayLike$1(O);
1403
1041
  var index = toAbsoluteIndex(fromIndex, length);
1404
1042
  var value;
1405
1043
  // Array#includes uses SameValueZero equality algorithm
@@ -1418,30 +1056,35 @@ var createMethod = function (IS_INCLUDES) {
1418
1056
  var arrayIncludes = {
1419
1057
  // `Array.prototype.includes` method
1420
1058
  // https://tc39.es/ecma262/#sec-array.prototype.includes
1421
- includes: createMethod(true),
1059
+ includes: createMethod$1(true),
1422
1060
  // `Array.prototype.indexOf` method
1423
1061
  // https://tc39.es/ecma262/#sec-array.prototype.indexof
1424
- indexOf: createMethod(false)
1062
+ indexOf: createMethod$1(false)
1425
1063
  };
1426
1064
 
1065
+ var uncurryThis$4 = functionUncurryThis;
1066
+ var hasOwn$1 = hasOwnProperty_1;
1067
+ var toIndexedObject$1 = toIndexedObject$4;
1427
1068
  var indexOf = arrayIncludes.indexOf;
1069
+ var hiddenKeys$2 = hiddenKeys$4;
1428
1070
 
1071
+ var push$1 = uncurryThis$4([].push);
1429
1072
 
1430
1073
  var objectKeysInternal = function (object, names) {
1431
- var O = toIndexedObject(object);
1074
+ var O = toIndexedObject$1(object);
1432
1075
  var i = 0;
1433
1076
  var result = [];
1434
1077
  var key;
1435
- for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key);
1078
+ for (key in O) !hasOwn$1(hiddenKeys$2, key) && hasOwn$1(O, key) && push$1(result, key);
1436
1079
  // Don't enum bug & hidden keys
1437
- while (names.length > i) if (has(O, key = names[i++])) {
1438
- ~indexOf(result, key) || result.push(key);
1080
+ while (names.length > i) if (hasOwn$1(O, key = names[i++])) {
1081
+ ~indexOf(result, key) || push$1(result, key);
1439
1082
  }
1440
1083
  return result;
1441
1084
  };
1442
1085
 
1443
1086
  // IE8- don't enum bug keys
1444
- var enumBugKeys = [
1087
+ var enumBugKeys$3 = [
1445
1088
  'constructor',
1446
1089
  'hasOwnProperty',
1447
1090
  'isPrototypeOf',
@@ -1451,83 +1094,100 @@ var enumBugKeys = [
1451
1094
  'valueOf'
1452
1095
  ];
1453
1096
 
1454
- var hiddenKeys$1 = enumBugKeys.concat('length', 'prototype');
1097
+ var internalObjectKeys$1 = objectKeysInternal;
1098
+ var enumBugKeys$2 = enumBugKeys$3;
1099
+
1100
+ var hiddenKeys$1 = enumBugKeys$2.concat('length', 'prototype');
1455
1101
 
1456
1102
  // `Object.getOwnPropertyNames` method
1457
1103
  // https://tc39.es/ecma262/#sec-object.getownpropertynames
1458
- // eslint-disable-next-line es/no-object-getownpropertynames -- safe
1459
- var f$3 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
1460
- return objectKeysInternal(O, hiddenKeys$1);
1104
+ // eslint-disable-next-line es-x/no-object-getownpropertynames -- safe
1105
+ objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
1106
+ return internalObjectKeys$1(O, hiddenKeys$1);
1461
1107
  };
1462
1108
 
1463
- var objectGetOwnPropertyNames = {
1464
- f: f$3
1465
- };
1109
+ var objectGetOwnPropertySymbols = {};
1466
1110
 
1467
- // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
1468
- var f$4 = Object.getOwnPropertySymbols;
1111
+ // eslint-disable-next-line es-x/no-object-getownpropertysymbols -- safe
1112
+ objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
1469
1113
 
1470
- var objectGetOwnPropertySymbols = {
1471
- f: f$4
1472
- };
1114
+ var getBuiltIn$2 = getBuiltIn$5;
1115
+ var uncurryThis$3 = functionUncurryThis;
1116
+ var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
1117
+ var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
1118
+ var anObject$2 = anObject$4;
1119
+
1120
+ var concat = uncurryThis$3([].concat);
1473
1121
 
1474
1122
  // all object keys, includes non-enumerable and symbols
1475
- var ownKeys$1 = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
1476
- var keys = objectGetOwnPropertyNames.f(anObject(it));
1477
- var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
1478
- return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;
1123
+ var ownKeys$1 = getBuiltIn$2('Reflect', 'ownKeys') || function ownKeys(it) {
1124
+ var keys = getOwnPropertyNamesModule.f(anObject$2(it));
1125
+ var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
1126
+ return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;
1479
1127
  };
1480
1128
 
1481
- var copyConstructorProperties = function (target, source) {
1482
- var keys = ownKeys$1(source);
1483
- var defineProperty = objectDefineProperty.f;
1484
- var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
1129
+ var hasOwn = hasOwnProperty_1;
1130
+ var ownKeys = ownKeys$1;
1131
+ var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
1132
+ var definePropertyModule$1 = objectDefineProperty;
1133
+
1134
+ var copyConstructorProperties$1 = function (target, source, exceptions) {
1135
+ var keys = ownKeys(source);
1136
+ var defineProperty = definePropertyModule$1.f;
1137
+ var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
1485
1138
  for (var i = 0; i < keys.length; i++) {
1486
1139
  var key = keys[i];
1487
- if (!has(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
1140
+ if (!hasOwn(target, key) && !(exceptions && hasOwn(exceptions, key))) {
1141
+ defineProperty(target, key, getOwnPropertyDescriptor(source, key));
1142
+ }
1488
1143
  }
1489
1144
  };
1490
1145
 
1146
+ var fails$1 = fails$9;
1147
+ var isCallable$2 = isCallable$c;
1148
+
1491
1149
  var replacement = /#|\.prototype\./;
1492
1150
 
1493
- var isForced = function (feature, detection) {
1151
+ var isForced$1 = function (feature, detection) {
1494
1152
  var value = data[normalize(feature)];
1495
1153
  return value == POLYFILL ? true
1496
1154
  : value == NATIVE ? false
1497
- : typeof detection == 'function' ? fails(detection)
1155
+ : isCallable$2(detection) ? fails$1(detection)
1498
1156
  : !!detection;
1499
1157
  };
1500
1158
 
1501
- var normalize = isForced.normalize = function (string) {
1159
+ var normalize = isForced$1.normalize = function (string) {
1502
1160
  return String(string).replace(replacement, '.').toLowerCase();
1503
1161
  };
1504
1162
 
1505
- var data = isForced.data = {};
1506
- var NATIVE = isForced.NATIVE = 'N';
1507
- var POLYFILL = isForced.POLYFILL = 'P';
1508
-
1509
- var isForced_1 = isForced;
1510
-
1511
- var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
1512
-
1513
-
1514
-
1163
+ var data = isForced$1.data = {};
1164
+ var NATIVE = isForced$1.NATIVE = 'N';
1165
+ var POLYFILL = isForced$1.POLYFILL = 'P';
1515
1166
 
1167
+ var isForced_1 = isForced$1;
1516
1168
 
1169
+ var global$1 = global$a;
1170
+ var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
1171
+ var createNonEnumerableProperty = createNonEnumerableProperty$2;
1172
+ var defineBuiltIn = defineBuiltIn$1;
1173
+ var defineGlobalProperty = defineGlobalProperty$3;
1174
+ var copyConstructorProperties = copyConstructorProperties$1;
1175
+ var isForced = isForced_1;
1517
1176
 
1518
1177
  /*
1519
- options.target - name of the target object
1520
- options.global - target is the global object
1521
- options.stat - export as static methods of target
1522
- options.proto - export as prototype methods of target
1523
- options.real - real prototype method for the `pure` version
1524
- options.forced - export even if the native feature is available
1525
- options.bind - bind methods to the target, required for the `pure` version
1526
- options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
1527
- options.unsafe - use the simple assignment of property instead of delete + defineProperty
1528
- options.sham - add a flag to not completely full polyfills
1529
- options.enumerable - export as enumerable property
1530
- options.noTargetGet - prevent calling a getter on target
1178
+ options.target - name of the target object
1179
+ options.global - target is the global object
1180
+ options.stat - export as static methods of target
1181
+ options.proto - export as prototype methods of target
1182
+ options.real - real prototype method for the `pure` version
1183
+ options.forced - export even if the native feature is available
1184
+ options.bind - bind methods to the target, required for the `pure` version
1185
+ options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
1186
+ options.unsafe - use the simple assignment of property instead of delete + defineProperty
1187
+ options.sham - add a flag to not completely full polyfills
1188
+ options.enumerable - export as enumerable property
1189
+ options.dontCallGetSet - prevent calling a getter on target
1190
+ options.name - the .name of the function if it does not match the key
1531
1191
  */
1532
1192
  var _export = function (options, source) {
1533
1193
  var TARGET = options.target;
@@ -1535,158 +1195,204 @@ var _export = function (options, source) {
1535
1195
  var STATIC = options.stat;
1536
1196
  var FORCED, target, key, targetProperty, sourceProperty, descriptor;
1537
1197
  if (GLOBAL) {
1538
- target = global_1;
1198
+ target = global$1;
1539
1199
  } else if (STATIC) {
1540
- target = global_1[TARGET] || setGlobal(TARGET, {});
1200
+ target = global$1[TARGET] || defineGlobalProperty(TARGET, {});
1541
1201
  } else {
1542
- target = (global_1[TARGET] || {}).prototype;
1202
+ target = (global$1[TARGET] || {}).prototype;
1543
1203
  }
1544
1204
  if (target) for (key in source) {
1545
1205
  sourceProperty = source[key];
1546
- if (options.noTargetGet) {
1547
- descriptor = getOwnPropertyDescriptor$1(target, key);
1206
+ if (options.dontCallGetSet) {
1207
+ descriptor = getOwnPropertyDescriptor(target, key);
1548
1208
  targetProperty = descriptor && descriptor.value;
1549
1209
  } else targetProperty = target[key];
1550
- FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
1210
+ FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
1551
1211
  // contained in target
1552
1212
  if (!FORCED && targetProperty !== undefined) {
1553
- if (typeof sourceProperty === typeof targetProperty) continue;
1213
+ if (typeof sourceProperty == typeof targetProperty) continue;
1554
1214
  copyConstructorProperties(sourceProperty, targetProperty);
1555
1215
  }
1556
1216
  // add a flag to not completely full polyfills
1557
1217
  if (options.sham || (targetProperty && targetProperty.sham)) {
1558
1218
  createNonEnumerableProperty(sourceProperty, 'sham', true);
1559
1219
  }
1560
- // extend global
1561
- redefine(target, key, sourceProperty, options);
1220
+ defineBuiltIn(target, key, sourceProperty, options);
1562
1221
  }
1563
1222
  };
1564
1223
 
1565
- var aFunction$1 = function (it) {
1566
- if (typeof it != 'function') {
1567
- throw TypeError(String(it) + ' is not a function');
1568
- } return it;
1569
- };
1224
+ var uncurryThis$2 = functionUncurryThis;
1225
+ var aCallable = aCallable$2;
1226
+ var NATIVE_BIND = functionBindNative;
1227
+
1228
+ var bind$1 = uncurryThis$2(uncurryThis$2.bind);
1570
1229
 
1571
1230
  // optional / simple context binding
1572
- var functionBindContext = function (fn, that, length) {
1573
- aFunction$1(fn);
1574
- if (that === undefined) return fn;
1575
- switch (length) {
1576
- case 0: return function () {
1577
- return fn.call(that);
1578
- };
1579
- case 1: return function (a) {
1580
- return fn.call(that, a);
1581
- };
1582
- case 2: return function (a, b) {
1583
- return fn.call(that, a, b);
1584
- };
1585
- case 3: return function (a, b, c) {
1586
- return fn.call(that, a, b, c);
1587
- };
1588
- }
1589
- return function (/* ...args */) {
1231
+ var functionBindContext = function (fn, that) {
1232
+ aCallable(fn);
1233
+ return that === undefined ? fn : NATIVE_BIND ? bind$1(fn, that) : function (/* ...args */) {
1590
1234
  return fn.apply(that, arguments);
1591
1235
  };
1592
1236
  };
1593
1237
 
1238
+ var classof$2 = classofRaw$1;
1239
+
1594
1240
  // `IsArray` abstract operation
1595
1241
  // https://tc39.es/ecma262/#sec-isarray
1596
- // eslint-disable-next-line es/no-array-isarray -- safe
1597
- var isArray = Array.isArray || function isArray(arg) {
1598
- return classofRaw(arg) == 'Array';
1242
+ // eslint-disable-next-line es-x/no-array-isarray -- safe
1243
+ var isArray$1 = Array.isArray || function isArray(argument) {
1244
+ return classof$2(argument) == 'Array';
1599
1245
  };
1600
1246
 
1601
- var engineUserAgent = getBuiltIn('navigator', 'userAgent') || '';
1247
+ var wellKnownSymbol$3 = wellKnownSymbol$5;
1602
1248
 
1603
- var process = global_1.process;
1604
- var versions = process && process.versions;
1605
- var v8 = versions && versions.v8;
1606
- var match, version;
1249
+ var TO_STRING_TAG$1 = wellKnownSymbol$3('toStringTag');
1250
+ var test = {};
1607
1251
 
1608
- if (v8) {
1609
- match = v8.split('.');
1610
- version = match[0] < 4 ? 1 : match[0] + match[1];
1611
- } else if (engineUserAgent) {
1612
- match = engineUserAgent.match(/Edge\/(\d+)/);
1613
- if (!match || match[1] >= 74) {
1614
- match = engineUserAgent.match(/Chrome\/(\d+)/);
1615
- if (match) version = match[1];
1616
- }
1617
- }
1252
+ test[TO_STRING_TAG$1] = 'z';
1618
1253
 
1619
- var engineV8Version = version && +version;
1254
+ var toStringTagSupport = String(test) === '[object z]';
1620
1255
 
1621
- /* eslint-disable es/no-symbol -- required for testing */
1256
+ var TO_STRING_TAG_SUPPORT = toStringTagSupport;
1257
+ var isCallable$1 = isCallable$c;
1258
+ var classofRaw = classofRaw$1;
1259
+ var wellKnownSymbol$2 = wellKnownSymbol$5;
1622
1260
 
1261
+ var TO_STRING_TAG = wellKnownSymbol$2('toStringTag');
1262
+ var $Object = Object;
1623
1263
 
1264
+ // ES3 wrong here
1265
+ var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
1624
1266
 
1625
- // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
1626
- var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
1627
- return !String(Symbol()) ||
1628
- // Chrome 38 Symbol has incorrect toString conversion
1629
- // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
1630
- !Symbol.sham && engineV8Version && engineV8Version < 41;
1631
- });
1267
+ // fallback for IE11 Script Access Denied error
1268
+ var tryGet = function (it, key) {
1269
+ try {
1270
+ return it[key];
1271
+ } catch (error) { /* empty */ }
1272
+ };
1632
1273
 
1633
- /* eslint-disable es/no-symbol -- required for testing */
1274
+ // getting tag from ES6+ `Object.prototype.toString`
1275
+ var classof$1 = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
1276
+ var O, tag, result;
1277
+ return it === undefined ? 'Undefined' : it === null ? 'Null'
1278
+ // @@toStringTag case
1279
+ : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag
1280
+ // builtinTag case
1281
+ : CORRECT_ARGUMENTS ? classofRaw(O)
1282
+ // ES3 arguments fallback
1283
+ : (result = classofRaw(O)) == 'Object' && isCallable$1(O.callee) ? 'Arguments' : result;
1284
+ };
1285
+
1286
+ var uncurryThis$1 = functionUncurryThis;
1287
+ var fails = fails$9;
1288
+ var isCallable = isCallable$c;
1289
+ var classof = classof$1;
1290
+ var getBuiltIn$1 = getBuiltIn$5;
1291
+ var inspectSource = inspectSource$3;
1292
+
1293
+ var noop = function () { /* empty */ };
1294
+ var empty = [];
1295
+ var construct = getBuiltIn$1('Reflect', 'construct');
1296
+ var constructorRegExp = /^\s*(?:class|function)\b/;
1297
+ var exec = uncurryThis$1(constructorRegExp.exec);
1298
+ var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
1299
+
1300
+ var isConstructorModern = function isConstructor(argument) {
1301
+ if (!isCallable(argument)) return false;
1302
+ try {
1303
+ construct(noop, empty, argument);
1304
+ return true;
1305
+ } catch (error) {
1306
+ return false;
1307
+ }
1308
+ };
1634
1309
 
1310
+ var isConstructorLegacy = function isConstructor(argument) {
1311
+ if (!isCallable(argument)) return false;
1312
+ switch (classof(argument)) {
1313
+ case 'AsyncFunction':
1314
+ case 'GeneratorFunction':
1315
+ case 'AsyncGeneratorFunction': return false;
1316
+ }
1317
+ try {
1318
+ // we can't check .prototype since constructors produced by .bind haven't it
1319
+ // `Function#toString` throws on some built-it function in some legacy engines
1320
+ // (for example, `DOMQuad` and similar in FF41-)
1321
+ return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument));
1322
+ } catch (error) {
1323
+ return true;
1324
+ }
1325
+ };
1635
1326
 
1636
- var useSymbolAsUid = nativeSymbol
1637
- && !Symbol.sham
1638
- && typeof Symbol.iterator == 'symbol';
1327
+ isConstructorLegacy.sham = true;
1639
1328
 
1640
- var WellKnownSymbolsStore = shared('wks');
1641
- var Symbol$1 = global_1.Symbol;
1642
- var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid;
1329
+ // `IsConstructor` abstract operation
1330
+ // https://tc39.es/ecma262/#sec-isconstructor
1331
+ var isConstructor$1 = !construct || fails(function () {
1332
+ var called;
1333
+ return isConstructorModern(isConstructorModern.call)
1334
+ || !isConstructorModern(Object)
1335
+ || !isConstructorModern(function () { called = true; })
1336
+ || called;
1337
+ }) ? isConstructorLegacy : isConstructorModern;
1643
1338
 
1644
- var wellKnownSymbol = function (name) {
1645
- if (!has(WellKnownSymbolsStore, name) || !(nativeSymbol || typeof WellKnownSymbolsStore[name] == 'string')) {
1646
- if (nativeSymbol && has(Symbol$1, name)) {
1647
- WellKnownSymbolsStore[name] = Symbol$1[name];
1648
- } else {
1649
- WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name);
1650
- }
1651
- } return WellKnownSymbolsStore[name];
1652
- };
1339
+ var isArray = isArray$1;
1340
+ var isConstructor = isConstructor$1;
1341
+ var isObject = isObject$6;
1342
+ var wellKnownSymbol$1 = wellKnownSymbol$5;
1653
1343
 
1654
- var SPECIES = wellKnownSymbol('species');
1344
+ var SPECIES = wellKnownSymbol$1('species');
1345
+ var $Array = Array;
1655
1346
 
1656
- // `ArraySpeciesCreate` abstract operation
1347
+ // a part of `ArraySpeciesCreate` abstract operation
1657
1348
  // https://tc39.es/ecma262/#sec-arrayspeciescreate
1658
- var arraySpeciesCreate = function (originalArray, length) {
1349
+ var arraySpeciesConstructor$1 = function (originalArray) {
1659
1350
  var C;
1660
1351
  if (isArray(originalArray)) {
1661
1352
  C = originalArray.constructor;
1662
1353
  // cross-realm fallback
1663
- if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
1354
+ if (isConstructor(C) && (C === $Array || isArray(C.prototype))) C = undefined;
1664
1355
  else if (isObject(C)) {
1665
1356
  C = C[SPECIES];
1666
1357
  if (C === null) C = undefined;
1667
1358
  }
1668
- } return new (C === undefined ? Array : C)(length === 0 ? 0 : length);
1359
+ } return C === undefined ? $Array : C;
1669
1360
  };
1670
1361
 
1671
- var push = [].push;
1362
+ var arraySpeciesConstructor = arraySpeciesConstructor$1;
1672
1363
 
1673
- // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterOut }` methods implementation
1674
- var createMethod$1 = function (TYPE) {
1364
+ // `ArraySpeciesCreate` abstract operation
1365
+ // https://tc39.es/ecma262/#sec-arrayspeciescreate
1366
+ var arraySpeciesCreate$1 = function (originalArray, length) {
1367
+ return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);
1368
+ };
1369
+
1370
+ var bind = functionBindContext;
1371
+ var uncurryThis = functionUncurryThis;
1372
+ var IndexedObject = indexedObject;
1373
+ var toObject = toObject$2;
1374
+ var lengthOfArrayLike = lengthOfArrayLike$2;
1375
+ var arraySpeciesCreate = arraySpeciesCreate$1;
1376
+
1377
+ var push = uncurryThis([].push);
1378
+
1379
+ // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterReject }` methods implementation
1380
+ var createMethod = function (TYPE) {
1675
1381
  var IS_MAP = TYPE == 1;
1676
1382
  var IS_FILTER = TYPE == 2;
1677
1383
  var IS_SOME = TYPE == 3;
1678
1384
  var IS_EVERY = TYPE == 4;
1679
1385
  var IS_FIND_INDEX = TYPE == 6;
1680
- var IS_FILTER_OUT = TYPE == 7;
1386
+ var IS_FILTER_REJECT = TYPE == 7;
1681
1387
  var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
1682
1388
  return function ($this, callbackfn, that, specificCreate) {
1683
1389
  var O = toObject($this);
1684
- var self = indexedObject(O);
1685
- var boundFunction = functionBindContext(callbackfn, that, 3);
1686
- var length = toLength(self.length);
1390
+ var self = IndexedObject(O);
1391
+ var boundFunction = bind(callbackfn, that);
1392
+ var length = lengthOfArrayLike(self);
1687
1393
  var index = 0;
1688
1394
  var create = specificCreate || arraySpeciesCreate;
1689
- var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_OUT ? create($this, 0) : undefined;
1395
+ var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_REJECT ? create($this, 0) : undefined;
1690
1396
  var value, result;
1691
1397
  for (;length > index; index++) if (NO_HOLES || index in self) {
1692
1398
  value = self[index];
@@ -1697,10 +1403,10 @@ var createMethod$1 = function (TYPE) {
1697
1403
  case 3: return true; // some
1698
1404
  case 5: return value; // find
1699
1405
  case 6: return index; // findIndex
1700
- case 2: push.call(target, value); // filter
1406
+ case 2: push(target, value); // filter
1701
1407
  } else switch (TYPE) {
1702
1408
  case 4: return false; // every
1703
- case 7: push.call(target, value); // filterOut
1409
+ case 7: push(target, value); // filterReject
1704
1410
  }
1705
1411
  }
1706
1412
  }
@@ -1711,51 +1417,76 @@ var createMethod$1 = function (TYPE) {
1711
1417
  var arrayIteration = {
1712
1418
  // `Array.prototype.forEach` method
1713
1419
  // https://tc39.es/ecma262/#sec-array.prototype.foreach
1714
- forEach: createMethod$1(0),
1420
+ forEach: createMethod(0),
1715
1421
  // `Array.prototype.map` method
1716
1422
  // https://tc39.es/ecma262/#sec-array.prototype.map
1717
- map: createMethod$1(1),
1423
+ map: createMethod(1),
1718
1424
  // `Array.prototype.filter` method
1719
1425
  // https://tc39.es/ecma262/#sec-array.prototype.filter
1720
- filter: createMethod$1(2),
1426
+ filter: createMethod(2),
1721
1427
  // `Array.prototype.some` method
1722
1428
  // https://tc39.es/ecma262/#sec-array.prototype.some
1723
- some: createMethod$1(3),
1429
+ some: createMethod(3),
1724
1430
  // `Array.prototype.every` method
1725
1431
  // https://tc39.es/ecma262/#sec-array.prototype.every
1726
- every: createMethod$1(4),
1432
+ every: createMethod(4),
1727
1433
  // `Array.prototype.find` method
1728
1434
  // https://tc39.es/ecma262/#sec-array.prototype.find
1729
- find: createMethod$1(5),
1435
+ find: createMethod(5),
1730
1436
  // `Array.prototype.findIndex` method
1731
1437
  // https://tc39.es/ecma262/#sec-array.prototype.findIndex
1732
- findIndex: createMethod$1(6),
1733
- // `Array.prototype.filterOut` method
1438
+ findIndex: createMethod(6),
1439
+ // `Array.prototype.filterReject` method
1734
1440
  // https://github.com/tc39/proposal-array-filtering
1735
- filterOut: createMethod$1(7)
1441
+ filterReject: createMethod(7)
1736
1442
  };
1737
1443
 
1444
+ var objectDefineProperties = {};
1445
+
1446
+ var internalObjectKeys = objectKeysInternal;
1447
+ var enumBugKeys$1 = enumBugKeys$3;
1448
+
1738
1449
  // `Object.keys` method
1739
1450
  // https://tc39.es/ecma262/#sec-object.keys
1740
- // eslint-disable-next-line es/no-object-keys -- safe
1741
- var objectKeys = Object.keys || function keys(O) {
1742
- return objectKeysInternal(O, enumBugKeys);
1451
+ // eslint-disable-next-line es-x/no-object-keys -- safe
1452
+ var objectKeys$1 = Object.keys || function keys(O) {
1453
+ return internalObjectKeys(O, enumBugKeys$1);
1743
1454
  };
1744
1455
 
1456
+ var DESCRIPTORS = descriptors;
1457
+ var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
1458
+ var definePropertyModule = objectDefineProperty;
1459
+ var anObject$1 = anObject$4;
1460
+ var toIndexedObject = toIndexedObject$4;
1461
+ var objectKeys = objectKeys$1;
1462
+
1745
1463
  // `Object.defineProperties` method
1746
1464
  // https://tc39.es/ecma262/#sec-object.defineproperties
1747
- // eslint-disable-next-line es/no-object-defineproperties -- safe
1748
- var objectDefineProperties = descriptors ? Object.defineProperties : function defineProperties(O, Properties) {
1749
- anObject(O);
1465
+ // eslint-disable-next-line es-x/no-object-defineproperties -- safe
1466
+ objectDefineProperties.f = DESCRIPTORS && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
1467
+ anObject$1(O);
1468
+ var props = toIndexedObject(Properties);
1750
1469
  var keys = objectKeys(Properties);
1751
1470
  var length = keys.length;
1752
1471
  var index = 0;
1753
1472
  var key;
1754
- while (length > index) objectDefineProperty.f(O, key = keys[index++], Properties[key]);
1473
+ while (length > index) definePropertyModule.f(O, key = keys[index++], props[key]);
1755
1474
  return O;
1756
1475
  };
1757
1476
 
1758
- var html = getBuiltIn('document', 'documentElement');
1477
+ var getBuiltIn = getBuiltIn$5;
1478
+
1479
+ var html$1 = getBuiltIn('document', 'documentElement');
1480
+
1481
+ /* global ActiveXObject -- old IE, WSH */
1482
+
1483
+ var anObject = anObject$4;
1484
+ var definePropertiesModule = objectDefineProperties;
1485
+ var enumBugKeys = enumBugKeys$3;
1486
+ var hiddenKeys = hiddenKeys$4;
1487
+ var html = html$1;
1488
+ var documentCreateElement = documentCreateElement$1;
1489
+ var sharedKey = sharedKey$2;
1759
1490
 
1760
1491
  var GT = '>';
1761
1492
  var LT = '<';
@@ -1769,172 +1500,1045 @@ var scriptTag = function (content) {
1769
1500
  return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
1770
1501
  };
1771
1502
 
1772
- // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
1773
- var NullProtoObjectViaActiveX = function (activeXDocument) {
1774
- activeXDocument.write(scriptTag(''));
1775
- activeXDocument.close();
1776
- var temp = activeXDocument.parentWindow.Object;
1777
- activeXDocument = null; // avoid memory leak
1778
- return temp;
1779
- };
1503
+ // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
1504
+ var NullProtoObjectViaActiveX = function (activeXDocument) {
1505
+ activeXDocument.write(scriptTag(''));
1506
+ activeXDocument.close();
1507
+ var temp = activeXDocument.parentWindow.Object;
1508
+ activeXDocument = null; // avoid memory leak
1509
+ return temp;
1510
+ };
1511
+
1512
+ // Create object with fake `null` prototype: use iframe Object with cleared prototype
1513
+ var NullProtoObjectViaIFrame = function () {
1514
+ // Thrash, waste and sodomy: IE GC bug
1515
+ var iframe = documentCreateElement('iframe');
1516
+ var JS = 'java' + SCRIPT + ':';
1517
+ var iframeDocument;
1518
+ iframe.style.display = 'none';
1519
+ html.appendChild(iframe);
1520
+ // https://github.com/zloirock/core-js/issues/475
1521
+ iframe.src = String(JS);
1522
+ iframeDocument = iframe.contentWindow.document;
1523
+ iframeDocument.open();
1524
+ iframeDocument.write(scriptTag('document.F=Object'));
1525
+ iframeDocument.close();
1526
+ return iframeDocument.F;
1527
+ };
1528
+
1529
+ // Check for document.domain and active x support
1530
+ // No need to use active x approach when document.domain is not set
1531
+ // see https://github.com/es-shims/es5-shim/issues/150
1532
+ // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
1533
+ // avoid IE GC bug
1534
+ var activeXDocument;
1535
+ var NullProtoObject = function () {
1536
+ try {
1537
+ activeXDocument = new ActiveXObject('htmlfile');
1538
+ } catch (error) { /* ignore */ }
1539
+ NullProtoObject = typeof document != 'undefined'
1540
+ ? document.domain && activeXDocument
1541
+ ? NullProtoObjectViaActiveX(activeXDocument) // old IE
1542
+ : NullProtoObjectViaIFrame()
1543
+ : NullProtoObjectViaActiveX(activeXDocument); // WSH
1544
+ var length = enumBugKeys.length;
1545
+ while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
1546
+ return NullProtoObject();
1547
+ };
1548
+
1549
+ hiddenKeys[IE_PROTO] = true;
1550
+
1551
+ // `Object.create` method
1552
+ // https://tc39.es/ecma262/#sec-object.create
1553
+ // eslint-disable-next-line es-x/no-object-create -- safe
1554
+ var objectCreate = Object.create || function create(O, Properties) {
1555
+ var result;
1556
+ if (O !== null) {
1557
+ EmptyConstructor[PROTOTYPE] = anObject(O);
1558
+ result = new EmptyConstructor();
1559
+ EmptyConstructor[PROTOTYPE] = null;
1560
+ // add "__proto__" for Object.getPrototypeOf polyfill
1561
+ result[IE_PROTO] = O;
1562
+ } else result = NullProtoObject();
1563
+ return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
1564
+ };
1565
+
1566
+ var wellKnownSymbol = wellKnownSymbol$5;
1567
+ var create = objectCreate;
1568
+ var defineProperty = objectDefineProperty.f;
1569
+
1570
+ var UNSCOPABLES = wellKnownSymbol('unscopables');
1571
+ var ArrayPrototype = Array.prototype;
1572
+
1573
+ // Array.prototype[@@unscopables]
1574
+ // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
1575
+ if (ArrayPrototype[UNSCOPABLES] == undefined) {
1576
+ defineProperty(ArrayPrototype, UNSCOPABLES, {
1577
+ configurable: true,
1578
+ value: create(null)
1579
+ });
1580
+ }
1581
+
1582
+ // add a key to Array.prototype[@@unscopables]
1583
+ var addToUnscopables$1 = function (key) {
1584
+ ArrayPrototype[UNSCOPABLES][key] = true;
1585
+ };
1586
+
1587
+ var $ = _export;
1588
+ var $find = arrayIteration.find;
1589
+ var addToUnscopables = addToUnscopables$1;
1590
+
1591
+ var FIND = 'find';
1592
+ var SKIPS_HOLES = true;
1593
+
1594
+ // Shouldn't skip holes
1595
+ if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
1596
+
1597
+ // `Array.prototype.find` method
1598
+ // https://tc39.es/ecma262/#sec-array.prototype.find
1599
+ $({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
1600
+ find: function find(callbackfn /* , that = undefined */) {
1601
+ return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
1602
+ }
1603
+ });
1604
+
1605
+ // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
1606
+ addToUnscopables(FIND);
1607
+
1608
+ var CONSTANT = {
1609
+ GLOBAL: {
1610
+ HIDE: '__react_tooltip_hide_event',
1611
+ REBUILD: '__react_tooltip_rebuild_event',
1612
+ SHOW: '__react_tooltip_show_event'
1613
+ }
1614
+ };
1615
+
1616
+ /**
1617
+ * Static methods for react-tooltip
1618
+ */
1619
+
1620
+ var dispatchGlobalEvent = function dispatchGlobalEvent(eventName, opts) {
1621
+ // Compatible with IE
1622
+ // @see http://stackoverflow.com/questions/26596123/internet-explorer-9-10-11-event-constructor-doesnt-work
1623
+ // @see https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent
1624
+ var event;
1625
+
1626
+ if (typeof window.CustomEvent === 'function') {
1627
+ event = new window.CustomEvent(eventName, {
1628
+ detail: opts
1629
+ });
1630
+ } else {
1631
+ event = document.createEvent('Event');
1632
+ event.initEvent(eventName, false, true, opts);
1633
+ }
1634
+
1635
+ window.dispatchEvent(event);
1636
+ };
1637
+
1638
+ function staticMethods (target) {
1639
+ /**
1640
+ * Hide all tooltip
1641
+ * @trigger ReactTooltip.hide()
1642
+ */
1643
+ target.hide = function (target) {
1644
+ dispatchGlobalEvent(CONSTANT.GLOBAL.HIDE, {
1645
+ target: target
1646
+ });
1647
+ };
1648
+ /**
1649
+ * Rebuild all tooltip
1650
+ * @trigger ReactTooltip.rebuild()
1651
+ */
1652
+
1653
+
1654
+ target.rebuild = function () {
1655
+ dispatchGlobalEvent(CONSTANT.GLOBAL.REBUILD);
1656
+ };
1657
+ /**
1658
+ * Show specific tooltip
1659
+ * @trigger ReactTooltip.show()
1660
+ */
1661
+
1662
+
1663
+ target.show = function (target) {
1664
+ dispatchGlobalEvent(CONSTANT.GLOBAL.SHOW, {
1665
+ target: target
1666
+ });
1667
+ };
1668
+
1669
+ target.prototype.globalRebuild = function () {
1670
+ if (this.mount) {
1671
+ this.unbindListener();
1672
+ this.bindListener();
1673
+ }
1674
+ };
1675
+
1676
+ target.prototype.globalShow = function (event) {
1677
+ if (this.mount) {
1678
+ var hasTarget = event && event.detail && event.detail.target && true || false; // Create a fake event, specific show will limit the type to `solid`
1679
+ // only `float` type cares e.clientX e.clientY
1680
+
1681
+ this.showTooltip({
1682
+ currentTarget: hasTarget && event.detail.target
1683
+ }, true);
1684
+ }
1685
+ };
1686
+
1687
+ target.prototype.globalHide = function (event) {
1688
+ if (this.mount) {
1689
+ var hasTarget = event && event.detail && event.detail.target && true || false;
1690
+ this.hideTooltip({
1691
+ currentTarget: hasTarget && event.detail.target
1692
+ }, hasTarget);
1693
+ }
1694
+ };
1695
+ }
1696
+
1697
+ /**
1698
+ * Events that should be bound to the window
1699
+ */
1700
+ function windowListener (target) {
1701
+ target.prototype.bindWindowEvents = function (resizeHide) {
1702
+ // ReactTooltip.hide
1703
+ window.removeEventListener(CONSTANT.GLOBAL.HIDE, this.globalHide);
1704
+ window.addEventListener(CONSTANT.GLOBAL.HIDE, this.globalHide, false); // ReactTooltip.rebuild
1705
+
1706
+ window.removeEventListener(CONSTANT.GLOBAL.REBUILD, this.globalRebuild);
1707
+ window.addEventListener(CONSTANT.GLOBAL.REBUILD, this.globalRebuild, false); // ReactTooltip.show
1708
+
1709
+ window.removeEventListener(CONSTANT.GLOBAL.SHOW, this.globalShow);
1710
+ window.addEventListener(CONSTANT.GLOBAL.SHOW, this.globalShow, false); // Resize
1711
+
1712
+ if (resizeHide) {
1713
+ window.removeEventListener('resize', this.onWindowResize);
1714
+ window.addEventListener('resize', this.onWindowResize, false);
1715
+ }
1716
+ };
1717
+
1718
+ target.prototype.unbindWindowEvents = function () {
1719
+ window.removeEventListener(CONSTANT.GLOBAL.HIDE, this.globalHide);
1720
+ window.removeEventListener(CONSTANT.GLOBAL.REBUILD, this.globalRebuild);
1721
+ window.removeEventListener(CONSTANT.GLOBAL.SHOW, this.globalShow);
1722
+ window.removeEventListener('resize', this.onWindowResize);
1723
+ };
1724
+ /**
1725
+ * invoked by resize event of window
1726
+ */
1727
+
1728
+
1729
+ target.prototype.onWindowResize = function () {
1730
+ if (!this.mount) return;
1731
+ this.hideTooltip();
1732
+ };
1733
+ }
1734
+
1735
+ /**
1736
+ * Custom events to control showing and hiding of tooltip
1737
+ *
1738
+ * @attributes
1739
+ * - `event` {String}
1740
+ * - `eventOff` {String}
1741
+ */
1742
+ var checkStatus = function checkStatus(dataEventOff, e) {
1743
+ var show = this.state.show;
1744
+ var id = this.props.id;
1745
+ var isCapture = this.isCapture(e.currentTarget);
1746
+ var currentItem = e.currentTarget.getAttribute('currentItem');
1747
+ if (!isCapture) e.stopPropagation();
1748
+
1749
+ if (show && currentItem === 'true') {
1750
+ if (!dataEventOff) this.hideTooltip(e);
1751
+ } else {
1752
+ e.currentTarget.setAttribute('currentItem', 'true');
1753
+ setUntargetItems(e.currentTarget, this.getTargetArray(id));
1754
+ this.showTooltip(e);
1755
+ }
1756
+ };
1757
+
1758
+ var setUntargetItems = function setUntargetItems(currentTarget, targetArray) {
1759
+ for (var i = 0; i < targetArray.length; i++) {
1760
+ if (currentTarget !== targetArray[i]) {
1761
+ targetArray[i].setAttribute('currentItem', 'false');
1762
+ } else {
1763
+ targetArray[i].setAttribute('currentItem', 'true');
1764
+ }
1765
+ }
1766
+ };
1767
+
1768
+ var customListeners = {
1769
+ id: '9b69f92e-d3fe-498b-b1b4-c5e63a51b0cf',
1770
+ set: function set(target, event, listener) {
1771
+ if (this.id in target) {
1772
+ var map = target[this.id];
1773
+ map[event] = listener;
1774
+ } else {
1775
+ // this is workaround for WeakMap, which is not supported in older browsers, such as IE
1776
+ Object.defineProperty(target, this.id, {
1777
+ configurable: true,
1778
+ value: _defineProperty({}, event, listener)
1779
+ });
1780
+ }
1781
+ },
1782
+ get: function get(target, event) {
1783
+ var map = target[this.id];
1784
+
1785
+ if (map !== undefined) {
1786
+ return map[event];
1787
+ }
1788
+ }
1789
+ };
1790
+ function customEvent (target) {
1791
+ target.prototype.isCustomEvent = function (ele) {
1792
+ var event = this.state.event;
1793
+ return event || !!ele.getAttribute('data-event');
1794
+ };
1795
+ /* Bind listener for custom event */
1796
+
1797
+
1798
+ target.prototype.customBindListener = function (ele) {
1799
+ var _this = this;
1800
+
1801
+ var _this$state = this.state,
1802
+ event = _this$state.event,
1803
+ eventOff = _this$state.eventOff;
1804
+ var dataEvent = ele.getAttribute('data-event') || event;
1805
+ var dataEventOff = ele.getAttribute('data-event-off') || eventOff;
1806
+ dataEvent.split(' ').forEach(function (event) {
1807
+ ele.removeEventListener(event, customListeners.get(ele, event));
1808
+ var customListener = checkStatus.bind(_this, dataEventOff);
1809
+ customListeners.set(ele, event, customListener);
1810
+ ele.addEventListener(event, customListener, false);
1811
+ });
1812
+
1813
+ if (dataEventOff) {
1814
+ dataEventOff.split(' ').forEach(function (event) {
1815
+ ele.removeEventListener(event, _this.hideTooltip);
1816
+ ele.addEventListener(event, _this.hideTooltip, false);
1817
+ });
1818
+ }
1819
+ };
1820
+ /* Unbind listener for custom event */
1821
+
1822
+
1823
+ target.prototype.customUnbindListener = function (ele) {
1824
+ var _this$state2 = this.state,
1825
+ event = _this$state2.event,
1826
+ eventOff = _this$state2.eventOff;
1827
+ var dataEvent = event || ele.getAttribute('data-event');
1828
+ var dataEventOff = eventOff || ele.getAttribute('data-event-off');
1829
+ ele.removeEventListener(dataEvent, customListeners.get(ele, event));
1830
+ if (dataEventOff) ele.removeEventListener(dataEventOff, this.hideTooltip);
1831
+ };
1832
+ }
1833
+
1834
+ /**
1835
+ * Util method to judge if it should follow capture model
1836
+ */
1837
+ function isCapture (target) {
1838
+ target.prototype.isCapture = function (currentTarget) {
1839
+ return currentTarget && currentTarget.getAttribute('data-iscapture') === 'true' || this.props.isCapture || false;
1840
+ };
1841
+ }
1842
+
1843
+ /**
1844
+ * Util method to get effect
1845
+ */
1846
+ function getEffect (target) {
1847
+ target.prototype.getEffect = function (currentTarget) {
1848
+ var dataEffect = currentTarget.getAttribute('data-effect');
1849
+ return dataEffect || this.props.effect || 'float';
1850
+ };
1851
+ }
1852
+
1853
+ /**
1854
+ * Util method to get effect
1855
+ */
1856
+
1857
+ var makeProxy = function makeProxy(e) {
1858
+ var proxy = {};
1859
+
1860
+ for (var key in e) {
1861
+ if (typeof e[key] === 'function') {
1862
+ proxy[key] = e[key].bind(e);
1863
+ } else {
1864
+ proxy[key] = e[key];
1865
+ }
1866
+ }
1867
+
1868
+ return proxy;
1869
+ };
1870
+
1871
+ var bodyListener = function bodyListener(callback, options, e) {
1872
+ var _options$respectEffec = options.respectEffect,
1873
+ respectEffect = _options$respectEffec === void 0 ? false : _options$respectEffec,
1874
+ _options$customEvent = options.customEvent,
1875
+ customEvent = _options$customEvent === void 0 ? false : _options$customEvent;
1876
+ var id = this.props.id;
1877
+ var tip = null;
1878
+ var forId;
1879
+ var target = e.target;
1880
+ var lastTarget; // walk up parent chain until tip is found
1881
+ // there is no match if parent visible area is matched by mouse position, so some corner cases might not work as expected
1882
+
1883
+ while (tip === null && target !== null) {
1884
+ lastTarget = target;
1885
+ tip = target.getAttribute('data-tip') || null;
1886
+ forId = target.getAttribute('data-for') || null;
1887
+ target = target.parentElement;
1888
+ }
1889
+
1890
+ target = lastTarget || e.target;
1891
+
1892
+ if (this.isCustomEvent(target) && !customEvent) {
1893
+ return;
1894
+ }
1895
+
1896
+ var isTargetBelongsToTooltip = id == null && forId == null || forId === id;
1897
+
1898
+ if (tip != null && (!respectEffect || this.getEffect(target) === 'float') && isTargetBelongsToTooltip) {
1899
+ var proxy = makeProxy(e);
1900
+ proxy.currentTarget = target;
1901
+ callback(proxy);
1902
+ }
1903
+ };
1904
+
1905
+ var findCustomEvents = function findCustomEvents(targetArray, dataAttribute) {
1906
+ var events = {};
1907
+ targetArray.forEach(function (target) {
1908
+ var event = target.getAttribute(dataAttribute);
1909
+ if (event) event.split(' ').forEach(function (event) {
1910
+ return events[event] = true;
1911
+ });
1912
+ });
1913
+ return events;
1914
+ };
1915
+
1916
+ var getBody = function getBody() {
1917
+ return document.getElementsByTagName('body')[0];
1918
+ };
1919
+
1920
+ function bodyMode (target) {
1921
+ target.prototype.isBodyMode = function () {
1922
+ return !!this.props.bodyMode;
1923
+ };
1924
+
1925
+ target.prototype.bindBodyListener = function (targetArray) {
1926
+ var _this = this;
1927
+
1928
+ var _this$state = this.state,
1929
+ event = _this$state.event,
1930
+ eventOff = _this$state.eventOff,
1931
+ possibleCustomEvents = _this$state.possibleCustomEvents,
1932
+ possibleCustomEventsOff = _this$state.possibleCustomEventsOff;
1933
+ var body = getBody();
1934
+ var customEvents = findCustomEvents(targetArray, 'data-event');
1935
+ var customEventsOff = findCustomEvents(targetArray, 'data-event-off');
1936
+ if (event != null) customEvents[event] = true;
1937
+ if (eventOff != null) customEventsOff[eventOff] = true;
1938
+ possibleCustomEvents.split(' ').forEach(function (event) {
1939
+ return customEvents[event] = true;
1940
+ });
1941
+ possibleCustomEventsOff.split(' ').forEach(function (event) {
1942
+ return customEventsOff[event] = true;
1943
+ });
1944
+ this.unbindBodyListener(body);
1945
+ var listeners = this.bodyModeListeners = {};
1946
+
1947
+ if (event == null) {
1948
+ listeners.mouseover = bodyListener.bind(this, this.showTooltip, {});
1949
+ listeners.mousemove = bodyListener.bind(this, this.updateTooltip, {
1950
+ respectEffect: true
1951
+ });
1952
+ listeners.mouseout = bodyListener.bind(this, this.hideTooltip, {});
1953
+ }
1954
+
1955
+ for (var _event in customEvents) {
1956
+ listeners[_event] = bodyListener.bind(this, function (e) {
1957
+ var targetEventOff = e.currentTarget.getAttribute('data-event-off') || eventOff;
1958
+ checkStatus.call(_this, targetEventOff, e);
1959
+ }, {
1960
+ customEvent: true
1961
+ });
1962
+ }
1963
+
1964
+ for (var _event2 in customEventsOff) {
1965
+ listeners[_event2] = bodyListener.bind(this, this.hideTooltip, {
1966
+ customEvent: true
1967
+ });
1968
+ }
1969
+
1970
+ for (var _event3 in listeners) {
1971
+ body.addEventListener(_event3, listeners[_event3]);
1972
+ }
1973
+ };
1974
+
1975
+ target.prototype.unbindBodyListener = function (body) {
1976
+ body = body || getBody();
1977
+ var listeners = this.bodyModeListeners;
1978
+
1979
+ for (var event in listeners) {
1980
+ body.removeEventListener(event, listeners[event]);
1981
+ }
1982
+ };
1983
+ }
1984
+
1985
+ /**
1986
+ * Tracking target removing from DOM.
1987
+ * It's necessary to hide tooltip when it's target disappears.
1988
+ * Otherwise, the tooltip would be shown forever until another target
1989
+ * is triggered.
1990
+ *
1991
+ * If MutationObserver is not available, this feature just doesn't work.
1992
+ */
1993
+ // https://hacks.mozilla.org/2012/05/dom-mutationobserver-reacting-to-dom-changes-without-killing-browser-performance/
1994
+ var getMutationObserverClass = function getMutationObserverClass() {
1995
+ return window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver;
1996
+ };
1997
+
1998
+ function trackRemoval (target) {
1999
+ target.prototype.bindRemovalTracker = function () {
2000
+ var _this = this;
2001
+
2002
+ var MutationObserver = getMutationObserverClass();
2003
+ if (MutationObserver == null) return;
2004
+ var observer = new MutationObserver(function (mutations) {
2005
+ for (var m1 = 0; m1 < mutations.length; m1++) {
2006
+ var mutation = mutations[m1];
2007
+
2008
+ for (var m2 = 0; m2 < mutation.removedNodes.length; m2++) {
2009
+ var element = mutation.removedNodes[m2];
2010
+
2011
+ if (element === _this.state.currentTarget) {
2012
+ _this.hideTooltip();
2013
+
2014
+ return;
2015
+ }
2016
+ }
2017
+ }
2018
+ });
2019
+ observer.observe(window.document, {
2020
+ childList: true,
2021
+ subtree: true
2022
+ });
2023
+ this.removalTracker = observer;
2024
+ };
2025
+
2026
+ target.prototype.unbindRemovalTracker = function () {
2027
+ if (this.removalTracker) {
2028
+ this.removalTracker.disconnect();
2029
+ this.removalTracker = null;
2030
+ }
2031
+ };
2032
+ }
2033
+
2034
+ /**
2035
+ * Calculate the position of tooltip
2036
+ *
2037
+ * @params
2038
+ * - `e` {Event} the event of current mouse
2039
+ * - `target` {Element} the currentTarget of the event
2040
+ * - `node` {DOM} the react-tooltip object
2041
+ * - `place` {String} top / right / bottom / left
2042
+ * - `effect` {String} float / solid
2043
+ * - `offset` {Object} the offset to default position
2044
+ *
2045
+ * @return {Object}
2046
+ * - `isNewState` {Bool} required
2047
+ * - `newState` {Object}
2048
+ * - `position` {Object} {left: {Number}, top: {Number}}
2049
+ */
2050
+ function getPosition (e, target, node, place, desiredPlace, effect, offset) {
2051
+ var _getDimensions = getDimensions(node),
2052
+ tipWidth = _getDimensions.width,
2053
+ tipHeight = _getDimensions.height;
2054
+
2055
+ var _getDimensions2 = getDimensions(target),
2056
+ targetWidth = _getDimensions2.width,
2057
+ targetHeight = _getDimensions2.height;
2058
+
2059
+ var _getCurrentOffset = getCurrentOffset(e, target, effect),
2060
+ mouseX = _getCurrentOffset.mouseX,
2061
+ mouseY = _getCurrentOffset.mouseY;
2062
+
2063
+ var defaultOffset = getDefaultPosition(effect, targetWidth, targetHeight, tipWidth, tipHeight);
2064
+
2065
+ var _calculateOffset = calculateOffset(offset),
2066
+ extraOffsetX = _calculateOffset.extraOffsetX,
2067
+ extraOffsetY = _calculateOffset.extraOffsetY;
2068
+
2069
+ var windowWidth = window.innerWidth;
2070
+ var windowHeight = window.innerHeight;
2071
+
2072
+ var _getParent = getParent(node),
2073
+ parentTop = _getParent.parentTop,
2074
+ parentLeft = _getParent.parentLeft; // Get the edge offset of the tooltip
2075
+
2076
+
2077
+ var getTipOffsetLeft = function getTipOffsetLeft(place) {
2078
+ var offsetX = defaultOffset[place].l;
2079
+ return mouseX + offsetX + extraOffsetX;
2080
+ };
2081
+
2082
+ var getTipOffsetRight = function getTipOffsetRight(place) {
2083
+ var offsetX = defaultOffset[place].r;
2084
+ return mouseX + offsetX + extraOffsetX;
2085
+ };
2086
+
2087
+ var getTipOffsetTop = function getTipOffsetTop(place) {
2088
+ var offsetY = defaultOffset[place].t;
2089
+ return mouseY + offsetY + extraOffsetY;
2090
+ };
2091
+
2092
+ var getTipOffsetBottom = function getTipOffsetBottom(place) {
2093
+ var offsetY = defaultOffset[place].b;
2094
+ return mouseY + offsetY + extraOffsetY;
2095
+ }; //
2096
+ // Functions to test whether the tooltip's sides are inside
2097
+ // the client window for a given orientation p
2098
+ //
2099
+ // _____________
2100
+ // | | <-- Right side
2101
+ // | p = 'left' |\
2102
+ // | |/ |\
2103
+ // |_____________| |_\ <-- Mouse
2104
+ // / \ |
2105
+ // |
2106
+ // |
2107
+ // Bottom side
2108
+ //
2109
+
2110
+
2111
+ var outsideLeft = function outsideLeft(p) {
2112
+ return getTipOffsetLeft(p) < 0;
2113
+ };
2114
+
2115
+ var outsideRight = function outsideRight(p) {
2116
+ return getTipOffsetRight(p) > windowWidth;
2117
+ };
2118
+
2119
+ var outsideTop = function outsideTop(p) {
2120
+ return getTipOffsetTop(p) < 0;
2121
+ };
2122
+
2123
+ var outsideBottom = function outsideBottom(p) {
2124
+ return getTipOffsetBottom(p) > windowHeight;
2125
+ }; // Check whether the tooltip with orientation p is completely inside the client window
2126
+
2127
+
2128
+ var outside = function outside(p) {
2129
+ return outsideLeft(p) || outsideRight(p) || outsideTop(p) || outsideBottom(p);
2130
+ };
2131
+
2132
+ var inside = function inside(p) {
2133
+ return !outside(p);
2134
+ };
2135
+
2136
+ var placeIsInside = {
2137
+ top: inside('top'),
2138
+ bottom: inside('bottom'),
2139
+ left: inside('left'),
2140
+ right: inside('right')
2141
+ };
2142
+
2143
+ function choose() {
2144
+ var allPlaces = desiredPlace.split(',').concat(place, ['top', 'bottom', 'left', 'right']);
2145
+
2146
+ var _iterator = _createForOfIteratorHelper(allPlaces),
2147
+ _step;
2148
+
2149
+ try {
2150
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
2151
+ var d = _step.value;
2152
+ if (placeIsInside[d]) return d;
2153
+ } // if nothing is inside, just use the old place.
2154
+
2155
+ } catch (err) {
2156
+ _iterator.e(err);
2157
+ } finally {
2158
+ _iterator.f();
2159
+ }
2160
+
2161
+ return place;
2162
+ }
2163
+
2164
+ var chosen = choose();
2165
+ var isNewState = false;
2166
+ var newPlace;
2167
+
2168
+ if (chosen && chosen !== place) {
2169
+ isNewState = true;
2170
+ newPlace = chosen;
2171
+ }
2172
+
2173
+ if (isNewState) {
2174
+ return {
2175
+ isNewState: true,
2176
+ newState: {
2177
+ place: newPlace
2178
+ }
2179
+ };
2180
+ }
2181
+
2182
+ return {
2183
+ isNewState: false,
2184
+ position: {
2185
+ left: parseInt(getTipOffsetLeft(place) - parentLeft, 10),
2186
+ top: parseInt(getTipOffsetTop(place) - parentTop, 10)
2187
+ }
2188
+ };
2189
+ }
2190
+
2191
+ var getDimensions = function getDimensions(node) {
2192
+ var _node$getBoundingClie = node.getBoundingClientRect(),
2193
+ height = _node$getBoundingClie.height,
2194
+ width = _node$getBoundingClie.width;
2195
+
2196
+ return {
2197
+ height: parseInt(height, 10),
2198
+ width: parseInt(width, 10)
2199
+ };
2200
+ }; // Get current mouse offset
2201
+
2202
+
2203
+ var getCurrentOffset = function getCurrentOffset(e, currentTarget, effect) {
2204
+ var boundingClientRect = currentTarget.getBoundingClientRect();
2205
+ var targetTop = boundingClientRect.top;
2206
+ var targetLeft = boundingClientRect.left;
2207
+
2208
+ var _getDimensions3 = getDimensions(currentTarget),
2209
+ targetWidth = _getDimensions3.width,
2210
+ targetHeight = _getDimensions3.height;
2211
+
2212
+ if (effect === 'float') {
2213
+ return {
2214
+ mouseX: e.clientX,
2215
+ mouseY: e.clientY
2216
+ };
2217
+ }
2218
+
2219
+ return {
2220
+ mouseX: targetLeft + targetWidth / 2,
2221
+ mouseY: targetTop + targetHeight / 2
2222
+ };
2223
+ }; // List all possibility of tooltip final offset
2224
+ // This is useful in judging if it is necessary for tooltip to switch position when out of window
2225
+
2226
+
2227
+ var getDefaultPosition = function getDefaultPosition(effect, targetWidth, targetHeight, tipWidth, tipHeight) {
2228
+ var top;
2229
+ var right;
2230
+ var bottom;
2231
+ var left;
2232
+ var disToMouse = 3;
2233
+ var triangleHeight = 2;
2234
+ var cursorHeight = 12; // Optimize for float bottom only, cause the cursor will hide the tooltip
2235
+
2236
+ if (effect === 'float') {
2237
+ top = {
2238
+ l: -(tipWidth / 2),
2239
+ r: tipWidth / 2,
2240
+ t: -(tipHeight + disToMouse + triangleHeight),
2241
+ b: -disToMouse
2242
+ };
2243
+ bottom = {
2244
+ l: -(tipWidth / 2),
2245
+ r: tipWidth / 2,
2246
+ t: disToMouse + cursorHeight,
2247
+ b: tipHeight + disToMouse + triangleHeight + cursorHeight
2248
+ };
2249
+ left = {
2250
+ l: -(tipWidth + disToMouse + triangleHeight),
2251
+ r: -disToMouse,
2252
+ t: -(tipHeight / 2),
2253
+ b: tipHeight / 2
2254
+ };
2255
+ right = {
2256
+ l: disToMouse,
2257
+ r: tipWidth + disToMouse + triangleHeight,
2258
+ t: -(tipHeight / 2),
2259
+ b: tipHeight / 2
2260
+ };
2261
+ } else if (effect === 'solid') {
2262
+ top = {
2263
+ l: -(tipWidth / 2),
2264
+ r: tipWidth / 2,
2265
+ t: -(targetHeight / 2 + tipHeight + triangleHeight),
2266
+ b: -(targetHeight / 2)
2267
+ };
2268
+ bottom = {
2269
+ l: -(tipWidth / 2),
2270
+ r: tipWidth / 2,
2271
+ t: targetHeight / 2,
2272
+ b: targetHeight / 2 + tipHeight + triangleHeight
2273
+ };
2274
+ left = {
2275
+ l: -(tipWidth + targetWidth / 2 + triangleHeight),
2276
+ r: -(targetWidth / 2),
2277
+ t: -(tipHeight / 2),
2278
+ b: tipHeight / 2
2279
+ };
2280
+ right = {
2281
+ l: targetWidth / 2,
2282
+ r: tipWidth + targetWidth / 2 + triangleHeight,
2283
+ t: -(tipHeight / 2),
2284
+ b: tipHeight / 2
2285
+ };
2286
+ }
2287
+
2288
+ return {
2289
+ top: top,
2290
+ bottom: bottom,
2291
+ left: left,
2292
+ right: right
2293
+ };
2294
+ }; // Consider additional offset into position calculation
2295
+
2296
+
2297
+ var calculateOffset = function calculateOffset(offset) {
2298
+ var extraOffsetX = 0;
2299
+ var extraOffsetY = 0;
2300
+
2301
+ if (Object.prototype.toString.apply(offset) === '[object String]') {
2302
+ offset = JSON.parse(offset.toString().replace(/'/g, '"'));
2303
+ }
2304
+
2305
+ for (var key in offset) {
2306
+ if (key === 'top') {
2307
+ extraOffsetY -= parseInt(offset[key], 10);
2308
+ } else if (key === 'bottom') {
2309
+ extraOffsetY += parseInt(offset[key], 10);
2310
+ } else if (key === 'left') {
2311
+ extraOffsetX -= parseInt(offset[key], 10);
2312
+ } else if (key === 'right') {
2313
+ extraOffsetX += parseInt(offset[key], 10);
2314
+ }
2315
+ }
2316
+
2317
+ return {
2318
+ extraOffsetX: extraOffsetX,
2319
+ extraOffsetY: extraOffsetY
2320
+ };
2321
+ }; // Get the offset of the parent elements
2322
+
2323
+
2324
+ var getParent = function getParent(currentTarget) {
2325
+ var currentParent = currentTarget;
2326
+
2327
+ while (currentParent) {
2328
+ var computedStyle = window.getComputedStyle(currentParent); // transform and will-change: transform change the containing block
2329
+ // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_Block
2330
+
2331
+ if (computedStyle.getPropertyValue('transform') !== 'none' || computedStyle.getPropertyValue('will-change') === 'transform') break;
2332
+ currentParent = currentParent.parentElement;
2333
+ }
2334
+
2335
+ var parentTop = currentParent && currentParent.getBoundingClientRect().top || 0;
2336
+ var parentLeft = currentParent && currentParent.getBoundingClientRect().left || 0;
2337
+ return {
2338
+ parentTop: parentTop,
2339
+ parentLeft: parentLeft
2340
+ };
2341
+ };
2342
+
2343
+ /**
2344
+ * To get the tooltip content
2345
+ * it may comes from data-tip or this.props.children
2346
+ * it should support multiline
2347
+ *
2348
+ * @params
2349
+ * - `tip` {String} value of data-tip
2350
+ * - `children` {ReactElement} this.props.children
2351
+ * - `multiline` {Any} could be Bool(true/false) or String('true'/'false')
2352
+ *
2353
+ * @return
2354
+ * - String or react component
2355
+ */
2356
+ function TipContent(tip, children, getContent, multiline) {
2357
+ if (children) return children;
2358
+ if (getContent !== undefined && getContent !== null) return getContent; // getContent can be 0, '', etc.
2359
+
2360
+ if (getContent === null) return null; // Tip not exist and children is null or undefined
2361
+
2362
+ var regexp = /<br\s*\/?>/;
2363
+
2364
+ if (!multiline || multiline === 'false' || !regexp.test(tip)) {
2365
+ // No trim(), so that user can keep their input
2366
+ return tip;
2367
+ } // Multiline tooltip content
2368
+
2369
+
2370
+ return tip.split(regexp).map(function (d, i) {
2371
+ return /*#__PURE__*/React.createElement("span", {
2372
+ key: i,
2373
+ className: "multi-line"
2374
+ }, d);
2375
+ });
2376
+ }
2377
+
2378
+ /**
2379
+ * Support aria- and role in ReactTooltip
2380
+ *
2381
+ * @params props {Object}
2382
+ * @return {Object}
2383
+ */
2384
+ function parseAria(props) {
2385
+ var ariaObj = {};
2386
+ Object.keys(props).filter(function (prop) {
2387
+ // aria-xxx and role is acceptable
2388
+ return /(^aria-\w+$|^role$)/.test(prop);
2389
+ }).forEach(function (prop) {
2390
+ ariaObj[prop] = props[prop];
2391
+ });
2392
+ return ariaObj;
2393
+ }
2394
+
2395
+ /**
2396
+ * Convert nodelist to array
2397
+ * @see https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/core/createArrayFromMixed.js#L24
2398
+ * NodeLists are functions in Safari
2399
+ */
2400
+ function nodeListToArray (nodeList) {
2401
+ var length = nodeList.length;
2402
+
2403
+ if (nodeList.hasOwnProperty) {
2404
+ return Array.prototype.slice.call(nodeList);
2405
+ }
1780
2406
 
1781
- // Create object with fake `null` prototype: use iframe Object with cleared prototype
1782
- var NullProtoObjectViaIFrame = function () {
1783
- // Thrash, waste and sodomy: IE GC bug
1784
- var iframe = documentCreateElement('iframe');
1785
- var JS = 'java' + SCRIPT + ':';
1786
- var iframeDocument;
1787
- iframe.style.display = 'none';
1788
- html.appendChild(iframe);
1789
- // https://github.com/zloirock/core-js/issues/475
1790
- iframe.src = String(JS);
1791
- iframeDocument = iframe.contentWindow.document;
1792
- iframeDocument.open();
1793
- iframeDocument.write(scriptTag('document.F=Object'));
1794
- iframeDocument.close();
1795
- return iframeDocument.F;
1796
- };
2407
+ return new Array(length).fill().map(function (index) {
2408
+ return nodeList[index];
2409
+ });
2410
+ }
1797
2411
 
1798
- // Check for document.domain and active x support
1799
- // No need to use active x approach when document.domain is not set
1800
- // see https://github.com/es-shims/es5-shim/issues/150
1801
- // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
1802
- // avoid IE GC bug
1803
- var activeXDocument;
1804
- var NullProtoObject = function () {
1805
- try {
1806
- /* global ActiveXObject -- old IE */
1807
- activeXDocument = document.domain && new ActiveXObject('htmlfile');
1808
- } catch (error) { /* ignore */ }
1809
- NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame();
1810
- var length = enumBugKeys.length;
1811
- while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
1812
- return NullProtoObject();
1813
- };
2412
+ function generateUUID() {
2413
+ return 't' + v4();
2414
+ }
1814
2415
 
1815
- hiddenKeys[IE_PROTO] = true;
2416
+ var baseCss = ".__react_component_tooltip {\n border-radius: 3px;\n display: inline-block;\n font-size: 13px;\n left: -999em;\n opacity: 0;\n position: fixed;\n pointer-events: none;\n transition: opacity 0.3s ease-out;\n top: -999em;\n visibility: hidden;\n z-index: 999;\n}\n.__react_component_tooltip.allow_hover, .__react_component_tooltip.allow_click {\n pointer-events: auto;\n}\n.__react_component_tooltip::before, .__react_component_tooltip::after {\n content: \"\";\n width: 0;\n height: 0;\n position: absolute;\n}\n.__react_component_tooltip.show {\n opacity: 0.9;\n margin-top: 0;\n margin-left: 0;\n visibility: visible;\n}\n.__react_component_tooltip.place-top::before {\n border-left: 10px solid transparent;\n border-right: 10px solid transparent;\n bottom: -8px;\n left: 50%;\n margin-left: -10px;\n}\n.__react_component_tooltip.place-bottom::before {\n border-left: 10px solid transparent;\n border-right: 10px solid transparent;\n top: -8px;\n left: 50%;\n margin-left: -10px;\n}\n.__react_component_tooltip.place-left::before {\n border-top: 6px solid transparent;\n border-bottom: 6px solid transparent;\n right: -8px;\n top: 50%;\n margin-top: -5px;\n}\n.__react_component_tooltip.place-right::before {\n border-top: 6px solid transparent;\n border-bottom: 6px solid transparent;\n left: -8px;\n top: 50%;\n margin-top: -5px;\n}\n.__react_component_tooltip .multi-line {\n display: block;\n padding: 2px 0;\n text-align: center;\n}";
1816
2417
 
1817
- // `Object.create` method
1818
- // https://tc39.es/ecma262/#sec-object.create
1819
- var objectCreate = Object.create || function create(O, Properties) {
1820
- var result;
1821
- if (O !== null) {
1822
- EmptyConstructor[PROTOTYPE] = anObject(O);
1823
- result = new EmptyConstructor();
1824
- EmptyConstructor[PROTOTYPE] = null;
1825
- // add "__proto__" for Object.getPrototypeOf polyfill
1826
- result[IE_PROTO] = O;
1827
- } else result = NullProtoObject();
1828
- return Properties === undefined ? result : objectDefineProperties(result, Properties);
2418
+ /**
2419
+ * Default pop-up style values (text color, background color).
2420
+ */
2421
+ var defaultColors = {
2422
+ dark: {
2423
+ text: '#fff',
2424
+ background: '#222',
2425
+ border: 'transparent',
2426
+ arrow: '#222'
2427
+ },
2428
+ success: {
2429
+ text: '#fff',
2430
+ background: '#8DC572',
2431
+ border: 'transparent',
2432
+ arrow: '#8DC572'
2433
+ },
2434
+ warning: {
2435
+ text: '#fff',
2436
+ background: '#F0AD4E',
2437
+ border: 'transparent',
2438
+ arrow: '#F0AD4E'
2439
+ },
2440
+ error: {
2441
+ text: '#fff',
2442
+ background: '#BE6464',
2443
+ border: 'transparent',
2444
+ arrow: '#BE6464'
2445
+ },
2446
+ info: {
2447
+ text: '#fff',
2448
+ background: '#337AB7',
2449
+ border: 'transparent',
2450
+ arrow: '#337AB7'
2451
+ },
2452
+ light: {
2453
+ text: '#222',
2454
+ background: '#fff',
2455
+ border: 'transparent',
2456
+ arrow: '#fff'
2457
+ }
1829
2458
  };
2459
+ function getDefaultPopupColors(type) {
2460
+ return defaultColors[type] ? _objectSpread2({}, defaultColors[type]) : undefined;
2461
+ }
2462
+ var DEFAULT_PADDING = '8px 21px';
1830
2463
 
1831
- var UNSCOPABLES = wellKnownSymbol('unscopables');
1832
- var ArrayPrototype = Array.prototype;
2464
+ /**
2465
+ * Generates the specific tooltip style for use on render.
2466
+ */
1833
2467
 
1834
- // Array.prototype[@@unscopables]
1835
- // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
1836
- if (ArrayPrototype[UNSCOPABLES] == undefined) {
1837
- objectDefineProperty.f(ArrayPrototype, UNSCOPABLES, {
1838
- configurable: true,
1839
- value: objectCreate(null)
1840
- });
2468
+ function generateTooltipStyle(uuid, customColors, type, hasBorder, padding) {
2469
+ return generateStyle(uuid, getPopupColors(customColors, type, hasBorder), padding);
1841
2470
  }
2471
+ /**
2472
+ * Generates the tooltip style rules based on the element-specified "data-type" property.
2473
+ */
1842
2474
 
1843
- // add a key to Array.prototype[@@unscopables]
1844
- var addToUnscopables = function (key) {
1845
- ArrayPrototype[UNSCOPABLES][key] = true;
1846
- };
2475
+ function generateStyle(uuid, colors) {
2476
+ var padding = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : DEFAULT_PADDING;
2477
+ var textColor = colors.text;
2478
+ var backgroundColor = colors.background;
2479
+ var borderColor = colors.border;
2480
+ var arrowColor = colors.arrow;
2481
+ return "\n \t.".concat(uuid, " {\n\t color: ").concat(textColor, ";\n\t background: ").concat(backgroundColor, ";\n\t border: 1px solid ").concat(borderColor, ";\n\t padding: ").concat(padding, ";\n \t}\n\n \t.").concat(uuid, ".place-top {\n margin-top: -10px;\n }\n .").concat(uuid, ".place-top::before {\n border-top: 8px solid ").concat(borderColor, ";\n }\n .").concat(uuid, ".place-top::after {\n border-left: 8px solid transparent;\n border-right: 8px solid transparent;\n bottom: -6px;\n left: 50%;\n margin-left: -8px;\n border-top-color: ").concat(arrowColor, ";\n border-top-style: solid;\n border-top-width: 6px;\n }\n\n .").concat(uuid, ".place-bottom {\n margin-top: 10px;\n }\n .").concat(uuid, ".place-bottom::before {\n border-bottom: 8px solid ").concat(borderColor, ";\n }\n .").concat(uuid, ".place-bottom::after {\n border-left: 8px solid transparent;\n border-right: 8px solid transparent;\n top: -6px;\n left: 50%;\n margin-left: -8px;\n border-bottom-color: ").concat(arrowColor, ";\n border-bottom-style: solid;\n border-bottom-width: 6px;\n }\n\n .").concat(uuid, ".place-left {\n margin-left: -10px;\n }\n .").concat(uuid, ".place-left::before {\n border-left: 8px solid ").concat(borderColor, ";\n }\n .").concat(uuid, ".place-left::after {\n border-top: 5px solid transparent;\n border-bottom: 5px solid transparent;\n right: -6px;\n top: 50%;\n margin-top: -4px;\n border-left-color: ").concat(arrowColor, ";\n border-left-style: solid;\n border-left-width: 6px;\n }\n\n .").concat(uuid, ".place-right {\n margin-left: 10px;\n }\n .").concat(uuid, ".place-right::before {\n border-right: 8px solid ").concat(borderColor, ";\n }\n .").concat(uuid, ".place-right::after {\n border-top: 5px solid transparent;\n border-bottom: 5px solid transparent;\n left: -6px;\n top: 50%;\n margin-top: -4px;\n border-right-color: ").concat(arrowColor, ";\n border-right-style: solid;\n border-right-width: 6px;\n }\n ");
2482
+ }
1847
2483
 
1848
- var $find = arrayIteration.find;
2484
+ function getPopupColors(customColors, type, hasBorder) {
2485
+ var textColor = customColors.text;
2486
+ var backgroundColor = customColors.background;
2487
+ var borderColor = customColors.border;
2488
+ var arrowColor = customColors.arrow ? customColors.arrow : customColors.background;
2489
+ var colors = getDefaultPopupColors(type);
1849
2490
 
2491
+ if (textColor) {
2492
+ colors.text = textColor;
2493
+ }
1850
2494
 
1851
- var FIND = 'find';
1852
- var SKIPS_HOLES = true;
2495
+ if (backgroundColor) {
2496
+ colors.background = backgroundColor;
2497
+ }
1853
2498
 
1854
- // Shouldn't skip holes
1855
- if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
2499
+ if (hasBorder) {
2500
+ if (borderColor) {
2501
+ colors.border = borderColor;
2502
+ } else {
2503
+ colors.border = type === 'light' ? 'black' : 'white';
2504
+ }
2505
+ }
1856
2506
 
1857
- // `Array.prototype.find` method
1858
- // https://tc39.es/ecma262/#sec-array.prototype.find
1859
- _export({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
1860
- find: function find(callbackfn /* , that = undefined */) {
1861
- return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
2507
+ if (arrowColor) {
2508
+ colors.arrow = arrowColor;
1862
2509
  }
1863
- });
1864
2510
 
1865
- // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
1866
- addToUnscopables(FIND);
2511
+ return colors;
2512
+ }
1867
2513
 
1868
- var _class, _class2, _temp;
2514
+ var _class, _class2;
2515
+ /* Polyfill */
1869
2516
 
1870
- var ReactTooltip = staticMethods(_class = windowListener(_class = customEvent(_class = isCapture(_class = getEffect(_class = bodyMode(_class = trackRemoval(_class = (_temp = _class2 =
1871
- /*#__PURE__*/
1872
- function (_React$Component) {
2517
+ var ReactTooltip = staticMethods(_class = windowListener(_class = customEvent(_class = isCapture(_class = getEffect(_class = bodyMode(_class = trackRemoval(_class = (_class2 = /*#__PURE__*/function (_React$Component) {
1873
2518
  _inherits(ReactTooltip, _React$Component);
1874
2519
 
1875
- _createClass(ReactTooltip, null, [{
1876
- key: "propTypes",
1877
- get: function get() {
1878
- return {
1879
- uuid: PropTypes.string,
1880
- children: PropTypes.any,
1881
- place: PropTypes.string,
1882
- type: PropTypes.string,
1883
- effect: PropTypes.string,
1884
- offset: PropTypes.object,
1885
- multiline: PropTypes.bool,
1886
- border: PropTypes.bool,
1887
- textColor: PropTypes.string,
1888
- backgroundColor: PropTypes.string,
1889
- borderColor: PropTypes.string,
1890
- arrowColor: PropTypes.string,
1891
- insecure: PropTypes.bool,
1892
- "class": PropTypes.string,
1893
- className: PropTypes.string,
1894
- id: PropTypes.string,
1895
- html: PropTypes.bool,
1896
- delayHide: PropTypes.number,
1897
- delayUpdate: PropTypes.number,
1898
- delayShow: PropTypes.number,
1899
- event: PropTypes.string,
1900
- eventOff: PropTypes.string,
1901
- isCapture: PropTypes.bool,
1902
- globalEventOff: PropTypes.string,
1903
- getContent: PropTypes.any,
1904
- afterShow: PropTypes.func,
1905
- afterHide: PropTypes.func,
1906
- overridePosition: PropTypes.func,
1907
- disable: PropTypes.bool,
1908
- scrollHide: PropTypes.bool,
1909
- resizeHide: PropTypes.bool,
1910
- wrapper: PropTypes.string,
1911
- bodyMode: PropTypes.bool,
1912
- possibleCustomEvents: PropTypes.string,
1913
- possibleCustomEventsOff: PropTypes.string,
1914
- clickable: PropTypes.bool
1915
- };
1916
- }
1917
- }]);
2520
+ var _super = _createSuper(ReactTooltip);
1918
2521
 
1919
2522
  function ReactTooltip(props) {
1920
2523
  var _this;
1921
2524
 
1922
2525
  _classCallCheck(this, ReactTooltip);
1923
2526
 
1924
- _this = _possibleConstructorReturn(this, _getPrototypeOf(ReactTooltip).call(this, props));
2527
+ _this = _super.call(this, props);
1925
2528
  _this.state = {
1926
2529
  uuid: props.uuid || generateUUID(),
1927
2530
  place: props.place || 'top',
1928
2531
  // Direction of tooltip
1929
2532
  desiredPlace: props.place || 'top',
1930
- type: 'dark',
2533
+ type: props.type || 'dark',
1931
2534
  // Color theme of tooltip
1932
- effect: 'float',
2535
+ effect: props.effect || 'float',
1933
2536
  // float or fixed
1934
2537
  show: false,
1935
2538
  border: false,
1936
2539
  customColors: {},
1937
2540
  offset: {},
2541
+ padding: props.padding,
1938
2542
  extraClass: '',
1939
2543
  html: false,
1940
2544
  delayHide: 0,
@@ -1981,9 +2585,10 @@ function (_React$Component) {
1981
2585
  }, {
1982
2586
  key: "componentDidMount",
1983
2587
  value: function componentDidMount() {
1984
- var _this$props = this.props,
1985
- insecure = _this$props.insecure,
1986
- resizeHide = _this$props.resizeHide;
2588
+ var _this$props = this.props;
2589
+ _this$props.insecure;
2590
+ var resizeHide = _this$props.resizeHide;
2591
+ this.mount = true;
1987
2592
  this.bindListener(); // Bind listener for tooltip
1988
2593
 
1989
2594
  this.bindWindowEvents(resizeHide); // Bind global event for static method
@@ -2211,7 +2816,7 @@ function (_React$Component) {
2211
2816
  }
2212
2817
  }
2213
2818
 
2214
- return getTipContent(this.state.originTooltip, children, content, this.state.isMultiline);
2819
+ return TipContent(this.state.originTooltip, children, content, this.state.isMultiline);
2215
2820
  }
2216
2821
  }, {
2217
2822
  key: "isEmptyTip",
@@ -2258,20 +2863,20 @@ function (_React$Component) {
2258
2863
 
2259
2864
 
2260
2865
  if (e && e.currentTarget && e.currentTarget.setAttribute) {
2261
- e.currentTarget.setAttribute('aria-describedby', this.state.uuid);
2866
+ e.currentTarget.setAttribute('aria-describedby', this.props.id || this.state.uuid);
2262
2867
  } // Make sure the correct place is set
2263
2868
 
2264
2869
 
2265
2870
  var desiredPlace = e.currentTarget.getAttribute('data-place') || this.props.place || 'top';
2266
2871
  var effect = switchToSolid && 'solid' || this.getEffect(e.currentTarget);
2267
2872
  var offset = e.currentTarget.getAttribute('data-offset') || this.props.offset || {};
2268
- var result = getPosition(e, e.currentTarget, this.tooltipRef, desiredPlace, desiredPlace, effect, offset);
2873
+ var result = getPosition(e, e.currentTarget, this.tooltipRef, desiredPlace.split(',')[0], desiredPlace, effect, offset);
2269
2874
 
2270
2875
  if (result.position && this.props.overridePosition) {
2271
2876
  result.position = this.props.overridePosition(result.position, e, e.currentTarget, this.tooltipRef, desiredPlace, desiredPlace, effect, offset);
2272
2877
  }
2273
2878
 
2274
- var place = result.isNewState ? result.newState.place : desiredPlace; // To prevent previously created timers from triggering
2879
+ var place = result.isNewState ? result.newState.place : desiredPlace.split(',')[0]; // To prevent previously created timers from triggering
2275
2880
 
2276
2881
  this.clearTimer();
2277
2882
  var target = e.currentTarget;
@@ -2293,6 +2898,7 @@ function (_React$Component) {
2293
2898
  },
2294
2899
  effect: effect,
2295
2900
  offset: offset,
2901
+ padding: target.getAttribute('data-padding') || self.props.padding,
2296
2902
  html: (target.getAttribute('data-html') ? target.getAttribute('data-html') === 'true' : self.props.html) || false,
2297
2903
  delayShow: target.getAttribute('data-delay-show') || self.props.delayShow || 0,
2298
2904
  delayHide: target.getAttribute('data-delay-hide') || self.props.delayHide || 0,
@@ -2312,7 +2918,7 @@ function (_React$Component) {
2312
2918
  self.intervalUpdateContent = setInterval(function () {
2313
2919
  if (self.mount) {
2314
2920
  var _getContent = self.props.getContent;
2315
- var placeholder = getTipContent(originTooltip, '', _getContent[0](), isMultiline);
2921
+ var placeholder = TipContent(originTooltip, '', _getContent[0](), isMultiline);
2316
2922
  var isEmptyTip = self.isEmptyTip(placeholder);
2317
2923
  self.setState({
2318
2924
  isEmptyTip: isEmptyTip
@@ -2343,7 +2949,9 @@ function (_React$Component) {
2343
2949
  var _this$state = this.state,
2344
2950
  delayShow = _this$state.delayShow,
2345
2951
  disable = _this$state.disable;
2346
- var afterShow = this.props.afterShow;
2952
+ var _this$props6 = this.props,
2953
+ afterShow = _this$props6.afterShow,
2954
+ disableProp = _this$props6.disable;
2347
2955
  var placeholder = this.getTooltipContent();
2348
2956
  var eventTarget = e.currentTarget || e.target; // Check if the mouse is actually over the tooltip, if so don't hide the tooltip
2349
2957
 
@@ -2352,7 +2960,7 @@ function (_React$Component) {
2352
2960
  } // if the tooltip is empty, disable the tooltip
2353
2961
 
2354
2962
 
2355
- if (this.isEmptyTip(placeholder) || disable) {
2963
+ if (this.isEmptyTip(placeholder) || disable || disableProp) {
2356
2964
  return;
2357
2965
  }
2358
2966
 
@@ -2367,20 +2975,23 @@ function (_React$Component) {
2367
2975
  currentTarget: eventTarget,
2368
2976
  show: true
2369
2977
  }, function () {
2370
- _this5.updatePosition();
2371
-
2372
- if (isInvisible && afterShow) {
2373
- afterShow(e);
2374
- }
2978
+ _this5.updatePosition(function () {
2979
+ if (isInvisible && afterShow) {
2980
+ afterShow(e);
2981
+ }
2982
+ });
2375
2983
  });
2376
2984
  }
2377
2985
  };
2378
2986
 
2379
- clearTimeout(this.delayShowLoop);
2987
+ if (this.delayShowLoop) {
2988
+ clearTimeout(this.delayShowLoop);
2989
+ }
2380
2990
 
2381
2991
  if (delayTime) {
2382
2992
  this.delayShowLoop = setTimeout(updateState, delayTime);
2383
2993
  } else {
2994
+ this.delayShowLoop = null;
2384
2995
  updateState();
2385
2996
  }
2386
2997
  }
@@ -2421,10 +3032,12 @@ function (_React$Component) {
2421
3032
  var disable = this.state.disable;
2422
3033
  var isScroll = options.isScroll;
2423
3034
  var delayHide = isScroll ? 0 : this.state.delayHide;
2424
- var afterHide = this.props.afterHide;
3035
+ var _this$props7 = this.props,
3036
+ afterHide = _this$props7.afterHide,
3037
+ disableProp = _this$props7.disable;
2425
3038
  var placeholder = this.getTooltipContent();
2426
3039
  if (!this.mount) return;
2427
- if (this.isEmptyTip(placeholder) || disable) return; // if the tooltip is empty, disable the tooltip
3040
+ if (this.isEmptyTip(placeholder) || disable || disableProp) return; // if the tooltip is empty, disable the tooltip
2428
3041
 
2429
3042
  if (hasTarget) {
2430
3043
  // Don't trigger other elements belongs to other ReactTooltip
@@ -2501,7 +3114,7 @@ function (_React$Component) {
2501
3114
 
2502
3115
  }, {
2503
3116
  key: "updatePosition",
2504
- value: function updatePosition() {
3117
+ value: function updatePosition(callbackAfter) {
2505
3118
  var _this7 = this;
2506
3119
 
2507
3120
  var _this$state2 = this.state,
@@ -2521,10 +3134,11 @@ function (_React$Component) {
2521
3134
  if (result.isNewState) {
2522
3135
  // Switch to reverse placement
2523
3136
  return this.setState(result.newState, function () {
2524
- _this7.updatePosition();
3137
+ _this7.updatePosition(callbackAfter);
2525
3138
  });
2526
- } // Set tooltip position
3139
+ }
2527
3140
 
3141
+ callbackAfter(); // Set tooltip position
2528
3142
 
2529
3143
  node.style.left = result.position.left + 'px';
2530
3144
  node.style.top = result.position.top + 'px';
@@ -2536,10 +3150,25 @@ function (_React$Component) {
2536
3150
  }, {
2537
3151
  key: "clearTimer",
2538
3152
  value: function clearTimer() {
2539
- clearTimeout(this.delayShowLoop);
2540
- clearTimeout(this.delayHideLoop);
2541
- clearTimeout(this.delayReshow);
2542
- clearInterval(this.intervalUpdateContent);
3153
+ if (this.delayShowLoop) {
3154
+ clearTimeout(this.delayShowLoop);
3155
+ this.delayShowLoop = null;
3156
+ }
3157
+
3158
+ if (this.delayHideLoop) {
3159
+ clearTimeout(this.delayHideLoop);
3160
+ this.delayHideLoop = null;
3161
+ }
3162
+
3163
+ if (this.delayReshow) {
3164
+ clearTimeout(this.delayReshow);
3165
+ this.delayReshow = null;
3166
+ }
3167
+
3168
+ if (this.intervalUpdateContent) {
3169
+ clearInterval(this.intervalUpdateContent);
3170
+ this.intervalUpdateContent = null;
3171
+ }
2543
3172
  }
2544
3173
  }, {
2545
3174
  key: "hasCustomColors",
@@ -2563,7 +3192,7 @@ function (_React$Component) {
2563
3192
  uuid = _this$state3.uuid;
2564
3193
  var content = this.getTooltipContent();
2565
3194
  var isEmptyTip = this.isEmptyTip(content);
2566
- var style = generateTooltipStyle(this.state.uuid, this.state.customColors, this.state.type, this.state.border);
3195
+ var style = generateTooltipStyle(this.state.uuid, this.state.customColors, this.state.type, this.state.border, this.state.padding);
2567
3196
  var tooltipClass = '__react_component_tooltip' + " ".concat(this.state.uuid) + (this.state.show && !disable && !isEmptyTip ? ' show' : '') + (this.state.border ? ' border' : '') + " place-".concat(this.state.place) + // top, bottom, left, right
2568
3197
  " type-".concat(this.hasCustomColors() ? 'custom' : this.state.type) + ( // dark, success, warning, error, info, light, custom
2569
3198
  this.props.delayUpdate ? ' allow_hover' : '') + (this.props.clickable ? ' allow_click' : '');
@@ -2577,7 +3206,7 @@ function (_React$Component) {
2577
3206
 
2578
3207
  if (html) {
2579
3208
  var htmlContent = "".concat(content, "\n<style aria-hidden=\"true\">").concat(style, "</style>");
2580
- return React.createElement(Wrapper, _extends({
3209
+ return /*#__PURE__*/React.createElement(Wrapper, _extends({
2581
3210
  className: "".concat(wrapperClassName),
2582
3211
  id: this.props.id || uuid,
2583
3212
  ref: function ref(_ref) {
@@ -2590,7 +3219,7 @@ function (_React$Component) {
2590
3219
  }
2591
3220
  }));
2592
3221
  } else {
2593
- return React.createElement(Wrapper, _extends({
3222
+ return /*#__PURE__*/React.createElement(Wrapper, _extends({
2594
3223
  className: "".concat(wrapperClassName),
2595
3224
  id: this.props.id || uuid
2596
3225
  }, ariaProps, {
@@ -2598,7 +3227,7 @@ function (_React$Component) {
2598
3227
  return _this9.tooltipRef = _ref2;
2599
3228
  },
2600
3229
  "data-id": "tooltip"
2601
- }), React.createElement("style", {
3230
+ }), /*#__PURE__*/React.createElement("style", {
2602
3231
  dangerouslySetInnerHTML: {
2603
3232
  __html: style
2604
3233
  },
@@ -2607,6 +3236,49 @@ function (_React$Component) {
2607
3236
  }
2608
3237
  }
2609
3238
  }], [{
3239
+ key: "propTypes",
3240
+ get: function get() {
3241
+ return {
3242
+ uuid: PropTypes.string,
3243
+ children: PropTypes.any,
3244
+ place: PropTypes.string,
3245
+ type: PropTypes.string,
3246
+ effect: PropTypes.string,
3247
+ offset: PropTypes.object,
3248
+ padding: PropTypes.string,
3249
+ multiline: PropTypes.bool,
3250
+ border: PropTypes.bool,
3251
+ textColor: PropTypes.string,
3252
+ backgroundColor: PropTypes.string,
3253
+ borderColor: PropTypes.string,
3254
+ arrowColor: PropTypes.string,
3255
+ insecure: PropTypes.bool,
3256
+ "class": PropTypes.string,
3257
+ className: PropTypes.string,
3258
+ id: PropTypes.string,
3259
+ html: PropTypes.bool,
3260
+ delayHide: PropTypes.number,
3261
+ delayUpdate: PropTypes.number,
3262
+ delayShow: PropTypes.number,
3263
+ event: PropTypes.string,
3264
+ eventOff: PropTypes.string,
3265
+ isCapture: PropTypes.bool,
3266
+ globalEventOff: PropTypes.string,
3267
+ getContent: PropTypes.any,
3268
+ afterShow: PropTypes.func,
3269
+ afterHide: PropTypes.func,
3270
+ overridePosition: PropTypes.func,
3271
+ disable: PropTypes.bool,
3272
+ scrollHide: PropTypes.bool,
3273
+ resizeHide: PropTypes.bool,
3274
+ wrapper: PropTypes.string,
3275
+ bodyMode: PropTypes.bool,
3276
+ possibleCustomEvents: PropTypes.string,
3277
+ possibleCustomEventsOff: PropTypes.string,
3278
+ clickable: PropTypes.bool
3279
+ };
3280
+ }
3281
+ }, {
2610
3282
  key: "getDerivedStateFromProps",
2611
3283
  value: function getDerivedStateFromProps(nextProps, prevState) {
2612
3284
  var ariaProps = prevState.ariaProps;
@@ -2619,7 +3291,7 @@ function (_React$Component) {
2619
3291
  return null;
2620
3292
  }
2621
3293
 
2622
- return _objectSpread2({}, prevState, {
3294
+ return _objectSpread2(_objectSpread2({}, prevState), {}, {
2623
3295
  ariaProps: newAriaProps
2624
3296
  });
2625
3297
  }
@@ -2631,7 +3303,7 @@ function (_React$Component) {
2631
3303
  resizeHide: true,
2632
3304
  wrapper: 'div',
2633
3305
  clickable: false
2634
- }), _defineProperty(_class2, "supportedWrappers", ['div', 'span']), _defineProperty(_class2, "displayName", 'ReactTooltip'), _temp)) || _class) || _class) || _class) || _class) || _class) || _class) || _class;
3306
+ }), _defineProperty(_class2, "supportedWrappers", ['div', 'span']), _defineProperty(_class2, "displayName", 'ReactTooltip'), _class2)) || _class) || _class) || _class) || _class) || _class) || _class) || _class;
2635
3307
 
2636
- export default ReactTooltip;
3308
+ export { ReactTooltip as default };
2637
3309
  //# sourceMappingURL=index.es.js.map