dsh-codearts 1.1.1 → 1.1.4

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.
@@ -33,70 +33,70 @@ if (typeof document !== "undefined" && document.querySelector("style[data-plugin
33
33
  document.head.appendChild(tag);
34
34
  }
35
35
  var CodeArtsPluginCard_module_css_default = {
36
- "accountRow": "xoziZG_accountRow",
37
- "modelTrack": "xoziZG_modelTrack",
38
- "accountNameRow": "xoziZG_accountNameRow",
39
- "choices": "xoziZG_choices",
40
- "modelFill": "xoziZG_modelFill",
41
- "claimAllRow": "xoziZG_claimAllRow",
36
+ "card": "xoziZG_card",
37
+ "statusLine": "xoziZG_statusLine",
38
+ "tabs": "xoziZG_tabs",
39
+ "actions": "xoziZG_actions",
40
+ "choiceRow": "xoziZG_choiceRow",
41
+ "modelShare": "xoziZG_modelShare",
42
+ "accountRowActions": "xoziZG_accountRowActions",
43
+ "sectionHead": "xoziZG_sectionHead",
44
+ "creditFooter": "xoziZG_creditFooter",
45
+ "danger": "xoziZG_danger",
46
+ "modelRequests": "xoziZG_modelRequests",
42
47
  "manual": "xoziZG_manual",
43
- "creditBlock": "xoziZG_creditBlock",
44
- "header": "xoziZG_header",
45
- "meta": "xoziZG_meta",
46
- "balanceMeta": "xoziZG_balanceMeta",
47
- "accountEntry": "xoziZG_accountEntry",
48
- "barFill": "xoziZG_barFill",
49
- "hint": "xoziZG_hint",
50
- "modelTokens": "xoziZG_modelTokens",
51
48
  "fieldLabel": "xoziZG_fieldLabel",
52
- "desc": "xoziZG_desc",
49
+ "count": "xoziZG_count",
50
+ "modelName": "xoziZG_modelName",
51
+ "expiryLabel": "xoziZG_expiryLabel",
52
+ "name": "xoziZG_name",
53
+ "barFill": "xoziZG_barFill",
54
+ "balanceUnit": "xoziZG_balanceUnit",
53
55
  "section": "xoziZG_section",
54
- "check": "xoziZG_check",
55
- "avatar": "xoziZG_avatar",
56
- "creditRows": "xoziZG_creditRows",
57
- "creditLink": "xoziZG_creditLink",
58
- "tabPanel": "xoziZG_tabPanel",
59
- "accountCard": "xoziZG_accountCard",
60
- "statusLine": "xoziZG_statusLine",
56
+ "usageBar": "xoziZG_usageBar",
57
+ "accountHint": "xoziZG_accountHint",
58
+ "modelTrack": "xoziZG_modelTrack",
59
+ "accountInfo": "xoziZG_accountInfo",
60
+ "balanceRow": "xoziZG_balanceRow",
61
+ "modelTokens": "xoziZG_modelTokens",
62
+ "accountNameRow": "xoziZG_accountNameRow",
63
+ "claimAllRow": "xoziZG_claimAllRow",
61
64
  "modelRow": "xoziZG_modelRow",
62
- "modelShare": "xoziZG_modelShare",
63
- "sectionHead": "xoziZG_sectionHead",
64
- "updated": "xoziZG_updated",
65
- "bar": "xoziZG_bar",
66
- "card": "xoziZG_card",
67
- "field": "xoziZG_field",
65
+ "manualSummary": "xoziZG_manualSummary",
68
66
  "accountName": "xoziZG_accountName",
69
- "balanceRow": "xoziZG_balanceRow",
67
+ "avatar": "xoziZG_avatar",
68
+ "choices": "xoziZG_choices",
69
+ "creditHint": "xoziZG_creditHint",
70
+ "creditRow": "xoziZG_creditRow",
71
+ "field": "xoziZG_field",
72
+ "usageFill": "xoziZG_usageFill",
73
+ "updated": "xoziZG_updated",
70
74
  "expiryRow": "xoziZG_expiryRow",
71
- "actions": "xoziZG_actions",
75
+ "accountRow": "xoziZG_accountRow",
76
+ "error": "xoziZG_error",
77
+ "bar": "xoziZG_bar",
78
+ "header": "xoziZG_header",
79
+ "tabPanel": "xoziZG_tabPanel",
80
+ "meta": "xoziZG_meta",
81
+ "desc": "xoziZG_desc",
72
82
  "balance": "xoziZG_balance",
73
- "modelName": "xoziZG_modelName",
74
- "modelRequests": "xoziZG_modelRequests",
83
+ "modelFill": "xoziZG_modelFill",
84
+ "creditRows": "xoziZG_creditRows",
75
85
  "modelChart": "xoziZG_modelChart",
76
86
  "headText": "xoziZG_headText",
77
- "accountRowActions": "xoziZG_accountRowActions",
78
- "usageBar": "xoziZG_usageBar",
79
- "creditHint": "xoziZG_creditHint",
80
- "count": "xoziZG_count",
81
- "area": "xoziZG_area",
82
- "accountHint": "xoziZG_accountHint",
83
- "expiryLabel": "xoziZG_expiryLabel",
84
- "accountInfo": "xoziZG_accountInfo",
85
- "error": "xoziZG_error",
86
87
  "accountToolbar": "xoziZG_accountToolbar",
88
+ "creditBlock": "xoziZG_creditBlock",
89
+ "sectionLabel": "xoziZG_sectionLabel",
87
90
  "manualForm": "xoziZG_manualForm",
88
- "body": "xoziZG_body",
89
- "creditFooter": "xoziZG_creditFooter",
90
- "balanceUnit": "xoziZG_balanceUnit",
91
- "name": "xoziZG_name",
92
- "tabs": "xoziZG_tabs",
93
- "usageFill": "xoziZG_usageFill",
94
- "choiceRow": "xoziZG_choiceRow",
95
- "creditRow": "xoziZG_creditRow",
91
+ "area": "xoziZG_area",
92
+ "balanceMeta": "xoziZG_balanceMeta",
93
+ "accountCard": "xoziZG_accountCard",
94
+ "check": "xoziZG_check",
95
+ "creditLink": "xoziZG_creditLink",
96
96
  "link": "xoziZG_link",
97
- "sectionLabel": "xoziZG_sectionLabel",
98
- "danger": "xoziZG_danger",
99
- "manualSummary": "xoziZG_manualSummary"
97
+ "accountEntry": "xoziZG_accountEntry",
98
+ "body": "xoziZG_body",
99
+ "hint": "xoziZG_hint"
100
100
  };
101
101
  //#endregion
102
102
  //#region src/client/CodeArtsPluginCard.tsx
@@ -879,311 +879,318 @@ function CodeArtsPluginCard({ t }) {
879
879
  })]
