@arbidocs/react 0.5.152 → 0.5.153

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 (65) hide show
  1. package/dist/artifacts/index.cjs +46 -46
  2. package/dist/calls/livekit/index.cjs +51 -51
  3. package/dist/{chunk-VXFTVWEI.cjs → chunk-4VHECR5O.cjs} +44 -44
  4. package/dist/{chunk-VXFTVWEI.cjs.map → chunk-4VHECR5O.cjs.map} +1 -1
  5. package/dist/{chunk-P2DPOZBS.cjs → chunk-5ZNO77YB.cjs} +11 -2
  6. package/dist/chunk-5ZNO77YB.cjs.map +1 -0
  7. package/dist/{chunk-MK5L56Z3.cjs → chunk-BUMLF3MS.cjs} +60 -60
  8. package/dist/{chunk-MK5L56Z3.cjs.map → chunk-BUMLF3MS.cjs.map} +1 -1
  9. package/dist/{chunk-6RRKO4ZK.cjs → chunk-DBWW6DXJ.cjs} +5 -5
  10. package/dist/{chunk-6RRKO4ZK.cjs.map → chunk-DBWW6DXJ.cjs.map} +1 -1
  11. package/dist/{chunk-KULS4YWP.cjs → chunk-DQODLWFX.cjs} +3 -3
  12. package/dist/{chunk-KULS4YWP.cjs.map → chunk-DQODLWFX.cjs.map} +1 -1
  13. package/dist/{chunk-GFX7LQGR.cjs → chunk-HISGJISX.cjs} +67 -67
  14. package/dist/{chunk-GFX7LQGR.cjs.map → chunk-HISGJISX.cjs.map} +1 -1
  15. package/dist/{chunk-BI7HFGXF.cjs → chunk-NJWQPNGD.cjs} +14 -14
  16. package/dist/{chunk-BI7HFGXF.cjs.map → chunk-NJWQPNGD.cjs.map} +1 -1
  17. package/dist/{chunk-SKJWJ3OY.cjs → chunk-WWGUGZZN.cjs} +39 -39
  18. package/dist/{chunk-SKJWJ3OY.cjs.map → chunk-WWGUGZZN.cjs.map} +1 -1
  19. package/dist/{chunk-WJIRX5MS.cjs → chunk-XQLJSNAL.cjs} +3 -3
  20. package/dist/{chunk-WJIRX5MS.cjs.map → chunk-XQLJSNAL.cjs.map} +1 -1
  21. package/dist/datasets/aggregate-source.js +133 -0
  22. package/dist/datasets/aggregate-source.js.map +7 -0
  23. package/dist/datasets/aggregate.js +72 -22
  24. package/dist/datasets/aggregate.js.map +2 -2
  25. package/dist/datasets/index.js +27 -1
  26. package/dist/datasets/index.js.map +2 -2
  27. package/dist/datasets/sources/activity.js +44 -9
  28. package/dist/datasets/sources/activity.js.map +2 -2
  29. package/dist/datasets/sources/conversations.js +37 -7
  30. package/dist/datasets/sources/conversations.js.map +2 -2
  31. package/dist/datasets/sources/documents.js +44 -6
  32. package/dist/datasets/sources/documents.js.map +2 -2
  33. package/dist/datasets/sources/facts.js +31 -5
  34. package/dist/datasets/sources/facts.js.map +3 -3
  35. package/dist/datasets/sources/tags.js +37 -5
  36. package/dist/datasets/sources/tags.js.map +3 -3
  37. package/dist/datasets/sources/usage.js +29 -32
  38. package/dist/datasets/sources/usage.js.map +2 -2
  39. package/dist/datasets/sources/workflows.js +56 -22
  40. package/dist/datasets/sources/workflows.js.map +2 -2
  41. package/dist/datasets/workspace-aggregate.js +64 -0
  42. package/dist/datasets/workspace-aggregate.js.map +7 -0
  43. package/dist/document-tools/core.cjs +102 -102
  44. package/dist/document-tools/core.d.ts +2 -2
  45. package/dist/document-tools/index.cjs +104 -104
  46. package/dist/document-tools/index.d.ts +2 -2
  47. package/dist/{file-shares.d-CamKxNLC.d.ts → file-shares.d-CyTnJ2Re.d.ts} +11 -0
  48. package/dist/index.cjs +2935 -2476
  49. package/dist/index.cjs.map +1 -1
  50. package/dist/index.d.ts +138 -5
  51. package/dist/index.js +11 -2
  52. package/dist/index.js.map +2 -2
  53. package/dist/projects.js +9 -0
  54. package/dist/projects.js.map +2 -2
  55. package/dist/query-keys.js +9 -0
  56. package/dist/query-keys.js.map +2 -2
  57. package/dist/shell/index.cjs +40 -40
  58. package/dist/storage.js +24 -1
  59. package/dist/storage.js.map +2 -2
  60. package/dist/table-views.js +19 -1
  61. package/dist/table-views.js.map +2 -2
  62. package/dist/ui/index.cjs +181 -181
  63. package/dist/viewers/index.cjs +9 -9
  64. package/package.json +3 -3
  65. package/dist/chunk-P2DPOZBS.cjs.map +0 -1
@@ -1,15 +1,15 @@
1
1
  'use strict';
2
2
 
3
- var chunkVXFTVWEI_cjs = require('../chunk-VXFTVWEI.cjs');
4
- var chunkMK5L56Z3_cjs = require('../chunk-MK5L56Z3.cjs');
3
+ var chunk4VHECR5O_cjs = require('../chunk-4VHECR5O.cjs');
4
+ var chunkEM6DP62E_cjs = require('../chunk-EM6DP62E.cjs');
5
+ var chunkBUMLF3MS_cjs = require('../chunk-BUMLF3MS.cjs');
5
6
  var chunk3AADNIOK_cjs = require('../chunk-3AADNIOK.cjs');
