@arbidocs/react 0.5.61 → 0.5.63

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 (103) hide show
  1. package/dist/ProductionDialog.d-CpzslFn0.d.cts +51 -0
  2. package/dist/ProductionDialog.d-CpzslFn0.d.ts +51 -0
  3. package/dist/annotations/freeze/index.cjs +14 -14
  4. package/dist/annotations/freeze/index.js +3 -3
  5. package/dist/annotations/index.d.cts +3 -2
  6. package/dist/annotations/index.d.ts +3 -2
  7. package/dist/artifacts/index.cjs +12 -12
  8. package/dist/artifacts/index.js +5 -5
  9. package/dist/bundle-IC65W2AO.cjs +14 -0
  10. package/dist/{bundle-DCWPYNGD.cjs.map → bundle-IC65W2AO.cjs.map} +1 -1
  11. package/dist/bundle-YNOX7VIL.js +5 -0
  12. package/dist/{bundle-JCKKGEJE.js.map → bundle-YNOX7VIL.js.map} +1 -1
  13. package/dist/calls/livekit/index.cjs +54 -54
  14. package/dist/calls/livekit/index.js +6 -6
  15. package/dist/{chunk-S2W3ZOWG.js → chunk-2LV53J46.js} +85 -16
  16. package/dist/chunk-2LV53J46.js.map +1 -0
  17. package/dist/{chunk-H3HYKAS5.cjs → chunk-3BFSALPC.cjs} +3 -3
  18. package/dist/{chunk-H3HYKAS5.cjs.map → chunk-3BFSALPC.cjs.map} +1 -1
  19. package/dist/{chunk-2NFUEC5O.js → chunk-3NBPMR3X.js} +3 -3
  20. package/dist/{chunk-2NFUEC5O.js.map → chunk-3NBPMR3X.js.map} +1 -1
  21. package/dist/chunk-4DTTEUVY.js +1042 -0
  22. package/dist/chunk-4DTTEUVY.js.map +1 -0
  23. package/dist/{chunk-U64WCQP3.js → chunk-AOEJ744V.js} +25 -14
  24. package/dist/chunk-AOEJ744V.js.map +1 -0
  25. package/dist/{chunk-4E737GNX.cjs → chunk-BLBXADTN.cjs} +86 -73
  26. package/dist/chunk-BLBXADTN.cjs.map +1 -0
  27. package/dist/{chunk-X7JXQT6F.cjs → chunk-DVL7EFZZ.cjs} +42 -46
  28. package/dist/chunk-DVL7EFZZ.cjs.map +1 -0
  29. package/dist/{chunk-VAMPYLQ4.cjs → chunk-DZUBZ45Y.cjs} +78 -2
  30. package/dist/chunk-DZUBZ45Y.cjs.map +1 -0
  31. package/dist/{chunk-OSWKXZTJ.js → chunk-ER4LFZG3.js} +12 -16
  32. package/dist/chunk-ER4LFZG3.js.map +1 -0
  33. package/dist/{chunk-5HDC43MF.js → chunk-G4Z3IP4J.js} +72 -3
  34. package/dist/chunk-G4Z3IP4J.js.map +1 -0
  35. package/dist/chunk-GOJHU7RZ.cjs +1122 -0
  36. package/dist/chunk-GOJHU7RZ.cjs.map +1 -0
  37. package/dist/{chunk-G76ASVVH.cjs → chunk-GQAXAZN7.cjs} +25 -14
  38. package/dist/chunk-GQAXAZN7.cjs.map +1 -0
  39. package/dist/{chunk-TUPSNW3B.cjs → chunk-LMW46NBD.cjs} +11 -11
  40. package/dist/{chunk-TUPSNW3B.cjs.map → chunk-LMW46NBD.cjs.map} +1 -1
  41. package/dist/{chunk-KRH55LXW.js → chunk-NCMSQACC.js} +37 -24
  42. package/dist/chunk-NCMSQACC.js.map +1 -0
  43. package/dist/{chunk-A2XSLTIP.js → chunk-NIKPG4PW.js} +3 -3
  44. package/dist/{chunk-A2XSLTIP.js.map → chunk-NIKPG4PW.js.map} +1 -1
  45. package/dist/{chunk-B6I2HRRF.cjs → chunk-PC4O3JDV.cjs} +3 -3
  46. package/dist/{chunk-B6I2HRRF.cjs.map → chunk-PC4O3JDV.cjs.map} +1 -1
  47. package/dist/{chunk-M2SZQBCO.js → chunk-SI7DJWBT.js} +3 -3
  48. package/dist/{chunk-M2SZQBCO.js.map → chunk-SI7DJWBT.js.map} +1 -1
  49. package/dist/{chunk-3QK4VVPG.cjs → chunk-TGSEQGM3.cjs} +3 -3
  50. package/dist/{chunk-3QK4VVPG.cjs.map → chunk-TGSEQGM3.cjs.map} +1 -1
  51. package/dist/{chunk-LCSUCZVX.cjs → chunk-ZNQPUPX6.cjs} +118 -41
  52. package/dist/chunk-ZNQPUPX6.cjs.map +1 -0
  53. package/dist/{chunk-CMNZI4WQ.js → chunk-ZTPJNKF2.js} +4 -4
  54. package/dist/{chunk-CMNZI4WQ.js.map → chunk-ZTPJNKF2.js.map} +1 -1
  55. package/dist/document-tools/core.cjs +408 -0
  56. package/dist/document-tools/core.cjs.map +1 -0
  57. package/dist/document-tools/core.d.cts +957 -0
  58. package/dist/document-tools/core.d.ts +957 -0
  59. package/dist/document-tools/core.js +15 -0
  60. package/dist/document-tools/core.js.map +1 -0
  61. package/dist/document-tools/index.cjs +347 -1130
  62. package/dist/document-tools/index.cjs.map +1 -1
  63. package/dist/document-tools/index.d.cts +12 -950
  64. package/dist/document-tools/index.d.ts +12 -950
  65. package/dist/document-tools/index.js +13 -1034
  66. package/dist/document-tools/index.js.map +1 -1
  67. package/dist/index.cjs +1510 -1255
  68. package/dist/index.cjs.map +1 -1
  69. package/dist/{index.d-BLw5AN0H.d.cts → index.d-AT7wdTWC.d.cts} +50 -2
  70. package/dist/{index.d-BLw5AN0H.d.ts → index.d-AT7wdTWC.d.ts} +50 -2
  71. package/dist/{index.d-DPVj21h1.d.ts → index.d-B0dosFZc.d.cts} +6 -6
  72. package/dist/{index.d-DPVj21h1.d.cts → index.d-B0dosFZc.d.ts} +6 -6
  73. package/dist/index.d.cts +145 -69
  74. package/dist/index.d.ts +145 -69
  75. package/dist/index.js +346 -121
  76. package/dist/index.js.map +1 -1
  77. package/dist/{query-keys.d-DEEMzkLz.d.cts → query-keys.d-BFKQVevT.d.cts} +21 -12
  78. package/dist/{query-keys.d-DEEMzkLz.d.ts → query-keys.d-BFKQVevT.d.ts} +21 -12
  79. package/dist/shell/index.cjs +68 -40
  80. package/dist/shell/index.d.cts +1 -1
  81. package/dist/shell/index.d.ts +1 -1
  82. package/dist/shell/index.js +3 -3
  83. package/dist/store.d-DkFXbWDk.d.ts +35 -0
  84. package/dist/store.d-GADDvC7w.d.cts +35 -0
  85. package/dist/ui/index.cjs +149 -149
  86. package/dist/ui/index.d.cts +1 -1
  87. package/dist/ui/index.d.ts +1 -1
  88. package/dist/ui/index.js +2 -2
  89. package/package.json +11 -3
  90. package/dist/ProductionDialog.d-BDJwBSzj.d.ts +0 -84
  91. package/dist/ProductionDialog.d-DjRQFmQw.d.cts +0 -84
  92. package/dist/bundle-DCWPYNGD.cjs +0 -14
  93. package/dist/bundle-JCKKGEJE.js +0 -5
  94. package/dist/chunk-4E737GNX.cjs.map +0 -1
  95. package/dist/chunk-5HDC43MF.js.map +0 -1
  96. package/dist/chunk-G76ASVVH.cjs.map +0 -1
  97. package/dist/chunk-KRH55LXW.js.map +0 -1
  98. package/dist/chunk-LCSUCZVX.cjs.map +0 -1
  99. package/dist/chunk-OSWKXZTJ.js.map +0 -1
  100. package/dist/chunk-S2W3ZOWG.js.map +0 -1
  101. package/dist/chunk-U64WCQP3.js.map +0 -1
  102. package/dist/chunk-VAMPYLQ4.cjs.map +0 -1
  103. package/dist/chunk-X7JXQT6F.cjs.map +0 -1