880
880
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
881
881
  className: CodeArtsPluginCard_module_css_default.body,
882
- children: [signedIn ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
883
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.SegmentedTabs, {
884
- className: CodeArtsPluginCard_module_css_default.tabs,
885
- items: tabs,
886
- value: activeTab,
887
- onChange: setTab,
888
- label: t("tabsLabel")
882
+ children: [
883
+ status?.piAiError !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
884
+ className: CodeArtsPluginCard_module_css_default.error,
885
+ children: status.piAiError
889
886
  }),
890
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TabPanel, {
891
- id: panelId("accounts"),
892
- labelledBy: tabId("accounts"),
893
- active: activeTab === "accounts",
894
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
895
- className: CodeArtsPluginCard_module_css_default.section,
896
- children: [
897
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
898
- className: CodeArtsPluginCard_module_css_default.sectionHead,
899
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
900
- className: CodeArtsPluginCard_module_css_default.sectionLabel,
901
- children: t("accountsTitle")
902
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
903
- className: CodeArtsPluginCard_module_css_default.count,
904
- children: accounts.length
905
- })]
906
- }),
907
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
908
- className: CodeArtsPluginCard_module_css_default.accountToolbar,
909
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
910
- variant: "outline",
911
- size: "sm",
912
- "aria-expanded": manualOpen,
913
- disabled: busy,
914
- onClick: () => setManualOpen((open) => !open),
915
- children: t("pasteTokenAdd")
916
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
917
- variant: "primary",
918
- size: "sm",
919
- disabled: busy || loginPending,
920
- onClick: () => void startOAuthLogin(),
921
- children: loginPending ? t("signingIn") : t("addAccount")
922
- })]
923
- }),
924
- loginUrl !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
925
- className: CodeArtsPluginCard_module_css_default.hint,
926
- children: [
927
- t("openManually"),
928
- " ",
929
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
930
- className: CodeArtsPluginCard_module_css_default.link,
931
- href: loginUrl,
932
- target: "_blank",
933
- rel: "noreferrer",
934
- children: loginUrl
935
- })
936
- ]
937
- }),
938
- manualOpen && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
939
- className: CodeArtsPluginCard_module_css_default.manualForm,
940
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ManualTokenForm, {
941
- t,
942
- token,
943
- label,
944
- busy,
945
- onToken: setToken,
946
- onLabel: setLabel,
947
- onSubmit: (e) => void saveToken(e)
948
- })
949
- }),
950
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
951
- className: CodeArtsPluginCard_module_css_default.accountCard,
952
- children: [
953
- accounts.map((account) => {
954
- const accountLine = accountMeta(account);
955
- const credit = creditFor(account.id);
956
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
957
- className: CodeArtsPluginCard_module_css_default.accountEntry,
958
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
959
- className: CodeArtsPluginCard_module_css_default.accountRow,
960
- children: [
961
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
962
- className: CodeArtsPluginCard_module_css_default.avatar,
963
- "aria-hidden": "true",
964
- children: Array.from(accountName(account))[0] ?? "*"
965
- }),
966
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
967
- className: CodeArtsPluginCard_module_css_default.accountInfo,
968
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
969
- className: CodeArtsPluginCard_module_css_default.accountNameRow,
970
- children: [
971
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
972
- className: CodeArtsPluginCard_module_css_default.accountName,
973
- children: accountName(account)
974
- }),
975
- account.stale && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tag, { children: t("accountNeedsSignIn") }),
976
- !account.signable && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tag, { children: t("accountNoKey") })
977
- ]
978
- }), accountLine !== "" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
979
- className: CodeArtsPluginCard_module_css_default.meta,
980
- children: accountLine
981
- })]
982
- }),
983
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
984
- className: CodeArtsPluginCard_module_css_default.accountRowActions,
985
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
986
- variant: "outline",
987
- size: "sm",
988
- className: CodeArtsPluginCard_module_css_default.danger,
989
- disabled: busy,
990
- onClick: () => void removeAccount(account.id),
991
- children: t("accountRemove")
992
- })
993
- })
994
- ]
995
- }), credit !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CreditBlock, {
996
- credits: credit.credits,
997
- error: credit.creditsError,
998
- t,
999
- onClaim: () => void claim(account.id),
1000
- claiming: claimingId === account.id || claimingId === CLAIM_ALL,
1001
- claimResult: claimResults[account.id] ?? null,
1002
- justClaimed: claimedIds[account.id] === true
1003
- })]
1004
- }, account.id);
1005
- }),
1006
- accounts.length > 1 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1007
- className: CodeArtsPluginCard_module_css_default.claimAllRow,
1008
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
1009
- variant: "outline",
1010
- size: "sm",
1011
- disabled: claimingId !== null,
1012
- onClick: () => void claim(),
1013
- children: claimingId === CLAIM_ALL ? t("claimPending") : t("claimAll")
1014
- })
1015
- }),
1016
- accounts.length > 1 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
1017
- className: CodeArtsPluginCard_module_css_default.accountHint,
1018
- children: t("accountsRotateHint")
1019
- })
1020
- ]
1021
- }),
1022
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1023
- className: CodeArtsPluginCard_module_css_default.actions,
1024
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
1025
- variant: "outline",
1026
- size: "sm",
1027
- className: CodeArtsPluginCard_module_css_default.danger,
1028
- disabled: busy,
1029
- onClick: () => void clearToken(),
1030
- children: t("clearToken")
1031
- })
1032
- })
1033
- ]
1034
- })
1035
- }),
1036
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TabPanel, {
1037
- id: panelId("models"),
1038
- labelledBy: tabId("models"),
1039
- active: activeTab === "models",
1040
- children: selection ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1041
- className: CodeArtsPluginCard_module_css_default.section,
1042
- children: [
1043
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1044
- className: CodeArtsPluginCard_module_css_default.sectionHead,
1045
- children: [
1046
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
887
+ signedIn ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
888
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.SegmentedTabs, {
889
+ className: CodeArtsPluginCard_module_css_default.tabs,
890
+ items: tabs,
891
+ value: activeTab,
892
+ onChange: setTab,
893
+ label: t("tabsLabel")
894
+ }),
895
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TabPanel, {
896
+ id: panelId("accounts"),
897
+ labelledBy: tabId("accounts"),
898
+ active: activeTab === "accounts",
899
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
900
+ className: CodeArtsPluginCard_module_css_default.section,
901
+ children: [
902
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
903
+ className: CodeArtsPluginCard_module_css_default.sectionHead,
904
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1047
905
  className: CodeArtsPluginCard_module_css_default.sectionLabel,
1048
- children: t("modelsTitle")
1049
- }),
1050
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
906
+ children: t("accountsTitle")
907
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1051
908
  className: CodeArtsPluginCard_module_css_default.count,
1052
- children: t("selectedCount", {
1053
- n: draft.length,
1054
- total: all
1055
- })
1056
- }),
1057
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
909
+ children: accounts.length
910
+ })]
911
+ }),
912
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
913
+ className: CodeArtsPluginCard_module_css_default.accountToolbar,
914
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
1058
915
  variant: "outline",
