@sparkelf/dsh-dataops-managed 0.3.38 → 0.3.40

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
@@ -834,22 +834,22 @@ window.__ModuleLoader__.load({
834
834
  document.head.appendChild(tag);
835
835
  }
836
836
  var ManagedDataOpsSection_module_css_default = {
837
- "refusal": "_2dqzjG_refusal",
838
- "row": "_2dqzjG_row",
839
- "reviewRow": "_2dqzjG_reviewRow",
840
- "reviewRows": "_2dqzjG_reviewRows",
837
+ "card": "_2dqzjG_card",
841
838
  "actions": "_2dqzjG_actions",
842
- "label": "_2dqzjG_label",
843
- "reviewActions": "_2dqzjG_reviewActions",
844
- "reviewHint": "_2dqzjG_reviewHint",
845
839
  "meta": "_2dqzjG_meta",
846
- "card": "_2dqzjG_card",
847
- "fields": "_2dqzjG_fields",
840
+ "reviewRow": "_2dqzjG_reviewRow",
841
+ "label": "_2dqzjG_label",
848
842
  "section": "_2dqzjG_section",
843
+ "reviewActions": "_2dqzjG_reviewActions",
849
844
  "heading": "_2dqzjG_heading",
850
- "title": "_2dqzjG_title",
845
+ "status": "_2dqzjG_status",
846
+ "row": "_2dqzjG_row",
851
847
  "copy": "_2dqzjG_copy",
852
- "status": "_2dqzjG_status"
848
+ "refusal": "_2dqzjG_refusal",
849
+ "fields": "_2dqzjG_fields",
850
+ "reviewRows": "_2dqzjG_reviewRows",
851
+ "reviewHint": "_2dqzjG_reviewHint",
852
+ "title": "_2dqzjG_title"
853
853
  };
854
854
  //#endregion
855
855
  //#region src/client/ReviewSettingsCard.tsx
@@ -1502,11 +1502,6 @@ window.__ModuleLoader__.load({
1502
1502
  function sortNotifications(items) {
1503
1503
  return [...items].sort((left, right) => right.createdAt.localeCompare(left.createdAt));
1504
1504
  }
1505
- /** The tab a notification should open, when its resource has one. */
1506
- function notificationTab(item) {
1507
- if (item.type === "submitted" || item.type === "review_pending" || item.type === "ai_report_ready" || item.type === "ai_report") return "pending";
1508
- if (item.type === "approved" || item.type === "published" || item.type === "shared") return "approved";
1509
- }
1510
1505
  //#endregion
1511
1506
  //#region src/client/skill-plaza-client.ts
1512
1507
  /** Route the plugin's Host half serves for the plaza. */
@@ -1592,136 +1587,10 @@ window.__ModuleLoader__.load({
1592
1587
  return await response.json();
1593
1588
  }
1594
1589
  //#endregion
1595
- //#region src/client/review-notification-store.ts
1590
+ //#region \0dsh-css:/root/projects/dsh-plugins-plus/packages/dataops-managed/src/client/SkillPlazaSection.module.css.mjs
1596
1591
  init_review_demo();
1597
- /**
1598
- * One process-wide notification store shared by every bell.
1599
- *
1600
- * The skill plaza and the workflow plaza are separate React trees, but they show the same
1601
- * inbox; keeping the read state in one store is what stops a badge in one place from staying
1602
- * unread after the other opened the row.
1603
- */
1604
- const DEMO_ITEMS = [
1605
- {
1606
- id: "demo-1",
1607
- type: "review_pending",
1608
- title: "技能「SQL 取数助手」等待审核",
1609
- body: "来自研发部 · 提交于 10 分钟前",
1610
- resourceKind: "skill",
1611
- resourceId: 101,
1612
- read: false,
1613
- createdAt: "2026-10-23T04:50:00.000Z"
1614
- },
1615
- {
1616
- id: "demo-2",
1617
- type: "ai_report",
1618
- title: "AI 风险报告已生成",
1619
- body: "风险等级:中 · 2 条建议",
1620
- resourceKind: "skill",
1621
- resourceId: 101,
1622
- read: false,
1623
- createdAt: "2026-10-23T04:49:00.000Z"
1624
- },
1625
- {
1626
- id: "demo-3",
1627
- type: "approved",
1628
- title: "工作流「每日经营日报」已通过",
1629
- body: "审核人:admin",
1630
- resourceKind: "workflow",
1631
- resourceId: "wf-1",
1632
- read: true,
1633
- createdAt: "2026-10-22T09:10:00.000Z"
1634
- }
1635
- ];
1636
- let state = {
1637
- status: "idle",
1638
- items: [],
1639
- unread: 0
1640
- };
1641
- const listeners = /* @__PURE__ */ new Set();
1642
- function publish(next) {
1643
- state = next;
1644
- for (const listener of listeners) listener();
1645
- }
1646
- /** Current snapshot for `useSyncExternalStore`. */
1647
- function notificationSnapshot() {
1648
- return state;
1649
- }
1650
- /** Subscribe to store changes. */
1651
- function subscribeNotifications(listener) {
1652
- listeners.add(listener);
1653
- return () => {
1654
- listeners.delete(listener);
1655
- };
1656
- }
1657
- /** Load the inbox once; a second caller joins the first request. */
1658
- let inflight;
1659
- function loadNotifications() {
1660
- if (inflight !== void 0) return inflight;
1661
- publish({
1662
- ...state,
1663
- status: "loading"
1664
- });
1665
- inflight = (async () => {
1666
- try {
1667
- if (reviewDemoMode()) {
1668
- publish({
1669
- status: "ready",
1670
- items: sortNotifications(DEMO_ITEMS),
1671
- unread: unreadCount(DEMO_ITEMS)
1672
- });
1673
- return;
1674
- }
1675
- const result = await fetchNotifications();
1676
- if (result === null) {
1677
- publish({
1678
- status: "unavailable",
1679
- items: [],
1680
- unread: 0
1681
- });
1682
- return;
1683
- }
1684
- publish({
1685
- status: "ready",
1686
- items: sortNotifications(result.items),
1687
- unread: unreadCount(result.items)
1688
- });
1689
- } catch {
1690
- publish({
1691
- status: "unavailable",
1692
- items: [],
1693
- unread: 0
1694
- });
1695
- } finally {
1696
- inflight = void 0;
1697
- }
1698
- })();
1699
- return inflight;
1700
- }
1701
- /** Mark one row or the whole inbox read, optimistically. */
1702
- async function markRead(ids) {
1703
- const items = ids === "all" ? state.items.map((item) => ({
1704
- ...item,
1705
- read: true
1706
- })) : state.items.map((item) => ids.includes(item.id) ? {
1707
- ...item,
1708
- read: true
1709
- } : item);
1710
- publish({
1711
- ...state,
1712
- items,
1713
- unread: unreadCount(items)
1714
- });
1715
- try {
1716
- if (!await markNotificationsRead(ids)) await loadNotifications();
1717
- } catch {
1718
- await loadNotifications();
1719
- }
1720
- }
1721
- //#endregion
1722
- //#region \0dsh-css:/root/projects/dsh-plugins-plus/packages/dataops-managed/src/client/NotificationBell.module.css.mjs
1723
- const css$4 = ".tE0trG_bell{width:26px;height:26px;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:0;border-radius:6px;flex:none;justify-content:center;align-items:center;padding:0;display:inline-flex;position:relative}.tE0trG_bell:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}.tE0trG_bell:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:1px}.tE0trG_badge{background:var(--dsw-alias-state-error-primary);color:#fff;text-align:center;border-radius:7px;min-width:14px;height:14px;padding:0 3px;font-size:9px;font-weight:600;line-height:14px;position:absolute;top:0;right:-2px}.tE0trG_dialog{flex-direction:column;width:min(520px,100vw - 32px);height:70vh;max-height:70vh;display:flex;overflow:hidden}.tE0trG_demo{background:var(--dsw-alias-state-warn-secondary);color:var(--dsw-alias-state-warn-primary);border-radius:4px;margin:0 0 8px;padding:5px 8px;font-size:11px}.tE0trG_empty{color:var(--dsw-alias-label-tertiary);text-align:center;margin:0;padding:18px 0;font-size:12px;line-height:18px}.tE0trG_list{flex-direction:column;flex:none;gap:6px;max-height:calc(70vh - 210px);margin:0;padding:0;list-style:none;display:flex;overflow-y:auto}.tE0trG_row{width:100%;color:var(--dsw-alias-label-secondary);text-align:left;cursor:pointer;background:0 0;border:0;border-radius:0;align-items:flex-start;gap:9px;padding:4px 2px;display:flex}.tE0trG_row:hover .tE0trG_rowTitle{color:var(--dsw-alias-state-business-primary)}.tE0trG_rowIcon{width:18px;height:18px;color:var(--dsw-alias-label-secondary);flex:none;justify-content:center;align-items:center;margin-top:1px;display:inline-flex}.tE0trG_rowIcon[data-tone=success]{color:var(--dsw-alias-state-success-primary)}.tE0trG_rowIcon[data-tone=danger]{color:var(--dsw-alias-state-error-primary)}.tE0trG_rowIcon[data-tone=warn]{color:var(--dsw-alias-state-warn-primary)}.tE0trG_rowIcon[data-tone=info]{color:var(--dsw-alias-state-business-primary)}.tE0trG_dot{background:var(--dsw-alias-state-business-primary);border-radius:50%;flex:none;width:6px;height:6px}.tE0trG_rowBody{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}.tE0trG_rowTitle{color:var(--dsw-alias-label-primary);font-size:12px;font-weight:500;line-height:18px}.tE0trG_rowText{color:var(--dsw-alias-label-secondary);font-size:11px;line-height:16px}.tE0trG_rowMeta{flex:none;align-items:center;gap:6px;margin-top:2px;display:flex}.tE0trG_rowTime{color:var(--dsw-alias-label-tertiary);flex:none;font-size:10px;line-height:16px}.tE0trG_actions{justify-content:flex-end;gap:6px;display:flex}.tE0trG_button,.tE0trG_linkButton{cursor:pointer;border-radius:5px;height:28px;padding:0 10px;font-size:12px}.tE0trG_button{border:1px solid var(--dsw-alias-border-l2);color:var(--dsw-alias-label-primary);background:0 0}.tE0trG_linkButton{color:var(--dsw-alias-state-business-primary);background:0 0;border:0}.tE0trG_pager{color:var(--dsw-alias-label-secondary);justify-content:flex-end;align-items:center;gap:8px;padding-top:8px;font-size:11px;display:flex}.tE0trG_pager button{border:1px solid var(--dsw-alias-border-l2);height:24px;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border-radius:4px;padding:0 8px;font-size:11px}.tE0trG_pager button:disabled{opacity:.4;cursor:default}";
1724
- const tagId$4 = "@sparkelf/dsh-dataops-managed/NotificationBell.module.css";
1592
+ const css$4 = "._9FdZvq_section{box-sizing:border-box;flex-direction:column;width:100%;max-width:960px;margin:0 auto;display:flex}._9FdZvq_head{flex-direction:column;margin-bottom:8px;display:flex}._9FdZvq_title{color:var(--dsw-alias-label-primary);align-items:baseline;gap:8px;margin:0;font-size:14px;font-weight:500;line-height:20px;display:flex}._9FdZvq_titleCount{color:var(--dsw-alias-label-tertiary);font-size:12px;font-weight:400}._9FdZvq_status{text-align:center;color:var(--dsw-alias-label-tertiary);margin:0;padding:20px 0;font-size:13px;line-height:20px}._9FdZvq_departmentBar{align-items:center;gap:8px;margin-bottom:10px;display:inline-flex}._9FdZvq_departmentLabel{color:var(--dsw-alias-label-secondary);font-size:12px;line-height:18px}._9FdZvq_departmentSelect{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-1);height:28px;color:var(--dsw-alias-label-primary);font:inherit;border-radius:8px;padding:0 8px;font-size:12px;line-height:18px}._9FdZvq_departmentSelect:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:1px}._9FdZvq_notice{color:var(--dsw-alias-state-business-primary);margin:4px 0 0;font-size:12px;line-height:18px}._9FdZvq_cards{grid-template-columns:repeat(auto-fill,minmax(272px,1fr));grid-auto-rows:max-content;align-content:start;align-items:stretch;gap:12px;margin:0;padding:0;list-style:none;display:grid}._9FdZvq_card{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-1);border-radius:10px;flex-direction:column;align-self:stretch;gap:10px;min-width:0;height:auto;padding:12px;display:flex}._9FdZvq_cardTop{justify-content:space-between;align-items:center;gap:10px;min-height:28px;display:flex}._9FdZvq_cardIcon{background:var(--dsw-alias-bg-layer-2);width:28px;height:28px;color:var(--dsw-alias-label-secondary);border-radius:50%;flex:none;place-items:center;display:grid}._9FdZvq_cardTitle{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;font-size:14px;font-weight:600;line-height:20px;overflow:hidden}._9FdZvq_mine{flex:none}._9FdZvq_cardDesc{min-height:36px;color:var(--dsw-alias-label-secondary);-webkit-line-clamp:2;-webkit-box-orient:vertical;font-size:12px;line-height:18px;display:-webkit-box;overflow:hidden}._9FdZvq_cardMarks{flex-wrap:wrap;align-content:flex-start;gap:6px;min-height:20px;display:flex}._9FdZvq_mark{background:color-mix(in srgb, var(--dsw-alias-state-business-primary) 14%, var(--dsw-alias-bg-layer-1));color:var(--dsw-alias-state-business-primary);white-space:nowrap;border:0;border-radius:4px;padding:2px 7px;font-size:11px;font-weight:500;line-height:16px}._9FdZvq_cardEnd{flex:none;align-items:center;gap:4px;margin-top:auto;padding-top:4px;display:flex}._9FdZvq_detailButton{margin-left:auto}._9FdZvq_detail{flex-direction:column;gap:12px;margin:0;display:flex}._9FdZvq_dialog{width:min(560px,100%)}._9FdZvq_detailRow{flex-direction:column;gap:2px;display:flex}._9FdZvq_detailLabel{color:var(--dsw-alias-label-caption);font-size:11px;line-height:16px}._9FdZvq_detailValue{max-height:160px;color:var(--dsw-alias-label-secondary);white-space:pre-wrap;overflow-wrap:anywhere;margin:0;font-size:12px;line-height:18px;overflow:auto}._9FdZvq_empty{text-align:center;flex-direction:column;align-items:center;gap:10px;padding:28px 16px 32px;display:flex}._9FdZvq_emptyIcon{border:.5px solid var(--dsw-alias-border-l3);width:56px;height:56px;color:var(--dsw-alias-label-tertiary);border-radius:14px;justify-content:center;align-items:center;display:inline-flex}._9FdZvq_emptyText{color:var(--dsw-alias-label-tertiary);margin:0;font-size:13px;line-height:20px}._9FdZvq_headRow{align-items:center;gap:6px;display:flex}._9FdZvq_headRow ._9FdZvq_title{flex:none}._9FdZvq_demoTag{background:var(--dsw-alias-state-warn-secondary);color:var(--dsw-alias-state-warn-primary);border-radius:4px;padding:1px 6px;font-size:10px;line-height:16px}._9FdZvq_tabs{border-bottom:1px solid var(--dsw-alias-border-l1);align-items:center;gap:2px;margin-bottom:8px;display:flex}._9FdZvq_tab{height:30px;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:0;border-bottom:2px solid #0000;align-items:center;gap:5px;padding:0 9px;font-size:12px;display:inline-flex}._9FdZvq_tab:hover{color:var(--dsw-alias-label-primary)}._9FdZvq_tabActive{color:var(--dsw-alias-state-business-primary);border-bottom-color:var(--dsw-alias-state-business-primary);font-weight:500}._9FdZvq_tabCount{background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-tertiary);border-radius:7px;padding:0 4px;font-size:10px;line-height:14px}._9FdZvq_tagTop{text-overflow:ellipsis;white-space:nowrap;border:1px solid var(--dsw-alias-border-l2);max-width:40%;color:var(--dsw-alias-label-secondary);border-radius:4px;flex:none;padding:1px 6px;font-size:10px;line-height:16px;overflow:hidden}._9FdZvq_sharedTag{color:#fff;background:#0e6b3a;border-radius:4px;padding:2px 7px;font-size:11px;font-weight:600;line-height:16px}._9FdZvq_pendingTag{color:#fff;background:#7a4a00;border-radius:4px;padding:2px 7px;font-size:11px;font-weight:600;line-height:16px}._9FdZvq_rejectedTag{color:#fff;background:#a8231b;border-radius:4px;padding:2px 7px;font-size:11px;font-weight:600;line-height:16px}._9FdZvq_reviewButton{margin-left:auto}._9FdZvq_reviewNote{border-left:3px solid var(--dsw-alias-state-error-primary);background:color-mix(in srgb, var(--dsw-alias-state-error-primary) 10%, var(--dsw-alias-bg-layer-1));color:var(--dsw-alias-label-primary);margin:0;padding:6px 8px;font-size:11px;line-height:16px}._9FdZvq_auditDialog{width:min(640px,100vw - 32px)}._9FdZvq_audit{flex-direction:column;gap:14px;display:flex}._9FdZvq_auditFooter{justify-content:flex-end;gap:6px;display:flex}._9FdZvq_risk{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);border-radius:6px;flex-direction:column;gap:8px;padding:10px;display:flex}._9FdZvq_riskHead{justify-content:space-between;align-items:center;gap:8px;font-size:12px;display:flex}._9FdZvq_riskEmpty,._9FdZvq_riskFailed{color:var(--dsw-alias-label-tertiary);margin:0;font-size:11px;line-height:16px}._9FdZvq_riskFailed{color:var(--dsw-alias-state-error-primary)}._9FdZvq_riskSummary{color:var(--dsw-alias-label-secondary);flex-wrap:wrap;align-items:center;gap:6px;font-size:12px;line-height:18px;display:flex}._9FdZvq_riskScore{color:var(--dsw-alias-label-primary);font-weight:600}._9FdZvq_severity{background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-secondary);text-transform:uppercase;border-radius:3px;padding:0 5px;font-size:10px;line-height:16px}._9FdZvq_severity[data-severity=high],._9FdZvq_severity[data-severity=critical]{background:var(--dsw-alias-state-error-secondary);color:var(--dsw-alias-state-error-primary)}._9FdZvq_severity[data-severity=medium]{background:var(--dsw-alias-state-warn-secondary);color:var(--dsw-alias-state-warn-primary)}._9FdZvq_findings{flex-direction:column;gap:6px;margin:0;padding:0;list-style:none;display:flex}._9FdZvq_finding{flex-wrap:wrap;align-items:baseline;gap:5px;font-size:11px;line-height:16px;display:flex}._9FdZvq_findingText{color:var(--dsw-alias-label-secondary);flex-basis:100%}._9FdZvq_findingHint{color:var(--dsw-alias-label-tertiary);flex-basis:100%}._9FdZvq_noteField{color:var(--dsw-alias-label-secondary);flex-direction:column;gap:5px;font-size:12px;display:flex}._9FdZvq_noteField textarea{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-base);min-height:64px;color:var(--dsw-alias-label-primary);font:inherit;resize:vertical;border-radius:5px;padding:7px 9px}._9FdZvq_reviewError{color:var(--dsw-alias-state-error-primary);margin:0;font-size:11px}";
1593
+ const tagId$4 = "@sparkelf/dsh-dataops-managed/SkillPlazaSection.module.css";
1725
1594
  if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$4) + "]") === null) {
1726
1595
  const tag = document.createElement("style");
1727
1596
  tag.dataset.plugin = "@sparkelf/dsh-dataops-managed";
@@ -1729,624 +1598,316 @@ window.__ModuleLoader__.load({
1729
1598
  tag.textContent = css$4;
1730
1599
  document.head.appendChild(tag);
1731
1600
  }
1732
- var NotificationBell_module_css_default = {
1733
- "rowTime": "tE0trG_rowTime",
1734
- "bell": "tE0trG_bell",
1735
- "row": "tE0trG_row",
1736
- "dialog": "tE0trG_dialog",
1737
- "list": "tE0trG_list",
1738
- "actions": "tE0trG_actions",
1739
- "linkButton": "tE0trG_linkButton",
1740
- "empty": "tE0trG_empty",
1741
- "rowBody": "tE0trG_rowBody",
1742
- "rowMeta": "tE0trG_rowMeta",
1743
- "dot": "tE0trG_dot",
1744
- "button": "tE0trG_button",
1745
- "rowText": "tE0trG_rowText",
1746
- "badge": "tE0trG_badge",
1747
- "demo": "tE0trG_demo",
1748
- "rowIcon": "tE0trG_rowIcon",
1749
- "rowTitle": "tE0trG_rowTitle",
1750
- "pager": "tE0trG_pager"
1601
+ var SkillPlazaSection_module_css_default = {
1602
+ "cards": "_9FdZvq_cards",
1603
+ "emptyIcon": "_9FdZvq_emptyIcon",
1604
+ "titleCount": "_9FdZvq_titleCount",
1605
+ "headRow": "_9FdZvq_headRow",
1606
+ "demoTag": "_9FdZvq_demoTag",
1607
+ "departmentBar": "_9FdZvq_departmentBar",
1608
+ "dialog": "_9FdZvq_dialog",
1609
+ "detailLabel": "_9FdZvq_detailLabel",
1610
+ "section": "_9FdZvq_section",
1611
+ "cardIcon": "_9FdZvq_cardIcon",
1612
+ "tab": "_9FdZvq_tab",
1613
+ "tagTop": "_9FdZvq_tagTop",
1614
+ "empty": "_9FdZvq_empty",
1615
+ "sharedTag": "_9FdZvq_sharedTag",
1616
+ "pendingTag": "_9FdZvq_pendingTag",
1617
+ "risk": "_9FdZvq_risk",
1618
+ "departmentSelect": "_9FdZvq_departmentSelect",
1619
+ "cardDesc": "_9FdZvq_cardDesc",
1620
+ "cardMarks": "_9FdZvq_cardMarks",
1621
+ "mark": "_9FdZvq_mark",
1622
+ "head": "_9FdZvq_head",
1623
+ "status": "_9FdZvq_status",
1624
+ "detailValue": "_9FdZvq_detailValue",
1625
+ "tabActive": "_9FdZvq_tabActive",
1626
+ "riskHead": "_9FdZvq_riskHead",
1627
+ "findings": "_9FdZvq_findings",
1628
+ "riskScore": "_9FdZvq_riskScore",
1629
+ "tabCount": "_9FdZvq_tabCount",
1630
+ "reviewNote": "_9FdZvq_reviewNote",
1631
+ "auditDialog": "_9FdZvq_auditDialog",
1632
+ "findingHint": "_9FdZvq_findingHint",
1633
+ "riskFailed": "_9FdZvq_riskFailed",
1634
+ "detail": "_9FdZvq_detail",
1635
+ "audit": "_9FdZvq_audit",
1636
+ "riskSummary": "_9FdZvq_riskSummary",
1637
+ "title": "_9FdZvq_title",
1638
+ "tabs": "_9FdZvq_tabs",
1639
+ "mine": "_9FdZvq_mine",
1640
+ "emptyText": "_9FdZvq_emptyText",
1641
+ "finding": "_9FdZvq_finding",
1642
+ "departmentLabel": "_9FdZvq_departmentLabel",
1643
+ "detailRow": "_9FdZvq_detailRow",
1644
+ "reviewButton": "_9FdZvq_reviewButton",
1645
+ "cardTitle": "_9FdZvq_cardTitle",
1646
+ "severity": "_9FdZvq_severity",
1647
+ "card": "_9FdZvq_card",
1648
+ "detailButton": "_9FdZvq_detailButton",
1649
+ "findingText": "_9FdZvq_findingText",
1650
+ "auditFooter": "_9FdZvq_auditFooter",
1651
+ "cardEnd": "_9FdZvq_cardEnd",
1652
+ "riskEmpty": "_9FdZvq_riskEmpty",
1653
+ "noteField": "_9FdZvq_noteField",
1654
+ "notice": "_9FdZvq_notice",
1655
+ "rejectedTag": "_9FdZvq_rejectedTag",
1656
+ "reviewError": "_9FdZvq_reviewError",
1657
+ "cardTop": "_9FdZvq_cardTop"
1751
1658
  };
1752
1659
  //#endregion
1753
- //#region src/client/NotificationBell.tsx
1754
- /** Colour tone and glyph for one notification type, matching the automation-task rows. */
1755
- function notificationTone(type) {
1756
- if (type === "approved" || type === "published" || type === "success") return "success";
1757
- if (type === "rejected") return "danger";
1758
- if (type === "unpublished") return "warn";
1759
- return "info";
1660
+ //#region src/client/SkillPlazaSection.tsx
1661
+ /** Tab counts from the same visible rows the cards render. */
1662
+ function countsOf(skills) {
1663
+ const counted = reviewCounts(skills);
1664
+ return {
1665
+ approved: counted.approved,
1666
+ pending: counted.pending,
1667
+ rejected: skills.filter((row) => row.reviewStatus === "rejected").length,
1668
+ total: counted.all
1669
+ };
1760
1670
  }
1761
- function NotificationIcon({ tone }) {
1762
- if (tone === "success") return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
1763
- width: "14",
1764
- height: "14",
1765
- viewBox: "0 0 16 16",
1766
- fill: "none",
1767
- "aria-hidden": "true",
1768
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("circle", {
1769
- cx: "8",
1770
- cy: "8",
1771
- r: "6.2",
1772
- stroke: "currentColor",
1773
- strokeWidth: "1.3"
1774
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
1775
- d: "m5.3 8.1 1.8 1.8 3.6-3.8",
1776
- stroke: "currentColor",
1777
- strokeWidth: "1.3",
1778
- strokeLinecap: "round",
1779
- strokeLinejoin: "round"
1780
- })]
1781
- });
1782
- if (tone === "danger") return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
1783
- width: "14",
1784
- height: "14",
1785
- viewBox: "0 0 16 16",
1786
- fill: "none",
1787
- "aria-hidden": "true",
1671
+ /**
1672
+ * The department a plaza row belongs to.
1673
+ *
1674
+ * The backend normally sends `departmentCode`; a legacy row may carry only a name or path, so the
1675
+ * fallbacks keep those rows selectable instead of dropping them into an empty key.
1676
+ * @param skill - one plaza row.
1677
+ * @returns the code, the name, or the deepest path name; empty when the row says nothing.
1678
+ */
1679
+ function departmentKeyOf(skill) {
1680
+ return skill.departmentCode ?? skill.departmentName ?? skill.departmentPath?.at(-1)?.name ?? "";
1681
+ }
1682
+ /**
1683
+ * The department choices present in the visible rows.
1684
+ *
1685
+ * The label falls back from the row's own name to the deepest path name and finally to the code,
1686
+ * so a department the backend can no longer name still renders as a readable option.
1687
+ * @param skills - every row the current query returned.
1688
+ * @returns distinct departments, sorted by label.
1689
+ */
1690
+ function departmentOptionsOf(skills) {
1691
+ const options = /* @__PURE__ */ new Map();
1692
+ for (const skill of skills) {
1693
+ if (normalizeVisibility(skill.visibility) !== "department") continue;
1694
+ const code = departmentKeyOf(skill);
1695
+ if (code === "" || options.has(code)) continue;
1696
+ options.set(code, skill.departmentName ?? skill.departmentPath?.at(-1)?.name ?? code);
1697
+ }
1698
+ return [...options].map(([code, name]) => ({
1699
+ code,
1700
+ name
1701
+ })).sort((left, right) => left.name.localeCompare(right.name, "zh-Hans-CN"));
1702
+ }
1703
+ /**
1704
+ * The rows the department tab shows.
1705
+ * @param skills - every row the current query returned.
1706
+ * @param code - selected department key, or an empty string for all of them.
1707
+ * @returns the department-shared rows, narrowed to `code` when it is set.
1708
+ */
1709
+ function filterByDepartment(skills, code) {
1710
+ const shared = skills.filter((skill) => normalizeVisibility(skill.visibility) === "department");
1711
+ return code === "" ? shared : shared.filter((skill) => departmentKeyOf(skill) === code);
1712
+ }
1713
+ /** One skill as a card in the plaza grid. */
1714
+ function PlazaCard({ skill, busy, canAudit, onInstall, onUnshare, onReview, t }) {
1715
+ const [open, setOpen] = (0, react.useState)(false);
1716
+ const status = normalizeReviewStatus(skill.reviewStatus);
1717
+ const tag = visibilityTag(skill);
1718
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
1719
+ className: SkillPlazaSection_module_css_default.card,
1720
+ "data-review-status": status,
1788
1721
  children: [
1789
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
1790
- d: "M8 2.3 14 13H2L8 2.3Z",
1791
- stroke: "currentColor",
1792
- strokeWidth: "1.3",
1793
- strokeLinejoin: "round"
1722
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1723
+ className: SkillPlazaSection_module_css_default.cardTop,
1724
+ children: [
1725
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1726
+ className: SkillPlazaSection_module_css_default.cardIcon,
1727
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconSkillOutlineRegular, { size: 16 })
1728
+ }),
1729
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1730
+ className: SkillPlazaSection_module_css_default.cardTitle,
1731
+ children: skill.name
1732
+ }),
1733
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1734
+ className: SkillPlazaSection_module_css_default.tagTop,
1735
+ title: tag.detail,
1736
+ children: tag.label
1737
+ })
1738
+ ]
1794
1739
  }),
