call-live-sdk1 0.0.1 → 0.0.3

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.
@@ -25589,6 +25589,15 @@ const createImpl = (createState) => {
25589
25589
  return useBoundStore;
25590
25590
  };
25591
25591
  const create$c = (createState) => createState ? createImpl(createState) : createImpl;
25592
+ var define_import_meta_env_default = {};
25593
+ const envConfig$1 = {
25594
+ // 环境名称
25595
+ env: define_import_meta_env_default.VITE_ENV || "development",
25596
+ // SDK 授权配置
25597
+ queenSdkKey: "hP7in57avgV12eJB7dff0052b8ac0481da28769b23b37bc77",
25598
+ // API 相关配置
25599
+ liveProxyUrl: "https://api.lfeiyao.com"
25600
+ };
25592
25601
  var ErrorSeverity = /* @__PURE__ */ ((ErrorSeverity2) => {
25593
25602
  ErrorSeverity2["SEVERE"] = "severe";
25594
25603
  ErrorSeverity2["WARNING"] = "warning";
@@ -25601,27 +25610,34 @@ var GlobalErrorType = /* @__PURE__ */ ((GlobalErrorType2) => {
25601
25610
  GlobalErrorType2["OTHER_ERROR"] = "other_error";
25602
25611
  return GlobalErrorType2;
25603
25612
  })(GlobalErrorType || {});
25604
- const useSdkStore = create$c((set3, get4) => ({
25613
+ const envConfig = {
25605
25614
  callConfig: {
25606
- el: "root",
25607
- sign: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlZGl0aW9uX2lkIjo0NywiZXhwIjoxNzY2OTg2NDY2LCJpYXQiOjE3NjYzODE2NjYsIm5iZiI6MTc2NjM4MTY2Niwic3ViX3VzZXJpZCI6MCwidXNlcmlkIjoiMzg3MzU5ODkifQ.PoX2zUuJycp_Qt8obbKNO1m6GcAWBYklaeIi2IgxnEI",
25608
- liveId: 53065,
25609
- title: "test",
25615
+ el: envConfig$1.env === "production" ? "" : "root",
25616
+ sign: envConfig$1.env === "production" ? "" : "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlZGl0aW9uX2lkIjo0NywiZXhwIjoxNzY2OTg2NDY2LCJpYXQiOjE3NjYzODE2NjYsIm5iZiI6MTc2NjM4MTY2Niwic3ViX3VzZXJpZCI6MCwidXNlcmlkIjoiMzg3MzU5ODkifQ.PoX2zUuJycp_Qt8obbKNO1m6GcAWBYklaeIi2IgxnEI",
25617
+ liveId: envConfig$1.env === "production" ? null : 53065,
25618
+ title: envConfig$1.env === "production" ? "" : "test",
25610
25619
  components: {
25611
25620
  chat: { enabled: true },
25612
25621
  team: { enabled: true },
25613
25622
  call: { enabled: true, inviteLink: "" }
25614
25623
  },
25615
- agentId: 38735989,
25616
- apiDomain: "https://api.lfeiyao.com"
25624
+ agentId: envConfig$1.env === "production" ? null : 38735989,
25625
+ apiDomain: envConfig$1.liveProxyUrl
25617
25626
  },
25618
25627
  guestConfig: {
25619
25628
  el: "",
25620
- sign: "",
25621
- liveId: 53065,
25622
- agentId: 38735989,
25623
- apiDomain: "https://api.lfeiyao.com"
25629
+ sign: envConfig$1.env === "production" ? "" : "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlZGl0aW9uX2lkIjo0NywiZXhwIjoxNzY2OTg2NDY2LCJpYXQiOjE3NjYzODE2NjYsIm5iZiI6MTc2NjM4MTY2Niwic3ViX3VzZXJpZCI6MCwidXNlcmlkIjoiMzg3MzU5ODkifQ.PoX2zUuJycp_Qt8obbKNO1m6GcAWBYklaeIi2IgxnEI",
25630
+ liveId: envConfig$1.env === "production" ? null : 53065,
25631
+ agentId: envConfig$1.env === "production" ? null : 38735989,
25632
+ apiDomain: envConfig$1.liveProxyUrl
25624
25633
  },
25634
+ styleConfig: {
25635
+ minHeight: 770,
25636
+ minWidth: 1500
25637
+ }
25638
+ };
25639
+ const useSdkStore = create$c((set3, get4) => ({
25640
+ ...envConfig,
25625
25641
  // 初始错误状态
25626
25642
  globalError: null,
25627
25643
  setGuestConfig: (config2) => set3({ guestConfig: config2 }),
@@ -25676,6 +25692,178 @@ const useSdkStore = create$c((set3, get4) => ({
25676
25692
  clearGlobalError: () => set3({ globalError: null })
25677
25693
  }));
25678
25694
  const useLiveId = () => useSdkStore((state) => state.getLiveId());
25695
+ function withPureRenderTheme(Component) {
25696
+ return (props) => /* @__PURE__ */ reactExports.createElement(ConfigProvider$1, {
25697
+ theme: {
25698
+ token: {
25699
+ motion: false,
25700
+ zIndexPopupBase: 0
25701
+ }
25702
+ }
25703
+ }, /* @__PURE__ */ reactExports.createElement(Component, Object.assign({}, props)));
25704
+ }
25705
+ const genPurePanel = (Component, alignPropName, postProps, defaultPrefixCls2, getDropdownCls) => {
25706
+ const PurePanel2 = (props) => {
25707
+ const {
25708
+ prefixCls: customizePrefixCls,
25709
+ style: style2
25710
+ } = props;
25711
+ const holderRef = reactExports.useRef(null);
25712
+ const [popupHeight, setPopupHeight] = reactExports.useState(0);
25713
+ const [popupWidth, setPopupWidth] = reactExports.useState(0);
25714
+ const [open2, setOpen] = useMergedState(false, {
25715
+ value: props.open
25716
+ });
25717
+ const {
25718
+ getPrefixCls
25719
+ } = reactExports.useContext(ConfigContext);
25720
+ const prefixCls = getPrefixCls(defaultPrefixCls2 || "select", customizePrefixCls);
25721
+ reactExports.useEffect(() => {
25722
+ setOpen(true);
25723
+ if (typeof ResizeObserver !== "undefined") {
25724
+ const resizeObserver2 = new ResizeObserver((entries) => {
25725
+ const element = entries[0].target;
25726
+ setPopupHeight(element.offsetHeight + 8);
25727
+ setPopupWidth(element.offsetWidth);
25728
+ });
25729
+ const interval = setInterval(() => {
25730
+ var _a2;
25731
+ const dropdownCls = getDropdownCls ? `.${getDropdownCls(prefixCls)}` : `.${prefixCls}-dropdown`;
25732
+ const popup = (_a2 = holderRef.current) === null || _a2 === void 0 ? void 0 : _a2.querySelector(dropdownCls);
25733
+ if (popup) {
25734
+ clearInterval(interval);
25735
+ resizeObserver2.observe(popup);
25736
+ }
25737
+ }, 10);
25738
+ return () => {
25739
+ clearInterval(interval);
25740
+ resizeObserver2.disconnect();
25741
+ };
25742
+ }
25743
+ }, [prefixCls]);
25744
+ let mergedProps = Object.assign(Object.assign({}, props), {
25745
+ style: Object.assign(Object.assign({}, style2), {
25746
+ margin: 0
25747
+ }),
25748
+ open: open2,
25749
+ visible: open2,
25750
+ getPopupContainer: () => holderRef.current
25751
+ });
25752
+ if (postProps) {
25753
+ mergedProps = postProps(mergedProps);
25754
+ }
25755
+ if (alignPropName) {
25756
+ Object.assign(mergedProps, {
25757
+ [alignPropName]: {
25758
+ overflow: {
25759
+ adjustX: false,
25760
+ adjustY: false
25761
+ }
25762
+ }
25763
+ });
25764
+ }
25765
+ const mergedStyle = {
25766
+ paddingBottom: popupHeight,
25767
+ position: "relative",
25768
+ minWidth: popupWidth
25769
+ };
25770
+ return /* @__PURE__ */ reactExports.createElement("div", {
25771
+ ref: holderRef,
25772
+ style: mergedStyle
25773
+ }, /* @__PURE__ */ reactExports.createElement(Component, Object.assign({}, mergedProps)));
25774
+ };
25775
+ return withPureRenderTheme(PurePanel2);
25776
+ };
25777
+ var __rest$1d = function(s3, e3) {
25778
+ var t2 = {};
25779
+ for (var p2 in s3)
25780
+ if (Object.prototype.hasOwnProperty.call(s3, p2) && e3.indexOf(p2) < 0)
25781
+ t2[p2] = s3[p2];
25782
+ if (s3 != null && typeof Object.getOwnPropertySymbols === "function")
25783
+ for (var i = 0, p2 = Object.getOwnPropertySymbols(s3); i < p2.length; i++) {
25784
+ if (e3.indexOf(p2[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s3, p2[i]))
25785
+ t2[p2[i]] = s3[p2[i]];
25786
+ }
25787
+ return t2;
25788
+ };
25789
+ const PurePanel$b = (props) => {
25790
+ const {
25791
+ prefixCls: customizePrefixCls,
25792
+ className,
25793
+ closeIcon,
25794
+ closable,
25795
+ type: type4,
25796
+ title,
25797
+ children,
25798
+ footer
25799
+ } = props, restProps = __rest$1d(props, ["prefixCls", "className", "closeIcon", "closable", "type", "title", "children", "footer"]);
25800
+ const {
25801
+ getPrefixCls
25802
+ } = reactExports.useContext(ConfigContext);
25803
+ const rootPrefixCls = getPrefixCls();
25804
+ const prefixCls = customizePrefixCls || getPrefixCls("modal");
25805
+ const rootCls = useCSSVarCls(rootPrefixCls);
25806
+ const [wrapCSSVar, hashId, cssVarCls] = useStyle$$(prefixCls, rootCls);
25807
+ const confirmPrefixCls = `${prefixCls}-confirm`;
25808
+ let additionalProps = {};
25809
+ if (type4) {
25810
+ additionalProps = {
25811
+ closable: closable !== null && closable !== void 0 ? closable : false,
25812
+ title: "",
25813
+ footer: "",
25814
+ children: /* @__PURE__ */ reactExports.createElement(ConfirmContent, Object.assign({}, props, {
25815
+ prefixCls,
25816
+ confirmPrefixCls,
25817
+ rootPrefixCls,
25818
+ content: children
25819
+ }))
25820
+ };
25821
+ } else {
25822
+ additionalProps = {
25823
+ closable: closable !== null && closable !== void 0 ? closable : true,
25824
+ title,
25825
+ footer: footer !== null && /* @__PURE__ */ reactExports.createElement(Footer$3, Object.assign({}, props)),
25826
+ children
25827
+ };
25828
+ }
25829
+ return wrapCSSVar(/* @__PURE__ */ reactExports.createElement(Panel$2, Object.assign({
25830
+ prefixCls,
25831
+ className: classNames$1(hashId, `${prefixCls}-pure-panel`, type4 && confirmPrefixCls, type4 && `${confirmPrefixCls}-${type4}`, className, cssVarCls, rootCls)
25832
+ }, restProps, {
25833
+ closeIcon: renderCloseIcon(prefixCls, closeIcon),
25834
+ closable
25835
+ }, additionalProps)));
25836
+ };
25837
+ const PurePanel$c = withPureRenderTheme(PurePanel$b);
25838
+ function modalWarn(props) {
25839
+ return confirm$1(withWarn(props));
25840
+ }
25841
+ const Modal = Modal$1;
25842
+ Modal.useModal = useModal;
25843
+ Modal.info = function infoFn(props) {
25844
+ return confirm$1(withInfo(props));
25845
+ };
25846
+ Modal.success = function successFn(props) {
25847
+ return confirm$1(withSuccess(props));
25848
+ };
25849
+ Modal.error = function errorFn(props) {
25850
+ return confirm$1(withError(props));
25851
+ };
25852
+ Modal.warning = modalWarn;
25853
+ Modal.warn = modalWarn;
25854
+ Modal.confirm = function confirmFn(props) {
25855
+ return confirm$1(withConfirm(props));
25856
+ };
25857
+ Modal.destroyAll = function destroyAllFn() {
25858
+ while (destroyFns.length) {
25859
+ const close = destroyFns.pop();
25860
+ if (close) {
25861
+ close();
25862
+ }
25863
+ }
25864
+ };
25865
+ Modal.config = modalGlobalConfig;
25866
+ Modal._InternalPanelDoNotUseOrYouWillBeFired = PurePanel$c;
25679
25867
  const genCardHeadStyle = (token2) => {
25680
25868
  const {
25681
25869
  antCls,
@@ -31067,7 +31255,7 @@ function useAnimateConfig(prefixCls, animated2 = {
31067
31255
  }
31068
31256
  return mergedAnimated;
31069
31257
  }
31070
- var __rest$1d = function(s3, e3) {
31258
+ var __rest$1c = function(s3, e3) {
31071
31259
  var t2 = {};
31072
31260
  for (var p2 in s3)
31073
31261
  if (Object.prototype.hasOwnProperty.call(s3, p2) && e3.indexOf(p2) < 0)
@@ -31101,7 +31289,7 @@ function useLegacyItems$2(items, children) {
31101
31289
  } = node2;
31102
31290
  const _a2 = props || {}, {
31103
31291
  tab: tab2
31104
- } = _a2, restProps = __rest$1d(_a2, ["tab"]);
31292
+ } = _a2, restProps = __rest$1c(_a2, ["tab"]);
31105
31293
  const item = Object.assign(Object.assign({
31106
31294
  key: String(key)
31107
31295
  }, restProps), {
@@ -32010,7 +32198,7 @@ const useStyle$X = genStyleHooks("Tabs", (token2) => {
32010
32198
  return [genSizeStyle$4(tabsToken), genRtlStyle$2(tabsToken), genPositionStyle(tabsToken), genDropdownStyle(tabsToken), genCardStyle(tabsToken), genTabsStyle(tabsToken), genMotionStyle$2(tabsToken)];
32011
32199
  }, prepareComponentToken$u);
32012
32200
  const TabPane$2 = () => null;
32013
- var __rest$1c = function(s3, e3) {
32201
+ var __rest$1b = function(s3, e3) {
32014
32202
  var t2 = {};
32015
32203
  for (var p2 in s3)
32016
32204
  if (Object.prototype.hasOwnProperty.call(s3, p2) && e3.indexOf(p2) < 0)
@@ -32045,7 +32233,7 @@ const InternalTabs = /* @__PURE__ */ reactExports.forwardRef((props, ref) => {
32045
32233
  indicator,
32046
32234
  destroyInactiveTabPane,
32047
32235
  destroyOnHidden
32048
- } = props, otherProps = __rest$1c(props, ["type", "className", "rootClassName", "size", "onEdit", "hideAdd", "centered", "addIcon", "removeIcon", "moreIcon", "more", "popupClassName", "children", "items", "animated", "style", "indicatorSize", "indicator", "destroyInactiveTabPane", "destroyOnHidden"]);
32236
+ } = props, otherProps = __rest$1b(props, ["type", "className", "rootClassName", "size", "onEdit", "hideAdd", "centered", "addIcon", "removeIcon", "moreIcon", "more", "popupClassName", "children", "items", "animated", "style", "indicatorSize", "indicator", "destroyInactiveTabPane", "destroyOnHidden"]);
32049
32237
  const {
32050
32238
  prefixCls: customizePrefixCls
32051
32239
  } = otherProps;
@@ -32113,7 +32301,7 @@ const InternalTabs = /* @__PURE__ */ reactExports.forwardRef((props, ref) => {
32113
32301
  });
32114
32302
  const Tabs$2 = InternalTabs;
32115
32303
  Tabs$2.TabPane = TabPane$2;
32116
- var __rest$1b = function(s3, e3) {
32304
+ var __rest$1a = function(s3, e3) {
32117
32305
  var t2 = {};
32118
32306
  for (var p2 in s3)
32119
32307
  if (Object.prototype.hasOwnProperty.call(s3, p2) && e3.indexOf(p2) < 0)
@@ -32130,7 +32318,7 @@ const Grid$1 = (_a2) => {
32130
32318
  prefixCls,
32131
32319
  className,
32132
32320
  hoverable = true
32133
- } = _a2, props = __rest$1b(_a2, ["prefixCls", "className", "hoverable"]);
32321
+ } = _a2, props = __rest$1a(_a2, ["prefixCls", "className", "hoverable"]);
32134
32322
  const {
32135
32323
  getPrefixCls
32136
32324
  } = reactExports.useContext(ConfigContext);
@@ -32161,7 +32349,7 @@ const useVariant = (component, variant, legacyBordered) => {
32161
32349
  const enableVariantCls = Variants.includes(mergedVariant);
32162
32350
  return [mergedVariant, enableVariantCls];
32163
32351
  };
32164
- var __rest$1a = function(s3, e3) {
32352
+ var __rest$19 = function(s3, e3) {
32165
32353
  var t2 = {};
32166
32354
  for (var p2 in s3)
32167
32355
  if (Object.prototype.hasOwnProperty.call(s3, p2) && e3.indexOf(p2) < 0)
@@ -32218,7 +32406,7 @@ const Card$2 = /* @__PURE__ */ reactExports.forwardRef((props, ref) => {
32218
32406
  tabProps = {},
32219
32407
  classNames: customClassNames,
32220
32408
  styles: customStyles
32221
- } = props, others = __rest$1a(props, ["prefixCls", "className", "rootClassName", "style", "extra", "headStyle", "bodyStyle", "title", "loading", "bordered", "variant", "size", "type", "cover", "actions", "tabList", "children", "activeTabKey", "defaultActiveTabKey", "tabBarExtraContent", "hoverable", "tabProps", "classNames", "styles"]);
32409
+ } = props, others = __rest$19(props, ["prefixCls", "className", "rootClassName", "style", "extra", "headStyle", "bodyStyle", "title", "loading", "bordered", "variant", "size", "type", "cover", "actions", "tabList", "children", "activeTabKey", "defaultActiveTabKey", "tabBarExtraContent", "hoverable", "tabProps", "classNames", "styles"]);
32222
32410
  const {
32223
32411
  getPrefixCls,
32224
32412
  direction,
@@ -32272,7 +32460,7 @@ const Card$2 = /* @__PURE__ */ reactExports.forwardRef((props, ref) => {
32272
32460
  items: tabList.map((_a2) => {
32273
32461
  var {
32274
32462
  tab: tab2
32275
- } = _a2, item = __rest$1a(_a2, ["tab"]);
32463
+ } = _a2, item = __rest$19(_a2, ["tab"]);
32276
32464
  return Object.assign({
32277
32465
  label: tab2
32278
32466
  }, item);
@@ -32332,7 +32520,7 @@ const Card$2 = /* @__PURE__ */ reactExports.forwardRef((props, ref) => {
32332
32520
  style: mergedStyle
32333
32521
  }), head, coverDom, body, actionDom));
32334
32522
  });
32335
- var __rest$19 = function(s3, e3) {
32523
+ var __rest$18 = function(s3, e3) {
32336
32524
  var t2 = {};
32337
32525
  for (var p2 in s3)
32338
32526
  if (Object.prototype.hasOwnProperty.call(s3, p2) && e3.indexOf(p2) < 0)
@@ -32351,7 +32539,7 @@ const Meta = (props) => {
32351
32539
  avatar,
32352
32540
  title,
32353
32541
  description: description2
32354
- } = props, others = __rest$19(props, ["prefixCls", "className", "avatar", "title", "description"]);
32542
+ } = props, others = __rest$18(props, ["prefixCls", "className", "avatar", "title", "description"]);
32355
32543
  const {
32356
32544
  getPrefixCls
32357
32545
  } = reactExports.useContext(ConfigContext);
@@ -33193,184 +33381,16 @@ const ErrorPage = ({
33193
33381
  })
33194
33382
  });
33195
33383
  };
33196
- function withPureRenderTheme(Component) {
33197
- return (props) => /* @__PURE__ */ reactExports.createElement(ConfigProvider$1, {
33198
- theme: {
33199
- token: {
33200
- motion: false,
33201
- zIndexPopupBase: 0
33202
- }
33203
- }
33204
- }, /* @__PURE__ */ reactExports.createElement(Component, Object.assign({}, props)));
33205
- }
33206
- const genPurePanel = (Component, alignPropName, postProps, defaultPrefixCls2, getDropdownCls) => {
33207
- const PurePanel2 = (props) => {
33208
- const {
33209
- prefixCls: customizePrefixCls,
33210
- style: style2
33211
- } = props;
33212
- const holderRef = reactExports.useRef(null);
33213
- const [popupHeight, setPopupHeight] = reactExports.useState(0);
33214
- const [popupWidth, setPopupWidth] = reactExports.useState(0);
33215
- const [open2, setOpen] = useMergedState(false, {
33216
- value: props.open
33217
- });
33218
- const {
33219
- getPrefixCls
33220
- } = reactExports.useContext(ConfigContext);
33221
- const prefixCls = getPrefixCls(defaultPrefixCls2 || "select", customizePrefixCls);
33222
- reactExports.useEffect(() => {
33223
- setOpen(true);
33224
- if (typeof ResizeObserver !== "undefined") {
33225
- const resizeObserver2 = new ResizeObserver((entries) => {
33226
- const element = entries[0].target;
33227
- setPopupHeight(element.offsetHeight + 8);
33228
- setPopupWidth(element.offsetWidth);
33229
- });
33230
- const interval = setInterval(() => {
33231
- var _a2;
33232
- const dropdownCls = getDropdownCls ? `.${getDropdownCls(prefixCls)}` : `.${prefixCls}-dropdown`;
33233
- const popup = (_a2 = holderRef.current) === null || _a2 === void 0 ? void 0 : _a2.querySelector(dropdownCls);
33234
- if (popup) {
33235
- clearInterval(interval);
33236
- resizeObserver2.observe(popup);
33237
- }
33238
- }, 10);
33239
- return () => {
33240
- clearInterval(interval);
33241
- resizeObserver2.disconnect();
33242
- };
33243
- }
33244
- }, [prefixCls]);
33245
- let mergedProps = Object.assign(Object.assign({}, props), {
33246
- style: Object.assign(Object.assign({}, style2), {
33247
- margin: 0
33248
- }),
33249
- open: open2,
33250
- visible: open2,
33251
- getPopupContainer: () => holderRef.current
33252
- });
33253
- if (postProps) {
33254
- mergedProps = postProps(mergedProps);
33255
- }
33256
- if (alignPropName) {
33257
- Object.assign(mergedProps, {
33258
- [alignPropName]: {
33259
- overflow: {
33260
- adjustX: false,
33261
- adjustY: false
33262
- }
33263
- }
33264
- });
33265
- }
33266
- const mergedStyle = {
33267
- paddingBottom: popupHeight,
33268
- position: "relative",
33269
- minWidth: popupWidth
33270
- };
33271
- return /* @__PURE__ */ reactExports.createElement("div", {
33272
- ref: holderRef,
33273
- style: mergedStyle
33274
- }, /* @__PURE__ */ reactExports.createElement(Component, Object.assign({}, mergedProps)));
33275
- };
33276
- return withPureRenderTheme(PurePanel2);
33277
- };
33278
- var __rest$18 = function(s3, e3) {
33279
- var t2 = {};
33280
- for (var p2 in s3)
33281
- if (Object.prototype.hasOwnProperty.call(s3, p2) && e3.indexOf(p2) < 0)
33282
- t2[p2] = s3[p2];
33283
- if (s3 != null && typeof Object.getOwnPropertySymbols === "function")
33284
- for (var i = 0, p2 = Object.getOwnPropertySymbols(s3); i < p2.length; i++) {
33285
- if (e3.indexOf(p2[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s3, p2[i]))
33286
- t2[p2[i]] = s3[p2[i]];
33287
- }
33288
- return t2;
33289
- };
33290
- const PurePanel$b = (props) => {
33291
- const {
33292
- prefixCls: customizePrefixCls,
33293
- className,
33294
- closeIcon,
33295
- closable,
33296
- type: type4,
33297
- title,
33298
- children,
33299
- footer
33300
- } = props, restProps = __rest$18(props, ["prefixCls", "className", "closeIcon", "closable", "type", "title", "children", "footer"]);
33301
- const {
33302
- getPrefixCls
33303
- } = reactExports.useContext(ConfigContext);
33304
- const rootPrefixCls = getPrefixCls();
33305
- const prefixCls = customizePrefixCls || getPrefixCls("modal");
33306
- const rootCls = useCSSVarCls(rootPrefixCls);
33307
- const [wrapCSSVar, hashId, cssVarCls] = useStyle$$(prefixCls, rootCls);
33308
- const confirmPrefixCls = `${prefixCls}-confirm`;
33309
- let additionalProps = {};
33310
- if (type4) {
33311
- additionalProps = {
33312
- closable: closable !== null && closable !== void 0 ? closable : false,
33313
- title: "",
33314
- footer: "",
33315
- children: /* @__PURE__ */ reactExports.createElement(ConfirmContent, Object.assign({}, props, {
33316
- prefixCls,
33317
- confirmPrefixCls,
33318
- rootPrefixCls,
33319
- content: children
33320
- }))
33321
- };
33322
- } else {
33323
- additionalProps = {
33324
- closable: closable !== null && closable !== void 0 ? closable : true,
33325
- title,
33326
- footer: footer !== null && /* @__PURE__ */ reactExports.createElement(Footer$3, Object.assign({}, props)),
33327
- children
33328
- };
33329
- }
33330
- return wrapCSSVar(/* @__PURE__ */ reactExports.createElement(Panel$2, Object.assign({
33331
- prefixCls,
33332
- className: classNames$1(hashId, `${prefixCls}-pure-panel`, type4 && confirmPrefixCls, type4 && `${confirmPrefixCls}-${type4}`, className, cssVarCls, rootCls)
33333
- }, restProps, {
33334
- closeIcon: renderCloseIcon(prefixCls, closeIcon),
33335
- closable
33336
- }, additionalProps)));
33337
- };
33338
- const PurePanel$c = withPureRenderTheme(PurePanel$b);
33339
- function modalWarn(props) {
33340
- return confirm$1(withWarn(props));
33341
- }
33342
- const Modal = Modal$1;
33343
- Modal.useModal = useModal;
33344
- Modal.info = function infoFn(props) {
33345
- return confirm$1(withInfo(props));
33346
- };
33347
- Modal.success = function successFn(props) {
33348
- return confirm$1(withSuccess(props));
33349
- };
33350
- Modal.error = function errorFn(props) {
33351
- return confirm$1(withError(props));
33352
- };
33353
- Modal.warning = modalWarn;
33354
- Modal.warn = modalWarn;
33355
- Modal.confirm = function confirmFn(props) {
33356
- return confirm$1(withConfirm(props));
33357
- };
33358
- Modal.destroyAll = function destroyAllFn() {
33359
- while (destroyFns.length) {
33360
- const close = destroyFns.pop();
33361
- if (close) {
33362
- close();
33363
- }
33364
- }
33365
- };
33366
- Modal.config = modalGlobalConfig;
33367
- Modal._InternalPanelDoNotUseOrYouWillBeFired = PurePanel$c;
33368
33384
  class GlobalErrorBoundary extends reactExports.Component {
33369
33385
  constructor(props) {
33370
33386
  super(props);
33371
33387
  this.unsubscribe = null;
33372
33388
  this.handleApiError = (event) => {
33373
- const { code, message: message2, details } = event.detail;
33389
+ const {
33390
+ code,
33391
+ message: message2,
33392
+ details
33393
+ } = event.detail;
33374
33394
  const severity = code && code >= 500 ? ErrorSeverity.SEVERE : ErrorSeverity.WARNING;
33375
33395
  const globalError = {
33376
33396
  type: GlobalErrorType.API_ERROR,
@@ -33379,10 +33399,15 @@ class GlobalErrorBoundary extends reactExports.Component {
33379
33399
  details,
33380
33400
  severity
33381
33401
  };
33382
- useSdkStore.setState({ globalError });
33402
+ useSdkStore.setState({
33403
+ globalError
33404
+ });
33383
33405
  };
33384
33406
  this.handleParamValidationError = (event) => {
33385
- const { message: message2, details } = event.detail;
33407
+ const {
33408
+ message: message2,
33409
+ details
33410
+ } = event.detail;
33386
33411
  const globalError = {
33387
33412
  type: GlobalErrorType.PARAM_VALIDATION_ERROR,
33388
33413
  code: 400,
@@ -33390,7 +33415,9 @@ class GlobalErrorBoundary extends reactExports.Component {
33390
33415
  details,
33391
33416
  severity: ErrorSeverity.WARNING
33392
33417
  };
33393
- useSdkStore.setState({ globalError });
33418
+ useSdkStore.setState({
33419
+ globalError
33420
+ });
33394
33421
  };
33395
33422
  this.handleTokenExpired = (event) => {
33396
33423
  const globalError = {
@@ -33400,10 +33427,16 @@ class GlobalErrorBoundary extends reactExports.Component {
33400
33427
  details: event.detail,
33401
33428
  severity: ErrorSeverity.SEVERE
33402
33429
  };
33403
- useSdkStore.setState({ globalError });
33430
+ useSdkStore.setState({
33431
+ globalError
33432
+ });
33404
33433
  };
33405
33434
  this.handleNotFoundError = (event) => {
33406
- const { code, message: message2, details } = event.detail;
33435
+ const {
33436
+ code,
33437
+ message: message2,
33438
+ details
33439
+ } = event.detail;
33407
33440
  const globalError = {
33408
33441
  type: GlobalErrorType.API_ERROR,
33409
33442
  code: code || 404,
@@ -33411,10 +33444,16 @@ class GlobalErrorBoundary extends reactExports.Component {
33411
33444
  details,
33412
33445
  severity: ErrorSeverity.SEVERE
33413
33446
  };
33414
- useSdkStore.setState({ globalError });
33447
+ useSdkStore.setState({
33448
+ globalError
33449
+ });
33415
33450
  };
33416
33451
  this.handleTimeoutError = (event) => {
33417
- const { code, message: message2, details } = event.detail;
33452
+ const {
33453
+ code,
33454
+ message: message2,
33455
+ details
33456
+ } = event.detail;
33418
33457
  const globalError = {
33419
33458
  type: GlobalErrorType.API_ERROR,
33420
33459
  code: code || 408,
@@ -33422,10 +33461,16 @@ class GlobalErrorBoundary extends reactExports.Component {
33422
33461
  details,
33423
33462
  severity: ErrorSeverity.WARNING
33424
33463
  };
33425
- useSdkStore.setState({ globalError });
33464
+ useSdkStore.setState({
33465
+ globalError
33466
+ });
33426
33467
  };
33427
33468
  this.handleServerError = (event) => {
33428
- const { code, message: message2, details } = event.detail;
33469
+ const {
33470
+ code,
33471
+ message: message2,
33472
+ details
33473
+ } = event.detail;
33429
33474
  const globalError = {
33430
33475
  type: GlobalErrorType.API_ERROR,
33431
33476
  code: code || 500,
@@ -33433,10 +33478,16 @@ class GlobalErrorBoundary extends reactExports.Component {
33433
33478
  details,
33434
33479
  severity: ErrorSeverity.SEVERE
33435
33480
  };
33436
- useSdkStore.setState({ globalError });
33481
+ useSdkStore.setState({
33482
+ globalError
33483
+ });
33437
33484
  };
33438
33485
  this.handleClientError = (event) => {
33439
- const { code, message: message2, details } = event.detail;
33486
+ const {
33487
+ code,
33488
+ message: message2,
33489
+ details
33490
+ } = event.detail;
33440
33491
  const globalError = {
33441
33492
  type: GlobalErrorType.API_ERROR,
33442
33493
  code: code || 400,
@@ -33444,10 +33495,16 @@ class GlobalErrorBoundary extends reactExports.Component {
33444
33495
  details,
33445
33496
  severity: ErrorSeverity.WARNING
33446
33497
  };
33447
- useSdkStore.setState({ globalError });
33498
+ useSdkStore.setState({
33499
+ globalError
33500
+ });
33448
33501
  };
33449
33502
  this.handleUnknownError = (event) => {
33450
- const { code, message: message2, details } = event.detail;
33503
+ const {
33504
+ code,
33505
+ message: message2,
33506
+ details
33507
+ } = event.detail;
33451
33508
  const globalError = {
33452
33509
  type: GlobalErrorType.OTHER_ERROR,
33453
33510
  code: code || 500,
@@ -33455,11 +33512,17 @@ class GlobalErrorBoundary extends reactExports.Component {
33455
33512
  details,
33456
33513
  severity: ErrorSeverity.SEVERE
33457
33514
  };
33458
- useSdkStore.setState({ globalError });
33515
+ useSdkStore.setState({
33516
+ globalError
33517
+ });
33459
33518
  };
33460
33519
  this.handleClearError = () => {
33461
- useSdkStore.setState({ globalError: null });
33462
- this.setState({ hasError: false });
33520
+ useSdkStore.setState({
33521
+ globalError: null
33522
+ });
33523
+ this.setState({
33524
+ hasError: false
33525
+ });
33463
33526
  };
33464
33527
  this.handleRetry = () => {
33465
33528
  this.handleClearError();
@@ -33496,7 +33559,9 @@ class GlobalErrorBoundary extends reactExports.Component {
33496
33559
  window.addEventListener("unknownError", this.handleUnknownError);
33497
33560
  this.unsubscribe = useSdkStore.subscribe((state, prevState) => {
33498
33561
  if (state.globalError !== prevState.globalError) {
33499
- this.setState({ globalError: state.globalError });
33562
+ this.setState({
33563
+ globalError: state.globalError
33564
+ });
33500
33565
  }
33501
33566
  });
33502
33567
  }
@@ -33535,49 +33600,56 @@ class GlobalErrorBoundary extends reactExports.Component {
33535
33600
  },
33536
33601
  severity: ErrorSeverity.SEVERE
33537
33602
  };
33538
- useSdkStore.setState({ globalError });
33539
- this.setState({ globalError });
33603
+ useSdkStore.setState({
33604
+ globalError
33605
+ });
33606
+ this.setState({
33607
+ globalError
33608
+ });
33540
33609
  }
33541
33610
  /**
33542
33611
  * 渲染组件
33543
33612
  * @returns React节点
33544
33613
  */
33545
33614
  render() {
33546
- const { globalError } = this.state;
33547
- const { errorNotification = false } = this.props;
33615
+ const {
33616
+ globalError
33617
+ } = this.state;
33618
+ const {
33619
+ errorNotification = false
33620
+ } = this.props;
33548
33621
  if (!errorNotification) {
33549
33622
  return this.props.children;
33550
33623
  }
33551
33624
  if (globalError) {
33552
33625
  if (globalError.severity === ErrorSeverity.SEVERE) {
33553
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
33554
- ErrorPage,
33555
- {
33556
- error: globalError,
33557
- onClose: this.handleClearError,
33558
- onRetry: this.handleRetry
33559
- }
33560
- );
33626
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(ErrorPage, {
33627
+ error: globalError,
33628
+ onClose: this.handleClearError,
33629
+ onRetry: this.handleRetry
33630
+ });
33561
33631
  } else {
33562
- return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
33563
- this.props.children,
33564
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
33565
- Modal,
33566
- {
33567
- title: "错误提示",
33568
- open: !!globalError && globalError.severity === ErrorSeverity.WARNING,
33569
- onOk: this.handleClearError,
33570
- onCancel: this.handleClearError,
33571
- okText: "关闭",
33572
- cancelText: "取消",
33573
- centered: true,
33574
- children: [
33575
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-red-500", children: globalError.message }),
33576
- globalError.details && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-2 text-sm text-gray-600", children: /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: "whitespace-pre-wrap", children: JSON.stringify(globalError.details, null, 2) }) })
33577
- ]
33578
- }
33579
- )
33580
- ] });
33632
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
33633
+ children: [this.props.children, /* @__PURE__ */ jsxRuntimeExports.jsxs(Modal, {
33634
+ title: "错误提示",
33635
+ open: !!globalError && globalError.severity === ErrorSeverity.WARNING,
33636
+ onOk: this.handleClearError,
33637
+ onCancel: this.handleClearError,
33638
+ okText: "关闭",
33639
+ cancelText: "取消",
33640
+ centered: true,
33641
+ children: [/* @__PURE__ */ jsxRuntimeExports.jsx("div", {
33642
+ className: "text-red-500",
33643
+ children: globalError.message
33644
+ }), globalError.details && /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
33645
+ className: "mt-2 text-sm text-gray-600",
33646
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx("pre", {
33647
+ className: "whitespace-pre-wrap",
33648
+ children: JSON.stringify(globalError.details, null, 2)
33649
+ })
33650
+ })]
33651
+ })]
33652
+ });
33581
33653
  }
33582
33654
  }
33583
33655
  return this.props.children;
@@ -46027,18 +46099,6 @@ axios.formToJSON = (thing) => formDataToJSON(utils$9.isHTMLForm(thing) ? new For
46027
46099
  axios.getAdapter = adapters.getAdapter;
46028
46100
  axios.HttpStatusCode = HttpStatusCode;
46029
46101
  axios.default = axios;
46030
- var define_import_meta_env_default = {};
46031
- const envConfig = {
46032
- // 环境名称
46033
- env: define_import_meta_env_default.VITE_ENV || "development",
46034
- // 地图相关配置
46035
- amapKey: "d3e9b4bd66a3ed8533f2e5d01c24e273",
46036
- amapCode: "ff1c6caa84b5fe4e179dc6a84580995c",
46037
- // SDK 授权配置
46038
- queenSdkKey: "hP7in57avgV12eJB7dff0052b8ac0481da28769b23b37bc77",
46039
- // API 相关配置
46040
- liveProxyUrl: "https://api.lfeiyao.com"
46041
- };
46042
46102
  function withResolvers() {
46043
46103
  let output = {};
46044
46104
  output.promise = new Promise((res, rej) => {
@@ -46520,10 +46580,14 @@ const errorConfig = {
46520
46580
  console.warn("Login expired, please re-login");
46521
46581
  }
46522
46582
  };
46523
- console.log("<<envConfig.env>>", envConfig);
46524
- console.log("=====>", envConfig.env === "production" ? useSdkStore.getState().getApiDomain() : envConfig);
46583
+ const map$d = {
46584
+ production: useSdkStore.getState().getApiDomain(),
46585
+ test: envConfig$1.liveProxyUrl,
46586
+ dev: ""
46587
+ };
46588
+ console.log("envConfig.env", envConfig$1.env);
46525
46589
  const axiosInstance = axios.create({
46526
- baseURL: envConfig.env === "production" ? useSdkStore.getState().getApiDomain() : envConfig.liveProxyUrl,
46590
+ baseURL: map$d[envConfig$1.env],
46527
46591
  // 只在生产环境设置基础 URL,开发环境使用代理
46528
46592
  timeout: 3e4,
46529
46593
  // 30秒超时
@@ -85324,6 +85388,10 @@ function useLiveInfo() {
85324
85388
  return res;
85325
85389
  }
85326
85390
  return res;
85391
+ }).catch((error22) => {
85392
+ console.error("直播信息请求失败,取消轮训:", error22);
85393
+ requestResult.cancel();
85394
+ return error22;
85327
85395
  });
85328
85396
  }, {
85329
85397
  pollingInterval: 2e3,
@@ -85517,10 +85585,16 @@ const Head = ({
85517
85585
  livePushCode
85518
85586
  } = useLivePushCodeStore();
85519
85587
  const {
85520
- data: liveInfoData
85588
+ data: liveInfoData,
85589
+ run: runLiveInfo
85521
85590
  } = useRequest(() => request(`/bis/live-info?id=${liveId}`).then((res) => res.data), {
85522
- manual: callConfig.role !== "main"
85591
+ manual: true
85523
85592
  });
85593
+ reactExports.useEffect(() => {
85594
+ if (callConfig.rule === "main") {
85595
+ runLiveInfo();
85596
+ }
85597
+ }, [callConfig.rule]);
85524
85598
  const [isLive, setIsLive] = reactExports.useState(false);
85525
85599
  const [isCurrentPagePushing, setIsCurrentPagePushing] = reactExports.useState(false);
85526
85600
  const [isModalVisible, setIsModalVisible] = reactExports.useState(false);
@@ -195526,46 +195600,37 @@ const useDrawingToolsStore = create$c((set3, get4) => ({
195526
195600
  setPenSize: (size) => set3((state) => {
195527
195601
  const newSize = typeof size === "function" ? size(state.penSize) : size;
195528
195602
  return {
195529
- penSize: newSize,
195530
- penSizeRef: { current: newSize }
195603
+ penSize: newSize
195531
195604
  };
195532
195605
  }),
195533
195606
  penColor: "#ff5a5a",
195534
195607
  setPenColor: (color) => set3((state) => {
195535
195608
  const newColor = typeof color === "function" ? color(state.penColor) : color;
195536
195609
  return {
195537
- penColor: newColor,
195538
- penColorRef: { current: newColor }
195610
+ penColor: newColor
195539
195611
  };
195540
195612
  }),
195541
- penSizeRef: { current: 2 },
195542
- penColorRef: { current: "#ff5a5a" },
195543
195613
  // 激光笔设置
195544
195614
  laserPenSize: 2,
195545
195615
  setLaserPenSize: (size) => set3((state) => {
195546
195616
  const newSize = typeof size === "function" ? size(state.laserPenSize) : size;
195547
195617
  return {
195548
- laserPenSize: newSize,
195549
- laserPenSizeRef: { current: newSize }
195618
+ laserPenSize: newSize
195550
195619
  };
195551
195620
  }),
195552
195621
  laserPenColor: "#ff5a5a",
195553
195622
  setLaserPenColor: (color) => set3((state) => {
195554
195623
  const newColor = typeof color === "function" ? color(state.laserPenColor) : color;
195555
195624
  return {
195556
- laserPenColor: newColor,
195557
- laserPenColorRef: { current: newColor }
195625
+ laserPenColor: newColor
195558
195626
  };
195559
195627
  }),
195560
- laserPenSizeRef: { current: 2 },
195561
- laserPenColorRef: { current: "#ff5a5a" },
195562
195628
  // 形状设置
195563
195629
  shapeSize: 2,
195564
195630
  setShapeSize: (size) => set3((state) => {
195565
195631
  const newSize = typeof size === "function" ? size(state.shapeSize) : size;
195566
195632
  return {
195567
- shapeSize: newSize,
195568
- shapeSizeRef: { current: newSize }
195633
+ shapeSize: newSize
195569
195634
  };
195570
195635
  }),
195571
195636
  shapeType: "rect",
@@ -195580,39 +195645,32 @@ const useDrawingToolsStore = create$c((set3, get4) => ({
195580
195645
  setShapeColor: (color) => set3((state) => {
195581
195646
  const newColor = typeof color === "function" ? color(state.shapeColor) : color;
195582
195647
  return {
195583
- shapeColor: newColor,
195584
- shapeColorRef: { current: newColor }
195648
+ shapeColor: newColor
195585
195649
  };
195586
195650
  }),
195587
- shapeSizeRef: { current: 2 },
195588
- shapeTypeRef: { current: "rect" },
195589
- shapeColorRef: { current: "#ff5a5a" },
195590
195651
  // 文字设置
195591
195652
  textSize: 16,
195592
195653
  setTextSize: (size) => set3((state) => {
195593
195654
  const newSize = typeof size === "function" ? size(state.textSize) : size;
195594
195655
  return {
195595
- textSize: newSize,
195596
- textSizeRef: { current: newSize }
195656
+ textSize: newSize
195597
195657
  };
195598
195658
  }),
195599
195659
  textColor: "#ff5a5a",
195600
195660
  setTextColor: (color) => set3((state) => {
195601
195661
  const newColor = typeof color === "function" ? color(state.textColor) : color;
195602
195662
  return {
195603
- textColor: newColor,
195604
- textColorRef: { current: newColor }
195663
+ textColor: newColor
195605
195664
  };
195606
195665
  }),
195607
- textSizeRef: { current: 16 },
195608
- textColorRef: { current: "#ff5a5a" },
195609
195666
  // 预览弹窗状态
195610
195667
  isPreviewModalVisible: false,
195611
195668
  setIsPreviewModalVisible: (visible) => set3({ isPreviewModalVisible: visible }),
195612
195669
  // 绘图相关引用
195613
195670
  downPoint: { current: null },
195614
195671
  upPoint: { current: null },
195615
- currentShape: { current: null }
195672
+ currentShape: { current: null },
195673
+ getter: () => get4()
195616
195674
  }));
195617
195675
  const useCallUserPagination = (config2) => {
195618
195676
  const { gridCols } = config2;
@@ -265662,7 +265720,7 @@ const Document$1 = ({
265662
265720
  return /* @__PURE__ */ jsxRuntimeExports.jsx("a", {
265663
265721
  href: r3.buy_url,
265664
265722
  target: "_blank",
265665
- className: "flex text-stone-500",
265723
+ className: "text-[--call-live-sdk-color-primary]",
265666
265724
  rel: "noreferrer",
265667
265725
  children: r3.name
265668
265726
  });
@@ -266022,13 +266080,13 @@ const Document$1 = ({
266022
266080
  title: "预览文档",
266023
266081
  width: 715,
266024
266082
  children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
266025
- className: "w-670px pt-4 h-430px bg-#e8e8e8 flex items-center flex-col",
266083
+ className: "w-670px pt-4 h-430px bg-#1a1a1a flex items-center flex-col",
266026
266084
  children: [/* @__PURE__ */ jsxRuntimeExports.jsx("img", {
266027
266085
  src: urlList[listIndex],
266028
- className: " h-92 object-contain"
266086
+ className: " h-92 object-contain bg-#0e121c p-4 rounded"
266029
266087
  }), /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
266030
- className: "flex items-center h-40px",
266031
- children: [/* @__PURE__ */ jsxRuntimeExports.jsx("div", {
266088
+ className: "flex items-center h-40px text-white",
266089
+ children: [/* @__PURE__ */ jsxRuntimeExports.jsx(Button$1, {
266032
266090
  onClick: () => {
266033
266091
  if (listIndex > 0) {
266034
266092
  setListIndex(listIndex - 1);
@@ -266036,12 +266094,13 @@ const Document$1 = ({
266036
266094
  setListIndex(urlList.length - 1);
266037
266095
  }
266038
266096
  },
266039
- className: " cursor-pointer bg-white px-2",
266097
+ type: "primary",
266098
+ ghost: true,
266040
266099
  children: "上一页"
266041
266100
  }), /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
266042
- className: "mx-2",
266101
+ className: "mx-2 text-white",
266043
266102
  children: [listIndex + 1, "/", urlList.length]
266044
- }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
266103
+ }), /* @__PURE__ */ jsxRuntimeExports.jsx(Button$1, {
266045
266104
  onClick: () => {
266046
266105
  if (listIndex < urlList.length - 1) {
266047
266106
  setListIndex(listIndex + 1);
@@ -266049,7 +266108,8 @@ const Document$1 = ({
266049
266108
  setListIndex(0);
266050
266109
  }
266051
266110
  },
266052
- className: " cursor-pointer bg-white px-2",
266111
+ type: "primary",
266112
+ ghost: true,
266053
266113
  children: "下一页"
266054
266114
  })]
266055
266115
  })]
@@ -266146,7 +266206,6 @@ const DocumentControler = ({
266146
266206
  setDocumentIndex(selectedScene.documentIndex);
266147
266207
  handleImageClick(selectedScene.documentIndex);
266148
266208
  }, [currentScene]);
266149
- console.log("documentInfo", documentInfo);
266150
266209
  reactExports.useEffect(() => {
266151
266210
  if (!documentInfo.name) {
266152
266211
  setDocumentScrollLeft(0);
@@ -266463,30 +266522,20 @@ const ToolOption = reactExports.memo(({
266463
266522
  });
266464
266523
  });
266465
266524
  ToolOption.displayName = "ToolOption";
266525
+ const COLORS = ["#ff5a5a", "#ffbf48", "#3a9bff", "#58efb8", "#000000", "#808080", "#ffffff"];
266526
+ const LINE_SIZES = [2, 4, 6];
266527
+ const TEXT_SIZES = [16, 20, 24, 28, 32];
266528
+ const TOOL_IDS = {
266529
+ SELECT: 1,
266530
+ PEN: 2,
266531
+ LASER_PEN: 3,
266532
+ SHAPE: 4,
266533
+ TEXT: 5
266534
+ };
266466
266535
  const DrawingToolbar = ({
266467
266536
  onToolClick,
266468
266537
  onClearCanvas,
266469
- onPreviewClick,
266470
- // 初始值 - 仅用于初始化,实际状态由 model 管理
266471
- initialPenSize = 2,
266472
- initialPenColor = "#ff5a5a",
266473
- initialLaserPenSize = 2,
266474
- initialLaserPenColor = "#ff5a5a",
266475
- initialShapeSize = 2,
266476
- initialShapeType = "rect",
266477
- initialShapeColor = "#ff5a5a",
266478
- initialTextSize = 16,
266479
- initialTextColor = "#ff5a5a",
266480
- // 状态更新回调 - 用于向父组件通知变化
266481
- onPenSizeChange,
266482
- onPenColorChange,
266483
- onLaserPenSizeChange,
266484
- onLaserPenColorChange,
266485
- onShapeSizeChange,
266486
- onShapeTypeChange,
266487
- onShapeColorChange,
266488
- onTextSizeChange,
266489
- onTextColorChange
266538
+ onPreviewClick
266490
266539
  }) => {
266491
266540
  const {
266492
266541
  // 工具选择
@@ -266517,114 +266566,23 @@ const DrawingToolbar = ({
266517
266566
  // 预览弹窗状态
266518
266567
  setIsPreviewModalVisible
266519
266568
  } = useDrawingToolsStore();
266520
- const prevPropsRef = reactExports.useRef({
266521
- initialPenSize,
266522
- initialPenColor,
266523
- initialLaserPenSize,
266524
- initialLaserPenColor,
266525
- initialShapeSize,
266526
- initialShapeType,
266527
- initialShapeColor,
266528
- initialTextSize,
266529
- initialTextColor
266530
- });
266531
- reactExports.useEffect(() => {
266532
- const prevProps = prevPropsRef.current;
266533
- if (prevProps.initialPenSize !== initialPenSize) {
266534
- setPenSize(initialPenSize);
266535
- prevPropsRef.current.initialPenSize = initialPenSize;
266536
- }
266537
- if (prevProps.initialPenColor !== initialPenColor) {
266538
- setPenColor(initialPenColor);
266539
- prevPropsRef.current.initialPenColor = initialPenColor;
266540
- }
266541
- if (prevProps.initialLaserPenSize !== initialLaserPenSize) {
266542
- setLaserPenSize(initialLaserPenSize);
266543
- prevPropsRef.current.initialLaserPenSize = initialLaserPenSize;
266544
- }
266545
- if (prevProps.initialLaserPenColor !== initialLaserPenColor) {
266546
- setLaserPenColor(initialLaserPenColor);
266547
- prevPropsRef.current.initialLaserPenColor = initialLaserPenColor;
266548
- }
266549
- if (prevProps.initialShapeSize !== initialShapeSize) {
266550
- setShapeSize(initialShapeSize);
266551
- prevPropsRef.current.initialShapeSize = initialShapeSize;
266552
- }
266553
- if (prevProps.initialShapeType !== initialShapeType) {
266554
- setShapeType(initialShapeType);
266555
- prevPropsRef.current.initialShapeType = initialShapeType;
266556
- }
266557
- if (prevProps.initialShapeColor !== initialShapeColor) {
266558
- setShapeColor(initialShapeColor);
266559
- prevPropsRef.current.initialShapeColor = initialShapeColor;
266560
- }
266561
- if (prevProps.initialTextSize !== initialTextSize) {
266562
- setTextSize(initialTextSize);
266563
- prevPropsRef.current.initialTextSize = initialTextSize;
266564
- }
266565
- if (prevProps.initialTextColor !== initialTextColor) {
266566
- setTextColor(initialTextColor);
266567
- prevPropsRef.current.initialTextColor = initialTextColor;
266568
- }
266569
- }, [initialPenSize, initialPenColor, initialLaserPenSize, initialLaserPenColor, initialShapeSize, initialShapeType, initialShapeColor, initialTextSize, initialTextColor]);
266570
266569
  const handleToolClick = (tool) => {
266571
266570
  setSelectedTool(tool);
266572
266571
  onToolClick(tool);
266573
266572
  };
266574
- const handlePenSizeChange = (size) => {
266575
- setPenSize(size);
266576
- if (onPenSizeChange)
266577
- onPenSizeChange(size);
266578
- setTimeout(() => onToolClick(2));
266579
- };
266580
- const handlePenColorChange = (color) => {
266581
- setPenColor(color);
266582
- if (onPenColorChange)
266583
- onPenColorChange(color);
266584
- setTimeout(() => onToolClick(2));
266585
- };
266586
- const handleLaserPenSizeChange = (size) => {
266587
- setLaserPenSize(size);
266588
- if (onLaserPenSizeChange)
266589
- onLaserPenSizeChange(size);
266590
- setTimeout(() => onToolClick(3));
266591
- };
266592
- const handleLaserPenColorChange = (color) => {
266593
- setLaserPenColor(color);
266594
- if (onLaserPenColorChange)
266595
- onLaserPenColorChange(color);
266596
- setTimeout(() => onToolClick(3));
266597
- };
266598
- const handleShapeSizeChange = (size) => {
266599
- setShapeSize(size);
266600
- if (onShapeSizeChange)
266601
- onShapeSizeChange(size);
266602
- setTimeout(() => onToolClick(4));
266603
- };
266604
- const handleShapeTypeChange = (type4) => {
266605
- setShapeType(type4);
266606
- if (onShapeTypeChange)
266607
- onShapeTypeChange(type4);
266608
- setTimeout(() => onToolClick(4));
266609
- };
266610
- const handleShapeColorChange = (color) => {
266611
- setShapeColor(color);
266612
- if (onShapeColorChange)
266613
- onShapeColorChange(color);
266614
- setTimeout(() => onToolClick(4));
266615
- };
266616
- const handleTextSizeChange = (size) => {
266617
- setTextSize(size);
266618
- if (onTextSizeChange)
266619
- onTextSizeChange(size);
266620
- setTimeout(() => onToolClick(5));
266621
- };
266622
- const handleTextColorChange = (color) => {
266623
- setTextColor(color);
266624
- if (onTextColorChange)
266625
- onTextColorChange(color);
266626
- setTimeout(() => onToolClick(5));
266627
- };
266573
+ const handleToolSettingChange = (setter, toolId) => (value) => {
266574
+ setter(value);
266575
+ setTimeout(() => onToolClick(toolId));
266576
+ };
266577
+ const handlePenSizeChange = handleToolSettingChange(setPenSize, TOOL_IDS.PEN);
266578
+ const handlePenColorChange = handleToolSettingChange(setPenColor, TOOL_IDS.PEN);
266579
+ const handleLaserPenSizeChange = handleToolSettingChange(setLaserPenSize, TOOL_IDS.LASER_PEN);
266580
+ const handleLaserPenColorChange = handleToolSettingChange(setLaserPenColor, TOOL_IDS.LASER_PEN);
266581
+ const handleShapeSizeChange = handleToolSettingChange(setShapeSize, TOOL_IDS.SHAPE);
266582
+ const handleShapeTypeChange = handleToolSettingChange(setShapeType, TOOL_IDS.SHAPE);
266583
+ const handleShapeColorChange = handleToolSettingChange(setShapeColor, TOOL_IDS.SHAPE);
266584
+ const handleTextSizeChange = handleToolSettingChange(setTextSize, TOOL_IDS.TEXT);
266585
+ const handleTextColorChange = handleToolSettingChange(setTextColor, TOOL_IDS.TEXT);
266628
266586
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
266629
266587
  className: "flex items-center",
266630
266588
  children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Space, {
@@ -266635,10 +266593,10 @@ const DrawingToolbar = ({
266635
266593
  children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
266636
266594
  className: "w-32px h-32px flex justify-center items-center cursor-pointer hover:bg-#12151a",
266637
266595
  style: {
266638
- background: selectedTool === 1 ? "#12151a" : "",
266639
- color: selectedTool === 1 ? "#6672fc" : "#fff"
266596
+ background: selectedTool === TOOL_IDS.SELECT ? "#12151a" : "",
266597
+ color: selectedTool === TOOL_IDS.SELECT ? "#6672fc" : "#fff"
266640
266598
  },
266641
- onClick: () => handleToolClick(1),
266599
+ onClick: () => handleToolClick(TOOL_IDS.SELECT),
266642
266600
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(SvgGuideO, {
266643
266601
  className: "text-24px"
266644
266602
  })
@@ -266648,11 +266606,11 @@ const DrawingToolbar = ({
266648
266606
  optionContent: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
266649
266607
  className: "w-260px py-4 px-3 flex flex-col justify-between",
266650
266608
  children: [/* @__PURE__ */ jsxRuntimeExports.jsx(SizePicker, {
266651
- sizes: [2, 4, 6],
266609
+ sizes: LINE_SIZES,
266652
266610
  selectedSize: penSize,
266653
266611
  onSizeChange: handlePenSizeChange
266654
266612
  }), /* @__PURE__ */ jsxRuntimeExports.jsx(ColorPicker, {
266655
- colors: ["#ff5a5a", "#ffbf48", "#3a9bff", "#58efb8", "#000000", "#808080", "#ffffff"],
266613
+ colors: COLORS,
266656
266614
  selectedColor: penColor,
266657
266615
  onColorChange: handlePenColorChange
266658
266616
  })]
@@ -266664,10 +266622,10 @@ const DrawingToolbar = ({
266664
266622
  children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
266665
266623
  className: "w-32px h-32px flex justify-center items-center cursor-pointer hover:bg-#12151a",
266666
266624
  style: {
266667
- background: selectedTool === 2 ? "#12151a" : "",
266668
- color: selectedTool === 2 ? "#6672fc" : "#fff"
266625
+ background: selectedTool === TOOL_IDS.PEN ? "#12151a" : "",
266626
+ color: selectedTool === TOOL_IDS.PEN ? "#6672fc" : "#fff"
266669
266627
  },
266670
- onClick: () => handleToolClick(2),
266628
+ onClick: () => handleToolClick(TOOL_IDS.PEN),
266671
266629
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(SvgEdit, {
266672
266630
  className: "text-18px"
266673
266631
  })
@@ -266678,11 +266636,11 @@ const DrawingToolbar = ({
266678
266636
  optionContent: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
266679
266637
  className: "w-260px py-4 px-3 flex flex-col justify-between",
266680
266638
  children: [/* @__PURE__ */ jsxRuntimeExports.jsx(SizePicker, {
266681
- sizes: [2, 4, 6],
266639
+ sizes: LINE_SIZES,
266682
266640
  selectedSize: laserPenSize,
266683
266641
  onSizeChange: handleLaserPenSizeChange
266684
266642
  }), /* @__PURE__ */ jsxRuntimeExports.jsx(ColorPicker, {
266685
- colors: ["#ff5a5a", "#ffbf48", "#3a9bff", "#58efb8", "#000000", "#808080", "#ffffff"],
266643
+ colors: COLORS,
266686
266644
  selectedColor: laserPenColor,
266687
266645
  onColorChange: handleLaserPenColorChange
266688
266646
  })]
@@ -266694,10 +266652,10 @@ const DrawingToolbar = ({
266694
266652
  children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
266695
266653
  className: "w-32px h-32px flex justify-center items-center cursor-pointer hover:bg-#12151a",
266696
266654
  style: {
266697
- background: selectedTool === 3 ? "#12151a" : "",
266698
- color: selectedTool === 3 ? "#6672fc" : "#fff"
266655
+ background: selectedTool === TOOL_IDS.LASER_PEN ? "#12151a" : "",
266656
+ color: selectedTool === TOOL_IDS.LASER_PEN ? "#6672fc" : "#fff"
266699
266657
  },
266700
- onClick: () => handleToolClick(3),
266658
+ onClick: () => handleToolClick(TOOL_IDS.LASER_PEN),
266701
266659
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$r, {
266702
266660
  className: "text-18px"
266703
266661
  })
@@ -266712,7 +266670,7 @@ const DrawingToolbar = ({
266712
266670
  marginBottom: 10
266713
266671
  },
266714
266672
  children: [/* @__PURE__ */ jsxRuntimeExports.jsx(SizePicker, {
266715
- sizes: [2, 4, 6],
266673
+ sizes: LINE_SIZES,
266716
266674
  selectedSize: shapeSize,
266717
266675
  onSizeChange: handleShapeSizeChange
266718
266676
  }), /* @__PURE__ */ jsxRuntimeExports.jsx(ShapeTypePicker, {
@@ -266721,7 +266679,7 @@ const DrawingToolbar = ({
266721
266679
  onTypeChange: handleShapeTypeChange
266722
266680
  })]
266723
266681
  }), /* @__PURE__ */ jsxRuntimeExports.jsx(ColorPicker, {
266724
- colors: ["#ff5a5a", "#ffbf48", "#3a9bff", "#58efb8", "#000000", "#808080", "#ffffff"],
266682
+ colors: COLORS,
266725
266683
  selectedColor: shapeColor,
266726
266684
  onColorChange: handleShapeColorChange
266727
266685
  })]
@@ -266733,10 +266691,10 @@ const DrawingToolbar = ({
266733
266691
  children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
266734
266692
  className: "w-32px h-32px flex justify-center items-center cursor-pointer hover:bg-#12151a",
266735
266693
  style: {
266736
- background: selectedTool === 4 ? "#12151a" : "",
266737
- color: selectedTool === 4 ? "#6672fc" : "#fff"
266694
+ background: selectedTool === TOOL_IDS.SHAPE ? "#12151a" : "",
266695
+ color: selectedTool === TOOL_IDS.SHAPE ? "#6672fc" : "#fff"
266738
266696
  },
266739
- onClick: () => handleToolClick(4),
266697
+ onClick: () => handleToolClick(TOOL_IDS.SHAPE),
266740
266698
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$p, {
266741
266699
  className: "text-18px"
266742
266700
  })
@@ -266747,11 +266705,11 @@ const DrawingToolbar = ({
266747
266705
  optionContent: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
266748
266706
  className: "w-260px py-4 px-3 flex flex-col justify-between",
266749
266707
  children: [/* @__PURE__ */ jsxRuntimeExports.jsx(TextSizePicker, {
266750
- sizes: [16, 20, 24, 28, 32],
266708
+ sizes: TEXT_SIZES,
266751
266709
  selectedSize: textSize,
266752
266710
  onSizeChange: handleTextSizeChange
266753
266711
  }), /* @__PURE__ */ jsxRuntimeExports.jsx(ColorPicker, {
266754
- colors: ["#ff5a5a", "#ffbf48", "#3a9bff", "#58efb8", "#000000", "#808080", "#ffffff"],
266712
+ colors: COLORS,
266755
266713
  selectedColor: textColor,
266756
266714
  onColorChange: handleTextColorChange
266757
266715
  })]
@@ -266763,10 +266721,10 @@ const DrawingToolbar = ({
266763
266721
  children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
266764
266722
  className: "w-32px h-32px flex justify-center items-center cursor-pointer hover:bg-#12151a",
266765
266723
  style: {
266766
- background: selectedTool === 5 ? "#12151a" : "",
266767
- color: selectedTool === 5 ? "#6672fc" : "#fff"
266724
+ background: selectedTool === TOOL_IDS.TEXT ? "#12151a" : "",
266725
+ color: selectedTool === TOOL_IDS.TEXT ? "#6672fc" : "#fff"
266768
266726
  },
266769
- onClick: () => handleToolClick(5),
266727
+ onClick: () => handleToolClick(TOOL_IDS.TEXT),
266770
266728
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$e, {
266771
266729
  className: "text-18px"
266772
266730
  })
@@ -266984,14 +266942,11 @@ const LivePlayer = ({
266984
266942
  callUsers: state.callUsers,
266985
266943
  toggleRightSidebar: state.toggleRightSidebar
266986
266944
  }));
266987
- useSdkStore((state) => state.callConfig.el);
266988
266945
  const canvasRef = reactExports.useRef(null);
266989
266946
  const canvasContainerRef = reactExports.useRef(null);
266990
266947
  const streamRef = reactExports.useRef(null);
266991
266948
  const streamContainerRef = reactExports.useRef(null);
266992
266949
  const {
266993
- // 工具选择
266994
- selectedTool,
266995
266950
  setSelectedTool,
266996
266951
  // 绘图相关引用
266997
266952
  downPoint,
@@ -266999,37 +266954,37 @@ const LivePlayer = ({
266999
266954
  currentShape,
267000
266955
  // 形状设置
267001
266956
  shapeType,
267002
- setShapeType,
267003
- shapeTypeRef,
267004
266957
  shapeColor,
267005
- setShapeColor,
267006
- shapeColorRef,
267007
266958
  shapeSize,
267008
- setShapeSize,
267009
- shapeSizeRef,
267010
266959
  // 画笔设置
267011
266960
  penColor,
267012
- setPenColor,
267013
- penColorRef,
267014
266961
  penSize,
267015
- setPenSize,
267016
- penSizeRef,
267017
266962
  // 激光笔设置
267018
266963
  laserPenColor,
267019
- setLaserPenColor,
267020
- laserPenColorRef,
267021
266964
  laserPenSize,
267022
- setLaserPenSize,
267023
- laserPenSizeRef,
267024
266965
  // 文字设置
267025
266966
  textColor,
267026
- setTextColor,
267027
- textColorRef,
267028
266967
  textSize,
267029
- setTextSize,
267030
- textSizeRef,
267031
- setIsPreviewModalVisible
267032
- } = useDrawingToolsStore();
266968
+ // 预览弹窗状态
266969
+ setIsPreviewModalVisible,
266970
+ getter: getDrawing
266971
+ } = useDrawingToolsStore((state) => ({
266972
+ setSelectedTool: state.setSelectedTool,
266973
+ downPoint: state.downPoint,
266974
+ upPoint: state.upPoint,
266975
+ currentShape: state.currentShape,
266976
+ shapeType: state.shapeType,
266977
+ shapeColor: state.shapeColor,
266978
+ shapeSize: state.shapeSize,
266979
+ penColor: state.penColor,
266980
+ penSize: state.penSize,
266981
+ laserPenColor: state.laserPenColor,
266982
+ laserPenSize: state.laserPenSize,
266983
+ textColor: state.textColor,
266984
+ textSize: state.textSize,
266985
+ getter: state.getter,
266986
+ setIsPreviewModalVisible: state.setIsPreviewModalVisible
266987
+ }));
267033
266988
  const canvasSettingRef = reactExports.useRef("horizontal");
267034
266989
  const worker = reactExports.useRef(null);
267035
266990
  const isWorkerRunning = reactExports.useRef(false);
@@ -267566,9 +267521,9 @@ const LivePlayer = ({
267566
267521
  };
267567
267522
  const drawShapeMouseDown = (e3) => {
267568
267523
  downPoint.current = e3.absolutePointer;
267569
- const shapeType2 = shapeTypeRef.current;
267570
- const shapeColor2 = shapeColorRef.current;
267571
- const shapeSize2 = shapeSizeRef.current;
267524
+ const shapeType2 = getDrawing().shapeType;
267525
+ const shapeColor2 = getDrawing().shapeColor;
267526
+ const shapeSize2 = getDrawing().shapeSize;
267572
267527
  if (shapeType2 === "circle" || shapeType2 === "rect") {
267573
267528
  currentShape.current = shapeType2 === "circle" ? new xo({
267574
267529
  left: downPoint.current.x,
@@ -267596,7 +267551,7 @@ const LivePlayer = ({
267596
267551
  const drawShapeMouseMove = (e3) => {
267597
267552
  if (!currentShape.current)
267598
267553
  return;
267599
- const shapeType2 = shapeTypeRef.current;
267554
+ const shapeType2 = getDrawing().shapeType;
267600
267555
  const currentPoint = e3.absolutePointer;
267601
267556
  const dx = currentPoint.x - downPoint.current.x;
267602
267557
  const dy = currentPoint.y - downPoint.current.y;
@@ -267630,7 +267585,7 @@ const LivePlayer = ({
267630
267585
  canvasRequestRenderAll();
267631
267586
  };
267632
267587
  const drawShareMouseUp = () => {
267633
- const shapeColor2 = shapeColorRef.current;
267588
+ const shapeColor2 = getDrawing().shapeColor;
267634
267589
  if (currentShape.current) {
267635
267590
  if (JSON.stringify(downPoint.current) === JSON.stringify(upPoint.current)) {
267636
267591
  return;
@@ -267645,8 +267600,8 @@ const LivePlayer = ({
267645
267600
  const drawTextMouseDown = (e3) => {
267646
267601
  var _a3;
267647
267602
  const pointer = (_a3 = getter().fabricInstance) == null ? void 0 : _a3.getPointer(e3.e);
267648
- const textColor2 = textColorRef.current;
267649
- const textSize2 = textSizeRef.current;
267603
+ const textColor2 = getDrawing().textColor;
267604
+ const textSize2 = getDrawing().textSize;
267650
267605
  if (pointer) {
267651
267606
  const {
267652
267607
  x,
@@ -267667,8 +267622,8 @@ const LivePlayer = ({
267667
267622
  };
267668
267623
  const enablePenDrawing = () => {
267669
267624
  const canvas = getter().fabricInstance;
267670
- const penColor2 = penColorRef.current;
267671
- const penSize2 = penSizeRef.current;
267625
+ const penColor2 = getDrawing().penColor;
267626
+ const penSize2 = getDrawing().penSize;
267672
267627
  const pencilBrush = new oo(canvas);
267673
267628
  pencilBrush.color = penColor2;
267674
267629
  pencilBrush.width = penSize2;
@@ -267679,8 +267634,8 @@ const LivePlayer = ({
267679
267634
  };
267680
267635
  const enableLaserPenDrawing = () => {
267681
267636
  const canvas = getter().fabricInstance;
267682
- const laserPenColor2 = laserPenColorRef.current;
267683
- const laserPenSize2 = laserPenSizeRef.current;
267637
+ const laserPenColor2 = getDrawing().laserPenColor;
267638
+ const laserPenSize2 = getDrawing().laserPenSize;
267684
267639
  const pencilBrush = new oo(canvas);
267685
267640
  pencilBrush.color = laserPenColor2;
267686
267641
  pencilBrush.width = laserPenSize2;
@@ -268756,7 +268711,7 @@ const LivePlayer = ({
268756
268711
  let queenEngine;
268757
268712
  if (cameraType === 1) {
268758
268713
  queenEngine = new d$3();
268759
- queenEngine.init(envConfig.queenSdkKey, function() {
268714
+ queenEngine.init(envConfig$1.queenSdkKey, function() {
268760
268715
  console.log("初始化完成");
268761
268716
  const {
268762
268717
  isSkinBuffing,
@@ -269182,28 +269137,9 @@ const LivePlayer = ({
269182
269137
  children: [isMainRole && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
269183
269138
  className: " flex items-center justify-center h-48px gap-5 bg-#222933",
269184
269139
  children: [/* @__PURE__ */ jsxRuntimeExports.jsx(DrawingToolbar, {
269185
- selectedTool,
269186
269140
  onToolClick: clickTool,
269187
269141
  onClearCanvas: clearCanvas,
269188
- onPreviewClick: () => setIsPreviewModalVisible(true),
269189
- initialPenSize: penSize,
269190
- initialPenColor: penColor,
269191
- initialLaserPenSize: laserPenSize,
269192
- initialLaserPenColor: laserPenColor,
269193
- initialShapeSize: shapeSize,
269194
- initialShapeType: shapeType,
269195
- initialShapeColor: shapeColor,
269196
- initialTextSize: textSize,
269197
- initialTextColor: textColor,
269198
- onPenSizeChange: setPenSize,
269199
- onPenColorChange: setPenColor,
269200
- onLaserPenSizeChange: setLaserPenSize,
269201
- onLaserPenColorChange: setLaserPenColor,
269202
- onShapeSizeChange: setShapeSize,
269203
- onShapeTypeChange: setShapeType,
269204
- onShapeColorChange: setShapeColor,
269205
- onTextSizeChange: setTextSize,
269206
- onTextColorChange: setTextColor
269142
+ onPreviewClick: () => setIsPreviewModalVisible(true)
269207
269143
  }), callConfig.isCall && /* @__PURE__ */ jsxRuntimeExports.jsx(LayoutSwitcher, {
269208
269144
  className: "absolute right-10",
269209
269145
  currentLayout: layoutMode,
@@ -269363,9 +269299,8 @@ const InviteGuestModal = ({
269363
269299
  const [open2, setOpen] = reactExports.useState(false);
269364
269300
  const isModalOpen = externalIsOpen !== void 0 ? externalIsOpen : open2;
269365
269301
  const handleClose = externalOnClose || (() => setOpen(false));
269366
- const inviteLink = (call2 == null ? void 0 : call2.enabled) ? (call2 == null ? void 0 : call2.inviteLink) || "" : "";
269367
269302
  const copyText = `直播名称: ${data2 == null ? void 0 : data2.title}
269368
- 加入链接: ${inviteLink}
269303
+ 加入链接: ${call2 == null ? void 0 : call2.inviteLink}
269369
269304
  加入密码: ${callConfig.password}`;
269370
269305
  const copyInviteLink = () => {
269371
269306
  navigator.clipboard.writeText(copyText).then(() => {
@@ -269417,7 +269352,7 @@ const InviteGuestModal = ({
269417
269352
  centered: true,
269418
269353
  children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
269419
269354
  className: styles.inviteContainer,
269420
- children: [/* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
269355
+ children: [(call2 == null ? void 0 : call2.inviteLink) && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
269421
269356
  className: styles.inviteSection,
269422
269357
  children: [/* @__PURE__ */ jsxRuntimeExports.jsx("div", {
269423
269358
  className: styles.sectionLabel,
@@ -269425,7 +269360,7 @@ const InviteGuestModal = ({
269425
269360
  }), /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
269426
269361
  className: styles.inputGroup,
269427
269362
  children: [/* @__PURE__ */ jsxRuntimeExports.jsx(Input, {
269428
- value: inviteLink,
269363
+ value: call2 == null ? void 0 : call2.inviteLink,
269429
269364
  readOnly: true,
269430
269365
  className: styles.inviteInput
269431
269366
  }), /* @__PURE__ */ jsxRuntimeExports.jsx(Button$1, {
@@ -280136,6 +280071,618 @@ let ErrorBoundary$1 = class ErrorBoundary extends reactExports.Component {
280136
280071
  return this.props.children;
280137
280072
  }
280138
280073
  };
280074
+ const AudioVisualizer = reactExports.memo(
280075
+ ({ selectedMicrophone, isVisible: isVisible3, onVolumeLevelsChange }) => {
280076
+ const [audioContext, setAudioContext] = reactExports.useState(null);
280077
+ const [analyser, setAnalyser] = reactExports.useState(null);
280078
+ const [microphoneStream, setMicrophoneStream] = reactExports.useState(null);
280079
+ const [volumeLevels, setVolumeLevels] = reactExports.useState(Array(12).fill(0));
280080
+ const animationFrameRef = reactExports.useRef(null);
280081
+ const canvasRef = reactExports.useRef(null);
280082
+ const microphoneStreamRef = reactExports.useRef(microphoneStream);
280083
+ const audioContextRef = reactExports.useRef(audioContext);
280084
+ const analyserRef = reactExports.useRef(analyser);
280085
+ reactExports.useEffect(() => {
280086
+ microphoneStreamRef.current = microphoneStream;
280087
+ audioContextRef.current = audioContext;
280088
+ analyserRef.current = analyser;
280089
+ }, [microphoneStream, audioContext, analyser]);
280090
+ const cleanupMediaResources = reactExports.useCallback(() => {
280091
+ if (animationFrameRef.current) {
280092
+ cancelAnimationFrame(animationFrameRef.current);
280093
+ animationFrameRef.current = null;
280094
+ }
280095
+ if (microphoneStreamRef.current) {
280096
+ microphoneStreamRef.current.getTracks().forEach((track) => track.stop());
280097
+ setMicrophoneStream(null);
280098
+ }
280099
+ if (audioContextRef.current) {
280100
+ audioContextRef.current.close().catch((err2) => console.error("关闭音频上下文失败:", err2));
280101
+ setAudioContext(null);
280102
+ setAnalyser(null);
280103
+ }
280104
+ }, []);
280105
+ reactExports.useEffect(() => {
280106
+ if (onVolumeLevelsChange) {
280107
+ onVolumeLevelsChange(volumeLevels);
280108
+ }
280109
+ }, [volumeLevels, onVolumeLevelsChange]);
280110
+ reactExports.useEffect(() => {
280111
+ if (isVisible3 && selectedMicrophone) {
280112
+ const context = new (window.AudioContext || window.webkitAudioContext)();
280113
+ setAudioContext(context);
280114
+ const audioAnalyser = context.createAnalyser();
280115
+ audioAnalyser.fftSize = 2048;
280116
+ setAnalyser(audioAnalyser);
280117
+ navigator.mediaDevices.getUserMedia({
280118
+ audio: {
280119
+ deviceId: selectedMicrophone ? { exact: selectedMicrophone } : void 0
280120
+ }
280121
+ }).then((stream) => {
280122
+ setMicrophoneStream(stream);
280123
+ const source = context.createMediaStreamSource(stream);
280124
+ source.connect(audioAnalyser);
280125
+ const canvas = canvasRef.current;
280126
+ const canvasCtx = canvas == null ? void 0 : canvas.getContext("2d");
280127
+ const frequencyDataArray = new Uint8Array(audioAnalyser.frequencyBinCount);
280128
+ const timeDataArray = new Uint8Array(audioAnalyser.frequencyBinCount);
280129
+ const analyzeVolume = () => {
280130
+ audioAnalyser.getByteFrequencyData(frequencyDataArray);
280131
+ audioAnalyser.getByteTimeDomainData(timeDataArray);
280132
+ if (canvasCtx && canvas) {
280133
+ canvasCtx.clearRect(0, 0, canvas.width, canvas.height);
280134
+ canvasCtx.lineWidth = 2;
280135
+ canvasCtx.strokeStyle = "#2196F3";
280136
+ canvasCtx.beginPath();
280137
+ const sliceWidth = canvas.width / timeDataArray.length;
280138
+ let x = 0;
280139
+ for (let i = 0; i < timeDataArray.length; i++) {
280140
+ const v3 = timeDataArray[i] / 128;
280141
+ const y3 = v3 * canvas.height / 2;
280142
+ if (i === 0) {
280143
+ canvasCtx.moveTo(x, y3);
280144
+ } else {
280145
+ canvasCtx.lineTo(x, y3);
280146
+ }
280147
+ x += sliceWidth;
280148
+ }
280149
+ canvasCtx.lineTo(canvas.width, canvas.height / 2);
280150
+ canvasCtx.stroke();
280151
+ }
280152
+ const segmentSize = Math.floor(frequencyDataArray.length / 12);
280153
+ const normalizedLevels = Array(12).fill(0).map((_2, index2) => {
280154
+ const start2 = index2 * segmentSize;
280155
+ const end2 = start2 + segmentSize;
280156
+ const segmentAvg = frequencyDataArray.slice(start2, end2).reduce((sum2, value) => sum2 + value, 0) / segmentSize;
280157
+ return Math.min(1, Math.pow(segmentAvg / 255, 0.8));
280158
+ });
280159
+ setVolumeLevels(normalizedLevels);
280160
+ animationFrameRef.current = requestAnimationFrame(analyzeVolume);
280161
+ };
280162
+ analyzeVolume();
280163
+ }).catch((err2) => {
280164
+ console.error("获取麦克风失败:", err2);
280165
+ const interval = setInterval(() => {
280166
+ const newLevels = Array(12).fill(0).map(() => Math.random());
280167
+ setVolumeLevels(newLevels);
280168
+ }, 200);
280169
+ return () => clearInterval(interval);
280170
+ });
280171
+ return cleanupMediaResources;
280172
+ }
280173
+ }, [isVisible3, selectedMicrophone, cleanupMediaResources]);
280174
+ reactExports.useEffect(() => {
280175
+ return () => {
280176
+ cleanupMediaResources();
280177
+ };
280178
+ }, [cleanupMediaResources]);
280179
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-col space-y-4", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: " h-24 bg-gray-50 rounded border border-gray-200", children: /* @__PURE__ */ jsxRuntimeExports.jsx("canvas", { ref: canvasRef, className: " h-full", width: "400", height: "100" }) }) });
280180
+ }
280181
+ );
280182
+ AudioVisualizer.displayName = "AudioVisualizer";
280183
+ class MediaErrorBoundary extends reactExports.Component {
280184
+ constructor(props) {
280185
+ super(props);
280186
+ this.state = {
280187
+ hasError: false,
280188
+ errorMessage: ""
280189
+ };
280190
+ }
280191
+ static getDerivedStateFromError(error2) {
280192
+ return {
280193
+ hasError: true,
280194
+ errorMessage: error2.message
280195
+ };
280196
+ }
280197
+ componentDidCatch(error2, errorInfo) {
280198
+ console.error("媒体设备错误:", error2, errorInfo);
280199
+ }
280200
+ render() {
280201
+ if (this.state.hasError) {
280202
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
280203
+ className: "p-4 border border-red-300 rounded bg-red-50",
280204
+ children: [/* @__PURE__ */ jsxRuntimeExports.jsx(Alert, {
280205
+ message: "媒体设备错误",
280206
+ description: `无法访问媒体设备: ${this.state.errorMessage}。请检查设备权限或连接。`,
280207
+ type: "error",
280208
+ showIcon: true,
280209
+ icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon, {})
280210
+ }), /* @__PURE__ */ jsxRuntimeExports.jsx(Button$1, {
280211
+ type: "primary",
280212
+ className: "mt-4",
280213
+ onClick: () => this.setState({
280214
+ hasError: false,
280215
+ errorMessage: ""
280216
+ }),
280217
+ children: "重试"
280218
+ })]
280219
+ });
280220
+ }
280221
+ return this.props.children;
280222
+ }
280223
+ }
280224
+ const MediaSettings = () => {
280225
+ const {
280226
+ callCurrentUser,
280227
+ toggleVideo,
280228
+ rtc,
280229
+ getter
280230
+ } = useCallStore();
280231
+ const [isModalVisible, setIsModalVisible] = reactExports.useState(false);
280232
+ const [mirrorEnabled, setMirrorEnabled] = reactExports.useState(true);
280233
+ const [cameraDevices, setCameraDevices] = reactExports.useState([]);
280234
+ const [microphoneDevices, setMicrophoneDevices] = reactExports.useState([]);
280235
+ const [selectedCamera, setSelectedCamera] = reactExports.useState("");
280236
+ const [selectedMicrophone, setSelectedMicrophone] = reactExports.useState("");
280237
+ const [beautySettings, setBeautySettings] = reactExports.useState({
280238
+ enabled: false,
280239
+ whiteIntensity: 0.5,
280240
+ smoothIntensity: 0.5,
280241
+ sharpenIntensity: 0.5
280242
+ });
280243
+ const [beautyExtension, setBeautyExtension] = reactExports.useState(null);
280244
+ const [beautyCompatible, setBeautyCompatible] = reactExports.useState(false);
280245
+ console.log("beautyCompatible", beautyCompatible);
280246
+ const [beautyInitialized, setBeautyInitialized] = reactExports.useState(false);
280247
+ const getDevices = reactExports.useCallback(async () => {
280248
+ try {
280249
+ if (!navigator.mediaDevices || !navigator.mediaDevices.enumerateDevices) {
280250
+ console.error("浏览器不支持获取媒体设备列表");
280251
+ staticMethods.error("您的浏览器不支持媒体设备选择功能");
280252
+ return;
280253
+ }
280254
+ await navigator.mediaDevices.getUserMedia({
280255
+ audio: true,
280256
+ video: true
280257
+ }).catch((err2) => console.error("获取媒体权限失败:", err2));
280258
+ const devices = await navigator.mediaDevices.enumerateDevices();
280259
+ const cameras = devices.filter((device) => device.kind === "videoinput").map((device) => ({
280260
+ id: device.deviceId,
280261
+ label: device.label || `摄像头 ${device.deviceId.slice(0, 5)}...`
280262
+ }));
280263
+ const microphones = devices.filter((device) => device.kind === "audioinput").map((device) => ({
280264
+ id: device.deviceId,
280265
+ label: device.label || `麦克风 ${device.deviceId.slice(0, 5)}...`
280266
+ }));
280267
+ if (cameras.length > 0) {
280268
+ setCameraDevices(cameras);
280269
+ setSelectedCamera((prevCamera) => {
280270
+ return cameras.find((cam) => cam.id === prevCamera) ? prevCamera : cameras[0].id;
280271
+ });
280272
+ }
280273
+ if (microphones.length > 0) {
280274
+ setMicrophoneDevices(microphones);
280275
+ setSelectedMicrophone((prevMic) => {
280276
+ return microphones.find((mic) => mic.id === prevMic) ? prevMic : microphones[0].id;
280277
+ });
280278
+ }
280279
+ } catch (error2) {
280280
+ console.error("获取设备列表失败:", error2);
280281
+ staticMethods.error("获取媒体设备失败,请检查设备权限");
280282
+ setCameraDevices([{
280283
+ id: "default",
280284
+ label: "默认摄像头"
280285
+ }]);
280286
+ setMicrophoneDevices([{
280287
+ id: "default",
280288
+ label: "默认麦克风"
280289
+ }]);
280290
+ }
280291
+ }, []);
280292
+ reactExports.useEffect(() => {
280293
+ if (isModalVisible) {
280294
+ getDevices();
280295
+ }
280296
+ if (navigator.mediaDevices) {
280297
+ navigator.mediaDevices.addEventListener("devicechange", getDevices);
280298
+ return () => {
280299
+ navigator.mediaDevices.removeEventListener("devicechange", getDevices);
280300
+ };
280301
+ }
280302
+ }, [getDevices, isModalVisible]);
280303
+ reactExports.useEffect(() => {
280304
+ if (isModalVisible && !beautyInitialized) {
280305
+ initializeBeautyExtension();
280306
+ }
280307
+ }, [isModalVisible, beautyInitialized]);
280308
+ const initializeBeautyExtension = reactExports.useCallback(async () => {
280309
+ try {
280310
+ const rtcInstance = getter().rtc;
280311
+ if (rtcInstance && rtcInstance.beautyExtension) {
280312
+ const extension = rtcInstance.beautyExtension;
280313
+ const compatibilityResult = await extension.checkCompatibility();
280314
+ console.log("浏览器兼容性检查结果:", compatibilityResult);
280315
+ if (compatibilityResult.isCompatible) {
280316
+ setBeautyExtension(extension);
280317
+ setBeautyCompatible(true);
280318
+ setBeautyInitialized(true);
280319
+ console.log("美颜扩展初始化成功");
280320
+ } else {
280321
+ console.warn("浏览器不支持美颜功能:", compatibilityResult.message || "兼容性检查失败");
280322
+ setBeautyCompatible(false);
280323
+ staticMethods.warning("您的浏览器不支持美颜功能,请使用 Chrome 78+ 或其他兼容浏览器");
280324
+ }
280325
+ } else {
280326
+ console.warn("RTC客户端或美颜扩展未初始化");
280327
+ setBeautyCompatible(false);
280328
+ staticMethods.warning("RTC客户端未初始化,无法使用美颜功能");
280329
+ }
280330
+ } catch (error2) {
280331
+ console.error("美颜扩展初始化失败:", error2);
280332
+ setBeautyCompatible(false);
280333
+ staticMethods.error("美颜功能初始化失败");
280334
+ }
280335
+ }, [rtc]);
280336
+ const handleBeautyToggle = reactExports.useCallback((enabled) => {
280337
+ if (!beautyExtension || !beautyCompatible) {
280338
+ staticMethods.warning("美颜功能不可用");
280339
+ return;
280340
+ }
280341
+ try {
280342
+ if (enabled) {
280343
+ beautyExtension.enableBeauty();
280344
+ console.log("美颜已开启");
280345
+ } else {
280346
+ beautyExtension.disableBeauty();
280347
+ console.log("美颜已关闭");
280348
+ }
280349
+ setBeautySettings((prev2) => ({
280350
+ ...prev2,
280351
+ enabled
280352
+ }));
280353
+ } catch (error2) {
280354
+ console.error("美颜开关操作失败:", error2);
280355
+ staticMethods.error("美颜开关操作失败");
280356
+ }
280357
+ }, [beautyExtension, beautyCompatible]);
280358
+ const handleBeautyIntensityChange = reactExports.useCallback(
280359
+ debounce$6((type4, value) => {
280360
+ if (!beautyExtension || !beautyCompatible) {
280361
+ return;
280362
+ }
280363
+ try {
280364
+ let mode;
280365
+ let settingKey;
280366
+ switch (type4) {
280367
+ case "white":
280368
+ mode = EffectBeautyMode.EFFECT_WHITE_MODE;
280369
+ settingKey = "whiteIntensity";
280370
+ break;
280371
+ case "smooth":
280372
+ mode = EffectBeautyMode.EFFECT_SMOOTH_MODE;
280373
+ settingKey = "smoothIntensity";
280374
+ break;
280375
+ case "sharpen":
280376
+ mode = EffectBeautyMode.EFFECT_SHARPEN_MODE;
280377
+ settingKey = "sharpenIntensity";
280378
+ break;
280379
+ default:
280380
+ return;
280381
+ }
280382
+ beautyExtension.setBeautyIntensity(mode, value);
280383
+ setBeautySettings((prev2) => ({
280384
+ ...prev2,
280385
+ [settingKey]: value
280386
+ }));
280387
+ console.log(`${type4} 强度已设置为:`, value);
280388
+ } catch (error2) {
280389
+ console.error("美颜强度设置失败:", error2);
280390
+ staticMethods.error("美颜强度设置失败");
280391
+ }
280392
+ }, 300),
280393
+ // 300ms 防抖延迟
280394
+ [beautyExtension, beautyCompatible]
280395
+ );
280396
+ reactExports.useEffect(() => {
280397
+ const savedBeautySettings = localStorage.getItem("beautySettings");
280398
+ if (savedBeautySettings) {
280399
+ try {
280400
+ const parsed = JSON.parse(savedBeautySettings);
280401
+ setBeautySettings(parsed);
280402
+ } catch (error2) {
280403
+ console.error("加载美颜设置失败:", error2);
280404
+ }
280405
+ }
280406
+ }, []);
280407
+ reactExports.useEffect(() => {
280408
+ localStorage.setItem("beautySettings", JSON.stringify(beautySettings));
280409
+ }, [beautySettings]);
280410
+ const handleCameraChange = reactExports.useCallback(async (newCameraId) => {
280411
+ setSelectedCamera(newCameraId);
280412
+ try {
280413
+ const rtcInstance = getter().rtc;
280414
+ if (rtcInstance && rtcInstance.setMediaDevices) {
280415
+ const result = await rtcInstance.setMediaDevices({
280416
+ cameraId: newCameraId,
280417
+ mirrorEnabled
280418
+ });
280419
+ if (result.success) {
280420
+ console.log("摄像头设备已切换:", newCameraId);
280421
+ } else {
280422
+ console.error("摄像头切换失败:", result.message);
280423
+ staticMethods.error("摄像头切换失败");
280424
+ }
280425
+ }
280426
+ } catch (error2) {
280427
+ console.error("摄像头配置失败:", error2);
280428
+ staticMethods.error("摄像头配置失败");
280429
+ }
280430
+ }, [rtc, mirrorEnabled]);
280431
+ const handleMicrophoneChange = reactExports.useCallback(async (newMicrophoneId) => {
280432
+ setSelectedMicrophone(newMicrophoneId);
280433
+ try {
280434
+ const rtcInstance = getter().rtc;
280435
+ if (rtcInstance && rtcInstance.setMediaDevices) {
280436
+ const result = await rtcInstance.setMediaDevices({
280437
+ microphoneId: newMicrophoneId
280438
+ });
280439
+ if (result.success) {
280440
+ console.log("麦克风设备已切换:", newMicrophoneId);
280441
+ } else {
280442
+ console.error("麦克风切换失败:", result.message);
280443
+ staticMethods.error("麦克风切换失败");
280444
+ }
280445
+ }
280446
+ } catch (error2) {
280447
+ console.error("麦克风配置失败:", error2);
280448
+ staticMethods.error("麦克风配置失败");
280449
+ }
280450
+ }, [rtc]);
280451
+ const handleMirrorChange = reactExports.useCallback(async (checked) => {
280452
+ setMirrorEnabled(checked);
280453
+ try {
280454
+ const rtcInstance = getter().rtc;
280455
+ if (rtcInstance && rtcInstance.setMediaDevices) {
280456
+ const result = await rtcInstance.setMediaDevices({
280457
+ cameraId: selectedCamera,
280458
+ mirrorEnabled: checked
280459
+ });
280460
+ if (result.success) {
280461
+ console.log("镜像翻转已设置:", checked);
280462
+ } else {
280463
+ console.error("镜像翻转设置失败:", result.message);
280464
+ staticMethods.error("镜像翻转设置失败");
280465
+ }
280466
+ }
280467
+ } catch (error2) {
280468
+ console.error("镜像翻转配置失败:", error2);
280469
+ staticMethods.error("镜像翻转配置失败");
280470
+ }
280471
+ }, [rtc, selectedCamera]);
280472
+ const closeMediaSettings = reactExports.useCallback(() => {
280473
+ setIsModalVisible(false);
280474
+ }, []);
280475
+ const openMediaSettings = () => {
280476
+ console.log("openMediaSettings");
280477
+ setIsModalVisible(true);
280478
+ };
280479
+ const handleClose = reactExports.useCallback(() => {
280480
+ closeMediaSettings();
280481
+ }, [closeMediaSettings]);
280482
+ reactExports.useEffect(() => {
280483
+ console.log("useEffect openMediaSettings");
280484
+ eventBus.on("openMediaSettings", openMediaSettings);
280485
+ eventBus.on("closeMediaSettings", closeMediaSettings);
280486
+ return () => {
280487
+ eventBus.off("openMediaSettings", openMediaSettings);
280488
+ eventBus.off("closeMediaSettings", closeMediaSettings);
280489
+ };
280490
+ }, []);
280491
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Modal, {
280492
+ open: isModalVisible,
280493
+ title: "媒体设置",
280494
+ onCancel: handleClose,
280495
+ width: 910,
280496
+ footer: null,
280497
+ children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
280498
+ className: "flex justify-between",
280499
+ children: [/* @__PURE__ */ jsxRuntimeExports.jsx(MediaErrorBoundary, {
280500
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
280501
+ children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
280502
+ className: "mb-6",
280503
+ children: [/* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
280504
+ className: "flex items-center mb-2",
280505
+ children: [/* @__PURE__ */ jsxRuntimeExports.jsx("span", {
280506
+ className: "mr-2",
280507
+ children: "摄像头:"
280508
+ }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
280509
+ className: "flex-1",
280510
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(Select$1, {
280511
+ className: "w-full",
280512
+ value: selectedCamera,
280513
+ onChange: handleCameraChange,
280514
+ options: reactExports.useMemo(() => cameraDevices.map((device) => ({
280515
+ value: device.id,
280516
+ label: device.label
280517
+ })), [cameraDevices])
280518
+ })
280519
+ })]
280520
+ }), /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
280521
+ className: "flex items-center mb-2",
280522
+ children: [/* @__PURE__ */ jsxRuntimeExports.jsx("span", {
280523
+ className: "mr-2",
280524
+ children: "麦克风:"
280525
+ }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
280526
+ className: "flex-1",
280527
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(Select$1, {
280528
+ className: "w-full",
280529
+ value: selectedMicrophone,
280530
+ onChange: handleMicrophoneChange,
280531
+ options: reactExports.useMemo(() => microphoneDevices.map((device) => ({
280532
+ value: device.id,
280533
+ label: device.label
280534
+ })), [microphoneDevices])
280535
+ })
280536
+ })]
280537
+ }), /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
280538
+ className: "mt-8",
280539
+ children: [/* @__PURE__ */ jsxRuntimeExports.jsx("div", {
280540
+ className: "flex items-center justify-between mb-2",
280541
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
280542
+ children: "音频监控"
280543
+ })
280544
+ }), /* @__PURE__ */ jsxRuntimeExports.jsx(MediaErrorBoundary, {
280545
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(AudioVisualizer, {
280546
+ selectedMicrophone,
280547
+ isVisible: isModalVisible
280548
+ })
280549
+ })]
280550
+ }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
280551
+ className: "mt-8",
280552
+ children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
280553
+ className: "flex items-center justify-between mb-2",
280554
+ children: [/* @__PURE__ */ jsxRuntimeExports.jsx("span", {
280555
+ children: "镜像翻转"
280556
+ }), /* @__PURE__ */ jsxRuntimeExports.jsx(Switch, {
280557
+ checked: mirrorEnabled,
280558
+ onChange: handleMirrorChange,
280559
+ size: "small"
280560
+ })]
280561
+ })
280562
+ }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
280563
+ className: "mt-8 border-t pt-6",
280564
+ children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
280565
+ className: "mb-4",
280566
+ children: [/* @__PURE__ */ jsxRuntimeExports.jsxs("h3", {
280567
+ className: "text-lg font-medium mb-4 flex items-center",
280568
+ children: [/* @__PURE__ */ jsxRuntimeExports.jsx("span", {
280569
+ className: "mr-2",
280570
+ children: "🎨"
280571
+ }), "美颜设置", !beautyCompatible && /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
280572
+ className: "ml-2 text-xs text-red-500 bg-red-50 px-2 py-1 rounded",
280573
+ children: "不支持"
280574
+ })]
280575
+ }), /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
280576
+ className: "flex items-center justify-between mb-4",
280577
+ children: [/* @__PURE__ */ jsxRuntimeExports.jsx("span", {
280578
+ className: "text-sm",
280579
+ children: "启用美颜"
280580
+ }), /* @__PURE__ */ jsxRuntimeExports.jsx(Switch, {
280581
+ checked: beautySettings.enabled,
280582
+ onChange: handleBeautyToggle,
280583
+ disabled: !beautyCompatible,
280584
+ size: "small"
280585
+ })]
280586
+ }), beautySettings.enabled && beautyCompatible && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
280587
+ className: "space-y-4",
280588
+ children: [/* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
280589
+ children: [/* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
280590
+ className: "flex items-center justify-between mb-2",
280591
+ children: [/* @__PURE__ */ jsxRuntimeExports.jsx("span", {
280592
+ className: "text-sm",
280593
+ children: "美白强度"
280594
+ }), /* @__PURE__ */ jsxRuntimeExports.jsxs("span", {
280595
+ className: "text-xs text-gray-500",
280596
+ children: [Math.round(beautySettings.whiteIntensity * 100), "%"]
280597
+ })]
280598
+ }), /* @__PURE__ */ jsxRuntimeExports.jsx(Slider2, {
280599
+ min: 0,
280600
+ max: 1,
280601
+ step: 0.1,
280602
+ value: beautySettings.whiteIntensity,
280603
+ onChange: (value) => handleBeautyIntensityChange("white", value),
280604
+ tooltip: {
280605
+ formatter: (value) => `${Math.round((value || 0) * 100)}%`
280606
+ }
280607
+ })]
280608
+ }), /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
280609
+ children: [/* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
280610
+ className: "flex items-center justify-between mb-2",
280611
+ children: [/* @__PURE__ */ jsxRuntimeExports.jsx("span", {
280612
+ className: "text-sm",
280613
+ children: "磨皮强度"
280614
+ }), /* @__PURE__ */ jsxRuntimeExports.jsxs("span", {
280615
+ className: "text-xs text-gray-500",
280616
+ children: [Math.round(beautySettings.smoothIntensity * 100), "%"]
280617
+ })]
280618
+ }), /* @__PURE__ */ jsxRuntimeExports.jsx(Slider2, {
280619
+ min: 0,
280620
+ max: 1,
280621
+ step: 0.1,
280622
+ value: beautySettings.smoothIntensity,
280623
+ onChange: (value) => handleBeautyIntensityChange("smooth", value),
280624
+ tooltip: {
280625
+ formatter: (value) => `${Math.round((value || 0) * 100)}%`
280626
+ }
280627
+ })]
280628
+ }), /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
280629
+ children: [/* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
280630
+ className: "flex items-center justify-between mb-2",
280631
+ children: [/* @__PURE__ */ jsxRuntimeExports.jsx("span", {
280632
+ className: "text-sm",
280633
+ children: "锐化强度"
280634
+ }), /* @__PURE__ */ jsxRuntimeExports.jsxs("span", {
280635
+ className: "text-xs text-gray-500",
280636
+ children: [Math.round(beautySettings.sharpenIntensity * 100), "%"]
280637
+ })]
280638
+ }), /* @__PURE__ */ jsxRuntimeExports.jsx(Slider2, {
280639
+ min: 0,
280640
+ max: 1,
280641
+ step: 0.1,
280642
+ value: beautySettings.sharpenIntensity,
280643
+ onChange: (value) => handleBeautyIntensityChange("sharpen", value),
280644
+ tooltip: {
280645
+ formatter: (value) => `${Math.round((value || 0) * 100)}%`
280646
+ }
280647
+ })]
280648
+ })]
280649
+ }), !beautyCompatible && /* @__PURE__ */ jsxRuntimeExports.jsx(Alert, {
280650
+ message: "美颜功能不可用",
280651
+ description: "您的浏览器不支持美颜功能,请使用 Chrome 78+ 或其他兼容浏览器",
280652
+ type: "warning",
280653
+ showIcon: true,
280654
+ icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon, {}),
280655
+ className: "mt-4"
280656
+ })]
280657
+ })
280658
+ })]
280659
+ })
280660
+ })
280661
+ }), /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
280662
+ children: [/* @__PURE__ */ jsxRuntimeExports.jsx("div", {
280663
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(MediaErrorBoundary, {
280664
+ children: isModalVisible && /* @__PURE__ */ jsxRuntimeExports.jsx(CallUserVideo, {
280665
+ video_id: (callCurrentUser == null ? void 0 : callCurrentUser.rtc_userid) + "preview",
280666
+ user: callCurrentUser,
280667
+ className: " h-60",
280668
+ selectable: false
280669
+ })
280670
+ })
280671
+ }), /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
280672
+ className: "mt-4 flex items-center justify-center",
280673
+ children: [/* @__PURE__ */ jsxRuntimeExports.jsxs("span", {
280674
+ className: "text-sm",
280675
+ children: [(callCurrentUser == null ? void 0 : callCurrentUser.isVideoEnabled) ? "开启" : "关闭", "摄像头"]
280676
+ }), /* @__PURE__ */ jsxRuntimeExports.jsx(Switch, {
280677
+ checked: callCurrentUser == null ? void 0 : callCurrentUser.isVideoEnabled,
280678
+ onChange: toggleVideo,
280679
+ size: "small"
280680
+ })]
280681
+ })]
280682
+ })]
280683
+ })
280684
+ });
280685
+ };
280139
280686
  const CallComponent = () => {
280140
280687
  const liveId = useLiveId();
280141
280688
  const {
@@ -280246,7 +280793,7 @@ const CallComponent = () => {
280246
280793
  })
280247
280794
  }), callConfig.rule === "main" && callConfig.isCall && /* @__PURE__ */ jsxRuntimeExports.jsx(CallBottomActions, {
280248
280795
  onConfigUpdate: handleUpdateRTCConfig
280249
- })]
280796
+ }), (callConfig == null ? void 0 : callConfig.isCall) && /* @__PURE__ */ jsxRuntimeExports.jsx(MediaSettings, {})]
280250
280797
  })
280251
280798
  })
280252
280799
  })
@@ -280903,10 +281450,141 @@ const useCommentSocketStore = create$c((set3, get4) => ({
280903
281450
  disconnect: void 0,
280904
281451
  // 业务方法(空实现,后续由 Hook 覆盖)
280905
281452
  fetChatUrl: async (id3) => {
280906
- },
280907
- setCallback: () => {
280908
281453
  }
280909
281454
  }));
281455
+ function useCommentSocket() {
281456
+ const liveId = useLiveId();
281457
+ const callbackRef = reactExports.useRef();
281458
+ const fetchLivePush = useLivePushCodeStore((state) => state.fetchLivePush);
281459
+ const chat_url = useCommentSocketStore((state) => state.chat_url);
281460
+ const handleMessageChange = reactExports.useCallback((mess) => {
281461
+ var _a2;
281462
+ if (!(mess == null ? void 0 : mess.data))
281463
+ return;
281464
+ let message2;
281465
+ try {
281466
+ message2 = JSON.parse(mess.data);
281467
+ } catch (e3) {
281468
+ console.error("解析 WebSocket 消息失败:", e3);
281469
+ return;
281470
+ }
281471
+ useCommentSocketStore.setState({ latestMessage: mess });
281472
+ switch (message2.type) {
281473
+ case "comment_delete":
281474
+ useCommentSocketStore.setState({ commentDeleteItem: message2.data });
281475
+ setTimeout(() => {
281476
+ useCommentSocketStore.setState({ commentDeleteItem: {} });
281477
+ }, 0);
281478
+ break;
281479
+ case "chat_forward":
281480
+ (_a2 = callbackRef.current) == null ? void 0 : _a2.call(callbackRef, message2.data);
281481
+ break;
281482
+ case "activity_config_change":
281483
+ useCommentSocketStore.setState({ activityConfigChange: message2.data });
281484
+ break;
281485
+ }
281486
+ }, []);
281487
+ const socketRef = reactExports.useRef(null);
281488
+ reactExports.useEffect(() => {
281489
+ if (!chat_url) {
281490
+ return;
281491
+ }
281492
+ if (socketRef.current) {
281493
+ socketRef.current.close();
281494
+ socketRef.current = null;
281495
+ }
281496
+ try {
281497
+ socketRef.current = new WebSocket(chat_url);
281498
+ socketRef.current.onopen = (event) => {
281499
+ if (liveId && socketRef.current) {
281500
+ try {
281501
+ const joinRoomMessage = JSON.stringify({
281502
+ type: "join_room",
281503
+ data: { room_id: liveId }
281504
+ });
281505
+ socketRef.current.send(joinRoomMessage);
281506
+ } catch (error2) {
281507
+ console.error("❌ WebSocket: 发送 join_room 失败:", error2);
281508
+ }
281509
+ }
281510
+ useCommentSocketStore.setState({ readyState: 1 });
281511
+ };
281512
+ socketRef.current.onclose = (event) => {
281513
+ useCommentSocketStore.setState({ readyState: 3 });
281514
+ };
281515
+ socketRef.current.onerror = (error2) => {
281516
+ console.error("❌ WebSocket: 连接错误:", error2);
281517
+ useCommentSocketStore.setState({ readyState: 3 });
281518
+ };
281519
+ socketRef.current.onmessage = (event) => {
281520
+ handleMessageChange(event);
281521
+ };
281522
+ } catch (error2) {
281523
+ console.error("❌ WebSocket: 创建连接失败:", error2);
281524
+ useCommentSocketStore.setState({ readyState: 3 });
281525
+ }
281526
+ return () => {
281527
+ if (socketRef.current) {
281528
+ socketRef.current.close();
281529
+ socketRef.current = null;
281530
+ }
281531
+ };
281532
+ }, [chat_url, liveId, handleMessageChange]);
281533
+ const fetChatUrl = reactExports.useCallback(
281534
+ async (id3) => {
281535
+ if (!id3) {
281536
+ return;
281537
+ }
281538
+ try {
281539
+ const res = await fetchLivePush(id3);
281540
+ if (!res) {
281541
+ console.error("❌ 获取直播推流配置失败");
281542
+ return;
281543
+ }
281544
+ let newChatUrl = res.chat_url || "";
281545
+ if (newChatUrl) {
281546
+ const userAgentParam = `equipment=${encodeURIComponent(navigator.userAgent)}`;
281547
+ newChatUrl += newChatUrl.includes("?") ? `&${userAgentParam}` : `?${userAgentParam}`;
281548
+ } else {
281549
+ console.error("❌ 未获取到有效的 chat_url");
281550
+ }
281551
+ useCommentSocketStore.setState({
281552
+ chat_url: newChatUrl,
281553
+ rtmUrl: res.rtm_push_url || "",
281554
+ webTransportUrl: res.web_transport_url || ""
281555
+ });
281556
+ } catch (error2) {
281557
+ console.error("❌ 获取直播推流配置失败:", error2);
281558
+ }
281559
+ },
281560
+ [fetchLivePush]
281561
+ );
281562
+ const setCallback = reactExports.useCallback((callback) => {
281563
+ callbackRef.current = callback;
281564
+ }, []);
281565
+ const sendMessage = reactExports.useCallback((message2) => {
281566
+ if (socketRef.current && socketRef.current.readyState === 1) {
281567
+ socketRef.current.send(message2);
281568
+ } else {
281569
+ console.error("useCommentSocket - 发送消息失败,WebSocket 未连接");
281570
+ }
281571
+ }, []);
281572
+ const disconnect = reactExports.useCallback(() => {
281573
+ if (socketRef.current) {
281574
+ socketRef.current.close();
281575
+ socketRef.current = null;
281576
+ useCommentSocketStore.setState({ readyState: 3 });
281577
+ }
281578
+ }, []);
281579
+ reactExports.useEffect(() => {
281580
+ useCommentSocketStore.setState({
281581
+ sendMessage,
281582
+ disconnect,
281583
+ fetChatUrl
281584
+ });
281585
+ }, [sendMessage, disconnect, fetChatUrl]);
281586
+ return { ...useCommentSocketStore.getState(), setCallback };
281587
+ }
280910
281588
  function getTargetElement(target, defaultElement) {
280911
281589
  if (!target) {
280912
281590
  return defaultElement;
@@ -288838,7 +289516,7 @@ const ChatComponent = () => {
288838
289516
  fetChatUrl,
288839
289517
  disconnect,
288840
289518
  setCallback
288841
- } = useCommentSocketStore();
289519
+ } = useCommentSocket();
288842
289520
  const [selectFilter, setSelectFilter] = reactExports.useState(1);
288843
289521
  const fetchInteractionList = async () => {
288844
289522
  const res = await request("/bis/interaction-list", {
@@ -288878,11 +289556,20 @@ const ChatComponent = () => {
288878
289556
  }
288879
289557
  };
288880
289558
  reactExports.useEffect(() => {
288881
- fetChatUrl(liveId);
289559
+ setCallback(handleMessage);
288882
289560
  return () => {
288883
- disconnect == null ? void 0 : disconnect();
289561
+ setCallback(() => {
289562
+ });
288884
289563
  };
288885
289564
  }, []);
289565
+ reactExports.useEffect(() => {
289566
+ if (liveId) {
289567
+ fetChatUrl(liveId);
289568
+ }
289569
+ return () => {
289570
+ disconnect == null ? void 0 : disconnect();
289571
+ };
289572
+ }, [liveId, fetChatUrl, disconnect]);
288886
289573
  const handleMessage = (message2) => {
288887
289574
  console.log("New message received:", message2);
288888
289575
  if (Object.keys(message2).length === 0)
@@ -288907,13 +289594,6 @@ const ChatComponent = () => {
288907
289594
  }
288908
289595
  }
288909
289596
  };
288910
- reactExports.useEffect(() => {
288911
- setCallback(handleMessage);
288912
- return () => {
288913
- setCallback(() => {
288914
- });
288915
- };
288916
- }, []);
288917
289597
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
288918
289598
  className: " h-full",
288919
289599
  children: [/* @__PURE__ */ jsxRuntimeExports.jsx("div", {
@@ -292136,616 +292816,6 @@ const RtcJoomRoom = reactExports.memo(({
292136
292816
  })
292137
292817
  });
292138
292818
  });
292139
- const AudioVisualizer = reactExports.memo(
292140
- ({ selectedMicrophone, isVisible: isVisible3, onVolumeLevelsChange }) => {
292141
- const [audioContext, setAudioContext] = reactExports.useState(null);
292142
- const [analyser, setAnalyser] = reactExports.useState(null);
292143
- const [microphoneStream, setMicrophoneStream] = reactExports.useState(null);
292144
- const [volumeLevels, setVolumeLevels] = reactExports.useState(Array(12).fill(0));
292145
- const animationFrameRef = reactExports.useRef(null);
292146
- const canvasRef = reactExports.useRef(null);
292147
- const microphoneStreamRef = reactExports.useRef(microphoneStream);
292148
- const audioContextRef = reactExports.useRef(audioContext);
292149
- const analyserRef = reactExports.useRef(analyser);
292150
- reactExports.useEffect(() => {
292151
- microphoneStreamRef.current = microphoneStream;
292152
- audioContextRef.current = audioContext;
292153
- analyserRef.current = analyser;
292154
- }, [microphoneStream, audioContext, analyser]);
292155
- const cleanupMediaResources = reactExports.useCallback(() => {
292156
- if (animationFrameRef.current) {
292157
- cancelAnimationFrame(animationFrameRef.current);
292158
- animationFrameRef.current = null;
292159
- }
292160
- if (microphoneStreamRef.current) {
292161
- microphoneStreamRef.current.getTracks().forEach((track) => track.stop());
292162
- setMicrophoneStream(null);
292163
- }
292164
- if (audioContextRef.current) {
292165
- audioContextRef.current.close().catch((err2) => console.error("关闭音频上下文失败:", err2));
292166
- setAudioContext(null);
292167
- setAnalyser(null);
292168
- }
292169
- }, []);
292170
- reactExports.useEffect(() => {
292171
- if (onVolumeLevelsChange) {
292172
- onVolumeLevelsChange(volumeLevels);
292173
- }
292174
- }, [volumeLevels, onVolumeLevelsChange]);
292175
- reactExports.useEffect(() => {
292176
- if (isVisible3 && selectedMicrophone) {
292177
- const context = new (window.AudioContext || window.webkitAudioContext)();
292178
- setAudioContext(context);
292179
- const audioAnalyser = context.createAnalyser();
292180
- audioAnalyser.fftSize = 2048;
292181
- setAnalyser(audioAnalyser);
292182
- navigator.mediaDevices.getUserMedia({
292183
- audio: {
292184
- deviceId: selectedMicrophone ? { exact: selectedMicrophone } : void 0
292185
- }
292186
- }).then((stream) => {
292187
- setMicrophoneStream(stream);
292188
- const source = context.createMediaStreamSource(stream);
292189
- source.connect(audioAnalyser);
292190
- const canvas = canvasRef.current;
292191
- const canvasCtx = canvas == null ? void 0 : canvas.getContext("2d");
292192
- const frequencyDataArray = new Uint8Array(audioAnalyser.frequencyBinCount);
292193
- const timeDataArray = new Uint8Array(audioAnalyser.frequencyBinCount);
292194
- const analyzeVolume = () => {
292195
- audioAnalyser.getByteFrequencyData(frequencyDataArray);
292196
- audioAnalyser.getByteTimeDomainData(timeDataArray);
292197
- if (canvasCtx && canvas) {
292198
- canvasCtx.clearRect(0, 0, canvas.width, canvas.height);
292199
- canvasCtx.lineWidth = 2;
292200
- canvasCtx.strokeStyle = "#2196F3";
292201
- canvasCtx.beginPath();
292202
- const sliceWidth = canvas.width / timeDataArray.length;
292203
- let x = 0;
292204
- for (let i = 0; i < timeDataArray.length; i++) {
292205
- const v3 = timeDataArray[i] / 128;
292206
- const y3 = v3 * canvas.height / 2;
292207
- if (i === 0) {
292208
- canvasCtx.moveTo(x, y3);
292209
- } else {
292210
- canvasCtx.lineTo(x, y3);
292211
- }
292212
- x += sliceWidth;
292213
- }
292214
- canvasCtx.lineTo(canvas.width, canvas.height / 2);
292215
- canvasCtx.stroke();
292216
- }
292217
- const segmentSize = Math.floor(frequencyDataArray.length / 12);
292218
- const normalizedLevels = Array(12).fill(0).map((_2, index2) => {
292219
- const start2 = index2 * segmentSize;
292220
- const end2 = start2 + segmentSize;
292221
- const segmentAvg = frequencyDataArray.slice(start2, end2).reduce((sum2, value) => sum2 + value, 0) / segmentSize;
292222
- return Math.min(1, Math.pow(segmentAvg / 255, 0.8));
292223
- });
292224
- setVolumeLevels(normalizedLevels);
292225
- animationFrameRef.current = requestAnimationFrame(analyzeVolume);
292226
- };
292227
- analyzeVolume();
292228
- }).catch((err2) => {
292229
- console.error("获取麦克风失败:", err2);
292230
- const interval = setInterval(() => {
292231
- const newLevels = Array(12).fill(0).map(() => Math.random());
292232
- setVolumeLevels(newLevels);
292233
- }, 200);
292234
- return () => clearInterval(interval);
292235
- });
292236
- return cleanupMediaResources;
292237
- }
292238
- }, [isVisible3, selectedMicrophone, cleanupMediaResources]);
292239
- reactExports.useEffect(() => {
292240
- return () => {
292241
- cleanupMediaResources();
292242
- };
292243
- }, [cleanupMediaResources]);
292244
- return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-col space-y-4", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: " h-24 bg-gray-50 rounded border border-gray-200", children: /* @__PURE__ */ jsxRuntimeExports.jsx("canvas", { ref: canvasRef, className: " h-full", width: "400", height: "100" }) }) });
292245
- }
292246
- );
292247
- AudioVisualizer.displayName = "AudioVisualizer";
292248
- class MediaErrorBoundary extends reactExports.Component {
292249
- constructor(props) {
292250
- super(props);
292251
- this.state = {
292252
- hasError: false,
292253
- errorMessage: ""
292254
- };
292255
- }
292256
- static getDerivedStateFromError(error2) {
292257
- return {
292258
- hasError: true,
292259
- errorMessage: error2.message
292260
- };
292261
- }
292262
- componentDidCatch(error2, errorInfo) {
292263
- console.error("媒体设备错误:", error2, errorInfo);
292264
- }
292265
- render() {
292266
- if (this.state.hasError) {
292267
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
292268
- className: "p-4 border border-red-300 rounded bg-red-50",
292269
- children: [/* @__PURE__ */ jsxRuntimeExports.jsx(Alert, {
292270
- message: "媒体设备错误",
292271
- description: `无法访问媒体设备: ${this.state.errorMessage}。请检查设备权限或连接。`,
292272
- type: "error",
292273
- showIcon: true,
292274
- icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon, {})
292275
- }), /* @__PURE__ */ jsxRuntimeExports.jsx(Button$1, {
292276
- type: "primary",
292277
- className: "mt-4",
292278
- onClick: () => this.setState({
292279
- hasError: false,
292280
- errorMessage: ""
292281
- }),
292282
- children: "重试"
292283
- })]
292284
- });
292285
- }
292286
- return this.props.children;
292287
- }
292288
- }
292289
- const MediaSettings = () => {
292290
- const {
292291
- callCurrentUser,
292292
- toggleVideo,
292293
- rtc,
292294
- getter
292295
- } = useCallStore();
292296
- const [isModalVisible, setIsModalVisible] = reactExports.useState(false);
292297
- const [mirrorEnabled, setMirrorEnabled] = reactExports.useState(true);
292298
- const [cameraDevices, setCameraDevices] = reactExports.useState([]);
292299
- const [microphoneDevices, setMicrophoneDevices] = reactExports.useState([]);
292300
- const [selectedCamera, setSelectedCamera] = reactExports.useState("");
292301
- const [selectedMicrophone, setSelectedMicrophone] = reactExports.useState("");
292302
- const [beautySettings, setBeautySettings] = reactExports.useState({
292303
- enabled: false,
292304
- whiteIntensity: 0.5,
292305
- smoothIntensity: 0.5,
292306
- sharpenIntensity: 0.5
292307
- });
292308
- const [beautyExtension, setBeautyExtension] = reactExports.useState(null);
292309
- const [beautyCompatible, setBeautyCompatible] = reactExports.useState(false);
292310
- console.log("beautyCompatible", beautyCompatible);
292311
- const [beautyInitialized, setBeautyInitialized] = reactExports.useState(false);
292312
- const getDevices = reactExports.useCallback(async () => {
292313
- try {
292314
- if (!navigator.mediaDevices || !navigator.mediaDevices.enumerateDevices) {
292315
- console.error("浏览器不支持获取媒体设备列表");
292316
- staticMethods.error("您的浏览器不支持媒体设备选择功能");
292317
- return;
292318
- }
292319
- await navigator.mediaDevices.getUserMedia({
292320
- audio: true,
292321
- video: true
292322
- }).catch((err2) => console.error("获取媒体权限失败:", err2));
292323
- const devices = await navigator.mediaDevices.enumerateDevices();
292324
- const cameras = devices.filter((device) => device.kind === "videoinput").map((device) => ({
292325
- id: device.deviceId,
292326
- label: device.label || `摄像头 ${device.deviceId.slice(0, 5)}...`
292327
- }));
292328
- const microphones = devices.filter((device) => device.kind === "audioinput").map((device) => ({
292329
- id: device.deviceId,
292330
- label: device.label || `麦克风 ${device.deviceId.slice(0, 5)}...`
292331
- }));
292332
- if (cameras.length > 0) {
292333
- setCameraDevices(cameras);
292334
- setSelectedCamera((prevCamera) => {
292335
- return cameras.find((cam) => cam.id === prevCamera) ? prevCamera : cameras[0].id;
292336
- });
292337
- }
292338
- if (microphones.length > 0) {
292339
- setMicrophoneDevices(microphones);
292340
- setSelectedMicrophone((prevMic) => {
292341
- return microphones.find((mic) => mic.id === prevMic) ? prevMic : microphones[0].id;
292342
- });
292343
- }
292344
- } catch (error2) {
292345
- console.error("获取设备列表失败:", error2);
292346
- staticMethods.error("获取媒体设备失败,请检查设备权限");
292347
- setCameraDevices([{
292348
- id: "default",
292349
- label: "默认摄像头"
292350
- }]);
292351
- setMicrophoneDevices([{
292352
- id: "default",
292353
- label: "默认麦克风"
292354
- }]);
292355
- }
292356
- }, []);
292357
- reactExports.useEffect(() => {
292358
- if (isModalVisible) {
292359
- getDevices();
292360
- }
292361
- if (navigator.mediaDevices) {
292362
- navigator.mediaDevices.addEventListener("devicechange", getDevices);
292363
- return () => {
292364
- navigator.mediaDevices.removeEventListener("devicechange", getDevices);
292365
- };
292366
- }
292367
- }, [getDevices, isModalVisible]);
292368
- reactExports.useEffect(() => {
292369
- if (isModalVisible && !beautyInitialized) {
292370
- initializeBeautyExtension();
292371
- }
292372
- }, [isModalVisible, beautyInitialized]);
292373
- const initializeBeautyExtension = reactExports.useCallback(async () => {
292374
- try {
292375
- const rtcInstance = getter().rtc;
292376
- if (rtcInstance && rtcInstance.beautyExtension) {
292377
- const extension = rtcInstance.beautyExtension;
292378
- const compatibilityResult = await extension.checkCompatibility();
292379
- console.log("浏览器兼容性检查结果:", compatibilityResult);
292380
- if (compatibilityResult.isCompatible) {
292381
- setBeautyExtension(extension);
292382
- setBeautyCompatible(true);
292383
- setBeautyInitialized(true);
292384
- console.log("美颜扩展初始化成功");
292385
- } else {
292386
- console.warn("浏览器不支持美颜功能:", compatibilityResult.message || "兼容性检查失败");
292387
- setBeautyCompatible(false);
292388
- staticMethods.warning("您的浏览器不支持美颜功能,请使用 Chrome 78+ 或其他兼容浏览器");
292389
- }
292390
- } else {
292391
- console.warn("RTC客户端或美颜扩展未初始化");
292392
- setBeautyCompatible(false);
292393
- staticMethods.warning("RTC客户端未初始化,无法使用美颜功能");
292394
- }
292395
- } catch (error2) {
292396
- console.error("美颜扩展初始化失败:", error2);
292397
- setBeautyCompatible(false);
292398
- staticMethods.error("美颜功能初始化失败");
292399
- }
292400
- }, [rtc]);
292401
- const handleBeautyToggle = reactExports.useCallback((enabled) => {
292402
- if (!beautyExtension || !beautyCompatible) {
292403
- staticMethods.warning("美颜功能不可用");
292404
- return;
292405
- }
292406
- try {
292407
- if (enabled) {
292408
- beautyExtension.enableBeauty();
292409
- console.log("美颜已开启");
292410
- } else {
292411
- beautyExtension.disableBeauty();
292412
- console.log("美颜已关闭");
292413
- }
292414
- setBeautySettings((prev2) => ({
292415
- ...prev2,
292416
- enabled
292417
- }));
292418
- } catch (error2) {
292419
- console.error("美颜开关操作失败:", error2);
292420
- staticMethods.error("美颜开关操作失败");
292421
- }
292422
- }, [beautyExtension, beautyCompatible]);
292423
- const handleBeautyIntensityChange = reactExports.useCallback(
292424
- debounce$6((type4, value) => {
292425
- if (!beautyExtension || !beautyCompatible) {
292426
- return;
292427
- }
292428
- try {
292429
- let mode;
292430
- let settingKey;
292431
- switch (type4) {
292432
- case "white":
292433
- mode = EffectBeautyMode.EFFECT_WHITE_MODE;
292434
- settingKey = "whiteIntensity";
292435
- break;
292436
- case "smooth":
292437
- mode = EffectBeautyMode.EFFECT_SMOOTH_MODE;
292438
- settingKey = "smoothIntensity";
292439
- break;
292440
- case "sharpen":
292441
- mode = EffectBeautyMode.EFFECT_SHARPEN_MODE;
292442
- settingKey = "sharpenIntensity";
292443
- break;
292444
- default:
292445
- return;
292446
- }
292447
- beautyExtension.setBeautyIntensity(mode, value);
292448
- setBeautySettings((prev2) => ({
292449
- ...prev2,
292450
- [settingKey]: value
292451
- }));
292452
- console.log(`${type4} 强度已设置为:`, value);
292453
- } catch (error2) {
292454
- console.error("美颜强度设置失败:", error2);
292455
- staticMethods.error("美颜强度设置失败");
292456
- }
292457
- }, 300),
292458
- // 300ms 防抖延迟
292459
- [beautyExtension, beautyCompatible]
292460
- );
292461
- reactExports.useEffect(() => {
292462
- const savedBeautySettings = localStorage.getItem("beautySettings");
292463
- if (savedBeautySettings) {
292464
- try {
292465
- const parsed = JSON.parse(savedBeautySettings);
292466
- setBeautySettings(parsed);
292467
- } catch (error2) {
292468
- console.error("加载美颜设置失败:", error2);
292469
- }
292470
- }
292471
- }, []);
292472
- reactExports.useEffect(() => {
292473
- localStorage.setItem("beautySettings", JSON.stringify(beautySettings));
292474
- }, [beautySettings]);
292475
- const handleCameraChange = reactExports.useCallback(async (newCameraId) => {
292476
- setSelectedCamera(newCameraId);
292477
- try {
292478
- const rtcInstance = getter().rtc;
292479
- if (rtcInstance && rtcInstance.setMediaDevices) {
292480
- const result = await rtcInstance.setMediaDevices({
292481
- cameraId: newCameraId,
292482
- mirrorEnabled
292483
- });
292484
- if (result.success) {
292485
- console.log("摄像头设备已切换:", newCameraId);
292486
- } else {
292487
- console.error("摄像头切换失败:", result.message);
292488
- staticMethods.error("摄像头切换失败");
292489
- }
292490
- }
292491
- } catch (error2) {
292492
- console.error("摄像头配置失败:", error2);
292493
- staticMethods.error("摄像头配置失败");
292494
- }
292495
- }, [rtc, mirrorEnabled]);
292496
- const handleMicrophoneChange = reactExports.useCallback(async (newMicrophoneId) => {
292497
- setSelectedMicrophone(newMicrophoneId);
292498
- try {
292499
- const rtcInstance = getter().rtc;
292500
- if (rtcInstance && rtcInstance.setMediaDevices) {
292501
- const result = await rtcInstance.setMediaDevices({
292502
- microphoneId: newMicrophoneId
292503
- });
292504
- if (result.success) {
292505
- console.log("麦克风设备已切换:", newMicrophoneId);
292506
- } else {
292507
- console.error("麦克风切换失败:", result.message);
292508
- staticMethods.error("麦克风切换失败");
292509
- }
292510
- }
292511
- } catch (error2) {
292512
- console.error("麦克风配置失败:", error2);
292513
- staticMethods.error("麦克风配置失败");
292514
- }
292515
- }, [rtc]);
292516
- const handleMirrorChange = reactExports.useCallback(async (checked) => {
292517
- setMirrorEnabled(checked);
292518
- try {
292519
- const rtcInstance = getter().rtc;
292520
- if (rtcInstance && rtcInstance.setMediaDevices) {
292521
- const result = await rtcInstance.setMediaDevices({
292522
- cameraId: selectedCamera,
292523
- mirrorEnabled: checked
292524
- });
292525
- if (result.success) {
292526
- console.log("镜像翻转已设置:", checked);
292527
- } else {
292528
- console.error("镜像翻转设置失败:", result.message);
292529
- staticMethods.error("镜像翻转设置失败");
292530
- }
292531
- }
292532
- } catch (error2) {
292533
- console.error("镜像翻转配置失败:", error2);
292534
- staticMethods.error("镜像翻转配置失败");
292535
- }
292536
- }, [rtc, selectedCamera]);
292537
- const closeMediaSettings = reactExports.useCallback(() => {
292538
- setIsModalVisible(false);
292539
- }, []);
292540
- const openMediaSettings = () => {
292541
- setIsModalVisible(true);
292542
- };
292543
- const handleClose = reactExports.useCallback(() => {
292544
- closeMediaSettings();
292545
- }, [closeMediaSettings]);
292546
- reactExports.useEffect(() => {
292547
- eventBus.on("openMediaSettings", openMediaSettings);
292548
- eventBus.on("closeMediaSettings", closeMediaSettings);
292549
- return () => {
292550
- eventBus.off("openMediaSettings", openMediaSettings);
292551
- eventBus.off("closeMediaSettings", closeMediaSettings);
292552
- };
292553
- }, []);
292554
- return /* @__PURE__ */ jsxRuntimeExports.jsx(Modal, {
292555
- open: isModalVisible,
292556
- title: "媒体设置",
292557
- onCancel: handleClose,
292558
- width: 910,
292559
- footer: null,
292560
- children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
292561
- className: "flex justify-between",
292562
- children: [/* @__PURE__ */ jsxRuntimeExports.jsx(MediaErrorBoundary, {
292563
- children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
292564
- children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
292565
- className: "mb-6",
292566
- children: [/* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
292567
- className: "flex items-center mb-2",
292568
- children: [/* @__PURE__ */ jsxRuntimeExports.jsx("span", {
292569
- className: "mr-2",
292570
- children: "摄像头:"
292571
- }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
292572
- className: "flex-1",
292573
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(Select$1, {
292574
- className: "w-full",
292575
- value: selectedCamera,
292576
- onChange: handleCameraChange,
292577
- options: reactExports.useMemo(() => cameraDevices.map((device) => ({
292578
- value: device.id,
292579
- label: device.label
292580
- })), [cameraDevices])
292581
- })
292582
- })]
292583
- }), /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
292584
- className: "flex items-center mb-2",
292585
- children: [/* @__PURE__ */ jsxRuntimeExports.jsx("span", {
292586
- className: "mr-2",
292587
- children: "麦克风:"
292588
- }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
292589
- className: "flex-1",
292590
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(Select$1, {
292591
- className: "w-full",
292592
- value: selectedMicrophone,
292593
- onChange: handleMicrophoneChange,
292594
- options: reactExports.useMemo(() => microphoneDevices.map((device) => ({
292595
- value: device.id,
292596
- label: device.label
292597
- })), [microphoneDevices])
292598
- })
292599
- })]
292600
- }), /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
292601
- className: "mt-8",
292602
- children: [/* @__PURE__ */ jsxRuntimeExports.jsx("div", {
292603
- className: "flex items-center justify-between mb-2",
292604
- children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
292605
- children: "音频监控"
292606
- })
292607
- }), /* @__PURE__ */ jsxRuntimeExports.jsx(MediaErrorBoundary, {
292608
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(AudioVisualizer, {
292609
- selectedMicrophone,
292610
- isVisible: isModalVisible
292611
- })
292612
- })]
292613
- }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
292614
- className: "mt-8",
292615
- children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
292616
- className: "flex items-center justify-between mb-2",
292617
- children: [/* @__PURE__ */ jsxRuntimeExports.jsx("span", {
292618
- children: "镜像翻转"
292619
- }), /* @__PURE__ */ jsxRuntimeExports.jsx(Switch, {
292620
- checked: mirrorEnabled,
292621
- onChange: handleMirrorChange,
292622
- size: "small"
292623
- })]
292624
- })
292625
- }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
292626
- className: "mt-8 border-t pt-6",
292627
- children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
292628
- className: "mb-4",
292629
- children: [/* @__PURE__ */ jsxRuntimeExports.jsxs("h3", {
292630
- className: "text-lg font-medium mb-4 flex items-center",
292631
- children: [/* @__PURE__ */ jsxRuntimeExports.jsx("span", {
292632
- className: "mr-2",
292633
- children: "🎨"
292634
- }), "美颜设置", !beautyCompatible && /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
292635
- className: "ml-2 text-xs text-red-500 bg-red-50 px-2 py-1 rounded",
292636
- children: "不支持"
292637
- })]
292638
- }), /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
292639
- className: "flex items-center justify-between mb-4",
292640
- children: [/* @__PURE__ */ jsxRuntimeExports.jsx("span", {
292641
- className: "text-sm",
292642
- children: "启用美颜"
292643
- }), /* @__PURE__ */ jsxRuntimeExports.jsx(Switch, {
292644
- checked: beautySettings.enabled,
292645
- onChange: handleBeautyToggle,
292646
- disabled: !beautyCompatible,
292647
- size: "small"
292648
- })]
292649
- }), beautySettings.enabled && beautyCompatible && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
292650
- className: "space-y-4",
292651
- children: [/* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
292652
- children: [/* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
292653
- className: "flex items-center justify-between mb-2",
292654
- children: [/* @__PURE__ */ jsxRuntimeExports.jsx("span", {
292655
- className: "text-sm",
292656
- children: "美白强度"
292657
- }), /* @__PURE__ */ jsxRuntimeExports.jsxs("span", {
292658
- className: "text-xs text-gray-500",
292659
- children: [Math.round(beautySettings.whiteIntensity * 100), "%"]
292660
- })]
292661
- }), /* @__PURE__ */ jsxRuntimeExports.jsx(Slider2, {
292662
- min: 0,
292663
- max: 1,
292664
- step: 0.1,
292665
- value: beautySettings.whiteIntensity,
292666
- onChange: (value) => handleBeautyIntensityChange("white", value),
292667
- tooltip: {
292668
- formatter: (value) => `${Math.round((value || 0) * 100)}%`
292669
- }
292670
- })]
292671
- }), /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
292672
- children: [/* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
292673
- className: "flex items-center justify-between mb-2",
292674
- children: [/* @__PURE__ */ jsxRuntimeExports.jsx("span", {
292675
- className: "text-sm",
292676
- children: "磨皮强度"
292677
- }), /* @__PURE__ */ jsxRuntimeExports.jsxs("span", {
292678
- className: "text-xs text-gray-500",
292679
- children: [Math.round(beautySettings.smoothIntensity * 100), "%"]
292680
- })]
292681
- }), /* @__PURE__ */ jsxRuntimeExports.jsx(Slider2, {
292682
- min: 0,
292683
- max: 1,
292684
- step: 0.1,
292685
- value: beautySettings.smoothIntensity,
292686
- onChange: (value) => handleBeautyIntensityChange("smooth", value),
292687
- tooltip: {
292688
- formatter: (value) => `${Math.round((value || 0) * 100)}%`
292689
- }
292690
- })]
292691
- }), /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
292692
- children: [/* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
292693
- className: "flex items-center justify-between mb-2",
292694
- children: [/* @__PURE__ */ jsxRuntimeExports.jsx("span", {
292695
- className: "text-sm",
292696
- children: "锐化强度"
292697
- }), /* @__PURE__ */ jsxRuntimeExports.jsxs("span", {
292698
- className: "text-xs text-gray-500",
292699
- children: [Math.round(beautySettings.sharpenIntensity * 100), "%"]
292700
- })]
292701
- }), /* @__PURE__ */ jsxRuntimeExports.jsx(Slider2, {
292702
- min: 0,
292703
- max: 1,
292704
- step: 0.1,
292705
- value: beautySettings.sharpenIntensity,
292706
- onChange: (value) => handleBeautyIntensityChange("sharpen", value),
292707
- tooltip: {
292708
- formatter: (value) => `${Math.round((value || 0) * 100)}%`
292709
- }
292710
- })]
292711
- })]
292712
- }), !beautyCompatible && /* @__PURE__ */ jsxRuntimeExports.jsx(Alert, {
292713
- message: "美颜功能不可用",
292714
- description: "您的浏览器不支持美颜功能,请使用 Chrome 78+ 或其他兼容浏览器",
292715
- type: "warning",
292716
- showIcon: true,
292717
- icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon, {}),
292718
- className: "mt-4"
292719
- })]
292720
- })
292721
- })]
292722
- })
292723
- })
292724
- }), /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
292725
- children: [/* @__PURE__ */ jsxRuntimeExports.jsx("div", {
292726
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(MediaErrorBoundary, {
292727
- children: isModalVisible && /* @__PURE__ */ jsxRuntimeExports.jsx(CallUserVideo, {
292728
- video_id: (callCurrentUser == null ? void 0 : callCurrentUser.rtc_userid) + "preview",
292729
- user: callCurrentUser,
292730
- className: " h-60",
292731
- selectable: false
292732
- })
292733
- })
292734
- }), /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
292735
- className: "mt-4 flex items-center justify-center",
292736
- children: [/* @__PURE__ */ jsxRuntimeExports.jsxs("span", {
292737
- className: "text-sm",
292738
- children: [(callCurrentUser == null ? void 0 : callCurrentUser.isVideoEnabled) ? "开启" : "关闭", "摄像头"]
292739
- }), /* @__PURE__ */ jsxRuntimeExports.jsx(Switch, {
292740
- checked: callCurrentUser == null ? void 0 : callCurrentUser.isVideoEnabled,
292741
- onChange: toggleVideo,
292742
- size: "small"
292743
- })]
292744
- })]
292745
- })]
292746
- })
292747
- });
292748
- };
292749
292819
  const CallHome$1 = () => {
292750
292820
  const audioContextRef = reactExports.useRef(null);
292751
292821
  const audioDestinationRef = reactExports.useRef(null);
@@ -292811,7 +292881,7 @@ const CallHome$1 = () => {
292811
292881
  rule: "sub"
292812
292882
  }), /* @__PURE__ */ jsxRuntimeExports.jsx(RightSidebar, {
292813
292883
  canvasSetting
292814
- }), /* @__PURE__ */ jsxRuntimeExports.jsx(MediaSettings, {})]
292884
+ })]
292815
292885
  })]
