ant-design-x-vue 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
[![npm version][npm-version-src]][npm-version-href]
|
|
4
4
|
[![npm downloads][npm-downloads-src]][npm-downloads-href]
|
|
5
5
|
[![bundle][bundle-src]][bundle-href]
|
|
6
|
+
![vue][vue-version-src]
|
|
6
7
|
[![Github Actions][github-actions-src]][github-actions-href]
|
|
7
8
|
![Netlify Build][netlify-build-src]
|
|
8
9
|
[![License][license-src]][license-href]
|
|
@@ -110,6 +111,7 @@ $ pnpm lint
|
|
|
110
111
|
[npm-downloads-href]: https://npmjs.com/package/ant-design-x-vue
|
|
111
112
|
[bundle-src]: https://img.shields.io/bundlephobia/minzip/ant-design-x-vue?style=flat
|
|
112
113
|
[bundle-href]: https://bundlephobia.com/result?p=ant-design-x-vue
|
|
114
|
+
[vue-version-src]: https://img.shields.io/badge/vue-%20%3E%3D%203.5-47c219
|
|
113
115
|
[github-actions-src]: https://img.shields.io/github/actions/workflow/status/wzc520pyfm/ant-design-x-vue/ci.yml?branch=main&style=flat
|
|
114
116
|
[github-actions-href]: https://github.com/wzc520pyfm/ant-design-x-vue/actions?query=workflow%3Aci
|
|
115
117
|
[netlify-build-src]: https://img.shields.io/netlify/cb006e4e-afce-4c3e-9652-6f8a065b5b6e
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var cy = Object.defineProperty;
|
|
2
2
|
var uy = (e, t, n) => t in e ? cy(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
3
|
var to = (e, t, n) => uy(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
-
import { computed as S, inject as ye, provide as be, shallowRef as K, defineComponent as k, watch as Q, unref as le, triggerRef as Lt, Fragment as Te, isVNode as Dt, Comment as dy, Text as Cm, reactive as Ge, getCurrentInstance as It, onMounted as xe, onUpdated as Lo, onUnmounted as qn, ref as G, watchEffect as $e, onBeforeUnmount as Be, createVNode as f, h as $o, Transition as Bt, withDirectives as Gt, resolveDirective as fy, cloneVNode as Is, nextTick as He, toRef as Ee, withModifiers as xu, vShow as bn, onBeforeMount as py, Teleport as Qi, createTextVNode as gr, isRef as my, toRefs as Ts, toRaw as xo, render as vr, onBeforeUpdate as Sm, TransitionGroup as Es, createApp as gy, useSlots as Tt, mergeProps as We, onWatcherCleanup as Bo, toValue as Ne, mergeDefaults as
|
|
4
|
+
import { computed as S, inject as ye, provide as be, shallowRef as K, defineComponent as k, watch as Q, unref as le, triggerRef as Lt, Fragment as Te, isVNode as Dt, Comment as dy, Text as Cm, reactive as Ge, getCurrentInstance as It, onMounted as xe, onUpdated as Lo, onUnmounted as qn, ref as G, watchEffect as $e, onBeforeUnmount as Be, createVNode as f, h as $o, Transition as Bt, withDirectives as Gt, resolveDirective as fy, cloneVNode as Is, nextTick as He, toRef as Ee, withModifiers as xu, vShow as bn, onBeforeMount as py, Teleport as Qi, createTextVNode as gr, isRef as my, toRefs as Ts, toRaw as xo, render as vr, onBeforeUpdate as Sm, TransitionGroup as Es, createApp as gy, useSlots as Tt, mergeProps as We, onWatcherCleanup as Bo, toValue as Ne, mergeDefaults as Je, useAttrs as $m, useTemplateRef as wo, openBlock as xm, createElementBlock as wm, createElementVNode as go, useId as vy } from "vue";
|
|
5
5
|
const hr = function() {
|
|
6
6
|
for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
|
|
7
7
|
t[n] = arguments[n];
|
|
@@ -19514,7 +19514,7 @@ Ui.newInstance = function(t, n) {
|
|
|
19514
19514
|
let {
|
|
19515
19515
|
attrs: $
|
|
19516
19516
|
} = b;
|
|
19517
|
-
const w = K(), O = S(() =>
|
|
19517
|
+
const w = K(), O = S(() => Qe.getPrefixCls(r, l)), [, x] = d(O);
|
|
19518
19518
|
return xe(() => {
|
|
19519
19519
|
n({
|
|
19520
19520
|
notice(I) {
|
|
@@ -19531,7 +19531,7 @@ Ui.newInstance = function(t, n) {
|
|
|
19531
19531
|
component: w
|
|
19532
19532
|
});
|
|
19533
19533
|
}), () => {
|
|
19534
|
-
const I =
|
|
19534
|
+
const I = Qe, C = I.getRootPrefixCls(s, O.value), E = c ? u : `${O.value}-${u}`;
|
|
19535
19535
|
return f(So, B(B({}, I), {}, {
|
|
19536
19536
|
prefixCls: C
|
|
19537
19537
|
}), {
|
|
@@ -20908,24 +20908,24 @@ var h3 = function(e, t) {
|
|
|
20908
20908
|
};
|
|
20909
20909
|
const y3 = "ant";
|
|
20910
20910
|
function Co() {
|
|
20911
|
-
return
|
|
20911
|
+
return Qe.prefixCls || y3;
|
|
20912
20912
|
}
|
|
20913
20913
|
function jh() {
|
|
20914
|
-
return
|
|
20914
|
+
return Qe.iconPrefixCls || As;
|
|
20915
20915
|
}
|
|
20916
|
-
const Lc = Ge({}),
|
|
20916
|
+
const Lc = Ge({}), Qe = Ge({});
|
|
20917
20917
|
$e(() => {
|
|
20918
|
-
v(
|
|
20918
|
+
v(Qe, Lc), Qe.prefixCls = Co(), Qe.iconPrefixCls = jh(), Qe.getPrefixCls = (e, t) => t || (e ? `${Qe.prefixCls}-${e}` : Qe.prefixCls), Qe.getRootPrefixCls = () => Qe.prefixCls ? Qe.prefixCls : Co();
|
|
20919
20919
|
});
|
|
20920
20920
|
let dl;
|
|
20921
20921
|
const b3 = (e) => {
|
|
20922
20922
|
dl && dl(), dl = $e(() => {
|
|
20923
|
-
v(Lc, Ge(e)), v(
|
|
20923
|
+
v(Lc, Ge(e)), v(Qe, Ge(e));
|
|
20924
20924
|
}), e.theme && m3(Co(), e.theme);
|
|
20925
20925
|
}, C3 = () => ({
|
|
20926
20926
|
getPrefixCls: (e, t) => t || (e ? `${Co()}-${e}` : Co()),
|
|
20927
20927
|
getIconPrefixCls: jh,
|
|
20928
|
-
getRootPrefixCls: () =>
|
|
20928
|
+
getRootPrefixCls: () => Qe.prefixCls ? Qe.prefixCls : Co()
|
|
20929
20929
|
}), So = k({
|
|
20930
20930
|
compatConfig: {
|
|
20931
20931
|
MODE: 3
|
|
@@ -29850,7 +29850,7 @@ const { genStyleHooks: wn, genComponentStyleHook: v7, genSubStyleComponent: h7 }
|
|
|
29850
29850
|
}), T0 = /* @__PURE__ */ k({
|
|
29851
29851
|
name: "AXBubble",
|
|
29852
29852
|
__name: "Bubble",
|
|
29853
|
-
props:
|
|
29853
|
+
props: Je({
|
|
29854
29854
|
prefixCls: null,
|
|
29855
29855
|
rootClassName: null,
|
|
29856
29856
|
styles: null,
|
|
@@ -30087,7 +30087,7 @@ const AA = 1, MA = /* @__PURE__ */ k({
|
|
|
30087
30087
|
name: "AXBubbleList",
|
|
30088
30088
|
inheritAttrs: !1,
|
|
30089
30089
|
__name: "BubbleList",
|
|
30090
|
-
props:
|
|
30090
|
+
props: Je({
|
|
30091
30091
|
prefixCls: null,
|
|
30092
30092
|
rootClassName: null,
|
|
30093
30093
|
items: null,
|
|
@@ -30472,7 +30472,7 @@ const Ol = "__ungrouped", LA = (e, t = []) => {
|
|
|
30472
30472
|
), b7 = /* @__PURE__ */ k({
|
|
30473
30473
|
name: "AXConversations",
|
|
30474
30474
|
__name: "Conversations",
|
|
30475
|
-
props:
|
|
30475
|
+
props: Je({
|
|
30476
30476
|
items: null,
|
|
30477
30477
|
activeKey: null,
|
|
30478
30478
|
defaultActiveKey: null,
|
|
@@ -30623,7 +30623,7 @@ function kA(e) {
|
|
|
30623
30623
|
const C7 = /* @__PURE__ */ k({
|
|
30624
30624
|
name: "AXWelcome",
|
|
30625
30625
|
__name: "Welcome",
|
|
30626
|
-
props:
|
|
30626
|
+
props: Je({
|
|
30627
30627
|
prefixCls: null,
|
|
30628
30628
|
rootClassName: null,
|
|
30629
30629
|
className: null,
|
|
@@ -30830,7 +30830,7 @@ const C7 = /* @__PURE__ */ k({
|
|
|
30830
30830
|
), qA = /* @__PURE__ */ k({
|
|
30831
30831
|
name: "AXPrompts",
|
|
30832
30832
|
__name: "Prompts",
|
|
30833
|
-
props:
|
|
30833
|
+
props: Je({
|
|
30834
30834
|
items: null,
|
|
30835
30835
|
title: null,
|
|
30836
30836
|
onItemClick: {
|
|
@@ -31015,7 +31015,7 @@ function JA(e, t, n, o, r) {
|
|
|
31015
31015
|
const S7 = /* @__PURE__ */ k({
|
|
31016
31016
|
name: "AXSuggestion",
|
|
31017
31017
|
__name: "Suggestion",
|
|
31018
|
-
props:
|
|
31018
|
+
props: Je({
|
|
31019
31019
|
prefixCls: null,
|
|
31020
31020
|
className: null,
|
|
31021
31021
|
rootClassName: null,
|
|
@@ -31137,7 +31137,7 @@ const S7 = /* @__PURE__ */ k({
|
|
|
31137
31137
|
}), Ra = /* @__PURE__ */ k({
|
|
31138
31138
|
name: "AXSenderActionButton",
|
|
31139
31139
|
__name: "index",
|
|
31140
|
-
props:
|
|
31140
|
+
props: Je({
|
|
31141
31141
|
prefixCls: null,
|
|
31142
31142
|
type: null,
|
|
31143
31143
|
htmlType: null,
|
|
@@ -31184,7 +31184,7 @@ const S7 = /* @__PURE__ */ k({
|
|
|
31184
31184
|
}), iM = /* @__PURE__ */ k({
|
|
31185
31185
|
name: "AXSenderClearButton",
|
|
31186
31186
|
__name: "ClearButton",
|
|
31187
|
-
props:
|
|
31187
|
+
props: Je({
|
|
31188
31188
|
prefixCls: null,
|
|
31189
31189
|
type: null,
|
|
31190
31190
|
htmlType: null,
|
|
@@ -31264,7 +31264,7 @@ const S7 = /* @__PURE__ */ k({
|
|
|
31264
31264
|
}), um = /* @__PURE__ */ k({
|
|
31265
31265
|
name: "AXSenderLoadingButton",
|
|
31266
31266
|
__name: "LoadingButton",
|
|
31267
|
-
props:
|
|
31267
|
+
props: Je({
|
|
31268
31268
|
prefixCls: null,
|
|
31269
31269
|
type: null,
|
|
31270
31270
|
htmlType: null,
|
|
@@ -31311,7 +31311,7 @@ const S7 = /* @__PURE__ */ k({
|
|
|
31311
31311
|
}), dm = /* @__PURE__ */ k({
|
|
31312
31312
|
name: "AXSenderLoadingButton",
|
|
31313
31313
|
__name: "SendButton",
|
|
31314
|
-
props:
|
|
31314
|
+
props: Je({
|
|
31315
31315
|
prefixCls: null,
|
|
31316
31316
|
type: null,
|
|
31317
31317
|
htmlType: null,
|
|
@@ -31392,7 +31392,7 @@ const S7 = /* @__PURE__ */ k({
|
|
|
31392
31392
|
}), pm = /* @__PURE__ */ k({
|
|
31393
31393
|
name: "AXSenderSpeechButton",
|
|
31394
31394
|
__name: "index",
|
|
31395
|
-
props:
|
|
31395
|
+
props: Je({
|
|
31396
31396
|
prefixCls: null,
|
|
31397
31397
|
type: null,
|
|
31398
31398
|
htmlType: null,
|
|
@@ -31520,6 +31520,12 @@ const sM = (e) => {
|
|
|
31520
31520
|
paddingInlineStart: e.padding,
|
|
31521
31521
|
paddingInlineEnd: e.paddingXS,
|
|
31522
31522
|
display: "flex",
|
|
31523
|
+
borderRadius: {
|
|
31524
|
+
_skip_check_: !0,
|
|
31525
|
+
value: n(e.borderRadius).mul(2).equal()
|
|
31526
|
+
},
|
|
31527
|
+
borderBottomRightRadius: 0,
|
|
31528
|
+
borderBottomLeftRadius: 0,
|
|
31523
31529
|
[`${o}-title`]: {
|
|
31524
31530
|
flex: "auto"
|
|
31525
31531
|
}
|
|
@@ -31735,72 +31741,58 @@ function pM(e, t) {
|
|
|
31735
31741
|
const mM = /* @__PURE__ */ k({
|
|
31736
31742
|
name: "AXSender",
|
|
31737
31743
|
__name: "Sender",
|
|
31738
|
-
props:
|
|
31739
|
-
onKeyPress: {
|
|
31740
|
-
|
|
31741
|
-
},
|
|
31742
|
-
|
|
31743
|
-
|
|
31744
|
-
|
|
31745
|
-
defaultValue: null,
|
|
31746
|
-
value: null,
|
|
31744
|
+
props: {
|
|
31745
|
+
onKeyPress: {},
|
|
31746
|
+
onFocus: {},
|
|
31747
|
+
onBlur: {},
|
|
31748
|
+
prefixCls: {},
|
|
31749
|
+
defaultValue: {},
|
|
31750
|
+
value: {},
|
|
31747
31751
|
loading: {
|
|
31748
31752
|
type: Boolean
|
|
31749
31753
|
},
|
|
31750
|
-
placeholder:
|
|
31754
|
+
placeholder: {},
|
|
31751
31755
|
readOnly: {
|
|
31752
31756
|
type: Boolean
|
|
31753
31757
|
},
|
|
31754
31758
|
submitType: {
|
|
31755
|
-
type: [String, Boolean]
|
|
31759
|
+
type: [String, Boolean],
|
|
31760
|
+
default: "enter"
|
|
31756
31761
|
},
|
|
31757
31762
|
disabled: {
|
|
31758
|
-
type: Boolean
|
|
31759
|
-
|
|
31760
|
-
onSubmit: {
|
|
31761
|
-
type: Function
|
|
31762
|
-
},
|
|
31763
|
-
onChange: {
|
|
31764
|
-
type: Function
|
|
31765
|
-
},
|
|
31766
|
-
onCancel: null,
|
|
31767
|
-
onKeyDown: {
|
|
31768
|
-
type: Function
|
|
31769
|
-
},
|
|
31770
|
-
onPaste: {
|
|
31771
|
-
type: Function
|
|
31772
|
-
},
|
|
31773
|
-
onPasteFile: {
|
|
31774
|
-
type: Function
|
|
31763
|
+
type: Boolean,
|
|
31764
|
+
default: void 0
|
|
31775
31765
|
},
|
|
31776
|
-
|
|
31777
|
-
|
|
31778
|
-
|
|
31779
|
-
|
|
31780
|
-
|
|
31781
|
-
|
|
31766
|
+
onSubmit: {},
|
|
31767
|
+
onChange: {},
|
|
31768
|
+
onCancel: {},
|
|
31769
|
+
onKeyDown: {},
|
|
31770
|
+
onPaste: {},
|
|
31771
|
+
onPasteFile: {},
|
|
31772
|
+
components: {},
|
|
31773
|
+
styles: {
|
|
31774
|
+
default: () => ({})
|
|
31775
|
+
},
|
|
31776
|
+
rootClassName: {},
|
|
31777
|
+
classNames: {
|
|
31778
|
+
default: () => ({})
|
|
31779
|
+
},
|
|
31780
|
+
style: {},
|
|
31781
|
+
className: {},
|
|
31782
31782
|
actions: {
|
|
31783
|
-
type: [Function, Boolean]
|
|
31784
|
-
|
|
31785
|
-
allowSpeech: null,
|
|
31786
|
-
prefix: null,
|
|
31787
|
-
footer: {
|
|
31788
|
-
type: Function
|
|
31783
|
+
type: [Object, Function, Boolean],
|
|
31784
|
+
default: void 0
|
|
31789
31785
|
},
|
|
31790
|
-
|
|
31786
|
+
allowSpeech: {},
|
|
31787
|
+
prefix: {},
|
|
31788
|
+
footer: {},
|
|
31789
|
+
header: {},
|
|
31791
31790
|
autoSize: {
|
|
31792
|
-
|
|
31791
|
+
default: () => ({
|
|
31792
|
+
maxRows: 8
|
|
31793
|
+
})
|
|
31793
31794
|
}
|
|
31794
|
-
},
|
|
31795
|
-
styles: () => ({}),
|
|
31796
|
-
classNames: () => ({}),
|
|
31797
|
-
submitType: "enter",
|
|
31798
|
-
actions: void 0,
|
|
31799
|
-
disabled: void 0,
|
|
31800
|
-
autoSize: () => ({
|
|
31801
|
-
maxRows: 8
|
|
31802
|
-
})
|
|
31803
|
-
}),
|
|
31795
|
+
},
|
|
31804
31796
|
emits: ["update:value"],
|
|
31805
31797
|
setup(e, {
|
|
31806
31798
|
expose: t,
|
|
@@ -31949,9 +31941,7 @@ const mM = /* @__PURE__ */ k({
|
|
|
31949
31941
|
...e.styles.input
|
|
31950
31942
|
},
|
|
31951
31943
|
class: de(h.value, m.value.classNames.input, e.classNames.input),
|
|
31952
|
-
autoSize:
|
|
31953
|
-
maxRows: 8
|
|
31954
|
-
},
|
|
31944
|
+
autoSize: e.autoSize,
|
|
31955
31945
|
value: x.value,
|
|
31956
31946
|
onChange: (W) => {
|
|
31957
31947
|
C(W.target.value, W), R(!0);
|
|
@@ -31983,7 +31973,7 @@ const mM = /* @__PURE__ */ k({
|
|
|
31983
31973
|
name: "AXSenderHeader",
|
|
31984
31974
|
inheritAttrs: !1,
|
|
31985
31975
|
__name: "SenderHeader",
|
|
31986
|
-
props:
|
|
31976
|
+
props: Je({
|
|
31987
31977
|
forceRender: {
|
|
31988
31978
|
type: Boolean
|
|
31989
31979
|
},
|
|
@@ -32077,7 +32067,7 @@ const mM = /* @__PURE__ */ k({
|
|
|
32077
32067
|
}), yM = /* @__PURE__ */ k({
|
|
32078
32068
|
name: "AXAttachmentsPlaceholderUploader",
|
|
32079
32069
|
__name: "PlaceholderUploader",
|
|
32080
|
-
props:
|
|
32070
|
+
props: Je({
|
|
32081
32071
|
prefixCls: null,
|
|
32082
32072
|
placeholder: null,
|
|
32083
32073
|
upload: null,
|
|
@@ -33228,7 +33218,7 @@ const EM = (e) => {
|
|
|
33228
33218
|
}), NM = /* @__PURE__ */ k({
|
|
33229
33219
|
name: "AXAttachments",
|
|
33230
33220
|
__name: "Attachments",
|
|
33231
|
-
props:
|
|
33221
|
+
props: Je({
|
|
33232
33222
|
capture: null,
|
|
33233
33223
|
type: null,
|
|
33234
33224
|
name: null,
|
|
@@ -33671,7 +33661,7 @@ const LM = (e) => {
|
|
|
33671
33661
|
}), kM = /* @__PURE__ */ k({
|
|
33672
33662
|
name: "AXThoughtChainNode",
|
|
33673
33663
|
__name: "item",
|
|
33674
|
-
props:
|
|
33664
|
+
props: Je({
|
|
33675
33665
|
info: null,
|
|
33676
33666
|
nextStatus: null,
|
|
33677
33667
|
onClick: {
|
|
@@ -33755,7 +33745,7 @@ const LM = (e) => {
|
|
|
33755
33745
|
}), w7 = /* @__PURE__ */ k({
|
|
33756
33746
|
name: "AXThoughtChain",
|
|
33757
33747
|
__name: "ThoughtChain",
|
|
33758
|
-
props:
|
|
33748
|
+
props: Je({
|
|
33759
33749
|
items: null,
|
|
33760
33750
|
collapsible: {
|
|
33761
33751
|
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]+/),Y8="aria-",Z8="data-";function _0(e,t){return e.indexOf(t)===0}function go(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"||_0(r,Y8))||n.data&&_0(r,Z8)||n.attr&&(H0.includes(r)||H0.includes(r.toLowerCase())))&&(o[r]=e[r])}),o}function Q8(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=Gi(l=>{l===i.unref(r)&&n(i.unref(t)+1)});return[o,a]}function J8(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 eR=1,k0=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=je(e,["prefixCls","rootClassName","items","autoScroll","roles"]);i.toRef(e,"roles"),i.toRef(e,"items"),i.toRef(e,"prefixCls");const o=i.useAttrs(),r=go(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}=We(),d=u("bubble",e.prefixCls),f=`${d}-list`,[p,m,v]=L0(d),[g,y]=Te(!1);i.watchEffect(()=>{y(!0),i.onWatcherCleanup(()=>{y(!1)})});const b=J8(a,l),[S,$]=Q8(b),[x,w]=Te(!0),[P,C]=Te(0),I=R=>{const z=R.target;w(z.scrollHeight-Math.abs(z.scrollTop)-z.clientHeight<=eR)};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:T=0}=(j==null?void 0:j.getBoundingClientRect())??{},{top:D,bottom:V}=i.unref(s).getBoundingClientRect();O<V&&T>D&&(C(i.unref(P)+1),w(!0))}}});const M=Gi(()=>{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 T=i.unref(S).findIndex(D=>D.key===R);w(T===i.unref(S).length-1),O.nativeElement.scrollIntoView({behavior:A,block:j})}}}}),()=>p(i.createVNode(G8,{value:E.value},{default:()=>[i.createVNode("div",i.mergeProps(r,{class:ae(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(j0,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))])]}))}}),tR=Object.assign(j0,{List:k0}),nR=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=je(e,["prefixCls","info","class","direction","onClick","active","menu"]);i.toRef(e,"class");const n=i.computed(()=>go(t,{aria:!0,data:!0,attr:!0})),o=g=>{g.stopPropagation()},r=i.computed(()=>e.info.disabled),[a,l]=Te(!1),[s,c]=Te(!1),u=i.computed(()=>ae(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=g=>{g&&c(!g)},p=i.computed(()=>{var g;return(g=e.menu)==null?void 0:g.trigger}),m=i.computed(()=>{const{trigger:g,...y}=e.menu||{};return y}),v=g=>{const y=i.createVNode(Yo,{onClick:o,class:`${e.prefixCls}-menu-icon`},null);return p.value?typeof p.value=="function"?p.value(g,{originNode:y}):p.value:y};return()=>i.createVNode(Kt,{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]}),!r.value&&e.menu&&i.createVNode(Sn,{placement:e.direction==="rtl"?"bottomLeft":"bottomRight",trigger:["click"],disabled:r.value,onOpenChange:f},{default:()=>v(e.info),overlay:()=>i.createVNode(Yt,m.value,null)})])]})}}),W0=Symbol("GroupTitleContext"),vc=i.shallowRef(),oR=e=>{i.provide(W0,e),i.watch(e,()=>{vc.value=i.unref(e),i.triggerRef(vc)},{immediate:!0,deep:!0})},rR=()=>i.inject(W0,i.computed(()=>vc.value||{})),iR=i.defineComponent({props:{value:St()},setup(e,{slots:t}){return oR(i.computed(()=>e.value)),()=>{var n;return(n=t.default)==null?void 0:n.call(t)}}}),X0=i.defineComponent({name:"AXConversationsGroupTitle",__name:"GroupTitle",setup(e){const t=i.useSlots(),n=rR(),o=i.computed(()=>{var r;return(r=t.default)==null?void 0:r.call(t)});return()=>i.createVNode("div",{class:ae(`${n.value.prefixCls}-group-title`)},[o.value&&i.createVNode(Oe.Text,null,{default:()=>[o.value]})])}});function U0(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 yc="__ungrouped",aR=(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:yc,data:i.toValue(t),title:void 0}],enableGroup:n.value.enableGroup};const o=i.toValue(t).reduce((l,s)=>{const c=s.group||yc;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===yc?void 0:l,title:n.value.title,data:o[l]})),enableGroup:n.value.enableGroup}})},lR=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 ${ft(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 ${ft(e.paddingXS)}`}}}},sR=nn("Conversations",e=>{const t=Ct(e,{});return lR(t)},()=>({})),cR=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=je(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(()=>go(t,{attr:!0,aria:!0,data:!0})),[r,a]=U0(e.defaultActiveKey,{value:n});i.watch(()=>e.activeKey,()=>{n.value=e.activeKey});const l=aR(()=>e.groupable,()=>e.items),{getPrefixCls:s,direction:c}=We(),u=i.computed(()=>s("conversations",e.prefixCls)),d=en("conversations"),[f,p,m]=sR(u),v=i.computed(()=>ae(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(nR,{key:$.key||`key-${x}`,info:$,prefixCls:u.value,direction:c.value,class:ae(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(iR,{value:{prefixCls:u.value}},{default:()=>{var $;return[(($=y.title)==null?void 0:$.call(y,y.name,{components:{GroupTitle:X0}}))||i.createVNode(X0,{key:y.name},{default:()=>[y.name]})]}}),i.createVNode("ul",{class:`${u.value}-list`},[S])]):S})]))}}),uR=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"}}}}},dR=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}}}}},fR=nn("Welcome",e=>{const t=Ct(e,{});return[uR(t),dR(t)]},()=>({}));function pR(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!i.isVNode(e)}const mR=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}=We(),r=o("welcome",e.prefixCls),a=en("welcome"),[l,s,c]=fR(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:ae(`${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:ae(`${r}-title`,a.value.classNames.title,e.classNames.title),style:e.styles.title},pR(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:ae(`${r}-extra`,a.value.classNames.extra,e.classNames.extra),style:e.styles.extra},[m]):null});return()=>l(i.createVNode(pr,{class:ae(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(pr,{vertical:!0,class:`${r}-content-wrapper`},{default:()=>[t.extra||e.extra?i.createVNode(pr,{align:"flex-start",class:`${r}-title-wrapper`},{default:()=>[d.value,p.value]}):d.value,f.value&&i.createVNode(Oe.Text,{class:ae(`${r}-description`,a.value.classNames.description,e.classNames.description),style:e.styles.description},{default:()=>[f.value]})]})]}))}}),gR=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:`${ft(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}}}}}},hR=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}}}}},vR=nn("Prompts",e=>{const t=Ct(e,{});return[gR(t),hR(t)]},()=>({})),K0=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=je(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}=We(),a=o("prompts",e.prefixCls),l=en("prompts"),[s,c,u]=vR(a),d=i.computed(()=>ae(a,l.value.className,e.class,e.rootClassName,c.value,u,{[`${a}-rtl`]:r.value==="rtl"})),f=i.computed(()=>ae(`${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:ae(`${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:ae(`${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:ae(`${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(K0,{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)])])})])]))}}}),yR=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"}}}}},bR=nn("Suggestion",e=>{const t=Ct(e,{});return yR(t)},()=>({}));function CR(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=Gi(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 SR=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}=We(),r=i.computed(()=>o("suggestion",e.prefixCls));`${r.value}`;const a=i.computed(()=>n.value==="rtl"),l=en("suggestion"),[s,c,u]=bR(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]=CR(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(t6,{options:b.value,open:d.value,value:$.value,placement:a.value?"topRight":"topLeft",onDropdownVisibleChange:P=>{P||y()},class:ae(e.rootClassName,r.value,c,u,{[`${r.value}-block`]:e.block}),onChange:S,dropdownMatchSelectWidth:e.block},{default:()=>i.createVNode("div",{class:ae(r.value,l.value.className,e.rootClassName,e.className,`${r.value}-wrapper`,c.value,u),style:{...l.value.style,...e.style}},[w.value])}))}}),G0=Symbol("SenderHeaderContext"),bc=i.shallowRef(),wR=e=>{i.provide(G0,e),i.watch(e,()=>{bc.value=i.unref(e),i.triggerRef(bc)},{immediate:!0,deep:!0})},$R=()=>i.inject(G0,i.computed(()=>bc.value||{})),xR=i.defineComponent({props:{value:St()},setup(e,{slots:t}){return wR(i.computed(()=>e.value)),()=>{var n;return(n=t.default)==null?void 0:n.call(t)}}}),q0=Symbol("ActionButtonContext"),Cc=i.shallowRef(),OR=e=>{i.provide(q0,e),i.watch(e,()=>{Cc.value=i.unref(e),i.triggerRef(Cc)},{immediate:!0,deep:!0})},Sc=()=>i.inject(q0,i.computed(()=>Cc.value||{})),PR=i.defineComponent({props:{value:St()},setup(e,{slots:t}){return OR(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=je(e,["action","type","disabled","onClick"]);i.toRef(e,"disabled");const n=i.useSlots(),o=Sc(),r=i.computed(()=>{var c;const l=o.value.disabled,s=(c=o.value)==null?void 0:c[`${e.action}Disabled`];return e.disabled??l??s}),a=i.computed(()=>o.value.prefixCls);return()=>i.createVNode(_e,i.mergeProps({type:e.type},t,{onClick:l=>{var s,c;r.value||((c=(s=o.value)==null?void 0:s[e.action])==null||c.call(s),e.onClick&&!Array.isArray(e.onClick)&&e.onClick(l))},class:ae(a.value,{[`${a.value}-disabled`]:r.value})}),{icon:()=>n.default()})}}),IR=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=je(e,["disabled"]);return()=>i.createVNode(qi,i.mergeProps({disabled:e.disabled},t,{action:"onClear"}),{default:()=>[i.createVNode(Zs,null,null)]})}}),TR=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)])])}}),Y0=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=je(e,["type","shape","icon","disabled"]),n=Sc(),{token:o}=mr.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:ae(`${n.value.prefixCls}-loading-button`),action:"onCancel"}),{default:()=>[i.createVNode(TR,{className:`${n.value.prefixCls}-loading-icon`},null)]})}}),Z0=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=je(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(Gs,null,null)]})}}),yr=1e3,br=4,Yi=140,Zi=250,Q0=500,Qi=.8,NR=i.defineComponent({name:"AXSenderRecordingIcon",__name:"RecordingIcon",props:{className:null},setup(e){const t=Yi/2;return()=>i.createVNode("svg",{color:"currentColor",viewBox:`0 0 ${yr} ${yr}`,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:br}).map((n,o)=>{const r=(yr-Yi*br)/(br-1),a=o*(r+Yi),l=yr/2-Zi/2,s=yr/2-Q0/2;return i.createVNode("rect",{fill:"currentColor",rx:t,ry:t,height:Zi,width:Yi,x:a,y:l,key:o},[i.createVNode("animate",{attributeName:"height",values:`${Zi}; ${Q0}; ${Zi}`,keyTimes:"0; 0.5; 1",dur:`${Qi}s`,begin:`${Qi/br*o}s`,repeatCount:"indefinite"},null),i.createVNode("animate",{attributeName:"y",values:`${l}; ${s}; ${l}`,keyTimes:"0; 0.5; 1",dur:`${Qi}s`,begin:`${Qi/br*o}s`,repeatCount:"indefinite"},null)])})])}}),J0=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=je(e,["type","disabled"]),n=Sc(),{token:o}=mr.useToken(),r=i.computed(()=>n.value.speechRecording),a=i.computed(()=>n.value.prefixCls),l=i.computed(()=>{let s;return r.value?s=i.createVNode(NR,{className:`${a.value}-recording-icon`},null):n.value.onSpeechDisabled?s=i.createVNode(qs,null,null):s=i.createVNode(Ys,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]})}}),Cr=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)]}})}}),ev=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(",")}}}}};Cr.install=function(e){return e.component(Cr.name,Cr),e};const ER=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"}}}}}},RR=e=>{const{componentCls:t,padding:n,paddingSM:o,paddingXS:r,paddingXXS:a,lineWidth:l,lineWidthBold:s,calc:c}=e;return{[t]:{position:"relative",width:"100%",boxSizing:"border-box",boxShadow:`${e.boxShadowTertiary}`,transition:`background ${e.motionDurationSlow}`,borderRadius:{_skip_check_:!0,value:c(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:l},"&:focus-within":{boxShadow:`${e.boxShadowSecondary}`,borderColor:e.colorPrimary,"&:after":{borderWidth:s}},"&-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"}},[`${t}-footer`]:{paddingInlineStart:n,paddingInlineEnd:o,paddingBlockEnd:o,paddingBlockStart:a,boxSizing:"border-box"}}}},MR=nn("Sender",e=>{const{paddingXS:t,calc:n}=e,o=Ct(e,{SenderContentMaxWidth:`calc(100% - ${ft(n(t).add(32).equal())})`});return[RR(o),ER(o),ev(o)]},()=>({}));let Ji;!Ji&&typeof window<"u"&&(Ji=window.SpeechRecognition||window.webkitSpeechRecognition);function AR(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(()=>Ji&&s.value!=="denied"),u=i.ref(null),[d,f]=U0(!1,{value:r}),p=i.ref(!1),m=()=>{if(c.value&&!u.value){const g=new Ji;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 VR(e,t){for(var n=e,o=0;o<t.length;o+=1){if(n==null)return;n=n[t[o]]}return n}const DR=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,Boolean]},allowSpeech:null,prefix:null,footer:{type:Function},header:null,autoSize:{type:Boolean}},{styles:()=>({}),classNames:()=>({}),submitType:"enter",actions:void 0,disabled:void 0,autoSize:()=>({maxRows:8})}),emits:["update:value"],setup(e,{expose:t,emit:n}){const o=je(e,["prefixCls","styles","classNames","className","rootClassName","style","defaultValue","value","placeholder","readOnly","submitType","onSubmit","loading","components","onCancel","onChange","actions","onKeyPress","onKeyDown","disabled","allowSpeech","prefix","footer","header","onPaste","onPasteFile","autoSize"]);i.toRef(e,"prefixCls");function r(k,Y,X){return VR(k,Y)||X}const a={SendButton:Z0,ClearButton:IR,LoadingButton:Y0,SpeechButton:J0},l=n,s=i.useSlots(),{direction:c,getPrefixCls:u}=We(),d=i.computed(()=>u("sender",e.prefixCls)),f=i.ref(null),p=i.ref(null),m=en("sender"),v=i.computed(()=>`${d.value}-input`),[g,y,b]=MR(d.value),S=i.computed(()=>ae(d.value,m.value.className,e.className,e.rootClassName,y.value,b,{[`${d.value}-rtl`]:c.value==="rtl",[`${d.value}-disabled`]:e.disabled})),$=i.computed(()=>`${d.value}-actions-btn`),x=i.computed(()=>`${d.value}-actions-list`),w=i.ref(e.value??e.defaultValue??""),P=k=>{w.value=k};i.watch(()=>e.value,()=>{P(e.value)});const C=(k,Y)=>{P(k),l("update:value",k),e.onChange&&e.onChange(k,Y)},{speechPermission:I,triggerSpeech:M,recording:E}=AR(k=>{C(`${w.value} ${k}`)},()=>e.allowSpeech),R=r(e.components,["input"],Ae.TextArea),z=i.computed(()=>go(o,{attr:!0,aria:!0,data:!0})),A=i.computed(()=>({...z.value,ref:p})),j=()=>{w.value&&e.onSubmit&&!e.loading&&e.onSubmit(w.value)},O=()=>{C("")},T=i.ref(!1),D=()=>{T.value=!0},V=()=>{T.value=!1},N=k=>{const Y=k.key==="Enter"&&!T.value;switch(e.submitType){case"enter":Y&&!k.shiftKey&&(k.preventDefault(),j());break;case"shiftEnter":Y&&k.shiftKey&&(k.preventDefault(),j());break}e.onKeyPress&&e.onKeyPress(k)},F=k=>{var X,L;const Y=(X=k.clipboardData)==null?void 0:X.files;Y!=null&&Y.length&&e.onPasteFile&&(e.onPasteFile(Y[0],Y),k.preventDefault()),(L=e.onPaste)==null||L.call(e,k)},_=k=>{var Y,X;k.target!==((Y=f.value)==null?void 0:Y.querySelector(`.${v.value}`))&&k.preventDefault(),(X=p.value)==null||X.focus()},G=i.computed(()=>{let k=i.createVNode(pr,{class:`${x.value}-presets`},{default:()=>[e.allowSpeech&&i.createVNode(J0,null,null),e.loading?i.createVNode(Y0,null,null):i.createVNode(Z0,null,null)]});const Y={components:a};return s.actions?k=s.actions({ori:k,info:Y}):typeof e.actions=="function"?k=e.actions(k,Y):(e.actions||e.actions===!1)&&(k=e.actions),k}),Z=i.computed(()=>({prefixCls:$.value,onSend:j,onSendDisabled:!w.value,onClear:O,onClearDisabled:!w.value,onCancel:e.onCancel,onCancelDisabled:!e.loading,onSpeech:()=>M(!1),onSpeechDisabled:!I.value,speechRecording:E.value,disabled:e.disabled})),te=i.computed(()=>{let k=null;const Y={components:a};return s.footer?k=s.footer({info:Y}):typeof e.footer=="function"?k=e.footer({components:a}):e.footer&&(k=e.footer),k}),oe=i.computed(()=>s.header?s.header():e.header),J=i.computed(()=>s.prefix?s.prefix():e.prefix);return t({nativeElement:f.value,focus:k=>{var Y;return(Y=p.value)==null?void 0:Y.focus(k)},blur:()=>{var k;return(k=p.value)==null?void 0:k.blur()}}),()=>g(i.createVNode("div",{ref:f,class:S.value,style:{...m.value.style,...e.style}},[oe.value&&i.createVNode(xR,{value:{prefixCls:d.value}},{default:()=>[oe.value]}),i.createVNode(PR,{value:Z.value},{default:()=>[i.createVNode("div",{class:`${d.value}-content`,onMousedown:_},[J.value&&i.createVNode("div",{class:ae(`${d.value}-prefix`,m.value.classNames.prefix,e.classNames.prefix),style:{...m.value.styles.prefix,...e.styles.prefix}},[J.value]),i.createVNode(R,i.mergeProps(A.value,{disabled:e.disabled,style:{...m.value.styles.input,...e.styles.input},class:ae(v.value,m.value.classNames.input,e.classNames.input),autoSize:{maxRows:8},value:w.value,onChange:k=>{C(k.target.value,k),M(!0)},onPressEnter:N,onCompositionstart:D,onCompositionend:V,onKeydown:e.onKeyDown,placeholder:e.placeholder,onPaste:F,bordered:!1,readOnly:e.readOnly}),null),G.value&&i.createVNode("div",{class:ae(x.value,m.value.classNames.actions,e.classNames.actions),style:{...m.value.styles.actions,...e.styles.actions}},[G.value])]),te.value&&i.createVNode("div",{class:ae(`${d.value}-footer`,m.value.classNames.footer,e.classNames.footer),style:{...m.value.styles.footer,...e.styles.footer}},[te.value])]})]))}}),BR=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=$R(),o=i.computed(()=>`${n.value.prefixCls}-header`),r=i.useAttrs();return()=>i.createVNode(Cr,{prefixCls:n.value.prefixCls},{default:()=>{var a;return[e.open||e.forceRender?i.withDirectives(i.createVNode("div",i.mergeProps(r,{class:ae(o.value,e.className),style:{...e.style}}),[(e.closable!==!1||e.title)&&i.createVNode("div",{class:ae(`${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(_e,{type:"text",icon:i.createVNode(Rt,null,null),size:"small",onClick:()=>{var l;(l=e.onOpenChange)==null||l.call(e,!e.open)}},null)])]),t.default&&i.createVNode("div",{class:ae(`${o.value}-content`,e.classNames.content),style:{...e.styles.content}},[(a=t.default)==null?void 0:a.call(t)])]),[[i.vShow,e.open]]):null]}})}}),LR=Object.assign(DR,{Header:BR}),tv=Symbol("AttachmentContext"),wc=i.shallowRef(),zR=e=>{i.provide(tv,e),i.watch(e,()=>{wc.value=i.unref(e),i.triggerRef(wc)},{immediate:!0,deep:!0})},ea=()=>i.inject(tv,i.computed(()=>wc.value||{})),jR=i.defineComponent({inheritAttrs:!1,props:{value:St()},setup(e,{slots:t}){return zR(i.computed(()=>e.value)),()=>{var n;return(n=t.default)==null?void 0:n.call(t)}}}),FR=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=ea(),[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(pr,{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:ae(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(Fh.Dragger,i.mergeProps({showUploadList:!1},e.upload,{ref:"upload-dragger",style:{padding:0,border:0,background:"transparent"}}),{default:()=>[p.value]})])}}),nv=i.defineComponent({name:"AXAttachmentsDropArea",__name:"DropArea",props:{prefixCls:null,className:null,getDropContainer:{type:Function},children:null},setup(e){const t=ea(),[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:ae(s,e.className,{[`${s}-on-body`]:n.value.tagName==="BODY"}),style:{display:r.value?"block":"none"}},[e.children])]}):null}}),ov=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(Fh,i.mergeProps(e.upload,{showUploadList:!1,ref:"upload"}),{default:()=>[e.children]})}}),rv=(e,t)=>{const n=e.__vccOpts||e;for(const[o,r]of t)n[o]=r;return n},HR={},_R={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 kR(e,t){return i.openBlock(),i.createElementBlock("svg",_R,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 WR=rv(HR,[["render",kR]]),XR={},UR={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 KR(e,t){return i.openBlock(),i.createElementBlock("svg",UR,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 GR=rv(XR,[["render",KR]]),qR=e=>e.indexOf("image/")===0,ta=200;function YR(e){return new Promise(t=>{if(!e||!e.type||!qR(e.type)){t("");return}const n=new Image;if(n.onload=()=>{const{width:o,height:r}=n,a=o/r,l=a>1?ta:ta*a,s=a>1?ta/a:ta,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 Ve=Math.round;function $c(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 iv=(e,t,n)=>n===0?e:e/100;function Sr(e,t){const n=t||255;return e>n?n:e<0?0:e}class xc{constructor(t){Ue(this,"isValid",!0),Ue(this,"r",0),Ue(this,"g",0),Ue(this,"b",0),Ue(this,"a",1),Ue(this,"_h",void 0),Ue(this,"_s",void 0),Ue(this,"_l",void 0),Ue(this,"_v",void 0),Ue(this,"_max",void 0),Ue(this,"_min",void 0),Ue(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 xc)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=Sr(t.r),this.g=Sr(t.g),this.b=Sr(t.b),this.a=typeof t.a=="number"?Sr(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=Ve(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:Ve(a("r")),g:Ve(a("g")),b:Ve(a("b")),a:Ve(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=>Ve((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=Ve(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=Ve(this.getSaturation()*100),o=Ve(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]=Sr(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=Ve(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=Ve((a+f)*255),this.g=Ve((l+f)*255),this.b=Ve((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=Ve(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=Ve(o*(1-n)*255),d=Ve(o*(1-n*c)*255),f=Ve(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=$c(t,iv);this.fromHsv({h:n[0],s:n[1],v:n[2],a:n[3]})}fromHslString(t){const n=$c(t,iv);this.fromHsl({h:n[0],s:n[1],l:n[2],a:n[3]})}fromRgbString(t){const n=$c(t,(o,r)=>r.includes("%")?Ve(o/100*255):o);this.r=n[0],this.g=n[1],this.b=n[2],this.a=n[3]}}const ZR=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()}}}}},Oc={"&, *":{boxSizing:"border-box"}},QR=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,...Oc,"&-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)",...Oc,[`${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`]:{}}}}},JR=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%",...Oc,[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"}}}}}},av=nn("Attachments",e=>{const t=Ct(e,{});return[QR(t),JR(t),ZR(t)]},e=>{const{colorBgContainer:t}=e;return{colorBgPlaceholderHover:new xc(t).setA(.85).toRgbString()}}),Pc=" ",Ic="#8c8c8c",lv=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(Qs,null,null),color:"#22b35e",ext:["xlsx","xls"]},{icon:i.createVNode(Js,null,null),color:Ic,ext:n},{icon:i.createVNode(ec,null,null),color:Ic,ext:["md","mdx"]},{icon:i.createVNode(tc,null,null),color:"#ff4d4f",ext:["pdf"]},{icon:i.createVNode(nc,null,null),color:"#ff6e31",ext:["ppt","pptx"]},{icon:i.createVNode(rc,null,null),color:"#1677ff",ext:["doc","docx"]},{icon:i.createVNode(ic,null,null),color:"#fab714",ext:["zip","rar","7z","tar","gz"]},{icon:i.createVNode(GR,null,null),color:"#ff4d4f",ext:["mp4","avi","mov","wmv","flv","mkv"]},{icon:i.createVNode(WR,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 T=0;for(;j>=1024&&T<O.length-1;)j/=1024,T++;return`${j.toFixed(0)} ${O[T]}`}const l=ea(),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}=We(),v=i.computed(()=>m("attachment",e.prefixCls)),g=`${v.value}-list-card`,[y,b,S]=av(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||Pc:u.value?a(u.value):Pc),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(oc,{key:"defaultIcon"},null),iconColor:Ic}}),[I,M]=Te();i.watch(()=>e.item.originFileObj,()=>{if(e.item.originFileObj){let A=!0;YR(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(xn,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(bh,{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??Pc]),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:ae(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(dt,null,null)])]))}}),sv=1,e5=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=ea();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)>=sv),u(v.scrollWidth-v.clientWidth-Math.abs(v.scrollLeft)>=sv)):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:ae(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(lv,{key:v.uid,prefixCls:e.prefixCls,item:v,onRemove:e.onRemove,className:ae(e.itemClassName),imageProps:e.imageProps,style:{...e.itemStyle}},null)),!a.value.disabled&&i.createVNode(ov,{upload:e.upload,children:i.createVNode(_e,{class:`${t.value}-upload-btn`,type:"dashed"},{default:()=>[i.createVNode(us,{class:`${t.value}-upload-btn-icon`},null)]})},null),e.overflow==="scrollX"&&i.createVNode(i.Fragment,null,[i.createVNode(_e,{size:"small",shape:"circle",class:`${t.value}-prev-btn`,icon:i.createVNode(ao,null,null),onClick:p},null),i.createVNode(_e,{size:"small",shape:"circle",class:`${t.value}-next-btn`,icon:i.createVNode(Gt,null,null),onClick:m},null)])])}}),t5=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=je(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}=We(),l=r("attachment",e.prefixCls),s=en("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]=av(l),g=i.computed(()=>ae(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(FR,{placeholder:E,upload:$.value,prefixCls:l,className:ae(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(jR,{value:{disabled:e.disabled}},{default:()=>[e.children?i.createVNode(i.Fragment,null,[i.createVNode(ov,{upload:$.value,rootClassName:e.rootClassName,ref:"attachments-upload",children:e.children},null),i.createVNode(nv,{getDropContainer:e.getDropContainer,prefixCls:l,className:ae(g.value,e.rootClassName),children:w("drop")},null)]):i.createVNode("div",{class:ae(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(e5,{prefixCls:l,items:y.value,onRemove:x,overflow:e.overflow,upload:$.value,listClassName:ae(c.value.list,e.classNames.list),listStyle:{...u.value.list,...e.styles.list,...!P.value&&{display:"none"}},itemClassName:ae(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(nv,{getDropContainer:e.getDropContainer||(()=>d.value),prefixCls:l,className:g.value,children:w("drop")},null)])]}))}}),n5=Object.assign(t5,{FileCard:lv}),o5=(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 na=(e=>(e.PENDING="pending",e.SUCCESS="success",e.ERROR="error",e))(na||{});const r5=e=>{const{componentCls:t}=e,n=`${t}-item`,o={[na.PENDING]:e.colorPrimaryText,[na.SUCCESS]:e.colorSuccessText,[na.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},{})},i5=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()}}}},a5=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:`${ft(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:`${ft(e.lineWidth)} ${e.lineType} ${e.colorBorderSecondary}`}},[`& ${n}-footer`]:{marginTop:e.itemGap,display:"inline-flex"}}}},Tc=(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,...a5({...e,...o}),...i5({...e,...o})}}},l5=e=>{const{componentCls:t}=e;return{[t]:{display:"flex",flexDirection:"column",...r5(e),...Tc(e),...Tc(e,"large"),...Tc(e,"small"),[`&${t}-rtl`]:{direction:"rtl"}}}},s5=nn("ThoughtChain",e=>{const t=Ct(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[l5(t),ev(t)]}),cv=Symbol("ThoughtChainNodeContext"),Nc=i.shallowRef(),c5=e=>{i.provide(cv,e),i.watch(e,()=>{Nc.value=i.unref(e),i.triggerRef(Nc)},{immediate:!0,deep:!0})},u5=()=>i.inject(cv,i.computed(()=>Nc.value||{})),d5=i.defineComponent({props:{value:St()},setup(e,{slots:t}){return c5(i.computed(()=>e.value)),()=>{var n;return(n=t.default)==null?void 0:n.call(t)}}}),f5=i.defineComponent({name:"AXThoughtChainNode",__name:"item",props:i.mergeDefaults({info:null,nextStatus:null,onClick:{type:Function}},{info:()=>({})}),setup(e){const t=je(e,["info","nextStatus","onClick"]),n=i.computed(()=>go(t,{attr:!0,aria:!0,data:!0})),o=u5(),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:ae($.value,{[`${$.value}-${b.value}${e.nextStatus?`-${e.nextStatus}`:""}`]:b.value},t.class),style:t.style}),[i.createVNode("div",{class:ae(`${$.value}-header`,c.value.itemHeader),style:u.value.itemHeader,onClick:x},[i.createVNode(Cn,{icon:p.value,class:`${$.value}-icon`},null),i.createVNode("div",{class:ae(`${$.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(ao,{class:`${$.value}-collapse-icon`,rotate:w.value?-90:0},null):i.createVNode(Gt,{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(Cr,{prefixCls:r.value},{default:()=>[g.value&&i.withDirectives(i.createVNode("div",{class:ae(`${$.value}-content`)},[i.createVNode("div",{class:ae(`${$.value}-content-box`,c.value.itemContent),style:u.value.itemContent},[g.value])]),[[i.vShow,P.value]])]}),y.value&&i.createVNode("div",{class:ae(`${$.value}-footer`,c.value.itemFooter),style:u.value.itemFooter},[y.value])])}}),p5=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=je(e,["prefixCls","rootClassName","class","items","collapsible","styles","style","classNames","size"]);i.toRef(e,"class"),i.toRef(e,"prefixCls");const n=i.computed(()=>go(t,{attr:!0,aria:!0,data:!0})),{getPrefixCls:o,direction:r}=We(),a=i.computed(()=>o()),l=i.computed(()=>o("thought-chain",e.prefixCls)),s=en("thoughtChain"),[c,u,d]=o5(()=>e.collapsible,l.value,a.value),[f,p,m]=s5(l),v=i.computed(()=>ae(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(d5,{value:{prefixCls:l.value,enableCollapse:c.value,expandedKeys:u.value,direction:r.value,classNames:{itemHeader:ae(s.value.classNames.itemHeader,e.classNames.itemHeader),itemContent:ae(s.value.classNames.itemContent,e.classNames.itemContent),itemFooter:ae(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(f5,{key:y.key||`key_${b}`,class:ae(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)})]}})]))}}),m5=`
|
|
292
|
+
onLoadstart onPause onPlay onPlaying onProgress onRatechange onSeeked onSeeking onStalled onSuspend onTimeupdate onVolumechange onWaiting onLoad onError`.split(/[\s\n]+/),Y8="aria-",Z8="data-";function _0(e,t){return e.indexOf(t)===0}function go(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"||_0(r,Y8))||n.data&&_0(r,Z8)||n.attr&&(H0.includes(r)||H0.includes(r.toLowerCase())))&&(o[r]=e[r])}),o}function Q8(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=Gi(l=>{l===i.unref(r)&&n(i.unref(t)+1)});return[o,a]}function J8(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 eR=1,k0=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=je(e,["prefixCls","rootClassName","items","autoScroll","roles"]);i.toRef(e,"roles"),i.toRef(e,"items"),i.toRef(e,"prefixCls");const o=i.useAttrs(),r=go(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}=We(),d=u("bubble",e.prefixCls),f=`${d}-list`,[p,m,v]=L0(d),[g,y]=Te(!1);i.watchEffect(()=>{y(!0),i.onWatcherCleanup(()=>{y(!1)})});const b=J8(a,l),[S,$]=Q8(b),[x,w]=Te(!0),[P,C]=Te(0),I=R=>{const z=R.target;w(z.scrollHeight-Math.abs(z.scrollTop)-z.clientHeight<=eR)};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:T=0}=(j==null?void 0:j.getBoundingClientRect())??{},{top:D,bottom:V}=i.unref(s).getBoundingClientRect();O<V&&T>D&&(C(i.unref(P)+1),w(!0))}}});const M=Gi(()=>{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 T=i.unref(S).findIndex(D=>D.key===R);w(T===i.unref(S).length-1),O.nativeElement.scrollIntoView({behavior:A,block:j})}}}}),()=>p(i.createVNode(G8,{value:E.value},{default:()=>[i.createVNode("div",i.mergeProps(r,{class:ae(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(j0,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))])]}))}}),tR=Object.assign(j0,{List:k0}),nR=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=je(e,["prefixCls","info","class","direction","onClick","active","menu"]);i.toRef(e,"class");const n=i.computed(()=>go(t,{aria:!0,data:!0,attr:!0})),o=g=>{g.stopPropagation()},r=i.computed(()=>e.info.disabled),[a,l]=Te(!1),[s,c]=Te(!1),u=i.computed(()=>ae(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=g=>{g&&c(!g)},p=i.computed(()=>{var g;return(g=e.menu)==null?void 0:g.trigger}),m=i.computed(()=>{const{trigger:g,...y}=e.menu||{};return y}),v=g=>{const y=i.createVNode(Yo,{onClick:o,class:`${e.prefixCls}-menu-icon`},null);return p.value?typeof p.value=="function"?p.value(g,{originNode:y}):p.value:y};return()=>i.createVNode(Kt,{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]}),!r.value&&e.menu&&i.createVNode(Sn,{placement:e.direction==="rtl"?"bottomLeft":"bottomRight",trigger:["click"],disabled:r.value,onOpenChange:f},{default:()=>v(e.info),overlay:()=>i.createVNode(Yt,m.value,null)})])]})}}),W0=Symbol("GroupTitleContext"),vc=i.shallowRef(),oR=e=>{i.provide(W0,e),i.watch(e,()=>{vc.value=i.unref(e),i.triggerRef(vc)},{immediate:!0,deep:!0})},rR=()=>i.inject(W0,i.computed(()=>vc.value||{})),iR=i.defineComponent({props:{value:St()},setup(e,{slots:t}){return oR(i.computed(()=>e.value)),()=>{var n;return(n=t.default)==null?void 0:n.call(t)}}}),X0=i.defineComponent({name:"AXConversationsGroupTitle",__name:"GroupTitle",setup(e){const t=i.useSlots(),n=rR(),o=i.computed(()=>{var r;return(r=t.default)==null?void 0:r.call(t)});return()=>i.createVNode("div",{class:ae(`${n.value.prefixCls}-group-title`)},[o.value&&i.createVNode(Oe.Text,null,{default:()=>[o.value]})])}});function U0(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 yc="__ungrouped",aR=(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:yc,data:i.toValue(t),title:void 0}],enableGroup:n.value.enableGroup};const o=i.toValue(t).reduce((l,s)=>{const c=s.group||yc;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===yc?void 0:l,title:n.value.title,data:o[l]})),enableGroup:n.value.enableGroup}})},lR=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 ${ft(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 ${ft(e.paddingXS)}`}}}},sR=nn("Conversations",e=>{const t=Ct(e,{});return lR(t)},()=>({})),cR=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=je(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(()=>go(t,{attr:!0,aria:!0,data:!0})),[r,a]=U0(e.defaultActiveKey,{value:n});i.watch(()=>e.activeKey,()=>{n.value=e.activeKey});const l=aR(()=>e.groupable,()=>e.items),{getPrefixCls:s,direction:c}=We(),u=i.computed(()=>s("conversations",e.prefixCls)),d=en("conversations"),[f,p,m]=sR(u),v=i.computed(()=>ae(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(nR,{key:$.key||`key-${x}`,info:$,prefixCls:u.value,direction:c.value,class:ae(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(iR,{value:{prefixCls:u.value}},{default:()=>{var $;return[(($=y.title)==null?void 0:$.call(y,y.name,{components:{GroupTitle:X0}}))||i.createVNode(X0,{key:y.name},{default:()=>[y.name]})]}}),i.createVNode("ul",{class:`${u.value}-list`},[S])]):S})]))}}),uR=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"}}}}},dR=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}}}}},fR=nn("Welcome",e=>{const t=Ct(e,{});return[uR(t),dR(t)]},()=>({}));function pR(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!i.isVNode(e)}const mR=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}=We(),r=o("welcome",e.prefixCls),a=en("welcome"),[l,s,c]=fR(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:ae(`${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:ae(`${r}-title`,a.value.classNames.title,e.classNames.title),style:e.styles.title},pR(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:ae(`${r}-extra`,a.value.classNames.extra,e.classNames.extra),style:e.styles.extra},[m]):null});return()=>l(i.createVNode(pr,{class:ae(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(pr,{vertical:!0,class:`${r}-content-wrapper`},{default:()=>[t.extra||e.extra?i.createVNode(pr,{align:"flex-start",class:`${r}-title-wrapper`},{default:()=>[d.value,p.value]}):d.value,f.value&&i.createVNode(Oe.Text,{class:ae(`${r}-description`,a.value.classNames.description,e.classNames.description),style:e.styles.description},{default:()=>[f.value]})]})]}))}}),gR=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:`${ft(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}}}}}},hR=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}}}}},vR=nn("Prompts",e=>{const t=Ct(e,{});return[gR(t),hR(t)]},()=>({})),K0=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=je(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}=We(),a=o("prompts",e.prefixCls),l=en("prompts"),[s,c,u]=vR(a),d=i.computed(()=>ae(a,l.value.className,e.class,e.rootClassName,c.value,u,{[`${a}-rtl`]:r.value==="rtl"})),f=i.computed(()=>ae(`${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:ae(`${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:ae(`${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:ae(`${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(K0,{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)])])})])]))}}}),yR=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"}}}}},bR=nn("Suggestion",e=>{const t=Ct(e,{});return yR(t)},()=>({}));function CR(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=Gi(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 SR=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}=We(),r=i.computed(()=>o("suggestion",e.prefixCls));`${r.value}`;const a=i.computed(()=>n.value==="rtl"),l=en("suggestion"),[s,c,u]=bR(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]=CR(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(t6,{options:b.value,open:d.value,value:$.value,placement:a.value?"topRight":"topLeft",onDropdownVisibleChange:P=>{P||y()},class:ae(e.rootClassName,r.value,c,u,{[`${r.value}-block`]:e.block}),onChange:S,dropdownMatchSelectWidth:e.block},{default:()=>i.createVNode("div",{class:ae(r.value,l.value.className,e.rootClassName,e.className,`${r.value}-wrapper`,c.value,u),style:{...l.value.style,...e.style}},[w.value])}))}}),G0=Symbol("SenderHeaderContext"),bc=i.shallowRef(),wR=e=>{i.provide(G0,e),i.watch(e,()=>{bc.value=i.unref(e),i.triggerRef(bc)},{immediate:!0,deep:!0})},$R=()=>i.inject(G0,i.computed(()=>bc.value||{})),xR=i.defineComponent({props:{value:St()},setup(e,{slots:t}){return wR(i.computed(()=>e.value)),()=>{var n;return(n=t.default)==null?void 0:n.call(t)}}}),q0=Symbol("ActionButtonContext"),Cc=i.shallowRef(),OR=e=>{i.provide(q0,e),i.watch(e,()=>{Cc.value=i.unref(e),i.triggerRef(Cc)},{immediate:!0,deep:!0})},Sc=()=>i.inject(q0,i.computed(()=>Cc.value||{})),PR=i.defineComponent({props:{value:St()},setup(e,{slots:t}){return OR(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=je(e,["action","type","disabled","onClick"]);i.toRef(e,"disabled");const n=i.useSlots(),o=Sc(),r=i.computed(()=>{var c;const l=o.value.disabled,s=(c=o.value)==null?void 0:c[`${e.action}Disabled`];return e.disabled??l??s}),a=i.computed(()=>o.value.prefixCls);return()=>i.createVNode(_e,i.mergeProps({type:e.type},t,{onClick:l=>{var s,c;r.value||((c=(s=o.value)==null?void 0:s[e.action])==null||c.call(s),e.onClick&&!Array.isArray(e.onClick)&&e.onClick(l))},class:ae(a.value,{[`${a.value}-disabled`]:r.value})}),{icon:()=>n.default()})}}),IR=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=je(e,["disabled"]);return()=>i.createVNode(qi,i.mergeProps({disabled:e.disabled},t,{action:"onClear"}),{default:()=>[i.createVNode(Zs,null,null)]})}}),TR=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)])])}}),Y0=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=je(e,["type","shape","icon","disabled"]),n=Sc(),{token:o}=mr.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:ae(`${n.value.prefixCls}-loading-button`),action:"onCancel"}),{default:()=>[i.createVNode(TR,{className:`${n.value.prefixCls}-loading-icon`},null)]})}}),Z0=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=je(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(Gs,null,null)]})}}),yr=1e3,br=4,Yi=140,Zi=250,Q0=500,Qi=.8,NR=i.defineComponent({name:"AXSenderRecordingIcon",__name:"RecordingIcon",props:{className:null},setup(e){const t=Yi/2;return()=>i.createVNode("svg",{color:"currentColor",viewBox:`0 0 ${yr} ${yr}`,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:br}).map((n,o)=>{const r=(yr-Yi*br)/(br-1),a=o*(r+Yi),l=yr/2-Zi/2,s=yr/2-Q0/2;return i.createVNode("rect",{fill:"currentColor",rx:t,ry:t,height:Zi,width:Yi,x:a,y:l,key:o},[i.createVNode("animate",{attributeName:"height",values:`${Zi}; ${Q0}; ${Zi}`,keyTimes:"0; 0.5; 1",dur:`${Qi}s`,begin:`${Qi/br*o}s`,repeatCount:"indefinite"},null),i.createVNode("animate",{attributeName:"y",values:`${l}; ${s}; ${l}`,keyTimes:"0; 0.5; 1",dur:`${Qi}s`,begin:`${Qi/br*o}s`,repeatCount:"indefinite"},null)])})])}}),J0=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=je(e,["type","disabled"]),n=Sc(),{token:o}=mr.useToken(),r=i.computed(()=>n.value.speechRecording),a=i.computed(()=>n.value.prefixCls),l=i.computed(()=>{let s;return r.value?s=i.createVNode(NR,{className:`${a.value}-recording-icon`},null):n.value.onSpeechDisabled?s=i.createVNode(qs,null,null):s=i.createVNode(Ys,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]})}}),Cr=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)]}})}}),ev=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(",")}}}}};Cr.install=function(e){return e.component(Cr.name,Cr),e};const ER=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",borderRadius:{_skip_check_:!0,value:n(e.borderRadius).mul(2).equal()},borderBottomRightRadius:0,borderBottomLeftRadius:0,[`${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"}}}}}},RR=e=>{const{componentCls:t,padding:n,paddingSM:o,paddingXS:r,paddingXXS:a,lineWidth:l,lineWidthBold:s,calc:c}=e;return{[t]:{position:"relative",width:"100%",boxSizing:"border-box",boxShadow:`${e.boxShadowTertiary}`,transition:`background ${e.motionDurationSlow}`,borderRadius:{_skip_check_:!0,value:c(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:l},"&:focus-within":{boxShadow:`${e.boxShadowSecondary}`,borderColor:e.colorPrimary,"&:after":{borderWidth:s}},"&-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"}},[`${t}-footer`]:{paddingInlineStart:n,paddingInlineEnd:o,paddingBlockEnd:o,paddingBlockStart:a,boxSizing:"border-box"}}}},MR=nn("Sender",e=>{const{paddingXS:t,calc:n}=e,o=Ct(e,{SenderContentMaxWidth:`calc(100% - ${ft(n(t).add(32).equal())})`});return[RR(o),ER(o),ev(o)]},()=>({}));let Ji;!Ji&&typeof window<"u"&&(Ji=window.SpeechRecognition||window.webkitSpeechRecognition);function AR(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(()=>Ji&&s.value!=="denied"),u=i.ref(null),[d,f]=U0(!1,{value:r}),p=i.ref(!1),m=()=>{if(c.value&&!u.value){const g=new Ji;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 VR(e,t){for(var n=e,o=0;o<t.length;o+=1){if(n==null)return;n=n[t[o]]}return n}const DR=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:{type:[Object,Function,Boolean],default:void 0},allowSpeech:{},prefix:{},footer:{},header:{},autoSize:{default:()=>({maxRows:8})}},emits:["update:value"],setup(e,{expose:t,emit:n}){const o=je(e,["prefixCls","styles","classNames","className","rootClassName","style","defaultValue","value","placeholder","readOnly","submitType","onSubmit","loading","components","onCancel","onChange","actions","onKeyPress","onKeyDown","disabled","allowSpeech","prefix","footer","header","onPaste","onPasteFile","autoSize"]);i.toRef(e,"prefixCls");function r(k,Y,X){return VR(k,Y)||X}const a={SendButton:Z0,ClearButton:IR,LoadingButton:Y0,SpeechButton:J0},l=n,s=i.useSlots(),{direction:c,getPrefixCls:u}=We(),d=i.computed(()=>u("sender",e.prefixCls)),f=i.ref(null),p=i.ref(null),m=en("sender"),v=i.computed(()=>`${d.value}-input`),[g,y,b]=MR(d.value),S=i.computed(()=>ae(d.value,m.value.className,e.className,e.rootClassName,y.value,b,{[`${d.value}-rtl`]:c.value==="rtl",[`${d.value}-disabled`]:e.disabled})),$=i.computed(()=>`${d.value}-actions-btn`),x=i.computed(()=>`${d.value}-actions-list`),w=i.ref(e.value??e.defaultValue??""),P=k=>{w.value=k};i.watch(()=>e.value,()=>{P(e.value)});const C=(k,Y)=>{P(k),l("update:value",k),e.onChange&&e.onChange(k,Y)},{speechPermission:I,triggerSpeech:M,recording:E}=AR(k=>{C(`${w.value} ${k}`)},()=>e.allowSpeech),R=r(e.components,["input"],Ae.TextArea),z=i.computed(()=>go(o,{attr:!0,aria:!0,data:!0})),A=i.computed(()=>({...z.value,ref:p})),j=()=>{w.value&&e.onSubmit&&!e.loading&&e.onSubmit(w.value)},O=()=>{C("")},T=i.ref(!1),D=()=>{T.value=!0},V=()=>{T.value=!1},N=k=>{const Y=k.key==="Enter"&&!T.value;switch(e.submitType){case"enter":Y&&!k.shiftKey&&(k.preventDefault(),j());break;case"shiftEnter":Y&&k.shiftKey&&(k.preventDefault(),j());break}e.onKeyPress&&e.onKeyPress(k)},F=k=>{var X,L;const Y=(X=k.clipboardData)==null?void 0:X.files;Y!=null&&Y.length&&e.onPasteFile&&(e.onPasteFile(Y[0],Y),k.preventDefault()),(L=e.onPaste)==null||L.call(e,k)},_=k=>{var Y,X;k.target!==((Y=f.value)==null?void 0:Y.querySelector(`.${v.value}`))&&k.preventDefault(),(X=p.value)==null||X.focus()},G=i.computed(()=>{let k=i.createVNode(pr,{class:`${x.value}-presets`},{default:()=>[e.allowSpeech&&i.createVNode(J0,null,null),e.loading?i.createVNode(Y0,null,null):i.createVNode(Z0,null,null)]});const Y={components:a};return s.actions?k=s.actions({ori:k,info:Y}):typeof e.actions=="function"?k=e.actions(k,Y):(e.actions||e.actions===!1)&&(k=e.actions),k}),Z=i.computed(()=>({prefixCls:$.value,onSend:j,onSendDisabled:!w.value,onClear:O,onClearDisabled:!w.value,onCancel:e.onCancel,onCancelDisabled:!e.loading,onSpeech:()=>M(!1),onSpeechDisabled:!I.value,speechRecording:E.value,disabled:e.disabled})),te=i.computed(()=>{let k=null;const Y={components:a};return s.footer?k=s.footer({info:Y}):typeof e.footer=="function"?k=e.footer({components:a}):e.footer&&(k=e.footer),k}),oe=i.computed(()=>s.header?s.header():e.header),J=i.computed(()=>s.prefix?s.prefix():e.prefix);return t({nativeElement:f.value,focus:k=>{var Y;return(Y=p.value)==null?void 0:Y.focus(k)},blur:()=>{var k;return(k=p.value)==null?void 0:k.blur()}}),()=>g(i.createVNode("div",{ref:f,class:S.value,style:{...m.value.style,...e.style}},[oe.value&&i.createVNode(xR,{value:{prefixCls:d.value}},{default:()=>[oe.value]}),i.createVNode(PR,{value:Z.value},{default:()=>[i.createVNode("div",{class:`${d.value}-content`,onMousedown:_},[J.value&&i.createVNode("div",{class:ae(`${d.value}-prefix`,m.value.classNames.prefix,e.classNames.prefix),style:{...m.value.styles.prefix,...e.styles.prefix}},[J.value]),i.createVNode(R,i.mergeProps(A.value,{disabled:e.disabled,style:{...m.value.styles.input,...e.styles.input},class:ae(v.value,m.value.classNames.input,e.classNames.input),autoSize:e.autoSize,value:w.value,onChange:k=>{C(k.target.value,k),M(!0)},onPressEnter:N,onCompositionstart:D,onCompositionend:V,onKeydown:e.onKeyDown,placeholder:e.placeholder,onPaste:F,bordered:!1,readOnly:e.readOnly}),null),G.value&&i.createVNode("div",{class:ae(x.value,m.value.classNames.actions,e.classNames.actions),style:{...m.value.styles.actions,...e.styles.actions}},[G.value])]),te.value&&i.createVNode("div",{class:ae(`${d.value}-footer`,m.value.classNames.footer,e.classNames.footer),style:{...m.value.styles.footer,...e.styles.footer}},[te.value])]})]))}}),BR=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=$R(),o=i.computed(()=>`${n.value.prefixCls}-header`),r=i.useAttrs();return()=>i.createVNode(Cr,{prefixCls:n.value.prefixCls},{default:()=>{var a;return[e.open||e.forceRender?i.withDirectives(i.createVNode("div",i.mergeProps(r,{class:ae(o.value,e.className),style:{...e.style}}),[(e.closable!==!1||e.title)&&i.createVNode("div",{class:ae(`${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(_e,{type:"text",icon:i.createVNode(Rt,null,null),size:"small",onClick:()=>{var l;(l=e.onOpenChange)==null||l.call(e,!e.open)}},null)])]),t.default&&i.createVNode("div",{class:ae(`${o.value}-content`,e.classNames.content),style:{...e.styles.content}},[(a=t.default)==null?void 0:a.call(t)])]),[[i.vShow,e.open]]):null]}})}}),LR=Object.assign(DR,{Header:BR}),tv=Symbol("AttachmentContext"),wc=i.shallowRef(),zR=e=>{i.provide(tv,e),i.watch(e,()=>{wc.value=i.unref(e),i.triggerRef(wc)},{immediate:!0,deep:!0})},ea=()=>i.inject(tv,i.computed(()=>wc.value||{})),jR=i.defineComponent({inheritAttrs:!1,props:{value:St()},setup(e,{slots:t}){return zR(i.computed(()=>e.value)),()=>{var n;return(n=t.default)==null?void 0:n.call(t)}}}),FR=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=ea(),[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(pr,{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:ae(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(Fh.Dragger,i.mergeProps({showUploadList:!1},e.upload,{ref:"upload-dragger",style:{padding:0,border:0,background:"transparent"}}),{default:()=>[p.value]})])}}),nv=i.defineComponent({name:"AXAttachmentsDropArea",__name:"DropArea",props:{prefixCls:null,className:null,getDropContainer:{type:Function},children:null},setup(e){const t=ea(),[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:ae(s,e.className,{[`${s}-on-body`]:n.value.tagName==="BODY"}),style:{display:r.value?"block":"none"}},[e.children])]}):null}}),ov=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(Fh,i.mergeProps(e.upload,{showUploadList:!1,ref:"upload"}),{default:()=>[e.children]})}}),rv=(e,t)=>{const n=e.__vccOpts||e;for(const[o,r]of t)n[o]=r;return n},HR={},_R={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 kR(e,t){return i.openBlock(),i.createElementBlock("svg",_R,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 WR=rv(HR,[["render",kR]]),XR={},UR={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 KR(e,t){return i.openBlock(),i.createElementBlock("svg",UR,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 GR=rv(XR,[["render",KR]]),qR=e=>e.indexOf("image/")===0,ta=200;function YR(e){return new Promise(t=>{if(!e||!e.type||!qR(e.type)){t("");return}const n=new Image;if(n.onload=()=>{const{width:o,height:r}=n,a=o/r,l=a>1?ta:ta*a,s=a>1?ta/a:ta,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 Ve=Math.round;function $c(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 iv=(e,t,n)=>n===0?e:e/100;function Sr(e,t){const n=t||255;return e>n?n:e<0?0:e}class xc{constructor(t){Ue(this,"isValid",!0),Ue(this,"r",0),Ue(this,"g",0),Ue(this,"b",0),Ue(this,"a",1),Ue(this,"_h",void 0),Ue(this,"_s",void 0),Ue(this,"_l",void 0),Ue(this,"_v",void 0),Ue(this,"_max",void 0),Ue(this,"_min",void 0),Ue(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 xc)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=Sr(t.r),this.g=Sr(t.g),this.b=Sr(t.b),this.a=typeof t.a=="number"?Sr(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=Ve(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:Ve(a("r")),g:Ve(a("g")),b:Ve(a("b")),a:Ve(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=>Ve((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=Ve(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=Ve(this.getSaturation()*100),o=Ve(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]=Sr(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=Ve(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=Ve((a+f)*255),this.g=Ve((l+f)*255),this.b=Ve((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=Ve(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=Ve(o*(1-n)*255),d=Ve(o*(1-n*c)*255),f=Ve(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=$c(t,iv);this.fromHsv({h:n[0],s:n[1],v:n[2],a:n[3]})}fromHslString(t){const n=$c(t,iv);this.fromHsl({h:n[0],s:n[1],l:n[2],a:n[3]})}fromRgbString(t){const n=$c(t,(o,r)=>r.includes("%")?Ve(o/100*255):o);this.r=n[0],this.g=n[1],this.b=n[2],this.a=n[3]}}const ZR=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()}}}}},Oc={"&, *":{boxSizing:"border-box"}},QR=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,...Oc,"&-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)",...Oc,[`${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`]:{}}}}},JR=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%",...Oc,[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"}}}}}},av=nn("Attachments",e=>{const t=Ct(e,{});return[QR(t),JR(t),ZR(t)]},e=>{const{colorBgContainer:t}=e;return{colorBgPlaceholderHover:new xc(t).setA(.85).toRgbString()}}),Pc=" ",Ic="#8c8c8c",lv=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(Qs,null,null),color:"#22b35e",ext:["xlsx","xls"]},{icon:i.createVNode(Js,null,null),color:Ic,ext:n},{icon:i.createVNode(ec,null,null),color:Ic,ext:["md","mdx"]},{icon:i.createVNode(tc,null,null),color:"#ff4d4f",ext:["pdf"]},{icon:i.createVNode(nc,null,null),color:"#ff6e31",ext:["ppt","pptx"]},{icon:i.createVNode(rc,null,null),color:"#1677ff",ext:["doc","docx"]},{icon:i.createVNode(ic,null,null),color:"#fab714",ext:["zip","rar","7z","tar","gz"]},{icon:i.createVNode(GR,null,null),color:"#ff4d4f",ext:["mp4","avi","mov","wmv","flv","mkv"]},{icon:i.createVNode(WR,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 T=0;for(;j>=1024&&T<O.length-1;)j/=1024,T++;return`${j.toFixed(0)} ${O[T]}`}const l=ea(),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}=We(),v=i.computed(()=>m("attachment",e.prefixCls)),g=`${v.value}-list-card`,[y,b,S]=av(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||Pc:u.value?a(u.value):Pc),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(oc,{key:"defaultIcon"},null),iconColor:Ic}}),[I,M]=Te();i.watch(()=>e.item.originFileObj,()=>{if(e.item.originFileObj){let A=!0;YR(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(xn,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(bh,{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??Pc]),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:ae(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(dt,null,null)])]))}}),sv=1,e5=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=ea();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)>=sv),u(v.scrollWidth-v.clientWidth-Math.abs(v.scrollLeft)>=sv)):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:ae(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(lv,{key:v.uid,prefixCls:e.prefixCls,item:v,onRemove:e.onRemove,className:ae(e.itemClassName),imageProps:e.imageProps,style:{...e.itemStyle}},null)),!a.value.disabled&&i.createVNode(ov,{upload:e.upload,children:i.createVNode(_e,{class:`${t.value}-upload-btn`,type:"dashed"},{default:()=>[i.createVNode(us,{class:`${t.value}-upload-btn-icon`},null)]})},null),e.overflow==="scrollX"&&i.createVNode(i.Fragment,null,[i.createVNode(_e,{size:"small",shape:"circle",class:`${t.value}-prev-btn`,icon:i.createVNode(ao,null,null),onClick:p},null),i.createVNode(_e,{size:"small",shape:"circle",class:`${t.value}-next-btn`,icon:i.createVNode(Gt,null,null),onClick:m},null)])])}}),t5=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=je(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}=We(),l=r("attachment",e.prefixCls),s=en("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]=av(l),g=i.computed(()=>ae(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(FR,{placeholder:E,upload:$.value,prefixCls:l,className:ae(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(jR,{value:{disabled:e.disabled}},{default:()=>[e.children?i.createVNode(i.Fragment,null,[i.createVNode(ov,{upload:$.value,rootClassName:e.rootClassName,ref:"attachments-upload",children:e.children},null),i.createVNode(nv,{getDropContainer:e.getDropContainer,prefixCls:l,className:ae(g.value,e.rootClassName),children:w("drop")},null)]):i.createVNode("div",{class:ae(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(e5,{prefixCls:l,items:y.value,onRemove:x,overflow:e.overflow,upload:$.value,listClassName:ae(c.value.list,e.classNames.list),listStyle:{...u.value.list,...e.styles.list,...!P.value&&{display:"none"}},itemClassName:ae(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(nv,{getDropContainer:e.getDropContainer||(()=>d.value),prefixCls:l,className:g.value,children:w("drop")},null)])]}))}}),n5=Object.assign(t5,{FileCard:lv}),o5=(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 na=(e=>(e.PENDING="pending",e.SUCCESS="success",e.ERROR="error",e))(na||{});const r5=e=>{const{componentCls:t}=e,n=`${t}-item`,o={[na.PENDING]:e.colorPrimaryText,[na.SUCCESS]:e.colorSuccessText,[na.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},{})},i5=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()}}}},a5=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:`${ft(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:`${ft(e.lineWidth)} ${e.lineType} ${e.colorBorderSecondary}`}},[`& ${n}-footer`]:{marginTop:e.itemGap,display:"inline-flex"}}}},Tc=(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,...a5({...e,...o}),...i5({...e,...o})}}},l5=e=>{const{componentCls:t}=e;return{[t]:{display:"flex",flexDirection:"column",...r5(e),...Tc(e),...Tc(e,"large"),...Tc(e,"small"),[`&${t}-rtl`]:{direction:"rtl"}}}},s5=nn("ThoughtChain",e=>{const t=Ct(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[l5(t),ev(t)]}),cv=Symbol("ThoughtChainNodeContext"),Nc=i.shallowRef(),c5=e=>{i.provide(cv,e),i.watch(e,()=>{Nc.value=i.unref(e),i.triggerRef(Nc)},{immediate:!0,deep:!0})},u5=()=>i.inject(cv,i.computed(()=>Nc.value||{})),d5=i.defineComponent({props:{value:St()},setup(e,{slots:t}){return c5(i.computed(()=>e.value)),()=>{var n;return(n=t.default)==null?void 0:n.call(t)}}}),f5=i.defineComponent({name:"AXThoughtChainNode",__name:"item",props:i.mergeDefaults({info:null,nextStatus:null,onClick:{type:Function}},{info:()=>({})}),setup(e){const t=je(e,["info","nextStatus","onClick"]),n=i.computed(()=>go(t,{attr:!0,aria:!0,data:!0})),o=u5(),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:ae($.value,{[`${$.value}-${b.value}${e.nextStatus?`-${e.nextStatus}`:""}`]:b.value},t.class),style:t.style}),[i.createVNode("div",{class:ae(`${$.value}-header`,c.value.itemHeader),style:u.value.itemHeader,onClick:x},[i.createVNode(Cn,{icon:p.value,class:`${$.value}-icon`},null),i.createVNode("div",{class:ae(`${$.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(ao,{class:`${$.value}-collapse-icon`,rotate:w.value?-90:0},null):i.createVNode(Gt,{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(Cr,{prefixCls:r.value},{default:()=>[g.value&&i.withDirectives(i.createVNode("div",{class:ae(`${$.value}-content`)},[i.createVNode("div",{class:ae(`${$.value}-content-box`,c.value.itemContent),style:u.value.itemContent},[g.value])]),[[i.vShow,P.value]])]}),y.value&&i.createVNode("div",{class:ae(`${$.value}-footer`,c.value.itemFooter),style:u.value.itemFooter},[y.value])])}}),p5=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=je(e,["prefixCls","rootClassName","class","items","collapsible","styles","style","classNames","size"]);i.toRef(e,"class"),i.toRef(e,"prefixCls");const n=i.computed(()=>go(t,{attr:!0,aria:!0,data:!0})),{getPrefixCls:o,direction:r}=We(),a=i.computed(()=>o()),l=i.computed(()=>o("thought-chain",e.prefixCls)),s=en("thoughtChain"),[c,u,d]=o5(()=>e.collapsible,l.value,a.value),[f,p,m]=s5(l),v=i.computed(()=>ae(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(d5,{value:{prefixCls:l.value,enableCollapse:c.value,expandedKeys:u.value,direction:r.value,classNames:{itemHeader:ae(s.value.classNames.itemHeader,e.classNames.itemHeader),itemContent:ae(s.value.classNames.itemContent,e.classNames.itemContent),itemFooter:ae(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(f5,{key:y.key||`key_${b}`,class:ae(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)})]}})]))}}),m5=`
|
|
293
293
|
|
|
294
294
|
`,g5=`
|
|
295
295
|
`,uv=":",Ec=e=>(e??"").trim()!=="";function h5(){let e="";return new TransformStream({transform(t,n){e+=t;const o=e.split(m5);o.slice(0,-1).forEach(r=>{Ec(r)&&n.enqueue(r)}),e=o[o.length-1]},flush(t){Ec(e)&&t.enqueue(e)}})}function v5(){return new TransformStream({transform(e,t){const o=e.split(g5).reduce((r,a)=>{const l=a.indexOf(uv);if(l===-1)throw new Error(`The key-value separator "${uv}" is not found in the sse line chunk!`);const s=a.slice(0,l);if(!Ec(s))return r;const c=a.slice(l+1);return{...r,[s]:c}},{});Object.keys(o).length!==0&&t.enqueue(o)}})}function Rc(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(h5()).pipeThrough(v5());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 dv=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},Rn=class Rn{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 dv(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 Rc({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 Rc({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 Rn.instanceBuffer.has(n)||Rn.instanceBuffer.set(n,new Rn(t)),Rn.instanceBuffer.get(n)}};Rn.instanceBuffer=new Map;let Mc=Rn;const fv=Mc.init;let pv=0;class mv{constructor(t){this.requestingMap={},this.request=(n,o)=>{const{request:r}=this.config,{onUpdate:a,onSuccess:l,onError:s}=o,c=pv;pv+=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 y5(e){const{request:t,...n}=e;return[i.computed(()=>new mv({request:t||fv({baseURL:n.baseURL,model:n.model,dangerouslyApiKey:n.dangerouslyApiKey}).create,...n}))]}function b5(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 C5(e){return Array.isArray(e)?e:[e]}function S5(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]=b5(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=C5(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:Gi(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=n5,me.Bubble=tR,me.BubbleList=k0,me.Conversations=cR,me.Prompts=K0,me.Sender=LR,me.Suggestion=SR,me.ThoughtChain=p5,me.Welcome=mR,me.XAgent=mv,me.XFetch=dv,me.XProvider=DE,me.XRequest=fv,me.XStream=Rc,me.defaultPrefixCls=Nv,me.theme=mr,me.useXAgent=y5,me.useXChat=S5,me.useXProviderContext=We,Object.defineProperty(me,Symbol.toStringTag,{value:"Module"})});
|
|
@@ -10,8 +10,8 @@ declare function __VLS_template(): {
|
|
|
10
10
|
header?(): VNode;
|
|
11
11
|
prefix?(): VNode;
|
|
12
12
|
actions?(props?: {
|
|
13
|
-
ori
|
|
14
|
-
info
|
|
13
|
+
ori: VNode;
|
|
14
|
+
info: {
|
|
15
15
|
components: {
|
|
16
16
|
SendButton: typeof SendButton;
|
|
17
17
|
ClearButton: typeof ClearButton;
|
|
@@ -21,7 +21,7 @@ declare function __VLS_template(): {
|
|
|
21
21
|
};
|
|
22
22
|
}): VNode;
|
|
23
23
|
footer?(props?: {
|
|
24
|
-
info
|
|
24
|
+
info: {
|
|
25
25
|
components: {
|
|
26
26
|
SendButton: typeof SendButton;
|
|
27
27
|
ClearButton: typeof ClearButton;
|
|
@@ -34,8 +34,8 @@ declare function __VLS_template(): {
|
|
|
34
34
|
header?(): VNode;
|
|
35
35
|
prefix?(): VNode;
|
|
36
36
|
actions?(props?: {
|
|
37
|
-
ori
|
|
38
|
-
info
|
|
37
|
+
ori: VNode;
|
|
38
|
+
info: {
|
|
39
39
|
components: {
|
|
40
40
|
SendButton: typeof SendButton;
|
|
41
41
|
ClearButton: typeof ClearButton;
|
|
@@ -45,7 +45,7 @@ declare function __VLS_template(): {
|
|
|
45
45
|
};
|
|
46
46
|
}): VNode;
|
|
47
47
|
footer?(props?: {
|
|
48
|
-
info
|
|
48
|
+
info: {
|
|
49
49
|
components: {
|
|
50
50
|
SendButton: typeof SendButton;
|
|
51
51
|
ClearButton: typeof ClearButton;
|
|
@@ -38,8 +38,8 @@ declare const Sender: {
|
|
|
38
38
|
header?(): import("vue").VNode;
|
|
39
39
|
prefix?(): import("vue").VNode;
|
|
40
40
|
actions?(props?: {
|
|
41
|
-
ori
|
|
42
|
-
info
|
|
41
|
+
ori: import("vue").VNode;
|
|
42
|
+
info: {
|
|
43
43
|
components: {
|
|
44
44
|
SendButton: typeof import("./components/SendButton.vue").default;
|
|
45
45
|
ClearButton: typeof import("./components/ClearButton.vue").default;
|
|
@@ -49,7 +49,7 @@ declare const Sender: {
|
|
|
49
49
|
};
|
|
50
50
|
}): import("vue").VNode;
|
|
51
51
|
footer?(props?: {
|
|
52
|
-
info
|
|
52
|
+
info: {
|
|
53
53
|
components: {
|
|
54
54
|
SendButton: typeof import("./components/SendButton.vue").default;
|
|
55
55
|
ClearButton: typeof import("./components/ClearButton.vue").default;
|
|
@@ -62,8 +62,8 @@ declare const Sender: {
|
|
|
62
62
|
header?(): import("vue").VNode;
|
|
63
63
|
prefix?(): import("vue").VNode;
|
|
64
64
|
actions?(props?: {
|
|
65
|
-
ori
|
|
66
|
-
info
|
|
65
|
+
ori: import("vue").VNode;
|
|
66
|
+
info: {
|
|
67
67
|
components: {
|
|
68
68
|
SendButton: typeof import("./components/SendButton.vue").default;
|
|
69
69
|
ClearButton: typeof import("./components/ClearButton.vue").default;
|
|
@@ -73,7 +73,7 @@ declare const Sender: {
|
|
|
73
73
|
};
|
|
74
74
|
}): import("vue").VNode;
|
|
75
75
|
footer?(props?: {
|
|
76
|
-
info
|
|
76
|
+
info: {
|
|
77
77
|
components: {
|
|
78
78
|
SendButton: typeof import("./components/SendButton.vue").default;
|
|
79
79
|
ClearButton: typeof import("./components/ClearButton.vue").default;
|
|
@@ -65,10 +65,10 @@ export interface SenderProps {
|
|
|
65
65
|
prefix?: VNode;
|
|
66
66
|
footer?: VNode | FooterRender;
|
|
67
67
|
header?: VNode;
|
|
68
|
-
autoSize?: boolean | {
|
|
68
|
+
autoSize?: AvoidValidation<boolean | {
|
|
69
69
|
minRows?: number;
|
|
70
70
|
maxRows?: number;
|
|
71
|
-
}
|
|
71
|
+
}>;
|
|
72
72
|
}
|
|
73
73
|
export type SenderRef = {
|
|
74
74
|
nativeElement: HTMLDivElement;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ant-design-x-vue",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Craft AI-driven interfaces effortlessly",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"AI",
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
},
|
|
83
83
|
"peerDependencies": {
|
|
84
84
|
"ant-design-vue": ">=4.0.0",
|
|
85
|
-
"vue": ">=3.
|
|
85
|
+
"vue": ">=3.5.0"
|
|
86
86
|
},
|
|
87
87
|
"devDependencies": {
|
|
88
88
|
"@ant-design/icons-vue": "^7.0.1",
|