-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmuse-browser.js
More file actions
12688 lines (12482 loc) · 473 KB
/
muse-browser.js
File metadata and controls
12688 lines (12482 loc) · 473 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
(() => {
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __commonJS = (cb, mod) => function __require() {
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
// node_modules/rxjs/internal/util/isFunction.js
var require_isFunction = __commonJS({
"node_modules/rxjs/internal/util/isFunction.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function isFunction(x) {
return typeof x === "function";
}
exports.isFunction = isFunction;
}
});
// node_modules/rxjs/internal/config.js
var require_config = __commonJS({
"node_modules/rxjs/internal/config.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var _enable_super_gross_mode_that_will_cause_bad_things = false;
exports.config = {
Promise: void 0,
set useDeprecatedSynchronousErrorHandling(value) {
if (value) {
var error = new Error();
console.warn("DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n" + error.stack);
} else if (_enable_super_gross_mode_that_will_cause_bad_things) {
console.log("RxJS: Back to a better error behavior. Thank you. <3");
}
_enable_super_gross_mode_that_will_cause_bad_things = value;
},
get useDeprecatedSynchronousErrorHandling() {
return _enable_super_gross_mode_that_will_cause_bad_things;
}
};
}
});
// node_modules/rxjs/internal/util/hostReportError.js
var require_hostReportError = __commonJS({
"node_modules/rxjs/internal/util/hostReportError.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function hostReportError(err) {
setTimeout(function() {
throw err;
}, 0);
}
exports.hostReportError = hostReportError;
}
});
// node_modules/rxjs/internal/Observer.js
var require_Observer = __commonJS({
"node_modules/rxjs/internal/Observer.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var config_1 = require_config();
var hostReportError_1 = require_hostReportError();
exports.empty = {
closed: true,
next: function(value) {
},
error: function(err) {
if (config_1.config.useDeprecatedSynchronousErrorHandling) {
throw err;
} else {
hostReportError_1.hostReportError(err);
}
},
complete: function() {
}
};
}
});
// node_modules/rxjs/internal/util/isArray.js
var require_isArray = __commonJS({
"node_modules/rxjs/internal/util/isArray.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isArray = function() {
return Array.isArray || function(x) {
return x && typeof x.length === "number";
};
}();
}
});
// node_modules/rxjs/internal/util/isObject.js
var require_isObject = __commonJS({
"node_modules/rxjs/internal/util/isObject.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function isObject(x) {
return x !== null && typeof x === "object";
}
exports.isObject = isObject;
}
});
// node_modules/rxjs/internal/util/UnsubscriptionError.js
var require_UnsubscriptionError = __commonJS({
"node_modules/rxjs/internal/util/UnsubscriptionError.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var UnsubscriptionErrorImpl = function() {
function UnsubscriptionErrorImpl2(errors) {
Error.call(this);
this.message = errors ? errors.length + " errors occurred during unsubscription:\n" + errors.map(function(err, i) {
return i + 1 + ") " + err.toString();
}).join("\n ") : "";
this.name = "UnsubscriptionError";
this.errors = errors;
return this;
}
UnsubscriptionErrorImpl2.prototype = Object.create(Error.prototype);
return UnsubscriptionErrorImpl2;
}();
exports.UnsubscriptionError = UnsubscriptionErrorImpl;
}
});
// node_modules/rxjs/internal/Subscription.js
var require_Subscription = __commonJS({
"node_modules/rxjs/internal/Subscription.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var isArray_1 = require_isArray();
var isObject_1 = require_isObject();
var isFunction_1 = require_isFunction();
var UnsubscriptionError_1 = require_UnsubscriptionError();
var Subscription = function() {
function Subscription2(unsubscribe) {
this.closed = false;
this._parentOrParents = null;
this._subscriptions = null;
if (unsubscribe) {
this._ctorUnsubscribe = true;
this._unsubscribe = unsubscribe;
}
}
Subscription2.prototype.unsubscribe = function() {
var errors;
if (this.closed) {
return;
}
var _a = this, _parentOrParents = _a._parentOrParents, _ctorUnsubscribe = _a._ctorUnsubscribe, _unsubscribe = _a._unsubscribe, _subscriptions = _a._subscriptions;
this.closed = true;
this._parentOrParents = null;
this._subscriptions = null;
if (_parentOrParents instanceof Subscription2) {
_parentOrParents.remove(this);
} else if (_parentOrParents !== null) {
for (var index = 0; index < _parentOrParents.length; ++index) {
var parent_1 = _parentOrParents[index];
parent_1.remove(this);
}
}
if (isFunction_1.isFunction(_unsubscribe)) {
if (_ctorUnsubscribe) {
this._unsubscribe = void 0;
}
try {
_unsubscribe.call(this);
} catch (e) {
errors = e instanceof UnsubscriptionError_1.UnsubscriptionError ? flattenUnsubscriptionErrors(e.errors) : [e];
}
}
if (isArray_1.isArray(_subscriptions)) {
var index = -1;
var len = _subscriptions.length;
while (++index < len) {
var sub = _subscriptions[index];
if (isObject_1.isObject(sub)) {
try {
sub.unsubscribe();
} catch (e) {
errors = errors || [];
if (e instanceof UnsubscriptionError_1.UnsubscriptionError) {
errors = errors.concat(flattenUnsubscriptionErrors(e.errors));
} else {
errors.push(e);
}
}
}
}
}
if (errors) {
throw new UnsubscriptionError_1.UnsubscriptionError(errors);
}
};
Subscription2.prototype.add = function(teardown) {
var subscription = teardown;
if (!teardown) {
return Subscription2.EMPTY;
}
switch (typeof teardown) {
case "function":
subscription = new Subscription2(teardown);
case "object":
if (subscription === this || subscription.closed || typeof subscription.unsubscribe !== "function") {
return subscription;
} else if (this.closed) {
subscription.unsubscribe();
return subscription;
} else if (!(subscription instanceof Subscription2)) {
var tmp = subscription;
subscription = new Subscription2();
subscription._subscriptions = [tmp];
}
break;
default: {
throw new Error("unrecognized teardown " + teardown + " added to Subscription.");
}
}
var _parentOrParents = subscription._parentOrParents;
if (_parentOrParents === null) {
subscription._parentOrParents = this;
} else if (_parentOrParents instanceof Subscription2) {
if (_parentOrParents === this) {
return subscription;
}
subscription._parentOrParents = [_parentOrParents, this];
} else if (_parentOrParents.indexOf(this) === -1) {
_parentOrParents.push(this);
} else {
return subscription;
}
var subscriptions = this._subscriptions;
if (subscriptions === null) {
this._subscriptions = [subscription];
} else {
subscriptions.push(subscription);
}
return subscription;
};
Subscription2.prototype.remove = function(subscription) {
var subscriptions = this._subscriptions;
if (subscriptions) {
var subscriptionIndex = subscriptions.indexOf(subscription);
if (subscriptionIndex !== -1) {
subscriptions.splice(subscriptionIndex, 1);
}
}
};
Subscription2.EMPTY = function(empty) {
empty.closed = true;
return empty;
}(new Subscription2());
return Subscription2;
}();
exports.Subscription = Subscription;
function flattenUnsubscriptionErrors(errors) {
return errors.reduce(function(errs, err) {
return errs.concat(err instanceof UnsubscriptionError_1.UnsubscriptionError ? err.errors : err);
}, []);
}
}
});
// node_modules/rxjs/internal/symbol/rxSubscriber.js
var require_rxSubscriber = __commonJS({
"node_modules/rxjs/internal/symbol/rxSubscriber.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.rxSubscriber = function() {
return typeof Symbol === "function" ? Symbol("rxSubscriber") : "@@rxSubscriber_" + Math.random();
}();
exports.$$rxSubscriber = exports.rxSubscriber;
}
});
// node_modules/rxjs/internal/Subscriber.js
var require_Subscriber = __commonJS({
"node_modules/rxjs/internal/Subscriber.js"(exports) {
"use strict";
var __extends = exports && exports.__extends || /* @__PURE__ */ function() {
var extendStatics = function(d, b) {
extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
d2.__proto__ = b2;
} || function(d2, b2) {
for (var p in b2)
if (b2.hasOwnProperty(p))
d2[p] = b2[p];
};
return extendStatics(d, b);
};
return function(d, b) {
extendStatics(d, b);
function __() {
this.constructor = d;
}
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
}();
Object.defineProperty(exports, "__esModule", { value: true });
var isFunction_1 = require_isFunction();
var Observer_1 = require_Observer();
var Subscription_1 = require_Subscription();
var rxSubscriber_1 = require_rxSubscriber();
var config_1 = require_config();
var hostReportError_1 = require_hostReportError();
var Subscriber = function(_super) {
__extends(Subscriber2, _super);
function Subscriber2(destinationOrNext, error, complete) {
var _this = _super.call(this) || this;
_this.syncErrorValue = null;
_this.syncErrorThrown = false;
_this.syncErrorThrowable = false;
_this.isStopped = false;
switch (arguments.length) {
case 0:
_this.destination = Observer_1.empty;
break;
case 1:
if (!destinationOrNext) {
_this.destination = Observer_1.empty;
break;
}
if (typeof destinationOrNext === "object") {
if (destinationOrNext instanceof Subscriber2) {
_this.syncErrorThrowable = destinationOrNext.syncErrorThrowable;
_this.destination = destinationOrNext;
destinationOrNext.add(_this);
} else {
_this.syncErrorThrowable = true;
_this.destination = new SafeSubscriber(_this, destinationOrNext);
}
break;
}
default:
_this.syncErrorThrowable = true;
_this.destination = new SafeSubscriber(_this, destinationOrNext, error, complete);
break;
}
return _this;
}
Subscriber2.prototype[rxSubscriber_1.rxSubscriber] = function() {
return this;
};
Subscriber2.create = function(next, error, complete) {
var subscriber = new Subscriber2(next, error, complete);
subscriber.syncErrorThrowable = false;
return subscriber;
};
Subscriber2.prototype.next = function(value) {
if (!this.isStopped) {
this._next(value);
}
};
Subscriber2.prototype.error = function(err) {
if (!this.isStopped) {
this.isStopped = true;
this._error(err);
}
};
Subscriber2.prototype.complete = function() {
if (!this.isStopped) {
this.isStopped = true;
this._complete();
}
};
Subscriber2.prototype.unsubscribe = function() {
if (this.closed) {
return;
}
this.isStopped = true;
_super.prototype.unsubscribe.call(this);
};
Subscriber2.prototype._next = function(value) {
this.destination.next(value);
};
Subscriber2.prototype._error = function(err) {
this.destination.error(err);
this.unsubscribe();
};
Subscriber2.prototype._complete = function() {
this.destination.complete();
this.unsubscribe();
};
Subscriber2.prototype._unsubscribeAndRecycle = function() {
var _parentOrParents = this._parentOrParents;
this._parentOrParents = null;
this.unsubscribe();
this.closed = false;
this.isStopped = false;
this._parentOrParents = _parentOrParents;
return this;
};
return Subscriber2;
}(Subscription_1.Subscription);
exports.Subscriber = Subscriber;
var SafeSubscriber = function(_super) {
__extends(SafeSubscriber2, _super);
function SafeSubscriber2(_parentSubscriber, observerOrNext, error, complete) {
var _this = _super.call(this) || this;
_this._parentSubscriber = _parentSubscriber;
var next;
var context = _this;
if (isFunction_1.isFunction(observerOrNext)) {
next = observerOrNext;
} else if (observerOrNext) {
next = observerOrNext.next;
error = observerOrNext.error;
complete = observerOrNext.complete;
if (observerOrNext !== Observer_1.empty) {
context = Object.create(observerOrNext);
if (isFunction_1.isFunction(context.unsubscribe)) {
_this.add(context.unsubscribe.bind(context));
}
context.unsubscribe = _this.unsubscribe.bind(_this);
}
}
_this._context = context;
_this._next = next;
_this._error = error;
_this._complete = complete;
return _this;
}
SafeSubscriber2.prototype.next = function(value) {
if (!this.isStopped && this._next) {
var _parentSubscriber = this._parentSubscriber;
if (!config_1.config.useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {
this.__tryOrUnsub(this._next, value);
} else if (this.__tryOrSetError(_parentSubscriber, this._next, value)) {
this.unsubscribe();
}
}
};
SafeSubscriber2.prototype.error = function(err) {
if (!this.isStopped) {
var _parentSubscriber = this._parentSubscriber;
var useDeprecatedSynchronousErrorHandling = config_1.config.useDeprecatedSynchronousErrorHandling;
if (this._error) {
if (!useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {
this.__tryOrUnsub(this._error, err);
this.unsubscribe();
} else {
this.__tryOrSetError(_parentSubscriber, this._error, err);
this.unsubscribe();
}
} else if (!_parentSubscriber.syncErrorThrowable) {
this.unsubscribe();
if (useDeprecatedSynchronousErrorHandling) {
throw err;
}
hostReportError_1.hostReportError(err);
} else {
if (useDeprecatedSynchronousErrorHandling) {
_parentSubscriber.syncErrorValue = err;
_parentSubscriber.syncErrorThrown = true;
} else {
hostReportError_1.hostReportError(err);
}
this.unsubscribe();
}
}
};
SafeSubscriber2.prototype.complete = function() {
var _this = this;
if (!this.isStopped) {
var _parentSubscriber = this._parentSubscriber;
if (this._complete) {
var wrappedComplete = function() {
return _this._complete.call(_this._context);
};
if (!config_1.config.useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {
this.__tryOrUnsub(wrappedComplete);
this.unsubscribe();
} else {
this.__tryOrSetError(_parentSubscriber, wrappedComplete);
this.unsubscribe();
}
} else {
this.unsubscribe();
}
}
};
SafeSubscriber2.prototype.__tryOrUnsub = function(fn, value) {
try {
fn.call(this._context, value);
} catch (err) {
this.unsubscribe();
if (config_1.config.useDeprecatedSynchronousErrorHandling) {
throw err;
} else {
hostReportError_1.hostReportError(err);
}
}
};
SafeSubscriber2.prototype.__tryOrSetError = function(parent, fn, value) {
if (!config_1.config.useDeprecatedSynchronousErrorHandling) {
throw new Error("bad call");
}
try {
fn.call(this._context, value);
} catch (err) {
if (config_1.config.useDeprecatedSynchronousErrorHandling) {
parent.syncErrorValue = err;
parent.syncErrorThrown = true;
return true;
} else {
hostReportError_1.hostReportError(err);
return true;
}
}
return false;
};
SafeSubscriber2.prototype._unsubscribe = function() {
var _parentSubscriber = this._parentSubscriber;
this._context = null;
this._parentSubscriber = null;
_parentSubscriber.unsubscribe();
};
return SafeSubscriber2;
}(Subscriber);
exports.SafeSubscriber = SafeSubscriber;
}
});
// node_modules/rxjs/internal/util/canReportError.js
var require_canReportError = __commonJS({
"node_modules/rxjs/internal/util/canReportError.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Subscriber_1 = require_Subscriber();
function canReportError(observer) {
while (observer) {
var _a = observer, closed_1 = _a.closed, destination = _a.destination, isStopped = _a.isStopped;
if (closed_1 || isStopped) {
return false;
} else if (destination && destination instanceof Subscriber_1.Subscriber) {
observer = destination;
} else {
observer = null;
}
}
return true;
}
exports.canReportError = canReportError;
}
});
// node_modules/rxjs/internal/util/toSubscriber.js
var require_toSubscriber = __commonJS({
"node_modules/rxjs/internal/util/toSubscriber.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Subscriber_1 = require_Subscriber();
var rxSubscriber_1 = require_rxSubscriber();
var Observer_1 = require_Observer();
function toSubscriber(nextOrObserver, error, complete) {
if (nextOrObserver) {
if (nextOrObserver instanceof Subscriber_1.Subscriber) {
return nextOrObserver;
}
if (nextOrObserver[rxSubscriber_1.rxSubscriber]) {
return nextOrObserver[rxSubscriber_1.rxSubscriber]();
}
}
if (!nextOrObserver && !error && !complete) {
return new Subscriber_1.Subscriber(Observer_1.empty);
}
return new Subscriber_1.Subscriber(nextOrObserver, error, complete);
}
exports.toSubscriber = toSubscriber;
}
});
// node_modules/rxjs/internal/symbol/observable.js
var require_observable = __commonJS({
"node_modules/rxjs/internal/symbol/observable.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.observable = function() {
return typeof Symbol === "function" && Symbol.observable || "@@observable";
}();
}
});
// node_modules/rxjs/internal/util/identity.js
var require_identity = __commonJS({
"node_modules/rxjs/internal/util/identity.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function identity(x) {
return x;
}
exports.identity = identity;
}
});
// node_modules/rxjs/internal/util/pipe.js
var require_pipe = __commonJS({
"node_modules/rxjs/internal/util/pipe.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var identity_1 = require_identity();
function pipe() {
var fns = [];
for (var _i = 0; _i < arguments.length; _i++) {
fns[_i] = arguments[_i];
}
return pipeFromArray(fns);
}
exports.pipe = pipe;
function pipeFromArray(fns) {
if (fns.length === 0) {
return identity_1.identity;
}
if (fns.length === 1) {
return fns[0];
}
return function piped(input) {
return fns.reduce(function(prev, fn) {
return fn(prev);
}, input);
};
}
exports.pipeFromArray = pipeFromArray;
}
});
// node_modules/rxjs/internal/Observable.js
var require_Observable = __commonJS({
"node_modules/rxjs/internal/Observable.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var canReportError_1 = require_canReportError();
var toSubscriber_1 = require_toSubscriber();
var observable_1 = require_observable();
var pipe_1 = require_pipe();
var config_1 = require_config();
var Observable = function() {
function Observable2(subscribe) {
this._isScalar = false;
if (subscribe) {
this._subscribe = subscribe;
}
}
Observable2.prototype.lift = function(operator) {
var observable = new Observable2();
observable.source = this;
observable.operator = operator;
return observable;
};
Observable2.prototype.subscribe = function(observerOrNext, error, complete) {
var operator = this.operator;
var sink = toSubscriber_1.toSubscriber(observerOrNext, error, complete);
if (operator) {
sink.add(operator.call(sink, this.source));
} else {
sink.add(this.source || config_1.config.useDeprecatedSynchronousErrorHandling && !sink.syncErrorThrowable ? this._subscribe(sink) : this._trySubscribe(sink));
}
if (config_1.config.useDeprecatedSynchronousErrorHandling) {
if (sink.syncErrorThrowable) {
sink.syncErrorThrowable = false;
if (sink.syncErrorThrown) {
throw sink.syncErrorValue;
}
}
}
return sink;
};
Observable2.prototype._trySubscribe = function(sink) {
try {
return this._subscribe(sink);
} catch (err) {
if (config_1.config.useDeprecatedSynchronousErrorHandling) {
sink.syncErrorThrown = true;
sink.syncErrorValue = err;
}
if (canReportError_1.canReportError(sink)) {
sink.error(err);
} else {
console.warn(err);
}
}
};
Observable2.prototype.forEach = function(next, promiseCtor) {
var _this = this;
promiseCtor = getPromiseCtor(promiseCtor);
return new promiseCtor(function(resolve, reject) {
var subscription;
subscription = _this.subscribe(function(value) {
try {
next(value);
} catch (err) {
reject(err);
if (subscription) {
subscription.unsubscribe();
}
}
}, reject, resolve);
});
};
Observable2.prototype._subscribe = function(subscriber) {
var source = this.source;
return source && source.subscribe(subscriber);
};
Observable2.prototype[observable_1.observable] = function() {
return this;
};
Observable2.prototype.pipe = function() {
var operations = [];
for (var _i = 0; _i < arguments.length; _i++) {
operations[_i] = arguments[_i];
}
if (operations.length === 0) {
return this;
}
return pipe_1.pipeFromArray(operations)(this);
};
Observable2.prototype.toPromise = function(promiseCtor) {
var _this = this;
promiseCtor = getPromiseCtor(promiseCtor);
return new promiseCtor(function(resolve, reject) {
var value;
_this.subscribe(function(x) {
return value = x;
}, function(err) {
return reject(err);
}, function() {
return resolve(value);
});
});
};
Observable2.create = function(subscribe) {
return new Observable2(subscribe);
};
return Observable2;
}();
exports.Observable = Observable;
function getPromiseCtor(promiseCtor) {
if (!promiseCtor) {
promiseCtor = config_1.config.Promise || Promise;
}
if (!promiseCtor) {
throw new Error("no Promise impl found");
}
return promiseCtor;
}
}
});
// node_modules/rxjs/internal/util/ObjectUnsubscribedError.js
var require_ObjectUnsubscribedError = __commonJS({
"node_modules/rxjs/internal/util/ObjectUnsubscribedError.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var ObjectUnsubscribedErrorImpl = function() {
function ObjectUnsubscribedErrorImpl2() {
Error.call(this);
this.message = "object unsubscribed";
this.name = "ObjectUnsubscribedError";
return this;
}
ObjectUnsubscribedErrorImpl2.prototype = Object.create(Error.prototype);
return ObjectUnsubscribedErrorImpl2;
}();
exports.ObjectUnsubscribedError = ObjectUnsubscribedErrorImpl;
}
});
// node_modules/rxjs/internal/SubjectSubscription.js
var require_SubjectSubscription = __commonJS({
"node_modules/rxjs/internal/SubjectSubscription.js"(exports) {
"use strict";
var __extends = exports && exports.__extends || /* @__PURE__ */ function() {
var extendStatics = function(d, b) {
extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
d2.__proto__ = b2;
} || function(d2, b2) {
for (var p in b2)
if (b2.hasOwnProperty(p))
d2[p] = b2[p];
};
return extendStatics(d, b);
};
return function(d, b) {
extendStatics(d, b);
function __() {
this.constructor = d;
}
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
}();
Object.defineProperty(exports, "__esModule", { value: true });
var Subscription_1 = require_Subscription();
var SubjectSubscription = function(_super) {
__extends(SubjectSubscription2, _super);
function SubjectSubscription2(subject, subscriber) {
var _this = _super.call(this) || this;
_this.subject = subject;
_this.subscriber = subscriber;
_this.closed = false;
return _this;
}
SubjectSubscription2.prototype.unsubscribe = function() {
if (this.closed) {
return;
}
this.closed = true;
var subject = this.subject;
var observers = subject.observers;
this.subject = null;
if (!observers || observers.length === 0 || subject.isStopped || subject.closed) {
return;
}
var subscriberIndex = observers.indexOf(this.subscriber);
if (subscriberIndex !== -1) {
observers.splice(subscriberIndex, 1);
}
};
return SubjectSubscription2;
}(Subscription_1.Subscription);
exports.SubjectSubscription = SubjectSubscription;
}
});
// node_modules/rxjs/internal/Subject.js
var require_Subject = __commonJS({
"node_modules/rxjs/internal/Subject.js"(exports) {
"use strict";
var __extends = exports && exports.__extends || /* @__PURE__ */ function() {
var extendStatics = function(d, b) {
extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
d2.__proto__ = b2;
} || function(d2, b2) {
for (var p in b2)
if (b2.hasOwnProperty(p))
d2[p] = b2[p];
};
return extendStatics(d, b);
};
return function(d, b) {
extendStatics(d, b);
function __() {
this.constructor = d;
}
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
}();
Object.defineProperty(exports, "__esModule", { value: true });
var Observable_1 = require_Observable();
var Subscriber_1 = require_Subscriber();
var Subscription_1 = require_Subscription();
var ObjectUnsubscribedError_1 = require_ObjectUnsubscribedError();
var SubjectSubscription_1 = require_SubjectSubscription();
var rxSubscriber_1 = require_rxSubscriber();
var SubjectSubscriber = function(_super) {
__extends(SubjectSubscriber2, _super);
function SubjectSubscriber2(destination) {
var _this = _super.call(this, destination) || this;
_this.destination = destination;
return _this;
}
return SubjectSubscriber2;
}(Subscriber_1.Subscriber);
exports.SubjectSubscriber = SubjectSubscriber;
var Subject = function(_super) {
__extends(Subject2, _super);
function Subject2() {
var _this = _super.call(this) || this;
_this.observers = [];
_this.closed = false;
_this.isStopped = false;
_this.hasError = false;
_this.thrownError = null;
return _this;
}
Subject2.prototype[rxSubscriber_1.rxSubscriber] = function() {
return new SubjectSubscriber(this);
};
Subject2.prototype.lift = function(operator) {
var subject = new AnonymousSubject(this, this);
subject.operator = operator;
return subject;
};
Subject2.prototype.next = function(value) {
if (this.closed) {
throw new ObjectUnsubscribedError_1.ObjectUnsubscribedError();
}
if (!this.isStopped) {
var observers = this.observers;
var len = observers.length;
var copy = observers.slice();
for (var i = 0; i < len; i++) {
copy[i].next(value);
}
}
};
Subject2.prototype.error = function(err) {
if (this.closed) {
throw new ObjectUnsubscribedError_1.ObjectUnsubscribedError();
}
this.hasError = true;
this.thrownError = err;
this.isStopped = true;
var observers = this.observers;
var len = observers.length;
var copy = observers.slice();
for (var i = 0; i < len; i++) {
copy[i].error(err);
}
this.observers.length = 0;
};
Subject2.prototype.complete = function() {
if (this.closed) {
throw new ObjectUnsubscribedError_1.ObjectUnsubscribedError();
}
this.isStopped = true;
var observers = this.observers;
var len = observers.length;
var copy = observers.slice();
for (var i = 0; i < len; i++) {
copy[i].complete();
}
this.observers.length = 0;
};
Subject2.prototype.unsubscribe = function() {
this.isStopped = true;
this.closed = true;
this.observers = null;
};
Subject2.prototype._trySubscribe = function(subscriber) {
if (this.closed) {
throw new ObjectUnsubscribedError_1.ObjectUnsubscribedError();
} else {
return _super.prototype._trySubscribe.call(this, subscriber);
}
};
Subject2.prototype._subscribe = function(subscriber) {
if (this.closed) {
throw new ObjectUnsubscribedError_1.ObjectUnsubscribedError();
} else if (this.hasError) {
subscriber.error(this.thrownError);
return Subscription_1.Subscription.EMPTY;
} else if (this.isStopped) {
subscriber.complete();
return Subscription_1.Subscription.EMPTY;
} else {
this.observers.push(subscriber);
return new SubjectSubscription_1.SubjectSubscription(this, subscriber);
}
};
Subject2.prototype.asObservable = function() {
var observable = new Observable_1.Observable();
observable.source = this;
return observable;
};
Subject2.create = function(destination, source) {
return new AnonymousSubject(destination, source);
};
return Subject2;
}(Observable_1.Observable);
exports.Subject = Subject;
var AnonymousSubject = function(_super) {
__extends(AnonymousSubject2, _super);
function AnonymousSubject2(destination, source) {
var _this = _super.call(this) || this;
_this.destination = destination;
_this.source = source;
return _this;
}
AnonymousSubject2.prototype.next = function(value) {
var destination = this.destination;
if (destination && destination.next) {
destination.next(value);
}
};
AnonymousSubject2.prototype.error = function(err) {
var destination = this.destination;
if (destination && destination.error) {