@matechat/core 0.0.1-alpha → 0.0.1-alpha.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/mate-chat.js CHANGED
@@ -1,17 +1,16 @@
1
1
  import "./mate-chat.css";
2
- import { defineComponent as C, openBlock as l, createElementBlock as c, createElementVNode as S, normalizeClass as b, createCommentVNode as y, toDisplayString as k, renderSlot as v, useSlots as ve, computed as H, createVNode as E, unref as d, normalizeProps as te, guardReactiveProps as ge, createTextVNode as U, inject as oe, createBlock as R, isRef as ye, nextTick as ne, withCtx as O, ref as w, watch as se, provide as he, Fragment as V, renderList as ae, onMounted as re, mergeProps as _e, Comment as be, Text as $e, h as Se, withDirectives as ke, cloneVNode as Ce, reactive as Ee, onBeforeUnmount as Ie, Teleport as we, Transition as Le, normalizeStyle as Te } from "vue";
3
- import { Avatar as Ae } from "vue-devui/avatar";
2
+ import { defineComponent as T, openBlock as l, createElementBlock as d, createElementVNode as _, normalizeClass as $, createCommentVNode as h, toDisplayString as S, renderSlot as y, useSlots as Se, computed as U, createVNode as I, unref as u, normalizeProps as ue, guardReactiveProps as ke, createTextVNode as fe, inject as me, createBlock as B, isRef as Te, nextTick as pe, withCtx as x, ref as j, watch as ge, provide as we, Fragment as D, renderList as ve, onMounted as ye, mergeProps as Ee, Comment as Ie, Text as Me, h as Ae, withDirectives as Pe, cloneVNode as Oe, reactive as Be, onBeforeUnmount as je, Teleport as Ve, Transition as He, normalizeStyle as Ke } from "vue";
3
+ import { Avatar as Ne } from "vue-devui/avatar";
4
4
  import "vue-devui/avatar/style.css";
5
- import { Textarea as Pe } from "vue-devui/textarea";
5
+ import { Textarea as Re } from "vue-devui/textarea";
6
6
  import "vue-devui/textarea/style.css";
7
- import { Button as Me } from "vue-devui/button";
7
+ import { Button as Ze } from "vue-devui/button";
8
8
  import "vue-devui/button/style.css";
9
- import { Icon as Be } from "vue-devui/icon";
9
+ import { Icon as ze } from "vue-devui/icon";
10
10
  import "vue-devui/icon/style.css";
