securemark 0.262.1 → 0.262.2

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.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! securemark v0.262.1 https://github.com/falsandtru/securemark | (c) 2017, falsandtru | UNLICENSED License */
1
+ /*! securemark v0.262.2 https://github.com/falsandtru/securemark | (c) 2017, falsandtru | UNLICENSED License */
2
2
  (function webpackUniversalModuleDefinition(root, factory) {
3
3
  if(typeof exports === 'object' && typeof module === 'object')
4
4
  module.exports = factory(require("DOMPurify"), require("Prism"));
@@ -178,7 +178,28 @@ function splice(as, index, count, ...values) {
178
178
  return push(as, values), [];
179
179
  }
180
180
 
181
- return arguments.length > 2 ? as.splice(index, count, ...values) : as.splice(index);
181
+ switch (values.length) {
182
+ case 0:
183
+ return count !== undefined || arguments.length > 1 ? as.splice(index, count) : as.splice(index);
184
+
185
+ case 1:
186
+ return as.splice(index, count, values[0]);
187
+
188
+ case 2:
189
+ return as.splice(index, count, values[0], values[1]);
190
+
191
+ case 3:
192
+ return as.splice(index, count, values[0], values[1], values[2]);
193
+
194
+ case 4:
195
+ return as.splice(index, count, values[0], values[1], values[2], values[3]);
196
+
197
+ case 5:
198
+ return as.splice(index, count, values[0], values[1], values[2], values[3], values[4]);
199
+
200
+ default:
201
+ return count !== undefined || arguments.length > 1 ? as.splice(index, count, ...values) : as.splice(index);
202
+ }
182
203
  }
183
204
 
184
205
  exports.splice = splice;
@@ -406,6 +427,7 @@ class Cache {
406
427
  if (this.window * 1000 >= this.capacity === false) throw new Error(`Spica: Cache: Window must be 0.1% of capacity or more.`);
407
428
  this.block = settings.block;
408
429
  this.limit = settings.limit;
430
+ this.age = settings.age;
409
431
  this.earlyExpiring = settings.earlyExpiring;
410
432
  this.disposer = settings.disposer;
411
433
  this.stats = new Stats(this.window, settings.resolution, settings.offset);
@@ -424,7 +446,12 @@ class Cache {
424
446
  const index = node.value;
425
447
  callback &&= !!this.disposer;
426
448
  this.overlap -= +(index.region === 'LFU' && node.list === this.indexes.LRU);
427
- index.enode && this.expiries.delete(index.enode);
449
+
450
+ if (index.enode) {
451
+ this.expiries.delete(index.enode);
452
+ index.enode = void 0;
453
+ }
454
+
428
455
  node.delete();
429
456
  this.memory.delete(index.key);
430
457
  this.SIZE -= index.size;
@@ -486,14 +513,18 @@ class Cache {
486
513
 
487
514
  put(key, value, {
488
515
  size = 1,
489
- age = this.settings.age
516
+ age = this.age
490
517
  } = {}) {
491
518
  if (size < 1 || this.capacity < size || age <= 0) {
492
519
  this.disposer?.(value, key);
493
520
  return false;
494
521
  }
495
522
 
496
- const expiry = age === global_1.Infinity ? global_1.Infinity : (0, clock_1.now)() + age;
523
+ if (age === global_1.Infinity) {
524
+ age = 0;
525
+ }
526
+
527
+ const expiry = age ? (0, clock_1.now)() + age : global_1.Infinity;
497
528
  const node = this.memory.get(key);
498
529
 
499
530
  if (node && this.ensure(size, node)) {
@@ -503,7 +534,7 @@ class Cache {
503
534
  index.size = size;
504
535
  index.expiry = expiry;
505
536
 
506
- if (this.earlyExpiring && expiry !== global_1.Infinity) {
537
+ if (this.earlyExpiring && age) {
507
538
  index.enode ? this.expiries.update(index.enode, expiry) : index.enode = this.expiries.insert(node, expiry);
508
539
  } else if (index.enode) {
509
540
  this.expiries.delete(index.enode);
@@ -528,7 +559,7 @@ class Cache {
528
559
  region: 'LRU'
529
560
  }));
530
561
 
531
- if (this.earlyExpiring && expiry !== global_1.Infinity) {
562
+ if (this.earlyExpiring && age) {
532
563
  LRU.head.value.enode = this.expiries.insert(LRU.head, expiry);
533
564
  }
534
565
 
@@ -873,110 +904,6 @@ exports.equal = equal;
873
904
 
874
905
  /***/ }),
875
906
 
876
- /***/ 5084:
877
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
878
-
879
- "use strict";
880
-
881
-
882
- Object.defineProperty(exports, "__esModule", ({
883
- value: true
884
- }));
885
- exports.MultiMap = void 0;
886
-
887
- const global_1 = __webpack_require__(4128);
888
-
889
- const ring_1 = __webpack_require__(6395);
890
-
891
- class MultiMap {
892
- constructor(entries = [], memory = new global_1.Map()) {
893
- this.memory = memory;
894
-
895
- for (const {
896
- 0: k,
897
- 1: v
898
- } of entries) {
899
- this.set(k, v);
900
- }
901
- }
902
-
903
- get(key) {
904
- return this.memory.get(key)?.at(0);
905
- }
906
-
907
- getAll(key) {
908
- return this.memory.get(key);
909
- }
910
-
911
- set(key, val) {
912
- let vs = this.memory.get(key);
913
- if (vs) return vs.push(val), this;
914
- vs = new ring_1.Ring();
915
- vs.push(val);
916
- this.memory.set(key, vs);
917
- return this;
918
- }
919
-
920
- has(key, value) {
921
- const vs = this.memory.get(key);
922
- if (!vs?.length) return false;
923
- if (arguments.length < 2) return true;
924
- return vs.includes(value);
925
- }
926
-
927
- delete(key, value) {
928
- if (arguments.length < 2) return this.memory.delete(key);
929
- const vs = this.memory.get(key);
930
- if (!vs?.length) return false;
931
- const i = vs.indexOf(value);
932
- if (i === -1) return false;
933
- vs.splice(i, 1);
934
- return true;
935
- }
936
-
937
- clear() {
938
- this.memory.clear();
939
- }
940
-
941
- take(key, count) {
942
- const vs = this.memory.get(key);
943
- if (count === void 0) return vs?.shift();
944
- const acc = [];
945
-
946
- while (vs?.length && count--) {
947
- acc.push(vs.shift());
948
- }
949
-
950
- return acc;
951
- }
952
-
953
- ref(key) {
954
- let vs = this.memory.get(key);
955
- if (vs) return vs;
956
- vs = new ring_1.Ring();
957
- this.memory.set(key, vs);
958
- return vs;
959
- }
960
-
961
- *[Symbol.iterator]() {
962
- for (const {
963
- 0: k,
964
- 1: vs
965
- } of this.memory) {
966
- for (let i = 0; i < vs.length; ++i) {
967
- yield [k, vs.at(i)];
968
- }
969
- }
970
-
971
- return;
972
- }
973
-
974
- }
975
-
976
- exports.MultiMap = MultiMap;
977
-
978
- /***/ }),
979
-
980
907
  /***/ 8099:
981
908
  /***/ ((__unused_webpack_module, exports) => {
982
909
 
@@ -1282,6 +1209,10 @@ class Heap {
1282
1209
  sort(this.cmp, array, node[2], this.$length, this.stable);
1283
1210
  }
1284
1211
 
1212
+ find(order) {
1213
+ return this.array.find(node => node && node[0] === order);
1214
+ }
1215
+
1285
1216
  clear() {
1286
1217
  this.array = (0, global_1.Array)(size);
1287
1218
  this.$length = 0;
@@ -1300,7 +1231,7 @@ class MultiHeap {
1300
1231
  this.cmp = cmp;
1301
1232
  this.clean = clean;
1302
1233
  this.heap = new Heap(this.cmp);
1303
- this.dict = new Map();
1234
+ this.dict = new global_1.Map();
1304
1235
  this.list = (0, memoize_1.memoize)(order => {
1305
1236
  const list = new invlist_1.List();
1306
1237
  list[MultiHeap.order] = order;
@@ -1328,8 +1259,7 @@ class MultiHeap {
1328
1259
  }
1329
1260
 
1330
1261
  ++this.$length;
1331
- const list = this.list(order);
1332
- return [order, list.push(value)];
1262
+ return this.list(order).push(value);
1333
1263
  }
1334
1264
 
1335
1265
  extract() {
@@ -1347,35 +1277,37 @@ class MultiHeap {
1347
1277
  }
1348
1278
 
1349
1279
  delete(node) {
1350
- if (!node[1].list) throw new Error('Invalid node');
1351
- const {
1352
- 0: order,
1353
- 1: lnode
1354
- } = node;
1280
+ const list = node.list;
1281
+ if (!list) throw new Error('Invalid node');
1355
1282
  --this.$length;
1356
1283
 
1357
- if (lnode.list.length === 1) {
1358
- this.heap.delete(lnode[MultiHeap.heap]);
1359
- this.clean && this.dict.delete(order);
1284
+ if (list.length === 1) {
1285
+ this.heap.delete(list[MultiHeap.heap]);
1286
+ this.clean && this.dict.delete(list[MultiHeap.order]);
1360
1287
  }
1361
1288
 
1362
- return lnode.delete();
1289
+ return node.delete();
1363
1290
  }
1364
1291
 
1365
1292
  update(node, order, value) {
1366
- if (!node[1].list) throw new Error('Invalid node');
1293
+ const list = node.list;
1294
+ if (!list) throw new Error('Invalid node');
1367
1295
 
1368
1296
  if (arguments.length < 2) {
1369
- order = node[0];
1297
+ order = list[MultiHeap.order];
1370
1298
  }
1371
1299
 
1372
1300
  if (arguments.length > 2) {
1373
- node[1].value = value;
1301
+ node.value = value;
1374
1302
  }
1375
1303
 
1376
- if (this.cmp(node[0], order) === 0) return node;
1304
+ if (this.cmp(list[MultiHeap.order], order) === 0) return node;
1377
1305
  this.delete(node);
1378
- return this.insert(node[1].value, order);
1306
+ return this.insert(node.value, order);
1307
+ }
1308
+
1309
+ find(order) {
1310
+ return this.dict.get(order);
1379
1311
  }
1380
1312
 
1381
1313
  clear() {
@@ -1491,23 +1423,20 @@ __exportStar(__webpack_require__(2310), exports);
1491
1423
  "use strict";
1492
1424
  // Circular Inverse List
1493
1425
 
1494
- var _a;
1495
-
1496
1426
  Object.defineProperty(exports, "__esModule", ({
1497
1427
  value: true
1498
1428
  }));
1499
1429
  exports.List = void 0;
1500
1430
  const undefined = void 0;
1501
- const LENGTH = Symbol('length');
1502
1431
 
1503
1432
  class List {
1504
1433
  constructor() {
1505
- this[_a] = 0;
1434
+ this.$length = 0;
1506
1435
  this.head = undefined;
1507
1436
  }
1508
1437
 
1509
1438
  get length() {
1510
- return this[LENGTH];
1439
+ return this.$length;
1511
1440
  }
1512
1441
 
1513
1442
  get tail() {
@@ -1520,7 +1449,7 @@ class List {
1520
1449
 
1521
1450
  clear() {
1522
1451
  this.head = undefined;
1523
- this[LENGTH] = 0;
1452
+ this.$length = 0;
1524
1453
  }
1525
1454
 
1526
1455
  unshift(value) {
@@ -1566,7 +1495,7 @@ class List {
1566
1495
  insert(node, before = this.head) {
1567
1496
  if (node.list === this) return node.moveTo(before), node;
1568
1497
  node.delete();
1569
- ++this[LENGTH];
1498
+ ++this.$length;
1570
1499
  this.head ??= node; // @ts-expect-error
1571
1500
 
1572
1501
  node.list = this;
@@ -1576,11 +1505,43 @@ class List {
1576
1505
  return node;
1577
1506
  }
1578
1507
 
1579
- *[(_a = LENGTH, Symbol.iterator)]() {
1580
- for (let node = this.head; node;) {
1508
+ find(f) {
1509
+ for (let head = this.head, node = head; node;) {
1510
+ if (f(node.value)) return node;
1511
+ node = node.next;
1512
+ if (node === head) break;
1513
+ }
1514
+ }
1515
+
1516
+ toNodes() {
1517
+ const acc = [];
1518
+
1519
+ for (let head = this.head, node = head; node;) {
1520
+ acc.push(node);
1521
+ node = node.next;
1522
+ if (node === head) break;
1523
+ }
1524
+
1525
+ return acc;
1526
+ }
1527
+
1528
+ toArray() {
1529
+ const acc = [];
1530
+
1531
+ for (let head = this.head, node = head; node;) {
1532
+ acc.push(node.value);
1533
+ node = node.next;
1534
+ if (node === head) break;
1535
+ }
1536
+
1537
+ return acc;
1538
+ }
1539
+
1540
+ *[Symbol.iterator]() {
1541
+ for (let head = this.head, node = head; node;) {
1581
1542
  yield node.value;
1582
1543
  node = node.next;
1583
- if (node === this.head) return;
1544
+ if (node === head) return;
1584
1545
  }
1585
1546
  }
1586
1547
 
@@ -1594,14 +1555,14 @@ class Node {
1594
1555
  this.value = value;
1595
1556
  this.next = next;
1596
1557
  this.prev = prev;
1597
- ++list[LENGTH];
1558
+ ++list.$length;
1598
1559
  list.head ??= this;
1599
1560
  next && prev ? next.prev = prev.next = this : this.next = this.prev = this;
1600
1561
  }
1601
1562
 
1602
1563
  delete() {
1603
1564
  if (!this.list) return this.value;
1604
- --this.list[LENGTH];
1565
+ --this.list.$length;
1605
1566
  const {
1606
1567
  next,
1607
1568
  prev
@@ -1759,43 +1720,6 @@ exports.reduce = reduce;
1759
1720
 
1760
1721
  /***/ }),
1761
1722
 
1762
- /***/ 940:
1763
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
1764
-
1765
- "use strict";
1766
-
1767
-
1768
- var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
1769
- if (k2 === undefined) k2 = k;
1770
- var desc = Object.getOwnPropertyDescriptor(m, k);
1771
-
1772
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
1773
- desc = {
1774
- enumerable: true,
1775
- get: function () {
1776
- return m[k];
1777
- }
1778
- };
1779
- }
1780
-
1781
- Object.defineProperty(o, k2, desc);
1782
- } : function (o, m, k, k2) {
1783
- if (k2 === undefined) k2 = k;
1784
- o[k2] = m[k];
1785
- });
1786
-
1787
- var __exportStar = this && this.__exportStar || function (m, exports) {
1788
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
1789
- };
1790
-
1791
- Object.defineProperty(exports, "__esModule", ({
1792
- value: true
1793
- }));
1794
-
1795
- __exportStar(__webpack_require__(5084), exports);
1796
-
1797
- /***/ }),
1798
-
1799
1723
  /***/ 4934:
1800
1724
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1801
1725
 
@@ -1805,7 +1729,7 @@ __exportStar(__webpack_require__(5084), exports);
1805
1729
  Object.defineProperty(exports, "__esModule", ({
1806
1730
  value: true
1807
1731
  }));
1808
- exports.PriorityQueue = exports.Queue = void 0;
1732
+ exports.MultiQueue = exports.PriorityQueue = exports.Queue = void 0;
1809
1733
 
1810
1734
  const global_1 = __webpack_require__(4128);
1811
1735
 
@@ -1935,7 +1859,7 @@ class FixedQueue {
1935
1859
  class PriorityQueue {
1936
1860
  constructor(cmp = PriorityQueue.max, clean = true) {
1937
1861
  this.clean = clean;
1938
- this.dict = new Map();
1862
+ this.dict = new global_1.Map();
1939
1863
  this.queue = (0, memoize_1.memoize)(priority => {
1940
1864
  const queue = new Queue();
1941
1865
  queue[PriorityQueue.priority] = priority;
@@ -1954,22 +1878,22 @@ class PriorityQueue {
1954
1878
  return this.$length === 0;
1955
1879
  }
1956
1880
 
1957
- peek() {
1958
- return this.heap.peek()?.peek();
1881
+ peek(priority) {
1882
+ return arguments.length === 0 ? this.heap.peek()?.peek() : this.dict.get(priority)?.peek();
1959
1883
  }
1960
1884
 
1961
- push(value, priority) {
1885
+ push(priority, value) {
1962
1886
  ++this.$length;
1963
1887
  this.queue(priority).push(value);
1964
1888
  }
1965
1889
 
1966
- pop() {
1890
+ pop(priority) {
1967
1891
  if (this.$length === 0) return;
1968
1892
  --this.$length;
1969
- const queue = this.heap.peek();
1970
- const value = queue.pop();
1893
+ const queue = arguments.length === 0 ? this.heap.peek() : this.dict.get(priority);
1894
+ const value = queue?.pop();
1971
1895
 
1972
- if (queue.isEmpty()) {
1896
+ if (queue?.isEmpty()) {
1973
1897
  this.heap.extract();
1974
1898
  this.clean && this.dict.delete(queue[PriorityQueue.priority]);
1975
1899
  }
@@ -1998,6 +1922,103 @@ PriorityQueue.priority = Symbol('priority');
1998
1922
  PriorityQueue.max = heap_1.Heap.max;
1999
1923
  PriorityQueue.min = heap_1.Heap.min;
2000
1924
 
1925
+ class MultiQueue {
1926
+ constructor(entries) {
1927
+ this.dict = new global_1.Map();
1928
+ if (entries) for (const {
1929
+ 0: k,
1930
+ 1: v
1931
+ } of entries) {
1932
+ this.set(k, v);
1933
+ }
1934
+ }
1935
+
1936
+ get length() {
1937
+ return this.dict.size;
1938
+ }
1939
+
1940
+ isEmpty() {
1941
+ return this.dict.size === 0;
1942
+ }
1943
+
1944
+ peek(key) {
1945
+ return this.dict.get(key)?.peek();
1946
+ }
1947
+
1948
+ push(key, value) {
1949
+ let vs = this.dict.get(key);
1950
+ if (vs) return void vs.push(value);
1951
+ vs = new Queue();
1952
+ vs.push(value);
1953
+ this.dict.set(key, vs);
1954
+ }
1955
+
1956
+ pop(key) {
1957
+ return this.dict.get(key)?.pop();
1958
+ }
1959
+
1960
+ clear() {
1961
+ this.dict = new global_1.Map();
1962
+ }
1963
+
1964
+ take(key, count) {
1965
+ if (count === void 0) return this.pop(key);
1966
+ const vs = this.dict.get(key);
1967
+ const acc = [];
1968
+
1969
+ while (vs && !vs.isEmpty() && count--) {
1970
+ acc.push(vs.pop());
1971
+ }
1972
+
1973
+ return acc;
1974
+ }
1975
+
1976
+ ref(key) {
1977
+ let vs = this.dict.get(key);
1978
+ if (vs) return vs;
1979
+ vs = new Queue();
1980
+ this.dict.set(key, vs);
1981
+ return vs;
1982
+ }
1983
+
1984
+ get size() {
1985
+ return this.length;
1986
+ }
1987
+
1988
+ get(key) {
1989
+ return this.peek(key);
1990
+ }
1991
+
1992
+ set(key, value) {
1993
+ this.push(key, value);
1994
+ return this;
1995
+ }
1996
+
1997
+ has(key) {
1998
+ return this.dict.has(key);
1999
+ }
2000
+
2001
+ delete(key) {
2002
+ return this.dict.delete(key);
2003
+ }
2004
+
2005
+ *[Symbol.iterator]() {
2006
+ for (const {
2007
+ 0: k,
2008
+ 1: vs
2009
+ } of this.dict) {
2010
+ while (!vs.isEmpty()) {
2011
+ yield [k, vs.pop()];
2012
+ }
2013
+ }
2014
+
2015
+ return;
2016
+ }
2017
+
2018
+ }
2019
+
2020
+ exports.MultiQueue = MultiQueue;
2021
+
2001
2022
  /***/ }),
2002
2023
 
2003
2024
  /***/ 7325:
@@ -2015,8 +2036,8 @@ const global_1 = __webpack_require__(4128);
2015
2036
 
2016
2037
  const radixes = Object.freeze([...Array(7)].map((_, i) => 1 << i));
2017
2038
  const masks = Object.freeze(radixes.map(radix => radix - 1));
2018
- const dict0_ = Object.freeze([...[...Array(36)].map((_, i) => i.toString(36)), ...[...Array(36)].map((_, i) => i.toString(36).toUpperCase()).slice(-26), '-', '_']);
2019
- const dictAz = Object.freeze([...[...Array(36)].map((_, i) => i.toString(36).toUpperCase()).slice(-26), ...[...Array(36)].map((_, i) => i.toString(36)).slice(-26)]);
2039
+ const dict0_ = [...[...Array(36)].map((_, i) => i.toString(36)), ...[...Array(36)].map((_, i) => i.toString(36).toUpperCase()).slice(-26), '-', '_'].join('');
2040
+ const dictAz = [...[...Array(36)].map((_, i) => i.toString(36).toUpperCase()).slice(-26), ...[...Array(36)].map((_, i) => i.toString(36)).slice(-26)].join('');
2020
2041
  exports.rnd16 = cons(16);
2021
2042
  exports.rnd32 = cons(32);
2022
2043
  exports.rnd62 = cons(62);
@@ -2084,264 +2105,35 @@ function conv(rnd, dict) {
2084
2105
  let acc = '';
2085
2106
 
2086
2107
  while (len--) {
2087
- acc += dict[rnd()];
2088
- }
2089
-
2090
- return acc;
2091
- };
2092
- }
2093
-
2094
- const buffer = new Uint16Array(512);
2095
- const digit = 16;
2096
- let index = buffer.length;
2097
- let offset = digit;
2098
-
2099
- function random(len) {
2100
- if (index === buffer.length) {
2101
- global_1.crypto.getRandomValues(buffer);
2102
- index = 0;
2103
- }
2104
-
2105
- if (offset === len) {
2106
- offset = digit;
2107
- return buffer[index++] & masks[len];
2108
- } else if (offset > len) {
2109
- offset -= len;
2110
- return buffer[index] >> offset & masks[len];
2111
- } else {
2112
- offset = digit;
2113
- ++index;
2114
- return random(len);
2115
- }
2116
- }
2117
-
2118
- /***/ }),
2119
-
2120
- /***/ 6395:
2121
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2122
-
2123
- "use strict";
2124
-
2125
-
2126
- Object.defineProperty(exports, "__esModule", ({
2127
- value: true
2128
- }));
2129
- exports.Ring = void 0;
2130
-
2131
- const global_1 = __webpack_require__(4128);
2132
-
2133
- const alias_1 = __webpack_require__(5406);
2134
-
2135
- const array_1 = __webpack_require__(8112);
2136
-
2137
- const undefined = void 0;
2138
- const empty = Symbol('empty');
2139
-
2140
- const unempty = value => value === empty ? undefined : value;
2141
-
2142
- const space = Object.freeze((0, global_1.Array)(100).fill(empty));
2143
- let size = 16;
2144
-
2145
- class Ring {
2146
- constructor() {
2147
- this.array = (0, global_1.Array)(size);
2148
- this.head = 0;
2149
- this.tail = 0;
2150
- this.$length = 0;
2151
- this.excess = 0;
2152
- }
2153
-
2154
- get length() {
2155
- return this.$length;
2156
- }
2157
-
2158
- at(index) {
2159
- // Inline the code for optimization.
2160
- const array = this.array;
2161
-
2162
- if (index >= 0) {
2163
- if (index >= this.$length) return;
2164
- return unempty(array[(this.head - 1 + index) % array.length]);
2165
- } else {
2166
- if (-index > this.$length) return;
2167
- return this.tail + index >= 0 ? unempty(array[this.tail + index]) : unempty(array[array.length + this.tail + index]);
2168
- }
2169
- }
2170
-
2171
- replace(index, value, replacer) {
2172
- const array = this.array;
2173
-
2174
- if (index >= 0) {
2175
- if (index >= this.$length) throw new RangeError('Invalid index');
2176
- index = (this.head - 1 + index) % array.length;
2177
- } else {
2178
- if (-index > this.$length) throw new RangeError('Invalid index');
2179
- index = this.tail + index >= 0 ? this.tail + index : array.length + this.tail + index;
2180
- }
2181
-
2182
- const val = unempty(array[index]);
2183
- array[index] = replacer ? replacer(val, value) : value;
2184
- return val;
2185
- }
2186
-
2187
- push(value) {
2188
- const array = this.array;
2189
- let {
2190
- head,
2191
- tail
2192
- } = this;
2193
- tail = this.tail = next(head, tail, array.length);
2194
- head = this.head ||= tail;
2195
-
2196
- if (head === tail && this.$length !== 0) {
2197
- (0, array_1.splice)(array, tail - 1, 0, ...space);
2198
- head = this.head += space.length;
2199
- }
2200
-
2201
- array[tail - 1] = value;
2202
- ++this.$length;
2203
- }
2204
-
2205
- unshift(value) {
2206
- const array = this.array;
2207
- let {
2208
- head,
2209
- tail
2210
- } = this;
2211
- head = this.head = prev(head, tail, array.length);
2212
- tail = this.tail ||= head;
2213
-
2214
- if (head === tail && this.$length !== 0) {
2215
- (0, array_1.splice)(array, head, 0, ...space);
2216
- head = this.head += space.length;
2217
- }
2218
-
2219
- array[head - 1] = value;
2220
- ++this.$length;
2221
- }
2222
-
2223
- pop() {
2224
- if (this.$length === 0) return;
2225
- const array = this.array;
2226
- const i = this.tail - 1;
2227
- const value = unempty(array[i]);
2228
- array[i] = empty;
2229
- --this.$length === 0 ? this.head = this.tail = 0 : this.tail = this.tail === 1 ? array.length : this.tail - 1;
2230
- return value;
2231
- }
2232
-
2233
- shift() {
2234
- if (this.$length === 0) return;
2235
- const array = this.array;
2236
- const i = this.head - 1;
2237
- const value = unempty(array[i]);
2238
- array[i] = empty;
2239
- --this.$length === 0 ? this.head = this.tail = 0 : this.head = this.head === array.length ? 1 : this.head + 1;
2240
- return value;
2241
- }
2242
-
2243
- splice(index, count, ...values) {
2244
- const array = this.array;
2245
-
2246
- if (this.excess > 100 && array.length - this.$length > 200) {
2247
- (0, array_1.splice)(array, 0, 100 - (0, array_1.splice)(array, this.tail, 100).length);
2248
- this.excess -= 100;
2249
- } else if (-this.excess > array.length * 2) {
2250
- this.excess = array.length;
2251
- }
2252
-
2253
- index = index < 0 ? (0, alias_1.max)(0, this.$length + index) : index <= this.$length ? index : this.$length;
2254
- count = (0, alias_1.min)((0, alias_1.max)(count, 0), this.$length - index);
2255
-
2256
- if (values.length === 0) {
2257
- if (count === 0) return [];
2258
-
2259
- switch (index) {
2260
- case 0:
2261
- if (count === 1) return [this.shift()];
2262
- break;
2263
-
2264
- case this.$length - 1:
2265
- if (count === 1) return [this.pop()];
2266
- break;
2267
-
2268
- case this.$length:
2269
- return [];
2270
- }
2271
- }
2272
-
2273
- index = (this.head || 1) - 1 + index;
2274
- index = index > array.length ? index % array.length : index;
2275
- this.excess += values.length - count;
2276
- this.$length += values.length - count; // |--H>*>T--|
2277
-
2278
- if (this.head <= this.tail) {
2279
- this.tail += values.length - count;
2280
- return (0, array_1.splice)(array, index, count, ...values);
2281
- } // |*>T---H>>|
2282
-
2283
-
2284
- if (index < this.tail) {
2285
- this.head += values.length - count;
2286
- this.tail += values.length - count;
2287
- return (0, array_1.splice)(array, index, count, ...values);
2288
- } // |>>T---H>*|
2289
-
2290
-
2291
- const cnt = (0, alias_1.min)(count, array.length - index);
2292
- const vs = (0, array_1.splice)(array, index, cnt, ...(0, array_1.splice)(values, 0, cnt));
2293
- vs.push(...(0, array_1.splice)(array, 0, count - vs.length, ...values));
2294
- return vs;
2295
- }
2296
-
2297
- clear() {
2298
- this.array = (0, global_1.Array)(size);
2299
- this.$length = this.head = this.tail = 0;
2300
- }
2301
-
2302
- includes(value) {
2303
- return this.array.includes(value);
2304
- }
2305
-
2306
- relational(index) {
2307
- if (index === -1) return -1;
2308
- return index + 1 >= this.head ? index + 1 - this.head : this.array.length - this.head + index;
2309
- }
2310
-
2311
- indexOf(value) {
2312
- return this.relational((0, array_1.indexOf)(this.array, value));
2313
- }
2314
-
2315
- findIndex(f) {
2316
- return this.relational(this.array.findIndex(value => value !== empty && f(value)));
2317
- }
2318
-
2319
- find(f) {
2320
- return unempty(this.array.find(value => value !== empty && f(value)));
2321
- }
2322
-
2323
- toArray() {
2324
- return this.head <= this.tail ? this.array.slice((this.head || 1) - 1, this.tail) : this.array.slice((this.head || 1) - 1).concat(this.array.slice(0, this.tail));
2325
- }
2326
-
2327
- *[Symbol.iterator]() {
2328
- for (let i = 0; i < this.$length; ++i) {
2329
- yield this.at(i);
2330
- }
2331
-
2332
- return;
2333
- }
2108
+ acc += dict[rnd()];
2109
+ }
2334
2110
 
2111
+ return acc;
2112
+ };
2335
2113
  }
2336
2114
 
2337
- exports.Ring = Ring;
2115
+ const buffer = new Uint16Array(512);
2116
+ const digit = 16;
2117
+ let index = buffer.length;
2118
+ let offset = digit;
2338
2119
 
2339
- function next(head, tail, length) {
2340
- return tail === length && head !== 1 ? 1 : tail + 1;
2341
- }
2120
+ function random(len) {
2121
+ if (index === buffer.length) {
2122
+ global_1.crypto.getRandomValues(buffer);
2123
+ index = 0;
2124
+ }
2342
2125
 
2343
- function prev(head, tail, length) {
2344
- return head === 0 || head === 1 ? tail === length ? length + 1 : length : head - 1;
2126
+ if (offset === len) {
2127
+ offset = digit;
2128
+ return buffer[index++] & masks[len];
2129
+ } else if (offset > len) {
2130
+ offset -= len;
2131
+ return buffer[index] >> offset & masks[len];
2132
+ } else {
2133
+ offset = digit;
2134
+ ++index;
2135
+ return random(len);
2136
+ }
2345
2137
  }
2346
2138
 
2347
2139
  /***/ }),
@@ -7150,8 +6942,6 @@ const combinator_1 = __webpack_require__(2087);
7150
6942
 
7151
6943
  const dom_1 = __webpack_require__(3252);
7152
6944
 
7153
- const query_1 = __webpack_require__(6120);
7154
-
7155
6945
  function indexee(parser, optional) {
7156
6946
  return (0, combinator_1.fmap)(parser, ([el], _, {
7157
6947
  id
@@ -7176,7 +6966,7 @@ function text(source, optional = false) {
7176
6966
  if (index) return index;
7177
6967
  const target = source.cloneNode(true);
7178
6968
 
7179
- for (let es = (0, query_1.querySelectorAll)(target, 'code[data-src], .math[data-src], .comment, rt, rp, .reference, .checkbox, ul, ol'), i = 0; i < es.length; ++i) {
6969
+ for (let es = target.querySelectorAll('code[data-src], .math[data-src], .comment, rt, rp, .reference, .checkbox, ul, ol'), len = es.length, i = 0; i < len; ++i) {
7180
6970
  const el = es[i];
7181
6971
 
7182
6972
  switch (el.tagName) {
@@ -8147,14 +7937,12 @@ const ja_1 = __webpack_require__(1499);
8147
7937
 
8148
7938
  const dom_1 = __webpack_require__(3252);
8149
7939
 
8150
- const query_1 = __webpack_require__(6120);
8151
-
8152
7940
  function localize(parser) {
8153
7941
  return (0, combinator_1.fmap)(parser, ns => {
8154
7942
  if (ns.length === 0) return ns;
8155
7943
  const el = ns.length === 1 && typeof ns[0] === 'object' ? ns[0] : (0, dom_1.html)('div', ns);
8156
7944
 
8157
- for (let es = (0, query_1.querySelectorAll)(el, '.linebreak:not(:empty)'), i = 0; i < es.length; ++i) {
7945
+ for (let es = el.querySelectorAll('.linebreak:not(:empty)'), len = es.length, i = 0; i < len; ++i) {
8158
7946
  const el = es[i];
8159
7947
  if (!check(el)) continue;
8160
7948
  el.firstChild.remove();
@@ -8245,7 +8033,7 @@ const global_1 = __webpack_require__(4128);
8245
8033
 
8246
8034
  const label_1 = __webpack_require__(466);
8247
8035
 
8248
- const multimap_1 = __webpack_require__(940);
8036
+ const queue_1 = __webpack_require__(4934);
8249
8037
 
8250
8038
  const array_1 = __webpack_require__(8112);
8251
8039
 
@@ -8254,15 +8042,15 @@ const dom_1 = __webpack_require__(3252);
8254
8042
  const query_1 = __webpack_require__(6120);
8255
8043
 
8256
8044
  function* figure(target, footnotes, opts = {}) {
8257
- const refs = new multimap_1.MultiMap((0, array_1.push)((0, query_1.querySelectorAll)(target, 'a.label:not(.disabled)[data-label]'), footnotes && (0, query_1.querySelectorAll)(footnotes.references, 'a.label:not(.disabled)') || []).map(el => [el.getAttribute('data-label'), el]));
8045
+ const refs = new queue_1.MultiQueue((0, array_1.push)((0, query_1.querySelectorAll)(target, 'a.label:not(.disabled)[data-label]'), footnotes && (0, query_1.querySelectorAll)(footnotes.references, 'a.label:not(.disabled)') || []).map(el => [el.getAttribute('data-label'), el]));
8258
8046
  const labels = new global_1.Set();
8259
8047
  const numbers = new global_1.Map();
8260
8048
  let base = '0';
8261
8049
  let bases = base.split('.');
8262
8050
  let index = bases; // Bug: Firefox
8263
- //for (let defs = querySelectorAll(target, ':scope > figure[data-label], :scope > h1, :scope > h2'), len = defs.length, i = 0; i < len; ++i) {
8051
+ //for (let defs = target.querySelectorAll(':scope > figure[data-label], :scope > h1, :scope > h2'), len = defs.length, i = 0; i < len; ++i) {
8264
8052
 
8265
- for (let defs = (0, query_1.querySelectorAll)(target, 'figure[data-label], h1, h2'), len = defs.length, i = 0; i < len; ++i) {
8053
+ for (let defs = target.querySelectorAll('figure[data-label], h1, h2'), len = defs.length, i = 0; i < len; ++i) {
8266
8054
  yield;
8267
8055
  const def = defs[i];
8268
8056
  if (def.parentNode !== target) continue;
@@ -8444,16 +8232,14 @@ const global_1 = __webpack_require__(4128);
8444
8232
 
8445
8233
  const indexee_1 = __webpack_require__(1269);
8446
8234
 
8447
- const multimap_1 = __webpack_require__(940);
8235
+ const queue_1 = __webpack_require__(4934);
8448
8236
 
8449
8237
  const dom_1 = __webpack_require__(3252);
8450
8238
 
8451
- const query_1 = __webpack_require__(6120);
8452
-
8453
8239
  function* footnote(target, footnotes, opts = {}, bottom = null) {
8454
8240
  // Bug: Firefox
8455
- //querySelectorAll(target, `:scope > .annotations`).forEach(el => el.remove());
8456
- for (let es = (0, query_1.querySelectorAll)(target, `.annotations`), i = 0; i < es.length; ++i) {
8241
+ //target.querySelectorAll(`:scope > .annotations`).forEach(el => el.remove());
8242
+ for (let es = target.querySelectorAll(`.annotations`), len = es.length, i = 0; i < len; ++i) {
8457
8243
  const el = es[i];
8458
8244
  el.parentNode === target && el.remove();
8459
8245
  }
@@ -8472,13 +8258,13 @@ function build(syntax, marker, splitter) {
8472
8258
  // 構文ごとに各1回の処理では不可能
8473
8259
  return function* (target, footnote, opts = {}, bottom = null) {
8474
8260
  const defs = new global_1.Map();
8475
- const buffer = new multimap_1.MultiMap();
8261
+ const buffer = new queue_1.MultiQueue();
8476
8262
  const titles = new global_1.Map(); // Bug: Firefox
8477
- //const splitters = push([], querySelectorAll(target, `:scope > :is(${splitter ?? '_'})`));
8263
+ //const splitters = push([], target.querySelectorAll(`:scope > :is(${splitter ?? '_'})`));
8478
8264
 
8479
8265
  const splitters = [];
8480
8266
 
8481
- for (let es = (0, query_1.querySelectorAll)(target, splitter ?? '_'), i = 0; i < es.length; ++i) {
8267
+ for (let es = target.querySelectorAll(splitter ?? '_'), len = es.length, i = 0; i < len; ++i) {
8482
8268
  const el = es[i];
8483
8269
  el.parentNode === target && splitters.push(el);
8484
8270
  }
@@ -8487,7 +8273,7 @@ function build(syntax, marker, splitter) {
8487
8273
  let total = 0;
8488
8274
  let style;
8489
8275
 
8490
- for (let refs = (0, query_1.querySelectorAll)(target, `sup.${syntax}:not(.disabled)`), len = refs.length, i = 0; i < len; ++i) {
8276
+ for (let refs = target.querySelectorAll(`sup.${syntax}:not(.disabled)`), len = refs.length, i = 0; i < len; ++i) {
8491
8277
  yield;
8492
8278
  const ref = refs[i];
8493
8279
 
@@ -9838,8 +9624,6 @@ exports.info = void 0;
9838
9624
 
9839
9625
  const scope_1 = __webpack_require__(5202);
9840
9626
 
9841
- const query_1 = __webpack_require__(6120);
9842
-
9843
9627
  function info(source) {
9844
9628
  const match = (0, scope_1.scope)(source, '.invalid');
9845
9629
  return {
@@ -9858,7 +9642,7 @@ function info(source) {
9858
9642
  function find(selector) {
9859
9643
  const acc = [];
9860
9644
 
9861
- for (let es = (0, query_1.querySelectorAll)(source, selector), i = 0; i < es.length; ++i) {
9645
+ for (let es = source.querySelectorAll(selector), len = es.length, i = 0; i < len; ++i) {
9862
9646
  const el = es[i];
9863
9647
  match(el) && acc.push(el);
9864
9648
  }
@@ -9890,8 +9674,6 @@ const cite_1 = __webpack_require__(6315);
9890
9674
 
9891
9675
  const dom_1 = __webpack_require__(3252);
9892
9676
 
9893
- const query_1 = __webpack_require__(6120);
9894
-
9895
9677
  function quote(anchor, range) {
9896
9678
  if ((0, parser_1.exec)((0, cite_1.cite)({
9897
9679
  source: `>>${anchor}`,
@@ -9901,7 +9683,7 @@ function quote(anchor, range) {
9901
9683
  const node = trim(range.cloneContents());
9902
9684
  if (!node.firstChild) return '';
9903
9685
 
9904
- for (let es = (0, query_1.querySelectorAll)(node, 'code[data-src], .math[data-src], .media[data-src], rt, rp'), i = 0; i < es.length; ++i) {
9686
+ for (let es = node.querySelectorAll('code[data-src], .math[data-src], .media[data-src], rt, rp'), len = es.length, i = 0; i < len; ++i) {
9905
9687
  const el = es[i];
9906
9688
 
9907
9689
  switch (true) {
@@ -9927,7 +9709,7 @@ function quote(anchor, range) {
9927
9709
  anchor = '';
9928
9710
  }
9929
9711
 
9930
- for (let es = (0, query_1.querySelectorAll)(node, 'br'), i = 0; i < es.length; ++i) {
9712
+ for (let es = node.querySelectorAll('br'), len = es.length, i = 0; i < len; ++i) {
9931
9713
  const el = es[i];
9932
9714
 
9933
9715
  if (anchor && el.nextSibling instanceof global_1.Element && el.nextSibling.matches('.cite, .quote')) {
@@ -10037,10 +9819,8 @@ const global_1 = __webpack_require__(4128);
10037
9819
 
10038
9820
  const array_1 = __webpack_require__(8112);
10039
9821
 
10040
- const dom_1 = __webpack_require__(3252);
10041
-
10042
- const query_1 = __webpack_require__(6120); // Bug: Firefox
10043
- //const selector = 'h1 h2 h3 h4 h5 h6 aside.aside'.split(' ').map(s => `:scope > ${s}[id]`).join();
9822
+ const dom_1 = __webpack_require__(3252); // Bug: Firefox
9823
+ //const selector = `:scope > :is(h1, h2, h3, h4, h5, h6, aside.aside)[id]`;
10044
9824
 
10045
9825
 
10046
9826
  const selector = ':is(h1, h2, h3, h4, h5, h6, aside.aside)[id]';
@@ -10048,7 +9828,7 @@ const selector = ':is(h1, h2, h3, h4, h5, h6, aside.aside)[id]';
10048
9828
  function toc(source) {
10049
9829
  const hs = [];
10050
9830
 
10051
- for (let es = (0, query_1.querySelectorAll)(source, selector), i = 0; i < es.length; ++i) {
9831
+ for (let es = source.querySelectorAll(selector), len = es.length, i = 0; i < len; ++i) {
10052
9832
  const el = es[i];
10053
9833
 
10054
9834
  switch (el.tagName) {
@@ -10107,7 +9887,7 @@ function unlink(h) {
10107
9887
  /***/ 3252:
10108
9888
  /***/ (function(module) {
10109
9889
 
10110
- /*! typed-dom v0.0.307 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | (Apache-2.0 AND MPL-2.0) License */
9890
+ /*! typed-dom v0.0.309 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | (Apache-2.0 AND MPL-2.0) License */
10111
9891
  (function webpackUniversalModuleDefinition(root, factory) {
10112
9892
  if(true)
10113
9893
  module.exports = factory();
@@ -10539,7 +10319,7 @@ exports.defrag = defrag;
10539
10319
  /***/ 6120:
10540
10320
  /***/ (function(module) {
10541
10321
 
10542
- /*! typed-dom v0.0.307 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | (Apache-2.0 AND MPL-2.0) License */
10322
+ /*! typed-dom v0.0.309 https://github.com/falsandtru/typed-dom | (c) 2016, falsandtru | (Apache-2.0 AND MPL-2.0) License */
10543
10323
  (function webpackUniversalModuleDefinition(root, factory) {
10544
10324
  if(true)
10545
10325
  module.exports = factory();
@@ -10547,220 +10327,8 @@ exports.defrag = defrag;
10547
10327
  })(this, () => {
10548
10328
  return /******/ (() => { // webpackBootstrap
10549
10329
  /******/ "use strict";
10550
- /******/ var __webpack_modules__ = ({
10551
-
10552
- /***/ 99:
10553
- /***/ ((__unused_webpack_module, exports) => {
10554
-
10555
-
10556
-
10557
- Object.defineProperty(exports, "__esModule", ({
10558
- value: true
10559
- }));
10560
- exports.duffReduce = exports.duffEach = exports.duffbk = exports.duff = void 0; // 100,000以上でforより大幅に低速となり実用不可
10561
-
10562
- function duff(count, proc) {
10563
- if (count > 0) {
10564
- let i = 0,
10565
- m = count & 7,
10566
- d = (count - m) / 8;
10567
-
10568
- while (m--) {
10569
- proc(i++);
10570
- }
10571
-
10572
- while (d--) {
10573
- proc(i++);
10574
- proc(i++);
10575
- proc(i++);
10576
- proc(i++);
10577
- proc(i++);
10578
- proc(i++);
10579
- proc(i++);
10580
- proc(i++);
10581
- }
10582
- } else {
10583
- let i = -count,
10584
- m = i & 7,
10585
- d = (i - m) / 8;
10586
-
10587
- while (m--) {
10588
- proc(--i);
10589
- }
10590
-
10591
- while (d--) {
10592
- proc(--i);
10593
- proc(--i);
10594
- proc(--i);
10595
- proc(--i);
10596
- proc(--i);
10597
- proc(--i);
10598
- proc(--i);
10599
- proc(--i);
10600
- }
10601
- }
10602
- }
10603
-
10604
- exports.duff = duff; // 100,000以上でforより大幅に低速となり実用不可
10605
-
10606
- function duffbk(count, proc) {
10607
- if (count > 0) {
10608
- let i = 0,
10609
- m = count & 7,
10610
- d = (count - m) / 8;
10611
-
10612
- while (m--) {
10613
- if (proc(i++) === false) return;
10614
- }
10615
-
10616
- while (d--) {
10617
- switch (false) {
10618
- case proc(i++):
10619
- case proc(i++):
10620
- case proc(i++):
10621
- case proc(i++):
10622
- case proc(i++):
10623
- case proc(i++):
10624
- case proc(i++):
10625
- case proc(i++):
10626
- return;
10627
- }
10628
- }
10629
- } else {
10630
- let i = -count,
10631
- m = i & 7,
10632
- d = (i - m) / 8;
10633
-
10634
- while (m--) {
10635
- if (proc(--i) === false) return;
10636
- }
10637
-
10638
- while (d--) {
10639
- switch (false) {
10640
- case proc(--i):
10641
- case proc(--i):
10642
- case proc(--i):
10643
- case proc(--i):
10644
- case proc(--i):
10645
- case proc(--i):
10646
- case proc(--i):
10647
- case proc(--i):
10648
- return;
10649
- }
10650
- }
10651
- }
10652
- }
10653
-
10654
- exports.duffbk = duffbk;
10655
-
10656
- function duffEach(array, proc) {
10657
- let count = array.length;
10658
- let i = 0,
10659
- m = count & 7,
10660
- d = (count - m) / 8;
10661
-
10662
- while (m--) {
10663
- proc(array[i], i++, array);
10664
- }
10665
-
10666
- while (d--) {
10667
- proc(array[i], i++, array);
10668
- proc(array[i], i++, array);
10669
- proc(array[i], i++, array);
10670
- proc(array[i], i++, array);
10671
- proc(array[i], i++, array);
10672
- proc(array[i], i++, array);
10673
- proc(array[i], i++, array);
10674
- proc(array[i], i++, array);
10675
- }
10676
- }
10677
-
10678
- exports.duffEach = duffEach; // ベンチマークの10,000以上で急激な速度低下が見られる場合があるがNodeListなどでの
10679
- // 実際の使用では速度低下は見られない
10680
-
10681
- function duffReduce(array, proc, initial) {
10682
- let count = array.length;
10683
- let i = 0,
10684
- m = count & 7,
10685
- d = (count - m) / 8;
10686
- let acc = initial;
10687
-
10688
- while (m--) {
10689
- acc = proc(acc, array[i], i++, array);
10690
- }
10691
-
10692
- while (d--) {
10693
- acc = proc(acc, array[i], i++, array);
10694
- acc = proc(acc, array[i], i++, array);
10695
- acc = proc(acc, array[i], i++, array);
10696
- acc = proc(acc, array[i], i++, array);
10697
- acc = proc(acc, array[i], i++, array);
10698
- acc = proc(acc, array[i], i++, array);
10699
- acc = proc(acc, array[i], i++, array);
10700
- acc = proc(acc, array[i], i++, array);
10701
- }
10702
-
10703
- return acc;
10704
- }
10705
-
10706
- exports.duffReduce = duffReduce;
10707
-
10708
- /***/ }),
10709
-
10710
- /***/ 128:
10711
- /***/ ((module, __unused_webpack_exports, __nested_webpack_require_3627__) => {
10712
-
10713
-
10714
-
10715
- __nested_webpack_require_3627__(921);
10716
-
10717
- const global = void 0 || typeof globalThis !== 'undefined' && globalThis // @ts-ignore
10718
- || typeof self !== 'undefined' && self || Function('return this')();
10719
- global.global = global;
10720
- module.exports = global;
10721
-
10722
- /***/ }),
10723
-
10724
- /***/ 921:
10725
- /***/ (() => {
10726
-
10727
- // @ts-ignore
10728
-
10729
- var globalThis; // @ts-ignore
10730
-
10731
- var global = (/* unused pure expression or super */ null && (0));
10732
-
10733
- /***/ })
10734
-
10735
- /******/ });
10736
- /************************************************************************/
10737
- /******/ // The module cache
10738
- /******/ var __webpack_module_cache__ = {};
10739
- /******/
10740
- /******/ // The require function
10741
- /******/ function __nested_webpack_require_4279__(moduleId) {
10742
- /******/ // Check if module is in cache
10743
- /******/ var cachedModule = __webpack_module_cache__[moduleId];
10744
- /******/ if (cachedModule !== undefined) {
10745
- /******/ return cachedModule.exports;
10746
- /******/ }
10747
- /******/ // Create a new module (and put it into the cache)
10748
- /******/ var module = __webpack_module_cache__[moduleId] = {
10749
- /******/ // no module.id needed
10750
- /******/ // no module.loaded needed
10751
- /******/ exports: {}
10752
- /******/ };
10753
- /******/
10754
- /******/ // Execute the module function
10755
- /******/ __webpack_modules__[moduleId](module, module.exports, __nested_webpack_require_4279__);
10756
- /******/
10757
- /******/ // Return the exports of the module
10758
- /******/ return module.exports;
10759
- /******/ }
10760
- /******/
10761
- /************************************************************************/
10762
10330
  var __webpack_exports__ = {};
10763
- // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
10331
+ // This entry need to be wrapped in an IIFE because it uses a non-standard name for the exports (exports).
10764
10332
  (() => {
10765
10333
  var exports = __webpack_exports__;
10766
10334
 
@@ -10770,10 +10338,6 @@ Object.defineProperty(exports, "__esModule", ({
10770
10338
  }));
10771
10339
  exports.querySelectorAll = exports.querySelectorAllWith = exports.querySelectorWith = void 0;
10772
10340
 
10773
- const global_1 = __nested_webpack_require_4279__(128);
10774
-
10775
- const duff_1 = __nested_webpack_require_4279__(99);
10776
-
10777
10341
  function querySelectorWith(node, selector) {
10778
10342
  return 'matches' in node && node.matches(selector) ? node : node.querySelector(selector);
10779
10343
  }
@@ -10787,13 +10351,23 @@ function querySelectorAllWith(node, selector) {
10787
10351
  acc.push(node);
10788
10352
  }
10789
10353
 
10790
- return (0, duff_1.duffReduce)(node.querySelectorAll(selector), (acc, el) => (acc.push(el), acc), acc);
10354
+ for (let es = node.querySelectorAll(selector), len = es.length, i = 0; i < len; ++i) {
10355
+ acc.push(es[i]);
10356
+ }
10357
+
10358
+ return acc;
10791
10359
  }
10792
10360
 
10793
10361
  exports.querySelectorAllWith = querySelectorAllWith;
10794
10362
 
10795
10363
  function querySelectorAll(node, selector) {
10796
- return (0, duff_1.duffReduce)(node.querySelectorAll(selector), (acc, el) => (acc.push(el), acc), (0, global_1.Array)());
10364
+ const acc = [];
10365
+
10366
+ for (let es = node.querySelectorAll(selector), len = es.length, i = 0; i < len; ++i) {
10367
+ acc.push(es[i]);
10368
+ }
10369
+
10370
+ return acc;
10797
10371
  }
10798
10372
 
10799
10373
  exports.querySelectorAll = querySelectorAll;