tuikit-atomicx-vue3 3.4.1 → 3.4.2

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.
Files changed (84) hide show
  1. package/dist/components/BarrageInput/TextEditor/CharacterCountExtension.js +1 -1
  2. package/dist/components/BarrageInput/TextEditor/EditorCore.js +2 -2
  3. package/dist/components/CoHostPanel/BattlePanel.js +16 -16
  4. package/dist/components/CoHostPanel/CoHostPanel.js +60 -55
  5. package/dist/components/CoHostPanel/ConnectionPanel.js +42 -42
  6. package/dist/components/{LiveCoreView → LiveView}/CoreViewDecorate/BattleDecorate.js +1 -1
  7. package/dist/components/{LiveCoreView → LiveView}/CoreViewDecorate/BattleUserDecorate.js +56 -49
  8. package/dist/components/{LiveCoreView → LiveView}/CoreViewDecorate/CoHostDecorate.js +1 -1
  9. package/dist/components/{LiveCoreView → LiveView}/CoreViewDecorate/LiveCoreDecorate.js +1 -1
  10. package/dist/components/{LiveCoreView → LiveView}/DefaultStreamViewUI.js +7 -7
  11. package/dist/components/{LiveCoreView → LiveView}/PlayerControl/AudioControl.js +16 -16
  12. package/dist/components/{LiveCoreView → LiveView}/PlayerControl/MultiResolution.js +15 -15
  13. package/dist/components/{LiveCoreView → LiveView}/PlayerControl/PlayerControl.js +1 -1
  14. package/dist/components/{LiveCoreView/i18n/zh-CN → LiveView/i18n/en-US}/index.d.ts +1 -0
  15. package/dist/components/{LiveCoreView → LiveView}/i18n/en-US/index.js +2 -1
  16. package/dist/components/{LiveCoreView/i18n/en-US → LiveView/i18n/zh-CN}/index.d.ts +1 -0
  17. package/dist/components/{LiveCoreView → LiveView}/i18n/zh-CN/index.js +2 -1
  18. package/dist/components/LiveView/index.d.ts +79 -0
  19. package/dist/components/{LiveCoreView → LiveView}/index.js +44 -42
  20. package/dist/components/MessageInput/TextEditor/EditorCore.js +2 -2
  21. package/dist/components/StreamMixer/index.js +6 -6
  22. package/dist/{index-D-KJvDvy.js → index-Bm-QfV5o.js} +1 -1
  23. package/dist/{index-D88ja_7_.js → index-D2OVtqc8.js} +1705 -1705
  24. package/dist/index.js +140 -138
  25. package/dist/rtc/index.d.ts +2 -39
  26. package/dist/rtc/index.js +49 -48
  27. package/dist/states/BattleState.js +48 -48
  28. package/dist/styles/index.css +1 -1
  29. package/package.json +2 -2
  30. package/src/components/CoHostPanel/BattlePanel.vue +3 -3
  31. package/src/components/CoHostPanel/CoHostPanel.vue +11 -3
  32. package/src/components/CoHostPanel/ConnectionPanel.vue +4 -4
  33. package/src/components/{LiveCoreView → LiveView}/CoreViewDecorate/BattleUserDecorate.vue +28 -29
  34. package/src/components/{LiveCoreView → LiveView}/i18n/en-US/index.ts +1 -0
  35. package/src/components/{LiveCoreView → LiveView}/i18n/zh-CN/index.ts +1 -0
  36. package/src/components/{LiveCoreView → LiveView}/index.ts +5 -2
  37. package/src/components/{LiveCoreView → LiveView}/index.vue +1 -1
  38. package/src/components/StreamMixer/index.vue +1 -1
  39. package/src/rtc/index.ts +2 -2
  40. package/dist/components/LiveCoreView/index.d.ts +0 -4
  41. /package/dist/components/{LiveCoreView → LiveView}/CoreViewDecorate/BattleDecorate.vue.d.ts +0 -0
  42. /package/dist/components/{LiveCoreView → LiveView}/CoreViewDecorate/BattleUserDecorate.vue.d.ts +0 -0
  43. /package/dist/components/{LiveCoreView → LiveView}/CoreViewDecorate/CoHostDecorate.vue.d.ts +0 -0
  44. /package/dist/components/{LiveCoreView → LiveView}/CoreViewDecorate/LiveCoreDecorate.vue.d.ts +0 -0
  45. /package/dist/components/{LiveCoreView → LiveView}/DefaultStreamViewUI.vue.d.ts +0 -0
  46. /package/dist/components/{LiveCoreView → LiveView}/PlayerControl/AudioControl.vue.d.ts +0 -0
  47. /package/dist/components/{LiveCoreView → LiveView}/PlayerControl/MultiResolution.vue.d.ts +0 -0
  48. /package/dist/components/{LiveCoreView → LiveView}/PlayerControl/PlayerControl.vue.d.ts +0 -0
  49. /package/dist/components/{LiveCoreView → LiveView}/PlayerControl/PlayerControlState.d.ts +0 -0
  50. /package/dist/components/{LiveCoreView → LiveView}/PlayerControl/PlayerControlState.js +0 -0
  51. /package/dist/components/{LiveCoreView → LiveView}/PlayerControl/index.d.ts +0 -0
  52. /package/dist/components/{LiveCoreView → LiveView}/PlayerControl/index.js +0 -0
  53. /package/dist/components/{LiveCoreView → LiveView}/PlayerControl/utils/deviceDetection.d.ts +0 -0
  54. /package/dist/components/{LiveCoreView → LiveView}/PlayerControl/utils/deviceDetection.js +0 -0
  55. /package/dist/components/{LiveCoreView → LiveView}/PlayerControl/utils/domHelpers.d.ts +0 -0
  56. /package/dist/components/{LiveCoreView → LiveView}/PlayerControl/utils/domHelpers.js +0 -0
  57. /package/dist/components/{LiveCoreView → LiveView}/PlayerControl/utils/fullscreenManager.d.ts +0 -0
  58. /package/dist/components/{LiveCoreView → LiveView}/PlayerControl/utils/fullscreenManager.js +0 -0
  59. /package/dist/components/{LiveCoreView → LiveView}/i18n/index.d.ts +0 -0
  60. /package/dist/components/{LiveCoreView → LiveView}/i18n/index.js +0 -0
  61. /package/dist/components/{LiveCoreView → LiveView}/index.vue.d.ts +0 -0
  62. /package/src/components/{LiveCoreView → LiveView}/CoreViewDecorate/BattleDecorate.vue +0 -0
  63. /package/src/components/{LiveCoreView → LiveView}/CoreViewDecorate/CoHostDecorate.vue +0 -0
  64. /package/src/components/{LiveCoreView → LiveView}/CoreViewDecorate/LiveCoreDecorate.vue +0 -0
  65. /package/src/components/{LiveCoreView → LiveView}/DefaultStreamViewUI.vue +0 -0
  66. /package/src/components/{LiveCoreView → LiveView}/PlayerControl/AudioControl.vue +0 -0
  67. /package/src/components/{LiveCoreView → LiveView}/PlayerControl/MultiResolution.vue +0 -0
  68. /package/src/components/{LiveCoreView → LiveView}/PlayerControl/PlayerControl.module.scss +0 -0
  69. /package/src/components/{LiveCoreView → LiveView}/PlayerControl/PlayerControl.vue +0 -0
  70. /package/src/components/{LiveCoreView → LiveView}/PlayerControl/PlayerControlState.ts +0 -0
  71. /package/src/components/{LiveCoreView → LiveView}/PlayerControl/index.ts +0 -0
  72. /package/src/components/{LiveCoreView → LiveView}/PlayerControl/utils/deviceDetection.ts +0 -0
  73. /package/src/components/{LiveCoreView → LiveView}/PlayerControl/utils/domHelpers.ts +0 -0
  74. /package/src/components/{LiveCoreView → LiveView}/PlayerControl/utils/fullscreenManager.ts +0 -0
  75. /package/src/components/{LiveCoreView → LiveView}/assets/img/defeat.png +0 -0
  76. /package/src/components/{LiveCoreView → LiveView}/assets/img/draw.png +0 -0
  77. /package/src/components/{LiveCoreView → LiveView}/assets/img/victory.png +0 -0
  78. /package/src/components/{LiveCoreView → LiveView}/assets/svg/BattleOrdinaryBadge.svg +0 -0
  79. /package/src/components/{LiveCoreView → LiveView}/assets/svg/BattleTopBadge.svg +0 -0
  80. /package/src/components/{LiveCoreView → LiveView}/assets/svg/blueBkg.svg +0 -0
  81. /package/src/components/{LiveCoreView → LiveView}/assets/svg/redBkg.svg +0 -0
  82. /package/src/components/{LiveCoreView → LiveView}/assets/svg/s.svg +0 -0
  83. /package/src/components/{LiveCoreView → LiveView}/assets/svg/v.svg +0 -0
  84. /package/src/components/{LiveCoreView → LiveView}/i18n/index.ts +0 -0
