@oila/0account 3.4.7 → 3.4.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/zero-account/app-globals-0f993ce5.js +5 -0
- package/dist/zero-account/app-globals-0f993ce5.js.map +1 -0
- package/dist/{collection/components/zero-account/enums.js → zero-account/enums-816340c2.js} +7 -4
- package/dist/zero-account/enums-816340c2.js.map +1 -0
- package/dist/zero-account/enums-e7827156.js +21 -0
- package/dist/zero-account/enums-e7827156.js.map +1 -0
- package/dist/zero-account/index-57856b47.js +3380 -0
- package/dist/zero-account/index-57856b47.js.map +1 -0
- package/dist/zero-account/index.esm.js +1 -0
- package/dist/zero-account/index.esm.js.map +1 -1
- package/dist/{collection/utils/qrcode/qrcode.js → zero-account/qr-code.entry.js} +35 -3
- package/dist/zero-account/qr-code.entry.js.map +1 -0
- package/dist/zero-account/shadow-css-8a6ccf47.js +389 -0
- package/dist/zero-account/shadow-css-8a6ccf47.js.map +1 -0
- package/dist/{components/zero-account.js → zero-account/zero-account.entry.js} +597 -58
- package/dist/zero-account/zero-account.entry.js.map +1 -0
- package/dist/zero-account/zero-account.esm.js +64 -1
- package/dist/zero-account/zero-account.esm.js.map +1 -1
- package/package.json +1 -1
- package/dist/cjs/index-1e526aba.js +0 -1645
- package/dist/cjs/index-1e526aba.js.map +0 -1
- package/dist/cjs/index.cjs.js +0 -4
- package/dist/cjs/index.cjs.js.map +0 -1
- package/dist/cjs/loader.cjs.js +0 -15
- package/dist/cjs/loader.cjs.js.map +0 -1
- package/dist/cjs/qr-code_2.cjs.entry.js +0 -2470
- package/dist/cjs/qr-code_2.cjs.entry.js.map +0 -1
- package/dist/cjs/zero-account.cjs.js +0 -25
- package/dist/cjs/zero-account.cjs.js.map +0 -1
- package/dist/collection/collection-manifest.json +0 -13
- package/dist/collection/components/zero-account/enums.js.map +0 -1
- package/dist/collection/components/zero-account/logo.js +0 -6
- package/dist/collection/components/zero-account/logo.js.map +0 -1
- package/dist/collection/components/zero-account/qrcode.js +0 -111
- package/dist/collection/components/zero-account/qrcode.js.map +0 -1
- package/dist/collection/components/zero-account/websocket.js +0 -175
- package/dist/collection/components/zero-account/websocket.js.map +0 -1
- package/dist/collection/components/zero-account/zero-account.css +0 -287
- package/dist/collection/components/zero-account/zero-account.e2e.js +0 -26
- package/dist/collection/components/zero-account/zero-account.e2e.js.map +0 -1
- package/dist/collection/components/zero-account/zero-account.js +0 -401
- package/dist/collection/components/zero-account/zero-account.js.map +0 -1
- package/dist/collection/components/zero-account/zero-account.spec.js +0 -35
- package/dist/collection/components/zero-account/zero-account.spec.js.map +0 -1
- package/dist/collection/index.js +0 -2
- package/dist/collection/index.js.map +0 -1
- package/dist/collection/utils/request.js +0 -38
- package/dist/collection/utils/request.js.map +0 -1
- package/dist/collection/utils/url.js +0 -43
- package/dist/collection/utils/utils.js +0 -16
- package/dist/collection/utils/utils.js.map +0 -1
- package/dist/collection/utils/utils.spec.js +0 -10
- package/dist/collection/utils/utils.spec.js.map +0 -1
- package/dist/components/index.js +0 -3
- package/dist/components/index.js.map +0 -1
- package/dist/components/qr-code.js +0 -8
- package/dist/components/qr-code.js.map +0 -1
- package/dist/components/qrcode.js +0 -1073
- package/dist/components/qrcode.js.map +0 -1
- package/dist/components/zero-account.js.map +0 -1
- package/dist/esm/index-09024c20.js +0 -1616
- package/dist/esm/index-09024c20.js.map +0 -1
- package/dist/esm/index.js +0 -3
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/loader.js +0 -11
- package/dist/esm/loader.js.map +0 -1
- package/dist/esm/polyfills/core-js.js +0 -11
- package/dist/esm/polyfills/dom.js +0 -79
- package/dist/esm/polyfills/es5-html-element.js +0 -1
- package/dist/esm/polyfills/index.js +0 -34
- package/dist/esm/polyfills/system.js +0 -6
- package/dist/esm/qr-code_2.entry.js +0 -2465
- package/dist/esm/qr-code_2.entry.js.map +0 -1
- package/dist/esm/zero-account.js +0 -20
- package/dist/esm/zero-account.js.map +0 -1
- package/dist/index.cjs.js +0 -1
- package/dist/index.js +0 -1
- package/dist/zero-account/p-21f4994d.js +0 -3
- package/dist/zero-account/p-21f4994d.js.map +0 -1
- package/dist/zero-account/p-a29dc444.entry.js +0 -2
- package/dist/zero-account/p-a29dc444.entry.js.map +0 -1
|
@@ -1,18 +1,45 @@
|
|
|
1
|
-
import { Build, h,
|
|
2
|
-
import { E as Environment, a as ErrorCorrectionLevel, T as ThemePreset
|
|
1
|
+
import { a as Build, h, r as registerInstance, e as Host, g as getElement } from './index-57856b47.js';
|
|
2
|
+
import { E as Environment, a as ErrorCorrectionLevel, T as ThemePreset } from './enums-e7827156.js';
|
|
3
3
|
|
|
4
4
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
5
5
|
|
|
6
|
+
function getDefaultExportFromCjs (x) {
|
|
7
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
8
|
+
}
|
|
9
|
+
|
|
6
10
|
function createCommonjsModule(fn, basedir, module) {
|
|
7
11
|
return module = {
|
|
8
12
|
path: basedir,
|
|
9
13
|
exports: {},
|
|
10
14
|
require: function (path, base) {
|
|
11
|
-
return commonjsRequire();
|
|
15
|
+
return commonjsRequire(path, (base === undefined || base === null) ? module.path : base);
|
|
12
16
|
}
|
|
13
17
|
}, fn(module, module.exports), module.exports;
|
|
14
18
|
}
|
|
15
19
|
|
|
20
|
+
function getDefaultExportFromNamespaceIfPresent (n) {
|
|
21
|
+
return n && Object.prototype.hasOwnProperty.call(n, 'default') ? n['default'] : n;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function getDefaultExportFromNamespaceIfNotNamed (n) {
|
|
25
|
+
return n && Object.prototype.hasOwnProperty.call(n, 'default') && Object.keys(n).length === 1 ? n['default'] : n;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function getAugmentedNamespace(n) {
|
|
29
|
+
if (n.__esModule) return n;
|
|
30
|
+
var a = Object.defineProperty({}, '__esModule', {value: true});
|
|
31
|
+
Object.keys(n).forEach(function (k) {
|
|
32
|
+
var d = Object.getOwnPropertyDescriptor(n, k);
|
|
33
|
+
Object.defineProperty(a, k, d.get ? d : {
|
|
34
|
+
enumerable: true,
|
|
35
|
+
get: function () {
|
|
36
|
+
return n[k];
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
return a;
|
|
41
|
+
}
|
|
42
|
+
|
|
16
43
|
function commonjsRequire () {
|
|
17
44
|
throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
|
|
18
45
|
}
|
|
@@ -30,6 +57,8 @@ var uaParser = createCommonjsModule(function (module, exports) {
|
|
|
30
57
|
|
|
31
58
|
(function (window, undefined$1) {
|
|
32
59
|
|
|
60
|
+
'use strict';
|
|
61
|
+
|
|
33
62
|
//////////////
|
|
34
63
|
// Constants
|
|
35
64
|
/////////////
|
|
@@ -74,6 +103,7 @@ var uaParser = createCommonjsModule(function (module, exports) {
|
|
|
74
103
|
SAMSUNG = 'Samsung',
|
|
75
104
|
SHARP = 'Sharp',
|
|
76
105
|
SONY = 'Sony',
|
|
106
|
+
VIERA = 'Viera',
|
|
77
107
|
XIAOMI = 'Xiaomi',
|
|
78
108
|
ZEBRA = 'Zebra',
|
|
79
109
|
FACEBOOK = 'Facebook',
|
|
@@ -907,12 +937,22 @@ var uaParser = createCommonjsModule(function (module, exports) {
|
|
|
907
937
|
//////////
|
|
908
938
|
|
|
909
939
|
// check js environment
|
|
910
|
-
{
|
|
940
|
+
if ('object' !== UNDEF_TYPE) {
|
|
911
941
|
// nodejs env
|
|
912
|
-
if (module.exports) {
|
|
942
|
+
if ('object' !== UNDEF_TYPE && module.exports) {
|
|
913
943
|
exports = module.exports = UAParser;
|
|
914
944
|
}
|
|
915
945
|
exports.UAParser = UAParser;
|
|
946
|
+
} else {
|
|
947
|
+
// requirejs env (optional)
|
|
948
|
+
if (typeof(undefined$1) === FUNC_TYPE && undefined$1.amd) {
|
|
949
|
+
undefined$1(function () {
|
|
950
|
+
return UAParser;
|
|
951
|
+
});
|
|
952
|
+
} else if (typeof window !== UNDEF_TYPE) {
|
|
953
|
+
// browser env
|
|
954
|
+
window.UAParser = UAParser;
|
|
955
|
+
}
|
|
916
956
|
}
|
|
917
957
|
|
|
918
958
|
// jQuery/Zepto specific (optional)
|
|
@@ -958,6 +998,12 @@ function rng() {
|
|
|
958
998
|
return getRandomValues(rnds8);
|
|
959
999
|
}
|
|
960
1000
|
|
|
1001
|
+
const REGEX = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
|
|
1002
|
+
|
|
1003
|
+
function validate(uuid) {
|
|
1004
|
+
return typeof uuid === 'string' && REGEX.test(uuid);
|
|
1005
|
+
}
|
|
1006
|
+
|
|
961
1007
|
/**
|
|
962
1008
|
* Convert array of 16 byte values to UUID string format of the form:
|
|
963
1009
|
* XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
|
|
@@ -975,6 +1021,424 @@ function unsafeStringify(arr, offset = 0) {
|
|
|
975
1021
|
return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
|
|
976
1022
|
}
|
|
977
1023
|
|
|
1024
|
+
function stringify(arr, offset = 0) {
|
|
1025
|
+
const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one
|
|
1026
|
+
// of the following:
|
|
1027
|
+
// - One or more input array values don't map to a hex octet (leading to
|
|
1028
|
+
// "undefined" in the uuid)
|
|
1029
|
+
// - Invalid input values for the RFC `version` or `variant` fields
|
|
1030
|
+
|
|
1031
|
+
if (!validate(uuid)) {
|
|
1032
|
+
throw TypeError('Stringified UUID is invalid');
|
|
1033
|
+
}
|
|
1034
|
+
|
|
1035
|
+
return uuid;
|
|
1036
|
+
}
|
|
1037
|
+
|
|
1038
|
+
//
|
|
1039
|
+
// Inspired by https://github.com/LiosK/UUID.js
|
|
1040
|
+
// and http://docs.python.org/library/uuid.html
|
|
1041
|
+
|
|
1042
|
+
let _nodeId;
|
|
1043
|
+
|
|
1044
|
+
let _clockseq; // Previous uuid creation time
|
|
1045
|
+
|
|
1046
|
+
|
|
1047
|
+
let _lastMSecs = 0;
|
|
1048
|
+
let _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details
|
|
1049
|
+
|
|
1050
|
+
function v1(options, buf, offset) {
|
|
1051
|
+
let i = buf && offset || 0;
|
|
1052
|
+
const b = buf || new Array(16);
|
|
1053
|
+
options = options || {};
|
|
1054
|
+
let node = options.node || _nodeId;
|
|
1055
|
+
let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not
|
|
1056
|
+
// specified. We do this lazily to minimize issues related to insufficient
|
|
1057
|
+
// system entropy. See #189
|
|
1058
|
+
|
|
1059
|
+
if (node == null || clockseq == null) {
|
|
1060
|
+
const seedBytes = options.random || (options.rng || rng)();
|
|
1061
|
+
|
|
1062
|
+
if (node == null) {
|
|
1063
|
+
// Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
|
|
1064
|
+
node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];
|
|
1065
|
+
}
|
|
1066
|
+
|
|
1067
|
+
if (clockseq == null) {
|
|
1068
|
+
// Per 4.2.2, randomize (14 bit) clockseq
|
|
1069
|
+
clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;
|
|
1070
|
+
}
|
|
1071
|
+
} // UUID timestamps are 100 nano-second units since the Gregorian epoch,
|
|
1072
|
+
// (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
|
|
1073
|
+
// time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
|
|
1074
|
+
// (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
|
|
1075
|
+
|
|
1076
|
+
|
|
1077
|
+
let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock
|
|
1078
|
+
// cycle to simulate higher resolution clock
|
|
1079
|
+
|
|
1080
|
+
let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs)
|
|
1081
|
+
|
|
1082
|
+
const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression
|
|
1083
|
+
|
|
1084
|
+
if (dt < 0 && options.clockseq === undefined) {
|
|
1085
|
+
clockseq = clockseq + 1 & 0x3fff;
|
|
1086
|
+
} // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
|
|
1087
|
+
// time interval
|
|
1088
|
+
|
|
1089
|
+
|
|
1090
|
+
if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
|
|
1091
|
+
nsecs = 0;
|
|
1092
|
+
} // Per 4.2.1.2 Throw error if too many uuids are requested
|
|
1093
|
+
|
|
1094
|
+
|
|
1095
|
+
if (nsecs >= 10000) {
|
|
1096
|
+
throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");
|
|
1097
|
+
}
|
|
1098
|
+
|
|
1099
|
+
_lastMSecs = msecs;
|
|
1100
|
+
_lastNSecs = nsecs;
|
|
1101
|
+
_clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch
|
|
1102
|
+
|
|
1103
|
+
msecs += 12219292800000; // `time_low`
|
|
1104
|
+
|
|
1105
|
+
const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
|
|
1106
|
+
b[i++] = tl >>> 24 & 0xff;
|
|
1107
|
+
b[i++] = tl >>> 16 & 0xff;
|
|
1108
|
+
b[i++] = tl >>> 8 & 0xff;
|
|
1109
|
+
b[i++] = tl & 0xff; // `time_mid`
|
|
1110
|
+
|
|
1111
|
+
const tmh = msecs / 0x100000000 * 10000 & 0xfffffff;
|
|
1112
|
+
b[i++] = tmh >>> 8 & 0xff;
|
|
1113
|
+
b[i++] = tmh & 0xff; // `time_high_and_version`
|
|
1114
|
+
|
|
1115
|
+
b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
|
|
1116
|
+
|
|
1117
|
+
b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
|
|
1118
|
+
|
|
1119
|
+
b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low`
|
|
1120
|
+
|
|
1121
|
+
b[i++] = clockseq & 0xff; // `node`
|
|
1122
|
+
|
|
1123
|
+
for (let n = 0; n < 6; ++n) {
|
|
1124
|
+
b[i + n] = node[n];
|
|
1125
|
+
}
|
|
1126
|
+
|
|
1127
|
+
return buf || unsafeStringify(b);
|
|
1128
|
+
}
|
|
1129
|
+
|
|
1130
|
+
function parse(uuid) {
|
|
1131
|
+
if (!validate(uuid)) {
|
|
1132
|
+
throw TypeError('Invalid UUID');
|
|
1133
|
+
}
|
|
1134
|
+
|
|
1135
|
+
let v;
|
|
1136
|
+
const arr = new Uint8Array(16); // Parse ########-....-....-....-............
|
|
1137
|
+
|
|
1138
|
+
arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;
|
|
1139
|
+
arr[1] = v >>> 16 & 0xff;
|
|
1140
|
+
arr[2] = v >>> 8 & 0xff;
|
|
1141
|
+
arr[3] = v & 0xff; // Parse ........-####-....-....-............
|
|
1142
|
+
|
|
1143
|
+
arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;
|
|
1144
|
+
arr[5] = v & 0xff; // Parse ........-....-####-....-............
|
|
1145
|
+
|
|
1146
|
+
arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;
|
|
1147
|
+
arr[7] = v & 0xff; // Parse ........-....-....-####-............
|
|
1148
|
+
|
|
1149
|
+
arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;
|
|
1150
|
+
arr[9] = v & 0xff; // Parse ........-....-....-....-############
|
|
1151
|
+
// (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes)
|
|
1152
|
+
|
|
1153
|
+
arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff;
|
|
1154
|
+
arr[11] = v / 0x100000000 & 0xff;
|
|
1155
|
+
arr[12] = v >>> 24 & 0xff;
|
|
1156
|
+
arr[13] = v >>> 16 & 0xff;
|
|
1157
|
+
arr[14] = v >>> 8 & 0xff;
|
|
1158
|
+
arr[15] = v & 0xff;
|
|
1159
|
+
return arr;
|
|
1160
|
+
}
|
|
1161
|
+
|
|
1162
|
+
function stringToBytes(str) {
|
|
1163
|
+
str = unescape(encodeURIComponent(str)); // UTF8 escape
|
|
1164
|
+
|
|
1165
|
+
const bytes = [];
|
|
1166
|
+
|
|
1167
|
+
for (let i = 0; i < str.length; ++i) {
|
|
1168
|
+
bytes.push(str.charCodeAt(i));
|
|
1169
|
+
}
|
|
1170
|
+
|
|
1171
|
+
return bytes;
|
|
1172
|
+
}
|
|
1173
|
+
|
|
1174
|
+
const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';
|
|
1175
|
+
const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';
|
|
1176
|
+
function v35(name, version, hashfunc) {
|
|
1177
|
+
function generateUUID(value, namespace, buf, offset) {
|
|
1178
|
+
var _namespace;
|
|
1179
|
+
|
|
1180
|
+
if (typeof value === 'string') {
|
|
1181
|
+
value = stringToBytes(value);
|
|
1182
|
+
}
|
|
1183
|
+
|
|
1184
|
+
if (typeof namespace === 'string') {
|
|
1185
|
+
namespace = parse(namespace);
|
|
1186
|
+
}
|
|
1187
|
+
|
|
1188
|
+
if (((_namespace = namespace) === null || _namespace === void 0 ? void 0 : _namespace.length) !== 16) {
|
|
1189
|
+
throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');
|
|
1190
|
+
} // Compute hash of namespace and value, Per 4.3
|
|
1191
|
+
// Future: Use spread syntax when supported on all platforms, e.g. `bytes =
|
|
1192
|
+
// hashfunc([...namespace, ... value])`
|
|
1193
|
+
|
|
1194
|
+
|
|
1195
|
+
let bytes = new Uint8Array(16 + value.length);
|
|
1196
|
+
bytes.set(namespace);
|
|
1197
|
+
bytes.set(value, namespace.length);
|
|
1198
|
+
bytes = hashfunc(bytes);
|
|
1199
|
+
bytes[6] = bytes[6] & 0x0f | version;
|
|
1200
|
+
bytes[8] = bytes[8] & 0x3f | 0x80;
|
|
1201
|
+
|
|
1202
|
+
if (buf) {
|
|
1203
|
+
offset = offset || 0;
|
|
1204
|
+
|
|
1205
|
+
for (let i = 0; i < 16; ++i) {
|
|
1206
|
+
buf[offset + i] = bytes[i];
|
|
1207
|
+
}
|
|
1208
|
+
|
|
1209
|
+
return buf;
|
|
1210
|
+
}
|
|
1211
|
+
|
|
1212
|
+
return unsafeStringify(bytes);
|
|
1213
|
+
} // Function#name is not settable on some platforms (#270)
|
|
1214
|
+
|
|
1215
|
+
|
|
1216
|
+
try {
|
|
1217
|
+
generateUUID.name = name; // eslint-disable-next-line no-empty
|
|
1218
|
+
} catch (err) {} // For CommonJS default export support
|
|
1219
|
+
|
|
1220
|
+
|
|
1221
|
+
generateUUID.DNS = DNS;
|
|
1222
|
+
generateUUID.URL = URL;
|
|
1223
|
+
return generateUUID;
|
|
1224
|
+
}
|
|
1225
|
+
|
|
1226
|
+
/*
|
|
1227
|
+
* Browser-compatible JavaScript MD5
|
|
1228
|
+
*
|
|
1229
|
+
* Modification of JavaScript MD5
|
|
1230
|
+
* https://github.com/blueimp/JavaScript-MD5
|
|
1231
|
+
*
|
|
1232
|
+
* Copyright 2011, Sebastian Tschan
|
|
1233
|
+
* https://blueimp.net
|
|
1234
|
+
*
|
|
1235
|
+
* Licensed under the MIT license:
|
|
1236
|
+
* https://opensource.org/licenses/MIT
|
|
1237
|
+
*
|
|
1238
|
+
* Based on
|
|
1239
|
+
* A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
|
|
1240
|
+
* Digest Algorithm, as defined in RFC 1321.
|
|
1241
|
+
* Version 2.2 Copyright (C) Paul Johnston 1999 - 2009
|
|
1242
|
+
* Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
|
|
1243
|
+
* Distributed under the BSD License
|
|
1244
|
+
* See http://pajhome.org.uk/crypt/md5 for more info.
|
|
1245
|
+
*/
|
|
1246
|
+
function md5(bytes) {
|
|
1247
|
+
if (typeof bytes === 'string') {
|
|
1248
|
+
const msg = unescape(encodeURIComponent(bytes)); // UTF8 escape
|
|
1249
|
+
|
|
1250
|
+
bytes = new Uint8Array(msg.length);
|
|
1251
|
+
|
|
1252
|
+
for (let i = 0; i < msg.length; ++i) {
|
|
1253
|
+
bytes[i] = msg.charCodeAt(i);
|
|
1254
|
+
}
|
|
1255
|
+
}
|
|
1256
|
+
|
|
1257
|
+
return md5ToHexEncodedArray(wordsToMd5(bytesToWords(bytes), bytes.length * 8));
|
|
1258
|
+
}
|
|
1259
|
+
/*
|
|
1260
|
+
* Convert an array of little-endian words to an array of bytes
|
|
1261
|
+
*/
|
|
1262
|
+
|
|
1263
|
+
|
|
1264
|
+
function md5ToHexEncodedArray(input) {
|
|
1265
|
+
const output = [];
|
|
1266
|
+
const length32 = input.length * 32;
|
|
1267
|
+
const hexTab = '0123456789abcdef';
|
|
1268
|
+
|
|
1269
|
+
for (let i = 0; i < length32; i += 8) {
|
|
1270
|
+
const x = input[i >> 5] >>> i % 32 & 0xff;
|
|
1271
|
+
const hex = parseInt(hexTab.charAt(x >>> 4 & 0x0f) + hexTab.charAt(x & 0x0f), 16);
|
|
1272
|
+
output.push(hex);
|
|
1273
|
+
}
|
|
1274
|
+
|
|
1275
|
+
return output;
|
|
1276
|
+
}
|
|
1277
|
+
/**
|
|
1278
|
+
* Calculate output length with padding and bit length
|
|
1279
|
+
*/
|
|
1280
|
+
|
|
1281
|
+
|
|
1282
|
+
function getOutputLength(inputLength8) {
|
|
1283
|
+
return (inputLength8 + 64 >>> 9 << 4) + 14 + 1;
|
|
1284
|
+
}
|
|
1285
|
+
/*
|
|
1286
|
+
* Calculate the MD5 of an array of little-endian words, and a bit length.
|
|
1287
|
+
*/
|
|
1288
|
+
|
|
1289
|
+
|
|
1290
|
+
function wordsToMd5(x, len) {
|
|
1291
|
+
/* append padding */
|
|
1292
|
+
x[len >> 5] |= 0x80 << len % 32;
|
|
1293
|
+
x[getOutputLength(len) - 1] = len;
|
|
1294
|
+
let a = 1732584193;
|
|
1295
|
+
let b = -271733879;
|
|
1296
|
+
let c = -1732584194;
|
|
1297
|
+
let d = 271733878;
|
|
1298
|
+
|
|
1299
|
+
for (let i = 0; i < x.length; i += 16) {
|
|
1300
|
+
const olda = a;
|
|
1301
|
+
const oldb = b;
|
|
1302
|
+
const oldc = c;
|
|
1303
|
+
const oldd = d;
|
|
1304
|
+
a = md5ff(a, b, c, d, x[i], 7, -680876936);
|
|
1305
|
+
d = md5ff(d, a, b, c, x[i + 1], 12, -389564586);
|
|
1306
|
+
c = md5ff(c, d, a, b, x[i + 2], 17, 606105819);
|
|
1307
|
+
b = md5ff(b, c, d, a, x[i + 3], 22, -1044525330);
|
|
1308
|
+
a = md5ff(a, b, c, d, x[i + 4], 7, -176418897);
|
|
1309
|
+
d = md5ff(d, a, b, c, x[i + 5], 12, 1200080426);
|
|
1310
|
+
c = md5ff(c, d, a, b, x[i + 6], 17, -1473231341);
|
|
1311
|
+
b = md5ff(b, c, d, a, x[i + 7], 22, -45705983);
|
|
1312
|
+
a = md5ff(a, b, c, d, x[i + 8], 7, 1770035416);
|
|
1313
|
+
d = md5ff(d, a, b, c, x[i + 9], 12, -1958414417);
|
|
1314
|
+
c = md5ff(c, d, a, b, x[i + 10], 17, -42063);
|
|
1315
|
+
b = md5ff(b, c, d, a, x[i + 11], 22, -1990404162);
|
|
1316
|
+
a = md5ff(a, b, c, d, x[i + 12], 7, 1804603682);
|
|
1317
|
+
d = md5ff(d, a, b, c, x[i + 13], 12, -40341101);
|
|
1318
|
+
c = md5ff(c, d, a, b, x[i + 14], 17, -1502002290);
|
|
1319
|
+
b = md5ff(b, c, d, a, x[i + 15], 22, 1236535329);
|
|
1320
|
+
a = md5gg(a, b, c, d, x[i + 1], 5, -165796510);
|
|
1321
|
+
d = md5gg(d, a, b, c, x[i + 6], 9, -1069501632);
|
|
1322
|
+
c = md5gg(c, d, a, b, x[i + 11], 14, 643717713);
|
|
1323
|
+
b = md5gg(b, c, d, a, x[i], 20, -373897302);
|
|
1324
|
+
a = md5gg(a, b, c, d, x[i + 5], 5, -701558691);
|
|
1325
|
+
d = md5gg(d, a, b, c, x[i + 10], 9, 38016083);
|
|
1326
|
+
c = md5gg(c, d, a, b, x[i + 15], 14, -660478335);
|
|
1327
|
+
b = md5gg(b, c, d, a, x[i + 4], 20, -405537848);
|
|
1328
|
+
a = md5gg(a, b, c, d, x[i + 9], 5, 568446438);
|
|
1329
|
+
d = md5gg(d, a, b, c, x[i + 14], 9, -1019803690);
|
|
1330
|
+
c = md5gg(c, d, a, b, x[i + 3], 14, -187363961);
|
|
1331
|
+
b = md5gg(b, c, d, a, x[i + 8], 20, 1163531501);
|
|
1332
|
+
a = md5gg(a, b, c, d, x[i + 13], 5, -1444681467);
|
|
1333
|
+
d = md5gg(d, a, b, c, x[i + 2], 9, -51403784);
|
|
1334
|
+
c = md5gg(c, d, a, b, x[i + 7], 14, 1735328473);
|
|
1335
|
+
b = md5gg(b, c, d, a, x[i + 12], 20, -1926607734);
|
|
1336
|
+
a = md5hh(a, b, c, d, x[i + 5], 4, -378558);
|
|
1337
|
+
d = md5hh(d, a, b, c, x[i + 8], 11, -2022574463);
|
|
1338
|
+
c = md5hh(c, d, a, b, x[i + 11], 16, 1839030562);
|
|
1339
|
+
b = md5hh(b, c, d, a, x[i + 14], 23, -35309556);
|
|
1340
|
+
a = md5hh(a, b, c, d, x[i + 1], 4, -1530992060);
|
|
1341
|
+
d = md5hh(d, a, b, c, x[i + 4], 11, 1272893353);
|
|
1342
|
+
c = md5hh(c, d, a, b, x[i + 7], 16, -155497632);
|
|
1343
|
+
b = md5hh(b, c, d, a, x[i + 10], 23, -1094730640);
|
|
1344
|
+
a = md5hh(a, b, c, d, x[i + 13], 4, 681279174);
|
|
1345
|
+
d = md5hh(d, a, b, c, x[i], 11, -358537222);
|
|
1346
|
+
c = md5hh(c, d, a, b, x[i + 3], 16, -722521979);
|
|
1347
|
+
b = md5hh(b, c, d, a, x[i + 6], 23, 76029189);
|
|
1348
|
+
a = md5hh(a, b, c, d, x[i + 9], 4, -640364487);
|
|
1349
|
+
d = md5hh(d, a, b, c, x[i + 12], 11, -421815835);
|
|
1350
|
+
c = md5hh(c, d, a, b, x[i + 15], 16, 530742520);
|
|
1351
|
+
b = md5hh(b, c, d, a, x[i + 2], 23, -995338651);
|
|
1352
|
+
a = md5ii(a, b, c, d, x[i], 6, -198630844);
|
|
1353
|
+
d = md5ii(d, a, b, c, x[i + 7], 10, 1126891415);
|
|
1354
|
+
c = md5ii(c, d, a, b, x[i + 14], 15, -1416354905);
|
|
1355
|
+
b = md5ii(b, c, d, a, x[i + 5], 21, -57434055);
|
|
1356
|
+
a = md5ii(a, b, c, d, x[i + 12], 6, 1700485571);
|
|
1357
|
+
d = md5ii(d, a, b, c, x[i + 3], 10, -1894986606);
|
|
1358
|
+
c = md5ii(c, d, a, b, x[i + 10], 15, -1051523);
|
|
1359
|
+
b = md5ii(b, c, d, a, x[i + 1], 21, -2054922799);
|
|
1360
|
+
a = md5ii(a, b, c, d, x[i + 8], 6, 1873313359);
|
|
1361
|
+
d = md5ii(d, a, b, c, x[i + 15], 10, -30611744);
|
|
1362
|
+
c = md5ii(c, d, a, b, x[i + 6], 15, -1560198380);
|
|
1363
|
+
b = md5ii(b, c, d, a, x[i + 13], 21, 1309151649);
|
|
1364
|
+
a = md5ii(a, b, c, d, x[i + 4], 6, -145523070);
|
|
1365
|
+
d = md5ii(d, a, b, c, x[i + 11], 10, -1120210379);
|
|
1366
|
+
c = md5ii(c, d, a, b, x[i + 2], 15, 718787259);
|
|
1367
|
+
b = md5ii(b, c, d, a, x[i + 9], 21, -343485551);
|
|
1368
|
+
a = safeAdd(a, olda);
|
|
1369
|
+
b = safeAdd(b, oldb);
|
|
1370
|
+
c = safeAdd(c, oldc);
|
|
1371
|
+
d = safeAdd(d, oldd);
|
|
1372
|
+
}
|
|
1373
|
+
|
|
1374
|
+
return [a, b, c, d];
|
|
1375
|
+
}
|
|
1376
|
+
/*
|
|
1377
|
+
* Convert an array bytes to an array of little-endian words
|
|
1378
|
+
* Characters >255 have their high-byte silently ignored.
|
|
1379
|
+
*/
|
|
1380
|
+
|
|
1381
|
+
|
|
1382
|
+
function bytesToWords(input) {
|
|
1383
|
+
if (input.length === 0) {
|
|
1384
|
+
return [];
|
|
1385
|
+
}
|
|
1386
|
+
|
|
1387
|
+
const length8 = input.length * 8;
|
|
1388
|
+
const output = new Uint32Array(getOutputLength(length8));
|
|
1389
|
+
|
|
1390
|
+
for (let i = 0; i < length8; i += 8) {
|
|
1391
|
+
output[i >> 5] |= (input[i / 8] & 0xff) << i % 32;
|
|
1392
|
+
}
|
|
1393
|
+
|
|
1394
|
+
return output;
|
|
1395
|
+
}
|
|
1396
|
+
/*
|
|
1397
|
+
* Add integers, wrapping at 2^32. This uses 16-bit operations internally
|
|
1398
|
+
* to work around bugs in some JS interpreters.
|
|
1399
|
+
*/
|
|
1400
|
+
|
|
1401
|
+
|
|
1402
|
+
function safeAdd(x, y) {
|
|
1403
|
+
const lsw = (x & 0xffff) + (y & 0xffff);
|
|
1404
|
+
const msw = (x >> 16) + (y >> 16) + (lsw >> 16);
|
|
1405
|
+
return msw << 16 | lsw & 0xffff;
|
|
1406
|
+
}
|
|
1407
|
+
/*
|
|
1408
|
+
* Bitwise rotate a 32-bit number to the left.
|
|
1409
|
+
*/
|
|
1410
|
+
|
|
1411
|
+
|
|
1412
|
+
function bitRotateLeft(num, cnt) {
|
|
1413
|
+
return num << cnt | num >>> 32 - cnt;
|
|
1414
|
+
}
|
|
1415
|
+
/*
|
|
1416
|
+
* These functions implement the four basic operations the algorithm uses.
|
|
1417
|
+
*/
|
|
1418
|
+
|
|
1419
|
+
|
|
1420
|
+
function md5cmn(q, a, b, x, s, t) {
|
|
1421
|
+
return safeAdd(bitRotateLeft(safeAdd(safeAdd(a, q), safeAdd(x, t)), s), b);
|
|
1422
|
+
}
|
|
1423
|
+
|
|
1424
|
+
function md5ff(a, b, c, d, x, s, t) {
|
|
1425
|
+
return md5cmn(b & c | ~b & d, a, b, x, s, t);
|
|
1426
|
+
}
|
|
1427
|
+
|
|
1428
|
+
function md5gg(a, b, c, d, x, s, t) {
|
|
1429
|
+
return md5cmn(b & d | c & ~d, a, b, x, s, t);
|
|
1430
|
+
}
|
|
1431
|
+
|
|
1432
|
+
function md5hh(a, b, c, d, x, s, t) {
|
|
1433
|
+
return md5cmn(b ^ c ^ d, a, b, x, s, t);
|
|
1434
|
+
}
|
|
1435
|
+
|
|
1436
|
+
function md5ii(a, b, c, d, x, s, t) {
|
|
1437
|
+
return md5cmn(c ^ (b | ~d), a, b, x, s, t);
|
|
1438
|
+
}
|
|
1439
|
+
|
|
1440
|
+
const v3 = v35('v3', 0x30, md5);
|
|
1441
|
+
|
|
978
1442
|
const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
979
1443
|
const native = {
|
|
980
1444
|
randomUUID
|
|
@@ -1004,6 +1468,116 @@ function v4(options, buf, offset) {
|
|
|
1004
1468
|
return unsafeStringify(rnds);
|
|
1005
1469
|
}
|
|
1006
1470
|
|
|
1471
|
+
// Adapted from Chris Veness' SHA1 code at
|
|
1472
|
+
// http://www.movable-type.co.uk/scripts/sha1.html
|
|
1473
|
+
function f(s, x, y, z) {
|
|
1474
|
+
switch (s) {
|
|
1475
|
+
case 0:
|
|
1476
|
+
return x & y ^ ~x & z;
|
|
1477
|
+
|
|
1478
|
+
case 1:
|
|
1479
|
+
return x ^ y ^ z;
|
|
1480
|
+
|
|
1481
|
+
case 2:
|
|
1482
|
+
return x & y ^ x & z ^ y & z;
|
|
1483
|
+
|
|
1484
|
+
case 3:
|
|
1485
|
+
return x ^ y ^ z;
|
|
1486
|
+
}
|
|
1487
|
+
}
|
|
1488
|
+
|
|
1489
|
+
function ROTL(x, n) {
|
|
1490
|
+
return x << n | x >>> 32 - n;
|
|
1491
|
+
}
|
|
1492
|
+
|
|
1493
|
+
function sha1(bytes) {
|
|
1494
|
+
const K = [0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6];
|
|
1495
|
+
const H = [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0];
|
|
1496
|
+
|
|
1497
|
+
if (typeof bytes === 'string') {
|
|
1498
|
+
const msg = unescape(encodeURIComponent(bytes)); // UTF8 escape
|
|
1499
|
+
|
|
1500
|
+
bytes = [];
|
|
1501
|
+
|
|
1502
|
+
for (let i = 0; i < msg.length; ++i) {
|
|
1503
|
+
bytes.push(msg.charCodeAt(i));
|
|
1504
|
+
}
|
|
1505
|
+
} else if (!Array.isArray(bytes)) {
|
|
1506
|
+
// Convert Array-like to Array
|
|
1507
|
+
bytes = Array.prototype.slice.call(bytes);
|
|
1508
|
+
}
|
|
1509
|
+
|
|
1510
|
+
bytes.push(0x80);
|
|
1511
|
+
const l = bytes.length / 4 + 2;
|
|
1512
|
+
const N = Math.ceil(l / 16);
|
|
1513
|
+
const M = new Array(N);
|
|
1514
|
+
|
|
1515
|
+
for (let i = 0; i < N; ++i) {
|
|
1516
|
+
const arr = new Uint32Array(16);
|
|
1517
|
+
|
|
1518
|
+
for (let j = 0; j < 16; ++j) {
|
|
1519
|
+
arr[j] = bytes[i * 64 + j * 4] << 24 | bytes[i * 64 + j * 4 + 1] << 16 | bytes[i * 64 + j * 4 + 2] << 8 | bytes[i * 64 + j * 4 + 3];
|
|
1520
|
+
}
|
|
1521
|
+
|
|
1522
|
+
M[i] = arr;
|
|
1523
|
+
}
|
|
1524
|
+
|
|
1525
|
+
M[N - 1][14] = (bytes.length - 1) * 8 / Math.pow(2, 32);
|
|
1526
|
+
M[N - 1][14] = Math.floor(M[N - 1][14]);
|
|
1527
|
+
M[N - 1][15] = (bytes.length - 1) * 8 & 0xffffffff;
|
|
1528
|
+
|
|
1529
|
+
for (let i = 0; i < N; ++i) {
|
|
1530
|
+
const W = new Uint32Array(80);
|
|
1531
|
+
|
|
1532
|
+
for (let t = 0; t < 16; ++t) {
|
|
1533
|
+
W[t] = M[i][t];
|
|
1534
|
+
}
|
|
1535
|
+
|
|
1536
|
+
for (let t = 16; t < 80; ++t) {
|
|
1537
|
+
W[t] = ROTL(W[t - 3] ^ W[t - 8] ^ W[t - 14] ^ W[t - 16], 1);
|
|
1538
|
+
}
|
|
1539
|
+
|
|
1540
|
+
let a = H[0];
|
|
1541
|
+
let b = H[1];
|
|
1542
|
+
let c = H[2];
|
|
1543
|
+
let d = H[3];
|
|
1544
|
+
let e = H[4];
|
|
1545
|
+
|
|
1546
|
+
for (let t = 0; t < 80; ++t) {
|
|
1547
|
+
const s = Math.floor(t / 20);
|
|
1548
|
+
const T = ROTL(a, 5) + f(s, b, c, d) + e + K[s] + W[t] >>> 0;
|
|
1549
|
+
e = d;
|
|
1550
|
+
d = c;
|
|
1551
|
+
c = ROTL(b, 30) >>> 0;
|
|
1552
|
+
b = a;
|
|
1553
|
+
a = T;
|
|
1554
|
+
}
|
|
1555
|
+
|
|
1556
|
+
H[0] = H[0] + a >>> 0;
|
|
1557
|
+
H[1] = H[1] + b >>> 0;
|
|
1558
|
+
H[2] = H[2] + c >>> 0;
|
|
1559
|
+
H[3] = H[3] + d >>> 0;
|
|
1560
|
+
H[4] = H[4] + e >>> 0;
|
|
1561
|
+
}
|
|
1562
|
+
|
|
1563
|
+
return [H[0] >> 24 & 0xff, H[0] >> 16 & 0xff, H[0] >> 8 & 0xff, H[0] & 0xff, H[1] >> 24 & 0xff, H[1] >> 16 & 0xff, H[1] >> 8 & 0xff, H[1] & 0xff, H[2] >> 24 & 0xff, H[2] >> 16 & 0xff, H[2] >> 8 & 0xff, H[2] & 0xff, H[3] >> 24 & 0xff, H[3] >> 16 & 0xff, H[3] >> 8 & 0xff, H[3] & 0xff, H[4] >> 24 & 0xff, H[4] >> 16 & 0xff, H[4] >> 8 & 0xff, H[4] & 0xff];
|
|
1564
|
+
}
|
|
1565
|
+
|
|
1566
|
+
const v5 = v35('v5', 0x50, sha1);
|
|
1567
|
+
|
|
1568
|
+
const nil = '00000000-0000-0000-0000-000000000000';
|
|
1569
|
+
|
|
1570
|
+
function version(uuid) {
|
|
1571
|
+
if (!validate(uuid)) {
|
|
1572
|
+
throw TypeError('Invalid UUID');
|
|
1573
|
+
}
|
|
1574
|
+
|
|
1575
|
+
return parseInt(uuid.slice(14, 15), 16);
|
|
1576
|
+
}
|
|
1577
|
+
|
|
1578
|
+
const format = (appId) => {
|
|
1579
|
+
return appId || '';
|
|
1580
|
+
};
|
|
1007
1581
|
class Logger {
|
|
1008
1582
|
constructor(environment) {
|
|
1009
1583
|
this.log = (...args) => {
|
|
@@ -1061,15 +1635,17 @@ function appendToParams(url, getParamsToUpdate) {
|
|
|
1061
1635
|
}
|
|
1062
1636
|
|
|
1063
1637
|
const Logo = ({ className = '', color = '#7263FA' }) => {
|
|
1064
|
-
return (h("svg", { class: className, xmlns:
|
|
1065
|
-
h("
|
|
1066
|
-
h("path", { d: 'M128 185h57v57h-57zM128 14h57v57h-57zM71 185h57v57H71zM71 14h57v57H71zM14 71h57v57H14zM185 71h57v57h-57zM71 14v57H14l57-57ZM14 128h57v57H14zM185 128h57v57h-57zM14 185h57v57l-57-57ZM185 14l57 57h-57V14Z' })),
|
|
1067
|
-
h("defs", null,
|
|
1068
|
-
h("clipPath", { id: 'a' },
|
|
1069
|
-
h("path", { fill: '#fff', d: 'M14 14h228v228H14z' })))));
|
|
1638
|
+
return (h("svg", { class: className, xmlns: "http://www.w3.org/2000/svg", viewBox: '0 0 256 256', fill: "none" },
|
|
1639
|
+
h("path", { fill: color, d: "M128 185h57v57h-57v-57ZM128 14h57v57h-57V14ZM71 185h57v57H71v-57ZM71 14h57v57H71V14ZM14 71h57v57H14V71ZM185 71h57v57h-57V71ZM71 14v57H14l57-57ZM14 128h57v57H14v-57ZM185 128h57v57h-57v-57ZM14 185h57v57l-57-57ZM185 14l57 57h-57V14Z" })));
|
|
1070
1640
|
};
|
|
1071
1641
|
|
|
1642
|
+
const maxRetries = 30;
|
|
1072
1643
|
const send = (url, opts, request, errorCount) => {
|
|
1644
|
+
if (errorCount >= maxRetries) {
|
|
1645
|
+
request.abort();
|
|
1646
|
+
request = null;
|
|
1647
|
+
return;
|
|
1648
|
+
}
|
|
1073
1649
|
let limit = errorCount
|
|
1074
1650
|
? Math.pow(2, errorCount - 1) * opts.startLimit
|
|
1075
1651
|
: 0;
|
|
@@ -1085,7 +1661,8 @@ const send = (url, opts, request, errorCount) => {
|
|
|
1085
1661
|
request.send();
|
|
1086
1662
|
}, pause);
|
|
1087
1663
|
};
|
|
1088
|
-
const xhr = (url, opts
|
|
1664
|
+
const xhr = (url, opts, callback) => {
|
|
1665
|
+
opts = Object.assign({ startLimit: 100, maxLimit: 3 * 1000, enableWithCredentials: false }, opts);
|
|
1089
1666
|
let errorCount = 0;
|
|
1090
1667
|
const request = new XMLHttpRequest();
|
|
1091
1668
|
if (opts.enableWithCredentials)
|
|
@@ -1285,11 +1862,9 @@ const maxInterval = 59 * 60 * 1000;
|
|
|
1285
1862
|
const minInterval = 10 * 1000;
|
|
1286
1863
|
const DEFAULT_CALLBACK_URL = window.location.origin + '/zero/auth';
|
|
1287
1864
|
const ANIMATION_DURATION = 3000;
|
|
1288
|
-
const ZeroAccount
|
|
1289
|
-
constructor() {
|
|
1290
|
-
|
|
1291
|
-
this.__registerHost();
|
|
1292
|
-
this.__attachShadow();
|
|
1865
|
+
const ZeroAccount = class {
|
|
1866
|
+
constructor(hostRef) {
|
|
1867
|
+
registerInstance(this, hostRef);
|
|
1293
1868
|
this.refreshQR = (ignoreAnimate = false) => {
|
|
1294
1869
|
const update = () => {
|
|
1295
1870
|
this.restartTimer();
|
|
@@ -1410,46 +1985,10 @@ const ZeroAccount$1 = /*@__PURE__*/ proxyCustomElement(class ZeroAccount extends
|
|
|
1410
1985
|
window.clearTimeout(this.animationTimer);
|
|
1411
1986
|
this.isAnimating = false;
|
|
1412
1987
|
}
|
|
1413
|
-
get host() { return this; }
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
"appId": [1, "app-id"],
|
|
1417
|
-
"updateInterval": [2, "update-interval"],
|
|
1418
|
-
"callbackURL": [1, "callback-url"],
|
|
1419
|
-
"modal": [4],
|
|
1420
|
-
"level": [1],
|
|
1421
|
-
"primaryColor": [1, "primary-color"],
|
|
1422
|
-
"secondaryColor": [1, "secondary-color"],
|
|
1423
|
-
"environment": [1],
|
|
1424
|
-
"enableWithCredentials": [4, "enable-with-credentials"],
|
|
1425
|
-
"themePreset": [1, "theme-preset"],
|
|
1426
|
-
"autoStartApp": [4, "auto-start-app"],
|
|
1427
|
-
"modalOpen": [32],
|
|
1428
|
-
"isAnimating": [32],
|
|
1429
|
-
"url": [32]
|
|
1430
|
-
}, [[4, "0account-toggle-modal", "toggleModal"], [4, "0account-close-modal", "_closeModal"], [4, "0account-authenticated", "_closeModal"], [4, "0account-open-app", "openApp"]]]);
|
|
1431
|
-
function defineCustomElement$1() {
|
|
1432
|
-
if (typeof customElements === "undefined") {
|
|
1433
|
-
return;
|
|
1434
|
-
}
|
|
1435
|
-
const components = ["zero-account", "qr-code"];
|
|
1436
|
-
components.forEach(tagName => { switch (tagName) {
|
|
1437
|
-
case "zero-account":
|
|
1438
|
-
if (!customElements.get(tagName)) {
|
|
1439
|
-
customElements.define(tagName, ZeroAccount$1);
|
|
1440
|
-
}
|
|
1441
|
-
break;
|
|
1442
|
-
case "qr-code":
|
|
1443
|
-
if (!customElements.get(tagName)) {
|
|
1444
|
-
defineCustomElement$2();
|
|
1445
|
-
}
|
|
1446
|
-
break;
|
|
1447
|
-
} });
|
|
1448
|
-
}
|
|
1449
|
-
|
|
1450
|
-
const ZeroAccount = ZeroAccount$1;
|
|
1451
|
-
const defineCustomElement = defineCustomElement$1;
|
|
1988
|
+
get host() { return getElement(this); }
|
|
1989
|
+
};
|
|
1990
|
+
ZeroAccount.style = zeroAccountCss;
|
|
1452
1991
|
|
|
1453
|
-
export { ZeroAccount
|
|
1992
|
+
export { ZeroAccount as zero_account };
|
|
1454
1993
|
|
|
1455
|
-
//# sourceMappingURL=zero-account.js.map
|
|
1994
|
+
//# sourceMappingURL=zero-account.entry.js.map
|