11
- import { isObject as Ve } from "@vue/shared";
12
- import { computePosition as Ke, offset as He } from "@floating-ui/dom";
13
- import { debounce as Oe, isObject as Ne } from "lodash";
14
- const Re = {
11
+ import { isObject as De } from "@vue/shared";
12
+ import { computePosition as We, offset as Fe } from "@floating-ui/dom";
13
+ const Ue = {
15
14
  logoImg: {
16
15
  type: String,
17
16
  default: ""
@@ -24,38 +23,38 @@ const Re = {
24
23
  type: Boolean,
25
24
  default: !1
26
25
  }
27
- }, ze = { class: "mc-header" }, De = ["src", "alt"], je = { class: "mc-header-title" }, Fe = { class: "mc-header-operation" }, Ue = /* @__PURE__ */ C({
26
+ }, xe = { class: "mc-header" }, Ge = ["src", "alt"], qe = { class: "mc-header-title" }, Xe = { class: "mc-header-operation" }, Je = /* @__PURE__ */ T({
28
27
  __name: "Header",
29
- props: Re,
28
+ props: Ue,
30
29
  emits: ["logoClicked"],
31
30
  setup(e, { emit: t }) {
32
- const n = t, a = e, u = () => {
33
- a.logoClickable && n("logoClicked");
31
+ const n = t, i = e, c = () => {
32
+ i.logoClickable && n("logoClicked");
34
33
  };
35
- return (o, s) => (l(), c("div", ze, [
36
- S("div", {
37
- class: b(["mc-header-logo-container", { clickable: o.logoClickable }]),
38
- onClick: u
34
+ return (o, r) => (l(), d("div", xe, [
35
+ _("div", {
36
+ class: $(["mc-header-logo-container", { clickable: o.logoClickable }]),
37
+ onClick: c
39
38
  }, [
40
- o.logoImg ? (l(), c("img", {
39
+ o.logoImg ? (l(), d("img", {
41
40
  key: 0,
42
41
  class: "mc-header-logo",
43
42
  src: o.logoImg,
44
43
  alt: o.logoImg
45
- }, null, 8, De)) : y("", !0),
46
- S("div", je, k(o.title), 1)
44
+ }, null, 8, Ge)) : h("", !0),
45
+ _("div", qe, S(o.title), 1)
47
46
  ], 2),
48
- S("div", Fe, [
49
- v(o.$slots, "operationArea", {}, void 0, !0)
47
+ _("div", Xe, [
48
+ y(o.$slots, "operationArea", {}, void 0, !0)
50
49
  ])
51
50
  ]));
52
51
  }
53
- }), $ = (e, t) => {
52
+ }), L = (e, t) => {
54
53
  const n = e.__vccOpts || e;
55
- for (const [a, u] of t)
56
- n[a] = u;
54
+ for (const [i, c] of t)
55
+ n[i] = c;
57
56
  return n;
58
- }, We = /* @__PURE__ */ $(Ue, [["__scopeId", "data-v-706d836c"]]), qe = {
57
+ }, Qe = /* @__PURE__ */ L(Je, [["__scopeId", "data-v-2eda62d1"]]), Ye = {
59
58
  content: {
60
59
  type: String,
61
60
  default: ""
@@ -79,77 +78,77 @@ const Re = {
79
78
  avatarConfig: {
80
79
  type: Object
81
80
  }
82
- }, Ge = 36, Xe = 36, Je = "name", Qe = "imgSrc", Ye = {}, Ze = { class: "mc-bubble-loading" };
83
- function xe(e, t) {
84
- return l(), c("div", Ze, t[0] || (t[0] = [
85
- S("div", { class: "loading-dot dot-start" }, null, -1),
86
- S("div", { class: "loading-dot dot-middle" }, null, -1),
87
- S("div", { class: "loading-dot dot-end" }, null, -1)
81
+ }, et = 36, tt = 36, nt = "name", ot = "imgSrc", rt = {}, it = { class: "mc-bubble-loading" };
82
+ function at(e, t) {
83
+ return l(), d("div", it, t[0] || (t[0] = [
84
+ _("div", { class: "loading-dot dot-start" }, null, -1),
85
+ _("div", { class: "loading-dot dot-middle" }, null, -1),
86
+ _("div", { class: "loading-dot dot-end" }, null, -1)
88
87
  ]));
89
88
  }
90
- const et = /* @__PURE__ */ $(Ye, [["render", xe], ["__scopeId", "data-v-f976c7b6"]]), tt = {
89
+ const st = /* @__PURE__ */ L(rt, [["render", at], ["__scopeId", "data-v-f976c7b6"]]), lt = {
91
90
  key: 0,
92
91
  class: "mc-bubble-avatar-name"
93
- }, ot = {
92
+ }, ct = {
94
93
  key: 1,
95
94
  class: "loading-container"
96
- }, nt = /* @__PURE__ */ C({
95
+ }, dt = /* @__PURE__ */ T({
97
96
  __name: "Bubble",
98
- props: qe,
97
+ props: Ye,
99
98
  setup(e) {
100
- const t = ve(), n = e, a = H(() => [
99
+ const t = Se(), n = e, i = U(() => [
101
100
  `mc-bubble-avatar-${n.avatarPosition}`,
102
101
  `mc-bubble-${n.align}`,
103
102
  n.loading ? "mc-bubble-loading" : ""
104
- ]), u = H(() => {
103
+ ]), c = U(() => {
105
104
  if (n.avatarConfig) {
106
- const o = Object.keys(n.avatarConfig), s = o.some((r) => r === Je || r === Qe);
107
- return o.length < 1 || !s;
105
+ const o = Object.keys(n.avatarConfig), r = o.some((a) => a === nt || a === ot);
106
+ return o.length < 1 || !r;
108
107
  } else
109
108
  return !0;
110
109
  });
111
- return (o, s) => {
112
- var r, i, p;
113
- return l(), c("div", {
114
- class: b(["mc-bubble", a.value])
110
+ return (o, r) => {
111
+ var a, s, f;
112
+ return l(), d("div", {
113
+ class: $(["mc-bubble", i.value])
115
114
  }, [
116
- o.avatarConfig ? (l(), c("div", {
115
+ o.avatarConfig ? (l(), d("div", {
117
116
  key: 0,
118
- class: b(["mc-bubble-avatar", { "empty-avatar": u.value }])
117
+ class: $(["mc-bubble-avatar", { "empty-avatar": c.value }])
119
118
  }, [
120
- E(d(Ae), te(ge(
121
- u.value ? {
122
- width: ((r = o.avatarConfig) == null ? void 0 : r.width) || d(Ge),
123
- height: ((i = o.avatarConfig) == null ? void 0 : i.height) || d(Xe)
119
+ I(u(Ne), ue(ke(
120
+ c.value ? {
121
+ width: ((a = o.avatarConfig) == null ? void 0 : a.width) || u(et),
122
+ height: ((s = o.avatarConfig) == null ? void 0 : s.height) || u(tt)
124
123
  } : o.avatarConfig
125
124
  )), null, 16),
126
- o.avatarPosition === "top" ? (l(), c("span", tt, k((p = o.avatarConfig) == null ? void 0 : p.displayName), 1)) : y("", !0)
127
- ], 2)) : y("", !0),
128
- S("div", {
129
- class: b(["mc-bubble-content-container", { "with-avatar": o.avatarConfig }])
125
+ o.avatarPosition === "top" ? (l(), d("span", lt, S((f = o.avatarConfig) == null ? void 0 : f.displayName), 1)) : h("", !0)
126
+ ], 2)) : h("", !0),
127
+ _("div", {
128
+ class: $(["mc-bubble-content-container", { "with-avatar": o.avatarConfig }])
130
129
  }, [
131
- o.loading ? y("", !0) : v(o.$slots, "top", { key: 0 }, void 0, !0),
132
- o.loading ? (l(), c("div", ot, [
133
- v(o.$slots, "loadingTpl", {}, () => [
134
- E(et)
130
+ o.loading ? h("", !0) : y(o.$slots, "top", { key: 0 }, void 0, !0),
131
+ o.loading ? (l(), d("div", ct, [
132
+ y(o.$slots, "loadingTpl", {}, () => [
133
+ I(st)
135
134
  ], !0)
136
- ])) : y("", !0),
137
- (d(t).default || o.content) && !o.loading ? (l(), c("div", {
135
+ ])) : h("", !0),
136
+ (u(t).default || o.content) && !o.loading ? (l(), d("div", {
138
137
  key: 2,
139
- class: b(["mc-bubble-content", [o.variant]])
138
+ class: $(["mc-bubble-content", [o.variant]])
140
139
  }, [
141
- v(o.$slots, "default", {}, () => [
142
- U(k(o.content), 1)
140
+ y(o.$slots, "default", {}, () => [
141
+ fe(S(o.content), 1)
143
142
  ], !0)
144
- ], 2)) : y("", !0),
145
- o.loading ? y("", !0) : v(o.$slots, "bottom", { key: 3 }, void 0, !0)
143
+ ], 2)) : h("", !0),
144
+ o.loading ? h("", !0) : y(o.$slots, "bottom", { key: 3 }, void 0, !0)
146
145
  ], 2)
147
146
  ], 2);
148
147
  };
149
148
  }
150
- }), st = /* @__PURE__ */ $(nt, [["__scopeId", "data-v-817ff41e"]]);
151
- var N = /* @__PURE__ */ ((e) => (e.Simple = "simple", e.Full = "full", e))(N || {}), B = /* @__PURE__ */ ((e) => (e.Enter = "enter", e.ShiftEnter = "shiftEnter", e))(B || {});
152
- const at = {
149
+ }), ut = /* @__PURE__ */ L(dt, [["__scopeId", "data-v-817ff41e"]]);
150
+ var G = /* @__PURE__ */ ((e) => (e.Simple = "simple", e.Full = "full", e))(G || {}), z = /* @__PURE__ */ ((e) => (e.Enter = "enter", e.ShiftEnter = "shiftEnter", e))(z || {});
151
+ const ft = {
153
152
  value: {
154
153
  type: String,
155
154
  default: ""
@@ -182,106 +181,144 @@ const at = {
182
181
  default: "enter"
183
182
  /* Enter */
184
183
  }
185
- }, rt = ["change", "submit", "cancel"], W = "mc-input", lt = /* @__PURE__ */ C({
184
+ }, mt = ["change", "submit", "cancel"], oe = "mc-input", pt = /* @__PURE__ */ T({
186
185
  __name: "textarea",
187
186
  setup(e) {
188
- const { inputValue: t, rootProps: n, rootEmits: a } = oe(W), u = H(() => {
189
- let f = "", _ = "";
190
- return n.submitShortKey === B.Enter && (f = "Enter", _ = "Shift + Enter"), n.submitShortKey === B.ShiftEnter && (f = "Shift + Enter", _ = "Enter"), n.placeholder ?? (f ? `请输入您的问题,并按${f}发送,按${_}换行` : "请输入您的问题...");
187
+ const { inputValue: t, rootProps: n, rootEmits: i } = me(oe), c = U(() => {
188
+ let m = "", b = "";
189
+ return n.submitShortKey === z.Enter && (m = "Enter", b = "Shift + Enter"), n.submitShortKey === z.ShiftEnter && (m = "Shift + Enter", b = "Enter"), n.placeholder ?? (m ? `请输入您的问题,并按${m}发送,按${b}换行` : "请输入您的问题...");
191
190
  });
192
191
  let o = !1;
193
- const s = () => {
194
- ne(() => {
195
- a("change", t.value);
192
+ const r = () => {
193
+ pe(() => {
194
+ i("change", t.value);
196
195
  });
197
- }, r = () => {
198
- o || s();
199
- }, i = () => {
196
+ }, a = () => {
197
+ o || r();
198
+ }, s = () => {
200
199
  o = !0;
201
- }, p = () => {
202
- o = !1, s();
203
- }, g = (f) => {
200
+ }, f = () => {
201
+ o = !1, r();
202
+ }, g = (m) => {
204
203
  if (n.submitShortKey === null)
205
204
  return;
206
- (n.submitShortKey === B.Enter ? !f.shiftKey : n.submitShortKey === B.ShiftEnter ? f.shiftKey : !1) && f.code === "Enter" && (f.preventDefault(), a("submit", t.value), t.value = "");
205
+ (n.submitShortKey === z.Enter ? !m.shiftKey : n.submitShortKey === z.ShiftEnter ? m.shiftKey : !1) && m.code === "Enter" && (m.preventDefault(), i("submit", t.value), t.value = "");
207
206
  };
208
- return (f, _) => (l(), R(d(Pe), {
209
- modelValue: d(t),
210
- "onUpdate:modelValue": _[0] || (_[0] = (L) => ye(t) ? t.value = L : null),
211
- placeholder: u.value,
207
+ return (m, b) => (l(), B(u(Re), {
208
+ modelValue: u(t),
209
+ "onUpdate:modelValue": b[0] || (b[0] = (w) => Te(t) ? t.value = w : null),
210
+ placeholder: c.value,
212
211
  showGlowStyle: !1,
213
- disabled: d(n).disabled,
214
- maxlength: d(n).maxLength,
215
- class: b(["mc-textarea", { "mc-textarea-simple": d(n).displayType === d(N).Simple }]),
216
- onInput: r,
217
- onCompositionstart: i,
218
- onCompositionend: p,
212
+ disabled: u(n).disabled,
213
+ maxlength: u(n).maxLength,
214
+ class: $(["mc-textarea", { "mc-textarea-simple": u(n).displayType === u(G).Simple }]),
215
+ onInput: a,
216
+ onCompositionstart: s,
217
+ onCompositionend: f,
219
218
  onKeydown: g
220
219
  }, null, 8, ["modelValue", "placeholder", "disabled", "maxlength", "class"]));
221
220
  }
222
- }), it = /* @__PURE__ */ C({
221
+ }), gt = {}, vt = {
222
+ width: "16px",
223
+ height: "16px",
224
+ viewBox: "0 0 16 16",
225
+ version: "1.1",
226
+ xmlns: "http://www.w3.org/2000/svg"
227
+ };
228
+ function yt(e, t) {
229
+ return l(), d("svg", vt, t[0] || (t[0] = [
230
+ _("g", {
231
+ stroke: "none",
232
+ "stroke-width": "1",
233
+ fill: "none",
234
+ "fill-rule": "evenodd"
235
+ }, [
236
+ _("path", { d: "M8,12 C8.27614237,12 8.5,12.2238576 8.5,12.5 L8.5,14.5 C8.5,14.7761424 8.27614237,15 8,15 C7.72385763,15 7.5,14.7761424 7.5,14.5 L7.5,12.5 C7.5,12.2238576 7.72385763,12 8,12 Z M11.0495421,11.3466838 L12.2251126,12.9647178 C12.3874251,13.1881217 12.3379006,13.5008065 12.1144968,13.663119 C11.8910929,13.8254314 11.5784081,13.775907 11.4160956,13.5525031 L10.2405251,11.9344691 C10.0782127,11.7110652 10.1277371,11.3983804 10.351141,11.236068 C10.5745449,11.0737556 10.8872297,11.12328 11.0495421,11.3466838 Z M5.64885899,11.236068 C5.87226287,11.3983804 5.92178728,11.7110652 5.75947486,11.9344691 L4.58390436,13.5525031 C4.42159194,13.775907 4.10890711,13.8254314 3.88550323,13.663119 C3.66209936,13.5008065 3.61257495,13.1881217 3.77488736,12.9647178 L4.95045787,11.3466838 C5.11277028,11.12328 5.42545512,11.0737556 5.64885899,11.236068 Z M12.4342628,8.91504822 L14.3363759,9.53308221 C14.5990029,9.61841489 14.7427283,9.90049196 14.6573956,10.163119 C14.5720629,10.425746 14.2899859,10.5694714 14.0273589,10.4841387 L12.1252458,9.86610473 C11.8626188,9.78077205 11.7188934,9.49869498 11.8042261,9.23606798 C11.8895588,8.97344097 12.1716358,8.82971553 12.4342628,8.91504822 Z M4.19577393,9.23606798 C4.28110662,9.49869498 4.13738118,9.78077205 3.87475417,9.86610473 L1.97264114,10.4841387 C1.71001414,10.5694714 1.42793707,10.425746 1.34260439,10.163119 C1.2572717,9.90049196 1.40099714,9.61841489 1.66362415,9.53308221 L3.56573718,8.91504822 C3.82836418,8.82971553 4.11044125,8.97344097 4.19577393,9.23606798 Z M14.6573956,5.83688104 C14.7427283,6.09950804 14.5990029,6.38158511 14.3363759,6.46691779 L12.4342628,7.08495178 C12.1716358,7.17028447 11.8895588,7.02655903 11.8042261,6.76393202 C11.7188934,6.50130502 11.8626188,6.21922795 12.1252458,6.13389527 L14.0273589,5.51586128 C14.2899859,5.43052859 14.5720629,5.57425403 14.6573956,5.83688104 Z M1.97264114,5.51586128 L3.87475417,6.13389527 C4.13738118,6.21922795 4.28110662,6.50130502 4.19577393,6.76393202 C4.11044125,7.02655903 3.82836418,7.17028447 3.56573718,7.08495178 L1.66362415,6.46691779 C1.40099714,6.38158511 1.2572717,6.09950804 1.34260439,5.83688104 C1.42793707,5.57425403 1.71001414,5.43052859 1.97264114,5.51586128 Z M12.1144968,2.33688104 C12.3379006,2.49919345 12.3874251,2.81187829 12.2251126,3.03528216 L11.0495421,4.65331615 C10.8872297,4.87672003 10.5745449,4.92624444 10.351141,4.76393202 C10.1277371,4.60161961 10.0782127,4.28893477 10.2405251,4.0655309 L11.4160956,2.44749691 C11.5784081,2.22409304 11.8910929,2.17456862 12.1144968,2.33688104 Z M4.58390436,2.44749691 L5.75947486,4.0655309 C5.92178728,4.28893477 5.87226287,4.60161961 5.64885899,4.76393202 C5.42545512,4.92624444 5.11277028,4.87672003 4.95045787,4.65331615 L3.77488736,3.03528216 C3.61257495,2.81187829 3.66209936,2.49919345 3.88550323,2.33688104 C4.10890711,2.17456862 4.42159194,2.22409304 4.58390436,2.44749691 Z M8,1 C8.27614237,1 8.5,1.22385763 8.5,1.5 L8.5,3.5 C8.5,3.77614237 8.27614237,4 8,4 C7.72385763,4 7.5,3.77614237 7.5,3.5 L7.5,1.5 C7.5,1.22385763 7.72385763,1 8,1 Z" })
237
+ ], -1)
238
+ ]));
239
+ }
240
+ const ht = /* @__PURE__ */ L(gt, [["render", yt]]), bt = {}, _t = {
241
+ width: "16px",
242
+ height: "16px",
243
+ viewBox: "0 0 16 16",
244
+ version: "1.1",
245
+ xmlns: "http://www.w3.org/2000/svg"
246
+ };
247
+ function Ct(e, t) {
248
+ return l(), d("svg", _t, t[0] || (t[0] = [
249
+ _("g", {
250
+ stroke: "none",
251
+ "stroke-width": "1",
252
+ fill: "none",
253
+ "fill-rule": "evenodd"
254
+ }, [
255
+ _("path", { d: "M13.5105149,2.56164948 C14.1211149,2.35546948 14.7829149,2.68328948 14.9892149,3.29376948 C15.0349149,3.42925948 15.0552149,3.57159948 15.0495149,3.71368948 L15.0495149,3.71368948 L15.0351149,3.85546948 L13.6575149,12.2717195 C13.5237149,13.0892195 12.7524149,13.6435195 11.9348149,13.5097195 C11.8542149,13.4965195 11.7751149,13.4768195 11.6980149,13.4508195 L11.6980149,13.4508195 L11.5840149,13.4071195 L9.3049349,12.4260195 L8.4482449,13.5422195 C8.1958049,13.8708195 7.8205549,14.0786195 7.4128449,14.1207195 L7.4128449,14.1207195 L7.2585449,14.1286195 C6.4787649,14.1286195 5.8381349,13.5337195 5.7653849,12.7731195 L5.7653849,12.7731195 L5.7585449,12.6286195 L5.7602549,10.5258195 L5.7756349,10.4384195 L5.7944349,10.3824195 L5.8266649,10.3168995 L5.8735349,10.2503695 L5.9177249,10.2039195 L12.6909149,3.89392948 L2.3403349,7.38903948 C2.2329149,7.42529948 2.1418449,7.49676948 2.0808149,7.59063948 L2.0808149,7.59063948 L2.0412649,7.66497948 C1.9440949,7.89044948 2.0258749,8.14788948 2.2236349,8.27917948 L2.2236349,8.27917948 L2.3029749,8.32214948 L4.4799849,9.26177948 C4.7333949,9.37121948 4.8503449,9.66546948 4.7409649,9.91894948 C4.6435549,10.1443495 4.4003949,10.2616595 4.1694349,10.2081295 L4.1694349,10.2081295 L4.0837449,10.1798795 L1.9072249,9.24047948 C1.1462449,8.91284948 0.795166898,8.03039948 1.1225549,7.26953948 C1.2700249,6.92755948 1.5380849,6.65435948 1.8730449,6.50018948 L1.8730449,6.50018948 L2.0205049,6.44158948 Z M6.7578149,11.3299195 L6.7585449,12.6286195 L6.7666013,12.7185103 C6.80894095,12.9517898 7.0131049,13.1286195 7.2585449,13.1286195 C7.3828149,13.1286195 7.5014649,13.0824195 7.5925349,13.0008195 L7.5925349,13.0008195 L7.6550349,12.9332195 L8.3569349,12.0179195 L6.7578149,11.3299195 Z M13.9888149,4.05090948 L7.1599149,10.4129195 L11.9795149,12.4886195 C11.9980149,12.4966195 12.0173149,12.5035195 12.0369149,12.5093195 L12.0369149,12.5093195 L12.0964149,12.5228195 C12.3386149,12.5624195 12.5686149,12.4209195 12.6482149,12.1975195 L12.6482149,12.1975195 L12.6706149,12.1101195 L13.9888149,4.05090948 Z" })
256
+ ], -1)
257
+ ]));
258
+ }
259
+ const Lt = /* @__PURE__ */ L(bt, [["render", Ct]]), $t = /* @__PURE__ */ T({
223
260
  __name: "button",
224
261
  setup(e) {
225
- const { inputValue: t, rootProps: n, rootEmits: a } = oe(W), u = () => {
226
- n.loading ? a("cancel") : (a("submit", t.value), t.value = "");
262
+ const { inputValue: t, rootProps: n, rootEmits: i } = me(oe), c = () => {
263
+ n.loading ? i("cancel") : (i("submit", t.value), t.value = "");
227
264
  };
228
- return (o, s) => (l(), R(d(Me), {
265
+ return (o, r) => (l(), B(u(Ze), {
229
266
  variant: "solid",
230
- icon: d(n).loading ? "icon-loading-2" : "publish-new",
231
267
  shape: "round",
232
- disabled: d(n).disabled || !d(n).loading && !d(t),
233
- class: b(["mc-button", { "mc-button-loading": d(n).loading }]),
234
- onClick: u
268
+ disabled: u(n).disabled || !u(n).loading && !u(t),
269
+ class: $(["mc-button", { "mc-button-loading": u(n).loading }]),
270
+ onClick: c
235
271
  }, {
236
- default: O(() => [
237
- U(k(d(n).loading ? "暂停回答" : "发送"), 1)
272
+ default: x(() => [
273
+ u(n).loading ? (l(), B(ht, { key: 0 })) : (l(), B(Lt, { key: 1 })),
274
+ _("span", null, S(u(n).loading ? "暂停回答" : "发送"), 1)
238
275
  ]),
239
276
  _: 1
240
- }, 8, ["icon", "disabled", "class"]));
277
+ }, 8, ["disabled", "class"]));
241
278
  }
242
- }), x = /* @__PURE__ */ $(it, [["__scopeId", "data-v-75e80f2d"]]), ct = { class: "mc-input-content" }, ut = {
279
+ }), ae = /* @__PURE__ */ L($t, [["__scopeId", "data-v-4b65a940"]]), St = { class: "mc-input-content" }, kt = {
243
280
  key: 0,
244
281
  class: "mc-input-foot"
245
- }, dt = { class: "mc-input-foot-left" }, mt = {
282
+ }, Tt = { class: "mc-input-foot-left" }, wt = {
246
283
  key: 0,
247
284
  class: "mc-input-foot-count"
248
- }, pt = /* @__PURE__ */ C({
285
+ }, Et = /* @__PURE__ */ T({
249
286
  __name: "Input",
250
- props: at,
251
- emits: rt,
287
+ props: ft,
288
+ emits: mt,
252
289
  setup(e, { expose: t, emit: n }) {
253
- const a = e, u = n, o = w(""), s = () => {
290
+ const i = e, c = n, o = j(""), r = () => {
254
291
  o.value = "";
255
- }, r = () => o.value;
256
- return se(
257
- () => a.value,
292
+ }, a = () => o.value;
293
+ return ge(
294
+ () => i.value,
258
295
  () => {
259
- o.value = a.value;
296
+ o.value = i.value;
260
297
  },
261
298
  { immediate: !0 }
262
- ), t({ clearInput: s, getInput: r }), he(W, { inputValue: o, rootProps: a, rootEmits: u }), (i, p) => (l(), c("div", {
263
- class: b(["mc-input", { "mc-input-disabled": i.disabled }])
299
+ ), t({ clearInput: r, getInput: a }), we(oe, { inputValue: o, rootProps: i, rootEmits: c }), (s, f) => (l(), d("div", {
300
+ class: $(["mc-input", { "mc-input-disabled": s.disabled }])
264
301
  }, [
265
- v(i.$slots, "head"),
266
- S("div", ct, [
267
- v(i.$slots, "prefix"),
268
- E(lt),
269
- i.displayType === d(N).Simple ? v(i.$slots, "button", { key: 0 }, () => [
270
- E(x)
271
- ]) : y("", !0)
302
+ y(s.$slots, "head"),
303
+ _("div", St, [
304
+ y(s.$slots, "prefix"),
305
+ I(pt),
306
+ s.displayType === u(G).Simple ? y(s.$slots, "button", { key: 0 }, () => [
307
+ I(ae)
308
+ ]) : h("", !0)
272
309
  ]),
273
- i.displayType === d(N).Full ? (l(), c("div", ut, [
274
- S("div", dt, [
275
- v(i.$slots, "extra"),
276
- i.showCount ? (l(), c("span", mt, k(o.value.length) + k(i.maxLength ?? !1 ? `/${i.maxLength}` : ""), 1)) : y("", !0)
310
+ s.displayType === u(G).Full ? (l(), d("div", kt, [
311
+ _("div", Tt, [
312
+ y(s.$slots, "extra"),
313
+ s.showCount ? (l(), d("span", wt, S(o.value.length) + S(s.maxLength ?? !1 ? `/${s.maxLength}` : ""), 1)) : h("", !0)
277
314
  ]),
278
- v(i.$slots, "button", {}, () => [
279
- E(x)
315
+ y(s.$slots, "button", {}, () => [
316
+ I(ae)
280
317
  ])
281
- ])) : y("", !0)
318
+ ])) : h("", !0)
282
319
  ], 2));
283
320
  }
284
- }), ft = {
321
+ }), It = {
285
322
  logoImg: {
286
323
  type: String,
287
324
  default: ""
@@ -306,37 +343,37 @@ const at = {
306
343
  type: String,
307
344
  default: "center"
308
345
  }
309
- }, vt = { class: "mc-introduction-logo-container" }, gt = ["src", "alt"], yt = { class: "mc-introduction-title" }, ht = {
346
+ }, Mt = { class: "mc-introduction-logo-container" }, At = ["src", "alt"], Pt = { class: "mc-introduction-title" }, Ot = {
310
347
  key: 0,
311
348
  class: "mc-introduction-sub-title"
312
- }, _t = {
349
+ }, Bt = {
313
350
  key: 1,
314
351
  class: "mc-introduction-description"
315
- }, bt = /* @__PURE__ */ C({
352
+ }, jt = /* @__PURE__ */ T({
316
353
  __name: "Introduction",
317
- props: ft,
354
+ props: It,
318
355
  setup(e) {
319
- return (t, n) => (l(), c("div", {
320
- class: b(["mc-introduction", [t.align, t.background]])
356
+ return (t, n) => (l(), d("div", {
357
+ class: $(["mc-introduction", [t.align, t.background]])
321
358
  }, [
322
- S("div", vt, [
323
- t.logoImg ? (l(), c("img", {
359
+ _("div", Mt, [
360
+ t.logoImg ? (l(), d("img", {
324
361
  key: 0,
325
362
  src: t.logoImg,
326
363
  alt: t.title
327
- }, null, 8, gt)) : y("", !0),
328
- S("div", yt, k(t.title), 1)
364
+ }, null, 8, At)) : h("", !0),
365
+ _("div", Pt, S(t.title), 1)
329
366
  ]),
330
- t.subTitle ? (l(), c("div", ht, k(t.subTitle), 1)) : y("", !0),
331
- t.description.length ? (l(), c("div", _t, [
332
- (l(!0), c(V, null, ae(t.description, (a, u) => (l(), c("div", { key: u }, k(a), 1))), 128))
333
- ])) : y("", !0),
334
- v(t.$slots, "default", {}, void 0, !0)
367
+ t.subTitle ? (l(), d("div", Ot, S(t.subTitle), 1)) : h("", !0),
368
+ t.description.length ? (l(), d("div", Bt, [
369
+ (l(!0), d(D, null, ve(t.description, (i, c) => (l(), d("div", { key: c }, S(i), 1))), 128))
370
+ ])) : h("", !0),
371
+ y(t.$slots, "default", {}, void 0, !0)
335
372
  ], 2));
336
373
  }
337
- }), $t = /* @__PURE__ */ $(bt, [["__scopeId", "data-v-48b255c7"]]);
338
- var K = /* @__PURE__ */ ((e) => (e.Horizontal = "horizontal", e.Vertical = "vertical", e))(K || {}), q = /* @__PURE__ */ ((e) => (e.Transparent = "transparent", e.Filled = "filled", e.Bordered = "bordered", e.None = "none", e))(q || {});
339
- const St = {
374
+ }), Vt = /* @__PURE__ */ L(jt, [["__scopeId", "data-v-48b255c7"]]);
375
+ var W = /* @__PURE__ */ ((e) => (e.Horizontal = "horizontal", e.Vertical = "vertical", e))(W || {}), re = /* @__PURE__ */ ((e) => (e.Transparent = "transparent", e.Filled = "filled", e.Bordered = "bordered", e.None = "none", e))(re || {});
376
+ const Ht = {
340
377
  direction: {
341
378
  type: String,
342
379
  default: "vertical"
@@ -370,79 +407,79 @@ const St = {
370
407
  type: Boolean,
371
408
  default: !0
372
409
  }
373
- }, kt = 50, Ct = ["TEXTAREA", "INPUT"], Et = "ArrowUp", It = "ArrowDown", wt = "Enter";
374
- function Lt(e, t) {
375
- const n = w(e.enableShortKey ? 0 : -1), a = (s) => {
376
- if (!s.disabled) {
410
+ }, Kt = 50, Nt = ["TEXTAREA", "INPUT"], Rt = "ArrowUp", Zt = "ArrowDown", zt = "Enter";
411
+ function Dt(e, t) {
412
+ const n = j(e.enableShortKey ? 0 : -1), i = (r) => {
413
+ if (!r.disabled) {
377
414
  if (e.selectable)
378
- for (let r = 0; r < e.data.length; r++)
379
- e.data[r].active = e.data[r].value === s.value;
380
- t("select", { ...s });
415
+ for (let a = 0; a < e.data.length; a++)
416
+ e.data[a].active = e.data[a].value === r.value;
417
+ t("select", { ...r });
381
418
  }
382
- }, u = (s) => {
383
- if (!e.enableLazyLoad || e.direction !== K.Vertical)
419
+ }, c = (r) => {
420
+ if (!e.enableLazyLoad || e.direction !== W.Vertical)
384
421
  return;
385
- const r = s.target, i = r.scrollHeight, p = r.clientHeight, g = r.scrollTop;
386
- i - p - g < kt && t("loadMore", s);
387
- }, o = (s) => {
388
- s.code === Et && (n.value = n.value === 0 ? e.data.length - 1 : n.value - 1), s.code === It && (n.value = n.value === e.data.length - 1 ? 0 : n.value + 1), s.code === wt && (e.selectable && (e.data[n.value].active = !0), t("select", { ...e.data[n.value] }));
422
+ const a = r.target, s = a.scrollHeight, f = a.clientHeight, g = a.scrollTop;
423
+ s - f - g < Kt && t("loadMore", r);
424
+ }, o = (r) => {
425
+ r.code === Rt && (n.value = n.value === 0 ? e.data.length - 1 : n.value - 1), r.code === Zt && (n.value = n.value === e.data.length - 1 ? 0 : n.value + 1), r.code === zt && (e.selectable && (e.data[n.value].active = !0), t("select", { ...e.data[n.value] }));
389
426
  };
390
- return re(() => {
391
- let s;
427
+ return ye(() => {
428
+ let r;
392
429
  if (e.inputEl) {
393
- const r = e.inputEl.$el ?? e.inputEl;
394
- Ct.includes(r.tagName) ? s = r : s = r.querySelector("textarea") || r.querySelector("input") || document;
430
+ const a = e.inputEl.$el ?? e.inputEl;
431
+ Nt.includes(a.tagName) ? r = a : r = a.querySelector("textarea") || a.querySelector("input") || document;
395
432
  } else
396
- s = document;
397
- e.enableShortKey && s.addEventListener("keydown", o);
398
- }), { preSelectIndex: n, onItemClick: a, onListScroll: u };
433
+ r = document;
434
+ e.enableShortKey && r.addEventListener("keydown", o);
435
+ }), { preSelectIndex: n, onItemClick: i, onListScroll: c };
399
436
  }
400
- function Tt(e) {
401
- return { listClasses: H(() => ({
437
+ function Wt(e) {
438
+ return { listClasses: U(() => ({
402
439
  "mc-list": !0,
403
- "mc-list-horizontal": e.direction === K.Horizontal,
404
- "mc-list-nowrap": e.direction === K.Horizontal && !e.autoWrap
440
+ "mc-list-horizontal": e.direction === W.Horizontal,
441
+ "mc-list-nowrap": e.direction === W.Horizontal && !e.autoWrap
405
442
  })) };
406
443
  }
407
- const At = ["onClick"], Pt = /* @__PURE__ */ C({
444
+ const Ft = ["onClick"], Ut = /* @__PURE__ */ T({
408
445
  __name: "List",
409
- props: St,
446
+ props: Ht,
410
447
  emits: ["select", "loadMore"],
411
448
  setup(e, { emit: t }) {
412
- const n = e, a = t, { listClasses: u } = Tt(n), { preSelectIndex: o, onItemClick: s, onListScroll: r } = Lt(n, a);
413
- return (i, p) => (l(), c("div", {
414
- class: b(d(u)),
415
- onScroll: p[0] || (p[0] = //@ts-ignore
416
- (...g) => d(r) && d(r)(...g))
449
+ const n = e, i = t, { listClasses: c } = Wt(n), { preSelectIndex: o, onItemClick: r, onListScroll: a } = Dt(n, i);
450
+ return (s, f) => (l(), d("div", {
451
+ class: $(u(c)),
452
+ onScroll: f[0] || (f[0] = //@ts-ignore
453
+ (...g) => u(a) && u(a)(...g))
417
454
  }, [
418
- (l(!0), c(V, null, ae(i.data, (g, f) => (l(), c(V, { key: f }, [
419
- i.variant === d(q).None ? v(i.$slots, "item", {
455
+ (l(!0), d(D, null, ve(s.data, (g, m) => (l(), d(D, { key: m }, [
456
+ s.variant === u(re).None ? y(s.$slots, "item", {
420
457
  key: 0,
421
458
  item: g
422
- }, void 0, !0) : (l(), c("div", {
459
+ }, void 0, !0) : (l(), d("div", {
423
460
  key: 1,
424
- class: b([
461
+ class: $([
425
462
  "mc-list-item",
426
463
  {
427
464
  "mc-list-item-disabled": g.disabled,
428
465
  "mc-list-item-active": g.active,
429
- "mc-list-item-pre-selection": f === d(o)
466
+ "mc-list-item-pre-selection": m === u(o)
430
467
  },
431
- i.variant
468
+ s.variant
432
469
  ]),
433
- onClick: () => d(s)(g)
470
+ onClick: () => u(r)(g)
434
471
  }, [
435
- v(i.$slots, "item", { item: g }, () => [
436
- U(k(g.label), 1)
472
+ y(s.$slots, "item", { item: g }, () => [
473
+ fe(S(g.label), 1)
437
474
  ], !0)
438
- ], 10, At))
475
+ ], 10, Ft))
439
476
  ], 64))), 128))
440
477
  ], 34));
441
478
  }
442
- }), le = /* @__PURE__ */ $(Pt, [["__scopeId", "data-v-adad50a4"]]), Mt = {
479
+ }), he = /* @__PURE__ */ L(Ut, [["__scopeId", "data-v-adad50a4"]]), xt = {
443
480
  direction: {
444
481
  type: String,
445
- default: K.Vertical
482
+ default: W.Vertical
446
483
  },
447
484
  list: {
448
485
  type: Array,
@@ -450,57 +487,57 @@ const At = ["onClick"], Pt = /* @__PURE__ */ C({
450
487
  },
451
488
  variant: {
452
489
  type: String,
453
- default: q.Filled
490
+ default: re.Filled
454
491
  }
455
- }, Bt = {
492
+ }, Gt = {
456
493
  prompt: {
457
494
  type: Object
458
495
  }
459
- }, Vt = { class: "mc-prompt-item" }, Kt = {
496
+ }, qt = { class: "mc-prompt-item" }, Xt = {
460
497
  key: 0,
461
498
  class: "mc-prompt-item-content"
462
- }, Ht = {
499
+ }, Jt = {
463
500
  key: 0,
464
501
  class: "mc-prompt-item-label"
465
- }, Ot = {
502
+ }, Qt = {
466
503
  key: 1,
467
504
  class: "mc-prompt-item-description"
468
- }, Nt = /* @__PURE__ */ C({
505
+ }, Yt = /* @__PURE__ */ T({
469
506
  __name: "PromptItem",
470
- props: Bt,
507
+ props: Gt,
471
508
  setup(e) {
472
509
  return (t, n) => {
473
- var a, u, o, s, r, i, p, g, f;
474
- return l(), c("div", Vt, [
475
- S("div", {
476
- class: b(["mc-prompt-item-icon", { "no-description": !((a = t.prompt) != null && a.desc) }])
510
+ var i, c, o, r, a, s, f, g, m;
511
+ return l(), d("div", qt, [
512
+ _("div", {
513
+ class: $(["mc-prompt-item-icon", { "no-description": !((i = t.prompt) != null && i.desc) }])
477
514
  }, [
478
- (u = t.prompt) != null && u.iconConfig ? (l(), R(d(Be), te(_e({ key: 0 }, (o = t.prompt) == null ? void 0 : o.iconConfig)), null, 16)) : y("", !0)
515
+ (c = t.prompt) != null && c.iconConfig ? (l(), B(u(ze), ue(Ee({ key: 0 }, (o = t.prompt) == null ? void 0 : o.iconConfig)), null, 16)) : h("", !0)
479
516
  ], 2),
480
- (s = t.prompt) != null && s.label || (r = t.prompt) != null && r.desc ? (l(), c("div", Kt, [
481
- (i = t.prompt) != null && i.label ? (l(), c("div", Ht, k((p = t.prompt) == null ? void 0 : p.label), 1)) : y("", !0),
482
- (g = t.prompt) != null && g.desc ? (l(), c("div", Ot, k((f = t.prompt) == null ? void 0 : f.desc), 1)) : y("", !0)
483
- ])) : y("", !0)
517
+ (r = t.prompt) != null && r.label || (a = t.prompt) != null && a.desc ? (l(), d("div", Xt, [
518
+ (s = t.prompt) != null && s.label ? (l(), d("div", Jt, S((f = t.prompt) == null ? void 0 : f.label), 1)) : h("", !0),
519
+ (g = t.prompt) != null && g.desc ? (l(), d("div", Qt, S((m = t.prompt) == null ? void 0 : m.desc), 1)) : h("", !0)
520
+ ])) : h("", !0)
484
521
  ]);
485
522
  };
486
523
  }
487
- }), Rt = /* @__PURE__ */ $(Nt, [["__scopeId", "data-v-5f016595"]]), zt = { class: "mc-prompt" }, Dt = /* @__PURE__ */ C({
524
+ }), en = /* @__PURE__ */ L(Yt, [["__scopeId", "data-v-5f016595"]]), tn = { class: "mc-prompt" }, nn = /* @__PURE__ */ T({
488
525
  __name: "Prompt",
489
- props: Mt,
526
+ props: xt,
490
527
  emits: ["itemClick"],
491
528
  setup(e, { emit: t }) {
492
- const n = t, a = e;
493
- return (u, o) => (l(), c("div", zt, [
494
- E(le, {
495
- data: a.list,
496
- direction: a.direction,
497
- variant: a.variant,
529
+ const n = t, i = e;
530
+ return (c, o) => (l(), d("div", tn, [
531
+ I(he, {
532
+ data: i.list,
533
+ direction: i.direction,
534
+ variant: i.variant,
498
535
  selectable: !1
499
536
  }, {
500
- item: O(({ item: s }) => [
501
- E(Rt, {
502
- prompt: s,
503
- onClick: (r) => n("itemClick", s)
537
+ item: x(({ item: r }) => [
538
+ I(en, {
539
+ prompt: r,
540
+ onClick: (a) => n("itemClick", r)
504
541
  }, null, 8, ["prompt", "onClick"])
505
542
  ]),
506
543
  _: 1
@@ -508,41 +545,41 @@ const At = ["onClick"], Pt = /* @__PURE__ */ C({
508
545
  ]));
509
546
  }
510
547
  });
511
- function ee(e) {
512
- return Se("span", {}, e);
548
+ function se(e) {
549
+ return Ae("span", {}, e);
513
550
  }
514
- function ie(e) {
551
+ function be(e) {
515
552
  for (const t of e) {
516
- if (Ve(t)) {
517
- if (t.type === be)
553
+ if (De(t)) {
554
+ if (t.type === Ie)
518
555
  continue;
519
- return t.type === "svg" || t.type === $e ? ee(t) : t.type === V ? ie(t.children) : t;
556
+ return t.type === "svg" || t.type === Me ? se(t) : t.type === D ? be(t.children) : t;
520
557
  }
521
- return ee(t);
558
+ return se(t);
522
559
  }
523
560
  return null;
524
561
  }
525
- const jt = /* @__PURE__ */ C({
562
+ const on = /* @__PURE__ */ T({
526
563
  setup(e, t) {
527
564
  const {
528
565
  slots: n,
529
- attrs: a,
530
- expose: u
531
- } = t, o = w();
532
- return u({
566
+ attrs: i,
567
+ expose: c
568
+ } = t, o = j();
569
+ return c({
533
570
  triggerEl: o
534
571
  }), () => {
535
- var i;
536
- const s = (i = n.default) == null ? void 0 : i.call(n, a);
537
- if (!s)
572
+ var s;
573
+ const r = (s = n.default) == null ? void 0 : s.call(n, i);
574
+ if (!r)
538
575
  return null;
539
- const r = ie(s);
540
- return r ? ke(Ce(r, a), [[{
541
- mounted(p) {
542
- o.value = p;
576
+ const a = be(r);
577
+ return a ? Pe(Oe(a, i), [[{
578
+ mounted(f) {
579
+ o.value = f;
543
580
  },
544
- updated(p) {
545
- o.value = p;
581
+ updated(f) {
582
+ o.value = f;
546
583
  },
547
584
  unmounted() {
548
585
  o.value = null;
@@ -550,7 +587,7 @@ const jt = /* @__PURE__ */ C({
550
587
  }]]) : null;
551
588
  };
552
589
  }
553
- }), Ft = {
590
+ }), rn = {
554
591
  modelValue: {
555
592
  type: Boolean,
556
593
  default: !1
@@ -566,160 +603,267 @@ const jt = /* @__PURE__ */ C({
566
603
  menuClass: {
567
604
  type: String
568
605
  }
569
- }, Ut = ["update:modelValue", "searchChange", "toggleChange"], F = " ", Wt = "ArrowLeft", qt = "ArrowRight", Gt = "Escape";
570
- function Xt(e, t) {
571
- const n = w(), a = w(), u = w(), o = Ee({ top: "0px", left: "0px", width: "" });
572
- let s, r, i, p, g = "", f, _;
573
- const L = async () => {
574
- if (!a.value || !u.value)
606
+ }, an = ["update:modelValue", "searchChange", "toggleChange"];
607
+ var sn = typeof global == "object" && global && global.Object === Object && global, ln = typeof self == "object" && self && self.Object === Object && self, _e = sn || ln || Function("return this")(), q = _e.Symbol, Ce = Object.prototype, cn = Ce.hasOwnProperty, dn = Ce.toString, Z = q ? q.toStringTag : void 0;
608
+ function un(e) {
609
+ var t = cn.call(e, Z), n = e[Z];
610
+ try {
611
+ e[Z] = void 0;
612
+ var i = !0;
613
+ } catch {
614
+ }
615
+ var c = dn.call(e);
616
+ return i && (t ? e[Z] = n : delete e[Z]), c;
617
+ }
618
+ var fn = Object.prototype, mn = fn.toString;
619
+ function pn(e) {
620
+ return mn.call(e);
621
+ }
622
+ var gn = "[object Null]", vn = "[object Undefined]", le = q ? q.toStringTag : void 0;
623
+ function yn(e) {
624
+ return e == null ? e === void 0 ? vn : gn : le && le in Object(e) ? un(e) : pn(e);
625
+ }
626
+ function hn(e) {
627
+ return e != null && typeof e == "object";
628
+ }
629
+ var bn = "[object Symbol]";
630
+ function _n(e) {
631
+ return typeof e == "symbol" || hn(e) && yn(e) == bn;
632
+ }
633
+ var Cn = /\s/;
634
+ function Ln(e) {
635
+ for (var t = e.length; t-- && Cn.test(e.charAt(t)); )
636
+ ;
637
+ return t;
638
+ }
639
+ var $n = /^\s+/;
640
+ function Sn(e) {
641
+ return e && e.slice(0, Ln(e) + 1).replace($n, "");
642
+ }
643
+ function X(e) {
644
+ var t = typeof e;
645
+ return e != null && (t == "object" || t == "function");
646
+ }
647
+ var ce = NaN, kn = /^[-+]0x[0-9a-f]+$/i, Tn = /^0b[01]+$/i, wn = /^0o[0-7]+$/i, En = parseInt;
648
+ function de(e) {
649
+ if (typeof e == "number")
650
+ return e;
651
+ if (_n(e))
652
+ return ce;
653
+ if (X(e)) {
654
+ var t = typeof e.valueOf == "function" ? e.valueOf() : e;
655
+ e = X(t) ? t + "" : t;
656
+ }
657
+ if (typeof e != "string")
658
+ return e === 0 ? e : +e;
659
+ e = Sn(e);
660
+ var n = Tn.test(e);
661
+ return n || wn.test(e) ? En(e.slice(2), n ? 2 : 8) : kn.test(e) ? ce : +e;
662
+ }
663
+ var te = function() {
664
+ return _e.Date.now();
665
+ }, In = "Expected a function", Mn = Math.max, An = Math.min;
666
+ function Pn(e, t, n) {
667
+ var i, c, o, r, a, s, f = 0, g = !1, m = !1, b = !0;
668
+ if (typeof e != "function")
669
+ throw new TypeError(In);
670
+ t = de(t) || 0, X(n) && (g = !!n.leading, m = "maxWait" in n, o = m ? Mn(de(n.maxWait) || 0, t) : o, b = "trailing" in n ? !!n.trailing : b);
671
+ function w(v) {
672
+ var k = i, E = c;
673
+ return i = c = void 0, f = v, r = e.apply(E, k), r;
674
+ }
675
+ function J(v) {
676
+ return f = v, a = setTimeout(A, t), g ? w(v) : r;
677
+ }
678
+ function Q(v) {
679
+ var k = v - s, E = v - f, F = t - k;
680
+ return m ? An(F, o - E) : F;
681
+ }
682
+ function V(v) {
683
+ var k = v - s, E = v - f;
684
+ return s === void 0 || k >= t || k < 0 || m && E >= o;
685
+ }
686
+ function A() {
687
+ var v = te();
688
+ if (V(v))
689
+ return M(v);
690
+ a = setTimeout(A, Q(v));
691
+ }
692
+ function M(v) {
693
+ return a = void 0, b && i ? w(v) : (i = c = void 0, r);
694
+ }
695
+ function Y() {
696
+ a !== void 0 && clearTimeout(a), f = 0, i = s = c = a = void 0;
697
+ }
698
+ function H() {
699
+ return a === void 0 ? r : M(te());
700
+ }
701
+ function P() {
702
+ var v = te(), k = V(v);
703
+ if (i = arguments, c = this, s = v, k) {
704
+ if (a === void 0)
705
+ return J(s);
706
+ if (m)
707
+ return clearTimeout(a), a = setTimeout(A, t), w(s);
708
+ }
709
+ return a === void 0 && (a = setTimeout(A, t)), r;
710
+ }
711
+ return P.cancel = Y, P.flush = H, P;
712
+ }
713
+ const ne = " ", On = "ArrowLeft", Bn = "ArrowRight", jn = "Escape";
714
+ function Vn(e, t) {
715
+ const n = j(), i = j(), c = j(), o = Be({ top: "0px", left: "0px", width: "" });
716
+ let r, a, s, f, g = "", m, b;
717
+ const w = async () => {
718
+ if (!i.value || !c.value)
575
719
  return;
576
- const { x: m, y: h } = await Ke(a.value, u.value, {
720
+ const { x: p, y: C } = await We(i.value, c.value, {
577
721
  strategy: "fixed",
578
722
  placement: "top-start",
579
- middleware: [He(4)]
723
+ middleware: [Fe(4)]
580
724
  });
581
- o.top = `${h}px`, o.left = `${m}px`;
582
- }, ce = () => {
583
- const { width: m } = a.value.getBoundingClientRect();
584
- o.width = `${m}px`, L();
585
- }, ue = () => {
586
- e.fitHostWidth && typeof window < "u" && a.value && (_ = new window.ResizeObserver(ce), _.observe(a.value));
587
- }, G = () => {
588
- a.value && (_ == null || _.unobserve(a.value));
725
+ o.top = `${C}px`, o.left = `${p}px`;
726
+ }, J = () => {
727
+ const { width: p } = i.value.getBoundingClientRect();
728
+ o.width = `${p}px`, w();
729
+ }, Q = () => {
730
+ e.fitHostWidth && typeof window < "u" && i.value && (b = new window.ResizeObserver(J), b.observe(i.value));
731
+ }, V = () => {
732
+ i.value && (b == null || b.unobserve(i.value));
589
733
  };
590
- se(
734
+ ge(
591
735
  () => e.modelValue,
592
- (m, h) => {
593
- m ? (ne(L), ue(), window.addEventListener("scroll", D, !0)) : (G(), window.removeEventListener("scroll", D, !0)), h !== void 0 && t("toggleChange", m);
736
+ (p, C) => {
737
+ p ? (pe(w), Q(), typeof window < "u" && window.addEventListener("scroll", E, !0)) : (V(), typeof window < "u" && window.removeEventListener("scroll", E, !0)), C !== void 0 && t("toggleChange", p);
594
738
  },
595
739
  { immediate: !0 }
596
740
  );
597
- const X = () => {
598
- r = null, i = -1, p = -1, g = "";
599
- }, T = (m) => {
600
- t("update:modelValue", m);
601
- }, de = () => {
602
- if (!s)
741
+ const A = () => {
742
+ a = null, s = -1, f = -1, g = "";
743
+ }, M = (p) => {
744
+ t("update:modelValue", p);
745
+ }, Y = () => {
746
+ if (!r)
603
747
  return;
604
- const m = s.value.replace(/[\r\n]/g, F) || "", h = s.selectionStart;
605
- if (!m.trim() || !h) {
606
- X();
748
+ const p = r.value.replace(/[\r\n]/g, ne) || "", C = r.selectionStart;
749
+ if (!p.trim() || !C) {
750
+ A();
607
751
  return;
608
752
  }
609
- for (let I = 0; I < e.prefix.length; I++) {
610
- const A = e.prefix[I];
611
- let P = "", Z = !1;
612
- if (typeof A == "string")
613
- P = A;
614
- else if (Ne(A))
615
- P = A.key, Z = !!A.onlyInputStart;
753
+ for (let O = 0; O < e.prefix.length; O++) {
754
+ const K = e.prefix[O];
755
+ let N = "", ie = !1;
756
+ if (typeof K == "string")
757
+ N = K;
758
+ else if (X(K))
759
+ N = K.key, ie = !!K.onlyInputStart;
616
760
  else
617
761
  continue;
618
- const M = m.lastIndexOf(P, h), pe = m.lastIndexOf(F, h), j = m.substring(M, h), fe = j.charAt(j.length - 1);
619
- if (M < 0 || M > 0 && Z || M < pe || fe === F)
620
- X();
762
+ const R = p.lastIndexOf(N, C), Le = p.lastIndexOf(ne, C), ee = p.substring(R, C), $e = ee.charAt(ee.length - 1);
763
+ if (R < 0 || R > 0 && ie || R < Le || $e === ne)
764
+ A();
621
765
  else {
622
- r = P, i = M, p = h, g = j.slice(P.length);
766
+ a = N, s = R, f = C, g = ee.slice(N.length);
623
767
  return;
624
768
  }
625
769
  }
626
- }, z = () => {
627
- if (de(), !r) {
628
- T(!1);
770
+ }, H = () => {
771
+ if (Y(), !a) {
772
+ M(!1);
629
773
  return;
630
774
  }
631
- t("searchChange", { value: g, trigger: r, triggerIndex: i, cursorIndex: p }), T(!0);
632
- }, J = Oe(z, 300), Q = (m) => {
633
- (m.code === Wt || m.code === qt) && (f = setTimeout(() => {
634
- z(), f && (f = void 0, clearTimeout(f));
635
- })), m.code === Gt && T(!1);
636
- }, Y = (m) => {
637
- var h, I;
638
- e.modelValue ? (h = a.value) != null && h.contains(m.target) || T(!1) : (I = a.value) != null && I.contains(m.target) && z();
775
+ t("searchChange", { value: g, trigger: a, triggerIndex: s, cursorIndex: f }), M(!0);
776
+ }, P = Pn(H, 300), v = (p) => {
777
+ (p.code === On || p.code === Bn) && (m = setTimeout(() => {
778
+ H(), m && (m = void 0, clearTimeout(m));
779
+ })), p.code === jn && M(!1);
780
+ }, k = (p) => {
781
+ var C, O;
782
+ e.modelValue ? (C = i.value) != null && C.contains(p.target) || M(!1) : (O = i.value) != null && O.contains(p.target) && H();
639
783
  };
640
- function D(m) {
641
- const h = m.target;
642
- h != null && h.contains(a.value) && L();
784
+ function E(p) {
785
+ const C = p.target;
786
+ C != null && C.contains(i.value) && w();
643
787
  }
644
- const me = () => {
645
- a.value && (s = a.value.querySelector("textarea") || a.value.querySelector("input"), s && (s.addEventListener("input", J), s.addEventListener("keydown", Q))), document.addEventListener("click", Y);
788
+ const F = () => {
789
+ i.value && (r = i.value.querySelector("textarea") || i.value.querySelector("input"), r && (r.addEventListener("input", P), r.addEventListener("keydown", v))), document.addEventListener("click", k);
646
790
  };
647
- return re(() => {
648
- const m = n.value.triggerEl;
649
- a.value = m.$el ?? m, me();
650
- }), Ie(() => {
651
- T(!1), s == null || s.removeEventListener("input", J), s == null || s.removeEventListener("keydown", Q), document.removeEventListener("click", Y), window.removeEventListener("scroll", D, !0), G();
652
- }), { popperTriggerEl: n, overlayEl: u, overlayStyle: o };
791
+ return ye(() => {
792
+ const p = n.value.triggerEl;
793
+ i.value = p.$el ?? p, F();
794
+ }), je(() => {
795
+ M(!1), r == null || r.removeEventListener("input", P), r == null || r.removeEventListener("keydown", v), document.removeEventListener("click", k), typeof window < "u" && window.removeEventListener("scroll", E, !0), V();
796
+ }), { popperTriggerEl: n, overlayEl: c, overlayStyle: o };
653
797
  }
654
- const Jt = /* @__PURE__ */ C({
798
+ const Hn = /* @__PURE__ */ T({
655
799
  __name: "Mention",
656
- props: Ft,
657
- emits: Ut,
800
+ props: rn,
801
+ emits: an,
658
802
  setup(e, { emit: t }) {
659
- const n = e, a = t, { popperTriggerEl: u, overlayEl: o, overlayStyle: s } = Xt(n, a);
660
- return (r, i) => (l(), c(V, null, [
661
- E(d(jt), {
803
+ const n = e, i = t, { popperTriggerEl: c, overlayEl: o, overlayStyle: r } = Vn(n, i);
804
+ return (a, s) => (l(), d(D, null, [
805
+ I(u(on), {
662
806
  ref_key: "popperTriggerEl",
663
- ref: u
807
+ ref: c
664
808
  }, {
665
- default: O(() => [
666
- v(r.$slots, "default", {}, void 0, !0)
809
+ default: x(() => [
810
+ y(a.$slots, "default", {}, void 0, !0)
667
811
  ]),
668
812
  _: 3
669
813
  }, 512),
670
- (l(), R(we, { to: "body" }, [
671
- E(Le, { name: "mc-mention-fade" }, {
672
- default: O(() => [
673
- r.modelValue ? (l(), c("div", {
814
+ (l(), B(Ve, { to: "body" }, [
815
+ I(He, { name: "mc-mention-fade" }, {
816
+ default: x(() => [
817
+ a.modelValue ? (l(), d("div", {
674
818
  key: 0,
675
819
  ref_key: "overlayEl",
676
820
  ref: o,
677
- class: b(["mc-mention", r.menuClass]),
678
- style: Te(d(s))
821
+ class: $(["mc-mention", a.menuClass]),
822
+ style: Ke(u(r))
679
823
  }, [
680
- v(r.$slots, "menu", {}, void 0, !0)
681
- ], 6)) : y("", !0)
824
+ y(a.$slots, "menu", {}, void 0, !0)
825
+ ], 6)) : h("", !0)
682
826
  ]),
683
827
  _: 3
684
828
  })
685
829
  ]))
686
830
  ], 64));
687
831
  }
688
- }), Qt = /* @__PURE__ */ $(Jt, [["__scopeId", "data-v-196371c8"]]), Yt = {}, Zt = { class: "mc-layout" };
689
- function xt(e, t) {
690
- return l(), c("div", Zt, [
691
- v(e.$slots, "default", {}, void 0, !0)
832
+ }), Kn = /* @__PURE__ */ L(Hn, [["__scopeId", "data-v-196371c8"]]), Nn = {}, Rn = { class: "mc-layout" };
833
+ function Zn(e, t) {
834
+ return l(), d("div", Rn, [
835
+ y(e.$slots, "default", {}, void 0, !0)
692
836
  ]);
693
837
  }
694
- const eo = /* @__PURE__ */ $(Yt, [["render", xt], ["__scopeId", "data-v-f08e803e"]]), to = {}, oo = { class: "mc-layout-content" };
695
- function no(e, t) {
696
- return l(), c("div", oo, [
697
- v(e.$slots, "default", {}, void 0, !0)
838
+ const zn = /* @__PURE__ */ L(Nn, [["render", Zn], ["__scopeId", "data-v-f08e803e"]]), Dn = {}, Wn = { class: "mc-layout-content" };
839
+ function Fn(e, t) {
840
+ return l(), d("div", Wn, [
841
+ y(e.$slots, "default", {}, void 0, !0)
698
842
  ]);
699
843
  }
700
- const so = /* @__PURE__ */ $(to, [["render", no], ["__scopeId", "data-v-74f98b9a"]]), ao = {}, ro = { class: "mc-layout-header" };
701
- function lo(e, t) {
702
- return l(), c("div", ro, [
703
- v(e.$slots, "default", {}, void 0, !0)
844
+ const Un = /* @__PURE__ */ L(Dn, [["render", Fn], ["__scopeId", "data-v-74f98b9a"]]), xn = {}, Gn = { class: "mc-layout-header" };
845
+ function qn(e, t) {
846
+ return l(), d("div", Gn, [
847
+ y(e.$slots, "default", {}, void 0, !0)
704
848
  ]);
705
849
  }
706
- const io = /* @__PURE__ */ $(ao, [["render", lo], ["__scopeId", "data-v-cfa1505b"]]), co = {}, uo = { class: "mc-layout-aside" };
707
- function mo(e, t) {
708
- return l(), c("div", uo, [
709
- v(e.$slots, "default")
850
+ const Xn = /* @__PURE__ */ L(xn, [["render", qn], ["__scopeId", "data-v-cfa1505b"]]), Jn = {}, Qn = { class: "mc-layout-aside" };
851
+ function Yn(e, t) {
852
+ return l(), d("div", Qn, [
853
+ y(e.$slots, "default")
710
854
  ]);
711
855
  }
712
- const po = /* @__PURE__ */ $(co, [["render", mo]]), fo = {}, vo = { class: "mc-layout-sender" };
713
- function go(e, t) {
714
- return l(), c("div", vo, [
715
- v(e.$slots, "default")
856
+ const eo = /* @__PURE__ */ L(Jn, [["render", Yn]]), to = {}, no = { class: "mc-layout-sender" };
857
+ function oo(e, t) {
858
+ return l(), d("div", no, [
859
+ y(e.$slots, "default")
716
860
  ]);
717
861
  }
718
- const yo = /* @__PURE__ */ $(fo, [["render", go]]), Ao = {
862
+ const ro = /* @__PURE__ */ L(to, [["render", oo]]), yo = {
719
863
  install(e) {
720
- e.component("McHeader", We), e.component("McBubble", st), e.component("McInput", pt), e.component("McIntroduction", $t), e.component("McPrompt", Dt), e.component("McList", le), e.component("McMention", Qt), e.component("McLayout", eo), e.component("McLayoutContent", so), e.component("McLayoutHeader", io), e.component("McLayoutAside", po), e.component("McLayoutSender", yo);
864
+ e.component("McHeader", Qe), e.component("McBubble", ut), e.component("McInput", Et), e.component("McIntroduction", Vt), e.component("McPrompt", nn), e.component("McList", he), e.component("McMention", Kn), e.component("McLayout", zn), e.component("McLayoutContent", Un), e.component("McLayoutHeader", Xn), e.component("McLayoutAside", eo), e.component("McLayoutSender", ro);
721
865
  }
722
866
  };
723
867
  export {
724
- Ao as default
868
+ yo as default
725
869
  };