@arbidocs/react 0.5.138 → 0.5.140

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.cjs CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  var chunkTMPDW7J5_cjs = require('./chunk-TMPDW7J5.cjs');
4
4
  var chunk26SZ3DS4_cjs = require('./chunk-26SZ3DS4.cjs');
5
- var chunkPDE246CA_cjs = require('./chunk-PDE246CA.cjs');
5
+ var chunkVO7OWQP6_cjs = require('./chunk-VO7OWQP6.cjs');
6
6
  var chunkZZZYVNFW_cjs = require('./chunk-ZZZYVNFW.cjs');
7
7
  var chunkFDYZA6NO_cjs = require('./chunk-FDYZA6NO.cjs');
8
8
  var chunkFE6ZSNZE_cjs = require('./chunk-FE6ZSNZE.cjs');
@@ -1679,19 +1679,11 @@ function subscribeDocumentReads(qc, onRows) {
1679
1679
  var STALE_TASK_MS = 6 * 60 * 60 * 1e3;
1680
1680
  var ORPHAN_TASK_MS = 15 * 60 * 1e3;
1681
1681
  var SNAPSHOT_MS = 500;
1682
- function applyTaskEvent(queryClient, arbi, message, me) {
1683
- const workspaceId = message.workspace_ext_id;
1684
- if (!workspaceId) return;
1685
- if (chunkPDE246CA_cjs.FINISHED_DOCUMENT_STATUSES.has(message.status)) {
1686
- void chunkPDE246CA_cjs.refreshDocuments(queryClient, arbi, [message.doc_ext_id]);
1687
- return;
1688
- }
1689
- const cached = chunkPDE246CA_cjs.getCachedDocuments(queryClient, workspaceId);
1690
- if (!cached || cached.some((d) => d.external_id === message.doc_ext_id)) return;
1682
+ function placeholderRow(message, me) {
1691
1683
  const now = (/* @__PURE__ */ new Date()).toISOString();
1692
- const placeholder = {
1684
+ return {
1693
1685
  external_id: message.doc_ext_id,
1694
- workspace_ext_id: workspaceId,
1686
+ workspace_ext_id: message.workspace_ext_id,
1695
1687
  file_name: message.file_name ?? "Uploading\u2026",
1696
1688
  status: message.status,
1697
1689
  folder: message.folder ?? null,
@@ -1703,23 +1695,50 @@ function applyTaskEvent(queryClient, arbi, message, me) {
1703
1695
  created_at: now,
1704
1696
  updated_at: now
1705
1697
  };
1706
- chunkPDE246CA_cjs.patchDocuments(
1707
- queryClient,
1708
- (old) => old.some((d) => d.external_id === message.doc_ext_id) ? old : [...old, placeholder],
1709
- workspaceId
1710
- );
1698
+ }
1699
+ function applyTaskEvents(queryClient, arbi, messages, me) {
1700
+ const finished = /* @__PURE__ */ new Set();
1701
+ const pending = /* @__PURE__ */ new Map();
1702
+ for (const message of messages) {
1703
+ const workspaceId = message.workspace_ext_id;
1704
+ if (!workspaceId) continue;
1705
+ if (chunkVO7OWQP6_cjs.FINISHED_DOCUMENT_STATUSES.has(message.status)) {
1706
+ finished.add(message.doc_ext_id);
1707
+ continue;
1708
+ }
1709
+ const rows = pending.get(workspaceId) ?? /* @__PURE__ */ new Map();
1710
+ if (!rows.has(message.doc_ext_id)) rows.set(message.doc_ext_id, message);
1711
+ pending.set(workspaceId, rows);
1712
+ }
1713
+ chunkVO7OWQP6_cjs.queueDocumentReads(queryClient, arbi, [...finished]);
1714
+ for (const [workspaceId, rows] of pending) {
1715
+ const cached = chunkVO7OWQP6_cjs.getCachedDocuments(queryClient, workspaceId);
1716
+ if (!cached) continue;
1717
+ const listed = new Set(cached.map((d) => d.external_id));
1718
+ const fresh = [...rows.values()].filter((m) => !listed.has(m.doc_ext_id));
1719
+ if (!fresh.length) continue;
1720
+ chunkVO7OWQP6_cjs.patchDocuments(
1721
+ queryClient,
1722
+ (old) => {
1723
+ const known = old === cached ? listed : new Set(old.map((d) => d.external_id));
1724
+ const add = fresh.filter((m) => !known.has(m.doc_ext_id)).map((m) => placeholderRow(m, me));
1725
+ return add.length ? [...old, ...add] : old;
1726
+ },
1727
+ workspaceId
1728
+ );
1729
+ }
1711
1730
  }
1712
1731
  function useWorkspaceProcessing(workspaceId) {
1713
1732
  const queryClient = reactQuery.useQueryClient();
1714
1733
  const arbi = chunkFE6ZSNZE_cjs.useArbi();
1715
- const [snapshot, setSnapshot] = React.useState(() => chunkPDE246CA_cjs.useArbiWsStore.getState().tasks);
1734
+ const [snapshot, setSnapshot] = React.useState(() => chunkVO7OWQP6_cjs.useArbiWsStore.getState().tasks);
1716
1735
  React.useEffect(() => {
1717
1736
  let timer = null;
1718
- const unsubscribe = chunkPDE246CA_cjs.useArbiWsStore.subscribe((state, previous) => {
1737
+ const unsubscribe = chunkVO7OWQP6_cjs.useArbiWsStore.subscribe((state, previous) => {
1719
1738
  if (state.tasks === previous.tasks || timer) return;
1720
1739
  timer = setTimeout(() => {
1721
1740
  timer = null;
1722
- setSnapshot(chunkPDE246CA_cjs.useArbiWsStore.getState().tasks);
1741
+ setSnapshot(chunkVO7OWQP6_cjs.useArbiWsStore.getState().tasks);
1723
1742
  }, SNAPSHOT_MS);
1724
1743
  });
1725
1744
  return () => {
@@ -1729,13 +1748,13 @@ function useWorkspaceProcessing(workspaceId) {
1729
1748
  }, []);
1730
1749
  React.useEffect(() => {
1731
1750
  if (!workspaceId) return;
1732
- const store2 = chunkPDE246CA_cjs.useArbiWsStore.getState();
1733
- const documents3 = chunkPDE246CA_cjs.getCachedDocuments(queryClient, workspaceId) ?? [];
1751
+ const store2 = chunkVO7OWQP6_cjs.useArbiWsStore.getState();
1752
+ const documents3 = chunkVO7OWQP6_cjs.getCachedDocuments(queryClient, workspaceId) ?? [];
1734
1753
  store2.settleTasks(documents3);
1735
1754
  const listed = new Set(documents3.map((d) => d.external_id));
1736
1755
  const now = Date.now();
1737
- for (const task of Object.values(chunkPDE246CA_cjs.useArbiWsStore.getState().tasks)) {
1738
- if (task.workspace_ext_id !== workspaceId || !chunkPDE246CA_cjs.IN_FLIGHT_DOCUMENT_STATUSES.has(task.status))
1756
+ for (const task of Object.values(chunkVO7OWQP6_cjs.useArbiWsStore.getState().tasks)) {
1757
+ if (task.workspace_ext_id !== workspaceId || !chunkVO7OWQP6_cjs.IN_FLIGHT_DOCUMENT_STATUSES.has(task.status))
1739
1758
  continue;
1740
1759
  const since = task.startTime ?? task.endTime;
1741
1760
  const age = since == null ? null : now - since;
@@ -1748,16 +1767,16 @@ function useWorkspaceProcessing(workspaceId) {
1748
1767
  if (!workspaceId) return;
1749
1768
  const unsubscribeReads = subscribeDocumentReads(
1750
1769
  queryClient,
1751
- (rows) => chunkPDE246CA_cjs.useArbiWsStore.getState().settleTasks(rows)
1770
+ (rows) => chunkVO7OWQP6_cjs.useArbiWsStore.getState().settleTasks(rows)
1752
1771
  );
1753
1772
  const recheck = async () => {
1754
- const ids2 = Object.values(chunkPDE246CA_cjs.useArbiWsStore.getState().tasks).filter(
1755
- (t) => t.workspace_ext_id === workspaceId && chunkPDE246CA_cjs.IN_FLIGHT_DOCUMENT_STATUSES.has(t.status)
1773
+ const ids2 = Object.values(chunkVO7OWQP6_cjs.useArbiWsStore.getState().tasks).filter(
1774
+ (t) => t.workspace_ext_id === workspaceId && chunkVO7OWQP6_cjs.IN_FLIGHT_DOCUMENT_STATUSES.has(t.status)
1756
1775
  ).map((t) => t.doc_ext_id);
1757
- if (ids2.length) await chunkPDE246CA_cjs.refreshDocuments(queryClient, arbi, ids2);
1776
+ if (ids2.length) await chunkVO7OWQP6_cjs.refreshDocuments(queryClient, arbi, ids2);
1758
1777
  };
1759
- let wasConnected = chunkPDE246CA_cjs.useArbiWsStore.getState().status === "connected";
1760
- const unsubscribeStatus = chunkPDE246CA_cjs.useArbiWsStore.subscribe((state) => {
1778
+ let wasConnected = chunkVO7OWQP6_cjs.useArbiWsStore.getState().status === "connected";
1779
+ const unsubscribeStatus = chunkVO7OWQP6_cjs.useArbiWsStore.subscribe((state) => {
1761
1780
  const connected = state.status === "connected";
1762
1781
  if (connected && !wasConnected) void recheck();
1763
1782
  wasConnected = connected;
@@ -1772,11 +1791,11 @@ function useWorkspaceProcessing(workspaceId) {
1772
1791
  const count = (statuses) => allTasks.filter(
1773
1792
  (t) => Array.isArray(statuses) ? statuses.includes(t.status) : statuses.has(t.status)
1774
1793
  ).length;
1775
- const { clearTask, clearFinishedTasks } = chunkPDE246CA_cjs.useArbiWsStore.getState();
1794
+ const { clearTask, clearFinishedTasks } = chunkVO7OWQP6_cjs.useArbiWsStore.getState();
1776
1795
  return {
1777
1796
  tasks: Object.fromEntries(allTasks.map((t) => [t.doc_ext_id, t])),
1778
1797
  allTasks,
1779
- processingCount: count(chunkPDE246CA_cjs.IN_FLIGHT_DOCUMENT_STATUSES),
1798
+ processingCount: count(chunkVO7OWQP6_cjs.IN_FLIGHT_DOCUMENT_STATUSES),
1780
1799
  completedCount: count(["completed", "low-content"]),
1781
1800
  failedCount: count(["failed"]),
1782
1801
  skippedCount: count(["skipped"]),
@@ -1788,7 +1807,7 @@ function useWorkspaceProcessing(workspaceId) {
1788
1807
  function applyOptimisticDocumentEdit(qc, updates) {
1789
1808
  const byId = new Map(updates.map((update2) => [update2.external_id, update2]));
1790
1809
  const previous = [];
1791
- chunkPDE246CA_cjs.patchDocuments(qc, (old) => {
1810
+ chunkVO7OWQP6_cjs.patchDocuments(qc, (old) => {
1792
1811
  let changed = false;
1793
1812
  const next = old.map((doc) => {
1794
1813
  const update2 = byId.get(doc.external_id);
@@ -1803,7 +1822,7 @@ function applyOptimisticDocumentEdit(qc, updates) {
1803
1822
  const own = qc.getQueryData(
1804
1823
  chunkFE6ZSNZE_cjs.arbiQueryKeys.document(update2.external_id)
1805
1824
  );
1806
- if (own) chunkPDE246CA_cjs.setCachedDocument(qc, { ...own, ...update2 });
1825
+ if (own) chunkVO7OWQP6_cjs.setCachedDocument(qc, { ...own, ...update2 });
1807
1826
  return [update2.external_id, own];
1808
1827
  });
1809
1828
  return { optimistic: true, previous, previousOwn };
@@ -1813,7 +1832,7 @@ function rollbackOptimisticDocumentEdit(qc, context) {
1813
1832
  if (!edit?.optimistic) return;
1814
1833
  if (edit.previous.length) {
1815
1834
  const restore = new Map(edit.previous.map((doc) => [doc.external_id, doc]));
1816
- chunkPDE246CA_cjs.patchDocuments(
1835
+ chunkVO7OWQP6_cjs.patchDocuments(
1817
1836
  qc,
1818
1837
  (old) => old.some((doc) => restore.has(doc.external_id)) ? old.map((doc) => restore.get(doc.external_id) ?? doc) : old
1819
1838
  );
@@ -1823,19 +1842,19 @@ function rollbackOptimisticDocumentEdit(qc, context) {
1823
1842
  function settleUpdatedDocuments(qc, updated) {
1824
1843
  if (!updated.length) return;
1825
1844
  const byId = new Map(updated.map((doc) => [doc.external_id, doc]));
1826
- chunkPDE246CA_cjs.patchDocuments(
1845
+ chunkVO7OWQP6_cjs.patchDocuments(
1827
1846
  qc,
1828
1847
  (old) => old.some((doc) => byId.has(doc.external_id)) ? old.map((doc) => byId.get(doc.external_id) ?? doc) : old
1829
1848
  );
1830
- for (const doc of updated) chunkPDE246CA_cjs.setCachedDocument(qc, doc);
1849
+ for (const doc of updated) chunkVO7OWQP6_cjs.setCachedDocument(qc, doc);
1831
1850
  }
1832
1851
  function patchEachDocument(qc, docIds, reducer) {
1833
1852
  const ids2 = new Set(docIds);
1834
- chunkPDE246CA_cjs.patchDocuments(
1853
+ chunkVO7OWQP6_cjs.patchDocuments(
1835
1854
  qc,
1836
1855
  (old) => old.some((doc) => ids2.has(doc.external_id)) ? old.map((doc) => ids2.has(doc.external_id) ? reducer(doc) : doc) : old
1837
1856
  );
1838
- for (const id of ids2) chunkPDE246CA_cjs.patchCachedDocument(qc, id, reducer);
1857
+ for (const id of ids2) chunkVO7OWQP6_cjs.patchCachedDocument(qc, id, reducer);
1839
1858
  }
1840
1859
  function workspaceOf(qc, docId) {
1841
1860
  for (const [, docs] of qc.getQueriesData({
@@ -1862,7 +1881,7 @@ function settleAssignedDocTags(qc, created) {
1862
1881
  ...doc,
1863
1882
  doctags: [...doc.doctags ?? [], ...byDoc.get(doc.external_id) ?? []]
1864
1883
  }));
1865
- for (const [workspaceId, delta] of workspaces) chunkPDE246CA_cjs.adjustTagCounts(qc, workspaceId, delta);
1884
+ for (const [workspaceId, delta] of workspaces) chunkVO7OWQP6_cjs.adjustTagCounts(qc, workspaceId, delta);
1866
1885
  }
1867
1886
  function settleRemovedDocTags(qc, { tagId, docIds }) {
1868
1887
  const ids2 = new Set(docIds);
@@ -1884,7 +1903,7 @@ function settleRemovedDocTags(qc, { tagId, docIds }) {
1884
1903
  doctags: (doc.doctags ?? []).filter((dt) => dt.tag_ext_id !== tagId)
1885
1904
  }));
1886
1905
  for (const [workspaceId, removed] of removedByWorkspace)
1887
- chunkPDE246CA_cjs.adjustTagCounts(qc, workspaceId, /* @__PURE__ */ new Map([[tagId, -removed]]));
1906
+ chunkVO7OWQP6_cjs.adjustTagCounts(qc, workspaceId, /* @__PURE__ */ new Map([[tagId, -removed]]));
1888
1907
  }
1889
1908
  function settleUpdatedDocTag(qc, updated) {
1890
1909
  patchEachDocument(qc, [updated.doc_ext_id], (doc) => ({
@@ -1892,23 +1911,23 @@ function settleUpdatedDocTag(qc, updated) {
1892
1911
  doctags: (doc.doctags ?? []).map((dt) => dt.tag_ext_id === updated.tag_ext_id ? updated : dt)
1893
1912
  }));
1894
1913
  }
1895
- var sendUpdateDocuments = (client, input) => chunkPDE246CA_cjs.inWorkspace(
1896
- chunkPDE246CA_cjs.primeOnClient(client),
1914
+ var sendUpdateDocuments = (client, input) => chunkVO7OWQP6_cjs.inWorkspace(
1915
+ chunkVO7OWQP6_cjs.primeOnClient(client),
1897
1916
  input.workspaceId,
1898
1917
  () => browser.documents.updateDocuments(client, input.documents)
1899
1918
  );
1900
- var sendAssignDocTags = (client, input) => chunkPDE246CA_cjs.inWorkspace(
1901
- chunkPDE246CA_cjs.primeOnClient(client),
1919
+ var sendAssignDocTags = (client, input) => chunkVO7OWQP6_cjs.inWorkspace(
1920
+ chunkVO7OWQP6_cjs.primeOnClient(client),
1902
1921
  input.workspaceId,
1903
1922
  () => browser.doctags.assignDocTags(client, input.tagId, input.docIds, input.note, input.citations)
1904
1923
  );
1905
- var sendRemoveDocTags = (client, input) => chunkPDE246CA_cjs.inWorkspace(
1906
- chunkPDE246CA_cjs.primeOnClient(client),
1924
+ var sendRemoveDocTags = (client, input) => chunkVO7OWQP6_cjs.inWorkspace(
1925
+ chunkVO7OWQP6_cjs.primeOnClient(client),
1907
1926
  input.workspaceId,
1908
1927
  () => browser.doctags.removeDocTags(client, input.tagId, input.docIds)
1909
1928
  );
1910
- var sendUpdateDocTag = (client, input) => chunkPDE246CA_cjs.inWorkspace(
1911
- chunkPDE246CA_cjs.primeOnClient(client),
1929
+ var sendUpdateDocTag = (client, input) => chunkVO7OWQP6_cjs.inWorkspace(
1930
+ chunkVO7OWQP6_cjs.primeOnClient(client),
1912
1931
  input.workspaceId,
1913
1932
  () => browser.doctags.updateDocTag(client, input.tagId, input.docId, {
1914
1933
  note: input.note,
@@ -1961,7 +1980,7 @@ function useMarkDocumentShared() {
1961
1980
  const qc = reactQuery.useQueryClient();
1962
1981
  return React.useCallback(
1963
1982
  (documentExtId) => {
1964
- chunkPDE246CA_cjs.patchDocuments(
1983
+ chunkVO7OWQP6_cjs.patchDocuments(
1965
1984
  qc,
1966
1985
  (old) => old.map((doc) => doc.external_id === documentExtId ? { ...doc, shared: true } : doc)
1967
1986
  );
@@ -1977,21 +1996,21 @@ function useUpdateDocuments() {
1977
1996
  (input) => input.documents[0]?.external_id
1978
1997
  );
1979
1998
  return resolvingOffline(
1980
- chunkPDE246CA_cjs.useCapturingWorkspace(
1999
+ chunkVO7OWQP6_cjs.useCapturingWorkspace(
1981
2000
  reactQuery.useMutation({
1982
2001
  mutationKey: chunkFE6ZSNZE_cjs.arbiMutationKeys.updateDocuments(),
1983
- mutationFn: (input) => chunkPDE246CA_cjs.inWorkspace(
1984
- chunkPDE246CA_cjs.primeOnArbi(arbi),
2002
+ mutationFn: (input) => chunkVO7OWQP6_cjs.inWorkspace(
2003
+ chunkVO7OWQP6_cjs.primeOnArbi(arbi),
1985
2004
  input.workspaceId,
1986
2005
  () => arbi.documents.update(input.documents)
1987
2006
  ),
1988
2007
  onMutate: ({ documents: documents3 }) => reactQuery.onlineManager.isOnline() || !documents3.length ? void 0 : applyOptimisticDocumentEdit(qc, documents3),
1989
2008
  // Not sent because its workspace can't be opened: the edit stays, listed as not sent.
1990
2009
  onError: (error, _input, context) => {
1991
- if (!chunkPDE246CA_cjs.isWorkspaceUnavailable(error)) rollbackOptimisticDocumentEdit(qc, context);
2010
+ if (!chunkVO7OWQP6_cjs.isWorkspaceUnavailable(error)) rollbackOptimisticDocumentEdit(qc, context);
1992
2011
  },
1993
2012
  onSuccess: (updated) => settleUpdatedDocuments(qc, updated),
1994
- ...chunkPDE246CA_cjs.QUEUED_WRITE_RETRY
2013
+ ...chunkVO7OWQP6_cjs.QUEUED_WRITE_RETRY
1995
2014
  }),
1996
2015
  capture
1997
2016
  )
@@ -2017,7 +2036,7 @@ function useRenameFolder() {
2017
2036
  return folder === void 0 ? [] : [{ external_id: doc.external_id, folder }];
2018
2037
  });
2019
2038
  if (updates.length > 0) await mutateAsync({ documents: updates });
2020
- chunkPDE246CA_cjs.patchDocuments(qc, (rows) => {
2039
+ chunkVO7OWQP6_cjs.patchDocuments(qc, (rows) => {
2021
2040
  let changed = false;
2022
2041
  const next = rows.map((doc) => {
2023
2042
  const folder = moved(doc.folder);
@@ -2040,19 +2059,19 @@ function useDeleteDocuments() {
2040
2059
  mutationFn: (docIds) => arbi.documents.delete(docIds),
2041
2060
  onSuccess: (_data, docIds) => {
2042
2061
  const gone = new Set(docIds);
2043
- chunkPDE246CA_cjs.patchDocuments(
2062
+ chunkVO7OWQP6_cjs.patchDocuments(
2044
2063
  qc,
2045
2064
  (old) => old.some((doc) => gone.has(doc.external_id)) ? old.filter((doc) => !gone.has(doc.external_id)) : old
2046
2065
  );
2047
- chunkPDE246CA_cjs.forgetDocuments(qc, docIds);
2048
- const { clearTask } = chunkPDE246CA_cjs.useArbiWsStore.getState();
2066
+ chunkVO7OWQP6_cjs.forgetDocuments(qc, docIds);
2067
+ const { clearTask } = chunkVO7OWQP6_cjs.useArbiWsStore.getState();
2049
2068
  for (const id of docIds) clearTask(id);
2050
2069
  return qc.invalidateQueries({ queryKey: chunkFE6ZSNZE_cjs.arbiQueryKeys.workspaces() });
2051
2070
  }
2052
2071
  });
2053
2072
  }
2054
2073
  async function settleUpload(qc, arbi, docIds) {
2055
- if (docIds?.length) await chunkPDE246CA_cjs.refreshDocuments(qc, arbi, docIds);
2074
+ if (docIds?.length) await chunkVO7OWQP6_cjs.refreshDocuments(qc, arbi, docIds);
2056
2075
  await qc.invalidateQueries({ queryKey: chunkFE6ZSNZE_cjs.arbiQueryKeys.workspaces() });
2057
2076
  }
2058
2077
  function useUploadDocuments() {
@@ -2082,16 +2101,16 @@ function useAssignDocTags() {
2082
2101
  const qc = reactQuery.useQueryClient();
2083
2102
  const capture = useDocumentWriteWorkspace((input) => input.docIds[0]);
2084
2103
  return resolvingOffline(
2085
- chunkPDE246CA_cjs.useCapturingWorkspace(
2104
+ chunkVO7OWQP6_cjs.useCapturingWorkspace(
2086
2105
  reactQuery.useMutation({
2087
2106
  mutationKey: chunkFE6ZSNZE_cjs.arbiMutationKeys.assignDocTags(),
2088
- mutationFn: ({ workspaceId, tagId, docIds, note, citations }) => chunkPDE246CA_cjs.inWorkspace(
2089
- chunkPDE246CA_cjs.primeOnArbi(arbi),
2107
+ mutationFn: ({ workspaceId, tagId, docIds, note, citations }) => chunkVO7OWQP6_cjs.inWorkspace(
2108
+ chunkVO7OWQP6_cjs.primeOnArbi(arbi),
2090
2109
  workspaceId,
2091
2110
  () => arbi.doctags.assign(tagId, docIds, note, citations)
2092
2111
  ),
2093
2112
  onSuccess: (created) => settleAssignedDocTags(qc, created),
2094
- ...chunkPDE246CA_cjs.QUEUED_WRITE_RETRY
2113
+ ...chunkVO7OWQP6_cjs.QUEUED_WRITE_RETRY
2095
2114
  }),
2096
2115
  capture
2097
2116
  )
@@ -2102,12 +2121,12 @@ function useRemoveDocTags() {
2102
2121
  const qc = reactQuery.useQueryClient();
2103
2122
  const capture = useDocumentWriteWorkspace((input) => input.docIds[0]);
2104
2123
  return resolvingOffline(
2105
- chunkPDE246CA_cjs.useCapturingWorkspace(
2124
+ chunkVO7OWQP6_cjs.useCapturingWorkspace(
2106
2125
  reactQuery.useMutation({
2107
2126
  mutationKey: chunkFE6ZSNZE_cjs.arbiMutationKeys.removeDocTags(),
2108
- mutationFn: ({ workspaceId, tagId, docIds }) => chunkPDE246CA_cjs.inWorkspace(chunkPDE246CA_cjs.primeOnArbi(arbi), workspaceId, () => arbi.doctags.remove(tagId, docIds)),
2127
+ mutationFn: ({ workspaceId, tagId, docIds }) => chunkVO7OWQP6_cjs.inWorkspace(chunkVO7OWQP6_cjs.primeOnArbi(arbi), workspaceId, () => arbi.doctags.remove(tagId, docIds)),
2109
2128
  onSuccess: (_data, input) => settleRemovedDocTags(qc, input),
2110
- ...chunkPDE246CA_cjs.QUEUED_WRITE_RETRY
2129
+ ...chunkVO7OWQP6_cjs.QUEUED_WRITE_RETRY
2111
2130
  }),
2112
2131
  capture
2113
2132
  )
@@ -2118,23 +2137,23 @@ function useUpdateDocTag() {
2118
2137
  const qc = reactQuery.useQueryClient();
2119
2138
  const capture = useDocumentWriteWorkspace((input) => input.docId);
2120
2139
  return resolvingOffline(
2121
- chunkPDE246CA_cjs.useCapturingWorkspace(
2140
+ chunkVO7OWQP6_cjs.useCapturingWorkspace(
2122
2141
  reactQuery.useMutation({
2123
2142
  mutationKey: chunkFE6ZSNZE_cjs.arbiMutationKeys.updateDocTag(),
2124
- mutationFn: ({ workspaceId, tagId, docId, note, citations }) => chunkPDE246CA_cjs.inWorkspace(
2125
- chunkPDE246CA_cjs.primeOnArbi(arbi),
2143
+ mutationFn: ({ workspaceId, tagId, docId, note, citations }) => chunkVO7OWQP6_cjs.inWorkspace(
2144
+ chunkVO7OWQP6_cjs.primeOnArbi(arbi),
2126
2145
  workspaceId,
2127
2146
  () => arbi.doctags.update(tagId, docId, { note, citations })
2128
2147
  ),
2129
2148
  onSuccess: (updated) => settleUpdatedDocTag(qc, updated),
2130
- ...chunkPDE246CA_cjs.QUEUED_WRITE_RETRY
2149
+ ...chunkVO7OWQP6_cjs.QUEUED_WRITE_RETRY
2131
2150
  }),
2132
2151
  capture
2133
2152
  )
2134
2153
  );
2135
2154
  }
2136
2155
  function queueProcessing(documents3) {
2137
- const store2 = chunkPDE246CA_cjs.useArbiWsStore.getState();
2156
+ const store2 = chunkVO7OWQP6_cjs.useArbiWsStore.getState();
2138
2157
  const previous = documents3.map(({ docId }) => [docId, store2.tasks[docId]]);
2139
2158
  const now = Date.now();
2140
2159
  for (const doc of documents3)
@@ -2147,7 +2166,7 @@ function queueProcessing(documents3) {
2147
2166
  progress: 0,
2148
2167
  startTime: now
2149
2168
  });
2150
- return () => chunkPDE246CA_cjs.useArbiWsStore.setState((state) => {
2169
+ return () => chunkVO7OWQP6_cjs.useArbiWsStore.setState((state) => {
2151
2170
  const tasks = { ...state.tasks };
2152
2171
  for (const [docId, task] of previous) {
2153
2172
  if (task) tasks[docId] = task;
@@ -2166,7 +2185,7 @@ function useGenerateDocTags() {
2166
2185
  if (!docIds.length) return void 0;
2167
2186
  const workspaceId = arbi.hasWorkspace ? arbi.getWorkspaceId() : "";
2168
2187
  const listed = new Map(
2169
- (chunkPDE246CA_cjs.getCachedDocuments(qc, workspaceId) ?? []).map((doc) => [doc.external_id, doc])
2188
+ (chunkVO7OWQP6_cjs.getCachedDocuments(qc, workspaceId) ?? []).map((doc) => [doc.external_id, doc])
2170
2189
  );
2171
2190
  return {
2172
2191
  undo: queueProcessing(
@@ -2187,7 +2206,7 @@ function useFinaliseTranslation() {
2187
2206
  const qc = reactQuery.useQueryClient();
2188
2207
  return reactQuery.useMutation({
2189
2208
  mutationFn: (docId) => arbi.documents.finaliseTranslation(docId),
2190
- onSuccess: (result) => void chunkPDE246CA_cjs.refreshDocuments(qc, arbi, [result.document_ext_id])
2209
+ onSuccess: (result) => void chunkVO7OWQP6_cjs.refreshDocuments(qc, arbi, [result.document_ext_id])
2191
2210
  });
2192
2211
  }
2193
2212
 
@@ -2197,10 +2216,10 @@ function useDocumentsSupport() {
2197
2216
  return chunkFE6ZSNZE_cjs.useArbiHost().documents ?? NO_SUPPORT;
2198
2217
  }
2199
2218
  function useProcessingTasks() {
2200
- return chunkPDE246CA_cjs.useArbiWsStore((state) => state.tasks);
2219
+ return chunkVO7OWQP6_cjs.useArbiWsStore((state) => state.tasks);
2201
2220
  }
2202
2221
  function useProcessingTask(docId) {
2203
- return chunkPDE246CA_cjs.useArbiWsStore((state) => state.tasks[docId]);
2222
+ return chunkVO7OWQP6_cjs.useArbiWsStore((state) => state.tasks[docId]);
2204
2223
  }
2205
2224
  var NO_ACTIONS = {};
2206
2225
  function useDocumentHostActions() {
@@ -2394,7 +2413,7 @@ function useDocumentThumbnails(visibleIds) {
2394
2413
  for (const id of visibleIds)
2395
2414
  if (IN_PROGRESS.has(tasks[id]?.status ?? "")) resolvedRef.current.delete(id);
2396
2415
  const ready = visibleIds.filter(
2397
- (id) => !resolvedRef.current.has(id) && chunkPDE246CA_cjs.FINISHED_DOCUMENT_STATUSES.has(tasks[id]?.status ?? "")
2416
+ (id) => !resolvedRef.current.has(id) && chunkVO7OWQP6_cjs.FINISHED_DOCUMENT_STATUSES.has(tasks[id]?.status ?? "")
2398
2417
  );
2399
2418
  if (ready.length > 0) void fetchMissing(ready);
2400
2419
  }, [tasks, idsKey, fetchMissing]);
@@ -2416,8 +2435,8 @@ function DocumentReview({
2416
2435
  onClose,
2417
2436
  className
2418
2437
  }) {
2419
- const processingInProp = !!doc?.status && !chunkPDE246CA_cjs.FINISHED_DOCUMENT_STATUSES.has(doc.status);
2420
- const { data: polled } = chunkPDE246CA_cjs.useDocument(docId, {
2438
+ const processingInProp = !!doc?.status && !chunkVO7OWQP6_cjs.FINISHED_DOCUMENT_STATUSES.has(doc.status);
2439
+ const { data: polled } = chunkVO7OWQP6_cjs.useDocument(docId, {
2421
2440
  enabled: processingInProp,
2422
2441
  pollWhileProcessing: true
2423
2442
  });
@@ -3307,9 +3326,53 @@ function uploadFolderOf(file, base) {
3307
3326
  const own = slash > 0 ? relative.slice(0, slash) : "";
3308
3327
  return sanitizeFolderPath([base, own].filter(Boolean).join("/")) || null;
3309
3328
  }
3329
+
3330
+ // src/lib/throttle.ts
3331
+ function throttle(fn, intervalMs) {
3332
+ let last = -Infinity;
3333
+ let pending = null;
3334
+ let timer = null;
3335
+ const run2 = (args) => {
3336
+ last = Date.now();
3337
+ pending = null;
3338
+ fn(...args);
3339
+ };
3340
+ const clear = () => {
3341
+ if (timer) clearTimeout(timer);
3342
+ timer = null;
3343
+ };
3344
+ const throttled = ((...args) => {
3345
+ const wait = last + intervalMs - Date.now();
3346
+ if (wait <= 0 && !timer) {
3347
+ run2(args);
3348
+ return;
3349
+ }
3350
+ pending = args;
3351
+ if (!timer)
3352
+ timer = setTimeout(
3353
+ () => {
3354
+ timer = null;
3355
+ if (pending) run2(pending);
3356
+ },
3357
+ Math.max(0, wait)
3358
+ );
3359
+ });
3360
+ throttled.flush = () => {
3361
+ clear();
3362
+ if (pending) run2(pending);
3363
+ };
3364
+ throttled.cancel = () => {
3365
+ clear();
3366
+ pending = null;
3367
+ };
3368
+ return throttled;
3369
+ }
3370
+
3371
+ // src/documents/useUploadFiles.ts
3310
3372
  var { mimeFromName: mimeFromName2, newUploadSet } = browser.documents;
3311
3373
  var BATCH_SIZE2 = 100;
3312
3374
  var CONCURRENT_BATCHES = 4;
3375
+ var UPLOAD_PROGRESS_INTERVAL_MS = 100;
3313
3376
  var uploadedFolders = /* @__PURE__ */ new Map();
3314
3377
  function uploadedDocumentFolder(workspaceId, docId) {
3315
3378
  const pending = uploadedFolders.get(docId);
@@ -3363,12 +3426,16 @@ function useUploadFiles() {
3363
3426
  const filesByBatch = new Array(batches.length).fill(0);
3364
3427
  let done = 0;
3365
3428
  let highest = 0;
3429
+ const emit = throttle(
3430
+ (progress) => onProgress?.(progress),
3431
+ UPLOAD_PROGRESS_INTERVAL_MS
3432
+ );
3366
3433
  const report = () => {
3367
3434
  const loaded = loadedByBatch.reduce((sum, bytes) => sum + bytes, 0);
3368
3435
  const sent = filesByBatch.reduce((sum, files) => sum + files, 0);
3369
3436
  const share = input.files.length > 0 ? sent / input.files.length : 0;
3370
3437
  highest = Math.max(highest, Math.min(Math.round(share * 100), 100));
3371
- onProgress?.({
3438
+ emit({
3372
3439
  loaded,
3373
3440
  total,
3374
3441
  percentage: highest,
@@ -3427,7 +3494,7 @@ function useUploadFiles() {
3427
3494
  if (docIds2.length > 0) {
3428
3495
  for (const docId of docIds2) uploadedFolders.set(docId, { workspaceId, folder });
3429
3496
  const made = new Set(docIds2);
3430
- chunkPDE246CA_cjs.patchDocuments(
3497
+ chunkVO7OWQP6_cjs.patchDocuments(
3431
3498
  qc,
3432
3499
  (rows) => rows.map((doc) => made.has(doc.external_id) ? { ...doc, folder } : doc),
3433
3500
  workspaceId
@@ -3440,20 +3507,22 @@ function useUploadFiles() {
3440
3507
  return result;
3441
3508
  }),
3442
3509
  CONCURRENT_BATCHES
3443
- );
3510
+ ).finally(() => emit.cancel());
3511
+ report();
3512
+ emit.flush();
3444
3513
  const docIds = results.flatMap((result) => result.doc_ext_ids ?? []);
3445
3514
  const skipped = results.flatMap((result) => result.skipped ?? []);
3446
- if (docIds.length > 0) {
3447
- const read = await chunkPDE246CA_cjs.refreshDocuments(qc, arbi, docIds);
3448
- for (const doc of read) forgetUploadedDocumentFolder(doc.external_id);
3449
- }
3450
- await qc.invalidateQueries({ queryKey: chunkFE6ZSNZE_cjs.arbiQueryKeys.workspaces() });
3451
- if (docIds.length > 0 && input.generateTagIds?.length) {
3452
- await generateDocTags({ tagIds: input.generateTagIds, docIds, overwrite: false }).catch(
3453
- () => void 0
3454
- );
3455
- }
3456
- return { docIds, skipped };
3515
+ const settled = (async () => {
3516
+ if (docIds.length > 0) {
3517
+ const read = await chunkVO7OWQP6_cjs.refreshDocuments(qc, arbi, docIds);
3518
+ for (const doc of read) forgetUploadedDocumentFolder(doc.external_id);
3519
+ }
3520
+ await qc.invalidateQueries({ queryKey: chunkFE6ZSNZE_cjs.arbiQueryKeys.workspaces() });
3521
+ if (docIds.length > 0 && input.generateTagIds?.length) {
3522
+ await generateDocTags({ tagIds: input.generateTagIds, docIds, overwrite: false });
3523
+ }
3524
+ })().catch(() => void 0);
3525
+ return { docIds, skipped, settled };
3457
3526
  },
3458
3527
  [arbi, qc, direct, resolveWorkspaceKey, generateDocTags]
3459
3528
  );
@@ -3538,7 +3607,7 @@ function getRelatedLabels(related) {
3538
3607
  return parts;
3539
3608
  }
3540
3609
  function useRelatedDocuments(documents3) {
3541
- const { data: similarData } = chunkPDE246CA_cjs.useSimilarDocuments();
3610
+ const { data: similarData } = chunkVO7OWQP6_cjs.useSimilarDocuments();
3542
3611
  const structuralKey = React.useMemo(() => {
3543
3612
  const parts = [];
3544
3613
  for (const doc of documents3) {
@@ -3618,7 +3687,7 @@ function useRelatedDocuments(documents3) {
3618
3687
  }
3619
3688
  if (similarData?.pairs) {
3620
3689
  for (const pair of similarData.pairs) {
3621
- if (pair.similarity < chunkPDE246CA_cjs.SIMILARITY_THRESHOLD || pair.similarity >= 1) continue;
3690
+ if (pair.similarity < chunkVO7OWQP6_cjs.SIMILARITY_THRESHOLD || pair.similarity >= 1) continue;
3622
3691
  const docA = docById.get(pair.doc_a.external_id);
3623
3692
  const docB = docById.get(pair.doc_b.external_id);
3624
3693
  if (docA && docB) {
@@ -3638,7 +3707,7 @@ function useRelatedDocuments(documents3) {
3638
3707
  }, [documents3, similarData, structuralKey]);
3639
3708
  }
3640
3709
  var REPLAYABLE = [
3641
- ...chunkPDE246CA_cjs.replayableTagMutations,
3710
+ ...chunkVO7OWQP6_cjs.replayableTagMutations,
3642
3711
  ...replayableDocumentMutations
3643
3712
  ];
3644
3713
  function isReplayableArbiMutation(mutationKey) {
@@ -3652,7 +3721,7 @@ function registerArbiMutationDefaults(queryClient, client) {
3652
3721
  // kept as not sent.
3653
3722
  mutationFn: (variables) => m.run(client(), variables),
3654
3723
  onSuccess: (data, variables) => m.settle(queryClient, data, variables),
3655
- ...chunkPDE246CA_cjs.QUEUED_WRITE_RETRY
3724
+ ...chunkVO7OWQP6_cjs.QUEUED_WRITE_RETRY
3656
3725
  });
3657
3726
  }
3658
3727
  }
@@ -3680,7 +3749,7 @@ function isRestorableArbiQueryOnline(queryKey, data) {
3680
3749
  const docs = Array.isArray(data) ? data : [data];
3681
3750
  return !docs.some((doc) => {
3682
3751
  const status = doc?.status;
3683
- return !!status && !chunkPDE246CA_cjs.FINISHED_DOCUMENT_STATUSES.has(status);
3752
+ return !!status && !chunkVO7OWQP6_cjs.FINISHED_DOCUMENT_STATUSES.has(status);
3684
3753
  });
3685
3754
  }
3686
3755
 
@@ -3779,7 +3848,7 @@ function buildPendingSyncItem(raw, docNameById, tagNameById) {
3779
3848
  status: raw.status,
3780
3849
  at: raw.at,
3781
3850
  docIds,
3782
- ...raw.blocked ? { notice: chunkPDE246CA_cjs.QUEUED_WRITE_BLOCKED_MESSAGE } : {}
3851
+ ...raw.blocked ? { notice: chunkVO7OWQP6_cjs.QUEUED_WRITE_BLOCKED_MESSAGE } : {}
3783
3852
  };
3784
3853
  }
3785
3854
  var PENDING_SYNC_PREDICATE = (m) => (
@@ -3794,10 +3863,10 @@ var PENDING_SYNC_PREDICATE = (m) => (
3794
3863
  // flash "pending/syncing" while fully online. `error` is kept so a failed
3795
3864
  // sync stays visible to review/undo.
3796
3865
  // A write held back because its workspace can't be opened (tried again meanwhile) is waiting too.
3797
- isReplayableArbiMutation(m.options.mutationKey) && (m.state.isPaused || m.state.status === "error" || chunkPDE246CA_cjs.isBlockedOnWorkspace(m))
3866
+ isReplayableArbiMutation(m.options.mutationKey) && (m.state.isPaused || m.state.status === "error" || chunkVO7OWQP6_cjs.isBlockedOnWorkspace(m))
3798
3867
  );
3799
3868
  function usePendingSyncItems() {
3800
- const { data: documents3 } = chunkPDE246CA_cjs.useDocuments();
3869
+ const { data: documents3 } = chunkVO7OWQP6_cjs.useDocuments();
3801
3870
  const { data: tags } = chunkZZZYVNFW_cjs.useTags();
3802
3871
  const raw = reactQuery.useMutationState({
3803
3872
  filters: { predicate: PENDING_SYNC_PREDICATE },
@@ -3806,9 +3875,9 @@ function usePendingSyncItems() {
3806
3875
  kind: kindOf(m.options.mutationKey) ?? "fields",
3807
3876
  variables: m.state.variables,
3808
3877
  context: m.state.context,
3809
- status: statusOf(m.state.isPaused, m.state.status, chunkPDE246CA_cjs.isBlockedOnWorkspace(m)),
3878
+ status: statusOf(m.state.isPaused, m.state.status, chunkVO7OWQP6_cjs.isBlockedOnWorkspace(m)),
3810
3879
  at: m.state.submittedAt,
3811
- blocked: chunkPDE246CA_cjs.isBlockedOnWorkspace(m)
3880
+ blocked: chunkVO7OWQP6_cjs.isBlockedOnWorkspace(m)
3812
3881
  })
3813
3882
  });
3814
3883
  return React.useMemo(() => {
@@ -3983,7 +4052,7 @@ function useKeepDocumentsOffline() {
3983
4052
  return reactQuery.useMutation({
3984
4053
  mutationFn: async (docs) => {
3985
4054
  await keepDocumentsOffline(arbi.getClient().fetch, docs);
3986
- for (const doc of docs) chunkPDE246CA_cjs.setCachedDocument(queryClient, doc);
4055
+ for (const doc of docs) chunkVO7OWQP6_cjs.setCachedDocument(queryClient, doc);
3987
4056
  await onKeptOffline?.();
3988
4057
  return docs.length;
3989
4058
  },
@@ -4376,7 +4445,7 @@ function useStreamHandlers() {
4376
4445
  return "";
4377
4446
  }
4378
4447
  },
4379
- refreshDocuments: (ids2) => chunkPDE246CA_cjs.refreshDocuments(queryClient, arbi, ids2)
4448
+ refreshDocuments: (ids2) => chunkVO7OWQP6_cjs.refreshDocuments(queryClient, arbi, ids2)
4380
4449
  },
4381
4450
  params
4382
4451
  ),
@@ -4633,7 +4702,7 @@ function useConversationActions({
4633
4702
  conversationId: convId,
4634
4703
  workspaceId: turnWorkspaceId
4635
4704
  });
4636
- const flushing = chunkPDE246CA_cjs.flushDocumentForTurn(activeArtifactExtId);
4705
+ const flushing = chunkVO7OWQP6_cjs.flushDocumentForTurn(activeArtifactExtId);
4637
4706
  if (flushing) await flushing;
4638
4707
  const pendingTools = state.pendingTools;
4639
4708
  if (pendingTools) session.setPendingTools(null);
@@ -5546,7 +5615,7 @@ function useConversation(options = {}) {
5546
5615
  React.useEffect(() => {
5547
5616
  if (agentId && workspaceId && !conversationId) session.setNewAgentChat({ agentId, workspaceId });
5548
5617
  }, [session, agentId, workspaceId, conversationId]);
5549
- const { data: docs = [], isLoading: isLoadingDocuments } = chunkPDE246CA_cjs.useDocuments(workspaceId);
5618
+ const { data: docs = [], isLoading: isLoadingDocuments } = chunkVO7OWQP6_cjs.useDocuments(workspaceId);
5550
5619
  const ordinaryHistory = chunkZZZYVNFW_cjs.useConversations(workspaceId, { enabled: !agentId, live: true });
5551
5620
  const agentHistory = useAgentChats(agentId);
5552
5621
  const stored = React.useMemo(
@@ -5824,7 +5893,7 @@ function useConversation(options = {}) {
5824
5893
  uploaded.push(...result.doc_ext_ids ?? []);
5825
5894
  }
5826
5895
  }
5827
- if (uploaded.length) await chunkPDE246CA_cjs.refreshDocuments(queryClient, arbi, uploaded);
5896
+ if (uploaded.length) await chunkVO7OWQP6_cjs.refreshDocuments(queryClient, arbi, uploaded);
5828
5897
  } catch (e) {
5829
5898
  setUploadError(messageOf(e, "The upload failed."));
5830
5899
  } finally {
@@ -6059,7 +6128,7 @@ function useConversationDocuments() {
6059
6128
  const inConversationDocuments = chunkZZZYVNFW_cjs.useArbiSessionState(
6060
6129
  (state) => state.conversationDocuments[convKey] || EMPTY_DOCS
6061
6130
  );
6062
- const { data: documents3 = [], isLoading: isLoadingDocs } = chunkPDE246CA_cjs.useDocuments();
6131
+ const { data: documents3 = [], isLoading: isLoadingDocs } = chunkVO7OWQP6_cjs.useDocuments();
6063
6132
  const conversationDocuments = React__default.default.useMemo(() => {
6064
6133
  if (inConversationDocuments.length === 0) {
6065
6134
  return [];
@@ -6804,7 +6873,7 @@ function computeOnline(wsStatus, isAuthenticated, workOffline, wsEverConnected)
6804
6873
  }
6805
6874
  function useOnlineSync() {
6806
6875
  const session = chunkZZZYVNFW_cjs.useArbiSessionStore();
6807
- const wsStatus = chunkPDE246CA_cjs.useArbiWsStore((s) => s.status);
6876
+ const wsStatus = chunkVO7OWQP6_cjs.useArbiWsStore((s) => s.status);
6808
6877
  const signedIn2 = chunkZZZYVNFW_cjs.useArbiSession().status === "signed-in";
6809
6878
  const [workOffline] = useWorkOffline();
6810
6879
  const wsEverConnected = React.useRef(false);
@@ -6817,7 +6886,7 @@ function useOnlineSync() {
6817
6886
  React.useEffect(() => {
6818
6887
  const update2 = () => reactQuery.onlineManager.setOnline(
6819
6888
  computeOnline(
6820
- chunkPDE246CA_cjs.useArbiWsStore.getState().status,
6889
+ chunkVO7OWQP6_cjs.useArbiWsStore.getState().status,
6821
6890
  signedInRef.current,
6822
6891
  isWorkingOffline(session),
6823
6892
  wsEverConnected.current
@@ -7423,7 +7492,7 @@ async function applyMailChangesOnce(sender, isOnline) {
7423
7492
  var NO_PRIMER = () => void 0;
7424
7493
  async function sendMailFile(fetch2, prime, account, messageId, request) {
7425
7494
  const { threadId } = request;
7426
- return chunkPDE246CA_cjs.inWorkspace(prime, request.workspaceExtId, async () => {
7495
+ return chunkVO7OWQP6_cjs.inWorkspace(prime, request.workspaceExtId, async () => {
7427
7496
  if (!threadId) return browser.mail.fileMessage(fetch2, messageId, request.workspaceExtId, account.id);
7428
7497
  const { filed } = await browser.mail.fileConversation(fetch2, {
7429
7498
  accountId: account.id,
@@ -7436,7 +7505,7 @@ async function sendMailFile(fetch2, prime, account, messageId, request) {
7436
7505
  }
7437
7506
  function useMailWorkspacePrimer() {
7438
7507
  const { arbi } = chunkFE6ZSNZE_cjs.useArbiHost();
7439
- return arbi ? chunkPDE246CA_cjs.primeOnArbi(arbi) : NO_PRIMER;
7508
+ return arbi ? chunkVO7OWQP6_cjs.primeOnArbi(arbi) : NO_PRIMER;
7440
7509
  }
7441
7510
  function useMailFiling(account, messageIds, threadIds, options = {}) {
7442
7511
  const { client } = useMailClient();
@@ -7470,7 +7539,7 @@ function useSetNativeMailFiling() {
7470
7539
  const prime = useMailWorkspacePrimer();
7471
7540
  const queryClient = reactQuery.useQueryClient();
7472
7541
  return reactQuery.useMutation({
7473
- mutationFn: (input) => chunkPDE246CA_cjs.inWorkspace(prime, input.workspaceExtId, () => browser.mail.setNativeFiling(client.fetch, input)),
7542
+ mutationFn: (input) => chunkVO7OWQP6_cjs.inWorkspace(prime, input.workspaceExtId, () => browser.mail.setNativeFiling(client.fetch, input)),
7474
7543
  onSuccess: () => queryClient.invalidateQueries({ queryKey: chunkFE6ZSNZE_cjs.mailQueryKeys.allFiling() })
7475
7544
  });
7476
7545
  }
@@ -8054,7 +8123,7 @@ function liveChangeSender(arbi) {
8054
8123
  const { kind: _, ...request } = change;
8055
8124
  await sendMailFile(
8056
8125
  (p, i) => arbi.mail.fetch(p, i),
8057
- chunkPDE246CA_cjs.primeOnArbi(arbi),
8126
+ chunkVO7OWQP6_cjs.primeOnArbi(arbi),
8058
8127
  account,
8059
8128
  messageId,
8060
8129
  request
@@ -8743,7 +8812,7 @@ function applyRunFinished(queryClient, arbi, session, message, onQuotaExceeded)
8743
8812
  if (!conversationId) return;
8744
8813
  session.setConversationGenerating(conversationId, false, null);
8745
8814
  if (message.doc_ext_ids?.length) {
8746
- chunkPDE246CA_cjs.refreshDocuments(queryClient, arbi, message.doc_ext_ids).catch(
8815
+ chunkVO7OWQP6_cjs.refreshDocuments(queryClient, arbi, message.doc_ext_ids).catch(
8747
8816
  (error) => client.logger.error("[WebSocket] Failed to refresh task outputs:", error)
8748
8817
  );
8749
8818
  }
@@ -8790,6 +8859,7 @@ function signedInId(arbi) {
8790
8859
  return arbi.isLoggedIn ? arbi.user.identity()?.externalId ?? null : null;
8791
8860
  }
8792
8861
  var EVICTED_CLOSE_CODE = 1008;
8862
+ var TASK_UPDATE_FLUSH_MS = 250;
8793
8863
  function ArbiWebSocketProvider({
8794
8864
  enabled = true,
8795
8865
  onAuthenticated,
@@ -8801,11 +8871,11 @@ function ArbiWebSocketProvider({
8801
8871
  arbiRef.current = arbi;
8802
8872
  const queryClient = reactQuery.useQueryClient();
8803
8873
  const subscribersRef = React.useRef(/* @__PURE__ */ new Set());
8804
- const setStatus = chunkPDE246CA_cjs.useArbiWsStore((s) => s.setStatus);
8805
- const applyTaskUpdate = chunkPDE246CA_cjs.useArbiWsStore((s) => s.applyTaskUpdate);
8806
- const applyPresence = chunkPDE246CA_cjs.useArbiWsStore((s) => s.applyPresence);
8807
- const reset = chunkPDE246CA_cjs.useArbiWsStore((s) => s.reset);
8808
- const setEvicted = chunkPDE246CA_cjs.useArbiWsStore((s) => s.setEvicted);
8874
+ const setStatus = chunkVO7OWQP6_cjs.useArbiWsStore((s) => s.setStatus);
8875
+ const applyTaskUpdates = chunkVO7OWQP6_cjs.useArbiWsStore((s) => s.applyTaskUpdates);
8876
+ const applyPresence = chunkVO7OWQP6_cjs.useArbiWsStore((s) => s.applyPresence);
8877
+ const reset = chunkVO7OWQP6_cjs.useArbiWsStore((s) => s.reset);
8878
+ const setEvicted = chunkVO7OWQP6_cjs.useArbiWsStore((s) => s.setEvicted);
8809
8879
  const onAuthenticatedRef = React.useRef(onAuthenticated);
8810
8880
  onAuthenticatedRef.current = onAuthenticated;
8811
8881
  const handlersRef = React.useRef(handlers);
@@ -8840,13 +8910,43 @@ function ArbiWebSocketProvider({
8840
8910
  let cancelled = false;
8841
8911
  let evicted = false;
8842
8912
  const me = () => signedInId(arbiRef.current);
8913
+ const deliver = (msg) => {
8914
+ const type = msg.type;
8915
+ try {
8916
+ handlersRef.current?.[type]?.(msg);
8917
+ } catch (error) {
8918
+ client.logger.error(`[WebSocket] The host's ${type} handler failed:`, error);
8919
+ }
8920
+ for (const fn of subscribersRef.current) {
8921
+ try {
8922
+ fn(msg);
8923
+ } catch {
8924
+ }
8925
+ }
8926
+ };
8927
+ let taskBuffer = [];
8928
+ let taskTimer = null;
8929
+ const flushTasks = () => {
8930
+ if (taskTimer) clearTimeout(taskTimer);
8931
+ taskTimer = null;
8932
+ if (!taskBuffer.length) return;
8933
+ const batch = taskBuffer;
8934
+ taskBuffer = [];
8935
+ const taken = applyTaskUpdates(batch);
8936
+ if (taken.length) applyTaskEvents(queryClient, arbiRef.current, taken, me());
8937
+ for (const msg of batch) deliver(msg);
8938
+ };
8843
8939
  const onMessage = (msg) => {
8844
8940
  const type = msg.type;
8941
+ if (client.isMessageType(msg, "task_update")) {
8942
+ taskBuffer.push(msg);
8943
+ taskTimer ??= setTimeout(flushTasks, TASK_UPDATE_FLUSH_MS);
8944
+ return;
8945
+ }
8946
+ flushTasks();
8845
8947
  if (type === "connection_closed") {
8846
8948
  evicted = true;
8847
8949
  setEvicted(true);
8848
- } else if (client.isMessageType(msg, "task_update")) {
8849
- if (applyTaskUpdate(msg)) applyTaskEvent(queryClient, arbiRef.current, msg, me());
8850
8950
  } else if (client.isMessageType(msg, "presence_update")) applyPresence(msg);
8851
8951
  else if (client.isMessageType(msg, "response_complete"))
8852
8952
  applyRunFinished(
@@ -8860,12 +8960,12 @@ function ArbiWebSocketProvider({
8860
8960
  client.logger.error("[WebSocket] Server error:", msg.message);
8861
8961
  else if (client.isMessageType(msg, "batch_complete")) {
8862
8962
  if (msg.batch_type === "entity_extract") {
8863
- chunkPDE246CA_cjs.finishEntityExtraction(msg.doc_ext_ids ?? []);
8963
+ chunkVO7OWQP6_cjs.finishEntityExtraction(msg.doc_ext_ids ?? []);
8864
8964
  void queryClient.invalidateQueries({ queryKey: chunkFE6ZSNZE_cjs.arbiQueryKeys.allFacts() });
8865
8965
  }
8866
8966
  if (msg.batch_type === "upload" || msg.batch_type === "entity_extract") {
8867
8967
  if (msg.doc_ext_ids?.length)
8868
- void chunkPDE246CA_cjs.refreshDocuments(queryClient, arbiRef.current, msg.doc_ext_ids);
8968
+ chunkVO7OWQP6_cjs.queueDocumentReads(queryClient, arbiRef.current, msg.doc_ext_ids);
8869
8969
  void queryClient.invalidateQueries({ queryKey: chunkFE6ZSNZE_cjs.arbiQueryKeys.allTags() });
8870
8970
  }
8871
8971
  } else if (type.startsWith("chat.") || type === "agent_dm_status")
@@ -8874,17 +8974,7 @@ function ArbiWebSocketProvider({
8874
8974
  chunk26SZ3DS4_cjs.applyCallEvent(queryClient, msg, { me: me(), acceptRings: acceptRingsRef.current });
8875
8975
  else if (isNotificationRow(msg)) applyNotificationRow(queryClient, msg, me());
8876
8976
  else void applyLiveUpdate(queryClient, msg);
8877
- try {
8878
- handlersRef.current?.[type]?.(msg);
8879
- } catch (error) {
8880
- client.logger.error(`[WebSocket] The host's ${type} handler failed:`, error);
8881
- }
8882
- for (const fn of subscribersRef.current) {
8883
- try {
8884
- fn(msg);
8885
- } catch {
8886
- }
8887
- }
8977
+ deliver(msg);
8888
8978
  };
8889
8979
  let retryTimer2 = null;
8890
8980
  let attempt3 = 0;
@@ -8957,11 +9047,12 @@ function ArbiWebSocketProvider({
8957
9047
  void start();
8958
9048
  return () => {
8959
9049
  cancelled = true;
9050
+ if (taskTimer) clearTimeout(taskTimer);
8960
9051
  if (retryTimer2) clearTimeout(retryTimer2);
8961
9052
  conn?.close();
8962
9053
  reset();
8963
9054
  };
8964
- }, [enabled, queryClient, setStatus, setEvicted, applyTaskUpdate, applyPresence, reset]);
9055
+ }, [enabled, queryClient, setStatus, setEvicted, applyTaskUpdates, applyPresence, reset]);
8965
9056
  return /* @__PURE__ */ jsxRuntime.jsx(ArbiWsContext.Provider, { value: context, children });
8966
9057
  }
8967
9058
  function useArbiWebSocket(onMessage) {
@@ -8982,7 +9073,7 @@ function useArbiWsMessage(type, handler) {
8982
9073
  );
8983
9074
  }
8984
9075
  function useArbiWsStatus() {
8985
- return chunkPDE246CA_cjs.useArbiWsStore((s) => s.status);
9076
+ return chunkVO7OWQP6_cjs.useArbiWsStore((s) => s.status);
8986
9077
  }
8987
9078
 
8988
9079
  // src/workspaces/shell-workspaces.ts
@@ -10798,7 +10889,7 @@ function createDocumentsSource(labels) {
10798
10889
  description: l.description,
10799
10890
  useFields: staticFields(fields),
10800
10891
  useRows(params, enabled) {
10801
- const query = chunkPDE246CA_cjs.useDocuments(workspaceOf2(params), { enabled });
10892
+ const query = chunkVO7OWQP6_cjs.useDocuments(workspaceOf2(params), { enabled });
10802
10893
  const nameOf = useNames(enabled);
10803
10894
  const rows = React.useMemo(
10804
10895
  () => query.data?.map((d) => ({
@@ -11596,9 +11687,16 @@ var IDB_KEY = "arbi-react-query-cache";
11596
11687
  var OWNER_KEY = "arbi-react-query-cache-owner";
11597
11688
  var CACHE_BUSTER = "arbi-rq-v2";
11598
11689
  var MAX_AGE = 1e3 * 60 * 60 * 24 * 7;
11690
+ var PERSIST_THROTTLE_MS = 1e3;
11599
11691
  function createIDBPersister() {
11692
+ const write3 = throttle((client) => {
11693
+ void withStorage(() => idbKeyval.set(IDB_KEY, client));
11694
+ }, PERSIST_THROTTLE_MS);
11695
+ if (typeof window !== "undefined") window.addEventListener("pagehide", () => write3.flush());
11600
11696
  return {
11601
- persistClient: (client) => withStorage(() => idbKeyval.set(IDB_KEY, client)),
11697
+ persistClient: async (client) => {
11698
+ write3(client);
11699
+ },
11602
11700
  // The offline persister must be INERT when online. Because the documents
11603
11701
  // list never auto-refetches, a rehydrated copy would be trusted
11604
11702
  // indefinitely and surface stale statuses across a reload — e.g. a document
@@ -11620,7 +11718,10 @@ function createIDBPersister() {
11620
11718
  );
11621
11719
  return persisted;
11622
11720
  },
11623
- removeClient: () => withStorage(() => idbKeyval.del(IDB_KEY))
11721
+ removeClient: () => {
11722
+ write3.cancel();
11723
+ return withStorage(() => idbKeyval.del(IDB_KEY));
11724
+ }
11624
11725
  };
11625
11726
  }
11626
11727
  async function claimOfflineQueue(userExtId) {
@@ -14639,7 +14740,7 @@ function useCalendarOfflineRuntime() {
14639
14740
  }, [ready, arbi, queryClient]);
14640
14741
  }
14641
14742
  function useWorkspaceDocs(workspaceId) {
14642
- const { data: docs = [], isLoading, isError } = chunkPDE246CA_cjs.useDocuments(workspaceId);
14743
+ const { data: docs = [], isLoading, isError } = chunkVO7OWQP6_cjs.useDocuments(workspaceId);
14643
14744
  const docIds = React.useMemo(
14644
14745
  () => docs.map((d) => d.external_id).filter((id) => !!id),
14645
14746
  [docs]
@@ -16466,7 +16567,7 @@ function isAgentUser(user) {
16466
16567
  return user.external_id.startsWith("agt-");
16467
16568
  }
16468
16569
  function DmAvatar({ user, className, size = "lg" }) {
16469
- const presence = chunkPDE246CA_cjs.useArbiWsStore((s) => s.presence[user.external_id]);
16570
+ const presence = chunkVO7OWQP6_cjs.useArbiWsStore((s) => s.presence[user.external_id]);
16470
16571
  const displayStatus = presence === void 0 ? void 0 : presence === "online" ? "connected" : "disconnected";
16471
16572
  return /* @__PURE__ */ jsxRuntime.jsx(
16472
16573
  chunk4NGWDVHD_cjs.UserEntity,
@@ -18138,187 +18239,187 @@ Object.defineProperty(exports, "writeSamples", {
18138
18239
  });
18139
18240
  Object.defineProperty(exports, "DISMISSED_TASK_TTL_MS", {
18140
18241
  enumerable: true,
18141
- get: function () { return chunkPDE246CA_cjs.DISMISSED_TASK_TTL_MS; }
18242
+ get: function () { return chunkVO7OWQP6_cjs.DISMISSED_TASK_TTL_MS; }
18142
18243
  });
18143
18244
  Object.defineProperty(exports, "DOCUMENTS_FIRST_PAGE_MEASURE", {
18144
18245
  enumerable: true,
18145
- get: function () { return chunkPDE246CA_cjs.DOCUMENTS_FIRST_PAGE_MEASURE; }
18246
+ get: function () { return chunkVO7OWQP6_cjs.DOCUMENTS_FIRST_PAGE_MEASURE; }
18146
18247
  });
18147
18248
  Object.defineProperty(exports, "DOCUMENTS_FIRST_PAGE_SIZE", {
18148
18249
  enumerable: true,
18149
- get: function () { return chunkPDE246CA_cjs.DOCUMENTS_FIRST_PAGE_SIZE; }
18250
+ get: function () { return chunkVO7OWQP6_cjs.DOCUMENTS_FIRST_PAGE_SIZE; }
18150
18251
  });
18151
18252
  Object.defineProperty(exports, "DOCUMENTS_PAGE_SIZE", {
18152
18253
  enumerable: true,
18153
- get: function () { return chunkPDE246CA_cjs.DOCUMENTS_PAGE_SIZE; }
18254
+ get: function () { return chunkVO7OWQP6_cjs.DOCUMENTS_PAGE_SIZE; }
18154
18255
  });
18155
18256
  Object.defineProperty(exports, "FINISHED_DOCUMENT_STATUSES", {
18156
18257
  enumerable: true,
18157
- get: function () { return chunkPDE246CA_cjs.FINISHED_DOCUMENT_STATUSES; }
18258
+ get: function () { return chunkVO7OWQP6_cjs.FINISHED_DOCUMENT_STATUSES; }
18158
18259
  });
18159
18260
  Object.defineProperty(exports, "IN_FLIGHT_DOCUMENT_STATUSES", {
18160
18261
  enumerable: true,
18161
- get: function () { return chunkPDE246CA_cjs.IN_FLIGHT_DOCUMENT_STATUSES; }
18262
+ get: function () { return chunkVO7OWQP6_cjs.IN_FLIGHT_DOCUMENT_STATUSES; }
18162
18263
  });
18163
18264
  Object.defineProperty(exports, "SIMILARITY_THRESHOLD", {
18164
18265
  enumerable: true,
18165
- get: function () { return chunkPDE246CA_cjs.SIMILARITY_THRESHOLD; }
18266
+ get: function () { return chunkVO7OWQP6_cjs.SIMILARITY_THRESHOLD; }
18166
18267
  });
18167
18268
  Object.defineProperty(exports, "adjustTagCounts", {
18168
18269
  enumerable: true,
18169
- get: function () { return chunkPDE246CA_cjs.adjustTagCounts; }
18270
+ get: function () { return chunkVO7OWQP6_cjs.adjustTagCounts; }
18170
18271
  });
18171
18272
  Object.defineProperty(exports, "dropTagFromCachedDocuments", {
18172
18273
  enumerable: true,
18173
- get: function () { return chunkPDE246CA_cjs.dropTagFromCachedDocuments; }
18274
+ get: function () { return chunkVO7OWQP6_cjs.dropTagFromCachedDocuments; }
18174
18275
  });
18175
18276
  Object.defineProperty(exports, "finishEntityExtraction", {
18176
18277
  enumerable: true,
18177
- get: function () { return chunkPDE246CA_cjs.finishEntityExtraction; }
18278
+ get: function () { return chunkVO7OWQP6_cjs.finishEntityExtraction; }
18178
18279
  });
18179
18280
  Object.defineProperty(exports, "flushDocumentForTurn", {
18180
18281
  enumerable: true,
18181
- get: function () { return chunkPDE246CA_cjs.flushDocumentForTurn; }
18282
+ get: function () { return chunkVO7OWQP6_cjs.flushDocumentForTurn; }
18182
18283
  });
18183
18284
  Object.defineProperty(exports, "forgetDocuments", {
18184
18285
  enumerable: true,
18185
- get: function () { return chunkPDE246CA_cjs.forgetDocuments; }
18286
+ get: function () { return chunkVO7OWQP6_cjs.forgetDocuments; }
18186
18287
  });
18187
18288
  Object.defineProperty(exports, "getCachedDocuments", {
18188
18289
  enumerable: true,
18189
- get: function () { return chunkPDE246CA_cjs.getCachedDocuments; }
18290
+ get: function () { return chunkVO7OWQP6_cjs.getCachedDocuments; }
18190
18291
  });
18191
18292
  Object.defineProperty(exports, "invalidateTagData", {
18192
18293
  enumerable: true,
18193
- get: function () { return chunkPDE246CA_cjs.invalidateTagData; }
18294
+ get: function () { return chunkVO7OWQP6_cjs.invalidateTagData; }
18194
18295
  });
18195
18296
  Object.defineProperty(exports, "invalidateTagTables", {
18196
18297
  enumerable: true,
18197
- get: function () { return chunkPDE246CA_cjs.invalidateTagTables; }
18298
+ get: function () { return chunkVO7OWQP6_cjs.invalidateTagTables; }
18198
18299
  });
18199
18300
  Object.defineProperty(exports, "isDocumentsLoading", {
18200
18301
  enumerable: true,
18201
- get: function () { return chunkPDE246CA_cjs.isDocumentsLoading; }
18302
+ get: function () { return chunkVO7OWQP6_cjs.isDocumentsLoading; }
18202
18303
  });
18203
18304
  Object.defineProperty(exports, "isRowNewer", {
18204
18305
  enumerable: true,
18205
- get: function () { return chunkPDE246CA_cjs.isRowNewer; }
18306
+ get: function () { return chunkVO7OWQP6_cjs.isRowNewer; }
18206
18307
  });
18207
18308
  Object.defineProperty(exports, "isStaleTaskUpdate", {
18208
18309
  enumerable: true,
18209
- get: function () { return chunkPDE246CA_cjs.isStaleTaskUpdate; }
18310
+ get: function () { return chunkVO7OWQP6_cjs.isStaleTaskUpdate; }
18210
18311
  });
18211
18312
  Object.defineProperty(exports, "patchCachedDocument", {
18212
18313
  enumerable: true,
18213
- get: function () { return chunkPDE246CA_cjs.patchCachedDocument; }
18314
+ get: function () { return chunkVO7OWQP6_cjs.patchCachedDocument; }
18214
18315
  });
18215
18316
  Object.defineProperty(exports, "patchDocuments", {
18216
18317
  enumerable: true,
18217
- get: function () { return chunkPDE246CA_cjs.patchDocuments; }
18318
+ get: function () { return chunkVO7OWQP6_cjs.patchDocuments; }
18218
18319
  });
18219
18320
  Object.defineProperty(exports, "patchWorkspaceTags", {
18220
18321
  enumerable: true,
18221
- get: function () { return chunkPDE246CA_cjs.patchWorkspaceTags; }
18322
+ get: function () { return chunkVO7OWQP6_cjs.patchWorkspaceTags; }
18222
18323
  });
18223
18324
  Object.defineProperty(exports, "refreshDocuments", {
18224
18325
  enumerable: true,
18225
- get: function () { return chunkPDE246CA_cjs.refreshDocuments; }
18326
+ get: function () { return chunkVO7OWQP6_cjs.refreshDocuments; }
18226
18327
  });
18227
18328
  Object.defineProperty(exports, "registerDocumentTurnFlush", {
18228
18329
  enumerable: true,
18229
- get: function () { return chunkPDE246CA_cjs.registerDocumentTurnFlush; }
18330
+ get: function () { return chunkVO7OWQP6_cjs.registerDocumentTurnFlush; }
18230
18331
  });
18231
18332
  Object.defineProperty(exports, "resolveDocumentStatus", {
18232
18333
  enumerable: true,
18233
- get: function () { return chunkPDE246CA_cjs.resolveDocumentStatus; }
18334
+ get: function () { return chunkVO7OWQP6_cjs.resolveDocumentStatus; }
18234
18335
  });
18235
18336
  Object.defineProperty(exports, "setCachedDocument", {
18236
18337
  enumerable: true,
18237
- get: function () { return chunkPDE246CA_cjs.setCachedDocument; }
18338
+ get: function () { return chunkVO7OWQP6_cjs.setCachedDocument; }
18238
18339
  });
18239
18340
  Object.defineProperty(exports, "settledByRows", {
18240
18341
  enumerable: true,
18241
- get: function () { return chunkPDE246CA_cjs.settledByRows; }
18342
+ get: function () { return chunkVO7OWQP6_cjs.settledByRows; }
18242
18343
  });
18243
18344
  Object.defineProperty(exports, "startEntityExtraction", {
18244
18345
  enumerable: true,
18245
- get: function () { return chunkPDE246CA_cjs.startEntityExtraction; }
18346
+ get: function () { return chunkVO7OWQP6_cjs.startEntityExtraction; }
18246
18347
  });
18247
18348
  Object.defineProperty(exports, "stopDocumentsLoading", {
18248
18349
  enumerable: true,
18249
- get: function () { return chunkPDE246CA_cjs.stopDocumentsLoading; }
18350
+ get: function () { return chunkVO7OWQP6_cjs.stopDocumentsLoading; }
18250
18351
  });
18251
18352
  Object.defineProperty(exports, "subscribeDocumentRows", {
18252
18353
  enumerable: true,
18253
- get: function () { return chunkPDE246CA_cjs.subscribeDocumentRows; }
18354
+ get: function () { return chunkVO7OWQP6_cjs.subscribeDocumentRows; }
18254
18355
  });
18255
18356
  Object.defineProperty(exports, "upsertDocuments", {
18256
18357
  enumerable: true,
18257
- get: function () { return chunkPDE246CA_cjs.upsertDocuments; }
18358
+ get: function () { return chunkVO7OWQP6_cjs.upsertDocuments; }
18258
18359
  });
18259
18360
  Object.defineProperty(exports, "useArbiWsStore", {
18260
18361
  enumerable: true,
18261
- get: function () { return chunkPDE246CA_cjs.useArbiWsStore; }
18362
+ get: function () { return chunkVO7OWQP6_cjs.useArbiWsStore; }
18262
18363
  });
18263
18364
  Object.defineProperty(exports, "useCreateTag", {
18264
18365
  enumerable: true,
18265
- get: function () { return chunkPDE246CA_cjs.useCreateTag; }
18366
+ get: function () { return chunkVO7OWQP6_cjs.useCreateTag; }
18266
18367
  });
18267
18368
  Object.defineProperty(exports, "useDeleteTag", {
18268
18369
  enumerable: true,
18269
- get: function () { return chunkPDE246CA_cjs.useDeleteTag; }
18370
+ get: function () { return chunkVO7OWQP6_cjs.useDeleteTag; }
18270
18371
  });
18271
18372
  Object.defineProperty(exports, "useDocument", {
18272
18373
  enumerable: true,
18273
- get: function () { return chunkPDE246CA_cjs.useDocument; }
18374
+ get: function () { return chunkVO7OWQP6_cjs.useDocument; }
18274
18375
  });
18275
18376
  Object.defineProperty(exports, "useDocuments", {
18276
18377
  enumerable: true,
18277
- get: function () { return chunkPDE246CA_cjs.useDocuments; }
18378
+ get: function () { return chunkVO7OWQP6_cjs.useDocuments; }
18278
18379
  });
18279
18380
  Object.defineProperty(exports, "useDocumentsLoading", {
18280
18381
  enumerable: true,
18281
- get: function () { return chunkPDE246CA_cjs.useDocumentsLoading; }
18382
+ get: function () { return chunkVO7OWQP6_cjs.useDocumentsLoading; }
18282
18383
  });
18283
18384
  Object.defineProperty(exports, "useEntityExtractionDocIds", {
18284
18385
  enumerable: true,
18285
- get: function () { return chunkPDE246CA_cjs.useEntityExtractionDocIds; }
18386
+ get: function () { return chunkVO7OWQP6_cjs.useEntityExtractionDocIds; }
18286
18387
  });
18287
18388
  Object.defineProperty(exports, "useExtractEntities", {
18288
18389
  enumerable: true,
18289
- get: function () { return chunkPDE246CA_cjs.useExtractEntities; }
18390
+ get: function () { return chunkVO7OWQP6_cjs.useExtractEntities; }
18290
18391
  });
18291
18392
  Object.defineProperty(exports, "useInvalidateTagData", {
18292
18393
  enumerable: true,
18293
- get: function () { return chunkPDE246CA_cjs.useInvalidateTagData; }
18394
+ get: function () { return chunkVO7OWQP6_cjs.useInvalidateTagData; }
18294
18395
  });
18295
18396
  Object.defineProperty(exports, "useIsCreatingTag", {
18296
18397
  enumerable: true,
18297
- get: function () { return chunkPDE246CA_cjs.useIsCreatingTag; }
18398
+ get: function () { return chunkVO7OWQP6_cjs.useIsCreatingTag; }
18298
18399
  });
18299
18400
  Object.defineProperty(exports, "useRefreshDocuments", {
18300
18401
  enumerable: true,
18301
- get: function () { return chunkPDE246CA_cjs.useRefreshDocuments; }
18402
+ get: function () { return chunkVO7OWQP6_cjs.useRefreshDocuments; }
18302
18403
  });
18303
18404
  Object.defineProperty(exports, "useSetTagValues", {
18304
18405
  enumerable: true,
18305
- get: function () { return chunkPDE246CA_cjs.useSetTagValues; }
18406
+ get: function () { return chunkVO7OWQP6_cjs.useSetTagValues; }
18306
18407
  });
18307
18408
  Object.defineProperty(exports, "useSimilarDocuments", {
18308
18409
  enumerable: true,
18309
- get: function () { return chunkPDE246CA_cjs.useSimilarDocuments; }
18410
+ get: function () { return chunkVO7OWQP6_cjs.useSimilarDocuments; }
18310
18411
  });
18311
18412
  Object.defineProperty(exports, "useTagKindSchema", {
18312
18413
  enumerable: true,
18313
- get: function () { return chunkPDE246CA_cjs.useTagKindSchema; }
18414
+ get: function () { return chunkVO7OWQP6_cjs.useTagKindSchema; }
18314
18415
  });
18315
18416
  Object.defineProperty(exports, "useUpdateTag", {
18316
18417
  enumerable: true,
18317
- get: function () { return chunkPDE246CA_cjs.useUpdateTag; }
18418
+ get: function () { return chunkVO7OWQP6_cjs.useUpdateTag; }
18318
18419
  });
18319
18420
  Object.defineProperty(exports, "useUpdateTagKindSchema", {
18320
18421
  enumerable: true,
18321
- get: function () { return chunkPDE246CA_cjs.useUpdateTagKindSchema; }
18422
+ get: function () { return chunkVO7OWQP6_cjs.useUpdateTagKindSchema; }
18322
18423
  });
18323
18424
  Object.defineProperty(exports, "DEFAULT_DOCUMENT_VIEWER_STATE", {
18324
18425
  enumerable: true,
@@ -20072,7 +20173,7 @@ exports.applyLiveUpdate = applyLiveUpdate;
20072
20173
  exports.applyNotificationRow = applyNotificationRow;
20073
20174
  exports.applyOptimisticDocumentEdit = applyOptimisticDocumentEdit;
20074
20175
  exports.applyOutputItemToMessage = applyOutputItemToMessage;
20075
- exports.applyTaskEvent = applyTaskEvent;
20176
+ exports.applyTaskEvents = applyTaskEvents;
20076
20177
  exports.arbiMailClient = arbiMailClient;
20077
20178
  exports.archiveName = archiveName;
20078
20179
  exports.archivedWorkspaceMessage = archivedWorkspaceMessage;