1795
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
1796
- d: "M8 6v3.1",
1797
- stroke: "currentColor",
1798
- strokeWidth: "1.3",
1799
- strokeLinecap: "round"
1740
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1741
+ className: SkillPlazaSection_module_css_default.cardMarks,
1742
+ children: [
1743
+ skill.sharedByMe ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1744
+ className: SkillPlazaSection_module_css_default.sharedTag,
1745
+ children: t("plazaSharedTag")
1746
+ }) : null,
1747
+ status === "pending" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1748
+ className: SkillPlazaSection_module_css_default.pendingTag,
1749
+ children: t("plazaTabPending")
1750
+ }) : null,
1751
+ status === "rejected" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1752
+ className: SkillPlazaSection_module_css_default.rejectedTag,
1753
+ children: t("plazaReject")
1754
+ }) : null,
1755
+ skill.tags.map((item) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1756
+ className: SkillPlazaSection_module_css_default.mark,
1757
+ children: item
1758
+ }, item))
1759
+ ]
1800
1760
  }),
1801
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("circle", {
1802
- cx: "8",
1803
- cy: "11.2",
1804
- r: ".7",
1805
- fill: "currentColor"
1806
- })
1807
- ]
1808
- });
1809
- if (tone === "warn") return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
1810
- width: "14",
1811
- height: "14",
1812
- viewBox: "0 0 16 16",
1813
- fill: "none",
1814
- "aria-hidden": "true",
1815
- children: [
1816
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("circle", {
1817
- cx: "8",
1818
- cy: "8",
1819
- r: "6.2",
1820
- stroke: "currentColor",
1821
- strokeWidth: "1.3"
1761
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1762
+ className: SkillPlazaSection_module_css_default.cardDesc,
1763
+ children: skill.description ?? ""
1822
1764
  }),
1823
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
1824
- d: "M8 4.8v3.6",
1825
- stroke: "currentColor",
1826
- strokeWidth: "1.3",
1827
- strokeLinecap: "round"
1765
+ status === "rejected" && skill.reviewNote !== null && skill.reviewNote !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
1766
+ className: SkillPlazaSection_module_css_default.reviewNote,
1767
+ children: skill.reviewNote
1768
+ }) : null,
1769
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1770
+ className: SkillPlazaSection_module_css_default.cardEnd,
1771
+ children: [
1772
+ canAudit && status === "pending" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
1773
+ variant: "outline",
1774
+ size: "sm",
1775
+ className: SkillPlazaSection_module_css_default.reviewButton,
1776
+ onClick: onReview,
1777
+ children: t("plazaReview")
1778
+ }) : null,
1779
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
1780
+ variant: "outline",
1781
+ size: "sm",
1782
+ icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconDownloadOutlineRegular, { size: 16 }),
1783
+ disabled: busy,
1784
+ onClick: onInstall,
1785
+ children: t("plazaInstall")
1786
+ }),
1787
+ skill.sharedByMe ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
1788
+ variant: "ghost",
1789
+ size: "sm",
1790
+ icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconTrashOutlineRegular, { size: 16 }),
1791
+ disabled: busy,
1792
+ onClick: onUnshare,
1793
+ children: t("plazaUnshare")
1794
+ }) : null,
1795
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
1796
+ variant: "outline",
1797
+ size: "sm",
1798
+ className: SkillPlazaSection_module_css_default.detailButton,
1799
+ onClick: () => {
1800
+ setOpen(true);
1801
+ },
1802
+ children: t("plazaShowDetail")
1803
+ })
1804
+ ]
1828
1805
  }),
1829
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("circle", {
1830
- cx: "8",
1831
- cy: "11.1",
1832
- r: ".7",
1833
- fill: "currentColor"
1806
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Modal, {
1807
+ open,
1808
+ onClose: () => {
1809
+ setOpen(false);
1810
+ },
1811
+ title: skill.name,
1812
+ closeLabel: t("plazaClose"),
1813
+ className: SkillPlazaSection_module_css_default.dialog,
1814
+ footer: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
1815
+ variant: "outline",
1816
+ onClick: () => {
1817
+ setOpen(false);
1818
+ },
1819
+ children: t("plazaClose")
1820
+ }),
1821
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("dl", {
1822
+ className: SkillPlazaSection_module_css_default.detail,
1823
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1824
+ className: SkillPlazaSection_module_css_default.detailRow,
1825
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("dt", {
1826
+ className: SkillPlazaSection_module_css_default.detailLabel,
1827
+ children: t("plazaDetailUpdated")
1828
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dd", {
1829
+ className: SkillPlazaSection_module_css_default.detailValue,
1830
+ children: skill.updatedAt
1831
+ })]
1832
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1833
+ className: SkillPlazaSection_module_css_default.detailRow,
1834
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("dt", {
1835
+ className: SkillPlazaSection_module_css_default.detailLabel,
1836
+ children: t("plazaDetailBody")
1837
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dd", {
1838
+ className: SkillPlazaSection_module_css_default.detailValue,
1839
+ children: skill.instruction
1840
+ })]
1841
+ })]
1842
+ })
1834
1843
  })
1835
1844
  ]
1836
1845
  });
1837
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
1838
- width: "14",
1839
- height: "14",
1840
- viewBox: "0 0 16 16",
1841
- fill: "none",
1842
- "aria-hidden": "true",
1843
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
1844
- d: "M4 2.5h5l3 3v8H4v-11Z",
1845
- stroke: "currentColor",
1846
- strokeWidth: "1.2",
1847
- strokeLinejoin: "round"
1848
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
1849
- d: "M9 2.5v3h3M6 8h4M6 10.5h3",
1850
- stroke: "currentColor",
1851
- strokeWidth: "1.2",
1852
- strokeLinecap: "round"
1853
- })]
1854
- });
1855
1846
  }
1856
- /**
1857
- * A bell with an unread badge and the shared inbox.
1858
- *
1859
- * The bell is a button rather than a menu so keyboard focus and Escape follow the dialog
1860
- * conventions the rest of the page already uses. Rows mark themselves read when opened;
1861
- * "全部已读" is the one bulk action.
1862
- */
1863
- function NotificationBell({ label, onOpen }) {
1864
- const state = (0, react.useSyncExternalStore)(subscribeNotifications, notificationSnapshot, notificationSnapshot);
1865
- const [open, setOpen] = (0, react.useState)(false);
1866
- const [page, setPage] = (0, react.useState)(0);
1867
- const items = sortNotifications(state.items);
1868
- const unread = unreadCount(items);
1869
- const pages = Math.max(1, Math.ceil(items.length / 20));
1870
- const visible = items.slice(page * 20, page * 20 + 20);
1871
- (0, react.useEffect)(() => {
1872
- if (page >= pages) setPage(pages - 1);
1873
- }, [page, pages]);
1874
- (0, react.useEffect)(() => {
1875
- loadNotifications();
1876
- }, []);
1877
- const openOne = (item) => {
1878
- markRead([item.id]);
1879
- setOpen(false);
1880
- onOpen?.(item);
1881
- };
1882
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
1883
- type: "button",
1884
- className: NotificationBell_module_css_default.bell,
1885
- "aria-label": unread === 0 ? label : label + "," + String(unread) + " 条未读",
1886
- title: label,
1887
- "data-notification-bell": "",
1888
- "data-unread": unread,
1889
- onClick: () => {
1890
- setOpen(true);
1891
- setPage(0);
1892
- loadNotifications();
1893
- },
1894
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
1895
- width: "16",
1896
- height: "16",
1897
- viewBox: "0 0 16 16",
1898
- fill: "none",
1899
- "aria-hidden": "true",
1900
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
1901
- d: "M8 2.2a4.1 4.1 0 0 0-4.1 4.1v2.3L2.7 10.8a.6.6 0 0 0 .5.9h9.6a.6.6 0 0 0 .5-.9L12.1 8.6V6.3A4.1 4.1 0 0 0 8 2.2Z",
1902
- stroke: "currentColor",
1903
- strokeWidth: "1.2",
1904
- strokeLinejoin: "round"
1905
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
1906
- d: "M6.4 13.2a1.7 1.7 0 0 0 3.2 0",
1907
- stroke: "currentColor",
1908
- strokeWidth: "1.2",
1909
- strokeLinecap: "round"
1910
- })]
1911
- }), unread === 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1912
- className: NotificationBell_module_css_default.badge,
1913
- children: unread > 99 ? "99+" : unread
1914
- })]
1915
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_deepseek_ai_dsh_client_ui_primitives.Modal, {
1916
- open,
1917
- onClose: () => {
1918
- setOpen(false);
1919
- },
1920
- title: label,
1921
- closeLabel: "关闭",
1922
- className: NotificationBell_module_css_default.dialog,
1923
- footer: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1924
- className: NotificationBell_module_css_default.actions,
1925
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
1926
- type: "button",
1927
- className: NotificationBell_module_css_default.linkButton,
1928
- onClick: () => {
1929
- markRead("all");
1930
- },
1931
- children: "全部已读"
1932
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
1933
- type: "button",
1934
- className: NotificationBell_module_css_default.button,
1935
- onClick: () => {
1936
- setOpen(false);
1937
- },
1938
- children: "关闭"
1939
- })]
1940
- }),
1847
+ /** The AI report block inside the audit dialog. */
1848
+ function RiskReportView({ report, busy, failed, onScan, t }) {
1849
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
1850
+ className: SkillPlazaSection_module_css_default.risk,
1941
1851
  children: [
1942
- reviewDemoMode() ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
1943
- className: NotificationBell_module_css_default.demo,
1944
- children: "演示数据 · 后端契约到达后自动切换"
1945
- }) : null,
1946
- state.status === "unavailable" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
1947
- className: NotificationBell_module_css_default.empty,
1948
- children: "通知服务待后端联调(task-35);上线后这里会显示审核、上架与 AI 报告事件。"
1949
- }) : null,
1950
- state.status !== "unavailable" && items.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
1951
- className: NotificationBell_module_css_default.empty,
1952
- children: "暂无通知。"
1852
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1853
+ className: SkillPlazaSection_module_css_default.riskHead,
1854
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: t("plazaRiskTitle") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
1855
+ variant: "outline",
1856
+ size: "sm",
1857
+ disabled: busy,
1858
+ onClick: onScan,
1859
+ children: busy ? t("plazaRiskScanning") : t("plazaRiskScan")
1860
+ })]
1861
+ }),
1862
+ failed ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
1863
+ className: SkillPlazaSection_module_css_default.riskFailed,
1864
+ children: t("plazaRiskFailed")
1953
1865
  }) : null,
1954
- items.length === 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
1955
- className: NotificationBell_module_css_default.list,
1956
- children: visible.map((item) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
1957
- type: "button",
1958
- className: NotificationBell_module_css_default.row,
1959
- onClick: () => {
1960
- openOne(item);
1961
- },
1866
+ report === null ? busy ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
1867
+ className: SkillPlazaSection_module_css_default.riskEmpty,
1868
+ children: t("plazaRiskNone")
1869
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1870
+ className: SkillPlazaSection_module_css_default.riskSummary,
1871
+ children: [
1872
+ report.score === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
1873
+ className: SkillPlazaSection_module_css_default.riskScore,
1874
+ children: [
1875
+ t("plazaRiskScore"),
1876
+ " ",
1877
+ report.score
1878
+ ]
1879
+ }),
1880
+ report.severity === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1881
+ className: SkillPlazaSection_module_css_default.severity,
1882
+ "data-severity": report.severity,
1883
+ children: report.severity
1884
+ }),
1885
+ report.summary === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: report.summary })
1886
+ ]
1887
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
1888
+ className: SkillPlazaSection_module_css_default.findings,
1889
+ children: report.findings.map((finding, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
1890
+ className: SkillPlazaSection_module_css_default.finding,
1962
1891
  children: [
1963
1892
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1964
- className: NotificationBell_module_css_default.rowIcon,
1965
- "data-tone": notificationTone(item.type),
1966
- "aria-hidden": "true",
1967
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(NotificationIcon, { tone: notificationTone(item.type) })
1893
+ className: SkillPlazaSection_module_css_default.severity,
1894
+ "data-severity": finding.severity,
1895
+ children: finding.severity
1968
1896
  }),
1969
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
1970
- className: NotificationBell_module_css_default.rowBody,
1971
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1972
- className: NotificationBell_module_css_default.rowTitle,
1973
- children: item.title
1974
- }), item.body === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1975
- className: NotificationBell_module_css_default.rowText,
1976
- children: item.body
1977
- })]
1897
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: finding.category }),
1898
+ finding.evidence === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1899
+ className: SkillPlazaSection_module_css_default.findingText,
1900
+ children: finding.evidence
1978
1901
  }),
1979
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
1980
- className: NotificationBell_module_css_default.rowMeta,
1981
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1982
- className: NotificationBell_module_css_default.rowTime,
1983
- children: item.createdAt.slice(0, 16).replace("T", " ")
1984
- }), item.read ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1985
- className: NotificationBell_module_css_default.dot,
1986
- "aria-hidden": "true"
1987
- })]
1902
+ finding.recommendation === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1903
+ className: SkillPlazaSection_module_css_default.findingHint,
1904
+ children: finding.recommendation
1988
1905
  })
1989
1906
  ]
1990
- }) }, item.id))
1991
- }),
1992
- items.length === 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1993
- className: NotificationBell_module_css_default.pager,
1994
- children: [
1995
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
1996
- type: "button",
1997
- disabled: page === 0,
1998
- onClick: () => {
1999
- setPage((current) => Math.max(0, current - 1));
2000
- },
2001
- children: "上一页"
2002
- }),
2003
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { children: [
2004
- "第 ",
2005
- page + 1,
2006
- " / ",
2007
- pages,
2008
- " 页 · 共 ",
2009
- items.length,
2010
- " 条"
2011
- ] }),
2012
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
2013
- type: "button",
2014
- disabled: page >= pages - 1,
2015
- onClick: () => {
2016
- setPage((current) => Math.min(pages - 1, current + 1));
2017
- },
2018
- children: "下一页"
2019
- })
2020
- ]
2021
- })
1907
+ }, String(index)))
1908
+ })] })
2022
1909
  ]
