@jctrans-materials/shared 1.0.5 → 1.0.7

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 ADDED
@@ -0,0 +1,236 @@
1
+ # 地理位置搜索 SDK
2
+
3
+ 该 SDK 提供了一套统一的地理位置(国家、地区、城市、港口、机场、码头等)搜索与查询能力,支持 axios/fetch 双请求适配器、多语言适配、动态配置管理,可快速集成到各类前端项目中。
4
+
5
+ ## 特性
6
+
7
+ - 🗺️ 覆盖多类型地理实体:国家/地区、省份、城市、港口、机场、码头等
8
+ - 🔌 双请求适配器:支持 Axios / Fetch 两种请求方式
9
+ - 🌐 多语言适配:自动识别中英文环境,生成对应展示文本
10
+ - ⚙️ 动态配置:支持运行时修改请求地址,适配多环境(开发/测试/生产)
11
+ - 📦 类型完备:基于 TypeScript 开发,提供完整的类型定义
12
+ - 🚀 事件总线:内置全局模态框事件通信能力
13
+
14
+ ## 安装
15
+
16
+ ### npm
17
+
18
+ ```bash
19
+ npm install @jctrans-materials/shared --save
20
+ ```
21
+
22
+ ### yarn
23
+
24
+ ```bash
25
+ yarn add @jctrans-materials/shared
26
+ ```
27
+
28
+ ### pnpm
29
+
30
+ ```bash
31
+ pnpm add @jctrans-materials/shared
32
+ ```
33
+
34
+ ## 快速开始
35
+
36
+ ### 1. 初始化配置(可选)
37
+
38
+ 默认使用测试环境地址,可在项目入口处初始化自定义配置:
39
+
40
+ ```typescript
41
+ import { initSharedConfig } from "@jctrans-materials/shared";
42
+
43
+ // 初始化自定义配置
44
+ initSharedConfig({
45
+ prefixPath: "https://api-production.jctrans.com", // 生产环境域名
46
+ searchPath: "/system/dms/fr/aggr/getLocationOptions", // 接口路径
47
+ });
48
+ ```
49
+
50
+ ### 2. 切换请求适配器(可选)
51
+
52
+ 默认使用 Axios 适配器,可切换为 Fetch:
53
+
54
+ ```typescript
55
+ import { createRequest } from "@jctrans-materials/shared";
56
+
57
+ // 切换为 Fetch 适配器
58
+ createRequest("fetch", {
59
+ fetch: window.fetch, // 可传入自定义 fetch 实现(如 node-fetch)
60
+ });
61
+ ```
62
+
63
+ ### 3. 基础使用示例
64
+
65
+ #### 搜索国家
66
+
67
+ ```typescript
68
+ import { searchCountryByName } from "@jctrans-materials/shared";
69
+
70
+ // 搜索名称包含"中国"的国家
71
+ const result = await searchCountryByName("中国", {
72
+ page: 1,
73
+ size: 10,
74
+ });
75
+ console.log(result.records); // 归一化后的国家列表
76
+ ```
77
+
78
+ #### 按ID查询城市
79
+
80
+ ```typescript
81
+ import { getById } from "@jctrans-materials/shared";
82
+
83
+ // 查询 ID 为 1001 的城市
84
+ const city = await getById("City", 1001);
85
+ console.log(city); // 城市详情
86
+ ```
87
+
88
+ #### 获取指定国家下的所有城市
89
+
90
+ ```typescript
91
+ import { getCitiesByCountry } from "@jctrans-materials/shared";
92
+
93
+ // 获取国家 ID 为 1 的所有城市
94
+ const cities = await getCitiesByCountry(1, {
95
+ page: 1,
96
+ size: 100,
97
+ });
98
+ console.log(cities.records);
99
+ ```
100
+
101
+ #### 使用 V2 版本接口(推荐)
102
+
103
+ ```typescript
104
+ import { locationSearchV2 } from "@jctrans-materials/shared";
105
+
106
+ // 搜索港口
107
+ const seaports = await locationSearchV2.seaport.searchByName({
108
+ keyword: "上海",
109
+ countryId: 1,
110
+ current: 1,
111
+ size: 10,
112
+ });
113
+ console.log(seaports.records);
114
+ ```
115
+
116
+ ## 核心 API 文档
117
+
118
+ ### 配置管理
119
+
120
+ | 方法 | 说明 | 类型 |
121
+ | ------------------ | ---------------------- | -------------------------------------------- |
122
+ | `initSharedConfig` | 初始化全局配置 | `(newConfig: Partial<SharedConfig>) => void` |
123
+ | `getSharedConfig` | 获取当前配置 | `() => { basePath: string }` |
124
+ | `getIsEn` | 判断当前是否为英文环境 | `() => boolean` |
125
+
126
+ ### 基础搜索(baseSearch)
127
+
128
+ | 方法 | 说明 |
129
+ | --------------------- | ---------------------------------- |
130
+ | `search` | 通用搜索接口(支持多条件、多类型) |
131
+ | `searchByName` | 按名称搜索指定类型地理实体 |
132
+ | `getByIds` | 按类型+ID批量查询 |
133
+ | `getById` | 按类型+单个ID查询 |
134
+ | `getCitiesByCountry` | 获取指定国家下的所有城市 |
135
+ | `getChildrenByCity` | 获取指定城市下的港口/机场 |
136
+ | `searchCountryByName` | 按名称搜索国家 |
137
+ | `searchCityByName` | 按名称搜索城市(支持国家筛选) |
138
+ | `searchSeaportByName` | 按名称搜索港口(支持城市筛选) |
139
+ | `searchAirportByName` | 按名称搜索机场(支持城市筛选) |
140
+
141
+ ### V2 版本搜索(searchV2)
142
+
143
+ `locationSearchV2` 提供更语义化的接口封装:
144
+
145
+ | 子模块 | 方法 | 说明 |
146
+ | --------- | ---------------------------------------------- | -------------------------- |
147
+ | `country` | `searchByName`/`getByIds` | 国家搜索/批量查询 |
148
+ | `region` | `searchByName`/`getByIds` | 地区搜索/批量查询 |
149
+ | `city` | `searchByName`/`getByIds`/`getCitiesByCountry` | 城市搜索/查询/按国家筛选 |
150
+ | `seaport` | `searchByName`/`getByIds` | 港口搜索/批量查询 |
151
+ | `airport` | `searchByName`/`getByIds` | 机场搜索/批量查询 |
152
+ | `wharf` | `getByIds` | 码头批量查询 |
153
+ | - | `searchByIdWithType` | 按类型+ID查询任意地理实体 |
154
+ | - | `getChildrenByCity` | 获取城市下的港口/机场/码头 |
155
+
156
+ ### 请求适配器
157
+
158
+ | 方法 | 说明 |
159
+ | --------------- | ---------------------------------- |
160
+ | `createRequest` | 创建/切换请求适配器(axios/fetch) |
161
+ | `request` | 全局请求实例(get/post方法) |
162
+
163
+ ### 事件总线
164
+
165
+ 用于全局模态框交互:
166
+
167
+ ```typescript
168
+ import { emitter, MODAL_ACTION } from "@jctrans-materials/shared";
169
+
170
+ // 监听模态框打开事件
171
+ emitter.on(MODAL_ACTION.Open, () => {
172
+ console.log("模态框已打开");
173
+ });
174
+
175
+ // 触发模态框关闭事件
176
+ emitter.emit(MODAL_ACTION.Close);
177
+ ```
178
+
179
+ ## 关键类型定义
180
+
181
+ ### 地理实体类型
182
+
183
+ ```typescript
184
+ // baseSearch 支持的类型
185
+ type DisplayInfo =
186
+ | "Continent"
187
+ | "Country"
188
+ | "Province"
189
+ | "City"
190
+ | "Seaport"
191
+ | "Airport";
192
+
193
+ // searchV2 支持的类型(扩展)
194
+ type LocationType = DisplayInfo | "Region" | "Street" | "Town" | "Wharf";
195
+ ```
196
+
197
+ ### 归一化实体结构
198
+
199
+ ```typescript
200
+ interface UnifiedItem {
201
+ id: number | string; // 实体ID
202
+ type: DisplayInfo; // 实体类型
203
+ nameCn?: string; // 中文名称
204
+ nameEn?: string; // 英文名称
205
+ display?: string; // 适配当前语言的展示文本
206
+ continent?: Record<string, any>; // 所属大洲
207
+ country?: Record<string, any>; // 所属国家
208
+ city?: Record<string, any>; // 所属城市
209
+ province?: Record<string, any>; // 所属省份
210
+ raw?: any; // 原始后端数据
211
+ }
212
+ ```
213
+
214
+ ### 请求配置
215
+
216
+ ```typescript
217
+ interface RequestConfig {
218
+ params?: Record<string, any>; // URL参数
219
+ headers?: Record<string, string>; // 请求头
220
+ }
221
+ ```
222
+
223
+ ## 注意事项
224
+
225
+ 1. 接口默认分页:`current=1`(页码)、`size=10`(每页条数)
226
+ 2. 多语言判断优先级:Nuxt Cookie > 浏览器 Cookie > Nuxt SSR 上下文
227
+ 3. 实体展示文本规则:
228
+ - 港口/机场:`名称 (城市, 国家)`
229
+ - 城市/省份:`名称 (国家)`
230
+ - 国家:`名称 (大洲)`
231
+ 4. 请求超时时间(Axios):默认 15000ms
232
+ 5. 重复数据:SDK 内部会自动根据 `type + id` 去重
233
+
234
+ ## 许可证
235
+
236
+ [MIT](根据实际情况修改)
@@ -0,0 +1,8 @@
1
+ export type ReportType = "City" | "Seaport" | "Airport" | "Line";
2
+ export interface reportNewTypeData {
3
+ reportData: string;
4
+ reportType: ReportType;
5
+ countryId: string | number;
6
+ }
7
+ declare function reportNewTypeDataApi(payload: reportNewTypeData): Promise<{}>;
8
+ export { reportNewTypeDataApi };
@@ -1,9 +1,12 @@
1
1
  export interface SharedConfig {
2
2
  prefixPath: string;
3
3
  searchPath: string;
4
+ oldSearchPath: string;
4
5
  }
5
6
  export declare const currentConfig: {
6
7
  readonly basePath: string;
8
+ readonly oldBasePath: string;
9
+ readonly prefixPath: string;
7
10
  };
8
11
  /**
9
12
  * 全局初始化方法,在项目入口调用
@@ -14,6 +17,8 @@ export declare const initSharedConfig: (newConfig: Partial<SharedConfig>) => voi
14
17
  */
15
18
  export declare const getSharedConfig: () => {
16
19
  readonly basePath: string;
20
+ readonly oldBasePath: string;
21
+ readonly prefixPath: string;
17
22
  };
