@superinterface/react 2.0.11 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -619,7 +619,7 @@ var useToasts = function() {
619
619
  };
620
620
  // src/components/threads/Thread/Messages/Content/MessageGroup/index.tsx
621
621
  import { useContext as useContext6 } from "react";
622
- import { Box as Box9, Avatar as Avatar3 } from "@radix-ui/themes";
622
+ import { Box as Box10, Avatar as Avatar3 } from "@radix-ui/themes";
623
623
  import { PersonIcon } from "@radix-ui/react-icons";
624
624
  // src/components/messageGroups/MessageGroupBase/AssistantAvatar.tsx
625
625
  import { useContext as useContext3 } from "react";
@@ -655,7 +655,7 @@ var AssistantNameContext = createContext4("Assistant");
655
655
  import { Flex as Flex10 } from "@radix-ui/themes";
656
656
  // src/components/threads/Thread/Message/index.tsx
657
657
  import { useMemo as useMemo4 } from "react";
658
- import { Box as Box8 } from "@radix-ui/themes";
658
+ import { Box as Box9 } from "@radix-ui/themes";
659
659
  // src/components/runSteps/RunSteps/index.tsx
660
660
  import { Flex as Flex9 } from "@radix-ui/themes";
661
661
  // src/components/runSteps/RunStep/ToolCalls/index.tsx
@@ -1039,6 +1039,20 @@ var Code2 = function(param) {
1039
1039
  children: children
1040
1040
  });
1041
1041
  };
1042
+ // src/contexts/markdown/MarkdownContext/lib/components/Img.tsx
1043
+ import { Box as Box8 } from "@radix-ui/themes";
1044
+ import { jsx as jsx28 } from "react/jsx-runtime";
1045
+ var Img = function(props) {
1046
+ return /* @__PURE__ */ jsx28(Box8, {
1047
+ pb: "3",
1048
+ children: /* @__PURE__ */ jsx28("img", _object_spread_props(_object_spread({}, props), {
1049
+ style: {
1050
+ maxWidth: "100%",
1051
+ height: "auto"
1052
+ }
1053
+ }))
1054
+ });
1055
+ };
1042
1056
  // src/contexts/markdown/MarkdownContext/lib/components/index.tsx
