fds-vue-core 2.1.21 → 2.1.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/fds-vue-core.cjs.js +2947 -375
- package/dist/fds-vue-core.cjs.js.map +1 -1
- package/dist/fds-vue-core.css +1 -1
- package/dist/fds-vue-core.es.js +2948 -376
- package/dist/fds-vue-core.es.js.map +1 -1
- package/package.json +3 -1
- package/src/components/Blocks/FdsBlockExpander/FdsBlockExpander.vue +16 -7
- package/src/components/Blocks/FdsBlockExpander/types.ts +3 -0
- package/src/components/Buttons/FdsButtonDownload/FdsButtonDownload.vue +11 -54
- package/src/components/FdsSearchSelect/types.ts +5 -4
- package/src/components/FdsSticker/FdsSticker.vue +1 -1
- package/src/components/Form/FdsCheckbox/FdsCheckbox.vue +7 -5
- package/src/components/Form/FdsCheckbox/types.ts +6 -10
- package/src/components/Form/FdsInput/FdsInput.vue +16 -7
- package/src/components/Form/FdsInput/types.ts +8 -18
- package/src/components/Form/FdsRadio/FdsRadio.vue +0 -1
- package/src/components/Form/FdsRadio/types.ts +5 -10
- package/src/components/Form/FdsSelect/types.ts +6 -9
- package/src/components/Form/FdsTextarea/types.ts +5 -9
- package/src/composables/useDownload.ts +77 -0
- package/src/index.ts +2 -1
- package/src/.DS_Store +0 -0
package/dist/fds-vue-core.cjs.js
CHANGED
|
@@ -768,7 +768,52 @@ const _sfc_main$t = /* @__PURE__ */ vue.defineComponent({
|
|
|
768
768
|
};
|
|
769
769
|
}
|
|
770
770
|
});
|
|
771
|
-
const _hoisted_1$n =
|
|
771
|
+
const _hoisted_1$n = ["aria-live"];
|
|
772
|
+
const _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
|
|
773
|
+
__name: "FdsSticker",
|
|
774
|
+
props: {
|
|
775
|
+
variant: { default: "blue" },
|
|
776
|
+
bullet: { type: Boolean, default: false },
|
|
777
|
+
ariaLive: { default: void 0 }
|
|
778
|
+
},
|
|
779
|
+
setup(__props) {
|
|
780
|
+
const props = __props;
|
|
781
|
+
const stickerClasses = vue.computed(() => [
|
|
782
|
+
"inline-block font-bold text-sm leading-[18px] tracking-normal py-0.5 px-3 rounded-xl border border-transparent whitespace-nowrap max-w-full",
|
|
783
|
+
props.bullet ? "text-base! bg-transparent flex-wrap justify-start items-baseline text-base font-normal text-gray-700 border-transparent p-0! mr-3" : "",
|
|
784
|
+
// Variant colors
|
|
785
|
+
props.variant === "blue" && !props.bullet && "bg-blue-600 text-white",
|
|
786
|
+
props.variant === "green" && !props.bullet && "bg-green-700 text-white",
|
|
787
|
+
props.variant === "red" && !props.bullet && "bg-red-600 text-white",
|
|
788
|
+
props.variant === "yellow" && !props.bullet && "bg-yellow-200 text-gray-700 border-yellow-300",
|
|
789
|
+
props.variant === "gray" && !props.bullet && "bg-gray-200 text-gray-700 border-gray-300!",
|
|
790
|
+
props.variant === "t_blue" && !props.bullet && "bg-blue_t-100 text-gray-700 border-blue_t-200!"
|
|
791
|
+
]);
|
|
792
|
+
const bulletDotClasses = vue.computed(() => [
|
|
793
|
+
"inline-block w-3 h-3 rounded-full mr-1.5",
|
|
794
|
+
// Bullet dot colors
|
|
795
|
+
props.variant === "blue" && "bg-blue-600",
|
|
796
|
+
props.variant === "green" && "bg-green-700",
|
|
797
|
+
props.variant === "red" && "bg-red-600",
|
|
798
|
+
props.variant === "yellow" && "bg-yellow-200 border border-yellow-300",
|
|
799
|
+
props.variant === "gray" && "bg-gray-400",
|
|
800
|
+
props.variant === "t_blue" && "bg-blue-200 border border-blue-300"
|
|
801
|
+
]);
|
|
802
|
+
return (_ctx, _cache) => {
|
|
803
|
+
return vue.openBlock(), vue.createElementBlock("span", {
|
|
804
|
+
class: vue.normalizeClass(stickerClasses.value),
|
|
805
|
+
"aria-live": __props.ariaLive
|
|
806
|
+
}, [
|
|
807
|
+
__props.bullet ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
808
|
+
key: 0,
|
|
809
|
+
class: vue.normalizeClass(bulletDotClasses.value)
|
|
810
|
+
}, null, 2)) : vue.createCommentVNode("", true),
|
|
811
|
+
vue.renderSlot(_ctx.$slots, "default")
|
|
812
|
+
], 10, _hoisted_1$n);
|
|
813
|
+
};
|
|
814
|
+
}
|
|
815
|
+
});
|
|
816
|
+
const _hoisted_1$m = { class: "w-full flex justify-between items-start" };
|
|
772
817
|
const _hoisted_2$h = { class: "inline-flex items-center" };
|
|
773
818
|
const _hoisted_3$9 = {
|
|
774
819
|
key: 0,
|
|
@@ -780,7 +825,7 @@ const _hoisted_5$7 = {
|
|
|
780
825
|
class: "w-full flex mt-2"
|
|
781
826
|
};
|
|
782
827
|
const _hoisted_6$4 = ["aria-hidden"];
|
|
783
|
-
const _sfc_main$
|
|
828
|
+
const _sfc_main$r = /* @__PURE__ */ vue.defineComponent({
|
|
784
829
|
...{
|
|
785
830
|
inheritAttrs: false
|
|
786
831
|
},
|
|
@@ -790,7 +835,9 @@ const _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
|
|
|
790
835
|
label: { default: "" },
|
|
791
836
|
open: { type: Boolean, default: false },
|
|
792
837
|
preIcon: { default: void 0 },
|
|
793
|
-
id: { default: void 0 }
|
|
838
|
+
id: { default: void 0 },
|
|
839
|
+
stickerColor: { default: void 0 },
|
|
840
|
+
stickerText: { default: void 0 }
|
|
794
841
|
},
|
|
795
842
|
emits: ["toggle"],
|
|
796
843
|
setup(__props, { emit: __emit }) {
|
|
@@ -818,8 +865,7 @@ const _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
|
|
|
818
865
|
const headerClasses = vue.computed(() => [
|
|
819
866
|
"flex w-full flex-col text-left bg-white text-blue-600 rounded-2xl p-[calc(1rem-2px)] border-2 border-white transition-colors border-2 border-white hover:border-blue-500 active:bg-blue_t-100 active:border-white focus-visible:border-blue-500 focus-visible:border-dashed focus-visible:outline-0",
|
|
820
867
|
props.disabled ? "cursor-not-allowed hover:border-2 hover:border-transparent active:bg-white" : "cursor-pointer",
|
|
821
|
-
isOpen.value ? "rounded-b-none" : "rounded-b-2xl"
|
|
822
|
-
hasExtraRowSlot.value ? "" : ""
|
|
868
|
+
isOpen.value ? "rounded-b-none" : "rounded-b-2xl"
|
|
823
869
|
]);
|
|
824
870
|
const buttonRowClasses = vue.computed(() => ["flex justify-between items-start w-full", hasExtraRowSlot.value ? "" : ""]);
|
|
825
871
|
function handleToggle() {
|
|
@@ -839,7 +885,7 @@ const _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
|
|
|
839
885
|
vue.createElementVNode("span", {
|
|
840
886
|
class: vue.normalizeClass(buttonRowClasses.value)
|
|
841
887
|
}, [
|
|
842
|
-
vue.createElementVNode("span", _hoisted_1$
|
|
888
|
+
vue.createElementVNode("span", _hoisted_1$m, [
|
|
843
889
|
vue.createElementVNode("span", _hoisted_2$h, [
|
|
844
890
|
__props.preIcon ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_3$9, [
|
|
845
891
|
vue.createVNode(_sfc_main$w, {
|
|
@@ -854,11 +900,22 @@ const _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
|
|
|
854
900
|
}, vue.toDisplayString(__props.label), 3)
|
|
855
901
|
])
|
|
856
902
|
]),
|
|
857
|
-
vue.
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
903
|
+
vue.createElementVNode("span", null, [
|
|
904
|
+
__props.stickerText && __props.stickerColor ? (vue.openBlock(), vue.createBlock(_sfc_main$s, {
|
|
905
|
+
key: 0,
|
|
906
|
+
variant: __props.stickerColor
|
|
907
|
+
}, {
|
|
908
|
+
default: vue.withCtx(() => [
|
|
909
|
+
vue.createTextVNode(vue.toDisplayString(__props.stickerText), 1)
|
|
910
|
+
]),
|
|
911
|
+
_: 1
|
|
912
|
+
}, 8, ["variant"])) : vue.createCommentVNode("", true),
|
|
913
|
+
vue.createVNode(_sfc_main$w, {
|
|
914
|
+
name: "arrowDown",
|
|
915
|
+
size: 24,
|
|
916
|
+
class: vue.normalizeClass(["ml-4 transition-transform duration-200 fill-blue-500 min-w-6 min-h-6", { "rotate-180": isOpen.value, "fill-gray-500": __props.disabled }])
|
|
917
|
+
}, null, 8, ["class"])
|
|
918
|
+
])
|
|
862
919
|
])
|
|
863
920
|
], 2),
|
|
864
921
|
vue.unref(hasExtraRowSlot) && !isOpen.value ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_5$7, [
|
|
@@ -877,7 +934,7 @@ const _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
|
|
|
877
934
|
};
|
|
878
935
|
}
|
|
879
936
|
});
|
|
880
|
-
const _hoisted_1$
|
|
937
|
+
const _hoisted_1$l = ["id"];
|
|
881
938
|
const _hoisted_2$g = {
|
|
882
939
|
key: 0,
|
|
883
940
|
class: "flex items-start gap-4"
|
|
@@ -902,7 +959,7 @@ const _hoisted_13$1 = { class: "flex items-start gap-3" };
|
|
|
902
959
|
const _hoisted_14 = { class: "mb-0-last-child" };
|
|
903
960
|
const smallIconSize = 24;
|
|
904
961
|
const largeIconSize = 48;
|
|
905
|
-
const _sfc_main$
|
|
962
|
+
const _sfc_main$q = /* @__PURE__ */ vue.defineComponent({
|
|
906
963
|
__name: "FdsBlockInfo",
|
|
907
964
|
props: {
|
|
908
965
|
heading: { default: void 0 },
|
|
@@ -970,16 +1027,16 @@ const _sfc_main$r = /* @__PURE__ */ vue.defineComponent({
|
|
|
970
1027
|
vue.renderSlot(_ctx.$slots, "default")
|
|
971
1028
|
])
|
|
972
1029
|
]))
|
|
973
|
-
], 10, _hoisted_1$
|
|
1030
|
+
], 10, _hoisted_1$l);
|
|
974
1031
|
};
|
|
975
1032
|
}
|
|
976
1033
|
});
|
|
977
|
-
const _hoisted_1$
|
|
1034
|
+
const _hoisted_1$k = { class: "mb-0-last-child" };
|
|
978
1035
|
const _hoisted_2$f = {
|
|
979
1036
|
key: 0,
|
|
980
1037
|
class: "flex items-end"
|
|
981
1038
|
};
|
|
982
|
-
const _sfc_main$
|
|
1039
|
+
const _sfc_main$p = /* @__PURE__ */ vue.defineComponent({
|
|
983
1040
|
...{
|
|
984
1041
|
inheritAttrs: false
|
|
985
1042
|
},
|
|
@@ -1087,7 +1144,7 @@ const _sfc_main$q = /* @__PURE__ */ vue.defineComponent({
|
|
|
1087
1144
|
vue.createElementVNode("div", {
|
|
1088
1145
|
class: vue.normalizeClass(slotWrapperClasses.value)
|
|
1089
1146
|
}, [
|
|
1090
|
-
vue.createElementVNode("div", _hoisted_1$
|
|
1147
|
+
vue.createElementVNode("div", _hoisted_1$k, [
|
|
1091
1148
|
vue.renderSlot(_ctx.$slots, "default")
|
|
1092
1149
|
]),
|
|
1093
1150
|
vue.unref(hasStickerSlot) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$f, [
|
|
@@ -1108,8 +1165,8 @@ const _sfc_main$q = /* @__PURE__ */ vue.defineComponent({
|
|
|
1108
1165
|
};
|
|
1109
1166
|
}
|
|
1110
1167
|
});
|
|
1111
|
-
const _hoisted_1$
|
|
1112
|
-
const _sfc_main$
|
|
1168
|
+
const _hoisted_1$j = ["aria-label"];
|
|
1169
|
+
const _sfc_main$o = /* @__PURE__ */ vue.defineComponent({
|
|
1113
1170
|
__name: "FdsSpinner",
|
|
1114
1171
|
props: {
|
|
1115
1172
|
size: { default: "48px" },
|
|
@@ -1181,14 +1238,14 @@ const _sfc_main$p = /* @__PURE__ */ vue.defineComponent({
|
|
|
1181
1238
|
key: 0,
|
|
1182
1239
|
class: vue.normalizeClass(__props.labelPosition === "bottom" ? "font-bold" : "")
|
|
1183
1240
|
}, vue.toDisplayString(__props.label), 3)) : vue.createCommentVNode("", true)
|
|
1184
|
-
], 10, _hoisted_1$
|
|
1241
|
+
], 10, _hoisted_1$j);
|
|
1185
1242
|
};
|
|
1186
1243
|
}
|
|
1187
1244
|
});
|
|
1188
|
-
const _hoisted_1$
|
|
1245
|
+
const _hoisted_1$i = ["aria-disabled"];
|
|
1189
1246
|
const _hoisted_2$e = { class: "pt-0.5" };
|
|
1190
1247
|
const elBase$2 = "box-border appearance-none inline-flex items-start justify-center w-fit cursor-pointer shadow-none p-0.5 text-base select-none m-0 rounded-md text-left align-start no-underline transition-[box-shadow,border-color,background-color] duration-200 font-main font-bold text-base leading-5 tracking-normal focus-visible:outline-dashed focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-blue-500";
|
|
1191
|
-
const _sfc_main$
|
|
1248
|
+
const _sfc_main$n = /* @__PURE__ */ vue.defineComponent({
|
|
1192
1249
|
...{
|
|
1193
1250
|
inheritAttrs: false
|
|
1194
1251
|
},
|
|
@@ -1245,136 +1302,2759 @@ const _sfc_main$o = /* @__PURE__ */ vue.defineComponent({
|
|
|
1245
1302
|
}
|
|
1246
1303
|
emit("click", ev);
|
|
1247
1304
|
};
|
|
1248
|
-
const linkAttrs = vue.computed(() => {
|
|
1249
|
-
if (props.as === "a") return { href: props.href };
|
|
1250
|
-
if (props.as === "router-link") return { to: props.href };
|
|
1251
|
-
return {};
|
|
1305
|
+
const linkAttrs = vue.computed(() => {
|
|
1306
|
+
if (props.as === "a") return { href: props.href };
|
|
1307
|
+
if (props.as === "router-link") return { to: props.href };
|
|
1308
|
+
return {};
|
|
1309
|
+
});
|
|
1310
|
+
const componentAttrs = vue.computed(() => ({
|
|
1311
|
+
...linkAttrs.value,
|
|
1312
|
+
...attrs
|
|
1313
|
+
}));
|
|
1314
|
+
return (_ctx, _cache) => {
|
|
1315
|
+
return vue.openBlock(), vue.createElementBlock("div", {
|
|
1316
|
+
class: vue.normalizeClass(rootClasses.value),
|
|
1317
|
+
"aria-disabled": __props.disabled ? "true" : void 0
|
|
1318
|
+
}, [
|
|
1319
|
+
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(__props.as), vue.mergeProps(componentAttrs.value, {
|
|
1320
|
+
type: __props.as === "button" ? __props.type : void 0,
|
|
1321
|
+
disabled: __props.as === "button" ? __props.disabled : void 0,
|
|
1322
|
+
target: __props.as === "a" ? __props.target : void 0,
|
|
1323
|
+
rel: __props.as === "a" ? __props.rel : void 0,
|
|
1324
|
+
class: buttonClasses.value,
|
|
1325
|
+
onClick
|
|
1326
|
+
}), {
|
|
1327
|
+
default: vue.withCtx(() => [
|
|
1328
|
+
__props.loading ? (vue.openBlock(), vue.createBlock(_sfc_main$o, {
|
|
1329
|
+
key: 0,
|
|
1330
|
+
class: "mr-2",
|
|
1331
|
+
size: "24px",
|
|
1332
|
+
color: "inherit"
|
|
1333
|
+
})) : __props.icon ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
1334
|
+
key: 1,
|
|
1335
|
+
class: vue.normalizeClass(iconOrderClasses.value),
|
|
1336
|
+
"aria-hidden": "true"
|
|
1337
|
+
}, [
|
|
1338
|
+
vue.createVNode(_sfc_main$w, {
|
|
1339
|
+
class: vue.normalizeClass(iconFillClass2.value),
|
|
1340
|
+
name: __props.icon,
|
|
1341
|
+
size: 24
|
|
1342
|
+
}, null, 8, ["class", "name"])
|
|
1343
|
+
], 2)) : vue.createCommentVNode("", true),
|
|
1344
|
+
vue.createElementVNode("span", _hoisted_2$e, vue.toDisplayString(__props.text), 1)
|
|
1345
|
+
]),
|
|
1346
|
+
_: 1
|
|
1347
|
+
}, 16, ["type", "disabled", "target", "rel", "class"]))
|
|
1348
|
+
], 10, _hoisted_1$i);
|
|
1349
|
+
};
|
|
1350
|
+
}
|
|
1351
|
+
});
|
|
1352
|
+
const _hoisted_1$h = {
|
|
1353
|
+
key: 0,
|
|
1354
|
+
class: "flex items-center gap-2 h-7"
|
|
1355
|
+
};
|
|
1356
|
+
const _sfc_main$m = /* @__PURE__ */ vue.defineComponent({
|
|
1357
|
+
__name: "FdsButtonCopy",
|
|
1358
|
+
props: {
|
|
1359
|
+
value: { default: "" },
|
|
1360
|
+
targetId: {},
|
|
1361
|
+
label: { default: "Kopiera" },
|
|
1362
|
+
copiedLabel: { default: "Kopierat!" },
|
|
1363
|
+
timeoutMs: { default: 800 },
|
|
1364
|
+
disabled: { type: Boolean, default: false },
|
|
1365
|
+
onClick: {}
|
|
1366
|
+
},
|
|
1367
|
+
emits: ["click"],
|
|
1368
|
+
setup(__props) {
|
|
1369
|
+
const props = __props;
|
|
1370
|
+
const isCopied = vue.ref(false);
|
|
1371
|
+
let resetTimer = null;
|
|
1372
|
+
async function copyToClipboard(text) {
|
|
1373
|
+
try {
|
|
1374
|
+
if (navigator.clipboard && navigator.clipboard.writeText) {
|
|
1375
|
+
await navigator.clipboard.writeText(text);
|
|
1376
|
+
return true;
|
|
1377
|
+
}
|
|
1378
|
+
} catch {
|
|
1379
|
+
}
|
|
1380
|
+
const textarea = document.createElement("textarea");
|
|
1381
|
+
textarea.value = text;
|
|
1382
|
+
textarea.style.position = "fixed";
|
|
1383
|
+
textarea.style.opacity = "0";
|
|
1384
|
+
document.body.appendChild(textarea);
|
|
1385
|
+
textarea.focus();
|
|
1386
|
+
textarea.select();
|
|
1387
|
+
let ok = false;
|
|
1388
|
+
try {
|
|
1389
|
+
ok = document.execCommand("copy");
|
|
1390
|
+
} catch {
|
|
1391
|
+
ok = false;
|
|
1392
|
+
}
|
|
1393
|
+
document.body.removeChild(textarea);
|
|
1394
|
+
return ok;
|
|
1395
|
+
}
|
|
1396
|
+
async function onClick() {
|
|
1397
|
+
if (props.disabled) return;
|
|
1398
|
+
let textToCopy = props.value;
|
|
1399
|
+
if (props.targetId) {
|
|
1400
|
+
const el = document.getElementById(props.targetId);
|
|
1401
|
+
if (el) {
|
|
1402
|
+
textToCopy = el.innerText || el.textContent || "";
|
|
1403
|
+
}
|
|
1404
|
+
}
|
|
1405
|
+
if (!textToCopy) return;
|
|
1406
|
+
const ok = await copyToClipboard(textToCopy);
|
|
1407
|
+
if (!ok) return;
|
|
1408
|
+
isCopied.value = true;
|
|
1409
|
+
if (resetTimer) clearTimeout(resetTimer);
|
|
1410
|
+
resetTimer = setTimeout(() => isCopied.value = false, props.timeoutMs);
|
|
1411
|
+
}
|
|
1412
|
+
vue.onMounted(() => {
|
|
1413
|
+
if (resetTimer) {
|
|
1414
|
+
clearTimeout(resetTimer);
|
|
1415
|
+
resetTimer = null;
|
|
1416
|
+
}
|
|
1417
|
+
});
|
|
1418
|
+
return (_ctx, _cache) => {
|
|
1419
|
+
return isCopied.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$h, [
|
|
1420
|
+
vue.createVNode(_sfc_main$w, { name: "bigSuccess" }),
|
|
1421
|
+
vue.createElementVNode("span", null, vue.toDisplayString(props.copiedLabel), 1)
|
|
1422
|
+
])) : (vue.openBlock(), vue.createBlock(_sfc_main$n, {
|
|
1423
|
+
key: 1,
|
|
1424
|
+
type: "button",
|
|
1425
|
+
disabled: props.disabled,
|
|
1426
|
+
icon: "copy",
|
|
1427
|
+
text: isCopied.value ? props.copiedLabel : props.label,
|
|
1428
|
+
onClick
|
|
1429
|
+
}, null, 8, ["disabled", "text"]));
|
|
1430
|
+
};
|
|
1431
|
+
}
|
|
1432
|
+
});
|
|
1433
|
+
function bind(fn, thisArg) {
|
|
1434
|
+
return function wrap() {
|
|
1435
|
+
return fn.apply(thisArg, arguments);
|
|
1436
|
+
};
|
|
1437
|
+
}
|
|
1438
|
+
const { toString } = Object.prototype;
|
|
1439
|
+
const { getPrototypeOf } = Object;
|
|
1440
|
+
const { iterator, toStringTag } = Symbol;
|
|
1441
|
+
const kindOf = /* @__PURE__ */ ((cache) => (thing) => {
|
|
1442
|
+
const str = toString.call(thing);
|
|
1443
|
+
return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
|
|
1444
|
+
})(/* @__PURE__ */ Object.create(null));
|
|
1445
|
+
const kindOfTest = (type) => {
|
|
1446
|
+
type = type.toLowerCase();
|
|
1447
|
+
return (thing) => kindOf(thing) === type;
|
|
1448
|
+
};
|
|
1449
|
+
const typeOfTest = (type) => (thing) => typeof thing === type;
|
|
1450
|
+
const { isArray } = Array;
|
|
1451
|
+
const isUndefined = typeOfTest("undefined");
|
|
1452
|
+
function isBuffer(val) {
|
|
1453
|
+
return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction$1(val.constructor.isBuffer) && val.constructor.isBuffer(val);
|
|
1454
|
+
}
|
|
1455
|
+
const isArrayBuffer = kindOfTest("ArrayBuffer");
|
|
1456
|
+
function isArrayBufferView(val) {
|
|
1457
|
+
let result;
|
|
1458
|
+
if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) {
|
|
1459
|
+
result = ArrayBuffer.isView(val);
|
|
1460
|
+
} else {
|
|
1461
|
+
result = val && val.buffer && isArrayBuffer(val.buffer);
|
|
1462
|
+
}
|
|
1463
|
+
return result;
|
|
1464
|
+
}
|
|
1465
|
+
const isString$1 = typeOfTest("string");
|
|
1466
|
+
const isFunction$1 = typeOfTest("function");
|
|
1467
|
+
const isNumber = typeOfTest("number");
|
|
1468
|
+
const isObject$1 = (thing) => thing !== null && typeof thing === "object";
|
|
1469
|
+
const isBoolean = (thing) => thing === true || thing === false;
|
|
1470
|
+
const isPlainObject = (val) => {
|
|
1471
|
+
if (kindOf(val) !== "object") {
|
|
1472
|
+
return false;
|
|
1473
|
+
}
|
|
1474
|
+
const prototype2 = getPrototypeOf(val);
|
|
1475
|
+
return (prototype2 === null || prototype2 === Object.prototype || Object.getPrototypeOf(prototype2) === null) && !(toStringTag in val) && !(iterator in val);
|
|
1476
|
+
};
|
|
1477
|
+
const isEmptyObject = (val) => {
|
|
1478
|
+
if (!isObject$1(val) || isBuffer(val)) {
|
|
1479
|
+
return false;
|
|
1480
|
+
}
|
|
1481
|
+
try {
|
|
1482
|
+
return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype;
|
|
1483
|
+
} catch (e) {
|
|
1484
|
+
return false;
|
|
1485
|
+
}
|
|
1486
|
+
};
|
|
1487
|
+
const isDate = kindOfTest("Date");
|
|
1488
|
+
const isFile = kindOfTest("File");
|
|
1489
|
+
const isBlob = kindOfTest("Blob");
|
|
1490
|
+
const isFileList = kindOfTest("FileList");
|
|
1491
|
+
const isStream = (val) => isObject$1(val) && isFunction$1(val.pipe);
|
|
1492
|
+
const isFormData = (thing) => {
|
|
1493
|
+
let kind;
|
|
1494
|
+
return thing && (typeof FormData === "function" && thing instanceof FormData || isFunction$1(thing.append) && ((kind = kindOf(thing)) === "formdata" || // detect form-data instance
|
|
1495
|
+
kind === "object" && isFunction$1(thing.toString) && thing.toString() === "[object FormData]"));
|
|
1496
|
+
};
|
|
1497
|
+
const isURLSearchParams = kindOfTest("URLSearchParams");
|
|
1498
|
+
const [isReadableStream, isRequest, isResponse, isHeaders] = ["ReadableStream", "Request", "Response", "Headers"].map(kindOfTest);
|
|
1499
|
+
const trim = (str) => str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
1500
|
+
function forEach(obj, fn, { allOwnKeys = false } = {}) {
|
|
1501
|
+
if (obj === null || typeof obj === "undefined") {
|
|
1502
|
+
return;
|
|
1503
|
+
}
|
|
1504
|
+
let i;
|
|
1505
|
+
let l;
|
|
1506
|
+
if (typeof obj !== "object") {
|
|
1507
|
+
obj = [obj];
|
|
1508
|
+
}
|
|
1509
|
+
if (isArray(obj)) {
|
|
1510
|
+
for (i = 0, l = obj.length; i < l; i++) {
|
|
1511
|
+
fn.call(null, obj[i], i, obj);
|
|
1512
|
+
}
|
|
1513
|
+
} else {
|
|
1514
|
+
if (isBuffer(obj)) {
|
|
1515
|
+
return;
|
|
1516
|
+
}
|
|
1517
|
+
const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
|
|
1518
|
+
const len = keys.length;
|
|
1519
|
+
let key;
|
|
1520
|
+
for (i = 0; i < len; i++) {
|
|
1521
|
+
key = keys[i];
|
|
1522
|
+
fn.call(null, obj[key], key, obj);
|
|
1523
|
+
}
|
|
1524
|
+
}
|
|
1525
|
+
}
|
|
1526
|
+
function findKey(obj, key) {
|
|
1527
|
+
if (isBuffer(obj)) {
|
|
1528
|
+
return null;
|
|
1529
|
+
}
|
|
1530
|
+
key = key.toLowerCase();
|
|
1531
|
+
const keys = Object.keys(obj);
|
|
1532
|
+
let i = keys.length;
|
|
1533
|
+
let _key;
|
|
1534
|
+
while (i-- > 0) {
|
|
1535
|
+
_key = keys[i];
|
|
1536
|
+
if (key === _key.toLowerCase()) {
|
|
1537
|
+
return _key;
|
|
1538
|
+
}
|
|
1539
|
+
}
|
|
1540
|
+
return null;
|
|
1541
|
+
}
|
|
1542
|
+
const _global = (() => {
|
|
1543
|
+
if (typeof globalThis !== "undefined") return globalThis;
|
|
1544
|
+
return typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : global;
|
|
1545
|
+
})();
|
|
1546
|
+
const isContextDefined = (context) => !isUndefined(context) && context !== _global;
|
|
1547
|
+
function merge() {
|
|
1548
|
+
const { caseless, skipUndefined } = isContextDefined(this) && this || {};
|
|
1549
|
+
const result = {};
|
|
1550
|
+
const assignValue = (val, key) => {
|
|
1551
|
+
const targetKey = caseless && findKey(result, key) || key;
|
|
1552
|
+
if (isPlainObject(result[targetKey]) && isPlainObject(val)) {
|
|
1553
|
+
result[targetKey] = merge(result[targetKey], val);
|
|
1554
|
+
} else if (isPlainObject(val)) {
|
|
1555
|
+
result[targetKey] = merge({}, val);
|
|
1556
|
+
} else if (isArray(val)) {
|
|
1557
|
+
result[targetKey] = val.slice();
|
|
1558
|
+
} else if (!skipUndefined || !isUndefined(val)) {
|
|
1559
|
+
result[targetKey] = val;
|
|
1560
|
+
}
|
|
1561
|
+
};
|
|
1562
|
+
for (let i = 0, l = arguments.length; i < l; i++) {
|
|
1563
|
+
arguments[i] && forEach(arguments[i], assignValue);
|
|
1564
|
+
}
|
|
1565
|
+
return result;
|
|
1566
|
+
}
|
|
1567
|
+
const extend = (a, b, thisArg, { allOwnKeys } = {}) => {
|
|
1568
|
+
forEach(b, (val, key) => {
|
|
1569
|
+
if (thisArg && isFunction$1(val)) {
|
|
1570
|
+
a[key] = bind(val, thisArg);
|
|
1571
|
+
} else {
|
|
1572
|
+
a[key] = val;
|
|
1573
|
+
}
|
|
1574
|
+
}, { allOwnKeys });
|
|
1575
|
+
return a;
|
|
1576
|
+
};
|
|
1577
|
+
const stripBOM = (content) => {
|
|
1578
|
+
if (content.charCodeAt(0) === 65279) {
|
|
1579
|
+
content = content.slice(1);
|
|
1580
|
+
}
|
|
1581
|
+
return content;
|
|
1582
|
+
};
|
|
1583
|
+
const inherits = (constructor, superConstructor, props, descriptors2) => {
|
|
1584
|
+
constructor.prototype = Object.create(superConstructor.prototype, descriptors2);
|
|
1585
|
+
constructor.prototype.constructor = constructor;
|
|
1586
|
+
Object.defineProperty(constructor, "super", {
|
|
1587
|
+
value: superConstructor.prototype
|
|
1588
|
+
});
|
|
1589
|
+
props && Object.assign(constructor.prototype, props);
|
|
1590
|
+
};
|
|
1591
|
+
const toFlatObject = (sourceObj, destObj, filter2, propFilter) => {
|
|
1592
|
+
let props;
|
|
1593
|
+
let i;
|
|
1594
|
+
let prop;
|
|
1595
|
+
const merged = {};
|
|
1596
|
+
destObj = destObj || {};
|
|
1597
|
+
if (sourceObj == null) return destObj;
|
|
1598
|
+
do {
|
|
1599
|
+
props = Object.getOwnPropertyNames(sourceObj);
|
|
1600
|
+
i = props.length;
|
|
1601
|
+
while (i-- > 0) {
|
|
1602
|
+
prop = props[i];
|
|
1603
|
+
if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {
|
|
1604
|
+
destObj[prop] = sourceObj[prop];
|
|
1605
|
+
merged[prop] = true;
|
|
1606
|
+
}
|
|
1607
|
+
}
|
|
1608
|
+
sourceObj = filter2 !== false && getPrototypeOf(sourceObj);
|
|
1609
|
+
} while (sourceObj && (!filter2 || filter2(sourceObj, destObj)) && sourceObj !== Object.prototype);
|
|
1610
|
+
return destObj;
|
|
1611
|
+
};
|
|
1612
|
+
const endsWith = (str, searchString, position) => {
|
|
1613
|
+
str = String(str);
|
|
1614
|
+
if (position === void 0 || position > str.length) {
|
|
1615
|
+
position = str.length;
|
|
1616
|
+
}
|
|
1617
|
+
position -= searchString.length;
|
|
1618
|
+
const lastIndex = str.indexOf(searchString, position);
|
|
1619
|
+
return lastIndex !== -1 && lastIndex === position;
|
|
1620
|
+
};
|
|
1621
|
+
const toArray = (thing) => {
|
|
1622
|
+
if (!thing) return null;
|
|
1623
|
+
if (isArray(thing)) return thing;
|
|
1624
|
+
let i = thing.length;
|
|
1625
|
+
if (!isNumber(i)) return null;
|
|
1626
|
+
const arr = new Array(i);
|
|
1627
|
+
while (i-- > 0) {
|
|
1628
|
+
arr[i] = thing[i];
|
|
1629
|
+
}
|
|
1630
|
+
return arr;
|
|
1631
|
+
};
|
|
1632
|
+
const isTypedArray = /* @__PURE__ */ ((TypedArray) => {
|
|
1633
|
+
return (thing) => {
|
|
1634
|
+
return TypedArray && thing instanceof TypedArray;
|
|
1635
|
+
};
|
|
1636
|
+
})(typeof Uint8Array !== "undefined" && getPrototypeOf(Uint8Array));
|
|
1637
|
+
const forEachEntry = (obj, fn) => {
|
|
1638
|
+
const generator = obj && obj[iterator];
|
|
1639
|
+
const _iterator = generator.call(obj);
|
|
1640
|
+
let result;
|
|
1641
|
+
while ((result = _iterator.next()) && !result.done) {
|
|
1642
|
+
const pair = result.value;
|
|
1643
|
+
fn.call(obj, pair[0], pair[1]);
|
|
1644
|
+
}
|
|
1645
|
+
};
|
|
1646
|
+
const matchAll = (regExp, str) => {
|
|
1647
|
+
let matches;
|
|
1648
|
+
const arr = [];
|
|
1649
|
+
while ((matches = regExp.exec(str)) !== null) {
|
|
1650
|
+
arr.push(matches);
|
|
1651
|
+
}
|
|
1652
|
+
return arr;
|
|
1653
|
+
};
|
|
1654
|
+
const isHTMLForm = kindOfTest("HTMLFormElement");
|
|
1655
|
+
const toCamelCase = (str) => {
|
|
1656
|
+
return str.toLowerCase().replace(
|
|
1657
|
+
/[-_\s]([a-z\d])(\w*)/g,
|
|
1658
|
+
function replacer(m, p1, p2) {
|
|
1659
|
+
return p1.toUpperCase() + p2;
|
|
1660
|
+
}
|
|
1661
|
+
);
|
|
1662
|
+
};
|
|
1663
|
+
const hasOwnProperty = (({ hasOwnProperty: hasOwnProperty2 }) => (obj, prop) => hasOwnProperty2.call(obj, prop))(Object.prototype);
|
|
1664
|
+
const isRegExp = kindOfTest("RegExp");
|
|
1665
|
+
const reduceDescriptors = (obj, reducer) => {
|
|
1666
|
+
const descriptors2 = Object.getOwnPropertyDescriptors(obj);
|
|
1667
|
+
const reducedDescriptors = {};
|
|
1668
|
+
forEach(descriptors2, (descriptor, name) => {
|
|
1669
|
+
let ret;
|
|
1670
|
+
if ((ret = reducer(descriptor, name, obj)) !== false) {
|
|
1671
|
+
reducedDescriptors[name] = ret || descriptor;
|
|
1672
|
+
}
|
|
1673
|
+
});
|
|
1674
|
+
Object.defineProperties(obj, reducedDescriptors);
|
|
1675
|
+
};
|
|
1676
|
+
const freezeMethods = (obj) => {
|
|
1677
|
+
reduceDescriptors(obj, (descriptor, name) => {
|
|
1678
|
+
if (isFunction$1(obj) && ["arguments", "caller", "callee"].indexOf(name) !== -1) {
|
|
1679
|
+
return false;
|
|
1680
|
+
}
|
|
1681
|
+
const value = obj[name];
|
|
1682
|
+
if (!isFunction$1(value)) return;
|
|
1683
|
+
descriptor.enumerable = false;
|
|
1684
|
+
if ("writable" in descriptor) {
|
|
1685
|
+
descriptor.writable = false;
|
|
1686
|
+
return;
|
|
1687
|
+
}
|
|
1688
|
+
if (!descriptor.set) {
|
|
1689
|
+
descriptor.set = () => {
|
|
1690
|
+
throw Error("Can not rewrite read-only method '" + name + "'");
|
|
1691
|
+
};
|
|
1692
|
+
}
|
|
1693
|
+
});
|
|
1694
|
+
};
|
|
1695
|
+
const toObjectSet = (arrayOrString, delimiter) => {
|
|
1696
|
+
const obj = {};
|
|
1697
|
+
const define = (arr) => {
|
|
1698
|
+
arr.forEach((value) => {
|
|
1699
|
+
obj[value] = true;
|
|
1700
|
+
});
|
|
1701
|
+
};
|
|
1702
|
+
isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));
|
|
1703
|
+
return obj;
|
|
1704
|
+
};
|
|
1705
|
+
const noop = () => {
|
|
1706
|
+
};
|
|
1707
|
+
const toFiniteNumber = (value, defaultValue) => {
|
|
1708
|
+
return value != null && Number.isFinite(value = +value) ? value : defaultValue;
|
|
1709
|
+
};
|
|
1710
|
+
function isSpecCompliantForm(thing) {
|
|
1711
|
+
return !!(thing && isFunction$1(thing.append) && thing[toStringTag] === "FormData" && thing[iterator]);
|
|
1712
|
+
}
|
|
1713
|
+
const toJSONObject = (obj) => {
|
|
1714
|
+
const stack = new Array(10);
|
|
1715
|
+
const visit = (source, i) => {
|
|
1716
|
+
if (isObject$1(source)) {
|
|
1717
|
+
if (stack.indexOf(source) >= 0) {
|
|
1718
|
+
return;
|
|
1719
|
+
}
|
|
1720
|
+
if (isBuffer(source)) {
|
|
1721
|
+
return source;
|
|
1722
|
+
}
|
|
1723
|
+
if (!("toJSON" in source)) {
|
|
1724
|
+
stack[i] = source;
|
|
1725
|
+
const target = isArray(source) ? [] : {};
|
|
1726
|
+
forEach(source, (value, key) => {
|
|
1727
|
+
const reducedValue = visit(value, i + 1);
|
|
1728
|
+
!isUndefined(reducedValue) && (target[key] = reducedValue);
|
|
1729
|
+
});
|
|
1730
|
+
stack[i] = void 0;
|
|
1731
|
+
return target;
|
|
1732
|
+
}
|
|
1733
|
+
}
|
|
1734
|
+
return source;
|
|
1735
|
+
};
|
|
1736
|
+
return visit(obj, 0);
|
|
1737
|
+
};
|
|
1738
|
+
const isAsyncFn = kindOfTest("AsyncFunction");
|
|
1739
|
+
const isThenable = (thing) => thing && (isObject$1(thing) || isFunction$1(thing)) && isFunction$1(thing.then) && isFunction$1(thing.catch);
|
|
1740
|
+
const _setImmediate = ((setImmediateSupported, postMessageSupported) => {
|
|
1741
|
+
if (setImmediateSupported) {
|
|
1742
|
+
return setImmediate;
|
|
1743
|
+
}
|
|
1744
|
+
return postMessageSupported ? ((token, callbacks) => {
|
|
1745
|
+
_global.addEventListener("message", ({ source, data }) => {
|
|
1746
|
+
if (source === _global && data === token) {
|
|
1747
|
+
callbacks.length && callbacks.shift()();
|
|
1748
|
+
}
|
|
1749
|
+
}, false);
|
|
1750
|
+
return (cb) => {
|
|
1751
|
+
callbacks.push(cb);
|
|
1752
|
+
_global.postMessage(token, "*");
|
|
1753
|
+
};
|
|
1754
|
+
})(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);
|
|
1755
|
+
})(
|
|
1756
|
+
typeof setImmediate === "function",
|
|
1757
|
+
isFunction$1(_global.postMessage)
|
|
1758
|
+
);
|
|
1759
|
+
const asap = typeof queueMicrotask !== "undefined" ? queueMicrotask.bind(_global) : typeof process !== "undefined" && process.nextTick || _setImmediate;
|
|
1760
|
+
const isIterable = (thing) => thing != null && isFunction$1(thing[iterator]);
|
|
1761
|
+
const utils$1 = {
|
|
1762
|
+
isArray,
|
|
1763
|
+
isArrayBuffer,
|
|
1764
|
+
isBuffer,
|
|
1765
|
+
isFormData,
|
|
1766
|
+
isArrayBufferView,
|
|
1767
|
+
isString: isString$1,
|
|
1768
|
+
isNumber,
|
|
1769
|
+
isBoolean,
|
|
1770
|
+
isObject: isObject$1,
|
|
1771
|
+
isPlainObject,
|
|
1772
|
+
isEmptyObject,
|
|
1773
|
+
isReadableStream,
|
|
1774
|
+
isRequest,
|
|
1775
|
+
isResponse,
|
|
1776
|
+
isHeaders,
|
|
1777
|
+
isUndefined,
|
|
1778
|
+
isDate,
|
|
1779
|
+
isFile,
|
|
1780
|
+
isBlob,
|
|
1781
|
+
isRegExp,
|
|
1782
|
+
isFunction: isFunction$1,
|
|
1783
|
+
isStream,
|
|
1784
|
+
isURLSearchParams,
|
|
1785
|
+
isTypedArray,
|
|
1786
|
+
isFileList,
|
|
1787
|
+
forEach,
|
|
1788
|
+
merge,
|
|
1789
|
+
extend,
|
|
1790
|
+
trim,
|
|
1791
|
+
stripBOM,
|
|
1792
|
+
inherits,
|
|
1793
|
+
toFlatObject,
|
|
1794
|
+
kindOf,
|
|
1795
|
+
kindOfTest,
|
|
1796
|
+
endsWith,
|
|
1797
|
+
toArray,
|
|
1798
|
+
forEachEntry,
|
|
1799
|
+
matchAll,
|
|
1800
|
+
isHTMLForm,
|
|
1801
|
+
hasOwnProperty,
|
|
1802
|
+
hasOwnProp: hasOwnProperty,
|
|
1803
|
+
// an alias to avoid ESLint no-prototype-builtins detection
|
|
1804
|
+
reduceDescriptors,
|
|
1805
|
+
freezeMethods,
|
|
1806
|
+
toObjectSet,
|
|
1807
|
+
toCamelCase,
|
|
1808
|
+
noop,
|
|
1809
|
+
toFiniteNumber,
|
|
1810
|
+
findKey,
|
|
1811
|
+
global: _global,
|
|
1812
|
+
isContextDefined,
|
|
1813
|
+
isSpecCompliantForm,
|
|
1814
|
+
toJSONObject,
|
|
1815
|
+
isAsyncFn,
|
|
1816
|
+
isThenable,
|
|
1817
|
+
setImmediate: _setImmediate,
|
|
1818
|
+
asap,
|
|
1819
|
+
isIterable
|
|
1820
|
+
};
|
|
1821
|
+
function AxiosError$1(message, code, config, request, response) {
|
|
1822
|
+
Error.call(this);
|
|
1823
|
+
if (Error.captureStackTrace) {
|
|
1824
|
+
Error.captureStackTrace(this, this.constructor);
|
|
1825
|
+
} else {
|
|
1826
|
+
this.stack = new Error().stack;
|
|
1827
|
+
}
|
|
1828
|
+
this.message = message;
|
|
1829
|
+
this.name = "AxiosError";
|
|
1830
|
+
code && (this.code = code);
|
|
1831
|
+
config && (this.config = config);
|
|
1832
|
+
request && (this.request = request);
|
|
1833
|
+
if (response) {
|
|
1834
|
+
this.response = response;
|
|
1835
|
+
this.status = response.status ? response.status : null;
|
|
1836
|
+
}
|
|
1837
|
+
}
|
|
1838
|
+
utils$1.inherits(AxiosError$1, Error, {
|
|
1839
|
+
toJSON: function toJSON() {
|
|
1840
|
+
return {
|
|
1841
|
+
// Standard
|
|
1842
|
+
message: this.message,
|
|
1843
|
+
name: this.name,
|
|
1844
|
+
// Microsoft
|
|
1845
|
+
description: this.description,
|
|
1846
|
+
number: this.number,
|
|
1847
|
+
// Mozilla
|
|
1848
|
+
fileName: this.fileName,
|
|
1849
|
+
lineNumber: this.lineNumber,
|
|
1850
|
+
columnNumber: this.columnNumber,
|
|
1851
|
+
stack: this.stack,
|
|
1852
|
+
// Axios
|
|
1853
|
+
config: utils$1.toJSONObject(this.config),
|
|
1854
|
+
code: this.code,
|
|
1855
|
+
status: this.status
|
|
1856
|
+
};
|
|
1857
|
+
}
|
|
1858
|
+
});
|
|
1859
|
+
const prototype$1 = AxiosError$1.prototype;
|
|
1860
|
+
const descriptors = {};
|
|
1861
|
+
[
|
|
1862
|
+
"ERR_BAD_OPTION_VALUE",
|
|
1863
|
+
"ERR_BAD_OPTION",
|
|
1864
|
+
"ECONNABORTED",
|
|
1865
|
+
"ETIMEDOUT",
|
|
1866
|
+
"ERR_NETWORK",
|
|
1867
|
+
"ERR_FR_TOO_MANY_REDIRECTS",
|
|
1868
|
+
"ERR_DEPRECATED",
|
|
1869
|
+
"ERR_BAD_RESPONSE",
|
|
1870
|
+
"ERR_BAD_REQUEST",
|
|
1871
|
+
"ERR_CANCELED",
|
|
1872
|
+
"ERR_NOT_SUPPORT",
|
|
1873
|
+
"ERR_INVALID_URL"
|
|
1874
|
+
// eslint-disable-next-line func-names
|
|
1875
|
+
].forEach((code) => {
|
|
1876
|
+
descriptors[code] = { value: code };
|
|
1877
|
+
});
|
|
1878
|
+
Object.defineProperties(AxiosError$1, descriptors);
|
|
1879
|
+
Object.defineProperty(prototype$1, "isAxiosError", { value: true });
|
|
1880
|
+
AxiosError$1.from = (error, code, config, request, response, customProps) => {
|
|
1881
|
+
const axiosError = Object.create(prototype$1);
|
|
1882
|
+
utils$1.toFlatObject(error, axiosError, function filter2(obj) {
|
|
1883
|
+
return obj !== Error.prototype;
|
|
1884
|
+
}, (prop) => {
|
|
1885
|
+
return prop !== "isAxiosError";
|
|
1886
|
+
});
|
|
1887
|
+
const msg = error && error.message ? error.message : "Error";
|
|
1888
|
+
const errCode = code == null && error ? error.code : code;
|
|
1889
|
+
AxiosError$1.call(axiosError, msg, errCode, config, request, response);
|
|
1890
|
+
if (error && axiosError.cause == null) {
|
|
1891
|
+
Object.defineProperty(axiosError, "cause", { value: error, configurable: true });
|
|
1892
|
+
}
|
|
1893
|
+
axiosError.name = error && error.name || "Error";
|
|
1894
|
+
customProps && Object.assign(axiosError, customProps);
|
|
1895
|
+
return axiosError;
|
|
1896
|
+
};
|
|
1897
|
+
const httpAdapter = null;
|
|
1898
|
+
function isVisitable(thing) {
|
|
1899
|
+
return utils$1.isPlainObject(thing) || utils$1.isArray(thing);
|
|
1900
|
+
}
|
|
1901
|
+
function removeBrackets(key) {
|
|
1902
|
+
return utils$1.endsWith(key, "[]") ? key.slice(0, -2) : key;
|
|
1903
|
+
}
|
|
1904
|
+
function renderKey(path, key, dots) {
|
|
1905
|
+
if (!path) return key;
|
|
1906
|
+
return path.concat(key).map(function each(token, i) {
|
|
1907
|
+
token = removeBrackets(token);
|
|
1908
|
+
return !dots && i ? "[" + token + "]" : token;
|
|
1909
|
+
}).join(dots ? "." : "");
|
|
1910
|
+
}
|
|
1911
|
+
function isFlatArray(arr) {
|
|
1912
|
+
return utils$1.isArray(arr) && !arr.some(isVisitable);
|
|
1913
|
+
}
|
|
1914
|
+
const predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) {
|
|
1915
|
+
return /^is[A-Z]/.test(prop);
|
|
1916
|
+
});
|
|
1917
|
+
function toFormData$1(obj, formData, options) {
|
|
1918
|
+
if (!utils$1.isObject(obj)) {
|
|
1919
|
+
throw new TypeError("target must be an object");
|
|
1920
|
+
}
|
|
1921
|
+
formData = formData || new FormData();
|
|
1922
|
+
options = utils$1.toFlatObject(options, {
|
|
1923
|
+
metaTokens: true,
|
|
1924
|
+
dots: false,
|
|
1925
|
+
indexes: false
|
|
1926
|
+
}, false, function defined(option, source) {
|
|
1927
|
+
return !utils$1.isUndefined(source[option]);
|
|
1928
|
+
});
|
|
1929
|
+
const metaTokens = options.metaTokens;
|
|
1930
|
+
const visitor = options.visitor || defaultVisitor;
|
|
1931
|
+
const dots = options.dots;
|
|
1932
|
+
const indexes = options.indexes;
|
|
1933
|
+
const _Blob = options.Blob || typeof Blob !== "undefined" && Blob;
|
|
1934
|
+
const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
|
|
1935
|
+
if (!utils$1.isFunction(visitor)) {
|
|
1936
|
+
throw new TypeError("visitor must be a function");
|
|
1937
|
+
}
|
|
1938
|
+
function convertValue(value) {
|
|
1939
|
+
if (value === null) return "";
|
|
1940
|
+
if (utils$1.isDate(value)) {
|
|
1941
|
+
return value.toISOString();
|
|
1942
|
+
}
|
|
1943
|
+
if (utils$1.isBoolean(value)) {
|
|
1944
|
+
return value.toString();
|
|
1945
|
+
}
|
|
1946
|
+
if (!useBlob && utils$1.isBlob(value)) {
|
|
1947
|
+
throw new AxiosError$1("Blob is not supported. Use a Buffer instead.");
|
|
1948
|
+
}
|
|
1949
|
+
if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
|
|
1950
|
+
return useBlob && typeof Blob === "function" ? new Blob([value]) : Buffer.from(value);
|
|
1951
|
+
}
|
|
1952
|
+
return value;
|
|
1953
|
+
}
|
|
1954
|
+
function defaultVisitor(value, key, path) {
|
|
1955
|
+
let arr = value;
|
|
1956
|
+
if (value && !path && typeof value === "object") {
|
|
1957
|
+
if (utils$1.endsWith(key, "{}")) {
|
|
1958
|
+
key = metaTokens ? key : key.slice(0, -2);
|
|
1959
|
+
value = JSON.stringify(value);
|
|
1960
|
+
} else if (utils$1.isArray(value) && isFlatArray(value) || (utils$1.isFileList(value) || utils$1.endsWith(key, "[]")) && (arr = utils$1.toArray(value))) {
|
|
1961
|
+
key = removeBrackets(key);
|
|
1962
|
+
arr.forEach(function each(el, index) {
|
|
1963
|
+
!(utils$1.isUndefined(el) || el === null) && formData.append(
|
|
1964
|
+
// eslint-disable-next-line no-nested-ternary
|
|
1965
|
+
indexes === true ? renderKey([key], index, dots) : indexes === null ? key : key + "[]",
|
|
1966
|
+
convertValue(el)
|
|
1967
|
+
);
|
|
1968
|
+
});
|
|
1969
|
+
return false;
|
|
1970
|
+
}
|
|
1971
|
+
}
|
|
1972
|
+
if (isVisitable(value)) {
|
|
1973
|
+
return true;
|
|
1974
|
+
}
|
|
1975
|
+
formData.append(renderKey(path, key, dots), convertValue(value));
|
|
1976
|
+
return false;
|
|
1977
|
+
}
|
|
1978
|
+
const stack = [];
|
|
1979
|
+
const exposedHelpers = Object.assign(predicates, {
|
|
1980
|
+
defaultVisitor,
|
|
1981
|
+
convertValue,
|
|
1982
|
+
isVisitable
|
|
1983
|
+
});
|
|
1984
|
+
function build(value, path) {
|
|
1985
|
+
if (utils$1.isUndefined(value)) return;
|
|
1986
|
+
if (stack.indexOf(value) !== -1) {
|
|
1987
|
+
throw Error("Circular reference detected in " + path.join("."));
|
|
1988
|
+
}
|
|
1989
|
+
stack.push(value);
|
|
1990
|
+
utils$1.forEach(value, function each(el, key) {
|
|
1991
|
+
const result = !(utils$1.isUndefined(el) || el === null) && visitor.call(
|
|
1992
|
+
formData,
|
|
1993
|
+
el,
|
|
1994
|
+
utils$1.isString(key) ? key.trim() : key,
|
|
1995
|
+
path,
|
|
1996
|
+
exposedHelpers
|
|
1997
|
+
);
|
|
1998
|
+
if (result === true) {
|
|
1999
|
+
build(el, path ? path.concat(key) : [key]);
|
|
2000
|
+
}
|
|
2001
|
+
});
|
|
2002
|
+
stack.pop();
|
|
2003
|
+
}
|
|
2004
|
+
if (!utils$1.isObject(obj)) {
|
|
2005
|
+
throw new TypeError("data must be an object");
|
|
2006
|
+
}
|
|
2007
|
+
build(obj);
|
|
2008
|
+
return formData;
|
|
2009
|
+
}
|
|
2010
|
+
function encode$1(str) {
|
|
2011
|
+
const charMap = {
|
|
2012
|
+
"!": "%21",
|
|
2013
|
+
"'": "%27",
|
|
2014
|
+
"(": "%28",
|
|
2015
|
+
")": "%29",
|
|
2016
|
+
"~": "%7E",
|
|
2017
|
+
"%20": "+",
|
|
2018
|
+
"%00": "\0"
|
|
2019
|
+
};
|
|
2020
|
+
return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {
|
|
2021
|
+
return charMap[match];
|
|
2022
|
+
});
|
|
2023
|
+
}
|
|
2024
|
+
function AxiosURLSearchParams(params, options) {
|
|
2025
|
+
this._pairs = [];
|
|
2026
|
+
params && toFormData$1(params, this, options);
|
|
2027
|
+
}
|
|
2028
|
+
const prototype = AxiosURLSearchParams.prototype;
|
|
2029
|
+
prototype.append = function append(name, value) {
|
|
2030
|
+
this._pairs.push([name, value]);
|
|
2031
|
+
};
|
|
2032
|
+
prototype.toString = function toString2(encoder) {
|
|
2033
|
+
const _encode = encoder ? function(value) {
|
|
2034
|
+
return encoder.call(this, value, encode$1);
|
|
2035
|
+
} : encode$1;
|
|
2036
|
+
return this._pairs.map(function each(pair) {
|
|
2037
|
+
return _encode(pair[0]) + "=" + _encode(pair[1]);
|
|
2038
|
+
}, "").join("&");
|
|
2039
|
+
};
|
|
2040
|
+
function encode(val) {
|
|
2041
|
+
return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
|
|
2042
|
+
}
|
|
2043
|
+
function buildURL(url, params, options) {
|
|
2044
|
+
if (!params) {
|
|
2045
|
+
return url;
|
|
2046
|
+
}
|
|
2047
|
+
const _encode = options && options.encode || encode;
|
|
2048
|
+
if (utils$1.isFunction(options)) {
|
|
2049
|
+
options = {
|
|
2050
|
+
serialize: options
|
|
2051
|
+
};
|
|
2052
|
+
}
|
|
2053
|
+
const serializeFn = options && options.serialize;
|
|
2054
|
+
let serializedParams;
|
|
2055
|
+
if (serializeFn) {
|
|
2056
|
+
serializedParams = serializeFn(params, options);
|
|
2057
|
+
} else {
|
|
2058
|
+
serializedParams = utils$1.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams(params, options).toString(_encode);
|
|
2059
|
+
}
|
|
2060
|
+
if (serializedParams) {
|
|
2061
|
+
const hashmarkIndex = url.indexOf("#");
|
|
2062
|
+
if (hashmarkIndex !== -1) {
|
|
2063
|
+
url = url.slice(0, hashmarkIndex);
|
|
2064
|
+
}
|
|
2065
|
+
url += (url.indexOf("?") === -1 ? "?" : "&") + serializedParams;
|
|
2066
|
+
}
|
|
2067
|
+
return url;
|
|
2068
|
+
}
|
|
2069
|
+
class InterceptorManager {
|
|
2070
|
+
constructor() {
|
|
2071
|
+
this.handlers = [];
|
|
2072
|
+
}
|
|
2073
|
+
/**
|
|
2074
|
+
* Add a new interceptor to the stack
|
|
2075
|
+
*
|
|
2076
|
+
* @param {Function} fulfilled The function to handle `then` for a `Promise`
|
|
2077
|
+
* @param {Function} rejected The function to handle `reject` for a `Promise`
|
|
2078
|
+
*
|
|
2079
|
+
* @return {Number} An ID used to remove interceptor later
|
|
2080
|
+
*/
|
|
2081
|
+
use(fulfilled, rejected, options) {
|
|
2082
|
+
this.handlers.push({
|
|
2083
|
+
fulfilled,
|
|
2084
|
+
rejected,
|
|
2085
|
+
synchronous: options ? options.synchronous : false,
|
|
2086
|
+
runWhen: options ? options.runWhen : null
|
|
2087
|
+
});
|
|
2088
|
+
return this.handlers.length - 1;
|
|
2089
|
+
}
|
|
2090
|
+
/**
|
|
2091
|
+
* Remove an interceptor from the stack
|
|
2092
|
+
*
|
|
2093
|
+
* @param {Number} id The ID that was returned by `use`
|
|
2094
|
+
*
|
|
2095
|
+
* @returns {void}
|
|
2096
|
+
*/
|
|
2097
|
+
eject(id) {
|
|
2098
|
+
if (this.handlers[id]) {
|
|
2099
|
+
this.handlers[id] = null;
|
|
2100
|
+
}
|
|
2101
|
+
}
|
|
2102
|
+
/**
|
|
2103
|
+
* Clear all interceptors from the stack
|
|
2104
|
+
*
|
|
2105
|
+
* @returns {void}
|
|
2106
|
+
*/
|
|
2107
|
+
clear() {
|
|
2108
|
+
if (this.handlers) {
|
|
2109
|
+
this.handlers = [];
|
|
2110
|
+
}
|
|
2111
|
+
}
|
|
2112
|
+
/**
|
|
2113
|
+
* Iterate over all the registered interceptors
|
|
2114
|
+
*
|
|
2115
|
+
* This method is particularly useful for skipping over any
|
|
2116
|
+
* interceptors that may have become `null` calling `eject`.
|
|
2117
|
+
*
|
|
2118
|
+
* @param {Function} fn The function to call for each interceptor
|
|
2119
|
+
*
|
|
2120
|
+
* @returns {void}
|
|
2121
|
+
*/
|
|
2122
|
+
forEach(fn) {
|
|
2123
|
+
utils$1.forEach(this.handlers, function forEachHandler(h) {
|
|
2124
|
+
if (h !== null) {
|
|
2125
|
+
fn(h);
|
|
2126
|
+
}
|
|
2127
|
+
});
|
|
2128
|
+
}
|
|
2129
|
+
}
|
|
2130
|
+
const transitionalDefaults = {
|
|
2131
|
+
silentJSONParsing: true,
|
|
2132
|
+
forcedJSONParsing: true,
|
|
2133
|
+
clarifyTimeoutError: false
|
|
2134
|
+
};
|
|
2135
|
+
const URLSearchParams$1 = typeof URLSearchParams !== "undefined" ? URLSearchParams : AxiosURLSearchParams;
|
|
2136
|
+
const FormData$1 = typeof FormData !== "undefined" ? FormData : null;
|
|
2137
|
+
const Blob$1 = typeof Blob !== "undefined" ? Blob : null;
|
|
2138
|
+
const platform$1 = {
|
|
2139
|
+
isBrowser: true,
|
|
2140
|
+
classes: {
|
|
2141
|
+
URLSearchParams: URLSearchParams$1,
|
|
2142
|
+
FormData: FormData$1,
|
|
2143
|
+
Blob: Blob$1
|
|
2144
|
+
},
|
|
2145
|
+
protocols: ["http", "https", "file", "blob", "url", "data"]
|
|
2146
|
+
};
|
|
2147
|
+
const hasBrowserEnv = typeof window !== "undefined" && typeof document !== "undefined";
|
|
2148
|
+
const _navigator = typeof navigator === "object" && navigator || void 0;
|
|
2149
|
+
const hasStandardBrowserEnv = hasBrowserEnv && (!_navigator || ["ReactNative", "NativeScript", "NS"].indexOf(_navigator.product) < 0);
|
|
2150
|
+
const hasStandardBrowserWebWorkerEnv = (() => {
|
|
2151
|
+
return typeof WorkerGlobalScope !== "undefined" && // eslint-disable-next-line no-undef
|
|
2152
|
+
self instanceof WorkerGlobalScope && typeof self.importScripts === "function";
|
|
2153
|
+
})();
|
|
2154
|
+
const origin = hasBrowserEnv && window.location.href || "http://localhost";
|
|
2155
|
+
const utils = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2156
|
+
__proto__: null,
|
|
2157
|
+
hasBrowserEnv,
|
|
2158
|
+
hasStandardBrowserEnv,
|
|
2159
|
+
hasStandardBrowserWebWorkerEnv,
|
|
2160
|
+
navigator: _navigator,
|
|
2161
|
+
origin
|
|
2162
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
2163
|
+
const platform = {
|
|
2164
|
+
...utils,
|
|
2165
|
+
...platform$1
|
|
2166
|
+
};
|
|
2167
|
+
function toURLEncodedForm(data, options) {
|
|
2168
|
+
return toFormData$1(data, new platform.classes.URLSearchParams(), {
|
|
2169
|
+
visitor: function(value, key, path, helpers) {
|
|
2170
|
+
if (platform.isNode && utils$1.isBuffer(value)) {
|
|
2171
|
+
this.append(key, value.toString("base64"));
|
|
2172
|
+
return false;
|
|
2173
|
+
}
|
|
2174
|
+
return helpers.defaultVisitor.apply(this, arguments);
|
|
2175
|
+
},
|
|
2176
|
+
...options
|
|
2177
|
+
});
|
|
2178
|
+
}
|
|
2179
|
+
function parsePropPath(name) {
|
|
2180
|
+
return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map((match) => {
|
|
2181
|
+
return match[0] === "[]" ? "" : match[1] || match[0];
|
|
2182
|
+
});
|
|
2183
|
+
}
|
|
2184
|
+
function arrayToObject(arr) {
|
|
2185
|
+
const obj = {};
|
|
2186
|
+
const keys = Object.keys(arr);
|
|
2187
|
+
let i;
|
|
2188
|
+
const len = keys.length;
|
|
2189
|
+
let key;
|
|
2190
|
+
for (i = 0; i < len; i++) {
|
|
2191
|
+
key = keys[i];
|
|
2192
|
+
obj[key] = arr[key];
|
|
2193
|
+
}
|
|
2194
|
+
return obj;
|
|
2195
|
+
}
|
|
2196
|
+
function formDataToJSON(formData) {
|
|
2197
|
+
function buildPath(path, value, target, index) {
|
|
2198
|
+
let name = path[index++];
|
|
2199
|
+
if (name === "__proto__") return true;
|
|
2200
|
+
const isNumericKey = Number.isFinite(+name);
|
|
2201
|
+
const isLast = index >= path.length;
|
|
2202
|
+
name = !name && utils$1.isArray(target) ? target.length : name;
|
|
2203
|
+
if (isLast) {
|
|
2204
|
+
if (utils$1.hasOwnProp(target, name)) {
|
|
2205
|
+
target[name] = [target[name], value];
|
|
2206
|
+
} else {
|
|
2207
|
+
target[name] = value;
|
|
2208
|
+
}
|
|
2209
|
+
return !isNumericKey;
|
|
2210
|
+
}
|
|
2211
|
+
if (!target[name] || !utils$1.isObject(target[name])) {
|
|
2212
|
+
target[name] = [];
|
|
2213
|
+
}
|
|
2214
|
+
const result = buildPath(path, value, target[name], index);
|
|
2215
|
+
if (result && utils$1.isArray(target[name])) {
|
|
2216
|
+
target[name] = arrayToObject(target[name]);
|
|
2217
|
+
}
|
|
2218
|
+
return !isNumericKey;
|
|
2219
|
+
}
|
|
2220
|
+
if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) {
|
|
2221
|
+
const obj = {};
|
|
2222
|
+
utils$1.forEachEntry(formData, (name, value) => {
|
|
2223
|
+
buildPath(parsePropPath(name), value, obj, 0);
|
|
2224
|
+
});
|
|
2225
|
+
return obj;
|
|
2226
|
+
}
|
|
2227
|
+
return null;
|
|
2228
|
+
}
|
|
2229
|
+
function stringifySafely(rawValue, parser, encoder) {
|
|
2230
|
+
if (utils$1.isString(rawValue)) {
|
|
2231
|
+
try {
|
|
2232
|
+
(parser || JSON.parse)(rawValue);
|
|
2233
|
+
return utils$1.trim(rawValue);
|
|
2234
|
+
} catch (e) {
|
|
2235
|
+
if (e.name !== "SyntaxError") {
|
|
2236
|
+
throw e;
|
|
2237
|
+
}
|
|
2238
|
+
}
|
|
2239
|
+
}
|
|
2240
|
+
return (encoder || JSON.stringify)(rawValue);
|
|
2241
|
+
}
|
|
2242
|
+
const defaults = {
|
|
2243
|
+
transitional: transitionalDefaults,
|
|
2244
|
+
adapter: ["xhr", "http", "fetch"],
|
|
2245
|
+
transformRequest: [function transformRequest(data, headers) {
|
|
2246
|
+
const contentType = headers.getContentType() || "";
|
|
2247
|
+
const hasJSONContentType = contentType.indexOf("application/json") > -1;
|
|
2248
|
+
const isObjectPayload = utils$1.isObject(data);
|
|
2249
|
+
if (isObjectPayload && utils$1.isHTMLForm(data)) {
|
|
2250
|
+
data = new FormData(data);
|
|
2251
|
+
}
|
|
2252
|
+
const isFormData2 = utils$1.isFormData(data);
|
|
2253
|
+
if (isFormData2) {
|
|
2254
|
+
return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
|
|
2255
|
+
}
|
|
2256
|
+
if (utils$1.isArrayBuffer(data) || utils$1.isBuffer(data) || utils$1.isStream(data) || utils$1.isFile(data) || utils$1.isBlob(data) || utils$1.isReadableStream(data)) {
|
|
2257
|
+
return data;
|
|
2258
|
+
}
|
|
2259
|
+
if (utils$1.isArrayBufferView(data)) {
|
|
2260
|
+
return data.buffer;
|
|
2261
|
+
}
|
|
2262
|
+
if (utils$1.isURLSearchParams(data)) {
|
|
2263
|
+
headers.setContentType("application/x-www-form-urlencoded;charset=utf-8", false);
|
|
2264
|
+
return data.toString();
|
|
2265
|
+
}
|
|
2266
|
+
let isFileList2;
|
|
2267
|
+
if (isObjectPayload) {
|
|
2268
|
+
if (contentType.indexOf("application/x-www-form-urlencoded") > -1) {
|
|
2269
|
+
return toURLEncodedForm(data, this.formSerializer).toString();
|
|
2270
|
+
}
|
|
2271
|
+
if ((isFileList2 = utils$1.isFileList(data)) || contentType.indexOf("multipart/form-data") > -1) {
|
|
2272
|
+
const _FormData = this.env && this.env.FormData;
|
|
2273
|
+
return toFormData$1(
|
|
2274
|
+
isFileList2 ? { "files[]": data } : data,
|
|
2275
|
+
_FormData && new _FormData(),
|
|
2276
|
+
this.formSerializer
|
|
2277
|
+
);
|
|
2278
|
+
}
|
|
2279
|
+
}
|
|
2280
|
+
if (isObjectPayload || hasJSONContentType) {
|
|
2281
|
+
headers.setContentType("application/json", false);
|
|
2282
|
+
return stringifySafely(data);
|
|
2283
|
+
}
|
|
2284
|
+
return data;
|
|
2285
|
+
}],
|
|
2286
|
+
transformResponse: [function transformResponse(data) {
|
|
2287
|
+
const transitional2 = this.transitional || defaults.transitional;
|
|
2288
|
+
const forcedJSONParsing = transitional2 && transitional2.forcedJSONParsing;
|
|
2289
|
+
const JSONRequested = this.responseType === "json";
|
|
2290
|
+
if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) {
|
|
2291
|
+
return data;
|
|
2292
|
+
}
|
|
2293
|
+
if (data && utils$1.isString(data) && (forcedJSONParsing && !this.responseType || JSONRequested)) {
|
|
2294
|
+
const silentJSONParsing = transitional2 && transitional2.silentJSONParsing;
|
|
2295
|
+
const strictJSONParsing = !silentJSONParsing && JSONRequested;
|
|
2296
|
+
try {
|
|
2297
|
+
return JSON.parse(data, this.parseReviver);
|
|
2298
|
+
} catch (e) {
|
|
2299
|
+
if (strictJSONParsing) {
|
|
2300
|
+
if (e.name === "SyntaxError") {
|
|
2301
|
+
throw AxiosError$1.from(e, AxiosError$1.ERR_BAD_RESPONSE, this, null, this.response);
|
|
2302
|
+
}
|
|
2303
|
+
throw e;
|
|
2304
|
+
}
|
|
2305
|
+
}
|
|
2306
|
+
}
|
|
2307
|
+
return data;
|
|
2308
|
+
}],
|
|
2309
|
+
/**
|
|
2310
|
+
* A timeout in milliseconds to abort a request. If set to 0 (default) a
|
|
2311
|
+
* timeout is not created.
|
|
2312
|
+
*/
|
|
2313
|
+
timeout: 0,
|
|
2314
|
+
xsrfCookieName: "XSRF-TOKEN",
|
|
2315
|
+
xsrfHeaderName: "X-XSRF-TOKEN",
|
|
2316
|
+
maxContentLength: -1,
|
|
2317
|
+
maxBodyLength: -1,
|
|
2318
|
+
env: {
|
|
2319
|
+
FormData: platform.classes.FormData,
|
|
2320
|
+
Blob: platform.classes.Blob
|
|
2321
|
+
},
|
|
2322
|
+
validateStatus: function validateStatus(status) {
|
|
2323
|
+
return status >= 200 && status < 300;
|
|
2324
|
+
},
|
|
2325
|
+
headers: {
|
|
2326
|
+
common: {
|
|
2327
|
+
"Accept": "application/json, text/plain, */*",
|
|
2328
|
+
"Content-Type": void 0
|
|
2329
|
+
}
|
|
2330
|
+
}
|
|
2331
|
+
};
|
|
2332
|
+
utils$1.forEach(["delete", "get", "head", "post", "put", "patch"], (method) => {
|
|
2333
|
+
defaults.headers[method] = {};
|
|
2334
|
+
});
|
|
2335
|
+
const ignoreDuplicateOf = utils$1.toObjectSet([
|
|
2336
|
+
"age",
|
|
2337
|
+
"authorization",
|
|
2338
|
+
"content-length",
|
|
2339
|
+
"content-type",
|
|
2340
|
+
"etag",
|
|
2341
|
+
"expires",
|
|
2342
|
+
"from",
|
|
2343
|
+
"host",
|
|
2344
|
+
"if-modified-since",
|
|
2345
|
+
"if-unmodified-since",
|
|
2346
|
+
"last-modified",
|
|
2347
|
+
"location",
|
|
2348
|
+
"max-forwards",
|
|
2349
|
+
"proxy-authorization",
|
|
2350
|
+
"referer",
|
|
2351
|
+
"retry-after",
|
|
2352
|
+
"user-agent"
|
|
2353
|
+
]);
|
|
2354
|
+
const parseHeaders = (rawHeaders) => {
|
|
2355
|
+
const parsed = {};
|
|
2356
|
+
let key;
|
|
2357
|
+
let val;
|
|
2358
|
+
let i;
|
|
2359
|
+
rawHeaders && rawHeaders.split("\n").forEach(function parser(line) {
|
|
2360
|
+
i = line.indexOf(":");
|
|
2361
|
+
key = line.substring(0, i).trim().toLowerCase();
|
|
2362
|
+
val = line.substring(i + 1).trim();
|
|
2363
|
+
if (!key || parsed[key] && ignoreDuplicateOf[key]) {
|
|
2364
|
+
return;
|
|
2365
|
+
}
|
|
2366
|
+
if (key === "set-cookie") {
|
|
2367
|
+
if (parsed[key]) {
|
|
2368
|
+
parsed[key].push(val);
|
|
2369
|
+
} else {
|
|
2370
|
+
parsed[key] = [val];
|
|
2371
|
+
}
|
|
2372
|
+
} else {
|
|
2373
|
+
parsed[key] = parsed[key] ? parsed[key] + ", " + val : val;
|
|
2374
|
+
}
|
|
2375
|
+
});
|
|
2376
|
+
return parsed;
|
|
2377
|
+
};
|
|
2378
|
+
const $internals = /* @__PURE__ */ Symbol("internals");
|
|
2379
|
+
function normalizeHeader(header) {
|
|
2380
|
+
return header && String(header).trim().toLowerCase();
|
|
2381
|
+
}
|
|
2382
|
+
function normalizeValue(value) {
|
|
2383
|
+
if (value === false || value == null) {
|
|
2384
|
+
return value;
|
|
2385
|
+
}
|
|
2386
|
+
return utils$1.isArray(value) ? value.map(normalizeValue) : String(value);
|
|
2387
|
+
}
|
|
2388
|
+
function parseTokens(str) {
|
|
2389
|
+
const tokens = /* @__PURE__ */ Object.create(null);
|
|
2390
|
+
const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
|
|
2391
|
+
let match;
|
|
2392
|
+
while (match = tokensRE.exec(str)) {
|
|
2393
|
+
tokens[match[1]] = match[2];
|
|
2394
|
+
}
|
|
2395
|
+
return tokens;
|
|
2396
|
+
}
|
|
2397
|
+
const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
|
|
2398
|
+
function matchHeaderValue(context, value, header, filter2, isHeaderNameFilter) {
|
|
2399
|
+
if (utils$1.isFunction(filter2)) {
|
|
2400
|
+
return filter2.call(this, value, header);
|
|
2401
|
+
}
|
|
2402
|
+
if (isHeaderNameFilter) {
|
|
2403
|
+
value = header;
|
|
2404
|
+
}
|
|
2405
|
+
if (!utils$1.isString(value)) return;
|
|
2406
|
+
if (utils$1.isString(filter2)) {
|
|
2407
|
+
return value.indexOf(filter2) !== -1;
|
|
2408
|
+
}
|
|
2409
|
+
if (utils$1.isRegExp(filter2)) {
|
|
2410
|
+
return filter2.test(value);
|
|
2411
|
+
}
|
|
2412
|
+
}
|
|
2413
|
+
function formatHeader(header) {
|
|
2414
|
+
return header.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => {
|
|
2415
|
+
return char.toUpperCase() + str;
|
|
2416
|
+
});
|
|
2417
|
+
}
|
|
2418
|
+
function buildAccessors(obj, header) {
|
|
2419
|
+
const accessorName = utils$1.toCamelCase(" " + header);
|
|
2420
|
+
["get", "set", "has"].forEach((methodName) => {
|
|
2421
|
+
Object.defineProperty(obj, methodName + accessorName, {
|
|
2422
|
+
value: function(arg1, arg2, arg3) {
|
|
2423
|
+
return this[methodName].call(this, header, arg1, arg2, arg3);
|
|
2424
|
+
},
|
|
2425
|
+
configurable: true
|
|
2426
|
+
});
|
|
2427
|
+
});
|
|
2428
|
+
}
|
|
2429
|
+
let AxiosHeaders$1 = class AxiosHeaders {
|
|
2430
|
+
constructor(headers) {
|
|
2431
|
+
headers && this.set(headers);
|
|
2432
|
+
}
|
|
2433
|
+
set(header, valueOrRewrite, rewrite) {
|
|
2434
|
+
const self2 = this;
|
|
2435
|
+
function setHeader(_value, _header, _rewrite) {
|
|
2436
|
+
const lHeader = normalizeHeader(_header);
|
|
2437
|
+
if (!lHeader) {
|
|
2438
|
+
throw new Error("header name must be a non-empty string");
|
|
2439
|
+
}
|
|
2440
|
+
const key = utils$1.findKey(self2, lHeader);
|
|
2441
|
+
if (!key || self2[key] === void 0 || _rewrite === true || _rewrite === void 0 && self2[key] !== false) {
|
|
2442
|
+
self2[key || _header] = normalizeValue(_value);
|
|
2443
|
+
}
|
|
2444
|
+
}
|
|
2445
|
+
const setHeaders = (headers, _rewrite) => utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
|
|
2446
|
+
if (utils$1.isPlainObject(header) || header instanceof this.constructor) {
|
|
2447
|
+
setHeaders(header, valueOrRewrite);
|
|
2448
|
+
} else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
|
|
2449
|
+
setHeaders(parseHeaders(header), valueOrRewrite);
|
|
2450
|
+
} else if (utils$1.isObject(header) && utils$1.isIterable(header)) {
|
|
2451
|
+
let obj = {}, dest, key;
|
|
2452
|
+
for (const entry of header) {
|
|
2453
|
+
if (!utils$1.isArray(entry)) {
|
|
2454
|
+
throw TypeError("Object iterator must return a key-value pair");
|
|
2455
|
+
}
|
|
2456
|
+
obj[key = entry[0]] = (dest = obj[key]) ? utils$1.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]] : entry[1];
|
|
2457
|
+
}
|
|
2458
|
+
setHeaders(obj, valueOrRewrite);
|
|
2459
|
+
} else {
|
|
2460
|
+
header != null && setHeader(valueOrRewrite, header, rewrite);
|
|
2461
|
+
}
|
|
2462
|
+
return this;
|
|
2463
|
+
}
|
|
2464
|
+
get(header, parser) {
|
|
2465
|
+
header = normalizeHeader(header);
|
|
2466
|
+
if (header) {
|
|
2467
|
+
const key = utils$1.findKey(this, header);
|
|
2468
|
+
if (key) {
|
|
2469
|
+
const value = this[key];
|
|
2470
|
+
if (!parser) {
|
|
2471
|
+
return value;
|
|
2472
|
+
}
|
|
2473
|
+
if (parser === true) {
|
|
2474
|
+
return parseTokens(value);
|
|
2475
|
+
}
|
|
2476
|
+
if (utils$1.isFunction(parser)) {
|
|
2477
|
+
return parser.call(this, value, key);
|
|
2478
|
+
}
|
|
2479
|
+
if (utils$1.isRegExp(parser)) {
|
|
2480
|
+
return parser.exec(value);
|
|
2481
|
+
}
|
|
2482
|
+
throw new TypeError("parser must be boolean|regexp|function");
|
|
2483
|
+
}
|
|
2484
|
+
}
|
|
2485
|
+
}
|
|
2486
|
+
has(header, matcher) {
|
|
2487
|
+
header = normalizeHeader(header);
|
|
2488
|
+
if (header) {
|
|
2489
|
+
const key = utils$1.findKey(this, header);
|
|
2490
|
+
return !!(key && this[key] !== void 0 && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
|
|
2491
|
+
}
|
|
2492
|
+
return false;
|
|
2493
|
+
}
|
|
2494
|
+
delete(header, matcher) {
|
|
2495
|
+
const self2 = this;
|
|
2496
|
+
let deleted = false;
|
|
2497
|
+
function deleteHeader(_header) {
|
|
2498
|
+
_header = normalizeHeader(_header);
|
|
2499
|
+
if (_header) {
|
|
2500
|
+
const key = utils$1.findKey(self2, _header);
|
|
2501
|
+
if (key && (!matcher || matchHeaderValue(self2, self2[key], key, matcher))) {
|
|
2502
|
+
delete self2[key];
|
|
2503
|
+
deleted = true;
|
|
2504
|
+
}
|
|
2505
|
+
}
|
|
2506
|
+
}
|
|
2507
|
+
if (utils$1.isArray(header)) {
|
|
2508
|
+
header.forEach(deleteHeader);
|
|
2509
|
+
} else {
|
|
2510
|
+
deleteHeader(header);
|
|
2511
|
+
}
|
|
2512
|
+
return deleted;
|
|
2513
|
+
}
|
|
2514
|
+
clear(matcher) {
|
|
2515
|
+
const keys = Object.keys(this);
|
|
2516
|
+
let i = keys.length;
|
|
2517
|
+
let deleted = false;
|
|
2518
|
+
while (i--) {
|
|
2519
|
+
const key = keys[i];
|
|
2520
|
+
if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
|
|
2521
|
+
delete this[key];
|
|
2522
|
+
deleted = true;
|
|
2523
|
+
}
|
|
2524
|
+
}
|
|
2525
|
+
return deleted;
|
|
2526
|
+
}
|
|
2527
|
+
normalize(format) {
|
|
2528
|
+
const self2 = this;
|
|
2529
|
+
const headers = {};
|
|
2530
|
+
utils$1.forEach(this, (value, header) => {
|
|
2531
|
+
const key = utils$1.findKey(headers, header);
|
|
2532
|
+
if (key) {
|
|
2533
|
+
self2[key] = normalizeValue(value);
|
|
2534
|
+
delete self2[header];
|
|
2535
|
+
return;
|
|
2536
|
+
}
|
|
2537
|
+
const normalized = format ? formatHeader(header) : String(header).trim();
|
|
2538
|
+
if (normalized !== header) {
|
|
2539
|
+
delete self2[header];
|
|
2540
|
+
}
|
|
2541
|
+
self2[normalized] = normalizeValue(value);
|
|
2542
|
+
headers[normalized] = true;
|
|
2543
|
+
});
|
|
2544
|
+
return this;
|
|
2545
|
+
}
|
|
2546
|
+
concat(...targets) {
|
|
2547
|
+
return this.constructor.concat(this, ...targets);
|
|
2548
|
+
}
|
|
2549
|
+
toJSON(asStrings) {
|
|
2550
|
+
const obj = /* @__PURE__ */ Object.create(null);
|
|
2551
|
+
utils$1.forEach(this, (value, header) => {
|
|
2552
|
+
value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(", ") : value);
|
|
2553
|
+
});
|
|
2554
|
+
return obj;
|
|
2555
|
+
}
|
|
2556
|
+
[Symbol.iterator]() {
|
|
2557
|
+
return Object.entries(this.toJSON())[Symbol.iterator]();
|
|
2558
|
+
}
|
|
2559
|
+
toString() {
|
|
2560
|
+
return Object.entries(this.toJSON()).map(([header, value]) => header + ": " + value).join("\n");
|
|
2561
|
+
}
|
|
2562
|
+
getSetCookie() {
|
|
2563
|
+
return this.get("set-cookie") || [];
|
|
2564
|
+
}
|
|
2565
|
+
get [Symbol.toStringTag]() {
|
|
2566
|
+
return "AxiosHeaders";
|
|
2567
|
+
}
|
|
2568
|
+
static from(thing) {
|
|
2569
|
+
return thing instanceof this ? thing : new this(thing);
|
|
2570
|
+
}
|
|
2571
|
+
static concat(first, ...targets) {
|
|
2572
|
+
const computed = new this(first);
|
|
2573
|
+
targets.forEach((target) => computed.set(target));
|
|
2574
|
+
return computed;
|
|
2575
|
+
}
|
|
2576
|
+
static accessor(header) {
|
|
2577
|
+
const internals = this[$internals] = this[$internals] = {
|
|
2578
|
+
accessors: {}
|
|
2579
|
+
};
|
|
2580
|
+
const accessors = internals.accessors;
|
|
2581
|
+
const prototype2 = this.prototype;
|
|
2582
|
+
function defineAccessor(_header) {
|
|
2583
|
+
const lHeader = normalizeHeader(_header);
|
|
2584
|
+
if (!accessors[lHeader]) {
|
|
2585
|
+
buildAccessors(prototype2, _header);
|
|
2586
|
+
accessors[lHeader] = true;
|
|
2587
|
+
}
|
|
2588
|
+
}
|
|
2589
|
+
utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
|
|
2590
|
+
return this;
|
|
2591
|
+
}
|
|
2592
|
+
};
|
|
2593
|
+
AxiosHeaders$1.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
|
|
2594
|
+
utils$1.reduceDescriptors(AxiosHeaders$1.prototype, ({ value }, key) => {
|
|
2595
|
+
let mapped = key[0].toUpperCase() + key.slice(1);
|
|
2596
|
+
return {
|
|
2597
|
+
get: () => value,
|
|
2598
|
+
set(headerValue) {
|
|
2599
|
+
this[mapped] = headerValue;
|
|
2600
|
+
}
|
|
2601
|
+
};
|
|
2602
|
+
});
|
|
2603
|
+
utils$1.freezeMethods(AxiosHeaders$1);
|
|
2604
|
+
function transformData(fns, response) {
|
|
2605
|
+
const config = this || defaults;
|
|
2606
|
+
const context = response || config;
|
|
2607
|
+
const headers = AxiosHeaders$1.from(context.headers);
|
|
2608
|
+
let data = context.data;
|
|
2609
|
+
utils$1.forEach(fns, function transform(fn) {
|
|
2610
|
+
data = fn.call(config, data, headers.normalize(), response ? response.status : void 0);
|
|
2611
|
+
});
|
|
2612
|
+
headers.normalize();
|
|
2613
|
+
return data;
|
|
2614
|
+
}
|
|
2615
|
+
function isCancel$1(value) {
|
|
2616
|
+
return !!(value && value.__CANCEL__);
|
|
2617
|
+
}
|
|
2618
|
+
function CanceledError$1(message, config, request) {
|
|
2619
|
+
AxiosError$1.call(this, message == null ? "canceled" : message, AxiosError$1.ERR_CANCELED, config, request);
|
|
2620
|
+
this.name = "CanceledError";
|
|
2621
|
+
}
|
|
2622
|
+
utils$1.inherits(CanceledError$1, AxiosError$1, {
|
|
2623
|
+
__CANCEL__: true
|
|
2624
|
+
});
|
|
2625
|
+
function settle(resolve, reject, response) {
|
|
2626
|
+
const validateStatus2 = response.config.validateStatus;
|
|
2627
|
+
if (!response.status || !validateStatus2 || validateStatus2(response.status)) {
|
|
2628
|
+
resolve(response);
|
|
2629
|
+
} else {
|
|
2630
|
+
reject(new AxiosError$1(
|
|
2631
|
+
"Request failed with status code " + response.status,
|
|
2632
|
+
[AxiosError$1.ERR_BAD_REQUEST, AxiosError$1.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
|
|
2633
|
+
response.config,
|
|
2634
|
+
response.request,
|
|
2635
|
+
response
|
|
2636
|
+
));
|
|
2637
|
+
}
|
|
2638
|
+
}
|
|
2639
|
+
function parseProtocol(url) {
|
|
2640
|
+
const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
|
|
2641
|
+
return match && match[1] || "";
|
|
2642
|
+
}
|
|
2643
|
+
function speedometer(samplesCount, min) {
|
|
2644
|
+
samplesCount = samplesCount || 10;
|
|
2645
|
+
const bytes = new Array(samplesCount);
|
|
2646
|
+
const timestamps = new Array(samplesCount);
|
|
2647
|
+
let head = 0;
|
|
2648
|
+
let tail = 0;
|
|
2649
|
+
let firstSampleTS;
|
|
2650
|
+
min = min !== void 0 ? min : 1e3;
|
|
2651
|
+
return function push(chunkLength) {
|
|
2652
|
+
const now = Date.now();
|
|
2653
|
+
const startedAt = timestamps[tail];
|
|
2654
|
+
if (!firstSampleTS) {
|
|
2655
|
+
firstSampleTS = now;
|
|
2656
|
+
}
|
|
2657
|
+
bytes[head] = chunkLength;
|
|
2658
|
+
timestamps[head] = now;
|
|
2659
|
+
let i = tail;
|
|
2660
|
+
let bytesCount = 0;
|
|
2661
|
+
while (i !== head) {
|
|
2662
|
+
bytesCount += bytes[i++];
|
|
2663
|
+
i = i % samplesCount;
|
|
2664
|
+
}
|
|
2665
|
+
head = (head + 1) % samplesCount;
|
|
2666
|
+
if (head === tail) {
|
|
2667
|
+
tail = (tail + 1) % samplesCount;
|
|
2668
|
+
}
|
|
2669
|
+
if (now - firstSampleTS < min) {
|
|
2670
|
+
return;
|
|
2671
|
+
}
|
|
2672
|
+
const passed = startedAt && now - startedAt;
|
|
2673
|
+
return passed ? Math.round(bytesCount * 1e3 / passed) : void 0;
|
|
2674
|
+
};
|
|
2675
|
+
}
|
|
2676
|
+
function throttle(fn, freq) {
|
|
2677
|
+
let timestamp = 0;
|
|
2678
|
+
let threshold = 1e3 / freq;
|
|
2679
|
+
let lastArgs;
|
|
2680
|
+
let timer;
|
|
2681
|
+
const invoke = (args, now = Date.now()) => {
|
|
2682
|
+
timestamp = now;
|
|
2683
|
+
lastArgs = null;
|
|
2684
|
+
if (timer) {
|
|
2685
|
+
clearTimeout(timer);
|
|
2686
|
+
timer = null;
|
|
2687
|
+
}
|
|
2688
|
+
fn(...args);
|
|
2689
|
+
};
|
|
2690
|
+
const throttled = (...args) => {
|
|
2691
|
+
const now = Date.now();
|
|
2692
|
+
const passed = now - timestamp;
|
|
2693
|
+
if (passed >= threshold) {
|
|
2694
|
+
invoke(args, now);
|
|
2695
|
+
} else {
|
|
2696
|
+
lastArgs = args;
|
|
2697
|
+
if (!timer) {
|
|
2698
|
+
timer = setTimeout(() => {
|
|
2699
|
+
timer = null;
|
|
2700
|
+
invoke(lastArgs);
|
|
2701
|
+
}, threshold - passed);
|
|
2702
|
+
}
|
|
2703
|
+
}
|
|
2704
|
+
};
|
|
2705
|
+
const flush = () => lastArgs && invoke(lastArgs);
|
|
2706
|
+
return [throttled, flush];
|
|
2707
|
+
}
|
|
2708
|
+
const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
|
|
2709
|
+
let bytesNotified = 0;
|
|
2710
|
+
const _speedometer = speedometer(50, 250);
|
|
2711
|
+
return throttle((e) => {
|
|
2712
|
+
const loaded = e.loaded;
|
|
2713
|
+
const total = e.lengthComputable ? e.total : void 0;
|
|
2714
|
+
const progressBytes = loaded - bytesNotified;
|
|
2715
|
+
const rate = _speedometer(progressBytes);
|
|
2716
|
+
const inRange = loaded <= total;
|
|
2717
|
+
bytesNotified = loaded;
|
|
2718
|
+
const data = {
|
|
2719
|
+
loaded,
|
|
2720
|
+
total,
|
|
2721
|
+
progress: total ? loaded / total : void 0,
|
|
2722
|
+
bytes: progressBytes,
|
|
2723
|
+
rate: rate ? rate : void 0,
|
|
2724
|
+
estimated: rate && total && inRange ? (total - loaded) / rate : void 0,
|
|
2725
|
+
event: e,
|
|
2726
|
+
lengthComputable: total != null,
|
|
2727
|
+
[isDownloadStream ? "download" : "upload"]: true
|
|
2728
|
+
};
|
|
2729
|
+
listener(data);
|
|
2730
|
+
}, freq);
|
|
2731
|
+
};
|
|
2732
|
+
const progressEventDecorator = (total, throttled) => {
|
|
2733
|
+
const lengthComputable = total != null;
|
|
2734
|
+
return [(loaded) => throttled[0]({
|
|
2735
|
+
lengthComputable,
|
|
2736
|
+
total,
|
|
2737
|
+
loaded
|
|
2738
|
+
}), throttled[1]];
|
|
2739
|
+
};
|
|
2740
|
+
const asyncDecorator = (fn) => (...args) => utils$1.asap(() => fn(...args));
|
|
2741
|
+
const isURLSameOrigin = platform.hasStandardBrowserEnv ? /* @__PURE__ */ ((origin2, isMSIE) => (url) => {
|
|
2742
|
+
url = new URL(url, platform.origin);
|
|
2743
|
+
return origin2.protocol === url.protocol && origin2.host === url.host && (isMSIE || origin2.port === url.port);
|
|
2744
|
+
})(
|
|
2745
|
+
new URL(platform.origin),
|
|
2746
|
+
platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)
|
|
2747
|
+
) : () => true;
|
|
2748
|
+
const cookies = platform.hasStandardBrowserEnv ? (
|
|
2749
|
+
// Standard browser envs support document.cookie
|
|
2750
|
+
{
|
|
2751
|
+
write(name, value, expires, path, domain, secure, sameSite) {
|
|
2752
|
+
if (typeof document === "undefined") return;
|
|
2753
|
+
const cookie = [`${name}=${encodeURIComponent(value)}`];
|
|
2754
|
+
if (utils$1.isNumber(expires)) {
|
|
2755
|
+
cookie.push(`expires=${new Date(expires).toUTCString()}`);
|
|
2756
|
+
}
|
|
2757
|
+
if (utils$1.isString(path)) {
|
|
2758
|
+
cookie.push(`path=${path}`);
|
|
2759
|
+
}
|
|
2760
|
+
if (utils$1.isString(domain)) {
|
|
2761
|
+
cookie.push(`domain=${domain}`);
|
|
2762
|
+
}
|
|
2763
|
+
if (secure === true) {
|
|
2764
|
+
cookie.push("secure");
|
|
2765
|
+
}
|
|
2766
|
+
if (utils$1.isString(sameSite)) {
|
|
2767
|
+
cookie.push(`SameSite=${sameSite}`);
|
|
2768
|
+
}
|
|
2769
|
+
document.cookie = cookie.join("; ");
|
|
2770
|
+
},
|
|
2771
|
+
read(name) {
|
|
2772
|
+
if (typeof document === "undefined") return null;
|
|
2773
|
+
const match = document.cookie.match(new RegExp("(?:^|; )" + name + "=([^;]*)"));
|
|
2774
|
+
return match ? decodeURIComponent(match[1]) : null;
|
|
2775
|
+
},
|
|
2776
|
+
remove(name) {
|
|
2777
|
+
this.write(name, "", Date.now() - 864e5, "/");
|
|
2778
|
+
}
|
|
2779
|
+
}
|
|
2780
|
+
) : (
|
|
2781
|
+
// Non-standard browser env (web workers, react-native) lack needed support.
|
|
2782
|
+
{
|
|
2783
|
+
write() {
|
|
2784
|
+
},
|
|
2785
|
+
read() {
|
|
2786
|
+
return null;
|
|
2787
|
+
},
|
|
2788
|
+
remove() {
|
|
2789
|
+
}
|
|
2790
|
+
}
|
|
2791
|
+
);
|
|
2792
|
+
function isAbsoluteURL(url) {
|
|
2793
|
+
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
|
|
2794
|
+
}
|
|
2795
|
+
function combineURLs(baseURL, relativeURL) {
|
|
2796
|
+
return relativeURL ? baseURL.replace(/\/?\/$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
|
|
2797
|
+
}
|
|
2798
|
+
function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
|
|
2799
|
+
let isRelativeUrl = !isAbsoluteURL(requestedURL);
|
|
2800
|
+
if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) {
|
|
2801
|
+
return combineURLs(baseURL, requestedURL);
|
|
2802
|
+
}
|
|
2803
|
+
return requestedURL;
|
|
2804
|
+
}
|
|
2805
|
+
const headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? { ...thing } : thing;
|
|
2806
|
+
function mergeConfig$1(config1, config2) {
|
|
2807
|
+
config2 = config2 || {};
|
|
2808
|
+
const config = {};
|
|
2809
|
+
function getMergedValue(target, source, prop, caseless) {
|
|
2810
|
+
if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
|
|
2811
|
+
return utils$1.merge.call({ caseless }, target, source);
|
|
2812
|
+
} else if (utils$1.isPlainObject(source)) {
|
|
2813
|
+
return utils$1.merge({}, source);
|
|
2814
|
+
} else if (utils$1.isArray(source)) {
|
|
2815
|
+
return source.slice();
|
|
2816
|
+
}
|
|
2817
|
+
return source;
|
|
2818
|
+
}
|
|
2819
|
+
function mergeDeepProperties(a, b, prop, caseless) {
|
|
2820
|
+
if (!utils$1.isUndefined(b)) {
|
|
2821
|
+
return getMergedValue(a, b, prop, caseless);
|
|
2822
|
+
} else if (!utils$1.isUndefined(a)) {
|
|
2823
|
+
return getMergedValue(void 0, a, prop, caseless);
|
|
2824
|
+
}
|
|
2825
|
+
}
|
|
2826
|
+
function valueFromConfig2(a, b) {
|
|
2827
|
+
if (!utils$1.isUndefined(b)) {
|
|
2828
|
+
return getMergedValue(void 0, b);
|
|
2829
|
+
}
|
|
2830
|
+
}
|
|
2831
|
+
function defaultToConfig2(a, b) {
|
|
2832
|
+
if (!utils$1.isUndefined(b)) {
|
|
2833
|
+
return getMergedValue(void 0, b);
|
|
2834
|
+
} else if (!utils$1.isUndefined(a)) {
|
|
2835
|
+
return getMergedValue(void 0, a);
|
|
2836
|
+
}
|
|
2837
|
+
}
|
|
2838
|
+
function mergeDirectKeys(a, b, prop) {
|
|
2839
|
+
if (prop in config2) {
|
|
2840
|
+
return getMergedValue(a, b);
|
|
2841
|
+
} else if (prop in config1) {
|
|
2842
|
+
return getMergedValue(void 0, a);
|
|
2843
|
+
}
|
|
2844
|
+
}
|
|
2845
|
+
const mergeMap = {
|
|
2846
|
+
url: valueFromConfig2,
|
|
2847
|
+
method: valueFromConfig2,
|
|
2848
|
+
data: valueFromConfig2,
|
|
2849
|
+
baseURL: defaultToConfig2,
|
|
2850
|
+
transformRequest: defaultToConfig2,
|
|
2851
|
+
transformResponse: defaultToConfig2,
|
|
2852
|
+
paramsSerializer: defaultToConfig2,
|
|
2853
|
+
timeout: defaultToConfig2,
|
|
2854
|
+
timeoutMessage: defaultToConfig2,
|
|
2855
|
+
withCredentials: defaultToConfig2,
|
|
2856
|
+
withXSRFToken: defaultToConfig2,
|
|
2857
|
+
adapter: defaultToConfig2,
|
|
2858
|
+
responseType: defaultToConfig2,
|
|
2859
|
+
xsrfCookieName: defaultToConfig2,
|
|
2860
|
+
xsrfHeaderName: defaultToConfig2,
|
|
2861
|
+
onUploadProgress: defaultToConfig2,
|
|
2862
|
+
onDownloadProgress: defaultToConfig2,
|
|
2863
|
+
decompress: defaultToConfig2,
|
|
2864
|
+
maxContentLength: defaultToConfig2,
|
|
2865
|
+
maxBodyLength: defaultToConfig2,
|
|
2866
|
+
beforeRedirect: defaultToConfig2,
|
|
2867
|
+
transport: defaultToConfig2,
|
|
2868
|
+
httpAgent: defaultToConfig2,
|
|
2869
|
+
httpsAgent: defaultToConfig2,
|
|
2870
|
+
cancelToken: defaultToConfig2,
|
|
2871
|
+
socketPath: defaultToConfig2,
|
|
2872
|
+
responseEncoding: defaultToConfig2,
|
|
2873
|
+
validateStatus: mergeDirectKeys,
|
|
2874
|
+
headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true)
|
|
2875
|
+
};
|
|
2876
|
+
utils$1.forEach(Object.keys({ ...config1, ...config2 }), function computeConfigValue(prop) {
|
|
2877
|
+
const merge2 = mergeMap[prop] || mergeDeepProperties;
|
|
2878
|
+
const configValue = merge2(config1[prop], config2[prop], prop);
|
|
2879
|
+
utils$1.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config[prop] = configValue);
|
|
2880
|
+
});
|
|
2881
|
+
return config;
|
|
2882
|
+
}
|
|
2883
|
+
const resolveConfig = (config) => {
|
|
2884
|
+
const newConfig = mergeConfig$1({}, config);
|
|
2885
|
+
let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig;
|
|
2886
|
+
newConfig.headers = headers = AxiosHeaders$1.from(headers);
|
|
2887
|
+
newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer);
|
|
2888
|
+
if (auth) {
|
|
2889
|
+
headers.set(
|
|
2890
|
+
"Authorization",
|
|
2891
|
+
"Basic " + btoa((auth.username || "") + ":" + (auth.password ? unescape(encodeURIComponent(auth.password)) : ""))
|
|
2892
|
+
);
|
|
2893
|
+
}
|
|
2894
|
+
if (utils$1.isFormData(data)) {
|
|
2895
|
+
if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
|
|
2896
|
+
headers.setContentType(void 0);
|
|
2897
|
+
} else if (utils$1.isFunction(data.getHeaders)) {
|
|
2898
|
+
const formHeaders = data.getHeaders();
|
|
2899
|
+
const allowedHeaders = ["content-type", "content-length"];
|
|
2900
|
+
Object.entries(formHeaders).forEach(([key, val]) => {
|
|
2901
|
+
if (allowedHeaders.includes(key.toLowerCase())) {
|
|
2902
|
+
headers.set(key, val);
|
|
2903
|
+
}
|
|
2904
|
+
});
|
|
2905
|
+
}
|
|
2906
|
+
}
|
|
2907
|
+
if (platform.hasStandardBrowserEnv) {
|
|
2908
|
+
withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));
|
|
2909
|
+
if (withXSRFToken || withXSRFToken !== false && isURLSameOrigin(newConfig.url)) {
|
|
2910
|
+
const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);
|
|
2911
|
+
if (xsrfValue) {
|
|
2912
|
+
headers.set(xsrfHeaderName, xsrfValue);
|
|
2913
|
+
}
|
|
2914
|
+
}
|
|
2915
|
+
}
|
|
2916
|
+
return newConfig;
|
|
2917
|
+
};
|
|
2918
|
+
const isXHRAdapterSupported = typeof XMLHttpRequest !== "undefined";
|
|
2919
|
+
const xhrAdapter = isXHRAdapterSupported && function(config) {
|
|
2920
|
+
return new Promise(function dispatchXhrRequest(resolve, reject) {
|
|
2921
|
+
const _config = resolveConfig(config);
|
|
2922
|
+
let requestData = _config.data;
|
|
2923
|
+
const requestHeaders = AxiosHeaders$1.from(_config.headers).normalize();
|
|
2924
|
+
let { responseType, onUploadProgress, onDownloadProgress } = _config;
|
|
2925
|
+
let onCanceled;
|
|
2926
|
+
let uploadThrottled, downloadThrottled;
|
|
2927
|
+
let flushUpload, flushDownload;
|
|
2928
|
+
function done() {
|
|
2929
|
+
flushUpload && flushUpload();
|
|
2930
|
+
flushDownload && flushDownload();
|
|
2931
|
+
_config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);
|
|
2932
|
+
_config.signal && _config.signal.removeEventListener("abort", onCanceled);
|
|
2933
|
+
}
|
|
2934
|
+
let request = new XMLHttpRequest();
|
|
2935
|
+
request.open(_config.method.toUpperCase(), _config.url, true);
|
|
2936
|
+
request.timeout = _config.timeout;
|
|
2937
|
+
function onloadend() {
|
|
2938
|
+
if (!request) {
|
|
2939
|
+
return;
|
|
2940
|
+
}
|
|
2941
|
+
const responseHeaders = AxiosHeaders$1.from(
|
|
2942
|
+
"getAllResponseHeaders" in request && request.getAllResponseHeaders()
|
|
2943
|
+
);
|
|
2944
|
+
const responseData = !responseType || responseType === "text" || responseType === "json" ? request.responseText : request.response;
|
|
2945
|
+
const response = {
|
|
2946
|
+
data: responseData,
|
|
2947
|
+
status: request.status,
|
|
2948
|
+
statusText: request.statusText,
|
|
2949
|
+
headers: responseHeaders,
|
|
2950
|
+
config,
|
|
2951
|
+
request
|
|
2952
|
+
};
|
|
2953
|
+
settle(function _resolve(value) {
|
|
2954
|
+
resolve(value);
|
|
2955
|
+
done();
|
|
2956
|
+
}, function _reject(err) {
|
|
2957
|
+
reject(err);
|
|
2958
|
+
done();
|
|
2959
|
+
}, response);
|
|
2960
|
+
request = null;
|
|
2961
|
+
}
|
|
2962
|
+
if ("onloadend" in request) {
|
|
2963
|
+
request.onloadend = onloadend;
|
|
2964
|
+
} else {
|
|
2965
|
+
request.onreadystatechange = function handleLoad() {
|
|
2966
|
+
if (!request || request.readyState !== 4) {
|
|
2967
|
+
return;
|
|
2968
|
+
}
|
|
2969
|
+
if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf("file:") === 0)) {
|
|
2970
|
+
return;
|
|
2971
|
+
}
|
|
2972
|
+
setTimeout(onloadend);
|
|
2973
|
+
};
|
|
2974
|
+
}
|
|
2975
|
+
request.onabort = function handleAbort() {
|
|
2976
|
+
if (!request) {
|
|
2977
|
+
return;
|
|
2978
|
+
}
|
|
2979
|
+
reject(new AxiosError$1("Request aborted", AxiosError$1.ECONNABORTED, config, request));
|
|
2980
|
+
request = null;
|
|
2981
|
+
};
|
|
2982
|
+
request.onerror = function handleError(event) {
|
|
2983
|
+
const msg = event && event.message ? event.message : "Network Error";
|
|
2984
|
+
const err = new AxiosError$1(msg, AxiosError$1.ERR_NETWORK, config, request);
|
|
2985
|
+
err.event = event || null;
|
|
2986
|
+
reject(err);
|
|
2987
|
+
request = null;
|
|
2988
|
+
};
|
|
2989
|
+
request.ontimeout = function handleTimeout() {
|
|
2990
|
+
let timeoutErrorMessage = _config.timeout ? "timeout of " + _config.timeout + "ms exceeded" : "timeout exceeded";
|
|
2991
|
+
const transitional2 = _config.transitional || transitionalDefaults;
|
|
2992
|
+
if (_config.timeoutErrorMessage) {
|
|
2993
|
+
timeoutErrorMessage = _config.timeoutErrorMessage;
|
|
2994
|
+
}
|
|
2995
|
+
reject(new AxiosError$1(
|
|
2996
|
+
timeoutErrorMessage,
|
|
2997
|
+
transitional2.clarifyTimeoutError ? AxiosError$1.ETIMEDOUT : AxiosError$1.ECONNABORTED,
|
|
2998
|
+
config,
|
|
2999
|
+
request
|
|
3000
|
+
));
|
|
3001
|
+
request = null;
|
|
3002
|
+
};
|
|
3003
|
+
requestData === void 0 && requestHeaders.setContentType(null);
|
|
3004
|
+
if ("setRequestHeader" in request) {
|
|
3005
|
+
utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
|
|
3006
|
+
request.setRequestHeader(key, val);
|
|
3007
|
+
});
|
|
3008
|
+
}
|
|
3009
|
+
if (!utils$1.isUndefined(_config.withCredentials)) {
|
|
3010
|
+
request.withCredentials = !!_config.withCredentials;
|
|
3011
|
+
}
|
|
3012
|
+
if (responseType && responseType !== "json") {
|
|
3013
|
+
request.responseType = _config.responseType;
|
|
3014
|
+
}
|
|
3015
|
+
if (onDownloadProgress) {
|
|
3016
|
+
[downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true);
|
|
3017
|
+
request.addEventListener("progress", downloadThrottled);
|
|
3018
|
+
}
|
|
3019
|
+
if (onUploadProgress && request.upload) {
|
|
3020
|
+
[uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress);
|
|
3021
|
+
request.upload.addEventListener("progress", uploadThrottled);
|
|
3022
|
+
request.upload.addEventListener("loadend", flushUpload);
|
|
3023
|
+
}
|
|
3024
|
+
if (_config.cancelToken || _config.signal) {
|
|
3025
|
+
onCanceled = (cancel) => {
|
|
3026
|
+
if (!request) {
|
|
3027
|
+
return;
|
|
3028
|
+
}
|
|
3029
|
+
reject(!cancel || cancel.type ? new CanceledError$1(null, config, request) : cancel);
|
|
3030
|
+
request.abort();
|
|
3031
|
+
request = null;
|
|
3032
|
+
};
|
|
3033
|
+
_config.cancelToken && _config.cancelToken.subscribe(onCanceled);
|
|
3034
|
+
if (_config.signal) {
|
|
3035
|
+
_config.signal.aborted ? onCanceled() : _config.signal.addEventListener("abort", onCanceled);
|
|
3036
|
+
}
|
|
3037
|
+
}
|
|
3038
|
+
const protocol = parseProtocol(_config.url);
|
|
3039
|
+
if (protocol && platform.protocols.indexOf(protocol) === -1) {
|
|
3040
|
+
reject(new AxiosError$1("Unsupported protocol " + protocol + ":", AxiosError$1.ERR_BAD_REQUEST, config));
|
|
3041
|
+
return;
|
|
3042
|
+
}
|
|
3043
|
+
request.send(requestData || null);
|
|
3044
|
+
});
|
|
3045
|
+
};
|
|
3046
|
+
const composeSignals = (signals, timeout) => {
|
|
3047
|
+
const { length } = signals = signals ? signals.filter(Boolean) : [];
|
|
3048
|
+
if (timeout || length) {
|
|
3049
|
+
let controller = new AbortController();
|
|
3050
|
+
let aborted;
|
|
3051
|
+
const onabort = function(reason) {
|
|
3052
|
+
if (!aborted) {
|
|
3053
|
+
aborted = true;
|
|
3054
|
+
unsubscribe();
|
|
3055
|
+
const err = reason instanceof Error ? reason : this.reason;
|
|
3056
|
+
controller.abort(err instanceof AxiosError$1 ? err : new CanceledError$1(err instanceof Error ? err.message : err));
|
|
3057
|
+
}
|
|
3058
|
+
};
|
|
3059
|
+
let timer = timeout && setTimeout(() => {
|
|
3060
|
+
timer = null;
|
|
3061
|
+
onabort(new AxiosError$1(`timeout ${timeout} of ms exceeded`, AxiosError$1.ETIMEDOUT));
|
|
3062
|
+
}, timeout);
|
|
3063
|
+
const unsubscribe = () => {
|
|
3064
|
+
if (signals) {
|
|
3065
|
+
timer && clearTimeout(timer);
|
|
3066
|
+
timer = null;
|
|
3067
|
+
signals.forEach((signal2) => {
|
|
3068
|
+
signal2.unsubscribe ? signal2.unsubscribe(onabort) : signal2.removeEventListener("abort", onabort);
|
|
3069
|
+
});
|
|
3070
|
+
signals = null;
|
|
3071
|
+
}
|
|
3072
|
+
};
|
|
3073
|
+
signals.forEach((signal2) => signal2.addEventListener("abort", onabort));
|
|
3074
|
+
const { signal } = controller;
|
|
3075
|
+
signal.unsubscribe = () => utils$1.asap(unsubscribe);
|
|
3076
|
+
return signal;
|
|
3077
|
+
}
|
|
3078
|
+
};
|
|
3079
|
+
const streamChunk = function* (chunk, chunkSize) {
|
|
3080
|
+
let len = chunk.byteLength;
|
|
3081
|
+
if (len < chunkSize) {
|
|
3082
|
+
yield chunk;
|
|
3083
|
+
return;
|
|
3084
|
+
}
|
|
3085
|
+
let pos = 0;
|
|
3086
|
+
let end;
|
|
3087
|
+
while (pos < len) {
|
|
3088
|
+
end = pos + chunkSize;
|
|
3089
|
+
yield chunk.slice(pos, end);
|
|
3090
|
+
pos = end;
|
|
3091
|
+
}
|
|
3092
|
+
};
|
|
3093
|
+
const readBytes = async function* (iterable, chunkSize) {
|
|
3094
|
+
for await (const chunk of readStream(iterable)) {
|
|
3095
|
+
yield* streamChunk(chunk, chunkSize);
|
|
3096
|
+
}
|
|
3097
|
+
};
|
|
3098
|
+
const readStream = async function* (stream) {
|
|
3099
|
+
if (stream[Symbol.asyncIterator]) {
|
|
3100
|
+
yield* stream;
|
|
3101
|
+
return;
|
|
3102
|
+
}
|
|
3103
|
+
const reader = stream.getReader();
|
|
3104
|
+
try {
|
|
3105
|
+
for (; ; ) {
|
|
3106
|
+
const { done, value } = await reader.read();
|
|
3107
|
+
if (done) {
|
|
3108
|
+
break;
|
|
3109
|
+
}
|
|
3110
|
+
yield value;
|
|
3111
|
+
}
|
|
3112
|
+
} finally {
|
|
3113
|
+
await reader.cancel();
|
|
3114
|
+
}
|
|
3115
|
+
};
|
|
3116
|
+
const trackStream = (stream, chunkSize, onProgress, onFinish) => {
|
|
3117
|
+
const iterator2 = readBytes(stream, chunkSize);
|
|
3118
|
+
let bytes = 0;
|
|
3119
|
+
let done;
|
|
3120
|
+
let _onFinish = (e) => {
|
|
3121
|
+
if (!done) {
|
|
3122
|
+
done = true;
|
|
3123
|
+
onFinish && onFinish(e);
|
|
3124
|
+
}
|
|
3125
|
+
};
|
|
3126
|
+
return new ReadableStream({
|
|
3127
|
+
async pull(controller) {
|
|
3128
|
+
try {
|
|
3129
|
+
const { done: done2, value } = await iterator2.next();
|
|
3130
|
+
if (done2) {
|
|
3131
|
+
_onFinish();
|
|
3132
|
+
controller.close();
|
|
3133
|
+
return;
|
|
3134
|
+
}
|
|
3135
|
+
let len = value.byteLength;
|
|
3136
|
+
if (onProgress) {
|
|
3137
|
+
let loadedBytes = bytes += len;
|
|
3138
|
+
onProgress(loadedBytes);
|
|
3139
|
+
}
|
|
3140
|
+
controller.enqueue(new Uint8Array(value));
|
|
3141
|
+
} catch (err) {
|
|
3142
|
+
_onFinish(err);
|
|
3143
|
+
throw err;
|
|
3144
|
+
}
|
|
3145
|
+
},
|
|
3146
|
+
cancel(reason) {
|
|
3147
|
+
_onFinish(reason);
|
|
3148
|
+
return iterator2.return();
|
|
3149
|
+
}
|
|
3150
|
+
}, {
|
|
3151
|
+
highWaterMark: 2
|
|
3152
|
+
});
|
|
3153
|
+
};
|
|
3154
|
+
const DEFAULT_CHUNK_SIZE = 64 * 1024;
|
|
3155
|
+
const { isFunction } = utils$1;
|
|
3156
|
+
const globalFetchAPI = (({ Request, Response }) => ({
|
|
3157
|
+
Request,
|
|
3158
|
+
Response
|
|
3159
|
+
}))(utils$1.global);
|
|
3160
|
+
const {
|
|
3161
|
+
ReadableStream: ReadableStream$1,
|
|
3162
|
+
TextEncoder
|
|
3163
|
+
} = utils$1.global;
|
|
3164
|
+
const test = (fn, ...args) => {
|
|
3165
|
+
try {
|
|
3166
|
+
return !!fn(...args);
|
|
3167
|
+
} catch (e) {
|
|
3168
|
+
return false;
|
|
3169
|
+
}
|
|
3170
|
+
};
|
|
3171
|
+
const factory = (env) => {
|
|
3172
|
+
env = utils$1.merge.call({
|
|
3173
|
+
skipUndefined: true
|
|
3174
|
+
}, globalFetchAPI, env);
|
|
3175
|
+
const { fetch: envFetch, Request, Response } = env;
|
|
3176
|
+
const isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === "function";
|
|
3177
|
+
const isRequestSupported = isFunction(Request);
|
|
3178
|
+
const isResponseSupported = isFunction(Response);
|
|
3179
|
+
if (!isFetchSupported) {
|
|
3180
|
+
return false;
|
|
3181
|
+
}
|
|
3182
|
+
const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream$1);
|
|
3183
|
+
const encodeText = isFetchSupported && (typeof TextEncoder === "function" ? /* @__PURE__ */ ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) : async (str) => new Uint8Array(await new Request(str).arrayBuffer()));
|
|
3184
|
+
const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => {
|
|
3185
|
+
let duplexAccessed = false;
|
|
3186
|
+
const hasContentType = new Request(platform.origin, {
|
|
3187
|
+
body: new ReadableStream$1(),
|
|
3188
|
+
method: "POST",
|
|
3189
|
+
get duplex() {
|
|
3190
|
+
duplexAccessed = true;
|
|
3191
|
+
return "half";
|
|
3192
|
+
}
|
|
3193
|
+
}).headers.has("Content-Type");
|
|
3194
|
+
return duplexAccessed && !hasContentType;
|
|
3195
|
+
});
|
|
3196
|
+
const supportsResponseStream = isResponseSupported && isReadableStreamSupported && test(() => utils$1.isReadableStream(new Response("").body));
|
|
3197
|
+
const resolvers = {
|
|
3198
|
+
stream: supportsResponseStream && ((res) => res.body)
|
|
3199
|
+
};
|
|
3200
|
+
isFetchSupported && (() => {
|
|
3201
|
+
["text", "arrayBuffer", "blob", "formData", "stream"].forEach((type) => {
|
|
3202
|
+
!resolvers[type] && (resolvers[type] = (res, config) => {
|
|
3203
|
+
let method = res && res[type];
|
|
3204
|
+
if (method) {
|
|
3205
|
+
return method.call(res);
|
|
3206
|
+
}
|
|
3207
|
+
throw new AxiosError$1(`Response type '${type}' is not supported`, AxiosError$1.ERR_NOT_SUPPORT, config);
|
|
3208
|
+
});
|
|
3209
|
+
});
|
|
3210
|
+
})();
|
|
3211
|
+
const getBodyLength = async (body) => {
|
|
3212
|
+
if (body == null) {
|
|
3213
|
+
return 0;
|
|
3214
|
+
}
|
|
3215
|
+
if (utils$1.isBlob(body)) {
|
|
3216
|
+
return body.size;
|
|
3217
|
+
}
|
|
3218
|
+
if (utils$1.isSpecCompliantForm(body)) {
|
|
3219
|
+
const _request = new Request(platform.origin, {
|
|
3220
|
+
method: "POST",
|
|
3221
|
+
body
|
|
3222
|
+
});
|
|
3223
|
+
return (await _request.arrayBuffer()).byteLength;
|
|
3224
|
+
}
|
|
3225
|
+
if (utils$1.isArrayBufferView(body) || utils$1.isArrayBuffer(body)) {
|
|
3226
|
+
return body.byteLength;
|
|
3227
|
+
}
|
|
3228
|
+
if (utils$1.isURLSearchParams(body)) {
|
|
3229
|
+
body = body + "";
|
|
3230
|
+
}
|
|
3231
|
+
if (utils$1.isString(body)) {
|
|
3232
|
+
return (await encodeText(body)).byteLength;
|
|
3233
|
+
}
|
|
3234
|
+
};
|
|
3235
|
+
const resolveBodyLength = async (headers, body) => {
|
|
3236
|
+
const length = utils$1.toFiniteNumber(headers.getContentLength());
|
|
3237
|
+
return length == null ? getBodyLength(body) : length;
|
|
3238
|
+
};
|
|
3239
|
+
return async (config) => {
|
|
3240
|
+
let {
|
|
3241
|
+
url,
|
|
3242
|
+
method,
|
|
3243
|
+
data,
|
|
3244
|
+
signal,
|
|
3245
|
+
cancelToken,
|
|
3246
|
+
timeout,
|
|
3247
|
+
onDownloadProgress,
|
|
3248
|
+
onUploadProgress,
|
|
3249
|
+
responseType,
|
|
3250
|
+
headers,
|
|
3251
|
+
withCredentials = "same-origin",
|
|
3252
|
+
fetchOptions
|
|
3253
|
+
} = resolveConfig(config);
|
|
3254
|
+
let _fetch = envFetch || fetch;
|
|
3255
|
+
responseType = responseType ? (responseType + "").toLowerCase() : "text";
|
|
3256
|
+
let composedSignal = composeSignals([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
|
|
3257
|
+
let request = null;
|
|
3258
|
+
const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
|
|
3259
|
+
composedSignal.unsubscribe();
|
|
3260
|
+
});
|
|
3261
|
+
let requestContentLength;
|
|
3262
|
+
try {
|
|
3263
|
+
if (onUploadProgress && supportsRequestStream && method !== "get" && method !== "head" && (requestContentLength = await resolveBodyLength(headers, data)) !== 0) {
|
|
3264
|
+
let _request = new Request(url, {
|
|
3265
|
+
method: "POST",
|
|
3266
|
+
body: data,
|
|
3267
|
+
duplex: "half"
|
|
3268
|
+
});
|
|
3269
|
+
let contentTypeHeader;
|
|
3270
|
+
if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get("content-type"))) {
|
|
3271
|
+
headers.setContentType(contentTypeHeader);
|
|
3272
|
+
}
|
|
3273
|
+
if (_request.body) {
|
|
3274
|
+
const [onProgress, flush] = progressEventDecorator(
|
|
3275
|
+
requestContentLength,
|
|
3276
|
+
progressEventReducer(asyncDecorator(onUploadProgress))
|
|
3277
|
+
);
|
|
3278
|
+
data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
|
|
3279
|
+
}
|
|
3280
|
+
}
|
|
3281
|
+
if (!utils$1.isString(withCredentials)) {
|
|
3282
|
+
withCredentials = withCredentials ? "include" : "omit";
|
|
3283
|
+
}
|
|
3284
|
+
const isCredentialsSupported = isRequestSupported && "credentials" in Request.prototype;
|
|
3285
|
+
const resolvedOptions = {
|
|
3286
|
+
...fetchOptions,
|
|
3287
|
+
signal: composedSignal,
|
|
3288
|
+
method: method.toUpperCase(),
|
|
3289
|
+
headers: headers.normalize().toJSON(),
|
|
3290
|
+
body: data,
|
|
3291
|
+
duplex: "half",
|
|
3292
|
+
credentials: isCredentialsSupported ? withCredentials : void 0
|
|
3293
|
+
};
|
|
3294
|
+
request = isRequestSupported && new Request(url, resolvedOptions);
|
|
3295
|
+
let response = await (isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url, resolvedOptions));
|
|
3296
|
+
const isStreamResponse = supportsResponseStream && (responseType === "stream" || responseType === "response");
|
|
3297
|
+
if (supportsResponseStream && (onDownloadProgress || isStreamResponse && unsubscribe)) {
|
|
3298
|
+
const options = {};
|
|
3299
|
+
["status", "statusText", "headers"].forEach((prop) => {
|
|
3300
|
+
options[prop] = response[prop];
|
|
3301
|
+
});
|
|
3302
|
+
const responseContentLength = utils$1.toFiniteNumber(response.headers.get("content-length"));
|
|
3303
|
+
const [onProgress, flush] = onDownloadProgress && progressEventDecorator(
|
|
3304
|
+
responseContentLength,
|
|
3305
|
+
progressEventReducer(asyncDecorator(onDownloadProgress), true)
|
|
3306
|
+
) || [];
|
|
3307
|
+
response = new Response(
|
|
3308
|
+
trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
|
|
3309
|
+
flush && flush();
|
|
3310
|
+
unsubscribe && unsubscribe();
|
|
3311
|
+
}),
|
|
3312
|
+
options
|
|
3313
|
+
);
|
|
3314
|
+
}
|
|
3315
|
+
responseType = responseType || "text";
|
|
3316
|
+
let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || "text"](response, config);
|
|
3317
|
+
!isStreamResponse && unsubscribe && unsubscribe();
|
|
3318
|
+
return await new Promise((resolve, reject) => {
|
|
3319
|
+
settle(resolve, reject, {
|
|
3320
|
+
data: responseData,
|
|
3321
|
+
headers: AxiosHeaders$1.from(response.headers),
|
|
3322
|
+
status: response.status,
|
|
3323
|
+
statusText: response.statusText,
|
|
3324
|
+
config,
|
|
3325
|
+
request
|
|
3326
|
+
});
|
|
3327
|
+
});
|
|
3328
|
+
} catch (err) {
|
|
3329
|
+
unsubscribe && unsubscribe();
|
|
3330
|
+
if (err && err.name === "TypeError" && /Load failed|fetch/i.test(err.message)) {
|
|
3331
|
+
throw Object.assign(
|
|
3332
|
+
new AxiosError$1("Network Error", AxiosError$1.ERR_NETWORK, config, request),
|
|
3333
|
+
{
|
|
3334
|
+
cause: err.cause || err
|
|
3335
|
+
}
|
|
3336
|
+
);
|
|
3337
|
+
}
|
|
3338
|
+
throw AxiosError$1.from(err, err && err.code, config, request);
|
|
3339
|
+
}
|
|
3340
|
+
};
|
|
3341
|
+
};
|
|
3342
|
+
const seedCache = /* @__PURE__ */ new Map();
|
|
3343
|
+
const getFetch = (config) => {
|
|
3344
|
+
let env = config && config.env || {};
|
|
3345
|
+
const { fetch: fetch2, Request, Response } = env;
|
|
3346
|
+
const seeds = [
|
|
3347
|
+
Request,
|
|
3348
|
+
Response,
|
|
3349
|
+
fetch2
|
|
3350
|
+
];
|
|
3351
|
+
let len = seeds.length, i = len, seed, target, map = seedCache;
|
|
3352
|
+
while (i--) {
|
|
3353
|
+
seed = seeds[i];
|
|
3354
|
+
target = map.get(seed);
|
|
3355
|
+
target === void 0 && map.set(seed, target = i ? /* @__PURE__ */ new Map() : factory(env));
|
|
3356
|
+
map = target;
|
|
3357
|
+
}
|
|
3358
|
+
return target;
|
|
3359
|
+
};
|
|
3360
|
+
getFetch();
|
|
3361
|
+
const knownAdapters = {
|
|
3362
|
+
http: httpAdapter,
|
|
3363
|
+
xhr: xhrAdapter,
|
|
3364
|
+
fetch: {
|
|
3365
|
+
get: getFetch
|
|
3366
|
+
}
|
|
3367
|
+
};
|
|
3368
|
+
utils$1.forEach(knownAdapters, (fn, value) => {
|
|
3369
|
+
if (fn) {
|
|
3370
|
+
try {
|
|
3371
|
+
Object.defineProperty(fn, "name", { value });
|
|
3372
|
+
} catch (e) {
|
|
3373
|
+
}
|
|
3374
|
+
Object.defineProperty(fn, "adapterName", { value });
|
|
3375
|
+
}
|
|
3376
|
+
});
|
|
3377
|
+
const renderReason = (reason) => `- ${reason}`;
|
|
3378
|
+
const isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false;
|
|
3379
|
+
function getAdapter$1(adapters2, config) {
|
|
3380
|
+
adapters2 = utils$1.isArray(adapters2) ? adapters2 : [adapters2];
|
|
3381
|
+
const { length } = adapters2;
|
|
3382
|
+
let nameOrAdapter;
|
|
3383
|
+
let adapter;
|
|
3384
|
+
const rejectedReasons = {};
|
|
3385
|
+
for (let i = 0; i < length; i++) {
|
|
3386
|
+
nameOrAdapter = adapters2[i];
|
|
3387
|
+
let id;
|
|
3388
|
+
adapter = nameOrAdapter;
|
|
3389
|
+
if (!isResolvedHandle(nameOrAdapter)) {
|
|
3390
|
+
adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
|
|
3391
|
+
if (adapter === void 0) {
|
|
3392
|
+
throw new AxiosError$1(`Unknown adapter '${id}'`);
|
|
3393
|
+
}
|
|
3394
|
+
}
|
|
3395
|
+
if (adapter && (utils$1.isFunction(adapter) || (adapter = adapter.get(config)))) {
|
|
3396
|
+
break;
|
|
3397
|
+
}
|
|
3398
|
+
rejectedReasons[id || "#" + i] = adapter;
|
|
3399
|
+
}
|
|
3400
|
+
if (!adapter) {
|
|
3401
|
+
const reasons = Object.entries(rejectedReasons).map(
|
|
3402
|
+
([id, state]) => `adapter ${id} ` + (state === false ? "is not supported by the environment" : "is not available in the build")
|
|
3403
|
+
);
|
|
3404
|
+
let s = length ? reasons.length > 1 ? "since :\n" + reasons.map(renderReason).join("\n") : " " + renderReason(reasons[0]) : "as no adapter specified";
|
|
3405
|
+
throw new AxiosError$1(
|
|
3406
|
+
`There is no suitable adapter to dispatch the request ` + s,
|
|
3407
|
+
"ERR_NOT_SUPPORT"
|
|
3408
|
+
);
|
|
3409
|
+
}
|
|
3410
|
+
return adapter;
|
|
3411
|
+
}
|
|
3412
|
+
const adapters = {
|
|
3413
|
+
/**
|
|
3414
|
+
* Resolve an adapter from a list of adapter names or functions.
|
|
3415
|
+
* @type {Function}
|
|
3416
|
+
*/
|
|
3417
|
+
getAdapter: getAdapter$1,
|
|
3418
|
+
/**
|
|
3419
|
+
* Exposes all known adapters
|
|
3420
|
+
* @type {Object<string, Function|Object>}
|
|
3421
|
+
*/
|
|
3422
|
+
adapters: knownAdapters
|
|
3423
|
+
};
|
|
3424
|
+
function throwIfCancellationRequested(config) {
|
|
3425
|
+
if (config.cancelToken) {
|
|
3426
|
+
config.cancelToken.throwIfRequested();
|
|
3427
|
+
}
|
|
3428
|
+
if (config.signal && config.signal.aborted) {
|
|
3429
|
+
throw new CanceledError$1(null, config);
|
|
3430
|
+
}
|
|
3431
|
+
}
|
|
3432
|
+
function dispatchRequest(config) {
|
|
3433
|
+
throwIfCancellationRequested(config);
|
|
3434
|
+
config.headers = AxiosHeaders$1.from(config.headers);
|
|
3435
|
+
config.data = transformData.call(
|
|
3436
|
+
config,
|
|
3437
|
+
config.transformRequest
|
|
3438
|
+
);
|
|
3439
|
+
if (["post", "put", "patch"].indexOf(config.method) !== -1) {
|
|
3440
|
+
config.headers.setContentType("application/x-www-form-urlencoded", false);
|
|
3441
|
+
}
|
|
3442
|
+
const adapter = adapters.getAdapter(config.adapter || defaults.adapter, config);
|
|
3443
|
+
return adapter(config).then(function onAdapterResolution(response) {
|
|
3444
|
+
throwIfCancellationRequested(config);
|
|
3445
|
+
response.data = transformData.call(
|
|
3446
|
+
config,
|
|
3447
|
+
config.transformResponse,
|
|
3448
|
+
response
|
|
3449
|
+
);
|
|
3450
|
+
response.headers = AxiosHeaders$1.from(response.headers);
|
|
3451
|
+
return response;
|
|
3452
|
+
}, function onAdapterRejection(reason) {
|
|
3453
|
+
if (!isCancel$1(reason)) {
|
|
3454
|
+
throwIfCancellationRequested(config);
|
|
3455
|
+
if (reason && reason.response) {
|
|
3456
|
+
reason.response.data = transformData.call(
|
|
3457
|
+
config,
|
|
3458
|
+
config.transformResponse,
|
|
3459
|
+
reason.response
|
|
3460
|
+
);
|
|
3461
|
+
reason.response.headers = AxiosHeaders$1.from(reason.response.headers);
|
|
3462
|
+
}
|
|
3463
|
+
}
|
|
3464
|
+
return Promise.reject(reason);
|
|
3465
|
+
});
|
|
3466
|
+
}
|
|
3467
|
+
const VERSION$1 = "1.13.2";
|
|
3468
|
+
const validators$1 = {};
|
|
3469
|
+
["object", "boolean", "number", "function", "string", "symbol"].forEach((type, i) => {
|
|
3470
|
+
validators$1[type] = function validator2(thing) {
|
|
3471
|
+
return typeof thing === type || "a" + (i < 1 ? "n " : " ") + type;
|
|
3472
|
+
};
|
|
3473
|
+
});
|
|
3474
|
+
const deprecatedWarnings = {};
|
|
3475
|
+
validators$1.transitional = function transitional(validator2, version, message) {
|
|
3476
|
+
function formatMessage(opt, desc) {
|
|
3477
|
+
return "[Axios v" + VERSION$1 + "] Transitional option '" + opt + "'" + desc + (message ? ". " + message : "");
|
|
3478
|
+
}
|
|
3479
|
+
return (value, opt, opts) => {
|
|
3480
|
+
if (validator2 === false) {
|
|
3481
|
+
throw new AxiosError$1(
|
|
3482
|
+
formatMessage(opt, " has been removed" + (version ? " in " + version : "")),
|
|
3483
|
+
AxiosError$1.ERR_DEPRECATED
|
|
3484
|
+
);
|
|
3485
|
+
}
|
|
3486
|
+
if (version && !deprecatedWarnings[opt]) {
|
|
3487
|
+
deprecatedWarnings[opt] = true;
|
|
3488
|
+
console.warn(
|
|
3489
|
+
formatMessage(
|
|
3490
|
+
opt,
|
|
3491
|
+
" has been deprecated since v" + version + " and will be removed in the near future"
|
|
3492
|
+
)
|
|
3493
|
+
);
|
|
3494
|
+
}
|
|
3495
|
+
return validator2 ? validator2(value, opt, opts) : true;
|
|
3496
|
+
};
|
|
3497
|
+
};
|
|
3498
|
+
validators$1.spelling = function spelling(correctSpelling) {
|
|
3499
|
+
return (value, opt) => {
|
|
3500
|
+
console.warn(`${opt} is likely a misspelling of ${correctSpelling}`);
|
|
3501
|
+
return true;
|
|
3502
|
+
};
|
|
3503
|
+
};
|
|
3504
|
+
function assertOptions(options, schema, allowUnknown) {
|
|
3505
|
+
if (typeof options !== "object") {
|
|
3506
|
+
throw new AxiosError$1("options must be an object", AxiosError$1.ERR_BAD_OPTION_VALUE);
|
|
3507
|
+
}
|
|
3508
|
+
const keys = Object.keys(options);
|
|
3509
|
+
let i = keys.length;
|
|
3510
|
+
while (i-- > 0) {
|
|
3511
|
+
const opt = keys[i];
|
|
3512
|
+
const validator2 = schema[opt];
|
|
3513
|
+
if (validator2) {
|
|
3514
|
+
const value = options[opt];
|
|
3515
|
+
const result = value === void 0 || validator2(value, opt, options);
|
|
3516
|
+
if (result !== true) {
|
|
3517
|
+
throw new AxiosError$1("option " + opt + " must be " + result, AxiosError$1.ERR_BAD_OPTION_VALUE);
|
|
3518
|
+
}
|
|
3519
|
+
continue;
|
|
3520
|
+
}
|
|
3521
|
+
if (allowUnknown !== true) {
|
|
3522
|
+
throw new AxiosError$1("Unknown option " + opt, AxiosError$1.ERR_BAD_OPTION);
|
|
3523
|
+
}
|
|
3524
|
+
}
|
|
3525
|
+
}
|
|
3526
|
+
const validator = {
|
|
3527
|
+
assertOptions,
|
|
3528
|
+
validators: validators$1
|
|
3529
|
+
};
|
|
3530
|
+
const validators = validator.validators;
|
|
3531
|
+
let Axios$1 = class Axios {
|
|
3532
|
+
constructor(instanceConfig) {
|
|
3533
|
+
this.defaults = instanceConfig || {};
|
|
3534
|
+
this.interceptors = {
|
|
3535
|
+
request: new InterceptorManager(),
|
|
3536
|
+
response: new InterceptorManager()
|
|
3537
|
+
};
|
|
3538
|
+
}
|
|
3539
|
+
/**
|
|
3540
|
+
* Dispatch a request
|
|
3541
|
+
*
|
|
3542
|
+
* @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
|
|
3543
|
+
* @param {?Object} config
|
|
3544
|
+
*
|
|
3545
|
+
* @returns {Promise} The Promise to be fulfilled
|
|
3546
|
+
*/
|
|
3547
|
+
async request(configOrUrl, config) {
|
|
3548
|
+
try {
|
|
3549
|
+
return await this._request(configOrUrl, config);
|
|
3550
|
+
} catch (err) {
|
|
3551
|
+
if (err instanceof Error) {
|
|
3552
|
+
let dummy = {};
|
|
3553
|
+
Error.captureStackTrace ? Error.captureStackTrace(dummy) : dummy = new Error();
|
|
3554
|
+
const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, "") : "";
|
|
3555
|
+
try {
|
|
3556
|
+
if (!err.stack) {
|
|
3557
|
+
err.stack = stack;
|
|
3558
|
+
} else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ""))) {
|
|
3559
|
+
err.stack += "\n" + stack;
|
|
3560
|
+
}
|
|
3561
|
+
} catch (e) {
|
|
3562
|
+
}
|
|
3563
|
+
}
|
|
3564
|
+
throw err;
|
|
3565
|
+
}
|
|
3566
|
+
}
|
|
3567
|
+
_request(configOrUrl, config) {
|
|
3568
|
+
if (typeof configOrUrl === "string") {
|
|
3569
|
+
config = config || {};
|
|
3570
|
+
config.url = configOrUrl;
|
|
3571
|
+
} else {
|
|
3572
|
+
config = configOrUrl || {};
|
|
3573
|
+
}
|
|
3574
|
+
config = mergeConfig$1(this.defaults, config);
|
|
3575
|
+
const { transitional: transitional2, paramsSerializer, headers } = config;
|
|
3576
|
+
if (transitional2 !== void 0) {
|
|
3577
|
+
validator.assertOptions(transitional2, {
|
|
3578
|
+
silentJSONParsing: validators.transitional(validators.boolean),
|
|
3579
|
+
forcedJSONParsing: validators.transitional(validators.boolean),
|
|
3580
|
+
clarifyTimeoutError: validators.transitional(validators.boolean)
|
|
3581
|
+
}, false);
|
|
3582
|
+
}
|
|
3583
|
+
if (paramsSerializer != null) {
|
|
3584
|
+
if (utils$1.isFunction(paramsSerializer)) {
|
|
3585
|
+
config.paramsSerializer = {
|
|
3586
|
+
serialize: paramsSerializer
|
|
3587
|
+
};
|
|
3588
|
+
} else {
|
|
3589
|
+
validator.assertOptions(paramsSerializer, {
|
|
3590
|
+
encode: validators.function,
|
|
3591
|
+
serialize: validators.function
|
|
3592
|
+
}, true);
|
|
3593
|
+
}
|
|
3594
|
+
}
|
|
3595
|
+
if (config.allowAbsoluteUrls !== void 0) ;
|
|
3596
|
+
else if (this.defaults.allowAbsoluteUrls !== void 0) {
|
|
3597
|
+
config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;
|
|
3598
|
+
} else {
|
|
3599
|
+
config.allowAbsoluteUrls = true;
|
|
3600
|
+
}
|
|
3601
|
+
validator.assertOptions(config, {
|
|
3602
|
+
baseUrl: validators.spelling("baseURL"),
|
|
3603
|
+
withXsrfToken: validators.spelling("withXSRFToken")
|
|
3604
|
+
}, true);
|
|
3605
|
+
config.method = (config.method || this.defaults.method || "get").toLowerCase();
|
|
3606
|
+
let contextHeaders = headers && utils$1.merge(
|
|
3607
|
+
headers.common,
|
|
3608
|
+
headers[config.method]
|
|
3609
|
+
);
|
|
3610
|
+
headers && utils$1.forEach(
|
|
3611
|
+
["delete", "get", "head", "post", "put", "patch", "common"],
|
|
3612
|
+
(method) => {
|
|
3613
|
+
delete headers[method];
|
|
3614
|
+
}
|
|
3615
|
+
);
|
|
3616
|
+
config.headers = AxiosHeaders$1.concat(contextHeaders, headers);
|
|
3617
|
+
const requestInterceptorChain = [];
|
|
3618
|
+
let synchronousRequestInterceptors = true;
|
|
3619
|
+
this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
|
|
3620
|
+
if (typeof interceptor.runWhen === "function" && interceptor.runWhen(config) === false) {
|
|
3621
|
+
return;
|
|
3622
|
+
}
|
|
3623
|
+
synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
|
|
3624
|
+
requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
|
|
3625
|
+
});
|
|
3626
|
+
const responseInterceptorChain = [];
|
|
3627
|
+
this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
|
|
3628
|
+
responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
|
|
3629
|
+
});
|
|
3630
|
+
let promise;
|
|
3631
|
+
let i = 0;
|
|
3632
|
+
let len;
|
|
3633
|
+
if (!synchronousRequestInterceptors) {
|
|
3634
|
+
const chain = [dispatchRequest.bind(this), void 0];
|
|
3635
|
+
chain.unshift(...requestInterceptorChain);
|
|
3636
|
+
chain.push(...responseInterceptorChain);
|
|
3637
|
+
len = chain.length;
|
|
3638
|
+
promise = Promise.resolve(config);
|
|
3639
|
+
while (i < len) {
|
|
3640
|
+
promise = promise.then(chain[i++], chain[i++]);
|
|
3641
|
+
}
|
|
3642
|
+
return promise;
|
|
3643
|
+
}
|
|
3644
|
+
len = requestInterceptorChain.length;
|
|
3645
|
+
let newConfig = config;
|
|
3646
|
+
while (i < len) {
|
|
3647
|
+
const onFulfilled = requestInterceptorChain[i++];
|
|
3648
|
+
const onRejected = requestInterceptorChain[i++];
|
|
3649
|
+
try {
|
|
3650
|
+
newConfig = onFulfilled(newConfig);
|
|
3651
|
+
} catch (error) {
|
|
3652
|
+
onRejected.call(this, error);
|
|
3653
|
+
break;
|
|
3654
|
+
}
|
|
3655
|
+
}
|
|
3656
|
+
try {
|
|
3657
|
+
promise = dispatchRequest.call(this, newConfig);
|
|
3658
|
+
} catch (error) {
|
|
3659
|
+
return Promise.reject(error);
|
|
3660
|
+
}
|
|
3661
|
+
i = 0;
|
|
3662
|
+
len = responseInterceptorChain.length;
|
|
3663
|
+
while (i < len) {
|
|
3664
|
+
promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);
|
|
3665
|
+
}
|
|
3666
|
+
return promise;
|
|
3667
|
+
}
|
|
3668
|
+
getUri(config) {
|
|
3669
|
+
config = mergeConfig$1(this.defaults, config);
|
|
3670
|
+
const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
|
|
3671
|
+
return buildURL(fullPath, config.params, config.paramsSerializer);
|
|
3672
|
+
}
|
|
3673
|
+
};
|
|
3674
|
+
utils$1.forEach(["delete", "get", "head", "options"], function forEachMethodNoData(method) {
|
|
3675
|
+
Axios$1.prototype[method] = function(url, config) {
|
|
3676
|
+
return this.request(mergeConfig$1(config || {}, {
|
|
3677
|
+
method,
|
|
3678
|
+
url,
|
|
3679
|
+
data: (config || {}).data
|
|
3680
|
+
}));
|
|
3681
|
+
};
|
|
3682
|
+
});
|
|
3683
|
+
utils$1.forEach(["post", "put", "patch"], function forEachMethodWithData(method) {
|
|
3684
|
+
function generateHTTPMethod(isForm) {
|
|
3685
|
+
return function httpMethod(url, data, config) {
|
|
3686
|
+
return this.request(mergeConfig$1(config || {}, {
|
|
3687
|
+
method,
|
|
3688
|
+
headers: isForm ? {
|
|
3689
|
+
"Content-Type": "multipart/form-data"
|
|
3690
|
+
} : {},
|
|
3691
|
+
url,
|
|
3692
|
+
data
|
|
3693
|
+
}));
|
|
3694
|
+
};
|
|
3695
|
+
}
|
|
3696
|
+
Axios$1.prototype[method] = generateHTTPMethod();
|
|
3697
|
+
Axios$1.prototype[method + "Form"] = generateHTTPMethod(true);
|
|
3698
|
+
});
|
|
3699
|
+
let CancelToken$1 = class CancelToken {
|
|
3700
|
+
constructor(executor) {
|
|
3701
|
+
if (typeof executor !== "function") {
|
|
3702
|
+
throw new TypeError("executor must be a function.");
|
|
3703
|
+
}
|
|
3704
|
+
let resolvePromise;
|
|
3705
|
+
this.promise = new Promise(function promiseExecutor(resolve) {
|
|
3706
|
+
resolvePromise = resolve;
|
|
3707
|
+
});
|
|
3708
|
+
const token = this;
|
|
3709
|
+
this.promise.then((cancel) => {
|
|
3710
|
+
if (!token._listeners) return;
|
|
3711
|
+
let i = token._listeners.length;
|
|
3712
|
+
while (i-- > 0) {
|
|
3713
|
+
token._listeners[i](cancel);
|
|
3714
|
+
}
|
|
3715
|
+
token._listeners = null;
|
|
3716
|
+
});
|
|
3717
|
+
this.promise.then = (onfulfilled) => {
|
|
3718
|
+
let _resolve;
|
|
3719
|
+
const promise = new Promise((resolve) => {
|
|
3720
|
+
token.subscribe(resolve);
|
|
3721
|
+
_resolve = resolve;
|
|
3722
|
+
}).then(onfulfilled);
|
|
3723
|
+
promise.cancel = function reject() {
|
|
3724
|
+
token.unsubscribe(_resolve);
|
|
3725
|
+
};
|
|
3726
|
+
return promise;
|
|
3727
|
+
};
|
|
3728
|
+
executor(function cancel(message, config, request) {
|
|
3729
|
+
if (token.reason) {
|
|
3730
|
+
return;
|
|
3731
|
+
}
|
|
3732
|
+
token.reason = new CanceledError$1(message, config, request);
|
|
3733
|
+
resolvePromise(token.reason);
|
|
3734
|
+
});
|
|
3735
|
+
}
|
|
3736
|
+
/**
|
|
3737
|
+
* Throws a `CanceledError` if cancellation has been requested.
|
|
3738
|
+
*/
|
|
3739
|
+
throwIfRequested() {
|
|
3740
|
+
if (this.reason) {
|
|
3741
|
+
throw this.reason;
|
|
3742
|
+
}
|
|
3743
|
+
}
|
|
3744
|
+
/**
|
|
3745
|
+
* Subscribe to the cancel signal
|
|
3746
|
+
*/
|
|
3747
|
+
subscribe(listener) {
|
|
3748
|
+
if (this.reason) {
|
|
3749
|
+
listener(this.reason);
|
|
3750
|
+
return;
|
|
3751
|
+
}
|
|
3752
|
+
if (this._listeners) {
|
|
3753
|
+
this._listeners.push(listener);
|
|
3754
|
+
} else {
|
|
3755
|
+
this._listeners = [listener];
|
|
3756
|
+
}
|
|
3757
|
+
}
|
|
3758
|
+
/**
|
|
3759
|
+
* Unsubscribe from the cancel signal
|
|
3760
|
+
*/
|
|
3761
|
+
unsubscribe(listener) {
|
|
3762
|
+
if (!this._listeners) {
|
|
3763
|
+
return;
|
|
3764
|
+
}
|
|
3765
|
+
const index = this._listeners.indexOf(listener);
|
|
3766
|
+
if (index !== -1) {
|
|
3767
|
+
this._listeners.splice(index, 1);
|
|
3768
|
+
}
|
|
3769
|
+
}
|
|
3770
|
+
toAbortSignal() {
|
|
3771
|
+
const controller = new AbortController();
|
|
3772
|
+
const abort = (err) => {
|
|
3773
|
+
controller.abort(err);
|
|
3774
|
+
};
|
|
3775
|
+
this.subscribe(abort);
|
|
3776
|
+
controller.signal.unsubscribe = () => this.unsubscribe(abort);
|
|
3777
|
+
return controller.signal;
|
|
3778
|
+
}
|
|
3779
|
+
/**
|
|
3780
|
+
* Returns an object that contains a new `CancelToken` and a function that, when called,
|
|
3781
|
+
* cancels the `CancelToken`.
|
|
3782
|
+
*/
|
|
3783
|
+
static source() {
|
|
3784
|
+
let cancel;
|
|
3785
|
+
const token = new CancelToken(function executor(c) {
|
|
3786
|
+
cancel = c;
|
|
1252
3787
|
});
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
}));
|
|
1257
|
-
return (_ctx, _cache) => {
|
|
1258
|
-
return vue.openBlock(), vue.createElementBlock("div", {
|
|
1259
|
-
class: vue.normalizeClass(rootClasses.value),
|
|
1260
|
-
"aria-disabled": __props.disabled ? "true" : void 0
|
|
1261
|
-
}, [
|
|
1262
|
-
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(__props.as), vue.mergeProps(componentAttrs.value, {
|
|
1263
|
-
type: __props.as === "button" ? __props.type : void 0,
|
|
1264
|
-
disabled: __props.as === "button" ? __props.disabled : void 0,
|
|
1265
|
-
target: __props.as === "a" ? __props.target : void 0,
|
|
1266
|
-
rel: __props.as === "a" ? __props.rel : void 0,
|
|
1267
|
-
class: buttonClasses.value,
|
|
1268
|
-
onClick
|
|
1269
|
-
}), {
|
|
1270
|
-
default: vue.withCtx(() => [
|
|
1271
|
-
__props.loading ? (vue.openBlock(), vue.createBlock(_sfc_main$p, {
|
|
1272
|
-
key: 0,
|
|
1273
|
-
class: "mr-2",
|
|
1274
|
-
size: "24px",
|
|
1275
|
-
color: "inherit"
|
|
1276
|
-
})) : __props.icon ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
1277
|
-
key: 1,
|
|
1278
|
-
class: vue.normalizeClass(iconOrderClasses.value),
|
|
1279
|
-
"aria-hidden": "true"
|
|
1280
|
-
}, [
|
|
1281
|
-
vue.createVNode(_sfc_main$w, {
|
|
1282
|
-
class: vue.normalizeClass(iconFillClass2.value),
|
|
1283
|
-
name: __props.icon,
|
|
1284
|
-
size: 24
|
|
1285
|
-
}, null, 8, ["class", "name"])
|
|
1286
|
-
], 2)) : vue.createCommentVNode("", true),
|
|
1287
|
-
vue.createElementVNode("span", _hoisted_2$e, vue.toDisplayString(__props.text), 1)
|
|
1288
|
-
]),
|
|
1289
|
-
_: 1
|
|
1290
|
-
}, 16, ["type", "disabled", "target", "rel", "class"]))
|
|
1291
|
-
], 10, _hoisted_1$j);
|
|
3788
|
+
return {
|
|
3789
|
+
token,
|
|
3790
|
+
cancel
|
|
1292
3791
|
};
|
|
1293
3792
|
}
|
|
3793
|
+
};
|
|
3794
|
+
function spread$1(callback) {
|
|
3795
|
+
return function wrap(arr) {
|
|
3796
|
+
return callback.apply(null, arr);
|
|
3797
|
+
};
|
|
3798
|
+
}
|
|
3799
|
+
function isAxiosError$1(payload) {
|
|
3800
|
+
return utils$1.isObject(payload) && payload.isAxiosError === true;
|
|
3801
|
+
}
|
|
3802
|
+
const HttpStatusCode$1 = {
|
|
3803
|
+
Continue: 100,
|
|
3804
|
+
SwitchingProtocols: 101,
|
|
3805
|
+
Processing: 102,
|
|
3806
|
+
EarlyHints: 103,
|
|
3807
|
+
Ok: 200,
|
|
3808
|
+
Created: 201,
|
|
3809
|
+
Accepted: 202,
|
|
3810
|
+
NonAuthoritativeInformation: 203,
|
|
3811
|
+
NoContent: 204,
|
|
3812
|
+
ResetContent: 205,
|
|
3813
|
+
PartialContent: 206,
|
|
3814
|
+
MultiStatus: 207,
|
|
3815
|
+
AlreadyReported: 208,
|
|
3816
|
+
ImUsed: 226,
|
|
3817
|
+
MultipleChoices: 300,
|
|
3818
|
+
MovedPermanently: 301,
|
|
3819
|
+
Found: 302,
|
|
3820
|
+
SeeOther: 303,
|
|
3821
|
+
NotModified: 304,
|
|
3822
|
+
UseProxy: 305,
|
|
3823
|
+
Unused: 306,
|
|
3824
|
+
TemporaryRedirect: 307,
|
|
3825
|
+
PermanentRedirect: 308,
|
|
3826
|
+
BadRequest: 400,
|
|
3827
|
+
Unauthorized: 401,
|
|
3828
|
+
PaymentRequired: 402,
|
|
3829
|
+
Forbidden: 403,
|
|
3830
|
+
NotFound: 404,
|
|
3831
|
+
MethodNotAllowed: 405,
|
|
3832
|
+
NotAcceptable: 406,
|
|
3833
|
+
ProxyAuthenticationRequired: 407,
|
|
3834
|
+
RequestTimeout: 408,
|
|
3835
|
+
Conflict: 409,
|
|
3836
|
+
Gone: 410,
|
|
3837
|
+
LengthRequired: 411,
|
|
3838
|
+
PreconditionFailed: 412,
|
|
3839
|
+
PayloadTooLarge: 413,
|
|
3840
|
+
UriTooLong: 414,
|
|
3841
|
+
UnsupportedMediaType: 415,
|
|
3842
|
+
RangeNotSatisfiable: 416,
|
|
3843
|
+
ExpectationFailed: 417,
|
|
3844
|
+
ImATeapot: 418,
|
|
3845
|
+
MisdirectedRequest: 421,
|
|
3846
|
+
UnprocessableEntity: 422,
|
|
3847
|
+
Locked: 423,
|
|
3848
|
+
FailedDependency: 424,
|
|
3849
|
+
TooEarly: 425,
|
|
3850
|
+
UpgradeRequired: 426,
|
|
3851
|
+
PreconditionRequired: 428,
|
|
3852
|
+
TooManyRequests: 429,
|
|
3853
|
+
RequestHeaderFieldsTooLarge: 431,
|
|
3854
|
+
UnavailableForLegalReasons: 451,
|
|
3855
|
+
InternalServerError: 500,
|
|
3856
|
+
NotImplemented: 501,
|
|
3857
|
+
BadGateway: 502,
|
|
3858
|
+
ServiceUnavailable: 503,
|
|
3859
|
+
GatewayTimeout: 504,
|
|
3860
|
+
HttpVersionNotSupported: 505,
|
|
3861
|
+
VariantAlsoNegotiates: 506,
|
|
3862
|
+
InsufficientStorage: 507,
|
|
3863
|
+
LoopDetected: 508,
|
|
3864
|
+
NotExtended: 510,
|
|
3865
|
+
NetworkAuthenticationRequired: 511,
|
|
3866
|
+
WebServerIsDown: 521,
|
|
3867
|
+
ConnectionTimedOut: 522,
|
|
3868
|
+
OriginIsUnreachable: 523,
|
|
3869
|
+
TimeoutOccurred: 524,
|
|
3870
|
+
SslHandshakeFailed: 525,
|
|
3871
|
+
InvalidSslCertificate: 526
|
|
3872
|
+
};
|
|
3873
|
+
Object.entries(HttpStatusCode$1).forEach(([key, value]) => {
|
|
3874
|
+
HttpStatusCode$1[value] = key;
|
|
1294
3875
|
});
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
3876
|
+
function createInstance(defaultConfig) {
|
|
3877
|
+
const context = new Axios$1(defaultConfig);
|
|
3878
|
+
const instance = bind(Axios$1.prototype.request, context);
|
|
3879
|
+
utils$1.extend(instance, Axios$1.prototype, context, { allOwnKeys: true });
|
|
3880
|
+
utils$1.extend(instance, context, null, { allOwnKeys: true });
|
|
3881
|
+
instance.create = function create(instanceConfig) {
|
|
3882
|
+
return createInstance(mergeConfig$1(defaultConfig, instanceConfig));
|
|
3883
|
+
};
|
|
3884
|
+
return instance;
|
|
3885
|
+
}
|
|
3886
|
+
const axios = createInstance(defaults);
|
|
3887
|
+
axios.Axios = Axios$1;
|
|
3888
|
+
axios.CanceledError = CanceledError$1;
|
|
3889
|
+
axios.CancelToken = CancelToken$1;
|
|
3890
|
+
axios.isCancel = isCancel$1;
|
|
3891
|
+
axios.VERSION = VERSION$1;
|
|
3892
|
+
axios.toFormData = toFormData$1;
|
|
3893
|
+
axios.AxiosError = AxiosError$1;
|
|
3894
|
+
axios.Cancel = axios.CanceledError;
|
|
3895
|
+
axios.all = function all(promises) {
|
|
3896
|
+
return Promise.all(promises);
|
|
1298
3897
|
};
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
3898
|
+
axios.spread = spread$1;
|
|
3899
|
+
axios.isAxiosError = isAxiosError$1;
|
|
3900
|
+
axios.mergeConfig = mergeConfig$1;
|
|
3901
|
+
axios.AxiosHeaders = AxiosHeaders$1;
|
|
3902
|
+
axios.formToJSON = (thing) => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing);
|
|
3903
|
+
axios.getAdapter = adapters.getAdapter;
|
|
3904
|
+
axios.HttpStatusCode = HttpStatusCode$1;
|
|
3905
|
+
axios.default = axios;
|
|
3906
|
+
const {
|
|
3907
|
+
Axios: Axios2,
|
|
3908
|
+
AxiosError,
|
|
3909
|
+
CanceledError,
|
|
3910
|
+
isCancel,
|
|
3911
|
+
CancelToken: CancelToken2,
|
|
3912
|
+
VERSION,
|
|
3913
|
+
all: all2,
|
|
3914
|
+
Cancel,
|
|
3915
|
+
isAxiosError,
|
|
3916
|
+
spread,
|
|
3917
|
+
toFormData,
|
|
3918
|
+
AxiosHeaders: AxiosHeaders2,
|
|
3919
|
+
HttpStatusCode,
|
|
3920
|
+
formToJSON,
|
|
3921
|
+
getAdapter,
|
|
3922
|
+
mergeConfig
|
|
3923
|
+
} = axios;
|
|
3924
|
+
const HEX_ESCAPE_REPLACE_REGEXP = /%([0-9A-Fa-f]{2})/g;
|
|
3925
|
+
const NON_LATIN1_REGEXP = /[^\x20-\x7e\xa0-\xff]/g;
|
|
3926
|
+
const QESC_REGEXP = /\\([\u0000-\u007f])/g;
|
|
3927
|
+
const PARAM_REGEXP = /;[\x09\x20]*([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*=[\x09\x20]*("(?:[\x20!\x23-\x5b\x5d-\x7e\x80-\xff]|\\[\x20-\x7e])*"|[!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*/g;
|
|
3928
|
+
const EXT_VALUE_REGEXP = /^([A-Za-z0-9!#$%&+\-^_`{}~]+)'(?:[A-Za-z]{2,3}(?:-[A-Za-z]{3}){0,3}|[A-Za-z]{4,8}|)'((?:%[0-9A-Fa-f]{2}|[A-Za-z0-9!#$&+.^_`|~-])+)$/;
|
|
3929
|
+
const DISPOSITION_TYPE_REGEXP = /^([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*(?:$|;)/;
|
|
3930
|
+
function decodefield(str) {
|
|
3931
|
+
const match = EXT_VALUE_REGEXP.exec(str);
|
|
3932
|
+
if (!match) {
|
|
3933
|
+
throw new TypeError("invalid extended field value");
|
|
3934
|
+
}
|
|
3935
|
+
const charset = match[1].toLowerCase();
|
|
3936
|
+
const encoded = match[2];
|
|
3937
|
+
let value;
|
|
3938
|
+
switch (charset) {
|
|
3939
|
+
case "iso-8859-1":
|
|
3940
|
+
value = getlatin1(encoded.replace(HEX_ESCAPE_REPLACE_REGEXP, pdecode));
|
|
3941
|
+
break;
|
|
3942
|
+
case "utf-8":
|
|
1316
3943
|
try {
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
}
|
|
1321
|
-
} catch {
|
|
3944
|
+
value = decodeURIComponent(encoded);
|
|
3945
|
+
} catch (_a) {
|
|
3946
|
+
throw new TypeError("invalid encoded utf-8");
|
|
1322
3947
|
}
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
3948
|
+
break;
|
|
3949
|
+
default:
|
|
3950
|
+
throw new TypeError("unsupported charset in extended field");
|
|
3951
|
+
}
|
|
3952
|
+
return value;
|
|
3953
|
+
}
|
|
3954
|
+
function getlatin1(val) {
|
|
3955
|
+
return String(val).replace(NON_LATIN1_REGEXP, "?");
|
|
3956
|
+
}
|
|
3957
|
+
function parse(string) {
|
|
3958
|
+
if (!string || typeof string !== "string") {
|
|
3959
|
+
throw new TypeError("argument string is required");
|
|
3960
|
+
}
|
|
3961
|
+
let match = DISPOSITION_TYPE_REGEXP.exec(string);
|
|
3962
|
+
if (!match) {
|
|
3963
|
+
throw new TypeError("invalid type format");
|
|
3964
|
+
}
|
|
3965
|
+
let index = match[0].length;
|
|
3966
|
+
const type = match[1].toLowerCase();
|
|
3967
|
+
let key;
|
|
3968
|
+
const names = [];
|
|
3969
|
+
const params = {};
|
|
3970
|
+
let value;
|
|
3971
|
+
index = PARAM_REGEXP.lastIndex = match[0].substr(-1) === ";" ? index - 1 : index;
|
|
3972
|
+
while (match = PARAM_REGEXP.exec(string)) {
|
|
3973
|
+
if (match.index !== index) {
|
|
3974
|
+
throw new TypeError("invalid parameter format");
|
|
3975
|
+
}
|
|
3976
|
+
index += match[0].length;
|
|
3977
|
+
key = match[1].toLowerCase();
|
|
3978
|
+
value = match[2];
|
|
3979
|
+
if (names.indexOf(key) !== -1) {
|
|
3980
|
+
throw new TypeError("invalid duplicate parameter");
|
|
3981
|
+
}
|
|
3982
|
+
names.push(key);
|
|
3983
|
+
if (key.indexOf("*") + 1 === key.length) {
|
|
3984
|
+
key = key.slice(0, -1);
|
|
3985
|
+
value = decodefield(value);
|
|
3986
|
+
params[key] = value;
|
|
3987
|
+
continue;
|
|
3988
|
+
}
|
|
3989
|
+
if (typeof params[key] === "string") {
|
|
3990
|
+
continue;
|
|
3991
|
+
}
|
|
3992
|
+
if (value[0] === '"') {
|
|
3993
|
+
value = value.substr(1, value.length - 2).replace(QESC_REGEXP, "$1");
|
|
3994
|
+
}
|
|
3995
|
+
params[key] = value;
|
|
3996
|
+
}
|
|
3997
|
+
if (index !== -1 && index !== string.length) {
|
|
3998
|
+
throw new TypeError("invalid parameter format");
|
|
3999
|
+
}
|
|
4000
|
+
return { type, parameters: params };
|
|
4001
|
+
}
|
|
4002
|
+
function pdecode(str, hex) {
|
|
4003
|
+
return String.fromCharCode(parseInt(hex, 16));
|
|
4004
|
+
}
|
|
4005
|
+
function useDownload() {
|
|
4006
|
+
const isDownloading = vue.ref(false);
|
|
4007
|
+
const downloadFile = async (url, filename, token, headers) => {
|
|
4008
|
+
if (isDownloading.value) return;
|
|
4009
|
+
try {
|
|
4010
|
+
isDownloading.value = true;
|
|
4011
|
+
const requestHeaders = { ...headers };
|
|
4012
|
+
if (token && !requestHeaders.Authorization) {
|
|
4013
|
+
requestHeaders.Authorization = `Bearer ${token}`;
|
|
1335
4014
|
}
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
4015
|
+
const response = await axios.get(url, {
|
|
4016
|
+
responseType: "blob",
|
|
4017
|
+
...Object.keys(requestHeaders).length > 0 && { headers: requestHeaders }
|
|
4018
|
+
});
|
|
4019
|
+
const blob = new Blob([response.data], { type: response.data.type });
|
|
4020
|
+
const blobUrl = URL.createObjectURL(blob);
|
|
4021
|
+
let finalFilename = filename;
|
|
4022
|
+
const contentDisposition = response.headers["content-disposition"] || response.headers["Content-Disposition"];
|
|
4023
|
+
if (contentDisposition) {
|
|
4024
|
+
try {
|
|
4025
|
+
const parsed = parse(contentDisposition);
|
|
4026
|
+
if (parsed.parameters?.filename) {
|
|
4027
|
+
finalFilename = decodeURIComponent(parsed.parameters.filename.replace(/\+/g, "%20"));
|
|
4028
|
+
}
|
|
4029
|
+
} catch {
|
|
1346
4030
|
}
|
|
1347
4031
|
}
|
|
1348
|
-
if (!
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
4032
|
+
if (!finalFilename) {
|
|
4033
|
+
finalFilename = url.substring(url.lastIndexOf("/") + 1) || "download";
|
|
4034
|
+
}
|
|
4035
|
+
const link = document.createElement("a");
|
|
4036
|
+
link.href = blobUrl;
|
|
4037
|
+
link.download = finalFilename;
|
|
4038
|
+
document.body.appendChild(link);
|
|
4039
|
+
link.click();
|
|
4040
|
+
setTimeout(() => {
|
|
4041
|
+
document.body.removeChild(link);
|
|
4042
|
+
URL.revokeObjectURL(blobUrl);
|
|
4043
|
+
}, 100);
|
|
4044
|
+
} catch (error) {
|
|
4045
|
+
console.error("Download failed:", error);
|
|
4046
|
+
throw error;
|
|
4047
|
+
} finally {
|
|
4048
|
+
isDownloading.value = false;
|
|
1354
4049
|
}
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
vue.createVNode(_sfc_main$w, { name: "bigSuccess" }),
|
|
1364
|
-
vue.createElementVNode("span", null, vue.toDisplayString(props.copiedLabel), 1)
|
|
1365
|
-
])) : (vue.openBlock(), vue.createBlock(_sfc_main$o, {
|
|
1366
|
-
key: 1,
|
|
1367
|
-
type: "button",
|
|
1368
|
-
disabled: props.disabled,
|
|
1369
|
-
icon: "copy",
|
|
1370
|
-
text: isCopied.value ? props.copiedLabel : props.label,
|
|
1371
|
-
onClick
|
|
1372
|
-
}, null, 8, ["disabled", "text"]));
|
|
1373
|
-
};
|
|
1374
|
-
}
|
|
1375
|
-
});
|
|
1376
|
-
const _hoisted_1$h = ["disabled", "aria-disabled"];
|
|
1377
|
-
const _sfc_main$m = /* @__PURE__ */ vue.defineComponent({
|
|
4050
|
+
};
|
|
4051
|
+
return {
|
|
4052
|
+
downloadFile,
|
|
4053
|
+
isDownloading
|
|
4054
|
+
};
|
|
4055
|
+
}
|
|
4056
|
+
const _hoisted_1$g = ["disabled", "aria-disabled"];
|
|
4057
|
+
const _sfc_main$l = /* @__PURE__ */ vue.defineComponent({
|
|
1378
4058
|
__name: "FdsButtonDownload",
|
|
1379
4059
|
props: {
|
|
1380
4060
|
loading: { type: Boolean, default: false },
|
|
@@ -1389,7 +4069,7 @@ const _sfc_main$m = /* @__PURE__ */ vue.defineComponent({
|
|
|
1389
4069
|
setup(__props, { emit: __emit }) {
|
|
1390
4070
|
const props = __props;
|
|
1391
4071
|
const emit = __emit;
|
|
1392
|
-
const isDownloading =
|
|
4072
|
+
const { downloadFile, isDownloading } = useDownload();
|
|
1393
4073
|
const elBase2 = vue.computed(() => [
|
|
1394
4074
|
"inline-block transition-opacity duration-200 text-left",
|
|
1395
4075
|
"box-border appearance-none inline-flex items-center justify-center shadow-none p-0.5 text-base",
|
|
@@ -1410,7 +4090,7 @@ const _sfc_main$m = /* @__PURE__ */ vue.defineComponent({
|
|
|
1410
4090
|
isDownloading.value ? "cursor-not-allowed text-gray-500" : "cursor-pointer text-blue-600"
|
|
1411
4091
|
]);
|
|
1412
4092
|
const iconFillClass2 = vue.computed(() => isDownloading.value || props.disabled ? "fill-gray-500" : "fill-blue-500");
|
|
1413
|
-
async
|
|
4093
|
+
const handleDownload = async (ev) => {
|
|
1414
4094
|
if (props.disabled || props.loading || isDownloading.value) {
|
|
1415
4095
|
ev.preventDefault();
|
|
1416
4096
|
return;
|
|
@@ -1420,48 +4100,17 @@ const _sfc_main$m = /* @__PURE__ */ vue.defineComponent({
|
|
|
1420
4100
|
return;
|
|
1421
4101
|
}
|
|
1422
4102
|
ev.preventDefault();
|
|
1423
|
-
isDownloading.value = true;
|
|
1424
4103
|
const options = props.downloadOptions;
|
|
1425
|
-
const
|
|
1426
|
-
|
|
4104
|
+
const headers = {};
|
|
4105
|
+
headers[options.headerAuthKey || "Authorization"] = `${options.headerAuthValuePrefix || "Bearer "}${options.token}`;
|
|
1427
4106
|
if (options.accept) {
|
|
1428
|
-
|
|
4107
|
+
headers.Accept = options.accept;
|
|
1429
4108
|
}
|
|
1430
4109
|
try {
|
|
1431
|
-
const
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
if (!response.ok) {
|
|
1436
|
-
throw new Error(`Download failed: ${response.status} ${response.statusText}`);
|
|
1437
|
-
}
|
|
1438
|
-
const blob = await response.blob();
|
|
1439
|
-
const url = URL.createObjectURL(blob);
|
|
1440
|
-
const link = document.createElement("a");
|
|
1441
|
-
link.href = url;
|
|
1442
|
-
const contentDisposition = response.headers.get("content-disposition");
|
|
1443
|
-
let fileName = props.href.substring(props.href.lastIndexOf("/") + 1);
|
|
1444
|
-
if (contentDisposition) {
|
|
1445
|
-
const fileNameMatch = contentDisposition.match(/filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/);
|
|
1446
|
-
if (fileNameMatch && fileNameMatch[1]) {
|
|
1447
|
-
fileName = fileNameMatch[1].replace(/['"]/g, "");
|
|
1448
|
-
fileName = fileName.replace(/\+/g, "%20");
|
|
1449
|
-
fileName = decodeURIComponent(fileName);
|
|
1450
|
-
}
|
|
1451
|
-
}
|
|
1452
|
-
link.setAttribute("download", fileName);
|
|
1453
|
-
document.body.appendChild(link);
|
|
1454
|
-
link.dispatchEvent(
|
|
1455
|
-
new MouseEvent("click", {
|
|
1456
|
-
bubbles: true,
|
|
1457
|
-
cancelable: true,
|
|
1458
|
-
view: window
|
|
1459
|
-
})
|
|
1460
|
-
);
|
|
1461
|
-
setTimeout(() => {
|
|
1462
|
-
document.body.removeChild(link);
|
|
1463
|
-
URL.revokeObjectURL(url);
|
|
1464
|
-
}, 100);
|
|
4110
|
+
const url = props.href;
|
|
4111
|
+
const filename = void 0;
|
|
4112
|
+
const token = void 0;
|
|
4113
|
+
await downloadFile(url, filename, token, headers);
|
|
1465
4114
|
if (options.onFinishCallback) {
|
|
1466
4115
|
options.onFinishCallback();
|
|
1467
4116
|
}
|
|
@@ -1471,10 +4120,8 @@ const _sfc_main$m = /* @__PURE__ */ vue.defineComponent({
|
|
|
1471
4120
|
} else {
|
|
1472
4121
|
throw error;
|
|
1473
4122
|
}
|
|
1474
|
-
} finally {
|
|
1475
|
-
isDownloading.value = false;
|
|
1476
4123
|
}
|
|
1477
|
-
}
|
|
4124
|
+
};
|
|
1478
4125
|
const onClick = (ev) => {
|
|
1479
4126
|
if (props.downloadOptions) {
|
|
1480
4127
|
handleDownload(ev);
|
|
@@ -1489,7 +4136,7 @@ const _sfc_main$m = /* @__PURE__ */ vue.defineComponent({
|
|
|
1489
4136
|
return (_ctx, _cache) => {
|
|
1490
4137
|
return vue.openBlock(), vue.createElementBlock("button", {
|
|
1491
4138
|
class: vue.normalizeClass(buttonClasses.value),
|
|
1492
|
-
disabled: __props.disabled || __props.loading || isDownloading
|
|
4139
|
+
disabled: __props.disabled || __props.loading || vue.unref(isDownloading),
|
|
1493
4140
|
type: "button",
|
|
1494
4141
|
onClick,
|
|
1495
4142
|
"aria-disabled": __props.disabled ? "true" : void 0
|
|
@@ -1505,16 +4152,16 @@ const _sfc_main$m = /* @__PURE__ */ vue.defineComponent({
|
|
|
1505
4152
|
}, null, 8, ["class"])
|
|
1506
4153
|
], 2),
|
|
1507
4154
|
vue.createTextVNode(" " + vue.toDisplayString(__props.text), 1)
|
|
1508
|
-
], 10, _hoisted_1$
|
|
4155
|
+
], 10, _hoisted_1$g);
|
|
1509
4156
|
};
|
|
1510
4157
|
}
|
|
1511
4158
|
});
|
|
1512
|
-
const _hoisted_1$
|
|
4159
|
+
const _hoisted_1$f = ["aria-disabled"];
|
|
1513
4160
|
const _hoisted_2$d = { key: 2 };
|
|
1514
4161
|
const elBase$1 = "box-border appearance-none inline-flex items-center justify-center cursor-pointer select-none w-full min-h-0 min-w-12 m-0 rounded-lg text-center align-middle whitespace-nowrap no-underline shadow-[0_2px_4px_rgba(12,72,153,0.12)] transition-[box-shadow,border-color,background-color] duration-200 font-main font-bold text-base leading-5 tracking-normal focus-visible:outline-dashed focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-blue-500";
|
|
1515
4162
|
const variantClasses$1 = "bg-red-600 border border-red-700 text-white hover:bg-red-700 active:bg-red-800 active:border-red-800";
|
|
1516
4163
|
const iconFillClass$1 = "fill-white";
|
|
1517
|
-
const _sfc_main$
|
|
4164
|
+
const _sfc_main$k = /* @__PURE__ */ vue.defineComponent({
|
|
1518
4165
|
__name: "FdsButtonPrimary",
|
|
1519
4166
|
props: {
|
|
1520
4167
|
text: {},
|
|
@@ -1585,7 +4232,7 @@ const _sfc_main$l = /* @__PURE__ */ vue.defineComponent({
|
|
|
1585
4232
|
onClick
|
|
1586
4233
|
}), {
|
|
1587
4234
|
default: vue.withCtx(() => [
|
|
1588
|
-
__props.loading ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
4235
|
+
__props.loading ? (vue.openBlock(), vue.createBlock(_sfc_main$o, {
|
|
1589
4236
|
key: 0,
|
|
1590
4237
|
size: "24px",
|
|
1591
4238
|
color: "inherit"
|
|
@@ -1604,16 +4251,16 @@ const _sfc_main$l = /* @__PURE__ */ vue.defineComponent({
|
|
|
1604
4251
|
]),
|
|
1605
4252
|
_: 1
|
|
1606
4253
|
}, 16, ["type", "disabled", "class"]))
|
|
1607
|
-
], 10, _hoisted_1$
|
|
4254
|
+
], 10, _hoisted_1$f);
|
|
1608
4255
|
};
|
|
1609
4256
|
}
|
|
1610
4257
|
});
|
|
1611
|
-
const _hoisted_1$
|
|
4258
|
+
const _hoisted_1$e = ["aria-disabled"];
|
|
1612
4259
|
const _hoisted_2$c = { key: 2 };
|
|
1613
4260
|
const elBase = "box-border appearance-none inline-flex items-center justify-center cursor-pointer select-none w-full min-h-0 min-w-12 m-0 rounded-lg text-center align-middle whitespace-nowrap no-underline shadow-[0_2px_4px_rgba(12,72,153,0.12)] transition-[box-shadow,border-color,background-color] duration-200 font-main font-bold text-base leading-5 tracking-normal focus-visible:outline-dashed focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-blue-500";
|
|
1614
4261
|
const variantClasses = "bg-white border-2 border-blue-500 text-blue-600 hover:border-blue-600 active:bg-blue-600 active:border-blue-600 active:text-white";
|
|
1615
4262
|
const iconFillClass = "fill-blue-500";
|
|
1616
|
-
const _sfc_main$
|
|
4263
|
+
const _sfc_main$j = /* @__PURE__ */ vue.defineComponent({
|
|
1617
4264
|
__name: "FdsButtonSecondary",
|
|
1618
4265
|
props: {
|
|
1619
4266
|
text: {},
|
|
@@ -1684,7 +4331,7 @@ const _sfc_main$k = /* @__PURE__ */ vue.defineComponent({
|
|
|
1684
4331
|
onClick
|
|
1685
4332
|
}), {
|
|
1686
4333
|
default: vue.withCtx(() => [
|
|
1687
|
-
__props.loading ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
4334
|
+
__props.loading ? (vue.openBlock(), vue.createBlock(_sfc_main$o, {
|
|
1688
4335
|
key: 0,
|
|
1689
4336
|
size: "24px",
|
|
1690
4337
|
color: "inherit"
|
|
@@ -1703,13 +4350,13 @@ const _sfc_main$k = /* @__PURE__ */ vue.defineComponent({
|
|
|
1703
4350
|
]),
|
|
1704
4351
|
_: 1
|
|
1705
4352
|
}, 16, ["type", "disabled", "class"]))
|
|
1706
|
-
], 10, _hoisted_1$
|
|
4353
|
+
], 10, _hoisted_1$e);
|
|
1707
4354
|
};
|
|
1708
4355
|
}
|
|
1709
4356
|
});
|
|
1710
|
-
const _hoisted_1$
|
|
4357
|
+
const _hoisted_1$d = { class: "flex justify-between mb-4" };
|
|
1711
4358
|
const _hoisted_2$b = { class: "mb-0-last-child" };
|
|
1712
|
-
const _sfc_main$
|
|
4359
|
+
const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
|
|
1713
4360
|
__name: "FdsModal",
|
|
1714
4361
|
props: {
|
|
1715
4362
|
open: { type: Boolean, default: false },
|
|
@@ -1888,7 +4535,7 @@ const _sfc_main$j = /* @__PURE__ */ vue.defineComponent({
|
|
|
1888
4535
|
onClick: _cache[1] || (_cache[1] = vue.withModifiers(() => {
|
|
1889
4536
|
}, ["stop"]))
|
|
1890
4537
|
}, [
|
|
1891
|
-
vue.createElementVNode("div", _hoisted_1$
|
|
4538
|
+
vue.createElementVNode("div", _hoisted_1$d, [
|
|
1892
4539
|
vue.createElementVNode("h3", {
|
|
1893
4540
|
tabindex: "-1",
|
|
1894
4541
|
class: vue.normalizeClass(headerTitleClasses.value)
|
|
@@ -5094,47 +7741,34 @@ try {
|
|
|
5094
7741
|
globalThis.IMask = IMask;
|
|
5095
7742
|
} catch {
|
|
5096
7743
|
}
|
|
5097
|
-
const _hoisted_1$
|
|
7744
|
+
const _hoisted_1$c = ["for"];
|
|
5098
7745
|
const _hoisted_2$a = { class: "relative" };
|
|
5099
|
-
const _hoisted_3$7 = ["id", "type", "disabled", "required", "value", "aria-invalid"];
|
|
7746
|
+
const _hoisted_3$7 = ["id", "type", "disabled", "required", "value", "aria-invalid", "maxlength"];
|
|
5100
7747
|
const _hoisted_4$6 = {
|
|
5101
7748
|
key: 0,
|
|
5102
7749
|
class: "text-red-600 font-bold mt-1"
|
|
5103
7750
|
};
|
|
5104
|
-
const _sfc_main$
|
|
7751
|
+
const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
|
|
5105
7752
|
...{
|
|
5106
7753
|
inheritAttrs: false
|
|
5107
7754
|
},
|
|
5108
7755
|
__name: "FdsInput",
|
|
5109
7756
|
props: /* @__PURE__ */ vue.mergeModels({
|
|
5110
|
-
value: { default: void 0 },
|
|
5111
7757
|
label: { default: void 0 },
|
|
5112
|
-
|
|
7758
|
+
meta: { default: void 0 },
|
|
5113
7759
|
valid: { type: [Boolean, null], default: void 0 },
|
|
5114
7760
|
optional: { type: Boolean, default: false },
|
|
5115
7761
|
invalidMessage: {},
|
|
5116
|
-
required: { type: Boolean, default: false },
|
|
5117
7762
|
labelLeft: { type: Boolean, default: false },
|
|
5118
|
-
meta: { default: void 0 },
|
|
5119
|
-
type: { default: "text" },
|
|
5120
7763
|
clearButton: { type: Boolean, default: false },
|
|
5121
|
-
name: {},
|
|
5122
|
-
id: { default: void 0 },
|
|
5123
7764
|
passwordLabels: { default: void 0 },
|
|
5124
7765
|
locale: {},
|
|
5125
|
-
size: {},
|
|
5126
|
-
maxlength: {},
|
|
5127
7766
|
mask: { default: void 0 },
|
|
5128
|
-
maskOptions: { default: void 0 },
|
|
5129
7767
|
modelValue: {},
|
|
5130
|
-
modelModifiers: { default: () => ({}) },
|
|
5131
7768
|
onClearInput: {},
|
|
5132
|
-
|
|
5133
|
-
|
|
5134
|
-
|
|
5135
|
-
onChange: {},
|
|
5136
|
-
autocomplete: {},
|
|
5137
|
-
dataTestid: {}
|
|
7769
|
+
maskOptions: { default: void 0 },
|
|
7770
|
+
modelModifiers: { default: () => ({}) },
|
|
7771
|
+
value: { default: void 0 }
|
|
5138
7772
|
}, {
|
|
5139
7773
|
"modelValue": { default: void 0, required: false },
|
|
5140
7774
|
"modelModifiers": {}
|
|
@@ -5158,20 +7792,26 @@ const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
|
|
|
5158
7792
|
const showPasswordToggle = vue.computed(() => isPasswordType.value && internalValue.value.length > 0);
|
|
5159
7793
|
const wrapperClass = vue.computed(() => attrs.class);
|
|
5160
7794
|
const inputClasses = vue.computed(() => [
|
|
5161
|
-
"block
|
|
7795
|
+
"block rounded-md border border-gray-500 px-3 py-[calc(0.75rem-1px)]",
|
|
7796
|
+
props.maxlength ? "" : "w-full",
|
|
5162
7797
|
"focus:outline-2 focus:outline-blue-500 -outline-offset-2 focus:border-transparent",
|
|
5163
7798
|
props.disabled ? "outline-dashed outline-2 outline-gray-400 cursor-not-allowed border-transparent" : "bg-white",
|
|
5164
7799
|
isInvalid.value && "outline-2 outline-red-600"
|
|
5165
7800
|
]);
|
|
7801
|
+
const inputStyle = vue.computed(() => {
|
|
7802
|
+
if (props.maxlength) {
|
|
7803
|
+
return {
|
|
7804
|
+
width: `calc(${props.maxlength}ch + 1.5rem + 0.25rem)`,
|
|
7805
|
+
maxWidth: "100%"
|
|
7806
|
+
};
|
|
7807
|
+
}
|
|
7808
|
+
return {};
|
|
7809
|
+
});
|
|
5166
7810
|
const validationIconClasses = vue.computed(() => [
|
|
5167
7811
|
"absolute flex gap-2 right-4 top-1/2 -translate-y-1/2 flex items-center justify-end"
|
|
5168
7812
|
]);
|
|
5169
7813
|
const internalValue = vue.computed({
|
|
5170
|
-
get: () =>
|
|
5171
|
-
// If modelValue is explicitly set (via v-model), use it
|
|
5172
|
-
// Otherwise fall back to value prop
|
|
5173
|
-
modelValue.value !== void 0 ? modelValue.value : props.value ?? ""
|
|
5174
|
-
),
|
|
7814
|
+
get: () => modelValue.value !== void 0 ? modelValue.value : props.value ?? "",
|
|
5175
7815
|
set: (newValue) => {
|
|
5176
7816
|
if (modelValue.value !== void 0) {
|
|
5177
7817
|
modelValue.value = newValue;
|
|
@@ -5272,7 +7912,7 @@ const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
|
|
|
5272
7912
|
key: 0,
|
|
5273
7913
|
for: inputId.value,
|
|
5274
7914
|
class: vue.normalizeClass(["block font-bold text-gray-900 cursor-pointer", { "mb-0": __props.meta, "mb-1": !__props.meta }])
|
|
5275
|
-
}, vue.toDisplayString(__props.label), 11, _hoisted_1$
|
|
7915
|
+
}, vue.toDisplayString(__props.label), 11, _hoisted_1$c)) : vue.createCommentVNode("", true),
|
|
5276
7916
|
__props.meta ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
5277
7917
|
key: 1,
|
|
5278
7918
|
class: vue.normalizeClass(["font-thin", { "mb-1": !__props.labelLeft }])
|
|
@@ -5286,13 +7926,15 @@ const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
|
|
|
5286
7926
|
ref_key: "inputRef",
|
|
5287
7927
|
ref: inputRef,
|
|
5288
7928
|
id: inputId.value,
|
|
5289
|
-
type: isPasswordType.value ? showPassword.value ? "text" : "password" :
|
|
5290
|
-
disabled:
|
|
5291
|
-
required:
|
|
7929
|
+
type: isPasswordType.value ? showPassword.value ? "text" : "password" : _ctx.type,
|
|
7930
|
+
disabled: _ctx.disabled,
|
|
7931
|
+
required: _ctx.required,
|
|
5292
7932
|
value: internalValue.value,
|
|
5293
7933
|
"aria-invalid": __props.valid === false ? "true" : void 0,
|
|
5294
|
-
class: inputClasses.value
|
|
7934
|
+
class: inputClasses.value,
|
|
7935
|
+
style: inputStyle.value
|
|
5295
7936
|
}, inputAttrs.value, {
|
|
7937
|
+
maxlength: _ctx.maxlength,
|
|
5296
7938
|
onInput: handleInputChange,
|
|
5297
7939
|
onChange: handleInputChange,
|
|
5298
7940
|
onBlur: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("blur", $event)),
|
|
@@ -5313,11 +7955,11 @@ const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
|
|
|
5313
7955
|
key: 1,
|
|
5314
7956
|
name: "bigSuccess"
|
|
5315
7957
|
})) : vue.createCommentVNode("", true),
|
|
5316
|
-
__props.clearButton && !!internalValue.value && !
|
|
7958
|
+
__props.clearButton && !!internalValue.value && !_ctx.disabled ? (vue.openBlock(), vue.createBlock(_sfc_main$v, vue.mergeProps({
|
|
5317
7959
|
key: 2,
|
|
5318
7960
|
icon: "cross"
|
|
5319
7961
|
}, { "aria-label": clearButtonLabel.value }, { onClick: onClear }), null, 16)) : vue.createCommentVNode("", true),
|
|
5320
|
-
showPasswordToggle.value ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
7962
|
+
showPasswordToggle.value ? (vue.openBlock(), vue.createBlock(_sfc_main$n, {
|
|
5321
7963
|
key: 3,
|
|
5322
7964
|
icon: showPassword.value ? "viewOff" : "viewOn",
|
|
5323
7965
|
text: "",
|
|
@@ -5332,12 +7974,12 @@ const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
|
|
|
5332
7974
|
};
|
|
5333
7975
|
}
|
|
5334
7976
|
});
|
|
5335
|
-
const _hoisted_1$
|
|
7977
|
+
const _hoisted_1$b = ["id"];
|
|
5336
7978
|
const _hoisted_2$9 = { class: "flex items-center justify-start gap-1 w-[100px]" };
|
|
5337
7979
|
const _hoisted_3$6 = { class: "flex items-center justify-center w-auto gap-2 order-0 sm:order-0" };
|
|
5338
7980
|
const _hoisted_4$5 = { class: "whitespace-nowrap" };
|
|
5339
7981
|
const _hoisted_5$5 = { class: "flex items-center justify-end gap-1 order-2 sm:order-0 w-[100px]" };
|
|
5340
|
-
const _sfc_main$
|
|
7982
|
+
const _sfc_main$g = /* @__PURE__ */ vue.defineComponent({
|
|
5341
7983
|
__name: "FdsPagination",
|
|
5342
7984
|
props: {
|
|
5343
7985
|
id: { default: void 0 },
|
|
@@ -5421,7 +8063,7 @@ const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
|
|
|
5421
8063
|
id: inputId.value
|
|
5422
8064
|
}, [
|
|
5423
8065
|
vue.createElementVNode("div", _hoisted_2$9, [
|
|
5424
|
-
__props.loading && loadingIndicator.value === "start" ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
8066
|
+
__props.loading && loadingIndicator.value === "start" ? (vue.openBlock(), vue.createBlock(_sfc_main$o, {
|
|
5425
8067
|
key: 0,
|
|
5426
8068
|
size: "32px",
|
|
5427
8069
|
color: "blue"
|
|
@@ -5432,7 +8074,7 @@ const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
|
|
|
5432
8074
|
class: [{ "hidden!": __props.current === 1 }, "w-8 h-8 sm:w-12 sm:h-12"],
|
|
5433
8075
|
onClick: _cache[0] || (_cache[0] = ($event) => handlePagination("start"))
|
|
5434
8076
|
}), null, 16, ["disabled", "class"])),
|
|
5435
|
-
__props.loading && loadingIndicator.value === "prev" ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
8077
|
+
__props.loading && loadingIndicator.value === "prev" ? (vue.openBlock(), vue.createBlock(_sfc_main$o, {
|
|
5436
8078
|
key: 2,
|
|
5437
8079
|
size: "24px",
|
|
5438
8080
|
color: "blue"
|
|
@@ -5445,14 +8087,14 @@ const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
|
|
|
5445
8087
|
}), null, 16, ["disabled", "class"]))
|
|
5446
8088
|
]),
|
|
5447
8089
|
vue.createElementVNode("div", _hoisted_3$6, [
|
|
5448
|
-
__props.loading && loadingIndicator.value === "input" ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
8090
|
+
__props.loading && loadingIndicator.value === "input" ? (vue.openBlock(), vue.createBlock(_sfc_main$o, {
|
|
5449
8091
|
key: 0,
|
|
5450
8092
|
size: "24px",
|
|
5451
8093
|
color: "blue",
|
|
5452
8094
|
label: "Laddar",
|
|
5453
8095
|
"label-position": "right"
|
|
5454
8096
|
})) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
|
|
5455
|
-
vue.createVNode(_sfc_main$
|
|
8097
|
+
vue.createVNode(_sfc_main$h, {
|
|
5456
8098
|
value: inputValue.value,
|
|
5457
8099
|
type: "text",
|
|
5458
8100
|
size: __props.max.toString().length,
|
|
@@ -5464,7 +8106,7 @@ const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
|
|
|
5464
8106
|
], 64))
|
|
5465
8107
|
]),
|
|
5466
8108
|
vue.createElementVNode("div", _hoisted_5$5, [
|
|
5467
|
-
__props.loading && loadingIndicator.value === "next" ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
8109
|
+
__props.loading && loadingIndicator.value === "next" ? (vue.openBlock(), vue.createBlock(_sfc_main$o, {
|
|
5468
8110
|
key: 0,
|
|
5469
8111
|
size: "24px",
|
|
5470
8112
|
color: "blue"
|
|
@@ -5477,7 +8119,7 @@ const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
|
|
|
5477
8119
|
class: [{ "hidden!": __props.current === __props.max }, "w-8 h-8 sm:w-12 sm:h-12"],
|
|
5478
8120
|
onClick: _cache[2] || (_cache[2] = ($event) => handlePagination("next"))
|
|
5479
8121
|
}), null, 16, ["disabled", "class"])),
|
|
5480
|
-
__props.loading && loadingIndicator.value === "end" ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
8122
|
+
__props.loading && loadingIndicator.value === "end" ? (vue.openBlock(), vue.createBlock(_sfc_main$o, {
|
|
5481
8123
|
key: 2,
|
|
5482
8124
|
size: "24px",
|
|
5483
8125
|
color: "blue"
|
|
@@ -5491,7 +8133,7 @@ const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
|
|
|
5491
8133
|
onClick: _cache[3] || (_cache[3] = ($event) => handlePagination("end"))
|
|
5492
8134
|
}), null, 16, ["disabled", "class"]))
|
|
5493
8135
|
])
|
|
5494
|
-
], 8, _hoisted_1$
|
|
8136
|
+
], 8, _hoisted_1$b);
|
|
5495
8137
|
};
|
|
5496
8138
|
}
|
|
5497
8139
|
});
|
|
@@ -5534,7 +8176,7 @@ function useIsPid(value) {
|
|
|
5534
8176
|
isPid
|
|
5535
8177
|
};
|
|
5536
8178
|
}
|
|
5537
|
-
const _hoisted_1$
|
|
8179
|
+
const _hoisted_1$a = { class: "relative block" };
|
|
5538
8180
|
const _hoisted_2$8 = {
|
|
5539
8181
|
key: 0,
|
|
5540
8182
|
class: "relative"
|
|
@@ -5562,7 +8204,7 @@ const _hoisted_12 = {
|
|
|
5562
8204
|
class: "block m-0 list-none p-0"
|
|
5563
8205
|
};
|
|
5564
8206
|
const _hoisted_13 = { class: "p-4" };
|
|
5565
|
-
const _sfc_main$
|
|
8207
|
+
const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
|
|
5566
8208
|
__name: "FdsSearchSelect",
|
|
5567
8209
|
props: {
|
|
5568
8210
|
items: { default: () => [] },
|
|
@@ -5939,10 +8581,10 @@ const _sfc_main$g = /* @__PURE__ */ vue.defineComponent({
|
|
|
5939
8581
|
ref: componentRef,
|
|
5940
8582
|
class: "fds-search-select block mb-6"
|
|
5941
8583
|
}, [
|
|
5942
|
-
vue.createElementVNode("div", _hoisted_1$
|
|
8584
|
+
vue.createElementVNode("div", _hoisted_1$a, [
|
|
5943
8585
|
!singleItemName.value.length ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$8, [
|
|
5944
8586
|
vue.createElementVNode("div", _hoisted_3$5, [
|
|
5945
|
-
vue.createVNode(_sfc_main$
|
|
8587
|
+
vue.createVNode(_sfc_main$h, {
|
|
5946
8588
|
label: __props.label,
|
|
5947
8589
|
meta: __props.meta ?? void 0,
|
|
5948
8590
|
labelLeft: __props.labelLeft,
|
|
@@ -5980,7 +8622,7 @@ const _sfc_main$g = /* @__PURE__ */ vue.defineComponent({
|
|
|
5980
8622
|
"aria-controls": "select-dropdown"
|
|
5981
8623
|
}, [
|
|
5982
8624
|
__props.loading ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6$2, [
|
|
5983
|
-
vue.createVNode(_sfc_main$
|
|
8625
|
+
vue.createVNode(_sfc_main$o, {
|
|
5984
8626
|
color: "blue",
|
|
5985
8627
|
size: "48px"
|
|
5986
8628
|
})
|
|
@@ -6024,7 +8666,7 @@ const _sfc_main$g = /* @__PURE__ */ vue.defineComponent({
|
|
|
6024
8666
|
], 42, _hoisted_9$2);
|
|
6025
8667
|
}), 128))
|
|
6026
8668
|
], 32),
|
|
6027
|
-
__props.page !== void 0 && totalPages.value !== null && totalPages.value > 1 ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
8669
|
+
__props.page !== void 0 && totalPages.value !== null && totalPages.value > 1 ? (vue.openBlock(), vue.createBlock(_sfc_main$g, {
|
|
6028
8670
|
key: 2,
|
|
6029
8671
|
current: __props.page,
|
|
6030
8672
|
max: totalPages.value,
|
|
@@ -6040,51 +8682,6 @@ const _sfc_main$g = /* @__PURE__ */ vue.defineComponent({
|
|
|
6040
8682
|
};
|
|
6041
8683
|
}
|
|
6042
8684
|
});
|
|
6043
|
-
const _hoisted_1$a = ["aria-live"];
|
|
6044
|
-
const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
|
|
6045
|
-
__name: "FdsSticker",
|
|
6046
|
-
props: {
|
|
6047
|
-
variant: { default: "blue" },
|
|
6048
|
-
bullet: { type: Boolean, default: false },
|
|
6049
|
-
ariaLive: { default: void 0 }
|
|
6050
|
-
},
|
|
6051
|
-
setup(__props) {
|
|
6052
|
-
const props = __props;
|
|
6053
|
-
const stickerClasses = vue.computed(() => [
|
|
6054
|
-
"inline-block font-bold text-sm leading-[18px] tracking-normal py-0.5 px-3 rounded-xl border border-transparent whitespace-nowrap max-w-full",
|
|
6055
|
-
props.bullet ? "text-base! bg-transparent flex-wrap justify-start items-baseline text-base font-normal text-gray-700 border-transparent p-0 mr-3" : "",
|
|
6056
|
-
// Variant colors
|
|
6057
|
-
props.variant === "blue" && !props.bullet && "bg-blue-600 text-white",
|
|
6058
|
-
props.variant === "green" && !props.bullet && "bg-green-700 text-white",
|
|
6059
|
-
props.variant === "red" && !props.bullet && "bg-red-600 text-white",
|
|
6060
|
-
props.variant === "yellow" && !props.bullet && "bg-yellow-200 text-gray-700 border-yellow-300",
|
|
6061
|
-
props.variant === "gray" && !props.bullet && "bg-gray-200 text-gray-700 border-gray-300!",
|
|
6062
|
-
props.variant === "t_blue" && !props.bullet && "bg-blue_t-100 text-gray-700 border-blue_t-200!"
|
|
6063
|
-
]);
|
|
6064
|
-
const bulletDotClasses = vue.computed(() => [
|
|
6065
|
-
"inline-block w-3 h-3 rounded-full mr-1.5",
|
|
6066
|
-
// Bullet dot colors
|
|
6067
|
-
props.variant === "blue" && "bg-blue-600",
|
|
6068
|
-
props.variant === "green" && "bg-green-700",
|
|
6069
|
-
props.variant === "red" && "bg-red-600",
|
|
6070
|
-
props.variant === "yellow" && "bg-yellow-200 border border-yellow-300",
|
|
6071
|
-
props.variant === "gray" && "bg-gray-400",
|
|
6072
|
-
props.variant === "t_blue" && "bg-blue-200 border border-blue-300"
|
|
6073
|
-
]);
|
|
6074
|
-
return (_ctx, _cache) => {
|
|
6075
|
-
return vue.openBlock(), vue.createElementBlock("span", {
|
|
6076
|
-
class: vue.normalizeClass(stickerClasses.value),
|
|
6077
|
-
"aria-live": __props.ariaLive
|
|
6078
|
-
}, [
|
|
6079
|
-
__props.bullet ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
6080
|
-
key: 0,
|
|
6081
|
-
class: vue.normalizeClass(bulletDotClasses.value)
|
|
6082
|
-
}, null, 2)) : vue.createCommentVNode("", true),
|
|
6083
|
-
vue.renderSlot(_ctx.$slots, "default")
|
|
6084
|
-
], 10, _hoisted_1$a);
|
|
6085
|
-
};
|
|
6086
|
-
}
|
|
6087
|
-
});
|
|
6088
8685
|
const getTitleFromProperties = (node, titleTemplate) => {
|
|
6089
8686
|
if (!titleTemplate) {
|
|
6090
8687
|
return node.title;
|
|
@@ -6494,17 +9091,10 @@ const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
|
|
|
6494
9091
|
__name: "FdsCheckbox",
|
|
6495
9092
|
props: /* @__PURE__ */ vue.mergeModels({
|
|
6496
9093
|
label: { default: void 0 },
|
|
6497
|
-
checked: { type: Boolean, default: false },
|
|
6498
9094
|
indeterminate: { type: Boolean, default: false },
|
|
6499
|
-
disabled: { type: Boolean, default: false },
|
|
6500
|
-
value: { default: void 0 },
|
|
6501
|
-
name: { default: void 0 },
|
|
6502
|
-
id: { default: void 0 },
|
|
6503
|
-
required: { type: Boolean, default: false },
|
|
6504
9095
|
modelValue: { type: [Boolean, Array] },
|
|
6505
|
-
|
|
6506
|
-
|
|
6507
|
-
dataTestid: {}
|
|
9096
|
+
checked: { type: Boolean, default: false },
|
|
9097
|
+
value: { default: void 0 }
|
|
6508
9098
|
}, {
|
|
6509
9099
|
"modelValue": { type: [Boolean, Array], ...{
|
|
6510
9100
|
default: void 0,
|
|
@@ -6535,12 +9125,14 @@ const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
|
|
|
6535
9125
|
const internalChecked = vue.computed({
|
|
6536
9126
|
get: () => {
|
|
6537
9127
|
if (modelValue.value === void 0) {
|
|
6538
|
-
return props.checked;
|
|
9128
|
+
return props.checked ?? false;
|
|
6539
9129
|
}
|
|
6540
9130
|
if (Array.isArray(modelValue.value)) {
|
|
6541
|
-
|
|
9131
|
+
const val = props.value;
|
|
9132
|
+
if (val === void 0) return false;
|
|
9133
|
+
return modelValue.value.includes(val);
|
|
6542
9134
|
}
|
|
6543
|
-
return modelValue.value;
|
|
9135
|
+
return Boolean(modelValue.value);
|
|
6544
9136
|
},
|
|
6545
9137
|
set: (checked) => {
|
|
6546
9138
|
if (modelValue.value === void 0) {
|
|
@@ -6598,15 +9190,15 @@ const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
|
|
|
6598
9190
|
}, [
|
|
6599
9191
|
vue.createElementVNode("label", vue.mergeProps({
|
|
6600
9192
|
for: inputId.value,
|
|
6601
|
-
class: [innerWrapperClasses.value, { "cursor-not-allowed":
|
|
9193
|
+
class: [innerWrapperClasses.value, { "cursor-not-allowed": _ctx.disabled }]
|
|
6602
9194
|
}, _ctx.$attrs), [
|
|
6603
9195
|
vue.withDirectives(vue.createElementVNode("input", {
|
|
6604
9196
|
id: inputId.value,
|
|
6605
|
-
name:
|
|
9197
|
+
name: _ctx.name,
|
|
6606
9198
|
value: __props.value,
|
|
6607
9199
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => internalChecked.value = $event),
|
|
6608
|
-
disabled:
|
|
6609
|
-
required:
|
|
9200
|
+
disabled: _ctx.disabled,
|
|
9201
|
+
required: _ctx.required,
|
|
6610
9202
|
type: "checkbox",
|
|
6611
9203
|
class: vue.normalizeClass([checkboxClasses.value])
|
|
6612
9204
|
}, null, 10, _hoisted_2$7), [
|
|
@@ -6614,7 +9206,7 @@ const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
|
|
|
6614
9206
|
]),
|
|
6615
9207
|
vue.unref(hasLabelSlot) || __props.label ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
6616
9208
|
key: 0,
|
|
6617
|
-
class: vue.normalizeClass(["relative inline-block leading-6 pl-1 select-none", { "cursor-not-allowed":
|
|
9209
|
+
class: vue.normalizeClass(["relative inline-block leading-6 pl-1 select-none", { "cursor-not-allowed": _ctx.disabled }])
|
|
6618
9210
|
}, [
|
|
6619
9211
|
vue.unref(hasLabelSlot) ? vue.renderSlot(_ctx.$slots, "default", { key: 0 }) : __props.label ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
|
|
6620
9212
|
vue.createTextVNode(vue.toDisplayString(__props.label), 1)
|
|
@@ -6634,17 +9226,9 @@ const _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
|
|
|
6634
9226
|
__name: "FdsRadio",
|
|
6635
9227
|
props: /* @__PURE__ */ vue.mergeModels({
|
|
6636
9228
|
label: { default: void 0 },
|
|
6637
|
-
checked: { type: Boolean, default: false },
|
|
6638
|
-
disabled: { type: Boolean, default: false },
|
|
6639
|
-
value: { default: void 0 },
|
|
6640
|
-
name: { default: void 0 },
|
|
6641
|
-
id: { default: void 0 },
|
|
6642
|
-
required: { type: Boolean, default: false },
|
|
6643
9229
|
modelValue: {},
|
|
6644
|
-
|
|
6645
|
-
|
|
6646
|
-
onChange: {},
|
|
6647
|
-
onInput: {}
|
|
9230
|
+
checked: { type: Boolean, default: false },
|
|
9231
|
+
value: { default: void 0 }
|
|
6648
9232
|
}, {
|
|
6649
9233
|
"modelValue": { default: void 0, required: false },
|
|
6650
9234
|
"modelModifiers": {}
|
|
@@ -6688,15 +9272,15 @@ const _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
|
|
|
6688
9272
|
}, [
|
|
6689
9273
|
vue.createElementVNode("label", {
|
|
6690
9274
|
for: inputId.value,
|
|
6691
|
-
class: vue.normalizeClass([innerWrapperClasses.value, { "cursor-not-allowed":
|
|
9275
|
+
class: vue.normalizeClass([innerWrapperClasses.value, { "cursor-not-allowed": _ctx.disabled }])
|
|
6692
9276
|
}, [
|
|
6693
9277
|
vue.withDirectives(vue.createElementVNode("input", vue.mergeProps(inputAttrs.value, {
|
|
6694
9278
|
id: inputId.value,
|
|
6695
|
-
name:
|
|
9279
|
+
name: _ctx.name,
|
|
6696
9280
|
value: __props.value,
|
|
6697
9281
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => radioModel.value = $event),
|
|
6698
|
-
disabled:
|
|
6699
|
-
required:
|
|
9282
|
+
disabled: _ctx.disabled,
|
|
9283
|
+
required: _ctx.required,
|
|
6700
9284
|
type: "radio",
|
|
6701
9285
|
class: [inputClasses.value, "m-[2px]"]
|
|
6702
9286
|
}), null, 16, _hoisted_2$6), [
|
|
@@ -6704,7 +9288,7 @@ const _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
|
|
|
6704
9288
|
]),
|
|
6705
9289
|
vue.unref(hasLabelSlot) || __props.label ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
6706
9290
|
key: 0,
|
|
6707
|
-
class: vue.normalizeClass(["relative inline-block leading-6 pl-1 select-none", { "cursor-not-allowed":
|
|
9291
|
+
class: vue.normalizeClass(["relative inline-block leading-6 pl-1 select-none", { "cursor-not-allowed": _ctx.disabled }])
|
|
6708
9292
|
}, [
|
|
6709
9293
|
vue.unref(hasLabelSlot) ? vue.renderSlot(_ctx.$slots, "default", { key: 0 }) : __props.label ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
|
|
6710
9294
|
vue.createTextVNode(vue.toDisplayString(__props.label), 1)
|
|
@@ -7200,7 +9784,7 @@ const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
|
|
|
7200
9784
|
ref: searchContainerRef,
|
|
7201
9785
|
class: "pb-4"
|
|
7202
9786
|
}, [
|
|
7203
|
-
vue.createVNode(_sfc_main$
|
|
9787
|
+
vue.createVNode(_sfc_main$h, {
|
|
7204
9788
|
value: vue.unref(treeState)?.searchTerm?.value ?? "",
|
|
7205
9789
|
onInput: _cache[0] || (_cache[0] = ($event) => vue.unref(treeState)?.setSearchTerm($event.target.value)),
|
|
7206
9790
|
class: "w-full",
|
|
@@ -7337,7 +9921,7 @@ const _sfc_main$9 = /* @__PURE__ */ vue.defineComponent({
|
|
|
7337
9921
|
class: vue.normalizeClass([contentClasses.value, { open: isOpen.value }]),
|
|
7338
9922
|
style: vue.normalizeStyle({ maxWidth: `${containerWidth.value}px` })
|
|
7339
9923
|
}, vue.toDisplayString(__props.content), 7)),
|
|
7340
|
-
shouldShowButton.value ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
9924
|
+
shouldShowButton.value ? (vue.openBlock(), vue.createBlock(_sfc_main$n, {
|
|
7341
9925
|
key: 2,
|
|
7342
9926
|
icon: isOpen.value ? "arrowUp" : "arrowDown",
|
|
7343
9927
|
iconPos: "right",
|
|
@@ -7370,20 +9954,14 @@ const _hoisted_9 = {
|
|
|
7370
9954
|
const _sfc_main$8 = /* @__PURE__ */ vue.defineComponent({
|
|
7371
9955
|
__name: "FdsSelect",
|
|
7372
9956
|
props: /* @__PURE__ */ vue.mergeModels({
|
|
7373
|
-
value: { default: void 0 },
|
|
7374
9957
|
label: { default: void 0 },
|
|
7375
|
-
modelValue: {},
|
|
7376
9958
|
meta: { default: void 0 },
|
|
7377
|
-
disabled: { type: Boolean, default: false },
|
|
7378
9959
|
optional: { type: Boolean, default: false },
|
|
7379
9960
|
valid: { type: [Boolean, null], default: void 0 },
|
|
7380
9961
|
invalidMessage: { default: void 0 },
|
|
7381
|
-
name: { default: void 0 },
|
|
7382
|
-
id: { default: void 0 },
|
|
7383
|
-
placeholder: { default: void 0 },
|
|
7384
9962
|
options: { default: void 0 },
|
|
7385
|
-
|
|
7386
|
-
|
|
9963
|
+
modelValue: {},
|
|
9964
|
+
value: { default: void 0 }
|
|
7387
9965
|
}, {
|
|
7388
9966
|
"modelValue": { default: void 0, required: false },
|
|
7389
9967
|
"modelModifiers": {}
|
|
@@ -7432,8 +10010,8 @@ const _sfc_main$8 = /* @__PURE__ */ vue.defineComponent({
|
|
|
7432
10010
|
vue.createElementVNode("div", _hoisted_4$2, [
|
|
7433
10011
|
vue.withDirectives(vue.createElementVNode("select", vue.mergeProps({
|
|
7434
10012
|
id: selectId.value,
|
|
7435
|
-
name:
|
|
7436
|
-
disabled:
|
|
10013
|
+
name: _ctx.name || void 0,
|
|
10014
|
+
disabled: _ctx.disabled,
|
|
7437
10015
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => internalValue.value = $event),
|
|
7438
10016
|
"aria-invalid": __props.valid === false ? "true" : void 0,
|
|
7439
10017
|
class: selectClasses.value
|
|
@@ -7441,7 +10019,7 @@ const _sfc_main$8 = /* @__PURE__ */ vue.defineComponent({
|
|
|
7441
10019
|
onChange: handleChange,
|
|
7442
10020
|
onInput: _cache[1] || (_cache[1] = (e) => emit("input", e))
|
|
7443
10021
|
}), [
|
|
7444
|
-
|
|
10022
|
+
_ctx.placeholder && !hasDefaultSlot.value ? (vue.openBlock(), vue.createElementBlock("option", _hoisted_6, vue.toDisplayString(_ctx.placeholder), 1)) : vue.createCommentVNode("", true),
|
|
7445
10023
|
!hasDefaultSlot.value && __props.options ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 1 }, vue.renderList(__props.options, (option) => {
|
|
7446
10024
|
return vue.openBlock(), vue.createElementBlock("option", {
|
|
7447
10025
|
key: option.value,
|
|
@@ -7457,9 +10035,9 @@ const _sfc_main$8 = /* @__PURE__ */ vue.defineComponent({
|
|
|
7457
10035
|
name: "arrowDown",
|
|
7458
10036
|
size: 24,
|
|
7459
10037
|
class: vue.normalizeClass({
|
|
7460
|
-
"fill-gray-500":
|
|
7461
|
-
"fill-red-500": isInvalid.value && !
|
|
7462
|
-
"fill-blue-500": !
|
|
10038
|
+
"fill-gray-500": _ctx.disabled,
|
|
10039
|
+
"fill-red-500": isInvalid.value && !_ctx.disabled,
|
|
10040
|
+
"fill-blue-500": !_ctx.disabled && !isInvalid.value
|
|
7463
10041
|
})
|
|
7464
10042
|
}, null, 8, ["class"])
|
|
7465
10043
|
])
|
|
@@ -7486,21 +10064,14 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
|
|
|
7486
10064
|
},
|
|
7487
10065
|
__name: "FdsTextarea",
|
|
7488
10066
|
props: /* @__PURE__ */ vue.mergeModels({
|
|
7489
|
-
value: { default: void 0 },
|
|
7490
10067
|
label: { default: void 0 },
|
|
7491
10068
|
meta: { default: void 0 },
|
|
7492
|
-
disabled: { type: Boolean, default: false },
|
|
7493
10069
|
optional: { type: Boolean, default: false },
|
|
7494
10070
|
valid: { type: [Boolean, null], default: void 0 },
|
|
7495
10071
|
invalidMessage: {},
|
|
7496
|
-
rows: { default: 4 },
|
|
7497
|
-
name: {},
|
|
7498
|
-
id: { default: void 0 },
|
|
7499
10072
|
modelValue: {},
|
|
7500
10073
|
modelModifiers: { default: () => ({}) },
|
|
7501
|
-
|
|
7502
|
-
onChange: {},
|
|
7503
|
-
onInput: {}
|
|
10074
|
+
value: { default: void 0 }
|
|
7504
10075
|
}, {
|
|
7505
10076
|
"modelValue": { default: void 0, required: false },
|
|
7506
10077
|
"modelModifiers": {}
|
|
@@ -7908,7 +10479,7 @@ const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
|
|
|
7908
10479
|
};
|
|
7909
10480
|
return (_ctx, _cache) => {
|
|
7910
10481
|
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$1, [
|
|
7911
|
-
__props.loading ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
10482
|
+
__props.loading ? (vue.openBlock(), vue.createBlock(_sfc_main$o, {
|
|
7912
10483
|
key: 0,
|
|
7913
10484
|
size: "24px",
|
|
7914
10485
|
color: "blue",
|
|
@@ -7935,32 +10506,32 @@ const FdsSeparator = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_ren
|
|
|
7935
10506
|
const FdsVueCorePlugin = {
|
|
7936
10507
|
install(app) {
|
|
7937
10508
|
app.component("FdsTreeView", _sfc_main$a);
|
|
7938
|
-
app.component("FdsButtonPrimary", _sfc_main$
|
|
7939
|
-
app.component("FdsButtonSecondary", _sfc_main$
|
|
7940
|
-
app.component("FdsButtonMinor", _sfc_main$
|
|
10509
|
+
app.component("FdsButtonPrimary", _sfc_main$k);
|
|
10510
|
+
app.component("FdsButtonSecondary", _sfc_main$j);
|
|
10511
|
+
app.component("FdsButtonMinor", _sfc_main$n);
|
|
7941
10512
|
app.component("FdsButtonIcon", _sfc_main$v);
|
|
7942
|
-
app.component("FdsButtonCopy", _sfc_main$
|
|
7943
|
-
app.component("FdsButtonDownload", _sfc_main$
|
|
10513
|
+
app.component("FdsButtonCopy", _sfc_main$m);
|
|
10514
|
+
app.component("FdsButtonDownload", _sfc_main$l);
|
|
7944
10515
|
app.component("FdsIcon", _sfc_main$w);
|
|
7945
|
-
app.component("FdsSpinner", _sfc_main$
|
|
10516
|
+
app.component("FdsSpinner", _sfc_main$o);
|
|
7946
10517
|
app.component("FdsRadio", _sfc_main$d);
|
|
7947
10518
|
app.component("FdsCheckbox", _sfc_main$e);
|
|
7948
10519
|
app.component("FdsTextarea", _sfc_main$7);
|
|
7949
10520
|
app.component("FdsSelect", _sfc_main$8);
|
|
7950
10521
|
app.component("FdsTable", _sfc_main$6);
|
|
7951
10522
|
app.component("FdsTableHead", _sfc_main$5);
|
|
7952
|
-
app.component("FdsInput", _sfc_main$
|
|
10523
|
+
app.component("FdsInput", _sfc_main$h);
|
|
7953
10524
|
app.component("FdsBlockContent", _sfc_main$t);
|
|
7954
|
-
app.component("FdsBlockInfo", _sfc_main$
|
|
10525
|
+
app.component("FdsBlockInfo", _sfc_main$q);
|
|
7955
10526
|
app.component("FdsBlockAlert", _sfc_main$u);
|
|
7956
|
-
app.component("FdsBlockExpander", _sfc_main$
|
|
7957
|
-
app.component("FdsBlockLink", _sfc_main$
|
|
7958
|
-
app.component("FdsSticker", _sfc_main$
|
|
10527
|
+
app.component("FdsBlockExpander", _sfc_main$r);
|
|
10528
|
+
app.component("FdsBlockLink", _sfc_main$p);
|
|
10529
|
+
app.component("FdsSticker", _sfc_main$s);
|
|
7959
10530
|
app.component("FdsTabs", _sfc_main$4);
|
|
7960
10531
|
app.component("FdsTabsItem", _sfc_main$3);
|
|
7961
|
-
app.component("FdsModal", _sfc_main$
|
|
7962
|
-
app.component("FdsPagination", _sfc_main$
|
|
7963
|
-
app.component("FdsSearchSelect", _sfc_main$
|
|
10532
|
+
app.component("FdsModal", _sfc_main$i);
|
|
10533
|
+
app.component("FdsPagination", _sfc_main$g);
|
|
10534
|
+
app.component("FdsSearchSelect", _sfc_main$f);
|
|
7964
10535
|
app.component("FdsTruncatedText", _sfc_main$9);
|
|
7965
10536
|
app.component("FdsHeading", _sfc_main$2);
|
|
7966
10537
|
app.component("FdsSeparator", FdsSeparator);
|
|
@@ -7970,28 +10541,28 @@ const FdsVueCorePlugin = {
|
|
|
7970
10541
|
};
|
|
7971
10542
|
exports.FdsBlockAlert = _sfc_main$u;
|
|
7972
10543
|
exports.FdsBlockContent = _sfc_main$t;
|
|
7973
|
-
exports.FdsBlockExpander = _sfc_main$
|
|
7974
|
-
exports.FdsBlockInfo = _sfc_main$
|
|
7975
|
-
exports.FdsBlockLink = _sfc_main$
|
|
7976
|
-
exports.FdsButtonCopy = _sfc_main$
|
|
7977
|
-
exports.FdsButtonDownload = _sfc_main$
|
|
10544
|
+
exports.FdsBlockExpander = _sfc_main$r;
|
|
10545
|
+
exports.FdsBlockInfo = _sfc_main$q;
|
|
10546
|
+
exports.FdsBlockLink = _sfc_main$p;
|
|
10547
|
+
exports.FdsButtonCopy = _sfc_main$m;
|
|
10548
|
+
exports.FdsButtonDownload = _sfc_main$l;
|
|
7978
10549
|
exports.FdsButtonIcon = _sfc_main$v;
|
|
7979
|
-
exports.FdsButtonMinor = _sfc_main$
|
|
7980
|
-
exports.FdsButtonPrimary = _sfc_main$
|
|
7981
|
-
exports.FdsButtonSecondary = _sfc_main$
|
|
10550
|
+
exports.FdsButtonMinor = _sfc_main$n;
|
|
10551
|
+
exports.FdsButtonPrimary = _sfc_main$k;
|
|
10552
|
+
exports.FdsButtonSecondary = _sfc_main$j;
|
|
7982
10553
|
exports.FdsCheckbox = _sfc_main$e;
|
|
7983
10554
|
exports.FdsHeading = _sfc_main$2;
|
|
7984
10555
|
exports.FdsIcon = _sfc_main$w;
|
|
7985
|
-
exports.FdsInput = _sfc_main$
|
|
10556
|
+
exports.FdsInput = _sfc_main$h;
|
|
7986
10557
|
exports.FdsListHeading = _sfc_main$1;
|
|
7987
|
-
exports.FdsModal = _sfc_main$
|
|
7988
|
-
exports.FdsPagination = _sfc_main$
|
|
10558
|
+
exports.FdsModal = _sfc_main$i;
|
|
10559
|
+
exports.FdsPagination = _sfc_main$g;
|
|
7989
10560
|
exports.FdsRadio = _sfc_main$d;
|
|
7990
|
-
exports.FdsSearchSelect = _sfc_main$
|
|
10561
|
+
exports.FdsSearchSelect = _sfc_main$f;
|
|
7991
10562
|
exports.FdsSelect = _sfc_main$8;
|
|
7992
10563
|
exports.FdsSeparator = FdsSeparator;
|
|
7993
|
-
exports.FdsSpinner = _sfc_main$
|
|
7994
|
-
exports.FdsSticker = _sfc_main$
|
|
10564
|
+
exports.FdsSpinner = _sfc_main$o;
|
|
10565
|
+
exports.FdsSticker = _sfc_main$s;
|
|
7995
10566
|
exports.FdsTable = _sfc_main$6;
|
|
7996
10567
|
exports.FdsTableHead = _sfc_main$5;
|
|
7997
10568
|
exports.FdsTabs = _sfc_main$4;
|
|
@@ -8003,6 +10574,7 @@ exports.FdsTruncatedText = _sfc_main$9;
|
|
|
8003
10574
|
exports.default = FdsVueCorePlugin;
|
|
8004
10575
|
exports.isPidString = isPidString;
|
|
8005
10576
|
exports.useBoldQuery = useBoldQuery;
|
|
10577
|
+
exports.useDownload = useDownload;
|
|
8006
10578
|
exports.useIsPid = useIsPid;
|
|
8007
10579
|
exports.useTreeState = useTreeState;
|
|
8008
10580
|
//# sourceMappingURL=fds-vue-core.cjs.js.map
|