2023
- })] });
2024
- }
2025
- /** The automation page's seat: the same inbox under the workflow plaza's heading. */
2026
- function WorkflowPlazaBell() {
2027
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(NotificationBell, { label: "自动化任务通知" });
2028
- }
2029
- //#endregion
2030
- //#region \0dsh-css:/root/projects/dsh-plugins-plus/packages/dataops-managed/src/client/SkillPlazaSection.module.css.mjs
2031
- const css$3 = "._9FdZvq_section{box-sizing:border-box;flex-direction:column;width:100%;max-width:960px;margin:0 auto;display:flex}._9FdZvq_head{flex-direction:column;margin-bottom:8px;display:flex}._9FdZvq_title{color:var(--dsw-alias-label-primary);align-items:baseline;gap:8px;margin:0;font-size:14px;font-weight:500;line-height:20px;display:flex}._9FdZvq_titleCount{color:var(--dsw-alias-label-tertiary);font-size:12px;font-weight:400}._9FdZvq_status{text-align:center;color:var(--dsw-alias-label-tertiary);margin:0;padding:20px 0;font-size:13px;line-height:20px}._9FdZvq_departmentBar{align-items:center;gap:8px;margin-bottom:10px;display:inline-flex}._9FdZvq_departmentLabel{color:var(--dsw-alias-label-secondary);font-size:12px;line-height:18px}._9FdZvq_departmentSelect{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-1);height:28px;color:var(--dsw-alias-label-primary);font:inherit;border-radius:8px;padding:0 8px;font-size:12px;line-height:18px}._9FdZvq_departmentSelect:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:1px}._9FdZvq_notice{color:var(--dsw-alias-state-business-primary);margin:4px 0 0;font-size:12px;line-height:18px}._9FdZvq_cards{grid-template-columns:repeat(auto-fill,minmax(272px,1fr));grid-auto-rows:max-content;align-content:start;align-items:stretch;gap:12px;margin:0;padding:0;list-style:none;display:grid}._9FdZvq_card{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-1);border-radius:10px;flex-direction:column;align-self:stretch;gap:10px;min-width:0;height:auto;padding:12px;display:flex}._9FdZvq_cardTop{justify-content:space-between;align-items:center;gap:10px;min-height:28px;display:flex}._9FdZvq_cardIcon{background:var(--dsw-alias-bg-layer-2);width:28px;height:28px;color:var(--dsw-alias-label-secondary);border-radius:50%;flex:none;place-items:center;display:grid}._9FdZvq_cardTitle{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;font-size:14px;font-weight:600;line-height:20px;overflow:hidden}._9FdZvq_mine{flex:none}._9FdZvq_cardDesc{min-height:36px;color:var(--dsw-alias-label-secondary);-webkit-line-clamp:2;-webkit-box-orient:vertical;font-size:12px;line-height:18px;display:-webkit-box;overflow:hidden}._9FdZvq_cardMarks{flex-wrap:wrap;align-content:flex-start;gap:6px;min-height:20px;display:flex}._9FdZvq_mark{background:color-mix(in srgb, var(--dsw-alias-state-business-primary) 14%, var(--dsw-alias-bg-layer-1));color:var(--dsw-alias-state-business-primary);white-space:nowrap;border:0;border-radius:4px;padding:2px 7px;font-size:11px;font-weight:500;line-height:16px}._9FdZvq_cardEnd{flex:none;align-items:center;gap:4px;margin-top:auto;padding-top:4px;display:flex}._9FdZvq_detailButton{margin-left:auto}._9FdZvq_detail{flex-direction:column;gap:12px;margin:0;display:flex}._9FdZvq_dialog{width:min(560px,100%)}._9FdZvq_detailRow{flex-direction:column;gap:2px;display:flex}._9FdZvq_detailLabel{color:var(--dsw-alias-label-caption);font-size:11px;line-height:16px}._9FdZvq_detailValue{max-height:160px;color:var(--dsw-alias-label-secondary);white-space:pre-wrap;overflow-wrap:anywhere;margin:0;font-size:12px;line-height:18px;overflow:auto}._9FdZvq_empty{text-align:center;flex-direction:column;align-items:center;gap:10px;padding:28px 16px 32px;display:flex}._9FdZvq_emptyIcon{border:.5px solid var(--dsw-alias-border-l3);width:56px;height:56px;color:var(--dsw-alias-label-tertiary);border-radius:14px;justify-content:center;align-items:center;display:inline-flex}._9FdZvq_emptyText{color:var(--dsw-alias-label-tertiary);margin:0;font-size:13px;line-height:20px}._9FdZvq_headRow{align-items:center;gap:6px;display:flex}._9FdZvq_headRow ._9FdZvq_title{flex:none}._9FdZvq_demoTag{background:var(--dsw-alias-state-warn-secondary);color:var(--dsw-alias-state-warn-primary);border-radius:4px;padding:1px 6px;font-size:10px;line-height:16px}._9FdZvq_tabs{border-bottom:1px solid var(--dsw-alias-border-l1);align-items:center;gap:2px;margin-bottom:8px;display:flex}._9FdZvq_tab{height:30px;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:0;border-bottom:2px solid #0000;align-items:center;gap:5px;padding:0 9px;font-size:12px;display:inline-flex}._9FdZvq_tab:hover{color:var(--dsw-alias-label-primary)}._9FdZvq_tabActive{color:var(--dsw-alias-state-business-primary);border-bottom-color:var(--dsw-alias-state-business-primary);font-weight:500}._9FdZvq_tabCount{background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-tertiary);border-radius:7px;padding:0 4px;font-size:10px;line-height:14px}._9FdZvq_tagTop{text-overflow:ellipsis;white-space:nowrap;border:1px solid var(--dsw-alias-border-l2);max-width:40%;color:var(--dsw-alias-label-secondary);border-radius:4px;flex:none;padding:1px 6px;font-size:10px;line-height:16px;overflow:hidden}._9FdZvq_sharedTag{color:#fff;background:#0e6b3a;border-radius:4px;padding:2px 7px;font-size:11px;font-weight:600;line-height:16px}._9FdZvq_pendingTag{color:#fff;background:#7a4a00;border-radius:4px;padding:2px 7px;font-size:11px;font-weight:600;line-height:16px}._9FdZvq_rejectedTag{color:#fff;background:#a8231b;border-radius:4px;padding:2px 7px;font-size:11px;font-weight:600;line-height:16px}._9FdZvq_reviewButton{margin-left:auto}._9FdZvq_reviewNote{border-left:3px solid var(--dsw-alias-state-error-primary);background:color-mix(in srgb, var(--dsw-alias-state-error-primary) 10%, var(--dsw-alias-bg-layer-1));color:var(--dsw-alias-label-primary);margin:0;padding:6px 8px;font-size:11px;line-height:16px}._9FdZvq_auditDialog{width:min(640px,100vw - 32px)}._9FdZvq_audit{flex-direction:column;gap:14px;display:flex}._9FdZvq_auditFooter{justify-content:flex-end;gap:6px;display:flex}._9FdZvq_risk{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);border-radius:6px;flex-direction:column;gap:8px;padding:10px;display:flex}._9FdZvq_riskHead{justify-content:space-between;align-items:center;gap:8px;font-size:12px;display:flex}._9FdZvq_riskEmpty,._9FdZvq_riskFailed{color:var(--dsw-alias-label-tertiary);margin:0;font-size:11px;line-height:16px}._9FdZvq_riskFailed{color:var(--dsw-alias-state-error-primary)}._9FdZvq_riskSummary{color:var(--dsw-alias-label-secondary);flex-wrap:wrap;align-items:center;gap:6px;font-size:12px;line-height:18px;display:flex}._9FdZvq_riskScore{color:var(--dsw-alias-label-primary);font-weight:600}._9FdZvq_severity{background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-secondary);text-transform:uppercase;border-radius:3px;padding:0 5px;font-size:10px;line-height:16px}._9FdZvq_severity[data-severity=high],._9FdZvq_severity[data-severity=critical]{background:var(--dsw-alias-state-error-secondary);color:var(--dsw-alias-state-error-primary)}._9FdZvq_severity[data-severity=medium]{background:var(--dsw-alias-state-warn-secondary);color:var(--dsw-alias-state-warn-primary)}._9FdZvq_findings{flex-direction:column;gap:6px;margin:0;padding:0;list-style:none;display:flex}._9FdZvq_finding{flex-wrap:wrap;align-items:baseline;gap:5px;font-size:11px;line-height:16px;display:flex}._9FdZvq_findingText{color:var(--dsw-alias-label-secondary);flex-basis:100%}._9FdZvq_findingHint{color:var(--dsw-alias-label-tertiary);flex-basis:100%}._9FdZvq_noteField{color:var(--dsw-alias-label-secondary);flex-direction:column;gap:5px;font-size:12px;display:flex}._9FdZvq_noteField textarea{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-base);min-height:64px;color:var(--dsw-alias-label-primary);font:inherit;resize:vertical;border-radius:5px;padding:7px 9px}._9FdZvq_reviewError{color:var(--dsw-alias-state-error-primary);margin:0;font-size:11px}";
2032
- const tagId$3 = "@sparkelf/dsh-dataops-managed/SkillPlazaSection.module.css";
2033
- if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$3) + "]") === null) {
2034
- const tag = document.createElement("style");
2035
- tag.dataset.plugin = "@sparkelf/dsh-dataops-managed";
2036
- tag.dataset.pluginCss = tagId$3;
2037
- tag.textContent = css$3;
2038
- document.head.appendChild(tag);
2039
- }
2040
- var SkillPlazaSection_module_css_default = {
2041
- "findings": "_9FdZvq_findings",
2042
- "detailValue": "_9FdZvq_detailValue",
2043
- "reviewError": "_9FdZvq_reviewError",
2044
- "detailRow": "_9FdZvq_detailRow",
2045
- "notice": "_9FdZvq_notice",
2046
- "detail": "_9FdZvq_detail",
2047
- "dialog": "_9FdZvq_dialog",
2048
- "departmentLabel": "_9FdZvq_departmentLabel",
2049
- "emptyIcon": "_9FdZvq_emptyIcon",
2050
- "cardMarks": "_9FdZvq_cardMarks",
2051
- "detailButton": "_9FdZvq_detailButton",
2052
- "emptyText": "_9FdZvq_emptyText",
2053
- "cardIcon": "_9FdZvq_cardIcon",
2054
- "titleCount": "_9FdZvq_titleCount",
2055
- "detailLabel": "_9FdZvq_detailLabel",
2056
- "tab": "_9FdZvq_tab",
2057
- "cardEnd": "_9FdZvq_cardEnd",
2058
- "tabActive": "_9FdZvq_tabActive",
2059
- "tabCount": "_9FdZvq_tabCount",
2060
- "tagTop": "_9FdZvq_tagTop",
2061
- "card": "_9FdZvq_card",
2062
- "reviewNote": "_9FdZvq_reviewNote",
2063
- "auditDialog": "_9FdZvq_auditDialog",
2064
- "departmentBar": "_9FdZvq_departmentBar",
2065
- "pendingTag": "_9FdZvq_pendingTag",
2066
- "audit": "_9FdZvq_audit",
2067
- "riskEmpty": "_9FdZvq_riskEmpty",
2068
- "cardTop": "_9FdZvq_cardTop",
2069
- "tabs": "_9FdZvq_tabs",
2070
- "riskScore": "_9FdZvq_riskScore",
2071
- "finding": "_9FdZvq_finding",
2072
- "findingText": "_9FdZvq_findingText",
2073
- "findingHint": "_9FdZvq_findingHint",
2074
- "reviewButton": "_9FdZvq_reviewButton",
2075
- "status": "_9FdZvq_status",
2076
- "rejectedTag": "_9FdZvq_rejectedTag",
2077
- "mark": "_9FdZvq_mark",
2078
- "head": "_9FdZvq_head",
2079
- "riskHead": "_9FdZvq_riskHead",
2080
- "cardDesc": "_9FdZvq_cardDesc",
2081
- "sharedTag": "_9FdZvq_sharedTag",
2082
- "headRow": "_9FdZvq_headRow",
2083
- "riskFailed": "_9FdZvq_riskFailed",
2084
- "departmentSelect": "_9FdZvq_departmentSelect",
2085
- "mine": "_9FdZvq_mine",
2086
- "demoTag": "_9FdZvq_demoTag",
2087
- "risk": "_9FdZvq_risk",
2088
- "title": "_9FdZvq_title",
2089
- "auditFooter": "_9FdZvq_auditFooter",
2090
- "cardTitle": "_9FdZvq_cardTitle",
2091
- "cards": "_9FdZvq_cards",
2092
- "empty": "_9FdZvq_empty",
2093
- "riskSummary": "_9FdZvq_riskSummary",
2094
- "section": "_9FdZvq_section",
2095
- "severity": "_9FdZvq_severity",
2096
- "noteField": "_9FdZvq_noteField"
2097
- };
2098
- //#endregion
2099
- //#region src/client/SkillPlazaSection.tsx
2100
- /** Tab counts from the same visible rows the cards render. */
2101
- function countsOf(skills) {
2102
- const counted = reviewCounts(skills);
2103
- return {
2104
- approved: counted.approved,
2105
- pending: counted.pending,
2106
- rejected: skills.filter((row) => row.reviewStatus === "rejected").length,
2107
- total: counted.all
2108
- };
2109
- }
2110
- /**
2111
- * The department a plaza row belongs to.
2112
- *
2113
- * The backend normally sends `departmentCode`; a legacy row may carry only a name or path, so the
2114
- * fallbacks keep those rows selectable instead of dropping them into an empty key.
2115
- * @param skill - one plaza row.
2116
- * @returns the code, the name, or the deepest path name; empty when the row says nothing.
2117
- */
2118
- function departmentKeyOf(skill) {
2119
- return skill.departmentCode ?? skill.departmentName ?? skill.departmentPath?.at(-1)?.name ?? "";
2120
- }
2121
- /**
2122
- * The department choices present in the visible rows.
2123
- *
2124
- * The label falls back from the row's own name to the deepest path name and finally to the code,
2125
- * so a department the backend can no longer name still renders as a readable option.
2126
- * @param skills - every row the current query returned.
2127
- * @returns distinct departments, sorted by label.
2128
- */
2129
- function departmentOptionsOf(skills) {
2130
- const options = /* @__PURE__ */ new Map();
2131
- for (const skill of skills) {
2132
- if (normalizeVisibility(skill.visibility) !== "department") continue;
2133
- const code = departmentKeyOf(skill);
2134
- if (code === "" || options.has(code)) continue;
2135
- options.set(code, skill.departmentName ?? skill.departmentPath?.at(-1)?.name ?? code);
2136
- }
2137
- return [...options].map(([code, name]) => ({
2138
- code,
2139
- name
2140
- })).sort((left, right) => left.name.localeCompare(right.name, "zh-Hans-CN"));
2141
- }
2142
- /**
2143
- * The rows the department tab shows.
2144
- * @param skills - every row the current query returned.
2145
- * @param code - selected department key, or an empty string for all of them.
2146
- * @returns the department-shared rows, narrowed to `code` when it is set.
2147
- */
2148
- function filterByDepartment(skills, code) {
2149
- const shared = skills.filter((skill) => normalizeVisibility(skill.visibility) === "department");
2150
- return code === "" ? shared : shared.filter((skill) => departmentKeyOf(skill) === code);
2151
- }
2152
- /** One skill as a card in the plaza grid. */
2153
- function PlazaCard({ skill, busy, canAudit, onInstall, onUnshare, onReview, t }) {
2154
- const [open, setOpen] = (0, react.useState)(false);
2155
- const status = normalizeReviewStatus(skill.reviewStatus);
2156
- const tag = visibilityTag(skill);
2157
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
2158
- className: SkillPlazaSection_module_css_default.card,
2159
- "data-review-status": status,
2160
- children: [
2161
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
2162
- className: SkillPlazaSection_module_css_default.cardTop,
2163
- children: [
2164
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
2165
- className: SkillPlazaSection_module_css_default.cardIcon,
2166
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconSkillOutlineRegular, { size: 16 })
2167
- }),
2168
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
2169
- className: SkillPlazaSection_module_css_default.cardTitle,
2170
- children: skill.name
2171
- }),
2172
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
2173
- className: SkillPlazaSection_module_css_default.tagTop,
2174
- title: tag.detail,
2175
- children: tag.label
2176
- })
2177
- ]
2178
- }),
2179
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
2180
- className: SkillPlazaSection_module_css_default.cardMarks,
2181
- children: [
2182
- skill.sharedByMe ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
2183
- className: SkillPlazaSection_module_css_default.sharedTag,
2184
- children: t("plazaSharedTag")
2185
- }) : null,
2186
- status === "pending" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
2187
- className: SkillPlazaSection_module_css_default.pendingTag,
2188
- children: t("plazaTabPending")
2189
- }) : null,
2190
- status === "rejected" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
2191
- className: SkillPlazaSection_module_css_default.rejectedTag,
2192
- children: t("plazaReject")
2193
- }) : null,
2194
- skill.tags.map((item) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
2195
- className: SkillPlazaSection_module_css_default.mark,
2196
- children: item
2197
- }, item))
2198
- ]
2199
- }),
2200
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
2201
- className: SkillPlazaSection_module_css_default.cardDesc,
2202
- children: skill.description ?? ""
2203
- }),
2204
- status === "rejected" && skill.reviewNote !== null && skill.reviewNote !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
2205
- className: SkillPlazaSection_module_css_default.reviewNote,
2206
- children: skill.reviewNote
2207
- }) : null,
2208
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
2209
- className: SkillPlazaSection_module_css_default.cardEnd,
2210
- children: [
2211
- canAudit && status === "pending" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
2212
- variant: "outline",
2213
- size: "sm",
2214
- className: SkillPlazaSection_module_css_default.reviewButton,
2215
- onClick: onReview,
2216
- children: t("plazaReview")
2217
- }) : null,
2218
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
2219
- variant: "outline",
2220
- size: "sm",
2221
- icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconDownloadOutlineRegular, { size: 16 }),
2222
- disabled: busy,
2223
- onClick: onInstall,
2224
- children: t("plazaInstall")
2225
- }),
2226
- skill.sharedByMe ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
2227
- variant: "ghost",
2228
- size: "sm",
2229
- icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconTrashOutlineRegular, { size: 16 }),
2230
- disabled: busy,
2231
- onClick: onUnshare,
2232
- children: t("plazaUnshare")
2233
- }) : null,
2234
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
2235
- variant: "outline",
2236
- size: "sm",
2237
- className: SkillPlazaSection_module_css_default.detailButton,
2238
- onClick: () => {
2239
- setOpen(true);
2240
- },
2241
- children: t("plazaShowDetail")
2242
- })
2243
- ]
2244
- }),
2245
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Modal, {
2246
- open,
2247
- onClose: () => {
2248
- setOpen(false);
2249
- },
2250
- title: skill.name,
2251
- closeLabel: t("plazaClose"),
2252
- className: SkillPlazaSection_module_css_default.dialog,
2253
- footer: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
2254
- variant: "outline",
2255
- onClick: () => {
2256
- setOpen(false);
2257
- },
2258
- children: t("plazaClose")
2259
- }),
2260
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("dl", {
2261
- className: SkillPlazaSection_module_css_default.detail,
2262
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
2263
- className: SkillPlazaSection_module_css_default.detailRow,
2264
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("dt", {
2265
- className: SkillPlazaSection_module_css_default.detailLabel,
2266
- children: t("plazaDetailUpdated")
2267
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dd", {
2268
- className: SkillPlazaSection_module_css_default.detailValue,
2269
- children: skill.updatedAt
2270
- })]
2271
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
2272
- className: SkillPlazaSection_module_css_default.detailRow,
2273
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("dt", {
2274
- className: SkillPlazaSection_module_css_default.detailLabel,
2275
- children: t("plazaDetailBody")
2276
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dd", {
2277
- className: SkillPlazaSection_module_css_default.detailValue,
2278
- children: skill.instruction
2279
- })]
2280
- })]
2281
- })
2282
- })
2283
- ]
2284
- });
2285
- }
2286
- /** The AI report block inside the audit dialog. */
2287
- function RiskReportView({ report, busy, failed, onScan, t }) {
2288
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
2289
- className: SkillPlazaSection_module_css_default.risk,
2290
- children: [
2291
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
2292
- className: SkillPlazaSection_module_css_default.riskHead,
2293
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: t("plazaRiskTitle") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
2294
- variant: "outline",
2295
- size: "sm",
2296
- disabled: busy,
2297
- onClick: onScan,
2298
- children: busy ? t("plazaRiskScanning") : t("plazaRiskScan")
2299
- })]
2300
- }),
2301
- failed ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
2302
- className: SkillPlazaSection_module_css_default.riskFailed,
2303
- children: t("plazaRiskFailed")
2304
- }) : null,
2305
- report === null ? busy ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
2306
- className: SkillPlazaSection_module_css_default.riskEmpty,
2307
- children: t("plazaRiskNone")
2308
- }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
2309
- className: SkillPlazaSection_module_css_default.riskSummary,
2310
- children: [
2311
- report.score === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
2312
- className: SkillPlazaSection_module_css_default.riskScore,
2313
- children: [
2314
- t("plazaRiskScore"),
2315
- " ",
2316
- report.score
2317
- ]
2318
- }),
2319
- report.severity === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
2320
- className: SkillPlazaSection_module_css_default.severity,
2321
- "data-severity": report.severity,
2322
- children: report.severity
2323
- }),
2324
- report.summary === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: report.summary })
2325
- ]
2326
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
2327
- className: SkillPlazaSection_module_css_default.findings,
2328
- children: report.findings.map((finding, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
2329
- className: SkillPlazaSection_module_css_default.finding,
2330
- children: [
2331
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
2332
- className: SkillPlazaSection_module_css_default.severity,
2333
- "data-severity": finding.severity,
2334
- children: finding.severity
2335
- }),
2336
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: finding.category }),
2337
- finding.evidence === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
2338
- className: SkillPlazaSection_module_css_default.findingText,
2339
- children: finding.evidence
2340
- }),
2341
- finding.recommendation === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
2342
- className: SkillPlazaSection_module_css_default.findingHint,
2343
- children: finding.recommendation
2344
- })
2345
- ]
2346
- }, String(index)))
2347
- })] })
2348
- ]
2349
- });
1910
+ });
2350
1911
  }
