@buoy-gg/ask-buoy 7.0.35 → 7.0.38

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 (286) hide show
  1. package/README.md +73 -15
  2. package/lib/commonjs/blocks/AskBlocks.js +1 -338
  3. package/lib/commonjs/blocks/BlockRenderer.js +1 -250
  4. package/lib/commonjs/blocks/ChromePrototypes.js +1 -514
  5. package/lib/commonjs/blocks/DataBlocks.js +1 -688
  6. package/lib/commonjs/blocks/ExtraBlocks.js +1 -1854
  7. package/lib/commonjs/blocks/MediaBlocks.js +1 -140
  8. package/lib/commonjs/blocks/ReceiptBlocks.js +1 -586
  9. package/lib/commonjs/blocks/blockText.js +1 -0
  10. package/lib/commonjs/blocks/blockText.test.js +1 -0
  11. package/lib/commonjs/blocks/context.js +1 -42
  12. package/lib/commonjs/blocks/icons.js +1 -96
  13. package/lib/commonjs/blocks/index.js +1 -95
  14. package/lib/commonjs/blocks/listRow.test.js +1 -55
  15. package/lib/commonjs/blocks/pageState.js +1 -34
  16. package/lib/commonjs/blocks/pageState.test.js +1 -57
  17. package/lib/commonjs/blocks/primitives.js +1 -401
  18. package/lib/commonjs/blocks/primitivesIndex.js +1 -62
  19. package/lib/commonjs/components/ApprovalCard.js +1 -140
  20. package/lib/commonjs/components/AskBuoyHeader.js +1 -164
  21. package/lib/commonjs/components/AskBuoyIcon.js +1 -19
  22. package/lib/commonjs/components/AskBuoyModal.js +1 -353
  23. package/lib/commonjs/components/AskBuoySettings.js +1 -69
  24. package/lib/commonjs/components/ChangesBar.js +1 -211
  25. package/lib/commonjs/components/Composer.js +1 -175
  26. package/lib/commonjs/components/EmptyState.js +1 -154
  27. package/lib/commonjs/components/KeyboardPad.js +1 -0
  28. package/lib/commonjs/components/Markdown.js +1 -252
  29. package/lib/commonjs/components/MessageList.js +1 -683
  30. package/lib/commonjs/components/QueuedMessages.js +1 -0
  31. package/lib/commonjs/components/ThinkingStrip.js +1 -223
  32. package/lib/commonjs/components/TypingDots.js +1 -63
  33. package/lib/commonjs/components/markdownParse.js +1 -0
  34. package/lib/commonjs/components/markdownParse.test.js +1 -0
  35. package/lib/commonjs/components/useCopyAction.js +1 -50
  36. package/lib/commonjs/index.js +1 -252
  37. package/lib/commonjs/preset.js +1 -90
  38. package/lib/commonjs/store/activityGroups.js +1 -0
  39. package/lib/commonjs/store/activityGroups.test.js +1 -0
  40. package/lib/commonjs/store/askBuoySettings.js +1 -67
  41. package/lib/commonjs/store/askBuoyStore.js +1 -365
  42. package/lib/commonjs/store/blockPlacement.js +1 -0
  43. package/lib/commonjs/store/blockPlacement.test.js +1 -0
  44. package/lib/commonjs/store/queue.test.js +1 -0
  45. package/lib/commonjs/store/resetConversation.js +1 -0
  46. package/lib/commonjs/store/restorePending.test.js +1 -0
  47. package/lib/commonjs/store/restoredIds.test.js +1 -47
  48. package/lib/commonjs/store/suggestions.js +1 -0
  49. package/lib/commonjs/store/suggestions.test.js +1 -0
  50. package/lib/commonjs/store/systemLine.test.js +1 -0
  51. package/lib/commonjs/store/ticketPrompt.js +1 -0
  52. package/lib/commonjs/store/traceText.js +1 -81
  53. package/lib/commonjs/store/traceText.test.js +1 -112
  54. package/lib/commonjs/store/transcriptPersistence.js +1 -208
  55. package/lib/commonjs/store/transcriptPersistence.test.js +1 -185
  56. package/lib/commonjs/store/turnRendering.test.js +1 -0
  57. package/lib/commonjs/store/useAskBuoy.js +1 -400
  58. package/lib/commonjs/store/useAskBuoySettings.js +1 -14
  59. package/lib/commonjs/sync/askBuoySyncAdapter.js +1 -119
  60. package/lib/commonjs/sync/askBuoySyncAdapter.test.js +1 -141
  61. package/lib/commonjs/sync/wire.js +1 -58
  62. package/lib/commonjs/types.js +1 -6
  63. package/lib/module/blocks/AskBlocks.js +1 -331
  64. package/lib/module/blocks/BlockRenderer.js +1 -245
  65. package/lib/module/blocks/ChromePrototypes.js +1 -503
  66. package/lib/module/blocks/DataBlocks.js +1 -674
  67. package/lib/module/blocks/ExtraBlocks.js +1 -1827
  68. package/lib/module/blocks/MediaBlocks.js +1 -135
  69. package/lib/module/blocks/ReceiptBlocks.js +1 -574
  70. package/lib/module/blocks/blockText.js +1 -0
  71. package/lib/module/blocks/blockText.test.js +1 -0
  72. package/lib/module/blocks/context.js +1 -35
  73. package/lib/module/blocks/icons.js +1 -91
  74. package/lib/module/blocks/index.js +1 -8
  75. package/lib/module/blocks/listRow.test.js +1 -56
  76. package/lib/module/blocks/pageState.js +1 -30
  77. package/lib/module/blocks/pageState.test.js +1 -56
  78. package/lib/module/blocks/primitives.js +1 -389
  79. package/lib/module/blocks/primitivesIndex.js +1 -5
  80. package/lib/module/components/ApprovalCard.js +1 -135
  81. package/lib/module/components/AskBuoyHeader.js +1 -161
  82. package/lib/module/components/AskBuoyIcon.js +1 -8
  83. package/lib/module/components/AskBuoyModal.js +1 -348
  84. package/lib/module/components/AskBuoySettings.js +1 -64
  85. package/lib/module/components/ChangesBar.js +1 -206
  86. package/lib/module/components/Composer.js +1 -170
  87. package/lib/module/components/EmptyState.js +1 -149
  88. package/lib/module/components/KeyboardPad.js +1 -0
  89. package/lib/module/components/Markdown.js +1 -246
  90. package/lib/module/components/MessageList.js +1 -677
  91. package/lib/module/components/QueuedMessages.js +1 -0
  92. package/lib/module/components/ThinkingStrip.js +1 -218
  93. package/lib/module/components/TypingDots.js +1 -58
  94. package/lib/module/components/markdownParse.js +1 -0
  95. package/lib/module/components/markdownParse.test.js +1 -0
  96. package/lib/module/components/useCopyAction.js +1 -46
  97. package/lib/module/index.js +1 -34
  98. package/lib/module/preset.js +1 -73
  99. package/lib/module/store/activityGroups.js +1 -0
  100. package/lib/module/store/activityGroups.test.js +1 -0
  101. package/lib/module/store/askBuoySettings.js +1 -62
  102. package/lib/module/store/askBuoyStore.js +1 -361
  103. package/lib/module/store/blockPlacement.js +1 -0
  104. package/lib/module/store/blockPlacement.test.js +1 -0
  105. package/lib/module/store/queue.test.js +1 -0
  106. package/lib/module/store/resetConversation.js +1 -0
  107. package/lib/module/store/restorePending.test.js +1 -0
  108. package/lib/module/store/restoredIds.test.js +1 -46
  109. package/lib/module/store/suggestions.js +1 -0
  110. package/lib/module/store/suggestions.test.js +1 -0
  111. package/lib/module/store/systemLine.test.js +1 -0
  112. package/lib/module/store/ticketPrompt.js +1 -0
  113. package/lib/module/store/traceText.js +1 -75
  114. package/lib/module/store/traceText.test.js +1 -111
  115. package/lib/module/store/transcriptPersistence.js +1 -198
  116. package/lib/module/store/transcriptPersistence.test.js +1 -184
  117. package/lib/module/store/turnRendering.test.js +1 -0
  118. package/lib/module/store/useAskBuoy.js +1 -394
  119. package/lib/module/store/useAskBuoySettings.js +1 -9
  120. package/lib/module/sync/askBuoySyncAdapter.js +1 -114
  121. package/lib/module/sync/askBuoySyncAdapter.test.js +1 -140
  122. package/lib/module/sync/wire.js +1 -47
  123. package/lib/module/types.js +1 -4
  124. package/lib/typescript/blocks/DataBlocks.d.ts +11 -0
  125. package/lib/typescript/blocks/ExtraBlocks.d.ts +18 -2
  126. package/lib/typescript/blocks/blockText.d.ts +14 -0
  127. package/lib/typescript/blocks/blockText.test.d.ts +2 -0
  128. package/lib/typescript/blocks/primitives.d.ts +16 -1
  129. package/lib/typescript/components/ApprovalCard.d.ts +9 -1
  130. package/lib/typescript/components/AskBuoyHeader.d.ts +31 -1
  131. package/lib/typescript/components/Composer.d.ts +16 -1
  132. package/lib/typescript/components/EmptyState.d.ts +5 -1
  133. package/lib/typescript/components/KeyboardPad.d.ts +33 -0
  134. package/lib/typescript/components/Markdown.d.ts +0 -10
  135. package/lib/typescript/components/MessageList.d.ts +7 -2
  136. package/lib/typescript/components/QueuedMessages.d.ts +10 -0
  137. package/lib/typescript/components/markdownParse.d.ts +49 -0
  138. package/lib/typescript/components/markdownParse.test.d.ts +2 -0
  139. package/lib/typescript/preset.d.ts +4 -2
  140. package/lib/typescript/store/activityGroups.d.ts +29 -0
  141. package/lib/typescript/store/activityGroups.test.d.ts +2 -0
  142. package/lib/typescript/store/askBuoySettings.d.ts +22 -0
  143. package/lib/typescript/store/askBuoyStore.d.ts +174 -9
  144. package/lib/typescript/store/blockPlacement.d.ts +30 -0
  145. package/lib/typescript/store/blockPlacement.test.d.ts +2 -0
  146. package/lib/typescript/store/queue.test.d.ts +2 -0
  147. package/lib/typescript/store/resetConversation.d.ts +38 -0
  148. package/lib/typescript/store/restorePending.test.d.ts +2 -0
  149. package/lib/typescript/store/suggestions.d.ts +32 -0
  150. package/lib/typescript/store/suggestions.test.d.ts +2 -0
  151. package/lib/typescript/store/systemLine.test.d.ts +2 -0
  152. package/lib/typescript/store/ticketPrompt.d.ts +11 -0
  153. package/lib/typescript/store/transcriptPersistence.d.ts +41 -2
  154. package/lib/typescript/store/turnRendering.test.d.ts +2 -0
  155. package/lib/typescript/store/useAskBuoy.d.ts +26 -3
  156. package/lib/typescript/sync/askBuoySyncAdapter.d.ts +29 -6
  157. package/package.json +10 -10
  158. package/lib/commonjs/blocks/AskBlocks.js.map +0 -1
  159. package/lib/commonjs/blocks/BlockRenderer.js.map +0 -1
  160. package/lib/commonjs/blocks/ChromePrototypes.js.map +0 -1
  161. package/lib/commonjs/blocks/DataBlocks.js.map +0 -1
  162. package/lib/commonjs/blocks/ExtraBlocks.js.map +0 -1
  163. package/lib/commonjs/blocks/MediaBlocks.js.map +0 -1
  164. package/lib/commonjs/blocks/ReceiptBlocks.js.map +0 -1
  165. package/lib/commonjs/blocks/context.js.map +0 -1
  166. package/lib/commonjs/blocks/icons.js.map +0 -1
  167. package/lib/commonjs/blocks/index.js.map +0 -1
  168. package/lib/commonjs/blocks/listRow.test.js.map +0 -1
  169. package/lib/commonjs/blocks/pageState.js.map +0 -1
  170. package/lib/commonjs/blocks/pageState.test.js.map +0 -1
  171. package/lib/commonjs/blocks/primitives.js.map +0 -1
  172. package/lib/commonjs/blocks/primitivesIndex.js.map +0 -1
  173. package/lib/commonjs/components/ApprovalCard.js.map +0 -1
  174. package/lib/commonjs/components/AskBuoyHeader.js.map +0 -1
  175. package/lib/commonjs/components/AskBuoyIcon.js.map +0 -1
  176. package/lib/commonjs/components/AskBuoyModal.js.map +0 -1
  177. package/lib/commonjs/components/AskBuoySettings.js.map +0 -1
  178. package/lib/commonjs/components/ChangesBar.js.map +0 -1
  179. package/lib/commonjs/components/Composer.js.map +0 -1
  180. package/lib/commonjs/components/EmptyState.js.map +0 -1
  181. package/lib/commonjs/components/Markdown.js.map +0 -1
  182. package/lib/commonjs/components/MessageList.js.map +0 -1
  183. package/lib/commonjs/components/ThinkingStrip.js.map +0 -1
  184. package/lib/commonjs/components/TypingDots.js.map +0 -1
  185. package/lib/commonjs/components/useCopyAction.js.map +0 -1
  186. package/lib/commonjs/index.js.map +0 -1
  187. package/lib/commonjs/preset.js.map +0 -1
  188. package/lib/commonjs/store/askBuoySettings.js.map +0 -1
  189. package/lib/commonjs/store/askBuoyStore.js.map +0 -1
  190. package/lib/commonjs/store/restoredIds.test.js.map +0 -1
  191. package/lib/commonjs/store/traceText.js.map +0 -1
  192. package/lib/commonjs/store/traceText.test.js.map +0 -1
  193. package/lib/commonjs/store/transcriptPersistence.js.map +0 -1
  194. package/lib/commonjs/store/transcriptPersistence.test.js.map +0 -1
  195. package/lib/commonjs/store/useAskBuoy.js.map +0 -1
  196. package/lib/commonjs/store/useAskBuoySettings.js.map +0 -1
  197. package/lib/commonjs/sync/askBuoySyncAdapter.js.map +0 -1
  198. package/lib/commonjs/sync/askBuoySyncAdapter.test.js.map +0 -1
  199. package/lib/commonjs/sync/wire.js.map +0 -1
  200. package/lib/commonjs/types.js.map +0 -1
  201. package/lib/module/blocks/AskBlocks.js.map +0 -1
  202. package/lib/module/blocks/BlockRenderer.js.map +0 -1
  203. package/lib/module/blocks/ChromePrototypes.js.map +0 -1
  204. package/lib/module/blocks/DataBlocks.js.map +0 -1
  205. package/lib/module/blocks/ExtraBlocks.js.map +0 -1
  206. package/lib/module/blocks/MediaBlocks.js.map +0 -1
  207. package/lib/module/blocks/ReceiptBlocks.js.map +0 -1
  208. package/lib/module/blocks/context.js.map +0 -1
  209. package/lib/module/blocks/icons.js.map +0 -1
  210. package/lib/module/blocks/index.js.map +0 -1
  211. package/lib/module/blocks/listRow.test.js.map +0 -1
  212. package/lib/module/blocks/pageState.js.map +0 -1
  213. package/lib/module/blocks/pageState.test.js.map +0 -1
  214. package/lib/module/blocks/primitives.js.map +0 -1
  215. package/lib/module/blocks/primitivesIndex.js.map +0 -1
  216. package/lib/module/components/ApprovalCard.js.map +0 -1
  217. package/lib/module/components/AskBuoyHeader.js.map +0 -1
  218. package/lib/module/components/AskBuoyIcon.js.map +0 -1
  219. package/lib/module/components/AskBuoyModal.js.map +0 -1
  220. package/lib/module/components/AskBuoySettings.js.map +0 -1
  221. package/lib/module/components/ChangesBar.js.map +0 -1
  222. package/lib/module/components/Composer.js.map +0 -1
  223. package/lib/module/components/EmptyState.js.map +0 -1
  224. package/lib/module/components/Markdown.js.map +0 -1
  225. package/lib/module/components/MessageList.js.map +0 -1
  226. package/lib/module/components/ThinkingStrip.js.map +0 -1
  227. package/lib/module/components/TypingDots.js.map +0 -1
  228. package/lib/module/components/useCopyAction.js.map +0 -1
  229. package/lib/module/index.js.map +0 -1
  230. package/lib/module/preset.js.map +0 -1
  231. package/lib/module/store/askBuoySettings.js.map +0 -1
  232. package/lib/module/store/askBuoyStore.js.map +0 -1
  233. package/lib/module/store/restoredIds.test.js.map +0 -1
  234. package/lib/module/store/traceText.js.map +0 -1
  235. package/lib/module/store/traceText.test.js.map +0 -1
  236. package/lib/module/store/transcriptPersistence.js.map +0 -1
  237. package/lib/module/store/transcriptPersistence.test.js.map +0 -1
  238. package/lib/module/store/useAskBuoy.js.map +0 -1
  239. package/lib/module/store/useAskBuoySettings.js.map +0 -1
  240. package/lib/module/sync/askBuoySyncAdapter.js.map +0 -1
  241. package/lib/module/sync/askBuoySyncAdapter.test.js.map +0 -1
  242. package/lib/module/sync/wire.js.map +0 -1
  243. package/lib/module/types.js.map +0 -1
  244. package/lib/typescript/blocks/AskBlocks.d.ts.map +0 -1
  245. package/lib/typescript/blocks/BlockRenderer.d.ts.map +0 -1
  246. package/lib/typescript/blocks/ChromePrototypes.d.ts.map +0 -1
  247. package/lib/typescript/blocks/DataBlocks.d.ts.map +0 -1
  248. package/lib/typescript/blocks/ExtraBlocks.d.ts.map +0 -1
  249. package/lib/typescript/blocks/MediaBlocks.d.ts.map +0 -1
  250. package/lib/typescript/blocks/ReceiptBlocks.d.ts.map +0 -1
  251. package/lib/typescript/blocks/context.d.ts.map +0 -1
  252. package/lib/typescript/blocks/icons.d.ts.map +0 -1
  253. package/lib/typescript/blocks/index.d.ts.map +0 -1
  254. package/lib/typescript/blocks/listRow.test.d.ts.map +0 -1
  255. package/lib/typescript/blocks/pageState.d.ts.map +0 -1
  256. package/lib/typescript/blocks/pageState.test.d.ts.map +0 -1
  257. package/lib/typescript/blocks/primitives.d.ts.map +0 -1
  258. package/lib/typescript/blocks/primitivesIndex.d.ts.map +0 -1
  259. package/lib/typescript/components/ApprovalCard.d.ts.map +0 -1
  260. package/lib/typescript/components/AskBuoyHeader.d.ts.map +0 -1
  261. package/lib/typescript/components/AskBuoyIcon.d.ts.map +0 -1
  262. package/lib/typescript/components/AskBuoyModal.d.ts.map +0 -1
  263. package/lib/typescript/components/AskBuoySettings.d.ts.map +0 -1
  264. package/lib/typescript/components/ChangesBar.d.ts.map +0 -1
  265. package/lib/typescript/components/Composer.d.ts.map +0 -1
  266. package/lib/typescript/components/EmptyState.d.ts.map +0 -1
  267. package/lib/typescript/components/Markdown.d.ts.map +0 -1
  268. package/lib/typescript/components/MessageList.d.ts.map +0 -1
  269. package/lib/typescript/components/ThinkingStrip.d.ts.map +0 -1
  270. package/lib/typescript/components/TypingDots.d.ts.map +0 -1
  271. package/lib/typescript/components/useCopyAction.d.ts.map +0 -1
  272. package/lib/typescript/index.d.ts.map +0 -1
  273. package/lib/typescript/preset.d.ts.map +0 -1
  274. package/lib/typescript/store/askBuoySettings.d.ts.map +0 -1
  275. package/lib/typescript/store/askBuoyStore.d.ts.map +0 -1
  276. package/lib/typescript/store/restoredIds.test.d.ts.map +0 -1
  277. package/lib/typescript/store/traceText.d.ts.map +0 -1
  278. package/lib/typescript/store/traceText.test.d.ts.map +0 -1
  279. package/lib/typescript/store/transcriptPersistence.d.ts.map +0 -1
  280. package/lib/typescript/store/transcriptPersistence.test.d.ts.map +0 -1
  281. package/lib/typescript/store/useAskBuoy.d.ts.map +0 -1
  282. package/lib/typescript/store/useAskBuoySettings.d.ts.map +0 -1
  283. package/lib/typescript/sync/askBuoySyncAdapter.d.ts.map +0 -1
  284. package/lib/typescript/sync/askBuoySyncAdapter.test.d.ts.map +0 -1
  285. package/lib/typescript/sync/wire.d.ts.map +0 -1
  286. package/lib/typescript/types.d.ts.map +0 -1
