@yadsh/dsh-qa-surface 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (245) hide show
  1. package/README.md +153 -12
  2. package/lib/account-remotes.js +100 -0
  3. package/lib/account-remotes.js.map +1 -0
  4. package/lib/accounts/credentials.js +27 -0
  5. package/lib/accounts/credentials.js.map +1 -0
  6. package/lib/accounts/errors.js +9 -0
  7. package/lib/accounts/errors.js.map +1 -0
  8. package/lib/accounts/file.js +101 -0
  9. package/lib/accounts/file.js.map +1 -0
  10. package/lib/accounts/store.js +144 -161
  11. package/lib/accounts/store.js.map +1 -1
  12. package/lib/accounts/token.js +61 -0
  13. package/lib/accounts/token.js.map +1 -0
  14. package/lib/attachment-rules.js +111 -0
  15. package/lib/attachment-rules.js.map +1 -0
  16. package/lib/cli.js +122 -9
  17. package/lib/cli.js.map +1 -1
  18. package/lib/client/QaAccountsController.js +32 -2
  19. package/lib/client/QaAccountsController.js.map +1 -1
  20. package/lib/client/QaSessionController.js +47 -65
  21. package/lib/client/QaSessionController.js.map +1 -1
  22. package/lib/client/QaSurface.js +121 -107
  23. package/lib/client/QaSurface.js.map +1 -1
  24. package/lib/client/QaTranscriptAdapter.js +71 -6
  25. package/lib/client/QaTranscriptAdapter.js.map +1 -1
  26. package/lib/client/attachments.js +150 -0
  27. package/lib/client/attachments.js.map +1 -0
  28. package/lib/client/attestation.js +1 -1
  29. package/lib/client/attestation.js.map +1 -1
  30. package/lib/client/base64.js +16 -0
  31. package/lib/client/base64.js.map +1 -0
  32. package/lib/client/chat-files.js +48 -0
  33. package/lib/client/chat-files.js.map +1 -0
  34. package/lib/client/components/Markdown.js +1 -1
  35. package/lib/client/components/Markdown.js.map +1 -1
  36. package/lib/client/components/QaChangelog.js +38 -19
  37. package/lib/client/components/QaChangelog.js.map +1 -1
  38. package/lib/client/components/QaComposer.js +56 -74
  39. package/lib/client/components/QaComposer.js.map +1 -1
  40. package/lib/client/components/QaFileAttachment.js +19 -0
  41. package/lib/client/components/QaFileAttachment.js.map +1 -0
  42. package/lib/client/components/QaFilesPanel.js +45 -0
  43. package/lib/client/components/QaFilesPanel.js.map +1 -0
  44. package/lib/client/components/QaHeader.js +34 -0
  45. package/lib/client/components/QaHeader.js.map +1 -0
  46. package/lib/client/components/QaMessage.js +17 -4
  47. package/lib/client/components/QaMessage.js.map +1 -1
  48. package/lib/client/components/QaModal.js +31 -0
  49. package/lib/client/components/QaModal.js.map +1 -0
  50. package/lib/client/components/QaProfile.js +64 -0
  51. package/lib/client/components/QaProfile.js.map +1 -0
  52. package/lib/client/components/QaRightRail.js +15 -0
  53. package/lib/client/components/QaRightRail.js.map +1 -0
  54. package/lib/client/components/QaSidebar.js +6 -1
  55. package/lib/client/components/QaSidebar.js.map +1 -1
  56. package/lib/client/components/{QaSourcesDrawer.js → QaSourcesPanel.js} +3 -3
  57. package/lib/client/components/QaSourcesPanel.js.map +1 -0
  58. package/lib/client/components/QaTurnRail.js +15 -0
  59. package/lib/client/components/QaTurnRail.js.map +1 -1
  60. package/lib/client/components/QaWidthHandle.js +25 -20
  61. package/lib/client/components/QaWidthHandle.js.map +1 -1
  62. package/lib/client/components/QaWorkGroup.js +19 -20
  63. package/lib/client/components/QaWorkGroup.js.map +1 -1
  64. package/lib/client/components/surface-utils.js +28 -0
  65. package/lib/client/components/surface-utils.js.map +1 -0
  66. package/lib/client/components/thinking-phrases.js +24 -0
  67. package/lib/client/components/thinking-phrases.js.map +1 -0
  68. package/lib/client/create-session.js +7 -32
  69. package/lib/client/create-session.js.map +1 -1
  70. package/lib/client/failure-copy.js +63 -0
  71. package/lib/client/failure-copy.js.map +1 -0
  72. package/lib/client/index.js +38 -7
  73. package/lib/client/index.js.map +1 -1
  74. package/lib/client/prompt-content.js +54 -0
  75. package/lib/client/prompt-content.js.map +1 -0
  76. package/lib/client/settings/card.js +143 -0
  77. package/lib/client/settings/card.js.map +1 -0
  78. package/lib/client/settings/fields.js +145 -0
  79. package/lib/client/settings/fields.js.map +1 -0
  80. package/lib/client/settings/format.js +255 -0
  81. package/lib/client/settings/format.js.map +1 -0
  82. package/lib/client/settings/sections/access.js +25 -0
  83. package/lib/client/settings/sections/access.js.map +1 -0
  84. package/lib/client/settings/sections/accounts.js +47 -0
  85. package/lib/client/settings/sections/accounts.js.map +1 -0
  86. package/lib/client/settings/sections/attachments.js +46 -0
  87. package/lib/client/settings/sections/attachments.js.map +1 -0
  88. package/lib/client/settings/sections/branding.js +28 -0
  89. package/lib/client/settings/sections/branding.js.map +1 -0
  90. package/lib/client/settings/sections/common.js +20 -0
  91. package/lib/client/settings/sections/common.js.map +1 -0
  92. package/lib/client/settings/sections/embedding.js +19 -0
  93. package/lib/client/settings/sections/embedding.js.map +1 -0
  94. package/lib/client/settings/sections/interface.js +60 -0
  95. package/lib/client/settings/sections/interface.js.map +1 -0
  96. package/lib/client/settings/sections/lockdown.js +82 -0
  97. package/lib/client/settings/sections/lockdown.js.map +1 -0
  98. package/lib/client/settings/sections/session.js +53 -0
  99. package/lib/client/settings/sections/session.js.map +1 -0
  100. package/lib/client/settings/sections/sources.js +72 -0
  101. package/lib/client/settings/sections/sources.js.map +1 -0
  102. package/lib/client/settings/sections/status.js +37 -0
  103. package/lib/client/settings/sections/status.js.map +1 -0
  104. package/lib/client/settings/sections.js +23 -0
  105. package/lib/client/settings/sections.js.map +1 -0
  106. package/lib/client/settings/styles.js +57 -0
  107. package/lib/client/settings/styles.js.map +1 -0
  108. package/lib/client/stream-publisher.js +47 -0
  109. package/lib/client/stream-publisher.js.map +1 -0
  110. package/lib/client/styles.js +85 -19
  111. package/lib/client/styles.js.map +1 -1
  112. package/lib/client/types.js.map +1 -1
  113. package/lib/client/use-right-rail.js +96 -0
  114. package/lib/client/use-right-rail.js.map +1 -0
  115. package/lib/client/use-session-ui-state.js +26 -19
  116. package/lib/client/use-session-ui-state.js.map +1 -1
  117. package/lib/client.js +4788 -869
  118. package/lib/client.js.map +1 -1
  119. package/lib/config-resolvers/accounts.js +60 -0
  120. package/lib/config-resolvers/accounts.js.map +1 -0
  121. package/lib/config-resolvers/attachments.js +28 -0
  122. package/lib/config-resolvers/attachments.js.map +1 -0
  123. package/lib/config-resolvers/basics.js +59 -0
  124. package/lib/config-resolvers/basics.js.map +1 -0
  125. package/lib/config-resolvers/defaults.js +132 -0
  126. package/lib/config-resolvers/defaults.js.map +1 -0
  127. package/lib/config-resolvers/lockdown.js +79 -0
  128. package/lib/config-resolvers/lockdown.js.map +1 -0
  129. package/lib/config-resolvers/session.js +42 -0
  130. package/lib/config-resolvers/session.js.map +1 -0
  131. package/lib/config-resolvers/shared.js +42 -0
  132. package/lib/config-resolvers/shared.js.map +1 -0
  133. package/lib/config-resolvers/sources.js +81 -0
  134. package/lib/config-resolvers/sources.js.map +1 -0
  135. package/lib/config-resolvers/ui.js +20 -0
  136. package/lib/config-resolvers/ui.js.map +1 -0
  137. package/lib/config.js +65 -4
  138. package/lib/config.js.map +1 -1
  139. package/lib/entry-redirect.js +2 -1
  140. package/lib/entry-redirect.js.map +1 -1
  141. package/lib/index.js +123 -74
  142. package/lib/index.js.map +1 -1
  143. package/lib/profile.js +214 -0
  144. package/lib/profile.js.map +1 -0
  145. package/lib/prompt-notes.js +231 -0
  146. package/lib/prompt-notes.js.map +1 -0
  147. package/lib/resolve-config.js +35 -410
  148. package/lib/resolve-config.js.map +1 -1
  149. package/lib/secure-session.js +82 -16
  150. package/lib/secure-session.js.map +1 -1
  151. package/lib/shared/session-key.js +18 -0
  152. package/lib/shared/session-key.js.map +1 -0
  153. package/lib/shared/settings.js +10 -0
  154. package/lib/shared/settings.js.map +1 -0
  155. package/lib/thinking-phrases.js +68 -0
  156. package/lib/thinking-phrases.js.map +1 -0
  157. package/lib/typert.host.js +162 -17
  158. package/lib/typert.remote-client.d.ts +5 -1
  159. package/lib/typert.remote-client.js +132 -13
  160. package/lib/types/account-remotes.d.ts +42 -0
  161. package/lib/types/accounts/credentials.d.ts +14 -0
  162. package/lib/types/accounts/errors.d.ts +11 -0
  163. package/lib/types/accounts/file.d.ts +82 -0
  164. package/lib/types/accounts/store.d.ts +66 -43
  165. package/lib/types/accounts/token.d.ts +31 -0
  166. package/lib/types/attachment-rules.d.ts +44 -0
  167. package/lib/types/cli.d.ts +2 -2
  168. package/lib/types/client/QaAccountsController.d.ts +8 -1
  169. package/lib/types/client/QaSessionController.d.ts +16 -16
  170. package/lib/types/client/QaSurface.d.ts +7 -1
  171. package/lib/types/client/attachments.d.ts +54 -0
  172. package/lib/types/client/base64.d.ts +10 -0
  173. package/lib/types/client/chat-files.d.ts +30 -0
  174. package/lib/types/client/components/QaChangelog.d.ts +1 -1
  175. package/lib/types/client/components/QaComposer.d.ts +8 -4
  176. package/lib/types/client/components/QaFileAttachment.d.ts +14 -0
  177. package/lib/types/client/components/QaFilesPanel.d.ts +15 -0
  178. package/lib/types/client/components/QaHeader.d.ts +41 -0
  179. package/lib/types/client/components/QaMessage.d.ts +3 -1
  180. package/lib/types/client/components/QaModal.d.ts +26 -0
  181. package/lib/types/client/components/QaProfile.d.ts +25 -0
  182. package/lib/types/client/components/QaRightRail.d.ts +23 -0
  183. package/lib/types/client/components/QaSidebar.d.ts +14 -0
  184. package/lib/types/client/components/{QaSourcesDrawer.d.ts → QaSourcesPanel.d.ts} +7 -4
  185. package/lib/types/client/components/QaTurnRail.d.ts +6 -0
  186. package/lib/types/client/components/QaWidthHandle.d.ts +14 -7
  187. package/lib/types/client/components/QaWorkGroup.d.ts +5 -3
  188. package/lib/types/client/components/surface-utils.d.ts +11 -0
  189. package/lib/types/client/components/thinking-phrases.d.ts +9 -0
  190. package/lib/types/client/create-session.d.ts +6 -9
  191. package/lib/types/client/failure-copy.d.ts +19 -0
  192. package/lib/types/client/prompt-content.d.ts +30 -0
  193. package/lib/types/client/settings/card.d.ts +23 -0
  194. package/lib/types/client/settings/fields.d.ts +139 -0
  195. package/lib/types/client/settings/format.d.ts +108 -0
  196. package/lib/types/client/settings/sections/access.d.ts +9 -0
  197. package/lib/types/client/settings/sections/accounts.d.ts +9 -0
  198. package/lib/types/client/settings/sections/attachments.d.ts +15 -0
  199. package/lib/types/client/settings/sections/branding.d.ts +8 -0
  200. package/lib/types/client/settings/sections/common.d.ts +28 -0
  201. package/lib/types/client/settings/sections/embedding.d.ts +8 -0
  202. package/lib/types/client/settings/sections/interface.d.ts +9 -0
  203. package/lib/types/client/settings/sections/lockdown.d.ts +9 -0
  204. package/lib/types/client/settings/sections/session.d.ts +9 -0
  205. package/lib/types/client/settings/sections/sources.d.ts +9 -0
  206. package/lib/types/client/settings/sections/status.d.ts +22 -0
  207. package/lib/types/client/settings/sections.d.ts +25 -0
  208. package/lib/types/client/settings/styles.d.ts +8 -0
  209. package/lib/types/client/stream-publisher.d.ts +28 -0
  210. package/lib/types/client/types.d.ts +29 -1
  211. package/lib/types/client/use-right-rail.d.ts +56 -0
  212. package/lib/types/client/use-session-ui-state.d.ts +13 -7
  213. package/lib/types/config-resolvers/accounts.d.ts +15 -0
  214. package/lib/types/config-resolvers/attachments.d.ts +6 -0
  215. package/lib/types/config-resolvers/basics.d.ts +8 -0
  216. package/lib/types/config-resolvers/defaults.d.ts +4 -0
  217. package/lib/types/config-resolvers/lockdown.d.ts +10 -0
  218. package/lib/types/config-resolvers/session.d.ts +6 -0
  219. package/lib/types/config-resolvers/shared.d.ts +16 -0
  220. package/lib/types/config-resolvers/sources.d.ts +6 -0
  221. package/lib/types/config-resolvers/ui.d.ts +6 -0
  222. package/lib/types/index.d.ts +20 -13
  223. package/lib/types/profile.d.ts +76 -0
  224. package/lib/types/prompt-notes.d.ts +110 -0
  225. package/lib/types/resolve-config.d.ts +8 -3
  226. package/lib/types/secure-session.d.ts +26 -1
  227. package/lib/types/shared/session-key.d.ts +23 -0
  228. package/lib/types/shared/settings.d.ts +10 -0
  229. package/lib/types/thinking-phrases.d.ts +17 -0
  230. package/lib/types/types.d.ts +123 -5
  231. package/lib/types/user-workspace.d.ts +38 -0
  232. package/lib/user-workspace.js +231 -0
  233. package/lib/user-workspace.js.map +1 -0
  234. package/package.json +14 -7
  235. package/CHANGELOG.md +0 -176
  236. package/SPEC-dsh-qa-surface.md +0 -2425
  237. package/docs/ARCHITECTURE.md +0 -66
  238. package/docs/COMPATIBILITY.md +0 -14
  239. package/docs/CONFIGURATION.md +0 -199
  240. package/docs/EMBEDDING.md +0 -13
  241. package/docs/SOURCES-MIGRATION.md +0 -28
  242. package/docs/SOURCES-PROVENANCE-AUDIT.md +0 -88
  243. package/docs/SPEC-dsh-qa-surface-accounts.md +0 -219
  244. package/docs/SPEC-dsh-qa-surface-sources-provenance.md +0 -1692
  245. package/lib/client/components/QaSourcesDrawer.js.map +0 -1