2351
1912
  /**
2352
1913
  * Browse, share, and install skills other users published.
@@ -2485,28 +2046,18 @@ window.__ModuleLoader__.load({
2485
2046
  if (state.kind === "loading") return null;
2486
2047
  const head = (count) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
2487
2048
  className: SkillPlazaSection_module_css_default.head,
2488
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
2489
- className: SkillPlazaSection_module_css_default.headRow,
2490
- children: [
2491
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("h2", {
2492
- className: SkillPlazaSection_module_css_default.title,
2493
- children: [t("plazaTitle"), count === null ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
2494
- className: SkillPlazaSection_module_css_default.titleCount,
2495
- children: count
2496
- })]
2497
- }),
2498
- reviewDemoMode() ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
2499
- className: SkillPlazaSection_module_css_default.demoTag,
2500
- children: t("plazaDemo")
2501
- }) : null,
2502
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(NotificationBell, {
2503
- label: t("plazaTitle") + "通知",
2504
- onOpen: (item) => {
2505
- const next = notificationTab(item);
2506
- if (next !== void 0) setTab(next);
2507
- }
2508
- })
2509
- ]
2049
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
2050
+ className: SkillPlazaSection_module_css_default.headRow,
2051
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("h2", {
2052
+ className: SkillPlazaSection_module_css_default.title,
2053
+ children: [t("plazaTitle"), count === null ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
2054
+ className: SkillPlazaSection_module_css_default.titleCount,
2055
+ children: count
2056
+ })]
2057
+ }), reviewDemoMode() ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
2058
+ className: SkillPlazaSection_module_css_default.demoTag,
2059
+ children: t("plazaDemo")
2060
+ }) : null]
2510
2061
  })
2511
2062
  });
2512
2063
  if (state.kind === "unavailable") return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
@@ -2748,29 +2299,29 @@ window.__ModuleLoader__.load({
2748
2299
  }
2749
2300
  //#endregion
2750
2301
  //#region \0dsh-css:/root/projects/dsh-plugins-plus/packages/dataops-managed/src/client/WanxiangBrand.module.css.mjs
2751
- const css$2 = ".s0HPxG_mark{color:inherit;flex:none;display:block;overflow:visible}.s0HPxG_animatedMark{cursor:pointer}.s0HPxG_mark g{transform-box:fill-box;transform-origin:50%}.s0HPxG_sidebarName{min-width:0;height:24px;color:inherit;align-items:center;gap:6px;display:inline-flex}.s0HPxG_sidebarName>:first-child{flex:0 auto;min-width:0;max-width:102px}.s0HPxG_wordmark{letter-spacing:.01em;white-space:nowrap;text-overflow:ellipsis;font-family:PingFang SC,HarmonyOS Sans SC,Microsoft YaHei,Noto Sans CJK SC,Source Han Sans SC,sans-serif;font-weight:600;line-height:1;display:block;overflow:hidden}.s0HPxG_harness{flex:none;display:block;overflow:visible}@keyframes s0HPxG_unit-top{0%,to{transform:translate(0)}50%{transform:translateY(-2px)}}@keyframes s0HPxG_unit-left{0%,to{transform:translate(0)}50%{transform:translate(-2px,1px)}}@keyframes s0HPxG_unit-right{0%,to{transform:translate(0)}50%{transform:translate(2px,1px)}}@keyframes s0HPxG_unit-core{0%,to{transform:translate(0)}50%{transform:translateY(2px)}}@media (hover:hover) and (prefers-reduced-motion:no-preference){.s0HPxG_animatedMark:hover .s0HPxG_unitTop{animation:1.6s ease-in-out infinite s0HPxG_unit-top}.s0HPxG_animatedMark:hover .s0HPxG_unitLeft{animation:1.6s ease-in-out infinite s0HPxG_unit-left}.s0HPxG_animatedMark:hover .s0HPxG_unitRight{animation:1.6s ease-in-out infinite s0HPxG_unit-right}.s0HPxG_animatedMark:hover .s0HPxG_unitCore{animation:1.6s ease-in-out infinite s0HPxG_unit-core}}@media (prefers-reduced-motion:reduce){.s0HPxG_animatedMark,.s0HPxG_animatedMark g{animation:none!important;transform:none!important}}";
2752
- const tagId$2 = "@sparkelf/dsh-dataops-managed/WanxiangBrand.module.css";
2753
- if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$2) + "]") === null) {
2302
+ const css$3 = ".s0HPxG_mark{color:inherit;flex:none;display:block;overflow:visible}.s0HPxG_animatedMark{cursor:pointer}.s0HPxG_mark g{transform-box:fill-box;transform-origin:50%}.s0HPxG_sidebarName{min-width:0;height:24px;color:inherit;align-items:center;gap:6px;display:inline-flex}.s0HPxG_sidebarName>:first-child{flex:0 auto;min-width:0;max-width:102px}.s0HPxG_wordmark{letter-spacing:.01em;white-space:nowrap;text-overflow:ellipsis;font-family:PingFang SC,HarmonyOS Sans SC,Microsoft YaHei,Noto Sans CJK SC,Source Han Sans SC,sans-serif;font-weight:600;line-height:1;display:block;overflow:hidden}.s0HPxG_harness{flex:none;display:block;overflow:visible}@keyframes s0HPxG_unit-top{0%,to{transform:translate(0)}50%{transform:translateY(-2px)}}@keyframes s0HPxG_unit-left{0%,to{transform:translate(0)}50%{transform:translate(-2px,1px)}}@keyframes s0HPxG_unit-right{0%,to{transform:translate(0)}50%{transform:translate(2px,1px)}}@keyframes s0HPxG_unit-core{0%,to{transform:translate(0)}50%{transform:translateY(2px)}}@media (hover:hover) and (prefers-reduced-motion:no-preference){.s0HPxG_animatedMark:hover .s0HPxG_unitTop{animation:1.6s ease-in-out infinite s0HPxG_unit-top}.s0HPxG_animatedMark:hover .s0HPxG_unitLeft{animation:1.6s ease-in-out infinite s0HPxG_unit-left}.s0HPxG_animatedMark:hover .s0HPxG_unitRight{animation:1.6s ease-in-out infinite s0HPxG_unit-right}.s0HPxG_animatedMark:hover .s0HPxG_unitCore{animation:1.6s ease-in-out infinite s0HPxG_unit-core}}@media (prefers-reduced-motion:reduce){.s0HPxG_animatedMark,.s0HPxG_animatedMark g{animation:none!important;transform:none!important}}";
2303
+ const tagId$3 = "@sparkelf/dsh-dataops-managed/WanxiangBrand.module.css";
2304
+ if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$3) + "]") === null) {
2754
2305
  const tag = document.createElement("style");
2755
2306
  tag.dataset.plugin = "@sparkelf/dsh-dataops-managed";
2756
- tag.dataset.pluginCss = tagId$2;
2757
- tag.textContent = css$2;
2307
+ tag.dataset.pluginCss = tagId$3;
2308
+ tag.textContent = css$3;
2758
2309
  document.head.appendChild(tag);
2759
2310
  }
2760
2311
  var WanxiangBrand_module_css_default = {
2761
- "unit-core": "s0HPxG_unit-core",
2762
- "mark": "s0HPxG_mark",
2763
- "unitCore": "s0HPxG_unitCore",
2764
2312
  "animatedMark": "s0HPxG_animatedMark",
2765
- "harness": "s0HPxG_harness",
2766
- "unitRight": "s0HPxG_unitRight",
2767
- "unit-left": "s0HPxG_unit-left",
2768
- "wordmark": "s0HPxG_wordmark",
2769
- "sidebarName": "s0HPxG_sidebarName",
2770
2313
  "unit-top": "s0HPxG_unit-top",
2771
- "unit-right": "s0HPxG_unit-right",
2772
2314
  "unitTop": "s0HPxG_unitTop",
2773
- "unitLeft": "s0HPxG_unitLeft"
2315
+ "unit-left": "s0HPxG_unit-left",
2316
+ "unitRight": "s0HPxG_unitRight",
2317
+ "harness": "s0HPxG_harness",
2318
+ "unitLeft": "s0HPxG_unitLeft",
2319
+ "unit-right": "s0HPxG_unit-right",
2320
+ "unitCore": "s0HPxG_unitCore",
2321
+ "wordmark": "s0HPxG_wordmark",
2322
+ "mark": "s0HPxG_mark",
2323
+ "unit-core": "s0HPxG_unit-core",
2324
+ "sidebarName": "s0HPxG_sidebarName"
2774
2325
  };
2775
2326
  //#endregion
2776
2327
  //#region src/client/WanxiangBrand.tsx
@@ -3177,102 +2728,102 @@ window.__ModuleLoader__.load({
3177
2728
  }
3178
2729
  //#endregion
3179
2730
  //#region \0dsh-css:/root/projects/dsh-plugins-plus/packages/dataops-managed/src/client/PermissionCenterSection.module.css.mjs
3180
- const css$1 = ".PNbOqW_page{box-sizing:border-box;flex-direction:column;gap:14px;width:100%;max-width:clamp(1000px,60vw,1200px);min-height:0;margin:0 auto;padding:24px;display:flex}.PNbOqW_head{justify-content:space-between;align-items:center;gap:12px;display:flex}.PNbOqW_headText{min-width:0}.PNbOqW_headActions{flex:none;align-items:center;gap:8px;display:flex}.PNbOqW_title{color:var(--dsw-alias-label-primary);margin:0;font-size:20px;font-weight:600;line-height:28px}.PNbOqW_subtitle{color:var(--dsw-alias-label-tertiary);align-items:center;gap:6px;margin:3px 0 0;font-size:12px;display:flex}.PNbOqW_demo{color:#9a5b00;background:#fff3e0;border-radius:4px;padding:1px 6px;font-size:10px;line-height:16px}.PNbOqW_tabs{border-bottom:1px solid var(--dsw-alias-border-l1);scrollbar-width:none;flex-wrap:nowrap;align-items:center;gap:0;display:flex;overflow:auto hidden}.PNbOqW_tabs::-webkit-scrollbar{display:none}.PNbOqW_tabGroup{flex:none;align-items:center;gap:4px;display:flex}.PNbOqW_tabDivider{background:#ffffff1f;flex:none;align-self:center;width:1px;height:14px;margin:0 12px}.PNbOqW_tab{height:34px;color:var(--dsw-alias-label-secondary,#8ea6c6);cursor:pointer;white-space:nowrap;background:0 0;border:0;border-bottom:2px solid #0000;border-radius:4px 4px 0 0;align-items:center;gap:6px;padding:0 10px;font-size:13px;font-weight:400;display:inline-flex}.PNbOqW_tab:hover{background:#ffffff0a}.PNbOqW_tabActive{color:var(--dsw-alias-label-primary,#fff);border-bottom-color:var(--dsw-alias-brand-primary,#2563eb);font-weight:600}.PNbOqW_tabBadge{background:var(--dsw-alias-bg-layer-2);min-width:18px;height:16px;color:var(--dsw-alias-label-caption);font-variant-numeric:tabular-nums;border-radius:999px;justify-content:center;align-items:center;padding:0 5px;font-size:10px;font-weight:500;display:inline-flex}.PNbOqW_notice,.PNbOqW_waiting{background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-secondary);border-radius:5px;margin:0;padding:8px 10px;font-size:12px}.PNbOqW_waiting{border:1px dashed var(--dsw-alias-border-l2);color:var(--dsw-alias-label-tertiary)}.PNbOqW_panel{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);border-radius:8px;flex-direction:column;gap:10px;min-height:0;padding:14px;display:flex}.PNbOqW_sectionTitle{margin:0;font-size:13px;font-weight:600}.PNbOqW_matrixHead{justify-content:space-between;align-items:center;gap:12px;display:flex}.PNbOqW_matrixHeadLeft{align-items:center;gap:8px;display:flex}.PNbOqW_matrixTool{width:24px;height:24px;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:0;border-radius:6px;place-items:center;padding:0;font-size:15px;line-height:1;display:inline-grid}.PNbOqW_matrixTool:hover{color:var(--dsw-alias-label-primary);background:#ffffff0f}.PNbOqW_matrixToolActive{color:#2563eb;background:#2563eb26}.PNbOqW_matrixPermHead{text-align:left;white-space:normal;min-width:116px;max-width:140px;font-weight:500}.PNbOqW_matrixRoleHead,.PNbOqW_matrixRoleCell{white-space:nowrap}.PNbOqW_roleSearchWrap{flex:none;width:240px;max-width:100%;display:inline-flex;position:relative}.PNbOqW_roleSearchIcon{color:#8ea6c6;pointer-events:none;width:16px;height:16px;transition:color .12s;position:absolute;top:50%;left:10px;transform:translateY(-50%)}.PNbOqW_roleSearchWrap:focus-within .PNbOqW_roleSearchIcon{color:#2563eb}.PNbOqW_roleSearch{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-2);width:100%;height:30px;color:var(--dsw-alias-label-primary);font:var(--dsw-font-xxs-12);border-radius:6px;outline:none;padding:0 10px 0 34px}.PNbOqW_roleSearch::placeholder{color:var(--dsw-alias-label-caption)}.PNbOqW_roleSearch:focus{border-color:var(--dsw-alias-brand-primary,#2563eb)}.PNbOqW_empty{text-align:center;color:var(--dsw-alias-label-caption);margin:0;padding:28px 12px;font-size:12px}.PNbOqW_matrixScroll,.PNbOqW_tableScroll{overscroll-behavior:contain;scrollbar-gutter:stable;max-height:clamp(280px,100dvh - 340px,520px);overflow:auto}.PNbOqW_matrix,.PNbOqW_table{border-collapse:collapse;width:100%;font-size:12px}.PNbOqW_matrix th,.PNbOqW_matrix td,.PNbOqW_table th,.PNbOqW_table td{border-bottom:1px solid var(--dsw-alias-border-l1);text-align:left;vertical-align:top;padding:7px 9px}.PNbOqW_matrix th,.PNbOqW_table th{background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-secondary);white-space:nowrap;font-weight:600}.PNbOqW_permission{white-space:nowrap;color:var(--dsw-alias-label-secondary);align-items:center;gap:5px;font-size:11px;line-height:20px;display:flex}.PNbOqW_panelFoot{flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:6px;display:flex}.PNbOqW_readOnly{color:var(--dsw-alias-label-tertiary);margin-right:auto;font-size:11px}.PNbOqW_muted{color:var(--dsw-alias-label-tertiary);font-size:11px}.PNbOqW_departments{flex-direction:column;gap:4px;margin:0;padding:0;list-style:none;display:flex}.PNbOqW_department{border-bottom:1px solid var(--dsw-alias-border-l1);justify-content:space-between;align-items:center;gap:12px;padding:9px 8px;font-size:12px;display:flex}.PNbOqW_deptAdmins{align-items:center;gap:5px;display:flex}.PNbOqW_adminTag{color:var(--dsw-alias-state-business-primary);background:#ecf1fc;border-radius:4px;padding:1px 6px;font-size:11px}.PNbOqW_empty{text-align:center;color:var(--dsw-alias-label-tertiary);margin:0;padding:40px 0}.PNbOqW_matrixScroll{overscroll-behavior:contain;scrollbar-gutter:stable;max-height:clamp(280px,100dvh - 340px,520px);overflow:auto}.PNbOqW_matrix thead th{z-index:2;position:sticky;top:0}.PNbOqW_matrix thead th:first-child,.PNbOqW_matrix tbody th{background:var(--dsw-alias-bg-layer-2);min-width:132px;position:sticky;left:0}.PNbOqW_matrix thead th:first-child{z-index:3}.PNbOqW_matrix tbody th{z-index:1;background:var(--dsw-alias-bg-layer-1)}.PNbOqW_protected{background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-tertiary);white-space:nowrap;border-radius:3px;margin-left:5px;padding:0 5px;font-size:10px;font-weight:500;line-height:16px;display:inline-block}tr[data-locked=true] td{opacity:.62}.PNbOqW_pager{justify-content:flex-end;align-items:center;gap:8px;padding-top:8px;display:flex}.PNbOqW_dialog{width:min(560px,100vw - 32px)}.PNbOqW_dialogBody{flex-direction:column;gap:10px;display:flex}.PNbOqW_dialogHint{color:var(--dsw-alias-label-secondary);margin:0;font-size:12px;line-height:18px}.PNbOqW_search{box-sizing:border-box;border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-base);width:100%;height:30px;color:var(--dsw-alias-label-primary);font:var(--dsw-font-xs-13);border-radius:5px;padding:0 9px}.PNbOqW_candidates{flex-direction:column;gap:2px;max-height:260px;margin:0;padding:0;list-style:none;display:flex;overflow:auto}.PNbOqW_candidate{cursor:pointer;border-radius:5px;align-items:center;gap:7px;padding:6px 7px;font-size:12px;display:flex}.PNbOqW_candidate:hover{background:var(--dsw-alias-interactive-bg-hover)}.PNbOqW_error{color:var(--dsw-alias-state-error-primary);margin:0;font-size:11px;line-height:16px}.PNbOqW_dialogFooter{justify-content:flex-end;gap:6px;display:flex}.PNbOqW_matrixNote{color:var(--dsw-alias-label-tertiary);margin:6px 0 0;font-size:11px;line-height:16px}.PNbOqW_panelHead{justify-content:space-between;align-items:center;gap:10px;display:flex}.PNbOqW_treeRoot,.PNbOqW_treeChildren{margin:0;padding:0;list-style:none}.PNbOqW_treeChildren{border-left:1px solid var(--dsw-alias-border-l1);margin-left:18px}.PNbOqW_treeRow{border-bottom:1px solid var(--dsw-alias-border-l1);align-items:center;gap:7px;min-height:34px;font-size:12px;display:flex}.PNbOqW_treeToggle,.PNbOqW_treeSpacer{flex:none;justify-content:center;align-items:center;width:18px;height:18px;display:inline-flex}.PNbOqW_treeToggle{color:var(--dsw-alias-label-tertiary);cursor:pointer;background:0 0;border:0;border-radius:3px;font-size:11px}.PNbOqW_treeToggle:hover{background:var(--dsw-alias-interactive-bg-hover)}.PNbOqW_treeName{color:var(--dsw-alias-label-primary);white-space:nowrap;font-weight:600}.PNbOqW_treeActions{align-items:center;gap:2px;margin-left:auto;display:flex}.PNbOqW_field{color:var(--dsw-alias-label-secondary);flex-direction:column;gap:5px;font-size:12px;display:flex}.PNbOqW_field input,.PNbOqW_field select{box-sizing:border-box;border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-base);width:100%;height:30px;color:var(--dsw-alias-label-primary);font:var(--dsw-font-xs-13);border-radius:5px;padding:0 9px}.PNbOqW_field input:disabled{opacity:.65}.PNbOqW_matrixModule{vertical-align:top;background:var(--dsw-alias-bg-layer-2);min-width:96px;color:var(--dsw-alias-label-secondary);text-align:left;border-right:1px solid var(--dsw-alias-border-l1);padding:10px 9px;font-size:12px;font-weight:600}.PNbOqW_matrixGroup th{background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-secondary);text-align:left;padding:7px 9px;font-size:12px;font-weight:600}.PNbOqW_matrixPermission{white-space:nowrap;min-width:230px}.PNbOqW_scopeBadge{border-radius:3px;margin-left:6px;padding:0 5px;font-size:10px;font-weight:500;line-height:16px;display:inline-block}.PNbOqW_scopeBadge[data-scope=department]{background:color-mix(in srgb, var(--dsw-alias-state-business-primary) 14%, var(--dsw-alias-bg-layer-1));color:var(--dsw-alias-state-business-primary)}.PNbOqW_scopeBadge[data-scope=global]{background:color-mix(in srgb, var(--dsw-alias-state-warn-primary) 16%, var(--dsw-alias-bg-layer-1));color:var(--dsw-alias-state-warn-primary)}.PNbOqW_onlyAdmin{color:var(--dsw-alias-label-tertiary);white-space:nowrap;margin-left:4px;font-size:10px}.PNbOqW_permCopy{max-width:100%;color:var(--dsw-alias-label-primary);font:inherit;text-align:left;cursor:pointer;background:0 0;border:0;align-items:center;gap:2px;padding:0;display:inline-flex}.PNbOqW_permCopy:hover span:first-child{color:var(--dsw-alias-state-business-primary);text-decoration:underline dotted}.PNbOqW_permDescription{color:var(--dsw-alias-label-tertiary);white-space:normal;margin-top:2px;font-size:10px;font-weight:400;line-height:15px;display:block}.PNbOqW_copied{color:var(--dsw-alias-state-success-primary);margin-left:4px;font-size:10px}.PNbOqW_combobox{min-width:132px;position:relative}.PNbOqW_comboboxTrigger{box-sizing:border-box;border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-base);width:100%;height:28px;color:var(--dsw-alias-label-primary);font:var(--dsw-font-xs-13);text-align:left;cursor:pointer;border-radius:5px;justify-content:space-between;align-items:center;gap:8px;padding:0 8px;display:flex}.PNbOqW_comboboxTrigger:hover:not(:disabled){border-color:var(--dsw-alias-state-business-primary)}.PNbOqW_comboboxTrigger:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:1px}.PNbOqW_comboboxTrigger:disabled{opacity:.55;cursor:default}.PNbOqW_comboboxPlaceholder{color:var(--dsw-alias-label-tertiary)}.PNbOqW_comboboxMenu{z-index:30;box-sizing:border-box;border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-1);border-radius:7px;width:max(100%,220px);padding:5px;position:absolute;top:calc(100% + 4px);left:0;box-shadow:0 8px 24px #00000038}.PNbOqW_comboboxSearch{box-sizing:border-box;border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-base);width:100%;height:28px;color:var(--dsw-alias-label-primary);font:var(--dsw-font-xs-13);border-radius:4px;padding:0 7px}.PNbOqW_comboboxList{max-height:210px;margin:4px 0 0;padding:0;list-style:none;overflow:auto}.PNbOqW_comboboxOption{width:100%;color:var(--dsw-alias-label-primary);text-align:left;cursor:pointer;background:0 0;border:0;border-radius:4px;align-items:center;gap:5px;padding:6px;font-size:12px;line-height:18px;display:flex}.PNbOqW_comboboxOptionActive,.PNbOqW_comboboxOption:hover{background:var(--dsw-alias-interactive-bg-hover)}.PNbOqW_comboboxCheck{width:13px;color:var(--dsw-alias-state-business-primary);flex:none;font-size:11px}.PNbOqW_comboboxHint{color:var(--dsw-alias-label-tertiary);margin-left:auto;font-size:10px}.PNbOqW_comboboxEmpty{color:var(--dsw-alias-label-tertiary);padding:9px 7px;font-size:11px}.PNbOqW_rowActions{white-space:nowrap;align-items:center;gap:4px;display:flex}.PNbOqW_detailGrid{grid-template-columns:92px minmax(0,1fr);gap:8px 12px;margin:0;font-size:12px;line-height:18px;display:grid}.PNbOqW_detailGrid dt{color:var(--dsw-alias-label-tertiary)}.PNbOqW_detailGrid dd{color:var(--dsw-alias-label-primary);overflow-wrap:anywhere;margin:0}.PNbOqW_roleCell{flex-direction:column;gap:6px;display:flex}.PNbOqW_roleTags{flex-wrap:wrap;gap:4px;display:flex}.PNbOqW_roleTag{background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-secondary);border-radius:4px;align-items:center;gap:4px;padding:1px 6px;font-size:11px;line-height:18px;display:inline-flex}.PNbOqW_roleRevoke{width:14px;height:14px;color:var(--dsw-alias-label-tertiary);cursor:pointer;background:0 0;border:0;border-radius:3px;padding:0;font-size:12px;line-height:1}.PNbOqW_roleRevoke:hover{color:var(--dsw-alias-state-danger,#b91c1c);background:#ffffff14}.PNbOqW_roleGrant{align-items:center;gap:6px;display:flex}.PNbOqW_roleGrant select{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-2);height:26px;color:var(--dsw-alias-label-primary);border-radius:5px;padding:0 6px;font-size:11px}";
3181
- const tagId$1 = "@sparkelf/dsh-dataops-managed/PermissionCenterSection.module.css";
3182
- if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$1) + "]") === null) {
2731
+ const css$2 = ".PNbOqW_page{box-sizing:border-box;flex-direction:column;gap:14px;width:100%;max-width:clamp(1000px,60vw,1200px);min-height:0;margin:0 auto;padding:24px;display:flex}.PNbOqW_head{justify-content:space-between;align-items:center;gap:12px;display:flex}.PNbOqW_headText{min-width:0}.PNbOqW_headActions{flex:none;align-items:center;gap:8px;display:flex}.PNbOqW_title{color:var(--dsw-alias-label-primary);margin:0;font-size:20px;font-weight:600;line-height:28px}.PNbOqW_subtitle{color:var(--dsw-alias-label-tertiary);align-items:center;gap:6px;margin:3px 0 0;font-size:12px;display:flex}.PNbOqW_demo{color:#9a5b00;background:#fff3e0;border-radius:4px;padding:1px 6px;font-size:10px;line-height:16px}.PNbOqW_tabs{border-bottom:1px solid var(--dsw-alias-border-l1);scrollbar-width:none;flex-wrap:nowrap;align-items:center;gap:0;display:flex;overflow:auto hidden}.PNbOqW_tabs::-webkit-scrollbar{display:none}.PNbOqW_tabGroup{flex:none;align-items:center;gap:4px;display:flex}.PNbOqW_tabDivider{background:#ffffff1f;flex:none;align-self:center;width:1px;height:14px;margin:0 12px}.PNbOqW_tab{height:34px;color:var(--dsw-alias-label-secondary,#8ea6c6);cursor:pointer;white-space:nowrap;background:0 0;border:0;border-bottom:2px solid #0000;border-radius:4px 4px 0 0;align-items:center;gap:6px;padding:0 10px;font-size:13px;font-weight:400;display:inline-flex}.PNbOqW_tab:hover{background:#ffffff0a}.PNbOqW_tabActive{color:var(--dsw-alias-label-primary,#fff);border-bottom-color:var(--dsw-alias-brand-primary,#2563eb);font-weight:600}.PNbOqW_tabBadge{background:var(--dsw-alias-bg-layer-2);min-width:18px;height:16px;color:var(--dsw-alias-label-caption);font-variant-numeric:tabular-nums;border-radius:999px;justify-content:center;align-items:center;padding:0 5px;font-size:10px;font-weight:500;display:inline-flex}.PNbOqW_notice,.PNbOqW_waiting{background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-secondary);border-radius:5px;margin:0;padding:8px 10px;font-size:12px}.PNbOqW_waiting{border:1px dashed var(--dsw-alias-border-l2);color:var(--dsw-alias-label-tertiary)}.PNbOqW_panel{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);border-radius:8px;flex-direction:column;gap:10px;min-height:0;padding:14px;display:flex}.PNbOqW_sectionTitle{margin:0;font-size:13px;font-weight:600}.PNbOqW_matrixHead{justify-content:space-between;align-items:center;gap:12px;display:flex}.PNbOqW_matrixHeadLeft{align-items:center;gap:8px;display:flex}.PNbOqW_matrixTool{width:24px;height:24px;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:0;border-radius:6px;place-items:center;padding:0;font-size:15px;line-height:1;display:inline-grid}.PNbOqW_matrixTool:hover{color:var(--dsw-alias-label-primary);background:#ffffff0f}.PNbOqW_matrixToolActive{color:#2563eb;background:#2563eb26}.PNbOqW_matrixPermHead{text-align:left;white-space:normal;min-width:116px;max-width:140px;font-weight:500}.PNbOqW_matrixRoleHead,.PNbOqW_matrixRoleCell{white-space:nowrap}.PNbOqW_roleSearchWrap{flex:none;width:240px;max-width:100%;display:inline-flex;position:relative}.PNbOqW_roleSearchIcon{color:#8ea6c6;pointer-events:none;width:16px;height:16px;transition:color .12s;position:absolute;top:50%;left:10px;transform:translateY(-50%)}.PNbOqW_roleSearchWrap:focus-within .PNbOqW_roleSearchIcon{color:#2563eb}.PNbOqW_roleSearch{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-2);width:100%;height:30px;color:var(--dsw-alias-label-primary);font:var(--dsw-font-xxs-12);border-radius:6px;outline:none;padding:0 10px 0 34px}.PNbOqW_roleSearch::placeholder{color:var(--dsw-alias-label-caption)}.PNbOqW_roleSearch:focus{border-color:var(--dsw-alias-brand-primary,#2563eb)}.PNbOqW_empty{text-align:center;color:var(--dsw-alias-label-caption);margin:0;padding:28px 12px;font-size:12px}.PNbOqW_matrixScroll,.PNbOqW_tableScroll{overscroll-behavior:contain;scrollbar-gutter:stable;max-height:clamp(280px,100dvh - 340px,520px);overflow:auto}.PNbOqW_matrix,.PNbOqW_table{border-collapse:collapse;width:100%;font-size:12px}.PNbOqW_matrix th,.PNbOqW_matrix td,.PNbOqW_table th,.PNbOqW_table td{border-bottom:1px solid var(--dsw-alias-border-l1);text-align:left;vertical-align:top;padding:7px 9px}.PNbOqW_matrix th,.PNbOqW_table th{background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-secondary);white-space:nowrap;font-weight:600}.PNbOqW_permission{white-space:nowrap;color:var(--dsw-alias-label-secondary);align-items:center;gap:5px;font-size:11px;line-height:20px;display:flex}.PNbOqW_panelFoot{flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:6px;display:flex}.PNbOqW_readOnly{color:var(--dsw-alias-label-tertiary);margin-right:auto;font-size:11px}.PNbOqW_muted{color:var(--dsw-alias-label-tertiary);font-size:11px}.PNbOqW_departments{flex-direction:column;gap:4px;margin:0;padding:0;list-style:none;display:flex}.PNbOqW_department{border-bottom:1px solid var(--dsw-alias-border-l1);justify-content:space-between;align-items:center;gap:12px;padding:9px 8px;font-size:12px;display:flex}.PNbOqW_deptAdmins{align-items:center;gap:5px;display:flex}.PNbOqW_adminTag{color:var(--dsw-alias-state-business-primary);background:#ecf1fc;border-radius:4px;padding:1px 6px;font-size:11px}.PNbOqW_empty{text-align:center;color:var(--dsw-alias-label-tertiary);margin:0;padding:40px 0}.PNbOqW_matrixScroll{overscroll-behavior:contain;scrollbar-gutter:stable;max-height:clamp(280px,100dvh - 340px,520px);overflow:auto}.PNbOqW_matrix thead th{z-index:2;position:sticky;top:0}.PNbOqW_matrix thead th:first-child,.PNbOqW_matrix tbody th{background:var(--dsw-alias-bg-layer-2);min-width:132px;position:sticky;left:0}.PNbOqW_matrix thead th:first-child{z-index:3}.PNbOqW_matrix tbody th{z-index:1;background:var(--dsw-alias-bg-layer-1)}.PNbOqW_protected{background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-tertiary);white-space:nowrap;border-radius:3px;margin-left:5px;padding:0 5px;font-size:10px;font-weight:500;line-height:16px;display:inline-block}tr[data-locked=true] td{opacity:.62}.PNbOqW_pager{justify-content:flex-end;align-items:center;gap:8px;padding-top:8px;display:flex}.PNbOqW_dialog{width:min(560px,100vw - 32px)}.PNbOqW_dialogBody{flex-direction:column;gap:10px;display:flex}.PNbOqW_dialogHint{color:var(--dsw-alias-label-secondary);margin:0;font-size:12px;line-height:18px}.PNbOqW_search{box-sizing:border-box;border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-base);width:100%;height:30px;color:var(--dsw-alias-label-primary);font:var(--dsw-font-xs-13);border-radius:5px;padding:0 9px}.PNbOqW_candidates{flex-direction:column;gap:2px;max-height:260px;margin:0;padding:0;list-style:none;display:flex;overflow:auto}.PNbOqW_candidate{cursor:pointer;border-radius:5px;align-items:center;gap:7px;padding:6px 7px;font-size:12px;display:flex}.PNbOqW_candidate:hover{background:var(--dsw-alias-interactive-bg-hover)}.PNbOqW_error{color:var(--dsw-alias-state-error-primary);margin:0;font-size:11px;line-height:16px}.PNbOqW_dialogFooter{justify-content:flex-end;gap:6px;display:flex}.PNbOqW_matrixNote{color:var(--dsw-alias-label-tertiary);margin:6px 0 0;font-size:11px;line-height:16px}.PNbOqW_panelHead{justify-content:space-between;align-items:center;gap:10px;display:flex}.PNbOqW_treeRoot,.PNbOqW_treeChildren{margin:0;padding:0;list-style:none}.PNbOqW_treeChildren{border-left:1px solid var(--dsw-alias-border-l1);margin-left:18px}.PNbOqW_treeRow{border-bottom:1px solid var(--dsw-alias-border-l1);align-items:center;gap:7px;min-height:34px;font-size:12px;display:flex}.PNbOqW_treeToggle,.PNbOqW_treeSpacer{flex:none;justify-content:center;align-items:center;width:18px;height:18px;display:inline-flex}.PNbOqW_treeToggle{color:var(--dsw-alias-label-tertiary);cursor:pointer;background:0 0;border:0;border-radius:3px;font-size:11px}.PNbOqW_treeToggle:hover{background:var(--dsw-alias-interactive-bg-hover)}.PNbOqW_treeName{color:var(--dsw-alias-label-primary);white-space:nowrap;font-weight:600}.PNbOqW_treeActions{align-items:center;gap:2px;margin-left:auto;display:flex}.PNbOqW_field{color:var(--dsw-alias-label-secondary);flex-direction:column;gap:5px;font-size:12px;display:flex}.PNbOqW_field input,.PNbOqW_field select{box-sizing:border-box;border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-base);width:100%;height:30px;color:var(--dsw-alias-label-primary);font:var(--dsw-font-xs-13);border-radius:5px;padding:0 9px}.PNbOqW_field input:disabled{opacity:.65}.PNbOqW_matrixModule{vertical-align:top;background:var(--dsw-alias-bg-layer-2);min-width:96px;color:var(--dsw-alias-label-secondary);text-align:left;border-right:1px solid var(--dsw-alias-border-l1);padding:10px 9px;font-size:12px;font-weight:600}.PNbOqW_matrixGroup th{background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-secondary);text-align:left;padding:7px 9px;font-size:12px;font-weight:600}.PNbOqW_matrixPermission{white-space:nowrap;min-width:230px}.PNbOqW_scopeBadge{border-radius:3px;margin-left:6px;padding:0 5px;font-size:10px;font-weight:500;line-height:16px;display:inline-block}.PNbOqW_scopeBadge[data-scope=department]{background:color-mix(in srgb, var(--dsw-alias-state-business-primary) 14%, var(--dsw-alias-bg-layer-1));color:var(--dsw-alias-state-business-primary)}.PNbOqW_scopeBadge[data-scope=global]{background:color-mix(in srgb, var(--dsw-alias-state-warn-primary) 16%, var(--dsw-alias-bg-layer-1));color:var(--dsw-alias-state-warn-primary)}.PNbOqW_onlyAdmin{color:var(--dsw-alias-label-tertiary);white-space:nowrap;margin-left:4px;font-size:10px}.PNbOqW_permCopy{max-width:100%;color:var(--dsw-alias-label-primary);font:inherit;text-align:left;cursor:pointer;background:0 0;border:0;align-items:center;gap:2px;padding:0;display:inline-flex}.PNbOqW_permCopy:hover span:first-child{color:var(--dsw-alias-state-business-primary);text-decoration:underline dotted}.PNbOqW_permDescription{color:var(--dsw-alias-label-tertiary);white-space:normal;margin-top:2px;font-size:10px;font-weight:400;line-height:15px;display:block}.PNbOqW_copied{color:var(--dsw-alias-state-success-primary);margin-left:4px;font-size:10px}.PNbOqW_combobox{min-width:132px;position:relative}.PNbOqW_comboboxTrigger{box-sizing:border-box;border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-base);width:100%;height:28px;color:var(--dsw-alias-label-primary);font:var(--dsw-font-xs-13);text-align:left;cursor:pointer;border-radius:5px;justify-content:space-between;align-items:center;gap:8px;padding:0 8px;display:flex}.PNbOqW_comboboxTrigger:hover:not(:disabled){border-color:var(--dsw-alias-state-business-primary)}.PNbOqW_comboboxTrigger:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:1px}.PNbOqW_comboboxTrigger:disabled{opacity:.55;cursor:default}.PNbOqW_comboboxPlaceholder{color:var(--dsw-alias-label-tertiary)}.PNbOqW_comboboxMenu{z-index:30;box-sizing:border-box;border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-1);border-radius:7px;width:max(100%,220px);padding:5px;position:absolute;top:calc(100% + 4px);left:0;box-shadow:0 8px 24px #00000038}.PNbOqW_comboboxSearch{box-sizing:border-box;border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-base);width:100%;height:28px;color:var(--dsw-alias-label-primary);font:var(--dsw-font-xs-13);border-radius:4px;padding:0 7px}.PNbOqW_comboboxList{max-height:210px;margin:4px 0 0;padding:0;list-style:none;overflow:auto}.PNbOqW_comboboxOption{width:100%;color:var(--dsw-alias-label-primary);text-align:left;cursor:pointer;background:0 0;border:0;border-radius:4px;align-items:center;gap:5px;padding:6px;font-size:12px;line-height:18px;display:flex}.PNbOqW_comboboxOptionActive,.PNbOqW_comboboxOption:hover{background:var(--dsw-alias-interactive-bg-hover)}.PNbOqW_comboboxCheck{width:13px;color:var(--dsw-alias-state-business-primary);flex:none;font-size:11px}.PNbOqW_comboboxHint{color:var(--dsw-alias-label-tertiary);margin-left:auto;font-size:10px}.PNbOqW_comboboxEmpty{color:var(--dsw-alias-label-tertiary);padding:9px 7px;font-size:11px}.PNbOqW_rowActions{white-space:nowrap;align-items:center;gap:4px;display:flex}.PNbOqW_detailGrid{grid-template-columns:92px minmax(0,1fr);gap:8px 12px;margin:0;font-size:12px;line-height:18px;display:grid}.PNbOqW_detailGrid dt{color:var(--dsw-alias-label-tertiary)}.PNbOqW_detailGrid dd{color:var(--dsw-alias-label-primary);overflow-wrap:anywhere;margin:0}.PNbOqW_roleCell{flex-direction:column;gap:6px;display:flex}.PNbOqW_roleTags{flex-wrap:wrap;gap:4px;display:flex}.PNbOqW_roleTag{background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-secondary);border-radius:4px;align-items:center;gap:4px;padding:1px 6px;font-size:11px;line-height:18px;display:inline-flex}.PNbOqW_roleRevoke{width:14px;height:14px;color:var(--dsw-alias-label-tertiary);cursor:pointer;background:0 0;border:0;border-radius:3px;padding:0;font-size:12px;line-height:1}.PNbOqW_roleRevoke:hover{color:var(--dsw-alias-state-danger,#b91c1c);background:#ffffff14}.PNbOqW_roleGrant{align-items:center;gap:6px;display:flex}.PNbOqW_roleGrant select{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-2);height:26px;color:var(--dsw-alias-label-primary);border-radius:5px;padding:0 6px;font-size:11px}";
2732
+ const tagId$2 = "@sparkelf/dsh-dataops-managed/PermissionCenterSection.module.css";
2733
+ if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$2) + "]") === null) {
3183
2734
  const tag = document.createElement("style");
3184
2735
  tag.dataset.plugin = "@sparkelf/dsh-dataops-managed";
3185
- tag.dataset.pluginCss = tagId$1;
3186
- tag.textContent = css$1;
2736
+ tag.dataset.pluginCss = tagId$2;
2737
+ tag.textContent = css$2;
3187
2738
  document.head.appendChild(tag);
3188
2739
  }
3189
2740
  var PermissionCenterSection_module_css_default = {
3190
- "readOnly": "PNbOqW_readOnly",
3191
- "waiting": "PNbOqW_waiting",
3192
- "deptAdmins": "PNbOqW_deptAdmins",
3193
- "comboboxMenu": "PNbOqW_comboboxMenu",
3194
- "tab": "PNbOqW_tab",
3195
- "tabDivider": "PNbOqW_tabDivider",
3196
- "roleRevoke": "PNbOqW_roleRevoke",
3197
- "table": "PNbOqW_table",
3198
- "roleGrant": "PNbOqW_roleGrant",
3199
- "panel": "PNbOqW_panel",
3200
- "search": "PNbOqW_search",
2741
+ "permission": "PNbOqW_permission",
3201
2742
  "pager": "PNbOqW_pager",
3202
- "matrixTool": "PNbOqW_matrixTool",
3203
- "permCopy": "PNbOqW_permCopy",
3204
- "matrixPermHead": "PNbOqW_matrixPermHead",
3205
- "sectionTitle": "PNbOqW_sectionTitle",
2743
+ "error": "PNbOqW_error",
2744
+ "panel": "PNbOqW_panel",
3206
2745
  "matrixGroup": "PNbOqW_matrixGroup",
3207
- "onlyAdmin": "PNbOqW_onlyAdmin",
3208
- "field": "PNbOqW_field",
2746
+ "table": "PNbOqW_table",
2747
+ "panelFoot": "PNbOqW_panelFoot",
2748
+ "tab": "PNbOqW_tab",
2749
+ "roleSearchIcon": "PNbOqW_roleSearchIcon",
3209
2750
  "tabActive": "PNbOqW_tabActive",
3210
- "copied": "PNbOqW_copied",
3211
- "roleSearchWrap": "PNbOqW_roleSearchWrap",
3212
- "notice": "PNbOqW_notice",
3213
- "departments": "PNbOqW_departments",
3214
- "matrixPermission": "PNbOqW_matrixPermission",
3215
- "comboboxOption": "PNbOqW_comboboxOption",
2751
+ "matrixHeadLeft": "PNbOqW_matrixHeadLeft",
2752
+ "treeSpacer": "PNbOqW_treeSpacer",
2753
+ "treeRoot": "PNbOqW_treeRoot",
2754
+ "treeToggle": "PNbOqW_treeToggle",
2755
+ "tableScroll": "PNbOqW_tableScroll",
2756
+ "treeRow": "PNbOqW_treeRow",
2757
+ "comboboxMenu": "PNbOqW_comboboxMenu",
2758
+ "tabDivider": "PNbOqW_tabDivider",
2759
+ "treeActions": "PNbOqW_treeActions",
3216
2760
  "comboboxHint": "PNbOqW_comboboxHint",
3217
- "comboboxEmpty": "PNbOqW_comboboxEmpty",
3218
- "detailGrid": "PNbOqW_detailGrid",
2761
+ "sectionTitle": "PNbOqW_sectionTitle",
2762
+ "dialogBody": "PNbOqW_dialogBody",
2763
+ "treeName": "PNbOqW_treeName",
2764
+ "comboboxSearch": "PNbOqW_comboboxSearch",
3219
2765
  "matrixHead": "PNbOqW_matrixHead",
3220
- "combobox": "PNbOqW_combobox",
3221
- "candidates": "PNbOqW_candidates",
3222
2766
  "title": "PNbOqW_title",
2767
+ "demo": "PNbOqW_demo",
2768
+ "matrixModule": "PNbOqW_matrixModule",
2769
+ "roleTag": "PNbOqW_roleTag",
2770
+ "treeChildren": "PNbOqW_treeChildren",
2771
+ "copied": "PNbOqW_copied",
2772
+ "subtitle": "PNbOqW_subtitle",
2773
+ "comboboxEmpty": "PNbOqW_comboboxEmpty",
2774
+ "department": "PNbOqW_department",
3223
2775
  "tabGroup": "PNbOqW_tabGroup",
3224
- "dialogHint": "PNbOqW_dialogHint",
3225
- "panelFoot": "PNbOqW_panelFoot",
3226
- "head": "PNbOqW_head",
3227
- "treeRow": "PNbOqW_treeRow",
3228
- "comboboxOptionActive": "PNbOqW_comboboxOptionActive",
2776
+ "roleSearch": "PNbOqW_roleSearch",
2777
+ "departments": "PNbOqW_departments",
2778
+ "dialog": "PNbOqW_dialog",
3229
2779
  "comboboxCheck": "PNbOqW_comboboxCheck",
3230
- "matrixModule": "PNbOqW_matrixModule",
2780
+ "panelHead": "PNbOqW_panelHead",
2781
+ "roleSearchWrap": "PNbOqW_roleSearchWrap",
3231
2782
  "roleCell": "PNbOqW_roleCell",
3232
- "headActions": "PNbOqW_headActions",
3233
- "matrixNote": "PNbOqW_matrixNote",
3234
- "roleTags": "PNbOqW_roleTags",
3235
- "demo": "PNbOqW_demo",
3236
- "matrixRoleCell": "PNbOqW_matrixRoleCell",
3237
- "roleSearchIcon": "PNbOqW_roleSearchIcon",
2783
+ "roleRevoke": "PNbOqW_roleRevoke",
2784
+ "permCopy": "PNbOqW_permCopy",
2785
+ "candidate": "PNbOqW_candidate",
3238
2786
  "dialogFooter": "PNbOqW_dialogFooter",
3239
- "treeRoot": "PNbOqW_treeRoot",
3240
- "treeSpacer": "PNbOqW_treeSpacer",
3241
- "permission": "PNbOqW_permission",
3242
- "comboboxPlaceholder": "PNbOqW_comboboxPlaceholder",
3243
- "matrixScroll": "PNbOqW_matrixScroll",
3244
- "treeChildren": "PNbOqW_treeChildren",
2787
+ "matrixToolActive": "PNbOqW_matrixToolActive",
2788
+ "waiting": "PNbOqW_waiting",
2789
+ "matrixRoleHead": "PNbOqW_matrixRoleHead",
2790
+ "matrixNote": "PNbOqW_matrixNote",
2791
+ "tabBadge": "PNbOqW_tabBadge",
2792
+ "notice": "PNbOqW_notice",
2793
+ "readOnly": "PNbOqW_readOnly",
2794
+ "search": "PNbOqW_search",
2795
+ "dialogHint": "PNbOqW_dialogHint",
3245
2796
  "matrix": "PNbOqW_matrix",
2797
+ "comboboxOption": "PNbOqW_comboboxOption",
2798
+ "adminTag": "PNbOqW_adminTag",
2799
+ "matrixPermHead": "PNbOqW_matrixPermHead",
2800
+ "comboboxTrigger": "PNbOqW_comboboxTrigger",
2801
+ "head": "PNbOqW_head",
2802
+ "headActions": "PNbOqW_headActions",
3246
2803
  "headText": "PNbOqW_headText",
3247
- "comboboxSearch": "PNbOqW_comboboxSearch",
2804
+ "matrixTool": "PNbOqW_matrixTool",
2805
+ "matrixScroll": "PNbOqW_matrixScroll",
2806
+ "candidates": "PNbOqW_candidates",
2807
+ "matrixRoleCell": "PNbOqW_matrixRoleCell",
2808
+ "roleTags": "PNbOqW_roleTags",
2809
+ "roleGrant": "PNbOqW_roleGrant",
2810
+ "onlyAdmin": "PNbOqW_onlyAdmin",
3248
2811
  "tabs": "PNbOqW_tabs",
3249
- "treeName": "PNbOqW_treeName",
3250
- "panelHead": "PNbOqW_panelHead",
3251
- "matrixHeadLeft": "PNbOqW_matrixHeadLeft",
3252
- "rowActions": "PNbOqW_rowActions",
3253
- "scopeBadge": "PNbOqW_scopeBadge",
3254
- "adminTag": "PNbOqW_adminTag",
3255
- "candidate": "PNbOqW_candidate",
3256
- "page": "PNbOqW_page",
3257
2812
  "empty": "PNbOqW_empty",
3258
- "matrixRoleHead": "PNbOqW_matrixRoleHead",
3259
- "dialogBody": "PNbOqW_dialogBody",
3260
- "roleTag": "PNbOqW_roleTag",
3261
- "matrixToolActive": "PNbOqW_matrixToolActive",
3262
- "comboboxTrigger": "PNbOqW_comboboxTrigger",
3263
- "error": "PNbOqW_error",
3264
- "dialog": "PNbOqW_dialog",
3265
- "permDescription": "PNbOqW_permDescription",
3266
- "subtitle": "PNbOqW_subtitle",
3267
- "protected": "PNbOqW_protected",
3268
- "treeActions": "PNbOqW_treeActions",
3269
- "department": "PNbOqW_department",
3270
- "tabBadge": "PNbOqW_tabBadge",
3271
- "roleSearch": "PNbOqW_roleSearch",
3272
- "tableScroll": "PNbOqW_tableScroll",
3273
- "treeToggle": "PNbOqW_treeToggle",
2813
+ "field": "PNbOqW_field",
2814
+ "comboboxPlaceholder": "PNbOqW_comboboxPlaceholder",
3274
2815
  "muted": "PNbOqW_muted",
3275
- "comboboxList": "PNbOqW_comboboxList"
2816
+ "protected": "PNbOqW_protected",
2817
+ "matrixPermission": "PNbOqW_matrixPermission",
2818
+ "permDescription": "PNbOqW_permDescription",
2819
+ "comboboxList": "PNbOqW_comboboxList",
2820
+ "comboboxOptionActive": "PNbOqW_comboboxOptionActive",
2821
+ "page": "PNbOqW_page",
2822
+ "combobox": "PNbOqW_combobox",
2823
+ "scopeBadge": "PNbOqW_scopeBadge",
2824
+ "rowActions": "PNbOqW_rowActions",
2825
+ "detailGrid": "PNbOqW_detailGrid",
2826
+ "deptAdmins": "PNbOqW_deptAdmins"
3276
2827
  };
3277
2828
  //#endregion
3278
2829
  //#region src/client/combobox.ts
@@ -4596,325 +4147,649 @@ window.__ModuleLoader__.load({
4596
4147
  onClose: () => {
4597
4148
  setDetail(null);
4598
4149
  },
4599
- title: t("permDetailTitle"),
4600
- closeLabel: t("permClose"),
4601
- className: PermissionCenterSection_module_css_default.dialog,
4602
- footer: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
4603
- className: PermissionCenterSection_module_css_default.dialogFooter,
4604
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
4605
- variant: "outline",
4150
+ title: t("permDetailTitle"),
4151
+ closeLabel: t("permClose"),
4152
+ className: PermissionCenterSection_module_css_default.dialog,
4153
+ footer: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
4154
+ className: PermissionCenterSection_module_css_default.dialogFooter,
4155
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
4156
+ variant: "outline",
4157
+ onClick: () => {
4158
+ setDetail(null);
4159
+ },
4160
+ children: t("permClose")
4161
+ })
4162
+ }),
4163
+ children: detail === null ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("dl", {
4164
+ className: PermissionCenterSection_module_css_default.detailGrid,
4165
+ children: [
4166
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dt", { children: t("permDetailType") }),
4167
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dd", { children: typeLabel(detail.kind) }),
4168
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dt", { children: t("permDetailName") }),
4169
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dd", { children: detail.name }),
4170
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dt", { children: t("permDetailOwner") }),
4171
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dd", { children: ownerDisplay(detail.ownerName) }),
4172
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dt", { children: t("permDetailScope") }),
4173
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dd", { children: visibilityLabel(detail.visibility) }),
4174
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dt", { children: t("permDetailDepartment") }),
4175
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dd", { children: departmentName(detail.departmentCode) }),
4176
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dt", { children: t("permDetailStatus") }),
4177
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dd", { children: statusLabel(detail.reviewStatus) }),
4178
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dt", { children: t("permDetailUpdated") }),
4179
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dd", { children: detail.updatedAt === void 0 ? "—" : new Date(detail.updatedAt).toLocaleString() })
4180
+ ]
4181
+ })
4182
+ })
4183
+ ]
4184
+ });
4185
+ }
4186
+ /** Accessible searchable combobox used for visibility and department pickers. */
4187
+ function SearchCombobox({ t, value, options, onChange, placeholder, ariaLabel, disabled = false }) {
4188
+ const [open, setOpen] = (0, react.useState)(false);
4189
+ const [query, setQuery] = (0, react.useState)("");
4190
+ const [active, setActive] = (0, react.useState)(0);
4191
+ const rootRef = (0, react.useRef)(null);
4192
+ const inputRef = (0, react.useRef)(null);
4193
+ const selected = options.find((option) => option.value === value);
4194
+ const filtered = (0, react.useMemo)(() => filterComboboxOptions(options, query), [options, query]);
4195
+ (0, react.useEffect)(() => {
4196
+ if (!open) return;
4197
+ const close = (event) => {
4198
+ if (rootRef.current !== null && !rootRef.current.contains(event.target)) setOpen(false);
4199
+ };
4200
+ document.addEventListener("mousedown", close);
4201
+ inputRef.current?.focus();
4202
+ return () => {
4203
+ document.removeEventListener("mousedown", close);
4204
+ };
4205
+ }, [open]);
4206
+ (0, react.useEffect)(() => {
4207
+ if (!open) return;
4208
+ const index = filtered.findIndex((option) => option.value === value);
4209
+ setActive(index >= 0 ? index : 0);
4210
+ }, [
4211
+ open,
4212
+ filtered,
4213
+ value
4214
+ ]);
4215
+ const choose = (next) => {
4216
+ onChange(next);
4217
+ setOpen(false);
4218
+ setQuery("");
4219
+ };
4220
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
4221
+ className: PermissionCenterSection_module_css_default.combobox,
4222
+ ref: rootRef,
4223
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
4224
+ type: "button",
4225
+ className: PermissionCenterSection_module_css_default.comboboxTrigger,
4226
+ "aria-label": ariaLabel,
4227
+ "aria-haspopup": "listbox",
4228
+ "aria-expanded": open,
4229
+ disabled,
4230
+ onClick: () => {
4231
+ setOpen((current) => !current);
4232
+ },
4233
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
4234
+ className: selected === void 0 ? PermissionCenterSection_module_css_default.comboboxPlaceholder : void 0,
4235
+ children: selected?.label ?? placeholder
4236
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
4237
+ "aria-hidden": "true",
4238
+ children: "⌄"
4239
+ })]
4240
+ }), open ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
4241
+ className: PermissionCenterSection_module_css_default.comboboxMenu,
4242
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
4243
+ ref: inputRef,
4244
+ className: PermissionCenterSection_module_css_default.comboboxSearch,
4245
+ value: query,
4246
+ placeholder: t("permSearch"),
4247
+ "aria-label": t("permSearch"),
4248
+ onChange: (event) => {
4249
+ setQuery(event.target.value);
4250
+ setActive(0);
4251
+ },
4252
+ onKeyDown: (event) => {
4253
+ if (event.key === "Escape") {
4254
+ setOpen(false);
4255
+ return;
4256
+ }
4257
+ if (event.key === "ArrowDown") {
4258
+ event.preventDefault();
4259
+ setActive((current) => clampActiveIndex(current + 1, filtered.length));
4260
+ }
4261
+ if (event.key === "ArrowUp") {
4262
+ event.preventDefault();
4263
+ setActive((current) => clampActiveIndex(current - 1, filtered.length));
4264
+ }
4265
+ if (event.key === "Enter") {
4266
+ event.preventDefault();
4267
+ const option = filtered[active];
4268
+ if (option !== void 0) choose(option.value);
4269
+ }
4270
+ }
4271
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
4272
+ className: PermissionCenterSection_module_css_default.comboboxList,
4273
+ role: "listbox",
4274
+ "aria-label": ariaLabel,
4275
+ children: filtered.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", {
4276
+ className: PermissionCenterSection_module_css_default.comboboxEmpty,
4277
+ children: t("permNoMatches")
4278
+ }) : filtered.map((option, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", {
4279
+ role: "option",
4280
+ "aria-selected": option.value === value,
4281
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
4282
+ type: "button",
4283
+ className: index === active ? PermissionCenterSection_module_css_default.comboboxOption + " " + PermissionCenterSection_module_css_default.comboboxOptionActive : PermissionCenterSection_module_css_default.comboboxOption,
4284
+ onMouseEnter: () => {
4285
+ setActive(index);
4286
+ },
4606
4287
  onClick: () => {
4607
- setDetail(null);
4288
+ choose(option.value);
4608
4289
  },
4609
- children: t("permClose")
4290
+ children: [
4291
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
4292
+ className: PermissionCenterSection_module_css_default.comboboxCheck,
4293
+ children: option.value === value ? "✓" : ""
4294
+ }),
4295
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: option.label }),
4296
+ option.hint === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
4297
+ className: PermissionCenterSection_module_css_default.comboboxHint,
4298
+ children: option.hint
4299
+ })
4300
+ ]
4610
4301
  })