1043
1057
  var components = {
1044
1058
  p: Paragraph,
@@ -1048,7 +1062,8 @@ var components = {
1048
1062
  ol: OrderedList,
1049
1063
  li: ListItem,
1050
1064
  pre: Pre,
1051
- code: Code2
1065
+ code: Code2,
1066
+ img: Img
1052
1067
  };
1053
1068
  // src/contexts/markdown/MarkdownContext/index.ts
1054
1069
  var MarkdownContext = createContext7({
@@ -1068,7 +1083,7 @@ var TextContent = function(param) {
1068
1083
  return useRemarkSync(content.text.value, markdownContext);
1069
1084
  };
1070
1085
  // src/components/threads/Thread/Message/index.tsx
1071
- import { jsx as jsx28, jsxs as jsxs6 } from "react/jsx-runtime";
1086
+ import { jsx as jsx29, jsxs as jsxs6 } from "react/jsx-runtime";
1072
1087
  var Message = function(param) {
1073
1088
  var message = param.message;
1074
1089
  var _useMemo4 = _sliced_to_array(useMemo4(function() {
@@ -1103,23 +1118,23 @@ var Message = function(param) {
1103
1118
  }, [
1104
1119
  message
1105
1120
  ]), 2), olderRunSteps = _useMemo4[0], laterRunSteps = _useMemo4[1];
1106
- return /* @__PURE__ */ jsx28(Provider, {
1121
+ return /* @__PURE__ */ jsx29(Provider, {
1107
1122
  value: {
1108
1123
  message: message
1109
1124
  },
1110
- children: /* @__PURE__ */ jsxs6(Box8, {
1125
+ children: /* @__PURE__ */ jsxs6(Box9, {
1111
1126
  children: [
1112
- /* @__PURE__ */ jsx28(RunSteps, {
1127
+ /* @__PURE__ */ jsx29(RunSteps, {
1113
1128
  runSteps: olderRunSteps
1114
1129
  }),
1115
1130
  message.content.map(function(content, index) {
1116
- return /* @__PURE__ */ jsx28(Box8, {
1117
- children: content.type === "text" && /* @__PURE__ */ jsx28(TextContent, {
1131
+ return /* @__PURE__ */ jsx29(Box9, {
1132
+ children: content.type === "text" && /* @__PURE__ */ jsx29(TextContent, {
1118
1133
  content: content
1119
1134
  })
1120
1135
  }, index);
1121
1136
  }),
1122
- /* @__PURE__ */ jsx28(RunSteps, {
1137
+ /* @__PURE__ */ jsx29(RunSteps, {
1123
1138
  runSteps: laterRunSteps
1124
1139
  })
1125
1140
  ]
@@ -1127,36 +1142,36 @@ var Message = function(param) {
1127
1142
  });
1128
1143
  };
1129
1144
  // src/components/threads/Thread/Messages/Content/MessageGroup/Content/index.tsx
1130
- import { jsx as jsx29 } from "react/jsx-runtime";
1145
+ import { jsx as jsx30 } from "react/jsx-runtime";
1131
1146
  var Content2 = function(param) {
1132
1147
  var messageGroup = param.messageGroup;
1133
- return /* @__PURE__ */ jsx29(Flex10, {
1148
+ return /* @__PURE__ */ jsx30(Flex10, {
1134
1149
  direction: "column-reverse",
1135
1150
  children: messageGroup.messages.map(function(message) {
1136
- return /* @__PURE__ */ jsx29(Message, {
1151
+ return /* @__PURE__ */ jsx30(Message, {
1137
1152
  message: message
1138
1153
  }, message.id);
1139
1154
  })
1140
1155
  });
1141
1156
  };
1142
1157
  // src/components/threads/Thread/Messages/Content/MessageGroup/index.tsx
1143
- import { jsx as jsx30, jsxs as jsxs7 } from "react/jsx-runtime";
1158
+ import { jsx as jsx31, jsxs as jsxs7 } from "react/jsx-runtime";
1144
1159
  var MessageGroup = function(param) {
1145
1160
  var messageGroup = param.messageGroup;
1146
1161
  var assistantNameContext = useContext6(AssistantNameContext);
1147
1162
  return /* @__PURE__ */ jsxs7(MessageGroupBase, {
1148
1163
  children: [
1149
- messageGroup.role === "user" ? /* @__PURE__ */ jsx30(Avatar3, {
1150
- fallback: /* @__PURE__ */ jsx30(PersonIcon, {}),
1164
+ messageGroup.role === "user" ? /* @__PURE__ */ jsx31(Avatar3, {
1165
+ fallback: /* @__PURE__ */ jsx31(PersonIcon, {}),
1151
1166
  size: "1"
1152
- }) : /* @__PURE__ */ jsx30(AssistantAvatar, {}),
1153
- /* @__PURE__ */ jsxs7(Box9, {
1167
+ }) : /* @__PURE__ */ jsx31(AssistantAvatar, {}),
1168
+ /* @__PURE__ */ jsxs7(Box10, {
1154
1169
  flexGrow: "1",
1155
1170
  children: [
1156
- /* @__PURE__ */ jsx30(Name, {
1171
+ /* @__PURE__ */ jsx31(Name, {
1157
1172
  children: messageGroup.role === "user" ? "You" : assistantNameContext
1158
1173
  }),
1159
- /* @__PURE__ */ jsx30(Content2, {
1174
+ /* @__PURE__ */ jsx31(Content2, {
1160
1175
  messageGroup: messageGroup
1161
1176
  })
1162
1177
  ]
@@ -1165,7 +1180,7 @@ var MessageGroup = function(param) {
1165
1180
  });
1166
1181
  };
1167
1182
  // src/components/threads/Thread/Messages/Content/index.tsx
1168
- import { Fragment, jsx as jsx31 } from "react/jsx-runtime";
1183
+ import { Fragment, jsx as jsx32 } from "react/jsx-runtime";
1169
1184
  var Content3 = function() {
1170
1185
  var _useMessages = useMessages(), messages2 = _useMessages.messages, isLoading = _useMessages.isLoading, isLoadingError = _useMessages.isLoadingError;
1171
1186
  var addToast = useToasts().addToast;
@@ -1184,23 +1199,23 @@ var Content3 = function() {
1184
1199
  addToast
1185
1200
  ]);
1186
1201
  if (isLoading || isLoadingError) {
1187
- return /* @__PURE__ */ jsx31(MessagesSkeleton, {});
1202
+ return /* @__PURE__ */ jsx32(MessagesSkeleton, {});
1188
1203
  }
1189
- return /* @__PURE__ */ jsx31(Fragment, {
1204
+ return /* @__PURE__ */ jsx32(Fragment, {
1190
1205
  children: messageGroups2.map(function(messageGroup) {
1191
- return /* @__PURE__ */ jsx31(MessageGroup, {
1206
+ return /* @__PURE__ */ jsx32(MessageGroup, {
1192
1207
  messageGroup: messageGroup
1193
1208
  }, messageGroup.id);
1194
1209
  })
1195
1210
  });
1196
1211
  };
1197
1212
  // src/components/threads/Thread/Messages/Progress/index.tsx
1198
- import { Box as Box11 } from "@radix-ui/themes";
1213
+ import { Box as Box12 } from "@radix-ui/themes";
1199
1214
  // src/components/skeletons/StartingContentSkeleton/index.tsx
1200
1215
  import { Skeleton as Skeleton2 } from "@radix-ui/themes";
1201
- import { jsx as jsx32 } from "react/jsx-runtime";
1216
+ import { jsx as jsx33 } from "react/jsx-runtime";
1202
1217
  var StartingContentSkeleton = function() {
1203
- return /* @__PURE__ */ jsx32(Skeleton2, {
1218
+ return /* @__PURE__ */ jsx33(Skeleton2, {
1204
1219
  loading: true,
1205
1220
  mt: "1",
1206
1221
  height: "var(--space-4)",
@@ -1213,21 +1228,21 @@ var StartingContentSkeleton = function() {
1213
1228
  };
1214
1229
  // src/components/skeletons/StartingSkeleton/index.tsx
1215
1230
  import { useContext as useContext7 } from "react";
1216
- import { Box as Box10 } from "@radix-ui/themes";
1217
- import { jsx as jsx33, jsxs as jsxs8 } from "react/jsx-runtime";
1231
+ import { Box as Box11 } from "@radix-ui/themes";
1232
+ import { jsx as jsx34, jsxs as jsxs8 } from "react/jsx-runtime";
1218
1233
  var StartingSkeleton = function(param) {
1219
1234
  var children = param.children;
1220
1235
  var assistantNameContext = useContext7(AssistantNameContext);
1221
1236
  return /* @__PURE__ */ jsxs8(MessageGroupBase, {
1222
1237
  children: [
1223
- /* @__PURE__ */ jsx33(AssistantAvatar, {}),
1224
- /* @__PURE__ */ jsxs8(Box10, {
1238
+ /* @__PURE__ */ jsx34(AssistantAvatar, {}),
1239
+ /* @__PURE__ */ jsxs8(Box11, {
1225
1240
  children: [
1226
- /* @__PURE__ */ jsx33(Name, {
1241
+ /* @__PURE__ */ jsx34(Name, {
1227
1242
  children: assistantNameContext
1228
1243
  }),
1229
1244
  children,
1230
- /* @__PURE__ */ jsx33(StartingContentSkeleton, {})
1245
+ /* @__PURE__ */ jsx34(StartingContentSkeleton, {})
1231
1246
  ]
1232
1247
  })
1233
1248
  ]
@@ -1398,21 +1413,21 @@ var useIsRunActive = function() {
1398
1413
  ]);
1399
1414
  };
1400
1415
  // src/components/threads/Thread/Messages/Progress/index.tsx
1401
- import { jsx as jsx34, jsxs as jsxs9 } from "react/jsx-runtime";
1416
+ import { jsx as jsx35, jsxs as jsxs9 } from "react/jsx-runtime";
1402
1417
  var Progress = function() {
1403
1418
  var _useIsRunActive = useIsRunActive(), isRunActive2 = _useIsRunActive.isRunActive;
1404
1419
  var latestMessage = useLatestMessage().latestMessage;
1405
1420
  if (!latestMessage) return null;
1406
1421
  if (!isRunActive2) return null;
1407
1422
  if (latestMessage.role === "user") {
1408
- return /* @__PURE__ */ jsx34(StartingSkeleton, {});
1423
+ return /* @__PURE__ */ jsx35(StartingSkeleton, {});
1409
1424
  }
1410
1425
  return /* @__PURE__ */ jsxs9(MessageGroupBase, {
1411
1426
  children: [
1412
- /* @__PURE__ */ jsx34(Box11, {
1427
+ /* @__PURE__ */ jsx35(Box12, {
1413
1428
  pl: "5"
1414
1429
  }),
1415
- /* @__PURE__ */ jsx34(StartingContentSkeleton, {})
1430
+ /* @__PURE__ */ jsx35(StartingContentSkeleton, {})
1416
1431
  ]
1417
1432
  });
1418
1433
  };
@@ -2017,7 +2032,7 @@ var useLifecycle = function() {
2017
2032
  return null;
2018
2033
  };
2019
2034
  // src/components/threads/Thread/Messages/Root/index.tsx
2020
- import { jsx as jsx35, jsxs as jsxs10 } from "react/jsx-runtime";
2035
+ import { jsx as jsx36, jsxs as jsxs10 } from "react/jsx-runtime";
2021
2036
  var Root = function(param) {
2022
2037
  var children = param.children, _param_style = param.style, style = _param_style === void 0 ? {} : _param_style;
2023
2038
  var _useMessages = useMessages(), isFetchingNextPage = _useMessages.isFetchingNextPage, hasNextPage = _useMessages.hasNextPage, fetchNextPage = _useMessages.fetchNextPage;
@@ -2036,10 +2051,10 @@ var Root = function(param) {
2036
2051
  }),
2037
2052
  children: [
2038
2053
  children,
2039
- hasNextPage && /* @__PURE__ */ jsx35(Flex11, {
2054
+ hasNextPage && /* @__PURE__ */ jsx36(Flex11, {
2040
2055
  ref: loaderRef
2041
2056
  }),
2042
- /* @__PURE__ */ jsx35(Flex11, {
2057
+ /* @__PURE__ */ jsx36(Flex11, {
2043
2058
  flexShrink: "0",
2044
2059
  flexGrow: "1"
2045
2060
  })
@@ -2047,30 +2062,30 @@ var Root = function(param) {
2047
2062
  });
2048
2063
  };
2049
2064
  // src/components/threads/Thread/Messages/NextPageSkeleton.tsx
2050
- import { jsx as jsx36 } from "react/jsx-runtime";
2065
+ import { jsx as jsx37 } from "react/jsx-runtime";
2051
2066
  var NextPageSkeleton = function() {
2052
2067
  var hasNextPage = useMessages().hasNextPage;
2053
2068
  if (!hasNextPage) {
2054
2069
  return null;
2055
2070
  }
2056
- return /* @__PURE__ */ jsx36(MessagesSkeleton, {});
2071
+ return /* @__PURE__ */ jsx37(MessagesSkeleton, {});
2057
2072
  };
2058
2073
  // src/components/threads/Thread/Messages/index.tsx
2059
- import { jsx as jsx37, jsxs as jsxs11 } from "react/jsx-runtime";
2074
+ import { jsx as jsx38, jsxs as jsxs11 } from "react/jsx-runtime";
2060
2075
  var Messages = function(param) {
2061
2076
  var children = param.children, _param_style = param.style, style = _param_style === void 0 ? {} : _param_style;
2062
2077
  return /* @__PURE__ */ jsxs11(Root, {
2063
2078
  style: style,
2064
2079
  children: [
2065
- /* @__PURE__ */ jsx37(Flex12, {
2080
+ /* @__PURE__ */ jsx38(Flex12, {
2066
2081
  flexShrink: "0",
2067
2082
  height: "var(--space-3)"
2068
2083
  }),
2069
- /* @__PURE__ */ jsx37(Progress, {}),
2084
+ /* @__PURE__ */ jsx38(Progress, {}),
2070
2085
  children,
2071
- /* @__PURE__ */ jsx37(Content3, {}),
2072
- /* @__PURE__ */ jsx37(NextPageSkeleton, {}),
2073
- /* @__PURE__ */ jsx37(Flex12, {
2086
+ /* @__PURE__ */ jsx38(Content3, {}),
2087
+ /* @__PURE__ */ jsx38(NextPageSkeleton, {}),
2088
+ /* @__PURE__ */ jsx38(Flex12, {
2074
2089
  flexShrink: "0",
2075
2090
  flexGrow: "1"
2076
2091
  })
@@ -2098,16 +2113,16 @@ var useMessageFormContext = function() {
2098
2113
  return useContext9(MessageFormContext);
2099
2114
  };
2100
2115
  // src/components/threads/Thread/MessageForm/Submit/index.tsx
2101
- import { jsx as jsx38 } from "react/jsx-runtime";
2116
+ import { jsx as jsx39 } from "react/jsx-runtime";
2102
2117
  var Submit = function() {
2103
2118
  var _useMessageFormContext = useMessageFormContext(), isDisabled = _useMessageFormContext.isDisabled, isLoading = _useMessageFormContext.isLoading;
2104
- return /* @__PURE__ */ jsx38(Button2, {
2119
+ return /* @__PURE__ */ jsx39(Button2, {
2105
2120
  type: "submit",
2106
2121
  radius: "large",
2107
2122
  disabled: isDisabled || isLoading,
2108
- children: /* @__PURE__ */ jsx38(Spinner, {
2123
+ children: /* @__PURE__ */ jsx39(Spinner, {
2109
2124
  loading: isLoading,
2110
- children: /* @__PURE__ */ jsx38(ArrowUpIcon, {})
2125
+ children: /* @__PURE__ */ jsx39(ArrowUpIcon, {})
2111
2126
  })
2112
2127
  });
2113
2128
  };
@@ -2297,7 +2312,7 @@ var formOptions = {
2297
2312
  resolver: zodResolver(schema)
2298
2313
  };
2299
2314
  // src/components/threads/Thread/MessageForm/Root/index.tsx
2300
- import { jsx as jsx39 } from "react/jsx-runtime";
2315
+ import { jsx as jsx40 } from "react/jsx-runtime";
2301
2316
  var Root2 = function(param) {
2302
2317
  var children = param.children;
2303
2318
  var formProps = useForm(formOptions);
@@ -2351,13 +2366,13 @@ var Root2 = function(param) {
2351
2366
  latestMessage,
2352
2367
  isLoading
2353
2368
  ]);
2354
- return /* @__PURE__ */ jsx39(MessageFormContext.Provider, {
2369
+ return /* @__PURE__ */ jsx40(MessageFormContext.Provider, {
2355
2370
  value: {
2356
2371
  isDisabled: isDisabled,
2357
2372
  isLoading: isLoading
2358
2373
  },
2359
- children: /* @__PURE__ */ jsx39(FormProvider, _object_spread_props(_object_spread({}, formProps), {
2360
- children: /* @__PURE__ */ jsx39("form", {
2374
+ children: /* @__PURE__ */ jsx40(FormProvider, _object_spread_props(_object_spread({}, formProps), {
2375
+ children: /* @__PURE__ */ jsx40("form", {
2361
2376
  onSubmit: handleSubmit(onSubmit),
2362
2377
  children: children
2363
2378
  })
@@ -2370,15 +2385,15 @@ import { useContext as useContext10, useMemo as useMemo10, useRef as useRef3, us
2370
2385
  // src/components/textareas/TextareaBase/index.tsx
2371
2386
  import { forwardRef as forwardRef3 } from "react";
2372
2387
  import TextareaAutosize from "react-textarea-autosize";
2373
- import { Fragment as Fragment2, jsx as jsx40, jsxs as jsxs12 } from "react/jsx-runtime";
2388
+ import { Fragment as Fragment2, jsx as jsx41, jsxs as jsxs12 } from "react/jsx-runtime";
2374
2389
  var UPSCALE_RATIO = 16 / 14;
2375
2390
  var TextareaBase = forwardRef3(function TextareaBase2(props, ref) {
2376
2391
  return /* @__PURE__ */ jsxs12(Fragment2, {
2377
2392
  children: [
2378
- /* @__PURE__ */ jsx40("style", {
2393
+ /* @__PURE__ */ jsx41("style", {
2379
2394
  children: ".superinterface-textarea { min-height: inherit; height: 30px; }\n.superinterface-textarea::placeholder { color: var(--gray-a10); }"
2380
2395
  }),
2381
- /* @__PURE__ */ jsx40(TextareaAutosize, _object_spread({
2396
+ /* @__PURE__ */ jsx41(TextareaAutosize, _object_spread({
2382
2397
  ref: ref,
2383
2398
  className: "rt-reset superinterface-textarea",
2384
2399
  style: {
@@ -2403,20 +2418,20 @@ var TextareaBase = forwardRef3(function TextareaBase2(props, ref) {
2403
2418
  // src/components/threads/Thread/MessageForm/Field/index.tsx
2404
2419
  import { useFormContext } from "react-hook-form";
2405
2420
  import { Container as Container2, Flex as Flex13 } from "@radix-ui/themes";
2406
- import { jsx as jsx41 } from "react/jsx-runtime";
2421
+ import { jsx as jsx42 } from "react/jsx-runtime";
2407
2422
  var Root3 = function(param) {
2408
2423
  var children = param.children;
2409
2424
  var _useFormContext = useFormContext(), errors = _useFormContext.formState.errors;
2410
- return /* @__PURE__ */ jsx41(Container2, {
2425
+ return /* @__PURE__ */ jsx42(Container2, {
2411
2426
  size: "2",
2412
2427
  flexGrow: "0",
2413
- children: /* @__PURE__ */ jsx41(Flex13, {
2428
+ children: /* @__PURE__ */ jsx42(Flex13, {
2414
2429
  direction: "column",
2415
2430
  flexShrink: "0",
2416
- children: /* @__PURE__ */ jsx41(Flex13, {
2431
+ children: /* @__PURE__ */ jsx42(Flex13, {
2417
2432
  direction: "column",
2418
2433
  flexShrink: "0",
2419
- children: /* @__PURE__ */ jsx41(Flex13, {
2434
+ children: /* @__PURE__ */ jsx42(Flex13, {
2420
2435
  style: _object_spread({
2421
2436
  borderRadius: "var(--radius-2)",
2422
2437
  borderWidth: "1px",
@@ -2456,7 +2471,7 @@ var Control = function() {
2456
2471
  isDisabledPrevious,
2457
2472
  textareaProps
2458
2473
  ]);
2459
- return /* @__PURE__ */ jsx41(TextareaBase, _object_spread_props(_object_spread({
2474
+ return /* @__PURE__ */ jsx42(TextareaBase, _object_spread_props(_object_spread({
2460
2475
  minRows: 1,
2461
2476
  placeholder: "Message ".concat(assistantNameContext, "..."),
2462
2477
  disabled: isDisabled,
@@ -2480,26 +2495,26 @@ var Field = {
2480
2495
  Control: Control
2481
2496
  };
2482
2497
  // src/components/threads/Thread/MessageForm/index.tsx
2483
- import { jsx as jsx42, jsxs as jsxs13 } from "react/jsx-runtime";
2498
+ import { jsx as jsx43, jsxs as jsxs13 } from "react/jsx-runtime";
2484
2499
  var MessageForm = function() {
2485
- return /* @__PURE__ */ jsx42(Root2, {
2500
+ return /* @__PURE__ */ jsx43(Root2, {
2486
2501
  children: /* @__PURE__ */ jsxs13(Field.Root, {
2487
2502
  children: [
2488
- /* @__PURE__ */ jsx42(Text5, {
2503
+ /* @__PURE__ */ jsx43(Text5, {
2489
2504
  size: "2",
2490
2505
  style: {
2491
2506
  flexGrow: 1
2492
2507
  },
2493
- children: /* @__PURE__ */ jsx42(Flex14, {
2508
+ children: /* @__PURE__ */ jsx43(Flex14, {
2494
2509
  flexGrow: "1",
2495
2510
  direction: "column",
2496
- children: /* @__PURE__ */ jsx42(Field.Control, {})
2511
+ children: /* @__PURE__ */ jsx43(Field.Control, {})
2497
2512
  })
2498
2513
  }),
2499
- /* @__PURE__ */ jsx42(Flex14, {
2514
+ /* @__PURE__ */ jsx43(Flex14, {
2500
2515
  flexShrink: "0",
2501
2516
  align: "end",
2502
- children: /* @__PURE__ */ jsx42(Submit, {})
2517
+ children: /* @__PURE__ */ jsx43(Submit, {})
2503
2518
  })
2504
2519
  ]
2505
2520
  })
@@ -2512,11 +2527,11 @@ MessageForm.Submit = Submit;
2512
2527
  import { Flex as Flex15 } from "@radix-ui/themes";
2513
2528
  // src/components/runs/PollingProvider/index.tsx
2514
2529
  import { useState as useState2 } from "react";
2515
- import { jsx as jsx43 } from "react/jsx-runtime";
2530
+ import { jsx as jsx44 } from "react/jsx-runtime";
2516
2531
  var PollingProvider = function(param) {
2517
2532
  var children = param.children;
2518
2533
  var _useState2 = _sliced_to_array(useState2(false), 2), isPollRefetching = _useState2[0], setIsPollRefetching = _useState2[1];
2519
- return /* @__PURE__ */ jsx43(PollingContext.Provider, {
2534
+ return /* @__PURE__ */ jsx44(PollingContext.Provider, {
2520
2535
  value: {
2521
2536
  isPollRefetching: isPollRefetching,
2522
2537
  setIsPollRefetching: setIsPollRefetching
@@ -2525,20 +2540,20 @@ var PollingProvider = function(param) {
2525
2540
  });
2526
2541
  };
2527
2542
  // src/components/threads/Thread/Provider/index.tsx
2528
- import { jsx as jsx44 } from "react/jsx-runtime";
2543
+ import { jsx as jsx45 } from "react/jsx-runtime";
2529
2544
  var Provider2 = function(args) {
2530
- return /* @__PURE__ */ jsx44(PollingProvider, {
2531
- children: /* @__PURE__ */ jsx44(SuperinterfaceProvider, _object_spread({}, args))
2545
+ return /* @__PURE__ */ jsx45(PollingProvider, {
2546
+ children: /* @__PURE__ */ jsx45(SuperinterfaceProvider, _object_spread({}, args))
2532
2547
  });
2533
2548
  };
2534
2549
  // src/components/threads/Thread/Root/index.tsx
2535
- import { jsx as jsx45 } from "react/jsx-runtime";
2550
+ import { jsx as jsx46 } from "react/jsx-runtime";
2536
2551
  var Root4 = function(_param) {
2537
2552
  var children = _param.children, rest = _object_without_properties(_param, [
2538
2553
  "children"
2539
2554
  ]);
2540
- return /* @__PURE__ */ jsx45(Provider2, _object_spread_props(_object_spread({}, rest), {
2541
- children: /* @__PURE__ */ jsx45(Flex15, {
2555
+ return /* @__PURE__ */ jsx46(Provider2, _object_spread_props(_object_spread({}, rest), {
2556
+ children: /* @__PURE__ */ jsx46(Flex15, {
2542
2557
  direction: "column",
2543
2558
  flexGrow: "1",
2544
2559
  children: children
@@ -2546,12 +2561,12 @@ var Root4 = function(_param) {
2546
2561
  }));
2547
2562
  };
2548
2563
  // src/components/threads/Thread/index.tsx
2549
- import { jsx as jsx46, jsxs as jsxs14 } from "react/jsx-runtime";
2564
+ import { jsx as jsx47, jsxs as jsxs14 } from "react/jsx-runtime";
2550
2565
  var Thread = function(props) {
2551
2566
  return /* @__PURE__ */ jsxs14(Root4, _object_spread_props(_object_spread({}, props), {
2552
2567
  children: [
2553
- /* @__PURE__ */ jsx46(Messages, {}),
2554
- /* @__PURE__ */ jsx46(MessageForm, {})
2568
+ /* @__PURE__ */ jsx47(Messages, {}),
2569
+ /* @__PURE__ */ jsx47(MessageForm, {})
2555
2570
  ]
2556
2571
  }));
2557
2572
  };
@@ -2563,8 +2578,6 @@ import { useContext as useContext11 } from "react";
2563
2578
  var useMessageContext = function() {
2564
2579
  return useContext11(MessageContext);
2565
2580
  };
2566
- // src/components/threads/ThreadDialog/Root/index.tsx
2567
- import { Flex as Flex17 } from "@radix-ui/themes";
2568
2581
  // src/components/threads/ThreadDialog/Provider/index.tsx
2569
2582
  import { useState as useState3 } from "react";
2570
2583
  // src/contexts/threads/ThreadDialogContext/index.ts
@@ -2579,12 +2592,12 @@ var useThreadDialogContext = function() {
2579
2592
  return useContext12(ThreadDialogContext);
2580
2593
  };
2581
2594
  // src/components/threads/ThreadDialog/Provider/index.tsx
2582
- import { jsx as jsx47 } from "react/jsx-runtime";
2595
+ import { jsx as jsx48 } from "react/jsx-runtime";
2583
2596
  var Provider3 = function(param) {
2584
2597
  var children = param.children;
2585
2598
  var threadDialogContext = useThreadDialogContext();
2586
2599
  var _useState3 = _sliced_to_array(useState3(threadDialogContext.isOpen), 2), isOpen = _useState3[0], setIsOpen = _useState3[1];
2587
- return /* @__PURE__ */ jsx47(ThreadDialogContext.Provider, {
2600
+ return /* @__PURE__ */ jsx48(ThreadDialogContext.Provider, {
2588
2601
  value: {
2589
2602
  isOpen: isOpen,
2590
2603
  setIsOpen: setIsOpen
@@ -2599,25 +2612,25 @@ import * as Toast2 from "@radix-ui/react-toast";
2599
2612
  import * as Toast from "@radix-ui/react-toast";
2600
2613
  import { Card, Text as Text6, Flex as Flex16 } from "@radix-ui/themes";
2601
2614
  import { CheckCircledIcon as CheckCircledIcon2, CrossCircledIcon } from "@radix-ui/react-icons";
2602
- import { jsx as jsx48, jsxs as jsxs15 } from "react/jsx-runtime";
2615
+ import { jsx as jsx49, jsxs as jsxs15 } from "react/jsx-runtime";
2603
2616
  var CustomToast = function(param) {
2604
2617
  var toast = param.toast;
2605
- return /* @__PURE__ */ jsx48(Toast.Root, {
2606
- children: /* @__PURE__ */ jsx48(Card, {
2607
- children: /* @__PURE__ */ jsx48(Toast.Title, {
2618
+ return /* @__PURE__ */ jsx49(Toast.Root, {
2619
+ children: /* @__PURE__ */ jsx49(Card, {
2620
+ children: /* @__PURE__ */ jsx49(Toast.Title, {
2608
2621
  children: /* @__PURE__ */ jsxs15(Flex16, {
2609
2622
  children: [
2610
- /* @__PURE__ */ jsx48(Flex16, {
2623
+ /* @__PURE__ */ jsx49(Flex16, {
2611
2624
  pr: "2",
2612
2625
  height: "14px",
2613
2626
  align: "center",
2614
- children: toast.type === "success" ? /* @__PURE__ */ jsx48(CheckCircledIcon2, {
2627
+ children: toast.type === "success" ? /* @__PURE__ */ jsx49(CheckCircledIcon2, {
2615
2628
  color: "var(--mint-9)"
2616
- }) : /* @__PURE__ */ jsx48(CrossCircledIcon, {
2629
+ }) : /* @__PURE__ */ jsx49(CrossCircledIcon, {
2617
2630
  color: "var(--red-9)"
2618
2631
  })
2619
2632
  }),
2620
- /* @__PURE__ */ jsx48(Text6, {
2633
+ /* @__PURE__ */ jsx49(Text6, {
2621
2634
  weight: "medium",
2622
2635
  size: "1",
2623
2636
  children: toast.message
@@ -2629,7 +2642,7 @@ var CustomToast = function(param) {
2629
2642
  });
2630
2643
  };
2631
2644
  // src/components/toasts/ToastsProvider/index.tsx
2632
- import { jsx as jsx49, jsxs as jsxs16 } from "react/jsx-runtime";
2645
+ import { jsx as jsx50, jsxs as jsxs16 } from "react/jsx-runtime";
2633
2646
  var ToastsProvider = function(param) {
2634
2647
  var children = param.children;
2635
2648
  var _useState4 = _sliced_to_array(useState4([]), 2), toasts = _useState4[0], setToasts = _useState4[1];
@@ -2640,7 +2653,7 @@ var ToastsProvider = function(param) {
2640
2653
  ]);
2641
2654
  });
2642
2655
  }, []);
2643
- return /* @__PURE__ */ jsx49(ToastsContext.Provider, {
2656
+ return /* @__PURE__ */ jsx50(ToastsContext.Provider, {
2644
2657
  value: {
2645
2658
  toasts: toasts,
2646
2659
  addToast: addToast
@@ -2649,11 +2662,11 @@ var ToastsProvider = function(param) {
2649
2662
  children: [
2650
2663
  children,
2651
2664
  Array.from(toasts).map(function(toast, index) {
2652
- return /* @__PURE__ */ jsx49(CustomToast, {
2665
+ return /* @__PURE__ */ jsx50(CustomToast, {
2653
2666
  toast: toast
2654
2667
  }, index);
2655
2668
  }),
2656
- /* @__PURE__ */ jsx49(Toast2.Viewport, {
2669
+ /* @__PURE__ */ jsx50(Toast2.Viewport, {
2657
2670
  style: {
2658
2671
  position: "absolute",
2659
2672
  bottom: 0,
@@ -2675,34 +2688,26 @@ var ToastsProvider = function(param) {
2675
2688
  });
2676
2689
  };
2677
2690
  // src/components/threads/ThreadDialog/Root/index.tsx
2678
- import { jsx as jsx50 } from "react/jsx-runtime";
2691
+ import { jsx as jsx51 } from "react/jsx-runtime";
2679
2692
  var Root6 = function(param) {
2680
2693
  var children = param.children, _param_style = param.style, style = _param_style === void 0 ? {} : _param_style;
2681
- return /* @__PURE__ */ jsx50(ToastsProvider, {
2682
- children: /* @__PURE__ */ jsx50(Provider3, {
2683
- children: /* @__PURE__ */ jsx50(Flex17, {
2684
- direction: "column",
2685
- justify: "end",
2686
- align: "end",
2687
- position: "fixed",
2688
- style: _object_spread({
2689
- bottom: "24px",
2690
- right: "24px",
2691
- top: "24px",
2692
- zIndex: 9999999999
2693
- }, style),
2694
- children: children
2695
- })
2694
+ return /* @__PURE__ */ jsx51(ToastsProvider, {
2695
+ children: /* @__PURE__ */ jsx51(Provider3, {
2696
+ children: children
2696
2697
  })
2697
2698
  });
2698
2699
  };
2699
2700
  // src/components/threads/ThreadDialog/Trigger/index.tsx
2700
- import { Flex as Flex18 } from "@radix-ui/themes";
2701
- import { jsx as jsx51 } from "react/jsx-runtime";
2701
+ import { Flex as Flex17 } from "@radix-ui/themes";
2702
+ import { jsx as jsx52 } from "react/jsx-runtime";
2702
2703
  var Trigger = function(param) {
2703
- var children = param.children;
2704
- var setIsOpen = useThreadDialogContext().setIsOpen;
2705
- return /* @__PURE__ */ jsx51(Flex18, {
2704
+ var children = param.children, _param_style = param.style, style = _param_style === void 0 ? {} : _param_style;
2705
+ var _useThreadDialogContext = useThreadDialogContext(), setIsOpen = _useThreadDialogContext.setIsOpen, isOpen = _useThreadDialogContext.isOpen;
2706
+ return /* @__PURE__ */ jsx52(Flex17, {
2707
+ display: {
2708
+ initial: isOpen ? "none" : "flex",
2709
+ sm: "flex"
2710
+ },
2706
2711
  onClick: function() {
2707
2712
  return setIsOpen(function(prev) {
2708
2713
  return !prev;
@@ -2710,66 +2715,144 @@ var Trigger = function(param) {
2710
2715
  },
2711
2716
  direction: "column",
2712
2717
  flexShrink: "0",
2718
+ justify: "end",
2719
+ align: "end",
2720
+ position: "fixed",
2721
+ bottom: "24px",
2722
+ right: "24px",
2723
+ style: _object_spread({
2724
+ zIndex: 9999999999
2725
+ }, style),
2713
2726
  children: children
2714
2727
  });
2715
2728
  };
2716
2729
  // src/components/threads/ThreadDialog/Button/index.tsx
2717
2730
  import { IconButton } from "@radix-ui/themes";
2718
2731
  import { ChatBubbleIcon } from "@radix-ui/react-icons";
2719
- import { jsx as jsx52 } from "react/jsx-runtime";
2732
+ import { jsx as jsx53 } from "react/jsx-runtime";
2720
2733
  var Button3 = function() {
2721
- return /* @__PURE__ */ jsx52(IconButton, {
2734
+ return /* @__PURE__ */ jsx53(IconButton, {
2722
2735
  size: "4",
2723
2736
  radius: "full",
2724
- children: /* @__PURE__ */ jsx52(ChatBubbleIcon, {})
2737
+ children: /* @__PURE__ */ jsx53(ChatBubbleIcon, {})
2725
2738
  });
2726
2739
  };
2727
2740
  // src/components/threads/ThreadDialog/Content/index.tsx
2728
2741
  import { Card as Card2, Inset, Flex as Flex19 } from "@radix-ui/themes";
2729
- import { jsx as jsx53, jsxs as jsxs17 } from "react/jsx-runtime";
2742
+ // src/components/threads/ThreadDialog/Close/index.tsx
2743
+ import { Cross1Icon } from "@radix-ui/react-icons";
2744
+ import { IconButton as IconButton2, Flex as Flex18 } from "@radix-ui/themes";
2745
+ import { jsx as jsx54 } from "react/jsx-runtime";
2746
+ var Close = function() {
2747
+ var _useThreadDialogContext = useThreadDialogContext(), setIsOpen = _useThreadDialogContext.setIsOpen, isOpen = _useThreadDialogContext.isOpen;
2748
+ return /* @__PURE__ */ jsx54(Flex18, {
2749
+ display: {
2750
+ initial: isOpen ? "flex" : "none",
2751
+ sm: "none"
2752
+ },
2753
+ onClick: function() {
2754
+ return setIsOpen(function(prev) {
2755
+ return !prev;
2756
+ });
2757
+ },
2758
+ direction: "column",
2759
+ flexShrink: "0",
2760
+ justify: "end",
2761
+ align: "end",
2762
+ position: "absolute",
2763
+ top: "24px",
2764
+ right: "24px",
2765
+ style: {
2766
+ zIndex: 9999999999
2767
+ },
2768
+ children: /* @__PURE__ */ jsx54(IconButton2, {
2769
+ size: "2",
2770
+ radius: "full",
2771
+ variant: "soft",
2772
+ children: /* @__PURE__ */ jsx54(Cross1Icon, {})
2773
+ })
2774
+ });
2775
+ };
2776
+ // src/components/threads/ThreadDialog/Content/index.tsx
2777
+ import { jsx as jsx55, jsxs as jsxs17 } from "react/jsx-runtime";
2730
2778
  var Root7 = function(param) {
2731
- var children = param.children;
2779
+ var children = param.children, _param_style = param.style, style = _param_style === void 0 ? {} : _param_style;
2732
2780
  var isOpen = useThreadDialogContext().isOpen;
2733
2781
  if (!isOpen) return null;
2734
- return /* @__PURE__ */ jsx53(Card2, {
2735
- mb: "3",
2736
- style: {
2737
- display: "flex",
2738
- flexGrow: 1,
2739
- width: "100vw",
2740
- maxWidth: "400px",
2741
- maxHeight: "720px"
2782
+ return /* @__PURE__ */ jsx55(Flex19, {
2783
+ direction: "column",
2784
+ justify: "end",
2785
+ position: "fixed",
2786
+ bottom: {
2787
+ initial: "0",
2788
+ sm: "72px"
2789
+ },
2790
+ right: {
2791
+ initial: "0",
2792
+ sm: "24px"
2793
+ },
2794
+ top: {
2795
+ initial: "0",
2796
+ sm: "24px"
2797
+ },
2798
+ maxHeight: {
2799
+ initial: void 0,
2800
+ sm: "720px"
2801
+ },
2802
+ maxWidth: {
2803
+ initial: void 0,
2804
+ sm: "400px"
2742
2805
  },
2743
- children: /* @__PURE__ */ jsx53(Inset, {
2744
- clip: "padding-box",
2745
- side: "all",
2746
- pb: "current",
2806
+ width: "100%",
2807
+ style: _object_spread({
2808
+ zIndex: 9999999999
2809
+ }, style),
2810
+ children: /* @__PURE__ */ jsxs17(Card2, {
2811
+ mb: {
2812
+ initial: void 0,
2813
+ sm: "3"
2814
+ },
2747
2815
  style: {
2816
+ position: "relative",
2748
2817
  display: "flex",
2749
2818
  flexGrow: 1
2750
2819
  },
2751
- children: children
2820
+ children: [
2821
+ /* @__PURE__ */ jsx55(Inset, {
2822
+ clip: "padding-box",
2823
+ side: "all",
2824
+ pb: "current",
2825
+ style: {
2826
+ display: "flex",
2827
+ flexGrow: 1
2828
+ },
2829
+ children: children
2830
+ }),
2831
+ /* @__PURE__ */ jsx55(Close, {})
2832
+ ]
2752
2833
  })
2753
2834
  });
2754
2835
  };
2755
- var Content4 = function() {
2756
- return /* @__PURE__ */ jsx53(Root7, {
2836
+ var Content4 = function(param) {
2837
+ var _param_style = param.style, style = _param_style === void 0 ? {} : _param_style;
2838
+ return /* @__PURE__ */ jsx55(Root7, {
2839
+ style: style,
2757
2840
  children: /* @__PURE__ */ jsxs17(Thread.Root, {
2758
2841
  children: [
2759
- /* @__PURE__ */ jsx53(Thread.Messages, {
2842
+ /* @__PURE__ */ jsx55(Thread.Messages, {
2760
2843
  style: {
2761
2844
  paddingTop: "var(--space-5)",
2762
2845
  paddingRight: "var(--space-5)",
2763
2846
  paddingLeft: "var(--space-5)"
2764
2847
  }
2765
2848
  }),
2766
- /* @__PURE__ */ jsx53(Flex19, {
2849
+ /* @__PURE__ */ jsx55(Flex19, {
2767
2850
  direction: "column",
2768
2851
  pl: "5",
2769
2852
  pr: "5",
2770
2853
  pb: "3",
2771
2854
  flexShrink: "0",
2772
- children: /* @__PURE__ */ jsx53(Thread.MessageForm, {})
2855
+ children: /* @__PURE__ */ jsx55(Thread.MessageForm, {})
2773
2856
  })
2774
2857
  ]
2775
2858
  })
@@ -2777,13 +2860,13 @@ var Content4 = function() {
2777
2860
  };
2778
2861
  Content4.Root = Root7;
2779
2862
  // src/components/threads/ThreadDialog/index.tsx
2780
- import { jsx as jsx54, jsxs as jsxs18 } from "react/jsx-runtime";
2863
+ import { jsx as jsx56, jsxs as jsxs18 } from "react/jsx-runtime";
2781
2864
  var ThreadDialog = function() {
2782
2865
  return /* @__PURE__ */ jsxs18(Root6, {
2783
2866
  children: [
2784
- /* @__PURE__ */ jsx54(Content4, {}),
2785
- /* @__PURE__ */ jsx54(Trigger, {
2786
- children: /* @__PURE__ */ jsx54(Button3, {})
2867
+ /* @__PURE__ */ jsx56(Content4, {}),
2868
+ /* @__PURE__ */ jsx56(Trigger, {
2869
+ children: /* @__PURE__ */ jsx56(Button3, {})
2787
2870
  })
2788
2871
  ]
2789
2872
  });
@@ -3066,7 +3149,7 @@ var isHtmlAudioSupported = !unsupportedNames.includes(((_detect = detect()) ===
3066
3149
  // src/hooks/audioThreads/useMessageAudio/index.ts
3067
3150
  var useMessageAudio = function(param) {
3068
3151
  var onEnd = param.onEnd;
3069
- var _useState6 = _sliced_to_array(useState6([]), 2), playedMessageIds = _useState6[0], setPlayedMessageIds = _useState6[1];
3152
+ var _useState6 = _sliced_to_array(useState6([]), 2), playedMessages = _useState6[0], setPlayedMessages = _useState6[1];
3070
3153
  var audioPlayer = useAudioPlayer2();
3071
3154
  var superinterfaceContext = useSuperinterfaceContext();
3072
3155
  var latestMessageProps = useLatestMessage();
@@ -3074,14 +3157,19 @@ var useMessageAudio = function(param) {
3074
3157
  if (audioPlayer.playing) return;
3075
3158
  if (!latestMessageProps.latestMessage) return;
3076
3159
  if (latestMessageProps.latestMessage.role !== "assistant") return;
3077
- if (playedMessageIds.includes(latestMessageProps.latestMessage.id)) return;
3160
+ if (playedMessages.find(function(pm) {
3161
+ return pm.id === latestMessageProps.latestMessage.id || isOptimistic({
3162
+ id: pm.id
3163
+ }) && pm.content === latestMessageProps.latestMessage.content;
3164
+ })) return;
3165
+ if (playedMessages.includes(latestMessageProps.latestMessage)) return;
3078
3166
  var input2 = input({
3079
3167
  message: latestMessageProps.latestMessage
3080
3168
  });
3081
3169
  if (!input2) return;
3082
- setPlayedMessageIds(function(prev) {
3170
+ setPlayedMessages(function(prev) {
3083
3171
  return _to_consumable_array(prev).concat([
3084
- latestMessageProps.latestMessage.id
3172
+ latestMessageProps.latestMessage
3085
3173
  ]);
3086
3174
  });
3087
3175
  audioPlayer.load("".concat(superinterfaceContext.baseUrl, "/tts?input=").concat(input2), {
@@ -3101,7 +3189,7 @@ var useMessageAudio = function(param) {
3101
3189
  superinterfaceContext,
3102
3190
  latestMessageProps,
3103
3191
  audioPlayer,
3104
- playedMessageIds,
3192
+ playedMessages,
3105
3193
  onEnd
3106
3194
  ]);
3107
3195
  var isInited = useRef5(false);
@@ -3141,7 +3229,7 @@ var useMessageAudio = function(param) {
3141
3229
  });
3142
3230
  };
3143
3231
  // src/components/threads/AudioThread/Root/index.tsx
3144
- import { jsx as jsx55 } from "react/jsx-runtime";
3232
+ import { jsx as jsx57 } from "react/jsx-runtime";
3145
3233
  var Root8 = function(param) {
3146
3234
  var children = param.children;
3147
3235
  useLifecycle();
@@ -3162,6 +3250,7 @@ var Root8 = function(param) {
3162
3250
  return _ts_generator(this, function(_state) {
3163
3251
  switch(_state.label){
3164
3252
  case 0:
3253
+ console.log("creaing", chunks);
3165
3254
  blob = new Blob(chunks, {
3166
3255
  type: chunks[0].type
3167
3256
  });
@@ -3201,62 +3290,36 @@ var Root8 = function(param) {
3201
3290
  createMessageProps: createMessageProps,
3202
3291
  messageAudioProps: messageAudioProps
3203
3292
  }).status;
3204
- return /* @__PURE__ */ jsx55(AudioThreadContext.Provider, {
3293
+ return /* @__PURE__ */ jsx57(AudioThreadContext.Provider, {
3205
3294
  value: {
3206
3295
  status: status,
3207
3296
  recorderProps: recorderProps,
3208
3297
  messageAudioProps: messageAudioProps
3209
3298
  },
3210
- children: /* @__PURE__ */ jsx55(Flex20, {
3299
+ children: /* @__PURE__ */ jsx57(Flex20, {
3211
3300
  direction: "column",
3212
3301
  flexGrow: "1",
3213
- p: "5",
3302
+ p: "9",
3214
3303
  children: children
3215
3304
  })
3216
3305
  });
3217
3306
  };
3218
3307
  // src/components/threads/AudioThread/Visualization/index.tsx
3219
- import { Flex as Flex21 } from "@radix-ui/themes";
3308
+ import { Flex as Flex22 } from "@radix-ui/themes";
3220
3309
  // src/hooks/threads/useAudioThreadContext/index.ts
3221
3310
  import { useContext as useContext13 } from "react";
3222
3311
  var useAudioThreadContext = function() {
3223
3312
  return useContext13(AudioThreadContext);
3224
3313
  };
3225
- // src/components/threads/AudioThread/Visualization/index.tsx
3226
- import { jsx as jsx56 } from "react/jsx-runtime";
3227
- var Visualization = function() {
3228
- var audioThreadContext = useAudioThreadContext();
3229
- return /* @__PURE__ */ jsx56(Flex21, {
3230
- direction: "column",
3231
- align: "center",
3232
- justify: "center",
3233
- mb: "3",
3234
- flexGrow: "1",
3235
- children: /* @__PURE__ */ jsx56(Flex21, {
3236
- align: "center",
3237
- justify: "center",
3238
- height: "200px",
3239
- width: "200px",
3240
- style: {
3241
- backgroundColor: "var(--".concat(audioThreadContext.status === "playing" ? "mint" : "gray", "-4)"),
3242
- borderRadius: "9999px"
3243
- }
3244
- })
3245
- });
3246
- };
3247
- // src/components/threads/AudioThread/Form/index.tsx
3248
- import { SpeakerModerateIcon } from "@radix-ui/react-icons";
3249
- import { Flex as Flex24 } from "@radix-ui/themes";
3250
- // src/components/threads/AudioThread/Form/Visualizer/index.tsx
3314
+ // src/components/threads/AudioThread/BarsVisualizer/index.tsx
3251
3315
  import _7 from "lodash";
3252
- import { Flex as Flex22, Grid } from "@radix-ui/themes";
3316
+ import { Flex as Flex21, Grid } from "@radix-ui/themes";
3253
3317
  import { useState as useState7, useEffect as useEffect9, useCallback as useCallback4 } from "react";
3254
3318
  import { cluster } from "radash";
3255
- import { jsx as jsx57 } from "react/jsx-runtime";
3319
+ import { jsx as jsx58 } from "react/jsx-runtime";
3256
3320
  var barCount = 4;
3257
- var Visualizer = function() {
3258
- var audioThreadContext = useAudioThreadContext();
3259
- var visualizationAnalyser = audioThreadContext.recorderProps.visualizationAnalyser;
3321
+ var BarsVisualizer = function(param) {
3322
+ var visualizationAnalyser = param.visualizationAnalyser, color = param.color, height = param.height, barWidth = param.barWidth;
3260
3323
  var _useState7 = _sliced_to_array(useState7(function() {
3261
3324
  return new AudioContext().createAnalyser();
3262
3325
  }), 1), emptyVisualizer = _useState7[0];
@@ -3284,7 +3347,7 @@ var Visualizer = function() {
3284
3347
  visualizationAnalyser,
3285
3348
  emptyVisualizer
3286
3349
  ]);
3287
- return /* @__PURE__ */ jsx57(Grid, {
3350
+ return /* @__PURE__ */ jsx58(Grid, {
3288
3351
  columns: "".concat(barCount),
3289
3352
  gap: "1",
3290
3353
  width: "auto",
@@ -3293,18 +3356,18 @@ var Visualizer = function() {
3293
3356
  gridTemplateColumns: "repeat(4, minmax(0, 1fr))"
3294
3357
  },
3295
3358
  children: barHeights.map(function(barHeight, index) {
3296
- return /* @__PURE__ */ jsx57(Flex22, {
3359
+ return /* @__PURE__ */ jsx58(Flex21, {
3297
3360
  direction: "column",
3298
3361
  align: "center",
3299
3362
  justify: "center",
3300
- height: "20px",
3301
- children: /* @__PURE__ */ jsx57(Flex22, {
3363
+ height: height,
3364
+ children: /* @__PURE__ */ jsx58(Flex21, {
3302
3365
  minHeight: "50%",
3303
3366
  maxHeight: "100%",
3304
3367
  height: "".concat(barHeight + 20, "%"),
3305
- width: "12px",
3368
+ width: barWidth,
3306
3369
  style: {
3307
- backgroundColor: "var(--".concat(audioThreadContext.status === "recording" ? "mint" : "gray", "-11)"),
3370
+ backgroundColor: "var(--".concat(color, "-11)"),
3308
3371
  borderRadius: "var(--radius-6)"
3309
3372
  }
3310
3373
  })
@@ -3312,32 +3375,63 @@ var Visualizer = function() {
3312
3375
  })
3313
3376
  });
3314
3377
  };
3378
+ // src/components/threads/AudioThread/Visualization/index.tsx
3379
+ import { jsx as jsx59 } from "react/jsx-runtime";
3380
+ var Visualization = function() {
3381
+ var audioThreadContext = useAudioThreadContext();
3382
+ return /* @__PURE__ */ jsx59(Flex22, {
3383
+ direction: "column",
3384
+ align: "center",
3385
+ justify: "center",
3386
+ mb: "3",
3387
+ flexGrow: "1",
3388
+ children: /* @__PURE__ */ jsx59(Flex22, {
3389
+ align: "center",
3390
+ justify: "center",
3391
+ height: "200px",
3392
+ width: "200px",
3393
+ style: {
3394
+ backgroundColor: "var(--".concat(audioThreadContext.status === "playing" ? "mint" : "gray", "-4)"),
3395
+ borderRadius: "9999px"
3396
+ },
3397
+ children: /* @__PURE__ */ jsx59(BarsVisualizer, {
3398
+ visualizationAnalyser: audioThreadContext.messageAudioProps.visualizationAnalyser,
3399
+ color: audioThreadContext.status === "playing" ? "mint" : "gray",
3400
+ height: "40px",
3401
+ barWidth: "24px"
3402
+ })
3403
+ })
3404
+ });
3405
+ };
3406
+ // src/components/threads/AudioThread/Form/index.tsx
3407
+ import { SpeakerModerateIcon } from "@radix-ui/react-icons";
3408
+ import { Flex as Flex24 } from "@radix-ui/themes";
3315
3409
  // src/components/threads/AudioThread/Form/ActionButton/index.tsx
3316
- import { Flex as Flex23, IconButton as IconButton2, Tooltip } from "@radix-ui/themes";
3410
+ import { Flex as Flex23, IconButton as IconButton3, Tooltip } from "@radix-ui/themes";
3317
3411
  import { PauseIcon, ArrowUpIcon as ArrowUpIcon2, ResumeIcon } from "@radix-ui/react-icons";
3318
- import { jsx as jsx58, jsxs as jsxs19 } from "react/jsx-runtime";
3412
+ import { jsx as jsx60, jsxs as jsxs19 } from "react/jsx-runtime";
3319
3413
  var ActionButton = function() {
3320
3414
  var audioThreadContext = useAudioThreadContext();
3321
3415
  if (audioThreadContext.status === "recording") {
3322
3416
  return /* @__PURE__ */ jsxs19(Flex23, {
3323
3417
  align: "center",
3324
3418
  children: [
3325
- /* @__PURE__ */ jsx58(Flex23, {
3419
+ /* @__PURE__ */ jsx60(Flex23, {
3326
3420
  mr: "3",
3327
3421
  ml: "-7",
3328
- children: /* @__PURE__ */ jsx58(IconButton2, {
3422
+ children: /* @__PURE__ */ jsx60(IconButton3, {
3329
3423
  onClick: audioThreadContext.recorderProps.pause,
3330
3424
  color: "gray",
3331
3425
  radius: "full",
3332
3426
  size: "1",
3333
- children: /* @__PURE__ */ jsx58(PauseIcon, {})
3427
+ children: /* @__PURE__ */ jsx60(PauseIcon, {})
3334
3428
  })
3335
3429
  }),
3336
- /* @__PURE__ */ jsx58(Tooltip, {
3430
+ /* @__PURE__ */ jsx60(Tooltip, {
3337
3431
  open: true,
3338
3432
  content: "Send your message",
3339
3433
  side: "bottom",
3340
- children: /* @__PURE__ */ jsx58(IconButton2, {
3434
+ children: /* @__PURE__ */ jsx60(IconButton3, {
3341
3435
  onClick: audioThreadContext.recorderProps.stop,
3342
3436
  color: "gray",
3343
3437
  highContrast: true,
@@ -3346,14 +3440,14 @@ var ActionButton = function() {
3346
3440
  style: {
3347
3441
  border: "2px solid var(--gray-8)"
3348
3442
  },
3349
- children: /* @__PURE__ */ jsx58(ArrowUpIcon2, {})
3443
+ children: /* @__PURE__ */ jsx60(ArrowUpIcon2, {})
3350
3444
  })
3351
3445
  })
3352
3446
  ]
3353
3447
  });
3354
3448
  }
3355
3449
  if (audioThreadContext.status === "recorderPaused") {
3356
- return /* @__PURE__ */ jsx58(IconButton2, {
3450
+ return /* @__PURE__ */ jsx60(IconButton3, {
3357
3451
  onClick: audioThreadContext.recorderProps.resume,
3358
3452
  color: "red",
3359
3453
  radius: "full",
@@ -3361,11 +3455,11 @@ var ActionButton = function() {
3361
3455
  style: {
3362
3456
  border: "2px solid var(--gray-8)"
3363
3457
  },
3364
- children: /* @__PURE__ */ jsx58(ResumeIcon, {})
3458
+ children: /* @__PURE__ */ jsx60(ResumeIcon, {})
3365
3459
  });
3366
3460
  }
3367
3461
  if (audioThreadContext.status === "idle") {
3368
- return /* @__PURE__ */ jsx58(IconButton2, {
3462
+ return /* @__PURE__ */ jsx60(IconButton3, {
3369
3463
  onClick: function() {
3370
3464
  return audioThreadContext.recorderProps.start();
3371
3465
  },
@@ -3378,7 +3472,7 @@ var ActionButton = function() {
3378
3472
  });
3379
3473
  }
3380
3474
  if (audioThreadContext.status === "playing") {
3381
- return /* @__PURE__ */ jsx58(IconButton2, {
3475
+ return /* @__PURE__ */ jsx60(IconButton3, {
3382
3476
  onClick: function() {
3383
3477
  return audioThreadContext.messageAudioProps.pause();
3384
3478
  },
@@ -3388,11 +3482,11 @@ var ActionButton = function() {
3388
3482
  style: {
3389
3483
  border: "2px solid var(--gray-8)"
3390
3484
  },
3391
- children: /* @__PURE__ */ jsx58(PauseIcon, {})
3485
+ children: /* @__PURE__ */ jsx60(PauseIcon, {})
3392
3486
  });
3393
3487
  }
3394
3488
  if (audioThreadContext.status === "playerPaused") {
3395
- return /* @__PURE__ */ jsx58(IconButton2, {
3489
+ return /* @__PURE__ */ jsx60(IconButton3, {
3396
3490
  onClick: function() {
3397
3491
  return audioThreadContext.messageAudioProps.play();
3398
3492
  },
@@ -3402,10 +3496,10 @@ var ActionButton = function() {
3402
3496
  style: {
3403
3497
  border: "2px solid var(--gray-8)"
3404
3498
  },
3405
- children: /* @__PURE__ */ jsx58(ResumeIcon, {})
3499
+ children: /* @__PURE__ */ jsx60(ResumeIcon, {})
3406
3500
  });
3407
3501
  }
3408
- return /* @__PURE__ */ jsx58(IconButton2, {
3502
+ return /* @__PURE__ */ jsx60(IconButton3, {
3409
3503
  size: "4",
3410
3504
  color: "red",
3411
3505
  radius: "full",
@@ -3416,7 +3510,7 @@ var ActionButton = function() {
3416
3510
  });
3417
3511
  };
3418
3512
  // src/components/threads/AudioThread/Form/index.tsx
3419
- import { jsx as jsx59, jsxs as jsxs20 } from "react/jsx-runtime";
3513
+ import { jsx as jsx61, jsxs as jsxs20 } from "react/jsx-runtime";
3420
3514
  var Form = function() {
3421
3515
  var audioThreadContext = useAudioThreadContext();
3422
3516
  return /* @__PURE__ */ jsxs20(Flex24, {
@@ -3427,38 +3521,43 @@ var Form = function() {
3427
3521
  pb: "3",
3428
3522
  align: "center",
3429
3523
  children: [
3430
- /* @__PURE__ */ jsx59(Flex24, {
3524
+ /* @__PURE__ */ jsx61(Flex24, {
3431
3525
  ml: "-5",
3432
3526
  mr: "2",
3433
3527
  align: "center",
3434
- children: /* @__PURE__ */ jsx59(SpeakerModerateIcon, {
3528
+ children: /* @__PURE__ */ jsx61(SpeakerModerateIcon, {
3435
3529
  style: {
3436
3530
  color: "var(--".concat(audioThreadContext.status === "recording" ? "mint" : "gray", "-12)")
3437
3531
  }
3438
3532
  })
3439
3533
  }),
3440
- /* @__PURE__ */ jsx59(Flex24, {
3534
+ /* @__PURE__ */ jsx61(Flex24, {
3441
3535
  px: "2",
3442
3536
  py: "1",
3443
3537
  style: {
3444
3538
  backgroundColor: "var(--".concat(audioThreadContext.status === "recording" ? "mint" : "gray", "-4)"),
3445
3539
  borderRadius: "var(--radius-6)"
3446
3540
  },
3447
- children: /* @__PURE__ */ jsx59(Visualizer, {})
3541
+ children: /* @__PURE__ */ jsx61(BarsVisualizer, {
3542
+ visualizationAnalyser: audioThreadContext.recorderProps.visualizationAnalyser,
3543
+ color: audioThreadContext.status === "recording" ? "mint" : "gray",
3544
+ height: "20px",
3545
+ barWidth: "12px"
3546
+ })
3448
3547
  })
3449
3548
  ]
3450
3549
  }),
3451
- /* @__PURE__ */ jsx59(ActionButton, {})
3550
+ /* @__PURE__ */ jsx61(ActionButton, {})
3452
3551
  ]
3453
3552
  });
3454
3553
  };
3455
3554
  // src/components/threads/AudioThread/index.tsx
3456
- import { jsx as jsx60, jsxs as jsxs21 } from "react/jsx-runtime";
3555
+ import { jsx as jsx62, jsxs as jsxs21 } from "react/jsx-runtime";
3457
3556
  var AudioThread = function(props) {
3458
3557
  return /* @__PURE__ */ jsxs21(Root8, _object_spread_props(_object_spread({}, props), {
3459
3558
  children: [
3460
- /* @__PURE__ */ jsx60(Visualization, {}),
3461
- /* @__PURE__ */ jsx60(Form, {})
3559
+ /* @__PURE__ */ jsx62(Visualization, {}),
3560
+ /* @__PURE__ */ jsx62(Form, {})
3462
3561
  ]
3463
3562
  }));
3464
3563
  };
@@ -3466,15 +3565,15 @@ AudioThread.Root = Root8;
3466
3565
  AudioThread.Visualization = Visualization;
3467
3566
  AudioThread.Form = Form;
3468
3567
  // src/components/threads/AudioThreadDialog/index.tsx
3469
- import { jsx as jsx61, jsxs as jsxs22 } from "react/jsx-runtime";
3568
+ import { jsx as jsx63, jsxs as jsxs22 } from "react/jsx-runtime";
3470
3569
  var AudioThreadDialog = function() {
3471
3570
  return /* @__PURE__ */ jsxs22(Root6, {
3472
3571
  children: [
3473
- /* @__PURE__ */ jsx61(Content4.Root, {
3474
- children: /* @__PURE__ */ jsx61(AudioThread, {})
3572
+ /* @__PURE__ */ jsx63(Content4.Root, {
3573
+ children: /* @__PURE__ */ jsx63(AudioThread, {})
3475
3574
  }),
3476
- /* @__PURE__ */ jsx61(Trigger, {
3477
- children: /* @__PURE__ */ jsx61(Button3, {})
3575
+ /* @__PURE__ */ jsx63(Trigger, {
3576
+ children: /* @__PURE__ */ jsx63(Button3, {})
3478
3577
  })
3479
3578
  ]
3480
3579
  });
@@ -3493,11 +3592,11 @@ import { Flex as Flex25 } from "@radix-ui/themes";
3493
3592
  // src/components/suggestions/Suggestions/Item.tsx
3494
3593
  import { ArrowUpIcon as ArrowUpIcon3 } from "@radix-ui/react-icons";
3495
3594
  import { Text as Text7, Button as Button4, Spinner as Spinner2 } from "@radix-ui/themes";
3496
- import { jsx as jsx62, jsxs as jsxs23 } from "react/jsx-runtime";
3595
+ import { jsx as jsx64, jsxs as jsxs23 } from "react/jsx-runtime";
3497
3596
  var Item = function(param) {
3498
3597
  var suggestion = param.suggestion, isDisabled = param.isDisabled;
3499
3598
  var _useCreateMessage = useCreateMessage(), createMessage = _useCreateMessage.createMessage, isPending = _useCreateMessage.isPending;
3500
- return /* @__PURE__ */ jsx62(Content5, {
3599
+ return /* @__PURE__ */ jsx64(Content5, {
3501
3600
  onClick: function() {
3502
3601
  createMessage({
3503
3602
  // @ts-ignore-next-line
@@ -3515,22 +3614,31 @@ var Content5 = function(param) {
3515
3614
  variant: "soft",
3516
3615
  onClick: onClick,
3517
3616
  disabled: isDisabled,
3617
+ style: {
3618
+ minHeight: "var(--base-button-height)",
3619
+ height: "inherit",
3620
+ flexShrink: 1
3621
+ },
3518
3622
  children: [
3519
- /* @__PURE__ */ jsx62(Text7, {
3623
+ /* @__PURE__ */ jsx64(Text7, {
3520
3624
  size: "1",
3521
3625
  weight: "regular",
3522
3626
  children: children
3523
3627
  }),
3524
- /* @__PURE__ */ jsx62(Spinner2, {
3628
+ /* @__PURE__ */ jsx64(Spinner2, {
3525
3629
  loading: isPending,
3526
- children: /* @__PURE__ */ jsx62(ArrowUpIcon3, {})
3630
+ children: /* @__PURE__ */ jsx64(ArrowUpIcon3, {
3631
+ style: {
3632
+ flexShrink: 0
3633
+ }
3634
+ })
3527
3635
  })
3528
3636
  ]
3529
3637
  });
3530
3638
  };
3531
3639
  Item.Content = Content5;
3532
3640
  // src/components/suggestions/Suggestions/Content.tsx
3533
- import { jsx as jsx63 } from "react/jsx-runtime";
3641
+ import { jsx as jsx65 } from "react/jsx-runtime";
3534
3642
  var Content6 = function(param) {
3535
3643
  var children = param.children;
3536
3644
  var isRunActiveProps = useIsRunActive();
@@ -3549,12 +3657,12 @@ var Content6 = function(param) {
3549
3657
  isRunActiveProps
3550
3658
  ]);
3551
3659
  if (isEmpty2(suggestions)) return null;
3552
- return /* @__PURE__ */ jsx63(Flex25, {
3660
+ return /* @__PURE__ */ jsx65(Flex25, {
3553
3661
  gap: "2",
3554
3662
  py: "2",
3555
3663
  wrap: "wrap",
3556
3664
  children: suggestions.map(function(suggestion) {
3557
- return /* @__PURE__ */ jsx63(Item, {
3665
+ return /* @__PURE__ */ jsx65(Item, {
3558
3666
  suggestion: suggestion,
3559
3667
  isDisabled: isDisabled
3560
3668
  }, suggestion);
@@ -3562,7 +3670,7 @@ var Content6 = function(param) {
3562
3670
  });
3563
3671
  };
3564
3672
  // src/components/suggestions/Suggestions/index.tsx
3565
- import { jsx as jsx64 } from "react/jsx-runtime";
3673
+ import { jsx as jsx66 } from "react/jsx-runtime";
3566
3674
  var Suggestions = function(param) {
3567
3675
  var children = param.children;
3568
3676
  var latestMessageProps = useLatestMessage();
@@ -3575,14 +3683,14 @@ var Suggestions = function(param) {
3575
3683
  ]);
3576
3684
  if (latestMessageProps.isLoading) return null;
3577
3685
  if (isDisabled) return null;
3578
- return /* @__PURE__ */ jsx64(Content6, {
3686
+ return /* @__PURE__ */ jsx66(Content6, {
3579
3687
  children: children
3580
3688
  });
3581
3689
  };
3582
3690
  Suggestions.Item = Item;
3583
3691
  // src/components/markdown/MarkdownProvider/index.tsx
3584
3692
  import { useMemo as useMemo16 } from "react";
3585
- import { jsx as jsx65 } from "react/jsx-runtime";
3693
+ import { jsx as jsx67 } from "react/jsx-runtime";
3586
3694
  var MarkdownProvider = function(_param) {
3587
3695
  var children = _param.children, rest = _object_without_properties(_param, [
3588
3696
  "children"
@@ -3594,7 +3702,7 @@ var MarkdownProvider = function(_param) {
3594
3702
  rest,
3595
3703
  prevMarkdownContext
3596
3704
  ]);
3597
- return /* @__PURE__ */ jsx65(MarkdownContext.Provider, {
3705
+ return /* @__PURE__ */ jsx67(MarkdownContext.Provider, {
3598
3706
  value: value,
3599
3707
  children: children
3600
3708
  });