@@ -0,0 +1,57 @@
1
+ import { PLUGIN_CARD_SHELL_CSS } from "@yadsh/dsh-plugin-kit/client";
2
+ /**
3
+ * Card stylesheet: the canonical shell (AGENTS.md contract) plus body rules
4
+ * for this plugin's own controls. Every surface, border, and colour comes from
5
+ * `--dsw-alias-*` tokens so light, dark, and system themes stay coherent; the
6
+ * QA page's own palette stays out of the settings page.
7
+ */
8
+ export const QA_SETTINGS_STYLES = `${PLUGIN_CARD_SHELL_CSS}
9
+ .qa-card-body,.qa-card-body *{box-sizing:border-box}
10
+ .qa-card-body{padding-top:16px;display:grid;gap:18px;color:var(--dsw-alias-label-primary)}
11
+ .qa-card-section{display:grid;gap:12px}
12
+ .qa-card-section__title{display:flex;justify-content:space-between;align-items:center;gap:12px}
13
+ .qa-card-section__title h3{font-size:13px;margin:0;display:flex;align-items:center;gap:7px}
14
+ .qa-card-muted{color:var(--dsw-alias-label-tertiary);font-size:12px;margin:0;line-height:1.5}
15
+ .qa-card-modified{font-size:9px;font-weight:600;text-transform:uppercase;letter-spacing:.04em;color:var(--dsw-alias-brand-primary);background:var(--dsw-alias-bg-module-platform);border-radius:999px;padding:1px 7px}
16
+ .qa-card-grid{display:grid;grid-template-columns:minmax(0,1fr);gap:0}
17
+ /* One field per row, like the first-party plugin cards: two columns drifted
18
+ apart wherever a hint wrapped to a different number of lines. Fields reach
19
+ the section directly or through a grid, so both paths share the rhythm. */
20
+ .qa-card-grid>*,.qa-card-section>.qa-card-field{padding:12px 0}
21
+ .qa-card-grid>*+*,.qa-card-section>.qa-card-field:not(:first-child){border-top:.5px solid var(--dsw-alias-border-l2)}
22
+ .qa-card-field{display:grid;gap:6px}
23
+ .qa-card-field>span{font-size:13px;color:var(--dsw-alias-label-primary);font-weight:500}
24
+ .qa-card-control{width:100%;height:34px;border:.5px solid var(--dsw-alias-border-l4);border-radius:8px;background:var(--dsw-alias-bg-layer-3);color:var(--dsw-alias-label-primary);padding:0 12px;font:inherit;font-size:13px;line-height:1.5;outline:none}
25
+ textarea.qa-card-control{height:auto;padding:8px 12px;line-height:1.5;resize:vertical}
26
+ .qa-card-control:focus-visible{border-color:var(--dsw-alias-brand-primary);outline:2px solid var(--dsw-alias-brand-primary);outline-offset:-1px}
27
+ .qa-card-control:disabled{cursor:default;opacity:.45}
28
+ .qa-card-toggle-row{display:flex;align-items:center;justify-content:space-between;gap:12px}
29
+ .qa-card-toggle-copy{display:grid;gap:2px;min-width:0}
30
+ .qa-card-toggle-copy strong{font-size:13px;font-weight:500;color:var(--dsw-alias-label-primary)}
31
+ .qa-card-toggle-copy span{font-size:12px;line-height:1.5;color:var(--dsw-alias-label-tertiary)}
32
+ .qa-card-toggle{appearance:none;width:34px;height:19px;border-radius:999px;background:var(--dsw-alias-label-dimmed);position:relative;cursor:pointer;transition:.18s;flex:none}
33
+ .qa-card-toggle:after{content:'';position:absolute;top:3px;left:3px;width:13px;height:13px;border-radius:50%;background:var(--dsw-alias-bg-layer-3);transition:.18s}
34
+ .qa-card-toggle:checked{background:var(--dsw-alias-brand-primary)}
35
+ .qa-card-toggle:checked:after{transform:translateX(15px)}
36
+ .qa-card-toggle:disabled{cursor:default;opacity:.45}
37
+ .qa-card-btn{height:34px;border:1px solid var(--dsw-alias-border-l2);border-radius:8px;background:var(--dsw-alias-bg-module-platform);color:var(--dsw-alias-label-primary);padding:0 12px;font:inherit;font-size:11px;font-weight:600;cursor:pointer;white-space:nowrap}
38
+ .qa-card-btn:hover:not(:disabled){border-color:var(--dsw-alias-label-dimmed);background:var(--dsw-alias-interactive-bg-hover)}
39
+ .qa-card-btn:disabled{cursor:default;opacity:.45}
40
+ .qa-card-btn.link{height:27px;padding:0 8px;background:transparent}
41
+ .qa-card-status{display:flex;flex-wrap:wrap;gap:8px}
42
+ .qa-card-chip{display:inline-flex;align-items:center;gap:6px;border:1px solid var(--dsw-alias-border-l2);border-radius:999px;padding:3px 10px;font-size:11px;color:var(--dsw-alias-label-secondary)}
43
+ .qa-card-chip b{font-weight:600;color:var(--dsw-alias-label-primary)}
44
+ .qa-card-chip.off{color:var(--dsw-alias-label-tertiary)}
45
+ .qa-card-notice{padding:9px 11px;border-radius:8px;background:var(--dsw-alias-bg-module-platform);border:1px solid var(--dsw-alias-border-l2);font-size:11px;line-height:1.5;color:var(--dsw-alias-label-secondary)}
46
+ .qa-card-notice.warn{border-color:var(--dsw-alias-label-dimmed);color:var(--dsw-alias-label-primary)}
47
+ .qa-card-error{padding:9px 11px;border-radius:8px;background:var(--dsw-alias-bg-error);color:var(--dsw-alias-label-error);font-size:11px;line-height:1.5}
48
+ .qa-card-advanced{border:1px solid var(--dsw-alias-border-l2);border-radius:10px;padding:0 12px}
49
+ .qa-card-advanced summary{cursor:pointer;padding:11px 0;font-size:12px;font-weight:600}
50
+ .qa-card-advanced-content{padding:2px 0 13px;display:grid;gap:10px}
51
+ .qa-card-rows{display:grid;gap:6px}
52
+ .qa-card-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:9px;align-items:center;padding:7px 9px;border:1px solid var(--dsw-alias-border-l2);border-radius:8px;font-size:11px}
53
+ .qa-card-row code{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--dsw-alias-label-primary);font-family:ui-monospace,SFMono-Regular,Consolas,monospace}
54
+ .qa-card-footer{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap}
55
+ .qa-card-footer-note{font-size:10px;color:var(--dsw-alias-label-tertiary);margin:0;line-height:1.5;max-width:64ch}
56
+ `;
57
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/client/settings/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAErE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAW,GAAG,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgDjE,CAAC"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Spacing for a running turn's stream frames. A running turn's frames arrive
3
+ * at animation-frame cadence, so re-projections are spaced at least the
4
+ * configured interval apart: the first frame of a window projects at once and
5
+ * further frames are absorbed (the memoized render path replays nothing, so
6
+ * absorbing a frame only defers it). Everything outside a running turn —
7
+ * phase flips, errors, turn completion — projects immediately, and a
8
+ * non-running notification also cancels an absorbed window so the final
9
+ * state never waits for it. Zero disables the spacing entirely.
10
+ */
11
+ export class StreamPublisher {
12
+ intervalMs;
13
+ timer;
14
+ constructor(intervalMs) {
15
+ this.intervalMs = intervalMs;
16
+ }
17
+ /**
18
+ * Deliver one notification. `running` says whether the bound session is
19
+ * mid-turn; `emit` performs the actual projection and must stay cheap to
20
+ * defer.
21
+ */
22
+ publish(running, emit) {
23
+ if (this.intervalMs <= 0 || !running) {
24
+ this.clear();
25
+ emit();
26
+ return;
27
+ }
28
+ if (this.timer !== undefined)
29
+ return;
30
+ emit();
31
+ this.timer = setTimeout(() => {
32
+ this.timer = undefined;
33
+ }, this.intervalMs);
34
+ }
35
+ /**
36
+ * Cancel an absorbed window so the next frame projects at once. Called
37
+ * when the binding goes away or the controller winds down: a stale window
38
+ * must not swallow the first frame of a fresh binding.
39
+ */
40
+ clear() {
41
+ if (this.timer === undefined)
42
+ return;
43
+ clearTimeout(this.timer);
44
+ this.timer = undefined;
45
+ }
46
+ }
47
+ //# sourceMappingURL=stream-publisher.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stream-publisher.js","sourceRoot":"","sources":["../../src/client/stream-publisher.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,OAAO,eAAe;IAGG,UAAU;IAF/B,KAAK,CAA4C;IAEzD,YAA6B,UAAkB;0BAAlB,UAAU;IAAW,CAAC;IAEnD;;;;OAIG;IACH,OAAO,CAAC,OAAgB,EAAE,IAAgB;QACxC,IAAI,IAAI,CAAC,UAAU,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;YACrC,IAAI,CAAC,KAAK,EAAE,CAAC;YACb,IAAI,EAAE,CAAC;YACP,OAAO;QACT,CAAC;QACD,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS;YAAE,OAAO;QACrC,IAAI,EAAE,CAAC;QACP,IAAI,CAAC,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE;YAC3B,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC;QACzB,CAAC,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IACtB,CAAC;IAED;;;;OAIG;IACH,KAAK;QACH,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS;YAAE,OAAO;QACrC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACzB,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC;IACzB,CAAC;CACF"}
@@ -110,7 +110,9 @@ export const QA_SURFACE_STYLES = String.raw `
110
110
  .dsh-qa-sidebar__version:hover{color:var(--dsw-alias-label-primary)}
111
111
  .dsh-qa-sidebar__version:focus-visible{outline:2px solid var(--dsh-qa-accent);outline-offset:2px;border-radius:4px}
112
112
  .dsh-qa-sidebar__account{display:flex;align-items:center;gap:6px;min-width:0;margin-bottom:6px}
113
- .dsh-qa-sidebar__account-name{min-width:0;overflow:hidden;color:var(--dsw-alias-label-secondary);font-size:12px;line-height:16px;text-overflow:ellipsis;white-space:nowrap}
113
+ .dsh-qa-sidebar__account-name{appearance:none;min-width:0;overflow:hidden;padding:0;border:0;background:0 0;color:var(--dsw-alias-label-secondary);font:inherit;font-size:12px;line-height:16px;text-align:left;text-overflow:ellipsis;white-space:nowrap;cursor:pointer;transition:color .12s}
114
+ .dsh-qa-sidebar__account-name:hover{color:var(--dsw-alias-label-primary)}
115
+ .dsh-qa-sidebar__account-name:focus-visible{outline:2px solid var(--dsh-qa-accent);outline-offset:2px;border-radius:4px}
114
116
  .dsh-qa-sidebar__account-role{flex:none;padding:1px 6px;border-radius:999px;background:var(--dsw-alias-bg-module-platform);color:var(--dsw-alias-label-tertiary);font-size:10px;font-weight:500;line-height:15px}
115
117
  .dsh-qa-sidebar__account-exit{appearance:none;display:grid;place-items:center;flex:none;width:24px;height:24px;padding:0;border:0;border-radius:7px;background:0 0;color:var(--dsw-alias-label-tertiary);cursor:pointer}
116
118
  .dsh-qa-sidebar__account-exit:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}
@@ -136,15 +138,17 @@ export const QA_SURFACE_STYLES = String.raw `
136
138
  .dsh-qa-auth__submit:hover{background:var(--dsh-qa-accent-hover)}
