pervert-monkey 1.0.11 → 1.0.13
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/README.md +22 -11
- package/dist/core/pervertmonkey.core.es.d.ts +25 -16
- package/dist/core/pervertmonkey.core.es.js +712 -61
- package/dist/core/pervertmonkey.core.es.js.map +1 -1
- package/dist/core/pervertmonkey.core.umd.js +712 -61
- package/dist/core/pervertmonkey.core.umd.js.map +1 -1
- package/dist/userscripts/3hentai.user.js +19 -26
- package/dist/userscripts/camgirlfinder.user.js +2 -2
- package/dist/userscripts/camwhores.user.js +12 -16
- package/dist/userscripts/e-hentai.user.js +3 -4
- package/dist/userscripts/ebalka.user.js +6 -11
- package/dist/userscripts/eporner.user.js +11 -16
- package/dist/userscripts/erome.user.js +2 -2
- package/dist/userscripts/eroprofile.user.js +2 -2
- package/dist/userscripts/javhdporn.user.js +2 -2
- package/dist/userscripts/missav.user.js +2 -2
- package/dist/userscripts/motherless.user.js +22 -42
- package/dist/userscripts/namethatporn.user.js +5 -4
- package/dist/userscripts/nhentai.user.js +3 -3
- package/dist/userscripts/obmenvsem.user.js +18 -4
- package/dist/userscripts/pornhub.user.js +9 -12
- package/dist/userscripts/spankbang.user.js +6 -38
- package/dist/userscripts/thisvid.user.js +20 -22
- package/dist/userscripts/xhamster.user.js +13 -16
- package/dist/userscripts/xvideos.user.js +7 -12
- package/package.json +1 -1
- package/src/core/data-handler/data-manager.ts +4 -4
- package/src/core/jabroni-config/index.ts +3 -2
- package/src/core/jabroni-config/jabroni-gui-controller.ts +61 -0
- package/src/core/parsers/thumb-data-parser.ts +10 -1
- package/src/core/rules/index.ts +12 -39
- package/src/userscripts/index.ts +1 -1
- package/src/userscripts/scripts/3hentai.ts +20 -24
- package/src/userscripts/scripts/camgirlfinder.ts +1 -1
- package/src/userscripts/scripts/camwhores.ts +10 -17
- package/src/userscripts/scripts/e-hentai.ts +1 -1
- package/src/userscripts/scripts/ebalka.ts +7 -12
- package/src/userscripts/scripts/eporner.ts +8 -14
- package/src/userscripts/scripts/erome.ts +1 -1
- package/src/userscripts/scripts/eroprofile.ts +3 -3
- package/src/userscripts/scripts/javhdporn.ts +1 -1
- package/src/userscripts/scripts/missav.ts +1 -1
- package/src/userscripts/scripts/motherless.ts +19 -48
- package/src/userscripts/scripts/namethatporn.ts +1 -1
- package/src/userscripts/scripts/nhentai.ts +1 -1
- package/src/userscripts/scripts/obmenvsem.ts +1 -1
- package/src/userscripts/scripts/pornhub.ts +1 -1
- package/src/userscripts/scripts/spankbang.ts +1 -1
- package/src/userscripts/scripts/thisvid.ts +18 -19
- package/src/userscripts/scripts/xhamster.ts +10 -11
- package/src/userscripts/scripts/xvideos.ts +6 -11
- package/src/utils/dom/index.ts +10 -0
- package/src/utils/events/on-hover.ts +17 -25
- package/src/utils/events/tick.ts +1 -3
- package/src/utils/parsers/index.ts +16 -0
|
@@ -245,36 +245,28 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
245
245
|
});
|
|
246
246
|
}
|
|
247
247
|
class OnHover {
|
|
248
|
-
constructor(container,
|
|
248
|
+
constructor(container, targetSelector, onOver) {
|
|
249
249
|
__publicField(this, "target");
|
|
250
|
-
__publicField(this, "
|
|
251
|
-
__publicField(this, "onOverFinally");
|
|
250
|
+
__publicField(this, "onOverCallback");
|
|
252
251
|
this.container = container;
|
|
253
|
-
this.
|
|
252
|
+
this.targetSelector = targetSelector;
|
|
254
253
|
this.onOver = onOver;
|
|
255
|
-
this.
|
|
256
|
-
this.container.addEventListener("pointerover", (e) => this.handleEvent(e));
|
|
254
|
+
this.container.addEventListener("pointerover", (e) => this.handleHover(e));
|
|
257
255
|
}
|
|
258
|
-
|
|
259
|
-
var _a3
|
|
260
|
-
(_a3 = this.
|
|
261
|
-
|
|
256
|
+
handleLeave() {
|
|
257
|
+
var _a3;
|
|
258
|
+
(_a3 = this.onOverCallback) == null ? void 0 : _a3.call(this);
|
|
259
|
+
this.onOverCallback = void 0;
|
|
262
260
|
this.target = void 0;
|
|
263
|
-
this.onOverFinally = void 0;
|
|
264
|
-
this.leaveSubject = void 0;
|
|
265
261
|
}
|
|
266
|
-
|
|
262
|
+
handleHover(e) {
|
|
267
263
|
var _a3;
|
|
268
|
-
const
|
|
269
|
-
if (!
|
|
270
|
-
(_a3 = this.
|
|
271
|
-
this.target =
|
|
272
|
-
|
|
273
|
-
this.
|
|
274
|
-
this.leaveSubject = (result == null ? void 0 : result.leaveTarget) || this.target;
|
|
275
|
-
this.leaveSubject.addEventListener("pointerleave", (_2) => this.handleLeaveEvent(), {
|
|
276
|
-
once: true
|
|
277
|
-
});
|
|
264
|
+
const newTarget = e.target.closest(this.targetSelector);
|
|
265
|
+
if (!newTarget || this.target === newTarget) return;
|
|
266
|
+
(_a3 = this.target) == null ? void 0 : _a3.dispatchEvent(new PointerEvent("pointerleave"));
|
|
267
|
+
this.target = newTarget;
|
|
268
|
+
this.onOverCallback = this.onOver(this.target);
|
|
269
|
+
this.target.addEventListener("pointerleave", () => this.handleLeave(), { once: true });
|
|
278
270
|
}
|
|
279
271
|
static create(...args) {
|
|
280
272
|
return new OnHover(...args);
|
|
@@ -294,12 +286,11 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
294
286
|
this.tick = window.setInterval(callback, this.delay);
|
|
295
287
|
}
|
|
296
288
|
stop() {
|
|
289
|
+
var _a3;
|
|
297
290
|
if (this.tick !== void 0) {
|
|
298
291
|
clearInterval(this.tick);
|
|
299
292
|
this.tick = void 0;
|
|
300
|
-
|
|
301
|
-
if (this.callbackFinal) {
|
|
302
|
-
this.callbackFinal();
|
|
293
|
+
(_a3 = this.callbackFinal) == null ? void 0 : _a3.call(this);
|
|
303
294
|
this.callbackFinal = void 0;
|
|
304
295
|
}
|
|
305
296
|
}
|
|
@@ -406,6 +397,18 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
406
397
|
const num = Number(n);
|
|
407
398
|
return Number.isSafeInteger(num) ? num : or2;
|
|
408
399
|
}
|
|
400
|
+
function parseNumberWithLetter(str) {
|
|
401
|
+
var _a3;
|
|
402
|
+
const multipliers = { k: 1e3, m: 1e6 };
|
|
403
|
+
const match = str.trim().match(/^([\d.]+)(\w)?$/);
|
|
404
|
+
if (!match) return 0;
|
|
405
|
+
const num = parseFloat(match[1]);
|
|
406
|
+
const suffix = (_a3 = match[2]) == null ? void 0 : _a3.toLowerCase();
|
|
407
|
+
if (suffix && suffix in multipliers) {
|
|
408
|
+
return num * multipliers[suffix];
|
|
409
|
+
}
|
|
410
|
+
return num;
|
|
411
|
+
}
|
|
409
412
|
function parseDataParams(str) {
|
|
410
413
|
const paramsStr = decodeURI(str.trim()).split(";");
|
|
411
414
|
return paramsStr.reduce(
|
|
@@ -527,7 +530,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
527
530
|
});
|
|
528
531
|
let DataFilter = _DataFilter;
|
|
529
532
|
class DataManager {
|
|
530
|
-
constructor(rules,
|
|
533
|
+
constructor(rules, parentHomogenity) {
|
|
531
534
|
__publicField(this, "data", /* @__PURE__ */ new Map());
|
|
532
535
|
__publicField(this, "lazyImgLoader", new LazyImgLoader(
|
|
533
536
|
(target) => !DataFilter.isFiltered(target)
|
|
@@ -536,13 +539,13 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
536
539
|
__publicField(this, "applyFilters", async (filters = {}, offset = 0) => {
|
|
537
540
|
const filtersToApply = this.dataFilter.selectFilters(filters);
|
|
538
541
|
if (filtersToApply.length === 0) return;
|
|
539
|
-
const
|
|
542
|
+
const iterator2 = this.data.values().drop(offset);
|
|
540
543
|
let finished = false;
|
|
541
544
|
await new Promise((resolve) => {
|
|
542
545
|
function runBatch(deadline) {
|
|
543
546
|
const updates = [];
|
|
544
547
|
while (deadline.timeRemaining() > 0) {
|
|
545
|
-
const { value, done } =
|
|
548
|
+
const { value, done } = iterator2.next();
|
|
546
549
|
finished = !!done;
|
|
547
550
|
if (done) break;
|
|
548
551
|
for (const f of filtersToApply) {
|
|
@@ -578,13 +581,13 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
578
581
|
const dataOffset = this.data.size;
|
|
579
582
|
const fragment = document.createDocumentFragment();
|
|
580
583
|
const parent = container || this.rules.container;
|
|
581
|
-
const homogenity = !!this.
|
|
584
|
+
const homogenity = !!this.parentHomogenity;
|
|
582
585
|
for (const thumbElement of thumbs) {
|
|
583
|
-
const url = this.rules.
|
|
586
|
+
const url = this.rules.thumbDataParser.getUrl(thumbElement);
|
|
584
587
|
if (!url || this.data.has(url) || parent !== container && (parent == null ? void 0 : parent.contains(thumbElement)) || homogenity && !checkHomogenity(
|
|
585
588
|
parent,
|
|
586
589
|
thumbElement.parentElement,
|
|
587
|
-
this.
|
|
590
|
+
this.parentHomogenity
|
|
588
591
|
)) {
|
|
589
592
|
if (removeDuplicates) thumbElement.remove();
|
|
590
593
|
continue;
|
|
@@ -604,7 +607,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
604
607
|
});
|
|
605
608
|
});
|
|
606
609
|
this.rules = rules;
|
|
607
|
-
this.
|
|
610
|
+
this.parentHomogenity = parentHomogenity;
|
|
608
611
|
this.dataFilter = new DataFilter(this.rules);
|
|
609
612
|
}
|
|
610
613
|
sortBy(key, direction = true) {
|
|
@@ -638,6 +641,102 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
638
641
|
}
|
|
639
642
|
d2.prototype = b2 === null ? Object.create(b2) : (__.prototype = b2.prototype, new __());
|
|
640
643
|
}
|
|
644
|
+
function __awaiter(thisArg, _arguments, P2, generator) {
|
|
645
|
+
function adopt(value) {
|
|
646
|
+
return value instanceof P2 ? value : new P2(function(resolve) {
|
|
647
|
+
resolve(value);
|
|
648
|
+
});
|
|
649
|
+
}
|
|
650
|
+
return new (P2 || (P2 = Promise))(function(resolve, reject) {
|
|
651
|
+
function fulfilled(value) {
|
|
652
|
+
try {
|
|
653
|
+
step(generator.next(value));
|
|
654
|
+
} catch (e) {
|
|
655
|
+
reject(e);
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
function rejected(value) {
|
|
659
|
+
try {
|
|
660
|
+
step(generator["throw"](value));
|
|
661
|
+
} catch (e) {
|
|
662
|
+
reject(e);
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
function step(result) {
|
|
666
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
667
|
+
}
|
|
668
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
669
|
+
});
|
|
670
|
+
}
|
|
671
|
+
function __generator(thisArg, body) {
|
|
672
|
+
var _2 = { label: 0, sent: function() {
|
|
673
|
+
if (t[0] & 1) throw t[1];
|
|
674
|
+
return t[1];
|
|
675
|
+
}, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
676
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
677
|
+
return this;
|
|
678
|
+
}), g;
|
|
679
|
+
function verb(n) {
|
|
680
|
+
return function(v2) {
|
|
681
|
+
return step([n, v2]);
|
|
682
|
+
};
|
|
683
|
+
}
|
|
684
|
+
function step(op2) {
|
|
685
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
686
|
+
while (g && (g = 0, op2[0] && (_2 = 0)), _2) try {
|
|
687
|
+
if (f = 1, y && (t = op2[0] & 2 ? y["return"] : op2[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op2[1])).done) return t;
|
|
688
|
+
if (y = 0, t) op2 = [op2[0] & 2, t.value];
|
|
689
|
+
switch (op2[0]) {
|
|
690
|
+
case 0:
|
|
691
|
+
case 1:
|
|
692
|
+
t = op2;
|
|
693
|
+
break;
|
|
694
|
+
case 4:
|
|
695
|
+
_2.label++;
|
|
696
|
+
return { value: op2[1], done: false };
|
|
697
|
+
case 5:
|
|
698
|
+
_2.label++;
|
|
699
|
+
y = op2[1];
|
|
700
|
+
op2 = [0];
|
|
701
|
+
continue;
|
|
702
|
+
case 7:
|
|
703
|
+
op2 = _2.ops.pop();
|
|
704
|
+
_2.trys.pop();
|
|
705
|
+
continue;
|
|
706
|
+
default:
|
|
707
|
+
if (!(t = _2.trys, t = t.length > 0 && t[t.length - 1]) && (op2[0] === 6 || op2[0] === 2)) {
|
|
708
|
+
_2 = 0;
|
|
709
|
+
continue;
|
|
710
|
+
}
|
|
711
|
+
if (op2[0] === 3 && (!t || op2[1] > t[0] && op2[1] < t[3])) {
|
|
712
|
+
_2.label = op2[1];
|
|
713
|
+
break;
|
|
714
|
+
}
|
|
715
|
+
if (op2[0] === 6 && _2.label < t[1]) {
|
|
716
|
+
_2.label = t[1];
|
|
717
|
+
t = op2;
|
|
718
|
+
break;
|
|
719
|
+
}
|
|
720
|
+
if (t && _2.label < t[2]) {
|
|
721
|
+
_2.label = t[2];
|
|
722
|
+
_2.ops.push(op2);
|
|
723
|
+
break;
|
|
724
|
+
}
|
|
725
|
+
if (t[2]) _2.ops.pop();
|
|
726
|
+
_2.trys.pop();
|
|
727
|
+
continue;
|
|
728
|
+
}
|
|
729
|
+
op2 = body.call(thisArg, _2);
|
|
730
|
+
} catch (e) {
|
|
731
|
+
op2 = [6, e];
|
|
732
|
+
y = 0;
|
|
733
|
+
} finally {
|
|
734
|
+
f = t = 0;
|
|
735
|
+
}
|
|
736
|
+
if (op2[0] & 5) throw op2[1];
|
|
737
|
+
return { value: op2[0] ? op2[1] : void 0, done: true };
|
|
738
|
+
}
|
|
739
|
+
}
|
|
641
740
|
function __values(o) {
|
|
642
741
|
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
643
742
|
if (m) return m.call(o);
|
|
@@ -675,6 +774,69 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
675
774
|
}
|
|
676
775
|
return to2.concat(ar2 || Array.prototype.slice.call(from));
|
|
677
776
|
}
|
|
777
|
+
function __await(v2) {
|
|
778
|
+
return this instanceof __await ? (this.v = v2, this) : new __await(v2);
|
|
779
|
+
}
|
|
780
|
+
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
781
|
+
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
782
|
+
var g = generator.apply(thisArg, _arguments || []), i, q2 = [];
|
|
783
|
+
return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function() {
|
|
784
|
+
return this;
|
|
785
|
+
}, i;
|
|
786
|
+
function awaitReturn(f) {
|
|
787
|
+
return function(v2) {
|
|
788
|
+
return Promise.resolve(v2).then(f, reject);
|
|
789
|
+
};
|
|
790
|
+
}
|
|
791
|
+
function verb(n, f) {
|
|
792
|
+
if (g[n]) {
|
|
793
|
+
i[n] = function(v2) {
|
|
794
|
+
return new Promise(function(a2, b2) {
|
|
795
|
+
q2.push([n, v2, a2, b2]) > 1 || resume(n, v2);
|
|
796
|
+
});
|
|
797
|
+
};
|
|
798
|
+
if (f) i[n] = f(i[n]);
|
|
799
|
+
}
|
|
800
|
+
}
|
|
801
|
+
function resume(n, v2) {
|
|
802
|
+
try {
|
|
803
|
+
step(g[n](v2));
|
|
804
|
+
} catch (e) {
|
|
805
|
+
settle(q2[0][3], e);
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
function step(r) {
|
|
809
|
+
r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q2[0][2], r);
|
|
810
|
+
}
|
|
811
|
+
function fulfill(value) {
|
|
812
|
+
resume("next", value);
|
|
813
|
+
}
|
|
814
|
+
function reject(value) {
|
|
815
|
+
resume("throw", value);
|
|
816
|
+
}
|
|
817
|
+
function settle(f, v2) {
|
|
818
|
+
if (f(v2), q2.shift(), q2.length) resume(q2[0][0], q2[0][1]);
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
function __asyncValues(o) {
|
|
822
|
+
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
823
|
+
var m = o[Symbol.asyncIterator], i;
|
|
824
|
+
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() {
|
|
825
|
+
return this;
|
|
826
|
+
}, i);
|
|
827
|
+
function verb(n) {
|
|
828
|
+
i[n] = o[n] && function(v2) {
|
|
829
|
+
return new Promise(function(resolve, reject) {
|
|
830
|
+
v2 = o[n](v2), settle(resolve, reject, v2.done, v2.value);
|
|
831
|
+
});
|
|
832
|
+
};
|
|
833
|
+
}
|
|
834
|
+
function settle(resolve, reject, d2, v2) {
|
|
835
|
+
Promise.resolve(v2).then(function(v3) {
|
|
836
|
+
resolve({ value: v3, done: d2 });
|
|
837
|
+
}, reject);
|
|
838
|
+
}
|
|
839
|
+
}
|
|
678
840
|
typeof SuppressedError === "function" ? SuppressedError : function(error, suppressed, message) {
|
|
679
841
|
var e = new Error(message);
|
|
680
842
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
@@ -1115,6 +1277,69 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
1115
1277
|
function isSubscriber(value) {
|
|
1116
1278
|
return value && value instanceof Subscriber || isObserver(value) && isSubscription(value);
|
|
1117
1279
|
}
|
|
1280
|
+
function hasLift(source) {
|
|
1281
|
+
return isFunction(source === null || source === void 0 ? void 0 : source.lift);
|
|
1282
|
+
}
|
|
1283
|
+
function operate(init) {
|
|
1284
|
+
return function(source) {
|
|
1285
|
+
if (hasLift(source)) {
|
|
1286
|
+
return source.lift(function(liftedSource) {
|
|
1287
|
+
try {
|
|
1288
|
+
return init(liftedSource, this);
|
|
1289
|
+
} catch (err) {
|
|
1290
|
+
this.error(err);
|
|
1291
|
+
}
|
|
1292
|
+
});
|
|
1293
|
+
}
|
|
1294
|
+
throw new TypeError("Unable to lift unknown Observable type");
|
|
1295
|
+
};
|
|
1296
|
+
}
|
|
1297
|
+
function createOperatorSubscriber(destination, onNext, onComplete, onError, onFinalize) {
|
|
1298
|
+
return new OperatorSubscriber(destination, onNext, onComplete, onError, onFinalize);
|
|
1299
|
+
}
|
|
1300
|
+
var OperatorSubscriber = (function(_super) {
|
|
1301
|
+
__extends(OperatorSubscriber2, _super);
|
|
1302
|
+
function OperatorSubscriber2(destination, onNext, onComplete, onError, onFinalize, shouldUnsubscribe) {
|
|
1303
|
+
var _this = _super.call(this, destination) || this;
|
|
1304
|
+
_this.onFinalize = onFinalize;
|
|
1305
|
+
_this.shouldUnsubscribe = shouldUnsubscribe;
|
|
1306
|
+
_this._next = onNext ? function(value) {
|
|
1307
|
+
try {
|
|
1308
|
+
onNext(value);
|
|
1309
|
+
} catch (err) {
|
|
1310
|
+
destination.error(err);
|
|
1311
|
+
}
|
|
1312
|
+
} : _super.prototype._next;
|
|
1313
|
+
_this._error = onError ? function(err) {
|
|
1314
|
+
try {
|
|
1315
|
+
onError(err);
|
|
1316
|
+
} catch (err2) {
|
|
1317
|
+
destination.error(err2);
|
|
1318
|
+
} finally {
|
|
1319
|
+
this.unsubscribe();
|
|
1320
|
+
}
|
|
1321
|
+
} : _super.prototype._error;
|
|
1322
|
+
_this._complete = onComplete ? function() {
|
|
1323
|
+
try {
|
|
1324
|
+
onComplete();
|
|
1325
|
+
} catch (err) {
|
|
1326
|
+
destination.error(err);
|
|
1327
|
+
} finally {
|
|
1328
|
+
this.unsubscribe();
|
|
1329
|
+
}
|
|
1330
|
+
} : _super.prototype._complete;
|
|
1331
|
+
return _this;
|
|
1332
|
+
}
|
|
1333
|
+
OperatorSubscriber2.prototype.unsubscribe = function() {
|
|
1334
|
+
var _a3;
|
|
1335
|
+
if (!this.shouldUnsubscribe || this.shouldUnsubscribe()) {
|
|
1336
|
+
var closed_1 = this.closed;
|
|
1337
|
+
_super.prototype.unsubscribe.call(this);
|
|
1338
|
+
!closed_1 && ((_a3 = this.onFinalize) === null || _a3 === void 0 ? void 0 : _a3.call(this));
|
|
1339
|
+
}
|
|
1340
|
+
};
|
|
1341
|
+
return OperatorSubscriber2;
|
|
1342
|
+
})(Subscriber);
|
|
1118
1343
|
var ObjectUnsubscribedError = createErrorClass(function(_super) {
|
|
1119
1344
|
return function ObjectUnsubscribedErrorImpl() {
|
|
1120
1345
|
_super(this);
|
|
@@ -1275,6 +1500,404 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
1275
1500
|
};
|
|
1276
1501
|
return AnonymousSubject2;
|
|
1277
1502
|
})(Subject);
|
|
1503
|
+
var dateTimestampProvider = {
|
|
1504
|
+
now: function() {
|
|
1505
|
+
return (dateTimestampProvider.delegate || Date).now();
|
|
1506
|
+
},
|
|
1507
|
+
delegate: void 0
|
|
1508
|
+
};
|
|
1509
|
+
var ReplaySubject = (function(_super) {
|
|
1510
|
+
__extends(ReplaySubject2, _super);
|
|
1511
|
+
function ReplaySubject2(_bufferSize, _windowTime, _timestampProvider) {
|
|
1512
|
+
if (_bufferSize === void 0) {
|
|
1513
|
+
_bufferSize = Infinity;
|
|
1514
|
+
}
|
|
1515
|
+
if (_windowTime === void 0) {
|
|
1516
|
+
_windowTime = Infinity;
|
|
1517
|
+
}
|
|
1518
|
+
if (_timestampProvider === void 0) {
|
|
1519
|
+
_timestampProvider = dateTimestampProvider;
|
|
1520
|
+
}
|
|
1521
|
+
var _this = _super.call(this) || this;
|
|
1522
|
+
_this._bufferSize = _bufferSize;
|
|
1523
|
+
_this._windowTime = _windowTime;
|
|
1524
|
+
_this._timestampProvider = _timestampProvider;
|
|
1525
|
+
_this._buffer = [];
|
|
1526
|
+
_this._infiniteTimeWindow = true;
|
|
1527
|
+
_this._infiniteTimeWindow = _windowTime === Infinity;
|
|
1528
|
+
_this._bufferSize = Math.max(1, _bufferSize);
|
|
1529
|
+
_this._windowTime = Math.max(1, _windowTime);
|
|
1530
|
+
return _this;
|
|
1531
|
+
}
|
|
1532
|
+
ReplaySubject2.prototype.next = function(value) {
|
|
1533
|
+
var _a3 = this, isStopped = _a3.isStopped, _buffer = _a3._buffer, _infiniteTimeWindow = _a3._infiniteTimeWindow, _timestampProvider = _a3._timestampProvider, _windowTime = _a3._windowTime;
|
|
1534
|
+
if (!isStopped) {
|
|
1535
|
+
_buffer.push(value);
|
|
1536
|
+
!_infiniteTimeWindow && _buffer.push(_timestampProvider.now() + _windowTime);
|
|
1537
|
+
}
|
|
1538
|
+
this._trimBuffer();
|
|
1539
|
+
_super.prototype.next.call(this, value);
|
|
1540
|
+
};
|
|
1541
|
+
ReplaySubject2.prototype._subscribe = function(subscriber) {
|
|
1542
|
+
this._throwIfClosed();
|
|
1543
|
+
this._trimBuffer();
|
|
1544
|
+
var subscription = this._innerSubscribe(subscriber);
|
|
1545
|
+
var _a3 = this, _infiniteTimeWindow = _a3._infiniteTimeWindow, _buffer = _a3._buffer;
|
|
1546
|
+
var copy = _buffer.slice();
|
|
1547
|
+
for (var i = 0; i < copy.length && !subscriber.closed; i += _infiniteTimeWindow ? 1 : 2) {
|
|
1548
|
+
subscriber.next(copy[i]);
|
|
1549
|
+
}
|
|
1550
|
+
this._checkFinalizedStatuses(subscriber);
|
|
1551
|
+
return subscription;
|
|
1552
|
+
};
|
|
1553
|
+
ReplaySubject2.prototype._trimBuffer = function() {
|
|
1554
|
+
var _a3 = this, _bufferSize = _a3._bufferSize, _timestampProvider = _a3._timestampProvider, _buffer = _a3._buffer, _infiniteTimeWindow = _a3._infiniteTimeWindow;
|
|
1555
|
+
var adjustedBufferSize = (_infiniteTimeWindow ? 1 : 2) * _bufferSize;
|
|
1556
|
+
_bufferSize < Infinity && adjustedBufferSize < _buffer.length && _buffer.splice(0, _buffer.length - adjustedBufferSize);
|
|
1557
|
+
if (!_infiniteTimeWindow) {
|
|
1558
|
+
var now = _timestampProvider.now();
|
|
1559
|
+
var last = 0;
|
|
1560
|
+
for (var i = 1; i < _buffer.length && _buffer[i] <= now; i += 2) {
|
|
1561
|
+
last = i;
|
|
1562
|
+
}
|
|
1563
|
+
last && _buffer.splice(0, last + 1);
|
|
1564
|
+
}
|
|
1565
|
+
};
|
|
1566
|
+
return ReplaySubject2;
|
|
1567
|
+
})(Subject);
|
|
1568
|
+
var isArrayLike = (function(x2) {
|
|
1569
|
+
return x2 && typeof x2.length === "number" && typeof x2 !== "function";
|
|
1570
|
+
});
|
|
1571
|
+
function isPromise(value) {
|
|
1572
|
+
return isFunction(value === null || value === void 0 ? void 0 : value.then);
|
|
1573
|
+
}
|
|
1574
|
+
function isInteropObservable(input) {
|
|
1575
|
+
return isFunction(input[observable]);
|
|
1576
|
+
}
|
|
1577
|
+
function isAsyncIterable(obj) {
|
|
1578
|
+
return Symbol.asyncIterator && isFunction(obj === null || obj === void 0 ? void 0 : obj[Symbol.asyncIterator]);
|
|
1579
|
+
}
|
|
1580
|
+
function createInvalidObservableTypeError(input) {
|
|
1581
|
+
return new TypeError("You provided " + (input !== null && typeof input === "object" ? "an invalid object" : "'" + input + "'") + " where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.");
|
|
1582
|
+
}
|
|
1583
|
+
function getSymbolIterator() {
|
|
1584
|
+
if (typeof Symbol !== "function" || !Symbol.iterator) {
|
|
1585
|
+
return "@@iterator";
|
|
1586
|
+
}
|
|
1587
|
+
return Symbol.iterator;
|
|
1588
|
+
}
|
|
1589
|
+
var iterator = getSymbolIterator();
|
|
1590
|
+
function isIterable(input) {
|
|
1591
|
+
return isFunction(input === null || input === void 0 ? void 0 : input[iterator]);
|
|
1592
|
+
}
|
|
1593
|
+
function readableStreamLikeToAsyncGenerator(readableStream) {
|
|
1594
|
+
return __asyncGenerator(this, arguments, function readableStreamLikeToAsyncGenerator_1() {
|
|
1595
|
+
var reader, _a3, value, done;
|
|
1596
|
+
return __generator(this, function(_b2) {
|
|
1597
|
+
switch (_b2.label) {
|
|
1598
|
+
case 0:
|
|
1599
|
+
reader = readableStream.getReader();
|
|
1600
|
+
_b2.label = 1;
|
|
1601
|
+
case 1:
|
|
1602
|
+
_b2.trys.push([1, , 9, 10]);
|
|
1603
|
+
_b2.label = 2;
|
|
1604
|
+
case 2:
|
|
1605
|
+
return [4, __await(reader.read())];
|
|
1606
|
+
case 3:
|
|
1607
|
+
_a3 = _b2.sent(), value = _a3.value, done = _a3.done;
|
|
1608
|
+
if (!done) return [3, 5];
|
|
1609
|
+
return [4, __await(void 0)];
|
|
1610
|
+
case 4:
|
|
1611
|
+
return [2, _b2.sent()];
|
|
1612
|
+
case 5:
|
|
1613
|
+
return [4, __await(value)];
|
|
1614
|
+
case 6:
|
|
1615
|
+
return [4, _b2.sent()];
|
|
1616
|
+
case 7:
|
|
1617
|
+
_b2.sent();
|
|
1618
|
+
return [3, 2];
|
|
1619
|
+
case 8:
|
|
1620
|
+
return [3, 10];
|
|
1621
|
+
case 9:
|
|
1622
|
+
reader.releaseLock();
|
|
1623
|
+
return [7];
|
|
1624
|
+
case 10:
|
|
1625
|
+
return [2];
|
|
1626
|
+
}
|
|
1627
|
+
});
|
|
1628
|
+
});
|
|
1629
|
+
}
|
|
1630
|
+
function isReadableStreamLike(obj) {
|
|
1631
|
+
return isFunction(obj === null || obj === void 0 ? void 0 : obj.getReader);
|
|
1632
|
+
}
|
|
1633
|
+
function innerFrom(input) {
|
|
1634
|
+
if (input instanceof Observable) {
|
|
1635
|
+
return input;
|
|
1636
|
+
}
|
|
1637
|
+
if (input != null) {
|
|
1638
|
+
if (isInteropObservable(input)) {
|
|
1639
|
+
return fromInteropObservable(input);
|
|
1640
|
+
}
|
|
1641
|
+
if (isArrayLike(input)) {
|
|
1642
|
+
return fromArrayLike(input);
|
|
1643
|
+
}
|
|
1644
|
+
if (isPromise(input)) {
|
|
1645
|
+
return fromPromise(input);
|
|
1646
|
+
}
|
|
1647
|
+
if (isAsyncIterable(input)) {
|
|
1648
|
+
return fromAsyncIterable(input);
|
|
1649
|
+
}
|
|
1650
|
+
if (isIterable(input)) {
|
|
1651
|
+
return fromIterable(input);
|
|
1652
|
+
}
|
|
1653
|
+
if (isReadableStreamLike(input)) {
|
|
1654
|
+
return fromReadableStreamLike(input);
|
|
1655
|
+
}
|
|
1656
|
+
}
|
|
1657
|
+
throw createInvalidObservableTypeError(input);
|
|
1658
|
+
}
|
|
1659
|
+
function fromInteropObservable(obj) {
|
|
1660
|
+
return new Observable(function(subscriber) {
|
|
1661
|
+
var obs = obj[observable]();
|
|
1662
|
+
if (isFunction(obs.subscribe)) {
|
|
1663
|
+
return obs.subscribe(subscriber);
|
|
1664
|
+
}
|
|
1665
|
+
throw new TypeError("Provided object does not correctly implement Symbol.observable");
|
|
1666
|
+
});
|
|
1667
|
+
}
|
|
1668
|
+
function fromArrayLike(array) {
|
|
1669
|
+
return new Observable(function(subscriber) {
|
|
1670
|
+
for (var i = 0; i < array.length && !subscriber.closed; i++) {
|
|
1671
|
+
subscriber.next(array[i]);
|
|
1672
|
+
}
|
|
1673
|
+
subscriber.complete();
|
|
1674
|
+
});
|
|
1675
|
+
}
|
|
1676
|
+
function fromPromise(promise) {
|
|
1677
|
+
return new Observable(function(subscriber) {
|
|
1678
|
+
promise.then(function(value) {
|
|
1679
|
+
if (!subscriber.closed) {
|
|
1680
|
+
subscriber.next(value);
|
|
1681
|
+
subscriber.complete();
|
|
1682
|
+
}
|
|
1683
|
+
}, function(err) {
|
|
1684
|
+
return subscriber.error(err);
|
|
1685
|
+
}).then(null, reportUnhandledError);
|
|
1686
|
+
});
|
|
1687
|
+
}
|
|
1688
|
+
function fromIterable(iterable) {
|
|
1689
|
+
return new Observable(function(subscriber) {
|
|
1690
|
+
var e_1, _a3;
|
|
1691
|
+
try {
|
|
1692
|
+
for (var iterable_1 = __values(iterable), iterable_1_1 = iterable_1.next(); !iterable_1_1.done; iterable_1_1 = iterable_1.next()) {
|
|
1693
|
+
var value = iterable_1_1.value;
|
|
1694
|
+
subscriber.next(value);
|
|
1695
|
+
if (subscriber.closed) {
|
|
1696
|
+
return;
|
|
1697
|
+
}
|
|
1698
|
+
}
|
|
1699
|
+
} catch (e_1_1) {
|
|
1700
|
+
e_1 = { error: e_1_1 };
|
|
1701
|
+
} finally {
|
|
1702
|
+
try {
|
|
1703
|
+
if (iterable_1_1 && !iterable_1_1.done && (_a3 = iterable_1.return)) _a3.call(iterable_1);
|
|
1704
|
+
} finally {
|
|
1705
|
+
if (e_1) throw e_1.error;
|
|
1706
|
+
}
|
|
1707
|
+
}
|
|
1708
|
+
subscriber.complete();
|
|
1709
|
+
});
|
|
1710
|
+
}
|
|
1711
|
+
function fromAsyncIterable(asyncIterable) {
|
|
1712
|
+
return new Observable(function(subscriber) {
|
|
1713
|
+
process(asyncIterable, subscriber).catch(function(err) {
|
|
1714
|
+
return subscriber.error(err);
|
|
1715
|
+
});
|
|
1716
|
+
});
|
|
1717
|
+
}
|
|
1718
|
+
function fromReadableStreamLike(readableStream) {
|
|
1719
|
+
return fromAsyncIterable(readableStreamLikeToAsyncGenerator(readableStream));
|
|
1720
|
+
}
|
|
1721
|
+
function process(asyncIterable, subscriber) {
|
|
1722
|
+
var asyncIterable_1, asyncIterable_1_1;
|
|
1723
|
+
var e_2, _a3;
|
|
1724
|
+
return __awaiter(this, void 0, void 0, function() {
|
|
1725
|
+
var value, e_2_1;
|
|
1726
|
+
return __generator(this, function(_b2) {
|
|
1727
|
+
switch (_b2.label) {
|
|
1728
|
+
case 0:
|
|
1729
|
+
_b2.trys.push([0, 5, 6, 11]);
|
|
1730
|
+
asyncIterable_1 = __asyncValues(asyncIterable);
|
|
1731
|
+
_b2.label = 1;
|
|
1732
|
+
case 1:
|
|
1733
|
+
return [4, asyncIterable_1.next()];
|
|
1734
|
+
case 2:
|
|
1735
|
+
if (!(asyncIterable_1_1 = _b2.sent(), !asyncIterable_1_1.done)) return [3, 4];
|
|
1736
|
+
value = asyncIterable_1_1.value;
|
|
1737
|
+
subscriber.next(value);
|
|
1738
|
+
if (subscriber.closed) {
|
|
1739
|
+
return [2];
|
|
1740
|
+
}
|
|
1741
|
+
_b2.label = 3;
|
|
1742
|
+
case 3:
|
|
1743
|
+
return [3, 1];
|
|
1744
|
+
case 4:
|
|
1745
|
+
return [3, 11];
|
|
1746
|
+
case 5:
|
|
1747
|
+
e_2_1 = _b2.sent();
|
|
1748
|
+
e_2 = { error: e_2_1 };
|
|
1749
|
+
return [3, 11];
|
|
1750
|
+
case 6:
|
|
1751
|
+
_b2.trys.push([6, , 9, 10]);
|
|
1752
|
+
if (!(asyncIterable_1_1 && !asyncIterable_1_1.done && (_a3 = asyncIterable_1.return))) return [3, 8];
|
|
1753
|
+
return [4, _a3.call(asyncIterable_1)];
|
|
1754
|
+
case 7:
|
|
1755
|
+
_b2.sent();
|
|
1756
|
+
_b2.label = 8;
|
|
1757
|
+
case 8:
|
|
1758
|
+
return [3, 10];
|
|
1759
|
+
case 9:
|
|
1760
|
+
if (e_2) throw e_2.error;
|
|
1761
|
+
return [7];
|
|
1762
|
+
case 10:
|
|
1763
|
+
return [7];
|
|
1764
|
+
case 11:
|
|
1765
|
+
subscriber.complete();
|
|
1766
|
+
return [2];
|
|
1767
|
+
}
|
|
1768
|
+
});
|
|
1769
|
+
});
|
|
1770
|
+
}
|
|
1771
|
+
function map(project, thisArg) {
|
|
1772
|
+
return operate(function(source, subscriber) {
|
|
1773
|
+
var index = 0;
|
|
1774
|
+
source.subscribe(createOperatorSubscriber(subscriber, function(value) {
|
|
1775
|
+
subscriber.next(project.call(thisArg, value, index++));
|
|
1776
|
+
}));
|
|
1777
|
+
});
|
|
1778
|
+
}
|
|
1779
|
+
function scanInternals(accumulator, seed, hasSeed, emitOnNext, emitBeforeComplete) {
|
|
1780
|
+
return function(source, subscriber) {
|
|
1781
|
+
var hasState = hasSeed;
|
|
1782
|
+
var state = seed;
|
|
1783
|
+
var index = 0;
|
|
1784
|
+
source.subscribe(createOperatorSubscriber(subscriber, function(value) {
|
|
1785
|
+
var i = index++;
|
|
1786
|
+
state = hasState ? accumulator(state, value, i) : (hasState = true, value);
|
|
1787
|
+
subscriber.next(state);
|
|
1788
|
+
}, emitBeforeComplete));
|
|
1789
|
+
};
|
|
1790
|
+
}
|
|
1791
|
+
function scan(accumulator, seed) {
|
|
1792
|
+
return operate(scanInternals(accumulator, seed, arguments.length >= 2, true));
|
|
1793
|
+
}
|
|
1794
|
+
function share(options) {
|
|
1795
|
+
if (options === void 0) {
|
|
1796
|
+
options = {};
|
|
1797
|
+
}
|
|
1798
|
+
var _a3 = options.connector, connector = _a3 === void 0 ? function() {
|
|
1799
|
+
return new Subject();
|
|
1800
|
+
} : _a3, _b2 = options.resetOnError, resetOnError = _b2 === void 0 ? true : _b2, _c2 = options.resetOnComplete, resetOnComplete = _c2 === void 0 ? true : _c2, _d2 = options.resetOnRefCountZero, resetOnRefCountZero = _d2 === void 0 ? true : _d2;
|
|
1801
|
+
return function(wrapperSource) {
|
|
1802
|
+
var connection;
|
|
1803
|
+
var resetConnection;
|
|
1804
|
+
var subject;
|
|
1805
|
+
var refCount = 0;
|
|
1806
|
+
var hasCompleted = false;
|
|
1807
|
+
var hasErrored = false;
|
|
1808
|
+
var cancelReset = function() {
|
|
1809
|
+
resetConnection === null || resetConnection === void 0 ? void 0 : resetConnection.unsubscribe();
|
|
1810
|
+
resetConnection = void 0;
|
|
1811
|
+
};
|
|
1812
|
+
var reset = function() {
|
|
1813
|
+
cancelReset();
|
|
1814
|
+
connection = subject = void 0;
|
|
1815
|
+
hasCompleted = hasErrored = false;
|
|
1816
|
+
};
|
|
1817
|
+
var resetAndUnsubscribe = function() {
|
|
1818
|
+
var conn = connection;
|
|
1819
|
+
reset();
|
|
1820
|
+
conn === null || conn === void 0 ? void 0 : conn.unsubscribe();
|
|
1821
|
+
};
|
|
1822
|
+
return operate(function(source, subscriber) {
|
|
1823
|
+
refCount++;
|
|
1824
|
+
if (!hasErrored && !hasCompleted) {
|
|
1825
|
+
cancelReset();
|
|
1826
|
+
}
|
|
1827
|
+
var dest = subject = subject !== null && subject !== void 0 ? subject : connector();
|
|
1828
|
+
subscriber.add(function() {
|
|
1829
|
+
refCount--;
|
|
1830
|
+
if (refCount === 0 && !hasErrored && !hasCompleted) {
|
|
1831
|
+
resetConnection = handleReset(resetAndUnsubscribe, resetOnRefCountZero);
|
|
1832
|
+
}
|
|
1833
|
+
});
|
|
1834
|
+
dest.subscribe(subscriber);
|
|
1835
|
+
if (!connection && refCount > 0) {
|
|
1836
|
+
connection = new SafeSubscriber({
|
|
1837
|
+
next: function(value) {
|
|
1838
|
+
return dest.next(value);
|
|
1839
|
+
},
|
|
1840
|
+
error: function(err) {
|
|
1841
|
+
hasErrored = true;
|
|
1842
|
+
cancelReset();
|
|
1843
|
+
resetConnection = handleReset(reset, resetOnError, err);
|
|
1844
|
+
dest.error(err);
|
|
1845
|
+
},
|
|
1846
|
+
complete: function() {
|
|
1847
|
+
hasCompleted = true;
|
|
1848
|
+
cancelReset();
|
|
1849
|
+
resetConnection = handleReset(reset, resetOnComplete);
|
|
1850
|
+
dest.complete();
|
|
1851
|
+
}
|
|
1852
|
+
});
|
|
1853
|
+
innerFrom(source).subscribe(connection);
|
|
1854
|
+
}
|
|
1855
|
+
})(wrapperSource);
|
|
1856
|
+
};
|
|
1857
|
+
}
|
|
1858
|
+
function handleReset(reset, on2) {
|
|
1859
|
+
var args = [];
|
|
1860
|
+
for (var _i4 = 2; _i4 < arguments.length; _i4++) {
|
|
1861
|
+
args[_i4 - 2] = arguments[_i4];
|
|
1862
|
+
}
|
|
1863
|
+
if (on2 === true) {
|
|
1864
|
+
reset();
|
|
1865
|
+
return;
|
|
1866
|
+
}
|
|
1867
|
+
if (on2 === false) {
|
|
1868
|
+
return;
|
|
1869
|
+
}
|
|
1870
|
+
var onSubscriber = new SafeSubscriber({
|
|
1871
|
+
next: function() {
|
|
1872
|
+
onSubscriber.unsubscribe();
|
|
1873
|
+
reset();
|
|
1874
|
+
}
|
|
1875
|
+
});
|
|
1876
|
+
return innerFrom(on2.apply(void 0, __spreadArray([], __read(args)))).subscribe(onSubscriber);
|
|
1877
|
+
}
|
|
1878
|
+
function shareReplay(configOrBufferSize, windowTime, scheduler) {
|
|
1879
|
+
var bufferSize;
|
|
1880
|
+
var refCount = false;
|
|
1881
|
+
{
|
|
1882
|
+
bufferSize = configOrBufferSize;
|
|
1883
|
+
}
|
|
1884
|
+
return share({
|
|
1885
|
+
connector: function() {
|
|
1886
|
+
return new ReplaySubject(bufferSize, windowTime, scheduler);
|
|
1887
|
+
},
|
|
1888
|
+
resetOnError: true,
|
|
1889
|
+
resetOnComplete: false,
|
|
1890
|
+
resetOnRefCountZero: refCount
|
|
1891
|
+
});
|
|
1892
|
+
}
|
|
1893
|
+
function takeUntil(notifier) {
|
|
1894
|
+
return operate(function(source, subscriber) {
|
|
1895
|
+
innerFrom(notifier).subscribe(createOperatorSubscriber(subscriber, function() {
|
|
1896
|
+
return subscriber.complete();
|
|
1897
|
+
}, noop));
|
|
1898
|
+
!subscriber.closed && source.subscribe(subscriber);
|
|
1899
|
+
});
|
|
1900
|
+
}
|
|
1278
1901
|
class InfiniteScroller {
|
|
1279
1902
|
constructor(options) {
|
|
1280
1903
|
__publicField(this, "enabled", true);
|
|
@@ -2399,6 +3022,9 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
2399
3022
|
const duration = timeToSeconds(((_a3 = title.match(/\d+m|\d+:\d+/)) == null ? void 0 : _a3[0]) || "");
|
|
2400
3023
|
return { title, duration };
|
|
2401
3024
|
}
|
|
3025
|
+
getUrl(thumb) {
|
|
3026
|
+
return (thumb.querySelector("a[href]") || thumb).href;
|
|
3027
|
+
}
|
|
2402
3028
|
preprocessCustomThumbDataSelectors() {
|
|
2403
3029
|
if (!this.selectors) return;
|
|
2404
3030
|
Object.entries(this.selectors).forEach(([key, value]) => {
|
|
@@ -2426,6 +3052,10 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
2426
3052
|
if (type === "duration") {
|
|
2427
3053
|
return timeToSeconds(querySelectorText(thumb, selector));
|
|
2428
3054
|
}
|
|
3055
|
+
if (type === "float") {
|
|
3056
|
+
const value = querySelectorText(thumb, selector);
|
|
3057
|
+
return parseNumberWithLetter(value);
|
|
3058
|
+
}
|
|
2429
3059
|
return Number.parseInt(querySelectorText(thumb, selector));
|
|
2430
3060
|
}
|
|
2431
3061
|
static create(o = {}) {
|
|
@@ -9078,6 +9708,50 @@ Expected function or array of functions, received type ${typeof t}.`
|
|
|
9078
9708
|
$paginationLast: 1,
|
|
9079
9709
|
$paginationOffset: 1
|
|
9080
9710
|
};
|
|
9711
|
+
class JabronioGuiController {
|
|
9712
|
+
constructor(store, dataManager) {
|
|
9713
|
+
__publicField(this, "destroy$", new Subject());
|
|
9714
|
+
__publicField(this, "directionalEventObservable$");
|
|
9715
|
+
__publicField(this, "eventsMap", {
|
|
9716
|
+
"sort by duration": (direction) => this.dataManager.sortBy("duration", direction),
|
|
9717
|
+
"sort by views": (direction) => this.dataManager.sortBy("views", direction)
|
|
9718
|
+
});
|
|
9719
|
+
this.store = store;
|
|
9720
|
+
this.dataManager = dataManager;
|
|
9721
|
+
this.directionalEventObservable$ = this.directionalEvent();
|
|
9722
|
+
this.setupStoreListeners();
|
|
9723
|
+
}
|
|
9724
|
+
dispose() {
|
|
9725
|
+
this.destroy$.next();
|
|
9726
|
+
this.destroy$.complete();
|
|
9727
|
+
}
|
|
9728
|
+
directionalEvent() {
|
|
9729
|
+
return this.store.eventSubject.pipe(
|
|
9730
|
+
scan(
|
|
9731
|
+
(acc, value) => ({
|
|
9732
|
+
type: value,
|
|
9733
|
+
direction: acc.type === value ? !acc.direction : true
|
|
9734
|
+
}),
|
|
9735
|
+
{ type: void 0, direction: true }
|
|
9736
|
+
),
|
|
9737
|
+
map(({ type, direction }) => ({
|
|
9738
|
+
type,
|
|
9739
|
+
direction
|
|
9740
|
+
})),
|
|
9741
|
+
shareReplay(1),
|
|
9742
|
+
takeUntil(this.destroy$)
|
|
9743
|
+
);
|
|
9744
|
+
}
|
|
9745
|
+
setupStoreListeners() {
|
|
9746
|
+
var _a3;
|
|
9747
|
+
(_a3 = this.directionalEventObservable$) == null ? void 0 : _a3.subscribe((e) => {
|
|
9748
|
+
this.eventsMap[e.type](e.direction);
|
|
9749
|
+
});
|
|
9750
|
+
this.store.stateSubject.pipe(takeUntil(this.destroy$)).subscribe((a2) => {
|
|
9751
|
+
this.dataManager.applyFilters(a2);
|
|
9752
|
+
});
|
|
9753
|
+
}
|
|
9754
|
+
}
|
|
9081
9755
|
class Rules {
|
|
9082
9756
|
constructor(options) {
|
|
9083
9757
|
__publicField(this, "thumb", {});
|
|
@@ -9103,6 +9777,7 @@ Expected function or array of functions, received type ${typeof t}.`
|
|
|
9103
9777
|
__publicField(this, "schemeOptions", []);
|
|
9104
9778
|
__publicField(this, "store");
|
|
9105
9779
|
__publicField(this, "gui");
|
|
9780
|
+
__publicField(this, "inputController");
|
|
9106
9781
|
__publicField(this, "customGenerator");
|
|
9107
9782
|
__publicField(this, "infiniteScroller");
|
|
9108
9783
|
__publicField(this, "getPaginationData");
|
|
@@ -9119,11 +9794,9 @@ Expected function or array of functions, received type ${typeof t}.`
|
|
|
9119
9794
|
this.store = this.createStore();
|
|
9120
9795
|
this.gui = this.createGui();
|
|
9121
9796
|
this.dataManager = new DataManager(this, this.dataHomogenity);
|
|
9797
|
+
this.inputController = new JabronioGuiController(this.store, this.dataManager);
|
|
9122
9798
|
this.reset();
|
|
9123
9799
|
}
|
|
9124
|
-
getThumbUrl(thumb) {
|
|
9125
|
-
return (thumb.querySelector("a[href]") || thumb).href;
|
|
9126
|
-
}
|
|
9127
9800
|
get container() {
|
|
9128
9801
|
if (typeof this.containerSelectorLast === "string") {
|
|
9129
9802
|
return querySelectorLast(document, this.containerSelectorLast);
|
|
@@ -9173,30 +9846,6 @@ Expected function or array of functions, received type ${typeof t}.`
|
|
|
9173
9846
|
get isEmbedded() {
|
|
9174
9847
|
return window.self !== window.top;
|
|
9175
9848
|
}
|
|
9176
|
-
setupStoreListeners() {
|
|
9177
|
-
const eventsMap = {
|
|
9178
|
-
"sort by duration": {
|
|
9179
|
-
action: (direction2) => this.dataManager.sortBy("duration", direction2)
|
|
9180
|
-
}
|
|
9181
|
-
};
|
|
9182
|
-
let lastEvent;
|
|
9183
|
-
let direction = true;
|
|
9184
|
-
this.store.eventSubject.subscribe((event) => {
|
|
9185
|
-
if (event === lastEvent) {
|
|
9186
|
-
direction = !direction;
|
|
9187
|
-
} else {
|
|
9188
|
-
lastEvent = event;
|
|
9189
|
-
direction = true;
|
|
9190
|
-
}
|
|
9191
|
-
if (event in eventsMap) {
|
|
9192
|
-
const ev = eventsMap[event];
|
|
9193
|
-
ev == null ? void 0 : ev.action(direction);
|
|
9194
|
-
}
|
|
9195
|
-
});
|
|
9196
|
-
this.store.stateSubject.subscribe((a2) => {
|
|
9197
|
-
this.dataManager.applyFilters(a2);
|
|
9198
|
-
});
|
|
9199
|
-
}
|
|
9200
9849
|
resetOn() {
|
|
9201
9850
|
if (!this.resetOnPaginationOrContainerDeath) return;
|
|
9202
9851
|
const observables = [
|
|
@@ -9219,7 +9868,8 @@ Expected function or array of functions, received type ${typeof t}.`
|
|
|
9219
9868
|
this.mutationObservers = [];
|
|
9220
9869
|
this.paginationStrategy = getPaginationStrategy(this.paginationStrategyOptions);
|
|
9221
9870
|
this.dataManager = new DataManager(this, this.dataHomogenity);
|
|
9222
|
-
this.
|
|
9871
|
+
this.inputController.dispose();
|
|
9872
|
+
this.inputController = new JabronioGuiController(this.store, this.dataManager);
|
|
9223
9873
|
this.resetInfiniteScroller();
|
|
9224
9874
|
this.container && ((_a3 = this.animatePreview) == null ? void 0 : _a3.call(this, this.container));
|
|
9225
9875
|
this.gropeInit();
|
|
@@ -9265,6 +9915,7 @@ Expected function or array of functions, received type ${typeof t}.`
|
|
|
9265
9915
|
exports2.parseDataParams = parseDataParams;
|
|
9266
9916
|
exports2.parseHtml = parseHtml;
|
|
9267
9917
|
exports2.parseIntegerOr = parseIntegerOr;
|
|
9918
|
+
exports2.parseNumberWithLetter = parseNumberWithLetter;
|
|
9268
9919
|
exports2.parseUrl = parseUrl;
|
|
9269
9920
|
exports2.querySelectorLast = querySelectorLast;
|
|
9270
9921
|
exports2.querySelectorLastNumber = querySelectorLastNumber;
|