@arbidocs/blocks 0.4.70 → 0.4.72

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 (179) hide show
  1. package/README.md +90 -14
  2. package/bin/arbidocs-copy-pdf-assets.mjs +112 -0
  3. package/dist/{StreamedArtifactEditor-OPL4KXOT.js → StreamedArtifactEditor-HTNPG4NB.js} +3 -2
  4. package/dist/StreamedArtifactEditor-HTNPG4NB.js.map +1 -0
  5. package/dist/{StreamedArtifactEditor-RIKG6CJQ.cjs → StreamedArtifactEditor-IZWYNFMM.cjs} +3 -2
  6. package/dist/StreamedArtifactEditor-IZWYNFMM.cjs.map +1 -0
  7. package/dist/agents/index.cjs +224 -224
  8. package/dist/agents/index.js +8 -8
  9. package/dist/artifacts/editor/index.cjs +1 -0
  10. package/dist/artifacts/editor/index.js +1 -0
  11. package/dist/artifacts/index.cjs +1 -0
  12. package/dist/artifacts/index.js +1 -0
  13. package/dist/auth/index.cjs +1 -0
  14. package/dist/auth/index.js +1 -0
  15. package/dist/calendar/CalendarGrid.d.ts +2 -0
  16. package/dist/calendar/CalendarList.d.ts +2 -0
  17. package/dist/calendar/CalendarSettingsForm.d.ts +2 -0
  18. package/dist/calendar/EventDetails.d.ts +2 -0
  19. package/dist/calendar/EventEditor.d.ts +2 -0
  20. package/dist/calendar/MiniMonth.d.ts +2 -0
  21. package/dist/calendar/RecurrenceEditor.d.ts +13 -0
  22. package/dist/calendar/RoomFinder.d.ts +2 -0
  23. package/dist/calendar/SchedulingAssistant.d.ts +2 -0
  24. package/dist/calendar/ScopeDialog.d.ts +2 -0
  25. package/dist/calendar/TimeZonePicker.d.ts +2 -0
  26. package/dist/calendar/colors.d.ts +4 -0
  27. package/dist/calendar/draft.d.ts +43 -0
  28. package/dist/calendar/format.d.ts +14 -0
  29. package/dist/calendar/grid-model.d.ts +24 -0
  30. package/dist/calendar/index.cjs +4122 -0
  31. package/dist/calendar/index.cjs.map +1 -0
  32. package/dist/calendar/index.d.ts +30 -0
  33. package/dist/calendar/index.js +4043 -0
  34. package/dist/calendar/index.js.map +1 -0
  35. package/dist/calendar/labels.d.ts +4 -0
  36. package/dist/calendar/recurrence-labels.d.ts +22 -0
  37. package/dist/calendar/recurrence.d.ts +66 -0
  38. package/dist/calendar/reminders.d.ts +26 -0
  39. package/dist/calendar/scheduling.d.ts +27 -0
  40. package/dist/calendar/types.d.ts +605 -0
  41. package/dist/calendar/ui.d.ts +16 -0
  42. package/dist/calendar/zone.d.ts +56 -0
  43. package/dist/chat/index.cjs +124 -123
  44. package/dist/chat/index.js +4 -3
  45. package/dist/{chunk-XNRGCQPZ.cjs → chunk-3SFFTSOI.cjs} +5 -5
  46. package/dist/{chunk-XNRGCQPZ.cjs.map → chunk-3SFFTSOI.cjs.map} +1 -1
  47. package/dist/{chunk-EHXSBH6U.js → chunk-5HOAOKZL.js} +4 -2
  48. package/dist/chunk-5HOAOKZL.js.map +1 -0
  49. package/dist/{chunk-7WM62NMM.cjs → chunk-6OL5S7MJ.cjs} +5 -2
  50. package/dist/chunk-6OL5S7MJ.cjs.map +1 -0
  51. package/dist/{chunk-VUEZARW5.cjs → chunk-B3WCKBJ7.cjs} +278 -5
  52. package/dist/chunk-B3WCKBJ7.cjs.map +1 -0
  53. package/dist/{chunk-L5UPP2HC.js → chunk-D46ZAPEE.js} +5 -2
  54. package/dist/chunk-D46ZAPEE.js.map +1 -0
  55. package/dist/chunk-DES3K4SD.cjs +18 -0
  56. package/dist/chunk-DES3K4SD.cjs.map +1 -0
  57. package/dist/{chunk-7M22KND4.cjs → chunk-DH7C2UJO.cjs} +10 -10
  58. package/dist/{chunk-7M22KND4.cjs.map → chunk-DH7C2UJO.cjs.map} +1 -1
  59. package/dist/{chunk-CXWESDIZ.cjs → chunk-F4RUCUXF.cjs} +6 -6
  60. package/dist/{chunk-CXWESDIZ.cjs.map → chunk-F4RUCUXF.cjs.map} +1 -1
  61. package/dist/{chunk-DABEWNL2.js → chunk-G5DP27DU.js} +3 -3
  62. package/dist/{chunk-DABEWNL2.js.map → chunk-G5DP27DU.js.map} +1 -1
  63. package/dist/{chunk-BR2CPKFU.cjs → chunk-G5QTGKDJ.cjs} +8 -8
  64. package/dist/{chunk-BR2CPKFU.cjs.map → chunk-G5QTGKDJ.cjs.map} +1 -1
  65. package/dist/{chunk-VZGBCBYB.js → chunk-GJV2G4FC.js} +276 -7
  66. package/dist/chunk-GJV2G4FC.js.map +1 -0
  67. package/dist/{chunk-HLMFU7L2.js → chunk-IMC2Z32C.js} +8 -8
  68. package/dist/{chunk-HLMFU7L2.js.map → chunk-IMC2Z32C.js.map} +1 -1
  69. package/dist/{chunk-5DM6VU4L.cjs → chunk-KJ3QEKOJ.cjs} +3 -3
  70. package/dist/{chunk-5DM6VU4L.cjs.map → chunk-KJ3QEKOJ.cjs.map} +1 -1
  71. package/dist/{chunk-CW4WXGEN.js → chunk-KOXUBCLL.js} +4 -4
  72. package/dist/{chunk-CW4WXGEN.js.map → chunk-KOXUBCLL.js.map} +1 -1
  73. package/dist/{chunk-ILGHS6ZV.js → chunk-SB5ZKOYN.js} +3 -3
  74. package/dist/{chunk-ILGHS6ZV.js.map → chunk-SB5ZKOYN.js.map} +1 -1
  75. package/dist/{chunk-TLQQV7WW.cjs → chunk-THO7DZNN.cjs} +4 -2
  76. package/dist/chunk-THO7DZNN.cjs.map +1 -0
  77. package/dist/{chunk-CPMNAJLF.js → chunk-TX2ZICS7.js} +24 -4
  78. package/dist/chunk-TX2ZICS7.js.map +1 -0
  79. package/dist/{chunk-2ZTONLT5.cjs → chunk-ULWRNGGE.cjs} +25 -4
  80. package/dist/chunk-ULWRNGGE.cjs.map +1 -0
  81. package/dist/{chunk-BMWZTNZB.js → chunk-VRPRAU3J.js} +3 -3
  82. package/dist/{chunk-BMWZTNZB.js.map → chunk-VRPRAU3J.js.map} +1 -1
  83. package/dist/chunk-VUNV25KB.js +15 -0
  84. package/dist/chunk-VUNV25KB.js.map +1 -0
  85. package/dist/citations/index.cjs +1 -0
  86. package/dist/citations/index.js +1 -0
  87. package/dist/collaboration/index.cjs +45 -45
  88. package/dist/collaboration/index.js +3 -3
  89. package/dist/connect/docx.cjs +3 -2
  90. package/dist/connect/docx.cjs.map +1 -1
  91. package/dist/connect/docx.js +2 -1
  92. package/dist/connect/docx.js.map +1 -1
  93. package/dist/connect/index.cjs +79 -49
  94. package/dist/connect/index.cjs.map +1 -1
  95. package/dist/connect/index.d.ts +1 -1
  96. package/dist/connect/index.js +39 -11
  97. package/dist/connect/index.js.map +1 -1
  98. package/dist/connection/ConnectedSettings.d.ts +13 -0
  99. package/dist/connection/ConnectionProvider.d.ts +5 -0
  100. package/dist/connection/types.d.ts +6 -0
  101. package/dist/document-tools/SignatureStatus.d.ts +4 -2
  102. package/dist/document-tools/index.cjs +14 -11
  103. package/dist/document-tools/index.cjs.map +1 -1
  104. package/dist/document-tools/index.js +12 -9
  105. package/dist/document-tools/index.js.map +1 -1
  106. package/dist/document-tools/production/ProductionSetDialog.d.ts +23 -0
  107. package/dist/document-tools/production/index.cjs +102 -0
  108. package/dist/document-tools/production/index.cjs.map +1 -0
  109. package/dist/document-tools/production/index.d.ts +1 -0
  110. package/dist/document-tools/production/index.js +100 -0
  111. package/dist/document-tools/production/index.js.map +1 -0
  112. package/dist/document-tools/viewer/index.cjs +1 -1
  113. package/dist/document-tools/viewer/index.js +1 -1
  114. package/dist/docx/index.cjs +1 -0
  115. package/dist/docx/index.cjs.map +1 -1
  116. package/dist/docx/index.js +1 -0
  117. package/dist/docx/index.js.map +1 -1
  118. package/dist/facts/index.cjs +3 -2
  119. package/dist/facts/index.cjs.map +1 -1
  120. package/dist/facts/index.js +3 -2
  121. package/dist/facts/index.js.map +1 -1
  122. package/dist/files/import/index.d.ts +0 -1
  123. package/dist/files/index.cjs +25 -88
  124. package/dist/files/index.cjs.map +1 -1
  125. package/dist/files/index.js +7 -68
  126. package/dist/files/index.js.map +1 -1
  127. package/dist/home/index.cjs +2 -1
  128. package/dist/home/index.cjs.map +1 -1
  129. package/dist/home/index.js +2 -1
  130. package/dist/home/index.js.map +1 -1
  131. package/dist/index.cjs +537 -537
  132. package/dist/index.js +14 -14
  133. package/dist/lib-6QPUXAQS.cjs +9674 -0
  134. package/dist/lib-6QPUXAQS.cjs.map +1 -0
  135. package/dist/lib-NRGL2JGF.js +9672 -0
  136. package/dist/lib-NRGL2JGF.js.map +1 -0
  137. package/dist/retrieval/index.cjs +1 -0
  138. package/dist/retrieval/index.js +1 -0
  139. package/dist/settings/Billing.d.ts +4 -0
  140. package/dist/settings/IdentityVerification.d.ts +83 -0
  141. package/dist/settings/PlanBadge.d.ts +2 -2
  142. package/dist/settings/PlanCard.d.ts +6 -1
  143. package/dist/settings/ProfileCard.d.ts +5 -1
  144. package/dist/settings/SubscriptionParts.d.ts +6 -2
  145. package/dist/settings/index.cjs +129 -95
  146. package/dist/settings/index.cjs.map +1 -1
  147. package/dist/settings/index.d.ts +1 -0
  148. package/dist/settings/index.js +65 -47
  149. package/dist/settings/index.js.map +1 -1
  150. package/dist/shell/ActionCluster.d.ts +3 -1
  151. package/dist/shell/index.cjs +56 -55
  152. package/dist/shell/index.js +4 -3
  153. package/dist/site/index.cjs +1 -0
  154. package/dist/site/index.js +1 -0
  155. package/dist/studio/index.cjs +8 -7
  156. package/dist/studio/index.cjs.map +1 -1
  157. package/dist/studio/index.js +6 -5
  158. package/dist/studio/index.js.map +1 -1
  159. package/dist/timeline/index.cjs +1 -0
  160. package/dist/timeline/index.js +1 -0
  161. package/dist/workspaces/index.cjs +3 -3
  162. package/dist/workspaces/index.js +2 -2
  163. package/package.json +35 -5
  164. package/src/calendar/calendar.css +316 -0
  165. package/dist/StreamedArtifactEditor-OPL4KXOT.js.map +0 -1
  166. package/dist/StreamedArtifactEditor-RIKG6CJQ.cjs.map +0 -1
  167. package/dist/chunk-2ZTONLT5.cjs.map +0 -1
  168. package/dist/chunk-7WM62NMM.cjs.map +0 -1
  169. package/dist/chunk-CPMNAJLF.js.map +0 -1
  170. package/dist/chunk-DCDVWPMB.cjs +0 -29
  171. package/dist/chunk-DCDVWPMB.cjs.map +0 -1
  172. package/dist/chunk-EHXSBH6U.js.map +0 -1
  173. package/dist/chunk-L5UPP2HC.js.map +0 -1
  174. package/dist/chunk-TJMKFY5P.js +0 -27
  175. package/dist/chunk-TJMKFY5P.js.map +0 -1
  176. package/dist/chunk-TLQQV7WW.cjs.map +0 -1
  177. package/dist/chunk-VUEZARW5.cjs.map +0 -1
  178. package/dist/chunk-VZGBCBYB.js.map +0 -1
  179. package/dist/files/import/CalendarImportRow.d.ts +0 -26
