@uidev1116/acms-js-sdk 0.1.2 → 0.3.1
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 +256 -7
- package/dist/cjs/acms-js-sdk.cjs +3 -3
- package/dist/cjs/acms-path.cjs +4 -1
- package/dist/cjs/type-guard.cjs +1 -1
- package/dist/es/acms-js-sdk.js +53 -60
- package/dist/es/acms-path.js +2124 -4
- package/dist/es/type-guard.js +2 -3
- package/dist/index-BeSRDPIk.js +15 -0
- package/dist/index-Bm4C_vR2.cjs +1 -0
- package/dist/types/core/AcmsClient.d.ts +3 -2
- package/dist/types/core/AcmsFetchError.d.ts +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/lib/acmsPath/acmsField.d.ts +13 -0
- package/dist/types/lib/acmsPath/acmsField.test.d.ts +1 -0
- package/dist/types/lib/acmsPath/acmsPath.d.ts +2 -2
- package/dist/types/lib/acmsPath/{defaultOptions.d.ts → defaults.d.ts} +1 -0
- package/dist/types/lib/acmsPath/index.d.ts +1 -0
- package/dist/types/lib/acmsPath/parseAcmsPath.d.ts +1 -1
- package/dist/types/lib/acmsPath/types.d.ts +32 -7
- package/dist/types/lib/acmsPath/utils.d.ts +1 -0
- package/dist/types/lib/acmsPath/utils.test.d.ts +1 -0
- package/dist/types/lib/typeGuard/isAcmsFetchError.d.ts +1 -1
- package/dist/types/types/index.d.ts +1 -2
- package/dist/types/utils/index.d.ts +3 -0
- package/dist/types/utils/mergeConfig.d.ts +10 -0
- package/dist/types/utils/mergeConfig.test.d.ts +1 -0
- package/dist/types/utils/parseFormData.d.ts +7 -0
- package/dist/types/utils/unique.d.ts +1 -0
- package/package.json +28 -27
- package/dist/browser-ponyfill-EPWIFhDK.js +0 -339
- package/dist/browser-ponyfill-r3mBr4hd.cjs +0 -2
- package/dist/index-H2fSgwjT.js +0 -328
- package/dist/index-WFlkDf6U.cjs +0 -1
- package/dist/index-ZZQxXurp.js +0 -19
- package/dist/index-x-5Zn68j.cjs +0 -1
- /package/dist/{typeGuard-eqTQ9U-x.cjs → typeGuard-B-hez9oi.cjs} +0 -0
- /package/dist/{typeGuard-Jsany_41.js → typeGuard-CkfEvQcm.js} +0 -0
|
@@ -1,339 +0,0 @@
|
|
|
1
|
-
import { g as V, c as R } from "./index-H2fSgwjT.js";
|
|
2
|
-
function z(w, d) {
|
|
3
|
-
for (var b = 0; b < d.length; b++) {
|
|
4
|
-
const y = d[b];
|
|
5
|
-
if (typeof y != "string" && !Array.isArray(y)) {
|
|
6
|
-
for (const h in y)
|
|
7
|
-
if (h !== "default" && !(h in w)) {
|
|
8
|
-
const p = Object.getOwnPropertyDescriptor(y, h);
|
|
9
|
-
p && Object.defineProperty(w, h, p.get ? p : {
|
|
10
|
-
enumerable: !0,
|
|
11
|
-
get: () => y[h]
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
return Object.freeze(Object.defineProperty(w, Symbol.toStringTag, { value: "Module" }));
|
|
17
|
-
}
|
|
18
|
-
var O = { exports: {} };
|
|
19
|
-
(function(w, d) {
|
|
20
|
-
var b = typeof globalThis < "u" && globalThis || typeof self < "u" && self || typeof R < "u" && R, y = function() {
|
|
21
|
-
function p() {
|
|
22
|
-
this.fetch = !1, this.DOMException = b.DOMException;
|
|
23
|
-
}
|
|
24
|
-
return p.prototype = b, new p();
|
|
25
|
-
}();
|
|
26
|
-
(function(p) {
|
|
27
|
-
(function(u) {
|
|
28
|
-
var a = typeof p < "u" && p || typeof self < "u" && self || typeof a < "u" && a, f = {
|
|
29
|
-
searchParams: "URLSearchParams" in a,
|
|
30
|
-
iterable: "Symbol" in a && "iterator" in Symbol,
|
|
31
|
-
blob: "FileReader" in a && "Blob" in a && function() {
|
|
32
|
-
try {
|
|
33
|
-
return new Blob(), !0;
|
|
34
|
-
} catch {
|
|
35
|
-
return !1;
|
|
36
|
-
}
|
|
37
|
-
}(),
|
|
38
|
-
formData: "FormData" in a,
|
|
39
|
-
arrayBuffer: "ArrayBuffer" in a
|
|
40
|
-
};
|
|
41
|
-
function j(e) {
|
|
42
|
-
return e && DataView.prototype.isPrototypeOf(e);
|
|
43
|
-
}
|
|
44
|
-
if (f.arrayBuffer)
|
|
45
|
-
var S = [
|
|
46
|
-
"[object Int8Array]",
|
|
47
|
-
"[object Uint8Array]",
|
|
48
|
-
"[object Uint8ClampedArray]",
|
|
49
|
-
"[object Int16Array]",
|
|
50
|
-
"[object Uint16Array]",
|
|
51
|
-
"[object Int32Array]",
|
|
52
|
-
"[object Uint32Array]",
|
|
53
|
-
"[object Float32Array]",
|
|
54
|
-
"[object Float64Array]"
|
|
55
|
-
], F = ArrayBuffer.isView || function(e) {
|
|
56
|
-
return e && S.indexOf(Object.prototype.toString.call(e)) > -1;
|
|
57
|
-
};
|
|
58
|
-
function v(e) {
|
|
59
|
-
if (typeof e != "string" && (e = String(e)), /[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e) || e === "")
|
|
60
|
-
throw new TypeError('Invalid character in header field name: "' + e + '"');
|
|
61
|
-
return e.toLowerCase();
|
|
62
|
-
}
|
|
63
|
-
function A(e) {
|
|
64
|
-
return typeof e != "string" && (e = String(e)), e;
|
|
65
|
-
}
|
|
66
|
-
function E(e) {
|
|
67
|
-
var t = {
|
|
68
|
-
next: function() {
|
|
69
|
-
var r = e.shift();
|
|
70
|
-
return { done: r === void 0, value: r };
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
return f.iterable && (t[Symbol.iterator] = function() {
|
|
74
|
-
return t;
|
|
75
|
-
}), t;
|
|
76
|
-
}
|
|
77
|
-
function s(e) {
|
|
78
|
-
this.map = {}, e instanceof s ? e.forEach(function(t, r) {
|
|
79
|
-
this.append(r, t);
|
|
80
|
-
}, this) : Array.isArray(e) ? e.forEach(function(t) {
|
|
81
|
-
this.append(t[0], t[1]);
|
|
82
|
-
}, this) : e && Object.getOwnPropertyNames(e).forEach(function(t) {
|
|
83
|
-
this.append(t, e[t]);
|
|
84
|
-
}, this);
|
|
85
|
-
}
|
|
86
|
-
s.prototype.append = function(e, t) {
|
|
87
|
-
e = v(e), t = A(t);
|
|
88
|
-
var r = this.map[e];
|
|
89
|
-
this.map[e] = r ? r + ", " + t : t;
|
|
90
|
-
}, s.prototype.delete = function(e) {
|
|
91
|
-
delete this.map[v(e)];
|
|
92
|
-
}, s.prototype.get = function(e) {
|
|
93
|
-
return e = v(e), this.has(e) ? this.map[e] : null;
|
|
94
|
-
}, s.prototype.has = function(e) {
|
|
95
|
-
return this.map.hasOwnProperty(v(e));
|
|
96
|
-
}, s.prototype.set = function(e, t) {
|
|
97
|
-
this.map[v(e)] = A(t);
|
|
98
|
-
}, s.prototype.forEach = function(e, t) {
|
|
99
|
-
for (var r in this.map)
|
|
100
|
-
this.map.hasOwnProperty(r) && e.call(t, this.map[r], r, this);
|
|
101
|
-
}, s.prototype.keys = function() {
|
|
102
|
-
var e = [];
|
|
103
|
-
return this.forEach(function(t, r) {
|
|
104
|
-
e.push(r);
|
|
105
|
-
}), E(e);
|
|
106
|
-
}, s.prototype.values = function() {
|
|
107
|
-
var e = [];
|
|
108
|
-
return this.forEach(function(t) {
|
|
109
|
-
e.push(t);
|
|
110
|
-
}), E(e);
|
|
111
|
-
}, s.prototype.entries = function() {
|
|
112
|
-
var e = [];
|
|
113
|
-
return this.forEach(function(t, r) {
|
|
114
|
-
e.push([r, t]);
|
|
115
|
-
}), E(e);
|
|
116
|
-
}, f.iterable && (s.prototype[Symbol.iterator] = s.prototype.entries);
|
|
117
|
-
function T(e) {
|
|
118
|
-
if (e.bodyUsed)
|
|
119
|
-
return Promise.reject(new TypeError("Already read"));
|
|
120
|
-
e.bodyUsed = !0;
|
|
121
|
-
}
|
|
122
|
-
function P(e) {
|
|
123
|
-
return new Promise(function(t, r) {
|
|
124
|
-
e.onload = function() {
|
|
125
|
-
t(e.result);
|
|
126
|
-
}, e.onerror = function() {
|
|
127
|
-
r(e.error);
|
|
128
|
-
};
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
function I(e) {
|
|
132
|
-
var t = new FileReader(), r = P(t);
|
|
133
|
-
return t.readAsArrayBuffer(e), r;
|
|
134
|
-
}
|
|
135
|
-
function M(e) {
|
|
136
|
-
var t = new FileReader(), r = P(t);
|
|
137
|
-
return t.readAsText(e), r;
|
|
138
|
-
}
|
|
139
|
-
function H(e) {
|
|
140
|
-
for (var t = new Uint8Array(e), r = new Array(t.length), n = 0; n < t.length; n++)
|
|
141
|
-
r[n] = String.fromCharCode(t[n]);
|
|
142
|
-
return r.join("");
|
|
143
|
-
}
|
|
144
|
-
function D(e) {
|
|
145
|
-
if (e.slice)
|
|
146
|
-
return e.slice(0);
|
|
147
|
-
var t = new Uint8Array(e.byteLength);
|
|
148
|
-
return t.set(new Uint8Array(e)), t.buffer;
|
|
149
|
-
}
|
|
150
|
-
function x() {
|
|
151
|
-
return this.bodyUsed = !1, this._initBody = function(e) {
|
|
152
|
-
this.bodyUsed = this.bodyUsed, this._bodyInit = e, e ? typeof e == "string" ? this._bodyText = e : f.blob && Blob.prototype.isPrototypeOf(e) ? this._bodyBlob = e : f.formData && FormData.prototype.isPrototypeOf(e) ? this._bodyFormData = e : f.searchParams && URLSearchParams.prototype.isPrototypeOf(e) ? this._bodyText = e.toString() : f.arrayBuffer && f.blob && j(e) ? (this._bodyArrayBuffer = D(e.buffer), this._bodyInit = new Blob([this._bodyArrayBuffer])) : f.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(e) || F(e)) ? this._bodyArrayBuffer = D(e) : this._bodyText = e = Object.prototype.toString.call(e) : this._bodyText = "", this.headers.get("content-type") || (typeof e == "string" ? this.headers.set("content-type", "text/plain;charset=UTF-8") : this._bodyBlob && this._bodyBlob.type ? this.headers.set("content-type", this._bodyBlob.type) : f.searchParams && URLSearchParams.prototype.isPrototypeOf(e) && this.headers.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8"));
|
|
153
|
-
}, f.blob && (this.blob = function() {
|
|
154
|
-
var e = T(this);
|
|
155
|
-
if (e)
|
|
156
|
-
return e;
|
|
157
|
-
if (this._bodyBlob)
|
|
158
|
-
return Promise.resolve(this._bodyBlob);
|
|
159
|
-
if (this._bodyArrayBuffer)
|
|
160
|
-
return Promise.resolve(new Blob([this._bodyArrayBuffer]));
|
|
161
|
-
if (this._bodyFormData)
|
|
162
|
-
throw new Error("could not read FormData body as blob");
|
|
163
|
-
return Promise.resolve(new Blob([this._bodyText]));
|
|
164
|
-
}, this.arrayBuffer = function() {
|
|
165
|
-
if (this._bodyArrayBuffer) {
|
|
166
|
-
var e = T(this);
|
|
167
|
-
return e || (ArrayBuffer.isView(this._bodyArrayBuffer) ? Promise.resolve(
|
|
168
|
-
this._bodyArrayBuffer.buffer.slice(
|
|
169
|
-
this._bodyArrayBuffer.byteOffset,
|
|
170
|
-
this._bodyArrayBuffer.byteOffset + this._bodyArrayBuffer.byteLength
|
|
171
|
-
)
|
|
172
|
-
) : Promise.resolve(this._bodyArrayBuffer));
|
|
173
|
-
} else
|
|
174
|
-
return this.blob().then(I);
|
|
175
|
-
}), this.text = function() {
|
|
176
|
-
var e = T(this);
|
|
177
|
-
if (e)
|
|
178
|
-
return e;
|
|
179
|
-
if (this._bodyBlob)
|
|
180
|
-
return M(this._bodyBlob);
|
|
181
|
-
if (this._bodyArrayBuffer)
|
|
182
|
-
return Promise.resolve(H(this._bodyArrayBuffer));
|
|
183
|
-
if (this._bodyFormData)
|
|
184
|
-
throw new Error("could not read FormData body as text");
|
|
185
|
-
return Promise.resolve(this._bodyText);
|
|
186
|
-
}, f.formData && (this.formData = function() {
|
|
187
|
-
return this.text().then(C);
|
|
188
|
-
}), this.json = function() {
|
|
189
|
-
return this.text().then(JSON.parse);
|
|
190
|
-
}, this;
|
|
191
|
-
}
|
|
192
|
-
var q = ["DELETE", "GET", "HEAD", "OPTIONS", "POST", "PUT"];
|
|
193
|
-
function L(e) {
|
|
194
|
-
var t = e.toUpperCase();
|
|
195
|
-
return q.indexOf(t) > -1 ? t : e;
|
|
196
|
-
}
|
|
197
|
-
function m(e, t) {
|
|
198
|
-
if (!(this instanceof m))
|
|
199
|
-
throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');
|
|
200
|
-
t = t || {};
|
|
201
|
-
var r = t.body;
|
|
202
|
-
if (e instanceof m) {
|
|
203
|
-
if (e.bodyUsed)
|
|
204
|
-
throw new TypeError("Already read");
|
|
205
|
-
this.url = e.url, this.credentials = e.credentials, t.headers || (this.headers = new s(e.headers)), this.method = e.method, this.mode = e.mode, this.signal = e.signal, !r && e._bodyInit != null && (r = e._bodyInit, e.bodyUsed = !0);
|
|
206
|
-
} else
|
|
207
|
-
this.url = String(e);
|
|
208
|
-
if (this.credentials = t.credentials || this.credentials || "same-origin", (t.headers || !this.headers) && (this.headers = new s(t.headers)), this.method = L(t.method || this.method || "GET"), this.mode = t.mode || this.mode || null, this.signal = t.signal || this.signal, this.referrer = null, (this.method === "GET" || this.method === "HEAD") && r)
|
|
209
|
-
throw new TypeError("Body not allowed for GET or HEAD requests");
|
|
210
|
-
if (this._initBody(r), (this.method === "GET" || this.method === "HEAD") && (t.cache === "no-store" || t.cache === "no-cache")) {
|
|
211
|
-
var n = /([?&])_=[^&]*/;
|
|
212
|
-
if (n.test(this.url))
|
|
213
|
-
this.url = this.url.replace(n, "$1_=" + (/* @__PURE__ */ new Date()).getTime());
|
|
214
|
-
else {
|
|
215
|
-
var i = /\?/;
|
|
216
|
-
this.url += (i.test(this.url) ? "&" : "?") + "_=" + (/* @__PURE__ */ new Date()).getTime();
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
m.prototype.clone = function() {
|
|
221
|
-
return new m(this, { body: this._bodyInit });
|
|
222
|
-
};
|
|
223
|
-
function C(e) {
|
|
224
|
-
var t = new FormData();
|
|
225
|
-
return e.trim().split("&").forEach(function(r) {
|
|
226
|
-
if (r) {
|
|
227
|
-
var n = r.split("="), i = n.shift().replace(/\+/g, " "), o = n.join("=").replace(/\+/g, " ");
|
|
228
|
-
t.append(decodeURIComponent(i), decodeURIComponent(o));
|
|
229
|
-
}
|
|
230
|
-
}), t;
|
|
231
|
-
}
|
|
232
|
-
function k(e) {
|
|
233
|
-
var t = new s(), r = e.replace(/\r?\n[\t ]+/g, " ");
|
|
234
|
-
return r.split("\r").map(function(n) {
|
|
235
|
-
return n.indexOf(`
|
|
236
|
-
`) === 0 ? n.substr(1, n.length) : n;
|
|
237
|
-
}).forEach(function(n) {
|
|
238
|
-
var i = n.split(":"), o = i.shift().trim();
|
|
239
|
-
if (o) {
|
|
240
|
-
var _ = i.join(":").trim();
|
|
241
|
-
t.append(o, _);
|
|
242
|
-
}
|
|
243
|
-
}), t;
|
|
244
|
-
}
|
|
245
|
-
x.call(m.prototype);
|
|
246
|
-
function l(e, t) {
|
|
247
|
-
if (!(this instanceof l))
|
|
248
|
-
throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');
|
|
249
|
-
t || (t = {}), this.type = "default", this.status = t.status === void 0 ? 200 : t.status, this.ok = this.status >= 200 && this.status < 300, this.statusText = t.statusText === void 0 ? "" : "" + t.statusText, this.headers = new s(t.headers), this.url = t.url || "", this._initBody(e);
|
|
250
|
-
}
|
|
251
|
-
x.call(l.prototype), l.prototype.clone = function() {
|
|
252
|
-
return new l(this._bodyInit, {
|
|
253
|
-
status: this.status,
|
|
254
|
-
statusText: this.statusText,
|
|
255
|
-
headers: new s(this.headers),
|
|
256
|
-
url: this.url
|
|
257
|
-
});
|
|
258
|
-
}, l.error = function() {
|
|
259
|
-
var e = new l(null, { status: 0, statusText: "" });
|
|
260
|
-
return e.type = "error", e;
|
|
261
|
-
};
|
|
262
|
-
var N = [301, 302, 303, 307, 308];
|
|
263
|
-
l.redirect = function(e, t) {
|
|
264
|
-
if (N.indexOf(t) === -1)
|
|
265
|
-
throw new RangeError("Invalid status code");
|
|
266
|
-
return new l(null, { status: t, headers: { location: e } });
|
|
267
|
-
}, u.DOMException = a.DOMException;
|
|
268
|
-
try {
|
|
269
|
-
new u.DOMException();
|
|
270
|
-
} catch {
|
|
271
|
-
u.DOMException = function(t, r) {
|
|
272
|
-
this.message = t, this.name = r;
|
|
273
|
-
var n = Error(t);
|
|
274
|
-
this.stack = n.stack;
|
|
275
|
-
}, u.DOMException.prototype = Object.create(Error.prototype), u.DOMException.prototype.constructor = u.DOMException;
|
|
276
|
-
}
|
|
277
|
-
function B(e, t) {
|
|
278
|
-
return new Promise(function(r, n) {
|
|
279
|
-
var i = new m(e, t);
|
|
280
|
-
if (i.signal && i.signal.aborted)
|
|
281
|
-
return n(new u.DOMException("Aborted", "AbortError"));
|
|
282
|
-
var o = new XMLHttpRequest();
|
|
283
|
-
function _() {
|
|
284
|
-
o.abort();
|
|
285
|
-
}
|
|
286
|
-
o.onload = function() {
|
|
287
|
-
var c = {
|
|
288
|
-
status: o.status,
|
|
289
|
-
statusText: o.statusText,
|
|
290
|
-
headers: k(o.getAllResponseHeaders() || "")
|
|
291
|
-
};
|
|
292
|
-
c.url = "responseURL" in o ? o.responseURL : c.headers.get("X-Request-URL");
|
|
293
|
-
var g = "response" in o ? o.response : o.responseText;
|
|
294
|
-
setTimeout(function() {
|
|
295
|
-
r(new l(g, c));
|
|
296
|
-
}, 0);
|
|
297
|
-
}, o.onerror = function() {
|
|
298
|
-
setTimeout(function() {
|
|
299
|
-
n(new TypeError("Network request failed"));
|
|
300
|
-
}, 0);
|
|
301
|
-
}, o.ontimeout = function() {
|
|
302
|
-
setTimeout(function() {
|
|
303
|
-
n(new TypeError("Network request failed"));
|
|
304
|
-
}, 0);
|
|
305
|
-
}, o.onabort = function() {
|
|
306
|
-
setTimeout(function() {
|
|
307
|
-
n(new u.DOMException("Aborted", "AbortError"));
|
|
308
|
-
}, 0);
|
|
309
|
-
};
|
|
310
|
-
function G(c) {
|
|
311
|
-
try {
|
|
312
|
-
return c === "" && a.location.href ? a.location.href : c;
|
|
313
|
-
} catch {
|
|
314
|
-
return c;
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
o.open(i.method, G(i.url), !0), i.credentials === "include" ? o.withCredentials = !0 : i.credentials === "omit" && (o.withCredentials = !1), "responseType" in o && (f.blob ? o.responseType = "blob" : f.arrayBuffer && i.headers.get("Content-Type") && i.headers.get("Content-Type").indexOf("application/octet-stream") !== -1 && (o.responseType = "arraybuffer")), t && typeof t.headers == "object" && !(t.headers instanceof s) ? Object.getOwnPropertyNames(t.headers).forEach(function(c) {
|
|
318
|
-
o.setRequestHeader(c, A(t.headers[c]));
|
|
319
|
-
}) : i.headers.forEach(function(c, g) {
|
|
320
|
-
o.setRequestHeader(g, c);
|
|
321
|
-
}), i.signal && (i.signal.addEventListener("abort", _), o.onreadystatechange = function() {
|
|
322
|
-
o.readyState === 4 && i.signal.removeEventListener("abort", _);
|
|
323
|
-
}), o.send(typeof i._bodyInit > "u" ? null : i._bodyInit);
|
|
324
|
-
});
|
|
325
|
-
}
|
|
326
|
-
return B.polyfill = !0, a.fetch || (a.fetch = B, a.Headers = s, a.Request = m, a.Response = l), u.Headers = s, u.Request = m, u.Response = l, u.fetch = B, u;
|
|
327
|
-
})({});
|
|
328
|
-
})(y), y.fetch.ponyfill = !0, delete y.fetch.polyfill;
|
|
329
|
-
var h = b.fetch ? b : y;
|
|
330
|
-
d = h.fetch, d.default = h.fetch, d.fetch = h.fetch, d.Headers = h.Headers, d.Request = h.Request, d.Response = h.Response, w.exports = d;
|
|
331
|
-
})(O, O.exports);
|
|
332
|
-
var U = O.exports;
|
|
333
|
-
const $ = /* @__PURE__ */ V(U), J = /* @__PURE__ */ z({
|
|
334
|
-
__proto__: null,
|
|
335
|
-
default: $
|
|
336
|
-
}, [U]);
|
|
337
|
-
export {
|
|
338
|
-
J as b
|
|
339
|
-
};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";const O=require("./index-WFlkDf6U.cjs");function V(w,d){for(var b=0;b<d.length;b++){const y=d[b];if(typeof y!="string"&&!Array.isArray(y)){for(const h in y)if(h!=="default"&&!(h in w)){const p=Object.getOwnPropertyDescriptor(y,h);p&&Object.defineProperty(w,h,p.get?p:{enumerable:!0,get:()=>y[h]})}}}return Object.freeze(Object.defineProperty(w,Symbol.toStringTag,{value:"Module"}))}var P={exports:{}};(function(w,d){var b=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof O.commonjsGlobal<"u"&&O.commonjsGlobal,y=function(){function p(){this.fetch=!1,this.DOMException=b.DOMException}return p.prototype=b,new p}();(function(p){(function(u){var a=typeof p<"u"&&p||typeof self<"u"&&self||typeof a<"u"&&a,f={searchParams:"URLSearchParams"in a,iterable:"Symbol"in a&&"iterator"in Symbol,blob:"FileReader"in a&&"Blob"in a&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};function j(e){return e&&DataView.prototype.isPrototypeOf(e)}if(f.arrayBuffer)var S=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],F=ArrayBuffer.isView||function(e){return e&&S.indexOf(Object.prototype.toString.call(e))>-1};function v(e){if(typeof e!="string"&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||e==="")throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function A(e){return typeof e!="string"&&(e=String(e)),e}function E(e){var t={next:function(){var r=e.shift();return{done:r===void 0,value:r}}};return f.iterable&&(t[Symbol.iterator]=function(){return t}),t}function s(e){this.map={},e instanceof s?e.forEach(function(t,r){this.append(r,t)},this):Array.isArray(e)?e.forEach(function(t){this.append(t[0],t[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}s.prototype.append=function(e,t){e=v(e),t=A(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},s.prototype.delete=function(e){delete this.map[v(e)]},s.prototype.get=function(e){return e=v(e),this.has(e)?this.map[e]:null},s.prototype.has=function(e){return this.map.hasOwnProperty(v(e))},s.prototype.set=function(e,t){this.map[v(e)]=A(t)},s.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},s.prototype.keys=function(){var e=[];return this.forEach(function(t,r){e.push(r)}),E(e)},s.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),E(e)},s.prototype.entries=function(){var e=[];return this.forEach(function(t,r){e.push([r,t])}),E(e)},f.iterable&&(s.prototype[Symbol.iterator]=s.prototype.entries);function T(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function D(e){return new Promise(function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}})}function I(e){var t=new FileReader,r=D(t);return t.readAsArrayBuffer(e),r}function M(e){var t=new FileReader,r=D(t);return t.readAsText(e),r}function H(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}function x(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function R(){return this.bodyUsed=!1,this._initBody=function(e){this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?typeof e=="string"?this._bodyText=e:f.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:f.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:f.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():f.arrayBuffer&&f.blob&&j(e)?(this._bodyArrayBuffer=x(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):f.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||F(e))?this._bodyArrayBuffer=x(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||(typeof e=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):f.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},f.blob&&(this.blob=function(){var e=T(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){if(this._bodyArrayBuffer){var e=T(this);return e||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else return this.blob().then(I)}),this.text=function(){var e=T(this);if(e)return e;if(this._bodyBlob)return M(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(H(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},f.formData&&(this.formData=function(){return this.text().then(C)}),this.json=function(){return this.text().then(JSON.parse)},this}var q=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function L(e){var t=e.toUpperCase();return q.indexOf(t)>-1?t:e}function m(e,t){if(!(this instanceof m))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t=t||{};var r=t.body;if(e instanceof m){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new s(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,!r&&e._bodyInit!=null&&(r=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",(t.headers||!this.headers)&&(this.headers=new s(t.headers)),this.method=L(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&r)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(r),(this.method==="GET"||this.method==="HEAD")&&(t.cache==="no-store"||t.cache==="no-cache")){var n=/([?&])_=[^&]*/;if(n.test(this.url))this.url=this.url.replace(n,"$1_="+new Date().getTime());else{var i=/\?/;this.url+=(i.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}m.prototype.clone=function(){return new m(this,{body:this._bodyInit})};function C(e){var t=new FormData;return e.trim().split("&").forEach(function(r){if(r){var n=r.split("="),i=n.shift().replace(/\+/g," "),o=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(i),decodeURIComponent(o))}}),t}function k(e){var t=new s,r=e.replace(/\r?\n[\t ]+/g," ");return r.split("\r").map(function(n){return n.indexOf(`
|
|
2
|
-
`)===0?n.substr(1,n.length):n}).forEach(function(n){var i=n.split(":"),o=i.shift().trim();if(o){var _=i.join(":").trim();t.append(o,_)}}),t}R.call(m.prototype);function c(e,t){if(!(this instanceof c))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t||(t={}),this.type="default",this.status=t.status===void 0?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText=t.statusText===void 0?"":""+t.statusText,this.headers=new s(t.headers),this.url=t.url||"",this._initBody(e)}R.call(c.prototype),c.prototype.clone=function(){return new c(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new s(this.headers),url:this.url})},c.error=function(){var e=new c(null,{status:0,statusText:""});return e.type="error",e};var N=[301,302,303,307,308];c.redirect=function(e,t){if(N.indexOf(t)===-1)throw new RangeError("Invalid status code");return new c(null,{status:t,headers:{location:e}})},u.DOMException=a.DOMException;try{new u.DOMException}catch{u.DOMException=function(t,r){this.message=t,this.name=r;var n=Error(t);this.stack=n.stack},u.DOMException.prototype=Object.create(Error.prototype),u.DOMException.prototype.constructor=u.DOMException}function B(e,t){return new Promise(function(r,n){var i=new m(e,t);if(i.signal&&i.signal.aborted)return n(new u.DOMException("Aborted","AbortError"));var o=new XMLHttpRequest;function _(){o.abort()}o.onload=function(){var l={status:o.status,statusText:o.statusText,headers:k(o.getAllResponseHeaders()||"")};l.url="responseURL"in o?o.responseURL:l.headers.get("X-Request-URL");var g="response"in o?o.response:o.responseText;setTimeout(function(){r(new c(g,l))},0)},o.onerror=function(){setTimeout(function(){n(new TypeError("Network request failed"))},0)},o.ontimeout=function(){setTimeout(function(){n(new TypeError("Network request failed"))},0)},o.onabort=function(){setTimeout(function(){n(new u.DOMException("Aborted","AbortError"))},0)};function G(l){try{return l===""&&a.location.href?a.location.href:l}catch{return l}}o.open(i.method,G(i.url),!0),i.credentials==="include"?o.withCredentials=!0:i.credentials==="omit"&&(o.withCredentials=!1),"responseType"in o&&(f.blob?o.responseType="blob":f.arrayBuffer&&i.headers.get("Content-Type")&&i.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(o.responseType="arraybuffer")),t&&typeof t.headers=="object"&&!(t.headers instanceof s)?Object.getOwnPropertyNames(t.headers).forEach(function(l){o.setRequestHeader(l,A(t.headers[l]))}):i.headers.forEach(function(l,g){o.setRequestHeader(g,l)}),i.signal&&(i.signal.addEventListener("abort",_),o.onreadystatechange=function(){o.readyState===4&&i.signal.removeEventListener("abort",_)}),o.send(typeof i._bodyInit>"u"?null:i._bodyInit)})}return B.polyfill=!0,a.fetch||(a.fetch=B,a.Headers=s,a.Request=m,a.Response=c),u.Headers=s,u.Request=m,u.Response=c,u.fetch=B,u})({})})(y),y.fetch.ponyfill=!0,delete y.fetch.polyfill;var h=b.fetch?b:y;d=h.fetch,d.default=h.fetch,d.fetch=h.fetch,d.Headers=h.Headers,d.Request=h.Request,d.Response=h.Response,w.exports=d})(P,P.exports);var U=P.exports;const z=O.getDefaultExportFromCjs(U),$=V({__proto__:null,default:z},[U]);exports.browserPonyfill=$;
|
package/dist/index-H2fSgwjT.js
DELETED
|
@@ -1,328 +0,0 @@
|
|
|
1
|
-
import { a as w, i as h } from "./typeGuard-Jsany_41.js";
|
|
2
|
-
var Z = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
3
|
-
function M(e) {
|
|
4
|
-
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
5
|
-
}
|
|
6
|
-
var I = function(r) {
|
|
7
|
-
return P(r) && !D(r);
|
|
8
|
-
};
|
|
9
|
-
function P(e) {
|
|
10
|
-
return !!e && typeof e == "object";
|
|
11
|
-
}
|
|
12
|
-
function D(e) {
|
|
13
|
-
var r = Object.prototype.toString.call(e);
|
|
14
|
-
return r === "[object RegExp]" || r === "[object Date]" || U(e);
|
|
15
|
-
}
|
|
16
|
-
var E = typeof Symbol == "function" && Symbol.for, T = E ? Symbol.for("react.element") : 60103;
|
|
17
|
-
function U(e) {
|
|
18
|
-
return e.$$typeof === T;
|
|
19
|
-
}
|
|
20
|
-
function N(e) {
|
|
21
|
-
return Array.isArray(e) ? [] : {};
|
|
22
|
-
}
|
|
23
|
-
function $(e, r) {
|
|
24
|
-
return r.clone !== !1 && r.isMergeableObject(e) ? p(N(e), e, r) : e;
|
|
25
|
-
}
|
|
26
|
-
function _(e, r, t) {
|
|
27
|
-
return e.concat(r).map(function(a) {
|
|
28
|
-
return $(a, t);
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
function R(e, r) {
|
|
32
|
-
if (!r.customMerge)
|
|
33
|
-
return p;
|
|
34
|
-
var t = r.customMerge(e);
|
|
35
|
-
return typeof t == "function" ? t : p;
|
|
36
|
-
}
|
|
37
|
-
function F(e) {
|
|
38
|
-
return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(e).filter(function(r) {
|
|
39
|
-
return Object.propertyIsEnumerable.call(e, r);
|
|
40
|
-
}) : [];
|
|
41
|
-
}
|
|
42
|
-
function O(e) {
|
|
43
|
-
return Object.keys(e).concat(F(e));
|
|
44
|
-
}
|
|
45
|
-
function S(e, r) {
|
|
46
|
-
try {
|
|
47
|
-
return r in e;
|
|
48
|
-
} catch {
|
|
49
|
-
return !1;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
function K(e, r) {
|
|
53
|
-
return S(e, r) && !(Object.hasOwnProperty.call(e, r) && Object.propertyIsEnumerable.call(e, r));
|
|
54
|
-
}
|
|
55
|
-
function Y(e, r, t) {
|
|
56
|
-
var a = {};
|
|
57
|
-
return t.isMergeableObject(e) && O(e).forEach(function(n) {
|
|
58
|
-
a[n] = $(e[n], t);
|
|
59
|
-
}), O(r).forEach(function(n) {
|
|
60
|
-
K(e, n) || (S(e, n) && t.isMergeableObject(r[n]) ? a[n] = R(n, t)(e[n], r[n], t) : a[n] = $(r[n], t));
|
|
61
|
-
}), a;
|
|
62
|
-
}
|
|
63
|
-
function p(e, r, t) {
|
|
64
|
-
t = t || {}, t.arrayMerge = t.arrayMerge || _, t.isMergeableObject = t.isMergeableObject || I, t.cloneUnlessOtherwiseSpecified = $;
|
|
65
|
-
var a = Array.isArray(r), n = Array.isArray(e), u = a === n;
|
|
66
|
-
return u ? a ? t.arrayMerge(e, r, t) : Y(e, r, t) : $(r, t);
|
|
67
|
-
}
|
|
68
|
-
p.all = function(r, t) {
|
|
69
|
-
if (!Array.isArray(r))
|
|
70
|
-
throw new Error("first argument should be an array");
|
|
71
|
-
return r.reduce(function(a, n) {
|
|
72
|
-
return p(a, n, t);
|
|
73
|
-
}, {});
|
|
74
|
-
};
|
|
75
|
-
var C = p, L = C;
|
|
76
|
-
const v = /* @__PURE__ */ M(L);
|
|
77
|
-
function g(e) {
|
|
78
|
-
return encodeURIComponent(e).replace(
|
|
79
|
-
/[!'()*]/g,
|
|
80
|
-
(r) => `%${r.charCodeAt(0).toString(16)}`
|
|
81
|
-
);
|
|
82
|
-
}
|
|
83
|
-
function y(e) {
|
|
84
|
-
return !isNaN(Date.parse(e));
|
|
85
|
-
}
|
|
86
|
-
const A = {
|
|
87
|
-
bid: "bid",
|
|
88
|
-
cid: "cid",
|
|
89
|
-
eid: "eid",
|
|
90
|
-
uid: "uid",
|
|
91
|
-
tag: "tag",
|
|
92
|
-
field: "field",
|
|
93
|
-
span: "-",
|
|
94
|
-
page: "page",
|
|
95
|
-
order: "order",
|
|
96
|
-
limit: "limit",
|
|
97
|
-
keyword: "keyword",
|
|
98
|
-
admin: "admin",
|
|
99
|
-
tpl: "tpl",
|
|
100
|
-
api: "api"
|
|
101
|
-
};
|
|
102
|
-
function m(e) {
|
|
103
|
-
function r(s) {
|
|
104
|
-
return s < 10 ? "0" + s : s;
|
|
105
|
-
}
|
|
106
|
-
const t = e.getFullYear(), a = r(e.getMonth() + 1), n = r(e.getDate()), u = r(e.getHours()), o = r(e.getMinutes()), c = r(e.getSeconds());
|
|
107
|
-
return `${t}-${a}-${n} ${u}:${o}:${c}`;
|
|
108
|
-
}
|
|
109
|
-
const z = {
|
|
110
|
-
segments: A
|
|
111
|
-
};
|
|
112
|
-
function k(e, r = {}) {
|
|
113
|
-
const t = G(e) ? e : H(e), { segments: a } = v(z, r);
|
|
114
|
-
let n = [
|
|
115
|
-
"blog",
|
|
116
|
-
"admin",
|
|
117
|
-
"category",
|
|
118
|
-
"entry",
|
|
119
|
-
"user",
|
|
120
|
-
"tag",
|
|
121
|
-
"field",
|
|
122
|
-
"span",
|
|
123
|
-
"date",
|
|
124
|
-
"page",
|
|
125
|
-
"order",
|
|
126
|
-
"limit",
|
|
127
|
-
"keyword",
|
|
128
|
-
"tpl",
|
|
129
|
-
"api"
|
|
130
|
-
].reduce((o, c) => {
|
|
131
|
-
const s = t[c];
|
|
132
|
-
if (s == null)
|
|
133
|
-
return o;
|
|
134
|
-
if (c === "blog") {
|
|
135
|
-
const i = t[c];
|
|
136
|
-
return w(i) ? `${o}/${a.bid}/${i}` : `${o}/${i.split("/").map(g).join("/")}`;
|
|
137
|
-
}
|
|
138
|
-
if (c === "category") {
|
|
139
|
-
const i = t[c];
|
|
140
|
-
return w(i) ? `${o}/${a.cid}/${i}` : Array.isArray(i) ? `${o}/${i.map(g).join("/")}` : `${o}/${g(i)}`;
|
|
141
|
-
}
|
|
142
|
-
if (c === "entry") {
|
|
143
|
-
const i = t[c];
|
|
144
|
-
return w(i) ? `${o}/${a.eid}/${i}` : `${o}/${g(i)}`;
|
|
145
|
-
}
|
|
146
|
-
if (c === "user") {
|
|
147
|
-
const i = t[c];
|
|
148
|
-
return `${o}/${a.uid}/${i}`;
|
|
149
|
-
}
|
|
150
|
-
if (c === "field") {
|
|
151
|
-
const i = t[c];
|
|
152
|
-
return `${o}/${a.field}/${i.split("/").map(g).join("/")}`;
|
|
153
|
-
}
|
|
154
|
-
if (c === "span") {
|
|
155
|
-
const { start: i, end: l } = {
|
|
156
|
-
start: "1000-01-01 00:00:00",
|
|
157
|
-
end: "9999-12-31 23:59:59",
|
|
158
|
-
...t[c]
|
|
159
|
-
};
|
|
160
|
-
if (h(i) && !y(i))
|
|
161
|
-
throw new Error(`Invalid start date: ${i}`);
|
|
162
|
-
if (h(l) && !y(l))
|
|
163
|
-
throw new Error(`Invalid end date: ${l}`);
|
|
164
|
-
return `${o}/${g(m(new Date(i)))}/${a.span}/${g(m(new Date(l)))}`;
|
|
165
|
-
}
|
|
166
|
-
if (c === "date") {
|
|
167
|
-
if (t.span != null)
|
|
168
|
-
return o;
|
|
169
|
-
const { year: i, month: l, day: f } = t[c];
|
|
170
|
-
return [i, l, f].reduce((d, b) => b == null ? d : `${d}/${b}`, o);
|
|
171
|
-
}
|
|
172
|
-
if (c === "page") {
|
|
173
|
-
const i = t[c];
|
|
174
|
-
return i === 1 ? o : `${o}/${a.page}/${i}`;
|
|
175
|
-
}
|
|
176
|
-
if (c === "tpl") {
|
|
177
|
-
const i = t[c];
|
|
178
|
-
return `${o}/${a.tpl}/${i.split("/").map(g).join("/")}`;
|
|
179
|
-
}
|
|
180
|
-
return Array.isArray(s) ? s.length > 0 ? `${o}/${a[c]}/${s.map(g).join("/")}` : o : `${o}/${a[c]}/${g(
|
|
181
|
-
s
|
|
182
|
-
)}`;
|
|
183
|
-
}, "");
|
|
184
|
-
/\.[^/.]+$/.test(n) || (n += "/");
|
|
185
|
-
const u = new URLSearchParams(t.searchParams);
|
|
186
|
-
return u.size > 0 && (n += `?${u.toString()}`), n.startsWith("/") ? n.slice(1) : n;
|
|
187
|
-
}
|
|
188
|
-
function G(e) {
|
|
189
|
-
return "blog" in e || "category" in e || "entry" in e || "user" in e || "searchParams" in e;
|
|
190
|
-
}
|
|
191
|
-
function H(e) {
|
|
192
|
-
return {
|
|
193
|
-
blog: e.bid,
|
|
194
|
-
category: e.cid,
|
|
195
|
-
entry: e.eid,
|
|
196
|
-
user: e.uid,
|
|
197
|
-
tag: e.tag,
|
|
198
|
-
field: e.field,
|
|
199
|
-
span: e.span,
|
|
200
|
-
date: e.date,
|
|
201
|
-
page: e.page,
|
|
202
|
-
order: e.order,
|
|
203
|
-
limit: e.limit,
|
|
204
|
-
keyword: e.keyword,
|
|
205
|
-
admin: e.admin,
|
|
206
|
-
tpl: e.tpl,
|
|
207
|
-
api: e.api
|
|
208
|
-
};
|
|
209
|
-
}
|
|
210
|
-
const V = {
|
|
211
|
-
segments: A
|
|
212
|
-
};
|
|
213
|
-
function x(e, r = {}) {
|
|
214
|
-
const { segments: t } = v(
|
|
215
|
-
V,
|
|
216
|
-
r
|
|
217
|
-
), a = e.split("/").filter((s) => s), n = {}, u = [], o = Object.keys(t), c = Object.values(t);
|
|
218
|
-
for (let s = 0; s < a.length; s++) {
|
|
219
|
-
const i = a[s];
|
|
220
|
-
if (c.includes(i)) {
|
|
221
|
-
const l = o.find(
|
|
222
|
-
(f) => t[f] === i
|
|
223
|
-
);
|
|
224
|
-
if (l !== void 0) {
|
|
225
|
-
const f = a[s + 1];
|
|
226
|
-
if (f !== void 0)
|
|
227
|
-
switch (l) {
|
|
228
|
-
case "bid":
|
|
229
|
-
case "uid":
|
|
230
|
-
case "cid":
|
|
231
|
-
case "eid":
|
|
232
|
-
case "page":
|
|
233
|
-
case "limit":
|
|
234
|
-
n[l] = parseInt(f, 10), s++;
|
|
235
|
-
break;
|
|
236
|
-
case "admin":
|
|
237
|
-
case "api":
|
|
238
|
-
case "keyword":
|
|
239
|
-
n[l] = f, s++;
|
|
240
|
-
break;
|
|
241
|
-
case "tpl":
|
|
242
|
-
n.tpl = j(a, s + 1, c), s += n.tpl.split("/").length;
|
|
243
|
-
break;
|
|
244
|
-
case "field":
|
|
245
|
-
n.field = j(a, s + 1, c), s += n.field.split("/").length;
|
|
246
|
-
break;
|
|
247
|
-
case "tag":
|
|
248
|
-
n.tag = j(a, s + 1, c).split("/").map((d) => d.trim()), s += n.tag.length;
|
|
249
|
-
break;
|
|
250
|
-
case "span": {
|
|
251
|
-
const [d, b] = W(a[s - 1], f);
|
|
252
|
-
d !== void 0 && b !== void 0 && (n.span = { start: d, end: b }, u.pop(), s++);
|
|
253
|
-
break;
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
} else
|
|
258
|
-
u.push(i);
|
|
259
|
-
}
|
|
260
|
-
for (let s = 0; s < u.length; s++) {
|
|
261
|
-
const i = u[s];
|
|
262
|
-
if (q(i)) {
|
|
263
|
-
const l = i, f = u[s + 1];
|
|
264
|
-
if (f !== void 0 && B(f)) {
|
|
265
|
-
const d = u[s + 2];
|
|
266
|
-
if (d !== void 0 && J(d)) {
|
|
267
|
-
n.date = {
|
|
268
|
-
year: parseInt(l, 10),
|
|
269
|
-
month: parseInt(f, 10),
|
|
270
|
-
day: parseInt(d, 10)
|
|
271
|
-
}, u.splice(s, 3);
|
|
272
|
-
continue;
|
|
273
|
-
}
|
|
274
|
-
n.date = {
|
|
275
|
-
year: parseInt(l, 10),
|
|
276
|
-
month: parseInt(f, 10)
|
|
277
|
-
}, u.splice(s, 2);
|
|
278
|
-
continue;
|
|
279
|
-
}
|
|
280
|
-
n.date = { year: parseInt(l, 10) }, u.splice(s, 1);
|
|
281
|
-
continue;
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
return n.page === void 0 && (n.page = 1), n.span === void 0 && (n.span = Q(n)), n.unresolvedPath = u.join("/"), n;
|
|
285
|
-
}
|
|
286
|
-
function j(e, r, t) {
|
|
287
|
-
const a = [];
|
|
288
|
-
for (let n = r; n < e.length && !t.includes(e[n]); n++)
|
|
289
|
-
a.push(e[n]);
|
|
290
|
-
return a.join("/");
|
|
291
|
-
}
|
|
292
|
-
function W(e, r) {
|
|
293
|
-
const t = y(e) ? m(new Date(e)) : void 0, a = y(r) ? m(new Date(r)) : void 0;
|
|
294
|
-
return [t, a];
|
|
295
|
-
}
|
|
296
|
-
function q(e) {
|
|
297
|
-
const r = parseInt(e, 10);
|
|
298
|
-
return r >= 1e3 && r <= 9999;
|
|
299
|
-
}
|
|
300
|
-
function B(e) {
|
|
301
|
-
const r = parseInt(e, 10);
|
|
302
|
-
return r >= 1 && r <= 12;
|
|
303
|
-
}
|
|
304
|
-
function J(e) {
|
|
305
|
-
const r = parseInt(e, 10);
|
|
306
|
-
return r >= 1 && r <= 31;
|
|
307
|
-
}
|
|
308
|
-
function Q(e) {
|
|
309
|
-
let r = new Date(1e3, 0, 1, 0, 0, 0), t = new Date(9999, 11, 31, 23, 59, 59);
|
|
310
|
-
return e.date !== void 0 && (r = new Date(
|
|
311
|
-
e.date.year,
|
|
312
|
-
(e.date.month ?? 1) - 1,
|
|
313
|
-
e.date.day ?? 1
|
|
314
|
-
), t = new Date(
|
|
315
|
-
e.date.year,
|
|
316
|
-
(e.date.month ?? 12) - 1,
|
|
317
|
-
e.date.day ?? 31,
|
|
318
|
-
23,
|
|
319
|
-
59,
|
|
320
|
-
59
|
|
321
|
-
)), { start: m(r), end: m(t) };
|
|
322
|
-
}
|
|
323
|
-
export {
|
|
324
|
-
k as a,
|
|
325
|
-
Z as c,
|
|
326
|
-
M as g,
|
|
327
|
-
x as p
|
|
328
|
-
};
|