yahee-components 0.0.18 → 0.0.19

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.
Files changed (212) hide show
  1. package/es/_virtual/dayjs.min.js +4 -0
  2. package/es/annex-upload/annex-upload.vue.js +158 -0
  3. package/es/annex-upload/annex-upload.vue2.js +4 -0
  4. package/es/annex-upload/index.js +7 -0
  5. package/es/annex-upload/mimeType.js +822 -0
  6. package/es/annex-upload/style/index.css +7 -0
  7. package/es/api/server.js +29 -0
  8. package/es/api/tool.js +68 -0
  9. package/es/comprehensive-search/comprehensive-search.vue.js +165 -122
  10. package/es/copy/copy.vue.js +1 -1
  11. package/es/country-platform-shop-condition/country-platform-shop-condition.vue.js +218 -0
  12. package/es/country-platform-shop-condition/country-platform-shop-condition.vue2.js +4 -0
  13. package/es/country-platform-shop-condition/index.js +7 -0
  14. package/es/country-platform-shop-condition/style/index.css +48 -0
  15. package/es/drop-down-condition/drop-down-condition.vue.js +216 -0
  16. package/es/drop-down-condition/drop-down-condition.vue2.js +4 -0
  17. package/es/drop-down-condition/index.js +7 -0
  18. package/es/drop-down-condition/style/index.css +45 -0
  19. package/es/image-upload/image-upload.vue.js +177 -0
  20. package/es/image-upload/image-upload.vue2.js +4 -0
  21. package/es/image-upload/index.js +7 -0
  22. package/es/image-upload/style/index.css +33 -0
  23. package/es/index.js +26 -7
  24. package/es/installs.js +22 -4
  25. package/es/left-condition/index.js +7 -0
  26. package/es/left-condition/left-condition-sub.vue.js +95 -0
  27. package/es/left-condition/left-condition-sub.vue2.js +4 -0
  28. package/es/left-condition/left-condition.vue.js +216 -0
  29. package/es/left-condition/left-condition.vue2.js +4 -0
  30. package/es/left-condition/style/index.css +10 -0
  31. package/es/left-condition-enum/index.js +7 -0
  32. package/es/left-condition-enum/left-condition-enum.vue.js +80 -0
  33. package/es/left-condition-enum/left-condition-enum.vue2.js +4 -0
  34. package/es/left-condition-enum/style/index.css +10 -0
  35. package/es/node_modules/.pnpm/axios@1.7.7/node_modules/axios/index.js +38 -0
  36. package/es/node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/adapters/adapters.js +53 -0
  37. package/es/node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/adapters/fetch.js +141 -0
  38. package/es/node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/adapters/xhr.js +71 -0
  39. package/es/node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/axios.js +46 -0
  40. package/es/node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/cancel/CancelToken.js +77 -0
  41. package/es/node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/cancel/CanceledError.js +11 -0
  42. package/es/node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/cancel/isCancel.js +6 -0
  43. package/es/node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/core/Axios.js +133 -0
  44. package/es/node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/core/AxiosError.js +54 -0
  45. package/es/node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/core/AxiosHeaders.js +173 -0
  46. package/es/node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/core/InterceptorManager.js +58 -0
  47. package/es/node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/core/buildFullPath.js +8 -0
  48. package/es/node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/core/dispatchRequest.js +31 -0
  49. package/es/node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/core/mergeConfig.js +70 -0
  50. package/es/node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/core/settle.js +14 -0
  51. package/es/node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/core/transformData.js +13 -0
  52. package/es/node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/defaults/index.js +89 -0
  53. package/es/node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/defaults/transitional.js +8 -0
  54. package/es/node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/env/data.js +4 -0
  55. package/es/node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/helpers/AxiosURLSearchParams.js +33 -0
  56. package/es/node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/helpers/HttpStatusCode.js +71 -0
  57. package/es/node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/helpers/bind.js +8 -0
  58. package/es/node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/helpers/buildURL.js +19 -0
  59. package/es/node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/helpers/combineURLs.js +6 -0
  60. package/es/node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/helpers/composeSignals.js +30 -0
  61. package/es/node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/helpers/cookies.js +32 -0
  62. package/es/node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/helpers/formDataToJSON.js +31 -0
  63. package/es/node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/helpers/isAbsoluteURL.js +6 -0
  64. package/es/node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/helpers/isAxiosError.js +7 -0
  65. package/es/node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/helpers/isURLSameOrigin.js +37 -0
  66. package/es/node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/helpers/null.js +4 -0
  67. package/es/node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/helpers/parseHeaders.js +30 -0
  68. package/es/node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/helpers/parseProtocol.js +7 -0
  69. package/es/node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/helpers/progressEventReducer.js +35 -0
  70. package/es/node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/helpers/resolveConfig.js +33 -0
  71. package/es/node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/helpers/speedometer.js +19 -0
  72. package/es/node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/helpers/spread.js +8 -0
  73. package/es/node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/helpers/throttle.js +15 -0
  74. package/es/node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/helpers/toFormData.js +83 -0
  75. package/es/node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/helpers/toURLEncodedForm.js +13 -0
  76. package/es/node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/helpers/trackStream.js +63 -0
  77. package/es/node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/helpers/validator.js +51 -0
  78. package/es/node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/platform/browser/classes/Blob.js +4 -0
  79. package/es/node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/platform/browser/classes/FormData.js +4 -0
  80. package/es/node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js +5 -0
  81. package/es/node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/platform/browser/index.js +15 -0
  82. package/es/node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/platform/common/utils.js +9 -0
  83. package/es/node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/platform/index.js +9 -0
  84. package/es/node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/utils.js +233 -0
  85. package/es/node_modules/.pnpm/dayjs@1.11.13/node_modules/dayjs/dayjs.min.js +282 -0
  86. package/es/node_modules/{lodash → .pnpm/lodash@4.17.21/node_modules/lodash}/lodash.js +2 -2
  87. package/es/node_modules/.pnpm/v3-infinite-loading@1.3.2/node_modules/v3-infinite-loading/lib/v3-infinite-loading.es.js +120 -0
  88. package/es/operation-log/index.js +7 -0
  89. package/es/operation-log/operation-log-content.vue.js +100 -0
  90. package/es/operation-log/operation-log-content.vue2.js +4 -0
  91. package/es/operation-log/operation-log-dialog.vue.js +70 -0
  92. package/es/operation-log/operation-log-dialog.vue2.js +4 -0
  93. package/es/operation-log/operation-log-form.vue.js +181 -0
  94. package/es/operation-log/operation-log-form.vue2.js +4 -0
  95. package/es/operation-log/operation-log.vue.js +232 -0
  96. package/es/operation-log/operation-log.vue2.js +4 -0
  97. package/es/operation-log/style/index.css +220 -0
  98. package/es/packages/components/api/log/index.js +15 -0
  99. package/es/packages/components/api/log-server.js +50 -0
  100. package/es/packages/components/api/server.js +32 -0
  101. package/es/packages/components/api/tool.js +56 -0
  102. package/es/packages/components/api/upload-server.js +65 -0
  103. package/es/packages/components/assets/images/errorimg.png.js +4 -0
  104. package/es/packages/components/assets/images/excel.png.js +4 -0
  105. package/es/packages/components/assets/images/file-word.png.js +4 -0
  106. package/es/packages/components/assets/images/pdf.png.js +4 -0
  107. package/es/packages/components/assets/images/ppt.png.js +4 -0
  108. package/es/packages/components/assets/images/vue.svg.js +4 -0
  109. package/es/packages/components/hooks/useClipboard.js +30 -0
  110. package/es/packages/components/hooks/useImg.js +15 -0
  111. package/es/packages/components/hooks/useImgPath.js +14 -0
  112. package/es/packages/components/hooks/useImport.js +33 -0
  113. package/es/packages/components/hooks/useUpload.js +24 -0
  114. package/es/static/CommonObject.js +4 -0
  115. package/es/style.css +946 -0
  116. package/es/styles/custom.css +83 -0
  117. package/es/styles/globals.css +697 -0
  118. package/es/styles/index.css +787 -0
  119. package/es/styles/variables.css +32 -0
  120. package/es/utils/config.js +19 -0
  121. package/es/utils/const.js +19 -0
  122. package/es/utils/storage.js +52 -0
  123. package/es/utils/style.js +28 -0
  124. package/es/utils/translate.js +57 -0
  125. package/lib/annex-upload/style/index.css +7 -0
  126. package/lib/country-platform-shop-condition/style/index.css +48 -0
  127. package/lib/drop-down-condition/style/index.css +45 -0
  128. package/lib/image-upload/style/index.css +33 -0
  129. package/lib/left-condition/style/index.css +10 -0
  130. package/lib/left-condition-enum/style/index.css +10 -0
  131. package/lib/operation-log/style/index.css +220 -0
  132. package/lib/style.css +946 -0
  133. package/lib/styles/custom.css +83 -0
  134. package/lib/styles/globals.css +697 -0
  135. package/lib/styles/index.css +787 -0
  136. package/lib/styles/variables.css +32 -0
  137. package/package.json +10 -4
  138. package/types/hooks/useClipboard.d.ts +7 -0
  139. package/types/hooks/useImg.d.ts +10 -0
  140. package/types/hooks/useImgPath.d.ts +5 -0
  141. package/types/hooks/useImport.d.ts +11 -0
  142. package/types/hooks/useUpload.d.ts +12 -0
  143. package/types/index.d.ts +6 -204
  144. package/types/src/annex-upload/annex-upload.d.ts +30 -0
  145. package/types/src/annex-upload/annex-upload.vue.d.ts +443 -0
  146. package/types/src/annex-upload/index.d.ts +123 -0
  147. package/types/src/annex-upload/mimeType.d.ts +2 -0
  148. package/types/src/api/server.d.ts +6 -0
  149. package/types/src/api/tool.d.ts +6 -0
  150. package/types/src/api/types.d.ts +17 -0
  151. package/types/src/components.d.ts +10 -0
  152. package/types/src/comprehensive-search/comprehensive-search.d.ts +12 -0
  153. package/types/src/comprehensive-search/comprehensive-search.vue.d.ts +52 -0
  154. package/types/src/copy/copy.d.ts +12 -0
  155. package/types/src/copy/copy.vue.d.ts +21 -0
  156. package/types/src/copy/index.d.ts +32 -0
  157. package/types/src/country-platform-shop-condition/country-platform-shop-condition.d.ts +17 -0
  158. package/types/src/country-platform-shop-condition/country-platform-shop-condition.vue.d.ts +14 -0
  159. package/types/src/country-platform-shop-condition/index.d.ts +16 -0
  160. package/types/src/drop-down-condition/drop-down-condition.d.ts +6 -0
  161. package/types/src/drop-down-condition/drop-down-condition.vue.d.ts +40 -0
  162. package/types/src/drop-down-condition/index.d.ts +42 -0
  163. package/types/src/image-upload/image-upload.d.ts +26 -0
  164. package/types/src/image-upload/image-upload.vue.d.ts +43 -0
  165. package/types/src/image-upload/index.d.ts +94 -0
  166. package/types/src/index.d.ts +7 -0
  167. package/types/src/input/index.d.ts +16 -0
  168. package/types/src/input/input.d.ts +18 -0
  169. package/types/src/input/input.vue.d.ts +14 -0
  170. package/types/src/left-condition/index.d.ts +69 -0
  171. package/types/src/left-condition/left-condition-sub.vue.d.ts +47 -0
  172. package/types/src/left-condition/left-condition.d.ts +5 -0
  173. package/types/src/left-condition/left-condition.vue.d.ts +68 -0
  174. package/types/src/left-condition-enum/index.d.ts +162 -0
  175. package/types/src/left-condition-enum/left-condition-enum.d.ts +5 -0
  176. package/types/src/left-condition-enum/left-condition-enum.vue.d.ts +160 -0
  177. package/types/src/operation-log/index.d.ts +9 -0
  178. package/types/src/operation-log/operation-log-content.vue.d.ts +24 -0
  179. package/types/src/operation-log/operation-log-dialog.vue.d.ts +39 -0
  180. package/types/src/operation-log/operation-log-form.vue.d.ts +19 -0
  181. package/types/src/operation-log/operation-log.d.ts +11 -0
  182. package/types/src/operation-log/operation-log.vue.d.ts +6 -0
  183. package/types/src/static/CommonObject.d.ts +18 -0
  184. package/types/src/static/CommonVariables.d.ts +4 -0
  185. package/types/src/utils/config.d.ts +8 -0
  186. package/types/src/utils/const.d.ts +19 -0
  187. package/types/src/utils/functions.d.ts +1 -0
  188. package/types/src/utils/install.d.ts +8 -0
  189. package/types/src/utils/storage.d.ts +18 -0
  190. package/types/src/utils/style.d.ts +19 -0
  191. package/types/src/utils/to-kebab-case.d.ts +1 -0
  192. package/types/src/utils/translate.d.ts +5 -0
  193. package/types/src/utils/typescript.d.ts +5 -0
  194. package/es/hooks/useClipboard.js +0 -28
  195. package/lib/_virtual/_commonjsHelpers.js +0 -1
  196. package/lib/_virtual/lodash.js +0 -1
  197. package/lib/comprehensive-search/comprehensive-search.vue.js +0 -1
  198. package/lib/comprehensive-search/comprehensive-search.vue2.js +0 -1
  199. package/lib/comprehensive-search/index.js +0 -1
  200. package/lib/copy/copy.vue.js +0 -1
  201. package/lib/copy/copy.vue2.js +0 -1
  202. package/lib/copy/index.js +0 -1
  203. package/lib/hooks/useClipboard.js +0 -1
  204. package/lib/index.js +0 -1
  205. package/lib/input/index.js +0 -1
  206. package/lib/input/input.vue.js +0 -1
  207. package/lib/input/input.vue2.js +0 -1
  208. package/lib/installs.js +0 -1
  209. package/lib/node_modules/element-plus/es/locale/lang/zh-cn.js +0 -1
  210. package/lib/node_modules/lodash/lodash.js +0 -27
  211. package/lib/utils/install.js +0 -1
  212. /package/es/node_modules/{element-plus → .pnpm/element-plus@2.8.3_vue@3.5.12_typescript@5.6.2_/node_modules/element-plus}/es/locale/lang/zh-cn.js +0 -0
