@tonyclaw/agent-inspector 4.0.7 → 4.0.9
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/.output/backend/nitro.json +1 -1
- package/.output/cli.js +915 -25970
- package/.output/server/_chunks/ssr-renderer.mjs +1 -38
- package/.output/server/_libs/@opentelemetry/semantic-conventions+[...].mjs +1 -2658
- package/.output/server/_libs/agent-base.mjs +2 -234
- package/.output/server/_libs/ajv-formats.mjs +1 -330
- package/.output/server/_libs/ajv.mjs +8 -6080
- package/.output/server/_libs/anthropic-ai__sdk.mjs +19 -6021
- package/.output/server/_libs/atomically.mjs +1 -155
- package/.output/server/_libs/base64-js.mjs +1 -102
- package/.output/server/_libs/bignumber.js.mjs +1 -1353
- package/.output/server/_libs/buffer-equal-constant-time.mjs +1 -38
- package/.output/server/_libs/conf.mjs +1 -635
- package/.output/server/_libs/cookie-es.mjs +1 -44
- package/.output/server/_libs/core-util-is.mjs +1 -75
- package/.output/server/_libs/data-uri-to-buffer.mjs +1 -39
- package/.output/server/_libs/debounce-fn.mjs +1 -69
- package/.output/server/_libs/debug.mjs +5 -547
- package/.output/server/_libs/dot-prop.mjs +1 -265
- package/.output/server/_libs/ecdsa-sig-formatter.mjs +1 -162
- package/.output/server/_libs/env-paths.mjs +1 -57
- package/.output/server/_libs/extend.mjs +1 -94
- package/.output/server/_libs/fast-deep-equal.mjs +1 -38
- package/.output/server/_libs/fast-uri.mjs +1 -812
- package/.output/server/_libs/fetch-blob.mjs +1 -287
- package/.output/server/_libs/formdata-polyfill.mjs +9 -86
- package/.output/server/_libs/gaxios.mjs +5 -926
- package/.output/server/_libs/gcp-metadata.mjs +1 -322
- package/.output/server/_libs/google-auth-library.mjs +16 -6339
- package/.output/server/_libs/google-logging-utils.mjs +1 -385
- package/.output/server/_libs/google__genai.mjs +13 -18034
- package/.output/server/_libs/h3-v2.mjs +2 -287
- package/.output/server/_libs/h3.mjs +2 -408
- package/.output/server/_libs/has-flag.mjs +1 -16
- package/.output/server/_libs/https-proxy-agent.mjs +7 -280
- package/.output/server/_libs/immediate.mjs +1 -74
- package/.output/server/_libs/inherits.mjs +1 -50
- package/.output/server/_libs/isarray.mjs +1 -14
- package/.output/server/_libs/isbot.mjs +1 -20
- package/.output/server/_libs/json-bigint.mjs +8 -413
- package/.output/server/_libs/json-schema-traverse.mjs +1 -91
- package/.output/server/_libs/jszip.mjs +2 -3051
- package/.output/server/_libs/jwa.mjs +3 -233
- package/.output/server/_libs/jws.mjs +1 -298
- package/.output/server/_libs/lie.mjs +1 -273
- package/.output/server/_libs/mariozechner__pi-agent-core.mjs +1 -824
- package/.output/server/_libs/mariozechner__pi-ai.mjs +34 -22887
- package/.output/server/_libs/mimic-function.mjs +2 -47
- package/.output/server/_libs/mistralai__mistralai.mjs +7 -32045
- package/.output/server/_libs/modelcontextprotocol__core.mjs +1 -1121
- package/.output/server/_libs/modelcontextprotocol__server.mjs +13 -13205
- package/.output/server/_libs/ms.mjs +1 -120
- package/.output/server/_libs/node-domexception.mjs +1 -17
- package/.output/server/_libs/node-fetch.mjs +4 -1578
- package/.output/server/_libs/ohash.mjs +1 -1
- package/.output/server/_libs/openai.mjs +23 -6766
- package/.output/server/_libs/opentelemetry__api.mjs +1 -1678
- package/.output/server/_libs/p-retry.mjs +1 -87
- package/.output/server/_libs/pako.mjs +1 -4223
- package/.output/server/_libs/partial-json.mjs +2 -244
- package/.output/server/_libs/process-nextick-args.mjs +1 -48
- package/.output/server/_libs/react-dom.mjs +62 -10778
- package/.output/server/_libs/react.mjs +1 -519
- package/.output/server/_libs/readable-stream.mjs +1 -1518
- package/.output/server/_libs/retry.mjs +1 -236
- package/.output/server/_libs/rou3.mjs +1 -14
- package/.output/server/_libs/safe-buffer.mjs +1 -126
- package/.output/server/_libs/semver.mjs +1 -1938
- package/.output/server/_libs/seroval-plugins.mjs +1 -58
- package/.output/server/_libs/seroval.mjs +3 -1775
- package/.output/server/_libs/setimmediate.mjs +1 -152
- package/.output/server/_libs/srvx.mjs +4 -1390
- package/.output/server/_libs/stubborn-fs.mjs +1 -91
- package/.output/server/_libs/stubborn-utils.mjs +1 -66
- package/.output/server/_libs/supports-color.mjs +1 -108
- package/.output/server/_libs/tanstack__history.mjs +1 -230
- package/.output/server/_libs/tanstack__react-router.mjs +1 -848
- package/.output/server/_libs/tanstack__react-store.mjs +1 -1
- package/.output/server/_libs/tanstack__router-core.mjs +1 -4839
- package/.output/server/_libs/typebox.mjs +3 -6596
- package/.output/server/_libs/ufo.mjs +1 -54
- package/.output/server/_libs/uint8array-extras.mjs +1 -69
- package/.output/server/_libs/util-deprecate.mjs +1 -12
- package/.output/server/_libs/web-streams-polyfill.mjs +1 -4282
- package/.output/server/_libs/when-exit.mjs +1 -53
- package/.output/server/_libs/ws.mjs +7 -3715
- package/.output/server/_libs/zod-to-json-schema.mjs +5 -1207
- package/.output/server/_libs/zod.mjs +59 -9958
- package/.output/server/_ssr/empty-plugin-adapters-C3Q1xu4u.mjs +1 -0
- package/.output/server/_ssr/index.mjs +2 -1512
- package/.output/server/_ssr/publicBasePathContext--TAQS2_5.mjs +1 -0
- package/.output/server/_ssr/router-zSWaME0l.mjs +341 -0
- package/.output/server/_ssr/start-PDVGOqUN.mjs +1 -0
- package/.output/server/_tanstack-start-manifest_v-D7cKwKzM.mjs +1 -0
- package/.output/server/index.mjs +1 -320
- package/.output/ui/assets/{CompareDrawer-fWsmegqc.js → CompareDrawer-C6KvvPtJ.js} +1 -1
- package/.output/ui/assets/{InspectorPet-Z9XIA0t8.js → InspectorPet-CSH6OAhB.js} +1 -1
- package/.output/ui/assets/{ProxyViewerContainer-DhIB_ZAU.js → ProxyViewerContainer-vPd7g0Xn.js} +4 -4
- package/.output/ui/assets/{ReplayDialog-w_3PENIi.js → ReplayDialog-DbXUcT39.js} +1 -1
- package/.output/ui/assets/{RequestAnatomy-Dix0D4G6.js → RequestAnatomy-BWOCIN7J.js} +1 -1
- package/.output/ui/assets/{ResponseView-BtlbxW2o.js → ResponseView-BqDbTzFs.js} +1 -1
- package/.output/ui/assets/{StreamingChunkSequence-BqNQJASb.js → StreamingChunkSequence-UHl2g6w6.js} +1 -1
- package/.output/ui/assets/{_sessionId-DPiw4uu2.js → _sessionId-B2S61lDJ.js} +1 -1
- package/.output/ui/assets/{_sessionId-Bo9J8C5J.js → _sessionId-CS6hqj8-.js} +1 -1
- package/.output/ui/assets/{index-BL5id77_.js → index-C6V66rNI.js} +1 -1
- package/.output/ui/assets/{index-icwV1YtX.js → index-DY5xBYHr.js} +1 -1
- package/.output/ui/assets/{index-Wd6TK76x.js → index-DgyIeqyV.js} +2 -2
- package/.output/ui/assets/{index-CWSVfojK.js → index-HLs5jTyi.js} +1 -1
- package/.output/ui/assets/{json-viewer-Cpr3uw1I.js → json-viewer-i5LcN8e7.js} +1 -1
- package/.output/ui/assets/{jszip.min-Cncg6JOi.js → jszip.min-yNpb9qnf.js} +1 -1
- package/.output/ui/index.html +1 -1
- package/.output/workers/logFinalizer.worker.js +41 -17739
- package/.output/workers/sessionWorkerEntry.js +41 -17735
- package/package.json +7 -7
- package/.output/server/_ssr/empty-plugin-adapters-BFgPZ6_d.mjs +0 -6
- package/.output/server/_ssr/publicBasePathContext-IH2ilOfu.mjs +0 -176
- package/.output/server/_ssr/router-weYHAqCb.mjs +0 -27177
- package/.output/server/_ssr/start-COQu_AgD.mjs +0 -57
- package/.output/server/_tanstack-start-manifest_v-ClTaMkEj.mjs +0 -4
|
@@ -1,155 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import "node:fs";
|
|
3
|
-
import path from "node:path";
|
|
4
|
-
import "node:stream";
|
|
5
|
-
import { F as FS } from "./stubborn-fs.mjs";
|
|
6
|
-
import process from "node:process";
|
|
7
|
-
import { w as whenExit } from "./when-exit.mjs";
|
|
8
|
-
const DEFAULT_ENCODING = "utf8";
|
|
9
|
-
const DEFAULT_FILE_MODE = 438;
|
|
10
|
-
const DEFAULT_FOLDER_MODE = 511;
|
|
11
|
-
const DEFAULT_WRITE_OPTIONS = {};
|
|
12
|
-
const DEFAULT_USER_UID = process.geteuid ? process.geteuid() : -1;
|
|
13
|
-
const DEFAULT_USER_GID = process.getegid ? process.getegid() : -1;
|
|
14
|
-
const DEFAULT_TIMEOUT_SYNC = 1e3;
|
|
15
|
-
const IS_POSIX = !!process.getuid;
|
|
16
|
-
process.getuid ? !process.getuid() : false;
|
|
17
|
-
const LIMIT_BASENAME_LENGTH = 128;
|
|
18
|
-
const isException = (value) => {
|
|
19
|
-
return value instanceof Error && "code" in value;
|
|
20
|
-
};
|
|
21
|
-
const isString = (value) => {
|
|
22
|
-
return typeof value === "string";
|
|
23
|
-
};
|
|
24
|
-
const isUndefined = (value) => {
|
|
25
|
-
return value === void 0;
|
|
26
|
-
};
|
|
27
|
-
const Temp = {
|
|
28
|
-
/* VARIABLES */
|
|
29
|
-
store: {},
|
|
30
|
-
// filePath => purge
|
|
31
|
-
/* API */
|
|
32
|
-
create: (filePath) => {
|
|
33
|
-
const randomness = `000000${Math.floor(Math.random() * 16777215).toString(16)}`.slice(-6);
|
|
34
|
-
const timestamp = Date.now().toString().slice(-10);
|
|
35
|
-
const prefix = "tmp-";
|
|
36
|
-
const suffix = `.${prefix}${timestamp}${randomness}`;
|
|
37
|
-
const tempPath = `${filePath}${suffix}`;
|
|
38
|
-
return tempPath;
|
|
39
|
-
},
|
|
40
|
-
get: (filePath, creator, purge = true) => {
|
|
41
|
-
const tempPath = Temp.truncate(creator(filePath));
|
|
42
|
-
if (tempPath in Temp.store)
|
|
43
|
-
return Temp.get(filePath, creator, purge);
|
|
44
|
-
Temp.store[tempPath] = purge;
|
|
45
|
-
const disposer = () => delete Temp.store[tempPath];
|
|
46
|
-
return [tempPath, disposer];
|
|
47
|
-
},
|
|
48
|
-
purge: (filePath) => {
|
|
49
|
-
if (!Temp.store[filePath])
|
|
50
|
-
return;
|
|
51
|
-
delete Temp.store[filePath];
|
|
52
|
-
FS.attempt.unlink(filePath);
|
|
53
|
-
},
|
|
54
|
-
purgeSync: (filePath) => {
|
|
55
|
-
if (!Temp.store[filePath])
|
|
56
|
-
return;
|
|
57
|
-
delete Temp.store[filePath];
|
|
58
|
-
FS.attempt.unlinkSync(filePath);
|
|
59
|
-
},
|
|
60
|
-
purgeSyncAll: () => {
|
|
61
|
-
for (const filePath in Temp.store) {
|
|
62
|
-
Temp.purgeSync(filePath);
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
truncate: (filePath) => {
|
|
66
|
-
const basename = path.basename(filePath);
|
|
67
|
-
if (basename.length <= LIMIT_BASENAME_LENGTH)
|
|
68
|
-
return filePath;
|
|
69
|
-
const truncable = /^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(basename);
|
|
70
|
-
if (!truncable)
|
|
71
|
-
return filePath;
|
|
72
|
-
const truncationLength = basename.length - LIMIT_BASENAME_LENGTH;
|
|
73
|
-
return `${filePath.slice(0, -basename.length)}${truncable[1]}${truncable[2].slice(0, -truncationLength)}${truncable[3]}`;
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
whenExit(Temp.purgeSyncAll);
|
|
77
|
-
function writeFileSync(filePath, data, options = DEFAULT_WRITE_OPTIONS) {
|
|
78
|
-
if (isString(options))
|
|
79
|
-
return writeFileSync(filePath, data, { encoding: options });
|
|
80
|
-
const timeout = options.timeout ?? DEFAULT_TIMEOUT_SYNC;
|
|
81
|
-
const retryOptions = { timeout };
|
|
82
|
-
let tempDisposer = null;
|
|
83
|
-
let tempPath = null;
|
|
84
|
-
let fd = null;
|
|
85
|
-
try {
|
|
86
|
-
const filePathReal = FS.attempt.realpathSync(filePath);
|
|
87
|
-
const filePathExists = !!filePathReal;
|
|
88
|
-
filePath = filePathReal || filePath;
|
|
89
|
-
[tempPath, tempDisposer] = Temp.get(filePath, options.tmpCreate || Temp.create, !(options.tmpPurge === false));
|
|
90
|
-
const useStatChown = IS_POSIX && isUndefined(options.chown);
|
|
91
|
-
const useStatMode = isUndefined(options.mode);
|
|
92
|
-
if (filePathExists && (useStatChown || useStatMode)) {
|
|
93
|
-
const stats = FS.attempt.statSync(filePath);
|
|
94
|
-
if (stats) {
|
|
95
|
-
options = { ...options };
|
|
96
|
-
if (useStatChown) {
|
|
97
|
-
options.chown = { uid: stats.uid, gid: stats.gid };
|
|
98
|
-
}
|
|
99
|
-
if (useStatMode) {
|
|
100
|
-
options.mode = stats.mode;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
if (!filePathExists) {
|
|
105
|
-
const parentPath = path.dirname(filePath);
|
|
106
|
-
FS.attempt.mkdirSync(parentPath, {
|
|
107
|
-
mode: DEFAULT_FOLDER_MODE,
|
|
108
|
-
recursive: true
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
fd = FS.retry.openSync(retryOptions)(tempPath, "w", options.mode || DEFAULT_FILE_MODE);
|
|
112
|
-
if (options.tmpCreated) {
|
|
113
|
-
options.tmpCreated(tempPath);
|
|
114
|
-
}
|
|
115
|
-
if (isString(data)) {
|
|
116
|
-
FS.retry.writeSync(retryOptions)(fd, data, 0, options.encoding || DEFAULT_ENCODING);
|
|
117
|
-
} else if (!isUndefined(data)) {
|
|
118
|
-
FS.retry.writeSync(retryOptions)(fd, data, 0, data.length, 0);
|
|
119
|
-
}
|
|
120
|
-
if (options.fsync !== false) {
|
|
121
|
-
if (options.fsyncWait !== false) {
|
|
122
|
-
FS.retry.fsyncSync(retryOptions)(fd);
|
|
123
|
-
} else {
|
|
124
|
-
FS.attempt.fsync(fd);
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
FS.retry.closeSync(retryOptions)(fd);
|
|
128
|
-
fd = null;
|
|
129
|
-
if (options.chown && (options.chown.uid !== DEFAULT_USER_UID || options.chown.gid !== DEFAULT_USER_GID)) {
|
|
130
|
-
FS.attempt.chownSync(tempPath, options.chown.uid, options.chown.gid);
|
|
131
|
-
}
|
|
132
|
-
if (options.mode && options.mode !== DEFAULT_FILE_MODE) {
|
|
133
|
-
FS.attempt.chmodSync(tempPath, options.mode);
|
|
134
|
-
}
|
|
135
|
-
try {
|
|
136
|
-
FS.retry.renameSync(retryOptions)(tempPath, filePath);
|
|
137
|
-
} catch (error) {
|
|
138
|
-
if (!isException(error))
|
|
139
|
-
throw error;
|
|
140
|
-
if (error.code !== "ENAMETOOLONG")
|
|
141
|
-
throw error;
|
|
142
|
-
FS.retry.renameSync(retryOptions)(tempPath, Temp.truncate(filePath));
|
|
143
|
-
}
|
|
144
|
-
tempDisposer();
|
|
145
|
-
tempPath = null;
|
|
146
|
-
} finally {
|
|
147
|
-
if (fd)
|
|
148
|
-
FS.attempt.closeSync(fd);
|
|
149
|
-
if (tempPath)
|
|
150
|
-
Temp.purge(tempPath);
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
export {
|
|
154
|
-
writeFileSync as w
|
|
155
|
-
};
|
|
1
|
+
import"node:events";import"node:fs";import _ from"node:path";import"node:stream";import{F as n}from"./stubborn-fs.mjs";import d from"node:process";import{w as h}from"./when-exit.mjs";const D="utf8",p=438,T=511,L={},A=d.geteuid?d.geteuid():-1,F=d.getegid?d.getegid():-1,O=1e3,U=!!d.getuid;d.getuid&&d.getuid();const E=128,I=e=>e instanceof Error&&"code"in e,w=e=>typeof e=="string",y=e=>e===void 0,c={store:{},create:e=>{const r=`000000${Math.floor(Math.random()*16777215).toString(16)}`.slice(-6),o=`.tmp-${Date.now().toString().slice(-10)}${r}`;return`${e}${o}`},get:(e,r,t=!0)=>{const u=c.truncate(r(e));return u in c.store?c.get(e,r,t):(c.store[u]=t,[u,()=>delete c.store[u]])},purge:e=>{c.store[e]&&(delete c.store[e],n.attempt.unlink(e))},purgeSync:e=>{c.store[e]&&(delete c.store[e],n.attempt.unlinkSync(e))},purgeSyncAll:()=>{for(const e in c.store)c.purgeSync(e)},truncate:e=>{const r=_.basename(e);if(r.length<=E)return e;const t=/^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(r);if(!t)return e;const u=r.length-E;return`${e.slice(0,-r.length)}${t[1]}${t[2].slice(0,-u)}${t[3]}`}};h(c.purgeSyncAll);function $(e,r,t=L){if(w(t))return $(e,r,{encoding:t});const o={timeout:t.timeout??O};let f=null,m=null,i=null;try{const a=n.attempt.realpathSync(e),g=!!a;e=a||e,[m,f]=c.get(e,t.tmpCreate||c.create,t.tmpPurge!==!1);const S=U&&y(t.chown),l=y(t.mode);if(g&&(S||l)){const s=n.attempt.statSync(e);s&&(t={...t},S&&(t.chown={uid:s.uid,gid:s.gid}),l&&(t.mode=s.mode))}if(!g){const s=_.dirname(e);n.attempt.mkdirSync(s,{mode:T,recursive:!0})}i=n.retry.openSync(o)(m,"w",t.mode||p),t.tmpCreated&&t.tmpCreated(m),w(r)?n.retry.writeSync(o)(i,r,0,t.encoding||D):y(r)||n.retry.writeSync(o)(i,r,0,r.length,0),t.fsync!==!1&&(t.fsyncWait!==!1?n.retry.fsyncSync(o)(i):n.attempt.fsync(i)),n.retry.closeSync(o)(i),i=null,t.chown&&(t.chown.uid!==A||t.chown.gid!==F)&&n.attempt.chownSync(m,t.chown.uid,t.chown.gid),t.mode&&t.mode!==p&&n.attempt.chmodSync(m,t.mode);try{n.retry.renameSync(o)(m,e)}catch(s){if(!I(s)||s.code!=="ENAMETOOLONG")throw s;n.retry.renameSync(o)(m,c.truncate(e))}f(),m=null}finally{i&&n.attempt.closeSync(i),m&&c.purge(m)}}export{$ as w};
|
|
@@ -1,102 +1 @@
|
|
|
1
|
-
var
|
|
2
|
-
var hasRequiredBase64Js;
|
|
3
|
-
function requireBase64Js() {
|
|
4
|
-
if (hasRequiredBase64Js) return base64Js;
|
|
5
|
-
hasRequiredBase64Js = 1;
|
|
6
|
-
base64Js.byteLength = byteLength;
|
|
7
|
-
base64Js.toByteArray = toByteArray;
|
|
8
|
-
base64Js.fromByteArray = fromByteArray;
|
|
9
|
-
var lookup = [];
|
|
10
|
-
var revLookup = [];
|
|
11
|
-
var Arr = typeof Uint8Array !== "undefined" ? Uint8Array : Array;
|
|
12
|
-
var code = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
13
|
-
for (var i = 0, len = code.length; i < len; ++i) {
|
|
14
|
-
lookup[i] = code[i];
|
|
15
|
-
revLookup[code.charCodeAt(i)] = i;
|
|
16
|
-
}
|
|
17
|
-
revLookup["-".charCodeAt(0)] = 62;
|
|
18
|
-
revLookup["_".charCodeAt(0)] = 63;
|
|
19
|
-
function getLens(b64) {
|
|
20
|
-
var len2 = b64.length;
|
|
21
|
-
if (len2 % 4 > 0) {
|
|
22
|
-
throw new Error("Invalid string. Length must be a multiple of 4");
|
|
23
|
-
}
|
|
24
|
-
var validLen = b64.indexOf("=");
|
|
25
|
-
if (validLen === -1) validLen = len2;
|
|
26
|
-
var placeHoldersLen = validLen === len2 ? 0 : 4 - validLen % 4;
|
|
27
|
-
return [validLen, placeHoldersLen];
|
|
28
|
-
}
|
|
29
|
-
function byteLength(b64) {
|
|
30
|
-
var lens = getLens(b64);
|
|
31
|
-
var validLen = lens[0];
|
|
32
|
-
var placeHoldersLen = lens[1];
|
|
33
|
-
return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen;
|
|
34
|
-
}
|
|
35
|
-
function _byteLength(b64, validLen, placeHoldersLen) {
|
|
36
|
-
return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen;
|
|
37
|
-
}
|
|
38
|
-
function toByteArray(b64) {
|
|
39
|
-
var tmp;
|
|
40
|
-
var lens = getLens(b64);
|
|
41
|
-
var validLen = lens[0];
|
|
42
|
-
var placeHoldersLen = lens[1];
|
|
43
|
-
var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen));
|
|
44
|
-
var curByte = 0;
|
|
45
|
-
var len2 = placeHoldersLen > 0 ? validLen - 4 : validLen;
|
|
46
|
-
var i2;
|
|
47
|
-
for (i2 = 0; i2 < len2; i2 += 4) {
|
|
48
|
-
tmp = revLookup[b64.charCodeAt(i2)] << 18 | revLookup[b64.charCodeAt(i2 + 1)] << 12 | revLookup[b64.charCodeAt(i2 + 2)] << 6 | revLookup[b64.charCodeAt(i2 + 3)];
|
|
49
|
-
arr[curByte++] = tmp >> 16 & 255;
|
|
50
|
-
arr[curByte++] = tmp >> 8 & 255;
|
|
51
|
-
arr[curByte++] = tmp & 255;
|
|
52
|
-
}
|
|
53
|
-
if (placeHoldersLen === 2) {
|
|
54
|
-
tmp = revLookup[b64.charCodeAt(i2)] << 2 | revLookup[b64.charCodeAt(i2 + 1)] >> 4;
|
|
55
|
-
arr[curByte++] = tmp & 255;
|
|
56
|
-
}
|
|
57
|
-
if (placeHoldersLen === 1) {
|
|
58
|
-
tmp = revLookup[b64.charCodeAt(i2)] << 10 | revLookup[b64.charCodeAt(i2 + 1)] << 4 | revLookup[b64.charCodeAt(i2 + 2)] >> 2;
|
|
59
|
-
arr[curByte++] = tmp >> 8 & 255;
|
|
60
|
-
arr[curByte++] = tmp & 255;
|
|
61
|
-
}
|
|
62
|
-
return arr;
|
|
63
|
-
}
|
|
64
|
-
function tripletToBase64(num) {
|
|
65
|
-
return lookup[num >> 18 & 63] + lookup[num >> 12 & 63] + lookup[num >> 6 & 63] + lookup[num & 63];
|
|
66
|
-
}
|
|
67
|
-
function encodeChunk(uint8, start, end) {
|
|
68
|
-
var tmp;
|
|
69
|
-
var output = [];
|
|
70
|
-
for (var i2 = start; i2 < end; i2 += 3) {
|
|
71
|
-
tmp = (uint8[i2] << 16 & 16711680) + (uint8[i2 + 1] << 8 & 65280) + (uint8[i2 + 2] & 255);
|
|
72
|
-
output.push(tripletToBase64(tmp));
|
|
73
|
-
}
|
|
74
|
-
return output.join("");
|
|
75
|
-
}
|
|
76
|
-
function fromByteArray(uint8) {
|
|
77
|
-
var tmp;
|
|
78
|
-
var len2 = uint8.length;
|
|
79
|
-
var extraBytes = len2 % 3;
|
|
80
|
-
var parts = [];
|
|
81
|
-
var maxChunkLength = 16383;
|
|
82
|
-
for (var i2 = 0, len22 = len2 - extraBytes; i2 < len22; i2 += maxChunkLength) {
|
|
83
|
-
parts.push(encodeChunk(uint8, i2, i2 + maxChunkLength > len22 ? len22 : i2 + maxChunkLength));
|
|
84
|
-
}
|
|
85
|
-
if (extraBytes === 1) {
|
|
86
|
-
tmp = uint8[len2 - 1];
|
|
87
|
-
parts.push(
|
|
88
|
-
lookup[tmp >> 2] + lookup[tmp << 4 & 63] + "=="
|
|
89
|
-
);
|
|
90
|
-
} else if (extraBytes === 2) {
|
|
91
|
-
tmp = (uint8[len2 - 2] << 8) + uint8[len2 - 1];
|
|
92
|
-
parts.push(
|
|
93
|
-
lookup[tmp >> 10] + lookup[tmp >> 4 & 63] + lookup[tmp << 2 & 63] + "="
|
|
94
|
-
);
|
|
95
|
-
}
|
|
96
|
-
return parts.join("");
|
|
97
|
-
}
|
|
98
|
-
return base64Js;
|
|
99
|
-
}
|
|
100
|
-
export {
|
|
101
|
-
requireBase64Js as r
|
|
102
|
-
};
|
|
1
|
+
var u={},A;function m(){if(A)return u;A=1,u.byteLength=y,u.toByteArray=i,u.fromByteArray=B;for(var f=[],o=[],l=typeof Uint8Array<"u"?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",F=0,p=s.length;F<p;++F)f[F]=s[F],o[s.charCodeAt(F)]=F;o[45]=62,o[95]=63;function x(r){var e=r.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var a=r.indexOf("=");a===-1&&(a=e);var n=a===e?0:4-a%4;return[a,n]}function y(r){var e=x(r),a=e[0],n=e[1];return(a+n)*3/4-n}function C(r,e,a){return(e+a)*3/4-a}function i(r){var e,a=x(r),n=a[0],v=a[1],t=new l(C(r,n,v)),h=0,d=v>0?n-4:n,c;for(c=0;c<d;c+=4)e=o[r.charCodeAt(c)]<<18|o[r.charCodeAt(c+1)]<<12|o[r.charCodeAt(c+2)]<<6|o[r.charCodeAt(c+3)],t[h++]=e>>16&255,t[h++]=e>>8&255,t[h++]=e&255;return v===2&&(e=o[r.charCodeAt(c)]<<2|o[r.charCodeAt(c+1)]>>4,t[h++]=e&255),v===1&&(e=o[r.charCodeAt(c)]<<10|o[r.charCodeAt(c+1)]<<4|o[r.charCodeAt(c+2)]>>2,t[h++]=e>>8&255,t[h++]=e&255),t}function L(r){return f[r>>18&63]+f[r>>12&63]+f[r>>6&63]+f[r&63]}function g(r,e,a){for(var n,v=[],t=e;t<a;t+=3)n=(r[t]<<16&16711680)+(r[t+1]<<8&65280)+(r[t+2]&255),v.push(L(n));return v.join("")}function B(r){for(var e,a=r.length,n=a%3,v=[],t=16383,h=0,d=a-n;h<d;h+=t)v.push(g(r,h,h+t>d?d:h+t));return n===1?(e=r[a-1],v.push(f[e>>2]+f[e<<4&63]+"==")):n===2&&(e=(r[a-2]<<8)+r[a-1],v.push(f[e>>10]+f[e>>4&63]+f[e<<2&63]+"=")),v.join("")}return u}export{m as r};
|