smoothly 0.1.112 → 0.1.115

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 (246) hide show
  1. package/dist/cjs/{Notice-9c2b52b7.js → Notice-839702d8.js} +34 -26
  2. package/dist/cjs/{Trigger-74bd1ee8.js → Trigger-cf376531.js} +55 -146
  3. package/dist/cjs/{index-41a36ce2.js → index-1c61bdd3.js} +27 -1
  4. package/dist/cjs/index.cjs.js +20 -8
  5. package/dist/cjs/loader.cjs.js +3 -19
  6. package/dist/cjs/{smoothly-accordion_50.cjs.entry.js → smoothly-accordion_51.cjs.entry.js} +7694 -1487
  7. package/dist/cjs/smoothly-google-font.cjs.entry.js +2 -2
  8. package/dist/cjs/smoothly-radio-group.cjs.entry.js +2 -2
  9. package/dist/cjs/smoothly-reorder.cjs.entry.js +2 -2
  10. package/dist/cjs/smoothly-trigger-sink.cjs.entry.js +5 -5
  11. package/dist/cjs/smoothly-trigger-source.cjs.entry.js +5 -5
  12. package/dist/cjs/smoothly.cjs.js +5 -113
  13. package/dist/collection/collection-manifest.json +3 -2
  14. package/dist/collection/components/app-demo/index.js +6 -1
  15. package/dist/collection/components/button/index.js +168 -0
  16. package/dist/collection/components/button/style.css +49 -0
  17. package/dist/collection/components/input/style.css +2 -2
  18. package/dist/collection/components/picker/index.js +10 -6
  19. package/dist/collection/components/trigger/style.css +3 -3
  20. package/dist/custom-elements/index.d.ts +6 -0
  21. package/dist/custom-elements/index.js +7781 -2970
  22. package/dist/esm/{Notice-4131b4e0.js → Notice-608b552c.js} +34 -26
  23. package/dist/esm/{Trigger-d7b181ec.js → Trigger-365408f0.js} +55 -146
  24. package/dist/esm/{index-dcb2b612.js → index-a3737440.js} +27 -1
  25. package/dist/esm/index.js +17 -4
  26. package/dist/esm/loader.js +3 -19
  27. package/dist/esm/polyfills/css-shim.js +1 -1
  28. package/dist/esm/{smoothly-accordion_50.entry.js → smoothly-accordion_51.entry.js} +7694 -1488
  29. package/dist/esm/smoothly-google-font.entry.js +2 -2
  30. package/dist/esm/smoothly-radio-group.entry.js +2 -2
  31. package/dist/esm/smoothly-reorder.entry.js +2 -2
  32. package/dist/esm/smoothly-trigger-sink.entry.js +3 -3
  33. package/dist/esm/smoothly-trigger-source.entry.js +3 -3
  34. package/dist/esm/smoothly.js +5 -113
  35. package/dist/smoothly/index.esm.js +1 -376
  36. package/dist/smoothly/p-0215b4da.entry.js +1 -0
  37. package/dist/smoothly/{p-074a0448.js → p-0cba3e3d.js} +1 -1
  38. package/dist/smoothly/p-18a1063c.entry.js +1 -0
  39. package/dist/smoothly/p-6ca0d36c.js +1 -0
  40. package/dist/smoothly/p-6f009ac9.entry.js +1 -0
  41. package/dist/smoothly/p-7a30d9b8.js +1 -0
  42. package/dist/smoothly/p-8ae38136.entry.js +1 -0
  43. package/dist/smoothly/p-993534fa.entry.js +1 -0
  44. package/dist/smoothly/p-eec1c703.entry.js +1 -0
  45. package/dist/smoothly/smoothly.esm.js +1 -125
  46. package/dist/types/components/button/index.d.ts +11 -0
  47. package/dist/types/components.d.ts +27 -0
  48. package/dist/types/stencil-public-runtime.d.ts +6 -4
  49. package/package.json +18 -18
  50. package/dist/cjs/App-339acc9b.js +0 -647
  51. package/dist/cjs/_commonjsHelpers-10109b76.js +0 -48
  52. package/dist/cjs/app-globals-3a1e7e63.js +0 -5
  53. package/dist/cjs/css-shim-88cc6900.js +0 -6
  54. package/dist/cjs/dom-95afd968.js +0 -75
  55. package/dist/cjs/generate-f9a36f25.js +0 -66
  56. package/dist/cjs/index-138c41c2.js +0 -3066
  57. package/dist/cjs/index-40d009d5.js +0 -1354
  58. package/dist/cjs/index-ac32385c.js +0 -18850
  59. package/dist/cjs/index-d66869d7.js +0 -1672
  60. package/dist/cjs/shadow-css-71d0f821.js +0 -391
  61. package/dist/cjs/smoothly-accordion-item.cjs.entry.js +0 -54
  62. package/dist/cjs/smoothly-accordion.cjs.entry.js +0 -55
  63. package/dist/cjs/smoothly-app-demo.cjs.entry.js +0 -29
  64. package/dist/cjs/smoothly-app.cjs.entry.js +0 -19
  65. package/dist/cjs/smoothly-backtotop.cjs.entry.js +0 -37
  66. package/dist/cjs/smoothly-calendar.cjs.entry.js +0 -95
  67. package/dist/cjs/smoothly-checkbox.cjs.entry.js +0 -18671
  68. package/dist/cjs/smoothly-dialog-demo.cjs.entry.js +0 -16
  69. package/dist/cjs/smoothly-dialog.cjs.entry.js +0 -38
  70. package/dist/cjs/smoothly-display-amount.cjs.entry.js +0 -59
  71. package/dist/cjs/smoothly-display-date-time.cjs.entry.js +0 -20
  72. package/dist/cjs/smoothly-display-demo.cjs.entry.js +0 -25
  73. package/dist/cjs/smoothly-display.cjs.entry.js +0 -41
  74. package/dist/cjs/smoothly-frame.cjs.entry.js +0 -50
  75. package/dist/cjs/smoothly-icon-demo.cjs.entry.js +0 -491
  76. package/dist/cjs/smoothly-icon.cjs.entry.js +0 -52
  77. package/dist/cjs/smoothly-input-date-range.cjs.entry.js +0 -50
  78. package/dist/cjs/smoothly-input-date.cjs.entry.js +0 -44
  79. package/dist/cjs/smoothly-input-demo.cjs.entry.js +0 -19
  80. package/dist/cjs/smoothly-input-month.cjs.entry.js +0 -41
  81. package/dist/cjs/smoothly-input.cjs.entry.js +0 -202
  82. package/dist/cjs/smoothly-item.cjs.entry.js +0 -43
  83. package/dist/cjs/smoothly-menu-options.cjs.entry.js +0 -108
  84. package/dist/cjs/smoothly-notification.cjs.entry.js +0 -67
  85. package/dist/cjs/smoothly-notifier.cjs.entry.js +0 -29
  86. package/dist/cjs/smoothly-option.cjs.entry.js +0 -33
  87. package/dist/cjs/smoothly-picker.cjs.entry.js +0 -151
  88. package/dist/cjs/smoothly-popup.cjs.entry.js +0 -38
  89. package/dist/cjs/smoothly-quiet.cjs.entry.js +0 -19
  90. package/dist/cjs/smoothly-radio.cjs.entry.js +0 -28
  91. package/dist/cjs/smoothly-room.cjs.entry.js +0 -16
  92. package/dist/cjs/smoothly-select-demo.cjs.entry.js +0 -86
  93. package/dist/cjs/smoothly-select.cjs.entry.js +0 -31
  94. package/dist/cjs/smoothly-selector.cjs.entry.js +0 -119
  95. package/dist/cjs/smoothly-skeleton.cjs.entry.js +0 -27
  96. package/dist/cjs/smoothly-spinner.cjs.entry.js +0 -24
  97. package/dist/cjs/smoothly-submit.cjs.entry.js +0 -60
  98. package/dist/cjs/smoothly-svg.cjs.entry.js +0 -41
  99. package/dist/cjs/smoothly-tab-switch.cjs.entry.js +0 -32
  100. package/dist/cjs/smoothly-tab.cjs.entry.js +0 -37
  101. package/dist/cjs/smoothly-table-cell.cjs.entry.js +0 -19
  102. package/dist/cjs/smoothly-table-demo.cjs.entry.js +0 -22
  103. package/dist/cjs/smoothly-table-expandable-cell.cjs.entry.js +0 -45
  104. package/dist/cjs/smoothly-table-expandable-row.cjs.entry.js +0 -32
  105. package/dist/cjs/smoothly-table-header.cjs.entry.js +0 -41
  106. package/dist/cjs/smoothly-table-row.cjs.entry.js +0 -38
  107. package/dist/cjs/smoothly-table.cjs.entry.js +0 -26
  108. package/dist/cjs/smoothly-trigger.cjs.entry.js +0 -36
  109. package/dist/cjs/smoothly-tuple.cjs.entry.js +0 -16
  110. package/dist/cjs/smoothly-urlencoded.cjs.entry.js +0 -19
  111. package/dist/esm/App-22187759.js +0 -645
  112. package/dist/esm/_commonjsHelpers-8fe71198.js +0 -44
  113. package/dist/esm/app-globals-0f993ce5.js +0 -3
  114. package/dist/esm/css-shim-c64026cd.js +0 -4
  115. package/dist/esm/dom-a712b575.js +0 -73
  116. package/dist/esm/generate-50b98474.js +0 -61
  117. package/dist/esm/index-02a70ac1.js +0 -3027
  118. package/dist/esm/index-401c6ce3.js +0 -1670
  119. package/dist/esm/index-a5a08f46.js +0 -18848
  120. package/dist/esm/index-c8b5d468.js +0 -1349
  121. package/dist/esm/shadow-css-1e16431b.js +0 -389
  122. package/dist/esm/smoothly-accordion-item.entry.js +0 -50
  123. package/dist/esm/smoothly-accordion.entry.js +0 -51
  124. package/dist/esm/smoothly-app-demo.entry.js +0 -25
  125. package/dist/esm/smoothly-app.entry.js +0 -15
  126. package/dist/esm/smoothly-backtotop.entry.js +0 -33
  127. package/dist/esm/smoothly-calendar.entry.js +0 -91
  128. package/dist/esm/smoothly-checkbox.entry.js +0 -18667
  129. package/dist/esm/smoothly-dialog-demo.entry.js +0 -12
  130. package/dist/esm/smoothly-dialog.entry.js +0 -34
  131. package/dist/esm/smoothly-display-amount.entry.js +0 -55
  132. package/dist/esm/smoothly-display-date-time.entry.js +0 -16
  133. package/dist/esm/smoothly-display-demo.entry.js +0 -21
  134. package/dist/esm/smoothly-display.entry.js +0 -37
  135. package/dist/esm/smoothly-frame.entry.js +0 -46
  136. package/dist/esm/smoothly-icon-demo.entry.js +0 -487
  137. package/dist/esm/smoothly-icon.entry.js +0 -48
  138. package/dist/esm/smoothly-input-date-range.entry.js +0 -46
  139. package/dist/esm/smoothly-input-date.entry.js +0 -40
  140. package/dist/esm/smoothly-input-demo.entry.js +0 -15
  141. package/dist/esm/smoothly-input-month.entry.js +0 -37
  142. package/dist/esm/smoothly-input.entry.js +0 -198
  143. package/dist/esm/smoothly-item.entry.js +0 -39
  144. package/dist/esm/smoothly-menu-options.entry.js +0 -104
  145. package/dist/esm/smoothly-notification.entry.js +0 -63
  146. package/dist/esm/smoothly-notifier.entry.js +0 -25
  147. package/dist/esm/smoothly-option.entry.js +0 -29
  148. package/dist/esm/smoothly-picker.entry.js +0 -147
  149. package/dist/esm/smoothly-popup.entry.js +0 -34
  150. package/dist/esm/smoothly-quiet.entry.js +0 -15
  151. package/dist/esm/smoothly-radio.entry.js +0 -24
  152. package/dist/esm/smoothly-room.entry.js +0 -12
  153. package/dist/esm/smoothly-select-demo.entry.js +0 -82
  154. package/dist/esm/smoothly-select.entry.js +0 -27
  155. package/dist/esm/smoothly-selector.entry.js +0 -115
  156. package/dist/esm/smoothly-skeleton.entry.js +0 -23
  157. package/dist/esm/smoothly-spinner.entry.js +0 -20
  158. package/dist/esm/smoothly-submit.entry.js +0 -56
  159. package/dist/esm/smoothly-svg.entry.js +0 -37
  160. package/dist/esm/smoothly-tab-switch.entry.js +0 -28
  161. package/dist/esm/smoothly-tab.entry.js +0 -33
  162. package/dist/esm/smoothly-table-cell.entry.js +0 -15
  163. package/dist/esm/smoothly-table-demo.entry.js +0 -18
  164. package/dist/esm/smoothly-table-expandable-cell.entry.js +0 -41
  165. package/dist/esm/smoothly-table-expandable-row.entry.js +0 -28
  166. package/dist/esm/smoothly-table-header.entry.js +0 -37
  167. package/dist/esm/smoothly-table-row.entry.js +0 -34
  168. package/dist/esm/smoothly-table.entry.js +0 -22
  169. package/dist/esm/smoothly-trigger.entry.js +0 -32
  170. package/dist/esm/smoothly-tuple.entry.js +0 -12
  171. package/dist/esm/smoothly-urlencoded.entry.js +0 -15
  172. package/dist/smoothly/App-22187759.js +0 -645
  173. package/dist/smoothly/GoogleFont-8474516b.js +0 -21
  174. package/dist/smoothly/_commonjsHelpers-8fe71198.js +0 -44
  175. package/dist/smoothly/app-globals-0f993ce5.js +0 -3
  176. package/dist/smoothly/css-shim-c64026cd.js +0 -4
  177. package/dist/smoothly/dom-a712b575.js +0 -73
  178. package/dist/smoothly/generate-50b98474.js +0 -61
  179. package/dist/smoothly/index-02a70ac1.js +0 -3027
  180. package/dist/smoothly/index-401c6ce3.js +0 -1670
  181. package/dist/smoothly/index-a5a08f46.js +0 -18848
  182. package/dist/smoothly/index-c8b5d468.js +0 -1349
  183. package/dist/smoothly/p-0c1e9588.entry.js +0 -1
  184. package/dist/smoothly/p-14232157.entry.js +0 -1
  185. package/dist/smoothly/p-19518931.js +0 -1
  186. package/dist/smoothly/p-22d4d5a7.entry.js +0 -1
  187. package/dist/smoothly/p-2cda1784.js +0 -1
  188. package/dist/smoothly/p-436cd558.entry.js +0 -1
  189. package/dist/smoothly/p-9fa3ab06.entry.js +0 -1
  190. package/dist/smoothly/p-b8a3e273.entry.js +0 -1
  191. package/dist/smoothly/shadow-css-1e16431b.js +0 -389
  192. package/dist/smoothly/smoothly-accordion-item.entry.js +0 -50
  193. package/dist/smoothly/smoothly-accordion.entry.js +0 -51
  194. package/dist/smoothly/smoothly-app-demo.entry.js +0 -25
  195. package/dist/smoothly/smoothly-app.entry.js +0 -15
  196. package/dist/smoothly/smoothly-backtotop.entry.js +0 -33
  197. package/dist/smoothly/smoothly-calendar.entry.js +0 -91
  198. package/dist/smoothly/smoothly-checkbox.entry.js +0 -18667
  199. package/dist/smoothly/smoothly-dialog-demo.entry.js +0 -12
  200. package/dist/smoothly/smoothly-dialog.entry.js +0 -34
  201. package/dist/smoothly/smoothly-display-amount.entry.js +0 -55
  202. package/dist/smoothly/smoothly-display-date-time.entry.js +0 -16
  203. package/dist/smoothly/smoothly-display-demo.entry.js +0 -21
  204. package/dist/smoothly/smoothly-display.entry.js +0 -37
  205. package/dist/smoothly/smoothly-frame.entry.js +0 -46
  206. package/dist/smoothly/smoothly-google-font.entry.js +0 -13
  207. package/dist/smoothly/smoothly-icon-demo.entry.js +0 -487
  208. package/dist/smoothly/smoothly-icon.entry.js +0 -48
  209. package/dist/smoothly/smoothly-input-date-range.entry.js +0 -46
  210. package/dist/smoothly/smoothly-input-date.entry.js +0 -40
  211. package/dist/smoothly/smoothly-input-demo.entry.js +0 -15
  212. package/dist/smoothly/smoothly-input-month.entry.js +0 -37
  213. package/dist/smoothly/smoothly-input.entry.js +0 -198
  214. package/dist/smoothly/smoothly-item.entry.js +0 -39
  215. package/dist/smoothly/smoothly-menu-options.entry.js +0 -104
  216. package/dist/smoothly/smoothly-notification.entry.js +0 -63
  217. package/dist/smoothly/smoothly-notifier.entry.js +0 -25
  218. package/dist/smoothly/smoothly-option.entry.js +0 -29
  219. package/dist/smoothly/smoothly-picker.entry.js +0 -147
  220. package/dist/smoothly/smoothly-popup.entry.js +0 -34
  221. package/dist/smoothly/smoothly-quiet.entry.js +0 -15
  222. package/dist/smoothly/smoothly-radio-group.entry.js +0 -16
  223. package/dist/smoothly/smoothly-radio.entry.js +0 -24
  224. package/dist/smoothly/smoothly-reorder.entry.js +0 -99
  225. package/dist/smoothly/smoothly-room.entry.js +0 -12
  226. package/dist/smoothly/smoothly-select-demo.entry.js +0 -82
  227. package/dist/smoothly/smoothly-select.entry.js +0 -27
  228. package/dist/smoothly/smoothly-selector.entry.js +0 -115
  229. package/dist/smoothly/smoothly-skeleton.entry.js +0 -23
  230. package/dist/smoothly/smoothly-spinner.entry.js +0 -20
  231. package/dist/smoothly/smoothly-submit.entry.js +0 -56
  232. package/dist/smoothly/smoothly-svg.entry.js +0 -37
  233. package/dist/smoothly/smoothly-tab-switch.entry.js +0 -28
  234. package/dist/smoothly/smoothly-tab.entry.js +0 -33
  235. package/dist/smoothly/smoothly-table-cell.entry.js +0 -15
  236. package/dist/smoothly/smoothly-table-demo.entry.js +0 -18
  237. package/dist/smoothly/smoothly-table-expandable-cell.entry.js +0 -41
  238. package/dist/smoothly/smoothly-table-expandable-row.entry.js +0 -28
  239. package/dist/smoothly/smoothly-table-header.entry.js +0 -37
  240. package/dist/smoothly/smoothly-table-row.entry.js +0 -34
  241. package/dist/smoothly/smoothly-table.entry.js +0 -22
  242. package/dist/smoothly/smoothly-trigger-sink.entry.js +0 -29
  243. package/dist/smoothly/smoothly-trigger-source.entry.js +0 -28
  244. package/dist/smoothly/smoothly-trigger.entry.js +0 -32
  245. package/dist/smoothly/smoothly-tuple.entry.js +0 -12
  246. package/dist/smoothly/smoothly-urlencoded.entry.js +0 -15