@@ -1,4 +1,4 @@
1
- import { E as l, P as h, a as f } from "../../../index-D88ja_7_.js";
1
+ import { E as l, P as h, a as f } from "../../../index-D2OVtqc8.js";
2
2
  const m = l.create({
3
3
  name: "characterCount",
4
4
  addOptions() {
@@ -1,7 +1,7 @@
1
- import { S as g, P as x, E as p, I as o } from "../../../index-D-KJvDvy.js";
1
+ import { S as g, P as x, E as p, I as o } from "../../../index-Bm-QfV5o.js";
2
2
  import { isMobile as y } from "../../../utils/environment.js";
3
3
  import { CharacterCount as M } from "./CharacterCountExtension.js";
4
- import { E as T } from "../../../index-D88ja_7_.js";
4
+ import { E as T } from "../../../index-D2OVtqc8.js";
5
5
  import { MessageContentType as a } from "../../../states/MessageInputState/type.js";
6
6
  function b() {
7
7
  return o.extend({
@@ -35,7 +35,7 @@ const se = {
35
35
  battleUsers: L,
36
36
  requestBattle: A,
37
37
  exitBattle: D
38
- } = W(), I = z(!1), $ = (e, t) => N.value.some((i) => i.userId === e && i.liveId === t), a = /* @__PURE__ */ new Set(), j = async (e) => {
38
+ } = W(), I = z(!1), $ = (e, t) => N.value.some((d) => d.userId === e && d.liveId === t), a = /* @__PURE__ */ new Set(), j = async (e) => {
39
39
  try {
40
40
  switch ((await w({
41
41
  liveId: e.liveId,
@@ -47,7 +47,7 @@ const se = {
47
47
  })
48
48
  })).get(e.liveId)) {
49
49
  case f.TUIConnectionCodeSuccess:
50
- a.add(e.userId), n({ type: l.SUCCESS, message: o("Battle invitation sent to user", { userName: e.userName }) });
50
+ a.add(e.userId), n({ type: l.SUCCESS, message: o("Battle invitation sent to user", { userName: e.userName || e.userId }) });
51
51
  break;
52
52
  case f.TUIConnectionCodeRoomNotExist:
53
53
  n({ type: l.ERROR, message: o("Send battle request failed, Room not exist") });
@@ -90,22 +90,22 @@ const se = {
90
90
  }, _ = ({ inviter: e }) => {
91
91
  a.has(e.userId) && a.delete(e.userId);
92
92
  }, E = ({ invitee: e }) => {
93
- a.has(e.userId) && (a.delete(e.userId), n({ type: l.INFO, message: o("Battle request rejected by user", { userName: e.userName }) }));
93
+ a.has(e.userId) && (a.delete(e.userId), n({ type: l.INFO, message: o("Battle request rejected by user", { userName: e.userName || e.userId }) }));
94
94
  }, T = ({ inviter: e, invitee: t }) => {
95
- var i;
96
- e.userId === ((i = x.value) == null ? void 0 : i.userId) && a.has(t.userId) && (a.delete(t.userId), n({ type: l.INFO, message: o("Battle request timeout for user", { userName: t.userName }) }));
95
+ var d;
96
+ e.userId === ((d = x.value) == null ? void 0 : d.userId) && a.has(t.userId) && (a.delete(t.userId), n({ type: l.INFO, message: o("Battle request timeout for user", { userName: t.userName || t.userId }) }));
97
97
  };
98
98
  return J(() => {
99
99
  b(u.onCoHostRequestAccepted, k), b(u.onCoHostRequestCancelled, _), b(u.onCoHostRequestRejected, E), b(u.onCoHostRequestTimeout, T);
100
100
  }), K(() => {
101
101
  y(u.onCoHostRequestAccepted, k), y(u.onCoHostRequestCancelled, _), y(u.onCoHostRequestRejected, E), y(u.onCoHostRequestTimeout, T);
102
102
  }), (e, t) => {
103
- var i, S;
103
+ var d, S;
104
104
  return m(), g(M, null, [
105
105
  U("div", se, [
106
- (i = s(v)) != null && i.battleId ? (m(), g("div", ae, [
106
+ (d = s(v)) != null && d.battleId ? (m(), g("div", ae, [
107
107
  p(Z, { userList: s(L) }, {
108
- "user-actions": r(({ user: d }) => [
108
+ "user-actions": r(({ user: i }) => [
109
109
  U("div", ne, c(s(o)("In battle")) + "... ", 1)
110
110
  ]),
111
111
  _: 1
@@ -114,12 +114,12 @@ const se = {
114
114
  key: 1,
115
115
  class: "recommend-host-list"
116
116
  }, {
117
- "host-item-actions": r(({ user: d }) => [
118
- $(d.userId, d.liveId) ? (m(), h(s(R), {
117
+ "host-item-actions": r(({ user: i }) => [
118
+ $(i.userId, i.liveId) ? (m(), h(s(R), {
119
119
  key: 1,
120
120
  size: "small",
121
121
  color: "gray",
122
- onClick: (P) => F(d)
122
+ onClick: (P) => F(i)
123
123
  }, {
124
124
  default: r(() => [
125
125
  C(c(s(o)("Cancel invitation")), 1)
@@ -129,7 +129,7 @@ const se = {
129
129
  key: 0,
130
130
  size: "small",
131
131
  type: "primary",
132
- onClick: (P) => j(d)
132
+ onClick: (P) => j(i)
133
133
  }, {
134
134
  default: r(() => [
135
135
  C(c(s(o)("Invite battle")), 1)
@@ -144,7 +144,7 @@ const se = {
144
144
  p(s(R), {
145
145
  type: "primary",
146
146
  color: "red",
147
- onClick: t[0] || (t[0] = (d) => I.value = !0)
147
+ onClick: t[0] || (t[0] = (i) => I.value = !0)
148
148
  }, {
149
149
  default: r(() => [
150
150
  C(c(s(o)("End battle")), 1)
@@ -158,13 +158,13 @@ const se = {
158
158
  modal: !1,
159
159
  customClasses: ["exit-co-host-dialog"],
160
160
  onConfirm: H,
161
- onCancel: t[2] || (t[2] = (d) => I.value = !1)
161
+ onCancel: t[2] || (t[2] = (i) => I.value = !1)
162
162
  }, {
163
163
  footer: r(() => [
164
164
  p(s(R), {
165
165
  type: "default",
166
166
  color: "gray",
167
- onClick: t[1] || (t[1] = (d) => I.value = !1)
167
+ onClick: t[1] || (t[1] = (i) => I.value = !1)
168
168
  }, {
169
169
  default: r(() => [
170
170
  C(c(s(o)("Cancel")), 1)
@@ -190,7 +190,7 @@ const se = {
190
190
  ], 64);
191
191
  };
192
192
  }
193
- }), be = /* @__PURE__ */ oe(re, [["__scopeId", "data-v-f84283ae"]]);
193
+ }), be = /* @__PURE__ */ oe(re, [["__scopeId", "data-v-460969fc"]]);
194
194
  export {
195
195
  be as default
196
196
  };
@@ -1,58 +1,63 @@
1
- import { defineComponent as x, ref as d, computed as b, watch as N, createBlock as T, openBlock as p, unref as n, withCtx as f, createElementVNode as e, createVNode as r, createElementBlock as U, createCommentVNode as y, normalizeClass as g, toDisplayString as C, withDirectives as h, vShow as k } from "vue";
2
- import { useUIKit as $, TUIDialog as w, IconLiveSetting as z, IconClose as A } from "@tencentcloud/uikit-base-component-vue3";
3
- import { useBattleState as E } from "../../states/BattleState.js";
4
- import V from "./BattlePanel.js";
5
- import F from "./ConfigSettingPanel.js";
6
- import G from "./ConnectionPanel.js";
7
- import { useCoHostState as K } from "../../states/CoHostState/CoHostState.js";
8
- import { CoHostStatus as j, CoHostLayoutTemplate as q } from "../../types/coHost.js";
9
- import { _ as J } from "../../_plugin-vue_export-helper-CHgC5LLL.js";
10
- const M = { class: "dialog-header" }, O = { class: "dialog-title" }, Q = { class: "icon-buttons" }, R = { class: "panel-content" }, W = {
1
+ import { defineComponent as N, ref as d, computed as b, watch as _, createBlock as g, openBlock as p, unref as i, withCtx as f, createElementVNode as e, createVNode as v, createElementBlock as $, createCommentVNode as y, normalizeClass as h, toDisplayString as C, withDirectives as k, vShow as L } from "vue";
2
+ import { useUIKit as w, TUIDialog as z, IconLiveSetting as A, IconClose as E } from "@tencentcloud/uikit-base-component-vue3";
3
+ import { useBattleState as V } from "../../states/BattleState.js";
4
+ import { useLoginState as F } from "../../states/LoginState.js";
5
+ import G from "./BattlePanel.js";
6
+ import K from "./ConfigSettingPanel.js";
7
+ import j from "./ConnectionPanel.js";
8
+ import { useCoHostState as q } from "../../states/CoHostState/CoHostState.js";
9
+ import { CoHostStatus as J, CoHostLayoutTemplate as M } from "../../types/coHost.js";
10
+ import { _ as O } from "../../_plugin-vue_export-helper-CHgC5LLL.js";
11
+ const Q = { class: "dialog-header" }, R = { class: "dialog-title" }, W = { class: "icon-buttons" }, X = { class: "panel-content" }, Y = {
11
12
  key: 0,
12
13
  class: "panel-header"
13
- }, X = { class: "tabs" }, Y = { class: "panel-body" }, Z = { class: "battle-content" }, tt = { class: "coHost-content" }, et = /* @__PURE__ */ x({
14
+ }, Z = { class: "tabs" }, tt = { class: "panel-body" }, et = { class: "battle-content" }, ot = { class: "coHost-content" }, at = /* @__PURE__ */ N({
14
15
  __name: "CoHostPanel",
15
16
  props: {
16
17
  visible: { type: Boolean }
17
18
  },
18
19
  emits: ["update:visible"],
19
- setup(D, { emit: L }) {
20
- const { t: l } = $(), S = D, { coHostStatus: B } = K(), { currentBattleInfo: I } = E(), H = L, i = () => {
20
+ setup(S, { emit: D }) {
21
+ const { t: l } = w(), I = S, { loginUserInfo: B } = F(), { coHostStatus: P } = q(), { battleUsers: U } = V(), H = D, u = () => {
21
22
  H("update:visible", !1);
22
- }, a = d("battleTab"), v = d(!1), m = b(() => B.value === j.Connected), c = b(() => {
23
- var o;
24
- return ((o = I.value) == null ? void 0 : o.battleId) !== void 0;
25
- }), _ = b(() => c.value ? l("Anchor battling...") : m.value ? l("Anchor connecting...") : l("CoHost")), s = d({
23
+ }, a = d("battleTab"), m = d(!1), c = b(() => P.value === J.Connected), n = b(() => U.value.some((o) => {
24
+ var t;
25
+ return o.userId === ((t = B.value) == null ? void 0 : t.userId);
26
+ })), T = b(() => n.value ? l("Anchor battling...") : c.value ? l("Anchor connecting...") : l("CoHost")), s = d({
26
27
  battleDuration: 5 * 60,
27
- coHostLayoutTemplate: q.HostDynamicGrid
28
- }), P = (o) => {
28
+ coHostLayoutTemplate: M.HostDynamicGrid
29
+ }), x = (o) => {
29
30
  s.value = o;
30
31
  };
31
- return N(c, (o, t) => {
32
+ return _(c, (o) => {
33
+ o && !n.value && (a.value = "coHostTab");
34
+ }, {
35
+ immediate: !0
36
+ }), _(n, (o, t) => {
32
37
  o && (H("update:visible", !1), a.value = "battleTab"), o !== t && !o && (a.value = "coHostTab");
33
38
  }, {
34
39
  immediate: !0
35
- }), (o, t) => (p(), T(n(w), {
36
- title: _.value,
37
- visible: S.visible,
40
+ }), (o, t) => (p(), g(i(z), {
41
+ title: T.value,
42
+ visible: I.visible,
38
43
  "custom-classes": ["co-host-dialog"],
39
- onClose: i,
40
- onConfirm: i,
41
- onCancel: i
44
+ onClose: u,
45
+ onConfirm: u,
46
+ onCancel: u
42
47
  }, {
43
48
  header: f(() => [
44
- e("div", M, [
45
- e("span", O, C(_.value), 1),
46
- e("div", Q, [
47
- !c.value && !m.value ? (p(), T(n(z), {
49
+ e("div", Q, [
50
+ e("span", R, C(T.value), 1),
51
+ e("div", W, [
52
+ !n.value && !c.value ? (p(), g(i(A), {
48
53
  key: 0,
49
54
  class: "icon-button",
50
55
  size: "20",
51
- onClick: t[0] || (t[0] = (u) => v.value = !0)
56
+ onClick: t[0] || (t[0] = (r) => m.value = !0)
52
57
  })) : y("", !0),
53
- r(n(A), {
58
+ v(i(E), {
54
59
  class: "icon-button",
55
- onClick: i
60
+ onClick: u
56
61
  })
57
62
  ])
58
63
  ])
@@ -61,49 +66,49 @@ const M = { class: "dialog-header" }, O = { class: "dialog-title" }, Q = { class
61
66
  e("div", null, null, -1)
62
67
  ])]),
63
68
  default: f(() => [
64
- e("div", R, [
65
- !m.value && !c.value ? (p(), U("div", W, [
66
- e("div", X, [
69
+ e("div", X, [
70
+ !c.value && !n.value ? (p(), $("div", Y, [
71
+ e("div", Z, [
67
72
  e("span", {
68
- class: g(["tab-item", { active: a.value === "battleTab" }]),
69
- onClick: t[1] || (t[1] = (u) => a.value = "battleTab")
70
- }, C(n(l)("Host Battle")), 3),
73
+ class: h(["tab-item", { active: a.value === "battleTab" }]),
74
+ onClick: t[1] || (t[1] = (r) => a.value = "battleTab")
75
+ }, C(i(l)("Host Battle")), 3),
71
76
  e("span", {
72
- class: g(["tab-item", { active: a.value === "coHostTab" }]),
73
- onClick: t[2] || (t[2] = (u) => a.value = "coHostTab")
74
- }, C(n(l)("Host Connection")), 3)
77
+ class: h(["tab-item", { active: a.value === "coHostTab" }]),
78
+ onClick: t[2] || (t[2] = (r) => a.value = "coHostTab")
79
+ }, C(i(l)("Host Connection")), 3)
75
80
  ])
76
81
  ])) : y("", !0),
77
- e("div", Y, [
78
- h(e("div", Z, [
79
- r(V, {
82
+ e("div", tt, [
83
+ k(e("div", et, [
84
+ v(G, {
80
85
  "battle-duration": s.value.battleDuration,
81
86
  coHostLayoutTemplate: s.value.coHostLayoutTemplate
82
87
  }, null, 8, ["battle-duration", "coHostLayoutTemplate"])
83
88
  ], 512), [
84
- [k, a.value === "battleTab"]
89
+ [L, a.value === "battleTab"]
85
90
  ]),
86
- h(e("div", tt, [
87
- r(G, {
91
+ k(e("div", ot, [
92
+ v(j, {
88
93
  battleDuration: s.value.battleDuration,
89
94
  coHostLayoutTemplate: s.value.coHostLayoutTemplate
90
95
  }, null, 8, ["battleDuration", "coHostLayoutTemplate"])
91
96
  ], 512), [
92
- [k, a.value === "coHostTab"]
97
+ [L, a.value === "coHostTab"]
93
98
  ])
94
99
  ])
95
100
  ]),
96
- r(F, {
97
- visible: v.value,
98
- "onUpdate:visible": t[3] || (t[3] = (u) => v.value = u),
101
+ v(K, {
102
+ visible: m.value,
103
+ "onUpdate:visible": t[3] || (t[3] = (r) => m.value = r),
99
104
  form: s.value,
100
- onConfirm: P
105
+ onConfirm: x
101
106
  }, null, 8, ["visible", "form"])
102
107
  ]),
103
108
  _: 1
104
109
  }, 8, ["title", "visible"]));
105
110
  }
106
- }), vt = /* @__PURE__ */ J(et, [["__scopeId", "data-v-4f709c76"]]);
111
+ }), bt = /* @__PURE__ */ O(at, [["__scopeId", "data-v-93d0efba"]]);
107
112
  export {
108
- vt as default
113
+ bt as default
109
114
  };
@@ -1,9 +1,9 @@
1
- import { defineComponent as ce, computed as G, ref as S, onMounted as de, onUnmounted as me, createElementBlock as R, openBlock as r, Fragment as O, createElementVNode as c, createCommentVNode as y, createVNode as h, unref as s, toDisplayString as l, renderList as ve, withCtx as m, createBlock as T, createTextVNode as p } from "vue";
1
+ import { defineComponent as ce, computed as G, ref as S, onMounted as de, onUnmounted as me, createElementBlock as I, openBlock as r, Fragment as O, createElementVNode as c, createCommentVNode as y, createVNode as h, unref as s, toDisplayString as l, renderList as ve, withCtx as m, createBlock as T, createTextVNode as p } from "vue";
2
2
  import { TUILiveBattleManagerEvents as v, TUIConnectionCode as _ } from "@tencentcloud/tuiroom-engine-js";
3
- import { useUIKit as Ce, TUIButton as f, TUIDialog as pe, TUIToast as i, TOAST_TYPE as u } from "@tencentcloud/uikit-base-component-vue3";
4
- import { useBattleState as Re } from "../../states/BattleState.js";
5
- import { useLoginState as fe } from "../../states/LoginState.js";
6
- import Ie from "../Avatar/Avatar.js";
3
+ import { useUIKit as Ce, TUIButton as R, TUIDialog as pe, TUIToast as u, TOAST_TYPE as i } from "@tencentcloud/uikit-base-component-vue3";
4
+ import { useBattleState as Ie } from "../../states/BattleState.js";
5
+ import { useLoginState as Re } from "../../states/LoginState.js";
6
+ import fe from "../Avatar/Avatar.js";
7
7
  import ye from "./RecommendHostList.js";
8
8
  import { useCoHostState as he } from "../../states/CoHostState/CoHostState.js";
9
9
  import { CoHostEvent as q, CoHostStatus as N, CoHostLayoutTemplate as J } from "../../types/coHost.js";
@@ -28,7 +28,7 @@ const qe = {
28
28
  coHostLayoutTemplate: {}
29
29
  },
30
30
  setup(K) {
31
- const U = K, { t: o } = Ce(), { loginUserInfo: I } = fe(), {
31
+ const U = K, { t: o } = Ce(), { loginUserInfo: f } = Re(), {
32
32
  coHostStatus: H,
33
33
  connected: k,
34
34
  invitees: Y,
@@ -44,12 +44,12 @@ const qe = {
44
44
  cancelBattleRequest: te,
45
45
  subscribeEvent: b,
46
46
  unsubscribeEvent: g
47
- } = Re(), se = G(() => ({
47
+ } = Ie(), se = G(() => ({
48
48
  [J.HostDynamicGrid]: 9,
49
49
  [J.HostDynamic1v6]: 7
50
50
  })[U.coHostLayoutTemplate]), B = S(!1), d = S(/* @__PURE__ */ new Set()), E = S(""), oe = (e, t) => Y.value.some((a) => a.userId === e && a.liveId === t), A = G(() => Z.value.some((e) => {
51
51
  var t;
52
- return e.userId === ((t = I.value) == null ? void 0 : t.userId);
52
+ return e.userId === ((t = f.value) == null ? void 0 : t.userId);
53
53
  })), C = S(/* @__PURE__ */ new Set()), ne = async (e) => {
54
54
  try {
55
55
  const t = await Q({
@@ -62,43 +62,43 @@ const qe = {
62
62
  })
63
63
  });
64
64
  if (t.get(e.liveId) === _.TUIConnectionCodeSuccess)
65
- C.value.add(e.userId), i({ type: u.SUCCESS, message: o("Co-host invitation sent to user", { userName: e.userName }) });
65
+ C.value.add(e.userId), u({ type: i.SUCCESS, message: o("Co-host invitation sent to user", { userName: e.userName || e.userId }) });
66
66
  else
67
67
  switch (t.get(e.liveId)) {
68
68
  case _.TUIConnectionCodeRoomNotExist:
69
- i({ type: u.ERROR, message: o("Send co-host request failed, Room not exist") });
69
+ u({ type: i.ERROR, message: o("Send co-host request failed, Room not exist") });
70
70
  break;
71
71
  case _.TUIConnectionCodeConnecting:
72
- i({ type: u.ERROR, message: o("Send co-host request failed, Room is connecting") });
72
+ u({ type: i.ERROR, message: o("Send co-host request failed, Room is connecting") });
73
73
  break;
74
74
  case _.TUIConnectionCodeConnectingOtherRoom:
75
- i({ type: u.ERROR, message: o("Send co-host request failed, Room is connecting other room") });
75
+ u({ type: i.ERROR, message: o("Send co-host request failed, Room is connecting other room") });
76
76
  break;
77
77
  case _.TUIConnectionCodeFull:
78
- i({ type: u.ERROR, message: o("Send co-host request failed, Connected count is full") });
78
+ u({ type: i.ERROR, message: o("Send co-host request failed, Connected count is full") });
79
79
  break;
80
80
  case _.TUIConnectionCodeRetry:
81
- i({ type: u.ERROR, message: o("Send co-host request failed") });
81
+ u({ type: i.ERROR, message: o("Send co-host request failed") });
82
82
  break;
83
83
  default:
84
- i({ type: u.ERROR, message: o("Send co-host request failed") });
84
+ u({ type: i.ERROR, message: o("Send co-host request failed") });
85
85
  break;
86
86
  }
87
87
  } catch (t) {
88
- throw i({ type: u.ERROR, message: o("Send co-host request failed") }), t;
88
+ throw u({ type: i.ERROR, message: o("Send co-host request failed") }), t;
89
89
  }
90
90
  }, ae = async (e) => {
91
91
  try {
92
92
  await W({ liveId: e.liveId }), C.value.delete(e.userId);
93
93
  } catch (t) {
94
- throw i({ type: u.ERROR, message: o("Cancel co-host request failed") }), t;
94
+ throw u({ type: i.ERROR, message: o("Cancel co-host request failed") }), t;
95
95
  }
96
96
  }, le = () => {
97
97
  L(), B.value = !1;
98
- }, ie = async () => {
98
+ }, ue = async () => {
99
99
  const e = k.value.filter((a) => {
100
100
  var n;
101
- return a.userId !== ((n = I.value) == null ? void 0 : n.userId);
101
+ return a.userId !== ((n = f.value) == null ? void 0 : n.userId);
102
102
  }).map((a) => a.userId), t = await ee({
103
103
  config: {
104
104
  duration: U.battleDuration,
@@ -108,7 +108,7 @@ const qe = {
108
108
  timeout: 10
109
109
  });
110
110
  E.value = t.battleId, e.forEach((a) => d.value.add(a));
111
- }, ue = async () => {
111
+ }, ie = async () => {
112
112
  await te({
113
113
  battleId: E.value,
114
114
  userIdList: Array.from(d.value)
@@ -116,19 +116,19 @@ const qe = {
116
116
  }, $ = ({ invitee: e }) => {
117
117
  C.value.has(e.userId) && C.value.delete(e.userId);
118
118
  }, j = ({ invitee: e }) => {
119
- C.value.has(e.userId) && (i({ type: u.INFO, message: o("Co-host request rejected by user", { userName: e.userName }) }), C.value.delete(e.userId));
119
+ C.value.has(e.userId) && (u({ type: i.INFO, message: o("Co-host request rejected by user", { userName: e.userName || e.userId }) }), C.value.delete(e.userId));
120
120
  }, D = ({ inviter: e, invitee: t }) => {
121
121
  var a;
122
- e.userId === ((a = I.value) == null ? void 0 : a.userId) && C.value.has(t.userId) && (i({ type: u.INFO, message: o("Co-host request timeout for user", { userName: t.userName }) }), C.value.delete(t.userId));
122
+ e.userId === ((a = f.value) == null ? void 0 : a.userId) && C.value.has(t.userId) && (u({ type: i.INFO, message: o("Co-host request timeout for user", { userName: t.userName || t.userId }) }), C.value.delete(t.userId));
123
123
  }, z = (e) => {
124
124
  var t;
125
- e.inviter.userId === ((t = I.value) == null ? void 0 : t.userId) && d.value.delete(e.invitee.userId);
125
+ e.inviter.userId === ((t = f.value) == null ? void 0 : t.userId) && d.value.delete(e.invitee.userId);
126
126
  }, F = (e) => {
127
127
  var t;
128
- e.inviter.userId === ((t = I.value) == null ? void 0 : t.userId) && (i({ type: u.INFO, message: o("Battle request rejected by user", { userName: e.invitee.userName }) }), d.value.delete(e.invitee.userId));
128
+ e.inviter.userId === ((t = f.value) == null ? void 0 : t.userId) && (u({ type: i.INFO, message: o("Battle request rejected by user", { userName: e.invitee.userName || e.invitee.userId }) }), d.value.delete(e.invitee.userId));
129
129
  }, P = (e) => {
130
130
  var t;
131
- e.inviter.userId === ((t = I.value) == null ? void 0 : t.userId) && d.value.delete(e.invitee.userId);
131
+ e.inviter.userId === ((t = f.value) == null ? void 0 : t.userId) && d.value.delete(e.invitee.userId);
132
132
  }, M = (e) => {
133
133
  E.value = "", d.value.clear();
134
134
  }, V = (e) => {
@@ -140,20 +140,20 @@ const qe = {
140
140
  w(q.onCoHostRequestAccepted, $), w(q.onCoHostRequestRejected, j), w(q.onCoHostRequestTimeout, D), g(v.onBattleRequestAccept, z), g(v.onBattleRequestReject, F), g(v.onBattleRequestTimeout, P), g(v.onBattleStarted, M), g(v.onBattleEnded, V);
141
141
  }), (e, t) => {
142
142
  var a;
143
- return r(), R(O, null, [
143
+ return r(), I(O, null, [
144
144
  c("div", qe, [
145
- s(H) === s(N).Connected ? (r(), R("div", be, [
145
+ s(H) === s(N).Connected ? (r(), I("div", be, [
146
146
  c("div", ge, [
147
147
  c("span", Be, l(s(o)("Current seat")), 1),
148
148
  c("span", Ee, l(`(${s(k).length}/${se.value})`), 1)
149
149
  ]),
150
150
  c("div", He, [
151
- (r(!0), R(O, null, ve(s(k), (n) => (r(), R("div", {
151
+ (r(!0), I(O, null, ve(s(k), (n) => (r(), I("div", {
152
152
  key: `${n.userId}-${n.liveId}`,
153
153
  class: "user-item"
154
154
  }, [
155
155
  c("div", ke, [
156
- h(s(Ie), {
156
+ h(s(fe), {
157
157
  src: n.avatarUrl,
158
158
  size: 40
159
159
  }, null, 8, ["src"])
@@ -166,13 +166,13 @@ const qe = {
166
166
  ])
167
167
  ]))), 128))
168
168
  ]),
169
- s(k).length === 0 ? (r(), R("div", xe, [
169
+ s(k).length === 0 ? (r(), I("div", xe, [
170
170
  c("span", null, l(s(o)("Seat is empty")), 1)
171
171
  ])) : y("", !0)
172
172
  ])) : y("", !0),
173
173
  h(ye, { class: "recommend-host-list" }, {
174
174
  "host-item-actions": m(({ user: n }) => [
175
- oe(n.userId, n.liveId) ? (r(), T(s(f), {
175
+ oe(n.userId, n.liveId) ? (r(), T(s(R), {
176
176
  key: 1,
177
177
  size: "small",
178
178
  color: "gray",
@@ -182,7 +182,7 @@ const qe = {
182
182
  p(l(s(o)("Cancel invitation")), 1)
183
183
  ]),
184
184
  _: 1
185
- }, 8, ["onClick"])) : (r(), T(s(f), {
185
+ }, 8, ["onClick"])) : (r(), T(s(R), {
186
186
  key: 0,
187
187
  size: "small",
188
188
  type: s(H) === s(N).Connected ? "default" : "primary",
@@ -197,8 +197,8 @@ const qe = {
197
197
  _: 1
198
198
  })
199
199
  ]),
200
- s(H) === s(N).Connected ? (r(), R("div", we, [
201
- h(s(f), {
200
+ s(H) === s(N).Connected ? (r(), I("div", we, [
201
+ h(s(R), {
202
202
  color: "red",
203
203
  onClick: t[0] || (t[0] = (n) => B.value = !0)
204
204
  }, {
@@ -207,20 +207,20 @@ const qe = {
207
207
  ]),
208
208
  _: 1
209
209
  }),
210
- (a = s(X)) != null && a.battleId ? y("", !0) : (r(), R(O, { key: 0 }, [
211
- !A.value && d.value.size === 0 ? (r(), T(s(f), {
210
+ (a = s(X)) != null && a.battleId ? y("", !0) : (r(), I(O, { key: 0 }, [
211
+ !A.value && d.value.size === 0 ? (r(), T(s(R), {
212
212
  key: 0,
213
213
  type: "primary",
214
- onClick: ie
214
+ onClick: ue
215
215
  }, {
216
216
  default: m(() => [
217
217
  p(l(s(o)("Start battle")), 1)
218
218
  ]),
219
219
  _: 1
220
220
  })) : y("", !0),
221
- !A.value && d.value.size > 0 ? (r(), T(s(f), {
221
+ !A.value && d.value.size > 0 ? (r(), T(s(R), {
222
222
  key: 1,
223
- onClick: ue
223
+ onClick: ie
224
224
  }, {
225
225
  default: m(() => [
226
226
  p(l(s(o)("Cancel battle")), 1)
@@ -238,7 +238,7 @@ const qe = {
238
238
  onCancel: t[2] || (t[2] = (n) => B.value = !1)
239
239
  }, {
240
240
  footer: m(() => [
241
- h(s(f), {
241
+ h(s(R), {
242
242
  type: "default",
243
243
  color: "gray",
244
244
  onClick: t[1] || (t[1] = (n) => B.value = !1)
@@ -248,7 +248,7 @@ const qe = {
248
248
  ]),
249
249
  _: 1
250
250
  }),
251
- h(s(f), {
251
+ h(s(R), {
252
252
  type: "primary",
253
253
  color: "red",
254
254
  onClick: le
@@ -267,7 +267,7 @@ const qe = {
267
267
  ], 64);
268
268
  };
269
269
  }
270
- }), Ge = /* @__PURE__ */ _e(Oe, [["__scopeId", "data-v-9b2e40cd"]]);
270
+ }), Ge = /* @__PURE__ */ _e(Oe, [["__scopeId", "data-v-fdce3ba7"]]);
271
271
  export {
272
272
  Ge as default
273
273
  };
@@ -146,7 +146,7 @@ const te = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAARwAAAD2CAYAAAAEXDiwAA
146
146
  ], 2)
147
147
  ])) : G("", !0);
148
148
  }
149
- }), we = /* @__PURE__ */ ee(ke, [["__scopeId", "data-v-33d3814f"]]);
149
+ }), we = /* @__PURE__ */ ee(ke, [["__scopeId", "data-v-294c0910"]]);
150
150
  export {
151
151
  we as default
152
152
  };