@@ -0,0 +1,80 @@
1
+ import { defineComponent as f, ref as c, onMounted as d, openBlock as y, createBlock as N } from "vue";
2
+ import h from "../left-condition/left-condition.vue.js";
3
+ import { storage as o } from "../utils/storage.js";
4
+ import { Get as p } from "../packages/components/api/server.js";
5
+ const E = /* @__PURE__ */ f({
6
+ name: "YaheeLeftConditionEnum",
7
+ __name: "left-condition-enum",
8
+ props: {
9
+ selectList: {
10
+ type: Array,
11
+ default: () => []
12
+ },
13
+ baseUrl: {
14
+ type: String,
15
+ default: ""
16
+ },
17
+ countList: {
18
+ type: Array,
19
+ required: !1
20
+ },
21
+ enumEntity: {
22
+ type: String,
23
+ default: ""
24
+ },
25
+ filterKey: {
26
+ type: String,
27
+ default: ""
28
+ },
29
+ totalCount: {
30
+ type: Number,
31
+ required: !1
32
+ },
33
+ noNeedRefreshNumFilterName: {
34
+ type: String,
35
+ required: !1
36
+ },
37
+ allIsCheckbox: {
38
+ type: Boolean,
39
+ required: !1
40
+ },
41
+ allIsEmpty: {
42
+ type: Boolean,
43
+ required: !1
44
+ },
45
+ translateUserId: {
46
+ type: Boolean,
47
+ required: !1
48
+ }
49
+ },
50
+ emits: ["filterChange", "setNoNeedRefreshNumFilterName"],
51
+ setup(e, { emit: s }) {
52
+ const t = e, i = s, r = c(t.selectList), u = (l) => {
53
+ i("filterChange", l);
54
+ }, m = () => {
55
+ i("setNoNeedRefreshNumFilterName", t.filterKey);
56
+ };
57
+ return d(() => {
58
+ const l = `filter-key-${t.enumEntity}`, n = o.getWithExpireTime(l);
59
+ n ? r.value = n : p(`${t.baseUrl}/${t.enumEntity}`).then((a) => {
60
+ r.value = a.data, o.setWithExpireTime(l, r.value, 1200 * 1e3);
61
+ }).catch((a) => {
62
+ console.log(a);
63
+ });
64
+ }), (l, n) => (y(), N(h, {
65
+ "select-list": r.value,
66
+ "count-list": e.countList,
67
+ "total-count": e.totalCount,
68
+ "filter-key": e.filterKey,
69
+ "no-need-refresh-num-filter-name": e.noNeedRefreshNumFilterName,
70
+ "all-is-checkbox": e.allIsCheckbox,
71
+ "translate-user-id": e.translateUserId,
72
+ "all-is-empty": e.allIsEmpty,
73
+ onFilterChange: u,
74
+ onSetNoNeedRefreshNumFilterName: m
75
+ }, null, 8, ["select-list", "count-list", "total-count", "filter-key", "no-need-refresh-num-filter-name", "all-is-checkbox", "translate-user-id", "all-is-empty"]));
76
+ }
77
+ });
78
+ export {
79
+ E as default
80
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./left-condition-enum.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,10 @@
1
+ .yahee-left-condition :deep(.custom-button + .custom-button) {
2
+ margin-left: 5px;
3
+ margin-bottom: 5px;
4
+ position: relative;
5
+ top: 2px;
6
+ }
7
+ .yahee-left-condition :deep(.custom-button) {
8
+ padding: 1px 4px;
9
+ height: 22px;
10
+ }
@@ -0,0 +1,38 @@
1
+ import o from "./lib/axios.js";
2
+ const {
3
+ Axios: e,
4
+ AxiosError: a,
5
+ CanceledError: s,
6
+ isCancel: t,
7
+ CancelToken: i,
8
+ VERSION: l,
9
+ all: n,
10
+ Cancel: d,
11
+ isAxiosError: x,
12
+ spread: C,
13
+ toFormData: c,
14
+ AxiosHeaders: m,
15
+ HttpStatusCode: p,
16
+ formToJSON: A,
17
+ getAdapter: f,
18
+ mergeConfig: E
19
+ } = o;
20
+ export {
21
+ e as Axios,
22
+ a as AxiosError,
23
+ m as AxiosHeaders,
24
+ d as Cancel,
25
+ i as CancelToken,
26
+ s as CanceledError,
27
+ p as HttpStatusCode,
28
+ l as VERSION,
29
+ n as all,
30
+ o as default,
31
+ A as formToJSON,
32
+ f as getAdapter,
33
+ x as isAxiosError,
34
+ t as isCancel,
35
+ E as mergeConfig,
36
+ C as spread,
37
+ c as toFormData
38
+ };
@@ -0,0 +1,53 @@
1
+ import a from "../utils.js";
2
+ import h from "../helpers/null.js";
3
+ import m from "./xhr.js";
4
+ import u from "./fetch.js";
5
+ import d from "../core/AxiosError.js";
6
+ const s = {
7
+ http: h,
8
+ xhr: m,
9
+ fetch: u
10
+ };
11
+ a.forEach(s, (e, n) => {
12
+ if (e) {
13
+ try {
14
+ Object.defineProperty(e, "name", { value: n });
15
+ } catch {
16
+ }
17
+ Object.defineProperty(e, "adapterName", { value: n });
18
+ }
19
+ });
20
+ const c = (e) => `- ${e}`, b = (e) => a.isFunction(e) || e === null || e === !1, y = {
21
+ getAdapter: (e) => {
22
+ e = a.isArray(e) ? e : [e];
23
+ const { length: n } = e;
24
+ let o, r;
25
+ const p = {};
26
+ for (let t = 0; t < n; t++) {
27
+ o = e[t];
28
+ let i;
29
+ if (r = o, !b(o) && (r = s[(i = String(o)).toLowerCase()], r === void 0))
30
+ throw new d(`Unknown adapter '${i}'`);
31
+ if (r)
32
+ break;
33
+ p[i || "#" + t] = r;
34
+ }
35
+ if (!r) {
36
+ const t = Object.entries(p).map(
37
+ ([f, l]) => `adapter ${f} ` + (l === !1 ? "is not supported by the environment" : "is not available in the build")
38
+ );
39
+ let i = n ? t.length > 1 ? `since :
40
+ ` + t.map(c).join(`
41
+ `) : " " + c(t[0]) : "as no adapter specified";
42
+ throw new d(
43
+ "There is no suitable adapter to dispatch the request " + i,
44
+ "ERR_NOT_SUPPORT"
45
+ );
46
+ }
47
+ return r;
48
+ },
49
+ adapters: s
50
+ };
51
+ export {
52
+ y as default
53
+ };
@@ -0,0 +1,141 @@
1
+ import B from "../platform/index.js";
2
+ import r from "../utils.js";
3
+ import l from "../core/AxiosError.js";
4
+ import H from "../helpers/composeSignals.js";
5
+ import { trackStream as L } from "../helpers/trackStream.js";
6
+ import K from "../core/AxiosHeaders.js";
7
+ import { progressEventDecorator as P, progressEventReducer as A, asyncDecorator as O } from "../helpers/progressEventReducer.js";
8
+ import z from "../helpers/resolveConfig.js";
9
+ import j from "../core/settle.js";
10
+ const w = typeof fetch == "function" && typeof Request == "function" && typeof Response == "function", D = w && typeof ReadableStream == "function", I = w && (typeof TextEncoder == "function" ? /* @__PURE__ */ ((e) => (t) => e.encode(t))(new TextEncoder()) : async (e) => new Uint8Array(await new Response(e).arrayBuffer())), F = (e, ...t) => {
11
+ try {
12
+ return !!e(...t);
13
+ } catch {
14
+ return !1;
15
+ }
16
+ }, J = D && F(() => {
17
+ let e = !1;
18
+ const t = new Request(B.origin, {
19
+ body: new ReadableStream(),
20
+ method: "POST",
21
+ get duplex() {
22
+ return e = !0, "half";
23
+ }
24
+ }).headers.has("Content-Type");
25
+ return e && !t;
26
+ }), _ = 64 * 1024, T = D && F(() => r.isReadableStream(new Response("").body)), g = {
27
+ stream: T && ((e) => e.body)
28
+ };
29
+ w && ((e) => {
30
+ ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((t) => {
31
+ !g[t] && (g[t] = r.isFunction(e[t]) ? (s) => s[t]() : (s, u) => {
32
+ throw new l(`Response type '${t}' is not supported`, l.ERR_NOT_SUPPORT, u);
33
+ });
34
+ });
35
+ })(new Response());
36
+ const V = async (e) => {
37
+ if (e == null)
38
+ return 0;
39
+ if (r.isBlob(e))
40
+ return e.size;
41
+ if (r.isSpecCompliantForm(e))
42
+ return (await new Request(B.origin, {
43
+ method: "POST",
44
+ body: e
45
+ }).arrayBuffer()).byteLength;
46
+ if (r.isArrayBufferView(e) || r.isArrayBuffer(e))
47
+ return e.byteLength;
48
+ if (r.isURLSearchParams(e) && (e = e + ""), r.isString(e))
49
+ return (await I(e)).byteLength;
50
+ }, W = async (e, t) => {
51
+ const s = r.toFiniteNumber(e.getContentLength());
52
+ return s ?? V(t);
53
+ }, re = w && (async (e) => {
54
+ let {
55
+ url: t,
56
+ method: s,
57
+ data: u,
58
+ signal: N,
59
+ cancelToken: x,
60
+ timeout: U,
61
+ onDownloadProgress: R,
62
+ onUploadProgress: b,
63
+ responseType: n,
64
+ headers: y,
65
+ withCredentials: m = "same-origin",
66
+ fetchOptions: v
67
+ } = z(e);
68
+ n = n ? (n + "").toLowerCase() : "text";
69
+ let d = H([N, x && x.toAbortSignal()], U), f;
70
+ const c = d && d.unsubscribe && (() => {
71
+ d.unsubscribe();
72
+ });
73
+ let E;
74
+ try {
75
+ if (b && J && s !== "get" && s !== "head" && (E = await W(y, u)) !== 0) {
76
+ let i = new Request(t, {
77
+ method: "POST",
78
+ body: u,
79
+ duplex: "half"
80
+ }), p;
81
+ if (r.isFormData(u) && (p = i.headers.get("content-type")) && y.setContentType(p), i.body) {
82
+ const [S, h] = P(
83
+ E,
84
+ A(O(b))
85
+ );
86
+ u = L(i.body, _, S, h);
87
+ }
88
+ }
89
+ r.isString(m) || (m = m ? "include" : "omit");
90
+ const o = "credentials" in Request.prototype;
91
+ f = new Request(t, {
92
+ ...v,
93
+ signal: d,
94
+ method: s.toUpperCase(),
95
+ headers: y.normalize().toJSON(),
96
+ body: u,
97
+ duplex: "half",
98
+ credentials: o ? m : void 0
99
+ });
100
+ let a = await fetch(f);
101
+ const C = T && (n === "stream" || n === "response");
102
+ if (T && (R || C && c)) {
103
+ const i = {};
104
+ ["status", "statusText", "headers"].forEach((q) => {
105
+ i[q] = a[q];
106
+ });
107
+ const p = r.toFiniteNumber(a.headers.get("content-length")), [S, h] = R && P(
108
+ p,
109
+ A(O(R), !0)
110
+ ) || [];
111
+ a = new Response(
112
+ L(a.body, _, S, () => {
113
+ h && h(), c && c();
114
+ }),
115
+ i
116
+ );
117
+ }
118
+ n = n || "text";
119
+ let k = await g[r.findKey(g, n) || "text"](a, e);
120
+ return !C && c && c(), await new Promise((i, p) => {
121
+ j(i, p, {
122
+ data: k,
123
+ headers: K.from(a.headers),
124
+ status: a.status,
125
+ statusText: a.statusText,
126
+ config: e,
127
+ request: f
128
+ });
129
+ });
130
+ } catch (o) {
131
+ throw c && c(), o && o.name === "TypeError" && /fetch/i.test(o.message) ? Object.assign(
132
+ new l("Network Error", l.ERR_NETWORK, e, f),
133
+ {
134
+ cause: o.cause || o
135
+ }
136
+ ) : l.from(o, o && o.code, e, f);
137
+ }
138
+ });
139
+ export {
140
+ re as default
141
+ };
@@ -0,0 +1,71 @@
1
+ import b from "../utils.js";
2
+ import D from "../core/settle.js";
3
+ import L from "../defaults/transitional.js";
4
+ import r from "../core/AxiosError.js";
5
+ import v from "../cancel/CanceledError.js";
6
+ import y from "../helpers/parseProtocol.js";
7
+ import O from "../platform/index.js";
8
+ import H from "../core/AxiosHeaders.js";
9
+ import { progressEventReducer as q } from "../helpers/progressEventReducer.js";
10
+ import U from "../helpers/resolveConfig.js";
11
+ const N = typeof XMLHttpRequest < "u", Q = N && function(n) {
12
+ return new Promise(function(A, s) {
13
+ const t = U(n);
14
+ let c = t.data;
15
+ const E = H.from(t.headers).normalize();
16
+ let { responseType: i, onUploadProgress: T, onDownloadProgress: R } = t, a, h, w, u, p;
17
+ function g() {
18
+ u && u(), p && p(), t.cancelToken && t.cancelToken.unsubscribe(a), t.signal && t.signal.removeEventListener("abort", a);
19
+ }
20
+ let e = new XMLHttpRequest();
21
+ e.open(t.method.toUpperCase(), t.url, !0), e.timeout = t.timeout;
22
+ function x() {
23
+ if (!e)
24
+ return;
25
+ const o = H.from(
26
+ "getAllResponseHeaders" in e && e.getAllResponseHeaders()
27
+ ), d = {
28
+ data: !i || i === "text" || i === "json" ? e.responseText : e.response,
29
+ status: e.status,
30
+ statusText: e.statusText,
31
+ headers: o,
32
+ config: n,
33
+ request: e
34
+ };
35
+ D(function(m) {
36
+ A(m), g();
37
+ }, function(m) {
38
+ s(m), g();
39
+ }, d), e = null;
40
+ }
41
+ "onloadend" in e ? e.onloadend = x : e.onreadystatechange = function() {
42
+ !e || e.readyState !== 4 || e.status === 0 && !(e.responseURL && e.responseURL.indexOf("file:") === 0) || setTimeout(x);
43
+ }, e.onabort = function() {
44
+ e && (s(new r("Request aborted", r.ECONNABORTED, n, e)), e = null);
45
+ }, e.onerror = function() {
46
+ s(new r("Network Error", r.ERR_NETWORK, n, e)), e = null;
47
+ }, e.ontimeout = function() {
48
+ let l = t.timeout ? "timeout of " + t.timeout + "ms exceeded" : "timeout exceeded";
49
+ const d = t.transitional || L;
50
+ t.timeoutErrorMessage && (l = t.timeoutErrorMessage), s(new r(
51
+ l,
52
+ d.clarifyTimeoutError ? r.ETIMEDOUT : r.ECONNABORTED,
53
+ n,
54
+ e
55
+ )), e = null;
56
+ }, c === void 0 && E.setContentType(null), "setRequestHeader" in e && b.forEach(E.toJSON(), function(l, d) {
57
+ e.setRequestHeader(d, l);
58
+ }), b.isUndefined(t.withCredentials) || (e.withCredentials = !!t.withCredentials), i && i !== "json" && (e.responseType = t.responseType), R && ([w, p] = q(R, !0), e.addEventListener("progress", w)), T && e.upload && ([h, u] = q(T), e.upload.addEventListener("progress", h), e.upload.addEventListener("loadend", u)), (t.cancelToken || t.signal) && (a = (o) => {
59
+ e && (s(!o || o.type ? new v(null, n, e) : o), e.abort(), e = null);
60
+ }, t.cancelToken && t.cancelToken.subscribe(a), t.signal && (t.signal.aborted ? a() : t.signal.addEventListener("abort", a)));
61
+ const f = y(t.url);
62
+ if (f && O.protocols.indexOf(f) === -1) {
63
+ s(new r("Unsupported protocol " + f + ":", r.ERR_BAD_REQUEST, n));
64
+ return;
65
+ }
66
+ e.send(c || null);
67
+ });
68
+ };
69
+ export {
70
+ Q as default
71
+ };
@@ -0,0 +1,46 @@
1
+ import a from "./utils.js";
2
+ import p from "./helpers/bind.js";
3
+ import m from "./core/Axios.js";
4
+ import i from "./core/mergeConfig.js";
5
+ import f from "./defaults/index.js";
6
+ import l from "./helpers/formDataToJSON.js";
7
+ import c from "./cancel/CanceledError.js";
8
+ import d from "./cancel/CancelToken.js";
9
+ import u from "./cancel/isCancel.js";
10
+ import { VERSION as x } from "./env/data.js";
11
+ import C from "./helpers/toFormData.js";
12
+ import A from "./core/AxiosError.js";
13
+ import E from "./helpers/spread.js";
14
+ import O from "./helpers/isAxiosError.js";
15
+ import S from "./core/AxiosHeaders.js";
16
+ import H from "./adapters/adapters.js";
17
+ import T from "./helpers/HttpStatusCode.js";
18
+ function n(o) {
19
+ const t = new m(o), e = p(m.prototype.request, t);
20
+ return a.extend(e, m.prototype, t, { allOwnKeys: !0 }), a.extend(e, t, null, { allOwnKeys: !0 }), e.create = function(s) {
21
+ return n(i(o, s));
22
+ }, e;
23
+ }
24
+ const r = n(f);
25
+ r.Axios = m;
26
+ r.CanceledError = c;
27
+ r.CancelToken = d;
28
+ r.isCancel = u;
29
+ r.VERSION = x;
30
+ r.toFormData = C;
31
+ r.AxiosError = A;
32
+ r.Cancel = r.CanceledError;
33
+ r.all = function(t) {
34
+ return Promise.all(t);
35
+ };
36
+ r.spread = E;
37
+ r.isAxiosError = O;
38
+ r.mergeConfig = i;
39
+ r.AxiosHeaders = S;
40
+ r.formToJSON = (o) => l(a.isHTMLForm(o) ? new FormData(o) : o);
41
+ r.getAdapter = H.getAdapter;
42
+ r.HttpStatusCode = T;
43
+ r.default = r;
44
+ export {
45
+ r as default
46
+ };
@@ -0,0 +1,77 @@
1
+ import u from "./CanceledError.js";
2
+ class c {
3
+ constructor(e) {
4
+ if (typeof e != "function")
5
+ throw new TypeError("executor must be a function.");
6
+ let t;
7
+ this.promise = new Promise(function(r) {
8
+ t = r;
9
+ });
10
+ const s = this;
11
+ this.promise.then((n) => {
12
+ if (!s._listeners) return;
13
+ let r = s._listeners.length;
14
+ for (; r-- > 0; )
15
+ s._listeners[r](n);
16
+ s._listeners = null;
17
+ }), this.promise.then = (n) => {
18
+ let r;
19
+ const o = new Promise((i) => {
20
+ s.subscribe(i), r = i;
21
+ }).then(n);
22
+ return o.cancel = function() {
23
+ s.unsubscribe(r);
24
+ }, o;
25
+ }, e(function(r, o, i) {
26
+ s.reason || (s.reason = new u(r, o, i), t(s.reason));
27
+ });
28
+ }
29
+ /**
30
+ * Throws a `CanceledError` if cancellation has been requested.
31
+ */
32
+ throwIfRequested() {
33
+ if (this.reason)
34
+ throw this.reason;
35
+ }
36
+ /**
37
+ * Subscribe to the cancel signal
38
+ */
39
+ subscribe(e) {
40
+ if (this.reason) {
41
+ e(this.reason);
42
+ return;
43
+ }
44
+ this._listeners ? this._listeners.push(e) : this._listeners = [e];
45
+ }
46
+ /**
47
+ * Unsubscribe from the cancel signal
48
+ */
49
+ unsubscribe(e) {
50
+ if (!this._listeners)
51
+ return;
52
+ const t = this._listeners.indexOf(e);
53
+ t !== -1 && this._listeners.splice(t, 1);
54
+ }
55
+ toAbortSignal() {
56
+ const e = new AbortController(), t = (s) => {
57
+ e.abort(s);
58
+ };
59
+ return this.subscribe(t), e.signal.unsubscribe = () => this.unsubscribe(t), e.signal;
60
+ }
61
+ /**
62
+ * Returns an object that contains a new `CancelToken` and a function that, when called,
63
+ * cancels the `CancelToken`.
64
+ */
65
+ static source() {
66
+ let e;
67
+ return {
68
+ token: new c(function(n) {
69
+ e = n;
70
+ }),
71
+ cancel: e
72
+ };
73
+ }
74
+ }
75
+ export {
76
+ c as default
77
+ };
@@ -0,0 +1,11 @@
1
+ import r from "../core/AxiosError.js";
2
+ import i from "../utils.js";
3
+ function l(o, t, e) {
4
+ r.call(this, o ?? "canceled", r.ERR_CANCELED, t, e), this.name = "CanceledError";
5
+ }
6
+ i.inherits(l, r, {
7
+ __CANCEL__: !0
8
+ });
9
+ export {
10
+ l as default
11
+ };
@@ -0,0 +1,6 @@
1
+ function t(n) {
2
+ return !!(n && n.__CANCEL__);
3
+ }
4
+ export {
5
+ t as default
6
+ };
@@ -0,0 +1,133 @@
1
+ import d from "../utils.js";
2
+ import R from "../helpers/buildURL.js";
3
+ import b from "./InterceptorManager.js";
4
+ import S from "./dispatchRequest.js";
5
+ import m from "./mergeConfig.js";
6
+ import C from "./buildFullPath.js";
7
+ import q from "../helpers/validator.js";
8
+ import I from "./AxiosHeaders.js";
9
+ const u = q.validators;
10
+ class k {
11
+ constructor(t) {
12
+ this.defaults = t, this.interceptors = {
13
+ request: new b(),
14
+ response: new b()
15
+ };
16
+ }
17
+ /**
18
+ * Dispatch a request
19
+ *
20
+ * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
21
+ * @param {?Object} config
22
+ *
23
+ * @returns {Promise} The Promise to be fulfilled
24
+ */
25
+ async request(t, e) {
26
+ try {
27
+ return await this._request(t, e);
28
+ } catch (s) {
29
+ if (s instanceof Error) {
30
+ let n;
31
+ Error.captureStackTrace ? Error.captureStackTrace(n = {}) : n = new Error();
32
+ const a = n.stack ? n.stack.replace(/^.+\n/, "") : "";
33
+ try {
34
+ s.stack ? a && !String(s.stack).endsWith(a.replace(/^.+\n.+\n/, "")) && (s.stack += `
35
+ ` + a) : s.stack = a;
36
+ } catch {
37
+ }
38
+ }
39
+ throw s;
40
+ }
41
+ }
42
+ _request(t, e) {
43
+ typeof t == "string" ? (e = e || {}, e.url = t) : e = t || {}, e = m(this.defaults, e);
44
+ const { transitional: s, paramsSerializer: n, headers: a } = e;
45
+ s !== void 0 && q.assertOptions(s, {
46
+ silentJSONParsing: u.transitional(u.boolean),
47
+ forcedJSONParsing: u.transitional(u.boolean),
48
+ clarifyTimeoutError: u.transitional(u.boolean)
49
+ }, !1), n != null && (d.isFunction(n) ? e.paramsSerializer = {
50
+ serialize: n
51
+ } : q.assertOptions(n, {
52
+ encode: u.function,
53
+ serialize: u.function
54
+ }, !0)), e.method = (e.method || this.defaults.method || "get").toLowerCase();
55
+ let f = a && d.merge(
56
+ a.common,
57
+ a[e.method]
58
+ );
59
+ a && d.forEach(
60
+ ["delete", "get", "head", "post", "put", "patch", "common"],
61
+ (r) => {
62
+ delete a[r];
63
+ }
64
+ ), e.headers = I.concat(f, a);
65
+ const h = [];
66
+ let y = !0;
67
+ this.interceptors.request.forEach(function(i) {
68
+ typeof i.runWhen == "function" && i.runWhen(e) === !1 || (y = y && i.synchronous, h.unshift(i.fulfilled, i.rejected));
69
+ });
70
+ const p = [];
71
+ this.interceptors.response.forEach(function(i) {
72
+ p.push(i.fulfilled, i.rejected);
73
+ });
74
+ let l, o = 0, c;
75
+ if (!y) {
76
+ const r = [S.bind(this), void 0];
77
+ for (r.unshift.apply(r, h), r.push.apply(r, p), c = r.length, l = Promise.resolve(e); o < c; )
78
+ l = l.then(r[o++], r[o++]);
79
+ return l;
80
+ }
81
+ c = h.length;
82
+ let E = e;
83
+ for (o = 0; o < c; ) {
84
+ const r = h[o++], i = h[o++];
85
+ try {
86
+ E = r(E);
87
+ } catch (P) {
88
+ i.call(this, P);
89
+ break;
90
+ }
91
+ }
92
+ try {
93
+ l = S.call(this, E);
94
+ } catch (r) {
95
+ return Promise.reject(r);
96
+ }
97
+ for (o = 0, c = p.length; o < c; )
98
+ l = l.then(p[o++], p[o++]);
99
+ return l;
100
+ }
101
+ getUri(t) {
102
+ t = m(this.defaults, t);
103
+ const e = C(t.baseURL, t.url);
104
+ return R(e, t.params, t.paramsSerializer);
105
+ }
106
+ }
107
+ d.forEach(["delete", "get", "head", "options"], function(t) {
108
+ k.prototype[t] = function(e, s) {
109
+ return this.request(m(s || {}, {
110
+ method: t,
111
+ url: e,
112
+ data: (s || {}).data
113
+ }));
114
+ };
115
+ });
116
+ d.forEach(["post", "put", "patch"], function(t) {
117
+ function e(s) {
118
+ return function(a, f, h) {
119
+ return this.request(m(h || {}, {
120
+ method: t,
121
+ headers: s ? {
122
+ "Content-Type": "multipart/form-data"
123
+ } : {},
124
+ url: a,
125
+ data: f
126
+ }));
127
+ };
128
+ }
129
+ k.prototype[t] = e(), k.prototype[t + "Form"] = e(!0);
130
+ });
131
+ export {
132
+ k as default
133
+ };