@@ -1,1354 +0,0 @@
1
- 'use strict';
2
-
3
- require('./GoogleFont-6c4f0da1.js');
4
-
5
- class TextEncoder {
6
- constructor() {
7
- this.encoding = "utf-8";
8
- }
9
- encode(data) {
10
- return Uint8Array.from(unescape(encodeURIComponent(data)).split(""), c => c.charCodeAt(0));
11
- }
12
- }
13
-
14
- const tables = {
15
- standard: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
16
- url: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",
17
- };
18
- function encode$1(value, standard = "standard", padding = "") {
19
- if (typeof value == "string")
20
- value = new TextEncoder().encode(value);
21
- const table = tables[standard];
22
- const result = [];
23
- for (let c = 0; c < value.length; c += 3) {
24
- const c0 = value[c];
25
- const c1 = c + 1 < value.length ? value[c + 1] : 0;
26
- const c2 = c + 2 < value.length ? value[c + 2] : 0;
27
- result.push(table[c0 >>> 2]);
28
- result.push(table[((c0 & 3) << 4) | (c1 >>> 4)]);
29
- result.push(table[((c1 & 15) << 2) | (c2 >>> 6)]);
30
- result.push(table[c2 & 63]);
31
- }
32
- const length = Math.ceil((value.length / 3) * 4);
33
- return result.join("").substr(0, length) + padding.repeat(result.length - length);
34
- }
35
- function decode$1(value, standard = "standard") {
36
- while (value.endsWith("=") && value.length > 0)
37
- value = value.substr(0, value.length - 1);
38
- const table = tables[standard];
39
- const data = value.split("").map(c => table.indexOf(c));
40
- const result = new Uint8Array(Math.floor((data.length / 4) * 3));
41
- for (let c = 0; c < result.length; c += 3) {
42
- const d0 = data.shift() || 0;
43
- const d1 = data.shift() || 0;
44
- const d2 = data.shift() || 0;
45
- const d3 = data.shift() || 0;
46
- result[c] = (d0 << 2) | (d1 >>> 4);
47
- result[c + 1] = ((d1 & 15) << 4) | (d2 >>> 2);
48
- result[c + 2] = ((d2 & 3) << 6) | d3;
49
- }
50
- return result;
51
- }
52
-
53
- const crypto = typeof window != "undefined"
54
- ? window.crypto || window.msCrypto
55
- : self.crypto || self.msCrypto;
56
-
57
- class TextDecoder {
58
- constructor() {
59
- this.encoding = "utf-8";
60
- }
61
- decode(view, options) {
62
- return !view
63
- ? ""
64
- : decodeURIComponent(escape(Array.from(new Uint8Array(view.buffer, view.byteOffset, view.byteLength), c => String.fromCharCode(c)).join("")));
65
- }
66
- }
67
-
68
- var __awaiter$d = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
69
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
70
- return new (P || (P = Promise))(function (resolve, reject) {
71
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
72
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
73
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
74
- step((generator = generator.apply(thisArg, _arguments || [])).next());
75
- });
76
- };
77
- class Algorithm$2 {
78
- constructor(key) {
79
- this.key = key;
80
- }
81
- encrypt(data, salt) {
82
- return __awaiter$d(this, void 0, void 0, function* () {
83
- const iv = salt ? decode$1(salt, "url") : crypto.getRandomValues(new Uint8Array(16));
84
- return {
85
- key: this.name,
86
- salt: salt || encode$1(iv, "url"),
87
- value: encode$1(new Uint8Array(yield crypto.subtle.encrypt({ name: (yield this.key).algorithm.name, iv }, yield this.key, new TextEncoder().encode(data))), "url"),
88
- };
89
- });
90
- }
91
- decrypt(encrypted, salt) {
92
- return __awaiter$d(this, void 0, void 0, function* () {
93
- if (typeof encrypted == "string")
94
- encrypted = { value: encrypted, salt: salt !== null && salt !== void 0 ? salt : "" };
95
- return new TextDecoder().decode(new Uint8Array(yield crypto.subtle.decrypt({ name: (yield this.key).algorithm.name, iv: decode$1(encrypted.salt, "url") }, yield this.key, decode$1(encrypted.value, "url"))));
96
- });
97
- }
98
- export(parts = 1) {
99
- return __awaiter$d(this, void 0, void 0, function* () {
100
- const key = new Uint8Array(yield crypto.subtle.exportKey("raw", yield this.key));
101
- let result = Algorithm$2.generateRandomKeys(key.length, parts - 1);
102
- result = [Algorithm$2.reduceKeys([key, ...result]), ...result];
103
- return result.length == 1 ? encode$1(result[0], "url") : result.map(r => encode$1(r, "url"));
104
- });
105
- }
106
- static aesCbc(key) {
107
- return Algorithm$2.generate("AES-CBC", key);
108
- }
109
- static aesGcm(key) {
110
- return Algorithm$2.generate("AES-GCM", key);
111
- }
112
- static generate(algorithm, key) {
113
- return new Algorithm$2(typeof key == "number"
114
- ? crypto.subtle.generateKey({ name: algorithm, length: key }, true, ["encrypt", "decrypt"])
115
- : crypto.subtle.importKey("raw", Array.isArray(key)
116
- ? Algorithm$2.reduceKeys(key.map(k => decode$1(k, "url")))
117
- : decode$1(key, "url"), algorithm, true, ["encrypt", "decrypt"]));
118
- }
119
- static generateRandomKeys(length, parts) {
120
- return parts > 0
121
- ? [crypto.getRandomValues(new Uint8Array(length)), ...this.generateRandomKeys(length, parts - 1)]
122
- : [];
123
- }
124
- static reduceKeys(keys) {
125
- const result = new Uint8Array(keys[0].length);
126
- for (let index = 0; index < keys[0].length; index++)
127
- result[index] = keys.reduce((p, c) => p ^ c[index], 0);
128
- return result;
129
- }
130
- }
131
-
132
- function encode(value, length) {
133
- const data = typeof value == "string" ? new TextEncoder().encode(value) : value;
134
- let result = [];
135
- for (const d of data)
136
- result.push(Math.floor(d / 16).toString(16), (d % 16).toString(16));
137
- if (length)
138
- result = result.slice(0, length);
139
- return result.join("");
140
- }
141
- function decode(value) {
142
- if (value.length % 2 == 1)
143
- value += "0";
144
- const result = new Uint8Array(value.length / 2);
145
- for (let index = 0; index < result.length; index++)
146
- result[index] = Number.parseInt(value[index * 2], 16) * 16 + Number.parseInt(value[index * 2 + 1], 16);
147
- return result;
148
- }
149
-
150
- var __awaiter$c = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
151
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
152
- return new (P || (P = Promise))(function (resolve, reject) {
153
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
154
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
155
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
156
- step((generator = generator.apply(thisArg, _arguments || [])).next());
157
- });
158
- };
159
- class Digest {
160
- constructor(algorithm) {
161
- this.algorithm = algorithm;
162
- }
163
- get length() {
164
- return Digest.lengths[this.algorithm];
165
- }
166
- digest(data, base = "standard") {
167
- return __awaiter$c(this, void 0, void 0, function* () {
168
- let result;
169
- if (typeof data == "string") {
170
- const digest = yield this.digest(new TextEncoder().encode(data));
171
- result = base == 16 ? encode(digest) : encode$1(digest, base);
172
- }
173
- else
174
- result = new Uint8Array(yield crypto.subtle.digest(this.algorithm, data));
175
- return result;
176
- });
177
- }
178
- }
179
- Digest.lengths = {
180
- "SHA-1": 128,
181
- "SHA-256": 256,
182
- "SHA-384": 384,
183
- "SHA-512": 512,
184
- };
185
-
186
- var Encrypted;
187
- (function (Encrypted) {
188
- function is(value) {
189
- return (typeof value == "object" &&
190
- (value.key == undefined || typeof value.key == "string") &&
191
- typeof value.value == "string" &&
192
- typeof value.salt == "string");
193
- }
194
- Encrypted.is = is;
195
- function stringify(encrypted) {
196
- encrypted.key = encrypted.key && encrypted.key.length != 4 ? encrypted.key.slice(-2) : encrypted.key;
197
- return [encrypted.key, encrypted.salt, encrypted.value].join(".");
198
- }
199
- Encrypted.stringify = stringify;
200
- function parse(encryptedString) {
201
- const splitted = encryptedString.split(".");
202
- const encrypted = { key: splitted[0], salt: splitted[1], value: splitted[2] };
203
- return Encrypted.is(encrypted) ? encrypted : undefined;
204
- }
205
- Encrypted.parse = parse;
206
- })(Encrypted || (Encrypted = {}));
207
-
208
- var Identifier;
209
- (function (Identifier) {
210
- function is(value, length) {
211
- return (typeof value == "string" &&
212
- (length == undefined || value.length == length) &&
213
- Array.from(value).every(c => (c >= "0" && c <= "9") || (c >= "A" && c <= "Z") || (c >= "a" && c <= "z") || c == "-" || c == "_"));
214
- }
215
- Identifier.is = is;
216
- function fromUint24(value) {
217
- return fromHexadecimal(value.toString(16).padStart(6, "0"));
218
- }
219
- Identifier.fromUint24 = fromUint24;
220
- function toUint24(identifier) {
221
- return Number.parseInt(toHexadecimal(identifier, 6), 16);
222
- }
223
- Identifier.toUint24 = toUint24;
224
- function fromUint48(value) {
225
- return fromHexadecimal(value.toString(16).padStart(12, "0"));
226
- }
227
- Identifier.fromUint48 = fromUint48;
228
- function toUint48(identifier) {
229
- return Number.parseInt(toHexadecimal(identifier, 12), 16);
230
- }
231
- Identifier.toUint48 = toUint48;
232
- function fromBinary(identifier) {
233
- return encode$1(identifier, "url");
234
- }
235
- Identifier.fromBinary = fromBinary;
236
- function toBinary(identifier) {
237
- return decode$1(identifier, "url");
238
- }
239
- Identifier.toBinary = toBinary;
240
- function generate(length) {
241
- return fromBinary(crypto.getRandomValues(new Uint8Array((length / 4) * 3)));
242
- }
243
- Identifier.generate = generate;
244
- function fromHexadecimal(identifier) {
245
- if (identifier.length % 2 == 1)
246
- identifier += "0";
247
- const result = new Uint8Array(identifier.length / 2);
248
- for (let index = 0; index < result.length; index++)
249
- result[index] = Number.parseInt(identifier[index * 2], 16) * 16 + Number.parseInt(identifier[index * 2 + 1], 16);
250
- return fromBinary(result);
251
- }
252
- Identifier.fromHexadecimal = fromHexadecimal;
253
- function toHexadecimal(identifier, length) {
254
- const data = decode$1(identifier, "url");
255
- let result = [];
256
- for (const d of data)
257
- result.push(Math.floor(d / 16).toString(16), (d % 16).toString(16));
258
- if (length)
259
- result = result.slice(0, length);
260
- return result.join("");
261
- }
262
- Identifier.toHexadecimal = toHexadecimal;
263
- Identifier.length = [
264
- 4,
265
- 8,
266
- 12,
267
- 16,
268
- 20,
269
- 24,
270
- 28,
271
- 32,
272
- 36,
273
- 40,
274
- 44,
275
- 48,
276
- 52,
277
- 56,
278
- 60,
279
- 64,
280
- 68,
281
- 72,
282
- 76,
283
- 80,
284
- 84,
285
- 88,
286
- 92,
287
- 96,
288
- 100,
289
- 104,
290
- 108,
291
- 112,
292
- 116,
293
- 120,
294
- 124,
295
- 128,
296
- ];
297
- let Length;
298
- (function (Length) {
299
- function is(value) {
300
- return typeof value == "number" && value >= 4 && value <= 128 && (value & 252) == value;
301
- }
302
- Length.is = is;
303
- })(Length = Identifier.Length || (Identifier.Length = {}));
304
- })(Identifier || (Identifier = {}));
305
-
306
- var __awaiter$b = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
307
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
308
- return new (P || (P = Promise))(function (resolve, reject) {
309
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
310
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
311
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
312
- step((generator = generator.apply(thisArg, _arguments || [])).next());
313
- });
314
- };
315
- var Password;
316
- (function (Password) {
317
- function is(value) {
318
- return (typeof value == "string" ||
319
- (typeof value == "object" && typeof value.hash == "string" && typeof value.salt == "string"));
320
- }
321
- Password.is = is;
322
- function hash(algorithm, password, salt) {
323
- return __awaiter$b(this, void 0, void 0, function* () {
324
- if (!salt)
325
- salt = encode$1(crypto.getRandomValues(new Uint8Array(64)));
326
- return {
327
- hash: yield algorithm.sign(salt + password),
328
- salt,
329
- };
330
- });
331
- }
332
- Password.hash = hash;
333
- function verify(algorithm, hash, password) {
334
- return __awaiter$b(this, void 0, void 0, function* () {
335
- return (yield Password.hash(algorithm, password, hash.salt)).hash == hash.hash;
336
- });
337
- }
338
- Password.verify = verify;
339
- let Hashed;
340
- (function (Hashed) {
341
- function is(value) {
342
- return typeof value == "object" && typeof value.hash == "string" && typeof value.salt == "string";
343
- }
344
- Hashed.is = is;
345
- })(Hashed = Password.Hashed || (Password.Hashed = {}));
346
- })(Password || (Password = {}));
347
-
348
- var RandomValue;
349
- (function (RandomValue) {
350
- function generate(array) {
351
- return crypto.getRandomValues(array);
352
- }
353
- RandomValue.generate = generate;
354
- })(RandomValue || (RandomValue = {}));
355
-
356
- var Algorithm$1;
357
- (function (Algorithm) {
358
- function is(value) {
359
- return value == "HMAC" || value == "RSA" || value == "ECDSA" || value == "RSA-PSS";
360
- }
361
- Algorithm.is = is;
362
- })(Algorithm$1 || (Algorithm$1 = {}));
363
-
364
- var __awaiter$a = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
365
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
366
- return new (P || (P = Promise))(function (resolve, reject) {
367
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
368
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
369
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
370
- step((generator = generator.apply(thisArg, _arguments || [])).next());
371
- });
372
- };
373
- class Base {
374
- sign(data) {
375
- return __awaiter$a(this, void 0, void 0, function* () {
376
- return typeof data == "string"
377
- ? encode$1(yield this.signBinary(new TextEncoder().encode(data)), "url")
378
- : this.signBinary(data);
379
- });
380
- }
381
- verify(data, signature) {
382
- if (typeof signature == "string")
383
- signature = decode$1(signature, "url");
384
- return typeof data == "string"
385
- ? this.verifyBinary(new TextEncoder().encode(data), signature)
386
- : this.verifyBinary(data, signature);
387
- }
388
- }
389
-
390
- var __awaiter$9 = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
391
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
392
- return new (P || (P = Promise))(function (resolve, reject) {
393
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
394
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
395
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
396
- step((generator = generator.apply(thisArg, _arguments || [])).next());
397
- });
398
- };
399
- class ECDSA extends Base {
400
- constructor(hash, publicKey, privateKey) {
401
- super();
402
- this.hash = hash;
403
- if (publicKey) {
404
- if (typeof publicKey == "string")
405
- publicKey = decode$1(publicKey);
406
- this.publicKey = crypto.subtle.importKey("spki", publicKey, { name: "ECDSA", namedCurve: hash.replace("SHA", "P") == "P-512" ? "P-521" : hash.replace("SHA", "P") }, false, ["verify"]);
407
- }
408
- if (privateKey) {
409
- if (typeof privateKey == "string")
410
- privateKey = decode$1(privateKey);
411
- this.privateKey = crypto.subtle.importKey("pkcs8", privateKey, { name: "ECDSA", namedCurve: hash.replace("SHA", "P") == "P-512" ? "P-521" : hash.replace("SHA", "P") }, true, ["sign", "verify"]);
412
- }
413
- }
414
- signBinary(data) {
415
- return __awaiter$9(this, void 0, void 0, function* () {
416
- return new Uint8Array(yield crypto.subtle.sign({ name: "ECDSA", hash: { name: this.hash } }, yield this.privateKey, data));
417
- });
418
- }
419
- verifyBinary(data, signature) {
420
- return __awaiter$9(this, void 0, void 0, function* () {
421
- return crypto.subtle.verify({ name: "ECDSA", hash: { name: this.hash } }, yield this.publicKey, signature, data);
422
- });
423
- }
424
- }
425
-
426
- var Hash;
427
- (function (Hash) {
428
- function is(value) {
429
- return value == "SHA-1" || value == "SHA-256" || value == "SHA-384" || value == "SHA-512";
430
- }
431
- Hash.is = is;
432
- })(Hash || (Hash = {}));
433
-
434
- var __awaiter$8 = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
435
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
436
- return new (P || (P = Promise))(function (resolve, reject) {
437
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
438
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
439
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
440
- step((generator = generator.apply(thisArg, _arguments || [])).next());
441
- });
442
- };
443
- class Symmetric$1 extends Base {
444
- verifyBinary(data, signature) {
445
- return __awaiter$8(this, void 0, void 0, function* () {
446
- return encode$1(yield this.signBinary(data), "url") == encode$1(signature, "url");
447
- });
448
- }
449
- }
450
-
451
- var __awaiter$7 = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
452
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
453
- return new (P || (P = Promise))(function (resolve, reject) {
454
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
455
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
456
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
457
- step((generator = generator.apply(thisArg, _arguments || [])).next());
458
- });
459
- };
460
- class HMAC extends Symmetric$1 {
461
- constructor(hash, key) {
462
- super();
463
- this.hash = hash;
464
- if (typeof key == "string")
465
- key = decode$1(key, "url");
466
- this.key = crypto.subtle.importKey("raw", key, { name: "HMAC", hash: { name: hash } }, false, ["sign", "verify"]);
467
- }
468
- signBinary(data) {
469
- return __awaiter$7(this, void 0, void 0, function* () {
470
- return new Uint8Array(yield crypto.subtle.sign("HMAC", yield this.key, data));
471
- });
472
- }
473
- }
474
-
475
- class None extends Symmetric$1 {
476
- signBinary(_) {
477
- return Promise.resolve(new Uint8Array(0));
478
- }
479
- }
480
-
481
- var __awaiter$6 = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
482
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
483
- return new (P || (P = Promise))(function (resolve, reject) {
484
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
485
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
486
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
487
- step((generator = generator.apply(thisArg, _arguments || [])).next());
488
- });
489
- };
490
- class RSA extends Base {
491
- constructor(hash, publicKey, privateKey) {
492
- super();
493
- this.hash = hash;
494
- if (publicKey) {
495
- if (typeof publicKey == "string")
496
- publicKey = decode$1(publicKey);
497
- this.publicKey = crypto.subtle.importKey("spki", publicKey, { name: "RSASSA-PKCS1-v1_5", hash: { name: hash } }, false, ["verify"]);
498
- }
499
- if (privateKey) {
500
- if (typeof privateKey == "string")
501
- privateKey = decode$1(privateKey);
502
- this.privateKey = crypto.subtle.importKey("pkcs8", privateKey, { name: "RSASSA-PKCS1-v1_5", hash: { name: hash } }, true, ["sign"]);
503
- }
504
- }
505
- signBinary(data) {
506
- return __awaiter$6(this, void 0, void 0, function* () {
507
- return new Uint8Array(yield crypto.subtle.sign("RSASSA-PKCS1-v1_5", yield this.privateKey, data));
508
- });
509
- }
510
- verifyBinary(data, signature) {
511
- return __awaiter$6(this, void 0, void 0, function* () {
512
- return crypto.subtle.verify("RSASSA-PKCS1-v1_5", yield this.publicKey, signature, data);
513
- });
514
- }
515
- }
516
-
517
- var __awaiter$5 = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
518
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
519
- return new (P || (P = Promise))(function (resolve, reject) {
520
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
521
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
522
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
523
- step((generator = generator.apply(thisArg, _arguments || [])).next());
524
- });
525
- };
526
- class RSAPSS extends Base {
527
- constructor(hash, publicKey, privateKey) {
528
- super();
529
- this.hash = hash;
530
- if (publicKey) {
531
- if (typeof publicKey == "string")
532
- publicKey = decode$1(publicKey);
533
- this.publicKey = crypto.subtle.importKey("spki", publicKey, { name: "RSA-PSS", hash: { name: hash } }, false, [
534
- "verify",
535
- ]);
536
- }
537
- if (privateKey) {
538
- if (typeof privateKey == "string")
539
- privateKey = decode$1(privateKey);
540
- this.privateKey = crypto.subtle.importKey("pkcs8", privateKey, { name: "RSA-PSS", hash: { name: hash } }, true, [
541
- "sign",
542
- "verify",
543
- ]);
544
- }
545
- }
546
- signBinary(data) {
547
- return __awaiter$5(this, void 0, void 0, function* () {
548
- return new Uint8Array(yield crypto.subtle.sign({ name: "RSA-PSS", saltLength: 128 }, yield this.privateKey, data));
549
- });
550
- }
551
- verifyBinary(data, signature) {
552
- return __awaiter$5(this, void 0, void 0, function* () {
553
- return crypto.subtle.verify({ name: "RSA-PSS", saltLength: 128 }, yield this.publicKey, signature, data);
554
- });
555
- }
556
- }
557
-
558
- var Signer;
559
- (function (Signer) {
560
- let Algorithm;
561
- (function (Algorithm) {
562
- Algorithm.is = Algorithm$1.is;
563
- })(Algorithm = Signer.Algorithm || (Signer.Algorithm = {}));
564
- let Hash$1;
565
- (function (Hash$1) {
566
- Hash$1.is = Hash.is;
567
- })(Hash$1 = Signer.Hash || (Signer.Hash = {}));
568
- function create(algorithm, hash, ...keys) {
569
- let result;
570
- switch (algorithm) {
571
- case "HMAC":
572
- if (hash != undefined)
573
- result = new HMAC(hash, keys[0]);
574
- break;
575
- case "RSA":
576
- if (hash != undefined)
577
- result = new RSA(hash, keys[0], keys[1]);
578
- break;
579
- case "RSA-PSS":
580
- if (hash != undefined)
581
- result = new RSAPSS(hash, keys[0], keys[1]);
582
- break;
583
- case "ECDSA":
584
- if (hash != undefined)
585
- result = new ECDSA(hash, keys[0], keys[1]);
586
- break;
587
- case "None":
588
- result = new None();
589
- }
590
- return result;
591
- }
592
- Signer.create = create;
593
- })(Signer || (Signer = {}));
594
-
595
- if (!Uint8Array.__proto__.from) {
596
- ;
597
- (() => {
598
- Uint8Array.__proto__.from = function (object, theFunction, thisObject) {
599
- const typedArrayClass = Uint8Array.__proto__;
600
- if (typeof this !== "function") {
601
- throw new TypeError("# is not a constructor");
602
- }
603
- if (this.__proto__ !== typedArrayClass) {
604
- throw new TypeError("this is not a typed array.");
605
- }
606
- theFunction = theFunction || (element => element);
607
- if (typeof theFunction !== "function") {
608
- throw new TypeError("specified argument is not a function");
609
- }
610
- object = Object(object);
611
- if (!object.length) {
612
- return new this(0);
613
- }
614
- let copyData = [];
615
- for (const data of copyData) {
616
- copyData.push(data);
617
- }
618
- copyData = copyData.map(theFunction, thisObject);
619
- const typedArray = new this(copyData.length);
620
- for (let i = 0; i < typedArray.length; i++) {
621
- typedArray[i] = copyData[i];
622
- }
623
- return typedArray;
624
- };
625
- })();
626
- }
627
-
628
- var __awaiter$4 = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
629
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
630
- return new (P || (P = Promise))(function (resolve, reject) {
631
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
632
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
633
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
634
- step((generator = generator.apply(thisArg, _arguments || [])).next());
635
- });
636
- };
637
- class Converter$1 {
638
- constructor(conversionMap) {
639
- this.conversionMap = conversionMap;
640
- }
641
- apply(payload) {
642
- return __awaiter$4(this, void 0, void 0, function* () {
643
- return payload && this.convert(payload, true);
644
- });
645
- }
646
- reverse(payload) {
647
- return __awaiter$4(this, void 0, void 0, function* () {
648
- return payload && this.convert(payload, false);
649
- });
650
- }
651
- convert(payload, forward) {
652
- return __awaiter$4(this, void 0, void 0, function* () {
653
- for (const key in this.conversionMap) {
654
- const fnction = forward ? this.conversionMap[key].forward : this.conversionMap[key].backward;
655
- const property = key.split(".");
656
- payload = yield this.convertProperty(payload, property, fnction);
657
- }
658
- return payload;
659
- });
660
- }
661
- convertProperty(payload, property, fnction) {
662
- return __awaiter$4(this, void 0, void 0, function* () {
663
- const result = Object.assign({}, payload);
664
- if (result[property[0]])
665
- result[property[0]] =
666
- property.length == 1
667
- ? yield fnction(result[property[0]])
668
- : yield this.convertProperty(result[property[0]], property.slice(1), fnction);
669
- return result;
670
- });
671
- }
672
- }
673
-
674
- var Converter;
675
- (function (Converter) {
676
- function is(value) {
677
- return typeof value == "object" && Object.entries(value).every(v => typeof v == "function");
678
- }
679
- Converter.is = is;
680
- })(Converter || (Converter = {}));
681
-
682
- var Crypto$1;
683
- (function (Crypto) {
684
- function is(value) {
685
- return Array.isArray(value) && value.every(v => typeof v == "string");
686
- }
687
- Crypto.is = is;
688
- })(Crypto$1 || (Crypto$1 = {}));
689
-
690
- var Renamer$1;
691
- (function (Renamer) {
692
- function is(value) {
693
- return typeof value == "object" && Object.entries(value).every(thing => typeof thing[1] == "string");
694
- }
695
- Renamer.is = is;
696
- })(Renamer$1 || (Renamer$1 = {}));
697
-
698
- var Creatable;
699
- (function (Creatable) {
700
- function is(value) {
701
- return Crypto$1.is(value) || Converter.is(value) || Renamer$1.is(value);
702
- }
703
- Creatable.is = is;
704
- let Converter$1;
705
- (function (Converter$1) {
706
- Converter$1.is = Converter.is;
707
- })(Converter$1 = Creatable.Converter || (Creatable.Converter = {}));
708
- let Crypto;
709
- (function (Crypto) {
710
- Crypto.is = Crypto$1.is;
711
- })(Crypto = Creatable.Crypto || (Creatable.Crypto = {}));
712
- let Renamer;
713
- (function (Renamer) {
714
- Renamer.is = Renamer$1.is;
715
- })(Renamer = Creatable.Renamer || (Creatable.Renamer = {}));
716
- })(Creatable || (Creatable = {}));
717
-
718
- class Remover {
719
- constructor(toRemove) {
720
- this.toRemove = toRemove;
721
- }
722
- apply(payload) {
723
- return payload && this.removeFrom(payload);
724
- }
725
- reverse(payload) {
726
- return payload && this.removeFrom(payload);
727
- }
728
- removeFrom(payload) {
729
- let result = Object.assign({}, payload);
730
- this.toRemove.forEach(str => {
731
- const property = str.split(".");
732
- result = this.removeProperty(result, property);
733
- });
734
- return result;
735
- }
736
- removeProperty(payload, property) {
737
- const result = Object.assign({}, payload);
738
- if (result[property[0]])
739
- if (property.length == 1)
740
- delete result[property[0]];
741
- else
742
- result[property[0]] = this.removeProperty(result[property[0]], property.slice(1));
743
- return result;
744
- }
745
- static create(toRemove) {
746
- return toRemove.length == 0 ? undefined : new Remover(toRemove);
747
- }
748
- }
749
-
750
- var __awaiter$3 = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
751
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
752
- return new (P || (P = Promise))(function (resolve, reject) {
753
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
754
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
755
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
756
- step((generator = generator.apply(thisArg, _arguments || [])).next());
757
- });
758
- };
759
- class Crypto {
760
- constructor(secret, ...properties) {
761
- this.secret = secret;
762
- this.encoder = new TextEncoder();
763
- this.decoder = new TextDecoder();
764
- this.properties = properties.map(p => p.split("."));
765
- }
766
- apply(payload) {
767
- return __awaiter$3(this, void 0, void 0, function* () {
768
- return (payload &&
769
- this.process(payload, value => this.encoder.encode(JSON.stringify(value)), value => encode$1(value, "url")));
770
- });
771
- }
772
- reverse(payload) {
773
- return __awaiter$3(this, void 0, void 0, function* () {
774
- return (payload &&
775
- this.process(payload, value => (typeof value == "string" ? decode$1(value, "url") : new Uint8Array()), value => JSON.parse(this.decoder.decode(value))));
776
- });
777
- }
778
- process(payload, preprocess, postprocess) {
779
- return __awaiter$3(this, void 0, void 0, function* () {
780
- const secret = this.secret + payload.sub + payload.iat;
781
- for (const property of this.properties)
782
- payload = yield this.processProperty(payload, property, secret + property.join("."), preprocess, postprocess);
783
- return payload;
784
- });
785
- }
786
- processProperty(payload, property, secret, preprocess, postprocess) {
787
- return __awaiter$3(this, void 0, void 0, function* () {
788
- const result = Object.assign({}, payload);
789
- if (result[property[0]])
790
- if (property.length == 1) {
791
- const data = preprocess(payload[property[0]]);
792
- const key = yield new Digest("SHA-512").digest(this.encoder.encode(secret));
793
- const processed = new Uint8Array(data.length);
794
- for (let index = 0; index < data.length; index++)
795
- processed[index] = data[index] ^ key[index];
796
- result[property[0]] = postprocess(processed);
797
- }
798
- else
799
- result[property[0]] = yield this.processProperty(result[property[0]], property.slice(1), secret, preprocess, postprocess);
800
- return result;
801
- });
802
- }
803
- static create(secret, ...properties) {
804
- return secret ? new Crypto(secret, ...properties) : Remover.create(properties);
805
- }
806
- }
807
-
808
- class Renamer {
809
- constructor(forwardTransformMap) {
810
- this.forwardTransformMap = forwardTransformMap;
811
- this.createBackwardTransformMap();
812
- }
813
- createBackwardTransformMap() {
814
- const result = {};
815
- for (const key in this.forwardTransformMap) {
816
- result[this.forwardTransformMap[key]] = key;
817
- }
818
- this.backwardTransformMap = result ? result : {};
819
- }
820
- apply(payload) {
821
- return payload && this.remap(payload, true);
822
- }
823
- reverse(payload) {
824
- return payload && this.remap(payload, false);
825
- }
826
- remap(payload, forward) {
827
- const transformMap = forward ? this.forwardTransformMap : this.backwardTransformMap;
828
- const result = {};
829
- for (const key in payload)
830
- if (key in transformMap)
831
- result[transformMap[key]] = this.resolve(payload[key], forward);
832
- else
833
- result[key] = this.resolve(payload[key], forward);
834
- return result;
835
- }
836
- resolve(payload, forward) {
837
- let result;
838
- if (Array.isArray(payload)) {
839
- result = [];
840
- payload.forEach(value => result.push(this.resolve(value, forward)));
841
- }
842
- else
843
- result = typeof payload == "object" ? this.remap(payload, forward) : payload;
844
- return result;
845
- }
846
- }
847
-
848
- var Transformer;
849
- (function (Transformer) {
850
- function is(value) {
851
- return typeof value == "object" && typeof value.apply == "function" && typeof value.reverse == "function";
852
- }
853
- Transformer.is = is;
854
- function create(transformer) {
855
- return {
856
- apply: transformer.apply ? transformer.apply : (v) => v,
857
- reverse: transformer.reverse ? transformer.reverse : (v) => v,
858
- };
859
- }
860
- Transformer.create = create;
861
- })(Transformer || (Transformer = {}));
862
-
863
- class Typeguard {
864
- constructor(...is) {
865
- this.is = is;
866
- }
867
- apply(payload) {
868
- return this.is.some(f => f(payload)) ? payload : undefined;
869
- }
870
- reverse(payload) {
871
- return this.is.some(f => f(payload)) ? payload : undefined;
872
- }
873
- }
874
-
875
- class Actor {
876
- constructor(id) {
877
- this.id = id;
878
- this.transformers = [];
879
- }
880
- add(...argument) {
881
- argument.forEach(value => value && this.transformers.push(Creatable.is(value) ? this.creatableToTransformer(value) : value));
882
- return this;
883
- }
884
- creatableToTransformer(creatable) {
885
- return Creatable.Converter.is(creatable)
886
- ? new Converter$1(creatable)
887
- : Creatable.Crypto.is(creatable)
888
- ? Crypto.create(creatable[0], ...creatable.slice(1))
889
- : new Renamer(creatable);
890
- }
891
- }
892
-
893
- var Asymmetric;
894
- (function (Asymmetric) {
895
- function is(value) {
896
- return (value == "RS256" ||
897
- value == "RS384" ||
898
- value == "RS512" ||
899
- value == "ES256" ||
900
- value == "ES384" ||
901
- value == "ES512" ||
902
- value == "PS256" ||
903
- value == "PS384" ||
904
- value == "PS512");
905
- }
906
- Asymmetric.is = is;
907
- })(Asymmetric || (Asymmetric = {}));
908
-
909
- var Symmetric;
910
- (function (Symmetric) {
911
- function is(value) {
912
- return value == "HS256" || value == "HS384" || value == "HS512";
913
- }
914
- Symmetric.is = is;
915
- })(Symmetric || (Symmetric = {}));
916
-
917
- var Name;
918
- (function (Name) {
919
- function is(value) {
920
- return value == "none" || Symmetric.is(value) || Asymmetric.is(value);
921
- }
922
- Name.is = is;
923
- let Symmetric$1;
924
- (function (Symmetric$1) {
925
- Symmetric$1.is = Symmetric.is;
926
- })(Symmetric$1 = Name.Symmetric || (Name.Symmetric = {}));
927
- let Asymmetric$1;
928
- (function (Asymmetric$1) {
929
- Asymmetric$1.is = Asymmetric.is;
930
- })(Asymmetric$1 = Name.Asymmetric || (Name.Asymmetric = {}));
931
- })(Name || (Name = {}));
932
-
933
- var __awaiter$2 = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
934
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
935
- return new (P || (P = Promise))(function (resolve, reject) {
936
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
937
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
938
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
939
- step((generator = generator.apply(thisArg, _arguments || [])).next());
940
- });
941
- };
942
- class Algorithm {
943
- constructor(name, signer) {
944
- this.name = name;
945
- this.signer = signer;
946
- }
947
- sign(data) {
948
- return __awaiter$2(this, void 0, void 0, function* () {
949
- return typeof data == "string" ? this.signer.sign(data) : this.signer.sign(data);
950
- });
951
- }
952
- verify(data, signature) {
953
- return this.signer.verify(data, signature);
954
- }
955
- static create(name, ...keys) {
956
- let result;
957
- switch (name) {
958
- case "ES256":
959
- result = Signer.create("ECDSA", "SHA-256", keys[0], keys[1]);
960
- break;
961
- case "ES384":
962
- result = Signer.create("ECDSA", "SHA-384", keys[0], keys[1]);
963
- break;
964
- case "ES512":
965
- result = Signer.create("ECDSA", "SHA-512", keys[0], keys[1]);
966
- break;
967
- case "PS256":
968
- result = Signer.create("RSA-PSS", "SHA-256", keys[0], keys[1]);
969
- break;
970
- case "PS384":
971
- result = Signer.create("RSA-PSS", "SHA-384", keys[0], keys[1]);
972
- break;
973
- case "PS512":
974
- result = Signer.create("RSA-PSS", "SHA-512", keys[0], keys[1]);
975
- break;
976
- case "HS256":
977
- result = Signer.create("HMAC", "SHA-256", keys[0]);
978
- break;
979
- case "HS384":
980
- result = Signer.create("HMAC", "SHA-384", keys[0]);
981
- break;
982
- case "HS512":
983
- result = Signer.create("HMAC", "SHA-512", keys[0]);
984
- break;
985
- case "RS256":
986
- result = Signer.create("RSA", "SHA-256", keys[0], keys[1]);
987
- break;
988
- case "RS384":
989
- result = Signer.create("RSA", "SHA-384", keys[0], keys[1]);
990
- break;
991
- case "RS512":
992
- result = Signer.create("RSA", "SHA-512", keys[0], keys[1]);
993
- break;
994
- case "none":
995
- result = Signer.create("None");
996
- break;
997
- }
998
- return result && new Algorithm(name, result);
999
- }
1000
- static none() {
1001
- return Algorithm.create("none");
1002
- }
1003
- static HS256(key) {
1004
- return Algorithm.create("HS256", key);
1005
- }
1006
- static HS384(key) {
1007
- return Algorithm.create("HS384", key);
1008
- }
1009
- static HS512(key) {
1010
- return Algorithm.create("HS512", key);
1011
- }
1012
- static RS256(publicKey, privateKey) {
1013
- return Algorithm.create("RS256", publicKey, privateKey);
1014
- }
1015
- static RS384(publicKey, privateKey) {
1016
- return Algorithm.create("RS384", publicKey, privateKey);
1017
- }
1018
- static RS512(publicKey, privateKey) {
1019
- return Algorithm.create("RS512", publicKey, privateKey);
1020
- }
1021
- static ES256(publicKey, privateKey) {
1022
- return Algorithm.create("ES256", publicKey, privateKey);
1023
- }
1024
- static ES384(publicKey, privateKey) {
1025
- return Algorithm.create("ES384", publicKey, privateKey);
1026
- }
1027
- static ES512(publicKey, privateKey) {
1028
- return Algorithm.create("ES512", publicKey, privateKey);
1029
- }
1030
- static PS256(publicKey, privateKey) {
1031
- return Algorithm.create("PS256", publicKey, privateKey);
1032
- }
1033
- static PS384(publicKey, privateKey) {
1034
- return Algorithm.create("PS384", publicKey, privateKey);
1035
- }
1036
- static PS512(publicKey, privateKey) {
1037
- return Algorithm.create("PS512", publicKey, privateKey);
1038
- }
1039
- }
1040
- (function (Algorithm) {
1041
- let Name$1;
1042
- (function (Name$1) {
1043
- Name$1.is = Name.is;
1044
- let Symmetric;
1045
- (function (Symmetric) {
1046
- Symmetric.is = Name.Symmetric.is;
1047
- })(Symmetric = Name$1.Symmetric || (Name$1.Symmetric = {}));
1048
- let Asymmetric;
1049
- (function (Asymmetric) {
1050
- Asymmetric.is = Name.Asymmetric.is;
1051
- })(Asymmetric = Name$1.Asymmetric || (Name$1.Asymmetric = {}));
1052
- })(Name$1 = Algorithm.Name || (Algorithm.Name = {}));
1053
- })(Algorithm || (Algorithm = {}));
1054
-
1055
- var __awaiter$1 = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
1056
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
1057
- return new (P || (P = Promise))(function (resolve, reject) {
1058
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
1059
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
1060
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
1061
- step((generator = generator.apply(thisArg, _arguments || [])).next());
1062
- });
1063
- };
1064
- class Issuer extends Actor {
1065
- constructor(issuer, algorithm) {
1066
- super(issuer);
1067
- this.algorithm = algorithm;
1068
- }
1069
- get header() {
1070
- return {
1071
- alg: this.algorithm.name,
1072
- typ: "JWT",
1073
- };
1074
- }
1075
- get payload() {
1076
- const result = { iss: this.id, iat: Issuer.issuedAt };
1077
- if (this.audience)
1078
- result.aud = this.audience;
1079
- if (this.duration && result.iat)
1080
- result.exp = result.iat + this.duration;
1081
- return result;
1082
- }
1083
- sign(payload, issuedAt) {
1084
- return __awaiter$1(this, void 0, void 0, function* () {
1085
- payload = Object.assign(Object.assign({}, this.payload), payload);
1086
- if (issuedAt)
1087
- payload.iat = typeof issuedAt == "number" ? issuedAt : issuedAt.getTime() / 1000;
1088
- const transformed = yield this.transformers.reduce((p, c) => __awaiter$1(this, void 0, void 0, function* () { return c.apply(yield p); }), Promise.resolve(payload));
1089
- const data = transformed &&
1090
- `${encode$1(new TextEncoder().encode(JSON.stringify(this.header)), "url")}.${encode$1(new TextEncoder().encode(JSON.stringify(transformed)), "url")}`;
1091
- return data && `${data}.${yield this.algorithm.sign(data)}`;
1092
- });
1093
- }
1094
- static get issuedAt() {
1095
- return Issuer.defaultIssuedAt == undefined
1096
- ? Math.floor(Date.now() / 1000)
1097
- : typeof Issuer.defaultIssuedAt == "number"
1098
- ? Issuer.defaultIssuedAt
1099
- : Math.floor(Issuer.defaultIssuedAt.getTime() / 1000);
1100
- }
1101
- static create(issuer, algorithm) {
1102
- return (algorithm && new Issuer(issuer, algorithm)) || undefined;
1103
- }
1104
- }
1105
-
1106
- var Token;
1107
- (function (Token) {
1108
- function is(value) {
1109
- return typeof value == "string" && /^[A-Za-z0-9-_=]+\.[A-Za-z0-9-_=]+\.?[A-Za-z0-9-_.+/=]*$/.test(value);
1110
- }
1111
- Token.is = is;
1112
- })(Token || (Token = {}));
1113
-
1114
- var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
1115
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
1116
- return new (P || (P = Promise))(function (resolve, reject) {
1117
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
1118
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
1119
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
1120
- step((generator = generator.apply(thisArg, _arguments || [])).next());
1121
- });
1122
- };
1123
- class Verifier extends Actor {
1124
- constructor(...algorithms) {
1125
- super();
1126
- if (algorithms.length > 0) {
1127
- this.algorithms = {};
1128
- for (const algorithm of algorithms)
1129
- if (this.algorithms[algorithm.name])
1130
- this.algorithms[algorithm.name].push(algorithm);
1131
- else
1132
- this.algorithms[algorithm.name] = [algorithm];
1133
- }
1134
- else
1135
- this.algorithms = undefined;
1136
- }
1137
- verify(token, ...audience) {
1138
- return __awaiter(this, void 0, void 0, function* () {
1139
- let result;
1140
- if (token) {
1141
- const splitted = token.split(".", 3);
1142
- if (splitted.length < 2)
1143
- result = undefined;
1144
- else {
1145
- try {
1146
- const oldDecoder = token.includes("/") || token.includes("+");
1147
- const header = JSON.parse(new TextDecoder().decode(decode$1(splitted[0], oldDecoder ? "standard" : "url")));
1148
- result = JSON.parse(new TextDecoder().decode(decode$1(splitted[1], oldDecoder ? "standard" : "url")));
1149
- if (this.algorithms) {
1150
- const algorithm = this.algorithms[header.alg];
1151
- result =
1152
- splitted.length == 3 &&
1153
- algorithm &&
1154
- algorithm.some((a) => __awaiter(this, void 0, void 0, function* () { return yield a.verify(`${splitted[0]}.${splitted[1]}`, splitted[2]); }))
1155
- ? result
1156
- : undefined;
1157
- }
1158
- }
1159
- catch (_a) {
1160
- result = undefined;
1161
- }
1162
- result = result && this.verifyAudience(result.aud, audience) ? result : undefined;
1163
- if (result) {
1164
- const now = Math.floor(Date.now() / 1000);
1165
- if ((result === null || result === void 0 ? void 0 : result.iat) && result.iat > 1000000000000)
1166
- result.iat = Math.floor(result.iat / 1000);
1167
- if ((result === null || result === void 0 ? void 0 : result.exp) && result.exp > 1000000000000)
1168
- result.exp = Math.floor(result.exp / 1000);
1169
- result =
1170
- (result.exp == undefined || result.exp > now) && (result.iat == undefined || result.iat <= now)
1171
- ? result
1172
- : undefined;
1173
- }
1174
- if (result) {
1175
- result.token = token;
1176
- result = yield this.transformers.reduceRight((p, c) => __awaiter(this, void 0, void 0, function* () { return c.reverse(yield p); }), Promise.resolve(result));
1177
- }
1178
- }
1179
- }
1180
- return result;
1181
- });
1182
- }
1183
- verifyAudience(audience, allowed) {
1184
- return (audience == undefined ||
1185
- allowed.length == 0 ||
1186
- (typeof audience == "string" && allowed.some(a => a == audience)) ||
1187
- (Array.isArray(audience) && audience.some(a => allowed.some(ta => ta == a))));
1188
- }
1189
- authenticate(authorization, ...audience) {
1190
- return __awaiter(this, void 0, void 0, function* () {
1191
- return authorization && authorization.startsWith("Bearer ")
1192
- ? this.verify(authorization.substr(7), ...audience)
1193
- : undefined;
1194
- });
1195
- }
1196
- static create(...algorithms) {
1197
- return (((algorithms.length == 0 || algorithms.some(a => !!a)) &&
1198
- new Verifier(...algorithms.filter(a => !!a))) ||
1199
- undefined);
1200
- }
1201
- }
1202
-
1203
- class ClientIdentifier {
1204
- constructor() { }
1205
- static get value() {
1206
- ClientIdentifier.valueCache = localStorage.getItem("clientIdentifier") || undefined;
1207
- if (!ClientIdentifier.valueCache) {
1208
- ClientIdentifier.valueCache = Identifier.generate(12);
1209
- localStorage.setItem("clientIdentifier", ClientIdentifier.valueCache);
1210
- }
1211
- return ClientIdentifier.valueCache;
1212
- }
1213
- }
1214
-
1215
- class Message {
1216
- static is(value) {
1217
- return typeof value == "object" && typeof value.destination == "string" && value.content != undefined;
1218
- }
1219
- static send(message, content, context) {
1220
- if (Message.is(message) && context == undefined) {
1221
- context = content;
1222
- if (!context)
1223
- context = window;
1224
- const destination = message.destination.split("#", 2);
1225
- message = { destination: destination[1], content: message.content };
1226
- context.postMessage(message, destination[0]);
1227
- }
1228
- else if (typeof context != "string") {
1229
- if (!context)
1230
- context = window;
1231
- if (typeof message == "string")
1232
- Message.send({ destination: message, content }, context);
1233
- }
1234
- }
1235
- static listen(origin, handle, context) {
1236
- const splitted = origin.split("#", 2);
1237
- let destination = "";
1238
- if (splitted.length == 2) {
1239
- origin = splitted[0];
1240
- destination = splitted[1];
1241
- }
1242
- ;
1243
- (context || window).addEventListener("message", (e) => {
1244
- const message = e.data;
1245
- if (Message.is(message) &&
1246
- (origin == "*" || e.origin == origin) &&
1247
- (destination == "" || message.destination == destination))
1248
- handle(message.destination, message.content);
1249
- });
1250
- }
1251
- }
1252
-
1253
- class Notice {
1254
- constructor(stateValue, messageValue, task) {
1255
- this.stateValue = stateValue;
1256
- this.messageValue = messageValue;
1257
- this.task = task;
1258
- this.listeners = [];
1259
- switch (stateValue) {
1260
- case "delayed":
1261
- this.timer = window.setTimeout(() => this.execute(), 5000);
1262
- break;
1263
- case "executing":
1264
- this.execute();
1265
- break;
1266
- case "success":
1267
- case "warning":
1268
- case "failed":
1269
- this.startCloseTimer();
1270
- break;
1271
- default:
1272
- break;
1273
- }
1274
- }
1275
- get state() {
1276
- return this.stateValue;
1277
- }
1278
- set state(value) {
1279
- if (this.stateValue != value) {
1280
- this.stateValue = value;
1281
- this.emit();
1282
- }
1283
- }
1284
- get message() {
1285
- return this.messageValue;
1286
- }
1287
- set message(value) {
1288
- if (this.messageValue != value) {
1289
- this.messageValue = value;
1290
- this.emit();
1291
- }
1292
- }
1293
- listen(listener) {
1294
- this.listeners.push(listener);
1295
- }
1296
- unlisten(listener) {
1297
- this.listeners.filter(l => l != listener);
1298
- }
1299
- emit() {
1300
- this.listeners.forEach(l => l(this));
1301
- }
1302
- execute() {
1303
- this.clearTimer();
1304
- if (this.task) {
1305
- this.state = "executing";
1306
- this.task(this).then(r => {
1307
- this.messageValue = r[1];
1308
- this.state = r[0] ? "success" : "failed";
1309
- this.startCloseTimer();
1310
- });
1311
- }
1312
- else
1313
- this.state = "failed";
1314
- }
1315
- startCloseTimer() {
1316
- this.timer = window.setTimeout(() => this.close(), 15000);
1317
- }
1318
- close() {
1319
- this.clearTimer();
1320
- this.state = "closed";
1321
- }
1322
- clearTimer() {
1323
- if (this.timer) {
1324
- window.clearTimeout(this.timer);
1325
- this.timer = undefined;
1326
- }
1327
- }
1328
- static delay(message, task) {
1329
- return new Notice("delayed", message, task);
1330
- }
1331
- static execute(message, task) {
1332
- return new Notice("executing", message, task);
1333
- }
1334
- static succeded(message) {
1335
- return new Notice("success", message);
1336
- }
1337
- static failed(message) {
1338
- return new Notice("failed", message);
1339
- }
1340
- static warn(message) {
1341
- return new Notice("warning", message);
1342
- }
1343
- }
1344
-
1345
- class Trigger {
1346
- static is(value) {
1347
- return typeof value == "object" && typeof value.name == "string";
1348
- }
1349
- }
1350
-
1351
- exports.ClientIdentifier = ClientIdentifier;
1352
- exports.Message = Message;
1353
- exports.Notice = Notice;
1354
- exports.Trigger = Trigger;