137
139
  .dsh-qa-auth__submit:focus-visible{outline:2px solid var(--dsh-qa-accent);outline-offset:2px}
138
140
  .dsh-qa-auth__submit:disabled{opacity:.6;cursor:default}
139
- .dsh-qa-changelog{position:fixed;inset:0;z-index:2147483600;display:grid;place-items:center;padding:24px;background:var(--dsh-qa-overlay)}
140
- .dsh-qa-changelog__panel{display:flex;flex-direction:column;width:min(560px,100%);max-height:min(640px,100%);border:1px solid var(--dsw-alias-border-l2);border-radius:14px;background:var(--dsw-alias-bg-layer-2);box-shadow:0 18px 48px var(--dsh-qa-overlay);overflow:hidden}
141
- .dsh-qa-changelog__head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex:none;padding:16px 18px 12px;border-bottom:1px solid var(--dsw-alias-border-l2)}
142
- .dsh-qa-changelog__title{margin:0;color:var(--dsw-alias-label-primary);font-size:15px;font-weight:600;line-height:20px}
143
- .dsh-qa-changelog__close{appearance:none;display:grid;place-items:center;flex:none;width:28px;height:28px;padding:0;border:0;border-radius:8px;background:0 0;color:var(--dsw-alias-label-tertiary);cursor:pointer}
144
- .dsh-qa-changelog__close:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}
145
- .dsh-qa-changelog__close:focus-visible{outline:2px solid var(--dsh-qa-accent);outline-offset:-2px}
146
- .dsh-qa-changelog__close svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:1.3;stroke-linecap:round;stroke-linejoin:round}
147
- .dsh-qa-changelog__body{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:6px 18px 18px}
141
+ .dsh-qa-modal{position:fixed;inset:0;z-index:2147483600;display:grid;place-items:center;padding:24px;background:var(--dsh-qa-overlay)}
142
+ .dsh-qa-modal__panel{display:flex;flex-direction:column;width:min(560px,100%);max-height:min(640px,100%);border:1px solid var(--dsw-alias-border-l2);border-radius:14px;background:var(--dsw-alias-bg-layer-2);box-shadow:0 18px 48px var(--dsh-qa-overlay);overflow:hidden}
143
+ .dsh-qa-modal__panel--wide{width:min(720px,100%)}
144
+ .dsh-qa-modal__head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex:none;padding:16px 18px 12px;border-bottom:1px solid var(--dsw-alias-border-l2)}
145
+ .dsh-qa-modal__title{margin:0;color:var(--dsw-alias-label-primary);font-size:15px;font-weight:600;line-height:20px}
146
+ .dsh-qa-modal__close{appearance:none;display:grid;place-items:center;flex:none;width:28px;height:28px;padding:0;border:0;border-radius:8px;background:0 0;color:var(--dsw-alias-label-tertiary);cursor:pointer}
147
+ .dsh-qa-modal__close:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}
148
+ .dsh-qa-modal__close:focus-visible{outline:2px solid var(--dsh-qa-accent);outline-offset:-2px}
149
+ .dsh-qa-modal__close svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:1.3;stroke-linecap:round;stroke-linejoin:round}
150
+ .dsh-qa-modal__body{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:6px 18px 18px}
151
+ .dsh-qa-modal__footer{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex:none;padding:12px 18px;border-top:1px solid var(--dsw-alias-border-l2)}
148
152
  .dsh-qa-changelog__entry{padding-top:10px}
