constella 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (747) hide show
  1. package/.next/BUILD_ID +1 -0
  2. package/.next/app-path-routes-manifest.json +53 -0
  3. package/.next/build-manifest.json +20 -0
  4. package/.next/diagnostics/build-diagnostics.json +6 -0
  5. package/.next/diagnostics/framework.json +1 -0
  6. package/.next/export-marker.json +6 -0
  7. package/.next/images-manifest.json +68 -0
  8. package/.next/next-minimal-server.js.nft.json +1 -0
  9. package/.next/next-server.js.nft.json +1 -0
  10. package/.next/package.json +1 -0
  11. package/.next/prerender-manifest.json +36 -0
  12. package/.next/react-loadable-manifest.json +14 -0
  13. package/.next/required-server-files.js +343 -0
  14. package/.next/required-server-files.json +343 -0
  15. package/.next/routes-manifest.json +362 -0
  16. package/.next/server/app/(app)/activity/page.js +2 -0
  17. package/.next/server/app/(app)/activity/page.js.nft.json +1 -0
  18. package/.next/server/app/(app)/activity/page_client-reference-manifest.js +1 -0
  19. package/.next/server/app/(app)/agents/[handle]/page.js +18 -0
  20. package/.next/server/app/(app)/agents/[handle]/page.js.nft.json +1 -0
  21. package/.next/server/app/(app)/agents/[handle]/page_client-reference-manifest.js +1 -0
  22. package/.next/server/app/(app)/code/page.js +2 -0
  23. package/.next/server/app/(app)/code/page.js.nft.json +1 -0
  24. package/.next/server/app/(app)/code/page_client-reference-manifest.js +1 -0
  25. package/.next/server/app/(app)/config/page.js +2 -0
  26. package/.next/server/app/(app)/config/page.js.nft.json +1 -0
  27. package/.next/server/app/(app)/config/page_client-reference-manifest.js +1 -0
  28. package/.next/server/app/(app)/costs/page.js +2 -0
  29. package/.next/server/app/(app)/costs/page.js.nft.json +1 -0
  30. package/.next/server/app/(app)/costs/page_client-reference-manifest.js +1 -0
  31. package/.next/server/app/(app)/cron/page.js +2 -0
  32. package/.next/server/app/(app)/cron/page.js.nft.json +1 -0
  33. package/.next/server/app/(app)/cron/page_client-reference-manifest.js +1 -0
  34. package/.next/server/app/(app)/dashboard/page.js +2 -0
  35. package/.next/server/app/(app)/dashboard/page.js.nft.json +1 -0
  36. package/.next/server/app/(app)/dashboard/page_client-reference-manifest.js +1 -0
  37. package/.next/server/app/(app)/docs/[id]/page.js +2 -0
  38. package/.next/server/app/(app)/docs/[id]/page.js.nft.json +1 -0
  39. package/.next/server/app/(app)/docs/[id]/page_client-reference-manifest.js +1 -0
  40. package/.next/server/app/(app)/docs/page.js +2 -0
  41. package/.next/server/app/(app)/docs/page.js.nft.json +1 -0
  42. package/.next/server/app/(app)/docs/page_client-reference-manifest.js +1 -0
  43. package/.next/server/app/(app)/github/page.js +2 -0
  44. package/.next/server/app/(app)/github/page.js.nft.json +1 -0
  45. package/.next/server/app/(app)/github/page_client-reference-manifest.js +1 -0
  46. package/.next/server/app/(app)/goals/page.js +2 -0
  47. package/.next/server/app/(app)/goals/page.js.nft.json +1 -0
  48. package/.next/server/app/(app)/goals/page_client-reference-manifest.js +1 -0
  49. package/.next/server/app/(app)/inbox/page.js +2 -0
  50. package/.next/server/app/(app)/inbox/page.js.nft.json +1 -0
  51. package/.next/server/app/(app)/inbox/page_client-reference-manifest.js +1 -0
  52. package/.next/server/app/(app)/knowledge/page.js +3 -0
  53. package/.next/server/app/(app)/knowledge/page.js.nft.json +1 -0
  54. package/.next/server/app/(app)/knowledge/page_client-reference-manifest.js +1 -0
  55. package/.next/server/app/(app)/models/page.js +2 -0
  56. package/.next/server/app/(app)/models/page.js.nft.json +1 -0
  57. package/.next/server/app/(app)/models/page_client-reference-manifest.js +1 -0
  58. package/.next/server/app/(app)/notifications/page.js +2 -0
  59. package/.next/server/app/(app)/notifications/page.js.nft.json +1 -0
  60. package/.next/server/app/(app)/notifications/page_client-reference-manifest.js +1 -0
  61. package/.next/server/app/(app)/org/page.js +2 -0
  62. package/.next/server/app/(app)/org/page.js.nft.json +1 -0
  63. package/.next/server/app/(app)/org/page_client-reference-manifest.js +1 -0
  64. package/.next/server/app/(app)/organizations/page.js +2 -0
  65. package/.next/server/app/(app)/organizations/page.js.nft.json +1 -0
  66. package/.next/server/app/(app)/organizations/page_client-reference-manifest.js +1 -0
  67. package/.next/server/app/(app)/page.js +3 -0
  68. package/.next/server/app/(app)/page.js.nft.json +1 -0
  69. package/.next/server/app/(app)/page_client-reference-manifest.js +1 -0
  70. package/.next/server/app/(app)/planner/page.js +2 -0
  71. package/.next/server/app/(app)/planner/page.js.nft.json +1 -0
  72. package/.next/server/app/(app)/planner/page_client-reference-manifest.js +1 -0
  73. package/.next/server/app/(app)/plugins/page.js +2 -0
  74. package/.next/server/app/(app)/plugins/page.js.nft.json +1 -0
  75. package/.next/server/app/(app)/plugins/page_client-reference-manifest.js +1 -0
  76. package/.next/server/app/(app)/pm/page.js +2 -0
  77. package/.next/server/app/(app)/pm/page.js.nft.json +1 -0
  78. package/.next/server/app/(app)/pm/page_client-reference-manifest.js +1 -0
  79. package/.next/server/app/(app)/prepare-deploy/page.js +19 -0
  80. package/.next/server/app/(app)/prepare-deploy/page.js.nft.json +1 -0
  81. package/.next/server/app/(app)/prepare-deploy/page_client-reference-manifest.js +1 -0
  82. package/.next/server/app/(app)/profile/page.js +2 -0
  83. package/.next/server/app/(app)/profile/page.js.nft.json +1 -0
  84. package/.next/server/app/(app)/profile/page_client-reference-manifest.js +1 -0
  85. package/.next/server/app/(app)/pulse/page.js +2 -0
  86. package/.next/server/app/(app)/pulse/page.js.nft.json +1 -0
  87. package/.next/server/app/(app)/pulse/page_client-reference-manifest.js +1 -0
  88. package/.next/server/app/(app)/reports/[id]/page.js +3 -0
  89. package/.next/server/app/(app)/reports/[id]/page.js.nft.json +1 -0
  90. package/.next/server/app/(app)/reports/[id]/page_client-reference-manifest.js +1 -0
  91. package/.next/server/app/(app)/reports/page.js +5 -0
  92. package/.next/server/app/(app)/reports/page.js.nft.json +1 -0
  93. package/.next/server/app/(app)/reports/page_client-reference-manifest.js +1 -0
  94. package/.next/server/app/(app)/routines/page.js +2 -0
  95. package/.next/server/app/(app)/routines/page.js.nft.json +1 -0
  96. package/.next/server/app/(app)/routines/page_client-reference-manifest.js +1 -0
  97. package/.next/server/app/(app)/search/page.js +2 -0
  98. package/.next/server/app/(app)/search/page.js.nft.json +1 -0
  99. package/.next/server/app/(app)/search/page_client-reference-manifest.js +1 -0
  100. package/.next/server/app/(app)/security/page.js +2 -0
  101. package/.next/server/app/(app)/security/page.js.nft.json +1 -0
  102. package/.next/server/app/(app)/security/page_client-reference-manifest.js +1 -0
  103. package/.next/server/app/(app)/skills/page.js +18 -0
  104. package/.next/server/app/(app)/skills/page.js.nft.json +1 -0
  105. package/.next/server/app/(app)/skills/page_client-reference-manifest.js +1 -0
  106. package/.next/server/app/(app)/tasks/page.js +2 -0
  107. package/.next/server/app/(app)/tasks/page.js.nft.json +1 -0
  108. package/.next/server/app/(app)/tasks/page_client-reference-manifest.js +1 -0
  109. package/.next/server/app/(app)/test-dev/page.js +2 -0
  110. package/.next/server/app/(app)/test-dev/page.js.nft.json +1 -0
  111. package/.next/server/app/(app)/test-dev/page_client-reference-manifest.js +1 -0
  112. package/.next/server/app/(app)/update/page.js +2 -0
  113. package/.next/server/app/(app)/update/page.js.nft.json +1 -0
  114. package/.next/server/app/(app)/update/page_client-reference-manifest.js +1 -0
  115. package/.next/server/app/(auth)/login/page.js +2 -0
  116. package/.next/server/app/(auth)/login/page.js.nft.json +1 -0
  117. package/.next/server/app/(auth)/login/page_client-reference-manifest.js +1 -0
  118. package/.next/server/app/(auth)/onboarding/page.js +18 -0
  119. package/.next/server/app/(auth)/onboarding/page.js.nft.json +1 -0
  120. package/.next/server/app/(auth)/onboarding/page_client-reference-manifest.js +1 -0
  121. package/.next/server/app/_global-error/page.js +32 -0
  122. package/.next/server/app/_global-error/page.js.nft.json +1 -0
  123. package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -0
  124. package/.next/server/app/_global-error.html +1 -0
  125. package/.next/server/app/_global-error.meta +16 -0
  126. package/.next/server/app/_global-error.rsc +15 -0
  127. package/.next/server/app/_global-error.segments/_full.segment.rsc +15 -0
  128. package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +5 -0
  129. package/.next/server/app/_global-error.segments/_global-error.segment.rsc +5 -0
  130. package/.next/server/app/_global-error.segments/_head.segment.rsc +5 -0
  131. package/.next/server/app/_global-error.segments/_index.segment.rsc +6 -0
  132. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -0
  133. package/.next/server/app/_not-found/page.js +2 -0
  134. package/.next/server/app/_not-found/page.js.nft.json +1 -0
  135. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -0
  136. package/.next/server/app/api/auth/[...all]/route.js +1 -0
  137. package/.next/server/app/api/auth/[...all]/route.js.nft.json +1 -0
  138. package/.next/server/app/api/auth/[...all]/route_client-reference-manifest.js +1 -0
  139. package/.next/server/app/api/cron/tick/route.js +52 -0
  140. package/.next/server/app/api/cron/tick/route.js.nft.json +1 -0
  141. package/.next/server/app/api/cron/tick/route_client-reference-manifest.js +1 -0
  142. package/.next/server/app/api/dev-login/route.js +1 -0
  143. package/.next/server/app/api/dev-login/route.js.nft.json +1 -0
  144. package/.next/server/app/api/dev-login/route_client-reference-manifest.js +1 -0
  145. package/.next/server/app/api/locks/acquire/route.js +1 -0
  146. package/.next/server/app/api/locks/acquire/route.js.nft.json +1 -0
  147. package/.next/server/app/api/locks/acquire/route_client-reference-manifest.js +1 -0
  148. package/.next/server/app/api/models/progress/route.js +1 -0
  149. package/.next/server/app/api/models/progress/route.js.nft.json +1 -0
  150. package/.next/server/app/api/models/progress/route_client-reference-manifest.js +1 -0
  151. package/.next/server/app/api/passkey/authenticate/options/route.js +1 -0
  152. package/.next/server/app/api/passkey/authenticate/options/route.js.nft.json +1 -0
  153. package/.next/server/app/api/passkey/authenticate/options/route_client-reference-manifest.js +1 -0
  154. package/.next/server/app/api/passkey/authenticate/verify/route.js +1 -0
  155. package/.next/server/app/api/passkey/authenticate/verify/route.js.nft.json +1 -0
  156. package/.next/server/app/api/passkey/authenticate/verify/route_client-reference-manifest.js +1 -0
  157. package/.next/server/app/api/passkey/register/options/route.js +1 -0
  158. package/.next/server/app/api/passkey/register/options/route.js.nft.json +1 -0
  159. package/.next/server/app/api/passkey/register/options/route_client-reference-manifest.js +1 -0
  160. package/.next/server/app/api/passkey/register/verify/route.js +1 -0
  161. package/.next/server/app/api/passkey/register/verify/route.js.nft.json +1 -0
  162. package/.next/server/app/api/passkey/register/verify/route_client-reference-manifest.js +1 -0
  163. package/.next/server/app/api/stream/route.js +4 -0
  164. package/.next/server/app/api/stream/route.js.nft.json +1 -0
  165. package/.next/server/app/api/stream/route_client-reference-manifest.js +1 -0
  166. package/.next/server/app/api/sync/file/route.js +2 -0
  167. package/.next/server/app/api/sync/file/route.js.nft.json +1 -0
  168. package/.next/server/app/api/sync/file/route_client-reference-manifest.js +1 -0
  169. package/.next/server/app/api/telegram/poll/route.js +15 -0
  170. package/.next/server/app/api/telegram/poll/route.js.nft.json +1 -0
  171. package/.next/server/app/api/telegram/poll/route_client-reference-manifest.js +1 -0
  172. package/.next/server/app/api/upload/route.js +1 -0
  173. package/.next/server/app/api/upload/route.js.nft.json +1 -0
  174. package/.next/server/app/api/upload/route_client-reference-manifest.js +1 -0
  175. package/.next/server/app/api/v1/[[...path]]/route.js +1 -0
  176. package/.next/server/app/api/v1/[[...path]]/route.js.nft.json +1 -0
  177. package/.next/server/app/api/v1/[[...path]]/route_client-reference-manifest.js +1 -0
  178. package/.next/server/app-paths-manifest.json +53 -0
  179. package/.next/server/chunks/1003.js +1 -0
  180. package/.next/server/chunks/127.js +26 -0
  181. package/.next/server/chunks/1388.js +1 -0
  182. package/.next/server/chunks/1408.js +21 -0
  183. package/.next/server/chunks/1572.js +1 -0
  184. package/.next/server/chunks/1591.js +24 -0
  185. package/.next/server/chunks/1619.js +188 -0
  186. package/.next/server/chunks/162.js +1 -0
  187. package/.next/server/chunks/1881.js +1 -0
  188. package/.next/server/chunks/1968.js +1 -0
  189. package/.next/server/chunks/2297.js +348 -0
  190. package/.next/server/chunks/2341.js +1 -0
  191. package/.next/server/chunks/2517.js +1 -0
  192. package/.next/server/chunks/2549.js +1 -0
  193. package/.next/server/chunks/259.js +14 -0
  194. package/.next/server/chunks/2599.js +1 -0
  195. package/.next/server/chunks/260.js +1 -0
  196. package/.next/server/chunks/2867.js +147 -0
  197. package/.next/server/chunks/3018.js +1 -0
  198. package/.next/server/chunks/3050.js +18 -0
  199. package/.next/server/chunks/3085.js +12 -0
  200. package/.next/server/chunks/3131.js +1 -0
  201. package/.next/server/chunks/3242.js +1 -0
  202. package/.next/server/chunks/3266.js +15 -0
  203. package/.next/server/chunks/3524.js +1 -0
  204. package/.next/server/chunks/3527.js +479 -0
  205. package/.next/server/chunks/3533.js +869 -0
  206. package/.next/server/chunks/3550.js +1 -0
  207. package/.next/server/chunks/3609.js +2 -0
  208. package/.next/server/chunks/3667.js +462 -0
  209. package/.next/server/chunks/3760.js +4 -0
  210. package/.next/server/chunks/4679.js +1 -0
  211. package/.next/server/chunks/4804.js +1 -0
  212. package/.next/server/chunks/4832.js +2 -0
  213. package/.next/server/chunks/4853.js +1 -0
  214. package/.next/server/chunks/4979.js +67 -0
  215. package/.next/server/chunks/5060.js +1 -0
  216. package/.next/server/chunks/5278.js +1 -0
  217. package/.next/server/chunks/5614.js +1 -0
  218. package/.next/server/chunks/5818.js +1 -0
  219. package/.next/server/chunks/6479.js +1 -0
  220. package/.next/server/chunks/6658.js +1 -0
  221. package/.next/server/chunks/6706.js +1 -0
  222. package/.next/server/chunks/6719.js +1 -0
  223. package/.next/server/chunks/678.js +1 -0
  224. package/.next/server/chunks/683.js +1 -0
  225. package/.next/server/chunks/6862.js +1 -0
  226. package/.next/server/chunks/6882.js +1 -0
  227. package/.next/server/chunks/7037.js +1 -0
  228. package/.next/server/chunks/7107.js +741 -0
  229. package/.next/server/chunks/73.js +17 -0
  230. package/.next/server/chunks/7327.js +1 -0
  231. package/.next/server/chunks/7514.js +1 -0
  232. package/.next/server/chunks/7622.js +1 -0
  233. package/.next/server/chunks/7778.js +1 -0
  234. package/.next/server/chunks/7912.js +1 -0
  235. package/.next/server/chunks/7949.js +1 -0
  236. package/.next/server/chunks/7971.js +1 -0
  237. package/.next/server/chunks/7989.js +1 -0
  238. package/.next/server/chunks/842.js +22 -0
  239. package/.next/server/chunks/8762.js +15 -0
  240. package/.next/server/chunks/8823.js +77 -0
  241. package/.next/server/chunks/9146.js +4 -0
  242. package/.next/server/chunks/9676.js +1 -0
  243. package/.next/server/chunks/9783.js +22 -0
  244. package/.next/server/chunks/9969.js +3 -0
  245. package/.next/server/functions-config-manifest.json +18 -0
  246. package/.next/server/instrumentation.js +1 -0
  247. package/.next/server/instrumentation.js.nft.json +1 -0
  248. package/.next/server/interception-route-rewrite-manifest.js +1 -0
  249. package/.next/server/middleware-build-manifest.js +1 -0
  250. package/.next/server/middleware-manifest.json +6 -0
  251. package/.next/server/middleware-react-loadable-manifest.js +1 -0
  252. package/.next/server/middleware.js +18 -0
  253. package/.next/server/middleware.js.nft.json +1 -0
  254. package/.next/server/next-font-manifest.js +1 -0
  255. package/.next/server/next-font-manifest.json +1 -0
  256. package/.next/server/pages/500.html +1 -0
  257. package/.next/server/pages-manifest.json +3 -0
  258. package/.next/server/prefetch-hints.json +1 -0
  259. package/.next/server/server-reference-manifest.js +1 -0
  260. package/.next/server/server-reference-manifest.json +1 -0
  261. package/.next/server/webpack-runtime.js +1 -0
  262. package/.next/static/chunks/1858-339516f78a4b00da.js +1 -0
  263. package/.next/static/chunks/2320-fc8b39380e69d465.js +2 -0
  264. package/.next/static/chunks/23550918-ff694f70f4b0648c.js +1 -0
  265. package/.next/static/chunks/3219-ebb3c23be38c838d.js +1 -0
  266. package/.next/static/chunks/4263-adecb5b466380b6e.js +1 -0
  267. package/.next/static/chunks/5479-0cceab68cd0ca9c7.js +1 -0
  268. package/.next/static/chunks/5701-665b927b06158b76.js +1 -0
  269. package/.next/static/chunks/5920.6451a68b63918988.js +1 -0
  270. package/.next/static/chunks/6575-5c9139720bb0f5bf.js +4 -0
  271. package/.next/static/chunks/6834-4759af1ce7d95fb6.js +32 -0
  272. package/.next/static/chunks/7509.721cd47a931c5518.js +1 -0
  273. package/.next/static/chunks/8264-1ca011989ee2b231.js +1 -0
  274. package/.next/static/chunks/9219-4a39a98b5502d9d1.js +1 -0
  275. package/.next/static/chunks/9690-53d5222618cbeddb.js +1 -0
  276. package/.next/static/chunks/app/(app)/activity/page-3973534281ecea81.js +1 -0
  277. package/.next/static/chunks/app/(app)/agents/[handle]/page-83662a175c098282.js +1 -0
  278. package/.next/static/chunks/app/(app)/code/page-33979545192cd137.js +1 -0
  279. package/.next/static/chunks/app/(app)/config/page-9933aed1ca8a85c1.js +1 -0
  280. package/.next/static/chunks/app/(app)/costs/page-131c4dc580efcc19.js +1 -0
  281. package/.next/static/chunks/app/(app)/cron/page-53ea1aff998a87ca.js +1 -0
  282. package/.next/static/chunks/app/(app)/dashboard/page-deed83aaa9d0d447.js +1 -0
  283. package/.next/static/chunks/app/(app)/docs/[id]/page-38c993d73c0eab4f.js +1 -0
  284. package/.next/static/chunks/app/(app)/docs/page-bf463b55d0554e86.js +1 -0
  285. package/.next/static/chunks/app/(app)/error-988cd28480809861.js +1 -0
  286. package/.next/static/chunks/app/(app)/github/page-62678b4e82dfecb6.js +1 -0
  287. package/.next/static/chunks/app/(app)/goals/page-4adb426fe1c96106.js +1 -0
  288. package/.next/static/chunks/app/(app)/inbox/page-e347dc55ab467310.js +1 -0
  289. package/.next/static/chunks/app/(app)/knowledge/page-65393a045b4349be.js +1 -0
  290. package/.next/static/chunks/app/(app)/layout-7f65675705b011d8.js +1 -0
  291. package/.next/static/chunks/app/(app)/models/page-e01f1dd7e49a2951.js +1 -0
  292. package/.next/static/chunks/app/(app)/notifications/page-56548ac87aef00da.js +1 -0
  293. package/.next/static/chunks/app/(app)/org/page-699e6a6dc0db7d81.js +1 -0
  294. package/.next/static/chunks/app/(app)/organizations/page-36051a380a7e8eb7.js +1 -0
  295. package/.next/static/chunks/app/(app)/page-7d1011a566f81520.js +1 -0
  296. package/.next/static/chunks/app/(app)/planner/page-dab7ced94083373a.js +1 -0
  297. package/.next/static/chunks/app/(app)/plugins/page-5b5a1f53389be42e.js +1 -0
  298. package/.next/static/chunks/app/(app)/pm/page-0de5c08c0b227bb0.js +1 -0
  299. package/.next/static/chunks/app/(app)/prepare-deploy/page-e426038552df8d41.js +1 -0
  300. package/.next/static/chunks/app/(app)/profile/page-608dfcaf8aae0a69.js +1 -0
  301. package/.next/static/chunks/app/(app)/pulse/page-309ccaca91de1faa.js +1 -0
  302. package/.next/static/chunks/app/(app)/reports/[id]/page-53ea1aff998a87ca.js +1 -0
  303. package/.next/static/chunks/app/(app)/reports/page-68cdc6dcfa472d86.js +1 -0
  304. package/.next/static/chunks/app/(app)/routines/page-bcc55550b197a9fa.js +1 -0
  305. package/.next/static/chunks/app/(app)/search/page-5c5f67558d0dbf0d.js +1 -0
  306. package/.next/static/chunks/app/(app)/security/page-a7d41e36aa366b45.js +1 -0
  307. package/.next/static/chunks/app/(app)/skills/page-c5b21e89593b8336.js +1 -0
  308. package/.next/static/chunks/app/(app)/tasks/page-08ae079e3e54d2ce.js +1 -0
  309. package/.next/static/chunks/app/(app)/test-dev/page-633f82dfd9c3ce23.js +1 -0
  310. package/.next/static/chunks/app/(app)/update/page-4be019054351bfac.js +1 -0
  311. package/.next/static/chunks/app/(auth)/login/page-6e85d3377062acae.js +1 -0
  312. package/.next/static/chunks/app/(auth)/onboarding/page-ebb10c175abf3b85.js +1 -0
  313. package/.next/static/chunks/app/_global-error/page-23fe50a6bf589c97.js +1 -0
  314. package/.next/static/chunks/app/_not-found/page-dc38b02aebeab535.js +1 -0
  315. package/.next/static/chunks/app/api/auth/[...all]/route-23fe50a6bf589c97.js +1 -0
  316. package/.next/static/chunks/app/api/cron/tick/route-23fe50a6bf589c97.js +1 -0
  317. package/.next/static/chunks/app/api/dev-login/route-23fe50a6bf589c97.js +1 -0
  318. package/.next/static/chunks/app/api/locks/acquire/route-23fe50a6bf589c97.js +1 -0
  319. package/.next/static/chunks/app/api/models/progress/route-23fe50a6bf589c97.js +1 -0
  320. package/.next/static/chunks/app/api/passkey/authenticate/options/route-23fe50a6bf589c97.js +1 -0
  321. package/.next/static/chunks/app/api/passkey/authenticate/verify/route-23fe50a6bf589c97.js +1 -0
  322. package/.next/static/chunks/app/api/passkey/register/options/route-23fe50a6bf589c97.js +1 -0
  323. package/.next/static/chunks/app/api/passkey/register/verify/route-23fe50a6bf589c97.js +1 -0
  324. package/.next/static/chunks/app/api/stream/route-23fe50a6bf589c97.js +1 -0
  325. package/.next/static/chunks/app/api/sync/file/route-23fe50a6bf589c97.js +1 -0
  326. package/.next/static/chunks/app/api/telegram/poll/route-23fe50a6bf589c97.js +1 -0
  327. package/.next/static/chunks/app/api/upload/route-23fe50a6bf589c97.js +1 -0
  328. package/.next/static/chunks/app/api/v1/[[...path]]/route-23fe50a6bf589c97.js +1 -0
  329. package/.next/static/chunks/app/error-09899a13c38b6e89.js +1 -0
  330. package/.next/static/chunks/app/global-error-b8050d4d886f448c.js +1 -0
  331. package/.next/static/chunks/app/layout-ab9deed1e7e2e9df.js +1 -0
  332. package/.next/static/chunks/framework-4b2c6b6043dd203f.js +1 -0
  333. package/.next/static/chunks/main-722e16032e7764d1.js +5 -0
  334. package/.next/static/chunks/main-app-761880af2b6f1962.js +1 -0
  335. package/.next/static/chunks/next/dist/client/components/builtin/app-error-23fe50a6bf589c97.js +1 -0
  336. package/.next/static/chunks/next/dist/client/components/builtin/forbidden-23fe50a6bf589c97.js +1 -0
  337. package/.next/static/chunks/next/dist/client/components/builtin/not-found-23fe50a6bf589c97.js +1 -0
  338. package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-23fe50a6bf589c97.js +1 -0
  339. package/.next/static/chunks/polyfills-42372ed130431b0a.js +1 -0
  340. package/.next/static/chunks/webpack-222e3894b78c67db.js +1 -0
  341. package/.next/static/css/0a9b5805594444e3.css +1 -0
  342. package/.next/static/yztMvBwyrWWkSqP6jfXoa/_buildManifest.js +1 -0
  343. package/.next/static/yztMvBwyrWWkSqP6jfXoa/_ssgManifest.js +1 -0
  344. package/.next/trace-build +1 -0
  345. package/.next/types/app/(app)/activity/page.ts +87 -0
  346. package/.next/types/app/(app)/agents/[handle]/page.ts +87 -0
  347. package/.next/types/app/(app)/code/page.ts +87 -0
  348. package/.next/types/app/(app)/config/page.ts +87 -0
  349. package/.next/types/app/(app)/costs/page.ts +87 -0
  350. package/.next/types/app/(app)/cron/page.ts +87 -0
  351. package/.next/types/app/(app)/dashboard/page.ts +87 -0
  352. package/.next/types/app/(app)/docs/[id]/page.ts +87 -0
  353. package/.next/types/app/(app)/docs/page.ts +87 -0
  354. package/.next/types/app/(app)/github/page.ts +87 -0
  355. package/.next/types/app/(app)/goals/page.ts +87 -0
  356. package/.next/types/app/(app)/inbox/page.ts +87 -0
  357. package/.next/types/app/(app)/knowledge/page.ts +87 -0
  358. package/.next/types/app/(app)/models/page.ts +87 -0
  359. package/.next/types/app/(app)/notifications/page.ts +87 -0
  360. package/.next/types/app/(app)/org/page.ts +87 -0
  361. package/.next/types/app/(app)/organizations/page.ts +87 -0
  362. package/.next/types/app/(app)/page.ts +87 -0
  363. package/.next/types/app/(app)/planner/page.ts +87 -0
  364. package/.next/types/app/(app)/plugins/page.ts +87 -0
  365. package/.next/types/app/(app)/pm/page.ts +87 -0
  366. package/.next/types/app/(app)/prepare-deploy/page.ts +87 -0
  367. package/.next/types/app/(app)/profile/page.ts +87 -0
  368. package/.next/types/app/(app)/pulse/page.ts +87 -0
  369. package/.next/types/app/(app)/reports/[id]/page.ts +87 -0
  370. package/.next/types/app/(app)/reports/page.ts +87 -0
  371. package/.next/types/app/(app)/routines/page.ts +87 -0
  372. package/.next/types/app/(app)/search/page.ts +87 -0
  373. package/.next/types/app/(app)/security/page.ts +87 -0
  374. package/.next/types/app/(app)/skills/page.ts +87 -0
  375. package/.next/types/app/(app)/tasks/page.ts +87 -0
  376. package/.next/types/app/(app)/test-dev/page.ts +87 -0
  377. package/.next/types/app/(app)/update/page.ts +87 -0
  378. package/.next/types/app/(auth)/login/page.ts +87 -0
  379. package/.next/types/app/(auth)/onboarding/page.ts +87 -0
  380. package/.next/types/app/api/auth/[...all]/route.ts +351 -0
  381. package/.next/types/app/api/cron/tick/route.ts +351 -0
  382. package/.next/types/app/api/dev-login/route.ts +351 -0
  383. package/.next/types/app/api/locks/acquire/route.ts +351 -0
  384. package/.next/types/app/api/models/progress/route.ts +351 -0
  385. package/.next/types/app/api/passkey/authenticate/options/route.ts +351 -0
  386. package/.next/types/app/api/passkey/authenticate/verify/route.ts +351 -0
  387. package/.next/types/app/api/passkey/register/options/route.ts +351 -0
  388. package/.next/types/app/api/passkey/register/verify/route.ts +351 -0
  389. package/.next/types/app/api/stream/route.ts +351 -0
  390. package/.next/types/app/api/sync/file/route.ts +351 -0
  391. package/.next/types/app/api/telegram/poll/route.ts +351 -0
  392. package/.next/types/app/api/upload/route.ts +351 -0
  393. package/.next/types/app/api/v1/[[...path]]/route.ts +351 -0
  394. package/.next/types/cache-life.d.ts +145 -0
  395. package/.next/types/link.d.ts +210 -0
  396. package/.next/types/package.json +1 -0
  397. package/.next/types/routes.d.ts +120 -0
  398. package/.next/types/validator.ts +511 -0
  399. package/CHANGELOG.md +312 -0
  400. package/LICENSE +21 -0
  401. package/README.md +382 -0
  402. package/README.pt-BR.md +391 -0
  403. package/bin/constella.mjs +329 -0
  404. package/bin/guard-hook.mjs +44 -0
  405. package/bin/lock-hook.mjs +49 -0
  406. package/bin/worker.mjs +142 -0
  407. package/docs/assets/arch-orbit.svg +56 -0
  408. package/docs/assets/blackhole.svg +37 -0
  409. package/docs/assets/divider-orbit.svg +23 -0
  410. package/docs/assets/hero-constella.svg +72 -0
  411. package/docs/en/AGENTS.md +279 -0
  412. package/docs/en/AI_ARCHITECTURE.md +373 -0
  413. package/docs/en/ARCHITECTURE.md +334 -0
  414. package/docs/en/AUTH_MODE.md +247 -0
  415. package/docs/en/CHAT_COMMANDS.md +305 -0
  416. package/docs/en/CONFIGURATION.md +340 -0
  417. package/docs/en/DEPLOY.md +331 -0
  418. package/docs/en/DM.md +297 -0
  419. package/docs/en/FAQ.md +258 -0
  420. package/docs/en/GITHUB.md +341 -0
  421. package/docs/en/GOALS_SPECS_ISSUES.md +303 -0
  422. package/docs/en/INBOX.md +340 -0
  423. package/docs/en/INSTALLATION.md +329 -0
  424. package/docs/en/KB_AGENT.md +305 -0
  425. package/docs/en/KB_RAG.md +356 -0
  426. package/docs/en/MCP.md +313 -0
  427. package/docs/en/MEMORY_RAG.md +289 -0
  428. package/docs/en/MODELS.md +341 -0
  429. package/docs/en/ONBOARDING.md +327 -0
  430. package/docs/en/PLUGINS.md +290 -0
  431. package/docs/en/PORTABLE_MODE.md +387 -0
  432. package/docs/en/PO_AGENT.md +379 -0
  433. package/docs/en/PREPARE_DEPLOY.md +308 -0
  434. package/docs/en/PROJECT_STACKS.md +258 -0
  435. package/docs/en/PUBLIC_API.md +315 -0
  436. package/docs/en/PUBLISHING.md +343 -0
  437. package/docs/en/README.md +95 -0
  438. package/docs/en/SECURITY.md +280 -0
  439. package/docs/en/SKILLS.md +349 -0
  440. package/docs/en/START_MODE.md +340 -0
  441. package/docs/en/SYNCED_BLOCKS.md +320 -0
  442. package/docs/en/TEAM_ROOM.md +285 -0
  443. package/docs/en/TELEGRAM.md +294 -0
  444. package/docs/en/TEST_DEV.md +321 -0
  445. package/docs/en/TROUBLESHOOTING.md +294 -0
  446. package/docs/en/UPDATE.md +301 -0
  447. package/docs/en/VPS_MODE.md +334 -0
  448. package/docs/en/WORKFLOW.md +321 -0
  449. package/docs/pt/AGENTS.md +279 -0
  450. package/docs/pt/AI_ARCHITECTURE.md +373 -0
  451. package/docs/pt/ARCHITECTURE.md +334 -0
  452. package/docs/pt/AUTH_MODE.md +247 -0
  453. package/docs/pt/CHAT_COMMANDS.md +307 -0
  454. package/docs/pt/CONFIGURATION.md +340 -0
  455. package/docs/pt/DEPLOY.md +331 -0
  456. package/docs/pt/DM.md +297 -0
  457. package/docs/pt/FAQ.md +258 -0
  458. package/docs/pt/GITHUB.md +341 -0
  459. package/docs/pt/GOALS_SPECS_ISSUES.md +303 -0
  460. package/docs/pt/INBOX.md +340 -0
  461. package/docs/pt/INSTALLATION.md +329 -0
  462. package/docs/pt/KB_AGENT.md +305 -0
  463. package/docs/pt/KB_RAG.md +356 -0
  464. package/docs/pt/MCP.md +313 -0
  465. package/docs/pt/MEMORY_RAG.md +289 -0
  466. package/docs/pt/MODELS.md +341 -0
  467. package/docs/pt/ONBOARDING.md +327 -0
  468. package/docs/pt/PLUGINS.md +290 -0
  469. package/docs/pt/PORTABLE_MODE.md +387 -0
  470. package/docs/pt/PO_AGENT.md +379 -0
  471. package/docs/pt/PREPARE_DEPLOY.md +308 -0
  472. package/docs/pt/PROJECT_STACKS.md +258 -0
  473. package/docs/pt/PUBLIC_API.md +315 -0
  474. package/docs/pt/PUBLISHING.md +343 -0
  475. package/docs/pt/README.md +95 -0
  476. package/docs/pt/SECURITY.md +280 -0
  477. package/docs/pt/SKILLS.md +349 -0
  478. package/docs/pt/START_MODE.md +340 -0
  479. package/docs/pt/SYNCED_BLOCKS.md +320 -0
  480. package/docs/pt/TEAM_ROOM.md +285 -0
  481. package/docs/pt/TELEGRAM.md +294 -0
  482. package/docs/pt/TEST_DEV.md +321 -0
  483. package/docs/pt/TROUBLESHOOTING.md +294 -0
  484. package/docs/pt/UPDATE.md +301 -0
  485. package/docs/pt/VPS_MODE.md +334 -0
  486. package/docs/pt/WORKFLOW.md +321 -0
  487. package/drizzle/0000_regular_nightshade.sql +644 -0
  488. package/drizzle/0001_mixed_zombie.sql +106 -0
  489. package/drizzle/meta/0000_snapshot.json +4650 -0
  490. package/drizzle/meta/0001_snapshot.json +5418 -0
  491. package/drizzle/meta/_journal.json +20 -0
  492. package/drizzle.config.mjs +16 -0
  493. package/next.config.mjs +18 -0
  494. package/package.json +130 -0
  495. package/scripts/clean-repo.mjs +20 -0
  496. package/scripts/dev-all.mjs +46 -0
  497. package/scripts/i18n-parity.mjs +57 -0
  498. package/scripts/mcp-server.mjs +100 -0
  499. package/scripts/postbuild.mjs +11 -0
  500. package/scripts/publish-public.mjs +116 -0
  501. package/scripts/start-all.mjs +45 -0
  502. package/scripts/trim-next.mjs +23 -0
  503. package/scripts/vps-install.sh +39 -0
  504. package/skills/CONTRIBUTING.md +122 -0
  505. package/skills/COVERAGE.md +129 -0
  506. package/skills/INDEX.json +3443 -0
  507. package/skills/README.md +57 -0
  508. package/skills/design/animation-motion/SKILL.md +60 -0
  509. package/skills/design/color-and-typography/SKILL.md +60 -0
  510. package/skills/design/css-techniques/SKILL.md +58 -0
  511. package/skills/design/design-systems/SKILL.md +60 -0
  512. package/skills/design/gradients/SKILL.md +59 -0
  513. package/skills/design/graphic-design-basics/SKILL.md +55 -0
  514. package/skills/design/microinteractions/SKILL.md +58 -0
  515. package/skills/design/responsive-layout/SKILL.md +59 -0
  516. package/skills/design/ui-ux-principles/SKILL.md +58 -0
  517. package/skills/engineering/architecture/api-design-rest-graphql/SKILL.md +67 -0
  518. package/skills/engineering/architecture/caching-strategies/SKILL.md +59 -0
  519. package/skills/engineering/architecture/data-modeling/SKILL.md +64 -0
  520. package/skills/engineering/architecture/message-queues-async/SKILL.md +58 -0
  521. package/skills/engineering/architecture/scalability-reliability/SKILL.md +62 -0
  522. package/skills/engineering/architecture/software-architecture-patterns/SKILL.md +56 -0
  523. package/skills/engineering/architecture/system-design-fundamentals/SKILL.md +56 -0
  524. package/skills/engineering/backend/auth-and-authorization/SKILL.md +62 -0
  525. package/skills/engineering/backend/backend-fundamentals/SKILL.md +65 -0
  526. package/skills/engineering/backend/observability-logging/SKILL.md +60 -0
  527. package/skills/engineering/frontend/accessibility-wcag/SKILL.md +57 -0
  528. package/skills/engineering/frontend/frontend-architecture/SKILL.md +65 -0
  529. package/skills/engineering/frontend/rendering-strategies-ssr-csr/SKILL.md +60 -0
  530. package/skills/engineering/frontend/state-management/SKILL.md +69 -0
  531. package/skills/engineering/performance/backend-performance/SKILL.md +69 -0
  532. package/skills/engineering/performance/database-query-optimization/SKILL.md +64 -0
  533. package/skills/engineering/performance/profiling-and-benchmarking/SKILL.md +60 -0
  534. package/skills/engineering/performance/web-performance-core-vitals/SKILL.md +72 -0
  535. package/skills/engineering/practices/clean-code/SKILL.md +61 -0
  536. package/skills/engineering/practices/code-optimization/SKILL.md +60 -0
  537. package/skills/engineering/practices/code-review-practices/SKILL.md +58 -0
  538. package/skills/engineering/practices/git-workflow/SKILL.md +62 -0
  539. package/skills/engineering/practices/refactoring/SKILL.md +58 -0
  540. package/skills/engineering/security/appsec-fundamentals/SKILL.md +70 -0
  541. package/skills/engineering/security/dependency-supply-chain/SKILL.md +77 -0
  542. package/skills/engineering/security/owasp-asvs/SKILL.md +54 -0
  543. package/skills/engineering/security/owasp-top-10/SKILL.md +63 -0
  544. package/skills/engineering/security/secrets-management/SKILL.md +58 -0
  545. package/skills/engineering/security/secure-auth-sessions/SKILL.md +56 -0
  546. package/skills/engineering/testing/tdd-and-coverage/SKILL.md +62 -0
  547. package/skills/engineering/testing/testing-strategy-pyramid/SKILL.md +56 -0
  548. package/skills/engineering/testing/unit-integration-e2e/SKILL.md +75 -0
  549. package/skills/languages/c/SKILL.md +74 -0
  550. package/skills/languages/clojure/SKILL.md +73 -0
  551. package/skills/languages/cpp/SKILL.md +75 -0
  552. package/skills/languages/csharp/SKILL.md +75 -0
  553. package/skills/languages/dart/SKILL.md +82 -0
  554. package/skills/languages/elixir/SKILL.md +74 -0
  555. package/skills/languages/erlang/SKILL.md +76 -0
  556. package/skills/languages/go/SKILL.md +83 -0
  557. package/skills/languages/haskell/SKILL.md +70 -0
  558. package/skills/languages/java/SKILL.md +71 -0
  559. package/skills/languages/javascript/SKILL.md +62 -0
  560. package/skills/languages/kotlin/SKILL.md +68 -0
  561. package/skills/languages/lua/SKILL.md +79 -0
  562. package/skills/languages/objectivec/SKILL.md +83 -0
  563. package/skills/languages/php/SKILL.md +74 -0
  564. package/skills/languages/python/SKILL.md +68 -0
  565. package/skills/languages/r/SKILL.md +70 -0
  566. package/skills/languages/ruby/SKILL.md +67 -0
  567. package/skills/languages/rust/SKILL.md +72 -0
  568. package/skills/languages/scala/SKILL.md +73 -0
  569. package/skills/languages/swift/SKILL.md +73 -0
  570. package/skills/languages/typescript/SKILL.md +69 -0
  571. package/skills/meta/authoring-agent-skills/SKILL.md +73 -0
  572. package/skills/meta/progressive-disclosure/SKILL.md +65 -0
  573. package/skills/meta/skill-frontmatter-spec/SKILL.md +65 -0
  574. package/skills/process/adr-technical-decisions/SKILL.md +59 -0
  575. package/skills/process/app-planning/SKILL.md +63 -0
  576. package/skills/process/architecture-before-code/SKILL.md +52 -0
  577. package/skills/process/breaking-work-into-sprints/SKILL.md +53 -0
  578. package/skills/process/idea-to-product/SKILL.md +50 -0
  579. package/skills/process/mocks-and-screen-flows/SKILL.md +52 -0
  580. package/skills/process/prioritization-moscow-rice/SKILL.md +64 -0
  581. package/skills/process/problem-framing/SKILL.md +51 -0
  582. package/skills/process/product-discovery/SKILL.md +53 -0
  583. package/skills/process/readme-generation/SKILL.md +90 -0
  584. package/skills/process/requirements-to-specs/SKILL.md +53 -0
  585. package/skills/process/research-official-docs/SKILL.md +58 -0
  586. package/skills/process/review-code-perf-security/SKILL.md +65 -0
  587. package/skills/process/security-by-design/SKILL.md +68 -0
  588. package/skills/process/specs-to-issues/SKILL.md +53 -0
  589. package/skills/process/testing-before-done/SKILL.md +61 -0
  590. package/skills/process/validating-ux-navigation/SKILL.md +63 -0
  591. package/skills/references/ai-attachments-ui/SKILL.md +66 -0
  592. package/skills/references/ai-in-browser-webllm/SKILL.md +74 -0
  593. package/skills/references/ai-tool-ui-patterns/SKILL.md +63 -0
  594. package/skills/references/component-patterns-gallery/SKILL.md +62 -0
  595. package/skills/references/gradient-resources/SKILL.md +66 -0
  596. package/skills/references/react-component-libraries/SKILL.md +61 -0
  597. package/skills/references/saas-landing-patterns/SKILL.md +67 -0
  598. package/skills/references/shadcn-tailwind-theming/SKILL.md +74 -0
  599. package/skills/references/vercel-ai-sdk-elements/SKILL.md +66 -0
  600. package/skills/references/web-animation-codrops/SKILL.md +68 -0
  601. package/skills/stacks/aiml/jupyter/SKILL.md +68 -0
  602. package/skills/stacks/aiml/keras/SKILL.md +77 -0
  603. package/skills/stacks/aiml/numpy/SKILL.md +69 -0
  604. package/skills/stacks/aiml/pandas/SKILL.md +72 -0
  605. package/skills/stacks/aiml/pytorch/SKILL.md +77 -0
  606. package/skills/stacks/aiml/scikit-learn/SKILL.md +74 -0
  607. package/skills/stacks/aiml/tensorflow/SKILL.md +79 -0
  608. package/skills/stacks/auth/auth0/SKILL.md +63 -0
  609. package/skills/stacks/auth/authjs/SKILL.md +69 -0
  610. package/skills/stacks/auth/clerk/SKILL.md +72 -0
  611. package/skills/stacks/auth/keycloak/SKILL.md +63 -0
  612. package/skills/stacks/auth/lucia/SKILL.md +56 -0
  613. package/skills/stacks/auth/passport/SKILL.md +70 -0
  614. package/skills/stacks/auth/supabase-auth/SKILL.md +66 -0
  615. package/skills/stacks/baas/amplify/SKILL.md +71 -0
  616. package/skills/stacks/baas/appwrite/SKILL.md +79 -0
  617. package/skills/stacks/baas/firebase/SKILL.md +73 -0
  618. package/skills/stacks/baas/heroku/SKILL.md +71 -0
  619. package/skills/stacks/backend/actix/SKILL.md +77 -0
  620. package/skills/stacks/backend/adonisjs/SKILL.md +65 -0
  621. package/skills/stacks/backend/aspnet-core/SKILL.md +75 -0
  622. package/skills/stacks/backend/codeigniter/SKILL.md +76 -0
  623. package/skills/stacks/backend/django/SKILL.md +62 -0
  624. package/skills/stacks/backend/express/SKILL.md +65 -0
  625. package/skills/stacks/backend/fastapi/SKILL.md +64 -0
  626. package/skills/stacks/backend/fastify/SKILL.md +64 -0
  627. package/skills/stacks/backend/fiber/SKILL.md +68 -0
  628. package/skills/stacks/backend/flask/SKILL.md +71 -0
  629. package/skills/stacks/backend/gin/SKILL.md +68 -0
  630. package/skills/stacks/backend/graphql/SKILL.md +70 -0
  631. package/skills/stacks/backend/hono/SKILL.md +64 -0
  632. package/skills/stacks/backend/koa/SKILL.md +63 -0
  633. package/skills/stacks/backend/laravel/SKILL.md +73 -0
  634. package/skills/stacks/backend/nestjs/SKILL.md +70 -0
  635. package/skills/stacks/backend/nginx/SKILL.md +77 -0
  636. package/skills/stacks/backend/phoenix/SKILL.md +68 -0
  637. package/skills/stacks/backend/rails/SKILL.md +67 -0
  638. package/skills/stacks/backend/spring/SKILL.md +70 -0
  639. package/skills/stacks/backend/spring-boot/SKILL.md +70 -0
  640. package/skills/stacks/backend/symfony/SKILL.md +77 -0
  641. package/skills/stacks/container/containerd/SKILL.md +75 -0
  642. package/skills/stacks/container/docker/SKILL.md +90 -0
  643. package/skills/stacks/container/podman/SKILL.md +93 -0
  644. package/skills/stacks/database/cassandra/SKILL.md +74 -0
  645. package/skills/stacks/database/cockroachdb/SKILL.md +69 -0
  646. package/skills/stacks/database/dynamodb/SKILL.md +62 -0
  647. package/skills/stacks/database/mariadb/SKILL.md +71 -0
  648. package/skills/stacks/database/mongodb/SKILL.md +71 -0
  649. package/skills/stacks/database/mysql/SKILL.md +72 -0
  650. package/skills/stacks/database/neon/SKILL.md +68 -0
  651. package/skills/stacks/database/planetscale/SKILL.md +70 -0
  652. package/skills/stacks/database/postgresql/SKILL.md +81 -0
  653. package/skills/stacks/database/redis/SKILL.md +78 -0
  654. package/skills/stacks/database/sqlite/SKILL.md +70 -0
  655. package/skills/stacks/database/supabase/SKILL.md +79 -0
  656. package/skills/stacks/dataviz/chart-js/SKILL.md +72 -0
  657. package/skills/stacks/dataviz/d3/SKILL.md +77 -0
  658. package/skills/stacks/dataviz/grafana/SKILL.md +69 -0
  659. package/skills/stacks/dataviz/plotly/SKILL.md +71 -0
  660. package/skills/stacks/frontend/alpine/SKILL.md +75 -0
  661. package/skills/stacks/frontend/angular/SKILL.md +75 -0
  662. package/skills/stacks/frontend/backbone/SKILL.md +82 -0
  663. package/skills/stacks/frontend/ember/SKILL.md +85 -0
  664. package/skills/stacks/frontend/htmx/SKILL.md +73 -0
  665. package/skills/stacks/frontend/lit/SKILL.md +76 -0
  666. package/skills/stacks/frontend/preact/SKILL.md +74 -0
  667. package/skills/stacks/frontend/qwik/SKILL.md +65 -0
  668. package/skills/stacks/frontend/react/SKILL.md +77 -0
  669. package/skills/stacks/frontend/solidjs/SKILL.md +75 -0
  670. package/skills/stacks/frontend/svelte/SKILL.md +70 -0
  671. package/skills/stacks/frontend/vue/SKILL.md +69 -0
  672. package/skills/stacks/infra/ansible/SKILL.md +76 -0
  673. package/skills/stacks/infra/aws/SKILL.md +66 -0
  674. package/skills/stacks/infra/azure/SKILL.md +72 -0
  675. package/skills/stacks/infra/circleci/SKILL.md +78 -0
  676. package/skills/stacks/infra/cloudflare/SKILL.md +65 -0
  677. package/skills/stacks/infra/fly-io/SKILL.md +63 -0
  678. package/skills/stacks/infra/gcp/SKILL.md +66 -0
  679. package/skills/stacks/infra/jenkins/SKILL.md +73 -0
  680. package/skills/stacks/infra/kubernetes/SKILL.md +64 -0
  681. package/skills/stacks/infra/netlify/SKILL.md +60 -0
  682. package/skills/stacks/infra/railway/SKILL.md +63 -0
  683. package/skills/stacks/infra/tailscale/SKILL.md +65 -0
  684. package/skills/stacks/infra/terraform/SKILL.md +75 -0
  685. package/skills/stacks/infra/vagrant/SKILL.md +70 -0
  686. package/skills/stacks/infra/vercel/SKILL.md +60 -0
  687. package/skills/stacks/meta/astro/SKILL.md +64 -0
  688. package/skills/stacks/meta/docusaurus/SKILL.md +71 -0
  689. package/skills/stacks/meta/eleventy/SKILL.md +69 -0
  690. package/skills/stacks/meta/gatsby/SKILL.md +63 -0
  691. package/skills/stacks/meta/hugo/SKILL.md +73 -0
  692. package/skills/stacks/meta/jekyll/SKILL.md +70 -0
  693. package/skills/stacks/meta/nextjs/SKILL.md +62 -0
  694. package/skills/stacks/meta/nuxt/SKILL.md +66 -0
  695. package/skills/stacks/meta/remix/SKILL.md +67 -0
  696. package/skills/stacks/meta/sveltekit/SKILL.md +70 -0
  697. package/skills/stacks/meta/vite/SKILL.md +63 -0
  698. package/skills/stacks/mobile/android/SKILL.md +77 -0
  699. package/skills/stacks/mobile/flutter/SKILL.md +77 -0
  700. package/skills/stacks/mobile/ionic/SKILL.md +72 -0
  701. package/skills/stacks/mobile/nativescript/SKILL.md +71 -0
  702. package/skills/stacks/mobile/react-native/SKILL.md +75 -0
  703. package/skills/stacks/mobile/xamarin/SKILL.md +73 -0
  704. package/skills/stacks/orm/diesel/SKILL.md +72 -0
  705. package/skills/stacks/orm/django-orm/SKILL.md +58 -0
  706. package/skills/stacks/orm/drizzle/SKILL.md +67 -0
  707. package/skills/stacks/orm/gorm/SKILL.md +73 -0
  708. package/skills/stacks/orm/knex/SKILL.md +64 -0
  709. package/skills/stacks/orm/mongoose/SKILL.md +64 -0
  710. package/skills/stacks/orm/prisma/SKILL.md +64 -0
  711. package/skills/stacks/orm/sequelize/SKILL.md +65 -0
  712. package/skills/stacks/orm/sqlalchemy/SKILL.md +71 -0
  713. package/skills/stacks/orm/typeorm/SKILL.md +70 -0
  714. package/skills/stacks/queue/bullmq/SKILL.md +69 -0
  715. package/skills/stacks/queue/celery/SKILL.md +68 -0
  716. package/skills/stacks/queue/kafka/SKILL.md +66 -0
  717. package/skills/stacks/queue/nats/SKILL.md +66 -0
  718. package/skills/stacks/queue/rabbitmq/SKILL.md +64 -0
  719. package/skills/stacks/queue/redis/SKILL.md +66 -0
  720. package/skills/stacks/runtime/beam/SKILL.md +72 -0
  721. package/skills/stacks/runtime/bun/SKILL.md +80 -0
  722. package/skills/stacks/runtime/deno/SKILL.md +74 -0
  723. package/skills/stacks/runtime/dotnet/SKILL.md +64 -0
  724. package/skills/stacks/runtime/jvm/SKILL.md +66 -0
  725. package/skills/stacks/runtime/node/SKILL.md +70 -0
  726. package/skills/stacks/runtime/pypy/SKILL.md +69 -0
  727. package/skills/stacks/runtime/python3/SKILL.md +70 -0
  728. package/skills/stacks/styling/bootstrap/SKILL.md +74 -0
  729. package/skills/stacks/styling/bulma/SKILL.md +80 -0
  730. package/skills/stacks/styling/chakra-ui/SKILL.md +61 -0
  731. package/skills/stacks/styling/css-modules/SKILL.md +54 -0
  732. package/skills/stacks/styling/mui/SKILL.md +60 -0
  733. package/skills/stacks/styling/sass/SKILL.md +63 -0
  734. package/skills/stacks/styling/shadcn-ui/SKILL.md +58 -0
  735. package/skills/stacks/styling/styled-components/SKILL.md +62 -0
  736. package/skills/stacks/styling/tailwind/SKILL.md +59 -0
  737. package/skills/stacks/styling/unocss/SKILL.md +64 -0
  738. package/skills/stacks/styling/vanilla-extract/SKILL.md +64 -0
  739. package/skills/stacks/styling/vuetify/SKILL.md +89 -0
  740. package/skills/stacks/testing/cypress/SKILL.md +68 -0
  741. package/skills/stacks/testing/jasmine/SKILL.md +67 -0
  742. package/skills/stacks/testing/jest/SKILL.md +67 -0
  743. package/skills/stacks/testing/mocha/SKILL.md +71 -0
  744. package/skills/stacks/testing/playwright/SKILL.md +68 -0
  745. package/skills/stacks/testing/puppeteer/SKILL.md +70 -0
  746. package/skills/stacks/testing/selenium/SKILL.md +70 -0
  747. package/skills/stacks/testing/vitest/SKILL.md +68 -0
@@ -0,0 +1,188 @@
1
+ exports.id=1619,exports.ids=[1619],exports.modules={91619:(a,b,c)=>{"use strict";let d;c.d(b,{YH:()=>lv,DW:()=>kW,R$:()=>lw,Ay:()=>lu});var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,$,_,aa,ab,ac,ad,ae,af,ag,ah,ai,aj,ak,al,am,an,ao,ap,aq,ar,as,at,au,av,aw,ax,ay,az,aA,aB,aC,aD,aE,aF,aG,aH,aI,aJ,aK,aL,aM,aN,aO,aP,aQ,aR,aS,aT,aU,aV,aW,aX,aY,aZ,a$,a_,a0,a1,a2,a3,a4,a5,a6,a7,a8,a9,ba,bb,bc,bd,be,bf,bg,bh,bi,bj,bk,bl,bm={};c.r(bm),c.d(bm,{Any:()=>dy,BaseBlock:()=>cC,BaseStringBlock:()=>cD,BitString:()=>cX,BmpString:()=>de,Boolean:()=>cT,CharacterString:()=>dq,Choice:()=>dz,Constructed:()=>cO,DATE:()=>dt,DEFAULT_MAX_CONTENT_LENGTH:()=>cI,DEFAULT_MAX_DEPTH:()=>cG,DEFAULT_MAX_NODES:()=>cH,DateTime:()=>dv,Duration:()=>dw,EndOfContent:()=>cQ,Enumerated:()=>c_,GeneralString:()=>dp,GeneralizedTime:()=>ds,GraphicString:()=>dm,HexBlock:()=>cw,IA5String:()=>dl,Integer:()=>c$,Null:()=>cR,NumericString:()=>dh,ObjectIdentifier:()=>c2,OctetString:()=>cV,Primitive:()=>cF,PrintableString:()=>di,RawData:()=>dB,RelativeObjectIdentifier:()=>c5,Repeated:()=>dA,Sequence:()=>c6,Set:()=>c7,TIME:()=>dx,TeletexString:()=>dj,TimeOfDay:()=>du,UTCTime:()=>dr,UniversalString:()=>dg,Utf8String:()=>dc,ValueBlock:()=>cy,VideotexString:()=>dk,ViewWriter:()=>cm,VisibleString:()=>dn,compareSchema:()=>dC,fromBER:()=>cM,verifySchema:()=>dD});let bn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bp=a=>{let b="u"<typeof Uint8Array?[]:new Uint8Array(256),c=bn.length;for(let d=0;d<c;d++)b[a.charCodeAt(d)]=d;return b},bq=bp(bn),br=bp(bo),bs=/^[-A-Za-z0-9\-_]*$/,bt=/^[-A-Za-z0-9+/]*={0,3}$/,bu={};function bv(a,b="base64url"){return new Uint8Array(bu.toArrayBuffer(a,"base64url"===b))}function bw(a,b="base64url"){let c=new Uint8Array(a);return bu.fromArrayBuffer(c.buffer,"base64url"===b)}function bx(a){return bu.toString(a,!0)}function by(a){return a=bz(a),bu.validate(a,!0)}function bz(a){return a.replace(/=/g,"")}function bA(a,b,c){let d;if(b<24)return[b,1];let e=a.byteLength-c-1,f=new DataView(a.buffer,c+1),g=0;switch(b){case 24:e>0&&(d=f.getUint8(0),g=2);break;case 25:e>1&&(d=f.getUint16(0,!1),g=3);break;case 26:e>3&&(d=f.getUint32(0,!1),g=5);break;case 27:if(e>7){let a=f.getBigUint64(0,!1);if(a>=24n&&a<=Number.MAX_SAFE_INTEGER)return[Number(a),9]}}if(d&&d>=24)return[d,g];throw Error("Length not supported or not well formed")}function bB(a,b){let c,d=a<<5;if(b<0)throw Error("CBOR Data Item argument must not be negative");if("number"==typeof b){if(!Number.isInteger(b))throw Error("CBOR Data Item argument must be an integer");c=BigInt(b)}else c=b;if(1==a){if(0n==c)throw Error("CBOR Data Item argument cannot be zero when negative");c-=1n}if(c>0xffffffffffffffffn)throw Error("CBOR number out of range");let e=new Uint8Array(8);return(new DataView(e.buffer).setBigUint64(0,c,!1),c<=23)?[d|e[7]]:c<=255?[24|d,e[7]]:c<=65535?[25|d,...e.slice(6)]:c<=0xffffffff?[26|d,...e.slice(4)]:[27|d,...e]}bu.toArrayBuffer=(a,b)=>{let c=a.length,d=.75*a.length,e,f=0,g,h,i,j;"="===a[a.length-1]&&(d--,"="===a[a.length-2]&&d--);let k=new ArrayBuffer(d),l=new Uint8Array(k),m=b?br:bq;for(e=0;e<c;e+=4)g=m[a.charCodeAt(e)],h=m[a.charCodeAt(e+1)],i=m[a.charCodeAt(e+2)],j=m[a.charCodeAt(e+3)],l[f++]=g<<2|h>>4,l[f++]=(15&h)<<4|i>>2,l[f++]=(3&i)<<6|63&j;return k},bu.fromArrayBuffer=(a,b)=>{let c=new Uint8Array(a),d,e="",f=c.length,g=b?bo:bn;for(d=0;d<f;d+=3)e+=g[c[d]>>2],e+=g[(3&c[d])<<4|c[d+1]>>4],e+=g[(15&c[d+1])<<2|c[d+2]>>6],e+=g[63&c[d+2]];let h=f%3;return 2===h?e=e.substring(0,e.length-1)+(b?"":"="):1===h&&(e=e.substring(0,e.length-2)+(b?"":"==")),e},bu.toString=(a,b)=>new TextDecoder().decode(bu.toArrayBuffer(a,b)),bu.fromString=(a,b)=>bu.fromArrayBuffer(new TextEncoder().encode(a),b),bu.validate=(a,b)=>{if(!("string"==typeof a||a instanceof String))return!1;try{return b?bs.test(a):bt.test(a)}catch(a){return!1}},bu.base64=bu;class bC{constructor(a,b){Object.defineProperty(this,"tagId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tagValue",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.tagId=a,this.tagValue=b}get tag(){return this.tagId}get value(){return this.tagValue}}function bD(a,b,c){let[d,e]=bA(a,b,c),f=c+e;return[new Uint8Array(a.buffer.slice(f,f+d)),e+d]}let bE=new TextDecoder,bF="Map is not supported or well formed";function bG(a,b){if(b>=a.byteLength)throw Error("CBOR stream ended before tag value");let c=a.getUint8(b),d=31&c;switch(c>>5){case 0:return bA(a,d,b);case 1:return function(a,b,c){let[d,e]=bA(a,b,c);return[-d-1,e]}(a,d,b);case 2:return bD(a,d,b);case 3:return function(a,b,c){let[d,e]=bD(a,b,c);return[bE.decode(d),e]}(a,d,b);case 4:return function(a,b,c){if(0===b)return[[],1];let[d,e]=bA(a,b,c),f=e,g=[];for(let b=0;b<d;b++){if(a.byteLength-c-f<=0)throw Error("array is not supported or well formed");let[b,d]=bG(a,c+f);g.push(b),f+=d}return[g,f]}(a,d,b);case 5:return function(a,b,c){if(0===b)return[new Map,1];let[d,e]=bA(a,b,c),f=e,g=new Map;for(let b=0;b<d;b++){let b=a.byteLength-c-f;if(b<=0)throw Error(bF);let[d,e]=bG(a,c+f);if(f+=e,(b-=e)<=0||"string"!=typeof d&&"number"!=typeof d||g.has(d))throw Error(bF);let[h,i]=bG(a,c+f);f+=i,g.set(d,h)}return[g,f]}(a,d,b);case 6:return function(a,b,c){let[d,e]=bA(a,b,c),[f,g]=bG(a,c+e);return[new bC(d,f),e+g]}(a,d,b);case 7:switch(d){case 20:return[!1,1];case 21:return[!0,1];case 22:return[null,1];case 23:return[void 0,1];case 25:if(b+3>a.byteLength)throw Error("CBOR stream ended before end of Float 16");let e=a.getUint16(b+1,!1);if(31744==e)return[1/0,3];if(32256==e)return[NaN,3];if(64512==e)return[-1/0,3];throw Error("Float16 data is unsupported");case 26:if(b+5>a.byteLength)throw Error("CBOR stream ended before end of Float 32");return[a.getFloat32(b+1,!1),5];case 27:if(b+9>a.byteLength)throw Error("CBOR stream ended before end of Float 64");return[a.getFloat64(b+1,!1),9]}}throw Error(`Unsupported or not well formed at ${b}`)}let bH=new TextEncoder;function bI(a){let[b]=function(a){if(0===a.byteLength||a.byteLength<=0)throw Error("No data");return a instanceof Uint8Array?bG(new DataView(a.buffer),0):a instanceof ArrayBuffer?bG(new DataView(a),0):bG(a,0)}(new Uint8Array(a));return b}function bJ(a){let b=[];!function a(b,c){if("boolean"==typeof b||null===b||void 0==b){var d;return void c.push(!0===(d=b)?245:!1===d?244:null===d?246:247)}if("number"==typeof b||"bigint"==typeof b)return void c.push(...function(a){if("number"==typeof a){if(Number.isSafeInteger(a))if(a<0)return bB(1,Math.abs(a));else return bB(0,a);return[function(a){if(Math.fround(a)==a||!Number.isFinite(a)||Number.isNaN(a)){let b=new Uint8Array(5);return b[0]=250,new DataView(b.buffer).setFloat32(1,a,!1),b}{let b=new Uint8Array(9);return b[0]=251,new DataView(b.buffer).setFloat64(1,a,!1),b}}(a)]}return a<0n?bB(1,-(1n*a)):bB(0,a)}(b));if("string"==typeof b)return void(c.push(...bB(3,b.length)),c.push(bH.encode(b)));if(b instanceof Uint8Array)return void(c.push(...bB(2,b.length)),c.push(b));if(Array.isArray(b))return void function(b,c){for(let d of(c.push(...bB(4,b.length)),b))a(d,c)}(b,c);if(b instanceof Map)return void function(b,c){for(let[d,e]of(c.push(new Uint8Array(bB(5,b.size))),b.entries()))a(d,c),a(e,c)}(b,c);if(b instanceof bC)return void(c.push(...bB(6,b.tag)),a(b.value,c));throw Error("Not implemented")}(a,b);let c=0;for(let a of b)"number"==typeof a?c+=1:c+=a.length;let d=new Uint8Array(c),e=0;for(let a of b)"number"==typeof a?(d[e]=a,e+=1):(d.set(a,e),e+=a.length);return d}function bK(a){let b=a.get(D.kty);return bM(b)&&b===E.EC2}function bL(a){let b=a.get(D.kty);return bM(b)&&b===E.RSA}function bM(a){return Object.values(E).indexOf(a)>=0}function bN(a){return Object.values(G).indexOf(a)>=0}function bO(a){if([G.RS1].indexOf(a)>=0)return"SHA-1";if([G.ES256,G.PS256,G.RS256].indexOf(a)>=0)return"SHA-256";if([G.ES384,G.PS384,G.RS384].indexOf(a)>=0)return"SHA-384";if([G.ES512,G.PS512,G.RS512,G.EdDSA].indexOf(a)>=0)return"SHA-512";throw Error(`Could not map COSE alg value of ${a} to a WebCrypto alg`)}function bP(){return new Promise((a,b)=>{if(d)return a(d);let c=bR.stubThisGlobalThisCrypto();return c?a(d=c):b(new bQ)})}(e=D||(D={}))[e.kty=1]="kty",e[e.alg=3]="alg",e[e.crv=-1]="crv",e[e.x=-2]="x",e[e.y=-3]="y",e[e.n=-1]="n",e[e.e=-2]="e",(f=E||(E={}))[f.OKP=1]="OKP",f[f.EC2=2]="EC2",f[f.RSA=3]="RSA",(g=F||(F={}))[g.P256=1]="P256",g[g.P384=2]="P384",g[g.P521=3]="P521",g[g.ED25519=6]="ED25519",g[g.SECP256K1=8]="SECP256K1",(h=G||(G={}))[h.ES256=-7]="ES256",h[h.EdDSA=-8]="EdDSA",h[h.ES384=-35]="ES384",h[h.ES512=-36]="ES512",h[h.PS256=-37]="PS256",h[h.PS384=-38]="PS384",h[h.PS512=-39]="PS512",h[h.ES256K=-47]="ES256K",h[h.RS256=-257]="RS256",h[h.RS384=-258]="RS384",h[h.RS512=-259]="RS512",h[h.RS1=-65535]="RS1";class bQ extends Error{constructor(){super("An instance of the Crypto API could not be located"),this.name="MissingWebCrypto"}}let bR={stubThisGlobalThisCrypto:()=>globalThis.crypto};async function bS(a,b){let c=await bP(),d=bO(b);return new Uint8Array(await c.subtle.digest(d,a))}async function bT(a){return(await bP()).getRandomValues(a),a}async function bU(a){let b=await bP(),{keyData:c,algorithm:d}=a;return b.subtle.importKey("jwk",c,d,!1,["verify"])}async function bV(a){let b,{cosePublicKey:c,signature:d,data:e,shaHashOverride:f}=a,g=await bP(),h=c.get(D.alg),i=c.get(D.crv),j=c.get(D.x),k=c.get(D.y);if(!h)throw Error("Public key was missing alg (EC2)");if(!i)throw Error("Public key was missing crv (EC2)");if(!j)throw Error("Public key was missing x (EC2)");if(!k)throw Error("Public key was missing y (EC2)");if(i===F.P256)b="P-256";else if(i===F.P384)b="P-384";else if(i===F.P521)b="P-521";else throw Error(`Unexpected COSE crv value of ${i} (EC2)`);let l={kty:"EC",crv:b,x:bw(j),y:bw(k),ext:!1},m={name:"ECDSA",namedCurve:b},n=await bU({keyData:l,algorithm:m}),o=bO(h);f&&(o=bO(f));let p={name:"ECDSA",hash:{name:o}};return g.subtle.verify(p,n,d,e)}function bW(a){if([G.EdDSA].indexOf(a)>=0)return"Ed25519";if([G.ES256,G.ES384,G.ES512,G.ES256K].indexOf(a)>=0)return"ECDSA";if([G.RS256,G.RS384,G.RS512,G.RS1].indexOf(a)>=0)return"RSASSA-PKCS1-v1_5";if([G.PS256,G.PS384,G.PS512].indexOf(a)>=0)return"RSA-PSS";throw Error(`Could not map COSE alg value of ${a} to a WebCrypto key alg name`)}async function bX(a){let{cosePublicKey:b,signature:c,data:d,shaHashOverride:e}=a,f=await bP(),g=b.get(D.alg),h=b.get(D.n),i=b.get(D.e);if(!g)throw Error("Public key was missing alg (RSA)");if(!bN(g))throw Error(`Public key had invalid alg ${g} (RSA)`);if(!h)throw Error("Public key was missing n (RSA)");if(!i)throw Error("Public key was missing e (RSA)");let j={kty:"RSA",alg:"",n:bw(h),e:bw(i),ext:!1},k={name:bW(g),hash:{name:bO(g)}},l={name:bW(g)};if(e&&(k.hash.name=bO(e)),"RSASSA-PKCS1-v1_5"===k.name)"SHA-256"===k.hash.name?j.alg="RS256":"SHA-384"===k.hash.name?j.alg="RS384":"SHA-512"===k.hash.name?j.alg="RS512":"SHA-1"===k.hash.name&&(j.alg="RS1");else if("RSA-PSS"===k.name){let a=0;"SHA-256"===k.hash.name?(j.alg="PS256",a=32):"SHA-384"===k.hash.name?(j.alg="PS384",a=48):"SHA-512"===k.hash.name&&(j.alg="PS512",a=64),l.saltLength=a}else throw Error(`Unexpected RSA key algorithm ${g} (${k.name})`);let m=await bU({keyData:j,algorithm:k});return f.subtle.verify(l,m,c,d)}function bY(a){let b=kN(a);return[b.slice(0,8),b.slice(8,12),b.slice(12,16),b.slice(16,20),b.slice(20,32)].join("-")}function bZ(a){let b;if("string"==typeof a)if(by(a)){let c;c=bu.toArrayBuffer(a,!0),b=bu.fromArrayBuffer(c)}else if(bu.validate(a,!1))b=a;else throw Error("Certificate is not a valid base64 or base64url string");else b=bw(a,"base64");let c="";for(let a=0;a<Math.ceil(b.length/64);a+=1){let d=64*a;c+=`${b.substr(d,64)}
2
+ `}return`-----BEGIN CERTIFICATE-----
3
+ ${c}-----END CERTIFICATE-----
4
+ `}function b$(a){let b=bI(a),c=Uint8Array.from([4]),d=b.get(D.x),e=b.get(D.y);if(!d)throw Error("COSE public key was missing x");return e?kO([c,d,e]):kO([c,d])}let b_=a=>a;function b0(a){let b=JSON.parse(bx(a));return b1.stubThis(b)}let b1={stubThis:a=>a};function b2(a){return b3.stubThis(bI(a))}let b3={stubThis:a=>a};async function b4(){let a=new Uint8Array(32);return await bT(a),b5.stubThis(a)}let b5={stubThis:a=>a};class b6{static isArrayBuffer(a){return"[object ArrayBuffer]"===Object.prototype.toString.call(a)}static toArrayBuffer(a){return this.isArrayBuffer(a)?a:a.byteLength===a.buffer.byteLength||0===a.byteOffset&&a.byteLength===a.buffer.byteLength?a.buffer:this.toUint8Array(a.buffer).slice(a.byteOffset,a.byteOffset+a.byteLength).buffer}static toUint8Array(a){return this.toView(a,Uint8Array)}static toView(a,b){if(a.constructor===b)return a;if(this.isArrayBuffer(a))return new b(a);if(this.isArrayBufferView(a))return new b(a.buffer,a.byteOffset,a.byteLength);throw TypeError("The provided value is not of type '(ArrayBuffer or ArrayBufferView)'")}static isBufferSource(a){return this.isArrayBufferView(a)||this.isArrayBuffer(a)}static isArrayBufferView(a){return ArrayBuffer.isView(a)||a&&this.isArrayBuffer(a.buffer)}static isEqual(a,b){let c=b6.toUint8Array(a),d=b6.toUint8Array(b);if(c.length!==d.byteLength)return!1;for(let a=0;a<c.length;a++)if(c[a]!==d[a])return!1;return!0}static concat(...a){let b;b=!Array.isArray(a[0])||a[1]instanceof Function?Array.isArray(a[0])&&a[1]instanceof Function?a[0]:a[a.length-1]instanceof Function?a.slice(0,a.length-1):a:a[0];let c=0;for(let a of b)c+=a.byteLength;let d=new Uint8Array(c),e=0;for(let a of b){let b=this.toUint8Array(a);d.set(b,e),e+=b.length}return a[a.length-1]instanceof Function?this.toView(d,a[a.length-1]):d.buffer}}let b7="string",b8=/^[0-9a-f\s]+$/i,b9=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,ca=/^[a-zA-Z0-9-_]+$/;class cb{static fromString(a){let b=unescape(encodeURIComponent(a)),c=new Uint8Array(b.length);for(let a=0;a<b.length;a++)c[a]=b.charCodeAt(a);return c.buffer}static toString(a){let b=b6.toUint8Array(a),c="";for(let a=0;a<b.length;a++)c+=String.fromCharCode(b[a]);return decodeURIComponent(escape(c))}}class cc{static toString(a,b=!1){let c=b6.toArrayBuffer(a),d=new DataView(c),e="";for(let a=0;a<c.byteLength;a+=2)e+=String.fromCharCode(d.getUint16(a,b));return e}static fromString(a,b=!1){let c=new ArrayBuffer(2*a.length),d=new DataView(c);for(let c=0;c<a.length;c++)d.setUint16(2*c,a.charCodeAt(c),b);return c}}class cd{static isHex(a){return typeof a===b7&&b8.test(a)}static isBase64(a){return typeof a===b7&&b9.test(a)}static isBase64Url(a){return typeof a===b7&&ca.test(a)}static ToString(a,b="utf8"){let c=b6.toUint8Array(a);switch(b.toLowerCase()){case"utf8":return this.ToUtf8String(c);case"binary":return this.ToBinary(c);case"hex":return this.ToHex(c);case"base64":return this.ToBase64(c);case"base64url":return this.ToBase64Url(c);case"utf16le":return cc.toString(c,!0);case"utf16":case"utf16be":return cc.toString(c);default:throw Error(`Unknown type of encoding '${b}'`)}}static FromString(a,b="utf8"){if(!a)return new ArrayBuffer(0);switch(b.toLowerCase()){case"utf8":return this.FromUtf8String(a);case"binary":return this.FromBinary(a);case"hex":return this.FromHex(a);case"base64":return this.FromBase64(a);case"base64url":return this.FromBase64Url(a);case"utf16le":return cc.fromString(a,!0);case"utf16":case"utf16be":return cc.fromString(a);default:throw Error(`Unknown type of encoding '${b}'`)}}static ToBase64(a){let b=b6.toUint8Array(a);return"u">typeof btoa?btoa(this.ToString(b,"binary")):Buffer.from(b).toString("base64")}static FromBase64(a){let b=this.formatString(a);if(!b)return new ArrayBuffer(0);if(!cd.isBase64(b))throw TypeError("Argument 'base64Text' is not Base64 encoded");return"u">typeof atob?this.FromBinary(atob(b)):new Uint8Array(Buffer.from(b,"base64")).buffer}static FromBase64Url(a){let b=this.formatString(a);if(!b)return new ArrayBuffer(0);if(!cd.isBase64Url(b))throw TypeError("Argument 'base64url' is not Base64Url encoded");return this.FromBase64(this.Base64Padding(b.replace(/\-/g,"+").replace(/\_/g,"/")))}static ToBase64Url(a){return this.ToBase64(a).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}static FromUtf8String(a,b=cd.DEFAULT_UTF8_ENCODING){switch(b){case"ascii":return this.FromBinary(a);case"utf8":return cb.fromString(a);case"utf16":case"utf16be":return cc.fromString(a);case"utf16le":case"usc2":return cc.fromString(a,!0);default:throw Error(`Unknown type of encoding '${b}'`)}}static ToUtf8String(a,b=cd.DEFAULT_UTF8_ENCODING){switch(b){case"ascii":return this.ToBinary(a);case"utf8":return cb.toString(a);case"utf16":case"utf16be":return cc.toString(a);case"utf16le":case"usc2":return cc.toString(a,!0);default:throw Error(`Unknown type of encoding '${b}'`)}}static FromBinary(a){let b=a.length,c=new Uint8Array(b);for(let d=0;d<b;d++)c[d]=a.charCodeAt(d);return c.buffer}static ToBinary(a){let b=b6.toUint8Array(a),c="";for(let a=0;a<b.length;a++)c+=String.fromCharCode(b[a]);return c}static ToHex(a){let b=b6.toUint8Array(a),c="",d=b.length;for(let a=0;a<d;a++){let d=b[a];d<16&&(c+="0"),c+=d.toString(16)}return c}static FromHex(a){let b=this.formatString(a);if(!b)return new ArrayBuffer(0);if(!cd.isHex(b))throw TypeError("Argument 'hexString' is not HEX encoded");b.length%2&&(b=`0${b}`);let c=new Uint8Array(b.length/2);for(let a=0;a<b.length;a+=2){let d=b.slice(a,a+2);c[a/2]=parseInt(d,16)}return c.buffer}static ToUtf16String(a,b=!1){return cc.toString(a,b)}static FromUtf16String(a,b=!1){return cc.fromString(a,b)}static Base64Padding(a){let b=4-a.length%4;if(b<4)for(let c=0;c<b;c++)a+="=";return a}static formatString(a){return(null==a?void 0:a.replace(/[\n\r\t ]/g,""))||""}}function ce(a,b){let c=0;if(1===a.length)return a[0];for(let d=a.length-1;d>=0;d--)c+=a[a.length-1-d]*Math.pow(2,b*d);return c}function cf(a,b,c=-1){let d=a,e=0,f=Math.pow(2,b);for(let g=1;g<8;g++){if(a<f){let a;if(c<0)a=new ArrayBuffer(g),e=g;else{if(c<g)return new ArrayBuffer(0);a=new ArrayBuffer(c),e=c}let f=new Uint8Array(a);for(let a=g-1;a>=0;a--){let c=Math.pow(2,a*b);f[e-a-1]=Math.floor(d/c),d-=f[e-a-1]*c}return a}f*=Math.pow(2,b)}return new ArrayBuffer(0)}function cg(...a){let b=0,c=0;for(let c of a)b+=c.length;let d=new Uint8Array(new ArrayBuffer(b));for(let b of a)d.set(b,c),c+=b.length;return d}function ch(){let a=new Uint8Array(this.valueHex);if(this.valueHex.byteLength>=2){let b=255===a[0]&&128&a[1],c=0===a[0]&&(128&a[1])==0;(b||c)&&this.warnings.push("Needlessly long format")}let b=new Uint8Array(new ArrayBuffer(this.valueHex.byteLength));for(let a=0;a<this.valueHex.byteLength;a++)b[a]=0;b[0]=128&a[0];let c=ce(b,8),d=new Uint8Array(new ArrayBuffer(this.valueHex.byteLength));for(let b=0;b<this.valueHex.byteLength;b++)d[b]=a[b];return d[0]&=127,ce(d,8)-c}function ci(a,b){let c=a.toString(10);if(b<c.length)return"";let d=b-c.length,e=Array(d);for(let a=0;a<d;a++)e[a]="0";return e.join("").concat(c)}function cj(){if("u"<typeof BigInt)throw Error("BigInt is not defined. Your environment doesn't implement BigInt.")}function ck(a){let b=0,c=0;for(let c=0;c<a.length;c++)b+=a[c].byteLength;let d=new Uint8Array(b);for(let b=0;b<a.length;b++){let e=a[b];d.set(new Uint8Array(e),c),c+=e.byteLength}return d.buffer}function cl(a,b,c,d){return b instanceof Uint8Array?b.byteLength?c<0?(a.error="Wrong parameter: inputOffset less than zero",!1):d<0?(a.error="Wrong parameter: inputLength less than zero",!1):!(b.byteLength-c-d<0)||(a.error="End of input reached before message was fully decoded (inconsistent offset and length values)",!1):(a.error="Wrong parameter: inputBuffer has zero length",!1):(a.error="Wrong parameter: inputBuffer must be 'Uint8Array'",!1)}cd.DEFAULT_UTF8_ENCODING="utf8";class cm{constructor(){this.items=[]}write(a){this.items.push(a)}final(){return ck(this.items)}}let cn=[new Uint8Array([1])],co="0123456789",cp="name",cq="valueHexView",cr=new ArrayBuffer(0),cs=new Uint8Array(0),ct="EndOfContent",cu="OCTET STRING",cv="BIT STRING";function cw(a){var b;return(b=class extends a{get valueHex(){return this.valueHexView.slice().buffer}set valueHex(a){this.valueHexView=new Uint8Array(a)}constructor(...a){var b;super(...a);const c=a[0]||{};this.isHexOnly=null!=(b=c.isHexOnly)&&b,this.valueHexView=c.valueHex?b6.toUint8Array(c.valueHex):cs}fromBER(a,b,c,d){let e=a instanceof ArrayBuffer?new Uint8Array(a):a;if(!cl(this,e,b,c))return -1;let f=b+c;return(this.valueHexView=e.subarray(b,f),this.valueHexView.length)?(this.blockLength=c,f):(this.warnings.push("Zero buffer length"),b)}toBER(a=!1){return this.isHexOnly?a?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.byteLength===this.valueHexView.buffer.byteLength?this.valueHexView.buffer:this.valueHexView.slice().buffer:(this.error="Flag 'isHexOnly' is not set, abort",cr)}toJSON(){return{...super.toJSON(),isHexOnly:this.isHexOnly,valueHex:cd.ToHex(this.valueHexView)}}}).NAME="hexBlock",b}class cx{static blockName(){return this.NAME}get valueBeforeDecode(){return this.valueBeforeDecodeView.slice().buffer}set valueBeforeDecode(a){this.valueBeforeDecodeView=new Uint8Array(a)}constructor({blockLength:a=0,error:b="",warnings:c=[],valueBeforeDecode:d=cs}={}){this.blockLength=a,this.error=b,this.warnings=c,this.valueBeforeDecodeView=b6.toUint8Array(d)}toJSON(){return{blockName:this.constructor.NAME,blockLength:this.blockLength,error:this.error,warnings:this.warnings,valueBeforeDecode:cd.ToHex(this.valueBeforeDecodeView)}}}cx.NAME="baseBlock";class cy extends cx{fromBER(a,b,c,d){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}toBER(a,b){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}}cy.NAME="valueBlock";class cz extends cw(cx){constructor({idBlock:a={}}={}){var b,c,d,e;super(),a?(this.isHexOnly=null!=(b=a.isHexOnly)&&b,this.valueHexView=a.valueHex?b6.toUint8Array(a.valueHex):cs,this.tagClass=null!=(c=a.tagClass)?c:-1,this.tagNumber=null!=(d=a.tagNumber)?d:-1,this.isConstructed=null!=(e=a.isConstructed)&&e):(this.tagClass=-1,this.tagNumber=-1,this.isConstructed=!1)}toBER(a=!1){let b=0;switch(this.tagClass){case 1:b|=0;break;case 2:b|=64;break;case 3:b|=128;break;case 4:b|=192;break;default:return this.error="Unknown tag class",cr}if(this.isConstructed&&(b|=32),this.tagNumber<31&&!this.isHexOnly){let c=new Uint8Array(1);if(!a){let a=this.tagNumber;a&=31,b|=a,c[0]=b}return c.buffer}if(!this.isHexOnly){let c=cf(this.tagNumber,7),d=new Uint8Array(c),e=c.byteLength,f=new Uint8Array(e+1);if(f[0]=31|b,!a){for(let a=0;a<e-1;a++)f[a+1]=128|d[a];f[e]=d[e-1]}return f.buffer}let c=new Uint8Array(this.valueHexView.byteLength+1);if(c[0]=31|b,!a){let a=this.valueHexView;for(let b=0;b<a.length-1;b++)c[b+1]=128|a[b];c[this.valueHexView.byteLength]=a[a.length-1]}return c.buffer}fromBER(a,b,c){let d=b6.toUint8Array(a);if(!cl(this,d,b,c))return -1;let e=d.subarray(b,b+c);if(0===e.length)return this.error="Zero buffer length",-1;switch(192&e[0]){case 0:this.tagClass=1;break;case 64:this.tagClass=2;break;case 128:this.tagClass=3;break;case 192:this.tagClass=4;break;default:return this.error="Unknown tag class",-1}this.isConstructed=(32&e[0])==32,this.isHexOnly=!1;let f=31&e[0];if(31!==f)this.tagNumber=f,this.blockLength=1;else{let a=0;for(;;){let b=a+1;if(b>=e.length)return this.error="End of input reached before message was fully decoded",-1;if(a++,(128&e[b])==0)break}this.blockLength=a+1;let b=this.valueHexView=new Uint8Array(a);for(let c=0;c<a;c++)b[c]=127&e[c+1];this.blockLength<=9?this.tagNumber=ce(b,7):(this.isHexOnly=!0,this.warnings.push("Tag too long, represented as hex-coded"))}if(1===this.tagClass&&this.isConstructed)switch(this.tagNumber){case 1:case 2:case 5:case 6:case 9:case 13:case 14:case 23:case 24:case 31:case 32:case 33:case 34:return this.error="Constructed encoding used for primitive type",-1}return b+this.blockLength}toJSON(){return{...super.toJSON(),tagClass:this.tagClass,tagNumber:this.tagNumber,isConstructed:this.isConstructed}}}cz.NAME="identificationBlock";class cA extends cx{constructor({lenBlock:a={}}={}){var b,c,d;super(),this.isIndefiniteForm=null!=(b=a.isIndefiniteForm)&&b,this.longFormUsed=null!=(c=a.longFormUsed)&&c,this.length=null!=(d=a.length)?d:0}fromBER(a,b,c){let d=b6.toUint8Array(a);if(!cl(this,d,b,c))return -1;let e=d.subarray(b,b+c);if(0===e.length)return this.error="Zero buffer length",-1;if(255===e[0])return this.error="Length block 0xFF is reserved by standard",-1;if(this.isIndefiniteForm=128===e[0],this.isIndefiniteForm)return this.blockLength=1,b+this.blockLength;if(this.longFormUsed=!!(128&e[0]),!1===this.longFormUsed)return this.length=e[0],this.blockLength=1,b+this.blockLength;let f=127&e[0];if(f>8)return this.error="Too big integer",-1;if(f+1>e.length)return this.error="End of input reached before message was fully decoded",-1;let g=b+1,h=d.subarray(g,g+f);return 0===h[f-1]&&this.warnings.push("Needlessly long encoded length"),this.length=ce(h,8),this.longFormUsed&&this.length<=127&&this.warnings.push("Unnecessary usage of long length form"),this.blockLength=f+1,b+this.blockLength}toBER(a=!1){let b,c;if(this.length>127&&(this.longFormUsed=!0),this.isIndefiniteForm)return b=new ArrayBuffer(1),!1===a&&((c=new Uint8Array(b))[0]=128),b;if(this.longFormUsed){let d=cf(this.length,8);if(d.byteLength>127)return this.error="Too big length",cr;if(b=new ArrayBuffer(d.byteLength+1),a)return b;let e=new Uint8Array(d);(c=new Uint8Array(b))[0]=128|d.byteLength;for(let a=0;a<d.byteLength;a++)c[a+1]=e[a];return b}return b=new ArrayBuffer(1),!1===a&&((c=new Uint8Array(b))[0]=this.length),b}toJSON(){return{...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,longFormUsed:this.longFormUsed,length:this.length}}}cA.NAME="lengthBlock";let cB={};class cC extends cx{constructor({name:a="",optional:b=!1,primitiveSchema:c,...d}={},e){super(d),this.name=a,this.optional=b,c&&(this.primitiveSchema=c),this.idBlock=new cz(d),this.lenBlock=new cA(d),this.valueBlock=e?new e(d):new cy(d)}fromBER(a,b,c,d){let e=this.valueBlock.fromBER(a,b,this.lenBlock.isIndefiniteForm?c:this.lenBlock.length,d);return -1===e?this.error=this.valueBlock.error:(this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength)),e}toBER(a,b){let c=b||new cm;b||function a(b){var c;if(b instanceof cB.Constructed)for(let c of b.valueBlock.value)a(c)&&(b.lenBlock.isIndefiniteForm=!0);return!!(null==(c=b.lenBlock)?void 0:c.isIndefiniteForm)}(this);let d=this.idBlock.toBER(a);if(c.write(d),this.lenBlock.isIndefiniteForm)c.write(new Uint8Array([128]).buffer),this.valueBlock.toBER(a,c),c.write(new ArrayBuffer(2));else{let b=this.valueBlock.toBER(a);this.lenBlock.length=b.byteLength;let d=this.lenBlock.toBER(a);c.write(d),c.write(b)}return b?cr:c.final()}toJSON(){let a={...super.toJSON(),idBlock:this.idBlock.toJSON(),lenBlock:this.lenBlock.toJSON(),valueBlock:this.valueBlock.toJSON(),name:this.name,optional:this.optional};return this.primitiveSchema&&(a.primitiveSchema=this.primitiveSchema.toJSON()),a}toString(a="ascii"){return"ascii"===a?this.onAsciiEncoding():cd.ToHex(this.toBER())}onAsciiEncoding(){let a=this.constructor.NAME,b=cd.ToHex(this.valueBlock.valueBeforeDecodeView);return`${a} : ${b}`}isEqual(a){if(this===a)return!0;if(!(a instanceof this.constructor))return!1;let b=this.toBER(),c=a.toBER();if(b.byteLength!==c.byteLength)return!1;let d=new Uint8Array(b),e=new Uint8Array(c);for(let a=0;a<d.length;a++)if(d[a]!==e[a])return!1;return!0}}cC.NAME="BaseBlock";class cD extends cC{getValue(){return this.valueBlock.value}setValue(a){this.valueBlock.value=a}constructor({value:a="",...b}={},c){super(b,c),a&&this.fromString(a)}fromBER(a,b,c){let d=this.valueBlock.fromBER(a,b,this.lenBlock.isIndefiniteForm?c:this.lenBlock.length);return -1===d?this.error=this.valueBlock.error:(this.fromBuffer(this.valueBlock.valueHexView),this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength)),d}onAsciiEncoding(){return`${this.constructor.NAME} : '${this.valueBlock.value}'`}}cD.NAME="BaseStringBlock";class cE extends cw(cy){constructor({isHexOnly:a=!0,...b}={}){super(b),this.isHexOnly=a}}cE.NAME="PrimitiveValueBlock";class cF extends cC{constructor(a={}){super(a,cE),this.idBlock.isConstructed=!1}}cB.Primitive=cF,cF.NAME="PRIMITIVE";let cG=100,cH=1e4,cI=0x1000000;function cJ(a={}){var b,c,d;return{depth:0,maxDepth:null!=(b=a.maxDepth)?b:cG,nodesCount:0,maxNodes:null!=(c=a.maxNodes)?c:cH,maxContentLength:null!=(d=a.maxContentLength)?d:cI}}function cK(a,b,c,d){let e=d.depth+1;if(e>d.maxDepth){let a;return(a=new cC({},cy)).error="Maximum ASN.1 nesting depth exceeded",{offset:-1,result:a}}d.depth=e;try{return cL(a,b,c,d)}finally{d.depth-=1}}function cL(a,b=0,c=a.length,d=cJ()){let e=b,f=new cC({},cy),g=new cx;if(!cl(g,a,b,c))return f.error=g.error,{offset:-1,result:f};if(!a.subarray(b,b+c).length)return f.error="Zero buffer length",{offset:-1,result:f};let h=function(a){if(a.nodesCount+=1,a.nodesCount>a.maxNodes)return"Maximum ASN.1 node count exceeded"}(d);if(h)return f.error=h,{offset:-1,result:f};let i=f.idBlock.fromBER(a,b,c);if(f.idBlock.warnings.length&&f.warnings.concat(f.idBlock.warnings),-1===i)return f.error=f.idBlock.error,{offset:-1,result:f};if(b=i,c-=f.idBlock.blockLength,i=f.lenBlock.fromBER(a,b,c),f.lenBlock.warnings.length&&f.warnings.concat(f.lenBlock.warnings),-1===i)return f.error=f.lenBlock.error,{offset:-1,result:f};b=i,c-=f.lenBlock.blockLength;let j=f.lenBlock.isIndefiniteForm?c:f.lenBlock.length,k=function(a,b){if(a>b.maxContentLength)return"Maximum ASN.1 content length exceeded"}(j,d);if(k)return f.error=k,{offset:-1,result:f};if(!f.idBlock.isConstructed&&f.lenBlock.isIndefiniteForm)return f.error="Indefinite length form used for primitive encoding form",{offset:-1,result:f};let l=cC;if(1===f.idBlock.tagClass){if(f.idBlock.tagNumber>=37&&!1===f.idBlock.isHexOnly)return f.error="UNIVERSAL 37 and upper tags are reserved by ASN.1 standard",{offset:-1,result:f};switch(f.idBlock.tagNumber){case 0:if(f.idBlock.isConstructed&&f.lenBlock.length>0)return f.error="Type [UNIVERSAL 0] is reserved",{offset:-1,result:f};l=cB.EndOfContent;break;case 1:l=cB.Boolean;break;case 2:l=cB.Integer;break;case 3:l=cB.BitString;break;case 4:l=cB.OctetString;break;case 5:l=cB.Null;break;case 6:l=cB.ObjectIdentifier;break;case 10:l=cB.Enumerated;break;case 12:l=cB.Utf8String;break;case 13:l=cB.RelativeObjectIdentifier;break;case 14:l=cB.TIME;break;case 15:return f.error="[UNIVERSAL 15] is reserved by ASN.1 standard",{offset:-1,result:f};case 16:l=cB.Sequence;break;case 17:l=cB.Set;break;case 18:l=cB.NumericString;break;case 19:l=cB.PrintableString;break;case 20:l=cB.TeletexString;break;case 21:l=cB.VideotexString;break;case 22:l=cB.IA5String;break;case 23:l=cB.UTCTime;break;case 24:l=cB.GeneralizedTime;break;case 25:l=cB.GraphicString;break;case 26:l=cB.VisibleString;break;case 27:l=cB.GeneralString;break;case 28:l=cB.UniversalString;break;case 29:l=cB.CharacterString;break;case 30:l=cB.BmpString;break;case 31:l=cB.DATE;break;case 32:l=cB.TimeOfDay;break;case 33:l=cB.DateTime;break;case 34:l=cB.Duration;break;default:{let a=f.idBlock.isConstructed?new cB.Constructed:new cB.Primitive;a.idBlock=f.idBlock,a.lenBlock=f.lenBlock,a.warnings=f.warnings,f=a}}}else l=f.idBlock.isConstructed?cB.Constructed:cB.Primitive;return i=(f=function(a,b){if(a instanceof b)return a;let c=new b;return c.idBlock=a.idBlock,c.lenBlock=a.lenBlock,c.warnings=a.warnings,c.valueBeforeDecodeView=a.valueBeforeDecodeView,c}(f,l)).fromBER(a,b,j,d),f.valueBeforeDecodeView=a.subarray(e,e+f.blockLength),{offset:i,result:f}}function cM(a,b={}){if(!a.byteLength){let a=new cC({},cy);return a.error="Input buffer has zero length",{offset:-1,result:a}}return cL(b6.toUint8Array(a).slice(),0,a.byteLength,cJ(b))}class cN extends cy{constructor({value:a=[],isIndefiniteForm:b=!1,...c}={}){super(c),this.value=a,this.isIndefiniteForm=b}fromBER(a,b,c,d){var e,f;let g=b6.toUint8Array(a),h=null!=d?d:cJ();if(!cl(this,g,b,c))return -1;if(this.valueBeforeDecodeView=g.subarray(b,b+c),0===this.valueBeforeDecodeView.length)return this.warnings.push("Zero buffer length"),b;let i=b;for(;e=this.isIndefiniteForm,f=c,(e?1:f)>0;){let a=cK(g,i,c,h);if(-1===a.offset)return this.error=a.result.error,this.warnings.concat(a.result.warnings),-1;if(i=a.offset,this.blockLength+=a.result.blockLength,c-=a.result.blockLength,this.value.push(a.result),this.isIndefiniteForm&&a.result.constructor.NAME===ct)break}return this.isIndefiniteForm&&(this.value[this.value.length-1].constructor.NAME===ct?this.value.pop():this.warnings.push("No EndOfContent block encoded")),i}toBER(a,b){let c=b||new cm;for(let b=0;b<this.value.length;b++)this.value[b].toBER(a,c);return b?cr:c.final()}toJSON(){let a={...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,value:[]};for(let b of this.value)a.value.push(b.toJSON());return a}}cN.NAME="ConstructedValueBlock";class cO extends cC{constructor(a={}){super(a,cN),this.idBlock.isConstructed=!0}fromBER(a,b,c,d){this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;let e=this.valueBlock.fromBER(a,b,this.lenBlock.isIndefiniteForm?c:this.lenBlock.length,d);return -1===e?this.error=this.valueBlock.error:(this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength)),e}onAsciiEncoding(){let a=[];for(let b of this.valueBlock.value)a.push(b.toString("ascii").split("\n").map(a=>` ${a}`).join("\n"));let b=3===this.idBlock.tagClass?`[${this.idBlock.tagNumber}]`:this.constructor.NAME;return a.length?`${b} :
5
+ ${a.join("\n")}`:`${b} :`}}cB.Constructed=cO,cO.NAME="CONSTRUCTED";class cP extends cy{fromBER(a,b,c){return b}toBER(a){return cr}}cP.override="EndOfContentValueBlock";class cQ extends cC{constructor(a={}){super(a,cP),this.idBlock.tagClass=1,this.idBlock.tagNumber=0}}cB.EndOfContent=cQ,cQ.NAME=ct;class cR extends cC{constructor(a={}){super(a,cy),this.idBlock.tagClass=1,this.idBlock.tagNumber=5}fromBER(a,b,c){return(this.lenBlock.length>0&&this.warnings.push("Non-zero length of value block for Null type"),this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.blockLength+=c,b+c>a.byteLength)?(this.error="End of input reached before message was fully decoded (inconsistent offset and length values)",-1):b+c}toBER(a,b){let c=new ArrayBuffer(2);if(!a){let a=new Uint8Array(c);a[0]=5,a[1]=0}return b&&b.write(c),c}onAsciiEncoding(){return`${this.constructor.NAME}`}}cB.Null=cR,cR.NAME="NULL";class cS extends cw(cy){get value(){for(let a of this.valueHexView)if(a>0)return!0;return!1}set value(a){this.valueHexView[0]=255*!!a}constructor({value:a,...b}={}){super(b),b.valueHex?this.valueHexView=b6.toUint8Array(b.valueHex):this.valueHexView=new Uint8Array(1),a&&(this.value=a)}fromBER(a,b,c){let d=b6.toUint8Array(a);return cl(this,d,b,c)?(this.valueHexView=d.subarray(b,b+c),c>1&&this.warnings.push("Boolean value encoded in more then 1 octet"),this.isHexOnly=!0,ch.call(this),this.blockLength=c,b+c):-1}toBER(){return this.valueHexView.slice()}toJSON(){return{...super.toJSON(),value:this.value}}}cS.NAME="BooleanValueBlock";class cT extends cC{getValue(){return this.valueBlock.value}setValue(a){this.valueBlock.value=a}constructor(a={}){super(a,cS),this.idBlock.tagClass=1,this.idBlock.tagNumber=1}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.getValue}`}}cB.Boolean=cT,cT.NAME="BOOLEAN";class cU extends cw(cN){constructor({isConstructed:a=!1,...b}={}){super(b),this.isConstructed=a}fromBER(a,b,c,d){let e=0;if(this.isConstructed){if(this.isHexOnly=!1,-1===(e=cN.prototype.fromBER.call(this,a,b,c,d)))return e;for(let a=0;a<this.value.length;a++){let b=this.value[a].constructor.NAME;if(b===ct)if(!this.isIndefiniteForm)return this.error="EndOfContent is unexpected, OCTET STRING may consists of OCTET STRINGs only",-1;else break;if(b!==cu)return this.error="OCTET STRING may consists of OCTET STRINGs only",-1}}else this.isHexOnly=!0,e=super.fromBER(a,b,c),this.blockLength=c;return e}toBER(a,b){return this.isConstructed?cN.prototype.toBER.call(this,a,b):a?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),isConstructed:this.isConstructed}}}cU.NAME="OctetStringValueBlock";class cV extends cC{constructor({idBlock:a={},lenBlock:b={},...c}={}){var d;null!=c.isConstructed||(c.isConstructed=!!(null==(d=c.value)?void 0:d.length)),super({idBlock:{isConstructed:c.isConstructed,...a},lenBlock:{...b,isIndefiniteForm:!!c.isIndefiniteForm},...c},cU),this.idBlock.tagClass=1,this.idBlock.tagNumber=4}fromBER(a,b,c,d){if(this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,0===c)return 0===this.idBlock.error.length&&(this.blockLength+=this.idBlock.blockLength),0===this.lenBlock.error.length&&(this.blockLength+=this.lenBlock.blockLength),b;if(!this.valueBlock.isConstructed){let e=(a instanceof ArrayBuffer?new Uint8Array(a):a).subarray(b,b+c);try{if(e.byteLength){let a=null!=d?d:cJ(),b=cK(e,0,e.byteLength,a);-1!==b.offset&&b.offset===c&&(this.valueBlock.value=[b.result])}}catch{}}return super.fromBER(a,b,c,d)}onAsciiEncoding(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length)return cO.prototype.onAsciiEncoding.call(this);let a=this.constructor.NAME,b=cd.ToHex(this.valueBlock.valueHexView);return`${a} : ${b}`}getValue(){if(!this.idBlock.isConstructed)return this.valueBlock.valueHexView.slice().buffer;let a=[];for(let b of this.valueBlock.value)b instanceof H&&a.push(b.valueBlock.valueHexView);return b6.concat(a)}}cB.OctetString=H=cV,cV.NAME=cu;class cW extends cw(cN){constructor({unusedBits:a=0,isConstructed:b=!1,...c}={}){super(c),this.unusedBits=a,this.isConstructed=b,this.blockLength=this.valueHexView.byteLength}fromBER(a,b,c,d){if(!c)return b;let e=-1;if(this.isConstructed){if(-1===(e=cN.prototype.fromBER.call(this,a,b,c,d)))return e;for(let a of this.value){let b=a.constructor.NAME;if(b===ct)if(!this.isIndefiniteForm)return this.error="EndOfContent is unexpected, BIT STRING may consists of BIT STRINGs only",-1;else break;if(b!==cv)return this.error="BIT STRING may consists of BIT STRINGs only",-1;let c=a.valueBlock;if(this.unusedBits>0&&c.unusedBits>0)return this.error='Using of "unused bits" inside constructive BIT STRING allowed for least one only',-1;this.unusedBits=c.unusedBits}return e}let f=b6.toUint8Array(a);if(!cl(this,f,b,c))return -1;let g=f.subarray(b,b+c);if(this.unusedBits=g[0],this.unusedBits>7)return this.error="Unused bits for BitString must be in range 0-7",-1;if(!this.unusedBits){let a=g.subarray(1);try{if(a.byteLength){let b=null!=d?d:cJ(),e=cK(a,0,a.byteLength,b);-1!==e.offset&&e.offset===c-1&&(this.value=[e.result])}}catch{}}return this.valueHexView=g.subarray(1),this.blockLength=g.length,b+c}toBER(a,b){if(this.isConstructed)return cN.prototype.toBER.call(this,a,b);if(a)return new ArrayBuffer(this.valueHexView.byteLength+1);if(!this.valueHexView.byteLength){let a=new Uint8Array(1);return a[0]=0,a.buffer}let c=new Uint8Array(this.valueHexView.length+1);return c[0]=this.unusedBits,c.set(this.valueHexView,1),c.buffer}toJSON(){return{...super.toJSON(),unusedBits:this.unusedBits,isConstructed:this.isConstructed}}}cW.NAME="BitStringValueBlock";class cX extends cC{constructor({idBlock:a={},lenBlock:b={},...c}={}){var d;null!=c.isConstructed||(c.isConstructed=!!(null==(d=c.value)?void 0:d.length)),super({idBlock:{isConstructed:c.isConstructed,...a},lenBlock:{...b,isIndefiniteForm:!!c.isIndefiniteForm},...c},cW),this.idBlock.tagClass=1,this.idBlock.tagNumber=3}fromBER(a,b,c,d){return this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,super.fromBER(a,b,c,d)}onAsciiEncoding(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length)return cO.prototype.onAsciiEncoding.call(this);{let a=[];for(let b of this.valueBlock.valueHexView)a.push(b.toString(2).padStart(8,"0"));let b=a.join(""),c=this.constructor.NAME,d=b.substring(0,b.length-this.valueBlock.unusedBits);return`${c} : ${d}`}}}function cY(a){if(a>=cn.length)for(let b=cn.length;b<=a;b++){let a=new Uint8Array([0]),c=cn[b-1].slice(0);for(let b=c.length-1;b>=0;b--){let d=new Uint8Array([(c[b]<<1)+a[0]]);a[0]=d[0]/10,c[b]=d[0]%10}a[0]>0&&(c=cg(a,c)),cn.push(c)}return cn[a]}cB.BitString=cX,cX.NAME=cv;class cZ extends cw(cy){setValueHex(){this.valueHexView.length>=4?(this.warnings.push("Too big Integer for decoding, hex only"),this.isHexOnly=!0,this._valueDec=0):(this.isHexOnly=!1,this.valueHexView.length>0&&(this._valueDec=ch.call(this)))}constructor({value:a,...b}={}){super(b),this._valueDec=0,b.valueHex&&this.setValueHex(),void 0!==a&&(this.valueDec=a)}set valueDec(a){this._valueDec=a,this.isHexOnly=!1,this.valueHexView=new Uint8Array(function(a){let b=a<0?-1*a:a,c=128;for(let d=1;d<8;d++){if(b<=c){if(a<0){let a=cf(c-b,8,d),e=new Uint8Array(a);return e[0]|=128,a}let e=cf(b,8,d),f=new Uint8Array(e);if(128&f[0]){let a=e.slice(0),b=new Uint8Array(a);f=new Uint8Array(e=new ArrayBuffer(e.byteLength+1));for(let c=0;c<a.byteLength;c++)f[c+1]=b[c];f[0]=0}return e}c*=256}return new ArrayBuffer(0)}(a))}get valueDec(){return this._valueDec}fromDER(a,b,c,d=0){let e=this.fromBER(a,b,c);if(-1===e)return e;let f=this.valueHexView;return 0===f[0]&&(128&f[1])!=0?this.valueHexView=f.subarray(1):0!==d&&f.length<d&&(d-f.length>1&&(d=f.length+1),this.valueHexView=f.subarray(d-f.length)),e}toDER(a=!1){let b=this.valueHexView;switch(!0){case(128&b[0])!=0:{let a=new Uint8Array(this.valueHexView.length+1);a[0]=0,a.set(b,1),this.valueHexView=a}break;case 0===b[0]&&(128&b[1])==0:this.valueHexView=this.valueHexView.subarray(1)}return this.toBER(a)}fromBER(a,b,c){let d=super.fromBER(a,b,c);return -1===d||this.setValueHex(),d}toBER(a){return a?new ArrayBuffer(this.valueHexView.length):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}toString(){let a,b=8*this.valueHexView.length-1,c=new Uint8Array(8*this.valueHexView.length/3),d=0,e=this.valueHexView,f="",g=!1;for(let g=e.byteLength-1;g>=0;g--){a=e[g];for(let e=0;e<8;e++)(1&a)==1&&(d===b?(c=function(a,b){let c,d=0,e=new Uint8Array(a),f=new Uint8Array(b),g=e.slice(0),h=g.length-1,i=f.slice(0),j=i.length-1,k=0;for(let a=j;a>=0;a--,k++)!0==(c=g[h-k]-i[j-k]-d)<0?(d=1,g[h-k]=c+10):(d=0,g[h-k]=c);if(d>0)for(let a=h-j+1;a>=0;a--,k++)if((c=g[h-k]-d)<0)d=1,g[h-k]=c+10;else{d=0,g[h-k]=c;break}return g.slice()}(cY(d),c),f="-"):c=function(a,b){let c=new Uint8Array([0]),d=new Uint8Array(a),e=new Uint8Array(b),f=d.slice(0),g=f.length-1,h=e.slice(0),i=h.length-1,j=0,k=i<g?g:i,l=0;for(let a=k;a>=0;a--,l++)j=!0==l<h.length?f[g-l]+h[i-l]+c[0]:f[g-l]+c[0],c[0]=j/10,!0==l>=f.length?f=cg(new Uint8Array([j%10]),f):f[g-l]=j%10;return c[0]>0&&(f=cg(c,f)),f}(c,cY(d))),d++,a>>=1}for(let a=0;a<c.length;a++)c[a]&&(g=!0),g&&(f+=co.charAt(c[a]));return!1===g&&(f+=co.charAt(0)),f}}cZ.NAME="IntegerValueBlock",Object.defineProperty(cZ.prototype,"valueHex",{set:function(a){this.valueHexView=new Uint8Array(a),this.setValueHex()},get:function(){return this.valueHexView.slice().buffer}});class c$ extends cC{constructor(a={}){super(a,cZ),this.idBlock.tagClass=1,this.idBlock.tagNumber=2}toBigInt(){return cj(),BigInt(this.valueBlock.toString())}static fromBigInt(a){cj();let b=BigInt(a),c=new cm,d=b.toString(16).replace(/^-/,""),e=new Uint8Array(cd.FromHex(d));if(b<0){let a=new Uint8Array(e.length+(128&e[0]?1:0));a[0]|=128;let d=BigInt(`0x${cd.ToHex(a)}`)+b,f=b6.toUint8Array(cd.FromHex(d.toString(16)));f[0]|=128,c.write(f)}else 128&e[0]&&c.write(new Uint8Array([0])),c.write(e);return new I({valueHex:c.final()})}convertToDER(){let a=new I({valueHex:this.valueBlock.valueHexView});return a.valueBlock.toDER(),a}convertFromDER(){return new I({valueHex:0===this.valueBlock.valueHexView[0]?this.valueBlock.valueHexView.subarray(1):this.valueBlock.valueHexView})}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()}`}}cB.Integer=I=c$,c$.NAME="INTEGER";class c_ extends c${constructor(a={}){super(a),this.idBlock.tagClass=1,this.idBlock.tagNumber=10}}cB.Enumerated=c_,c_.NAME="ENUMERATED";class c0 extends cw(cy){constructor({valueDec:a=-1,isFirstSid:b=!1,...c}={}){super(c),this.valueDec=a,this.isFirstSid=b}fromBER(a,b,c){if(!c)return b;let d=b6.toUint8Array(a);if(!cl(this,d,b,c))return -1;let e=d.subarray(b,b+c);this.valueHexView=new Uint8Array(c);for(let a=0;a<c&&(this.valueHexView[a]=127&e[a],this.blockLength++,(128&e[a])!=0);a++);let f=new Uint8Array(this.blockLength);for(let a=0;a<this.blockLength;a++)f[a]=this.valueHexView[a];return(this.valueHexView=f,(128&e[this.blockLength-1])!=0)?(this.error="End of input reached before message was fully decoded",-1):(0===this.valueHexView[0]&&this.warnings.push("Needlessly long format of SID encoding"),this.blockLength<=8?this.valueDec=ce(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),b+this.blockLength)}set valueBigInt(a){cj();let b=BigInt(a).toString(2);for(;b.length%7;)b="0"+b;let c=new Uint8Array(b.length/7);for(let a=0;a<c.length;a++)c[a]=parseInt(b.slice(7*a,7*a+7),2)+128*(a+1<c.length);this.fromBER(c.buffer,0,c.length)}toBER(a){if(this.isHexOnly){if(a)return new ArrayBuffer(this.valueHexView.byteLength);let b=this.valueHexView,c=new Uint8Array(this.blockLength);for(let a=0;a<this.blockLength-1;a++)c[a]=128|b[a];return c[this.blockLength-1]=b[this.blockLength-1],c.buffer}let b=cf(this.valueDec,7);if(0===b.byteLength)return this.error="Error during encoding SID value",cr;let c=new Uint8Array(b.byteLength);if(!a){let a=new Uint8Array(b),d=b.byteLength-1;for(let b=0;b<d;b++)c[b]=128|a[b];c[d]=a[d]}return c}toString(){let a="";if(this.isHexOnly)a=cd.ToHex(this.valueHexView);else if(this.isFirstSid){let b=this.valueDec;this.valueDec<=39?a="0.":this.valueDec<=79?(a="1.",b-=40):(a="2.",b-=80),a+=b.toString()}else a=this.valueDec.toString();return a}toJSON(){return{...super.toJSON(),valueDec:this.valueDec,isFirstSid:this.isFirstSid}}}c0.NAME="sidBlock";class c1 extends cy{constructor({value:a="",...b}={}){super(b),this.value=[],a&&this.fromString(a)}fromBER(a,b,c){let d=b;for(;c>0;){let b=new c0;if(-1===(d=b.fromBER(a,d,c))){this.blockLength=0,this.error=b.error;break}0===this.value.length&&(b.isFirstSid=!0),this.blockLength+=b.blockLength,c-=b.blockLength,this.value.push(b)}return d}toBER(a){let b=[];for(let c=0;c<this.value.length;c++){let d=this.value[c].toBER(a);if(0===d.byteLength)return this.error=this.value[c].error,cr;b.push(d)}return ck(b)}fromString(a){this.value=[];let b=0,c=0,d="",e=!1;do if(d=-1===(c=a.indexOf(".",b))?a.substring(b):a.substring(b,c),b=c+1,e){let a=this.value[0],b=0;switch(a.valueDec){case 0:break;case 1:b=40;break;case 2:b=80;break;default:this.value=[];return}let c=parseInt(d,10);if(isNaN(c))return;a.valueDec=c+b,e=!1}else{let a=new c0;if(d>Number.MAX_SAFE_INTEGER)cj(),a.valueBigInt=BigInt(d);else if(a.valueDec=parseInt(d,10),isNaN(a.valueDec))return;this.value.length||(a.isFirstSid=!0,e=!0),this.value.push(a)}while(-1!==c)}toString(){let a="",b=!1;for(let c=0;c<this.value.length;c++){b=this.value[c].isHexOnly;let d=this.value[c].toString();0!==c&&(a=`${a}.`),b?(d=`{${d}}`,this.value[c].isFirstSid?a=`2.{${d} - 80}`:a+=d):a+=d}return a}toJSON(){let a={...super.toJSON(),value:this.toString(),sidArray:[]};for(let b=0;b<this.value.length;b++)a.sidArray.push(this.value[b].toJSON());return a}}c1.NAME="ObjectIdentifierValueBlock";class c2 extends cC{getValue(){return this.valueBlock.toString()}setValue(a){this.valueBlock.fromString(a)}constructor(a={}){super(a,c1),this.idBlock.tagClass=1,this.idBlock.tagNumber=6}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}}cB.ObjectIdentifier=c2,c2.NAME="OBJECT IDENTIFIER";class c3 extends cw(cx){constructor({valueDec:a=0,...b}={}){super(b),this.valueDec=a}fromBER(a,b,c){if(0===c)return b;let d=b6.toUint8Array(a);if(!cl(this,d,b,c))return -1;let e=d.subarray(b,b+c);this.valueHexView=new Uint8Array(c);for(let a=0;a<c&&(this.valueHexView[a]=127&e[a],this.blockLength++,(128&e[a])!=0);a++);let f=new Uint8Array(this.blockLength);for(let a=0;a<this.blockLength;a++)f[a]=this.valueHexView[a];return(this.valueHexView=f,(128&e[this.blockLength-1])!=0)?(this.error="End of input reached before message was fully decoded",-1):(0===this.valueHexView[0]&&this.warnings.push("Needlessly long format of SID encoding"),this.blockLength<=8?this.valueDec=ce(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),b+this.blockLength)}toBER(a){if(this.isHexOnly){if(a)return new ArrayBuffer(this.valueHexView.byteLength);let b=this.valueHexView,c=new Uint8Array(this.blockLength);for(let a=0;a<this.blockLength-1;a++)c[a]=128|b[a];return c[this.blockLength-1]=b[this.blockLength-1],c.buffer}let b=cf(this.valueDec,7);if(0===b.byteLength)return this.error="Error during encoding SID value",cr;let c=new Uint8Array(b.byteLength);if(!a){let a=new Uint8Array(b),d=b.byteLength-1;for(let b=0;b<d;b++)c[b]=128|a[b];c[d]=a[d]}return c.buffer}toString(){return this.isHexOnly?cd.ToHex(this.valueHexView):this.valueDec.toString()}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}}c3.NAME="relativeSidBlock";class c4 extends cy{constructor({value:a="",...b}={}){super(b),this.value=[],a&&this.fromString(a)}fromBER(a,b,c){let d=b;for(;c>0;){let b=new c3;if(-1===(d=b.fromBER(a,d,c))){this.blockLength=0,this.error=b.error;break}this.blockLength+=b.blockLength,c-=b.blockLength,this.value.push(b)}return d}toBER(a,b){let c=[];for(let b=0;b<this.value.length;b++){let d=this.value[b].toBER(a);if(0===d.byteLength)return this.error=this.value[b].error,cr;c.push(d)}return ck(c)}fromString(a){this.value=[];let b=0,c=0,d="";do{d=-1===(c=a.indexOf(".",b))?a.substring(b):a.substring(b,c),b=c+1;let e=new c3;if(e.valueDec=parseInt(d,10),isNaN(e.valueDec))break;this.value.push(e)}while(-1!==c);return!0}toString(){let a="",b=!1;for(let c=0;c<this.value.length;c++){b=this.value[c].isHexOnly;let d=this.value[c].toString();0!==c&&(a=`${a}.`),b?a+=d=`{${d}}`:a+=d}return a}toJSON(){let a={...super.toJSON(),value:this.toString(),sidArray:[]};for(let b=0;b<this.value.length;b++)a.sidArray.push(this.value[b].toJSON());return a}}c4.NAME="RelativeObjectIdentifierValueBlock";class c5 extends cC{getValue(){return this.valueBlock.toString()}setValue(a){this.valueBlock.fromString(a)}constructor(a={}){super(a,c4),this.idBlock.tagClass=1,this.idBlock.tagNumber=13}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}}cB.RelativeObjectIdentifier=c5,c5.NAME="RelativeObjectIdentifier";class c6 extends cO{constructor(a={}){super(a),this.idBlock.tagClass=1,this.idBlock.tagNumber=16}}cB.Sequence=c6,c6.NAME="SEQUENCE";class c7 extends cO{constructor(a={}){super(a),this.idBlock.tagClass=1,this.idBlock.tagNumber=17}}cB.Set=c7,c7.NAME="SET";class c8 extends cw(cy){constructor({...a}={}){super(a),this.isHexOnly=!0,this.value=""}toJSON(){return{...super.toJSON(),value:this.value}}}c8.NAME="StringValueBlock";class c9 extends c8{}c9.NAME="SimpleStringValueBlock";class da extends cD{constructor({...a}={}){super(a,c9)}fromBuffer(a){this.valueBlock.value=String.fromCharCode.apply(null,b6.toUint8Array(a))}fromString(a){let b=a.length,c=this.valueBlock.valueHexView=new Uint8Array(b);for(let d=0;d<b;d++)c[d]=a.charCodeAt(d);this.valueBlock.value=a}}da.NAME="SIMPLE STRING";class db extends da{fromBuffer(a){this.valueBlock.valueHexView=b6.toUint8Array(a);try{this.valueBlock.value=cd.ToUtf8String(a)}catch(b){this.warnings.push(`Error during "decodeURIComponent": ${b}, using raw string`),this.valueBlock.value=cd.ToBinary(a)}}fromString(a){this.valueBlock.valueHexView=new Uint8Array(cd.FromUtf8String(a)),this.valueBlock.value=a}}db.NAME="Utf8StringValueBlock";class dc extends db{constructor(a={}){super(a),this.idBlock.tagClass=1,this.idBlock.tagNumber=12}}cB.Utf8String=dc,dc.NAME="UTF8String";class dd extends da{fromBuffer(a){this.valueBlock.value=cd.ToUtf16String(a),this.valueBlock.valueHexView=b6.toUint8Array(a)}fromString(a){this.valueBlock.value=a,this.valueBlock.valueHexView=new Uint8Array(cd.FromUtf16String(a))}}dd.NAME="BmpStringValueBlock";class de extends dd{constructor({...a}={}){super(a),this.idBlock.tagClass=1,this.idBlock.tagNumber=30}}cB.BmpString=de,de.NAME="BMPString";class df extends da{fromBuffer(a){let b=ArrayBuffer.isView(a)?a.slice().buffer:a.slice(0),c=new Uint8Array(b);for(let a=0;a<c.length;a+=4)c[a]=c[a+3],c[a+1]=c[a+2],c[a+2]=0,c[a+3]=0;this.valueBlock.value=String.fromCharCode.apply(null,new Uint32Array(b))}fromString(a){let b=a.length,c=this.valueBlock.valueHexView=new Uint8Array(4*b);for(let d=0;d<b;d++){let b=new Uint8Array(cf(a.charCodeAt(d),8));if(b.length>4)continue;let e=4-b.length;for(let a=b.length-1;a>=0;a--)c[4*d+a+e]=b[a]}this.valueBlock.value=a}}df.NAME="UniversalStringValueBlock";class dg extends df{constructor({...a}={}){super(a),this.idBlock.tagClass=1,this.idBlock.tagNumber=28}}cB.UniversalString=dg,dg.NAME="UniversalString";class dh extends da{constructor(a={}){super(a),this.idBlock.tagClass=1,this.idBlock.tagNumber=18}}cB.NumericString=dh,dh.NAME="NumericString";class di extends da{constructor(a={}){super(a),this.idBlock.tagClass=1,this.idBlock.tagNumber=19}}cB.PrintableString=di,di.NAME="PrintableString";class dj extends da{constructor(a={}){super(a),this.idBlock.tagClass=1,this.idBlock.tagNumber=20}}cB.TeletexString=dj,dj.NAME="TeletexString";class dk extends da{constructor(a={}){super(a),this.idBlock.tagClass=1,this.idBlock.tagNumber=21}}cB.VideotexString=dk,dk.NAME="VideotexString";class dl extends da{constructor(a={}){super(a),this.idBlock.tagClass=1,this.idBlock.tagNumber=22}}cB.IA5String=dl,dl.NAME="IA5String";class dm extends da{constructor(a={}){super(a),this.idBlock.tagClass=1,this.idBlock.tagNumber=25}}cB.GraphicString=dm,dm.NAME="GraphicString";class dn extends da{constructor(a={}){super(a),this.idBlock.tagClass=1,this.idBlock.tagNumber=26}}cB.VisibleString=dn,dn.NAME="VisibleString";class dp extends da{constructor(a={}){super(a),this.idBlock.tagClass=1,this.idBlock.tagNumber=27}}cB.GeneralString=dp,dp.NAME="GeneralString";class dq extends da{constructor(a={}){super(a),this.idBlock.tagClass=1,this.idBlock.tagNumber=29}}cB.CharacterString=dq,dq.NAME="CharacterString";class dr extends dn{constructor({value:a,valueDate:b,...c}={}){if(super(c),this.year=0,this.month=0,this.day=0,this.hour=0,this.minute=0,this.second=0,a){this.fromString(a),this.valueBlock.valueHexView=new Uint8Array(a.length);for(let b=0;b<a.length;b++)this.valueBlock.valueHexView[b]=a.charCodeAt(b)}b&&(this.fromDate(b),this.valueBlock.valueHexView=new Uint8Array(this.toBuffer())),this.idBlock.tagClass=1,this.idBlock.tagNumber=23}fromBuffer(a){this.fromString(String.fromCharCode.apply(null,b6.toUint8Array(a)))}toBuffer(){let a=this.toString(),b=new ArrayBuffer(a.length),c=new Uint8Array(b);for(let b=0;b<a.length;b++)c[b]=a.charCodeAt(b);return b}fromDate(a){this.year=a.getUTCFullYear(),this.month=a.getUTCMonth()+1,this.day=a.getUTCDate(),this.hour=a.getUTCHours(),this.minute=a.getUTCMinutes(),this.second=a.getUTCSeconds()}toDate(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second))}fromString(a){let b=/(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})Z/ig.exec(a);if(null===b){this.error="Wrong input string for conversion";return}let c=parseInt(b[1],10);c>=50?this.year=1900+c:this.year=2e3+c,this.month=parseInt(b[2],10),this.day=parseInt(b[3],10),this.hour=parseInt(b[4],10),this.minute=parseInt(b[5],10),this.second=parseInt(b[6],10)}toString(a="iso"){if("iso"===a){let a=Array(7);return a[0]=ci(this.year<2e3?this.year-1900:this.year-2e3,2),a[1]=ci(this.month,2),a[2]=ci(this.day,2),a[3]=ci(this.hour,2),a[4]=ci(this.minute,2),a[5]=ci(this.second,2),a[6]="Z",a.join("")}return super.toString(a)}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.toDate().toISOString()}`}toJSON(){return{...super.toJSON(),year:this.year,month:this.month,day:this.day,hour:this.hour,minute:this.minute,second:this.second}}}cB.UTCTime=dr,dr.NAME="UTCTime";class ds extends dr{constructor(a={}){super(a),null!=this.millisecond||(this.millisecond=0),this.idBlock.tagClass=1,this.idBlock.tagNumber=24}fromDate(a){super.fromDate(a),this.millisecond=a.getUTCMilliseconds()}toDate(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond))}fromString(a){let b,c=!1,d="",e="",f=0,g=0,h=0;if("Z"===a[a.length-1])d=a.substring(0,a.length-1),c=!0;else{if(isNaN(new Number(a[a.length-1]).valueOf()))throw Error("Wrong input string for conversion");d=a}if(c){if(-1!==d.indexOf("+")||-1!==d.indexOf("-"))throw Error("Wrong input string for conversion")}else{let a=1,b=d.indexOf("+"),c="";if(-1===b&&(b=d.indexOf("-"),a=-1),-1!==b){if(c=d.substring(b+1),d=d.substring(0,b),2!==c.length&&4!==c.length)throw Error("Wrong input string for conversion");let e=parseInt(c.substring(0,2),10);if(isNaN(e.valueOf()))throw Error("Wrong input string for conversion");if(g=a*e,4===c.length){if(isNaN((e=parseInt(c.substring(2,4),10)).valueOf()))throw Error("Wrong input string for conversion");h=a*e}}}let i=d.indexOf(".");if(-1===i&&(i=d.indexOf(",")),-1!==i){let a=new Number(`0${d.substring(i)}`);if(isNaN(a.valueOf()))throw Error("Wrong input string for conversion");f=a.valueOf(),e=d.substring(0,i)}else e=d;switch(!0){case 8===e.length:if(b=/(\d{4})(\d{2})(\d{2})/ig,-1!==i)throw Error("Wrong input string for conversion");break;case 10===e.length:if(b=/(\d{4})(\d{2})(\d{2})(\d{2})/ig,-1!==i){let a=60*f;this.minute=Math.floor(a),a=60*(a-this.minute),this.second=Math.floor(a),a=1e3*(a-this.second),this.millisecond=Math.floor(a)}break;case 12===e.length:if(b=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/ig,-1!==i){let a=60*f;this.second=Math.floor(a),a=1e3*(a-this.second),this.millisecond=Math.floor(a)}break;case 14===e.length:if(b=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/ig,-1!==i){let a=1e3*f;this.millisecond=Math.floor(a)}break;default:throw Error("Wrong input string for conversion")}let j=b.exec(e);if(null===j)throw Error("Wrong input string for conversion");for(let a=1;a<j.length;a++)switch(a){case 1:this.year=parseInt(j[a],10);break;case 2:this.month=parseInt(j[a],10);break;case 3:this.day=parseInt(j[a],10);break;case 4:this.hour=parseInt(j[a],10)+g;break;case 5:this.minute=parseInt(j[a],10)+h;break;case 6:this.second=parseInt(j[a],10);break;default:throw Error("Wrong input string for conversion")}if(!1===c){let a=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond);this.year=a.getUTCFullYear(),this.month=a.getUTCMonth(),this.day=a.getUTCDay(),this.hour=a.getUTCHours(),this.minute=a.getUTCMinutes(),this.second=a.getUTCSeconds(),this.millisecond=a.getUTCMilliseconds()}}toString(a="iso"){if("iso"===a){let a=[];return a.push(ci(this.year,4)),a.push(ci(this.month,2)),a.push(ci(this.day,2)),a.push(ci(this.hour,2)),a.push(ci(this.minute,2)),a.push(ci(this.second,2)),0!==this.millisecond&&(a.push("."),a.push(ci(this.millisecond,3))),a.push("Z"),a.join("")}return super.toString(a)}toJSON(){return{...super.toJSON(),millisecond:this.millisecond}}}cB.GeneralizedTime=ds,ds.NAME="GeneralizedTime";class dt extends dc{constructor(a={}){super(a),this.idBlock.tagClass=1,this.idBlock.tagNumber=31}}cB.DATE=dt,dt.NAME="DATE";class du extends dc{constructor(a={}){super(a),this.idBlock.tagClass=1,this.idBlock.tagNumber=32}}cB.TimeOfDay=du,du.NAME="TimeOfDay";class dv extends dc{constructor(a={}){super(a),this.idBlock.tagClass=1,this.idBlock.tagNumber=33}}cB.DateTime=dv,dv.NAME="DateTime";class dw extends dc{constructor(a={}){super(a),this.idBlock.tagClass=1,this.idBlock.tagNumber=34}}cB.Duration=dw,dw.NAME="Duration";class dx extends dc{constructor(a={}){super(a),this.idBlock.tagClass=1,this.idBlock.tagNumber=14}}cB.TIME=dx,dx.NAME="TIME";class dy{constructor({name:a="",optional:b=!1}={}){this.name=a,this.optional=b}}class dz extends dy{constructor({value:a=[],...b}={}){super(b),this.value=a}}class dA extends dy{constructor({value:a=new dy,local:b=!1,...c}={}){super(c),this.value=a,this.local=b}}class dB{get data(){return this.dataView.slice().buffer}set data(a){this.dataView=b6.toUint8Array(a)}constructor({data:a=cs}={}){this.dataView=b6.toUint8Array(a)}fromBER(a,b,c){let d=b+c;return this.dataView=b6.toUint8Array(a).subarray(b,d),d}toBER(a){return this.dataView.slice().buffer}}function dC(a,b,c){if(c instanceof dz){for(let d of c.value)if(dC(a,b,d).verified)return{verified:!0,result:a};{let a={verified:!1,result:{error:"Wrong values for Choice type"}};return c.hasOwnProperty(cp)&&(a.name=c.name),a}}if(c instanceof dy)return c.hasOwnProperty(cp)&&(a[c.name]=b),{verified:!0,result:a};if(a instanceof Object==!1)return{verified:!1,result:{error:"Wrong root object"}};if(b instanceof Object==!1)return{verified:!1,result:{error:"Wrong ASN.1 data"}};if(c instanceof Object==!1||"idBlock"in c==!1||"fromBER"in c.idBlock==!1||"toBER"in c.idBlock==!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};let d=c.idBlock.toBER(!1);if(0===d.byteLength)return{verified:!1,result:{error:"Error encoding idBlock for ASN.1 schema"}};if(-1===c.idBlock.fromBER(d,0,d.byteLength))return{verified:!1,result:{error:"Error decoding idBlock for ASN.1 schema"}};if(!1===c.idBlock.hasOwnProperty("tagClass"))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(c.idBlock.tagClass!==b.idBlock.tagClass)return{verified:!1,result:a};if(!1===c.idBlock.hasOwnProperty("tagNumber"))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(c.idBlock.tagNumber!==b.idBlock.tagNumber)return{verified:!1,result:a};if(!1===c.idBlock.hasOwnProperty("isConstructed"))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(c.idBlock.isConstructed!==b.idBlock.isConstructed)return{verified:!1,result:a};if(!("isHexOnly"in c.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(c.idBlock.isHexOnly!==b.idBlock.isHexOnly)return{verified:!1,result:a};if(c.idBlock.isHexOnly){if(cq in c.idBlock==!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};let d=c.idBlock.valueHexView,e=b.idBlock.valueHexView;if(d.length!==e.length)return{verified:!1,result:a};for(let b=0;b<d.length;b++)if(d[b]!==e[1])return{verified:!1,result:a}}if(c.name&&(c.name=c.name.replace(/^\s+|\s+$/g,""),c.name&&(a[c.name]=b)),c instanceof cB.Constructed){let d=0,e={verified:!1,result:{error:"Unknown error"}},f=c.valueBlock.value.length;if(f>0&&c.valueBlock.value[0]instanceof dA&&(f=b.valueBlock.value.length),0===f)return{verified:!0,result:a};if(0===b.valueBlock.value.length&&0!==c.valueBlock.value.length){let b=!0;for(let a=0;a<c.valueBlock.value.length;a++)b=b&&(c.valueBlock.value[a].optional||!1);return b?{verified:!0,result:a}:(c.name&&(c.name=c.name.replace(/^\s+|\s+$/g,""),c.name&&delete a[c.name]),a.error="Inconsistent object length",{verified:!1,result:a})}for(let g=0;g<f;g++)if(g-d>=b.valueBlock.value.length){if(!1===c.valueBlock.value[g].optional){let b={verified:!1,result:a};return a.error="Inconsistent length between ASN.1 data and schema",c.name&&(c.name=c.name.replace(/^\s+|\s+$/g,""),c.name&&(delete a[c.name],b.name=c.name)),b}}else if(c.valueBlock.value[0]instanceof dA){if(!1===(e=dC(a,b.valueBlock.value[g],c.valueBlock.value[0].value)).verified)if(!c.valueBlock.value[0].optional)return c.name&&(c.name=c.name.replace(/^\s+|\s+$/g,""),c.name&&delete a[c.name]),e;else d++;if(cp in c.valueBlock.value[0]&&c.valueBlock.value[0].name.length>0){let d={};void 0===(d="local"in c.valueBlock.value[0]&&c.valueBlock.value[0].local?b:a)[c.valueBlock.value[0].name]&&(d[c.valueBlock.value[0].name]=[]),d[c.valueBlock.value[0].name].push(b.valueBlock.value[g])}}else if(!1===(e=dC(a,b.valueBlock.value[g-d],c.valueBlock.value[g])).verified)if(!c.valueBlock.value[g].optional)return c.name&&(c.name=c.name.replace(/^\s+|\s+$/g,""),c.name&&delete a[c.name]),e;else d++;if(!1===e.verified){let b={verified:!1,result:a};return c.name&&(c.name=c.name.replace(/^\s+|\s+$/g,""),c.name&&(delete a[c.name],b.name=c.name)),b}return{verified:!0,result:a}}if(c.primitiveSchema&&cq in b.valueBlock){let d=cL(b.valueBlock.valueHexView);if(-1===d.offset){let b={verified:!1,result:d.result};return c.name&&(c.name=c.name.replace(/^\s+|\s+$/g,""),c.name&&(delete a[c.name],b.name=c.name)),b}return dC(a,d.result,c.primitiveSchema)}return{verified:!0,result:a}}function dD(a,b){if(b instanceof Object==!1)return{verified:!1,result:{error:"Wrong ASN.1 schema type"}};let c=cL(b6.toUint8Array(a));return -1===c.offset?{verified:!1,result:c.result}:dC(c.result,c.result,b)}function dE(a){return Object.prototype.toString.call(a)}function dF(a){return"[object ArrayBuffer]"===dE(a)}function dG(a){return dF(a)||"u">typeof SharedArrayBuffer&&"[object SharedArrayBuffer]"===dE(a)}function dH(a){return dG(a)||!!ArrayBuffer.isView(a)||!!a&&"object"==typeof a&&"number"==typeof a.byteOffset&&"number"==typeof a.byteLength&&dG(a.buffer)}function dI(a){if(!dH(a))throw TypeError("Expected ArrayBuffer, SharedArrayBuffer, or ArrayBufferView")}function dJ(a){return(dI(a),dG(a))?new Uint8Array(a):new Uint8Array(a.buffer,a.byteOffset,a.byteLength)}function dK(a){if(dI(a),dF(a))return a;let b=new ArrayBuffer(a.byteLength);return new Uint8Array(b).set(dJ(a)),b}(i=J||(J={}))[i.Sequence=0]="Sequence",i[i.Set=1]="Set",i[i.Choice=2]="Choice",(j=K||(K={}))[j.Any=1]="Any",j[j.Boolean=2]="Boolean",j[j.OctetString=3]="OctetString",j[j.BitString=4]="BitString",j[j.Integer=5]="Integer",j[j.Enumerated=6]="Enumerated",j[j.ObjectIdentifier=7]="ObjectIdentifier",j[j.Utf8String=8]="Utf8String",j[j.BmpString=9]="BmpString",j[j.UniversalString=10]="UniversalString",j[j.NumericString=11]="NumericString",j[j.PrintableString=12]="PrintableString",j[j.TeletexString=13]="TeletexString",j[j.VideotexString=14]="VideotexString",j[j.IA5String=15]="IA5String",j[j.GraphicString=16]="GraphicString",j[j.VisibleString=17]="VisibleString",j[j.GeneralString=18]="GeneralString",j[j.CharacterString=19]="CharacterString",j[j.UTCTime=20]="UTCTime",j[j.GeneralizedTime=21]="GeneralizedTime",j[j.DATE=22]="DATE",j[j.TimeOfDay=23]="TimeOfDay",j[j.DateTime=24]="DateTime",j[j.Duration=25]="Duration",j[j.TIME=26]="TIME",j[j.Null=27]="Null";class dL{unusedBits=0;value=new ArrayBuffer(0);constructor(a,b=0){if(a)if("number"==typeof a)this.fromNumber(a);else if(dH(a))this.unusedBits=b,this.value=dK(a);else throw TypeError("Unsupported type of 'params' argument for BitString")}fromASN(a){if(!(a instanceof cX))throw TypeError("Argument 'asn' is not instance of ASN.1 BitString");return this.unusedBits=a.valueBlock.unusedBits,this.value=dK(a.valueBlock.valueHex),this}toASN(){return new cX({unusedBits:this.unusedBits,valueHex:this.value})}toSchema(a){return new cX({name:a})}toNumber(){let a="";for(let b of new Uint8Array(this.value))a+=b.toString(2).padStart(8,"0");return a=a.split("").reverse().join(""),this.unusedBits&&(a=a.slice(this.unusedBits).padStart(this.unusedBits,"0")),parseInt(a,2)}fromNumber(a){let b=a.toString(2),c=b.length+7>>3;this.unusedBits=(c<<3)-b.length;let d=new Uint8Array(c);b=b.padStart(c<<3,"0").split("").reverse().join("");let e=0;for(;e<c;)d[e]=parseInt(b.slice(e<<3,(e<<3)+8),2),e++;this.value=d.buffer}}class dM{buffer;get byteLength(){return this.buffer.byteLength}get byteOffset(){return 0}constructor(a){"number"==typeof a?this.buffer=new ArrayBuffer(a):dH(a)?this.buffer=dK(a):Array.isArray(a)?this.buffer=new Uint8Array(a).buffer:this.buffer=new ArrayBuffer(0)}fromASN(a){if(!(a instanceof cV))throw TypeError("Argument 'asn' is not instance of ASN.1 OctetString");return this.buffer=dK(a.valueBlock.valueHex),this}toASN(){return new cV({valueHex:this.buffer})}toSchema(a){return new cV({name:a})}}let dN={fromASN:a=>a instanceof cR?null:dK(a.valueBeforeDecodeView),toASN:a=>{if(null===a)return new cR;let b=cM(a);if(b.result.error)throw Error(b.result.error);return b.result}},dO={fromASN:a=>a.valueBlock.valueHexView.byteLength>=4?a.valueBlock.toString():a.valueBlock.valueDec,toASN:a=>new c$({value:+a})},dP={fromASN:a=>a.valueBlock.valueDec,toASN:a=>new c_({value:a})},dQ={fromASN:a=>dK(a.valueBlock.valueHexView),toASN:a=>new c$({valueHex:a})},dR={fromASN:a=>dK(a.valueBlock.valueHexView),toASN:a=>new cX({valueHex:a})},dS={fromASN:a=>a.valueBlock.toString(),toASN:a=>new c2({value:a})},dT={fromASN:a=>a.valueBlock.value,toASN:a=>new cT({value:a})},dU={fromASN:a=>dK(a.valueBlock.valueHexView),toASN:a=>new cV({valueHex:a})};function dV(a){return{fromASN:a=>a.valueBlock.value,toASN:b=>new a({value:b})}}let dW=dV(dc),dX=dV(de),dY=dV(dg),dZ=dV(dh),d$=dV(di),d_=dV(dj),d0=dV(dk),d1=dV(dl),d2=dV(dm),d3=dV(dn),d4=dV(dp),d5=dV(dq),d6={fromASN:a=>a.toDate(),toASN:a=>new dr({valueDate:a})},d7={fromASN:a=>a.toDate(),toASN:a=>new ds({valueDate:a})},d8={fromASN:()=>null,toASN:()=>new cR};function d9(a){switch(a){case K.Any:return dN;case K.BitString:return dR;case K.BmpString:return dX;case K.Boolean:return dT;case K.CharacterString:return d5;case K.Enumerated:return dP;case K.GeneralString:return d4;case K.GeneralizedTime:return d7;case K.GraphicString:return d2;case K.IA5String:return d1;case K.Integer:return dO;case K.Null:return d8;case K.NumericString:return dZ;case K.ObjectIdentifier:return dS;case K.OctetString:return dU;case K.PrintableString:return d$;case K.TeletexString:return d_;case K.UTCTime:return d6;case K.UniversalString:return dY;case K.Utf8String:return dW;case K.VideotexString:return d0;case K.VisibleString:return d3;default:return null}}function ea(a){return"function"==typeof a&&a.prototype?!!a.prototype.toASN&&!!a.prototype.fromASN||ea(a.prototype):!!(a&&"object"==typeof a&&"toASN"in a&&"fromASN"in a)}class eb{items=new WeakMap;has(a){return this.items.has(a)}get(a,b=!1){let c=this.items.get(a);if(!c)throw Error(`Cannot get schema for '${a.prototype.constructor.name}' target`);if(b&&!c.schema)throw Error(`Schema '${a.prototype.constructor.name}' doesn't contain ASN.1 schema. Call 'AsnSchemaStorage.cache'.`);return c}cache(a){let b=this.get(a);b.schema||(b.schema=this.create(a,!0))}createDefault(a){let b={type:J.Sequence,items:{}},c=this.findParentSchema(a);return c&&(Object.assign(b,c),b.items=Object.assign({},b.items,c.items)),b}create(a,b){let c=this.items.get(a)||this.createDefault(a),d=[];for(let a in c.items){let e,f=c.items[a],g=b?a:"";if("number"==typeof f.type){let a=K[f.type],b=bm[a];if(!b)throw Error(`Cannot get ASN1 class by name '${a}'`);e=new b({name:g})}else ea(f.type)?e=new f.type().toSchema(g):f.optional?this.get(f.type).type===J.Choice?e=new dy({name:g}):(e=this.create(f.type,!1)).name=g:e=new dy({name:g});let h=!!f.optional||void 0!==f.defaultValue;if(f.repeated&&(e.name="",e=new("set"===f.repeated?c7:c6)({name:"",value:[new dA({name:g,value:e})]})),null!==f.context&&void 0!==f.context)if(f.implicit)if("number"==typeof f.type||ea(f.type)){let a=f.repeated?cO:cF;d.push(new a({name:g,optional:h,idBlock:{tagClass:3,tagNumber:f.context}}))}else{this.cache(f.type);let a=!!f.repeated,b=a?e:this.get(f.type,!0).schema;b="valueBlock"in b?b.valueBlock.value:b.value,d.push(new cO({name:a?"":g,optional:h,idBlock:{tagClass:3,tagNumber:f.context},value:b}))}else d.push(new cO({optional:h,idBlock:{tagClass:3,tagNumber:f.context},value:[e]}));else e.optional=h,d.push(e)}switch(c.type){case J.Sequence:return new c6({value:d,name:""});case J.Set:return new c7({value:d,name:""});case J.Choice:return new dz({value:d,name:""});default:throw Error("Unsupported ASN1 type in use")}}set(a,b){return this.items.set(a,b),this}findParentSchema(a){let b=Object.getPrototypeOf(a);return b?this.items.get(b)||this.findParentSchema(b):null}}let ec=new eb,ed=a=>b=>{let c;ec.has(b)?c=ec.get(b):(c=ec.createDefault(b),ec.set(b,c)),Object.assign(c,a)},ee=a=>(b,c)=>{let d;ec.has(b.constructor)?d=ec.get(b.constructor):(d=ec.createDefault(b.constructor),ec.set(b.constructor,d));let e=Object.assign({},a);if("number"==typeof e.type&&!e.converter){let d=d9(a.type);if(!d)throw Error(`Cannot get default converter for property '${c}' of ${b.constructor.name}`);e.converter=d}e.raw=a.raw,d.items[c]=e};class ef extends Error{schemas=[]}class eg{static parse(a,b,c){let d=cM(dK(a),c?.berOptions);if(d.result.error)throw Error(d.result.error);return this.fromASN(d.result,b,c)}static fromASN(a,b,c){try{if(ea(b))return new b().fromASN(a);let d=ec.get(b);ec.cache(b);let e=d.schema,f=this.handleChoiceTypes(a,d,b,e,c);if(f?.result)return f.result;f?.targetSchema&&(e=f.targetSchema);let g=this.handleSequenceTypes(a,d,b,e),h=new b;if(function a(b){if(b){let c=Object.getPrototypeOf(b);return c?.prototype?.constructor===Array||a(c)}return!1}(b))return this.handleArrayTypes(a,d,b,c);return this.processSchemaItems(d,g,h,c),h}catch(a){throw a instanceof ef&&a.schemas.push(b.name),a}}static handleChoiceTypes(a,b,c,d,e){if(a.constructor===cO&&b.type===J.Choice&&3===a.idBlock.tagClass)for(let d in b.items){let f=b.items[d];if(f.context===a.idBlock.tagNumber&&f.implicit&&"function"==typeof f.type&&ec.has(f.type)){let b=ec.get(f.type);if(b&&b.type===J.Sequence){let b=new c6;if("value"in a.valueBlock&&Array.isArray(a.valueBlock.value)&&"value"in b.valueBlock){b.valueBlock.value=a.valueBlock.value;let g=this.fromASN(b,f.type,e),h=new c;return h[d]=g,{result:h}}}}}else if(a.constructor===cO&&b.type!==J.Choice){let c=new cO({idBlock:{tagClass:3,tagNumber:a.idBlock.tagNumber},value:b.schema.valueBlock.value});for(let c in b.items)delete a[c];return{targetSchema:c}}return null}static handleSequenceTypes(a,b,c,d){if(b.type===J.Sequence){let b=dC({},a,d);if(!b.verified)throw new ef(`Data does not match to ${c.name} ASN1 schema.${b.result.error?` ${b.result.error}`:""}`);return b}{let b=dC({},a,d);if(!b.verified)throw new ef(`Data does not match to ${c.name} ASN1 schema.${b.result.error?` ${b.result.error}`:""}`);return b}}static processRepeatedField(a,b,c){let d=a.slice(b);if(1===d.length&&"Sequence"===d[0].constructor.name){let a=d[0];a.valueBlock&&a.valueBlock.value&&Array.isArray(a.valueBlock.value)&&(d=a.valueBlock.value)}if("number"!=typeof c.type)return d.filter(a=>a&&a.valueBlock).map(a=>{try{return this.fromASN(a,c.type)}catch{return}}).filter(a=>void 0!==a);{let a=d9(c.type);if(!a)throw Error(`No converter for ASN.1 type ${c.type}`);return d.filter(a=>a&&a.valueBlock).map(b=>{try{return a.fromASN(b)}catch{return}}).filter(a=>void 0!==a)}}static processPrimitiveField(a,b){let c=d9(b.type);if(!c)throw Error(`No converter for ASN.1 type ${b.type}`);return c.fromASN(a)}static isOptionalChoiceField(a){return a.optional&&"function"==typeof a.type&&ec.has(a.type)&&ec.get(a.type).type===J.Choice}static processOptionalChoiceField(a,b){try{let c=this.fromASN(a,b.type);return{processed:!0,value:c}}catch(a){if(a instanceof ef&&/Wrong values for Choice type/.test(a.message))return{processed:!1};throw a}}static handleArrayTypes(a,b,c,d){if(!("value"in a.valueBlock&&Array.isArray(a.valueBlock.value)))throw Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.");let e=b.itemType;if("number"!=typeof e)return c.from(a.valueBlock.value,a=>this.fromASN(a,e,d));{let b=d9(e);if(!b)throw Error(`Cannot get default converter for array item of ${c.name} ASN1 schema`);return c.from(a.valueBlock.value,a=>b.fromASN(a))}}static processSchemaItems(a,b,c,d){for(let e in a.items){let f,g=b.result[e];if(!g)continue;let h=a.items[e],i=h.type;(f="number"==typeof i||ea(i)?this.processPrimitiveSchemaItem(g,h,i,d):this.processComplexSchemaItem(g,h,i,d))&&"object"==typeof f&&"value"in f&&"raw"in f?(c[e]=f.value,c[`${e}Raw`]=f.raw):c[e]=f}}static processPrimitiveSchemaItem(a,b,c,d){let e=b.converter??(ea(c)?new c:null);if(!e)throw Error("Converter is empty");return b.repeated?this.processRepeatedPrimitiveItem(a,b,e,d):this.processSinglePrimitiveItem(a,b,c,e,d)}static processRepeatedPrimitiveItem(a,b,c,d){if(!b.implicit)return Array.from(a,a=>c.fromASN(a));{let e=new("sequence"===b.repeated?c6:c7);e.valueBlock=a.valueBlock;let f=cM(e.toBER(!1),d?.berOptions);if(-1===f.offset)throw Error(`Cannot parse the child item. ${f.result.error}`);if(!("value"in f.result.valueBlock&&Array.isArray(f.result.valueBlock.value)))throw Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.");return Array.from(f.result.valueBlock.value,a=>c.fromASN(a))}}static processSinglePrimitiveItem(a,b,c,d,e){let f=a;if(b.implicit){let a;if(ea(c))a=new c().toSchema("");else{let b=K[c],d=bm[b];if(!d)throw Error(`Cannot get '${b}' class from asn1js module`);a=new d}a.valueBlock=f.valueBlock,f=cM(a.toBER(!1),e?.berOptions).result}return d.fromASN(f)}static processComplexSchemaItem(a,b,c,d){if(b.repeated){if(!Array.isArray(a))throw Error("Cannot get list of items from the ASN.1 parsed value. ASN.1 value should be iterable.");return Array.from(a,a=>this.fromASN(a,c,d))}{let e=this.handleImplicitTagging(a,b,c);if(this.isOptionalChoiceField(b))try{return this.fromASN(e,c,d)}catch(a){if(a instanceof ef&&/Wrong values for Choice type/.test(a.message))return;throw a}{let f=this.fromASN(e,c,d);return b.raw?{value:f,raw:a.valueBeforeDecodeView}:f}}}static handleImplicitTagging(a,b,c){if(b.implicit&&"number"==typeof b.context){let b=ec.get(c);if(b.type===J.Sequence){let b=new c6;if("value"in a.valueBlock&&Array.isArray(a.valueBlock.value)&&"value"in b.valueBlock)return b.valueBlock.value=a.valueBlock.value,b}else if(b.type===J.Set){let b=new c7;if("value"in a.valueBlock&&Array.isArray(a.valueBlock.value)&&"value"in b.valueBlock)return b.valueBlock.value=a.valueBlock.value,b}}return a}}class eh{static serialize(a){return a instanceof cC?a.toBER(!1):this.toASN(a).toBER(!1)}static toASN(a){let b;if(a&&"object"==typeof a&&ea(a))return a.toASN();if(!(a&&"object"==typeof a))throw TypeError("Parameter 1 should be type of Object.");let c=a.constructor,d=ec.get(c);ec.cache(c);let e=[];if(d.itemType){if(!Array.isArray(a))throw TypeError("Parameter 1 should be type of Array.");if("number"==typeof d.itemType){let b=d9(d.itemType);if(!b)throw Error(`Cannot get default converter for array item of ${c.name} ASN1 schema`);e=a.map(a=>b.toASN(a))}else e=a.map(a=>this.toAsnItem({type:d.itemType},"[]",c,a))}else for(let b in d.items){let f=d.items[b],g=a[b];if(void 0===g||f.defaultValue===g||"object"==typeof f.defaultValue&&"object"==typeof g&&function(a,b){if(!(a&&b)||a.byteLength!==b.byteLength)return!1;let c=new Uint8Array(a),d=new Uint8Array(b);for(let b=0;b<a.byteLength;b++)if(c[b]!==d[b])return!1;return!0}(this.serialize(f.defaultValue),this.serialize(g)))continue;let h=eh.toAsnItem(f,b,c,g);if("number"==typeof f.context)if(f.implicit)if(!f.repeated&&("number"==typeof f.type||ea(f.type))){let a={};a.valueHex=h instanceof cR?dK(h.valueBeforeDecodeView):h.valueBlock.toBER(),e.push(new cF({optional:f.optional,idBlock:{tagClass:3,tagNumber:f.context},...a}))}else e.push(new cO({optional:f.optional,idBlock:{tagClass:3,tagNumber:f.context},value:h.valueBlock.value}));else e.push(new cO({optional:f.optional,idBlock:{tagClass:3,tagNumber:f.context},value:[h]}));else f.repeated?e=e.concat(h):e.push(h)}switch(d.type){case J.Sequence:b=new c6({value:e});break;case J.Set:b=new c7({value:e});break;case J.Choice:if(!e[0])throw Error(`Schema '${c.name}' has wrong data. Choice cannot be empty.`);b=e[0]}return b}static toAsnItem(a,b,c,d){let e;if("number"==typeof a.type){let f=a.converter;if(!f)throw Error(`Property '${b}' doesn't have converter for type ${K[a.type]} in schema '${c.name}'`);if(a.repeated){if(!Array.isArray(d))throw TypeError("Parameter 'objProp' should be type of Array.");let b=Array.from(d,a=>f.toASN(a));e=new("sequence"===a.repeated?c6:c7)({value:b})}else e=f.toASN(d)}else if(a.repeated){if(!Array.isArray(d))throw TypeError("Parameter 'objProp' should be type of Array.");let b=Array.from(d,a=>this.toASN(a));e=new("sequence"===a.repeated?c6:c7)({value:b})}else e=this.toASN(d);return e}}class ei extends Array{constructor(a=[]){if("number"==typeof a)super(a);else for(const b of(super(),a))this.push(b)}}class ej{static serialize(a){return eh.serialize(a)}static parse(a,b,c){return eg.parse(a,b,c)}static toString(a,b){let c=cM(dH(a)?dK(a):ej.serialize(a),b?.berOptions);if(-1===c.offset)throw Error(`Cannot decode ASN.1 data. ${c.result.error}`);return c.result.toString()}}function ek(a,b,c,d){var e,f=arguments.length,g=f<3?b:null===d?d=Object.getOwnPropertyDescriptor(b,c):d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)g=Reflect.decorate(a,b,c,d);else for(var h=a.length-1;h>=0;h--)(e=a[h])&&(g=(f<3?e(g):f>3?e(b,c,g):e(b,c))||g);return f>3&&g&&Object.defineProperty(b,c,g),g}function el(a,b,c,d){if("a"===c&&!d)throw TypeError("Private accessor was defined without a getter");if("function"==typeof b?a!==b||!d:!b.has(a))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===c?d:"a"===c?d.call(a):d?d.value:b.get(a)}function em(a,b,c,d,e){if("m"===d)throw TypeError("Private method is not writable");if("a"===d&&!e)throw TypeError("Private accessor was defined without a setter");if("function"==typeof b?a!==b||!e:!b.has(a))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===d?e.call(a,c):e?e.value=c:b.set(a,c),c}"function"==typeof SuppressedError&&SuppressedError;function en(a,b){if(!b)return a.join("");if(!Number.isInteger(b.size)||b.size<1)throw RangeError("Hex group size must be a positive integer");let c=[];for(let d=0;d<a.length;d+=b.size)c.push(a.slice(d,d+b.size).join(""));return c.join(b.separator)}function eo(a,b={}){let c=dJ(a),d=b.case??"lower",e=Array.from(c,a=>{let b=a.toString(16).padStart(2,"0");return"upper"===d?b.toUpperCase():b}),f="";if(b.line){let a=b.line.bytesPerLine;if(!Number.isInteger(a)||a<1)throw RangeError("Hex bytesPerLine must be a positive integer");let c=b.line.separator??"\n",d=[];for(let c=0;c<e.length;c+=a)d.push(en(e.slice(c,c+a),b.group));f=d.join(c)}else f=en(e,b.group);return`${b.prefix??""}${f}`}Object.freeze({}),Object.freeze({case:"upper"}),Object.freeze({group:{size:1,separator:":"}}),Object.freeze({case:"upper",group:{size:1,separator:":"}}),Object.freeze({group:{size:4,separator:" "}}),Object.freeze({prefix:"0x"});class ep{static isIPv4(a){return/^(\d{1,3}\.){3}\d{1,3}$/.test(a)}static parseIPv4(a){let b=a.split(".");if(4!==b.length)throw Error("Invalid IPv4 address");return b.map(a=>{let b=parseInt(a,10);if(isNaN(b)||b<0||b>255)throw Error("Invalid IPv4 address part");return b})}static parseIPv6(a){let b=this.expandIPv6(a).split(":");if(8!==b.length)throw Error("Invalid IPv6 address");return b.reduce((a,b)=>{let c=parseInt(b,16);if(isNaN(c)||c<0||c>65535)throw Error("Invalid IPv6 address part");return a.push(c>>8&255),a.push(255&c),a},[])}static expandIPv6(a){if(!a.includes("::"))return a;let b=a.split("::");if(b.length>2)throw Error("Invalid IPv6 address");let c=b[0]?b[0].split(":"):[],d=b[1]?b[1].split(":"):[],e=8-(c.length+d.length);if(e<0)throw Error("Invalid IPv6 address");return[...c,...Array(e).fill("0"),...d].join(":")}static formatIPv6(a){let b=[];for(let c=0;c<16;c+=2)b.push((a[c]<<8|a[c+1]).toString(16));return this.compressIPv6(b.join(":"))}static compressIPv6(a){let b=a.split(":"),c=-1,d=0,e=-1,f=0;for(let a=0;a<b.length;a++)"0"===b[a]?(-1===e&&(e=a),f++):(f>d&&(c=e,d=f),e=-1,f=0);if(f>d&&(c=e,d=f),d>1){let a=b.slice(0,c).join(":"),e=b.slice(c+d).join(":");return`${a}::${e}`}return a}static parseCIDR(a){let[b,c]=a.split("/"),d=parseInt(c,10);if(this.isIPv4(b)){if(d<0||d>32)throw Error("Invalid IPv4 prefix length");return[this.parseIPv4(b),d]}if(d<0||d>128)throw Error("Invalid IPv6 prefix length");return[this.parseIPv6(b),d]}static decodeIP(a){if(64===a.length&&0===parseInt(a,16))return"::/0";if(16!==a.length)return a;let b=parseInt(a.slice(8),16).toString(2).split("").reduce((a,b)=>a+ +b,0),c=a.slice(0,8).replace(/(.{2})/g,a=>`${parseInt(a,16)}.`);return c=c.slice(0,-1),`${c}/${b}`}static toString(a){let b=new Uint8Array(a);if(4===b.length)return Array.from(b).join(".");if(16===b.length)return this.formatIPv6(b);if(8===b.length||32===b.length){let a=b.length/2,c=b.slice(0,a),d=b.slice(a);if(b.every(a=>0===a))return 8===b.length?"0.0.0.0/0":"::/0";let e=d.reduce((a,b)=>a+(b.toString(2).match(/1/g)||[]).length,0);if(8===b.length){let a=Array.from(c).join(".");return`${a}/${e}`}{let a=this.formatIPv6(c);return`${a}/${e}`}}return this.decodeIP(eo(a))}static fromString(a){if(a.includes("/")){let[b,c]=this.parseCIDR(a),d=new Uint8Array(b.length),e=c;for(let a=0;a<d.length;a++)e>=8?(d[a]=255,e-=8):e>0&&(d[a]=255<<8-e,e=0);let f=new Uint8Array(2*b.length);return f.set(b,0),f.set(d,b.length),f.buffer}return new Uint8Array(this.isIPv4(a)?this.parseIPv4(a):this.parseIPv6(a)).buffer}}let eq=class{teletexString;printableString;universalString;utf8String;bmpString;constructor(a={}){Object.assign(this,a)}toString(){return this.bmpString||this.printableString||this.teletexString||this.universalString||this.utf8String||""}};ek([ee({type:K.TeletexString})],eq.prototype,"teletexString",void 0),ek([ee({type:K.PrintableString})],eq.prototype,"printableString",void 0),ek([ee({type:K.UniversalString})],eq.prototype,"universalString",void 0),ek([ee({type:K.Utf8String})],eq.prototype,"utf8String",void 0),ek([ee({type:K.BmpString})],eq.prototype,"bmpString",void 0),eq=ek([ed({type:J.Choice})],eq);let er=class extends eq{ia5String;anyValue;constructor(a={}){super(a),Object.assign(this,a)}toString(){return this.ia5String||(this.anyValue?eo(this.anyValue):super.toString())}};ek([ee({type:K.IA5String})],er.prototype,"ia5String",void 0),ek([ee({type:K.Any})],er.prototype,"anyValue",void 0),er=ek([ed({type:J.Choice})],er);class es{type="";value=new er;constructor(a={}){Object.assign(this,a)}}ek([ee({type:K.ObjectIdentifier})],es.prototype,"type",void 0),ek([ee({type:er})],es.prototype,"value",void 0);let et=L=class extends ei{constructor(a){super(a),Object.setPrototypeOf(this,L.prototype)}};et=L=ek([ed({type:J.Set,itemType:es})],et);let eu=M=class extends ei{constructor(a){super(a),Object.setPrototypeOf(this,M.prototype)}};eu=M=ek([ed({type:J.Sequence,itemType:et})],eu);let ev=N=class extends eu{constructor(a){super(a),Object.setPrototypeOf(this,N.prototype)}};ev=N=ek([ed({type:J.Sequence})],ev);class ew{typeId="";value=new ArrayBuffer(0);constructor(a={}){Object.assign(this,a)}}ek([ee({type:K.ObjectIdentifier})],ew.prototype,"typeId",void 0),ek([ee({type:K.Any,context:0})],ew.prototype,"value",void 0);class ex{nameAssigner;partyName=new eq;constructor(a={}){Object.assign(this,a)}}ek([ee({type:eq,optional:!0,context:0,implicit:!0})],ex.prototype,"nameAssigner",void 0),ek([ee({type:eq,context:1,implicit:!0})],ex.prototype,"partyName",void 0);let ey=class{otherName;rfc822Name;dNSName;x400Address;directoryName;ediPartyName;uniformResourceIdentifier;iPAddress;registeredID;constructor(a={}){Object.assign(this,a)}};ek([ee({type:ew,context:0,implicit:!0})],ey.prototype,"otherName",void 0),ek([ee({type:K.IA5String,context:1,implicit:!0})],ey.prototype,"rfc822Name",void 0),ek([ee({type:K.IA5String,context:2,implicit:!0})],ey.prototype,"dNSName",void 0),ek([ee({type:K.Any,context:3,implicit:!0})],ey.prototype,"x400Address",void 0),ek([ee({type:ev,context:4,implicit:!1})],ey.prototype,"directoryName",void 0),ek([ee({type:ex,context:5})],ey.prototype,"ediPartyName",void 0),ek([ee({type:K.IA5String,context:6,implicit:!0})],ey.prototype,"uniformResourceIdentifier",void 0),ek([ee({type:K.OctetString,context:7,implicit:!0,converter:{fromASN:a=>ep.toString(dU.fromASN(a)),toASN:a=>dU.toASN(ep.fromString(a))}})],ey.prototype,"iPAddress",void 0),ek([ee({type:K.ObjectIdentifier,context:8,implicit:!0})],ey.prototype,"registeredID",void 0),ey=ek([ed({type:J.Choice})],ey);let ez="1.3.6.1.5.5.7",eA=`${ez}.1`,eB=`${ez}.3`,eC=`${ez}.48`,eD=`${eC}.1`,eE=`${eC}.2`,eF=`${eC}.3`,eG=`${eC}.5`,eH="2.5.29",eI=`${eA}.1`;class eJ{accessMethod="";accessLocation=new ey;constructor(a={}){Object.assign(this,a)}}ek([ee({type:K.ObjectIdentifier})],eJ.prototype,"accessMethod",void 0),ek([ee({type:ey})],eJ.prototype,"accessLocation",void 0);let eK=O=class extends ei{constructor(a){super(a),Object.setPrototypeOf(this,O.prototype)}};eK=O=ek([ed({type:J.Sequence,itemType:eJ})],eK);let eL=`${eH}.35`;class eM extends dM{}class eN{keyIdentifier;authorityCertIssuer;authorityCertSerialNumber;constructor(a={}){a&&Object.assign(this,a)}}ek([ee({type:eM,context:0,optional:!0,implicit:!0})],eN.prototype,"keyIdentifier",void 0),ek([ee({type:ey,context:1,optional:!0,implicit:!0,repeated:"sequence"})],eN.prototype,"authorityCertIssuer",void 0),ek([ee({type:K.Integer,context:2,optional:!0,implicit:!0,converter:dQ})],eN.prototype,"authorityCertSerialNumber",void 0);let eO=`${eH}.19`;class eP{cA=!1;pathLenConstraint;constructor(a={}){Object.assign(this,a)}}ek([ee({type:K.Boolean,defaultValue:!1})],eP.prototype,"cA",void 0),ek([ee({type:K.Integer,optional:!0})],eP.prototype,"pathLenConstraint",void 0);let eQ=P=class extends ei{constructor(a){super(a),Object.setPrototypeOf(this,P.prototype)}};eQ=P=ek([ed({type:J.Sequence,itemType:ey})],eQ);let eR=Q=class extends eQ{constructor(a){super(a),Object.setPrototypeOf(this,Q.prototype)}};eR=Q=ek([ed({type:J.Sequence})],eR);let eS=`${eH}.32`,eT=class{ia5String;visibleString;bmpString;utf8String;constructor(a={}){Object.assign(this,a)}toString(){return this.ia5String||this.visibleString||this.bmpString||this.utf8String||""}};ek([ee({type:K.IA5String})],eT.prototype,"ia5String",void 0),ek([ee({type:K.VisibleString})],eT.prototype,"visibleString",void 0),ek([ee({type:K.BmpString})],eT.prototype,"bmpString",void 0),ek([ee({type:K.Utf8String})],eT.prototype,"utf8String",void 0),eT=ek([ed({type:J.Choice})],eT);class eU{organization=new eT;noticeNumbers=[];constructor(a={}){Object.assign(this,a)}}ek([ee({type:eT})],eU.prototype,"organization",void 0),ek([ee({type:K.Integer,repeated:"sequence"})],eU.prototype,"noticeNumbers",void 0);class eV{noticeRef;explicitText;constructor(a={}){Object.assign(this,a)}}ek([ee({type:eU,optional:!0})],eV.prototype,"noticeRef",void 0),ek([ee({type:eT,optional:!0})],eV.prototype,"explicitText",void 0);let eW=class{cPSuri;userNotice;constructor(a={}){Object.assign(this,a)}};ek([ee({type:K.IA5String})],eW.prototype,"cPSuri",void 0),ek([ee({type:eV})],eW.prototype,"userNotice",void 0),eW=ek([ed({type:J.Choice})],eW);class eX{policyQualifierId="";qualifier=new ArrayBuffer(0);constructor(a={}){Object.assign(this,a)}}ek([ee({type:K.ObjectIdentifier})],eX.prototype,"policyQualifierId",void 0),ek([ee({type:K.Any})],eX.prototype,"qualifier",void 0);class eY{policyIdentifier="";policyQualifiers;constructor(a={}){Object.assign(this,a)}}ek([ee({type:K.ObjectIdentifier})],eY.prototype,"policyIdentifier",void 0),ek([ee({type:eX,repeated:"sequence",optional:!0})],eY.prototype,"policyQualifiers",void 0);let eZ=R=class extends ei{constructor(a){super(a),Object.setPrototypeOf(this,R.prototype)}};eZ=R=ek([ed({type:J.Sequence,itemType:eY})],eZ);let e$=class{value;constructor(a=0){this.value=a}};ek([ee({type:K.Integer})],e$.prototype,"value",void 0),e$=ek([ed({type:J.Choice})],e$);let e_=class extends e${};e_=ek([ed({type:J.Choice})],e_);let e0=`${eH}.31`;(k=T||(T={}))[k.unused=1]="unused",k[k.keyCompromise=2]="keyCompromise",k[k.cACompromise=4]="cACompromise",k[k.affiliationChanged=8]="affiliationChanged",k[k.superseded=16]="superseded",k[k.cessationOfOperation=32]="cessationOfOperation",k[k.certificateHold=64]="certificateHold",k[k.privilegeWithdrawn=128]="privilegeWithdrawn",k[k.aACompromise=256]="aACompromise";class e1 extends dL{toJSON(){let a=[],b=this.toNumber();return b&T.aACompromise&&a.push("aACompromise"),b&T.affiliationChanged&&a.push("affiliationChanged"),b&T.cACompromise&&a.push("cACompromise"),b&T.certificateHold&&a.push("certificateHold"),b&T.cessationOfOperation&&a.push("cessationOfOperation"),b&T.keyCompromise&&a.push("keyCompromise"),b&T.privilegeWithdrawn&&a.push("privilegeWithdrawn"),b&T.superseded&&a.push("superseded"),b&T.unused&&a.push("unused"),a}toString(){return`[${this.toJSON().join(", ")}]`}}let e2=class{fullName;nameRelativeToCRLIssuer;constructor(a={}){Object.assign(this,a)}};ek([ee({type:ey,context:0,repeated:"sequence",implicit:!0})],e2.prototype,"fullName",void 0),ek([ee({type:et,context:1,implicit:!0})],e2.prototype,"nameRelativeToCRLIssuer",void 0),e2=ek([ed({type:J.Choice})],e2);class e3{distributionPoint;reasons;cRLIssuer;constructor(a={}){Object.assign(this,a)}}ek([ee({type:e2,context:0,optional:!0})],e3.prototype,"distributionPoint",void 0),ek([ee({type:e1,context:1,optional:!0,implicit:!0})],e3.prototype,"reasons",void 0),ek([ee({type:ey,context:2,optional:!0,repeated:"sequence",implicit:!0})],e3.prototype,"cRLIssuer",void 0);let e4=S=class extends ei{constructor(a){super(a),Object.setPrototypeOf(this,S.prototype)}};e4=S=ek([ed({type:J.Sequence,itemType:e3})],e4);let e5=U=class extends e4{constructor(a){super(a),Object.setPrototypeOf(this,U.prototype)}};e5=U=ek([ed({type:J.Sequence,itemType:e3})],e5);class e6{static ONLY=!1;distributionPoint;onlyContainsUserCerts=e6.ONLY;onlyContainsCACerts=e6.ONLY;onlySomeReasons;indirectCRL=e6.ONLY;onlyContainsAttributeCerts=e6.ONLY;constructor(a={}){Object.assign(this,a)}}ek([ee({type:e2,context:0,optional:!0})],e6.prototype,"distributionPoint",void 0),ek([ee({type:K.Boolean,context:1,defaultValue:e6.ONLY,implicit:!0})],e6.prototype,"onlyContainsUserCerts",void 0),ek([ee({type:K.Boolean,context:2,defaultValue:e6.ONLY,implicit:!0})],e6.prototype,"onlyContainsCACerts",void 0),ek([ee({type:e1,context:3,optional:!0,implicit:!0})],e6.prototype,"onlySomeReasons",void 0),ek([ee({type:K.Boolean,context:4,defaultValue:e6.ONLY,implicit:!0})],e6.prototype,"indirectCRL",void 0),ek([ee({type:K.Boolean,context:5,defaultValue:e6.ONLY,implicit:!0})],e6.prototype,"onlyContainsAttributeCerts",void 0);let e7=`${eH}.21`;(l=V||(V={}))[l.unspecified=0]="unspecified",l[l.keyCompromise=1]="keyCompromise",l[l.cACompromise=2]="cACompromise",l[l.affiliationChanged=3]="affiliationChanged",l[l.superseded=4]="superseded",l[l.cessationOfOperation=5]="cessationOfOperation",l[l.certificateHold=6]="certificateHold",l[l.removeFromCRL=8]="removeFromCRL",l[l.privilegeWithdrawn=9]="privilegeWithdrawn",l[l.aACompromise=10]="aACompromise";let e8=class{reason=V.unspecified;constructor(a=V.unspecified){this.reason=a}toJSON(){return V[this.reason]}toString(){return this.toJSON()}};ek([ee({type:K.Enumerated})],e8.prototype,"reason",void 0),e8=ek([ed({type:J.Choice})],e8);let e9=`${eH}.37`,fa=W=class extends ei{constructor(a){super(a),Object.setPrototypeOf(this,W.prototype)}};fa=W=ek([ed({type:J.Sequence,itemType:K.ObjectIdentifier})],fa);let fb=`${eB}.1`,fc=`${eB}.2`,fd=`${eB}.3`,fe=`${eB}.4`,ff=`${eB}.8`,fg=`${eB}.9`,fh=class{value;constructor(a=new ArrayBuffer(0)){this.value=a}};ek([ee({type:K.Integer,converter:dQ})],fh.prototype,"value",void 0),fh=ek([ed({type:J.Choice})],fh);let fi=`${eH}.24`,fj=class{value=new Date;constructor(a){a&&(this.value=a)}};ek([ee({type:K.GeneralizedTime})],fj.prototype,"value",void 0),fj=ek([ed({type:J.Choice})],fj);let fk=`${eH}.18`,fl=X=class extends eQ{constructor(a){super(a),Object.setPrototypeOf(this,X.prototype)}};fl=X=ek([ed({type:J.Sequence})],fl);let fm=`${eH}.15`;(m=Y||(Y={}))[m.digitalSignature=1]="digitalSignature",m[m.nonRepudiation=2]="nonRepudiation",m[m.keyEncipherment=4]="keyEncipherment",m[m.dataEncipherment=8]="dataEncipherment",m[m.keyAgreement=16]="keyAgreement",m[m.keyCertSign=32]="keyCertSign",m[m.cRLSign=64]="cRLSign",m[m.encipherOnly=128]="encipherOnly",m[m.decipherOnly=256]="decipherOnly";class fn extends dL{toJSON(){let a=this.toNumber(),b=[];return a&Y.cRLSign&&b.push("crlSign"),a&Y.dataEncipherment&&b.push("dataEncipherment"),a&Y.decipherOnly&&b.push("decipherOnly"),a&Y.digitalSignature&&b.push("digitalSignature"),a&Y.encipherOnly&&b.push("encipherOnly"),a&Y.keyAgreement&&b.push("keyAgreement"),a&Y.keyCertSign&&b.push("keyCertSign"),a&Y.keyEncipherment&&b.push("keyEncipherment"),a&Y.nonRepudiation&&b.push("nonRepudiation"),b}toString(){return`[${this.toJSON().join(", ")}]`}}class fo{base=new ey;minimum=0;maximum;constructor(a={}){Object.assign(this,a)}}ek([ee({type:ey})],fo.prototype,"base",void 0),ek([ee({type:K.Integer,context:0,defaultValue:0,implicit:!0})],fo.prototype,"minimum",void 0),ek([ee({type:K.Integer,context:1,optional:!0,implicit:!0})],fo.prototype,"maximum",void 0);let fp=Z=class extends ei{constructor(a){super(a),Object.setPrototypeOf(this,Z.prototype)}};fp=Z=ek([ed({type:J.Sequence,itemType:fo})],fp);class fq{permittedSubtrees;excludedSubtrees;constructor(a={}){Object.assign(this,a)}}ek([ee({type:fp,context:0,optional:!0,implicit:!0})],fq.prototype,"permittedSubtrees",void 0),ek([ee({type:fp,context:1,optional:!0,implicit:!0})],fq.prototype,"excludedSubtrees",void 0);class fr{requireExplicitPolicy;inhibitPolicyMapping;constructor(a={}){Object.assign(this,a)}}ek([ee({type:K.Integer,context:0,implicit:!0,optional:!0,converter:dQ})],fr.prototype,"requireExplicitPolicy",void 0),ek([ee({type:K.Integer,context:1,implicit:!0,optional:!0,converter:dQ})],fr.prototype,"inhibitPolicyMapping",void 0);class fs{issuerDomainPolicy="";subjectDomainPolicy="";constructor(a={}){Object.assign(this,a)}}ek([ee({type:K.ObjectIdentifier})],fs.prototype,"issuerDomainPolicy",void 0),ek([ee({type:K.ObjectIdentifier})],fs.prototype,"subjectDomainPolicy",void 0);let ft=$=class extends ei{constructor(a){super(a),Object.setPrototypeOf(this,$.prototype)}};ft=$=ek([ed({type:J.Sequence,itemType:fs})],ft);let fu=`${eH}.17`,fv=_=class extends eQ{constructor(a){super(a),Object.setPrototypeOf(this,_.prototype)}};fv=_=ek([ed({type:J.Sequence})],fv);class fw{type="";values=[];constructor(a={}){Object.assign(this,a)}}ek([ee({type:K.ObjectIdentifier})],fw.prototype,"type",void 0),ek([ee({type:K.Any,repeated:"set"})],fw.prototype,"values",void 0);let fx=aa=class extends ei{constructor(a){super(a),Object.setPrototypeOf(this,aa.prototype)}};fx=aa=ek([ed({type:J.Sequence,itemType:fw})],fx);let fy=`${eH}.14`;class fz extends eM{}class fA{notBefore;notAfter;constructor(a={}){Object.assign(this,a)}}ek([ee({type:K.GeneralizedTime,context:0,implicit:!0,optional:!0})],fA.prototype,"notBefore",void 0),ek([ee({type:K.GeneralizedTime,context:1,implicit:!0,optional:!0})],fA.prototype,"notAfter",void 0),(n=ab||(ab={}))[n.keyUpdateAllowed=1]="keyUpdateAllowed",n[n.newExtensions=2]="newExtensions",n[n.pKIXCertificate=4]="pKIXCertificate";class fB extends dL{toJSON(){let a=[],b=this.toNumber();return b&ab.pKIXCertificate&&a.push("pKIXCertificate"),b&ab.newExtensions&&a.push("newExtensions"),b&ab.keyUpdateAllowed&&a.push("keyUpdateAllowed"),a}toString(){return`[${this.toJSON().join(", ")}]`}}class fC{entrustVers="";entrustInfoFlags=new fB;constructor(a={}){Object.assign(this,a)}}ek([ee({type:K.GeneralString})],fC.prototype,"entrustVers",void 0),ek([ee({type:fB})],fC.prototype,"entrustInfoFlags",void 0);let fD=ac=class extends ei{constructor(a){super(a),Object.setPrototypeOf(this,ac.prototype)}};fD=ac=ek([ed({type:J.Sequence,itemType:eJ})],fD);class fE{algorithm="";parameters;constructor(a={}){Object.assign(this,a)}isEqual(a){return a instanceof fE&&a.algorithm==this.algorithm&&(a.parameters&&this.parameters&&function(a,b,c={}){let d=dJ(a),e=dJ(b);if(!c.constantTime&&d.byteLength!==e.byteLength)return!1;let f=Math.max(d.byteLength,e.byteLength),g=d.byteLength^e.byteLength;for(let a=0;a<f;a++)g|=(d[a]??0)^(e[a]??0);return 0===g}(a.parameters,this.parameters)||a.parameters===this.parameters)}}ek([ee({type:K.ObjectIdentifier})],fE.prototype,"algorithm",void 0),ek([ee({type:K.Any,optional:!0})],fE.prototype,"parameters",void 0);class fF{algorithm=new fE;subjectPublicKey=new ArrayBuffer(0);constructor(a={}){Object.assign(this,a)}}ek([ee({type:fE})],fF.prototype,"algorithm",void 0),ek([ee({type:K.BitString})],fF.prototype,"subjectPublicKey",void 0);let fG=class{utcTime;generalTime;constructor(a){if(a)if("string"==typeof a||"number"==typeof a||a instanceof Date){const b=new Date(a);b.setMilliseconds(0),b.getUTCFullYear()>2049?this.generalTime=b:this.utcTime=b}else Object.assign(this,a)}getTime(){let a=this.utcTime||this.generalTime;if(!a)throw Error("Cannot get time from CHOICE object");return a}};ek([ee({type:K.UTCTime})],fG.prototype,"utcTime",void 0),ek([ee({type:K.GeneralizedTime})],fG.prototype,"generalTime",void 0),fG=ek([ed({type:J.Choice})],fG);class fH{notBefore=new fG(new Date);notAfter=new fG(new Date);constructor(a){a&&(this.notBefore=new fG(a.notBefore),this.notAfter=new fG(a.notAfter))}}ek([ee({type:fG})],fH.prototype,"notBefore",void 0),ek([ee({type:fG})],fH.prototype,"notAfter",void 0);class fI{static CRITICAL=!1;extnID="";critical=fI.CRITICAL;extnValue=new dM;constructor(a={}){Object.assign(this,a)}}ek([ee({type:K.ObjectIdentifier})],fI.prototype,"extnID",void 0),ek([ee({type:K.Boolean,defaultValue:fI.CRITICAL})],fI.prototype,"critical",void 0),ek([ee({type:dM})],fI.prototype,"extnValue",void 0);let fJ=ad=class extends ei{constructor(a){super(a),Object.setPrototypeOf(this,ad.prototype)}};fJ=ad=ek([ed({type:J.Sequence,itemType:fI})],fJ),(o=ae||(ae={}))[o.v1=0]="v1",o[o.v2=1]="v2",o[o.v3=2]="v3";class fK{version=ae.v1;serialNumber=new ArrayBuffer(0);signature=new fE;issuer=new ev;validity=new fH;subject=new ev;subjectPublicKeyInfo=new fF;issuerUniqueID;subjectUniqueID;extensions;constructor(a={}){Object.assign(this,a)}}ek([ee({type:K.Integer,context:0,defaultValue:ae.v1})],fK.prototype,"version",void 0),ek([ee({type:K.Integer,converter:dQ})],fK.prototype,"serialNumber",void 0),ek([ee({type:fE})],fK.prototype,"signature",void 0),ek([ee({type:ev})],fK.prototype,"issuer",void 0),ek([ee({type:fH})],fK.prototype,"validity",void 0),ek([ee({type:ev})],fK.prototype,"subject",void 0),ek([ee({type:fF})],fK.prototype,"subjectPublicKeyInfo",void 0),ek([ee({type:K.BitString,context:1,implicit:!0,optional:!0})],fK.prototype,"issuerUniqueID",void 0),ek([ee({type:K.BitString,context:2,implicit:!0,optional:!0})],fK.prototype,"subjectUniqueID",void 0),ek([ee({type:fJ,context:3,optional:!0})],fK.prototype,"extensions",void 0);class fL{tbsCertificate=new fK;tbsCertificateRaw;signatureAlgorithm=new fE;signatureValue=new ArrayBuffer(0);constructor(a={}){Object.assign(this,a)}}ek([ee({type:fK,raw:!0})],fL.prototype,"tbsCertificate",void 0),ek([ee({type:fE})],fL.prototype,"signatureAlgorithm",void 0),ek([ee({type:K.BitString})],fL.prototype,"signatureValue",void 0);class fM{userCertificate=new ArrayBuffer(0);revocationDate=new fG;crlEntryExtensions;constructor(a={}){Object.assign(this,a)}}ek([ee({type:K.Integer,converter:dQ})],fM.prototype,"userCertificate",void 0),ek([ee({type:fG})],fM.prototype,"revocationDate",void 0),ek([ee({type:fI,optional:!0,repeated:"sequence"})],fM.prototype,"crlEntryExtensions",void 0);class fN{version;signature=new fE;issuer=new ev;thisUpdate=new fG;nextUpdate;revokedCertificates;crlExtensions;constructor(a={}){Object.assign(this,a)}}ek([ee({type:K.Integer,optional:!0})],fN.prototype,"version",void 0),ek([ee({type:fE})],fN.prototype,"signature",void 0),ek([ee({type:ev})],fN.prototype,"issuer",void 0),ek([ee({type:fG})],fN.prototype,"thisUpdate",void 0),ek([ee({type:fG,optional:!0})],fN.prototype,"nextUpdate",void 0),ek([ee({type:fM,repeated:"sequence",optional:!0})],fN.prototype,"revokedCertificates",void 0),ek([ee({type:fI,optional:!0,context:0,repeated:"sequence"})],fN.prototype,"crlExtensions",void 0);class fO{tbsCertList=new fN;tbsCertListRaw;signatureAlgorithm=new fE;signature=new ArrayBuffer(0);constructor(a={}){Object.assign(this,a)}}ek([ee({type:fN,raw:!0})],fO.prototype,"tbsCertList",void 0),ek([ee({type:fE})],fO.prototype,"signatureAlgorithm",void 0),ek([ee({type:K.BitString})],fO.prototype,"signature",void 0);let fP={"2.5.4.6":"C","2.5.4.10":"O","2.5.4.11":"OU","2.5.4.3":"CN"};function fQ(a){let b=eg.parse(a,fL),c=b.tbsCertificate,d={combined:""};c.issuer.forEach(([a])=>{let b=fP[a.type];b&&(d[b]=a.value.toString())}),d.combined=fR(d);let e={combined:""};c.subject.forEach(([a])=>{let b=fP[a.type];b&&(e[b]=a.value.toString())}),e.combined=fR(e);let f=!1;if(c.extensions)for(let a of c.extensions)a.extnID===eO&&(f=eg.parse(a.extnValue,eP).cA);return{issuer:d,subject:e,version:c.version,basicConstraintsCA:f,notBefore:c.validity.notBefore.getTime(),notAfter:c.validity.notAfter.getTime(),parsedCertificate:b}}function fR(a){let b=[];return a.C&&b.push(a.C),a.O&&b.push(a.O),a.OU&&b.push(a.OU),a.CN&&b.push(a.CN),b.join(" : ")}c(96107);class fS{issuer=new ev;serialNumber=new ArrayBuffer(0);constructor(a={}){Object.assign(this,a)}}ek([ee({type:ev})],fS.prototype,"issuer",void 0),ek([ee({type:K.Integer,converter:dQ})],fS.prototype,"serialNumber",void 0);let fT=class{subjectKeyIdentifier;issuerAndSerialNumber;constructor(a={}){Object.assign(this,a)}};ek([ee({type:fz,context:0,implicit:!0})],fT.prototype,"subjectKeyIdentifier",void 0),ek([ee({type:fS})],fT.prototype,"issuerAndSerialNumber",void 0),fT=ek([ed({type:J.Choice})],fT),(p=af||(af={}))[p.v0=0]="v0",p[p.v1=1]="v1",p[p.v2=2]="v2",p[p.v3=3]="v3",p[p.v4=4]="v4",p[p.v5=5]="v5";let fU=class extends fE{};fU=ek([ed({type:J.Sequence})],fU);let fV=class extends fE{};fV=ek([ed({type:J.Sequence})],fV);let fW=class extends fE{};fW=ek([ed({type:J.Sequence})],fW);let fX=class extends fE{};fX=ek([ed({type:J.Sequence})],fX);let fY=class extends fE{};fY=ek([ed({type:J.Sequence})],fY);let fZ=class extends fE{};fZ=ek([ed({type:J.Sequence})],fZ);class f${attrType="";attrValues=[];constructor(a={}){Object.assign(this,a)}}ek([ee({type:K.ObjectIdentifier})],f$.prototype,"attrType",void 0),ek([ee({type:K.Any,repeated:"set"})],f$.prototype,"attrValues",void 0);class f_{version=af.v0;sid=new fT;digestAlgorithm=new fU;signedAttrs;signedAttrsRaw;signatureAlgorithm=new fV;signature=new dM;unsignedAttrs;constructor(a={}){Object.assign(this,a)}}ek([ee({type:K.Integer})],f_.prototype,"version",void 0),ek([ee({type:fT})],f_.prototype,"sid",void 0),ek([ee({type:fU})],f_.prototype,"digestAlgorithm",void 0),ek([ee({type:f$,repeated:"set",context:0,implicit:!0,optional:!0,raw:!0})],f_.prototype,"signedAttrs",void 0),ek([ee({type:fV})],f_.prototype,"signatureAlgorithm",void 0),ek([ee({type:dM})],f_.prototype,"signature",void 0),ek([ee({type:f$,repeated:"set",context:1,implicit:!0,optional:!0})],f_.prototype,"unsignedAttrs",void 0);let f0=ag=class extends ei{constructor(a){super(a),Object.setPrototypeOf(this,ag.prototype)}};f0=ag=ek([ed({type:J.Set,itemType:f_})],f0);let f1=class extends f_{};f1=ek([ed({type:J.Sequence})],f1);let f2=class extends fG{};f2=ek([ed({type:J.Choice})],f2);class f3{acIssuer=new ey;acSerial=0;attrs=[];constructor(a={}){Object.assign(this,a)}}ek([ee({type:ey})],f3.prototype,"acIssuer",void 0),ek([ee({type:K.Integer})],f3.prototype,"acSerial",void 0),ek([ee({type:fw,repeated:"sequence"})],f3.prototype,"attrs",void 0);let f4=ah=class extends ei{constructor(a){super(a),Object.setPrototypeOf(this,ah.prototype)}};f4=ah=ek([ed({type:J.Sequence,itemType:K.ObjectIdentifier})],f4);class f5{pathLenConstraint;permittedAttrs;excludedAttrs;permitUnSpecified=!0;constructor(a={}){Object.assign(this,a)}}ek([ee({type:K.Integer,optional:!0})],f5.prototype,"pathLenConstraint",void 0),ek([ee({type:f4,implicit:!0,context:0,optional:!0})],f5.prototype,"permittedAttrs",void 0),ek([ee({type:f4,implicit:!0,context:1,optional:!0})],f5.prototype,"excludedAttrs",void 0),ek([ee({type:K.Boolean,defaultValue:!0})],f5.prototype,"permitUnSpecified",void 0);class f6{issuer=new eQ;serial=new ArrayBuffer(0);issuerUID=new ArrayBuffer(0);constructor(a={}){Object.assign(this,a)}}ek([ee({type:eQ})],f6.prototype,"issuer",void 0),ek([ee({type:K.Integer,converter:dQ})],f6.prototype,"serial",void 0),ek([ee({type:K.BitString,optional:!0})],f6.prototype,"issuerUID",void 0),(q=ai||(ai={}))[q.publicKey=0]="publicKey",q[q.publicKeyCert=1]="publicKeyCert",q[q.otherObjectTypes=2]="otherObjectTypes";class f7{digestedObjectType=ai.publicKey;otherObjectTypeID;digestAlgorithm=new fE;objectDigest=new ArrayBuffer(0);constructor(a={}){Object.assign(this,a)}}ek([ee({type:K.Enumerated})],f7.prototype,"digestedObjectType",void 0),ek([ee({type:K.ObjectIdentifier,optional:!0})],f7.prototype,"otherObjectTypeID",void 0),ek([ee({type:fE})],f7.prototype,"digestAlgorithm",void 0),ek([ee({type:K.BitString})],f7.prototype,"objectDigest",void 0);class f8{issuerName;baseCertificateID;objectDigestInfo;constructor(a={}){Object.assign(this,a)}}ek([ee({type:eQ,optional:!0})],f8.prototype,"issuerName",void 0),ek([ee({type:f6,context:0,implicit:!0,optional:!0})],f8.prototype,"baseCertificateID",void 0),ek([ee({type:f7,context:1,implicit:!0,optional:!0})],f8.prototype,"objectDigestInfo",void 0);let f9=class{v1Form;v2Form;constructor(a={}){Object.assign(this,a)}};ek([ee({type:ey,repeated:"sequence"})],f9.prototype,"v1Form",void 0),ek([ee({type:f8,context:0,implicit:!0})],f9.prototype,"v2Form",void 0),f9=ek([ed({type:J.Choice})],f9);class ga{notBeforeTime=new Date;notAfterTime=new Date;constructor(a={}){Object.assign(this,a)}}ek([ee({type:K.GeneralizedTime})],ga.prototype,"notBeforeTime",void 0),ek([ee({type:K.GeneralizedTime})],ga.prototype,"notAfterTime",void 0);class gb{baseCertificateID;entityName;objectDigestInfo;constructor(a={}){Object.assign(this,a)}}ek([ee({type:f6,implicit:!0,context:0,optional:!0})],gb.prototype,"baseCertificateID",void 0),ek([ee({type:eQ,implicit:!0,context:1,optional:!0})],gb.prototype,"entityName",void 0),ek([ee({type:f7,implicit:!0,context:2,optional:!0})],gb.prototype,"objectDigestInfo",void 0),(r=aj||(aj={}))[r.v2=1]="v2";class gc{version=aj.v2;holder=new gb;issuer=new f9;signature=new fE;serialNumber=new ArrayBuffer(0);attrCertValidityPeriod=new ga;attributes=[];issuerUniqueID;extensions;constructor(a={}){Object.assign(this,a)}}ek([ee({type:K.Integer})],gc.prototype,"version",void 0),ek([ee({type:gb})],gc.prototype,"holder",void 0),ek([ee({type:f9})],gc.prototype,"issuer",void 0),ek([ee({type:fE})],gc.prototype,"signature",void 0),ek([ee({type:K.Integer,converter:dQ})],gc.prototype,"serialNumber",void 0),ek([ee({type:ga})],gc.prototype,"attrCertValidityPeriod",void 0),ek([ee({type:fw,repeated:"sequence"})],gc.prototype,"attributes",void 0),ek([ee({type:K.BitString,optional:!0})],gc.prototype,"issuerUniqueID",void 0),ek([ee({type:fJ,optional:!0})],gc.prototype,"extensions",void 0);class gd{acinfo=new gc;signatureAlgorithm=new fE;signatureValue=new ArrayBuffer(0);constructor(a={}){Object.assign(this,a)}}ek([ee({type:gc})],gd.prototype,"acinfo",void 0),ek([ee({type:fE})],gd.prototype,"signatureAlgorithm",void 0),ek([ee({type:K.BitString})],gd.prototype,"signatureValue",void 0),(s=ak||(ak={}))[s.unmarked=1]="unmarked",s[s.unclassified=2]="unclassified",s[s.restricted=4]="restricted",s[s.confidential=8]="confidential",s[s.secret=16]="secret",s[s.topSecret=32]="topSecret";class ge extends dL{}class gf{type="";value=new ArrayBuffer(0);constructor(a={}){Object.assign(this,a)}}ek([ee({type:K.ObjectIdentifier,implicit:!0,context:0})],gf.prototype,"type",void 0),ek([ee({type:K.Any,implicit:!0,context:1})],gf.prototype,"value",void 0);class gg{policyId="";classList=new ge(ak.unclassified);securityCategories;constructor(a={}){Object.assign(this,a)}}ek([ee({type:K.ObjectIdentifier})],gg.prototype,"policyId",void 0),ek([ee({type:ge,defaultValue:new ge(ak.unclassified)})],gg.prototype,"classList",void 0),ek([ee({type:gf,repeated:"set"})],gg.prototype,"securityCategories",void 0);class gh{cotets;oid;string;constructor(a={}){Object.assign(this,a)}}ek([ee({type:dM})],gh.prototype,"cotets",void 0),ek([ee({type:K.ObjectIdentifier})],gh.prototype,"oid",void 0),ek([ee({type:K.Utf8String})],gh.prototype,"string",void 0);class gi{policyAuthority;values=[];constructor(a={}){Object.assign(this,a)}}ek([ee({type:eQ,implicit:!0,context:0,optional:!0})],gi.prototype,"policyAuthority",void 0),ek([ee({type:gh,repeated:"sequence"})],gi.prototype,"values",void 0);class gj{targetCertificate=new f6;targetName;certDigestInfo;constructor(a={}){Object.assign(this,a)}}ek([ee({type:f6})],gj.prototype,"targetCertificate",void 0),ek([ee({type:ey,optional:!0})],gj.prototype,"targetName",void 0),ek([ee({type:f7,optional:!0})],gj.prototype,"certDigestInfo",void 0);let gk=class{targetName;targetGroup;targetCert;constructor(a={}){Object.assign(this,a)}};ek([ee({type:ey,context:0,implicit:!0})],gk.prototype,"targetName",void 0),ek([ee({type:ey,context:1,implicit:!0})],gk.prototype,"targetGroup",void 0),ek([ee({type:gj,context:2,implicit:!0})],gk.prototype,"targetCert",void 0),gk=ek([ed({type:J.Choice})],gk);let gl=al=class extends ei{constructor(a){super(a),Object.setPrototypeOf(this,al.prototype)}};gl=al=ek([ed({type:J.Sequence,itemType:gk})],gl);let gm=am=class extends ei{constructor(a){super(a),Object.setPrototypeOf(this,am.prototype)}};gm=am=ek([ed({type:J.Sequence,itemType:gl})],gm);class gn{roleAuthority;roleName;constructor(a={}){Object.assign(this,a)}}ek([ee({type:eQ,implicit:!0,context:0,optional:!0})],gn.prototype,"roleAuthority",void 0),ek([ee({type:ey,implicit:!0,context:1})],gn.prototype,"roleName",void 0);class go{service=new ey;ident=new ey;authInfo;constructor(a={}){Object.assign(this,a)}}ek([ee({type:ey})],go.prototype,"service",void 0),ek([ee({type:ey})],go.prototype,"ident",void 0),ek([ee({type:dM,optional:!0})],go.prototype,"authInfo",void 0);class gp{otherCertFormat="";otherCert=new ArrayBuffer(0);constructor(a={}){Object.assign(this,a)}}ek([ee({type:K.ObjectIdentifier})],gp.prototype,"otherCertFormat",void 0),ek([ee({type:K.Any})],gp.prototype,"otherCert",void 0);let gq=class{certificate;v2AttrCert;other;constructor(a={}){Object.assign(this,a)}};ek([ee({type:fL})],gq.prototype,"certificate",void 0),ek([ee({type:gd,context:2,implicit:!0})],gq.prototype,"v2AttrCert",void 0),ek([ee({type:gp,context:3,implicit:!0})],gq.prototype,"other",void 0),gq=ek([ed({type:J.Choice})],gq);let gr=an=class extends ei{constructor(a){super(a),Object.setPrototypeOf(this,an.prototype)}};gr=an=ek([ed({type:J.Set,itemType:gq})],gr);class gs{contentType="";content=new ArrayBuffer(0);constructor(a={}){Object.assign(this,a)}}ek([ee({type:K.ObjectIdentifier})],gs.prototype,"contentType",void 0),ek([ee({type:K.Any,context:0})],gs.prototype,"content",void 0);let gt=class{single;any;constructor(a={}){Object.assign(this,a)}};ek([ee({type:dM})],gt.prototype,"single",void 0),ek([ee({type:K.Any})],gt.prototype,"any",void 0),gt=ek([ed({type:J.Choice})],gt);class gu{eContentType="";eContent;constructor(a={}){Object.assign(this,a)}}ek([ee({type:K.ObjectIdentifier})],gu.prototype,"eContentType",void 0),ek([ee({type:gt,context:0,optional:!0})],gu.prototype,"eContent",void 0);let gv=class{value;constructedValue;constructor(a={}){Object.assign(this,a)}};ek([ee({type:dM,context:0,implicit:!0,optional:!0})],gv.prototype,"value",void 0),ek([ee({type:dM,converter:{fromASN:a=>new dM(a.getValue()),toASN:a=>a.toASN()},context:0,implicit:!0,optional:!0,repeated:"sequence"})],gv.prototype,"constructedValue",void 0),gv=ek([ed({type:J.Choice})],gv);class gw{contentType="";contentEncryptionAlgorithm=new fX;encryptedContent;constructor(a={}){Object.assign(this,a)}}ek([ee({type:K.ObjectIdentifier})],gw.prototype,"contentType",void 0),ek([ee({type:fX})],gw.prototype,"contentEncryptionAlgorithm",void 0),ek([ee({type:gv,optional:!0})],gw.prototype,"encryptedContent",void 0);class gx{keyAttrId="";keyAttr;constructor(a={}){Object.assign(this,a)}}ek([ee({type:K.ObjectIdentifier})],gx.prototype,"keyAttrId",void 0),ek([ee({type:K.Any,optional:!0})],gx.prototype,"keyAttr",void 0);class gy{subjectKeyIdentifier=new fz;date;other;constructor(a={}){Object.assign(this,a)}}ek([ee({type:fz})],gy.prototype,"subjectKeyIdentifier",void 0),ek([ee({type:K.GeneralizedTime,optional:!0})],gy.prototype,"date",void 0),ek([ee({type:gx,optional:!0})],gy.prototype,"other",void 0);let gz=class{rKeyId;issuerAndSerialNumber;constructor(a={}){Object.assign(this,a)}};ek([ee({type:gy,context:0,implicit:!0,optional:!0})],gz.prototype,"rKeyId",void 0),ek([ee({type:fS,optional:!0})],gz.prototype,"issuerAndSerialNumber",void 0),gz=ek([ed({type:J.Choice})],gz);class gA{rid=new gz;encryptedKey=new dM;constructor(a={}){Object.assign(this,a)}}ek([ee({type:gz})],gA.prototype,"rid",void 0),ek([ee({type:dM})],gA.prototype,"encryptedKey",void 0);let gB=ao=class extends ei{constructor(a){super(a),Object.setPrototypeOf(this,ao.prototype)}};gB=ao=ek([ed({type:J.Sequence,itemType:gA})],gB);class gC{algorithm=new fE;publicKey=new ArrayBuffer(0);constructor(a={}){Object.assign(this,a)}}ek([ee({type:fE})],gC.prototype,"algorithm",void 0),ek([ee({type:K.BitString})],gC.prototype,"publicKey",void 0);let gD=class{subjectKeyIdentifier;originatorKey;issuerAndSerialNumber;constructor(a={}){Object.assign(this,a)}};ek([ee({type:fz,context:0,implicit:!0,optional:!0})],gD.prototype,"subjectKeyIdentifier",void 0),ek([ee({type:gC,context:1,implicit:!0,optional:!0})],gD.prototype,"originatorKey",void 0),ek([ee({type:fS,optional:!0})],gD.prototype,"issuerAndSerialNumber",void 0),gD=ek([ed({type:J.Choice})],gD);class gE{version=af.v3;originator=new gD;ukm;keyEncryptionAlgorithm=new fW;recipientEncryptedKeys=new gB;constructor(a={}){Object.assign(this,a)}}ek([ee({type:K.Integer})],gE.prototype,"version",void 0),ek([ee({type:gD,context:0})],gE.prototype,"originator",void 0),ek([ee({type:dM,context:1,optional:!0})],gE.prototype,"ukm",void 0),ek([ee({type:fW})],gE.prototype,"keyEncryptionAlgorithm",void 0),ek([ee({type:gB})],gE.prototype,"recipientEncryptedKeys",void 0);let gF=class{subjectKeyIdentifier;issuerAndSerialNumber;constructor(a={}){Object.assign(this,a)}};ek([ee({type:fz,context:0,implicit:!0})],gF.prototype,"subjectKeyIdentifier",void 0),ek([ee({type:fS})],gF.prototype,"issuerAndSerialNumber",void 0),gF=ek([ed({type:J.Choice})],gF);class gG{version=af.v0;rid=new gF;keyEncryptionAlgorithm=new fW;encryptedKey=new dM;constructor(a={}){Object.assign(this,a)}}ek([ee({type:K.Integer})],gG.prototype,"version",void 0),ek([ee({type:gF})],gG.prototype,"rid",void 0),ek([ee({type:fW})],gG.prototype,"keyEncryptionAlgorithm",void 0),ek([ee({type:dM})],gG.prototype,"encryptedKey",void 0);class gH{keyIdentifier=new dM;date;other;constructor(a={}){Object.assign(this,a)}}ek([ee({type:dM})],gH.prototype,"keyIdentifier",void 0),ek([ee({type:K.GeneralizedTime,optional:!0})],gH.prototype,"date",void 0),ek([ee({type:gx,optional:!0})],gH.prototype,"other",void 0);class gI{version=af.v4;kekid=new gH;keyEncryptionAlgorithm=new fW;encryptedKey=new dM;constructor(a={}){Object.assign(this,a)}}ek([ee({type:K.Integer})],gI.prototype,"version",void 0),ek([ee({type:gH})],gI.prototype,"kekid",void 0),ek([ee({type:fW})],gI.prototype,"keyEncryptionAlgorithm",void 0),ek([ee({type:dM})],gI.prototype,"encryptedKey",void 0);class gJ{version=af.v0;keyDerivationAlgorithm;keyEncryptionAlgorithm=new fW;encryptedKey=new dM;constructor(a={}){Object.assign(this,a)}}ek([ee({type:K.Integer})],gJ.prototype,"version",void 0),ek([ee({type:fZ,context:0,optional:!0})],gJ.prototype,"keyDerivationAlgorithm",void 0),ek([ee({type:fW})],gJ.prototype,"keyEncryptionAlgorithm",void 0),ek([ee({type:dM})],gJ.prototype,"encryptedKey",void 0);class gK{oriType="";oriValue=new ArrayBuffer(0);constructor(a={}){Object.assign(this,a)}}ek([ee({type:K.ObjectIdentifier})],gK.prototype,"oriType",void 0),ek([ee({type:K.Any})],gK.prototype,"oriValue",void 0);let gL=class{ktri;kari;kekri;pwri;ori;constructor(a={}){Object.assign(this,a)}};ek([ee({type:gG,optional:!0})],gL.prototype,"ktri",void 0),ek([ee({type:gE,context:1,implicit:!0,optional:!0})],gL.prototype,"kari",void 0),ek([ee({type:gI,context:2,implicit:!0,optional:!0})],gL.prototype,"kekri",void 0),ek([ee({type:gJ,context:3,implicit:!0,optional:!0})],gL.prototype,"pwri",void 0),ek([ee({type:gK,context:4,implicit:!0,optional:!0})],gL.prototype,"ori",void 0),gL=ek([ed({type:J.Choice})],gL);let gM=ap=class extends ei{constructor(a){super(a),Object.setPrototypeOf(this,ap.prototype)}};gM=ap=ek([ed({type:J.Set,itemType:gL})],gM);class gN{otherRevInfoFormat="";otherRevInfo=new ArrayBuffer(0);constructor(a={}){Object.assign(this,a)}}ek([ee({type:K.ObjectIdentifier})],gN.prototype,"otherRevInfoFormat",void 0),ek([ee({type:K.Any})],gN.prototype,"otherRevInfo",void 0);let gO=class{other=new gN;constructor(a={}){Object.assign(this,a)}};ek([ee({type:gN,context:1,implicit:!0})],gO.prototype,"other",void 0),gO=ek([ed({type:J.Choice})],gO);let gP=aq=class extends ei{constructor(a){super(a),Object.setPrototypeOf(this,aq.prototype)}};gP=aq=ek([ed({type:J.Set,itemType:gO})],gP);class gQ{certs;crls;constructor(a={}){Object.assign(this,a)}}ek([ee({type:gr,context:0,implicit:!0,optional:!0})],gQ.prototype,"certs",void 0),ek([ee({type:gP,context:1,implicit:!0,optional:!0})],gQ.prototype,"crls",void 0);let gR=ar=class extends ei{constructor(a){super(a),Object.setPrototypeOf(this,ar.prototype)}};gR=ar=ek([ed({type:J.Set,itemType:f$})],gR);class gS{version=af.v0;originatorInfo;recipientInfos=new gM;encryptedContentInfo=new gw;unprotectedAttrs;constructor(a={}){Object.assign(this,a)}}ek([ee({type:K.Integer})],gS.prototype,"version",void 0),ek([ee({type:gQ,context:0,implicit:!0,optional:!0})],gS.prototype,"originatorInfo",void 0),ek([ee({type:gM})],gS.prototype,"recipientInfos",void 0),ek([ee({type:gw})],gS.prototype,"encryptedContentInfo",void 0),ek([ee({type:gR,context:1,implicit:!0,optional:!0})],gS.prototype,"unprotectedAttrs",void 0);let gT=as=class extends ei{constructor(a){super(a),Object.setPrototypeOf(this,as.prototype)}};gT=as=ek([ed({type:J.Set,itemType:fU})],gT);class gU{version=af.v0;digestAlgorithms=new gT;encapContentInfo=new gu;certificates;crls;signerInfos=new f0;constructor(a={}){Object.assign(this,a)}}ek([ee({type:K.Integer})],gU.prototype,"version",void 0),ek([ee({type:gT})],gU.prototype,"digestAlgorithms",void 0),ek([ee({type:gu})],gU.prototype,"encapContentInfo",void 0),ek([ee({type:gr,context:0,implicit:!0,optional:!0})],gU.prototype,"certificates",void 0),ek([ee({type:gP,context:1,implicit:!0,optional:!0})],gU.prototype,"crls",void 0),ek([ee({type:f0})],gU.prototype,"signerInfos",void 0);let gV="1.2.840.10045.2.1",gW="1.2.840.10045.4.1",gX="1.2.840.10045.4.3.1",gY="1.2.840.10045.4.3.2",gZ="1.2.840.10045.4.3.3",g$="1.2.840.10045.4.3.4",g_="1.2.840.10045.3.1.7",g0="1.3.132.0.34",g1="1.3.132.0.35";function g2(a){return new fE({algorithm:a})}let g3=g2(gW);g2(gX);let g4=g2(gY),g5=g2(gZ),g6=g2(g$),g7=class{fieldType;parameters;constructor(a={}){Object.assign(this,a)}};ek([ee({type:K.ObjectIdentifier})],g7.prototype,"fieldType",void 0),ek([ee({type:K.Any})],g7.prototype,"parameters",void 0),g7=ek([ed({type:J.Sequence})],g7);class g8 extends dM{}let g9=class{a;b;seed;constructor(a={}){Object.assign(this,a)}};ek([ee({type:K.OctetString})],g9.prototype,"a",void 0),ek([ee({type:K.OctetString})],g9.prototype,"b",void 0),ek([ee({type:K.BitString,optional:!0})],g9.prototype,"seed",void 0),g9=ek([ed({type:J.Sequence})],g9),(t=at||(at={}))[t.ecpVer1=1]="ecpVer1";let ha=class{version=at.ecpVer1;fieldID;curve;base;order;cofactor;constructor(a={}){Object.assign(this,a)}};ek([ee({type:K.Integer})],ha.prototype,"version",void 0),ek([ee({type:g7})],ha.prototype,"fieldID",void 0),ek([ee({type:g9})],ha.prototype,"curve",void 0),ek([ee({type:g8})],ha.prototype,"base",void 0),ek([ee({type:K.Integer,converter:dQ})],ha.prototype,"order",void 0),ek([ee({type:K.Integer,optional:!0})],ha.prototype,"cofactor",void 0),ha=ek([ed({type:J.Sequence})],ha);let hb=class{namedCurve;implicitCurve;specifiedCurve;constructor(a={}){Object.assign(this,a)}};ek([ee({type:K.ObjectIdentifier})],hb.prototype,"namedCurve",void 0),ek([ee({type:K.Null})],hb.prototype,"implicitCurve",void 0),ek([ee({type:ha})],hb.prototype,"specifiedCurve",void 0),hb=ek([ed({type:J.Choice})],hb);class hc{version=1;privateKey=new dM;parameters;publicKey;constructor(a={}){Object.assign(this,a)}}ek([ee({type:K.Integer})],hc.prototype,"version",void 0),ek([ee({type:dM})],hc.prototype,"privateKey",void 0),ek([ee({type:hb,context:0,optional:!0})],hc.prototype,"parameters",void 0),ek([ee({type:K.BitString,context:1,optional:!0})],hc.prototype,"publicKey",void 0);class hd{r=new ArrayBuffer(0);s=new ArrayBuffer(0);constructor(a={}){Object.assign(this,a)}}ek([ee({type:K.Integer,converter:dQ})],hd.prototype,"r",void 0),ek([ee({type:K.Integer,converter:dQ})],hd.prototype,"s",void 0);let he="1.2.840.113549.1.1",hf=`${he}.1`,hg=`${he}.7`,hh=`${he}.9`,hi=`${he}.10`,hj=`${he}.2`,hk=`${he}.4`,hl=`${he}.5`,hm=`${he}.14`,hn=`${he}.11`,ho=`${he}.12`,hp=`${he}.13`,hq=`${he}.15`,hr=`${he}.16`,hs="1.3.14.3.2.26",ht="2.16.840.1.101.3.4.2.4",hu="2.16.840.1.101.3.4.2.1",hv="2.16.840.1.101.3.4.2.2",hw="2.16.840.1.101.3.4.2.3",hx=`${he}.8`;function hy(a){return new fE({algorithm:a,parameters:null})}hy("1.2.840.113549.2.2"),hy("1.2.840.113549.2.5");let hz=hy(hs);hy(ht),hy(hu),hy(hv),hy(hw),hy("2.16.840.1.101.3.4.2.5"),hy("2.16.840.1.101.3.4.2.6");let hA=new fE({algorithm:hx,parameters:ej.serialize(hz)}),hB=new fE({algorithm:hh,parameters:ej.serialize(dU.toASN(new Uint8Array([218,57,163,238,94,107,75,13,50,85,191,239,149,96,24,144,175,216,7,9]).buffer))});hy(hf),hy(hj),hy(hk),hy(hl),hy(hq),hy(hr),hy(ho),hy(hp),hy(hq),hy(hr);class hC{hashAlgorithm=new fE(hz);maskGenAlgorithm=new fE({algorithm:hx,parameters:ej.serialize(hz)});pSourceAlgorithm=new fE(hB);constructor(a={}){Object.assign(this,a)}}ek([ee({type:fE,context:0,defaultValue:hz})],hC.prototype,"hashAlgorithm",void 0),ek([ee({type:fE,context:1,defaultValue:hA})],hC.prototype,"maskGenAlgorithm",void 0),ek([ee({type:fE,context:2,defaultValue:hB})],hC.prototype,"pSourceAlgorithm",void 0),new fE({algorithm:hg,parameters:ej.serialize(new hC)});class hD{hashAlgorithm=new fE(hz);maskGenAlgorithm=new fE({algorithm:hx,parameters:ej.serialize(hz)});saltLength=20;trailerField=1;constructor(a={}){Object.assign(this,a)}}ek([ee({type:fE,context:0,defaultValue:hz})],hD.prototype,"hashAlgorithm",void 0),ek([ee({type:fE,context:1,defaultValue:hA})],hD.prototype,"maskGenAlgorithm",void 0),ek([ee({type:K.Integer,context:2,defaultValue:20})],hD.prototype,"saltLength",void 0),ek([ee({type:K.Integer,context:3,defaultValue:1})],hD.prototype,"trailerField",void 0),new fE({algorithm:hi,parameters:ej.serialize(new hD)});class hE{digestAlgorithm=new fE;digest=new dM;constructor(a={}){Object.assign(this,a)}}ek([ee({type:fE})],hE.prototype,"digestAlgorithm",void 0),ek([ee({type:dM})],hE.prototype,"digest",void 0);class hF{prime=new ArrayBuffer(0);exponent=new ArrayBuffer(0);coefficient=new ArrayBuffer(0);constructor(a={}){Object.assign(this,a)}}ek([ee({type:K.Integer,converter:dQ})],hF.prototype,"prime",void 0),ek([ee({type:K.Integer,converter:dQ})],hF.prototype,"exponent",void 0),ek([ee({type:K.Integer,converter:dQ})],hF.prototype,"coefficient",void 0);let hG=au=class extends ei{constructor(a){super(a),Object.setPrototypeOf(this,au.prototype)}};hG=au=ek([ed({type:J.Sequence,itemType:hF})],hG);class hH{version=0;modulus=new ArrayBuffer(0);publicExponent=new ArrayBuffer(0);privateExponent=new ArrayBuffer(0);prime1=new ArrayBuffer(0);prime2=new ArrayBuffer(0);exponent1=new ArrayBuffer(0);exponent2=new ArrayBuffer(0);coefficient=new ArrayBuffer(0);otherPrimeInfos;constructor(a={}){Object.assign(this,a)}}ek([ee({type:K.Integer})],hH.prototype,"version",void 0),ek([ee({type:K.Integer,converter:dQ})],hH.prototype,"modulus",void 0),ek([ee({type:K.Integer,converter:dQ})],hH.prototype,"publicExponent",void 0),ek([ee({type:K.Integer,converter:dQ})],hH.prototype,"privateExponent",void 0),ek([ee({type:K.Integer,converter:dQ})],hH.prototype,"prime1",void 0),ek([ee({type:K.Integer,converter:dQ})],hH.prototype,"prime2",void 0),ek([ee({type:K.Integer,converter:dQ})],hH.prototype,"exponent1",void 0),ek([ee({type:K.Integer,converter:dQ})],hH.prototype,"exponent2",void 0),ek([ee({type:K.Integer,converter:dQ})],hH.prototype,"coefficient",void 0),ek([ee({type:hG,optional:!0})],hH.prototype,"otherPrimeInfos",void 0);class hI{modulus=new ArrayBuffer(0);publicExponent=new ArrayBuffer(0);constructor(a={}){Object.assign(this,a)}}ek([ee({type:K.Integer,converter:dQ})],hI.prototype,"modulus",void 0),ek([ee({type:K.Integer,converter:dQ})],hI.prototype,"publicExponent",void 0),(u=av||(av={}))[u.Transient=0]="Transient",u[u.Singleton=1]="Singleton",u[u.ResolutionScoped=2]="ResolutionScoped",u[u.ContainerScoped=3]="ContainerScoped";let hJ=av;var hK=function(a,b){return(hK=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])})(a,b)};function hL(a,b){function c(){this.constructor=a}hK(a,b),a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)}function hM(a){var b="function"==typeof Symbol&&Symbol.iterator,c=b&&a[b],d=0;if(c)return c.call(a);if(a&&"number"==typeof a.length)return{next:function(){return a&&d>=a.length&&(a=void 0),{value:a&&a[d++],done:!a}}};throw TypeError(b?"Object is not iterable.":"Symbol.iterator is not defined.")}function hN(a,b){var c="function"==typeof Symbol&&a[Symbol.iterator];if(!c)return a;var d,e,f=c.call(a),g=[];try{for(;(void 0===b||b-- >0)&&!(d=f.next()).done;)g.push(d.value)}catch(a){e={error:a}}finally{try{d&&!d.done&&(c=f.return)&&c.call(f)}finally{if(e)throw e.error}}return g}function hO(){for(var a=[],b=0;b<arguments.length;b++)a=a.concat(hN(arguments[b]));return a}function hP(a){return!!a.useClass}function hQ(a){return!!a.useFactory}var hR=function(){function a(a){this.wrap=a,this.reflectMethods=["get","getPrototypeOf","setPrototypeOf","getOwnPropertyDescriptor","defineProperty","has","set","deleteProperty","apply","construct","ownKeys"]}return a.prototype.createProxy=function(a){var b,c=this,d=!1;return new Proxy({},this.createHandler(function(){return d||(b=a(c.wrap()),d=!0),b}))},a.prototype.createHandler=function(a){var b={};return this.reflectMethods.forEach(function(c){b[c]=function(){for(var b=[],d=0;d<arguments.length;d++)b[d]=arguments[d];return b[0]=a(),Reflect[c].apply(void 0,hO(b))}}),b},a}();function hS(a){return"string"==typeof a||"symbol"==typeof a}function hT(a){return"object"==typeof a&&"token"in a&&"transform"in a}function hU(a){return!!a.useToken}function hV(a){return void 0!=a.useValue}var hW=function(){function a(){this._registryMap=new Map}return a.prototype.entries=function(){return this._registryMap.entries()},a.prototype.getAll=function(a){return this.ensure(a),this._registryMap.get(a)},a.prototype.get=function(a){this.ensure(a);var b=this._registryMap.get(a);return b[b.length-1]||null},a.prototype.set=function(a,b){this.ensure(a),this._registryMap.get(a).push(b)},a.prototype.setAll=function(a,b){this._registryMap.set(a,b)},a.prototype.has=function(a){return this.ensure(a),this._registryMap.get(a).length>0},a.prototype.clear=function(){this._registryMap.clear()},a.prototype.ensure=function(a){this._registryMap.has(a)||this._registryMap.set(a,[])},a}(),hX=function(a){function b(){return null!==a&&a.apply(this,arguments)||this}return hL(b,a),b}(hW);let hY=function(){this.scopedResolutions=new Map};var hZ=function(a){function b(){return null!==a&&a.apply(this,arguments)||this}return hL(b,a),b}(hW),h$=function(a){function b(){return null!==a&&a.apply(this,arguments)||this}return hL(b,a),b}(hW);let h_=function(){this.preResolution=new hZ,this.postResolution=new h$};var h0=new Map,h1=new(function(){function a(a){this.parent=a,this._registry=new hX,this.interceptors=new h_,this.disposed=!1,this.disposables=new Set}return a.prototype.register=function(a,b,c){if(void 0===c&&(c={lifecycle:hJ.Transient}),this.ensureNotDisposed(),d=hP(b)||hV(b)||hU(b)||hQ(b)?b:{useClass:b},hU(d))for(var d,e=[a],f=d;null!=f;){var g=f.useToken;if(e.includes(g))throw Error("Token registration cycle detected! "+hO(e,[g]).join(" -> "));e.push(g);var h=this._registry.get(g);f=h&&hU(h.provider)?h.provider:null}if((c.lifecycle===hJ.Singleton||c.lifecycle==hJ.ContainerScoped||c.lifecycle==hJ.ResolutionScoped)&&(hV(d)||hQ(d)))throw Error('Cannot use lifecycle "'+hJ[c.lifecycle]+'" with ValueProviders or FactoryProviders');return this._registry.set(a,{provider:d,options:c}),this},a.prototype.registerType=function(a,b){return(this.ensureNotDisposed(),hS(b))?this.register(a,{useToken:b}):this.register(a,{useClass:b})},a.prototype.registerInstance=function(a,b){return this.ensureNotDisposed(),this.register(a,{useValue:b})},a.prototype.registerSingleton=function(a,b){if(this.ensureNotDisposed(),hS(a)){if(hS(b))return this.register(a,{useToken:b},{lifecycle:hJ.Singleton});if(b)return this.register(a,{useClass:b},{lifecycle:hJ.Singleton});throw Error('Cannot register a type name as a singleton without a "to" token')}var c=a;return b&&!hS(b)&&(c=b),this.register(a,{useClass:c},{lifecycle:hJ.Singleton})},a.prototype.resolve=function(a,b,c){void 0===b&&(b=new hY),void 0===c&&(c=!1),this.ensureNotDisposed();var d=this.getRegistration(a);if(!d&&hS(a)){if(c)return;throw Error('Attempted to resolve unregistered dependency token: "'+a.toString()+'"')}if(this.executePreResolutionInterceptor(a,"Single"),d){var e=this.resolveRegistration(d,b);return this.executePostResolutionInterceptor(a,e,"Single"),e}if("function"==typeof a||a instanceof hR){var e=this.construct(a,b);return this.executePostResolutionInterceptor(a,e,"Single"),e}throw Error("Attempted to construct an undefined constructor. Could mean a circular dependency problem. Try using `delay` function.")},a.prototype.executePreResolutionInterceptor=function(a,b){var c,d;if(this.interceptors.preResolution.has(a)){var e=[];try{for(var f=hM(this.interceptors.preResolution.getAll(a)),g=f.next();!g.done;g=f.next()){var h=g.value;"Once"!=h.options.frequency&&e.push(h),h.callback(a,b)}}catch(a){c={error:a}}finally{try{g&&!g.done&&(d=f.return)&&d.call(f)}finally{if(c)throw c.error}}this.interceptors.preResolution.setAll(a,e)}},a.prototype.executePostResolutionInterceptor=function(a,b,c){var d,e;if(this.interceptors.postResolution.has(a)){var f=[];try{for(var g=hM(this.interceptors.postResolution.getAll(a)),h=g.next();!h.done;h=g.next()){var i=h.value;"Once"!=i.options.frequency&&f.push(i),i.callback(a,b,c)}}catch(a){d={error:a}}finally{try{h&&!h.done&&(e=g.return)&&e.call(g)}finally{if(d)throw d.error}}this.interceptors.postResolution.setAll(a,f)}},a.prototype.resolveRegistration=function(a,b){if(this.ensureNotDisposed(),a.options.lifecycle===hJ.ResolutionScoped&&b.scopedResolutions.has(a))return b.scopedResolutions.get(a);var c,d=a.options.lifecycle===hJ.Singleton,e=a.options.lifecycle===hJ.ContainerScoped,f=d||e;return c=hV(a.provider)?a.provider.useValue:hU(a.provider)?f?a.instance||(a.instance=this.resolve(a.provider.useToken,b)):this.resolve(a.provider.useToken,b):hP(a.provider)?f?a.instance||(a.instance=this.construct(a.provider.useClass,b)):this.construct(a.provider.useClass,b):hQ(a.provider)?a.provider.useFactory(this):this.construct(a.provider,b),a.options.lifecycle===hJ.ResolutionScoped&&b.scopedResolutions.set(a,c),c},a.prototype.resolveAll=function(a,b,c){var d=this;void 0===b&&(b=new hY),void 0===c&&(c=!1),this.ensureNotDisposed();var e=this.getAllRegistrations(a);if(!e&&hS(a)){if(c)return[];throw Error('Attempted to resolve unregistered dependency token: "'+a.toString()+'"')}if(this.executePreResolutionInterceptor(a,"All"),e){var f=e.map(function(a){return d.resolveRegistration(a,b)});return this.executePostResolutionInterceptor(a,f,"All"),f}var g=[this.construct(a,b)];return this.executePostResolutionInterceptor(a,g,"All"),g},a.prototype.isRegistered=function(a,b){return void 0===b&&(b=!1),this.ensureNotDisposed(),this._registry.has(a)||b&&(this.parent||!1)&&this.parent.isRegistered(a,!0)},a.prototype.reset=function(){this.ensureNotDisposed(),this._registry.clear(),this.interceptors.preResolution.clear(),this.interceptors.postResolution.clear()},a.prototype.clearInstances=function(){var a,b;this.ensureNotDisposed();try{for(var c=hM(this._registry.entries()),d=c.next();!d.done;d=c.next()){var e=hN(d.value,2),f=e[0],g=e[1];this._registry.setAll(f,g.filter(function(a){return!hV(a.provider)}).map(function(a){return a.instance=void 0,a}))}}catch(b){a={error:b}}finally{try{d&&!d.done&&(b=c.return)&&b.call(c)}finally{if(a)throw a.error}}},a.prototype.createChildContainer=function(){this.ensureNotDisposed();var b,c,d=new a(this);try{for(var e=hM(this._registry.entries()),f=e.next();!f.done;f=e.next()){var g=hN(f.value,2),h=g[0],i=g[1];i.some(function(a){return a.options.lifecycle===hJ.ContainerScoped})&&d._registry.setAll(h,i.map(function(a){return a.options.lifecycle===hJ.ContainerScoped?{provider:a.provider,options:a.options}:a}))}}catch(a){b={error:a}}finally{try{f&&!f.done&&(c=e.return)&&c.call(e)}finally{if(b)throw b.error}}return d},a.prototype.beforeResolution=function(a,b,c){void 0===c&&(c={frequency:"Always"}),this.interceptors.preResolution.set(a,{callback:b,options:c})},a.prototype.afterResolution=function(a,b,c){void 0===c&&(c={frequency:"Always"}),this.interceptors.postResolution.set(a,{callback:b,options:c})},a.prototype.dispose=function(){var a,b,c,d;return a=this,b=void 0,c=void 0,d=function(){var a;return function(a,b){var c,d,e,f,g={label:0,sent:function(){if(1&e[0])throw e[1];return e[1]},trys:[],ops:[]};return f={next:h(0),throw:h(1),return:h(2)},"function"==typeof Symbol&&(f[Symbol.iterator]=function(){return this}),f;function h(f){return function(h){var i=[f,h];if(c)throw TypeError("Generator is already executing.");for(;g;)try{if(c=1,d&&(e=2&i[0]?d.return:i[0]?d.throw||((e=d.return)&&e.call(d),0):d.next)&&!(e=e.call(d,i[1])).done)return e;switch(d=0,e&&(i=[2&i[0],e.value]),i[0]){case 0:case 1:e=i;break;case 4:return g.label++,{value:i[1],done:!1};case 5:g.label++,d=i[1],i=[0];continue;case 7:i=g.ops.pop(),g.trys.pop();continue;default:if(!(e=(e=g.trys).length>0&&e[e.length-1])&&(6===i[0]||2===i[0])){g=0;continue}if(3===i[0]&&(!e||i[1]>e[0]&&i[1]<e[3])){g.label=i[1];break}if(6===i[0]&&g.label<e[1]){g.label=e[1],e=i;break}if(e&&g.label<e[2]){g.label=e[2],g.ops.push(i);break}e[2]&&g.ops.pop(),g.trys.pop();continue}i=b.call(a,g)}catch(a){i=[6,a],d=0}finally{c=e=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}}}(this,function(b){switch(b.label){case 0:return this.disposed=!0,a=[],this.disposables.forEach(function(b){var c=b.dispose();c&&a.push(c)}),[4,Promise.all(a)];case 1:return b.sent(),[2]}})},new(c||(c=Promise))(function(e,f){function g(a){try{i(d.next(a))}catch(a){f(a)}}function h(a){try{i(d.throw(a))}catch(a){f(a)}}function i(a){var b;a.done?e(a.value):((b=a.value)instanceof c?b:new c(function(a){a(b)})).then(g,h)}i((d=d.apply(a,b||[])).next())})},a.prototype.getRegistration=function(a){return this.isRegistered(a)?this._registry.get(a):this.parent?this.parent.getRegistration(a):null},a.prototype.getAllRegistrations=function(a){return this.isRegistered(a)?this._registry.getAll(a):this.parent?this.parent.getAllRegistrations(a):null},a.prototype.construct=function(a,b){var c=this;if(a instanceof hR)return a.createProxy(function(a){return c.resolve(a,b)});var d=function(){var d=h0.get(a);if(!d||0===d.length)if(0===a.length)return new a;else throw Error('TypeInfo not known for "'+a.name+'"');var e=d.map(c.resolveParams(b,a));return new(a.bind.apply(a,hO([void 0],e)))}();return"function"!=typeof d.dispose||d.dispose.length>0||this.disposables.add(d),d},a.prototype.resolveParams=function(a,b){var c=this;return function(d,e){var f,g,h,i,j,k,l;try{if("object"==typeof d&&"token"in d&&"multiple"in d)if(hT(d))return d.multiple?(f=c.resolve(d.transform)).transform.apply(f,hO([c.resolveAll(d.token,new hY,d.isOptional)],d.transformArgs)):(g=c.resolve(d.transform)).transform.apply(g,hO([c.resolve(d.token,a,d.isOptional)],d.transformArgs));else return d.multiple?c.resolveAll(d.token,new hY,d.isOptional):c.resolve(d.token,a,d.isOptional);if(hT(d))return(h=c.resolve(d.transform,a)).transform.apply(h,hO([c.resolve(d.token,a)],d.transformArgs));return c.resolve(d,a)}catch(a){throw Error((k="Cannot inject the dependency "+(j=void 0===(i=hN(b.toString().match(/constructor\(([\w, ]+)\)/)||[],2)[1])?null:i,null===j?"at position #"+e:'"'+j.split(",")[e].trim()+'" at position #'+e)+' of "'+b.name+'" constructor. Reason:',void 0===l&&(l=" "),hO([k],a.message.split("\n").map(function(a){return l+a})).join("\n")))}}},a.prototype.ensureNotDisposed=function(){if(this.disposed)throw Error("This container has been disposed, you cannot interact with a disposed container")},a}());let h2=function(a){return function(b){var c,d;h0.set(b,(c=Reflect.getMetadata("design:paramtypes",b)||[],Object.keys(d=Reflect.getOwnMetadata("injectionTokens",b)||{}).forEach(function(a){c[+a]=d[a]}),c)),a&&a.token&&(Array.isArray(a.token)?a.token.forEach(function(a){h1.register(a,b)}):h1.register(a.token,b))}};if("u"<typeof Reflect||!Reflect.getMetadata)throw Error("tsyringe requires a reflect polyfill. Please add 'import \"reflect-metadata\"' to the top of your entry point.");class h3{attrId="";attrValues=[];constructor(a={}){Object.assign(a)}}ek([ee({type:K.ObjectIdentifier})],h3.prototype,"attrId",void 0),ek([ee({type:K.Any,repeated:"set"})],h3.prototype,"attrValues",void 0);let h4=aw=class extends ei{constructor(a){super(a),Object.setPrototypeOf(this,aw.prototype)}};h4=aw=ek([ed({type:J.Sequence,itemType:h3})],h4);let h5=ax=class extends ei{constructor(a){super(a),Object.setPrototypeOf(this,ax.prototype)}};h5=ax=ek([ed({type:J.Sequence,itemType:gs})],h5);class h6{certId="";certValue=new ArrayBuffer(0);constructor(a={}){Object.assign(this,a)}}ek([ee({type:K.ObjectIdentifier})],h6.prototype,"certId",void 0),ek([ee({type:K.Any,context:0})],h6.prototype,"certValue",void 0);class h7{crlId="";crltValue=new ArrayBuffer(0);constructor(a={}){Object.assign(this,a)}}ek([ee({type:K.ObjectIdentifier})],h7.prototype,"crlId",void 0),ek([ee({type:K.Any,context:0})],h7.prototype,"crltValue",void 0);class h8 extends dM{}class h9{encryptionAlgorithm=new fE;encryptedData=new h8;constructor(a={}){Object.assign(this,a)}}ek([ee({type:fE})],h9.prototype,"encryptionAlgorithm",void 0),ek([ee({type:h8})],h9.prototype,"encryptedData",void 0),(v=az||(az={}))[v.v1=0]="v1";class ia extends dM{}let ib=ay=class extends ei{constructor(a){super(a),Object.setPrototypeOf(this,ay.prototype)}};ib=ay=ek([ed({type:J.Sequence,itemType:fw})],ib);class ic{version=az.v1;privateKeyAlgorithm=new fE;privateKey=new ia;attributes;constructor(a={}){Object.assign(this,a)}}ek([ee({type:K.Integer})],ic.prototype,"version",void 0),ek([ee({type:fE})],ic.prototype,"privateKeyAlgorithm",void 0),ek([ee({type:ia})],ic.prototype,"privateKey",void 0),ek([ee({type:ib,implicit:!0,context:0,optional:!0})],ic.prototype,"attributes",void 0);let id=class extends ic{};id=ek([ed({type:J.Sequence})],id);let ie=class extends h9{};ie=ek([ed({type:J.Sequence})],ie);class ig{secretTypeId="";secretValue=new ArrayBuffer(0);constructor(a={}){Object.assign(this,a)}}ek([ee({type:K.ObjectIdentifier})],ig.prototype,"secretTypeId",void 0),ek([ee({type:K.Any,context:0})],ig.prototype,"secretValue",void 0);class ih{mac=new hE;macSalt=new dM;iterations=1;constructor(a={}){Object.assign(this,a)}}ek([ee({type:hE})],ih.prototype,"mac",void 0),ek([ee({type:dM})],ih.prototype,"macSalt",void 0),ek([ee({type:K.Integer,defaultValue:1})],ih.prototype,"iterations",void 0);class ii{version=3;authSafe=new gs;macData=new ih;constructor(a={}){Object.assign(this,a)}}ek([ee({type:K.Integer})],ii.prototype,"version",void 0),ek([ee({type:gs})],ii.prototype,"authSafe",void 0),ek([ee({type:ih,optional:!0})],ii.prototype,"macData",void 0);class ij{bagId="";bagValue=new ArrayBuffer(0);bagAttributes;constructor(a={}){Object.assign(this,a)}}ek([ee({type:K.ObjectIdentifier})],ij.prototype,"bagId",void 0),ek([ee({type:K.Any,context:0})],ij.prototype,"bagValue",void 0),ek([ee({type:h3,repeated:"set",optional:!0})],ij.prototype,"bagAttributes",void 0);let ik=aA=class extends ei{constructor(a){super(a),Object.setPrototypeOf(this,aA.prototype)}};ik=aA=ek([ed({type:J.Sequence,itemType:ij})],ik);let il="1.2.840.113549.1.9",im=`${il}.7`,io=`${il}.14`,ip=class extends eq{ia5String;constructor(a={}){super(a)}toString(){return({}).toString(),this.ia5String||super.toString()}};ek([ee({type:K.IA5String})],ip.prototype,"ia5String",void 0),ip=ek([ed({type:J.Choice})],ip);let iq=class extends gs{};iq=ek([ed({type:J.Sequence})],iq);let ir=class extends ii{};ir=ek([ed({type:J.Sequence})],ir);let is=class extends h9{};is=ek([ed({type:J.Sequence})],is);let it=class{value;constructor(a=""){this.value=a}toString(){return this.value}};ek([ee({type:K.IA5String})],it.prototype,"value",void 0),it=ek([ed({type:J.Choice})],it);let iu=class extends ip{};iu=ek([ed({type:J.Choice})],iu);let iv=class extends eq{};iv=ek([ed({type:J.Choice})],iv);let iw=class{value;constructor(a=new Date){this.value=a}};ek([ee({type:K.GeneralizedTime})],iw.prototype,"value",void 0),iw=ek([ed({type:J.Choice})],iw);let ix=class extends eq{};ix=ek([ed({type:J.Choice})],ix);let iy=class{value;constructor(a="M"){this.value=a}toString(){return this.value}};ek([ee({type:K.PrintableString})],iy.prototype,"value",void 0),iy=ek([ed({type:J.Choice})],iy);let iz=class{value;constructor(a=""){this.value=a}toString(){return this.value}};ek([ee({type:K.PrintableString})],iz.prototype,"value",void 0),iz=ek([ed({type:J.Choice})],iz);let iA=class extends iz{};iA=ek([ed({type:J.Choice})],iA);let iB=class extends eq{};iB=ek([ed({type:J.Choice})],iB);let iC=class{value;constructor(a=""){this.value=a}toString(){return this.value}};ek([ee({type:K.ObjectIdentifier})],iC.prototype,"value",void 0),iC=ek([ed({type:J.Choice})],iC);let iD=class extends fG{};iD=ek([ed({type:J.Choice})],iD);let iE=class{value;constructor(a=0){this.value=a}toString(){return this.value.toString()}};ek([ee({type:K.Integer})],iE.prototype,"value",void 0),iE=ek([ed({type:J.Choice})],iE);let iF=class extends f_{};iF=ek([ed({type:J.Sequence})],iF);let iG=class extends eq{};iG=ek([ed({type:J.Choice})],iG);let iH=aB=class extends fJ{constructor(a){super(a),Object.setPrototypeOf(this,aB.prototype)}};iH=aB=ek([ed({type:J.Sequence})],iH);let iI=aC=class extends ei{constructor(a){super(a),Object.setPrototypeOf(this,aC.prototype)}};iI=aC=ek([ed({type:J.Set,itemType:f$})],iI);let iJ=class{value;constructor(a=""){this.value=a}toString(){return this.value}};ek([ee({type:K.BmpString})],iJ.prototype,"value",void 0),iJ=ek([ed({type:J.Choice})],iJ);let iK=class extends fE{};iK=ek([ed({type:J.Sequence})],iK);let iL=aD=class extends ei{constructor(a){super(a),Object.setPrototypeOf(this,aD.prototype)}};iL=aD=ek([ed({type:J.Sequence,itemType:iK})],iL);let iM=aE=class extends ei{constructor(a){super(a),Object.setPrototypeOf(this,aE.prototype)}};iM=aE=ek([ed({type:J.Sequence,itemType:fw})],iM);class iN{version=0;subject=new ev;subjectPKInfo=new fF;attributes=new iM;constructor(a={}){Object.assign(this,a)}}ek([ee({type:K.Integer})],iN.prototype,"version",void 0),ek([ee({type:ev})],iN.prototype,"subject",void 0),ek([ee({type:fF})],iN.prototype,"subjectPKInfo",void 0),ek([ee({type:iM,implicit:!0,context:0,optional:!0})],iN.prototype,"attributes",void 0);class iO{certificationRequestInfo=new iN;certificationRequestInfoRaw;signatureAlgorithm=new fE;signature=new ArrayBuffer(0);constructor(a={}){Object.assign(this,a)}}ek([ee({type:iN,raw:!0})],iO.prototype,"certificationRequestInfo",void 0),ek([ee({type:fE})],iO.prototype,"signatureAlgorithm",void 0),ek([ee({type:K.BitString})],iO.prototype,"signature",void 0);let iP="crypto.algorithm";class iQ{getAlgorithms(){return h1.resolveAll(iP)}toAsnAlgorithm(a){for(let b of({...a},this.getAlgorithms())){let c=b.toAsnAlgorithm(a);if(c)return c}if(/^[0-9.]+$/.test(a.name)){let b=new fE({algorithm:a.name});return"parameters"in a&&(b.parameters=a.parameters),b}throw Error("Cannot convert WebCrypto algorithm to ASN.1 algorithm")}toWebAlgorithm(a){for(let b of this.getAlgorithms()){let c=b.toWebAlgorithm(a);if(c)return c}return{name:a.algorithm,parameters:a.parameters}}}let iR="crypto.algorithmProvider";h1.registerSingleton(iR,iQ);let iS="1.3.36.3.3.2.8.1.1",iT=`${iS}.1`,iU=`${iS}.2`,iV=`${iS}.3`,iW=`${iS}.4`,iX=`${iS}.5`,iY=`${iS}.6`,iZ=`${iS}.7`,i$=`${iS}.8`,i_=`${iS}.9`,i0=`${iS}.10`,i1=`${iS}.11`,i2=`${iS}.12`,i3=`${iS}.13`,i4=`${iS}.14`,i5="brainpoolP160r1",i6="brainpoolP160t1",i7="brainpoolP192r1",i8="brainpoolP192t1",i9="brainpoolP224r1",ja="brainpoolP224t1",jb="brainpoolP256r1",jc="brainpoolP256t1",jd="brainpoolP320r1",je="brainpoolP320t1",jf="brainpoolP384r1",jg="brainpoolP384t1",jh="brainpoolP512r1",ji="brainpoolP512t1",jj="ECDSA",jk=aF=class{toAsnAlgorithm(a){if(a.name.toLowerCase()===jj.toLowerCase()){if("hash"in a)switch(("string"==typeof a.hash?a.hash:a.hash.name).toLowerCase()){case"sha-1":return g3;case"sha-256":return g4;case"sha-384":return g5;case"sha-512":return g6}else if("namedCurve"in a){let b="";switch(a.namedCurve){case"P-256":b=g_;break;case"K-256":b=aF.SECP256K1;break;case"P-384":b=g0;break;case"P-521":b=g1;break;case i5:b=iT;break;case i6:b=iU;break;case i7:b=iV;break;case i8:b=iW;break;case i9:b=iX;break;case ja:b=iY;break;case jb:b=iZ;break;case jc:b=i$;break;case jd:b=i_;break;case je:b=i0;break;case jf:b=i1;break;case jg:b=i2;break;case jh:b=i3;break;case ji:b=i4}if(b)return new fE({algorithm:gV,parameters:ej.serialize(new hb({namedCurve:b}))})}}return null}toWebAlgorithm(a){switch(a.algorithm){case gW:return{name:jj,hash:{name:"SHA-1"}};case gY:return{name:jj,hash:{name:"SHA-256"}};case gZ:return{name:jj,hash:{name:"SHA-384"}};case g$:return{name:jj,hash:{name:"SHA-512"}};case gV:if(!a.parameters)throw TypeError("Cannot get required parameters from EC algorithm");switch(ej.parse(a.parameters,hb).namedCurve){case g_:return{name:jj,namedCurve:"P-256"};case aF.SECP256K1:return{name:jj,namedCurve:"K-256"};case g0:return{name:jj,namedCurve:"P-384"};case g1:return{name:jj,namedCurve:"P-521"};case iT:return{name:jj,namedCurve:i5};case iU:return{name:jj,namedCurve:i6};case iV:return{name:jj,namedCurve:i7};case iW:return{name:jj,namedCurve:i8};case iX:return{name:jj,namedCurve:i9};case iY:return{name:jj,namedCurve:ja};case iZ:return{name:jj,namedCurve:jb};case i$:return{name:jj,namedCurve:jc};case i_:return{name:jj,namedCurve:jd};case i0:return{name:jj,namedCurve:je};case i1:return{name:jj,namedCurve:jf};case i2:return{name:jj,namedCurve:jg};case i3:return{name:jj,namedCurve:jh};case i4:return{name:jj,namedCurve:ji}}}return null}};jk.SECP256K1="1.3.132.0.10",jk=aF=ek([h2()],jk),h1.registerSingleton(iP,jk);let jl=Symbol("name"),jm=Symbol("value");class jn{constructor(a,b={},c=""){for(const d in this[jl]=a,this[jm]=c,b)this[d]=b[d]}}jn.NAME=jl,jn.VALUE=jm;class jo{static toTextObject(a){let b=new jn("Algorithm Identifier",{},jp.toString(a.algorithm));if(a.parameters)if(a.algorithm===gV){let c=new jk().toWebAlgorithm(a);c&&"namedCurve"in c?b["Named Curve"]=c.namedCurve:b.Parameters=a.parameters}else b.Parameters=a.parameters;return b}}class jp{static toString(a){let b=this.items[a];return b||a}}jp.items={[hs]:"sha1",[ht]:"sha224",[hu]:"sha256",[hv]:"sha384",[hw]:"sha512",[hf]:"rsaEncryption",[hl]:"sha1WithRSAEncryption",[hm]:"sha224WithRSAEncryption",[hn]:"sha256WithRSAEncryption",[ho]:"sha384WithRSAEncryption",[hp]:"sha512WithRSAEncryption",[gV]:"ecPublicKey",[gW]:"ecdsaWithSHA1",[gX]:"ecdsaWithSHA224",[gY]:"ecdsaWithSHA256",[gZ]:"ecdsaWithSHA384",[g$]:"ecdsaWithSHA512",[fb]:"TLS WWW server authentication",[fc]:"TLS WWW client authentication",[fd]:"Code Signing",[fe]:"E-mail Protection",[ff]:"Time Stamping",[fg]:"OCSP Signing","1.2.840.113549.1.7.2":"Signed Data"};class jq{static serialize(a){return this.serializeObj(a).join("\n")}static pad(a=0){return"".padStart(2*a," ")}static serializeObj(a,b=0){let c=[],d=this.pad(b++),e="",f=a[jn.VALUE];for(let g in f&&(e=` ${f}`),c.push(`${d}${a[jn.NAME]}:${e}`),d=this.pad(b),a){if("symbol"==typeof g)continue;let e=a[g],f=g?`${g}: `:"";if("string"==typeof e||"number"==typeof e||"boolean"==typeof e)c.push(`${d}${f}${e}`);else if(e instanceof Date)c.push(`${d}${f}${e.toUTCString()}`);else if(Array.isArray(e))for(let a of e)a[jn.NAME]=g,c.push(...this.serializeObj(a,b));else if(e instanceof jn)e[jn.NAME]=g,c.push(...this.serializeObj(e,b));else if(b6.isBufferSource(e))g?(c.push(`${d}${f}`),c.push(...this.serializeBufferSource(e,b+1))):c.push(...this.serializeBufferSource(e,b));else if("toTextObject"in e){let a=e.toTextObject();a[jn.NAME]=g,c.push(...this.serializeObj(a,b))}else throw TypeError("Cannot serialize data in text format. Unsupported type.")}return c}static serializeBufferSource(a,b=0){let c=this.pad(b),d=b6.toUint8Array(a),e=[];for(let a=0;a<d.length;){let b=[];for(let c=0;c<16&&a<d.length;c++){8===c&&b.push("");let e=d[a++].toString(16).padStart(2,"0");b.push(e)}e.push(`${c}${b.join(" ")}`)}return e}static serializeAlgorithm(a){return this.algorithmSerializer.toTextObject(a)}}jq.oidSerializer=jp,jq.algorithmSerializer=jo;class jr{get rawData(){return el(this,aG,"f")||em(this,aG,ej.serialize(this.asn),"f"),el(this,aG,"f")}constructor(...a){aG.set(this,void 0),b6.isBufferSource(a[0])?(this.asn=ej.parse(a[0],a[1]),em(this,aG,b6.toArrayBuffer(a[0]),"f")):this.asn=a[0],this.onInit(this.asn)}equal(a){return a instanceof jr&&function(a,b){if(!(a&&b)||a.byteLength!==b.byteLength)return!1;let c=new Uint8Array(a),d=new Uint8Array(b);for(let b=0;b<a.byteLength;b++)if(c[b]!==d[b])return!1;return!0}(a.rawData,this.rawData)}toString(a="text"){switch(a){case"asn":return ej.toString(this.rawData);case"text":return jq.serialize(this.toTextObject());case"hex":return cd.ToHex(this.rawData);case"base64":return cd.ToBase64(this.rawData);case"base64url":return cd.ToBase64Url(this.rawData);default:throw TypeError("Argument 'format' is unsupported value")}}getTextName(){return this.constructor.NAME}toTextObject(){let a=this.toTextObjectEmpty();return a[""]=this.rawData,a}toTextObjectEmpty(a){return new jn(this.getTextName(),{},a)}}aG=new WeakMap,jr.NAME="ASN";class js extends jr{constructor(...a){super(b6.isBufferSource(a[0])?b6.toArrayBuffer(a[0]):ej.serialize(new fI({extnID:a[0],critical:a[1],extnValue:new dM(b6.toArrayBuffer(a[2]))})),fI)}onInit(a){this.type=a.extnID,this.critical=a.critical,this.value=a.extnValue.buffer}toTextObject(){let a=this.toTextObjectWithoutValue();return a[""]=this.value,a}toTextObjectWithoutValue(){let a=this.toTextObjectEmpty(this.critical?"critical":void 0);return a[jn.NAME]===js.NAME&&(a[jn.NAME]=jp.toString(this.type)),a}}class jt{static isCryptoKeyPair(a){return a&&a.privateKey&&a.publicKey}static isCryptoKey(a){return a&&a.usages&&a.type&&a.algorithm&&void 0!==a.extractable}constructor(){this.items=new Map,this[aH]="CryptoProvider","u">typeof self&&"u">typeof crypto?this.set(jt.DEFAULT,crypto):"u">typeof global&&global.crypto&&global.crypto.subtle&&this.set(jt.DEFAULT,global.crypto)}clear(){this.items.clear()}delete(a){return this.items.delete(a)}forEach(a,b){return this.items.forEach(a,b)}has(a){return this.items.has(a)}get size(){return this.items.size}entries(){return this.items.entries()}keys(){return this.items.keys()}values(){return this.items.values()}[Symbol.iterator](){return this.items[Symbol.iterator]()}get(a=jt.DEFAULT){let b=this.items.get(a.toLowerCase());if(!b)throw Error(`Cannot get Crypto by name '${a}'`);return b}set(a,b){if("string"==typeof a){if(!b)throw TypeError("Argument 'value' is required");this.items.set(a.toLowerCase(),b)}else this.items.set(jt.DEFAULT,a);return this}}aH=Symbol.toStringTag,jt.DEFAULT="default";let ju=new jt,jv=/^[0-2](?:\.[1-9][0-9]*)+$/;class jw{constructor(a={}){for(const b in this.items={},a)this.register(b,a[b])}get(a){return this.items[a]||null}findId(a){return new RegExp(jv).test(a)?a:this.get(a)}register(a,b){this.items[a]=b,this.items[b]=a}}let jx=new jw;function jy(a,b){return`\\${cd.ToHex(cd.FromUtf8String(b)).toUpperCase()}`}jx.register("CN","2.5.4.3"),jx.register("L","2.5.4.7"),jx.register("ST","2.5.4.8"),jx.register("O","2.5.4.10"),jx.register("OU","2.5.4.11"),jx.register("C","2.5.4.6"),jx.register("DC","0.9.2342.19200300.100.1.25"),jx.register("E","1.2.840.113549.1.9.1"),jx.register("G","2.5.4.42"),jx.register("I","2.5.4.43"),jx.register("SN","2.5.4.4"),jx.register("T","2.5.4.12");class jz{static isASCII(a){for(let b=0;b<a.length;b++)if(a.charCodeAt(b)>255)return!1;return!0}static isPrintableString(a){return/^[A-Za-z0-9 '()+,-./:=?]*$/g.test(a)}constructor(a,b={}){for(const a in this.extraNames=new jw,this.asn=new ev,b)if(Object.prototype.hasOwnProperty.call(b,a)){const c=b[a];this.extraNames.register(a,c)}"string"==typeof a?this.asn=this.fromString(a):a instanceof ev?this.asn=a:b6.isBufferSource(a)?this.asn=ej.parse(a,ev):this.asn=this.fromJSON(a)}getField(a){let b=this.extraNames.findId(a)||jx.findId(a),c=[];for(let a of this.asn)for(let d of a)d.type===b&&c.push(d.value.toString());return c}getName(a){return this.extraNames.get(a)||jx.get(a)}toString(){return this.asn.map(a=>a.map(a=>{let b=this.getName(a.type)||a.type,c=a.value.anyValue?`#${cd.ToHex(a.value.anyValue)}`:a.value.toString().replace(/([,+"\\<>;])/g,"\\$1").replace(/^([ #])/,"\\$1").replace(/([ ]$)/,"\\$1").replace(/([\r\n\t])/,jy);return`${b}=${c}`}).join("+")).join(", ")}toJSON(){let a=[];for(let b of this.asn){let c={};for(let a of b){let b=this.getName(a.type)||a.type;null!=c[b]||(c[b]=[]),c[b].push(a.value.anyValue?`#${cd.ToHex(a.value.anyValue)}`:a.value.toString())}a.push(c)}return a}fromString(a){let b=new ev,c=/(\d\.[\d.]*\d|[A-Za-z]+)=((?:"")|(?:".*?[^\\]")|(?:[^,+"\\](?=[,+]|$))|(?:[^,+].*?(?:[^\\][,+]))|(?:))([,+])?/g,d=null,e=",";for(;d=c.exec(`${a},`);){let[,a,c]=d,f=c[c.length-1];(","===f||"+"===f)&&(c=c.slice(0,c.length-1),d[3]=f);let g=d[3];a=this.getTypeOid(a);let h=this.createAttribute(a,c);"+"===e?b[b.length-1].push(h):b.push(new et([h])),e=g}return b}fromJSON(a){let b=new ev;for(let c of a){let a=new et;for(let b in c){let d=this.getTypeOid(b);for(let e of c[b]){let b=this.createAttribute(d,e);a.push(b)}}b.push(a)}return b}getTypeOid(a){if(/[\d.]+/.test(a)||(a=this.getName(a)||""),!a)throw Error(`Cannot get OID for name type '${a}'`);return a}createAttribute(a,b){let c=new es({type:a});if("object"==typeof b)for(let a in b)switch(a){case"ia5String":c.value.ia5String=b[a];break;case"utf8String":c.value.utf8String=b[a];break;case"universalString":c.value.universalString=b[a];break;case"bmpString":c.value.bmpString=b[a];break;case"printableString":c.value.printableString=b[a]}else if("#"===b[0])c.value.anyValue=cd.FromHex(b.slice(1));else{let d=this.processStringValue(b);a===this.getName("E")||a===this.getName("DC")?c.value.ia5String=d:jz.isPrintableString(d)?c.value.printableString=d:c.value.utf8String=d}return c}processStringValue(a){let b=/"(.*?[^\\])?"/.exec(a);return b&&(a=b[1]),a.replace(/\\0a/ig,"\n").replace(/\\0d/ig,"\r").replace(/\\0g/ig," ").replace(/\\(.)/g,"$1")}toArrayBuffer(){return ej.serialize(this.asn)}async getThumbprint(...a){var b;let c,d="SHA-1";return!(a.length>=1)||(null==(b=a[0])?void 0:b.subtle)?c=a[0]||ju.get():(d=a[0]||d,c=a[1]||ju.get()),await c.subtle.digest(d,this.toArrayBuffer())}}let jA="Cannot initialize GeneralName from ASN.1 data.",jB=`${jA} Unsupported string format in use.`,jC=`${jA} Value doesn't match to GUID regular expression.`,jD=/^([0-9a-f]{8})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{12})$/i,jE="1.3.6.1.4.1.311.25.1",jF="1.3.6.1.4.1.311.20.2.3",jG="email",jH="guid";class jI extends jr{constructor(...a){let b;if(2===a.length)switch(a[0]){case"dn":{const c=new jz(a[1]).toArrayBuffer(),d=ej.parse(c,ev);b=new ey({directoryName:d});break}case"dns":b=new ey({dNSName:a[1]});break;case jG:b=new ey({rfc822Name:a[1]});break;case jH:{const c=RegExp(jD,"i").exec(a[1]);if(!c)throw Error("Cannot parse GUID value. Value doesn't match to regular expression");const d=c.slice(1).map((a,b)=>b<3?cd.ToHex(new Uint8Array(cd.FromHex(a)).reverse()):a).join("");b=new ey({otherName:new ew({typeId:jE,value:ej.serialize(new dM(cd.FromHex(d)))})});break}case"ip":b=new ey({iPAddress:a[1]});break;case"id":b=new ey({registeredID:a[1]});break;case"upn":b=new ey({otherName:new ew({typeId:jF,value:ej.serialize(dW.toASN(a[1]))})});break;case"url":b=new ey({uniformResourceIdentifier:a[1]});break;default:throw Error("Cannot create GeneralName. Unsupported type of the name")}else b=b6.isBufferSource(a[0])?ej.parse(a[0],ey):a[0];super(b)}onInit(a){if(void 0!=a.dNSName)this.type="dns",this.value=a.dNSName;else if(void 0!=a.rfc822Name)this.type=jG,this.value=a.rfc822Name;else if(void 0!=a.iPAddress)this.type="ip",this.value=a.iPAddress;else if(void 0!=a.uniformResourceIdentifier)this.type="url",this.value=a.uniformResourceIdentifier;else if(void 0!=a.registeredID)this.type="id",this.value=a.registeredID;else if(void 0!=a.directoryName)this.type="dn",this.value=new jz(a.directoryName).toString();else if(void 0!=a.otherName)if(a.otherName.typeId===jE){this.type=jH;let b=ej.parse(a.otherName.value,dM),c=RegExp(jD,"i").exec(cd.ToHex(b));if(!c)throw Error(jC);this.value=c.slice(1).map((a,b)=>b<3?cd.ToHex(new Uint8Array(cd.FromHex(a)).reverse()):a).join("-")}else if(a.otherName.typeId===jF)this.type="upn",this.value=ej.parse(a.otherName.value,eq).toString();else throw Error(jB);else throw Error(jB)}toJSON(){return{type:this.type,value:this.value}}toTextObject(){let a;switch(this.type){case"dn":case"dns":case jH:case"ip":case"id":case"upn":case"url":a=this.type.toUpperCase();break;case jG:a="Email";break;default:throw Error("Unsupported GeneralName type")}let b=this.value;return"id"===this.type&&(b=jp.toString(b)),new jn(a,void 0,b)}}class jJ extends jr{constructor(a){let b;if(a instanceof eQ)b=a;else if(Array.isArray(a)){const c=[];for(const b of a)if(b instanceof ey)c.push(b);else{const a=ej.parse(new jI(b.type,b.value).rawData,ey);c.push(a)}b=new eQ(c)}else if(b6.isBufferSource(a))b=ej.parse(a,eQ);else throw Error("Cannot initialize GeneralNames. Incorrect incoming arguments");super(b)}onInit(a){let b=[];for(let c of a){let a=null;try{a=new jI(c)}catch{continue}b.push(a)}this.items=b}toJSON(){return this.items.map(a=>a.toJSON())}toTextObject(){let a=super.toTextObjectEmpty();for(let b of this.items){let c=b.toTextObject(),d=a[c[jn.NAME]];Array.isArray(d)||(d=[],a[c[jn.NAME]]=d),d.push(c)}return a}}jJ.NAME="GeneralNames";let jK="-{5}",jL=`${jK}BEGIN ([^\\n]+(?=${jK}))${jK}`,jM=`${jK}END \\1${jK}`,jN=`${jL}\\n(?:((?:[^:\\n]+: (?:[^\\n]+\\n(?: +[^\\n]+\\n)*))+))?\\n?((?:[a-zA-Z0-9=+/]+\\n)+)${jM}`;class jO{static isPem(a){return"string"==typeof a&&RegExp(jN,"g").test(a.replace(/\r/g,""))}static decodeWithHeaders(a){a=a.replace(/\r/g,"");let b=RegExp(jN,"g"),c=[],d=null;for(;d=b.exec(a);){let a=d[3].replace(RegExp("[\\n]+","g"),""),b={type:d[1],headers:[],rawData:cd.FromBase64(a)},e=d[2];if(e){let a=e.split(RegExp("\\n","g")),c=null;for(let d of a){let[a,e]=d.split(/:(.*)/);if(void 0===e){if(!c)throw Error("Cannot parse PEM string. Incorrect header value");c.value+=a.trim()}else c&&b.headers.push(c),c={key:a,value:e.trim()}}c&&b.headers.push(c)}c.push(b)}return c}static decode(a){return this.decodeWithHeaders(a).map(a=>a.rawData)}static decodeFirst(a){let b=this.decode(a);if(!b.length)throw RangeError("PEM string doesn't contain any objects");return b[0]}static encode(a,b){if(Array.isArray(a)){let c=[];return b?a.forEach(a=>{if(!b6.isBufferSource(a))throw TypeError("Cannot encode array of BufferSource in PEM format. Not all items of the array are BufferSource");c.push(this.encodeStruct({type:b,rawData:b6.toArrayBuffer(a)}))}):a.forEach(a=>{if(!("type"in a))throw TypeError("Cannot encode array of PemStruct in PEM format. Not all items of the array are PemStrut");c.push(this.encodeStruct(a))}),c.join("\n")}if(!b)throw Error("Required argument 'tag' is missed");return this.encodeStruct({type:b,rawData:b6.toArrayBuffer(a)})}static encodeStruct(a){var b;let c,d=a.type.toLocaleUpperCase(),e=[];if(e.push(`-----BEGIN ${d}-----`),null==(b=a.headers)?void 0:b.length){for(let b of a.headers)e.push(`${b.key}: ${b.value}`);e.push("")}let f=cd.ToBase64(a.rawData),g=0,h=[];for(;g<f.length;)if(f.length-g<64?c=f.substring(g):(c=f.substring(g,g+64),g+=64),0!==c.length){if(h.push(c),c.length<64)break}else break;return e.push(...h),e.push(`-----END ${d}-----`),e.join("\n")}}jO.CertificateTag="CERTIFICATE",jO.CrlTag="CRL",jO.CertificateRequestTag="CERTIFICATE REQUEST",jO.PublicKeyTag="PUBLIC KEY",jO.PrivateKeyTag="PRIVATE KEY";class jP extends jr{static isAsnEncoded(a){return b6.isBufferSource(a)||"string"==typeof a}static toArrayBuffer(a){if("string"==typeof a)if(jO.isPem(a))return jO.decode(a)[0];else if(cd.isHex(a))return cd.FromHex(a);else if(cd.isBase64(a))return cd.FromBase64(a);else if(cd.isBase64Url(a))return cd.FromBase64Url(a);else throw TypeError("Unsupported format of 'raw' argument. Must be one of DER, PEM, HEX, Base64, or Base4Url");{let b=b6.toUint8Array(a);if(b.length>0&&48===b[0])return b6.toArrayBuffer(a);let c=cd.ToBinary(a);if(jO.isPem(c))return jO.decode(c)[0];if(cd.isHex(c))return cd.FromHex(c);if(cd.isBase64(c))return cd.FromBase64(c);else if(cd.isBase64Url(c))return cd.FromBase64Url(c);throw TypeError("Unsupported format of 'raw' argument. Must be one of DER, PEM, HEX, Base64, or Base4Url")}}constructor(...a){jP.isAsnEncoded(a[0])?super(jP.toArrayBuffer(a[0]),a[1]):super(a[0])}toString(a="pem"){return"pem"===a?jO.encode(this.rawData,this.tag):super.toString(a)}}class jQ extends jP{static async create(a,b=ju.get()){if(a instanceof jQ)return a;if(jt.isCryptoKey(a)){if("public"!==a.type)throw TypeError("Public key is required");return new jQ(await b.subtle.exportKey("spki",a))}if(a.publicKey)return a.publicKey;if(b6.isBufferSource(a))return new jQ(a);throw TypeError("Unsupported PublicKeyType")}constructor(a){jP.isAsnEncoded(a)?super(a,fF):super(a),this.tag=jO.PublicKeyTag}async export(...a){var b;let c,d=["verify"],e={hash:"SHA-256",...this.algorithm};a.length>1?(e=a[0]||e,d=a[1]||d,c=a[2]||ju.get()):c=a[0]||ju.get();let f=this.rawData,g=ej.parse(this.rawData,fF);return g.algorithm.algorithm===hi&&(b=g,b.algorithm=new fE({algorithm:hf,parameters:null}),f=ej.serialize(b)),c.subtle.importKey("spki",f,e,!0,d)}onInit(a){let b=h1.resolve(iR),c=this.algorithm=b.toWebAlgorithm(a.algorithm);if(a.algorithm.algorithm===hf){let b=ej.parse(a.subjectPublicKey,hI),d=b6.toUint8Array(b.modulus);c.publicExponent=b6.toUint8Array(b.publicExponent),c.modulusLength=(!d[0]?d.slice(1):d).byteLength<<3}}async getThumbprint(...a){var b;let c,d="SHA-1";return!(a.length>=1)||(null==(b=a[0])?void 0:b.subtle)?c=a[0]||ju.get():(d=a[0]||d,c=a[1]||ju.get()),await c.subtle.digest(d,this.rawData)}async getKeyIdentifier(...a){let b,c="SHA-1";1===a.length?"string"==typeof a[0]?(c=a[0],b=ju.get()):b=a[0]:2===a.length?(c=a[0],b=a[1]):b=ju.get();let d=ej.parse(this.rawData,fF);return await b.subtle.digest(c,d.subjectPublicKey)}toTextObject(){let a=this.toTextObjectEmpty(),b=ej.parse(this.rawData,fF);return a.Algorithm=jq.serializeAlgorithm(b.algorithm),b.algorithm.algorithm===gV?a["EC Point"]=b.subjectPublicKey:a["Raw Data"]=b.subjectPublicKey,a}}class jR extends js{static async create(a,b=!1,c=ju.get()){if("name"in a&&"serialNumber"in a)return new jR(a,b);let d=await jQ.create(a,c),e=await d.getKeyIdentifier(c);return new jR(cd.ToHex(e),b)}constructor(...a){if(b6.isBufferSource(a[0]))super(a[0]);else if("string"==typeof a[0]){const b=new eN({keyIdentifier:new eM(cd.FromHex(a[0]))});super(eL,a[1],ej.serialize(b))}else{const b=a[0],c=new eN({authorityCertIssuer:b.name instanceof jJ?ej.parse(b.name.rawData,eQ):b.name,authorityCertSerialNumber:cd.FromHex(b.serialNumber)});super(eL,a[1],ej.serialize(c))}}onInit(a){super.onInit(a);let b=ej.parse(a.extnValue,eN);b.keyIdentifier&&(this.keyId=cd.ToHex(b.keyIdentifier)),(b.authorityCertIssuer||b.authorityCertSerialNumber)&&(this.certId={name:b.authorityCertIssuer||[],serialNumber:b.authorityCertSerialNumber?cd.ToHex(b.authorityCertSerialNumber):""})}toTextObject(){let a=this.toTextObjectWithoutValue(),b=ej.parse(this.value,eN);return b.authorityCertIssuer&&(a["Authority Issuer"]=new jJ(b.authorityCertIssuer).toTextObject()),b.authorityCertSerialNumber&&(a["Authority Serial Number"]=b.authorityCertSerialNumber),b.keyIdentifier&&(a[""]=b.keyIdentifier),a}}jR.NAME="Authority Key Identifier";class jS extends js{constructor(...a){if(b6.isBufferSource(a[0])){super(a[0]);const b=ej.parse(this.value,eP);this.ca=b.cA,this.pathLength=b.pathLenConstraint}else{const b=new eP({cA:a[0],pathLenConstraint:a[1]});super(eO,a[2],ej.serialize(b)),this.ca=a[0],this.pathLength=a[1]}}toTextObject(){let a=this.toTextObjectWithoutValue();return this.ca&&(a.CA=this.ca),void 0!==this.pathLength&&(a["Path Length"]=this.pathLength),a}}jS.NAME="Basic Constraints",(w=aI||(aI={})).serverAuth="1.3.6.1.5.5.7.3.1",w.clientAuth="1.3.6.1.5.5.7.3.2",w.codeSigning="1.3.6.1.5.5.7.3.3",w.emailProtection="1.3.6.1.5.5.7.3.4",w.timeStamping="1.3.6.1.5.5.7.3.8",w.ocspSigning="1.3.6.1.5.5.7.3.9";class jT extends js{constructor(...a){if(b6.isBufferSource(a[0])){super(a[0]);const b=ej.parse(this.value,fa);this.usages=b.map(a=>a)}else{const b=new fa(a[0]);super(e9,a[1],ej.serialize(b)),this.usages=a[0]}}toTextObject(){let a=this.toTextObjectWithoutValue();return a[""]=this.usages.map(a=>jp.toString(a)).join(", "),a}}jT.NAME="Extended Key Usages",(x=aJ||(aJ={}))[x.digitalSignature=1]="digitalSignature",x[x.nonRepudiation=2]="nonRepudiation",x[x.keyEncipherment=4]="keyEncipherment",x[x.dataEncipherment=8]="dataEncipherment",x[x.keyAgreement=16]="keyAgreement",x[x.keyCertSign=32]="keyCertSign",x[x.cRLSign=64]="cRLSign",x[x.encipherOnly=128]="encipherOnly",x[x.decipherOnly=256]="decipherOnly";class jU extends js{constructor(...a){if(b6.isBufferSource(a[0])){super(a[0]);const b=ej.parse(this.value,fn);this.usages=b.toNumber()}else{const b=new fn(a[0]);super(fm,a[1],ej.serialize(b)),this.usages=a[0]}}toTextObject(){let a=this.toTextObjectWithoutValue(),b=ej.parse(this.value,fn);return a[""]=b.toJSON().join(", "),a}}jU.NAME="Key Usages";class jV extends js{static async create(a,b=!1,c=ju.get()){let d=await jQ.create(a,c),e=await d.getKeyIdentifier(c);return new jV(cd.ToHex(e),b)}constructor(...a){if(b6.isBufferSource(a[0])){super(a[0]);const b=ej.parse(this.value,fz);this.keyId=cd.ToHex(b)}else{const b="string"==typeof a[0]?cd.FromHex(a[0]):a[0],c=new fz(b);super(fy,a[1],ej.serialize(c)),this.keyId=cd.ToHex(b)}}toTextObject(){let a=this.toTextObjectWithoutValue(),b=ej.parse(this.value,fz);return a[""]=b,a}}jV.NAME="Subject Key Identifier";class jW extends js{constructor(...a){b6.isBufferSource(a[0])?super(a[0]):super(fu,a[1],new jJ(a[0]||[]).rawData)}onInit(a){super.onInit(a);let b=ej.parse(a.extnValue,fv);this.names=new jJ(b)}toTextObject(){let a=this.toTextObjectWithoutValue(),b=this.names.toTextObject();for(let c in b)a[c]=b[c];return a}}jW.NAME="Subject Alternative Name";class jX{static register(a,b){this.items.set(a,b)}static create(a){let b=new js(a),c=this.items.get(b.type);return c?new c(a):b}}jX.items=new Map;class jY extends js{constructor(...a){var b;if(b6.isBufferSource(a[0])){super(a[0]);const b=ej.parse(this.value,eZ);this.policies=b.map(a=>a.policyIdentifier)}else{const c=a[0],d=null!=(b=a[1])&&b,e=new eZ(c.map(a=>new eY({policyIdentifier:a})));super(eS,d,ej.serialize(e)),this.policies=c}}toTextObject(){let a=this.toTextObjectWithoutValue();return a.Policy=this.policies.map(a=>new jn("",{},jp.toString(a))),a}}jY.NAME="Certificate Policies",jX.register(eS,jY);class jZ extends js{constructor(...a){if(b6.isBufferSource(a[0]))super(a[0]);else if(Array.isArray(a[0])&&"string"==typeof a[0][0]){const b=a[0].map(a=>new e3({distributionPoint:new e2({fullName:[new ey({uniformResourceIdentifier:a})]})})),c=new e4(b);super(e0,a[1],ej.serialize(c))}else{const b=new e4(a[0]);super(e0,a[1],ej.serialize(b))}null!=this.distributionPoints||(this.distributionPoints=[])}onInit(a){super.onInit(a);let b=ej.parse(a.extnValue,e4);this.distributionPoints=b}toTextObject(){let a=this.toTextObjectWithoutValue();return a["Distribution Point"]=this.distributionPoints.map(a=>{var b;let c={};return a.distributionPoint&&(c[""]=null==(b=a.distributionPoint.fullName)?void 0:b.map(a=>new jI(a).toString()).join(", ")),a.reasons&&(c.Reasons=a.reasons.toString()),a.cRLIssuer&&(c["CRL Issuer"]=a.cRLIssuer.map(a=>a.toString()).join(", ")),c}),a}}jZ.NAME="CRL Distribution Points";class j$ extends js{constructor(...a){if(b6.isBufferSource(a[0]))super(a[0]);else if(a[0]instanceof eK){const b=new eK(a[0]);super(eI,a[1],ej.serialize(b))}else{const b=a[0],c=new eK;j0(c,b,eD,"ocsp"),j0(c,b,eE,"caIssuers"),j0(c,b,eF,"timeStamping"),j0(c,b,eG,"caRepository"),super(eI,a[1],ej.serialize(c))}null!=this.ocsp||(this.ocsp=[]),null!=this.caIssuers||(this.caIssuers=[]),null!=this.timeStamping||(this.timeStamping=[]),null!=this.caRepository||(this.caRepository=[])}onInit(a){super.onInit(a),this.ocsp=[],this.caIssuers=[],this.timeStamping=[],this.caRepository=[],ej.parse(a.extnValue,eK).forEach(a=>{switch(a.accessMethod){case eD:this.ocsp.push(new jI(a.accessLocation));break;case eE:this.caIssuers.push(new jI(a.accessLocation));break;case eF:this.timeStamping.push(new jI(a.accessLocation));break;case eG:this.caRepository.push(new jI(a.accessLocation))}})}toTextObject(){let a=this.toTextObjectWithoutValue();return this.ocsp.length&&j_(a,"OCSP",this.ocsp),this.caIssuers.length&&j_(a,"CA Issuers",this.caIssuers),this.timeStamping.length&&j_(a,"Time Stamping",this.timeStamping),this.caRepository.length&&j_(a,"CA Repository",this.caRepository),a}}function j_(a,b,c){if(1===c.length)a[b]=c[0].toTextObject();else{let d=new jn("");c.forEach((a,b)=>{let c=a.toTextObject(),e=`${c[jn.NAME]} ${b+1}`,f=d[e];Array.isArray(f)||(f=[],d[e]=f),f.push(c)}),a[b]=d}}function j0(a,b,c,d){let e=b[d];e&&(Array.isArray(e)?e:[e]).forEach(b=>{"string"==typeof b&&(b=new jI("url",b)),a.push(new eJ({accessMethod:c,accessLocation:ej.parse(b.rawData,ey)}))})}j$.NAME="Authority Info Access";class j1 extends js{constructor(...a){b6.isBufferSource(a[0])?super(a[0]):super(fk,a[1],new jJ(a[0]||[]).rawData)}onInit(a){super.onInit(a);let b=ej.parse(a.extnValue,eQ);this.names=new jJ(b)}toTextObject(){let a=this.toTextObjectWithoutValue(),b=this.names.toTextObject();for(let c in b)a[c]=b[c];return a}}j1.NAME="Issuer Alternative Name";class j2 extends jr{constructor(...a){let b;if(b6.isBufferSource(a[0]))b=b6.toArrayBuffer(a[0]);else{const c=a[0],d=Array.isArray(a[1])?a[1].map(a=>b6.toArrayBuffer(a)):[];b=ej.serialize(new fw({type:c,values:d}))}super(b,fw)}onInit(a){this.type=a.type,this.values=a.values}toTextObject(){let a=this.toTextObjectWithoutValue();return a.Value=this.values.map(a=>new jn("",{"":a})),a}toTextObjectWithoutValue(){let a=this.toTextObjectEmpty();return a[jn.NAME]===j2.NAME&&(a[jn.NAME]=jp.toString(this.type)),a}}j2.NAME="Attribute";class j3 extends j2{constructor(...a){if(b6.isBufferSource(a[0]))super(a[0]);else{const b=new iG({printableString:a[0]});super(im,[ej.serialize(b)])}null!=this.password||(this.password="")}onInit(a){if(super.onInit(a),this.values[0]){let a=ej.parse(this.values[0],iG);this.password=a.toString()}}toTextObject(){let a=this.toTextObjectWithoutValue();return a[jn.VALUE]=this.password,a}}j3.NAME="Challenge Password";class j4 extends j2{constructor(...a){if(b6.isBufferSource(a[0]))super(a[0]);else{const b=a[0],c=new fJ;for(const a of b)c.push(ej.parse(a.rawData,fI));super(io,[ej.serialize(c)])}null!=this.items||(this.items=[])}onInit(a){if(super.onInit(a),this.values[0]){let a=ej.parse(this.values[0],fJ);this.items=a.map(a=>jX.create(ej.serialize(a)))}}toTextObject(){let a=this.toTextObjectWithoutValue();for(let b of this.items.map(a=>a.toTextObject()))a[b[jn.NAME]]=b;return a}}j4.NAME="Extensions";class j5{static register(a,b){this.items.set(a,b)}static create(a){let b=new j2(a),c=this.items.get(b.type);return c?new c(a):b}}j5.items=new Map;let j6="crypto.signatureFormatter";class j7{toAsnSignature(a,b){return b6.toArrayBuffer(b)}toWebSignature(a,b){return b6.toArrayBuffer(b)}}let j8=aK=class{static createPssParams(a,b){let c=aK.getHashAlgorithm(a);return c?new hD({hashAlgorithm:c,maskGenAlgorithm:new fE({algorithm:hx,parameters:ej.serialize(c)}),saltLength:b}):null}static getHashAlgorithm(a){let b=h1.resolve(iR);return"string"==typeof a?b.toAsnAlgorithm({name:a}):"object"==typeof a&&a&&"name"in a?b.toAsnAlgorithm(a):null}toAsnAlgorithm(a){switch(a.name.toLowerCase()){case"rsassa-pkcs1-v1_5":if(!("hash"in a))return new fE({algorithm:hf,parameters:null});{let b;if("string"==typeof a.hash)b=a.hash;else if(a.hash&&"object"==typeof a.hash&&"name"in a.hash&&"string"==typeof a.hash.name)b=a.hash.name.toUpperCase();else throw Error("Cannot get hash algorithm name");switch(b.toLowerCase()){case"sha-1":return new fE({algorithm:hl,parameters:null});case"sha-256":return new fE({algorithm:hn,parameters:null});case"sha-384":return new fE({algorithm:ho,parameters:null});case"sha-512":return new fE({algorithm:hp,parameters:null})}}break;case"rsa-pss":if(!("hash"in a))return new fE({algorithm:hi,parameters:null});{if(!("saltLength"in a&&"number"==typeof a.saltLength))throw Error("Cannot get 'saltLength' from 'alg' argument");let b=aK.createPssParams(a.hash,a.saltLength);if(!b)throw Error("Cannot create PSS parameters");return new fE({algorithm:hi,parameters:ej.serialize(b)})}}return null}toWebAlgorithm(a){switch(a.algorithm){case hf:return{name:"RSASSA-PKCS1-v1_5"};case hl:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-1"}};case hn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case ho:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-384"}};case hp:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-512"}};case hi:if(!a.parameters)return{name:"RSA-PSS"};{let b=ej.parse(a.parameters,hD);return{name:"RSA-PSS",hash:h1.resolve(iR).toWebAlgorithm(b.hashAlgorithm),saltLength:b.saltLength}}}return null}};j8=aK=ek([h2()],j8),h1.registerSingleton(iP,j8);let j9=class{toAsnAlgorithm(a){switch(a.name.toLowerCase()){case"sha-1":return new fE({algorithm:hs});case"sha-256":return new fE({algorithm:hu});case"sha-384":return new fE({algorithm:hv});case"sha-512":return new fE({algorithm:hw})}return null}toWebAlgorithm(a){switch(a.algorithm){case hs:return{name:"SHA-1"};case hu:return{name:"SHA-256"};case hv:return{name:"SHA-384"};case hw:return{name:"SHA-512"}}return null}};j9=ek([h2()],j9),h1.registerSingleton(iP,j9);class ka{addPadding(a,b){let c=b6.toUint8Array(b),d=new Uint8Array(a);return d.set(c,a-c.length),d.buffer}removePadding(a,b=!1){let c=b6.toUint8Array(a);for(let a=0;a<c.length;a++)if(c[a]){c=c.slice(a);break}if(b&&c[0]>127){let a=new Uint8Array(c.length+1);return a.set(c,1),a.buffer}return c.buffer}toAsnSignature(a,b){if("ECDSA"===a.name){let c=a.namedCurve,d=ka.namedCurveSize.get(c)||ka.defaultNamedCurveSize,e=new hd,f=b6.toUint8Array(b);return e.r=this.removePadding(f.slice(0,d),!0),e.s=this.removePadding(f.slice(d,d+d),!0),ej.serialize(e)}return null}toWebSignature(a,b){if("ECDSA"===a.name){let c=ej.parse(b,hd),d=a.namedCurve,e=ka.namedCurveSize.get(d)||ka.defaultNamedCurveSize;return function(...a){let b=new Uint8Array(a.map(a=>a.byteLength).reduce((a,b)=>a+b)),c=0;return a.map(a=>new Uint8Array(a)).forEach(a=>{for(let d of a)b[c++]=d}),b.buffer}(this.addPadding(e,this.removePadding(c.r)),this.addPadding(e,this.removePadding(c.s)))}return null}}ka.namedCurveSize=new Map,ka.defaultNamedCurveSize=32;let kb="1.3.101.110",kc="1.3.101.111",kd="1.3.101.112",ke="1.3.101.113",kf=class{toAsnAlgorithm(a){let b=null;switch(a.name.toLowerCase()){case"ed25519":b=kd;break;case"x25519":b=kb;break;case"eddsa":switch(a.namedCurve.toLowerCase()){case"ed25519":b=kd;break;case"ed448":b=ke}break;case"ecdh-es":switch(a.namedCurve.toLowerCase()){case"x25519":b=kb;break;case"x448":b=kc}}return b?new fE({algorithm:b}):null}toWebAlgorithm(a){switch(a.algorithm){case kd:return{name:"Ed25519"};case ke:return{name:"EdDSA",namedCurve:"Ed448"};case kb:return{name:"X25519"};case kc:return{name:"ECDH-ES",namedCurve:"X448"}}return null}};kf=ek([h2()],kf),h1.registerSingleton(iP,kf);class kg extends jP{get subjectName(){return el(this,aM,"f")||em(this,aM,new jz(this.asn.certificationRequestInfo.subject),"f"),el(this,aM,"f")}get subject(){return el(this,aN,"f")||em(this,aN,this.subjectName.toString(),"f"),el(this,aN,"f")}get signatureAlgorithm(){if(!el(this,aO,"f")){let a=h1.resolve(iR);em(this,aO,a.toWebAlgorithm(this.asn.signatureAlgorithm),"f")}return el(this,aO,"f")}get signature(){return el(this,aP,"f")||em(this,aP,this.asn.signature,"f"),el(this,aP,"f")}get publicKey(){return el(this,aQ,"f")||em(this,aQ,new jQ(this.asn.certificationRequestInfo.subjectPKInfo),"f"),el(this,aQ,"f")}get attributes(){return el(this,aR,"f")||em(this,aR,this.asn.certificationRequestInfo.attributes.map(a=>j5.create(ej.serialize(a))),"f"),el(this,aR,"f")}get extensions(){if(!el(this,aS,"f")){em(this,aS,[],"f");let a=this.getAttribute(io);a instanceof j4&&em(this,aS,a.items,"f")}return el(this,aS,"f")}get tbs(){return el(this,aL,"f")||em(this,aL,this.asn.certificationRequestInfoRaw||ej.serialize(this.asn.certificationRequestInfo),"f"),el(this,aL,"f")}constructor(a){const b=jP.isAsnEncoded(a)?[a,iO]:[a];super(b[0],b[1]),aL.set(this,void 0),aM.set(this,void 0),aN.set(this,void 0),aO.set(this,void 0),aP.set(this,void 0),aQ.set(this,void 0),aR.set(this,void 0),aS.set(this,void 0),this.tag=jO.CertificateRequestTag}onInit(a){}getAttribute(a){for(let b of this.attributes)if(b.type===a)return b;return null}getAttributes(a){return this.attributes.filter(b=>b.type===a)}getExtension(a){for(let b of this.extensions)if(b.type===a)return b;return null}getExtensions(a){return this.extensions.filter(b=>b.type===a)}async verify(a=ju.get()){let b={...this.publicKey.algorithm,...this.signatureAlgorithm},c=await this.publicKey.export(b,["verify"],a),d=h1.resolveAll(j6).reverse(),e=null;for(let a of d)if(e=a.toWebSignature(b,this.signature))break;if(!e)throw Error("Cannot convert WebCrypto signature value to ASN.1 format");return await a.subtle.verify(this.signatureAlgorithm,c,e,this.tbs)}toTextObject(){let a=this.toTextObjectEmpty(),b=ej.parse(this.rawData,iO),c=b.certificationRequestInfo,d=new jn("",{Version:`${ae[c.version]} (${c.version})`,Subject:this.subject,"Subject Public Key Info":this.publicKey});if(this.attributes.length){let a=new jn("");for(let b of this.attributes){let c=b.toTextObject();a[c[jn.NAME]]=c}d.Attributes=a}return a.Data=d,a.Signature=new jn("",{Algorithm:jq.serializeAlgorithm(b.signatureAlgorithm),"":b.signature}),a}}aL=new WeakMap,aM=new WeakMap,aN=new WeakMap,aO=new WeakMap,aP=new WeakMap,aQ=new WeakMap,aR=new WeakMap,aS=new WeakMap,kg.NAME="PKCS#10 Certificate Request";class kh extends jP{get publicKey(){return el(this,a2,"f")||em(this,a2,new jQ(this.asn.tbsCertificate.subjectPublicKeyInfo),"f"),el(this,a2,"f")}get serialNumber(){if(!el(this,aU,"f")){let a=new Uint8Array(this.asn.tbsCertificate.serialNumber);a.length>1&&0===a[0]&&a[1]>127&&(a=a.slice(1)),em(this,aU,cd.ToHex(a),"f")}return el(this,aU,"f")}get subjectName(){return el(this,aV,"f")||em(this,aV,new jz(this.asn.tbsCertificate.subject),"f"),el(this,aV,"f")}get subject(){return el(this,aW,"f")||em(this,aW,this.subjectName.toString(),"f"),el(this,aW,"f")}get issuerName(){return el(this,aX,"f")||em(this,aX,new jz(this.asn.tbsCertificate.issuer),"f"),el(this,aX,"f")}get issuer(){return el(this,aY,"f")||em(this,aY,this.issuerName.toString(),"f"),el(this,aY,"f")}get notBefore(){if(!el(this,aZ,"f")){let a=this.asn.tbsCertificate.validity.notBefore.utcTime||this.asn.tbsCertificate.validity.notBefore.generalTime;if(!a)throw Error("Cannot get 'notBefore' value");em(this,aZ,a,"f")}return el(this,aZ,"f")}get notAfter(){if(!el(this,a$,"f")){let a=this.asn.tbsCertificate.validity.notAfter.utcTime||this.asn.tbsCertificate.validity.notAfter.generalTime;if(!a)throw Error("Cannot get 'notAfter' value");em(this,a$,a,"f")}return el(this,a$,"f")}get signatureAlgorithm(){if(!el(this,a_,"f")){let a=h1.resolve(iR);em(this,a_,a.toWebAlgorithm(this.asn.signatureAlgorithm),"f")}return el(this,a_,"f")}get signature(){return el(this,a0,"f")||em(this,a0,this.asn.signatureValue,"f"),el(this,a0,"f")}get extensions(){return!el(this,a1,"f")&&(em(this,a1,[],"f"),this.asn.tbsCertificate.extensions&&em(this,a1,this.asn.tbsCertificate.extensions.map(a=>jX.create(ej.serialize(a))),"f")),el(this,a1,"f")}get tbs(){return el(this,aT,"f")||em(this,aT,this.asn.tbsCertificateRaw||ej.serialize(this.asn.tbsCertificate),"f"),el(this,aT,"f")}constructor(a){const b=jP.isAsnEncoded(a)?[a,fL]:[a];super(b[0],b[1]),aT.set(this,void 0),aU.set(this,void 0),aV.set(this,void 0),aW.set(this,void 0),aX.set(this,void 0),aY.set(this,void 0),aZ.set(this,void 0),a$.set(this,void 0),a_.set(this,void 0),a0.set(this,void 0),a1.set(this,void 0),a2.set(this,void 0),this.tag=jO.CertificateTag}onInit(a){}getExtension(a){for(let b of this.extensions)if("string"==typeof a){if(b.type===a)return b}else if(b instanceof a)return b;return null}getExtensions(a){return this.extensions.filter(b=>"string"==typeof a?b.type===a:b instanceof a)}async verify(a={},b=ju.get()){let c,d,e=a.publicKey;try{if(e)if("publicKey"in e)c={...e.publicKey.algorithm,...this.signatureAlgorithm},d=await e.publicKey.export(c,["verify"],b);else if(e instanceof jQ)c={...e.algorithm,...this.signatureAlgorithm},d=await e.export(c,["verify"],b);else if(b6.isBufferSource(e)){let a=new jQ(e);c={...a.algorithm,...this.signatureAlgorithm},d=await a.export(c,["verify"],b)}else c={...e.algorithm,...this.signatureAlgorithm},d=e;else c={...this.publicKey.algorithm,...this.signatureAlgorithm},d=await this.publicKey.export(c,["verify"],b)}catch{return!1}let f=h1.resolveAll(j6).reverse(),g=null;for(let a of f)if(g=a.toWebSignature(c,this.signature))break;if(!g)throw Error("Cannot convert ASN.1 signature value to WebCrypto format");let h=await b.subtle.verify(this.signatureAlgorithm,d,g,this.tbs);if(a.signatureOnly)return h;{let b=(a.date||new Date).getTime();return h&&this.notBefore.getTime()<b&&b<this.notAfter.getTime()}}async getThumbprint(...a){let b,c="SHA-1";return a[0]&&(a[0].subtle?b=a[0]:(c=a[0]||c,b=a[1])),null!=b||(b=ju.get()),await b.subtle.digest(c,this.rawData)}async isSelfSigned(a=ju.get()){return this.subject===this.issuer&&await this.verify({signatureOnly:!0},a)}toTextObject(){let a=this.toTextObjectEmpty(),b=ej.parse(this.rawData,fL),c=b.tbsCertificate,d=new jn("",{Version:`${ae[c.version]} (${c.version})`,"Serial Number":c.serialNumber,"Signature Algorithm":jq.serializeAlgorithm(c.signature),Issuer:this.issuer,Validity:new jn("",{"Not Before":c.validity.notBefore.getTime(),"Not After":c.validity.notAfter.getTime()}),Subject:this.subject,"Subject Public Key Info":this.publicKey});if(c.issuerUniqueID&&(d["Issuer Unique ID"]=c.issuerUniqueID),c.subjectUniqueID&&(d["Subject Unique ID"]=c.subjectUniqueID),this.extensions.length){let a=new jn("");for(let b of this.extensions){let c=b.toTextObject();a[c[jn.NAME]]=c}d.Extensions=a}return a.Data=d,a.Signature=new jn("",{Algorithm:jq.serializeAlgorithm(b.signatureAlgorithm),"":b.signatureValue}),a}}function ki(a,b=ju.get()){let c=b6.toUint8Array(cd.FromHex(a||"")),d=c&&c.length&&c.some(a=>a>0)?new Uint8Array(c):void 0;d||(d=b.getRandomValues(new Uint8Array(16)));let e=0;for(;e<d.length-1&&0===d[e];)e++;if((d=d.slice(e))[0]>127){let a=new Uint8Array(d.length+1);a[0]=0,a.set(d,1),d=a}return d.buffer}aT=new WeakMap,aU=new WeakMap,aV=new WeakMap,aW=new WeakMap,aX=new WeakMap,aY=new WeakMap,aZ=new WeakMap,a$=new WeakMap,a_=new WeakMap,a0=new WeakMap,a1=new WeakMap,a2=new WeakMap,kh.NAME="Certificate",(y=a8||(a8={}))[y.unspecified=0]="unspecified",y[y.keyCompromise=1]="keyCompromise",y[y.cACompromise=2]="cACompromise",y[y.affiliationChanged=3]="affiliationChanged",y[y.superseded=4]="superseded",y[y.cessationOfOperation=5]="cessationOfOperation",y[y.certificateHold=6]="certificateHold",y[y.removeFromCRL=8]="removeFromCRL",y[y.privilegeWithdrawn=9]="privilegeWithdrawn",y[y.aACompromise=10]="aACompromise";class kj extends jr{get serialNumber(){return el(this,a3,"f")||em(this,a3,cd.ToHex(this.asn.userCertificate),"f"),el(this,a3,"f")}get revocationDate(){return el(this,a4,"f")||em(this,a4,this.asn.revocationDate.getTime(),"f"),el(this,a4,"f")}get reason(){return void 0===el(this,a5,"f")&&this.extensions,el(this,a5,"f")}get invalidity(){return void 0===el(this,a6,"f")&&this.extensions,el(this,a6,"f")}get extensions(){return!el(this,a7,"f")&&(em(this,a7,[],"f"),this.asn.crlEntryExtensions&&em(this,a7,this.asn.crlEntryExtensions.map(a=>{let b=jX.create(ej.serialize(a));switch(b.type){case e7:void 0===el(this,a5,"f")&&em(this,a5,ej.parse(b.value,e8).reason,"f");break;case fi:void 0===el(this,a6,"f")&&em(this,a6,ej.parse(b.value,fj).value,"f")}return b}),"f")),el(this,a7,"f")}constructor(...a){let b;if(b6.isBufferSource(a[0])?b=b6.toArrayBuffer(a[0]):"string"==typeof a[0]?b=ej.serialize(new fM({userCertificate:ki(a[0]),revocationDate:new fG(a[1]),crlEntryExtensions:a[2]})):a[0]instanceof fM&&(b=a[0]),!b)throw TypeError("Cannot create X509CrlEntry instance. Wrong constructor arguments.");super(b,fM),a3.set(this,void 0),a4.set(this,void 0),a5.set(this,void 0),a6.set(this,void 0),a7.set(this,void 0)}onInit(a){}}a3=new WeakMap,a4=new WeakMap,a5=new WeakMap,a6=new WeakMap,a7=new WeakMap;class kk extends jP{get version(){return this.asn.tbsCertList.version}get signatureAlgorithm(){if(!el(this,ba,"f")){let a=h1.resolve(iR);em(this,ba,a.toWebAlgorithm(this.asn.signatureAlgorithm),"f")}return el(this,ba,"f")}get signature(){return this.asn.signature}get issuer(){return this.issuerName.toString()}get issuerName(){return el(this,bb,"f")||em(this,bb,new jz(this.asn.tbsCertList.issuer),"f"),el(this,bb,"f")}get thisUpdate(){if(!el(this,bc,"f")){let a=this.asn.tbsCertList.thisUpdate.getTime();if(!a)throw Error("Cannot get 'thisUpdate' value");em(this,bc,a,"f")}return el(this,bc,"f")}get nextUpdate(){var a;return void 0===el(this,bd,"f")&&em(this,bd,(null==(a=this.asn.tbsCertList.nextUpdate)?void 0:a.getTime())||void 0,"f"),el(this,bd,"f")}get entries(){var a;return el(this,be,"f")||em(this,be,(null==(a=this.asn.tbsCertList.revokedCertificates)?void 0:a.map(a=>new kj(a)))||[],"f"),el(this,be,"f")}get extensions(){return!el(this,bf,"f")&&(em(this,bf,[],"f"),this.asn.tbsCertList.crlExtensions&&em(this,bf,this.asn.tbsCertList.crlExtensions.map(a=>jX.create(ej.serialize(a))),"f")),el(this,bf,"f")}get tbs(){return el(this,a9,"f")||em(this,a9,this.asn.tbsCertListRaw||ej.serialize(this.asn.tbsCertList),"f"),el(this,a9,"f")}get tbsCertListSignatureAlgorithm(){return this.asn.tbsCertList.signature}get certListSignatureAlgorithm(){return this.asn.signatureAlgorithm}constructor(a){super(a,jP.isAsnEncoded(a)?fO:void 0),this.tag=jO.CrlTag,a9.set(this,void 0),ba.set(this,void 0),bb.set(this,void 0),bc.set(this,void 0),bd.set(this,void 0),be.set(this,void 0),bf.set(this,void 0)}onInit(a){}getExtension(a){for(let b of this.extensions)if("string"==typeof a){if(b.type===a)return b}else if(b instanceof a)return b;return null}getExtensions(a){return this.extensions.filter(b=>"string"==typeof a?b.type===a:b instanceof a)}async verify(a,b=ju.get()){let c,d;if(!this.certListSignatureAlgorithm.isEqual(this.tbsCertListSignatureAlgorithm))throw Error("algorithm identifier in the sequence tbsCertList and CertificateList mismatch");let e=a.publicKey;try{e instanceof kh?(c={...e.publicKey.algorithm,...e.signatureAlgorithm},d=await e.publicKey.export(c,["verify"])):e instanceof jQ?(c={...e.algorithm,...this.signatureAlgorithm},d=await e.export(c,["verify"])):(c={...e.algorithm,...this.signatureAlgorithm},d=e)}catch{return!1}let f=h1.resolveAll(j6).reverse(),g=null;for(let a of f)if(g=a.toWebSignature(c,this.signature))break;if(!g)throw Error("Cannot convert ASN.1 signature value to WebCrypto format");return await b.subtle.verify(this.signatureAlgorithm,d,g,this.tbs)}async getThumbprint(...a){let b,c="SHA-1";return a[0]&&(a[0].subtle?b=a[0]:(c=a[0]||c,b=a[1])),null!=b||(b=ju.get()),await b.subtle.digest(c,this.rawData)}findRevoked(a){let b=ki("string"==typeof a?a:a.serialNumber);for(let a of this.asn.tbsCertList.revokedCertificates||[])if(b6.isEqual(a.userCertificate,b))return new kj(ej.serialize(a));return null}}function kl(a){return km.stubThis(a)}a9=new WeakMap,ba=new WeakMap,bb=new WeakMap,bc=new WeakMap,bd=new WeakMap,be=new WeakMap,bf=new WeakMap,jX.register(eO,jS),jX.register(e9,jT),jX.register(fm,jU),jX.register(fy,jV),jX.register(eL,jR),jX.register(fu,jW),jX.register(e0,jZ),jX.register(eI,j$),jX.register(fk,j1),j5.register(im,j3),j5.register(io,j4),h1.registerSingleton(j6,j7),h1.registerSingleton(j6,ka),ka.namedCurveSize.set("P-256",32),ka.namedCurveSize.set("K-256",32),ka.namedCurveSize.set("P-384",48),ka.namedCurveSize.set("P-521",66);let km={stubThis:a=>globalThis.fetch(a)},kn={};async function ko(a){let b,c,d,e,f,g,{extensions:h}=a;if(!h)return!1;if(h.forEach(a=>{a instanceof jR?b=a:a instanceof jV?c=a:a instanceof jZ&&(d=a)}),b&&b.keyId?g=b.keyId:c&&(g=c.keyId),g){let b=kn[g];if(b){let c=new Date;if(!b.nextUpdate||b.nextUpdate>c)return b.revokedCerts.indexOf(a.serialNumber)>=0}}let i=d?.distributionPoints?.[0].distributionPoint?.fullName?.[0].uniformResourceIdentifier;if(!i)return!1;try{let a=await kl(i);e=await a.arrayBuffer()}catch(a){return!1}try{f=new kk(e)}catch(a){return!1}let j={revokedCerts:[],nextUpdate:void 0};f.nextUpdate&&(j.nextUpdate=f.nextUpdate);let k=f.entries;if(k){for(let a of k){let b=a.serialNumber;j.revokedCerts.push(b)}return g&&(kn[g]=j),j.revokedCerts.indexOf(a.serialNumber)>=0}return!1}function kp(a){let b,c,d,e,f;if(a.byteLength<37)throw Error(`Authenticator data was ${a.byteLength} bytes, expected at least 37 bytes`);let g=0,h=kQ(a),i=a.slice(g,g+=32),j=a.slice(g,g+=1),k=j[0],l={up:!!(1&k),uv:!!(4&k),be:!!(8&k),bs:!!(16&k),at:!!(64&k),ed:!!(128&k),flagsInt:k},m=a.slice(g,g+4),n=h.getUint32(g,!1);if(g+=4,l.at){b=a.slice(g,g+=16);let e=h.getUint16(g);g+=2,c=a.slice(g,g+=e);let f=function(a){if(!a)return Uint8Array.from([]);if(!(0!==a.length&&a.length%2==0&&!/[^a-fA-F0-9]/u.test(a)))throw Error("Invalid hex string");let b=a.match(/.{1,2}/g)??[];return Uint8Array.from(b.map(a=>parseInt(a,16)))}("a301634f4b500327206745643235353139"),i=a.slice(g,g+f.byteLength),j=!1;kM(f,i)&&(j=!0,a[g]=164);let k=bI(a.slice(g)),l=Uint8Array.from(bJ(k));j&&(a[g]=163),d=l,g+=l.byteLength}if(l.ed){let b=bI(a.slice(g));e=function(a){let b;try{b=bI(a)}catch(a){throw Error(`Error decoding authenticator extensions: ${a.message}`)}return function a(b){let c={};for(let[d,e]of b)e instanceof Map?c[d]=a(e):c[d]=e;return c}(b)}(f=Uint8Array.from(bJ(b))),g+=f.byteLength}if(a.byteLength>g)throw Error("Leftover bytes detected while parsing authenticator data");return kq.stubThis({rpIdHash:i,flagsBuf:j,flags:l,counter:n,counterBuf:m,aaguid:b,credentialID:c,credentialPublicKey:d,extensionsData:e,extensionsDataBuffer:f})}let kq={stubThis:a=>a};function kr(a,b=-7){return"string"==typeof a&&(a=kP(a)),bS(a,b)}async function ks(a,b=[]){if(0===b.length)return!0;let c=await bP(),d=a.map(a=>new kh(a));for(let b=0;b<d.length;b++){let c=d[b],e=a[b];try{await kt(c)}catch(a){throw Error(`Found revoked certificate in x5c:
6
+ ${e}`)}try{ku(c.notBefore,c.notAfter)}catch(a){throw Error(`Found certificate out of validity period in x5c:
7
+ ${e}`)}}let e=b.map(a=>{try{return new kh(a)}catch(b){throw Error(`Could not parse trust anchor certificate:
8
+ ${a}`,{cause:b})}}),f=[];for(let a=0;a<e.length;a++){let b=e[a];try{await kt(b)}catch(a){continue}try{ku(b.notBefore,b.notAfter)}catch(a){continue}f.push(b)}if(0===f.length)throw Error("No specified trust anchor was valid for verifying x5c");let g=!1;for(let a of e)try{let b=d.concat([a]);if(new Set(b).size!==b.length)throw Error("Invalid certificate path: found duplicate certificates");for(let a=0;a<b.length-1;a++){let d=b[a],e=b[a+1];if(!await d.verify({publicKey:e.publicKey,signatureOnly:!0},c))throw new kv;if(e.subject===e.issuer){if(!await e.verify({publicKey:e.publicKey,signatureOnly:!0},c))throw new kv;break}}g=!1;break}catch(a){if(a instanceof kv)g=!0;else throw Error("Unexpected error while validating certificate path",{cause:a})}if(g)throw new kv;return!0}async function kt(a){if(await ko(a))throw Error("Found revoked certificate in certificate path")}function ku(a,b){let c=new Date(Date.now());if(a>c||b<c)throw Error("Certificate is not yet valid or expired")}class kv extends Error{constructor(){super("Subject issuer did not match issuer subject"),this.name="InvalidSubjectAndIssuer"}}function kw(a){let b;if("1.2.840.10045.4.3.2"===a)b=G.ES256;else if("1.2.840.10045.4.3.3"===a)b=G.ES384;else if("1.2.840.10045.4.3.4"===a)b=G.ES512;else if("1.2.840.113549.1.1.11"===a)b=G.RS256;else if("1.2.840.113549.1.1.12"===a)b=G.RS384;else if("1.2.840.113549.1.1.13"===a)b=G.RS512;else if("1.2.840.113549.1.1.5"===a)b=G.RS1;else throw Error(`Unable to map X.509 signature algorithm ${a} to a COSE algorithm`);return b}function kx(a){let b=new Map,{tbsCertificate:c}=eg.parse(a,fL),{subjectPublicKeyInfo:d,signature:e}=c,f=e.algorithm,g=d.algorithm.algorithm;if(g===gV){let a,c;if(!d.algorithm.parameters)throw Error("Certificate public key was missing parameters (EC2)");let e=eg.parse(new Uint8Array(d.algorithm.parameters),hb),g=-999,{namedCurve:h}=e;if(h===g_)g=F.P256;else if(h===g0)g=F.P384;else throw Error(`Certificate public key contained unexpected namedCurve ${h} (EC2)`);let i=new Uint8Array(d.subjectPublicKey);if(4===i[0]){let b=1,d=(i.length-1)/2;a=i.slice(b,b+=d),c=i.slice(b)}else throw Error('TODO: Figure out how to handle public keys in "compressed form"');let j=new Map;j.set(D.kty,E.EC2),j.set(D.alg,kw(f)),j.set(D.crv,g),j.set(D.x,a),j.set(D.y,c),b=j}else if(g===hf){let a=eg.parse(d.subjectPublicKey,hI),c=new Map;c.set(D.kty,E.RSA),c.set(D.alg,kw(f)),c.set(D.n,new Uint8Array(a.modulus)),c.set(D.e,new Uint8Array(a.publicExponent)),b=c}else throw Error(`Certificate public key contained unexpected algorithm ID ${g}`);return b}function ky(a){let{signature:b,data:c,credentialPublicKey:d,x509Certificate:e,hashAlgorithm:f}=a;if(!e&&!d)throw Error('Must declare either "leafCert" or "credentialPublicKey"');if(e&&d)throw Error('Must not declare both "leafCert" and "credentialPublicKey"');let g=new Map;return d?g=b2(d):e&&(g=kx(e)),kz.stubThis(function(a){let b,{cosePublicKey:c,signature:d,data:e,shaHashOverride:f}=a;if(bK(c)){let a,b,g,h,i=c.get(D.crv);if(!(Object.values(F).indexOf(i)>=0))throw Error(`unknown COSE curve ${i}`);return bV({cosePublicKey:c,signature:(b=new Uint8Array((a=eg.parse(d,hd)).r),g=new Uint8Array(a.s),kO([kL(b,h=function(a){switch(a){case F.P256:return 32;case F.P384:return 48;case F.P521:return 66;default:throw Error(`Unexpected COSE crv value of ${a} (EC2)`)}}(i)),kL(g,h)])),data:e,shaHashOverride:f})}if(bL(c))return bX({cosePublicKey:c,signature:d,data:e,shaHashOverride:f});if(bM(b=c.get(D.kty))&&b===E.OKP)return kK({cosePublicKey:c,signature:d,data:e});let g=c.get(D.kty);throw Error(`Signature verification with public key of kty ${g} is not supported by this method`)}({cosePublicKey:g,signature:b,data:c,shaHashOverride:f}))}let kz={stubThis:a=>a},kA=`-----BEGIN CERTIFICATE-----
9
+ MIIDdTCCAl2gAwIBAgILBAAAAAABFUtaw5QwDQYJKoZIhvcNAQEFBQAwVzELMAkG
10
+ A1UEBhMCQkUxGTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jv
11
+ b3QgQ0ExGzAZBgNVBAMTEkdsb2JhbFNpZ24gUm9vdCBDQTAeFw05ODA5MDExMjAw
12
+ MDBaFw0yODAxMjgxMjAwMDBaMFcxCzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9i
13
+ YWxTaWduIG52LXNhMRAwDgYDVQQLEwdSb290IENBMRswGQYDVQQDExJHbG9iYWxT
14
+ aWduIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDaDuaZ
15
+ jc6j40+Kfvvxi4Mla+pIH/EqsLmVEQS98GPR4mdmzxzdzxtIK+6NiY6arymAZavp
16
+ xy0Sy6scTHAHoT0KMM0VjU/43dSMUBUc71DuxC73/OlS8pF94G3VNTCOXkNz8kHp
17
+ 1Wrjsok6Vjk4bwY8iGlbKk3Fp1S4bInMm/k8yuX9ifUSPJJ4ltbcdG6TRGHRjcdG
18
+ snUOhugZitVtbNV4FpWi6cgKOOvyJBNPc1STE4U6G7weNLWLBYy5d4ux2x8gkasJ
19
+ U26Qzns3dLlwR5EiUWMWea6xrkEmCMgZK9FGqkjWZCrXgzT/LCrBbBlDSgeF59N8
20
+ 9iFo7+ryUp9/k5DPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8E
21
+ BTADAQH/MB0GA1UdDgQWBBRge2YaRQ2XyolQL30EzTSo//z9SzANBgkqhkiG9w0B
22
+ AQUFAAOCAQEA1nPnfE920I2/7LqivjTFKDK1fPxsnCwrvQmeU79rXqoRSLblCKOz
23
+ yj1hTdNGCbM+w6DjY1Ub8rrvrTnhQ7k4o+YviiY776BQVvnGCv04zcQLcFGUl5gE
24
+ 38NflNUVyRRBnMRddWQVDf9VMOyGj/8N7yy5Y0b2qvzfvGn9LhJIZJrglfCm7ymP
25
+ AbEVtQwdpf5pLGkkeB6zpxxxYu7KyJesF12KwvhHhm4qxFYxldBniYUr+WymXUad
26
+ DKqC5JlR3XC321Y9YeRq4VzW9v493kHMB65jUr9TU/Qr6cf9tveCX4XSQRjbgbME
27
+ HMUfpIBvFSDJ3gyICh3WZlXi/EjJKSZp4A==
28
+ -----END CERTIFICATE-----
29
+ `,kB=`-----BEGIN CERTIFICATE-----
30
+ MIIFYDCCA0igAwIBAgIJAOj6GWMU0voYMA0GCSqGSIb3DQEBCwUAMBsxGTAXBgNV
31
+ BAUTEGY5MjAwOWU4NTNiNmIwNDUwHhcNMTYwNTI2MTYyODUyWhcNMjYwNTI0MTYy
32
+ ODUyWjAbMRkwFwYDVQQFExBmOTIwMDllODUzYjZiMDQ1MIICIjANBgkqhkiG9w0B
33
+ AQEFAAOCAg8AMIICCgKCAgEAr7bHgiuxpwHsK7Qui8xUFmOr75gvMsd/dTEDDJdS
34
+ Sxtf6An7xyqpRR90PL2abxM1dEqlXnf2tqw1Ne4Xwl5jlRfdnJLmN0pTy/4lj4/7
35
+ tv0Sk3iiKkypnEUtR6WfMgH0QZfKHM1+di+y9TFRtv6y//0rb+T+W8a9nsNL/ggj
36
+ nar86461qO0rOs2cXjp3kOG1FEJ5MVmFmBGtnrKpa73XpXyTqRxB/M0n1n/W9nGq
37
+ C4FSYa04T6N5RIZGBN2z2MT5IKGbFlbC8UrW0DxW7AYImQQcHtGl/m00QLVWutHQ
38
+ oVJYnFPlXTcHYvASLu+RhhsbDmxMgJJ0mcDpvsC4PjvB+TxywElgS70vE0XmLD+O
39
+ JtvsBslHZvPBKCOdT0MS+tgSOIfga+z1Z1g7+DVagf7quvmag8jfPioyKvxnK/Eg
40
+ sTUVi2ghzq8wm27ud/mIM7AY2qEORR8Go3TVB4HzWQgpZrt3i5MIlCaY504LzSRi
41
+ igHCzAPlHws+W0rB5N+er5/2pJKnfBSDiCiFAVtCLOZ7gLiMm0jhO2B6tUXHI/+M
42
+ RPjy02i59lINMRRev56GKtcd9qO/0kUJWdZTdA2XoS82ixPvZtXQpUpuL12ab+9E
43
+ aDK8Z4RHJYYfCT3Q5vNAXaiWQ+8PTWm2QgBR/bkwSWc+NpUFgNPN9PvQi8WEg5Um
44
+ AGMCAwEAAaOBpjCBozAdBgNVHQ4EFgQUNmHhAHyIBQlRi0RsR/8aTMnqTxIwHwYD
45
+ VR0jBBgwFoAUNmHhAHyIBQlRi0RsR/8aTMnqTxIwDwYDVR0TAQH/BAUwAwEB/zAO
46
+ BgNVHQ8BAf8EBAMCAYYwQAYDVR0fBDkwNzA1oDOgMYYvaHR0cHM6Ly9hbmRyb2lk
47
+ Lmdvb2dsZWFwaXMuY29tL2F0dGVzdGF0aW9uL2NybC8wDQYJKoZIhvcNAQELBQAD
48
+ ggIBACDIw41L3KlXG0aMiS//cqrG+EShHUGo8HNsw30W1kJtjn6UBwRM6jnmiwfB
49
+ Pb8VA91chb2vssAtX2zbTvqBJ9+LBPGCdw/E53Rbf86qhxKaiAHOjpvAy5Y3m00m
50
+ qC0w/Zwvju1twb4vhLaJ5NkUJYsUS7rmJKHHBnETLi8GFqiEsqTWpG/6ibYCv7rY
51
+ DBJDcR9W62BW9jfIoBQcxUCUJouMPH25lLNcDc1ssqvC2v7iUgI9LeoM1sNovqPm
52
+ QUiG9rHli1vXxzCyaMTjwftkJLkf6724DFhuKug2jITV0QkXvaJWF4nUaHOTNA4u
53
+ JU9WDvZLI1j83A+/xnAJUucIv/zGJ1AMH2boHqF8CY16LpsYgBt6tKxxWH00XcyD
54
+ CdW2KlBCeqbQPcsFmWyWugxdcekhYsAWyoSf818NUsZdBWBaR/OukXrNLfkQ79Iy
55
+ ZohZbvabO/X+MVT3rriAoKc8oE2Uws6DF+60PV7/WIPjNvXySdqspImSN78mflxD
56
+ qwLqRBYkA3I75qppLGG9rp7UCdRjxMl8ZDBld+7yvHVgt1cVzJx9xnyGCC23Uaic
57
+ MDSXYrB4I4WHXPGjxhZuCuPBLTdOLU8YRvMYdEvYebWHMpvwGCF6bAx3JBpIeOQ1
58
+ wDB5y0USicV3YgYGmi+NZfhA4URSh77Yd6uuJOJENRaNVTzk
59
+ -----END CERTIFICATE-----
60
+ `,kC=`-----BEGIN CERTIFICATE-----
61
+ MIIFHDCCAwSgAwIBAgIJANUP8luj8tazMA0GCSqGSIb3DQEBCwUAMBsxGTAXBgNV
62
+ BAUTEGY5MjAwOWU4NTNiNmIwNDUwHhcNMTkxMTIyMjAzNzU4WhcNMzQxMTE4MjAz
63
+ NzU4WjAbMRkwFwYDVQQFExBmOTIwMDllODUzYjZiMDQ1MIICIjANBgkqhkiG9w0B
64
+ AQEFAAOCAg8AMIICCgKCAgEAr7bHgiuxpwHsK7Qui8xUFmOr75gvMsd/dTEDDJdS
65
+ Sxtf6An7xyqpRR90PL2abxM1dEqlXnf2tqw1Ne4Xwl5jlRfdnJLmN0pTy/4lj4/7
66
+ tv0Sk3iiKkypnEUtR6WfMgH0QZfKHM1+di+y9TFRtv6y//0rb+T+W8a9nsNL/ggj
67
+ nar86461qO0rOs2cXjp3kOG1FEJ5MVmFmBGtnrKpa73XpXyTqRxB/M0n1n/W9nGq
68
+ C4FSYa04T6N5RIZGBN2z2MT5IKGbFlbC8UrW0DxW7AYImQQcHtGl/m00QLVWutHQ
69
+ oVJYnFPlXTcHYvASLu+RhhsbDmxMgJJ0mcDpvsC4PjvB+TxywElgS70vE0XmLD+O
70
+ JtvsBslHZvPBKCOdT0MS+tgSOIfga+z1Z1g7+DVagf7quvmag8jfPioyKvxnK/Eg
71
+ sTUVi2ghzq8wm27ud/mIM7AY2qEORR8Go3TVB4HzWQgpZrt3i5MIlCaY504LzSRi
72
+ igHCzAPlHws+W0rB5N+er5/2pJKnfBSDiCiFAVtCLOZ7gLiMm0jhO2B6tUXHI/+M
73
+ RPjy02i59lINMRRev56GKtcd9qO/0kUJWdZTdA2XoS82ixPvZtXQpUpuL12ab+9E
74
+ aDK8Z4RHJYYfCT3Q5vNAXaiWQ+8PTWm2QgBR/bkwSWc+NpUFgNPN9PvQi8WEg5Um
75
+ AGMCAwEAAaNjMGEwHQYDVR0OBBYEFDZh4QB8iAUJUYtEbEf/GkzJ6k8SMB8GA1Ud
76
+ IwQYMBaAFDZh4QB8iAUJUYtEbEf/GkzJ6k8SMA8GA1UdEwEB/wQFMAMBAf8wDgYD
77
+ VR0PAQH/BAQDAgIEMA0GCSqGSIb3DQEBCwUAA4ICAQBOMaBc8oumXb2voc7XCWnu
78
+ XKhBBK3e2KMGz39t7lA3XXRe2ZLLAkLM5y3J7tURkf5a1SutfdOyXAmeE6SRo83U
79
+ h6WszodmMkxK5GM4JGrnt4pBisu5igXEydaW7qq2CdC6DOGjG+mEkN8/TA6p3cno
80
+ L/sPyz6evdjLlSeJ8rFBH6xWyIZCbrcpYEJzXaUOEaxxXxgYz5/cTiVKN2M1G2ok
81
+ QBUIYSY6bjEL4aUN5cfo7ogP3UvliEo3Eo0YgwuzR2v0KR6C1cZqZJSTnghIC/vA
82
+ D32KdNQ+c3N+vl2OTsUVMC1GiWkngNx1OO1+kXW+YTnnTUOtOIswUP/Vqd5SYgAI
83
+ mMAfY8U9/iIgkQj6T2W6FsScy94IN9fFhE1UtzmLoBIuUFsVXJMTz+Jucth+IqoW
84
+ Fua9v1R93/k98p41pjtFX+H8DslVgfP097vju4KDlqN64xV1grw3ZLl4CiOe/A91
85
+ oeLm2UHOq6wn3esB4r2EIQKb6jTVGu5sYCcdWpXr0AUVqcABPdgL+H7qJguBw09o
86
+ jm6xNIrw2OocrDKsudk/okr/AwqEyPKw9WnMlQgLIKw1rODG2NvU9oR3GVGdMkUB
87
+ ZutL8VuFkERQGt6vQ2OCw0sV47VMkuYbacK/xyZFiRcrPJPb41zgbQj9XAEyLKCH
88
+ ex0SdDrx+tWUDqG8At2JHA==
89
+ -----END CERTIFICATE-----
90
+ `,kD=`
91
+ -----BEGIN CERTIFICATE-----
92
+ MIIFHDCCAwSgAwIBAgIJAMNrfES5rhgxMA0GCSqGSIb3DQEBCwUAMBsxGTAXBgNV
93
+ BAUTEGY5MjAwOWU4NTNiNmIwNDUwHhcNMjExMTE3MjMxMDQyWhcNMzYxMTEzMjMx
94
+ MDQyWjAbMRkwFwYDVQQFExBmOTIwMDllODUzYjZiMDQ1MIICIjANBgkqhkiG9w0B
95
+ AQEFAAOCAg8AMIICCgKCAgEAr7bHgiuxpwHsK7Qui8xUFmOr75gvMsd/dTEDDJdS
96
+ Sxtf6An7xyqpRR90PL2abxM1dEqlXnf2tqw1Ne4Xwl5jlRfdnJLmN0pTy/4lj4/7
97
+ tv0Sk3iiKkypnEUtR6WfMgH0QZfKHM1+di+y9TFRtv6y//0rb+T+W8a9nsNL/ggj
98
+ nar86461qO0rOs2cXjp3kOG1FEJ5MVmFmBGtnrKpa73XpXyTqRxB/M0n1n/W9nGq
99
+ C4FSYa04T6N5RIZGBN2z2MT5IKGbFlbC8UrW0DxW7AYImQQcHtGl/m00QLVWutHQ
100
+ oVJYnFPlXTcHYvASLu+RhhsbDmxMgJJ0mcDpvsC4PjvB+TxywElgS70vE0XmLD+O
101
+ JtvsBslHZvPBKCOdT0MS+tgSOIfga+z1Z1g7+DVagf7quvmag8jfPioyKvxnK/Eg
102
+ sTUVi2ghzq8wm27ud/mIM7AY2qEORR8Go3TVB4HzWQgpZrt3i5MIlCaY504LzSRi
103
+ igHCzAPlHws+W0rB5N+er5/2pJKnfBSDiCiFAVtCLOZ7gLiMm0jhO2B6tUXHI/+M
104
+ RPjy02i59lINMRRev56GKtcd9qO/0kUJWdZTdA2XoS82ixPvZtXQpUpuL12ab+9E
105
+ aDK8Z4RHJYYfCT3Q5vNAXaiWQ+8PTWm2QgBR/bkwSWc+NpUFgNPN9PvQi8WEg5Um
106
+ AGMCAwEAAaNjMGEwHQYDVR0OBBYEFDZh4QB8iAUJUYtEbEf/GkzJ6k8SMB8GA1Ud
107
+ IwQYMBaAFDZh4QB8iAUJUYtEbEf/GkzJ6k8SMA8GA1UdEwEB/wQFMAMBAf8wDgYD
108
+ VR0PAQH/BAQDAgIEMA0GCSqGSIb3DQEBCwUAA4ICAQBTNNZe5cuf8oiq+jV0itTG
109
+ zWVhSTjOBEk2FQvh11J3o3lna0o7rd8RFHnN00q4hi6TapFhh4qaw/iG6Xg+xOan
110
+ 63niLWIC5GOPFgPeYXM9+nBb3zZzC8ABypYuCusWCmt6Tn3+Pjbz3MTVhRGXuT/T
111
+ QH4KGFY4PhvzAyXwdjTOCXID+aHud4RLcSySr0Fq/L+R8TWalvM1wJJPhyRjqRCJ
112
+ erGtfBagiALzvhnmY7U1qFcS0NCnKjoO7oFedKdWlZz0YAfu3aGCJd4KHT0MsGiL
113
+ Zez9WP81xYSrKMNEsDK+zK5fVzw6jA7cxmpXcARTnmAuGUeI7VVDhDzKeVOctf3a
114
+ 0qQLwC+d0+xrETZ4r2fRGNw2YEs2W8Qj6oDcfPvq9JySe7pJ6wcHnl5EZ0lwc4xH
115
+ 7Y4Dx9RA1JlfooLMw3tOdJZH0enxPXaydfAD3YifeZpFaUzicHeLzVJLt9dvGB0b
116
+ HQLE4+EqKFgOZv2EoP686DQqbVS1u+9k0p2xbMA105TBIk7npraa8VM0fnrRKi7w
117
+ lZKwdH+aNAyhbXRW9xsnODJ+g8eF452zvbiKKngEKirK5LGieoXBX7tZ9D1GNBH2
118
+ Ob3bKOwwIWdEFle/YF/h6zWgdeoaNGDqVBrLr2+0DtWoiB1aDEjLWl9FmyIUyUm7
119
+ mD/vFDkzF+wm7cyWpQpCVQ==
120
+ -----END CERTIFICATE-----
121
+ `,kE=`
122
+ -----BEGIN CERTIFICATE-----
123
+ MIIFHDCCAwSgAwIBAgIJAPHBcqaZ6vUdMA0GCSqGSIb3DQEBCwUAMBsxGTAXBgNV
124
+ BAUTEGY5MjAwOWU4NTNiNmIwNDUwHhcNMjIwMzIwMTgwNzQ4WhcNNDIwMzE1MTgw
125
+ NzQ4WjAbMRkwFwYDVQQFExBmOTIwMDllODUzYjZiMDQ1MIICIjANBgkqhkiG9w0B
126
+ AQEFAAOCAg8AMIICCgKCAgEAr7bHgiuxpwHsK7Qui8xUFmOr75gvMsd/dTEDDJdS
127
+ Sxtf6An7xyqpRR90PL2abxM1dEqlXnf2tqw1Ne4Xwl5jlRfdnJLmN0pTy/4lj4/7
128
+ tv0Sk3iiKkypnEUtR6WfMgH0QZfKHM1+di+y9TFRtv6y//0rb+T+W8a9nsNL/ggj
129
+ nar86461qO0rOs2cXjp3kOG1FEJ5MVmFmBGtnrKpa73XpXyTqRxB/M0n1n/W9nGq
130
+ C4FSYa04T6N5RIZGBN2z2MT5IKGbFlbC8UrW0DxW7AYImQQcHtGl/m00QLVWutHQ
131
+ oVJYnFPlXTcHYvASLu+RhhsbDmxMgJJ0mcDpvsC4PjvB+TxywElgS70vE0XmLD+O
132
+ JtvsBslHZvPBKCOdT0MS+tgSOIfga+z1Z1g7+DVagf7quvmag8jfPioyKvxnK/Eg
133
+ sTUVi2ghzq8wm27ud/mIM7AY2qEORR8Go3TVB4HzWQgpZrt3i5MIlCaY504LzSRi
134
+ igHCzAPlHws+W0rB5N+er5/2pJKnfBSDiCiFAVtCLOZ7gLiMm0jhO2B6tUXHI/+M
135
+ RPjy02i59lINMRRev56GKtcd9qO/0kUJWdZTdA2XoS82ixPvZtXQpUpuL12ab+9E
136
+ aDK8Z4RHJYYfCT3Q5vNAXaiWQ+8PTWm2QgBR/bkwSWc+NpUFgNPN9PvQi8WEg5Um
137
+ AGMCAwEAAaNjMGEwHQYDVR0OBBYEFDZh4QB8iAUJUYtEbEf/GkzJ6k8SMB8GA1Ud
138
+ IwQYMBaAFDZh4QB8iAUJUYtEbEf/GkzJ6k8SMA8GA1UdEwEB/wQFMAMBAf8wDgYD
139
+ VR0PAQH/BAQDAgIEMA0GCSqGSIb3DQEBCwUAA4ICAQB8cMqTllHc8U+qCrOlg3H7
140
+ 174lmaCsbo/bJ0C17JEgMLb4kvrqsXZs01U3mB/qABg/1t5Pd5AORHARs1hhqGIC
141
+ W/nKMav574f9rZN4PC2ZlufGXb7sIdJpGiO9ctRhiLuYuly10JccUZGEHpHSYM2G
142
+ tkgYbZba6lsCPYAAP83cyDV+1aOkTf1RCp/lM0PKvmxYN10RYsK631jrleGdcdkx
143
+ oSK//mSQbgcWnmAEZrzHoF1/0gso1HZgIn0YLzVhLSA/iXCX4QT2h3J5z3znluKG
144
+ 1nv8NQdxei2DIIhASWfu804CA96cQKTTlaae2fweqXjdN1/v2nqOhngNyz1361mF
145
+ mr4XmaKH/ItTwOe72NI9ZcwS1lVaCvsIkTDCEXdm9rCNPAY10iTunIHFXRh+7KPz
146
+ lHGewCq/8TOohBRn0/NNfh7uRslOSZ/xKbN9tMBtw37Z8d2vvnXq/YWdsm1+JLVw
147
+ n6yYD/yacNJBlwpddla8eaVMjsF6nBnIgQOf9zKSe06nSTqvgwUHosgOECZJZ1Eu
148
+ zbH4yswbt02tKtKEFhx+v+OTge/06V+jGsqTWLsfrOCNLuA8H++z+pUENmpqnnHo
149
+ vaI47gC+TNpkgYGkkBT6B/m/U01BuOBBTzhIlMEZq9qkDWuM2cA5kW5V3FJUcfHn
150
+ w1IdYIg2Wxg7yHcQZemFQg==
151
+ -----END CERTIFICATE-----
152
+ `,kF=`-----BEGIN CERTIFICATE-----
153
+ MIICEjCCAZmgAwIBAgIQaB0BbHo84wIlpQGUKEdXcTAKBggqhkjOPQQDAzBLMR8w
154
+ HQYDVQQDDBZBcHBsZSBXZWJBdXRobiBSb290IENBMRMwEQYDVQQKDApBcHBsZSBJ
155
+ bmMuMRMwEQYDVQQIDApDYWxpZm9ybmlhMB4XDTIwMDMxODE4MjEzMloXDTQ1MDMx
156
+ NTAwMDAwMFowSzEfMB0GA1UEAwwWQXBwbGUgV2ViQXV0aG4gUm9vdCBDQTETMBEG
157
+ A1UECgwKQXBwbGUgSW5jLjETMBEGA1UECAwKQ2FsaWZvcm5pYTB2MBAGByqGSM49
158
+ AgEGBSuBBAAiA2IABCJCQ2pTVhzjl4Wo6IhHtMSAzO2cv+H9DQKev3//fG59G11k
159
+ xu9eI0/7o6V5uShBpe1u6l6mS19S1FEh6yGljnZAJ+2GNP1mi/YK2kSXIuTHjxA/
160
+ pcoRf7XkOtO4o1qlcaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUJtdk
161
+ 2cV4wlpn0afeaxLQG2PxxtcwDgYDVR0PAQH/BAQDAgEGMAoGCCqGSM49BAMDA2cA
162
+ MGQCMFrZ+9DsJ1PW9hfNdBywZDsWDbWFp28it1d/5w2RPkRX3Bbn/UbDTNLx7Jr3
163
+ jAGGiQIwHFj+dJZYUJR786osByBelJYsVZd2GbHQu209b5RCmGQ21gpSAk9QZW4B
164
+ 1bWeT0vT
165
+ -----END CERTIFICATE-----
166
+ `,kG=`-----BEGIN CERTIFICATE-----
167
+ MIIDXzCCAkegAwIBAgILBAAAAAABIVhTCKIwDQYJKoZIhvcNAQELBQAwTDEgMB4G
168
+ A1UECxMXR2xvYmFsU2lnbiBSb290IENBIC0gUjMxEzARBgNVBAoTCkdsb2JhbFNp
169
+ Z24xEzARBgNVBAMTCkdsb2JhbFNpZ24wHhcNMDkwMzE4MTAwMDAwWhcNMjkwMzE4
170
+ MTAwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMzETMBEG
171
+ A1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjCCASIwDQYJKoZI
172
+ hvcNAQEBBQADggEPADCCAQoCggEBAMwldpB5BngiFvXAg7aEyiie/QV2EcWtiHL8
173
+ RgJDx7KKnQRfJMsuS+FggkbhUqsMgUdwbN1k0ev1LKMPgj0MK66X17YUhhB5uzsT
174
+ gHeMCOFJ0mpiLx9e+pZo34knlTifBtc+ycsmWQ1z3rDI6SYOgxXG71uL0gRgykmm
175
+ KPZpO/bLyCiR5Z2KYVc3rHQU3HTgOu5yLy6c+9C7v/U9AOEGM+iCK65TpjoWc4zd
176
+ QQ4gOsC0p6Hpsk+QLjJg6VfLuQSSaGjlOCZgdbKfd/+RFO+uIEn8rUAVSNECMWEZ
177
+ XriX7613t2Saer9fwRPvm2L7DWzgVGkWqQPabumDk3F2xmmFghcCAwEAAaNCMEAw
178
+ DgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFI/wS3+o
179
+ LkUkrk1Q+mOai97i3Ru8MA0GCSqGSIb3DQEBCwUAA4IBAQBLQNvAUKr+yAzv95ZU
180
+ RUm7lgAJQayzE4aGKAczymvmdLm6AC2upArT9fHxD4q/c2dKg8dEe3jgr25sbwMp
181
+ jjM5RcOO5LlXbKr8EpbsU8Yt5CRsuZRj+9xTaGdWPoO4zzUhw8lo/s7awlOqzJCK
182
+ 6fBdRoyV3XpYKBovHd7NADdBj+1EbddTKJd+82cEHhXXipa0095MJ6RMG3NzdvQX
183
+ mcIfeg7jLQitChws/zyrVQ4PkX4268NXSb7hLi18YIvDQVETI53O9zJrlAGomecs
184
+ Mx86OyXShkDOOyyGeMlhLxS67ttVb9+E7gUJTb0o2HLO02JQZR7rkpeDMdmztcpH
185
+ WD9f
186
+ -----END CERTIFICATE-----
187
+ `;class kH{constructor(){Object.defineProperty(this,"pemCertificates",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.pemCertificates=new Map}setRootCertificates(a){let{identifier:b,certificates:c}=a,d=[];for(let a of c)a instanceof Uint8Array?d.push(bZ(a)):d.push(a);this.pemCertificates.set(b,d)}getRootCertificates(a){let{identifier:b}=a;return this.pemCertificates.get(b)??[]}}let kI=new kH;async function kJ(a){let b,c=[JSON.parse(bx((b=a.split("."))[0])),JSON.parse(bx(b[1])),b[2]],d=c[0],e=c[1],f=d.x5c.map(bZ);try{let a=kI.getRootCertificates({identifier:"mds"});await ks(f,a)}catch(a){throw Error("BLOB certificate path could not be validated",{cause:a})}let g=f[0];if(!await function(a,b){let[c,d,e]=a.split("."),f=kx(b),g=kP(`${c}.${d}`),h=bv(e);if(bK(f))return bV({data:g,signature:h,cosePublicKey:f,shaHashOverride:G.ES256});if(bL(f))return bX({data:g,signature:h,cosePublicKey:f});let i=f.get(D.kty);throw Error(`JWT verification with public key of kty ${i} is not supported by this method`)}(a,bv(g.replace("-----BEGIN CERTIFICATE-----","").replace("-----END CERTIFICATE-----","").replace(/[\n ]/g,""),"base64")))throw Error("BLOB signature could not be verified");let h=[];for(let a of e.entries)a.aaguid&&a.metadataStatement&&h.push(a.metadataStatement);let[i,j,k]=e.nextUpdate.split("-");return{statements:h,parsedNextUpdate:new Date(parseInt(i,10),parseInt(j,10)-1,parseInt(k,10)),payload:e}}async function kK(a){let b,{cosePublicKey:c,signature:d,data:e}=a,f=await bP(),g=c.get(D.alg),h=c.get(D.crv),i=c.get(D.x);if(!g)throw Error("Public key was missing alg (OKP)");if(!bN(g))throw Error(`Public key had invalid alg ${g} (OKP)`);if(!h)throw Error("Public key was missing crv (OKP)");if(!i)throw Error("Public key was missing x (OKP)");if(h===F.ED25519)b="Ed25519";else throw Error(`Unexpected COSE crv value of ${h} (OKP)`);let j={kty:"OKP",crv:b,alg:"EdDSA",x:bw(i),ext:!1},k={name:b,namedCurve:b},l=await bU({keyData:j,algorithm:k}),m={name:b};return f.subtle.verify(m,l,d,e)}function kL(a,b){let c;if(a.length<b)(c=new Uint8Array(b)).set(a,b-a.length);else if(a.length===b)c=a;else if(a.length===b+1&&0===a[0]&&(128&a[1])==128)c=a.subarray(1);else throw Error(`Invalid signature component length ${a.length}, expected ${b}`);return c}function kM(a,b){return a.length==b.length&&a.every((a,c)=>a===b[c])}function kN(a){return Array.from(a,a=>a.toString(16).padStart(2,"0")).join("")}function kO(a){let b=0,c=new Uint8Array(a.reduce((a,b)=>a+b.length,0));return a.forEach(a=>{c.set(a,b),b+=a.length}),c}function kP(a){return new globalThis.TextEncoder().encode(a)}function kQ(a){return new DataView(a.buffer,a.byteOffset,a.length)}async function kR(){let a=new Uint8Array(32);return await bT(a),kS.stubThis(a)}kI.setRootCertificates({identifier:"android-key",certificates:[kB,kC,kD,kE]}),kI.setRootCertificates({identifier:"android-safetynet",certificates:[kA]}),kI.setRootCertificates({identifier:"apple",certificates:[kF]}),kI.setRootCertificates({identifier:"mds",certificates:[kG]});let kS={stubThis:a=>a},kT=[-8,-7,-36,-37,-38,-39,-257,-258,-259,-65535],kU={residentKey:"preferred",userVerification:"preferred"},kV=[-8,-7,-257];async function kW(a){let{rpName:b,rpID:c,userName:d,userID:e,challenge:f=await kR(),userDisplayName:g="",timeout:h=6e4,attestationType:i="none",excludeCredentials:j=[],authenticatorSelection:k=kU,extensions:l,supportedAlgorithmIDs:m=kV,preferredAuthenticatorType:n}=a,o=m.map(a=>({alg:a,type:"public-key"}));void 0===k.residentKey?k.requireResidentKey&&(k.residentKey="required"):k.requireResidentKey="required"===k.residentKey;let p=f;if("string"==typeof p&&(p=kP(p)),"string"==typeof e)throw Error("String values for `userID` are no longer supported. See https://simplewebauthn.dev/docs/advanced/server/custom-user-ids");let q=e;q||(q=await b4());let r=[];return n&&("securityKey"===n?(r.push("security-key"),k.authenticatorAttachment="cross-platform"):"localDevice"===n?(r.push("client-device"),k.authenticatorAttachment="platform"):"remoteDevice"===n&&(r.push("hybrid"),k.authenticatorAttachment="cross-platform")),{challenge:bw(p),rp:{name:b,id:c},user:{id:bw(q),name:d,displayName:g},pubKeyCredParams:o,timeout:h,attestation:i,excludeCredentials:j.map(a=>{if(!by(a.id))throw Error(`excludeCredential id "${a.id}" is not a valid base64url string`);return{...a,id:bz(a.id),type:"public-key"}}),authenticatorSelection:k,extensions:{...l,credProps:!0},hints:r}}function kX({be:a,bs:b}){let c="singleDevice";if(a&&(c="multiDevice"),"singleDevice"===c&&b)throw new kY("Single-device credential indicated that it was backed up, which should be impossible.");return{credentialDeviceType:c,credentialBackedUp:b}}class kY extends Error{constructor(a){super(a),this.name="InvalidBackupFlags"}}async function kZ(a,b){try{return await Promise.any(b.map(b=>new Promise((c,d)=>{kr(Uint8Array.from(b.split("").map(a=>a.charCodeAt(0)))).then(e=>{kM(a,e)?c(b):d()})})))}catch(a){if("AggregateError"===a.name)throw new k$;throw a}}class k$ extends Error{constructor(){super("Unexpected RP ID hash"),this.name="UnexpectedRPIDHash"}}async function k_(a){let{attStmt:b,clientDataHash:c,rpIdHash:d,credentialID:e,credentialPublicKey:f,aaguid:g,rootCertificates:h}=a,i=kO([Uint8Array.from([0]),d,c,e,b$(f)]),j=b.get("sig"),k=b.get("x5c");if(!k)throw Error("No attestation certificate provided in attestation statement (FIDOU2F)");if(!j)throw Error("No attestation signature provided in attestation statement (FIDOU2F)");let l=Number.parseInt(kN(g),16);if(0!==l)throw Error(`AAGUID "${l}" was not expected value`);try{await ks(k.map(bZ),h)}catch(a){throw Error(`${a.message} (FIDOU2F)`)}return ky({signature:j,data:i,x509Certificate:k[0],hashAlgorithm:G.ES256})}let k0="1.3.6.1.4.1.45724.1.1.4";function k1(a,b){if(!a)return!0;let c=a.find(a=>a.extnID===k0);if(!c)return!0;let d=new Uint8Array(eg.parse(c.extnValue,dM).buffer);if(!kM(b,d)){let a=kN(d),c=kN(b);throw Error(`Certificate extension id-fido-gen-ce-aaguid (${k0}) value of "${a}" was present but not equal to attestation statement AAGUID value of "${c}"`)}return!0}let k2={url:"",no:0,nextUpdate:new Date(0)};(z=bg||(bg={}))[z.DISABLED=0]="DISABLED",z[z.REFRESHING=1]="REFRESHING",z[z.READY=2]="READY";let k3=(a,...b)=>{};class k4{constructor(){Object.defineProperty(this,"mdsCache",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"statementCache",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:bg.DISABLED}),Object.defineProperty(this,"verificationMode",{enumerable:!0,configurable:!0,writable:!0,value:"strict"})}async initialize(a={}){this.statementCache={};let{mdsServers:b=["https://mds.fidoalliance.org/"],statements:c,verificationMode:d}=a;if(this.setState(bg.REFRESHING),c?.length){let a=0;c.forEach(b=>{b.aaguid&&(this.statementCache[b.aaguid]={entry:{metadataStatement:b,statusReports:[],timeOfLastStatusChange:"1970-01-01"},url:k2.url},a+=1)}),k3(`Cached ${a} local statements`)}if(b?.length){let a=Object.keys(this.statementCache).length,c=b.length;for(let a of b)try{let b={url:a,no:0,nextUpdate:new Date(0)},c=await this.downloadBlob(b);await this.verifyBlob(c,b)}catch(b){k3(`Could not download BLOB from ${a}:`,b),c-=1}let d=Object.keys(this.statementCache).length;k3(`Cached ${d-a} statements from ${c} metadata server(s)`)}d&&(this.verificationMode=d),this.setState(bg.READY)}async getStatement(a){if(this.state===bg.DISABLED||!a)return;a instanceof Uint8Array&&(a=bY(a)),await this.pauseUntilReady();let b=this.statementCache[a];if(!b){if("strict"===this.verificationMode)throw Error(`No metadata statement found for aaguid "${a}"`);return}if(b.url){let a=this.mdsCache[b.url];if(new Date>a.nextUpdate)try{this.setState(bg.REFRESHING);let b=await this.downloadBlob(a);await this.verifyBlob(b,a)}finally{this.setState(bg.READY)}}let{entry:c}=b;for(let b of c.statusReports){let{status:c}=b;if("USER_VERIFICATION_BYPASS"===c||"ATTESTATION_KEY_COMPROMISE"===c||"USER_KEY_REMOTE_COMPROMISE"===c||"USER_KEY_PHYSICAL_COMPROMISE"===c)throw Error(`Detected compromised aaguid "${a}"`)}return c.metadataStatement}async downloadBlob(a){let{url:b}=a,c=await kl(b);return await c.text()}async verifyBlob(a,b){let{url:c,no:d}=b,{payload:e,parsedNextUpdate:f}=await kJ(a);if(e.no<=d)throw Error(`Latest BLOB no. ${e.no} is not greater than previous no. ${d}`);for(let a of e.entries)a.aaguid&&(this.statementCache[a.aaguid]={entry:a,url:c});c?this.mdsCache[c]={...b,no:e.no,nextUpdate:f}:f<new Date&&k3(`⚠️ This MDS blob (serial: ${e.no}) contains stale data as of ${f.toISOString()}. Please consider re-initializing MetadataService with a newer MDS blob.`)}pauseUntilReady(){return new Promise(this.state===bg.READY?a=>{a()}:(a,b)=>{let c=700,d=globalThis.setInterval(()=>{c<1?(clearInterval(d),b("State did not become ready in 70 seconds")):this.state===bg.READY&&(clearInterval(d),a()),c-=1},100)})}setState(a){this.state=a,a===bg.DISABLED?k3("MetadataService is DISABLED"):a===bg.REFRESHING?k3("MetadataService is REFRESHING"):a===bg.READY&&k3("MetadataService is READY")}}let k5=new k4;async function k6({statement:a,credentialPublicKey:b,x5c:c,attestationStatementAlg:d}){let{authenticationAlgorithms:e,authenticatorGetInfo:f,attestationRootCertificates:g}=a,h=new Set;e.forEach(a=>{let b=k7[a];b&&h.add(b)});let i=b2(b),j=i.get(D.kty),k=i.get(D.alg);if(!j)throw Error("Credential public key was missing kty");if(!k)throw Error("Credential public key was missing alg");if(!j)throw Error("Credential public key was missing kty");let l={kty:j,alg:k};bK(i)&&(l.crv=i.get(D.crv));let m=!1;for(let a of h)if(a.alg===l.alg&&a.kty===l.kty&&((a.kty===E.EC2||a.kty===E.OKP)&&a.crv===l.crv,m=!0),m)break;if(!m){let a=JSON.stringify(e.map(a=>`'${a}' (COSE info: ${k8(k7[a])})`),null,2).replace(/"/g,""),b=k8(l);throw Error(`Public key parameters ${b} did not match any of the following metadata algorithms:
188
+ ${a}`)}if(void 0!==d&&f?.algorithms!==void 0){let a=f.algorithms.map(a=>a.alg);if(0>a.indexOf(d))throw Error(`Attestation statement alg ${d} did not match one of ${a}`)}let n=c.map(bZ),o=g.map(bZ),p=!1;if(1===n.length&&o.indexOf(n[0])>=0&&(p=!0),!p)try{await ks(n,o)}catch(a){throw Error(`Could not validate certificate path with any metadata root certificates: ${a.message}`)}return!0}let k7={secp256r1_ecdsa_sha256_raw:{kty:2,alg:-7,crv:1},secp256r1_ecdsa_sha256_der:{kty:2,alg:-7,crv:1},rsassa_pss_sha256_raw:{kty:3,alg:-37},rsassa_pss_sha256_der:{kty:3,alg:-37},secp256k1_ecdsa_sha256_raw:{kty:2,alg:-47,crv:8},secp256k1_ecdsa_sha256_der:{kty:2,alg:-47,crv:8},rsassa_pss_sha384_raw:{kty:3,alg:-38},rsassa_pkcsv15_sha256_raw:{kty:3,alg:-257},rsassa_pkcsv15_sha384_raw:{kty:3,alg:-258},rsassa_pkcsv15_sha512_raw:{kty:3,alg:-259},rsassa_pkcsv15_sha1_raw:{kty:3,alg:-65535},secp384r1_ecdsa_sha384_raw:{kty:2,alg:-35,crv:2},secp512r1_ecdsa_sha256_raw:{kty:2,alg:-36,crv:3},ed25519_eddsa_sha512_raw:{kty:1,alg:-8,crv:6}};function k8(a){let{kty:b,alg:c,crv:d}=a;return b!==E.RSA?`{ kty: ${b}, alg: ${c}, crv: ${d} }`:`{ kty: ${b}, alg: ${c} }`}async function k9(a){let{attStmt:b,clientDataHash:c,authData:d,credentialPublicKey:e,aaguid:f,rootCertificates:g}=a,h=b.get("sig"),i=b.get("x5c"),j=b.get("alg");if(!h)throw Error("No attestation signature provided in attestation statement (Packed)");if(!j)throw Error("Attestation statement did not contain alg (Packed)");if(!bN(j))throw Error(`Attestation statement contained invalid alg ${j} (Packed)`);let k=kO([d,c]),l=!1;if(i){let{subject:a,basicConstraintsCA:b,version:c,notBefore:d,notAfter:m,parsedCertificate:n}=fQ(i[0]),{OU:o,CN:p,O:q,C:r}=a;if("Authenticator Attestation"!==o)throw Error('Certificate OU was not "Authenticator Attestation" (Packed|Full)');if(!p)throw Error("Certificate CN was empty (Packed|Full)");if(!q)throw Error("Certificate O was empty (Packed|Full)");if(!r||2!==r.length)throw Error("Certificate C was not two-character ISO 3166 code (Packed|Full)");if(b)throw Error("Certificate basic constraints CA was not `false` (Packed|Full)");if(2!==c)throw Error("Certificate version was not `3` (ASN.1 value of 2) (Packed|Full)");let s=new Date;if(d>s)throw Error(`Certificate not good before "${d.toString()}" (Packed|Full)`);if(m<(s=new Date))throw Error(`Certificate not good after "${m.toString()}" (Packed|Full)`);try{await k1(n.tbsCertificate.extensions,f)}catch(a){throw Error(`${a.message} (Packed|Full)`)}let t=await k5.getStatement(f);if(t){if(0>t.attestationTypes.indexOf("basic_full"))throw Error("Metadata does not indicate support for full attestations (Packed|Full)");try{await k6({statement:t,credentialPublicKey:e,x5c:i,attestationStatementAlg:j})}catch(a){throw Error(`${a.message} (Packed|Full)`)}}else try{await ks(i.map(bZ),g)}catch(a){throw Error(`${a.message} (Packed|Full)`)}l=await ky({signature:h,data:k,x509Certificate:i[0],hashAlgorithm:j})}else l=await ky({signature:h,data:k,credentialPublicKey:e,hashAlgorithm:j});return l}async function la(a){let{attStmt:b,clientDataHash:c,authData:d,aaguid:e,rootCertificates:f,verifyTimestampMS:g=!0,credentialPublicKey:h,attestationSafetyNetEnforceCTSCheck:i}=a,j=b.get("alg"),k=b.get("response");if(!b.get("ver"))throw Error("No ver value in attestation (SafetyNet)");if(!k)throw Error("No response was included in attStmt by authenticator (SafetyNet)");let l=new globalThis.TextDecoder("utf-8").decode(k).split("."),m=JSON.parse(bx(l[0])),n=JSON.parse(bx(l[1])),o=l[2],{nonce:p,ctsProfileMatch:q,timestampMs:r}=n;if(g){let a=Date.now();if(r>Date.now())throw Error(`Payload timestamp "${r}" was later than "${a}" (SafetyNet)`);let b=r+6e4;if(b<(a=Date.now()))throw Error(`Payload timestamp "${b}" has expired (SafetyNet)`)}let s=kO([d,c]);if(p!==bw(await kr(s),"base64"))throw Error("Could not verify payload nonce (SafetyNet)");if(i&&!q)throw Error("Could not verify device integrity (SafetyNet)");let t=bv(m.x5c[0],"base64"),{subject:u}=fQ(t);if("attest.android.com"!==u.CN)throw Error('Certificate common name was not "attest.android.com" (SafetyNet)');let v=await k5.getStatement(e);if(v)try{await k6({statement:v,credentialPublicKey:h,x5c:m.x5c,attestationStatementAlg:j})}catch(a){throw Error(`${a.message} (SafetyNet)`)}else try{await ks(m.x5c.map(bZ),f)}catch(a){throw Error(`${a.message} (SafetyNet)`)}let w=kP(`${l[0]}.${l[1]}`),x=bv(o);return await ky({signature:x,data:w,x509Certificate:t,hashAlgorithm:j})}let lb={196:"TPM_ST_RSP_COMMAND",32768:"TPM_ST_NULL",32769:"TPM_ST_NO_SESSIONS",32770:"TPM_ST_SESSIONS",32788:"TPM_ST_ATTEST_NV",32789:"TPM_ST_ATTEST_COMMAND_AUDIT",32790:"TPM_ST_ATTEST_SESSION_AUDIT",32791:"TPM_ST_ATTEST_CERTIFY",32792:"TPM_ST_ATTEST_QUOTE",32793:"TPM_ST_ATTEST_TIME",32794:"TPM_ST_ATTEST_CREATION",32801:"TPM_ST_CREATION",32802:"TPM_ST_VERIFIED",32803:"TPM_ST_AUTH_SECRET",32804:"TPM_ST_HASHCHECK",32805:"TPM_ST_AUTH_SIGNED",32809:"TPM_ST_FU_MANIFEST"},lc={0:"TPM_ALG_ERROR",1:"TPM_ALG_RSA",4:"TPM_ALG_SHA",4:"TPM_ALG_SHA1",5:"TPM_ALG_HMAC",6:"TPM_ALG_AES",7:"TPM_ALG_MGF1",8:"TPM_ALG_KEYEDHASH",10:"TPM_ALG_XOR",11:"TPM_ALG_SHA256",12:"TPM_ALG_SHA384",13:"TPM_ALG_SHA512",16:"TPM_ALG_NULL",18:"TPM_ALG_SM3_256",19:"TPM_ALG_SM4",20:"TPM_ALG_RSASSA",21:"TPM_ALG_RSAES",22:"TPM_ALG_RSAPSS",23:"TPM_ALG_OAEP",24:"TPM_ALG_ECDSA",25:"TPM_ALG_ECDH",26:"TPM_ALG_ECDAA",27:"TPM_ALG_SM2",28:"TPM_ALG_ECSCHNORR",29:"TPM_ALG_ECMQV",32:"TPM_ALG_KDF1_SP800_56A",33:"TPM_ALG_KDF2",34:"TPM_ALG_KDF1_SP800_108",35:"TPM_ALG_ECC",37:"TPM_ALG_SYMCIPHER",38:"TPM_ALG_CAMELLIA",64:"TPM_ALG_CTR",65:"TPM_ALG_OFB",66:"TPM_ALG_CBC",67:"TPM_ALG_CFB",68:"TPM_ALG_ECB"},ld={0:"TPM_ECC_NONE",1:"TPM_ECC_NIST_P192",2:"TPM_ECC_NIST_P224",3:"TPM_ECC_NIST_P256",4:"TPM_ECC_NIST_P384",5:"TPM_ECC_NIST_P521",16:"TPM_ECC_BN_P256",17:"TPM_ECC_BN_P638",32:"TPM_ECC_SM2_P256"},le={"id:414D4400":{name:"AMD",id:"AMD"},"id:414E5400":{name:"Ant Group",id:"ANT"},"id:41544D4C":{name:"Atmel",id:"ATML"},"id:4252434D":{name:"Broadcom",id:"BRCM"},"id:4353434F":{name:"Cisco",id:"CSCO"},"id:464C5953":{name:"Flyslice Technologies",id:"FLYS"},"id:524F4343":{name:"Fuzhou Rockchip",id:"ROCC"},"id:474F4F47":{name:"Google",id:"GOOG"},"id:48504900":{name:"HPI",id:"HPI"},"id:48504500":{name:"HPE",id:"HPE"},"id:48495349":{name:"Huawei",id:"HISI"},"id:49424d00":{name:"IBM",id:"IBM"},"id:49424D00":{name:"IBM",id:"IBM"},"id:49465800":{name:"Infineon",id:"IFX"},"id:494E5443":{name:"Intel",id:"INTC"},"id:4C454E00":{name:"Lenovo",id:"LEN"},"id:4D534654":{name:"Microsoft",id:"MSFT"},"id:4E534D20":{name:"National Semiconductor",id:"NSM"},"id:4E545A00":{name:"Nationz",id:"NTZ"},"id:4E534700":{name:"NSING",id:"NSG"},"id:4E544300":{name:"Nuvoton Technology",id:"NTC"},"id:51434F4D":{name:"Qualcomm",id:"QCOM"},"id:534D534E":{name:"Samsung",id:"SMSN"},"id:53454345":{name:"SecEdge",id:"SECE"},"id:534E5300":{name:"Sinosun",id:"SNS"},"id:534D5343":{name:"SMSC",id:"SMSC"},"id:53544D20":{name:"STMicroelectronics",id:"STM"},"id:54584E00":{name:"Texas Instruments",id:"TXN"},"id:57454300":{name:"Winbond",id:"WEC"},"id:5345414C":{name:"Wisekey",id:"SEAL"},"id:FFFFF1D0":{name:"FIDO Alliance",id:"FIDO"}},lf={TPM_ECC_NIST_P256:1,TPM_ECC_NIST_P384:2,TPM_ECC_NIST_P521:3,TPM_ECC_BN_P256:1,TPM_ECC_SM2_P256:1};async function lg(a){let b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,{aaguid:z,attStmt:A,authData:B,credentialPublicKey:C,clientDataHash:E,rootCertificates:F}=a,H=A.get("ver"),I=A.get("sig"),J=A.get("alg"),K=A.get("x5c"),L=A.get("pubArea"),M=A.get("certInfo");if("2.0"!==H)throw Error(`Unexpected ver "${H}", expected "2.0" (TPM)`);if(!I)throw Error("No attestation signature provided in attestation statement (TPM)");if(!J)throw Error("Attestation statement did not contain alg (TPM)");if(!bN(J))throw Error(`Attestation statement contained invalid alg ${J} (TPM)`);if(!K)throw Error("No attestation certificate provided in attestation statement (TPM)");if(!L)throw Error("Attestation statement did not contain pubArea (TPM)");if(!M)throw Error("Attestation statement did not contain certInfo (TPM)");let{unique:N,type:O,parameters:P}=function(a){let b=0,c=kQ(a),d=lc[c.getUint16(b)];b+=2;let e=lc[c.getUint16(b)];b+=2;let f=c.getUint32(b);b+=4;let g=c.getUint16(b);b+=2;let h=a.slice(b,b+=g),i={},j=Uint8Array.from([]);if("TPM_ALG_RSA"===d){let d=lc[c.getUint16(b)];b+=2;let e=lc[c.getUint16(b)];b+=2;let f=c.getUint16(b);b+=2;let g=c.getUint32(b);b+=4,i.rsa={symmetric:d,scheme:e,keyBits:f,exponent:g};let h=c.getUint16(b);b+=2,j=a.slice(b,b+=h)}else if("TPM_ALG_ECC"===d){let d=lc[c.getUint16(b)];b+=2;let e=lc[c.getUint16(b)];b+=2;let f=ld[c.getUint16(b)];b+=2;let g=lc[c.getUint16(b)];b+=2,i.ecc={symmetric:d,scheme:e,curveID:f,kdf:g};let h=c.getUint16(b);b+=2;let k=a.slice(b,b+=h),l=c.getUint16(b);b+=2,j=kO([k,a.slice(b,b+=l)])}else throw Error(`Unexpected type "${d}" (TPM)`);return{type:d,nameAlg:e,objectAttributes:{fixedTPM:!!(1&f),stClear:!!(2&f),fixedParent:!!(8&f),sensitiveDataOrigin:!!(16&f),userWithAuth:!!(32&f),adminWithPolicy:!!(64&f),noDA:!!(512&f),encryptedDuplication:!!(1024&f),restricted:!!(32768&f),decrypt:!!(65536&f),signOrEncrypt:!!(131072&f)},authPolicy:h,parameters:i,unique:j}}(L),Q=b2(C);if("TPM_ALG_RSA"===O){if(!bL(Q))throw Error(`Credential public key with kty ${Q.get(D.kty)} did not match ${O}`);let a=Q.get(D.n),b=Q.get(D.e);if(!a)throw Error("COSE public key missing n (TPM|RSA)");if(!b)throw Error("COSE public key missing e (TPM|RSA)");if(!kM(N,a))throw Error("PubArea unique is not same as credentialPublicKey (TPM|RSA)");if(!P.rsa)throw Error("Parsed pubArea type is RSA, but missing parameters.rsa (TPM|RSA)");let c=P.rsa.exponent||65537,d=b[0]+(b[1]<<8)+(b[2]<<16);if(c!==d)throw Error(`Unexpected public key exp ${d}, expected ${c} (TPM|RSA)`)}else if("TPM_ALG_ECC"===O){if(!bK(Q))throw Error(`Credential public key with kty ${Q.get(D.kty)} did not match ${O}`);let a=Q.get(D.crv),b=Q.get(D.x),c=Q.get(D.y);if(!a)throw Error("COSE public key missing crv (TPM|ECC)");if(!b)throw Error("COSE public key missing x (TPM|ECC)");if(!c)throw Error("COSE public key missing y (TPM|ECC)");if(!kM(N,kO([b,c])))throw Error("PubArea unique is not same as public key x and y (TPM|ECC)");if(!P.ecc)throw Error("Parsed pubArea type is ECC, but missing parameters.ecc (TPM|ECC)");let d=P.ecc.curveID,e=lf[d];if(e!==a)throw Error(`Public area key curve ID "${d}" mapped to "${e}" which did not match public key crv of "${a}" (TPM|ECC)`)}else throw Error(`Unsupported pubArea.type "${O}"`);let{magic:R,type:S,attested:T,extraData:U}=(g=0,i=(h=kQ(M)).getUint32(g),g+=4,j=h.getUint16(g),g+=2,k=lb[j],l=h.getUint16(g),g+=2,m=M.slice(g,g+=l),n=h.getUint16(g),g+=2,o=M.slice(g,g+=n),p=M.slice(g,g+=8),q=h.getUint32(g),g+=4,r=h.getUint32(g),g+=4,s=!!M.slice(g,g+=1),t=M.slice(g,g+=8),u=h.getUint16(g),g+=2,w=kQ(v=M.slice(g,g+=u)),x=h.getUint16(g),g+=2,y=M.slice(g,g+=x),{magic:i,type:k,qualifiedSigner:m,extraData:o,clockInfo:{clock:p,resetCount:q,restartCount:r,safe:s},firmwareVersion:t,attested:{nameAlg:lc[w.getUint16(0)],nameAlgBuffer:v.slice(0,2),name:v,qualifiedName:y}});if(0xff544347!==R)throw Error(`Unexpected magic value "${R}", expected "0xff544347" (TPM)`);if("TPM_ST_ATTEST_CERTIFY"!==S)throw Error(`Unexpected type "${S}", expected "TPM_ST_ATTEST_CERTIFY" (TPM)`);let V=await kr(L,function(a){if("TPM_ALG_SHA256"===a)return G.ES256;if("TPM_ALG_SHA384"===a)return G.ES384;if("TPM_ALG_SHA512"===a)return G.ES512;throw Error(`Unexpected TPM attested name alg ${a}`)}(T.nameAlg)),W=kO([T.nameAlgBuffer,V]);if(!kM(T.name,W))throw Error("Attested name comparison failed (TPM)");let X=kO([B,E]);if(!kM(U,await kr(X,J)))throw Error("CertInfo extra data did not equal hashed attestation (TPM)");if(K.length<1)throw Error("No certificates present in x5c array (TPM)");let{basicConstraintsCA:Y,version:Z,subject:$,notAfter:_,notBefore:aa}=fQ(K[0]);if(Y)throw Error("Certificate basic constraints CA was not `false` (TPM)");if(2!==Z)throw Error("Certificate version was not `3` (ASN.1 value of 2) (TPM)");if($.combined.length>0)throw Error("Certificate subject was not empty (TPM)");let ab=new Date;if(aa>ab)throw Error(`Certificate not good before "${aa.toString()}" (TPM)`);if(_<(ab=new Date))throw Error(`Certificate not good after "${_.toString()}" (TPM)`);let ac=eg.parse(K[0],fL);if(!ac.tbsCertificate.extensions)throw Error("Certificate was missing extensions (TPM)");if(ac.tbsCertificate.extensions.forEach(a=>{a.extnID===fu?e=eg.parse(a.extnValue,fv):a.extnID===e9&&(f=eg.parse(a.extnValue,fa))}),!e)throw Error("Certificate did not contain subjectAltName extension (TPM)");if(!e[0].directoryName?.[0].length)throw Error("Certificate subjectAltName extension directoryName was empty (TPM)");let{tcgAtTpmManufacturer:ad,tcgAtTpmModel:ae,tcgAtTpmVersion:af}=(e[0].directoryName.forEach(a=>{a.forEach(a=>{"2.23.133.2.1"===a.type?b=a.value.toString():"2.23.133.2.2"===a.type?c=a.value.toString():"2.23.133.2.3"===a.type&&(d=a.value.toString())})}),{tcgAtTpmManufacturer:b,tcgAtTpmModel:c,tcgAtTpmVersion:d});if(!ad||!ae||!af)throw Error("Certificate contained incomplete subjectAltName data (TPM)");if(!f)throw Error("Certificate did not contain ExtendedKeyUsage extension (TPM)");if(!le[ad])throw Error(`Could not match TPM manufacturer "${ad}" (TPM)`);if("2.23.133.8.3"!==f[0])throw Error(`Unexpected extKeyUsage "${f[0]}", expected "2.23.133.8.3" (TPM)`);try{await k1(ac.tbsCertificate.extensions,z)}catch(a){throw Error(`${a.message} (TPM)`)}let ag=await k5.getStatement(z);if(ag)try{await k6({statement:ag,credentialPublicKey:C,x5c:K,attestationStatementAlg:J})}catch(a){throw Error(`${a.message} (TPM)`)}else try{await ks(K.map(bZ),F)}catch(a){throw Error(`${a.message} (TPM)`)}return ky({signature:I,data:M,x509Certificate:K[0],hashAlgorithm:J})}(A=bi||(bi={}))[A.verified=0]="verified",A[A.selfSigned=1]="selfSigned",A[A.unverified=2]="unverified",A[A.failed=3]="failed";class lh{verifiedBootKey=new dM;deviceLocked=!1;verifiedBootState=bi.verified;verifiedBootHash;constructor(a={}){Object.assign(this,a)}}ek([ee({type:dM})],lh.prototype,"verifiedBootKey",void 0),ek([ee({type:K.Boolean})],lh.prototype,"deviceLocked",void 0),ek([ee({type:K.Enumerated})],lh.prototype,"verifiedBootState",void 0),ek([ee({type:dM,optional:!0})],lh.prototype,"verifiedBootHash",void 0);let li=bh=class extends ei{constructor(a){super(a),Object.setPrototypeOf(this,bh.prototype)}};li=bh=ek([ed({type:J.Set,itemType:K.Integer})],li);class lj{purpose;algorithm;keySize;digest;padding;ecCurve;rsaPublicExponent;mgfDigest;rollbackResistance;earlyBootOnly;activeDateTime;originationExpireDateTime;usageExpireDateTime;usageCountLimit;noAuthRequired;userAuthType;authTimeout;allowWhileOnBody;trustedUserPresenceRequired;trustedConfirmationRequired;unlockedDeviceRequired;allApplications;applicationId;creationDateTime;origin;rollbackResistant;rootOfTrust;osVersion;osPatchLevel;attestationApplicationId;attestationIdBrand;attestationIdDevice;attestationIdProduct;attestationIdSerial;attestationIdImei;attestationIdMeid;attestationIdManufacturer;attestationIdModel;vendorPatchLevel;bootPatchLevel;deviceUniqueAttestation;attestationIdSecondImei;moduleHash;constructor(a={}){Object.assign(this,a)}}ek([ee({context:1,type:li,optional:!0})],lj.prototype,"purpose",void 0),ek([ee({context:2,type:K.Integer,optional:!0})],lj.prototype,"algorithm",void 0),ek([ee({context:3,type:K.Integer,optional:!0})],lj.prototype,"keySize",void 0),ek([ee({context:5,type:li,optional:!0})],lj.prototype,"digest",void 0),ek([ee({context:6,type:li,optional:!0})],lj.prototype,"padding",void 0),ek([ee({context:10,type:K.Integer,optional:!0})],lj.prototype,"ecCurve",void 0),ek([ee({context:200,type:K.Integer,optional:!0})],lj.prototype,"rsaPublicExponent",void 0),ek([ee({context:203,type:li,optional:!0})],lj.prototype,"mgfDigest",void 0),ek([ee({context:303,type:K.Null,optional:!0})],lj.prototype,"rollbackResistance",void 0),ek([ee({context:305,type:K.Null,optional:!0})],lj.prototype,"earlyBootOnly",void 0),ek([ee({context:400,type:K.Integer,optional:!0})],lj.prototype,"activeDateTime",void 0),ek([ee({context:401,type:K.Integer,optional:!0})],lj.prototype,"originationExpireDateTime",void 0),ek([ee({context:402,type:K.Integer,optional:!0})],lj.prototype,"usageExpireDateTime",void 0),ek([ee({context:405,type:K.Integer,optional:!0})],lj.prototype,"usageCountLimit",void 0),ek([ee({context:503,type:K.Null,optional:!0})],lj.prototype,"noAuthRequired",void 0),ek([ee({context:504,type:K.Integer,optional:!0})],lj.prototype,"userAuthType",void 0),ek([ee({context:505,type:K.Integer,optional:!0})],lj.prototype,"authTimeout",void 0),ek([ee({context:506,type:K.Null,optional:!0})],lj.prototype,"allowWhileOnBody",void 0),ek([ee({context:507,type:K.Null,optional:!0})],lj.prototype,"trustedUserPresenceRequired",void 0),ek([ee({context:508,type:K.Null,optional:!0})],lj.prototype,"trustedConfirmationRequired",void 0),ek([ee({context:509,type:K.Null,optional:!0})],lj.prototype,"unlockedDeviceRequired",void 0),ek([ee({context:600,type:K.Null,optional:!0})],lj.prototype,"allApplications",void 0),ek([ee({context:601,type:dM,optional:!0})],lj.prototype,"applicationId",void 0),ek([ee({context:701,type:K.Integer,optional:!0})],lj.prototype,"creationDateTime",void 0),ek([ee({context:702,type:K.Integer,optional:!0})],lj.prototype,"origin",void 0),ek([ee({context:703,type:K.Null,optional:!0})],lj.prototype,"rollbackResistant",void 0),ek([ee({context:704,type:lh,optional:!0})],lj.prototype,"rootOfTrust",void 0),ek([ee({context:705,type:K.Integer,optional:!0})],lj.prototype,"osVersion",void 0),ek([ee({context:706,type:K.Integer,optional:!0})],lj.prototype,"osPatchLevel",void 0),ek([ee({context:709,type:dM,optional:!0})],lj.prototype,"attestationApplicationId",void 0),ek([ee({context:710,type:dM,optional:!0})],lj.prototype,"attestationIdBrand",void 0),ek([ee({context:711,type:dM,optional:!0})],lj.prototype,"attestationIdDevice",void 0),ek([ee({context:712,type:dM,optional:!0})],lj.prototype,"attestationIdProduct",void 0),ek([ee({context:713,type:dM,optional:!0})],lj.prototype,"attestationIdSerial",void 0),ek([ee({context:714,type:dM,optional:!0})],lj.prototype,"attestationIdImei",void 0),ek([ee({context:715,type:dM,optional:!0})],lj.prototype,"attestationIdMeid",void 0),ek([ee({context:716,type:dM,optional:!0})],lj.prototype,"attestationIdManufacturer",void 0),ek([ee({context:717,type:dM,optional:!0})],lj.prototype,"attestationIdModel",void 0),ek([ee({context:718,type:K.Integer,optional:!0})],lj.prototype,"vendorPatchLevel",void 0),ek([ee({context:719,type:K.Integer,optional:!0})],lj.prototype,"bootPatchLevel",void 0),ek([ee({context:720,type:K.Null,optional:!0})],lj.prototype,"deviceUniqueAttestation",void 0),ek([ee({context:723,type:dM,optional:!0})],lj.prototype,"attestationIdSecondImei",void 0),ek([ee({context:724,type:dM,optional:!0})],lj.prototype,"moduleHash",void 0),(B=bj||(bj={}))[B.software=0]="software",B[B.trustedEnvironment=1]="trustedEnvironment",B[B.strongBox=2]="strongBox",(C=bk||(bk={}))[C.KM2=1]="KM2",C[C.KM3=2]="KM3",C[C.KM4=3]="KM4",C[C.KM4_1=4]="KM4_1",C[C.keyMint1=100]="keyMint1",C[C.keyMint2=200]="keyMint2",C[C.keyMint3=300]="keyMint3",C[C.keyMint4=400]="keyMint4";class lk{attestationVersion=bk.KM4;attestationSecurityLevel=bj.software;keymasterVersion=0;keymasterSecurityLevel=bj.software;attestationChallenge=new dM;uniqueId=new dM;softwareEnforced=new lj;teeEnforced=new lj;constructor(a={}){Object.assign(this,a)}}ek([ee({type:K.Integer})],lk.prototype,"attestationVersion",void 0),ek([ee({type:K.Enumerated})],lk.prototype,"attestationSecurityLevel",void 0),ek([ee({type:K.Integer})],lk.prototype,"keymasterVersion",void 0),ek([ee({type:K.Enumerated})],lk.prototype,"keymasterSecurityLevel",void 0),ek([ee({type:dM})],lk.prototype,"attestationChallenge",void 0),ek([ee({type:dM})],lk.prototype,"uniqueId",void 0),ek([ee({type:lj})],lk.prototype,"softwareEnforced",void 0),ek([ee({type:lj})],lk.prototype,"teeEnforced",void 0);class ll{attestationVersion=bk.keyMint4;attestationSecurityLevel=bj.software;keyMintVersion=0;keyMintSecurityLevel=bj.software;attestationChallenge=new dM;uniqueId=new dM;softwareEnforced=new lj;hardwareEnforced=new lj;constructor(a={}){Object.assign(this,a)}toLegacyKeyDescription(){return new lk({attestationVersion:this.attestationVersion,attestationSecurityLevel:this.attestationSecurityLevel,keymasterVersion:this.keyMintVersion,keymasterSecurityLevel:this.keyMintSecurityLevel,attestationChallenge:this.attestationChallenge,uniqueId:this.uniqueId,softwareEnforced:this.softwareEnforced,teeEnforced:this.hardwareEnforced})}static fromLegacyKeyDescription(a){return new ll({attestationVersion:a.attestationVersion,attestationSecurityLevel:a.attestationSecurityLevel,keyMintVersion:a.keymasterVersion,keyMintSecurityLevel:a.keymasterSecurityLevel,attestationChallenge:a.attestationChallenge,uniqueId:a.uniqueId,softwareEnforced:a.softwareEnforced,hardwareEnforced:a.teeEnforced})}}ek([ee({type:K.Integer})],ll.prototype,"attestationVersion",void 0),ek([ee({type:K.Enumerated})],ll.prototype,"attestationSecurityLevel",void 0),ek([ee({type:K.Integer})],ll.prototype,"keyMintVersion",void 0),ek([ee({type:K.Enumerated})],ll.prototype,"keyMintSecurityLevel",void 0),ek([ee({type:dM})],ll.prototype,"attestationChallenge",void 0),ek([ee({type:dM})],ll.prototype,"uniqueId",void 0),ek([ee({type:lj})],ll.prototype,"softwareEnforced",void 0),ek([ee({type:lj})],ll.prototype,"hardwareEnforced",void 0);let lm=class extends lj{};lm=ek([ed({type:J.Choice})],lm);let ln=bl=class extends ei{constructor(a){super(a),Object.setPrototypeOf(this,bl.prototype)}findProperty(a){let b=this.find(b=>void 0!==b[a]);if(b)return b[a]}};ln=bl=ek([ed({type:J.Sequence,itemType:lm})],ln);class lo{attestationVersion=bk.KM4;attestationSecurityLevel=bj.software;keymasterVersion=0;keymasterSecurityLevel=bj.software;attestationChallenge=new dM;uniqueId=new dM;softwareEnforced=new ln;teeEnforced=new ln;get keyMintVersion(){return this.keymasterVersion}set keyMintVersion(a){this.keymasterVersion=a}get keyMintSecurityLevel(){return this.keymasterSecurityLevel}set keyMintSecurityLevel(a){this.keymasterSecurityLevel=a}get hardwareEnforced(){return this.teeEnforced}set hardwareEnforced(a){this.teeEnforced=a}constructor(a={}){Object.assign(this,a)}}ek([ee({type:K.Integer})],lo.prototype,"attestationVersion",void 0),ek([ee({type:K.Enumerated})],lo.prototype,"attestationSecurityLevel",void 0),ek([ee({type:K.Integer})],lo.prototype,"keymasterVersion",void 0),ek([ee({type:K.Enumerated})],lo.prototype,"keymasterSecurityLevel",void 0),ek([ee({type:dM})],lo.prototype,"attestationChallenge",void 0),ek([ee({type:dM})],lo.prototype,"uniqueId",void 0),ek([ee({type:ln})],lo.prototype,"softwareEnforced",void 0),ek([ee({type:ln})],lo.prototype,"teeEnforced",void 0);let lp=class extends lo{constructor(a={}){"keymasterVersion"in a&&!("keyMintVersion"in a)&&(a.keyMintVersion=a.keymasterVersion),"keymasterSecurityLevel"in a&&!("keyMintSecurityLevel"in a)&&(a.keyMintSecurityLevel=a.keymasterSecurityLevel),"teeEnforced"in a&&!("hardwareEnforced"in a)&&(a.hardwareEnforced=a.teeEnforced),super(a)}};lp=ek([ed({type:J.Sequence})],lp);class lq{packageName;version;constructor(a={}){Object.assign(this,a)}}ek([ee({type:K.OctetString})],lq.prototype,"packageName",void 0),ek([ee({type:K.Integer})],lq.prototype,"version",void 0);class lr{packageInfos;signatureDigests;constructor(a={}){Object.assign(this,a)}}async function ls(a){let{authData:b,clientDataHash:c,attStmt:d,credentialPublicKey:e,aaguid:f,rootCertificates:g}=a,h=d.get("x5c"),i=d.get("sig"),j=d.get("alg");if(!h)throw Error("No attestation certificate provided in attestation statement (Android Key)");if(!i)throw Error("No attestation signature provided in attestation statement (Android Key)");if(!j)throw Error("Attestation statement did not contain alg (Android Key)");if(!bN(j))throw Error(`Attestation statement contained invalid alg ${j} (Android Key)`);let k=eg.parse(h[0],fL),l=new Uint8Array(k.tbsCertificate.subjectPublicKeyInfo.subjectPublicKey);if(!kM(b$(e),l))throw Error("Credential public key does not equal leaf cert public key (Android Key)");let m=k.tbsCertificate.extensions?.find(a=>"1.3.6.1.4.1.11129.2.1.17"===a.extnID);if(!m)throw Error("Certificate did not contain extKeyStore (Android Key)");let{attestationChallenge:n,teeEnforced:o,softwareEnforced:p}=eg.parse(m.extnValue,lk);if(!kM(new Uint8Array(n.buffer),c))throw Error("Attestation challenge was not equal to client data hash (Android Key)");if(void 0!==o.allApplications||void 0!==p.allApplications)throw Error('teeEnforced contained "allApplications [600]" tag (Android Key)');let q=await k5.getStatement(f);if(q)try{await k6({statement:q,credentialPublicKey:e,x5c:h,attestationStatementAlg:j})}catch(a){throw Error(`${a.message} (Android Key)`,{cause:a})}else{let a=h.slice(0,-1).map(bZ),b=h.slice(-1).map(bZ);try{await ks(a,b)}catch(a){throw Error(`${a.message} (Android Key)`,{cause:a})}if(g.length>0&&0>g.indexOf(b[0]))throw Error("x5c root certificate was not a known root certificate (Android Key)")}return ky({signature:i,data:kO([b,c]),x509Certificate:h[0],hashAlgorithm:j})}async function lt(a){let{attStmt:b,authData:c,clientDataHash:d,credentialPublicKey:e,rootCertificates:f}=a,g=b.get("x5c");if(!g)throw Error("No attestation certificate provided in attestation statement (Apple)");try{await ks(g.map(bZ),f)}catch(a){throw Error(`${a.message} (Apple)`)}let{extensions:h,subjectPublicKeyInfo:i}=eg.parse(g[0],fL).tbsCertificate;if(!h)throw Error("credCert missing extensions (Apple)");let j=h.find(a=>"1.2.840.113635.100.8.2"===a.extnID);if(!j)throw Error('credCert missing "1.2.840.113635.100.8.2" extension (Apple)');let k=kO([c,d]);if(!kM(await kr(k),new Uint8Array(j.extnValue.buffer).slice(6)))throw Error("credCert nonce was not expected value (Apple)");if(!kM(b$(e),new Uint8Array(i.subjectPublicKey)))throw Error("Credential public key does not equal credCert public key (Apple)");return!0}async function lu(a){let b,{response:c,expectedChallenge:d,expectedOrigin:e,expectedRPID:f,expectedType:g,requireUserPresence:h=!0,requireUserVerification:i=!0,supportedAlgorithmIDs:j=kT,attestationSafetyNetEnforceCTSCheck:k=!0}=a,{id:l,rawId:m,type:n,response:o}=c;if(!l)throw Error("Missing credential ID");if(l!==m)throw Error("Credential ID was not base64url-encoded");if("public-key"!==n)throw Error(`Unexpected credential type ${n}, expected "public-key"`);let p=b0(o.clientDataJSON),{type:q,origin:r,challenge:s,tokenBinding:t}=p;if(Array.isArray(g)){if(!g.includes(q)){let a=g.join(", ");throw Error(`Unexpected registration response type "${q}", expected one of: ${a}`)}}else if(g){if(q!==g)throw Error(`Unexpected registration response type "${q}", expected "${g}"`)}else if("webauthn.create"!==q)throw Error(`Unexpected registration response type: ${q}`);if("function"==typeof d){if(!await d(s))throw Error(`Custom challenge verifier returned false for registration response challenge "${s}"`)}else if(s!==d)throw Error(`Unexpected registration response challenge "${s}", expected "${d}"`);if(Array.isArray(e)){if(!e.includes(r))throw Error(`Unexpected registration response origin "${r}", expected one of: ${e.join(", ")}`)}else if(r!==e)throw Error(`Unexpected registration response origin "${r}", expected "${e}"`);if(t){if("object"!=typeof t)throw Error(`Unexpected value for TokenBinding "${t}"`);if(0>["present","supported","not-supported"].indexOf(t.status))throw Error(`Unexpected tokenBinding.status value of "${t.status}"`)}let u=bv(o.attestationObject),v=b_(bI(u)),w=v.get("fmt"),x=v.get("authData"),y=v.get("attStmt"),{aaguid:z,rpIdHash:A,flags:B,credentialID:C,counter:E,credentialPublicKey:F,extensionsData:G}=kp(x);if(f){let a=[];a="string"==typeof f?[f]:f,b=await kZ(A,a)}if(h&&!B.up)throw Error("User presence was required, but user was not present");if(i&&!B.uv)throw Error("User verification was required, but user could not be verified");if(!C)throw Error("No credential ID was provided by authenticator");if(!F)throw Error("No public key was provided by authenticator");if(!z)throw Error("No AAGUID was present during registration");let H=b2(F).get(D.alg);if("number"!=typeof H)throw Error("Credential public key was missing numeric alg");if(!j.includes(H)){let a=j.join(", ");throw Error(`Unexpected public key alg "${H}", expected one of "${a}"`)}let I={aaguid:z,attStmt:y,authData:x,clientDataHash:await kr(bv(o.clientDataJSON)),credentialID:C,credentialPublicKey:F,rootCertificates:kI.getRootCertificates({identifier:w}),rpIdHash:A,attestationSafetyNetEnforceCTSCheck:k},J=!1;if("fido-u2f"===w)J=await k_(I);else if("packed"===w)J=await k9(I);else if("android-safetynet"===w)J=await la(I);else if("android-key"===w)J=await ls(I);else if("tpm"===w)J=await lg(I);else if("apple"===w)J=await lt(I);else if("none"===w){if(y.size>0)throw Error("None attestation had unexpected attestation statement");J=!0}else throw Error(`Unsupported Attestation Format: ${w}`);if(!J)return{verified:!1};let{credentialDeviceType:K,credentialBackedUp:L}=kX(B);return{verified:!0,registrationInfo:{fmt:w,aaguid:bY(z),credentialType:n,credential:{id:bw(C),publicKey:F,counter:E,transports:c.response.transports},attestationObject:u,userVerified:B.uv,credentialDeviceType:K,credentialBackedUp:L,origin:p.origin,rpID:b,authenticatorExtensionResults:G}}}async function lv(a){let{allowCredentials:b,challenge:c=await kR(),timeout:d=6e4,userVerification:e="preferred",extensions:f,rpID:g}=a,h=c;return"string"==typeof h&&(h=kP(h)),{rpId:g,challenge:bw(h),allowCredentials:b?.map(a=>{if(!by(a.id))throw Error(`allowCredential id "${a.id}" is not a valid base64url string`);return{...a,id:bz(a.id),type:"public-key"}}),timeout:d,userVerification:e,extensions:f}}async function lw(a){let{response:b,expectedChallenge:c,expectedOrigin:d,expectedRPID:e,expectedType:f,credential:g,requireUserVerification:h=!0,advancedFIDOConfig:i}=a,{id:j,rawId:k,type:l,response:m}=b;if(!j)throw Error("Missing credential ID");if(j!==k)throw Error("Credential ID was not base64url-encoded");if("public-key"!==l)throw Error(`Unexpected credential type ${l}, expected "public-key"`);if(!b)throw Error("Credential missing response");if("string"!=typeof m?.clientDataJSON)throw Error("Credential response clientDataJSON was not a string");let n=b0(m.clientDataJSON),{type:o,origin:p,challenge:q,tokenBinding:r}=n;if(Array.isArray(f)){if(!f.includes(o)){let a=f.join(", ");throw Error(`Unexpected authentication response type "${o}", expected one of: ${a}`)}}else if(f){if(o!==f)throw Error(`Unexpected authentication response type "${o}", expected "${f}"`)}else if("webauthn.get"!==o)throw Error(`Unexpected authentication response type: ${o}`);if("function"==typeof c){if(!await c(q))throw Error(`Custom challenge verifier returned false for registration response challenge "${q}"`)}else if(q!==c)throw Error(`Unexpected authentication response challenge "${q}", expected "${c}"`);if(Array.isArray(d)){if(!d.includes(p)){let a=d.join(", ");throw Error(`Unexpected authentication response origin "${p}", expected one of: ${a}`)}}else if(p!==d)throw Error(`Unexpected authentication response origin "${p}", expected "${d}"`);if(!by(m.authenticatorData))throw Error("Credential response authenticatorData was not a base64url string");if(!by(m.signature))throw Error("Credential response signature was not a base64url string");if(m.userHandle&&"string"!=typeof m.userHandle)throw Error("Credential response userHandle was not a string");if(r){if("object"!=typeof r)throw Error("ClientDataJSON tokenBinding was not an object");if(0>["present","supported","notSupported"].indexOf(r.status))throw Error(`Unexpected tokenBinding status ${r.status}`)}let s=bv(m.authenticatorData),{rpIdHash:t,flags:u,counter:v,extensionsData:w}=kp(s),x=[];x="string"==typeof e?[e]:e;let y=await kZ(t,x);if(void 0!==i){let{userVerification:a}=i;if("required"===a&&!u.uv)throw Error("User verification required, but user could not be verified")}else{if(!u.up)throw Error("User not present during authentication");if(h&&!u.uv)throw Error("User verification required, but user could not be verified")}let z=kO([s,await kr(bv(m.clientDataJSON))]),A=bv(m.signature);if((v>0||g.counter>0)&&v<=g.counter)throw Error(`Response counter value ${v} was lower than expected ${g.counter}`);let{credentialDeviceType:B,credentialBackedUp:C}=kX(u);return{verified:await ky({signature:A,data:z,credentialPublicKey:g.publicKey}),authenticationInfo:{newCounter:v,credentialID:g.id,userVerified:u.uv,credentialDeviceType:B,credentialBackedUp:C,authenticatorExtensionResults:w,origin:n.origin,rpID:y}}}ek([ee({type:lq,repeated:"set"})],lr.prototype,"packageInfos",void 0),ek([ee({type:K.OctetString,repeated:"set"})],lr.prototype,"signatureDigests",void 0)},96107:()=>{var a,b;b=a||(a={}),function(a){var c="object"==typeof globalThis?globalThis:"object"==typeof global?global:"object"==typeof self?self:"object"==typeof this?this:function(){try{return Function("return this;")()}catch(a){}}()||function(){try{return(0,eval)("(function() { return this; })()")}catch(a){}}(),d=e(b);function e(a,b){return function(c,d){Object.defineProperty(a,c,{configurable:!0,writable:!0,value:d}),b&&b(c,d)}}void 0!==c.Reflect&&(d=e(c.Reflect,d)),a(d,c),void 0===c.Reflect&&(c.Reflect=b)}(function(a,b){var c,d=Object.prototype.hasOwnProperty,e="function"==typeof Symbol,f=e&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",g=e&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",h="function"==typeof Object.create,i=({__proto__:[]})instanceof Array,j=!h&&!i,k={create:h?function(){return L(Object.create(null))}:i?function(){return L({__proto__:null})}:function(){return L({})},has:j?function(a,b){return d.call(a,b)}:function(a,b){return b in a},get:j?function(a,b){return d.call(a,b)?a[b]:void 0}:function(a,b){return a[b]}},l=Object.getPrototypeOf(Function),m="function"==typeof Map&&"function"==typeof Map.prototype.entries?Map:function(){var a={},b=[],c=function(){function a(a,b,c){this._index=0,this._keys=a,this._values=b,this._selector=c}return a.prototype["@@iterator"]=function(){return this},a.prototype[g]=function(){return this},a.prototype.next=function(){var a=this._index;if(a>=0&&a<this._keys.length){var c=this._selector(this._keys[a],this._values[a]);return a+1>=this._keys.length?(this._index=-1,this._keys=b,this._values=b):this._index++,{value:c,done:!1}}return{value:void 0,done:!0}},a.prototype.throw=function(a){throw this._index>=0&&(this._index=-1,this._keys=b,this._values=b),a},a.prototype.return=function(a){return this._index>=0&&(this._index=-1,this._keys=b,this._values=b),{value:a,done:!0}},a}();function d(){this._keys=[],this._values=[],this._cacheKey=a,this._cacheIndex=-2}return Object.defineProperty(d.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),d.prototype.has=function(a){return this._find(a,!1)>=0},d.prototype.get=function(a){var b=this._find(a,!1);return b>=0?this._values[b]:void 0},d.prototype.set=function(a,b){var c=this._find(a,!0);return this._values[c]=b,this},d.prototype.delete=function(b){var c=this._find(b,!1);if(c>=0){for(var d=this._keys.length,e=c+1;e<d;e++)this._keys[e-1]=this._keys[e],this._values[e-1]=this._values[e];return this._keys.length--,this._values.length--,E(b,this._cacheKey)&&(this._cacheKey=a,this._cacheIndex=-2),!0}return!1},d.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=a,this._cacheIndex=-2},d.prototype.keys=function(){return new c(this._keys,this._values,e)},d.prototype.values=function(){return new c(this._keys,this._values,f)},d.prototype.entries=function(){return new c(this._keys,this._values,h)},d.prototype["@@iterator"]=function(){return this.entries()},d.prototype[g]=function(){return this.entries()},d.prototype._find=function(a,b){if(!E(this._cacheKey,a)){this._cacheIndex=-1;for(var c=0;c<this._keys.length;c++)if(E(this._keys[c],a)){this._cacheIndex=c;break}}return this._cacheIndex<0&&b&&(this._cacheIndex=this._keys.length,this._keys.push(a),this._values.push(void 0)),this._cacheIndex},d;function e(a,b){return a}function f(a,b){return b}function h(a,b){return[a,b]}}(),n="function"==typeof Set&&"function"==typeof Set.prototype.entries?Set:function(){function a(){this._map=new m}return Object.defineProperty(a.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),a.prototype.has=function(a){return this._map.has(a)},a.prototype.add=function(a){return this._map.set(a,a),this},a.prototype.delete=function(a){return this._map.delete(a)},a.prototype.clear=function(){this._map.clear()},a.prototype.keys=function(){return this._map.keys()},a.prototype.values=function(){return this._map.keys()},a.prototype.entries=function(){return this._map.entries()},a.prototype["@@iterator"]=function(){return this.keys()},a.prototype[g]=function(){return this.keys()},a}(),o="function"==typeof WeakMap?WeakMap:function(){var a=k.create(),b=e();function c(){this._key=e()}return c.prototype.has=function(a){var b=f(a,!1);return void 0!==b&&k.has(b,this._key)},c.prototype.get=function(a){var b=f(a,!1);return void 0!==b?k.get(b,this._key):void 0},c.prototype.set=function(a,b){return f(a,!0)[this._key]=b,this},c.prototype.delete=function(a){var b=f(a,!1);return void 0!==b&&delete b[this._key]},c.prototype.clear=function(){this._key=e()},c;function e(){var b;do b="@@WeakMap@@"+function(){var a=function(){if("function"==typeof Uint8Array){var a=new Uint8Array(16);return"u">typeof crypto?crypto.getRandomValues(a):"u">typeof msCrypto?msCrypto.getRandomValues(a):g(a,16),a}return g(Array(16),16)}();a[6]=79&a[6]|64,a[8]=191&a[8]|128;for(var b="",c=0;c<16;++c){var d=a[c];(4===c||6===c||8===c)&&(b+="-"),d<16&&(b+="0"),b+=d.toString(16).toLowerCase()}return b}();while(k.has(a,b));return a[b]=!0,b}function f(a,c){if(!d.call(a,b)){if(!c)return;Object.defineProperty(a,b,{value:k.create()})}return a[b]}function g(a,b){for(var c=0;c<b;++c)a[c]=255*Math.random()|0;return a}}(),p=e?Symbol.for("@reflect-metadata:registry"):void 0,q=(!x(p)&&z(b.Reflect)&&Object.isExtensible(b.Reflect)&&(c=b.Reflect[p]),x(c)&&(c=function(){x(p)||void 0===b.Reflect||p in b.Reflect||"function"!=typeof b.Reflect.defineMetadata||(c=(a=b.Reflect).defineMetadata,d=a.hasOwnMetadata,e=a.getOwnMetadata,f=a.getOwnMetadataKeys,g=a.deleteMetadata,h=new o,i={isProviderFor:function(a,b){var c=h.get(a);return!!(!x(c)&&c.has(b))||!!f(a,b).length&&(x(c)&&(c=new n,h.set(a,c)),c.add(b),!0)},OrdinaryDefineOwnMetadata:c,OrdinaryHasOwnMetadata:d,OrdinaryGetOwnMetadata:e,OrdinaryOwnMetadataKeys:f,OrdinaryDeleteMetadata:g});var a,c,d,e,f,g,h,i,j,k,l,q=new o,r={registerProvider:function(a){if(!Object.isExtensible(r))throw Error("Cannot add provider to a frozen registry.");switch(!0){case i===a:break;case x(j):j=a;break;case j===a:break;case x(k):k=a;break;case k===a:break;default:void 0===l&&(l=new n),l.add(a)}},getProvider:s,setProvider:function(a,b,c){if(!function(a){if(x(a))throw TypeError();return j===a||k===a||!x(l)&&l.has(a)}(c))throw Error("Metadata provider not registered.");var d=s(a,b);if(d!==c){if(!x(d))return!1;var e=q.get(a);x(e)&&(e=new m,q.set(a,e)),e.set(b,c)}return!0}};return r;function s(a,b){var c,d=q.get(a);return x(d)||(c=d.get(b)),x(c)&&(c=function(a,b){if(!x(j)){if(j.isProviderFor(a,b))return j;if(!x(k)){if(k.isProviderFor(a,b))return j;if(!x(l))for(var c=G(l);;){var d=H(c);if(!d)return;var e=d.value;if(e.isProviderFor(a,b))return I(c),e}}}if(!x(i)&&i.isProviderFor(a,b))return i}(a,b),x(c)||(x(d)&&(d=new m,q.set(a,d)),d.set(b,c))),c}}()),!x(p)&&z(b.Reflect)&&Object.isExtensible(b.Reflect)&&Object.defineProperty(b.Reflect,p,{enumerable:!1,configurable:!1,writable:!1,value:c}),c),r=function(a){var b=new o,c={isProviderFor:function(a,c){var d=b.get(a);return!x(d)&&d.has(c)},OrdinaryDefineOwnMetadata:function(a,b,c,e){d(c,e,!0).set(a,b)},OrdinaryHasOwnMetadata:function(a,b,c){var e=d(b,c,!1);return!x(e)&&!!e.has(a)},OrdinaryGetOwnMetadata:function(a,b,c){var e=d(b,c,!1);if(!x(e))return e.get(a)},OrdinaryOwnMetadataKeys:function(a,b){var c=[],e=d(a,b,!1);if(x(e))return c;for(var f=G(e.keys()),g=0;;){var h=H(f);if(!h)return c.length=g,c;var i=h.value;try{c[g]=i}catch(a){try{I(f)}finally{throw a}}g++}},OrdinaryDeleteMetadata:function(a,c,e){var f=d(c,e,!1);if(x(f)||!f.delete(a))return!1;if(0===f.size){var g=b.get(c);x(g)||(g.delete(e),0===g.size&&b.delete(g))}return!0}};return q.registerProvider(c),c;function d(d,e,f){var g=b.get(d),h=!1;if(x(g)){if(!f)return;g=new m,b.set(d,g),h=!0}var i=g.get(e);if(x(i)){if(!f)return;if(i=new m,g.set(e,i),!a.setProvider(d,e,c))throw g.delete(e),h&&b.delete(d),Error("Wrong provider for target.")}return i}}(q);function s(a,b,c){var d=K(b,c,!1);return!x(d)&&!!d.OrdinaryHasOwnMetadata(a,b,c)}function t(a,b,c){var d=K(b,c,!1);if(!x(d))return d.OrdinaryGetOwnMetadata(a,b,c)}function u(a,b,c,d){K(c,d,!0).OrdinaryDefineOwnMetadata(a,b,c,d)}function v(a,b){var c=K(a,b,!1);return c?c.OrdinaryOwnMetadataKeys(a,b):[]}function w(a){if(null===a)return 1;switch(typeof a){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===a?1:6;default:return 6}}function x(a){return void 0===a}function y(a){return null===a}function z(a){return"object"==typeof a?null!==a:"function"==typeof a}a("decorate",function(a,b,c,d){if(x(c)){if(!B(a)||!D(b))throw TypeError();for(var e=a,f=b,g=e.length-1;g>=0;--g){var h=(0,e[g])(f);if(!x(h)&&!y(h)){if(!D(h))throw TypeError();f=h}}return f}if(!B(a)||!z(b)||!z(d)&&!x(d)&&!y(d))throw TypeError();return y(d)&&(d=void 0),function(a,b,c,d){for(var e=a.length-1;e>=0;--e){var f=(0,a[e])(b,c,d);if(!x(f)&&!y(f)){if(!z(f))throw TypeError();d=f}}return d}(a,b,c=A(c),d)}),a("metadata",function(a,b){return function(c,d){if(!z(c)||!x(d)&&!function(a){switch(w(a)){case 3:case 4:return!0;default:return!1}}(d))throw TypeError();u(a,b,c,d)}}),a("defineMetadata",function(a,b,c,d){if(!z(c))throw TypeError();return x(d)||(d=A(d)),u(a,b,c,d)}),a("hasMetadata",function(a,b,c){if(!z(b))throw TypeError();return x(c)||(c=A(c)),function a(b,c,d){if(s(b,c,d))return!0;var e=J(c);return!y(e)&&a(b,e,d)}(a,b,c)}),a("hasOwnMetadata",function(a,b,c){if(!z(b))throw TypeError();return x(c)||(c=A(c)),s(a,b,c)}),a("getMetadata",function(a,b,c){if(!z(b))throw TypeError();return x(c)||(c=A(c)),function a(b,c,d){if(s(b,c,d))return t(b,c,d);var e=J(c);if(!y(e))return a(b,e,d)}(a,b,c)}),a("getOwnMetadata",function(a,b,c){if(!z(b))throw TypeError();return x(c)||(c=A(c)),t(a,b,c)}),a("getMetadataKeys",function(a,b){if(!z(a))throw TypeError();return x(b)||(b=A(b)),function a(b,c){var d=v(b,c),e=J(b);if(null===e)return d;var f=a(e,c);if(f.length<=0)return d;if(d.length<=0)return f;for(var g=new n,h=[],i=0;i<d.length;i++){var j=d[i],k=g.has(j);k||(g.add(j),h.push(j))}for(var l=0;l<f.length;l++){var j=f[l],k=g.has(j);k||(g.add(j),h.push(j))}return h}(a,b)}),a("getOwnMetadataKeys",function(a,b){if(!z(a))throw TypeError();return x(b)||(b=A(b)),v(a,b)}),a("deleteMetadata",function(a,b,c){if(!z(b)||(x(c)||(c=A(c)),!z(b)))throw TypeError();x(c)||(c=A(c));var d=K(b,c,!1);return!x(d)&&d.OrdinaryDeleteMetadata(a,b,c)});function A(a){var b=function(a){switch(w(a)){case 0:case 1:case 2:case 3:case 4:case 5:return a}var b="string",c=F(a,f);if(void 0!==c){var d=c.call(a,b);if(z(d))throw TypeError();return d}return function(a,b){if("string"===b){var c=a.toString;if(C(c)){var d=c.call(a);if(!z(d))return d}var e=a.valueOf;if(C(e)){var d=e.call(a);if(!z(d))return d}}else{var e=a.valueOf;if(C(e)){var d=e.call(a);if(!z(d))return d}var f=a.toString;if(C(f)){var d=f.call(a);if(!z(d))return d}}throw TypeError()}(a,b)}(a);return"symbol"==typeof b?b:""+b}function B(a){return Array.isArray?Array.isArray(a):a instanceof Object?a instanceof Array:"[object Array]"===Object.prototype.toString.call(a)}function C(a){return"function"==typeof a}function D(a){return"function"==typeof a}function E(a,b){return a===b||a!=a&&b!=b}function F(a,b){var c=a[b];if(null!=c){if(!C(c))throw TypeError();return c}}function G(a){var b=F(a,g);if(!C(b))throw TypeError();var c=b.call(a);if(!z(c))throw TypeError();return c}function H(a){var b=a.next();return!b.done&&b}function I(a){var b=a.return;b&&b.call(a)}function J(a){var b=Object.getPrototypeOf(a);if("function"!=typeof a||a===l||b!==l)return b;var c=a.prototype,d=c&&Object.getPrototypeOf(c);if(null==d||d===Object.prototype)return b;var e=d.constructor;return"function"!=typeof e||e===a?b:e}function K(a,b,c){var d=q.getProvider(a,b);if(!x(d))return d;if(c){if(q.setProvider(a,b,r))return r;throw Error("Illegal state.")}}function L(a){return a.__=void 0,delete a.__,a}})}};