@@ -1,14 +1,14 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
- var chunk5DM6VU4L_cjs = require('./chunk-5DM6VU4L.cjs');
5
- var chunkTLQQV7WW_cjs = require('./chunk-TLQQV7WW.cjs');
4
+ var chunkTHO7DZNN_cjs = require('./chunk-THO7DZNN.cjs');
5
+ var chunkKJ3QEKOJ_cjs = require('./chunk-KJ3QEKOJ.cjs');
6
6
  var react$1 = require('react');
7
7
  var react = require('@arbidocs/react');
8
8
  var jsxRuntime = require('react/jsx-runtime');
9
9
 
10
10
  function useConnectedAiTask() {
11
- const { assistantConfig } = chunkTLQQV7WW_cjs.useConnection();
11
+ const { assistantConfig } = chunkTHO7DZNN_cjs.useConnection();
12
12
  const task = react.useAiTask();
13
13
  const kitRun = task.run;
14
14
  const run = react$1.useCallback(
@@ -18,7 +18,7 @@ function useConnectedAiTask() {
18
18
  return { ...task, run };
19
19
  }
20
20
  function useWorkspaceDocs() {
21
- const { workspaceId, fallbackWorkspaceId } = chunkTLQQV7WW_cjs.useConnection();
21
+ const { workspaceId, fallbackWorkspaceId } = chunkTHO7DZNN_cjs.useConnection();
22
22
  return react.useWorkspaceDocs(workspaceId ?? fallbackWorkspaceId);
23
23
  }
24
24
  function useSemanticSearch() {
@@ -26,7 +26,7 @@ function useSemanticSearch() {
26
26
  return react.useSemanticSearch(docIds);
27
27
  }
28
28
  function useConnectedChat(options) {
29
- const { workspaceId, fallbackWorkspaceId, assistantConfig, user, status, ensureWorkspaceOpen } = chunkTLQQV7WW_cjs.useConnection();
29
+ const { workspaceId, fallbackWorkspaceId, assistantConfig, user, status, ensureWorkspaceOpen } = chunkTHO7DZNN_cjs.useConnection();
30
30
  const wsId = workspaceId ?? fallbackWorkspaceId;
31
31
  const { data: members = [] } = react.useWorkspaceUsers(wsId, {
32
32
  enabled: status === "authenticated" && !!wsId,
@@ -61,7 +61,7 @@ function useConnectedChat(options) {
61
61
  }
62
62
  function ConnectedAssistantDock(props) {
63
63
  const chat = useConnectedChat();
64
- return /* @__PURE__ */ jsxRuntime.jsx(chunk5DM6VU4L_cjs.AssistantDock, { ...props, chat });
64
+ return /* @__PURE__ */ jsxRuntime.jsx(chunkKJ3QEKOJ_cjs.AssistantDock, { ...props, chat });
65
65
  }
66
66
 
67
67
  Object.defineProperty(exports, "redlineStats", {
@@ -81,5 +81,5 @@ exports.useConnectedAiTask = useConnectedAiTask;
81
81
  exports.useConnectedChat = useConnectedChat;
82
82
  exports.useSemanticSearch = useSemanticSearch;
83
83
  exports.useWorkspaceDocs = useWorkspaceDocs;
84
- //# sourceMappingURL=chunk-BR2CPKFU.cjs.map
85
- //# sourceMappingURL=chunk-BR2CPKFU.cjs.map
84
+ //# sourceMappingURL=chunk-G5QTGKDJ.cjs.map
85
+ //# sourceMappingURL=chunk-G5QTGKDJ.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/connection/ai.tsx"],"names":["useConnection","useKitAiTask","useCallback","useKitWorkspaceDocs","useKitSemanticSearch","useWorkspaceUsers","useArbiChat","jsx","AssistantDock"],"mappings":";;;;;;;;AAgCO,SAAS,kBAAA,GAAqB;AACnC,EAAA,MAAM,EAAE,eAAA,EAAgB,GAAIA,+BAAA,EAAc;AAC1C,EAAA,MAAM,OAAOC,eAAA,EAAa;AAC1B,EAAA,MAAM,SAAS,IAAA,CAAK,GAAA;AACpB,EAAA,MAAM,GAAA,GA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C9B,EAAA,uBAAOC,cAAA,CAACC,+BAAA,EAAA,EAAe,GAAG,KAAA,EAAO,IAAA,EAAY,CAAA;AAC/C","file":"chunk-BR2CPKFU.cjs","sourcesContent":["/**\n * The connected agent hooks — thin adapters over the reusable AI kit in\n * `@arbidocs/react`. The streaming/accumulation/search plumbing lives once in\n * the SDK; these hooks only bind the *workspace source* (from the connection\n * context, falling back to the configured workspace) and inject the host's\n * default assistant *configuration* so call sites needn't know the config\n * ext_id. An explicit `opts.model` still wins.\n */\nimport { useCallback } from 'react'\nimport {\n useAiTask as useKitAiTask,\n useWorkspaceDocs as useKitWorkspaceDocs,\n useSemanticSearch as useKitSemanticSearch,\n useArbiChat,\n useWorkspaceUsers,\n type ArbiChat,\n type UseArbiChatOptions,\n type AiRunOptions,\n} from '@arbidocs/react'\nimport { useConnection } from './ConnectionProvider'\nimport { AssistantDock, type AssistantDockProps } from '../chat/AssistantDock'\nimport type { MentionCandidate } from '../chat/mentions'\n\nexport type { AiTaskStatus, AiRunOptions, SearchChunk, ArtifactEvent } from '@arbidocs/react'\n\n/** Client-side redlining, re-exported so a host app has one import surface. */\nexport { toRedlineMarkdown, redlineStats, textToArtifact } from '@arbidocs/react'\n\n/**\n * The kit's `useAiTask` with the host's default assistant configuration\n * injected, so call sites needn't know the config ext_id.\n */\nexport function useConnectedAiTask() {\n const { assistantConfig } = useConnection()\n const task = useKitAiTask()\n const kitRun = task.run\n const run = useCallback(\n (question: string, docIds: string[], opts?: AiRunOptions) =>\n kitRun(question, docIds, { ...opts, model: opts?.model ?? assistantConfig }),\n [kitRun, assistantConfig]\n )\n return { ...task, run }\n}\n\n/** Resolve the active workspace + its document ids (what we ground the agent on). */\nexport function useWorkspaceDocs() {\n const { workspaceId, fallbackWorkspaceId } = useConnection()\n return useKitWorkspaceDocs(workspaceId ?? fallbackWorkspaceId)\n}\n\n/** Search the active workspace's documents and return the top matching passages. */\nexport function useSemanticSearch() {\n const { docIds } = useWorkspaceDocs()\n return useKitSemanticSearch(docIds)\n}\n\n/**\n * The chat controller for `ChatPage` bound to the connection: the active workspace and the host's\n * default assistant configuration are injected, so a host writes\n * `<ChatPage chat={useConnectedChat()} />`.\n */\nexport function useConnectedChat(\n options?: Omit<UseArbiChatOptions, 'workspaceId'>\n): ArbiChat & { mentionCandidates: MentionCandidate[] } {\n const { workspaceId, fallbackWorkspaceId, assistantConfig, user, status, ensureWorkspaceOpen } =\n useConnection()\n const wsId = workspaceId ?? fallbackWorkspaceId\n const { data: members = [] } = useWorkspaceUsers(wsId, {\n enabled: status === 'authenticated' && !!wsId,\n beforeFetch: ensureWorkspaceOpen,\n })\n const mentionCandidates: MentionCandidate[] = [\n { id: 'assistant', kind: 'assistant', label: 'Assistant' },\n ...(status === 'authenticated' ? members : [])\n .filter(\n (member) =>\n !member.agent_ext_id &&\n member.user.external_id !== user?.externalId &&\n !member.user.external_id.startsWith('agt-')\n )\n .map((member) => ({\n id: member.user.external_id,\n kind: 'user' as const,\n label:\n [member.user.given_name, member.user.family_name].filter(Boolean).join(' ') ||\n member.user.email,\n description: member.user.email,\n }))\n .sort((a, b) => a.label.localeCompare(b.label)),\n ]\n const chat = useArbiChat({\n ...options,\n workspaceId: workspaceId ?? fallbackWorkspaceId,\n model: options?.model ?? assistantConfig,\n })\n return {\n ...chat,\n mentionCandidates,\n messages: chat.messages.map((message) => ({\n ...message,\n ...(message.authorId\n ? {\n senderName:\n message.authorId === user?.externalId\n ? user?.name || user?.email\n : mentionCandidates.find((candidate) => candidate.id === message.authorId)?.label,\n }\n : {}),\n })),\n }\n}\n\n/**\n * The assistant dock bound to the connection: mount it once in the layout (`Shell.Root`'s `aside`)\n * and put `AssistantDockToggle` in the topbar. Chat state lives here, so it survives closing the dock.\n */\nexport function ConnectedAssistantDock(props: Omit<AssistantDockProps, 'chat'>) {\n const chat = useConnectedChat()\n return <AssistantDock {...props} chat={chat} />\n}\n"]}
1
+ {"version":3,"sources":["../src/connection/ai.tsx"],"names":["useConnection","useKitAiTask","useCall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AAA,EAAM,UAAA,GACvB,MAAM,IAAA,IAAQ,IAAA,EAAM,KAAA,GACpB,iBAAA,CAAkB,KAAK,CAAC,SAAA,KAAc,UAAU,EAAA,KAAO,OAAA,CAAQ,QAAQ,CAAA,EAAG;AAAA,UAElF;AAAC,KACP,CAAE;AAAA,GACJ;AACF;AAMO,SAAS,uBAAuB,KAAA,EAAyC;AAC9E,EAAA,MAAM,OAAO,gBAAA,EAAiB;AAC9B,EAAA,uBAAOC,cAAA,CAACC,+BAAA,EAAA,EAAe,GAAG,KAAA,EAAO,IAAA,EAAY,CAAA;AAC/C","file":"chunk-G5QTGKDJ.cjs","sourcesContent":["/**\n * The connected agent hooks — thin adapters over the reusable AI kit in\n * `@arbidocs/react`. The streaming/accumulation/search plumbing lives once in\n * the SDK; these hooks only bind the *workspace source* (from the connection\n * context, falling back to the configured workspace) and inject the host's\n * default assistant *configuration* so call sites needn't know the config\n * ext_id. An explicit `opts.model` still wins.\n */\nimport { useCallback } from 'react'\nimport {\n useAiTask as useKitAiTask,\n useWorkspaceDocs as useKitWorkspaceDocs,\n useSemanticSearch as useKitSemanticSearch,\n useArbiChat,\n useWorkspaceUsers,\n type ArbiChat,\n type UseArbiChatOptions,\n type AiRunOptions,\n} from '@arbidocs/react'\nimport { useConnection } from './ConnectionProvider'\nimport { AssistantDock, type AssistantDockProps } from '../chat/AssistantDock'\nimport type { MentionCandidate } from '../chat/mentions'\n\nexport type { AiTaskStatus, AiRunOptions, SearchChunk, ArtifactEvent } from '@arbidocs/react'\n\n/** Client-side redlining, re-exported so a host app has one import surface. */\nexport { toRedlineMarkdown, redlineStats, textToArtifact } from '@arbidocs/react'\n\n/**\n * The kit's `useAiTask` with the host's default assistant configuration\n * injected, so call sites needn't know the config ext_id.\n */\nexport function useConnectedAiTask() {\n const { assistantConfig } = useConnection()\n const task = useKitAiTask()\n const kitRun = task.run\n const run = useCallback(\n (question: string, docIds: string[], opts?: AiRunOptions) =>\n kitRun(question, docIds, { ...opts, model: opts?.model ?? assistantConfig }),\n [kitRun, assistantConfig]\n )\n return { ...task, run }\n}\n\n/** Resolve the active workspace + its document ids (what we ground the agent on). */\nexport function useWorkspaceDocs() {\n const { workspaceId, fallbackWorkspaceId } = useConnection()\n return useKitWorkspaceDocs(workspaceId ?? fallbackWorkspaceId)\n}\n\n/** Search the active workspace's documents and return the top matching passages. */\nexport function useSemanticSearch() {\n const { docIds } = useWorkspaceDocs()\n return useKitSemanticSearch(docIds)\n}\n\n/**\n * The chat controller for `ChatPage` bound to the connection: the active workspace and the host's\n * default assistant configuration are injected, so a host writes\n * `<ChatPage chat={useConnectedChat()} />`.\n */\nexport function useConnectedChat(\n options?: Omit<UseArbiChatOptions, 'workspaceId'>\n): ArbiChat & { mentionCandidates: MentionCandidate[] } {\n const { workspaceId, fallbackWorkspaceId, assistantConfig, user, status, ensureWorkspaceOpen } =\n useConnection()\n const wsId = workspaceId ?? fallbackWorkspaceId\n const { data: members = [] } = useWorkspaceUsers(wsId, {\n enabled: status === 'authenticated' && !!wsId,\n beforeFetch: ensureWorkspaceOpen,\n })\n const mentionCandidates: MentionCandidate[] = [\n { id: 'assistant', kind: 'assistant', label: 'Assistant' },\n ...(status === 'authenticated' ? members : [])\n .filter(\n (member) =>\n !member.agent_ext_id &&\n member.user.external_id !== user?.externalId &&\n !member.user.external_id.startsWith('agt-')\n )\n .map((member) => ({\n id: member.user.external_id,\n kind: 'user' as const,\n label:\n [member.user.given_name, member.user.family_name].filter(Boolean).join(' ') ||\n member.user.email,\n description: member.user.email,\n }))\n .sort((a, b) => a.label.localeCompare(b.label)),\n ]\n const chat = useArbiChat({\n ...options,\n workspaceId: workspaceId ?? fallbackWorkspaceId,\n model: options?.model ?? assistantConfig,\n })\n return {\n ...chat,\n mentionCandidates,\n messages: chat.messages.map((message) => ({\n ...message,\n ...(message.authorId\n ? {\n senderName:\n message.authorId === user?.externalId\n ? user?.name || user?.email\n : mentionCandidates.find((candidate) => candidate.id === message.authorId)?.label,\n }\n : {}),\n })),\n }\n}\n\n/**\n * The assistant dock bound to the connection: mount it once in the layout (`Shell.Root`'s `aside`)\n * and put `AssistantDockToggle` in the topbar. Chat state lives here, so it survives closing the dock.\n */\nexport function ConnectedAssistantDock(props: Omit<AssistantDockProps, 'chat'>) {\n const chat = useConnectedChat()\n return <AssistantDock {...props} chat={chat} />\n}\n"]}
@@ -1,11 +1,11 @@
1
1
  "use client";
2
2
  import { PasswordStrengthInput } from './chunk-VILAPTCB.js';
3
3
  import { formatCount } from './chunk-OXF2IFXG.js';
4
- import { useRestoreFocus } from './chunk-TJMKFY5P.js';
4
+ import { ModalScaffold, useRestoreFocus } from './chunk-TX2ZICS7.js';
5
5
  import { testIdOr, prefixedTestId } from './chunk-7F6CBP3Z.js';
6
6
  import { useMemo, useRef, useId, useState } from 'react';
7
- import { Loader2, Camera, ChevronRight, ChevronDown, Check, Pencil, Mail, CheckCircle2, AlertCircle, Radio, AlertTriangle, LogOut } from 'lucide-react';
8
- import { Avatar, AvatarImage, AvatarFallback, cn, Input, Button, Tooltip, TooltipTrigger, TooltipContent, Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogFooter, Collapsible, CollapsibleTrigger, CollapsibleContent, Switch, Checkbox, Badge } from '@arbidocs/react/ui';
7
+ import { Loader2, Camera, ChevronRight, ChevronDown, Check, Pencil, Mail, ShieldCheck, ExternalLink, CheckCircle2, AlertCircle, Radio, AlertTriangle, LogOut } from 'lucide-react';
8
+ import { Avatar, AvatarImage, AvatarFallback, cn, Input, Button, VerifiedBadge, Tooltip, TooltipTrigger, TooltipContent, Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogFooter, Collapsible, CollapsibleTrigger, CollapsibleContent, Switch, Checkbox, Badge } from '@arbidocs/react/ui';
9
9
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
10
10
 
11
11
  var DEFAULT_AVATAR_PICKER_LABELS = {
@@ -242,13 +242,15 @@ var DEFAULT_PROFILE_CARD_LABELS = {
242
242
  enterCodeHint: "Enter the 3-word code from the email we just sent.",
243
243
  confirm: "Confirm",
244
244
  resendIn: (seconds) => `Resend in ${seconds}s`,
245
- resendCode: "Resend code"
245
+ resendCode: "Resend code",
246
+ verifiedNameLocked: "Verified name. Remove your identity verification to change it."
246
247
  };
247
248
  function ProfileCard({
248
249
  avatar,
249
250
  name,
250
251
  email,
251
252
  isSso,
253
+ isVerified = false,
252
254
  onStartEmailChange,
253
255
  emailChange,
254
256
  ssoTooltip,
@@ -296,6 +298,12 @@ function ProfileCard({
296
298
  ),
297
299
  /* @__PURE__ */ jsx(Button, { onClick: name.onCancel, size: "sm", variant: "ghost", disabled: name.isSaving, children: l.cancel })
298
300
  ] })
301
+ ] }) : isVerified ? /* @__PURE__ */ jsxs("div", { className: "-mx-2 w-full px-2 py-1", "data-testid": "verified-name", children: [
302
+ /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [
303
+ /* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 truncate font-heading text-xl font-semibold text-foreground", children: name.display }),
304
+ /* @__PURE__ */ jsx(VerifiedBadge, { className: "h-4 w-4" })
305
+ ] }),
306
+ /* @__PURE__ */ jsx("p", { className: "mt-0.5 text-xs text-muted-foreground", children: l.verifiedNameLocked })
299
307
  ] }) : /* @__PURE__ */ jsx(
300
308
  "button",
301
309
  {
@@ -429,6 +437,267 @@ function ProfileCard({
429
437
  ] }) }) })
430
438
  ] });
