@tonyclaw/agent-inspector 4.0.8 → 4.0.10
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-B3jax4sN.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-DafpfgaT.js → CompareDrawer-D8fg0prL.js} +1 -1
- package/.output/ui/assets/{InspectorPet-Brsmmfzx.js → InspectorPet-BAY7SAee.js} +1 -1
- package/.output/ui/assets/{ProxyViewerContainer-D2pq1fUr.js → ProxyViewerContainer-BPITPKYp.js} +4 -4
- package/.output/ui/assets/{ReplayDialog-D4mXXgT9.js → ReplayDialog-NLGOmBsc.js} +1 -1
- package/.output/ui/assets/{RequestAnatomy-Ccnsq12U.js → RequestAnatomy-DBhRhis7.js} +1 -1
- package/.output/ui/assets/{ResponseView-CJv3vB5X.js → ResponseView-DNXX-dzj.js} +1 -1
- package/.output/ui/assets/{StreamingChunkSequence-CEkLnOF6.js → StreamingChunkSequence-CLiT5Xun.js} +1 -1
- package/.output/ui/assets/{_sessionId-C7s68UH3.js → _sessionId-CY0Jj2Xv.js} +1 -1
- package/.output/ui/assets/{_sessionId-DlG-yHoI.js → _sessionId-Cf0So2vy.js} +1 -1
- package/.output/ui/assets/{index-ChZZrVHa.js → index-BIMJaHOR.js} +1 -1
- package/.output/ui/assets/{index-CFqnSirZ.js → index-DLG3AIXx.js} +1 -1
- package/.output/ui/assets/{index-B0NCZQ93.js → index-DTj5ErVh.js} +2 -2
- package/.output/ui/assets/{index-Cqh47jeU.js → index-ujyZ2AyC.js} +1 -1
- package/.output/ui/assets/{json-viewer-DvpI0vbY.js → json-viewer-BwPQ5x7s.js} +1 -1
- package/.output/ui/assets/{jszip.min-5AG8hW2c.js → jszip.min-CDwYiHmS.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-BDyF-OMB.mjs +0 -27187
- package/.output/server/_ssr/start-COQu_AgD.mjs +0 -57
- package/.output/server/_tanstack-start-manifest_v-ClTaMkEj.mjs +0 -4
|
@@ -1,812 +1 @@
|
|
|
1
|
-
var fastUri = { exports: {} };
|
|
2
|
-
var utils;
|
|
3
|
-
var hasRequiredUtils;
|
|
4
|
-
function requireUtils() {
|
|
5
|
-
if (hasRequiredUtils) return utils;
|
|
6
|
-
hasRequiredUtils = 1;
|
|
7
|
-
const isUUID = RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu);
|
|
8
|
-
const isIPv4 = RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);
|
|
9
|
-
const isHexPair = RegExp.prototype.test.bind(/^[\da-f]{2}$/iu);
|
|
10
|
-
const isUnreserved = RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu);
|
|
11
|
-
const isPathCharacter = RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);
|
|
12
|
-
function stringArrayToHexStripped(input) {
|
|
13
|
-
let acc = "";
|
|
14
|
-
let code = 0;
|
|
15
|
-
let i = 0;
|
|
16
|
-
for (i = 0; i < input.length; i++) {
|
|
17
|
-
code = input[i].charCodeAt(0);
|
|
18
|
-
if (code === 48) {
|
|
19
|
-
continue;
|
|
20
|
-
}
|
|
21
|
-
if (!(code >= 48 && code <= 57 || code >= 65 && code <= 70 || code >= 97 && code <= 102)) {
|
|
22
|
-
return "";
|
|
23
|
-
}
|
|
24
|
-
acc += input[i];
|
|
25
|
-
break;
|
|
26
|
-
}
|
|
27
|
-
for (i += 1; i < input.length; i++) {
|
|
28
|
-
code = input[i].charCodeAt(0);
|
|
29
|
-
if (!(code >= 48 && code <= 57 || code >= 65 && code <= 70 || code >= 97 && code <= 102)) {
|
|
30
|
-
return "";
|
|
31
|
-
}
|
|
32
|
-
acc += input[i];
|
|
33
|
-
}
|
|
34
|
-
return acc;
|
|
35
|
-
}
|
|
36
|
-
const nonSimpleDomain = RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);
|
|
37
|
-
function consumeIsZone(buffer) {
|
|
38
|
-
buffer.length = 0;
|
|
39
|
-
return true;
|
|
40
|
-
}
|
|
41
|
-
function consumeHextets(buffer, address, output) {
|
|
42
|
-
if (buffer.length) {
|
|
43
|
-
const hex = stringArrayToHexStripped(buffer);
|
|
44
|
-
if (hex !== "") {
|
|
45
|
-
address.push(hex);
|
|
46
|
-
} else {
|
|
47
|
-
output.error = true;
|
|
48
|
-
return false;
|
|
49
|
-
}
|
|
50
|
-
buffer.length = 0;
|
|
51
|
-
}
|
|
52
|
-
return true;
|
|
53
|
-
}
|
|
54
|
-
function getIPV6(input) {
|
|
55
|
-
let tokenCount = 0;
|
|
56
|
-
const output = { error: false, address: "", zone: "" };
|
|
57
|
-
const address = [];
|
|
58
|
-
const buffer = [];
|
|
59
|
-
let endipv6Encountered = false;
|
|
60
|
-
let endIpv6 = false;
|
|
61
|
-
let consume = consumeHextets;
|
|
62
|
-
for (let i = 0; i < input.length; i++) {
|
|
63
|
-
const cursor = input[i];
|
|
64
|
-
if (cursor === "[" || cursor === "]") {
|
|
65
|
-
continue;
|
|
66
|
-
}
|
|
67
|
-
if (cursor === ":") {
|
|
68
|
-
if (endipv6Encountered === true) {
|
|
69
|
-
endIpv6 = true;
|
|
70
|
-
}
|
|
71
|
-
if (!consume(buffer, address, output)) {
|
|
72
|
-
break;
|
|
73
|
-
}
|
|
74
|
-
if (++tokenCount > 7) {
|
|
75
|
-
output.error = true;
|
|
76
|
-
break;
|
|
77
|
-
}
|
|
78
|
-
if (i > 0 && input[i - 1] === ":") {
|
|
79
|
-
endipv6Encountered = true;
|
|
80
|
-
}
|
|
81
|
-
address.push(":");
|
|
82
|
-
continue;
|
|
83
|
-
} else if (cursor === "%") {
|
|
84
|
-
if (!consume(buffer, address, output)) {
|
|
85
|
-
break;
|
|
86
|
-
}
|
|
87
|
-
consume = consumeIsZone;
|
|
88
|
-
} else {
|
|
89
|
-
buffer.push(cursor);
|
|
90
|
-
continue;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
if (buffer.length) {
|
|
94
|
-
if (consume === consumeIsZone) {
|
|
95
|
-
output.zone = buffer.join("");
|
|
96
|
-
} else if (endIpv6) {
|
|
97
|
-
address.push(buffer.join(""));
|
|
98
|
-
} else {
|
|
99
|
-
address.push(stringArrayToHexStripped(buffer));
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
output.address = address.join("");
|
|
103
|
-
return output;
|
|
104
|
-
}
|
|
105
|
-
function normalizeIPv6(host) {
|
|
106
|
-
if (findToken(host, ":") < 2) {
|
|
107
|
-
return { host, isIPV6: false };
|
|
108
|
-
}
|
|
109
|
-
const ipv6 = getIPV6(host);
|
|
110
|
-
if (!ipv6.error) {
|
|
111
|
-
let newHost = ipv6.address;
|
|
112
|
-
let escapedHost = ipv6.address;
|
|
113
|
-
if (ipv6.zone) {
|
|
114
|
-
newHost += "%" + ipv6.zone;
|
|
115
|
-
escapedHost += "%25" + ipv6.zone;
|
|
116
|
-
}
|
|
117
|
-
return { host: newHost, isIPV6: true, escapedHost };
|
|
118
|
-
} else {
|
|
119
|
-
return { host, isIPV6: false };
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
function findToken(str, token) {
|
|
123
|
-
let ind = 0;
|
|
124
|
-
for (let i = 0; i < str.length; i++) {
|
|
125
|
-
if (str[i] === token) ind++;
|
|
126
|
-
}
|
|
127
|
-
return ind;
|
|
128
|
-
}
|
|
129
|
-
function removeDotSegments(path) {
|
|
130
|
-
let input = path;
|
|
131
|
-
const output = [];
|
|
132
|
-
let nextSlash = -1;
|
|
133
|
-
let len = 0;
|
|
134
|
-
while (len = input.length) {
|
|
135
|
-
if (len === 1) {
|
|
136
|
-
if (input === ".") {
|
|
137
|
-
break;
|
|
138
|
-
} else if (input === "/") {
|
|
139
|
-
output.push("/");
|
|
140
|
-
break;
|
|
141
|
-
} else {
|
|
142
|
-
output.push(input);
|
|
143
|
-
break;
|
|
144
|
-
}
|
|
145
|
-
} else if (len === 2) {
|
|
146
|
-
if (input[0] === ".") {
|
|
147
|
-
if (input[1] === ".") {
|
|
148
|
-
break;
|
|
149
|
-
} else if (input[1] === "/") {
|
|
150
|
-
input = input.slice(2);
|
|
151
|
-
continue;
|
|
152
|
-
}
|
|
153
|
-
} else if (input[0] === "/") {
|
|
154
|
-
if (input[1] === "." || input[1] === "/") {
|
|
155
|
-
output.push("/");
|
|
156
|
-
break;
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
} else if (len === 3) {
|
|
160
|
-
if (input === "/..") {
|
|
161
|
-
if (output.length !== 0) {
|
|
162
|
-
output.pop();
|
|
163
|
-
}
|
|
164
|
-
output.push("/");
|
|
165
|
-
break;
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
if (input[0] === ".") {
|
|
169
|
-
if (input[1] === ".") {
|
|
170
|
-
if (input[2] === "/") {
|
|
171
|
-
input = input.slice(3);
|
|
172
|
-
continue;
|
|
173
|
-
}
|
|
174
|
-
} else if (input[1] === "/") {
|
|
175
|
-
input = input.slice(2);
|
|
176
|
-
continue;
|
|
177
|
-
}
|
|
178
|
-
} else if (input[0] === "/") {
|
|
179
|
-
if (input[1] === ".") {
|
|
180
|
-
if (input[2] === "/") {
|
|
181
|
-
input = input.slice(2);
|
|
182
|
-
continue;
|
|
183
|
-
} else if (input[2] === ".") {
|
|
184
|
-
if (input[3] === "/") {
|
|
185
|
-
input = input.slice(3);
|
|
186
|
-
if (output.length !== 0) {
|
|
187
|
-
output.pop();
|
|
188
|
-
}
|
|
189
|
-
continue;
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
if ((nextSlash = input.indexOf("/", 1)) === -1) {
|
|
195
|
-
output.push(input);
|
|
196
|
-
break;
|
|
197
|
-
} else {
|
|
198
|
-
output.push(input.slice(0, nextSlash));
|
|
199
|
-
input = input.slice(nextSlash);
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
return output.join("");
|
|
203
|
-
}
|
|
204
|
-
const HOST_DELIMS = { "@": "%40", "/": "%2F", "?": "%3F", "#": "%23", ":": "%3A" };
|
|
205
|
-
const HOST_DELIM_RE = /[@/?#:]/g;
|
|
206
|
-
const HOST_DELIM_NO_COLON_RE = /[@/?#]/g;
|
|
207
|
-
function reescapeHostDelimiters(host, isIP) {
|
|
208
|
-
const re = isIP ? HOST_DELIM_NO_COLON_RE : HOST_DELIM_RE;
|
|
209
|
-
re.lastIndex = 0;
|
|
210
|
-
return host.replace(re, (ch) => HOST_DELIMS[ch]);
|
|
211
|
-
}
|
|
212
|
-
function normalizePercentEncoding(input, decodeUnreserved = false) {
|
|
213
|
-
if (input.indexOf("%") === -1) {
|
|
214
|
-
return input;
|
|
215
|
-
}
|
|
216
|
-
let output = "";
|
|
217
|
-
for (let i = 0; i < input.length; i++) {
|
|
218
|
-
if (input[i] === "%" && i + 2 < input.length) {
|
|
219
|
-
const hex = input.slice(i + 1, i + 3);
|
|
220
|
-
if (isHexPair(hex)) {
|
|
221
|
-
const normalizedHex = hex.toUpperCase();
|
|
222
|
-
const decoded = String.fromCharCode(parseInt(normalizedHex, 16));
|
|
223
|
-
if (decodeUnreserved && isUnreserved(decoded)) {
|
|
224
|
-
output += decoded;
|
|
225
|
-
} else {
|
|
226
|
-
output += "%" + normalizedHex;
|
|
227
|
-
}
|
|
228
|
-
i += 2;
|
|
229
|
-
continue;
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
output += input[i];
|
|
233
|
-
}
|
|
234
|
-
return output;
|
|
235
|
-
}
|
|
236
|
-
function normalizePathEncoding(input) {
|
|
237
|
-
let output = "";
|
|
238
|
-
for (let i = 0; i < input.length; i++) {
|
|
239
|
-
if (input[i] === "%" && i + 2 < input.length) {
|
|
240
|
-
const hex = input.slice(i + 1, i + 3);
|
|
241
|
-
if (isHexPair(hex)) {
|
|
242
|
-
const normalizedHex = hex.toUpperCase();
|
|
243
|
-
const decoded = String.fromCharCode(parseInt(normalizedHex, 16));
|
|
244
|
-
if (decoded !== "." && isUnreserved(decoded)) {
|
|
245
|
-
output += decoded;
|
|
246
|
-
} else {
|
|
247
|
-
output += "%" + normalizedHex;
|
|
248
|
-
}
|
|
249
|
-
i += 2;
|
|
250
|
-
continue;
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
if (isPathCharacter(input[i])) {
|
|
254
|
-
output += input[i];
|
|
255
|
-
} else {
|
|
256
|
-
output += escape(input[i]);
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
return output;
|
|
260
|
-
}
|
|
261
|
-
function escapePreservingEscapes(input) {
|
|
262
|
-
let output = "";
|
|
263
|
-
for (let i = 0; i < input.length; i++) {
|
|
264
|
-
if (input[i] === "%" && i + 2 < input.length) {
|
|
265
|
-
const hex = input.slice(i + 1, i + 3);
|
|
266
|
-
if (isHexPair(hex)) {
|
|
267
|
-
output += "%" + hex.toUpperCase();
|
|
268
|
-
i += 2;
|
|
269
|
-
continue;
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
output += escape(input[i]);
|
|
273
|
-
}
|
|
274
|
-
return output;
|
|
275
|
-
}
|
|
276
|
-
function recomposeAuthority(component) {
|
|
277
|
-
const uriTokens = [];
|
|
278
|
-
if (component.userinfo !== void 0) {
|
|
279
|
-
uriTokens.push(component.userinfo);
|
|
280
|
-
uriTokens.push("@");
|
|
281
|
-
}
|
|
282
|
-
if (component.host !== void 0) {
|
|
283
|
-
let host = unescape(component.host);
|
|
284
|
-
if (!isIPv4(host)) {
|
|
285
|
-
const ipV6res = normalizeIPv6(host);
|
|
286
|
-
if (ipV6res.isIPV6 === true) {
|
|
287
|
-
host = `[${ipV6res.escapedHost}]`;
|
|
288
|
-
} else {
|
|
289
|
-
host = reescapeHostDelimiters(host, false);
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
uriTokens.push(host);
|
|
293
|
-
}
|
|
294
|
-
if (typeof component.port === "number" || typeof component.port === "string") {
|
|
295
|
-
uriTokens.push(":");
|
|
296
|
-
uriTokens.push(String(component.port));
|
|
297
|
-
}
|
|
298
|
-
return uriTokens.length ? uriTokens.join("") : void 0;
|
|
299
|
-
}
|
|
300
|
-
utils = {
|
|
301
|
-
nonSimpleDomain,
|
|
302
|
-
recomposeAuthority,
|
|
303
|
-
reescapeHostDelimiters,
|
|
304
|
-
normalizePercentEncoding,
|
|
305
|
-
normalizePathEncoding,
|
|
306
|
-
escapePreservingEscapes,
|
|
307
|
-
removeDotSegments,
|
|
308
|
-
isIPv4,
|
|
309
|
-
isUUID,
|
|
310
|
-
normalizeIPv6,
|
|
311
|
-
stringArrayToHexStripped
|
|
312
|
-
};
|
|
313
|
-
return utils;
|
|
314
|
-
}
|
|
315
|
-
var schemes;
|
|
316
|
-
var hasRequiredSchemes;
|
|
317
|
-
function requireSchemes() {
|
|
318
|
-
if (hasRequiredSchemes) return schemes;
|
|
319
|
-
hasRequiredSchemes = 1;
|
|
320
|
-
const { isUUID } = requireUtils();
|
|
321
|
-
const URN_REG = /([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;
|
|
322
|
-
const supportedSchemeNames = (
|
|
323
|
-
/** @type {const} */
|
|
324
|
-
[
|
|
325
|
-
"http",
|
|
326
|
-
"https",
|
|
327
|
-
"ws",
|
|
328
|
-
"wss",
|
|
329
|
-
"urn",
|
|
330
|
-
"urn:uuid"
|
|
331
|
-
]
|
|
332
|
-
);
|
|
333
|
-
function isValidSchemeName(name) {
|
|
334
|
-
return supportedSchemeNames.indexOf(
|
|
335
|
-
/** @type {*} */
|
|
336
|
-
name
|
|
337
|
-
) !== -1;
|
|
338
|
-
}
|
|
339
|
-
function wsIsSecure(wsComponent) {
|
|
340
|
-
if (wsComponent.secure === true) {
|
|
341
|
-
return true;
|
|
342
|
-
} else if (wsComponent.secure === false) {
|
|
343
|
-
return false;
|
|
344
|
-
} else if (wsComponent.scheme) {
|
|
345
|
-
return wsComponent.scheme.length === 3 && (wsComponent.scheme[0] === "w" || wsComponent.scheme[0] === "W") && (wsComponent.scheme[1] === "s" || wsComponent.scheme[1] === "S") && (wsComponent.scheme[2] === "s" || wsComponent.scheme[2] === "S");
|
|
346
|
-
} else {
|
|
347
|
-
return false;
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
function httpParse(component) {
|
|
351
|
-
if (!component.host) {
|
|
352
|
-
component.error = component.error || "HTTP URIs must have a host.";
|
|
353
|
-
}
|
|
354
|
-
return component;
|
|
355
|
-
}
|
|
356
|
-
function httpSerialize(component) {
|
|
357
|
-
const secure = String(component.scheme).toLowerCase() === "https";
|
|
358
|
-
if (component.port === (secure ? 443 : 80) || component.port === "") {
|
|
359
|
-
component.port = void 0;
|
|
360
|
-
}
|
|
361
|
-
if (!component.path) {
|
|
362
|
-
component.path = "/";
|
|
363
|
-
}
|
|
364
|
-
return component;
|
|
365
|
-
}
|
|
366
|
-
function wsParse(wsComponent) {
|
|
367
|
-
wsComponent.secure = wsIsSecure(wsComponent);
|
|
368
|
-
wsComponent.resourceName = (wsComponent.path || "/") + (wsComponent.query ? "?" + wsComponent.query : "");
|
|
369
|
-
wsComponent.path = void 0;
|
|
370
|
-
wsComponent.query = void 0;
|
|
371
|
-
return wsComponent;
|
|
372
|
-
}
|
|
373
|
-
function wsSerialize(wsComponent) {
|
|
374
|
-
if (wsComponent.port === (wsIsSecure(wsComponent) ? 443 : 80) || wsComponent.port === "") {
|
|
375
|
-
wsComponent.port = void 0;
|
|
376
|
-
}
|
|
377
|
-
if (typeof wsComponent.secure === "boolean") {
|
|
378
|
-
wsComponent.scheme = wsComponent.secure ? "wss" : "ws";
|
|
379
|
-
wsComponent.secure = void 0;
|
|
380
|
-
}
|
|
381
|
-
if (wsComponent.resourceName) {
|
|
382
|
-
const [path, query] = wsComponent.resourceName.split("?");
|
|
383
|
-
wsComponent.path = path && path !== "/" ? path : void 0;
|
|
384
|
-
wsComponent.query = query;
|
|
385
|
-
wsComponent.resourceName = void 0;
|
|
386
|
-
}
|
|
387
|
-
wsComponent.fragment = void 0;
|
|
388
|
-
return wsComponent;
|
|
389
|
-
}
|
|
390
|
-
function urnParse(urnComponent, options) {
|
|
391
|
-
if (!urnComponent.path) {
|
|
392
|
-
urnComponent.error = "URN can not be parsed";
|
|
393
|
-
return urnComponent;
|
|
394
|
-
}
|
|
395
|
-
const matches = urnComponent.path.match(URN_REG);
|
|
396
|
-
if (matches) {
|
|
397
|
-
const scheme = options.scheme || urnComponent.scheme || "urn";
|
|
398
|
-
urnComponent.nid = matches[1].toLowerCase();
|
|
399
|
-
urnComponent.nss = matches[2];
|
|
400
|
-
const urnScheme = `${scheme}:${options.nid || urnComponent.nid}`;
|
|
401
|
-
const schemeHandler = getSchemeHandler(urnScheme);
|
|
402
|
-
urnComponent.path = void 0;
|
|
403
|
-
if (schemeHandler) {
|
|
404
|
-
urnComponent = schemeHandler.parse(urnComponent, options);
|
|
405
|
-
}
|
|
406
|
-
} else {
|
|
407
|
-
urnComponent.error = urnComponent.error || "URN can not be parsed.";
|
|
408
|
-
}
|
|
409
|
-
return urnComponent;
|
|
410
|
-
}
|
|
411
|
-
function urnSerialize(urnComponent, options) {
|
|
412
|
-
if (urnComponent.nid === void 0) {
|
|
413
|
-
throw new Error("URN without nid cannot be serialized");
|
|
414
|
-
}
|
|
415
|
-
const scheme = options.scheme || urnComponent.scheme || "urn";
|
|
416
|
-
const nid = urnComponent.nid.toLowerCase();
|
|
417
|
-
const urnScheme = `${scheme}:${options.nid || nid}`;
|
|
418
|
-
const schemeHandler = getSchemeHandler(urnScheme);
|
|
419
|
-
if (schemeHandler) {
|
|
420
|
-
urnComponent = schemeHandler.serialize(urnComponent, options);
|
|
421
|
-
}
|
|
422
|
-
const uriComponent = urnComponent;
|
|
423
|
-
const nss = urnComponent.nss;
|
|
424
|
-
uriComponent.path = `${nid || options.nid}:${nss}`;
|
|
425
|
-
options.skipEscape = true;
|
|
426
|
-
return uriComponent;
|
|
427
|
-
}
|
|
428
|
-
function urnuuidParse(urnComponent, options) {
|
|
429
|
-
const uuidComponent = urnComponent;
|
|
430
|
-
uuidComponent.uuid = uuidComponent.nss;
|
|
431
|
-
uuidComponent.nss = void 0;
|
|
432
|
-
if (!options.tolerant && (!uuidComponent.uuid || !isUUID(uuidComponent.uuid))) {
|
|
433
|
-
uuidComponent.error = uuidComponent.error || "UUID is not valid.";
|
|
434
|
-
}
|
|
435
|
-
return uuidComponent;
|
|
436
|
-
}
|
|
437
|
-
function urnuuidSerialize(uuidComponent) {
|
|
438
|
-
const urnComponent = uuidComponent;
|
|
439
|
-
urnComponent.nss = (uuidComponent.uuid || "").toLowerCase();
|
|
440
|
-
return urnComponent;
|
|
441
|
-
}
|
|
442
|
-
const http = (
|
|
443
|
-
/** @type {SchemeHandler} */
|
|
444
|
-
{
|
|
445
|
-
scheme: "http",
|
|
446
|
-
domainHost: true,
|
|
447
|
-
parse: httpParse,
|
|
448
|
-
serialize: httpSerialize
|
|
449
|
-
}
|
|
450
|
-
);
|
|
451
|
-
const https = (
|
|
452
|
-
/** @type {SchemeHandler} */
|
|
453
|
-
{
|
|
454
|
-
scheme: "https",
|
|
455
|
-
domainHost: http.domainHost,
|
|
456
|
-
parse: httpParse,
|
|
457
|
-
serialize: httpSerialize
|
|
458
|
-
}
|
|
459
|
-
);
|
|
460
|
-
const ws = (
|
|
461
|
-
/** @type {SchemeHandler} */
|
|
462
|
-
{
|
|
463
|
-
scheme: "ws",
|
|
464
|
-
domainHost: true,
|
|
465
|
-
parse: wsParse,
|
|
466
|
-
serialize: wsSerialize
|
|
467
|
-
}
|
|
468
|
-
);
|
|
469
|
-
const wss = (
|
|
470
|
-
/** @type {SchemeHandler} */
|
|
471
|
-
{
|
|
472
|
-
scheme: "wss",
|
|
473
|
-
domainHost: ws.domainHost,
|
|
474
|
-
parse: ws.parse,
|
|
475
|
-
serialize: ws.serialize
|
|
476
|
-
}
|
|
477
|
-
);
|
|
478
|
-
const urn = (
|
|
479
|
-
/** @type {SchemeHandler} */
|
|
480
|
-
{
|
|
481
|
-
scheme: "urn",
|
|
482
|
-
parse: urnParse,
|
|
483
|
-
serialize: urnSerialize,
|
|
484
|
-
skipNormalize: true
|
|
485
|
-
}
|
|
486
|
-
);
|
|
487
|
-
const urnuuid = (
|
|
488
|
-
/** @type {SchemeHandler} */
|
|
489
|
-
{
|
|
490
|
-
scheme: "urn:uuid",
|
|
491
|
-
parse: urnuuidParse,
|
|
492
|
-
serialize: urnuuidSerialize,
|
|
493
|
-
skipNormalize: true
|
|
494
|
-
}
|
|
495
|
-
);
|
|
496
|
-
const SCHEMES = (
|
|
497
|
-
/** @type {Record<SchemeName, SchemeHandler>} */
|
|
498
|
-
{
|
|
499
|
-
http,
|
|
500
|
-
https,
|
|
501
|
-
ws,
|
|
502
|
-
wss,
|
|
503
|
-
urn,
|
|
504
|
-
"urn:uuid": urnuuid
|
|
505
|
-
}
|
|
506
|
-
);
|
|
507
|
-
Object.setPrototypeOf(SCHEMES, null);
|
|
508
|
-
function getSchemeHandler(scheme) {
|
|
509
|
-
return scheme && (SCHEMES[
|
|
510
|
-
/** @type {SchemeName} */
|
|
511
|
-
scheme
|
|
512
|
-
] || SCHEMES[
|
|
513
|
-
/** @type {SchemeName} */
|
|
514
|
-
scheme.toLowerCase()
|
|
515
|
-
]) || void 0;
|
|
516
|
-
}
|
|
517
|
-
schemes = {
|
|
518
|
-
wsIsSecure,
|
|
519
|
-
SCHEMES,
|
|
520
|
-
isValidSchemeName,
|
|
521
|
-
getSchemeHandler
|
|
522
|
-
};
|
|
523
|
-
return schemes;
|
|
524
|
-
}
|
|
525
|
-
var hasRequiredFastUri;
|
|
526
|
-
function requireFastUri() {
|
|
527
|
-
if (hasRequiredFastUri) return fastUri.exports;
|
|
528
|
-
hasRequiredFastUri = 1;
|
|
529
|
-
const { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding, escapePreservingEscapes, reescapeHostDelimiters, isIPv4, nonSimpleDomain } = requireUtils();
|
|
530
|
-
const { SCHEMES, getSchemeHandler } = requireSchemes();
|
|
531
|
-
function normalize(uri, options) {
|
|
532
|
-
if (typeof uri === "string") {
|
|
533
|
-
uri = /** @type {T} */
|
|
534
|
-
normalizeString(uri, options);
|
|
535
|
-
} else if (typeof uri === "object") {
|
|
536
|
-
uri = /** @type {T} */
|
|
537
|
-
parse(serialize(uri, options), options);
|
|
538
|
-
}
|
|
539
|
-
return uri;
|
|
540
|
-
}
|
|
541
|
-
function resolve(baseURI, relativeURI, options) {
|
|
542
|
-
const schemelessOptions = options ? Object.assign({ scheme: "null" }, options) : { scheme: "null" };
|
|
543
|
-
const resolved = resolveComponent(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true);
|
|
544
|
-
schemelessOptions.skipEscape = true;
|
|
545
|
-
return serialize(resolved, schemelessOptions);
|
|
546
|
-
}
|
|
547
|
-
function resolveComponent(base, relative, options, skipNormalization) {
|
|
548
|
-
const target = {};
|
|
549
|
-
if (!skipNormalization) {
|
|
550
|
-
base = parse(serialize(base, options), options);
|
|
551
|
-
relative = parse(serialize(relative, options), options);
|
|
552
|
-
}
|
|
553
|
-
options = options || {};
|
|
554
|
-
if (!options.tolerant && relative.scheme) {
|
|
555
|
-
target.scheme = relative.scheme;
|
|
556
|
-
target.userinfo = relative.userinfo;
|
|
557
|
-
target.host = relative.host;
|
|
558
|
-
target.port = relative.port;
|
|
559
|
-
target.path = removeDotSegments(relative.path || "");
|
|
560
|
-
target.query = relative.query;
|
|
561
|
-
} else {
|
|
562
|
-
if (relative.userinfo !== void 0 || relative.host !== void 0 || relative.port !== void 0) {
|
|
563
|
-
target.userinfo = relative.userinfo;
|
|
564
|
-
target.host = relative.host;
|
|
565
|
-
target.port = relative.port;
|
|
566
|
-
target.path = removeDotSegments(relative.path || "");
|
|
567
|
-
target.query = relative.query;
|
|
568
|
-
} else {
|
|
569
|
-
if (!relative.path) {
|
|
570
|
-
target.path = base.path;
|
|
571
|
-
if (relative.query !== void 0) {
|
|
572
|
-
target.query = relative.query;
|
|
573
|
-
} else {
|
|
574
|
-
target.query = base.query;
|
|
575
|
-
}
|
|
576
|
-
} else {
|
|
577
|
-
if (relative.path[0] === "/") {
|
|
578
|
-
target.path = removeDotSegments(relative.path);
|
|
579
|
-
} else {
|
|
580
|
-
if ((base.userinfo !== void 0 || base.host !== void 0 || base.port !== void 0) && !base.path) {
|
|
581
|
-
target.path = "/" + relative.path;
|
|
582
|
-
} else if (!base.path) {
|
|
583
|
-
target.path = relative.path;
|
|
584
|
-
} else {
|
|
585
|
-
target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative.path;
|
|
586
|
-
}
|
|
587
|
-
target.path = removeDotSegments(target.path);
|
|
588
|
-
}
|
|
589
|
-
target.query = relative.query;
|
|
590
|
-
}
|
|
591
|
-
target.userinfo = base.userinfo;
|
|
592
|
-
target.host = base.host;
|
|
593
|
-
target.port = base.port;
|
|
594
|
-
}
|
|
595
|
-
target.scheme = base.scheme;
|
|
596
|
-
}
|
|
597
|
-
target.fragment = relative.fragment;
|
|
598
|
-
return target;
|
|
599
|
-
}
|
|
600
|
-
function equal(uriA, uriB, options) {
|
|
601
|
-
const normalizedA = normalizeComparableURI(uriA, options);
|
|
602
|
-
const normalizedB = normalizeComparableURI(uriB, options);
|
|
603
|
-
return normalizedA !== void 0 && normalizedB !== void 0 && normalizedA.toLowerCase() === normalizedB.toLowerCase();
|
|
604
|
-
}
|
|
605
|
-
function serialize(cmpts, opts) {
|
|
606
|
-
const component = {
|
|
607
|
-
host: cmpts.host,
|
|
608
|
-
scheme: cmpts.scheme,
|
|
609
|
-
userinfo: cmpts.userinfo,
|
|
610
|
-
port: cmpts.port,
|
|
611
|
-
path: cmpts.path,
|
|
612
|
-
query: cmpts.query,
|
|
613
|
-
nid: cmpts.nid,
|
|
614
|
-
nss: cmpts.nss,
|
|
615
|
-
uuid: cmpts.uuid,
|
|
616
|
-
fragment: cmpts.fragment,
|
|
617
|
-
reference: cmpts.reference,
|
|
618
|
-
resourceName: cmpts.resourceName,
|
|
619
|
-
secure: cmpts.secure,
|
|
620
|
-
error: ""
|
|
621
|
-
};
|
|
622
|
-
const options = Object.assign({}, opts);
|
|
623
|
-
const uriTokens = [];
|
|
624
|
-
const schemeHandler = getSchemeHandler(options.scheme || component.scheme);
|
|
625
|
-
if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(component, options);
|
|
626
|
-
if (component.path !== void 0) {
|
|
627
|
-
if (!options.skipEscape) {
|
|
628
|
-
component.path = escapePreservingEscapes(component.path);
|
|
629
|
-
if (component.scheme !== void 0) {
|
|
630
|
-
component.path = component.path.split("%3A").join(":");
|
|
631
|
-
}
|
|
632
|
-
} else {
|
|
633
|
-
component.path = normalizePercentEncoding(component.path);
|
|
634
|
-
}
|
|
635
|
-
}
|
|
636
|
-
if (options.reference !== "suffix" && component.scheme) {
|
|
637
|
-
uriTokens.push(component.scheme, ":");
|
|
638
|
-
}
|
|
639
|
-
const authority = recomposeAuthority(component);
|
|
640
|
-
if (authority !== void 0) {
|
|
641
|
-
if (options.reference !== "suffix") {
|
|
642
|
-
uriTokens.push("//");
|
|
643
|
-
}
|
|
644
|
-
uriTokens.push(authority);
|
|
645
|
-
if (component.path && component.path[0] !== "/") {
|
|
646
|
-
uriTokens.push("/");
|
|
647
|
-
}
|
|
648
|
-
}
|
|
649
|
-
if (component.path !== void 0) {
|
|
650
|
-
let s = component.path;
|
|
651
|
-
if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {
|
|
652
|
-
s = removeDotSegments(s);
|
|
653
|
-
}
|
|
654
|
-
if (authority === void 0 && s[0] === "/" && s[1] === "/") {
|
|
655
|
-
s = "/%2F" + s.slice(2);
|
|
656
|
-
}
|
|
657
|
-
uriTokens.push(s);
|
|
658
|
-
}
|
|
659
|
-
if (component.query !== void 0) {
|
|
660
|
-
uriTokens.push("?", component.query);
|
|
661
|
-
}
|
|
662
|
-
if (component.fragment !== void 0) {
|
|
663
|
-
uriTokens.push("#", component.fragment);
|
|
664
|
-
}
|
|
665
|
-
return uriTokens.join("");
|
|
666
|
-
}
|
|
667
|
-
const URI_PARSE = /^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;
|
|
668
|
-
function getParseError(parsed, matches) {
|
|
669
|
-
if (matches[2] !== void 0 && parsed.path && parsed.path[0] !== "/") {
|
|
670
|
-
return 'URI path must start with "/" when authority is present.';
|
|
671
|
-
}
|
|
672
|
-
if (typeof parsed.port === "number" && (parsed.port < 0 || parsed.port > 65535)) {
|
|
673
|
-
return "URI port is malformed.";
|
|
674
|
-
}
|
|
675
|
-
return void 0;
|
|
676
|
-
}
|
|
677
|
-
function parseWithStatus(uri, opts) {
|
|
678
|
-
const options = Object.assign({}, opts);
|
|
679
|
-
const parsed = {
|
|
680
|
-
scheme: void 0,
|
|
681
|
-
userinfo: void 0,
|
|
682
|
-
host: "",
|
|
683
|
-
port: void 0,
|
|
684
|
-
path: "",
|
|
685
|
-
query: void 0,
|
|
686
|
-
fragment: void 0
|
|
687
|
-
};
|
|
688
|
-
let malformedAuthorityOrPort = false;
|
|
689
|
-
let isIP = false;
|
|
690
|
-
if (options.reference === "suffix") {
|
|
691
|
-
if (options.scheme) {
|
|
692
|
-
uri = options.scheme + ":" + uri;
|
|
693
|
-
} else {
|
|
694
|
-
uri = "//" + uri;
|
|
695
|
-
}
|
|
696
|
-
}
|
|
697
|
-
const matches = uri.match(URI_PARSE);
|
|
698
|
-
if (matches) {
|
|
699
|
-
parsed.scheme = matches[1];
|
|
700
|
-
parsed.userinfo = matches[3];
|
|
701
|
-
parsed.host = matches[4];
|
|
702
|
-
parsed.port = parseInt(matches[5], 10);
|
|
703
|
-
parsed.path = matches[6] || "";
|
|
704
|
-
parsed.query = matches[7];
|
|
705
|
-
parsed.fragment = matches[8];
|
|
706
|
-
if (isNaN(parsed.port)) {
|
|
707
|
-
parsed.port = matches[5];
|
|
708
|
-
}
|
|
709
|
-
const parseError = getParseError(parsed, matches);
|
|
710
|
-
if (parseError !== void 0) {
|
|
711
|
-
parsed.error = parsed.error || parseError;
|
|
712
|
-
malformedAuthorityOrPort = true;
|
|
713
|
-
}
|
|
714
|
-
if (parsed.host) {
|
|
715
|
-
const ipv4result = isIPv4(parsed.host);
|
|
716
|
-
if (ipv4result === false) {
|
|
717
|
-
const ipv6result = normalizeIPv6(parsed.host);
|
|
718
|
-
parsed.host = ipv6result.host.toLowerCase();
|
|
719
|
-
isIP = ipv6result.isIPV6;
|
|
720
|
-
} else {
|
|
721
|
-
isIP = true;
|
|
722
|
-
}
|
|
723
|
-
}
|
|
724
|
-
if (parsed.scheme === void 0 && parsed.userinfo === void 0 && parsed.host === void 0 && parsed.port === void 0 && parsed.query === void 0 && !parsed.path) {
|
|
725
|
-
parsed.reference = "same-document";
|
|
726
|
-
} else if (parsed.scheme === void 0) {
|
|
727
|
-
parsed.reference = "relative";
|
|
728
|
-
} else if (parsed.fragment === void 0) {
|
|
729
|
-
parsed.reference = "absolute";
|
|
730
|
-
} else {
|
|
731
|
-
parsed.reference = "uri";
|
|
732
|
-
}
|
|
733
|
-
if (options.reference && options.reference !== "suffix" && options.reference !== parsed.reference) {
|
|
734
|
-
parsed.error = parsed.error || "URI is not a " + options.reference + " reference.";
|
|
735
|
-
}
|
|
736
|
-
const schemeHandler = getSchemeHandler(options.scheme || parsed.scheme);
|
|
737
|
-
if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {
|
|
738
|
-
if (parsed.host && (options.domainHost || schemeHandler && schemeHandler.domainHost) && isIP === false && nonSimpleDomain(parsed.host)) {
|
|
739
|
-
try {
|
|
740
|
-
parsed.host = URL.domainToASCII(parsed.host.toLowerCase());
|
|
741
|
-
} catch (e) {
|
|
742
|
-
parsed.error = parsed.error || "Host's domain name can not be converted to ASCII: " + e;
|
|
743
|
-
}
|
|
744
|
-
}
|
|
745
|
-
}
|
|
746
|
-
if (!schemeHandler || schemeHandler && !schemeHandler.skipNormalize) {
|
|
747
|
-
if (uri.indexOf("%") !== -1) {
|
|
748
|
-
if (parsed.scheme !== void 0) {
|
|
749
|
-
parsed.scheme = unescape(parsed.scheme);
|
|
750
|
-
}
|
|
751
|
-
if (parsed.host !== void 0) {
|
|
752
|
-
parsed.host = reescapeHostDelimiters(unescape(parsed.host), isIP);
|
|
753
|
-
}
|
|
754
|
-
}
|
|
755
|
-
if (parsed.path) {
|
|
756
|
-
parsed.path = normalizePathEncoding(parsed.path);
|
|
757
|
-
}
|
|
758
|
-
if (parsed.fragment) {
|
|
759
|
-
try {
|
|
760
|
-
parsed.fragment = encodeURI(decodeURIComponent(parsed.fragment));
|
|
761
|
-
} catch {
|
|
762
|
-
parsed.error = parsed.error || "URI malformed";
|
|
763
|
-
}
|
|
764
|
-
}
|
|
765
|
-
}
|
|
766
|
-
if (schemeHandler && schemeHandler.parse) {
|
|
767
|
-
schemeHandler.parse(parsed, options);
|
|
768
|
-
}
|
|
769
|
-
} else {
|
|
770
|
-
parsed.error = parsed.error || "URI can not be parsed.";
|
|
771
|
-
}
|
|
772
|
-
return { parsed, malformedAuthorityOrPort };
|
|
773
|
-
}
|
|
774
|
-
function parse(uri, opts) {
|
|
775
|
-
return parseWithStatus(uri, opts).parsed;
|
|
776
|
-
}
|
|
777
|
-
function normalizeString(uri, opts) {
|
|
778
|
-
return normalizeStringWithStatus(uri, opts).normalized;
|
|
779
|
-
}
|
|
780
|
-
function normalizeStringWithStatus(uri, opts) {
|
|
781
|
-
const { parsed, malformedAuthorityOrPort } = parseWithStatus(uri, opts);
|
|
782
|
-
return {
|
|
783
|
-
normalized: malformedAuthorityOrPort ? uri : serialize(parsed, opts),
|
|
784
|
-
malformedAuthorityOrPort
|
|
785
|
-
};
|
|
786
|
-
}
|
|
787
|
-
function normalizeComparableURI(uri, opts) {
|
|
788
|
-
if (typeof uri === "string") {
|
|
789
|
-
const { normalized, malformedAuthorityOrPort } = normalizeStringWithStatus(uri, opts);
|
|
790
|
-
return malformedAuthorityOrPort ? void 0 : normalized;
|
|
791
|
-
}
|
|
792
|
-
if (typeof uri === "object") {
|
|
793
|
-
return serialize(uri, opts);
|
|
794
|
-
}
|
|
795
|
-
}
|
|
796
|
-
const fastUri$1 = {
|
|
797
|
-
SCHEMES,
|
|
798
|
-
normalize,
|
|
799
|
-
resolve,
|
|
800
|
-
resolveComponent,
|
|
801
|
-
equal,
|
|
802
|
-
serialize,
|
|
803
|
-
parse
|
|
804
|
-
};
|
|
805
|
-
fastUri.exports = fastUri$1;
|
|
806
|
-
fastUri.exports.default = fastUri$1;
|
|
807
|
-
fastUri.exports.fastUri = fastUri$1;
|
|
808
|
-
return fastUri.exports;
|
|
809
|
-
}
|
|
810
|
-
export {
|
|
811
|
-
requireFastUri as r
|
|
812
|
-
};
|
|
1
|
+
var $={exports:{}},L,T;function M(){if(T)return L;T=1;const q=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),h=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),g=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),x=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),y=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function m(e){let t="",s=0,r=0;for(r=0;r<e.length;r++)if(s=e[r].charCodeAt(0),s!==48){if(!(s>=48&&s<=57||s>=65&&s<=70||s>=97&&s<=102))return"";t+=e[r];break}for(r+=1;r<e.length;r++){if(s=e[r].charCodeAt(0),!(s>=48&&s<=57||s>=65&&s<=70||s>=97&&s<=102))return"";t+=e[r]}return t}const P=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function U(e){return e.length=0,!0}function E(e,t,s){if(e.length){const r=m(e);if(r!=="")t.push(r);else return s.error=!0,!1;e.length=0}return!0}function R(e){let t=0;const s={error:!1,address:"",zone:""},r=[],i=[];let f=!1,n=!1,u=E;for(let c=0;c<e.length;c++){const o=e[c];if(!(o==="["||o==="]"))if(o===":"){if(f===!0&&(n=!0),!u(i,r,s))break;if(++t>7){s.error=!0;break}c>0&&e[c-1]===":"&&(f=!0),r.push(":");continue}else if(o==="%"){if(!u(i,r,s))break;u=U}else{i.push(o);continue}}return i.length&&(u===U?s.zone=i.join(""):n?r.push(i.join("")):r.push(m(i))),s.address=r.join(""),s}function z(e){if(k(e,":")<2)return{host:e,isIPV6:!1};const t=R(e);if(t.error)return{host:e,isIPV6:!1};{let s=t.address,r=t.address;return t.zone&&(s+="%"+t.zone,r+="%25"+t.zone),{host:s,isIPV6:!0,escapedHost:r}}}function k(e,t){let s=0;for(let r=0;r<e.length;r++)e[r]===t&&s++;return s}function b(e){let t=e;const s=[];let r=-1,i=0;for(;i=t.length;){if(i===1){if(t===".")break;if(t==="/"){s.push("/");break}else{s.push(t);break}}else if(i===2){if(t[0]==="."){if(t[1]===".")break;if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"&&(t[1]==="."||t[1]==="/")){s.push("/");break}}else if(i===3&&t==="/.."){s.length!==0&&s.pop(),s.push("/");break}if(t[0]==="."){if(t[1]==="."){if(t[2]==="/"){t=t.slice(3);continue}}else if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"&&t[1]==="."){if(t[2]==="/"){t=t.slice(2);continue}else if(t[2]==="."&&t[3]==="/"){t=t.slice(3),s.length!==0&&s.pop();continue}}if((r=t.indexOf("/",1))===-1){s.push(t);break}else s.push(t.slice(0,r)),t=t.slice(r)}return s.join("")}const S={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},O=/[@/?#:]/g,a=/[@/?#]/g;function H(e,t){const s=t?a:O;return s.lastIndex=0,e.replace(s,r=>S[r])}function A(e,t=!1){if(e.indexOf("%")===-1)return e;let s="";for(let r=0;r<e.length;r++){if(e[r]==="%"&&r+2<e.length){const i=e.slice(r+1,r+3);if(g(i)){const f=i.toUpperCase(),n=String.fromCharCode(parseInt(f,16));t&&x(n)?s+=n:s+="%"+f,r+=2;continue}}s+=e[r]}return s}function N(e){let t="";for(let s=0;s<e.length;s++){if(e[s]==="%"&&s+2<e.length){const r=e.slice(s+1,s+3);if(g(r)){const i=r.toUpperCase(),f=String.fromCharCode(parseInt(i,16));f!=="."&&x(f)?t+=f:t+="%"+i,s+=2;continue}}y(e[s])?t+=e[s]:t+=escape(e[s])}return t}function d(e){let t="";for(let s=0;s<e.length;s++){if(e[s]==="%"&&s+2<e.length){const r=e.slice(s+1,s+3);if(g(r)){t+="%"+r.toUpperCase(),s+=2;continue}}t+=escape(e[s])}return t}function I(e){const t=[];if(e.userinfo!==void 0&&(t.push(e.userinfo),t.push("@")),e.host!==void 0){let s=unescape(e.host);if(!h(s)){const r=z(s);r.isIPV6===!0?s=`[${r.escapedHost}]`:s=H(s,!1)}t.push(s)}return(typeof e.port=="number"||typeof e.port=="string")&&(t.push(":"),t.push(String(e.port))),t.length?t.join(""):void 0}return L={nonSimpleDomain:P,recomposeAuthority:I,reescapeHostDelimiters:H,normalizePercentEncoding:A,normalizePathEncoding:N,escapePreservingEscapes:d,removeDotSegments:b,isIPv4:h,isUUID:q,normalizeIPv6:z,stringArrayToHexStripped:m},L}var j,V;function W(){if(V)return j;V=1;const{isUUID:q}=M(),h=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,g=["http","https","ws","wss","urn","urn:uuid"];function x(e){return g.indexOf(e)!==-1}function y(e){return e.secure===!0?!0:e.secure===!1?!1:e.scheme?e.scheme.length===3&&(e.scheme[0]==="w"||e.scheme[0]==="W")&&(e.scheme[1]==="s"||e.scheme[1]==="S")&&(e.scheme[2]==="s"||e.scheme[2]==="S"):!1}function m(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function P(e){const t=String(e.scheme).toLowerCase()==="https";return(e.port===(t?443:80)||e.port==="")&&(e.port=void 0),e.path||(e.path="/"),e}function U(e){return e.secure=y(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function E(e){if((e.port===(y(e)?443:80)||e.port==="")&&(e.port=void 0),typeof e.secure=="boolean"&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){const[t,s]=e.resourceName.split("?");e.path=t&&t!=="/"?t:void 0,e.query=s,e.resourceName=void 0}return e.fragment=void 0,e}function R(e,t){if(!e.path)return e.error="URN can not be parsed",e;const s=e.path.match(h);if(s){const r=t.scheme||e.scheme||"urn";e.nid=s[1].toLowerCase(),e.nss=s[2];const i=`${r}:${t.nid||e.nid}`,f=I(i);e.path=void 0,f&&(e=f.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e}function z(e,t){if(e.nid===void 0)throw new Error("URN without nid cannot be serialized");const s=t.scheme||e.scheme||"urn",r=e.nid.toLowerCase(),i=`${s}:${t.nid||r}`,f=I(i);f&&(e=f.serialize(e,t));const n=e,u=e.nss;return n.path=`${r||t.nid}:${u}`,t.skipEscape=!0,n}function k(e,t){const s=e;return s.uuid=s.nss,s.nss=void 0,!t.tolerant&&(!s.uuid||!q(s.uuid))&&(s.error=s.error||"UUID is not valid."),s}function b(e){const t=e;return t.nss=(e.uuid||"").toLowerCase(),t}const S={scheme:"http",domainHost:!0,parse:m,serialize:P},O={scheme:"https",domainHost:S.domainHost,parse:m,serialize:P},a={scheme:"ws",domainHost:!0,parse:U,serialize:E},H={scheme:"wss",domainHost:a.domainHost,parse:a.parse,serialize:a.serialize},d={http:S,https:O,ws:a,wss:H,urn:{scheme:"urn",parse:R,serialize:z,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:k,serialize:b,skipNormalize:!0}};Object.setPrototypeOf(d,null);function I(e){return e&&(d[e]||d[e.toLowerCase()])||void 0}return j={wsIsSecure:y,SCHEMES:d,isValidSchemeName:x,getSchemeHandler:I},j}var F;function v(){if(F)return $.exports;F=1;const{normalizeIPv6:q,removeDotSegments:h,recomposeAuthority:g,normalizePercentEncoding:x,normalizePathEncoding:y,escapePreservingEscapes:m,reescapeHostDelimiters:P,isIPv4:U,nonSimpleDomain:E}=M(),{SCHEMES:R,getSchemeHandler:z}=W();function k(r,i){return typeof r=="string"?r=I(r,i):typeof r=="object"&&(r=d(a(r,i),i)),r}function b(r,i,f){const n=f?Object.assign({scheme:"null"},f):{scheme:"null"},u=S(d(r,n),d(i,n),n,!0);return n.skipEscape=!0,a(u,n)}function S(r,i,f,n){const u={};return n||(r=d(a(r,f),f),i=d(a(i,f),f)),f=f||{},!f.tolerant&&i.scheme?(u.scheme=i.scheme,u.userinfo=i.userinfo,u.host=i.host,u.port=i.port,u.path=h(i.path||""),u.query=i.query):(i.userinfo!==void 0||i.host!==void 0||i.port!==void 0?(u.userinfo=i.userinfo,u.host=i.host,u.port=i.port,u.path=h(i.path||""),u.query=i.query):(i.path?(i.path[0]==="/"?u.path=h(i.path):((r.userinfo!==void 0||r.host!==void 0||r.port!==void 0)&&!r.path?u.path="/"+i.path:r.path?u.path=r.path.slice(0,r.path.lastIndexOf("/")+1)+i.path:u.path=i.path,u.path=h(u.path)),u.query=i.query):(u.path=r.path,i.query!==void 0?u.query=i.query:u.query=r.query),u.userinfo=r.userinfo,u.host=r.host,u.port=r.port),u.scheme=r.scheme),u.fragment=i.fragment,u}function O(r,i,f){const n=t(r,f),u=t(i,f);return n!==void 0&&u!==void 0&&n.toLowerCase()===u.toLowerCase()}function a(r,i){const f={host:r.host,scheme:r.scheme,userinfo:r.userinfo,port:r.port,path:r.path,query:r.query,nid:r.nid,nss:r.nss,uuid:r.uuid,fragment:r.fragment,reference:r.reference,resourceName:r.resourceName,secure:r.secure,error:""},n=Object.assign({},i),u=[],c=z(n.scheme||f.scheme);c&&c.serialize&&c.serialize(f,n),f.path!==void 0&&(n.skipEscape?f.path=x(f.path):(f.path=m(f.path),f.scheme!==void 0&&(f.path=f.path.split("%3A").join(":")))),n.reference!=="suffix"&&f.scheme&&u.push(f.scheme,":");const o=g(f);if(o!==void 0&&(n.reference!=="suffix"&&u.push("//"),u.push(o),f.path&&f.path[0]!=="/"&&u.push("/")),f.path!==void 0){let l=f.path;!n.absolutePath&&(!c||!c.absolutePath)&&(l=h(l)),o===void 0&&l[0]==="/"&&l[1]==="/"&&(l="/%2F"+l.slice(2)),u.push(l)}return f.query!==void 0&&u.push("?",f.query),f.fragment!==void 0&&u.push("#",f.fragment),u.join("")}const H=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function A(r,i){if(i[2]!==void 0&&r.path&&r.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof r.port=="number"&&(r.port<0||r.port>65535))return"URI port is malformed."}function N(r,i){const f=Object.assign({},i),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let u=!1,c=!1;f.reference==="suffix"&&(f.scheme?r=f.scheme+":"+r:r="//"+r);const o=r.match(H);if(o){n.scheme=o[1],n.userinfo=o[3],n.host=o[4],n.port=parseInt(o[5],10),n.path=o[6]||"",n.query=o[7],n.fragment=o[8],isNaN(n.port)&&(n.port=o[5]);const l=A(n,o);if(l!==void 0&&(n.error=n.error||l,u=!0),n.host)if(U(n.host)===!1){const _=q(n.host);n.host=_.host.toLowerCase(),c=_.isIPV6}else c=!0;n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",f.reference&&f.reference!=="suffix"&&f.reference!==n.reference&&(n.error=n.error||"URI is not a "+f.reference+" reference.");const p=z(f.scheme||n.scheme);if(!f.unicodeSupport&&(!p||!p.unicodeSupport)&&n.host&&(f.domainHost||p&&p.domainHost)&&c===!1&&E(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(D){n.error=n.error||"Host's domain name can not be converted to ASCII: "+D}if((!p||p&&!p.skipNormalize)&&(r.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=P(unescape(n.host),c))),n.path&&(n.path=y(n.path)),n.fragment))try{n.fragment=encodeURI(decodeURIComponent(n.fragment))}catch{n.error=n.error||"URI malformed"}p&&p.parse&&p.parse(n,f)}else n.error=n.error||"URI can not be parsed.";return{parsed:n,malformedAuthorityOrPort:u}}function d(r,i){return N(r,i).parsed}function I(r,i){return e(r,i).normalized}function e(r,i){const{parsed:f,malformedAuthorityOrPort:n}=N(r,i);return{normalized:n?r:a(f,i),malformedAuthorityOrPort:n}}function t(r,i){if(typeof r=="string"){const{normalized:f,malformedAuthorityOrPort:n}=e(r,i);return n?void 0:f}if(typeof r=="object")return a(r,i)}const s={SCHEMES:R,normalize:k,resolve:b,resolveComponent:S,equal:O,serialize:a,parse:d};return $.exports=s,$.exports.default=s,$.exports.fastUri=s,$.exports}export{v as r};
|