1059
916
  size: "sm",
1060
- disabled: refreshing,
1061
- onClick: () => void refreshCatalog(),
1062
- children: refreshing ? t("refreshing") : t("refreshModels")
917
+ "aria-expanded": manualOpen,
918
+ disabled: busy,
919
+ onClick: () => setManualOpen((open) => !open),
920
+ children: t("pasteTokenAdd")
921
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
922
+ variant: "primary",
923
+ size: "sm",
924
+ disabled: busy || loginPending,
925
+ onClick: () => void startOAuthLogin(),
926
+ children: loginPending ? t("signingIn") : t("addAccount")
927
+ })]
928
+ }),
929
+ loginUrl !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
930
+ className: CodeArtsPluginCard_module_css_default.hint,
931
+ children: [
932
+ t("openManually"),
933
+ " ",
934
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
935
+ className: CodeArtsPluginCard_module_css_default.link,
936
+ href: loginUrl,
937
+ target: "_blank",
938
+ rel: "noreferrer",
939
+ children: loginUrl
940
+ })
941
+ ]
942
+ }),
943
+ manualOpen && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
944
+ className: CodeArtsPluginCard_module_css_default.manualForm,
945
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ManualTokenForm, {
946
+ t,
947
+ token,
948
+ label,
949
+ busy,
950
+ onToken: setToken,
951
+ onLabel: setLabel,
952
+ onSubmit: (e) => void saveToken(e)
1063
953
  })