149
153
  .dsh-qa-changelog__version{display:flex;align-items:baseline;gap:8px;margin:0 0 2px;color:var(--dsw-alias-label-primary);font-size:13px;font-weight:600;line-height:20px}
150
154
  .dsh-qa-changelog__date{color:var(--dsw-alias-label-tertiary);font-size:12px;font-weight:400;line-height:16px}
@@ -154,6 +158,25 @@ export const QA_SURFACE_STYLES = String.raw `
154
158
  .dsh-qa-changelog__list{margin:4px 0 0;padding-left:18px;color:var(--dsw-alias-label-secondary);font-size:13px;line-height:20px}
155
159
  .dsh-qa-changelog__list li{margin:3px 0}
156
160
  .dsh-qa-changelog__list li::marker{color:var(--dsw-alias-label-tertiary)}
161
+ .dsh-qa-profile{display:flex;flex-direction:column;gap:12px;margin-top:6px}
162
+ .dsh-qa-profile__lead{margin:0;color:var(--dsw-alias-label-tertiary);font-size:12px;line-height:17px}
163
+ .dsh-qa-profile__field{display:flex;flex-direction:column;gap:5px}
164
+ .dsh-qa-profile__field span{color:var(--dsw-alias-label-secondary);font-size:12px;line-height:16px}
165
+ .dsh-qa-profile__field input,.dsh-qa-profile__field textarea{appearance:none;width:100%;padding:9px 11px;border:1px solid var(--dsw-alias-border-l2);border-radius:9px;background:var(--dsw-alias-bg-base);color:var(--dsw-alias-label-primary);font:inherit;font-size:14px;line-height:20px}
166
+ .dsh-qa-profile__field textarea{min-height:76px;line-height:19px;resize:vertical}
167
+ .dsh-qa-profile__field input:focus,.dsh-qa-profile__field textarea:focus{outline:none;border-color:var(--dsh-qa-brand)}
168
+ .dsh-qa-profile__field input:read-only{opacity:.6}
169
+ .dsh-qa-profile__count{margin:-6px 0 0;color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:15px;text-align:right}
170
+ .dsh-qa-profile__hint{margin:0;color:var(--dsw-alias-label-tertiary);font-size:12px;line-height:17px}
171
+ .dsh-qa-profile__error{margin:0;color:var(--dsh-qa-error);font-size:12px;line-height:17px}
172
+ .dsh-qa-profile__save{appearance:none;padding:8px 16px;border:0;border-radius:9px;background:var(--dsh-qa-brand);color:var(--dsh-qa-accent-contrast);font:inherit;font-size:13px;font-weight:600;line-height:19px;cursor:pointer;transition:background .12s}
173
+ .dsh-qa-profile__save:hover{background:var(--dsh-qa-accent-hover)}
174
+ .dsh-qa-profile__save:focus-visible{outline:2px solid var(--dsh-qa-accent);outline-offset:2px}
175
+ .dsh-qa-profile__save:disabled{opacity:.6;cursor:default}
176
+ .dsh-qa-profile__cancel{appearance:none;padding:8px 14px;border:1px solid var(--dsw-alias-border-l2);border-radius:9px;background:0 0;color:var(--dsw-alias-label-secondary);font:inherit;font-size:13px;line-height:19px;cursor:pointer;transition:color .12s}
177
+ .dsh-qa-profile__cancel:hover{color:var(--dsw-alias-label-primary)}
178
+ .dsh-qa-profile__cancel:focus-visible{outline:2px solid var(--dsh-qa-accent);outline-offset:-2px}
179
+ .dsh-qa-profile__cancel:disabled{opacity:.6;cursor:default}
157
180
  .dsh-qa-surface *{box-sizing:border-box}
158
181
  .dsh-qa-surface ::selection{background:var(--dsh-qa-text-select)}
159
182
  .dsh-qa-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@@ -167,7 +190,6 @@ export const QA_SURFACE_STYLES = String.raw `