6
- var chunkP2DPOZBS_cjs = require('../chunk-P2DPOZBS.cjs');
7
7
  require('../chunk-N73IMVFF.cjs');
8
- var chunkKULS4YWP_cjs = require('../chunk-KULS4YWP.cjs');
9
- var chunkVOFNX4P6_cjs = require('../chunk-VOFNX4P6.cjs');
10
- var chunkEM6DP62E_cjs = require('../chunk-EM6DP62E.cjs');
8
+ var chunk5ZNO77YB_cjs = require('../chunk-5ZNO77YB.cjs');
9
+ var chunkDQODLWFX_cjs = require('../chunk-DQODLWFX.cjs');
11
10
  require('../chunk-5NOZDH3F.cjs');
12
11
  require('../chunk-S6A6FSG7.cjs');
12
+ var chunkVOFNX4P6_cjs = require('../chunk-VOFNX4P6.cjs');
13
13
  var react = require('react');
14
14
  var reactQuery = require('@tanstack/react-query');
15
15
  var jsxRuntime = require('react/jsx-runtime');
@@ -270,24 +270,24 @@ var isRefusal = (error) => {
270
270
  return code === 401 || code === 403;
271
271
  };
272
272
  function useArtifactText(docId, options) {
273
- const arbi = chunkP2DPOZBS_cjs.useArbi();
273
+ const arbi = chunk5ZNO77YB_cjs.useArbi();
274
274
  const { attempts, baseDelayMs, maxDelayMs } = {
275
275
  ...DEFAULT_ARTIFACT_TEXT_RETRY,
276
276
  ...options?.retry
277
277
  };
278
- const enabled = (options?.enabled ?? true) && chunkKULS4YWP_cjs.isDocumentId(docId) && arbi.hasWorkspace;
278
+ const enabled = (options?.enabled ?? true) && chunkDQODLWFX_cjs.isDocumentId(docId) && arbi.hasWorkspace;
279
279
  const query = reactQuery.useQuery({
280
280
  // Under the shared `parsedDoc` key, so a document's invalidation reaches it too.
281
- queryKey: [...chunkP2DPOZBS_cjs.arbiQueryKeys.parsedDoc(docId ?? "", "marker"), "artifact-text"],
281
+ queryKey: [...chunk5ZNO77YB_cjs.arbiQueryKeys.parsedDoc(docId ?? "", "marker"), "artifact-text"],
282
282
  queryFn: async () => {
283
- const { docId: plainId, version } = chunkKULS4YWP_cjs.parseVersionRef(docId);
283
+ const { docId: plainId, version } = chunkDQODLWFX_cjs.parseVersionRef(docId);
284
284
  const parsed = await arbi.documents.getParsedContent(
285
285
  plainId,
286
286
  "marker",
287
287
  version ?? void 0
288
288
  );
289
289
  if (!parsed.chunks?.some((c) => c.content?.trim())) throw new NotParsedYetError();
290
- return chunkKULS4YWP_cjs.flattenChunks(parsed.chunks, { unescape: true });
290
+ return chunkDQODLWFX_cjs.flattenChunks(parsed.chunks, { unescape: true });
291
291
  },
292
292
  enabled,
293
293
  retry: (failureCount, error) => !isRefusal(error) && failureCount < attempts,
@@ -325,22 +325,22 @@ function useArtifactText(docId, options) {
325
325
 
326
326
  // src/artifacts/useArtifactSession.ts
327
327
  function useArtifactVersions(workspaceId, docId) {
328
- const plainId = docId ? chunkKULS4YWP_cjs.parseVersionRef(docId).docId : null;
329
- const { data: documents } = chunkVXFTVWEI_cjs.useDocuments(workspaceId);
328
+ const plainId = docId ? chunkDQODLWFX_cjs.parseVersionRef(docId).docId : null;
329
+ const { data: documents } = chunk4VHECR5O_cjs.useDocuments(workspaceId);
330
330
  const listed = react.useMemo(
331
331
  () => (documents ?? []).find((d) => d.external_id === plainId),
332
332
  [documents, plainId]
333
333
  );
334
- const { data: history } = chunkMK5L56Z3_cjs.useDocumentVersionList(plainId, {
334
+ const { data: history } = chunkBUMLF3MS_cjs.useDocumentVersionList(plainId, {
335
335
  enabled: !!plainId && documents !== void 0 && !listed
336
336
  });
337
337
  return react.useMemo(
338
- () => listed ? chunkKULS4YWP_cjs.documentVersions(listed) : chunkKULS4YWP_cjs.toArtifactVersions(plainId, history),
338
+ () => listed ? chunkDQODLWFX_cjs.documentVersions(listed) : chunkDQODLWFX_cjs.toArtifactVersions(plainId, history),
339
339
  [listed, history, plainId]
340
340
  );
341
341
  }
342
342
  function useSaveArtifactVersion() {
343
- const arbi = chunkP2DPOZBS_cjs.useArbi();
343
+ const arbi = chunk5ZNO77YB_cjs.useArbi();
344
344
  const queryClient = reactQuery.useQueryClient();
345
345
  return reactQuery.useMutation({
346
346
  mutationFn: async ({ title, content, versionOf, configId, wpType, autosave }) => {
@@ -351,15 +351,15 @@ function useSaveArtifactVersion() {
351
351
  {
352
352
  wpType: wpType ?? "artifact",
353
353
  autosave,
354
- versionOf: versionOf ? chunkKULS4YWP_cjs.parseVersionRef(versionOf).docId : void 0,
354
+ versionOf: versionOf ? chunkDQODLWFX_cjs.parseVersionRef(versionOf).docId : void 0,
355
355
  configExtId: configId ?? void 0
356
356
  }
357
357
  );
358
358
  const docId = result.doc_ext_ids?.[0];
359
- if (docId) await chunkVXFTVWEI_cjs.refreshDocuments(queryClient, arbi, [docId]);
360
- await queryClient.invalidateQueries({ queryKey: chunkP2DPOZBS_cjs.arbiQueryKeys.allDocumentVersions() });
359
+ if (docId) await chunk4VHECR5O_cjs.refreshDocuments(queryClient, arbi, [docId]);
360
+ await queryClient.invalidateQueries({ queryKey: chunk5ZNO77YB_cjs.arbiQueryKeys.allDocumentVersions() });
361
361
  if (docId)
362
- await queryClient.invalidateQueries({ queryKey: chunkP2DPOZBS_cjs.arbiQueryKeys.parsedDocument(docId) });
362
+ await queryClient.invalidateQueries({ queryKey: chunk5ZNO77YB_cjs.arbiQueryKeys.parsedDocument(docId) });
363
363
  return { docId, version: result.version ?? void 0 };
364
364
  }
365
365
  });
@@ -379,7 +379,7 @@ function useArtifactSession(options) {
379
379
  const [saved, setSaved] = react.useState(null);
380
380
  const adopted = saved && saved.forId === hostDocId ? saved : null;
381
381
  const docId = adopted?.id ?? hostDocId;
382
- const isLocal = !chunkKULS4YWP_cjs.isDocumentId(docId);
382
+ const isLocal = !chunkDQODLWFX_cjs.isDocumentId(docId);
383
383
  const [ownCompareId, setOwnCompareId] = react.useState(null);
384
384
  const activeCompareId = compareId === void 0 ? ownCompareId : compareId;
385
385
  const changeCompare = react.useCallback(
@@ -396,7 +396,7 @@ function useArtifactSession(options) {
396
396
  });
397
397
  const saveVersion = useSaveArtifactVersion();
398
398
  const autosaveVersion = saveVersion.mutateAsync;
399
- const current = chunkKULS4YWP_cjs.findVersion(versions, docId);
399
+ const current = chunkDQODLWFX_cjs.findVersion(versions, docId);
400
400
  const save = react.useCallback(
401
401
  async (content) => {
402
402
  const result = await saveVersion.mutateAsync({
@@ -412,7 +412,7 @@ function useArtifactSession(options) {
412
412
  );
413
413
  const handleSaved = react.useCallback(
414
414
  (result, content) => {
415
- if (!chunkKULS4YWP_cjs.isDocumentId(hostDocId) && result.docId)
415
+ if (!chunkDQODLWFX_cjs.isDocumentId(hostDocId) && result.docId)
416
416
  setSaved({ forId: hostDocId, id: result.docId, text: content });
417
417
  onSaved?.(result, content);
418
418
  },
@@ -457,7 +457,7 @@ function useArtifactSession(options) {
457
457
  ]);
458
458
  react.useEffect(() => {
459
459
  if (!docId) return;
460
- return chunkVXFTVWEI_cjs.registerDocumentTurnFlush(docId, async () => {
460
+ return chunk4VHECR5O_cjs.registerDocumentTurnFlush(docId, async () => {
461
461
  if (session.hasChanges && !await session.save())
462
462
  throw new Error("Save the document before sending your message.");
463
463
  });
@@ -471,7 +471,7 @@ function useArtifactSession(options) {
471
471
  isLoading,
472
472
  status,
473
473
  versions,
474
- labelOf: (id) => chunkKULS4YWP_cjs.versionLabel(versions, id),
474
+ labelOf: (id) => chunkDQODLWFX_cjs.versionLabel(versions, id),
475
475
  view: {
476
476
  content: session.baseline,
477
477
  isEditing: session.isEditing,
@@ -518,9 +518,9 @@ function useArtifactSession(options) {
518
518
  );
519
519
  }
520
520
  function useArtifactSource(documentId, enabled = true) {
521
- const arbi = chunkP2DPOZBS_cjs.useArbi();
521
+ const arbi = chunk5ZNO77YB_cjs.useArbi();
522
522
  return reactQuery.useQuery({
523
- queryKey: chunkP2DPOZBS_cjs.arbiQueryKeys.artifactSource(documentId ?? ""),
523
+ queryKey: chunk5ZNO77YB_cjs.arbiQueryKeys.artifactSource(documentId ?? ""),
524
524
  queryFn: async () => (await arbi.documents.download(documentId)).text(),
525
525
  enabled: enabled && !!documentId && arbi.isLoggedIn,
526
526
  staleTime: 5 * 60 * 1e3
@@ -547,7 +547,7 @@ function useStreamedArtifact({
547
547
  const started = react.useRef(null);
548
548
  const content = artifact?.content ?? "";
549
549
  const title = artifact?.title ?? "Draft";
550
- const passThrough = !!artifact && chunkKULS4YWP_cjs.isDocumentId(artifact.doc_ext_id);
550
+ const passThrough = !!artifact && chunkDQODLWFX_cjs.isDocumentId(artifact.doc_ext_id);
551
551
  const needsSave = settled && !!artifact && !passThrough && !!content.trim() && !!workspaceId;
552
552
  react.useEffect(() => {
553
553
  const key = `${attempt}:${content}`;
@@ -557,7 +557,7 @@ function useStreamedArtifact({
557
557
  let stored;
558
558
  if (clean) stored = clean(content);
559
559
  else {
560
- const report = chunkKULS4YWP_cjs.cleanDraftWithReport(content);
560
+ const report = chunkDQODLWFX_cjs.cleanDraftWithReport(content);
561
561
  stored = report.text;
562
562
  setCleaned(report);
563
563
  onCleaned?.(report);
@@ -625,71 +625,71 @@ Object.defineProperty(exports, "revertRedlineRegion", {
625
625
  });
626
626
  Object.defineProperty(exports, "cleanDraftMarkdown", {
627
627
  enumerable: true,
628
- get: function () { return chunkKULS4YWP_cjs.cleanDraftMarkdown; }
628
+ get: function () { return chunkDQODLWFX_cjs.cleanDraftMarkdown; }
629
629
  });
630
630
  Object.defineProperty(exports, "cleanDraftWithReport", {
631
631
  enumerable: true,
632
- get: function () { return chunkKULS4YWP_cjs.cleanDraftWithReport; }
632
+ get: function () { return chunkDQODLWFX_cjs.cleanDraftWithReport; }
633
633
  });
634
634
  Object.defineProperty(exports, "documentVersions", {
635
635
  enumerable: true,
636
- get: function () { return chunkKULS4YWP_cjs.documentVersions; }
636
+ get: function () { return chunkDQODLWFX_cjs.documentVersions; }
637
637
  });
638
638
  Object.defineProperty(exports, "findVersion", {
639
639
  enumerable: true,
640
- get: function () { return chunkKULS4YWP_cjs.findVersion; }
640
+ get: function () { return chunkDQODLWFX_cjs.findVersion; }
641
641
  });
642
642
  Object.defineProperty(exports, "flattenChunks", {
643
643
  enumerable: true,
644
- get: function () { return chunkKULS4YWP_cjs.flattenChunks; }
644
+ get: function () { return chunkDQODLWFX_cjs.flattenChunks; }
645
645
  });
646
646
  Object.defineProperty(exports, "isDocumentId", {
647
647
  enumerable: true,
648
- get: function () { return chunkKULS4YWP_cjs.isDocumentId; }
648
+ get: function () { return chunkDQODLWFX_cjs.isDocumentId; }
649
649
  });
650
650
  Object.defineProperty(exports, "parseVersionRef", {
651
651
  enumerable: true,
652
- get: function () { return chunkKULS4YWP_cjs.parseVersionRef; }
652
+ get: function () { return chunkDQODLWFX_cjs.parseVersionRef; }
653
653
  });
654
654
  Object.defineProperty(exports, "promoteBoldTitle", {
655
655
  enumerable: true,
656
- get: function () { return chunkKULS4YWP_cjs.promoteBoldTitle; }
656
+ get: function () { return chunkDQODLWFX_cjs.promoteBoldTitle; }
657
657
  });
658
658
  Object.defineProperty(exports, "repairParsedStructure", {
659
659
  enumerable: true,
660
- get: function () { return chunkKULS4YWP_cjs.repairParsedStructure; }
660
+ get: function () { return chunkDQODLWFX_cjs.repairParsedStructure; }
661
661
  });
662
662
  Object.defineProperty(exports, "repairParsedTitle", {
663
663
  enumerable: true,
664
- get: function () { return chunkKULS4YWP_cjs.repairParsedTitle; }
664
+ get: function () { return chunkDQODLWFX_cjs.repairParsedTitle; }
665
665
  });
666
666
  Object.defineProperty(exports, "savedFromId", {
667
667
  enumerable: true,
668
- get: function () { return chunkKULS4YWP_cjs.savedFromId; }
668
+ get: function () { return chunkDQODLWFX_cjs.savedFromId; }
669
669
  });
670
670
  Object.defineProperty(exports, "stripAgentPreamble", {
671
671
  enumerable: true,
672
- get: function () { return chunkKULS4YWP_cjs.stripAgentPreamble; }
672
+ get: function () { return chunkDQODLWFX_cjs.stripAgentPreamble; }
673
673
  });
674
674
  Object.defineProperty(exports, "toArtifactVersions", {
675
675
  enumerable: true,
676
- get: function () { return chunkKULS4YWP_cjs.toArtifactVersions; }
676
+ get: function () { return chunkDQODLWFX_cjs.toArtifactVersions; }
677
677
  });
678
678
  Object.defineProperty(exports, "unescapeMarkdown", {
679
679
  enumerable: true,
680
- get: function () { return chunkKULS4YWP_cjs.unescapeMarkdown; }
680
+ get: function () { return chunkDQODLWFX_cjs.unescapeMarkdown; }
681
681
  });
682
682
  Object.defineProperty(exports, "unwrapCitationLinks", {
683
683
  enumerable: true,
684
- get: function () { return chunkKULS4YWP_cjs.unwrapCitationLinks; }
684
+ get: function () { return chunkDQODLWFX_cjs.unwrapCitationLinks; }
685
685
  });
686
686
  Object.defineProperty(exports, "versionLabel", {
687
687
  enumerable: true,
688
- get: function () { return chunkKULS4YWP_cjs.versionLabel; }
688
+ get: function () { return chunkDQODLWFX_cjs.versionLabel; }
689
689
  });
690
690
  Object.defineProperty(exports, "versionRef", {
691
691
  enumerable: true,
692
- get: function () { return chunkKULS4YWP_cjs.versionRef; }
692
+ get: function () { return chunkDQODLWFX_cjs.versionRef; }
693
693
  });
694
694
  Object.defineProperty(exports, "normalizeMarkdown", {
695
695
  enumerable: true,
@@ -1,15 +1,15 @@
1
1
  'use strict';
2
2
 
3
- var chunkGFX7LQGR_cjs = require('../../chunk-GFX7LQGR.cjs');
4
- require('../../chunk-MK5L56Z3.cjs');
5
- var chunkP2DPOZBS_cjs = require('../../chunk-P2DPOZBS.cjs');
3
+ var chunkHISGJISX_cjs = require('../../chunk-HISGJISX.cjs');
4
+ require('../../chunk-EEIYXVM4.cjs');
5
+ require('../../chunk-BUMLF3MS.cjs');
6
6
  var chunkIX4HOS5Z_cjs = require('../../chunk-IX4HOS5Z.cjs');
7
7
  require('../../chunk-N73IMVFF.cjs');
8
- require('../../chunk-KULS4YWP.cjs');
9
- require('../../chunk-VOFNX4P6.cjs');
10
- require('../../chunk-EEIYXVM4.cjs');
8
+ var chunk5ZNO77YB_cjs = require('../../chunk-5ZNO77YB.cjs');
9
+ require('../../chunk-DQODLWFX.cjs');
11
10
  require('../../chunk-5NOZDH3F.cjs');
12
11
  require('../../chunk-S6A6FSG7.cjs');
12
+ require('../../chunk-VOFNX4P6.cjs');
13
13
  var react = require('react');
14
14
  var livekitClient = require('livekit-client');
15
15
  var componentsReact = require('@livekit/components-react');
@@ -120,11 +120,11 @@ function useCallTranscriber({
120
120
  const room = componentsReact.useRoomContext();
121
121
  const { localParticipant } = componentsReact.useLocalParticipant();
122
122
  const myIdentity = localParticipant.identity;
123
- const arbi = chunkP2DPOZBS_cjs.useArbi();
123
+ const arbi = chunk5ZNO77YB_cjs.useArbi();
124
124
  const queryClient = reactQuery.useQueryClient();
125
125
  const profile = arbi.isLoggedIn ? arbi.user.profile() : null;
126
- const myProfileName = profile && chunkGFX7LQGR_cjs.toProfileView(profile).fullName || null;
127
- const deploymentAvailable = chunkGFX7LQGR_cjs.useCallTranscriptionAvailable();
126
+ const myProfileName = profile && chunkHISGJISX_cjs.toProfileView(profile).fullName || null;
127
+ const deploymentAvailable = chunkHISGJISX_cjs.useCallTranscriptionAvailable();
128
128
  const available = deploymentAvailable && !!callKey;
129
129
  const [state, setState] = react.useState(null);
130
130
  const [creatorExtId, setCreatorExtId] = react.useState(null);
@@ -167,7 +167,7 @@ function useCallTranscriber({
167
167
  };
168
168
  }, [available, callExtId]);
169
169
  react.useEffect(
170
- () => chunkGFX7LQGR_cjs.onCallEvent("call.transcription", (message) => {
170
+ () => chunkHISGJISX_cjs.onCallEvent("call.transcription", (message) => {
171
171
  if (message.call_ext_id === callExtId) applyState(message);
172
172
  }),
173
173
  [callExtId, applyState]
@@ -183,7 +183,7 @@ function useCallTranscriber({
183
183
  const persist = react.useCallback(
184
184
  (segment, speakerNeedsProxy) => {
185
185
  if (!callKey || persisted.current.has(segment.segmentId)) return;
186
- const role = chunkGFX7LQGR_cjs.transcriptPersistRole({
186
+ const role = chunkHISGJISX_cjs.transcriptPersistRole({
187
187
  myIdentity,
188
188
  canPost: canPost && (segment.speakerIdentity !== myIdentity || selfPosts.current),
189
189
  hasCallKey: true,
@@ -192,7 +192,7 @@ function useCallTranscriber({
192
192
  });
193
193
  if (!role) return;
194
194
  persisted.current.add(segment.segmentId);
195
- chunkGFX7LQGR_cjs.persistTranscriptSegment(arbi, queryClient, callExtId, callKey, segment).catch(
195
+ chunkHISGJISX_cjs.persistTranscriptSegment(arbi, queryClient, callExtId, callKey, segment).catch(
196
196
  (err) => {
197
197
  persisted.current.delete(segment.segmentId);
198
198
  if (role === "own" && err?.status === 403) {
@@ -212,7 +212,7 @@ function useCallTranscriber({
212
212
  );
213
213
  react.useEffect(() => {
214
214
  const onData = (payload, participant, _kind, topic, _encryption, participantIdentity) => {
215
- if (topic === chunkGFX7LQGR_cjs.CALL_TRANSCRIPTION_TOPIC) {
215
+ if (topic === chunkHISGJISX_cjs.CALL_TRANSCRIPTION_TOPIC) {
216
216
  if (participant || participantIdentity) return;
217
217
  try {
218
218
  const next = browser.calls.transcriptionStateFrom(JSON.parse(new TextDecoder().decode(payload)));
@@ -221,10 +221,10 @@ function useCallTranscriber({
221
221
  }
222
222
  return;
223
223
  }
224
- if (topic !== chunkGFX7LQGR_cjs.CALL_CAPTION_TOPIC || !callKey) return;
224
+ if (topic !== chunkHISGJISX_cjs.CALL_CAPTION_TOPIC || !callKey) return;
225
225
  const identity = participant?.identity ?? participantIdentity;
226
226
  if (!identity || identity === myIdentity) return;
227
- void chunkGFX7LQGR_cjs.decodeCaptionPacket(payload, callKey).then((packet) => {
227
+ void chunkHISGJISX_cjs.decodeCaptionPacket(payload, callKey).then((packet) => {
228
228
  if (!packet || packet.identity !== identity) return;
229
229
  const name = participant?.name || packet.name || identity;
230
230
  const t = Math.min(packet.t, Date.now());
@@ -264,7 +264,7 @@ function useCallTranscriber({
264
264
  })) {
265
265
  return;
266
266
  }
267
- const segmentId = chunkGFX7LQGR_cjs.newSegmentId();
267
+ const segmentId = chunkHISGJISX_cjs.newSegmentId();
268
268
  const startedAt = new Date(segment.startedAt).toISOString();
269
269
  let text;
270
270
  try {
@@ -298,7 +298,7 @@ function useCallTranscriber({
298
298
  });
299
299
  try {
300
300
  await localParticipant.publishData(
301
- await chunkGFX7LQGR_cjs.encodeCaptionPacket(
301
+ await chunkHISGJISX_cjs.encodeCaptionPacket(
302
302
  {
303
303
  v: 1,
304
304
  segment_id: segmentId,
@@ -310,7 +310,7 @@ function useCallTranscriber({
310
310
  },
311
311
  callKey
312
312
  ),
313
- { reliable: true, topic: chunkGFX7LQGR_cjs.CALL_CAPTION_TOPIC }
313
+ { reliable: true, topic: chunkHISGJISX_cjs.CALL_CAPTION_TOPIC }
314
314
  );
315
315
  } catch (err) {
316
316
  console.warn("[calls] could not broadcast a caption", err);
@@ -391,7 +391,7 @@ function useCallRecorder({
391
391
  isCreator,
392
392
  linkVersion = null
393
393
  }) {
394
- const arbi = chunkP2DPOZBS_cjs.useArbi();
394
+ const arbi = chunk5ZNO77YB_cjs.useArbi();
395
395
  const queryClient = reactQuery.useQueryClient();
396
396
  const room = componentsReact.useRoomContext();
397
397
  const { localParticipant } = componentsReact.useLocalParticipant();
@@ -425,14 +425,14 @@ function useCallRecorder({
425
425
  };
426
426
  }, [callExtId]);
427
427
  react.useEffect(
428
- () => chunkGFX7LQGR_cjs.onCallEvent("call.recording", (message) => {
428
+ () => chunkHISGJISX_cjs.onCallEvent("call.recording", (message) => {
429
429
  if (message.call_ext_id === callExtId) applyState(message);
430
430
  }),
431
431
  [callExtId, applyState]
432
432
  );
433
433
  react.useEffect(() => {
434
434
  const onData = (payload, participant, _kind, topic, _encryption, participantIdentity) => {
435
- if (topic !== chunkGFX7LQGR_cjs.CALL_RECORDING_TOPIC) return;
435
+ if (topic !== chunkHISGJISX_cjs.CALL_RECORDING_TOPIC) return;
436
436
  if (participant || participantIdentity) return;
437
437
  try {
438
438
  const next = browser.calls.recordingStateFrom(JSON.parse(new TextDecoder().decode(payload)));
@@ -453,7 +453,7 @@ function useCallRecorder({
453
453
  try {
454
454
  const row = call ?? await arbi.calls.get(callExtId);
455
455
  if (!row.workspace_locked && !row.chat_ext_id && callKey) {
456
- const ref = await chunkGFX7LQGR_cjs.ensureMeetingChat(arbi, queryClient, callExtId, callKey);
456
+ const ref = await chunkHISGJISX_cjs.ensureMeetingChat(arbi, queryClient, callExtId, callKey);
457
457
  if (ref.kind === "chat") setCall({ ...row, chat_ext_id: ref.chatExtId });
458
458
  }
459
459
  const answer = await arbi.calls.recording.start(callExtId, mode);
@@ -551,11 +551,11 @@ function useCallRecorder({
551
551
  }
552
552
  function useTrackUploader(recording, callKey, kind, mimeType) {
553
553
  const { recordingExtId, call, startedAt, shouldCapture, markStopped, linkVersion } = recording;
554
- const arbi = chunkP2DPOZBS_cjs.useArbi();
554
+ const arbi = chunk5ZNO77YB_cjs.useArbi();
555
555
  const queryClient = reactQuery.useQueryClient();
556
556
  return react.useMemo(() => {
557
557
  if (!shouldCapture || !recordingExtId || !call) return null;
558
- return chunkGFX7LQGR_cjs.trackUploaderFor({
558
+ return chunkHISGJISX_cjs.trackUploaderFor({
559
559
  arbi,
560
560
  callExtId: call.external_id,
561
561
  recordingExtId,
@@ -563,7 +563,7 @@ function useTrackUploader(recording, callKey, kind, mimeType) {
563
563
  mimeType,
564
564
  recordingStartedAt: startedAt,
565
565
  linkVersion,
566
- conversationKey: () => chunkGFX7LQGR_cjs.conversationKeyForCall(arbi, queryClient, call, { callKey }),
566
+ conversationKey: () => chunkHISGJISX_cjs.conversationKeyForCall(arbi, queryClient, call, { callKey }),
567
567
  // The server stopped the recording at the quota (its state event says so too).
568
568
  onStopped: () => markStopped()
569
569
  });
@@ -591,9 +591,9 @@ function useInCallChat({
591
591
  const room = componentsReact.useRoomContext();
592
592
  const { localParticipant } = componentsReact.useLocalParticipant();
593
593
  const myIdentity = localParticipant.identity;
594
- const arbi = chunkP2DPOZBS_cjs.useArbi();
594
+ const arbi = chunk5ZNO77YB_cjs.useArbi();
595
595
  const queryClient = reactQuery.useQueryClient();
596
- const openMeetingChat = chunkP2DPOZBS_cjs.useArbiHost().calls?.openMeetingChat;
596
+ const openMeetingChat = chunk5ZNO77YB_cjs.useArbiHost().calls?.openMeetingChat;
597
597
  const signedIn = arbi.isLoggedIn;
598
598
  const persists = !!callKey && signedIn && !readOnly && persist;
599
599
  const [live, setLive] = react.useState([]);
@@ -612,10 +612,10 @@ function useInCallChat({
612
612
  react.useEffect(() => {
613
613
  if (!callKey) return;
614
614
  const onData = (payload, participant, _kind, topic, _encryption, participantIdentity) => {
615
- if (topic !== chunkGFX7LQGR_cjs.CALL_CHAT_TOPIC) return;
615
+ if (topic !== chunkHISGJISX_cjs.CALL_CHAT_TOPIC) return;
616
616
  const identity = participant?.identity ?? participantIdentity;
617
617
  if (!identity || identity === myIdentity) return;
618
- void chunkGFX7LQGR_cjs.decodeCallChatPacket(payload, callKey).then((packet) => {
618
+ void chunkHISGJISX_cjs.decodeCallChatPacket(payload, callKey).then((packet) => {
619
619
  if (!packet) return;
620
620
  const key = `${identity}:${packet.id}`;
621
621
  if (seen.current.has(key)) return;
@@ -645,7 +645,7 @@ function useInCallChat({
645
645
  if (!open || !canRead || historyRequested.current) return;
646
646
  historyRequested.current = true;
647
647
  setHistoryLoading(true);
648
- chunkGFX7LQGR_cjs.loadMeetingHistory(arbi, queryClient, callExtId).then((result) => {
648
+ chunkHISGJISX_cjs.loadMeetingHistory(arbi, queryClient, callExtId).then((result) => {
649
649
  if (!result) return;
650
650
  setMeetingChat(result.ref);
651
651
  setHistory(result.messages);
@@ -656,13 +656,13 @@ function useInCallChat({
656
656
  }, [open, canRead, callExtId]);
657
657
  const send = react.useCallback(
658
658
  async (raw) => {
659
- const text = raw.trim().slice(0, chunkGFX7LQGR_cjs.CALL_CHAT_MAX_CHARS);
659
+ const text = raw.trim().slice(0, chunkHISGJISX_cjs.CALL_CHAT_MAX_CHARS);
660
660
  if (!text || !callKey || readOnly) return;
661
- const id = chunkGFX7LQGR_cjs.newPacketId();
661
+ const id = chunkHISGJISX_cjs.newPacketId();
662
662
  const at = Date.now();
663
663
  await localParticipant.publishData(
664
- await chunkGFX7LQGR_cjs.encodeCallChatPacket({ v: 1, id, text, at }, callKey),
665
- { reliable: true, topic: chunkGFX7LQGR_cjs.CALL_CHAT_TOPIC }
664
+ await chunkHISGJISX_cjs.encodeCallChatPacket({ v: 1, id, text, at }, callKey),
665
+ { reliable: true, topic: chunkHISGJISX_cjs.CALL_CHAT_TOPIC }
666
666
  );
667
667
  setLive((prev) => [
668
668
  ...prev,
@@ -681,7 +681,7 @@ function useInCallChat({
681
681
  (prev) => prev.map((l) => l.id === id && l.senderIdentity === myIdentity ? { ...l, status } : l)
682
682
  );
683
683
  try {
684
- setMeetingChat(await chunkGFX7LQGR_cjs.persistMeetingMessage(arbi, queryClient, callExtId, callKey, text));
684
+ setMeetingChat(await chunkHISGJISX_cjs.persistMeetingMessage(arbi, queryClient, callExtId, callKey, text));
685
685
  mark("saved");
686
686
  } catch (err) {
687
687
  console.warn("[calls] could not keep the message in the meeting chat", err);
@@ -693,7 +693,7 @@ function useInCallChat({
693
693
  const openMeeting = react.useCallback(async () => {
694
694
  if (!callKey) return;
695
695
  try {
696
- const ref = meetingChat ?? await chunkGFX7LQGR_cjs.ensureMeetingChat(arbi, queryClient, callExtId, callKey);
696
+ const ref = meetingChat ?? await chunkHISGJISX_cjs.ensureMeetingChat(arbi, queryClient, callExtId, callKey);
697
697
  setMeetingChat(ref);
698
698
  openMeetingChat?.(ref);
699
699
  } catch (err) {
@@ -701,7 +701,7 @@ function useInCallChat({
701
701
  }
702
702
  }, [callExtId, callKey, meetingChat]);
703
703
  const lines = react.useMemo(
704
- () => chunkGFX7LQGR_cjs.mergeChatLines(history, live, {
704
+ () => chunkHISGJISX_cjs.mergeChatLines(history, live, {
705
705
  myIdentity,
706
706
  nameOf: (identity) => identity === myIdentity ? localParticipant.name || "You" : room.remoteParticipants.get(identity)?.name || null
707
707
  }),
@@ -733,7 +733,7 @@ function useWebinar({
733
733
  linkVersion = null,
734
734
  callKey
735
735
  }) {
736
- const arbi = chunkP2DPOZBS_cjs.useArbi();
736
+ const arbi = chunk5ZNO77YB_cjs.useArbi();
737
737
  const webinarApi = react.useCallback(() => arbi.calls.webinar, [arbi]);
738
738
  const enabled = !!roleHint;
739
739
  const room = componentsReact.useRoomContext();
@@ -760,7 +760,7 @@ function useWebinar({
760
760
  const n = ++questionsRead.current;
761
761
  try {
762
762
  const rows = await webinarApi().questions.list(callExtId, linkVersion);
763
- const opened = await Promise.all(rows.map((q) => chunkGFX7LQGR_cjs.openQuestion(q, callKey)));
763
+ const opened = await Promise.all(rows.map((q) => chunkHISGJISX_cjs.openQuestion(q, callKey)));
764
764
  if (n === questionsRead.current) setQuestions(opened);
765
765
  } catch (err) {
766
766
  console.warn("[calls] could not load the questions", err);
@@ -772,7 +772,7 @@ function useWebinar({
772
772
  }, [refresh, refreshQuestions]);
773
773
  react.useEffect(() => {
774
774
  if (!enabled) return;
775
- return chunkGFX7LQGR_cjs.onCallEvent("call.webinar", (m) => {
775
+ return chunkHISGJISX_cjs.onCallEvent("call.webinar", (m) => {
776
776
  if (m.call_ext_id !== callExtId) return;
777
777
  setState((s) => s ? { ...s, live: m.live, chat: m.chat } : s);
778
778
  });
@@ -781,8 +781,8 @@ function useWebinar({
781
781
  react.useEffect(() => {
782
782
  if (!enabled) return;
783
783
  const onData = (payload, participant, _kind, topic, _encryption, participantIdentity) => {
784
- if (topic !== chunkGFX7LQGR_cjs.CALL_WEBINAR_TOPIC) return;
785
- const packet = chunkGFX7LQGR_cjs.parseWebinarPacket(payload, !!(participant || participantIdentity));
784
+ if (topic !== chunkHISGJISX_cjs.CALL_WEBINAR_TOPIC) return;
785
+ const packet = chunkHISGJISX_cjs.parseWebinarPacket(payload, !!(participant || participantIdentity));
786
786
  if (!packet) return;
787
787
  switch (packet.type) {
788
788
  case "state":
@@ -803,7 +803,7 @@ function useWebinar({
803
803
  return;
804
804
  case "demoted":
805
805
  setStageCheck(false);
806
- chunkGFX7LQGR_cjs.markRejoining(callExtId);
806
+ chunkHISGJISX_cjs.markRejoining(callExtId);
807
807
  if (fallback.current) clearTimeout(fallback.current);
808
808
  fallback.current = setTimeout(() => void room.disconnect(), DEMOTE_REJOIN_FALLBACK_MS);
809
809
  return;
@@ -830,12 +830,12 @@ function useWebinar({
830
830
  [callExtId, linkVersion]
831
831
  );
832
832
  const stepDown = react.useCallback(async () => {
833
- chunkGFX7LQGR_cjs.markRejoining(callExtId);
833
+ chunkHISGJISX_cjs.markRejoining(callExtId);
834
834
  setStageCheck(false);
835
835
  try {
836
836
  await webinarApi().demote(callExtId, myIdentity, linkVersion);
837
837
  } catch (err) {
838
- chunkGFX7LQGR_cjs.markRejoining(callExtId, false);
838
+ chunkHISGJISX_cjs.markRejoining(callExtId, false);
839
839
  failed("leave the stage")(err);
840
840
  }
841
841
  }, [callExtId, myIdentity, linkVersion]);
@@ -895,7 +895,7 @@ function useWebinar({
895
895
  if (!callKey) throw new Error("This call has no key.");
896
896
  await webinarApi().questions.ask(
897
897
  callExtId,
898
- await chunkGFX7LQGR_cjs.sealQuestionText(text, callKey),
898
+ await chunkHISGJISX_cjs.sealQuestionText(text, callKey),
899
899
  linkVersion
900
900
  );
901
901
  }, "ask the question"),
@@ -909,7 +909,7 @@ function useWebinar({
909
909
  await webinarApi().questions.update(
910
910
  callExtId,
911
911
  id,
912
- { answer: await chunkGFX7LQGR_cjs.sealQuestionText(text, callKey) },
912
+ { answer: await chunkHISGJISX_cjs.sealQuestionText(text, callKey) },
913
913
  linkVersion
914
914
  );
915
915
  }, "answer the question"),
@@ -939,15 +939,15 @@ function useWebinar({
939
939
  function useHostMuteNotice(callExtId) {
940
940
  const room = componentsReact.useRoomContext();
941
941
  react.useEffect(() => {
942
- const notifyMuted = chunkGFX7LQGR_cjs.createMutedNotifier((text) => chunkIX4HOS5Z_cjs.notify.info(text));
942
+ const notifyMuted = chunkHISGJISX_cjs.createMutedNotifier((text) => chunkIX4HOS5Z_cjs.notify.info(text));
943
943
  const onData = (payload, participant, _kind, topic, _encryption, participantIdentity) => {
944
- if (topic !== chunkGFX7LQGR_cjs.CALL_MODERATION_TOPIC) return;
944
+ if (topic !== chunkHISGJISX_cjs.CALL_MODERATION_TOPIC) return;
945
945
  if (participant || participantIdentity) return;
946
- const notice = chunkGFX7LQGR_cjs.mutedNoticeFromPacket(payload);
946
+ const notice = chunkHISGJISX_cjs.mutedNoticeFromPacket(payload);
947
947
  if (notice) notifyMuted(notice);
948
948
  };
949
949
  room.on(livekitClient.RoomEvent.DataReceived, onData);
950
- const offWs = chunkGFX7LQGR_cjs.onCallEvent("call.muted", (message) => {
950
+ const offWs = chunkHISGJISX_cjs.onCallEvent("call.muted", (message) => {
951
951
  if (message.callExtId === callExtId) notifyMuted(message);
952
952
  });
953
953
  return () => {