1064
- ]
1065
- }),
1066
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
1067
- className: CodeArtsPluginCard_module_css_default.hint,
1068
- children: selection.restricted ? t("optionalModelsHint") : t("optionalModelsAllHint")
1069
- }),
1070
- blockedCount > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
1071
- className: CodeArtsPluginCard_module_css_default.hint,
1072
- children: t("benefitBlockedHint", { n: blockedCount })
1073
- }),
1074
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1075
- className: CodeArtsPluginCard_module_css_default.choices,
1076
- children: selection.choices.map((choice) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1077
- className: CodeArtsPluginCard_module_css_default.choiceRow,
954
+ }),
955
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
956
+ className: CodeArtsPluginCard_module_css_default.accountCard,
1078
957
  children: [
1079
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Checkbox, {
1080
- className: CodeArtsPluginCard_module_css_default.check,
1081
- checked: draft.includes(choice.id),
1082
- disabled: !selection.writable || savingModels,
1083
- onChange: (on) => setModel(choice.id, on),
1084
- label: modelName(choice)
958
+ accounts.map((account) => {
959
+ const accountLine = accountMeta(account);
960
+ const credit = creditFor(account.id);
961
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
962
+ className: CodeArtsPluginCard_module_css_default.accountEntry,
963
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
964
+ className: CodeArtsPluginCard_module_css_default.accountRow,
965
+ children: [
966
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
967
+ className: CodeArtsPluginCard_module_css_default.avatar,
968
+ "aria-hidden": "true",
969
+ children: Array.from(accountName(account))[0] ?? "*"
970
+ }),
971
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
972
+ className: CodeArtsPluginCard_module_css_default.accountInfo,
973
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
974
+ className: CodeArtsPluginCard_module_css_default.accountNameRow,
975
+ children: [
976
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
977
+ className: CodeArtsPluginCard_module_css_default.accountName,
978
+ children: accountName(account)
979
+ }),
980
+ account.stale && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tag, { children: t("accountNeedsSignIn") }),
981
+ !account.signable && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tag, { children: t("accountNoKey") })
982
+ ]
983
+ }), accountLine !== "" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
984
+ className: CodeArtsPluginCard_module_css_default.meta,
985
+ children: accountLine
986
+ })]
987
+ }),
988
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
989
+ className: CodeArtsPluginCard_module_css_default.accountRowActions,
990
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
991
+ variant: "outline",
992
+ size: "sm",
993
+ className: CodeArtsPluginCard_module_css_default.danger,
994
+ disabled: busy,
995
+ onClick: () => void removeAccount(account.id),
996
+ children: t("accountRemove")
997
+ })
998
+ })
999
+ ]
1000
+ }), credit !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CreditBlock, {
1001
+ credits: credit.credits,
1002
+ error: credit.creditsError,
1003
+ t,
1004
+ onClaim: () => void claim(account.id),
1005
+ claiming: claimingId === account.id || claimingId === CLAIM_ALL,
1006
+ claimResult: claimResults[account.id] ?? null,
1007
+ justClaimed: claimedIds[account.id] === true
1008
+ })]
1009
+ }, account.id);
1085
1010
  }),
