ai.touchui-vue 1.30.2 → 1.30.4

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 (786) hide show
  1. package/README.md +21 -21
  2. package/lib/affix.js +2 -2
  3. package/lib/ai.touchui-vue.common.js +2393 -2382
  4. package/lib/align.js +2 -2
  5. package/lib/animation.js +2 -2
  6. package/lib/article.js +2 -2
  7. package/lib/box.js +2 -2
  8. package/lib/button.js +2 -2
  9. package/lib/calendar.js +2 -2
  10. package/lib/card-item.js +2 -2
  11. package/lib/card.js +2 -2
  12. package/lib/cascader.js +2 -2
  13. package/lib/center-scroll.js +2 -2
  14. package/lib/chat.js +7 -7
  15. package/lib/checkbox.js +2 -2
  16. package/lib/checkboxes.js +2 -2
  17. package/lib/collapse.js +8 -7
  18. package/lib/color.js +7 -7
  19. package/lib/countdown.js +2 -2
  20. package/lib/date-picker.js +30 -12
  21. package/lib/date-range.js +13 -14
  22. package/lib/dialog.js +2 -2
  23. package/lib/dis.js +2 -2
  24. package/lib/ellipsis.js +2 -2
  25. package/lib/emote.js +2 -2
  26. package/lib/export.js +5 -5
  27. package/lib/filter.js +2 -2
  28. package/lib/fix.js +2 -2
  29. package/lib/float.js +2 -2
  30. package/lib/flow.js +4 -4
  31. package/lib/form.js +2 -2
  32. package/lib/grid.js +2 -2
  33. package/lib/guider.js +2 -2
  34. package/lib/header.js +2 -2
  35. package/lib/hide.js +2 -2
  36. package/lib/icon.js +2 -2
  37. package/lib/import.js +2 -2
  38. package/lib/index.js +1 -1
  39. package/lib/index.js.LICENSE.txt +4 -0
  40. package/lib/input.js +2 -2
  41. package/lib/ip.js +2 -2
  42. package/lib/line.js +2 -2
  43. package/lib/loading.js +2 -2
  44. package/lib/locale/format.js +10 -10
  45. package/lib/longtap.js +2 -2
  46. package/lib/menu-icon.js +548 -547
  47. package/lib/message.js +2 -2
  48. package/lib/mixins/migrating.js +20 -20
  49. package/lib/mixins/transition.js +14 -14
  50. package/lib/msg.js +2 -2
  51. package/lib/org.js +10 -9
  52. package/lib/padding.js +2 -2
  53. package/lib/page.js +8 -7
  54. package/lib/param.js +2 -2
  55. package/lib/pic.js +2 -2
  56. package/lib/popup.js +2 -2
  57. package/lib/progress.js +2 -2
  58. package/lib/range.js +5 -5
  59. package/lib/rate.js +2 -2
  60. package/lib/reverser.js +2 -2
  61. package/lib/scroll.js +2 -2
  62. package/lib/segment.js +2 -2
  63. package/lib/select.js +2 -2
  64. package/lib/size.js +2 -2
  65. package/lib/skeleton.js +2 -2
  66. package/lib/slide.js +2 -2
  67. package/lib/space.js +2 -2
  68. package/lib/static/{net-mix.293a4b6.svg → net-mix.dc6e414.svg} +7 -7
  69. package/lib/step.js +2 -2
  70. package/lib/submit.js +2 -2
  71. package/lib/switch.js +2 -2
  72. package/lib/tab.js +2 -2
  73. package/lib/table.js +736 -742
  74. package/lib/tag.js +2 -2
  75. package/lib/timeline.js +2 -2
  76. package/lib/tip.js +2 -2
  77. package/lib/tooltip.js +2 -2
  78. package/lib/transfer.js +2 -2
  79. package/lib/tree.js +2 -2
  80. package/lib/upload.js +2 -2
  81. package/lib/utils/clickoutside.js +11 -11
  82. package/lib/utils/dom.js +13 -13
  83. package/lib/utils/filetransfer.js +4 -4
  84. package/lib/utils/jsencrypt/JSEncrypt.js +77 -77
  85. package/lib/utils/jsencrypt/JSEncryptRSAKey.js +115 -115
  86. package/lib/utils/jsencrypt/jselib/asn1js/asn1.js +4 -4
  87. package/lib/utils/jsencrypt/jselib/jsrsasign/asn1-1.0.js +734 -734
  88. package/lib/utils/jsencrypt/jselib/jsrsasign/yahoo.js +22 -22
  89. package/lib/utils/jsencrypt.js +260 -260
  90. package/lib/utils/md5.js +3 -3
  91. package/lib/utils/mime.js +2 -2
  92. package/lib/utils/ratio.js +54 -53
  93. package/lib/utils/sign.js +12 -12
  94. package/lib/utils/util.js +3 -3
  95. package/lib/utils/validate.js +11 -11
  96. package/package.json +160 -159
  97. package/packages/affix/index.js +8 -8
  98. package/packages/affix/src/affix.vue +139 -139
  99. package/packages/align/index.js +8 -8
  100. package/packages/align/src/directive.js +29 -29
  101. package/packages/animation/index.js +8 -8
  102. package/packages/animation/src/animation.vue +68 -68
  103. package/packages/article/index.js +8 -8
  104. package/packages/article/src/article.vue +23 -23
  105. package/packages/box/index.js +8 -8
  106. package/packages/box/src/box.vue +170 -170
  107. package/packages/button/index.js +8 -8
  108. package/packages/button/src/button.vue +162 -162
  109. package/packages/calendar/index.js +8 -8
  110. package/packages/calendar/src/calendar.vue +1142 -1142
  111. package/packages/card/index.js +10 -10
  112. package/packages/card/src/card-item.vue +92 -92
  113. package/packages/card/src/card.vue +175 -175
  114. package/packages/card-item/index.js +8 -8
  115. package/packages/cascader/index.js +8 -8
  116. package/packages/cascader/src/cascader.vue +814 -814
  117. package/packages/center-scroll/index.js +8 -8
  118. package/packages/center-scroll/src/center-scroll.vue +147 -147
  119. package/packages/chat/index.js +12 -12
  120. package/packages/chat/src/chat.vue +116 -116
  121. package/packages/checkbox/index.js +8 -8
  122. package/packages/checkbox/src/checkbox.vue +262 -262
  123. package/packages/checkboxes/index.js +8 -8
  124. package/packages/checkboxes/src/checkboxes.vue +97 -97
  125. package/packages/collapse/index.js +10 -10
  126. package/packages/collapse/src/collapse-item.vue +188 -188
  127. package/packages/collapse/src/collapse.vue +100 -100
  128. package/packages/color/index.js +8 -8
  129. package/packages/color/src/directive.js +42 -42
  130. package/packages/countdown/index.js +8 -8
  131. package/packages/countdown/src/countdown.vue +128 -128
  132. package/packages/date-picker/index.js +8 -8
  133. package/packages/date-picker/src/date-picker.vue +436 -432
  134. package/packages/date-picker/src/picker.vue +342 -342
  135. package/packages/date-range/index.js +8 -8
  136. package/packages/date-range/src/date-range.vue +384 -384
  137. package/packages/dialog/index.js +8 -8
  138. package/packages/dialog/src/dialog.vue +287 -287
  139. package/packages/dis/index.js +8 -8
  140. package/packages/dis/src/directive.js +42 -42
  141. package/packages/ellipsis/index.js +8 -8
  142. package/packages/ellipsis/src/ellipsis.vue +306 -306
  143. package/packages/emote/index.js +8 -8
  144. package/packages/emote/src/emote.vue +38 -38
  145. package/packages/export/index.js +8 -8
  146. package/packages/export/src/ajax.js +73 -73
  147. package/packages/export/src/export.vue +289 -289
  148. package/packages/filter/index.js +8 -8
  149. package/packages/filter/src/filter.vue +245 -245
  150. package/packages/fix/index.js +8 -8
  151. package/packages/fix/src/fix.vue +221 -221
  152. package/packages/float/index.js +16 -16
  153. package/packages/float/src/directive.js +20 -20
  154. package/packages/float/src/main.vue +642 -642
  155. package/packages/float/src/trigger.vue +31 -31
  156. package/packages/flow/index.js +8 -8
  157. package/packages/flow/src/flow.vue +234 -234
  158. package/packages/flow/src/flowItem.vue +61 -61
  159. package/packages/flow/src/flowLine.vue +168 -168
  160. package/packages/form/index.js +10 -10
  161. package/packages/form/src/form-item.vue +96 -96
  162. package/packages/form/src/form.vue +184 -184
  163. package/packages/grid/index.js +10 -10
  164. package/packages/grid/src/grid-item.vue +65 -65
  165. package/packages/grid/src/grid.vue +190 -190
  166. package/packages/grid-item/index.js +8 -8
  167. package/packages/guider/index.js +8 -8
  168. package/packages/guider/src/guider.vue +168 -168
  169. package/packages/header/index.js +8 -8
  170. package/packages/header/src/header.vue +111 -111
  171. package/packages/hide/index.js +8 -8
  172. package/packages/hide/src/directive.js +57 -57
  173. package/packages/icon/index.js +8 -8
  174. package/packages/icon/src/icon.vue +79 -79
  175. package/packages/import/index.js +8 -8
  176. package/packages/import/src/import.vue +279 -279
  177. package/packages/input/index.js +8 -8
  178. package/packages/input/src/calcTextareaHeight.js +104 -104
  179. package/packages/input/src/input.vue +653 -653
  180. package/packages/ip/index.js +8 -8
  181. package/packages/ip/src/ip.vue +143 -143
  182. package/packages/line/index.js +8 -8
  183. package/packages/line/src/line.vue +29 -29
  184. package/packages/loading/index.js +8 -8
  185. package/packages/loading/src/loading.js +58 -58
  186. package/packages/longtap/index.js +8 -8
  187. package/packages/longtap/src/longtap.js +95 -95
  188. package/packages/menu-icon/index.js +8 -8
  189. package/packages/menu-icon/src/menu-icon.vue +206 -206
  190. package/packages/message/index.js +8 -8
  191. package/packages/message/src/message.vue +9 -9
  192. package/packages/msg/index.js +8 -8
  193. package/packages/msg/src/msg.vue +227 -227
  194. package/packages/org/index.js +8 -8
  195. package/packages/org/src/org.vue +113 -113
  196. package/packages/org/src/orgItem.vue +63 -63
  197. package/packages/padding/index.js +8 -8
  198. package/packages/padding/src/padding.vue +105 -105
  199. package/packages/page/index.js +8 -8
  200. package/packages/page/src/page.vue +297 -297
  201. package/packages/param/index.js +8 -8
  202. package/packages/param/src/param.vue +226 -226
  203. package/packages/pic/index.js +8 -8
  204. package/packages/pic/src/pic-viewer.vue +331 -331
  205. package/packages/pic/src/pic.vue +144 -144
  206. package/packages/popup/index.js +12 -12
  207. package/packages/popup/src/popup-group.vue +47 -47
  208. package/packages/popup/src/popup-item.vue +163 -163
  209. package/packages/popup/src/popup.vue +350 -350
  210. package/packages/progress/index.js +8 -8
  211. package/packages/progress/src/progress.vue +306 -306
  212. package/packages/range/index.js +8 -8
  213. package/packages/range/src/range.vue +612 -612
  214. package/packages/rate/index.js +8 -8
  215. package/packages/rate/src/rate.vue +129 -129
  216. package/packages/reverser/index.js +8 -8
  217. package/packages/reverser/src/reverser.vue +49 -49
  218. package/packages/scroll/index.js +12 -12
  219. package/packages/scroll/src/scroll-point.vue +24 -24
  220. package/packages/scroll/src/scroll-sticky.vue +60 -60
  221. package/packages/scroll/src/scroll.vue +381 -381
  222. package/packages/segment/index.js +8 -8
  223. package/packages/segment/src/segment.vue +618 -618
  224. package/packages/select/index.js +8 -8
  225. package/packages/select/src/select.vue +1445 -1445
  226. package/packages/size/index.js +8 -8
  227. package/packages/size/src/directive.js +33 -33
  228. package/packages/skeleton/index.js +8 -8
  229. package/packages/skeleton/src/skeleton.vue +179 -179
  230. package/packages/slide/index.js +8 -8
  231. package/packages/slide/src/slide.vue +147 -147
  232. package/packages/space/index.js +8 -8
  233. package/packages/space/src/space.vue +53 -53
  234. package/packages/step/index.js +8 -8
  235. package/packages/step/src/step.vue +122 -122
  236. package/packages/submit/index.js +8 -8
  237. package/packages/submit/src/submit.vue +103 -103
  238. package/packages/switch/index.js +9 -9
  239. package/packages/switch/src/component.vue +131 -131
  240. package/packages/tab/index.js +10 -10
  241. package/packages/tab/src/tab-item.vue +85 -85
  242. package/packages/tab/src/tab.vue +590 -590
  243. package/packages/table/index.js +8 -8
  244. package/packages/table/src/table-body.vue +301 -301
  245. package/packages/table/src/table-config.vue +139 -139
  246. package/packages/table/src/table-head.vue +239 -239
  247. package/packages/table/src/table.vue +1455 -1458
  248. package/packages/tag/index.js +8 -8
  249. package/packages/tag/src/tag.vue +129 -129
  250. package/packages/theme/package.json +33 -33
  251. package/packages/theme/src/global/mixin.less +416 -416
  252. package/packages/theme/src/global/reset.less +27 -27
  253. package/packages/theme/src/less/component/affix.less +8 -8
  254. package/packages/theme/src/less/component/article-dark.less +6 -6
  255. package/packages/theme/src/less/component/article.less +39 -39
  256. package/packages/theme/src/less/component/box-dark.less +85 -85
  257. package/packages/theme/src/less/component/box.less +272 -272
  258. package/packages/theme/src/less/component/calendar-dark.less +111 -111
  259. package/packages/theme/src/less/component/calendar.less +282 -282
  260. package/packages/theme/src/less/component/card-dark.less +17 -17
  261. package/packages/theme/src/less/component/card.less +89 -89
  262. package/packages/theme/src/less/component/chat-dark.less +47 -47
  263. package/packages/theme/src/less/component/chat.less +71 -71
  264. package/packages/theme/src/less/component/code-dark.less +41 -41
  265. package/packages/theme/src/less/component/code.less +33 -33
  266. package/packages/theme/src/less/component/cover.less +4 -4
  267. package/packages/theme/src/less/component/dialog-dark.less +54 -54
  268. package/packages/theme/src/less/component/dialog.less +49 -49
  269. package/packages/theme/src/less/component/filter-dark.less +31 -31
  270. package/packages/theme/src/less/component/filter.less +97 -97
  271. package/packages/theme/src/less/component/float-dark.less +26 -26
  272. package/packages/theme/src/less/component/float.less +61 -61
  273. package/packages/theme/src/less/component/form-dark.less +45 -45
  274. package/packages/theme/src/less/component/form.less +322 -322
  275. package/packages/theme/src/less/component/gantt-dark.less +44 -44
  276. package/packages/theme/src/less/component/gantt.less +52 -52
  277. package/packages/theme/src/less/component/guider-dark.less +6 -6
  278. package/packages/theme/src/less/component/guider.less +15 -15
  279. package/packages/theme/src/less/component/header-dark.less +41 -41
  280. package/packages/theme/src/less/component/header.less +121 -121
  281. package/packages/theme/src/less/component/keyboard-dark.less +15 -15
  282. package/packages/theme/src/less/component/keyboard.less +21 -21
  283. package/packages/theme/src/less/component/line-dark.less +20 -20
  284. package/packages/theme/src/less/component/line.less +21 -21
  285. package/packages/theme/src/less/component/msg-dark.less +42 -42
  286. package/packages/theme/src/less/component/msg.less +102 -102
  287. package/packages/theme/src/less/component/page-dark.less +26 -26
  288. package/packages/theme/src/less/component/page.less +26 -26
  289. package/packages/theme/src/less/component/param-dark.less +31 -31
  290. package/packages/theme/src/less/component/param.less +136 -136
  291. package/packages/theme/src/less/component/popup-dark.less +20 -20
  292. package/packages/theme/src/less/component/popup.less +85 -85
  293. package/packages/theme/src/less/component/print.less +121 -121
  294. package/packages/theme/src/less/component/scroll-dark.less +19 -19
  295. package/packages/theme/src/less/component/scroll.less +47 -47
  296. package/packages/theme/src/less/component/skeleton-dark.less +29 -29
  297. package/packages/theme/src/less/component/skeleton.less +78 -78
  298. package/packages/theme/src/less/component/slide.less +70 -70
  299. package/packages/theme/src/less/component/space.less +2 -2
  300. package/packages/theme/src/less/component/step-dark.less +165 -165
  301. package/packages/theme/src/less/component/step.less +147 -147
  302. package/packages/theme/src/less/component/submit.less +40 -40
  303. package/packages/theme/src/less/component/tab-dark.less +221 -221
  304. package/packages/theme/src/less/component/tab.less +459 -459
  305. package/packages/theme/src/less/component/table-dark.less +196 -196
  306. package/packages/theme/src/less/component/table.less +425 -425
  307. package/packages/theme/src/less/component/timeline-dark.less +13 -13
  308. package/packages/theme/src/less/component/timeline.less +114 -114
  309. package/packages/theme/src/less/component/tip-dark.less +76 -76
  310. package/packages/theme/src/less/component/tip.less +139 -139
  311. package/packages/theme/src/less/component/tooltip-dark.less +105 -105
  312. package/packages/theme/src/less/component/tooltip.less +159 -159
  313. package/packages/theme/src/less/component/tree-dark.less +56 -56
  314. package/packages/theme/src/less/component/tree.less +148 -148
  315. package/packages/theme/src/less/element/align.less +32 -32
  316. package/packages/theme/src/less/element/animation.less +5 -5
  317. package/packages/theme/src/less/element/button-dark.less +29 -29
  318. package/packages/theme/src/less/element/button.less +65 -65
  319. package/packages/theme/src/less/element/center-scroll-dark.less +3 -3
  320. package/packages/theme/src/less/element/center-scroll.less +6 -6
  321. package/packages/theme/src/less/element/checkbox-dark.less +68 -68
  322. package/packages/theme/src/less/element/checkbox.less +73 -73
  323. package/packages/theme/src/less/element/color-dark.less +15 -15
  324. package/packages/theme/src/less/element/color.less +33 -33
  325. package/packages/theme/src/less/element/dis.less +9 -9
  326. package/packages/theme/src/less/element/ellipsis.less +35 -35
  327. package/packages/theme/src/less/element/emote.less +5 -5
  328. package/packages/theme/src/less/element/font-dark.less +9 -9
  329. package/packages/theme/src/less/element/font.less +8 -8
  330. package/packages/theme/src/less/element/hide-dark.less +114 -114
  331. package/packages/theme/src/less/element/hide.less +114 -114
  332. package/packages/theme/src/less/element/icon.less +297 -297
  333. package/packages/theme/src/less/element/input-dark.less +205 -205
  334. package/packages/theme/src/less/element/input.less +405 -405
  335. package/packages/theme/src/less/element/menu-icon.less +1 -1
  336. package/packages/theme/src/less/element/pic.less +18 -18
  337. package/packages/theme/src/less/element/progress-dark.less +37 -37
  338. package/packages/theme/src/less/element/progress.less +82 -82
  339. package/packages/theme/src/less/element/radio-dark.less +18 -18
  340. package/packages/theme/src/less/element/radio.less +11 -11
  341. package/packages/theme/src/less/element/range-dark.less +24 -24
  342. package/packages/theme/src/less/element/range.less +56 -56
  343. package/packages/theme/src/less/element/rate.less +17 -17
  344. package/packages/theme/src/less/element/segment-dark.less +119 -119
  345. package/packages/theme/src/less/element/segment.less +197 -197
  346. package/packages/theme/src/less/element/select-dark.less +167 -167
  347. package/packages/theme/src/less/element/select.less +431 -431
  348. package/packages/theme/src/less/element/size.less +10 -10
  349. package/packages/theme/src/less/element/switch-dark.less +7 -7
  350. package/packages/theme/src/less/element/switch.less +37 -37
  351. package/packages/theme/src/less/element/tag-dark.less +115 -115
  352. package/packages/theme/src/less/element/tag.less +159 -159
  353. package/packages/theme/src/less/element/upload-dark.less +26 -26
  354. package/packages/theme/src/less/element/upload.less +64 -64
  355. package/packages/theme/src/less/layout/fix.less +2 -2
  356. package/packages/theme/src/less/layout/flow.less +47 -47
  357. package/packages/theme/src/less/layout/grid-dark.less +28 -28
  358. package/packages/theme/src/less/layout/grid.less +172 -172
  359. package/packages/theme/src/less/layout/org-dark.less +2 -2
  360. package/packages/theme/src/less/layout/org.less +72 -72
  361. package/packages/theme/src/less/layout/padding.less +1 -1
  362. package/packages/theme/src/less/layout/reverser.less +8 -8
  363. package/packages/theme/src/less/theme/B-Design.less +159 -159
  364. package/packages/theme/src/less/theme/aiplan.less +159 -159
  365. package/packages/theme/src/less/theme/aiplangd.less +159 -159
  366. package/packages/theme/src/less/theme/chbn.less +159 -159
  367. package/packages/theme/src/less/theme/default.less +160 -160
  368. package/packages/theme/src/less/theme/dt.less +159 -159
  369. package/packages/theme/src/less/theme/ecloud.less +159 -159
  370. package/packages/theme/src/less/theme/hongkong.less +159 -159
  371. package/packages/theme/src/less/theme/narrow.less +160 -160
  372. package/packages/theme/src/less/theme/sdpf.less +160 -160
  373. package/packages/theme/src/less/theme/upc.less +159 -159
  374. package/packages/theme/src/less/theme/website.less +159 -159
  375. package/packages/theme/src/less/theme/zj.less +159 -159
  376. package/packages/timeline/index.js +8 -8
  377. package/packages/timeline/src/timeline.vue +84 -84
  378. package/packages/tip/index.js +8 -8
  379. package/packages/tip/src/tip.vue +226 -226
  380. package/packages/tooltip/index.js +8 -8
  381. package/packages/tooltip/src/directive.js +180 -180
  382. package/packages/tooltip/src/tooltip.vue +467 -467
  383. package/packages/transfer/index.js +8 -8
  384. package/packages/transfer/src/transfer.vue +293 -293
  385. package/packages/tree/index.js +8 -8
  386. package/packages/tree/src/tree.vue +518 -518
  387. package/packages/tree/src/treeItem.vue +443 -443
  388. package/packages/upload/index.js +8 -8
  389. package/packages/upload/src/upload.vue +860 -860
  390. package/src/index.js +207 -207
  391. package/src/locale/format.js +46 -46
  392. package/src/locale/index.js +48 -48
  393. package/src/locale/lang/en.js +207 -207
  394. package/src/locale/lang/zh-CN.js +207 -207
  395. package/src/mixins/blur.js +9 -9
  396. package/src/mixins/emitter.js +33 -33
  397. package/src/mixins/focus.js +9 -9
  398. package/src/mixins/locale.js +9 -9
  399. package/src/mixins/migrating.js +54 -54
  400. package/src/mixins/tip.js +10 -10
  401. package/src/mixins/transition.js +130 -130
  402. package/src/msg/index.js +107 -107
  403. package/src/svg/menu/main/abnormal-mix.svg +5 -5
  404. package/src/svg/menu/main/abnormal.svg +5 -5
  405. package/src/svg/menu/main/accountManager-mix.svg +5 -5
  406. package/src/svg/menu/main/accountManager.svg +5 -5
  407. package/src/svg/menu/main/agreement-mix.svg +7 -7
  408. package/src/svg/menu/main/agreement.svg +7 -7
  409. package/src/svg/menu/main/ai-mix.svg +5 -5
  410. package/src/svg/menu/main/archives-mix.svg +6 -6
  411. package/src/svg/menu/main/arrearsReport-mix.svg +17 -17
  412. package/src/svg/menu/main/arrearsReport.svg +17 -17
  413. package/src/svg/menu/main/bill-mix.svg +13 -13
  414. package/src/svg/menu/main/bill.svg +13 -13
  415. package/src/svg/menu/main/box-mix.svg +5 -5
  416. package/src/svg/menu/main/broadband-mix.svg +4 -4
  417. package/src/svg/menu/main/broadband.svg +4 -4
  418. package/src/svg/menu/main/card-mix.svg +5 -5
  419. package/src/svg/menu/main/card.svg +5 -5
  420. package/src/svg/menu/main/cash-mix.svg +5 -5
  421. package/src/svg/menu/main/cash.svg +5 -5
  422. package/src/svg/menu/main/cloud-mix.svg +4 -4
  423. package/src/svg/menu/main/cloud.svg +4 -4
  424. package/src/svg/menu/main/clue-mix.svg +10 -10
  425. package/src/svg/menu/main/clue.svg +10 -10
  426. package/src/svg/menu/main/commonUse-mix.svg +4 -4
  427. package/src/svg/menu/main/commonUse.svg +4 -4
  428. package/src/svg/menu/main/construction-mix.svg +7 -7
  429. package/src/svg/menu/main/construction.svg +7 -7
  430. package/src/svg/menu/main/contract-mix.svg +8 -8
  431. package/src/svg/menu/main/contract.svg +8 -8
  432. package/src/svg/menu/main/credit-mix.svg +5 -5
  433. package/src/svg/menu/main/credit.svg +5 -5
  434. package/src/svg/menu/main/data-mix.svg +5 -5
  435. package/src/svg/menu/main/data.svg +5 -5
  436. package/src/svg/menu/main/date-mix.svg +7 -7
  437. package/src/svg/menu/main/deposit-mix.svg +4 -4
  438. package/src/svg/menu/main/device-mix.svg +4 -4
  439. package/src/svg/menu/main/device.svg +4 -4
  440. package/src/svg/menu/main/discrepancy-mix.svg +5 -5
  441. package/src/svg/menu/main/door-mix.svg +6 -6
  442. package/src/svg/menu/main/fault-mix.svg +12 -12
  443. package/src/svg/menu/main/fault.svg +16 -16
  444. package/src/svg/menu/main/finance-mix.svg +11 -11
  445. package/src/svg/menu/main/finance.svg +13 -13
  446. package/src/svg/menu/main/flow-mix.svg +4 -4
  447. package/src/svg/menu/main/flow.svg +4 -4
  448. package/src/svg/menu/main/folder-mix.svg +4 -4
  449. package/src/svg/menu/main/folder.svg +4 -4
  450. package/src/svg/menu/main/friendly-mix.svg +5 -5
  451. package/src/svg/menu/main/fusion-mix.svg +5 -5
  452. package/src/svg/menu/main/fusion.svg +5 -5
  453. package/src/svg/menu/main/gift-mix.svg +8 -8
  454. package/src/svg/menu/main/gift.svg +8 -8
  455. package/src/svg/menu/main/gps-mix.svg +6 -6
  456. package/src/svg/menu/main/gps.svg +6 -6
  457. package/src/svg/menu/main/grid-mix.svg +7 -7
  458. package/src/svg/menu/main/grid.svg +7 -7
  459. package/src/svg/menu/main/group-mix.svg +4 -4
  460. package/src/svg/menu/main/group.svg +4 -4
  461. package/src/svg/menu/main/home-mix.svg +5 -5
  462. package/src/svg/menu/main/home.svg +8 -8
  463. package/src/svg/menu/main/ict-mix.svg +4 -4
  464. package/src/svg/menu/main/industry-mix.svg +5 -5
  465. package/src/svg/menu/main/industry.svg +5 -5
  466. package/src/svg/menu/main/info-mix.svg +9 -9
  467. package/src/svg/menu/main/info.svg +9 -9
  468. package/src/svg/menu/main/integral-mix.svg +5 -5
  469. package/src/svg/menu/main/integral.svg +5 -5
  470. package/src/svg/menu/main/internet-mix.svg +5 -5
  471. package/src/svg/menu/main/internet.svg +5 -5
  472. package/src/svg/menu/main/inventory-mix.svg +5 -5
  473. package/src/svg/menu/main/invoice-mix.svg +6 -6
  474. package/src/svg/menu/main/invoice.svg +14 -14
  475. package/src/svg/menu/main/iot-mix.svg +5 -5
  476. package/src/svg/menu/main/iot.svg +5 -5
  477. package/src/svg/menu/main/label-mix.svg +4 -4
  478. package/src/svg/menu/main/label.svg +4 -4
  479. package/src/svg/menu/main/love-mix.svg +6 -6
  480. package/src/svg/menu/main/love.svg +13 -13
  481. package/src/svg/menu/main/m1-mix.svg +4 -4
  482. package/src/svg/menu/main/m1.svg +4 -4
  483. package/src/svg/menu/main/m2-mix.svg +12 -12
  484. package/src/svg/menu/main/m2.svg +11 -11
  485. package/src/svg/menu/main/m3-mix.svg +6 -6
  486. package/src/svg/menu/main/m3.svg +7 -7
  487. package/src/svg/menu/main/m4-mix.svg +5 -5
  488. package/src/svg/menu/main/m4.svg +7 -7
  489. package/src/svg/menu/main/m5-mix.svg +8 -8
  490. package/src/svg/menu/main/m5.svg +10 -10
  491. package/src/svg/menu/main/mail-mix.svg +5 -5
  492. package/src/svg/menu/main/manual-mix.svg +11 -11
  493. package/src/svg/menu/main/manual.svg +11 -11
  494. package/src/svg/menu/main/market-mix.svg +4 -4
  495. package/src/svg/menu/main/market.svg +4 -4
  496. package/src/svg/menu/main/member-mix.svg +6 -6
  497. package/src/svg/menu/main/member.svg +6 -6
  498. package/src/svg/menu/main/menu-mix.svg +4 -4
  499. package/src/svg/menu/main/menu.svg +4 -4
  500. package/src/svg/menu/main/message-mix.svg +11 -11
  501. package/src/svg/menu/main/message.svg +11 -11
  502. package/src/svg/menu/main/namelist-mix.svg +4 -4
  503. package/src/svg/menu/main/namelist.svg +4 -4
  504. package/src/svg/menu/main/net-mix.svg +7 -7
  505. package/src/svg/menu/main/niche-mix.svg +12 -12
  506. package/src/svg/menu/main/niche.svg +12 -12
  507. package/src/svg/menu/main/notice-mix.svg +4 -4
  508. package/src/svg/menu/main/notice.svg +4 -4
  509. package/src/svg/menu/main/number-mix.svg +6 -6
  510. package/src/svg/menu/main/operations-mix.svg +4 -4
  511. package/src/svg/menu/main/operations.svg +4 -4
  512. package/src/svg/menu/main/order-mix.svg +8 -8
  513. package/src/svg/menu/main/order.svg +8 -8
  514. package/src/svg/menu/main/person-mix.svg +6 -6
  515. package/src/svg/menu/main/person.svg +6 -6
  516. package/src/svg/menu/main/phone-mix.svg +4 -4
  517. package/src/svg/menu/main/phone.svg +4 -4
  518. package/src/svg/menu/main/phoneBill-mix.svg +6 -6
  519. package/src/svg/menu/main/phoneBill.svg +6 -6
  520. package/src/svg/menu/main/preferential-mix.svg +5 -5
  521. package/src/svg/menu/main/preferential.svg +5 -5
  522. package/src/svg/menu/main/print-mix.svg +5 -5
  523. package/src/svg/menu/main/problem-mix.svg +4 -4
  524. package/src/svg/menu/main/problem.svg +4 -4
  525. package/src/svg/menu/main/process-mix.svg +4 -4
  526. package/src/svg/menu/main/process.svg +4 -4
  527. package/src/svg/menu/main/product-mix.svg +5 -5
  528. package/src/svg/menu/main/product.svg +6 -6
  529. package/src/svg/menu/main/qrCode-mix.svg +8 -8
  530. package/src/svg/menu/main/qrCode.svg +8 -8
  531. package/src/svg/menu/main/refuelingBag-mix-mix.svg +4 -4
  532. package/src/svg/menu/main/refuelingBag-mix.svg +4 -4
  533. package/src/svg/menu/main/reportForm-mix.svg +8 -8
  534. package/src/svg/menu/main/reportForm.svg +8 -8
  535. package/src/svg/menu/main/risk-mix.svg +16 -16
  536. package/src/svg/menu/main/risk.svg +17 -17
  537. package/src/svg/menu/main/robot-mix.svg +9 -9
  538. package/src/svg/menu/main/robot.svg +9 -9
  539. package/src/svg/menu/main/satisfaction-mix.svg +4 -4
  540. package/src/svg/menu/main/satisfaction.svg +4 -4
  541. package/src/svg/menu/main/scratchCard-mix.svg +4 -4
  542. package/src/svg/menu/main/sim-mix.svg +4 -4
  543. package/src/svg/menu/main/sim.svg +4 -4
  544. package/src/svg/menu/main/staging-mix.svg +4 -4
  545. package/src/svg/menu/main/staging.svg +4 -4
  546. package/src/svg/menu/main/survey-mix.svg +5 -5
  547. package/src/svg/menu/main/survey.svg +5 -5
  548. package/src/svg/menu/main/tasks-mix.svg +8 -8
  549. package/src/svg/menu/main/tasks.svg +8 -8
  550. package/src/svg/menu/main/telephone-mix.svg +4 -4
  551. package/src/svg/menu/main/topUp-mix.svg +5 -5
  552. package/src/svg/menu/main/trajectory-mix.svg +11 -11
  553. package/src/svg/menu/main/trajectory.svg +23 -23
  554. package/src/svg/menu/main/transmit-mix.svg +5 -5
  555. package/src/svg/menu/main/tv-mix.svg +6 -6
  556. package/src/svg/menu/main/unlock-mix.svg +4 -4
  557. package/src/svg/menu/main/unlock.svg +4 -4
  558. package/src/svg/menu/main/view-mix.svg +5 -5
  559. package/src/svg/menu/main/view.svg +5 -5
  560. package/src/svg/menu/main/visits-mix.svg +19 -19
  561. package/src/svg/menu/main/visits.svg +19 -19
  562. package/src/svg/menu/main/voice-mix.svg +4 -4
  563. package/src/svg/menu/main/voice.svg +4 -4
  564. package/src/svg/menu/main/wiki-mix.svg +4 -4
  565. package/src/svg/menu/main/wiki.svg +4 -4
  566. package/src/svg/menu/main/workOrder-mix.svg +6 -6
  567. package/src/svg/menu/main/workOrder.svg +14 -14
  568. package/src/svg/menu/patch/Mo-space.svg +2 -2
  569. package/src/svg/menu/patch/Mo.svg +3 -3
  570. package/src/svg/menu/patch/add-space.svg +3 -3
  571. package/src/svg/menu/patch/add.svg +3 -3
  572. package/src/svg/menu/patch/address-space.svg +3 -3
  573. package/src/svg/menu/patch/address.svg +3 -3
  574. package/src/svg/menu/patch/approve-space.svg +3 -3
  575. package/src/svg/menu/patch/approve.svg +4 -4
  576. package/src/svg/menu/patch/avoid-space.svg +3 -3
  577. package/src/svg/menu/patch/avoid.svg +3 -3
  578. package/src/svg/menu/patch/batch-space.svg +3 -3
  579. package/src/svg/menu/patch/batch.svg +5 -5
  580. package/src/svg/menu/patch/broadband-space.svg +3 -3
  581. package/src/svg/menu/patch/broadband.svg +4 -4
  582. package/src/svg/menu/patch/cancellation-space.svg +3 -3
  583. package/src/svg/menu/patch/cancellation.svg +3 -3
  584. package/src/svg/menu/patch/center-space.svg +3 -3
  585. package/src/svg/menu/patch/center.svg +5 -5
  586. package/src/svg/menu/patch/change-space.svg +3 -3
  587. package/src/svg/menu/patch/change.svg +4 -4
  588. package/src/svg/menu/patch/click-space.svg +3 -3
  589. package/src/svg/menu/patch/click.svg +4 -4
  590. package/src/svg/menu/patch/close-1-space.svg +3 -3
  591. package/src/svg/menu/patch/close-1.svg +3 -3
  592. package/src/svg/menu/patch/close-space.svg +2 -2
  593. package/src/svg/menu/patch/close.svg +3 -3
  594. package/src/svg/menu/patch/collect-space.svg +3 -3
  595. package/src/svg/menu/patch/collect.svg +3 -3
  596. package/src/svg/menu/patch/comment-space.svg +3 -3
  597. package/src/svg/menu/patch/comment.svg +3 -3
  598. package/src/svg/menu/patch/confirm-space.svg +3 -3
  599. package/src/svg/menu/patch/confirm.svg +3 -3
  600. package/src/svg/menu/patch/contract-space.svg +3 -3
  601. package/src/svg/menu/patch/contract.svg +3 -3
  602. package/src/svg/menu/patch/credit-space.svg +3 -3
  603. package/src/svg/menu/patch/credit.svg +5 -5
  604. package/src/svg/menu/patch/dataMonitoring-space.svg +3 -3
  605. package/src/svg/menu/patch/dataMonitoring.svg +3 -3
  606. package/src/svg/menu/patch/dedicatedCircuit-space.svg +3 -3
  607. package/src/svg/menu/patch/dedicatedCircuit.svg +3 -3
  608. package/src/svg/menu/patch/detail-space.svg +3 -3
  609. package/src/svg/menu/patch/detail.svg +3 -3
  610. package/src/svg/menu/patch/disassemb-space.svg +3 -3
  611. package/src/svg/menu/patch/disassemb.svg +3 -3
  612. package/src/svg/menu/patch/earnestMoney-space.svg +3 -3
  613. package/src/svg/menu/patch/earnestMoney.svg +3 -3
  614. package/src/svg/menu/patch/empower-space.svg +3 -3
  615. package/src/svg/menu/patch/empower.svg +3 -3
  616. package/src/svg/menu/patch/entrust-space.svg +3 -3
  617. package/src/svg/menu/patch/entrust.svg +3 -3
  618. package/src/svg/menu/patch/expedite-space.svg +4 -4
  619. package/src/svg/menu/patch/expedite.svg +4 -4
  620. package/src/svg/menu/patch/flow-space.svg +3 -3
  621. package/src/svg/menu/patch/flow.svg +3 -3
  622. package/src/svg/menu/patch/folder-space.svg +3 -3
  623. package/src/svg/menu/patch/folder.svg +3 -3
  624. package/src/svg/menu/patch/forbidden-space.svg +3 -3
  625. package/src/svg/menu/patch/forbidden.svg +3 -3
  626. package/src/svg/menu/patch/forward-space.svg +3 -3
  627. package/src/svg/menu/patch/forward.svg +3 -3
  628. package/src/svg/menu/patch/fusion-space.svg +3 -3
  629. package/src/svg/menu/patch/fusion.svg +6 -6
  630. package/src/svg/menu/patch/history-space.svg +3 -3
  631. package/src/svg/menu/patch/history.svg +3 -3
  632. package/src/svg/menu/patch/information-space.svg +3 -3
  633. package/src/svg/menu/patch/information.svg +3 -3
  634. package/src/svg/menu/patch/insert-space.svg +3 -3
  635. package/src/svg/menu/patch/insert.svg +3 -3
  636. package/src/svg/menu/patch/letv-space.svg +3 -3
  637. package/src/svg/menu/patch/letv.svg +3 -3
  638. package/src/svg/menu/patch/link-space.svg +3 -3
  639. package/src/svg/menu/patch/link.svg +3 -3
  640. package/src/svg/menu/patch/location-space.svg +3 -3
  641. package/src/svg/menu/patch/location.svg +3 -3
  642. package/src/svg/menu/patch/message-space.svg +3 -3
  643. package/src/svg/menu/patch/message.svg +4 -4
  644. package/src/svg/menu/patch/minus-space.svg +3 -3
  645. package/src/svg/menu/patch/minus.svg +3 -3
  646. package/src/svg/menu/patch/mms-space.svg +3 -3
  647. package/src/svg/menu/patch/mms.svg +3 -3
  648. package/src/svg/menu/patch/monitor-space.svg +3 -3
  649. package/src/svg/menu/patch/monitor.svg +3 -3
  650. package/src/svg/menu/patch/move-space.svg +3 -3
  651. package/src/svg/menu/patch/move.svg +3 -3
  652. package/src/svg/menu/patch/negative-space.svg +2 -2
  653. package/src/svg/menu/patch/negative.svg +3 -3
  654. package/src/svg/menu/patch/net-space.svg +2 -2
  655. package/src/svg/menu/patch/net.svg +3 -3
  656. package/src/svg/menu/patch/news-space.svg +3 -3
  657. package/src/svg/menu/patch/news.svg +3 -3
  658. package/src/svg/menu/patch/notice-space.svg +4 -4
  659. package/src/svg/menu/patch/notice.svg +5 -5
  660. package/src/svg/menu/patch/officialBusiness-space.svg +3 -3
  661. package/src/svg/menu/patch/officialBusiness.svg +4 -4
  662. package/src/svg/menu/patch/pay-space.svg +3 -3
  663. package/src/svg/menu/patch/pay.svg +3 -3
  664. package/src/svg/menu/patch/phone-space.svg +3 -3
  665. package/src/svg/menu/patch/phone.svg +5 -5
  666. package/src/svg/menu/patch/print-space.svg +3 -3
  667. package/src/svg/menu/patch/print.svg +5 -5
  668. package/src/svg/menu/patch/product-space.svg +3 -3
  669. package/src/svg/menu/patch/product.svg +5 -5
  670. package/src/svg/menu/patch/reservation-space.svg +3 -3
  671. package/src/svg/menu/patch/reservation.svg +3 -3
  672. package/src/svg/menu/patch/sale-space.svg +3 -3
  673. package/src/svg/menu/patch/sale.svg +5 -5
  674. package/src/svg/menu/patch/search-space.svg +3 -3
  675. package/src/svg/menu/patch/search.svg +3 -3
  676. package/src/svg/menu/patch/secure-space.svg +3 -3
  677. package/src/svg/menu/patch/secure.svg +5 -5
  678. package/src/svg/menu/patch/setup-space.svg +3 -3
  679. package/src/svg/menu/patch/setup.svg +3 -3
  680. package/src/svg/menu/patch/shift-space.svg +3 -3
  681. package/src/svg/menu/patch/shift.svg +3 -3
  682. package/src/svg/menu/patch/situation-space.svg +3 -3
  683. package/src/svg/menu/patch/situation.svg +3 -3
  684. package/src/svg/menu/patch/special-space.svg +3 -3
  685. package/src/svg/menu/patch/special.svg +3 -3
  686. package/src/svg/menu/patch/tabulation-space.svg +3 -3
  687. package/src/svg/menu/patch/tabulation.svg +8 -8
  688. package/src/svg/menu/patch/track-space.svg +3 -3
  689. package/src/svg/menu/patch/track.svg +5 -5
  690. package/src/svg/menu/patch/transaction-space.svg +3 -3
  691. package/src/svg/menu/patch/transaction.svg +6 -6
  692. package/src/svg/menu/patch/user-space.svg +3 -3
  693. package/src/svg/menu/patch/user.svg +3 -3
  694. package/src/svg/menu/patch/visualize-space.svg +3 -3
  695. package/src/svg/menu/patch/visualize.svg +4 -4
  696. package/src/svg/menu/patch/vnet-space.svg +3 -3
  697. package/src/svg/menu/patch/vnet.svg +3 -3
  698. package/src/tip/tip.js +160 -160
  699. package/src/utils/after-leave.js +27 -27
  700. package/src/utils/ajax.js +59 -59
  701. package/src/utils/array.js +24 -24
  702. package/src/utils/clickoutside.js +105 -105
  703. package/src/utils/compare.js +16 -16
  704. package/src/utils/date.js +34 -34
  705. package/src/utils/disabledArea.js +18 -18
  706. package/src/utils/dom.js +301 -301
  707. package/src/utils/filetransfer.js +287 -287
  708. package/src/utils/isModified.js +20 -20
  709. package/src/utils/jsencrypt/JSEncrypt.js +192 -192
  710. package/src/utils/jsencrypt/JSEncryptRSAKey.js +320 -320
  711. package/src/utils/jsencrypt/index.js +3 -3
  712. package/src/utils/jsencrypt/jselib/asn1js/asn1.d.ts +51 -51
  713. package/src/utils/jsencrypt/jselib/asn1js/asn1.js +565 -565
  714. package/src/utils/jsencrypt/jselib/asn1js/base64.d.ts +5 -5
  715. package/src/utils/jsencrypt/jselib/asn1js/base64.js +88 -88
  716. package/src/utils/jsencrypt/jselib/asn1js/hex.d.ts +3 -3
  717. package/src/utils/jsencrypt/jselib/asn1js/hex.js +64 -64
  718. package/src/utils/jsencrypt/jselib/asn1js/int10.d.ts +9 -9
  719. package/src/utils/jsencrypt/jselib/asn1js/int10.js +87 -87
  720. package/src/utils/jsencrypt/jselib/asn1js/oids.d.ts +9778 -9778
  721. package/src/utils/jsencrypt/jselib/asn1js/oids.js +1962 -1962
  722. package/src/utils/jsencrypt/jselib/jsbn/base64.d.ts +3 -3
  723. package/src/utils/jsencrypt/jselib/jsbn/base64.js +76 -76
  724. package/src/utils/jsencrypt/jselib/jsbn/jsbn.d.ts +98 -98
  725. package/src/utils/jsencrypt/jselib/jsbn/jsbn.js +1754 -1754
  726. package/src/utils/jsencrypt/jselib/jsbn/prng4.d.ts +10 -10
  727. package/src/utils/jsencrypt/jselib/jsbn/prng4.js +46 -46
  728. package/src/utils/jsencrypt/jselib/jsbn/rng.d.ts +3 -3
  729. package/src/utils/jsencrypt/jselib/jsbn/rng.js +78 -78
  730. package/src/utils/jsencrypt/jselib/jsbn/rsa.d.ts +23 -23
  731. package/src/utils/jsencrypt/jselib/jsbn/rsa.js +373 -373
  732. package/src/utils/jsencrypt/jselib/jsbn/util.d.ts +7 -7
  733. package/src/utils/jsencrypt/jselib/jsbn/util.js +58 -58
  734. package/src/utils/jsencrypt/jselib/jsrsasign/asn1-1.0.js +1593 -1593
  735. package/src/utils/jsencrypt/jselib/jsrsasign/yahoo.js +63 -63
  736. package/src/utils/jsencrypt/util.js +58 -58
  737. package/src/utils/jsencrypt.js +263 -263
  738. package/src/utils/md5.js +203 -203
  739. package/src/utils/merge.js +15 -15
  740. package/src/utils/mime.js +75 -75
  741. package/src/utils/print.js +39 -39
  742. package/src/utils/ratio.js +230 -230
  743. package/src/utils/respo.js +9 -9
  744. package/src/utils/shared.js +7 -7
  745. package/src/utils/sign.js +185 -185
  746. package/src/utils/string.js +13 -13
  747. package/src/utils/theme.js +91 -91
  748. package/src/utils/types.js +40 -40
  749. package/src/utils/util.js +286 -286
  750. package/src/utils/uuid.js +12 -12
  751. package/src/utils/validate.js +373 -373
  752. package/packages/.DS_Store +0 -0
  753. package/packages/article/.DS_Store +0 -0
  754. package/packages/chat/.DS_Store +0 -0
  755. package/packages/chat/src/.DS_Store +0 -0
  756. package/packages/date-picker/.DS_Store +0 -0
  757. package/packages/dis/.DS_Store +0 -0
  758. package/packages/emote/.DS_Store +0 -0
  759. package/packages/filter/.DS_Store +0 -0
  760. package/packages/filter/src/.DS_Store +0 -0
  761. package/packages/float/.DS_Store +0 -0
  762. package/packages/flow/.DS_Store +0 -0
  763. package/packages/guider/.DS_Store +0 -0
  764. package/packages/ip/.DS_Store +0 -0
  765. package/packages/org/.DS_Store +0 -0
  766. package/packages/page/.DS_Store +0 -0
  767. package/packages/page/src/.DS_Store +0 -0
  768. package/packages/pic/.DS_Store +0 -0
  769. package/packages/rate/.DS_Store +0 -0
  770. package/packages/reverser/.DS_Store +0 -0
  771. package/packages/reverser/src/.DS_Store +0 -0
  772. package/packages/segment/.DS_Store +0 -0
  773. package/packages/slide/.DS_Store +0 -0
  774. package/packages/tab/.DS_Store +0 -0
  775. package/packages/table/.DS_Store +0 -0
  776. package/packages/theme/src/.DS_Store +0 -0
  777. package/packages/theme/src/img/.DS_Store +0 -0
  778. package/packages/theme/src/img/emote/.DS_Store +0 -0
  779. package/packages/theme/src/less/.DS_Store +0 -0
  780. package/packages/theme/src/less/theme/.DS_Store +0 -0
  781. package/packages/tooltip/.DS_Store +0 -0
  782. package/packages/tree/.DS_Store +0 -0
  783. package/packages/upload/.DS_Store +0 -0
  784. package/src/.DS_Store +0 -0
  785. package/src/svg/.DS_Store +0 -0
  786. package/src/svg/menu/.DS_Store +0 -0
