ant-design-x-vue 1.0.8 → 1.0.9
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/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var Oy = Object.defineProperty;
|
|
2
2
|
var Py = (e, t, n) => t in e ? Oy(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
3
|
var no = (e, t, n) => Py(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
-
import { computed as $, inject as ye, provide as Ce, shallowRef as X, defineComponent as W, watch as Q, unref as se, triggerRef as jt, Fragment as Te, isVNode as zt, Comment as Iy, Text as Im, reactive as qe, getCurrentInstance as Tt, onMounted as we, onUpdated as Bo, onUnmounted as Yn, ref as U, watchEffect as be, onBeforeUnmount as Be, createVNode as f, h as wo, Transition as Ft, withDirectives as Yt, resolveDirective as Ty, cloneVNode as Ls, nextTick as _e, toRef as Ee, withModifiers as Nu, vShow as Sn, onBeforeMount as Ey, Teleport as Ji, createTextVNode as vr, isRef as Ay, toRefs as Bs, toRaw as xo, render as hr, onBeforeUpdate as Tm, TransitionGroup as js, createApp as My, useSlots as Et, mergeProps as We, onWatcherCleanup as jo, toValue as Ne, mergeDefaults as
|
|
4
|
+
import { computed as $, inject as ye, provide as Ce, shallowRef as X, defineComponent as W, watch as Q, unref as se, triggerRef as jt, Fragment as Te, isVNode as zt, Comment as Iy, Text as Im, reactive as qe, getCurrentInstance as Tt, onMounted as we, onUpdated as Bo, onUnmounted as Yn, ref as U, watchEffect as be, onBeforeUnmount as Be, createVNode as f, h as wo, Transition as Ft, withDirectives as Yt, resolveDirective as Ty, cloneVNode as Ls, nextTick as _e, toRef as Ee, withModifiers as Nu, vShow as Sn, onBeforeMount as Ey, Teleport as Ji, createTextVNode as vr, isRef as Ay, toRefs as Bs, toRaw as xo, render as hr, onBeforeUpdate as Tm, TransitionGroup as js, createApp as My, useSlots as Et, mergeProps as We, onWatcherCleanup as jo, toValue as Ne, mergeDefaults as tt, useAttrs as Em, useTemplateRef as Oo, openBlock as Am, createElementBlock as Mm, createElementVNode as vo, useId as Ry } from "vue";
|
|
5
5
|
const yr = function() {
|
|
6
6
|
for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
|
|
7
7
|
t[n] = arguments[n];
|
|
@@ -3748,10 +3748,10 @@ var Un = function(e) {
|
|
|
3748
3748
|
return ad(e) !== !1 && typeof (t = e.constructor) == "function" && ad(n = t.prototype) !== !1 && n.hasOwnProperty("isPrototypeOf") !== !1;
|
|
3749
3749
|
}, jg = function(e) {
|
|
3750
3750
|
return e;
|
|
3751
|
-
},
|
|
3751
|
+
}, et = jg;
|
|
3752
3752
|
if (process.env.NODE_ENV !== "production") {
|
|
3753
3753
|
var CC = typeof console < "u";
|
|
3754
|
-
|
|
3754
|
+
et = CC ? function(e) {
|
|
3755
3755
|
console.warn("[VueTypes warn]: " + e);
|
|
3756
3756
|
} : jg;
|
|
3757
3757
|
}
|
|
@@ -3793,16 +3793,16 @@ function Jn(e, t, n) {
|
|
|
3793
3793
|
}
|
|
3794
3794
|
if (!r) {
|
|
3795
3795
|
var l = a + 'value "' + t + '" should be of type "' + i + '"';
|
|
3796
|
-
return n === !1 ? (
|
|
3796
|
+
return n === !1 ? (et(l), !1) : l;
|
|
3797
3797
|
}
|
|
3798
3798
|
if (Tr(o, "validator") && Mo(o.validator)) {
|
|
3799
|
-
var s =
|
|
3800
|
-
if (
|
|
3799
|
+
var s = et, c = [];
|
|
3800
|
+
if (et = function(d) {
|
|
3801
3801
|
c.push(d);
|
|
3802
|
-
}, r = o.validator(t),
|
|
3802
|
+
}, r = o.validator(t), et = s, !r) {
|
|
3803
3803
|
var u = (c.length > 1 ? "* " : "") + c.join(`
|
|
3804
3804
|
* `);
|
|
3805
|
-
return c.length = 0, n === !1 ? (
|
|
3805
|
+
return c.length = 0, n === !1 ? (et(u), r) : u;
|
|
3806
3806
|
}
|
|
3807
3807
|
}
|
|
3808
3808
|
return r;
|
|
@@ -3815,14 +3815,14 @@ function mt(e, t) {
|
|
|
3815
3815
|
return [].concat(r);
|
|
3816
3816
|
} : Un(r) ? function() {
|
|
3817
3817
|
return Object.assign({}, r);
|
|
3818
|
-
} : r, this) : (
|
|
3818
|
+
} : r, this) : (et(this._vueTypes_name + ' - invalid default value: "' + r + '"'), this) : this;
|
|
3819
3819
|
} } }), o = n.validator;
|
|
3820
3820
|
return Mo(o) && (n.validator = Qs(o, n)), n;
|
|
3821
3821
|
}
|
|
3822
3822
|
function Bt(e, t) {
|
|
3823
3823
|
var n = mt(e, t);
|
|
3824
3824
|
return Object.defineProperty(n, "validate", { value: function(o) {
|
|
3825
|
-
return Mo(this.validator) &&
|
|
3825
|
+
return Mo(this.validator) && et(this._vueTypes_name + ` - calling .validate() will overwrite the current custom validator function. Validator info:
|
|
3826
3826
|
` + JSON.stringify(this)), this.validator = Qs(o, this), this;
|
|
3827
3827
|
} });
|
|
3828
3828
|
}
|
|
@@ -3870,7 +3870,7 @@ function MC(e, t) {
|
|
|
3870
3870
|
if (t === void 0 && (t = "custom validation failed"), typeof e != "function") throw new TypeError("[VueTypes error]: You must provide a function as argument");
|
|
3871
3871
|
return mt(e.name || "<<anonymous function>>", { validator: function(n) {
|
|
3872
3872
|
var o = e(n);
|
|
3873
|
-
return o ||
|
|
3873
|
+
return o || et(this._vueTypes_name + " - " + t), o;
|
|
3874
3874
|
} });
|
|
3875
3875
|
}
|
|
3876
3876
|
function RC(e) {
|
|
@@ -3884,7 +3884,7 @@ function RC(e) {
|
|
|
3884
3884
|
}, []);
|
|
3885
3885
|
return mt("oneOf", { type: n.length > 0 ? n : void 0, validator: function(o) {
|
|
3886
3886
|
var r = e.indexOf(o) !== -1;
|
|
3887
|
-
return r ||
|
|
3887
|
+
return r || et(t), r;
|
|
3888
3888
|
} });
|
|
3889
3889
|
}
|
|
3890
3890
|
function DC(e) {
|
|
@@ -3910,7 +3910,7 @@ function DC(e) {
|
|
|
3910
3910
|
var c = Jn(ji(s) && s._vueTypes_name === "oneOf" ? s.type || null : s, i, !0);
|
|
3911
3911
|
return typeof c == "string" && a.push(c), c === !0;
|
|
3912
3912
|
});
|
|
3913
|
-
return l ||
|
|
3913
|
+
return l || et("oneOfType - provided value does not match any of the " + a.length + ` passed-in validators:
|
|
3914
3914
|
` + ca(a.join(`
|
|
3915
3915
|
`))), l;
|
|
3916
3916
|
} } : { type: n });
|
|
@@ -3920,7 +3920,7 @@ function NC(e) {
|
|
|
3920
3920
|
var n, o = t.every(function(r) {
|
|
3921
3921
|
return (n = Jn(e, r, !0)) === !0;
|
|
3922
3922
|
});
|
|
3923
|
-
return o ||
|
|
3923
|
+
return o || et(`arrayOf - value validation error:
|
|
3924
3924
|
` + ca(n)), o;
|
|
3925
3925
|
} });
|
|
3926
3926
|
}
|
|
@@ -3932,7 +3932,7 @@ function LC(e) {
|
|
|
3932
3932
|
var n, o = Object.keys(t).every(function(r) {
|
|
3933
3933
|
return (n = Jn(e, t[r], !0)) === !0;
|
|
3934
3934
|
});
|
|
3935
|
-
return o ||
|
|
3935
|
+
return o || et(`objectOf - value validation error:
|
|
3936
3936
|
` + ca(n)), o;
|
|
3937
3937
|
} });
|
|
3938
3938
|
}
|
|
@@ -3950,12 +3950,12 @@ function BC(e) {
|
|
|
3950
3950
|
var l = n.filter(function(s) {
|
|
3951
3951
|
return a.indexOf(s) === -1;
|
|
3952
3952
|
});
|
|
3953
|
-
return
|
|
3953
|
+
return et(l.length === 1 ? 'shape - required property "' + l[0] + '" is not defined.' : 'shape - required properties "' + l.join('", "') + '" are not defined.'), !1;
|
|
3954
3954
|
}
|
|
3955
3955
|
return a.every(function(s) {
|
|
3956
|
-
if (t.indexOf(s) === -1) return i._vueTypes_isLoose === !0 || (
|
|
3956
|
+
if (t.indexOf(s) === -1) return i._vueTypes_isLoose === !0 || (et('shape - shape definition does not include a "' + s + '" property. Allowed keys: "' + t.join('", "') + '".'), !1);
|
|
3957
3957
|
var c = Jn(e[s], r[s], !0);
|
|
3958
|
-
return typeof c == "string" &&
|
|
3958
|
+
return typeof c == "string" && et('shape - "' + s + `" property validation error:
|
|
3959
3959
|
` + ca(c)), c === !0;
|
|
3960
3960
|
});
|
|
3961
3961
|
} });
|
|
@@ -19608,7 +19608,7 @@ Gi.newInstance = function(t, n) {
|
|
|
19608
19608
|
let {
|
|
19609
19609
|
attrs: S
|
|
19610
19610
|
} = b;
|
|
19611
|
-
const x = X(), O = $(() =>
|
|
19611
|
+
const x = X(), O = $(() => Je.getPrefixCls(r, l)), [, w] = d(O);
|
|
19612
19612
|
return we(() => {
|
|
19613
19613
|
n({
|
|
19614
19614
|
notice(I) {
|
|
@@ -19625,7 +19625,7 @@ Gi.newInstance = function(t, n) {
|
|
|
19625
19625
|
component: x
|
|
19626
19626
|
});
|
|
19627
19627
|
}), () => {
|
|
19628
|
-
const I =
|
|
19628
|
+
const I = Je, C = I.getRootPrefixCls(s, O.value), E = u ? c : `${O.value}-${c}`;
|
|
19629
19629
|
return f($o, B(B({}, I), {}, {
|
|
19630
19630
|
prefixCls: C
|
|
19631
19631
|
}), {
|
|
@@ -21002,24 +21002,24 @@ var V3 = function(e, t) {
|
|
|
21002
21002
|
};
|
|
21003
21003
|
const W3 = "ant";
|
|
21004
21004
|
function So() {
|
|
21005
|
-
return
|
|
21005
|
+
return Je.prefixCls || W3;
|
|
21006
21006
|
}
|
|
21007
21007
|
function Gh() {
|
|
21008
|
-
return
|
|
21008
|
+
return Je.iconPrefixCls || Fs;
|
|
21009
21009
|
}
|
|
21010
|
-
const Kc = qe({}),
|
|
21010
|
+
const Kc = qe({}), Je = qe({});
|
|
21011
21011
|
be(() => {
|
|
21012
|
-
v(
|
|
21012
|
+
v(Je, Kc), Je.prefixCls = So(), Je.iconPrefixCls = Gh(), Je.getPrefixCls = (e, t) => t || (e ? `${Je.prefixCls}-${e}` : Je.prefixCls), Je.getRootPrefixCls = () => Je.prefixCls ? Je.prefixCls : So();
|
|
21013
21013
|
});
|
|
21014
21014
|
let pl;
|
|
21015
21015
|
const k3 = (e) => {
|
|
21016
21016
|
pl && pl(), pl = be(() => {
|
|
21017
|
-
v(Kc, qe(e)), v(
|
|
21017
|
+
v(Kc, qe(e)), v(Je, qe(e));
|
|
21018
21018
|
}), e.theme && F3(So(), e.theme);
|
|
21019
21019
|
}, X3 = () => ({
|
|
21020
21020
|
getPrefixCls: (e, t) => t || (e ? `${So()}-${e}` : So()),
|
|
21021
21021
|
getIconPrefixCls: Gh,
|
|
21022
|
-
getRootPrefixCls: () =>
|
|
21022
|
+
getRootPrefixCls: () => Je.prefixCls ? Je.prefixCls : So()
|
|
21023
21023
|
}), $o = W({
|
|
21024
21024
|
compatConfig: {
|
|
21025
21025
|
MODE: 3
|
|
@@ -30031,7 +30031,7 @@ const { genStyleHooks: Pn, genComponentStyleHook: YR, genSubStyleComponent: ZR }
|
|
|
30031
30031
|
}), k0 = /* @__PURE__ */ W({
|
|
30032
30032
|
name: "AXBubble",
|
|
30033
30033
|
__name: "Bubble",
|
|
30034
|
-
props:
|
|
30034
|
+
props: tt({
|
|
30035
30035
|
prefixCls: null,
|
|
30036
30036
|
rootClassName: null,
|
|
30037
30037
|
styles: null,
|
|
@@ -30268,7 +30268,7 @@ const uM = 1, dM = /* @__PURE__ */ W({
|
|
|
30268
30268
|
name: "AXBubbleList",
|
|
30269
30269
|
inheritAttrs: !1,
|
|
30270
30270
|
__name: "BubbleList",
|
|
30271
|
-
props:
|
|
30271
|
+
props: tt({
|
|
30272
30272
|
prefixCls: null,
|
|
30273
30273
|
rootClassName: null,
|
|
30274
30274
|
items: null,
|
|
@@ -30640,7 +30640,7 @@ const Il = "__ungrouped", vM = (e, t = []) => {
|
|
|
30640
30640
|
), JR = /* @__PURE__ */ W({
|
|
30641
30641
|
name: "AXConversations",
|
|
30642
30642
|
__name: "Conversations",
|
|
30643
|
-
props:
|
|
30643
|
+
props: tt({
|
|
30644
30644
|
items: null,
|
|
30645
30645
|
activeKey: null,
|
|
30646
30646
|
defaultActiveKey: null,
|
|
@@ -30791,7 +30791,7 @@ function xM(e) {
|
|
|
30791
30791
|
const e7 = /* @__PURE__ */ W({
|
|
30792
30792
|
name: "AXWelcome",
|
|
30793
30793
|
__name: "Welcome",
|
|
30794
|
-
props:
|
|
30794
|
+
props: tt({
|
|
30795
30795
|
prefixCls: null,
|
|
30796
30796
|
rootClassName: null,
|
|
30797
30797
|
className: null,
|
|
@@ -30998,7 +30998,7 @@ const e7 = /* @__PURE__ */ W({
|
|
|
30998
30998
|
), EM = /* @__PURE__ */ W({
|
|
30999
30999
|
name: "AXPrompts",
|
|
31000
31000
|
__name: "Prompts",
|
|
31001
|
-
props:
|
|
31001
|
+
props: tt({
|
|
31002
31002
|
items: null,
|
|
31003
31003
|
title: null,
|
|
31004
31004
|
onItemClick: {
|
|
@@ -31183,7 +31183,7 @@ function DM(e, t, n, o, r) {
|
|
|
31183
31183
|
const t7 = /* @__PURE__ */ W({
|
|
31184
31184
|
name: "AXSuggestion",
|
|
31185
31185
|
__name: "Suggestion",
|
|
31186
|
-
props:
|
|
31186
|
+
props: tt({
|
|
31187
31187
|
prefixCls: null,
|
|
31188
31188
|
className: null,
|
|
31189
31189
|
rootClassName: null,
|
|
@@ -31305,7 +31305,7 @@ const t7 = /* @__PURE__ */ W({
|
|
|
31305
31305
|
}), Na = /* @__PURE__ */ W({
|
|
31306
31306
|
name: "AXSenderActionButton",
|
|
31307
31307
|
__name: "index",
|
|
31308
|
-
props:
|
|
31308
|
+
props: tt({
|
|
31309
31309
|
prefixCls: null,
|
|
31310
31310
|
type: null,
|
|
31311
31311
|
htmlType: null,
|
|
@@ -31354,7 +31354,7 @@ const t7 = /* @__PURE__ */ W({
|
|
|
31354
31354
|
}), FM = /* @__PURE__ */ W({
|
|
31355
31355
|
name: "AXSenderClearButton",
|
|
31356
31356
|
__name: "ClearButton",
|
|
31357
|
-
props:
|
|
31357
|
+
props: tt({
|
|
31358
31358
|
prefixCls: null,
|
|
31359
31359
|
type: null,
|
|
31360
31360
|
htmlType: null,
|
|
@@ -31434,7 +31434,7 @@ const t7 = /* @__PURE__ */ W({
|
|
|
31434
31434
|
}), hm = /* @__PURE__ */ W({
|
|
31435
31435
|
name: "AXSenderLoadingButton",
|
|
31436
31436
|
__name: "LoadingButton",
|
|
31437
|
-
props:
|
|
31437
|
+
props: tt({
|
|
31438
31438
|
prefixCls: null,
|
|
31439
31439
|
type: null,
|
|
31440
31440
|
htmlType: null,
|
|
@@ -31481,7 +31481,7 @@ const t7 = /* @__PURE__ */ W({
|
|
|
31481
31481
|
}), ym = /* @__PURE__ */ W({
|
|
31482
31482
|
name: "AXSenderLoadingButton",
|
|
31483
31483
|
__name: "SendButton",
|
|
31484
|
-
props:
|
|
31484
|
+
props: tt({
|
|
31485
31485
|
prefixCls: null,
|
|
31486
31486
|
type: null,
|
|
31487
31487
|
htmlType: null,
|
|
@@ -31562,7 +31562,7 @@ const t7 = /* @__PURE__ */ W({
|
|
|
31562
31562
|
}), Cm = /* @__PURE__ */ W({
|
|
31563
31563
|
name: "AXSenderSpeechButton",
|
|
31564
31564
|
__name: "index",
|
|
31565
|
-
props:
|
|
31565
|
+
props: tt({
|
|
31566
31566
|
prefixCls: null,
|
|
31567
31567
|
type: null,
|
|
31568
31568
|
htmlType: null,
|
|
@@ -31896,68 +31896,55 @@ function UM(e, t) {
|
|
|
31896
31896
|
const GM = /* @__PURE__ */ W({
|
|
31897
31897
|
name: "AXSender",
|
|
31898
31898
|
__name: "Sender",
|
|
31899
|
-
props:
|
|
31900
|
-
onKeyPress: {
|
|
31901
|
-
|
|
31902
|
-
},
|
|
31903
|
-
|
|
31904
|
-
|
|
31905
|
-
|
|
31906
|
-
defaultValue: null,
|
|
31907
|
-
value: null,
|
|
31899
|
+
props: {
|
|
31900
|
+
onKeyPress: {},
|
|
31901
|
+
onFocus: {},
|
|
31902
|
+
onBlur: {},
|
|
31903
|
+
prefixCls: {},
|
|
31904
|
+
defaultValue: {},
|
|
31905
|
+
value: {},
|
|
31908
31906
|
loading: {
|
|
31909
31907
|
type: Boolean
|
|
31910
31908
|
},
|
|
31911
|
-
placeholder:
|
|
31909
|
+
placeholder: {},
|
|
31912
31910
|
readOnly: {
|
|
31913
31911
|
type: Boolean
|
|
31914
31912
|
},
|
|
31915
31913
|
submitType: {
|
|
31916
|
-
type: [String, Boolean]
|
|
31914
|
+
type: [String, Boolean],
|
|
31915
|
+
default: "enter"
|
|
31917
31916
|
},
|
|
31918
31917
|
disabled: {
|
|
31919
|
-
type: Boolean
|
|
31920
|
-
|
|
31921
|
-
onSubmit: {
|
|
31922
|
-
type: Function
|
|
31923
|
-
},
|
|
31924
|
-
onChange: {
|
|
31925
|
-
type: Function
|
|
31926
|
-
},
|
|
31927
|
-
onCancel: null,
|
|
31928
|
-
onKeyDown: {
|
|
31929
|
-
type: Function
|
|
31930
|
-
},
|
|
31931
|
-
onPaste: {
|
|
31932
|
-
type: Function
|
|
31933
|
-
},
|
|
31934
|
-
onPasteFile: {
|
|
31935
|
-
type: Function
|
|
31936
|
-
},
|
|
31937
|
-
components: null,
|
|
31938
|
-
styles: null,
|
|
31939
|
-
rootClassName: null,
|
|
31940
|
-
classNames: null,
|
|
31941
|
-
style: null,
|
|
31942
|
-
className: null,
|
|
31943
|
-
actions: {
|
|
31944
|
-
type: Function
|
|
31918
|
+
type: Boolean,
|
|
31919
|
+
default: void 0
|
|
31945
31920
|
},
|
|
31946
|
-
|
|
31947
|
-
|
|
31948
|
-
|
|
31921
|
+
onSubmit: {},
|
|
31922
|
+
onChange: {},
|
|
31923
|
+
onCancel: {},
|
|
31924
|
+
onKeyDown: {},
|
|
31925
|
+
onPaste: {},
|
|
31926
|
+
onPasteFile: {},
|
|
31927
|
+
components: {},
|
|
31928
|
+
styles: {
|
|
31929
|
+
default: () => ({})
|
|
31930
|
+
},
|
|
31931
|
+
rootClassName: {},
|
|
31932
|
+
classNames: {
|
|
31933
|
+
default: () => ({})
|
|
31934
|
+
},
|
|
31935
|
+
style: {},
|
|
31936
|
+
className: {},
|
|
31937
|
+
actions: {},
|
|
31938
|
+
allowSpeech: {},
|
|
31939
|
+
prefix: {},
|
|
31940
|
+
header: {},
|
|
31949
31941
|
autoSize: {
|
|
31950
|
-
type: Boolean
|
|
31942
|
+
type: [Boolean, Object],
|
|
31943
|
+
default: () => ({
|
|
31944
|
+
maxRows: 8
|
|
31945
|
+
})
|
|
31951
31946
|
}
|
|
31952
|
-
},
|
|
31953
|
-
styles: () => ({}),
|
|
31954
|
-
classNames: () => ({}),
|
|
31955
|
-
submitType: "enter",
|
|
31956
|
-
disabled: void 0,
|
|
31957
|
-
autoSize: () => ({
|
|
31958
|
-
maxRows: 8
|
|
31959
|
-
})
|
|
31960
|
-
}),
|
|
31947
|
+
},
|
|
31961
31948
|
emits: ["update:value"],
|
|
31962
31949
|
setup(e, {
|
|
31963
31950
|
expose: t,
|
|
@@ -32122,7 +32109,7 @@ const GM = /* @__PURE__ */ W({
|
|
|
32122
32109
|
name: "AXSenderHeader",
|
|
32123
32110
|
inheritAttrs: !1,
|
|
32124
32111
|
__name: "SenderHeader",
|
|
32125
|
-
props:
|
|
32112
|
+
props: tt({
|
|
32126
32113
|
forceRender: {
|
|
32127
32114
|
type: Boolean
|
|
32128
32115
|
},
|
|
@@ -32216,7 +32203,7 @@ const GM = /* @__PURE__ */ W({
|
|
|
32216
32203
|
}), QM = /* @__PURE__ */ W({
|
|
32217
32204
|
name: "AXAttachmentsPlaceholderUploader",
|
|
32218
32205
|
__name: "PlaceholderUploader",
|
|
32219
|
-
props:
|
|
32206
|
+
props: tt({
|
|
32220
32207
|
prefixCls: null,
|
|
32221
32208
|
placeholder: null,
|
|
32222
32209
|
upload: null,
|
|
@@ -33279,18 +33266,16 @@ const cR = (e) => {
|
|
|
33279
33266
|
name: "AXAttachmentsFileList",
|
|
33280
33267
|
__name: "FileList",
|
|
33281
33268
|
props: {
|
|
33282
|
-
prefixCls:
|
|
33283
|
-
items:
|
|
33284
|
-
onRemove: {
|
|
33285
|
-
|
|
33286
|
-
},
|
|
33287
|
-
|
|
33288
|
-
|
|
33289
|
-
|
|
33290
|
-
|
|
33291
|
-
|
|
33292
|
-
itemClassName: null,
|
|
33293
|
-
itemStyle: null
|
|
33269
|
+
prefixCls: {},
|
|
33270
|
+
items: {},
|
|
33271
|
+
onRemove: {},
|
|
33272
|
+
overflow: {},
|
|
33273
|
+
upload: {},
|
|
33274
|
+
imageProps: {},
|
|
33275
|
+
listClassName: {},
|
|
33276
|
+
listStyle: {},
|
|
33277
|
+
itemClassName: {},
|
|
33278
|
+
itemStyle: {}
|
|
33294
33279
|
},
|
|
33295
33280
|
setup(e) {
|
|
33296
33281
|
const t = $(() => `${e.prefixCls}-list`), n = Oo("file-list-container"), [o, r] = ke(!1), i = za();
|
|
@@ -33367,7 +33352,7 @@ const cR = (e) => {
|
|
|
33367
33352
|
}), mR = /* @__PURE__ */ W({
|
|
33368
33353
|
name: "AXAttachments",
|
|
33369
33354
|
__name: "Attachments",
|
|
33370
|
-
props:
|
|
33355
|
+
props: tt({
|
|
33371
33356
|
capture: null,
|
|
33372
33357
|
type: null,
|
|
33373
33358
|
name: null,
|
|
@@ -33810,7 +33795,7 @@ const vR = (e) => {
|
|
|
33810
33795
|
}), xR = /* @__PURE__ */ W({
|
|
33811
33796
|
name: "AXThoughtChainNode",
|
|
33812
33797
|
__name: "item",
|
|
33813
|
-
props:
|
|
33798
|
+
props: tt({
|
|
33814
33799
|
info: null,
|
|
33815
33800
|
nextStatus: null,
|
|
33816
33801
|
onClick: {
|
|
@@ -33894,7 +33879,7 @@ const vR = (e) => {
|
|
|
33894
33879
|
}), r7 = /* @__PURE__ */ W({
|
|
33895
33880
|
name: "AXThoughtChain",
|
|
33896
33881
|
__name: "ThoughtChain",
|
|
33897
|
-
props:
|
|
33882
|
+
props: tt({
|
|
33898
33883
|
items: null,
|
|
33899
33884
|
collapsible: {
|
|
33900
33885
|
type: Boolean
|
package/dist/index.umd.js
CHANGED
|
@@ -289,7 +289,7 @@ summary tabindex target title type usemap value width wmode wrap onCopy onCut on
|
|
|
289
289
|
onMouseenter onMouseleave onMousemove onMouseout onMouseover onMouseup onSelect onTouchcancel
|
|
290
290
|
onTouchend onTouchmove onTouchstart onTouchstartPassive onTouchmovePassive onScroll onWheel onAbort onCanplay onCanplaythrough
|
|
291
291
|
onDurationchange onEmptied onEncrypted onEnded onError onLoadeddata onLoadedmetadata
|
|
292
|
-
onLoadstart onPause onPlay onPlaying onProgress onRatechange onSeeked onSeeking onStalled onSuspend onTimeupdate onVolumechange onWaiting onLoad onError`.split(/[\s\n]+/),AR="aria-",VR="data-";function lv(e,t){return e.indexOf(t)===0}function vo(e,t=!1){let n;t===!1?n={aria:!0,data:!0,attr:!0}:t===!0?n={aria:!0}:n={...t};const o={};return Object.keys(e).forEach(r=>{(n.aria&&(r==="role"||lv(r,AR))||n.data&&lv(r,VR)||n.attr&&(av.includes(r)||av.includes(r.toLowerCase())))&&(o[r]=e[r])}),o}function DR(e){const[t,n]=Te(e.value.length),o=i.computed(()=>e.value.slice(0,i.unref(t))),r=i.computed(()=>{const l=i.unref(o)[i.unref(o).length-1];return l?l.key:null});i.watch(e,()=>{var l;if(!(i.unref(o).length&&i.unref(o).every((s,c)=>{var u;return s.key===((u=e.value[c])==null?void 0:u.key)}))){if(i.unref(o).length===0)n(1);else for(let s=0;s<i.unref(o).length;s+=1)if(i.unref(o)[s].key!==((l=e.value[s])==null?void 0:l.key)){n(s);break}}},{immediate:!0,deep:!0});const a=Zi(l=>{l===i.unref(r)&&n(i.unref(t)+1)});return[o,a]}function LR(e,t){const n=(r,a)=>{var l;return typeof t.value=="function"?t.value(r,a):t?((l=t.value)==null?void 0:l[r.role])||{}:{}};return i.computed(()=>(e.value||[]).map((r,a)=>{const l=r.key??`preset_${a}`;return{...n(r,a),...r,key:l}}))}const BR=1,sv=i.defineComponent({name:"AXBubbleList",inheritAttrs:!1,__name:"BubbleList",props:i.mergeDefaults({prefixCls:null,rootClassName:null,items:null,autoScroll:{type:Boolean},roles:null},{autoScroll:!0}),setup(e,{expose:t}){const n=He(e,["prefixCls","rootClassName","items","autoScroll","roles"]);i.toRef(e,"roles"),i.toRef(e,"items"),i.toRef(e,"prefixCls");const o=i.useAttrs(),r=vo(i.mergeProps(n,o),{attr:!0,aria:!0}),a=i.ref(e.items),l=i.ref(e.roles);i.watch(()=>e.items,()=>{a.value=e.items}),i.watch(()=>e.roles,()=>{l.value=e.roles});const s=i.ref(null),c=i.ref({}),{getPrefixCls:u}=Xe(),d=u("bubble",e.prefixCls),f=`${d}-list`,[p,m,v]=nv(d),[g,y]=Te(!1);i.watchEffect(()=>{y(!0),i.onWatcherCleanup(()=>{y(!1)})});const b=LR(a,l),[S,$]=DR(b),[x,w]=Te(!0),[P,C]=Te(0),I=R=>{const z=R.target;w(z.scrollHeight-Math.abs(z.scrollTop)-z.clientHeight<=BR)};i.watch(P,()=>{e.autoScroll&&i.unref(s)&&i.unref(x)&&i.nextTick(()=>{i.unref(s).scrollTo({top:i.unref(s).scrollHeight})})}),i.watch(()=>i.unref(S).length,()=>{var R;if(e.autoScroll){const z=(R=i.unref(S)[i.unref(S).length-2])==null?void 0:R.key,A=i.unref(c)[z];if(A){const{nativeElement:j}=A,{top:O=0,bottom:N=0}=(j==null?void 0:j.getBoundingClientRect())??{},{top:D,bottom:V}=i.unref(s).getBoundingClientRect();O<V&&N>D&&(C(i.unref(P)+1),w(!0))}}});const M=Zi(()=>{e.autoScroll&&C(i.unref(P)+1)}),E=i.computed(()=>({onUpdate:M}));return t({nativeElement:s,scrollTo:({key:R,offset:z,behavior:A="smooth",block:j})=>{if(typeof z=="number")i.unref(s).scrollTo({top:z,behavior:A});else if(R!==void 0){const O=i.unref(c)[R];if(O){const N=i.unref(S).findIndex(D=>D.key===R);w(N===i.unref(S).length-1),O.nativeElement.scrollIntoView({behavior:A,block:j})}}}}),()=>p(i.createVNode(RR,{value:E.value},{default:()=>[i.createVNode("div",i.mergeProps(r,{class:le(f,e.rootClassName,m.value,v,{[`${f}-reach-end`]:x.value}),ref:s,onScroll:I}),[i.unref(S).map(({key:R,onTypingComplete:z,...A})=>i.createVNode(rv,i.mergeProps(A,{key:R,ref:j=>{j?c.value[R]=j:delete c.value[R]},typing:g.value?A.typing:!1,onTypingComplete:()=>{z==null||z(),$(R)}}),null))])]}))}}),zR=Object.assign(rv,{List:sv}),jR=i.defineComponent({name:"AXConversationsItem",__name:"ConversationsItem",props:{info:null,prefixCls:null,direction:null,menu:null,active:{type:Boolean},onClick:{type:Function}},setup(e){const t=He(e,["prefixCls","info","class","direction","onClick","active","menu"]);i.toRef(e,"class");const n=i.computed(()=>vo(t,{aria:!0,data:!0,attr:!0})),o=p=>{p.stopPropagation()},r=i.computed(()=>e.info.disabled),[a,l]=Te(!1),[s,c]=Te(!1),u=i.computed(()=>le(e.class,`${e.prefixCls}-item`,{[`${e.prefixCls}-item-active`]:e.active&&!r.value},{[`${e.prefixCls}-item-disabled`]:r.value})),d=()=>{!r.value&&e.onClick&&e.onClick(e.info)},f=p=>{p&&c(!p)};return()=>i.createVNode(Yt,{title:e.info.label,open:a.value&&s.value,onOpenChange:c,placement:e.direction==="rtl"?"left":"right"},{default:()=>[i.createVNode("li",i.mergeProps(n.value,{class:u.value,onClick:d}),[e.info.icon&&i.createVNode("div",{class:`${e.prefixCls}-icon`},[e.info.icon]),i.createVNode(Oe.Text,{class:`${e.prefixCls}-label`,ellipsis:{onEllipsis:l}},{default:()=>[e.info.label]}),e.menu&&!r.value&&i.createVNode($n,{placement:e.direction==="rtl"?"bottomLeft":"bottomRight",trigger:["click"],disabled:r.value,onOpenChange:f},{default:()=>i.createVNode(Jo,{onClick:o,disabled:r.value,class:`${e.prefixCls}-menu-icon`},null),overlay:()=>i.createVNode(Jt,e.menu,null)})])]})}}),cv=Symbol("GroupTitleContext"),Rc=i.shallowRef(),FR=e=>{i.provide(cv,e),i.watch(e,()=>{Rc.value=i.unref(e),i.triggerRef(Rc)},{immediate:!0,deep:!0})},HR=()=>i.inject(cv,i.computed(()=>Rc.value||{})),_R=i.defineComponent({props:{value:xt()},setup(e,{slots:t}){return FR(i.computed(()=>e.value)),()=>{var n;return(n=t.default)==null?void 0:n.call(t)}}}),uv=i.defineComponent({name:"AXConversationsGroupTitle",__name:"GroupTitle",setup(e){const t=i.useSlots(),n=HR(),o=i.computed(()=>{var r;return(r=t.default)==null?void 0:r.call(t)});return()=>i.createVNode("div",{class:le(`${n.value.prefixCls}-group-title`)},[o.value&&i.createVNode(Oe.Text,null,{default:()=>[o.value]})])}});function dv(e,t){const{defaultValue:n,value:o=i.ref()}=t||{};let r=typeof e=="function"?e():e;o.value!==void 0&&(r=i.unref(o)),n!==void 0&&(r=typeof n=="function"?n():n);const a=i.ref(r),l=i.ref(r);i.watchEffect(()=>{let c=o.value!==void 0?o.value:a.value;t.postState&&(c=t.postState(c)),l.value=c});function s(c){const u=l.value;a.value=c,i.toRaw(l.value)!==c&&t.onChange&&t.onChange(c,u)}return i.watch(o,()=>{a.value=o.value}),[l,s]}const Mc="__ungrouped",kR=(e,t=[])=>{const n=i.computed(()=>{if(!i.toValue(e))return{enableGroup:!1,sort:void 0,title:void 0};let o={sort:void 0,title:void 0};return typeof i.toValue(e)=="object"&&(o={...o,...i.toValue(e)}),{enableGroup:!0,sort:o.sort,title:o.title}});return i.computed(()=>{if(!n.value.enableGroup)return{groupList:[{name:Mc,data:i.toValue(t),title:void 0}],enableGroup:n.value.enableGroup};const o=i.toValue(t).reduce((l,s)=>{const c=s.group||Mc;return l[c]||(l[c]=[]),l[c].push(s),l},{});return{groupList:(n.value.sort?Object.keys(o).sort(n.value.sort):Object.keys(o)).map(l=>({name:l===Mc?void 0:l,title:n.value.title,data:o[l]})),enableGroup:n.value.enableGroup}})},WR=e=>{const{componentCls:t}=e;return{[t]:{display:"flex",flexDirection:"column",gap:e.paddingXXS,overflowY:"auto",padding:e.paddingSM,[`&${t}-rtl`]:{direction:"rtl"},[`& ${t}-list`]:{display:"flex",gap:e.paddingXXS,flexDirection:"column",paddingLeft:0,[`& ${t}-item`]:{paddingInlineStart:e.paddingXL},[`& ${t}-label`]:{color:e.colorTextDescription}},[`& ${t}-item`]:{display:"flex",height:e.controlHeightLG,minHeight:e.controlHeightLG,gap:e.paddingXS,padding:`0 ${mt(e.paddingXS)}`,alignItems:"center",borderRadius:e.borderRadiusLG,cursor:"pointer",transition:`all ${e.motionDurationMid} ${e.motionEaseInOut}`,"&:hover":{backgroundColor:e.colorBgTextHover},"&-active":{backgroundColor:e.colorBgTextHover,[`& ${t}-label, ${t}-menu-icon`]:{color:e.colorText}},"&-disabled":{cursor:"not-allowed",[`& ${t}-label`]:{color:e.colorTextDisabled}},"&:hover, &-active":{[`& ${t}-menu-icon`]:{opacity:1}}},[`& ${t}-label`]:{flex:1,overflow:"hidden",textOverflow:"ellipsis",color:e.colorText},[`& ${t}-menu-icon`]:{opacity:0,fontSize:e.fontSizeXL},[`& ${t}-group-title`]:{display:"flex",alignItems:"center",height:e.controlHeightLG,minHeight:e.controlHeightLG,padding:`0 ${mt(e.paddingXS)}`}}}},UR=an("Conversations",e=>{const t=wt(e,{});return WR(t)},()=>({})),XR=i.defineComponent({name:"AXConversations",__name:"Conversations",props:i.mergeDefaults({items:null,activeKey:null,defaultActiveKey:null,onActiveChange:{type:Function},menu:{type:Function},groupable:{type:Boolean},styles:null,classNames:null,prefixCls:null,rootClassName:null},{styles:()=>({}),classNames:()=>({})}),setup(e){const t=He(e,["prefixCls","rootClassName","items","activeKey","defaultActiveKey","onActiveChange","menu","styles","classNames","groupable","class","style"]);i.toRef(e,"class"),i.toRef(e,"activeKey"),i.toRef(e,"prefixCls");const n=i.ref(e.activeKey),o=i.computed(()=>vo(t,{attr:!0,aria:!0,data:!0})),[r,a]=dv(e.defaultActiveKey,{value:n});i.watch(()=>e.activeKey,()=>{n.value=e.activeKey});const l=kR(()=>e.groupable,()=>e.items),{getPrefixCls:s,direction:c}=Xe(),u=i.computed(()=>s("conversations",e.prefixCls)),d=on("conversations"),[f,p,m]=UR(u),v=i.computed(()=>le(u.value,d.value.className,e.class,e.rootClassName,p.value,m,{[`${u.value}-rtl`]:c.value==="rtl"})),g=y=>{a(y.key),e.onActiveChange&&e.onActiveChange(y.key)};return()=>f(i.createVNode("ul",i.mergeProps(o.value,{style:{...typeof d.value.style=="object"?d.value.style:{},...typeof e.style=="object"?e.style:{}},class:v.value}),[l.value.groupList.map((y,b)=>{const S=y.data.map(($,x)=>i.createVNode(jR,{key:$.key||`key-${x}`,info:$,prefixCls:u.value,direction:c.value,class:le(e.classNames.item,d.value.classNames.item),style:{...d.value.styles.item,...e.styles.item},menu:typeof e.menu=="function"?e.menu($):e.menu,active:r.value===$.key,onClick:g},null));return l.value.enableGroup?i.createVNode("li",{key:y.name||`key-${b}`},[i.createVNode(_R,{value:{prefixCls:u.value}},{default:()=>{var $;return[(($=y.title)==null?void 0:$.call(y,y.name,{components:{GroupTitle:uv}}))||i.createVNode(uv,{key:y.name},{default:()=>[y.name]})]}}),i.createVNode("ul",{class:`${u.value}-list`},[S])]):S})]))}}),KR=e=>{const{componentCls:t,calc:n}=e,o=n(e.fontSizeHeading3).mul(e.lineHeightHeading3).equal(),r=n(e.fontSize).mul(e.lineHeight).equal();return{[t]:{gap:e.padding,[`${t}-icon`]:{height:n(o).add(r).add(e.paddingXXS).equal(),display:"flex",img:{height:"100%"}},[`${t}-content-wrapper`]:{gap:e.paddingXS,flex:"auto",minWidth:0,[`${t}-title-wrapper`]:{gap:e.paddingXS},[`${t}-title`]:{margin:0},[`${t}-extra`]:{marginInlineStart:"auto"}}}}},GR=e=>{const{componentCls:t}=e;return{[t]:{"&-filled":{paddingInline:e.padding,paddingBlock:e.paddingSM,background:e.colorFillContent,borderRadius:e.borderRadiusLG},"&-borderless":{[`${t}-title`]:{fontSize:e.fontSizeHeading3,lineHeight:e.lineHeightHeading3}}}}},qR=an("Welcome",e=>{const t=wt(e,{});return[KR(t),GR(t)]},()=>({}));function YR(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!i.isVNode(e)}const ZR=i.defineComponent({name:"AXWelcome",__name:"Welcome",props:i.mergeDefaults({prefixCls:null,rootClassName:null,className:null,style:null,variant:null,classNames:null,styles:null,icon:null,title:null,description:null,extra:null},{variant:"filled",classNames:()=>({}),styles:()=>({})}),setup(e){i.toRef(e,"prefixCls");const t=i.useSlots(),{direction:n,getPrefixCls:o}=Xe(),r=o("welcome",e.prefixCls),a=on("welcome"),[l,s,c]=qR(r),u=i.computed(()=>{const m=t.icon?t.icon():e.icon;if(!m)return null;let v=m;return typeof m=="string"&&m.startsWith("http")&&(v=i.createVNode("img",{src:m,alt:"icon"},null)),i.createVNode("div",{class:le(`${r}-icon`,a.value.classNames.icon,e.classNames.icon),style:e.styles.icon},[v])}),d=i.computed(()=>{const m=t.title?t.title():e.title;return m?i.createVNode(Oe.Title,{level:4,class:le(`${r}-title`,a.value.classNames.title,e.classNames.title),style:e.styles.title},YR(m)?m:{default:()=>[m]}):null}),f=i.computed(()=>t.description?t.description():e.description),p=i.computed(()=>{const m=t.extra?t.extra():e.extra;return m?i.createVNode("div",{class:le(`${r}-extra`,a.value.classNames.extra,e.classNames.extra),style:e.styles.extra},[m]):null});return()=>l(i.createVNode(hr,{class:le(r,a.value.className,e.className,e.rootClassName,s.value,c,`${r}-${e.variant}`,{[`${r}-rtl`]:n.value==="rtl"}),style:e.style},{default:()=>[u.value,i.createVNode(hr,{vertical:!0,class:`${r}-content-wrapper`},{default:()=>[t.extra||e.extra?i.createVNode(hr,{align:"flex-start",class:`${r}-title-wrapper`},{default:()=>[d.value,p.value]}):d.value,f.value&&i.createVNode(Oe.Text,{class:le(`${r}-description`,a.value.classNames.description,e.classNames.description),style:e.styles.description},{default:()=>[f.value]})]})]}))}}),QR=e=>{const{componentCls:t}=e;return{[t]:{"&, & *":{boxSizing:"border-box"},maxWidth:"100%",[`&${t}-rtl`]:{direction:"rtl"},[`& ${t}-title`]:{marginBlockStart:0,fontWeight:"normal",color:e.colorTextTertiary},[`& ${t}-list`]:{display:"flex",gap:e.paddingSM,overflowX:"scroll","&::-webkit-scrollbar":{display:"none"},listStyle:"none",paddingInlineStart:0,marginBlock:0,alignItems:"stretch","&-wrap":{flexWrap:"wrap"},"&-vertical":{flexDirection:"column",alignItems:"flex-start"}},[`${t}-item`]:{flex:"none",display:"flex",gap:e.paddingXS,height:"auto",paddingBlock:e.paddingSM,paddingInline:e.padding,alignItems:"flex-start",justifyContent:"flex-start",background:e.colorBgContainer,borderRadius:e.borderRadiusLG,transition:["border","background"].map(n=>`${n} ${e.motionDurationSlow}`).join(","),border:`${mt(e.lineWidth)} ${e.lineType} ${e.colorBorderSecondary}`,[`&:not(${t}-item-has-nest)`]:{"&:hover":{cursor:"pointer",background:e.colorFillTertiary},"&:active":{background:e.colorFill}},[`${t}-content`]:{flex:"auto",minWidth:0,display:"flex",gap:e.paddingXXS,flexDirection:"column",alignItems:"flex-start"},[`${t}-icon, ${t}-label, ${t}-desc`]:{margin:0,padding:0,fontSize:e.fontSize,lineHeight:e.lineHeight,textAlign:"start",whiteSpace:"normal"},[`${t}-label`]:{color:e.colorTextHeading,fontWeight:500},[`${t}-label + ${t}-desc`]:{color:e.colorTextTertiary},[`&${t}-item-disabled`]:{pointerEvents:"none",background:e.colorBgContainerDisabled,[`${t}-label, ${t}-desc`]:{color:e.colorTextTertiary}}}}}},JR=e=>{const{componentCls:t}=e;return{[t]:{[`${t}-item-has-nest`]:{[`> ${t}-content`]:{[`> ${t}-label`]:{fontSize:e.fontSizeLG,lineHeight:e.lineHeightLG}}},[`&${t}-nested`]:{marginTop:e.paddingXS,alignSelf:"stretch",[`${t}-list`]:{alignItems:"stretch"},[`${t}-item`]:{border:0,background:e.colorFillQuaternary}}}}},eM=an("Prompts",e=>{const t=wt(e,{});return[QR(t),JR(t)]},()=>({})),fv=i.defineComponent({name:"AXPrompts",__name:"Prompts",props:i.mergeDefaults({items:null,title:null,onItemClick:{type:Function},vertical:{type:Boolean},wrap:{type:Boolean},styles:null,classNames:null,prefixCls:null,rootClassName:null},{styles:()=>({}),classNames:()=>({})}),setup(e){const t=He(e,["prefixCls","title","class","items","onItemClick","vertical","wrap","rootClassName","styles","classNames","style"]);i.toRef(e,"class"),i.toRef(e,"prefixCls");const n=i.useSlots(),{getPrefixCls:o,direction:r}=Xe(),a=o("prompts",e.prefixCls),l=on("prompts"),[s,c,u]=eM(a),d=i.computed(()=>le(a,l.value.className,e.class,e.rootClassName,c.value,u,{[`${a}-rtl`]:r.value==="rtl"})),f=i.computed(()=>le(`${a}-list`,l.value.classNames.list,e.classNames.list,{[`${a}-list-wrap`]:e.wrap},{[`${a}-list-vertical`]:e.vertical})),p=i.computed(()=>n.title?n.title():e.title);return()=>{var m;return s(i.createVNode("div",i.mergeProps(t,{class:d.value,style:{...typeof e.style=="object"?e.style:{},...typeof l.value.style=="object"?l.value.style:{}}}),[p.value&&i.createVNode(Oe.Title,{level:5,class:le(`${a}-title`,l.value.classNames.title,e.classNames.title),style:{...l.value.styles.title,...e.styles.title}},{default:()=>[p.value]}),i.createVNode("div",{class:f.value,style:{...l.value.styles.list,...e.styles.list}},[(m=e.items)==null?void 0:m.map((v,g)=>{const y=v.children&&v.children.length>0;return i.createVNode("div",{key:v.key||`key_${g}`,style:{...l.value.styles.item,...e.styles.item},class:le(`${a}-item`,l.value.classNames.item,e.classNames.item,{[`${a}-item-disabled`]:v.disabled,[`${a}-item-has-nest`]:y}),onClick:()=>{!y&&e.onItemClick&&e.onItemClick({data:v})}},[v.icon&&i.createVNode("div",{class:`${a}-icon`},[v.icon]),i.createVNode("div",{class:le(`${a}-content`,l.value.classNames.itemContent,e.classNames.itemContent),style:{...l.value.styles.itemContent,...e.styles.itemContent}},[v.label&&i.createVNode("h6",{class:`${a}-label`},[v.label]),v.description&&i.createVNode("p",{class:`${a}-desc`},[v.description]),y&&i.createVNode(fv,{class:`${a}-nested`,items:v.children,vertical:!0,onItemClick:e.onItemClick,classNames:{list:e.classNames.subList,item:e.classNames.subItem},styles:{list:e.styles.subList,item:e.styles.subItem}},null)])])})])]))}}}),tM=e=>{const{componentCls:t,antCls:n}=e;return{[t]:{[`${n}-cascader-menus ${n}-cascader-menu`]:{height:"auto"},[`${t}-item`]:{"&-icon":{marginInlineEnd:e.paddingXXS},"&-extra":{marginInlineStart:e.padding}},[`&${t}-block`]:{[`${t}-item-extra`]:{marginInlineStart:"auto"}}}}},nM=an("Suggestion",e=>{const t=wt(e,{});return tM(t)},()=>({}));function oM(e,t,n,o,r){const[a,l]=Te([]),s=(m,v=a.value)=>{let g=i.toValue(e);for(let y=0;y<m-1;y+=1){const b=v[y],S=g.find($=>$.value===b);if(!S)break;g=S.children||[]}return g},c=m=>m.map((v,g)=>{const b=s(g+1,m).find(S=>S.value===v);return b==null?void 0:b.value}),u=m=>{const v=a.value.length||1,g=s(v),y=g.findIndex($=>$.value===a.value[v-1]),b=g.length,S=g[(y+m+b)%b];l([...a.value.slice(0,v-1),S.value])},d=()=>{a.value.length>1&&l(a.value.slice(0,a.value.length-1))},f=()=>{const m=s(a.value.length+1);m.length&&l([...a.value,m[0].value])},p=Zi(m=>{if(i.toValue(t))switch(console.log("e.key",m),m.key){case"ArrowDown":u(1),m.preventDefault();break;case"ArrowUp":u(-1),m.preventDefault();break;case"ArrowRight":i.toValue(n)?d():f(),m.preventDefault();break;case"ArrowLeft":i.toValue(n)?f():d(),m.preventDefault();break;case"Enter":s(a.value.length+1).length||o(c(a.value)),m.preventDefault();break;case"Escape":r(),m.preventDefault();break}});return i.watch(()=>i.toValue(t),()=>{i.toValue(t)&&l([i.toValue(e)[0].value])},{immediate:!0}),[a,p]}const rM=i.defineComponent({name:"AXSuggestion",__name:"Suggestion",props:i.mergeDefaults({prefixCls:null,className:null,rootClassName:null,style:null,children:{type:Function},open:{type:Boolean},onOpenChange:{type:Function},items:{type:Function},onSelect:{type:Function},block:{type:Boolean},styles:null,classNames:null},{open:!1}),setup(e){i.toRef(e,"prefixCls");const t=i.useSlots(),{direction:n,getPrefixCls:o}=Xe(),r=i.computed(()=>o("suggestion",e.prefixCls));`${r.value}`;const a=i.computed(()=>n.value==="rtl"),l=on("suggestion"),[s,c,u]=nM(r),[d,f]=Te(e.open),[p,m]=Te(),v=P=>{var C;f(P),(C=e.onOpenChange)==null||C.call(e,P)},g=P=>{P===!1?v(!1):(m(P),v(!0))},y=()=>{v(!1)},b=i.computed(()=>typeof e.items=="function"?e.items(p.value):e.items),S=P=>{e.onSelect&&e.onSelect(P[P.length-1]),v(!1)},[$,x]=oM(b,d,a,S,y),w=i.computed(()=>{var P;return t.default?t.default({onTrigger:g,onKeyDown:x}):(P=e.children)==null?void 0:P.call(e,{onTrigger:g,onKeyDown:x})});return()=>s(i.createVNode(TN,{options:b.value,open:d.value,value:$.value,placement:a.value?"topRight":"topLeft",onDropdownVisibleChange:P=>{P||y()},class:le(e.rootClassName,r.value,c,u,{[`${r.value}-block`]:e.block}),onChange:S,dropdownMatchSelectWidth:e.block},{default:()=>i.createVNode("div",{class:le(r.value,l.value.className,e.rootClassName,e.className,`${r.value}-wrapper`,c.value,u),style:{...l.value.style,...e.style}},[w.value])}))}}),pv=Symbol("SenderHeaderContext"),Ac=i.shallowRef(),iM=e=>{i.provide(pv,e),i.watch(e,()=>{Ac.value=i.unref(e),i.triggerRef(Ac)},{immediate:!0,deep:!0})},aM=()=>i.inject(pv,i.computed(()=>Ac.value||{})),lM=i.defineComponent({props:{value:xt()},setup(e,{slots:t}){return iM(i.computed(()=>e.value)),()=>{var n;return(n=t.default)==null?void 0:n.call(t)}}}),mv=Symbol("ActionButtonContext"),Vc=i.shallowRef(),sM=e=>{i.provide(mv,e),i.watch(e,()=>{Vc.value=i.unref(e),i.triggerRef(Vc)},{immediate:!0,deep:!0})},Dc=()=>i.inject(mv,i.computed(()=>Vc.value||{})),cM=i.defineComponent({props:{value:xt()},setup(e,{slots:t}){return sM(i.computed(()=>e.value)),()=>{var n;return(n=t.default)==null?void 0:n.call(t)}}}),Qi=i.defineComponent({name:"AXSenderActionButton",__name:"index",props:i.mergeDefaults({prefixCls:null,type:null,htmlType:null,shape:null,size:null,loading:null,disabled:null,ghost:null,block:null,danger:null,icon:null,href:null,target:null,title:null,onClick:null,onMousedown:null,action:null},{type:"text",disabled:void 0}),setup(e){const t=He(e,["action","type","disabled","onClick"]);i.toRef(e,"onClick"),i.toRef(e,"disabled");const n=i.useSlots(),o=Dc(),r=i.computed(()=>{var u;const s=o.value.disabled,c=(u=o.value)==null?void 0:u[`${e.action}Disabled`];return s??e.disabled??c}),a=i.computed(()=>o.value.prefixCls),l=i.computed(()=>{var s;return(s=o.value)==null?void 0:s[e.action]});return()=>i.createVNode(We,i.mergeProps({type:e.type},t,{onClick:s=>{r.value||(l.value&&l.value(),e.onClick&&!Array.isArray(e.onClick)&&e.onClick(s))},class:le(a.value,{[`${a.value}-disabled`]:r.value})}),{icon:()=>n.default()})}}),uM=i.defineComponent({name:"AXSenderClearButton",__name:"ClearButton",props:i.mergeDefaults({prefixCls:null,type:null,htmlType:null,shape:null,size:null,loading:null,disabled:null,ghost:null,block:null,danger:null,icon:null,href:null,target:null,title:null,onClick:null,onMousedown:null},{disabled:void 0}),setup(e){const t=He(e,["disabled"]);return()=>i.createVNode(Qi,i.mergeProps({disabled:e.disabled},t,{action:"onClear"}),{default:()=>[i.createVNode(ac,null,null)]})}}),dM=i.defineComponent({name:"AXSenderStopLoading",__name:"StopLoading",props:{className:null},setup(e){const t=e;return()=>i.createVNode("svg",{color:"currentColor",viewBox:"0 0 1000 1000",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",class:t.className},[i.createVNode("title",null,[i.createTextVNode("Stop Loading")]),i.createVNode("rect",{fill:"currentColor",height:"250",rx:"24",ry:"24",width:"250",x:"375",y:"375"},null),i.createVNode("circle",{cx:"500",cy:"500",fill:"none",r:"450",stroke:"currentColor","stroke-width":"100",opacity:"0.45"},null),i.createVNode("circle",{cx:"500",cy:"500",fill:"none",r:"450",stroke:"currentColor","stroke-width":"100","stroke-dasharray":"600 9999999"},[i.createVNode("animateTransform",{attributeName:"transform",dur:"1s",from:"0 500 500",repeatCount:"indefinite",to:"360 500 500",type:"rotate"},null)])])}}),gv=i.defineComponent({name:"AXSenderLoadingButton",__name:"LoadingButton",props:i.mergeDefaults({prefixCls:null,type:null,htmlType:null,shape:null,size:null,loading:null,disabled:null,ghost:null,block:null,danger:null,icon:null,href:null,target:null,title:null,onClick:null,onMousedown:null},{type:"primary",shape:"circle",icon:null,disabled:void 0}),setup(e){const t=He(e,["type","shape","icon","disabled"]),n=Dc(),{token:o}=vr.useToken();return()=>i.createVNode(Qi,i.mergeProps({type:e.type,disabled:e.disabled,shape:e.shape},t,{style:{backgroundColor:"transparent",color:o.value.colorPrimary},class:le(`${n.value.prefixCls}-loading-button`),action:"onCancel"}),{default:()=>[i.createVNode(dM,{className:`${n.value.prefixCls}-loading-icon`},null)]})}}),hv=i.defineComponent({name:"AXSenderLoadingButton",__name:"SendButton",props:i.mergeDefaults({prefixCls:null,type:null,htmlType:null,shape:null,size:null,loading:null,disabled:null,ghost:null,block:null,danger:null,icon:null,href:null,target:null,title:null,onClick:null,onMousedown:null},{type:"primary",shape:"circle",disabled:void 0}),setup(e){const t=He(e,["type","shape","disabled"]);return()=>i.createVNode(Qi,i.mergeProps({type:e.type,shape:e.shape,disabled:e.disabled},t,{action:"onSend"}),{default:()=>[i.createVNode(oc,null,null)]})}}),Sr=1e3,wr=4,Ji=140,ea=250,vv=500,ta=.8,fM=i.defineComponent({name:"AXSenderRecordingIcon",__name:"RecordingIcon",props:{className:null},setup(e){const t=Ji/2;return()=>i.createVNode("svg",{color:"currentColor",viewBox:`0 0 ${Sr} ${Sr}`,xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",class:e.className},[i.createVNode("title",null,[i.createTextVNode("Speech Recording")]),Array.from({length:wr}).map((n,o)=>{const r=(Sr-Ji*wr)/(wr-1),a=o*(r+Ji),l=Sr/2-ea/2,s=Sr/2-vv/2;return i.createVNode("rect",{fill:"currentColor",rx:t,ry:t,height:ea,width:Ji,x:a,y:l,key:o},[i.createVNode("animate",{attributeName:"height",values:`${ea}; ${vv}; ${ea}`,keyTimes:"0; 0.5; 1",dur:`${ta}s`,begin:`${ta/wr*o}s`,repeatCount:"indefinite"},null),i.createVNode("animate",{attributeName:"y",values:`${l}; ${s}; ${l}`,keyTimes:"0; 0.5; 1",dur:`${ta}s`,begin:`${ta/wr*o}s`,repeatCount:"indefinite"},null)])})])}}),yv=i.defineComponent({name:"AXSenderSpeechButton",__name:"index",props:i.mergeDefaults({prefixCls:null,type:null,htmlType:null,shape:null,size:null,loading:null,disabled:null,ghost:null,block:null,danger:null,icon:null,href:null,target:null,title:null,onClick:null,onMousedown:null},{type:"text",disabled:void 0}),setup(e){const t=He(e,["type","disabled"]),n=Dc(),{token:o}=vr.useToken(),r=i.computed(()=>n.value.speechRecording),a=i.computed(()=>n.value.prefixCls),l=i.computed(()=>{let s;return r.value?s=i.createVNode(fM,{className:`${a.value}-recording-icon`},null):n.value.onSpeechDisabled?s=i.createVNode(rc,null,null):s=i.createVNode(ic,null,null),s});return()=>i.createVNode(Qi,i.mergeProps({type:e.type,disabled:e.disabled},t,{style:{display:"flex",justifyContent:"center",alignItems:"center",color:o.value.colorPrimary},action:"onSpeech"}),{default:()=>[l.value]})}}),$r=i.defineComponent({name:"AXTransitionCollapse",__name:"TransitionCollapse",props:{prefixCls:{default:"ax"}},setup(e){const t=e,n=i.useSlots(),o=i.computed(()=>t.prefixCls+"-transition-collapse"),r={beforeEnter(a){a.dataset||(a.dataset={}),a.dataset.oldPaddingTop=a.style.paddingTop,a.dataset.oldPaddingBottom=a.style.paddingBottom,a.style.maxHeight="0",a.style.paddingTop="0",a.style.paddingBottom="0"},enter(a){a.dataset.oldOverflow=a.style.overflow,a.scrollHeight!==0?(a.style.maxHeight=`${a.scrollHeight}px`,a.style.paddingTop=a.dataset.oldPaddingTop,a.style.paddingBottom=a.dataset.oldPaddingBottom):(a.style.maxHeight=`${a.dataset.oldMaxHeight||"999"}px`,a.style.paddingTop=a.dataset.oldPaddingTop,a.style.paddingBottom=a.dataset.oldPaddingBottom),a.style.overflow="hidden"},afterEnter(a){a.style.maxHeight="",a.style.overflow=a.dataset.oldOverflow},beforeLeave(a){a.dataset||(a.dataset={}),a.dataset.oldMaxHeight=a.scrollHeight,a.dataset.oldPaddingTop=a.style.paddingTop,a.dataset.oldPaddingBottom=a.style.paddingBottom,a.dataset.oldOverflow=a.style.overflow,a.style.overflow="hidden",a.style.maxHeight=`${a.scrollHeight}px`},leave(a){a.scrollHeight!==0&&(a.style.maxHeight="0",a.style.paddingTop="0",a.style.paddingBottom="0")},afterLeave(a){a.style.maxHeight="",a.style.overflow=a.dataset.oldOverflow,a.style.paddingTop=a.dataset.oldPaddingTop,a.style.paddingBottom=a.dataset.oldPaddingBottom}};return()=>i.createVNode(i.Transition,{name:o.value,onBeforeEnter:r.beforeEnter,onEnter:r.enter,onAfterEnter:r.afterEnter,onBeforeLeave:r.beforeLeave,onLeave:r.leave,onAfterLeave:r.afterLeave},{default:()=>{var a;return[(a=n.default)==null?void 0:a.call(n)]}})}}),bv=e=>{const{componentCls:t}=e,n=`${t}-transition-collapse`;return{[t]:{[n]:{"&-enter-active":{transition:["max-height","padding-top","padding-bottom"].map(o=>`${o} ${e.motionDurationSlow} ${e.motionEaseInOut}`).join(",")},"&-leave-active":{transition:["max-height","padding-top","padding-bottom"].map(o=>`${o} ${e.motionDurationSlow} ${e.motionEaseInOut}`).join(",")}}}}};$r.install=function(e){return e.component($r.name,$r),e};const pM=e=>{const{componentCls:t,calc:n}=e,o=`${t}-header`;return{[t]:{[o]:{borderBottomWidth:e.lineWidth,borderBottomStyle:"solid",borderBottomColor:e.colorBorder,"&-header":{background:e.colorFillAlter,fontSize:e.fontSize,lineHeight:e.lineHeight,paddingBlock:n(e.paddingSM).sub(e.lineWidthBold).equal(),paddingInlineStart:e.padding,paddingInlineEnd:e.paddingXS,display:"flex",[`${o}-title`]:{flex:"auto"}},"&-content":{padding:e.padding},"&-motion":{transition:["height","border"].map(r=>`${r} ${e.motionDurationSlow}`).join(","),overflow:"hidden","&-enter-start, &-leave-active":{borderBottomColor:"transparent"},"&-hidden":{display:"none"}}}}}},mM=e=>{const{componentCls:t,padding:n,paddingSM:o,paddingXS:r,lineWidth:a,lineWidthBold:l,calc:s}=e;return{[t]:{position:"relative",width:"100%",boxSizing:"border-box",boxShadow:`${e.boxShadowTertiary}`,transition:`background ${e.motionDurationSlow}`,borderRadius:{_skip_check_:!0,value:s(e.borderRadius).mul(2).equal()},borderColor:e.colorBorder,borderWidth:0,borderStyle:"solid","&:after":{content:'""',position:"absolute",inset:0,pointerEvents:"none",transition:`border-color ${e.motionDurationSlow}`,borderRadius:{_skip_check_:!0,value:"inherit"},borderStyle:"inherit",borderColor:"inherit",borderWidth:a},"&:focus-within":{boxShadow:`${e.boxShadowSecondary}`,borderColor:e.colorPrimary,"&:after":{borderWidth:l}},"&-disabled":{background:e.colorBgContainerDisabled},[`&${t}-rtl`]:{direction:"rtl"},[`${t}-content`]:{display:"flex",gap:r,width:"100%",paddingBlock:o,paddingInlineStart:n,paddingInlineEnd:o,boxSizing:"border-box",alignItems:"flex-end"},[`${t}-prefix`]:{flex:"none"},[`${t}-input`]:{padding:0,borderRadius:0,flex:"auto",alignSelf:"center",minHeight:"auto"},[`${t}-actions-list`]:{flex:"none",display:"flex","&-presets":{gap:e.paddingXS}},[`${t}-actions-btn`]:{"&-disabled":{opacity:.45},"&-loading-button":{padding:0,border:0},"&-loading-icon":{height:e.controlHeight,width:e.controlHeight,verticalAlign:"top"},"&-recording-icon":{height:"1.2em",width:"1.2em",verticalAlign:"top"}}}}},gM=an("Sender",e=>{const{paddingXS:t,calc:n}=e,o=wt(e,{SenderContentMaxWidth:`calc(100% - ${mt(n(t).add(32).equal())})`});return[mM(o),pM(o),bv(o)]},()=>({}));let na;!na&&typeof window<"u"&&(na=window.SpeechRecognition||window.webkitSpeechRecognition);function hM(e,t){const n=e,o=i.computed(()=>{const g=i.toValue(t);return typeof g=="object"?{controlledRecording:g.recording,onControlledRecordingChange:g.onRecordingChange,speechInControlled:typeof g.recording=="boolean"}:{controlledRecording:void 0,onControlledRecordingChange:void 0,speechInControlled:!1}}),r=i.computed(()=>o.value.controlledRecording),a=o.value.onControlledRecordingChange,l=o.value.speechInControlled,s=i.ref(null);i.watchEffect(()=>{if(typeof navigator<"u"&&"permissions"in navigator){let g=null;navigator.permissions.query({name:"microphone"}).then(y=>{s.value=y.state,y.onchange=function(){s.value=this.state},g=y}),i.onWatcherCleanup(()=>{g&&(g.onchange=null)})}});const c=i.computed(()=>na&&s.value!=="denied"),u=i.ref(null),[d,f]=dv(!1,{value:r}),p=i.ref(!1),m=()=>{if(c.value&&!u.value){const g=new na;g.onstart=()=>{f(!0)},g.onend=()=>{f(!1)},g.onresult=y=>{var b,S,$;if(!p.value){const x=($=(S=(b=y.results)==null?void 0:b[0])==null?void 0:S[0])==null?void 0:$.transcript;n(x)}p.value=!1},u.value=g}};return{speechPermission:c,triggerSpeech:g=>{g&&!d.value||(p.value=g,l?a==null||a(!d.value):(m(),u.value&&(d.value?(u.value.stop(),a==null||a(!1)):(u.value.start(),a==null||a(!0)))))},recording:d}}function vM(e,t){for(var n=e,o=0;o<t.length;o+=1){if(n==null)return;n=n[t[o]]}return n}const yM=i.defineComponent({name:"AXSender",__name:"Sender",props:i.mergeDefaults({onKeyPress:{type:Function},onFocus:null,onBlur:null,prefixCls:null,defaultValue:null,value:null,loading:{type:Boolean},placeholder:null,readOnly:{type:Boolean},submitType:{type:[String,Boolean]},disabled:{type:Boolean},onSubmit:{type:Function},onChange:{type:Function},onCancel:null,onKeyDown:{type:Function},onPaste:{type:Function},onPasteFile:{type:Function},components:null,styles:null,rootClassName:null,classNames:null,style:null,className:null,actions:{type:Function},allowSpeech:null,prefix:null,header:null,autoSize:{type:Boolean}},{styles:()=>({}),classNames:()=>({}),submitType:"enter",disabled:void 0,autoSize:()=>({maxRows:8})}),emits:["update:value"],setup(e,{expose:t,emit:n}){const o=He(e,["prefixCls","styles","classNames","className","rootClassName","style","defaultValue","value","placeholder","readOnly","submitType","onSubmit","loading","components","onCancel","onChange","actions","onKeyPress","onKeyDown","disabled","allowSpeech","prefix","header","onPaste","onPasteFile","autoSize"]);i.toRef(e,"prefixCls");function r(K,Q,te){return vM(K,Q)||te}const a=n,l=i.useSlots(),{direction:s,getPrefixCls:c}=Xe(),u=i.computed(()=>c("sender",e.prefixCls)),d=i.ref(null),f=i.ref(null),p=on("sender"),m=i.computed(()=>`${u.value}-input`),[v,g,y]=gM(u.value),b=i.computed(()=>le(u.value,p.value.className,e.className,e.rootClassName,g.value,y,{[`${u.value}-rtl`]:s.value==="rtl",[`${u.value}-disabled`]:e.disabled})),S=i.computed(()=>`${u.value}-actions-btn`),$=i.computed(()=>`${u.value}-actions-list`),x=i.ref(e.value??e.defaultValue??""),w=K=>{x.value=K};i.watch(()=>e.value,()=>{w(e.value)});const P=(K,Q)=>{w(K),a("update:value",K),e.onChange&&e.onChange(K,Q)},{speechPermission:C,triggerSpeech:I,recording:M}=hM(K=>{P(`${x.value} ${K}`)},()=>e.allowSpeech),E=r(e.components,["input"],Ve.TextArea),R=i.computed(()=>vo(o,{attr:!0,aria:!0,data:!0})),z=i.computed(()=>({...R.value,ref:f})),A=()=>{x.value&&e.onSubmit&&!e.loading&&e.onSubmit(x.value)},j=()=>{P("")},O=i.ref(!1),N=()=>{O.value=!0},D=()=>{O.value=!1},V=K=>{const Q=K.key==="Enter"&&!O.value;switch(e.submitType){case"enter":Q&&!K.shiftKey&&(K.preventDefault(),A());break;case"shiftEnter":Q&&K.shiftKey&&(K.preventDefault(),A());break}e.onKeyPress&&e.onKeyPress(K)},T=K=>{var te,X;const Q=(te=K.clipboardData)==null?void 0:te.files;Q!=null&&Q.length&&e.onPasteFile&&(e.onPasteFile(Q[0],Q),K.preventDefault()),(X=e.onPaste)==null||X.call(e,K)},F=K=>{var Q,te;K.target!==((Q=d.value)==null?void 0:Q.querySelector(`.${m.value}`))&&K.preventDefault(),(te=f.value)==null||te.focus()},_=i.computed(()=>{let K=i.createVNode(hr,{class:`${$.value}-presets`},{default:()=>[e.allowSpeech&&i.createVNode(yv,null,null),e.loading?i.createVNode(gv,null,null):i.createVNode(hv,null,null)]});const Q={components:{SendButton:hv,ClearButton:uM,LoadingButton:gv,SpeechButton:yv}};return l.actions?K=l.actions({ori:K,info:Q}):typeof e.actions=="function"?K=e.actions(K,Q):e.actions&&(K=e.actions),K}),q=i.computed(()=>l.header?l.header():e.header),Z=i.computed(()=>l.prefix?l.prefix():e.prefix);return t({nativeElement:d.value,focus:K=>{var Q;return(Q=f.value)==null?void 0:Q.focus(K)},blur:()=>{var K;return(K=f.value)==null?void 0:K.blur()}}),()=>v(i.createVNode("div",{ref:d,class:b.value,style:{...p.value.style,...e.style}},[q.value&&i.createVNode(lM,{value:{prefixCls:u.value}},{default:()=>[q.value]}),i.createVNode("div",{class:`${u.value}-content`,onMousedown:F},[Z.value&&i.createVNode("div",{class:le(`${u.value}-prefix`,p.value.classNames.prefix,e.classNames.prefix),style:{...p.value.styles.prefix,...e.styles.prefix}},[Z.value]),i.createVNode(E,i.mergeProps(z.value,{disabled:e.disabled,style:{...p.value.styles.input,...e.styles.input},class:le(m.value,p.value.classNames.input,e.classNames.input),autoSize:e.autoSize,value:x.value,onChange:K=>{P(K.target.value,K),I(!0)},onPressEnter:V,onCompositionstart:N,onCompositionend:D,onKeydown:e.onKeyDown,placeholder:e.placeholder,onPaste:T,bordered:!1,readOnly:e.readOnly}),null),i.createVNode("div",{class:le($.value,p.value.classNames.actions,e.classNames.actions),style:{...p.value.styles.actions,...e.styles.actions}},[i.createVNode(cM,{value:{prefixCls:S.value,onSend:A,onSendDisabled:!x.value,onClear:j,onClearDisabled:!x.value,onCancel:e.onCancel,onCancelDisabled:!e.loading,onSpeech:()=>I(!1),onSpeechDisabled:!C.value,speechRecording:M.value,disabled:e.disabled}},{default:()=>[_.value]})])])]))}}),bM=i.defineComponent({name:"AXSenderHeader",inheritAttrs:!1,__name:"SenderHeader",props:i.mergeDefaults({forceRender:{type:Boolean},open:{type:Boolean},onOpenChange:{type:Function},title:null,children:null,className:null,style:null,classNames:null,styles:null,closable:{type:Boolean}},{classNames:()=>({}),styles:()=>({})}),setup(e){i.toRef(e,"classNames");const t=i.useSlots(),n=aM(),o=i.computed(()=>`${n.value.prefixCls}-header`),r=i.useAttrs();return()=>i.createVNode($r,{prefixCls:n.value.prefixCls},{default:()=>{var a;return[e.open||e.forceRender?i.withDirectives(i.createVNode("div",i.mergeProps(r,{class:le(o.value,e.className),style:{...e.style}}),[(e.closable!==!1||e.title)&&i.createVNode("div",{class:le(`${o.value}-header`,e.classNames.header),style:{...e.styles.header}},[i.createVNode("div",{class:`${o.value}-title`},[e.title]),e.closable!==!1&&i.createVNode("div",{class:`${o.value}-close`},[i.createVNode(We,{type:"text",icon:i.createVNode(Vt,null,null),size:"small",onClick:()=>{var l;(l=e.onOpenChange)==null||l.call(e,!e.open)}},null)])]),t.default&&i.createVNode("div",{class:le(`${o.value}-content`,e.classNames.content),style:{...e.styles.content}},[(a=t.default)==null?void 0:a.call(t)])]),[[i.vShow,e.open]]):null]}})}}),CM=Object.assign(yM,{Header:bM}),Cv=Symbol("AttachmentContext"),Lc=i.shallowRef(),SM=e=>{i.provide(Cv,e),i.watch(e,()=>{Lc.value=i.unref(e),i.triggerRef(Lc)},{immediate:!0,deep:!0})},oa=()=>i.inject(Cv,i.computed(()=>Lc.value||{})),wM=i.defineComponent({inheritAttrs:!1,props:{value:xt()},setup(e,{slots:t}){return SM(i.computed(()=>e.value)),()=>{var n;return(n=t.default)==null?void 0:n.call(t)}}}),$M=i.defineComponent({name:"AXAttachmentsPlaceholderUploader",__name:"PlaceholderUploader",props:i.mergeDefaults({prefixCls:null,placeholder:null,upload:null,className:null,style:null},{placeholder:()=>({})}),setup(e,{expose:t}){const n=`${e.prefixCls}-placeholder`,o=i.computed(()=>e.placeholder||{}),r=i.useTemplateRef("upload-dragger"),a=oa(),[l,s]=Te(!1),c=()=>{s(!0)},u=m=>{m.currentTarget.contains(m.relatedTarget)||s(!1)},d=()=>{s(!1)};t({nativeElement:r});const f=m=>Array.isArray(m)&&m.every(i.isVNode),p=i.computed(()=>i.isVNode(e.placeholder)||f(e.placeholder)?e.placeholder:i.createVNode(hr,{align:"center",justify:"center",vertical:!0,class:`${n}-inner`},{default:()=>[i.createVNode(Oe.Text,{class:`${n}-icon`},{default:()=>[o.value.icon]}),i.createVNode(Oe.Title,{class:`${n}-title`,level:5},{default:()=>[o.value.title]}),i.createVNode(Oe.Text,{class:`${n}-description`,type:"secondary"},{default:()=>[o.value.description]})]}));return()=>i.createVNode("div",{class:le(n,{[`${n}-drag-in`]:l.value,[`${n}-disabled`]:a.value.disabled},e.className),onDragenter:c,onDragleave:u,onDrop:d,"aria-hidden":a.value.disabled,style:e.style},[i.createVNode(t0.Dragger,i.mergeProps({showUploadList:!1},e.upload,{ref:"upload-dragger",style:{padding:0,border:0,background:"transparent"}}),{default:()=>[p.value]})])}}),Sv=i.defineComponent({name:"AXAttachmentsDropArea",__name:"DropArea",props:{prefixCls:null,className:null,getDropContainer:{type:Function},children:null},setup(e){const t=oa(),[n,o]=Te(),[r,a]=Te(null);i.onMounted(()=>{var c;o((c=e.getDropContainer)==null?void 0:c.call(e))}),i.watch(()=>i.toValue(e.getDropContainer),()=>{var u;const c=(u=e.getDropContainer)==null?void 0:u.call(e);n.value!==c&&o(c)}),i.watch(()=>!!n.value,()=>{if(n.value){const c=()=>{a(!0)},u=p=>{p.preventDefault()},d=p=>{p.relatedTarget||a(!1)},f=p=>{a(!1),p.preventDefault()};document.addEventListener("dragenter",c),document.addEventListener("dragover",u),document.addEventListener("dragleave",d),document.addEventListener("drop",f),i.onWatcherCleanup(()=>{document.removeEventListener("dragenter",c),document.removeEventListener("dragover",u),document.removeEventListener("dragleave",d),document.removeEventListener("drop",f)})}});const l=i.computed(()=>e.getDropContainer&&n.value&&!t.value.disabled),s=`${e.prefixCls}-drop-area`;return()=>l.value?i.createVNode(i.Teleport,{to:n.value},{default:()=>[i.createVNode("div",{class:le(s,e.className,{[`${s}-on-body`]:n.value.tagName==="BODY"}),style:{display:r.value?"block":"none"}},[e.children])]}):null}}),wv=i.defineComponent({name:"AXAttachmentsSilentUploader",__name:"SilentUploader",props:{children:null,upload:null,rootClassName:null},setup(e,{expose:t}){const n=i.useTemplateRef("upload");return t({nativeElement:n}),()=>i.createVNode(t0,i.mergeProps(e.upload,{showUploadList:!1,ref:"upload"}),{default:()=>[e.children]})}}),$v=(e,t)=>{const n=e.__vccOpts||e;for(const[o,r]of t)n[o]=r;return n},xM={},OM={width:"1em",height:"1em",viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"};function PM(e,t){return i.openBlock(),i.createElementBlock("svg",OM,t[0]||(t[0]=[i.createElementVNode("title",null,"audio",-1),i.createElementVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[i.createElementVNode("path",{d:"M14.1178571,4.0125 C14.225,4.11964286 14.2857143,4.26428571 14.2857143,4.41607143 L14.2857143,15.4285714 C14.2857143,15.7446429 14.0303571,16 13.7142857,16 L2.28571429,16 C1.96964286,16 1.71428571,15.7446429 1.71428571,15.4285714 L1.71428571,0.571428571 C1.71428571,0.255357143 1.96964286,0 2.28571429,0 L9.86964286,0 C10.0214286,0 10.1678571,0.0607142857 10.275,0.167857143 L14.1178571,4.0125 Z M10.7315824,7.11216117 C10.7428131,7.15148751 10.7485063,7.19218979 10.7485063,7.23309113 L10.7485063,8.07742614 C10.7484199,8.27364959 10.6183424,8.44607275 10.4296853,8.50003683 L8.32984514,9.09986306 L8.32984514,11.7071803 C8.32986605,12.5367078 7.67249692,13.217028 6.84345686,13.2454634 L6.79068592,13.2463395 C6.12766108,13.2463395 5.53916361,12.8217001 5.33010655,12.1924966 C5.1210495,11.563293 5.33842118,10.8709227 5.86959669,10.4741173 C6.40077221,10.0773119 7.12636292,10.0652587 7.67042486,10.4442027 L7.67020842,7.74937024 L7.68449368,7.74937024 C7.72405122,7.59919041 7.83988806,7.48101083 7.98924584,7.4384546 L10.1880418,6.81004755 C10.42156,6.74340323 10.6648954,6.87865515 10.7315824,7.11216117 Z M9.60714286,1.31785714 L12.9678571,4.67857143 L9.60714286,4.67857143 L9.60714286,1.31785714 Z",fill:"currentColor"})],-1)]))}const IM=$v(xM,[["render",PM]]),NM={},TM={width:"1em",height:"1em",viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"};function EM(e,t){return i.openBlock(),i.createElementBlock("svg",TM,t[0]||(t[0]=[i.createElementVNode("title",null,"video",-1),i.createElementVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[i.createElementVNode("path",{d:"M14.1178571,4.0125 C14.225,4.11964286 14.2857143,4.26428571 14.2857143,4.41607143 L14.2857143,15.4285714 C14.2857143,15.7446429 14.0303571,16 13.7142857,16 L2.28571429,16 C1.96964286,16 1.71428571,15.7446429 1.71428571,15.4285714 L1.71428571,0.571428571 C1.71428571,0.255357143 1.96964286,0 2.28571429,0 L9.86964286,0 C10.0214286,0 10.1678571,0.0607142857 10.275,0.167857143 L14.1178571,4.0125 Z M12.9678571,4.67857143 L9.60714286,1.31785714 L9.60714286,4.67857143 L12.9678571,4.67857143 Z M10.5379461,10.3101106 L6.68957555,13.0059749 C6.59910784,13.0693494 6.47439406,13.0473861 6.41101953,12.9569184 C6.3874624,12.9232903 6.37482581,12.8832269 6.37482581,12.8421686 L6.37482581,7.45043999 C6.37482581,7.33998304 6.46436886,7.25043999 6.57482581,7.25043999 C6.61588409,7.25043999 6.65594753,7.26307658 6.68957555,7.28663371 L10.5379461,9.98249803 C10.6284138,10.0458726 10.6503772,10.1705863 10.5870027,10.2610541 C10.5736331,10.2801392 10.5570312,10.2967411 10.5379461,10.3101106 Z",fill:"currentColor"})],-1)]))}const RM=$v(NM,[["render",EM]]),MM=e=>e.indexOf("image/")===0,ra=200;function AM(e){return new Promise(t=>{if(!e||!e.type||!MM(e.type)){t("");return}const n=new Image;if(n.onload=()=>{const{width:o,height:r}=n,a=o/r,l=a>1?ra:ra*a,s=a>1?ra/a:ra,c=document.createElement("canvas");c.width=l,c.height=s,c.style.cssText=`position: fixed; left: 0; top: 0; width: ${l}px; height: ${s}px; z-index: 9999; display: none;`,document.body.appendChild(c),c.getContext("2d").drawImage(n,0,0,l,s);const d=c.toDataURL();document.body.removeChild(c),window.URL.revokeObjectURL(n.src),t(d)},n.crossOrigin="anonymous",e.type.startsWith("image/svg+xml")){const o=new FileReader;o.onload=()=>{o.result&&typeof o.result=="string"&&(n.src=o.result)},o.readAsDataURL(e)}else if(e.type.startsWith("image/gif")){const o=new FileReader;o.onload=()=>{o.result&&t(o.result)},o.readAsDataURL(e)}else n.src=window.URL.createObjectURL(e)})}const De=Math.round;function Bc(e,t){const n=e.replace(/^[^(]*\((.*)/,"$1").replace(/\).*/,"").match(/\d*\.?\d+%?/g)||[],o=n.map(r=>parseFloat(r));for(let r=0;r<3;r+=1)o[r]=t(o[r]||0,n[r]||"",r);return n[3]?o[3]=n[3].includes("%")?o[3]/100:o[3]:o[3]=1,o}const xv=(e,t,n)=>n===0?e:e/100;function xr(e,t){const n=t||255;return e>n?n:e<0?0:e}class zc{constructor(t){Ge(this,"isValid",!0),Ge(this,"r",0),Ge(this,"g",0),Ge(this,"b",0),Ge(this,"a",1),Ge(this,"_h",void 0),Ge(this,"_s",void 0),Ge(this,"_l",void 0),Ge(this,"_v",void 0),Ge(this,"_max",void 0),Ge(this,"_min",void 0),Ge(this,"_brightness",void 0);function n(o){return o[0]in t&&o[1]in t&&o[2]in t}if(t)if(typeof t=="string"){let r=function(a){return o.startsWith(a)};const o=t.trim();/^#?[A-F\d]{3,8}$/i.test(o)?this.fromHexString(o):r("rgb")?this.fromRgbString(o):r("hsl")?this.fromHslString(o):(r("hsv")||r("hsb"))&&this.fromHsvString(o)}else if(t instanceof zc)this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this._h=t._h,this._s=t._s,this._l=t._l,this._v=t._v;else if(n("rgb"))this.r=xr(t.r),this.g=xr(t.g),this.b=xr(t.b),this.a=typeof t.a=="number"?xr(t.a,1):1;else if(n("hsl"))this.fromHsl(t);else if(n("hsv"))this.fromHsv(t);else throw new Error("@ant-design/fast-color: unsupported input "+JSON.stringify(t))}setR(t){return this._sc("r",t)}setG(t){return this._sc("g",t)}setB(t){return this._sc("b",t)}setA(t){return this._sc("a",t,1)}setHue(t){const n=this.toHsv();return n.h=t,this._c(n)}getLuminance(){function t(a){const l=a/255;return l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4)}const n=t(this.r),o=t(this.g),r=t(this.b);return .2126*n+.7152*o+.0722*r}getHue(){if(typeof this._h>"u"){const t=this.getMax()-this.getMin();t===0?this._h=0:this._h=De(60*(this.r===this.getMax()?(this.g-this.b)/t+(this.g<this.b?6:0):this.g===this.getMax()?(this.b-this.r)/t+2:(this.r-this.g)/t+4))}return this._h}getSaturation(){if(typeof this._s>"u"){const t=this.getMax()-this.getMin();t===0?this._s=0:this._s=t/this.getMax()}return this._s}getLightness(){return typeof this._l>"u"&&(this._l=(this.getMax()+this.getMin())/510),this._l}getValue(){return typeof this._v>"u"&&(this._v=this.getMax()/255),this._v}getBrightness(){return typeof this._brightness>"u"&&(this._brightness=(this.r*299+this.g*587+this.b*114)/1e3),this._brightness}darken(t=10){const n=this.getHue(),o=this.getSaturation();let r=this.getLightness()-t/100;return r<0&&(r=0),this._c({h:n,s:o,l:r,a:this.a})}lighten(t=10){const n=this.getHue(),o=this.getSaturation();let r=this.getLightness()+t/100;return r>1&&(r=1),this._c({h:n,s:o,l:r,a:this.a})}mix(t,n=50){const o=this._c(t),r=n/100,a=s=>(o[s]-this[s])*r+this[s],l={r:De(a("r")),g:De(a("g")),b:De(a("b")),a:De(a("a")*100)/100};return this._c(l)}tint(t=10){return this.mix({r:255,g:255,b:255,a:1},t)}shade(t=10){return this.mix({r:0,g:0,b:0,a:1},t)}onBackground(t){const n=this._c(t),o=this.a+n.a*(1-this.a),r=a=>De((this[a]*this.a+n[a]*n.a*(1-this.a))/o);return this._c({r:r("r"),g:r("g"),b:r("b"),a:o})}isDark(){return this.getBrightness()<128}isLight(){return this.getBrightness()>=128}equals(t){return this.r===t.r&&this.g===t.g&&this.b===t.b&&this.a===t.a}clone(){return this._c(this)}toHexString(){let t="#";const n=(this.r||0).toString(16);t+=n.length===2?n:"0"+n;const o=(this.g||0).toString(16);t+=o.length===2?o:"0"+o;const r=(this.b||0).toString(16);if(t+=r.length===2?r:"0"+r,typeof this.a=="number"&&this.a>=0&&this.a<1){const a=De(this.a*255).toString(16);t+=a.length===2?a:"0"+a}return t}toHsl(){return{h:this.getHue(),s:this.getSaturation(),l:this.getLightness(),a:this.a}}toHslString(){const t=this.getHue(),n=De(this.getSaturation()*100),o=De(this.getLightness()*100);return this.a!==1?`hsla(${t},${n}%,${o}%,${this.a})`:`hsl(${t},${n}%,${o}%)`}toHsv(){return{h:this.getHue(),s:this.getSaturation(),v:this.getValue(),a:this.a}}toRgb(){return{r:this.r,g:this.g,b:this.b,a:this.a}}toRgbString(){return this.a!==1?`rgba(${this.r},${this.g},${this.b},${this.a})`:`rgb(${this.r},${this.g},${this.b})`}toString(){return this.toRgbString()}_sc(t,n,o){const r=this.clone();return r[t]=xr(n,o),r}_c(t){return new this.constructor(t)}getMax(){return typeof this._max>"u"&&(this._max=Math.max(this.r,this.g,this.b)),this._max}getMin(){return typeof this._min>"u"&&(this._min=Math.min(this.r,this.g,this.b)),this._min}fromHexString(t){const n=t.replace("#","");function o(r,a){return parseInt(n[r]+n[a||r],16)}n.length<6?(this.r=o(0),this.g=o(1),this.b=o(2),this.a=n[3]?o(3)/255:1):(this.r=o(0,1),this.g=o(2,3),this.b=o(4,5),this.a=n[6]?o(6,7)/255:1)}fromHsl({h:t,s:n,l:o,a:r}){if(this._h=t%360,this._s=n,this._l=o,this.a=typeof r=="number"?r:1,n<=0){const p=De(o*255);this.r=p,this.g=p,this.b=p}let a=0,l=0,s=0;const c=t/60,u=(1-Math.abs(2*o-1))*n,d=u*(1-Math.abs(c%2-1));c>=0&&c<1?(a=u,l=d):c>=1&&c<2?(a=d,l=u):c>=2&&c<3?(l=u,s=d):c>=3&&c<4?(l=d,s=u):c>=4&&c<5?(a=d,s=u):c>=5&&c<6&&(a=u,s=d);const f=o-u/2;this.r=De((a+f)*255),this.g=De((l+f)*255),this.b=De((s+f)*255)}fromHsv({h:t,s:n,v:o,a:r}){this._h=t%360,this._s=n,this._v=o,this.a=typeof r=="number"?r:1;const a=De(o*255);if(this.r=a,this.g=a,this.b=a,n<=0)return;const l=t/60,s=Math.floor(l),c=l-s,u=De(o*(1-n)*255),d=De(o*(1-n*c)*255),f=De(o*(1-n*(1-c))*255);switch(s){case 0:this.g=f,this.b=u;break;case 1:this.r=d,this.b=u;break;case 2:this.r=u,this.b=f;break;case 3:this.r=u,this.g=d;break;case 4:this.r=f,this.g=u;break;case 5:default:this.g=u,this.b=d;break}}fromHsvString(t){const n=Bc(t,xv);this.fromHsv({h:n[0],s:n[1],v:n[2],a:n[3]})}fromHslString(t){const n=Bc(t,xv);this.fromHsl({h:n[0],s:n[1],l:n[2],a:n[3]})}fromRgbString(t){const n=Bc(t,(o,r)=>r.includes("%")?De(o/100*255):o);this.r=n[0],this.g=n[1],this.b=n[2],this.a=n[3]}}const VM=e=>{const{componentCls:t,calc:n}=e,o=`${t}-list-card`,r=n(e.fontSize).mul(e.lineHeight).mul(2).add(e.paddingSM).add(e.paddingSM).equal();return{[o]:{borderRadius:e.borderRadius,position:"relative",background:e.colorFillContent,borderWidth:e.lineWidth,borderStyle:"solid",borderColor:"transparent",flex:"none",[`${o}-name,${o}-desc`]:{display:"flex",flexWrap:"nowrap",maxWidth:"100%"},[`${o}-ellipsis-prefix`]:{flex:"0 1 auto",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},[`${o}-ellipsis-suffix`]:{flex:"none"},"&-type-overview":{padding:n(e.paddingSM).sub(e.lineWidth).equal(),paddingInlineStart:n(e.padding).add(e.lineWidth).equal(),display:"flex",flexWrap:"nowrap",gap:e.paddingXS,alignItems:"flex-start",width:236,[`${o}-icon`]:{fontSize:n(e.fontSizeLG).mul(2).equal(),lineHeight:1,paddingTop:n(e.paddingXXS).mul(1.5).equal(),flex:"none"},[`${o}-content`]:{flex:"auto",minWidth:0,display:"flex",flexDirection:"column",alignItems:"stretch"},[`${o}-desc`]:{color:e.colorTextTertiary}},"&-type-preview":{width:r,height:r,lineHeight:1,[`&:not(${o}-status-error)`]:{border:0},img:{width:"100%",height:"100%",verticalAlign:"top",objectFit:"cover",borderRadius:"inherit"},[`${o}-img-mask`]:{position:"absolute",inset:0,display:"flex",justifyContent:"center",alignItems:"center",background:`rgba(0, 0, 0, ${e.opacityLoading})`,borderRadius:"inherit"},[`&${o}-status-error`]:{[`img, ${o}-img-mask`]:{borderRadius:n(e.borderRadius).sub(e.lineWidth).equal()},[`${o}-desc`]:{paddingInline:e.paddingXXS}},[`${o}-progress`]:{}},[`${o}-remove`]:{position:"absolute",top:0,insetInlineEnd:0,border:0,padding:e.paddingXXS,background:"transparent",lineHeight:1,transform:"translate(50%, -50%)",fontSize:e.fontSize,cursor:"pointer",opacity:e.opacityLoading,display:"none","&:dir(rtl)":{transform:"translate(-50%, -50%)"},"&:hover":{opacity:1},"&:active":{opacity:e.opacityLoading}},[`&:hover ${o}-remove`]:{display:"block"},"&-status-error":{borderColor:e.colorError,[`${o}-desc`]:{color:e.colorError}},"&-motion":{overflow:"hidden",transition:["opacity","width","margin","padding"].map(a=>`${a} ${e.motionDurationSlow}`).join(","),[`${o}-remove`]:{display:"none !important"},"&-appear-start":{width:0,transition:"none"},"&-leave-active":{opacity:0,width:0,paddingInline:0,borderInlineWidth:0,marginInlineEnd:n(e.paddingSM).mul(-1).equal()}}}}},jc={"&, *":{boxSizing:"border-box"}},DM=e=>{const{componentCls:t,calc:n,antCls:o}=e,r=`${t}-drop-area`,a=`${t}-placeholder`;return{[r]:{position:"absolute",inset:0,zIndex:e.zIndexPopupBase,...jc,"&-on-body":{position:"fixed",inset:0},"&-hide-placement":{[`${a}-inner`]:{display:"none"}},[a]:{padding:0}},"&":{[a]:{height:"100%",borderRadius:e.borderRadius,borderWidth:e.lineWidthBold,borderStyle:"dashed",borderColor:"transparent",padding:e.padding,position:"relative",backdropFilter:"blur(10px)",...jc,[`${o}-upload-wrapper ${o}-upload${o}-upload-btn`]:{padding:0},[`&${a}-drag-in`]:{borderColor:e.colorPrimaryHover},[`&${a}-disabled`]:{opacity:.25,pointerEvents:"none"},[`${a}-inner`]:{gap:n(e.paddingXXS).div(2).equal()},[`${a}-icon`]:{fontSize:e.fontSizeHeading2,lineHeight:1},[`${a}-title${a}-title`]:{margin:0,fontSize:e.fontSize,lineHeight:e.lineHeight},[`${a}-description`]:{}}}}},LM=e=>{const{componentCls:t,calc:n}=e,o=`${t}-list`,r=n(e.fontSize).mul(e.lineHeight).mul(2).add(e.paddingSM).add(e.paddingSM).equal();return{[t]:{position:"relative",width:"100%",...jc,[o]:{display:"flex",flexWrap:"wrap",gap:e.paddingSM,fontSize:e.fontSize,lineHeight:e.lineHeight,color:e.colorText,paddingBlock:e.paddingSM,paddingInline:e.padding,width:"100%",background:e.colorBgContainer,scrollbarWidth:"none","-ms-overflow-style":"none","&::-webkit-scrollbar":{display:"none"},"&-overflow-scrollX, &-overflow-scrollY":{"&:before, &:after":{content:'""',position:"absolute",opacity:0,transition:`opacity ${e.motionDurationSlow}`,zIndex:1}},"&-overflow-ping-start:before":{opacity:1},"&-overflow-ping-end:after":{opacity:1},"&-overflow-scrollX":{overflowX:"auto",overflowY:"hidden",flexWrap:"nowrap","&:before, &:after":{insetBlock:0,width:8},"&:before":{insetInlineStart:0,background:"linear-gradient(to right, rgba(0,0,0,0.06), rgba(0,0,0,0));"},"&:after":{insetInlineEnd:0,background:"linear-gradient(to left, rgba(0,0,0,0.06), rgba(0,0,0,0));"},"&:dir(rtl)":{"&:before":{background:"linear-gradient(to left, rgba(0,0,0,0.06), rgba(0,0,0,0));"},"&:after":{background:"linear-gradient(to right, rgba(0,0,0,0.06), rgba(0,0,0,0));"}}},"&-overflow-scrollY":{overflowX:"hidden",overflowY:"auto",maxHeight:n(r).mul(3).equal(),"&:before, &:after":{insetInline:0,height:8},"&:before":{insetBlockStart:0,background:"linear-gradient(to bottom, rgba(0,0,0,0.06), rgba(0,0,0,0));"},"&:after":{insetBlockEnd:0,background:"linear-gradient(to top, rgba(0,0,0,0.06), rgba(0,0,0,0));"}},"&-upload-btn":{width:r,height:r,fontSize:e.fontSizeHeading2,color:"#999"},"&-prev-btn, &-next-btn":{position:"absolute",top:"50%",transform:"translateY(-50%)",boxShadow:e.boxShadowTertiary,opacity:0,pointerEvents:"none"},"&-prev-btn":{left:{_skip_check_:!0,value:e.padding}},"&-next-btn":{right:{_skip_check_:!0,value:e.padding}},"&:dir(ltr)":{[`&${o}-overflow-ping-start ${o}-prev-btn`]:{opacity:1,pointerEvents:"auto"},[`&${o}-overflow-ping-end ${o}-next-btn`]:{opacity:1,pointerEvents:"auto"}},"&:dir(rtl)":{[`&${o}-overflow-ping-end ${o}-prev-btn`]:{opacity:1,pointerEvents:"auto"},[`&${o}-overflow-ping-start ${o}-next-btn`]:{opacity:1,pointerEvents:"auto"}}}}}},Ov=an("Attachments",e=>{const t=wt(e,{});return[DM(t),LM(t),VM(t)]},e=>{const{colorBgContainer:t}=e;return{colorBgPlaceholderHover:new zc(t).setA(.85).toRgbString()}}),Fc=" ",Hc="#8c8c8c",Pv=i.defineComponent({name:"AXAttachmentsFileListCard",__name:"FileListCard",props:{prefixCls:null,item:null,onRemove:{type:Function},className:null,style:null,imageProps:null},setup(e,{expose:t}){i.toRef(e,"prefixCls");const n=["png","jpg","jpeg","gif","bmp","webp","svg"],o=[{icon:i.createVNode(lc,null,null),color:"#22b35e",ext:["xlsx","xls"]},{icon:i.createVNode(sc,null,null),color:Hc,ext:n},{icon:i.createVNode(cc,null,null),color:Hc,ext:["md","mdx"]},{icon:i.createVNode(uc,null,null),color:"#ff4d4f",ext:["pdf"]},{icon:i.createVNode(dc,null,null),color:"#ff6e31",ext:["ppt","pptx"]},{icon:i.createVNode(pc,null,null),color:"#1677ff",ext:["doc","docx"]},{icon:i.createVNode(mc,null,null),color:"#fab714",ext:["zip","rar","7z","tar","gz"]},{icon:i.createVNode(RM,null,null),color:"#ff4d4f",ext:["mp4","avi","mov","wmv","flv","mkv"]},{icon:i.createVNode(IM,null,null),color:"#8c8c8c",ext:["mp3","wav","flac","ape","aac","ogg"]}];function r(A,j){return j.some(O=>A.toLowerCase()===`.${O}`)}function a(A){let j=A;const O=["B","KB","MB","GB","TB","PB","EB"];let N=0;for(;j>=1024&&N<O.length-1;)j/=1024,N++;return`${j.toFixed(0)} ${O[N]}`}const l=oa(),s=i.computed(()=>l.value.disabled),c=i.computed(()=>e.item.name),u=i.computed(()=>e.item.size),d=i.computed(()=>e.item.percent),f=i.computed(()=>e.item.status||"done"),p=i.computed(()=>e.item.description),{getPrefixCls:m}=Xe(),v=i.computed(()=>m("attachment",e.prefixCls)),g=`${v.value}-list-card`,[y,b,S]=Ov(v),$=i.useTemplateRef("file-list-card-container"),x=i.computed(()=>{const A=c.value||"",j=A.match(/^(.*)\.[^.]+$/);return{namePrefix:j?j[1]:A,nameSuffix:j?A.slice(j[1].length):""}}),w=i.computed(()=>r(x.value.nameSuffix,n)),P=i.computed(()=>p.value?p.value:f.value==="uploading"?`${d.value||0}%`:f.value==="error"?e.item.response||Fc:u.value?a(u.value):Fc),C=i.computed(()=>{for(const{ext:A,icon:j,color:O}of o)if(r(x.value.nameSuffix,A))return{icon:j,iconColor:O};return{icon:i.createVNode(fc,{key:"defaultIcon"},null),iconColor:Hc}}),[I,M]=Te();i.watch(()=>e.item.originFileObj,()=>{if(e.item.originFileObj){let A=!0;AM(e.item.originFileObj).then(j=>{A&&M(j)}),i.onWatcherCleanup(()=>{A=!1})}M(void 0)},{immediate:!0});const E=i.computed(()=>e.item.thumbUrl||e.item.url||I.value),R=i.computed(()=>w.value&&(e.item.originFileObj||E.value)),z=i.computed(()=>R.value?i.createVNode(i.Fragment,null,[E.value&&i.createVNode(Pn,i.mergeProps(e.imageProps,{alt:"preview",src:E.value}),null),f.value!=="done"&&i.createVNode("div",{class:`${g}-img-mask`},[f.value==="uploading"&&d.value!==void 0&&i.createVNode(Vh,{percent:d.value,prefixCls:g},null),f.value==="error"&&i.createVNode("div",{class:`${g}-desc`},[i.createVNode("div",{class:`${g}-ellipsis-prefix`},[P.value])])])]):i.createVNode(i.Fragment,null,[i.createVNode("div",{class:`${g}-icon`,style:{color:C.value.iconColor}},[C.value.icon]),i.createVNode("div",{class:`${g}-content`},[i.createVNode("div",{class:`${g}-name`},[i.createVNode("div",{class:`${g}-ellipsis-prefix`},[x.value.namePrefix??Fc]),i.createVNode("div",{class:`${g}-ellipsis-suffix`},[x.value.nameSuffix])]),i.createVNode("div",{class:`${g}-desc`},[i.createVNode("div",{class:`${g}-ellipsis-prefix`},[P.value])])])]));return t({nativeElement:$}),()=>y(i.createVNode("div",{class:le(g,{[`${g}-status-${f.value}`]:f.value,[`${g}-type-preview`]:R.value,[`${g}-type-overview`]:!R.value},e.className,b.value,S),style:e.style,ref:"file-list-card-container"},[z.value,!s.value&&e.onRemove&&i.createVNode("button",{type:"button",class:`${g}-remove`,onClick:()=>{e.onRemove(e.item)}},[i.createVNode(pt,null,null)])]))}}),Iv=1,BM=i.defineComponent({name:"AXAttachmentsFileList",__name:"FileList",props:{prefixCls:null,items:null,onRemove:{type:Function},overflow:null,upload:null,imageProps:null,listClassName:null,listStyle:null,itemClassName:null,itemStyle:null},setup(e){const t=i.computed(()=>`${e.prefixCls}-list`),n=i.useTemplateRef("file-list-container"),[o,r]=Te(!1),a=oa();i.watchEffect(()=>{r(!0),i.onWatcherCleanup(()=>{r(!1)})});const[l,s]=Te(!1),[c,u]=Te(!1),d=()=>{const v=n.value;v&&(e.overflow==="scrollX"?(s(Math.abs(v.scrollLeft)>=Iv),u(v.scrollWidth-v.clientWidth-Math.abs(v.scrollLeft)>=Iv)):e.overflow==="scrollY"&&(s(v.scrollTop!==0),u(v.scrollHeight-v.clientHeight!==v.scrollTop)))};i.watch([()=>e.overflow,()=>e.items.length],()=>{i.nextTick(()=>{d()})},{immediate:!0});const f=v=>{const g=n.value;g&&g.scrollTo({left:g.scrollLeft+v*g.clientWidth,behavior:"smooth"})},p=()=>{f(-1)},m=()=>{f(1)};return()=>i.createVNode("div",{class:le(t.value,{[`${t.value}-overflow-${e.overflow}`]:e.overflow,[`${t.value}-overflow-ping-start`]:l.value,[`${t.value}-overflow-ping-end`]:c.value},e.listClassName),ref:"file-list-container",onScroll:d,style:e.listStyle},[e.items.map(v=>i.createVNode(Pv,{key:v.uid,prefixCls:e.prefixCls,item:v,onRemove:e.onRemove,className:le(e.itemClassName),imageProps:e.imageProps,style:{...e.itemStyle}},null)),!a.value.disabled&&i.createVNode(wv,{upload:e.upload,children:i.createVNode(We,{class:`${t.value}-upload-btn`,type:"dashed"},{default:()=>[i.createVNode(bs,{class:`${t.value}-upload-btn-icon`},null)]})},null),e.overflow==="scrollX"&&i.createVNode(i.Fragment,null,[i.createVNode(We,{size:"small",shape:"circle",class:`${t.value}-prev-btn`,icon:i.createVNode(so,null,null),onClick:p},null),i.createVNode(We,{size:"small",shape:"circle",class:`${t.value}-next-btn`,icon:i.createVNode(Zt,null,null),onClick:m},null)])])}}),zM=i.defineComponent({name:"AXAttachments",__name:"Attachments",props:i.mergeDefaults({capture:null,type:null,name:null,defaultFileList:null,action:null,directory:null,data:null,method:null,headers:null,showUploadList:null,multiple:null,accept:null,beforeUpload:null,onChange:{type:Function},"onUpdate:fileList":null,onDrop:null,listType:null,onPreview:null,onDownload:null,onReject:null,onRemove:null,remove:null,supportServerRender:null,disabled:{type:Boolean},prefixCls:null,customRequest:null,withCredentials:null,openFileDialogOnClick:null,locale:null,id:null,previewFile:null,transformFile:null,iconRender:null,isImageUrl:null,progress:null,itemRender:null,maxCount:null,height:null,removeIcon:null,downloadIcon:null,previewIcon:null,rootClassName:null,rootStyle:null,style:null,className:null,classNames:null,styles:null,children:null,placeholder:{type:Function},getDropContainer:{type:Function},items:null,overflow:null,imageProps:null},{items:()=>[],classNames:()=>({}),styles:()=>({})}),setup(e,{expose:t}){const n=He(e,["prefixCls","rootClassName","rootStyle","className","style","items","children","getDropContainer","placeholder","onChange","onRemove","overflow","imageProps","disabled","classNames","styles"]);i.toRef(e,"prefixCls");const o=i.useSlots(),{getPrefixCls:r,direction:a}=Xe(),l=r("attachment",e.prefixCls),s=on("attachments"),c=i.computed(()=>s.value.classNames),u=i.computed(()=>s.value.styles),d=i.useTemplateRef("attachments-container"),f=i.useTemplateRef("attachments-upload"),[p,m,v]=Ov(l),g=i.computed(()=>le(m.value,v)),[y,b]=Te(e.items);i.watch(()=>e.items,()=>{b(e.items)});const S=C=>{var I;b(C.fileList),(I=e.onChange)==null||I.call(e,C)},$=i.computed(()=>({...n,fileList:y.value,onChange:S})),x=C=>Promise.resolve(typeof e.onRemove=="function"?e.onRemove(C):e.onRemove).then(I=>{if(I===!1)return;const M=y.value.filter(E=>E.uid!==C.uid);S({file:{...C,status:"removed"},fileList:M})}),w=(C,I,M)=>{const E=o.placeholder?o.placeholder({type:C}):typeof e.placeholder=="function"?e.placeholder(C):e.placeholder;return i.createVNode($M,{placeholder:E,upload:$.value,prefixCls:l,className:le(c.value.placeholder,e.classNames.placeholder),style:{...u.value.placeholder,...e.styles.placeholder,...I==null?void 0:I.style}},null)},P=i.computed(()=>y.value.length>0);return t({nativeElement:d.value,upload:C=>{var M,E;const I=(E=(M=f.value)==null?void 0:M.nativeElement)==null?void 0:E.querySelector('input[type="file"]');if(I){const R=new DataTransfer;R.items.add(C),I.files=R.files,I.dispatchEvent(new Event("change",{bubbles:!0}))}}}),()=>p(i.createVNode(wM,{value:{disabled:e.disabled}},{default:()=>[e.children?i.createVNode(i.Fragment,null,[i.createVNode(wv,{upload:$.value,rootClassName:e.rootClassName,ref:"attachments-upload",children:e.children},null),i.createVNode(Sv,{getDropContainer:e.getDropContainer,prefixCls:l,className:le(g.value,e.rootClassName),children:w("drop")},null)]):i.createVNode("div",{class:le(l,g.value,{[`${l}-rtl`]:a.value==="rtl"},e.className,e.rootClassName),style:{...e.rootStyle,...e.style},dir:a.value||"ltr",ref:"attachments-container"},[i.createVNode(BM,{prefixCls:l,items:y.value,onRemove:x,overflow:e.overflow,upload:$.value,listClassName:le(c.value.list,e.classNames.list),listStyle:{...u.value.list,...e.styles.list,...!P.value&&{display:"none"}},itemClassName:le(c.value.item,e.classNames.item),itemStyle:{...u.value.item,...e.styles.item},imageProps:e.imageProps},null),w("inline",P.value?{style:{display:"none"}}:{},f.value),i.createVNode(Sv,{getDropContainer:e.getDropContainer||(()=>d.value),prefixCls:l,className:g.value,children:w("drop")},null)])]}))}}),jM=Object.assign(zM,{FileCard:Pv}),FM=(e,t,n)=>{const o=i.computed(()=>{const s=i.toValue(e);let c={expandedKeys:[],onExpand:()=>{}};return s?(typeof s=="object"&&(c={...c,...s}),{enableCollapse:!0,customizeExpandedKeys:c.expandedKeys,customizeOnExpand:c.onExpand}):{enableCollapse:!1,customizeExpandedKeys:c.expandedKeys,customizeOnExpand:c.onExpand}}),[r,a]=Te(o.value.customizeExpandedKeys),l=s=>{var u,d;if(!o.value.enableCollapse)return;const c=r.value.includes(s)?r.value.filter(f=>f!==s):[...r.value,s];(d=(u=o.value).customizeOnExpand)==null||d.call(u,c),a(c)};return[i.computed(()=>o.value.enableCollapse),r,l]};var ia=(e=>(e.PENDING="pending",e.SUCCESS="success",e.ERROR="error",e))(ia||{});const HM=e=>{const{componentCls:t}=e,n=`${t}-item`,o={[ia.PENDING]:e.colorPrimaryText,[ia.SUCCESS]:e.colorSuccessText,[ia.ERROR]:e.colorErrorText},r=Object.keys(o);return r.reduce((a,l)=>{const s=o[l];return r.forEach(c=>{const u=`& ${n}-${l}-${c}`,d=l===c?{}:{backgroundColor:"none !important",backgroundImage:`linear-gradient(${s}, ${o[c]})`};a[u]={[`& ${n}-icon, & > *::before`]:{backgroundColor:`${s} !important`},"& > :last-child::before":d}}),a},{})},_M=e=>{const{calc:t,componentCls:n}=e,o=`${n}-item`,r={content:'""',width:t(e.lineWidth).mul(2).equal(),display:"block",position:"absolute",insetInlineEnd:"none",backgroundColor:e.colorTextPlaceholder};return{"& > :last-child > :last-child":{"&::before":{display:"none !important"},[`&${o}-footer`]:{"&::before":{display:"block !important",bottom:0}}},[`& > ${o}`]:{[`& ${o}-header, & ${o}-content, & ${o}-footer`]:{position:"relative","&::before":{bottom:t(e.itemGap).mul(-1).equal()}},[`& ${o}-header, & ${o}-content`]:{marginInlineStart:t(e.itemSize).mul(-1).equal(),"&::before":{...r,insetInlineStart:t(e.itemSize).div(2).sub(e.lineWidth).equal()}},[`& ${o}-header::before`]:{top:e.itemSize,bottom:t(e.itemGap).mul(-2).equal()},[`& ${o}-content::before`]:{top:"100%"},[`& ${o}-footer::before`]:{...r,top:0,insetInlineStart:t(e.itemSize).div(-2).sub(e.lineWidth).equal()}}}},kM=e=>{const{componentCls:t}=e,n=`${t}-item`;return{[n]:{display:"flex",flexDirection:"column",[`& ${n}-collapsible`]:{cursor:"pointer"},[`& ${n}-header`]:{display:"flex",marginBottom:e.itemGap,gap:e.itemGap,alignItems:"flex-start",[`& ${n}-icon`]:{height:e.itemSize,width:e.itemSize,fontSize:e.itemFontSize,display:"flex",justifyContent:"center",alignItems:"center"},[`& ${n}-extra`]:{height:e.itemSize,maxHeight:e.itemSize},[`& ${n}-header-box`]:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden",[`& ${n}-title`]:{height:e.itemSize,lineHeight:`${mt(e.itemSize)}`,maxHeight:e.itemSize,fontSize:e.itemFontSize,[`& ${n}-collapse-icon`]:{marginInlineEnd:e.marginXS}},[`& ${n}-desc`]:{fontSize:e.itemFontSize}}},[`& ${n}-content`]:{[`& ${n}-content-hidden`]:{display:"none"},[`& ${n}-content-box`]:{padding:e.itemGap,display:"inline-block",maxWidth:`calc(100% - ${e.itemSize})`,borderRadius:e.borderRadiusLG,backgroundColor:e.colorBgContainer,border:`${mt(e.lineWidth)} ${e.lineType} ${e.colorBorderSecondary}`}},[`& ${n}-footer`]:{marginTop:e.itemGap,display:"inline-flex"}}}},_c=(e,t="middle")=>{const{componentCls:n}=e,o={large:{itemSize:e.itemSizeLG,itemGap:e.itemGapLG,itemFontSize:e.itemFontSizeLG},middle:{itemSize:e.itemSize,itemGap:e.itemGap,itemFontSize:e.itemFontSize},small:{itemSize:e.itemSizeSM,itemGap:e.itemGapSM,itemFontSize:e.itemFontSizeSM}}[t];return{[`&${n}-${t}`]:{paddingInlineStart:o.itemSize,gap:o.itemGap,...kM({...e,...o}),..._M({...e,...o})}}},WM=e=>{const{componentCls:t}=e;return{[t]:{display:"flex",flexDirection:"column",...HM(e),..._c(e),..._c(e,"large"),..._c(e,"small"),[`&${t}-rtl`]:{direction:"rtl"}}}},UM=an("ThoughtChain",e=>{const t=wt(e,{itemFontSizeSM:e.fontSizeSM,itemSizeSM:e.calc(e.controlHeightXS).add(e.controlHeightSM).div(2).equal(),itemGapSM:e.marginSM,itemFontSize:e.fontSize,itemSize:e.calc(e.controlHeightSM).add(e.controlHeight).div(2).equal(),itemGap:e.margin,itemFontSizeLG:e.fontSizeLG,itemSizeLG:e.calc(e.controlHeight).add(e.controlHeightLG).div(2).equal(),itemGapLG:e.marginLG});return[WM(t),bv(t)]}),Nv=Symbol("ThoughtChainNodeContext"),kc=i.shallowRef(),XM=e=>{i.provide(Nv,e),i.watch(e,()=>{kc.value=i.unref(e),i.triggerRef(kc)},{immediate:!0,deep:!0})},KM=()=>i.inject(Nv,i.computed(()=>kc.value||{})),GM=i.defineComponent({props:{value:xt()},setup(e,{slots:t}){return XM(i.computed(()=>e.value)),()=>{var n;return(n=t.default)==null?void 0:n.call(t)}}}),qM=i.defineComponent({name:"AXThoughtChainNode",__name:"item",props:i.mergeDefaults({info:null,nextStatus:null,onClick:{type:Function}},{info:()=>({})}),setup(e){const t=He(e,["info","nextStatus","onClick"]),n=i.computed(()=>vo(t,{attr:!0,aria:!0,data:!0})),o=KM(),r=i.computed(()=>o.value.prefixCls),a=i.computed(()=>o.value.enableCollapse),l=i.computed(()=>o.value.expandedKeys),s=i.computed(()=>o.value.direction),c=i.computed(()=>o.value.classNames),u=i.computed(()=>o.value.styles),d=i.useId(),f=i.computed(()=>e.info.key??d),p=i.computed(()=>e.info.icon),m=i.computed(()=>e.info.title),v=i.computed(()=>e.info.extra),g=i.computed(()=>e.info.content),y=i.computed(()=>e.info.footer),b=i.computed(()=>e.info.status),S=i.computed(()=>e.info.description),$=i.computed(()=>`${r.value}-item`),x=()=>{var C;return(C=e.onClick)==null?void 0:C.call(e,f.value)},w=i.computed(()=>{var C;return(C=l.value)==null?void 0:C.includes(f.value)}),P=i.computed(()=>a.value?w.value:!0);return()=>i.createVNode("div",i.mergeProps(n.value,{class:le($.value,{[`${$.value}-${b.value}${e.nextStatus?`-${e.nextStatus}`:""}`]:b.value},t.class),style:t.style}),[i.createVNode("div",{class:le(`${$.value}-header`,c.value.itemHeader),style:u.value.itemHeader,onClick:x},[i.createVNode(wn,{icon:p.value,class:`${$.value}-icon`},null),i.createVNode("div",{class:le(`${$.value}-header-box`,{[`${$.value}-collapsible`]:a.value&&g.value})},[i.createVNode(Oe.Text,{strong:!0,ellipsis:{tooltip:{placement:s.value==="rtl"?"topRight":"topLeft",title:m.value}},class:`${$.value}-title`},{default:()=>[a.value&&g.value&&(s.value==="rtl"?i.createVNode(so,{class:`${$.value}-collapse-icon`,rotate:w.value?-90:0},null):i.createVNode(Zt,{class:`${$.value}-collapse-icon`,rotate:w.value?90:0},null)),m.value]}),S.value&&i.createVNode(Oe.Text,{class:`${$.value}-desc`,ellipsis:{tooltip:{placement:s.value==="rtl"?"topRight":"topLeft",title:S.value}},type:"secondary"},{default:()=>[S.value]})]),v.value&&i.createVNode("div",{class:`${$.value}-extra`},[v.value])]),i.createVNode($r,{prefixCls:r.value},{default:()=>[g.value&&i.withDirectives(i.createVNode("div",{class:le(`${$.value}-content`)},[i.createVNode("div",{class:le(`${$.value}-content-box`,c.value.itemContent),style:u.value.itemContent},[g.value])]),[[i.vShow,P.value]])]}),y.value&&i.createVNode("div",{class:le(`${$.value}-footer`,c.value.itemFooter),style:u.value.itemFooter},[y.value])])}}),YM=i.defineComponent({name:"AXThoughtChain",__name:"ThoughtChain",props:i.mergeDefaults({items:null,collapsible:{type:Boolean},size:null,styles:null,classNames:null,prefixCls:null,rootClassName:null},{styles:()=>({}),classNames:()=>({}),size:"middle"}),setup(e){const t=He(e,["prefixCls","rootClassName","class","items","collapsible","styles","style","classNames","size"]);i.toRef(e,"class"),i.toRef(e,"prefixCls");const n=i.computed(()=>vo(t,{attr:!0,aria:!0,data:!0})),{getPrefixCls:o,direction:r}=Xe(),a=i.computed(()=>o()),l=i.computed(()=>o("thought-chain",e.prefixCls)),s=on("thoughtChain"),[c,u,d]=FM(()=>e.collapsible,l.value,a.value),[f,p,m]=UM(l),v=i.computed(()=>le(e.class,e.rootClassName,l.value,s.value.className,p.value,m,{[`${l.value}-rtl`]:r.value==="rtl"},`${l.value}-${e.size}`));return()=>f(i.createVNode("div",i.mergeProps(n.value,{class:v.value,style:{...typeof s.value.style=="object"?s.value.style:{},...typeof e.style=="object"?e.style:{}}}),[i.createVNode(GM,{value:{prefixCls:l.value,enableCollapse:c.value,expandedKeys:u.value,direction:r.value,classNames:{itemHeader:le(s.value.classNames.itemHeader,e.classNames.itemHeader),itemContent:le(s.value.classNames.itemContent,e.classNames.itemContent),itemFooter:le(s.value.classNames.itemFooter,e.classNames.itemFooter)},styles:{itemHeader:{...s.value.styles.itemHeader,...e.styles.itemHeader},itemContent:{...s.value.styles.itemContent,...e.styles.itemContent},itemFooter:{...s.value.styles.itemFooter,...e.styles.itemFooter}}}},{default:()=>{var g;return[(g=e.items)==null?void 0:g.map((y,b)=>{var S;return i.createVNode(qM,{key:y.key||`key_${b}`,class:le(s.value.classNames.item,e.classNames.item),style:{...s.value.styles.item,...e.styles.item},info:{...y,icon:y.icon||b+1},onClick:d,nextStatus:((S=e.items[b+1])==null?void 0:S.status)||y.status},null)})]}})]))}}),ZM=`
|
|
292
|
+
onLoadstart onPause onPlay onPlaying onProgress onRatechange onSeeked onSeeking onStalled onSuspend onTimeupdate onVolumechange onWaiting onLoad onError`.split(/[\s\n]+/),AR="aria-",VR="data-";function lv(e,t){return e.indexOf(t)===0}function vo(e,t=!1){let n;t===!1?n={aria:!0,data:!0,attr:!0}:t===!0?n={aria:!0}:n={...t};const o={};return Object.keys(e).forEach(r=>{(n.aria&&(r==="role"||lv(r,AR))||n.data&&lv(r,VR)||n.attr&&(av.includes(r)||av.includes(r.toLowerCase())))&&(o[r]=e[r])}),o}function DR(e){const[t,n]=Te(e.value.length),o=i.computed(()=>e.value.slice(0,i.unref(t))),r=i.computed(()=>{const l=i.unref(o)[i.unref(o).length-1];return l?l.key:null});i.watch(e,()=>{var l;if(!(i.unref(o).length&&i.unref(o).every((s,c)=>{var u;return s.key===((u=e.value[c])==null?void 0:u.key)}))){if(i.unref(o).length===0)n(1);else for(let s=0;s<i.unref(o).length;s+=1)if(i.unref(o)[s].key!==((l=e.value[s])==null?void 0:l.key)){n(s);break}}},{immediate:!0,deep:!0});const a=Zi(l=>{l===i.unref(r)&&n(i.unref(t)+1)});return[o,a]}function LR(e,t){const n=(r,a)=>{var l;return typeof t.value=="function"?t.value(r,a):t?((l=t.value)==null?void 0:l[r.role])||{}:{}};return i.computed(()=>(e.value||[]).map((r,a)=>{const l=r.key??`preset_${a}`;return{...n(r,a),...r,key:l}}))}const BR=1,sv=i.defineComponent({name:"AXBubbleList",inheritAttrs:!1,__name:"BubbleList",props:i.mergeDefaults({prefixCls:null,rootClassName:null,items:null,autoScroll:{type:Boolean},roles:null},{autoScroll:!0}),setup(e,{expose:t}){const n=He(e,["prefixCls","rootClassName","items","autoScroll","roles"]);i.toRef(e,"roles"),i.toRef(e,"items"),i.toRef(e,"prefixCls");const o=i.useAttrs(),r=vo(i.mergeProps(n,o),{attr:!0,aria:!0}),a=i.ref(e.items),l=i.ref(e.roles);i.watch(()=>e.items,()=>{a.value=e.items}),i.watch(()=>e.roles,()=>{l.value=e.roles});const s=i.ref(null),c=i.ref({}),{getPrefixCls:u}=Xe(),d=u("bubble",e.prefixCls),f=`${d}-list`,[p,m,v]=nv(d),[g,y]=Te(!1);i.watchEffect(()=>{y(!0),i.onWatcherCleanup(()=>{y(!1)})});const b=LR(a,l),[S,$]=DR(b),[x,w]=Te(!0),[P,C]=Te(0),I=R=>{const z=R.target;w(z.scrollHeight-Math.abs(z.scrollTop)-z.clientHeight<=BR)};i.watch(P,()=>{e.autoScroll&&i.unref(s)&&i.unref(x)&&i.nextTick(()=>{i.unref(s).scrollTo({top:i.unref(s).scrollHeight})})}),i.watch(()=>i.unref(S).length,()=>{var R;if(e.autoScroll){const z=(R=i.unref(S)[i.unref(S).length-2])==null?void 0:R.key,A=i.unref(c)[z];if(A){const{nativeElement:j}=A,{top:O=0,bottom:N=0}=(j==null?void 0:j.getBoundingClientRect())??{},{top:D,bottom:V}=i.unref(s).getBoundingClientRect();O<V&&N>D&&(C(i.unref(P)+1),w(!0))}}});const M=Zi(()=>{e.autoScroll&&C(i.unref(P)+1)}),E=i.computed(()=>({onUpdate:M}));return t({nativeElement:s,scrollTo:({key:R,offset:z,behavior:A="smooth",block:j})=>{if(typeof z=="number")i.unref(s).scrollTo({top:z,behavior:A});else if(R!==void 0){const O=i.unref(c)[R];if(O){const N=i.unref(S).findIndex(D=>D.key===R);w(N===i.unref(S).length-1),O.nativeElement.scrollIntoView({behavior:A,block:j})}}}}),()=>p(i.createVNode(RR,{value:E.value},{default:()=>[i.createVNode("div",i.mergeProps(r,{class:le(f,e.rootClassName,m.value,v,{[`${f}-reach-end`]:x.value}),ref:s,onScroll:I}),[i.unref(S).map(({key:R,onTypingComplete:z,...A})=>i.createVNode(rv,i.mergeProps(A,{key:R,ref:j=>{j?c.value[R]=j:delete c.value[R]},typing:g.value?A.typing:!1,onTypingComplete:()=>{z==null||z(),$(R)}}),null))])]}))}}),zR=Object.assign(rv,{List:sv}),jR=i.defineComponent({name:"AXConversationsItem",__name:"ConversationsItem",props:{info:null,prefixCls:null,direction:null,menu:null,active:{type:Boolean},onClick:{type:Function}},setup(e){const t=He(e,["prefixCls","info","class","direction","onClick","active","menu"]);i.toRef(e,"class");const n=i.computed(()=>vo(t,{aria:!0,data:!0,attr:!0})),o=p=>{p.stopPropagation()},r=i.computed(()=>e.info.disabled),[a,l]=Te(!1),[s,c]=Te(!1),u=i.computed(()=>le(e.class,`${e.prefixCls}-item`,{[`${e.prefixCls}-item-active`]:e.active&&!r.value},{[`${e.prefixCls}-item-disabled`]:r.value})),d=()=>{!r.value&&e.onClick&&e.onClick(e.info)},f=p=>{p&&c(!p)};return()=>i.createVNode(Yt,{title:e.info.label,open:a.value&&s.value,onOpenChange:c,placement:e.direction==="rtl"?"left":"right"},{default:()=>[i.createVNode("li",i.mergeProps(n.value,{class:u.value,onClick:d}),[e.info.icon&&i.createVNode("div",{class:`${e.prefixCls}-icon`},[e.info.icon]),i.createVNode(Oe.Text,{class:`${e.prefixCls}-label`,ellipsis:{onEllipsis:l}},{default:()=>[e.info.label]}),e.menu&&!r.value&&i.createVNode($n,{placement:e.direction==="rtl"?"bottomLeft":"bottomRight",trigger:["click"],disabled:r.value,onOpenChange:f},{default:()=>i.createVNode(Jo,{onClick:o,disabled:r.value,class:`${e.prefixCls}-menu-icon`},null),overlay:()=>i.createVNode(Jt,e.menu,null)})])]})}}),cv=Symbol("GroupTitleContext"),Rc=i.shallowRef(),FR=e=>{i.provide(cv,e),i.watch(e,()=>{Rc.value=i.unref(e),i.triggerRef(Rc)},{immediate:!0,deep:!0})},HR=()=>i.inject(cv,i.computed(()=>Rc.value||{})),_R=i.defineComponent({props:{value:xt()},setup(e,{slots:t}){return FR(i.computed(()=>e.value)),()=>{var n;return(n=t.default)==null?void 0:n.call(t)}}}),uv=i.defineComponent({name:"AXConversationsGroupTitle",__name:"GroupTitle",setup(e){const t=i.useSlots(),n=HR(),o=i.computed(()=>{var r;return(r=t.default)==null?void 0:r.call(t)});return()=>i.createVNode("div",{class:le(`${n.value.prefixCls}-group-title`)},[o.value&&i.createVNode(Oe.Text,null,{default:()=>[o.value]})])}});function dv(e,t){const{defaultValue:n,value:o=i.ref()}=t||{};let r=typeof e=="function"?e():e;o.value!==void 0&&(r=i.unref(o)),n!==void 0&&(r=typeof n=="function"?n():n);const a=i.ref(r),l=i.ref(r);i.watchEffect(()=>{let c=o.value!==void 0?o.value:a.value;t.postState&&(c=t.postState(c)),l.value=c});function s(c){const u=l.value;a.value=c,i.toRaw(l.value)!==c&&t.onChange&&t.onChange(c,u)}return i.watch(o,()=>{a.value=o.value}),[l,s]}const Mc="__ungrouped",kR=(e,t=[])=>{const n=i.computed(()=>{if(!i.toValue(e))return{enableGroup:!1,sort:void 0,title:void 0};let o={sort:void 0,title:void 0};return typeof i.toValue(e)=="object"&&(o={...o,...i.toValue(e)}),{enableGroup:!0,sort:o.sort,title:o.title}});return i.computed(()=>{if(!n.value.enableGroup)return{groupList:[{name:Mc,data:i.toValue(t),title:void 0}],enableGroup:n.value.enableGroup};const o=i.toValue(t).reduce((l,s)=>{const c=s.group||Mc;return l[c]||(l[c]=[]),l[c].push(s),l},{});return{groupList:(n.value.sort?Object.keys(o).sort(n.value.sort):Object.keys(o)).map(l=>({name:l===Mc?void 0:l,title:n.value.title,data:o[l]})),enableGroup:n.value.enableGroup}})},WR=e=>{const{componentCls:t}=e;return{[t]:{display:"flex",flexDirection:"column",gap:e.paddingXXS,overflowY:"auto",padding:e.paddingSM,[`&${t}-rtl`]:{direction:"rtl"},[`& ${t}-list`]:{display:"flex",gap:e.paddingXXS,flexDirection:"column",paddingLeft:0,[`& ${t}-item`]:{paddingInlineStart:e.paddingXL},[`& ${t}-label`]:{color:e.colorTextDescription}},[`& ${t}-item`]:{display:"flex",height:e.controlHeightLG,minHeight:e.controlHeightLG,gap:e.paddingXS,padding:`0 ${mt(e.paddingXS)}`,alignItems:"center",borderRadius:e.borderRadiusLG,cursor:"pointer",transition:`all ${e.motionDurationMid} ${e.motionEaseInOut}`,"&:hover":{backgroundColor:e.colorBgTextHover},"&-active":{backgroundColor:e.colorBgTextHover,[`& ${t}-label, ${t}-menu-icon`]:{color:e.colorText}},"&-disabled":{cursor:"not-allowed",[`& ${t}-label`]:{color:e.colorTextDisabled}},"&:hover, &-active":{[`& ${t}-menu-icon`]:{opacity:1}}},[`& ${t}-label`]:{flex:1,overflow:"hidden",textOverflow:"ellipsis",color:e.colorText},[`& ${t}-menu-icon`]:{opacity:0,fontSize:e.fontSizeXL},[`& ${t}-group-title`]:{display:"flex",alignItems:"center",height:e.controlHeightLG,minHeight:e.controlHeightLG,padding:`0 ${mt(e.paddingXS)}`}}}},UR=an("Conversations",e=>{const t=wt(e,{});return WR(t)},()=>({})),XR=i.defineComponent({name:"AXConversations",__name:"Conversations",props:i.mergeDefaults({items:null,activeKey:null,defaultActiveKey:null,onActiveChange:{type:Function},menu:{type:Function},groupable:{type:Boolean},styles:null,classNames:null,prefixCls:null,rootClassName:null},{styles:()=>({}),classNames:()=>({})}),setup(e){const t=He(e,["prefixCls","rootClassName","items","activeKey","defaultActiveKey","onActiveChange","menu","styles","classNames","groupable","class","style"]);i.toRef(e,"class"),i.toRef(e,"activeKey"),i.toRef(e,"prefixCls");const n=i.ref(e.activeKey),o=i.computed(()=>vo(t,{attr:!0,aria:!0,data:!0})),[r,a]=dv(e.defaultActiveKey,{value:n});i.watch(()=>e.activeKey,()=>{n.value=e.activeKey});const l=kR(()=>e.groupable,()=>e.items),{getPrefixCls:s,direction:c}=Xe(),u=i.computed(()=>s("conversations",e.prefixCls)),d=on("conversations"),[f,p,m]=UR(u),v=i.computed(()=>le(u.value,d.value.className,e.class,e.rootClassName,p.value,m,{[`${u.value}-rtl`]:c.value==="rtl"})),g=y=>{a(y.key),e.onActiveChange&&e.onActiveChange(y.key)};return()=>f(i.createVNode("ul",i.mergeProps(o.value,{style:{...typeof d.value.style=="object"?d.value.style:{},...typeof e.style=="object"?e.style:{}},class:v.value}),[l.value.groupList.map((y,b)=>{const S=y.data.map(($,x)=>i.createVNode(jR,{key:$.key||`key-${x}`,info:$,prefixCls:u.value,direction:c.value,class:le(e.classNames.item,d.value.classNames.item),style:{...d.value.styles.item,...e.styles.item},menu:typeof e.menu=="function"?e.menu($):e.menu,active:r.value===$.key,onClick:g},null));return l.value.enableGroup?i.createVNode("li",{key:y.name||`key-${b}`},[i.createVNode(_R,{value:{prefixCls:u.value}},{default:()=>{var $;return[(($=y.title)==null?void 0:$.call(y,y.name,{components:{GroupTitle:uv}}))||i.createVNode(uv,{key:y.name},{default:()=>[y.name]})]}}),i.createVNode("ul",{class:`${u.value}-list`},[S])]):S})]))}}),KR=e=>{const{componentCls:t,calc:n}=e,o=n(e.fontSizeHeading3).mul(e.lineHeightHeading3).equal(),r=n(e.fontSize).mul(e.lineHeight).equal();return{[t]:{gap:e.padding,[`${t}-icon`]:{height:n(o).add(r).add(e.paddingXXS).equal(),display:"flex",img:{height:"100%"}},[`${t}-content-wrapper`]:{gap:e.paddingXS,flex:"auto",minWidth:0,[`${t}-title-wrapper`]:{gap:e.paddingXS},[`${t}-title`]:{margin:0},[`${t}-extra`]:{marginInlineStart:"auto"}}}}},GR=e=>{const{componentCls:t}=e;return{[t]:{"&-filled":{paddingInline:e.padding,paddingBlock:e.paddingSM,background:e.colorFillContent,borderRadius:e.borderRadiusLG},"&-borderless":{[`${t}-title`]:{fontSize:e.fontSizeHeading3,lineHeight:e.lineHeightHeading3}}}}},qR=an("Welcome",e=>{const t=wt(e,{});return[KR(t),GR(t)]},()=>({}));function YR(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!i.isVNode(e)}const ZR=i.defineComponent({name:"AXWelcome",__name:"Welcome",props:i.mergeDefaults({prefixCls:null,rootClassName:null,className:null,style:null,variant:null,classNames:null,styles:null,icon:null,title:null,description:null,extra:null},{variant:"filled",classNames:()=>({}),styles:()=>({})}),setup(e){i.toRef(e,"prefixCls");const t=i.useSlots(),{direction:n,getPrefixCls:o}=Xe(),r=o("welcome",e.prefixCls),a=on("welcome"),[l,s,c]=qR(r),u=i.computed(()=>{const m=t.icon?t.icon():e.icon;if(!m)return null;let v=m;return typeof m=="string"&&m.startsWith("http")&&(v=i.createVNode("img",{src:m,alt:"icon"},null)),i.createVNode("div",{class:le(`${r}-icon`,a.value.classNames.icon,e.classNames.icon),style:e.styles.icon},[v])}),d=i.computed(()=>{const m=t.title?t.title():e.title;return m?i.createVNode(Oe.Title,{level:4,class:le(`${r}-title`,a.value.classNames.title,e.classNames.title),style:e.styles.title},YR(m)?m:{default:()=>[m]}):null}),f=i.computed(()=>t.description?t.description():e.description),p=i.computed(()=>{const m=t.extra?t.extra():e.extra;return m?i.createVNode("div",{class:le(`${r}-extra`,a.value.classNames.extra,e.classNames.extra),style:e.styles.extra},[m]):null});return()=>l(i.createVNode(hr,{class:le(r,a.value.className,e.className,e.rootClassName,s.value,c,`${r}-${e.variant}`,{[`${r}-rtl`]:n.value==="rtl"}),style:e.style},{default:()=>[u.value,i.createVNode(hr,{vertical:!0,class:`${r}-content-wrapper`},{default:()=>[t.extra||e.extra?i.createVNode(hr,{align:"flex-start",class:`${r}-title-wrapper`},{default:()=>[d.value,p.value]}):d.value,f.value&&i.createVNode(Oe.Text,{class:le(`${r}-description`,a.value.classNames.description,e.classNames.description),style:e.styles.description},{default:()=>[f.value]})]})]}))}}),QR=e=>{const{componentCls:t}=e;return{[t]:{"&, & *":{boxSizing:"border-box"},maxWidth:"100%",[`&${t}-rtl`]:{direction:"rtl"},[`& ${t}-title`]:{marginBlockStart:0,fontWeight:"normal",color:e.colorTextTertiary},[`& ${t}-list`]:{display:"flex",gap:e.paddingSM,overflowX:"scroll","&::-webkit-scrollbar":{display:"none"},listStyle:"none",paddingInlineStart:0,marginBlock:0,alignItems:"stretch","&-wrap":{flexWrap:"wrap"},"&-vertical":{flexDirection:"column",alignItems:"flex-start"}},[`${t}-item`]:{flex:"none",display:"flex",gap:e.paddingXS,height:"auto",paddingBlock:e.paddingSM,paddingInline:e.padding,alignItems:"flex-start",justifyContent:"flex-start",background:e.colorBgContainer,borderRadius:e.borderRadiusLG,transition:["border","background"].map(n=>`${n} ${e.motionDurationSlow}`).join(","),border:`${mt(e.lineWidth)} ${e.lineType} ${e.colorBorderSecondary}`,[`&:not(${t}-item-has-nest)`]:{"&:hover":{cursor:"pointer",background:e.colorFillTertiary},"&:active":{background:e.colorFill}},[`${t}-content`]:{flex:"auto",minWidth:0,display:"flex",gap:e.paddingXXS,flexDirection:"column",alignItems:"flex-start"},[`${t}-icon, ${t}-label, ${t}-desc`]:{margin:0,padding:0,fontSize:e.fontSize,lineHeight:e.lineHeight,textAlign:"start",whiteSpace:"normal"},[`${t}-label`]:{color:e.colorTextHeading,fontWeight:500},[`${t}-label + ${t}-desc`]:{color:e.colorTextTertiary},[`&${t}-item-disabled`]:{pointerEvents:"none",background:e.colorBgContainerDisabled,[`${t}-label, ${t}-desc`]:{color:e.colorTextTertiary}}}}}},JR=e=>{const{componentCls:t}=e;return{[t]:{[`${t}-item-has-nest`]:{[`> ${t}-content`]:{[`> ${t}-label`]:{fontSize:e.fontSizeLG,lineHeight:e.lineHeightLG}}},[`&${t}-nested`]:{marginTop:e.paddingXS,alignSelf:"stretch",[`${t}-list`]:{alignItems:"stretch"},[`${t}-item`]:{border:0,background:e.colorFillQuaternary}}}}},eM=an("Prompts",e=>{const t=wt(e,{});return[QR(t),JR(t)]},()=>({})),fv=i.defineComponent({name:"AXPrompts",__name:"Prompts",props:i.mergeDefaults({items:null,title:null,onItemClick:{type:Function},vertical:{type:Boolean},wrap:{type:Boolean},styles:null,classNames:null,prefixCls:null,rootClassName:null},{styles:()=>({}),classNames:()=>({})}),setup(e){const t=He(e,["prefixCls","title","class","items","onItemClick","vertical","wrap","rootClassName","styles","classNames","style"]);i.toRef(e,"class"),i.toRef(e,"prefixCls");const n=i.useSlots(),{getPrefixCls:o,direction:r}=Xe(),a=o("prompts",e.prefixCls),l=on("prompts"),[s,c,u]=eM(a),d=i.computed(()=>le(a,l.value.className,e.class,e.rootClassName,c.value,u,{[`${a}-rtl`]:r.value==="rtl"})),f=i.computed(()=>le(`${a}-list`,l.value.classNames.list,e.classNames.list,{[`${a}-list-wrap`]:e.wrap},{[`${a}-list-vertical`]:e.vertical})),p=i.computed(()=>n.title?n.title():e.title);return()=>{var m;return s(i.createVNode("div",i.mergeProps(t,{class:d.value,style:{...typeof e.style=="object"?e.style:{},...typeof l.value.style=="object"?l.value.style:{}}}),[p.value&&i.createVNode(Oe.Title,{level:5,class:le(`${a}-title`,l.value.classNames.title,e.classNames.title),style:{...l.value.styles.title,...e.styles.title}},{default:()=>[p.value]}),i.createVNode("div",{class:f.value,style:{...l.value.styles.list,...e.styles.list}},[(m=e.items)==null?void 0:m.map((v,g)=>{const y=v.children&&v.children.length>0;return i.createVNode("div",{key:v.key||`key_${g}`,style:{...l.value.styles.item,...e.styles.item},class:le(`${a}-item`,l.value.classNames.item,e.classNames.item,{[`${a}-item-disabled`]:v.disabled,[`${a}-item-has-nest`]:y}),onClick:()=>{!y&&e.onItemClick&&e.onItemClick({data:v})}},[v.icon&&i.createVNode("div",{class:`${a}-icon`},[v.icon]),i.createVNode("div",{class:le(`${a}-content`,l.value.classNames.itemContent,e.classNames.itemContent),style:{...l.value.styles.itemContent,...e.styles.itemContent}},[v.label&&i.createVNode("h6",{class:`${a}-label`},[v.label]),v.description&&i.createVNode("p",{class:`${a}-desc`},[v.description]),y&&i.createVNode(fv,{class:`${a}-nested`,items:v.children,vertical:!0,onItemClick:e.onItemClick,classNames:{list:e.classNames.subList,item:e.classNames.subItem},styles:{list:e.styles.subList,item:e.styles.subItem}},null)])])})])]))}}}),tM=e=>{const{componentCls:t,antCls:n}=e;return{[t]:{[`${n}-cascader-menus ${n}-cascader-menu`]:{height:"auto"},[`${t}-item`]:{"&-icon":{marginInlineEnd:e.paddingXXS},"&-extra":{marginInlineStart:e.padding}},[`&${t}-block`]:{[`${t}-item-extra`]:{marginInlineStart:"auto"}}}}},nM=an("Suggestion",e=>{const t=wt(e,{});return tM(t)},()=>({}));function oM(e,t,n,o,r){const[a,l]=Te([]),s=(m,v=a.value)=>{let g=i.toValue(e);for(let y=0;y<m-1;y+=1){const b=v[y],S=g.find($=>$.value===b);if(!S)break;g=S.children||[]}return g},c=m=>m.map((v,g)=>{const b=s(g+1,m).find(S=>S.value===v);return b==null?void 0:b.value}),u=m=>{const v=a.value.length||1,g=s(v),y=g.findIndex($=>$.value===a.value[v-1]),b=g.length,S=g[(y+m+b)%b];l([...a.value.slice(0,v-1),S.value])},d=()=>{a.value.length>1&&l(a.value.slice(0,a.value.length-1))},f=()=>{const m=s(a.value.length+1);m.length&&l([...a.value,m[0].value])},p=Zi(m=>{if(i.toValue(t))switch(console.log("e.key",m),m.key){case"ArrowDown":u(1),m.preventDefault();break;case"ArrowUp":u(-1),m.preventDefault();break;case"ArrowRight":i.toValue(n)?d():f(),m.preventDefault();break;case"ArrowLeft":i.toValue(n)?f():d(),m.preventDefault();break;case"Enter":s(a.value.length+1).length||o(c(a.value)),m.preventDefault();break;case"Escape":r(),m.preventDefault();break}});return i.watch(()=>i.toValue(t),()=>{i.toValue(t)&&l([i.toValue(e)[0].value])},{immediate:!0}),[a,p]}const rM=i.defineComponent({name:"AXSuggestion",__name:"Suggestion",props:i.mergeDefaults({prefixCls:null,className:null,rootClassName:null,style:null,children:{type:Function},open:{type:Boolean},onOpenChange:{type:Function},items:{type:Function},onSelect:{type:Function},block:{type:Boolean},styles:null,classNames:null},{open:!1}),setup(e){i.toRef(e,"prefixCls");const t=i.useSlots(),{direction:n,getPrefixCls:o}=Xe(),r=i.computed(()=>o("suggestion",e.prefixCls));`${r.value}`;const a=i.computed(()=>n.value==="rtl"),l=on("suggestion"),[s,c,u]=nM(r),[d,f]=Te(e.open),[p,m]=Te(),v=P=>{var C;f(P),(C=e.onOpenChange)==null||C.call(e,P)},g=P=>{P===!1?v(!1):(m(P),v(!0))},y=()=>{v(!1)},b=i.computed(()=>typeof e.items=="function"?e.items(p.value):e.items),S=P=>{e.onSelect&&e.onSelect(P[P.length-1]),v(!1)},[$,x]=oM(b,d,a,S,y),w=i.computed(()=>{var P;return t.default?t.default({onTrigger:g,onKeyDown:x}):(P=e.children)==null?void 0:P.call(e,{onTrigger:g,onKeyDown:x})});return()=>s(i.createVNode(TN,{options:b.value,open:d.value,value:$.value,placement:a.value?"topRight":"topLeft",onDropdownVisibleChange:P=>{P||y()},class:le(e.rootClassName,r.value,c,u,{[`${r.value}-block`]:e.block}),onChange:S,dropdownMatchSelectWidth:e.block},{default:()=>i.createVNode("div",{class:le(r.value,l.value.className,e.rootClassName,e.className,`${r.value}-wrapper`,c.value,u),style:{...l.value.style,...e.style}},[w.value])}))}}),pv=Symbol("SenderHeaderContext"),Ac=i.shallowRef(),iM=e=>{i.provide(pv,e),i.watch(e,()=>{Ac.value=i.unref(e),i.triggerRef(Ac)},{immediate:!0,deep:!0})},aM=()=>i.inject(pv,i.computed(()=>Ac.value||{})),lM=i.defineComponent({props:{value:xt()},setup(e,{slots:t}){return iM(i.computed(()=>e.value)),()=>{var n;return(n=t.default)==null?void 0:n.call(t)}}}),mv=Symbol("ActionButtonContext"),Vc=i.shallowRef(),sM=e=>{i.provide(mv,e),i.watch(e,()=>{Vc.value=i.unref(e),i.triggerRef(Vc)},{immediate:!0,deep:!0})},Dc=()=>i.inject(mv,i.computed(()=>Vc.value||{})),cM=i.defineComponent({props:{value:xt()},setup(e,{slots:t}){return sM(i.computed(()=>e.value)),()=>{var n;return(n=t.default)==null?void 0:n.call(t)}}}),Qi=i.defineComponent({name:"AXSenderActionButton",__name:"index",props:i.mergeDefaults({prefixCls:null,type:null,htmlType:null,shape:null,size:null,loading:null,disabled:null,ghost:null,block:null,danger:null,icon:null,href:null,target:null,title:null,onClick:null,onMousedown:null,action:null},{type:"text",disabled:void 0}),setup(e){const t=He(e,["action","type","disabled","onClick"]);i.toRef(e,"onClick"),i.toRef(e,"disabled");const n=i.useSlots(),o=Dc(),r=i.computed(()=>{var u;const s=o.value.disabled,c=(u=o.value)==null?void 0:u[`${e.action}Disabled`];return s??e.disabled??c}),a=i.computed(()=>o.value.prefixCls),l=i.computed(()=>{var s;return(s=o.value)==null?void 0:s[e.action]});return()=>i.createVNode(We,i.mergeProps({type:e.type},t,{onClick:s=>{r.value||(l.value&&l.value(),e.onClick&&!Array.isArray(e.onClick)&&e.onClick(s))},class:le(a.value,{[`${a.value}-disabled`]:r.value})}),{icon:()=>n.default()})}}),uM=i.defineComponent({name:"AXSenderClearButton",__name:"ClearButton",props:i.mergeDefaults({prefixCls:null,type:null,htmlType:null,shape:null,size:null,loading:null,disabled:null,ghost:null,block:null,danger:null,icon:null,href:null,target:null,title:null,onClick:null,onMousedown:null},{disabled:void 0}),setup(e){const t=He(e,["disabled"]);return()=>i.createVNode(Qi,i.mergeProps({disabled:e.disabled},t,{action:"onClear"}),{default:()=>[i.createVNode(ac,null,null)]})}}),dM=i.defineComponent({name:"AXSenderStopLoading",__name:"StopLoading",props:{className:null},setup(e){const t=e;return()=>i.createVNode("svg",{color:"currentColor",viewBox:"0 0 1000 1000",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",class:t.className},[i.createVNode("title",null,[i.createTextVNode("Stop Loading")]),i.createVNode("rect",{fill:"currentColor",height:"250",rx:"24",ry:"24",width:"250",x:"375",y:"375"},null),i.createVNode("circle",{cx:"500",cy:"500",fill:"none",r:"450",stroke:"currentColor","stroke-width":"100",opacity:"0.45"},null),i.createVNode("circle",{cx:"500",cy:"500",fill:"none",r:"450",stroke:"currentColor","stroke-width":"100","stroke-dasharray":"600 9999999"},[i.createVNode("animateTransform",{attributeName:"transform",dur:"1s",from:"0 500 500",repeatCount:"indefinite",to:"360 500 500",type:"rotate"},null)])])}}),gv=i.defineComponent({name:"AXSenderLoadingButton",__name:"LoadingButton",props:i.mergeDefaults({prefixCls:null,type:null,htmlType:null,shape:null,size:null,loading:null,disabled:null,ghost:null,block:null,danger:null,icon:null,href:null,target:null,title:null,onClick:null,onMousedown:null},{type:"primary",shape:"circle",icon:null,disabled:void 0}),setup(e){const t=He(e,["type","shape","icon","disabled"]),n=Dc(),{token:o}=vr.useToken();return()=>i.createVNode(Qi,i.mergeProps({type:e.type,disabled:e.disabled,shape:e.shape},t,{style:{backgroundColor:"transparent",color:o.value.colorPrimary},class:le(`${n.value.prefixCls}-loading-button`),action:"onCancel"}),{default:()=>[i.createVNode(dM,{className:`${n.value.prefixCls}-loading-icon`},null)]})}}),hv=i.defineComponent({name:"AXSenderLoadingButton",__name:"SendButton",props:i.mergeDefaults({prefixCls:null,type:null,htmlType:null,shape:null,size:null,loading:null,disabled:null,ghost:null,block:null,danger:null,icon:null,href:null,target:null,title:null,onClick:null,onMousedown:null},{type:"primary",shape:"circle",disabled:void 0}),setup(e){const t=He(e,["type","shape","disabled"]);return()=>i.createVNode(Qi,i.mergeProps({type:e.type,shape:e.shape,disabled:e.disabled},t,{action:"onSend"}),{default:()=>[i.createVNode(oc,null,null)]})}}),Sr=1e3,wr=4,Ji=140,ea=250,vv=500,ta=.8,fM=i.defineComponent({name:"AXSenderRecordingIcon",__name:"RecordingIcon",props:{className:null},setup(e){const t=Ji/2;return()=>i.createVNode("svg",{color:"currentColor",viewBox:`0 0 ${Sr} ${Sr}`,xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",class:e.className},[i.createVNode("title",null,[i.createTextVNode("Speech Recording")]),Array.from({length:wr}).map((n,o)=>{const r=(Sr-Ji*wr)/(wr-1),a=o*(r+Ji),l=Sr/2-ea/2,s=Sr/2-vv/2;return i.createVNode("rect",{fill:"currentColor",rx:t,ry:t,height:ea,width:Ji,x:a,y:l,key:o},[i.createVNode("animate",{attributeName:"height",values:`${ea}; ${vv}; ${ea}`,keyTimes:"0; 0.5; 1",dur:`${ta}s`,begin:`${ta/wr*o}s`,repeatCount:"indefinite"},null),i.createVNode("animate",{attributeName:"y",values:`${l}; ${s}; ${l}`,keyTimes:"0; 0.5; 1",dur:`${ta}s`,begin:`${ta/wr*o}s`,repeatCount:"indefinite"},null)])})])}}),yv=i.defineComponent({name:"AXSenderSpeechButton",__name:"index",props:i.mergeDefaults({prefixCls:null,type:null,htmlType:null,shape:null,size:null,loading:null,disabled:null,ghost:null,block:null,danger:null,icon:null,href:null,target:null,title:null,onClick:null,onMousedown:null},{type:"text",disabled:void 0}),setup(e){const t=He(e,["type","disabled"]),n=Dc(),{token:o}=vr.useToken(),r=i.computed(()=>n.value.speechRecording),a=i.computed(()=>n.value.prefixCls),l=i.computed(()=>{let s;return r.value?s=i.createVNode(fM,{className:`${a.value}-recording-icon`},null):n.value.onSpeechDisabled?s=i.createVNode(rc,null,null):s=i.createVNode(ic,null,null),s});return()=>i.createVNode(Qi,i.mergeProps({type:e.type,disabled:e.disabled},t,{style:{display:"flex",justifyContent:"center",alignItems:"center",color:o.value.colorPrimary},action:"onSpeech"}),{default:()=>[l.value]})}}),$r=i.defineComponent({name:"AXTransitionCollapse",__name:"TransitionCollapse",props:{prefixCls:{default:"ax"}},setup(e){const t=e,n=i.useSlots(),o=i.computed(()=>t.prefixCls+"-transition-collapse"),r={beforeEnter(a){a.dataset||(a.dataset={}),a.dataset.oldPaddingTop=a.style.paddingTop,a.dataset.oldPaddingBottom=a.style.paddingBottom,a.style.maxHeight="0",a.style.paddingTop="0",a.style.paddingBottom="0"},enter(a){a.dataset.oldOverflow=a.style.overflow,a.scrollHeight!==0?(a.style.maxHeight=`${a.scrollHeight}px`,a.style.paddingTop=a.dataset.oldPaddingTop,a.style.paddingBottom=a.dataset.oldPaddingBottom):(a.style.maxHeight=`${a.dataset.oldMaxHeight||"999"}px`,a.style.paddingTop=a.dataset.oldPaddingTop,a.style.paddingBottom=a.dataset.oldPaddingBottom),a.style.overflow="hidden"},afterEnter(a){a.style.maxHeight="",a.style.overflow=a.dataset.oldOverflow},beforeLeave(a){a.dataset||(a.dataset={}),a.dataset.oldMaxHeight=a.scrollHeight,a.dataset.oldPaddingTop=a.style.paddingTop,a.dataset.oldPaddingBottom=a.style.paddingBottom,a.dataset.oldOverflow=a.style.overflow,a.style.overflow="hidden",a.style.maxHeight=`${a.scrollHeight}px`},leave(a){a.scrollHeight!==0&&(a.style.maxHeight="0",a.style.paddingTop="0",a.style.paddingBottom="0")},afterLeave(a){a.style.maxHeight="",a.style.overflow=a.dataset.oldOverflow,a.style.paddingTop=a.dataset.oldPaddingTop,a.style.paddingBottom=a.dataset.oldPaddingBottom}};return()=>i.createVNode(i.Transition,{name:o.value,onBeforeEnter:r.beforeEnter,onEnter:r.enter,onAfterEnter:r.afterEnter,onBeforeLeave:r.beforeLeave,onLeave:r.leave,onAfterLeave:r.afterLeave},{default:()=>{var a;return[(a=n.default)==null?void 0:a.call(n)]}})}}),bv=e=>{const{componentCls:t}=e,n=`${t}-transition-collapse`;return{[t]:{[n]:{"&-enter-active":{transition:["max-height","padding-top","padding-bottom"].map(o=>`${o} ${e.motionDurationSlow} ${e.motionEaseInOut}`).join(",")},"&-leave-active":{transition:["max-height","padding-top","padding-bottom"].map(o=>`${o} ${e.motionDurationSlow} ${e.motionEaseInOut}`).join(",")}}}}};$r.install=function(e){return e.component($r.name,$r),e};const pM=e=>{const{componentCls:t,calc:n}=e,o=`${t}-header`;return{[t]:{[o]:{borderBottomWidth:e.lineWidth,borderBottomStyle:"solid",borderBottomColor:e.colorBorder,"&-header":{background:e.colorFillAlter,fontSize:e.fontSize,lineHeight:e.lineHeight,paddingBlock:n(e.paddingSM).sub(e.lineWidthBold).equal(),paddingInlineStart:e.padding,paddingInlineEnd:e.paddingXS,display:"flex",[`${o}-title`]:{flex:"auto"}},"&-content":{padding:e.padding},"&-motion":{transition:["height","border"].map(r=>`${r} ${e.motionDurationSlow}`).join(","),overflow:"hidden","&-enter-start, &-leave-active":{borderBottomColor:"transparent"},"&-hidden":{display:"none"}}}}}},mM=e=>{const{componentCls:t,padding:n,paddingSM:o,paddingXS:r,lineWidth:a,lineWidthBold:l,calc:s}=e;return{[t]:{position:"relative",width:"100%",boxSizing:"border-box",boxShadow:`${e.boxShadowTertiary}`,transition:`background ${e.motionDurationSlow}`,borderRadius:{_skip_check_:!0,value:s(e.borderRadius).mul(2).equal()},borderColor:e.colorBorder,borderWidth:0,borderStyle:"solid","&:after":{content:'""',position:"absolute",inset:0,pointerEvents:"none",transition:`border-color ${e.motionDurationSlow}`,borderRadius:{_skip_check_:!0,value:"inherit"},borderStyle:"inherit",borderColor:"inherit",borderWidth:a},"&:focus-within":{boxShadow:`${e.boxShadowSecondary}`,borderColor:e.colorPrimary,"&:after":{borderWidth:l}},"&-disabled":{background:e.colorBgContainerDisabled},[`&${t}-rtl`]:{direction:"rtl"},[`${t}-content`]:{display:"flex",gap:r,width:"100%",paddingBlock:o,paddingInlineStart:n,paddingInlineEnd:o,boxSizing:"border-box",alignItems:"flex-end"},[`${t}-prefix`]:{flex:"none"},[`${t}-input`]:{padding:0,borderRadius:0,flex:"auto",alignSelf:"center",minHeight:"auto"},[`${t}-actions-list`]:{flex:"none",display:"flex","&-presets":{gap:e.paddingXS}},[`${t}-actions-btn`]:{"&-disabled":{opacity:.45},"&-loading-button":{padding:0,border:0},"&-loading-icon":{height:e.controlHeight,width:e.controlHeight,verticalAlign:"top"},"&-recording-icon":{height:"1.2em",width:"1.2em",verticalAlign:"top"}}}}},gM=an("Sender",e=>{const{paddingXS:t,calc:n}=e,o=wt(e,{SenderContentMaxWidth:`calc(100% - ${mt(n(t).add(32).equal())})`});return[mM(o),pM(o),bv(o)]},()=>({}));let na;!na&&typeof window<"u"&&(na=window.SpeechRecognition||window.webkitSpeechRecognition);function hM(e,t){const n=e,o=i.computed(()=>{const g=i.toValue(t);return typeof g=="object"?{controlledRecording:g.recording,onControlledRecordingChange:g.onRecordingChange,speechInControlled:typeof g.recording=="boolean"}:{controlledRecording:void 0,onControlledRecordingChange:void 0,speechInControlled:!1}}),r=i.computed(()=>o.value.controlledRecording),a=o.value.onControlledRecordingChange,l=o.value.speechInControlled,s=i.ref(null);i.watchEffect(()=>{if(typeof navigator<"u"&&"permissions"in navigator){let g=null;navigator.permissions.query({name:"microphone"}).then(y=>{s.value=y.state,y.onchange=function(){s.value=this.state},g=y}),i.onWatcherCleanup(()=>{g&&(g.onchange=null)})}});const c=i.computed(()=>na&&s.value!=="denied"),u=i.ref(null),[d,f]=dv(!1,{value:r}),p=i.ref(!1),m=()=>{if(c.value&&!u.value){const g=new na;g.onstart=()=>{f(!0)},g.onend=()=>{f(!1)},g.onresult=y=>{var b,S,$;if(!p.value){const x=($=(S=(b=y.results)==null?void 0:b[0])==null?void 0:S[0])==null?void 0:$.transcript;n(x)}p.value=!1},u.value=g}};return{speechPermission:c,triggerSpeech:g=>{g&&!d.value||(p.value=g,l?a==null||a(!d.value):(m(),u.value&&(d.value?(u.value.stop(),a==null||a(!1)):(u.value.start(),a==null||a(!0)))))},recording:d}}function vM(e,t){for(var n=e,o=0;o<t.length;o+=1){if(n==null)return;n=n[t[o]]}return n}const yM=i.defineComponent({name:"AXSender",__name:"Sender",props:{onKeyPress:{},onFocus:{},onBlur:{},prefixCls:{},defaultValue:{},value:{},loading:{type:Boolean},placeholder:{},readOnly:{type:Boolean},submitType:{type:[String,Boolean],default:"enter"},disabled:{type:Boolean,default:void 0},onSubmit:{},onChange:{},onCancel:{},onKeyDown:{},onPaste:{},onPasteFile:{},components:{},styles:{default:()=>({})},rootClassName:{},classNames:{default:()=>({})},style:{},className:{},actions:{},allowSpeech:{},prefix:{},header:{},autoSize:{type:[Boolean,Object],default:()=>({maxRows:8})}},emits:["update:value"],setup(e,{expose:t,emit:n}){const o=He(e,["prefixCls","styles","classNames","className","rootClassName","style","defaultValue","value","placeholder","readOnly","submitType","onSubmit","loading","components","onCancel","onChange","actions","onKeyPress","onKeyDown","disabled","allowSpeech","prefix","header","onPaste","onPasteFile","autoSize"]);i.toRef(e,"prefixCls");function r(K,Q,te){return vM(K,Q)||te}const a=n,l=i.useSlots(),{direction:s,getPrefixCls:c}=Xe(),u=i.computed(()=>c("sender",e.prefixCls)),d=i.ref(null),f=i.ref(null),p=on("sender"),m=i.computed(()=>`${u.value}-input`),[v,g,y]=gM(u.value),b=i.computed(()=>le(u.value,p.value.className,e.className,e.rootClassName,g.value,y,{[`${u.value}-rtl`]:s.value==="rtl",[`${u.value}-disabled`]:e.disabled})),S=i.computed(()=>`${u.value}-actions-btn`),$=i.computed(()=>`${u.value}-actions-list`),x=i.ref(e.value??e.defaultValue??""),w=K=>{x.value=K};i.watch(()=>e.value,()=>{w(e.value)});const P=(K,Q)=>{w(K),a("update:value",K),e.onChange&&e.onChange(K,Q)},{speechPermission:C,triggerSpeech:I,recording:M}=hM(K=>{P(`${x.value} ${K}`)},()=>e.allowSpeech),E=r(e.components,["input"],Ve.TextArea),R=i.computed(()=>vo(o,{attr:!0,aria:!0,data:!0})),z=i.computed(()=>({...R.value,ref:f})),A=()=>{x.value&&e.onSubmit&&!e.loading&&e.onSubmit(x.value)},j=()=>{P("")},O=i.ref(!1),N=()=>{O.value=!0},D=()=>{O.value=!1},V=K=>{const Q=K.key==="Enter"&&!O.value;switch(e.submitType){case"enter":Q&&!K.shiftKey&&(K.preventDefault(),A());break;case"shiftEnter":Q&&K.shiftKey&&(K.preventDefault(),A());break}e.onKeyPress&&e.onKeyPress(K)},T=K=>{var te,X;const Q=(te=K.clipboardData)==null?void 0:te.files;Q!=null&&Q.length&&e.onPasteFile&&(e.onPasteFile(Q[0],Q),K.preventDefault()),(X=e.onPaste)==null||X.call(e,K)},F=K=>{var Q,te;K.target!==((Q=d.value)==null?void 0:Q.querySelector(`.${m.value}`))&&K.preventDefault(),(te=f.value)==null||te.focus()},_=i.computed(()=>{let K=i.createVNode(hr,{class:`${$.value}-presets`},{default:()=>[e.allowSpeech&&i.createVNode(yv,null,null),e.loading?i.createVNode(gv,null,null):i.createVNode(hv,null,null)]});const Q={components:{SendButton:hv,ClearButton:uM,LoadingButton:gv,SpeechButton:yv}};return l.actions?K=l.actions({ori:K,info:Q}):typeof e.actions=="function"?K=e.actions(K,Q):e.actions&&(K=e.actions),K}),q=i.computed(()=>l.header?l.header():e.header),Z=i.computed(()=>l.prefix?l.prefix():e.prefix);return t({nativeElement:d.value,focus:K=>{var Q;return(Q=f.value)==null?void 0:Q.focus(K)},blur:()=>{var K;return(K=f.value)==null?void 0:K.blur()}}),()=>v(i.createVNode("div",{ref:d,class:b.value,style:{...p.value.style,...e.style}},[q.value&&i.createVNode(lM,{value:{prefixCls:u.value}},{default:()=>[q.value]}),i.createVNode("div",{class:`${u.value}-content`,onMousedown:F},[Z.value&&i.createVNode("div",{class:le(`${u.value}-prefix`,p.value.classNames.prefix,e.classNames.prefix),style:{...p.value.styles.prefix,...e.styles.prefix}},[Z.value]),i.createVNode(E,i.mergeProps(z.value,{disabled:e.disabled,style:{...p.value.styles.input,...e.styles.input},class:le(m.value,p.value.classNames.input,e.classNames.input),autoSize:e.autoSize,value:x.value,onChange:K=>{P(K.target.value,K),I(!0)},onPressEnter:V,onCompositionstart:N,onCompositionend:D,onKeydown:e.onKeyDown,placeholder:e.placeholder,onPaste:T,bordered:!1,readOnly:e.readOnly}),null),i.createVNode("div",{class:le($.value,p.value.classNames.actions,e.classNames.actions),style:{...p.value.styles.actions,...e.styles.actions}},[i.createVNode(cM,{value:{prefixCls:S.value,onSend:A,onSendDisabled:!x.value,onClear:j,onClearDisabled:!x.value,onCancel:e.onCancel,onCancelDisabled:!e.loading,onSpeech:()=>I(!1),onSpeechDisabled:!C.value,speechRecording:M.value,disabled:e.disabled}},{default:()=>[_.value]})])])]))}}),bM=i.defineComponent({name:"AXSenderHeader",inheritAttrs:!1,__name:"SenderHeader",props:i.mergeDefaults({forceRender:{type:Boolean},open:{type:Boolean},onOpenChange:{type:Function},title:null,children:null,className:null,style:null,classNames:null,styles:null,closable:{type:Boolean}},{classNames:()=>({}),styles:()=>({})}),setup(e){i.toRef(e,"classNames");const t=i.useSlots(),n=aM(),o=i.computed(()=>`${n.value.prefixCls}-header`),r=i.useAttrs();return()=>i.createVNode($r,{prefixCls:n.value.prefixCls},{default:()=>{var a;return[e.open||e.forceRender?i.withDirectives(i.createVNode("div",i.mergeProps(r,{class:le(o.value,e.className),style:{...e.style}}),[(e.closable!==!1||e.title)&&i.createVNode("div",{class:le(`${o.value}-header`,e.classNames.header),style:{...e.styles.header}},[i.createVNode("div",{class:`${o.value}-title`},[e.title]),e.closable!==!1&&i.createVNode("div",{class:`${o.value}-close`},[i.createVNode(We,{type:"text",icon:i.createVNode(Vt,null,null),size:"small",onClick:()=>{var l;(l=e.onOpenChange)==null||l.call(e,!e.open)}},null)])]),t.default&&i.createVNode("div",{class:le(`${o.value}-content`,e.classNames.content),style:{...e.styles.content}},[(a=t.default)==null?void 0:a.call(t)])]),[[i.vShow,e.open]]):null]}})}}),CM=Object.assign(yM,{Header:bM}),Cv=Symbol("AttachmentContext"),Lc=i.shallowRef(),SM=e=>{i.provide(Cv,e),i.watch(e,()=>{Lc.value=i.unref(e),i.triggerRef(Lc)},{immediate:!0,deep:!0})},oa=()=>i.inject(Cv,i.computed(()=>Lc.value||{})),wM=i.defineComponent({inheritAttrs:!1,props:{value:xt()},setup(e,{slots:t}){return SM(i.computed(()=>e.value)),()=>{var n;return(n=t.default)==null?void 0:n.call(t)}}}),$M=i.defineComponent({name:"AXAttachmentsPlaceholderUploader",__name:"PlaceholderUploader",props:i.mergeDefaults({prefixCls:null,placeholder:null,upload:null,className:null,style:null},{placeholder:()=>({})}),setup(e,{expose:t}){const n=`${e.prefixCls}-placeholder`,o=i.computed(()=>e.placeholder||{}),r=i.useTemplateRef("upload-dragger"),a=oa(),[l,s]=Te(!1),c=()=>{s(!0)},u=m=>{m.currentTarget.contains(m.relatedTarget)||s(!1)},d=()=>{s(!1)};t({nativeElement:r});const f=m=>Array.isArray(m)&&m.every(i.isVNode),p=i.computed(()=>i.isVNode(e.placeholder)||f(e.placeholder)?e.placeholder:i.createVNode(hr,{align:"center",justify:"center",vertical:!0,class:`${n}-inner`},{default:()=>[i.createVNode(Oe.Text,{class:`${n}-icon`},{default:()=>[o.value.icon]}),i.createVNode(Oe.Title,{class:`${n}-title`,level:5},{default:()=>[o.value.title]}),i.createVNode(Oe.Text,{class:`${n}-description`,type:"secondary"},{default:()=>[o.value.description]})]}));return()=>i.createVNode("div",{class:le(n,{[`${n}-drag-in`]:l.value,[`${n}-disabled`]:a.value.disabled},e.className),onDragenter:c,onDragleave:u,onDrop:d,"aria-hidden":a.value.disabled,style:e.style},[i.createVNode(t0.Dragger,i.mergeProps({showUploadList:!1},e.upload,{ref:"upload-dragger",style:{padding:0,border:0,background:"transparent"}}),{default:()=>[p.value]})])}}),Sv=i.defineComponent({name:"AXAttachmentsDropArea",__name:"DropArea",props:{prefixCls:null,className:null,getDropContainer:{type:Function},children:null},setup(e){const t=oa(),[n,o]=Te(),[r,a]=Te(null);i.onMounted(()=>{var c;o((c=e.getDropContainer)==null?void 0:c.call(e))}),i.watch(()=>i.toValue(e.getDropContainer),()=>{var u;const c=(u=e.getDropContainer)==null?void 0:u.call(e);n.value!==c&&o(c)}),i.watch(()=>!!n.value,()=>{if(n.value){const c=()=>{a(!0)},u=p=>{p.preventDefault()},d=p=>{p.relatedTarget||a(!1)},f=p=>{a(!1),p.preventDefault()};document.addEventListener("dragenter",c),document.addEventListener("dragover",u),document.addEventListener("dragleave",d),document.addEventListener("drop",f),i.onWatcherCleanup(()=>{document.removeEventListener("dragenter",c),document.removeEventListener("dragover",u),document.removeEventListener("dragleave",d),document.removeEventListener("drop",f)})}});const l=i.computed(()=>e.getDropContainer&&n.value&&!t.value.disabled),s=`${e.prefixCls}-drop-area`;return()=>l.value?i.createVNode(i.Teleport,{to:n.value},{default:()=>[i.createVNode("div",{class:le(s,e.className,{[`${s}-on-body`]:n.value.tagName==="BODY"}),style:{display:r.value?"block":"none"}},[e.children])]}):null}}),wv=i.defineComponent({name:"AXAttachmentsSilentUploader",__name:"SilentUploader",props:{children:null,upload:null,rootClassName:null},setup(e,{expose:t}){const n=i.useTemplateRef("upload");return t({nativeElement:n}),()=>i.createVNode(t0,i.mergeProps(e.upload,{showUploadList:!1,ref:"upload"}),{default:()=>[e.children]})}}),$v=(e,t)=>{const n=e.__vccOpts||e;for(const[o,r]of t)n[o]=r;return n},xM={},OM={width:"1em",height:"1em",viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"};function PM(e,t){return i.openBlock(),i.createElementBlock("svg",OM,t[0]||(t[0]=[i.createElementVNode("title",null,"audio",-1),i.createElementVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[i.createElementVNode("path",{d:"M14.1178571,4.0125 C14.225,4.11964286 14.2857143,4.26428571 14.2857143,4.41607143 L14.2857143,15.4285714 C14.2857143,15.7446429 14.0303571,16 13.7142857,16 L2.28571429,16 C1.96964286,16 1.71428571,15.7446429 1.71428571,15.4285714 L1.71428571,0.571428571 C1.71428571,0.255357143 1.96964286,0 2.28571429,0 L9.86964286,0 C10.0214286,0 10.1678571,0.0607142857 10.275,0.167857143 L14.1178571,4.0125 Z M10.7315824,7.11216117 C10.7428131,7.15148751 10.7485063,7.19218979 10.7485063,7.23309113 L10.7485063,8.07742614 C10.7484199,8.27364959 10.6183424,8.44607275 10.4296853,8.50003683 L8.32984514,9.09986306 L8.32984514,11.7071803 C8.32986605,12.5367078 7.67249692,13.217028 6.84345686,13.2454634 L6.79068592,13.2463395 C6.12766108,13.2463395 5.53916361,12.8217001 5.33010655,12.1924966 C5.1210495,11.563293 5.33842118,10.8709227 5.86959669,10.4741173 C6.40077221,10.0773119 7.12636292,10.0652587 7.67042486,10.4442027 L7.67020842,7.74937024 L7.68449368,7.74937024 C7.72405122,7.59919041 7.83988806,7.48101083 7.98924584,7.4384546 L10.1880418,6.81004755 C10.42156,6.74340323 10.6648954,6.87865515 10.7315824,7.11216117 Z M9.60714286,1.31785714 L12.9678571,4.67857143 L9.60714286,4.67857143 L9.60714286,1.31785714 Z",fill:"currentColor"})],-1)]))}const IM=$v(xM,[["render",PM]]),NM={},TM={width:"1em",height:"1em",viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"};function EM(e,t){return i.openBlock(),i.createElementBlock("svg",TM,t[0]||(t[0]=[i.createElementVNode("title",null,"video",-1),i.createElementVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[i.createElementVNode("path",{d:"M14.1178571,4.0125 C14.225,4.11964286 14.2857143,4.26428571 14.2857143,4.41607143 L14.2857143,15.4285714 C14.2857143,15.7446429 14.0303571,16 13.7142857,16 L2.28571429,16 C1.96964286,16 1.71428571,15.7446429 1.71428571,15.4285714 L1.71428571,0.571428571 C1.71428571,0.255357143 1.96964286,0 2.28571429,0 L9.86964286,0 C10.0214286,0 10.1678571,0.0607142857 10.275,0.167857143 L14.1178571,4.0125 Z M12.9678571,4.67857143 L9.60714286,1.31785714 L9.60714286,4.67857143 L12.9678571,4.67857143 Z M10.5379461,10.3101106 L6.68957555,13.0059749 C6.59910784,13.0693494 6.47439406,13.0473861 6.41101953,12.9569184 C6.3874624,12.9232903 6.37482581,12.8832269 6.37482581,12.8421686 L6.37482581,7.45043999 C6.37482581,7.33998304 6.46436886,7.25043999 6.57482581,7.25043999 C6.61588409,7.25043999 6.65594753,7.26307658 6.68957555,7.28663371 L10.5379461,9.98249803 C10.6284138,10.0458726 10.6503772,10.1705863 10.5870027,10.2610541 C10.5736331,10.2801392 10.5570312,10.2967411 10.5379461,10.3101106 Z",fill:"currentColor"})],-1)]))}const RM=$v(NM,[["render",EM]]),MM=e=>e.indexOf("image/")===0,ra=200;function AM(e){return new Promise(t=>{if(!e||!e.type||!MM(e.type)){t("");return}const n=new Image;if(n.onload=()=>{const{width:o,height:r}=n,a=o/r,l=a>1?ra:ra*a,s=a>1?ra/a:ra,c=document.createElement("canvas");c.width=l,c.height=s,c.style.cssText=`position: fixed; left: 0; top: 0; width: ${l}px; height: ${s}px; z-index: 9999; display: none;`,document.body.appendChild(c),c.getContext("2d").drawImage(n,0,0,l,s);const d=c.toDataURL();document.body.removeChild(c),window.URL.revokeObjectURL(n.src),t(d)},n.crossOrigin="anonymous",e.type.startsWith("image/svg+xml")){const o=new FileReader;o.onload=()=>{o.result&&typeof o.result=="string"&&(n.src=o.result)},o.readAsDataURL(e)}else if(e.type.startsWith("image/gif")){const o=new FileReader;o.onload=()=>{o.result&&t(o.result)},o.readAsDataURL(e)}else n.src=window.URL.createObjectURL(e)})}const De=Math.round;function Bc(e,t){const n=e.replace(/^[^(]*\((.*)/,"$1").replace(/\).*/,"").match(/\d*\.?\d+%?/g)||[],o=n.map(r=>parseFloat(r));for(let r=0;r<3;r+=1)o[r]=t(o[r]||0,n[r]||"",r);return n[3]?o[3]=n[3].includes("%")?o[3]/100:o[3]:o[3]=1,o}const xv=(e,t,n)=>n===0?e:e/100;function xr(e,t){const n=t||255;return e>n?n:e<0?0:e}class zc{constructor(t){Ge(this,"isValid",!0),Ge(this,"r",0),Ge(this,"g",0),Ge(this,"b",0),Ge(this,"a",1),Ge(this,"_h",void 0),Ge(this,"_s",void 0),Ge(this,"_l",void 0),Ge(this,"_v",void 0),Ge(this,"_max",void 0),Ge(this,"_min",void 0),Ge(this,"_brightness",void 0);function n(o){return o[0]in t&&o[1]in t&&o[2]in t}if(t)if(typeof t=="string"){let r=function(a){return o.startsWith(a)};const o=t.trim();/^#?[A-F\d]{3,8}$/i.test(o)?this.fromHexString(o):r("rgb")?this.fromRgbString(o):r("hsl")?this.fromHslString(o):(r("hsv")||r("hsb"))&&this.fromHsvString(o)}else if(t instanceof zc)this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this._h=t._h,this._s=t._s,this._l=t._l,this._v=t._v;else if(n("rgb"))this.r=xr(t.r),this.g=xr(t.g),this.b=xr(t.b),this.a=typeof t.a=="number"?xr(t.a,1):1;else if(n("hsl"))this.fromHsl(t);else if(n("hsv"))this.fromHsv(t);else throw new Error("@ant-design/fast-color: unsupported input "+JSON.stringify(t))}setR(t){return this._sc("r",t)}setG(t){return this._sc("g",t)}setB(t){return this._sc("b",t)}setA(t){return this._sc("a",t,1)}setHue(t){const n=this.toHsv();return n.h=t,this._c(n)}getLuminance(){function t(a){const l=a/255;return l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4)}const n=t(this.r),o=t(this.g),r=t(this.b);return .2126*n+.7152*o+.0722*r}getHue(){if(typeof this._h>"u"){const t=this.getMax()-this.getMin();t===0?this._h=0:this._h=De(60*(this.r===this.getMax()?(this.g-this.b)/t+(this.g<this.b?6:0):this.g===this.getMax()?(this.b-this.r)/t+2:(this.r-this.g)/t+4))}return this._h}getSaturation(){if(typeof this._s>"u"){const t=this.getMax()-this.getMin();t===0?this._s=0:this._s=t/this.getMax()}return this._s}getLightness(){return typeof this._l>"u"&&(this._l=(this.getMax()+this.getMin())/510),this._l}getValue(){return typeof this._v>"u"&&(this._v=this.getMax()/255),this._v}getBrightness(){return typeof this._brightness>"u"&&(this._brightness=(this.r*299+this.g*587+this.b*114)/1e3),this._brightness}darken(t=10){const n=this.getHue(),o=this.getSaturation();let r=this.getLightness()-t/100;return r<0&&(r=0),this._c({h:n,s:o,l:r,a:this.a})}lighten(t=10){const n=this.getHue(),o=this.getSaturation();let r=this.getLightness()+t/100;return r>1&&(r=1),this._c({h:n,s:o,l:r,a:this.a})}mix(t,n=50){const o=this._c(t),r=n/100,a=s=>(o[s]-this[s])*r+this[s],l={r:De(a("r")),g:De(a("g")),b:De(a("b")),a:De(a("a")*100)/100};return this._c(l)}tint(t=10){return this.mix({r:255,g:255,b:255,a:1},t)}shade(t=10){return this.mix({r:0,g:0,b:0,a:1},t)}onBackground(t){const n=this._c(t),o=this.a+n.a*(1-this.a),r=a=>De((this[a]*this.a+n[a]*n.a*(1-this.a))/o);return this._c({r:r("r"),g:r("g"),b:r("b"),a:o})}isDark(){return this.getBrightness()<128}isLight(){return this.getBrightness()>=128}equals(t){return this.r===t.r&&this.g===t.g&&this.b===t.b&&this.a===t.a}clone(){return this._c(this)}toHexString(){let t="#";const n=(this.r||0).toString(16);t+=n.length===2?n:"0"+n;const o=(this.g||0).toString(16);t+=o.length===2?o:"0"+o;const r=(this.b||0).toString(16);if(t+=r.length===2?r:"0"+r,typeof this.a=="number"&&this.a>=0&&this.a<1){const a=De(this.a*255).toString(16);t+=a.length===2?a:"0"+a}return t}toHsl(){return{h:this.getHue(),s:this.getSaturation(),l:this.getLightness(),a:this.a}}toHslString(){const t=this.getHue(),n=De(this.getSaturation()*100),o=De(this.getLightness()*100);return this.a!==1?`hsla(${t},${n}%,${o}%,${this.a})`:`hsl(${t},${n}%,${o}%)`}toHsv(){return{h:this.getHue(),s:this.getSaturation(),v:this.getValue(),a:this.a}}toRgb(){return{r:this.r,g:this.g,b:this.b,a:this.a}}toRgbString(){return this.a!==1?`rgba(${this.r},${this.g},${this.b},${this.a})`:`rgb(${this.r},${this.g},${this.b})`}toString(){return this.toRgbString()}_sc(t,n,o){const r=this.clone();return r[t]=xr(n,o),r}_c(t){return new this.constructor(t)}getMax(){return typeof this._max>"u"&&(this._max=Math.max(this.r,this.g,this.b)),this._max}getMin(){return typeof this._min>"u"&&(this._min=Math.min(this.r,this.g,this.b)),this._min}fromHexString(t){const n=t.replace("#","");function o(r,a){return parseInt(n[r]+n[a||r],16)}n.length<6?(this.r=o(0),this.g=o(1),this.b=o(2),this.a=n[3]?o(3)/255:1):(this.r=o(0,1),this.g=o(2,3),this.b=o(4,5),this.a=n[6]?o(6,7)/255:1)}fromHsl({h:t,s:n,l:o,a:r}){if(this._h=t%360,this._s=n,this._l=o,this.a=typeof r=="number"?r:1,n<=0){const p=De(o*255);this.r=p,this.g=p,this.b=p}let a=0,l=0,s=0;const c=t/60,u=(1-Math.abs(2*o-1))*n,d=u*(1-Math.abs(c%2-1));c>=0&&c<1?(a=u,l=d):c>=1&&c<2?(a=d,l=u):c>=2&&c<3?(l=u,s=d):c>=3&&c<4?(l=d,s=u):c>=4&&c<5?(a=d,s=u):c>=5&&c<6&&(a=u,s=d);const f=o-u/2;this.r=De((a+f)*255),this.g=De((l+f)*255),this.b=De((s+f)*255)}fromHsv({h:t,s:n,v:o,a:r}){this._h=t%360,this._s=n,this._v=o,this.a=typeof r=="number"?r:1;const a=De(o*255);if(this.r=a,this.g=a,this.b=a,n<=0)return;const l=t/60,s=Math.floor(l),c=l-s,u=De(o*(1-n)*255),d=De(o*(1-n*c)*255),f=De(o*(1-n*(1-c))*255);switch(s){case 0:this.g=f,this.b=u;break;case 1:this.r=d,this.b=u;break;case 2:this.r=u,this.b=f;break;case 3:this.r=u,this.g=d;break;case 4:this.r=f,this.g=u;break;case 5:default:this.g=u,this.b=d;break}}fromHsvString(t){const n=Bc(t,xv);this.fromHsv({h:n[0],s:n[1],v:n[2],a:n[3]})}fromHslString(t){const n=Bc(t,xv);this.fromHsl({h:n[0],s:n[1],l:n[2],a:n[3]})}fromRgbString(t){const n=Bc(t,(o,r)=>r.includes("%")?De(o/100*255):o);this.r=n[0],this.g=n[1],this.b=n[2],this.a=n[3]}}const VM=e=>{const{componentCls:t,calc:n}=e,o=`${t}-list-card`,r=n(e.fontSize).mul(e.lineHeight).mul(2).add(e.paddingSM).add(e.paddingSM).equal();return{[o]:{borderRadius:e.borderRadius,position:"relative",background:e.colorFillContent,borderWidth:e.lineWidth,borderStyle:"solid",borderColor:"transparent",flex:"none",[`${o}-name,${o}-desc`]:{display:"flex",flexWrap:"nowrap",maxWidth:"100%"},[`${o}-ellipsis-prefix`]:{flex:"0 1 auto",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},[`${o}-ellipsis-suffix`]:{flex:"none"},"&-type-overview":{padding:n(e.paddingSM).sub(e.lineWidth).equal(),paddingInlineStart:n(e.padding).add(e.lineWidth).equal(),display:"flex",flexWrap:"nowrap",gap:e.paddingXS,alignItems:"flex-start",width:236,[`${o}-icon`]:{fontSize:n(e.fontSizeLG).mul(2).equal(),lineHeight:1,paddingTop:n(e.paddingXXS).mul(1.5).equal(),flex:"none"},[`${o}-content`]:{flex:"auto",minWidth:0,display:"flex",flexDirection:"column",alignItems:"stretch"},[`${o}-desc`]:{color:e.colorTextTertiary}},"&-type-preview":{width:r,height:r,lineHeight:1,[`&:not(${o}-status-error)`]:{border:0},img:{width:"100%",height:"100%",verticalAlign:"top",objectFit:"cover",borderRadius:"inherit"},[`${o}-img-mask`]:{position:"absolute",inset:0,display:"flex",justifyContent:"center",alignItems:"center",background:`rgba(0, 0, 0, ${e.opacityLoading})`,borderRadius:"inherit"},[`&${o}-status-error`]:{[`img, ${o}-img-mask`]:{borderRadius:n(e.borderRadius).sub(e.lineWidth).equal()},[`${o}-desc`]:{paddingInline:e.paddingXXS}},[`${o}-progress`]:{}},[`${o}-remove`]:{position:"absolute",top:0,insetInlineEnd:0,border:0,padding:e.paddingXXS,background:"transparent",lineHeight:1,transform:"translate(50%, -50%)",fontSize:e.fontSize,cursor:"pointer",opacity:e.opacityLoading,display:"none","&:dir(rtl)":{transform:"translate(-50%, -50%)"},"&:hover":{opacity:1},"&:active":{opacity:e.opacityLoading}},[`&:hover ${o}-remove`]:{display:"block"},"&-status-error":{borderColor:e.colorError,[`${o}-desc`]:{color:e.colorError}},"&-motion":{overflow:"hidden",transition:["opacity","width","margin","padding"].map(a=>`${a} ${e.motionDurationSlow}`).join(","),[`${o}-remove`]:{display:"none !important"},"&-appear-start":{width:0,transition:"none"},"&-leave-active":{opacity:0,width:0,paddingInline:0,borderInlineWidth:0,marginInlineEnd:n(e.paddingSM).mul(-1).equal()}}}}},jc={"&, *":{boxSizing:"border-box"}},DM=e=>{const{componentCls:t,calc:n,antCls:o}=e,r=`${t}-drop-area`,a=`${t}-placeholder`;return{[r]:{position:"absolute",inset:0,zIndex:e.zIndexPopupBase,...jc,"&-on-body":{position:"fixed",inset:0},"&-hide-placement":{[`${a}-inner`]:{display:"none"}},[a]:{padding:0}},"&":{[a]:{height:"100%",borderRadius:e.borderRadius,borderWidth:e.lineWidthBold,borderStyle:"dashed",borderColor:"transparent",padding:e.padding,position:"relative",backdropFilter:"blur(10px)",...jc,[`${o}-upload-wrapper ${o}-upload${o}-upload-btn`]:{padding:0},[`&${a}-drag-in`]:{borderColor:e.colorPrimaryHover},[`&${a}-disabled`]:{opacity:.25,pointerEvents:"none"},[`${a}-inner`]:{gap:n(e.paddingXXS).div(2).equal()},[`${a}-icon`]:{fontSize:e.fontSizeHeading2,lineHeight:1},[`${a}-title${a}-title`]:{margin:0,fontSize:e.fontSize,lineHeight:e.lineHeight},[`${a}-description`]:{}}}}},LM=e=>{const{componentCls:t,calc:n}=e,o=`${t}-list`,r=n(e.fontSize).mul(e.lineHeight).mul(2).add(e.paddingSM).add(e.paddingSM).equal();return{[t]:{position:"relative",width:"100%",...jc,[o]:{display:"flex",flexWrap:"wrap",gap:e.paddingSM,fontSize:e.fontSize,lineHeight:e.lineHeight,color:e.colorText,paddingBlock:e.paddingSM,paddingInline:e.padding,width:"100%",background:e.colorBgContainer,scrollbarWidth:"none","-ms-overflow-style":"none","&::-webkit-scrollbar":{display:"none"},"&-overflow-scrollX, &-overflow-scrollY":{"&:before, &:after":{content:'""',position:"absolute",opacity:0,transition:`opacity ${e.motionDurationSlow}`,zIndex:1}},"&-overflow-ping-start:before":{opacity:1},"&-overflow-ping-end:after":{opacity:1},"&-overflow-scrollX":{overflowX:"auto",overflowY:"hidden",flexWrap:"nowrap","&:before, &:after":{insetBlock:0,width:8},"&:before":{insetInlineStart:0,background:"linear-gradient(to right, rgba(0,0,0,0.06), rgba(0,0,0,0));"},"&:after":{insetInlineEnd:0,background:"linear-gradient(to left, rgba(0,0,0,0.06), rgba(0,0,0,0));"},"&:dir(rtl)":{"&:before":{background:"linear-gradient(to left, rgba(0,0,0,0.06), rgba(0,0,0,0));"},"&:after":{background:"linear-gradient(to right, rgba(0,0,0,0.06), rgba(0,0,0,0));"}}},"&-overflow-scrollY":{overflowX:"hidden",overflowY:"auto",maxHeight:n(r).mul(3).equal(),"&:before, &:after":{insetInline:0,height:8},"&:before":{insetBlockStart:0,background:"linear-gradient(to bottom, rgba(0,0,0,0.06), rgba(0,0,0,0));"},"&:after":{insetBlockEnd:0,background:"linear-gradient(to top, rgba(0,0,0,0.06), rgba(0,0,0,0));"}},"&-upload-btn":{width:r,height:r,fontSize:e.fontSizeHeading2,color:"#999"},"&-prev-btn, &-next-btn":{position:"absolute",top:"50%",transform:"translateY(-50%)",boxShadow:e.boxShadowTertiary,opacity:0,pointerEvents:"none"},"&-prev-btn":{left:{_skip_check_:!0,value:e.padding}},"&-next-btn":{right:{_skip_check_:!0,value:e.padding}},"&:dir(ltr)":{[`&${o}-overflow-ping-start ${o}-prev-btn`]:{opacity:1,pointerEvents:"auto"},[`&${o}-overflow-ping-end ${o}-next-btn`]:{opacity:1,pointerEvents:"auto"}},"&:dir(rtl)":{[`&${o}-overflow-ping-end ${o}-prev-btn`]:{opacity:1,pointerEvents:"auto"},[`&${o}-overflow-ping-start ${o}-next-btn`]:{opacity:1,pointerEvents:"auto"}}}}}},Ov=an("Attachments",e=>{const t=wt(e,{});return[DM(t),LM(t),VM(t)]},e=>{const{colorBgContainer:t}=e;return{colorBgPlaceholderHover:new zc(t).setA(.85).toRgbString()}}),Fc=" ",Hc="#8c8c8c",Pv=i.defineComponent({name:"AXAttachmentsFileListCard",__name:"FileListCard",props:{prefixCls:null,item:null,onRemove:{type:Function},className:null,style:null,imageProps:null},setup(e,{expose:t}){i.toRef(e,"prefixCls");const n=["png","jpg","jpeg","gif","bmp","webp","svg"],o=[{icon:i.createVNode(lc,null,null),color:"#22b35e",ext:["xlsx","xls"]},{icon:i.createVNode(sc,null,null),color:Hc,ext:n},{icon:i.createVNode(cc,null,null),color:Hc,ext:["md","mdx"]},{icon:i.createVNode(uc,null,null),color:"#ff4d4f",ext:["pdf"]},{icon:i.createVNode(dc,null,null),color:"#ff6e31",ext:["ppt","pptx"]},{icon:i.createVNode(pc,null,null),color:"#1677ff",ext:["doc","docx"]},{icon:i.createVNode(mc,null,null),color:"#fab714",ext:["zip","rar","7z","tar","gz"]},{icon:i.createVNode(RM,null,null),color:"#ff4d4f",ext:["mp4","avi","mov","wmv","flv","mkv"]},{icon:i.createVNode(IM,null,null),color:"#8c8c8c",ext:["mp3","wav","flac","ape","aac","ogg"]}];function r(A,j){return j.some(O=>A.toLowerCase()===`.${O}`)}function a(A){let j=A;const O=["B","KB","MB","GB","TB","PB","EB"];let N=0;for(;j>=1024&&N<O.length-1;)j/=1024,N++;return`${j.toFixed(0)} ${O[N]}`}const l=oa(),s=i.computed(()=>l.value.disabled),c=i.computed(()=>e.item.name),u=i.computed(()=>e.item.size),d=i.computed(()=>e.item.percent),f=i.computed(()=>e.item.status||"done"),p=i.computed(()=>e.item.description),{getPrefixCls:m}=Xe(),v=i.computed(()=>m("attachment",e.prefixCls)),g=`${v.value}-list-card`,[y,b,S]=Ov(v),$=i.useTemplateRef("file-list-card-container"),x=i.computed(()=>{const A=c.value||"",j=A.match(/^(.*)\.[^.]+$/);return{namePrefix:j?j[1]:A,nameSuffix:j?A.slice(j[1].length):""}}),w=i.computed(()=>r(x.value.nameSuffix,n)),P=i.computed(()=>p.value?p.value:f.value==="uploading"?`${d.value||0}%`:f.value==="error"?e.item.response||Fc:u.value?a(u.value):Fc),C=i.computed(()=>{for(const{ext:A,icon:j,color:O}of o)if(r(x.value.nameSuffix,A))return{icon:j,iconColor:O};return{icon:i.createVNode(fc,{key:"defaultIcon"},null),iconColor:Hc}}),[I,M]=Te();i.watch(()=>e.item.originFileObj,()=>{if(e.item.originFileObj){let A=!0;AM(e.item.originFileObj).then(j=>{A&&M(j)}),i.onWatcherCleanup(()=>{A=!1})}M(void 0)},{immediate:!0});const E=i.computed(()=>e.item.thumbUrl||e.item.url||I.value),R=i.computed(()=>w.value&&(e.item.originFileObj||E.value)),z=i.computed(()=>R.value?i.createVNode(i.Fragment,null,[E.value&&i.createVNode(Pn,i.mergeProps(e.imageProps,{alt:"preview",src:E.value}),null),f.value!=="done"&&i.createVNode("div",{class:`${g}-img-mask`},[f.value==="uploading"&&d.value!==void 0&&i.createVNode(Vh,{percent:d.value,prefixCls:g},null),f.value==="error"&&i.createVNode("div",{class:`${g}-desc`},[i.createVNode("div",{class:`${g}-ellipsis-prefix`},[P.value])])])]):i.createVNode(i.Fragment,null,[i.createVNode("div",{class:`${g}-icon`,style:{color:C.value.iconColor}},[C.value.icon]),i.createVNode("div",{class:`${g}-content`},[i.createVNode("div",{class:`${g}-name`},[i.createVNode("div",{class:`${g}-ellipsis-prefix`},[x.value.namePrefix??Fc]),i.createVNode("div",{class:`${g}-ellipsis-suffix`},[x.value.nameSuffix])]),i.createVNode("div",{class:`${g}-desc`},[i.createVNode("div",{class:`${g}-ellipsis-prefix`},[P.value])])])]));return t({nativeElement:$}),()=>y(i.createVNode("div",{class:le(g,{[`${g}-status-${f.value}`]:f.value,[`${g}-type-preview`]:R.value,[`${g}-type-overview`]:!R.value},e.className,b.value,S),style:e.style,ref:"file-list-card-container"},[z.value,!s.value&&e.onRemove&&i.createVNode("button",{type:"button",class:`${g}-remove`,onClick:()=>{e.onRemove(e.item)}},[i.createVNode(pt,null,null)])]))}}),Iv=1,BM=i.defineComponent({name:"AXAttachmentsFileList",__name:"FileList",props:{prefixCls:{},items:{},onRemove:{},overflow:{},upload:{},imageProps:{},listClassName:{},listStyle:{},itemClassName:{},itemStyle:{}},setup(e){const t=i.computed(()=>`${e.prefixCls}-list`),n=i.useTemplateRef("file-list-container"),[o,r]=Te(!1),a=oa();i.watchEffect(()=>{r(!0),i.onWatcherCleanup(()=>{r(!1)})});const[l,s]=Te(!1),[c,u]=Te(!1),d=()=>{const v=n.value;v&&(e.overflow==="scrollX"?(s(Math.abs(v.scrollLeft)>=Iv),u(v.scrollWidth-v.clientWidth-Math.abs(v.scrollLeft)>=Iv)):e.overflow==="scrollY"&&(s(v.scrollTop!==0),u(v.scrollHeight-v.clientHeight!==v.scrollTop)))};i.watch([()=>e.overflow,()=>e.items.length],()=>{i.nextTick(()=>{d()})},{immediate:!0});const f=v=>{const g=n.value;g&&g.scrollTo({left:g.scrollLeft+v*g.clientWidth,behavior:"smooth"})},p=()=>{f(-1)},m=()=>{f(1)};return()=>i.createVNode("div",{class:le(t.value,{[`${t.value}-overflow-${e.overflow}`]:e.overflow,[`${t.value}-overflow-ping-start`]:l.value,[`${t.value}-overflow-ping-end`]:c.value},e.listClassName),ref:"file-list-container",onScroll:d,style:e.listStyle},[e.items.map(v=>i.createVNode(Pv,{key:v.uid,prefixCls:e.prefixCls,item:v,onRemove:e.onRemove,className:le(e.itemClassName),imageProps:e.imageProps,style:{...e.itemStyle}},null)),!a.value.disabled&&i.createVNode(wv,{upload:e.upload,children:i.createVNode(We,{class:`${t.value}-upload-btn`,type:"dashed"},{default:()=>[i.createVNode(bs,{class:`${t.value}-upload-btn-icon`},null)]})},null),e.overflow==="scrollX"&&i.createVNode(i.Fragment,null,[i.createVNode(We,{size:"small",shape:"circle",class:`${t.value}-prev-btn`,icon:i.createVNode(so,null,null),onClick:p},null),i.createVNode(We,{size:"small",shape:"circle",class:`${t.value}-next-btn`,icon:i.createVNode(Zt,null,null),onClick:m},null)])])}}),zM=i.defineComponent({name:"AXAttachments",__name:"Attachments",props:i.mergeDefaults({capture:null,type:null,name:null,defaultFileList:null,action:null,directory:null,data:null,method:null,headers:null,showUploadList:null,multiple:null,accept:null,beforeUpload:null,onChange:{type:Function},"onUpdate:fileList":null,onDrop:null,listType:null,onPreview:null,onDownload:null,onReject:null,onRemove:null,remove:null,supportServerRender:null,disabled:{type:Boolean},prefixCls:null,customRequest:null,withCredentials:null,openFileDialogOnClick:null,locale:null,id:null,previewFile:null,transformFile:null,iconRender:null,isImageUrl:null,progress:null,itemRender:null,maxCount:null,height:null,removeIcon:null,downloadIcon:null,previewIcon:null,rootClassName:null,rootStyle:null,style:null,className:null,classNames:null,styles:null,children:null,placeholder:{type:Function},getDropContainer:{type:Function},items:null,overflow:null,imageProps:null},{items:()=>[],classNames:()=>({}),styles:()=>({})}),setup(e,{expose:t}){const n=He(e,["prefixCls","rootClassName","rootStyle","className","style","items","children","getDropContainer","placeholder","onChange","onRemove","overflow","imageProps","disabled","classNames","styles"]);i.toRef(e,"prefixCls");const o=i.useSlots(),{getPrefixCls:r,direction:a}=Xe(),l=r("attachment",e.prefixCls),s=on("attachments"),c=i.computed(()=>s.value.classNames),u=i.computed(()=>s.value.styles),d=i.useTemplateRef("attachments-container"),f=i.useTemplateRef("attachments-upload"),[p,m,v]=Ov(l),g=i.computed(()=>le(m.value,v)),[y,b]=Te(e.items);i.watch(()=>e.items,()=>{b(e.items)});const S=C=>{var I;b(C.fileList),(I=e.onChange)==null||I.call(e,C)},$=i.computed(()=>({...n,fileList:y.value,onChange:S})),x=C=>Promise.resolve(typeof e.onRemove=="function"?e.onRemove(C):e.onRemove).then(I=>{if(I===!1)return;const M=y.value.filter(E=>E.uid!==C.uid);S({file:{...C,status:"removed"},fileList:M})}),w=(C,I,M)=>{const E=o.placeholder?o.placeholder({type:C}):typeof e.placeholder=="function"?e.placeholder(C):e.placeholder;return i.createVNode($M,{placeholder:E,upload:$.value,prefixCls:l,className:le(c.value.placeholder,e.classNames.placeholder),style:{...u.value.placeholder,...e.styles.placeholder,...I==null?void 0:I.style}},null)},P=i.computed(()=>y.value.length>0);return t({nativeElement:d.value,upload:C=>{var M,E;const I=(E=(M=f.value)==null?void 0:M.nativeElement)==null?void 0:E.querySelector('input[type="file"]');if(I){const R=new DataTransfer;R.items.add(C),I.files=R.files,I.dispatchEvent(new Event("change",{bubbles:!0}))}}}),()=>p(i.createVNode(wM,{value:{disabled:e.disabled}},{default:()=>[e.children?i.createVNode(i.Fragment,null,[i.createVNode(wv,{upload:$.value,rootClassName:e.rootClassName,ref:"attachments-upload",children:e.children},null),i.createVNode(Sv,{getDropContainer:e.getDropContainer,prefixCls:l,className:le(g.value,e.rootClassName),children:w("drop")},null)]):i.createVNode("div",{class:le(l,g.value,{[`${l}-rtl`]:a.value==="rtl"},e.className,e.rootClassName),style:{...e.rootStyle,...e.style},dir:a.value||"ltr",ref:"attachments-container"},[i.createVNode(BM,{prefixCls:l,items:y.value,onRemove:x,overflow:e.overflow,upload:$.value,listClassName:le(c.value.list,e.classNames.list),listStyle:{...u.value.list,...e.styles.list,...!P.value&&{display:"none"}},itemClassName:le(c.value.item,e.classNames.item),itemStyle:{...u.value.item,...e.styles.item},imageProps:e.imageProps},null),w("inline",P.value?{style:{display:"none"}}:{},f.value),i.createVNode(Sv,{getDropContainer:e.getDropContainer||(()=>d.value),prefixCls:l,className:g.value,children:w("drop")},null)])]}))}}),jM=Object.assign(zM,{FileCard:Pv}),FM=(e,t,n)=>{const o=i.computed(()=>{const s=i.toValue(e);let c={expandedKeys:[],onExpand:()=>{}};return s?(typeof s=="object"&&(c={...c,...s}),{enableCollapse:!0,customizeExpandedKeys:c.expandedKeys,customizeOnExpand:c.onExpand}):{enableCollapse:!1,customizeExpandedKeys:c.expandedKeys,customizeOnExpand:c.onExpand}}),[r,a]=Te(o.value.customizeExpandedKeys),l=s=>{var u,d;if(!o.value.enableCollapse)return;const c=r.value.includes(s)?r.value.filter(f=>f!==s):[...r.value,s];(d=(u=o.value).customizeOnExpand)==null||d.call(u,c),a(c)};return[i.computed(()=>o.value.enableCollapse),r,l]};var ia=(e=>(e.PENDING="pending",e.SUCCESS="success",e.ERROR="error",e))(ia||{});const HM=e=>{const{componentCls:t}=e,n=`${t}-item`,o={[ia.PENDING]:e.colorPrimaryText,[ia.SUCCESS]:e.colorSuccessText,[ia.ERROR]:e.colorErrorText},r=Object.keys(o);return r.reduce((a,l)=>{const s=o[l];return r.forEach(c=>{const u=`& ${n}-${l}-${c}`,d=l===c?{}:{backgroundColor:"none !important",backgroundImage:`linear-gradient(${s}, ${o[c]})`};a[u]={[`& ${n}-icon, & > *::before`]:{backgroundColor:`${s} !important`},"& > :last-child::before":d}}),a},{})},_M=e=>{const{calc:t,componentCls:n}=e,o=`${n}-item`,r={content:'""',width:t(e.lineWidth).mul(2).equal(),display:"block",position:"absolute",insetInlineEnd:"none",backgroundColor:e.colorTextPlaceholder};return{"& > :last-child > :last-child":{"&::before":{display:"none !important"},[`&${o}-footer`]:{"&::before":{display:"block !important",bottom:0}}},[`& > ${o}`]:{[`& ${o}-header, & ${o}-content, & ${o}-footer`]:{position:"relative","&::before":{bottom:t(e.itemGap).mul(-1).equal()}},[`& ${o}-header, & ${o}-content`]:{marginInlineStart:t(e.itemSize).mul(-1).equal(),"&::before":{...r,insetInlineStart:t(e.itemSize).div(2).sub(e.lineWidth).equal()}},[`& ${o}-header::before`]:{top:e.itemSize,bottom:t(e.itemGap).mul(-2).equal()},[`& ${o}-content::before`]:{top:"100%"},[`& ${o}-footer::before`]:{...r,top:0,insetInlineStart:t(e.itemSize).div(-2).sub(e.lineWidth).equal()}}}},kM=e=>{const{componentCls:t}=e,n=`${t}-item`;return{[n]:{display:"flex",flexDirection:"column",[`& ${n}-collapsible`]:{cursor:"pointer"},[`& ${n}-header`]:{display:"flex",marginBottom:e.itemGap,gap:e.itemGap,alignItems:"flex-start",[`& ${n}-icon`]:{height:e.itemSize,width:e.itemSize,fontSize:e.itemFontSize,display:"flex",justifyContent:"center",alignItems:"center"},[`& ${n}-extra`]:{height:e.itemSize,maxHeight:e.itemSize},[`& ${n}-header-box`]:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden",[`& ${n}-title`]:{height:e.itemSize,lineHeight:`${mt(e.itemSize)}`,maxHeight:e.itemSize,fontSize:e.itemFontSize,[`& ${n}-collapse-icon`]:{marginInlineEnd:e.marginXS}},[`& ${n}-desc`]:{fontSize:e.itemFontSize}}},[`& ${n}-content`]:{[`& ${n}-content-hidden`]:{display:"none"},[`& ${n}-content-box`]:{padding:e.itemGap,display:"inline-block",maxWidth:`calc(100% - ${e.itemSize})`,borderRadius:e.borderRadiusLG,backgroundColor:e.colorBgContainer,border:`${mt(e.lineWidth)} ${e.lineType} ${e.colorBorderSecondary}`}},[`& ${n}-footer`]:{marginTop:e.itemGap,display:"inline-flex"}}}},_c=(e,t="middle")=>{const{componentCls:n}=e,o={large:{itemSize:e.itemSizeLG,itemGap:e.itemGapLG,itemFontSize:e.itemFontSizeLG},middle:{itemSize:e.itemSize,itemGap:e.itemGap,itemFontSize:e.itemFontSize},small:{itemSize:e.itemSizeSM,itemGap:e.itemGapSM,itemFontSize:e.itemFontSizeSM}}[t];return{[`&${n}-${t}`]:{paddingInlineStart:o.itemSize,gap:o.itemGap,...kM({...e,...o}),..._M({...e,...o})}}},WM=e=>{const{componentCls:t}=e;return{[t]:{display:"flex",flexDirection:"column",...HM(e),..._c(e),..._c(e,"large"),..._c(e,"small"),[`&${t}-rtl`]:{direction:"rtl"}}}},UM=an("ThoughtChain",e=>{const t=wt(e,{itemFontSizeSM:e.fontSizeSM,itemSizeSM:e.calc(e.controlHeightXS).add(e.controlHeightSM).div(2).equal(),itemGapSM:e.marginSM,itemFontSize:e.fontSize,itemSize:e.calc(e.controlHeightSM).add(e.controlHeight).div(2).equal(),itemGap:e.margin,itemFontSizeLG:e.fontSizeLG,itemSizeLG:e.calc(e.controlHeight).add(e.controlHeightLG).div(2).equal(),itemGapLG:e.marginLG});return[WM(t),bv(t)]}),Nv=Symbol("ThoughtChainNodeContext"),kc=i.shallowRef(),XM=e=>{i.provide(Nv,e),i.watch(e,()=>{kc.value=i.unref(e),i.triggerRef(kc)},{immediate:!0,deep:!0})},KM=()=>i.inject(Nv,i.computed(()=>kc.value||{})),GM=i.defineComponent({props:{value:xt()},setup(e,{slots:t}){return XM(i.computed(()=>e.value)),()=>{var n;return(n=t.default)==null?void 0:n.call(t)}}}),qM=i.defineComponent({name:"AXThoughtChainNode",__name:"item",props:i.mergeDefaults({info:null,nextStatus:null,onClick:{type:Function}},{info:()=>({})}),setup(e){const t=He(e,["info","nextStatus","onClick"]),n=i.computed(()=>vo(t,{attr:!0,aria:!0,data:!0})),o=KM(),r=i.computed(()=>o.value.prefixCls),a=i.computed(()=>o.value.enableCollapse),l=i.computed(()=>o.value.expandedKeys),s=i.computed(()=>o.value.direction),c=i.computed(()=>o.value.classNames),u=i.computed(()=>o.value.styles),d=i.useId(),f=i.computed(()=>e.info.key??d),p=i.computed(()=>e.info.icon),m=i.computed(()=>e.info.title),v=i.computed(()=>e.info.extra),g=i.computed(()=>e.info.content),y=i.computed(()=>e.info.footer),b=i.computed(()=>e.info.status),S=i.computed(()=>e.info.description),$=i.computed(()=>`${r.value}-item`),x=()=>{var C;return(C=e.onClick)==null?void 0:C.call(e,f.value)},w=i.computed(()=>{var C;return(C=l.value)==null?void 0:C.includes(f.value)}),P=i.computed(()=>a.value?w.value:!0);return()=>i.createVNode("div",i.mergeProps(n.value,{class:le($.value,{[`${$.value}-${b.value}${e.nextStatus?`-${e.nextStatus}`:""}`]:b.value},t.class),style:t.style}),[i.createVNode("div",{class:le(`${$.value}-header`,c.value.itemHeader),style:u.value.itemHeader,onClick:x},[i.createVNode(wn,{icon:p.value,class:`${$.value}-icon`},null),i.createVNode("div",{class:le(`${$.value}-header-box`,{[`${$.value}-collapsible`]:a.value&&g.value})},[i.createVNode(Oe.Text,{strong:!0,ellipsis:{tooltip:{placement:s.value==="rtl"?"topRight":"topLeft",title:m.value}},class:`${$.value}-title`},{default:()=>[a.value&&g.value&&(s.value==="rtl"?i.createVNode(so,{class:`${$.value}-collapse-icon`,rotate:w.value?-90:0},null):i.createVNode(Zt,{class:`${$.value}-collapse-icon`,rotate:w.value?90:0},null)),m.value]}),S.value&&i.createVNode(Oe.Text,{class:`${$.value}-desc`,ellipsis:{tooltip:{placement:s.value==="rtl"?"topRight":"topLeft",title:S.value}},type:"secondary"},{default:()=>[S.value]})]),v.value&&i.createVNode("div",{class:`${$.value}-extra`},[v.value])]),i.createVNode($r,{prefixCls:r.value},{default:()=>[g.value&&i.withDirectives(i.createVNode("div",{class:le(`${$.value}-content`)},[i.createVNode("div",{class:le(`${$.value}-content-box`,c.value.itemContent),style:u.value.itemContent},[g.value])]),[[i.vShow,P.value]])]}),y.value&&i.createVNode("div",{class:le(`${$.value}-footer`,c.value.itemFooter),style:u.value.itemFooter},[y.value])])}}),YM=i.defineComponent({name:"AXThoughtChain",__name:"ThoughtChain",props:i.mergeDefaults({items:null,collapsible:{type:Boolean},size:null,styles:null,classNames:null,prefixCls:null,rootClassName:null},{styles:()=>({}),classNames:()=>({}),size:"middle"}),setup(e){const t=He(e,["prefixCls","rootClassName","class","items","collapsible","styles","style","classNames","size"]);i.toRef(e,"class"),i.toRef(e,"prefixCls");const n=i.computed(()=>vo(t,{attr:!0,aria:!0,data:!0})),{getPrefixCls:o,direction:r}=Xe(),a=i.computed(()=>o()),l=i.computed(()=>o("thought-chain",e.prefixCls)),s=on("thoughtChain"),[c,u,d]=FM(()=>e.collapsible,l.value,a.value),[f,p,m]=UM(l),v=i.computed(()=>le(e.class,e.rootClassName,l.value,s.value.className,p.value,m,{[`${l.value}-rtl`]:r.value==="rtl"},`${l.value}-${e.size}`));return()=>f(i.createVNode("div",i.mergeProps(n.value,{class:v.value,style:{...typeof s.value.style=="object"?s.value.style:{},...typeof e.style=="object"?e.style:{}}}),[i.createVNode(GM,{value:{prefixCls:l.value,enableCollapse:c.value,expandedKeys:u.value,direction:r.value,classNames:{itemHeader:le(s.value.classNames.itemHeader,e.classNames.itemHeader),itemContent:le(s.value.classNames.itemContent,e.classNames.itemContent),itemFooter:le(s.value.classNames.itemFooter,e.classNames.itemFooter)},styles:{itemHeader:{...s.value.styles.itemHeader,...e.styles.itemHeader},itemContent:{...s.value.styles.itemContent,...e.styles.itemContent},itemFooter:{...s.value.styles.itemFooter,...e.styles.itemFooter}}}},{default:()=>{var g;return[(g=e.items)==null?void 0:g.map((y,b)=>{var S;return i.createVNode(qM,{key:y.key||`key_${b}`,class:le(s.value.classNames.item,e.classNames.item),style:{...s.value.styles.item,...e.styles.item},info:{...y,icon:y.icon||b+1},onClick:d,nextStatus:((S=e.items[b+1])==null?void 0:S.status)||y.status},null)})]}})]))}}),ZM=`
|
|
293
293
|
|
|
294
294
|
`,QM=`
|
|
295
295
|
`,Tv=":",Wc=e=>(e??"").trim()!=="";function JM(){let e="";return new TransformStream({transform(t,n){e+=t;const o=e.split(ZM);o.slice(0,-1).forEach(r=>{Wc(r)&&n.enqueue(r)}),e=o[o.length-1]},flush(t){Wc(e)&&t.enqueue(e)}})}function e5(){return new TransformStream({transform(e,t){const o=e.split(QM).reduce((r,a)=>{const l=a.indexOf(Tv);if(l===-1)throw new Error(`The key-value separator "${Tv}" is not found in the sse line chunk!`);const s=a.slice(0,l);if(!Wc(s))return r;const c=a.slice(l+1);return{...r,[s]:c}},{});Object.keys(o).length!==0&&t.enqueue(o)}})}function Uc(e){const{readableStream:t,transformStream:n}=e;if(!(t instanceof ReadableStream))throw new Error("The options.readableStream must be an instance of ReadableStream.");const o=new TextDecoderStream,r=n?t.pipeThrough(o).pipeThrough(n):t.pipeThrough(o).pipeThrough(JM()).pipeThrough(e5());return r[Symbol.asyncIterator]=async function*(){const a=this.getReader();for(;;){const{done:l,value:s}=await a.read();if(l)break;s&&(yield s)}},r}const Ev=async(e,t={})=>{const{fetch:n=globalThis.fetch,middlewares:o={},...r}=t;if(typeof n!="function")throw new Error("The options.fetch must be a typeof fetch function!");let a=[e,r];typeof o.onRequest=="function"&&(a=await o.onRequest(...a));let l=await n(...a);if(typeof o.onResponse=="function"){const s=await o.onResponse(l);if(!(s instanceof Response))throw new Error("The options.onResponse must return a Response instance!");l=s}if(!l.ok)throw new Error(`Fetch failed with status ${l.status}`);if(!l.body)throw new Error("The response body is empty.");return l},An=class An{constructor(t){this.create=async(l,s,c)=>{var d;const u={method:"POST",body:JSON.stringify({model:this.model,...l}),headers:this.defaultHeaders};try{const f=await Ev(this.baseURL,{fetch:this.customOptions.fetch,...u});if(c){await this.customResponseHandler(f,s,c);return}const p=f.headers.get("content-type")||"";switch(p.split(";")[0].trim()){case"text/event-stream":await this.sseResponseHandler(f,s);break;case"application/json":await this.jsonResponseHandler(f,s);break;default:throw new Error(`The response content-type: ${p} is not support!`)}}catch(f){const p=f instanceof Error?f:new Error("Unknown error!");throw(d=s==null?void 0:s.onError)==null||d.call(s,p),p}},this.customResponseHandler=async(l,s,c)=>{var d,f;const u=[];for await(const p of Uc({readableStream:l.body,transformStream:c}))u.push(p),(d=s==null?void 0:s.onUpdate)==null||d.call(s,p);(f=s==null?void 0:s.onSuccess)==null||f.call(s,u)},this.sseResponseHandler=async(l,s)=>{var u,d;const c=[];for await(const f of Uc({readableStream:l.body}))c.push(f),(u=s==null?void 0:s.onUpdate)==null||u.call(s,f);(d=s==null?void 0:s.onSuccess)==null||d.call(s,c)},this.jsonResponseHandler=async(l,s)=>{var u,d;const c=await l.json();(u=s==null?void 0:s.onUpdate)==null||u.call(s,c),(d=s==null?void 0:s.onSuccess)==null||d.call(s,[c])};const{baseURL:n,model:o,dangerouslyApiKey:r,...a}=t;this.baseURL=t.baseURL,this.model=t.model,this.defaultHeaders={"Content-Type":"application/json",...t.dangerouslyApiKey&&{Authorization:t.dangerouslyApiKey}},this.customOptions=a}static init(t){if(!t.baseURL||typeof t.baseURL!="string")throw new Error("The baseURL is not valid!");const n=t.fetch||t.baseURL;return An.instanceBuffer.has(n)||An.instanceBuffer.set(n,new An(t)),An.instanceBuffer.get(n)}};An.instanceBuffer=new Map;let Xc=An;const Rv=Xc.init;let Mv=0;class Av{constructor(t){this.requestingMap={},this.request=(n,o)=>{const{request:r}=this.config,{onUpdate:a,onSuccess:l,onError:s}=o,c=Mv;Mv+=1,this.requestingMap[c]=!0,r==null||r(n,{onUpdate:u=>{this.requestingMap[c]&&a(u)},onSuccess:u=>{this.requestingMap[c]&&(l(u),this.finishRequest(c))},onError:u=>{this.requestingMap[c]&&(s(u),this.finishRequest(c))}})},this.config=t}finishRequest(t){delete this.requestingMap[t]}isRequesting(){return Object.keys(this.requestingMap).length>0}}function t5(e){const{request:t,...n}=e;return[i.computed(()=>new Av({request:t||Rv({baseURL:n.baseURL,model:n.model,dangerouslyApiKey:n.dangerouslyApiKey}).create,...n}))]}function n5(e,t){const n=i.ref(e);function o(r){const a=typeof r=="function"?r(n.value):r;a!==n.value&&t(a,n.value),n.value=a}return[n,o]}function o5(e){return Array.isArray(e)?e:[e]}function r5(e){const{defaultMessages:t,agent:n,requestFallback:o,requestPlaceholder:r,parser:a}=e,l=i.ref(0),s=i.computed(()=>(t||[]).map((g,y)=>({id:`default_${y}`,status:"local",...g}))),[c,u]=n5(s.value,()=>{}),d=(g,y)=>{const b={id:`msg_${l.value}`,message:g,status:y};return l.value+=1,b},f=i.computed(()=>{const g=[];return c.value.forEach(y=>{const b=a?a(y.message):y.message,S=o5(b);S.forEach(($,x)=>{let w=y.id;S.length>1&&(w=`${w}_${x}`),g.push({id:w,message:$,status:y.status})})}),g}),p=g=>g.filter(y=>y.status!=="loading"&&y.status!=="error").map(y=>y.message),m=()=>p(c.value);return{onRequest:Zi(g=>{if(!n)throw new Error("The agent parameter is required when using the onRequest method in an agent generated by useXAgent.");let y=null;u($=>{let x=[...$,d(g,"local")];if(r){let w;typeof r=="function"?w=r(g,{messages:p(x)}):w=r;const P=d(w,"loading");y=P.id,x=[...x,P]}return x});let b=null;const S=($,x)=>{let w=c.value.find(P=>P.id===b);return w?u(P=>P.map(C=>C.id===b?{...C,message:$,status:x}:C)):(w=d($,x),u(P=>[...P.filter(I=>I.id!==y),w]),b=w.id),w};n.request({message:g,messages:m()},{onUpdate:$=>{S($,"loading")},onSuccess:$=>{S($,"success")},onError:async $=>{if(o){let x;typeof o=="function"?x=await o(g,{error:$,messages:m()}):x=o,u(w=>[...w.filter(P=>P.id!==y&&P.id!==b),d(x,"error")])}else u(x=>x.filter(w=>w.id!==y&&w.id!==b))}})}),messages:c,parsedMessages:f,setMessages:u}}me.Attachments=jM,me.Bubble=zR,me.BubbleList=sv,me.Conversations=XR,me.Prompts=fv,me.Sender=CM,me.Suggestion=rM,me.ThoughtChain=YM,me.Welcome=ZR,me.XAgent=Av,me.XFetch=Ev,me.XProvider=c8,me.XRequest=Rv,me.XStream=Uc,me.defaultPrefixCls=Gv,me.theme=vr,me.useXAgent=t5,me.useXChat=r5,me.useXProviderContext=Xe,Object.defineProperty(me,Symbol.toStringTag,{value:"Module"})});
|
|
@@ -4,9 +4,9 @@ type __VLS_Props = {
|
|
|
4
4
|
declare function __VLS_template(): {
|
|
5
5
|
attrs: Partial<{}>;
|
|
6
6
|
slots: Readonly<{
|
|
7
|
-
default(props?: any): any;
|
|
7
|
+
default?(props?: any): any;
|
|
8
8
|
}> & {
|
|
9
|
-
default(props?: any): any;
|
|
9
|
+
default?(props?: any): any;
|
|
10
10
|
};
|
|
11
11
|
refs: {};
|
|
12
12
|
rootEl: any;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ant-design-x-vue",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.9",
|
|
4
4
|
"description": "Craft AI-driven interfaces effortlessly",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"AI",
|
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
"prettier-plugin-packagejson": "^2.2.18",
|
|
118
118
|
"stylelint": "^14.9.1",
|
|
119
119
|
"typescript": "~5.8.0",
|
|
120
|
-
"unplugin-vue-macros": "^2.
|
|
120
|
+
"unplugin-vue-macros": "^2.14.5",
|
|
121
121
|
"vite": "^5.4.8",
|
|
122
122
|
"vite-plugin-inspect": "^0.8.9",
|
|
123
123
|
"vitepress": "^1.5.0",
|