1086
- choice.benefit === true && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tag, {
1087
- tone: choice.blocked === true ? "warning" : "success",
1088
- children: choice.blocked === true ? t("benefitBlocked") : t("benefit")
1011
+ accounts.length > 1 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1012
+ className: CodeArtsPluginCard_module_css_default.claimAllRow,
1013
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
1014
+ variant: "outline",
1015
+ size: "sm",
1016
+ disabled: claimingId !== null,
1017
+ onClick: () => void claim(),
1018
+ children: claimingId === CLAIM_ALL ? t("claimPending") : t("claimAll")
1019
+ })
1089
1020
  }),
1090
- choice.ratio !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tag, {
1091
- tone: "quiet",
1092
- children: choice.ratio
1021
+ accounts.length > 1 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
1022
+ className: CodeArtsPluginCard_module_css_default.accountHint,
1023
+ children: t("accountsRotateHint")
1093
1024
  })
1094
1025
  ]
1095
- }, choice.id))
1096
- }),
1097
- selection.writable && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1098
- className: CodeArtsPluginCard_module_css_default.actions,
1099
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
1100
- variant: "outline",
1101
- size: "sm",
1102
- disabled: draft.length === all,
1103
- onClick: () => {
1104
- setSavedModels(false);
1105
- setModelError(null);
1106
- setDraft(selection.choices.map((c) => c.id));
1107
- },
1108
- children: t("selectAll")
1109
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
1110
- variant: "primary",
1111
- size: "sm",
1112
- disabled: !dirty || savingModels,
1113
- onClick: () => void saveModels(),
1114
- children: savingModels ? t("saving") : savedModels && !dirty ? t("saved") : t("saveModels")
1115
- })]
1116
- }),
1117
- modelError !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
1118
- className: CodeArtsPluginCard_module_css_default.error,
1119
- children: modelError
1120
- })
1121
- ]
1122
- }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
1123
- className: CodeArtsPluginCard_module_css_default.hint,
1124
- children: t("modelsLoading")
1125
- })
1126
- }),
1127
- status?.usage !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TabPanel, {
1128
- id: panelId("usage"),
1129
- labelledBy: tabId("usage"),
1130
- active: activeTab === "usage",
1131
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(UsageSection, {
1132
- usage: status.usage,
1133
- accounts,
1134
- t
1135
- })
1136
- })
1137
- ] }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1138
- className: CodeArtsPluginCard_module_css_default.section,
1139
- children: [
1140
- expired && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
1141
- className: CodeArtsPluginCard_module_css_default.hint,
1142
- children: t("expiredHint")
1143
- }),
1144
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1145
- className: CodeArtsPluginCard_module_css_default.actions,
1146
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
1147
- variant: "primary",
1148
- disabled: busy || loginPending,
1149
- onClick: () => void startOAuthLogin(),
1150
- children: loginPending ? t("signingIn") : t("signIn")
1026
+ }),
1027
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1028
+ className: CodeArtsPluginCard_module_css_default.actions,
1029
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
1030
+ variant: "outline",
1031
+ size: "sm",
1032
+ className: CodeArtsPluginCard_module_css_default.danger,
1033
+ disabled: busy,
1034
+ onClick: () => void clearToken(),
1035
+ children: t("clearToken")
1036
+ })
1037
+ })
1038
+ ]
1151
1039
  })