4611
- }),
4612
- children: detail === null ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("dl", {
4613
- className: PermissionCenterSection_module_css_default.detailGrid,
4614
- children: [
4615
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dt", { children: t("permDetailType") }),
4616
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dd", { children: typeLabel(detail.kind) }),
4617
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dt", { children: t("permDetailName") }),
4618
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dd", { children: detail.name }),
4619
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dt", { children: t("permDetailOwner") }),
4620
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dd", { children: ownerDisplay(detail.ownerName) }),
4621
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dt", { children: t("permDetailScope") }),
4622
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dd", { children: visibilityLabel(detail.visibility) }),
4623
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dt", { children: t("permDetailDepartment") }),
4624
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dd", { children: departmentName(detail.departmentCode) }),
4625
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dt", { children: t("permDetailStatus") }),
4626
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dd", { children: statusLabel(detail.reviewStatus) }),
4627
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dt", { children: t("permDetailUpdated") }),
4628
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dd", { children: detail.updatedAt === void 0 ? "—" : new Date(detail.updatedAt).toLocaleString() })
4629
- ]
4630
- })
4302
+ }, option.value))
4303
+ })]
4304
+ }) : null]
4305
+ });
4306
+ }
4307
+ function Pager({ page, pages, onChange }) {
4308
+ if (pages <= 1) return null;
4309
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
4310
+ className: PermissionCenterSection_module_css_default.pager,
4311
+ children: [
4312
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
4313
+ variant: "outline",
4314
+ size: "sm",
4315
+ disabled: page === 0,
4316
+ onClick: () => {
4317
+ onChange(page - 1);
4318
+ },
4319
+ children: "上一页"
4320
+ }),
4321
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
4322
+ className: PermissionCenterSection_module_css_default.muted,
4323
+ children: [
4324
+ page + 1,
4325
+ " / ",
4326
+ pages
4327
+ ]
4328
+ }),
4329
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
4330
+ variant: "outline",
4331
+ size: "sm",
4332
+ disabled: page >= pages - 1,
4333
+ onClick: () => {
4334
+ onChange(page + 1);
4335
+ },
4336
+ children: "下一页"
4631
4337
  })
