watermark-js-plus 1.6.3 → 1.6.4

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.
Files changed (45) hide show
  1. package/dist/es/src/core/watermark.js +8 -15
  2. package/dist/ie/es/node_modules/core-js/internals/array-from.js +11 -3
  3. package/dist/ie/es/node_modules/core-js/internals/array-set-length.js +39 -0
  4. package/dist/ie/es/node_modules/core-js/internals/check-correctness-of-iteration.js +2 -0
  5. package/dist/ie/es/node_modules/core-js/internals/environment-is-ios.js +1 -2
  6. package/dist/ie/es/node_modules/core-js/internals/function-bind-native.js +1 -1
  7. package/dist/ie/es/node_modules/core-js/internals/function-name.js +1 -1
  8. package/dist/ie/es/node_modules/core-js/internals/is-array.js +20 -0
  9. package/dist/ie/es/node_modules/core-js/internals/iterate.js +8 -3
  10. package/dist/ie/es/node_modules/core-js/internals/shared-store.js +3 -3
  11. package/dist/ie/es/node_modules/core-js/internals/to-string-tag-support.js +1 -1
  12. package/dist/ie/es/node_modules/core-js/modules/es.array.fill.js +1 -1
  13. package/dist/ie/es/node_modules/core-js/modules/es.array.from.js +1 -1
  14. package/dist/ie/es/node_modules/core-js/modules/es.array.includes.js +8 -2
  15. package/dist/ie/es/node_modules/core-js/modules/es.promise.js +1 -1
  16. package/dist/ie/es/src/core/watermark.js +8 -15
  17. package/dist/ie/index.cjs.js +94 -31
  18. package/dist/ie/index.cjs.js.map +1 -1
  19. package/dist/ie/index.cjs.min.js +1 -1
  20. package/dist/ie/index.esm.js +94 -31
  21. package/dist/ie/index.esm.js.map +1 -1
  22. package/dist/ie/index.esm.min.js +1 -1
  23. package/dist/ie/index.iife.js +94 -31
  24. package/dist/ie/index.iife.js.map +1 -1
  25. package/dist/ie/index.iife.min.js +1 -1
  26. package/dist/ie/index.umd.js +94 -31
  27. package/dist/ie/index.umd.js.map +1 -1
  28. package/dist/ie/index.umd.min.js +1 -1
  29. package/dist/index.cjs.js +9 -16
  30. package/dist/index.cjs.js.map +1 -1
  31. package/dist/index.cjs.min.js +1 -1
  32. package/dist/index.esm.js +9 -16
  33. package/dist/index.esm.js.map +1 -1
  34. package/dist/index.esm.min.js +1 -1
  35. package/dist/index.iife.js +9 -16
  36. package/dist/index.iife.js.map +1 -1
  37. package/dist/index.iife.min.js +1 -1
  38. package/dist/index.umd.js +9 -16
  39. package/dist/index.umd.js.map +1 -1
  40. package/dist/index.umd.min.js +1 -1
  41. package/package.json +57 -51
  42. /package/dist/ie/es/_virtual/{es.array.fill2.js → es2.array.fill.js} +0 -0
  43. /package/dist/ie/es/_virtual/{es.array.from2.js → es2.array.from.js} +0 -0
  44. /package/dist/ie/es/_virtual/{es.array.includes2.js → es2.array.includes.js} +0 -0
  45. /package/dist/ie/es/_virtual/{es.promise2.js → es2.promise.js} +0 -0
@@ -208,26 +208,22 @@ var Watermark = /** @class */ (function () {
208
208
  characterData: true, // 节点内容或节点文本的变动。
209
209
  });