1152
1040
  }),
1153
- loginUrl !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
1154
- className: CodeArtsPluginCard_module_css_default.hint,
1155
- children: [
1156
- t("openManually"),
1157
- " ",
1158
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
1159
- className: CodeArtsPluginCard_module_css_default.link,
1160
- href: loginUrl,
1161
- target: "_blank",
1162
- rel: "noreferrer",
1163
- children: loginUrl
1164
- })
1165
- ]
1041
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TabPanel, {
1042
+ id: panelId("models"),
1043
+ labelledBy: tabId("models"),
1044
+ active: activeTab === "models",
1045
+ children: selection ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1046
+ className: CodeArtsPluginCard_module_css_default.section,
1047
+ children: [
1048
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1049
+ className: CodeArtsPluginCard_module_css_default.sectionHead,
1050
+ children: [
1051
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1052
+ className: CodeArtsPluginCard_module_css_default.sectionLabel,
1053
+ children: t("modelsTitle")
1054
+ }),
1055
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1056
+ className: CodeArtsPluginCard_module_css_default.count,
1057
+ children: t("selectedCount", {
1058
+ n: draft.length,
1059
+ total: all
1060
+ })
1061
+ }),
1062
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
1063
+ variant: "outline",
1064
+ size: "sm",
1065
+ disabled: refreshing,
1066
+ onClick: () => void refreshCatalog(),
1067
+ children: refreshing ? t("refreshing") : t("refreshModels")
1068
+ })
1069
+ ]
1070
+ }),
1071
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
1072
+ className: CodeArtsPluginCard_module_css_default.hint,
1073
+ children: selection.restricted ? t("optionalModelsHint") : t("optionalModelsAllHint")
1074
+ }),
1075
+ blockedCount > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
1076
+ className: CodeArtsPluginCard_module_css_default.hint,
1077
+ children: t("benefitBlockedHint", { n: blockedCount })
1078
+ }),
1079
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1080
+ className: CodeArtsPluginCard_module_css_default.choices,
1081
+ children: selection.choices.map((choice) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1082
+ className: CodeArtsPluginCard_module_css_default.choiceRow,
1083
+ children: [
1084
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Checkbox, {
1085
+ className: CodeArtsPluginCard_module_css_default.check,
1086
+ checked: draft.includes(choice.id),
1087
+ disabled: !selection.writable || savingModels,
1088
+ onChange: (on) => setModel(choice.id, on),
1089
+ label: modelName(choice)
1090
+ }),
1091
+ choice.benefit === true && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tag, {
1092
+ tone: choice.blocked === true ? "warning" : "success",
1093
+ children: choice.blocked === true ? t("benefitBlocked") : t("benefit")
1094
+ }),
1095
+ choice.ratio !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tag, {
1096
+ tone: "quiet",
1097
+ children: choice.ratio
1098
+ })
1099
+ ]
1100
+ }, choice.id))
1101
+ }),
1102
+ selection.writable && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1103
+ className: CodeArtsPluginCard_module_css_default.actions,
1104
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
1105
+ variant: "outline",
1106
+ size: "sm",
1107
+ disabled: draft.length === all,
1108
+ onClick: () => {
1109
+ setSavedModels(false);
1110
+ setModelError(null);
1111
+ setDraft(selection.choices.map((c) => c.id));
1112
+ },
1113
+ children: t("selectAll")
1114
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
1115
+ variant: "primary",
1116
+ size: "sm",
1117
+ disabled: !dirty || savingModels,
1118
+ onClick: () => void saveModels(),
1119
+ children: savingModels ? t("saving") : savedModels && !dirty ? t("saved") : t("saveModels")
1120
+ })]
1121
+ }),
1122
+ modelError !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
1123
+ className: CodeArtsPluginCard_module_css_default.error,
1124
+ children: modelError
1125
+ })
1126
+ ]
1127
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
1128
+ className: CodeArtsPluginCard_module_css_default.hint,
1129
+ children: t("modelsLoading")
1130
+ })
1166
1131
  }),
