@peculiar/certificates-viewer 3.0.4 → 3.2.0

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.
Files changed (74) hide show
  1. package/dist/cjs/{certification_request-43396146.js → certification_request-cde57123.js} +138 -266
  2. package/dist/cjs/csr-78378ed0.js +150 -0
  3. package/dist/cjs/download-6724f3a7.js +79 -0
  4. package/dist/cjs/{download-5e7d5455.js → index-ff818d4d.js} +0 -72
  5. package/dist/cjs/index.cjs.js +2 -1
  6. package/dist/cjs/l10n-a048a686.js +145 -0
  7. package/dist/cjs/loader.cjs.js +1 -1
  8. package/dist/cjs/peculiar-attribute-certificate-viewer_2.cjs.entry.js +479 -0
  9. package/dist/cjs/peculiar-button_5.cjs.entry.js +148 -0
  10. package/dist/cjs/peculiar-certificate-decoder.cjs.entry.js +173 -0
  11. package/dist/cjs/peculiar-certificate-summary_3.cjs.entry.js +1 -1
  12. package/dist/cjs/peculiar-certificate-viewer.cjs.entry.js +124 -0
  13. package/dist/cjs/peculiar-certificates-viewer.cjs.entry.js +6 -4
  14. package/dist/cjs/peculiar.cjs.js +1 -1
  15. package/dist/cjs/public_key-e56dbe52.js +1104 -0
  16. package/dist/cjs/x509_attribute_certificate-cc325b70.js +87 -0
  17. package/dist/cjs/x509_certificate-51a97033.js +139 -0
  18. package/dist/collection/components/certificate-decoder/certificate-decoder.js +54 -11
  19. package/dist/collection/constants/oids.js +1 -0
  20. package/dist/collection/utils/index.js +0 -1
  21. package/dist/collection/www-copy/index.js +80 -0
  22. package/dist/esm/{certification_request-16ea346c.js → certification_request-c0674647.js} +77 -205
  23. package/dist/esm/csr-c1b6a176.js +147 -0
  24. package/dist/esm/download-735fb2eb.js +76 -0
  25. package/dist/esm/{download-cf68ac2c.js → index-0ba131b0.js} +1 -71
  26. package/dist/esm/index.js +2 -1
  27. package/dist/esm/l10n-ac28fa92.js +141 -0
  28. package/dist/esm/loader.js +1 -1
  29. package/dist/esm/peculiar-attribute-certificate-viewer_2.entry.js +474 -0
  30. package/dist/esm/peculiar-button_5.entry.js +140 -0
  31. package/dist/esm/peculiar-certificate-decoder.entry.js +169 -0
  32. package/dist/esm/peculiar-certificate-summary_3.entry.js +1 -1
  33. package/dist/esm/peculiar-certificate-viewer.entry.js +120 -0
  34. package/dist/esm/peculiar-certificates-viewer.entry.js +5 -3
  35. package/dist/esm/peculiar.js +1 -1
  36. package/dist/esm/public_key-43b2cbf0.js +1089 -0
  37. package/dist/esm/x509_attribute_certificate-a6d4aa15.js +85 -0
  38. package/dist/esm/x509_certificate-12f6d344.js +137 -0
  39. package/dist/peculiar/index.esm.js +1 -1
  40. package/dist/peculiar/p-006865d7.js +4 -0
  41. package/dist/peculiar/p-17c4da7b.js +11 -0
  42. package/dist/peculiar/p-1ebab45c.js +78 -0
  43. package/dist/peculiar/{p-b09a1f0b.entry.js → p-38635919.entry.js} +1 -1
  44. package/dist/peculiar/p-3f8d1008.entry.js +4 -0
  45. package/dist/peculiar/p-42da7f97.js +11 -0
  46. package/dist/peculiar/p-464e0943.js +87 -0
  47. package/dist/peculiar/p-4f4c1d30.js +12 -0
  48. package/dist/peculiar/p-530afe84.entry.js +11 -0
  49. package/dist/peculiar/p-6011646e.entry.js +11 -0
  50. package/dist/peculiar/p-6c510523.js +18 -0
  51. package/dist/peculiar/p-d7a13cb4.js +18 -0
  52. package/dist/peculiar/p-dafae164.entry.js +4 -0
  53. package/dist/peculiar/p-e77d0ccc.entry.js +18 -0
  54. package/dist/peculiar/peculiar.esm.js +1 -1
  55. package/dist/types/components/certificate-decoder/certificate-decoder.d.ts +13 -0
  56. package/dist/types/components.d.ts +20 -0
  57. package/dist/types/constants/oids.d.ts +1 -0
  58. package/dist/types/utils/index.d.ts +0 -1
  59. package/package.json +2 -3
  60. package/dist/cjs/l10n-d4a77087.js +0 -767
  61. package/dist/cjs/peculiar-attribute-certificate-viewer_9.cjs.entry.js +0 -2175
  62. package/dist/collection/utils/history.js +0 -19
  63. package/dist/collection/utils/parse_hash.js +0 -28
  64. package/dist/collection/utils/query_stringify.js +0 -21
  65. package/dist/esm/l10n-9ac63748.js +0 -762
  66. package/dist/esm/peculiar-attribute-certificate-viewer_9.entry.js +0 -2163
  67. package/dist/peculiar/p-7452b86e.entry.js +0 -4
  68. package/dist/peculiar/p-99797a49.js +0 -34
  69. package/dist/peculiar/p-c774ec0b.js +0 -18
  70. package/dist/peculiar/p-d0db9e70.entry.js +0 -113
  71. package/dist/peculiar/p-d7ed39f0.js +0 -87
  72. package/dist/types/utils/history.d.ts +0 -9
  73. package/dist/types/utils/parse_hash.d.ts +0 -9
  74. package/dist/types/utils/query_stringify.d.ts +0 -8