431
439
  }
440
+ var DEFAULT_IDENTITY_VERIFICATION_LABELS = {
441
+ title: "Identity verification",
442
+ intro: "Check your ID once to get a verified tick next to your name.",
443
+ priceLine: (price, attempts) => `${price} \xB7 ${attempts} attempts`,
444
+ proOnly: "Available on Pro plans.",
445
+ seePlans: "See plans",
446
+ manageBilling: "Manage billing",
447
+ verify: "Verify identity",
448
+ continue: "Continue",
449
+ attemptsLeft: (n) => `${n} attempt${n === 1 ? "" : "s"} left`,
450
+ verified: "Verified",
451
+ verifiedDetail: (country) => `ID issued in ${country}`,
452
+ inReview: "Your check is being reviewed. We\u2019ll update this when it\u2019s done.",
453
+ finishName: "Your ID was verified. Confirm your name to get the tick.",
454
+ finish: "Finish",
455
+ remove: "Remove",
456
+ payTitle: "Verify your identity",
457
+ payBody: (price, attempts) => `A one-time fee of ${price} is charged to the card on your Pro plan. It covers up to ${attempts} attempts. Your ID is checked by our provider, Didit; ARBI does not keep your document.`,
458
+ pay: "Pay and continue",
459
+ confirmPayment: "Confirm payment with your bank",
460
+ paymentConfirmed: "I\u2019ve confirmed it",
461
+ verifyTitle: "Scan your ID",
462
+ embedFailed: "Your camera isn\u2019t available here. Continue in a new tab, then come back.",
463
+ openInNewTab: "Open in a new tab",
464
+ checkResult: "I\u2019ve finished",
465
+ resultVerified: "You\u2019re verified. The tick now shows next to your name.",
466
+ resultDeclined: (n) => n > 0 ? `We couldn\u2019t verify your ID. You have ${n} attempt${n === 1 ? "" : "s"} left.` : "We couldn\u2019t verify your ID and no attempts are left.",
467
+ tryAgain: "Try again",
468
+ resultInReview: "Your check needs a manual review. We\u2019ll show the result here when it\u2019s done.",
469
+ nameMismatchTitle: "Your ID was verified",
470
+ nameMismatchBody: "The name on your ID differs from your account name. The tick shows only with the name on your ID.",
471
+ documentName: "Name on your ID",
472
+ accountName: "Account name",
473
+ useDocumentName: (name) => `Change my name to ${name}`,
474
+ keepName: "Keep my name",
475
+ close: "Close",
476
+ requiredTitle: "Identity verification required",
477
+ requiredBody: "This workspace requires a verified identity before you continue.",
478
+ requiredProOnly: "Identity verification is available on Pro plans. Ask your administrator."
479
+ };
480
+ function useLabels(labels) {
481
+ return useMemo(() => ({ ...DEFAULT_IDENTITY_VERIFICATION_LABELS, ...labels }), [labels]);
482
+ }
483
+ var BILLING_CODES = [
484
+ "PRO_REQUIRED",
485
+ "PAYMENT_METHOD_REQUIRED",
486
+ "BILLING_ADDRESS_REQUIRED",
487
+ "PAYMENT_DECLINED"
488
+ ];
489
+ function Problem({
490
+ flow,
491
+ onManageBilling,
492
+ label
493
+ }) {
494
+ if (!flow.problem) return null;
495
+ const billing = onManageBilling && BILLING_CODES.includes(flow.problem.code ?? "");
496
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-2", "data-testid": "identity-problem", children: [
497
+ /* @__PURE__ */ jsx("p", { role: "alert", className: "text-sm text-destructive", children: flow.problem.message }),
498
+ billing && /* @__PURE__ */ jsx(Button, { size: "sm", variant: "outline", onClick: onManageBilling, children: label })
499
+ ] });
500
+ }
501
+ function IdentityVerificationCard({
502
+ flow,
503
+ onManageBilling,
504
+ labels
505
+ }) {
506
+ const l = useLabels(labels);
507
+ const { status } = flow;
508
+ if (!status?.enabled) return null;
509
+ const busy = flow.busy !== null;
510
+ let description;
511
+ let action = null;
512
+ if (status.verified) {
513
+ description = /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-1.5", children: [
514
+ /* @__PURE__ */ jsx(VerifiedBadge, {}),
515
+ l.verified,
516
+ status.document_country && /* @__PURE__ */ jsxs("span", { className: "text-muted-foreground", children: [
517
+ " \xB7 ",
518
+ l.verifiedDetail(status.document_country)
519
+ ] })
520
+ ] });
521
+ action = /* @__PURE__ */ jsx(Button, { size: "sm", variant: "ghost", onClick: flow.remove, disabled: busy, children: l.remove });
522
+ } else if (!status.eligible) {
523
+ description = `${l.intro} ${l.proOnly}`;
524
+ action = onManageBilling ? /* @__PURE__ */ jsx(Button, { size: "sm", variant: "outline", onClick: onManageBilling, children: l.seePlans }) : null;
525
+ } else if (status.state === "in_review") {
526
+ description = l.inReview;
527
+ } else if (status.state === "name_mismatch") {
528
+ description = l.finishName;
529
+ action = /* @__PURE__ */ jsx(Button, { size: "sm", onClick: flow.open, children: l.finish });
530
+ } else {
531
+ const resuming = status.attempts_left > 0 || status.state === "in_progress";
532
+ description = /* @__PURE__ */ jsxs(Fragment, { children: [
533
+ l.intro,
534
+ " ",
535
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: resuming ? l.attemptsLeft(status.attempts_left) : l.priceLine(flow.price ?? "", status.attempts_per_fee) })
536
+ ] });
537
+ action = /* @__PURE__ */ jsxs(Button, { size: "sm", onClick: flow.open, disabled: busy, children: [
538
+ /* @__PURE__ */ jsx(ShieldCheck, { className: "mr-1 h-4 w-4" }),
539
+ resuming ? l.continue : l.verify
540
+ ] });
541
+ }
542
+ return /* @__PURE__ */ jsxs(SettingsCard, { padding: "sm", "data-testid": "identity-verification-card", children: [
543
+ /* @__PURE__ */ jsx(SettingsRow, { label: l.title, description, children: action }),
544
+ !flow.isOpen && /* @__PURE__ */ jsx(Problem, { flow, onManageBilling, label: l.manageBilling })
545
+ ] });
546
+ }
547
+ function IdentityVerificationDialog({
548
+ flow,
549
+ accountName,
550
+ dismissible = true,
551
+ onManageBilling,
552
+ labels
553
+ }) {
554
+ const l = useLabels(labels);
555
+ const { status } = flow;
556
+ const attempts = status?.attempts_per_fee ?? 0;
557
+ const docName = [status?.document_given_name, status?.document_family_name].filter(Boolean).join(" ");
558
+ const spinner = /* @__PURE__ */ jsx(Loader2, { className: "mr-1 h-4 w-4 animate-spin" });
559
+ let body;
560
+ let footer = null;
561
+ if (flow.step === "pay") {
562
+ body = flow.paymentUrl ? /* @__PURE__ */ jsxs(
563
+ "a",
564
+ {
565
+ href: flow.paymentUrl,
566
+ target: "_blank",
567
+ rel: "noopener noreferrer",
568
+ className: "inline-flex items-center gap-1 text-sm font-medium text-primary hover:underline",
569
+ children: [
570
+ l.confirmPayment,
571
+ /* @__PURE__ */ jsx(ExternalLink, { className: "h-3.5 w-3.5" })
572
+ ]
573
+ }
574
+ ) : /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: l.payBody(flow.price ?? "", attempts) });
575
+ footer = flow.paymentUrl ? /* @__PURE__ */ jsxs(Button, { onClick: flow.recheckPayment, disabled: flow.busy !== null, children: [
576
+ flow.busy === "start" && spinner,
577
+ l.paymentConfirmed
578
+ ] }) : /* @__PURE__ */ jsxs(Button, { onClick: flow.pay, disabled: flow.busy !== null, "data-testid": "identity-pay", children: [
579
+ flow.busy === "pay" && spinner,
580
+ l.pay
581
+ ] });
582
+ } else if (flow.step === "verify") {
583
+ body = /* @__PURE__ */ jsx("div", { className: "space-y-3", children: flow.embedFailed ? /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: l.embedFailed }) : /* @__PURE__ */ jsx(
584
+ "div",
585
+ {
586
+ id: flow.verifyContainerId,
587
+ ref: flow.verifyContainerRef,
588
+ className: "h-[560px] w-full overflow-hidden rounded-md bg-muted",
589
+ "data-testid": "identity-didit-frame",
590
+ children: flow.busy === "start" && /* @__PURE__ */ jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ jsx(Loader2, { className: "h-6 w-6 animate-spin text-muted-foreground" }) })
591
+ }
592
+ ) });
593
+ footer = /* @__PURE__ */ jsxs(Fragment, { children: [
594
+ flow.embedFailed && /* @__PURE__ */ jsxs(Button, { variant: "outline", onClick: flow.openInNewTab, children: [
595
+ /* @__PURE__ */ jsx(ExternalLink, { className: "mr-1 h-4 w-4" }),
596
+ l.openInNewTab
597
+ ] }),
598
+ /* @__PURE__ */ jsxs(Button, { variant: "ghost", onClick: flow.checkResult, disabled: flow.busy !== null, children: [
599
+ flow.busy === "refresh" && spinner,
600
+ l.checkResult
601
+ ] })
602
+ ] });
603
+ } else if (status?.state === "name_mismatch") {
604
+ body = /* @__PURE__ */ jsxs("div", { className: "space-y-3", "data-testid": "identity-name-mismatch", children: [
605
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: l.nameMismatchBody }),
606
+ /* @__PURE__ */ jsxs("dl", { className: "grid grid-cols-[auto_1fr] gap-x-4 gap-y-1 text-sm", children: [
607
+ /* @__PURE__ */ jsx("dt", { className: "text-muted-foreground", children: l.documentName }),
608
+ /* @__PURE__ */ jsx("dd", { className: "font-medium", children: docName }),
609
+ /* @__PURE__ */ jsx("dt", { className: "text-muted-foreground", children: l.accountName }),
610
+ /* @__PURE__ */ jsx("dd", { children: accountName })
611
+ ] })
612
+ ] });
613
+ footer = /* @__PURE__ */ jsxs(Fragment, { children: [
614
+ /* @__PURE__ */ jsx(Button, { variant: "ghost", onClick: flow.keepName, disabled: flow.busy !== null, children: l.keepName }),
615
+ /* @__PURE__ */ jsxs(Button, { onClick: flow.acceptName, disabled: flow.busy !== null || !docName, children: [
616
+ flow.busy === "accept" && spinner,
617
+ l.useDocumentName(docName)
618
+ ] })
619
+ ] });
620
+ } else if (status?.verified) {
621
+ body = /* @__PURE__ */ jsxs("p", { className: "flex items-center gap-2 text-sm", children: [
622
+ /* @__PURE__ */ jsx(VerifiedBadge, { className: "h-4 w-4" }),
623
+ l.resultVerified
624
+ ] });
625
+ footer = /* @__PURE__ */ jsx(Button, { onClick: flow.close, children: l.close });
626
+ } else if (status?.state === "in_review") {
627
+ body = /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: l.resultInReview });
628
+ footer = /* @__PURE__ */ jsx(Button, { onClick: flow.close, children: l.close });
629
+ } else {
630
+ const left = status?.attempts_left ?? 0;
631
+ body = /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: l.resultDeclined(left) });
632
+ footer = left > 0 ? /* @__PURE__ */ jsx(Button, { onClick: flow.retry, disabled: flow.busy !== null, children: l.tryAgain }) : /* @__PURE__ */ jsx(Button, { onClick: flow.close, children: l.close });
633
+ }
634
+ const title = status?.state === "name_mismatch" && flow.step === "result" ? l.nameMismatchTitle : flow.step === "verify" ? l.verifyTitle : l.payTitle;
635
+ return /* @__PURE__ */ jsxs(
636
+ ModalScaffold,
637
+ {
638
+ open: flow.isOpen,
639
+ onOpenChange: (open) => open ? flow.open() : flow.close(),
640
+ title,
641
+ icon: /* @__PURE__ */ jsx(ShieldCheck, { className: "h-5 w-5" }),
642
+ size: flow.step === "verify" ? "lg" : "md",
643
+ dismissible,
644
+ testId: "identity-verification-dialog",
645
+ children: [
646
+ /* @__PURE__ */ jsxs(ModalScaffold.Body, { children: [
647
+ body,
648
+ /* @__PURE__ */ jsx(Problem, { flow, onManageBilling, label: l.manageBilling })
649
+ ] }),
650
+ /* @__PURE__ */ jsx(ModalScaffold.Footer, { children: footer })
651
+ ]
652
+ }
653
+ );
654
+ }
655
+ function RequireVerified({
656
+ flow,
657
+ accountName,
658
+ onManageBilling,
659
+ children,
660
+ labels
661
+ }) {
662
+ const l = useLabels(labels);
663
+ const { status } = flow;
664
+ const blocked = Boolean(status?.enabled && status.required && !status.verified);
665
+ if (!blocked || !status) return /* @__PURE__ */ jsx(Fragment, { children });
666
+ if (flow.isOpen) {
667
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
668
+ children,
669
+ /* @__PURE__ */ jsx(
670
+ IdentityVerificationDialog,
671
+ {
672
+ flow,
673
+ accountName,
674
+ dismissible: false,
675
+ onManageBilling,
676
+ labels
677
+ }
678
+ )
679
+ ] });
680
+ }
681
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
682
+ children,
683
+ /* @__PURE__ */ jsxs(
684
+ ModalScaffold,
685
+ {
686
+ open: true,
687
+ onOpenChange: () => {
688
+ },
689
+ title: l.requiredTitle,
690
+ icon: /* @__PURE__ */ jsx(ShieldCheck, { className: "h-5 w-5" }),
691
+ dismissible: false,
692
+ testId: "identity-required-gate",
693
+ children: [
694
+ /* @__PURE__ */ jsx(ModalScaffold.Body, { children: /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: status.eligible ? l.requiredBody : l.requiredProOnly }) }),
695
+ status.eligible && /* @__PURE__ */ jsx(ModalScaffold.Footer, { children: /* @__PURE__ */ jsx(Button, { onClick: flow.open, children: l.verify }) })
696
+ ]
697
+ }
698
+ )
699
+ ] });
700
+ }
432
701
  var DEFAULT_PASSWORD_CHANGE_DIALOG_LABELS = {
433
702
  setNewPasswordTitle: "Set New Password",
434
703
  changeMasterPasswordTitle: "Change Master Password",
@@ -1151,6 +1420,6 @@ function toNotificationCategories(checked, defs = EMAIL_NOTIFICATION_CATEGORIES)
1151
1420
  return defs.map((def) => ({ ...def, checked: checked[def.key] ?? true }));
1152
1421
  }
