@kivii.com/bridge 1.0.0 → 1.0.2
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 +129 -95
- package/dist/config/request.d.ts +2 -25
- package/dist/config/request.d.ts.map +1 -1
- package/dist/core/Kivii.d.ts +1 -1
- package/dist/core/Kivii.d.ts.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/interfaces/IRequest.d.ts +14 -4
- package/dist/interfaces/IRequest.d.ts.map +1 -1
- package/dist/kivii.bridge.min.js +1 -1
- package/dist/kivii.bridge.min.js.map +1 -1
- package/dist/kivii.bridge.mjs +90 -7
- package/dist/kivii.bridge.mjs.map +1 -1
- package/dist/modules/AxiosRequest.d.ts +38 -0
- package/dist/modules/AxiosRequest.d.ts.map +1 -1
- package/package.json +26 -46
package/README.md
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
### pnpm
|
|
17
17
|
|
|
18
18
|
```bash
|
|
19
|
-
pnpm add "@
|
|
19
|
+
pnpm add "@Kivii.com/bridge"
|
|
20
20
|
```
|
|
21
21
|
|
|
22
22
|
## 🚀 快速开始
|
|
@@ -25,16 +25,66 @@ pnpm add "@kivii.com/bridge"
|
|
|
25
25
|
|
|
26
26
|
```html
|
|
27
27
|
<!-- 使用 UMD 格式 -->
|
|
28
|
-
<script src="https://unpkg.com/@
|
|
28
|
+
<script src="https://unpkg.com/@Kivii.com/bridge/dist/kivii.bridge.min.js"></script>
|
|
29
|
+
<script>
|
|
30
|
+
// 访问全局 Kivii 实例
|
|
31
|
+
Kivii.logger.info('应用已加载');
|
|
32
|
+
</script>
|
|
29
33
|
```
|
|
30
34
|
|
|
31
|
-
###
|
|
35
|
+
### Vue 3 插件方式
|
|
32
36
|
|
|
33
37
|
```javascript
|
|
34
|
-
import {
|
|
38
|
+
import { createApp } from 'vue';
|
|
39
|
+
import Kivii from '@Kivii.com/bridge';
|
|
40
|
+
import App from './App.vue';
|
|
35
41
|
|
|
36
|
-
|
|
37
|
-
|
|
42
|
+
const app = createApp(App);
|
|
43
|
+
|
|
44
|
+
// 安装 Kivii Bridge 插件
|
|
45
|
+
app.use(Kivii);
|
|
46
|
+
|
|
47
|
+
app.mount('#app');
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
在组件中使用:
|
|
51
|
+
|
|
52
|
+
```vue
|
|
53
|
+
<script setup>
|
|
54
|
+
import { inject } from 'vue';
|
|
55
|
+
import { getCurrentInstance } from 'vue';
|
|
56
|
+
|
|
57
|
+
// 方式 1:使用 inject
|
|
58
|
+
const Kivii = inject('Kivii');
|
|
59
|
+
|
|
60
|
+
// 方式 2:使用全局属性
|
|
61
|
+
const { proxy } = getCurrentInstance();
|
|
62
|
+
const Kivii = proxy.$Kivii;
|
|
63
|
+
|
|
64
|
+
// 发送请求
|
|
65
|
+
const fetchData = async () => {
|
|
66
|
+
const response = await Kivii.request.send({
|
|
67
|
+
url: '/api/data',
|
|
68
|
+
method: 'GET',
|
|
69
|
+
});
|
|
70
|
+
Kivii.logger.info('数据获取成功', response.data);
|
|
71
|
+
};
|
|
72
|
+
</script>
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### ES6 模块方式
|
|
76
|
+
|
|
77
|
+
```javascript
|
|
78
|
+
import { Kivii } from '@Kivii.com/bridge';
|
|
79
|
+
|
|
80
|
+
// 发送请求
|
|
81
|
+
const response = await Kivii.request.send({
|
|
82
|
+
url: '/api/users',
|
|
83
|
+
method: 'GET',
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
// 记录日志
|
|
87
|
+
Kivii.logger.info('请求成功', response.data);
|
|
38
88
|
```
|
|
39
89
|
|
|
40
90
|
## 📁 目录结构
|
|
@@ -62,137 +112,121 @@ src/
|
|
|
62
112
|
└── index.ts # 入口文件
|
|
63
113
|
```
|
|
64
114
|
|
|
65
|
-
## 📚
|
|
115
|
+
## 📚 核心功能
|
|
66
116
|
|
|
67
|
-
###
|
|
117
|
+
### 配置管理
|
|
68
118
|
|
|
69
119
|
```javascript
|
|
120
|
+
import { Kivii } from '@Kivii.com/bridge';
|
|
121
|
+
|
|
70
122
|
// 设置配置
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
123
|
+
Kivii.config.set('app.request.baseURL', 'https://api.example.com');
|
|
124
|
+
Kivii.config.set('app.request.timeout', 5000);
|
|
125
|
+
|
|
126
|
+
// 批量设置
|
|
127
|
+
Kivii.config.set('app', {
|
|
128
|
+
request: { baseURL: 'https://api.example.com', timeout: 5000 },
|
|
129
|
+
logger: { enabled: true },
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
// 获取配置
|
|
133
|
+
const baseURL = Kivii.config.get('app.request.baseURL');
|
|
74
134
|
```
|
|
75
135
|
|
|
136
|
+
**📖 详细文档:[配置管理 API](./src/docs/config.md)**
|
|
137
|
+
|
|
76
138
|
### 网络请求
|
|
77
139
|
|
|
78
140
|
```javascript
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
141
|
+
import { Kivii } from '@Kivii.com/bridge';
|
|
142
|
+
|
|
143
|
+
// GET 请求
|
|
144
|
+
const users = await Kivii.request.get('/api/users', {
|
|
83
145
|
params: { page: 1, limit: 10 },
|
|
84
146
|
});
|
|
85
147
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
url: '/api/users',
|
|
91
|
-
method: 'POST',
|
|
92
|
-
header: {
|
|
93
|
-
'Content-Type': 'application/json',
|
|
94
|
-
},
|
|
95
|
-
data: {
|
|
96
|
-
name: 'John Doe',
|
|
97
|
-
email: 'john@example.com',
|
|
98
|
-
},
|
|
148
|
+
// POST 请求
|
|
149
|
+
const newUser = await Kivii.request.post('/api/users', {
|
|
150
|
+
name: 'John Doe',
|
|
151
|
+
email: 'john@example.com',
|
|
99
152
|
});
|
|
100
153
|
```
|
|
101
154
|
|
|
155
|
+
**📖 详细文档:[Request 模块 API](./src/docs/request.md)**
|
|
156
|
+
|
|
102
157
|
### 日志记录
|
|
103
158
|
|
|
104
159
|
```javascript
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
160
|
+
import { Kivii } from '@Kivii.com/bridge';
|
|
161
|
+
|
|
162
|
+
Kivii.logger.debug('调试信息', { userId: 123 });
|
|
163
|
+
Kivii.logger.info('应用启动成功');
|
|
164
|
+
Kivii.logger.warn('警告信息');
|
|
165
|
+
Kivii.logger.error('错误信息', new Error('Something went wrong'));
|
|
110
166
|
```
|
|
111
167
|
|
|
168
|
+
**📖 详细文档:[Logger 模块 API](./src/docs/logger.md)**
|
|
169
|
+
|
|
112
170
|
### 依赖注入
|
|
113
171
|
|
|
114
172
|
```javascript
|
|
173
|
+
import { Kivii } from '@Kivii.com/bridge';
|
|
174
|
+
|
|
115
175
|
// 自定义请求模块
|
|
116
176
|
class CustomRequest {
|
|
117
177
|
async send(config) {
|
|
118
|
-
|
|
119
|
-
return await fetch(config.url, {
|
|
178
|
+
const response = await fetch(config.url, {
|
|
120
179
|
method: config.method,
|
|
121
|
-
headers: config.
|
|
180
|
+
headers: config.headers,
|
|
122
181
|
body: JSON.stringify(config.data),
|
|
123
182
|
});
|
|
183
|
+
return await response.json();
|
|
124
184
|
}
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
// 注入自定义模块
|
|
128
|
-
kivii.injection('request', new CustomRequest());
|
|
129
|
-
```
|
|
130
185
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
// 设置配置
|
|
135
|
-
kivii.config.set('database.host', 'localhost');
|
|
136
|
-
kivii.config.set('database.port', 5432);
|
|
137
|
-
kivii.config.set('database.credentials', {
|
|
138
|
-
username: 'admin',
|
|
139
|
-
password: 'secret',
|
|
140
|
-
});
|
|
141
|
-
|
|
142
|
-
// 获取配置
|
|
143
|
-
const dbHost = kivii.config.get('database.host');
|
|
144
|
-
const dbPort = kivii.config.get('database.port');
|
|
145
|
-
const credentials = kivii.config.get('database.credentials');
|
|
186
|
+
async get(url, config) {
|
|
187
|
+
return this.send({ url, method: 'GET', ...config });
|
|
188
|
+
}
|
|
146
189
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
190
|
+
async post(url, data, config) {
|
|
191
|
+
return this.send({ url, method: 'POST', data, ...config });
|
|
192
|
+
}
|
|
150
193
|
}
|
|
151
194
|
|
|
152
|
-
//
|
|
153
|
-
|
|
195
|
+
// 注入自定义模块
|
|
196
|
+
Kivii.injection('request', new CustomRequest());
|
|
154
197
|
```
|
|
155
198
|
|
|
156
|
-
##
|
|
157
|
-
|
|
158
|
-
### Kivii 类
|
|
159
|
-
|
|
160
|
-
#### 静态方法
|
|
161
|
-
|
|
162
|
-
- `getInstance()`: 获取 Kivii 单例实例
|
|
163
|
-
|
|
164
|
-
#### 实例属性
|
|
199
|
+
## 🎯 导出说明
|
|
165
200
|
|
|
166
|
-
|
|
167
|
-
- `request`: 请求模块实例
|
|
168
|
-
- `logger`: 日志模块实例
|
|
201
|
+
### 默认导出
|
|
169
202
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
#### 方法
|
|
203
|
+
```javascript
|
|
204
|
+
import KiviiBridge from '@Kivii.com/bridge';
|
|
205
|
+
// KiviiBridge = { install, Kivii }
|
|
206
|
+
// 适用于 Vue 插件方式:app.use(KiviiBridge)
|
|
207
|
+
// 或访问实例:KiviiBridge.Kivii
|
|
208
|
+
```
|
|
177
209
|
|
|
178
|
-
|
|
179
|
-
- `get(key: string)`: 获取配置值
|
|
180
|
-
- `has(key: string)`: 检查配置是否存在
|
|
181
|
-
- `delete(key: string)`: 删除配置
|
|
182
|
-
- `clear()`: 清空所有配置
|
|
183
|
-
- `getAll()`: 获取所有配置
|
|
210
|
+
### 命名导出
|
|
184
211
|
|
|
185
|
-
|
|
212
|
+
```javascript
|
|
213
|
+
import { Kivii, install } from '@Kivii.com/bridge';
|
|
214
|
+
// Kivii - Kivii 实例
|
|
215
|
+
// install - Vue 插件安装函数
|
|
216
|
+
```
|
|
186
217
|
|
|
187
|
-
|
|
218
|
+
## 📖 文档索引
|
|
188
219
|
|
|
189
|
-
|
|
220
|
+
### 核心文档
|
|
190
221
|
|
|
191
|
-
|
|
222
|
+
- [Request 模块文档](./src/docs/request.md) - HTTP 请求、拦截器、错误处理
|
|
223
|
+
- [Logger 模块文档](./src/docs/logger.md) - 日志记录、自定义日志器
|
|
224
|
+
- [配置管理文档](./src/docs/config.md) - 配置管理、环境配置、配置验证
|
|
192
225
|
|
|
193
|
-
|
|
226
|
+
### 快速链接
|
|
194
227
|
|
|
195
|
-
-
|
|
196
|
-
-
|
|
197
|
-
-
|
|
198
|
-
-
|
|
228
|
+
- [安装指南](#-安装)
|
|
229
|
+
- [快速开始](#-快速开始)
|
|
230
|
+
- [核心功能](#-核心功能)
|
|
231
|
+
- [目录结构](#-目录结构)
|
|
232
|
+
- [导出说明](#-导出说明)
|
package/dist/config/request.d.ts
CHANGED
|
@@ -1,29 +1,6 @@
|
|
|
1
|
+
import { IRequestConfig } from '../interfaces';
|
|
1
2
|
/**
|
|
2
3
|
* 默认请求配置
|
|
3
4
|
*/
|
|
4
|
-
export declare const
|
|
5
|
-
/** 基础 URL */
|
|
6
|
-
url: string;
|
|
7
|
-
/** 请求方法 */
|
|
8
|
-
method: "GET";
|
|
9
|
-
/** 请求头 */
|
|
10
|
-
header: {
|
|
11
|
-
'Content-Type': string;
|
|
12
|
-
Accept: string;
|
|
13
|
-
};
|
|
14
|
-
/** 请求参数 */
|
|
15
|
-
params: {};
|
|
16
|
-
/** 请求数据 */
|
|
17
|
-
data: {};
|
|
18
|
-
/** 超时时间(毫秒) */
|
|
19
|
-
timeout: number;
|
|
20
|
-
/** 是否启用请求日志 */
|
|
21
|
-
enableRequestLog: boolean;
|
|
22
|
-
/** 是否启用响应日志 */
|
|
23
|
-
enableResponseLog: boolean;
|
|
24
|
-
/** 重试次数 */
|
|
25
|
-
retryCount: number;
|
|
26
|
-
/** 重试延迟(毫秒) */
|
|
27
|
-
retryDelay: number;
|
|
28
|
-
};
|
|
5
|
+
export declare const RequestConfig: IRequestConfig;
|
|
29
6
|
//# sourceMappingURL=request.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../src/config/request.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../src/config/request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,cAwB3B,CAAC"}
|
package/dist/core/Kivii.d.ts
CHANGED
package/dist/core/Kivii.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Kivii.d.ts","sourceRoot":"","sources":["../../src/core/Kivii.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"Kivii.d.ts","sourceRoot":"","sources":["../../src/core/Kivii.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAGlD,qBAAa,KAAK;IAEhB,OAAO,CAAC,MAAM,CAAC,oBAAoB,CAAQ;IAGpC,MAAM,EAAE,MAAM,CAAgB;IAG9B,OAAO,EAAE,QAAQ,CAAsB;IACvC,MAAM,EAAE,OAAO,CAAuB;IAE7C;;;;OAIG;IACI,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,GAAG,IAAI;WAcvC,WAAW,IAAI,KAAK;CAMnC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { Kivii } from './core/Kivii';
|
|
2
2
|
declare const $Kivii: Kivii;
|
|
3
|
-
export { $Kivii as Kivii };
|
|
4
3
|
/**
|
|
5
4
|
* Vue 插件安装函数
|
|
6
5
|
* @param app Vue 应用实例
|
|
7
6
|
* @param options 插件选项
|
|
8
|
-
* @returns Promise<Application> 应用实例
|
|
9
7
|
*/
|
|
10
|
-
|
|
8
|
+
declare const install: (app: any) => void;
|
|
9
|
+
export { $Kivii as Kivii, install };
|
|
11
10
|
declare const _default: {
|
|
12
|
-
install:
|
|
11
|
+
install: (app: any) => void;
|
|
12
|
+
Kivii: Kivii;
|
|
13
13
|
};
|
|
14
14
|
export default _default;
|
|
15
15
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAGrC,QAAA,MAAM,MAAM,OAAsB,CAAC;AAYnC,OAAO,EAAE,MAAM,IAAI,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAGrC,QAAA,MAAM,MAAM,OAAsB,CAAC;AAYnC;;;;GAIG;AACH,QAAA,MAAM,OAAO,GAAI,KAAK,GAAG,SAQxB,CAAC;AAGF,OAAO,EAAE,MAAM,IAAI,KAAK,EAAE,OAAO,EAAE,CAAC;;mBAXd,GAAG;;;AAczB,wBAGE"}
|
|
@@ -1,16 +1,26 @@
|
|
|
1
1
|
export interface IRequestConfig {
|
|
2
2
|
/** 基础 URL */
|
|
3
|
-
|
|
3
|
+
baseURL?: string;
|
|
4
|
+
/** 请求 URL */
|
|
5
|
+
url?: string;
|
|
4
6
|
/** 请求方法 */
|
|
5
7
|
method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
6
8
|
/** 请求头 */
|
|
7
|
-
header
|
|
9
|
+
header?: Record<string, any>;
|
|
8
10
|
/** 请求参数 */
|
|
9
|
-
params
|
|
11
|
+
params?: Record<string, any>;
|
|
10
12
|
/** 请求数据 */
|
|
11
|
-
data
|
|
13
|
+
data?: Record<string, any>;
|
|
12
14
|
/** 超时时间(毫秒) */
|
|
13
15
|
timeout?: number;
|
|
16
|
+
/** 是否启用请求日志 */
|
|
17
|
+
enableRequestLog?: boolean;
|
|
18
|
+
/** 是否启用响应日志 */
|
|
19
|
+
enableResponseLog?: boolean;
|
|
20
|
+
/** 重试次数 */
|
|
21
|
+
retryCount?: number;
|
|
22
|
+
/** 重试延迟(毫秒) */
|
|
23
|
+
retryDelay?: number;
|
|
14
24
|
}
|
|
15
25
|
export interface IRequestResponse<T = any, D = any, H = {}> {
|
|
16
26
|
data: T;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IRequest.d.ts","sourceRoot":"","sources":["../../src/interfaces/IRequest.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC7B,aAAa;IACb,GAAG,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"IRequest.d.ts","sourceRoot":"","sources":["../../src/interfaces/IRequest.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC7B,aAAa;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,WAAW;IACX,MAAM,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;IAC1E,UAAU;IACV,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC7B,WAAW;IACX,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC7B,WAAW;IACX,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC3B,eAAe;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,eAAe;IACf,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,eAAe;IACf,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,WAAW;IACX,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,gBAAgB,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,GAAG,EAAE;IACxD,IAAI,EAAE,CAAC,CAAC;IACR,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,CAAC,CAAC;IACX,MAAM,EAAE,CAAC,CAAC;IACV,OAAO,CAAC,EAAE,QAAQ,CAAC;CACpB;AAED,MAAM,WAAW,QAAQ;IACvB;;;;OAIG;IACH,IAAI,CAAC,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;CACxD"}
|
package/dist/kivii.bridge.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Kivii={})}(this,function(e){"use strict";class t{constructor(){this.configs=new Map}set(e,t){e.includes(".")?this.setNestedValue(e,t):this.configs.set(e,t)}get(e){return e.includes(".")?this.getNestedValue(e):this.configs.get(e)}has(e){return e.includes(".")?void 0!==this.getNestedValue(e):this.configs.has(e)}delete(e){if(e.includes(".")){const t=e.split("."),n=t[0],r=t.slice(1).join(".");if(this.configs.has(n)){const e=this.configs.get(n);if("object"==typeof e&&null!==e)return delete e[r],!0}return!1}return this.configs.delete(e)}clear(){this.configs.clear()}getAll(){const e={};for(const[t,n]of this.configs)e[t]=n;return e}setNestedValue(e,t){const n=e.split("."),r=n[0];let o=this.configs.get(r)||{};for(let e=1;e<n.length-1;e++)o[n[e]]&&"object"==typeof o[n[e]]||(o[n[e]]={}),o=o[n[e]];o[n[n.length-1]]=t,this.configs.set(r,this.configs.get(r)||{}),Object.assign(this.configs.get(r),o)}getNestedValue(e){const t=e.split("."),n=t[0];let r=this.configs.get(n);for(let e=1;e<t.length;e++){if(!r||"object"!=typeof r||!(t[e]in r))return;r=r[t[e]]}return r}}class n{constructor(){}debug(e,t){this.isLogEnabled()&&console.log(`[DEBUG] ${e}`,t||"")}error(e,t){this.isLogEnabled()&&console.error(`[ERROR] ${e}`,t||"")}info(e,t){this.isLogEnabled()&&console.info(`[INFO] ${e}`,t||"")}warn(e,t){this.isLogEnabled()&&console.warn(`[WARN] ${e}`,t||"")}isLogEnabled(){return!1!==jt.getInstance().config.get("app.logger.enabled")}}function r(e,t){return function(){return e.apply(t,arguments)}}const{toString:o}=Object.prototype,{getPrototypeOf:s}=Object,{iterator:i,toStringTag:a}=Symbol,c=(l=Object.create(null),e=>{const t=o.call(e);return l[t]||(l[t]=t.slice(8,-1).toLowerCase())});var l;const u=e=>(e=e.toLowerCase(),t=>c(t)===e),f=e=>t=>typeof t===e,{isArray:d}=Array,h=f("undefined");function p(e){return null!==e&&!h(e)&&null!==e.constructor&&!h(e.constructor)&&b(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const m=u("ArrayBuffer");const g=f("string"),b=f("function"),y=f("number"),w=e=>null!==e&&"object"==typeof e,E=e=>{if("object"!==c(e))return!1;const t=s(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||a in e||i in e)},O=u("Date"),R=u("File"),S=u("Blob"),T=u("FileList"),v=u("URLSearchParams"),[A,j,x,C]=["ReadableStream","Request","Response","Headers"].map(u);function N(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),d(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{if(p(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),s=o.length;let i;for(r=0;r<s;r++)i=o[r],t.call(null,e[i],i,e)}}function U(e,t){if(p(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r,o=n.length;for(;o-- >0;)if(r=n[o],t===r.toLowerCase())return r;return null}const P="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,L=e=>!h(e)&&e!==P;const _=(F="undefined"!=typeof Uint8Array&&s(Uint8Array),e=>F&&e instanceof F);var F;const k=u("HTMLFormElement"),B=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),D=u("RegExp"),q=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};N(n,(n,o)=>{let s;!1!==(s=t(n,o,e))&&(r[o]=s||n)}),Object.defineProperties(e,r)};const I=u("AsyncFunction"),M=(z="function"==typeof setImmediate,H=b(P.postMessage),z?setImmediate:H?(K=`axios@${Math.random()}`,J=[],P.addEventListener("message",({source:e,data:t})=>{e===P&&t===K&&J.length&&J.shift()()},!1),e=>{J.push(e),P.postMessage(K,"*")}):e=>setTimeout(e));var z,H,K,J;const V="undefined"!=typeof queueMicrotask?queueMicrotask.bind(P):"undefined"!=typeof process&&process.nextTick||M;var $={isArray:d,isArrayBuffer:m,isBuffer:p,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||b(e.append)&&("formdata"===(t=c(e))||"object"===t&&b(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&m(e.buffer),t},isString:g,isNumber:y,isBoolean:e=>!0===e||!1===e,isObject:w,isPlainObject:E,isEmptyObject:e=>{if(!w(e)||p(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:A,isRequest:j,isResponse:x,isHeaders:C,isUndefined:h,isDate:O,isFile:R,isBlob:S,isRegExp:D,isFunction:b,isStream:e=>w(e)&&b(e.pipe),isURLSearchParams:v,isTypedArray:_,isFileList:T,forEach:N,merge:function e(){const{caseless:t,skipUndefined:n}=L(this)&&this||{},r={},o=(o,s)=>{const i=t&&U(r,s)||s;E(r[i])&&E(o)?r[i]=e(r[i],o):E(o)?r[i]=e({},o):d(o)?r[i]=o.slice():n&&h(o)||(r[i]=o)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&N(arguments[e],o);return r},extend:(e,t,n,{allOwnKeys:o}={})=>(N(t,(t,o)=>{n&&b(t)?e[o]=r(t,n):e[o]=t},{allOwnKeys:o}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let o,i,a;const c={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)a=o[i],r&&!r(a,e,t)||c[a]||(t[a]=e[a],c[a]=!0);e=!1!==n&&s(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:c,kindOfTest:u,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(d(e))return e;let t=e.length;if(!y(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[i]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:k,hasOwnProperty:B,hasOwnProp:B,reduceDescriptors:q,freezeMethods:e=>{q(e,(t,n)=>{if(b(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];b(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach(e=>{n[e]=!0})};return d(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:U,global:P,isContextDefined:L,isSpecCompliantForm:function(e){return!!(e&&b(e.append)&&"FormData"===e[a]&&e[i])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(w(e)){if(t.indexOf(e)>=0)return;if(p(e))return e;if(!("toJSON"in e)){t[r]=e;const o=d(e)?[]:{};return N(e,(e,t)=>{const s=n(e,r+1);!h(s)&&(o[t]=s)}),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:I,isThenable:e=>e&&(w(e)||b(e))&&b(e.then)&&b(e.catch),setImmediate:M,asap:V,isIterable:e=>null!=e&&b(e[i])};function W(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}$.inherits(W,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:$.toJSONObject(this.config),code:this.code,status:this.status}}});const G=W.prototype,X={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{X[e]={value:e}}),Object.defineProperties(W,X),Object.defineProperty(G,"isAxiosError",{value:!0}),W.from=(e,t,n,r,o,s)=>{const i=Object.create(G);$.toFlatObject(e,i,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e);const a=e&&e.message?e.message:"Error",c=null==t&&e?e.code:t;return W.call(i,a,c,n,r,o),e&&null==i.cause&&Object.defineProperty(i,"cause",{value:e,configurable:!0}),i.name=e&&e.name||"Error",s&&Object.assign(i,s),i};function Q(e){return $.isPlainObject(e)||$.isArray(e)}function Z(e){return $.endsWith(e,"[]")?e.slice(0,-2):e}function Y(e,t,n){return e?e.concat(t).map(function(e,t){return e=Z(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const ee=$.toFlatObject($,{},null,function(e){return/^is[A-Z]/.test(e)});function te(e,t,n){if(!$.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=$.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!$.isUndefined(t[e])})).metaTokens,o=n.visitor||l,s=n.dots,i=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&$.isSpecCompliantForm(t);if(!$.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if($.isDate(e))return e.toISOString();if($.isBoolean(e))return e.toString();if(!a&&$.isBlob(e))throw new W("Blob is not supported. Use a Buffer instead.");return $.isArrayBuffer(e)||$.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function l(e,n,o){let a=e;if(e&&!o&&"object"==typeof e)if($.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if($.isArray(e)&&function(e){return $.isArray(e)&&!e.some(Q)}(e)||($.isFileList(e)||$.endsWith(n,"[]"))&&(a=$.toArray(e)))return n=Z(n),a.forEach(function(e,r){!$.isUndefined(e)&&null!==e&&t.append(!0===i?Y([n],r,s):null===i?n:n+"[]",c(e))}),!1;return!!Q(e)||(t.append(Y(o,n,s),c(e)),!1)}const u=[],f=Object.assign(ee,{defaultVisitor:l,convertValue:c,isVisitable:Q});if(!$.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!$.isUndefined(n)){if(-1!==u.indexOf(n))throw Error("Circular reference detected in "+r.join("."));u.push(n),$.forEach(n,function(n,s){!0===(!($.isUndefined(n)||null===n)&&o.call(t,n,$.isString(s)?s.trim():s,r,f))&&e(n,r?r.concat(s):[s])}),u.pop()}}(e),t}function ne(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function re(e,t){this._pairs=[],e&&te(e,this,t)}const oe=re.prototype;function se(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function ie(e,t,n){if(!t)return e;const r=n&&n.encode||se;$.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let s;if(s=o?o(t,n):$.isURLSearchParams(t)?t.toString():new re(t,n).toString(r),s){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}oe.append=function(e,t){this._pairs.push([e,t])},oe.toString=function(e){const t=e?function(t){return e.call(this,t,ne)}:ne;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};class ae{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){$.forEach(this.handlers,function(t){null!==t&&e(t)})}}var ce={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},le={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:re,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const ue="undefined"!=typeof window&&"undefined"!=typeof document,fe="object"==typeof navigator&&navigator||void 0,de=ue&&(!fe||["ReactNative","NativeScript","NS"].indexOf(fe.product)<0),he="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,pe=ue&&window.location.href||"http://localhost";var me={...Object.freeze({__proto__:null,hasBrowserEnv:ue,hasStandardBrowserEnv:de,hasStandardBrowserWebWorkerEnv:he,navigator:fe,origin:pe}),...le};function ge(e){function t(e,n,r,o){let s=e[o++];if("__proto__"===s)return!0;const i=Number.isFinite(+s),a=o>=e.length;if(s=!s&&$.isArray(r)?r.length:s,a)return $.hasOwnProp(r,s)?r[s]=[r[s],n]:r[s]=n,!i;r[s]&&$.isObject(r[s])||(r[s]=[]);return t(e,n,r[s],o)&&$.isArray(r[s])&&(r[s]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let s;for(r=0;r<o;r++)s=n[r],t[s]=e[s];return t}(r[s])),!i}if($.isFormData(e)&&$.isFunction(e.entries)){const n={};return $.forEachEntry(e,(e,r)=>{t(function(e){return $.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),r,n,0)}),n}return null}const be={transitional:ce,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=$.isObject(e);o&&$.isHTMLForm(e)&&(e=new FormData(e));if($.isFormData(e))return r?JSON.stringify(ge(e)):e;if($.isArrayBuffer(e)||$.isBuffer(e)||$.isStream(e)||$.isFile(e)||$.isBlob(e)||$.isReadableStream(e))return e;if($.isArrayBufferView(e))return e.buffer;if($.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return te(e,new me.classes.URLSearchParams,{visitor:function(e,t,n,r){return me.isNode&&$.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((s=$.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return te(s?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if($.isString(e))try{return(t||JSON.parse)(e),$.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||be.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if($.isResponse(e)||$.isReadableStream(e))return e;if(e&&$.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e,this.parseReviver)}catch(e){if(n){if("SyntaxError"===e.name)throw W.from(e,W.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:me.classes.FormData,Blob:me.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};$.forEach(["delete","get","head","post","put","patch"],e=>{be.headers[e]={}});const ye=$.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const we=Symbol("internals");function Ee(e){return e&&String(e).trim().toLowerCase()}function Oe(e){return!1===e||null==e?e:$.isArray(e)?e.map(Oe):String(e)}function Re(e,t,n,r,o){return $.isFunction(r)?r.call(this,t,n):(o&&(t=n),$.isString(t)?$.isString(r)?-1!==t.indexOf(r):$.isRegExp(r)?r.test(t):void 0:void 0)}let Se=class{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=Ee(t);if(!o)throw new Error("header name must be a non-empty string");const s=$.findKey(r,o);(!s||void 0===r[s]||!0===n||void 0===n&&!1!==r[s])&&(r[s||t]=Oe(e))}const s=(e,t)=>$.forEach(e,(e,n)=>o(e,n,t));if($.isPlainObject(e)||e instanceof this.constructor)s(e,t);else if($.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))s((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach(function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!n||t[n]&&ye[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t})(e),t);else if($.isObject(e)&&$.isIterable(e)){let n,r,o={};for(const t of e){if(!$.isArray(t))throw TypeError("Object iterator must return a key-value pair");o[r=t[0]]=(n=o[r])?$.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}s(o,t)}else null!=e&&o(t,e,n);return this}get(e,t){if(e=Ee(e)){const n=$.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if($.isFunction(t))return t.call(this,e,n);if($.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Ee(e)){const n=$.findKey(this,e);return!(!n||void 0===this[n]||t&&!Re(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=Ee(e)){const o=$.findKey(n,e);!o||t&&!Re(0,n[o],o,t)||(delete n[o],r=!0)}}return $.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!Re(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return $.forEach(this,(r,o)=>{const s=$.findKey(n,o);if(s)return t[s]=Oe(r),void delete t[o];const i=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(o):String(o).trim();i!==o&&delete t[o],t[i]=Oe(r),n[i]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return $.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&$.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){const t=(this[we]=this[we]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=Ee(e);t[r]||(!function(e,t){const n=$.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})})}(n,e),t[r]=!0)}return $.isArray(e)?e.forEach(r):r(e),this}};function Te(e,t){const n=this||be,r=t||n,o=Se.from(r.headers);let s=r.data;return $.forEach(e,function(e){s=e.call(n,s,o.normalize(),t?t.status:void 0)}),o.normalize(),s}function ve(e){return!(!e||!e.__CANCEL__)}function Ae(e,t,n){W.call(this,null==e?"canceled":e,W.ERR_CANCELED,t,n),this.name="CanceledError"}function je(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new W("Request failed with status code "+n.status,[W.ERR_BAD_REQUEST,W.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}Se.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),$.reduceDescriptors(Se.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),$.freezeMethods(Se),$.inherits(Ae,W,{__CANCEL__:!0});const xe=(e,t,n=3)=>{let r=0;const o=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,s=0,i=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),l=r[i];o||(o=c),n[s]=a,r[s]=c;let u=i,f=0;for(;u!==s;)f+=n[u++],u%=e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),c-o<t)return;const d=l&&c-l;return d?Math.round(1e3*f/d):void 0}}(50,250);return function(e,t){let n,r,o=0,s=1e3/t;const i=(t,s=Date.now())=>{o=s,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),a=t-o;a>=s?i(e,t):(n=e,r||(r=setTimeout(()=>{r=null,i(n)},s-a)))},()=>n&&i(n)]}(n=>{const s=n.loaded,i=n.lengthComputable?n.total:void 0,a=s-r,c=o(a);r=s;e({loaded:s,total:i,progress:i?s/i:void 0,bytes:a,rate:c||void 0,estimated:c&&i&&s<=i?(i-s)/c:void 0,event:n,lengthComputable:null!=i,[t?"download":"upload"]:!0})},n)},Ce=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Ne=e=>(...t)=>$.asap(()=>e(...t));var Ue=me.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,me.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(me.origin),me.navigator&&/(msie|trident)/i.test(me.navigator.userAgent)):()=>!0,Pe=me.hasStandardBrowserEnv?{write(e,t,n,r,o,s){const i=[e+"="+encodeURIComponent(t)];$.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),$.isString(r)&&i.push("path="+r),$.isString(o)&&i.push("domain="+o),!0===s&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function Le(e,t,n){let r=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(r||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const _e=e=>e instanceof Se?{...e}:e;function Fe(e,t){t=t||{};const n={};function r(e,t,n,r){return $.isPlainObject(e)&&$.isPlainObject(t)?$.merge.call({caseless:r},e,t):$.isPlainObject(t)?$.merge({},t):$.isArray(t)?t.slice():t}function o(e,t,n,o){return $.isUndefined(t)?$.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function s(e,t){if(!$.isUndefined(t))return r(void 0,t)}function i(e,t){return $.isUndefined(t)?$.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,o,s){return s in t?r(n,o):s in e?r(void 0,n):void 0}const c={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(e,t,n)=>o(_e(e),_e(t),0,!0)};return $.forEach(Object.keys({...e,...t}),function(r){const s=c[r]||o,i=s(e[r],t[r],r);$.isUndefined(i)&&s!==a||(n[r]=i)}),n}var ke=e=>{const t=Fe({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:s,headers:i,auth:a}=t;if(t.headers=i=Se.from(i),t.url=ie(Le(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&i.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),$.isFormData(n))if(me.hasStandardBrowserEnv||me.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if($.isFunction(n.getHeaders)){const e=n.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,n])=>{t.includes(e.toLowerCase())&&i.set(e,n)})}if(me.hasStandardBrowserEnv&&(r&&$.isFunction(r)&&(r=r(t)),r||!1!==r&&Ue(t.url))){const e=o&&s&&Pe.read(s);e&&i.set(o,e)}return t};var Be="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const r=ke(e);let o=r.data;const s=Se.from(r.headers).normalize();let i,a,c,l,u,{responseType:f,onUploadProgress:d,onDownloadProgress:h}=r;function p(){l&&l(),u&&u(),r.cancelToken&&r.cancelToken.unsubscribe(i),r.signal&&r.signal.removeEventListener("abort",i)}let m=new XMLHttpRequest;function g(){if(!m)return;const r=Se.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());je(function(e){t(e),p()},function(e){n(e),p()},{data:f&&"text"!==f&&"json"!==f?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:r,config:e,request:m}),m=null}m.open(r.method.toUpperCase(),r.url,!0),m.timeout=r.timeout,"onloadend"in m?m.onloadend=g:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(g)},m.onabort=function(){m&&(n(new W("Request aborted",W.ECONNABORTED,e,m)),m=null)},m.onerror=function(t){const r=new W(t&&t.message?t.message:"Network Error",W.ERR_NETWORK,e,m);r.event=t||null,n(r),m=null},m.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||ce;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new W(t,o.clarifyTimeoutError?W.ETIMEDOUT:W.ECONNABORTED,e,m)),m=null},void 0===o&&s.setContentType(null),"setRequestHeader"in m&&$.forEach(s.toJSON(),function(e,t){m.setRequestHeader(t,e)}),$.isUndefined(r.withCredentials)||(m.withCredentials=!!r.withCredentials),f&&"json"!==f&&(m.responseType=r.responseType),h&&([c,u]=xe(h,!0),m.addEventListener("progress",c)),d&&m.upload&&([a,l]=xe(d),m.upload.addEventListener("progress",a),m.upload.addEventListener("loadend",l)),(r.cancelToken||r.signal)&&(i=t=>{m&&(n(!t||t.type?new Ae(null,e,m):t),m.abort(),m=null)},r.cancelToken&&r.cancelToken.subscribe(i),r.signal&&(r.signal.aborted?i():r.signal.addEventListener("abort",i)));const b=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);b&&-1===me.protocols.indexOf(b)?n(new W("Unsupported protocol "+b+":",W.ERR_BAD_REQUEST,e)):m.send(o||null)})};const De=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const o=function(e){if(!n){n=!0,i();const t=e instanceof Error?e:this.reason;r.abort(t instanceof W?t:new Ae(t instanceof Error?t.message:t))}};let s=t&&setTimeout(()=>{s=null,o(new W(`timeout ${t} of ms exceeded`,W.ETIMEDOUT))},t);const i=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)}),e=null)};e.forEach(e=>e.addEventListener("abort",o));const{signal:a}=r;return a.unsubscribe=()=>$.asap(i),a}},qe=function*(e,t){let n=e.byteLength;if(n<t)return void(yield e);let r,o=0;for(;o<n;)r=o+t,yield e.slice(o,r),o=r},Ie=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},Me=(e,t,n,r)=>{const o=async function*(e,t){for await(const n of Ie(e))yield*qe(n,t)}(e,t);let s,i=0,a=e=>{s||(s=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await o.next();if(t)return a(),void e.close();let s=r.byteLength;if(n){let e=i+=s;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw a(e),e}},cancel:e=>(a(e),o.return())},{highWaterMark:2})},{isFunction:ze}=$,He=(({Request:e,Response:t})=>({Request:e,Response:t}))($.global),{ReadableStream:Ke,TextEncoder:Je}=$.global,Ve=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},$e=e=>{e=$.merge.call({skipUndefined:!0},He,e);const{fetch:t,Request:n,Response:r}=e,o=t?ze(t):"function"==typeof fetch,s=ze(n),i=ze(r);if(!o)return!1;const a=o&&ze(Ke),c=o&&("function"==typeof Je?(l=new Je,e=>l.encode(e)):async e=>new Uint8Array(await new n(e).arrayBuffer()));var l;const u=s&&a&&Ve(()=>{let e=!1;const t=new n(me.origin,{body:new Ke,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),f=i&&a&&Ve(()=>$.isReadableStream(new r("").body)),d={stream:f&&(e=>e.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!d[e]&&(d[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new W(`Response type '${e}' is not supported`,W.ERR_NOT_SUPPORT,n)})});const h=async(e,t)=>{const r=$.toFiniteNumber(e.getContentLength());return null==r?(async e=>{if(null==e)return 0;if($.isBlob(e))return e.size;if($.isSpecCompliantForm(e)){const t=new n(me.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return $.isArrayBufferView(e)||$.isArrayBuffer(e)?e.byteLength:($.isURLSearchParams(e)&&(e+=""),$.isString(e)?(await c(e)).byteLength:void 0)})(t):r};return async e=>{let{url:o,method:i,data:a,signal:c,cancelToken:l,timeout:p,onDownloadProgress:m,onUploadProgress:g,responseType:b,headers:y,withCredentials:w="same-origin",fetchOptions:E}=ke(e),O=t||fetch;b=b?(b+"").toLowerCase():"text";let R=De([c,l&&l.toAbortSignal()],p),S=null;const T=R&&R.unsubscribe&&(()=>{R.unsubscribe()});let v;try{if(g&&u&&"get"!==i&&"head"!==i&&0!==(v=await h(y,a))){let e,t=new n(o,{method:"POST",body:a,duplex:"half"});if($.isFormData(a)&&(e=t.headers.get("content-type"))&&y.setContentType(e),t.body){const[e,n]=Ce(v,xe(Ne(g)));a=Me(t.body,65536,e,n)}}$.isString(w)||(w=w?"include":"omit");const t=s&&"credentials"in n.prototype,c={...E,signal:R,method:i.toUpperCase(),headers:y.normalize().toJSON(),body:a,duplex:"half",credentials:t?w:void 0};S=s&&new n(o,c);let l=await(s?O(S,E):O(o,c));const p=f&&("stream"===b||"response"===b);if(f&&(m||p&&T)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=l[t]});const t=$.toFiniteNumber(l.headers.get("content-length")),[n,o]=m&&Ce(t,xe(Ne(m),!0))||[];l=new r(Me(l.body,65536,n,()=>{o&&o(),T&&T()}),e)}b=b||"text";let A=await d[$.findKey(d,b)||"text"](l,e);return!p&&T&&T(),await new Promise((t,n)=>{je(t,n,{data:A,headers:Se.from(l.headers),status:l.status,statusText:l.statusText,config:e,request:S})})}catch(t){if(T&&T(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new W("Network Error",W.ERR_NETWORK,e,S),{cause:t.cause||t});throw W.from(t,t&&t.code,e,S)}}},We=new Map,Ge=e=>{let t=e?e.env:{};const{fetch:n,Request:r,Response:o}=t,s=[r,o,n];let i,a,c=s.length,l=We;for(;c--;)i=s[c],a=l.get(i),void 0===a&&l.set(i,a=c?new Map:$e(t)),l=a;return a};Ge();const Xe={http:null,xhr:Be,fetch:{get:Ge}};$.forEach(Xe,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const Qe=e=>`- ${e}`,Ze=e=>$.isFunction(e)||null===e||!1===e;var Ye=(e,t)=>{e=$.isArray(e)?e:[e];const{length:n}=e;let r,o;const s={};for(let i=0;i<n;i++){let n;if(r=e[i],o=r,!Ze(r)&&(o=Xe[(n=String(r)).toLowerCase()],void 0===o))throw new W(`Unknown adapter '${n}'`);if(o&&($.isFunction(o)||(o=o.get(t))))break;s[n||"#"+i]=o}if(!o){const e=Object.entries(s).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));throw new W("There is no suitable adapter to dispatch the request "+(n?e.length>1?"since :\n"+e.map(Qe).join("\n"):" "+Qe(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return o};function et(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Ae(null,e)}function tt(e){et(e),e.headers=Se.from(e.headers),e.data=Te.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return Ye(e.adapter||be.adapter,e)(e).then(function(t){return et(e),t.data=Te.call(e,e.transformResponse,t),t.headers=Se.from(t.headers),t},function(t){return ve(t)||(et(e),t&&t.response&&(t.response.data=Te.call(e,e.transformResponse,t.response),t.response.headers=Se.from(t.response.headers))),Promise.reject(t)})}const nt="1.12.2",rt={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{rt[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const ot={};rt.transitional=function(e,t,n){function r(e,t){return"[Axios v"+nt+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,s)=>{if(!1===e)throw new W(r(o," has been removed"+(t?" in "+t:"")),W.ERR_DEPRECATED);return t&&!ot[o]&&(ot[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,s)}},rt.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};var st={assertOptions:function(e,t,n){if("object"!=typeof e)throw new W("options must be an object",W.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const s=r[o],i=t[s];if(i){const t=e[s],n=void 0===t||i(t,s,e);if(!0!==n)throw new W("option "+s+" must be "+n,W.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new W("Unknown option "+s,W.ERR_BAD_OPTION)}},validators:rt};const it=st.validators;let at=class{constructor(e){this.defaults=e||{},this.interceptors={request:new ae,response:new ae}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Fe(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&st.assertOptions(n,{silentJSONParsing:it.transitional(it.boolean),forcedJSONParsing:it.transitional(it.boolean),clarifyTimeoutError:it.transitional(it.boolean)},!1),null!=r&&($.isFunction(r)?t.paramsSerializer={serialize:r}:st.assertOptions(r,{encode:it.function,serialize:it.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),st.assertOptions(t,{baseUrl:it.spelling("baseURL"),withXsrfToken:it.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let s=o&&$.merge(o.common,o[t.method]);o&&$.forEach(["delete","get","head","post","put","patch","common"],e=>{delete o[e]}),t.headers=Se.concat(s,o);const i=[];let a=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,i.unshift(e.fulfilled,e.rejected))});const c=[];let l;this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let u,f=0;if(!a){const e=[tt.bind(this),void 0];for(e.unshift(...i),e.push(...c),u=e.length,l=Promise.resolve(t);f<u;)l=l.then(e[f++],e[f++]);return l}u=i.length;let d=t;for(;f<u;){const e=i[f++],t=i[f++];try{d=e(d)}catch(e){t.call(this,e);break}}try{l=tt.call(this,d)}catch(e){return Promise.reject(e)}for(f=0,u=c.length;f<u;)l=l.then(c[f++],c[f++]);return l}getUri(e){return ie(Le((e=Fe(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}};$.forEach(["delete","get","head","options"],function(e){at.prototype[e]=function(t,n){return this.request(Fe(n||{},{method:e,url:t,data:(n||{}).data}))}}),$.forEach(["post","put","patch"],function(e){function t(t){return function(n,r,o){return this.request(Fe(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}at.prototype[e]=t(),at.prototype[e+"Form"]=t(!0)});const ct={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(ct).forEach(([e,t])=>{ct[t]=e});const lt=function e(t){const n=new at(t),o=r(at.prototype.request,n);return $.extend(o,at.prototype,n,{allOwnKeys:!0}),$.extend(o,n,null,{allOwnKeys:!0}),o.create=function(n){return e(Fe(t,n))},o}(be);lt.Axios=at,lt.CanceledError=Ae,lt.CancelToken=class e{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(e){t=e});const n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t;const r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,o){n.reason||(n.reason=new Ae(e,r,o),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e(function(e){t=e}),cancel:t}}},lt.isCancel=ve,lt.VERSION=nt,lt.toFormData=te,lt.AxiosError=W,lt.Cancel=lt.CanceledError,lt.all=function(e){return Promise.all(e)},lt.spread=function(e){return function(t){return e.apply(null,t)}},lt.isAxiosError=function(e){return $.isObject(e)&&!0===e.isAxiosError},lt.mergeConfig=Fe,lt.AxiosHeaders=Se,lt.formToJSON=e=>ge($.isHTMLForm(e)?new FormData(e):e),lt.getAdapter=Ye,lt.HttpStatusCode=ct,lt.default=lt;const{Axios:ut,AxiosError:ft,CanceledError:dt,isCancel:ht,CancelToken:pt,VERSION:mt,all:gt,Cancel:bt,isAxiosError:yt,spread:wt,toFormData:Et,AxiosHeaders:Ot,HttpStatusCode:Rt,formToJSON:St,getAdapter:Tt,mergeConfig:vt}=lt;class At{constructor(){this.interceptorsSetup=!1,this.axiosInstance=lt.create()}async send(e){const t=jt.getInstance().config;this.interceptorsSetup||(this.setupInterceptors(),this.interceptorsSetup=!0);try{const n={...this.getDefaultConfig(t),...this.convertToAxiosConfig(e)},r=await this.axiosInstance.request(n);return this.convertResponse(r)}catch(e){throw this.handleError(e)}}setupInterceptors(){this.axiosInstance.interceptors.request.use(e=>e,e=>Promise.reject(e)),this.axiosInstance.interceptors.response.use(e=>e,e=>Promise.reject(e))}getDefaultConfig(e){const t={},n=e.get("request.baseURL");n&&(t.baseURL=n);const r=e.get("request.timeout");r&&(t.timeout=r);const o=e.get("request.headers");return o&&(t.headers=o),t}convertToAxiosConfig(e){const t={url:e.url,method:e.method||"GET",timeout:e.timeout};return e.header&&Object.keys(e.header).length>0&&(t.headers=e.header),e.params&&Object.keys(e.params).length>0&&(t.params=e.params),e.data&&Object.keys(e.data).length>0&&(t.data=e.data),t}convertResponse(e){return{data:e.data,status:e.status,statusText:e.statusText,headers:e.headers,config:{url:e.config.url,method:e.config.method,timeout:e.config.timeout}}}handleError(e){if(e.response){const t=`请求失败: ${e.response.status} ${e.response.statusText}`;return new Error(t)}return e.request?new Error("网络请求超时或无法连接到服务器"):new Error(`请求配置错误: ${e.message}`)}}class jt{constructor(){this.config=new t,this.request=new At,this.logger=new n}injection(e,t){switch(e){case"request":this.request=t;break;case"logger":this.logger=t;break;default:console.warn(`Unknown module: ${e}`)}}static getInstance(){return jt._applicationInstance||(jt._applicationInstance=new jt),jt._applicationInstance}}const xt=jt.getInstance();function Ct(e){e.config.globalProperties.$Kivii=xt,e.provide("Kivii",xt),window.Kivii=xt}xt.config.set("app",{logger:{enabled:!0},request:{url:"",method:"GET",header:{"Content-Type":"application/json",Accept:"application/json"},params:{},data:{},timeout:1e4,enableRequestLog:!0,enableResponseLog:!0,retryCount:3,retryDelay:1e3}}),"undefined"!=typeof window&&(window.Kivii=xt);var Nt={install:Ct};e.Kivii=xt,e.default=Nt,e.install=Ct,Object.defineProperty(e,"__esModule",{value:!0})});
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Kivii={})}(this,function(e){"use strict";class t{constructor(){this.configs=new Map}set(e,t){e.includes(".")?this.setNestedValue(e,t):this.configs.set(e,t)}get(e){return e.includes(".")?this.getNestedValue(e):this.configs.get(e)}has(e){return e.includes(".")?void 0!==this.getNestedValue(e):this.configs.has(e)}delete(e){if(e.includes(".")){const t=e.split("."),n=t[0],r=t.slice(1).join(".");if(this.configs.has(n)){const e=this.configs.get(n);if("object"==typeof e&&null!==e)return delete e[r],!0}return!1}return this.configs.delete(e)}clear(){this.configs.clear()}getAll(){const e={};for(const[t,n]of this.configs)e[t]=n;return e}setNestedValue(e,t){const n=e.split("."),r=n[0];let o=this.configs.get(r)||{};for(let e=1;e<n.length-1;e++)o[n[e]]&&"object"==typeof o[n[e]]||(o[n[e]]={}),o=o[n[e]];o[n[n.length-1]]=t,this.configs.set(r,this.configs.get(r)||{}),Object.assign(this.configs.get(r),o)}getNestedValue(e){const t=e.split("."),n=t[0];let r=this.configs.get(n);for(let e=1;e<t.length;e++){if(!r||"object"!=typeof r||!(t[e]in r))return;r=r[t[e]]}return r}}class n{constructor(){}debug(e,t){this.isLogEnabled()&&console.log(`[DEBUG] ${e}`,t||"")}error(e,t){this.isLogEnabled()&&console.error(`[ERROR] ${e}`,t||"")}info(e,t){this.isLogEnabled()&&console.info(`[INFO] ${e}`,t||"")}warn(e,t){this.isLogEnabled()&&console.warn(`[WARN] ${e}`,t||"")}isLogEnabled(){return!1!==jt.getInstance().config.get("app.logger.enabled")}}function r(e,t){return function(){return e.apply(t,arguments)}}const{toString:o}=Object.prototype,{getPrototypeOf:s}=Object,{iterator:i,toStringTag:a}=Symbol,c=(l=Object.create(null),e=>{const t=o.call(e);return l[t]||(l[t]=t.slice(8,-1).toLowerCase())});var l;const u=e=>(e=e.toLowerCase(),t=>c(t)===e),d=e=>t=>typeof t===e,{isArray:f}=Array,h=d("undefined");function p(e){return null!==e&&!h(e)&&null!==e.constructor&&!h(e.constructor)&&b(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const m=u("ArrayBuffer");const g=d("string"),b=d("function"),y=d("number"),w=e=>null!==e&&"object"==typeof e,E=e=>{if("object"!==c(e))return!1;const t=s(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||a in e||i in e)},O=u("Date"),R=u("File"),S=u("Blob"),v=u("FileList"),T=u("URLSearchParams"),[A,j,x,C]=["ReadableStream","Request","Response","Headers"].map(u);function N(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),f(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{if(p(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),s=o.length;let i;for(r=0;r<s;r++)i=o[r],t.call(null,e[i],i,e)}}function P(e,t){if(p(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r,o=n.length;for(;o-- >0;)if(r=n[o],t===r.toLowerCase())return r;return null}const U="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,L=e=>!h(e)&&e!==U;const _=(F="undefined"!=typeof Uint8Array&&s(Uint8Array),e=>F&&e instanceof F);var F;const k=u("HTMLFormElement"),B=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),D=u("RegExp"),q=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};N(n,(n,o)=>{let s;!1!==(s=t(n,o,e))&&(r[o]=s||n)}),Object.defineProperties(e,r)};const I=u("AsyncFunction"),M=(z="function"==typeof setImmediate,H=b(U.postMessage),z?setImmediate:H?(K=`axios@${Math.random()}`,J=[],U.addEventListener("message",({source:e,data:t})=>{e===U&&t===K&&J.length&&J.shift()()},!1),e=>{J.push(e),U.postMessage(K,"*")}):e=>setTimeout(e));var z,H,K,J;const V="undefined"!=typeof queueMicrotask?queueMicrotask.bind(U):"undefined"!=typeof process&&process.nextTick||M;var $={isArray:f,isArrayBuffer:m,isBuffer:p,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||b(e.append)&&("formdata"===(t=c(e))||"object"===t&&b(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&m(e.buffer),t},isString:g,isNumber:y,isBoolean:e=>!0===e||!1===e,isObject:w,isPlainObject:E,isEmptyObject:e=>{if(!w(e)||p(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:A,isRequest:j,isResponse:x,isHeaders:C,isUndefined:h,isDate:O,isFile:R,isBlob:S,isRegExp:D,isFunction:b,isStream:e=>w(e)&&b(e.pipe),isURLSearchParams:T,isTypedArray:_,isFileList:v,forEach:N,merge:function e(){const{caseless:t,skipUndefined:n}=L(this)&&this||{},r={},o=(o,s)=>{const i=t&&P(r,s)||s;E(r[i])&&E(o)?r[i]=e(r[i],o):E(o)?r[i]=e({},o):f(o)?r[i]=o.slice():n&&h(o)||(r[i]=o)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&N(arguments[e],o);return r},extend:(e,t,n,{allOwnKeys:o}={})=>(N(t,(t,o)=>{n&&b(t)?e[o]=r(t,n):e[o]=t},{allOwnKeys:o}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let o,i,a;const c={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)a=o[i],r&&!r(a,e,t)||c[a]||(t[a]=e[a],c[a]=!0);e=!1!==n&&s(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:c,kindOfTest:u,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(f(e))return e;let t=e.length;if(!y(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[i]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:k,hasOwnProperty:B,hasOwnProp:B,reduceDescriptors:q,freezeMethods:e=>{q(e,(t,n)=>{if(b(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];b(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach(e=>{n[e]=!0})};return f(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:P,global:U,isContextDefined:L,isSpecCompliantForm:function(e){return!!(e&&b(e.append)&&"FormData"===e[a]&&e[i])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(w(e)){if(t.indexOf(e)>=0)return;if(p(e))return e;if(!("toJSON"in e)){t[r]=e;const o=f(e)?[]:{};return N(e,(e,t)=>{const s=n(e,r+1);!h(s)&&(o[t]=s)}),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:I,isThenable:e=>e&&(w(e)||b(e))&&b(e.then)&&b(e.catch),setImmediate:M,asap:V,isIterable:e=>null!=e&&b(e[i])};function W(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}$.inherits(W,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:$.toJSONObject(this.config),code:this.code,status:this.status}}});const G=W.prototype,X={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{X[e]={value:e}}),Object.defineProperties(W,X),Object.defineProperty(G,"isAxiosError",{value:!0}),W.from=(e,t,n,r,o,s)=>{const i=Object.create(G);$.toFlatObject(e,i,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e);const a=e&&e.message?e.message:"Error",c=null==t&&e?e.code:t;return W.call(i,a,c,n,r,o),e&&null==i.cause&&Object.defineProperty(i,"cause",{value:e,configurable:!0}),i.name=e&&e.name||"Error",s&&Object.assign(i,s),i};function Q(e){return $.isPlainObject(e)||$.isArray(e)}function Z(e){return $.endsWith(e,"[]")?e.slice(0,-2):e}function Y(e,t,n){return e?e.concat(t).map(function(e,t){return e=Z(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const ee=$.toFlatObject($,{},null,function(e){return/^is[A-Z]/.test(e)});function te(e,t,n){if(!$.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=$.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!$.isUndefined(t[e])})).metaTokens,o=n.visitor||l,s=n.dots,i=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&$.isSpecCompliantForm(t);if(!$.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if($.isDate(e))return e.toISOString();if($.isBoolean(e))return e.toString();if(!a&&$.isBlob(e))throw new W("Blob is not supported. Use a Buffer instead.");return $.isArrayBuffer(e)||$.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function l(e,n,o){let a=e;if(e&&!o&&"object"==typeof e)if($.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if($.isArray(e)&&function(e){return $.isArray(e)&&!e.some(Q)}(e)||($.isFileList(e)||$.endsWith(n,"[]"))&&(a=$.toArray(e)))return n=Z(n),a.forEach(function(e,r){!$.isUndefined(e)&&null!==e&&t.append(!0===i?Y([n],r,s):null===i?n:n+"[]",c(e))}),!1;return!!Q(e)||(t.append(Y(o,n,s),c(e)),!1)}const u=[],d=Object.assign(ee,{defaultVisitor:l,convertValue:c,isVisitable:Q});if(!$.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!$.isUndefined(n)){if(-1!==u.indexOf(n))throw Error("Circular reference detected in "+r.join("."));u.push(n),$.forEach(n,function(n,s){!0===(!($.isUndefined(n)||null===n)&&o.call(t,n,$.isString(s)?s.trim():s,r,d))&&e(n,r?r.concat(s):[s])}),u.pop()}}(e),t}function ne(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function re(e,t){this._pairs=[],e&&te(e,this,t)}const oe=re.prototype;function se(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function ie(e,t,n){if(!t)return e;const r=n&&n.encode||se;$.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let s;if(s=o?o(t,n):$.isURLSearchParams(t)?t.toString():new re(t,n).toString(r),s){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}oe.append=function(e,t){this._pairs.push([e,t])},oe.toString=function(e){const t=e?function(t){return e.call(this,t,ne)}:ne;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};class ae{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){$.forEach(this.handlers,function(t){null!==t&&e(t)})}}var ce={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},le={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:re,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const ue="undefined"!=typeof window&&"undefined"!=typeof document,de="object"==typeof navigator&&navigator||void 0,fe=ue&&(!de||["ReactNative","NativeScript","NS"].indexOf(de.product)<0),he="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,pe=ue&&window.location.href||"http://localhost";var me={...Object.freeze({__proto__:null,hasBrowserEnv:ue,hasStandardBrowserEnv:fe,hasStandardBrowserWebWorkerEnv:he,navigator:de,origin:pe}),...le};function ge(e){function t(e,n,r,o){let s=e[o++];if("__proto__"===s)return!0;const i=Number.isFinite(+s),a=o>=e.length;if(s=!s&&$.isArray(r)?r.length:s,a)return $.hasOwnProp(r,s)?r[s]=[r[s],n]:r[s]=n,!i;r[s]&&$.isObject(r[s])||(r[s]=[]);return t(e,n,r[s],o)&&$.isArray(r[s])&&(r[s]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let s;for(r=0;r<o;r++)s=n[r],t[s]=e[s];return t}(r[s])),!i}if($.isFormData(e)&&$.isFunction(e.entries)){const n={};return $.forEachEntry(e,(e,r)=>{t(function(e){return $.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),r,n,0)}),n}return null}const be={transitional:ce,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=$.isObject(e);o&&$.isHTMLForm(e)&&(e=new FormData(e));if($.isFormData(e))return r?JSON.stringify(ge(e)):e;if($.isArrayBuffer(e)||$.isBuffer(e)||$.isStream(e)||$.isFile(e)||$.isBlob(e)||$.isReadableStream(e))return e;if($.isArrayBufferView(e))return e.buffer;if($.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return te(e,new me.classes.URLSearchParams,{visitor:function(e,t,n,r){return me.isNode&&$.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((s=$.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return te(s?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if($.isString(e))try{return(t||JSON.parse)(e),$.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||be.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if($.isResponse(e)||$.isReadableStream(e))return e;if(e&&$.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e,this.parseReviver)}catch(e){if(n){if("SyntaxError"===e.name)throw W.from(e,W.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:me.classes.FormData,Blob:me.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};$.forEach(["delete","get","head","post","put","patch"],e=>{be.headers[e]={}});const ye=$.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const we=Symbol("internals");function Ee(e){return e&&String(e).trim().toLowerCase()}function Oe(e){return!1===e||null==e?e:$.isArray(e)?e.map(Oe):String(e)}function Re(e,t,n,r,o){return $.isFunction(r)?r.call(this,t,n):(o&&(t=n),$.isString(t)?$.isString(r)?-1!==t.indexOf(r):$.isRegExp(r)?r.test(t):void 0:void 0)}let Se=class{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=Ee(t);if(!o)throw new Error("header name must be a non-empty string");const s=$.findKey(r,o);(!s||void 0===r[s]||!0===n||void 0===n&&!1!==r[s])&&(r[s||t]=Oe(e))}const s=(e,t)=>$.forEach(e,(e,n)=>o(e,n,t));if($.isPlainObject(e)||e instanceof this.constructor)s(e,t);else if($.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))s((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach(function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!n||t[n]&&ye[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t})(e),t);else if($.isObject(e)&&$.isIterable(e)){let n,r,o={};for(const t of e){if(!$.isArray(t))throw TypeError("Object iterator must return a key-value pair");o[r=t[0]]=(n=o[r])?$.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}s(o,t)}else null!=e&&o(t,e,n);return this}get(e,t){if(e=Ee(e)){const n=$.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if($.isFunction(t))return t.call(this,e,n);if($.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Ee(e)){const n=$.findKey(this,e);return!(!n||void 0===this[n]||t&&!Re(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=Ee(e)){const o=$.findKey(n,e);!o||t&&!Re(0,n[o],o,t)||(delete n[o],r=!0)}}return $.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!Re(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return $.forEach(this,(r,o)=>{const s=$.findKey(n,o);if(s)return t[s]=Oe(r),void delete t[o];const i=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(o):String(o).trim();i!==o&&delete t[o],t[i]=Oe(r),n[i]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return $.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&$.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){const t=(this[we]=this[we]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=Ee(e);t[r]||(!function(e,t){const n=$.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})})}(n,e),t[r]=!0)}return $.isArray(e)?e.forEach(r):r(e),this}};function ve(e,t){const n=this||be,r=t||n,o=Se.from(r.headers);let s=r.data;return $.forEach(e,function(e){s=e.call(n,s,o.normalize(),t?t.status:void 0)}),o.normalize(),s}function Te(e){return!(!e||!e.__CANCEL__)}function Ae(e,t,n){W.call(this,null==e?"canceled":e,W.ERR_CANCELED,t,n),this.name="CanceledError"}function je(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new W("Request failed with status code "+n.status,[W.ERR_BAD_REQUEST,W.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}Se.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),$.reduceDescriptors(Se.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),$.freezeMethods(Se),$.inherits(Ae,W,{__CANCEL__:!0});const xe=(e,t,n=3)=>{let r=0;const o=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,s=0,i=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),l=r[i];o||(o=c),n[s]=a,r[s]=c;let u=i,d=0;for(;u!==s;)d+=n[u++],u%=e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),c-o<t)return;const f=l&&c-l;return f?Math.round(1e3*d/f):void 0}}(50,250);return function(e,t){let n,r,o=0,s=1e3/t;const i=(t,s=Date.now())=>{o=s,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),a=t-o;a>=s?i(e,t):(n=e,r||(r=setTimeout(()=>{r=null,i(n)},s-a)))},()=>n&&i(n)]}(n=>{const s=n.loaded,i=n.lengthComputable?n.total:void 0,a=s-r,c=o(a);r=s;e({loaded:s,total:i,progress:i?s/i:void 0,bytes:a,rate:c||void 0,estimated:c&&i&&s<=i?(i-s)/c:void 0,event:n,lengthComputable:null!=i,[t?"download":"upload"]:!0})},n)},Ce=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Ne=e=>(...t)=>$.asap(()=>e(...t));var Pe=me.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,me.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(me.origin),me.navigator&&/(msie|trident)/i.test(me.navigator.userAgent)):()=>!0,Ue=me.hasStandardBrowserEnv?{write(e,t,n,r,o,s){const i=[e+"="+encodeURIComponent(t)];$.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),$.isString(r)&&i.push("path="+r),$.isString(o)&&i.push("domain="+o),!0===s&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function Le(e,t,n){let r=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(r||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const _e=e=>e instanceof Se?{...e}:e;function Fe(e,t){t=t||{};const n={};function r(e,t,n,r){return $.isPlainObject(e)&&$.isPlainObject(t)?$.merge.call({caseless:r},e,t):$.isPlainObject(t)?$.merge({},t):$.isArray(t)?t.slice():t}function o(e,t,n,o){return $.isUndefined(t)?$.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function s(e,t){if(!$.isUndefined(t))return r(void 0,t)}function i(e,t){return $.isUndefined(t)?$.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,o,s){return s in t?r(n,o):s in e?r(void 0,n):void 0}const c={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(e,t,n)=>o(_e(e),_e(t),0,!0)};return $.forEach(Object.keys({...e,...t}),function(r){const s=c[r]||o,i=s(e[r],t[r],r);$.isUndefined(i)&&s!==a||(n[r]=i)}),n}var ke=e=>{const t=Fe({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:s,headers:i,auth:a}=t;if(t.headers=i=Se.from(i),t.url=ie(Le(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&i.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),$.isFormData(n))if(me.hasStandardBrowserEnv||me.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if($.isFunction(n.getHeaders)){const e=n.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,n])=>{t.includes(e.toLowerCase())&&i.set(e,n)})}if(me.hasStandardBrowserEnv&&(r&&$.isFunction(r)&&(r=r(t)),r||!1!==r&&Pe(t.url))){const e=o&&s&&Ue.read(s);e&&i.set(o,e)}return t};var Be="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const r=ke(e);let o=r.data;const s=Se.from(r.headers).normalize();let i,a,c,l,u,{responseType:d,onUploadProgress:f,onDownloadProgress:h}=r;function p(){l&&l(),u&&u(),r.cancelToken&&r.cancelToken.unsubscribe(i),r.signal&&r.signal.removeEventListener("abort",i)}let m=new XMLHttpRequest;function g(){if(!m)return;const r=Se.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());je(function(e){t(e),p()},function(e){n(e),p()},{data:d&&"text"!==d&&"json"!==d?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:r,config:e,request:m}),m=null}m.open(r.method.toUpperCase(),r.url,!0),m.timeout=r.timeout,"onloadend"in m?m.onloadend=g:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(g)},m.onabort=function(){m&&(n(new W("Request aborted",W.ECONNABORTED,e,m)),m=null)},m.onerror=function(t){const r=new W(t&&t.message?t.message:"Network Error",W.ERR_NETWORK,e,m);r.event=t||null,n(r),m=null},m.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||ce;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new W(t,o.clarifyTimeoutError?W.ETIMEDOUT:W.ECONNABORTED,e,m)),m=null},void 0===o&&s.setContentType(null),"setRequestHeader"in m&&$.forEach(s.toJSON(),function(e,t){m.setRequestHeader(t,e)}),$.isUndefined(r.withCredentials)||(m.withCredentials=!!r.withCredentials),d&&"json"!==d&&(m.responseType=r.responseType),h&&([c,u]=xe(h,!0),m.addEventListener("progress",c)),f&&m.upload&&([a,l]=xe(f),m.upload.addEventListener("progress",a),m.upload.addEventListener("loadend",l)),(r.cancelToken||r.signal)&&(i=t=>{m&&(n(!t||t.type?new Ae(null,e,m):t),m.abort(),m=null)},r.cancelToken&&r.cancelToken.subscribe(i),r.signal&&(r.signal.aborted?i():r.signal.addEventListener("abort",i)));const b=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);b&&-1===me.protocols.indexOf(b)?n(new W("Unsupported protocol "+b+":",W.ERR_BAD_REQUEST,e)):m.send(o||null)})};const De=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const o=function(e){if(!n){n=!0,i();const t=e instanceof Error?e:this.reason;r.abort(t instanceof W?t:new Ae(t instanceof Error?t.message:t))}};let s=t&&setTimeout(()=>{s=null,o(new W(`timeout ${t} of ms exceeded`,W.ETIMEDOUT))},t);const i=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)}),e=null)};e.forEach(e=>e.addEventListener("abort",o));const{signal:a}=r;return a.unsubscribe=()=>$.asap(i),a}},qe=function*(e,t){let n=e.byteLength;if(n<t)return void(yield e);let r,o=0;for(;o<n;)r=o+t,yield e.slice(o,r),o=r},Ie=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},Me=(e,t,n,r)=>{const o=async function*(e,t){for await(const n of Ie(e))yield*qe(n,t)}(e,t);let s,i=0,a=e=>{s||(s=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await o.next();if(t)return a(),void e.close();let s=r.byteLength;if(n){let e=i+=s;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw a(e),e}},cancel:e=>(a(e),o.return())},{highWaterMark:2})},{isFunction:ze}=$,He=(({Request:e,Response:t})=>({Request:e,Response:t}))($.global),{ReadableStream:Ke,TextEncoder:Je}=$.global,Ve=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},$e=e=>{e=$.merge.call({skipUndefined:!0},He,e);const{fetch:t,Request:n,Response:r}=e,o=t?ze(t):"function"==typeof fetch,s=ze(n),i=ze(r);if(!o)return!1;const a=o&&ze(Ke),c=o&&("function"==typeof Je?(l=new Je,e=>l.encode(e)):async e=>new Uint8Array(await new n(e).arrayBuffer()));var l;const u=s&&a&&Ve(()=>{let e=!1;const t=new n(me.origin,{body:new Ke,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),d=i&&a&&Ve(()=>$.isReadableStream(new r("").body)),f={stream:d&&(e=>e.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!f[e]&&(f[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new W(`Response type '${e}' is not supported`,W.ERR_NOT_SUPPORT,n)})});const h=async(e,t)=>{const r=$.toFiniteNumber(e.getContentLength());return null==r?(async e=>{if(null==e)return 0;if($.isBlob(e))return e.size;if($.isSpecCompliantForm(e)){const t=new n(me.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return $.isArrayBufferView(e)||$.isArrayBuffer(e)?e.byteLength:($.isURLSearchParams(e)&&(e+=""),$.isString(e)?(await c(e)).byteLength:void 0)})(t):r};return async e=>{let{url:o,method:i,data:a,signal:c,cancelToken:l,timeout:p,onDownloadProgress:m,onUploadProgress:g,responseType:b,headers:y,withCredentials:w="same-origin",fetchOptions:E}=ke(e),O=t||fetch;b=b?(b+"").toLowerCase():"text";let R=De([c,l&&l.toAbortSignal()],p),S=null;const v=R&&R.unsubscribe&&(()=>{R.unsubscribe()});let T;try{if(g&&u&&"get"!==i&&"head"!==i&&0!==(T=await h(y,a))){let e,t=new n(o,{method:"POST",body:a,duplex:"half"});if($.isFormData(a)&&(e=t.headers.get("content-type"))&&y.setContentType(e),t.body){const[e,n]=Ce(T,xe(Ne(g)));a=Me(t.body,65536,e,n)}}$.isString(w)||(w=w?"include":"omit");const t=s&&"credentials"in n.prototype,c={...E,signal:R,method:i.toUpperCase(),headers:y.normalize().toJSON(),body:a,duplex:"half",credentials:t?w:void 0};S=s&&new n(o,c);let l=await(s?O(S,E):O(o,c));const p=d&&("stream"===b||"response"===b);if(d&&(m||p&&v)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=l[t]});const t=$.toFiniteNumber(l.headers.get("content-length")),[n,o]=m&&Ce(t,xe(Ne(m),!0))||[];l=new r(Me(l.body,65536,n,()=>{o&&o(),v&&v()}),e)}b=b||"text";let A=await f[$.findKey(f,b)||"text"](l,e);return!p&&v&&v(),await new Promise((t,n)=>{je(t,n,{data:A,headers:Se.from(l.headers),status:l.status,statusText:l.statusText,config:e,request:S})})}catch(t){if(v&&v(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new W("Network Error",W.ERR_NETWORK,e,S),{cause:t.cause||t});throw W.from(t,t&&t.code,e,S)}}},We=new Map,Ge=e=>{let t=e?e.env:{};const{fetch:n,Request:r,Response:o}=t,s=[r,o,n];let i,a,c=s.length,l=We;for(;c--;)i=s[c],a=l.get(i),void 0===a&&l.set(i,a=c?new Map:$e(t)),l=a;return a};Ge();const Xe={http:null,xhr:Be,fetch:{get:Ge}};$.forEach(Xe,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const Qe=e=>`- ${e}`,Ze=e=>$.isFunction(e)||null===e||!1===e;var Ye=(e,t)=>{e=$.isArray(e)?e:[e];const{length:n}=e;let r,o;const s={};for(let i=0;i<n;i++){let n;if(r=e[i],o=r,!Ze(r)&&(o=Xe[(n=String(r)).toLowerCase()],void 0===o))throw new W(`Unknown adapter '${n}'`);if(o&&($.isFunction(o)||(o=o.get(t))))break;s[n||"#"+i]=o}if(!o){const e=Object.entries(s).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));throw new W("There is no suitable adapter to dispatch the request "+(n?e.length>1?"since :\n"+e.map(Qe).join("\n"):" "+Qe(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return o};function et(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Ae(null,e)}function tt(e){et(e),e.headers=Se.from(e.headers),e.data=ve.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return Ye(e.adapter||be.adapter,e)(e).then(function(t){return et(e),t.data=ve.call(e,e.transformResponse,t),t.headers=Se.from(t.headers),t},function(t){return Te(t)||(et(e),t&&t.response&&(t.response.data=ve.call(e,e.transformResponse,t.response),t.response.headers=Se.from(t.response.headers))),Promise.reject(t)})}const nt="1.12.2",rt={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{rt[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const ot={};rt.transitional=function(e,t,n){function r(e,t){return"[Axios v"+nt+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,s)=>{if(!1===e)throw new W(r(o," has been removed"+(t?" in "+t:"")),W.ERR_DEPRECATED);return t&&!ot[o]&&(ot[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,s)}},rt.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};var st={assertOptions:function(e,t,n){if("object"!=typeof e)throw new W("options must be an object",W.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const s=r[o],i=t[s];if(i){const t=e[s],n=void 0===t||i(t,s,e);if(!0!==n)throw new W("option "+s+" must be "+n,W.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new W("Unknown option "+s,W.ERR_BAD_OPTION)}},validators:rt};const it=st.validators;let at=class{constructor(e){this.defaults=e||{},this.interceptors={request:new ae,response:new ae}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Fe(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&st.assertOptions(n,{silentJSONParsing:it.transitional(it.boolean),forcedJSONParsing:it.transitional(it.boolean),clarifyTimeoutError:it.transitional(it.boolean)},!1),null!=r&&($.isFunction(r)?t.paramsSerializer={serialize:r}:st.assertOptions(r,{encode:it.function,serialize:it.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),st.assertOptions(t,{baseUrl:it.spelling("baseURL"),withXsrfToken:it.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let s=o&&$.merge(o.common,o[t.method]);o&&$.forEach(["delete","get","head","post","put","patch","common"],e=>{delete o[e]}),t.headers=Se.concat(s,o);const i=[];let a=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,i.unshift(e.fulfilled,e.rejected))});const c=[];let l;this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let u,d=0;if(!a){const e=[tt.bind(this),void 0];for(e.unshift(...i),e.push(...c),u=e.length,l=Promise.resolve(t);d<u;)l=l.then(e[d++],e[d++]);return l}u=i.length;let f=t;for(;d<u;){const e=i[d++],t=i[d++];try{f=e(f)}catch(e){t.call(this,e);break}}try{l=tt.call(this,f)}catch(e){return Promise.reject(e)}for(d=0,u=c.length;d<u;)l=l.then(c[d++],c[d++]);return l}getUri(e){return ie(Le((e=Fe(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}};$.forEach(["delete","get","head","options"],function(e){at.prototype[e]=function(t,n){return this.request(Fe(n||{},{method:e,url:t,data:(n||{}).data}))}}),$.forEach(["post","put","patch"],function(e){function t(t){return function(n,r,o){return this.request(Fe(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}at.prototype[e]=t(),at.prototype[e+"Form"]=t(!0)});const ct={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(ct).forEach(([e,t])=>{ct[t]=e});const lt=function e(t){const n=new at(t),o=r(at.prototype.request,n);return $.extend(o,at.prototype,n,{allOwnKeys:!0}),$.extend(o,n,null,{allOwnKeys:!0}),o.create=function(n){return e(Fe(t,n))},o}(be);lt.Axios=at,lt.CanceledError=Ae,lt.CancelToken=class e{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(e){t=e});const n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t;const r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,o){n.reason||(n.reason=new Ae(e,r,o),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e(function(e){t=e}),cancel:t}}},lt.isCancel=Te,lt.VERSION=nt,lt.toFormData=te,lt.AxiosError=W,lt.Cancel=lt.CanceledError,lt.all=function(e){return Promise.all(e)},lt.spread=function(e){return function(t){return e.apply(null,t)}},lt.isAxiosError=function(e){return $.isObject(e)&&!0===e.isAxiosError},lt.mergeConfig=Fe,lt.AxiosHeaders=Se,lt.formToJSON=e=>ge($.isHTMLForm(e)?new FormData(e):e),lt.getAdapter=Ye,lt.HttpStatusCode=ct,lt.default=lt;const{Axios:ut,AxiosError:dt,CanceledError:ft,isCancel:ht,CancelToken:pt,VERSION:mt,all:gt,Cancel:bt,isAxiosError:yt,spread:wt,toFormData:Et,AxiosHeaders:Ot,HttpStatusCode:Rt,formToJSON:St,getAdapter:vt,mergeConfig:Tt}=lt;class At{constructor(){this.interceptorsSetup=!1,this.axiosInstance=lt.create()}async send(e){const t=jt.getInstance().config;this.interceptorsSetup||(this.setupInterceptors(),this.interceptorsSetup=!0);try{const n={...this.getDefaultConfig(t),...this.convertToAxiosConfig(e)},r=await this.axiosInstance.request(n);return this.convertResponse(r)}catch(e){throw this.handleError(e)}}setupInterceptors(){this.axiosInstance.interceptors.request.use(e=>e,e=>Promise.reject(e)),this.axiosInstance.interceptors.response.use(e=>e,e=>Promise.reject(e))}getDefaultConfig(e){const t={},n=e.get("request.baseURL");n&&(t.baseURL=n);const r=e.get("request.timeout");r&&(t.timeout=r);const o=e.get("request.headers");return o&&(t.headers=o),t}convertToAxiosConfig(e){const t={url:e.url,method:e.method||"GET",timeout:e.timeout};return e.header&&Object.keys(e.header).length>0&&(t.headers=e.header),e.params&&Object.keys(e.params).length>0&&(t.params=e.params),e.data&&Object.keys(e.data).length>0&&(t.data=e.data),t}convertResponse(e){return{data:e.data,status:e.status,statusText:e.statusText,headers:e.headers,config:{url:e.config.url,method:e.config.method,timeout:e.config.timeout}}}handleError(e){if(e.response){const t=`请求失败: ${e.response.status} ${e.response.statusText}`;return new Error(t)}return e.request?new Error("网络请求超时或无法连接到服务器"):new Error(`请求配置错误: ${e.message}`)}async get(e,t){return this.send({url:e,method:"GET",header:(null==t?void 0:t.header)||{},params:(null==t?void 0:t.params)||{},data:(null==t?void 0:t.data)||{},timeout:null==t?void 0:t.timeout})}async post(e,t,n){return this.send({url:e,method:"POST",header:(null==n?void 0:n.header)||{},params:(null==n?void 0:n.params)||{},data:t||{},timeout:null==n?void 0:n.timeout})}async put(e,t,n){return this.send({url:e,method:"PUT",header:(null==n?void 0:n.header)||{},params:(null==n?void 0:n.params)||{},data:t||{},timeout:null==n?void 0:n.timeout})}async delete(e,t){return this.send({url:e,method:"DELETE",header:(null==t?void 0:t.header)||{},params:(null==t?void 0:t.params)||{},data:(null==t?void 0:t.data)||{},timeout:null==t?void 0:t.timeout})}async patch(e,t,n){return this.send({url:e,method:"PATCH",header:(null==n?void 0:n.header)||{},params:(null==n?void 0:n.params)||{},data:t||{},timeout:null==n?void 0:n.timeout})}}class jt{constructor(){this.config=new t,this.request=new At,this.logger=new n}injection(e,t){switch(e){case"request":this.request=t;break;case"logger":this.logger=t;break;default:console.warn(`Unknown module: ${e}`)}}static getInstance(){return jt._applicationInstance||(jt._applicationInstance=new jt),jt._applicationInstance}}const xt=jt.getInstance();xt.config.set("app",{logger:{enabled:!0},request:{baseURL:"",method:"GET",header:{"Content-Type":"application/json",Accept:"application/json"},params:{},data:{},timeout:1e4,enableRequestLog:!0,enableResponseLog:!0,retryCount:3,retryDelay:1e3}}),"undefined"!=typeof window&&(window.Kivii=xt);const Ct=e=>{e.config.globalProperties.$Kivii=xt,e.provide("Kivii",xt),window.Kivii=xt};var Nt={install:Ct,Kivii:xt};e.Kivii=xt,e.default=Nt,e.install=Ct,Object.defineProperty(e,"__esModule",{value:!0})});
|
|
2
2
|
//# sourceMappingURL=kivii.bridge.min.js.map
|