@@ -1,10 +1,10 @@
1
1
  'use strict';
2
2
 
3
- var chunkX7JXQT6F_cjs = require('./chunk-X7JXQT6F.cjs');
4
- var chunkG76ASVVH_cjs = require('./chunk-G76ASVVH.cjs');
5
- var chunkVAMPYLQ4_cjs = require('./chunk-VAMPYLQ4.cjs');
6
- var chunkEEIYXVM4_cjs = require('./chunk-EEIYXVM4.cjs');
3
+ var chunkDVL7EFZZ_cjs = require('./chunk-DVL7EFZZ.cjs');
4
+ var chunkGQAXAZN7_cjs = require('./chunk-GQAXAZN7.cjs');
7
5
  var chunkY7S2SQH3_cjs = require('./chunk-Y7S2SQH3.cjs');
6
+ var chunkDZUBZ45Y_cjs = require('./chunk-DZUBZ45Y.cjs');
7
+ var chunkEEIYXVM4_cjs = require('./chunk-EEIYXVM4.cjs');
8
8
  var reactQuery = require('@tanstack/react-query');
9
9
  var react = require('react');
10
10
  var browser = require('@arbidocs/sdk/browser');
@@ -13,7 +13,7 @@ var client = require('@arbidocs/client');
13
13
  function useUserSettings(options) {
14
14
  const arbi = chunkY7S2SQH3_cjs.useArbi();
15
15
  return reactQuery.useQuery({
16
- queryKey: chunkG76ASVVH_cjs.arbiQueryKeys.userSettings(),
16
+ queryKey: chunkGQAXAZN7_cjs.arbiQueryKeys.userSettings(),
17
17
  queryFn: () => arbi.settings.get(),
18
18
  // Edited about once a month, and every write here patches the cache: no refetch on each mount.
19
19
  staleTime: 30 * 60 * 1e3,
@@ -26,18 +26,18 @@ function useUpdateUserSettings() {
26
26
  return reactQuery.useMutation({
27
27
  mutationFn: (patch) => arbi.settings.update(patch),
28
28
  onMutate: async (patch) => {
29
- await qc.cancelQueries({ queryKey: chunkG76ASVVH_cjs.arbiQueryKeys.userSettings() });
30
- const previous = qc.getQueryData(chunkG76ASVVH_cjs.arbiQueryKeys.userSettings());
29
+ await qc.cancelQueries({ queryKey: chunkGQAXAZN7_cjs.arbiQueryKeys.userSettings() });
30
+ const previous = qc.getQueryData(chunkGQAXAZN7_cjs.arbiQueryKeys.userSettings());
31
31
  qc.setQueryData(
32
- chunkG76ASVVH_cjs.arbiQueryKeys.userSettings(),
32
+ chunkGQAXAZN7_cjs.arbiQueryKeys.userSettings(),
33
33
  (old) => old ? { ...old, ...patch } : old
34
34
  );
35
35
  return { previous };
36
36
  },
37
37
  onError: (_err, _patch, context) => {
38
- qc.setQueryData(chunkG76ASVVH_cjs.arbiQueryKeys.userSettings(), context?.previous);
38
+ qc.setQueryData(chunkGQAXAZN7_cjs.arbiQueryKeys.userSettings(), context?.previous);
39
39
  },
40
- onSettled: () => qc.invalidateQueries({ queryKey: chunkG76ASVVH_cjs.arbiQueryKeys.userSettings() })
40
+ onSettled: () => qc.invalidateQueries({ queryKey: chunkGQAXAZN7_cjs.arbiQueryKeys.userSettings() })
41
41
  });
42
42
  }
43
43
  var ALWAYS_ON = { on: true, set: () => {
@@ -150,7 +150,7 @@ var LISTS = {
150
150
  };
151
151
  function patchConversationList(queryClient, workspaceId, reducer) {
152
152
  if (!workspaceId) return;
153
- const key = chunkG76ASVVH_cjs.arbiQueryKeys.conversations(workspaceId);
153
+ const key = chunkGQAXAZN7_cjs.arbiQueryKeys.conversations(workspaceId);
154
154
  const current = queryClient.getQueryData(key) ?? [];
155
155
  const next = reducer(current);
156
156
  if (next !== current) queryClient.setQueryData(key, next);
@@ -218,13 +218,13 @@ function byActivity(a, b) {
218
218
  return bt - at;
219
219
  }
220
220
  function cachedChats(queryClient) {
221
- return queryClient.getQueryData(chunkG76ASVVH_cjs.arbiQueryKeys.chatList()) ?? [];
221
+ return queryClient.getQueryData(chunkGQAXAZN7_cjs.arbiQueryKeys.chatList()) ?? [];
222
222
  }
223
223
  function cachedChat(queryClient, chatExtId) {
224
224
  return cachedChats(queryClient).find((c) => c.external_id === chatExtId);
225
225
  }
226
226
  function upsertChat(queryClient, chat) {
227
- queryClient.setQueryData(chunkG76ASVVH_cjs.arbiQueryKeys.chatList(), (old) => {
227
+ queryClient.setQueryData(chunkGQAXAZN7_cjs.arbiQueryKeys.chatList(), (old) => {
228
228
  if (!old) return old;
229
229
  const rest = old.filter((c) => c.external_id !== chat.external_id);
230
230
  return [chat, ...rest].sort(byActivity);
@@ -232,13 +232,13 @@ function upsertChat(queryClient, chat) {
232
232
  }
233
233
  function removeChat(queryClient, chatExtId) {
234
234
  queryClient.setQueryData(
235
- chunkG76ASVVH_cjs.arbiQueryKeys.chatList(),
235
+ chunkGQAXAZN7_cjs.arbiQueryKeys.chatList(),
236
236
  (old) => old?.filter((c) => c.external_id !== chatExtId)
237
237
  );
238
- queryClient.removeQueries({ queryKey: chunkG76ASVVH_cjs.arbiQueryKeys.chatThread(chatExtId) });
238
+ queryClient.removeQueries({ queryKey: chunkGQAXAZN7_cjs.arbiQueryKeys.chatThread(chatExtId) });
239
239
  }
240
240
  function appendToThread(queryClient, chatExtId, message, replaceOptimisticId) {
241
- queryClient.setQueryData(chunkG76ASVVH_cjs.arbiQueryKeys.chatThread(chatExtId), (old) => {
241
+ queryClient.setQueryData(chunkGQAXAZN7_cjs.arbiQueryKeys.chatThread(chatExtId), (old) => {
242
242
  if (!old) return old;
243
243
  const without = old.messages.filter(
244
244
  (m) => m.external_id !== message.external_id && m.external_id !== replaceOptimisticId
@@ -248,12 +248,12 @@ function appendToThread(queryClient, chatExtId, message, replaceOptimisticId) {
248
248
  }
249
249
  function dropFromThread(queryClient, chatExtId, messageExtId) {
250
250
  queryClient.setQueryData(
251
- chunkG76ASVVH_cjs.arbiQueryKeys.chatThread(chatExtId),
251
+ chunkGQAXAZN7_cjs.arbiQueryKeys.chatThread(chatExtId),
252
252
  (old) => old ? { ...old, messages: old.messages.filter((m) => m.external_id !== messageExtId) } : old
253
253
  );
254
254
  }
255
255
  function replaceInThread(queryClient, chatExtId, message) {
256
- queryClient.setQueryData(chunkG76ASVVH_cjs.arbiQueryKeys.chatThread(chatExtId), (old) => {
256
+ queryClient.setQueryData(chunkGQAXAZN7_cjs.arbiQueryKeys.chatThread(chatExtId), (old) => {
257
257
  if (!old || !old.messages.some((m) => m.external_id === message.external_id)) return old;
258
258
  return {
259
259
  ...old,
@@ -263,14 +263,14 @@ function replaceInThread(queryClient, chatExtId, message) {
263
263
  }
264
264
  function patchLastMessage(queryClient, chatExtId, message) {
265
265
  queryClient.setQueryData(
266
- chunkG76ASVVH_cjs.arbiQueryKeys.chatList(),
266
+ chunkGQAXAZN7_cjs.arbiQueryKeys.chatList(),
267
267
  (old) => old?.map(
268
268
  (c) => c.external_id === chatExtId && c.last_message?.external_id === message.external_id ? { ...c, last_message: message } : c
269
269
  )
270
270
  );
271
271
  }
272
272
  async function deleteChatMessage(arbi, queryClient, chatExtId, messageExtId) {
273
- const thread = queryClient.getQueryData(chunkG76ASVVH_cjs.arbiQueryKeys.chatThread(chatExtId));
273
+ const thread = queryClient.getQueryData(chunkGQAXAZN7_cjs.arbiQueryKeys.chatThread(chatExtId));
274
274
  const before = thread?.messages.find((m) => m.external_id === messageExtId);
275
275
  const listed = cachedChat(queryClient, chatExtId);
276
276
  const wasLast = listed?.last_message?.external_id === messageExtId ? listed.last_message : null;
@@ -291,7 +291,7 @@ async function applyChangedMessage(arbi, queryClient, chatExtId, message) {
291
291
  return;
292
292
  }
293
293
  const chat = cachedChat(queryClient, chatExtId);
294
- if (!chat || !queryClient.getQueryData(chunkG76ASVVH_cjs.arbiQueryKeys.chatThread(chatExtId))) return;
294
+ if (!chat || !queryClient.getQueryData(chunkGQAXAZN7_cjs.arbiQueryKeys.chatThread(chatExtId))) return;
295
295
  try {
296
296
  replaceInThread(queryClient, chatExtId, await arbi.chats.decrypt(chat, message));
297
297
  } catch (err) {
@@ -303,7 +303,7 @@ async function applyChatMessage(arbi, queryClient, chatExtId, message) {
303
303
  const me = myChatId(arbi);
304
304
  const chat = cachedChat(queryClient, chatExtId);
305
305
  if (!chat) {
306
- void queryClient.invalidateQueries({ queryKey: chunkG76ASVVH_cjs.arbiQueryKeys.chatList() });
306
+ void queryClient.invalidateQueries({ queryKey: chunkGQAXAZN7_cjs.arbiQueryKeys.chatList() });
307
307
  return;
308
308
  }
309
309
  const mine = message.sender_ext_id === me;
@@ -317,7 +317,7 @@ async function applyChatMessage(arbi, queryClient, chatExtId, message) {
317
317
  (m) => m.user.external_id === me ? { ...m, last_read_at: message.created_at } : m
318
318
  ) : chat.members
319
319
  });
320
- if (queryClient.getQueryData(chunkG76ASVVH_cjs.arbiQueryKeys.chatThread(chatExtId))) {
320
+ if (queryClient.getQueryData(chunkGQAXAZN7_cjs.arbiQueryKeys.chatThread(chatExtId))) {
321
321
  try {
322
322
  appendToThread(queryClient, chatExtId, await arbi.chats.decrypt(chat, message));
323
323
  } catch (err) {
@@ -328,7 +328,7 @@ async function applyChatMessage(arbi, queryClient, chatExtId, message) {
328
328
  function applyChatRead(arbi, queryClient, chatExtId, userExtId, lastReadAt) {
329
329
  const me = myChatId(arbi);
330
330
  queryClient.setQueryData(
331
- chunkG76ASVVH_cjs.arbiQueryKeys.chatList(),
331
+ chunkGQAXAZN7_cjs.arbiQueryKeys.chatList(),
332
332
  (old) => old?.map(
333
333
  (c) => c.external_id !== chatExtId ? c : {
334
334
  ...c,
@@ -354,11 +354,11 @@ async function applyChatUpdated(arbi, queryClient, chatExtId, message) {
354
354
  }
355
355
  upsertChat(queryClient, chat);
356
356
  if (!message)
357
- void queryClient.invalidateQueries({ queryKey: chunkG76ASVVH_cjs.arbiQueryKeys.chatThread(chatExtId) });
357
+ void queryClient.invalidateQueries({ queryKey: chunkGQAXAZN7_cjs.arbiQueryKeys.chatThread(chatExtId) });
358
358
  }
359
359
  function applyAgentDmStatus(queryClient, status) {
360
360
  if (!["queued", "working", "done", "failed"].includes(status.status)) return;
361
- queryClient.setQueryData(chunkG76ASVVH_cjs.arbiQueryKeys.agentDmStatus(status.agent_ext_id), status);
361
+ queryClient.setQueryData(chunkGQAXAZN7_cjs.arbiQueryKeys.agentDmStatus(status.agent_ext_id), status);
362
362
  }
363
363
  async function applyChatEvent(arbi, queryClient, event) {
364
364
  const e = event;
@@ -373,13 +373,13 @@ async function applyChatEvent(arbi, queryClient, event) {
373
373
 
374
374
  // src/calls/keys.ts
375
375
  function serverCallsExperimental(queryClient) {
376
- return queryClient.getQueryData(chunkG76ASVVH_cjs.callQueryKeys.config())?.experimental !== false;
376
+ return queryClient.getQueryData(chunkGQAXAZN7_cjs.callQueryKeys.config())?.experimental !== false;
377
377
  }
378
378
  function invalidateCall(queryClient, message) {
379
- void queryClient.invalidateQueries({ queryKey: chunkG76ASVVH_cjs.callQueryKeys.call(message.call_ext_id) });
379
+ void queryClient.invalidateQueries({ queryKey: chunkGQAXAZN7_cjs.callQueryKeys.call(message.call_ext_id) });
380
380
  const thread = message.log_conversation_ext_id;
381
381
  if (thread) {
382
- void queryClient.invalidateQueries({ queryKey: chunkG76ASVVH_cjs.arbiQueryKeys.conversationActivity(thread) });
382
+ void queryClient.invalidateQueries({ queryKey: chunkGQAXAZN7_cjs.arbiQueryKeys.conversationActivity(thread) });
383
383
  }
384
384
  }
385
385
 
@@ -589,7 +589,7 @@ function applyCallEvent(queryClient, event, options = {}) {
589
589
  }
590
590
  case "call.declined":
591
591
  if (callExtId && callSession.getState().active?.callExtId === callExtId) {
592
- chunkVAMPYLQ4_cjs.notify.info("Call declined", { record: false, ambient: false });
592
+ chunkDZUBZ45Y_cjs.notify.info("Call declined", { record: false, ambient: false });
593
593
  }
594
594
  return true;
595
595
  case "call.started":
@@ -630,19 +630,19 @@ function applyCallEvent(queryClient, event, options = {}) {
630
630
  }
631
631
  case "call.recording": {
632
632
  if (callExtId)
633
- void queryClient.invalidateQueries({ queryKey: chunkG76ASVVH_cjs.callQueryKeys.recordingsOf(callExtId) });
633
+ void queryClient.invalidateQueries({ queryKey: chunkGQAXAZN7_cjs.callQueryKeys.recordingsOf(callExtId) });
634
634
  const state2 = browser.calls.recordingStateFrom(m);
635
635
  relay("call.recording", callExtId && state2 ? { ...state2, call_ext_id: callExtId } : null);
636
636
  return true;
637
637
  }
638
638
  case "call.recording_updated": {
639
639
  if (callExtId)
640
- void queryClient.invalidateQueries({ queryKey: chunkG76ASVVH_cjs.callQueryKeys.recordingsOf(callExtId) });
640
+ void queryClient.invalidateQueries({ queryKey: chunkGQAXAZN7_cjs.callQueryKeys.recordingsOf(callExtId) });
641
641
  return true;
642
642
  }
643
643
  case "call.recording_deleted": {
644
644
  if (callExtId)
645
- void queryClient.invalidateQueries({ queryKey: chunkG76ASVVH_cjs.callQueryKeys.recordingsOf(callExtId) });
645
+ void queryClient.invalidateQueries({ queryKey: chunkGQAXAZN7_cjs.callQueryKeys.recordingsOf(callExtId) });
646
646
  const recordingExtId = str(m.recording_ext_id);
647
647
  relay(
648
648
  "call.recording_deleted",
@@ -683,11 +683,11 @@ function useProfile(options) {
683
683
  const { client, enabled } = useAccountClient();
684
684
  const qc = reactQuery.useQueryClient();
685
685
  react.useEffect(
686
- () => client.onProfileChange(() => qc.setQueryData(chunkG76ASVVH_cjs.arbiQueryKeys.profile(), client.profile())),
686
+ () => client.onProfileChange(() => qc.setQueryData(chunkGQAXAZN7_cjs.arbiQueryKeys.profile(), client.profile())),
687
687
  [client, qc]
688
688
  );
689
689
  return reactQuery.useQuery({
690
- queryKey: chunkG76ASVVH_cjs.arbiQueryKeys.profile(),
690
+ queryKey: chunkGQAXAZN7_cjs.arbiQueryKeys.profile(),
691
691
  queryFn: () => client.profile(),
692
692
  enabled: (options?.enabled ?? true) && enabled,
693
693
  staleTime: Infinity
@@ -702,9 +702,9 @@ function useUpdateProfile() {
702
702
  return client.profile();
703
703
  },
704
704
  onSuccess: (profile) => {
705
- qc.setQueryData(chunkG76ASVVH_cjs.arbiQueryKeys.profile(), profile);
706
- void qc.invalidateQueries({ queryKey: chunkG76ASVVH_cjs.arbiQueryKeys.identity() });
707
- return qc.invalidateQueries({ queryKey: chunkG76ASVVH_cjs.arbiQueryKeys.workspaces() });
705
+ qc.setQueryData(chunkGQAXAZN7_cjs.arbiQueryKeys.profile(), profile);
706
+ void qc.invalidateQueries({ queryKey: chunkGQAXAZN7_cjs.arbiQueryKeys.identity() });
707
+ return qc.invalidateQueries({ queryKey: chunkGQAXAZN7_cjs.arbiQueryKeys.workspaces() });
708
708
  }
709
709
  });
710
710
  }
@@ -806,7 +806,8 @@ function arbiAccountClient(arbi, overrides = {}) {
806
806
  if (everywhere) await arbi.sessions.logoutAll();
807
807
  else await arbi.logout();
808
808
  } finally {
809
- chunkX7JXQT6F_cjs.clearSealedDrafts();
809
+ chunkDVL7EFZZ_cjs.clearSealedDrafts();
810
+ chunkDZUBZ45Y_cjs.clearChatArtifacts();
810
811
  }
811
812
  },
812
813
  requestDeletion: () => arbi.account.requestDeletion(),
@@ -863,7 +864,7 @@ function useAccountClient() {
863
864
  function useEntitlements() {
864
865
  const arbi = chunkY7S2SQH3_cjs.useArbi();
865
866
  return reactQuery.useQuery({
866
- queryKey: chunkG76ASVVH_cjs.arbiQueryKeys.entitlements(),
867
+ queryKey: chunkGQAXAZN7_cjs.arbiQueryKeys.entitlements(),
867
868
  queryFn: () => arbi.account.entitlements(),
868
869
  enabled: arbi.isLoggedIn,
869
870
  // A plan change shows on the next read; the API enforces it at once either way.
@@ -992,7 +993,7 @@ function ensureMeetingChat(arbi, queryClient, callExtId, callKey) {
992
993
  });
993
994
  if (!ref) throw new Error("The server did not return a meeting chat");
994
995
  if (ref.kind === "chat")
995
- void queryClient.invalidateQueries({ queryKey: chunkG76ASVVH_cjs.arbiQueryKeys.chatList() });
996
+ void queryClient.invalidateQueries({ queryKey: chunkGQAXAZN7_cjs.arbiQueryKeys.chatList() });
996
997
  else void invalidateConversationLists(queryClient);
997
998
  return ref;
998
999
  })();
@@ -2000,7 +2001,7 @@ async function transcribeRecording(params) {
2000
2001
  function useCallsConfig() {
2001
2002
  const arbi = chunkY7S2SQH3_cjs.useArbi();
2002
2003
  const { data } = reactQuery.useQuery({
2003
- queryKey: chunkG76ASVVH_cjs.callQueryKeys.config(),
2004
+ queryKey: chunkGQAXAZN7_cjs.callQueryKeys.config(),
2004
2005
  queryFn: () => arbi.calls.config(),
2005
2006
  enabled: arbi.isLoggedIn,
2006
2007
  staleTime: 5 * 6e4,
@@ -2020,7 +2021,7 @@ function useCallTranscriptionAvailable() {
2020
2021
  function useCall(callExtId) {
2021
2022
  const arbi = chunkY7S2SQH3_cjs.useArbi();
2022
2023
  return reactQuery.useQuery({
2023
- queryKey: chunkG76ASVVH_cjs.callQueryKeys.call(callExtId ?? ""),
2024
+ queryKey: chunkGQAXAZN7_cjs.callQueryKeys.call(callExtId ?? ""),
2024
2025
  queryFn: () => arbi.calls.get(callExtId),
2025
2026
  enabled: !!callExtId && arbi.isLoggedIn,
2026
2027
  staleTime: 6e4,
@@ -2030,7 +2031,7 @@ function useCall(callExtId) {
2030
2031
  function useCallRecordings(callExtId, enabled = true) {
2031
2032
  const arbi = chunkY7S2SQH3_cjs.useArbi();
2032
2033
  return reactQuery.useQuery({
2033
- queryKey: chunkG76ASVVH_cjs.callQueryKeys.recordings(callExtId ?? ""),
2034
+ queryKey: chunkGQAXAZN7_cjs.callQueryKeys.recordings(callExtId ?? ""),
2034
2035
  queryFn: () => arbi.calls.recording.list(callExtId),
2035
2036
  enabled: !!callExtId && enabled && arbi.isLoggedIn,
2036
2037
  retry: false
@@ -2039,7 +2040,7 @@ function useCallRecordings(callExtId, enabled = true) {
2039
2040
  function useCallRecording(callExtId, recordingExtId) {
2040
2041
  const arbi = chunkY7S2SQH3_cjs.useArbi();
2041
2042
  return reactQuery.useQuery({
2042
- queryKey: chunkG76ASVVH_cjs.callQueryKeys.recording(callExtId ?? "", recordingExtId ?? ""),
2043
+ queryKey: chunkGQAXAZN7_cjs.callQueryKeys.recording(callExtId ?? "", recordingExtId ?? ""),
2043
2044
  queryFn: () => arbi.calls.recording.get(callExtId, recordingExtId),
2044
2045
  enabled: !!callExtId && !!recordingExtId && arbi.isLoggedIn,
2045
2046
  retry: false
@@ -2053,7 +2054,7 @@ function useRecordingWindows(callExtId, enabled) {
2053
2054
  function useCallInviteLinks(callExtId) {
2054
2055
  const arbi = chunkY7S2SQH3_cjs.useArbi();
2055
2056
  return reactQuery.useQuery({
2056
- queryKey: chunkG76ASVVH_cjs.callQueryKeys.inviteLinks(callExtId ?? ""),
2057
+ queryKey: chunkGQAXAZN7_cjs.callQueryKeys.inviteLinks(callExtId ?? ""),
2057
2058
  queryFn: () => arbi.calls.inviteLinks.list(callExtId),
2058
2059
  enabled: !!callExtId && arbi.isLoggedIn,
2059
2060
  retry: false
@@ -2065,7 +2066,7 @@ function useRecordingActions(call) {
2065
2066
  return react.useMemo(
2066
2067
  () => ({
2067
2068
  refresh: () => void queryClient.invalidateQueries({
2068
- queryKey: chunkG76ASVVH_cjs.callQueryKeys.recordingsOf(call.external_id)
2069
+ queryKey: chunkGQAXAZN7_cjs.callQueryKeys.recordingsOf(call.external_id)
2069
2070
  }),
2070
2071
  open: (recording) => openRecording(arbi, queryClient, call, recording.external_id, recording),
2071
2072
  transcribe: async (opened, onProgress) => transcribeRecording({
@@ -2086,7 +2087,7 @@ function useRevokeCallInviteLink(callExtId) {
2086
2087
  return react.useCallback(
2087
2088
  async (inviteExtId) => {
2088
2089
  await arbi.calls.inviteLinks.revoke(callExtId, inviteExtId);
2089
- void queryClient.invalidateQueries({ queryKey: chunkG76ASVVH_cjs.callQueryKeys.inviteLinks(callExtId) });
2090
+ void queryClient.invalidateQueries({ queryKey: chunkGQAXAZN7_cjs.callQueryKeys.inviteLinks(callExtId) });
2090
2091
  },
2091
2092
  [arbi, queryClient, callExtId]
2092
2093
  );
@@ -2117,29 +2118,41 @@ function postRecordingDocsToThread(arbi, params) {
2117
2118
  return postToThread(arbi, params.conversationExtId, `Recording: ${meeting}`, content);
2118
2119
  }
2119
2120
  async function saveRecordingFilesToThread(arbi, params) {
2120
- const workspaceKey = await arbi.workspaces.key(params.workspaceExtId);
2121
- params.onUploading?.();
2122
- const result = await browser.documents.uploadDocumentsDirect(
2123
- arbi.getClient(),
2124
- workspaceKey,
2125
- await Promise.all(
2126
- params.files.map(async (file) => ({
2127
- name: file.name,
2128
- data: new Uint8Array(await file.arrayBuffer()),
2129
- contentType: file.type || browser.documents.mimeFromName(file.name)
2130
- }))
2131
- ),
2132
- { shared: true }
2133
- );
2134
- if (!result.doc_ext_ids.length) {
2135
- throw new Error(
2136
- `The files were not uploaded${result.skipped[0] ? `: ${result.skipped[0].reason}` : ""}`
2121
+ const workspaceId = params.workspaceExtId;
2122
+ const isOpen = arbi.hasWorkspace && arbi.getWorkspaceId() === workspaceId;
2123
+ let result;
2124
+ if (isOpen) {
2125
+ const workspaceKey = await arbi.workspaces.key(workspaceId);
2126
+ params.onUploading?.();
2127
+ result = await arbi.documents.uploadDirect(
2128
+ workspaceId,
2129
+ workspaceKey,
2130
+ await Promise.all(
2131
+ params.files.map(async (file) => ({
2132
+ name: file.name,
2133
+ data: new Uint8Array(await file.arrayBuffer()),
2134
+ contentType: file.type || browser.documents.mimeFromName(file.name)
2135
+ }))
2136
+ ),
2137
+ { shared: true }
2137
2138
  );
2139
+ } else {
2140
+ await arbi.workspaces.open(workspaceId);
2141
+ params.onUploading?.();
2142
+ result = await arbi.documents.upload(params.files, {
2143
+ shared: true,
2144
+ workspaceExtId: workspaceId
2145
+ });
2146
+ }
2147
+ const docExtIds = result.doc_ext_ids ?? [];
2148
+ const skipped = result.skipped ?? [];
2149
+ if (!docExtIds.length) {
2150
+ throw new Error(`The files were not uploaded${skipped[0] ? `: ${skipped[0].reason}` : ""}`);
2138
2151
  }
2139
2152
  return postRecordingDocsToThread(arbi, {
2140
2153
  conversationExtId: params.conversationExtId,
2141
2154
  title: params.title,
2142
- docExtIds: result.doc_ext_ids
2155
+ docExtIds
2143
2156
  });
2144
2157
  }
2145
2158
  function useSaveToThread() {
@@ -2163,13 +2176,13 @@ function callLink(callExtId, key, linkVersion) {
2163
2176
  function alreadyInCall(callExtId) {
2164
2177
  const active = callSession.getState().active;
2165
2178
  if (!active || active.callExtId === callExtId) return false;
2166
- chunkVAMPYLQ4_cjs.notify.warning("You are already in a call. Leave it first.");
2179
+ chunkDZUBZ45Y_cjs.notify.warning("You are already in a call. Leave it first.");
2167
2180
  return true;
2168
2181
  }
2169
2182
  function fail(err, what = "start the call") {
2170
2183
  console.error(`[calls] failed to ${what}`, err);
2171
2184
  const message = err instanceof Error ? err.message : "Unknown error";
2172
- chunkVAMPYLQ4_cjs.notify.error(`Could not ${what}: ${message}`);
2185
+ chunkDZUBZ45Y_cjs.notify.error(`Could not ${what}: ${message}`);
2173
2186
  }
2174
2187
  function callContext(call) {
2175
2188
  return {
@@ -2192,7 +2205,7 @@ async function sendInviteLinks(arbi, callExtId, key, linkVersion, invites) {
2192
2205
  fail(err, `invite ${invite.name || "a contact"}`);
2193
2206
  }
2194
2207
  }
2195
- if (sent) chunkVAMPYLQ4_cjs.notify.success(`Sent ${sent} ${sent === 1 ? "invitation" : "invitations"}`);
2208
+ if (sent) chunkDZUBZ45Y_cjs.notify.success(`Sent ${sent} ${sent === 1 ? "invitation" : "invitations"}`);
2196
2209
  return sent;
2197
2210
  }
2198
2211
  async function startCall(arbi, opts) {
@@ -2432,7 +2445,7 @@ function isWorkspaceGuestOf(workspaces, workspaceExtId, me) {
2432
2445
  function useMeetingReadOnly(lockedWorkspaceExtId) {
2433
2446
  const arbi = chunkY7S2SQH3_cjs.useArbi();
2434
2447
  const me = arbi.isLoggedIn ? arbi.user.identity()?.externalId ?? null : null;
2435
- const { data: workspaces } = chunkX7JXQT6F_cjs.useWorkspaces({
2448
+ const { data: workspaces } = chunkDVL7EFZZ_cjs.useWorkspaces({
2436
2449
  enabled: !!lockedWorkspaceExtId && arbi.isLoggedIn
2437
2450
  });
2438
2451
  return isWorkspaceGuestOf(
@@ -2465,7 +2478,7 @@ function useOpenCallMeetingChat() {
2465
2478
  open?.(ref);
2466
2479
  } catch (err) {
2467
2480
  console.warn("[calls] could not open the meeting chat", err);
2468
- chunkVAMPYLQ4_cjs.notify.error(
2481
+ chunkDZUBZ45Y_cjs.notify.error(
2469
2482
  `Could not open the meeting chat: ${err instanceof Error ? err.message : "unknown error"}`
2470
2483
  );
2471
2484
  }
@@ -2667,5 +2680,5 @@ exports.useUpdateUserSettings = useUpdateUserSettings;
2667
2680
  exports.useUserSettings = useUserSettings;
2668
2681
  exports.wrapTrackKey = wrapTrackKey;
2669
2682
  exports.writeSamples = writeSamples;
2670
- //# sourceMappingURL=chunk-4E737GNX.cjs.map
2671
- //# sourceMappingURL=chunk-4E737GNX.cjs.map
2683
+ //# sourceMappingURL=chunk-BLBXADTN.cjs.map
2684
+ //# sourceMappingURL=chunk-BLBXADTN.cjs.map