167
190
  .dsh-qa-header__mode svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.2;stroke-linecap:round;stroke-linejoin:round}
168
191
  .dsh-qa-header__reset{margin-left:auto;padding:5px 10px;border:0;border-radius:8px;background:transparent;color:var(--dsw-alias-label-secondary);font:inherit;font-size:13px;cursor:pointer}
169
192
  .dsh-qa-header__agents{display:inline-flex;align-items:center;gap:6px;flex:none;padding:5px 10px;border:0;border-radius:8px;background:transparent;color:var(--dsw-alias-label-secondary);font:inherit;font-size:13px;line-height:20px;cursor:pointer}
170
- .dsh-qa-header__agents--end{margin-left:auto}
171
193
  .dsh-qa-header__agents:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}
172
194
  .dsh-qa-header__agents:disabled{opacity:.45;cursor:default}
173
195
  .dsh-qa-header__agents[aria-expanded="true"]{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}
@@ -202,12 +224,18 @@ export const QA_SURFACE_STYLES = String.raw `
202
224
  .dsh-qa-agents__meta{color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:15px}
203
225
  .dsh-qa-agents__open{flex:none;color:var(--dsh-qa-accent);font-size:12px;font-weight:500;line-height:18px}
204
226
  .dsh-qa-header__sources{display:inline-flex;align-items:center;gap:6px;flex:none;padding:5px 10px;border:0;border-radius:8px;background:transparent;color:var(--dsw-alias-label-secondary);font:inherit;font-size:13px;line-height:20px;cursor:pointer}
205
- .dsh-qa-header__sources--end{margin-left:auto}
206
227
  .dsh-qa-header__sources:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}
207
228
  .dsh-qa-header__sources:disabled{opacity:.45;cursor:default}
208
229
  .dsh-qa-header__sources[aria-expanded="true"]{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}
209
230
  .dsh-qa-header__sources svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.2;stroke-linecap:round;stroke-linejoin:round}
210
231
  .dsh-qa-header__sources:focus-visible{outline:2px solid var(--dsh-qa-accent);outline-offset:2px}
232
+ .dsh-qa-header__files{display:inline-flex;align-items:center;gap:6px;flex:none;padding:5px 10px;border:0;border-radius:8px;background:transparent;color:var(--dsw-alias-label-secondary);font:inherit;font-size:13px;line-height:20px;cursor:pointer}
233
+ .dsh-qa-header__files--end{margin-left:auto}
234
+ .dsh-qa-header__files:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}
235
+ .dsh-qa-header__files:disabled{opacity:.45;cursor:default}
236
+ .dsh-qa-header__files[aria-expanded="true"]{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}
237
+ .dsh-qa-header__files svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.2;stroke-linecap:round;stroke-linejoin:round}
238
+ .dsh-qa-header__files:focus-visible{outline:2px solid var(--dsh-qa-accent);outline-offset:2px}
211
239
  .dsh-qa-header__reset:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover)}
212
240
  .dsh-qa-header__reset:disabled{opacity:.45;cursor:default}
213
241
  .dsh-qa-header__tabs{position:relative;z-index:1;display:flex;gap:32px;margin-top:4px}
@@ -233,12 +261,35 @@ export const QA_SURFACE_STYLES = String.raw `
233
261
  .dsh-qa-variants button:focus-visible{outline:2px solid var(--dsh-qa-accent);outline-offset:-1px}
234
262
  .dsh-qa-variants button svg{width:13px;height:13px;fill:none;stroke:currentColor;stroke-width:1.4;stroke-linecap:round;stroke-linejoin:round}
235
263
  .dsh-qa-variants span{min-width:34px;text-align:center;color:var(--dsw-alias-label-tertiary);font-size:12px;line-height:20px;font-variant-numeric:tabular-nums}
236
- .dsh-qa-sources{flex:none;display:flex;flex-direction:column;width:360px;min-height:0;border-left:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-base)}
237
- .dsh-qa-sources__head{display:flex;align-items:center;justify-content:space-between;flex:none;padding:14px 12px 10px 16px;color:var(--dsw-alias-label-primary);font-size:13px;font-weight:600;line-height:20px}
238
- .dsh-qa-sources__head button{appearance:none;display:grid;place-items:center;width:26px;height:26px;padding:0;border:0;border-radius:7px;background:0 0;color:var(--dsw-alias-label-tertiary);cursor:pointer}
239
- .dsh-qa-sources__head button:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}
240
- .dsh-qa-sources__head button:focus-visible{outline:2px solid var(--dsh-qa-accent);outline-offset:-2px}
241
- .dsh-qa-sources__head button svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:1.3;stroke-linecap:round}
264
+ .dsh-qa-panel{flex:none;display:flex;flex-direction:column;width:360px;min-height:0;border-left:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-base)}
265
+ .dsh-qa-panel__strip{display:flex;align-items:center;gap:4px;flex:none;padding:10px 10px 8px 12px}
266
+ .dsh-qa-panel__tab{display:inline-flex;align-items:center;gap:6px;padding:5px 10px;border:0;border-radius:8px;background:transparent;color:var(--dsw-alias-label-tertiary);font:inherit;font-size:13px;font-weight:500;line-height:20px;cursor:pointer}
267
+ .dsh-qa-panel__tab span{display:inline-grid;place-items:center;min-width:19px;height:18px;padding:0 5px;border-radius:999px;background:var(--dsw-alias-bg-layer-3);color:var(--dsw-alias-label-tertiary);font-size:10px;font-weight:400;line-height:18px}
268
+ .dsh-qa-panel__tab:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}
269
+ .dsh-qa-panel__tab--active{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}
270
+ .dsh-qa-panel__tab--active span{background:var(--dsw-alias-bg-module-platform);color:var(--dsw-alias-label-secondary)}
271
+ .dsh-qa-panel__tab:focus-visible{outline:2px solid var(--dsh-qa-accent);outline-offset:-2px}
272
+ .dsh-qa-panel__close{appearance:none;display:grid;place-items:center;width:26px;height:26px;margin-left:auto;flex:none;padding:0;border:0;border-radius:7px;background:0 0;color:var(--dsw-alias-label-tertiary);cursor:pointer}
273
+ .dsh-qa-panel__close:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}
274
+ .dsh-qa-panel__close:focus-visible{outline:2px solid var(--dsh-qa-accent);outline-offset:-2px}
275
+ .dsh-qa-panel__close svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:1.3;stroke-linecap:round}
276
+ .dsh-qa-panel__body{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}
277
+ .dsh-qa-sourcespanel{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}
278
+ .dsh-qa-sourcespanel__all{appearance:none;flex:none;align-self:flex-start;margin:2px 12px 10px 16px;padding:0;border:0;background:transparent;color:var(--dsh-qa-accent);font:inherit;font-size:12px;cursor:pointer}
279
+ .dsh-qa-sourcespanel__all:hover{text-decoration:underline}
280
+ .dsh-qa-sourcespanel__all:focus-visible{outline:2px solid var(--dsh-qa-accent);outline-offset:2px}
281
+ .dsh-qa-files{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:0 10px 12px}
282
+ .dsh-qa-files__empty{margin:12px 6px;color:var(--dsw-alias-label-tertiary);font-size:12px;line-height:17px}
283
+ .dsh-qa-files__group{margin:0 0 14px}
284
+ .dsh-qa-files__group h3{display:flex;align-items:center;gap:7px;margin:6px 4px 8px;color:var(--dsw-alias-label-secondary);font-size:12px;font-weight:600;line-height:18px}
285
+ .dsh-qa-files__jump{appearance:none;display:grid;place-items:center;width:22px;height:22px;flex:none;padding:0;border:0;border-radius:6px;background:0 0;color:var(--dsw-alias-label-tertiary);cursor:pointer}
286
+ .dsh-qa-files__jump:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}
287
+ .dsh-qa-files__jump:focus-visible{outline:2px solid var(--dsh-qa-accent);outline-offset:-2px}
288
+ .dsh-qa-files__jump svg{width:13px;height:13px;fill:none;stroke:currentColor;stroke-width:1.3;stroke-linecap:round;stroke-linejoin:round}
289
+ .dsh-qa-files__items{display:flex;flex-direction:column;align-items:flex-start;gap:8px}
290
+ .dsh-qa-files__thumb{display:inline-block;width:72px;height:54px;box-sizing:border-box;border:1px solid var(--dsw-alias-border-l2);border-radius:8px;background:var(--dsw-alias-bg-layer-2)}
291
+ span.dsh-qa-files__thumb{display:inline-block}
292
+ img.dsh-qa-files__thumb{object-fit:cover;background:var(--dsw-alias-bg-layer-3)}
242
293
  .dsh-qa-sources__list{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:0 10px 12px}
