@xmanrui/dsh-im 2.6.0 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/client.js CHANGED
@@ -47,7 +47,7 @@ var React20 = __toESM(require("react"), 1);
47
47
  // package.json
48
48
  var package_default = {
49
49
  name: "@xmanrui/dsh-im",
50
- version: "2.6.0",
50
+ version: "3.0.1",
51
51
  description: "\u628A\u4E5D\u79CD IM \u673A\u5668\u4EBA\u548C\u516C\u7F51 AI Office \u63A5\u5165\u672C\u673A DeepSeek Harness\u3002 Connect nine IM channels and a public AI Office to a local DeepSeek Harness.",
52
52
  keywords: [
53
53
  "deepseek-harness",
@@ -130,7 +130,7 @@ var package_default = {
130
130
  scripts: {
131
131
  build: "node plugin-src/client/build.mjs && node plugin-src/host/build.mjs",
132
132
  test: "node --test test/*.test.mjs test/channels/*/*.test.mjs",
133
- check: "npm test && npm run build && node scripts/verify-package.mjs"
133
+ check: "npm run build && npm test && node scripts/verify-package.mjs"
134
134
  },
135
135
  engines: {
136
136
  node: ">=22.19"
@@ -308,7 +308,7 @@ var EN = Object.freeze({
308
308
  "IM\u673A\u5668\u4EBA": "IM bots",
309
309
  "IM\u673A\u5668\u4EBA\u8BBE\u7F6E": "IM bot settings",
310
310
  "IM \u6E20\u9053": "IM channels",
311
- "\u8BA9 DeepSeek Harness \u89E6\u624B\u53EF\u53CA": "DeepSeek Harness, always within reach",
311
+ "\u8BA9 DeepSeek Harness \u89E6\u624B\u53EF\u53CA": "Connecting DeepSeek Harness",
312
312
  "\u5F53\u524D\u7248\u672C": "Current version",
313
313
  "AI Office": "AI Office",
314
314
  "\uFF08\u5B9E\u9A8C\u529F\u80FD\uFF09": "(Experimental)",
@@ -818,6 +818,9 @@ var EN = Object.freeze({
818
818
  "QQ \u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u626B\u7801\u7ED1\u5B9A\u8FDB\u5EA6": "QQ did not return QR setup progress",
819
819
  "QQ \u626B\u7801\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u6709\u6548\u7684\u7ED1\u5B9A\u4EFB\u52A1": "QQ did not return a valid setup attempt",
820
820
  "QQ WebSocket \u957F\u8FDE\u63A5\u8FD0\u884C\u6B63\u5E38": "QQ WebSocket connection is healthy",
821
+ "QQ \u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5\u3002": "The QQ connection is not ready; the plugin will retry automatically.",
822
+ "QQ \u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5": "The QQ connection is not ready; the plugin will retry automatically",
823
+ "QQ \u8FDE\u63A5\u5F53\u524D\u79BB\u7EBF": "The QQ connection is currently offline",
821
824
  "QQ \u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u6709\u6548\u7684\u673A\u5668\u4EBA\u5217\u8868": "QQ did not return a valid bot list",
822
825
  "\u5C1A\u672A\u7ED1\u5B9A QQ \u673A\u5668\u4EBA": "No QQ bot connected yet",
823
826
  "\u7528\u4E8E\u7ED1\u5B9A QQ \u673A\u5668\u4EBA\u7684\u4E00\u6B21\u6027\u4E8C\u7EF4\u7801": "One-time QR code for connecting a QQ bot",
@@ -1947,7 +1950,7 @@ function LastMessageErrorSummary({ className = "", error }) {
1947
1950
  }
1948
1951
 
1949
1952
  // plugin-src/client/channels/dingtalk/styles.js
1950
- var DINGTALK_STYLE_ID = "xmanrui-dsh-dingtalk-settings";
1953
+ var DINGTALK_STYLE_ID = "xmanrui-dsh-im-dingtalk-settings";
1951
1954
  var CSS = String.raw`
1952
1955
  .ddt-page {
1953
1956
  --ddt-accent: #1677ff;
@@ -2075,7 +2078,7 @@ function installDingtalkStyles() {
2075
2078
  if (existing) return () => {
2076
2079
  };
2077
2080
  const style = document.createElement("style");
2078
- style.dataset.plugin = "@xmanrui/dsh-dingtalk";
2081
+ style.dataset.plugin = "@xmanrui/dsh-im";
2079
2082
  style.dataset.pluginCss = DINGTALK_STYLE_ID;
2080
2083
  style.textContent = CSS;
2081
2084
  document.head.appendChild(style);
@@ -3932,1315 +3935,743 @@ function useAnimationFrameScheduler() {
3932
3935
  );
3933
3936
  }
3934
3937
 
3935
- // plugin-src/client/channels/feishu/styles.js
3936
- var FEISHU_STYLE_ID = "beihuixinghe-dsh-feishu-settings";
3937
- var CSS3 = String.raw`
3938
- .bxf-page {
3939
- --bxf-accent: var(--dsw-alias-state-business-primary, #3370ff);
3940
- --bxf-success: var(--dsw-alias-state-success-primary, #20a162);
3941
- --bxf-warning: var(--dsw-alias-state-warn-primary, #d97706);
3942
- --bxf-error: var(--dsw-alias-state-error-primary, #d54941);
3943
- box-sizing: border-box;
3944
- width: 100%;
3945
- max-width: 860px;
3946
- color: var(--dsw-alias-label-primary, #1f2329);
3947
- display: flex;
3948
- flex-direction: column;
3949
- container-type: inline-size;
3950
- gap: 18px;
3951
- padding: 2px 0 24px;
3952
- }
3953
-
3954
- .bxf-page *, .bxf-page *::before, .bxf-page *::after { box-sizing: border-box; }
3955
-
3956
- .bxf-heading {
3957
- display: flex;
3958
- align-items: flex-start;
3959
- justify-content: space-between;
3960
- gap: 20px;
3961
- }
3962
-
3963
- .bxf-headingCopy { min-width: 0; }
3964
- .bxf-heading h2, .bxf-heading p, .bxf-card h3, .bxf-card p { margin: 0; }
3965
-
3966
- .bxf-eyebrow {
3967
- color: var(--dsw-alias-label-tertiary, #8f959e);
3968
- font-size: 12px;
3969
- font-weight: 600;
3970
- line-height: 18px;
3971
- letter-spacing: .08em;
3972
- text-transform: uppercase;
3973
- margin-bottom: 3px;
3974
- }
3975
-
3976
- .bxf-heading h2 {
3977
- font-size: 20px;
3978
- line-height: 28px;
3979
- font-weight: 650;
3980
- letter-spacing: -.015em;
3938
+ // plugin-src/client/channels/feishu/index.js
3939
+ var CALLBACK_REPAIR_OPERATION = FEISHU_REGISTRATION_OPERATIONS.CALLBACK_REPAIR;
3940
+ var GROUP_MESSAGE_PERMISSION_OPERATION = FEISHU_REGISTRATION_OPERATIONS.GROUP_MESSAGE_PERMISSION;
3941
+ function isCallbackRepair(value) {
3942
+ return value?.operation === CALLBACK_REPAIR_OPERATION;
3981
3943
  }
3982
-
3983
- .bxf-heading p {
3984
- max-width: 540px;
3985
- color: var(--dsw-alias-label-secondary, #646a73);
3986
- font-size: 13px;
3987
- line-height: 20px;
3988
- margin-top: 5px;
3989
- white-space: nowrap;
3944
+ function isGroupMessagePermission(value) {
3945
+ return value?.operation === GROUP_MESSAGE_PERMISSION_OPERATION;
3990
3946
  }
3991
-
3992
- .bxf-headingTools {
3993
- width: 100%;
3994
- flex: none;
3995
- display: flex;
3996
- align-items: center;
3997
- justify-content: space-between;
3998
- flex-wrap: nowrap;
3999
- gap: 8px;
3947
+ function isTargetedAppUpdate2(value) {
3948
+ return isCallbackRepair(value) || isGroupMessagePermission(value);
4000
3949
  }
4001
-
4002
- .bxf-totalBadge {
4003
- min-height: 28px;
4004
- display: inline-flex;
4005
- align-items: baseline;
4006
- gap: 3px;
4007
- border-radius: 999px;
4008
- padding: 4px 10px;
4009
- color: var(--dsw-alias-label-secondary, #646a73);
4010
- background: var(--dsw-alias-bg-module-platform, #f2f3f5);
4011
- font-size: 11px;
4012
- line-height: 16px;
4013
- white-space: nowrap;
3950
+ function SvgIcon({ children, size = 18, className, viewBox = "0 0 24 24" }) {
3951
+ return h2("svg", {
3952
+ width: size,
3953
+ height: size,
3954
+ viewBox,
3955
+ fill: "none",
3956
+ xmlns: "http://www.w3.org/2000/svg",
3957
+ "aria-hidden": "true",
3958
+ focusable: "false",
3959
+ className
3960
+ }, children);
4014
3961
  }
4015
-
4016
- .bxf-totalBadge strong { color: var(--bxf-success); font-size: 13px; }
4017
-
4018
- .bxf-card {
4019
- position: relative;
4020
- overflow: hidden;
4021
- border: 1px solid var(--dsw-alias-border-l2, #dee0e3);
4022
- border-radius: 14px;
4023
- background: var(--dsw-alias-bg-layer-3, #fff);
4024
- box-shadow: var(--dsw-shadow-lv1, 0 3px 12px rgba(31, 35, 41, .05));
3962
+ function RobotIcon({ size = 26 }) {
3963
+ return h2(
3964
+ SvgIcon,
3965
+ { size },
3966
+ h2("rect", {
3967
+ x: "5",
3968
+ y: "7.5",
3969
+ width: "14",
3970
+ height: "11",
3971
+ rx: "4",
3972
+ stroke: "currentColor",
3973
+ strokeWidth: "1.7"
3974
+ }),
3975
+ h2("path", {
3976
+ d: "M12 4.5v3M8.7 12h.01M15.3 12h.01M9.2 15.3c1.67 1.08 3.93 1.08 5.6 0M3.5 11.5v3M20.5 11.5v3",
3977
+ stroke: "currentColor",
3978
+ strokeWidth: "1.7",
3979
+ strokeLinecap: "round"
3980
+ })
3981
+ );
4025
3982
  }
4026
-
4027
- .bxf-card::before {
4028
- content: "";
4029
- pointer-events: none;
4030
- position: absolute;
4031
- inset: 0 0 auto;
4032
- height: 88px;
4033
- background:
4034
- radial-gradient(circle at 86% -35%, color-mix(in srgb, var(--bxf-accent) 18%, transparent), transparent 68%);
4035
- opacity: .85;
3983
+ function AlertIcon({ size = 22 }) {
3984
+ return h2(
3985
+ SvgIcon,
3986
+ { size },
3987
+ h2("path", {
3988
+ d: "M12 3.4 21 19H3L12 3.4Z",
3989
+ stroke: "currentColor",
3990
+ strokeWidth: "1.7",
3991
+ strokeLinejoin: "round"
3992
+ }),
3993
+ h2("path", {
3994
+ d: "M12 9v4.4M12 16.6v.01",
3995
+ stroke: "currentColor",
3996
+ strokeWidth: "1.9",
3997
+ strokeLinecap: "round"
3998
+ })
3999
+ );
4036
4000
  }
4037
-
4038
- .bxf-cardBody { position: relative; padding: 24px; }
4039
-
4040
- .bxf-intro {
4041
- min-height: 250px;
4042
- display: grid;
4043
- grid-template-columns: minmax(0, 1fr) 172px;
4044
- gap: 32px;
4045
- align-items: center;
4001
+ function QrIcon({ size = 58 }) {
4002
+ return h2(SvgIcon, { size }, h2("path", {
4003
+ d: "M4 4h6v6H4V4Zm10 0h6v6h-6V4ZM4 14h6v6H4v-6Zm10 0h2v2h-2v-2Zm4 0h2v4h-2v-4Zm-4 4h4v2h-4v-2Z",
4004
+ fill: "currentColor"
4005
+ }));
4046
4006
  }
4047
-
4048
- .bxf-introCopy { max-width: 500px; }
4049
-
4050
- .bxf-stateLabel {
4051
- display: inline-flex;
4052
- align-items: center;
4053
- gap: 7px;
4054
- color: var(--dsw-alias-label-secondary, #646a73);
4055
- font-size: 12px;
4056
- font-weight: 600;
4057
- line-height: 18px;
4058
- margin-bottom: 13px;
4007
+ var Button5 = React12.forwardRef(function Button6({ children, kind = "secondary", size, icon, className = "", ...props }, ref) {
4008
+ return h2("button", {
4009
+ ...props,
4010
+ ref,
4011
+ type: "button",
4012
+ className: `bxf-button ${className}`.trim(),
4013
+ "data-kind": kind,
4014
+ "data-size": size
4015
+ }, icon, h2("span", null, children));
4016
+ });
4017
+ function BrandMark() {
4018
+ return h2("div", { className: "bxf-brandMark" }, h2(RobotIcon, { size: 34 }));
4059
4019
  }
4060
-
4061
- .bxf-dot {
4062
- width: 7px;
4063
- height: 7px;
4064
- border-radius: 50%;
4065
- background: var(--dsw-alias-label-tertiary, #8f959e);
4066
- box-shadow: 0 0 0 4px color-mix(in srgb, var(--dsw-alias-label-tertiary, #8f959e) 12%, transparent);
4020
+ function Heading2({ totals, onAdd, onCredential, credentialOpen, adding, busy, addButtonRef }) {
4021
+ const hasBots = totals.configured > 0;
4022
+ return h2(
4023
+ "div",
4024
+ { className: "bxf-heading" },
4025
+ h2(
4026
+ "div",
4027
+ { className: "bxf-headingTools" },
4028
+ h2(
4029
+ "div",
4030
+ { className: "dim-bindActions" },
4031
+ h2(Button5, {
4032
+ kind: "primary",
4033
+ size: "small",
4034
+ className: "bxf-bindButton dim-scanButton",
4035
+ onClick: onAdd,
4036
+ disabled: adding || busy,
4037
+ ref: addButtonRef,
4038
+ "aria-busy": busy ? "true" : void 0,
4039
+ "aria-label": "\u626B\u7801\u63A5\u5165\u98DE\u4E66\u673A\u5668\u4EBA",
4040
+ icon: h2(QrActionIcon)
4041
+ }, adding ? "\u6B63\u5728\u63A5\u5165" : "\u626B\u7801\u63A5\u5165\u673A\u5668\u4EBA"),
4042
+ h2(Button5, {
4043
+ kind: "credential",
4044
+ size: "small",
4045
+ className: "dim-credentialButton",
4046
+ onClick: onCredential,
4047
+ disabled: adding || busy,
4048
+ "aria-pressed": credentialOpen,
4049
+ "aria-label": "\u4F7F\u7528 App ID \u548C App Secret \u7ED1\u5B9A\u98DE\u4E66\u673A\u5668\u4EBA",
4050
+ icon: h2(CredentialActionIcon)
4051
+ }, credentialOpen ? "\u6536\u8D77\u51ED\u636E" : "\u624B\u52A8\u63A5\u5165")
4052
+ ),
4053
+ hasBots ? h2("div", {
4054
+ className: "bxf-totalBadge dim-onlineBadge",
4055
+ "aria-label": `\u5DF2\u63A5\u5165 ${totals.configured} \u4E2A\u673A\u5668\u4EBA\uFF0C\u5176\u4E2D ${totals.connected} \u4E2A\u5728\u7EBF`
4056
+ }, h2("span", null, `${totals.connected} / ${totals.configured} \u5728\u7EBF`)) : null
4057
+ )
4058
+ );
4067
4059
  }
4068
-
4069
- .bxf-dot[data-tone="success"] {
4070
- background: var(--bxf-success);
4071
- box-shadow: 0 0 0 4px color-mix(in srgb, var(--bxf-success) 13%, transparent);
4060
+ function LoadingView2() {
4061
+ return h2(
4062
+ "div",
4063
+ {
4064
+ className: "bxf-card dim-surfaceCard dim-loadingView",
4065
+ "aria-busy": "true",
4066
+ "aria-label": "\u6B63\u5728\u8BFB\u53D6\u98DE\u4E66\u673A\u5668\u4EBA\u5217\u8868"
4067
+ },
4068
+ h2("div", { className: "dim-spinner", "aria-hidden": "true" }),
4069
+ h2("span", null, "\u6B63\u5728\u8BFB\u53D6\u98DE\u4E66\u8FDE\u63A5\u72B6\u6001\u2026")
4070
+ );
4072
4071
  }
4073
-
4074
- .bxf-dot[data-tone="warning"] {
4075
- background: var(--bxf-warning);
4076
- box-shadow: 0 0 0 4px color-mix(in srgb, var(--bxf-warning) 13%, transparent);
4077
- }
4078
-
4079
- .bxf-dot[data-tone="error"] {
4080
- background: var(--bxf-error);
4081
- box-shadow: 0 0 0 4px color-mix(in srgb, var(--bxf-error) 13%, transparent);
4082
- }
4083
-
4084
- .bxf-intro h3 {
4085
- font-size: 24px;
4086
- line-height: 34px;
4087
- font-weight: 650;
4088
- letter-spacing: -.02em;
4072
+ function EmptyView2({ onStart, busy }) {
4073
+ return h2(
4074
+ "div",
4075
+ { className: "bxf-card dim-surfaceCard" },
4076
+ h2(
4077
+ "div",
4078
+ { className: "bxf-cardBody bxf-intro dim-surfaceBody dim-emptyView" },
4079
+ h2(
4080
+ "div",
4081
+ { className: "bxf-introCopy dim-emptyCopy" },
4082
+ h2(
4083
+ "div",
4084
+ { className: "bxf-stateLabel dim-stateLabel" },
4085
+ h2("span", { className: "bxf-dot dim-stateDot" }),
4086
+ h2("span", null, "\u5C1A\u672A\u63A5\u5165\u673A\u5668\u4EBA")
4087
+ ),
4088
+ h2("h3", null, "\u626B\u7801\uFF0C\u521B\u5EFA\u7B2C\u4E00\u4E2A\u98DE\u4E66\u5165\u53E3"),
4089
+ h2("p", null, "\u65E0\u9700\u624B\u52A8\u586B\u5199 App ID\u3002\u4EE5\u540E\u8FD8\u53EF\u4EE5\u7EE7\u7EED\u6DFB\u52A0\u673A\u5668\u4EBA\uFF0C\u5206\u522B\u670D\u52A1\u4E0D\u540C\u56E2\u961F\u6216\u98DE\u4E66\u79DF\u6237\u3002"),
4090
+ h2(
4091
+ "div",
4092
+ { className: "bxf-actions dim-viewActions" },
4093
+ h2(Button5, {
4094
+ kind: "primary",
4095
+ onClick: onStart,
4096
+ disabled: busy,
4097
+ "aria-busy": busy ? "true" : void 0
4098
+ }, busy ? "\u6B63\u5728\u751F\u6210\u4E8C\u7EF4\u7801\u2026" : "\u751F\u6210\u98DE\u4E66\u4E8C\u7EF4\u7801")
4099
+ )
4100
+ ),
4101
+ h2("div", { className: "bxf-markStage dim-emptyBrand", "aria-hidden": "true" }, h2(BrandMark))
4102
+ )
4103
+ );
4089
4104
  }
4090
-
4091
- .bxf-introCopy > p {
4092
- max-width: 490px;
4093
- color: var(--dsw-alias-label-secondary, #646a73);
4094
- font-size: 14px;
4095
- line-height: 23px;
4096
- margin-top: 8px;
4105
+ function safeVerificationHref(value) {
4106
+ if (!value) return void 0;
4107
+ try {
4108
+ const url = new URL(value);
4109
+ return url.protocol === "https:" && [
4110
+ "accounts.feishu.cn",
4111
+ "accounts.larksuite.com",
4112
+ "open.feishu.cn",
4113
+ "open.larksuite.com"
4114
+ ].includes(url.hostname) && !url.port && !url.username && !url.password ? url.toString() : void 0;
4115
+ } catch {
4116
+ return void 0;
4117
+ }
4097
4118
  }
4098
-
4099
- .bxf-note {
4100
- display: flex;
4101
- gap: 8px;
4102
- align-items: flex-start;
4103
- color: var(--dsw-alias-label-tertiary, #8f959e);
4104
- font-size: 12px;
4105
- line-height: 18px;
4106
- margin-top: 16px;
4119
+ function safeQrSource2(value) {
4120
+ if (!value) return void 0;
4121
+ return /^data:image\/(?:png|webp|svg\+xml)(?:;charset=[^;,]+)?;base64,/i.test(value) ? value : void 0;
4107
4122
  }
4108
-
4109
- .bxf-note svg { flex: none; margin-top: 1px; }
4110
-
4111
- .bxf-actions {
4112
- display: flex;
4113
- align-items: center;
4114
- flex-wrap: wrap;
4115
- gap: 10px;
4116
- margin-top: 22px;
4123
+ function QrPane({ provision, now, onRefresh, onCancel, busy }) {
4124
+ const [imageFailed, setImageFailed] = React12.useState(false);
4125
+ const qrSource = safeQrSource2(provision.qrCodeDataUrl);
4126
+ const href = safeVerificationHref(provision.verificationUrl);
4127
+ const remaining = Math.max(0, provision.expiresAt - now);
4128
+ const expired = provision.expired === true || remaining === 0;
4129
+ const progress = Math.min(1, remaining / Math.max(1, provision.durationMs ?? remaining));
4130
+ const repairing = isCallbackRepair(provision);
4131
+ const grantingGroupMessages = isGroupMessagePermission(provision);
4132
+ const botName = provision.botName ?? "\u6B64\u673A\u5668\u4EBA";
4133
+ React12.useEffect(() => setImageFailed(false), [qrSource]);
4134
+ return h2(
4135
+ "div",
4136
+ { className: "bxf-card bxf-provisionCard dim-surfaceCard" },
4137
+ h2(
4138
+ "div",
4139
+ { className: "bxf-cardBody bxf-qrLayout dim-surfaceBody dim-qrLayout" },
4140
+ h2(
4141
+ "div",
4142
+ { className: "bxf-qrColumn dim-qrColumn" },
4143
+ h2(
4144
+ "div",
4145
+ { className: "bxf-qrFrame dim-qrFrame" },
4146
+ qrSource && !imageFailed ? h2("img", {
4147
+ src: qrSource,
4148
+ alt: repairing ? `\u7528\u4E8E\u4E3A${botName}\u8865\u5168\u6743\u9650\u4E0E\u56DE\u8C03\u7684\u4E00\u6B21\u6027\u6388\u6743\u4E8C\u7EF4\u7801` : grantingGroupMessages ? `\u7528\u4E8E\u4E3A${botName}\u5F00\u901A\u7FA4\u6D88\u606F\u6743\u9650\u7684\u4E00\u6B21\u6027\u6388\u6743\u4E8C\u7EF4\u7801` : "\u7528\u4E8E\u65B0\u589E DeepSeek Harness \u98DE\u4E66\u673A\u5668\u4EBA\u7684\u4E00\u6B21\u6027\u6388\u6743\u4E8C\u7EF4\u7801",
4149
+ onError: () => setImageFailed(true)
4150
+ }) : h2(
4151
+ "div",
4152
+ { className: "bxf-qrFallback dim-qrFallback" },
4153
+ h2("div", null, h2(QrIcon), h2("span", null, "\u4E8C\u7EF4\u7801\u672A\u5C31\u7EEA\uFF0C\u8BF7\u6253\u5F00\u6388\u6743\u94FE\u63A5"))
4154
+ ),
4155
+ expired ? h2(
4156
+ "div",
4157
+ { className: "bxf-expiredOverlay dim-qrExpired", role: "status" },
4158
+ h2("div", null, "\u4E8C\u7EF4\u7801\u5DF2\u5931\u6548", h2("br"), "\u8BF7\u5237\u65B0\u540E\u91CD\u65B0\u626B\u7801")
4159
+ ) : null
4160
+ ),
4161
+ h2(
4162
+ "div",
4163
+ {
4164
+ className: "bxf-countdown dim-countdown",
4165
+ "aria-label": expired ? "\u4E8C\u7EF4\u7801\u5DF2\u5931\u6548" : `\u4E8C\u7EF4\u7801\u5269\u4F59 ${formatRemaining2(remaining)}`
4166
+ },
4167
+ h2(
4168
+ "div",
4169
+ { className: "bxf-countdownTop dim-countdownTop", "aria-hidden": "true" },
4170
+ h2("span", null, expired ? "\u7B49\u5F85\u5237\u65B0" : "\u4E8C\u7EF4\u7801\u6709\u6548\u65F6\u95F4"),
4171
+ h2("strong", null, formatRemaining2(remaining))
4172
+ ),
4173
+ h2(
4174
+ "div",
4175
+ { className: "bxf-progress dim-progress", "aria-hidden": "true" },
4176
+ h2("span", { style: { "--bxf-progress": `${Math.round(progress * 100)}%` } })
4177
+ )
4178
+ )
4179
+ ),
4180
+ h2(
4181
+ "div",
4182
+ { className: "bxf-qrCopy dim-qrCopy" },
4183
+ h2(
4184
+ "div",
4185
+ { className: "bxf-stateLabel dim-stateLabel" },
4186
+ h2("span", { className: "bxf-dot dim-stateDot", "data-tone": "warning" }),
4187
+ h2("span", null, repairing ? `\u6B63\u5728\u4E3A\u300C${botName}\u300D\u8865\u5168\u6743\u9650\u4E0E\u56DE\u8C03` : grantingGroupMessages ? `\u6B63\u5728\u4E3A\u300C${botName}\u300D\u5F00\u901A\u7FA4\u6D88\u606F\u6743\u9650` : "\u6B63\u5728\u6DFB\u52A0\u65B0\u673A\u5668\u4EBA")
4188
+ ),
4189
+ h2("h3", null, expired ? "\u5237\u65B0\u4E8C\u7EF4\u7801\u540E\u7EE7\u7EED" : repairing ? "\u4F7F\u7528\u98DE\u4E66\u626B\u7801\u8865\u5168\u6743\u9650" : grantingGroupMessages ? "\u4F7F\u7528\u98DE\u4E66\u786E\u8BA4\u7FA4\u6D88\u606F\u6743\u9650" : "\u4F7F\u7528\u98DE\u4E66\u626B\u7801\u521B\u5EFA\u673A\u5668\u4EBA"),
4190
+ h2("p", null, repairing ? "\u626B\u7801\u4F1A\u66F4\u65B0\u73B0\u6709\u98DE\u4E66\u5E94\u7528\uFF0C\u6700\u591A\u589E\u91CF\u8865\u5145\u5361\u7247\u6309\u94AE\u56DE\u8C03\u3001\u8BFB\u53D6\u7528\u6237\u6D88\u606F\u5185\u56FE\u7247\u6216\u6587\u4EF6\u6240\u9700\u7684 im:message:readonly\uFF08\u98DE\u4E66\u663E\u793A\u4E3A\u201C\u83B7\u53D6\u5355\u804A\u3001\u7FA4\u7EC4\u6D88\u606F\u201D\uFF09\uFF0C\u4EE5\u53CA\u4E0A\u4F20\u673A\u5668\u4EBA\u56FE\u7247\u6216\u6587\u4EF6\u6240\u9700\u7684 im:resource\uFF1B\u4E0D\u4F1A\u521B\u5EFA\u65B0\u5E94\u7528\u3002\u786E\u8BA4\u9875\u53EA\u663E\u793A\u5F53\u524D\u7F3A\u5C11\u9879\uFF0C\u5B8C\u6210\u540E\u6B64\u673A\u5668\u4EBA\u4F1A\u77ED\u6682\u91CD\u8FDE\uFF0C\u5176\u4ED6\u673A\u5668\u4EBA\u4E0D\u53D7\u5F71\u54CD\u3002" : grantingGroupMessages ? "\u626B\u7801\u4F1A\u66F4\u65B0\u73B0\u6709\u98DE\u4E66\u5E94\u7528\uFF0C\u53EA\u589E\u91CF\u5F00\u901A\u201C\u83B7\u53D6\u7FA4\u7EC4\u4E2D\u6240\u6709\u6D88\u606F\u201D\u6743\u9650\uFF1B\u4E0D\u4F1A\u521B\u5EFA\u65B0\u5E94\u7528\u3002\u786E\u8BA4\u540E\u4F1A\u81EA\u52A8\u542F\u7528\u201C\u54CD\u5E94\u6240\u6709\u7FA4\u6D88\u606F\u201D\uFF0C\u5176\u4ED6\u673A\u5668\u4EBA\u4E0D\u53D7\u5F71\u54CD\u3002" : "\u626B\u7801\u53EA\u4F1A\u65B0\u589E\u4E00\u4E2A\u673A\u5668\u4EBA\uFF0C\u5DF2\u63A5\u5165\u7684\u673A\u5668\u4EBA\u4F1A\u7EE7\u7EED\u6B63\u5E38\u6536\u53D1\u6D88\u606F\u3002"),
4191
+ h2(
4192
+ "ol",
4193
+ { className: "bxf-steps dim-steps" },
4194
+ h2("li", null, "\u6253\u5F00\u98DE\u4E66\u79FB\u52A8\u7AEF\uFF0C\u4F7F\u7528\u626B\u4E00\u626B\u8BFB\u53D6\u4E8C\u7EF4\u7801"),
4195
+ h2("li", null, repairing ? "\u6838\u5BF9\u73B0\u6709\u5E94\u7528\u540D\u79F0\uFF0C\u5E76\u786E\u8BA4\u53EA\u65B0\u589E\u5F53\u524D\u7F3A\u5C11\u7684\u4E0A\u8FF0\u914D\u7F6E" : grantingGroupMessages ? "\u6838\u5BF9\u73B0\u6709\u5E94\u7528\uFF0C\u5E76\u786E\u8BA4\u201C\u83B7\u53D6\u7FA4\u7EC4\u4E2D\u6240\u6709\u6D88\u606F\u201D\u6743\u9650" : "\u6838\u5BF9\u5E94\u7528\u540D\u79F0\u4E0E\u6743\u9650\u8303\u56F4\uFF0C\u5E76\u786E\u8BA4\u521B\u5EFA"),
4196
+ h2("li", null, repairing ? "\u4FDD\u6301\u672C\u9875\u6253\u5F00\uFF0C\u7B49\u5F85\u6743\u9650\u4E0E\u56DE\u8C03\u8865\u5168\u5B8C\u6210" : grantingGroupMessages ? "\u4FDD\u6301\u672C\u9875\u6253\u5F00\uFF0C\u7B49\u5F85\u6743\u9650\u751F\u6548\u5E76\u81EA\u52A8\u5207\u6362\u54CD\u5E94\u65B9\u5F0F" : "\u4FDD\u6301\u672C\u9875\u6253\u5F00\uFF0C\u7B49\u5F85\u65B0\u673A\u5668\u4EBA\u7684\u957F\u8FDE\u63A5\u5C31\u7EEA")
4197
+ ),
4198
+ h2(
4199
+ "div",
4200
+ { className: "bxf-actions dim-viewActions" },
4201
+ expired ? h2(Button5, {
4202
+ kind: "primary",
4203
+ onClick: onRefresh,
4204
+ disabled: busy
4205
+ }, busy ? "\u5237\u65B0\u4E2D\u2026" : "\u5237\u65B0\u4E8C\u7EF4\u7801") : href ? h2("a", {
4206
+ className: "bxf-button bxf-link",
4207
+ "data-kind": "secondary",
4208
+ href,
4209
+ target: "_blank",
4210
+ rel: "noopener noreferrer"
4211
+ }, h2("span", null, "\u5728\u98DE\u4E66\u4E2D\u6253\u5F00")) : null,
4212
+ !expired ? h2(Button5, { onClick: onRefresh, disabled: busy }, "\u6362\u4E00\u4E2A\u4E8C\u7EF4\u7801") : null,
4213
+ h2(Button5, { onClick: onCancel, disabled: busy }, repairing ? "\u53D6\u6D88\u8865\u5168" : grantingGroupMessages ? "\u53D6\u6D88\u6388\u6743" : "\u53D6\u6D88\u6DFB\u52A0")
4214
+ )
4215
+ )
4216
+ )
4217
+ );
4117
4218
  }
4118
-
4119
- .bxf-button {
4120
- appearance: none;
4121
- min-height: 36px;
4122
- display: inline-flex;
4123
- align-items: center;
4124
- justify-content: center;
4125
- gap: 7px;
4126
- border: 1px solid var(--dsw-alias-border-l2, #dee0e3);
4127
- border-radius: 8px;
4128
- padding: 7px 13px;
4129
- color: var(--dsw-alias-label-primary, #1f2329);
4130
- background: var(--dsw-alias-bg-layer-1, #fff);
4131
- font: inherit;
4132
- font-size: 13px;
4133
- font-weight: 550;
4134
- line-height: 20px;
4135
- text-decoration: none;
4136
- cursor: pointer;
4137
- transition: background .15s var(--ds-ease-in-out, ease), border-color .15s var(--ds-ease-in-out, ease), transform .15s var(--ds-ease-in-out, ease);
4219
+ function ProvisionProgress({ phase, provision, onCancel, busy }) {
4220
+ const connecting = phase === "connecting";
4221
+ const repairing = isCallbackRepair(provision);
4222
+ const grantingGroupMessages = isGroupMessagePermission(provision);
4223
+ return h2(
4224
+ "div",
4225
+ {
4226
+ className: "bxf-card bxf-provisionCard dim-surfaceCard dim-loadingView",
4227
+ "aria-busy": "true"
4228
+ },
4229
+ h2("div", { className: "dim-spinner", "aria-hidden": "true" }),
4230
+ h2("h3", null, connecting ? repairing ? "\u5DF2\u786E\u8BA4\uFF0C\u6B63\u5728\u5B8C\u6210\u6743\u9650\u4E0E\u56DE\u8C03\u914D\u7F6E" : grantingGroupMessages ? "\u5DF2\u786E\u8BA4\uFF0C\u6B63\u5728\u542F\u7528\u5168\u90E8\u6D88\u606F\u6A21\u5F0F" : "\u5DF2\u786E\u8BA4\uFF0C\u6B63\u5728\u8FDE\u63A5\u65B0\u673A\u5668\u4EBA" : repairing ? "\u6B63\u5728\u51C6\u5907\u6743\u9650\u8865\u5168\u4E8C\u7EF4\u7801" : grantingGroupMessages ? "\u6B63\u5728\u51C6\u5907\u6743\u9650\u6388\u6743\u4E8C\u7EF4\u7801" : "\u6B63\u5728\u51C6\u5907\u6388\u6743\u4E8C\u7EF4\u7801"),
4231
+ h2("p", null, connecting ? repairing ? "\u914D\u7F6E\u5DF2\u63D0\u4EA4\uFF0C\u6B63\u5728\u4FDD\u5B58\u6743\u9650\u3001\u9A8C\u8BC1\u5361\u7247\u56DE\u8C03\u5E76\u91CD\u8FDE\u6B64\u673A\u5668\u4EBA\uFF1B\u6B64\u9636\u6BB5\u65E0\u6CD5\u53D6\u6D88\uFF0C\u5176\u4ED6\u673A\u5668\u4EBA\u4E0D\u4F1A\u4E2D\u65AD\u3002" : grantingGroupMessages ? "\u6743\u9650\u914D\u7F6E\u5DF2\u63D0\u4EA4\uFF0C\u6B63\u5728\u4FDD\u5B58\u8BBE\u7F6E\u5E76\u91CD\u8FDE\u6B64\u673A\u5668\u4EBA\uFF1B\u6B64\u9636\u6BB5\u65E0\u6CD5\u53D6\u6D88\uFF0C\u5176\u4ED6\u673A\u5668\u4EBA\u4E0D\u4F1A\u4E2D\u65AD\u3002" : "\u6B63\u5728\u5B89\u5168\u4FDD\u5B58\u51ED\u636E\u5E76\u68C0\u67E5\u65B0\u673A\u5668\u4EBA\u7684\u6D88\u606F\u901A\u9053\uFF0C\u5176\u4ED6\u673A\u5668\u4EBA\u4E0D\u4F1A\u4E2D\u65AD\u3002" : repairing ? "\u6B63\u5728\u4E3A\u73B0\u6709\u98DE\u4E66\u5E94\u7528\u7533\u8BF7\u4E00\u6B21\u6027\u66F4\u65B0\u4E8C\u7EF4\u7801\uFF0C\u8BF7\u7A0D\u5019\u3002" : grantingGroupMessages ? "\u6B63\u5728\u4E3A\u73B0\u6709\u98DE\u4E66\u5E94\u7528\u7533\u8BF7\u7FA4\u6D88\u606F\u6743\u9650\u4E8C\u7EF4\u7801\uFF0C\u8BF7\u7A0D\u5019\u3002" : "\u6B63\u5728\u5411\u98DE\u4E66\u7533\u8BF7\u4E00\u6B21\u6027\u6388\u6743\u4E8C\u7EF4\u7801\uFF0C\u8BF7\u7A0D\u5019\u3002"),
4232
+ connecting && onCancel ? h2(
4233
+ "div",
4234
+ { className: "bxf-actions dim-viewActions", style: { justifyContent: "center" } },
4235
+ h2(Button5, { onClick: onCancel, disabled: busy }, repairing ? "\u53D6\u6D88\u8865\u5168" : grantingGroupMessages ? "\u53D6\u6D88\u6388\u6743" : "\u53D6\u6D88\u6DFB\u52A0")
4236
+ ) : null
4237
+ );
4138
4238
  }
4139
-
4140
- .bxf-button:hover:not(:disabled) {
4141
- background: var(--dsw-alias-interactive-bg-hover, #f2f3f5);
4142
- border-color: var(--dsw-alias-border-l1, #c9cdd4);
4239
+ function ProvisionError2({ error, provision, onRetry, onCancel, busy }) {
4240
+ const repairing = isCallbackRepair(provision);
4241
+ const grantingGroupMessages = isGroupMessagePermission(provision);
4242
+ return h2(
4243
+ "div",
4244
+ { className: "bxf-card bxf-provisionCard dim-surfaceCard" },
4245
+ h2(
4246
+ "div",
4247
+ { className: "bxf-inlineError dim-inlineError", role: "alert" },
4248
+ h2(
4249
+ "div",
4250
+ null,
4251
+ h2("h3", null, repairing ? "\u6743\u9650\u4E0E\u56DE\u8C03\u6CA1\u6709\u8865\u5168\u5B8C\u6210" : grantingGroupMessages ? "\u7FA4\u6D88\u606F\u6743\u9650\u6CA1\u6709\u5F00\u901A\u5B8C\u6210" : "\u65B0\u673A\u5668\u4EBA\u6CA1\u6709\u6DFB\u52A0\u5B8C\u6210"),
4252
+ h2("p", null, error.message),
4253
+ error.code ? h2("span", { className: "bxf-errorCode" }, error.code) : null,
4254
+ h2(
4255
+ "div",
4256
+ { className: "bxf-actions dim-viewActions" },
4257
+ h2(
4258
+ Button5,
4259
+ { kind: "primary", onClick: onRetry, disabled: busy },
4260
+ busy ? "\u91CD\u8BD5\u4E2D\u2026" : "\u91CD\u65B0\u751F\u6210\u4E8C\u7EF4\u7801"
4261
+ ),
4262
+ h2(Button5, { onClick: onCancel, disabled: busy }, "\u5173\u95ED")
4263
+ )
4264
+ )
4265
+ )
4266
+ );
4143
4267
  }
4144
-
4145
- .bxf-button:active:not(:disabled) { transform: translateY(1px); }
4146
-
4147
- .bxf-button:focus-visible, .bxf-link:focus-visible {
4148
- outline: 2px solid var(--bxf-accent);
4149
- outline-offset: 2px;
4150
- }
4151
-
4152
- .bxf-button:disabled { cursor: not-allowed; opacity: .55; }
4153
-
4154
- .bxf-button[data-kind="primary"] {
4155
- border-color: var(--bxf-accent);
4156
- color: #fff;
4157
- background: var(--bxf-accent);
4158
- box-shadow: 0 4px 12px color-mix(in srgb, var(--bxf-accent) 24%, transparent);
4159
- }
4160
-
4161
- .bxf-button[data-kind="primary"]:hover:not(:disabled) {
4162
- border-color: color-mix(in srgb, var(--bxf-accent) 86%, #000);
4163
- background: color-mix(in srgb, var(--bxf-accent) 90%, #000);
4164
- }
4165
-
4166
- .bxf-button[data-kind="danger"] { color: var(--bxf-error); }
4167
- .bxf-button[data-size="small"] { min-height: 32px; padding: 5px 10px; font-size: 12px; }
4168
- .bxf-bindButton { flex: none; white-space: nowrap; }
4169
-
4170
- .bxf-provisionCard {
4171
- border-color: color-mix(in srgb, var(--bxf-accent) 32%, var(--dsw-alias-border-l2, #dee0e3));
4172
- }
4173
-
4174
- .bxf-markStage {
4175
- position: relative;
4176
- width: 156px;
4177
- height: 156px;
4178
- display: grid;
4179
- place-items: center;
4180
- justify-self: end;
4181
- }
4182
-
4183
- .bxf-markStage::before, .bxf-markStage::after {
4184
- content: "";
4185
- position: absolute;
4186
- border-radius: 50%;
4187
- }
4188
-
4189
- .bxf-markStage::before {
4190
- inset: 12px;
4191
- border: 1px solid color-mix(in srgb, var(--bxf-accent) 18%, var(--dsw-alias-border-l2, #dee0e3));
4192
- background: color-mix(in srgb, var(--bxf-accent) 4%, var(--dsw-alias-bg-layer-1, #fff));
4193
- }
4194
-
4195
- .bxf-markStage::after {
4196
- inset: 0;
4197
- border: 1px dashed color-mix(in srgb, var(--bxf-accent) 16%, transparent);
4198
- animation: bxf-rotate 18s linear infinite;
4199
- }
4200
-
4201
- .bxf-brandMark {
4202
- position: relative;
4203
- z-index: 1;
4204
- width: 68px;
4205
- height: 68px;
4206
- display: grid;
4207
- place-items: center;
4208
- border-radius: 20px;
4209
- color: #fff;
4210
- background: var(--bxf-accent);
4211
- box-shadow: 0 12px 28px color-mix(in srgb, var(--bxf-accent) 28%, transparent);
4268
+ var HEALTH_LABELS = {
4269
+ connected: "\u8FD0\u884C\u6B63\u5E38",
4270
+ connecting: "\u6B63\u5728\u8FDE\u63A5",
4271
+ offline: "\u8FDE\u63A5\u4E2D\u65AD",
4272
+ error: "\u9700\u8981\u5904\u7406"
4273
+ };
4274
+ function formatCheckedTime(timestamp7) {
4275
+ if (!timestamp7) return "\u5C1A\u672A\u68C0\u67E5";
4276
+ try {
4277
+ return new Intl.DateTimeFormat("zh-CN", {
4278
+ hour: "2-digit",
4279
+ minute: "2-digit",
4280
+ second: "2-digit"
4281
+ }).format(new Date(timestamp7));
4282
+ } catch {
4283
+ return "\u521A\u521A";
4284
+ }
4212
4285
  }
4213
-
4214
- .bxf-qrLayout {
4215
- display: grid;
4216
- grid-template-columns: 236px minmax(0, 1fr);
4217
- align-items: center;
4218
- gap: 32px;
4286
+ function connectionTestNotice2(value) {
4287
+ if (value?.testMessage?.sent === true) {
4288
+ return "\u6D4B\u8BD5\u6D88\u606F\u5DF2\u53D1\u9001\uFF0C\u8BF7\u5230\u98DE\u4E66\u4F1A\u8BDD\u4E2D\u786E\u8BA4\u3002";
4289
+ }
4290
+ if (value?.testMessage?.code === "test-target-unavailable") {
4291
+ return "\u8FDE\u63A5\u68C0\u67E5\u5B8C\u6210\u3002\u673A\u5668\u4EBA\u5C1A\u672A\u6536\u5230\u53EF\u7528\u4E8E\u6D4B\u8BD5\u7684\u79C1\u804A\u6D88\u606F\u3002";
4292
+ }
4293
+ return value?.testMessage ? "\u8FDE\u63A5\u68C0\u67E5\u5B8C\u6210\uFF0C\u4F46\u6D4B\u8BD5\u6D88\u606F\u53D1\u9001\u5931\u8D25\u3002" : null;
4219
4294
  }
4220
-
4221
- .bxf-qrColumn { min-width: 0; }
4222
-
4223
- .bxf-qrFrame {
4224
- position: relative;
4225
- width: 222px;
4226
- height: 222px;
4227
- display: grid;
4228
- place-items: center;
4229
- border: 1px solid var(--dsw-alias-border-l2, #dee0e3);
4230
- border-radius: 14px;
4231
- padding: 13px;
4232
- background: #fff;
4233
- box-shadow: 0 8px 24px rgba(31, 35, 41, .07);
4295
+ function RemoveConfirmation2({ bot, busy, onConfirm, onCancel }) {
4296
+ const cancelRef = React12.useRef(null);
4297
+ const idPart = bot.botId.replace(/[^a-zA-Z0-9_-]/g, "-");
4298
+ const titleId = `bxf-remove-title-${idPart}`;
4299
+ const descriptionId = `bxf-remove-description-${idPart}`;
4300
+ React12.useEffect(() => cancelRef.current?.focus(), []);
4301
+ return h2(
4302
+ "div",
4303
+ {
4304
+ className: "bxf-confirm dim-confirm",
4305
+ role: "alertdialog",
4306
+ "aria-labelledby": titleId,
4307
+ "aria-describedby": descriptionId,
4308
+ onKeyDown: (event) => {
4309
+ if (event.key === "Escape" && !busy) {
4310
+ event.preventDefault();
4311
+ onCancel();
4312
+ }
4313
+ }
4314
+ },
4315
+ h2("h4", { id: titleId }, `\u4ECE DeepSeek Harness \u79FB\u9664\u201C${bot.bot.name}\u201D\uFF1F`),
4316
+ h2(
4317
+ "p",
4318
+ { id: descriptionId },
4319
+ "\u6B64\u64CD\u4F5C\u4F1A\u505C\u6B62\u8FD9\u4E2A\u673A\u5668\u4EBA\u7684\u8FDE\u63A5\uFF0C\u5E76\u5220\u9664\u4FDD\u5B58\u5728\u672C\u673A\u7684\u63A5\u5165\u914D\u7F6E\u548C\u51ED\u636E\u3002\u98DE\u4E66\u5F00\u653E\u5E73\u53F0\u4E2D\u7684\u5E94\u7528\u4E0D\u4F1A\u88AB\u81EA\u52A8\u5220\u9664\uFF0C\u5176\u4ED6\u673A\u5668\u4EBA\u4E5F\u4E0D\u53D7\u5F71\u54CD\u3002"
4320
+ ),
4321
+ h2(
4322
+ "div",
4323
+ { className: "bxf-actions dim-viewActions" },
4324
+ h2(Button5, { ref: cancelRef, onClick: onCancel, disabled: busy }, "\u4FDD\u7559\u673A\u5668\u4EBA"),
4325
+ h2(
4326
+ Button5,
4327
+ { kind: "danger", onClick: onConfirm, disabled: busy },
4328
+ busy ? "\u6B63\u5728\u79FB\u9664\u2026" : "\u786E\u8BA4\u79FB\u9664\u63A5\u5165"
4329
+ )
4330
+ )
4331
+ );
4234
4332
  }
4235
-
4236
- .bxf-qrFrame::before, .bxf-qrFrame::after {
4237
- content: "";
4238
- position: absolute;
4239
- width: 24px;
4240
- height: 24px;
4241
- border-color: var(--bxf-accent);
4242
- border-style: solid;
4333
+ function GroupResponseModeEditor({
4334
+ value,
4335
+ permissionGranted = false,
4336
+ disabled = false,
4337
+ authorizationDisabled = false,
4338
+ onSave,
4339
+ onAuthorize
4340
+ }) {
4341
+ const current = normalizeGroupResponseMode(value);
4342
+ const [saving, setSaving] = React12.useState(false);
4343
+ const [authorizing, setAuthorizing] = React12.useState(false);
4344
+ const [error, setError] = React12.useState(null);
4345
+ const change = async (event) => {
4346
+ const next = normalizeGroupResponseMode(event.target.value);
4347
+ if (next === current || saving || disabled) return;
4348
+ setSaving(true);
4349
+ setError(null);
4350
+ try {
4351
+ await onSave?.(next);
4352
+ } catch (cause) {
4353
+ setError(cause?.message ?? "\u7FA4\u804A\u54CD\u5E94\u65B9\u5F0F\u4FEE\u6539\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5\u3002");
4354
+ } finally {
4355
+ setSaving(false);
4356
+ }
4357
+ };
4358
+ const authorize = async () => {
4359
+ if (current !== "all" || saving || authorizing || disabled || authorizationDisabled) return;
4360
+ setAuthorizing(true);
4361
+ setError(null);
4362
+ try {
4363
+ await onAuthorize?.();
4364
+ } catch (cause) {
4365
+ setError(cause?.message ?? "\u7FA4\u6D88\u606F\u6743\u9650\u6388\u6743\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5\u3002");
4366
+ } finally {
4367
+ setAuthorizing(false);
4368
+ }
4369
+ };
4370
+ return h2(
4371
+ "div",
4372
+ { className: "bxf-responseMode dim-responseMode" },
4373
+ h2(
4374
+ "div",
4375
+ { className: "bxf-responseModeHeader dim-responseModeHeader" },
4376
+ h2("span", null, "\u7FA4\u804A\u54CD\u5E94\u65B9\u5F0F"),
4377
+ saving || authorizing ? h2(
4378
+ "span",
4379
+ { className: "bxf-responseModeStatus dim-responseModeStatus" },
4380
+ saving ? "\u4FDD\u5B58\u4E2D\u2026" : "\u6B63\u5728\u51C6\u5907\u6388\u6743\u2026"
4381
+ ) : null
4382
+ ),
4383
+ h2(
4384
+ "select",
4385
+ {
4386
+ className: "bxf-responseModeSelect dim-responseModeSelect",
4387
+ value: current,
4388
+ disabled: disabled || saving,
4389
+ "aria-label": "\u7FA4\u804A\u54CD\u5E94\u65B9\u5F0F",
4390
+ onChange: (event) => {
4391
+ void change(event);
4392
+ }
4393
+ },
4394
+ h2("option", { value: "mention" }, "\u4EC5\u5728 @\u673A\u5668\u4EBA\u65F6\u54CD\u5E94\uFF08\u63A8\u8350\uFF09"),
4395
+ h2("option", { value: "all" }, "\u54CD\u5E94\u6240\u6709\u7FA4\u6D88\u606F")
4396
+ ),
4397
+ h2(
4398
+ "small",
4399
+ { className: "bxf-responseModeHelp dim-responseModeHelp" },
4400
+ current === "mention" ? permissionGranted ? "\u79C1\u804A\u59CB\u7EC8\u54CD\u5E94\uFF1B\u7FA4\u804A\u4EC5\u5904\u7406\u660E\u786E @\u5F53\u524D\u673A\u5668\u4EBA\u7684\u6D88\u606F\u3002\u7FA4\u6D88\u606F\u6743\u9650\u5DF2\u5F00\u901A\uFF0C\u518D\u6B21\u5207\u6362\u65E0\u9700\u6388\u6743\u3002" : "\u79C1\u804A\u59CB\u7EC8\u54CD\u5E94\uFF1B\u7FA4\u804A\u4EC5\u5904\u7406\u660E\u786E @\u5F53\u524D\u673A\u5668\u4EBA\u7684\u6D88\u606F\u3002\u9009\u62E9\u5168\u90E8\u6D88\u606F\u540E\u4F1A\u6253\u5F00\u98DE\u4E66\u5B98\u65B9\u6388\u6743\u6D41\u7A0B\u3002" : permissionGranted ? "\u5DF2\u5F00\u901A\u201C\u83B7\u53D6\u7FA4\u7EC4\u4E2D\u6240\u6709\u6D88\u606F\u201D\u6743\u9650\uFF08im:message.group_msg\uFF09\uFF1B\u673A\u5668\u4EBA\u4F1A\u5904\u7406\u7FA4\u804A\u4E2D\u7684\u6240\u6709\u53EF\u89C1\u6D88\u606F\u3002" : "\u5C1A\u672A\u786E\u8BA4\u201C\u83B7\u53D6\u7FA4\u7EC4\u4E2D\u6240\u6709\u6D88\u606F\u201D\u6743\u9650\uFF0C\u8BF7\u5B8C\u6210\u98DE\u4E66\u6388\u6743\u3002"
4401
+ ),
4402
+ current === "all" ? h2(
4403
+ "div",
4404
+ { className: "bxf-responseModePermissionAction dim-responseModePermissionAction" },
4405
+ h2(Button5, {
4406
+ className: "bxf-responseModePermissionButton",
4407
+ size: "small",
4408
+ disabled: disabled || authorizationDisabled || saving || authorizing,
4409
+ "aria-busy": authorizing ? "true" : void 0,
4410
+ "aria-label": permissionGranted ? "\u91CD\u65B0\u6388\u6743\u7FA4\u6D88\u606F\u6743\u9650" : "\u6388\u6743\u7FA4\u6D88\u606F\u6743\u9650",
4411
+ onClick: () => {
4412
+ void authorize();
4413
+ }
4414
+ }, authorizing ? "\u6B63\u5728\u51C6\u5907\u2026" : permissionGranted ? "\u91CD\u65B0\u6388\u6743" : "\u53BB\u6388\u6743")
4415
+ ) : null,
4416
+ error ? h2("p", {
4417
+ className: "bxf-responseModeError dim-responseModeError",
4418
+ role: "alert"
4419
+ }, error) : null
4420
+ );
4243
4421
  }
4244
-
4245
- .bxf-qrFrame::before { inset: -3px auto auto -3px; border-width: 2px 0 0 2px; border-radius: 5px 0 0; }
4246
- .bxf-qrFrame::after { inset: auto -3px -3px auto; border-width: 0 2px 2px 0; border-radius: 0 0 5px; }
4247
- .bxf-qrFrame img { width: 100%; height: 100%; display: block; object-fit: contain; }
4248
-
4249
- .bxf-qrFallback {
4250
- width: 100%;
4251
- height: 100%;
4252
- display: grid;
4253
- place-items: center;
4254
- border-radius: 8px;
4255
- color: var(--bxf-accent);
4256
- background: #f7f9ff;
4257
- text-align: center;
4258
- padding: 20px;
4422
+ function BotCard({
4423
+ connection,
4424
+ busy,
4425
+ repairDisabled,
4426
+ provisionContent,
4427
+ provisionRef,
4428
+ actionError,
4429
+ testNotice,
4430
+ removing,
4431
+ onReconnect,
4432
+ onRepairCallback,
4433
+ onWorkspaceSave,
4434
+ onAgentPresetSave,
4435
+ onGroupResponseModeSave,
4436
+ onGroupMessagePermissionAuthorize,
4437
+ onRequestRemove,
4438
+ onConfirmRemove,
4439
+ onCancelRemove,
4440
+ cardRef,
4441
+ removeButtonRef
4442
+ }) {
4443
+ const { bot, health, state, connected } = connection;
4444
+ const repairTooltipId = React12.useId();
4445
+ const stateForDisplay = busy === "reconnect" ? "connecting" : state;
4446
+ const tone = stateForDisplay === "connected" ? "success" : stateForDisplay === "connecting" ? "warning" : "error";
4447
+ const summary = actionError?.message ?? connection.error?.message ?? (connected ? null : health.summary);
4448
+ const titleId = `bxf-bot-${connection.botId.replace(/[^a-zA-Z0-9_-]/g, "-")}`;
4449
+ return h2(
4450
+ "article",
4451
+ {
4452
+ className: "bxf-card bxf-botCard dim-botCard",
4453
+ "aria-labelledby": titleId,
4454
+ "data-bot-id": connection.botId,
4455
+ tabIndex: -1,
4456
+ ref: cardRef
4457
+ },
4458
+ h2(
4459
+ "div",
4460
+ { className: "bxf-cardBody dim-botCardBody" },
4461
+ h2(
4462
+ "div",
4463
+ { className: "bxf-connectedTop dim-botCardTop" },
4464
+ h2(
4465
+ "div",
4466
+ { className: "bxf-botIdentity dim-botIdentity" },
4467
+ h2(
4468
+ "div",
4469
+ { className: "bxf-avatar dim-botAvatar", "aria-hidden": "true" },
4470
+ h2(FeishuLogoGlyph, { size: 34 })
4471
+ ),
4472
+ h2(
4473
+ "div",
4474
+ { className: "bxf-botName dim-botName" },
4475
+ h2("h3", { id: titleId, title: bot.name }, bot.name),
4476
+ h2("p", { title: bot.appIdMasked }, bot.appIdMasked ?? "\u5E94\u7528\u6807\u8BC6\u5DF2\u5B89\u5168\u4FDD\u5B58")
4477
+ )
4478
+ ),
4479
+ h2(BotStatusMeta, {
4480
+ className: "bxf-healthPill",
4481
+ dotClassName: "bxf-dot",
4482
+ tone,
4483
+ stateLabel: HEALTH_LABELS[stateForDisplay] ?? "\u72B6\u6001\u672A\u77E5",
4484
+ lastCheckedAt: health.lastCheckedAt,
4485
+ formatCheckedTime,
4486
+ healthState: stateForDisplay
4487
+ })
4488
+ ),
4489
+ h2(WorkspaceEditor, {
4490
+ workspace: connection.workspace,
4491
+ disabled: Boolean(busy),
4492
+ onSave: onWorkspaceSave
4493
+ }),
4494
+ h2(AgentPresetEditor, {
4495
+ agentPreset: connection.agentPreset,
4496
+ disabled: Boolean(busy),
4497
+ onSave: onAgentPresetSave
4498
+ }),
4499
+ h2(GroupResponseModeEditor, {
4500
+ value: connection.groupResponseMode,
4501
+ permissionGranted: connection.groupMessagePermissionGranted,
4502
+ disabled: Boolean(busy),
4503
+ authorizationDisabled: repairDisabled,
4504
+ onSave: onGroupResponseModeSave,
4505
+ onAuthorize: onGroupMessagePermissionAuthorize
4506
+ }),
4507
+ provisionContent ? h2("section", {
4508
+ className: "bxf-botProvision dim-botProvision",
4509
+ "aria-label": `${bot.name}\u7684\u98DE\u4E66\u6388\u6743\u6D41\u7A0B`,
4510
+ "data-provision-for": connection.botId,
4511
+ ref: provisionRef,
4512
+ tabIndex: -1
4513
+ }, provisionContent) : null,
4514
+ h2(
4515
+ "div",
4516
+ { className: "bxf-connectedFooter dim-cardFooter" },
4517
+ h2(
4518
+ "div",
4519
+ { className: "dim-cardFooterLayout" },
4520
+ h2(
4521
+ "div",
4522
+ { className: "bxf-actions bxf-botActions dim-cardActions" },
4523
+ h2(Button5, {
4524
+ className: "dim-cardAction",
4525
+ onClick: onReconnect,
4526
+ disabled: Boolean(busy),
4527
+ "aria-busy": busy === "reconnect" ? "true" : void 0,
4528
+ "aria-label": `${connected ? "\u68C0\u67E5\u8FDE\u63A5" : "\u91CD\u8BD5\u8FDE\u63A5"}${bot.name}`
4529
+ }, busy === "reconnect" ? connected ? "\u68C0\u67E5\u4E2D\u2026" : "\u6B63\u5728\u8FDE\u63A5\u2026" : connected ? "\u68C0\u67E5\u8FDE\u63A5" : "\u91CD\u8BD5\u8FDE\u63A5"),
4530
+ h2(
4531
+ "span",
4532
+ { className: "bxf-repairAction" },
4533
+ h2(Button5, {
4534
+ className: "bxf-repairButton dim-cardAction",
4535
+ onClick: onRepairCallback,
4536
+ disabled: Boolean(busy) || repairDisabled,
4537
+ "aria-busy": busy === "callback-repair" ? "true" : void 0,
4538
+ "aria-label": `\u4E3A${bot.name}\u8865\u5168\u6743\u9650\u4E0E\u56DE\u8C03`,
4539
+ "aria-describedby": repairTooltipId
4540
+ }, busy === "callback-repair" ? "\u7B49\u5F85\u626B\u7801\u2026" : "\u8865\u5168\u6743\u9650"),
4541
+ h2(
4542
+ "span",
4543
+ {
4544
+ id: repairTooltipId,
4545
+ className: "bxf-repairTooltip",
4546
+ role: "tooltip"
4547
+ },
4548
+ h2("strong", null, "\u8865\u5168\u8303\u56F4"),
4549
+ h2("span", null, "\u6700\u591A\u589E\u91CF\u6DFB\u52A0\u5361\u7247\u56DE\u8C03 card.action.trigger\u3001\u8BFB\u53D6\u6D88\u606F\u5185\u56FE\u7247\u6216\u6587\u4EF6\u6240\u9700\u7684 im:message:readonly\uFF08\u98DE\u4E66\u663E\u793A\u4E3A\u201C\u83B7\u53D6\u5355\u804A\u3001\u7FA4\u7EC4\u6D88\u606F\u201D\uFF09\uFF0C\u4EE5\u53CA\u4E0A\u4F20\u673A\u5668\u4EBA\u56FE\u7247\u6216\u6587\u4EF6\u6240\u9700\u7684 im:resource\uFF1B\u786E\u8BA4\u9875\u53EA\u663E\u793A\u5F53\u524D\u7F3A\u5C11\u9879\uFF0C\u4E0D\u4F1A\u521B\u5EFA\u65B0\u5E94\u7528\u3002")
4550
+ )
4551
+ ),
4552
+ h2(Button5, {
4553
+ className: "dim-cardAction",
4554
+ kind: "danger",
4555
+ onClick: onRequestRemove,
4556
+ disabled: Boolean(busy),
4557
+ ref: removeButtonRef,
4558
+ "aria-label": `\u4ECE DeepSeek Harness \u79FB\u9664${bot.name}`
4559
+ }, "\u79FB\u9664\u63A5\u5165")
4560
+ ),
4561
+ summary ? h2(
4562
+ "div",
4563
+ { className: "bxf-healthSummary dim-cardSummary", "data-error": actionError || connection.error ? "true" : void 0 },
4564
+ summary
4565
+ ) : null,
4566
+ connection.lastMessageError ? h2(LastMessageErrorSummary, {
4567
+ className: "bxf-healthSummary",
4568
+ error: connection.lastMessageError
4569
+ }) : null,
4570
+ testNotice ? h2("div", {
4571
+ className: "bxf-healthSummary dim-cardFeedback",
4572
+ role: "status"
4573
+ }, testNotice) : null
4574
+ )
4575
+ )
4576
+ ),
4577
+ removing ? h2(RemoveConfirmation2, {
4578
+ bot: connection,
4579
+ busy: busy === "delete",
4580
+ onConfirm: onConfirmRemove,
4581
+ onCancel: onCancelRemove
4582
+ }) : null
4583
+ );
4259
4584
  }
4260
-
4261
- .bxf-qrFallback span { display: block; color: #646a73; font-size: 12px; line-height: 18px; margin-top: 8px; }
4262
-
4263
- .bxf-expiredOverlay {
4264
- position: absolute;
4265
- inset: 10px;
4266
- display: grid;
4267
- place-items: center;
4268
- border-radius: 9px;
4269
- color: #1f2329;
4270
- background: rgba(255, 255, 255, .94);
4271
- backdrop-filter: blur(3px);
4272
- font-size: 13px;
4273
- font-weight: 600;
4274
- text-align: center;
4585
+ function BotList(props) {
4586
+ return h2(
4587
+ "section",
4588
+ { className: "bxf-listSection dim-listSection", "aria-labelledby": "bxf-bot-list-title" },
4589
+ h2(ChannelListHeading, {
4590
+ className: "bxf-listHeading",
4591
+ id: "bxf-bot-list-title",
4592
+ title: "\u5DF2\u63A5\u5165\u7684\u673A\u5668\u4EBA",
4593
+ connectionLabel: "\u957F\u8FDE\u63A5"
4594
+ }),
4595
+ h2(
4596
+ "ul",
4597
+ { className: "bxf-botList dim-botList", role: "list" },
4598
+ props.bots.map((bot) => h2(
4599
+ "li",
4600
+ { key: bot.botId },
4601
+ h2(BotCard, {
4602
+ connection: bot,
4603
+ busy: props.busyByBot[bot.botId] ?? (isTargetedAppUpdate2(props.provisioning) && props.provisioning.botId === bot.botId ? props.provisioning.operation : void 0),
4604
+ repairDisabled: Boolean(props.provisioning),
4605
+ provisionContent: isTargetedAppUpdate2(props.provisioning) && props.provisioning.botId === bot.botId ? props.provisionContent : null,
4606
+ provisionRef: props.provisionRef,
4607
+ actionError: props.errorsByBot[bot.botId],
4608
+ testNotice: props.testNoticesByBot[bot.botId],
4609
+ removing: props.removeTargetId === bot.botId,
4610
+ onReconnect: () => props.onReconnect(bot),
4611
+ onRepairCallback: () => props.onRepairCallback(bot),
4612
+ onWorkspaceSave: (workspace) => props.onWorkspaceSave(bot, workspace),
4613
+ onAgentPresetSave: (agentPreset) => props.onAgentPresetSave(bot, agentPreset),
4614
+ onGroupResponseModeSave: (groupResponseMode) => props.onGroupResponseModeSave(bot, groupResponseMode),
4615
+ onGroupMessagePermissionAuthorize: () => props.onGroupMessagePermissionAuthorize(bot),
4616
+ onRequestRemove: () => props.onRequestRemove(bot),
4617
+ onConfirmRemove: () => props.onConfirmRemove(bot),
4618
+ onCancelRemove: props.onCancelRemove,
4619
+ cardRef: (node) => props.setCardRef(bot.botId, node),
4620
+ removeButtonRef: (node) => props.setRemoveButtonRef(bot.botId, node)
4621
+ })
4622
+ ))
4623
+ )
4624
+ );
4275
4625
  }
4276
-
4277
- .bxf-countdown {
4278
- width: 222px;
4279
- color: var(--dsw-alias-label-tertiary, #8f959e);
4280
- font-variant-numeric: tabular-nums;
4281
- font-size: 11px;
4282
- line-height: 17px;
4283
- margin-top: 11px;
4626
+ function PageError({ error, onRetry, busy }) {
4627
+ return h2(
4628
+ "div",
4629
+ { className: "bxf-card dim-surfaceCard" },
4630
+ h2(
4631
+ "div",
4632
+ { className: "bxf-error dim-inlineError", role: "alert" },
4633
+ h2(
4634
+ "div",
4635
+ null,
4636
+ h2("h3", null, "\u65E0\u6CD5\u8BFB\u53D6\u98DE\u4E66\u673A\u5668\u4EBA"),
4637
+ h2("p", null, error.message),
4638
+ error.code ? h2("span", { className: "bxf-errorCode" }, error.code) : null,
4639
+ h2(
4640
+ "div",
4641
+ { className: "bxf-actions dim-viewActions" },
4642
+ h2(
4643
+ Button5,
4644
+ { kind: "primary", onClick: onRetry, disabled: busy },
4645
+ busy ? "\u91CD\u8BD5\u4E2D\u2026" : "\u91CD\u65B0\u8BFB\u53D6"
4646
+ )
4647
+ )
4648
+ )
4649
+ )
4650
+ );
4284
4651
  }
4285
-
4286
- .bxf-countdownTop { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
4287
- .bxf-progress { height: 3px; overflow: hidden; border-radius: 99px; background: var(--dsw-alias-bg-module-platform, #f2f3f5); margin-top: 6px; }
4288
- .bxf-progress > span { display: block; width: var(--bxf-progress, 100%); height: 100%; border-radius: inherit; background: var(--bxf-accent); transition: width 1s linear; }
4289
-
4290
- .bxf-qrCopy h3 { font-size: 20px; line-height: 29px; font-weight: 650; }
4291
- .bxf-qrCopy > p { color: var(--dsw-alias-label-secondary, #646a73); font-size: 13px; line-height: 21px; margin-top: 7px; }
4292
-
4293
- .bxf-steps { counter-reset: bxf-step; display: flex; flex-direction: column; gap: 11px; margin: 20px 0 0; padding: 0; list-style: none; }
4294
- .bxf-steps li { counter-increment: bxf-step; display: grid; grid-template-columns: 23px minmax(0, 1fr); align-items: start; gap: 9px; color: var(--dsw-alias-label-secondary, #646a73); font-size: 12px; line-height: 19px; }
4295
- .bxf-steps li::before { content: counter(bxf-step); width: 21px; height: 21px; display: grid; place-items: center; border: 1px solid var(--dsw-alias-border-l2, #dee0e3); border-radius: 50%; color: var(--dsw-alias-label-primary, #1f2329); background: var(--dsw-alias-bg-layer-1, #fff); font-size: 10px; font-weight: 650; }
4296
-
4297
- .bxf-connecting { min-height: 292px; display: grid; place-items: center; text-align: center; padding: 36px 24px; }
4298
- .bxf-connectingCopy { max-width: 430px; }
4299
- .bxf-orbit { position: relative; width: 86px; height: 86px; display: grid; place-items: center; margin: 0 auto 22px; }
4300
- .bxf-orbit::before, .bxf-orbit::after { content: ""; position: absolute; border-radius: 50%; }
4301
- .bxf-orbit::before { inset: 3px; border: 1px solid color-mix(in srgb, var(--bxf-accent) 24%, transparent); animation: bxf-pulse 1.8s var(--ds-ease-in-out, ease) infinite; }
4302
- .bxf-orbit::after { inset: 0; border: 2px solid transparent; border-top-color: var(--bxf-accent); animation: bxf-rotate 1.2s linear infinite; }
4303
- .bxf-orbitCore { width: 50px; height: 50px; display: grid; place-items: center; border-radius: 16px; color: var(--bxf-accent); background: color-mix(in srgb, var(--bxf-accent) 9%, var(--dsw-alias-bg-layer-1, #fff)); }
4304
- .bxf-connecting h3 { font-size: 20px; line-height: 29px; }
4305
- .bxf-connecting p { color: var(--dsw-alias-label-secondary, #646a73); font-size: 13px; line-height: 21px; margin-top: 7px; }
4306
- .bxf-connectingCompact { min-height: 248px; }
4307
-
4308
- .bxf-inlineError {
4309
- min-height: 190px;
4310
- display: grid;
4311
- grid-template-columns: 44px minmax(0, 1fr);
4312
- align-content: center;
4313
- gap: 15px;
4314
- padding: 28px;
4315
- }
4316
-
4317
- .bxf-inlineError h3 { font-size: 17px; line-height: 25px; margin: 0; }
4318
- .bxf-inlineError p { color: var(--dsw-alias-label-secondary, #646a73); font-size: 13px; line-height: 21px; margin-top: 5px; overflow-wrap: anywhere; }
4319
-
4320
- .bxf-listSection { display: flex; flex-direction: column; gap: 10px; }
4321
- .bxf-listHeading { min-height: 28px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 2px; }
4322
- .bxf-listHeading h3 { font-size: 14px; line-height: 22px; font-weight: 650; margin: 0; }
4323
- .bxf-botList { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; }
4324
- .bxf-botList > li { min-width: 0; }
4325
- .bxf-botCard:focus { outline: none; }
4326
- .bxf-botCard:focus-visible { outline: 2px solid var(--bxf-accent); outline-offset: 2px; }
4327
-
4328
- .bxf-connectedTop { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
4329
- .bxf-botIdentity { min-width: 0; display: flex; align-items: center; gap: 13px; }
4330
- .bxf-avatar { flex: none; width: 48px; height: 48px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--dsw-alias-border-l2, #e5e6eb); border-radius: 14px; background: var(--dsw-alias-bg-layer-1, #fff); box-shadow: 0 1px 3px rgb(31 35 41 / 7%); }
4331
- .bxf-botName { min-width: 0; }
4332
- .bxf-botName h3 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 17px; line-height: 24px; font-weight: 650; }
4333
- .bxf-botName p { overflow: hidden; color: var(--dsw-alias-label-tertiary, #8f959e); font-family: var(--ds-font-family-code, monospace); font-size: 12px; line-height: 18px; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
4334
-
4335
- .bxf-healthPill { flex: none; display: inline-flex; align-items: center; gap: 7px; min-height: 28px; border-radius: 999px; padding: 4px 10px; color: var(--bxf-success); background: color-mix(in srgb, var(--bxf-success) 10%, transparent); font-size: 12px; font-weight: 600; line-height: 18px; }
4336
- .bxf-healthPill[data-health="degraded"], .bxf-healthPill[data-health="checking"], .bxf-healthPill[data-health="connecting"] { color: var(--bxf-warning); background: color-mix(in srgb, var(--bxf-warning) 10%, transparent); }
4337
- .bxf-healthPill[data-health="offline"], .bxf-healthPill[data-health="error"] { color: var(--bxf-error); background: color-mix(in srgb, var(--bxf-error) 10%, transparent); }
4338
-
4339
-
4340
- .bxf-responseMode { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) max-content; align-items: center; column-gap: 10px; row-gap: 5px; margin-top: 6px; padding: 8px 10px; border: 1px solid var(--dsw-alias-border-l1, #eef0f3); border-radius: 9px; background: var(--dsw-alias-bg-module-platform, #f7f8fa); }
4341
- .bxf-responseModeHeader { display: contents; color: var(--dsw-alias-label-secondary, #646a73); font-size: 12px; line-height: normal; }
4342
- .bxf-responseModeHeader > span:first-child { grid-column: 1; grid-row: 1; white-space: nowrap; }
4343
- .bxf-responseModeStatus { grid-column: 2; grid-row: 1; color: var(--dsw-alias-label-tertiary, #8f959e); font-size: 12px; white-space: nowrap; }
4344
- .bxf-responseModeSelect { min-width: 0; width: 100%; grid-column: 1 / -1; grid-row: 2; height: 32px; padding: 0 30px 0 9px; border: 1px solid var(--dsw-alias-border-l2, #dfe1e5); border-radius: 7px; color: var(--dsw-alias-label-primary, #1f2329); background-color: var(--dsw-alias-bg-layer-1, #fff); font: inherit; font-size: 12px; cursor: pointer; transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease; }
4345
- .bxf-responseModeSelect:hover:not(:disabled) { border-color: color-mix(in srgb, var(--bxf-accent) 45%, var(--dsw-alias-border-l2, #dfe1e5)); }
4346
- .bxf-responseModeSelect:focus-visible { outline: none; border-color: var(--bxf-accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--bxf-accent) 16%, transparent); }
4347
- .bxf-responseModeSelect:disabled { cursor: not-allowed; opacity: .55; }
4348
- .bxf-responseModeHelp { grid-column: 1 / -1; grid-row: 3; color: var(--dsw-alias-label-tertiary, #8f959e); font-size: 11px; line-height: 1.45; }
4349
- .bxf-responseModePermissionAction { grid-column: 1 / -1; grid-row: 4; display: flex; justify-content: flex-start; margin-top: 2px; }
4350
- .bxf-responseModePermissionButton { min-height: 28px; padding: 3px 9px; color: var(--bxf-accent); border-color: color-mix(in srgb, var(--bxf-accent) 30%, var(--dsw-alias-border-l2, #dfe1e5)); background: var(--dsw-alias-bg-layer-1, #fff); }
4351
- .bxf-responseModePermissionButton:hover:not(:disabled) { background: color-mix(in srgb, var(--bxf-accent) 7%, transparent); }
4352
- .bxf-responseModeError { grid-column: 1 / -1; grid-row: 5; color: var(--bxf-error); font-size: 12px; line-height: 1.4; margin: 0; }
4353
-
4354
- .bxf-botProvision {
4355
- position: relative;
4356
- margin-top: 14px;
4357
- scroll-margin-block: 20px;
4358
- animation: bxf-revealProvision .2s var(--ds-ease-out, ease-out) both;
4359
- }
4360
- .bxf-botProvision:focus { outline: none; }
4361
- .bxf-botProvision:focus-visible {
4362
- outline: 2px solid color-mix(in srgb, var(--bxf-accent) 75%, transparent);
4363
- outline-offset: 3px;
4364
- border-radius: 12px;
4365
- }
4366
- .bxf-botProvision > .bxf-provisionCard {
4367
- border-radius: 11px;
4368
- box-shadow: none;
4369
- background: color-mix(in srgb, var(--bxf-accent) 2.5%, var(--dsw-alias-bg-layer-3, #fff));
4370
- }
4371
- .bxf-botProvision .bxf-cardBody { padding: 18px; }
4372
- .bxf-botProvision .bxf-qrLayout {
4373
- grid-template-columns: 184px minmax(0, 1fr);
4374
- align-items: start;
4375
- gap: 24px;
4376
- }
4377
- .bxf-botProvision .bxf-qrFrame { width: 176px; height: 176px; padding: 10px; border-radius: 11px; }
4378
- .bxf-botProvision .bxf-countdown { width: 176px; }
4379
- .bxf-botProvision .bxf-qrCopy h3 { font-size: 18px; line-height: 26px; }
4380
- .bxf-botProvision .bxf-steps { gap: 8px; margin-top: 14px; }
4381
- .bxf-botProvision .bxf-actions { margin-top: 16px; }
4382
- .bxf-botProvision .bxf-inlineError { min-height: 160px; padding: 22px; }
4383
-
4384
- .bxf-connectedFooter { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--dsw-alias-border-l1, #eef0f3); }
4385
- .bxf-healthSummary { min-width: 0; color: var(--dsw-alias-label-secondary, #646a73); font-size: 12px; line-height: 18px; }
4386
- .bxf-healthSummary[data-error="true"] { color: var(--bxf-error); }
4387
- .bxf-botActions { position: relative; flex: none; width: 100%; flex-wrap: wrap; gap: 8px; margin-top: 0; justify-content: flex-end; }
4388
- .bxf-botActions .bxf-button { flex: none; white-space: nowrap; }
4389
- .bxf-botActions .bxf-repairButton { color: var(--bxf-accent); border-color: color-mix(in srgb, var(--bxf-accent) 35%, var(--dsw-alias-border-l2, #dee0e3)); }
4390
- .bxf-botActions .bxf-repairButton:hover:not(:disabled) { background: color-mix(in srgb, var(--bxf-accent) 7%, transparent); }
4391
- .bxf-repairAction { display: inline-flex; }
4392
- .bxf-repairTooltip {
4393
- position: absolute;
4394
- right: 0;
4395
- bottom: calc(100% + 8px);
4396
- z-index: 40;
4397
- width: min(330px, 100%);
4398
- display: grid;
4399
- gap: 3px;
4400
- padding: 9px 10px;
4401
- border: 1px solid var(--dsw-alias-border-l2, #dfe1e5);
4402
- border-radius: 8px;
4403
- color: var(--dsw-alias-label-primary, #1f2329);
4404
- background: var(--dsw-alias-bg-layer-3, #fff);
4405
- box-shadow: 0 10px 28px rgb(31 35 41 / 16%);
4406
- opacity: 0;
4407
- visibility: hidden;
4408
- transform: translateY(3px);
4409
- pointer-events: none;
4410
- transition: opacity .15s ease, transform .15s ease, visibility .15s ease;
4411
- }
4412
- .bxf-repairTooltip strong { font-size: 12px; line-height: 17px; font-weight: 650; }
4413
- .bxf-repairTooltip > span { color: var(--dsw-alias-label-secondary, #646a73); font-size: 11px; line-height: 17px; font-weight: 400; overflow-wrap: anywhere; }
4414
- .bxf-repairAction:hover .bxf-repairTooltip,
4415
- .bxf-repairAction:focus-within .bxf-repairTooltip { opacity: 1; visibility: visible; transform: translateY(0); }
4416
-
4417
- .bxf-confirm {
4418
- border-top: 1px solid var(--dsw-alias-border-l2, #dee0e3);
4419
- background: color-mix(in srgb, var(--bxf-error) 4%, var(--dsw-alias-bg-module-platform, #f7f8fa));
4420
- padding: 17px 24px 20px;
4421
- }
4422
- .bxf-confirm:focus { outline: none; }
4423
- .bxf-confirm h4 { font-size: 13px; line-height: 20px; margin: 0; }
4424
- .bxf-confirm p { color: var(--dsw-alias-label-secondary, #646a73); font-size: 12px; line-height: 19px; margin: 4px 0 0; }
4425
- .bxf-confirm .bxf-actions { margin-top: 12px; }
4426
-
4427
- .bxf-error { min-height: 252px; display: grid; grid-template-columns: 44px minmax(0, 1fr); align-content: center; gap: 15px; padding: 30px; }
4428
- .bxf-errorIcon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 13px; color: var(--bxf-error); background: color-mix(in srgb, var(--bxf-error) 9%, transparent); }
4429
- .bxf-error h3 { font-size: 17px; line-height: 25px; }
4430
- .bxf-error p { color: var(--dsw-alias-label-secondary, #646a73); font-size: 13px; line-height: 21px; margin-top: 5px; overflow-wrap: anywhere; }
4431
- .bxf-errorCode { display: inline-block; color: var(--dsw-alias-label-tertiary, #8f959e); font-family: var(--ds-font-family-code, monospace); font-size: 11px; margin-top: 7px; }
4432
-
4433
- .bxf-statusNotice {
4434
- display: flex;
4435
- align-items: center;
4436
- gap: 9px;
4437
- border: 1px solid color-mix(in srgb, var(--bxf-warning) 28%, var(--dsw-alias-border-l2, #dee0e3));
4438
- border-radius: 10px;
4439
- padding: 9px 11px;
4440
- color: var(--dsw-alias-label-secondary, #646a73);
4441
- background: color-mix(in srgb, var(--bxf-warning) 5%, var(--dsw-alias-bg-layer-1, #fff));
4442
- font-size: 12px;
4443
- line-height: 18px;
4444
- }
4445
- .bxf-statusNotice > svg { flex: none; color: var(--bxf-warning); }
4446
- .bxf-statusNotice > span { min-width: 0; flex: 1; overflow-wrap: anywhere; }
4447
-
4448
- .bxf-skeleton { min-height: 260px; padding: 28px; }
4449
- .bxf-skeletonLine { height: 12px; border-radius: 999px; background: linear-gradient(90deg, var(--dsw-alias-bg-module-platform, #f2f3f5), color-mix(in srgb, var(--dsw-alias-label-tertiary, #8f959e) 10%, transparent), var(--dsw-alias-bg-module-platform, #f2f3f5)); background-size: 220% 100%; animation: bxf-shimmer 1.5s linear infinite; }
4450
- .bxf-skeletonLine:nth-child(1) { width: 92px; }
4451
- .bxf-skeletonLine:nth-child(2) { width: 44%; height: 22px; margin-top: 23px; }
4452
- .bxf-skeletonLine:nth-child(3) { width: 72%; margin-top: 14px; }
4453
- .bxf-skeletonLine:nth-child(4) { width: 58%; margin-top: 9px; }
4454
- .bxf-skeletonBox { width: 138px; height: 38px; border-radius: 8px; background: var(--dsw-alias-bg-module-platform, #f2f3f5); margin-top: 28px; }
4455
-
4456
- .bxf-visuallyHidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
4457
-
4458
- @keyframes bxf-rotate { to { transform: rotate(360deg); } }
4459
- @keyframes bxf-pulse { 0%, 100% { transform: scale(.9); opacity: .45; } 50% { transform: scale(1.08); opacity: 1; } }
4460
- @keyframes bxf-shimmer { to { background-position: -220% 0; } }
4461
- @keyframes bxf-revealProvision { from { opacity: 0; transform: translateY(-5px); } }
4462
-
4463
- @container (max-width: 620px) {
4464
- .bxf-headingTools { gap: 6px; }
4465
- .bxf-headingTools .bxf-totalBadge { padding-inline: 8px; }
4466
- .bxf-headingTools .bxf-bindButton { padding-inline: 10px; }
4467
- }
4468
-
4469
- @media (max-width: 680px) {
4470
- .bxf-intro { grid-template-columns: minmax(0, 1fr); }
4471
- .bxf-markStage { display: none; }
4472
- .bxf-qrLayout { grid-template-columns: minmax(0, 1fr); justify-items: center; }
4473
- .bxf-botProvision .bxf-qrLayout { grid-template-columns: minmax(0, 1fr); }
4474
- .bxf-qrCopy { width: 100%; }
4475
- .bxf-connectedTop { align-items: flex-start; flex-direction: column; }
4476
- .bxf-inlineError { grid-template-columns: minmax(0, 1fr); padding: 20px; }
4477
- .bxf-statusNotice { align-items: flex-start; flex-wrap: wrap; }
4478
- .bxf-cardBody { padding: 20px; }
4479
- }
4480
-
4481
- @media (prefers-reduced-motion: reduce) {
4482
- .bxf-page *, .bxf-page *::before, .bxf-page *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
4483
- }
4484
- `;
4485
- function installFeishuStyles() {
4486
- if (typeof document === "undefined") {
4487
- return () => {
4488
- };
4489
- }
4490
- const existing = document.querySelector(
4491
- `style[data-plugin-css="${FEISHU_STYLE_ID}"]`
4492
- );
4493
- if (existing) {
4494
- return () => {
4652
+ var EMPTY_TOTALS2 = Object.freeze({ configured: 0, connected: 0 });
4653
+ function mergeFeishuSnapshotState(current, snapshot, { restoreProvisioning = false, now = Date.now() } = {}) {
4654
+ if (snapshot.revision > 0 && current.revision > snapshot.revision) return current;
4655
+ let provisioning = current.provisioning;
4656
+ if (!provisioning && restoreProvisioning && snapshot.provisioning) {
4657
+ const submitted = snapshot.provisioning.submitted === true;
4658
+ provisioning = {
4659
+ phase: submitted || snapshot.state === "connecting" ? "connecting" : "qr",
4660
+ ...snapshot.provisioning,
4661
+ durationMs: Math.max(1, snapshot.provisioning.expiresAt - now),
4662
+ expired: !submitted && snapshot.provisioning.expiresAt <= now
4495
4663
  };
4496
4664
  }
4497
- const style = document.createElement("style");
4498
- style.dataset.plugin = "@xmanrui/dsh-feishu";
4499
- style.dataset.pluginCss = FEISHU_STYLE_ID;
4500
- style.textContent = CSS3;
4501
- document.head.appendChild(style);
4502
- return () => {
4503
- style.remove();
4504
- };
4505
- }
4506
-
4507
- // plugin-src/client/channels/feishu/index.js
4508
- var CALLBACK_REPAIR_OPERATION = FEISHU_REGISTRATION_OPERATIONS.CALLBACK_REPAIR;
4509
- var GROUP_MESSAGE_PERMISSION_OPERATION = FEISHU_REGISTRATION_OPERATIONS.GROUP_MESSAGE_PERMISSION;
4510
- function isCallbackRepair(value) {
4511
- return value?.operation === CALLBACK_REPAIR_OPERATION;
4512
- }
4513
- function isGroupMessagePermission(value) {
4514
- return value?.operation === GROUP_MESSAGE_PERMISSION_OPERATION;
4515
- }
4516
- function isTargetedAppUpdate2(value) {
4517
- return isCallbackRepair(value) || isGroupMessagePermission(value);
4518
- }
4519
- function SvgIcon({ children, size = 18, className, viewBox = "0 0 24 24" }) {
4520
- return h2("svg", {
4521
- width: size,
4522
- height: size,
4523
- viewBox,
4524
- fill: "none",
4525
- xmlns: "http://www.w3.org/2000/svg",
4526
- "aria-hidden": "true",
4527
- focusable: "false",
4528
- className
4529
- }, children);
4530
- }
4531
- function RobotIcon({ size = 26 }) {
4532
- return h2(
4533
- SvgIcon,
4534
- { size },
4535
- h2("rect", {
4536
- x: "5",
4537
- y: "7.5",
4538
- width: "14",
4539
- height: "11",
4540
- rx: "4",
4541
- stroke: "currentColor",
4542
- strokeWidth: "1.7"
4543
- }),
4544
- h2("path", {
4545
- d: "M12 4.5v3M8.7 12h.01M15.3 12h.01M9.2 15.3c1.67 1.08 3.93 1.08 5.6 0M3.5 11.5v3M20.5 11.5v3",
4546
- stroke: "currentColor",
4547
- strokeWidth: "1.7",
4548
- strokeLinecap: "round"
4549
- })
4550
- );
4551
- }
4552
- function AlertIcon({ size = 22 }) {
4553
- return h2(
4554
- SvgIcon,
4555
- { size },
4556
- h2("path", {
4557
- d: "M12 3.4 21 19H3L12 3.4Z",
4558
- stroke: "currentColor",
4559
- strokeWidth: "1.7",
4560
- strokeLinejoin: "round"
4561
- }),
4562
- h2("path", {
4563
- d: "M12 9v4.4M12 16.6v.01",
4564
- stroke: "currentColor",
4565
- strokeWidth: "1.9",
4566
- strokeLinecap: "round"
4567
- })
4568
- );
4569
- }
4570
- function QrIcon({ size = 58 }) {
4571
- return h2(SvgIcon, { size }, h2("path", {
4572
- d: "M4 4h6v6H4V4Zm10 0h6v6h-6V4ZM4 14h6v6H4v-6Zm10 0h2v2h-2v-2Zm4 0h2v4h-2v-4Zm-4 4h4v2h-4v-2Z",
4573
- fill: "currentColor"
4574
- }));
4575
- }
4576
- var Button5 = React12.forwardRef(function Button6({ children, kind = "secondary", size, icon, className = "", ...props }, ref) {
4577
- return h2("button", {
4578
- ...props,
4579
- ref,
4580
- type: "button",
4581
- className: `bxf-button ${className}`.trim(),
4582
- "data-kind": kind,
4583
- "data-size": size
4584
- }, icon, h2("span", null, children));
4585
- });
4586
- function BrandMark() {
4587
- return h2("div", { className: "bxf-brandMark" }, h2(RobotIcon, { size: 34 }));
4588
- }
4589
- function Heading2({ totals, onAdd, onCredential, credentialOpen, adding, busy, addButtonRef }) {
4590
- const hasBots = totals.configured > 0;
4591
- return h2(
4592
- "div",
4593
- { className: "bxf-heading" },
4594
- h2(
4595
- "div",
4596
- { className: "bxf-headingTools" },
4597
- h2(
4598
- "div",
4599
- { className: "dim-bindActions" },
4600
- h2(Button5, {
4601
- kind: "primary",
4602
- size: "small",
4603
- className: "bxf-bindButton dim-scanButton",
4604
- onClick: onAdd,
4605
- disabled: adding || busy,
4606
- ref: addButtonRef,
4607
- "aria-busy": busy ? "true" : void 0,
4608
- "aria-label": "\u626B\u7801\u63A5\u5165\u98DE\u4E66\u673A\u5668\u4EBA",
4609
- icon: h2(QrActionIcon)
4610
- }, adding ? "\u6B63\u5728\u63A5\u5165" : "\u626B\u7801\u63A5\u5165\u673A\u5668\u4EBA"),
4611
- h2(Button5, {
4612
- kind: "credential",
4613
- size: "small",
4614
- className: "dim-credentialButton",
4615
- onClick: onCredential,
4616
- disabled: adding || busy,
4617
- "aria-pressed": credentialOpen,
4618
- "aria-label": "\u4F7F\u7528 App ID \u548C App Secret \u7ED1\u5B9A\u98DE\u4E66\u673A\u5668\u4EBA",
4619
- icon: h2(CredentialActionIcon)
4620
- }, credentialOpen ? "\u6536\u8D77\u51ED\u636E" : "\u624B\u52A8\u63A5\u5165")
4621
- ),
4622
- hasBots ? h2("div", {
4623
- className: "bxf-totalBadge dim-onlineBadge",
4624
- "aria-label": `\u5DF2\u63A5\u5165 ${totals.configured} \u4E2A\u673A\u5668\u4EBA\uFF0C\u5176\u4E2D ${totals.connected} \u4E2A\u5728\u7EBF`
4625
- }, h2("span", null, `${totals.connected} / ${totals.configured} \u5728\u7EBF`)) : null
4626
- )
4627
- );
4628
- }
4629
- function LoadingView2() {
4630
- return h2(
4631
- "div",
4632
- {
4633
- className: "bxf-card dim-surfaceCard dim-loadingView",
4634
- "aria-busy": "true",
4635
- "aria-label": "\u6B63\u5728\u8BFB\u53D6\u98DE\u4E66\u673A\u5668\u4EBA\u5217\u8868"
4636
- },
4637
- h2("div", { className: "dim-spinner", "aria-hidden": "true" }),
4638
- h2("span", null, "\u6B63\u5728\u8BFB\u53D6\u98DE\u4E66\u8FDE\u63A5\u72B6\u6001\u2026")
4639
- );
4640
- }
4641
- function EmptyView2({ onStart, busy }) {
4642
- return h2(
4643
- "div",
4644
- { className: "bxf-card dim-surfaceCard" },
4645
- h2(
4646
- "div",
4647
- { className: "bxf-cardBody bxf-intro dim-surfaceBody dim-emptyView" },
4648
- h2(
4649
- "div",
4650
- { className: "bxf-introCopy dim-emptyCopy" },
4651
- h2(
4652
- "div",
4653
- { className: "bxf-stateLabel dim-stateLabel" },
4654
- h2("span", { className: "bxf-dot dim-stateDot" }),
4655
- h2("span", null, "\u5C1A\u672A\u63A5\u5165\u673A\u5668\u4EBA")
4656
- ),
4657
- h2("h3", null, "\u626B\u7801\uFF0C\u521B\u5EFA\u7B2C\u4E00\u4E2A\u98DE\u4E66\u5165\u53E3"),
4658
- h2("p", null, "\u65E0\u9700\u624B\u52A8\u586B\u5199 App ID\u3002\u4EE5\u540E\u8FD8\u53EF\u4EE5\u7EE7\u7EED\u6DFB\u52A0\u673A\u5668\u4EBA\uFF0C\u5206\u522B\u670D\u52A1\u4E0D\u540C\u56E2\u961F\u6216\u98DE\u4E66\u79DF\u6237\u3002"),
4659
- h2(
4660
- "div",
4661
- { className: "bxf-actions dim-viewActions" },
4662
- h2(Button5, {
4663
- kind: "primary",
4664
- onClick: onStart,
4665
- disabled: busy,
4666
- "aria-busy": busy ? "true" : void 0
4667
- }, busy ? "\u6B63\u5728\u751F\u6210\u4E8C\u7EF4\u7801\u2026" : "\u751F\u6210\u98DE\u4E66\u4E8C\u7EF4\u7801")
4668
- )
4669
- ),
4670
- h2("div", { className: "bxf-markStage dim-emptyBrand", "aria-hidden": "true" }, h2(BrandMark))
4671
- )
4672
- );
4673
- }
4674
- function safeVerificationHref(value) {
4675
- if (!value) return void 0;
4676
- try {
4677
- const url = new URL(value);
4678
- return url.protocol === "https:" && [
4679
- "accounts.feishu.cn",
4680
- "accounts.larksuite.com",
4681
- "open.feishu.cn",
4682
- "open.larksuite.com"
4683
- ].includes(url.hostname) && !url.port && !url.username && !url.password ? url.toString() : void 0;
4684
- } catch {
4685
- return void 0;
4686
- }
4687
- }
4688
- function safeQrSource2(value) {
4689
- if (!value) return void 0;
4690
- return /^data:image\/(?:png|webp|svg\+xml)(?:;charset=[^;,]+)?;base64,/i.test(value) ? value : void 0;
4691
- }
4692
- function QrPane({ provision, now, onRefresh, onCancel, busy }) {
4693
- const [imageFailed, setImageFailed] = React12.useState(false);
4694
- const qrSource = safeQrSource2(provision.qrCodeDataUrl);
4695
- const href = safeVerificationHref(provision.verificationUrl);
4696
- const remaining = Math.max(0, provision.expiresAt - now);
4697
- const expired = provision.expired === true || remaining === 0;
4698
- const progress = Math.min(1, remaining / Math.max(1, provision.durationMs ?? remaining));
4699
- const repairing = isCallbackRepair(provision);
4700
- const grantingGroupMessages = isGroupMessagePermission(provision);
4701
- const botName = provision.botName ?? "\u6B64\u673A\u5668\u4EBA";
4702
- React12.useEffect(() => setImageFailed(false), [qrSource]);
4703
- return h2(
4704
- "div",
4705
- { className: "bxf-card bxf-provisionCard dim-surfaceCard" },
4706
- h2(
4707
- "div",
4708
- { className: "bxf-cardBody bxf-qrLayout dim-surfaceBody dim-qrLayout" },
4709
- h2(
4710
- "div",
4711
- { className: "bxf-qrColumn dim-qrColumn" },
4712
- h2(
4713
- "div",
4714
- { className: "bxf-qrFrame dim-qrFrame" },
4715
- qrSource && !imageFailed ? h2("img", {
4716
- src: qrSource,
4717
- alt: repairing ? `\u7528\u4E8E\u4E3A${botName}\u8865\u5168\u6743\u9650\u4E0E\u56DE\u8C03\u7684\u4E00\u6B21\u6027\u6388\u6743\u4E8C\u7EF4\u7801` : grantingGroupMessages ? `\u7528\u4E8E\u4E3A${botName}\u5F00\u901A\u7FA4\u6D88\u606F\u6743\u9650\u7684\u4E00\u6B21\u6027\u6388\u6743\u4E8C\u7EF4\u7801` : "\u7528\u4E8E\u65B0\u589E DeepSeek Harness \u98DE\u4E66\u673A\u5668\u4EBA\u7684\u4E00\u6B21\u6027\u6388\u6743\u4E8C\u7EF4\u7801",
4718
- onError: () => setImageFailed(true)
4719
- }) : h2(
4720
- "div",
4721
- { className: "bxf-qrFallback dim-qrFallback" },
4722
- h2("div", null, h2(QrIcon), h2("span", null, "\u4E8C\u7EF4\u7801\u672A\u5C31\u7EEA\uFF0C\u8BF7\u6253\u5F00\u6388\u6743\u94FE\u63A5"))
4723
- ),
4724
- expired ? h2(
4725
- "div",
4726
- { className: "bxf-expiredOverlay dim-qrExpired", role: "status" },
4727
- h2("div", null, "\u4E8C\u7EF4\u7801\u5DF2\u5931\u6548", h2("br"), "\u8BF7\u5237\u65B0\u540E\u91CD\u65B0\u626B\u7801")
4728
- ) : null
4729
- ),
4730
- h2(
4731
- "div",
4732
- {
4733
- className: "bxf-countdown dim-countdown",
4734
- "aria-label": expired ? "\u4E8C\u7EF4\u7801\u5DF2\u5931\u6548" : `\u4E8C\u7EF4\u7801\u5269\u4F59 ${formatRemaining2(remaining)}`
4735
- },
4736
- h2(
4737
- "div",
4738
- { className: "bxf-countdownTop dim-countdownTop", "aria-hidden": "true" },
4739
- h2("span", null, expired ? "\u7B49\u5F85\u5237\u65B0" : "\u4E8C\u7EF4\u7801\u6709\u6548\u65F6\u95F4"),
4740
- h2("strong", null, formatRemaining2(remaining))
4741
- ),
4742
- h2(
4743
- "div",
4744
- { className: "bxf-progress dim-progress", "aria-hidden": "true" },
4745
- h2("span", { style: { "--bxf-progress": `${Math.round(progress * 100)}%` } })
4746
- )
4747
- )
4748
- ),
4749
- h2(
4750
- "div",
4751
- { className: "bxf-qrCopy dim-qrCopy" },
4752
- h2(
4753
- "div",
4754
- { className: "bxf-stateLabel dim-stateLabel" },
4755
- h2("span", { className: "bxf-dot dim-stateDot", "data-tone": "warning" }),
4756
- h2("span", null, repairing ? `\u6B63\u5728\u4E3A\u300C${botName}\u300D\u8865\u5168\u6743\u9650\u4E0E\u56DE\u8C03` : grantingGroupMessages ? `\u6B63\u5728\u4E3A\u300C${botName}\u300D\u5F00\u901A\u7FA4\u6D88\u606F\u6743\u9650` : "\u6B63\u5728\u6DFB\u52A0\u65B0\u673A\u5668\u4EBA")
4757
- ),
4758
- h2("h3", null, expired ? "\u5237\u65B0\u4E8C\u7EF4\u7801\u540E\u7EE7\u7EED" : repairing ? "\u4F7F\u7528\u98DE\u4E66\u626B\u7801\u8865\u5168\u6743\u9650" : grantingGroupMessages ? "\u4F7F\u7528\u98DE\u4E66\u786E\u8BA4\u7FA4\u6D88\u606F\u6743\u9650" : "\u4F7F\u7528\u98DE\u4E66\u626B\u7801\u521B\u5EFA\u673A\u5668\u4EBA"),
4759
- h2("p", null, repairing ? "\u626B\u7801\u4F1A\u66F4\u65B0\u73B0\u6709\u98DE\u4E66\u5E94\u7528\uFF0C\u6700\u591A\u589E\u91CF\u8865\u5145\u5361\u7247\u6309\u94AE\u56DE\u8C03\u3001\u8BFB\u53D6\u7528\u6237\u6D88\u606F\u5185\u56FE\u7247\u6216\u6587\u4EF6\u6240\u9700\u7684 im:message:readonly\uFF08\u98DE\u4E66\u663E\u793A\u4E3A\u201C\u83B7\u53D6\u5355\u804A\u3001\u7FA4\u7EC4\u6D88\u606F\u201D\uFF09\uFF0C\u4EE5\u53CA\u4E0A\u4F20\u673A\u5668\u4EBA\u56FE\u7247\u6216\u6587\u4EF6\u6240\u9700\u7684 im:resource\uFF1B\u4E0D\u4F1A\u521B\u5EFA\u65B0\u5E94\u7528\u3002\u786E\u8BA4\u9875\u53EA\u663E\u793A\u5F53\u524D\u7F3A\u5C11\u9879\uFF0C\u5B8C\u6210\u540E\u6B64\u673A\u5668\u4EBA\u4F1A\u77ED\u6682\u91CD\u8FDE\uFF0C\u5176\u4ED6\u673A\u5668\u4EBA\u4E0D\u53D7\u5F71\u54CD\u3002" : grantingGroupMessages ? "\u626B\u7801\u4F1A\u66F4\u65B0\u73B0\u6709\u98DE\u4E66\u5E94\u7528\uFF0C\u53EA\u589E\u91CF\u5F00\u901A\u201C\u83B7\u53D6\u7FA4\u7EC4\u4E2D\u6240\u6709\u6D88\u606F\u201D\u6743\u9650\uFF1B\u4E0D\u4F1A\u521B\u5EFA\u65B0\u5E94\u7528\u3002\u786E\u8BA4\u540E\u4F1A\u81EA\u52A8\u542F\u7528\u201C\u54CD\u5E94\u6240\u6709\u7FA4\u6D88\u606F\u201D\uFF0C\u5176\u4ED6\u673A\u5668\u4EBA\u4E0D\u53D7\u5F71\u54CD\u3002" : "\u626B\u7801\u53EA\u4F1A\u65B0\u589E\u4E00\u4E2A\u673A\u5668\u4EBA\uFF0C\u5DF2\u63A5\u5165\u7684\u673A\u5668\u4EBA\u4F1A\u7EE7\u7EED\u6B63\u5E38\u6536\u53D1\u6D88\u606F\u3002"),
4760
- h2(
4761
- "ol",
4762
- { className: "bxf-steps dim-steps" },
4763
- h2("li", null, "\u6253\u5F00\u98DE\u4E66\u79FB\u52A8\u7AEF\uFF0C\u4F7F\u7528\u626B\u4E00\u626B\u8BFB\u53D6\u4E8C\u7EF4\u7801"),
4764
- h2("li", null, repairing ? "\u6838\u5BF9\u73B0\u6709\u5E94\u7528\u540D\u79F0\uFF0C\u5E76\u786E\u8BA4\u53EA\u65B0\u589E\u5F53\u524D\u7F3A\u5C11\u7684\u4E0A\u8FF0\u914D\u7F6E" : grantingGroupMessages ? "\u6838\u5BF9\u73B0\u6709\u5E94\u7528\uFF0C\u5E76\u786E\u8BA4\u201C\u83B7\u53D6\u7FA4\u7EC4\u4E2D\u6240\u6709\u6D88\u606F\u201D\u6743\u9650" : "\u6838\u5BF9\u5E94\u7528\u540D\u79F0\u4E0E\u6743\u9650\u8303\u56F4\uFF0C\u5E76\u786E\u8BA4\u521B\u5EFA"),
4765
- h2("li", null, repairing ? "\u4FDD\u6301\u672C\u9875\u6253\u5F00\uFF0C\u7B49\u5F85\u6743\u9650\u4E0E\u56DE\u8C03\u8865\u5168\u5B8C\u6210" : grantingGroupMessages ? "\u4FDD\u6301\u672C\u9875\u6253\u5F00\uFF0C\u7B49\u5F85\u6743\u9650\u751F\u6548\u5E76\u81EA\u52A8\u5207\u6362\u54CD\u5E94\u65B9\u5F0F" : "\u4FDD\u6301\u672C\u9875\u6253\u5F00\uFF0C\u7B49\u5F85\u65B0\u673A\u5668\u4EBA\u7684\u957F\u8FDE\u63A5\u5C31\u7EEA")
4766
- ),
4767
- h2(
4768
- "div",
4769
- { className: "bxf-actions dim-viewActions" },
4770
- expired ? h2(Button5, {
4771
- kind: "primary",
4772
- onClick: onRefresh,
4773
- disabled: busy
4774
- }, busy ? "\u5237\u65B0\u4E2D\u2026" : "\u5237\u65B0\u4E8C\u7EF4\u7801") : href ? h2("a", {
4775
- className: "bxf-button bxf-link",
4776
- "data-kind": "secondary",
4777
- href,
4778
- target: "_blank",
4779
- rel: "noopener noreferrer"
4780
- }, h2("span", null, "\u5728\u98DE\u4E66\u4E2D\u6253\u5F00")) : null,
4781
- !expired ? h2(Button5, { onClick: onRefresh, disabled: busy }, "\u6362\u4E00\u4E2A\u4E8C\u7EF4\u7801") : null,
4782
- h2(Button5, { onClick: onCancel, disabled: busy }, repairing ? "\u53D6\u6D88\u8865\u5168" : grantingGroupMessages ? "\u53D6\u6D88\u6388\u6743" : "\u53D6\u6D88\u6DFB\u52A0")
4783
- )
4784
- )
4785
- )
4786
- );
4787
- }
4788
- function ProvisionProgress({ phase, provision, onCancel, busy }) {
4789
- const connecting = phase === "connecting";
4790
- const repairing = isCallbackRepair(provision);
4791
- const grantingGroupMessages = isGroupMessagePermission(provision);
4792
- return h2(
4793
- "div",
4794
- {
4795
- className: "bxf-card bxf-provisionCard dim-surfaceCard dim-loadingView",
4796
- "aria-busy": "true"
4797
- },
4798
- h2("div", { className: "dim-spinner", "aria-hidden": "true" }),
4799
- h2("h3", null, connecting ? repairing ? "\u5DF2\u786E\u8BA4\uFF0C\u6B63\u5728\u5B8C\u6210\u6743\u9650\u4E0E\u56DE\u8C03\u914D\u7F6E" : grantingGroupMessages ? "\u5DF2\u786E\u8BA4\uFF0C\u6B63\u5728\u542F\u7528\u5168\u90E8\u6D88\u606F\u6A21\u5F0F" : "\u5DF2\u786E\u8BA4\uFF0C\u6B63\u5728\u8FDE\u63A5\u65B0\u673A\u5668\u4EBA" : repairing ? "\u6B63\u5728\u51C6\u5907\u6743\u9650\u8865\u5168\u4E8C\u7EF4\u7801" : grantingGroupMessages ? "\u6B63\u5728\u51C6\u5907\u6743\u9650\u6388\u6743\u4E8C\u7EF4\u7801" : "\u6B63\u5728\u51C6\u5907\u6388\u6743\u4E8C\u7EF4\u7801"),
4800
- h2("p", null, connecting ? repairing ? "\u914D\u7F6E\u5DF2\u63D0\u4EA4\uFF0C\u6B63\u5728\u4FDD\u5B58\u6743\u9650\u3001\u9A8C\u8BC1\u5361\u7247\u56DE\u8C03\u5E76\u91CD\u8FDE\u6B64\u673A\u5668\u4EBA\uFF1B\u6B64\u9636\u6BB5\u65E0\u6CD5\u53D6\u6D88\uFF0C\u5176\u4ED6\u673A\u5668\u4EBA\u4E0D\u4F1A\u4E2D\u65AD\u3002" : grantingGroupMessages ? "\u6743\u9650\u914D\u7F6E\u5DF2\u63D0\u4EA4\uFF0C\u6B63\u5728\u4FDD\u5B58\u8BBE\u7F6E\u5E76\u91CD\u8FDE\u6B64\u673A\u5668\u4EBA\uFF1B\u6B64\u9636\u6BB5\u65E0\u6CD5\u53D6\u6D88\uFF0C\u5176\u4ED6\u673A\u5668\u4EBA\u4E0D\u4F1A\u4E2D\u65AD\u3002" : "\u6B63\u5728\u5B89\u5168\u4FDD\u5B58\u51ED\u636E\u5E76\u68C0\u67E5\u65B0\u673A\u5668\u4EBA\u7684\u6D88\u606F\u901A\u9053\uFF0C\u5176\u4ED6\u673A\u5668\u4EBA\u4E0D\u4F1A\u4E2D\u65AD\u3002" : repairing ? "\u6B63\u5728\u4E3A\u73B0\u6709\u98DE\u4E66\u5E94\u7528\u7533\u8BF7\u4E00\u6B21\u6027\u66F4\u65B0\u4E8C\u7EF4\u7801\uFF0C\u8BF7\u7A0D\u5019\u3002" : grantingGroupMessages ? "\u6B63\u5728\u4E3A\u73B0\u6709\u98DE\u4E66\u5E94\u7528\u7533\u8BF7\u7FA4\u6D88\u606F\u6743\u9650\u4E8C\u7EF4\u7801\uFF0C\u8BF7\u7A0D\u5019\u3002" : "\u6B63\u5728\u5411\u98DE\u4E66\u7533\u8BF7\u4E00\u6B21\u6027\u6388\u6743\u4E8C\u7EF4\u7801\uFF0C\u8BF7\u7A0D\u5019\u3002"),
4801
- connecting && onCancel ? h2(
4802
- "div",
4803
- { className: "bxf-actions dim-viewActions", style: { justifyContent: "center" } },
4804
- h2(Button5, { onClick: onCancel, disabled: busy }, repairing ? "\u53D6\u6D88\u8865\u5168" : grantingGroupMessages ? "\u53D6\u6D88\u6388\u6743" : "\u53D6\u6D88\u6DFB\u52A0")
4805
- ) : null
4806
- );
4807
- }
4808
- function ProvisionError2({ error, provision, onRetry, onCancel, busy }) {
4809
- const repairing = isCallbackRepair(provision);
4810
- const grantingGroupMessages = isGroupMessagePermission(provision);
4811
- return h2(
4812
- "div",
4813
- { className: "bxf-card bxf-provisionCard dim-surfaceCard" },
4814
- h2(
4815
- "div",
4816
- { className: "bxf-inlineError dim-inlineError", role: "alert" },
4817
- h2(
4818
- "div",
4819
- null,
4820
- h2("h3", null, repairing ? "\u6743\u9650\u4E0E\u56DE\u8C03\u6CA1\u6709\u8865\u5168\u5B8C\u6210" : grantingGroupMessages ? "\u7FA4\u6D88\u606F\u6743\u9650\u6CA1\u6709\u5F00\u901A\u5B8C\u6210" : "\u65B0\u673A\u5668\u4EBA\u6CA1\u6709\u6DFB\u52A0\u5B8C\u6210"),
4821
- h2("p", null, error.message),
4822
- error.code ? h2("span", { className: "bxf-errorCode" }, error.code) : null,
4823
- h2(
4824
- "div",
4825
- { className: "bxf-actions dim-viewActions" },
4826
- h2(
4827
- Button5,
4828
- { kind: "primary", onClick: onRetry, disabled: busy },
4829
- busy ? "\u91CD\u8BD5\u4E2D\u2026" : "\u91CD\u65B0\u751F\u6210\u4E8C\u7EF4\u7801"
4830
- ),
4831
- h2(Button5, { onClick: onCancel, disabled: busy }, "\u5173\u95ED")
4832
- )
4833
- )
4834
- )
4835
- );
4836
- }
4837
- var HEALTH_LABELS = {
4838
- connected: "\u8FD0\u884C\u6B63\u5E38",
4839
- connecting: "\u6B63\u5728\u8FDE\u63A5",
4840
- offline: "\u8FDE\u63A5\u4E2D\u65AD",
4841
- error: "\u9700\u8981\u5904\u7406"
4842
- };
4843
- function formatCheckedTime(timestamp7) {
4844
- if (!timestamp7) return "\u5C1A\u672A\u68C0\u67E5";
4845
- try {
4846
- return new Intl.DateTimeFormat("zh-CN", {
4847
- hour: "2-digit",
4848
- minute: "2-digit",
4849
- second: "2-digit"
4850
- }).format(new Date(timestamp7));
4851
- } catch {
4852
- return "\u521A\u521A";
4853
- }
4854
- }
4855
- function connectionTestNotice2(value) {
4856
- if (value?.testMessage?.sent === true) {
4857
- return "\u6D4B\u8BD5\u6D88\u606F\u5DF2\u53D1\u9001\uFF0C\u8BF7\u5230\u98DE\u4E66\u4F1A\u8BDD\u4E2D\u786E\u8BA4\u3002";
4858
- }
4859
- if (value?.testMessage?.code === "test-target-unavailable") {
4860
- return "\u8FDE\u63A5\u68C0\u67E5\u5B8C\u6210\u3002\u673A\u5668\u4EBA\u5C1A\u672A\u6536\u5230\u53EF\u7528\u4E8E\u6D4B\u8BD5\u7684\u79C1\u804A\u6D88\u606F\u3002";
4861
- }
4862
- return value?.testMessage ? "\u8FDE\u63A5\u68C0\u67E5\u5B8C\u6210\uFF0C\u4F46\u6D4B\u8BD5\u6D88\u606F\u53D1\u9001\u5931\u8D25\u3002" : null;
4863
- }
4864
- function RemoveConfirmation2({ bot, busy, onConfirm, onCancel }) {
4865
- const cancelRef = React12.useRef(null);
4866
- const idPart = bot.botId.replace(/[^a-zA-Z0-9_-]/g, "-");
4867
- const titleId = `bxf-remove-title-${idPart}`;
4868
- const descriptionId = `bxf-remove-description-${idPart}`;
4869
- React12.useEffect(() => cancelRef.current?.focus(), []);
4870
- return h2(
4871
- "div",
4872
- {
4873
- className: "bxf-confirm dim-confirm",
4874
- role: "alertdialog",
4875
- "aria-labelledby": titleId,
4876
- "aria-describedby": descriptionId,
4877
- onKeyDown: (event) => {
4878
- if (event.key === "Escape" && !busy) {
4879
- event.preventDefault();
4880
- onCancel();
4881
- }
4882
- }
4883
- },
4884
- h2("h4", { id: titleId }, `\u4ECE DeepSeek Harness \u79FB\u9664\u201C${bot.bot.name}\u201D\uFF1F`),
4885
- h2(
4886
- "p",
4887
- { id: descriptionId },
4888
- "\u6B64\u64CD\u4F5C\u4F1A\u505C\u6B62\u8FD9\u4E2A\u673A\u5668\u4EBA\u7684\u8FDE\u63A5\uFF0C\u5E76\u5220\u9664\u4FDD\u5B58\u5728\u672C\u673A\u7684\u63A5\u5165\u914D\u7F6E\u548C\u51ED\u636E\u3002\u98DE\u4E66\u5F00\u653E\u5E73\u53F0\u4E2D\u7684\u5E94\u7528\u4E0D\u4F1A\u88AB\u81EA\u52A8\u5220\u9664\uFF0C\u5176\u4ED6\u673A\u5668\u4EBA\u4E5F\u4E0D\u53D7\u5F71\u54CD\u3002"
4889
- ),
4890
- h2(
4891
- "div",
4892
- { className: "bxf-actions dim-viewActions" },
4893
- h2(Button5, { ref: cancelRef, onClick: onCancel, disabled: busy }, "\u4FDD\u7559\u673A\u5668\u4EBA"),
4894
- h2(
4895
- Button5,
4896
- { kind: "danger", onClick: onConfirm, disabled: busy },
4897
- busy ? "\u6B63\u5728\u79FB\u9664\u2026" : "\u786E\u8BA4\u79FB\u9664\u63A5\u5165"
4898
- )
4899
- )
4900
- );
4901
- }
4902
- function GroupResponseModeEditor({
4903
- value,
4904
- permissionGranted = false,
4905
- disabled = false,
4906
- authorizationDisabled = false,
4907
- onSave,
4908
- onAuthorize
4909
- }) {
4910
- const current = normalizeGroupResponseMode(value);
4911
- const [saving, setSaving] = React12.useState(false);
4912
- const [authorizing, setAuthorizing] = React12.useState(false);
4913
- const [error, setError] = React12.useState(null);
4914
- const change = async (event) => {
4915
- const next = normalizeGroupResponseMode(event.target.value);
4916
- if (next === current || saving || disabled) return;
4917
- setSaving(true);
4918
- setError(null);
4919
- try {
4920
- await onSave?.(next);
4921
- } catch (cause) {
4922
- setError(cause?.message ?? "\u7FA4\u804A\u54CD\u5E94\u65B9\u5F0F\u4FEE\u6539\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5\u3002");
4923
- } finally {
4924
- setSaving(false);
4925
- }
4926
- };
4927
- const authorize = async () => {
4928
- if (current !== "all" || saving || authorizing || disabled || authorizationDisabled) return;
4929
- setAuthorizing(true);
4930
- setError(null);
4931
- try {
4932
- await onAuthorize?.();
4933
- } catch (cause) {
4934
- setError(cause?.message ?? "\u7FA4\u6D88\u606F\u6743\u9650\u6388\u6743\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5\u3002");
4935
- } finally {
4936
- setAuthorizing(false);
4937
- }
4938
- };
4939
- return h2(
4940
- "div",
4941
- { className: "bxf-responseMode dim-responseMode" },
4942
- h2(
4943
- "div",
4944
- { className: "bxf-responseModeHeader dim-responseModeHeader" },
4945
- h2("span", null, "\u7FA4\u804A\u54CD\u5E94\u65B9\u5F0F"),
4946
- saving || authorizing ? h2(
4947
- "span",
4948
- { className: "bxf-responseModeStatus dim-responseModeStatus" },
4949
- saving ? "\u4FDD\u5B58\u4E2D\u2026" : "\u6B63\u5728\u51C6\u5907\u6388\u6743\u2026"
4950
- ) : null
4951
- ),
4952
- h2(
4953
- "select",
4954
- {
4955
- className: "bxf-responseModeSelect dim-responseModeSelect",
4956
- value: current,
4957
- disabled: disabled || saving,
4958
- "aria-label": "\u7FA4\u804A\u54CD\u5E94\u65B9\u5F0F",
4959
- onChange: (event) => {
4960
- void change(event);
4961
- }
4962
- },
4963
- h2("option", { value: "mention" }, "\u4EC5\u5728 @\u673A\u5668\u4EBA\u65F6\u54CD\u5E94\uFF08\u63A8\u8350\uFF09"),
4964
- h2("option", { value: "all" }, "\u54CD\u5E94\u6240\u6709\u7FA4\u6D88\u606F")
4965
- ),
4966
- h2(
4967
- "small",
4968
- { className: "bxf-responseModeHelp dim-responseModeHelp" },
4969
- current === "mention" ? permissionGranted ? "\u79C1\u804A\u59CB\u7EC8\u54CD\u5E94\uFF1B\u7FA4\u804A\u4EC5\u5904\u7406\u660E\u786E @\u5F53\u524D\u673A\u5668\u4EBA\u7684\u6D88\u606F\u3002\u7FA4\u6D88\u606F\u6743\u9650\u5DF2\u5F00\u901A\uFF0C\u518D\u6B21\u5207\u6362\u65E0\u9700\u6388\u6743\u3002" : "\u79C1\u804A\u59CB\u7EC8\u54CD\u5E94\uFF1B\u7FA4\u804A\u4EC5\u5904\u7406\u660E\u786E @\u5F53\u524D\u673A\u5668\u4EBA\u7684\u6D88\u606F\u3002\u9009\u62E9\u5168\u90E8\u6D88\u606F\u540E\u4F1A\u6253\u5F00\u98DE\u4E66\u5B98\u65B9\u6388\u6743\u6D41\u7A0B\u3002" : permissionGranted ? "\u5DF2\u5F00\u901A\u201C\u83B7\u53D6\u7FA4\u7EC4\u4E2D\u6240\u6709\u6D88\u606F\u201D\u6743\u9650\uFF08im:message.group_msg\uFF09\uFF1B\u673A\u5668\u4EBA\u4F1A\u5904\u7406\u7FA4\u804A\u4E2D\u7684\u6240\u6709\u53EF\u89C1\u6D88\u606F\u3002" : "\u5C1A\u672A\u786E\u8BA4\u201C\u83B7\u53D6\u7FA4\u7EC4\u4E2D\u6240\u6709\u6D88\u606F\u201D\u6743\u9650\uFF0C\u8BF7\u5B8C\u6210\u98DE\u4E66\u6388\u6743\u3002"
4970
- ),
4971
- current === "all" ? h2(
4972
- "div",
4973
- { className: "bxf-responseModePermissionAction dim-responseModePermissionAction" },
4974
- h2(Button5, {
4975
- className: "bxf-responseModePermissionButton",
4976
- size: "small",
4977
- disabled: disabled || authorizationDisabled || saving || authorizing,
4978
- "aria-busy": authorizing ? "true" : void 0,
4979
- "aria-label": permissionGranted ? "\u91CD\u65B0\u6388\u6743\u7FA4\u6D88\u606F\u6743\u9650" : "\u6388\u6743\u7FA4\u6D88\u606F\u6743\u9650",
4980
- onClick: () => {
4981
- void authorize();
4982
- }
4983
- }, authorizing ? "\u6B63\u5728\u51C6\u5907\u2026" : permissionGranted ? "\u91CD\u65B0\u6388\u6743" : "\u53BB\u6388\u6743")
4984
- ) : null,
4985
- error ? h2("p", {
4986
- className: "bxf-responseModeError dim-responseModeError",
4987
- role: "alert"
4988
- }, error) : null
4989
- );
4990
- }
4991
- function BotCard({
4992
- connection,
4993
- busy,
4994
- repairDisabled,
4995
- provisionContent,
4996
- provisionRef,
4997
- actionError,
4998
- testNotice,
4999
- removing,
5000
- onReconnect,
5001
- onRepairCallback,
5002
- onWorkspaceSave,
5003
- onAgentPresetSave,
5004
- onGroupResponseModeSave,
5005
- onGroupMessagePermissionAuthorize,
5006
- onRequestRemove,
5007
- onConfirmRemove,
5008
- onCancelRemove,
5009
- cardRef,
5010
- removeButtonRef
5011
- }) {
5012
- const { bot, health, state, connected } = connection;
5013
- const repairTooltipId = React12.useId();
5014
- const stateForDisplay = busy === "reconnect" ? "connecting" : state;
5015
- const tone = stateForDisplay === "connected" ? "success" : stateForDisplay === "connecting" ? "warning" : "error";
5016
- const summary = actionError?.message ?? connection.error?.message ?? (connected ? null : health.summary);
5017
- const titleId = `bxf-bot-${connection.botId.replace(/[^a-zA-Z0-9_-]/g, "-")}`;
5018
- return h2(
5019
- "article",
5020
- {
5021
- className: "bxf-card bxf-botCard dim-botCard",
5022
- "aria-labelledby": titleId,
5023
- "data-bot-id": connection.botId,
5024
- tabIndex: -1,
5025
- ref: cardRef
5026
- },
5027
- h2(
5028
- "div",
5029
- { className: "bxf-cardBody dim-botCardBody" },
5030
- h2(
5031
- "div",
5032
- { className: "bxf-connectedTop dim-botCardTop" },
5033
- h2(
5034
- "div",
5035
- { className: "bxf-botIdentity dim-botIdentity" },
5036
- h2(
5037
- "div",
5038
- { className: "bxf-avatar dim-botAvatar", "aria-hidden": "true" },
5039
- h2(FeishuLogoGlyph, { size: 34 })
5040
- ),
5041
- h2(
5042
- "div",
5043
- { className: "bxf-botName dim-botName" },
5044
- h2("h3", { id: titleId, title: bot.name }, bot.name),
5045
- h2("p", { title: bot.appIdMasked }, bot.appIdMasked ?? "\u5E94\u7528\u6807\u8BC6\u5DF2\u5B89\u5168\u4FDD\u5B58")
5046
- )
5047
- ),
5048
- h2(BotStatusMeta, {
5049
- className: "bxf-healthPill",
5050
- dotClassName: "bxf-dot",
5051
- tone,
5052
- stateLabel: HEALTH_LABELS[stateForDisplay] ?? "\u72B6\u6001\u672A\u77E5",
5053
- lastCheckedAt: health.lastCheckedAt,
5054
- formatCheckedTime,
5055
- healthState: stateForDisplay
5056
- })
5057
- ),
5058
- h2(WorkspaceEditor, {
5059
- workspace: connection.workspace,
5060
- disabled: Boolean(busy),
5061
- onSave: onWorkspaceSave
5062
- }),
5063
- h2(AgentPresetEditor, {
5064
- agentPreset: connection.agentPreset,
5065
- disabled: Boolean(busy),
5066
- onSave: onAgentPresetSave
5067
- }),
5068
- h2(GroupResponseModeEditor, {
5069
- value: connection.groupResponseMode,
5070
- permissionGranted: connection.groupMessagePermissionGranted,
5071
- disabled: Boolean(busy),
5072
- authorizationDisabled: repairDisabled,
5073
- onSave: onGroupResponseModeSave,
5074
- onAuthorize: onGroupMessagePermissionAuthorize
5075
- }),
5076
- provisionContent ? h2("section", {
5077
- className: "bxf-botProvision dim-botProvision",
5078
- "aria-label": `${bot.name}\u7684\u98DE\u4E66\u6388\u6743\u6D41\u7A0B`,
5079
- "data-provision-for": connection.botId,
5080
- ref: provisionRef,
5081
- tabIndex: -1
5082
- }, provisionContent) : null,
5083
- h2(
5084
- "div",
5085
- { className: "bxf-connectedFooter dim-cardFooter" },
5086
- h2(
5087
- "div",
5088
- { className: "dim-cardFooterLayout" },
5089
- h2(
5090
- "div",
5091
- { className: "bxf-actions bxf-botActions dim-cardActions" },
5092
- h2(Button5, {
5093
- className: "dim-cardAction",
5094
- onClick: onReconnect,
5095
- disabled: Boolean(busy),
5096
- "aria-busy": busy === "reconnect" ? "true" : void 0,
5097
- "aria-label": `${connected ? "\u68C0\u67E5\u8FDE\u63A5" : "\u91CD\u8BD5\u8FDE\u63A5"}${bot.name}`
5098
- }, busy === "reconnect" ? connected ? "\u68C0\u67E5\u4E2D\u2026" : "\u6B63\u5728\u8FDE\u63A5\u2026" : connected ? "\u68C0\u67E5\u8FDE\u63A5" : "\u91CD\u8BD5\u8FDE\u63A5"),
5099
- h2(
5100
- "span",
5101
- { className: "bxf-repairAction" },
5102
- h2(Button5, {
5103
- className: "bxf-repairButton dim-cardAction",
5104
- onClick: onRepairCallback,
5105
- disabled: Boolean(busy) || repairDisabled,
5106
- "aria-busy": busy === "callback-repair" ? "true" : void 0,
5107
- "aria-label": `\u4E3A${bot.name}\u8865\u5168\u6743\u9650\u4E0E\u56DE\u8C03`,
5108
- "aria-describedby": repairTooltipId
5109
- }, busy === "callback-repair" ? "\u7B49\u5F85\u626B\u7801\u2026" : "\u8865\u5168\u6743\u9650"),
5110
- h2(
5111
- "span",
5112
- {
5113
- id: repairTooltipId,
5114
- className: "bxf-repairTooltip",
5115
- role: "tooltip"
5116
- },
5117
- h2("strong", null, "\u8865\u5168\u8303\u56F4"),
5118
- h2("span", null, "\u6700\u591A\u589E\u91CF\u6DFB\u52A0\u5361\u7247\u56DE\u8C03 card.action.trigger\u3001\u8BFB\u53D6\u6D88\u606F\u5185\u56FE\u7247\u6216\u6587\u4EF6\u6240\u9700\u7684 im:message:readonly\uFF08\u98DE\u4E66\u663E\u793A\u4E3A\u201C\u83B7\u53D6\u5355\u804A\u3001\u7FA4\u7EC4\u6D88\u606F\u201D\uFF09\uFF0C\u4EE5\u53CA\u4E0A\u4F20\u673A\u5668\u4EBA\u56FE\u7247\u6216\u6587\u4EF6\u6240\u9700\u7684 im:resource\uFF1B\u786E\u8BA4\u9875\u53EA\u663E\u793A\u5F53\u524D\u7F3A\u5C11\u9879\uFF0C\u4E0D\u4F1A\u521B\u5EFA\u65B0\u5E94\u7528\u3002")
5119
- )
5120
- ),
5121
- h2(Button5, {
5122
- className: "dim-cardAction",
5123
- kind: "danger",
5124
- onClick: onRequestRemove,
5125
- disabled: Boolean(busy),
5126
- ref: removeButtonRef,
5127
- "aria-label": `\u4ECE DeepSeek Harness \u79FB\u9664${bot.name}`
5128
- }, "\u79FB\u9664\u63A5\u5165")
5129
- ),
5130
- summary ? h2(
5131
- "div",
5132
- { className: "bxf-healthSummary dim-cardSummary", "data-error": actionError || connection.error ? "true" : void 0 },
5133
- summary
5134
- ) : null,
5135
- connection.lastMessageError ? h2(LastMessageErrorSummary, {
5136
- className: "bxf-healthSummary",
5137
- error: connection.lastMessageError
5138
- }) : null,
5139
- testNotice ? h2("div", {
5140
- className: "bxf-healthSummary dim-cardFeedback",
5141
- role: "status"
5142
- }, testNotice) : null
5143
- )
5144
- )
5145
- ),
5146
- removing ? h2(RemoveConfirmation2, {
5147
- bot: connection,
5148
- busy: busy === "delete",
5149
- onConfirm: onConfirmRemove,
5150
- onCancel: onCancelRemove
5151
- }) : null
5152
- );
5153
- }
5154
- function BotList(props) {
5155
- return h2(
5156
- "section",
5157
- { className: "bxf-listSection dim-listSection", "aria-labelledby": "bxf-bot-list-title" },
5158
- h2(ChannelListHeading, {
5159
- className: "bxf-listHeading",
5160
- id: "bxf-bot-list-title",
5161
- title: "\u5DF2\u63A5\u5165\u7684\u673A\u5668\u4EBA",
5162
- connectionLabel: "\u957F\u8FDE\u63A5"
5163
- }),
5164
- h2(
5165
- "ul",
5166
- { className: "bxf-botList dim-botList", role: "list" },
5167
- props.bots.map((bot) => h2(
5168
- "li",
5169
- { key: bot.botId },
5170
- h2(BotCard, {
5171
- connection: bot,
5172
- busy: props.busyByBot[bot.botId] ?? (isTargetedAppUpdate2(props.provisioning) && props.provisioning.botId === bot.botId ? props.provisioning.operation : void 0),
5173
- repairDisabled: Boolean(props.provisioning),
5174
- provisionContent: isTargetedAppUpdate2(props.provisioning) && props.provisioning.botId === bot.botId ? props.provisionContent : null,
5175
- provisionRef: props.provisionRef,
5176
- actionError: props.errorsByBot[bot.botId],
5177
- testNotice: props.testNoticesByBot[bot.botId],
5178
- removing: props.removeTargetId === bot.botId,
5179
- onReconnect: () => props.onReconnect(bot),
5180
- onRepairCallback: () => props.onRepairCallback(bot),
5181
- onWorkspaceSave: (workspace) => props.onWorkspaceSave(bot, workspace),
5182
- onAgentPresetSave: (agentPreset) => props.onAgentPresetSave(bot, agentPreset),
5183
- onGroupResponseModeSave: (groupResponseMode) => props.onGroupResponseModeSave(bot, groupResponseMode),
5184
- onGroupMessagePermissionAuthorize: () => props.onGroupMessagePermissionAuthorize(bot),
5185
- onRequestRemove: () => props.onRequestRemove(bot),
5186
- onConfirmRemove: () => props.onConfirmRemove(bot),
5187
- onCancelRemove: props.onCancelRemove,
5188
- cardRef: (node) => props.setCardRef(bot.botId, node),
5189
- removeButtonRef: (node) => props.setRemoveButtonRef(bot.botId, node)
5190
- })
5191
- ))
5192
- )
5193
- );
5194
- }
5195
- function PageError({ error, onRetry, busy }) {
5196
- return h2(
5197
- "div",
5198
- { className: "bxf-card dim-surfaceCard" },
5199
- h2(
5200
- "div",
5201
- { className: "bxf-error dim-inlineError", role: "alert" },
5202
- h2(
5203
- "div",
5204
- null,
5205
- h2("h3", null, "\u65E0\u6CD5\u8BFB\u53D6\u98DE\u4E66\u673A\u5668\u4EBA"),
5206
- h2("p", null, error.message),
5207
- error.code ? h2("span", { className: "bxf-errorCode" }, error.code) : null,
5208
- h2(
5209
- "div",
5210
- { className: "bxf-actions dim-viewActions" },
5211
- h2(
5212
- Button5,
5213
- { kind: "primary", onClick: onRetry, disabled: busy },
5214
- busy ? "\u91CD\u8BD5\u4E2D\u2026" : "\u91CD\u65B0\u8BFB\u53D6"
5215
- )
5216
- )
5217
- )
5218
- )
5219
- );
5220
- }
5221
- var EMPTY_TOTALS2 = Object.freeze({ configured: 0, connected: 0 });
5222
- function mergeFeishuSnapshotState(current, snapshot, { restoreProvisioning = false, now = Date.now() } = {}) {
5223
- if (snapshot.revision > 0 && current.revision > snapshot.revision) return current;
5224
- let provisioning = current.provisioning;
5225
- if (!provisioning && restoreProvisioning && snapshot.provisioning) {
5226
- const submitted = snapshot.provisioning.submitted === true;
5227
- provisioning = {
5228
- phase: submitted || snapshot.state === "connecting" ? "connecting" : "qr",
5229
- ...snapshot.provisioning,
5230
- durationMs: Math.max(1, snapshot.provisioning.expiresAt - now),
5231
- expired: !submitted && snapshot.provisioning.expiresAt <= now
5232
- };
5233
- }
5234
- return {
5235
- ...current,
5236
- phase: "ready",
5237
- revision: snapshot.revision,
5238
- bots: snapshot.bots,
5239
- totals: snapshot.totals,
5240
- provisioning,
5241
- pageError: null,
5242
- statusError: null,
5243
- agentPresetCatalog: snapshot.agentPresetCatalog ?? current.agentPresetCatalog
4665
+ return {
4666
+ ...current,
4667
+ phase: "ready",
4668
+ revision: snapshot.revision,
4669
+ bots: snapshot.bots,
4670
+ totals: snapshot.totals,
4671
+ provisioning,
4672
+ pageError: null,
4673
+ statusError: null,
4674
+ agentPresetCatalog: snapshot.agentPresetCatalog ?? current.agentPresetCatalog
5244
4675
  };
5245
4676
  }
5246
4677
  function FeishuSettingsTab({ rpcCall }) {
@@ -5923,6 +5354,578 @@ function FeishuSettingsTab({ rpcCall }) {
5923
5354
  ));
5924
5355
  }
5925
5356
 
5357
+ // plugin-src/client/channels/feishu/styles.js
5358
+ var FEISHU_STYLE_ID = "xmanrui-dsh-im-feishu-settings";
5359
+ var CSS3 = String.raw`
5360
+ .bxf-page {
5361
+ --bxf-accent: var(--dsw-alias-state-business-primary, #3370ff);
5362
+ --bxf-success: var(--dsw-alias-state-success-primary, #20a162);
5363
+ --bxf-warning: var(--dsw-alias-state-warn-primary, #d97706);
5364
+ --bxf-error: var(--dsw-alias-state-error-primary, #d54941);
5365
+ box-sizing: border-box;
5366
+ width: 100%;
5367
+ max-width: 860px;
5368
+ color: var(--dsw-alias-label-primary, #1f2329);
5369
+ display: flex;
5370
+ flex-direction: column;
5371
+ container-type: inline-size;
5372
+ gap: 18px;
5373
+ padding: 2px 0 24px;
5374
+ }
5375
+
5376
+ .bxf-page *, .bxf-page *::before, .bxf-page *::after { box-sizing: border-box; }
5377
+
5378
+ .bxf-heading {
5379
+ display: flex;
5380
+ align-items: flex-start;
5381
+ justify-content: space-between;
5382
+ gap: 20px;
5383
+ }
5384
+
5385
+ .bxf-headingCopy { min-width: 0; }
5386
+ .bxf-heading h2, .bxf-heading p, .bxf-card h3, .bxf-card p { margin: 0; }
5387
+
5388
+ .bxf-eyebrow {
5389
+ color: var(--dsw-alias-label-tertiary, #8f959e);
5390
+ font-size: 12px;
5391
+ font-weight: 600;
5392
+ line-height: 18px;
5393
+ letter-spacing: .08em;
5394
+ text-transform: uppercase;
5395
+ margin-bottom: 3px;
5396
+ }
5397
+
5398
+ .bxf-heading h2 {
5399
+ font-size: 20px;
5400
+ line-height: 28px;
5401
+ font-weight: 650;
5402
+ letter-spacing: -.015em;
5403
+ }
5404
+
5405
+ .bxf-heading p {
5406
+ max-width: 540px;
5407
+ color: var(--dsw-alias-label-secondary, #646a73);
5408
+ font-size: 13px;
5409
+ line-height: 20px;
5410
+ margin-top: 5px;
5411
+ white-space: nowrap;
5412
+ }
5413
+
5414
+ .bxf-headingTools {
5415
+ width: 100%;
5416
+ flex: none;
5417
+ display: flex;
5418
+ align-items: center;
5419
+ justify-content: space-between;
5420
+ flex-wrap: nowrap;
5421
+ gap: 8px;
5422
+ }
5423
+
5424
+ .bxf-totalBadge {
5425
+ min-height: 28px;
5426
+ display: inline-flex;
5427
+ align-items: baseline;
5428
+ gap: 3px;
5429
+ border-radius: 999px;
5430
+ padding: 4px 10px;
5431
+ color: var(--dsw-alias-label-secondary, #646a73);
5432
+ background: var(--dsw-alias-bg-module-platform, #f2f3f5);
5433
+ font-size: 11px;
5434
+ line-height: 16px;
5435
+ white-space: nowrap;
5436
+ }
5437
+
5438
+ .bxf-totalBadge strong { color: var(--bxf-success); font-size: 13px; }
5439
+
5440
+ .bxf-card {
5441
+ position: relative;
5442
+ overflow: hidden;
5443
+ border: 1px solid var(--dsw-alias-border-l2, #dee0e3);
5444
+ border-radius: 14px;
5445
+ background: var(--dsw-alias-bg-layer-3, #fff);
5446
+ box-shadow: var(--dsw-shadow-lv1, 0 3px 12px rgba(31, 35, 41, .05));
5447
+ }
5448
+
5449
+ .bxf-card::before {
5450
+ content: "";
5451
+ pointer-events: none;
5452
+ position: absolute;
5453
+ inset: 0 0 auto;
5454
+ height: 88px;
5455
+ background:
5456
+ radial-gradient(circle at 86% -35%, color-mix(in srgb, var(--bxf-accent) 18%, transparent), transparent 68%);
5457
+ opacity: .85;
5458
+ }
5459
+
5460
+ .bxf-cardBody { position: relative; padding: 24px; }
5461
+
5462
+ .bxf-intro {
5463
+ min-height: 250px;
5464
+ display: grid;
5465
+ grid-template-columns: minmax(0, 1fr) 172px;
5466
+ gap: 32px;
5467
+ align-items: center;
5468
+ }
5469
+
5470
+ .bxf-introCopy { max-width: 500px; }
5471
+
5472
+ .bxf-stateLabel {
5473
+ display: inline-flex;
5474
+ align-items: center;
5475
+ gap: 7px;
5476
+ color: var(--dsw-alias-label-secondary, #646a73);
5477
+ font-size: 12px;
5478
+ font-weight: 600;
5479
+ line-height: 18px;
5480
+ margin-bottom: 13px;
5481
+ }
5482
+
5483
+ .bxf-dot {
5484
+ width: 7px;
5485
+ height: 7px;
5486
+ border-radius: 50%;
5487
+ background: var(--dsw-alias-label-tertiary, #8f959e);
5488
+ box-shadow: 0 0 0 4px color-mix(in srgb, var(--dsw-alias-label-tertiary, #8f959e) 12%, transparent);
5489
+ }
5490
+
5491
+ .bxf-dot[data-tone="success"] {
5492
+ background: var(--bxf-success);
5493
+ box-shadow: 0 0 0 4px color-mix(in srgb, var(--bxf-success) 13%, transparent);
5494
+ }
5495
+
5496
+ .bxf-dot[data-tone="warning"] {
5497
+ background: var(--bxf-warning);
5498
+ box-shadow: 0 0 0 4px color-mix(in srgb, var(--bxf-warning) 13%, transparent);
5499
+ }
5500
+
5501
+ .bxf-dot[data-tone="error"] {
5502
+ background: var(--bxf-error);
5503
+ box-shadow: 0 0 0 4px color-mix(in srgb, var(--bxf-error) 13%, transparent);
5504
+ }
5505
+
5506
+ .bxf-intro h3 {
5507
+ font-size: 24px;
5508
+ line-height: 34px;
5509
+ font-weight: 650;
5510
+ letter-spacing: -.02em;
5511
+ }
5512
+
5513
+ .bxf-introCopy > p {
5514
+ max-width: 490px;
5515
+ color: var(--dsw-alias-label-secondary, #646a73);
5516
+ font-size: 14px;
5517
+ line-height: 23px;
5518
+ margin-top: 8px;
5519
+ }
5520
+
5521
+ .bxf-note {
5522
+ display: flex;
5523
+ gap: 8px;
5524
+ align-items: flex-start;
5525
+ color: var(--dsw-alias-label-tertiary, #8f959e);
5526
+ font-size: 12px;
5527
+ line-height: 18px;
5528
+ margin-top: 16px;
5529
+ }
5530
+
5531
+ .bxf-note svg { flex: none; margin-top: 1px; }
5532
+
5533
+ .bxf-actions {
5534
+ display: flex;
5535
+ align-items: center;
5536
+ flex-wrap: wrap;
5537
+ gap: 10px;
5538
+ margin-top: 22px;
5539
+ }
5540
+
5541
+ .bxf-button {
5542
+ appearance: none;
5543
+ min-height: 36px;
5544
+ display: inline-flex;
5545
+ align-items: center;
5546
+ justify-content: center;
5547
+ gap: 7px;
5548
+ border: 1px solid var(--dsw-alias-border-l2, #dee0e3);
5549
+ border-radius: 8px;
5550
+ padding: 7px 13px;
5551
+ color: var(--dsw-alias-label-primary, #1f2329);
5552
+ background: var(--dsw-alias-bg-layer-1, #fff);
5553
+ font: inherit;
5554
+ font-size: 13px;
5555
+ font-weight: 550;
5556
+ line-height: 20px;
5557
+ text-decoration: none;
5558
+ cursor: pointer;
5559
+ transition: background .15s var(--ds-ease-in-out, ease), border-color .15s var(--ds-ease-in-out, ease), transform .15s var(--ds-ease-in-out, ease);
5560
+ }
5561
+
5562
+ .bxf-button:hover:not(:disabled) {
5563
+ background: var(--dsw-alias-interactive-bg-hover, #f2f3f5);
5564
+ border-color: var(--dsw-alias-border-l1, #c9cdd4);
5565
+ }
5566
+
5567
+ .bxf-button:active:not(:disabled) { transform: translateY(1px); }
5568
+
5569
+ .bxf-button:focus-visible, .bxf-link:focus-visible {
5570
+ outline: 2px solid var(--bxf-accent);
5571
+ outline-offset: 2px;
5572
+ }
5573
+
5574
+ .bxf-button:disabled { cursor: not-allowed; opacity: .55; }
5575
+
5576
+ .bxf-button[data-kind="primary"] {
5577
+ border-color: var(--bxf-accent);
5578
+ color: #fff;
5579
+ background: var(--bxf-accent);
5580
+ box-shadow: 0 4px 12px color-mix(in srgb, var(--bxf-accent) 24%, transparent);
5581
+ }
5582
+
5583
+ .bxf-button[data-kind="primary"]:hover:not(:disabled) {
5584
+ border-color: color-mix(in srgb, var(--bxf-accent) 86%, #000);
5585
+ background: color-mix(in srgb, var(--bxf-accent) 90%, #000);
5586
+ }
5587
+
5588
+ .bxf-button[data-kind="danger"] { color: var(--bxf-error); }
5589
+ .bxf-button[data-size="small"] { min-height: 32px; padding: 5px 10px; font-size: 12px; }
5590
+ .bxf-bindButton { flex: none; white-space: nowrap; }
5591
+
5592
+ .bxf-provisionCard {
5593
+ border-color: color-mix(in srgb, var(--bxf-accent) 32%, var(--dsw-alias-border-l2, #dee0e3));
5594
+ }
5595
+
5596
+ .bxf-markStage {
5597
+ position: relative;
5598
+ width: 156px;
5599
+ height: 156px;
5600
+ display: grid;
5601
+ place-items: center;
5602
+ justify-self: end;
5603
+ }
5604
+
5605
+ .bxf-markStage::before, .bxf-markStage::after {
5606
+ content: "";
5607
+ position: absolute;
5608
+ border-radius: 50%;
5609
+ }
5610
+
5611
+ .bxf-markStage::before {
5612
+ inset: 12px;
5613
+ border: 1px solid color-mix(in srgb, var(--bxf-accent) 18%, var(--dsw-alias-border-l2, #dee0e3));
5614
+ background: color-mix(in srgb, var(--bxf-accent) 4%, var(--dsw-alias-bg-layer-1, #fff));
5615
+ }
5616
+
5617
+ .bxf-markStage::after {
5618
+ inset: 0;
5619
+ border: 1px dashed color-mix(in srgb, var(--bxf-accent) 16%, transparent);
5620
+ animation: bxf-rotate 18s linear infinite;
5621
+ }
5622
+
5623
+ .bxf-brandMark {
5624
+ position: relative;
5625
+ z-index: 1;
5626
+ width: 68px;
5627
+ height: 68px;
5628
+ display: grid;
5629
+ place-items: center;
5630
+ border-radius: 20px;
5631
+ color: #fff;
5632
+ background: var(--bxf-accent);
5633
+ box-shadow: 0 12px 28px color-mix(in srgb, var(--bxf-accent) 28%, transparent);
5634
+ }
5635
+
5636
+ .bxf-qrLayout {
5637
+ display: grid;
5638
+ grid-template-columns: 236px minmax(0, 1fr);
5639
+ align-items: center;
5640
+ gap: 32px;
5641
+ }
5642
+
5643
+ .bxf-qrColumn { min-width: 0; }
5644
+
5645
+ .bxf-qrFrame {
5646
+ position: relative;
5647
+ width: 222px;
5648
+ height: 222px;
5649
+ display: grid;
5650
+ place-items: center;
5651
+ border: 1px solid var(--dsw-alias-border-l2, #dee0e3);
5652
+ border-radius: 14px;
5653
+ padding: 13px;
5654
+ background: #fff;
5655
+ box-shadow: 0 8px 24px rgba(31, 35, 41, .07);
5656
+ }
5657
+
5658
+ .bxf-qrFrame::before, .bxf-qrFrame::after {
5659
+ content: "";
5660
+ position: absolute;
5661
+ width: 24px;
5662
+ height: 24px;
5663
+ border-color: var(--bxf-accent);
5664
+ border-style: solid;
5665
+ }
5666
+
5667
+ .bxf-qrFrame::before { inset: -3px auto auto -3px; border-width: 2px 0 0 2px; border-radius: 5px 0 0; }
5668
+ .bxf-qrFrame::after { inset: auto -3px -3px auto; border-width: 0 2px 2px 0; border-radius: 0 0 5px; }
5669
+ .bxf-qrFrame img { width: 100%; height: 100%; display: block; object-fit: contain; }
5670
+
5671
+ .bxf-qrFallback {
5672
+ width: 100%;
5673
+ height: 100%;
5674
+ display: grid;
5675
+ place-items: center;
5676
+ border-radius: 8px;
5677
+ color: var(--bxf-accent);
5678
+ background: #f7f9ff;
5679
+ text-align: center;
5680
+ padding: 20px;
5681
+ }
5682
+
5683
+ .bxf-qrFallback span { display: block; color: #646a73; font-size: 12px; line-height: 18px; margin-top: 8px; }
5684
+
5685
+ .bxf-expiredOverlay {
5686
+ position: absolute;
5687
+ inset: 10px;
5688
+ display: grid;
5689
+ place-items: center;
5690
+ border-radius: 9px;
5691
+ color: #1f2329;
5692
+ background: rgba(255, 255, 255, .94);
5693
+ backdrop-filter: blur(3px);
5694
+ font-size: 13px;
5695
+ font-weight: 600;
5696
+ text-align: center;
5697
+ }
5698
+
5699
+ .bxf-countdown {
5700
+ width: 222px;
5701
+ color: var(--dsw-alias-label-tertiary, #8f959e);
5702
+ font-variant-numeric: tabular-nums;
5703
+ font-size: 11px;
5704
+ line-height: 17px;
5705
+ margin-top: 11px;
5706
+ }
5707
+
5708
+ .bxf-countdownTop { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
5709
+ .bxf-progress { height: 3px; overflow: hidden; border-radius: 99px; background: var(--dsw-alias-bg-module-platform, #f2f3f5); margin-top: 6px; }
5710
+ .bxf-progress > span { display: block; width: var(--bxf-progress, 100%); height: 100%; border-radius: inherit; background: var(--bxf-accent); transition: width 1s linear; }
5711
+
5712
+ .bxf-qrCopy h3 { font-size: 20px; line-height: 29px; font-weight: 650; }
5713
+ .bxf-qrCopy > p { color: var(--dsw-alias-label-secondary, #646a73); font-size: 13px; line-height: 21px; margin-top: 7px; }
5714
+
5715
+ .bxf-steps { counter-reset: bxf-step; display: flex; flex-direction: column; gap: 11px; margin: 20px 0 0; padding: 0; list-style: none; }
5716
+ .bxf-steps li { counter-increment: bxf-step; display: grid; grid-template-columns: 23px minmax(0, 1fr); align-items: start; gap: 9px; color: var(--dsw-alias-label-secondary, #646a73); font-size: 12px; line-height: 19px; }
5717
+ .bxf-steps li::before { content: counter(bxf-step); width: 21px; height: 21px; display: grid; place-items: center; border: 1px solid var(--dsw-alias-border-l2, #dee0e3); border-radius: 50%; color: var(--dsw-alias-label-primary, #1f2329); background: var(--dsw-alias-bg-layer-1, #fff); font-size: 10px; font-weight: 650; }
5718
+
5719
+ .bxf-connecting { min-height: 292px; display: grid; place-items: center; text-align: center; padding: 36px 24px; }
5720
+ .bxf-connectingCopy { max-width: 430px; }
5721
+ .bxf-orbit { position: relative; width: 86px; height: 86px; display: grid; place-items: center; margin: 0 auto 22px; }
5722
+ .bxf-orbit::before, .bxf-orbit::after { content: ""; position: absolute; border-radius: 50%; }
5723
+ .bxf-orbit::before { inset: 3px; border: 1px solid color-mix(in srgb, var(--bxf-accent) 24%, transparent); animation: bxf-pulse 1.8s var(--ds-ease-in-out, ease) infinite; }
5724
+ .bxf-orbit::after { inset: 0; border: 2px solid transparent; border-top-color: var(--bxf-accent); animation: bxf-rotate 1.2s linear infinite; }
5725
+ .bxf-orbitCore { width: 50px; height: 50px; display: grid; place-items: center; border-radius: 16px; color: var(--bxf-accent); background: color-mix(in srgb, var(--bxf-accent) 9%, var(--dsw-alias-bg-layer-1, #fff)); }
5726
+ .bxf-connecting h3 { font-size: 20px; line-height: 29px; }
5727
+ .bxf-connecting p { color: var(--dsw-alias-label-secondary, #646a73); font-size: 13px; line-height: 21px; margin-top: 7px; }
5728
+ .bxf-connectingCompact { min-height: 248px; }
5729
+
5730
+ .bxf-inlineError {
5731
+ min-height: 190px;
5732
+ display: grid;
5733
+ grid-template-columns: 44px minmax(0, 1fr);
5734
+ align-content: center;
5735
+ gap: 15px;
5736
+ padding: 28px;
5737
+ }
5738
+
5739
+ .bxf-inlineError h3 { font-size: 17px; line-height: 25px; margin: 0; }
5740
+ .bxf-inlineError p { color: var(--dsw-alias-label-secondary, #646a73); font-size: 13px; line-height: 21px; margin-top: 5px; overflow-wrap: anywhere; }
5741
+
5742
+ .bxf-listSection { display: flex; flex-direction: column; gap: 10px; }
5743
+ .bxf-listHeading { min-height: 28px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 2px; }
5744
+ .bxf-listHeading h3 { font-size: 14px; line-height: 22px; font-weight: 650; margin: 0; }
5745
+ .bxf-botList { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; }
5746
+ .bxf-botList > li { min-width: 0; }
5747
+ .bxf-botCard:focus { outline: none; }
5748
+ .bxf-botCard:focus-visible { outline: 2px solid var(--bxf-accent); outline-offset: 2px; }
5749
+
5750
+ .bxf-connectedTop { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
5751
+ .bxf-botIdentity { min-width: 0; display: flex; align-items: center; gap: 13px; }
5752
+ .bxf-avatar { flex: none; width: 48px; height: 48px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--dsw-alias-border-l2, #e5e6eb); border-radius: 14px; background: var(--dsw-alias-bg-layer-1, #fff); box-shadow: 0 1px 3px rgb(31 35 41 / 7%); }
5753
+ .bxf-botName { min-width: 0; }
5754
+ .bxf-botName h3 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 17px; line-height: 24px; font-weight: 650; }
5755
+ .bxf-botName p { overflow: hidden; color: var(--dsw-alias-label-tertiary, #8f959e); font-family: var(--ds-font-family-code, monospace); font-size: 12px; line-height: 18px; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
5756
+
5757
+ .bxf-healthPill { flex: none; display: inline-flex; align-items: center; gap: 7px; min-height: 28px; border-radius: 999px; padding: 4px 10px; color: var(--bxf-success); background: color-mix(in srgb, var(--bxf-success) 10%, transparent); font-size: 12px; font-weight: 600; line-height: 18px; }
5758
+ .bxf-healthPill[data-health="degraded"], .bxf-healthPill[data-health="checking"], .bxf-healthPill[data-health="connecting"] { color: var(--bxf-warning); background: color-mix(in srgb, var(--bxf-warning) 10%, transparent); }
5759
+ .bxf-healthPill[data-health="offline"], .bxf-healthPill[data-health="error"] { color: var(--bxf-error); background: color-mix(in srgb, var(--bxf-error) 10%, transparent); }
5760
+
5761
+
5762
+ .bxf-responseMode { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) max-content; align-items: center; column-gap: 10px; row-gap: 5px; margin-top: 6px; padding: 8px 10px; border: 1px solid var(--dsw-alias-border-l1, #eef0f3); border-radius: 9px; background: var(--dsw-alias-bg-module-platform, #f7f8fa); }
5763
+ .bxf-responseModeHeader { display: contents; color: var(--dsw-alias-label-secondary, #646a73); font-size: 12px; line-height: normal; }
5764
+ .bxf-responseModeHeader > span:first-child { grid-column: 1; grid-row: 1; white-space: nowrap; }
5765
+ .bxf-responseModeStatus { grid-column: 2; grid-row: 1; color: var(--dsw-alias-label-tertiary, #8f959e); font-size: 12px; white-space: nowrap; }
5766
+ .bxf-responseModeSelect { min-width: 0; width: 100%; grid-column: 1 / -1; grid-row: 2; height: 32px; padding: 0 30px 0 9px; border: 1px solid var(--dsw-alias-border-l2, #dfe1e5); border-radius: 7px; color: var(--dsw-alias-label-primary, #1f2329); background-color: var(--dsw-alias-bg-layer-1, #fff); font: inherit; font-size: 12px; cursor: pointer; transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease; }
5767
+ .bxf-responseModeSelect:hover:not(:disabled) { border-color: color-mix(in srgb, var(--bxf-accent) 45%, var(--dsw-alias-border-l2, #dfe1e5)); }
5768
+ .bxf-responseModeSelect:focus-visible { outline: none; border-color: var(--bxf-accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--bxf-accent) 16%, transparent); }
5769
+ .bxf-responseModeSelect:disabled { cursor: not-allowed; opacity: .55; }
5770
+ .bxf-responseModeHelp { grid-column: 1 / -1; grid-row: 3; color: var(--dsw-alias-label-tertiary, #8f959e); font-size: 11px; line-height: 1.45; }
5771
+ .bxf-responseModePermissionAction { grid-column: 1 / -1; grid-row: 4; display: flex; justify-content: flex-start; margin-top: 2px; }
5772
+ .bxf-responseModePermissionButton { min-height: 28px; padding: 3px 9px; color: var(--bxf-accent); border-color: color-mix(in srgb, var(--bxf-accent) 30%, var(--dsw-alias-border-l2, #dfe1e5)); background: var(--dsw-alias-bg-layer-1, #fff); }
5773
+ .bxf-responseModePermissionButton:hover:not(:disabled) { background: color-mix(in srgb, var(--bxf-accent) 7%, transparent); }
5774
+ .bxf-responseModeError { grid-column: 1 / -1; grid-row: 5; color: var(--bxf-error); font-size: 12px; line-height: 1.4; margin: 0; }
5775
+
5776
+ .bxf-botProvision {
5777
+ position: relative;
5778
+ margin-top: 14px;
5779
+ scroll-margin-block: 20px;
5780
+ animation: bxf-revealProvision .2s var(--ds-ease-out, ease-out) both;
5781
+ }
5782
+ .bxf-botProvision:focus { outline: none; }
5783
+ .bxf-botProvision:focus-visible {
5784
+ outline: 2px solid color-mix(in srgb, var(--bxf-accent) 75%, transparent);
5785
+ outline-offset: 3px;
5786
+ border-radius: 12px;
5787
+ }
5788
+ .bxf-botProvision > .bxf-provisionCard {
5789
+ border-radius: 11px;
5790
+ box-shadow: none;
5791
+ background: color-mix(in srgb, var(--bxf-accent) 2.5%, var(--dsw-alias-bg-layer-3, #fff));
5792
+ }
5793
+ .bxf-botProvision .bxf-cardBody { padding: 18px; }
5794
+ .bxf-botProvision .bxf-qrLayout {
5795
+ grid-template-columns: 184px minmax(0, 1fr);
5796
+ align-items: start;
5797
+ gap: 24px;
5798
+ }
5799
+ .bxf-botProvision .bxf-qrFrame { width: 176px; height: 176px; padding: 10px; border-radius: 11px; }
5800
+ .bxf-botProvision .bxf-countdown { width: 176px; }
5801
+ .bxf-botProvision .bxf-qrCopy h3 { font-size: 18px; line-height: 26px; }
5802
+ .bxf-botProvision .bxf-steps { gap: 8px; margin-top: 14px; }
5803
+ .bxf-botProvision .bxf-actions { margin-top: 16px; }
5804
+ .bxf-botProvision .bxf-inlineError { min-height: 160px; padding: 22px; }
5805
+
5806
+ .bxf-connectedFooter { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--dsw-alias-border-l1, #eef0f3); }
5807
+ .bxf-healthSummary { min-width: 0; color: var(--dsw-alias-label-secondary, #646a73); font-size: 12px; line-height: 18px; }
5808
+ .bxf-healthSummary[data-error="true"] { color: var(--bxf-error); }
5809
+ .bxf-botActions { position: relative; flex: none; width: 100%; flex-wrap: wrap; gap: 8px; margin-top: 0; justify-content: flex-end; }
5810
+ .bxf-botActions .bxf-button { flex: none; white-space: nowrap; }
5811
+ .bxf-botActions .bxf-repairButton { color: var(--bxf-accent); border-color: color-mix(in srgb, var(--bxf-accent) 35%, var(--dsw-alias-border-l2, #dee0e3)); }
5812
+ .bxf-botActions .bxf-repairButton:hover:not(:disabled) { background: color-mix(in srgb, var(--bxf-accent) 7%, transparent); }
5813
+ .bxf-repairAction { display: inline-flex; }
5814
+ .bxf-repairTooltip {
5815
+ position: absolute;
5816
+ right: 0;
5817
+ bottom: calc(100% + 8px);
5818
+ z-index: 40;
5819
+ width: min(330px, 100%);
5820
+ display: grid;
5821
+ gap: 3px;
5822
+ padding: 9px 10px;
5823
+ border: 1px solid var(--dsw-alias-border-l2, #dfe1e5);
5824
+ border-radius: 8px;
5825
+ color: var(--dsw-alias-label-primary, #1f2329);
5826
+ background: var(--dsw-alias-bg-layer-3, #fff);
5827
+ box-shadow: 0 10px 28px rgb(31 35 41 / 16%);
5828
+ opacity: 0;
5829
+ visibility: hidden;
5830
+ transform: translateY(3px);
5831
+ pointer-events: none;
5832
+ transition: opacity .15s ease, transform .15s ease, visibility .15s ease;
5833
+ }
5834
+ .bxf-repairTooltip strong { font-size: 12px; line-height: 17px; font-weight: 650; }
5835
+ .bxf-repairTooltip > span { color: var(--dsw-alias-label-secondary, #646a73); font-size: 11px; line-height: 17px; font-weight: 400; overflow-wrap: anywhere; }
5836
+ .bxf-repairAction:hover .bxf-repairTooltip,
5837
+ .bxf-repairAction:focus-within .bxf-repairTooltip { opacity: 1; visibility: visible; transform: translateY(0); }
5838
+
5839
+ .bxf-confirm {
5840
+ border-top: 1px solid var(--dsw-alias-border-l2, #dee0e3);
5841
+ background: color-mix(in srgb, var(--bxf-error) 4%, var(--dsw-alias-bg-module-platform, #f7f8fa));
5842
+ padding: 17px 24px 20px;
5843
+ }
5844
+ .bxf-confirm:focus { outline: none; }
5845
+ .bxf-confirm h4 { font-size: 13px; line-height: 20px; margin: 0; }
5846
+ .bxf-confirm p { color: var(--dsw-alias-label-secondary, #646a73); font-size: 12px; line-height: 19px; margin: 4px 0 0; }
5847
+ .bxf-confirm .bxf-actions { margin-top: 12px; }
5848
+
5849
+ .bxf-error { min-height: 252px; display: grid; grid-template-columns: 44px minmax(0, 1fr); align-content: center; gap: 15px; padding: 30px; }
5850
+ .bxf-errorIcon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 13px; color: var(--bxf-error); background: color-mix(in srgb, var(--bxf-error) 9%, transparent); }
5851
+ .bxf-error h3 { font-size: 17px; line-height: 25px; }
5852
+ .bxf-error p { color: var(--dsw-alias-label-secondary, #646a73); font-size: 13px; line-height: 21px; margin-top: 5px; overflow-wrap: anywhere; }
5853
+ .bxf-errorCode { display: inline-block; color: var(--dsw-alias-label-tertiary, #8f959e); font-family: var(--ds-font-family-code, monospace); font-size: 11px; margin-top: 7px; }
5854
+
5855
+ .bxf-statusNotice {
5856
+ display: flex;
5857
+ align-items: center;
5858
+ gap: 9px;
5859
+ border: 1px solid color-mix(in srgb, var(--bxf-warning) 28%, var(--dsw-alias-border-l2, #dee0e3));
5860
+ border-radius: 10px;
5861
+ padding: 9px 11px;
5862
+ color: var(--dsw-alias-label-secondary, #646a73);
5863
+ background: color-mix(in srgb, var(--bxf-warning) 5%, var(--dsw-alias-bg-layer-1, #fff));
5864
+ font-size: 12px;
5865
+ line-height: 18px;
5866
+ }
5867
+ .bxf-statusNotice > svg { flex: none; color: var(--bxf-warning); }
5868
+ .bxf-statusNotice > span { min-width: 0; flex: 1; overflow-wrap: anywhere; }
5869
+
5870
+ .bxf-skeleton { min-height: 260px; padding: 28px; }
5871
+ .bxf-skeletonLine { height: 12px; border-radius: 999px; background: linear-gradient(90deg, var(--dsw-alias-bg-module-platform, #f2f3f5), color-mix(in srgb, var(--dsw-alias-label-tertiary, #8f959e) 10%, transparent), var(--dsw-alias-bg-module-platform, #f2f3f5)); background-size: 220% 100%; animation: bxf-shimmer 1.5s linear infinite; }
5872
+ .bxf-skeletonLine:nth-child(1) { width: 92px; }
5873
+ .bxf-skeletonLine:nth-child(2) { width: 44%; height: 22px; margin-top: 23px; }
5874
+ .bxf-skeletonLine:nth-child(3) { width: 72%; margin-top: 14px; }
5875
+ .bxf-skeletonLine:nth-child(4) { width: 58%; margin-top: 9px; }
5876
+ .bxf-skeletonBox { width: 138px; height: 38px; border-radius: 8px; background: var(--dsw-alias-bg-module-platform, #f2f3f5); margin-top: 28px; }
5877
+
5878
+ .bxf-visuallyHidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
5879
+
5880
+ @keyframes bxf-rotate { to { transform: rotate(360deg); } }
5881
+ @keyframes bxf-pulse { 0%, 100% { transform: scale(.9); opacity: .45; } 50% { transform: scale(1.08); opacity: 1; } }
5882
+ @keyframes bxf-shimmer { to { background-position: -220% 0; } }
5883
+ @keyframes bxf-revealProvision { from { opacity: 0; transform: translateY(-5px); } }
5884
+
5885
+ @container (max-width: 620px) {
5886
+ .bxf-headingTools { gap: 6px; }
5887
+ .bxf-headingTools .bxf-totalBadge { padding-inline: 8px; }
5888
+ .bxf-headingTools .bxf-bindButton { padding-inline: 10px; }
5889
+ }
5890
+
5891
+ @media (max-width: 680px) {
5892
+ .bxf-intro { grid-template-columns: minmax(0, 1fr); }
5893
+ .bxf-markStage { display: none; }
5894
+ .bxf-qrLayout { grid-template-columns: minmax(0, 1fr); justify-items: center; }
5895
+ .bxf-botProvision .bxf-qrLayout { grid-template-columns: minmax(0, 1fr); }
5896
+ .bxf-qrCopy { width: 100%; }
5897
+ .bxf-connectedTop { align-items: flex-start; flex-direction: column; }
5898
+ .bxf-inlineError { grid-template-columns: minmax(0, 1fr); padding: 20px; }
5899
+ .bxf-statusNotice { align-items: flex-start; flex-wrap: wrap; }
5900
+ .bxf-cardBody { padding: 20px; }
5901
+ }
5902
+
5903
+ @media (prefers-reduced-motion: reduce) {
5904
+ .bxf-page *, .bxf-page *::before, .bxf-page *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
5905
+ }
5906
+ `;
5907
+ function installFeishuStyles() {
5908
+ if (typeof document === "undefined") {
5909
+ return () => {
5910
+ };
5911
+ }
5912
+ const existing = document.querySelector(
5913
+ `style[data-plugin-css="${FEISHU_STYLE_ID}"]`
5914
+ );
5915
+ if (existing) {
5916
+ return () => {
5917
+ };
5918
+ }
5919
+ const style = document.createElement("style");
5920
+ style.dataset.plugin = "@xmanrui/dsh-im";
5921
+ style.dataset.pluginCss = FEISHU_STYLE_ID;
5922
+ style.textContent = CSS3;
5923
+ document.head.appendChild(style);
5924
+ return () => {
5925
+ style.remove();
5926
+ };
5927
+ }
5928
+
5926
5929
  // plugin-src/client/channels/qq/api.js
5927
5930
  var QQ_RPC_CHANNEL = "/qq";
5928
5931
  var QQ_ENDPOINTS = Object.freeze({
@@ -7279,32 +7282,34 @@ var CSS7 = String.raw`
7279
7282
  .dtg-page { --ddt-accent: #229ed9; --ddt-accent-deep: #1687bd; --ddt-accent-wash: #eaf7fd; }
7280
7283
  .dtg-avatar { color: #fff; background: #229ed9; }
7281
7284
  .dtg-avatar svg { display: block; }
7282
- .dtg-access { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--dsw-alias-border-l2, #dfe1e5); border-radius: 10px; background: var(--dsw-alias-bg-layer-2, #f7f8fa); }
7283
- .dtg-accessHeading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
7284
- .dtg-accessHeading > strong { font-size: 13px; }
7285
- .dtg-accessStatus { min-width: 0; display: inline-flex; align-items: center; justify-content: flex-end; gap: 6px; }
7286
- .dtg-accessBadge { flex: none; padding: 3px 8px; border-radius: 999px; color: #1687bd; background: #eaf7fd; font-size: 11px; font-weight: 700; }
7285
+ .dtg-access { min-width: 0; width: 100%; max-width: 100%; display: grid; gap: 10px; padding: 12px; border: 1px solid var(--dsw-alias-border-l2, #dfe1e5); border-radius: 10px; background: var(--dsw-alias-bg-layer-2, #f7f8fa); }
7286
+ .dtg-accessHeading { position: relative; min-width: 0; max-width: 100%; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; }
7287
+ .dtg-accessHeading > strong { min-width: 0; font-size: 13px; overflow-wrap: anywhere; }
7288
+ .dtg-accessStatus { min-width: 0; max-width: 100%; flex: 0 1 auto; display: inline-flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 6px; }
7289
+ .dtg-accessBadge { min-width: 0; max-width: 100%; flex: 0 1 auto; padding: 3px 8px; border-radius: 999px; color: #1687bd; background: #eaf7fd; font-size: 11px; font-weight: 700; overflow-wrap: anywhere; text-align: center; }
7287
7290
  .dtg-accessBadge[data-mode="private-allowlist"] { color: #a15c00; background: #fff3d6; }
7288
- .dtg-accessHelp { position: relative; display: inline-flex; flex: none; }
7291
+ .dtg-accessHelp { position: static; display: inline-flex; flex: none; }
7289
7292
  .dtg-accessHelpButton { width: 20px; height: 20px; display: grid; place-items: center; padding: 0; border: 1px solid color-mix(in srgb, #229ed9 28%, var(--dsw-alias-border-l2, #dfe1e5)); border-radius: 50%; color: #1687bd; background: var(--dsw-alias-bg-layer-1, #fff); font: inherit; font-size: 12px; line-height: 1; font-weight: 750; cursor: help; transition: border-color .15s ease, color .15s ease, background .15s ease, box-shadow .15s ease; }
7290
7293
  .dtg-accessHelpButton:hover { border-color: #229ed9; color: #1178a8; background: #eaf7fd; }
7291
7294
  .dtg-accessHelpButton:focus-visible { outline: none; border-color: #229ed9; box-shadow: 0 0 0 3px color-mix(in srgb, #229ed9 18%, transparent); }
7292
- .dtg-accessTooltip { position: absolute; top: calc(100% + 8px); right: 0; z-index: 30; width: 260px; max-width: min(280px, calc(100vw - 48px)); display: grid; gap: 8px; padding: 10px 11px; border: 1px solid var(--dsw-alias-border-l2, #dfe1e5); border-radius: 9px; color: var(--dsw-alias-label-primary, #1f2329); background: var(--dsw-alias-bg-layer-3, #fff); box-shadow: 0 10px 28px rgb(31 35 41 / 16%); opacity: 0; visibility: hidden; transform: translateY(-3px); pointer-events: none; transition: opacity .15s ease, transform .15s ease, visibility .15s ease; }
7295
+ .dtg-accessTooltip { position: absolute; top: calc(100% + 8px); right: 0; z-index: 30; width: min(300px, 100%); max-width: 100%; display: grid; gap: 8px; padding: 10px 11px; border: 1px solid var(--dsw-alias-border-l2, #dfe1e5); border-radius: 9px; color: var(--dsw-alias-label-primary, #1f2329); background: var(--dsw-alias-bg-layer-3, #fff); box-shadow: 0 10px 28px rgb(31 35 41 / 16%); opacity: 0; visibility: hidden; transform: translateY(-3px); pointer-events: none; transition: opacity .15s ease, transform .15s ease, visibility .15s ease; }
7293
7296
  .dtg-accessTooltipItem { display: grid; gap: 2px; }
7294
7297
  .dtg-accessTooltipItem + .dtg-accessTooltipItem { padding-top: 8px; border-top: 1px solid var(--dsw-alias-border-l2, #eef0f3); }
7295
7298
  .dtg-accessTooltipItem strong { color: var(--dsw-alias-label-primary, #1f2329); font-size: 12px; line-height: 17px; font-weight: 700; }
7296
7299
  .dtg-accessTooltipItem > span { color: var(--dsw-alias-label-secondary, #646a73); font-size: 11px; line-height: 16px; font-weight: 400; }
7297
7300
  .dtg-accessHelp:hover .dtg-accessTooltip, .dtg-accessHelp:focus-within .dtg-accessTooltip { opacity: 1; visibility: visible; transform: translateY(0); }
7298
- .dtg-accessField { display: grid; gap: 5px; color: var(--dsw-alias-label-primary, #1f2329); font-size: 12px; font-weight: 600; }
7299
- .dtg-accessField select, .dtg-accessField textarea { width: 100%; box-sizing: border-box; border: 1px solid var(--dsw-alias-border-l1, #c9cdd4); border-radius: 7px; color: inherit; background: var(--dsw-alias-bg-layer-1, #fff); font: inherit; font-weight: 400; }
7301
+ .dtg-accessField { min-width: 0; max-width: 100%; display: grid; gap: 5px; color: var(--dsw-alias-label-primary, #1f2329); font-size: 12px; font-weight: 600; }
7302
+ .dtg-accessField select, .dtg-accessField textarea { min-width: 0; width: 100%; max-width: 100%; box-sizing: border-box; border: 1px solid var(--dsw-alias-border-l1, #c9cdd4); border-radius: 7px; color: inherit; background: var(--dsw-alias-bg-layer-1, #fff); font: inherit; font-weight: 400; }
7300
7303
  .dtg-accessField select { height: 34px; padding: 0 9px; }
7301
7304
  .dtg-accessField textarea { min-height: 68px; padding: 8px 9px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
7302
7305
  .dtg-accessField textarea:disabled { color: var(--dsw-alias-label-tertiary, #8f959e); background: var(--dsw-alias-bg-module-platform, #f2f3f5); cursor: not-allowed; resize: none; opacity: 1; }
7306
+ .dtg-accessField > span, .dtg-accessField small { overflow-wrap: anywhere; }
7303
7307
  .dtg-accessField small { color: var(--dsw-alias-label-secondary, #646a73); font-weight: 400; }
7304
7308
  .dtg-accessWarning, .dtg-accessError { margin: 0; font-size: 12px; line-height: 1.5; }
7305
7309
  .dtg-accessWarning { color: #a15c00; }
7306
7310
  .dtg-accessError { color: var(--dsw-alias-state-error-primary, #d83931); }
7307
- .dtg-accessActions { display: flex; justify-content: flex-end; }
7311
+ .dtg-accessActions { min-width: 0; max-width: 100%; display: flex; justify-content: flex-end; flex-wrap: wrap; }
7312
+ .dtg-accessActions .ddt-button { max-width: 100%; white-space: normal; }
7308
7313
  `;
7309
7314
  function installTelegramStyles() {
7310
7315
  if (typeof document === "undefined") return () => {
@@ -8417,123 +8422,6 @@ function formatRemaining5(milliseconds) {
8417
8422
  return `${Math.floor(seconds / 60)}:${String(seconds % 60).padStart(2, "0")}`;
8418
8423
  }
8419
8424
 
8420
- // plugin-src/client/channels/weixin/styles.js
8421
- var WEIXIN_STYLE_ID = "xmanrui-dsh-weixin-settings";
8422
- var CSS9 = String.raw`
8423
- .dxw-page {
8424
- --dxw-accent: #07c160;
8425
- --dxw-accent-dark: #05994c;
8426
- --dxw-success: var(--dsw-alias-state-success-primary, #20a162);
8427
- --dxw-warning: var(--dsw-alias-state-warn-primary, #d97706);
8428
- --dxw-error: var(--dsw-alias-state-error-primary, #d54941);
8429
- width: 100%;
8430
- max-width: 880px;
8431
- display: flex;
8432
- flex-direction: column;
8433
- gap: 18px;
8434
- padding: 2px 0 28px;
8435
- color: var(--dsw-alias-label-primary, #1f2329);
8436
- box-sizing: border-box;
8437
- }
8438
- .dxw-page *, .dxw-page *::before, .dxw-page *::after { box-sizing: border-box; }
8439
- .dxw-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
8440
- .dxw-heading h2, .dxw-heading p, .dxw-card h3, .dxw-card p { margin: 0; }
8441
- .dxw-eyebrow { color: var(--dsw-alias-label-tertiary, #8f959e); font-size: 12px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 3px; }
8442
- .dxw-heading h2 { font-size: 20px; line-height: 28px; font-weight: 680; }
8443
- .dxw-heading p { color: var(--dsw-alias-label-secondary, #646a73); font-size: 13px; line-height: 20px; margin-top: 5px; white-space: nowrap; }
8444
- .dxw-tools, .dxw-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
8445
- .dxw-tools { width: 100%; justify-content: space-between; flex-wrap: nowrap; }
8446
- .dxw-badge { display: inline-flex; align-items: center; gap: 7px; min-height: 30px; padding: 0 11px; border-radius: 999px; color: var(--dsw-alias-label-secondary, #646a73); background: var(--dsw-alias-bg-module-platform, #f2f3f5); font-size: 12px; white-space: nowrap; }
8447
- .dxw-dot { width: 8px; height: 8px; border-radius: 50%; background: #aeb3bb; flex: none; }
8448
- .dxw-dot[data-tone="success"] { background: var(--dxw-success); box-shadow: 0 0 0 3px color-mix(in srgb, var(--dxw-success) 14%, transparent); }
8449
- .dxw-dot[data-tone="warning"] { background: var(--dxw-warning); }
8450
- .dxw-dot[data-tone="error"] { background: var(--dxw-error); }
8451
- .dxw-button { min-height: 34px; border: 1px solid var(--dsw-alias-border-l2, #dfe1e5); border-radius: 8px; padding: 0 13px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; color: var(--dsw-alias-label-primary, #1f2329); background: var(--dsw-alias-bg-layer-1, #fff); font: inherit; font-size: 13px; font-weight: 560; cursor: pointer; text-decoration: none; transition: border-color .15s ease, background .15s ease, transform .15s ease; }
8452
- .dxw-button:hover:not(:disabled) { border-color: #aeb3bb; background: var(--dsw-alias-interactive-bg-hover, #f7f8fa); }
8453
- .dxw-button:active:not(:disabled) { transform: translateY(1px); }
8454
- .dxw-button:focus-visible, .dxw-input:focus-visible { outline: 2px solid color-mix(in srgb, var(--dxw-accent) 70%, white); outline-offset: 2px; }
8455
- .dxw-button:disabled { cursor: not-allowed; opacity: .55; }
8456
- .dxw-button[data-kind="primary"] { color: white; border-color: var(--dxw-accent); background: var(--dxw-accent); }
8457
- .dxw-button[data-kind="primary"]:hover:not(:disabled) { border-color: var(--dxw-accent-dark); background: var(--dxw-accent-dark); }
8458
- .dxw-button[data-kind="danger"] { color: var(--dxw-error); }
8459
- .dxw-card { overflow: hidden; border: 1px solid var(--dsw-alias-border-l2, #e5e6eb); border-radius: 14px; background: var(--dsw-alias-bg-layer-1, #fff); box-shadow: 0 1px 2px rgb(31 35 41 / 3%); }
8460
- .dxw-cardBody { padding: 24px; }
8461
- .dxw-empty { min-height: 230px; display: grid; grid-template-columns: minmax(0, 1fr) 180px; align-items: center; gap: 30px; }
8462
- .dxw-empty h3 { font-size: 18px; margin-bottom: 8px; }
8463
- .dxw-empty p { max-width: 560px; color: var(--dsw-alias-label-secondary, #646a73); line-height: 1.65; }
8464
- .dxw-empty .dxw-actions { margin-top: 20px; }
8465
- .dxw-logo { width: 110px; height: 110px; display: grid; place-items: center; justify-self: center; border-radius: 28px; color: white; background: var(--dxw-accent); box-shadow: 0 18px 45px rgb(7 193 96 / 22%); }
8466
- .dxw-logo svg { width: 62px; height: 62px; }
8467
- .dxw-qrLayout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 34px; align-items: center; }
8468
- .dxw-qrColumn { display: flex; flex-direction: column; align-items: center; gap: 12px; }
8469
- .dxw-qrFrame { position: relative; width: 270px; aspect-ratio: 1; display: grid; place-items: center; overflow: hidden; padding: 10px; border: 1px solid var(--dsw-alias-border-l2, #e5e6eb); border-radius: 16px; background: white; }
8470
- .dxw-qrFrame img { display: block; width: 100%; height: 100%; object-fit: contain; }
8471
- .dxw-qrFallback { padding: 24px; text-align: center; color: #646a73; }
8472
- .dxw-expired { position: absolute; inset: 0; display: grid; place-items: center; padding: 30px; color: white; text-align: center; font-weight: 650; background: rgb(31 35 41 / 76%); backdrop-filter: blur(3px); }
8473
- .dxw-countdown { width: 270px; color: var(--dsw-alias-label-secondary, #646a73); font-size: 12px; }
8474
- .dxw-countdown div { display: flex; justify-content: space-between; margin-bottom: 6px; }
8475
- .dxw-progress { height: 4px; overflow: hidden; border-radius: 99px; background: #eef0f3; }
8476
- .dxw-progress span { display: block; width: var(--dxw-progress); height: 100%; background: var(--dxw-accent); transition: width .2s linear; }
8477
- .dxw-qrCopy h3 { margin: 9px 0 8px; font-size: 18px; }
8478
- .dxw-qrCopy > p { color: var(--dsw-alias-label-secondary, #646a73); line-height: 1.65; }
8479
- .dxw-steps { margin: 18px 0 22px; padding-left: 22px; color: var(--dsw-alias-label-secondary, #646a73); font-size: 13px; line-height: 1.9; }
8480
- .dxw-stateLabel { display: inline-flex; align-items: center; gap: 8px; color: var(--dsw-alias-label-secondary, #646a73); font-size: 12px; font-weight: 600; }
8481
- .dxw-verify { max-width: 560px; margin: 0 auto; padding: 32px; text-align: center; }
8482
- .dxw-verify h3 { margin: 8px 0; font-size: 19px; }
8483
- .dxw-verify p { color: var(--dsw-alias-label-secondary, #646a73); line-height: 1.6; }
8484
- .dxw-codeRow { display: flex; justify-content: center; gap: 10px; margin: 24px 0 10px; }
8485
- .dxw-input { width: 190px; height: 42px; padding: 0 14px; border: 1px solid var(--dsw-alias-border-l2, #dfe1e5); border-radius: 9px; background: var(--dsw-alias-bg-layer-1, white); color: inherit; font: inherit; font-size: 18px; letter-spacing: .16em; text-align: center; }
8486
- .dxw-statusNotice, .dxw-error { display: flex; align-items: center; gap: 10px; padding: 13px 15px; border: 1px solid color-mix(in srgb, var(--dxw-error) 28%, transparent); border-radius: 10px; color: var(--dxw-error); background: color-mix(in srgb, var(--dxw-error) 7%, transparent); font-size: 13px; }
8487
- .dxw-error { align-items: flex-start; flex-direction: column; padding: 22px; }
8488
- .dxw-error h3 { font-size: 17px; }
8489
- .dxw-errorCode { font-family: ui-monospace, SFMono-Regular, monospace; font-size: 11px; opacity: .8; }
8490
- .dxw-listHeading { display: flex; justify-content: space-between; align-items: center; margin: 2px 0 9px; }
8491
- .dxw-listHeading h3 { margin: 0; font-size: 14px; }
8492
- .dxw-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
8493
- .dxw-accountTop { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
8494
- .dxw-accountIdentity { display: flex; align-items: center; gap: 12px; min-width: 0; }
8495
- .dxw-avatar { width: 42px; height: 42px; display: grid; place-items: center; flex: none; border-radius: 12px; color: white; background: var(--dxw-accent); }
8496
- .dxw-accountIdentity h3 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
8497
- .dxw-accountIdentity p { color: var(--dsw-alias-label-secondary, #646a73); font: 12px ui-monospace, SFMono-Regular, monospace; margin-top: 4px; }
8498
- .dxw-health { display: inline-flex; align-items: center; gap: 7px; color: var(--dsw-alias-label-secondary, #646a73); font-size: 12px; white-space: nowrap; }
8499
- .dxw-accountFooter { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding-top: 16px; border-top: 1px solid var(--dsw-alias-border-l1, #eef0f3); }
8500
- .dxw-accountFooter .dxw-actions { flex: none; flex-wrap: nowrap; gap: 8px; margin-top: 0; }
8501
- .dxw-accountFooter .dxw-button { flex: none; white-space: nowrap; }
8502
- .dxw-summary { color: var(--dsw-alias-label-secondary, #646a73); font-size: 12px; }
8503
- .dxw-confirm { padding: 18px 24px; border-top: 1px solid color-mix(in srgb, var(--dxw-error) 25%, transparent); background: color-mix(in srgb, var(--dxw-error) 5%, transparent); }
8504
- .dxw-confirm strong { display: block; font-size: 14px; margin-bottom: 6px; }
8505
- .dxw-confirm p { color: var(--dsw-alias-label-secondary, #646a73); font-size: 12px; line-height: 1.55; }
8506
- .dxw-confirm .dxw-actions { margin-top: 13px; }
8507
- .dxw-loading { padding: 36px; color: var(--dsw-alias-label-secondary, #646a73); text-align: center; }
8508
- .dxw-spinner { width: 24px; height: 24px; margin: 0 auto 12px; border: 3px solid #e6e8eb; border-top-color: var(--dxw-accent); border-radius: 50%; animation: dxw-spin .8s linear infinite; }
8509
- .dxw-visuallyHidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
8510
- @keyframes dxw-spin { to { transform: rotate(360deg); } }
8511
- @media (max-width: 720px) {
8512
- .dxw-heading, .dxw-accountTop { flex-direction: column; align-items: stretch; }
8513
- .dxw-empty { grid-template-columns: minmax(0, 1fr); }
8514
- .dxw-logo { display: none; }
8515
- .dxw-qrLayout { grid-template-columns: minmax(0, 1fr); justify-items: center; }
8516
- .dxw-qrCopy { width: 100%; }
8517
- .dxw-cardBody { padding: 20px; }
8518
- }
8519
- @media (prefers-reduced-motion: reduce) {
8520
- .dxw-page *, .dxw-page *::before, .dxw-page *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
8521
- }
8522
- `;
8523
- function installWeixinStyles() {
8524
- if (typeof document === "undefined") return () => {
8525
- };
8526
- const existing = document.querySelector(`style[data-plugin-css="${WEIXIN_STYLE_ID}"]`);
8527
- if (existing) return () => {
8528
- };
8529
- const style = document.createElement("style");
8530
- style.dataset.plugin = "@xmanrui/dsh-weixin";
8531
- style.dataset.pluginCss = WEIXIN_STYLE_ID;
8532
- style.textContent = CSS9;
8533
- document.head.appendChild(style);
8534
- return () => style.remove();
8535
- }
8536
-
8537
8425
  // plugin-src/client/channels/weixin/index.js
8538
8426
  var Button12 = React18.forwardRef(function Button13({ children, kind = "secondary", className = "", ...props }, ref) {
8539
8427
  return h2("button", {
@@ -9320,6 +9208,123 @@ function WeixinSettingsTab({ rpcCall }) {
9320
9208
  ));
9321
9209
  }
9322
9210
 
9211
+ // plugin-src/client/channels/weixin/styles.js
9212
+ var WEIXIN_STYLE_ID = "xmanrui-dsh-im-weixin-settings";
9213
+ var CSS9 = String.raw`
9214
+ .dxw-page {
9215
+ --dxw-accent: #07c160;
9216
+ --dxw-accent-dark: #05994c;
9217
+ --dxw-success: var(--dsw-alias-state-success-primary, #20a162);
9218
+ --dxw-warning: var(--dsw-alias-state-warn-primary, #d97706);
9219
+ --dxw-error: var(--dsw-alias-state-error-primary, #d54941);
9220
+ width: 100%;
9221
+ max-width: 880px;
9222
+ display: flex;
9223
+ flex-direction: column;
9224
+ gap: 18px;
9225
+ padding: 2px 0 28px;
9226
+ color: var(--dsw-alias-label-primary, #1f2329);
9227
+ box-sizing: border-box;
9228
+ }
9229
+ .dxw-page *, .dxw-page *::before, .dxw-page *::after { box-sizing: border-box; }
9230
+ .dxw-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
9231
+ .dxw-heading h2, .dxw-heading p, .dxw-card h3, .dxw-card p { margin: 0; }
9232
+ .dxw-eyebrow { color: var(--dsw-alias-label-tertiary, #8f959e); font-size: 12px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 3px; }
9233
+ .dxw-heading h2 { font-size: 20px; line-height: 28px; font-weight: 680; }
9234
+ .dxw-heading p { color: var(--dsw-alias-label-secondary, #646a73); font-size: 13px; line-height: 20px; margin-top: 5px; white-space: nowrap; }
9235
+ .dxw-tools, .dxw-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
9236
+ .dxw-tools { width: 100%; justify-content: space-between; flex-wrap: nowrap; }
9237
+ .dxw-badge { display: inline-flex; align-items: center; gap: 7px; min-height: 30px; padding: 0 11px; border-radius: 999px; color: var(--dsw-alias-label-secondary, #646a73); background: var(--dsw-alias-bg-module-platform, #f2f3f5); font-size: 12px; white-space: nowrap; }
9238
+ .dxw-dot { width: 8px; height: 8px; border-radius: 50%; background: #aeb3bb; flex: none; }
9239
+ .dxw-dot[data-tone="success"] { background: var(--dxw-success); box-shadow: 0 0 0 3px color-mix(in srgb, var(--dxw-success) 14%, transparent); }
9240
+ .dxw-dot[data-tone="warning"] { background: var(--dxw-warning); }
9241
+ .dxw-dot[data-tone="error"] { background: var(--dxw-error); }
9242
+ .dxw-button { min-height: 34px; border: 1px solid var(--dsw-alias-border-l2, #dfe1e5); border-radius: 8px; padding: 0 13px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; color: var(--dsw-alias-label-primary, #1f2329); background: var(--dsw-alias-bg-layer-1, #fff); font: inherit; font-size: 13px; font-weight: 560; cursor: pointer; text-decoration: none; transition: border-color .15s ease, background .15s ease, transform .15s ease; }
9243
+ .dxw-button:hover:not(:disabled) { border-color: #aeb3bb; background: var(--dsw-alias-interactive-bg-hover, #f7f8fa); }
9244
+ .dxw-button:active:not(:disabled) { transform: translateY(1px); }
9245
+ .dxw-button:focus-visible, .dxw-input:focus-visible { outline: 2px solid color-mix(in srgb, var(--dxw-accent) 70%, white); outline-offset: 2px; }
9246
+ .dxw-button:disabled { cursor: not-allowed; opacity: .55; }
9247
+ .dxw-button[data-kind="primary"] { color: white; border-color: var(--dxw-accent); background: var(--dxw-accent); }
9248
+ .dxw-button[data-kind="primary"]:hover:not(:disabled) { border-color: var(--dxw-accent-dark); background: var(--dxw-accent-dark); }
9249
+ .dxw-button[data-kind="danger"] { color: var(--dxw-error); }
9250
+ .dxw-card { overflow: hidden; border: 1px solid var(--dsw-alias-border-l2, #e5e6eb); border-radius: 14px; background: var(--dsw-alias-bg-layer-1, #fff); box-shadow: 0 1px 2px rgb(31 35 41 / 3%); }
9251
+ .dxw-cardBody { padding: 24px; }
9252
+ .dxw-empty { min-height: 230px; display: grid; grid-template-columns: minmax(0, 1fr) 180px; align-items: center; gap: 30px; }
9253
+ .dxw-empty h3 { font-size: 18px; margin-bottom: 8px; }
9254
+ .dxw-empty p { max-width: 560px; color: var(--dsw-alias-label-secondary, #646a73); line-height: 1.65; }
9255
+ .dxw-empty .dxw-actions { margin-top: 20px; }
9256
+ .dxw-logo { width: 110px; height: 110px; display: grid; place-items: center; justify-self: center; border-radius: 28px; color: white; background: var(--dxw-accent); box-shadow: 0 18px 45px rgb(7 193 96 / 22%); }
9257
+ .dxw-logo svg { width: 62px; height: 62px; }
9258
+ .dxw-qrLayout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 34px; align-items: center; }
9259
+ .dxw-qrColumn { display: flex; flex-direction: column; align-items: center; gap: 12px; }
9260
+ .dxw-qrFrame { position: relative; width: 270px; aspect-ratio: 1; display: grid; place-items: center; overflow: hidden; padding: 10px; border: 1px solid var(--dsw-alias-border-l2, #e5e6eb); border-radius: 16px; background: white; }
9261
+ .dxw-qrFrame img { display: block; width: 100%; height: 100%; object-fit: contain; }
9262
+ .dxw-qrFallback { padding: 24px; text-align: center; color: #646a73; }
9263
+ .dxw-expired { position: absolute; inset: 0; display: grid; place-items: center; padding: 30px; color: white; text-align: center; font-weight: 650; background: rgb(31 35 41 / 76%); backdrop-filter: blur(3px); }
9264
+ .dxw-countdown { width: 270px; color: var(--dsw-alias-label-secondary, #646a73); font-size: 12px; }
9265
+ .dxw-countdown div { display: flex; justify-content: space-between; margin-bottom: 6px; }
9266
+ .dxw-progress { height: 4px; overflow: hidden; border-radius: 99px; background: #eef0f3; }
9267
+ .dxw-progress span { display: block; width: var(--dxw-progress); height: 100%; background: var(--dxw-accent); transition: width .2s linear; }
9268
+ .dxw-qrCopy h3 { margin: 9px 0 8px; font-size: 18px; }
9269
+ .dxw-qrCopy > p { color: var(--dsw-alias-label-secondary, #646a73); line-height: 1.65; }
9270
+ .dxw-steps { margin: 18px 0 22px; padding-left: 22px; color: var(--dsw-alias-label-secondary, #646a73); font-size: 13px; line-height: 1.9; }
9271
+ .dxw-stateLabel { display: inline-flex; align-items: center; gap: 8px; color: var(--dsw-alias-label-secondary, #646a73); font-size: 12px; font-weight: 600; }
9272
+ .dxw-verify { max-width: 560px; margin: 0 auto; padding: 32px; text-align: center; }
9273
+ .dxw-verify h3 { margin: 8px 0; font-size: 19px; }
9274
+ .dxw-verify p { color: var(--dsw-alias-label-secondary, #646a73); line-height: 1.6; }
9275
+ .dxw-codeRow { display: flex; justify-content: center; gap: 10px; margin: 24px 0 10px; }
9276
+ .dxw-input { width: 190px; height: 42px; padding: 0 14px; border: 1px solid var(--dsw-alias-border-l2, #dfe1e5); border-radius: 9px; background: var(--dsw-alias-bg-layer-1, white); color: inherit; font: inherit; font-size: 18px; letter-spacing: .16em; text-align: center; }
9277
+ .dxw-statusNotice, .dxw-error { display: flex; align-items: center; gap: 10px; padding: 13px 15px; border: 1px solid color-mix(in srgb, var(--dxw-error) 28%, transparent); border-radius: 10px; color: var(--dxw-error); background: color-mix(in srgb, var(--dxw-error) 7%, transparent); font-size: 13px; }
9278
+ .dxw-error { align-items: flex-start; flex-direction: column; padding: 22px; }
9279
+ .dxw-error h3 { font-size: 17px; }
9280
+ .dxw-errorCode { font-family: ui-monospace, SFMono-Regular, monospace; font-size: 11px; opacity: .8; }
9281
+ .dxw-listHeading { display: flex; justify-content: space-between; align-items: center; margin: 2px 0 9px; }
9282
+ .dxw-listHeading h3 { margin: 0; font-size: 14px; }
9283
+ .dxw-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
9284
+ .dxw-accountTop { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
9285
+ .dxw-accountIdentity { display: flex; align-items: center; gap: 12px; min-width: 0; }
9286
+ .dxw-avatar { width: 42px; height: 42px; display: grid; place-items: center; flex: none; border-radius: 12px; color: white; background: var(--dxw-accent); }
9287
+ .dxw-accountIdentity h3 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
9288
+ .dxw-accountIdentity p { color: var(--dsw-alias-label-secondary, #646a73); font: 12px ui-monospace, SFMono-Regular, monospace; margin-top: 4px; }
9289
+ .dxw-health { display: inline-flex; align-items: center; gap: 7px; color: var(--dsw-alias-label-secondary, #646a73); font-size: 12px; white-space: nowrap; }
9290
+ .dxw-accountFooter { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding-top: 16px; border-top: 1px solid var(--dsw-alias-border-l1, #eef0f3); }
9291
+ .dxw-accountFooter .dxw-actions { flex: none; flex-wrap: nowrap; gap: 8px; margin-top: 0; }
9292
+ .dxw-accountFooter .dxw-button { flex: none; white-space: nowrap; }
9293
+ .dxw-summary { color: var(--dsw-alias-label-secondary, #646a73); font-size: 12px; }
9294
+ .dxw-confirm { padding: 18px 24px; border-top: 1px solid color-mix(in srgb, var(--dxw-error) 25%, transparent); background: color-mix(in srgb, var(--dxw-error) 5%, transparent); }
9295
+ .dxw-confirm strong { display: block; font-size: 14px; margin-bottom: 6px; }
9296
+ .dxw-confirm p { color: var(--dsw-alias-label-secondary, #646a73); font-size: 12px; line-height: 1.55; }
9297
+ .dxw-confirm .dxw-actions { margin-top: 13px; }
9298
+ .dxw-loading { padding: 36px; color: var(--dsw-alias-label-secondary, #646a73); text-align: center; }
9299
+ .dxw-spinner { width: 24px; height: 24px; margin: 0 auto 12px; border: 3px solid #e6e8eb; border-top-color: var(--dxw-accent); border-radius: 50%; animation: dxw-spin .8s linear infinite; }
9300
+ .dxw-visuallyHidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
9301
+ @keyframes dxw-spin { to { transform: rotate(360deg); } }
9302
+ @media (max-width: 720px) {
9303
+ .dxw-heading, .dxw-accountTop { flex-direction: column; align-items: stretch; }
9304
+ .dxw-empty { grid-template-columns: minmax(0, 1fr); }
9305
+ .dxw-logo { display: none; }
9306
+ .dxw-qrLayout { grid-template-columns: minmax(0, 1fr); justify-items: center; }
9307
+ .dxw-qrCopy { width: 100%; }
9308
+ .dxw-cardBody { padding: 20px; }
9309
+ }
9310
+ @media (prefers-reduced-motion: reduce) {
9311
+ .dxw-page *, .dxw-page *::before, .dxw-page *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
9312
+ }
9313
+ `;
9314
+ function installWeixinStyles() {
9315
+ if (typeof document === "undefined") return () => {
9316
+ };
9317
+ const existing = document.querySelector(`style[data-plugin-css="${WEIXIN_STYLE_ID}"]`);
9318
+ if (existing) return () => {
9319
+ };
9320
+ const style = document.createElement("style");
9321
+ style.dataset.plugin = "@xmanrui/dsh-im";
9322
+ style.dataset.pluginCss = WEIXIN_STYLE_ID;
9323
+ style.textContent = CSS9;
9324
+ document.head.appendChild(style);
9325
+ return () => style.remove();
9326
+ }
9327
+
9323
9328
  // plugin-src/client/channels/whatsapp/api.js
9324
9329
  var WHATSAPP_RPC_CHANNEL = "/whatsapp";
9325
9330
  var WHATSAPP_ENDPOINTS = Object.freeze({
@@ -10328,7 +10333,7 @@ var CSS11 = String.raw`
10328
10333
  .dim-brand:focus-visible { outline: 2px solid color-mix(in srgb, var(--dim-blue) 70%, white); outline-offset: 2px; }
10329
10334
  .dim-brandName { color: var(--dsw-alias-label-primary, #1f2329); font-size: 20px; line-height: 24px; font-weight: 800; letter-spacing: .04em; }
10330
10335
  .dim-title p { margin: 0; color: var(--dsw-alias-label-secondary, #646a73); font-size: 12px; line-height: 18px; font-weight: 500; white-space: nowrap; }
10331
- .dim-versionTooltip { position: absolute; left: 0; bottom: calc(100% + 8px); z-index: 20; width: max-content; max-width: min(220px, 80vw); display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; border: 1px solid var(--dsw-alias-border-l2, #dfe1e5); border-radius: 7px; color: var(--dsw-alias-label-secondary, #646a73); background: var(--dsw-alias-bg-layer-3, #fff); box-shadow: 0 8px 24px rgb(31 35 41 / 14%); font-size: 11px; line-height: 16px; font-weight: 500; white-space: nowrap; opacity: 0; visibility: hidden; transform: translateY(3px); pointer-events: none; transition: opacity .15s ease, transform .15s ease, visibility .15s ease; }
10336
+ .dim-versionTooltip { position: absolute; top: calc(100% + 8px); left: 0; z-index: 20; width: max-content; max-width: min(220px, 80vw); display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; border: 1px solid var(--dsw-alias-border-l2, #dfe1e5); border-radius: 7px; color: var(--dsw-alias-label-secondary, #646a73); background: var(--dsw-alias-bg-layer-3, #fff); box-shadow: 0 8px 24px rgb(31 35 41 / 14%); font-size: 11px; line-height: 16px; font-weight: 500; white-space: nowrap; opacity: 0; visibility: hidden; transform: translateY(-3px); pointer-events: none; transition: opacity .15s ease, transform .15s ease, visibility .15s ease; }
10332
10337
  .dim-versionTooltip strong { color: var(--dsw-alias-label-primary, #1f2329); font: 600 11px/16px ui-monospace, SFMono-Regular, Menlo, monospace; }
10333
10338
  .dim-brand:hover .dim-versionTooltip, .dim-brand:focus .dim-versionTooltip { opacity: 1; visibility: visible; transform: translateY(0); }
10334
10339
  .dim-githubAction { position: relative; display: inline-flex; flex: none; }
@@ -10336,7 +10341,7 @@ var CSS11 = String.raw`
10336
10341
  .dim-githubLink:hover { border-color: #aeb3bb; color: var(--dsw-alias-label-primary, #1f2329); background: var(--dsw-alias-interactive-bg-hover, #f7f8fa); }
10337
10342
  .dim-githubLink:focus-visible { outline: 2px solid color-mix(in srgb, var(--dim-blue) 70%, white); outline-offset: 2px; }
10338
10343
  .dim-githubArrow { font-size: 13px; line-height: 1; }
10339
- .dim-githubTooltip { position: absolute; right: 0; bottom: calc(100% + 8px); z-index: 20; width: max-content; max-width: min(220px, 80vw); padding: 6px 9px; border: 1px solid var(--dsw-alias-border-l2, #dfe1e5); border-radius: 7px; color: var(--dsw-alias-label-primary, #1f2329); background: var(--dsw-alias-bg-layer-3, #fff); box-shadow: 0 8px 24px rgb(31 35 41 / 14%); font-size: 11px; line-height: 16px; font-weight: 500; white-space: nowrap; opacity: 0; visibility: hidden; transform: translateY(3px); pointer-events: none; transition: opacity .15s ease, transform .15s ease, visibility .15s ease; }
10344
+ .dim-githubTooltip { position: absolute; top: calc(100% + 8px); right: 0; z-index: 20; width: max-content; max-width: min(220px, 80vw); padding: 6px 9px; border: 1px solid var(--dsw-alias-border-l2, #dfe1e5); border-radius: 7px; color: var(--dsw-alias-label-primary, #1f2329); background: var(--dsw-alias-bg-layer-3, #fff); box-shadow: 0 8px 24px rgb(31 35 41 / 14%); font-size: 11px; line-height: 16px; font-weight: 500; white-space: nowrap; opacity: 0; visibility: hidden; transform: translateY(-3px); pointer-events: none; transition: opacity .15s ease, transform .15s ease, visibility .15s ease; }
10340
10345
  .dim-githubAction:hover .dim-githubTooltip, .dim-githubAction:focus-within .dim-githubTooltip { opacity: 1; visibility: visible; transform: translateY(0); }
10341
10346
  .dim-layout { display: grid; grid-template-columns: 174px 1px minmax(0, 1fr); gap: 24px; align-items: start; }
10342
10347
  .dim-rail { max-height: 520px; display: grid; align-content: start; gap: 8px; overflow-y: auto; padding: 1px 4px 1px 1px; scrollbar-width: thin; scrollbar-color: var(--dsw-alias-border-l2, #dfe1e5) transparent; }
@@ -10393,7 +10398,7 @@ var CSS11 = String.raw`
10393
10398
  .dim-panel .dim-credentialButton:hover:not(:disabled) { border-color: #4e5969; background: var(--dsw-alias-interactive-bg-hover, #f7f8fa); }
10394
10399
  .dim-panel .dim-credentialButton[aria-pressed="true"] { border-color: #4e5969; background: var(--dsw-alias-bg-module-platform, #f2f3f5); box-shadow: inset 0 0 0 1px rgb(78 89 105 / 8%); }
10395
10400
  .dim-panel .bxf-headingTools .dim-onlineBadge, .dim-panel .dxw-tools .dim-onlineBadge, .dim-panel .ddt-tools .dim-onlineBadge { min-height: 30px; display: inline-flex; align-items: center; justify-self: end; gap: 0; padding: 0 11px; border: 0; border-radius: 999px; color: var(--dsw-alias-label-secondary, #646a73); background: var(--dsw-alias-bg-module-platform, #f2f3f5); font: inherit; font-size: 12px; font-weight: 400; line-height: normal; white-space: nowrap; }
10396
- .dim-panel .dim-channelPage { width: 100%; max-width: none; display: flex; flex-direction: column; gap: 12px; padding: 0 0 24px; color: var(--dsw-alias-label-primary, #1f2329); box-sizing: border-box; }
10401
+ .dim-panel .dim-channelPage { min-width: 0; width: 100%; max-width: none; display: flex; flex-direction: column; gap: 12px; padding: 0 0 24px; color: var(--dsw-alias-label-primary, #1f2329); box-sizing: border-box; }
10397
10402
  .dim-panel .dim-surfaceCard { position: relative; overflow: hidden; border: 1px solid var(--dsw-alias-border-l2, #e5e6eb); border-radius: 14px; background: var(--dsw-alias-bg-layer-1, #fff); box-shadow: 0 1px 2px rgb(31 35 41 / 3%); }
10398
10403
  .dim-panel .dim-surfaceCard::before { display: none; }
10399
10404
  .dim-panel .dim-surfaceBody { padding: 24px; }
@@ -10408,7 +10413,7 @@ var CSS11 = String.raw`
10408
10413
  .dim-panel .dim-credentialError, .dim-panel .dim-credentialActions { grid-column: 1 / -1; }
10409
10414
  .dim-panel .dim-credentialError { margin: 0; color: var(--dsw-alias-state-error-primary, #d54941); font-size: 12px; line-height: 1.5; }
10410
10415
  .dim-panel .dim-credentialActions { margin-top: 0; }
10411
- .dim-panel .dim-listSection { display: flex; flex-direction: column; gap: 0; }
10416
+ .dim-panel .dim-listSection { min-width: 0; width: 100%; max-width: 100%; display: flex; flex-direction: column; gap: 0; }
10412
10417
  .dim-panel .dim-listHeading { min-height: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 6px; padding: 0; }
10413
10418
  .dim-panel .dim-listHeading h3 { margin: 0; color: var(--dsw-alias-label-primary, #1f2329); font-size: 14px; line-height: normal; font-weight: 650; }
10414
10419
  .dim-panel .dim-listTitle { min-width: 0; display: inline-flex; align-items: center; gap: 6px; }
@@ -10419,7 +10424,8 @@ var CSS11 = String.raw`
10419
10424
  .dim-panel .dim-channelTooltip { position: absolute; top: calc(100% + 7px); left: 0; z-index: 30; width: max-content; max-width: min(280px, calc(100vw - 48px)); display: flex; align-items: baseline; gap: 5px; padding: 8px 10px; border: 1px solid var(--dsw-alias-border-l2, #dfe1e5); border-radius: 8px; color: var(--dsw-alias-label-secondary, #646a73); background: var(--dsw-alias-bg-layer-3, #fff); box-shadow: 0 10px 28px rgb(31 35 41 / 16%); font-size: 11px; line-height: 16px; font-weight: 400; white-space: normal; opacity: 0; visibility: hidden; transform: translateY(-3px); pointer-events: none; transition: opacity .15s ease, transform .15s ease, visibility .15s ease; }
10420
10425
  .dim-panel .dim-channelTooltip strong { color: var(--dsw-alias-label-primary, #1f2329); font-weight: 600; white-space: nowrap; }
10421
10426
  .dim-panel .dim-channelHelp:hover .dim-channelTooltip, .dim-panel .dim-channelHelp:focus-within .dim-channelTooltip { opacity: 1; visibility: visible; transform: translateY(0); }
10422
- .dim-panel .dim-botList { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
10427
+ .dim-panel .dim-botList { min-width: 0; width: 100%; max-width: 100%; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin: 0; padding: 0; list-style: none; }
10428
+ .dim-panel .dim-botList > li { min-width: 0; max-width: 100%; }
10423
10429
  .dim-panel .dim-loadingView { padding: 38px; color: var(--dsw-alias-label-secondary, #646a73); text-align: center; }
10424
10430
  .dim-panel .dim-loadingView h3 { margin: 0 0 7px; color: var(--dsw-alias-label-primary, #1f2329); font-size: 17px; line-height: normal; font-weight: 650; }
10425
10431
  .dim-panel .dim-loadingView p { margin: 0; line-height: 1.6; }
@@ -10473,7 +10479,7 @@ var CSS11 = String.raw`
10473
10479
  .dim-panel .dim-workspaceHeader > span { grid-column: 1; grid-row: 1; white-space: nowrap; }
10474
10480
  .dim-panel .dim-workspaceEdit { grid-column: 2; grid-row: 1; padding: 0; border: 0; color: #1677ff; background: transparent; font: inherit; font-weight: 560; white-space: nowrap; cursor: pointer; }
10475
10481
  .dim-panel .dim-workspaceEdit:disabled { cursor: not-allowed; opacity: .55; }
10476
- .dim-panel .dim-workspacePath { min-width: 0; max-width: 100%; grid-column: 1 / -1; grid-row: 2; display: block; overflow-x: auto; overflow-y: hidden; color: var(--dsw-alias-label-primary, #1f2329); font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: nowrap; }
10482
+ .dim-panel .dim-workspacePath { min-width: 0; max-width: 100%; grid-column: 1 / -1; grid-row: 2; display: block; overflow: hidden; color: var(--dsw-alias-label-primary, #1f2329); font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; white-space: normal; }
10477
10483
  .dim-panel .dim-preset { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) max-content; align-items: center; column-gap: 10px; row-gap: 4px; margin-top: 6px; padding: 6px 10px; border: 1px solid var(--dsw-alias-border-l1, #eef0f3); border-radius: 9px; background: var(--dsw-alias-bg-module-platform, #f7f8fa); }
10478
10484
  .dim-panel .dim-presetHeader { position: relative; min-width: 0; grid-column: 1 / -1; grid-row: 1; display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--dsw-alias-label-secondary, #646a73); font-size: 12px; line-height: normal; }
10479
10485
  .dim-panel .dim-presetTitle { min-width: 0; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
@@ -10528,7 +10534,7 @@ var CSS11 = String.raw`
10528
10534
  .dim-directoryPickerActions .dim-directoryPickerPrimary { border-color: var(--dim-blue); color: #fff; background: var(--dim-blue); }
10529
10535
  .dim-directoryPickerActions button:hover:not(:disabled) { filter: brightness(.97); }
10530
10536
  .dim-directoryPickerActions button:disabled { cursor: not-allowed; opacity: .52; }
10531
- .dim-panel .dim-cardSummary { min-width: 0; color: var(--dsw-alias-label-secondary, #646a73); font: inherit; font-size: 12px; font-weight: 400; line-height: normal; }
10537
+ .dim-panel .dim-cardSummary { min-width: 0; color: var(--dsw-alias-label-secondary, #646a73); font: inherit; font-size: 12px; font-weight: 400; line-height: normal; overflow-wrap: anywhere; white-space: normal; }
10532
10538
  .dim-panel .dim-cardFooterLayout { min-width: 0; width: 100%; display: flex; flex-direction: column; align-items: stretch; gap: 9px; }
10533
10539
  .dim-panel .dim-cardFooterLayout > .dim-cardActions { align-self: stretch; }
10534
10540
  .dim-panel .dim-cardFeedback { width: 100%; padding: 8px 10px; border-radius: 8px; color: var(--dsw-alias-label-secondary, #646a73); background: var(--dsw-alias-bg-module-platform, #f7f8fa); font: inherit; font-size: 12px; font-weight: 400; line-height: 18px; overflow-wrap: anywhere; white-space: normal; }
@@ -10536,17 +10542,17 @@ var CSS11 = String.raw`
10536
10542
  .dim-panel .dim-cardActions .dim-cardAction { flex: none; min-height: 32px; padding: 0 11px; border: 1px solid var(--dsw-alias-border-l2, #dfe1e5); border-radius: 8px; color: var(--dsw-alias-label-primary, #1f2329); background: var(--dsw-alias-bg-layer-1, #fff); font: inherit; font-size: 13px; font-weight: 560; line-height: normal; white-space: nowrap; }
10537
10543
  .dim-panel .dim-cardActions .dim-cardAction:hover:not(:disabled) { border-color: #aeb3bb; background: var(--dsw-alias-interactive-bg-hover, #f7f8fa); }
10538
10544
  .dim-panel .dim-cardActions .dim-cardAction[data-kind="danger"] { color: var(--dsw-alias-state-error-primary, #d54941); }
10539
- .dim-panel .dim-botCard { position: relative; overflow: hidden; border: 1px solid var(--dsw-alias-border-l2, #e5e6eb); border-radius: 14px; background: var(--dsw-alias-bg-layer-1, #fff); box-shadow: 0 1px 2px rgb(31 35 41 / 3%); }
10545
+ .dim-panel .dim-botCard { position: relative; min-width: 0; width: 100%; max-width: 100%; overflow: hidden; border: 1px solid var(--dsw-alias-border-l2, #e5e6eb); border-radius: 14px; background: var(--dsw-alias-bg-layer-1, #fff); box-shadow: 0 1px 2px rgb(31 35 41 / 3%); }
10540
10546
  .dim-panel .dim-botCard::before { display: none; }
10541
- .dim-panel .dim-botCardBody { position: relative; padding: 12px; }
10542
- .dim-panel .dim-botCardTop { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
10543
- .dim-panel .dim-botIdentity { min-width: 0; display: flex; align-items: center; gap: 10px; }
10547
+ .dim-panel .dim-botCardBody { position: relative; min-width: 0; width: 100%; max-width: 100%; padding: 12px; }
10548
+ .dim-panel .dim-botCardTop { min-width: 0; max-width: 100%; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
10549
+ .dim-panel .dim-botIdentity { min-width: 0; flex: 1 1 0; display: flex; align-items: center; gap: 10px; }
10544
10550
  .dim-panel .dim-botAvatar { flex: none; width: 38px; height: 38px; display: grid; place-items: center; overflow: hidden; border-radius: 11px; box-shadow: none; }
10545
10551
  .dim-panel .dim-botAvatar svg { width: 27px; height: 27px; }
10546
10552
  .dim-panel .dim-botName { min-width: 0; }
10547
10553
  .dim-panel .dim-botName h3 { overflow: hidden; margin: 0; color: var(--dsw-alias-label-primary, #1f2329); font-size: 15px; font-weight: 650; line-height: normal; text-overflow: ellipsis; white-space: nowrap; }
10548
10554
  .dim-panel .dim-botName p { overflow: hidden; margin: 4px 0 0; color: var(--dsw-alias-label-secondary, #646a73); font: 12px ui-monospace, SFMono-Regular, monospace; line-height: normal; text-overflow: ellipsis; white-space: nowrap; }
10549
- .dim-panel .dim-botHealthGroup { flex: none; display: grid; justify-items: end; gap: 5px; }
10555
+ .dim-panel .dim-botHealthGroup { min-width: 0; max-width: 100%; flex: none; display: grid; justify-items: end; gap: 5px; }
10550
10556
  .dim-panel .dim-botCard .dim-botHealth { flex: none; min-height: 0; display: inline-flex; align-items: center; gap: 7px; padding: 0; border: 0; border-radius: 0; color: var(--dsw-alias-label-secondary, #646a73); background: transparent; font: inherit; font-size: 12px; font-weight: 400; line-height: normal; white-space: nowrap; }
10551
10557
  .dim-panel .dim-lastChecked { display: inline-flex; align-items: baseline; gap: 4px; color: var(--dsw-alias-label-tertiary, #8f959e); font: inherit; font-size: 11px; font-weight: 400; line-height: normal; white-space: nowrap; }
10552
10558
  .dim-panel .dim-botCard .dim-healthDot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: #aeb3bb; box-shadow: none; }
@@ -10558,6 +10564,8 @@ var CSS11 = String.raw`
10558
10564
  .dim-panel .ddt-qrFrame, .dim-panel .ddt-countdown { width: min(270px, 100%); }
10559
10565
  @container (max-width: 680px) {
10560
10566
  .dim-panel .bxf-headingTools, .dim-panel .dxw-tools, .dim-panel .ddt-tools { gap: 6px; }
10567
+ .dim-panel .dim-botCardTop { flex-direction: column; align-items: stretch; }
10568
+ .dim-panel .dim-botHealthGroup { justify-items: start; }
10561
10569
  .dim-panel .dim-bindActions { gap: 6px; }
10562
10570
  .dim-panel .bxf-headingTools .dim-scanButton, .dim-panel .dxw-tools .dim-scanButton, .dim-panel .ddt-tools .dim-scanButton, .dim-panel .dim-credentialButton { gap: 5px; padding-inline: 8px; font-size: 12px; }
10563
10571
  .dim-panel .dim-actionIcon { width: 13px; height: 13px; flex-basis: 13px; }
@@ -10917,10 +10925,10 @@ function apply(ctx) {
10917
10925
  listDirectory: (path, signal) => ctx.workspaces.listDirectory(path, signal),
10918
10926
  pickDirectory: () => ctx.workspaces.pickDirectory()
10919
10927
  });
10920
- ctx.slots.inject("settings.plugins.tab", () => ctx.slots.register({
10921
- name: "settings.plugins.tab",
10922
- id: "im",
10923
- order: 20,
10928
+ ctx.slots.inject("settings.section", () => ctx.slots.register({
10929
+ name: "settings.section",
10930
+ id: "xmanrui-dsh-im",
10931
+ order: 21,
10924
10932
  label: () => t("IM\u673A\u5668\u4EBA"),
10925
10933
  locale: IM_LOCALE_NAMESPACE,
10926
10934
  inject: () => ({