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