243
294
  .dsh-qa-sources__group{margin:0 0 14px}
244
295
  .dsh-qa-sources__group h3{display:flex;align-items:center;gap:7px;margin:4px 4px 8px;color:var(--dsw-alias-label-secondary);font-size:12px;font-weight:600;line-height:18px}
@@ -298,6 +349,9 @@ a.dsh-qa-sources__title:hover{text-decoration:underline}
298
349
  .dsh-qa-message--user .dsh-qa-message__content{max-width:min(525px,82%);padding:10px 16px;border-radius:22px;background:var(--dsw-specific-bubble);font-size:16px;line-height:24px}
299
350
  .dsh-qa-message__byline{display:block;margin-bottom:2px;color:var(--dsw-alias-label-secondary);font-size:12px;line-height:16px;font-weight:500}
300
351
  .dsh-qa-message__images{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 8px}
352
+ .dsh-qa-message__files{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 8px}
353
+ .dsh-qa-message--user .dsh-qa-message__files{justify-content:flex-end}
354
+ .dsh-qa-message__files .dsh-qa-file{background:var(--dsw-alias-bg-layer-3)}
301
355
  .dsh-qa-message--user .dsh-qa-message__images{justify-content:flex-end}
302
356
  .dsh-qa-message__image{display:block;width:132px;height:96px;border-radius:12px;border:1px solid var(--dsw-alias-border-l2);object-fit:cover;background:var(--dsw-alias-bg-layer-2)}
303
357
  a.dsh-qa-message__image{padding:0}