@@ -1,767 +0,0 @@
1
- /*!
2
- * © Peculiar Ventures https://peculiarventures.com/ - MIT License
3
- */
4
- 'use strict';
5
-
6
- const _commonjsHelpers = require('./_commonjsHelpers-cb1f949a.js');
7
-
8
- function _extends() {
9
- _extends = Object.assign || function (target) {
10
- for (var i = 1; i < arguments.length; i++) {
11
- var source = arguments[i];
12
-
13
- for (var key in source) {
14
- if (Object.prototype.hasOwnProperty.call(source, key)) {
15
- target[key] = source[key];
16
- }
17
- }
18
- }
19
-
20
- return target;
21
- };
22
-
23
- return _extends.apply(this, arguments);
24
- }
25
-
26
- function isAbsolute(pathname) {
27
- return pathname.charAt(0) === '/';
28
- }
29
-
30
- // About 1.5x faster than the two-arg version of Array#splice()
31
- function spliceOne(list, index) {
32
- for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1) {
33
- list[i] = list[k];
34
- }
35
-
36
- list.pop();
37
- }
38
-
39
- // This implementation is based heavily on node's url.parse
40
- function resolvePathname(to, from) {
41
- if (from === undefined) from = '';
42
-
43
- var toParts = (to && to.split('/')) || [];
44
- var fromParts = (from && from.split('/')) || [];
45
-
46
- var isToAbs = to && isAbsolute(to);
47
- var isFromAbs = from && isAbsolute(from);
48
- var mustEndAbs = isToAbs || isFromAbs;
49
-
50
- if (to && isAbsolute(to)) {
51
- // to is absolute
52
- fromParts = toParts;
53
- } else if (toParts.length) {
54
- // to is relative, drop the filename
55
- fromParts.pop();
56
- fromParts = fromParts.concat(toParts);
57
- }
58
-
59
- if (!fromParts.length) return '/';
60
-
61
- var hasTrailingSlash;
62
- if (fromParts.length) {
63
- var last = fromParts[fromParts.length - 1];
64
- hasTrailingSlash = last === '.' || last === '..' || last === '';
65
- } else {
66
- hasTrailingSlash = false;
67
- }
68
-
69
- var up = 0;
70
- for (var i = fromParts.length; i >= 0; i--) {
71
- var part = fromParts[i];
72
-
73
- if (part === '.') {
74
- spliceOne(fromParts, i);
75
- } else if (part === '..') {
76
- spliceOne(fromParts, i);
77
- up++;
78
- } else if (up) {
79
- spliceOne(fromParts, i);
80
- up--;
81
- }
82
- }
83
-
84
- if (!mustEndAbs) for (; up--; up) fromParts.unshift('..');
85
-
86
- if (
87
- mustEndAbs &&
88
- fromParts[0] !== '' &&
89
- (!fromParts[0] || !isAbsolute(fromParts[0]))
90
- )
91
- fromParts.unshift('');
92
-
93
- var result = fromParts.join('/');
94
-
95
- if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';
96
-
97
- return result;
98
- }
99
-
100
- var prefix = 'Invariant failed';
101
- function invariant(condition, message) {
102
- if (condition) {
103
- return;
104
- }
105
- {
106
- throw new Error(prefix);
107
- }
108
- }
109
-
110
- function addLeadingSlash(path) {
111
- return path.charAt(0) === '/' ? path : '/' + path;
112
- }
113
- function hasBasename(path, prefix) {
114
- return path.toLowerCase().indexOf(prefix.toLowerCase()) === 0 && '/?#'.indexOf(path.charAt(prefix.length)) !== -1;
115
- }
116
- function stripBasename(path, prefix) {
117
- return hasBasename(path, prefix) ? path.substr(prefix.length) : path;
118
- }
119
- function stripTrailingSlash(path) {
120
- return path.charAt(path.length - 1) === '/' ? path.slice(0, -1) : path;
121
- }
122
- function parsePath(path) {
123
- var pathname = path || '/';
124
- var search = '';
125
- var hash = '';
126
- var hashIndex = pathname.indexOf('#');
127
-
128
- if (hashIndex !== -1) {
129
- hash = pathname.substr(hashIndex);
130
- pathname = pathname.substr(0, hashIndex);
131
- }
132
-
133
- var searchIndex = pathname.indexOf('?');
134
-
135
- if (searchIndex !== -1) {
136
- search = pathname.substr(searchIndex);
137
- pathname = pathname.substr(0, searchIndex);
138
- }
139
-
140
- return {
141
- pathname: pathname,
142
- search: search === '?' ? '' : search,
143
- hash: hash === '#' ? '' : hash
144
- };
145
- }
146
- function createPath(location) {
147
- var pathname = location.pathname,
148
- search = location.search,
149
- hash = location.hash;
150
- var path = pathname || '/';
151
- if (search && search !== '?') path += search.charAt(0) === '?' ? search : "?" + search;
152
- if (hash && hash !== '#') path += hash.charAt(0) === '#' ? hash : "#" + hash;
153
- return path;
154
- }
155
-
156
- function createLocation(path, state, key, currentLocation) {
157
- var location;
158
-
159
- if (typeof path === 'string') {
160
- // Two-arg form: push(path, state)
161
- location = parsePath(path);
162
- location.state = state;
163
- } else {
164
- // One-arg form: push(location)
165
- location = _extends({}, path);
166
- if (location.pathname === undefined) location.pathname = '';
167
-
168
- if (location.search) {
169
- if (location.search.charAt(0) !== '?') location.search = '?' + location.search;
170
- } else {
171
- location.search = '';
172
- }
173
-
174
- if (location.hash) {
175
- if (location.hash.charAt(0) !== '#') location.hash = '#' + location.hash;
176
- } else {
177
- location.hash = '';
178
- }
179
-
180
- if (state !== undefined && location.state === undefined) location.state = state;
181
- }
182
-
183
- try {
184
- location.pathname = decodeURI(location.pathname);
185
- } catch (e) {
186
- if (e instanceof URIError) {
187
- throw new URIError('Pathname "' + location.pathname + '" could not be decoded. ' + 'This is likely caused by an invalid percent-encoding.');
188
- } else {
189
- throw e;
190
- }
191
- }
192
-
193
- if (key) location.key = key;
194
-
195
- if (currentLocation) {
196
- // Resolve incomplete/relative pathname relative to current location.
197
- if (!location.pathname) {
198
- location.pathname = currentLocation.pathname;
199
- } else if (location.pathname.charAt(0) !== '/') {
200
- location.pathname = resolvePathname(location.pathname, currentLocation.pathname);
201
- }
202
- } else {
203
- // When there is no prior location and pathname is empty, set it to /
204
- if (!location.pathname) {
205
- location.pathname = '/';
206
- }
207
- }
208
-
209
- return location;
210
- }
211
-
212
- function createTransitionManager() {
213
- var prompt = null;
214
-
215
- function setPrompt(nextPrompt) {
216
- prompt = nextPrompt;
217
- return function () {
218
- if (prompt === nextPrompt) prompt = null;
219
- };
220
- }
221
-
222
- function confirmTransitionTo(location, action, getUserConfirmation, callback) {
223
- // TODO: If another transition starts while we're still confirming
224
- // the previous one, we may end up in a weird state. Figure out the
225
- // best way to handle this.
226
- if (prompt != null) {
227
- var result = typeof prompt === 'function' ? prompt(location, action) : prompt;
228
-
229
- if (typeof result === 'string') {
230
- if (typeof getUserConfirmation === 'function') {
231
- getUserConfirmation(result, callback);
232
- } else {
233
- callback(true);
234
- }
235
- } else {
236
- // Return false from a transition hook to cancel the transition.
237
- callback(result !== false);
238
- }
239
- } else {
240
- callback(true);
241
- }
242
- }
243
-
244
- var listeners = [];
245
-
246
- function appendListener(fn) {
247
- var isActive = true;
248
-
249
- function listener() {
250
- if (isActive) fn.apply(void 0, arguments);
251
- }
252
-
253
- listeners.push(listener);
254
- return function () {
255
- isActive = false;
256
- listeners = listeners.filter(function (item) {
257
- return item !== listener;
258
- });
259
- };
260
- }
261
-
262
- function notifyListeners() {
263
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
264
- args[_key] = arguments[_key];
265
- }
266
-
267
- listeners.forEach(function (listener) {
268
- return listener.apply(void 0, args);
269
- });
270
- }
271
-
272
- return {
273
- setPrompt: setPrompt,
274
- confirmTransitionTo: confirmTransitionTo,
275
- appendListener: appendListener,
276
- notifyListeners: notifyListeners
277
- };
278
- }
279
-
280
- var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
281
- function getConfirmation(message, callback) {
282
- callback(window.confirm(message)); // eslint-disable-line no-alert
283
- }
284
- /**
285
- * Returns true if the HTML5 history API is supported. Taken from Modernizr.
286
- *
287
- * https://github.com/Modernizr/Modernizr/blob/master/LICENSE
288
- * https://github.com/Modernizr/Modernizr/blob/master/feature-detects/history.js
289
- * changed to avoid false negatives for Windows Phones: https://github.com/reactjs/react-router/issues/586
290
- */
291
-
292
- function supportsHistory() {
293
- var ua = window.navigator.userAgent;
294
- if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) return false;
295
- return window.history && 'pushState' in window.history;
296
- }
297
- /**
298
- * Returns true if browser fires popstate on hash change.
299
- * IE10 and IE11 do not.
300
- */
301
-
302
- function supportsPopStateOnHashChange() {
303
- return window.navigator.userAgent.indexOf('Trident') === -1;
304
- }
305
- /**
306
- * Returns true if a given popstate event is an extraneous WebKit event.
307
- * Accounts for the fact that Chrome on iOS fires real popstate events
308
- * containing undefined state when pressing the back button.
309
- */
310
-
311
- function isExtraneousPopstateEvent(event) {
312
- return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;
313
- }
314
-
315
- var PopStateEvent = 'popstate';
316
- var HashChangeEvent = 'hashchange';
317
-
318
- function getHistoryState() {
319
- try {
320
- return window.history.state || {};
321
- } catch (e) {
322
- // IE 11 sometimes throws when accessing window.history.state
323
- // See https://github.com/ReactTraining/history/pull/289
324
- return {};
325
- }
326
- }
327
- /**
328
- * Creates a history object that uses the HTML5 history API including
329
- * pushState, replaceState, and the popstate event.
330
- */
331
-
332
-
333
- function createBrowserHistory(props) {
334
- if (props === void 0) {
335
- props = {};
336
- }
337
-
338
- !canUseDOM ? invariant(false) : void 0;
339
- var globalHistory = window.history;
340
- var canUseHistory = supportsHistory();
341
- var needsHashChangeListener = !supportsPopStateOnHashChange();
342
- var _props = props,
343
- _props$forceRefresh = _props.forceRefresh,
344
- forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,
345
- _props$getUserConfirm = _props.getUserConfirmation,
346
- getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,
347
- _props$keyLength = _props.keyLength,
348
- keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;
349
- var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';
350
-
351
- function getDOMLocation(historyState) {
352
- var _ref = historyState || {},
353
- key = _ref.key,
354
- state = _ref.state;
355
-
356
- var _window$location = window.location,
357
- pathname = _window$location.pathname,
358
- search = _window$location.search,
359
- hash = _window$location.hash;
360
- var path = pathname + search + hash;
361
- if (basename) path = stripBasename(path, basename);
362
- return createLocation(path, state, key);
363
- }
364
-
365
- function createKey() {
366
- return Math.random().toString(36).substr(2, keyLength);
367
- }
368
-
369
- var transitionManager = createTransitionManager();
370
-
371
- function setState(nextState) {
372
- _extends(history, nextState);
373
-
374
- history.length = globalHistory.length;
375
- transitionManager.notifyListeners(history.location, history.action);
376
- }
377
-
378
- function handlePopState(event) {
379
- // Ignore extraneous popstate events in WebKit.
380
- if (isExtraneousPopstateEvent(event)) return;
381
- handlePop(getDOMLocation(event.state));
382
- }
383
-
384
- function handleHashChange() {
385
- handlePop(getDOMLocation(getHistoryState()));
386
- }
387
-
388
- var forceNextPop = false;
389
-
390
- function handlePop(location) {
391
- if (forceNextPop) {
392
- forceNextPop = false;
393
- setState();
394
- } else {
395
- var action = 'POP';
396
- transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
397
- if (ok) {
398
- setState({
399
- action: action,
400
- location: location
401
- });
402
- } else {
403
- revertPop(location);
404
- }
405
- });
406
- }
407
- }
408
-
409
- function revertPop(fromLocation) {
410
- var toLocation = history.location; // TODO: We could probably make this more reliable by
411
- // keeping a list of keys we've seen in sessionStorage.
412
- // Instead, we just default to 0 for keys we don't know.
413
-
414
- var toIndex = allKeys.indexOf(toLocation.key);
415
- if (toIndex === -1) toIndex = 0;
416
- var fromIndex = allKeys.indexOf(fromLocation.key);
417
- if (fromIndex === -1) fromIndex = 0;
418
- var delta = toIndex - fromIndex;
419
-
420
- if (delta) {
421
- forceNextPop = true;
422
- go(delta);
423
- }
424
- }
425
-
426
- var initialLocation = getDOMLocation(getHistoryState());
427
- var allKeys = [initialLocation.key]; // Public interface
428
-
429
- function createHref(location) {
430
- return basename + createPath(location);
431
- }
432
-
433
- function push(path, state) {
434
- var action = 'PUSH';
435
- var location = createLocation(path, state, createKey(), history.location);
436
- transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
437
- if (!ok) return;
438
- var href = createHref(location);
439
- var key = location.key,
440
- state = location.state;
441
-
442
- if (canUseHistory) {
443
- globalHistory.pushState({
444
- key: key,
445
- state: state
446
- }, null, href);
447
-
448
- if (forceRefresh) {
449
- window.location.href = href;
450
- } else {
451
- var prevIndex = allKeys.indexOf(history.location.key);
452
- var nextKeys = allKeys.slice(0, prevIndex + 1);
453
- nextKeys.push(location.key);
454
- allKeys = nextKeys;
455
- setState({
456
- action: action,
457
- location: location
458
- });
459
- }
460
- } else {
461
- window.location.href = href;
462
- }
463
- });
464
- }
465
-
466
- function replace(path, state) {
467
- var action = 'REPLACE';
468
- var location = createLocation(path, state, createKey(), history.location);
469
- transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
470
- if (!ok) return;
471
- var href = createHref(location);
472
- var key = location.key,
473
- state = location.state;
474
-
475
- if (canUseHistory) {
476
- globalHistory.replaceState({
477
- key: key,
478
- state: state
479
- }, null, href);
480
-
481
- if (forceRefresh) {
482
- window.location.replace(href);
483
- } else {
484
- var prevIndex = allKeys.indexOf(history.location.key);
485
- if (prevIndex !== -1) allKeys[prevIndex] = location.key;
486
- setState({
487
- action: action,
488
- location: location
489
- });
490
- }
491
- } else {
492
- window.location.replace(href);
493
- }
494
- });
495
- }
496
-
497
- function go(n) {
498
- globalHistory.go(n);
499
- }
500
-
501
- function goBack() {
502
- go(-1);
503
- }
504
-
505
- function goForward() {
506
- go(1);
507
- }
508
-
509
- var listenerCount = 0;
510
-
511
- function checkDOMListeners(delta) {
512
- listenerCount += delta;
513
-
514
- if (listenerCount === 1 && delta === 1) {
515
- window.addEventListener(PopStateEvent, handlePopState);
516
- if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);
517
- } else if (listenerCount === 0) {
518
- window.removeEventListener(PopStateEvent, handlePopState);
519
- if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);
520
- }
521
- }
522
-
523
- var isBlocked = false;
524
-
525
- function block(prompt) {
526
- if (prompt === void 0) {
527
- prompt = false;
528
- }
529
-
530
- var unblock = transitionManager.setPrompt(prompt);
531
-
532
- if (!isBlocked) {
533
- checkDOMListeners(1);
534
- isBlocked = true;
535
- }
536
-
537
- return function () {
538
- if (isBlocked) {
539
- isBlocked = false;
540
- checkDOMListeners(-1);
541
- }
542
-
543
- return unblock();
544
- };
545
- }
546
-
547
- function listen(listener) {
548
- var unlisten = transitionManager.appendListener(listener);
549
- checkDOMListeners(1);
550
- return function () {
551
- checkDOMListeners(-1);
552
- unlisten();
553
- };
554
- }
555
-
556
- var history = {
557
- length: globalHistory.length,
558
- action: 'POP',
559
- location: initialLocation,
560
- createHref: createHref,
561
- push: push,
562
- replace: replace,
563
- go: go,
564
- goBack: goBack,
565
- goForward: goForward,
566
- block: block,
567
- listen: listen
568
- };
569
- return history;
570
- }
571
-
572
- /**
573
- * @license
574
- * Copyright (c) Peculiar Ventures, LLC.
575
- *
576
- * This source code is licensed under the MIT license found in the
577
- * LICENSE file in the root directory of this source tree.
578
- */
579
- function parseHash(hash = window.location.hash) {
580
- if (!hash.length) {
581
- return {};
582
- }
583
- const pairs = hash.replace(/^(#|\?)?\/?/, '').split('&');
584
- const result = {};
585
- for (let i = 0; i < pairs.length; i += 1) {
586
- const pair = pairs[i].split('=');
587
- try {
588
- result[pair[0]] = pair[1] && decodeURIComponent(pair[1]);
589
- }
590
- catch (error) {
591
- console.warn(error);
592
- }
593
- }
594
- return result;
595
- }
596
-
597
- /**
598
- * @license
599
- * Copyright (c) Peculiar Ventures, LLC.
600
- *
601
- * This source code is licensed under the MIT license found in the
602
- * LICENSE file in the root directory of this source tree.
603
- */
604
- function queryStringify(options) {
605
- const parameters = [];
606
- Object.keys(options).forEach((o) => {
607
- if (typeof options[o] === 'string'
608
- || typeof options[o] === 'boolean'
609
- || typeof options[o] === 'number') {
610
- parameters.push(`${o}=${encodeURIComponent(options[o])}`);
611
- }
612
- });
613
- return parameters.join('&');
614
- }
615
-
616
- /**
617
- * @license
618
- * Copyright (c) Peculiar Ventures, LLC.
619
- *
620
- * This source code is licensed under the MIT license found in the
621
- * LICENSE file in the root directory of this source tree.
622
- */
623
- const browserHistory = createBrowserHistory();
624
- const history = Object.assign(browserHistory, {
625
- parseHash,
626
- queryStringify,
627
- });
628
-
629
- var dayjs_min = _commonjsHelpers.createCommonjsModule(function (module, exports) {
630
- !function(t,e){module.exports=e();}(_commonjsHelpers.commonjsGlobal,(function(){var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",f="month",h="quarter",c="year",d="date",$="Invalid Date",l=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},m=function(t,e,n){var r=String(t);return !r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},g={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return (e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return -t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,f),s=n-i<0,u=e.clone().add(r+(s?-1:1),f);return +(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return {M:f,y:c,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:h}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},v="en",D={};D[v]=M;var p=function(t){return t instanceof _},S=function t(e,n,r){var i;if(!e)return v;if("string"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split("-");if(!i&&u.length>1)return t(u[0])}else {var a=e.name;D[a]=e,i=a;}return !r&&i&&(v=i),i||!r&&v},w=function(t,e){if(p(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},O=g;O.l=S,O.i=p,O.w=function(t,e){return w(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=S(t.locale,null,!0),this.parse(t);}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(O.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match(l);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.$x=t.x||{},this.init();},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds();},m.$utils=function(){return O},m.isValid=function(){return !(this.$d.toString()===$)},m.isSame=function(t,e){var n=w(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return w(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<w(t)},m.$g=function(t,e,n){return O.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!O.u(e)||e,h=O.p(t),$=function(t,e){var i=O.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},l=function(t,e){return O.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,g="set"+(this.$u?"UTC":"");switch(h){case c:return r?$(1,0):$(31,11);case f:return r?$(1,M):$(0,M+1);case o:var v=this.$locale().weekStart||0,D=(y<v?y+7:y)-v;return $(r?m-D:m+(6-D),M);case a:case d:return l(g+"Hours",0);case u:return l(g+"Minutes",1);case s:return l(g+"Seconds",2);case i:return l(g+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=O.p(t),h="set"+(this.$u?"UTC":""),$=(n={},n[a]=h+"Date",n[d]=h+"Date",n[f]=h+"Month",n[c]=h+"FullYear",n[u]=h+"Hours",n[s]=h+"Minutes",n[i]=h+"Seconds",n[r]=h+"Milliseconds",n)[o],l=o===a?this.$D+(e-this.$W):e;if(o===f||o===c){var y=this.clone().set(d,1);y.$d[$](l),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d;}else $&&this.$d[$](l);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[O.p(t)]()},m.add=function(r,h){var d,$=this;r=Number(r);var l=O.p(h),y=function(t){var e=w($);return O.w(e.date(e.date()+Math.round(t*r)),$)};if(l===f)return this.set(f,this.$M+r);if(l===c)return this.set(c,this.$y+r);if(l===a)return y(1);if(l===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[l]||1,m=this.$d.getTime()+r*M;return O.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||$;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=O.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,f=n.months,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},c=function(t){return O.s(s%12||12,t,"0")},d=n.meridiem||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r},l={YY:String(this.$y).slice(-2),YYYY:this.$y,M:a+1,MM:O.s(a+1,2,"0"),MMM:h(n.monthsShort,a,f,3),MMMM:h(f,a),D:this.$D,DD:O.s(this.$D,2,"0"),d:String(this.$W),dd:h(n.weekdaysMin,this.$W,o,2),ddd:h(n.weekdaysShort,this.$W,o,3),dddd:o[this.$W],H:String(s),HH:O.s(s,2,"0"),h:c(1),hh:c(2),a:d(s,u,!0),A:d(s,u,!1),m:String(u),mm:O.s(u,2,"0"),s:String(this.$s),ss:O.s(this.$s,2,"0"),SSS:O.s(this.$ms,3,"0"),Z:i};return r.replace(y,(function(t,e){return e||l[t]||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,$){var l,y=O.p(d),M=w(r),m=(M.utcOffset()-this.utcOffset())*e,g=this-M,v=O.m(this,M);return v=(l={},l[c]=v/12,l[f]=v,l[h]=v/3,l[o]=(g-m)/6048e5,l[a]=(g-m)/864e5,l[u]=g/n,l[s]=g/e,l[i]=g/t,l)[y]||g,$?v:O.a(v)},m.daysInMonth=function(){return this.endOf(f).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=S(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return O.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),T=_.prototype;return w.prototype=T,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",f],["$y",c],["$D",d]].forEach((function(t){T[t[1]]=function(e){return this.$g(e,t[0],t[1])};})),w.extend=function(t,e){return t.$i||(t(e,_,w),t.$i=!0),w},w.locale=S,w.isDayjs=p,w.unix=function(t){return w(1e3*t)},w.en=D[v],w.Ls=D,w.p={},w}));
631
- });
632
-
633
- var relativeTime = _commonjsHelpers.createCommonjsModule(function (module, exports) {
634
- !function(r,e){module.exports=e();}(_commonjsHelpers.commonjsGlobal,(function(){return function(r,e,t){r=r||{};var n=e.prototype,o={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function i(r,e,t,o){return n.fromToBase(r,e,t,o)}t.en.relativeTime=o,n.fromToBase=function(e,n,i,d,u){for(var f,a,s,l=i.$locale().relativeTime||o,h=r.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],m=h.length,c=0;c<m;c+=1){var y=h[c];y.d&&(f=d?t(e).diff(i,y.d,!0):i.diff(e,y.d,!0));var p=(r.rounding||Math.round)(Math.abs(f));if(s=f>0,p<=y.r||!y.r){p<=1&&c>0&&(y=h[c-1]);var v=l[y.l];u&&(p=u(""+p)),a="string"==typeof v?v.replace("%d",p):v(p,n,y.l,s);break}}if(n)return a;var M=s?l.future:l.past;return "function"==typeof M?M(a):M.replace("%s",a)},n.to=function(r,e){return i(r,e,this,!0)},n.from=function(r,e){return i(r,e,this)};var d=function(r){return r.$u?t.utc():t()};n.toNow=function(r){return this.to(d(this),r)},n.fromNow=function(r){return this.from(d(this),r)};}}));
635
- });
636
-
637
- /**
638
- * @license
639
- * Copyright (c) Peculiar Ventures, LLC.
640
- *
641
- * This source code is licensed under the MIT license found in the
642
- * LICENSE file in the root directory of this source tree.
643
- */
644
- dayjs_min.extend(relativeTime);
645
- const dateShort = (date) => (new Date(date).toUTCString());
646
- const dateDiff = (dateStart, dateEnd) => {
647
- if (!dateStart || !dateEnd) {
648
- return '';
649
- }
650
- const start = dayjs_min(dateStart);
651
- const end = dayjs_min(dateEnd);
652
- return start.to(end, true);
653
- };
654
-
655
- const basicInformation = "Basic Information";
656
- const subjectName = "Subject Name";
657
- const issuerName = "Issuer Name";
658
- const publicKeyInfo = "Public Key Info";
659
- const signature = "Signature";
660
- const extensions = "Extensions";
661
- const miscellaneous = "Miscellaneous";
662
- const download = "Download";
663
- const serialNumber = "Serial Number";
664
- const version = "Version";
665
- const validity = "Validity";
666
- const issued = "Issued";
667
- const expired = "Expired";
668
- const algorithm = "Algorithm";
669
- const namedCurve = "Named Curve";
670
- const exponent = "Exponent";
671
- const modulus = "Modulus";
672
- const value = "Value";
673
- const valid = "Valid";
674
- const revoked = "Revoked";
675
- const issuer = "Issuer";
676
- const name = "Name";
677
- const publicKey = "Public Key";
678
- const fingerprint = "Fingerprint";
679
- const fingerprints = "Fingerprints";
680
- const actions = "Actions";
681
- const details = "Details";
682
- const testURLs = "Test URLs";
683
- const certificateDetails = "Certificate Details";
684
- const holder = "Holder";
685
- const digestInfo = "Digest Info";
686
- const type = "Type";
687
- const en = {
688
- basicInformation: basicInformation,
689
- subjectName: subjectName,
690
- issuerName: issuerName,
691
- publicKeyInfo: publicKeyInfo,
692
- signature: signature,
693
- extensions: extensions,
694
- miscellaneous: miscellaneous,
695
- download: download,
696
- "download.pem": "Download PEM",
697
- "download.der": "Download DER",
698
- serialNumber: serialNumber,
699
- version: version,
700
- validity: validity,
701
- issued: issued,
702
- expired: expired,
703
- algorithm: algorithm,
704
- namedCurve: namedCurve,
705
- exponent: exponent,
706
- modulus: modulus,
707
- value: value,
708
- valid: valid,
709
- revoked: revoked,
710
- issuer: issuer,
711
- name: name,
712
- publicKey: publicKey,
713
- fingerprint: fingerprint,
714
- fingerprints: fingerprints,
715
- actions: actions,
716
- details: details,
717
- testURLs: testURLs,
718
- certificateDetails: certificateDetails,
719
- holder: holder,
720
- digestInfo: digestInfo,
721
- type: type
722
- };
723
-
724
- /**
725
- * @license
726
- * Copyright (c) Peculiar Ventures, LLC.
727
- *
728
- * This source code is licensed under the MIT license found in the
729
- * LICENSE file in the root directory of this source tree.
730
- */
731
- const MESSAGES_ALL = {
732
- en,
733
- };
734
- class Localization {
735
- constructor() {
736
- this.setLocale = (locale) => {
737
- this.locale = locale && MESSAGES_ALL[locale] ? locale : 'en';
738
- };
739
- this.getLocale = () => this.locale;
740
- const language = window.navigator.language.slice(0, 2).toLowerCase();
741
- this.setLocale(language);
742
- }
743
- getString(id, replacer) {
744
- const value = MESSAGES_ALL[this.locale][id];
745
- if (!value) {
746
- return '';
747
- }
748
- if (!replacer) {
749
- return value;
750
- }
751
- const splitted = value.split(replacer.pattern);
752
- if (splitted.length > 1) {
753
- return [
754
- splitted[0],
755
- replacer.replacer,
756
- splitted[1],
757
- ];
758
- }
759
- return value;
760
- }
761
- }
762
- const l10n = new Localization();
763
-
764
- exports.dateDiff = dateDiff;
765
- exports.dateShort = dateShort;
766
- exports.history = history;
767
- exports.l10n = l10n;