4632
4338
  ]
4633
4339
  });
4634
4340
  }
4635
- /** Accessible searchable combobox used for visibility and department pickers. */
4636
- function SearchCombobox({ t, value, options, onChange, placeholder, ariaLabel, disabled = false }) {
4637
- const [open, setOpen] = (0, react.useState)(false);
4638
- const [query, setQuery] = (0, react.useState)("");
4639
- const [active, setActive] = (0, react.useState)(0);
4640
- const rootRef = (0, react.useRef)(null);
4641
- const inputRef = (0, react.useRef)(null);
4642
- const selected = options.find((option) => option.value === value);
4643
- const filtered = (0, react.useMemo)(() => filterComboboxOptions(options, query), [options, query]);
4341
+ /** The four role labels, so the header does not show a backend code. */
4342
+ function roleLabel(role) {
4343
+ switch (role) {
4344
+ case "SUPER_ADMIN": return "超级管理员";
4345
+ case "ADMIN": return "管理员";
4346
+ case "DEPT_ADMIN": return "部门管理员";
4347
+ default: return "应用人员";
4348
+ }
4349
+ }
4350
+ //#endregion
4351
+ //#region src/client/PermissionCenterIcon.tsx
4352
+ /**
4353
+ * The sidebar glyph for the permission centre.
4354
+ *
4355
+ * The entry is hidden for a caller the Host reports as an ordinary user. This is a navigation
4356
+ * affordance, not the authorization decision: every permission-centre endpoint re-checks the
4357
+ * caller, and the page itself refuses to render without a management role.
4358
+ */
4359
+ function PermissionCenterIcon() {
4360
+ const [allowed, setAllowed] = (0, react.useState)(() => canSeeManagedSettings() ? true : void 0);
4361
+ (0, react.useEffect)(() => {
4362
+ let live = true;
4363
+ if (reviewDemoMode() || canSeeManagedSettings()) {
4364
+ setAllowed(true);
4365
+ return () => {
4366
+ live = false;
4367
+ };
4368
+ }
4369
+ fetchReviewContext().then((context) => {
4370
+ if (!live) return;
4371
+ setAllowed(context !== null && context.role !== "APP_USER");
4372
+ }).catch(() => {
4373
+ if (live) setAllowed(false);
4374
+ });
4375
+ return () => {
4376
+ live = false;
4377
+ };
4378
+ }, []);
4379
+ if (allowed !== true) return null;
4380
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
4381
+ width: "18",
4382
+ height: "18",
4383
+ viewBox: "0 0 18 18",
4384
+ fill: "none",
4385
+ "aria-hidden": "true",
4386
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
4387
+ d: "M9 2.2 14.5 4v4.4c0 3.1-2.1 5.6-5.5 7.4-3.4-1.8-5.5-4.3-5.5-7.4V4L9 2.2Z",
4388
+ stroke: "currentColor",
4389
+ strokeWidth: "1.2",
4390
+ strokeLinejoin: "round"
4391
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
4392
+ d: "m6.7 8.8 1.6 1.6 3-3.1",
4393
+ stroke: "currentColor",
4394
+ strokeWidth: "1.2",
4395
+ strokeLinecap: "round",
4396
+ strokeLinejoin: "round"
4397
+ })]
4398
+ });
4399
+ }
4400
+ //#endregion
4401
+ //#region src/client/workspace-upgrade-client.ts
4402
+ /** Same-origin calls for the workspace image upgrade banner. */
4403
+ /** Route the plugin's Host half serves for upgrade detection and start. */
4404
+ const WORKSPACE_UPGRADE_PATH = "/integrations/dataops/workspace-upgrade";
4405
+ /** Narrow an unknown response into the status contract. */
4406
+ function asStatus(value) {
4407
+ if (typeof value !== "object" || value === null || Array.isArray(value)) return null;
4408
+ const record = value;
4409
+ const imageStatus = record.imageStatus;
4410
+ if (imageStatus !== "CURRENT" && imageStatus !== "UPDATE_AVAILABLE" && imageStatus !== "NOT_RUNNING" && imageStatus !== "UNKNOWN") return null;
4411
+ const sessions = Array.isArray(record.activeSessions) ? record.activeSessions.flatMap((entry) => {
4412
+ if (typeof entry !== "object" || entry === null || Array.isArray(entry)) return [];
4413
+ const session = entry;
4414
+ if (typeof session.sessionId !== "string" || session.sessionId.trim() === "") return [];
4415
+ return [{
4416
+ sessionId: session.sessionId.trim(),
4417
+ ...typeof session.title === "string" && session.title.trim() !== "" ? { title: session.title.trim() } : {},
4418
+ ...typeof session.cwd === "string" && session.cwd.trim() !== "" ? { cwd: session.cwd.trim() } : {}
4419
+ }];
4420
+ }) : [];
4421
+ return {
4422
+ imageStatus,
4423
+ configuredImage: typeof record.configuredImage === "string" ? record.configuredImage : "",
4424
+ activeSessions: sessions
4425
+ };
4426
+ }
4427
+ /**
4428
+ * Read the workspace upgrade preview.
4429
+ * @returns the status, or null when the Host route is not ready or not connected.
4430
+ */
4431
+ async function fetchWorkspaceUpgrade() {
4432
+ const response = await fetch(WORKSPACE_UPGRADE_PATH, {
4433
+ credentials: "same-origin",
4434
+ headers: { accept: "application/json" }
4435
+ });
4436
+ if (response.status === 503 || response.status === 401) return null;
4437
+ if (!response.ok) throw new Error(`workspace upgrade preview failed with HTTP ${String(response.status)}`);
4438
+ return asStatus(await response.json());
4439
+ }
4440
+ /**
4441
+ * Ask the Host to snapshot sessions and recreate the workspace container.
4442
+ * @returns the accepted hand-off summary.
4443
+ */
4444
+ async function requestWorkspaceUpgrade() {
4445
+ const response = await fetch(WORKSPACE_UPGRADE_PATH, {
4446
+ method: "POST",
4447
+ credentials: "same-origin",
4448
+ headers: {
4449
+ "content-type": "application/json",
4450
+ accept: "application/json"
4451
+ },
4452
+ body: JSON.stringify({ force: true })
4453
+ });
4454
+ const body = await response.json().catch(() => null);
4455
+ if (!response.ok) {
4456
+ const message = typeof body?.error === "string" ? body.error : `workspace upgrade failed with HTTP ${String(response.status)}`;
4457
+ throw new Error(message);
4458
+ }
4459
+ return {
4460
+ accepted: body?.accepted === true,
4461
+ upgradeId: typeof body?.upgradeId === "string" ? body.upgradeId : "",
4462
+ sessions: typeof body?.sessions === "number" ? body.sessions : 0
4463
+ };
4464
+ }
4465
+ //#endregion
4466
+ //#region \0dsh-css:/root/projects/dsh-plugins-plus/packages/dataops-managed/src/client/WorkspaceUpgradePrompt.module.css.mjs
4467
+ const css$1 = ".razUfG_banner{z-index:40;border:.5px solid var(--dsw-alias-settings-card-stroke);border-radius:var(--dsw-radius-xl);background:var(--dsw-alias-settings-card-fill);width:min(680px,100vw - 32px);color:var(--dsw-alias-label-primary);justify-content:space-between;align-items:center;gap:20px;padding:10px 12px 10px 16px;display:flex;position:fixed;top:16px;left:50%;transform:translate(-50%);box-shadow:0 8px 28px #0000001f}.razUfG_copy{flex-direction:column;gap:2px;min-width:0;display:flex}.razUfG_title{font-size:13px;font-weight:600;line-height:22px}.razUfG_body{color:var(--dsw-alias-label-secondary);font-size:12px;line-height:18px}.razUfG_actions{flex:none;align-items:center;gap:4px;display:flex}.razUfG_dialogBody{flex-direction:column;gap:12px;min-width:min(420px,70vw);display:flex}.razUfG_dialogText{color:var(--dsw-alias-label-secondary);margin:0;font-size:13px;line-height:22px}.razUfG_sessionList{border-radius:var(--dsw-radius-lg);background:var(--dsw-alias-bg-layer-1);flex-direction:column;gap:4px;max-height:220px;margin:0;padding:8px 10px;list-style:none;display:flex;overflow:auto}.razUfG_sessionRow{flex-direction:column;gap:1px;min-width:0;display:flex}.razUfG_sessionTitle{color:var(--dsw-alias-label-primary);text-overflow:ellipsis;white-space:nowrap;font-size:12px;line-height:18px;overflow:hidden}.razUfG_sessionPath{color:var(--dsw-alias-label-tertiary);text-overflow:ellipsis;white-space:nowrap;font-size:11px;line-height:16px;overflow:hidden}.razUfG_error{color:var(--dsw-alias-state-error-primary);margin:0;font-size:12px;line-height:18px}";
4468
+ const tagId$1 = "@sparkelf/dsh-dataops-managed/WorkspaceUpgradePrompt.module.css";
4469
+ if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$1) + "]") === null) {
4470
+ const tag = document.createElement("style");
4471
+ tag.dataset.plugin = "@sparkelf/dsh-dataops-managed";
4472
+ tag.dataset.pluginCss = tagId$1;
4473
+ tag.textContent = css$1;
4474
+ document.head.appendChild(tag);
4475
+ }
4476
+ var WorkspaceUpgradePrompt_module_css_default = {
4477
+ "title": "razUfG_title",
4478
+ "sessionPath": "razUfG_sessionPath",
4479
+ "error": "razUfG_error",
4480
+ "dialogBody": "razUfG_dialogBody",
4481
+ "sessionList": "razUfG_sessionList",
4482
+ "actions": "razUfG_actions",
4483
+ "copy": "razUfG_copy",
4484
+ "sessionRow": "razUfG_sessionRow",
4485
+ "sessionTitle": "razUfG_sessionTitle",
4486
+ "banner": "razUfG_banner",
4487
+ "body": "razUfG_body",
4488
+ "dialogText": "razUfG_dialogText"
4489
+ };
4490
+ //#endregion
4491
+ //#region src/client/WorkspaceUpgradePrompt.tsx
4492
+ /**
4493
+ * Workspace image upgrade banner and confirmation dialog.
4494
+ *
4495
+ * The banner is deliberately quiet: it tells the user a newer workspace image exists and
4496
+ * leaves the current session usable. Only the explicit upgrade action opens the dialog
4497
+ * that can interrupt running sessions.
4498
+ *
4499
+ * @module WorkspaceUpgradePrompt
4500
+ */
4501
+ /** How often to re-read the image status while the page is open. */
4502
+ const POLL_MS = 3e4;
4503
+ /** Wait before a reload so the restarted workspace has a chance to come back. */
4504
+ const RELOAD_DELAY_MS = 12e3;
4505
+ /**
4506
+ * Render the banner and its upgrade dialog.
4507
+ * @param props.t - localized copy resolver.
4508
+ * @returns the banner while an image update is available, otherwise null.
4509
+ */
4510
+ function WorkspaceUpgradePrompt(props) {
4511
+ const { t } = props;
4512
+ const [status, setStatus] = (0, react.useState)(null);
4513
+ const [dismissed, setDismissed] = (0, react.useState)(false);
4514
+ const [dialogOpen, setDialogOpen] = (0, react.useState)(false);
4515
+ const [busy, setBusy] = (0, react.useState)(false);
4516
+ const [notice, setNotice] = (0, react.useState)("");
4517
+ const [error, setError] = (0, react.useState)("");
4518
+ const refresh = (0, react.useCallback)(async () => {
4519
+ try {
4520
+ const next = await fetchWorkspaceUpgrade();
4521
+ if (next !== null) setStatus(next);
4522
+ } catch {}
4523
+ }, []);
4644
4524
  (0, react.useEffect)(() => {
4645
- if (!open) return;
4646
- const close = (event) => {
4647
- if (rootRef.current !== null && !rootRef.current.contains(event.target)) setOpen(false);
4525
+ let cancelled = false;
4526
+ const tick = async () => {
4527
+ if (cancelled) return;
4528
+ await refresh();
4648
4529
  };
4649
- document.addEventListener("mousedown", close);
4650
- inputRef.current?.focus();
4530
+ tick();
4531
+ const timer = setInterval(() => {
4532
+ tick();
4533
+ }, POLL_MS);
4651
4534
  return () => {
4652
- document.removeEventListener("mousedown", close);
4535
+ cancelled = true;
4536
+ clearInterval(timer);
4653
4537
  };
4654
- }, [open]);
4655
- (0, react.useEffect)(() => {
4656
- if (!open) return;
4657
- const index = filtered.findIndex((option) => option.value === value);
4658
- setActive(index >= 0 ? index : 0);
4659
- }, [
4660
- open,
4661
- filtered,
4662
- value
4663
- ]);
4664
- const choose = (next) => {
4665
- onChange(next);
4666
- setOpen(false);
4667
- setQuery("");
4668
- };
4669
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
4670
- className: PermissionCenterSection_module_css_default.combobox,
4671
- ref: rootRef,
4672
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
4673
- type: "button",
4674
- className: PermissionCenterSection_module_css_default.comboboxTrigger,
4675
- "aria-label": ariaLabel,
4676
- "aria-haspopup": "listbox",
4677
- "aria-expanded": open,
4678
- disabled,
4679
- onClick: () => {
4680
- setOpen((current) => !current);
4681
- },
4682
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
4683
- className: selected === void 0 ? PermissionCenterSection_module_css_default.comboboxPlaceholder : void 0,
4684
- children: selected?.label ?? placeholder
4685
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
4686
- "aria-hidden": "true",
4687
- children: "⌄"
4688
- })]
4689
- }), open ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
4690
- className: PermissionCenterSection_module_css_default.comboboxMenu,
4691
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
4692
- ref: inputRef,
4693
- className: PermissionCenterSection_module_css_default.comboboxSearch,
4694
- value: query,
4695
- placeholder: t("permSearch"),
4696
- "aria-label": t("permSearch"),
4697
- onChange: (event) => {
4698
- setQuery(event.target.value);
4699
- setActive(0);
4700
- },
4701
- onKeyDown: (event) => {
4702
- if (event.key === "Escape") {
4703
- setOpen(false);
4704
- return;
4705
- }
4706
- if (event.key === "ArrowDown") {
4707
- event.preventDefault();
4708
- setActive((current) => clampActiveIndex(current + 1, filtered.length));
4709
- }
4710
- if (event.key === "ArrowUp") {
4711
- event.preventDefault();
4712
- setActive((current) => clampActiveIndex(current - 1, filtered.length));
4713
- }
4714
- if (event.key === "Enter") {
4715
- event.preventDefault();
4716
- const option = filtered[active];
4717
- if (option !== void 0) choose(option.value);
4718
- }
4719
- }
4720
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
4721
- className: PermissionCenterSection_module_css_default.comboboxList,
4722
- role: "listbox",
4723
- "aria-label": ariaLabel,
4724
- children: filtered.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", {
4725
- className: PermissionCenterSection_module_css_default.comboboxEmpty,
4726
- children: t("permNoMatches")
4727
- }) : filtered.map((option, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", {
4728
- role: "option",
4729
- "aria-selected": option.value === value,
4730
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
4731
- type: "button",
4732
- className: index === active ? PermissionCenterSection_module_css_default.comboboxOption + " " + PermissionCenterSection_module_css_default.comboboxOptionActive : PermissionCenterSection_module_css_default.comboboxOption,
4733
- onMouseEnter: () => {
4734
- setActive(index);
4735
- },
4736
- onClick: () => {
4737
- choose(option.value);
4738
- },
4739
- children: [
4740
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
4741
- className: PermissionCenterSection_module_css_default.comboboxCheck,
4742
- children: option.value === value ? "✓" : ""
4743
- }),
4744
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: option.label }),
4745
- option.hint === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
4746
- className: PermissionCenterSection_module_css_default.comboboxHint,
4747
- children: option.hint
4748
- })
4749
- ]
4750
- })
4751
- }, option.value))
4752
- })]
4753
- }) : null]
4538
+ }, [refresh]);
4539
+ const available = status?.imageStatus === "UPDATE_AVAILABLE";
4540
+ const sessionCount = status?.activeSessions.length ?? 0;
4541
+ const warning = (0, react.useMemo)(() => t("upgradeSessionsWarning").replace("{count}", String(sessionCount)), [sessionCount, t]);
4542
+ const openDialog = (0, react.useCallback)(() => {
4543
+ setError("");
4544
+ setDialogOpen(true);
4545
+ }, []);
4546
+ const closeDialog = (0, react.useCallback)(() => {
4547
+ if (busy) return;
4548
+ setDialogOpen(false);
4549
+ }, [busy]);
4550
+ const upgrade = (0, react.useCallback)(async () => {
4551
+ setBusy(true);
4552
+ setError("");
4553
+ try {
4554
+ await requestWorkspaceUpgrade();
4555
+ setDialogOpen(false);
4556
+ setNotice(t("upgradeStarted"));
4557
+ setDismissed(true);
4558
+ window.setTimeout(() => {
4559
+ window.location.reload();
4560
+ }, RELOAD_DELAY_MS);
4561
+ } catch (cause) {
4562
+ if (cause instanceof TypeError) {
4563
+ setDialogOpen(false);
4564
+ setNotice(t("upgradeStarted"));
4565
+ setDismissed(true);
4566
+ window.setTimeout(() => {
4567
+ window.location.reload();
4568
+ }, RELOAD_DELAY_MS);
4569
+ return;
4570
+ }
4571
+ setError(cause instanceof Error ? cause.message : t("upgradeFailed"));
4572
+ } finally {
4573
+ setBusy(false);
4574
+ }
4575
+ }, [t]);
4576
+ if (notice !== "") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
4577
+ className: WorkspaceUpgradePrompt_module_css_default.banner,
4578
+ role: "status",
4579
+ "aria-live": "polite",
4580
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
4581
+ className: WorkspaceUpgradePrompt_module_css_default.title,
4582
+ children: notice
4583
+ })
4754
4584
  });