@@ -1,565 +1,565 @@
1
- // ASN.1 JavaScript decoder
2
- // Copyright (c) 2008-2014 Lapo Luchini <lapo@lapo.it>
3
- // Permission to use, copy, modify, and/or distribute this software for any
4
- // purpose with or without fee is hereby granted, provided that the above
5
- // copyright notice and this permission notice appear in all copies.
6
- //
7
- // THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
8
- // WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
9
- // MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
10
- // ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
11
- // WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
12
- // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
13
- // OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
14
- /*jshint browser: true, strict: true, immed: true, latedef: true, undef: true, regexdash: false */
15
- /*global oids */
16
- import { Int10 } from "./int10";
17
- var ellipsis = "\u2026";
18
- var reTimeS = /^(\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/;
19
- var reTimeL = /^(\d\d\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/;
20
- function stringCut(str, len) {
21
- if (str.length > len) {
22
- str = str.substring(0, len) + ellipsis;
23
- }
24
- return str;
25
- }
26
- var Stream = /** @class */ (function () {
27
- function Stream(enc, pos) {
28
- this.hexDigits = "0123456789ABCDEF";
29
- if (enc instanceof Stream) {
30
- this.enc = enc.enc;
31
- this.pos = enc.pos;
32
- }
33
- else {
34
- // enc should be an array or a binary string
35
- this.enc = enc;
36
- this.pos = pos;
37
- }
38
- }
39
- Stream.prototype.get = function (pos) {
40
- if (pos === undefined) {
41
- pos = this.pos++;
42
- }
43
- if (pos >= this.enc.length) {
44
- throw new Error("Requesting byte offset ".concat(pos, " on a stream of length ").concat(this.enc.length));
45
- }
46
- return ("string" === typeof this.enc) ? this.enc.charCodeAt(pos) : this.enc[pos];
47
- };
48
- Stream.prototype.hexByte = function (b) {
49
- return this.hexDigits.charAt((b >> 4) & 0xF) + this.hexDigits.charAt(b & 0xF);
50
- };
51
- Stream.prototype.hexDump = function (start, end, raw) {
52
- var s = "";
53
- for (var i = start; i < end; ++i) {
54
- s += this.hexByte(this.get(i));
55
- if (raw !== true) {
56
- switch (i & 0xF) {
57
- case 0x7:
58
- s += " ";
59
- break;
60
- case 0xF:
61
- s += "\n";
62
- break;
63
- default:
64
- s += " ";
65
- }
66
- }
67
- }
68
- return s;
69
- };
70
- Stream.prototype.isASCII = function (start, end) {
71
- for (var i = start; i < end; ++i) {
72
- var c = this.get(i);
73
- if (c < 32 || c > 176) {
74
- return false;
75
- }
76
- }
77
- return true;
78
- };
79
- Stream.prototype.parseStringISO = function (start, end) {
80
- var s = "";
81
- for (var i = start; i < end; ++i) {
82
- s += String.fromCharCode(this.get(i));
83
- }
84
- return s;
85
- };
86
- Stream.prototype.parseStringUTF = function (start, end) {
87
- var s = "";
88
- for (var i = start; i < end;) {
89
- var c = this.get(i++);
90
- if (c < 128) {
91
- s += String.fromCharCode(c);
92
- }
93
- else if ((c > 191) && (c < 224)) {
94
- s += String.fromCharCode(((c & 0x1F) << 6) | (this.get(i++) & 0x3F));
95
- }
96
- else {
97
- s += String.fromCharCode(((c & 0x0F) << 12) | ((this.get(i++) & 0x3F) << 6) | (this.get(i++) & 0x3F));
98
- }
99
- }
100
- return s;
101
- };
102
- Stream.prototype.parseStringBMP = function (start, end) {
103
- var str = "";
104
- var hi;
105
- var lo;
106
- for (var i = start; i < end;) {
107
- hi = this.get(i++);
108
- lo = this.get(i++);
109
- str += String.fromCharCode((hi << 8) | lo);
110
- }
111
- return str;
112
- };
113
- Stream.prototype.parseTime = function (start, end, shortYear) {
114
- var s = this.parseStringISO(start, end);
115
- var m = (shortYear ? reTimeS : reTimeL).exec(s);
116
- if (!m) {
117
- return "Unrecognized time: " + s;
118
- }
119
- if (shortYear) {
120
- // to avoid querying the timer, use the fixed range [1970, 2069]
121
- // it will conform with ITU X.400 [-10, +40] sliding window until 2030
122
- m[1] = +m[1];
123
- m[1] += (+m[1] < 70) ? 2000 : 1900;
124
- }
125
- s = m[1] + "-" + m[2] + "-" + m[3] + " " + m[4];
126
- if (m[5]) {
127
- s += ":" + m[5];
128
- if (m[6]) {
129
- s += ":" + m[6];
130
- if (m[7]) {
131
- s += "." + m[7];
132
- }
133
- }
134
- }
135
- if (m[8]) {
136
- s += " UTC";
137
- if (m[8] != "Z") {
138
- s += m[8];
139
- if (m[9]) {
140
- s += ":" + m[9];
141
- }
142
- }
143
- }
144
- return s;
145
- };
146
- Stream.prototype.parseInteger = function (start, end) {
147
- var v = this.get(start);
148
- var neg = (v > 127);
149
- var pad = neg ? 255 : 0;
150
- var len;
151
- var s = "";
152
- // skip unuseful bits (not allowed in DER)
153
- while (v == pad && ++start < end) {
154
- v = this.get(start);
155
- }
156
- len = end - start;
157
- if (len === 0) {
158
- return neg ? -1 : 0;
159
- }
160
- // show bit length of huge integers
161
- if (len > 4) {
162
- s = v;
163
- len <<= 3;
164
- while (((+s ^ pad) & 0x80) == 0) {
165
- s = +s << 1;
166
- --len;
167
- }
168
- s = "(" + len + " bit)\n";
169
- }
170
- // decode the integer
171
- if (neg) {
172
- v = v - 256;
173
- }
174
- var n = new Int10(v);
175
- for (var i = start + 1; i < end; ++i) {
176
- n.mulAdd(256, this.get(i));
177
- }
178
- return s + n.toString();
179
- };
180
- Stream.prototype.parseBitString = function (start, end, maxLength) {
181
- var unusedBit = this.get(start);
182
- var lenBit = ((end - start - 1) << 3) - unusedBit;
183
- var intro = "(" + lenBit + " bit)\n";
184
- var s = "";
185
- for (var i = start + 1; i < end; ++i) {
186
- var b = this.get(i);
187
- var skip = (i == end - 1) ? unusedBit : 0;
188
- for (var j = 7; j >= skip; --j) {
189
- s += (b >> j) & 1 ? "1" : "0";
190
- }
191
- if (s.length > maxLength) {
192
- return intro + stringCut(s, maxLength);
193
- }
194
- }
195
- return intro + s;
196
- };
197
- Stream.prototype.parseOctetString = function (start, end, maxLength) {
198
- if (this.isASCII(start, end)) {
199
- return stringCut(this.parseStringISO(start, end), maxLength);
200
- }
201
- var len = end - start;
202
- var s = "(" + len + " byte)\n";
203
- maxLength /= 2; // we work in bytes
204
- if (len > maxLength) {
205
- end = start + maxLength;
206
- }
207
- for (var i = start; i < end; ++i) {
208
- s += this.hexByte(this.get(i));
209
- }
210
- if (len > maxLength) {
211
- s += ellipsis;
212
- }
213
- return s;
214
- };
215
- Stream.prototype.parseOID = function (start, end, maxLength) {
216
- var s = "";
217
- var n = new Int10();
218
- var bits = 0;
219
- for (var i = start; i < end; ++i) {
220
- var v = this.get(i);
221
- n.mulAdd(128, v & 0x7F);
222
- bits += 7;
223
- if (!(v & 0x80)) { // finished
224
- if (s === "") {
225
- n = n.simplify();
226
- if (n instanceof Int10) {
227
- n.sub(80);
228
- s = "2." + n.toString();
229
- }
230
- else {
231
- var m = n < 80 ? n < 40 ? 0 : 1 : 2;
232
- s = m + "." + (n - m * 40);
233
- }
234
- }
235
- else {
236
- s += "." + n.toString();
237
- }
238
- if (s.length > maxLength) {
239
- return stringCut(s, maxLength);
240
- }
241
- n = new Int10();
242
- bits = 0;
243
- }
244
- }
245
- if (bits > 0) {
246
- s += ".incomplete";
247
- }
248
- return s;
249
- };
250
- return Stream;
251
- }());
252
- export { Stream };
253
- var ASN1 = /** @class */ (function () {
254
- function ASN1(stream, header, length, tag, sub) {
255
- if (!(tag instanceof ASN1Tag)) {
256
- throw new Error("Invalid tag value.");
257
- }
258
- this.stream = stream;
259
- this.header = header;
260
- this.length = length;
261
- this.tag = tag;
262
- this.sub = sub;
263
- }
264
- ASN1.prototype.typeName = function () {
265
- switch (this.tag.tagClass) {
266
- case 0: // universal
267
- switch (this.tag.tagNumber) {
268
- case 0x00:
269
- return "EOC";
270
- case 0x01:
271
- return "BOOLEAN";
272
- case 0x02:
273
- return "INTEGER";
274
- case 0x03:
275
- return "BIT_STRING";
276
- case 0x04:
277
- return "OCTET_STRING";
278
- case 0x05:
279
- return "NULL";
280
- case 0x06:
281
- return "OBJECT_IDENTIFIER";
282
- case 0x07:
283
- return "ObjectDescriptor";
284
- case 0x08:
285
- return "EXTERNAL";
286
- case 0x09:
287
- return "REAL";
288
- case 0x0A:
289
- return "ENUMERATED";
290
- case 0x0B:
291
- return "EMBEDDED_PDV";
292
- case 0x0C:
293
- return "UTF8String";
294
- case 0x10:
295
- return "SEQUENCE";
296
- case 0x11:
297
- return "SET";
298
- case 0x12:
299
- return "NumericString";
300
- case 0x13:
301
- return "PrintableString"; // ASCII subset
302
- case 0x14:
303
- return "TeletexString"; // aka T61String
304
- case 0x15:
305
- return "VideotexString";
306
- case 0x16:
307
- return "IA5String"; // ASCII
308
- case 0x17:
309
- return "UTCTime";
310
- case 0x18:
311
- return "GeneralizedTime";
312
- case 0x19:
313
- return "GraphicString";
314
- case 0x1A:
315
- return "VisibleString"; // ASCII subset
316
- case 0x1B:
317
- return "GeneralString";
318
- case 0x1C:
319
- return "UniversalString";
320
- case 0x1E:
321
- return "BMPString";
322
- }
323
- return "Universal_" + this.tag.tagNumber.toString();
324
- case 1:
325
- return "Application_" + this.tag.tagNumber.toString();
326
- case 2:
327
- return "[" + this.tag.tagNumber.toString() + "]"; // Context
328
- case 3:
329
- return "Private_" + this.tag.tagNumber.toString();
330
- }
331
- };
332
- ASN1.prototype.content = function (maxLength) {
333
- if (this.tag === undefined) {
334
- return null;
335
- }
336
- if (maxLength === undefined) {
337
- maxLength = Infinity;
338
- }
339
- var content = this.posContent();
340
- var len = Math.abs(this.length);
341
- if (!this.tag.isUniversal()) {
342
- if (this.sub !== null) {
343
- return "(" + this.sub.length + " elem)";
344
- }
345
- return this.stream.parseOctetString(content, content + len, maxLength);
346
- }
347
- switch (this.tag.tagNumber) {
348
- case 0x01: // BOOLEAN
349
- return (this.stream.get(content) === 0) ? "false" : "true";
350
- case 0x02: // INTEGER
351
- return this.stream.parseInteger(content, content + len);
352
- case 0x03: // BIT_STRING
353
- return this.sub ? "(" + this.sub.length + " elem)" :
354
- this.stream.parseBitString(content, content + len, maxLength);
355
- case 0x04: // OCTET_STRING
356
- return this.sub ? "(" + this.sub.length + " elem)" :
357
- this.stream.parseOctetString(content, content + len, maxLength);
358
- // case 0x05: // NULL
359
- case 0x06: // OBJECT_IDENTIFIER
360
- return this.stream.parseOID(content, content + len, maxLength);
361
- // case 0x07: // ObjectDescriptor
362
- // case 0x08: // EXTERNAL
363
- // case 0x09: // REAL
364
- // case 0x0A: // ENUMERATED
365
- // case 0x0B: // EMBEDDED_PDV
366
- case 0x10: // SEQUENCE
367
- case 0x11: // SET
368
- if (this.sub !== null) {
369
- return "(" + this.sub.length + " elem)";
370
- }
371
- else {
372
- return "(no elem)";
373
- }
374
- case 0x0C: // UTF8String
375
- return stringCut(this.stream.parseStringUTF(content, content + len), maxLength);
376
- case 0x12: // NumericString
377
- case 0x13: // PrintableString
378
- case 0x14: // TeletexString
379
- case 0x15: // VideotexString
380
- case 0x16: // IA5String
381
- // case 0x19: // GraphicString
382
- case 0x1A: // VisibleString
383
- // case 0x1B: // GeneralString
384
- // case 0x1C: // UniversalString
385
- return stringCut(this.stream.parseStringISO(content, content + len), maxLength);
386
- case 0x1E: // BMPString
387
- return stringCut(this.stream.parseStringBMP(content, content + len), maxLength);
388
- case 0x17: // UTCTime
389
- case 0x18: // GeneralizedTime
390
- return this.stream.parseTime(content, content + len, (this.tag.tagNumber == 0x17));
391
- }
392
- return null;
393
- };
394
- ASN1.prototype.toString = function () {
395
- return this.typeName() + "@" + this.stream.pos + "[header:" + this.header + ",length:" + this.length + ",sub:" + ((this.sub === null) ? "null" : this.sub.length) + "]";
396
- };
397
- ASN1.prototype.toPrettyString = function (indent) {
398
- if (indent === undefined) {
399
- indent = "";
400
- }
401
- var s = indent + this.typeName() + " @" + this.stream.pos;
402
- if (this.length >= 0) {
403
- s += "+";
404
- }
405
- s += this.length;
406
- if (this.tag.tagConstructed) {
407
- s += " (constructed)";
408
- }
409
- else if ((this.tag.isUniversal() && ((this.tag.tagNumber == 0x03) || (this.tag.tagNumber == 0x04))) && (this.sub !== null)) {
410
- s += " (encapsulates)";
411
- }
412
- s += "\n";
413
- if (this.sub !== null) {
414
- indent += " ";
415
- for (var i = 0, max = this.sub.length; i < max; ++i) {
416
- s += this.sub[i].toPrettyString(indent);
417
- }
418
- }
419
- return s;
420
- };
421
- ASN1.prototype.posStart = function () {
422
- return this.stream.pos;
423
- };
424
- ASN1.prototype.posContent = function () {
425
- return this.stream.pos + this.header;
426
- };
427
- ASN1.prototype.posEnd = function () {
428
- return this.stream.pos + this.header + Math.abs(this.length);
429
- };
430
- ASN1.prototype.toHexString = function () {
431
- return this.stream.hexDump(this.posStart(), this.posEnd(), true);
432
- };
433
- ASN1.decodeLength = function (stream) {
434
- var buf = stream.get();
435
- var len = buf & 0x7F;
436
- if (len == buf) {
437
- return len;
438
- }
439
- // no reason to use Int10, as it would be a huge buffer anyways
440
- if (len > 6) {
441
- throw new Error("Length over 48 bits not supported at position " + (stream.pos - 1));
442
- }
443
- if (len === 0) {
444
- return null;
445
- } // undefined
446
- buf = 0;
447
- for (var i = 0; i < len; ++i) {
448
- buf = (buf * 256) + stream.get();
449
- }
450
- return buf;
451
- };
452
- /**
453
- * Retrieve the hexadecimal value (as a string) of the current ASN.1 element
454
- * @returns {string}
455
- * @public
456
- */
457
- ASN1.prototype.getHexStringValue = function () {
458
- var hexString = this.toHexString();
459
- var offset = this.header * 2;
460
- var length = this.length * 2;
461
- return hexString.substr(offset, length);
462
- };
463
- ASN1.decode = function (str) {
464
- var stream;
465
- if (!(str instanceof Stream)) {
466
- stream = new Stream(str, 0);
467
- }
468
- else {
469
- stream = str;
470
- }
471
- var streamStart = new Stream(stream);
472
- var tag = new ASN1Tag(stream);
473
- var len = ASN1.decodeLength(stream);
474
- var start = stream.pos;
475
- var header = start - streamStart.pos;
476
- var sub = null;
477
- var getSub = function () {
478
- var ret = [];
479
- if (len !== null) {
480
- // definite length
481
- var end = start + len;
482
- while (stream.pos < end) {
483
- ret[ret.length] = ASN1.decode(stream);
484
- }
485
- if (stream.pos != end) {
486
- throw new Error("Content size is not correct for container starting at offset " + start);
487
- }
488
- }
489
- else {
490
- // undefined length
491
- try {
492
- for (;;) {
493
- var s = ASN1.decode(stream);
494
- if (s.tag.isEOC()) {
495
- break;
496
- }
497
- ret[ret.length] = s;
498
- }
499
- len = start - stream.pos; // undefined lengths are represented as negative values
500
- }
501
- catch (e) {
502
- throw new Error("Exception while decoding undefined length content: " + e);
503
- }
504
- }
505
- return ret;
506
- };
507
- if (tag.tagConstructed) {
508
- // must have valid content
509
- sub = getSub();
510
- }
511
- else if (tag.isUniversal() && ((tag.tagNumber == 0x03) || (tag.tagNumber == 0x04))) {
512
- // sometimes BitString and OctetString are used to encapsulate ASN.1
513
- try {
514
- if (tag.tagNumber == 0x03) {
515
- if (stream.get() != 0) {
516
- throw new Error("BIT STRINGs with unused bits cannot encapsulate.");
517
- }
518
- }
519
- sub = getSub();
520
- for (var i = 0; i < sub.length; ++i) {
521
- if (sub[i].tag.isEOC()) {
522
- throw new Error("EOC is not supposed to be actual content.");
523
- }
524
- }
525
- }
526
- catch (e) {
527
- // but silently ignore when they don't
528
- sub = null;
529
- }
530
- }
531
- if (sub === null) {
532
- if (len === null) {
533
- throw new Error("We can't skip over an invalid tag with undefined length at offset " + start);
534
- }
535
- stream.pos = start + Math.abs(len);
536
- }
537
- return new ASN1(streamStart, header, len, tag, sub);
538
- };
539
- return ASN1;
540
- }());
541
- export { ASN1 };
542
- var ASN1Tag = /** @class */ (function () {
543
- function ASN1Tag(stream) {
544
- var buf = stream.get();
545
- this.tagClass = buf >> 6;
546
- this.tagConstructed = ((buf & 0x20) !== 0);
547
- this.tagNumber = buf & 0x1F;
548
- if (this.tagNumber == 0x1F) { // long tag
549
- var n = new Int10();
550
- do {
551
- buf = stream.get();
552
- n.mulAdd(128, buf & 0x7F);
553
- } while (buf & 0x80);
554
- this.tagNumber = n.simplify();
555
- }
556
- }
557
- ASN1Tag.prototype.isUniversal = function () {
558
- return this.tagClass === 0x00;
559
- };
560
- ASN1Tag.prototype.isEOC = function () {
561
- return this.tagClass === 0x00 && this.tagNumber === 0x00;
562
- };
563
- return ASN1Tag;
564
- }());
565
- export { ASN1Tag };
1
+ // ASN.1 JavaScript decoder
2
+ // Copyright (c) 2008-2014 Lapo Luchini <lapo@lapo.it>
3
+ // Permission to use, copy, modify, and/or distribute this software for any
4
+ // purpose with or without fee is hereby granted, provided that the above
5
+ // copyright notice and this permission notice appear in all copies.
6
+ //
7
+ // THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
8
+ // WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
9
+ // MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
10
+ // ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
11
+ // WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
12
+ // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
13
+ // OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
14
+ /*jshint browser: true, strict: true, immed: true, latedef: true, undef: true, regexdash: false */
15
+ /*global oids */
16
+ import { Int10 } from "./int10";
17
+ var ellipsis = "\u2026";
18
+ var reTimeS = /^(\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/;
19
+ var reTimeL = /^(\d\d\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/;
20
+ function stringCut(str, len) {
21
+ if (str.length > len) {
22
+ str = str.substring(0, len) + ellipsis;
23
+ }
24
+ return str;
25
+ }
26
+ var Stream = /** @class */ (function () {
27
+ function Stream(enc, pos) {
28
+ this.hexDigits = "0123456789ABCDEF";
29
+ if (enc instanceof Stream) {
30
+ this.enc = enc.enc;
31
+ this.pos = enc.pos;
32
+ }
33
+ else {
34
+ // enc should be an array or a binary string
35
+ this.enc = enc;
36
+ this.pos = pos;
37
+ }
38
+ }
39
+ Stream.prototype.get = function (pos) {
40
+ if (pos === undefined) {
41
+ pos = this.pos++;
42
+ }
43
+ if (pos >= this.enc.length) {
44
+ throw new Error("Requesting byte offset ".concat(pos, " on a stream of length ").concat(this.enc.length));
45
+ }
46
+ return ("string" === typeof this.enc) ? this.enc.charCodeAt(pos) : this.enc[pos];
47
+ };
48
+ Stream.prototype.hexByte = function (b) {
49
+ return this.hexDigits.charAt((b >> 4) & 0xF) + this.hexDigits.charAt(b & 0xF);
50
+ };
51
+ Stream.prototype.hexDump = function (start, end, raw) {
52
+ var s = "";
53
+ for (var i = start; i < end; ++i) {
54
+ s += this.hexByte(this.get(i));
55
+ if (raw !== true) {
56
+ switch (i & 0xF) {
57
+ case 0x7:
58
+ s += " ";
59
+ break;
60
+ case 0xF:
61
+ s += "\n";
62
+ break;
63
+ default:
64
+ s += " ";
65
+ }
66
+ }
67
+ }
68
+ return s;
69
+ };
70
+ Stream.prototype.isASCII = function (start, end) {
71
+ for (var i = start; i < end; ++i) {
72
+ var c = this.get(i);
73
+ if (c < 32 || c > 176) {
74
+ return false;
75
+ }
76
+ }
77
+ return true;
78
+ };
79
+ Stream.prototype.parseStringISO = function (start, end) {
80
+ var s = "";
81
+ for (var i = start; i < end; ++i) {
82
+ s += String.fromCharCode(this.get(i));
83
+ }
84
+ return s;
85
+ };
86
+ Stream.prototype.parseStringUTF = function (start, end) {
87
+ var s = "";
88
+ for (var i = start; i < end;) {
89
+ var c = this.get(i++);
90
+ if (c < 128) {
91
+ s += String.fromCharCode(c);
92
+ }
93
+ else if ((c > 191) && (c < 224)) {
94
+ s += String.fromCharCode(((c & 0x1F) << 6) | (this.get(i++) & 0x3F));
95
+ }
96
+ else {
97
+ s += String.fromCharCode(((c & 0x0F) << 12) | ((this.get(i++) & 0x3F) << 6) | (this.get(i++) & 0x3F));
98
+ }
99
+ }
100
+ return s;
101
+ };
102
+ Stream.prototype.parseStringBMP = function (start, end) {
103
+ var str = "";
104
+ var hi;
105
+ var lo;
106
+ for (var i = start; i < end;) {
107
+ hi = this.get(i++);
108
+ lo = this.get(i++);
109
+ str += String.fromCharCode((hi << 8) | lo);
110
+ }
111
+ return str;
112
+ };
113
+ Stream.prototype.parseTime = function (start, end, shortYear) {
114
+ var s = this.parseStringISO(start, end);
115
+ var m = (shortYear ? reTimeS : reTimeL).exec(s);
116
+ if (!m) {
117
+ return "Unrecognized time: " + s;
118
+ }
119
+ if (shortYear) {
120
+ // to avoid querying the timer, use the fixed range [1970, 2069]
121
+ // it will conform with ITU X.400 [-10, +40] sliding window until 2030
122
+ m[1] = +m[1];
123
+ m[1] += (+m[1] < 70) ? 2000 : 1900;
124
+ }
125
+ s = m[1] + "-" + m[2] + "-" + m[3] + " " + m[4];
126
+ if (m[5]) {
127
+ s += ":" + m[5];
128
+ if (m[6]) {
129
+ s += ":" + m[6];
130
+ if (m[7]) {
131
+ s += "." + m[7];
132
+ }
133
+ }
134
+ }
135
+ if (m[8]) {
136
+ s += " UTC";
137
+ if (m[8] != "Z") {
138
+ s += m[8];
139
+ if (m[9]) {
140
+ s += ":" + m[9];
141
+ }
142
+ }
143
+ }
144
+ return s;
145
+ };
146
+ Stream.prototype.parseInteger = function (start, end) {
147
+ var v = this.get(start);
148
+ var neg = (v > 127);
149
+ var pad = neg ? 255 : 0;
150
+ var len;
151
+ var s = "";
152
+ // skip unuseful bits (not allowed in DER)
153
+ while (v == pad && ++start < end) {
154
+ v = this.get(start);
155
+ }
156
+ len = end - start;
157
+ if (len === 0) {
158
+ return neg ? -1 : 0;
159
+ }
160
+ // show bit length of huge integers
161
+ if (len > 4) {
162
+ s = v;
163
+ len <<= 3;
164
+ while (((+s ^ pad) & 0x80) == 0) {
165
+ s = +s << 1;
166
+ --len;
167
+ }
168
+ s = "(" + len + " bit)\n";
169
+ }
170
+ // decode the integer
171
+ if (neg) {
172
+ v = v - 256;
173
+ }
174
+ var n = new Int10(v);
175
+ for (var i = start + 1; i < end; ++i) {
176
+ n.mulAdd(256, this.get(i));
177
+ }
178
+ return s + n.toString();
179
+ };
180
+ Stream.prototype.parseBitString = function (start, end, maxLength) {
181
+ var unusedBit = this.get(start);
182
+ var lenBit = ((end - start - 1) << 3) - unusedBit;
183
+ var intro = "(" + lenBit + " bit)\n";
184
+ var s = "";
185
+ for (var i = start + 1; i < end; ++i) {
186
+ var b = this.get(i);
187
+ var skip = (i == end - 1) ? unusedBit : 0;
188
+ for (var j = 7; j >= skip; --j) {
189
+ s += (b >> j) & 1 ? "1" : "0";
190
+ }
191
+ if (s.length > maxLength) {
192
+ return intro + stringCut(s, maxLength);
193
+ }
194
+ }
195
+ return intro + s;
196
+ };
197
+ Stream.prototype.parseOctetString = function (start, end, maxLength) {
198
+ if (this.isASCII(start, end)) {
199
+ return stringCut(this.parseStringISO(start, end), maxLength);
200
+ }
201
+ var len = end - start;
202
+ var s = "(" + len + " byte)\n";
203
+ maxLength /= 2; // we work in bytes
204
+ if (len > maxLength) {
205
+ end = start + maxLength;
206
+ }
207
+ for (var i = start; i < end; ++i) {
208
+ s += this.hexByte(this.get(i));
209
+ }
210
+ if (len > maxLength) {
211
+ s += ellipsis;
212
+ }
213
+ return s;
214
+ };
215
+ Stream.prototype.parseOID = function (start, end, maxLength) {
216
+ var s = "";
217
+ var n = new Int10();
218
+ var bits = 0;
219
+ for (var i = start; i < end; ++i) {
220
+ var v = this.get(i);
221
+ n.mulAdd(128, v & 0x7F);
222
+ bits += 7;
223
+ if (!(v & 0x80)) { // finished
224
+ if (s === "") {
225
+ n = n.simplify();
226
+ if (n instanceof Int10) {
227
+ n.sub(80);
228
+ s = "2." + n.toString();
229
+ }
230
+ else {
231
+ var m = n < 80 ? n < 40 ? 0 : 1 : 2;
232
+ s = m + "." + (n - m * 40);
233
+ }
234
+ }
235
+ else {
236
+ s += "." + n.toString();
237
+ }
238
+ if (s.length > maxLength) {
239
+ return stringCut(s, maxLength);
240
+ }
241
+ n = new Int10();
242
+ bits = 0;
243
+ }
244
+ }
245
+ if (bits > 0) {
246
+ s += ".incomplete";
247
+ }
248
+ return s;
249
+ };
250
+ return Stream;
251
+ }());
252
+ export { Stream };
253
+ var ASN1 = /** @class */ (function () {
254
+ function ASN1(stream, header, length, tag, sub) {
255
+ if (!(tag instanceof ASN1Tag)) {
256
+ throw new Error("Invalid tag value.");
257
+ }
258
+ this.stream = stream;
259
+ this.header = header;
260
+ this.length = length;
261
+ this.tag = tag;
262
+ this.sub = sub;
263
+ }
264
+ ASN1.prototype.typeName = function () {
265
+ switch (this.tag.tagClass) {
266
+ case 0: // universal
267
+ switch (this.tag.tagNumber) {
268
+ case 0x00:
269
+ return "EOC";
270
+ case 0x01:
271
+ return "BOOLEAN";
272
+ case 0x02:
273
+ return "INTEGER";
274
+ case 0x03:
275
+ return "BIT_STRING";
276
+ case 0x04:
277
+ return "OCTET_STRING";
278
+ case 0x05:
279
+ return "NULL";
280
+ case 0x06:
281
+ return "OBJECT_IDENTIFIER";
282
+ case 0x07:
283
+ return "ObjectDescriptor";
284
+ case 0x08:
285
+ return "EXTERNAL";
286
+ case 0x09:
287
+ return "REAL";
288
+ case 0x0A:
289
+ return "ENUMERATED";
290
+ case 0x0B:
291
+ return "EMBEDDED_PDV";
292
+ case 0x0C:
293
+ return "UTF8String";
294
+ case 0x10:
295
+ return "SEQUENCE";
296
+ case 0x11:
297
+ return "SET";
298
+ case 0x12:
299
+ return "NumericString";
300
+ case 0x13:
301
+ return "PrintableString"; // ASCII subset
302
+ case 0x14:
303
+ return "TeletexString"; // aka T61String
304
+ case 0x15:
305
+ return "VideotexString";
306
+ case 0x16:
307
+ return "IA5String"; // ASCII
308
+ case 0x17:
309
+ return "UTCTime";
310
+ case 0x18:
311
+ return "GeneralizedTime";
312
+ case 0x19:
313
+ return "GraphicString";
314
+ case 0x1A:
315
+ return "VisibleString"; // ASCII subset
316
+ case 0x1B:
317
+ return "GeneralString";
318
+ case 0x1C:
319
+ return "UniversalString";
320
+ case 0x1E:
321
+ return "BMPString";
322
+ }
323
+ return "Universal_" + this.tag.tagNumber.toString();
324
+ case 1:
325
+ return "Application_" + this.tag.tagNumber.toString();
326
+ case 2:
327
+ return "[" + this.tag.tagNumber.toString() + "]"; // Context
328
+ case 3:
329
+ return "Private_" + this.tag.tagNumber.toString();
330
+ }
331
+ };
332
+ ASN1.prototype.content = function (maxLength) {
333
+ if (this.tag === undefined) {
334
+ return null;
335
+ }
336
+ if (maxLength === undefined) {
337
+ maxLength = Infinity;
338
+ }
339
+ var content = this.posContent();
340
+ var len = Math.abs(this.length);
341
+ if (!this.tag.isUniversal()) {
342
+ if (this.sub !== null) {
343
+ return "(" + this.sub.length + " elem)";
344
+ }
345
+ return this.stream.parseOctetString(content, content + len, maxLength);
346
+ }
347
+ switch (this.tag.tagNumber) {
348
+ case 0x01: // BOOLEAN
349
+ return (this.stream.get(content) === 0) ? "false" : "true";
350
+ case 0x02: // INTEGER
351
+ return this.stream.parseInteger(content, content + len);
352
+ case 0x03: // BIT_STRING
353
+ return this.sub ? "(" + this.sub.length + " elem)" :
354
+ this.stream.parseBitString(content, content + len, maxLength);
355
+ case 0x04: // OCTET_STRING
356
+ return this.sub ? "(" + this.sub.length + " elem)" :
357
+ this.stream.parseOctetString(content, content + len, maxLength);
358
+ // case 0x05: // NULL
359
+ case 0x06: // OBJECT_IDENTIFIER
360
+ return this.stream.parseOID(content, content + len, maxLength);
361
+ // case 0x07: // ObjectDescriptor
362
+ // case 0x08: // EXTERNAL
363
+ // case 0x09: // REAL
364
+ // case 0x0A: // ENUMERATED
365
+ // case 0x0B: // EMBEDDED_PDV
366
+ case 0x10: // SEQUENCE
367
+ case 0x11: // SET
368
+ if (this.sub !== null) {
369
+ return "(" + this.sub.length + " elem)";
370
+ }
371
+ else {
372
+ return "(no elem)";
373
+ }
374
+ case 0x0C: // UTF8String
375
+ return stringCut(this.stream.parseStringUTF(content, content + len), maxLength);
376
+ case 0x12: // NumericString
377
+ case 0x13: // PrintableString
378
+ case 0x14: // TeletexString
379
+ case 0x15: // VideotexString
380
+ case 0x16: // IA5String
381
+ // case 0x19: // GraphicString
382
+ case 0x1A: // VisibleString
383
+ // case 0x1B: // GeneralString
384
+ // case 0x1C: // UniversalString
385
+ return stringCut(this.stream.parseStringISO(content, content + len), maxLength);
386
+ case 0x1E: // BMPString
387
+ return stringCut(this.stream.parseStringBMP(content, content + len), maxLength);
388
+ case 0x17: // UTCTime
389
+ case 0x18: // GeneralizedTime
390
+ return this.stream.parseTime(content, content + len, (this.tag.tagNumber == 0x17));
391
+ }
392
+ return null;
393
+ };
394
+ ASN1.prototype.toString = function () {
395
+ return this.typeName() + "@" + this.stream.pos + "[header:" + this.header + ",length:" + this.length + ",sub:" + ((this.sub === null) ? "null" : this.sub.length) + "]";
396
+ };
397
+ ASN1.prototype.toPrettyString = function (indent) {
398
+ if (indent === undefined) {
399
+ indent = "";
400
+ }
401
+ var s = indent + this.typeName() + " @" + this.stream.pos;
402
+ if (this.length >= 0) {
403
+ s += "+";
404
+ }
405
+ s += this.length;
406
+ if (this.tag.tagConstructed) {
407
+ s += " (constructed)";
408
+ }
409
+ else if ((this.tag.isUniversal() && ((this.tag.tagNumber == 0x03) || (this.tag.tagNumber == 0x04))) && (this.sub !== null)) {
410
+ s += " (encapsulates)";
411
+ }
412
+ s += "\n";
413
+ if (this.sub !== null) {
414
+ indent += " ";
415
+ for (var i = 0, max = this.sub.length; i < max; ++i) {
416
+ s += this.sub[i].toPrettyString(indent);
417
+ }
418
+ }
419
+ return s;
420
+ };
421
+ ASN1.prototype.posStart = function () {
422
+ return this.stream.pos;
423
+ };
424
+ ASN1.prototype.posContent = function () {
425
+ return this.stream.pos + this.header;
426
+ };
427
+ ASN1.prototype.posEnd = function () {
428
+ return this.stream.pos + this.header + Math.abs(this.length);
429
+ };
430
+ ASN1.prototype.toHexString = function () {
431
+ return this.stream.hexDump(this.posStart(), this.posEnd(), true);
432
+ };
433
+ ASN1.decodeLength = function (stream) {
434
+ var buf = stream.get();
435
+ var len = buf & 0x7F;
436
+ if (len == buf) {
437
+ return len;
438
+ }
439
+ // no reason to use Int10, as it would be a huge buffer anyways
440
+ if (len > 6) {
441
+ throw new Error("Length over 48 bits not supported at position " + (stream.pos - 1));
442
+ }
443
+ if (len === 0) {
444
+ return null;
445
+ } // undefined
446
+ buf = 0;
447
+ for (var i = 0; i < len; ++i) {
448
+ buf = (buf * 256) + stream.get();
449
+ }
450
+ return buf;
451
+ };
452
+ /**
453
+ * Retrieve the hexadecimal value (as a string) of the current ASN.1 element
454
+ * @returns {string}
455
+ * @public
456
+ */
457
+ ASN1.prototype.getHexStringValue = function () {
458
+ var hexString = this.toHexString();
459
+ var offset = this.header * 2;
460
+ var length = this.length * 2;
461
+ return hexString.substr(offset, length);
462
+ };
463
+ ASN1.decode = function (str) {
464
+ var stream;
465
+ if (!(str instanceof Stream)) {
466
+ stream = new Stream(str, 0);
467
+ }
468
+ else {
469
+ stream = str;
470
+ }
471
+ var streamStart = new Stream(stream);
472
+ var tag = new ASN1Tag(stream);
473
+ var len = ASN1.decodeLength(stream);
474
+ var start = stream.pos;
475
+ var header = start - streamStart.pos;
476
+ var sub = null;
477
+ var getSub = function () {
478
+ var ret = [];
479
+ if (len !== null) {
480
+ // definite length
481
+ var end = start + len;
482
+ while (stream.pos < end) {
483
+ ret[ret.length] = ASN1.decode(stream);
484
+ }
485
+ if (stream.pos != end) {
486
+ throw new Error("Content size is not correct for container starting at offset " + start);
487
+ }
488
+ }
489
+ else {
490
+ // undefined length
491
+ try {
492
+ for (;;) {
493
+ var s = ASN1.decode(stream);
494
+ if (s.tag.isEOC()) {
495
+ break;
496
+ }
497
+ ret[ret.length] = s;
498
+ }
499
+ len = start - stream.pos; // undefined lengths are represented as negative values
500
+ }
501
+ catch (e) {
502
+ throw new Error("Exception while decoding undefined length content: " + e);
503
+ }
504
+ }
505
+ return ret;
506
+ };
507
+ if (tag.tagConstructed) {
508
+ // must have valid content
509
+ sub = getSub();
510
+ }
511
+ else if (tag.isUniversal() && ((tag.tagNumber == 0x03) || (tag.tagNumber == 0x04))) {
512
+ // sometimes BitString and OctetString are used to encapsulate ASN.1
513
+ try {
514
+ if (tag.tagNumber == 0x03) {
515
+ if (stream.get() != 0) {
516
+ throw new Error("BIT STRINGs with unused bits cannot encapsulate.");
517
+ }
518
+ }
519
+ sub = getSub();
520
+ for (var i = 0; i < sub.length; ++i) {
521
+ if (sub[i].tag.isEOC()) {
522
+ throw new Error("EOC is not supposed to be actual content.");
523
+ }
524
+ }
525
+ }
526
+ catch (e) {
527
+ // but silently ignore when they don't
528
+ sub = null;
529
+ }
530
+ }
531
+ if (sub === null) {
532
+ if (len === null) {
533
+ throw new Error("We can't skip over an invalid tag with undefined length at offset " + start);
534
+ }
535
+ stream.pos = start + Math.abs(len);
536
+ }
537
+ return new ASN1(streamStart, header, len, tag, sub);
538
+ };
539
+ return ASN1;
540
+ }());
541
+ export { ASN1 };
542
+ var ASN1Tag = /** @class */ (function () {
543
+ function ASN1Tag(stream) {
544
+ var buf = stream.get();
545
+ this.tagClass = buf >> 6;
546
+ this.tagConstructed = ((buf & 0x20) !== 0);
547
+ this.tagNumber = buf & 0x1F;
548
+ if (this.tagNumber == 0x1F) { // long tag
549
+ var n = new Int10();
550
+ do {
551
+ buf = stream.get();
552
+ n.mulAdd(128, buf & 0x7F);
553
+ } while (buf & 0x80);
554
+ this.tagNumber = n.simplify();
555
+ }
556
+ }
557
+ ASN1Tag.prototype.isUniversal = function () {
558
+ return this.tagClass === 0x00;
559
+ };
560
+ ASN1Tag.prototype.isEOC = function () {
561
+ return this.tagClass === 0x00 && this.tagNumber === 0x00;
562
+ };
563
+ return ASN1Tag;
564
+ }());
565
+ export { ASN1Tag };