1167
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("details", {
1168
- className: CodeArtsPluginCard_module_css_default.manual,
1169
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("summary", {
1170
- className: CodeArtsPluginCard_module_css_default.manualSummary,
1171
- children: t("manualToken")
1172
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ManualTokenForm, {
1173
- t,
1174
- token,
1175
- label,
1176
- busy,
1177
- onToken: setToken,
1178
- onLabel: setLabel,
1179
- onSubmit: (e) => void saveToken(e)
1180
- })]
1132
+ status?.usage !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TabPanel, {
1133
+ id: panelId("usage"),
1134
+ labelledBy: tabId("usage"),
1135
+ active: activeTab === "usage",
1136
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(UsageSection, {
1137
+ usage: status.usage,
1138
+ accounts,
1139
+ t
1140
+ })
1181
1141
  })
1182
- ]
1183
- }), msg !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
1184
- className: CodeArtsPluginCard_module_css_default.error,
1185
- children: msg
1186
- })]
1142
+ ] }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1143
+ className: CodeArtsPluginCard_module_css_default.section,
1144
+ children: [
1145
+ expired && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
1146
+ className: CodeArtsPluginCard_module_css_default.hint,
1147
+ children: t("expiredHint")
1148
+ }),
1149
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1150
+ className: CodeArtsPluginCard_module_css_default.actions,
1151
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
1152
+ variant: "primary",
1153
+ disabled: busy || loginPending,
1154
+ onClick: () => void startOAuthLogin(),
1155
+ children: loginPending ? t("signingIn") : t("signIn")
1156
+ })
1157
+ }),
1158
+ loginUrl !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
1159
+ className: CodeArtsPluginCard_module_css_default.hint,
1160
+ children: [
1161
+ t("openManually"),
1162
+ " ",
1163
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
1164
+ className: CodeArtsPluginCard_module_css_default.link,
1165
+ href: loginUrl,
1166
+ target: "_blank",
1167
+ rel: "noreferrer",
1168
+ children: loginUrl
1169
+ })
1170
+ ]
1171
+ }),
1172
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("details", {
1173
+ className: CodeArtsPluginCard_module_css_default.manual,
1174
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("summary", {
1175
+ className: CodeArtsPluginCard_module_css_default.manualSummary,
1176
+ children: t("manualToken")
1177
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ManualTokenForm, {
1178
+ t,
1179
+ token,
1180
+ label,
1181
+ busy,
1182
+ onToken: setToken,
1183
+ onLabel: setLabel,
1184
+ onSubmit: (e) => void saveToken(e)
1185
+ })]
1186
+ })
1187
+ ]
1188
+ }),
1189
+ msg !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
1190
+ className: CodeArtsPluginCard_module_css_default.error,
1191
+ children: msg
1192
+ })
1193
+ ]
1187
1194
  })]
1188
1195
  });
1189
1196
  }