k2-im 0.2.13 → 0.2.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/dist/chat-kit-pinia.d.ts +4 -4
- package/dist/chat-kit.d.ts +3 -3
- package/dist/crypto.worker.js +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/modules/api-protocol-client/src/client.js +1 -1
- package/dist/modules/api-protocol-client/src/nonce.js +1 -1
- package/dist/modules/crypto/browser.js +1 -1
- package/dist/modules/crypto/driver.js +1 -1
- package/dist/modules/crypto/vendor/crypto/index_bg.js +1 -1
- package/dist/modules/im-browser/src/http/session-favorite-http-adapter.js +1 -1
- package/dist/modules/im-browser/src/media/media-preview-preparation-executor.js +1 -1
- package/dist/modules/im-browser/src/media/media-transfer-adapter.js +1 -1
- package/dist/modules/im-browser/src/network/browser-connection-ownership.js +1 -1
- package/dist/modules/im-browser/src/storage/indexed-db-storage-adapter.js +1 -1
- package/dist/modules/im-chat-kit/src/pinia/composer.store.js +1 -1
- package/dist/modules/im-chat-kit/src/pinia/expression.store.js +1 -1
- package/dist/modules/im-chat-kit/src/utils/emoji/unicode.js +1 -1
- package/dist/modules/im-core/src/abort.js +1 -1
- package/dist/modules/im-core/src/mapping/message-id.js +1 -1
- package/dist/modules/im-core/src/mapping/search-text.js +1 -1
- package/dist/modules/im-core/src/media-thumbnail-policy.js +1 -1
- package/dist/modules/im-core/src/message-flow/media/media-sender.js +1 -1
- package/dist/modules/im-core/src/state/domain-state.js +1 -1
- package/dist/modules/im-sdk/src/product/conversation-handle.js +1 -1
- package/dist/modules/im-sdk/src/product/diagnostic-memory-buffer.js +1 -1
- package/dist/modules/im-sdk/src/product/media.js +1 -1
- package/dist/modules/im-sdk/src/runtime/recent-history-prefetch.js +1 -1
- package/dist/request-crypto.d.ts +2 -3
- package/dist/sdk.d.ts +2 -2
- package/dist/vendor/crypto/index_bg.wasm +0 -0
- package/package.json +10 -1
- package/dist/modules/im-browser/src/media/thumbnail-pixel-profile.js +0 -1
package/README.md
CHANGED
|
@@ -20,6 +20,12 @@ Chat Kit Core 与 Core-only 入口不依赖 Vue/Pinia/路由,也不自行获
|
|
|
20
20
|
|
|
21
21
|
ESM 与声明构建均包含所需 workspace 实现,crypto Worker、WASM 和 Speex 运行时资产也随包提供。ESM 保留模块之间的导入与导出,使宿主能够删除未使用的实现;`dist/modules` 是包内实现,不是公开导入入口。开发期本地同步不压缩并保留 source map;公共 npm 发布压缩 JavaScript 与 Speex、保留纯调用标记,并且不包含 `.map` 文件。workspace 版本用于源码开发,正式制品版本由发布命令指定;本地构建不表示已上传 Registry。
|
|
22
22
|
|
|
23
|
+
SDK 的 JavaScript 浏览器目标维护在本包 `package.json` 的 `browserslist.js`:Chromium / Edge 93+、Firefox 91+、Safari / iOS 15+,独立于宿主 CSS 框架。聚合包、拆分包和私有 classic Worker 通过构建期的 `browserslist-to-esbuild` 读取同一范围;聚合包与拆分包保留 ES2020 语法上限,Worker 保留 ES2017 语法上限。TypeScript 类型在构建时移除,运行时只交付转换后的 JavaScript。
|
|
24
|
+
|
|
25
|
+
请求加密模块保留顶层 `await`,由宿主打包器处理异步模块。独立的 `@k2/crypto` 拆包保留已有 JS/WASM 封装,不经过上述转译,其语法与运行能力仍须检查。`browserslist` 只声明目标,不会自行转换文件;构建时必须显式接入编译器,消费者也不能据此认定原始 ESM 可在所有 ES2020 浏览器直接运行。
|
|
26
|
+
|
|
27
|
+
第三方 external 依赖由宿主安装和打包,也必须纳入最终产物检查。语法转换不会补齐 `Array.at`、`findLast`、Web Locks 等运行时 API 或 WebAssembly 能力;它们需要按实际浏览器基线分别检查。SDK 构建成功不等于这些能力都可用,也不代表已经通过真机验收。
|
|
28
|
+
|
|
23
29
|
运行 `pnpm check:im-tree-shaking` 可以用真实生产消费者验证轻量 API 的体积与运行结果。该检查不等于完整客户端按功能裁剪:`createImClient()` 仍装配当前支持的会话与产品能力,未调用某个方法不会自动移除相应功能。
|
|
24
30
|
|
|
25
31
|
发布候选已通过独立 Rspack clean-consumer Gate:AWS 仅在首次上传时加载,crypto WASM 与 Speex 由 dist 自持,fixture 不需要 Node shim、WASM loader、asset copy 或 postinstall。该证据只证明普通 Rspack 消费者可以编译,不等于 H5 已同步当前 tarball 或真实媒体链路已验收;H5 开发期通过本地同步脚本完成自身 typecheck/Rspack 验证,上线准备阶段使用已发布 npm 精确版本完成 Docker/Jenkins 验证。
|
package/dist/chat-kit-pinia.d.ts
CHANGED
|
@@ -1943,7 +1943,7 @@ interface ImHttpPort {
|
|
|
1943
1943
|
}
|
|
1944
1944
|
|
|
1945
1945
|
/** 可持久化的媒体资产类型;未注册类型必须跳过缓存,不能回退到其它类型。 */
|
|
1946
|
-
type MediaAssetKind = 'image' | 'video';
|
|
1946
|
+
type MediaAssetKind = 'image' | 'video' | 'file';
|
|
1947
1947
|
/** 持久媒体资产的稳定键。resourceVersion 由远端资源标识派生,避免同消息替换资源后误命中旧缓存。 */
|
|
1948
1948
|
interface MediaAssetCacheKey {
|
|
1949
1949
|
kind: MediaAssetKind;
|
|
@@ -5474,7 +5474,7 @@ interface ImMediaTasksApi {
|
|
|
5474
5474
|
clearCache: () => Promise<void>;
|
|
5475
5475
|
/**
|
|
5476
5476
|
* 按输入顺序查询完整本机媒体是否可用;不下载、不读取 Blob、不续缓存期限或创建任务。
|
|
5477
|
-
*
|
|
5477
|
+
* 支持图片、视频和文件(含各自合集);未配置持久缓存时只检查内存。
|
|
5478
5478
|
* @throws 不支持轻量查询或存储读取失败时明确拒绝,不伪装成未命中。
|
|
5479
5479
|
* @example const [available] = await client.media.probeCached([messageRef])
|
|
5480
5480
|
*/
|
|
@@ -5557,7 +5557,7 @@ interface ImMediaTasksApi {
|
|
|
5557
5557
|
*
|
|
5558
5558
|
* 返回的对象可以**原样**作为 `localPreviewMetadata` 交给 `sendImage` / `sendVideo` /
|
|
5559
5559
|
* `sendMediaAlbum`:发送链路会复用可用元信息;合集项超出其可用消息空间时重新生成封面。
|
|
5560
|
-
* posterData 使用共享自适应发送规格(视频 JPEG,长边最多
|
|
5560
|
+
* posterData 使用共享自适应发送规格(视频 JPEG,长边最多 480px,目标 8 KiB、硬上限 24 KiB);includeDisplayPoster 可在同一次解码中额外生成
|
|
5561
5561
|
* 仅供页面显示的高清 displayPoster(长边最多 960),不得绕过发送校验直接用它替换 posterData。
|
|
5562
5562
|
*
|
|
5563
5563
|
* @param input.kind 按文件类型选解码路径;`'video'` 才会抽首帧与读时长。
|
|
@@ -7901,7 +7901,7 @@ interface ImExpressionStoreActions {
|
|
|
7901
7901
|
loadRecent: (kind: RecentKind) => Promise<ImExpressionOperationResult>;
|
|
7902
7902
|
reportRecent: (input: ImExpressionRecentInput) => Promise<ImExpressionOperationResult>;
|
|
7903
7903
|
rememberEmoji: (entry: ImEmojiRecentEntry) => Promise<ImExpressionOperationResult>;
|
|
7904
|
-
/**
|
|
7904
|
+
/** 批量记录并上报普通表情;默认刷新服务端列表,refreshAfterReport 为 false 时保留本地最近记录。 */
|
|
7905
7905
|
rememberEmojis: (entries: readonly ImEmojiRecentEntry[], options?: {
|
|
7906
7906
|
refreshAfterReport?: boolean;
|
|
7907
7907
|
}) => Promise<ImExpressionOperationResult>;
|
package/dist/chat-kit.d.ts
CHANGED
|
@@ -1940,7 +1940,7 @@ interface ImHttpPort {
|
|
|
1940
1940
|
}
|
|
1941
1941
|
|
|
1942
1942
|
/** 可持久化的媒体资产类型;未注册类型必须跳过缓存,不能回退到其它类型。 */
|
|
1943
|
-
type MediaAssetKind = 'image' | 'video';
|
|
1943
|
+
type MediaAssetKind = 'image' | 'video' | 'file';
|
|
1944
1944
|
/** 持久媒体资产的稳定键。resourceVersion 由远端资源标识派生,避免同消息替换资源后误命中旧缓存。 */
|
|
1945
1945
|
interface MediaAssetCacheKey {
|
|
1946
1946
|
kind: MediaAssetKind;
|
|
@@ -5585,7 +5585,7 @@ interface ImMediaTasksApi {
|
|
|
5585
5585
|
clearCache: () => Promise<void>;
|
|
5586
5586
|
/**
|
|
5587
5587
|
* 按输入顺序查询完整本机媒体是否可用;不下载、不读取 Blob、不续缓存期限或创建任务。
|
|
5588
|
-
*
|
|
5588
|
+
* 支持图片、视频和文件(含各自合集);未配置持久缓存时只检查内存。
|
|
5589
5589
|
* @throws 不支持轻量查询或存储读取失败时明确拒绝,不伪装成未命中。
|
|
5590
5590
|
* @example const [available] = await client.media.probeCached([messageRef])
|
|
5591
5591
|
*/
|
|
@@ -5668,7 +5668,7 @@ interface ImMediaTasksApi {
|
|
|
5668
5668
|
*
|
|
5669
5669
|
* 返回的对象可以**原样**作为 `localPreviewMetadata` 交给 `sendImage` / `sendVideo` /
|
|
5670
5670
|
* `sendMediaAlbum`:发送链路会复用可用元信息;合集项超出其可用消息空间时重新生成封面。
|
|
5671
|
-
* posterData 使用共享自适应发送规格(视频 JPEG,长边最多
|
|
5671
|
+
* posterData 使用共享自适应发送规格(视频 JPEG,长边最多 480px,目标 8 KiB、硬上限 24 KiB);includeDisplayPoster 可在同一次解码中额外生成
|
|
5672
5672
|
* 仅供页面显示的高清 displayPoster(长边最多 960),不得绕过发送校验直接用它替换 posterData。
|
|
5673
5673
|
*
|
|
5674
5674
|
* @param input.kind 按文件类型选解码路径;`'video'` 才会抽首帧与读时长。
|
package/dist/crypto.worker.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var Ya=Object.defineProperty,$a=Object.defineProperties;var ja=Object.getOwnPropertyDescriptors;var ar=Object.getOwnPropertySymbols;var Za=Object.prototype.hasOwnProperty,Ja=Object.prototype.propertyIsEnumerable;var ir=(ue,J,ae)=>J in ue?Ya(ue,J,{enumerable:!0,configurable:!0,writable:!0,value:ae}):ue[J]=ae,nr=(ue,J)=>{for(var ae in J||(J={}))Za.call(J,ae)&&ir(ue,ae,J[ae]);if(ar)for(var ae of ar(J))Ja.call(J,ae)&&ir(ue,ae,J[ae]);return ue},sr=(ue,J)=>$a(ue,ja(J));(function(){"use strict";function or(i){if(i===null||typeof i!="object")return!1;const e=i;return e.version===1&&Number.isSafeInteger(e.generation)&&e.generation>=0&&typeof e.operationId=="string"&&e.operationId.length<=256}function ur(i){if(!or(i))return!1;if(i.kind==="init")return i.operationId==="";if(i.operationId==="")return!1;if(i.kind==="cancel"||i.kind==="promote")return!0;if(i.kind==="decrypt-tea"||i.kind==="encrypt-tea"){const e=i.kind==="encrypt-tea"?i.plain:i.cipherData;return i.teaKey instanceof ArrayBuffer&&i.teaKey.byteLength===16&&e instanceof ArrayBuffer&&e.byteLength<=262144&&(i.priority==="foreground"||i.priority==="background")}if(i.kind==="decrypt-batch"){if(!((i.priority==="foreground"||i.priority==="background")&&Array.isArray(i.keys)&&i.keys.every(g=>typeof g=="string")&&Array.isArray(i.items)&&i.items.length>0&&i.items.length<=8&&i.keys.length<=i.items.length&&i.items.every(g=>g!==null&&typeof g=="object"&&Number.isSafeInteger(g.itemIndex)&&g.itemIndex>=0&&Number.isSafeInteger(g.keyIndex)&&g.keyIndex>=0&&g.keyIndex<i.keys.length&&g.secretKey instanceof ArrayBuffer&&g.cipherData instanceof ArrayBuffer)))return!1;const{keys:t,items:u}=i,I=t.reduce((g,s)=>g+s.length*2,0)+u.reduce((g,s)=>g+s.secretKey.byteLength+s.cipherData.byteLength,0);return new Set(t).size===t.length&&new Set(u.map(g=>g.itemIndex)).size===u.length&&new Set(u.map(g=>g.keyIndex)).size===t.length&&(u.length===1||I<=262144)}return i.kind==="decrypt-rsa"&&i.data instanceof ArrayBuffer&&typeof i.privateKey=="string"&&(i.priority==="foreground"||i.priority==="background")}var fr=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function Ie(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}function lr(i){if(Object.prototype.hasOwnProperty.call(i,"__esModule"))return i;var e=i.default;if(typeof e=="function"){var t=function u(){var I=!1;try{I=this instanceof u}catch(g){}return I?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(i).forEach(function(u){var I=Object.getOwnPropertyDescriptor(i,u);Object.defineProperty(t,u,I.get?I:{enumerable:!0,get:function(){return i[u]}})}),t}var Ae={exports:{}},Be,ot;function H(){return ot||(ot=1,Be={options:{usePureJavaScript:!1}}),Be}var be={exports:{}},Ne,ut;function cr(){if(ut)return Ne;ut=1;var i={};Ne=i;var e={};i.encode=function(u,I,g){if(typeof I!="string")throw new TypeError('"alphabet" must be a string.');if(g!==void 0&&typeof g!="number")throw new TypeError('"maxline" must be a number.');var s="";if(!(u instanceof Uint8Array))s=t(u,I);else{var o=0,d=I.length,c=I.charAt(0),T=[0];for(o=0;o<u.length;++o){for(var R=0,x=u[o];R<T.length;++R)x+=T[R]<<8,T[R]=x%d,x=x/d|0;for(;x>0;)T.push(x%d),x=x/d|0}for(o=0;u[o]===0&&o<u.length-1;++o)s+=c;for(o=T.length-1;o>=0;--o)s+=I[T[o]]}if(g){var y=new RegExp(".{1,"+g+"}","g");s=s.match(y).join(`\r
|
|
2
2
|
`)}return s},i.decode=function(u,I){if(typeof u!="string")throw new TypeError('"input" must be a string.');if(typeof I!="string")throw new TypeError('"alphabet" must be a string.');var g=e[I];if(!g){g=e[I]=[];for(var s=0;s<I.length;++s)g[I.charCodeAt(s)]=s}u=u.replace(/\s/g,"");for(var o=I.length,d=I.charAt(0),c=[0],s=0;s<u.length;s++){var T=g[u.charCodeAt(s)];if(T===void 0)return;for(var R=0,x=T;R<c.length;++R)x+=c[R]*o,c[R]=x&255,x>>=8;for(;x>0;)c.push(x&255),x>>=8}for(var y=0;u[y]===d&&y<u.length-1;++y)c.push(0);return typeof Buffer!="undefined"?Buffer.from(c.reverse()):new Uint8Array(c.reverse())};function t(u,I){var g=0,s=I.length,o=I.charAt(0),d=[0];for(g=0;g<u.length();++g){for(var c=0,T=u.at(g);c<d.length;++c)T+=d[c]<<8,d[c]=T%s,T=T/s|0;for(;T>0;)d.push(T%s),T=T/s|0}var R="";for(g=0;u.at(g)===0&&g<u.length()-1;++g)R+=o;for(g=d.length-1;g>=0;--g)R+=I[d[g]];return R}return Ne}var ft;function X(){if(ft)return be.exports;ft=1;var i=H(),e=cr(),t=be.exports=i.util=i.util||{};(function(){if(typeof process!="undefined"&&process.nextTick&&!process.browser){t.nextTick=process.nextTick,typeof setImmediate=="function"?t.setImmediate=setImmediate:t.setImmediate=t.nextTick;return}if(typeof setImmediate=="function"){t.setImmediate=function(){return setImmediate.apply(void 0,arguments)},t.nextTick=function(r){return setImmediate(r)};return}if(t.setImmediate=function(r){setTimeout(r,0)},typeof window!="undefined"&&typeof window.postMessage=="function"){let r=function(f){if(f.source===window&&f.data===a){f.stopPropagation();var S=l.slice();l.length=0,S.forEach(function(w){w()})}};var a="forge.setImmediate",l=[];t.setImmediate=function(f){l.push(f),l.length===1&&window.postMessage(a,"*")},window.addEventListener("message",r,!0)}if(typeof MutationObserver!="undefined"){var h=Date.now(),A=!0,b=document.createElement("div"),l=[];new MutationObserver(function(){var f=l.slice();l.length=0,f.forEach(function(S){S()})}).observe(b,{attributes:!0});var n=t.setImmediate;t.setImmediate=function(f){Date.now()-h>15?(h=Date.now(),n(f)):(l.push(f),l.length===1&&b.setAttribute("a",A=!A))}}t.nextTick=t.setImmediate})(),t.isNodejs=typeof process!="undefined"&&process.versions&&process.versions.node,t.globalScope=(function(){return t.isNodejs?fr:typeof self=="undefined"?window:self})(),t.isArray=Array.isArray||function(a){return Object.prototype.toString.call(a)==="[object Array]"},t.isArrayBuffer=function(a){return typeof ArrayBuffer!="undefined"&&a instanceof ArrayBuffer},t.isArrayBufferView=function(a){return a&&t.isArrayBuffer(a.buffer)&&a.byteLength!==void 0};function u(a){if(!(a===8||a===16||a===24||a===32))throw new Error("Only 8, 16, 24, or 32 bits supported: "+a)}t.ByteBuffer=I;function I(a){if(this.data="",this.read=0,typeof a=="string")this.data=a;else if(t.isArrayBuffer(a)||t.isArrayBufferView(a))if(typeof Buffer!="undefined"&&a instanceof Buffer)this.data=a.toString("binary");else{var l=new Uint8Array(a);try{this.data=String.fromCharCode.apply(null,l)}catch(A){for(var h=0;h<l.length;++h)this.putByte(l[h])}}else(a instanceof I||typeof a=="object"&&typeof a.data=="string"&&typeof a.read=="number")&&(this.data=a.data,this.read=a.read);this._constructedStringLength=0}t.ByteStringBuffer=I;var g=4096;t.ByteStringBuffer.prototype._optimizeConstructedString=function(a){this._constructedStringLength+=a,this._constructedStringLength>g&&(this.data.substr(0,1),this._constructedStringLength=0)},t.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read},t.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0},t.ByteStringBuffer.prototype.putByte=function(a){return this.putBytes(String.fromCharCode(a))},t.ByteStringBuffer.prototype.fillWithByte=function(a,l){a=String.fromCharCode(a);for(var h=this.data;l>0;)l&1&&(h+=a),l>>>=1,l>0&&(a+=a);return this.data=h,this._optimizeConstructedString(l),this},t.ByteStringBuffer.prototype.putBytes=function(a){return this.data+=a,this._optimizeConstructedString(a.length),this},t.ByteStringBuffer.prototype.putString=function(a){return this.putBytes(t.encodeUtf8(a))},t.ByteStringBuffer.prototype.putInt16=function(a){return this.putBytes(String.fromCharCode(a>>8&255)+String.fromCharCode(a&255))},t.ByteStringBuffer.prototype.putInt24=function(a){return this.putBytes(String.fromCharCode(a>>16&255)+String.fromCharCode(a>>8&255)+String.fromCharCode(a&255))},t.ByteStringBuffer.prototype.putInt32=function(a){return this.putBytes(String.fromCharCode(a>>24&255)+String.fromCharCode(a>>16&255)+String.fromCharCode(a>>8&255)+String.fromCharCode(a&255))},t.ByteStringBuffer.prototype.putInt16Le=function(a){return this.putBytes(String.fromCharCode(a&255)+String.fromCharCode(a>>8&255))},t.ByteStringBuffer.prototype.putInt24Le=function(a){return this.putBytes(String.fromCharCode(a&255)+String.fromCharCode(a>>8&255)+String.fromCharCode(a>>16&255))},t.ByteStringBuffer.prototype.putInt32Le=function(a){return this.putBytes(String.fromCharCode(a&255)+String.fromCharCode(a>>8&255)+String.fromCharCode(a>>16&255)+String.fromCharCode(a>>24&255))},t.ByteStringBuffer.prototype.putInt=function(a,l){u(l);var h="";do l-=8,h+=String.fromCharCode(a>>l&255);while(l>0);return this.putBytes(h)},t.ByteStringBuffer.prototype.putSignedInt=function(a,l){return a<0&&(a+=2<<l-1),this.putInt(a,l)},t.ByteStringBuffer.prototype.putBuffer=function(a){return this.putBytes(a.getBytes())},t.ByteStringBuffer.prototype.getByte=function(){return this.data.charCodeAt(this.read++)},t.ByteStringBuffer.prototype.getInt16=function(){var a=this.data.charCodeAt(this.read)<<8^this.data.charCodeAt(this.read+1);return this.read+=2,a},t.ByteStringBuffer.prototype.getInt24=function(){var a=this.data.charCodeAt(this.read)<<16^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2);return this.read+=3,a},t.ByteStringBuffer.prototype.getInt32=function(){var a=this.data.charCodeAt(this.read)<<24^this.data.charCodeAt(this.read+1)<<16^this.data.charCodeAt(this.read+2)<<8^this.data.charCodeAt(this.read+3);return this.read+=4,a},t.ByteStringBuffer.prototype.getInt16Le=function(){var a=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8;return this.read+=2,a},t.ByteStringBuffer.prototype.getInt24Le=function(){var a=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16;return this.read+=3,a},t.ByteStringBuffer.prototype.getInt32Le=function(){var a=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16^this.data.charCodeAt(this.read+3)<<24;return this.read+=4,a},t.ByteStringBuffer.prototype.getInt=function(a){u(a);var l=0;do l=(l<<8)+this.data.charCodeAt(this.read++),a-=8;while(a>0);return l},t.ByteStringBuffer.prototype.getSignedInt=function(a){var l=this.getInt(a),h=2<<a-2;return l>=h&&(l-=h<<1),l},t.ByteStringBuffer.prototype.getBytes=function(a){var l;return a?(a=Math.min(this.length(),a),l=this.data.slice(this.read,this.read+a),this.read+=a):a===0?l="":(l=this.read===0?this.data:this.data.slice(this.read),this.clear()),l},t.ByteStringBuffer.prototype.bytes=function(a){return typeof a=="undefined"?this.data.slice(this.read):this.data.slice(this.read,this.read+a)},t.ByteStringBuffer.prototype.at=function(a){return this.data.charCodeAt(this.read+a)},t.ByteStringBuffer.prototype.setAt=function(a,l){return this.data=this.data.substr(0,this.read+a)+String.fromCharCode(l)+this.data.substr(this.read+a+1),this},t.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)},t.ByteStringBuffer.prototype.copy=function(){var a=t.createBuffer(this.data);return a.read=this.read,a},t.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this},t.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this},t.ByteStringBuffer.prototype.truncate=function(a){var l=Math.max(0,this.length()-a);return this.data=this.data.substr(this.read,l),this.read=0,this},t.ByteStringBuffer.prototype.toHex=function(){for(var a="",l=this.read;l<this.data.length;++l){var h=this.data.charCodeAt(l);h<16&&(a+="0"),a+=h.toString(16)}return a},t.ByteStringBuffer.prototype.toString=function(){return t.decodeUtf8(this.bytes())};function s(a,l){l=l||{},this.read=l.readOffset||0,this.growSize=l.growSize||1024;var h=t.isArrayBuffer(a),A=t.isArrayBufferView(a);if(h||A){h?this.data=new DataView(a):this.data=new DataView(a.buffer,a.byteOffset,a.byteLength),this.write="writeOffset"in l?l.writeOffset:this.data.byteLength;return}this.data=new DataView(new ArrayBuffer(0)),this.write=0,a!=null&&this.putBytes(a),"writeOffset"in l&&(this.write=l.writeOffset)}t.DataBuffer=s,t.DataBuffer.prototype.length=function(){return this.write-this.read},t.DataBuffer.prototype.isEmpty=function(){return this.length()<=0},t.DataBuffer.prototype.accommodate=function(a,l){if(this.length()>=a)return this;l=Math.max(l||this.growSize,a);var h=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),A=new Uint8Array(this.length()+l);return A.set(h),this.data=new DataView(A.buffer),this},t.DataBuffer.prototype.putByte=function(a){return this.accommodate(1),this.data.setUint8(this.write++,a),this},t.DataBuffer.prototype.fillWithByte=function(a,l){this.accommodate(l);for(var h=0;h<l;++h)this.data.setUint8(a);return this},t.DataBuffer.prototype.putBytes=function(a,l){if(t.isArrayBufferView(a)){var h=new Uint8Array(a.buffer,a.byteOffset,a.byteLength),A=h.byteLength-h.byteOffset;this.accommodate(A);var b=new Uint8Array(this.data.buffer,this.write);return b.set(h),this.write+=A,this}if(t.isArrayBuffer(a)){var h=new Uint8Array(a);this.accommodate(h.byteLength);var b=new Uint8Array(this.data.buffer);return b.set(h,this.write),this.write+=h.byteLength,this}if(a instanceof t.DataBuffer||typeof a=="object"&&typeof a.read=="number"&&typeof a.write=="number"&&t.isArrayBufferView(a.data)){var h=new Uint8Array(a.data.byteLength,a.read,a.length());this.accommodate(h.byteLength);var b=new Uint8Array(a.data.byteLength,this.write);return b.set(h),this.write+=h.byteLength,this}if(a instanceof t.ByteStringBuffer&&(a=a.data,l="binary"),l=l||"binary",typeof a=="string"){var n;if(l==="hex")return this.accommodate(Math.ceil(a.length/2)),n=new Uint8Array(this.data.buffer,this.write),this.write+=t.binary.hex.decode(a,n,this.write),this;if(l==="base64")return this.accommodate(Math.ceil(a.length/4)*3),n=new Uint8Array(this.data.buffer,this.write),this.write+=t.binary.base64.decode(a,n,this.write),this;if(l==="utf8"&&(a=t.encodeUtf8(a),l="binary"),l==="binary"||l==="raw")return this.accommodate(a.length),n=new Uint8Array(this.data.buffer,this.write),this.write+=t.binary.raw.decode(n),this;if(l==="utf16")return this.accommodate(a.length*2),n=new Uint16Array(this.data.buffer,this.write),this.write+=t.text.utf16.encode(n),this;throw new Error("Invalid encoding: "+l)}throw Error("Invalid parameter: "+a)},t.DataBuffer.prototype.putBuffer=function(a){return this.putBytes(a),a.clear(),this},t.DataBuffer.prototype.putString=function(a){return this.putBytes(a,"utf16")},t.DataBuffer.prototype.putInt16=function(a){return this.accommodate(2),this.data.setInt16(this.write,a),this.write+=2,this},t.DataBuffer.prototype.putInt24=function(a){return this.accommodate(3),this.data.setInt16(this.write,a>>8&65535),this.data.setInt8(this.write,a>>16&255),this.write+=3,this},t.DataBuffer.prototype.putInt32=function(a){return this.accommodate(4),this.data.setInt32(this.write,a),this.write+=4,this},t.DataBuffer.prototype.putInt16Le=function(a){return this.accommodate(2),this.data.setInt16(this.write,a,!0),this.write+=2,this},t.DataBuffer.prototype.putInt24Le=function(a){return this.accommodate(3),this.data.setInt8(this.write,a>>16&255),this.data.setInt16(this.write,a>>8&65535,!0),this.write+=3,this},t.DataBuffer.prototype.putInt32Le=function(a){return this.accommodate(4),this.data.setInt32(this.write,a,!0),this.write+=4,this},t.DataBuffer.prototype.putInt=function(a,l){u(l),this.accommodate(l/8);do l-=8,this.data.setInt8(this.write++,a>>l&255);while(l>0);return this},t.DataBuffer.prototype.putSignedInt=function(a,l){return u(l),this.accommodate(l/8),a<0&&(a+=2<<l-1),this.putInt(a,l)},t.DataBuffer.prototype.getByte=function(){return this.data.getInt8(this.read++)},t.DataBuffer.prototype.getInt16=function(){var a=this.data.getInt16(this.read);return this.read+=2,a},t.DataBuffer.prototype.getInt24=function(){var a=this.data.getInt16(this.read)<<8^this.data.getInt8(this.read+2);return this.read+=3,a},t.DataBuffer.prototype.getInt32=function(){var a=this.data.getInt32(this.read);return this.read+=4,a},t.DataBuffer.prototype.getInt16Le=function(){var a=this.data.getInt16(this.read,!0);return this.read+=2,a},t.DataBuffer.prototype.getInt24Le=function(){var a=this.data.getInt8(this.read)^this.data.getInt16(this.read+1,!0)<<8;return this.read+=3,a},t.DataBuffer.prototype.getInt32Le=function(){var a=this.data.getInt32(this.read,!0);return this.read+=4,a},t.DataBuffer.prototype.getInt=function(a){u(a);var l=0;do l=(l<<8)+this.data.getInt8(this.read++),a-=8;while(a>0);return l},t.DataBuffer.prototype.getSignedInt=function(a){var l=this.getInt(a),h=2<<a-2;return l>=h&&(l-=h<<1),l},t.DataBuffer.prototype.getBytes=function(a){var l;return a?(a=Math.min(this.length(),a),l=this.data.slice(this.read,this.read+a),this.read+=a):a===0?l="":(l=this.read===0?this.data:this.data.slice(this.read),this.clear()),l},t.DataBuffer.prototype.bytes=function(a){return typeof a=="undefined"?this.data.slice(this.read):this.data.slice(this.read,this.read+a)},t.DataBuffer.prototype.at=function(a){return this.data.getUint8(this.read+a)},t.DataBuffer.prototype.setAt=function(a,l){return this.data.setUint8(a,l),this},t.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)},t.DataBuffer.prototype.copy=function(){return new t.DataBuffer(this)},t.DataBuffer.prototype.compact=function(){if(this.read>0){var a=new Uint8Array(this.data.buffer,this.read),l=new Uint8Array(a.byteLength);l.set(a),this.data=new DataView(l),this.write-=this.read,this.read=0}return this},t.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this},t.DataBuffer.prototype.truncate=function(a){return this.write=Math.max(0,this.length()-a),this.read=Math.min(this.read,this.write),this},t.DataBuffer.prototype.toHex=function(){for(var a="",l=this.read;l<this.data.byteLength;++l){var h=this.data.getUint8(l);h<16&&(a+="0"),a+=h.toString(16)}return a},t.DataBuffer.prototype.toString=function(a){var l=new Uint8Array(this.data,this.read,this.length());if(a=a||"utf8",a==="binary"||a==="raw")return t.binary.raw.encode(l);if(a==="hex")return t.binary.hex.encode(l);if(a==="base64")return t.binary.base64.encode(l);if(a==="utf8")return t.text.utf8.decode(l);if(a==="utf16")return t.text.utf16.decode(l);throw new Error("Invalid encoding: "+a)},t.createBuffer=function(a,l){return l=l||"raw",a!==void 0&&l==="utf8"&&(a=t.encodeUtf8(a)),new t.ByteBuffer(a)},t.fillString=function(a,l){for(var h="";l>0;)l&1&&(h+=a),l>>>=1,l>0&&(a+=a);return h},t.xorBytes=function(a,l,h){for(var A="",b="",n="",r=0,f=0;h>0;--h,++r)b=a.charCodeAt(r)^l.charCodeAt(r),f>=10&&(A+=n,n="",f=0),n+=String.fromCharCode(b),++f;return A+=n,A},t.hexToBytes=function(a){var l="",h=0;for(a.length&!0&&(h=1,l+=String.fromCharCode(parseInt(a[0],16)));h<a.length;h+=2)l+=String.fromCharCode(parseInt(a.substr(h,2),16));return l},t.bytesToHex=function(a){return t.createBuffer(a).toHex()},t.int32ToBytes=function(a){return String.fromCharCode(a>>24&255)+String.fromCharCode(a>>16&255)+String.fromCharCode(a>>8&255)+String.fromCharCode(a&255)};var o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",d=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],c="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";t.encode64=function(a,l){for(var h="",A="",b,n,r,f=0;f<a.length;)b=a.charCodeAt(f++),n=a.charCodeAt(f++),r=a.charCodeAt(f++),h+=o.charAt(b>>2),h+=o.charAt((b&3)<<4|n>>4),isNaN(n)?h+="==":(h+=o.charAt((n&15)<<2|r>>6),h+=isNaN(r)?"=":o.charAt(r&63)),l&&h.length>l&&(A+=h.substr(0,l)+`\r
|
|
3
3
|
`,h=h.substr(l));return A+=h,A},t.decode64=function(a){a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var l="",h,A,b,n,r=0;r<a.length;)h=d[a.charCodeAt(r++)-43],A=d[a.charCodeAt(r++)-43],b=d[a.charCodeAt(r++)-43],n=d[a.charCodeAt(r++)-43],l+=String.fromCharCode(h<<2|A>>4),b!==64&&(l+=String.fromCharCode((A&15)<<4|b>>2),n!==64&&(l+=String.fromCharCode((b&3)<<6|n)));return l},t.encodeUtf8=function(a){return unescape(encodeURIComponent(a))},t.decodeUtf8=function(a){return decodeURIComponent(escape(a))},t.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:e.encode,decode:e.decode}},t.binary.raw.encode=function(a){return String.fromCharCode.apply(null,a)},t.binary.raw.decode=function(a,l,h){var A=l;A||(A=new Uint8Array(a.length)),h=h||0;for(var b=h,n=0;n<a.length;++n)A[b++]=a.charCodeAt(n);return l?b-h:A},t.binary.hex.encode=t.bytesToHex,t.binary.hex.decode=function(a,l,h){var A=l;A||(A=new Uint8Array(Math.ceil(a.length/2))),h=h||0;var b=0,n=h;for(a.length&1&&(b=1,A[n++]=parseInt(a[0],16));b<a.length;b+=2)A[n++]=parseInt(a.substr(b,2),16);return l?n-h:A},t.binary.base64.encode=function(a,l){for(var h="",A="",b,n,r,f=0;f<a.byteLength;)b=a[f++],n=a[f++],r=a[f++],h+=o.charAt(b>>2),h+=o.charAt((b&3)<<4|n>>4),isNaN(n)?h+="==":(h+=o.charAt((n&15)<<2|r>>6),h+=isNaN(r)?"=":o.charAt(r&63)),l&&h.length>l&&(A+=h.substr(0,l)+`\r
|
|
4
|
-
`,h=h.substr(l));return A+=h,A},t.binary.base64.decode=function(a,l,h){var A=l;A||(A=new Uint8Array(Math.ceil(a.length/4)*3)),a=a.replace(/[^A-Za-z0-9\+\/\=]/g,""),h=h||0;for(var b,n,r,f,S=0,w=h;S<a.length;)b=d[a.charCodeAt(S++)-43],n=d[a.charCodeAt(S++)-43],r=d[a.charCodeAt(S++)-43],f=d[a.charCodeAt(S++)-43],A[w++]=b<<2|n>>4,r!==64&&(A[w++]=(n&15)<<4|r>>2,f!==64&&(A[w++]=(r&3)<<6|f));return l?w-h:A.subarray(0,w)},t.binary.base58.encode=function(a,l){return t.binary.baseN.encode(a,c,l)},t.binary.base58.decode=function(a,l){return t.binary.baseN.decode(a,c,l)},t.text={utf8:{},utf16:{}},t.text.utf8.encode=function(a,l,h){a=t.encodeUtf8(a);var A=l;A||(A=new Uint8Array(a.length)),h=h||0;for(var b=h,n=0;n<a.length;++n)A[b++]=a.charCodeAt(n);return l?b-h:A},t.text.utf8.decode=function(a){return t.decodeUtf8(String.fromCharCode.apply(null,a))},t.text.utf16.encode=function(a,l,h){var A=l;A||(A=new Uint8Array(a.length*2));var b=new Uint16Array(A.buffer);h=h||0;for(var n=h,r=h,f=0;f<a.length;++f)b[r++]=a.charCodeAt(f),n+=2;return l?n-h:A},t.text.utf16.decode=function(a){return String.fromCharCode.apply(null,new Uint16Array(a.buffer))},t.deflate=function(a,l,h){if(l=t.decode64(a.deflate(t.encode64(l)).rval),h){var A=2,b=l.charCodeAt(1);b&32&&(A=6),l=l.substring(A,l.length-4)}return l},t.inflate=function(a,l,h){var A=a.inflate(t.encode64(l)).rval;return A===null?null:t.decode64(A)};var T=function(a,l,h){if(!a)throw new Error("WebStorage not available.");var A;if(h===null?A=a.removeItem(l):(h=t.encode64(JSON.stringify(h)),A=a.setItem(l,h)),typeof A!="undefined"&&A.rval!==!0){var b=new Error(A.error.message);throw b.id=A.error.id,b.name=A.error.name,b}},R=function(a,l){if(!a)throw new Error("WebStorage not available.");var h=a.getItem(l);if(a.init)if(h.rval===null){if(h.error){var A=new Error(h.error.message);throw A.id=h.error.id,A.name=h.error.name,A}h=null}else h=h.rval;return h!==null&&(h=JSON.parse(t.decode64(h))),h},x=function(a,l,h,A){var b=R(a,l);b===null&&(b={}),b[h]=A,T(a,l,b)},y=function(a,l,h){var A=R(a,l);return A!==null&&(A=h in A?A[h]:null),A},E=function(a,l,h){var A=R(a,l);if(A!==null&&h in A){delete A[h];var b=!0;for(var n in A){b=!1;break}b&&(A=null),T(a,l,A)}},v=function(a,l){T(a,l,null)},m=function(a,l,h){var A=null;typeof h=="undefined"&&(h=["web","flash"]);var b,n=!1,r=null;for(var f in h){b=h[f];try{if(b==="flash"||b==="both"){if(l[0]===null)throw new Error("Flash local storage not available.");A=a.apply(this,l),n=b==="flash"}(b==="web"||b==="both")&&(l[0]=localStorage,A=a.apply(this,l),n=!0)}catch(S){r=S}if(n)break}if(!n)throw r;return A};return t.setItem=function(a,l,h,A,b){m(x,arguments,b)},t.getItem=function(a,l,h,A){return m(y,arguments,A)},t.removeItem=function(a,l,h,A){m(E,arguments,A)},t.clearItems=function(a,l,h){m(v,arguments,h)},t.isEmpty=function(a){for(var l in a)if(a.hasOwnProperty(l))return!1;return!0},t.format=function(a){for(var l=/%./g,h,A,b=0,n=[],r=0;h=l.exec(a);){A=a.substring(r,l.lastIndex-2),A.length>0&&n.push(A),r=l.lastIndex;var f=h[0][1];switch(f){case"s":case"o":b<arguments.length?n.push(arguments[b+++1]):n.push("<?>");break;case"%":n.push("%");break;default:n.push("<%"+f+"?>")}}return n.push(a.substring(r)),n.join("")},t.formatNumber=function(a,l,h,A){var b=a,n=isNaN(l=Math.abs(l))?2:l,r=h===void 0?",":h,f=A===void 0?".":A,S=b<0?"-":"",w=parseInt(b=Math.abs(+b||0).toFixed(n),10)+"",U=w.length>3?w.length%3:0;return S+(U?w.substr(0,U)+f:"")+w.substr(U).replace(/(\d{3})(?=\d)/g,"$1"+f)+(n?r+Math.abs(b-w).toFixed(n).slice(2):"")},t.formatSize=function(a){return a>=1073741824?a=t.formatNumber(a/1073741824,2,".","")+" GiB":a>=1048576?a=t.formatNumber(a/1048576,2,".","")+" MiB":a>=1024?a=t.formatNumber(a/1024,0)+" KiB":a=t.formatNumber(a,0)+" bytes",a},t.bytesFromIP=function(a){return a.indexOf(".")!==-1?t.bytesFromIPv4(a):a.indexOf(":")!==-1?t.bytesFromIPv6(a):null},t.bytesFromIPv4=function(a){if(a=a.split("."),a.length!==4)return null;for(var l=t.createBuffer(),h=0;h<a.length;++h){var A=parseInt(a[h],10);if(isNaN(A))return null;l.putByte(A)}return l.getBytes()},t.bytesFromIPv6=function(a){var l=0;a=a.split(":").filter(function(r){return r.length===0&&++l,!0});for(var h=(8-a.length+l)*2,A=t.createBuffer(),b=0;b<8;++b){if(!a[b]||a[b].length===0){A.fillWithByte(0,h),h=0;continue}var n=t.hexToBytes(a[b]);n.length<2&&A.putByte(0),A.putBytes(n)}return A.getBytes()},t.bytesToIP=function(a){return a.length===4?t.bytesToIPv4(a):a.length===16?t.bytesToIPv6(a):null},t.bytesToIPv4=function(a){if(a.length!==4)return null;for(var l=[],h=0;h<a.length;++h)l.push(a.charCodeAt(h));return l.join(".")},t.bytesToIPv6=function(a){if(a.length!==16)return null;for(var l=[],h=[],A=0,b=0;b<a.length;b+=2){for(var n=t.bytesToHex(a[b]+a[b+1]);n[0]==="0"&&n!=="0";)n=n.substr(1);if(n==="0"){var r=h[h.length-1],f=l.length;!r||f!==r.end+1?h.push({start:f,end:f}):(r.end=f,r.end-r.start>h[A].end-h[A].start&&(A=h.length-1))}l.push(n)}if(h.length>0){var S=h[A];S.end-S.start>0&&(l.splice(S.start,S.end-S.start+1,""),S.start===0&&l.unshift(""),S.end===7&&l.push(""))}return l.join(":")},t.estimateCores=function(a,l){if(typeof a=="function"&&(l=a,a={}),a=a||{},"cores"in t&&!a.update)return l(null,t.cores);if(typeof navigator!="undefined"&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return t.cores=navigator.hardwareConcurrency,l(null,t.cores);if(typeof Worker=="undefined")return t.cores=1,l(null,t.cores);if(typeof Blob=="undefined")return t.cores=2,l(null,t.cores);var h=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",function(r){var f=Date.now(),S=f+4;self.postMessage({st:f,et:S})})}.toString(),")()"],{type:"application/javascript"}));A([],5,16);function A(r,f,S){if(f===0){var w=Math.floor(r.reduce(function(U,N){return U+N},0)/r.length);return t.cores=Math.max(1,w),URL.revokeObjectURL(h),l(null,t.cores)}b(S,function(U,N){r.push(n(S,N)),A(r,f-1,S)})}function b(r,f){for(var S=[],w=[],U=0;U<r;++U){var N=new Worker(h);N.addEventListener("message",function(L){if(w.push(L.data),w.length===r){for(var P=0;P<r;++P)S[P].terminate();f(null,w)}}),S.push(N)}for(var U=0;U<r;++U)S[U].postMessage(U)}function n(r,f){for(var S=[],w=0;w<r;++w)for(var U=f[w],N=S[w]=[],L=0;L<r;++L)if(w!==L){var P=f[L];(U.st>P.st&&U.st<P.et||P.st>U.st&&P.st<U.et)&&N.push(L)}return S.reduce(function(_,k){return Math.max(_,k.length)},0)}},be.exports}var Re={exports:{}},lt;function he(){if(lt)return Re.exports;lt=1;var i=H();i.pki=i.pki||{};var e=Re.exports=i.pki.oids=i.oids=i.oids||{};function t(I,g){e[I]=g,e[g]=I}function u(I,g){e[I]=g}return t("1.2.840.113549.1.1.1","rsaEncryption"),t("1.2.840.113549.1.1.4","md5WithRSAEncryption"),t("1.2.840.113549.1.1.5","sha1WithRSAEncryption"),t("1.2.840.113549.1.1.7","RSAES-OAEP"),t("1.2.840.113549.1.1.8","mgf1"),t("1.2.840.113549.1.1.9","pSpecified"),t("1.2.840.113549.1.1.10","RSASSA-PSS"),t("1.2.840.113549.1.1.11","sha256WithRSAEncryption"),t("1.2.840.113549.1.1.12","sha384WithRSAEncryption"),t("1.2.840.113549.1.1.13","sha512WithRSAEncryption"),t("1.3.101.112","EdDSA25519"),t("1.2.840.10040.4.3","dsa-with-sha1"),t("1.3.14.3.2.7","desCBC"),t("1.3.14.3.2.26","sha1"),t("1.3.14.3.2.29","sha1WithRSASignature"),t("2.16.840.1.101.3.4.2.1","sha256"),t("2.16.840.1.101.3.4.2.2","sha384"),t("2.16.840.1.101.3.4.2.3","sha512"),t("2.16.840.1.101.3.4.2.4","sha224"),t("2.16.840.1.101.3.4.2.5","sha512-224"),t("2.16.840.1.101.3.4.2.6","sha512-256"),t("1.2.840.113549.2.2","md2"),t("1.2.840.113549.2.5","md5"),t("1.2.840.113549.1.7.1","data"),t("1.2.840.113549.1.7.2","signedData"),t("1.2.840.113549.1.7.3","envelopedData"),t("1.2.840.113549.1.7.4","signedAndEnvelopedData"),t("1.2.840.113549.1.7.5","digestedData"),t("1.2.840.113549.1.7.6","encryptedData"),t("1.2.840.113549.1.9.1","emailAddress"),t("1.2.840.113549.1.9.2","unstructuredName"),t("1.2.840.113549.1.9.3","contentType"),t("1.2.840.113549.1.9.4","messageDigest"),t("1.2.840.113549.1.9.5","signingTime"),t("1.2.840.113549.1.9.6","counterSignature"),t("1.2.840.113549.1.9.7","challengePassword"),t("1.2.840.113549.1.9.8","unstructuredAddress"),t("1.2.840.113549.1.9.14","extensionRequest"),t("1.2.840.113549.1.9.20","friendlyName"),t("1.2.840.113549.1.9.21","localKeyId"),t("1.2.840.113549.1.9.22.1","x509Certificate"),t("1.2.840.113549.1.12.10.1.1","keyBag"),t("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag"),t("1.2.840.113549.1.12.10.1.3","certBag"),t("1.2.840.113549.1.12.10.1.4","crlBag"),t("1.2.840.113549.1.12.10.1.5","secretBag"),t("1.2.840.113549.1.12.10.1.6","safeContentsBag"),t("1.2.840.113549.1.5.13","pkcs5PBES2"),t("1.2.840.113549.1.5.12","pkcs5PBKDF2"),t("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4"),t("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4"),t("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC"),t("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC"),t("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC"),t("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC"),t("1.2.840.113549.2.7","hmacWithSHA1"),t("1.2.840.113549.2.8","hmacWithSHA224"),t("1.2.840.113549.2.9","hmacWithSHA256"),t("1.2.840.113549.2.10","hmacWithSHA384"),t("1.2.840.113549.2.11","hmacWithSHA512"),t("1.2.840.113549.3.7","des-EDE3-CBC"),t("2.16.840.1.101.3.4.1.2","aes128-CBC"),t("2.16.840.1.101.3.4.1.22","aes192-CBC"),t("2.16.840.1.101.3.4.1.42","aes256-CBC"),t("2.5.4.3","commonName"),t("2.5.4.4","surname"),t("2.5.4.5","serialNumber"),t("2.5.4.6","countryName"),t("2.5.4.7","localityName"),t("2.5.4.8","stateOrProvinceName"),t("2.5.4.9","streetAddress"),t("2.5.4.10","organizationName"),t("2.5.4.11","organizationalUnitName"),t("2.5.4.12","title"),t("2.5.4.13","description"),t("2.5.4.15","businessCategory"),t("2.5.4.17","postalCode"),t("2.5.4.42","givenName"),t("2.5.4.65","pseudonym"),t("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName"),t("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName"),t("2.16.840.1.113730.1.1","nsCertType"),t("2.16.840.1.113730.1.13","nsComment"),u("2.5.29.1","authorityKeyIdentifier"),u("2.5.29.2","keyAttributes"),u("2.5.29.3","certificatePolicies"),u("2.5.29.4","keyUsageRestriction"),u("2.5.29.5","policyMapping"),u("2.5.29.6","subtreesConstraint"),u("2.5.29.7","subjectAltName"),u("2.5.29.8","issuerAltName"),u("2.5.29.9","subjectDirectoryAttributes"),u("2.5.29.10","basicConstraints"),u("2.5.29.11","nameConstraints"),u("2.5.29.12","policyConstraints"),u("2.5.29.13","basicConstraints"),t("2.5.29.14","subjectKeyIdentifier"),t("2.5.29.15","keyUsage"),u("2.5.29.16","privateKeyUsagePeriod"),t("2.5.29.17","subjectAltName"),t("2.5.29.18","issuerAltName"),t("2.5.29.19","basicConstraints"),u("2.5.29.20","cRLNumber"),u("2.5.29.21","cRLReason"),u("2.5.29.22","expirationDate"),u("2.5.29.23","instructionCode"),u("2.5.29.24","invalidityDate"),u("2.5.29.25","cRLDistributionPoints"),u("2.5.29.26","issuingDistributionPoint"),u("2.5.29.27","deltaCRLIndicator"),u("2.5.29.28","issuingDistributionPoint"),u("2.5.29.29","certificateIssuer"),u("2.5.29.30","nameConstraints"),t("2.5.29.31","cRLDistributionPoints"),t("2.5.29.32","certificatePolicies"),u("2.5.29.33","policyMappings"),u("2.5.29.34","policyConstraints"),t("2.5.29.35","authorityKeyIdentifier"),u("2.5.29.36","policyConstraints"),t("2.5.29.37","extKeyUsage"),u("2.5.29.46","freshestCRL"),u("2.5.29.54","inhibitAnyPolicy"),t("1.3.6.1.4.1.11129.2.4.2","timestampList"),t("1.3.6.1.5.5.7.1.1","authorityInfoAccess"),t("1.3.6.1.5.5.7.3.1","serverAuth"),t("1.3.6.1.5.5.7.3.2","clientAuth"),t("1.3.6.1.5.5.7.3.3","codeSigning"),t("1.3.6.1.5.5.7.3.4","emailProtection"),t("1.3.6.1.5.5.7.3.8","timeStamping"),Re.exports}var ct;function ce(){if(ct)return Ae.exports;ct=1;var i=H();X(),he();var e=Ae.exports=i.asn1=i.asn1||{};e.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192},e.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30},e.maxDepth=256,e.create=function(s,o,d,c,T){if(i.util.isArray(c)){for(var R=[],x=0;x<c.length;++x)c[x]!==void 0&&R.push(c[x]);c=R}var y={tagClass:s,type:o,constructed:d,composed:d||i.util.isArray(c),value:c};return T&&"bitStringContents"in T&&(y.bitStringContents=T.bitStringContents,y.original=e.copy(y)),y},e.copy=function(s,o){var d;if(i.util.isArray(s)){d=[];for(var c=0;c<s.length;++c)d.push(e.copy(s[c],o));return d}return typeof s=="string"?s:(d={tagClass:s.tagClass,type:s.type,constructed:s.constructed,composed:s.composed,value:e.copy(s.value,o)},o&&!o.excludeBitStringContents&&(d.bitStringContents=s.bitStringContents),d)},e.equals=function(s,o,d){if(i.util.isArray(s)){if(!i.util.isArray(o)||s.length!==o.length)return!1;for(var c=0;c<s.length;++c)if(!e.equals(s[c],o[c]))return!1;return!0}if(typeof s!=typeof o)return!1;if(typeof s=="string")return s===o;var T=s.tagClass===o.tagClass&&s.type===o.type&&s.constructed===o.constructed&&s.composed===o.composed&&e.equals(s.value,o.value);return d&&d.includeBitStringContents&&(T=T&&s.bitStringContents===o.bitStringContents),T},e.getBerValueLength=function(s){var o=s.getByte();if(o!==128){var d,c=o&128;return c?d=s.getInt((o&127)<<3):d=o,d}};function t(s,o,d){if(d>o){var c=new Error("Too few bytes to parse DER.");throw c.available=s.length(),c.remaining=o,c.requested=d,c}}var u=function(s,o){var d=s.getByte();if(o--,d!==128){var c,T=d&128;if(!T)c=d;else{var R=d&127;t(s,o,R),c=s.getInt(R<<3)}if(c<0)throw new Error("Negative length: "+c);return c}};e.fromDer=function(s,o){o===void 0&&(o={strict:!0,parseAllBytes:!0,decodeBitStrings:!0}),typeof o=="boolean"&&(o={strict:o,parseAllBytes:!0,decodeBitStrings:!0}),"strict"in o||(o.strict=!0),"parseAllBytes"in o||(o.parseAllBytes=!0),"decodeBitStrings"in o||(o.decodeBitStrings=!0),"maxDepth"in o||(o.maxDepth=e.maxDepth),typeof s=="string"&&(s=i.util.createBuffer(s));var d=s.length(),c=I(s,s.length(),0,o);if(o.parseAllBytes&&s.length()!==0){var T=new Error("Unparsed DER bytes remain after ASN.1 parsing.");throw T.byteCount=d,T.remaining=s.length(),T}return c};function I(s,o,d,c){if(d>=c.maxDepth)throw new Error("ASN.1 parsing error: Max depth exceeded.");var T;t(s,o,2);var R=s.getByte();o--;var x=R&192,y=R&31;T=s.length();var E=u(s,o);if(o-=T-s.length(),E!==void 0&&E>o){if(c.strict){var v=new Error("Too few bytes to read ASN.1 value.");throw v.available=s.length(),v.remaining=o,v.requested=E,v}E=o}var m,a,l=(R&32)===32;if(l)if(m=[],E===void 0)for(;;){if(t(s,o,2),s.bytes(2)==="\0\0"){s.getBytes(2),o-=2;break}T=s.length(),m.push(I(s,o,d+1,c)),o-=T-s.length()}else for(;E>0;)T=s.length(),m.push(I(s,E,d+1,c)),o-=T-s.length(),E-=T-s.length();if(m===void 0&&x===e.Class.UNIVERSAL&&y===e.Type.BITSTRING&&(a=s.bytes(E)),m===void 0&&c.decodeBitStrings&&x===e.Class.UNIVERSAL&&y===e.Type.BITSTRING&&E>1){var h=s.read,A=o,b=0;if(y===e.Type.BITSTRING&&(t(s,o,1),b=s.getByte(),o--),b===0)try{T=s.length();var n={strict:!0,decodeBitStrings:!0},r=I(s,o,d+1,n),f=T-s.length();o-=f,y==e.Type.BITSTRING&&f++;var S=r.tagClass;f===E&&(S===e.Class.UNIVERSAL||S===e.Class.CONTEXT_SPECIFIC)&&(m=[r])}catch(U){}m===void 0&&(s.read=h,o=A)}if(m===void 0){if(E===void 0){if(c.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");E=o}if(y===e.Type.BMPSTRING)for(m="";E>0;E-=2)t(s,o,2),m+=String.fromCharCode(s.getInt16()),o-=2;else m=s.getBytes(E),o-=E}var w=a===void 0?null:{bitStringContents:a};return e.create(x,y,l,m,w)}e.toDer=function(s){var o=i.util.createBuffer(),d=s.tagClass|s.type,c=i.util.createBuffer(),T=!1;if("bitStringContents"in s&&(T=!0,s.original&&(T=e.equals(s,s.original))),T)c.putBytes(s.bitStringContents);else if(s.composed){s.constructed?d|=32:c.putByte(0);for(var R=0;R<s.value.length;++R)s.value[R]!==void 0&&c.putBuffer(e.toDer(s.value[R]))}else if(s.type===e.Type.BMPSTRING)for(var R=0;R<s.value.length;++R)c.putInt16(s.value.charCodeAt(R));else s.type===e.Type.INTEGER&&s.value.length>1&&(s.value.charCodeAt(0)===0&&(s.value.charCodeAt(1)&128)===0||s.value.charCodeAt(0)===255&&(s.value.charCodeAt(1)&128)===128)?c.putBytes(s.value.substr(1)):c.putBytes(s.value);if(o.putByte(d),c.length()<=127)o.putByte(c.length()&127);else{var x=c.length(),y="";do y+=String.fromCharCode(x&255),x=x>>>8;while(x>0);o.putByte(y.length|128);for(var R=y.length-1;R>=0;--R)o.putByte(y.charCodeAt(R))}return o.putBuffer(c),o},e.oidToDer=function(s){var o=s.split("."),d=i.util.createBuffer();d.putByte(40*parseInt(o[0],10)+parseInt(o[1],10));for(var c,T,R,x,y=2;y<o.length;++y){if(c=!0,T=[],R=parseInt(o[y],10),R>4294967295)throw new Error("OID value too large; max is 32-bits.");do x=R&127,R=R>>>7,c||(x|=128),T.push(x),c=!1;while(R>0);for(var E=T.length-1;E>=0;--E)d.putByte(T[E])}return d},e.derToOid=function(s){var o;typeof s=="string"&&(s=i.util.createBuffer(s));var d=s.getByte();o=Math.floor(d/40)+"."+d%40;for(var c=0;s.length()>0;){if(c>70368744177663)throw new Error("OID value too large; max is 53-bits.");d=s.getByte(),c=c*128,d&128?c+=d&127:(o+="."+(c+d),c=0)}return o},e.utcTimeToDate=function(s){var o=new Date,d=parseInt(s.substr(0,2),10);d=d>=50?1900+d:2e3+d;var c=parseInt(s.substr(2,2),10)-1,T=parseInt(s.substr(4,2),10),R=parseInt(s.substr(6,2),10),x=parseInt(s.substr(8,2),10),y=0;if(s.length>11){var E=s.charAt(10),v=10;E!=="+"&&E!=="-"&&(y=parseInt(s.substr(10,2),10),v+=2)}if(o.setUTCFullYear(d,c,T),o.setUTCHours(R,x,y,0),v&&(E=s.charAt(v),E==="+"||E==="-")){var m=parseInt(s.substr(v+1,2),10),a=parseInt(s.substr(v+4,2),10),l=m*60+a;l*=6e4,E==="+"?o.setTime(+o-l):o.setTime(+o+l)}return o},e.generalizedTimeToDate=function(s){var o=new Date,d=parseInt(s.substr(0,4),10),c=parseInt(s.substr(4,2),10)-1,T=parseInt(s.substr(6,2),10),R=parseInt(s.substr(8,2),10),x=parseInt(s.substr(10,2),10),y=parseInt(s.substr(12,2),10),E=0,v=0,m=!1;s.charAt(s.length-1)==="Z"&&(m=!0);var a=s.length-5,l=s.charAt(a);if(l==="+"||l==="-"){var h=parseInt(s.substr(a+1,2),10),A=parseInt(s.substr(a+4,2),10);v=h*60+A,v*=6e4,l==="+"&&(v*=-1),m=!0}return s.charAt(14)==="."&&(E=parseFloat(s.substr(14),10)*1e3),m?(o.setUTCFullYear(d,c,T),o.setUTCHours(R,x,y,E),o.setTime(+o+v)):(o.setFullYear(d,c,T),o.setHours(R,x,y,E)),o},e.dateToUtcTime=function(s){if(typeof s=="string")return s;var o="",d=[];d.push((""+s.getUTCFullYear()).substr(2)),d.push(""+(s.getUTCMonth()+1)),d.push(""+s.getUTCDate()),d.push(""+s.getUTCHours()),d.push(""+s.getUTCMinutes()),d.push(""+s.getUTCSeconds());for(var c=0;c<d.length;++c)d[c].length<2&&(o+="0"),o+=d[c];return o+="Z",o},e.dateToGeneralizedTime=function(s){if(typeof s=="string")return s;var o="",d=[];d.push(""+s.getUTCFullYear()),d.push(""+(s.getUTCMonth()+1)),d.push(""+s.getUTCDate()),d.push(""+s.getUTCHours()),d.push(""+s.getUTCMinutes()),d.push(""+s.getUTCSeconds());for(var c=0;c<d.length;++c)d[c].length<2&&(o+="0"),o+=d[c];return o+="Z",o},e.integerToDer=function(s){var o=i.util.createBuffer();if(s>=-128&&s<128)return o.putSignedInt(s,8);if(s>=-32768&&s<32768)return o.putSignedInt(s,16);if(s>=-8388608&&s<8388608)return o.putSignedInt(s,24);if(s>=-2147483648&&s<2147483648)return o.putSignedInt(s,32);var d=new Error("Integer too large; max is 32-bits.");throw d.integer=s,d},e.derToInteger=function(s){typeof s=="string"&&(s=i.util.createBuffer(s));var o=s.length()*8;if(o>32)throw new Error("Integer too large; max is 32-bits.");return s.getSignedInt(o)},e.validate=function(s,o,d,c){var T=!1;if((s.tagClass===o.tagClass||typeof o.tagClass=="undefined")&&(s.type===o.type||typeof o.type=="undefined"))if(s.constructed===o.constructed||typeof o.constructed=="undefined"){if(T=!0,o.value&&i.util.isArray(o.value))for(var R=0,x=0;T&&x<o.value.length;++x){var y=o.value[x];T=!!y.optional;var E=s.value[R];if(!E){y.optional||(T=!1,c&&c.push("["+o.name+'] Missing required element. Expected tag class "'+y.tagClass+'", type "'+y.type+'"'));continue}var v=typeof y.tagClass!="undefined"&&typeof y.type!="undefined";if(v&&(E.tagClass!==y.tagClass||E.type!==y.type))if(y.optional){T=!0;continue}else{T=!1,c&&c.push("["+o.name+"] Tag mismatch. Expected ("+y.tagClass+","+y.type+"), got ("+E.tagClass+","+E.type+")");break}var m=e.validate(E,y,d,c);if(m)++R,T=!0;else if(y.optional)T=!0;else{T=!1;break}}if(T&&d&&(o.capture&&(d[o.capture]=s.value),o.captureAsn1&&(d[o.captureAsn1]=s),o.captureBitStringContents&&"bitStringContents"in s&&(d[o.captureBitStringContents]=s.bitStringContents),o.captureBitStringValue&&"bitStringContents"in s))if(s.bitStringContents.length<2)d[o.captureBitStringValue]="";else{var a=s.bitStringContents.charCodeAt(0);if(a!==0)throw new Error("captureBitStringValue only supported for zero unused bits");d[o.captureBitStringValue]=s.bitStringContents.slice(1)}}else c&&c.push("["+o.name+'] Expected constructed "'+o.constructed+'", got "'+s.constructed+'"');else c&&(s.tagClass!==o.tagClass&&c.push("["+o.name+'] Expected tag class "'+o.tagClass+'", got "'+s.tagClass+'"'),s.type!==o.type&&c.push("["+o.name+'] Expected type "'+o.type+'", got "'+s.type+'"'));return T};var g=/[^\\u0000-\\u00ff]/;return e.prettyPrint=function(s,o,d){var c="";o=o||0,d=d||2,o>0&&(c+=`
|
|
4
|
+
`,h=h.substr(l));return A+=h,A},t.binary.base64.decode=function(a,l,h){var A=l;A||(A=new Uint8Array(Math.ceil(a.length/4)*3)),a=a.replace(/[^A-Za-z0-9\+\/\=]/g,""),h=h||0;for(var b,n,r,f,S=0,w=h;S<a.length;)b=d[a.charCodeAt(S++)-43],n=d[a.charCodeAt(S++)-43],r=d[a.charCodeAt(S++)-43],f=d[a.charCodeAt(S++)-43],A[w++]=b<<2|n>>4,r!==64&&(A[w++]=(n&15)<<4|r>>2,f!==64&&(A[w++]=(r&3)<<6|f));return l?w-h:A.subarray(0,w)},t.binary.base58.encode=function(a,l){return t.binary.baseN.encode(a,c,l)},t.binary.base58.decode=function(a,l){return t.binary.baseN.decode(a,c,l)},t.text={utf8:{},utf16:{}},t.text.utf8.encode=function(a,l,h){a=t.encodeUtf8(a);var A=l;A||(A=new Uint8Array(a.length)),h=h||0;for(var b=h,n=0;n<a.length;++n)A[b++]=a.charCodeAt(n);return l?b-h:A},t.text.utf8.decode=function(a){return t.decodeUtf8(String.fromCharCode.apply(null,a))},t.text.utf16.encode=function(a,l,h){var A=l;A||(A=new Uint8Array(a.length*2));var b=new Uint16Array(A.buffer);h=h||0;for(var n=h,r=h,f=0;f<a.length;++f)b[r++]=a.charCodeAt(f),n+=2;return l?n-h:A},t.text.utf16.decode=function(a){return String.fromCharCode.apply(null,new Uint16Array(a.buffer))},t.deflate=function(a,l,h){if(l=t.decode64(a.deflate(t.encode64(l)).rval),h){var A=2,b=l.charCodeAt(1);b&32&&(A=6),l=l.substring(A,l.length-4)}return l},t.inflate=function(a,l,h){var A=a.inflate(t.encode64(l)).rval;return A===null?null:t.decode64(A)};var T=function(a,l,h){if(!a)throw new Error("WebStorage not available.");var A;if(h===null?A=a.removeItem(l):(h=t.encode64(JSON.stringify(h)),A=a.setItem(l,h)),typeof A!="undefined"&&A.rval!==!0){var b=new Error(A.error.message);throw b.id=A.error.id,b.name=A.error.name,b}},R=function(a,l){if(!a)throw new Error("WebStorage not available.");var h=a.getItem(l);if(a.init)if(h.rval===null){if(h.error){var A=new Error(h.error.message);throw A.id=h.error.id,A.name=h.error.name,A}h=null}else h=h.rval;return h!==null&&(h=JSON.parse(t.decode64(h))),h},x=function(a,l,h,A){var b=R(a,l);b===null&&(b={}),b[h]=A,T(a,l,b)},y=function(a,l,h){var A=R(a,l);return A!==null&&(A=h in A?A[h]:null),A},E=function(a,l,h){var A=R(a,l);if(A!==null&&h in A){delete A[h];var b=!0;for(var n in A){b=!1;break}b&&(A=null),T(a,l,A)}},v=function(a,l){T(a,l,null)},m=function(a,l,h){var A=null;typeof h=="undefined"&&(h=["web","flash"]);var b,n=!1,r=null;for(var f in h){b=h[f];try{if(b==="flash"||b==="both"){if(l[0]===null)throw new Error("Flash local storage not available.");A=a.apply(this,l),n=b==="flash"}(b==="web"||b==="both")&&(l[0]=localStorage,A=a.apply(this,l),n=!0)}catch(S){r=S}if(n)break}if(!n)throw r;return A};return t.setItem=function(a,l,h,A,b){m(x,arguments,b)},t.getItem=function(a,l,h,A){return m(y,arguments,A)},t.removeItem=function(a,l,h,A){m(E,arguments,A)},t.clearItems=function(a,l,h){m(v,arguments,h)},t.isEmpty=function(a){for(var l in a)if(a.hasOwnProperty(l))return!1;return!0},t.format=function(a){for(var l=/%./g,h,A,b=0,n=[],r=0;h=l.exec(a);){A=a.substring(r,l.lastIndex-2),A.length>0&&n.push(A),r=l.lastIndex;var f=h[0][1];switch(f){case"s":case"o":b<arguments.length?n.push(arguments[b+++1]):n.push("<?>");break;case"%":n.push("%");break;default:n.push("<%"+f+"?>")}}return n.push(a.substring(r)),n.join("")},t.formatNumber=function(a,l,h,A){var b=a,n=isNaN(l=Math.abs(l))?2:l,r=h===void 0?",":h,f=A===void 0?".":A,S=b<0?"-":"",w=parseInt(b=Math.abs(+b||0).toFixed(n),10)+"",U=w.length>3?w.length%3:0;return S+(U?w.substr(0,U)+f:"")+w.substr(U).replace(/(\d{3})(?=\d)/g,"$1"+f)+(n?r+Math.abs(b-w).toFixed(n).slice(2):"")},t.formatSize=function(a){return a>=1073741824?a=t.formatNumber(a/1073741824,2,".","")+" GiB":a>=1048576?a=t.formatNumber(a/1048576,2,".","")+" MiB":a>=1024?a=t.formatNumber(a/1024,0)+" KiB":a=t.formatNumber(a,0)+" bytes",a},t.bytesFromIP=function(a){return a.indexOf(".")!==-1?t.bytesFromIPv4(a):a.indexOf(":")!==-1?t.bytesFromIPv6(a):null},t.bytesFromIPv4=function(a){if(a=a.split("."),a.length!==4)return null;for(var l=t.createBuffer(),h=0;h<a.length;++h){var A=parseInt(a[h],10);if(isNaN(A))return null;l.putByte(A)}return l.getBytes()},t.bytesFromIPv6=function(a){var l=0;a=a.split(":").filter(function(r){return r.length===0&&++l,!0});for(var h=(8-a.length+l)*2,A=t.createBuffer(),b=0;b<8;++b){if(!a[b]||a[b].length===0){A.fillWithByte(0,h),h=0;continue}var n=t.hexToBytes(a[b]);n.length<2&&A.putByte(0),A.putBytes(n)}return A.getBytes()},t.bytesToIP=function(a){return a.length===4?t.bytesToIPv4(a):a.length===16?t.bytesToIPv6(a):null},t.bytesToIPv4=function(a){if(a.length!==4)return null;for(var l=[],h=0;h<a.length;++h)l.push(a.charCodeAt(h));return l.join(".")},t.bytesToIPv6=function(a){if(a.length!==16)return null;for(var l=[],h=[],A=0,b=0;b<a.length;b+=2){for(var n=t.bytesToHex(a[b]+a[b+1]);n[0]==="0"&&n!=="0";)n=n.substr(1);if(n==="0"){var r=h[h.length-1],f=l.length;!r||f!==r.end+1?h.push({start:f,end:f}):(r.end=f,r.end-r.start>h[A].end-h[A].start&&(A=h.length-1))}l.push(n)}if(h.length>0){var S=h[A];S.end-S.start>0&&(l.splice(S.start,S.end-S.start+1,""),S.start===0&&l.unshift(""),S.end===7&&l.push(""))}return l.join(":")},t.estimateCores=function(a,l){if(typeof a=="function"&&(l=a,a={}),a=a||{},"cores"in t&&!a.update)return l(null,t.cores);if(typeof navigator!="undefined"&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return t.cores=navigator.hardwareConcurrency,l(null,t.cores);if(typeof Worker=="undefined")return t.cores=1,l(null,t.cores);if(typeof Blob=="undefined")return t.cores=2,l(null,t.cores);var h=URL.createObjectURL(new Blob(["(",(function(){self.addEventListener("message",function(r){var f=Date.now(),S=f+4;self.postMessage({st:f,et:S})})}).toString(),")()"],{type:"application/javascript"}));A([],5,16);function A(r,f,S){if(f===0){var w=Math.floor(r.reduce(function(U,N){return U+N},0)/r.length);return t.cores=Math.max(1,w),URL.revokeObjectURL(h),l(null,t.cores)}b(S,function(U,N){r.push(n(S,N)),A(r,f-1,S)})}function b(r,f){for(var S=[],w=[],U=0;U<r;++U){var N=new Worker(h);N.addEventListener("message",function(L){if(w.push(L.data),w.length===r){for(var P=0;P<r;++P)S[P].terminate();f(null,w)}}),S.push(N)}for(var U=0;U<r;++U)S[U].postMessage(U)}function n(r,f){for(var S=[],w=0;w<r;++w)for(var U=f[w],N=S[w]=[],L=0;L<r;++L)if(w!==L){var P=f[L];(U.st>P.st&&U.st<P.et||P.st>U.st&&P.st<U.et)&&N.push(L)}return S.reduce(function(_,k){return Math.max(_,k.length)},0)}},be.exports}var Re={exports:{}},lt;function he(){if(lt)return Re.exports;lt=1;var i=H();i.pki=i.pki||{};var e=Re.exports=i.pki.oids=i.oids=i.oids||{};function t(I,g){e[I]=g,e[g]=I}function u(I,g){e[I]=g}return t("1.2.840.113549.1.1.1","rsaEncryption"),t("1.2.840.113549.1.1.4","md5WithRSAEncryption"),t("1.2.840.113549.1.1.5","sha1WithRSAEncryption"),t("1.2.840.113549.1.1.7","RSAES-OAEP"),t("1.2.840.113549.1.1.8","mgf1"),t("1.2.840.113549.1.1.9","pSpecified"),t("1.2.840.113549.1.1.10","RSASSA-PSS"),t("1.2.840.113549.1.1.11","sha256WithRSAEncryption"),t("1.2.840.113549.1.1.12","sha384WithRSAEncryption"),t("1.2.840.113549.1.1.13","sha512WithRSAEncryption"),t("1.3.101.112","EdDSA25519"),t("1.2.840.10040.4.3","dsa-with-sha1"),t("1.3.14.3.2.7","desCBC"),t("1.3.14.3.2.26","sha1"),t("1.3.14.3.2.29","sha1WithRSASignature"),t("2.16.840.1.101.3.4.2.1","sha256"),t("2.16.840.1.101.3.4.2.2","sha384"),t("2.16.840.1.101.3.4.2.3","sha512"),t("2.16.840.1.101.3.4.2.4","sha224"),t("2.16.840.1.101.3.4.2.5","sha512-224"),t("2.16.840.1.101.3.4.2.6","sha512-256"),t("1.2.840.113549.2.2","md2"),t("1.2.840.113549.2.5","md5"),t("1.2.840.113549.1.7.1","data"),t("1.2.840.113549.1.7.2","signedData"),t("1.2.840.113549.1.7.3","envelopedData"),t("1.2.840.113549.1.7.4","signedAndEnvelopedData"),t("1.2.840.113549.1.7.5","digestedData"),t("1.2.840.113549.1.7.6","encryptedData"),t("1.2.840.113549.1.9.1","emailAddress"),t("1.2.840.113549.1.9.2","unstructuredName"),t("1.2.840.113549.1.9.3","contentType"),t("1.2.840.113549.1.9.4","messageDigest"),t("1.2.840.113549.1.9.5","signingTime"),t("1.2.840.113549.1.9.6","counterSignature"),t("1.2.840.113549.1.9.7","challengePassword"),t("1.2.840.113549.1.9.8","unstructuredAddress"),t("1.2.840.113549.1.9.14","extensionRequest"),t("1.2.840.113549.1.9.20","friendlyName"),t("1.2.840.113549.1.9.21","localKeyId"),t("1.2.840.113549.1.9.22.1","x509Certificate"),t("1.2.840.113549.1.12.10.1.1","keyBag"),t("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag"),t("1.2.840.113549.1.12.10.1.3","certBag"),t("1.2.840.113549.1.12.10.1.4","crlBag"),t("1.2.840.113549.1.12.10.1.5","secretBag"),t("1.2.840.113549.1.12.10.1.6","safeContentsBag"),t("1.2.840.113549.1.5.13","pkcs5PBES2"),t("1.2.840.113549.1.5.12","pkcs5PBKDF2"),t("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4"),t("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4"),t("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC"),t("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC"),t("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC"),t("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC"),t("1.2.840.113549.2.7","hmacWithSHA1"),t("1.2.840.113549.2.8","hmacWithSHA224"),t("1.2.840.113549.2.9","hmacWithSHA256"),t("1.2.840.113549.2.10","hmacWithSHA384"),t("1.2.840.113549.2.11","hmacWithSHA512"),t("1.2.840.113549.3.7","des-EDE3-CBC"),t("2.16.840.1.101.3.4.1.2","aes128-CBC"),t("2.16.840.1.101.3.4.1.22","aes192-CBC"),t("2.16.840.1.101.3.4.1.42","aes256-CBC"),t("2.5.4.3","commonName"),t("2.5.4.4","surname"),t("2.5.4.5","serialNumber"),t("2.5.4.6","countryName"),t("2.5.4.7","localityName"),t("2.5.4.8","stateOrProvinceName"),t("2.5.4.9","streetAddress"),t("2.5.4.10","organizationName"),t("2.5.4.11","organizationalUnitName"),t("2.5.4.12","title"),t("2.5.4.13","description"),t("2.5.4.15","businessCategory"),t("2.5.4.17","postalCode"),t("2.5.4.42","givenName"),t("2.5.4.65","pseudonym"),t("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName"),t("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName"),t("2.16.840.1.113730.1.1","nsCertType"),t("2.16.840.1.113730.1.13","nsComment"),u("2.5.29.1","authorityKeyIdentifier"),u("2.5.29.2","keyAttributes"),u("2.5.29.3","certificatePolicies"),u("2.5.29.4","keyUsageRestriction"),u("2.5.29.5","policyMapping"),u("2.5.29.6","subtreesConstraint"),u("2.5.29.7","subjectAltName"),u("2.5.29.8","issuerAltName"),u("2.5.29.9","subjectDirectoryAttributes"),u("2.5.29.10","basicConstraints"),u("2.5.29.11","nameConstraints"),u("2.5.29.12","policyConstraints"),u("2.5.29.13","basicConstraints"),t("2.5.29.14","subjectKeyIdentifier"),t("2.5.29.15","keyUsage"),u("2.5.29.16","privateKeyUsagePeriod"),t("2.5.29.17","subjectAltName"),t("2.5.29.18","issuerAltName"),t("2.5.29.19","basicConstraints"),u("2.5.29.20","cRLNumber"),u("2.5.29.21","cRLReason"),u("2.5.29.22","expirationDate"),u("2.5.29.23","instructionCode"),u("2.5.29.24","invalidityDate"),u("2.5.29.25","cRLDistributionPoints"),u("2.5.29.26","issuingDistributionPoint"),u("2.5.29.27","deltaCRLIndicator"),u("2.5.29.28","issuingDistributionPoint"),u("2.5.29.29","certificateIssuer"),u("2.5.29.30","nameConstraints"),t("2.5.29.31","cRLDistributionPoints"),t("2.5.29.32","certificatePolicies"),u("2.5.29.33","policyMappings"),u("2.5.29.34","policyConstraints"),t("2.5.29.35","authorityKeyIdentifier"),u("2.5.29.36","policyConstraints"),t("2.5.29.37","extKeyUsage"),u("2.5.29.46","freshestCRL"),u("2.5.29.54","inhibitAnyPolicy"),t("1.3.6.1.4.1.11129.2.4.2","timestampList"),t("1.3.6.1.5.5.7.1.1","authorityInfoAccess"),t("1.3.6.1.5.5.7.3.1","serverAuth"),t("1.3.6.1.5.5.7.3.2","clientAuth"),t("1.3.6.1.5.5.7.3.3","codeSigning"),t("1.3.6.1.5.5.7.3.4","emailProtection"),t("1.3.6.1.5.5.7.3.8","timeStamping"),Re.exports}var ct;function ce(){if(ct)return Ae.exports;ct=1;var i=H();X(),he();var e=Ae.exports=i.asn1=i.asn1||{};e.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192},e.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30},e.maxDepth=256,e.create=function(s,o,d,c,T){if(i.util.isArray(c)){for(var R=[],x=0;x<c.length;++x)c[x]!==void 0&&R.push(c[x]);c=R}var y={tagClass:s,type:o,constructed:d,composed:d||i.util.isArray(c),value:c};return T&&"bitStringContents"in T&&(y.bitStringContents=T.bitStringContents,y.original=e.copy(y)),y},e.copy=function(s,o){var d;if(i.util.isArray(s)){d=[];for(var c=0;c<s.length;++c)d.push(e.copy(s[c],o));return d}return typeof s=="string"?s:(d={tagClass:s.tagClass,type:s.type,constructed:s.constructed,composed:s.composed,value:e.copy(s.value,o)},o&&!o.excludeBitStringContents&&(d.bitStringContents=s.bitStringContents),d)},e.equals=function(s,o,d){if(i.util.isArray(s)){if(!i.util.isArray(o)||s.length!==o.length)return!1;for(var c=0;c<s.length;++c)if(!e.equals(s[c],o[c]))return!1;return!0}if(typeof s!=typeof o)return!1;if(typeof s=="string")return s===o;var T=s.tagClass===o.tagClass&&s.type===o.type&&s.constructed===o.constructed&&s.composed===o.composed&&e.equals(s.value,o.value);return d&&d.includeBitStringContents&&(T=T&&s.bitStringContents===o.bitStringContents),T},e.getBerValueLength=function(s){var o=s.getByte();if(o!==128){var d,c=o&128;return c?d=s.getInt((o&127)<<3):d=o,d}};function t(s,o,d){if(d>o){var c=new Error("Too few bytes to parse DER.");throw c.available=s.length(),c.remaining=o,c.requested=d,c}}var u=function(s,o){var d=s.getByte();if(o--,d!==128){var c,T=d&128;if(!T)c=d;else{var R=d&127;t(s,o,R),c=s.getInt(R<<3)}if(c<0)throw new Error("Negative length: "+c);return c}};e.fromDer=function(s,o){o===void 0&&(o={strict:!0,parseAllBytes:!0,decodeBitStrings:!0}),typeof o=="boolean"&&(o={strict:o,parseAllBytes:!0,decodeBitStrings:!0}),"strict"in o||(o.strict=!0),"parseAllBytes"in o||(o.parseAllBytes=!0),"decodeBitStrings"in o||(o.decodeBitStrings=!0),"maxDepth"in o||(o.maxDepth=e.maxDepth),typeof s=="string"&&(s=i.util.createBuffer(s));var d=s.length(),c=I(s,s.length(),0,o);if(o.parseAllBytes&&s.length()!==0){var T=new Error("Unparsed DER bytes remain after ASN.1 parsing.");throw T.byteCount=d,T.remaining=s.length(),T}return c};function I(s,o,d,c){if(d>=c.maxDepth)throw new Error("ASN.1 parsing error: Max depth exceeded.");var T;t(s,o,2);var R=s.getByte();o--;var x=R&192,y=R&31;T=s.length();var E=u(s,o);if(o-=T-s.length(),E!==void 0&&E>o){if(c.strict){var v=new Error("Too few bytes to read ASN.1 value.");throw v.available=s.length(),v.remaining=o,v.requested=E,v}E=o}var m,a,l=(R&32)===32;if(l)if(m=[],E===void 0)for(;;){if(t(s,o,2),s.bytes(2)==="\0\0"){s.getBytes(2),o-=2;break}T=s.length(),m.push(I(s,o,d+1,c)),o-=T-s.length()}else for(;E>0;)T=s.length(),m.push(I(s,E,d+1,c)),o-=T-s.length(),E-=T-s.length();if(m===void 0&&x===e.Class.UNIVERSAL&&y===e.Type.BITSTRING&&(a=s.bytes(E)),m===void 0&&c.decodeBitStrings&&x===e.Class.UNIVERSAL&&y===e.Type.BITSTRING&&E>1){var h=s.read,A=o,b=0;if(y===e.Type.BITSTRING&&(t(s,o,1),b=s.getByte(),o--),b===0)try{T=s.length();var n={strict:!0,decodeBitStrings:!0},r=I(s,o,d+1,n),f=T-s.length();o-=f,y==e.Type.BITSTRING&&f++;var S=r.tagClass;f===E&&(S===e.Class.UNIVERSAL||S===e.Class.CONTEXT_SPECIFIC)&&(m=[r])}catch(U){}m===void 0&&(s.read=h,o=A)}if(m===void 0){if(E===void 0){if(c.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");E=o}if(y===e.Type.BMPSTRING)for(m="";E>0;E-=2)t(s,o,2),m+=String.fromCharCode(s.getInt16()),o-=2;else m=s.getBytes(E),o-=E}var w=a===void 0?null:{bitStringContents:a};return e.create(x,y,l,m,w)}e.toDer=function(s){var o=i.util.createBuffer(),d=s.tagClass|s.type,c=i.util.createBuffer(),T=!1;if("bitStringContents"in s&&(T=!0,s.original&&(T=e.equals(s,s.original))),T)c.putBytes(s.bitStringContents);else if(s.composed){s.constructed?d|=32:c.putByte(0);for(var R=0;R<s.value.length;++R)s.value[R]!==void 0&&c.putBuffer(e.toDer(s.value[R]))}else if(s.type===e.Type.BMPSTRING)for(var R=0;R<s.value.length;++R)c.putInt16(s.value.charCodeAt(R));else s.type===e.Type.INTEGER&&s.value.length>1&&(s.value.charCodeAt(0)===0&&(s.value.charCodeAt(1)&128)===0||s.value.charCodeAt(0)===255&&(s.value.charCodeAt(1)&128)===128)?c.putBytes(s.value.substr(1)):c.putBytes(s.value);if(o.putByte(d),c.length()<=127)o.putByte(c.length()&127);else{var x=c.length(),y="";do y+=String.fromCharCode(x&255),x=x>>>8;while(x>0);o.putByte(y.length|128);for(var R=y.length-1;R>=0;--R)o.putByte(y.charCodeAt(R))}return o.putBuffer(c),o},e.oidToDer=function(s){var o=s.split("."),d=i.util.createBuffer();d.putByte(40*parseInt(o[0],10)+parseInt(o[1],10));for(var c,T,R,x,y=2;y<o.length;++y){if(c=!0,T=[],R=parseInt(o[y],10),R>4294967295)throw new Error("OID value too large; max is 32-bits.");do x=R&127,R=R>>>7,c||(x|=128),T.push(x),c=!1;while(R>0);for(var E=T.length-1;E>=0;--E)d.putByte(T[E])}return d},e.derToOid=function(s){var o;typeof s=="string"&&(s=i.util.createBuffer(s));var d=s.getByte();o=Math.floor(d/40)+"."+d%40;for(var c=0;s.length()>0;){if(c>70368744177663)throw new Error("OID value too large; max is 53-bits.");d=s.getByte(),c=c*128,d&128?c+=d&127:(o+="."+(c+d),c=0)}return o},e.utcTimeToDate=function(s){var o=new Date,d=parseInt(s.substr(0,2),10);d=d>=50?1900+d:2e3+d;var c=parseInt(s.substr(2,2),10)-1,T=parseInt(s.substr(4,2),10),R=parseInt(s.substr(6,2),10),x=parseInt(s.substr(8,2),10),y=0;if(s.length>11){var E=s.charAt(10),v=10;E!=="+"&&E!=="-"&&(y=parseInt(s.substr(10,2),10),v+=2)}if(o.setUTCFullYear(d,c,T),o.setUTCHours(R,x,y,0),v&&(E=s.charAt(v),E==="+"||E==="-")){var m=parseInt(s.substr(v+1,2),10),a=parseInt(s.substr(v+4,2),10),l=m*60+a;l*=6e4,E==="+"?o.setTime(+o-l):o.setTime(+o+l)}return o},e.generalizedTimeToDate=function(s){var o=new Date,d=parseInt(s.substr(0,4),10),c=parseInt(s.substr(4,2),10)-1,T=parseInt(s.substr(6,2),10),R=parseInt(s.substr(8,2),10),x=parseInt(s.substr(10,2),10),y=parseInt(s.substr(12,2),10),E=0,v=0,m=!1;s.charAt(s.length-1)==="Z"&&(m=!0);var a=s.length-5,l=s.charAt(a);if(l==="+"||l==="-"){var h=parseInt(s.substr(a+1,2),10),A=parseInt(s.substr(a+4,2),10);v=h*60+A,v*=6e4,l==="+"&&(v*=-1),m=!0}return s.charAt(14)==="."&&(E=parseFloat(s.substr(14),10)*1e3),m?(o.setUTCFullYear(d,c,T),o.setUTCHours(R,x,y,E),o.setTime(+o+v)):(o.setFullYear(d,c,T),o.setHours(R,x,y,E)),o},e.dateToUtcTime=function(s){if(typeof s=="string")return s;var o="",d=[];d.push((""+s.getUTCFullYear()).substr(2)),d.push(""+(s.getUTCMonth()+1)),d.push(""+s.getUTCDate()),d.push(""+s.getUTCHours()),d.push(""+s.getUTCMinutes()),d.push(""+s.getUTCSeconds());for(var c=0;c<d.length;++c)d[c].length<2&&(o+="0"),o+=d[c];return o+="Z",o},e.dateToGeneralizedTime=function(s){if(typeof s=="string")return s;var o="",d=[];d.push(""+s.getUTCFullYear()),d.push(""+(s.getUTCMonth()+1)),d.push(""+s.getUTCDate()),d.push(""+s.getUTCHours()),d.push(""+s.getUTCMinutes()),d.push(""+s.getUTCSeconds());for(var c=0;c<d.length;++c)d[c].length<2&&(o+="0"),o+=d[c];return o+="Z",o},e.integerToDer=function(s){var o=i.util.createBuffer();if(s>=-128&&s<128)return o.putSignedInt(s,8);if(s>=-32768&&s<32768)return o.putSignedInt(s,16);if(s>=-8388608&&s<8388608)return o.putSignedInt(s,24);if(s>=-2147483648&&s<2147483648)return o.putSignedInt(s,32);var d=new Error("Integer too large; max is 32-bits.");throw d.integer=s,d},e.derToInteger=function(s){typeof s=="string"&&(s=i.util.createBuffer(s));var o=s.length()*8;if(o>32)throw new Error("Integer too large; max is 32-bits.");return s.getSignedInt(o)},e.validate=function(s,o,d,c){var T=!1;if((s.tagClass===o.tagClass||typeof o.tagClass=="undefined")&&(s.type===o.type||typeof o.type=="undefined"))if(s.constructed===o.constructed||typeof o.constructed=="undefined"){if(T=!0,o.value&&i.util.isArray(o.value))for(var R=0,x=0;T&&x<o.value.length;++x){var y=o.value[x];T=!!y.optional;var E=s.value[R];if(!E){y.optional||(T=!1,c&&c.push("["+o.name+'] Missing required element. Expected tag class "'+y.tagClass+'", type "'+y.type+'"'));continue}var v=typeof y.tagClass!="undefined"&&typeof y.type!="undefined";if(v&&(E.tagClass!==y.tagClass||E.type!==y.type))if(y.optional){T=!0;continue}else{T=!1,c&&c.push("["+o.name+"] Tag mismatch. Expected ("+y.tagClass+","+y.type+"), got ("+E.tagClass+","+E.type+")");break}var m=e.validate(E,y,d,c);if(m)++R,T=!0;else if(y.optional)T=!0;else{T=!1;break}}if(T&&d&&(o.capture&&(d[o.capture]=s.value),o.captureAsn1&&(d[o.captureAsn1]=s),o.captureBitStringContents&&"bitStringContents"in s&&(d[o.captureBitStringContents]=s.bitStringContents),o.captureBitStringValue&&"bitStringContents"in s))if(s.bitStringContents.length<2)d[o.captureBitStringValue]="";else{var a=s.bitStringContents.charCodeAt(0);if(a!==0)throw new Error("captureBitStringValue only supported for zero unused bits");d[o.captureBitStringValue]=s.bitStringContents.slice(1)}}else c&&c.push("["+o.name+'] Expected constructed "'+o.constructed+'", got "'+s.constructed+'"');else c&&(s.tagClass!==o.tagClass&&c.push("["+o.name+'] Expected tag class "'+o.tagClass+'", got "'+s.tagClass+'"'),s.type!==o.type&&c.push("["+o.name+'] Expected type "'+o.type+'", got "'+s.type+'"'));return T};var g=/[^\\u0000-\\u00ff]/;return e.prettyPrint=function(s,o,d){var c="";o=o||0,d=d||2,o>0&&(c+=`
|
|
5
5
|
`);for(var T="",R=0;R<o*d;++R)T+=" ";switch(c+=T+"Tag: ",s.tagClass){case e.Class.UNIVERSAL:c+="Universal:";break;case e.Class.APPLICATION:c+="Application:";break;case e.Class.CONTEXT_SPECIFIC:c+="Context-Specific:";break;case e.Class.PRIVATE:c+="Private:";break}if(s.tagClass===e.Class.UNIVERSAL)switch(c+=s.type,s.type){case e.Type.NONE:c+=" (None)";break;case e.Type.BOOLEAN:c+=" (Boolean)";break;case e.Type.INTEGER:c+=" (Integer)";break;case e.Type.BITSTRING:c+=" (Bit string)";break;case e.Type.OCTETSTRING:c+=" (Octet string)";break;case e.Type.NULL:c+=" (Null)";break;case e.Type.OID:c+=" (Object Identifier)";break;case e.Type.ODESC:c+=" (Object Descriptor)";break;case e.Type.EXTERNAL:c+=" (External or Instance of)";break;case e.Type.REAL:c+=" (Real)";break;case e.Type.ENUMERATED:c+=" (Enumerated)";break;case e.Type.EMBEDDED:c+=" (Embedded PDV)";break;case e.Type.UTF8:c+=" (UTF8)";break;case e.Type.ROID:c+=" (Relative Object Identifier)";break;case e.Type.SEQUENCE:c+=" (Sequence)";break;case e.Type.SET:c+=" (Set)";break;case e.Type.PRINTABLESTRING:c+=" (Printable String)";break;case e.Type.IA5String:c+=" (IA5String (ASCII))";break;case e.Type.UTCTIME:c+=" (UTC time)";break;case e.Type.GENERALIZEDTIME:c+=" (Generalized time)";break;case e.Type.BMPSTRING:c+=" (BMP String)";break}else c+=s.type;if(c+=`
|
|
6
6
|
`,c+=T+"Constructed: "+s.constructed+`
|
|
7
7
|
`,s.composed){for(var x=0,y="",R=0;R<s.value.length;++R)s.value[R]!==void 0&&(x+=1,y+=e.prettyPrint(s.value[R],o+1,d),R+1<s.value.length&&(y+=","));c+=T+"Sub values: "+x+y}else{if(c+=T+"Value: ",s.type===e.Type.OID){var E=e.derToOid(s.value);c+=E,i.pki&&i.pki.oids&&E in i.pki.oids&&(c+=" ("+i.pki.oids[E]+") ")}if(s.type===e.Type.INTEGER)try{c+=e.derToInteger(s.value)}catch(m){c+="0x"+i.util.bytesToHex(s.value)}else if(s.type===e.Type.BITSTRING){if(s.value.length>1?c+="0x"+i.util.bytesToHex(s.value.slice(1)):c+="(none)",s.value.length>0){var v=s.value.charCodeAt(0);v==1?c+=" (1 unused bit shown)":v>1&&(c+=" ("+v+" unused bits shown)")}}else if(s.type===e.Type.OCTETSTRING)g.test(s.value)||(c+="("+s.value+") "),c+="0x"+i.util.bytesToHex(s.value);else if(s.type===e.Type.UTF8)try{c+=i.util.decodeUtf8(s.value)}catch(m){if(m.message==="URI malformed")c+="0x"+i.util.bytesToHex(s.value)+" (malformed UTF8)";else throw m}else s.type===e.Type.PRINTABLESTRING||s.type===e.Type.IA5String?c+=s.value:g.test(s.value)?c+="0x"+i.util.bytesToHex(s.value):s.value.length===0?c+="[null]":c+=s.value}return c},Ae.exports}var hr=ce();const pr=Ie(hr);var we={exports:{}},Ue,ht;function pt(){if(ht)return Ue;ht=1;var i=H();X(),Ue=i.cipher=i.cipher||{},i.cipher.algorithms=i.cipher.algorithms||{},i.cipher.createCipher=function(t,u){var I=t;if(typeof I=="string"&&(I=i.cipher.getAlgorithm(I),I&&(I=I())),!I)throw new Error("Unsupported algorithm: "+t);return new i.cipher.BlockCipher({algorithm:I,key:u,decrypt:!1})},i.cipher.createDecipher=function(t,u){var I=t;if(typeof I=="string"&&(I=i.cipher.getAlgorithm(I),I&&(I=I())),!I)throw new Error("Unsupported algorithm: "+t);return new i.cipher.BlockCipher({algorithm:I,key:u,decrypt:!0})},i.cipher.registerAlgorithm=function(t,u){t=t.toUpperCase(),i.cipher.algorithms[t]=u},i.cipher.getAlgorithm=function(t){return t=t.toUpperCase(),t in i.cipher.algorithms?i.cipher.algorithms[t]:null};var e=i.cipher.BlockCipher=function(t){this.algorithm=t.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=t.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=t.decrypt,this.algorithm.initialize(t)};return e.prototype.start=function(t){t=t||{};var u={};for(var I in t)u[I]=t[I];u.decrypt=this._decrypt,this._finish=!1,this._input=i.util.createBuffer(),this.output=t.output||i.util.createBuffer(),this.mode.start(u)},e.prototype.update=function(t){for(t&&this._input.putBuffer(t);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact()},e.prototype.finish=function(t){t&&(this.mode.name==="ECB"||this.mode.name==="CBC")&&(this.mode.pad=function(I){return t(this.blockSize,I,!1)},this.mode.unpad=function(I){return t(this.blockSize,I,!0)});var u={};return u.decrypt=this._decrypt,u.overflow=this._input.length()%this.blockSize,!(!this._decrypt&&this.mode.pad&&!this.mode.pad(this._input,u)||(this._finish=!0,this.update(),this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,u))||this.mode.afterFinish&&!this.mode.afterFinish(this.output,u))},Ue}var Le={exports:{}},dt;function yt(){if(dt)return Le.exports;dt=1;var i=H();X(),i.cipher=i.cipher||{};var e=Le.exports=i.cipher.modes=i.cipher.modes||{};e.ecb=function(g){g=g||{},this.name="ECB",this.cipher=g.cipher,this.blockSize=g.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},e.ecb.prototype.start=function(g){},e.ecb.prototype.encrypt=function(g,s,o){if(g.length()<this.blockSize&&!(o&&g.length()>0))return!0;for(var d=0;d<this._ints;++d)this._inBlock[d]=g.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(var d=0;d<this._ints;++d)s.putInt32(this._outBlock[d])},e.ecb.prototype.decrypt=function(g,s,o){if(g.length()<this.blockSize&&!(o&&g.length()>0))return!0;for(var d=0;d<this._ints;++d)this._inBlock[d]=g.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(var d=0;d<this._ints;++d)s.putInt32(this._outBlock[d])},e.ecb.prototype.pad=function(g,s){var o=g.length()===this.blockSize?this.blockSize:this.blockSize-g.length();return g.fillWithByte(o,o),!0},e.ecb.prototype.unpad=function(g,s){if(s.overflow>0)return!1;var o=g.length(),d=g.at(o-1);return d>this.blockSize<<2?!1:(g.truncate(d),!0)},e.cbc=function(g){g=g||{},this.name="CBC",this.cipher=g.cipher,this.blockSize=g.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},e.cbc.prototype.start=function(g){if(g.iv===null){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else if("iv"in g)this._iv=t(g.iv,this.blockSize),this._prev=this._iv.slice(0);else throw new Error("Invalid IV parameter.")},e.cbc.prototype.encrypt=function(g,s,o){if(g.length()<this.blockSize&&!(o&&g.length()>0))return!0;for(var d=0;d<this._ints;++d)this._inBlock[d]=this._prev[d]^g.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(var d=0;d<this._ints;++d)s.putInt32(this._outBlock[d]);this._prev=this._outBlock},e.cbc.prototype.decrypt=function(g,s,o){if(g.length()<this.blockSize&&!(o&&g.length()>0))return!0;for(var d=0;d<this._ints;++d)this._inBlock[d]=g.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(var d=0;d<this._ints;++d)s.putInt32(this._prev[d]^this._outBlock[d]);this._prev=this._inBlock.slice(0)},e.cbc.prototype.pad=function(g,s){var o=g.length()===this.blockSize?this.blockSize:this.blockSize-g.length();return g.fillWithByte(o,o),!0},e.cbc.prototype.unpad=function(g,s){if(s.overflow>0)return!1;var o=g.length(),d=g.at(o-1);return d>this.blockSize<<2?!1:(g.truncate(d),!0)},e.cfb=function(g){g=g||{},this.name="CFB",this.cipher=g.cipher,this.blockSize=g.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=i.util.createBuffer(),this._partialBytes=0},e.cfb.prototype.start=function(g){if(!("iv"in g))throw new Error("Invalid IV parameter.");this._iv=t(g.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},e.cfb.prototype.encrypt=function(g,s,o){var d=g.length();if(d===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&d>=this.blockSize){for(var c=0;c<this._ints;++c)this._inBlock[c]=g.getInt32()^this._outBlock[c],s.putInt32(this._inBlock[c]);return}var T=(this.blockSize-d)%this.blockSize;T>0&&(T=this.blockSize-T),this._partialOutput.clear();for(var c=0;c<this._ints;++c)this._partialBlock[c]=g.getInt32()^this._outBlock[c],this._partialOutput.putInt32(this._partialBlock[c]);if(T>0)g.read-=this.blockSize;else for(var c=0;c<this._ints;++c)this._inBlock[c]=this._partialBlock[c];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),T>0&&!o)return s.putBytes(this._partialOutput.getBytes(T-this._partialBytes)),this._partialBytes=T,!0;s.putBytes(this._partialOutput.getBytes(d-this._partialBytes)),this._partialBytes=0},e.cfb.prototype.decrypt=function(g,s,o){var d=g.length();if(d===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&d>=this.blockSize){for(var c=0;c<this._ints;++c)this._inBlock[c]=g.getInt32(),s.putInt32(this._inBlock[c]^this._outBlock[c]);return}var T=(this.blockSize-d)%this.blockSize;T>0&&(T=this.blockSize-T),this._partialOutput.clear();for(var c=0;c<this._ints;++c)this._partialBlock[c]=g.getInt32(),this._partialOutput.putInt32(this._partialBlock[c]^this._outBlock[c]);if(T>0)g.read-=this.blockSize;else for(var c=0;c<this._ints;++c)this._inBlock[c]=this._partialBlock[c];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),T>0&&!o)return s.putBytes(this._partialOutput.getBytes(T-this._partialBytes)),this._partialBytes=T,!0;s.putBytes(this._partialOutput.getBytes(d-this._partialBytes)),this._partialBytes=0},e.ofb=function(g){g=g||{},this.name="OFB",this.cipher=g.cipher,this.blockSize=g.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=i.util.createBuffer(),this._partialBytes=0},e.ofb.prototype.start=function(g){if(!("iv"in g))throw new Error("Invalid IV parameter.");this._iv=t(g.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},e.ofb.prototype.encrypt=function(g,s,o){var d=g.length();if(g.length()===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&d>=this.blockSize){for(var c=0;c<this._ints;++c)s.putInt32(g.getInt32()^this._outBlock[c]),this._inBlock[c]=this._outBlock[c];return}var T=(this.blockSize-d)%this.blockSize;T>0&&(T=this.blockSize-T),this._partialOutput.clear();for(var c=0;c<this._ints;++c)this._partialOutput.putInt32(g.getInt32()^this._outBlock[c]);if(T>0)g.read-=this.blockSize;else for(var c=0;c<this._ints;++c)this._inBlock[c]=this._outBlock[c];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),T>0&&!o)return s.putBytes(this._partialOutput.getBytes(T-this._partialBytes)),this._partialBytes=T,!0;s.putBytes(this._partialOutput.getBytes(d-this._partialBytes)),this._partialBytes=0},e.ofb.prototype.decrypt=e.ofb.prototype.encrypt,e.ctr=function(g){g=g||{},this.name="CTR",this.cipher=g.cipher,this.blockSize=g.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=i.util.createBuffer(),this._partialBytes=0},e.ctr.prototype.start=function(g){if(!("iv"in g))throw new Error("Invalid IV parameter.");this._iv=t(g.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},e.ctr.prototype.encrypt=function(g,s,o){var d=g.length();if(d===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&d>=this.blockSize)for(var c=0;c<this._ints;++c)s.putInt32(g.getInt32()^this._outBlock[c]);else{var T=(this.blockSize-d)%this.blockSize;T>0&&(T=this.blockSize-T),this._partialOutput.clear();for(var c=0;c<this._ints;++c)this._partialOutput.putInt32(g.getInt32()^this._outBlock[c]);if(T>0&&(g.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),T>0&&!o)return s.putBytes(this._partialOutput.getBytes(T-this._partialBytes)),this._partialBytes=T,!0;s.putBytes(this._partialOutput.getBytes(d-this._partialBytes)),this._partialBytes=0}u(this._inBlock)},e.ctr.prototype.decrypt=e.ctr.prototype.encrypt,e.gcm=function(g){g=g||{},this.name="GCM",this.cipher=g.cipher,this.blockSize=g.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=i.util.createBuffer(),this._partialBytes=0,this._R=3774873600},e.gcm.prototype.start=function(g){if(!("iv"in g))throw new Error("Invalid IV parameter.");var s=i.util.createBuffer(g.iv);this._cipherLength=0;var o;if("additionalData"in g?o=i.util.createBuffer(g.additionalData):o=i.util.createBuffer(),"tagLength"in g?this._tagLength=g.tagLength:this._tagLength=128,this._tag=null,g.decrypt&&(this._tag=i.util.createBuffer(g.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var d=s.length();if(d===12)this._j0=[s.getInt32(),s.getInt32(),s.getInt32(),1];else{for(this._j0=[0,0,0,0];s.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[s.getInt32(),s.getInt32(),s.getInt32(),s.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(I(d*8)))}this._inBlock=this._j0.slice(0),u(this._inBlock),this._partialBytes=0,o=i.util.createBuffer(o),this._aDataLength=I(o.length()*8);var c=o.length()%this.blockSize;for(c&&o.fillWithByte(0,this.blockSize-c),this._s=[0,0,0,0];o.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[o.getInt32(),o.getInt32(),o.getInt32(),o.getInt32()])},e.gcm.prototype.encrypt=function(g,s,o){var d=g.length();if(d===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&d>=this.blockSize){for(var c=0;c<this._ints;++c)s.putInt32(this._outBlock[c]^=g.getInt32());this._cipherLength+=this.blockSize}else{var T=(this.blockSize-d)%this.blockSize;T>0&&(T=this.blockSize-T),this._partialOutput.clear();for(var c=0;c<this._ints;++c)this._partialOutput.putInt32(g.getInt32()^this._outBlock[c]);if(T<=0||o){if(o){var R=d%this.blockSize;this._cipherLength+=R,this._partialOutput.truncate(this.blockSize-R)}else this._cipherLength+=this.blockSize;for(var c=0;c<this._ints;++c)this._outBlock[c]=this._partialOutput.getInt32();this._partialOutput.read-=this.blockSize}if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),T>0&&!o)return g.read-=this.blockSize,s.putBytes(this._partialOutput.getBytes(T-this._partialBytes)),this._partialBytes=T,!0;s.putBytes(this._partialOutput.getBytes(d-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),u(this._inBlock)},e.gcm.prototype.decrypt=function(g,s,o){var d=g.length();if(d<this.blockSize&&!(o&&d>0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),u(this._inBlock),this._hashBlock[0]=g.getInt32(),this._hashBlock[1]=g.getInt32(),this._hashBlock[2]=g.getInt32(),this._hashBlock[3]=g.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var c=0;c<this._ints;++c)s.putInt32(this._outBlock[c]^this._hashBlock[c]);d<this.blockSize?this._cipherLength+=d%this.blockSize:this._cipherLength+=this.blockSize},e.gcm.prototype.afterFinish=function(g,s){var o=!0;s.decrypt&&s.overflow&&g.truncate(this.blockSize-s.overflow),this.tag=i.util.createBuffer();var d=this._aDataLength.concat(I(this._cipherLength*8));this._s=this.ghash(this._hashSubkey,this._s,d);var c=[];this.cipher.encrypt(this._j0,c);for(var T=0;T<this._ints;++T)this.tag.putInt32(this._s[T]^c[T]);return this.tag.truncate(this.tag.length()%(this._tagLength/8)),s.decrypt&&this.tag.bytes()!==this._tag&&(o=!1),o},e.gcm.prototype.multiply=function(g,s){for(var o=[0,0,0,0],d=s.slice(0),c=0;c<128;++c){var T=g[c/32|0]&1<<31-c%32;T&&(o[0]^=d[0],o[1]^=d[1],o[2]^=d[2],o[3]^=d[3]),this.pow(d,d)}return o},e.gcm.prototype.pow=function(g,s){for(var o=g[3]&1,d=3;d>0;--d)s[d]=g[d]>>>1|(g[d-1]&1)<<31;s[0]=g[0]>>>1,o&&(s[0]^=this._R)},e.gcm.prototype.tableMultiply=function(g){for(var s=[0,0,0,0],o=0;o<32;++o){var d=o/8|0,c=g[d]>>>(7-o%8)*4&15,T=this._m[o][c];s[0]^=T[0],s[1]^=T[1],s[2]^=T[2],s[3]^=T[3]}return s},e.gcm.prototype.ghash=function(g,s,o){return s[0]^=o[0],s[1]^=o[1],s[2]^=o[2],s[3]^=o[3],this.tableMultiply(s)},e.gcm.prototype.generateHashTable=function(g,s){for(var o=8/s,d=4*o,c=16*o,T=new Array(c),R=0;R<c;++R){var x=[0,0,0,0],y=R/d|0,E=(d-1-R%d)*s;x[y]=1<<s-1<<E,T[R]=this.generateSubHashTable(this.multiply(x,g),s)}return T},e.gcm.prototype.generateSubHashTable=function(g,s){var o=1<<s,d=o>>>1,c=new Array(o);c[d]=g.slice(0);for(var T=d>>>1;T>0;)this.pow(c[2*T],c[T]=[]),T>>=1;for(T=2;T<d;){for(var R=1;R<T;++R){var x=c[T],y=c[R];c[T+R]=[x[0]^y[0],x[1]^y[1],x[2]^y[2],x[3]^y[3]]}T*=2}for(c[0]=[0,0,0,0],T=d+1;T<o;++T){var E=c[T^d];c[T]=[g[0]^E[0],g[1]^E[1],g[2]^E[2],g[3]^E[3]]}return c};function t(g,s){if(typeof g=="string"&&(g=i.util.createBuffer(g)),i.util.isArray(g)&&g.length>4){var o=g;g=i.util.createBuffer();for(var d=0;d<o.length;++d)g.putByte(o[d])}if(g.length()<s)throw new Error("Invalid IV length; got "+g.length()+" bytes and expected "+s+" bytes.");if(!i.util.isArray(g)){for(var c=[],T=s/4,d=0;d<T;++d)c.push(g.getInt32());g=c}return g}function u(g){g[g.length-1]=g[g.length-1]+1&4294967295}function I(g){return[g/4294967296|0,g&4294967295]}return Le.exports}var De,gt;function _e(){if(gt)return De;gt=1;var i=H();pt(),yt(),X(),De=i.aes=i.aes||{},i.aes.startEncrypting=function(y,E,v,m){var a=x({key:y,output:v,decrypt:!1,mode:m});return a.start(E),a},i.aes.createEncryptionCipher=function(y,E){return x({key:y,output:null,decrypt:!1,mode:E})},i.aes.startDecrypting=function(y,E,v,m){var a=x({key:y,output:v,decrypt:!0,mode:m});return a.start(E),a},i.aes.createDecryptionCipher=function(y,E){return x({key:y,output:null,decrypt:!0,mode:E})},i.aes.Algorithm=function(y,E){t||c();var v=this;v.name=y,v.mode=new E({blockSize:16,cipher:{encrypt:function(m,a){return R(v._w,m,a,!1)},decrypt:function(m,a){return R(v._w,m,a,!0)}}}),v._init=!1},i.aes.Algorithm.prototype.initialize=function(y){if(!this._init){var E=y.key,v;if(typeof E=="string"&&(E.length===16||E.length===24||E.length===32))E=i.util.createBuffer(E);else if(i.util.isArray(E)&&(E.length===16||E.length===24||E.length===32)){v=E,E=i.util.createBuffer();for(var m=0;m<v.length;++m)E.putByte(v[m])}if(!i.util.isArray(E)){v=E,E=[];var a=v.length();if(a===16||a===24||a===32){a=a>>>2;for(var m=0;m<a;++m)E.push(v.getInt32())}}if(!i.util.isArray(E)||!(E.length===4||E.length===6||E.length===8))throw new Error("Invalid key parameter.");var l=this.mode.name,h=["CFB","OFB","CTR","GCM"].indexOf(l)!==-1;this._w=T(E,y.decrypt&&!h),this._init=!0}},i.aes._expandKey=function(y,E){return t||c(),T(y,E)},i.aes._updateBlock=R,e("AES-ECB",i.cipher.modes.ecb),e("AES-CBC",i.cipher.modes.cbc),e("AES-CFB",i.cipher.modes.cfb),e("AES-OFB",i.cipher.modes.ofb),e("AES-CTR",i.cipher.modes.ctr),e("AES-GCM",i.cipher.modes.gcm);function e(y,E){var v=function(){return new i.aes.Algorithm(y,E)};i.cipher.registerAlgorithm(y,v)}var t=!1,u=4,I,g,s,o,d;function c(){t=!0,s=[0,1,2,4,8,16,32,64,128,27,54];for(var y=new Array(256),E=0;E<128;++E)y[E]=E<<1,y[E+128]=E+128<<1^283;I=new Array(256),g=new Array(256),o=new Array(4),d=new Array(4);for(var E=0;E<4;++E)o[E]=new Array(256),d[E]=new Array(256);for(var v=0,m=0,a,l,h,A,b,n,r,E=0;E<256;++E){A=m^m<<1^m<<2^m<<3^m<<4,A=A>>8^A&255^99,I[v]=A,g[A]=v,b=y[A],a=y[v],l=y[a],h=y[l],n=b<<24^A<<16^A<<8^(A^b),r=(a^l^h)<<24^(v^h)<<16^(v^l^h)<<8^(v^a^h);for(var f=0;f<4;++f)o[f][v]=n,d[f][A]=r,n=n<<24|n>>>8,r=r<<24|r>>>8;v===0?v=m=1:(v=a^y[y[y[a^h]]],m^=y[y[m]])}}function T(y,E){for(var v=y.slice(0),m,a=1,l=v.length,h=l+6+1,A=u*h,b=l;b<A;++b)m=v[b-1],b%l===0?(m=I[m>>>16&255]<<24^I[m>>>8&255]<<16^I[m&255]<<8^I[m>>>24]^s[a]<<24,a++):l>6&&b%l===4&&(m=I[m>>>24]<<24^I[m>>>16&255]<<16^I[m>>>8&255]<<8^I[m&255]),v[b]=v[b-l]^m;if(E){var n,r=d[0],f=d[1],S=d[2],w=d[3],U=v.slice(0);A=v.length;for(var b=0,N=A-u;b<A;b+=u,N-=u)if(b===0||b===A-u)U[b]=v[N],U[b+1]=v[N+3],U[b+2]=v[N+2],U[b+3]=v[N+1];else for(var L=0;L<u;++L)n=v[N+L],U[b+(3&-L)]=r[I[n>>>24]]^f[I[n>>>16&255]]^S[I[n>>>8&255]]^w[I[n&255]];v=U}return v}function R(y,E,v,m){var a=y.length/4-1,l,h,A,b,n;m?(l=d[0],h=d[1],A=d[2],b=d[3],n=g):(l=o[0],h=o[1],A=o[2],b=o[3],n=I);var r,f,S,w,U,N,L;r=E[0]^y[0],f=E[m?3:1]^y[1],S=E[2]^y[2],w=E[m?1:3]^y[3];for(var P=3,_=1;_<a;++_)U=l[r>>>24]^h[f>>>16&255]^A[S>>>8&255]^b[w&255]^y[++P],N=l[f>>>24]^h[S>>>16&255]^A[w>>>8&255]^b[r&255]^y[++P],L=l[S>>>24]^h[w>>>16&255]^A[r>>>8&255]^b[f&255]^y[++P],w=l[w>>>24]^h[r>>>16&255]^A[f>>>8&255]^b[S&255]^y[++P],r=U,f=N,S=L;v[0]=n[r>>>24]<<24^n[f>>>16&255]<<16^n[S>>>8&255]<<8^n[w&255]^y[++P],v[m?3:1]=n[f>>>24]<<24^n[S>>>16&255]<<16^n[w>>>8&255]<<8^n[r&255]^y[++P],v[2]=n[S>>>24]<<24^n[w>>>16&255]<<16^n[r>>>8&255]<<8^n[f&255]^y[++P],v[m?1:3]=n[w>>>24]<<24^n[r>>>16&255]<<16^n[f>>>8&255]<<8^n[S&255]^y[++P]}function x(y){y=y||{};var E=(y.mode||"CBC").toUpperCase(),v="AES-"+E,m;y.decrypt?m=i.cipher.createDecipher(v,y.key):m=i.cipher.createCipher(v,y.key);var a=m.start;return m.start=function(l,h){var A=null;h instanceof i.util.ByteBuffer&&(A=h,h={}),h=h||{},h.output=A,h.iv=l,a.call(m,h)},m}return De}var Pe,vt;function Ct(){if(vt)return Pe;vt=1;var i=H();pt(),yt(),X(),Pe=i.des=i.des||{},i.des.startEncrypting=function(y,E,v,m){var a=x({key:y,output:v,decrypt:!1,mode:m||(E===null?"ECB":"CBC")});return a.start(E),a},i.des.createEncryptionCipher=function(y,E){return x({key:y,output:null,decrypt:!1,mode:E})},i.des.startDecrypting=function(y,E,v,m){var a=x({key:y,output:v,decrypt:!0,mode:m||(E===null?"ECB":"CBC")});return a.start(E),a},i.des.createDecryptionCipher=function(y,E){return x({key:y,output:null,decrypt:!0,mode:E})},i.des.Algorithm=function(y,E){var v=this;v.name=y,v.mode=new E({blockSize:8,cipher:{encrypt:function(m,a){return R(v._keys,m,a,!1)},decrypt:function(m,a){return R(v._keys,m,a,!0)}}}),v._init=!1},i.des.Algorithm.prototype.initialize=function(y){if(!this._init){var E=i.util.createBuffer(y.key);if(this.name.indexOf("3DES")===0&&E.length()!==24)throw new Error("Invalid Triple-DES key size: "+E.length()*8);this._keys=T(E),this._init=!0}},e("DES-ECB",i.cipher.modes.ecb),e("DES-CBC",i.cipher.modes.cbc),e("DES-CFB",i.cipher.modes.cfb),e("DES-OFB",i.cipher.modes.ofb),e("DES-CTR",i.cipher.modes.ctr),e("3DES-ECB",i.cipher.modes.ecb),e("3DES-CBC",i.cipher.modes.cbc),e("3DES-CFB",i.cipher.modes.cfb),e("3DES-OFB",i.cipher.modes.ofb),e("3DES-CTR",i.cipher.modes.ctr);function e(y,E){var v=function(){return new i.des.Algorithm(y,E)};i.cipher.registerAlgorithm(y,v)}var t=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],u=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],I=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],g=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],s=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],o=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],d=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],c=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];function T(y){for(var E=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],v=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],m=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],a=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],l=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],h=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],A=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],b=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],n=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],r=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],f=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],S=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],w=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],U=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],N=y.length()>8?3:1,L=[],P=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],_=0,k,F=0;F<N;F++){var K=y.getInt32(),G=y.getInt32();k=(K>>>4^G)&252645135,G^=k,K^=k<<4,k=(G>>>-16^K)&65535,K^=k,G^=k<<-16,k=(K>>>2^G)&858993459,G^=k,K^=k<<2,k=(G>>>-16^K)&65535,K^=k,G^=k<<-16,k=(K>>>1^G)&1431655765,G^=k,K^=k<<1,k=(G>>>8^K)&16711935,K^=k,G^=k<<8,k=(K>>>1^G)&1431655765,G^=k,K^=k<<1,k=K<<8|G>>>20&240,K=G<<24|G<<8&16711680|G>>>8&65280|G>>>24&240,G=k;for(var z=0;z<P.length;++z){P[z]?(K=K<<2|K>>>26,G=G<<2|G>>>26):(K=K<<1|K>>>27,G=G<<1|G>>>27),K&=-15,G&=-15;var Q=E[K>>>28]|v[K>>>24&15]|m[K>>>20&15]|a[K>>>16&15]|l[K>>>12&15]|h[K>>>8&15]|A[K>>>4&15],Y=b[G>>>28]|n[G>>>24&15]|r[G>>>20&15]|f[G>>>16&15]|S[G>>>12&15]|w[G>>>8&15]|U[G>>>4&15];k=(Y>>>16^Q)&65535,L[_++]=Q^k,L[_++]=Y^k<<16}}return L}function R(y,E,v,m){var a=y.length===32?3:9,l;a===3?l=m?[30,-2,-2]:[0,32,2]:l=m?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var h,A=E[0],b=E[1];h=(A>>>4^b)&252645135,b^=h,A^=h<<4,h=(A>>>16^b)&65535,b^=h,A^=h<<16,h=(b>>>2^A)&858993459,A^=h,b^=h<<2,h=(b>>>8^A)&16711935,A^=h,b^=h<<8,h=(A>>>1^b)&1431655765,b^=h,A^=h<<1,A=A<<1|A>>>31,b=b<<1|b>>>31;for(var n=0;n<a;n+=3){for(var r=l[n+1],f=l[n+2],S=l[n];S!=r;S+=f){var w=b^y[S],U=(b>>>4|b<<28)^y[S+1];h=A,A=b,b=h^(u[w>>>24&63]|g[w>>>16&63]|o[w>>>8&63]|c[w&63]|t[U>>>24&63]|I[U>>>16&63]|s[U>>>8&63]|d[U&63])}h=A,A=b,b=h}A=A>>>1|A<<31,b=b>>>1|b<<31,h=(A>>>1^b)&1431655765,b^=h,A^=h<<1,h=(b>>>8^A)&16711935,A^=h,b^=h<<8,h=(b>>>2^A)&858993459,A^=h,b^=h<<2,h=(A>>>16^b)&65535,b^=h,A^=h<<16,h=(A>>>4^b)&252645135,b^=h,A^=h<<4,v[0]=A,v[1]=b}function x(y){y=y||{};var E=(y.mode||"CBC").toUpperCase(),v="DES-"+E,m;y.decrypt?m=i.cipher.createDecipher(v,y.key):m=i.cipher.createCipher(v,y.key);var a=m.start;return m.start=function(l,h){var A=null;h instanceof i.util.ByteBuffer&&(A=h,h={}),h=h||{},h.output=A,h.iv=l,a.call(m,h)},m}return Pe}var ke,Et;function pe(){if(Et)return ke;Et=1;var i=H();return ke=i.md=i.md||{},i.md.algorithms=i.md.algorithms||{},ke}var Oe={exports:{}},mt;function xt(){if(mt)return Oe.exports;mt=1;var i=H();pe(),X();var e=Oe.exports=i.hmac=i.hmac||{};return e.create=function(){var t=null,u=null,I=null,g=null,s={};return s.start=function(o,d){if(o!==null)if(typeof o=="string")if(o=o.toLowerCase(),o in i.md.algorithms)u=i.md.algorithms[o].create();else throw new Error('Unknown hash algorithm "'+o+'"');else u=o;if(d===null)d=t;else{if(typeof d=="string")d=i.util.createBuffer(d);else if(i.util.isArray(d)){var c=d;d=i.util.createBuffer();for(var T=0;T<c.length;++T)d.putByte(c[T])}var R=d.length();R>u.blockLength&&(u.start(),u.update(d.bytes()),d=u.digest()),I=i.util.createBuffer(),g=i.util.createBuffer(),R=d.length();for(var T=0;T<R;++T){var c=d.at(T);I.putByte(54^c),g.putByte(92^c)}if(R<u.blockLength)for(var c=u.blockLength-R,T=0;T<c;++T)I.putByte(54),g.putByte(92);t=d,I=I.bytes(),g=g.bytes()}u.start(),u.update(I)},s.update=function(o){u.update(o)},s.getMac=function(){var o=u.digest().bytes();return u.start(),u.update(g),u.update(o),u.digest()},s.digest=s.getMac,s},Oe.exports}const Ve=lr(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Fe,St;function Tt(){if(St)return Fe;St=1;var i=H();xt(),pe(),X();var e=i.pkcs5=i.pkcs5||{},t;return i.util.isNodejs&&!i.options.usePureJavaScript&&(t=Ve),Fe=i.pbkdf2=e.pbkdf2=function(u,I,g,s,o,d){if(typeof o=="function"&&(d=o,o=null),i.util.isNodejs&&!i.options.usePureJavaScript&&t.pbkdf2&&(o===null||typeof o!="object")&&(t.pbkdf2Sync.length>4||!o||o==="sha1"))return typeof o!="string"&&(o="sha1"),u=Buffer.from(u,"binary"),I=Buffer.from(I,"binary"),d?t.pbkdf2Sync.length===4?t.pbkdf2(u,I,g,s,function(n,r){if(n)return d(n);d(null,r.toString("binary"))}):t.pbkdf2(u,I,g,s,o,function(n,r){if(n)return d(n);d(null,r.toString("binary"))}):t.pbkdf2Sync.length===4?t.pbkdf2Sync(u,I,g,s).toString("binary"):t.pbkdf2Sync(u,I,g,s,o).toString("binary");if((typeof o=="undefined"||o===null)&&(o="sha1"),typeof o=="string"){if(!(o in i.md.algorithms))throw new Error("Unknown hash algorithm: "+o);o=i.md[o].create()}var c=o.digestLength;if(s>4294967295*c){var T=new Error("Derived key is too long.");if(d)return d(T);throw T}var R=Math.ceil(s/c),x=s-(R-1)*c,y=i.hmac.create();y.start(o,u);var E="",v,m,a;if(!d){for(var l=1;l<=R;++l){y.start(null,null),y.update(I),y.update(i.util.int32ToBytes(l)),v=a=y.digest().getBytes();for(var h=2;h<=g;++h)y.start(null,null),y.update(a),m=y.digest().getBytes(),v=i.util.xorBytes(v,m,c),a=m;E+=l<R?v:v.substr(0,x)}return E}var l=1,h;function A(){if(l>R)return d(null,E);y.start(null,null),y.update(I),y.update(i.util.int32ToBytes(l)),v=a=y.digest().getBytes(),h=2,b()}function b(){if(h<=g)return y.start(null,null),y.update(a),m=y.digest().getBytes(),v=i.util.xorBytes(v,m,c),a=m,++h,i.util.setImmediate(b);E+=l<R?v:v.substr(0,x),++l,A()}A()},Fe}var Ke={exports:{}},It;function Me(){if(It)return Ke.exports;It=1;var i=H();X();var e=Ke.exports=i.pem=i.pem||{};e.encode=function(I,g){g=g||{};var s="-----BEGIN "+I.type+`-----\r
|
package/dist/index.d.ts
CHANGED
|
@@ -1981,7 +1981,7 @@ interface ImHttpPort {
|
|
|
1981
1981
|
}
|
|
1982
1982
|
|
|
1983
1983
|
/** 可持久化的媒体资产类型;未注册类型必须跳过缓存,不能回退到其它类型。 */
|
|
1984
|
-
type MediaAssetKind = 'image' | 'video';
|
|
1984
|
+
type MediaAssetKind = 'image' | 'video' | 'file';
|
|
1985
1985
|
/** 持久媒体资产的稳定键。resourceVersion 由远端资源标识派生,避免同消息替换资源后误命中旧缓存。 */
|
|
1986
1986
|
interface MediaAssetCacheKey {
|
|
1987
1987
|
kind: MediaAssetKind;
|
|
@@ -6157,7 +6157,7 @@ interface ImMediaTasksApi {
|
|
|
6157
6157
|
clearCache: () => Promise<void>;
|
|
6158
6158
|
/**
|
|
6159
6159
|
* 按输入顺序查询完整本机媒体是否可用;不下载、不读取 Blob、不续缓存期限或创建任务。
|
|
6160
|
-
*
|
|
6160
|
+
* 支持图片、视频和文件(含各自合集);未配置持久缓存时只检查内存。
|
|
6161
6161
|
* @throws 不支持轻量查询或存储读取失败时明确拒绝,不伪装成未命中。
|
|
6162
6162
|
* @example const [available] = await client.media.probeCached([messageRef])
|
|
6163
6163
|
*/
|
|
@@ -6240,7 +6240,7 @@ interface ImMediaTasksApi {
|
|
|
6240
6240
|
*
|
|
6241
6241
|
* 返回的对象可以**原样**作为 `localPreviewMetadata` 交给 `sendImage` / `sendVideo` /
|
|
6242
6242
|
* `sendMediaAlbum`:发送链路会复用可用元信息;合集项超出其可用消息空间时重新生成封面。
|
|
6243
|
-
* posterData 使用共享自适应发送规格(视频 JPEG,长边最多
|
|
6243
|
+
* posterData 使用共享自适应发送规格(视频 JPEG,长边最多 480px,目标 8 KiB、硬上限 24 KiB);includeDisplayPoster 可在同一次解码中额外生成
|
|
6244
6244
|
* 仅供页面显示的高清 displayPoster(长边最多 960),不得绕过发送校验直接用它替换 posterData。
|
|
6245
6245
|
*
|
|
6246
6246
|
* @param input.kind 按文件类型选解码路径;`'video'` 才会抽首帧与读时长。
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{computeBiFeedbackHeaderSign as t}from"./bi-feedback.js";import{API_PROTOCOL_OS_TYPE as e,API_PROTOCOL_APP_ID as s,API_PROTOCOL_APP_TYPE as n,API_PROTOCOL_BI_FEEDBACK_APP_ID as o,API_PROTOCOL_CLIENT_TYPE as r}from"./constants.js";import{parseApiProtocolJson as a}from"./json.js";import{
|
|
1
|
+
import{computeBiFeedbackHeaderSign as t}from"./bi-feedback.js";import{API_PROTOCOL_OS_TYPE as e,API_PROTOCOL_APP_ID as s,API_PROTOCOL_APP_TYPE as n,API_PROTOCOL_BI_FEEDBACK_APP_ID as o,API_PROTOCOL_CLIENT_TYPE as r}from"./constants.js";import{parseApiProtocolJson as a}from"./json.js";import{generateRequestNonce as i}from"./nonce.js";import{resolveTargetConfig as c,normalizeProtocolParams as p,resolveProtocolLang as u,resolveBrowserInfo as d,formatTimestamp as m,normalizeHeaders as l,appendQueryParams as f,isFormDataBody as g,createRandomAlphaNumericString as y,joinUrlParts as w,collectResponseHeaders as b,readResponseHeader as h,transportDataToUint8Array as v,isJsonResponse as S,isTextResponse as T,transportDataToText as M}from"./utils.js";const D=/* @__PURE__ */new Set(["content-etag","token","req-id"]);function C(t){const e=t.rawBody,s=null!==e&&"object"==typeof e&&"code"in e?e.code:void 0;return{transportStatus:t.transportStatus,...void 0===t.httpStatus?{}:{httpStatus:t.httpStatus},..."number"==typeof s&&Number.isFinite(s)?{businessCode:s}:{}}}function E(t,e){return{code:502,msg:t instanceof Error?t.message:String(t),data:null,time:Math.floor(e/1e3)}}function j(t,e,s,n){if(S(s))return a(M(e.data));if(T(s))return M(e.data);const o=v(e.data),r=n?t.crypto.decryptAes(o):o,i=(new TextDecoder).decode(r);return a(i)}async function B(t,e,s){if(!t.onDebugRecord)return;const n={...e.meta,response:e.response,...s?{error:{name:s instanceof Error?s.name:void 0,message:s instanceof Error?s.message:String(s)}}:{}};try{await t.onDebugRecord(n)}catch{}}async function _(t,e,s,n,o,r,i){const c=b(e.headers),p=h(c,"content-type");if(e.status<200||e.status>=300){let a;if(n)a=void 0;else try{a=j(t,e,p,s)}catch{a=void 0}const u=function(t){if(!t||"object"!=typeof t)return!1;const e=t;return Number.isFinite(e.code)&&"data"in e}(a)?a:function(t,e){return{code:t.status,msg:t.statusText,data:null,time:Math.floor(e/1e3)}}(e,i);return{response:u,meta:{...o,transportStatus:"http_error",httpStatus:e.status,contentType:p,responseHeaders:c,...void 0!==a?{rawBody:a}:{},timings:{totalMs:i-r,upstreamMs:i-r}}}}const u=Date.now();if(n){const t=v(e.data),s=Date.now();return{response:{code:e.status,data:t,time:Math.floor(s/1e3)},meta:{...o,transportStatus:"success",httpStatus:e.status,contentType:p,responseHeaders:c,rawBody:t,timings:{totalMs:s-r,upstreamMs:i-r,parseMs:s-u}}}}try{if(S(p)){const s=j(t,e,p,!1),n=Date.now();return{response:s,meta:{...o,transportStatus:"success",httpStatus:e.status,contentType:p,responseHeaders:c,rawBody:s,timings:{totalMs:n-r,upstreamMs:i-r,parseMs:n-u}}}}if(T(p)){const t=M(e.data),s=Date.now();return{response:{code:e.status,msg:e.statusText,data:t,time:Math.floor(s/1e3)},meta:{...o,transportStatus:"success",httpStatus:e.status,contentType:p,responseHeaders:c,rawBody:t,timings:{totalMs:s-r,upstreamMs:i-r,parseMs:s-u}}}}const n=v(e.data),d=Date.now(),m=s?t.crypto.decryptAes(n):n,l=Date.now(),f=(new TextDecoder).decode(m),g=a(f),y=Date.now();return{response:g,meta:{...o,transportStatus:"success",httpStatus:e.status,contentType:p,responseHeaders:c,rawBody:g,timings:{totalMs:y-r,upstreamMs:i-r,parseMs:y-u,...s?{decryptMs:l-d}:{}}}}}catch(t){const s=Date.now();return{response:{code:(d=e.status,Number.isInteger(d)&&d>=400&&d<=599?d:502),msg:t instanceof Error?t.message:String(t),data:null,time:Math.floor(s/1e3)},meta:{...o,transportStatus:"invalid_response",httpStatus:e.status,contentType:p,responseHeaders:c,timings:{totalMs:s-r,upstreamMs:i-r,parseMs:s-u}}}}var d}function I(a){return async function(b,h={}){const v=a.now??(()=>/* @__PURE__ */new Date),S=a.randomNonce??i,T=a.randomRequestId??(()=>`req-${crypto.randomUUID().replaceAll("-","")}`),M=a.randomETag??(()=>y()),j=(h.method??"POST").toUpperCase(),I=h.target??"core",N=c(I,a.config.targets[I]),k=h.prefix??N.prefix??"",q=null!=h.body,P=p(h.data??{}),R="/v1/feedback"===b&&"/bi/h5"===k,U=!R&&(h.encrypt??!q),x=!R&&(h.sign??!q),H=v(),A=M(),O=T(),V=h.token??await(a.getToken?.())??"",L=u(h.locale??a.getLocale?.()),J=a.getBrowserInfo?.()??d(h.userAgent),F={app_id:s,os_type:e,app_version:a.config.appVersion,sign_method:"md5",timestamp:m(H),nonce:S()},X={...F,...P,nonce:F.nonce};let G=F,Y=P,$=X;!R&&x&&(X.sign=a.crypto.generateSign("api",a.config.envType,X,A),F.sign=X.sign);const z={app_version:a.config.appVersion,"X-ENC-VERSION":a.config.appVersion,"X-APP-TYPE":n,"Client-type":r,"Content-ETag":A,"brand-id":a.config.brandId,"channel-id":h.channelId||a.config.channelId,device_brand:J.deviceBrand,device_info:J.deviceInfo,device_number:J.deviceNumber,device_token:J.deviceToken,lang:L,"mch-id":a.config.merchantId,"req-id":O,token:V},K=l(h.headers);let Q,W=b,Z={...z,...Object.fromEntries(Object.entries(K).filter(([t])=>!D.has(t.toLowerCase())))};if(q)Q=h.body??void 0,G=null,Y=h.data??null,$=h.data??null;else if(R){const e=String(H.getTime()),s={"app-id":o,"app-version":a.config.appVersion,"sys-type":n,"sys-version":J.deviceNumber,time:e};G=s,Z={...Z,...s,sign:t(a.crypto,s),"Content-Type":"application/json"},Q=JSON.stringify(P),$=P}else"GET"===j?(W=f(W,X),$=X):U?(Q=a.crypto.encryptAes((new TextEncoder).encode(JSON.stringify(X))),Z["Content-Type"]=Z["Content-Type"]||"application/octet-stream",$=X):(Q=JSON.stringify(X),Z["Content-Type"]=Z["Content-Type"]||"application/json",$=X);g(Q)&&delete Z["Content-Type"];const tt=function(t,e,s,n,o){if(s.customUrl)return t;const r=c(n,e.config.targets[n]),a=s.baseUrl??r.baseUrl;return w(a,o,t)}(W,a,h,I,k),et=Date.now(),st=h.timeoutMs??6e4,nt=function(t,e){const s=new AbortController,n=setTimeout(()=>s.abort(),t),o=()=>s.abort();return e&&(e.aborted?s.abort():e.addEventListener("abort",o,{once:!0})),{signal:s.signal,dispose:()=>{clearTimeout(n),e?.removeEventListener("abort",o)}}}(st,h.signal),ot={requestId:O,eTag:A,method:j,upstreamUrl:tt,requestHeaders:Z,requestCommonParams:G,requestBusinessParams:Y,requestParams:$};let rt;try{const t=await a.transport({url:tt,method:j,headers:Z,body:Q,signal:nt.signal,timeoutMs:st,onUploadProgress:h.onUploadProgress}),e=Date.now(),s=await _(a,t,U&&!R,"raw"===h.responseMode,ot,et,e);return h.onResponse&&(rt=C(s.meta),s.observation=rt),await B(a,s),!h.skipBusinessResponseHandler&&a.onBusinessResponse&&await a.onBusinessResponse(s.response,{request:{path:b,method:j,target:I,url:tt},options:h}),s}catch(t){const e=Date.now(),s={response:E(t,e),...void 0===rt?{}:{observation:rt},meta:{...ot,transportStatus:"network_error",timings:{totalMs:e-et,upstreamMs:e-et}}};return await B(a,s,t),s}finally{nt.dispose()}}}function N(t){const e=I(t);return async function(t,s={}){const n=await e(t,s);return await(s.onResponse?.(n.observation??C(n.meta))),n.response}}export{N as createApiProtocolClient};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const r="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";function n(n){if(!Number.isSafeInteger(n)||n<0)throw new RangeError("随机字符串长度必须是非负整数");const t=new Uint8Array(16);let
|
|
1
|
+
const r="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";function n(n){if(!Number.isSafeInteger(n)||n<0)throw new RangeError("随机字符串长度必须是非负整数");const t=new Uint8Array(16);let e="";for(;e.length<n;){globalThis.crypto.getRandomValues(t);for(const o of t)if(!(o>=248)&&(e+=r.charAt(o%62),e.length===n))return e}return e}function t(){return n(10)}export{t as generateRequestNonce,n as generateSecureRandomString};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{createCryptoDriver as t}from"./driver.js";import*as r from"./vendor/crypto/index_bg.js";import{__wbg_set_wasm as n}from"./vendor/crypto/index_bg.js";let e=null,a=null;async function i(){return a||(a=async function(){const e=await fetch(new URL("../../vendor/crypto/index_bg.wasm",import.meta.url));if(!e.ok)throw new Error(`crypto wasm 加载失败:HTTP ${e.status}`);const a={"./index_bg.js":r};let i;if("function"==typeof WebAssembly.instantiateStreaming)try{i=await WebAssembly.instantiateStreaming(e.clone(),a)}catch{i=await WebAssembly.instantiate(await e.arrayBuffer(),a)}else i=await WebAssembly.instantiate(await e.arrayBuffer(),a);return n(i.instance.exports),i.instance.exports.__wbindgen_start(),t(r)}().catch(t=>{throw a=null,t})),e=await a,e}function o(){if(!e)throw new Error("crypto driver 尚未初始化,请先 await loadBrowserCryptoDriver()");return e}function s(t){return o().cryptMd5(t)}function c(t,r,n,e=null){return o().generateSign(t,r,n,e)}function u(t){return o().encryptAes(t)}function f(t){return o().decryptAes(t)}await i();export{s as cryptMd5,f as decryptAes,u as encryptAes,c as generateSign,i as loadBrowserCryptoDriver};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function e(e){return{cryptMd5:e.crypt_md5,generateSign:e.generate_sign,encryptAes:e.encrypt_aes,decryptAes:e.decrypt_aes}}export{e as createCryptoDriver};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
let n;function e(e){n=e}function t(e,t){try{return e.apply(this,t)}catch(e){const t=function(e){const t=n.__externref_table_alloc();return n.__wbindgen_export_2.set(t,e),t}(e);n.__wbindgen_exn_store(t)}}function r(n){const e=typeof n;if("number"==e||"boolean"==e||null==n)return`${n}`;if("string"==e)return`"${n}"`;if("symbol"==e){const e=n.description;return null==e?"Symbol":`Symbol(${e})`}if("function"==e){const e=n.name;return"string"==typeof e&&e.length>0?`Function(${e})`:"Function"}if(Array.isArray(n)){const e=n.length;let t="[";e>0&&(t+=r(n[0]));for(let o=1;o<e;o++)t+=`, ${r(n[o])}`;return t+="]",t}const t=/\[object ([^\]]+)\]/.exec(toString.call(n));let o;if(!(t&&t.length>1))return toString.call(n);if(o=t[1],"Object"==o)try{return`Object(${JSON.stringify(n)})`}catch(n){return"Object"}return n instanceof Error?`${n.name}: ${n.message}\n${n.stack}`:o}let o=0,c=null;function i(){return null!==c&&0!==c.byteLength||(c=new Uint8Array(n.memory.buffer)),c}const l=new("undefined"==typeof TextEncoder?(0,module.require)("util").TextEncoder:TextEncoder)("utf-8"),u="function"==typeof l.encodeInto?function(n,e){return l.encodeInto(n,e)}:function(n,e){const t=l.encode(n);return e.set(t),{read:n.length,written:t.length}};function _(n,e,t){if(void 0===t){const t=l.encode(n),r=e(t.length,1)>>>0;return i().subarray(r,r+t.length).set(t),o=t.length,r}let r=n.length,c=e(r,1)>>>0;const _=i();let f=0;for(;f<r;f++){const e=n.charCodeAt(f);if(e>127)break;_[c+f]=e}if(f!==r){0!==f&&(n=n.slice(f)),c=t(c,r,r=f+3*n.length,1)>>>0;const e=i().subarray(c+f,c+r);f+=u(n,e).written,c=t(c,r,f,1)>>>0}return o=f,c}let f=null;function s(){return(null===f||!0===f.buffer.detached||void 0===f.buffer.detached&&f.buffer!==n.memory.buffer)&&(f=new DataView(n.memory.buffer)),f}function d(n){return null==n}const a=new("undefined"==typeof TextDecoder?(0,module.require)("util").TextDecoder:TextDecoder)("utf-8",{ignoreBOM:!0,fatal:!0});function g(n,e){return n>>>=0,a.decode(i().subarray(n,n+e))}function b(e){let t,r;try{const c=_(e,n.__wbindgen_malloc,n.__wbindgen_realloc),i=o,l=n.crypt_md5(c,i);return t=l[0],r=l[1],g(l[0],l[1])}finally{n.__wbindgen_free(t,r,1)}}function w(e,t,r,c){let i,l;try{const u=_(e,n.__wbindgen_malloc,n.__wbindgen_realloc),f=o,s=_(t,n.__wbindgen_malloc,n.__wbindgen_realloc),a=o,b=d(c)?0:_(c,n.__wbindgen_malloc,n.__wbindgen_realloc),w=o,y=n.generate_sign(u,f,s,a,r,b,w);let m=y[0],h=y[1];if(y[3])throw m=0,h=0,function(e){const t=n.__wbindgen_export_2.get(e);return n.__externref_table_dealloc(e),t}(y[2]);return i=m,l=h,g(m,h)}finally{n.__wbindgen_free(i,l,1)}}function y(n,e){const t=e(1*n.length,1)>>>0;return i().set(n,t/1),o=n.length,t}function m(n,e){return n>>>=0,i().subarray(n/1,n/1+e)}function h(e){const t=y(e,n.__wbindgen_malloc),r=o,c=n.encrypt_aes(t,r),i=m(c[0],c[1]).slice();return n.__wbindgen_free(c[0],1*c[1],1),i}function p(e){const t=y(e,n.__wbindgen_malloc),r=o,c=n.decrypt_aes(t,r),i=m(c[0],c[1]).slice();return n.__wbindgen_free(c[0],1*c[1],1),i}function x(){return t((n,e)=>Reflect.get(n,e),arguments)}function $(n,e){return n[e>>>0]}function I(n){return n.length}function T(){return t(n=>Reflect.ownKeys(n),arguments)}function j(e,t){const c=_(r(t),n.__wbindgen_malloc,n.__wbindgen_realloc),i=o;s().setInt32(e+4,i,!0),s().setInt32(e+0,c,!0)}function v(){const e=n.__wbindgen_export_2,t=e.grow(4);e.set(0,void 0),e.set(t+0,void 0),e.set(t+1,null),e.set(t+2,!0),e.set(t+3,!1)}function E(n){return"object"==typeof n&&null!==n}function O(e,t){const r="string"==typeof t?t:void 0,c=d(r)?0:_(r,n.__wbindgen_malloc,n.__wbindgen_realloc),i=o;s().setInt32(e+4,i,!0),s().setInt32(e+0,c,!0)}function S(n,e){return g(n,e)}function A(n,e){throw new Error(g(n,e))}a.decode();export{x as __wbg_get_67b2ba62fc30de12,$ as __wbg_get_b9b93047fe3cf45b,I as __wbg_length_e2d2a49132c1b256,T as __wbg_ownKeys_3930041068756f1f,e as __wbg_set_wasm,j as __wbindgen_debug_string,v as __wbindgen_init_externref_table,E as __wbindgen_is_object,O as __wbindgen_string_get,S as __wbindgen_string_new,A as __wbindgen_throw,b as crypt_md5,p as decrypt_aes,h as encrypt_aes,w as generate_sign};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{encryptCollectTeaBody as e,parseCollectFavoriteMsgBody as r}from"../crypto/collect-tea.js";import{requestCoreJson as t,CoreJsonBusinessError as i}from"./requests/core-json-request.js";import{projectSessionFavoriteFilesBody as n,parseSessionFavoriteFileItems as o}from"../../../im-core/src/session-favorite-files.js";import{resolveSessionFavoriteListImageUrl as a}from"../../../im-core/src/session-favorite-album.js";
|
|
1
|
+
import{encryptCollectTeaBody as e,parseCollectFavoriteMsgBody as r}from"../crypto/collect-tea.js";import{requestCoreJson as t,CoreJsonBusinessError as i}from"./requests/core-json-request.js";import{projectSessionFavoriteFilesBody as n,parseSessionFavoriteFileItems as o}from"../../../im-core/src/session-favorite-files.js";import{resolveSessionFavoriteListImageUrl as a}from"../../../im-core/src/session-favorite-album.js";class s extends Error{constructor(){super("会话收藏 Core API 未配置"),this.name="SessionFavoriteProviderUnavailableError"}}class c extends Error{constructor(e){super(e),this.name="SessionFavoriteMappingError"}}function d(e){return"string"==typeof e?e:null==e?"":String(e)}function m(e,r){const t=d(e).trim();if(""===t)throw new c(`${r} 不能为空`);return t}function l(e){if("direct"===e)return 0;if("group"===e)return 1;if("channel"===e)return 2;throw new c(`favorite conversation type ${e}`)}function f(e,r){return"text"===r||"location"===r?d(e.content).trim():"file"===r?d(e.fileName||e.file_name||e.name).trim():"mediaAlbum"===r||"filesAlbum"===r?d(e.caption).trim():"liveRoom"===r?d(e.liveRoomName).trim()||d(e.broadcasterUserName).trim():""}function u(e,r){const t=d(e.group_id).trim(),i=d(e.radio_id).trim(),n=Number(d(e.msg_type).trim());if(1===n&&""!==t)return{conversationType:"group",conversationId:t};if(2===n&&""!==i)return{conversationType:"channel",conversationId:i};if(""!==t)return{conversationType:"group",conversationId:t};if(""!==i)return{conversationType:"channel",conversationId:i};if(0===n){const t=d(e.from_id).trim(),i=d(e.to_id).trim(),n=t===r.trim()?i:t;if(""!==n)return{conversationType:"direct",conversationId:n}}return null}function v(e,r){const t=e.from_user,i=d(t?.nick_name||t?.nickname||t?.name).trim();return""===i?r:i}function p(e,t){const i=d(e.uu_id).trim(),s=function(e){const r="number"==typeof e?e:Number(String(e??"").trim());return 1===r?"text":2===r?"image":3===r?"video":4===r?"voice":5===r?"location":11===r?"file":28===r?"mediaAlbum":29===r?"filesAlbum":30===r?"liveRoom":null}(e.content_type),c=r(d(e.msg_body),t);if(""===i||null===s||null===c)return null;const m=d(e.from_id).trim();return Object.freeze({collectId:i,msgId:d(e.msg_id).trim(),kind:s,senderId:m,senderName:v(e,m),avatarUrl:d(e.from_user?.avatar).trim(),createdAt:d(e.create_time||e.update_time||e.msg_time).trim(),text:f(c,s),imageUrl:a(s,c),fileName:"filesAlbum"===s?o(c).map(e=>e.fileName).join(" "):"file"===s?f(c,"file"):"",body:"filesAlbum"===s?n(c):Object.freeze({...c}),conversation:u(e,t)})}function y(){if("undefined"==typeof crypto||"function"!=typeof crypto.randomUUID)throw new c("collect uuid 不可用");return crypto.randomUUID()}function g(r){async function d(e,n,o){if(void 0===r.coreClient)throw new s;const a=await t(r.coreClient,e,n,{method:"POST",responseMode:"strict",prefix:""});if(!a.ok)throw new i(o,a.code,a.message);return a.data}return{async list(){const e=m(r.getUserId(),"favorite userId"),t=await d("/api/v1/user/favorite/list",{start_time:"1970-01-01 08:00:00",page_size:"2000"},"会话收藏列表");return Object.freeze(function(e){if(null==e)return[];if(Array.isArray(e))return e;if("object"==typeof e&&null!==e&&"list"in e){const r=e.list;if(null==r)return[];if(Array.isArray(r))return r}throw new c("favorite list data 必须是数组或 { list }")}(t).flatMap(r=>{const t=p(r,e);return null===t?[]:[t]}))},async add(t){const i=m(r.getUserId(),"favorite userId"),s=(r.createCollectId??y)(),c={msg_id:m(t.messageId,"favorite msgId"),content_type:(u=t.kind,"text"===u?1:"image"===u?2:"video"===u?3:"voice"===u?4:"location"===u?5:"mediaAlbum"===u?28:"filesAlbum"===u?29:"liveRoom"===u?30:11),msg_type:l(t.conversation.conversationType),msg_time:String(t.createdAt),from_id:m(t.senderId,"favorite fromId"),to_id:m(t.peerId,"favorite toId"),is_hide:!0===t.hide?"1":"0",uu_id:s,msg_body:e(JSON.stringify(t.plainBody),i)};var u,v;return"group"===t.conversation.conversationType&&(c.group_id=t.conversation.conversationId),"channel"===t.conversation.conversationType&&(c.radio_id=t.conversation.conversationId),await d("/api/v1/user/favorite/add",c,"添加会话收藏"),v={collectId:s,msgId:t.messageId.trim(),kind:t.kind,senderId:t.senderId.trim(),senderName:t.senderId.trim(),avatarUrl:"",createdAt:String(t.createdAt),text:f(t.plainBody,t.kind),imageUrl:a(t.kind,t.plainBody),fileName:"filesAlbum"===t.kind?o(t.plainBody).map(e=>e.fileName).join(" "):"file"===t.kind?f(t.plainBody,"file"):"",body:"filesAlbum"===t.kind?n(t.plainBody):t.plainBody,conversation:t.conversation},Object.freeze({...v,body:Object.freeze({...v.body}),conversation:null===v.conversation?null:Object.freeze({...v.conversation})})},async delete(e){const r=[...new Set(e.map(e=>e.trim()).filter(e=>""!==e))];if(0===r.length)throw new c("favorite ids 不能为空");await d("/api/v1/user/favorite/del",{ids:r.join("|")},"删除会话收藏")}}}export{c as SessionFavoriteMappingError,s as SessionFavoriteProviderUnavailableError,g as createSessionFavoriteHttpAdapter};
|