@@ -389,6 +443,8 @@ a.dsh-qa-srcref:hover,button.dsh-qa-srcref:hover{border-color:var(--dsw-alias-la
389
443
  .dsh-qa-work{width:100%;color:var(--dsw-alias-label-secondary);font-size:14px;line-height:22px}
390
444
  .dsh-qa-work__toggle{display:flex;align-items:center;gap:7px;min-height:30px;margin:0;padding:3px 5px 3px 0;border:0;border-radius:7px;background:transparent;color:var(--dsw-alias-label-secondary);font:inherit;cursor:pointer}
391
445
  .dsh-qa-work__toggle:hover{color:var(--dsw-alias-label-primary)}
446
+ .dsh-qa-work[data-state="error"] .dsh-qa-work__toggle{color:var(--dsh-qa-error)}
447
+ .dsh-qa-work[data-state="error"] .dsh-qa-work__toggle:hover{color:var(--dsh-qa-error)}
392
448
  .dsh-qa-work__toggle:focus-visible{outline:2px solid var(--dsh-qa-accent);outline-offset:2px}
393
449
  .dsh-qa-work__chevron{width:14px;height:14px;flex:none;fill:none;stroke:currentColor;stroke-width:1.25;stroke-linecap:round;stroke-linejoin:round;transition:transform .16s ease}
394
450
  .dsh-qa-work__chevron[data-open],.dsh-qa-work-tool[open]>.dsh-qa-work-item .dsh-qa-work__chevron{transform:rotate(90deg)}
@@ -430,6 +486,16 @@ a.dsh-qa-srcref:hover,button.dsh-qa-srcref:hover{border-color:var(--dsw-alias-la
430
486
  .dsh-qa-quick-questions button:focus-visible{outline:2px solid var(--dsh-qa-accent);outline-offset:1px}
431
487
  .dsh-qa-composer-wrap--drag .dsh-qa-composer{border-color:var(--dsh-qa-accent);border-style:dashed;background:color-mix(in srgb,var(--dsh-qa-accent) 6%,var(--dsw-specific-input-major))}
432
488
  .dsh-qa-composer__images{display:flex;flex-wrap:wrap;gap:8px}
489
+ .dsh-qa-composer__files{display:flex;flex-wrap:wrap;gap:8px}
490
+ .dsh-qa-file{display:flex;align-items:center;gap:10px;max-width:280px;min-width:0;padding:8px 10px;border:1px solid var(--dsw-alias-border-l2);border-radius:12px;background:var(--dsw-alias-bg-layer-2)}
491
+ .dsh-qa-file__badge{display:grid;place-items:center;flex:none;width:34px;height:34px;border-radius:9px;background:var(--dsw-alias-bg-module-platform);color:var(--dsw-alias-label-secondary);font-size:10px;font-weight:700;letter-spacing:.02em}
492
+ .dsh-qa-file__text{display:flex;flex-direction:column;gap:1px;min-width:0}
493
+ .dsh-qa-file__name{color:var(--dsw-alias-label-primary);font-size:13px;line-height:18px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
494
+ .dsh-qa-file__meta{color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:16px}
495
+ .dsh-qa-file button{display:grid;place-items:center;flex:none;width:18px;height:18px;padding:0;border:0;border-radius:999px;background:transparent;color:var(--dsw-alias-label-tertiary);cursor:pointer}
496
+ .dsh-qa-file button:hover{color:var(--dsh-qa-error)}
497
+ .dsh-qa-file button:focus-visible{outline:2px solid var(--dsh-qa-accent);outline-offset:1px}
498
+ .dsh-qa-file button svg{width:11px;height:11px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round}
433
499
  .dsh-qa-composer__image{position:relative;display:block;width:64px;height:64px;flex:none}
434
500
  .dsh-qa-composer__image img{display:block;width:100%;height:100%;object-fit:cover;border-radius:10px;border:1px solid var(--dsw-alias-border-l2)}
435
501
  .dsh-qa-composer__image button{position:absolute;top:-6px;right:-6px;display:grid;place-items:center;width:18px;height:18px;padding:0;border:0;border-radius:999px;background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-secondary);cursor:pointer;box-shadow:var(--dsw-shadow-lv2)}
@@ -458,7 +524,7 @@ a.dsh-qa-srcref:hover,button.dsh-qa-srcref:hover{border-color:var(--dsw-alias-la
458
524
  .dsh-qa-composer__action:disabled{opacity:.4;cursor:default}
459
525
  .dsh-qa-composer__action:focus-visible,.dsh-qa-error button:focus-visible,.dsh-qa-header__reset:focus-visible{outline:2px solid var(--dsh-qa-accent);outline-offset:2px}
460
526
  @media (hover:hover){.dsh-qa-message__actions .dsh-qa-message__meta{opacity:0;transition:opacity 80ms ease}.dsh-qa-message:hover .dsh-qa-message__actions .dsh-qa-message__meta,.dsh-qa-message:focus-within .dsh-qa-message__actions .dsh-qa-message__meta,.dsh-qa-message__actions[data-persistent] .dsh-qa-message__meta{opacity:1}}.dsh-qa-message__actions[data-persistent] .dsh-qa-message__meta{opacity:1}
461
- @media (max-width:600px){.dsh-qa-sidebar{display:none}.dsh-qa-sources,.dsh-qa-agents{position:absolute;inset:0;z-index:6;width:100%;border-left:0}.dsh-qa-header__inner{padding-left:16px;padding-right:16px}.dsh-qa-header h1{max-width:48vw}.dsh-qa-header__mode{font-size:12px}.dsh-qa-width-handle{display:none}.dsh-qa-transcript__inner{max-width:100%;padding:16px 16px 28px}.dsh-qa-footer__inner{max-width:100%}.dsh-qa-message{margin-bottom:16px}.dsh-qa-message--user .dsh-qa-message__content{max-width:88%;font-size:15px}.dsh-qa-message__content{font-size:14px}.dsh-qa-footer{padding-left:10px;padding-right:10px;padding-bottom:max(8px,env(safe-area-inset-bottom))}.dsh-qa-composer{min-height:84px;padding-top:12px}.dsh-qa-composer__hint{font-size:0}.dsh-qa-composer__hint::after{content:"Enter: отправить";font-size:11px}}
527
+ @media (max-width:600px){.dsh-qa-sidebar{display:none}.dsh-qa-panel,.dsh-qa-agents{position:absolute;inset:0;z-index:6;width:100%;border-left:0}.dsh-qa-header__inner{padding-left:16px;padding-right:16px}.dsh-qa-header h1{max-width:48vw}.dsh-qa-header__mode{font-size:12px}.dsh-qa-width-handle{display:none}.dsh-qa-transcript__inner{max-width:100%;padding:16px 16px 28px}.dsh-qa-footer__inner{max-width:100%}.dsh-qa-message{margin-bottom:16px}.dsh-qa-message--user .dsh-qa-message__content{max-width:88%;font-size:15px}.dsh-qa-message__content{font-size:14px}.dsh-qa-footer{padding-left:10px;padding-right:10px;padding-bottom:max(8px,env(safe-area-inset-bottom))}.dsh-qa-composer{min-height:84px;padding-top:12px}.dsh-qa-composer__hint{font-size:0}.dsh-qa-composer__hint::after{content:"Enter: отправить";font-size:11px}}
462
528
  @media (max-height:480px) and (orientation:landscape){.dsh-qa-header__inner{padding-top:6px}.dsh-qa-header__tabs{display:none}.dsh-qa-transcript__inner{padding-top:12px}.dsh-qa-footer{padding-top:12px}.dsh-qa-composer{min-height:72px;gap:4px;padding-top:8px}}
463
529
  @media (prefers-reduced-motion:reduce){.dsh-qa-message__cursor,.dsh-qa-work__spinner,.dsh-qa-work-item__spinner{animation:none}.dsh-qa-work__chevron{transition:none}.dsh-qa-rail__frame,.dsh-qa-rail__pos,.dsh-qa-rail__mark::before,.dsh-qa-rail__mark--busy::before,.dsh-qa-rail__preview{transition:none;animation:none}}
464
530
  `;
@@ -1 +1 @@
1
- {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../src/client/styles.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,gBAAgB,GAAG;IACvB,KAAK,EAAE,SAAS;IAChB,yDAAyD;IACzD,MAAM,EAAE,SAAS;IACjB,UAAU,EAAE,SAAS;IACrB,UAAU,EAAE,SAAS;IACrB,WAAW,EAAE,SAAS;IACtB,uBAAuB;IACvB,IAAI,EAAE,SAAS;IACf,MAAM,EAAE,SAAS;IACjB,MAAM,EAAE,SAAS;IACjB,kBAAkB;IAClB,OAAO,EAAE,SAAS;IAClB,SAAS,EAAE,SAAS;IACpB,SAAS,EAAE,SAAS;IACpB,gBAAgB;IAChB,KAAK,EAAE,SAAS;IAChB,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,UAAU,EAAE,SAAS;IACrB,yBAAyB;IACzB,OAAO,EAAE,SAAS;IAClB,SAAS,EAAE,SAAS;IACpB,SAAS,EAAE,SAAS;IACpB,YAAY,EAAE,SAAS;IACvB,mDAAmD;IACnD,cAAc,EAAE,SAAS;IACzB,qDAAqD;IACrD,OAAO,EAAE,wBAAwB;CACzB,CAAC;AAEX,MAAM,eAAe,GAAG,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC;KACrD,GAAG,CACF,CAAC,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,EAAE,CACjB,YAAY,KAAK,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,MAAM,CAAC,WAAW,EAAE,EAAE,CAAC,IAAI,KAAK,EAAE,CAC1F;KACA,IAAI,CAAC,GAAG,CAAC,CAAC;AAEb,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,GAAG,CAAA;kBACzB,eAAe;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;IACf,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;IAC3B,KAAK,EAAE,IAAI;IACX,OAAO,EAAE,KAAK;IACd,OAAO,EAAE,KAAK;IACd,aAAa,EAAE,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;IAC1B,eAAe,EAAE,IAAI;IACrB,uBAAuB,EAAE,SAAS;IAClC,eAAe,EAAE,IAAI;CACtB,CAAC,CAAC"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/client/types.ts"],"names":[],"mappings":"AA+JA,iFAAiF;AACjF,MAAM,CAAC,MAAM,qBAAqB,GAAmB,MAAM,CAAC,MAAM,CAAC;IACjE,KAAK,EAAE,MAAM;IACb,SAAS,EAAE,IAAI;IACf,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;IAC3B,KAAK,EAAE,IAAI;IACX,OAAO,EAAE,KAAK;IACd,OAAO,EAAE,KAAK;IACd,aAAa,EAAE,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;IAC1B,eAAe,EAAE,IAAI;IACrB,uBAAuB,EAAE,SAAS;IAClC,eAAe,EAAE,IAAI;CACtB,CAAC,CAAC"}
@@ -0,0 +1,96 @@
1
+ import { useCallback } from "react";
2
+ /**
3
+ * Right-rail controller over the chat-local drawer state: every transition
4
+ * between the whole-chat list, a pinned message subset and a single source's
5
+ * detail lives here, so the surface only wires controls to intents. The
6
+ * callbacks stay referentially stable — they close over `useState` setters,
7
+ * whose identities never change.
8
+ */
9
+ export function useRightRail(ui) {
10
+ const { railOpen, railTab, setRailOpen, setRailTab, setDrawerSources, setDrawerCompleteness, setDrawerDetail, setAgentsOpen, } = ui;
11
+ const openSources = useCallback((sources, complete, incompleteOrigins) => {
12
+ setDrawerSources(sources);
13
+ setDrawerCompleteness({
14
+ complete,
15
+ ...(incompleteOrigins === undefined ? {} : { incompleteOrigins }),
16
+ });
17
+ setDrawerDetail(null);
18
+ setRailOpen(true);
19
+ setRailTab("sources");
20
+ setAgentsOpen(false);
21
+ }, [
22
+ setAgentsOpen,
23
+ setDrawerCompleteness,
24
+ setDrawerDetail,
25
+ setDrawerSources,
26
+ setRailOpen,
27
+ setRailTab,
28
+ ]);
29
+ const openSourceDetail = useCallback((source) => {
30
+ setDrawerSources(null);
31
+ setDrawerCompleteness(null);
32
+ setDrawerDetail(source);
33
+ setRailOpen(true);
34
+ setRailTab("sources");
35
+ setAgentsOpen(false);
36
+ }, [
37
+ setAgentsOpen,
38
+ setDrawerCompleteness,
39
+ setDrawerDetail,
40
+ setDrawerSources,
41
+ setRailOpen,
42
+ setRailTab,
43
+ ]);
44
+ const showAllSources = useCallback(() => {
45
+ setDrawerSources(null);
46
+ setDrawerCompleteness(null);
47
+ setDrawerDetail(null);
48
+ }, [setDrawerCompleteness, setDrawerDetail, setDrawerSources]);
49
+ const close = useCallback(() => {
50
+ setRailOpen(false);
51
+ setDrawerSources(null);
52
+ setDrawerCompleteness(null);
53
+ setDrawerDetail(null);
54
+ }, [setDrawerCompleteness, setDrawerDetail, setDrawerSources, setRailOpen]);
55
+ const openTab = useCallback((tab) => {
56
+ if (railOpen && railTab === tab) {
57
+ close();
58
+ return;
59
+ }
60
+ setAgentsOpen(false);
61
+ setRailOpen(true);
62
+ setRailTab(tab);
63
+ if (tab === "sources")
64
+ showAllSources();
65
+ }, [
66
+ close,
67
+ railOpen,
68
+ railTab,
69
+ setAgentsOpen,
70
+ setRailOpen,
71
+ setRailTab,
72
+ showAllSources,
73
+ ]);
74
+ const selectTab = useCallback((tab) => {
75
+ setRailTab(tab);
76
+ }, [setRailTab]);
77
+ const toggleAgents = useCallback(() => {
78
+ setAgentsOpen((open) => !open);
79
+ setRailOpen(false);
80
+ }, [setAgentsOpen, setRailOpen]);
81
+ return {
82
+ railOpen,
83
+ railTab,
84
+ drawerSources: ui.drawerSources,
85
+ drawerCompleteness: ui.drawerCompleteness,
86
+ drawerDetail: ui.drawerDetail,
87
+ openSources,
88
+ openSourceDetail,
89
+ showAllSources,
90
+ close,
91
+ openTab,
92
+ selectTab,
93
+ toggleAgents,
94
+ };
95
+ }
96
+ //# sourceMappingURL=use-right-rail.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-right-rail.js","sourceRoot":"","sources":["../../src/client/use-right-rail.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAsC,MAAM,OAAO,CAAC;AA6DxE;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAAC,EAAoB;IAC/C,MAAM,EACJ,QAAQ,EACR,OAAO,EACP,WAAW,EACX,UAAU,EACV,gBAAgB,EAChB,qBAAqB,EACrB,eAAe,EACf,aAAa,GACd,GAAG,EAAE,CAAC;IAEP,MAAM,WAAW,GAAG,WAAW,CAC7B,CACE,OAA4B,EAC5B,QAAiB,EACjB,iBAAqD,EACrD,EAAE;QACF,gBAAgB,CAAC,OAAO,CAAC,CAAC;QAC1B,qBAAqB,CAAC;YACpB,QAAQ;YACR,GAAG,CAAC,iBAAiB,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,iBAAiB,EAAE,CAAC;SAClE,CAAC,CAAC;QACH,eAAe,CAAC,IAAI,CAAC,CAAC;QACtB,WAAW,CAAC,IAAI,CAAC,CAAC;QAClB,UAAU,CAAC,SAAS,CAAC,CAAC;QACtB,aAAa,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC,EACD;QACE,aAAa;QACb,qBAAqB;QACrB,eAAe;QACf,gBAAgB;QAChB,WAAW;QACX,UAAU;KACX,CACF,CAAC;IAEF,MAAM,gBAAgB,GAAG,WAAW,CAClC,CAAC,MAAgB,EAAE,EAAE;QACnB,gBAAgB,CAAC,IAAI,CAAC,CAAC;QACvB,qBAAqB,CAAC,IAAI,CAAC,CAAC;QAC5B,eAAe,CAAC,MAAM,CAAC,CAAC;QACxB,WAAW,CAAC,IAAI,CAAC,CAAC;Q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AAC;IAClB,CAAC,EACD,CAAC,UAAU,CAAC,CACb,CAAC;IAEF,MAAM,YAAY,GAAG,WAAW,CAAC,GAAG,EAAE;QACpC,aAAa,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;QAC/B,WAAW,CAAC,KAAK,CAAC,CAAC;IACrB,CAAC,EAAE,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC,CAAC;IAEjC,OAAO;QACL,QAAQ;QACR,OAAO;QACP,aAAa,EAAE,EAAE,CAAC,aAAa;QAC/B,kBAAkB,EAAE,EAAE,CAAC,kBAAkB;QACzC,YAAY,EAAE,EAAE,CAAC,YAAY;QAC7B,WAAW;QACX,gBAAgB;QAChB,cAAc;QACd,KAAK;QACL,OAAO;QACP,SAAS;QACT,YAAY;KACb,CAAC;AACJ,CAAC"}
@@ -3,48 +3,53 @@ import { revokeObjectUrlIfBlob } from "./session-assets.js";
3
3
  /**
4
4
  * Per-chat UI state: composer attachments, variant offsets, the rail mark and
5
5
  * the drawers. Everything here describes the chat it was made in, so a
6
- * session change clears it instead of leaking a draft, an image or a drawer
7
- * from one conversation into the next.
6
+ * session change clears it instead of leaking a draft, an attachment or a
7
+ * drawer from one conversation into the next.
8
8
  */
9
9
  export function useSessionUiState(sessionId) {
10
10
  /** Per group: how many answers back from the newest is shown (0 = newest). */
11
11
  const [variantOffsets, setVariantOffsets] = useState({});
12
12
  const [activeTurn, setActiveTurn] = useState(null);
13
13
  const [agentsOpen, setAgentsOpen] = useState(false);
14
- const [sourcesOpen, setSourcesOpen] = useState(false);
14
+ const [railOpen, setRailOpen] = useState(false);
15
+ const [railTab, setRailTab] = useState("sources");
15
16
  const [drawerSources, setDrawerSources] = useState(null);
16
17
  const [drawerCompleteness, setDrawerCompleteness] = useState(null);
17
18
  const [drawerDetail, setDrawerDetail] = useState(null);
18
- const [pendingImages, setPendingImagesState] = useState([]);
19
+ const [pendingAttachments, setPendingAttachmentsState] = useState([]);
19
20
  /** Mirror of the live drafts: blob URLs to revoke when they leave state. */
20
- const pendingImagesRef = useRef([]);
21
+ const pendingAttachmentsRef = useRef([]);
21
22
  /**
22
23
  * The single entry point that changes the draft set: every image that
23
24
  * leaves state has its preview blob URL revoked here, whether it was
24
25
  * removed by the composer, cleared by a send or dropped on a chat switch.
25
26
  */
26
- const setPendingImages = useCallback((next) => {
27
- for (const draft of pendingImagesRef.current) {
28
- if (!next.includes(draft))
27
+ const setPendingAttachments = useCallback((next) => {
28
+ for (const draft of pendingAttachmentsRef.current) {
29
+ if (draft.kind === "image" && !next.includes(draft)) {
29
30
  revokeObjectUrlIfBlob(draft.previewUrl);
31
+ }
30
32
  }
31
- pendingImagesRef.current = next;
32
- setPendingImagesState(next);
33
+ pendingAttachmentsRef.current = next;
34
+ setPendingAttachmentsState(next);
33
35
  }, []);
34
36
  useEffect(() => {
35
37
  setVariantOffsets({});
36
38
  setActiveTurn(null);
37
39
  setAgentsOpen(false);
38
- setSourcesOpen(false);
40
+ setRailOpen(false);
41
+ setRailTab("sources");
39
42
  setDrawerSources(null);
40
43
  setDrawerCompleteness(null);
41
44
  setDrawerDetail(null);
42
- setPendingImages([]);
43
- }, [sessionId, setPendingImages]);
45
+ setPendingAttachments([]);
46
+ }, [sessionId, setPendingAttachments]);
44
47
  // Whatever is still attached dies with the surface, and its URLs with it.
45
48
  useEffect(() => () => {
46
- for (const draft of pendingImagesRef.current)
47
- revokeObjectUrlIfBlob(draft.previewUrl);
49
+ for (const draft of pendingAttachmentsRef.current) {
50
+ if (draft.kind === "image")
51
+ revokeObjectUrlIfBlob(draft.previewUrl);
52
+ }
48
53
  }, []);
49
54
  return {
50
55
  variantOffsets,
@@ -53,16 +58,18 @@ export function useSessionUiState(sessionId) {
53
58
  setActiveTurn,
54
59
  agentsOpen,
55
60
  setAgentsOpen,
56
- sourcesOpen,
57
- setSourcesOpen,
61
+ railOpen,
62
+ setRailOpen,
63
+ railTab,
64
+ setRailTab,
58
65
  drawerSources,
59
66
  setDrawerSources,
60
67
  drawerCompleteness,
61
68
  setDrawerCompleteness,
62
69
  drawerDetail,
63
70
  setDrawerDetail,
64
- pendingImages,
65
- setPendingImages,
71
+ pendingAttachments,
72
+ setPendingAttachments,
66
73
  };
67
74
  }
68
75
  //# sourceMappingURL=use-session-ui-state.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-session-ui-state.js","sourceRoot":"","sources":["../../src/client/use-session-ui-state.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,SAAS,EACT,MAAM,EACN,QAAQ,GAGT,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAiC5D;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAAC,SAAwB;IACxD,8EAA8E;IAC9E,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,QAAQ,CAClD,EAAE,CACH,CAAC;IACF,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC,CAAC;IAClE,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACpD,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACtD,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,QAAQ,CAEhD,IAAI,CAAC,CAAC;IACR,MAAM,CAAC,kBAAkB,EAAE,qBAAqB,CAAC,GAC/C,QAAQ,CAA8B,IAAI,CAAC,CAAC;IAC9C,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAkB,IAAI,CAAC,CAAC;IACxE,MAAM,CAAC,aAAa,EAAE,qBAAqB,CAAC,GAAG,QAAQ,CAErD,EAAE,CAAC,CAAC;IACN,4EAA4E;IAC5E,MAAM,gBAAgB,GAAG,MAAM,CAA0B,EAAE,CAAC,CAAC;IAE7D;;;;OAIG;IACH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