@@ -1,1854 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.Banner = Banner;
7
- exports.CardCarousel = CardCarousel;
8
- exports.CardView = CardView;
9
- exports.Checkpoint = Checkpoint;
10
- exports.Claim = Claim;
11
- exports.Compare = Compare;
12
- exports.DateTime = DateTime;
13
- exports.Details = Details;
14
- exports.File = File;
15
- exports.Form = Form;
16
- exports.LivePill = LivePill;
17
- exports.MultiSelect = MultiSelect;
18
- exports.Plan = Plan;
19
- exports.Proposal = Proposal;
20
- exports.Screenshot = Screenshot;
21
- exports.Select = Select;
22
- exports.Slider = Slider;
23
- exports.Sparkline = Sparkline;
24
- exports.Suggestions = Suggestions;
25
- exports.Tabs = Tabs;
26
- exports.Task = Task;
27
- exports.Timeline = Timeline;
28
- exports.Upload = Upload;
29
- var _react = require("react");
30
- var _reactNative = require("react-native");
31
- var _sharedUi = require("@buoy-gg/shared-ui");
32
- var _BlockRenderer = require("./BlockRenderer");
33
- var _context = require("./context");
34
- var _primitives = require("./primitives");
35
- var _jsxRuntime = require("react/jsx-runtime");
36
- /**
37
- * Second-wave blocks from the survey (plan §11). Prototype-quality on purpose:
38
- * each one exists so it can be judged on the review page, and the ones that
39
- * survive get the same care as the first wave.
40
- */
41
-
42
- const fmt = v => typeof v === "string" ? v : v === undefined ? "—" : JSON.stringify(v);
43
-
44
- // ---------------------------------------------------------------- Suggestions
45
- function Suggestions({
46
- block
47
- }) {
48
- const h = (0, _context.useBlockHandlers)();
49
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
50
- style: styles.chips,
51
- testID: `buoy-block-suggestions-${block.id}`,
52
- children: block.chips.slice(0, 4).map(c => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
53
- disabled: !!h.busy,
54
- onPress: () => void h.runAction({
55
- label: c.label,
56
- send: c.send ?? c.label
57
- }, block.id),
58
- style: ({
59
- pressed
60
- }) => [styles.chip, pressed && styles.pressed],
61
- accessibilityRole: "button",
62
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
63
- style: styles.chipText,
64
- children: c.label
65
- })
66
- }, c.label))
67
- });
68
- }
69
-
70
- // ---------------------------------------------------------------- MultiSelect
71
- function MultiSelect({
72
- block
73
- }) {
74
- const h = (0, _context.useBlockHandlers)();
75
- const answer = h.answered[block.id];
76
- const locked = !!answer;
77
- const [picked, setPicked] = (0, _react.useState)([]);
78
- const chosen = answer?.kind === "multi" ? answer.optionIds : picked;
79
- const toggle = id => setPicked(p => p.includes(id) ? p.filter(x => x !== id) : [...p, id]);
80
- const ok = picked.length >= (block.min ?? 1) && (!block.max || picked.length <= block.max);
81
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_primitives.Card, {
82
- testID: `buoy-block-multi-${block.id}`,
83
- tone: locked ? undefined : "info",
84
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
85
- style: styles.question,
86
- children: block.question
87
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
88
- style: styles.optionsBox,
89
- children: block.options.map((o, i) => {
90
- const on = chosen.includes(o.id);
91
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Pressable, {
92
- disabled: locked,
93
- onPress: () => toggle(o.id),
94
- style: [styles.option, i > 0 && _primitives.blockStyles.rowDivider, locked && !on && styles.dim],
95
- accessibilityRole: "checkbox",
96
- accessibilityState: {
97
- checked: on
98
- },
99
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
100
- style: [styles.checkbox, on && styles.checkboxOn],
101
- children: on ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.Check, {
102
- size: 11,
103
- color: _sharedUi.night.color.onAccent
104
- }) : null
105
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
106
- style: styles.flex,
107
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
108
- style: styles.optionLabel,
109
- children: o.label
110
- }), o.detail ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
111
- style: styles.optionDetail,
112
- children: o.detail
113
- }) : null]
114
- })]
115
- }, o.id);
116
- })
117
- }), locked ? null : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
118
- style: styles.rowEnd,
119
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
120
- testID: "buoy-block-multi-submit",
121
- disabled: !ok,
122
- onPress: () => h.answer({
123
- blockId: block.id,
124
- kind: "multi",
125
- optionIds: picked,
126
- labels: block.options.filter(o => picked.includes(o.id)).map(o => o.label)
127
- }),
128
- style: [styles.button, styles.buttonPrimary, !ok && styles.disabled],
129
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
130
- style: styles.buttonTextPrimary,
131
- children: block.submitLabel ?? `Use ${picked.length || ""}`.trim()
132
- })
133
- })
134
- })]
135
- });
136
- }
137
-
138
- // ---------------------------------------------------------------- Select (long list)
139
- function Select({
140
- block
141
- }) {
142
- const h = (0, _context.useBlockHandlers)();
143
- const answer = h.answered[block.id];
144
- const [q, setQ] = (0, _react.useState)("");
145
- const [open, setOpen] = (0, _react.useState)(false);
146
- const chosen = answer?.kind === "select" ? answer.label : null;
147
- const items = block.options.filter(o => !q || o.label.toLowerCase().includes(q.toLowerCase())).slice(0, 8);
148
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_primitives.Card, {
149
- testID: `buoy-block-select-${block.id}`,
150
- tone: answer ? undefined : "info",
151
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
152
- style: styles.question,
153
- children: block.label
154
- }), chosen ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
155
- style: styles.decided,
156
- children: chosen
157
- }) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
158
- style: styles.selectBox,
159
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Pressable, {
160
- onPress: () => setOpen(v => !v),
161
- style: styles.selectField,
162
- accessibilityRole: "button",
163
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
164
- style: styles.selectPlaceholder,
165
- children: open ? "Choose…" : `${block.options.length} options`
166
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.ChevronDown, {
167
- size: 14,
168
- color: _sharedUi.night.color.textSecondary
169
- })]
170
- }), open && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
171
- children: [block.searchable !== false && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
172
- style: styles.search,
173
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.Search, {
174
- size: 12,
175
- color: _sharedUi.night.color.textSecondary
176
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TextInput, {
177
- style: styles.searchInput,
178
- value: q,
179
- onChangeText: setQ,
180
- placeholder: "Search",
181
- placeholderTextColor: _sharedUi.night.color.placeholder,
182
- autoCapitalize: "none",
183
- autoCorrect: false
184
- })]
185
- }), items.map((o, i) => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Pressable, {
186
- onPress: () => h.answer({
187
- blockId: block.id,
188
- kind: "select",
189
- optionId: o.id,
190
- label: o.label
191
- }),
192
- style: [styles.option, i > 0 && _primitives.blockStyles.rowDivider],
193
- accessibilityRole: "button",
194
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
195
- style: styles.flex,
196
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
197
- style: styles.optionLabel,
198
- children: o.label
199
- }), o.detail ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
200
- style: styles.optionDetail,
201
- children: o.detail
202
- }) : null]
203
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.ChevronRight, {
204
- size: 12,
205
- color: _sharedUi.night.color.textTertiary
206
- })]
207
- }, o.id)), block.options.length > items.length ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
208
- style: styles.hint,
209
- children: [block.options.length - items.length, " more \u2014 keep typing"]
210
- }) : null]
211
- })]
212
- })]
213
- });
214
- }
215
-
216
- // ---------------------------------------------------------------- Slider
217
- /**
218
- * Tap anywhere on the track to jump there, or use the − / + steppers. No drag
219
- * on purpose: a drag inside a scrolling transcript fights the list for the
220
- * gesture, and a tap-to-place slider does the job with none of that.
221
- */
222
- function SliderControl({
223
- min,
224
- max,
225
- step = 1,
226
- value,
227
- unit,
228
- onChange,
229
- disabled
230
- }) {
231
- const width = (0, _react.useRef)(0);
232
- const pct = max > min ? (value - min) / (max - min) * 100 : 0;
233
- const quantise = raw => Math.min(max, Math.max(min, +(Math.round((raw - min) / step) * step + min).toFixed(6)));
234
- const bump = d => !disabled && onChange(quantise(value + d * step));
235
- const onTrackPress = e => {
236
- if (disabled || width.current <= 0) return;
237
- const ratio = Math.min(1, Math.max(0, e.nativeEvent.locationX / width.current));
238
- onChange(quantise(min + ratio * (max - min)));
239
- };
240
- const onLayout = e => {
241
- width.current = e.nativeEvent.layout.width;
242
- };
243
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
244
- style: styles.sliderRow,
245
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
246
- disabled: disabled,
247
- onPress: () => bump(-1),
248
- style: styles.stepBtn,
249
- accessibilityRole: "button",
250
- accessibilityLabel: "Decrease",
251
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
252
- style: styles.stepText,
253
- children: "\u2212"
254
- })
255
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
256
- style: styles.trackHit,
257
- onLayout: onLayout,
258
- onPress: onTrackPress,
259
- disabled: disabled,
260
- accessibilityRole: "adjustable",
261
- accessibilityValue: {
262
- min,
263
- max,
264
- now: value
265
- },
266
- accessibilityActions: [{
267
- name: "increment"
268
- }, {
269
- name: "decrement"
270
- }],
271
- onAccessibilityAction: e => bump(e.nativeEvent.actionName === "increment" ? 1 : -1),
272
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
273
- style: styles.track,
274
- pointerEvents: "none",
275
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
276
- style: [styles.fill, {
277
- width: `${pct}%`
278
- }]
279
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
280
- style: [styles.thumb, {
281
- left: `${pct}%`
282
- }]
283
- })]
284
- })
285
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
286
- disabled: disabled,
287
- onPress: () => bump(1),
288
- style: styles.stepBtn,
289
- accessibilityRole: "button",
290
- accessibilityLabel: "Increase",
291
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
292
- style: styles.stepText,
293
- children: "+"
294
- })
295
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
296
- style: styles.sliderValue,
297
- children: [value, unit ? ` ${unit}` : ""]
298
- })]
299
- });
300
- }
301
- function Slider({
302
- block
303
- }) {
304
- const h = (0, _context.useBlockHandlers)();
305
- const answer = h.answered[block.id];
306
- const [v, setV] = (0, _react.useState)(block.value ?? block.min);
307
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_primitives.Card, {
308
- testID: `buoy-block-slider-${block.id}`,
309
- tone: answer ? undefined : "info",
310
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
311
- style: styles.question,
312
- children: block.label
313
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
314
- style: styles.pad,
315
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(SliderControl, {
316
- min: block.min,
317
- max: block.max,
318
- step: block.step,
319
- value: answer?.kind === "slider" ? answer.value : v,
320
- unit: block.unit,
321
- onChange: setV,
322
- disabled: !!answer
323
- })
324
- }), answer ? null : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
325
- style: styles.rowEnd,
326
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
327
- onPress: () => h.answer({
328
- blockId: block.id,
329
- kind: "slider",
330
- value: v,
331
- unit: block.unit
332
- }),
333
- style: [styles.button, styles.buttonPrimary],
334
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
335
- style: styles.buttonTextPrimary,
336
- children: ["Use ", v, block.unit ? ` ${block.unit}` : ""]
337
- })
338
- })
339
- })]
340
- });
341
- }
342
-
343
- // ---------------------------------------------------------------- DateTime
344
- function DateTime({
345
- block
346
- }) {
347
- const h = (0, _context.useBlockHandlers)();
348
- const answer = h.answered[block.id];
349
- const [text, setText] = (0, _react.useState)("");
350
- const presets = block.presets ?? [{
351
- label: "Now",
352
- value: new Date().toISOString()
353
- }, {
354
- label: "Tomorrow",
355
- value: new Date(Date.now() + 864e5).toISOString()
356
- }, {
357
- label: "+7 days",
358
- value: new Date(Date.now() + 7 * 864e5).toISOString()
359
- }, {
360
- label: "+30 days",
361
- value: new Date(Date.now() + 30 * 864e5).toISOString()
362
- }];
363
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_primitives.Card, {
364
- testID: `buoy-block-datetime-${block.id}`,
365
- tone: answer ? undefined : "info",
366
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
367
- style: styles.question,
368
- children: block.label
369
- }), answer ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
370
- style: styles.decided,
371
- children: answer.kind === "dateTime" ? answer.label ?? answer.value : "(skipped)"
372
- }) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
373
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
374
- style: [styles.chips, styles.pad],
375
- children: presets.map(p => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
376
- onPress: () => h.answer({
377
- blockId: block.id,
378
- kind: "dateTime",
379
- value: p.value,
380
- label: p.label
381
- }),
382
- style: styles.chip,
383
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
384
- style: styles.chipText,
385
- children: p.label
386
- })
387
- }, p.label))
388
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
389
- style: [styles.inputRow, styles.pad],
390
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TextInput, {
391
- style: styles.input,
392
- value: text,
393
- onChangeText: setText,
394
- placeholder: block.mode === "time" ? "14:30" : "2026-09-15",
395
- placeholderTextColor: _sharedUi.night.color.placeholder,
396
- keyboardType: "numbers-and-punctuation"
397
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
398
- disabled: !text.trim(),
399
- onPress: () => h.answer({
400
- blockId: block.id,
401
- kind: "dateTime",
402
- value: text.trim()
403
- }),
404
- style: [styles.button, styles.buttonPrimary, !text.trim() && styles.disabled],
405
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
406
- style: styles.buttonTextPrimary,
407
- children: "Use"
408
- })
409
- })]
410
- })]
411
- })]
412
- });
413
- }
414
-
415
- // ---------------------------------------------------------------- Form / Proposal
416
- function FieldRow({
417
- f,
418
- value,
419
- onChange,
420
- disabled
421
- }) {
422
- if (f.type === "toggle") {
423
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
424
- style: styles.fieldRow,
425
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
426
- style: styles.fieldLabel,
427
- children: f.label
428
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Switch, {
429
- value: !!value,
430
- onValueChange: onChange,
431
- disabled: disabled,
432
- trackColor: {
433
- true: _sharedUi.night.color.accent,
434
- false: _sharedUi.night.color.fillTertiary
435
- },
436
- thumbColor: _sharedUi.night.color.knob
437
- })]
438
- });
439
- }
440
- if (f.type === "select") {
441
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
442
- style: styles.fieldCol,
443
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
444
- style: styles.fieldLabel,
445
- children: f.label
446
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
447
- style: styles.chips,
448
- children: f.options.map(o => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
449
- disabled: disabled,
450
- onPress: () => onChange(o.id),
451
- style: [styles.chip, value === o.id && styles.chipOn],
452
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
453
- style: [styles.chipText, value === o.id && styles.chipTextOn],
454
- children: o.label
455
- })
456
- }, o.id))
457
- })]
458
- });
459
- }
460
- if (f.type === "slider") {
461
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
462
- style: styles.fieldCol,
463
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
464
- style: styles.fieldLabel,
465
- children: f.label
466
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(SliderControl, {
467
- min: f.min,
468
- max: f.max,
469
- step: f.step,
470
- unit: f.unit,
471
- value: typeof value === "number" ? value : f.min,
472
- onChange: onChange,
473
- disabled: disabled
474
- })]
475
- });
476
- }
477
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
478
- style: styles.fieldRow,
479
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
480
- style: styles.fieldLabel,
481
- children: f.label
482
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TextInput, {
483
- style: styles.fieldInput,
484
- value: value === undefined || value === null ? "" : String(value),
485
- onChangeText: onChange,
486
- editable: !disabled,
487
- placeholder: f.placeholder ?? "",
488
- placeholderTextColor: _sharedUi.night.color.placeholder,
489
- keyboardType: f.type === "number" ? "numeric" : "ascii-capable",
490
- secureTextEntry: f.type === "secret",
491
- autoCapitalize: "none",
492
- autoCorrect: false
493
- })]
494
- });
495
- }
496
- function useFormValues(fields) {
497
- const [values, setValues] = (0, _react.useState)(() => Object.fromEntries(fields.map(f => [f.key, f.value])));
498
- return {
499
- values,
500
- set: (k, v) => setValues(m => ({
501
- ...m,
502
- [k]: v
503
- }))
504
- };
505
- }
506
- function Form({
507
- block
508
- }) {
509
- const h = (0, _context.useBlockHandlers)();
510
- const answer = h.answered[block.id];
511
- const {
512
- values,
513
- set
514
- } = useFormValues(block.fields);
515
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_primitives.Card, {
516
- title: block.title,
517
- testID: `buoy-block-form-${block.id}`,
518
- tone: answer ? undefined : "info",
519
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
520
- style: styles.pad,
521
- children: block.fields.map(f => /*#__PURE__*/(0, _jsxRuntime.jsx)(FieldRow, {
522
- f: f,
523
- value: values[f.key],
524
- onChange: v => set(f.key, v),
525
- disabled: !!answer
526
- }, f.key))
527
- }), answer ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
528
- style: styles.decided,
529
- children: "Sent"
530
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
531
- style: styles.rowEnd,
532
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
533
- onPress: () => h.answer({
534
- blockId: block.id,
535
- kind: "form",
536
- values
537
- }),
538
- style: [styles.button, styles.buttonPrimary],
539
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
540
- style: styles.buttonTextPrimary,
541
- children: block.submitLabel ?? "Send"
542
- })
543
- })
544
- })]
545
- });
546
- }
547
- function Proposal({
548
- block
549
- }) {
550
- const h = (0, _context.useBlockHandlers)();
551
- const answer = h.answered[block.id];
552
- const {
553
- values,
554
- set
555
- } = useFormValues(block.fields);
556
- const approved = answer?.kind === "proposal" ? answer.approved : null;
557
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_primitives.Card, {
558
- testID: `buoy-block-proposal-${block.id}`,
559
- tone: answer ? undefined : "warning",
560
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
561
- style: styles.confirmTitle,
562
- children: block.title
563
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
564
- style: styles.confirmChange,
565
- children: block.change
566
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
567
- style: styles.pad,
568
- children: block.fields.map(f => /*#__PURE__*/(0, _jsxRuntime.jsx)(FieldRow, {
569
- f: f,
570
- value: values[f.key],
571
- onChange: v => set(f.key, v),
572
- disabled: !!answer
573
- }, f.key))
574
- }), block.consequence ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
575
- style: styles.consequence,
576
- children: block.consequence
577
- }) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
578
- style: styles.actionsRow,
579
- children: answer ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
580
- style: styles.decided,
581
- children: approved ? "✓ Applied with these values" : "✕ Not applied"
582
- }) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
583
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
584
- onPress: () => h.answer({
585
- blockId: block.id,
586
- kind: "proposal",
587
- approved: true,
588
- values
589
- }),
590
- style: [styles.button, styles.buttonPrimary],
591
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
592
- style: styles.buttonTextPrimary,
593
- children: block.approveLabel ?? "Apply"
594
- })
595
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
596
- onPress: () => h.answer({
597
- blockId: block.id,
598
- kind: "proposal",
599
- approved: false
600
- }),
601
- style: [styles.button, styles.buttonPlate],
602
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
603
- style: styles.buttonTextPlate,
604
- children: "Not now"
605
- })
606
- })]
607
- })
608
- })]
609
- });
610
- }
611
-
612
- // ---------------------------------------------------------------- Claim (citations + verify)
613
- function Claim({
614
- block
615
- }) {
616
- const h = (0, _context.useBlockHandlers)();
617
- const [open, setOpen] = (0, _react.useState)(null);
618
- const state = h.actionState?.[`${block.id}:${block.verify?.label ?? "Verify"}`];
619
- const verified = block.verified || state === "done";
620
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
621
- style: styles.claim,
622
- testID: `buoy-block-claim-${block.id}`,
623
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
624
- style: styles.claimText,
625
- children: [block.text, block.sources.map((s, i) => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
626
- onPress: () => setOpen(open === i ? null : i),
627
- style: styles.cite,
628
- children: [" [", i + 1, "]"]
629
- }, i)), verified ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
630
- style: styles.verified,
631
- children: " \u2713 verified"
632
- }) : null]
633
- }), open !== null && block.sources[open] ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
634
- style: styles.citeBox,
635
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
636
- style: styles.citeLabel,
637
- children: ["[", open + 1, "] ", block.sources[open].label]
638
- }), block.sources[open].detail ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
639
- style: styles.citeDetail,
640
- children: block.sources[open].detail
641
- }) : null]
642
- }) : null, block.verify && !verified ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Pressable, {
643
- onPress: () => void h.runAction(block.verify, block.id),
644
- style: styles.verifyBtn,
645
- accessibilityRole: "button",
646
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.RefreshCw, {
647
- size: 11,
648
- color: _sharedUi.night.color.accent
649
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
650
- style: styles.verifyText,
651
- children: state === "running" ? "Checking…" : block.verify.label
652
- })]
653
- }) : null]
654
- });
655
- }
656
-
657
- // ---------------------------------------------------------------- Details / Tabs
658
- function Details({
659
- block
660
- }) {
661
- const [open, setOpen] = (0, _react.useState)(!!block.open);
662
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_primitives.Card, {
663
- testID: `buoy-block-details-${block.id}`,
664
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Pressable, {
665
- onPress: () => setOpen(v => !v),
666
- style: _primitives.blockStyles.row,
667
- accessibilityRole: "button",
668
- accessibilityState: {
669
- expanded: open
670
- },
671
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
672
- style: _primitives.blockStyles.rowTitle,
673
- children: block.summary
674
- }), open ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.ChevronDown, {
675
- size: 12,
676
- color: _sharedUi.night.color.textTertiary
677
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.ChevronRight, {
678
- size: 12,
679
- color: _sharedUi.night.color.textTertiary
680
- })]
681
- }), open ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
682
- style: styles.detailsBody,
683
- selectable: true,
684
- children: block.body
685
- }) : null]
686
- });
687
- }
688
-
689
- /**
690
- * The tool-header segmented control, not a strip of this block's own.
691
- *
692
- * `NightSegmented` is what the dial settings and the network tool mount, so a
693
- * tabbed block now reads as part of the same product rather than as a
694
- * lookalike drawn next to it. `sm` is its compact variant, which is what a
695
- * control inside a chat bubble wants.
696
- *
697
- * Keyed by INDEX, not label: two tabs may legitimately share a label, and a
698
- * duplicate key would collapse them into one.
699
- */
700
- function Tabs({
701
- block
702
- }) {
703
- const [i, setI] = (0, _react.useState)(0);
704
- const tabs = block.tabs.map((t, k) => ({
705
- key: String(k),
706
- label: t.label
707
- }));
708
- const active = block.tabs[i];
709
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
710
- style: styles.tabsWrap,
711
- testID: `buoy-block-tabs-${block.id}`,
712
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.NightSegmented, {
713
- tabs: tabs,
714
- activeKey: String(i),
715
- onChange: key => setI(Number(key)),
716
- size: "sm"
717
- }), active ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_BlockRenderer.BlockRenderer, {
718
- block: active.block
719
- }) : null]
720
- });
721
- }
722
-
723
- // ---------------------------------------------------------------- Timeline
724
- /** Ten fits a phone without the answer above it scrolling away. */
725
- const TIMELINE_CAP = 10;
726
- function Timeline({
727
- block
728
- }) {
729
- /**
730
- * The cap used to be a bare `.slice(0, 10)` while the "+N more" line below
731
- * compared `total` against the FULL event array — so eleven events with a
732
- * matching total rendered ten and said nothing about the eleventh, and a
733
- * total larger than the array rendered a "+N more" that was only ever a
734
- * label. Both counts come from the pager now.
735
- */
736
- const paged = (0, _primitives.usePaged)(block.events, TIMELINE_CAP);
737
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_primitives.Card, {
738
- title: block.title ?? "What happened",
739
- source: block.source,
740
- testID: `buoy-block-timeline-${block.id}`,
741
- children: [paged.visible.map((e, i) => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
742
- style: styles.tlRow,
743
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
744
- style: styles.tlAt,
745
- children: e.at
746
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
747
- style: styles.tlLine,
748
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
749
- style: [styles.tlDot, {
750
- backgroundColor: (0, _primitives.toneColor)(e.tone ?? "muted")
751
- }]
752
- }), i < paged.visible.length - 1 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
753
- style: styles.tlStem
754
- }) : null]
755
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
756
- style: styles.flex,
757
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
758
- style: styles.tlSource,
759
- children: e.source.toUpperCase()
760
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
761
- style: _primitives.blockStyles.rowTitle,
762
- numberOfLines: 2,
763
- children: e.label
764
- })]
765
- })]
766
- }, i)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.More, {
767
- paged: paged
768
- })]
769
- });
770
- }
771
-
772
- // ---------------------------------------------------------------- Sparkline
773
- function Sparkline({
774
- block
775
- }) {
776
- const s = block.series.slice(-60);
777
- const max = Math.max(1, ...s);
778
- const min = Math.min(...s, 0);
779
- const H = 44;
780
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_primitives.Card, {
781
- title: block.title,
782
- source: block.source,
783
- testID: `buoy-block-sparkline-${block.id}`,
784
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
785
- style: styles.sparkHead,
786
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
787
- style: styles.sparkCurrent,
788
- children: [block.current ?? s[s.length - 1], block.unit ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
789
- style: styles.sparkUnit,
790
- children: [" ", block.unit]
791
- }) : null]
792
- }), block.live ? /*#__PURE__*/(0, _jsxRuntime.jsx)(LivePill, {}) : null]
793
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
794
- style: [styles.spark, {
795
- height: H
796
- }],
797
- children: s.map((v, i) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
798
- style: [styles.sparkBar, {
799
- height: Math.max(2, (v - min) / (max - min || 1) * H),
800
- backgroundColor: i === s.length - 1 ? _sharedUi.night.color.accent : _sharedUi.night.color.accentBorderStrong
801
- }]
802
- }, i))
803
- }), block.label ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
804
- style: styles.hint,
805
- children: block.label
806
- }) : null]
807
- });
808
- }
809
- function LivePill() {
810
- const o = (0, _react.useRef)(new _reactNative.Animated.Value(1)).current;
811
- (0, _react.useEffect)(() => {
812
- const loop = _reactNative.Animated.loop(_reactNative.Animated.sequence([_reactNative.Animated.timing(o, {
813
- toValue: 0.3,
814
- duration: 700,
815
- useNativeDriver: true
816
- }), _reactNative.Animated.timing(o, {
817
- toValue: 1,
818
- duration: 700,
819
- useNativeDriver: true
820
- })]));
821
- loop.start();
822
- return () => loop.stop();
823
- }, [o]);
824
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
825
- style: styles.live,
826
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Animated.View, {
827
- style: [styles.liveDot, {
828
- opacity: o
829
- }]
830
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
831
- style: styles.liveText,
832
- children: "LIVE"
833
- })]
834
- });
835
- }
836
-
837
- // ---------------------------------------------------------------- Compare
838
- function Compare({
839
- block
840
- }) {
841
- const keys = [...new Set([...block.left.pairs.map(p => p.key), ...block.right.pairs.map(p => p.key)])];
842
- const l = Object.fromEntries(block.left.pairs.map(p => [p.key, p.value]));
843
- const r = Object.fromEntries(block.right.pairs.map(p => [p.key, p.value]));
844
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_primitives.Card, {
845
- title: block.title,
846
- source: block.source,
847
- testID: `buoy-block-compare-${block.id}`,
848
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
849
- style: styles.cmpHead,
850
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
851
- style: styles.cmpKey
852
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
853
- style: styles.cmpCol,
854
- children: block.left.title
855
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
856
- style: styles.cmpCol,
857
- children: block.right.title
858
- })]
859
- }), keys.map((k, i) => {
860
- const diff = JSON.stringify(l[k]) !== JSON.stringify(r[k]);
861
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
862
- style: [styles.cmpRow, i > 0 && _primitives.blockStyles.rowDivider, diff && styles.cmpDiff],
863
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
864
- style: styles.cmpKey,
865
- numberOfLines: 1,
866
- children: k
867
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
868
- style: [styles.cmpVal, diff && {
869
- color: _sharedUi.night.color.danger
870
- }],
871
- numberOfLines: 2,
872
- children: fmt(l[k])
873
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
874
- style: [styles.cmpVal, diff && {
875
- color: _sharedUi.night.color.accent
876
- }],
877
- numberOfLines: 2,
878
- children: fmt(r[k])
879
- })]
880
- }, k);
881
- })]
882
- });
883
- }
884
-
885
- // ---------------------------------------------------------------- Card / carousel
886
- function CardBody({
887
- c,
888
- id
889
- }) {
890
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
891
- children: [c.image ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Image, {
892
- source: {
893
- uri: c.image
894
- },
895
- style: styles.cardImage,
896
- resizeMode: "contain",
897
- accessibilityLabel: c.title
898
- }) : null, /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
899
- style: styles.cardText,
900
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
901
- style: styles.cardTitle,
902
- numberOfLines: 2,
903
- children: c.title
904
- }), c.subtitle ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
905
- style: _primitives.blockStyles.rowSub,
906
- numberOfLines: 2,
907
- children: c.subtitle
908
- }) : null, c.facts?.slice(0, 4).map(f => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
909
- style: styles.fact,
910
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
911
- style: styles.factLabel,
912
- children: f.label
913
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
914
- style: [styles.factValue, f.tone && {
915
- color: (0, _primitives.toneColor)(f.tone)
916
- }],
917
- children: f.value
918
- })]
919
- }, f.label))]
920
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.ActionRow, {
921
- actions: c.actions,
922
- blockId: id
923
- })]
924
- });
925
- }
926
- function CardView({
927
- block
928
- }) {
929
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.Card, {
930
- source: block.source,
931
- testID: `buoy-block-card-${block.id}`,
932
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(CardBody, {
933
- c: block,
934
- id: block.id
935
- })
936
- });
937
- }
938
- function CardCarousel({
939
- block
940
- }) {
941
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
942
- testID: `buoy-block-cardcarousel-${block.id}`,
943
- children: [block.title ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
944
- style: styles.carouselTitle,
945
- children: block.title
946
- }) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ScrollView, {
947
- horizontal: true,
948
- showsHorizontalScrollIndicator: false,
949
- snapToInterval: 232,
950
- decelerationRate: "fast",
951
- contentContainerStyle: styles.carousel,
952
- children: block.cards.slice(0, 8).map((c, i) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
953
- style: styles.carouselCard,
954
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(CardBody, {
955
- c: c,
956
- id: `${block.id}-${i}`
957
- })
958
- }, `${c.title}-${i}`))
959
- })]
960
- });
961
- }
962
-
963
- // ---------------------------------------------------------------- Screenshot
964
- function Screenshot({
965
- block
966
- }) {
967
- const [big, setBig] = (0, _react.useState)(false);
968
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_primitives.Card, {
969
- title: block.route ? `Screen · ${block.route}` : "Screen",
970
- source: block.source,
971
- testID: `buoy-block-screenshot-${block.id}`,
972
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
973
- onPress: () => setBig(v => !v),
974
- accessibilityRole: "imagebutton",
975
- accessibilityLabel: block.caption ?? "Screenshot",
976
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Image, {
977
- source: {
978
- uri: block.url
979
- },
980
- style: [styles.shot, big && styles.shotBig],
981
- resizeMode: "contain"
982
- })
983
- }), block.caption ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
984
- style: styles.hint,
985
- children: block.caption
986
- }) : null]
987
- });
988
- }
989
-
990
- // ---------------------------------------------------------------- Plan / Checkpoint / Task
991
- function Plan({
992
- block
993
- }) {
994
- const done = block.steps.filter(s => s.state === "done").length;
995
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_primitives.Card, {
996
- title: block.title,
997
- testID: `buoy-block-plan-${block.id}`,
998
- tone: block.pending ? "info" : undefined,
999
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
1000
- style: styles.progress,
1001
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
1002
- style: [styles.progressFill, {
1003
- width: `${done / Math.max(1, block.steps.length) * 100}%`
1004
- }]
1005
- })
1006
- }), block.steps.map((s, i) => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
1007
- style: [styles.step, i > 0 && _primitives.blockStyles.rowDivider],
1008
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
1009
- style: [styles.stepMark, s.state === "done" && styles.stepDone, s.state === "failed" && styles.stepFailed, s.state === "running" && styles.stepRunning],
1010
- children: s.state === "done" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.Check, {
1011
- size: 10,
1012
- color: _sharedUi.night.color.onAccent
1013
- }) : s.state === "failed" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.X, {
1014
- size: 10,
1015
- color: _sharedUi.night.color.text
1016
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
1017
- style: styles.stepNum,
1018
- children: i + 1
1019
- })
1020
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
1021
- style: [_primitives.blockStyles.rowTitle, s.state === "done" && styles.muted],
1022
- children: [s.text, s.state === "running" ? "…" : ""]
1023
- })]
1024
- }, i)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.ActionRow, {
1025
- actions: block.actions ?? (block.pending ? [{
1026
- label: "Go",
1027
- primary: true,
1028
- send: "Go ahead with the plan."
1029
- }, {
1030
- label: "Change it",
1031
- send: "Let me change the plan first."
1032
- }] : undefined),
1033
- blockId: block.id
1034
- })]
1035
- });
1036
- }
1037
- function Checkpoint({
1038
- block
1039
- }) {
1040
- const h = (0, _context.useBlockHandlers)();
1041
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Pressable, {
1042
- testID: `buoy-block-checkpoint-${block.id}`,
1043
- disabled: !block.restore,
1044
- onPress: () => block.restore && void h.runAction(block.restore, block.id),
1045
- style: styles.checkpoint,
1046
- accessibilityRole: "button",
1047
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
1048
- style: styles.cpFlag
1049
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
1050
- style: styles.cpText,
1051
- children: [block.label, block.at ? ` · ${block.at}` : ""]
1052
- }), block.restore ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
1053
- style: styles.cpRestore,
1054
- children: block.restore.label
1055
- }) : null]
1056
- });
1057
- }
1058
- function Task({
1059
- block
1060
- }) {
1061
- const color = block.status === "failed" ? _sharedUi.night.color.danger : block.status === "done" ? _sharedUi.night.color.accent : _sharedUi.night.color.info;
1062
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_primitives.Card, {
1063
- testID: `buoy-block-task-${block.id}`,
1064
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
1065
- style: styles.taskHead,
1066
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
1067
- style: styles.cardTitle,
1068
- children: block.title
1069
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
1070
- style: [_primitives.blockStyles.pill, {
1071
- backgroundColor: `${color}22`
1072
- }],
1073
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
1074
- style: [_primitives.blockStyles.pillText, {
1075
- color
1076
- }],
1077
- children: block.status.toUpperCase()
1078
- })
1079
- })]
1080
- }), block.progress !== undefined ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
1081
- style: [styles.progress, styles.pad],
1082
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
1083
- style: [styles.progressFill, {
1084
- width: `${Math.round(block.progress * 100)}%`,
1085
- backgroundColor: color
1086
- }]
1087
- })
1088
- }) : null, block.detail ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
1089
- style: styles.hint,
1090
- children: block.detail
1091
- }) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.ActionRow, {
1092
- actions: block.actions,
1093
- blockId: block.id
1094
- })]
1095
- });
1096
- }
1097
-
1098
- // ---------------------------------------------------------------- Banner / File / Upload / NotBuilt
1099
- function Banner({
1100
- block
1101
- }) {
1102
- const color = block.tone === "danger" ? _sharedUi.night.color.danger : block.tone === "warning" ? _sharedUi.night.color.warning : _sharedUi.night.color.info;
1103
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
1104
- style: [styles.banner, {
1105
- borderColor: color,
1106
- backgroundColor: `${color}1A`
1107
- }],
1108
- testID: `buoy-block-banner-${block.id}`,
1109
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.AlertTriangle, {
1110
- size: 13,
1111
- color: color
1112
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
1113
- style: [styles.bannerText, {
1114
- color
1115
- }],
1116
- numberOfLines: 2,
1117
- children: block.text
1118
- }), block.actions?.[0] ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.ActionRow, {
1119
- actions: block.actions.slice(0, 1),
1120
- blockId: block.id,
1121
- align: "right"
1122
- }) : null]
1123
- });
1124
- }
1125
- function File({
1126
- block
1127
- }) {
1128
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_primitives.Card, {
1129
- testID: `buoy-block-file-${block.id}`,
1130
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
1131
- style: _primitives.blockStyles.row,
1132
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
1133
- style: styles.fileIcon,
1134
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
1135
- style: styles.fileExt,
1136
- children: (block.type ?? block.name.split(".").pop() ?? "file").toUpperCase().slice(0, 4)
1137
- })
1138
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
1139
- style: styles.flex,
1140
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
1141
- style: _primitives.blockStyles.rowTitle,
1142
- numberOfLines: 1,
1143
- children: block.name
1144
- }), block.size ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
1145
- style: _primitives.blockStyles.rowSub,
1146
- children: block.size
1147
- }) : null]
1148
- })]
1149
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.ActionRow, {
1150
- actions: block.actions,
1151
- blockId: block.id
1152
- })]
1153
- });
1154
- }
1155
- function Upload({
1156
- block
1157
- }) {
1158
- const h = (0, _context.useBlockHandlers)();
1159
- const answer = h.answered[block.id];
1160
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_primitives.Card, {
1161
- testID: `buoy-block-upload-${block.id}`,
1162
- tone: answer ? undefined : "info",
1163
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
1164
- style: styles.question,
1165
- children: block.label
1166
- }), answer ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
1167
- style: styles.decided,
1168
- children: answer.kind === "upload" ? `Attached ${answer.name}` : "(skipped)"
1169
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
1170
- style: [styles.rowEnd, {
1171
- justifyContent: "flex-start"
1172
- }],
1173
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
1174
- onPress: () => h.answer({
1175
- blockId: block.id,
1176
- kind: "upload",
1177
- name: "screenshot.png"
1178
- }),
1179
- style: [styles.button, styles.buttonPlate],
1180
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
1181
- style: styles.buttonTextPlate,
1182
- children: block.accept === "image" ? "Choose a screenshot" : "Choose a file"
1183
- })
1184
- })
1185
- })]
1186
- });
1187
- }
1188
- const styles = _reactNative.StyleSheet.create({
1189
- flex: {
1190
- flex: 1
1191
- },
1192
- pad: {
1193
- paddingHorizontal: 12,
1194
- paddingBottom: 8
1195
- },
1196
- muted: {
1197
- color: _sharedUi.night.color.textSecondary
1198
- },
1199
- dim: {
1200
- opacity: 0.45
1201
- },
1202
- disabled: {
1203
- opacity: 0.5
1204
- },
1205
- pressed: {
1206
- opacity: 0.7
1207
- },
1208
- question: {
1209
- color: _sharedUi.night.color.text,
1210
- fontSize: _sharedUi.night.font.row,
1211
- fontWeight: "600",
1212
- lineHeight: 20,
1213
- paddingHorizontal: 12,
1214
- paddingTop: 12,
1215
- paddingBottom: 8
1216
- },
1217
- hint: {
1218
- color: _sharedUi.night.color.textTertiary,
1219
- fontSize: _sharedUi.night.font.micro,
1220
- paddingHorizontal: 12,
1221
- paddingBottom: 10
1222
- },
1223
- decided: {
1224
- color: _sharedUi.night.color.textSecondary,
1225
- fontSize: _sharedUi.night.font.caption,
1226
- fontWeight: "600",
1227
- paddingHorizontal: 12,
1228
- paddingVertical: 10
1229
- },
1230
- rowEnd: {
1231
- flexDirection: "row",
1232
- justifyContent: "flex-end",
1233
- paddingHorizontal: 12,
1234
- paddingBottom: 12,
1235
- gap: 8
1236
- },
1237
- actionsRow: {
1238
- flexDirection: "row",
1239
- gap: 8,
1240
- paddingHorizontal: 12,
1241
- paddingVertical: 12,
1242
- alignItems: "center"
1243
- },
1244
- button: {
1245
- paddingHorizontal: 14,
1246
- paddingVertical: 9,
1247
- borderRadius: _sharedUi.night.radius.row
1248
- },
1249
- buttonPrimary: {
1250
- backgroundColor: _sharedUi.night.color.accent
1251
- },
1252
- buttonPlate: {
1253
- backgroundColor: _sharedUi.night.color.button
1254
- },
1255
- buttonTextPrimary: {
1256
- color: _sharedUi.night.color.onAccent,
1257
- fontSize: _sharedUi.night.font.caption,
1258
- fontWeight: "600"
1259
- },
1260
- buttonTextPlate: {
1261
- color: _sharedUi.night.color.text,
1262
- fontSize: _sharedUi.night.font.caption,
1263
- fontWeight: "600"
1264
- },
1265
- chips: {
1266
- flexDirection: "row",
1267
- flexWrap: "wrap",
1268
- gap: 6
1269
- },
1270
- chip: {
1271
- paddingHorizontal: 12,
1272
- paddingVertical: 7,
1273
- borderRadius: _sharedUi.night.radius.chip,
1274
- backgroundColor: _sharedUi.night.color.fill,
1275
- borderWidth: _reactNative.StyleSheet.hairlineWidth,
1276
- borderColor: _sharedUi.night.color.border
1277
- },
1278
- chipOn: {
1279
- backgroundColor: _sharedUi.night.color.accentSoft,
1280
- borderColor: _sharedUi.night.color.accentBorderStrong
1281
- },
1282
- chipText: {
1283
- color: _sharedUi.night.color.text,
1284
- fontSize: _sharedUi.night.font.caption
1285
- },
1286
- chipTextOn: {
1287
- color: _sharedUi.night.color.accent,
1288
- fontWeight: "600"
1289
- },
1290
- optionsBox: {
1291
- marginHorizontal: 8,
1292
- marginBottom: 8,
1293
- borderRadius: _sharedUi.night.radius.row,
1294
- backgroundColor: _sharedUi.night.color.surfaceElevated,
1295
- overflow: "hidden"
1296
- },
1297
- option: {
1298
- flexDirection: "row",
1299
- alignItems: "center",
1300
- gap: 10,
1301
- paddingHorizontal: 12,
1302
- paddingVertical: 10
1303
- },
1304
- optionLabel: {
1305
- color: _sharedUi.night.color.text,
1306
- fontSize: _sharedUi.night.font.body,
1307
- fontWeight: "500"
1308
- },
1309
- optionDetail: {
1310
- color: _sharedUi.night.color.textSecondary,
1311
- fontSize: _sharedUi.night.font.caption
1312
- },
1313
- checkbox: {
1314
- width: 20,
1315
- height: 20,
1316
- borderRadius: 6,
1317
- borderWidth: 1.5,
1318
- borderColor: _sharedUi.night.color.textTertiary,
1319
- alignItems: "center",
1320
- justifyContent: "center"
1321
- },
1322
- checkboxOn: {
1323
- backgroundColor: _sharedUi.night.color.accent,
1324
- borderColor: _sharedUi.night.color.accent
1325
- },
1326
- selectBox: {
1327
- marginHorizontal: 12,
1328
- marginBottom: 12,
1329
- borderRadius: _sharedUi.night.radius.row,
1330
- backgroundColor: _sharedUi.night.color.surfaceElevated,
1331
- overflow: "hidden"
1332
- },
1333
- selectField: {
1334
- flexDirection: "row",
1335
- alignItems: "center",
1336
- justifyContent: "space-between",
1337
- paddingHorizontal: 12,
1338
- paddingVertical: 11
1339
- },
1340
- selectPlaceholder: {
1341
- color: _sharedUi.night.color.textSecondary,
1342
- fontSize: _sharedUi.night.font.body
1343
- },
1344
- search: {
1345
- flexDirection: "row",
1346
- alignItems: "center",
1347
- gap: 6,
1348
- paddingHorizontal: 12,
1349
- paddingVertical: 6,
1350
- borderTopWidth: _reactNative.StyleSheet.hairlineWidth,
1351
- borderTopColor: _sharedUi.night.color.separator
1352
- },
1353
- searchInput: {
1354
- flex: 1,
1355
- color: _sharedUi.night.color.text,
1356
- fontSize: _sharedUi.night.font.caption,
1357
- paddingVertical: 4
1358
- },
1359
- sliderRow: {
1360
- flexDirection: "row",
1361
- alignItems: "center",
1362
- gap: 8
1363
- },
1364
- stepBtn: {
1365
- width: 28,
1366
- height: 28,
1367
- borderRadius: 14,
1368
- backgroundColor: _sharedUi.night.color.fill,
1369
- alignItems: "center",
1370
- justifyContent: "center"
1371
- },
1372
- stepText: {
1373
- color: _sharedUi.night.color.text,
1374
- fontSize: 16,
1375
- fontWeight: "600"
1376
- },
1377
- trackHit: {
1378
- flex: 1,
1379
- height: 36,
1380
- justifyContent: "center"
1381
- },
1382
- track: {
1383
- height: 6,
1384
- borderRadius: 3,
1385
- backgroundColor: _sharedUi.night.color.fillTertiary,
1386
- justifyContent: "center"
1387
- },
1388
- fill: {
1389
- height: 6,
1390
- borderRadius: 3,
1391
- backgroundColor: _sharedUi.night.color.accent
1392
- },
1393
- thumb: {
1394
- position: "absolute",
1395
- width: 20,
1396
- height: 20,
1397
- borderRadius: 10,
1398
- backgroundColor: _sharedUi.night.color.knob,
1399
- marginLeft: -10,
1400
- shadowColor: "#000",
1401
- shadowOpacity: 0.35,
1402
- shadowRadius: 3,
1403
- shadowOffset: {
1404
- width: 0,
1405
- height: 1
1406
- }
1407
- },
1408
- sliderValue: {
1409
- width: 64,
1410
- textAlign: "right",
1411
- color: _sharedUi.night.color.text,
1412
- fontSize: _sharedUi.night.font.caption,
1413
- fontWeight: "600"
1414
- },
1415
- inputRow: {
1416
- flexDirection: "row",
1417
- alignItems: "center",
1418
- gap: 8,
1419
- paddingBottom: 12
1420
- },
1421
- input: {
1422
- flex: 1,
1423
- height: 38,
1424
- paddingHorizontal: 12,
1425
- borderRadius: _sharedUi.night.radius.row,
1426
- backgroundColor: _sharedUi.night.color.surfaceElevated,
1427
- color: _sharedUi.night.color.text,
1428
- fontSize: _sharedUi.night.font.body
1429
- },
1430
- fieldRow: {
1431
- flexDirection: "row",
1432
- alignItems: "center",
1433
- justifyContent: "space-between",
1434
- gap: 10,
1435
- paddingVertical: 6
1436
- },
1437
- fieldCol: {
1438
- paddingVertical: 6,
1439
- gap: 6
1440
- },
1441
- fieldLabel: {
1442
- color: _sharedUi.night.color.textSecondary,
1443
- fontSize: _sharedUi.night.font.caption,
1444
- width: 110
1445
- },
1446
- fieldInput: {
1447
- flex: 1,
1448
- height: 34,
1449
- paddingHorizontal: 10,
1450
- borderRadius: _sharedUi.night.radius.segment,
1451
- backgroundColor: _sharedUi.night.color.surfaceElevated,
1452
- color: _sharedUi.night.color.text,
1453
- fontSize: _sharedUi.night.font.caption
1454
- },
1455
- confirmTitle: {
1456
- color: _sharedUi.night.color.text,
1457
- fontSize: _sharedUi.night.font.row,
1458
- fontWeight: "600",
1459
- paddingHorizontal: 12,
1460
- paddingTop: 12
1461
- },
1462
- confirmChange: {
1463
- color: _sharedUi.night.color.text,
1464
- fontSize: _sharedUi.night.font.body,
1465
- lineHeight: 19,
1466
- paddingHorizontal: 12,
1467
- paddingTop: 6,
1468
- paddingBottom: 6
1469
- },
1470
- consequence: {
1471
- color: _sharedUi.night.color.warning,
1472
- fontSize: _sharedUi.night.font.caption,
1473
- paddingHorizontal: 12
1474
- },
1475
- claim: {
1476
- gap: 6,
1477
- paddingHorizontal: 2
1478
- },
1479
- claimText: {
1480
- color: _sharedUi.night.color.text,
1481
- fontSize: _sharedUi.night.font.row,
1482
- lineHeight: 22
1483
- },
1484
- cite: {
1485
- color: _sharedUi.night.color.accent,
1486
- fontSize: _sharedUi.night.font.caption,
1487
- fontWeight: "700"
1488
- },
1489
- verified: {
1490
- color: _sharedUi.night.color.accent,
1491
- fontSize: _sharedUi.night.font.caption,
1492
- fontWeight: "600"
1493
- },
1494
- citeBox: {
1495
- padding: 10,
1496
- borderRadius: _sharedUi.night.radius.row,
1497
- backgroundColor: _sharedUi.night.color.surface,
1498
- borderWidth: _reactNative.StyleSheet.hairlineWidth,
1499
- borderColor: _sharedUi.night.color.border,
1500
- gap: 2
1501
- },
1502
- citeLabel: {
1503
- color: _sharedUi.night.color.text,
1504
- fontSize: _sharedUi.night.font.caption,
1505
- fontWeight: "600"
1506
- },
1507
- citeDetail: {
1508
- color: _sharedUi.night.color.textSecondary,
1509
- fontSize: _sharedUi.night.font.caption,
1510
- fontFamily: "Menlo"
1511
- },
1512
- verifyBtn: {
1513
- alignSelf: "flex-start",
1514
- flexDirection: "row",
1515
- alignItems: "center",
1516
- gap: 5,
1517
- paddingHorizontal: 10,
1518
- paddingVertical: 5,
1519
- borderRadius: _sharedUi.night.radius.chip,
1520
- backgroundColor: _sharedUi.night.color.accentSoft
1521
- },
1522
- verifyText: {
1523
- color: _sharedUi.night.color.accent,
1524
- fontSize: _sharedUi.night.font.micro,
1525
- fontWeight: "700"
1526
- },
1527
- detailsBody: {
1528
- color: _sharedUi.night.color.textSecondary,
1529
- fontSize: _sharedUi.night.font.caption,
1530
- lineHeight: 18,
1531
- paddingHorizontal: 12,
1532
- paddingBottom: 12
1533
- },
1534
- tabsWrap: {
1535
- gap: 8
1536
- },
1537
- tabBar: {
1538
- flexDirection: "row",
1539
- gap: 6
1540
- },
1541
- tab: {
1542
- paddingHorizontal: 12,
1543
- paddingVertical: 6,
1544
- borderRadius: _sharedUi.night.radius.badge,
1545
- backgroundColor: _sharedUi.night.color.fill
1546
- },
1547
- tabOn: {
1548
- backgroundColor: _sharedUi.night.color.accentSoft
1549
- },
1550
- tabText: {
1551
- color: _sharedUi.night.color.textSecondary,
1552
- fontSize: _sharedUi.night.font.caption,
1553
- fontWeight: "600"
1554
- },
1555
- tabTextOn: {
1556
- color: _sharedUi.night.color.accent
1557
- },
1558
- tlRow: {
1559
- flexDirection: "row",
1560
- gap: 10,
1561
- paddingHorizontal: 12,
1562
- paddingVertical: 4,
1563
- alignItems: "flex-start"
1564
- },
1565
- tlAt: {
1566
- width: 46,
1567
- color: _sharedUi.night.color.textTertiary,
1568
- fontSize: _sharedUi.night.font.micro,
1569
- fontFamily: "Menlo",
1570
- paddingTop: 3
1571
- },
1572
- tlLine: {
1573
- width: 12,
1574
- alignItems: "center"
1575
- },
1576
- tlDot: {
1577
- width: 8,
1578
- height: 8,
1579
- borderRadius: 4,
1580
- marginTop: 5
1581
- },
1582
- tlStem: {
1583
- width: 1,
1584
- flex: 1,
1585
- minHeight: 18,
1586
- backgroundColor: _sharedUi.night.color.separator,
1587
- marginTop: 2
1588
- },
1589
- tlSource: {
1590
- color: _sharedUi.night.color.textTertiary,
1591
- fontSize: 9,
1592
- fontWeight: "700",
1593
- letterSpacing: 0.6
1594
- },
1595
- sparkHead: {
1596
- flexDirection: "row",
1597
- alignItems: "center",
1598
- justifyContent: "space-between",
1599
- paddingHorizontal: 12,
1600
- paddingTop: 8
1601
- },
1602
- sparkCurrent: {
1603
- color: _sharedUi.night.color.text,
1604
- fontSize: 22,
1605
- fontWeight: "700"
1606
- },
1607
- sparkUnit: {
1608
- color: _sharedUi.night.color.textSecondary,
1609
- fontSize: _sharedUi.night.font.caption,
1610
- fontWeight: "500"
1611
- },
1612
- spark: {
1613
- flexDirection: "row",
1614
- alignItems: "flex-end",
1615
- gap: 2,
1616
- paddingHorizontal: 12,
1617
- paddingTop: 6,
1618
- paddingBottom: 6
1619
- },
1620
- sparkBar: {
1621
- flex: 1,
1622
- borderRadius: 1
1623
- },
1624
- live: {
1625
- flexDirection: "row",
1626
- alignItems: "center",
1627
- gap: 5,
1628
- paddingHorizontal: 8,
1629
- paddingVertical: 3,
1630
- borderRadius: _sharedUi.night.radius.badge,
1631
- backgroundColor: _sharedUi.night.color.dangerSoft
1632
- },
1633
- liveDot: {
1634
- width: 6,
1635
- height: 6,
1636
- borderRadius: 3,
1637
- backgroundColor: _sharedUi.night.color.danger
1638
- },
1639
- liveText: {
1640
- color: _sharedUi.night.color.danger,
1641
- fontSize: 9,
1642
- fontWeight: "800",
1643
- letterSpacing: 0.8
1644
- },
1645
- cmpHead: {
1646
- flexDirection: "row",
1647
- paddingHorizontal: 12,
1648
- paddingVertical: 6,
1649
- backgroundColor: _sharedUi.night.color.fill,
1650
- gap: 8
1651
- },
1652
- cmpCol: {
1653
- flex: 1,
1654
- color: _sharedUi.night.color.textTertiary,
1655
- fontSize: _sharedUi.night.font.micro,
1656
- fontWeight: "700",
1657
- letterSpacing: 0.6,
1658
- textTransform: "uppercase"
1659
- },
1660
- cmpRow: {
1661
- flexDirection: "row",
1662
- paddingHorizontal: 12,
1663
- paddingVertical: 8,
1664
- gap: 8,
1665
- alignItems: "flex-start"
1666
- },
1667
- cmpDiff: {
1668
- backgroundColor: _sharedUi.night.color.fill
1669
- },
1670
- cmpKey: {
1671
- width: 90,
1672
- color: _sharedUi.night.color.textSecondary,
1673
- fontSize: _sharedUi.night.font.caption
1674
- },
1675
- cmpVal: {
1676
- flex: 1,
1677
- color: _sharedUi.night.color.text,
1678
- fontSize: _sharedUi.night.font.caption,
1679
- fontFamily: "Menlo"
1680
- },
1681
- /**
1682
- * A fixed box the image is fitted INTO, never cropped to.
1683
- *
1684
- * This was `cover`, which is right for a decorative banner and wrong for
1685
- * everything the agent actually passes: product art, avatars and sprites are
1686
- * square, and a square scaled to fill a 2.4:1 box loses its top and bottom —
1687
- * a Charizard reduced to a band of its own middle. These pictures are the
1688
- * app's DATA, being looked at in a devtool; cropping hides the thing you
1689
- * opened the card to see. `contain` letterboxes a wide image instead, which
1690
- * costs a little space and no information. The fill behind it is the
1691
- * letterbox. Same reasoning as the screenshot block, which was already
1692
- * `contain`.
1693
- */
1694
- cardImage: {
1695
- width: "100%",
1696
- height: 140,
1697
- backgroundColor: _sharedUi.night.color.fill
1698
- },
1699
- cardText: {
1700
- paddingHorizontal: 12,
1701
- paddingTop: 10,
1702
- paddingBottom: 4,
1703
- gap: 4
1704
- },
1705
- cardTitle: {
1706
- color: _sharedUi.night.color.text,
1707
- fontSize: _sharedUi.night.font.row,
1708
- fontWeight: "600"
1709
- },
1710
- fact: {
1711
- flexDirection: "row",
1712
- justifyContent: "space-between",
1713
- gap: 8
1714
- },
1715
- factLabel: {
1716
- color: _sharedUi.night.color.textSecondary,
1717
- fontSize: _sharedUi.night.font.caption
1718
- },
1719
- factValue: {
1720
- color: _sharedUi.night.color.text,
1721
- fontSize: _sharedUi.night.font.caption,
1722
- fontWeight: "500"
1723
- },
1724
- carouselTitle: {
1725
- color: _sharedUi.night.color.text,
1726
- fontSize: _sharedUi.night.font.caption,
1727
- fontWeight: "600",
1728
- paddingBottom: 8
1729
- },
1730
- carousel: {
1731
- gap: 8,
1732
- paddingRight: 8
1733
- },
1734
- carouselCard: {
1735
- width: 224,
1736
- borderRadius: _sharedUi.night.radius.card,
1737
- borderWidth: _reactNative.StyleSheet.hairlineWidth,
1738
- borderColor: _sharedUi.night.color.border,
1739
- backgroundColor: _sharedUi.night.color.surface,
1740
- overflow: "hidden"
1741
- },
1742
- shot: {
1743
- width: "100%",
1744
- height: 220,
1745
- backgroundColor: _sharedUi.night.color.fill
1746
- },
1747
- shotBig: {
1748
- height: 520
1749
- },
1750
- progress: {
1751
- height: 4,
1752
- backgroundColor: _sharedUi.night.color.fill,
1753
- marginHorizontal: 12,
1754
- marginTop: 6,
1755
- marginBottom: 8,
1756
- borderRadius: 2,
1757
- overflow: "hidden"
1758
- },
1759
- progressFill: {
1760
- height: 4,
1761
- backgroundColor: _sharedUi.night.color.accent
1762
- },
1763
- step: {
1764
- flexDirection: "row",
1765
- alignItems: "center",
1766
- gap: 10,
1767
- paddingHorizontal: 12,
1768
- paddingVertical: 9
1769
- },
1770
- stepMark: {
1771
- width: 20,
1772
- height: 20,
1773
- borderRadius: 10,
1774
- backgroundColor: _sharedUi.night.color.fillTertiary,
1775
- alignItems: "center",
1776
- justifyContent: "center"
1777
- },
1778
- stepDone: {
1779
- backgroundColor: _sharedUi.night.color.accent
1780
- },
1781
- stepFailed: {
1782
- backgroundColor: _sharedUi.night.color.danger
1783
- },
1784
- stepRunning: {
1785
- backgroundColor: _sharedUi.night.color.info
1786
- },
1787
- stepNum: {
1788
- color: _sharedUi.night.color.text,
1789
- fontSize: _sharedUi.night.font.micro,
1790
- fontWeight: "700"
1791
- },
1792
- checkpoint: {
1793
- alignSelf: "flex-start",
1794
- flexDirection: "row",
1795
- alignItems: "center",
1796
- gap: 8,
1797
- paddingHorizontal: 12,
1798
- paddingVertical: 7,
1799
- borderRadius: _sharedUi.night.radius.chip,
1800
- backgroundColor: _sharedUi.night.color.fill
1801
- },
1802
- cpFlag: {
1803
- width: 8,
1804
- height: 8,
1805
- borderRadius: 2,
1806
- backgroundColor: _sharedUi.night.color.info
1807
- },
1808
- cpText: {
1809
- color: _sharedUi.night.color.textSecondary,
1810
- fontSize: _sharedUi.night.font.caption
1811
- },
1812
- cpRestore: {
1813
- color: _sharedUi.night.color.accent,
1814
- fontSize: _sharedUi.night.font.caption,
1815
- fontWeight: "600"
1816
- },
1817
- taskHead: {
1818
- flexDirection: "row",
1819
- alignItems: "center",
1820
- justifyContent: "space-between",
1821
- gap: 8,
1822
- paddingHorizontal: 12,
1823
- paddingTop: 12
1824
- },
1825
- banner: {
1826
- flexDirection: "row",
1827
- alignItems: "center",
1828
- gap: 8,
1829
- paddingLeft: 12,
1830
- paddingRight: 4,
1831
- paddingVertical: 4,
1832
- borderRadius: _sharedUi.night.radius.row,
1833
- borderWidth: _reactNative.StyleSheet.hairlineWidth
1834
- },
1835
- bannerText: {
1836
- flex: 1,
1837
- fontSize: _sharedUi.night.font.caption,
1838
- fontWeight: "600"
1839
- },
1840
- fileIcon: {
1841
- width: 40,
1842
- height: 40,
1843
- borderRadius: 8,
1844
- backgroundColor: _sharedUi.night.color.fill,
1845
- alignItems: "center",
1846
- justifyContent: "center"
1847
- },
1848
- fileExt: {
1849
- color: _sharedUi.night.color.textSecondary,
1850
- fontSize: 10,
1851
- fontWeight: "800"
1852
- }
1853
- });
1854
- //# sourceMappingURL=ExtraBlocks.js.map
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Banner=Banner,exports.CardCarousel=CardCarousel,exports.CardView=CardView,exports.Checkpoint=Checkpoint,exports.Claim=Claim,exports.Compare=Compare,exports.DateTime=DateTime,exports.Details=Details,exports.File=File,exports.Form=Form,exports.LivePill=LivePill,exports.MultiSelect=MultiSelect,exports.Plan=Plan,exports.Proposal=Proposal,exports.Screenshot=Screenshot,exports.Select=Select,exports.Slider=Slider,exports.Sparkline=Sparkline,exports.Suggestions=Suggestions,exports.Tabs=Tabs,exports.Task=Task,exports.Timeline=Timeline,exports.Upload=Upload;var _react=require("react"),_reactNative=require("react-native"),_sharedUi=require("@buoy-gg/shared-ui"),_context=require("./context"),_primitives=require("./primitives"),_jsxRuntime=require("react/jsx-runtime");const fmt=e=>"string"==typeof e?e:void 0===e?"—":JSON.stringify(e);function Suggestions({block:e}){const t=(0,_context.useBlockHandlers)();return(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.chips,testID:`buoy-block-suggestions-${e.id}`,children:e.chips.slice(0,4).map(i=>(0,_jsxRuntime.jsx)(_reactNative.Pressable,{disabled:!!t.busy,onPress:()=>{t.runAction({label:i.label,send:i.send??i.label},e.id)},style:({pressed:e})=>[styles.chip,e&&styles.pressed],accessibilityRole:"button",children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.chipText,children:i.label})},i.label))})}function MultiSelect({block:e}){const t=(0,_context.useBlockHandlers)(),i=t.answered[e.id],s=!!i,[r,n]=(0,_react.useState)([]),l="multi"===i?.kind?i.optionIds:r,o=r.length>=(e.min??1)&&(!e.max||r.length<=e.max);return(0,_jsxRuntime.jsxs)(_primitives.Card,{testID:`buoy-block-multi-${e.id}`,tone:s?void 0:"info",children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.question,children:e.question}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.optionsBox,children:e.options.map((e,t)=>{const i=l.includes(e.id);return(0,_jsxRuntime.jsxs)(_reactNative.Pressable,{disabled:s,onPress:()=>{return t=e.id,n(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t]);var t},style:[styles.option,t>0&&_primitives.blockStyles.rowDivider,s&&!i&&styles.dim],accessibilityRole:"checkbox",accessibilityState:{checked:i},children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.checkbox,i&&styles.checkboxOn],children:i?(0,_jsxRuntime.jsx)(_sharedUi.Check,{size:11,color:_sharedUi.night.color.onAccent}):null}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.flex,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.optionLabel,children:e.label}),e.detail?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.optionDetail,children:e.detail}):null]})]},e.id)})}),s?null:(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.rowEnd,children:(0,_jsxRuntime.jsx)(_reactNative.Pressable,{testID:"buoy-block-multi-submit",disabled:!o,onPress:()=>t.answer({blockId:e.id,kind:"multi",optionIds:r,labels:e.options.filter(e=>r.includes(e.id)).map(e=>e.label)}),style:[styles.button,styles.buttonPrimary,!o&&styles.disabled],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.buttonTextPrimary,children:e.submitLabel??`Use ${r.length||""}`.trim()})})})]})}const SEARCH_FROM=8;function Select({block:e}){const t=(0,_context.useBlockHandlers)(),i=t.answered[e.id],[s,r]=(0,_react.useState)(""),[n,l]=(0,_react.useState)(!1),o="select"===i?.kind?i.label:null,a=e.options.filter(e=>!s||e.label.toLowerCase().includes(s.toLowerCase())).slice(0,8),c=!1!==e.searchable&&e.options.length>=SEARCH_FROM;return(0,_jsxRuntime.jsxs)(_primitives.Card,{testID:`buoy-block-select-${e.id}`,tone:i?void 0:"info",children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.question,children:e.label}),o?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.decided,children:o}):(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.selectBox,children:[(0,_jsxRuntime.jsxs)(_reactNative.Pressable,{onPress:()=>l(e=>!e),style:styles.selectField,accessibilityRole:"button",children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.selectPlaceholder,children:n?"Choose…":`${e.options.length} options`}),(0,_jsxRuntime.jsx)(_sharedUi.ChevronDown,{size:14,color:_sharedUi.night.color.textSecondary})]}),n&&(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[c&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.search,children:[(0,_jsxRuntime.jsx)(_sharedUi.Search,{size:12,color:_sharedUi.night.color.textSecondary}),(0,_jsxRuntime.jsx)(_reactNative.TextInput,{style:styles.searchInput,value:s,onChangeText:r,placeholder:"Search",placeholderTextColor:_sharedUi.night.color.placeholder,autoCapitalize:"none",autoCorrect:!1})]}),a.map((i,s)=>(0,_jsxRuntime.jsxs)(_reactNative.Pressable,{onPress:()=>t.answer({blockId:e.id,kind:"select",optionId:i.id,label:i.label}),style:[styles.option,s>0&&_primitives.blockStyles.rowDivider],accessibilityRole:"button",children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.flex,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.optionLabel,children:i.label}),i.detail?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.optionDetail,children:i.detail}):null]}),(0,_jsxRuntime.jsx)(_sharedUi.ChevronRight,{size:12,color:_sharedUi.night.color.textTertiary})]},i.id)),e.options.length>a.length?(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.hint,children:[e.options.length-a.length," more — keep typing"]}):null]})]})]})}function SliderControl({min:e,max:t,step:i=1,value:s,unit:r,onChange:n,disabled:l}){const o=(0,_react.useRef)(0),a=t>e?(s-e)/(t-e)*100:0,c=s=>Math.min(t,Math.max(e,+(Math.round((s-e)/i)*i+e).toFixed(6))),d=e=>!l&&n(c(s+e*i));return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.sliderRow,children:[(0,_jsxRuntime.jsx)(_reactNative.Pressable,{disabled:l,onPress:()=>d(-1),style:styles.stepBtn,accessibilityRole:"button",accessibilityLabel:"Decrease",children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.stepText,children:"−"})}),(0,_jsxRuntime.jsx)(_reactNative.Pressable,{style:styles.trackHit,onLayout:e=>{o.current=e.nativeEvent.layout.width},onPress:i=>{if(l||o.current<=0)return;const s=Math.min(1,Math.max(0,i.nativeEvent.locationX/o.current));n(c(e+s*(t-e)))},disabled:l,accessibilityRole:"adjustable",accessibilityValue:{min:e,max:t,now:s},accessibilityActions:[{name:"increment"},{name:"decrement"}],onAccessibilityAction:e=>d("increment"===e.nativeEvent.actionName?1:-1),children:(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.track,pointerEvents:"none",children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.fill,{width:`${a}%`}]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.thumb,{left:`${a}%`}]})]})}),(0,_jsxRuntime.jsx)(_reactNative.Pressable,{disabled:l,onPress:()=>d(1),style:styles.stepBtn,accessibilityRole:"button",accessibilityLabel:"Increase",children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.stepText,children:"+"})}),(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.sliderValue,children:[s,r?` ${r}`:""]})]})}function Slider({block:e}){const t=(0,_context.useBlockHandlers)(),i=t.answered[e.id],[s,r]=(0,_react.useState)(e.value??e.min);return(0,_jsxRuntime.jsxs)(_primitives.Card,{testID:`buoy-block-slider-${e.id}`,tone:i?void 0:"info",children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.question,children:e.label}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.pad,children:(0,_jsxRuntime.jsx)(SliderControl,{min:e.min,max:e.max,step:e.step,value:"slider"===i?.kind?i.value:s,unit:e.unit,onChange:r,disabled:!!i})}),i?null:(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.rowEnd,children:(0,_jsxRuntime.jsx)(_reactNative.Pressable,{onPress:()=>t.answer({blockId:e.id,kind:"slider",value:s,unit:e.unit}),style:[styles.button,styles.buttonPrimary],children:(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.buttonTextPrimary,children:["Use ",s,e.unit?` ${e.unit}`:""]})})})]})}function DateTime({block:e}){const t=(0,_context.useBlockHandlers)(),i=t.answered[e.id],[s,r]=(0,_react.useState)(""),n=e.presets??[{label:"Now",value:(new Date).toISOString()},{label:"Tomorrow",value:new Date(Date.now()+864e5).toISOString()},{label:"+7 days",value:new Date(Date.now()+6048e5).toISOString()},{label:"+30 days",value:new Date(Date.now()+2592e6).toISOString()}];return(0,_jsxRuntime.jsxs)(_primitives.Card,{testID:`buoy-block-datetime-${e.id}`,tone:i?void 0:"info",children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.question,children:e.label}),i?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.decided,children:"dateTime"===i.kind?i.label??i.value:"(skipped)"}):(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.chips,styles.pad],children:n.map(i=>(0,_jsxRuntime.jsx)(_reactNative.Pressable,{onPress:()=>t.answer({blockId:e.id,kind:"dateTime",value:i.value,label:i.label}),style:styles.chip,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.chipText,children:i.label})},i.label))}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[styles.inputRow,styles.pad],children:[(0,_jsxRuntime.jsx)(_reactNative.TextInput,{style:styles.input,value:s,onChangeText:r,placeholder:"time"===e.mode?"14:30":"2026-09-15",placeholderTextColor:_sharedUi.night.color.placeholder,keyboardType:"numbers-and-punctuation"}),(0,_jsxRuntime.jsx)(_reactNative.Pressable,{disabled:!s.trim(),onPress:()=>t.answer({blockId:e.id,kind:"dateTime",value:s.trim()}),style:[styles.button,styles.buttonPrimary,!s.trim()&&styles.disabled],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.buttonTextPrimary,children:"Use"})})]})]})]})}function FieldRow({f:e,value:t,onChange:i,disabled:s}){return"toggle"===e.type?(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.fieldRow,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.fieldLabel,children:e.label}),(0,_jsxRuntime.jsx)(_reactNative.Switch,{value:!!t,onValueChange:i,disabled:s,trackColor:{true:_sharedUi.night.color.accent,false:_sharedUi.night.color.fillTertiary},thumbColor:_sharedUi.night.color.knob})]}):"select"===e.type?(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.fieldCol,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.fieldLabel,children:e.label}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.chips,children:e.options.map(e=>(0,_jsxRuntime.jsx)(_reactNative.Pressable,{disabled:s,onPress:()=>i(e.id),style:[styles.chip,t===e.id&&styles.chipOn],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.chipText,t===e.id&&styles.chipTextOn],children:e.label})},e.id))})]}):"slider"===e.type?(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.fieldCol,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.fieldLabel,children:e.label}),(0,_jsxRuntime.jsx)(SliderControl,{min:e.min,max:e.max,step:e.step,unit:e.unit,value:"number"==typeof t?t:e.min,onChange:i,disabled:s})]}):(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.fieldRow,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.fieldLabel,children:e.label}),(0,_jsxRuntime.jsx)(_reactNative.TextInput,{style:styles.fieldInput,value:null==t?"":String(t),onChangeText:i,editable:!s,placeholder:e.placeholder??"",placeholderTextColor:_sharedUi.night.color.placeholder,keyboardType:"number"===e.type?"numeric":"ascii-capable",secureTextEntry:"secret"===e.type,autoCapitalize:"none",autoCorrect:!1})]})}function useFormValues(e){const[t,i]=(0,_react.useState)(()=>Object.fromEntries(e.map(e=>[e.key,e.value])));return{values:t,set:(e,t)=>i(i=>({...i,[e]:t}))}}function Form({block:e}){const t=(0,_context.useBlockHandlers)(),i=t.answered[e.id],{values:s,set:r}=useFormValues(e.fields);return(0,_jsxRuntime.jsxs)(_primitives.Card,{title:e.title,testID:`buoy-block-form-${e.id}`,tone:i?void 0:"info",children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.pad,children:e.fields.map(e=>(0,_jsxRuntime.jsx)(FieldRow,{f:e,value:s[e.key],onChange:t=>r(e.key,t),disabled:!!i},e.key))}),i?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.decided,children:"Sent"}):(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.rowEnd,children:(0,_jsxRuntime.jsx)(_reactNative.Pressable,{onPress:()=>t.answer({blockId:e.id,kind:"form",values:s}),style:[styles.button,styles.buttonPrimary],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.buttonTextPrimary,children:e.submitLabel??"Send"})})})]})}function Proposal({block:e}){const t=(0,_context.useBlockHandlers)(),i=t.answered[e.id],{values:s,set:r}=useFormValues(e.fields),n="proposal"===i?.kind?i.approved:null;return(0,_jsxRuntime.jsxs)(_primitives.Card,{testID:`buoy-block-proposal-${e.id}`,tone:i?void 0:"warning",children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.confirmTitle,children:e.title}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.confirmChange,children:e.change}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.pad,children:e.fields.map(e=>(0,_jsxRuntime.jsx)(FieldRow,{f:e,value:s[e.key],onChange:t=>r(e.key,t),disabled:!!i},e.key))}),e.consequence?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.consequence,children:e.consequence}):null,(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.actionsRow,children:i?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.decided,children:n?"✓ Applied with these values":"✕ Not applied"}):(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsx)(_reactNative.Pressable,{onPress:()=>t.answer({blockId:e.id,kind:"proposal",approved:!0,values:s}),style:[styles.button,styles.buttonPrimary],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.buttonTextPrimary,children:e.approveLabel??"Apply"})}),(0,_jsxRuntime.jsx)(_reactNative.Pressable,{onPress:()=>t.answer({blockId:e.id,kind:"proposal",approved:!1}),style:[styles.button,styles.buttonPlate],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.buttonTextPlate,children:"Not now"})})]})})]})}function Claim({block:e}){const t=(0,_context.useBlockHandlers)(),[i,s]=(0,_react.useState)(null),r=t.actionState?.[`${e.id}:${e.verify?.label??"Verify"}`],n=e.verified||"done"===r;return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.claim,testID:`buoy-block-claim-${e.id}`,children:[(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.claimText,children:[e.text,e.sources.map((e,t)=>(0,_jsxRuntime.jsxs)(_reactNative.Text,{onPress:()=>s(i===t?null:t),style:styles.cite,children:[" [",t+1,"]"]},t)),n?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.verified,children:" ✓ verified"}):null]}),null!==i&&e.sources[i]?(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.citeBox,children:[(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.citeLabel,children:["[",i+1,"] ",e.sources[i].label]}),e.sources[i].detail?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.citeDetail,children:e.sources[i].detail}):null]}):null,e.verify&&!n?(0,_jsxRuntime.jsxs)(_reactNative.Pressable,{onPress:()=>{t.runAction(e.verify,e.id)},style:styles.verifyBtn,accessibilityRole:"button",children:[(0,_jsxRuntime.jsx)(_sharedUi.RefreshCw,{size:11,color:_sharedUi.night.color.accent}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.verifyText,children:"running"===r?"Checking…":e.verify.label})]}):null]})}function Details({block:e}){const[t,i]=(0,_react.useState)(!!e.open);return(0,_jsxRuntime.jsxs)(_primitives.Card,{testID:`buoy-block-details-${e.id}`,children:[(0,_jsxRuntime.jsxs)(_reactNative.Pressable,{onPress:()=>i(e=>!e),style:_primitives.blockStyles.row,accessibilityRole:"button",accessibilityState:{expanded:t},children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:_primitives.blockStyles.rowTitle,children:e.summary}),t?(0,_jsxRuntime.jsx)(_sharedUi.ChevronDown,{size:12,color:_sharedUi.night.color.textTertiary}):(0,_jsxRuntime.jsx)(_sharedUi.ChevronRight,{size:12,color:_sharedUi.night.color.textTertiary})]}),t?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.detailsBody,selectable:!0,children:e.body}):null]})}function Tabs({block:e,renderNested:t}){const[i,s]=(0,_react.useState)(0),r=e.tabs.map((e,t)=>({key:String(t),label:e.label})),n=e.tabs[i];return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.tabsWrap,testID:`buoy-block-tabs-${e.id}`,children:[(0,_jsxRuntime.jsx)(_sharedUi.NightSegmented,{tabs:r,activeKey:String(i),onChange:e=>s(Number(e)),size:"sm"}),n&&t?t(n.block):null]})}const TIMELINE_CAP=10;function Timeline({block:e}){const t=(0,_primitives.usePaged)(e.events,TIMELINE_CAP);return(0,_jsxRuntime.jsxs)(_primitives.Card,{title:e.title??"What happened",source:e.source,testID:`buoy-block-timeline-${e.id}`,children:[t.visible.map((e,i)=>(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.tlRow,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.tlAt,children:e.at}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.tlLine,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.tlDot,{backgroundColor:(0,_primitives.toneColor)(e.tone??"muted")}]}),i<t.visible.length-1?(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.tlStem}):null]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.flex,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.tlSource,children:e.source.toUpperCase()}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:_primitives.blockStyles.rowTitle,numberOfLines:2,children:e.label})]})]},i)),(0,_jsxRuntime.jsx)(_primitives.More,{paged:t})]})}function Sparkline({block:e}){const t=e.series.slice(-60),i=Math.max(1,...t),s=Math.min(...t,0);return(0,_jsxRuntime.jsxs)(_primitives.Card,{title:e.title,source:e.source,testID:`buoy-block-sparkline-${e.id}`,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.sparkHead,children:[(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.sparkCurrent,children:[e.current??t[t.length-1],e.unit?(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.sparkUnit,children:[" ",e.unit]}):null]}),e.live?(0,_jsxRuntime.jsx)(LivePill,{}):null]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.spark,{height:44}],children:t.map((e,r)=>(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.sparkBar,{height:Math.max(2,(e-s)/(i-s||1)*44),backgroundColor:r===t.length-1?_sharedUi.night.color.accent:_sharedUi.night.color.accentBorderStrong}]},r))}),e.label?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.hint,children:e.label}):null]})}function LivePill(){const e=(0,_react.useRef)(new _reactNative.Animated.Value(1)).current;return(0,_react.useEffect)(()=>{const t=_reactNative.Animated.loop(_reactNative.Animated.sequence([_reactNative.Animated.timing(e,{toValue:.3,duration:700,useNativeDriver:!0}),_reactNative.Animated.timing(e,{toValue:1,duration:700,useNativeDriver:!0})]));return t.start(),()=>t.stop()},[e]),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.live,children:[(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{style:[styles.liveDot,{opacity:e}]}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.liveText,children:"LIVE"})]})}function Compare({block:e}){const t=[...new Set([...e.left.pairs.map(e=>e.key),...e.right.pairs.map(e=>e.key)])],i=Object.fromEntries(e.left.pairs.map(e=>[e.key,e.value])),s=Object.fromEntries(e.right.pairs.map(e=>[e.key,e.value]));return(0,_jsxRuntime.jsxs)(_primitives.Card,{title:e.title,source:e.source,testID:`buoy-block-compare-${e.id}`,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.cmpHead,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.cmpKey}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.cmpCol,children:e.left.title}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.cmpCol,children:e.right.title})]}),t.map((e,t)=>{const r=JSON.stringify(i[e])!==JSON.stringify(s[e]);return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[styles.cmpRow,t>0&&_primitives.blockStyles.rowDivider,r&&styles.cmpDiff],children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.cmpKey,numberOfLines:1,children:e}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.cmpVal,r&&{color:_sharedUi.night.color.danger}],numberOfLines:2,children:fmt(i[e])}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.cmpVal,r&&{color:_sharedUi.night.color.accent}],numberOfLines:2,children:fmt(s[e])})]},e)})]})}function CardBody({c:e,id:t}){return(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[e.image?(0,_jsxRuntime.jsx)(_reactNative.Image,{source:{uri:e.image},style:styles.cardImage,resizeMode:"contain",accessibilityLabel:e.title}):null,(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.cardText,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.cardTitle,numberOfLines:2,children:e.title}),e.subtitle?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:_primitives.blockStyles.rowSub,numberOfLines:2,children:e.subtitle}):null,e.facts?.slice(0,4).map(e=>(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.fact,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.factLabel,children:e.label}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.factValue,e.tone&&{color:(0,_primitives.toneColor)(e.tone)}],children:e.value})]},e.label))]}),(0,_jsxRuntime.jsx)(_primitives.ActionRow,{actions:e.actions,blockId:t})]})}function CardView({block:e}){return(0,_jsxRuntime.jsx)(_primitives.Card,{source:e.source,testID:`buoy-block-card-${e.id}`,children:(0,_jsxRuntime.jsx)(CardBody,{c:e,id:e.id})})}function CardCarousel({block:e}){return(0,_jsxRuntime.jsxs)(_reactNative.View,{testID:`buoy-block-cardcarousel-${e.id}`,children:[e.title?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.carouselTitle,children:e.title}):null,(0,_jsxRuntime.jsx)(_reactNative.ScrollView,{horizontal:!0,showsHorizontalScrollIndicator:!1,snapToInterval:232,decelerationRate:"fast",contentContainerStyle:styles.carousel,children:e.cards.slice(0,8).map((t,i)=>(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.carouselCard,children:(0,_jsxRuntime.jsx)(CardBody,{c:t,id:`${e.id}-${i}`})},`${t.title}-${i}`))})]})}function Screenshot({block:e}){const[t,i]=(0,_react.useState)(!1);return(0,_jsxRuntime.jsxs)(_primitives.Card,{title:e.route?`Screen · ${e.route}`:"Screen",source:e.source,testID:`buoy-block-screenshot-${e.id}`,children:[(0,_jsxRuntime.jsx)(_reactNative.Pressable,{onPress:()=>i(e=>!e),accessibilityRole:"imagebutton",accessibilityLabel:e.caption??"Screenshot",children:(0,_jsxRuntime.jsx)(_reactNative.Image,{source:{uri:e.url},style:[styles.shot,t&&styles.shotBig],resizeMode:"contain"})}),e.caption?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.hint,children:e.caption}):null]})}function Plan({block:e}){const t=e.steps.filter(e=>"done"===e.state).length;return(0,_jsxRuntime.jsxs)(_primitives.Card,{title:e.title,testID:`buoy-block-plan-${e.id}`,tone:e.pending?"info":void 0,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.progress,children:(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.progressFill,{width:t/Math.max(1,e.steps.length)*100+"%"}]})}),e.steps.map((e,t)=>(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[styles.step,t>0&&_primitives.blockStyles.rowDivider],children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.stepMark,"done"===e.state&&styles.stepDone,"failed"===e.state&&styles.stepFailed,"running"===e.state&&styles.stepRunning],children:"done"===e.state?(0,_jsxRuntime.jsx)(_sharedUi.Check,{size:10,color:_sharedUi.night.color.onAccent}):"failed"===e.state?(0,_jsxRuntime.jsx)(_sharedUi.X,{size:10,color:_sharedUi.night.color.text}):(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.stepNum,children:t+1})}),(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:[_primitives.blockStyles.rowTitle,"done"===e.state&&styles.muted],children:[e.text,"running"===e.state?"…":""]})]},t)),(0,_jsxRuntime.jsx)(_primitives.ActionRow,{actions:e.actions??(e.pending?[{label:"Go",primary:!0,send:"Go ahead with the plan."},{label:"Change it",send:"Let me change the plan first."}]:void 0),blockId:e.id})]})}function Checkpoint({block:e}){const t=(0,_context.useBlockHandlers)();return(0,_jsxRuntime.jsxs)(_reactNative.Pressable,{testID:`buoy-block-checkpoint-${e.id}`,disabled:!e.restore,onPress:()=>e.restore&&void t.runAction(e.restore,e.id),style:styles.checkpoint,accessibilityRole:"button",children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.cpFlag}),(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.cpText,children:[e.label,e.at?` · ${e.at}`:""]}),e.restore?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.cpRestore,children:e.restore.label}):null]})}function Task({block:e}){const t="failed"===e.status?_sharedUi.night.color.danger:"done"===e.status?_sharedUi.night.color.accent:_sharedUi.night.color.info;return(0,_jsxRuntime.jsxs)(_primitives.Card,{testID:`buoy-block-task-${e.id}`,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.taskHead,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.cardTitle,children:e.title}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:[_primitives.blockStyles.pill,{backgroundColor:`${t}22`}],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[_primitives.blockStyles.pillText,{color:t}],children:e.status.toUpperCase()})})]}),void 0!==e.progress?(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.progress,styles.pad],children:(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.progressFill,{width:`${Math.round(100*e.progress)}%`,backgroundColor:t}]})}):null,e.detail?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.hint,children:e.detail}):null,(0,_jsxRuntime.jsx)(_primitives.ActionRow,{actions:e.actions,blockId:e.id})]})}function Banner({block:e}){const t="danger"===e.tone?_sharedUi.night.color.danger:"warning"===e.tone?_sharedUi.night.color.warning:_sharedUi.night.color.info;return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[styles.banner,{borderColor:t,backgroundColor:`${t}1A`}],testID:`buoy-block-banner-${e.id}`,children:[(0,_jsxRuntime.jsx)(_sharedUi.AlertTriangle,{size:13,color:t}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.bannerText,{color:t}],numberOfLines:2,children:e.text}),e.actions?.[0]?(0,_jsxRuntime.jsx)(_primitives.ActionRow,{actions:e.actions.slice(0,1),blockId:e.id,align:"right"}):null]})}function File({block:e}){return(0,_jsxRuntime.jsxs)(_primitives.Card,{testID:`buoy-block-file-${e.id}`,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:_primitives.blockStyles.row,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.fileIcon,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.fileExt,children:(e.type??e.name.split(".").pop()??"file").toUpperCase().slice(0,4)})}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.flex,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:_primitives.blockStyles.rowTitle,numberOfLines:1,children:e.name}),e.size?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:_primitives.blockStyles.rowSub,children:e.size}):null]})]}),(0,_jsxRuntime.jsx)(_primitives.ActionRow,{actions:e.actions,blockId:e.id})]})}function Upload({block:e}){const t=(0,_context.useBlockHandlers)(),i=t.answered[e.id];return(0,_jsxRuntime.jsxs)(_primitives.Card,{testID:`buoy-block-upload-${e.id}`,tone:i?void 0:"info",children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.question,children:e.label}),i?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.decided,children:"upload"===i.kind?`Attached ${i.name}`:"(skipped)"}):(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.rowEnd,{justifyContent:"flex-start"}],children:(0,_jsxRuntime.jsx)(_reactNative.Pressable,{onPress:()=>t.answer({blockId:e.id,kind:"upload",name:"screenshot.png"}),style:[styles.button,styles.buttonPlate],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.buttonTextPlate,children:"image"===e.accept?"Choose a screenshot":"Choose a file"})})})]})}const styles=_reactNative.StyleSheet.create({flex:{flex:1},pad:{paddingHorizontal:12,paddingBottom:8},muted:{color:_sharedUi.night.color.textSecondary},dim:{opacity:.45},disabled:{opacity:.5},pressed:{opacity:.7},question:{color:_sharedUi.night.color.text,fontSize:_sharedUi.night.font.row,fontWeight:"600",lineHeight:20,paddingHorizontal:12,paddingTop:12,paddingBottom:8},hint:{color:_sharedUi.night.color.textTertiary,fontSize:_sharedUi.night.font.micro,paddingHorizontal:12,paddingBottom:10},decided:{color:_sharedUi.night.color.textSecondary,fontSize:_sharedUi.night.font.caption,fontWeight:"600",paddingHorizontal:12,paddingVertical:10},rowEnd:{flexDirection:"row",justifyContent:"flex-end",paddingHorizontal:12,paddingBottom:12,gap:8},actionsRow:{flexDirection:"row",gap:8,paddingHorizontal:12,paddingVertical:12,alignItems:"center"},button:{paddingHorizontal:14,paddingVertical:9,borderRadius:_sharedUi.night.radius.row},buttonPrimary:{backgroundColor:_sharedUi.night.color.accent},buttonPlate:{backgroundColor:_sharedUi.night.color.button},buttonTextPrimary:{color:_sharedUi.night.color.onAccent,fontSize:_sharedUi.night.font.caption,fontWeight:"600"},buttonTextPlate:{color:_sharedUi.night.color.text,fontSize:_sharedUi.night.font.caption,fontWeight:"600"},chips:{flexDirection:"row",flexWrap:"wrap",gap:6},chip:{paddingHorizontal:12,paddingVertical:7,borderRadius:_sharedUi.night.radius.chip,backgroundColor:_sharedUi.night.color.fill,borderWidth:_reactNative.StyleSheet.hairlineWidth,borderColor:_sharedUi.night.color.border},chipOn:{backgroundColor:_sharedUi.night.color.accentSoft,borderColor:_sharedUi.night.color.accentBorderStrong},chipText:{color:_sharedUi.night.color.text,fontSize:_sharedUi.night.font.caption},chipTextOn:{color:_sharedUi.night.color.accent,fontWeight:"600"},optionsBox:{marginHorizontal:8,marginBottom:8,borderRadius:_sharedUi.night.radius.row,backgroundColor:_sharedUi.night.color.surfaceElevated,overflow:"hidden"},option:{flexDirection:"row",alignItems:"center",gap:10,paddingHorizontal:12,paddingVertical:10},optionLabel:{color:_sharedUi.night.color.text,fontSize:_sharedUi.night.font.body,fontWeight:"500"},optionDetail:{color:_sharedUi.night.color.textSecondary,fontSize:_sharedUi.night.font.caption},checkbox:{width:20,height:20,borderRadius:6,borderWidth:1.5,borderColor:_sharedUi.night.color.textTertiary,alignItems:"center",justifyContent:"center"},checkboxOn:{backgroundColor:_sharedUi.night.color.accent,borderColor:_sharedUi.night.color.accent},selectBox:{marginHorizontal:12,marginBottom:12,borderRadius:_sharedUi.night.radius.row,backgroundColor:_sharedUi.night.color.surfaceElevated,overflow:"hidden"},selectField:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:12,paddingVertical:11},selectPlaceholder:{color:_sharedUi.night.color.textSecondary,fontSize:_sharedUi.night.font.body},search:{flexDirection:"row",alignItems:"center",gap:6,paddingHorizontal:12,paddingVertical:6,borderTopWidth:_reactNative.StyleSheet.hairlineWidth,borderTopColor:_sharedUi.night.color.separator},searchInput:{flex:1,color:_sharedUi.night.color.text,fontSize:_sharedUi.night.font.caption,paddingVertical:4},sliderRow:{flexDirection:"row",alignItems:"center",gap:8},stepBtn:{width:28,height:28,borderRadius:14,backgroundColor:_sharedUi.night.color.fill,alignItems:"center",justifyContent:"center"},stepText:{color:_sharedUi.night.color.text,fontSize:16,fontWeight:"600"},trackHit:{flex:1,height:36,justifyContent:"center"},track:{height:6,borderRadius:3,backgroundColor:_sharedUi.night.color.fillTertiary,justifyContent:"center"},fill:{height:6,borderRadius:3,backgroundColor:_sharedUi.night.color.accent},thumb:{position:"absolute",width:20,height:20,borderRadius:10,backgroundColor:_sharedUi.night.color.knob,marginLeft:-10,shadowColor:"#000",shadowOpacity:.35,shadowRadius:3,shadowOffset:{width:0,height:1}},sliderValue:{width:64,textAlign:"right",color:_sharedUi.night.color.text,fontSize:_sharedUi.night.font.caption,fontWeight:"600"},inputRow:{flexDirection:"row",alignItems:"center",gap:8,paddingBottom:12},input:{flex:1,height:38,paddingHorizontal:12,borderRadius:_sharedUi.night.radius.row,backgroundColor:_sharedUi.night.color.surfaceElevated,color:_sharedUi.night.color.text,fontSize:_sharedUi.night.font.body},fieldRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:10,paddingVertical:6},fieldCol:{paddingVertical:6,gap:6},fieldLabel:{color:_sharedUi.night.color.textSecondary,fontSize:_sharedUi.night.font.caption,width:110},fieldInput:{flex:1,height:34,paddingHorizontal:10,borderRadius:_sharedUi.night.radius.segment,backgroundColor:_sharedUi.night.color.surfaceElevated,color:_sharedUi.night.color.text,fontSize:_sharedUi.night.font.caption},confirmTitle:{color:_sharedUi.night.color.text,fontSize:_sharedUi.night.font.row,fontWeight:"600",paddingHorizontal:12,paddingTop:12},confirmChange:{color:_sharedUi.night.color.text,fontSize:_sharedUi.night.font.body,lineHeight:19,paddingHorizontal:12,paddingTop:6,paddingBottom:6},consequence:{color:_sharedUi.night.color.warning,fontSize:_sharedUi.night.font.caption,paddingHorizontal:12},claim:{gap:6,paddingHorizontal:2},claimText:{color:_sharedUi.night.color.text,fontSize:_sharedUi.night.font.row,lineHeight:22},cite:{color:_sharedUi.night.color.accent,fontSize:_sharedUi.night.font.caption,fontWeight:"700"},verified:{color:_sharedUi.night.color.accent,fontSize:_sharedUi.night.font.caption,fontWeight:"600"},citeBox:{padding:10,borderRadius:_sharedUi.night.radius.row,backgroundColor:_sharedUi.night.color.surface,borderWidth:_reactNative.StyleSheet.hairlineWidth,borderColor:_sharedUi.night.color.border,gap:2},citeLabel:{color:_sharedUi.night.color.text,fontSize:_sharedUi.night.font.caption,fontWeight:"600"},citeDetail:{color:_sharedUi.night.color.textSecondary,fontSize:_sharedUi.night.font.caption,fontFamily:"Menlo"},verifyBtn:{alignSelf:"flex-start",flexDirection:"row",alignItems:"center",gap:5,paddingHorizontal:10,paddingVertical:5,borderRadius:_sharedUi.night.radius.chip,backgroundColor:_sharedUi.night.color.accentSoft},verifyText:{color:_sharedUi.night.color.accent,fontSize:_sharedUi.night.font.micro,fontWeight:"700"},detailsBody:{color:_sharedUi.night.color.textSecondary,fontSize:_sharedUi.night.font.caption,lineHeight:18,paddingHorizontal:12,paddingBottom:12},tabsWrap:{gap:8},tabBar:{flexDirection:"row",gap:6},tab:{paddingHorizontal:12,paddingVertical:6,borderRadius:_sharedUi.night.radius.badge,backgroundColor:_sharedUi.night.color.fill},tabOn:{backgroundColor:_sharedUi.night.color.accentSoft},tabText:{color:_sharedUi.night.color.textSecondary,fontSize:_sharedUi.night.font.caption,fontWeight:"600"},tabTextOn:{color:_sharedUi.night.color.accent},tlRow:{flexDirection:"row",gap:10,paddingHorizontal:12,paddingVertical:4,alignItems:"flex-start"},tlAt:{width:46,color:_sharedUi.night.color.textTertiary,fontSize:_sharedUi.night.font.micro,fontFamily:"Menlo",paddingTop:3},tlLine:{width:12,alignItems:"center"},tlDot:{width:8,height:8,borderRadius:4,marginTop:5},tlStem:{width:1,flex:1,minHeight:18,backgroundColor:_sharedUi.night.color.separator,marginTop:2},tlSource:{color:_sharedUi.night.color.textTertiary,fontSize:9,fontWeight:"700",letterSpacing:.6},sparkHead:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:12,paddingTop:8},sparkCurrent:{color:_sharedUi.night.color.text,fontSize:22,fontWeight:"700"},sparkUnit:{color:_sharedUi.night.color.textSecondary,fontSize:_sharedUi.night.font.caption,fontWeight:"500"},spark:{flexDirection:"row",alignItems:"flex-end",gap:2,paddingHorizontal:12,paddingTop:6,paddingBottom:6},sparkBar:{flex:1,borderRadius:1},live:{flexDirection:"row",alignItems:"center",gap:5,paddingHorizontal:8,paddingVertical:3,borderRadius:_sharedUi.night.radius.badge,backgroundColor:_sharedUi.night.color.dangerSoft},liveDot:{width:6,height:6,borderRadius:3,backgroundColor:_sharedUi.night.color.danger},liveText:{color:_sharedUi.night.color.danger,fontSize:9,fontWeight:"800",letterSpacing:.8},cmpHead:{flexDirection:"row",paddingHorizontal:12,paddingVertical:6,backgroundColor:_sharedUi.night.color.fill,gap:8},cmpCol:{flex:1,color:_sharedUi.night.color.textTertiary,fontSize:_sharedUi.night.font.micro,fontWeight:"700",letterSpacing:.6,textTransform:"uppercase"},cmpRow:{flexDirection:"row",paddingHorizontal:12,paddingVertical:8,gap:8,alignItems:"flex-start"},cmpDiff:{backgroundColor:_sharedUi.night.color.fill},cmpKey:{width:90,color:_sharedUi.night.color.textSecondary,fontSize:_sharedUi.night.font.caption},cmpVal:{flex:1,color:_sharedUi.night.color.text,fontSize:_sharedUi.night.font.caption,fontFamily:"Menlo"},cardImage:{width:"100%",height:140,backgroundColor:_sharedUi.night.color.fill},cardText:{paddingHorizontal:12,paddingTop:10,paddingBottom:4,gap:4},cardTitle:{color:_sharedUi.night.color.text,fontSize:_sharedUi.night.font.row,fontWeight:"600"},fact:{flexDirection:"row",justifyContent:"space-between",gap:8},factLabel:{color:_sharedUi.night.color.textSecondary,fontSize:_sharedUi.night.font.caption},factValue:{color:_sharedUi.night.color.text,fontSize:_sharedUi.night.font.caption,fontWeight:"500"},carouselTitle:{color:_sharedUi.night.color.text,fontSize:_sharedUi.night.font.caption,fontWeight:"600",paddingBottom:8},carousel:{gap:8,paddingRight:8},carouselCard:{width:224,borderRadius:_sharedUi.night.radius.card,borderWidth:_reactNative.StyleSheet.hairlineWidth,borderColor:_sharedUi.night.color.border,backgroundColor:_sharedUi.night.color.surface,overflow:"hidden"},shot:{width:"100%",height:220,backgroundColor:_sharedUi.night.color.fill},shotBig:{height:520},progress:{height:4,backgroundColor:_sharedUi.night.color.fill,marginHorizontal:12,marginTop:6,marginBottom:8,borderRadius:2,overflow:"hidden"},progressFill:{height:4,backgroundColor:_sharedUi.night.color.accent},step:{flexDirection:"row",alignItems:"center",gap:10,paddingHorizontal:12,paddingVertical:9},stepMark:{width:20,height:20,borderRadius:10,backgroundColor:_sharedUi.night.color.fillTertiary,alignItems:"center",justifyContent:"center"},stepDone:{backgroundColor:_sharedUi.night.color.accent},stepFailed:{backgroundColor:_sharedUi.night.color.danger},stepRunning:{backgroundColor:_sharedUi.night.color.info},stepNum:{color:_sharedUi.night.color.text,fontSize:_sharedUi.night.font.micro,fontWeight:"700"},checkpoint:{alignSelf:"flex-start",flexDirection:"row",alignItems:"center",gap:8,paddingHorizontal:12,paddingVertical:7,borderRadius:_sharedUi.night.radius.chip,backgroundColor:_sharedUi.night.color.fill},cpFlag:{width:8,height:8,borderRadius:2,backgroundColor:_sharedUi.night.color.info},cpText:{color:_sharedUi.night.color.textSecondary,fontSize:_sharedUi.night.font.caption},cpRestore:{color:_sharedUi.night.color.accent,fontSize:_sharedUi.night.font.caption,fontWeight:"600"},taskHead:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:8,paddingHorizontal:12,paddingTop:12},banner:{flexDirection:"row",alignItems:"center",gap:8,paddingLeft:12,paddingRight:4,paddingVertical:4,borderRadius:_sharedUi.night.radius.row,borderWidth:_reactNative.StyleSheet.hairlineWidth},bannerText:{flex:1,fontSize:_sharedUi.night.font.caption,fontWeight:"600"},fileIcon:{width:40,height:40,borderRadius:8,backgroundColor:_sharedUi.night.color.fill,alignItems:"center",justifyContent:"center"},fileExt:{color:_sharedUi.night.color.textSecondary,fontSize:10,fontWeight:"800"}});