292816
292886
  }), (callCurrentUser == null ? void 0 : callCurrentUser.waiting_mode_state) === WaitingModeState.WAITING && /* @__PURE__ */ jsxRuntimeExports.jsx(LiveWaitingRoom, {
292817
292887
  hostName: callConfig.title
@@ -295619,7 +295689,7 @@ const CanvasCameraForm = reactExports.forwardRef(({
295619
295689
  const queenEngineCanvas = document.getElementById("queenEngineCanvas");
295620
295690
  const queenEngine = new d$3();
295621
295691
  queenEngineRef.current = queenEngine;
295622
- queenEngine.init(envConfig.queenSdkKey, function() {
295692
+ queenEngine.init(envConfig$1.queenSdkKey, function() {
295623
295693
  console.log("初始化完成");
295624
295694
  timer.current = setInterval(() => {
295625
295695
  queenRender();
@@ -296119,13 +296189,13 @@ const CanvasUploadVideo = ({
296119
296189
  children: [/* @__PURE__ */ jsxRuntimeExports.jsx(Dragger$1, {
296120
296190
  ...props,
296121
296191
  children: videoUrl ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
296122
- className: "relative aspect-video flex items-center justify-center videoUploadWrap",
296192
+ className: "relative w-full aspect-video flex items-center justify-center videoUploadWrap",
296123
296193
  children: [/* @__PURE__ */ jsxRuntimeExports.jsx("video", {
296124
296194
  src: videoUrl,
296125
296195
  autoPlay: !isVideoAutoPlay,
296126
- className: " aspect-video"
296196
+ className: "w-full"
296127
296197
  }), /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
296128
- className: " h-full absolute top-0 left-0 text-#fff bg-#0009 items-center justify-center uploadContent flex-col",
296198
+ className: "w-full h-full absolute top-0 left-0 text-#fff bg-#0009 items-center justify-center uploadContent flex-col",
296129
296199
  style: {
296130
296200
  display: "none"
296131
296201
  },
@@ -296269,7 +296339,7 @@ const CanvasUploadAudio = ({
296269
296339
  className: "mt-2",
296270
296340
  children: fileData.current.name
296271
296341
  }), /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
296272
- className: " h-full absolute top-0 left-0 text-#fff bg-#0009 items-center justify-center uploadContent flex-col",
296342
+ className: "w-full h-full absolute top-0 left-0 text-#fff bg-#0009 items-center justify-center uploadContent flex-col",
296273
296343
  style: {
296274
296344
  display: "none"
296275
296345
  },
@@ -305542,7 +305612,6 @@ const CallHome = () => {
305542
305612
  fabricInstance,
305543
305613
  updateCallConfig
305544
305614
  } = useCallStore();
305545
- console.log("重新渲染推流端");
305546
305615
  const pcRef = reactExports.useRef(null);
305547
305616
  const audioContextRef = reactExports.useRef(null);
305548
305617
  const audioDestinationRef = reactExports.useRef(null);
@@ -305707,16 +305776,6 @@ const CallHome = () => {
305707
305776
  newBackgroundAudioStreams.set(streamId, audioStream);
305708
305777
  audioStreamRef.current = newBackgroundAudioStreams;
305709
305778
  });
305710
- return () => {
305711
- var _a3;
305712
- const rtmp = rtmpRef.current;
305713
- console.log("rtmp", rtmp);
305714
- if (rtmpRef.current) {
305715
- rtmpRef.current.stopPush();
305716
- (_a3 = rtmpRef.current) == null ? void 0 : _a3.destroy();
305717
- rtmpRef.current = null;
305718
- }
305719
- };
305720
305779
  }, []);
305721
305780
  reactExports.useEffect(() => {
305722
305781
  const handleBeforeUnload = (e3) => {
@@ -305769,26 +305828,54 @@ const CallHome = () => {
305769
305828
  return;
305770
305829
  (_a3 = livePlayerRef.current) == null ? void 0 : _a3.canvasRequestRenderAll();
305771
305830
  }, [isSelectedId, isHoveredId]);
305772
- const sizeEl = useSdkStore((state) => state.callConfig.el);
305831
+ const {
305832
+ sizeEl,
305833
+ styleConfig
305834
+ } = useSdkStore((state) => ({
305835
+ sizeEl: state.callConfig.el,
305836
+ styleConfig: state.styleConfig
305837
+ }));
305773
305838
  const wapRef = reactExports.useRef(null);
305774
305839
  reactExports.useEffect(() => {
305775
- console.log("[livePlayer.设置视频容器高度]", sizeEl);
305776
305840
  if (!wapRef.current)
305777
305841
  return;
305778
- let el2;
305842
+ let el2 = null;
305779
305843
  if (typeof sizeEl === "string") {
305780
305844
  el2 = document.getElementById(sizeEl);
305781
- } else {
305845
+ if (!el2) {
305846
+ console.warn(`[ResizeObserver] 找不到 ID 为 "${sizeEl}" 的元素,`);
305847
+ }
305848
+ } else if (sizeEl instanceof HTMLElement) {
305782
305849
  el2 = sizeEl;
305850
+ } else {
305851
+ console.warn("[ResizeObserver] sizeEl 无效,");
305783
305852
  }
305784
- if (!el2)
305853
+ if (!el2) {
305854
+ console.error("[ResizeObserver] 无法获取要观察的元素");
305785
305855
  return;
305856
+ }
305857
+ console.log("[ResizeObserver] 开始观察元素:", el2);
305858
+ const updateHeight = () => {
305859
+ if (wapRef.current) {
305860
+ const newHeight = el2.clientHeight - 60;
305861
+ wapRef.current.style.height = newHeight + "px";
305862
+ wapRef.current.style.minHeight = "770px";
305863
+ console.log("[ResizeObserver] 更新高度:", newHeight);
305864
+ }
305865
+ };
305786
305866
  const resizeObserver2 = new ResizeObserver(() => {
305787
- wapRef.current.style.height = (el2 == null ? void 0 : el2.clientHeight) - 60 + "px";
305867
+ updateHeight();
305788
305868
  });
305789
305869
  resizeObserver2.observe(el2);
305870
+ const handleWindowResize = () => {
305871
+ updateHeight();
305872
+ };
305873
+ window.addEventListener("resize", handleWindowResize);
305874
+ updateHeight();
305790
305875
  return () => {
305876
+ console.log("[ResizeObserver] 停止观察元素:", el2);
305791
305877
  resizeObserver2.disconnect();
305878
+ window.removeEventListener("resize", handleWindowResize);
305792
305879
  };
305793
305880
  }, [sizeEl]);
305794
305881
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(ConfigProvider$1, {
@@ -305803,7 +305890,7 @@ const CallHome = () => {
305803
305890
  }
305804
305891
  },
305805
305892
  children: [/* @__PURE__ */ jsxRuntimeExports.jsx(RtcJoomRoom, {}), /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
305806
- className: "h-full bg-#0e131c min-w-[1500px] min-h-[770px] overflow-auto flex flex-col",
305893
+ className: `h-full bg-#0e131c min-w-[${styleConfig.minWidth}] min-h-[${styleConfig.minHeight}] overflow-auto`,
305807
305894
  children: [/* @__PURE__ */ jsxRuntimeExports.jsx(Head$1, {
305808
305895
  canvasSetting,
305809
305896
  setCanvasSetting,
@@ -305814,7 +305901,7 @@ const CallHome = () => {
305814
305901
  audioDestinationRef
305815
305902
  }), /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
305816
305903
  ref: wapRef,
305817
- className: " flex-1 relative flex mt-1 gap-1 ",
305904
+ className: "h-[calc(100%-60px)] relative flex mt-1 gap-1 ",
305818
305905
  children: [/* @__PURE__ */ jsxRuntimeExports.jsx(LeftSidebar, {
305819
305906
  onSceneClick: handleSceneClick,
305820
305907
  currentScene,