1153
1422
 
1154
- export { ActiveSessionsDialog, AvatarPicker, DEFAULT_ACTIVE_SESSIONS_DIALOG_LABELS, DEFAULT_AVATAR_PICKER_LABELS, DEFAULT_DELETE_ACCOUNT_DIALOG_LABELS, DEFAULT_LOGOUT_DIALOG_LABELS, DEFAULT_PASSWORD_CHANGE_DIALOG_LABELS, DEFAULT_PROFILE_CARD_LABELS, DEFAULT_SETTINGS_DANGER_ZONE_LABELS, DeleteAccountDialog, EMAIL_NOTIFICATION_CATEGORIES, EMAIL_NOTIFICATION_KEYS, LogoutDialog, NotificationCategoryList, PasswordChangeDialog, ProfileCard, SettingsActionRow, SettingsCard, SettingsDangerZone, SettingsPanel, SettingsRow, SettingsSection, SettingsSwitchGroup, SettingsSwitchRow, formatSessionTtl, toActiveSessionViews, toDeleteBlockerViews, toLogoutSessionViews, toNotificationCategories };
1155
- //# sourceMappingURL=chunk-VZGBCBYB.js.map
1156
- //# sourceMappingURL=chunk-VZGBCBYB.js.map
1423
+ export { ActiveSessionsDialog, AvatarPicker, DEFAULT_ACTIVE_SESSIONS_DIALOG_LABELS, DEFAULT_AVATAR_PICKER_LABELS, DEFAULT_DELETE_ACCOUNT_DIALOG_LABELS, DEFAULT_IDENTITY_VERIFICATION_LABELS, DEFAULT_LOGOUT_DIALOG_LABELS, DEFAULT_PASSWORD_CHANGE_DIALOG_LABELS, DEFAULT_PROFILE_CARD_LABELS, DEFAULT_SETTINGS_DANGER_ZONE_LABELS, DeleteAccountDialog, EMAIL_NOTIFICATION_CATEGORIES, EMAIL_NOTIFICATION_KEYS, IdentityVerificationCard, IdentityVerificationDialog, LogoutDialog, NotificationCategoryList, PasswordChangeDialog, ProfileCard, RequireVerified, SettingsActionRow, SettingsCard, SettingsDangerZone, SettingsPanel, SettingsRow, SettingsSection, SettingsSwitchGroup, SettingsSwitchRow, formatSessionTtl, toActiveSessionViews, toDeleteBlockerViews, toLogoutSessionViews, toNotificationCategories };
1424
+ //# sourceMappingURL=chunk-GJV2G4FC.js.map
1425
+ //# sourceMappingURL=chunk-GJV2G4FC.js.map