4755
- }
4756
- function Pager({ page, pages, onChange }) {
4757
- if (pages <= 1) return null;
4758
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
4759
- className: PermissionCenterSection_module_css_default.pager,
4760
- children: [
4761
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
4762
- variant: "outline",
4763
- size: "sm",
4764
- disabled: page === 0,
4765
- onClick: () => {
4766
- onChange(page - 1);
4767
- },
4768
- children: "上一页"
4769
- }),
4770
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
4771
- className: PermissionCenterSection_module_css_default.muted,
4772
- children: [
4773
- page + 1,
4774
- " / ",
4775
- pages
4776
- ]
4777
- }),
4778
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
4779
- variant: "outline",
4585
+ if (!available || dismissed) return null;
4586
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
4587
+ className: WorkspaceUpgradePrompt_module_css_default.banner,
4588
+ role: "status",
4589
+ "aria-live": "polite",
4590
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
4591
+ className: WorkspaceUpgradePrompt_module_css_default.copy,
4592
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", {
4593
+ className: WorkspaceUpgradePrompt_module_css_default.title,
4594
+ children: t("upgradeAvailableTitle")
4595
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
4596
+ className: WorkspaceUpgradePrompt_module_css_default.body,
4597
+ children: t("upgradeAvailableBody")
4598
+ })]
4599
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
4600
+ className: WorkspaceUpgradePrompt_module_css_default.actions,
4601
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
4602
+ variant: "primary",
4603
+ size: "sm",
4604
+ onClick: openDialog,
4605
+ children: t("upgradeAction")
4606
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
4607
+ variant: "ghost",
4780
4608
  size: "sm",
4781
- disabled: page >= pages - 1,
4782
4609
  onClick: () => {
4783
- onChange(page + 1);
4610
+ setDismissed(true);
4784
4611
  },
4785
- children: "下一页"
4786
- })
4787
- ]
4788
- });
4789
- }
4790
- /** The four role labels, so the header does not show a backend code. */
4791
- function roleLabel(role) {
4792
- switch (role) {
4793
- case "SUPER_ADMIN": return "超级管理员";
4794
- case "ADMIN": return "管理员";
4795
- case "DEPT_ADMIN": return "部门管理员";
4796
- default: return "应用人员";
4797
- }
4612
+ children: t("upgradeLater")
4613
+ })]
4614
+ })]
4615
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Modal, {
4616
+ open: dialogOpen,
4617
+ onClose: closeDialog,
4618
+ title: t("upgradeDialogTitle"),
4619
+ description: t("upgradeDialogBody"),
4620
+ closeLabel: t("upgradeCancel"),
4621
+ footer: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
4622
+ variant: "ghost",
4623
+ onClick: closeDialog,
4624
+ disabled: busy,
4625
+ children: t("upgradeCancel")
4626
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
4627
+ variant: "primary",
4628
+ onClick: () => {
4629
+ upgrade();
4630
+ },
4631
+ disabled: busy,
4632
+ children: busy ? t("upgradeBusy") : sessionCount === 0 ? t("upgradeAction") : t("upgradeConfirm")
4633
+ })] }),
4634
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
4635
+ className: WorkspaceUpgradePrompt_module_css_default.dialogBody,
4636
+ children: [
4637
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
4638
+ className: WorkspaceUpgradePrompt_module_css_default.dialogText,
4639
+ children: sessionCount === 0 ? t("upgradeNoSessions") : warning
4640
+ }),
4641
+ sessionCount > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
4642
+ className: WorkspaceUpgradePrompt_module_css_default.sessionList,
4643
+ children: status?.activeSessions.map((session) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
4644
+ className: WorkspaceUpgradePrompt_module_css_default.sessionRow,
4645
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
4646
+ className: WorkspaceUpgradePrompt_module_css_default.sessionTitle,
4647
+ children: session.title ?? session.sessionId
4648
+ }), session.cwd ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
4649
+ className: WorkspaceUpgradePrompt_module_css_default.sessionPath,
4650
+ children: session.cwd
4651
+ }) : null]
4652
+ }, session.sessionId))
4653
+ }) : null,
4654
+ error !== "" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
4655
+ className: WorkspaceUpgradePrompt_module_css_default.error,
4656
+ role: "alert",
4657
+ children: error
4658
+ }) : null
4659
+ ]
4660
+ })
4661
+ })] });
4798
4662
  }
4799
4663
  //#endregion
4800
- //#region src/client/PermissionCenterIcon.tsx
4664
+ //#region src/client/review-notification-store.ts
4801
4665
  /**
4802
- * The sidebar glyph for the permission centre.
4666
+ * One process-wide notification store shared by every bell.
4803
4667
  *
4804
- * The entry is hidden for a caller the Host reports as an ordinary user. This is a navigation
4805
- * affordance, not the authorization decision: every permission-centre endpoint re-checks the
4806
- * caller, and the page itself refuses to render without a management role.
4668
+ * The skill plaza and the workflow plaza are separate React trees, but they show the same
4669
+ * inbox; keeping the read state in one store is what stops a badge in one place from staying
4670
+ * unread after the other opened the row.
4807
4671
  */
4808
- function PermissionCenterIcon() {
4809
- const [allowed, setAllowed] = (0, react.useState)(() => canSeeManagedSettings() ? true : void 0);
4810
- (0, react.useEffect)(() => {
4811
- let live = true;
4812
- if (reviewDemoMode() || canSeeManagedSettings()) {
4813
- setAllowed(true);
4814
- return () => {
4815
- live = false;
4816
- };
4817
- }
4818
- fetchReviewContext().then((context) => {
4819
- if (!live) return;
4820
- setAllowed(context !== null && context.role !== "APP_USER");
4821
- }).catch(() => {
4822
- if (live) setAllowed(false);
4823
- });
4824
- return () => {
4825
- live = false;
4826
- };
4827
- }, []);
4828
- if (allowed !== true) return null;
4829
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
4830
- width: "18",
4831
- height: "18",
4832
- viewBox: "0 0 18 18",
4833
- fill: "none",
4834
- "aria-hidden": "true",
4835
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
4836
- d: "M9 2.2 14.5 4v4.4c0 3.1-2.1 5.6-5.5 7.4-3.4-1.8-5.5-4.3-5.5-7.4V4L9 2.2Z",
4837
- stroke: "currentColor",
4838
- strokeWidth: "1.2",
4839
- strokeLinejoin: "round"
4840
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
4841
- d: "m6.7 8.8 1.6 1.6 3-3.1",
4842
- stroke: "currentColor",
4843
- strokeWidth: "1.2",
4844
- strokeLinecap: "round",
4845
- strokeLinejoin: "round"
4846
- })]
4847
- });
4672
+ const DEMO_ITEMS = [
4673
+ {
4674
+ id: "demo-1",
4675
+ type: "review_pending",
4676
+ title: "技能「SQL 取数助手」等待审核",
4677
+ body: "来自研发部 · 提交于 10 分钟前",
4678
+ resourceKind: "skill",
4679
+ resourceId: 101,
4680
+ read: false,
4681
+ createdAt: "2026-10-23T04:50:00.000Z"
4682
+ },
4683
+ {
4684
+ id: "demo-2",
4685
+ type: "ai_report",
4686
+ title: "AI 风险报告已生成",
4687
+ body: "风险等级:中 · 2 条建议",
4688
+ resourceKind: "skill",
4689
+ resourceId: 101,
4690
+ read: false,
4691
+ createdAt: "2026-10-23T04:49:00.000Z"
4692
+ },
4693
+ {
4694
+ id: "demo-3",
4695
+ type: "approved",
4696
+ title: "工作流「每日经营日报」已通过",
4697
+ body: "审核人:admin",
4698
+ resourceKind: "workflow",
4699
+ resourceId: "wf-1",
4700
+ read: true,
4701
+ createdAt: "2026-10-22T09:10:00.000Z"
4702
+ }
4703
+ ];
4704
+ let state = {
4705
+ status: "idle",
4706
+ items: [],
4707
+ unread: 0
4708
+ };
4709
+ const listeners = /* @__PURE__ */ new Set();
4710
+ function publish(next) {
4711
+ state = next;
4712
+ for (const listener of listeners) listener();
4848
4713
  }