210
210
  this.parentObserve = new MutationObserver(function (mutationsList) { return __awaiter(_this, void 0, void 0, function () {
211
- var _i, mutationsList_1, item;
212
- var _a;
213
- return __generator(this, function (_b) {
214
- switch (_b.label) {
211
+ var _i, mutationsList_1, item, watermarkRemoved;
212
+ return __generator(this, function (_a) {
213
+ switch (_a.label) {
215
214
  case 0:
216
215
  _i = 0, mutationsList_1 = mutationsList;
217
- _b.label = 1;
216
+ _a.label = 1;
218
217
  case 1:
219
218
  if (!(_i < mutationsList_1.length)) return [3 /*break*/, 4];
220
219
  item = mutationsList_1[_i];
221
- if (!((item === null || item === void 0 ? void 0 : item.target) === this.watermarkDom ||
222
- ((_a = item === null || item === void 0 ? void 0 : item.removedNodes) === null || _a === void 0 ? void 0 : _a[0]) === this.watermarkDom ||
223
- (item.type === 'childList' &&
224
- item.target === this.parentElement &&
225
- item.target.lastChild !== this.watermarkDom))) return [3 /*break*/, 3];
220
+ watermarkRemoved = Array.from(item.removedNodes).includes(this.watermarkDom);
221
+ if (!watermarkRemoved) return [3 /*break*/, 3];
226
222
  this.remove();
227
223
  return [4 /*yield*/, this.create()];
228
224
  case 2:
229
- _b.sent();
230
- _b.label = 3;
225
+ _a.sent();
226
+ _a.label = 3;
231
227
  case 3:
232
228
  _i++;
233
229
  return [3 /*break*/, 1];
@@ -236,10 +232,7 @@ var Watermark = /** @class */ (function () {
236
232
  });
237
233
  }); });
238
234
  this.parentObserve.observe(this.parentElement, {
239
- attributes: true, // 属性的变动
240
235
  childList: true, // 子节点的变动(指新增,删除或者更改)
241
- subtree: true, // 布尔值,表示是否将该观察器应用于该节点的所有后代节点。
242
- characterData: true, // 节点内容或节点文本的变动。
243
236
  });
244
237
  };
245
238
  return Watermark;
@@ -6,8 +6,10 @@ import { __require as requireIsArrayIteratorMethod } from './is-array-iterator-m
6
6
  import { __require as requireIsConstructor } from './is-constructor.js';
7
7
  import { __require as requireLengthOfArrayLike } from './length-of-array-like.js';
8
8
  import { __require as requireCreateProperty } from './create-property.js';
9
+ import { __require as requireArraySetLength } from './array-set-length.js';
9
10
  import { __require as requireGetIterator } from './get-iterator.js';
10
11
  import { __require as requireGetIteratorMethod } from './get-iterator-method.js';
12
+ import { __require as requireIteratorClose } from './iterator-close.js';
11
13
 
12
14
  var arrayFrom;
13
15
  var hasRequiredArrayFrom;
@@ -23,20 +25,22 @@ function requireArrayFrom () {
23
25
  var isConstructor = requireIsConstructor();
24
26
  var lengthOfArrayLike = requireLengthOfArrayLike();
25
27
  var createProperty = requireCreateProperty();
28
+ var setArrayLength = requireArraySetLength();
26
29
  var getIterator = requireGetIterator();
27
30
  var getIteratorMethod = requireGetIteratorMethod();
31
+ var iteratorClose = requireIteratorClose();
28
32
 
29
33
  var $Array = Array;
30
34
 
31
35
  // `Array.from` method implementation
32
36
  // https://tc39.es/ecma262/#sec-array.from
33
37
  arrayFrom = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
34
- var O = toObject(arrayLike);
35
38
  var IS_CONSTRUCTOR = isConstructor(this);
36
39
  var argumentsLength = arguments.length;
37
40
  var mapfn = argumentsLength > 1 ? arguments[1] : undefined;
38
41
  var mapping = mapfn !== undefined;
39
42
  if (mapping) mapfn = bind(mapfn, argumentsLength > 2 ? arguments[2] : undefined);
43
+ var O = toObject(arrayLike);
40
44
  var iteratorMethod = getIteratorMethod(O);
41
45
  var index = 0;
42
46
  var length, result, step, iterator, next, value;
@@ -47,7 +51,11 @@ function requireArrayFrom () {
47
51
  next = iterator.next;
48
52
  for (;!(step = call(next, iterator)).done; index++) {
49
53
  value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value;
50
- createProperty(result, index, value);
54
+ try {
55
+ createProperty(result, index, value);
56
+ } catch (error) {
57
+ iteratorClose(iterator, 'throw', error);
58
+ }
51
59
  }
52
60
  } else {
53
61
  length = lengthOfArrayLike(O);
@@ -57,7 +65,7 @@ function requireArrayFrom () {
57
65
  createProperty(result, index, value);
58
66
  }
59
67
  }
60
- result.length = index;
68
+ setArrayLength(result, index);
61
69
  return result;
62
70
  };
63
71
  return arrayFrom;
@@ -0,0 +1,39 @@
1
+ import { __require as requireDescriptors } from './descriptors.js';
2
+ import { __require as requireIsArray } from './is-array.js';
3
+
4
+ var arraySetLength;
5
+ var hasRequiredArraySetLength;
6
+
7
+ function requireArraySetLength () {
8
+ if (hasRequiredArraySetLength) return arraySetLength;
9
+ hasRequiredArraySetLength = 1;
10
+ var DESCRIPTORS = requireDescriptors();
11
+ var isArray = requireIsArray();
12
+
13
+ var $TypeError = TypeError;
14
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
15
+ var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
16
+
17
+ // Safari < 13 does not throw an error in this case
18
+ var SILENT_ON_NON_WRITABLE_LENGTH_SET = DESCRIPTORS && !function () {
19
+ // makes no sense without proper strict mode support
20
+ if (this !== undefined) return true;
21
+ try {
22
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
23
+ Object.defineProperty([], 'length', { writable: false }).length = 1;
24
+ } catch (error) {
25
+ return error instanceof TypeError;
26
+ }
27
+ }();
28
+
29
+ arraySetLength = SILENT_ON_NON_WRITABLE_LENGTH_SET ? function (O, length) {
30
+ if (isArray(O) && !getOwnPropertyDescriptor(O, 'length').writable) {
31
+ throw new $TypeError('Cannot set read only .length');
32
+ } return O.length = length;
33
+ } : function (O, length) {
34
+ return O.length = length;
35
+ };
36
+ return arraySetLength;
37
+ }
38
+
39
+ export { requireArraySetLength as __require };
@@ -21,6 +21,7 @@ function requireCheckCorrectnessOfIteration () {
21
21
  SAFE_CLOSING = true;
22
22
  }
23
23
  };
24
+ // eslint-disable-next-line unicorn/no-immediate-mutation -- ES3 syntax limitation
24
25
  iteratorWithReturn[ITERATOR] = function () {
25
26
  return this;
26
27
  };
@@ -35,6 +36,7 @@ function requireCheckCorrectnessOfIteration () {
35
36
  var ITERATION_SUPPORT = false;
36
37
  try {
37
38
  var object = {};
39
+ // eslint-disable-next-line unicorn/no-immediate-mutation -- ES3 syntax limitation
38
40
  object[ITERATOR] = function () {
39
41
  return {
40
42
  next: function () {
@@ -8,8 +8,7 @@ function requireEnvironmentIsIos () {
8
8
  hasRequiredEnvironmentIsIos = 1;
9
9
  var userAgent = requireEnvironmentUserAgent();
10
10
 
11
- // eslint-disable-next-line redos/no-vulnerable -- safe
12
- environmentIsIos = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent);
11
+ environmentIsIos = /ipad|iphone|ipod/i.test(userAgent) && /applewebkit/i.test(userAgent);
13
12
  return environmentIsIos;
14
13
  }
15
14
 
@@ -10,7 +10,7 @@ function requireFunctionBindNative () {
10
10
 
11
11
  functionBindNative = !fails(function () {
12
12
  // eslint-disable-next-line es/no-function-prototype-bind -- safe
13
- var test = (function () { /* empty */ }).bind();
13
+ var test = function () { /* empty */ }.bind();
14
14
  // eslint-disable-next-line no-prototype-builtins -- safe
15
15
  return typeof test != 'function' || test.hasOwnProperty('prototype');
16
16
  });
@@ -16,7 +16,7 @@ function requireFunctionName () {
16
16
 
17
17
  var EXISTS = hasOwn(FunctionPrototype, 'name');
18
18
  // additional protection from minified / mangled / dropped function names
19
- var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
19
+ var PROPER = EXISTS && function something() { /* empty */ }.name === 'something';
20
20
  var CONFIGURABLE = EXISTS && (!DESCRIPTORS || (DESCRIPTORS && getDescriptor(FunctionPrototype, 'name').configurable));
21
21
 
22
22
  functionName = {
@@ -0,0 +1,20 @@
1
+ import { __require as requireClassofRaw } from './classof-raw.js';
2
+
3
+ var isArray;
4
+ var hasRequiredIsArray;
5
+
6
+ function requireIsArray () {
7
+ if (hasRequiredIsArray) return isArray;
8
+ hasRequiredIsArray = 1;
9
+ var classof = requireClassofRaw();
10
+
11
+ // `IsArray` abstract operation
12
+ // https://tc39.es/ecma262/#sec-isarray
13
+ // eslint-disable-next-line es/no-array-isarray -- safe
14
+ isArray = Array.isArray || function isArray(argument) {
15
+ return classof(argument) === 'Array';
16
+ };
17
+ return isArray;
18
+ }
19
+
20
+ export { requireIsArray as __require };
@@ -45,7 +45,9 @@ function requireIterate () {
45
45
  var iterator, iterFn, index, length, result, next, step;
46
46
 
47
47
  var stop = function (condition) {
48
- if (iterator) iteratorClose(iterator, 'normal');
48
+ var $iterator = iterator;
49
+ iterator = undefined;
50
+ if ($iterator) iteratorClose($iterator, 'normal');
49
51
  return new Result(true, condition);
50
52
  };
51
53
 
@@ -75,10 +77,13 @@ function requireIterate () {
75
77
 
76
78
  next = IS_RECORD ? iterable.next : iterator.next;
77
79
  while (!(step = call(next, iterator)).done) {
80
+ // `IteratorValue` errors should propagate without closing the iterator
81
+ var value = step.value;
78
82
  try {
79
- result = callFn(step.value);
83
+ result = callFn(value);
80
84
  } catch (error) {
81
- iteratorClose(iterator, 'throw', error);
85
+ if (iterator) iteratorClose(iterator, 'throw', error);
86
+ else throw error;
82
87
  }
83
88
  if (typeof result == 'object' && result && isPrototypeOf(ResultPrototype, result)) return result;
84
89
  } return new Result(false);
@@ -16,10 +16,10 @@ function requireSharedStore () {
16
16
  var store = sharedStore.exports = globalThis[SHARED] || defineGlobalProperty(SHARED, {});
17
17
 
18
18
  (store.versions || (store.versions = [])).push({
19
- version: '3.44.0',
19
+ version: '3.49.0',
20
20
  mode: IS_PURE ? 'pure' : 'global',
21
- copyright: '© 2014-2025 Denis Pushkarev (zloirock.ru)',
22
- license: 'https://github.com/zloirock/core-js/blob/v3.44.0/LICENSE',
21
+ copyright: '© 2013–2025 Denis Pushkarev (zloirock.ru), 2025–2026 CoreJS Company (core-js.io). All rights reserved.',
22
+ license: 'https://github.com/zloirock/core-js/blob/v3.49.0/LICENSE',
23
23
  source: 'https://github.com/zloirock/core-js'
24
24
  });
25
25
  return sharedStore.exports;
@@ -10,7 +10,7 @@ function requireToStringTagSupport () {
10
10
 
11
11
  var TO_STRING_TAG = wellKnownSymbol('toStringTag');
12
12
  var test = {};
13
-
13
+ // eslint-disable-next-line unicorn/no-immediate-mutation -- ES3 syntax limitation
14
14
  test[TO_STRING_TAG] = 'z';
15
15
 
16
16
  toStringTagSupport = String(test) === '[object z]';
@@ -1,4 +1,4 @@
1
- import { __exports as es_array_fill } from '../../../_virtual/es.array.fill2.js';
1
+ import { __exports as es_array_fill } from '../../../_virtual/es2.array.fill.js';
2
2
  import { __require as require_export } from '../internals/export.js';
3
3
  import { __require as requireArrayFill } from '../internals/array-fill.js';
4
4
  import { __require as requireAddToUnscopables } from '../internals/add-to-unscopables.js';
@@ -1,4 +1,4 @@
1
- import { __exports as es_array_from } from '../../../_virtual/es.array.from2.js';
1
+ import { __exports as es_array_from } from '../../../_virtual/es2.array.from.js';
2
2
  import { __require as require_export } from '../internals/export.js';
3
3
  import { __require as requireArrayFrom } from '../internals/array-from.js';
4
4
  import { __require as requireCheckCorrectnessOfIteration } from '../internals/check-correctness-of-iteration.js';
@@ -1,4 +1,4 @@
1
- import { __exports as es_array_includes } from '../../../_virtual/es.array.includes2.js';
1
+ import { __exports as es_array_includes } from '../../../_virtual/es2.array.includes.js';
2
2
  import { __require as require_export } from '../internals/export.js';
3
3
  import { __require as requireArrayIncludes } from '../internals/array-includes.js';
4
4
  import { __require as requireFails } from '../internals/fails.js';
@@ -20,9 +20,15 @@ function requireEs_array_includes () {
20
20
  return !Array(1).includes();
21
21
  });
22
22
 
23
+ // Safari 26.4- bug
24
+ var BROKEN_ON_SPARSE_WITH_FROM_INDEX = fails(function () {
25
+ // eslint-disable-next-line no-sparse-arrays, es/no-array-prototype-includes -- detection
26
+ return [, 1].includes(undefined, 1);
27
+ });
28
+
23
29
  // `Array.prototype.includes` method
24
30
  // https://tc39.es/ecma262/#sec-array.prototype.includes
25
- $({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
31
+ $({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE || BROKEN_ON_SPARSE_WITH_FROM_INDEX }, {
26
32
  includes: function includes(el /* , fromIndex = 0 */) {
27
33
  return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
28
34
  }
@@ -1,4 +1,4 @@
1
- import { __exports as es_promise } from '../../../_virtual/es.promise2.js';
1
+ import { __exports as es_promise } from '../../../_virtual/es2.promise.js';
2
2
  import { __require as requireEs_promise_constructor } from './es.promise.constructor.js';
3
3
  import { __require as requireEs_promise_all } from './es.promise.all.js';
4
4
  import { __require as requireEs_promise_catch } from './es.promise.catch.js';
@@ -208,26 +208,22 @@ var Watermark = /** @class */ (function () {
208
208
  characterData: true, // 节点内容或节点文本的变动。
209
209
  });
210
210
  this.parentObserve = new MutationObserver(function (mutationsList) { return __awaiter(_this, void 0, void 0, function () {
211
- var _i, mutationsList_1, item;
212
- var _a;
213
- return __generator(this, function (_b) {
214
- switch (_b.label) {
211
+ var _i, mutationsList_1, item, watermarkRemoved;
212
+ return __generator(this, function (_a) {
213
+ switch (_a.label) {
215
214
  case 0:
216
215
  _i = 0, mutationsList_1 = mutationsList;
217
- _b.label = 1;
216
+ _a.label = 1;
218
217
  case 1:
219
218
  if (!(_i < mutationsList_1.length)) return [3 /*break*/, 4];
220
219
  item = mutationsList_1[_i];
221
- if (!((item === null || item === void 0 ? void 0 : item.target) === this.watermarkDom ||
222
- ((_a = item === null || item === void 0 ? void 0 : item.removedNodes) === null || _a === void 0 ? void 0 : _a[0]) === this.watermarkDom ||
223
- (item.type === 'childList' &&
224
- item.target === this.parentElement &&
225
- item.target.lastChild !== this.watermarkDom))) return [3 /*break*/, 3];
220
+ watermarkRemoved = Array.from(item.removedNodes).includes(this.watermarkDom);
221
+ if (!watermarkRemoved) return [3 /*break*/, 3];
226
222
  this.remove();
227
223
  return [4 /*yield*/, this.create()];
228
224
  case 2:
229
- _b.sent();
230
- _b.label = 3;
225
+ _a.sent();
226
+ _a.label = 3;
231
227
  case 3:
232
228
  _i++;
233
229
  return [3 /*break*/, 1];
@@ -236,10 +232,7 @@ var Watermark = /** @class */ (function () {
236
232
  });
237
233
  }); });
238
234
  this.parentObserve.observe(this.parentElement, {
239
- attributes: true, // 属性的变动
240
235
  childList: true, // 子节点的变动(指新增,删除或者更改)
241
- subtree: true, // 布尔值,表示是否将该观察器应用于该节点的所有后代节点。
242
- characterData: true, // 节点内容或节点文本的变动。
243
236
  });
244
237
  };
245
238
  return Watermark;
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * watermark-js-plus v1.6.3
2
+ * watermark-js-plus v1.6.4
3
3
  * (c) 2022-2024 Michael Sun
4
4
  * Released under the MIT License.
5
5
  */
@@ -77,7 +77,7 @@ function requireFunctionBindNative () {
77
77
 
78
78
  functionBindNative = !fails(function () {
79
79
  // eslint-disable-next-line es/no-function-prototype-bind -- safe
80
- var test = (function () { /* empty */ }).bind();
80
+ var test = function () { /* empty */ }.bind();
81
81
  // eslint-disable-next-line no-prototype-builtins -- safe
82
82
  return typeof test != 'function' || test.hasOwnProperty('prototype');
83
83
  });
@@ -556,10 +556,10 @@ function requireSharedStore () {
556
556
  var store = sharedStore.exports = globalThis[SHARED] || defineGlobalProperty(SHARED, {});
557
557
 
558
558
  (store.versions || (store.versions = [])).push({
559
- version: '3.44.0',
559
+ version: '3.49.0',
560
560
  mode: IS_PURE ? 'pure' : 'global',
561
- copyright: '© 2014-2025 Denis Pushkarev (zloirock.ru)',
562
- license: 'https://github.com/zloirock/core-js/blob/v3.44.0/LICENSE',
561
+ copyright: '© 2013–2025 Denis Pushkarev (zloirock.ru), 2025–2026 CoreJS Company (core-js.io). All rights reserved.',
562
+ license: 'https://github.com/zloirock/core-js/blob/v3.49.0/LICENSE',
563
563
  source: 'https://github.com/zloirock/core-js'
564
564
  });
565
565
  return sharedStore.exports;
@@ -912,7 +912,7 @@ function requireFunctionName () {
912
912
 
913
913
  var EXISTS = hasOwn(FunctionPrototype, 'name');
914
914
  // additional protection from minified / mangled / dropped function names
915
- var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
915
+ var PROPER = EXISTS && function something() { /* empty */ }.name === 'something';
916
916
  var CONFIGURABLE = EXISTS && (!DESCRIPTORS || (DESCRIPTORS && getDescriptor(FunctionPrototype, 'name').configurable));
917
917
 
918
918
  functionName = {
@@ -1654,7 +1654,7 @@ function requireToStringTagSupport () {
1654
1654
 
1655
1655
  var TO_STRING_TAG = wellKnownSymbol('toStringTag');
1656
1656
  var test = {};
1657
-
1657
+ // eslint-disable-next-line unicorn/no-immediate-mutation -- ES3 syntax limitation
1658
1658
  test[TO_STRING_TAG] = 'z';
1659
1659
 
1660
1660
  toStringTagSupport = String(test) === '[object z]';
@@ -1776,6 +1776,58 @@ function requireCreateProperty () {
1776
1776
  return createProperty;
1777
1777
  }
1778
1778
 
1779
+ var isArray;
1780
+ var hasRequiredIsArray;
1781
+
1782
+ function requireIsArray () {
1783
+ if (hasRequiredIsArray) return isArray;
1784
+ hasRequiredIsArray = 1;
1785
+ var classof = requireClassofRaw();
1786
+
1787
+ // `IsArray` abstract operation
1788
+ // https://tc39.es/ecma262/#sec-isarray
1789
+ // eslint-disable-next-line es/no-array-isarray -- safe
1790
+ isArray = Array.isArray || function isArray(argument) {
1791
+ return classof(argument) === 'Array';
1792
+ };
1793
+ return isArray;
1794
+ }
1795
+
1796
+ var arraySetLength;
1797
+ var hasRequiredArraySetLength;
1798
+
1799
+ function requireArraySetLength () {
1800
+ if (hasRequiredArraySetLength) return arraySetLength;
1801
+ hasRequiredArraySetLength = 1;
1802
+ var DESCRIPTORS = requireDescriptors();
1803
+ var isArray = requireIsArray();
1804
+
1805
+ var $TypeError = TypeError;
1806
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
1807
+ var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
1808
+
1809
+ // Safari < 13 does not throw an error in this case
1810
+ var SILENT_ON_NON_WRITABLE_LENGTH_SET = DESCRIPTORS && !function () {
1811
+ // makes no sense without proper strict mode support
1812
+ if (this !== undefined) return true;
1813
+ try {
1814
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
1815
+ Object.defineProperty([], 'length', { writable: false }).length = 1;
1816
+ } catch (error) {
1817
+ return error instanceof TypeError;
1818
+ }
1819
+ }();
1820
+
1821
+ arraySetLength = SILENT_ON_NON_WRITABLE_LENGTH_SET ? function (O, length) {
1822
+ if (isArray(O) && !getOwnPropertyDescriptor(O, 'length').writable) {
1823
+ throw new $TypeError('Cannot set read only .length');
1824
+ } return O.length = length;
1825
+ } : function (O, length) {
1826
+ return O.length = length;
1827
+ };
1828
+ return arraySetLength;
1829
+ }
1830
+
1779
1831
  var getIteratorMethod;
1780
1832
  var hasRequiredGetIteratorMethod;
1781
1833
 
@@ -1834,20 +1886,22 @@ function requireArrayFrom () {
1834
1886
  var isConstructor = requireIsConstructor();
1835
1887
  var lengthOfArrayLike = requireLengthOfArrayLike();
1836
1888
  var createProperty = requireCreateProperty();
1889
+ var setArrayLength = requireArraySetLength();
1837
1890
  var getIterator = requireGetIterator();
1838
1891
  var getIteratorMethod = requireGetIteratorMethod();
1892
+ var iteratorClose = requireIteratorClose();
1839
1893
 
1840
1894
  var $Array = Array;
1841
1895
 
1842
1896
  // `Array.from` method implementation
1843
1897
  // https://tc39.es/ecma262/#sec-array.from
1844
1898
  arrayFrom = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
1845
- var O = toObject(arrayLike);
1846
1899
  var IS_CONSTRUCTOR = isConstructor(this);
1847
1900
  var argumentsLength = arguments.length;
1848
1901
  var mapfn = argumentsLength > 1 ? arguments[1] : undefined;
1849
1902
  var mapping = mapfn !== undefined;
1850
1903
  if (mapping) mapfn = bind(mapfn, argumentsLength > 2 ? arguments[2] : undefined);
1904
+ var O = toObject(arrayLike);
1851
1905
  var iteratorMethod = getIteratorMethod(O);
1852
1906
  var index = 0;
1853
1907
  var length, result, step, iterator, next, value;
@@ -1858,7 +1912,11 @@ function requireArrayFrom () {
1858
1912
  next = iterator.next;
1859
1913
  for (;!(step = call(next, iterator)).done; index++) {
1860
1914
  value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value;
1861
- createProperty(result, index, value);
1915
+ try {
1916
+ createProperty(result, index, value);
1917
+ } catch (error) {
1918
+ iteratorClose(iterator, 'throw', error);
1919
+ }
1862
1920
  }
1863
1921
  } else {
1864
1922
  length = lengthOfArrayLike(O);
@@ -1868,7 +1926,7 @@ function requireArrayFrom () {
1868
1926
  createProperty(result, index, value);
1869
1927
  }
1870
1928
  }
1871
- result.length = index;
1929
+ setArrayLength(result, index);
1872
1930
  return result;
1873
1931
  };
1874
1932
  return arrayFrom;
@@ -1895,6 +1953,7 @@ function requireCheckCorrectnessOfIteration () {
1895
1953
  SAFE_CLOSING = true;
1896
1954
  }
1897
1955
  };
1956
+ // eslint-disable-next-line unicorn/no-immediate-mutation -- ES3 syntax limitation
1898
1957
  iteratorWithReturn[ITERATOR] = function () {
1899
1958
  return this;
1900
1959
  };
@@ -1909,6 +1968,7 @@ function requireCheckCorrectnessOfIteration () {
1909
1968
  var ITERATION_SUPPORT = false;
1910
1969
  try {
1911
1970
  var object = {};
1971
+ // eslint-disable-next-line unicorn/no-immediate-mutation -- ES3 syntax limitation
1912
1972
  object[ITERATOR] = function () {
1913
1973
  return {
1914
1974
  next: function () {
@@ -2280,8 +2340,7 @@ function requireEnvironmentIsIos () {
2280
2340
  hasRequiredEnvironmentIsIos = 1;
2281
2341
  var userAgent = requireEnvironmentUserAgent();
2282
2342
 
2283
- // eslint-disable-next-line redos/no-vulnerable -- safe
2284
- environmentIsIos = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent);
2343
+ environmentIsIos = /ipad|iphone|ipod/i.test(userAgent) && /applewebkit/i.test(userAgent);
2285
2344
  return environmentIsIos;
2286
2345
  }
2287
2346
 
@@ -3041,7 +3100,9 @@ function requireIterate () {
3041
3100
  var iterator, iterFn, index, length, result, next, step;
3042
3101
 
3043
3102
  var stop = function (condition) {
3044
- if (iterator) iteratorClose(iterator, 'normal');
3103
+ var $iterator = iterator;
3104
+ iterator = undefined;
3105
+ if ($iterator) iteratorClose($iterator, 'normal');
3045
3106
  return new Result(true, condition);
3046
3107
  };
3047
3108
 
@@ -3071,10 +3132,13 @@ function requireIterate () {
3071
3132
 
3072
3133
  next = IS_RECORD ? iterable.next : iterator.next;
3073
3134
  while (!(step = call(next, iterator)).done) {
3135
+ // `IteratorValue` errors should propagate without closing the iterator
3136
+ var value = step.value;
3074
3137
  try {
3075
- result = callFn(step.value);
3138
+ result = callFn(value);
3076
3139
  } catch (error) {
3077
- iteratorClose(iterator, 'throw', error);
3140
+ if (iterator) iteratorClose(iterator, 'throw', error);
3141
+ else throw error;
3078
3142
  }
3079
3143
  if (typeof result == 'object' && result && isPrototypeOf(ResultPrototype, result)) return result;
3080
3144
  } return new Result(false);
@@ -3491,9 +3555,15 @@ function requireEs_array_includes () {
3491
3555
  return !Array(1).includes();
3492
3556
  });
3493
3557
 
3558
+ // Safari 26.4- bug
3559
+ var BROKEN_ON_SPARSE_WITH_FROM_INDEX = fails(function () {
3560
+ // eslint-disable-next-line no-sparse-arrays, es/no-array-prototype-includes -- detection
3561
+ return [, 1].includes(undefined, 1);
3562
+ });
3563
+
3494
3564
  // `Array.prototype.includes` method
3495
3565
  // https://tc39.es/ecma262/#sec-array.prototype.includes
3496
- $({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
3566
+ $({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE || BROKEN_ON_SPARSE_WITH_FROM_INDEX }, {
3497
3567
  includes: function includes(el /* , fromIndex = 0 */) {
3498
3568
  return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
3499
3569
  }
@@ -5351,26 +5421,22 @@ var Watermark = /** @class */ (function () {
5351
5421
  characterData: true, // 节点内容或节点文本的变动。
5352
5422
  });
5353
5423
  this.parentObserve = new MutationObserver(function (mutationsList) { return __awaiter(_this, void 0, void 0, function () {
5354
- var _i, mutationsList_1, item;
5355
- var _a;
5356
- return __generator(this, function (_b) {
5357
- switch (_b.label) {
5424
+ var _i, mutationsList_1, item, watermarkRemoved;
5425
+ return __generator(this, function (_a) {
5426
+ switch (_a.label) {
5358
5427
  case 0:
5359
5428
  _i = 0, mutationsList_1 = mutationsList;
5360
- _b.label = 1;
5429
+ _a.label = 1;
5361
5430
  case 1:
5362
5431
  if (!(_i < mutationsList_1.length)) return [3 /*break*/, 4];
5363
5432
  item = mutationsList_1[_i];
5364
- if (!((item === null || item === void 0 ? void 0 : item.target) === this.watermarkDom ||
5365
- ((_a = item === null || item === void 0 ? void 0 : item.removedNodes) === null || _a === void 0 ? void 0 : _a[0]) === this.watermarkDom ||
5366
- (item.type === 'childList' &&
5367
- item.target === this.parentElement &&
5368
- item.target.lastChild !== this.watermarkDom))) return [3 /*break*/, 3];
5433
+ watermarkRemoved = Array.from(item.removedNodes).includes(this.watermarkDom);
5434
+ if (!watermarkRemoved) return [3 /*break*/, 3];
5369
5435
  this.remove();
5370
5436
  return [4 /*yield*/, this.create()];
5371
5437
  case 2:
5372
- _b.sent();
5373
- _b.label = 3;
5438
+ _a.sent();
5439
+ _a.label = 3;
5374
5440
  case 3:
5375
5441
  _i++;
5376
5442
  return [3 /*break*/, 1];
@@ -5379,10 +5445,7 @@ var Watermark = /** @class */ (function () {
5379
5445
  });
5380
5446
  }); });
5381
5447
  this.parentObserve.observe(this.parentElement, {
5382
- attributes: true, // 属性的变动
5383
5448
  childList: true, // 子节点的变动(指新增,删除或者更改)
5384
- subtree: true, // 布尔值,表示是否将该观察器应用于该节点的所有后代节点。
5385
- characterData: true, // 节点内容或节点文本的变动。
5386
5449
  });
5387
5450
  };
5388
5451
  return Watermark;