-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.43d43591.js
6405 lines (6366 loc) · 318 KB
/
index.43d43591.js
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
// modules are defined as an array
// [ module function, map of requires ]
//
// map of requires is short require name -> numeric require
//
// anything defined in a previous bundle is accessed via the
// orig method which is the require for previous bundles
(function (modules, entry, mainEntry, parcelRequireName, globalName) {
/* eslint-disable no-undef */
var globalObject =
typeof globalThis !== 'undefined'
? globalThis
: typeof self !== 'undefined'
? self
: typeof window !== 'undefined'
? window
: typeof global !== 'undefined'
? global
: {};
/* eslint-enable no-undef */
// Save the require from previous bundle to this closure if any
var previousRequire =
typeof globalObject[parcelRequireName] === 'function' &&
globalObject[parcelRequireName];
var cache = previousRequire.cache || {};
// Do not use `require` to prevent Webpack from trying to bundle this call
var nodeRequire =
typeof module !== 'undefined' &&
typeof module.require === 'function' &&
module.require.bind(module);
function newRequire(name, jumped) {
if (!cache[name]) {
if (!modules[name]) {
// if we cannot find the module within our internal map or
// cache jump to the current global require ie. the last bundle
// that was added to the page.
var currentRequire =
typeof globalObject[parcelRequireName] === 'function' &&
globalObject[parcelRequireName];
if (!jumped && currentRequire) {
return currentRequire(name, true);
}
// If there are other bundles on this page the require from the
// previous one is saved to 'previousRequire'. Repeat this as
// many times as there are bundles until the module is found or
// we exhaust the require chain.
if (previousRequire) {
return previousRequire(name, true);
}
// Try the node require function if it exists.
if (nodeRequire && typeof name === 'string') {
return nodeRequire(name);
}
var err = new Error("Cannot find module '" + name + "'");
err.code = 'MODULE_NOT_FOUND';
throw err;
}
localRequire.resolve = resolve;
localRequire.cache = {};
var module = (cache[name] = new newRequire.Module(name));
modules[name][0].call(
module.exports,
localRequire,
module,
module.exports,
this
);
}
return cache[name].exports;
function localRequire(x) {
var res = localRequire.resolve(x);
return res === false ? {} : newRequire(res);
}
function resolve(x) {
var id = modules[name][1][x];
return id != null ? id : x;
}
}
function Module(moduleName) {
this.id = moduleName;
this.bundle = newRequire;
this.exports = {};
}
newRequire.isParcelRequire = true;
newRequire.Module = Module;
newRequire.modules = modules;
newRequire.cache = cache;
newRequire.parent = previousRequire;
newRequire.register = function (id, exports) {
modules[id] = [
function (require, module) {
module.exports = exports;
},
{},
];
};
Object.defineProperty(newRequire, 'root', {
get: function () {
return globalObject[parcelRequireName];
},
});
globalObject[parcelRequireName] = newRequire;
for (var i = 0; i < entry.length; i++) {
newRequire(entry[i]);
}
if (mainEntry) {
// Expose entry point to Node, AMD or browser globals
// Based on https://github.com/ForbesLindesay/umd/blob/master/template.js
var mainExports = newRequire(mainEntry);
// CommonJS
if (typeof exports === 'object' && typeof module !== 'undefined') {
module.exports = mainExports;
// RequireJS
} else if (typeof define === 'function' && define.amd) {
define(function () {
return mainExports;
});
// <script>
} else if (globalName) {
this[globalName] = mainExports;
}
}
})({"cucIK":[function(require,module,exports) {
var global = arguments[3];
var HMR_HOST = null;
var HMR_PORT = null;
var HMR_SECURE = false;
var HMR_ENV_HASH = "d6ea1d42532a7575";
module.bundle.HMR_BUNDLE_ID = "ad8b822743d43591";
"use strict";
/* global HMR_HOST, HMR_PORT, HMR_ENV_HASH, HMR_SECURE, chrome, browser, __parcel__import__, __parcel__importScripts__, ServiceWorkerGlobalScope */ /*::
import type {
HMRAsset,
HMRMessage,
} from '@parcel/reporter-dev-server/src/HMRServer.js';
interface ParcelRequire {
(string): mixed;
cache: {|[string]: ParcelModule|};
hotData: {|[string]: mixed|};
Module: any;
parent: ?ParcelRequire;
isParcelRequire: true;
modules: {|[string]: [Function, {|[string]: string|}]|};
HMR_BUNDLE_ID: string;
root: ParcelRequire;
}
interface ParcelModule {
hot: {|
data: mixed,
accept(cb: (Function) => void): void,
dispose(cb: (mixed) => void): void,
// accept(deps: Array<string> | string, cb: (Function) => void): void,
// decline(): void,
_acceptCallbacks: Array<(Function) => void>,
_disposeCallbacks: Array<(mixed) => void>,
|};
}
interface ExtensionContext {
runtime: {|
reload(): void,
getURL(url: string): string;
getManifest(): {manifest_version: number, ...};
|};
}
declare var module: {bundle: ParcelRequire, ...};
declare var HMR_HOST: string;
declare var HMR_PORT: string;
declare var HMR_ENV_HASH: string;
declare var HMR_SECURE: boolean;
declare var chrome: ExtensionContext;
declare var browser: ExtensionContext;
declare var __parcel__import__: (string) => Promise<void>;
declare var __parcel__importScripts__: (string) => Promise<void>;
declare var globalThis: typeof self;
declare var ServiceWorkerGlobalScope: Object;
*/ var OVERLAY_ID = "__parcel__error__overlay__";
var OldModule = module.bundle.Module;
function Module(moduleName) {
OldModule.call(this, moduleName);
this.hot = {
data: module.bundle.hotData[moduleName],
_acceptCallbacks: [],
_disposeCallbacks: [],
accept: function(fn) {
this._acceptCallbacks.push(fn || function() {});
},
dispose: function(fn) {
this._disposeCallbacks.push(fn);
}
};
module.bundle.hotData[moduleName] = undefined;
}
module.bundle.Module = Module;
module.bundle.hotData = {};
var checkedAssets /*: {|[string]: boolean|} */ , assetsToDispose /*: Array<[ParcelRequire, string]> */ , assetsToAccept /*: Array<[ParcelRequire, string]> */ ;
function getHostname() {
return HMR_HOST || (location.protocol.indexOf("http") === 0 ? location.hostname : "localhost");
}
function getPort() {
return HMR_PORT || location.port;
}
// eslint-disable-next-line no-redeclare
var parent = module.bundle.parent;
if ((!parent || !parent.isParcelRequire) && typeof WebSocket !== "undefined") {
var hostname = getHostname();
var port = getPort();
var protocol = HMR_SECURE || location.protocol == "https:" && !/localhost|127.0.0.1|0.0.0.0/.test(hostname) ? "wss" : "ws";
var ws;
try {
ws = new WebSocket(protocol + "://" + hostname + (port ? ":" + port : "") + "/");
} catch (err) {
if (err.message) console.error(err.message);
ws = {};
}
// Web extension context
var extCtx = typeof browser === "undefined" ? typeof chrome === "undefined" ? null : chrome : browser;
// Safari doesn't support sourceURL in error stacks.
// eval may also be disabled via CSP, so do a quick check.
var supportsSourceURL = false;
try {
(0, eval)('throw new Error("test"); //# sourceURL=test.js');
} catch (err) {
supportsSourceURL = err.stack.includes("test.js");
}
// $FlowFixMe
ws.onmessage = async function(event /*: {data: string, ...} */ ) {
checkedAssets = {} /*: {|[string]: boolean|} */ ;
assetsToAccept = [];
assetsToDispose = [];
var data /*: HMRMessage */ = JSON.parse(event.data);
if (data.type === "update") {
// Remove error overlay if there is one
if (typeof document !== "undefined") removeErrorOverlay();
let assets = data.assets.filter((asset)=>asset.envHash === HMR_ENV_HASH);
// Handle HMR Update
let handled = assets.every((asset)=>{
return asset.type === "css" || asset.type === "js" && hmrAcceptCheck(module.bundle.root, asset.id, asset.depsByBundle);
});
if (handled) {
console.clear();
// Dispatch custom event so other runtimes (e.g React Refresh) are aware.
if (typeof window !== "undefined" && typeof CustomEvent !== "undefined") window.dispatchEvent(new CustomEvent("parcelhmraccept"));
await hmrApplyUpdates(assets);
// Dispose all old assets.
let processedAssets = {} /*: {|[string]: boolean|} */ ;
for(let i = 0; i < assetsToDispose.length; i++){
let id = assetsToDispose[i][1];
if (!processedAssets[id]) {
hmrDispose(assetsToDispose[i][0], id);
processedAssets[id] = true;
}
}
// Run accept callbacks. This will also re-execute other disposed assets in topological order.
processedAssets = {};
for(let i = 0; i < assetsToAccept.length; i++){
let id = assetsToAccept[i][1];
if (!processedAssets[id]) {
hmrAccept(assetsToAccept[i][0], id);
processedAssets[id] = true;
}
}
} else fullReload();
}
if (data.type === "error") {
// Log parcel errors to console
for (let ansiDiagnostic of data.diagnostics.ansi){
let stack = ansiDiagnostic.codeframe ? ansiDiagnostic.codeframe : ansiDiagnostic.stack;
console.error("\uD83D\uDEA8 [parcel]: " + ansiDiagnostic.message + "\n" + stack + "\n\n" + ansiDiagnostic.hints.join("\n"));
}
if (typeof document !== "undefined") {
// Render the fancy html overlay
removeErrorOverlay();
var overlay = createErrorOverlay(data.diagnostics.html);
// $FlowFixMe
document.body.appendChild(overlay);
}
}
};
ws.onerror = function(e) {
if (e.message) console.error(e.message);
};
ws.onclose = function() {
console.warn("[parcel] \uD83D\uDEA8 Connection to the HMR server was lost");
};
}
function removeErrorOverlay() {
var overlay = document.getElementById(OVERLAY_ID);
if (overlay) {
overlay.remove();
console.log("[parcel] \u2728 Error resolved");
}
}
function createErrorOverlay(diagnostics) {
var overlay = document.createElement("div");
overlay.id = OVERLAY_ID;
let errorHTML = '<div style="background: black; opacity: 0.85; font-size: 16px; color: white; position: fixed; height: 100%; width: 100%; top: 0px; left: 0px; padding: 30px; font-family: Menlo, Consolas, monospace; z-index: 9999;">';
for (let diagnostic of diagnostics){
let stack = diagnostic.frames.length ? diagnostic.frames.reduce((p, frame)=>{
return `${p}
<a href="/__parcel_launch_editor?file=${encodeURIComponent(frame.location)}" style="text-decoration: underline; color: #888" onclick="fetch(this.href); return false">${frame.location}</a>
${frame.code}`;
}, "") : diagnostic.stack;
errorHTML += `
<div>
<div style="font-size: 18px; font-weight: bold; margin-top: 20px;">
\u{1F6A8} ${diagnostic.message}
</div>
<pre>${stack}</pre>
<div>
${diagnostic.hints.map((hint)=>"<div>\uD83D\uDCA1 " + hint + "</div>").join("")}
</div>
${diagnostic.documentation ? `<div>\u{1F4DD} <a style="color: violet" href="${diagnostic.documentation}" target="_blank">Learn more</a></div>` : ""}
</div>
`;
}
errorHTML += "</div>";
overlay.innerHTML = errorHTML;
return overlay;
}
function fullReload() {
if ("reload" in location) location.reload();
else if (extCtx && extCtx.runtime && extCtx.runtime.reload) extCtx.runtime.reload();
}
function getParents(bundle, id) /*: Array<[ParcelRequire, string]> */ {
var modules = bundle.modules;
if (!modules) return [];
var parents = [];
var k, d, dep;
for(k in modules)for(d in modules[k][1]){
dep = modules[k][1][d];
if (dep === id || Array.isArray(dep) && dep[dep.length - 1] === id) parents.push([
bundle,
k
]);
}
if (bundle.parent) parents = parents.concat(getParents(bundle.parent, id));
return parents;
}
function updateLink(link) {
var href = link.getAttribute("href");
if (!href) return;
var newLink = link.cloneNode();
newLink.onload = function() {
if (link.parentNode !== null) // $FlowFixMe
link.parentNode.removeChild(link);
};
newLink.setAttribute("href", // $FlowFixMe
href.split("?")[0] + "?" + Date.now());
// $FlowFixMe
link.parentNode.insertBefore(newLink, link.nextSibling);
}
var cssTimeout = null;
function reloadCSS() {
if (cssTimeout) return;
cssTimeout = setTimeout(function() {
var links = document.querySelectorAll('link[rel="stylesheet"]');
for(var i = 0; i < links.length; i++){
// $FlowFixMe[incompatible-type]
var href /*: string */ = links[i].getAttribute("href");
var hostname = getHostname();
var servedFromHMRServer = hostname === "localhost" ? new RegExp("^(https?:\\/\\/(0.0.0.0|127.0.0.1)|localhost):" + getPort()).test(href) : href.indexOf(hostname + ":" + getPort());
var absolute = /^https?:\/\//i.test(href) && href.indexOf(location.origin) !== 0 && !servedFromHMRServer;
if (!absolute) updateLink(links[i]);
}
cssTimeout = null;
}, 50);
}
function hmrDownload(asset) {
if (asset.type === "js") {
if (typeof document !== "undefined") {
let script = document.createElement("script");
script.src = asset.url + "?t=" + Date.now();
if (asset.outputFormat === "esmodule") script.type = "module";
return new Promise((resolve, reject)=>{
var _document$head;
script.onload = ()=>resolve(script);
script.onerror = reject;
(_document$head = document.head) === null || _document$head === void 0 || _document$head.appendChild(script);
});
} else if (typeof importScripts === "function") {
// Worker scripts
if (asset.outputFormat === "esmodule") return import(asset.url + "?t=" + Date.now());
else return new Promise((resolve, reject)=>{
try {
importScripts(asset.url + "?t=" + Date.now());
resolve();
} catch (err) {
reject(err);
}
});
}
}
}
async function hmrApplyUpdates(assets) {
global.parcelHotUpdate = Object.create(null);
let scriptsToRemove;
try {
// If sourceURL comments aren't supported in eval, we need to load
// the update from the dev server over HTTP so that stack traces
// are correct in errors/logs. This is much slower than eval, so
// we only do it if needed (currently just Safari).
// https://bugs.webkit.org/show_bug.cgi?id=137297
// This path is also taken if a CSP disallows eval.
if (!supportsSourceURL) {
let promises = assets.map((asset)=>{
var _hmrDownload;
return (_hmrDownload = hmrDownload(asset)) === null || _hmrDownload === void 0 ? void 0 : _hmrDownload.catch((err)=>{
// Web extension fix
if (extCtx && extCtx.runtime && extCtx.runtime.getManifest().manifest_version == 3 && typeof ServiceWorkerGlobalScope != "undefined" && global instanceof ServiceWorkerGlobalScope) {
extCtx.runtime.reload();
return;
}
throw err;
});
});
scriptsToRemove = await Promise.all(promises);
}
assets.forEach(function(asset) {
hmrApply(module.bundle.root, asset);
});
} finally{
delete global.parcelHotUpdate;
if (scriptsToRemove) scriptsToRemove.forEach((script)=>{
if (script) {
var _document$head2;
(_document$head2 = document.head) === null || _document$head2 === void 0 || _document$head2.removeChild(script);
}
});
}
}
function hmrApply(bundle /*: ParcelRequire */ , asset /*: HMRAsset */ ) {
var modules = bundle.modules;
if (!modules) return;
if (asset.type === "css") reloadCSS();
else if (asset.type === "js") {
let deps = asset.depsByBundle[bundle.HMR_BUNDLE_ID];
if (deps) {
if (modules[asset.id]) {
// Remove dependencies that are removed and will become orphaned.
// This is necessary so that if the asset is added back again, the cache is gone, and we prevent a full page reload.
let oldDeps = modules[asset.id][1];
for(let dep in oldDeps)if (!deps[dep] || deps[dep] !== oldDeps[dep]) {
let id = oldDeps[dep];
let parents = getParents(module.bundle.root, id);
if (parents.length === 1) hmrDelete(module.bundle.root, id);
}
}
if (supportsSourceURL) // Global eval. We would use `new Function` here but browser
// support for source maps is better with eval.
(0, eval)(asset.output);
// $FlowFixMe
let fn = global.parcelHotUpdate[asset.id];
modules[asset.id] = [
fn,
deps
];
} else if (bundle.parent) hmrApply(bundle.parent, asset);
}
}
function hmrDelete(bundle, id) {
let modules = bundle.modules;
if (!modules) return;
if (modules[id]) {
// Collect dependencies that will become orphaned when this module is deleted.
let deps = modules[id][1];
let orphans = [];
for(let dep in deps){
let parents = getParents(module.bundle.root, deps[dep]);
if (parents.length === 1) orphans.push(deps[dep]);
}
// Delete the module. This must be done before deleting dependencies in case of circular dependencies.
delete modules[id];
delete bundle.cache[id];
// Now delete the orphans.
orphans.forEach((id)=>{
hmrDelete(module.bundle.root, id);
});
} else if (bundle.parent) hmrDelete(bundle.parent, id);
}
function hmrAcceptCheck(bundle /*: ParcelRequire */ , id /*: string */ , depsByBundle /*: ?{ [string]: { [string]: string } }*/ ) {
if (hmrAcceptCheckOne(bundle, id, depsByBundle)) return true;
// Traverse parents breadth first. All possible ancestries must accept the HMR update, or we'll reload.
let parents = getParents(module.bundle.root, id);
let accepted = false;
while(parents.length > 0){
let v = parents.shift();
let a = hmrAcceptCheckOne(v[0], v[1], null);
if (a) // If this parent accepts, stop traversing upward, but still consider siblings.
accepted = true;
else {
// Otherwise, queue the parents in the next level upward.
let p = getParents(module.bundle.root, v[1]);
if (p.length === 0) {
// If there are no parents, then we've reached an entry without accepting. Reload.
accepted = false;
break;
}
parents.push(...p);
}
}
return accepted;
}
function hmrAcceptCheckOne(bundle /*: ParcelRequire */ , id /*: string */ , depsByBundle /*: ?{ [string]: { [string]: string } }*/ ) {
var modules = bundle.modules;
if (!modules) return;
if (depsByBundle && !depsByBundle[bundle.HMR_BUNDLE_ID]) {
// If we reached the root bundle without finding where the asset should go,
// there's nothing to do. Mark as "accepted" so we don't reload the page.
if (!bundle.parent) return true;
return hmrAcceptCheck(bundle.parent, id, depsByBundle);
}
if (checkedAssets[id]) return true;
checkedAssets[id] = true;
var cached = bundle.cache[id];
assetsToDispose.push([
bundle,
id
]);
if (!cached || cached.hot && cached.hot._acceptCallbacks.length) {
assetsToAccept.push([
bundle,
id
]);
return true;
}
}
function hmrDispose(bundle /*: ParcelRequire */ , id /*: string */ ) {
var cached = bundle.cache[id];
bundle.hotData[id] = {};
if (cached && cached.hot) cached.hot.data = bundle.hotData[id];
if (cached && cached.hot && cached.hot._disposeCallbacks.length) cached.hot._disposeCallbacks.forEach(function(cb) {
cb(bundle.hotData[id]);
});
delete bundle.cache[id];
}
function hmrAccept(bundle /*: ParcelRequire */ , id /*: string */ ) {
// Execute the module.
bundle(id);
// Run the accept callbacks in the new version of the module.
var cached = bundle.cache[id];
if (cached && cached.hot && cached.hot._acceptCallbacks.length) cached.hot._acceptCallbacks.forEach(function(cb) {
var assetsToAlsoAccept = cb(function() {
return getParents(module.bundle.root, id);
});
if (assetsToAlsoAccept && assetsToAccept.length) {
assetsToAlsoAccept.forEach(function(a) {
hmrDispose(a[0], a[1]);
});
// $FlowFixMe[method-unbinding]
assetsToAccept.push.apply(assetsToAccept, assetsToAlsoAccept);
}
});
}
},{}],"l17dj":[function(require,module,exports) {
var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js");
var _highway = require("@dogstudio/highway");
var _highwayDefault = parcelHelpers.interopDefault(_highway);
var _gsap = require("gsap");
var _gsapDefault = parcelHelpers.interopDefault(_gsap);
var _games = require("./games");
var _gamesDefault = parcelHelpers.interopDefault(_games);
var _music = require("./music");
var _musicDefault = parcelHelpers.interopDefault(_music);
var _art = require("./art");
var _artDefault = parcelHelpers.interopDefault(_art);
var _me = require("./me");
var _meDefault = parcelHelpers.interopDefault(_me);
var _ = require(".");
var _Default = parcelHelpers.interopDefault(_);
var _gameGallerySetup = require("/src/static/games/GameGallery/GameGallerySetup");
var _gameGallerySetupDefault = parcelHelpers.interopDefault(_gameGallerySetup);
class Slide extends (0, _highwayDefault.default).Transition {
in({ from, to, done }) {
window.scrollTo({
top: 0,
left: 0,
behavior: "smooth"
});
(0, _gsapDefault.default).fromTo(from, {
opacity: "100%",
left: "0%"
}, {
opacity: "0%",
left: "-100%",
duration: 1,
onComplete: function() {}
});
(0, _gsapDefault.default).fromTo(to, {
opacity: "0%",
left: "-100%"
}, {
opacity: "100%",
left: "0%",
duration: 1,
onComplete: function() {
from.remove();
done();
}
});
}
out({ from, done }) {
done();
}
}
const H = new (0, _highwayDefault.default).Core({
transitions: {
default: Slide
},
renderers: {
maingames: (0, _gamesDefault.default),
mainart: (0, _artDefault.default),
mainmusic: (0, _musicDefault.default),
mainme: (0, _meDefault.default),
main: (0, _Default.default),
maingamegallery: (0, _gameGallerySetupDefault.default)
}
});
H.on("NAVIGATE_END", ({ location })=>{
var articleItems = document.querySelectorAll("article");
for(var i = 0; i < articleItems.length - 1; ++i){
console.log("Get Obliterated");
articleItems[i].remove();
}
// Check Anchor
if (location.anchor) {
// Get element
const el = document.querySelector(location.anchor);
if (el) // Scroll to element
window.scrollTo(el.offsetLeft, el.offsetTop);
}
});
H.on("NAVIGATE_IN", ({ to, location })=>{});
var light_mode = false;
const themeButton = document.getElementById("color-mode");
const moon = document.getElementById("moon");
const sun = document.getElementById("sun");
let body = document.body;
themeButton.onclick = ()=>{
if (light_mode) {
light_mode = false;
body.classList.replace("light", "dark");
moon.classList.replace("other-mode", "current-mode");
sun.classList.replace("current-mode", "other-mode");
} else {
light_mode = true;
body.classList.replace("dark", "light");
moon.classList.replace("current-mode", "other-mode");
sun.classList.replace("other-mode", "current-mode");
}
};
},{"@dogstudio/highway":"26LRT","gsap":"fPSuC","./games":"d1VX1","./music":"8tXhl","./art":"7C9M0","./me":"fc8E8",".":"ebWYT","@parcel/transformer-js/src/esmodule-helpers.js":"gkKU3","/src/static/games/GameGallery/GameGallerySetup":"cdXoo"}],"26LRT":[function(require,module,exports) {
var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js");
parcelHelpers.defineInteropFlag(exports);
function t() {}
t.prototype = {
on: function(t, e, r) {
var i = this.e || (this.e = {});
return (i[t] || (i[t] = [])).push({
fn: e,
ctx: r
}), this;
},
once: function(t, e, r) {
var i = this;
function n() {
i.off(t, n), e.apply(r, arguments);
}
return n._ = e, this.on(t, n, r);
},
emit: function(t) {
for(var e = [].slice.call(arguments, 1), r = ((this.e || (this.e = {}))[t] || []).slice(), i = 0, n = r.length; i < n; i++)r[i].fn.apply(r[i].ctx, e);
return this;
},
off: function(t, e) {
var r = this.e || (this.e = {}), i = r[t], n = [];
if (i && e) for(var o = 0, s = i.length; o < s; o++)i[o].fn !== e && i[o].fn._ !== e && n.push(i[o]);
return n.length ? r[t] = n : delete r[t], this;
}
};
var e = t;
e.TinyEmitter = t;
var r = function(t) {
this.wrap = document.querySelector("[data-router-wrapper]"), this.properties = t, this.Transition = t.transition ? new t.transition.class(this.wrap, t.transition.name) : null;
};
r.prototype.setup = function() {
this.onEnter && this.onEnter(), this.onEnterCompleted && this.onEnterCompleted();
}, r.prototype.add = function() {
this.wrap.insertAdjacentHTML("beforeend", this.properties.view.outerHTML);
}, r.prototype.update = function() {
document.title = this.properties.page.title;
}, r.prototype.show = function(t) {
var e = this;
return new Promise(function(r) {
try {
function i(t) {
e.onEnterCompleted && e.onEnterCompleted(), r();
}
return e.update(), e.onEnter && e.onEnter(), Promise.resolve(e.Transition ? Promise.resolve(e.Transition.show(t)).then(i) : i());
} catch (t) {
return Promise.reject(t);
}
});
}, r.prototype.hide = function(t) {
var e = this;
return new Promise(function(r) {
try {
function i(t) {
e.onLeaveCompleted && e.onLeaveCompleted(), r();
}
return e.onLeave && e.onLeave(), Promise.resolve(e.Transition ? Promise.resolve(e.Transition.hide(t)).then(i) : i());
} catch (t) {
return Promise.reject(t);
}
});
};
var i = new window.DOMParser, n = function(t, e) {
this.renderers = t, this.transitions = e;
};
n.prototype.getOrigin = function(t) {
var e = t.match(/(https?:\/\/[\w\-.]+)/);
return e ? e[1].replace(/https?:\/\//, "") : null;
}, n.prototype.getPathname = function(t) {
var e = t.match(/https?:\/\/.*?(\/[\w_\-./]+)/);
return e ? e[1] : "/";
}, n.prototype.getAnchor = function(t) {
var e = t.match(/(#.*)$/);
return e ? e[1] : null;
}, n.prototype.getParams = function(t) {
var e = t.match(/\?([\w_\-.=&]+)/);
if (!e) return null;
for(var r = e[1].split("&"), i = {}, n = 0; n < r.length; n++){
var o = r[n].split("=");
i[o[0]] = o[1];
}
return i;
}, n.prototype.getDOM = function(t) {
return "string" == typeof t ? i.parseFromString(t, "text/html") : t;
}, n.prototype.getView = function(t) {
return t.querySelector("[data-router-view]");
}, n.prototype.getSlug = function(t) {
return t.getAttribute("data-router-view");
}, n.prototype.getRenderer = function(t) {
if (!this.renderers) return Promise.resolve(r);
if (t in this.renderers) {
var e = this.renderers[t];
return "function" != typeof e || r.isPrototypeOf(e) ? "function" == typeof e.then ? Promise.resolve(e).then(function(t) {
return t.default;
}) : Promise.resolve(e) : Promise.resolve(e()).then(function(t) {
return t.default;
});
}
return Promise.resolve(r);
}, n.prototype.getTransition = function(t) {
return this.transitions ? t in this.transitions ? {
class: this.transitions[t],
name: t
} : "default" in this.transitions ? {
class: this.transitions.default,
name: "default"
} : null : null;
}, n.prototype.getProperties = function(t) {
var e = this.getDOM(t), r = this.getView(e), i = this.getSlug(r);
return {
page: e,
view: r,
slug: i,
renderer: this.getRenderer(i, this.renderers),
transition: this.getTransition(i, this.transitions)
};
}, n.prototype.getLocation = function(t) {
return {
href: t,
anchor: this.getAnchor(t),
origin: this.getOrigin(t),
params: this.getParams(t),
pathname: this.getPathname(t)
};
};
var o = function(t) {
function e(e) {
var r = this;
void 0 === e && (e = {});
var i = e.renderers, o = e.transitions;
t.call(this), this.Helpers = new n(i, o), this.Transitions = o, this.Contextual = !1, this.location = this.Helpers.getLocation(window.location.href), this.properties = this.Helpers.getProperties(document.cloneNode(!0)), this.popping = !1, this.running = !1, this.trigger = null, this.cache = new Map, this.cache.set(this.location.href, this.properties), this.properties.renderer.then(function(t) {
r.From = new t(r.properties), r.From.setup();
}), this._navigate = this.navigate.bind(this), window.addEventListener("popstate", this.popState.bind(this)), this.links = document.querySelectorAll("a:not([target]):not([data-router-disabled])"), this.attach(this.links);
}
return t && (e.__proto__ = t), (e.prototype = Object.create(t && t.prototype)).constructor = e, e.prototype.attach = function(t) {
for(var e = 0, r = t; e < r.length; e += 1)r[e].addEventListener("click", this._navigate);
}, e.prototype.detach = function(t) {
for(var e = 0, r = t; e < r.length; e += 1)r[e].removeEventListener("click", this._navigate);
}, e.prototype.navigate = function(t) {
if (!t.metaKey && !t.ctrlKey) {
t.preventDefault();
var e = !!t.currentTarget.hasAttribute("data-transition") && t.currentTarget.dataset.transition;
this.redirect(t.currentTarget.href, e, t.currentTarget);
}
}, e.prototype.redirect = function(t, e, r) {
if (void 0 === e && (e = !1), void 0 === r && (r = "script"), this.trigger = r, !this.running && t !== this.location.href) {
var i = this.Helpers.getLocation(t);
this.Contextual = !1, e && (this.Contextual = this.Transitions.contextual[e].prototype, this.Contextual.name = e), i.origin !== this.location.origin || i.anchor && i.pathname === this.location.pathname ? window.location.href = t : (this.location = i, this.beforeFetch());
}
}, e.prototype.popState = function() {
this.trigger = "popstate", this.Contextual = !1;
var t = this.Helpers.getLocation(window.location.href);
this.location.pathname !== t.pathname || !this.location.anchor && !t.anchor ? (this.popping = !0, this.location = t, this.beforeFetch()) : this.location = t;
}, e.prototype.pushState = function() {
this.popping || window.history.pushState(this.location, "", this.location.href);
}, e.prototype.fetch = function() {
try {
var t = this;
return Promise.resolve(fetch(t.location.href, {
mode: "same-origin",
method: "GET",
headers: {
"X-Requested-With": "Highway"
},
credentials: "same-origin"
})).then(function(e) {
if (e.status >= 200 && e.status < 300) return e.text();
window.location.href = t.location.href;
});
} catch (t) {
return Promise.reject(t);
}
}, e.prototype.beforeFetch = function() {
try {
var t = this;
function e() {
t.afterFetch();
}
t.pushState(), t.running = !0, t.emit("NAVIGATE_OUT", {
from: {
page: t.From.properties.page,
view: t.From.properties.view
},
trigger: t.trigger,
location: t.location
});
var r = {
trigger: t.trigger,
contextual: t.Contextual
}, i = t.cache.has(t.location.href) ? Promise.resolve(t.From.hide(r)).then(function() {
t.properties = t.cache.get(t.location.href);
}) : Promise.resolve(Promise.all([
t.fetch(),
t.From.hide(r)
])).then(function(e) {
t.properties = t.Helpers.getProperties(e[0]), t.cache.set(t.location.href, t.properties);
});
return Promise.resolve(i && i.then ? i.then(e) : e());
} catch (t) {
return Promise.reject(t);
}
}, e.prototype.afterFetch = function() {
try {
var t = this;
return Promise.resolve(t.properties.renderer).then(function(e) {
return t.To = new e(t.properties), t.To.add(), t.emit("NAVIGATE_IN", {
to: {
page: t.To.properties.page,
view: t.To.wrap.lastElementChild
},
trigger: t.trigger,
location: t.location
}), Promise.resolve(t.To.show({
trigger: t.trigger,
contextual: t.Contextual
})).then(function() {
t.popping = !1, t.running = !1, t.detach(t.links), t.links = document.querySelectorAll("a:not([target]):not([data-router-disabled])"), t.attach(t.links), t.emit("NAVIGATE_END", {
to: {
page: t.To.properties.page,
view: t.To.wrap.lastElementChild
},
from: {
page: t.From.properties.page,
view: t.From.properties.view
},
trigger: t.trigger,
location: t.location
}), t.From = t.To, t.trigger = null;
});
});
} catch (t) {
return Promise.reject(t);
}
}, e;
}(e), s = function(t, e) {
this.wrap = t, this.name = e;
};
s.prototype.show = function(t) {
var e = this, r = t.trigger, i = t.contextual, n = this.wrap.lastElementChild, o = this.wrap.firstElementChild;
return new Promise(function(t) {
i ? (n.setAttribute("data-transition-in", i.name), n.removeAttribute("data-transition-out", i.name), i.in && i.in({
to: n,
from: o,
trigger: r,
done: t
})) : (n.setAttribute("data-transition-in", e.name), n.removeAttribute("data-transition-out", e.name), e.in && e.in({
to: n,
from: o,
trigger: r,
done: t
}));
});
}, s.prototype.hide = function(t) {
var e = this, r = t.trigger, i = t.contextual, n = this.wrap.firstElementChild;
return new Promise(function(t) {
i ? (n.setAttribute("data-transition-out", i.name), n.removeAttribute("data-transition-in", i.name), i.out && i.out({
from: n,
trigger: r,
done: t
})) : (n.setAttribute("data-transition-out", e.name), n.removeAttribute("data-transition-in", e.name), e.out && e.out({
from: n,
trigger: r,
done: t
}));
});
}, console.log("Highway v2.2.0");
exports.default = {
Core: o,
Helpers: n,
Renderer: r,
Transition: s
};
},{"@parcel/transformer-js/src/esmodule-helpers.js":"gkKU3"}],"gkKU3":[function(require,module,exports) {
exports.interopDefault = function(a) {
return a && a.__esModule ? a : {
default: a
};
};
exports.defineInteropFlag = function(a) {
Object.defineProperty(a, "__esModule", {
value: true
});
};
exports.exportAll = function(source, dest) {
Object.keys(source).forEach(function(key) {
if (key === "default" || key === "__esModule" || dest.hasOwnProperty(key)) return;
Object.defineProperty(dest, key, {
enumerable: true,
get: function() {
return source[key];
}
});
});
return dest;
};
exports.export = function(dest, destName, get) {
Object.defineProperty(dest, destName, {
enumerable: true,
get: get
});
};
},{}],"fPSuC":[function(require,module,exports) {
var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js");
parcelHelpers.defineInteropFlag(exports);
parcelHelpers.export(exports, "gsap", ()=>gsapWithCSS);
parcelHelpers.export(exports, "default", ()=>gsapWithCSS);
parcelHelpers.export(exports, "CSSPlugin", ()=>(0, _csspluginJs.CSSPlugin));
parcelHelpers.export(exports, "TweenMax", ()=>TweenMaxWithCSS);
parcelHelpers.export(exports, "TweenLite", ()=>(0, _gsapCoreJs.TweenLite));
parcelHelpers.export(exports, "TimelineMax", ()=>(0, _gsapCoreJs.TimelineMax));
parcelHelpers.export(exports, "TimelineLite", ()=>(0, _gsapCoreJs.TimelineLite));
parcelHelpers.export(exports, "Power0", ()=>(0, _gsapCoreJs.Power0));
parcelHelpers.export(exports, "Power1", ()=>(0, _gsapCoreJs.Power1));
parcelHelpers.export(exports, "Power2", ()=>(0, _gsapCoreJs.Power2));
parcelHelpers.export(exports, "Power3", ()=>(0, _gsapCoreJs.Power3));
parcelHelpers.export(exports, "Power4", ()=>(0, _gsapCoreJs.Power4));
parcelHelpers.export(exports, "Linear", ()=>(0, _gsapCoreJs.Linear));
parcelHelpers.export(exports, "Quad", ()=>(0, _gsapCoreJs.Quad));
parcelHelpers.export(exports, "Cubic", ()=>(0, _gsapCoreJs.Cubic));
parcelHelpers.export(exports, "Quart", ()=>(0, _gsapCoreJs.Quart));
parcelHelpers.export(exports, "Quint", ()=>(0, _gsapCoreJs.Quint));