4849
- //#endregion
4850
- //#region src/client/workspace-upgrade-client.ts
4851
- /** Same-origin calls for the workspace image upgrade banner. */
4852
- /** Route the plugin's Host half serves for upgrade detection and start. */
4853
- const WORKSPACE_UPGRADE_PATH = "/integrations/dataops/workspace-upgrade";
4854
- /** Narrow an unknown response into the status contract. */
4855
- function asStatus(value) {
4856
- if (typeof value !== "object" || value === null || Array.isArray(value)) return null;
4857
- const record = value;
4858
- const imageStatus = record.imageStatus;
4859
- if (imageStatus !== "CURRENT" && imageStatus !== "UPDATE_AVAILABLE" && imageStatus !== "NOT_RUNNING" && imageStatus !== "UNKNOWN") return null;
4860
- const sessions = Array.isArray(record.activeSessions) ? record.activeSessions.flatMap((entry) => {
4861
- if (typeof entry !== "object" || entry === null || Array.isArray(entry)) return [];
4862
- const session = entry;
4863
- if (typeof session.sessionId !== "string" || session.sessionId.trim() === "") return [];
4864
- return [{
4865
- sessionId: session.sessionId.trim(),
4866
- ...typeof session.title === "string" && session.title.trim() !== "" ? { title: session.title.trim() } : {},
4867
- ...typeof session.cwd === "string" && session.cwd.trim() !== "" ? { cwd: session.cwd.trim() } : {}
4868
- }];
4869
- }) : [];
4870
- return {
4871
- imageStatus,
4872
- configuredImage: typeof record.configuredImage === "string" ? record.configuredImage : "",
4873
- activeSessions: sessions
4714
+ /** Current snapshot for `useSyncExternalStore`. */
4715
+ function notificationSnapshot() {
4716
+ return state;
4717
+ }
4718
+ /** Subscribe to store changes. */
4719
+ function subscribeNotifications(listener) {
4720
+ listeners.add(listener);
4721
+ return () => {
4722
+ listeners.delete(listener);
4874
4723
  };
4875
4724
  }
4876
- /**
4877
- * Read the workspace upgrade preview.
4878
- * @returns the status, or null when the Host route is not ready or not connected.
4879
- */
4880
- async function fetchWorkspaceUpgrade() {
4881
- const response = await fetch(WORKSPACE_UPGRADE_PATH, {
4882
- credentials: "same-origin",
4883
- headers: { accept: "application/json" }
4725
+ /** Load the inbox once; a second caller joins the first request. */
4726
+ let inflight;
4727
+ function loadNotifications() {
4728
+ if (inflight !== void 0) return inflight;
4729
+ publish({
4730
+ ...state,
4731
+ status: "loading"
4884
4732
  });
4885
- if (response.status === 503 || response.status === 401) return null;
4886
- if (!response.ok) throw new Error(`workspace upgrade preview failed with HTTP ${String(response.status)}`);
4887
- return asStatus(await response.json());
4733
+ inflight = (async () => {
4734
+ try {
4735
+ if (reviewDemoMode()) {
4736
+ publish({
4737
+ status: "ready",
4738
+ items: sortNotifications(DEMO_ITEMS),
4739
+ unread: unreadCount(DEMO_ITEMS)
4740
+ });
4741
+ return;
4742
+ }
4743
+ const result = await fetchNotifications();
4744
+ if (result === null) {
4745
+ publish({
4746
+ status: "unavailable",
4747
+ items: [],
4748
+ unread: 0
4749
+ });
4750
+ return;
4751
+ }
4752
+ publish({
4753
+ status: "ready",
4754
+ items: sortNotifications(result.items),
4755
+ unread: unreadCount(result.items)
4756
+ });
4757
+ } catch {
4758
+ publish({
4759
+ status: "unavailable",
4760
+ items: [],
4761
+ unread: 0
4762
+ });
4763
+ } finally {
4764
+ inflight = void 0;
4765
+ }
4766
+ })();
4767
+ return inflight;
4888
4768
  }
4889
- /**
4890
- * Ask the Host to snapshot sessions and recreate the workspace container.
4891
- * @returns the accepted hand-off summary.
4892
- */
4893
- async function requestWorkspaceUpgrade() {
4894
- const response = await fetch(WORKSPACE_UPGRADE_PATH, {
4895
- method: "POST",
4896
- credentials: "same-origin",
4897
- headers: {
4898
- "content-type": "application/json",
4899
- accept: "application/json"
4900
- },
4901
- body: JSON.stringify({ force: true })
4769
+ /** Mark one row or the whole inbox read, optimistically. */
4770
+ async function markRead(ids) {
4771
+ const items = ids === "all" ? state.items.map((item) => ({
4772
+ ...item,
4773
+ read: true
4774
+ })) : state.items.map((item) => ids.includes(item.id) ? {
4775
+ ...item,
4776
+ read: true
4777
+ } : item);
4778
+ publish({
4779
+ ...state,
4780
+ items,
4781
+ unread: unreadCount(items)
4902
4782
  });
4903
- const body = await response.json().catch(() => null);
4904
- if (!response.ok) {
4905
- const message = typeof body?.error === "string" ? body.error : `workspace upgrade failed with HTTP ${String(response.status)}`;
4906
- throw new Error(message);
4783
+ try {
4784
+ if (!await markNotificationsRead(ids)) await loadNotifications();
4785
+ } catch {
4786
+ await loadNotifications();
4907
4787
  }
4908
- return {
4909
- accepted: body?.accepted === true,
4910
- upgradeId: typeof body?.upgradeId === "string" ? body.upgradeId : "",
4911
- sessions: typeof body?.sessions === "number" ? body.sessions : 0
4912
- };
4913
4788
  }
4914
4789
  //#endregion
4915
- //#region \0dsh-css:/root/projects/dsh-plugins-plus/packages/dataops-managed/src/client/WorkspaceUpgradePrompt.module.css.mjs
4916
- const css = ".razUfG_banner{z-index:40;border:.5px solid var(--dsw-alias-settings-card-stroke);border-radius:var(--dsw-radius-xl);background:var(--dsw-alias-settings-card-fill);width:min(680px,100vw - 32px);color:var(--dsw-alias-label-primary);justify-content:space-between;align-items:center;gap:20px;padding:10px 12px 10px 16px;display:flex;position:fixed;top:16px;left:50%;transform:translate(-50%);box-shadow:0 8px 28px #0000001f}.razUfG_copy{flex-direction:column;gap:2px;min-width:0;display:flex}.razUfG_title{font-size:13px;font-weight:600;line-height:22px}.razUfG_body{color:var(--dsw-alias-label-secondary);font-size:12px;line-height:18px}.razUfG_actions{flex:none;align-items:center;gap:4px;display:flex}.razUfG_dialogBody{flex-direction:column;gap:12px;min-width:min(420px,70vw);display:flex}.razUfG_dialogText{color:var(--dsw-alias-label-secondary);margin:0;font-size:13px;line-height:22px}.razUfG_sessionList{border-radius:var(--dsw-radius-lg);background:var(--dsw-alias-bg-layer-1);flex-direction:column;gap:4px;max-height:220px;margin:0;padding:8px 10px;list-style:none;display:flex;overflow:auto}.razUfG_sessionRow{flex-direction:column;gap:1px;min-width:0;display:flex}.razUfG_sessionTitle{color:var(--dsw-alias-label-primary);text-overflow:ellipsis;white-space:nowrap;font-size:12px;line-height:18px;overflow:hidden}.razUfG_sessionPath{color:var(--dsw-alias-label-tertiary);text-overflow:ellipsis;white-space:nowrap;font-size:11px;line-height:16px;overflow:hidden}.razUfG_error{color:var(--dsw-alias-state-error-primary);margin:0;font-size:12px;line-height:18px}";
4917
- const tagId = "@sparkelf/dsh-dataops-managed/WorkspaceUpgradePrompt.module.css";
4790
+ //#region \0dsh-css:/root/projects/dsh-plugins-plus/packages/dataops-managed/src/client/NotificationBell.module.css.mjs
4791
+ const css = ".tE0trG_bell{width:26px;height:26px;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:0;border-radius:6px;flex:none;justify-content:center;align-items:center;padding:0;display:inline-flex;position:relative}.tE0trG_bell:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}.tE0trG_bell:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:1px}.tE0trG_badge{background:var(--dsw-alias-state-error-primary);color:#fff;text-align:center;border-radius:7px;min-width:14px;height:14px;padding:0 3px;font-size:9px;font-weight:600;line-height:14px;position:absolute;top:0;right:-2px}.tE0trG_dialog{flex-direction:column;width:min(520px,100vw - 32px);height:70vh;max-height:70vh;display:flex;overflow:hidden}.tE0trG_demo{background:var(--dsw-alias-state-warn-secondary);color:var(--dsw-alias-state-warn-primary);border-radius:4px;margin:0 0 8px;padding:5px 8px;font-size:11px}.tE0trG_empty{color:var(--dsw-alias-label-tertiary);text-align:center;margin:0;padding:18px 0;font-size:12px;line-height:18px}.tE0trG_list{flex-direction:column;flex:none;gap:6px;max-height:calc(70vh - 210px);margin:0;padding:0;list-style:none;display:flex;overflow-y:auto}.tE0trG_row{width:100%;color:var(--dsw-alias-label-secondary);text-align:left;cursor:pointer;background:0 0;border:0;border-radius:0;align-items:flex-start;gap:9px;padding:4px 2px;display:flex}.tE0trG_row:hover .tE0trG_rowTitle{color:var(--dsw-alias-state-business-primary)}.tE0trG_rowIcon{width:18px;height:18px;color:var(--dsw-alias-label-secondary);flex:none;justify-content:center;align-items:center;margin-top:1px;display:inline-flex}.tE0trG_rowIcon[data-tone=success]{color:var(--dsw-alias-state-success-primary)}.tE0trG_rowIcon[data-tone=danger]{color:var(--dsw-alias-state-error-primary)}.tE0trG_rowIcon[data-tone=warn]{color:var(--dsw-alias-state-warn-primary)}.tE0trG_rowIcon[data-tone=info]{color:var(--dsw-alias-state-business-primary)}.tE0trG_dot{background:var(--dsw-alias-state-business-primary);border-radius:50%;flex:none;width:6px;height:6px}.tE0trG_rowBody{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}.tE0trG_rowTitle{color:var(--dsw-alias-label-primary);font-size:12px;font-weight:500;line-height:18px}.tE0trG_rowText{color:var(--dsw-alias-label-secondary);font-size:11px;line-height:16px}.tE0trG_rowMeta{flex:none;align-items:center;gap:6px;margin-top:2px;display:flex}.tE0trG_rowTime{color:var(--dsw-alias-label-tertiary);flex:none;font-size:10px;line-height:16px}.tE0trG_actions{justify-content:flex-end;gap:6px;display:flex}.tE0trG_button,.tE0trG_linkButton{cursor:pointer;border-radius:5px;height:28px;padding:0 10px;font-size:12px}.tE0trG_button{border:1px solid var(--dsw-alias-border-l2);color:var(--dsw-alias-label-primary);background:0 0}.tE0trG_linkButton{color:var(--dsw-alias-state-business-primary);background:0 0;border:0}.tE0trG_pager{color:var(--dsw-alias-label-secondary);justify-content:flex-end;align-items:center;gap:8px;padding-top:8px;font-size:11px;display:flex}.tE0trG_pager button{border:1px solid var(--dsw-alias-border-l2);height:24px;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border-radius:4px;padding:0 8px;font-size:11px}.tE0trG_pager button:disabled{opacity:.4;cursor:default}";
4792
+ const tagId = "@sparkelf/dsh-dataops-managed/NotificationBell.module.css";
4918
4793
  if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId) + "]") === null) {
4919
4794
  const tag = document.createElement("style");
4920
4795
  tag.dataset.plugin = "@sparkelf/dsh-dataops-managed";
@@ -4922,193 +4797,303 @@ window.__ModuleLoader__.load({
4922
4797
  tag.textContent = css;
4923
4798
  document.head.appendChild(tag);
4924
4799
  }
4925
- var WorkspaceUpgradePrompt_module_css_default = {
4926
- "error": "razUfG_error",
4927
- "copy": "razUfG_copy",
4928
- "title": "razUfG_title",
4929
- "sessionRow": "razUfG_sessionRow",
4930
- "dialogBody": "razUfG_dialogBody",
4931
- "sessionTitle": "razUfG_sessionTitle",
4932
- "sessionPath": "razUfG_sessionPath",
4933
- "body": "razUfG_body",
4934
- "dialogText": "razUfG_dialogText",
4935
- "banner": "razUfG_banner",
4936
- "sessionList": "razUfG_sessionList",
4937
- "actions": "razUfG_actions"
4800
+ var NotificationBell_module_css_default = {
4801
+ "badge": "tE0trG_badge",
4802
+ "demo": "tE0trG_demo",
4803
+ "row": "tE0trG_row",
4804
+ "empty": "tE0trG_empty",
4805
+ "rowMeta": "tE0trG_rowMeta",
4806
+ "dot": "tE0trG_dot",
4807
+ "rowBody": "tE0trG_rowBody",
4808
+ "dialog": "tE0trG_dialog",
4809
+ "button": "tE0trG_button",
4810
+ "rowTitle": "tE0trG_rowTitle",
4811
+ "rowIcon": "tE0trG_rowIcon",
4812
+ "bell": "tE0trG_bell",
4813
+ "rowText": "tE0trG_rowText",
4814
+ "actions": "tE0trG_actions",
4815
+ "linkButton": "tE0trG_linkButton",
4816
+ "pager": "tE0trG_pager",
4817
+ "list": "tE0trG_list",
4818
+ "rowTime": "tE0trG_rowTime"
4938
4819
  };
4939
4820
  //#endregion
4940
- //#region src/client/WorkspaceUpgradePrompt.tsx
4941
- /**
4942
- * Workspace image upgrade banner and confirmation dialog.
4943
- *
4944
- * The banner is deliberately quiet: it tells the user a newer workspace image exists and
4945
- * leaves the current session usable. Only the explicit upgrade action opens the dialog
4946
- * that can interrupt running sessions.
4947
- *
4948
- * @module WorkspaceUpgradePrompt
4949
- */
4950
- /** How often to re-read the image status while the page is open. */
4951
- const POLL_MS = 3e4;
4952
- /** Wait before a reload so the restarted workspace has a chance to come back. */
4953
- const RELOAD_DELAY_MS = 12e3;
4954
- /**
4955
- * Render the banner and its upgrade dialog.
4956
- * @param props.t - localized copy resolver.
4957
- * @returns the banner while an image update is available, otherwise null.
4958
- */
4959
- function WorkspaceUpgradePrompt(props) {
4960
- const { t } = props;
4961
- const [status, setStatus] = (0, react.useState)(null);
4962
- const [dismissed, setDismissed] = (0, react.useState)(false);
4963
- const [dialogOpen, setDialogOpen] = (0, react.useState)(false);
4964
- const [busy, setBusy] = (0, react.useState)(false);
4965
- const [notice, setNotice] = (0, react.useState)("");
4966
- const [error, setError] = (0, react.useState)("");
4967
- const refresh = (0, react.useCallback)(async () => {
4968
- try {
4969
- const next = await fetchWorkspaceUpgrade();
4970
- if (next !== null) setStatus(next);
4971
- } catch {}
4972
- }, []);
4973
- (0, react.useEffect)(() => {
4974
- let cancelled = false;
4975
- const tick = async () => {
4976
- if (cancelled) return;
4977
- await refresh();
4978
- };
4979
- tick();
4980
- const timer = setInterval(() => {
4981
- tick();
4982
- }, POLL_MS);
4983
- return () => {
4984
- cancelled = true;
4985
- clearInterval(timer);
4986
- };
4987
- }, [refresh]);
4988
- const available = status?.imageStatus === "UPDATE_AVAILABLE";
4989
- const sessionCount = status?.activeSessions.length ?? 0;
4990
- const warning = (0, react.useMemo)(() => t("upgradeSessionsWarning").replace("{count}", String(sessionCount)), [sessionCount, t]);
4991
- const openDialog = (0, react.useCallback)(() => {
4992
- setError("");
4993
- setDialogOpen(true);
4994
- }, []);
4995
- const closeDialog = (0, react.useCallback)(() => {
4996
- if (busy) return;
4997
- setDialogOpen(false);
4998
- }, [busy]);
4999
- const upgrade = (0, react.useCallback)(async () => {
5000
- setBusy(true);
5001
- setError("");
5002
- try {
5003
- await requestWorkspaceUpgrade();
5004
- setDialogOpen(false);
5005
- setNotice(t("upgradeStarted"));
5006
- setDismissed(true);
5007
- window.setTimeout(() => {
5008
- window.location.reload();
5009
- }, RELOAD_DELAY_MS);
5010
- } catch (cause) {
5011
- if (cause instanceof TypeError) {
5012
- setDialogOpen(false);
5013
- setNotice(t("upgradeStarted"));
5014
- setDismissed(true);
5015
- window.setTimeout(() => {
5016
- window.location.reload();
5017
- }, RELOAD_DELAY_MS);
5018
- return;
5019
- }
5020
- setError(cause instanceof Error ? cause.message : t("upgradeFailed"));
5021
- } finally {
5022
- setBusy(false);
5023
- }
5024
- }, [t]);
5025
- if (notice !== "") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
5026
- className: WorkspaceUpgradePrompt_module_css_default.banner,
5027
- role: "status",
5028
- "aria-live": "polite",
5029
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
5030
- className: WorkspaceUpgradePrompt_module_css_default.title,
5031
- children: notice
5032
- })
4821
+ //#region src/client/NotificationBell.tsx
4822
+ /** Colour tone and glyph for one notification type, matching the automation-task rows. */
4823
+ function notificationTone(type) {
4824
+ if (type === "approved" || type === "published" || type === "success") return "success";
4825
+ if (type === "rejected") return "danger";
4826
+ if (type === "unpublished") return "warn";
4827
+ return "info";
4828
+ }
4829
+ function NotificationIcon({ tone }) {
4830
+ if (tone === "success") return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
4831
+ width: "14",
4832
+ height: "14",
4833
+ viewBox: "0 0 16 16",
4834
+ fill: "none",
4835
+ "aria-hidden": "true",
4836
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("circle", {
4837
+ cx: "8",
4838
+ cy: "8",
4839
+ r: "6.2",
4840
+ stroke: "currentColor",
4841
+ strokeWidth: "1.3"
4842
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
4843
+ d: "m5.3 8.1 1.8 1.8 3.6-3.8",
4844
+ stroke: "currentColor",
4845
+ strokeWidth: "1.3",
4846
+ strokeLinecap: "round",
4847
+ strokeLinejoin: "round"
4848
+ })]
4849
+ });
4850
+ if (tone === "danger") return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
4851
+ width: "14",
4852
+ height: "14",
4853
+ viewBox: "0 0 16 16",
4854
+ fill: "none",
4855
+ "aria-hidden": "true",
4856
+ children: [
4857
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
4858
+ d: "M8 2.3 14 13H2L8 2.3Z",
4859
+ stroke: "currentColor",
4860
+ strokeWidth: "1.3",
4861
+ strokeLinejoin: "round"
4862
+ }),
4863
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
4864
+ d: "M8 6v3.1",
4865
+ stroke: "currentColor",
4866
+ strokeWidth: "1.3",
4867
+ strokeLinecap: "round"
4868
+ }),
4869
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("circle", {
4870
+ cx: "8",
4871
+ cy: "11.2",
4872
+ r: ".7",
4873
+ fill: "currentColor"
4874
+ })
4875
+ ]
4876
+ });
4877
+ if (tone === "warn") return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
4878
+ width: "14",
4879
+ height: "14",
4880
+ viewBox: "0 0 16 16",
4881
+ fill: "none",
4882
+ "aria-hidden": "true",
4883
+ children: [
4884
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("circle", {
4885
+ cx: "8",
4886
+ cy: "8",
4887
+ r: "6.2",
4888
+ stroke: "currentColor",
4889
+ strokeWidth: "1.3"
4890
+ }),
4891
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
4892
+ d: "M8 4.8v3.6",
4893
+ stroke: "currentColor",
4894
+ strokeWidth: "1.3",
4895
+ strokeLinecap: "round"
4896
+ }),
4897
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("circle", {
4898
+ cx: "8",
4899
+ cy: "11.1",
4900
+ r: ".7",
4901
+ fill: "currentColor"
4902
+ })
4903
+ ]
4904
+ });
4905
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
4906
+ width: "14",
4907
+ height: "14",
4908
+ viewBox: "0 0 16 16",
4909
+ fill: "none",
4910
+ "aria-hidden": "true",
4911
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
4912
+ d: "M4 2.5h5l3 3v8H4v-11Z",
4913
+ stroke: "currentColor",
4914
+ strokeWidth: "1.2",
4915
+ strokeLinejoin: "round"
4916
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
4917
+ d: "M9 2.5v3h3M6 8h4M6 10.5h3",
4918
+ stroke: "currentColor",
4919
+ strokeWidth: "1.2",
4920
+ strokeLinecap: "round"
4921
+ })]
5033
4922
  });
5034
- if (!available || dismissed) return null;
5035
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
5036
- className: WorkspaceUpgradePrompt_module_css_default.banner,
5037
- role: "status",
5038
- "aria-live": "polite",
5039
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
5040
- className: WorkspaceUpgradePrompt_module_css_default.copy,
5041
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", {
5042
- className: WorkspaceUpgradePrompt_module_css_default.title,
5043
- children: t("upgradeAvailableTitle")
5044
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
5045
- className: WorkspaceUpgradePrompt_module_css_default.body,
5046
- children: t("upgradeAvailableBody")
4923
+ }
4924
+ /**
4925
+ * A bell with an unread badge and the shared inbox.
4926
+ *
4927
+ * The bell is a button rather than a menu so keyboard focus and Escape follow the dialog
4928
+ * conventions the rest of the page already uses. Rows mark themselves read when opened;
4929
+ * "全部已读" is the one bulk action.
4930
+ */
4931
+ function NotificationBell({ label, onOpen }) {
4932
+ const state = (0, react.useSyncExternalStore)(subscribeNotifications, notificationSnapshot, notificationSnapshot);
4933
+ const [open, setOpen] = (0, react.useState)(false);
4934
+ const [page, setPage] = (0, react.useState)(0);
4935
+ const items = sortNotifications(state.items);
4936
+ const unread = unreadCount(items);
4937
+ const pages = Math.max(1, Math.ceil(items.length / 20));
4938
+ const visible = items.slice(page * 20, page * 20 + 20);
4939
+ (0, react.useEffect)(() => {
4940
+ if (page >= pages) setPage(pages - 1);
4941
+ }, [page, pages]);
4942
+ (0, react.useEffect)(() => {
4943
+ loadNotifications();
4944
+ }, []);
4945
+ const openOne = (item) => {
4946
+ markRead([item.id]);
4947
+ setOpen(false);
4948
+ onOpen?.(item);
4949
+ };
4950
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
4951
+ type: "button",
4952
+ className: NotificationBell_module_css_default.bell,
4953
+ "aria-label": unread === 0 ? label : label + "," + String(unread) + " 条未读",
4954
+ title: label,
4955
+ "data-notification-bell": "",
4956
+ "data-unread": unread,
4957
+ onClick: () => {
4958
+ setOpen(true);
4959
+ setPage(0);
4960
+ loadNotifications();
4961
+ },
4962
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
4963
+ width: "16",
4964
+ height: "16",
4965
+ viewBox: "0 0 16 16",
4966
+ fill: "none",
4967
+ "aria-hidden": "true",
4968
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
4969
+ d: "M8 2.2a4.1 4.1 0 0 0-4.1 4.1v2.3L2.7 10.8a.6.6 0 0 0 .5.9h9.6a.6.6 0 0 0 .5-.9L12.1 8.6V6.3A4.1 4.1 0 0 0 8 2.2Z",
4970
+ stroke: "currentColor",
4971
+ strokeWidth: "1.2",
4972
+ strokeLinejoin: "round"
4973
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
4974
+ d: "M6.4 13.2a1.7 1.7 0 0 0 3.2 0",
4975
+ stroke: "currentColor",
4976
+ strokeWidth: "1.2",
4977
+ strokeLinecap: "round"
5047
4978
  })]
5048
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
5049
- className: WorkspaceUpgradePrompt_module_css_default.actions,
5050
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
5051
- variant: "primary",
5052
- size: "sm",
5053
- onClick: openDialog,
5054
- children: t("upgradeAction")
5055
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
5056
- variant: "ghost",
5057
- size: "sm",
4979
+ }), unread === 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
4980
+ className: NotificationBell_module_css_default.badge,
4981
+ children: unread > 99 ? "99+" : unread
4982
+ })]
4983
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_deepseek_ai_dsh_client_ui_primitives.Modal, {
4984
+ open,
4985
+ onClose: () => {
4986
+ setOpen(false);
4987
+ },
4988
+ title: label,
4989
+ closeLabel: "关闭",
4990
+ className: NotificationBell_module_css_default.dialog,
4991
+ footer: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
4992
+ className: NotificationBell_module_css_default.actions,
4993
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
4994
+ type: "button",
4995
+ className: NotificationBell_module_css_default.linkButton,
5058
4996
  onClick: () => {
5059
- setDismissed(true);
4997
+ markRead("all");
5060
4998
  },
5061
- children: t("upgradeLater")
4999
+ children: "全部已读"
5000
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
5001
+ type: "button",
5002
+ className: NotificationBell_module_css_default.button,
5003
+ onClick: () => {
5004
+ setOpen(false);
5005
+ },
5006
+ children: "关闭"
5062
5007
  })]
5063
- })]
5064
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Modal, {
5065
- open: dialogOpen,
5066
- onClose: closeDialog,
5067
- title: t("upgradeDialogTitle"),
5068
- description: t("upgradeDialogBody"),
5069
- closeLabel: t("upgradeCancel"),
5070
- footer: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
5071
- variant: "ghost",
5072
- onClick: closeDialog,
5073
- disabled: busy,
5074
- children: t("upgradeCancel")
5075
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
5076
- variant: "primary",
5077
- onClick: () => {
5078
- upgrade();
5079
- },
5080
- disabled: busy,
5081
- children: busy ? t("upgradeBusy") : sessionCount === 0 ? t("upgradeAction") : t("upgradeConfirm")
5082
- })] }),
5083
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
5084
- className: WorkspaceUpgradePrompt_module_css_default.dialogBody,
5085
- children: [
5086
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
5087
- className: WorkspaceUpgradePrompt_module_css_default.dialogText,
5088
- children: sessionCount === 0 ? t("upgradeNoSessions") : warning
5089
- }),
5090
- sessionCount > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
5091
- className: WorkspaceUpgradePrompt_module_css_default.sessionList,
5092
- children: status?.activeSessions.map((session) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
5093
- className: WorkspaceUpgradePrompt_module_css_default.sessionRow,
5094
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
5095
- className: WorkspaceUpgradePrompt_module_css_default.sessionTitle,
5096
- children: session.title ?? session.sessionId
5097
- }), session.cwd ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
5098
- className: WorkspaceUpgradePrompt_module_css_default.sessionPath,
5099
- children: session.cwd
5100
- }) : null]
5101
- }, session.sessionId))
5102
- }) : null,
5103
- error !== "" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
5104
- className: WorkspaceUpgradePrompt_module_css_default.error,
5105
- role: "alert",
5106
- children: error
5107
- }) : null
5108
- ]
5109
- })
5008
+ }),
5009
+ children: [
5010
+ reviewDemoMode() ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
5011
+ className: NotificationBell_module_css_default.demo,
5012
+ children: "演示数据 · 后端契约到达后自动切换"
5013
+ }) : null,
5014
+ state.status === "unavailable" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
5015
+ className: NotificationBell_module_css_default.empty,
5016
+ children: "通知服务待后端联调(task-35);上线后这里会显示审核、上架与 AI 报告事件。"
5017
+ }) : null,
5018
+ state.status !== "unavailable" && items.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
5019
+ className: NotificationBell_module_css_default.empty,
5020
+ children: "暂无通知。"
5021
+ }) : null,
5022
+ items.length === 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
5023
+ className: NotificationBell_module_css_default.list,
5024
+ children: visible.map((item) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
5025
+ type: "button",
5026
+ className: NotificationBell_module_css_default.row,
5027
+ onClick: () => {
5028
+ openOne(item);
5029
+ },
5030
+ children: [
5031
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
5032
+ className: NotificationBell_module_css_default.rowIcon,
5033
+ "data-tone": notificationTone(item.type),
5034
+ "aria-hidden": "true",
5035
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(NotificationIcon, { tone: notificationTone(item.type) })
5036
+ }),
5037
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
5038
+ className: NotificationBell_module_css_default.rowBody,
5039
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
5040
+ className: NotificationBell_module_css_default.rowTitle,
5041
+ children: item.title
5042
+ }), item.body === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
5043
+ className: NotificationBell_module_css_default.rowText,
5044
+ children: item.body
5045
+ })]
5046
+ }),
5047
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
5048
+ className: NotificationBell_module_css_default.rowMeta,
5049
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
5050
+ className: NotificationBell_module_css_default.rowTime,
5051
+ children: item.createdAt.slice(0, 16).replace("T", " ")
5052
+ }), item.read ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
5053
+ className: NotificationBell_module_css_default.dot,
5054
+ "aria-hidden": "true"
5055
+ })]
5056
+ })
5057
+ ]
5058
+ }) }, item.id))
5059
+ }),
5060
+ items.length === 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
5061
+ className: NotificationBell_module_css_default.pager,
5062
+ children: [
5063
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
5064
+ type: "button",
5065
+ disabled: page === 0,
5066
+ onClick: () => {
5067
+ setPage((current) => Math.max(0, current - 1));
5068
+ },
5069
+ children: "上一页"
5070
+ }),
5071
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { children: [
5072
+ "第 ",
5073
+ page + 1,
5074
+ " / ",
5075
+ pages,
5076
+ " 页 · 共 ",
5077
+ items.length,
5078
+ " 条"
5079
+ ] }),
5080
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
5081
+ type: "button",
5082
+ disabled: page >= pages - 1,
5083
+ onClick: () => {
5084
+ setPage((current) => Math.min(pages - 1, current + 1));
5085
+ },
5086
+ children: "下一页"
5087
+ })
5088
+ ]
5089
+ })
5090
+ ]
5110
5091
  })] });
5111
5092
  }
5093
+ /** The automation page's seat: the same inbox under the workflow plaza's heading. */
5094
+ function WorkflowPlazaBell() {
5095
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(NotificationBell, { label: "自动化任务通知" });
5096
+ }
5112
5097
  //#endregion
5113
5098
  //#region src/client/ResourceCatalogSidebar.tsx
5114
5099
  /**
@@ -6212,6 +6197,36 @@ window.__ModuleLoader__.load({
6212
6197
  en
6213
6198
  }), "dataops-managed: settings copy");
6214
6199
  installWanxiangBranding(ctx);
6200
+ /**
6201
+ * The DSH logo returns to the portal page the reader entered from.
6202
+ *
6203
+ * The portal records `dataops.ai.returnTo` in sessionStorage before mounting this frame;
6204
+ * its shell owns the router, so this half only asks it to navigate. The menu label is
6205
+ * DSH-owned, hence the visible-text match rather than a stable id.
6206
+ */
6207
+ ctx.effect(() => {
6208
+ if (window.parent === window) return () => {};
6209
+ const onLogoClick = (event) => {
6210
+ const target = event.target;
6211
+ if (!(target instanceof Element)) return;
6212
+ let node = target;
6213
+ for (let depth = 0; node !== null && depth < 5; depth += 1, node = node.parentElement) {
6214
+ const rect = node.getBoundingClientRect();
6215
+ if (rect.top > 120 || rect.left > 360 || rect.width <= 0 || rect.width > 520) break;
6216
+ if (/万相AI中台|Wanxiang AI/i.test((node.textContent ?? "").trim())) {
6217
+ event.preventDefault();
6218
+ event.stopPropagation();
6219
+ window.parent.postMessage({
6220
+ type: "dataops:return-to",
6221
+ version: 1
6222
+ }, "*");
6223
+ return;
6224
+ }
6225
+ }
6226
+ };
6227
+ document.addEventListener("click", onLogoClick, true);
6228
+ return () => document.removeEventListener("click", onLogoClick, true);
6229
+ }, "dataops-managed: return-to logo");
6215
6230
  const t = ctx.locale.bind(NS);
6216
6231
  /**
6217
6232
  * Register the settings section only for the two administrator role labels.