@rainte/ant 0.0.56 → 0.0.58
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/dist/index.js +155 -11
- package/dist/index.umd.cjs +1 -80
- package/dist/types/{src/components → components}/Editor/index.d.ts +3 -3
- package/dist/types/components/Form/index.d.ts +11 -0
- package/dist/types/{src/components → components}/Provider/index.d.ts +1 -1
- package/dist/types/components/Table/index.d.ts +4 -0
- package/dist/types/{src/components → components}/Upload/index.d.ts +2 -2
- package/dist/types/lib.d.ts +12 -0
- package/dist/types/views/form/index.d.ts +1 -0
- package/dist/types/views/layout/blank/index.d.ts +1 -0
- package/dist/types/views/layout/menu/index.d.ts +2 -0
- package/dist/types/views/table/index.d.ts +1 -0
- package/package.json +27 -34
- package/dist/browser-ponyfill-B_NmYAlA.js +0 -366
- package/dist/index-Bpi8Scy9.js +0 -10591
- package/dist/index.css +0 -7
- package/dist/types/lib/index.d.ts +0 -14
- package/dist/types/src/components/Form/index.d.ts +0 -11
- package/dist/types/src/components/Menu/index.d.ts +0 -3
- package/dist/types/src/components/Table/index.d.ts +0 -4
- package/dist/types/src/views/form/index.d.ts +0 -1
- package/dist/types/src/views/layout/blank/index.d.ts +0 -1
- package/dist/types/src/views/layout/menu/index.d.ts +0 -1
- package/dist/types/src/views/table/index.d.ts +0 -1
- package/dist/types/vite.config.d.ts +0 -2
- /package/dist/types/{src/main.d.ts → main.d.ts} +0 -0
- /package/dist/types/{src/router → router}/index.d.ts +0 -0
- /package/dist/types/{src/utils → utils}/dialog.d.ts +0 -0
- /package/dist/types/{src/utils → utils}/i18n.d.ts +0 -0
- /package/dist/types/{src/utils → utils}/misc.d.ts +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { CSSProperties } from 'react';
|
|
2
|
-
import { QuillOptions } from 'quill';
|
|
1
|
+
import { type CSSProperties } from 'react';
|
|
2
|
+
import { type QuillOptions } from 'quill';
|
|
3
3
|
import 'quill/dist/quill.snow.css';
|
|
4
4
|
export type EditorProps = QuillOptions & {
|
|
5
5
|
value?: any;
|
|
6
6
|
onChange?: FunctionProps;
|
|
7
7
|
style?: CSSProperties;
|
|
8
8
|
};
|
|
9
|
-
export default function Editor(props: EditorProps): import("react
|
|
9
|
+
export default function Editor(props: EditorProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type ComponentProps } from 'react';
|
|
2
|
+
import { type ValueTypeProps } from '@/components/Provider';
|
|
3
|
+
import { BetaSchemaForm, type ProFormInstance } from '@ant-design/pro-components';
|
|
4
|
+
export type FormProps<T = any, ValueType = ValueTypeProps> = ComponentProps<typeof BetaSchemaForm<T, ValueType>> & {
|
|
5
|
+
form?: ProFormInstance;
|
|
6
|
+
};
|
|
7
|
+
export declare const useForm: () => import("antd").FormInstance<any>;
|
|
8
|
+
declare const Form: React.FC<FormProps> & {
|
|
9
|
+
useForm: () => ProFormInstance;
|
|
10
|
+
};
|
|
11
|
+
export default Form;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export type ValueTypeProps = 'text' | 'upload' | 'editor';
|
|
2
|
-
export default function Provider({ children }: ProviderProps): import("react
|
|
2
|
+
export default function Provider({ children }: ProviderProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type ValueTypeProps } from '@/components/Provider';
|
|
2
|
+
import { type ProTableProps } from '@ant-design/pro-components';
|
|
3
|
+
export type TableProps<T = any, U = ObjectProps, ValueType = ValueTypeProps> = ProTableProps<T, U, ValueType>;
|
|
4
|
+
export default function Table(props: TableProps): import("react").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { UploadProps as AntUploadProps } from 'antd';
|
|
1
|
+
import { type UploadProps as AntUploadProps } from 'antd';
|
|
2
2
|
export type UploadProps = AntUploadProps & {
|
|
3
3
|
value?: any;
|
|
4
4
|
onChange?: FunctionProps;
|
|
5
5
|
};
|
|
6
6
|
export declare const files: (e: any) => any;
|
|
7
|
-
export default function Upload(props: UploadProps): import("react
|
|
7
|
+
export default function Upload(props: UploadProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { default as Editor } from './components/Editor';
|
|
2
|
+
export type { EditorProps } from './components/Editor';
|
|
3
|
+
export { default as Form } from './components/Form';
|
|
4
|
+
export type { FormProps } from './components/Form';
|
|
5
|
+
export { default as Provider } from './components/Provider';
|
|
6
|
+
export { default as Table } from './components/Table';
|
|
7
|
+
export type { TableProps } from './components/Table';
|
|
8
|
+
export { default as Upload } from './components/Upload';
|
|
9
|
+
export type { UploadProps } from './components/Upload';
|
|
10
|
+
export * as dialog from './utils/dialog';
|
|
11
|
+
export * as i18n from './utils/i18n';
|
|
12
|
+
export * as misc from './utils/misc';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function App(): import("react").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function App(): import("react").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function App(): import("react").JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rainte/ant",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.58",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -10,50 +10,49 @@
|
|
|
10
10
|
],
|
|
11
11
|
"main": "./dist/index.umd.cjs",
|
|
12
12
|
"module": "./dist/index.js",
|
|
13
|
-
"types": "./dist/types/lib
|
|
13
|
+
"types": "./dist/types/lib.d.ts",
|
|
14
14
|
"exports": {
|
|
15
15
|
".": {
|
|
16
|
-
"types": "./dist/types/lib
|
|
16
|
+
"types": "./dist/types/lib.d.ts",
|
|
17
17
|
"import": "./dist/index.js",
|
|
18
18
|
"require": "./dist/index.umd.cjs"
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
21
|
"scripts": {
|
|
22
22
|
"dev": "vite",
|
|
23
|
-
"build": "vite build && tsc",
|
|
23
|
+
"build": "vite build && tsc -b",
|
|
24
|
+
"lint": "oxlint",
|
|
24
25
|
"preview": "vite preview",
|
|
25
|
-
"
|
|
26
|
+
"upgrade": "pnpm up -L --registry=https://registry.npmjs.org",
|
|
26
27
|
"commit": "git add -A && git commit -m commit && git push || git push",
|
|
27
28
|
"release": "npm publish --registry=https://registry.npmjs.org",
|
|
28
29
|
"prepublishOnly": "npm run build && npm run commit && npm version patch",
|
|
29
|
-
"postpublish": "git push"
|
|
30
|
+
"postpublish": "git push",
|
|
31
|
+
"test": "vitest"
|
|
30
32
|
},
|
|
31
33
|
"dependencies": {
|
|
32
|
-
"@ant-design/pro-components": "^
|
|
33
|
-
"@rainte/js": "^0.0.
|
|
34
|
-
"antd": "^
|
|
35
|
-
"i18next": "^
|
|
36
|
-
"i18next-browser-languagedetector": "^8.0
|
|
37
|
-
"i18next-http-backend": "^
|
|
34
|
+
"@ant-design/pro-components": "^3.1.15-9",
|
|
35
|
+
"@rainte/js": "^0.0.51",
|
|
36
|
+
"antd": "^6.6.8",
|
|
37
|
+
"i18next": "^26.7.1",
|
|
38
|
+
"i18next-browser-languagedetector": "^8.3.0",
|
|
39
|
+
"i18next-http-backend": "^4.0.9",
|
|
38
40
|
"quill": "^2.0.3",
|
|
39
|
-
"react": "19.1
|
|
40
|
-
"react-dom": "19.1
|
|
41
|
-
"react-i18next": "^
|
|
42
|
-
"react-icons": "^5.
|
|
43
|
-
"react-router-dom": "^7.
|
|
41
|
+
"react": "^19.3.1",
|
|
42
|
+
"react-dom": "^19.3.1",
|
|
43
|
+
"react-i18next": "^17.1.11",
|
|
44
|
+
"react-icons": "^5.7.0",
|
|
45
|
+
"react-router-dom": "^7.18.5"
|
|
44
46
|
},
|
|
45
47
|
"devDependencies": {
|
|
46
|
-
"@types/node": "^
|
|
47
|
-
"@types/react": "^19.0
|
|
48
|
-
"@types/react-dom": "^19.0
|
|
49
|
-
"@
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"eslint-plugin-react-refresh": "^0.4.19",
|
|
55
|
-
"typescript": "^5.8.2",
|
|
56
|
-
"vite": "^6.2.3"
|
|
48
|
+
"@types/node": "^26.6.6",
|
|
49
|
+
"@types/react": "^19.3.0",
|
|
50
|
+
"@types/react-dom": "^19.3.0",
|
|
51
|
+
"@vitejs/plugin-react": "^6.2.1",
|
|
52
|
+
"happy-dom": "^21.0.4",
|
|
53
|
+
"oxlint": "^1.90.0",
|
|
54
|
+
"typescript": "^7.0.2",
|
|
55
|
+
"vite": "^8.3.5"
|
|
57
56
|
},
|
|
58
57
|
"peerDependencies": {
|
|
59
58
|
"@ant-design/pro-components": "*",
|
|
@@ -63,11 +62,5 @@
|
|
|
63
62
|
"react-dom": "*",
|
|
64
63
|
"react-icons": "*",
|
|
65
64
|
"react-router-dom": "*"
|
|
66
|
-
},
|
|
67
|
-
"pnpm": {
|
|
68
|
-
"overrides": {
|
|
69
|
-
"react": "18.3.1",
|
|
70
|
-
"react-dom": "18.3.1"
|
|
71
|
-
}
|
|
72
65
|
}
|
|
73
66
|
}
|
|
@@ -1,366 +0,0 @@
|
|
|
1
|
-
import { c as A, g as $ } from "./index-Bpi8Scy9.js";
|
|
2
|
-
function X(g, 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 l in y)
|
|
7
|
-
if (l !== "default" && !(l in g)) {
|
|
8
|
-
const p = Object.getOwnPropertyDescriptor(y, l);
|
|
9
|
-
p && Object.defineProperty(g, l, p.get ? p : {
|
|
10
|
-
enumerable: !0,
|
|
11
|
-
get: () => y[l]
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
return Object.freeze(Object.defineProperty(g, Symbol.toStringTag, { value: "Module" }));
|
|
17
|
-
}
|
|
18
|
-
var E = { exports: {} }, H;
|
|
19
|
-
function J() {
|
|
20
|
-
return H || (H = 1, (function(g, d) {
|
|
21
|
-
var b = typeof globalThis < "u" && globalThis || typeof self < "u" && self || typeof A < "u" && A, y = (function() {
|
|
22
|
-
function p() {
|
|
23
|
-
this.fetch = !1, this.DOMException = b.DOMException;
|
|
24
|
-
}
|
|
25
|
-
return p.prototype = b, new p();
|
|
26
|
-
})();
|
|
27
|
-
(function(p) {
|
|
28
|
-
(function(h) {
|
|
29
|
-
var a = typeof p < "u" && p || typeof self < "u" && self || // eslint-disable-next-line no-undef
|
|
30
|
-
typeof A < "u" && A || {}, u = {
|
|
31
|
-
searchParams: "URLSearchParams" in a,
|
|
32
|
-
iterable: "Symbol" in a && "iterator" in Symbol,
|
|
33
|
-
blob: "FileReader" in a && "Blob" in a && (function() {
|
|
34
|
-
try {
|
|
35
|
-
return new Blob(), !0;
|
|
36
|
-
} catch {
|
|
37
|
-
return !1;
|
|
38
|
-
}
|
|
39
|
-
})(),
|
|
40
|
-
formData: "FormData" in a,
|
|
41
|
-
arrayBuffer: "ArrayBuffer" in a
|
|
42
|
-
};
|
|
43
|
-
function F(e) {
|
|
44
|
-
return e && DataView.prototype.isPrototypeOf(e);
|
|
45
|
-
}
|
|
46
|
-
if (u.arrayBuffer)
|
|
47
|
-
var q = [
|
|
48
|
-
"[object Int8Array]",
|
|
49
|
-
"[object Uint8Array]",
|
|
50
|
-
"[object Uint8ClampedArray]",
|
|
51
|
-
"[object Int16Array]",
|
|
52
|
-
"[object Uint16Array]",
|
|
53
|
-
"[object Int32Array]",
|
|
54
|
-
"[object Uint32Array]",
|
|
55
|
-
"[object Float32Array]",
|
|
56
|
-
"[object Float64Array]"
|
|
57
|
-
], C = ArrayBuffer.isView || function(e) {
|
|
58
|
-
return e && q.indexOf(Object.prototype.toString.call(e)) > -1;
|
|
59
|
-
};
|
|
60
|
-
function v(e) {
|
|
61
|
-
if (typeof e != "string" && (e = String(e)), /[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e) || e === "")
|
|
62
|
-
throw new TypeError('Invalid character in header field name: "' + e + '"');
|
|
63
|
-
return e.toLowerCase();
|
|
64
|
-
}
|
|
65
|
-
function T(e) {
|
|
66
|
-
return typeof e != "string" && (e = String(e)), e;
|
|
67
|
-
}
|
|
68
|
-
function B(e) {
|
|
69
|
-
var t = {
|
|
70
|
-
next: function() {
|
|
71
|
-
var r = e.shift();
|
|
72
|
-
return { done: r === void 0, value: r };
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
return u.iterable && (t[Symbol.iterator] = function() {
|
|
76
|
-
return t;
|
|
77
|
-
}), t;
|
|
78
|
-
}
|
|
79
|
-
function i(e) {
|
|
80
|
-
this.map = {}, e instanceof i ? e.forEach(function(t, r) {
|
|
81
|
-
this.append(r, t);
|
|
82
|
-
}, this) : Array.isArray(e) ? e.forEach(function(t) {
|
|
83
|
-
if (t.length != 2)
|
|
84
|
-
throw new TypeError("Headers constructor: expected name/value pair to be length 2, found" + t.length);
|
|
85
|
-
this.append(t[0], t[1]);
|
|
86
|
-
}, this) : e && Object.getOwnPropertyNames(e).forEach(function(t) {
|
|
87
|
-
this.append(t, e[t]);
|
|
88
|
-
}, this);
|
|
89
|
-
}
|
|
90
|
-
i.prototype.append = function(e, t) {
|
|
91
|
-
e = v(e), t = T(t);
|
|
92
|
-
var r = this.map[e];
|
|
93
|
-
this.map[e] = r ? r + ", " + t : t;
|
|
94
|
-
}, i.prototype.delete = function(e) {
|
|
95
|
-
delete this.map[v(e)];
|
|
96
|
-
}, i.prototype.get = function(e) {
|
|
97
|
-
return e = v(e), this.has(e) ? this.map[e] : null;
|
|
98
|
-
}, i.prototype.has = function(e) {
|
|
99
|
-
return this.map.hasOwnProperty(v(e));
|
|
100
|
-
}, i.prototype.set = function(e, t) {
|
|
101
|
-
this.map[v(e)] = T(t);
|
|
102
|
-
}, i.prototype.forEach = function(e, t) {
|
|
103
|
-
for (var r in this.map)
|
|
104
|
-
this.map.hasOwnProperty(r) && e.call(t, this.map[r], r, this);
|
|
105
|
-
}, i.prototype.keys = function() {
|
|
106
|
-
var e = [];
|
|
107
|
-
return this.forEach(function(t, r) {
|
|
108
|
-
e.push(r);
|
|
109
|
-
}), B(e);
|
|
110
|
-
}, i.prototype.values = function() {
|
|
111
|
-
var e = [];
|
|
112
|
-
return this.forEach(function(t) {
|
|
113
|
-
e.push(t);
|
|
114
|
-
}), B(e);
|
|
115
|
-
}, i.prototype.entries = function() {
|
|
116
|
-
var e = [];
|
|
117
|
-
return this.forEach(function(t, r) {
|
|
118
|
-
e.push([r, t]);
|
|
119
|
-
}), B(e);
|
|
120
|
-
}, u.iterable && (i.prototype[Symbol.iterator] = i.prototype.entries);
|
|
121
|
-
function O(e) {
|
|
122
|
-
if (!e._noBody) {
|
|
123
|
-
if (e.bodyUsed)
|
|
124
|
-
return Promise.reject(new TypeError("Already read"));
|
|
125
|
-
e.bodyUsed = !0;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
function D(e) {
|
|
129
|
-
return new Promise(function(t, r) {
|
|
130
|
-
e.onload = function() {
|
|
131
|
-
t(e.result);
|
|
132
|
-
}, e.onerror = function() {
|
|
133
|
-
r(e.error);
|
|
134
|
-
};
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
function I(e) {
|
|
138
|
-
var t = new FileReader(), r = D(t);
|
|
139
|
-
return t.readAsArrayBuffer(e), r;
|
|
140
|
-
}
|
|
141
|
-
function M(e) {
|
|
142
|
-
var t = new FileReader(), r = D(t), n = /charset=([A-Za-z0-9_-]+)/.exec(e.type), s = n ? n[1] : "utf-8";
|
|
143
|
-
return t.readAsText(e, s), r;
|
|
144
|
-
}
|
|
145
|
-
function L(e) {
|
|
146
|
-
for (var t = new Uint8Array(e), r = new Array(t.length), n = 0; n < t.length; n++)
|
|
147
|
-
r[n] = String.fromCharCode(t[n]);
|
|
148
|
-
return r.join("");
|
|
149
|
-
}
|
|
150
|
-
function R(e) {
|
|
151
|
-
if (e.slice)
|
|
152
|
-
return e.slice(0);
|
|
153
|
-
var t = new Uint8Array(e.byteLength);
|
|
154
|
-
return t.set(new Uint8Array(e)), t.buffer;
|
|
155
|
-
}
|
|
156
|
-
function U() {
|
|
157
|
-
return this.bodyUsed = !1, this._initBody = function(e) {
|
|
158
|
-
this.bodyUsed = this.bodyUsed, this._bodyInit = e, e ? typeof e == "string" ? this._bodyText = e : u.blob && Blob.prototype.isPrototypeOf(e) ? this._bodyBlob = e : u.formData && FormData.prototype.isPrototypeOf(e) ? this._bodyFormData = e : u.searchParams && URLSearchParams.prototype.isPrototypeOf(e) ? this._bodyText = e.toString() : u.arrayBuffer && u.blob && F(e) ? (this._bodyArrayBuffer = R(e.buffer), this._bodyInit = new Blob([this._bodyArrayBuffer])) : u.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(e) || C(e)) ? this._bodyArrayBuffer = R(e) : this._bodyText = e = Object.prototype.toString.call(e) : (this._noBody = !0, 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) : u.searchParams && URLSearchParams.prototype.isPrototypeOf(e) && this.headers.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8"));
|
|
159
|
-
}, u.blob && (this.blob = function() {
|
|
160
|
-
var e = O(this);
|
|
161
|
-
if (e)
|
|
162
|
-
return e;
|
|
163
|
-
if (this._bodyBlob)
|
|
164
|
-
return Promise.resolve(this._bodyBlob);
|
|
165
|
-
if (this._bodyArrayBuffer)
|
|
166
|
-
return Promise.resolve(new Blob([this._bodyArrayBuffer]));
|
|
167
|
-
if (this._bodyFormData)
|
|
168
|
-
throw new Error("could not read FormData body as blob");
|
|
169
|
-
return Promise.resolve(new Blob([this._bodyText]));
|
|
170
|
-
}), this.arrayBuffer = function() {
|
|
171
|
-
if (this._bodyArrayBuffer) {
|
|
172
|
-
var e = O(this);
|
|
173
|
-
return e || (ArrayBuffer.isView(this._bodyArrayBuffer) ? Promise.resolve(
|
|
174
|
-
this._bodyArrayBuffer.buffer.slice(
|
|
175
|
-
this._bodyArrayBuffer.byteOffset,
|
|
176
|
-
this._bodyArrayBuffer.byteOffset + this._bodyArrayBuffer.byteLength
|
|
177
|
-
)
|
|
178
|
-
) : Promise.resolve(this._bodyArrayBuffer));
|
|
179
|
-
} else {
|
|
180
|
-
if (u.blob)
|
|
181
|
-
return this.blob().then(I);
|
|
182
|
-
throw new Error("could not read as ArrayBuffer");
|
|
183
|
-
}
|
|
184
|
-
}, this.text = function() {
|
|
185
|
-
var e = O(this);
|
|
186
|
-
if (e)
|
|
187
|
-
return e;
|
|
188
|
-
if (this._bodyBlob)
|
|
189
|
-
return M(this._bodyBlob);
|
|
190
|
-
if (this._bodyArrayBuffer)
|
|
191
|
-
return Promise.resolve(L(this._bodyArrayBuffer));
|
|
192
|
-
if (this._bodyFormData)
|
|
193
|
-
throw new Error("could not read FormData body as text");
|
|
194
|
-
return Promise.resolve(this._bodyText);
|
|
195
|
-
}, u.formData && (this.formData = function() {
|
|
196
|
-
return this.text().then(z);
|
|
197
|
-
}), this.json = function() {
|
|
198
|
-
return this.text().then(JSON.parse);
|
|
199
|
-
}, this;
|
|
200
|
-
}
|
|
201
|
-
var N = ["CONNECT", "DELETE", "GET", "HEAD", "OPTIONS", "PATCH", "POST", "PUT", "TRACE"];
|
|
202
|
-
function k(e) {
|
|
203
|
-
var t = e.toUpperCase();
|
|
204
|
-
return N.indexOf(t) > -1 ? t : e;
|
|
205
|
-
}
|
|
206
|
-
function w(e, t) {
|
|
207
|
-
if (!(this instanceof w))
|
|
208
|
-
throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');
|
|
209
|
-
t = t || {};
|
|
210
|
-
var r = t.body;
|
|
211
|
-
if (e instanceof w) {
|
|
212
|
-
if (e.bodyUsed)
|
|
213
|
-
throw new TypeError("Already read");
|
|
214
|
-
this.url = e.url, this.credentials = e.credentials, t.headers || (this.headers = new i(e.headers)), this.method = e.method, this.mode = e.mode, this.signal = e.signal, !r && e._bodyInit != null && (r = e._bodyInit, e.bodyUsed = !0);
|
|
215
|
-
} else
|
|
216
|
-
this.url = String(e);
|
|
217
|
-
if (this.credentials = t.credentials || this.credentials || "same-origin", (t.headers || !this.headers) && (this.headers = new i(t.headers)), this.method = k(t.method || this.method || "GET"), this.mode = t.mode || this.mode || null, this.signal = t.signal || this.signal || (function() {
|
|
218
|
-
if ("AbortController" in a) {
|
|
219
|
-
var o = new AbortController();
|
|
220
|
-
return o.signal;
|
|
221
|
-
}
|
|
222
|
-
})(), this.referrer = null, (this.method === "GET" || this.method === "HEAD") && r)
|
|
223
|
-
throw new TypeError("Body not allowed for GET or HEAD requests");
|
|
224
|
-
if (this._initBody(r), (this.method === "GET" || this.method === "HEAD") && (t.cache === "no-store" || t.cache === "no-cache")) {
|
|
225
|
-
var n = /([?&])_=[^&]*/;
|
|
226
|
-
if (n.test(this.url))
|
|
227
|
-
this.url = this.url.replace(n, "$1_=" + (/* @__PURE__ */ new Date()).getTime());
|
|
228
|
-
else {
|
|
229
|
-
var s = /\?/;
|
|
230
|
-
this.url += (s.test(this.url) ? "&" : "?") + "_=" + (/* @__PURE__ */ new Date()).getTime();
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
w.prototype.clone = function() {
|
|
235
|
-
return new w(this, { body: this._bodyInit });
|
|
236
|
-
};
|
|
237
|
-
function z(e) {
|
|
238
|
-
var t = new FormData();
|
|
239
|
-
return e.trim().split("&").forEach(function(r) {
|
|
240
|
-
if (r) {
|
|
241
|
-
var n = r.split("="), s = n.shift().replace(/\+/g, " "), o = n.join("=").replace(/\+/g, " ");
|
|
242
|
-
t.append(decodeURIComponent(s), decodeURIComponent(o));
|
|
243
|
-
}
|
|
244
|
-
}), t;
|
|
245
|
-
}
|
|
246
|
-
function G(e) {
|
|
247
|
-
var t = new i(), r = e.replace(/\r?\n[\t ]+/g, " ");
|
|
248
|
-
return r.split("\r").map(function(n) {
|
|
249
|
-
return n.indexOf(`
|
|
250
|
-
`) === 0 ? n.substr(1, n.length) : n;
|
|
251
|
-
}).forEach(function(n) {
|
|
252
|
-
var s = n.split(":"), o = s.shift().trim();
|
|
253
|
-
if (o) {
|
|
254
|
-
var _ = s.join(":").trim();
|
|
255
|
-
try {
|
|
256
|
-
t.append(o, _);
|
|
257
|
-
} catch (x) {
|
|
258
|
-
console.warn("Response " + x.message);
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
}), t;
|
|
262
|
-
}
|
|
263
|
-
U.call(w.prototype);
|
|
264
|
-
function c(e, t) {
|
|
265
|
-
if (!(this instanceof c))
|
|
266
|
-
throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');
|
|
267
|
-
if (t || (t = {}), this.type = "default", this.status = t.status === void 0 ? 200 : t.status, this.status < 200 || this.status > 599)
|
|
268
|
-
throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");
|
|
269
|
-
this.ok = this.status >= 200 && this.status < 300, this.statusText = t.statusText === void 0 ? "" : "" + t.statusText, this.headers = new i(t.headers), this.url = t.url || "", this._initBody(e);
|
|
270
|
-
}
|
|
271
|
-
U.call(c.prototype), c.prototype.clone = function() {
|
|
272
|
-
return new c(this._bodyInit, {
|
|
273
|
-
status: this.status,
|
|
274
|
-
statusText: this.statusText,
|
|
275
|
-
headers: new i(this.headers),
|
|
276
|
-
url: this.url
|
|
277
|
-
});
|
|
278
|
-
}, c.error = function() {
|
|
279
|
-
var e = new c(null, { status: 200, statusText: "" });
|
|
280
|
-
return e.ok = !1, e.status = 0, e.type = "error", e;
|
|
281
|
-
};
|
|
282
|
-
var V = [301, 302, 303, 307, 308];
|
|
283
|
-
c.redirect = function(e, t) {
|
|
284
|
-
if (V.indexOf(t) === -1)
|
|
285
|
-
throw new RangeError("Invalid status code");
|
|
286
|
-
return new c(null, { status: t, headers: { location: e } });
|
|
287
|
-
}, h.DOMException = a.DOMException;
|
|
288
|
-
try {
|
|
289
|
-
new h.DOMException();
|
|
290
|
-
} catch {
|
|
291
|
-
h.DOMException = function(t, r) {
|
|
292
|
-
this.message = t, this.name = r;
|
|
293
|
-
var n = Error(t);
|
|
294
|
-
this.stack = n.stack;
|
|
295
|
-
}, h.DOMException.prototype = Object.create(Error.prototype), h.DOMException.prototype.constructor = h.DOMException;
|
|
296
|
-
}
|
|
297
|
-
function P(e, t) {
|
|
298
|
-
return new Promise(function(r, n) {
|
|
299
|
-
var s = new w(e, t);
|
|
300
|
-
if (s.signal && s.signal.aborted)
|
|
301
|
-
return n(new h.DOMException("Aborted", "AbortError"));
|
|
302
|
-
var o = new XMLHttpRequest();
|
|
303
|
-
function _() {
|
|
304
|
-
o.abort();
|
|
305
|
-
}
|
|
306
|
-
o.onload = function() {
|
|
307
|
-
var f = {
|
|
308
|
-
statusText: o.statusText,
|
|
309
|
-
headers: G(o.getAllResponseHeaders() || "")
|
|
310
|
-
};
|
|
311
|
-
s.url.indexOf("file://") === 0 && (o.status < 200 || o.status > 599) ? f.status = 200 : f.status = o.status, f.url = "responseURL" in o ? o.responseURL : f.headers.get("X-Request-URL");
|
|
312
|
-
var m = "response" in o ? o.response : o.responseText;
|
|
313
|
-
setTimeout(function() {
|
|
314
|
-
r(new c(m, f));
|
|
315
|
-
}, 0);
|
|
316
|
-
}, o.onerror = function() {
|
|
317
|
-
setTimeout(function() {
|
|
318
|
-
n(new TypeError("Network request failed"));
|
|
319
|
-
}, 0);
|
|
320
|
-
}, o.ontimeout = function() {
|
|
321
|
-
setTimeout(function() {
|
|
322
|
-
n(new TypeError("Network request timed out"));
|
|
323
|
-
}, 0);
|
|
324
|
-
}, o.onabort = function() {
|
|
325
|
-
setTimeout(function() {
|
|
326
|
-
n(new h.DOMException("Aborted", "AbortError"));
|
|
327
|
-
}, 0);
|
|
328
|
-
};
|
|
329
|
-
function x(f) {
|
|
330
|
-
try {
|
|
331
|
-
return f === "" && a.location.href ? a.location.href : f;
|
|
332
|
-
} catch {
|
|
333
|
-
return f;
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
if (o.open(s.method, x(s.url), !0), s.credentials === "include" ? o.withCredentials = !0 : s.credentials === "omit" && (o.withCredentials = !1), "responseType" in o && (u.blob ? o.responseType = "blob" : u.arrayBuffer && (o.responseType = "arraybuffer")), t && typeof t.headers == "object" && !(t.headers instanceof i || a.Headers && t.headers instanceof a.Headers)) {
|
|
337
|
-
var j = [];
|
|
338
|
-
Object.getOwnPropertyNames(t.headers).forEach(function(f) {
|
|
339
|
-
j.push(v(f)), o.setRequestHeader(f, T(t.headers[f]));
|
|
340
|
-
}), s.headers.forEach(function(f, m) {
|
|
341
|
-
j.indexOf(m) === -1 && o.setRequestHeader(m, f);
|
|
342
|
-
});
|
|
343
|
-
} else
|
|
344
|
-
s.headers.forEach(function(f, m) {
|
|
345
|
-
o.setRequestHeader(m, f);
|
|
346
|
-
});
|
|
347
|
-
s.signal && (s.signal.addEventListener("abort", _), o.onreadystatechange = function() {
|
|
348
|
-
o.readyState === 4 && s.signal.removeEventListener("abort", _);
|
|
349
|
-
}), o.send(typeof s._bodyInit > "u" ? null : s._bodyInit);
|
|
350
|
-
});
|
|
351
|
-
}
|
|
352
|
-
return P.polyfill = !0, a.fetch || (a.fetch = P, a.Headers = i, a.Request = w, a.Response = c), h.Headers = i, h.Request = w, h.Response = c, h.fetch = P, h;
|
|
353
|
-
})({});
|
|
354
|
-
})(y), y.fetch.ponyfill = !0, delete y.fetch.polyfill;
|
|
355
|
-
var l = b.fetch ? b : y;
|
|
356
|
-
d = l.fetch, d.default = l.fetch, d.fetch = l.fetch, d.Headers = l.Headers, d.Request = l.Request, d.Response = l.Response, g.exports = d;
|
|
357
|
-
})(E, E.exports)), E.exports;
|
|
358
|
-
}
|
|
359
|
-
var S = J();
|
|
360
|
-
const Z = /* @__PURE__ */ $(S), Q = /* @__PURE__ */ X({
|
|
361
|
-
__proto__: null,
|
|
362
|
-
default: Z
|
|
363
|
-
}, [S]);
|
|
364
|
-
export {
|
|
365
|
-
Q as b
|
|
366
|
-
};
|