@@ -4743,6 +4743,38 @@ var _Crypto_noble=(()=>{var ie=Object.defineProperty;var Nn=Object.getOwnPropert
47434743*/
47444744/*! Bundled license information:
47454745
4746+@noble/hashes/utils.js:
4747+ (*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
4748+
4749+@noble/curves/utils.js:
4750+@noble/curves/abstract/modular.js:
4751+@noble/curves/abstract/curve.js:
4752+@noble/curves/abstract/weierstrass.js:
4753+@noble/curves/secp256k1.js:
4754+@noble/curves/abstract/edwards.js:
4755+@noble/curves/abstract/montgomery.js:
4756+@noble/curves/ed25519.js:
4757+@noble/curves/nist.js:
4758+ (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
4759+*/
4760+/*! Bundled license information:
4761+
4762+@noble/hashes/utils.js:
4763+ (*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
4764+
4765+@noble/curves/utils.js:
4766+@noble/curves/abstract/modular.js:
4767+@noble/curves/abstract/curve.js:
4768+@noble/curves/abstract/weierstrass.js:
4769+@noble/curves/secp256k1.js:
4770+@noble/curves/abstract/edwards.js:
4771+@noble/curves/abstract/montgomery.js:
4772+@noble/curves/ed25519.js:
4773+@noble/curves/nist.js:
4774+ (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
4775+*/
4776+/*! Bundled license information:
4777+
47464778@noble/hashes/utils.js:
47474779 (*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
47484780
@@ -7440,21 +7472,43 @@ var $author$project$Main$charToHexBytes = function (c) {
74407472 A2($elm$core$Basics$modBy, 16, b2))
74417473 ]);
74427474 } else {
7443− var b3 = 128 + A2($elm$core$Basics$modBy, 64, code);
7444− var b2 = 128 + A2($elm$core$Basics$modBy, 64, (code / 64) | 0);
7445− var b1 = 224 + ((code / 4096) | 0);
7446− return _List_fromArray(
7447− [
7448− $author$project$Main$nibbleToHex((b1 / 16) | 0),
7449− $author$project$Main$nibbleToHex(
7450− A2($elm$core$Basics$modBy, 16, b1)),
7451− $author$project$Main$nibbleToHex((b2 / 16) | 0),
7452− $author$project$Main$nibbleToHex(
7453− A2($elm$core$Basics$modBy, 16, b2)),
7454− $author$project$Main$nibbleToHex((b3 / 16) | 0),
7455− $author$project$Main$nibbleToHex(
7456− A2($elm$core$Basics$modBy, 16, b3))
7457− ]);
7475+ if (code < 65536) {
7476+ var b3 = 128 + A2($elm$core$Basics$modBy, 64, code);
7477+ var b2 = 128 + A2($elm$core$Basics$modBy, 64, (code / 64) | 0);
7478+ var b1 = 224 + ((code / 4096) | 0);
7479+ return _List_fromArray(
7480+ [
7481+ $author$project$Main$nibbleToHex((b1 / 16) | 0),
7482+ $author$project$Main$nibbleToHex(
7483+ A2($elm$core$Basics$modBy, 16, b1)),
7484+ $author$project$Main$nibbleToHex((b2 / 16) | 0),
7485+ $author$project$Main$nibbleToHex(
7486+ A2($elm$core$Basics$modBy, 16, b2)),
7487+ $author$project$Main$nibbleToHex((b3 / 16) | 0),
7488+ $author$project$Main$nibbleToHex(
7489+ A2($elm$core$Basics$modBy, 16, b3))
7490+ ]);
7491+ } else {
7492+ var b4 = 128 + A2($elm$core$Basics$modBy, 64, code);
7493+ var b3 = 128 + A2($elm$core$Basics$modBy, 64, (code / 64) | 0);
7494+ var b2 = 128 + A2($elm$core$Basics$modBy, 64, (code / 4096) | 0);
7495+ var b1 = 240 + ((code / 262144) | 0);
7496+ return _List_fromArray(
7497+ [
7498+ $author$project$Main$nibbleToHex((b1 / 16) | 0),
7499+ $author$project$Main$nibbleToHex(
7500+ A2($elm$core$Basics$modBy, 16, b1)),
7501+ $author$project$Main$nibbleToHex((b2 / 16) | 0),
7502+ $author$project$Main$nibbleToHex(
7503+ A2($elm$core$Basics$modBy, 16, b2)),
7504+ $author$project$Main$nibbleToHex((b3 / 16) | 0),
7505+ $author$project$Main$nibbleToHex(
7506+ A2($elm$core$Basics$modBy, 16, b3)),
7507+ $author$project$Main$nibbleToHex((b4 / 16) | 0),
7508+ $author$project$Main$nibbleToHex(
7509+ A2($elm$core$Basics$modBy, 16, b4))
7510+ ]);
7511+ }
74587512 }
74597513 }
74607514};
@@ -7917,68 +7971,77 @@ var $author$project$Main$messagePayloadDecoder = A5(
79177971 A2($elm$json$Json$Decode$field, 'body', $elm$json$Json$Decode$string));
79187972var $author$project$Main$processEvents = F4(
79197973 function (xPriv, myEdHex, events, seenIds) {
7920− return A3(
7921− $elm$core$List$foldl,
7922− F2(
7923− function (event, _v0) {
7924− var msgs = _v0.a;
7925− var seen = _v0.b;
7926− var acks = _v0.c;
7927− if (event.eventType !== 'message') {
7928− return _Utils_Tuple3(msgs, seen, acks);
7929− } else {
7930− var _v1 = A2($elm$json$Json$Decode$decodeString, $author$project$Main$envelopeDecoder, event.payload);
7931− if (_v1.$ === 'Err') {
7932− return _Utils_Tuple3(
7933− msgs,
7934− seen,
7935− A2($elm$core$List$cons, event.id, acks));
7974+ return function (_v5) {
7975+ var msgs = _v5.a;
7976+ var seen = _v5.b;
7977+ var acks = _v5.c;
7978+ return _Utils_Tuple3(
7979+ $elm$core$List$reverse(msgs),
7980+ seen,
7981+ acks);
7982+ }(
7983+ A3(
7984+ $elm$core$List$foldl,
7985+ F2(
7986+ function (event, _v0) {
7987+ var msgs = _v0.a;
7988+ var seen = _v0.b;
7989+ var acks = _v0.c;
7990+ if (event.eventType !== 'message') {
7991+ return _Utils_Tuple3(msgs, seen, acks);
79367992 } else {
7937− var envelope = _v1.a;
7938− if (_Utils_eq(envelope.fromKey, myEdHex)) {
7993+ var _v1 = A2($elm$json$Json$Decode$decodeString, $author$project$Main$envelopeDecoder, event.payload);
7994+ if (_v1.$ === 'Err') {
79397995 return _Utils_Tuple3(
79407996 msgs,
79417997 seen,
79427998 A2($elm$core$List$cons, event.id, acks));
79437999 } else {
7944− var _v2 = A2($author$project$Main$decryptMessage, xPriv, envelope.encryptedBlob);
7945− if (_v2.$ === 'Nothing') {
8000+ var envelope = _v1.a;
8001+ if (_Utils_eq(envelope.fromKey, myEdHex)) {
79468002 return _Utils_Tuple3(
79478003 msgs,
79488004 seen,
79498005 A2($elm$core$List$cons, event.id, acks));
79508006 } else {
7951− var _v3 = _v2.a;
7952− var senderPub = _v3.a;
7953− var json = _v3.b;
7954− var _v4 = A2($elm$json$Json$Decode$decodeString, $author$project$Main$messagePayloadDecoder, json);
7955− if (_v4.$ === 'Err') {
8007+ var _v2 = A2($author$project$Main$decryptMessage, xPriv, envelope.encryptedBlob);
8008+ if (_v2.$ === 'Nothing') {
79568009 return _Utils_Tuple3(
79578010 msgs,
79588011 seen,
79598012 A2($elm$core$List$cons, event.id, acks));
79608013 } else {
7961− var payload = _v4.a;
7962− return A2($elm$core$Set$member, payload.id, seen) ? _Utils_Tuple3(
7963− msgs,
7964− seen,
7965− A2($elm$core$List$cons, event.id, acks)) : _Utils_Tuple3(
7966− A2(
7967− $elm$core$List$cons,
7968− _Utils_Tuple2(
7969− senderPub,
7970− {body: payload.body, id: payload.id, outgoing: false, timestamp: payload.timestamp}),
7971− msgs),
7972− A2($elm$core$Set$insert, payload.id, seen),
7973− A2($elm$core$List$cons, event.id, acks));
8014+ var _v3 = _v2.a;
8015+ var senderPub = _v3.a;
8016+ var json = _v3.b;
8017+ var _v4 = A2($elm$json$Json$Decode$decodeString, $author$project$Main$messagePayloadDecoder, json);
8018+ if (_v4.$ === 'Err') {
8019+ return _Utils_Tuple3(
8020+ msgs,
8021+ seen,
8022+ A2($elm$core$List$cons, event.id, acks));
8023+ } else {
8024+ var payload = _v4.a;
8025+ return A2($elm$core$Set$member, payload.id, seen) ? _Utils_Tuple3(
8026+ msgs,
8027+ seen,
8028+ A2($elm$core$List$cons, event.id, acks)) : _Utils_Tuple3(
8029+ A2(
8030+ $elm$core$List$cons,
8031+ _Utils_Tuple2(
8032+ senderPub,
8033+ {body: payload.body, id: payload.id, outgoing: false, timestamp: payload.timestamp}),
8034+ msgs),
8035+ A2($elm$core$Set$insert, payload.id, seen),
8036+ A2($elm$core$List$cons, event.id, acks));
8037+ }
79748038 }
79758039 }
79768040 }
79778041 }
7978− }
7979− }),
7980− _Utils_Tuple3(_List_Nil, seenIds, _List_Nil),
7981− events);
8042+ }),
8043+ _Utils_Tuple3(_List_Nil, seenIds, _List_Nil),
8044+ events));
79828045 });
79838046var $author$project$Main$GotChallenge = function (a) {
79848047 return {$: 'GotChallenge', a: a};