summaryrefslogtreecommitdiff
path: root/docs/static/js/application.js
blob: 6245bb4fed390fa96f3d7101bb0cd9388d00e03c (plain)
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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
function pegasus(t, e) {
    return (
        (e = new XMLHttpRequest()),
        e.open("GET", t),
        (t = []),
        (e.onreadystatechange = e.then = function (n, o, i, r) {
            if (
                (n && n.call && (t = [, n, o]),
                    4 == e.readyState && (i = t[0 | (e.status / 200)]))
            ) {
                try {
                    r = JSON.parse(e.responseText);
                } catch (s) {
                    r = null;
                }
                i(r, e);
            }
        }),
        e.send(),
        e
    );
}
if (
    ("document" in self &&
        ("classList" in document.createElement("_")
            ? !(function () {
                "use strict";
                var t = document.createElement("_");
                if ((t.classList.add("c1", "c2"), !t.classList.contains("c2"))) {
                    var e = function (t) {
                        var e = DOMTokenList.prototype[t];
                        DOMTokenList.prototype[t] = function (t) {
                            var n,
                                o = arguments.length;
                            for (n = 0; o > n; n++) (t = arguments[n]), e.call(this, t);
                        };
                    };
                    e("add"), e("remove");
                }
                if ((t.classList.toggle("c3", !1), t.classList.contains("c3"))) {
                    var n = DOMTokenList.prototype.toggle;
                    DOMTokenList.prototype.toggle = function (t, e) {
                        return 1 in arguments && !this.contains(t) == !e
                            ? e
                            : n.call(this, t);
                    };
                }
                t = null;
            })()
            : !(function (t) {
                "use strict";
                if ("Element" in t) {
                    var e = "classList",
                        n = "prototype",
                        o = t.Element[n],
                        i = Object,
                        r =
                            String[n].trim ||
                            function () {
                                return this.replace(/^\s+|\s+$/g, "");
                            },
                        s =
                            Array[n].indexOf ||
                            function (t) {
                                for (var e = 0, n = this.length; n > e; e++)
                                    if (e in this && this[e] === t) return e;
                                return -1;
                            },
                        a = function (t, e) {
                            (this.name = t),
                                (this.code = DOMException[t]),
                                (this.message = e);
                        },
                        c = function (t, e) {
                            if ("" === e)
                                throw new a(
                                    "SYNTAX_ERR",
                                    "An invalid or illegal string was specified"
                                );
                            if (/\s/.test(e))
                                throw new a(
                                    "INVALID_CHARACTER_ERR",
                                    "String contains an invalid character"
                                );
                            return s.call(t, e);
                        },
                        l = function (t) {
                            for (
                                var e = r.call(t.getAttribute("class") || ""),
                                n = e ? e.split(/\s+/) : [],
                                o = 0,
                                i = n.length;
                                i > o;
                                o++
                            )
                                this.push(n[o]);
                            this._updateClassName = function () {
                                t.setAttribute("class", this.toString());
                            };
                        },
                        u = (l[n] = []),
                        d = function () {
                            return new l(this);
                        };
                    if (
                        ((a[n] = Error[n]),
                            (u.item = function (t) {
                                return this[t] || null;
                            }),
                            (u.contains = function (t) {
                                return (t += ""), -1 !== c(this, t);
                            }),
                            (u.add = function () {
                                var t,
                                    e = arguments,
                                    n = 0,
                                    o = e.length,
                                    i = !1;
                                do
                                    (t = e[n] + ""),
                                        -1 === c(this, t) && (this.push(t), (i = !0));
                                while (++n < o);
                                i && this._updateClassName();
                            }),
                            (u.remove = function () {
                                var t,
                                    e,
                                    n = arguments,
                                    o = 0,
                                    i = n.length,
                                    r = !1;
                                do
                                    for (t = n[o] + "", e = c(this, t); -1 !== e;)
                                        this.splice(e, 1), (r = !0), (e = c(this, t));
                                while (++o < i);
                                r && this._updateClassName();
                            }),
                            (u.toggle = function (t, e) {
                                t += "";
                                var n = this.contains(t),
                                    o = n ? e !== !0 && "remove" : e !== !1 && "add";
                                return o && this[o](t), e === !0 || e === !1 ? e : !n;
                            }),
                            (u.toString = function () {
                                return this.join(" ");
                            }),
                            i.defineProperty)
                    ) {
                        var h = { get: d, enumerable: !0, configurable: !0 };
                        try {
                            i.defineProperty(o, e, h);
                        } catch (f) {
                            -2146823252 === f.number &&
                                ((h.enumerable = !1), i.defineProperty(o, e, h));
                        }
                    } else i[n].__defineGetter__ && o.__defineGetter__(e, d);
                }
            })(self)),
        (function () {
            "use strict";
            function t(e, o) {
                function i(t, e) {
                    return function () {
                        return t.apply(e, arguments);
                    };
                }
                var r;
                if (
                    ((o = o || {}),
                        (this.trackingClick = !1),
                        (this.trackingClickStart = 0),
                        (this.targetElement = null),
                        (this.touchStartX = 0),
                        (this.touchStartY = 0),
                        (this.lastTouchIdentifier = 0),
                        (this.touchBoundary = o.touchBoundary || 10),
                        (this.layer = e),
                        (this.tapDelay = o.tapDelay || 200),
                        (this.tapTimeout = o.tapTimeout || 700),
                        !t.notNeeded(e))
                ) {
                    for (
                        var s = [
                            "onMouse",
                            "onClick",
                            "onTouchStart",
                            "onTouchMove",
                            "onTouchEnd",
                            "onTouchCancel"
                        ],
                        a = this,
                        c = 0,
                        l = s.length;
                        l > c;
                        c++
                    )
                        a[s[c]] = i(a[s[c]], a);
                    n &&
                        (e.addEventListener("mouseover", this.onMouse, !0),
                            e.addEventListener("mousedown", this.onMouse, !0),
                            e.addEventListener("mouseup", this.onMouse, !0)),
                        e.addEventListener("click", this.onClick, !0),
                        e.addEventListener("touchstart", this.onTouchStart, !1),
                        e.addEventListener("touchmove", this.onTouchMove, !1),
                        e.addEventListener("touchend", this.onTouchEnd, !1),
                        e.addEventListener("touchcancel", this.onTouchCancel, !1),
                        Event.prototype.stopImmediatePropagation ||
                        ((e.removeEventListener = function (t, n, o) {
                            var i = Node.prototype.removeEventListener;
                            "click" === t
                                ? i.call(e, t, n.hijacked || n, o)
                                : i.call(e, t, n, o);
                        }),
                            (e.addEventListener = function (t, n, o) {
                                var i = Node.prototype.addEventListener;
                                "click" === t
                                    ? i.call(
                                        e,
                                        t,
                                        n.hijacked ||
                                        (n.hijacked = function (t) {
                                            t.propagationStopped || n(t);
                                        }),
                                        o
                                    )
                                    : i.call(e, t, n, o);
                            })),
                        "function" == typeof e.onclick &&
                        ((r = e.onclick),
                            e.addEventListener(
                                "click",
                                function (t) {
                                    r(t);
                                },
                                !1
                            ),
                            (e.onclick = null));
                }
            }
            var e = navigator.userAgent.indexOf("Windows Phone") >= 0,
                n = navigator.userAgent.indexOf("Android") > 0 && !e,
                o = /iP(ad|hone|od)/.test(navigator.userAgent) && !e,
                i = o && /OS 4_\d(_\d)?/.test(navigator.userAgent),
                r = o && /OS [6-7]_\d/.test(navigator.userAgent),
                s = navigator.userAgent.indexOf("BB10") > 0;
            (t.prototype.needsClick = function (t) {
                switch (t.nodeName.toLowerCase()) {
                    case "button":
                    case "select":
                    case "textarea":
                        if (t.disabled) return !0;
                        break;
                    case "input":
                        if ((o && "file" === t.type) || t.disabled) return !0;
                        break;
                    case "label":
                    case "iframe":
                    case "video":
                        return !0;
                }
                return /\bneedsclick\b/.test(t.className);
            }),
                (t.prototype.needsFocus = function (t) {
                    switch (t.nodeName.toLowerCase()) {
                        case "textarea":
                            return !0;
                        case "select":
                            return !n;
                        case "input":
                            switch (t.type) {
                                case "button":
                                case "checkbox":
                                case "file":
                                case "image":
                                case "radio":
                                case "submit":
                                    return !1;
                            }
                            return !t.disabled && !t.readOnly;
                        default:
                            return /\bneedsfocus\b/.test(t.className);
                    }
                }),
                (t.prototype.sendClick = function (t, e) {
                    var n, o;
                    document.activeElement &&
                        document.activeElement !== t &&
                        document.activeElement.blur(),
                        (o = e.changedTouches[0]),
                        (n = document.createEvent("MouseEvents")),
                        n.initMouseEvent(
                            this.determineEventType(t),
                            !0,
                            !0,
                            window,
                            1,
                            o.screenX,
                            o.screenY,
                            o.clientX,
                            o.clientY,
                            !1,
                            !1,
                            !1,
                            !1,
                            0,
                            null
                        ),
                        (n.forwardedTouchEvent = !0),
                        t.dispatchEvent(n);
                }),
                (t.prototype.determineEventType = function (t) {
                    return n && "select" === t.tagName.toLowerCase()
                        ? "mousedown"
                        : "click";
                }),
                (t.prototype.focus = function (t) {
                    var e;
                    o &&
                        t.setSelectionRange &&
                        0 !== t.type.indexOf("date") &&
                        "time" !== t.type &&
                        "month" !== t.type
                        ? ((e = t.value.length), t.setSelectionRange(e, e))
                        : t.focus();
                }),
                (t.prototype.updateScrollParent = function (t) {
                    var e, n;
                    if (((e = t.fastClickScrollParent), !e || !e.contains(t))) {
                        n = t;
                        do {
                            if (n.scrollHeight > n.offsetHeight) {
                                (e = n), (t.fastClickScrollParent = n);
                                break;
                            }
                            n = n.parentElement;
                        } while (n);
                    }
                    e && (e.fastClickLastScrollTop = e.scrollTop);
                }),
                (t.prototype.getTargetElementFromEventTarget = function (t) {
                    return t.nodeType === Node.TEXT_NODE ? t.parentNode : t;
                }),
                (t.prototype.onTouchStart = function (t) {
                    var e, n, r;
                    if (t.targetTouches.length > 1) return !0;
                    if (
                        ((e = this.getTargetElementFromEventTarget(t.target)),
                            (n = t.targetTouches[0]),
                            o)
                    ) {
                        if (((r = window.getSelection()), r.rangeCount && !r.isCollapsed))
                            return !0;
                        if (!i) {
                            if (n.identifier && n.identifier === this.lastTouchIdentifier)
                                return t.preventDefault(), !1;
                            (this.lastTouchIdentifier = n.identifier),
                                this.updateScrollParent(e);
                        }
                    }
                    return (
                        (this.trackingClick = !0),
                        (this.trackingClickStart = t.timeStamp),
                        (this.targetElement = e),
                        (this.touchStartX = n.pageX),
                        (this.touchStartY = n.pageY),
                        t.timeStamp - this.lastClickTime < this.tapDelay &&
                        t.preventDefault(),
                        !0
                    );
                }),
                (t.prototype.touchHasMoved = function (t) {
                    var e = t.changedTouches[0],
                        n = this.touchBoundary;
                    return Math.abs(e.pageX - this.touchStartX) > n ||
                        Math.abs(e.pageY - this.touchStartY) > n
                        ? !0
                        : !1;
                }),
                (t.prototype.onTouchMove = function (t) {
                    return this.trackingClick
                        ? ((this.targetElement !==
                            this.getTargetElementFromEventTarget(t.target) ||
                            this.touchHasMoved(t)) &&
                            ((this.trackingClick = !1), (this.targetElement = null)),
                            !0)
                        : !0;
                }),
                (t.prototype.findControl = function (t) {
                    return void 0 !== t.control
                        ? t.control
                        : t.htmlFor
                            ? document.getElementById(t.htmlFor)
                            : t.querySelector(
                                "button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea"
                            );
                }),
                (t.prototype.onTouchEnd = function (t) {
                    var e,
                        s,
                        a,
                        c,
                        l,
                        u = this.targetElement;
                    if (!this.trackingClick) return !0;
                    if (t.timeStamp - this.lastClickTime < this.tapDelay)
                        return (this.cancelNextClick = !0), !0;
                    if (t.timeStamp - this.trackingClickStart > this.tapTimeout) return !0;
                    if (
                        ((this.cancelNextClick = !1),
                            (this.lastClickTime = t.timeStamp),
                            (s = this.trackingClickStart),
                            (this.trackingClick = !1),
                            (this.trackingClickStart = 0),
                            r &&
                            ((l = t.changedTouches[0]),
                                (u =
                                    document.elementFromPoint(
                                        l.pageX - window.pageXOffset,
                                        l.pageY - window.pageYOffset
                                    ) || u),
                                (u.fastClickScrollParent = this.targetElement.fastClickScrollParent)),
                            (a = u.tagName.toLowerCase()),
                            "label" === a)
                    ) {
                        if ((e = this.findControl(u))) {
                            if ((this.focus(u), n)) return !1;
                            u = e;
                        }
                    } else if (this.needsFocus(u))
                        return t.timeStamp - s > 100 ||
                            (o && window.top !== window && "input" === a)
                            ? ((this.targetElement = null), !1)
                            : (this.focus(u),
                                this.sendClick(u, t),
                                (o && "select" === a) ||
                                ((this.targetElement = null), t.preventDefault()),
                                !1);
                    return o &&
                        !i &&
                        ((c = u.fastClickScrollParent),
                            c && c.fastClickLastScrollTop !== c.scrollTop)
                        ? !0
                        : (this.needsClick(u) || (t.preventDefault(), this.sendClick(u, t)),
                            !1);
                }),
                (t.prototype.onTouchCancel = function () {
                    (this.trackingClick = !1), (this.targetElement = null);
                }),
                (t.prototype.onMouse = function (t) {
                    return this.targetElement
                        ? t.forwardedTouchEvent
                            ? !0
                            : t.cancelable &&
                                (!this.needsClick(this.targetElement) || this.cancelNextClick)
                                ? (t.stopImmediatePropagation
                                    ? t.stopImmediatePropagation()
                                    : (t.propagationStopped = !0),
                                    t.stopPropagation(),
                                    t.preventDefault(),
                                    !1)
                                : !0
                        : !0;
                }),
                (t.prototype.onClick = function (t) {
                    var e;
                    return this.trackingClick
                        ? ((this.targetElement = null), (this.trackingClick = !1), !0)
                        : "submit" === t.target.type && 0 === t.detail
                            ? !0
                            : ((e = this.onMouse(t)), e || (this.targetElement = null), e);
                }),
                (t.prototype.destroy = function () {
                    var t = this.layer;
                    n &&
                        (t.removeEventListener("mouseover", this.onMouse, !0),
                            t.removeEventListener("mousedown", this.onMouse, !0),
                            t.removeEventListener("mouseup", this.onMouse, !0)),
                        t.removeEventListener("click", this.onClick, !0),
                        t.removeEventListener("touchstart", this.onTouchStart, !1),
                        t.removeEventListener("touchmove", this.onTouchMove, !1),
                        t.removeEventListener("touchend", this.onTouchEnd, !1),
                        t.removeEventListener("touchcancel", this.onTouchCancel, !1);
                }),
                (t.notNeeded = function (t) {
                    var e, o, i, r;
                    if ("undefined" == typeof window.ontouchstart) return !0;
                    if ((o = +(/Chrome\/([0-9]+)/.exec(navigator.userAgent) || [, 0])[1])) {
                        if (!n) return !0;
                        if ((e = document.querySelector("meta[name=viewport]"))) {
                            if (-1 !== e.content.indexOf("user-scalable=no")) return !0;
                            if (
                                o > 31 &&
                                document.documentElement.scrollWidth <= window.outerWidth
                            )
                                return !0;
                        }
                    }
                    if (
                        s &&
                        ((i = navigator.userAgent.match(/Version\/([0-9]*)\.([0-9]*)/)),
                            i[1] >= 10 &&
                            i[2] >= 3 &&
                            (e = document.querySelector("meta[name=viewport]")))
                    ) {
                        if (-1 !== e.content.indexOf("user-scalable=no")) return !0;
                        if (document.documentElement.scrollWidth <= window.outerWidth)
                            return !0;
                    }
                    return "none" === t.style.msTouchAction ||
                        "manipulation" === t.style.touchAction
                        ? !0
                        : ((r = +(/Firefox\/([0-9]+)/.exec(navigator.userAgent) || [, 0])[1]),
                            r >= 27 &&
                                ((e = document.querySelector("meta[name=viewport]")),
                                    e &&
                                    (-1 !== e.content.indexOf("user-scalable=no") ||
                                        document.documentElement.scrollWidth <= window.outerWidth))
                                ? !0
                                : "none" === t.style.touchAction ||
                                    "manipulation" === t.style.touchAction
                                    ? !0
                                    : !1);
                }),
                (t.attach = function (e, n) {
                    return new t(e, n);
                }),
                "function" == typeof define && "object" == typeof define.amd && define.amd
                    ? define(function () {
                        return t;
                    })
                    : "undefined" != typeof module && module.exports
                        ? ((module.exports = t.attach), (module.exports.FastClick = t))
                        : (window.FastClick = t);
        })(),
        (function () {
            var t = function (e) {
                var n = new t.Index();
                return (
                    n.pipeline.add(t.trimmer, t.stopWordFilter, t.stemmer),
                    e && e.call(n, n),
                    n
                );
            };
            (t.version = "0.6.0"),
                (t.utils = {}),
                (t.utils.warn = (function (t) {
                    return function (e) {
                        t.console && console.warn && console.warn(e);
                    };
                })(this)),
                (t.utils.asString = function (t) {
                    return void 0 === t || null === t ? "" : t.toString();
                }),
                (t.EventEmitter = function () {
                    this.events = {};
                }),
                (t.EventEmitter.prototype.addListener = function () {
                    var t = Array.prototype.slice.call(arguments),
                        e = t.pop(),
                        n = t;
                    if ("function" != typeof e)
                        throw new TypeError("last argument must be a function");
                    n.forEach(function (t) {
                        this.hasHandler(t) || (this.events[t] = []), this.events[t].push(e);
                    }, this);
                }),
                (t.EventEmitter.prototype.removeListener = function (t, e) {
                    if (this.hasHandler(t)) {
                        var n = this.events[t].indexOf(e);
                        this.events[t].splice(n, 1),
                            this.events[t].length || delete this.events[t];
                    }
                }),
                (t.EventEmitter.prototype.emit = function (t) {
                    if (this.hasHandler(t)) {
                        var e = Array.prototype.slice.call(arguments, 1);
                        this.events[t].forEach(function (t) {
                            t.apply(void 0, e);
                        });
                    }
                }),
                (t.EventEmitter.prototype.hasHandler = function (t) {
                    return t in this.events;
                }),
                (t.tokenizer = function (e) {
                    return arguments.length && null != e && void 0 != e
                        ? Array.isArray(e)
                            ? e.map(function (e) {
                                return t.utils.asString(e).toLowerCase();
                            })
                            : e
                                .toString()
                                .trim()
                                .toLowerCase()
                                .split(t.tokenizer.seperator)
                        : [];
                }),
                (t.tokenizer.seperator = /[\s\-]+/),
                (t.Pipeline = function () {
                    this._stack = [];
                }),
                (t.Pipeline.registeredFunctions = {}),
                (t.Pipeline.registerFunction = function (e, n) {
                    n in this.registeredFunctions &&
                        t.utils.warn("Overwriting existing registered function: " + n),
                        (e.label = n),
                        (t.Pipeline.registeredFunctions[e.label] = e);
                }),
                (t.Pipeline.warnIfFunctionNotRegistered = function (e) {
                    var n = e.label && e.label in this.registeredFunctions;
                    n ||
                        t.utils.warn(
                            "Function is not registered with pipeline. This may cause problems when serialising the index.\n",
                            e
                        );
                }),
                (t.Pipeline.load = function (e) {
                    var n = new t.Pipeline();
                    return (
                        e.forEach(function (e) {
                            var o = t.Pipeline.registeredFunctions[e];
                            if (!o) throw new Error("Cannot load un-registered function: " + e);
                            n.add(o);
                        }),
                        n
                    );
                }),
                (t.Pipeline.prototype.add = function () {
                    var e = Array.prototype.slice.call(arguments);
                    e.forEach(function (e) {
                        t.Pipeline.warnIfFunctionNotRegistered(e), this._stack.push(e);
                    }, this);
                }),
                (t.Pipeline.prototype.after = function (e, n) {
                    t.Pipeline.warnIfFunctionNotRegistered(n);
                    var o = this._stack.indexOf(e);
                    if (-1 == o) throw new Error("Cannot find existingFn");
                    (o += 1), this._stack.splice(o, 0, n);
                }),
                (t.Pipeline.prototype.before = function (e, n) {
                    t.Pipeline.warnIfFunctionNotRegistered(n);
                    var o = this._stack.indexOf(e);
                    if (-1 == o) throw new Error("Cannot find existingFn");
                    this._stack.splice(o, 0, n);
                }),
                (t.Pipeline.prototype.remove = function (t) {
                    var e = this._stack.indexOf(t);
                    -1 != e && this._stack.splice(e, 1);
                }),
                (t.Pipeline.prototype.run = function (t) {
                    for (
                        var e = [], n = t.length, o = this._stack.length, i = 0;
                        n > i;
                        i++
                    ) {
                        for (
                            var r = t[i], s = 0;
                            o > s && ((r = this._stack[s](r, i, t)), void 0 !== r && "" !== r);
                            s++
                        );
                        void 0 !== r && "" !== r && e.push(r);
                    }
                    return e;
                }),
                (t.Pipeline.prototype.reset = function () {
                    this._stack = [];
                }),
                (t.Pipeline.prototype.toJSON = function () {
                    return this._stack.map(function (e) {
                        return t.Pipeline.warnIfFunctionNotRegistered(e), e.label;
                    });
                }),
                (t.Vector = function () {
                    (this._magnitude = null), (this.list = void 0), (this.length = 0);
                }),
                (t.Vector.Node = function (t, e, n) {
                    (this.idx = t), (this.val = e), (this.next = n);
                }),
                (t.Vector.prototype.insert = function (e, n) {
                    this._magnitude = void 0;
                    var o = this.list;
                    if (!o) return (this.list = new t.Vector.Node(e, n, o)), this.length++;
                    if (e < o.idx)
                        return (this.list = new t.Vector.Node(e, n, o)), this.length++;
                    for (var i = o, r = o.next; void 0 != r;) {
                        if (e < r.idx)
                            return (i.next = new t.Vector.Node(e, n, r)), this.length++;
                        (i = r), (r = r.next);
                    }
                    return (i.next = new t.Vector.Node(e, n, r)), this.length++;
                }),
                (t.Vector.prototype.magnitude = function () {
                    if (this._magnitude) return this._magnitude;
                    for (var t, e = this.list, n = 0; e;)
                        (t = e.val), (n += t * t), (e = e.next);
                    return (this._magnitude = Math.sqrt(n));
                }),
                (t.Vector.prototype.dot = function (t) {
                    for (var e = this.list, n = t.list, o = 0; e && n;)
                        e.idx < n.idx
                            ? (e = e.next)
                            : e.idx > n.idx
                                ? (n = n.next)
                                : ((o += e.val * n.val), (e = e.next), (n = n.next));
                    return o;
                }),
                (t.Vector.prototype.similarity = function (t) {
                    return this.dot(t) / (this.magnitude() * t.magnitude());
                }),
                (t.SortedSet = function () {
                    (this.length = 0), (this.elements = []);
                }),
                (t.SortedSet.load = function (t) {
                    var e = new this();
                    return (e.elements = t), (e.length = t.length), e;
                }),
                (t.SortedSet.prototype.add = function () {
                    var t, e;
                    for (t = 0; t < arguments.length; t++)
                        (e = arguments[t]),
                            ~this.indexOf(e) || this.elements.splice(this.locationFor(e), 0, e);
                    this.length = this.elements.length;
                }),
                (t.SortedSet.prototype.toArray = function () {
                    return this.elements.slice();
                }),
                (t.SortedSet.prototype.map = function (t, e) {
                    return this.elements.map(t, e);
                }),
                (t.SortedSet.prototype.forEach = function (t, e) {
                    return this.elements.forEach(t, e);
                }),
                (t.SortedSet.prototype.indexOf = function (t) {
                    for (
                        var e = 0,
                        n = this.elements.length,
                        o = n - e,
                        i = e + Math.floor(o / 2),
                        r = this.elements[i];
                        o > 1;

                    ) {
                        if (r === t) return i;
                        t > r && (e = i),
                            r > t && (n = i),
                            (o = n - e),
                            (i = e + Math.floor(o / 2)),
                            (r = this.elements[i]);
                    }
                    return r === t ? i : -1;
                }),
                (t.SortedSet.prototype.locationFor = function (t) {
                    for (
                        var e = 0,
                        n = this.elements.length,
                        o = n - e,
                        i = e + Math.floor(o / 2),
                        r = this.elements[i];
                        o > 1;

                    )
                        t > r && (e = i),
                            r > t && (n = i),
                            (o = n - e),
                            (i = e + Math.floor(o / 2)),
                            (r = this.elements[i]);
                    return r > t ? i : t > r ? i + 1 : void 0;
                }),
                (t.SortedSet.prototype.intersect = function (e) {
                    for (
                        var n = new t.SortedSet(),
                        o = 0,
                        i = 0,
                        r = this.length,
                        s = e.length,
                        a = this.elements,
                        c = e.elements;
                        ;

                    ) {
                        if (o > r - 1 || i > s - 1) break;
                        a[o] !== c[i]
                            ? a[o] < c[i]
                                ? o++
                                : a[o] > c[i] && i++
                            : (n.add(a[o]), o++ , i++);
                    }
                    return n;
                }),
                (t.SortedSet.prototype.clone = function () {
                    var e = new t.SortedSet();
                    return (e.elements = this.toArray()), (e.length = e.elements.length), e;
                }),
                (t.SortedSet.prototype.union = function (t) {
                    var e, n, o;
                    return (
                        this.length >= t.length
                            ? ((e = this), (n = t))
                            : ((e = t), (n = this)),
                        (o = e.clone()),
                        o.add.apply(o, n.toArray()),
                        o
                    );
                }),
                (t.SortedSet.prototype.toJSON = function () {
                    return this.toArray();
                }),
                (t.Index = function () {
                    (this._fields = []),
                        (this._ref = "id"),
                        (this.pipeline = new t.Pipeline()),
                        (this.documentStore = new t.Store()),
                        (this.tokenStore = new t.TokenStore()),
                        (this.corpusTokens = new t.SortedSet()),
                        (this.eventEmitter = new t.EventEmitter()),
                        (this._idfCache = {}),
                        this.on(
                            "add",
                            "remove",
                            "update",
                            function () {
                                this._idfCache = {};
                            }.bind(this)
                        );
                }),
                (t.Index.prototype.on = function () {
                    var t = Array.prototype.slice.call(arguments);
                    return this.eventEmitter.addListener.apply(this.eventEmitter, t);
                }),
                (t.Index.prototype.off = function (t, e) {
                    return this.eventEmitter.removeListener(t, e);
                }),
                (t.Index.load = function (e) {
                    e.version !== t.version &&
                        t.utils.warn(
                            "version mismatch: current " + t.version + " importing " + e.version
                        );
                    var n = new this();
                    return (
                        (n._fields = e.fields),
                        (n._ref = e.ref),
                        (n.documentStore = t.Store.load(e.documentStore)),
                        (n.tokenStore = t.TokenStore.load(e.tokenStore)),
                        (n.corpusTokens = t.SortedSet.load(e.corpusTokens)),
                        (n.pipeline = t.Pipeline.load(e.pipeline)),
                        n
                    );
                }),
                (t.Index.prototype.field = function (t, e) {
                    var e = e || {},
                        n = { name: t, boost: e.boost || 1 };
                    return this._fields.push(n), this;
                }),
                (t.Index.prototype.ref = function (t) {
                    return (this._ref = t), this;
                }),
                (t.Index.prototype.add = function (e, n) {
                    var o = {},
                        i = new t.SortedSet(),
                        r = e[this._ref],
                        n = void 0 === n ? !0 : n;
                    this._fields.forEach(function (n) {
                        var r = this.pipeline.run(t.tokenizer(e[n.name]));
                        (o[n.name] = r), t.SortedSet.prototype.add.apply(i, r);
                    }, this),
                        this.documentStore.set(r, i),
                        t.SortedSet.prototype.add.apply(this.corpusTokens, i.toArray());
                    for (var s = 0; s < i.length; s++) {
                        var a = i.elements[s],
                            c = this._fields.reduce(function (t, e) {
                                var n = o[e.name].length;
                                if (!n) return t;
                                var i = o[e.name].filter(function (t) {
                                    return t === a;
                                }).length;
                                return t + (i / n) * e.boost;
                            }, 0);
                        this.tokenStore.add(a, { ref: r, tf: c });
                    }
                    n && this.eventEmitter.emit("add", e, this);
                }),
                (t.Index.prototype.remove = function (t, e) {
                    var n = t[this._ref],
                        e = void 0 === e ? !0 : e;
                    if (this.documentStore.has(n)) {
                        var o = this.documentStore.get(n);
                        this.documentStore.remove(n),
                            o.forEach(function (t) {
                                this.tokenStore.remove(t, n);
                            }, this),
                            e && this.eventEmitter.emit("remove", t, this);
                    }
                }),
                (t.Index.prototype.update = function (t, e) {
                    var e = void 0 === e ? !0 : e;
                    this.remove(t, !1),
                        this.add(t, !1),
                        e && this.eventEmitter.emit("update", t, this);
                }),
                (t.Index.prototype.idf = function (t) {
                    var e = "@" + t;
                    if (Object.prototype.hasOwnProperty.call(this._idfCache, e))
                        return this._idfCache[e];
                    var n = this.tokenStore.count(t),
                        o = 1;
                    return (
                        n > 0 && (o = 1 + Math.log(this.documentStore.length / n)),
                        (this._idfCache[e] = o)
                    );
                }),
                (t.Index.prototype.search = function (e) {
                    var n = this.pipeline.run(t.tokenizer(e)),
                        o = new t.Vector(),
                        i = [],
                        r = this._fields.reduce(function (t, e) {
                            return t + e.boost;
                        }, 0),
                        s = n.some(function (t) {
                            return this.tokenStore.has(t);
                        }, this);
                    if (!s) return [];
                    n.forEach(function (e, n, s) {
                        var a = (1 / s.length) * this._fields.length * r,
                            c = this,
                            l = this.tokenStore.expand(e).reduce(function (n, i) {
                                var r = c.corpusTokens.indexOf(i),
                                    s = c.idf(i),
                                    l = 1,
                                    u = new t.SortedSet();
                                if (i !== e) {
                                    var d = Math.max(3, i.length - e.length);
                                    l = 1 / Math.log(d);
                                }
                                r > -1 && o.insert(r, a * s * l);
                                for (
                                    var h = c.tokenStore.get(i),
                                    f = Object.keys(h),
                                    p = f.length,
                                    m = 0;
                                    p > m;
                                    m++
                                )
                                    u.add(h[f[m]].ref);
                                return n.union(u);
                            }, new t.SortedSet());
                        i.push(l);
                    }, this);
                    var a = i.reduce(function (t, e) {
                        return t.intersect(e);
                    });
                    return a
                        .map(function (t) {
                            return { ref: t, score: o.similarity(this.documentVector(t)) };
                        }, this)
                        .sort(function (t, e) {
                            return e.score - t.score;
                        });
                }),
                (t.Index.prototype.documentVector = function (e) {
                    for (
                        var n = this.documentStore.get(e),
                        o = n.length,
                        i = new t.Vector(),
                        r = 0;
                        o > r;
                        r++
                    ) {
                        var s = n.elements[r],
                            a = this.tokenStore.get(s)[e].tf,
                            c = this.idf(s);
                        i.insert(this.corpusTokens.indexOf(s), a * c);
                    }
                    return i;
                }),
                (t.Index.prototype.toJSON = function () {
                    return {
                        version: t.version,
                        fields: this._fields,
                        ref: this._ref,
                        documentStore: this.documentStore.toJSON(),
                        tokenStore: this.tokenStore.toJSON(),
                        corpusTokens: this.corpusTokens.toJSON(),
                        pipeline: this.pipeline.toJSON()
                    };
                }),
                (t.Index.prototype.use = function (t) {
                    var e = Array.prototype.slice.call(arguments, 1);
                    e.unshift(this), t.apply(this, e);
                }),
                (t.Store = function () {
                    (this.store = {}), (this.length = 0);
                }),
                (t.Store.load = function (e) {
                    var n = new this();
                    return (
                        (n.length = e.length),
                        (n.store = Object.keys(e.store).reduce(function (n, o) {
                            return (n[o] = t.SortedSet.load(e.store[o])), n;
                        }, {})),
                        n
                    );
                }),
                (t.Store.prototype.set = function (t, e) {
                    this.has(t) || this.length++ , (this.store[t] = e);
                }),
                (t.Store.prototype.get = function (t) {
                    return this.store[t];
                }),
                (t.Store.prototype.has = function (t) {
                    return t in this.store;
                }),
                (t.Store.prototype.remove = function (t) {
                    this.has(t) && (delete this.store[t], this.length--);
                }),
                (t.Store.prototype.toJSON = function () {
                    return { store: this.store, length: this.length };
                }),
                (t.stemmer = (function () {
                    var t = {
                        ational: "ate",
                        tional: "tion",
                        enci: "ence",
                        anci: "ance",
                        izer: "ize",
                        bli: "ble",
                        alli: "al",
                        entli: "ent",
                        eli: "e",
                        ousli: "ous",
                        ization: "ize",
                        ation: "ate",
                        ator: "ate",
                        alism: "al",
                        iveness: "ive",
                        fulness: "ful",
                        ousness: "ous",
                        aliti: "al",
                        iviti: "ive",
                        biliti: "ble",
                        logi: "log"
                    },
                        e = {
                            icate: "ic",
                            ative: "",
                            alize: "al",
                            iciti: "ic",
                            ical: "ic",
                            ful: "",
                            ness: ""
                        },
                        n = "[^aeiou]",
                        o = "[aeiouy]",
                        i = n + "[^aeiouy]*",
                        r = o + "[aeiou]*",
                        s = "^(" + i + ")?" + r + i,
                        a = "^(" + i + ")?" + r + i + "(" + r + ")?$",
                        c = "^(" + i + ")?" + r + i + r + i,
                        l = "^(" + i + ")?" + o,
                        u = new RegExp(s),
                        d = new RegExp(c),
                        h = new RegExp(a),
                        f = new RegExp(l),
                        p = /^(.+?)(ss|i)es$/,
                        m = /^(.+?)([^s])s$/,
                        v = /^(.+?)eed$/,
                        g = /^(.+?)(ed|ing)$/,
                        y = /.$/,
                        w = /(at|bl|iz)$/,
                        S = new RegExp("([^aeiouylsz])\\1$"),
                        k = new RegExp("^" + i + o + "[^aeiouwxy]$"),
                        E = /^(.+?[^aeiou])y$/,
                        x = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/,
                        b = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/,
                        T = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/,
                        C = /^(.+?)(s|t)(ion)$/,
                        L = /^(.+?)e$/,
                        _ = /ll$/,
                        A = new RegExp("^" + i + o + "[^aeiouwxy]$"),
                        O = function (n) {
                            var o, i, r, s, a, c, l;
                            if (n.length < 3) return n;
                            if (
                                ((r = n.substr(0, 1)),
                                    "y" == r && (n = r.toUpperCase() + n.substr(1)),
                                    (s = p),
                                    (a = m),
                                    s.test(n)
                                        ? (n = n.replace(s, "$1$2"))
                                        : a.test(n) && (n = n.replace(a, "$1$2")),
                                    (s = v),
                                    (a = g),
                                    s.test(n))
                            ) {
                                var O = s.exec(n);
                                (s = u), s.test(O[1]) && ((s = y), (n = n.replace(s, "")));
                            } else if (a.test(n)) {
                                var O = a.exec(n);
                                (o = O[1]),
                                    (a = f),
                                    a.test(o) &&
                                    ((n = o),
                                        (a = w),
                                        (c = S),
                                        (l = k),
                                        a.test(n)
                                            ? (n += "e")
                                            : c.test(n)
                                                ? ((s = y), (n = n.replace(s, "")))
                                                : l.test(n) && (n += "e"));
                            }
                            if (((s = E), s.test(n))) {
                                var O = s.exec(n);
                                (o = O[1]), (n = o + "i");
                            }
                            if (((s = x), s.test(n))) {
                                var O = s.exec(n);
                                (o = O[1]), (i = O[2]), (s = u), s.test(o) && (n = o + t[i]);
                            }
                            if (((s = b), s.test(n))) {
                                var O = s.exec(n);
                                (o = O[1]), (i = O[2]), (s = u), s.test(o) && (n = o + e[i]);
                            }
                            if (((s = T), (a = C), s.test(n))) {
                                var O = s.exec(n);
                                (o = O[1]), (s = d), s.test(o) && (n = o);
                            } else if (a.test(n)) {
                                var O = a.exec(n);
                                (o = O[1] + O[2]), (a = d), a.test(o) && (n = o);
                            }
                            if (((s = L), s.test(n))) {
                                var O = s.exec(n);
                                (o = O[1]),
                                    (s = d),
                                    (a = h),
                                    (c = A),
                                    (s.test(o) || (a.test(o) && !c.test(o))) && (n = o);
                            }
                            return (
                                (s = _),
                                (a = d),
                                s.test(n) && a.test(n) && ((s = y), (n = n.replace(s, ""))),
                                "y" == r && (n = r.toLowerCase() + n.substr(1)),
                                n
                            );
                        };
                    return O;
                })()),
                t.Pipeline.registerFunction(t.stemmer, "stemmer"),
                (t.generateStopWordFilter = function (t) {
                    var e = t.reduce(function (t, e) {
                        return (t[e] = e), t;
                    }, {});
                    return function (t) {
                        return t && e[t] !== t ? t : void 0;
                    };
                }),
                (t.stopWordFilter = t.generateStopWordFilter([
                    "a",
                    "able",
                    "about",
                    "across",
                    "after",
                    "all",
                    "almost",
                    "also",
                    "am",
                    "among",
                    "an",
                    "and",
                    "any",
                    "are",
                    "as",
                    "at",
                    "be",
                    "because",
                    "been",
                    "but",
                    "by",
                    "can",
                    "cannot",
                    "could",
                    "dear",
                    "did",
                    "do",
                    "does",
                    "either",
                    "else",
                    "ever",
                    "every",
                    "for",
                    "from",
                    "get",
                    "got",
                    "had",
                    "has",
                    "have",
                    "he",
                    "her",
                    "hers",
                    "him",
                    "his",
                    "how",
                    "however",
                    "i",
                    "if",
                    "in",
                    "into",
                    "is",
                    "it",
                    "its",
                    "just",
                    "least",
                    "let",
                    "like",
                    "likely",
                    "may",
                    "me",
                    "might",
                    "most",
                    "must",
                    "my",
                    "neither",
                    "no",
                    "nor",
                    "not",
                    "of",
                    "off",
                    "often",
                    "on",
                    "only",
                    "or",
                    "other",
                    "our",
                    "own",
                    "rather",
                    "said",
                    "say",
                    "says",
                    "she",
                    "should",
                    "since",
                    "so",
                    "some",
                    "than",
                    "that",
                    "the",
                    "their",
                    "them",
                    "then",
                    "there",
                    "these",
                    "they",
                    "this",
                    "tis",
                    "to",
                    "too",
                    "twas",
                    "us",
                    "wants",
                    "was",
                    "we",
                    "were",
                    "what",
                    "when",
                    "where",
                    "which",
                    "while",
                    "who",
                    "whom",
                    "why",
                    "will",
                    "with",
                    "would",
                    "yet",
                    "you",
                    "your"
                ])),
                t.Pipeline.registerFunction(t.stopWordFilter, "stopWordFilter"),
                (t.trimmer = function (t) {
                    return t.replace(/^\W+/, "").replace(/\W+$/, "");
                }),
                t.Pipeline.registerFunction(t.trimmer, "trimmer"),
                (t.TokenStore = function () {
                    (this.root = { docs: {} }), (this.length = 0);
                }),
                (t.TokenStore.load = function (t) {
                    var e = new this();
                    return (e.root = t.root), (e.length = t.length), e;
                }),
                (t.TokenStore.prototype.add = function (t, e, n) {
                    var n = n || this.root,
                        o = t.charAt(0),
                        i = t.slice(1);
                    return (
                        o in n || (n[o] = { docs: {} }),
                        0 === i.length
                            ? ((n[o].docs[e.ref] = e), void (this.length += 1))
                            : this.add(i, e, n[o])
                    );
                }),
                (t.TokenStore.prototype.has = function (t) {
                    if (!t) return !1;
                    for (var e = this.root, n = 0; n < t.length; n++) {
                        if (!e[t.charAt(n)]) return !1;
                        e = e[t.charAt(n)];
                    }
                    return !0;
                }),
                (t.TokenStore.prototype.getNode = function (t) {
                    if (!t) return {};
                    for (var e = this.root, n = 0; n < t.length; n++) {
                        if (!e[t.charAt(n)]) return {};
                        e = e[t.charAt(n)];
                    }
                    return e;
                }),
                (t.TokenStore.prototype.get = function (t, e) {
                    return this.getNode(t, e).docs || {};
                }),
                (t.TokenStore.prototype.count = function (t, e) {
                    return Object.keys(this.get(t, e)).length;
                }),
                (t.TokenStore.prototype.remove = function (t, e) {
                    if (t) {
                        for (var n = this.root, o = 0; o < t.length; o++) {
                            if (!(t.charAt(o) in n)) return;
                            n = n[t.charAt(o)];
                        }
                        delete n.docs[e];
                    }
                }),
                (t.TokenStore.prototype.expand = function (t, e) {
                    var n = this.getNode(t),
                        o = n.docs || {},
                        e = e || [];
                    return (
                        Object.keys(o).length && e.push(t),
                        Object.keys(n).forEach(function (n) {
                            "docs" !== n && e.concat(this.expand(t + n, e));
                        }, this),
                        e
                    );
                }),
                (t.TokenStore.prototype.toJSON = function () {
                    return { root: this.root, length: this.length };
                }),
                (function (t, e) {
                    "function" == typeof define && define.amd
                        ? define(e)
                        : "object" == typeof exports
                            ? (module.exports = e())
                            : (t.lunr = e());
                })(this, function () {
                    return t;
                });
        })(),
        (String.prototype.truncate = function (t) {
            if (this.length > t) {
                for (; " " != this[t] && --t > 0;);
                return this.substring(0, t) + "&hellip;";
            }
            return this;
        }),
        (HTMLElement.prototype.wrap = function (t) {
            t.length || (t = [t]);
            for (var e = t.length - 1; e >= 0; e--) {
                var n = e > 0 ? this.cloneNode(!0) : this,
                    o = t[e],
                    i = o.parentNode,
                    r = o.nextSibling;
                n.appendChild(o), r ? i.insertBefore(n, r) : i.appendChild(n);
            }
        }),
        document.addEventListener("DOMContentLoaded", function () {
            "use strict";
            Modernizr.addTest("ios", function () {
                return !!navigator.userAgent.match(/(iPad|iPhone|iPod)/g);
            }),
                Modernizr.addTest("standalone", function () {
                    return !!navigator.standalone;
                }),
                FastClick.attach(document.body);
            var t = document.getElementById("toggle-search"),
                e = (document.getElementById("reset-search"),
                    document.querySelector(".drawer")),
                n = document.querySelectorAll(".anchor"),
                o = document.querySelector(".search .field"),
                i = document.querySelector(".query"),
                r = document.querySelector(".results .meta");
            Array.prototype.forEach.call(n, function (t) {
                t.querySelector("a").addEventListener("click", function () {
                    (document.getElementById("toggle-drawer").checked = !1),
                        document.body.classList.remove("toggle-drawer");
                });
            });
            var s = window.pageYOffset,
                a = function () {
                    var t = window.pageYOffset + window.innerHeight,
                        n = Math.max(0, window.innerHeight - e.offsetHeight);
                    t > document.body.clientHeight - (96 - n)
                        ? "absolute" != e.style.position &&
                        ((e.style.position = "absolute"),
                            (e.style.top = null),
                            (e.style.bottom = 0))
                        : e.offsetHeight < window.innerHeight
                            ? "fixed" != e.style.position &&
                            ((e.style.position = "fixed"),
                                (e.style.top = 0),
                                (e.style.bottom = null))
                            : "fixed" != e.style.position
                                ? t > e.offsetTop + e.offsetHeight
                                    ? ((e.style.position = "fixed"),
                                        (e.style.top = null),
                                        (e.style.bottom = "-96px"))
                                    : window.pageYOffset < e.offsetTop &&
                                    ((e.style.position = "fixed"),
                                        (e.style.top = 0),
                                        (e.style.bottom = null))
                                : window.pageYOffset > s
                                    ? e.style.top &&
                                    ((e.style.position = "absolute"),
                                        (e.style.top = Math.max(0, s) + "px"),
                                        (e.style.bottom = null))
                                    : e.style.bottom &&
                                    ((e.style.position = "absolute"),
                                        (e.style.top = t - e.offsetHeight + "px"),
                                        (e.style.bottom = null)),
                        (s = Math.max(0, window.pageYOffset));
                },
                c = function () {
                    var t = document.querySelector(".main");
                    window.removeEventListener("scroll", a),
                        matchMedia("only screen and (max-width: 959px)").matches
                            ? ((e.style.position = null),
                                (e.style.top = null),
                                (e.style.bottom = null))
                            : e.offsetHeight + 96 < t.offsetHeight &&
                            (window.addEventListener("scroll", a), a());
                };
            Modernizr.ios || (window.addEventListener("resize", c), c());
            var u = 0;
            t.addEventListener("click", function (t) {
                var e = document.body.classList,
                    n = !matchMedia("only screen and (min-width: 960px)").matches;
                e.contains("locked")
                    ? (e.remove("locked"),
                        n &&
                        setTimeout(function () {
                            window.scrollTo(0, u);
                        }, 100))
                    : ((u = window.scrollY),
                        n &&
                        setTimeout(function () {
                            window.scrollTo(0, 0);
                        }, 400),
                        setTimeout(
                            function () {
                                this.checked &&
                                    (n && e.add("locked"),
                                        setTimeout(function () {
                                            i.focus();
                                        }, 200));
                            }.bind(this),
                            450
                        ));
            }),
                o.addEventListener("touchstart", function () {
                    i.focus();
                }),
                window.addEventListener("keyup", function (e) {
                    var n = e.keyCode || e.which;
                    27 == n &&
                        (i.blur(),
                            document.body.classList.remove("toggle-search"),
                            document.body.classList.remove("locked"),
                            (t.checked = !1));
                });
            var d = document.getElementById("reset-search");
            d.addEventListener("click", function () {
                for (var t = document.querySelector(".results .list"); t.firstChild;)
                    t.removeChild(t.firstChild);
                var e = document.querySelector(".bar.search");
                e.classList.remove("non-empty"),
                    (r.innerHTML = ""),
                    (i.value = ""),
                    i.focus();
            });
            var h = document.querySelectorAll("h2");
            h = Array.prototype.map.call(h, function (t) {
                return t.offsetTop;
            });
            var f = null;
            document.addEventListener("scroll", function () {
                for (
                    var t = window.scrollY + window.innerHeight / 3,
                    e = h.length - 1,
                    o = 0;
                    e > o;
                    o++
                )
                    t < h[o + 1] && (e = o);
                e != f &&
                    ((f = e),
                        Array.prototype.forEach.call(n, function (t, e) {
                            var n = t.querySelector("a");
                            (e != f || n.classList.add("current")) &&
                                n.classList.remove("current");
                        }));
            });
            var p = document.querySelectorAll(".n + .p");
            Array.prototype.forEach.call(p, function (t) {
                var e = t.innerText || t.textContent;
                e && "(" == e[0] && t.previousSibling.classList.add("f");
            });
            var m = document.querySelectorAll("table");
            if (
                (Array.prototype.forEach.call(m, function (t) {
                    var e = document.createElement("div");
                    e.classList.add("data"), e.wrap(t);
                }),
                    Modernizr.ios)
            ) {
                var v = document.querySelectorAll(".scrollable, .standalone .article");
                Array.prototype.forEach.call(v, function (t) {
                    t.addEventListener("touchstart", function () {
                        var t = this.scrollTop;
                        0 == t
                            ? (this.scrollTop = 1)
                            : t + this.offsetHeight == this.scrollHeight &&
                            (this.scrollTop = t - 1);
                    });
                });
            }
            var g = document.querySelectorAll(".project, .overlay, .header");
            Array.prototype.forEach.call(g, function (t) {
                t.addEventListener("touchmove", function (t) {
                    t.preventDefault();
                });
            });
            var y = document.querySelectorAll(".toggle");
            Array.prototype.forEach.call(y, function (t) {
                t.addEventListener("click", function () {
                    document.body.classList.toggle(this.id);
                });
            }),
                repo_id &&
                pegasus("https://api.github.com/repos/" + repo_id).then(
                    function (t, e) {
                        var n = t.stargazers_count;
                        n > 1e4
                            ? (n = (n / 1e3).toFixed(0) + "k")
                            : n > 1e3 && (n = (n / 1e3).toFixed(1) + "k");
                        var o = document.querySelector(".repo-stars .count");
                        o.innerHTML = n;
                    },
                    function (t, e) {
                        console.error(t, e.status);
                    }
                );
        }),
        "standalone" in window.navigator && window.navigator.standalone)
) {
    var node,
        remotes = !1;
    document.addEventListener(
        "click",
        function (t) {
            for (node = t.target; "A" !== node.nodeName && "HTML" !== node.nodeName;)
                node = node.parentNode;
            "href" in node &&
                -1 !== node.href.indexOf("http") &&
                (-1 !== node.href.indexOf(document.location.host) || remotes) &&
                (t.preventDefault(), (document.location.href = node.href));
        },
        !1
    );
}