18
23
  /**
19
24
  * 兼容全环境的语言判断方法
package/dist/index.cjs.js CHANGED
@@ -1,6 +1,6 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const vt=require("mitt");function rt(e,t){return function(){return e.apply(t,arguments)}}const{toString:zt}=Object.prototype,{getPrototypeOf:Ne}=Object,{iterator:de,toStringTag:st}=Symbol,fe=(e=>t=>{const n=zt.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),x=e=>(e=e.toLowerCase(),t=>fe(t)===e),pe=e=>t=>typeof t===e,{isArray:V}=Array,J=pe("undefined");function Q(e){return e!==null&&!J(e)&&e.constructor!==null&&!J(e.constructor)&&O(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const ot=x("ArrayBuffer");function qt(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&ot(e.buffer),t}const jt=pe("string"),O=pe("function"),it=pe("number"),Y=e=>e!==null&&typeof e=="object",$t=e=>e===!0||e===!1,ie=e=>{if(fe(e)!=="object")return!1;const t=Ne(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(st in e)&&!(de in e)},Mt=e=>{if(!Y(e)||Q(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Ht=x("Date"),Jt=x("File"),Vt=x("Blob"),Wt=x("FileList"),Kt=e=>Y(e)&&O(e.pipe),Xt=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||O(e.append)&&((t=fe(e))==="formdata"||t==="object"&&O(e.toString)&&e.toString()==="[object FormData]"))},Gt=x("URLSearchParams"),[Qt,Yt,Zt,en]=["ReadableStream","Request","Response","Headers"].map(x),tn=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Z(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),V(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{if(Q(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let c;for(r=0;r<i;r++)c=o[r],t.call(null,e[c],c,e)}}function at(e,t){if(Q(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r=n.length,s;for(;r-- >0;)if(s=n[r],t===s.toLowerCase())return s;return null}const q=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,ct=e=>!J(e)&&e!==q;function Ce(){const{caseless:e,skipUndefined:t}=ct(this)&&this||{},n={},r=(s,o)=>{const i=e&&at(n,o)||o;ie(n[i])&&ie(s)?n[i]=Ce(n[i],s):ie(s)?n[i]=Ce({},s):V(s)?n[i]=s.slice():(!t||!J(s))&&(n[i]=s)};for(let s=0,o=arguments.length;s<o;s++)arguments[s]&&Z(arguments[s],r);return n}const nn=(e,t,n,{allOwnKeys:r}={})=>(Z(t,(s,o)=>{n&&O(s)?e[o]=rt(s,n):e[o]=s},{allOwnKeys:r}),e),rn=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),sn=(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)},on=(e,t,n,r)=>{let s,o,i;const c={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)i=s[o],(!r||r(i,e,t))&&!c[i]&&(t[i]=e[i],c[i]=!0);e=n!==!1&&Ne(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},an=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},cn=e=>{if(!e)return null;if(V(e))return e;let t=e.length;if(!it(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},un=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Ne(Uint8Array)),ln=(e,t)=>{const r=(e&&e[de]).call(e);let s;for(;(s=r.next())&&!s.done;){const o=s.value;t.call(e,o[0],o[1])}},dn=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},fn=x("HTMLFormElement"),pn=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),je=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),yn=x("RegExp"),ut=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Z(n,(s,o)=>{let i;(i=t(s,o,e))!==!1&&(r[o]=i||s)}),Object.defineProperties(e,r)},hn=e=>{ut(e,(t,n)=>{if(O(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(O(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},mn=(e,t)=>{const n={},r=s=>{s.forEach(o=>{n[o]=!0})};return V(e)?r(e):r(String(e).split(t)),n},gn=()=>{},wn=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Sn(e){return!!(e&&O(e.append)&&e[st]==="FormData"&&e[de])}const bn=e=>{const t=new Array(10),n=(r,s)=>{if(Y(r)){if(t.indexOf(r)>=0)return;if(Q(r))return r;if(!("toJSON"in r)){t[s]=r;const o=V(r)?[]:{};return Z(r,(i,c)=>{const f=n(i,s+1);!J(f)&&(o[c]=f)}),t[s]=void 0,o}}return r};return n(e,0)},En=x("AsyncFunction"),Cn=e=>e&&(Y(e)||O(e))&&O(e.then)&&O(e.catch),lt=((e,t)=>e?setImmediate:t?((n,r)=>(q.addEventListener("message",({source:s,data:o})=>{s===q&&o===n&&r.length&&r.shift()()},!1),s=>{r.push(s),q.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",O(q.postMessage)),An=typeof queueMicrotask<"u"?queueMicrotask.bind(q):typeof process<"u"&&process.nextTick||lt,Rn=e=>e!=null&&O(e[de]),a={isArray:V,isArrayBuffer:ot,isBuffer:Q,isFormData:Xt,isArrayBufferView:qt,isString:jt,isNumber:it,isBoolean:$t,isObject:Y,isPlainObject:ie,isEmptyObject:Mt,isReadableStream:Qt,isRequest:Yt,isResponse:Zt,isHeaders:en,isUndefined:J,isDate:Ht,isFile:Jt,isBlob:Vt,isRegExp:yn,isFunction:O,isStream:Kt,isURLSearchParams:Gt,isTypedArray:un,isFileList:Wt,forEach:Z,merge:Ce,extend:nn,trim:tn,stripBOM:rn,inherits:sn,toFlatObject:on,kindOf:fe,kindOfTest:x,endsWith:an,toArray:cn,forEachEntry:ln,matchAll:dn,isHTMLForm:fn,hasOwnProperty:je,hasOwnProp:je,reduceDescriptors:ut,freezeMethods:hn,toObjectSet:mn,toCamelCase:pn,noop:gn,toFiniteNumber:wn,findKey:at,global:q,isContextDefined:ct,isSpecCompliantForm:Sn,toJSONObject:bn,isAsyncFn:En,isThenable:Cn,setImmediate:lt,asap:An,isIterable:Rn};function m(e,t,n,r,s){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),s&&(this.response=s,this.status=s.status?s.status:null)}a.inherits(m,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:a.toJSONObject(this.config),code:this.code,status:this.status}}});const dt=m.prototype,ft={};["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=>{ft[e]={value:e}});Object.defineProperties(m,ft);Object.defineProperty(dt,"isAxiosError",{value:!0});m.from=(e,t,n,r,s,o)=>{const i=Object.create(dt);a.toFlatObject(e,i,function(l){return l!==Error.prototype},u=>u!=="isAxiosError");const c=e&&e.message?e.message:"Error",f=t==null&&e?e.code:t;return m.call(i,c,f,n,r,s),e&&i.cause==null&&Object.defineProperty(i,"cause",{value:e,configurable:!0}),i.name=e&&e.name||"Error",o&&Object.assign(i,o),i};const On=null;function Ae(e){return a.isPlainObject(e)||a.isArray(e)}function pt(e){return a.endsWith(e,"[]")?e.slice(0,-2):e}function $e(e,t,n){return e?e.concat(t).map(function(s,o){return s=pt(s),!n&&o?"["+s+"]":s}).join(n?".":""):t}function In(e){return a.isArray(e)&&!e.some(Ae)}const Tn=a.toFlatObject(a,{},null,function(t){return/^is[A-Z]/.test(t)});function ye(e,t,n){if(!a.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=a.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(h,y){return!a.isUndefined(y[h])});const r=n.metaTokens,s=n.visitor||l,o=n.dots,i=n.indexes,f=(n.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(t);if(!a.isFunction(s))throw new TypeError("visitor must be a function");function u(d){if(d===null)return"";if(a.isDate(d))return d.toISOString();if(a.isBoolean(d))return d.toString();if(!f&&a.isBlob(d))throw new m("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(d)||a.isTypedArray(d)?f&&typeof Blob=="function"?new Blob([d]):Buffer.from(d):d}function l(d,h,y){let S=d;if(d&&!y&&typeof d=="object"){if(a.endsWith(h,"{}"))h=r?h:h.slice(0,-2),d=JSON.stringify(d);else if(a.isArray(d)&&In(d)||(a.isFileList(d)||a.endsWith(h,"[]"))&&(S=a.toArray(d)))return h=pt(h),S.forEach(function(b,R){!(a.isUndefined(b)||b===null)&&t.append(i===!0?$e([h],R,o):i===null?h:h+"[]",u(b))}),!1}return Ae(d)?!0:(t.append($e(y,h,o),u(d)),!1)}const p=[],g=Object.assign(Tn,{defaultVisitor:l,convertValue:u,isVisitable:Ae});function E(d,h){if(!a.isUndefined(d)){if(p.indexOf(d)!==-1)throw Error("Circular reference detected in "+h.join("."));p.push(d),a.forEach(d,function(S,T){(!(a.isUndefined(S)||S===null)&&s.call(t,S,a.isString(T)?T.trim():T,h,g))===!0&&E(S,h?h.concat(T):[T])}),p.pop()}}if(!a.isObject(e))throw new TypeError("data must be an object");return E(e),t}function Me(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Pe(e,t){this._pairs=[],e&&ye(e,this,t)}const yt=Pe.prototype;yt.append=function(t,n){this._pairs.push([t,n])};yt.toString=function(t){const n=t?function(r){return t.call(this,r,Me)}:Me;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function Nn(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function ht(e,t,n){if(!t)return e;const r=n&&n.encode||Nn;a.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let o;if(s?o=s(t,n):o=a.isURLSearchParams(t)?t.toString():new Pe(t,n).toString(r),o){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class He{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){a.forEach(this.handlers,function(r){r!==null&&t(r)})}}const mt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Pn=typeof URLSearchParams<"u"?URLSearchParams:Pe,xn=typeof FormData<"u"?FormData:null,Bn=typeof Blob<"u"?Blob:null,Ln={isBrowser:!0,classes:{URLSearchParams:Pn,FormData:xn,Blob:Bn},protocols:["http","https","file","blob","url","data"]},xe=typeof window<"u"&&typeof document<"u",Re=typeof navigator=="object"&&navigator||void 0,_n=xe&&(!Re||["ReactNative","NativeScript","NS"].indexOf(Re.product)<0),Fn=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",kn=xe&&window.location.href||"http://localhost",Un=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:xe,hasStandardBrowserEnv:_n,hasStandardBrowserWebWorkerEnv:Fn,navigator:Re,origin:kn},Symbol.toStringTag,{value:"Module"})),C={...Un,...Ln};function Dn(e,t){return ye(e,new C.classes.URLSearchParams,{visitor:function(n,r,s,o){return C.isNode&&a.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}function vn(e){return a.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function zn(e){const t={},n=Object.keys(e);let r;const s=n.length;let o;for(r=0;r<s;r++)o=n[r],t[o]=e[o];return t}function gt(e){function t(n,r,s,o){let i=n[o++];if(i==="__proto__")return!0;const c=Number.isFinite(+i),f=o>=n.length;return i=!i&&a.isArray(s)?s.length:i,f?(a.hasOwnProp(s,i)?s[i]=[s[i],r]:s[i]=r,!c):((!s[i]||!a.isObject(s[i]))&&(s[i]=[]),t(n,r,s[i],o)&&a.isArray(s[i])&&(s[i]=zn(s[i])),!c)}if(a.isFormData(e)&&a.isFunction(e.entries)){const n={};return a.forEachEntry(e,(r,s)=>{t(vn(r),s,n,0)}),n}return null}function qn(e,t,n){if(a.isString(e))try{return(t||JSON.parse)(e),a.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const ee={transitional:mt,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,o=a.isObject(t);if(o&&a.isHTMLForm(t)&&(t=new FormData(t)),a.isFormData(t))return s?JSON.stringify(gt(t)):t;if(a.isArrayBuffer(t)||a.isBuffer(t)||a.isStream(t)||a.isFile(t)||a.isBlob(t)||a.isReadableStream(t))return t;if(a.isArrayBufferView(t))return t.buffer;if(a.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Dn(t,this.formSerializer).toString();if((c=a.isFileList(t))||r.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return ye(c?{"files[]":t}:t,f&&new f,this.formSerializer)}}return o||s?(n.setContentType("application/json",!1),qn(t)):t}],transformResponse:[function(t){const n=this.transitional||ee.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(a.isResponse(t)||a.isReadableStream(t))return t;if(t&&a.isString(t)&&(r&&!this.responseType||s)){const i=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t,this.parseReviver)}catch(c){if(i)throw c.name==="SyntaxError"?m.from(c,m.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:C.classes.FormData,Blob:C.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};a.forEach(["delete","get","head","post","put","patch"],e=>{ee.headers[e]={}});const jn=a.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"]),$n=e=>{const t={};let n,r,s;return e&&e.split(`
2
- `).forEach(function(i){s=i.indexOf(":"),n=i.substring(0,s).trim().toLowerCase(),r=i.substring(s+1).trim(),!(!n||t[n]&&jn[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},Je=Symbol("internals");function X(e){return e&&String(e).trim().toLowerCase()}function ae(e){return e===!1||e==null?e:a.isArray(e)?e.map(ae):String(e)}function Mn(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}const Hn=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function we(e,t,n,r,s){if(a.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!a.isString(t)){if(a.isString(r))return t.indexOf(r)!==-1;if(a.isRegExp(r))return r.test(t)}}function Jn(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function Vn(e,t){const n=a.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,o,i){return this[r].call(this,t,s,o,i)},configurable:!0})})}let I=class{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function o(c,f,u){const l=X(f);if(!l)throw new Error("header name must be a non-empty string");const p=a.findKey(s,l);(!p||s[p]===void 0||u===!0||u===void 0&&s[p]!==!1)&&(s[p||f]=ae(c))}const i=(c,f)=>a.forEach(c,(u,l)=>o(u,l,f));if(a.isPlainObject(t)||t instanceof this.constructor)i(t,n);else if(a.isString(t)&&(t=t.trim())&&!Hn(t))i($n(t),n);else if(a.isObject(t)&&a.isIterable(t)){let c={},f,u;for(const l of t){if(!a.isArray(l))throw TypeError("Object iterator must return a key-value pair");c[u=l[0]]=(f=c[u])?a.isArray(f)?[...f,l[1]]:[f,l[1]]:l[1]}i(c,n)}else t!=null&&o(n,t,r);return this}get(t,n){if(t=X(t),t){const r=a.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return Mn(s);if(a.isFunction(n))return n.call(this,s,r);if(a.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=X(t),t){const r=a.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||we(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function o(i){if(i=X(i),i){const c=a.findKey(r,i);c&&(!n||we(r,r[c],c,n))&&(delete r[c],s=!0)}}return a.isArray(t)?t.forEach(o):o(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const o=n[r];(!t||we(this,this[o],o,t,!0))&&(delete this[o],s=!0)}return s}normalize(t){const n=this,r={};return a.forEach(this,(s,o)=>{const i=a.findKey(r,o);if(i){n[i]=ae(s),delete n[o];return}const c=t?Jn(o):String(o).trim();c!==o&&delete n[o],n[c]=ae(s),r[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return a.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&a.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
3
- `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[Je]=this[Je]={accessors:{}}).accessors,s=this.prototype;function o(i){const c=X(i);r[c]||(Vn(s,i),r[c]=!0)}return a.isArray(t)?t.forEach(o):o(t),this}};I.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);a.reduceDescriptors(I.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});a.freezeMethods(I);function Se(e,t){const n=this||ee,r=t||n,s=I.from(r.headers);let o=r.data;return a.forEach(e,function(c){o=c.call(n,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function wt(e){return!!(e&&e.__CANCEL__)}function W(e,t,n){m.call(this,e??"canceled",m.ERR_CANCELED,t,n),this.name="CanceledError"}a.inherits(W,m,{__CANCEL__:!0});function St(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new m("Request failed with status code "+n.status,[m.ERR_BAD_REQUEST,m.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Wn(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Kn(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,o=0,i;return t=t!==void 0?t:1e3,function(f){const u=Date.now(),l=r[o];i||(i=u),n[s]=f,r[s]=u;let p=o,g=0;for(;p!==s;)g+=n[p++],p=p%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),u-i<t)return;const E=l&&u-l;return E?Math.round(g*1e3/E):void 0}}function Xn(e,t){let n=0,r=1e3/t,s,o;const i=(u,l=Date.now())=>{n=l,s=null,o&&(clearTimeout(o),o=null),e(...u)};return[(...u)=>{const l=Date.now(),p=l-n;p>=r?i(u,l):(s=u,o||(o=setTimeout(()=>{o=null,i(s)},r-p)))},()=>s&&i(s)]}const ue=(e,t,n=3)=>{let r=0;const s=Kn(50,250);return Xn(o=>{const i=o.loaded,c=o.lengthComputable?o.total:void 0,f=i-r,u=s(f),l=i<=c;r=i;const p={loaded:i,total:c,progress:c?i/c:void 0,bytes:f,rate:u||void 0,estimated:u&&c&&l?(c-i)/u:void 0,event:o,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(p)},n)},Ve=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},We=e=>(...t)=>a.asap(()=>e(...t)),Gn=C.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,C.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(C.origin),C.navigator&&/(msie|trident)/i.test(C.navigator.userAgent)):()=>!0,Qn=C.hasStandardBrowserEnv?{write(e,t,n,r,s,o,i){if(typeof document>"u")return;const c=[`${e}=${encodeURIComponent(t)}`];a.isNumber(n)&&c.push(`expires=${new Date(n).toUTCString()}`),a.isString(r)&&c.push(`path=${r}`),a.isString(s)&&c.push(`domain=${s}`),o===!0&&c.push("secure"),a.isString(i)&&c.push(`SameSite=${i}`),document.cookie=c.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Yn(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Zn(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function bt(e,t,n){let r=!Yn(t);return e&&(r||n==!1)?Zn(e,t):t}const Ke=e=>e instanceof I?{...e}:e;function $(e,t){t=t||{};const n={};function r(u,l,p,g){return a.isPlainObject(u)&&a.isPlainObject(l)?a.merge.call({caseless:g},u,l):a.isPlainObject(l)?a.merge({},l):a.isArray(l)?l.slice():l}function s(u,l,p,g){if(a.isUndefined(l)){if(!a.isUndefined(u))return r(void 0,u,p,g)}else return r(u,l,p,g)}function o(u,l){if(!a.isUndefined(l))return r(void 0,l)}function i(u,l){if(a.isUndefined(l)){if(!a.isUndefined(u))return r(void 0,u)}else return r(void 0,l)}function c(u,l,p){if(p in t)return r(u,l);if(p in e)return r(void 0,u)}const f={url:o,method:o,data:o,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:c,headers:(u,l,p)=>s(Ke(u),Ke(l),p,!0)};return a.forEach(Object.keys({...e,...t}),function(l){const p=f[l]||s,g=p(e[l],t[l],l);a.isUndefined(g)&&p!==c||(n[l]=g)}),n}const Et=e=>{const t=$({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:o,headers:i,auth:c}=t;if(t.headers=i=I.from(i),t.url=ht(bt(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),c&&i.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),a.isFormData(n)){if(C.hasStandardBrowserEnv||C.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(a.isFunction(n.getHeaders)){const f=n.getHeaders(),u=["content-type","content-length"];Object.entries(f).forEach(([l,p])=>{u.includes(l.toLowerCase())&&i.set(l,p)})}}if(C.hasStandardBrowserEnv&&(r&&a.isFunction(r)&&(r=r(t)),r||r!==!1&&Gn(t.url))){const f=s&&o&&Qn.read(o);f&&i.set(s,f)}return t},er=typeof XMLHttpRequest<"u",tr=er&&function(e){return new Promise(function(n,r){const s=Et(e);let o=s.data;const i=I.from(s.headers).normalize();let{responseType:c,onUploadProgress:f,onDownloadProgress:u}=s,l,p,g,E,d;function h(){E&&E(),d&&d(),s.cancelToken&&s.cancelToken.unsubscribe(l),s.signal&&s.signal.removeEventListener("abort",l)}let y=new XMLHttpRequest;y.open(s.method.toUpperCase(),s.url,!0),y.timeout=s.timeout;function S(){if(!y)return;const b=I.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),P={data:!c||c==="text"||c==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:b,config:e,request:y};St(function(N){n(N),h()},function(N){r(N),h()},P),y=null}"onloadend"in y?y.onloadend=S:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.indexOf("file:")===0)||setTimeout(S)},y.onabort=function(){y&&(r(new m("Request aborted",m.ECONNABORTED,e,y)),y=null)},y.onerror=function(R){const P=R&&R.message?R.message:"Network Error",v=new m(P,m.ERR_NETWORK,e,y);v.event=R||null,r(v),y=null},y.ontimeout=function(){let R=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const P=s.transitional||mt;s.timeoutErrorMessage&&(R=s.timeoutErrorMessage),r(new m(R,P.clarifyTimeoutError?m.ETIMEDOUT:m.ECONNABORTED,e,y)),y=null},o===void 0&&i.setContentType(null),"setRequestHeader"in y&&a.forEach(i.toJSON(),function(R,P){y.setRequestHeader(P,R)}),a.isUndefined(s.withCredentials)||(y.withCredentials=!!s.withCredentials),c&&c!=="json"&&(y.responseType=s.responseType),u&&([g,d]=ue(u,!0),y.addEventListener("progress",g)),f&&y.upload&&([p,E]=ue(f),y.upload.addEventListener("progress",p),y.upload.addEventListener("loadend",E)),(s.cancelToken||s.signal)&&(l=b=>{y&&(r(!b||b.type?new W(null,e,y):b),y.abort(),y=null)},s.cancelToken&&s.cancelToken.subscribe(l),s.signal&&(s.signal.aborted?l():s.signal.addEventListener("abort",l)));const T=Wn(s.url);if(T&&C.protocols.indexOf(T)===-1){r(new m("Unsupported protocol "+T+":",m.ERR_BAD_REQUEST,e));return}y.send(o||null)})},nr=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,s;const o=function(u){if(!s){s=!0,c();const l=u instanceof Error?u:this.reason;r.abort(l instanceof m?l:new W(l instanceof Error?l.message:l))}};let i=t&&setTimeout(()=>{i=null,o(new m(`timeout ${t} of ms exceeded`,m.ETIMEDOUT))},t);const c=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(o):u.removeEventListener("abort",o)}),e=null)};e.forEach(u=>u.addEventListener("abort",o));const{signal:f}=r;return f.unsubscribe=()=>a.asap(c),f}},rr=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,s;for(;r<n;)s=r+t,yield e.slice(r,s),r=s},sr=async function*(e,t){for await(const n of or(e))yield*rr(n,t)},or=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},Xe=(e,t,n,r)=>{const s=sr(e,t);let o=0,i,c=f=>{i||(i=!0,r&&r(f))};return new ReadableStream({async pull(f){try{const{done:u,value:l}=await s.next();if(u){c(),f.close();return}let p=l.byteLength;if(n){let g=o+=p;n(g)}f.enqueue(new Uint8Array(l))}catch(u){throw c(u),u}},cancel(f){return c(f),s.return()}},{highWaterMark:2})},Ge=64*1024,{isFunction:oe}=a,ir=(({Request:e,Response:t})=>({Request:e,Response:t}))(a.global),{ReadableStream:Qe,TextEncoder:Ye}=a.global,Ze=(e,...t)=>{try{return!!e(...t)}catch{return!1}},ar=e=>{e=a.merge.call({skipUndefined:!0},ir,e);const{fetch:t,Request:n,Response:r}=e,s=t?oe(t):typeof fetch=="function",o=oe(n),i=oe(r);if(!s)return!1;const c=s&&oe(Qe),f=s&&(typeof Ye=="function"?(d=>h=>d.encode(h))(new Ye):async d=>new Uint8Array(await new n(d).arrayBuffer())),u=o&&c&&Ze(()=>{let d=!1;const h=new n(C.origin,{body:new Qe,method:"POST",get duplex(){return d=!0,"half"}}).headers.has("Content-Type");return d&&!h}),l=i&&c&&Ze(()=>a.isReadableStream(new r("").body)),p={stream:l&&(d=>d.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(d=>{!p[d]&&(p[d]=(h,y)=>{let S=h&&h[d];if(S)return S.call(h);throw new m(`Response type '${d}' is not supported`,m.ERR_NOT_SUPPORT,y)})});const g=async d=>{if(d==null)return 0;if(a.isBlob(d))return d.size;if(a.isSpecCompliantForm(d))return(await new n(C.origin,{method:"POST",body:d}).arrayBuffer()).byteLength;if(a.isArrayBufferView(d)||a.isArrayBuffer(d))return d.byteLength;if(a.isURLSearchParams(d)&&(d=d+""),a.isString(d))return(await f(d)).byteLength},E=async(d,h)=>{const y=a.toFiniteNumber(d.getContentLength());return y??g(h)};return async d=>{let{url:h,method:y,data:S,signal:T,cancelToken:b,timeout:R,onDownloadProgress:P,onUploadProgress:v,responseType:N,headers:me,withCredentials:ne="same-origin",fetchOptions:ke}=Et(d),Ue=t||fetch;N=N?(N+"").toLowerCase():"text";let re=nr([T,b&&b.toAbortSignal()],R),K=null;const z=re&&re.unsubscribe&&(()=>{re.unsubscribe()});let De;try{if(v&&u&&y!=="get"&&y!=="head"&&(De=await E(me,S))!==0){let D=new n(h,{method:"POST",body:S,duplex:"half"}),M;if(a.isFormData(S)&&(M=D.headers.get("content-type"))&&me.setContentType(M),D.body){const[ge,se]=Ve(De,ue(We(v)));S=Xe(D.body,Ge,ge,se)}}a.isString(ne)||(ne=ne?"include":"omit");const B=o&&"credentials"in n.prototype,ve={...ke,signal:re,method:y.toUpperCase(),headers:me.normalize().toJSON(),body:S,duplex:"half",credentials:B?ne:void 0};K=o&&new n(h,ve);let U=await(o?Ue(K,ke):Ue(h,ve));const ze=l&&(N==="stream"||N==="response");if(l&&(P||ze&&z)){const D={};["status","statusText","headers"].forEach(qe=>{D[qe]=U[qe]});const M=a.toFiniteNumber(U.headers.get("content-length")),[ge,se]=P&&Ve(M,ue(We(P),!0))||[];U=new r(Xe(U.body,Ge,ge,()=>{se&&se(),z&&z()}),D)}N=N||"text";let Dt=await p[a.findKey(p,N)||"text"](U,d);return!ze&&z&&z(),await new Promise((D,M)=>{St(D,M,{data:Dt,headers:I.from(U.headers),status:U.status,statusText:U.statusText,config:d,request:K})})}catch(B){throw z&&z(),B&&B.name==="TypeError"&&/Load failed|fetch/i.test(B.message)?Object.assign(new m("Network Error",m.ERR_NETWORK,d,K),{cause:B.cause||B}):m.from(B,B&&B.code,d,K)}}},cr=new Map,Ct=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:s}=t,o=[r,s,n];let i=o.length,c=i,f,u,l=cr;for(;c--;)f=o[c],u=l.get(f),u===void 0&&l.set(f,u=c?new Map:ar(t)),l=u;return u};Ct();const Be={http:On,xhr:tr,fetch:{get:Ct}};a.forEach(Be,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const et=e=>`- ${e}`,ur=e=>a.isFunction(e)||e===null||e===!1;function lr(e,t){e=a.isArray(e)?e:[e];const{length:n}=e;let r,s;const o={};for(let i=0;i<n;i++){r=e[i];let c;if(s=r,!ur(r)&&(s=Be[(c=String(r)).toLowerCase()],s===void 0))throw new m(`Unknown adapter '${c}'`);if(s&&(a.isFunction(s)||(s=s.get(t))))break;o[c||"#"+i]=s}if(!s){const i=Object.entries(o).map(([f,u])=>`adapter ${f} `+(u===!1?"is not supported by the environment":"is not available in the build"));let c=n?i.length>1?`since :
4
- `+i.map(et).join(`
5
- `):" "+et(i[0]):"as no adapter specified";throw new m("There is no suitable adapter to dispatch the request "+c,"ERR_NOT_SUPPORT")}return s}const At={getAdapter:lr,adapters:Be};function be(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new W(null,e)}function tt(e){return be(e),e.headers=I.from(e.headers),e.data=Se.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),At.getAdapter(e.adapter||ee.adapter,e)(e).then(function(r){return be(e),r.data=Se.call(e,e.transformResponse,r),r.headers=I.from(r.headers),r},function(r){return wt(r)||(be(e),r&&r.response&&(r.response.data=Se.call(e,e.transformResponse,r.response),r.response.headers=I.from(r.response.headers))),Promise.reject(r)})}const Rt="1.13.2",he={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{he[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const nt={};he.transitional=function(t,n,r){function s(o,i){return"[Axios v"+Rt+"] Transitional option '"+o+"'"+i+(r?". "+r:"")}return(o,i,c)=>{if(t===!1)throw new m(s(i," has been removed"+(n?" in "+n:"")),m.ERR_DEPRECATED);return n&&!nt[i]&&(nt[i]=!0,console.warn(s(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,i,c):!0}};he.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function dr(e,t,n){if(typeof e!="object")throw new m("options must be an object",m.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const o=r[s],i=t[o];if(i){const c=e[o],f=c===void 0||i(c,o,e);if(f!==!0)throw new m("option "+o+" must be "+f,m.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new m("Unknown option "+o,m.ERR_BAD_OPTION)}}const ce={assertOptions:dr,validators:he},L=ce.validators;let j=class{constructor(t){this.defaults=t||{},this.interceptors={request:new He,response:new He}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const o=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=`
6
- `+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=$(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:o}=n;r!==void 0&&ce.assertOptions(r,{silentJSONParsing:L.transitional(L.boolean),forcedJSONParsing:L.transitional(L.boolean),clarifyTimeoutError:L.transitional(L.boolean)},!1),s!=null&&(a.isFunction(s)?n.paramsSerializer={serialize:s}:ce.assertOptions(s,{encode:L.function,serialize:L.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),ce.assertOptions(n,{baseUrl:L.spelling("baseURL"),withXsrfToken:L.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=o&&a.merge(o.common,o[n.method]);o&&a.forEach(["delete","get","head","post","put","patch","common"],d=>{delete o[d]}),n.headers=I.concat(i,o);const c=[];let f=!0;this.interceptors.request.forEach(function(h){typeof h.runWhen=="function"&&h.runWhen(n)===!1||(f=f&&h.synchronous,c.unshift(h.fulfilled,h.rejected))});const u=[];this.interceptors.response.forEach(function(h){u.push(h.fulfilled,h.rejected)});let l,p=0,g;if(!f){const d=[tt.bind(this),void 0];for(d.unshift(...c),d.push(...u),g=d.length,l=Promise.resolve(n);p<g;)l=l.then(d[p++],d[p++]);return l}g=c.length;let E=n;for(;p<g;){const d=c[p++],h=c[p++];try{E=d(E)}catch(y){h.call(this,y);break}}try{l=tt.call(this,E)}catch(d){return Promise.reject(d)}for(p=0,g=u.length;p<g;)l=l.then(u[p++],u[p++]);return l}getUri(t){t=$(this.defaults,t);const n=bt(t.baseURL,t.url,t.allowAbsoluteUrls);return ht(n,t.params,t.paramsSerializer)}};a.forEach(["delete","get","head","options"],function(t){j.prototype[t]=function(n,r){return this.request($(r||{},{method:t,url:n,data:(r||{}).data}))}});a.forEach(["post","put","patch"],function(t){function n(r){return function(o,i,c){return this.request($(c||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:i}))}}j.prototype[t]=n(),j.prototype[t+"Form"]=n(!0)});let fr=class Ot{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(s=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](s);r._listeners=null}),this.promise.then=s=>{let o;const i=new Promise(c=>{r.subscribe(c),o=c}).then(s);return i.cancel=function(){r.unsubscribe(o)},i},t(function(o,i,c){r.reason||(r.reason=new W(o,i,c),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Ot(function(s){t=s}),cancel:t}}};function pr(e){return function(n){return e.apply(null,n)}}function yr(e){return a.isObject(e)&&e.isAxiosError===!0}const Oe={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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Oe).forEach(([e,t])=>{Oe[t]=e});function It(e){const t=new j(e),n=rt(j.prototype.request,t);return a.extend(n,j.prototype,t,{allOwnKeys:!0}),a.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return It($(e,s))},n}const w=It(ee);w.Axios=j;w.CanceledError=W;w.CancelToken=fr;w.isCancel=wt;w.VERSION=Rt;w.toFormData=ye;w.AxiosError=m;w.Cancel=w.CanceledError;w.all=function(t){return Promise.all(t)};w.spread=pr;w.isAxiosError=yr;w.mergeConfig=$;w.AxiosHeaders=I;w.formToJSON=e=>gt(a.isHTMLForm(e)?new FormData(e):e);w.getAdapter=At.getAdapter;w.HttpStatusCode=Oe;w.default=w;const{Axios:Vr,AxiosError:Wr,CanceledError:Kr,isCancel:Xr,CancelToken:Gr,VERSION:Qr,all:Yr,Cancel:Zr,isAxiosError:es,spread:ts,toFormData:ns,AxiosHeaders:rs,HttpStatusCode:ss,formToJSON:os,getAdapter:is,mergeConfig:as}=w,Ie=w.create({timeout:15e3});Ie.interceptors.response.use(e=>e,e=>Promise.reject(e));const Tt={async get(e,t){const n=await Ie.get(e,{params:t?.params,headers:t?.headers});return{data:n.data,status:n.status,headers:n.headers}},async post(e,t,n){const r=await Ie.post(e,t,{params:n?.params,headers:n?.headers});return{data:r.data,status:r.status,headers:r.headers}}};function hr(e){return{async get(t,n){const r=n?.params?"?"+new URLSearchParams(n.params).toString():"",s=await e(t+r,{method:"GET",headers:n?.headers});return{data:await s.json(),status:s.status}},async post(t,n,r){const s=r?.params?"?"+new URLSearchParams(r.params).toString():"",o=await e(t+s,{method:"POST",headers:{"Content-Type":"application/json",...r?.headers},body:n?JSON.stringify(n):void 0});return{data:await o.json(),status:o.status}}}}let G=Tt;function mr(e,t){return e==="fetch"?G=hr(t?.fetch??fetch):G=Tt,G}const Nt={get:(...e)=>G.get(...e),post:(...e)=>G.post(...e)},le={prefixPath:"https://cloudapi-sit2.jctrans.net.cn",searchPath:"/system/dms/fr/aggr/getLocationOptions"},Pt={get basePath(){return le.prefixPath+le.searchPath}},gr=e=>{e&&(e.prefixPath!==void 0&&(le.prefixPath=e.prefixPath),e.searchPath!==void 0&&(le.searchPath=e.searchPath))},Le=()=>Pt,_e=()=>{let e;try{typeof useCookie=="function"&&(e=useCookie("jc-language")?.value)}catch{}if(e)return e==="en"||e==="en-US";if(typeof document<"u"){const t=document.cookie||"";return/(^|;\s*)jc-language=en(-US)?(;|$)/.test(t)}try{if(typeof useNuxtApp=="function"){const n=useNuxtApp()?.ssrContext?.event?.node?.req?.headers?.cookie||"";return/(^|;\s*)jc-language=en(-US)?(;|$)/.test(n)}}catch{}return!1},wr=()=>Le().basePath,Sr={Continent:"continentId",Country:"countryId",City:"cityId",Province:"provinceId",Seaport:"seaportId",Airport:"airportId"},br=["City","Seaport","Airport","Country","Region"].filter(Boolean);function H(e,t){return e==="allCityByCountryId"?Array.isArray(t)?String(t[0]):String(t):Array.isArray(t)?JSON.stringify(t):JSON.stringify([Number(t)])}function Er(e){const t=[];if(e.ids)for(const n of e.ids){const r=Sr[n.type];t.push({name:r,val:H(r,n.ids)})}return e.scope&&(e.scope.countryId!==void 0&&e.scope.countryId!==null&&t.push({name:"countryId",val:H("countryId",[e.scope.countryId])}),e.scope.cityId!==void 0&&e.scope.cityId!==null&&t.push({name:"cityId",val:H("cityId",[e.scope.cityId])}),e.scope.provinceId!==void 0&&e.scope.provinceId!==null&&t.push({name:"provinceId",val:H("provinceId",[e.scope.provinceId])})),t}function k(e){const t={current:e.page??1,size:e.size??10,level:e.level,searchContent:e.keyword??void 0,displayInfo:e.displayInfo??br,sort:e.sort},n=Er({ids:e.ids,scope:e.scope});return t.appointSearch=[...n,...e.extraAppoint||[]],Object.keys(t).forEach(r=>{t[r]===void 0&&delete t[r]}),t}function Cr(e,t,n){const r=_e(),s=(u,l)=>{if(!u)return"";const p=u.nameCn??u[`${l.toLowerCase()}NameCn`]??u.name,g=u.nameEn??u[`${l.toLowerCase()}NameEn`];return r?g||p||"":p||g||""},o=s(e,t),i=s(n.country,"country"),c=s(n.city,"city"),f=s(n.continent,"continent");switch(t){case"Seaport":case"Airport":const u=[c,i].filter(Boolean).join(", ");return u?`${o} (${u})`:o;case"City":case"Province":return i?`${o} (${i})`:o;case"Country":return f?`${o} (${f})`:o;default:return o}}function _(e=[],t=[]){const n=[];function r(o,i,c){if(!o||!t.includes(i))return;const f=o.id??o[i.toLowerCase()+"Id"]??null;if(f==null)return;const u=o.nameCn??o[`${i.toLowerCase()}NameCn`]??o.name??void 0,l=o.nameEn??o[`${i.toLowerCase()}NameEn`]??void 0,p=Cr(o,i,c)||u||l||"";n.push({id:f,type:i,nameCn:u,nameEn:l,display:p,continent:c.continent??void 0,country:c.country??void 0,city:c.city??void 0,province:c.province??void 0,raw:o})}for(const o of e){const i={continent:o.continent??void 0,country:o.country??void 0,city:o.city??void 0,province:o.province??void 0};let c=!1;if(["Continent","Country","Province","City","Seaport","Airport"].forEach(u=>{const l=u.toLowerCase();o[l]&&(r(o[l],u,i),c=!0)}),!c&&o.id!==void 0){let u;o.type&&t.includes(o.type)?u=o.type:t.length===1&&(u=t[0]),u&&r(o,u,i)}}const s=new Set;return n.filter(o=>{const i=`${o.type}_${o.id}`;return s.has(i)?!1:(s.add(i),!0)})}async function F(e){return(await Nt.post(wr(),e)).data}async function te(e){const t=k({keyword:e.keyword,displayInfo:e.displayInfo,page:e.page,size:e.size,level:e.level,sort:e.sort,ids:e.ids,scope:e.scope,extraAppoint:e.extraAppoint}),n=await F(t),r=_(n.data?.records||[],t.displayInfo||[]);return{...n,records:r}}async function Fe(e){if(!e.keyword?.trim())throw new Error("searchByName: keyword 不能为空");const t=e.types&&e.types.length>0?e.types:["Continent","Country","City","Province","Seaport","Airport"];return te({keyword:e.keyword.trim(),displayInfo:t,page:e.page,size:e.size,level:e.level,sort:e.sort})}async function xt(e,t){const n=Array.isArray(t)?t:[t],r=[e],s=k({displayInfo:r,ids:[{type:e,ids:n}]}),o=await F(s);return _(o.records||[],r).filter(c=>c.type===e)}async function Ar(e,t){return(await xt(e,[t]))[0]??null}async function Rr(e,t){const n=["City"],r=k({displayInfo:n,page:t?.page??1,size:t?.size??1e3,extraAppoint:[{name:"allCityByCountryId",val:H("allCityByCountryId",e)}]}),s=await F(r);return{...s,records:_(s.records||[],n)}}async function Or(e,t,n){if(!t||t.length===0)throw new Error("childTypes 必须至少包含一个:Seaport | Airport");const r=t,s=k({displayInfo:r,page:n?.page??1,size:n?.size??1e3,extraAppoint:[{name:"cityId",val:H("cityId",[e])}]}),o=await F(s);return{...o,records:_(o.records||[],r)}}function Ir(e,t){return Fe({keyword:e,types:["Country"],page:t?.page,size:t?.size})}function Tr(e,t){return t?.countryId?te({keyword:e,displayInfo:["City"],scope:{countryId:t.countryId},page:t.page,size:t.size}):Fe({keyword:e,types:["City"],page:t?.page,size:t?.size})}function Nr(e,t){return te({keyword:e,displayInfo:["Seaport"],scope:t?.cityId?{cityId:t.cityId}:void 0,page:t?.page,size:t?.size})}function Pr(e,t){return te({keyword:e,displayInfo:["Airport"],scope:t?.cityId?{cityId:t.cityId}:void 0,page:t?.page,size:t?.size})}async function xr(e={}){const t=["Continent"],n=await F({current:e.page??1,size:e.size??10,level:1,displayInfo:t});return{...n,records:_(n.records||[],t)}}async function Br(e={}){const t=["Country"],n=k({displayInfo:t,page:e.page??1,size:e.size??10,ids:e.ids?[{type:"Country",ids:e.ids}]:void 0}),r=await F(n);return{...r,records:_(r.records||[],t)}}async function Lr(e={}){const t=["City"],n=k({displayInfo:t,page:e.page??1,size:e.size??10,ids:e.ids?[{type:"City",ids:e.ids}]:void 0,scope:e.countryId?{countryId:e.countryId}:void 0}),r=await F(n);return{...r,records:_(r.records||[],t)}}async function _r(e={}){const t=["Province"],n=k({displayInfo:t,page:e.page??1,size:e.size??10,ids:e.ids?[{type:"Province",ids:e.ids}]:void 0,scope:e.countryId?{countryId:e.countryId}:void 0}),r=await F(n);return{...r,records:_(r.records||[],t)}}async function Fr(e={}){const t=["Seaport"],n=k({displayInfo:t,page:e.page??1,size:e.size??10,ids:e.ids?[{type:"Seaport",ids:e.ids}]:void 0,scope:e.cityId?{cityId:e.cityId}:e.countryId?{countryId:e.countryId}:void 0}),r=await F(n);return{...r,records:_(r.records||[],t)}}async function kr(e={}){const t=["Airport"],n=k({displayInfo:t,page:e.page??1,size:e.size??10,ids:e.ids?[{type:"Airport",ids:e.ids}]:void 0,scope:e.cityId?{cityId:e.cityId}:e.countryId?{countryId:e.countryId}:void 0}),r=await F(n);return{...r,records:_(r.records||[],t)}}const Ur="2.0",Dr=()=>Le().basePath;function Bt(e){let t=e.type;return t==="Country"&&e.region&&!e.country?{target:e.region,finalType:"Region"}:{target:e[t.toLowerCase()]||{},finalType:t}}function Ee(e,t){const{target:n,finalType:r}=Bt(e),s=u=>{if(!u)return"";const l=u.nameCn||u.displayNameCn||u.name||"",p=u.nameEn||u.displayNameEn||u.nameEnShow||"";return t?p||l:l||p},o=s(n),i=e.country||e.region,c=s(i),f=s(e.city);if(["Seaport","Airport","Wharf"].includes(r)){const u=[f,c].filter(Boolean).join(", ");return u?`${o} (${u})`:o}return["City","Province"].includes(r)&&c?`${o} (${c})`:o}function vr(e=[]){return e.map(t=>{const{target:n,finalType:r}=Bt(t);return{id:n.id??t.id,type:r,nameCn:n.nameCn||n.name,nameEn:n.nameEn||n.nameEnShow,display:Ee(t,_e()),displayEn:Ee(t,!0),displayCn:Ee(t,!1),raw:t}})}async function A(e){const t={current:1,size:10,...e},r=(await Nt.post(Dr(),t)).data.data||{};return{...r,records:vr(r.records||[])}}const Lt={searchByName:e=>A({searchContent:e.keyword,searchMode:e.searchMode,...e,displayInfo:["Country"]}),getByIds:e=>A({countryIds:e,displayInfo:["Country"]})},_t={searchByName:e=>A({searchContent:e.keyword,searchMode:e.searchMode,...e,displayInfo:["Country"]}),getByIds:e=>A({countryIds:e,displayInfo:["Country"]})},Te={searchByName:e=>A({searchContent:e.keyword,countryIds:e.countryId?[e.countryId]:void 0,...e,displayInfo:["City"]}),getByIds:e=>A({cityIds:e,displayInfo:["City"]}),getCitiesByCountry:(e,t)=>A({countryIds:[e],displayInfo:["City"],...t})},Ft={searchByName:e=>A({searchContent:e.keyword,cityIds:e.cityId?[e.cityId]:void 0,countryIds:e.countryId?[e.countryId]:void 0,...e,displayInfo:["Seaport"]}),getByIds:e=>A({seaportIds:e,displayInfo:["Seaport"]})},kt={searchByName:e=>A({searchContent:e.keyword,countryIds:e.countryId?[e.countryId]:void 0,...e,displayInfo:["Airport"]}),getByIds:e=>A({airportIds:e,displayInfo:["Airport"]})},Ut={getByIds:e=>A({wharfIds:e,displayInfo:["Wharf"]})},zr=e=>A({searchContent:e.keyword,...e}),qr=(e,t)=>{const n=Array.isArray(e)?e:[e];switch(t){case"Country":return Lt.getByIds(n);case"Region":return _t.getByIds(n);case"City":return Te.getByIds(n);case"Seaport":return Ft.getByIds(n);case"Airport":return kt.getByIds(n);case"Wharf":return Ut.getByIds(n);default:return A({[`${t.toLowerCase()}Ids`]:n,displayInfo:[t]})}},jr={SEARCH_VERSION:Ur,searchByName:zr,searchByIdWithType:qr,country:Lt,region:_t,city:Te,seaport:Ft,airport:kt,wharf:Ut,getCitiesByCountry:Te.getCitiesByCountry,getChildrenByCity:(e,t,n)=>A({cityIds:[e],displayInfo:t,...n})},$r={Open:"GLOBAL_MODAL_OPEN",Close:"GLOBAL_MODAL_CLOSE",Submit:"GLOBAL_MODAL_SUBMIT"},Mr=vt();exports.MODAL_ACTION=$r;exports.createRequest=mr;exports.currentConfig=Pt;exports.emitter=Mr;exports.getAirport=kr;exports.getById=Ar;exports.getByIds=xt;exports.getChildrenByCity=Or;exports.getCitiesByCountry=Rr;exports.getCity=Lr;exports.getContinent=xr;exports.getCountry=Br;exports.getIsEn=_e;exports.getProvince=_r;exports.getSeaport=Fr;exports.getSharedConfig=Le;exports.initSharedConfig=gr;exports.locationSearchV2=jr;exports.search=te;exports.searchAirportByName=Pr;exports.searchByName=Fe;exports.searchCityByName=Tr;exports.searchCountryByName=Ir;exports.searchSeaportByName=Nr;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const vt=require("mitt");function st(e,t){return function(){return e.apply(t,arguments)}}const{toString:zt}=Object.prototype,{getPrototypeOf:Pe}=Object,{iterator:de,toStringTag:ot}=Symbol,fe=(e=>t=>{const n=zt.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),x=e=>(e=e.toLowerCase(),t=>fe(t)===e),pe=e=>t=>typeof t===e,{isArray:W}=Array,V=pe("undefined");function Y(e){return e!==null&&!V(e)&&e.constructor!==null&&!V(e.constructor)&&O(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const it=x("ArrayBuffer");function qt(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&it(e.buffer),t}const jt=pe("string"),O=pe("function"),at=pe("number"),Z=e=>e!==null&&typeof e=="object",$t=e=>e===!0||e===!1,ae=e=>{if(fe(e)!=="object")return!1;const t=Pe(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(ot in e)&&!(de in e)},Mt=e=>{if(!Z(e)||Y(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Ht=x("Date"),Jt=x("File"),Vt=x("Blob"),Wt=x("FileList"),Kt=e=>Z(e)&&O(e.pipe),Xt=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||O(e.append)&&((t=fe(e))==="formdata"||t==="object"&&O(e.toString)&&e.toString()==="[object FormData]"))},Gt=x("URLSearchParams"),[Qt,Yt,Zt,en]=["ReadableStream","Request","Response","Headers"].map(x),tn=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ee(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),W(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{if(Y(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let c;for(r=0;r<i;r++)c=o[r],t.call(null,e[c],c,e)}}function ct(e,t){if(Y(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r=n.length,s;for(;r-- >0;)if(s=n[r],t===s.toLowerCase())return s;return null}const j=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,ut=e=>!V(e)&&e!==j;function Ae(){const{caseless:e,skipUndefined:t}=ut(this)&&this||{},n={},r=(s,o)=>{const i=e&&ct(n,o)||o;ae(n[i])&&ae(s)?n[i]=Ae(n[i],s):ae(s)?n[i]=Ae({},s):W(s)?n[i]=s.slice():(!t||!V(s))&&(n[i]=s)};for(let s=0,o=arguments.length;s<o;s++)arguments[s]&&ee(arguments[s],r);return n}const nn=(e,t,n,{allOwnKeys:r}={})=>(ee(t,(s,o)=>{n&&O(s)?e[o]=st(s,n):e[o]=s},{allOwnKeys:r}),e),rn=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),sn=(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)},on=(e,t,n,r)=>{let s,o,i;const c={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)i=s[o],(!r||r(i,e,t))&&!c[i]&&(t[i]=e[i],c[i]=!0);e=n!==!1&&Pe(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},an=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},cn=e=>{if(!e)return null;if(W(e))return e;let t=e.length;if(!at(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},un=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Pe(Uint8Array)),ln=(e,t)=>{const r=(e&&e[de]).call(e);let s;for(;(s=r.next())&&!s.done;){const o=s.value;t.call(e,o[0],o[1])}},dn=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},fn=x("HTMLFormElement"),pn=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),$e=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),hn=x("RegExp"),lt=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};ee(n,(s,o)=>{let i;(i=t(s,o,e))!==!1&&(r[o]=i||s)}),Object.defineProperties(e,r)},yn=e=>{lt(e,(t,n)=>{if(O(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(O(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},mn=(e,t)=>{const n={},r=s=>{s.forEach(o=>{n[o]=!0})};return W(e)?r(e):r(String(e).split(t)),n},gn=()=>{},wn=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Sn(e){return!!(e&&O(e.append)&&e[ot]==="FormData"&&e[de])}const bn=e=>{const t=new Array(10),n=(r,s)=>{if(Z(r)){if(t.indexOf(r)>=0)return;if(Y(r))return r;if(!("toJSON"in r)){t[s]=r;const o=W(r)?[]:{};return ee(r,(i,c)=>{const f=n(i,s+1);!V(f)&&(o[c]=f)}),t[s]=void 0,o}}return r};return n(e,0)},En=x("AsyncFunction"),Cn=e=>e&&(Z(e)||O(e))&&O(e.then)&&O(e.catch),dt=((e,t)=>e?setImmediate:t?((n,r)=>(j.addEventListener("message",({source:s,data:o})=>{s===j&&o===n&&r.length&&r.shift()()},!1),s=>{r.push(s),j.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",O(j.postMessage)),An=typeof queueMicrotask<"u"?queueMicrotask.bind(j):typeof process<"u"&&process.nextTick||dt,Rn=e=>e!=null&&O(e[de]),a={isArray:W,isArrayBuffer:it,isBuffer:Y,isFormData:Xt,isArrayBufferView:qt,isString:jt,isNumber:at,isBoolean:$t,isObject:Z,isPlainObject:ae,isEmptyObject:Mt,isReadableStream:Qt,isRequest:Yt,isResponse:Zt,isHeaders:en,isUndefined:V,isDate:Ht,isFile:Jt,isBlob:Vt,isRegExp:hn,isFunction:O,isStream:Kt,isURLSearchParams:Gt,isTypedArray:un,isFileList:Wt,forEach:ee,merge:Ae,extend:nn,trim:tn,stripBOM:rn,inherits:sn,toFlatObject:on,kindOf:fe,kindOfTest:x,endsWith:an,toArray:cn,forEachEntry:ln,matchAll:dn,isHTMLForm:fn,hasOwnProperty:$e,hasOwnProp:$e,reduceDescriptors:lt,freezeMethods:yn,toObjectSet:mn,toCamelCase:pn,noop:gn,toFiniteNumber:wn,findKey:ct,global:j,isContextDefined:ut,isSpecCompliantForm:Sn,toJSONObject:bn,isAsyncFn:En,isThenable:Cn,setImmediate:dt,asap:An,isIterable:Rn};function m(e,t,n,r,s){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),s&&(this.response=s,this.status=s.status?s.status:null)}a.inherits(m,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:a.toJSONObject(this.config),code:this.code,status:this.status}}});const ft=m.prototype,pt={};["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=>{pt[e]={value:e}});Object.defineProperties(m,pt);Object.defineProperty(ft,"isAxiosError",{value:!0});m.from=(e,t,n,r,s,o)=>{const i=Object.create(ft);a.toFlatObject(e,i,function(l){return l!==Error.prototype},u=>u!=="isAxiosError");const c=e&&e.message?e.message:"Error",f=t==null&&e?e.code:t;return m.call(i,c,f,n,r,s),e&&i.cause==null&&Object.defineProperty(i,"cause",{value:e,configurable:!0}),i.name=e&&e.name||"Error",o&&Object.assign(i,o),i};const On=null;function Re(e){return a.isPlainObject(e)||a.isArray(e)}function ht(e){return a.endsWith(e,"[]")?e.slice(0,-2):e}function Me(e,t,n){return e?e.concat(t).map(function(s,o){return s=ht(s),!n&&o?"["+s+"]":s}).join(n?".":""):t}function In(e){return a.isArray(e)&&!e.some(Re)}const Tn=a.toFlatObject(a,{},null,function(t){return/^is[A-Z]/.test(t)});function he(e,t,n){if(!a.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=a.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,h){return!a.isUndefined(h[y])});const r=n.metaTokens,s=n.visitor||l,o=n.dots,i=n.indexes,f=(n.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(t);if(!a.isFunction(s))throw new TypeError("visitor must be a function");function u(d){if(d===null)return"";if(a.isDate(d))return d.toISOString();if(a.isBoolean(d))return d.toString();if(!f&&a.isBlob(d))throw new m("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(d)||a.isTypedArray(d)?f&&typeof Blob=="function"?new Blob([d]):Buffer.from(d):d}function l(d,y,h){let S=d;if(d&&!h&&typeof d=="object"){if(a.endsWith(y,"{}"))y=r?y:y.slice(0,-2),d=JSON.stringify(d);else if(a.isArray(d)&&In(d)||(a.isFileList(d)||a.endsWith(y,"[]"))&&(S=a.toArray(d)))return y=ht(y),S.forEach(function(b,R){!(a.isUndefined(b)||b===null)&&t.append(i===!0?Me([y],R,o):i===null?y:y+"[]",u(b))}),!1}return Re(d)?!0:(t.append(Me(h,y,o),u(d)),!1)}const p=[],g=Object.assign(Tn,{defaultVisitor:l,convertValue:u,isVisitable:Re});function E(d,y){if(!a.isUndefined(d)){if(p.indexOf(d)!==-1)throw Error("Circular reference detected in "+y.join("."));p.push(d),a.forEach(d,function(S,T){(!(a.isUndefined(S)||S===null)&&s.call(t,S,a.isString(T)?T.trim():T,y,g))===!0&&E(S,y?y.concat(T):[T])}),p.pop()}}if(!a.isObject(e))throw new TypeError("data must be an object");return E(e),t}function He(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function xe(e,t){this._pairs=[],e&&he(e,this,t)}const yt=xe.prototype;yt.append=function(t,n){this._pairs.push([t,n])};yt.toString=function(t){const n=t?function(r){return t.call(this,r,He)}:He;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function Nn(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function mt(e,t,n){if(!t)return e;const r=n&&n.encode||Nn;a.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let o;if(s?o=s(t,n):o=a.isURLSearchParams(t)?t.toString():new xe(t,n).toString(r),o){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class Je{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){a.forEach(this.handlers,function(r){r!==null&&t(r)})}}const gt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Pn=typeof URLSearchParams<"u"?URLSearchParams:xe,xn=typeof FormData<"u"?FormData:null,Bn=typeof Blob<"u"?Blob:null,Ln={isBrowser:!0,classes:{URLSearchParams:Pn,FormData:xn,Blob:Bn},protocols:["http","https","file","blob","url","data"]},Be=typeof window<"u"&&typeof document<"u",Oe=typeof navigator=="object"&&navigator||void 0,_n=Be&&(!Oe||["ReactNative","NativeScript","NS"].indexOf(Oe.product)<0),Fn=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",kn=Be&&window.location.href||"http://localhost",Un=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Be,hasStandardBrowserEnv:_n,hasStandardBrowserWebWorkerEnv:Fn,navigator:Oe,origin:kn},Symbol.toStringTag,{value:"Module"})),C={...Un,...Ln};function Dn(e,t){return he(e,new C.classes.URLSearchParams,{visitor:function(n,r,s,o){return C.isNode&&a.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}function vn(e){return a.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function zn(e){const t={},n=Object.keys(e);let r;const s=n.length;let o;for(r=0;r<s;r++)o=n[r],t[o]=e[o];return t}function wt(e){function t(n,r,s,o){let i=n[o++];if(i==="__proto__")return!0;const c=Number.isFinite(+i),f=o>=n.length;return i=!i&&a.isArray(s)?s.length:i,f?(a.hasOwnProp(s,i)?s[i]=[s[i],r]:s[i]=r,!c):((!s[i]||!a.isObject(s[i]))&&(s[i]=[]),t(n,r,s[i],o)&&a.isArray(s[i])&&(s[i]=zn(s[i])),!c)}if(a.isFormData(e)&&a.isFunction(e.entries)){const n={};return a.forEachEntry(e,(r,s)=>{t(vn(r),s,n,0)}),n}return null}function qn(e,t,n){if(a.isString(e))try{return(t||JSON.parse)(e),a.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const te={transitional:gt,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,o=a.isObject(t);if(o&&a.isHTMLForm(t)&&(t=new FormData(t)),a.isFormData(t))return s?JSON.stringify(wt(t)):t;if(a.isArrayBuffer(t)||a.isBuffer(t)||a.isStream(t)||a.isFile(t)||a.isBlob(t)||a.isReadableStream(t))return t;if(a.isArrayBufferView(t))return t.buffer;if(a.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Dn(t,this.formSerializer).toString();if((c=a.isFileList(t))||r.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return he(c?{"files[]":t}:t,f&&new f,this.formSerializer)}}return o||s?(n.setContentType("application/json",!1),qn(t)):t}],transformResponse:[function(t){const n=this.transitional||te.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(a.isResponse(t)||a.isReadableStream(t))return t;if(t&&a.isString(t)&&(r&&!this.responseType||s)){const i=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t,this.parseReviver)}catch(c){if(i)throw c.name==="SyntaxError"?m.from(c,m.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:C.classes.FormData,Blob:C.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};a.forEach(["delete","get","head","post","put","patch"],e=>{te.headers[e]={}});const jn=a.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"]),$n=e=>{const t={};let n,r,s;return e&&e.split(`
2
+ `).forEach(function(i){s=i.indexOf(":"),n=i.substring(0,s).trim().toLowerCase(),r=i.substring(s+1).trim(),!(!n||t[n]&&jn[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},Ve=Symbol("internals");function G(e){return e&&String(e).trim().toLowerCase()}function ce(e){return e===!1||e==null?e:a.isArray(e)?e.map(ce):String(e)}function Mn(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}const Hn=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Se(e,t,n,r,s){if(a.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!a.isString(t)){if(a.isString(r))return t.indexOf(r)!==-1;if(a.isRegExp(r))return r.test(t)}}function Jn(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function Vn(e,t){const n=a.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,o,i){return this[r].call(this,t,s,o,i)},configurable:!0})})}let I=class{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function o(c,f,u){const l=G(f);if(!l)throw new Error("header name must be a non-empty string");const p=a.findKey(s,l);(!p||s[p]===void 0||u===!0||u===void 0&&s[p]!==!1)&&(s[p||f]=ce(c))}const i=(c,f)=>a.forEach(c,(u,l)=>o(u,l,f));if(a.isPlainObject(t)||t instanceof this.constructor)i(t,n);else if(a.isString(t)&&(t=t.trim())&&!Hn(t))i($n(t),n);else if(a.isObject(t)&&a.isIterable(t)){let c={},f,u;for(const l of t){if(!a.isArray(l))throw TypeError("Object iterator must return a key-value pair");c[u=l[0]]=(f=c[u])?a.isArray(f)?[...f,l[1]]:[f,l[1]]:l[1]}i(c,n)}else t!=null&&o(n,t,r);return this}get(t,n){if(t=G(t),t){const r=a.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return Mn(s);if(a.isFunction(n))return n.call(this,s,r);if(a.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=G(t),t){const r=a.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Se(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function o(i){if(i=G(i),i){const c=a.findKey(r,i);c&&(!n||Se(r,r[c],c,n))&&(delete r[c],s=!0)}}return a.isArray(t)?t.forEach(o):o(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const o=n[r];(!t||Se(this,this[o],o,t,!0))&&(delete this[o],s=!0)}return s}normalize(t){const n=this,r={};return a.forEach(this,(s,o)=>{const i=a.findKey(r,o);if(i){n[i]=ce(s),delete n[o];return}const c=t?Jn(o):String(o).trim();c!==o&&delete n[o],n[c]=ce(s),r[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return a.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&a.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
3
+ `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[Ve]=this[Ve]={accessors:{}}).accessors,s=this.prototype;function o(i){const c=G(i);r[c]||(Vn(s,i),r[c]=!0)}return a.isArray(t)?t.forEach(o):o(t),this}};I.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);a.reduceDescriptors(I.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});a.freezeMethods(I);function be(e,t){const n=this||te,r=t||n,s=I.from(r.headers);let o=r.data;return a.forEach(e,function(c){o=c.call(n,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function St(e){return!!(e&&e.__CANCEL__)}function K(e,t,n){m.call(this,e??"canceled",m.ERR_CANCELED,t,n),this.name="CanceledError"}a.inherits(K,m,{__CANCEL__:!0});function bt(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new m("Request failed with status code "+n.status,[m.ERR_BAD_REQUEST,m.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Wn(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Kn(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,o=0,i;return t=t!==void 0?t:1e3,function(f){const u=Date.now(),l=r[o];i||(i=u),n[s]=f,r[s]=u;let p=o,g=0;for(;p!==s;)g+=n[p++],p=p%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),u-i<t)return;const E=l&&u-l;return E?Math.round(g*1e3/E):void 0}}function Xn(e,t){let n=0,r=1e3/t,s,o;const i=(u,l=Date.now())=>{n=l,s=null,o&&(clearTimeout(o),o=null),e(...u)};return[(...u)=>{const l=Date.now(),p=l-n;p>=r?i(u,l):(s=u,o||(o=setTimeout(()=>{o=null,i(s)},r-p)))},()=>s&&i(s)]}const le=(e,t,n=3)=>{let r=0;const s=Kn(50,250);return Xn(o=>{const i=o.loaded,c=o.lengthComputable?o.total:void 0,f=i-r,u=s(f),l=i<=c;r=i;const p={loaded:i,total:c,progress:c?i/c:void 0,bytes:f,rate:u||void 0,estimated:u&&c&&l?(c-i)/u:void 0,event:o,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(p)},n)},We=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Ke=e=>(...t)=>a.asap(()=>e(...t)),Gn=C.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,C.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(C.origin),C.navigator&&/(msie|trident)/i.test(C.navigator.userAgent)):()=>!0,Qn=C.hasStandardBrowserEnv?{write(e,t,n,r,s,o,i){if(typeof document>"u")return;const c=[`${e}=${encodeURIComponent(t)}`];a.isNumber(n)&&c.push(`expires=${new Date(n).toUTCString()}`),a.isString(r)&&c.push(`path=${r}`),a.isString(s)&&c.push(`domain=${s}`),o===!0&&c.push("secure"),a.isString(i)&&c.push(`SameSite=${i}`),document.cookie=c.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Yn(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Zn(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Et(e,t,n){let r=!Yn(t);return e&&(r||n==!1)?Zn(e,t):t}const Xe=e=>e instanceof I?{...e}:e;function M(e,t){t=t||{};const n={};function r(u,l,p,g){return a.isPlainObject(u)&&a.isPlainObject(l)?a.merge.call({caseless:g},u,l):a.isPlainObject(l)?a.merge({},l):a.isArray(l)?l.slice():l}function s(u,l,p,g){if(a.isUndefined(l)){if(!a.isUndefined(u))return r(void 0,u,p,g)}else return r(u,l,p,g)}function o(u,l){if(!a.isUndefined(l))return r(void 0,l)}function i(u,l){if(a.isUndefined(l)){if(!a.isUndefined(u))return r(void 0,u)}else return r(void 0,l)}function c(u,l,p){if(p in t)return r(u,l);if(p in e)return r(void 0,u)}const f={url:o,method:o,data:o,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:c,headers:(u,l,p)=>s(Xe(u),Xe(l),p,!0)};return a.forEach(Object.keys({...e,...t}),function(l){const p=f[l]||s,g=p(e[l],t[l],l);a.isUndefined(g)&&p!==c||(n[l]=g)}),n}const Ct=e=>{const t=M({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:o,headers:i,auth:c}=t;if(t.headers=i=I.from(i),t.url=mt(Et(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),c&&i.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),a.isFormData(n)){if(C.hasStandardBrowserEnv||C.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(a.isFunction(n.getHeaders)){const f=n.getHeaders(),u=["content-type","content-length"];Object.entries(f).forEach(([l,p])=>{u.includes(l.toLowerCase())&&i.set(l,p)})}}if(C.hasStandardBrowserEnv&&(r&&a.isFunction(r)&&(r=r(t)),r||r!==!1&&Gn(t.url))){const f=s&&o&&Qn.read(o);f&&i.set(s,f)}return t},er=typeof XMLHttpRequest<"u",tr=er&&function(e){return new Promise(function(n,r){const s=Ct(e);let o=s.data;const i=I.from(s.headers).normalize();let{responseType:c,onUploadProgress:f,onDownloadProgress:u}=s,l,p,g,E,d;function y(){E&&E(),d&&d(),s.cancelToken&&s.cancelToken.unsubscribe(l),s.signal&&s.signal.removeEventListener("abort",l)}let h=new XMLHttpRequest;h.open(s.method.toUpperCase(),s.url,!0),h.timeout=s.timeout;function S(){if(!h)return;const b=I.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),P={data:!c||c==="text"||c==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:b,config:e,request:h};bt(function(N){n(N),y()},function(N){r(N),y()},P),h=null}"onloadend"in h?h.onloadend=S:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(S)},h.onabort=function(){h&&(r(new m("Request aborted",m.ECONNABORTED,e,h)),h=null)},h.onerror=function(R){const P=R&&R.message?R.message:"Network Error",v=new m(P,m.ERR_NETWORK,e,h);v.event=R||null,r(v),h=null},h.ontimeout=function(){let R=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const P=s.transitional||gt;s.timeoutErrorMessage&&(R=s.timeoutErrorMessage),r(new m(R,P.clarifyTimeoutError?m.ETIMEDOUT:m.ECONNABORTED,e,h)),h=null},o===void 0&&i.setContentType(null),"setRequestHeader"in h&&a.forEach(i.toJSON(),function(R,P){h.setRequestHeader(P,R)}),a.isUndefined(s.withCredentials)||(h.withCredentials=!!s.withCredentials),c&&c!=="json"&&(h.responseType=s.responseType),u&&([g,d]=le(u,!0),h.addEventListener("progress",g)),f&&h.upload&&([p,E]=le(f),h.upload.addEventListener("progress",p),h.upload.addEventListener("loadend",E)),(s.cancelToken||s.signal)&&(l=b=>{h&&(r(!b||b.type?new K(null,e,h):b),h.abort(),h=null)},s.cancelToken&&s.cancelToken.subscribe(l),s.signal&&(s.signal.aborted?l():s.signal.addEventListener("abort",l)));const T=Wn(s.url);if(T&&C.protocols.indexOf(T)===-1){r(new m("Unsupported protocol "+T+":",m.ERR_BAD_REQUEST,e));return}h.send(o||null)})},nr=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,s;const o=function(u){if(!s){s=!0,c();const l=u instanceof Error?u:this.reason;r.abort(l instanceof m?l:new K(l instanceof Error?l.message:l))}};let i=t&&setTimeout(()=>{i=null,o(new m(`timeout ${t} of ms exceeded`,m.ETIMEDOUT))},t);const c=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(o):u.removeEventListener("abort",o)}),e=null)};e.forEach(u=>u.addEventListener("abort",o));const{signal:f}=r;return f.unsubscribe=()=>a.asap(c),f}},rr=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,s;for(;r<n;)s=r+t,yield e.slice(r,s),r=s},sr=async function*(e,t){for await(const n of or(e))yield*rr(n,t)},or=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},Ge=(e,t,n,r)=>{const s=sr(e,t);let o=0,i,c=f=>{i||(i=!0,r&&r(f))};return new ReadableStream({async pull(f){try{const{done:u,value:l}=await s.next();if(u){c(),f.close();return}let p=l.byteLength;if(n){let g=o+=p;n(g)}f.enqueue(new Uint8Array(l))}catch(u){throw c(u),u}},cancel(f){return c(f),s.return()}},{highWaterMark:2})},Qe=64*1024,{isFunction:ie}=a,ir=(({Request:e,Response:t})=>({Request:e,Response:t}))(a.global),{ReadableStream:Ye,TextEncoder:Ze}=a.global,et=(e,...t)=>{try{return!!e(...t)}catch{return!1}},ar=e=>{e=a.merge.call({skipUndefined:!0},ir,e);const{fetch:t,Request:n,Response:r}=e,s=t?ie(t):typeof fetch=="function",o=ie(n),i=ie(r);if(!s)return!1;const c=s&&ie(Ye),f=s&&(typeof Ze=="function"?(d=>y=>d.encode(y))(new Ze):async d=>new Uint8Array(await new n(d).arrayBuffer())),u=o&&c&&et(()=>{let d=!1;const y=new n(C.origin,{body:new Ye,method:"POST",get duplex(){return d=!0,"half"}}).headers.has("Content-Type");return d&&!y}),l=i&&c&&et(()=>a.isReadableStream(new r("").body)),p={stream:l&&(d=>d.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(d=>{!p[d]&&(p[d]=(y,h)=>{let S=y&&y[d];if(S)return S.call(y);throw new m(`Response type '${d}' is not supported`,m.ERR_NOT_SUPPORT,h)})});const g=async d=>{if(d==null)return 0;if(a.isBlob(d))return d.size;if(a.isSpecCompliantForm(d))return(await new n(C.origin,{method:"POST",body:d}).arrayBuffer()).byteLength;if(a.isArrayBufferView(d)||a.isArrayBuffer(d))return d.byteLength;if(a.isURLSearchParams(d)&&(d=d+""),a.isString(d))return(await f(d)).byteLength},E=async(d,y)=>{const h=a.toFiniteNumber(d.getContentLength());return h??g(y)};return async d=>{let{url:y,method:h,data:S,signal:T,cancelToken:b,timeout:R,onDownloadProgress:P,onUploadProgress:v,responseType:N,headers:ge,withCredentials:re="same-origin",fetchOptions:Ue}=Ct(d),De=t||fetch;N=N?(N+"").toLowerCase():"text";let se=nr([T,b&&b.toAbortSignal()],R),X=null;const z=se&&se.unsubscribe&&(()=>{se.unsubscribe()});let ve;try{if(v&&u&&h!=="get"&&h!=="head"&&(ve=await E(ge,S))!==0){let D=new n(y,{method:"POST",body:S,duplex:"half"}),H;if(a.isFormData(S)&&(H=D.headers.get("content-type"))&&ge.setContentType(H),D.body){const[we,oe]=We(ve,le(Ke(v)));S=Ge(D.body,Qe,we,oe)}}a.isString(re)||(re=re?"include":"omit");const B=o&&"credentials"in n.prototype,ze={...Ue,signal:se,method:h.toUpperCase(),headers:ge.normalize().toJSON(),body:S,duplex:"half",credentials:B?re:void 0};X=o&&new n(y,ze);let U=await(o?De(X,Ue):De(y,ze));const qe=l&&(N==="stream"||N==="response");if(l&&(P||qe&&z)){const D={};["status","statusText","headers"].forEach(je=>{D[je]=U[je]});const H=a.toFiniteNumber(U.headers.get("content-length")),[we,oe]=P&&We(H,le(Ke(P),!0))||[];U=new r(Ge(U.body,Qe,we,()=>{oe&&oe(),z&&z()}),D)}N=N||"text";let Dt=await p[a.findKey(p,N)||"text"](U,d);return!qe&&z&&z(),await new Promise((D,H)=>{bt(D,H,{data:Dt,headers:I.from(U.headers),status:U.status,statusText:U.statusText,config:d,request:X})})}catch(B){throw z&&z(),B&&B.name==="TypeError"&&/Load failed|fetch/i.test(B.message)?Object.assign(new m("Network Error",m.ERR_NETWORK,d,X),{cause:B.cause||B}):m.from(B,B&&B.code,d,X)}}},cr=new Map,At=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:s}=t,o=[r,s,n];let i=o.length,c=i,f,u,l=cr;for(;c--;)f=o[c],u=l.get(f),u===void 0&&l.set(f,u=c?new Map:ar(t)),l=u;return u};At();const Le={http:On,xhr:tr,fetch:{get:At}};a.forEach(Le,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const tt=e=>`- ${e}`,ur=e=>a.isFunction(e)||e===null||e===!1;function lr(e,t){e=a.isArray(e)?e:[e];const{length:n}=e;let r,s;const o={};for(let i=0;i<n;i++){r=e[i];let c;if(s=r,!ur(r)&&(s=Le[(c=String(r)).toLowerCase()],s===void 0))throw new m(`Unknown adapter '${c}'`);if(s&&(a.isFunction(s)||(s=s.get(t))))break;o[c||"#"+i]=s}if(!s){const i=Object.entries(o).map(([f,u])=>`adapter ${f} `+(u===!1?"is not supported by the environment":"is not available in the build"));let c=n?i.length>1?`since :
4
+ `+i.map(tt).join(`
5
+ `):" "+tt(i[0]):"as no adapter specified";throw new m("There is no suitable adapter to dispatch the request "+c,"ERR_NOT_SUPPORT")}return s}const Rt={getAdapter:lr,adapters:Le};function Ee(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new K(null,e)}function nt(e){return Ee(e),e.headers=I.from(e.headers),e.data=be.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Rt.getAdapter(e.adapter||te.adapter,e)(e).then(function(r){return Ee(e),r.data=be.call(e,e.transformResponse,r),r.headers=I.from(r.headers),r},function(r){return St(r)||(Ee(e),r&&r.response&&(r.response.data=be.call(e,e.transformResponse,r.response),r.response.headers=I.from(r.response.headers))),Promise.reject(r)})}const Ot="1.13.2",ye={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{ye[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const rt={};ye.transitional=function(t,n,r){function s(o,i){return"[Axios v"+Ot+"] Transitional option '"+o+"'"+i+(r?". "+r:"")}return(o,i,c)=>{if(t===!1)throw new m(s(i," has been removed"+(n?" in "+n:"")),m.ERR_DEPRECATED);return n&&!rt[i]&&(rt[i]=!0,console.warn(s(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,i,c):!0}};ye.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function dr(e,t,n){if(typeof e!="object")throw new m("options must be an object",m.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const o=r[s],i=t[o];if(i){const c=e[o],f=c===void 0||i(c,o,e);if(f!==!0)throw new m("option "+o+" must be "+f,m.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new m("Unknown option "+o,m.ERR_BAD_OPTION)}}const ue={assertOptions:dr,validators:ye},L=ue.validators;let $=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Je,response:new Je}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const o=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=`
6
+ `+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=M(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:o}=n;r!==void 0&&ue.assertOptions(r,{silentJSONParsing:L.transitional(L.boolean),forcedJSONParsing:L.transitional(L.boolean),clarifyTimeoutError:L.transitional(L.boolean)},!1),s!=null&&(a.isFunction(s)?n.paramsSerializer={serialize:s}:ue.assertOptions(s,{encode:L.function,serialize:L.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),ue.assertOptions(n,{baseUrl:L.spelling("baseURL"),withXsrfToken:L.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=o&&a.merge(o.common,o[n.method]);o&&a.forEach(["delete","get","head","post","put","patch","common"],d=>{delete o[d]}),n.headers=I.concat(i,o);const c=[];let f=!0;this.interceptors.request.forEach(function(y){typeof y.runWhen=="function"&&y.runWhen(n)===!1||(f=f&&y.synchronous,c.unshift(y.fulfilled,y.rejected))});const u=[];this.interceptors.response.forEach(function(y){u.push(y.fulfilled,y.rejected)});let l,p=0,g;if(!f){const d=[nt.bind(this),void 0];for(d.unshift(...c),d.push(...u),g=d.length,l=Promise.resolve(n);p<g;)l=l.then(d[p++],d[p++]);return l}g=c.length;let E=n;for(;p<g;){const d=c[p++],y=c[p++];try{E=d(E)}catch(h){y.call(this,h);break}}try{l=nt.call(this,E)}catch(d){return Promise.reject(d)}for(p=0,g=u.length;p<g;)l=l.then(u[p++],u[p++]);return l}getUri(t){t=M(this.defaults,t);const n=Et(t.baseURL,t.url,t.allowAbsoluteUrls);return mt(n,t.params,t.paramsSerializer)}};a.forEach(["delete","get","head","options"],function(t){$.prototype[t]=function(n,r){return this.request(M(r||{},{method:t,url:n,data:(r||{}).data}))}});a.forEach(["post","put","patch"],function(t){function n(r){return function(o,i,c){return this.request(M(c||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:i}))}}$.prototype[t]=n(),$.prototype[t+"Form"]=n(!0)});let fr=class It{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(s=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](s);r._listeners=null}),this.promise.then=s=>{let o;const i=new Promise(c=>{r.subscribe(c),o=c}).then(s);return i.cancel=function(){r.unsubscribe(o)},i},t(function(o,i,c){r.reason||(r.reason=new K(o,i,c),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new It(function(s){t=s}),cancel:t}}};function pr(e){return function(n){return e.apply(null,n)}}function hr(e){return a.isObject(e)&&e.isAxiosError===!0}const Ie={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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Ie).forEach(([e,t])=>{Ie[t]=e});function Tt(e){const t=new $(e),n=st($.prototype.request,t);return a.extend(n,$.prototype,t,{allOwnKeys:!0}),a.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return Tt(M(e,s))},n}const w=Tt(te);w.Axios=$;w.CanceledError=K;w.CancelToken=fr;w.isCancel=St;w.VERSION=Ot;w.toFormData=he;w.AxiosError=m;w.Cancel=w.CanceledError;w.all=function(t){return Promise.all(t)};w.spread=pr;w.isAxiosError=hr;w.mergeConfig=M;w.AxiosHeaders=I;w.formToJSON=e=>wt(a.isHTMLForm(e)?new FormData(e):e);w.getAdapter=Rt.getAdapter;w.HttpStatusCode=Ie;w.default=w;const{Axios:Kr,AxiosError:Xr,CanceledError:Gr,isCancel:Qr,CancelToken:Yr,VERSION:Zr,all:es,Cancel:ts,isAxiosError:ns,spread:rs,toFormData:ss,AxiosHeaders:os,HttpStatusCode:is,formToJSON:as,getAdapter:cs,mergeConfig:us}=w,Te=w.create({timeout:15e3});Te.interceptors.response.use(e=>e,e=>Promise.reject(e));const Nt={async get(e,t){const n=await Te.get(e,{params:t?.params,headers:t?.headers});return{data:n.data,status:n.status,headers:n.headers}},async post(e,t,n){const r=await Te.post(e,t,{params:n?.params,headers:n?.headers});return{data:r.data,status:r.status,headers:r.headers}}};function yr(e){return{async get(t,n){const r=n?.params?"?"+new URLSearchParams(n.params).toString():"",s=await e(t+r,{method:"GET",headers:n?.headers});return{data:await s.json(),status:s.status}},async post(t,n,r){const s=r?.params?"?"+new URLSearchParams(r.params).toString():"",o=await e(t+s,{method:"POST",headers:{"Content-Type":"application/json",...r?.headers},body:n?JSON.stringify(n):void 0});return{data:await o.json(),status:o.status}}}}let Q=Nt;function mr(e,t){return e==="fetch"?Q=yr(t?.fetch??fetch):Q=Nt,Q}const _e={get:(...e)=>Q.get(...e),post:(...e)=>Q.post(...e)},q={prefixPath:"https://cloudapi-sit2.jctrans.net.cn",searchPath:"/system/dms/fr/aggr/getLocationOptions",oldSearchPath:"/system/dms/fr/aggr/findPageList"},Pt={get basePath(){return q.prefixPath+q.searchPath},get oldBasePath(){return q.prefixPath+q.oldSearchPath},get prefixPath(){return q.prefixPath}},gr=e=>{e&&(e.prefixPath!==void 0&&(q.prefixPath=e.prefixPath),e.searchPath!==void 0&&(q.searchPath=e.searchPath))},me=()=>Pt,Fe=()=>{let e;try{typeof useCookie=="function"&&(e=useCookie("jc-language")?.value)}catch{}if(e)return e==="en"||e==="en-US";if(typeof document<"u"){const t=document.cookie||"";return/(^|;\s*)jc-language=en(-US)?(;|$)/.test(t)}try{if(typeof useNuxtApp=="function"){const n=useNuxtApp()?.ssrContext?.event?.node?.req?.headers?.cookie||"";return/(^|;\s*)jc-language=en(-US)?(;|$)/.test(n)}}catch{}return!1},wr=()=>me().oldBasePath,Sr={Continent:"continentId",Country:"countryId",City:"cityId",Province:"provinceId",Seaport:"seaportId",Airport:"airportId"},br=["City","Seaport","Airport","Country","Region"].filter(Boolean);function J(e,t){return e==="allCityByCountryId"?Array.isArray(t)?String(t[0]):String(t):Array.isArray(t)?JSON.stringify(t):JSON.stringify([Number(t)])}function Er(e){const t=[];if(e.ids)for(const n of e.ids){const r=Sr[n.type];t.push({name:r,val:J(r,n.ids)})}return e.scope&&(e.scope.countryId!==void 0&&e.scope.countryId!==null&&t.push({name:"countryId",val:J("countryId",[e.scope.countryId])}),e.scope.cityId!==void 0&&e.scope.cityId!==null&&t.push({name:"cityId",val:J("cityId",[e.scope.cityId])}),e.scope.provinceId!==void 0&&e.scope.provinceId!==null&&t.push({name:"provinceId",val:J("provinceId",[e.scope.provinceId])})),t}function k(e){const t={current:e.page??1,size:e.size??10,level:e.level,searchContent:e.keyword??void 0,displayInfo:e.displayInfo??br,sort:e.sort},n=Er({ids:e.ids,scope:e.scope});return t.appointSearch=[...n,...e.extraAppoint||[]],Object.keys(t).forEach(r=>{t[r]===void 0&&delete t[r]}),t}function Cr(e,t,n){const r=Fe(),s=(u,l)=>{if(!u)return"";const p=u.nameCn??u[`${l.toLowerCase()}NameCn`]??u.name,g=u.nameEn??u[`${l.toLowerCase()}NameEn`];return r?g||p||"":p||g||""},o=s(e,t),i=s(n.country,"country"),c=s(n.city,"city"),f=s(n.continent,"continent");switch(t){case"Seaport":case"Airport":const u=[c,i].filter(Boolean).join(", ");return u?`${o} (${u})`:o;case"City":case"Province":return i?`${o} (${i})`:o;case"Country":return f?`${o} (${f})`:o;default:return o}}function _(e=[],t=[]){const n=[];function r(o,i,c){if(!o||!t.includes(i))return;const f=o.id??o[i.toLowerCase()+"Id"]??null;if(f==null)return;const u=o.nameCn??o[`${i.toLowerCase()}NameCn`]??o.name??void 0,l=o.nameEn??o[`${i.toLowerCase()}NameEn`]??void 0,p=Cr(o,i,c)||u||l||"";n.push({id:f,type:i,nameCn:u,nameEn:l,display:p,continent:c.continent??void 0,country:c.country??void 0,city:c.city??void 0,province:c.province??void 0,raw:o})}for(const o of e){const i={continent:o.continent??void 0,country:o.country??void 0,city:o.city??void 0,province:o.province??void 0};let c=!1;if(["Continent","Country","Province","City","Seaport","Airport"].forEach(u=>{const l=u.toLowerCase();o[l]&&(r(o[l],u,i),c=!0)}),!c&&o.id!==void 0){let u;o.type&&t.includes(o.type)?u=o.type:t.length===1&&(u=t[0]),u&&r(o,u,i)}}const s=new Set;return n.filter(o=>{const i=`${o.type}_${o.id}`;return s.has(i)?!1:(s.add(i),!0)})}async function F(e){return(await _e.post(wr(),e)).data}async function ne(e){const t=k({keyword:e.keyword,displayInfo:e.displayInfo,page:e.page,size:e.size,level:e.level,sort:e.sort,ids:e.ids,scope:e.scope,extraAppoint:e.extraAppoint}),n=await F(t),r=_(n.data?.records||[],t.displayInfo||[]);return{...n,records:r}}async function ke(e){if(!e.keyword?.trim())throw new Error("searchByName: keyword 不能为空");const t=e.types&&e.types.length>0?e.types:["Continent","Country","City","Province","Seaport","Airport"];return ne({keyword:e.keyword.trim(),displayInfo:t,page:e.page,size:e.size,level:e.level,sort:e.sort})}async function xt(e,t){const n=Array.isArray(t)?t:[t],r=[e],s=k({displayInfo:r,ids:[{type:e,ids:n}]}),o=await F(s);return _(o.records||[],r).filter(c=>c.type===e)}async function Ar(e,t){return(await xt(e,[t]))[0]??null}async function Rr(e,t){const n=["City"],r=k({displayInfo:n,page:t?.page??1,size:t?.size??1e3,extraAppoint:[{name:"allCityByCountryId",val:J("allCityByCountryId",e)}]}),s=await F(r);return{...s,records:_(s.records||[],n)}}async function Or(e,t,n){if(!t||t.length===0)throw new Error("childTypes 必须至少包含一个:Seaport | Airport");const r=t,s=k({displayInfo:r,page:n?.page??1,size:n?.size??1e3,extraAppoint:[{name:"cityId",val:J("cityId",[e])}]}),o=await F(s);return{...o,records:_(o.records||[],r)}}function Ir(e,t){return ke({keyword:e,types:["Country"],page:t?.page,size:t?.size})}function Tr(e,t){return t?.countryId?ne({keyword:e,displayInfo:["City"],scope:{countryId:t.countryId},page:t.page,size:t.size}):ke({keyword:e,types:["City"],page:t?.page,size:t?.size})}function Nr(e,t){return ne({keyword:e,displayInfo:["Seaport"],scope:t?.cityId?{cityId:t.cityId}:void 0,page:t?.page,size:t?.size})}function Pr(e,t){return ne({keyword:e,displayInfo:["Airport"],scope:t?.cityId?{cityId:t.cityId}:void 0,page:t?.page,size:t?.size})}async function xr(e={}){const t=["Continent"],n=await F({current:e.page??1,size:e.size??10,level:1,displayInfo:t});return{...n,records:_(n.records||[],t)}}async function Br(e={}){const t=["Country"],n=k({displayInfo:t,page:e.page??1,size:e.size??10,ids:e.ids?[{type:"Country",ids:e.ids}]:void 0}),r=await F(n);return{...r,records:_(r.records||[],t)}}async function Lr(e={}){const t=["City"],n=k({displayInfo:t,page:e.page??1,size:e.size??10,ids:e.ids?[{type:"City",ids:e.ids}]:void 0,scope:e.countryId?{countryId:e.countryId}:void 0}),r=await F(n);return{...r,records:_(r.records||[],t)}}async function _r(e={}){const t=["Province"],n=k({displayInfo:t,page:e.page??1,size:e.size??10,ids:e.ids?[{type:"Province",ids:e.ids}]:void 0,scope:e.countryId?{countryId:e.countryId}:void 0}),r=await F(n);return{...r,records:_(r.records||[],t)}}async function Fr(e={}){const t=["Seaport"],n=k({displayInfo:t,page:e.page??1,size:e.size??10,ids:e.ids?[{type:"Seaport",ids:e.ids}]:void 0,scope:e.cityId?{cityId:e.cityId}:e.countryId?{countryId:e.countryId}:void 0}),r=await F(n);return{...r,records:_(r.records||[],t)}}async function kr(e={}){const t=["Airport"],n=k({displayInfo:t,page:e.page??1,size:e.size??10,ids:e.ids?[{type:"Airport",ids:e.ids}]:void 0,scope:e.cityId?{cityId:e.cityId}:e.countryId?{countryId:e.countryId}:void 0}),r=await F(n);return{...r,records:_(r.records||[],t)}}const Ur="2.0",Dr=()=>me().basePath;function Bt(e){let t=e.type;return t==="Country"&&e.region&&!e.country?{target:e.region,finalType:"Region"}:{target:e[t.toLowerCase()]||{},finalType:t}}function Ce(e,t){const{target:n,finalType:r}=Bt(e),s=u=>{if(!u)return"";const l=u.nameCn||u.displayNameCn||u.name||"",p=u.nameEn||u.displayNameEn||u.nameEnShow||"";return t?p||l:l||p},o=s(n),i=e.country||e.region,c=s(i),f=s(e.city);if(["Seaport","Airport","Wharf"].includes(r)){const u=[f,c].filter(Boolean).join(", ");return u?`${o} (${u})`:o}return["City","Province"].includes(r)&&c?`${o} (${c})`:o}function vr(e=[]){return e.map(t=>{const{target:n,finalType:r}=Bt(t);return{id:n.id??t.id,type:r,nameCn:n.nameCn||n.name,nameEn:n.nameEn||n.nameEnShow,display:Ce(t,Fe()),displayEn:Ce(t,!0),displayCn:Ce(t,!1),raw:t}})}async function A(e){const t={current:1,size:10,...e},r=(await _e.post(Dr(),t)).data.data||{};return{...r,records:vr(r.records||[])}}const Lt={searchByName:e=>A({searchContent:e.keyword,searchMode:e.searchMode,...e,displayInfo:["Country"]}),getByIds:e=>A({countryIds:e,displayInfo:["Country"]})},_t={searchByName:e=>A({searchContent:e.keyword,searchMode:e.searchMode,...e,displayInfo:["Country"]}),getByIds:e=>A({countryIds:e,displayInfo:["Country"]})},Ne={searchByName:e=>A({searchContent:e.keyword,countryIds:e.countryId?[e.countryId]:void 0,...e,displayInfo:["City"]}),getByIds:e=>A({cityIds:e,displayInfo:["City"]}),getCitiesByCountry:(e,t)=>A({countryIds:[e],displayInfo:["City"],...t})},Ft={searchByName:e=>A({searchContent:e.keyword,cityIds:e.cityId?[e.cityId]:void 0,countryIds:e.countryId?[e.countryId]:void 0,...e,displayInfo:["Seaport"]}),getByIds:e=>A({seaportIds:e,displayInfo:["Seaport"]})},kt={searchByName:e=>A({searchContent:e.keyword,countryIds:e.countryId?[e.countryId]:void 0,...e,displayInfo:["Airport"]}),getByIds:e=>A({airportIds:e,displayInfo:["Airport"]})},Ut={getByIds:e=>A({wharfIds:e,displayInfo:["Wharf"]})},zr=e=>A({searchContent:e.keyword,...e}),qr=(e,t)=>{const n=Array.isArray(e)?e:[e];switch(t){case"Country":return Lt.getByIds(n);case"Region":return _t.getByIds(n);case"City":return Ne.getByIds(n);case"Seaport":return Ft.getByIds(n);case"Airport":return kt.getByIds(n);case"Wharf":return Ut.getByIds(n);default:return A({[`${t.toLowerCase()}Ids`]:n,displayInfo:[t]})}},jr={SEARCH_VERSION:Ur,searchByName:zr,searchByIdWithType:qr,country:Lt,region:_t,city:Ne,seaport:Ft,airport:kt,wharf:Ut,getCitiesByCountry:Ne.getCitiesByCountry,getChildrenByCity:(e,t,n)=>A({cityIds:[e],displayInfo:t,...n})},$r=()=>me().prefixPath;async function Mr(e){const t={...e};return{...(await _e.post($r()+"/system/dms/fr/dmsReport/report",t)).data.data||{}}}const Hr={Open:"GLOBAL_MODAL_OPEN",Close:"GLOBAL_MODAL_CLOSE",Submit:"GLOBAL_MODAL_SUBMIT"},Jr=vt();exports.MODAL_ACTION=Hr;exports.createRequest=mr;exports.currentConfig=Pt;exports.emitter=Jr;exports.getAirport=kr;exports.getById=Ar;exports.getByIds=xt;exports.getChildrenByCity=Or;exports.getCitiesByCountry=Rr;exports.getCity=Lr;exports.getContinent=xr;exports.getCountry=Br;exports.getIsEn=Fe;exports.getProvince=_r;exports.getSeaport=Fr;exports.getSharedConfig=me;exports.initSharedConfig=gr;exports.locationSearchV2=jr;exports.reportNewTypeDataApi=Mr;exports.search=ne;exports.searchAirportByName=Pr;exports.searchByName=ke;exports.searchCityByName=Tr;exports.searchCountryByName=Ir;exports.searchSeaportByName=Nr;
package/dist/index.d.ts CHANGED
@@ -16,4 +16,5 @@ export * from './api/baseSearch';
16
16
  export * from './utils/request';
17
17
  export * from './api/searchV2';
18
18
  export * from './config/index';
19
+ export * from './api/applyData';
19
20
  export { emitter };