@arbidocs/blocks 0.4.144 → 0.4.145

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 (146) hide show
  1. package/dist/agents/index.cjs +267 -267
  2. package/dist/agents/index.js +10 -10
  3. package/dist/chat/index.cjs +1 -1
  4. package/dist/chat/index.js +1 -1
  5. package/dist/{chunk-BUWBXJ2N.cjs → chunk-34GDGE77.cjs} +5 -5
  6. package/dist/{chunk-BUWBXJ2N.cjs.map → chunk-34GDGE77.cjs.map} +1 -1
  7. package/dist/{chunk-ON3TKY5Y.js → chunk-5YHEHEJT.js} +242 -4
  8. package/dist/chunk-5YHEHEJT.js.map +1 -0
  9. package/dist/{chunk-YFY3TQ6Q.cjs → chunk-COCGRJLA.cjs} +7 -7
  10. package/dist/{chunk-YFY3TQ6Q.cjs.map → chunk-COCGRJLA.cjs.map} +1 -1
  11. package/dist/{chunk-45LRMW54.js → chunk-DN2KI4BU.js} +8 -10
  12. package/dist/chunk-DN2KI4BU.js.map +1 -0
  13. package/dist/{chunk-R26BK7YL.cjs → chunk-DTROMMDX.cjs} +4 -4
  14. package/dist/{chunk-R26BK7YL.cjs.map → chunk-DTROMMDX.cjs.map} +1 -1
  15. package/dist/{chunk-65THHQVB.cjs → chunk-ECW2R2KF.cjs} +27 -27
  16. package/dist/{chunk-65THHQVB.cjs.map → chunk-ECW2R2KF.cjs.map} +1 -1
  17. package/dist/{chunk-RI6DZA5X.js → chunk-EF4ZLKRM.js} +3 -3
  18. package/dist/{chunk-RI6DZA5X.js.map → chunk-EF4ZLKRM.js.map} +1 -1
  19. package/dist/{chunk-WS5EX7DN.cjs → chunk-EYKISBDO.cjs} +5 -5
  20. package/dist/{chunk-WS5EX7DN.cjs.map → chunk-EYKISBDO.cjs.map} +1 -1
  21. package/dist/{chunk-JZNXRMLH.cjs → chunk-GAYMJWTC.cjs} +8 -10
  22. package/dist/chunk-GAYMJWTC.cjs.map +1 -0
  23. package/dist/{chunk-I7WG3JRD.js → chunk-H4D7WKDY.js} +3 -3
  24. package/dist/{chunk-I7WG3JRD.js.map → chunk-H4D7WKDY.js.map} +1 -1
  25. package/dist/{chunk-3RJN2VTL.js → chunk-IXWJGOM2.js} +3 -3
  26. package/dist/{chunk-3RJN2VTL.js.map → chunk-IXWJGOM2.js.map} +1 -1
  27. package/dist/{chunk-7NGAWGA3.js → chunk-J4M37SXY.js} +3 -3
  28. package/dist/{chunk-7NGAWGA3.js.map → chunk-J4M37SXY.js.map} +1 -1
  29. package/dist/{chunk-CYNF5PZI.js → chunk-J5CWKFSC.js} +3 -3
  30. package/dist/{chunk-CYNF5PZI.js.map → chunk-J5CWKFSC.js.map} +1 -1
  31. package/dist/{chunk-TP6PLDNM.cjs → chunk-KMZWKSKO.cjs} +8 -8
  32. package/dist/{chunk-TP6PLDNM.cjs.map → chunk-KMZWKSKO.cjs.map} +1 -1
  33. package/dist/{chunk-XGZX22ET.cjs → chunk-KPO67GBR.cjs} +39 -39
  34. package/dist/{chunk-XGZX22ET.cjs.map → chunk-KPO67GBR.cjs.map} +1 -1
  35. package/dist/{chunk-C4WSHRR6.cjs → chunk-KPZZ5FHE.cjs} +32 -12
  36. package/dist/chunk-KPZZ5FHE.cjs.map +1 -0
  37. package/dist/{chunk-X3TGXEFS.js → chunk-KTSF4HFC.js} +7 -7
  38. package/dist/{chunk-X3TGXEFS.js.map → chunk-KTSF4HFC.js.map} +1 -1
  39. package/dist/{chunk-33ZOUJXA.js → chunk-NGDXDHLG.js} +13 -32
  40. package/dist/chunk-NGDXDHLG.js.map +1 -0
  41. package/dist/chunk-NHZK64TQ.js +75 -0
  42. package/dist/chunk-NHZK64TQ.js.map +1 -0
  43. package/dist/{chunk-BPBSSMRB.js → chunk-NRFAWUVD.js} +3 -3
  44. package/dist/{chunk-BPBSSMRB.js.map → chunk-NRFAWUVD.js.map} +1 -1
  45. package/dist/{chunk-O2ODDTMA.cjs → chunk-NSNHRZBH.cjs} +8 -8
  46. package/dist/{chunk-O2ODDTMA.cjs.map → chunk-NSNHRZBH.cjs.map} +1 -1
  47. package/dist/chunk-NWNVWO6L.cjs +80 -0
  48. package/dist/chunk-NWNVWO6L.cjs.map +1 -0
  49. package/dist/{chunk-Y3KA6X7B.js → chunk-OVR3XMYL.js} +4 -4
  50. package/dist/{chunk-Y3KA6X7B.js.map → chunk-OVR3XMYL.js.map} +1 -1
  51. package/dist/{chunk-2FJMTZNJ.js → chunk-QOL3M4FJ.js} +9 -9
  52. package/dist/{chunk-2FJMTZNJ.js.map → chunk-QOL3M4FJ.js.map} +1 -1
  53. package/dist/{chunk-LYUO3E6V.js → chunk-SZOFGU7W.js} +3 -3
  54. package/dist/{chunk-LYUO3E6V.js.map → chunk-SZOFGU7W.js.map} +1 -1
  55. package/dist/{chunk-YNIBUKV5.js → chunk-TBEVGWY3.js} +32 -14
  56. package/dist/chunk-TBEVGWY3.js.map +1 -0
  57. package/dist/{chunk-MJCCBMM5.cjs → chunk-TC3RQNEX.cjs} +6 -80
  58. package/dist/chunk-TC3RQNEX.cjs.map +1 -0
  59. package/dist/{chunk-QIMVTGKS.cjs → chunk-U73KPFYH.cjs} +255 -2
  60. package/dist/chunk-U73KPFYH.cjs.map +1 -0
  61. package/dist/{chunk-RA3ZJ45L.cjs → chunk-ULPFRK3J.cjs} +25 -44
  62. package/dist/chunk-ULPFRK3J.cjs.map +1 -0
  63. package/dist/{chunk-HFGXA5CL.cjs → chunk-UTTTJSQU.cjs} +4 -4
  64. package/dist/{chunk-HFGXA5CL.cjs.map → chunk-UTTTJSQU.cjs.map} +1 -1
  65. package/dist/{chunk-DLBUFHLY.js → chunk-VTTZZ4FN.js} +4 -74
  66. package/dist/chunk-VTTZZ4FN.js.map +1 -0
  67. package/dist/{chunk-A6J2IBUG.js → chunk-VVZ34A2P.js} +3 -3
  68. package/dist/{chunk-A6J2IBUG.js.map → chunk-VVZ34A2P.js.map} +1 -1
  69. package/dist/{chunk-ABUO6PIQ.cjs → chunk-WO7QAVTL.cjs} +13 -13
  70. package/dist/{chunk-ABUO6PIQ.cjs.map → chunk-WO7QAVTL.cjs.map} +1 -1
  71. package/dist/{chunk-5FTIHRZH.cjs → chunk-XVUOMWMD.cjs} +4 -4
  72. package/dist/{chunk-5FTIHRZH.cjs.map → chunk-XVUOMWMD.cjs.map} +1 -1
  73. package/dist/{chunk-444XKG46.js → chunk-YKQ2DPIP.js} +3 -3
  74. package/dist/{chunk-444XKG46.js.map → chunk-YKQ2DPIP.js.map} +1 -1
  75. package/dist/{chunk-HEMU73OP.cjs → chunk-YSHIC4NJ.cjs} +4 -4
  76. package/dist/{chunk-HEMU73OP.cjs.map → chunk-YSHIC4NJ.cjs.map} +1 -1
  77. package/dist/citations/index.cjs +12 -12
  78. package/dist/citations/index.js +3 -3
  79. package/dist/collaboration/index.cjs +9 -9
  80. package/dist/collaboration/index.js +1 -1
  81. package/dist/connect/docx.cjs +11 -11
  82. package/dist/connect/docx.js +8 -8
  83. package/dist/connect/index.cjs +716 -329
  84. package/dist/connect/index.cjs.map +1 -1
  85. package/dist/connect/index.d.ts +1 -0
  86. package/dist/connect/index.js +591 -217
  87. package/dist/connect/index.js.map +1 -1
  88. package/dist/connection/ConnectedSettings.d.ts +3 -2
  89. package/dist/connection/ai.d.ts +27 -72
  90. package/dist/connection/settings-page/ConnectedAccountSettings.d.ts +35 -0
  91. package/dist/connection/settings-page/ConnectedMailSettings.d.ts +13 -0
  92. package/dist/connection/settings-page/ConnectedPremiumModels.d.ts +1 -0
  93. package/dist/connection/settings-page/ConnectedPrivacySettings.d.ts +12 -0
  94. package/dist/connection/settings-page/ConnectedSettingsPage.d.ts +29 -0
  95. package/dist/connection/settings-page/SessionStatusIcon.d.ts +7 -0
  96. package/dist/connection/settings-page/index.d.ts +6 -0
  97. package/dist/connection/workspaceData.d.ts +6 -6
  98. package/dist/document-tools/index.cjs +1 -1
  99. package/dist/document-tools/index.js +1 -1
  100. package/dist/facts/index.cjs +4 -4
  101. package/dist/facts/index.js +3 -3
  102. package/dist/files/index.cjs +3 -3
  103. package/dist/files/index.js +2 -2
  104. package/dist/home/index.cjs +20 -20
  105. package/dist/home/index.js +4 -4
  106. package/dist/index.cjs +476 -467
  107. package/dist/index.cjs.map +1 -1
  108. package/dist/index.d.ts +1 -0
  109. package/dist/index.js +23 -22
  110. package/dist/index.js.map +1 -1
  111. package/dist/provider/BlocksProvider.d.ts +5 -1
  112. package/dist/provider/settings-section.d.ts +9 -0
  113. package/dist/retrieval/index.cjs +4 -4
  114. package/dist/retrieval/index.js +2 -2
  115. package/dist/settings/AppearanceSettings.d.ts +18 -0
  116. package/dist/settings/ServerConnectionControls.d.ts +16 -0
  117. package/dist/settings/SettingsPage.d.ts +31 -0
  118. package/dist/settings/index.cjs +187 -250
  119. package/dist/settings/index.cjs.map +1 -1
  120. package/dist/settings/index.d.ts +3 -1
  121. package/dist/settings/index.js +87 -199
  122. package/dist/settings/index.js.map +1 -1
  123. package/dist/shell/index.cjs +44 -44
  124. package/dist/shell/index.js +3 -3
  125. package/dist/site/index.cjs +75 -74
  126. package/dist/site/index.js +4 -3
  127. package/dist/studio/index.cjs +80 -79
  128. package/dist/studio/index.cjs.map +1 -1
  129. package/dist/studio/index.js +12 -11
  130. package/dist/studio/index.js.map +1 -1
  131. package/dist/workflow-canvas/index.cjs +28 -28
  132. package/dist/workflow-canvas/index.js +11 -11
  133. package/dist/workspaces/index.cjs +3 -3
  134. package/dist/workspaces/index.js +2 -2
  135. package/node_modules/@arbidocs/coedit/package.json +1 -1
  136. package/package.json +4 -4
  137. package/dist/chunk-33ZOUJXA.js.map +0 -1
  138. package/dist/chunk-45LRMW54.js.map +0 -1
  139. package/dist/chunk-C4WSHRR6.cjs.map +0 -1
  140. package/dist/chunk-DLBUFHLY.js.map +0 -1
  141. package/dist/chunk-JZNXRMLH.cjs.map +0 -1
  142. package/dist/chunk-MJCCBMM5.cjs.map +0 -1
  143. package/dist/chunk-ON3TKY5Y.js.map +0 -1
  144. package/dist/chunk-QIMVTGKS.cjs.map +0 -1
  145. package/dist/chunk-RA3ZJ45L.cjs.map +0 -1
  146. package/dist/chunk-YNIBUKV5.js.map +0 -1
@@ -1,34 +1,34 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
- var chunkQIMVTGKS_cjs = require('../chunk-QIMVTGKS.cjs');
4
+ var chunkO4YPVYPO_cjs = require('../chunk-O4YPVYPO.cjs');
5
+ var chunkU73KPFYH_cjs = require('../chunk-U73KPFYH.cjs');
5
6
  var chunkODRHHWHY_cjs = require('../chunk-ODRHHWHY.cjs');
6
- var chunkRA3ZJ45L_cjs = require('../chunk-RA3ZJ45L.cjs');
7
- var chunkJZNXRMLH_cjs = require('../chunk-JZNXRMLH.cjs');
7
+ var chunkULPFRK3J_cjs = require('../chunk-ULPFRK3J.cjs');
8
+ var chunkGAYMJWTC_cjs = require('../chunk-GAYMJWTC.cjs');
8
9
  var chunkGFNELPDP_cjs = require('../chunk-GFNELPDP.cjs');
9
10
  var chunkJH6JTI76_cjs = require('../chunk-JH6JTI76.cjs');
10
11
  require('../chunk-464YPRAE.cjs');
11
12
  require('../chunk-V5OAXIBN.cjs');
12
13
  require('../chunk-5FYU7ZIU.cjs');
13
- var chunkO4YPVYPO_cjs = require('../chunk-O4YPVYPO.cjs');
14
- var chunkBUWBXJ2N_cjs = require('../chunk-BUWBXJ2N.cjs');
14
+ var chunk34GDGE77_cjs = require('../chunk-34GDGE77.cjs');
15
15
  var chunkV46W7YLI_cjs = require('../chunk-V46W7YLI.cjs');
16
16
  var chunkO6IEZDRC_cjs = require('../chunk-O6IEZDRC.cjs');
17
17
  require('../chunk-LJJJ6CYH.cjs');
18
18
  var chunkI2QSDQQV_cjs = require('../chunk-I2QSDQQV.cjs');
19
19
  require('../chunk-RC25WMVB.cjs');
20
- var chunkABUO6PIQ_cjs = require('../chunk-ABUO6PIQ.cjs');
20
+ var chunkWO7QAVTL_cjs = require('../chunk-WO7QAVTL.cjs');
21
+ require('../chunk-DETZZBG2.cjs');
21
22
  var chunkRFIBUWLF_cjs = require('../chunk-RFIBUWLF.cjs');
22
- var chunkO2ODDTMA_cjs = require('../chunk-O2ODDTMA.cjs');
23
- require('../chunk-WS5EX7DN.cjs');
23
+ var chunkNSNHRZBH_cjs = require('../chunk-NSNHRZBH.cjs');
24
24
  var chunkRQ2Y7USX_cjs = require('../chunk-RQ2Y7USX.cjs');
25
25
  require('../chunk-AHDJXIUB.cjs');
26
26
  require('../chunk-ZW6FPIFC.cjs');
27
- require('../chunk-DETZZBG2.cjs');
28
- require('../chunk-R26BK7YL.cjs');
29
27
  var chunkV4ISCZJ7_cjs = require('../chunk-V4ISCZJ7.cjs');
30
28
  var chunk2EI7NCUA_cjs = require('../chunk-2EI7NCUA.cjs');
31
29
  var chunkC2CWWEHO_cjs = require('../chunk-C2CWWEHO.cjs');
30
+ require('../chunk-EYKISBDO.cjs');
31
+ require('../chunk-DTROMMDX.cjs');
32
32
  var chunkQVBZESYQ_cjs = require('../chunk-QVBZESYQ.cjs');
33
33
  require('../chunk-ADOKTJHV.cjs');
34
34
  var chunk6YTHQ73P_cjs = require('../chunk-6YTHQ73P.cjs');
@@ -40,13 +40,13 @@ require('../chunk-B6MVQCXW.cjs');
40
40
  var chunkJKB7WT7L_cjs = require('../chunk-JKB7WT7L.cjs');
41
41
  var chunkJSTKEZBS_cjs = require('../chunk-JSTKEZBS.cjs');
42
42
  require('../chunk-76L6LOP3.cjs');
43
- require('../chunk-7UTB4PHM.cjs');
44
43
  require('../chunk-32HW2Q33.cjs');
44
+ require('../chunk-7UTB4PHM.cjs');
45
45
  require('../chunk-FX3K6LNZ.cjs');
46
46
  require('../chunk-PPCATBOY.cjs');
47
47
  require('../chunk-MHVNT4J3.cjs');
48
- var chunk5FTIHRZH_cjs = require('../chunk-5FTIHRZH.cjs');
49
- var chunkC4WSHRR6_cjs = require('../chunk-C4WSHRR6.cjs');
48
+ var chunkXVUOMWMD_cjs = require('../chunk-XVUOMWMD.cjs');
49
+ var chunkKPZZ5FHE_cjs = require('../chunk-KPZZ5FHE.cjs');
50
50
  var chunkULWRNGGE_cjs = require('../chunk-ULWRNGGE.cjs');
51
51
  var chunkKDG6FER6_cjs = require('../chunk-KDG6FER6.cjs');
52
52
  require('../chunk-DES3K4SD.cjs');
@@ -140,7 +140,7 @@ function ConnectedWorkspaceActivity({
140
140
  [feed.data]
141
141
  );
142
142
  return /* @__PURE__ */ jsxRuntime.jsx(
143
- chunkBUWBXJ2N_cjs.WorkspaceActivityList,
143
+ chunk34GDGE77_cjs.WorkspaceActivityList,
144
144
  {
145
145
  ...listProps,
146
146
  items,
@@ -568,7 +568,7 @@ function NotificationCenter({
568
568
  }
569
569
  ];
570
570
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col h-full bg-background", "data-testid": "notifications-page", children: [
571
- /* @__PURE__ */ jsxRuntime.jsx(chunkQIMVTGKS_cjs.DraggableHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(
571
+ /* @__PURE__ */ jsxRuntime.jsx(chunkU73KPFYH_cjs.DraggableHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(
572
572
  chunk7RGLTF76_cjs.TabHeader,
573
573
  {
574
574
  tabs,
@@ -813,7 +813,7 @@ function ConnectedWorkspaceNotificationMenu({
813
813
  });
814
814
  if (!workspaceId) return null;
815
815
  return /* @__PURE__ */ jsxRuntime.jsx(
816
- chunkBUWBXJ2N_cjs.WorkspaceNotificationMenu,
816
+ chunk34GDGE77_cjs.WorkspaceNotificationMenu,
817
817
  {
818
818
  ...menuProps,
819
819
  level,
@@ -832,7 +832,7 @@ function ConnectedThreadFollow({
832
832
  enabled: status === "authenticated"
833
833
  });
834
834
  if (!conversationId) return null;
835
- const Control = as === "menu-item" ? chunkBUWBXJ2N_cjs.ThreadFollowMenuItem : chunkBUWBXJ2N_cjs.ThreadFollowButton;
835
+ const Control = as === "menu-item" ? chunk34GDGE77_cjs.ThreadFollowMenuItem : chunk34GDGE77_cjs.ThreadFollowButton;
836
836
  return /* @__PURE__ */ jsxRuntime.jsx(
837
837
  Control,
838
838
  {
@@ -857,7 +857,7 @@ var DEFAULT_CONNECTED_SKILL_UPLOAD_LABELS = {
857
857
  };
858
858
  function ConnectedSkillUpload({ onDone, labels, className }) {
859
859
  const l = { ...DEFAULT_CONNECTED_SKILL_UPLOAD_LABELS, ...labels };
860
- const { notify } = chunkC4WSHRR6_cjs.useBlocksEnvironment();
860
+ const { notify } = chunkKPZZ5FHE_cjs.useBlocksEnvironment();
861
861
  const upload = react$1.useUploadSkillFiles();
862
862
  const fileRef = react.useRef(null);
863
863
  const [url, setUrl] = react.useState("");
@@ -905,7 +905,7 @@ function ConnectedSkillUpload({ onDone, labels, className }) {
905
905
  onChange: (e) => {
906
906
  const file = e.target.files?.[0];
907
907
  e.target.value = "";
908
- if (file) void add(() => chunkABUO6PIQ_cjs.importSkillFile(file));
908
+ if (file) void add(() => chunkWO7QAVTL_cjs.importSkillFile(file));
909
909
  }
910
910
  }
911
911
  ),
@@ -930,7 +930,7 @@ function ConnectedSkillUpload({ onDone, labels, className }) {
930
930
  className: "space-y-2",
931
931
  onSubmit: (e) => {
932
932
  e.preventDefault();
933
- if (url.trim()) void add(() => chunkABUO6PIQ_cjs.importSkillFromUrl(url));
933
+ if (url.trim()) void add(() => chunkWO7QAVTL_cjs.importSkillFromUrl(url));
934
934
  },
935
935
  children: [
936
936
  /* @__PURE__ */ jsxRuntime.jsx(ui.Label, { htmlFor: "skills-add-url", children: l.fromLink }),
@@ -982,7 +982,7 @@ function ConnectedSkillsLibrary({
982
982
  renderEditor
983
983
  }) {
984
984
  const arbi = react$1.useArbi();
985
- const { confirm, notify } = chunkC4WSHRR6_cjs.useBlocksEnvironment();
985
+ const { confirm, notify } = chunkKPZZ5FHE_cjs.useBlocksEnvironment();
986
986
  const { data: listings } = react$1.useSkills();
987
987
  const upload = react$1.useUploadSkillFiles();
988
988
  const setVisibility = react$1.useSetSkillVisibility();
@@ -994,9 +994,9 @@ function ConnectedSkillsLibrary({
994
994
  const [type, setType] = react.useState("all");
995
995
  const [view, setView] = react.useState("gallery");
996
996
  const [isBusy, setIsBusy] = react.useState(false);
997
- const all = react.useMemo(() => chunkABUO6PIQ_cjs.buildLibrarySkills(builtins, listings ?? []), [builtins, listings]);
997
+ const all = react.useMemo(() => chunkWO7QAVTL_cjs.buildLibrarySkills(builtins, listings ?? []), [builtins, listings]);
998
998
  const shown = react.useMemo(
999
- () => chunkABUO6PIQ_cjs.filterLibrarySkills(all, { query, source, type }),
999
+ () => chunkWO7QAVTL_cjs.filterLibrarySkills(all, { query, source, type }),
1000
1000
  [all, query, source, type]
1001
1001
  );
1002
1002
  const current = all.find((s) => s.slug === selected) ?? null;
@@ -1007,21 +1007,21 @@ function ConnectedSkillsLibrary({
1007
1007
  const count = (s) => all.filter((x) => x.source === s).length;
1008
1008
  const sourceOptions = [
1009
1009
  { id: "all", label: "All", count: all.length },
1010
- { id: "builtin", label: chunkABUO6PIQ_cjs.SKILL_SOURCE_LABELS.builtin, count: count("builtin") },
1011
- { id: "mine", label: chunkABUO6PIQ_cjs.SKILL_SOURCE_LABELS.mine, count: count("mine") },
1012
- { id: "shared", label: chunkABUO6PIQ_cjs.SKILL_SOURCE_LABELS.shared, count: count("shared") }
1010
+ { id: "builtin", label: chunkWO7QAVTL_cjs.SKILL_SOURCE_LABELS.builtin, count: count("builtin") },
1011
+ { id: "mine", label: chunkWO7QAVTL_cjs.SKILL_SOURCE_LABELS.mine, count: count("mine") },
1012
+ { id: "shared", label: chunkWO7QAVTL_cjs.SKILL_SOURCE_LABELS.shared, count: count("shared") }
1013
1013
  ];
1014
1014
  const types = [...new Set(all.map((s) => s.type))];
1015
1015
  const typeOptions = [
1016
1016
  { id: "all", label: "Any kind" },
1017
- ...types.map((t) => ({ id: t, label: chunkABUO6PIQ_cjs.SKILL_TYPE_LABELS[t] ?? t }))
1017
+ ...types.map((t) => ({ id: t, label: chunkWO7QAVTL_cjs.SKILL_TYPE_LABELS[t] ?? t }))
1018
1018
  ];
1019
1019
  const pick = (slug) => {
1020
1020
  setSelected(slug);
1021
1021
  setMode("detail");
1022
1022
  };
1023
1023
  const markdownOf = async (skill) => {
1024
- if (!skill.docExtId) return chunkABUO6PIQ_cjs.workflowToSkillMarkdown(skill.workflow);
1024
+ if (!skill.docExtId) return chunkWO7QAVTL_cjs.workflowToSkillMarkdown(skill.workflow);
1025
1025
  const response = await arbi.documents.download(skill.docExtId);
1026
1026
  if (!response.ok) throw new Error(`Could not read the skill (${response.status})`);
1027
1027
  return response.text();
@@ -1029,7 +1029,7 @@ function ConnectedSkillsLibrary({
1029
1029
  const saveAs = (slug, markdown, shared = false) => upload.mutateAsync([
1030
1030
  {
1031
1031
  folder: `${SKILL_FOLDER}${slug}`,
1032
- fileName: chunkABUO6PIQ_cjs.SKILL_MAIN_FILENAME,
1032
+ fileName: chunkWO7QAVTL_cjs.SKILL_MAIN_FILENAME,
1033
1033
  content: new Blob([markdown], { type: "text/markdown" }),
1034
1034
  shared
1035
1035
  }
@@ -1092,7 +1092,7 @@ function ConnectedSkillsLibrary({
1092
1092
  try {
1093
1093
  documentTools.downloadBlob(
1094
1094
  new Blob([await markdownOf(skill)], { type: "text/markdown" }),
1095
- chunkABUO6PIQ_cjs.SKILL_MAIN_FILENAME
1095
+ chunkWO7QAVTL_cjs.SKILL_MAIN_FILENAME
1096
1096
  );
1097
1097
  } catch (error) {
1098
1098
  notify(errorText(error, "Could not export the skill"), "error");
@@ -1133,10 +1133,10 @@ function ConnectedSkillsLibrary({
1133
1133
  }
1134
1134
  )
1135
1135
  ] }),
1136
- /* @__PURE__ */ jsxRuntime.jsx(chunkABUO6PIQ_cjs.SkillViewToggle, { value: view, onChange: setView })
1136
+ /* @__PURE__ */ jsxRuntime.jsx(chunkWO7QAVTL_cjs.SkillViewToggle, { value: view, onChange: setView })
1137
1137
  ] }),
1138
1138
  /* @__PURE__ */ jsxRuntime.jsx(
1139
- chunkABUO6PIQ_cjs.SkillFilterChips,
1139
+ chunkWO7QAVTL_cjs.SkillFilterChips,
1140
1140
  {
1141
1141
  label: "Show",
1142
1142
  value: source,
@@ -1145,7 +1145,7 @@ function ConnectedSkillsLibrary({
1145
1145
  }
1146
1146
  ),
1147
1147
  types.length > 1 && /* @__PURE__ */ jsxRuntime.jsx(
1148
- chunkABUO6PIQ_cjs.SkillFilterChips,
1148
+ chunkWO7QAVTL_cjs.SkillFilterChips,
1149
1149
  {
1150
1150
  label: "Kind",
1151
1151
  value: type,
@@ -1192,12 +1192,12 @@ function ConnectedSkillsLibrary({
1192
1192
  view === "gallery" ? "grid grid-cols-[repeat(auto-fill,minmax(9.5rem,1fr))]" : "flex flex-col"
1193
1193
  ),
1194
1194
  children: shown.map((skill) => /* @__PURE__ */ jsxRuntime.jsx(
1195
- chunkABUO6PIQ_cjs.SkillTile,
1195
+ chunkWO7QAVTL_cjs.SkillTile,
1196
1196
  {
1197
1197
  name: skill.title,
1198
1198
  testId: `skill-tile-${skill.slug}`,
1199
1199
  description: skill.description,
1200
- sourceLabel: skill.isShared ? `${chunkABUO6PIQ_cjs.SKILL_SOURCE_LABELS.mine}, shared` : chunkABUO6PIQ_cjs.SKILL_SOURCE_LABELS[skill.source],
1200
+ sourceLabel: skill.isShared ? `${chunkWO7QAVTL_cjs.SKILL_SOURCE_LABELS.mine}, shared` : chunkWO7QAVTL_cjs.SKILL_SOURCE_LABELS[skill.source],
1201
1201
  type: skill.type,
1202
1202
  icon,
1203
1203
  layout: view,
@@ -1232,7 +1232,7 @@ function ConnectedSkillsLibrary({
1232
1232
  }
1233
1233
  ),
1234
1234
  mode === "new" && /* @__PURE__ */ jsxRuntime.jsx(
1235
- chunkABUO6PIQ_cjs.SkillGenerateForm,
1235
+ chunkWO7QAVTL_cjs.SkillGenerateForm,
1236
1236
  {
1237
1237
  icon,
1238
1238
  onGenerate: (desc) => {
@@ -1259,11 +1259,11 @@ function ConnectedSkillsLibrary({
1259
1259
  ),
1260
1260
  mode === "add" && /* @__PURE__ */ jsxRuntime.jsx(ConnectedSkillUpload, { onDone: done }),
1261
1261
  mode === "detail" && current && /* @__PURE__ */ jsxRuntime.jsx(
1262
- chunkABUO6PIQ_cjs.SkillLibraryDetail,
1262
+ chunkWO7QAVTL_cjs.SkillLibraryDetail,
1263
1263
  {
1264
1264
  skill: current,
1265
1265
  icon,
1266
- instructions: current.docExtId ? currentText ? chunkABUO6PIQ_cjs.parseSkillFrontmatter(currentText, chunkABUO6PIQ_cjs.SKILL_MAIN_FILENAME).content : "" : current.workflow.run.kind === "prompt" ? current.workflow.run.promptTemplate : "",
1266
+ instructions: current.docExtId ? currentText ? chunkWO7QAVTL_cjs.parseSkillFrontmatter(currentText, chunkWO7QAVTL_cjs.SKILL_MAIN_FILENAME).content : "" : current.workflow.run.kind === "prompt" ? current.workflow.run.promptTemplate : "",
1267
1267
  isLoading: !!current.docExtId && textLoading,
1268
1268
  actions: {
1269
1269
  onRun: () => onRun(current.slug),
@@ -1290,7 +1290,7 @@ function SkillEditor({
1290
1290
  onCancel,
1291
1291
  isSaving
1292
1292
  }) {
1293
- const { notify } = chunkC4WSHRR6_cjs.useBlocksEnvironment();
1293
+ const { notify } = chunkKPZZ5FHE_cjs.useBlocksEnvironment();
1294
1294
  const isEditing = !!skill;
1295
1295
  const [name, setName] = react.useState(skill?.slug ?? "");
1296
1296
  const [description, setDescription] = react.useState("");
@@ -1298,7 +1298,7 @@ function SkillEditor({
1298
1298
  const [seeded, setSeeded] = react.useState(!isEditing);
1299
1299
  const [nameError, setNameError] = react.useState(null);
1300
1300
  if (isEditing && !seeded && text !== void 0) {
1301
- const parsed = chunkABUO6PIQ_cjs.parseSkillFrontmatter(text, chunkABUO6PIQ_cjs.SKILL_MAIN_FILENAME);
1301
+ const parsed = chunkWO7QAVTL_cjs.parseSkillFrontmatter(text, chunkWO7QAVTL_cjs.SKILL_MAIN_FILENAME);
1302
1302
  setDescription(parsed.description ?? "");
1303
1303
  setBody(parsed.content ?? "");
1304
1304
  setSeeded(true);
@@ -1312,15 +1312,15 @@ function SkillEditor({
1312
1312
  notify("Add a short description.", "error");
1313
1313
  return;
1314
1314
  }
1315
- const slug = chunkABUO6PIQ_cjs.skillSlug(name);
1315
+ const slug = chunkWO7QAVTL_cjs.skillSlug(name);
1316
1316
  try {
1317
- await onSave(slug, chunkABUO6PIQ_cjs.serializeSkill({ name: slug, description, body }), isEditing);
1317
+ await onSave(slug, chunkWO7QAVTL_cjs.serializeSkill({ name: slug, description, body }), isEditing);
1318
1318
  } catch (err) {
1319
1319
  notify(errorText(err, "Could not save the skill"), "error");
1320
1320
  }
1321
1321
  };
1322
1322
  return /* @__PURE__ */ jsxRuntime.jsx(
1323
- chunkABUO6PIQ_cjs.SkillEditForm,
1323
+ chunkWO7QAVTL_cjs.SkillEditForm,
1324
1324
  {
1325
1325
  name,
1326
1326
  onNameChange: setName,
@@ -1356,13 +1356,13 @@ function ConnectedAgentCreator({
1356
1356
  agent,
1357
1357
  initialName,
1358
1358
  onSaved,
1359
- capabilities = chunkABUO6PIQ_cjs.DEFAULT_AGENT_CAPABILITIES,
1360
- templates = chunkABUO6PIQ_cjs.DEFAULT_AGENT_TEMPLATES,
1361
- types = chunkABUO6PIQ_cjs.DEFAULT_AGENT_TYPES,
1359
+ capabilities = chunkWO7QAVTL_cjs.DEFAULT_AGENT_CAPABILITIES,
1360
+ templates = chunkWO7QAVTL_cjs.DEFAULT_AGENT_TEMPLATES,
1361
+ types = chunkWO7QAVTL_cjs.DEFAULT_AGENT_TYPES,
1362
1362
  canRevokeWorkspaces = false,
1363
1363
  labels
1364
1364
  }) {
1365
- const { notify } = chunkC4WSHRR6_cjs.useBlocksEnvironment();
1365
+ const { notify } = chunkKPZZ5FHE_cjs.useBlocksEnvironment();
1366
1366
  const isEdit = !!agent;
1367
1367
  const [saving, setSaving] = react.useState(false);
1368
1368
  const [skills, setSkills] = react.useState([]);
@@ -1400,7 +1400,7 @@ function ConnectedAgentCreator({
1400
1400
  const initialValues = react.useMemo(
1401
1401
  () => ({
1402
1402
  name: agent?.given_name ?? initialName ?? "",
1403
- persona: isEdit ? chunkABUO6PIQ_cjs.stripPersonaPreamble(String(agents.PERSONA ?? "")) : "",
1403
+ persona: isEdit ? chunkWO7QAVTL_cjs.stripPersonaPreamble(String(agents.PERSONA ?? "")) : "",
1404
1404
  modelName: String(agents.AGENT_MODEL_NAME ?? ""),
1405
1405
  capabilities: Object.fromEntries(capabilities.map(({ key }) => [key, Boolean(agents[key])])),
1406
1406
  type: "builtin",
@@ -1419,7 +1419,7 @@ function ConnectedAgentCreator({
1419
1419
  try {
1420
1420
  let agentExtId = agent?.external_id ?? early?.id ?? "";
1421
1421
  if (!agentExtId) {
1422
- if (!chunkABUO6PIQ_cjs.isValidAgentName(values.name)) {
1422
+ if (!chunkWO7QAVTL_cjs.isValidAgentName(values.name)) {
1423
1423
  notify("Give the agent a name first.", "error");
1424
1424
  return;
1425
1425
  }
@@ -1455,7 +1455,7 @@ function ConnectedAgentCreator({
1455
1455
  title: `agent-${name}`,
1456
1456
  sections: {
1457
1457
  Agents: {
1458
- PERSONA: chunkABUO6PIQ_cjs.composePersona(name, values.persona),
1458
+ PERSONA: chunkWO7QAVTL_cjs.composePersona(name, values.persona),
1459
1459
  ...values.modelName ? { AGENT_MODEL_NAME: values.modelName } : {},
1460
1460
  ...Object.fromEntries(capabilities.map(({ key }) => [key, !!values.capabilities[key]])),
1461
1461
  ENABLED_SKILLS: values.capabilities.SKILLS_ENABLED && skills.length ? skills : null,
@@ -1478,7 +1478,7 @@ function ConnectedAgentCreator({
1478
1478
  };
1479
1479
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1480
1480
  /* @__PURE__ */ jsxRuntime.jsx(
1481
- chunkABUO6PIQ_cjs.AgentCreator,
1481
+ chunkWO7QAVTL_cjs.AgentCreator,
1482
1482
  {
1483
1483
  open: ready,
1484
1484
  onOpenChange,
@@ -1494,11 +1494,11 @@ function ConnectedAgentCreator({
1494
1494
  ) : void 0,
1495
1495
  revokingWorkspaceId: revokeAccess.isPending ? revokeAccess.variables?.workspaceId : void 0,
1496
1496
  avatar: (values) => /* @__PURE__ */ jsxRuntime.jsx(
1497
- chunkABUO6PIQ_cjs.AgentAvatarField,
1497
+ chunkWO7QAVTL_cjs.AgentAvatarField,
1498
1498
  {
1499
1499
  picture,
1500
1500
  isBusy: avatarBusy,
1501
- canGenerate: isEdit || chunkABUO6PIQ_cjs.isValidAgentName(values.name),
1501
+ canGenerate: isEdit || chunkWO7QAVTL_cjs.isValidAgentName(values.name),
1502
1502
  onGenerate: () => handleGenerateAvatar(values)
1503
1503
  }
1504
1504
  ),
@@ -1550,7 +1550,7 @@ function ConnectedAgentCreator({
1550
1550
  /* @__PURE__ */ jsxRuntime.jsx(ui.DialogTitle, { children: "Connect your agent" }),
1551
1551
  /* @__PURE__ */ jsxRuntime.jsx(ui.DialogDescription, { children: "This key is shown once. Run the script on the machine that will host the agent." })
1552
1552
  ] }),
1553
- connect && /* @__PURE__ */ jsxRuntime.jsx(chunkABUO6PIQ_cjs.AgentConnectInstructions, { email: connect.email, signingKey: connect.signingKey })
1553
+ connect && /* @__PURE__ */ jsxRuntime.jsx(chunkWO7QAVTL_cjs.AgentConnectInstructions, { email: connect.email, signingKey: connect.signingKey })
1554
1554
  ]
1555
1555
  }
1556
1556
  ) })
@@ -1584,10 +1584,10 @@ function ConnectedWorkflowHistory({
1584
1584
  renderErrorReport,
1585
1585
  labels
1586
1586
  }) {
1587
- const { openConversation } = chunkC4WSHRR6_cjs.useBlocksEnvironment();
1587
+ const { openConversation } = chunkKPZZ5FHE_cjs.useBlocksEnvironment();
1588
1588
  const { data: runs = [], isLoading } = react$1.useWorkflowRuns(workflow?.external_id);
1589
1589
  return /* @__PURE__ */ jsxRuntime.jsx(
1590
- chunkABUO6PIQ_cjs.TaskRunsDialog,
1590
+ chunkWO7QAVTL_cjs.TaskRunsDialog,
1591
1591
  {
1592
1592
  inline,
1593
1593
  hideHeader,
@@ -1623,14 +1623,14 @@ function ConnectedTaskActivityDialog({
1623
1623
  const activity = react$1.useConversationActivity(conversationId, { live });
1624
1624
  const { data: agents = [] } = react$1.useAgents();
1625
1625
  const { userId } = chunkGFNELPDP_cjs.useConnectedWorkspace();
1626
- const { members } = chunkRA3ZJ45L_cjs.useConnectedWorkspaceRole();
1626
+ const { members } = chunkULPFRK3J_cjs.useConnectedWorkspaceRole();
1627
1627
  const renderPerson = react.useCallback(
1628
1628
  (id) => {
1629
1629
  const isMe = !!id && id === userId;
1630
1630
  const member = members.find((m) => m.user.external_id === id)?.user;
1631
1631
  const name = member && [member.given_name, member.family_name].filter(Boolean).join(" ") || member?.email;
1632
1632
  const person = { id, label: isMe ? "You" : name || "Someone", isMe };
1633
- return renderTaskPerson ? renderTaskPerson(person) : /* @__PURE__ */ jsxRuntime.jsx(chunkO2ODDTMA_cjs.PersonPill, { person });
1633
+ return renderTaskPerson ? renderTaskPerson(person) : /* @__PURE__ */ jsxRuntime.jsx(chunkNSNHRZBH_cjs.PersonPill, { person });
1634
1634
  },
1635
1635
  [renderTaskPerson, userId, members]
1636
1636
  );
@@ -1639,7 +1639,7 @@ function ConnectedTaskActivityDialog({
1639
1639
  [agents]
1640
1640
  );
1641
1641
  return /* @__PURE__ */ jsxRuntime.jsx(
1642
- chunkABUO6PIQ_cjs.TaskActivityDialog,
1642
+ chunkWO7QAVTL_cjs.TaskActivityDialog,
1643
1643
  {
1644
1644
  open: true,
1645
1645
  onOpenChange: (open) => !open && onClose(),
@@ -1785,7 +1785,7 @@ function useWorkflowThread(workflow, options = {}) {
1785
1785
  );
1786
1786
  const conversation = conversations.data?.find((c) => c.external_id === threadId);
1787
1787
  const steps = react.useMemo(
1788
- () => chunkJSTKEZBS_cjs.workflowSteps(workflow).length > 0 ? chunkJSTKEZBS_cjs.workflowSteps(workflow) : chunkABUO6PIQ_cjs.fromPlanSteps(conversation?.plan?.steps ?? []),
1788
+ () => chunkJSTKEZBS_cjs.workflowSteps(workflow).length > 0 ? chunkJSTKEZBS_cjs.workflowSteps(workflow) : chunkWO7QAVTL_cjs.fromPlanSteps(conversation?.plan?.steps ?? []),
1789
1789
  [workflow, conversation?.plan?.steps]
1790
1790
  );
1791
1791
  const activity = react$1.useConversationActivity(threadId, { live: !!threadId });
@@ -1845,7 +1845,7 @@ function useWorkflowThread(workflow, options = {}) {
1845
1845
  criteria: [],
1846
1846
  max_passes: 3,
1847
1847
  documents: [],
1848
- steps: chunkABUO6PIQ_cjs.toPlanSteps(workflow, {
1848
+ steps: chunkWO7QAVTL_cjs.toPlanSteps(workflow, {
1849
1849
  inputs: values,
1850
1850
  resolveWorkflow: options.resolveWorkflow,
1851
1851
  compose: options.compose
@@ -1932,7 +1932,7 @@ function useWorkflowThread(workflow, options = {}) {
1932
1932
  const anyRunning = Object.values(states).some((s) => s.status === "running");
1933
1933
  const needsStart = !threadId || idle && !anyRunning;
1934
1934
  const runError = idle ? conversation?.last_error ?? null : null;
1935
- const view = chunkABUO6PIQ_cjs.useWorkflowView({
1935
+ const view = chunkWO7QAVTL_cjs.useWorkflowView({
1936
1936
  steps,
1937
1937
  states,
1938
1938
  inputs,
@@ -2100,7 +2100,7 @@ function WorkflowWordDialog({
2100
2100
  title: title ?? labels.wordTitle,
2101
2101
  size: "xl",
2102
2102
  testId: "workflow-word-dialog",
2103
- children: /* @__PURE__ */ jsxRuntime.jsx(chunkULWRNGGE_cjs.ModalScaffold.Body, { className: "h-[70dvh] p-0", children: /* @__PURE__ */ jsxRuntime.jsx(chunkRA3ZJ45L_cjs.ConnectedNativeDocxEditor, { documentId: id, title: title ?? labels.wordTitle }) })
2103
+ children: /* @__PURE__ */ jsxRuntime.jsx(chunkULWRNGGE_cjs.ModalScaffold.Body, { className: "h-[70dvh] p-0", children: /* @__PURE__ */ jsxRuntime.jsx(chunkULPFRK3J_cjs.ConnectedNativeDocxEditor, { documentId: id, title: title ?? labels.wordTitle }) })
2104
2104
  }
2105
2105
  );
2106
2106
  }
@@ -2409,7 +2409,7 @@ function ConnectedWorkflowRunner({
2409
2409
  );
2410
2410
  };
2411
2411
  const runner = (compact) => /* @__PURE__ */ jsxRuntime.jsx(
2412
- chunkABUO6PIQ_cjs.WorkflowRunner,
2412
+ chunkWO7QAVTL_cjs.WorkflowRunner,
2413
2413
  {
2414
2414
  people,
2415
2415
  ...runnerProps,
@@ -2455,7 +2455,7 @@ function ConnectedWorkflowRunner({
2455
2455
  ) }),
2456
2456
  inThread && conversationId ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2457
2457
  /* @__PURE__ */ jsxRuntime.jsx(
2458
- chunkABUO6PIQ_cjs.WorkflowStepBar,
2458
+ chunkWO7QAVTL_cjs.WorkflowStepBar,
2459
2459
  {
2460
2460
  run: view,
2461
2461
  levels: chunkJSTKEZBS_cjs.stepLevels(view.steps),
@@ -2656,7 +2656,7 @@ function ConnectedTagTable({
2656
2656
  const fail = (e) => setError(e instanceof Error ? e.message : String(e));
2657
2657
  const snapshot = (data) => {
2658
2658
  const title = exportTitle ?? KIND_TITLES[kind];
2659
- const bytes = chunkBUWBXJ2N_cjs.tagTableDocx(data, {
2659
+ const bytes = chunk34GDGE77_cjs.tagTableDocx(data, {
2660
2660
  title,
2661
2661
  nameOf: (id) => people.find((p) => p.value === id)?.label
2662
2662
  });
@@ -2666,7 +2666,7 @@ function ConnectedTagTable({
2666
2666
  };
2667
2667
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
2668
2668
  /* @__PURE__ */ jsxRuntime.jsx(
2669
- chunkBUWBXJ2N_cjs.TagTable,
2669
+ chunk34GDGE77_cjs.TagTable,
2670
2670
  {
2671
2671
  ...props,
2672
2672
  table,
@@ -2743,6 +2743,11 @@ function useConnectedShellWorkspaces(options = {}) {
2743
2743
  select: (workspace) => setWorkspace(workspace.id)
2744
2744
  });
2745
2745
  }
2746
+ function SessionStatusIcon({ status, className }) {
2747
+ if (status === "agent") return /* @__PURE__ */ jsxRuntime.jsx(react$1.ArbiBotHeadIcon, { className: className ?? "w-4 h-4" });
2748
+ return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Monitor, { className: className ?? "w-4 h-4 text-muted-foreground" });
2749
+ }
2750
+ var renderSessionStatusIcon = (status) => /* @__PURE__ */ jsxRuntime.jsx(SessionStatusIcon, { status });
2746
2751
  function errorText2(error, fallback) {
2747
2752
  const body = error?.apiError;
2748
2753
  return typeof body?.detail === "string" ? body.detail : fallback;
@@ -2757,7 +2762,7 @@ function ConnectedProfileCard({
2757
2762
  avatarClassName = "bg-primary text-primary-foreground",
2758
2763
  children
2759
2764
  }) {
2760
- const { notify } = chunkC4WSHRR6_cjs.useBlocksEnvironment();
2765
+ const { notify } = chunkKPZZ5FHE_cjs.useBlocksEnvironment();
2761
2766
  const { data: profile } = react$1.useProfile();
2762
2767
  const updateProfile = react$1.useUpdateProfile();
2763
2768
  const requestEmailChange = react$1.useRequestEmailChange();
@@ -2808,13 +2813,13 @@ function ConnectedProfileCard({
2808
2813
  }
2809
2814
  });
2810
2815
  const display = profile?.fullName || "Unnamed";
2811
- return /* @__PURE__ */ jsxRuntime.jsxs(chunkQIMVTGKS_cjs.SettingsSection, { icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.UserCircle, {}), title, children: [
2816
+ return /* @__PURE__ */ jsxRuntime.jsxs(chunkU73KPFYH_cjs.SettingsSection, { icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.UserCircle, {}), title, children: [
2812
2817
  /* @__PURE__ */ jsxRuntime.jsx(
2813
- chunkQIMVTGKS_cjs.ProfileCard,
2818
+ chunkU73KPFYH_cjs.ProfileCard,
2814
2819
  {
2815
2820
  avatar: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2816
2821
  /* @__PURE__ */ jsxRuntime.jsx(
2817
- chunkQIMVTGKS_cjs.AvatarPicker,
2822
+ chunkU73KPFYH_cjs.AvatarPicker,
2818
2823
  {
2819
2824
  pictureUrl: profile?.picture,
2820
2825
  initials: chunkKDG6FER6_cjs.initials(display),
@@ -2853,7 +2858,7 @@ function ConnectedIdentityVerification({
2853
2858
  onManageBilling,
2854
2859
  formatPrice
2855
2860
  }) {
2856
- const { notify } = chunkC4WSHRR6_cjs.useBlocksEnvironment();
2861
+ const { notify } = chunkKPZZ5FHE_cjs.useBlocksEnvironment();
2857
2862
  const { data: profile } = react$1.useProfile();
2858
2863
  const flow = react$1.useIdentityVerification({
2859
2864
  formatPrice,
@@ -2861,9 +2866,9 @@ function ConnectedIdentityVerification({
2861
2866
  onNameAccepted: () => notify("Name updated to match your ID", "success")
2862
2867
  });
2863
2868
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2864
- /* @__PURE__ */ jsxRuntime.jsx(chunkQIMVTGKS_cjs.IdentityVerificationCard, { flow, labels, onManageBilling }),
2869
+ /* @__PURE__ */ jsxRuntime.jsx(chunkU73KPFYH_cjs.IdentityVerificationCard, { flow, labels, onManageBilling }),
2865
2870
  /* @__PURE__ */ jsxRuntime.jsx(
2866
- chunkQIMVTGKS_cjs.IdentityVerificationDialog,
2871
+ chunkU73KPFYH_cjs.IdentityVerificationDialog,
2867
2872
  {
2868
2873
  flow,
2869
2874
  accountName: profile?.fullName ?? "",
@@ -2876,7 +2881,7 @@ function ConnectedIdentityVerification({
2876
2881
  function ConnectedRequireVerified({ children, labels }) {
2877
2882
  const { data: profile } = react$1.useProfile();
2878
2883
  const flow = react$1.useIdentityVerification();
2879
- return /* @__PURE__ */ jsxRuntime.jsx(chunkQIMVTGKS_cjs.RequireVerified, { flow, accountName: profile?.fullName ?? "", labels, children });
2884
+ return /* @__PURE__ */ jsxRuntime.jsx(chunkU73KPFYH_cjs.RequireVerified, { flow, accountName: profile?.fullName ?? "", labels, children });
2880
2885
  }
2881
2886
  function defaultUnmetPasswordRequirement(password) {
2882
2887
  if (password.length < 8) return "Minimum 8 characters";
@@ -2893,7 +2898,7 @@ function ConnectedPasswordChangeDialog({
2893
2898
  recoveryMode = false,
2894
2899
  onRecoveryComplete
2895
2900
  }) {
2896
- const { notify } = chunkC4WSHRR6_cjs.useBlocksEnvironment();
2901
+ const { notify } = chunkKPZZ5FHE_cjs.useBlocksEnvironment();
2897
2902
  const change = react$1.usePasswordChange();
2898
2903
  const form = react$1.usePasswordChangeForm({
2899
2904
  recoveryMode,
@@ -2909,7 +2914,7 @@ function ConnectedPasswordChangeDialog({
2909
2914
  onRecoveryComplete
2910
2915
  });
2911
2916
  return /* @__PURE__ */ jsxRuntime.jsx(
2912
- chunkQIMVTGKS_cjs.PasswordChangeDialog,
2917
+ chunkU73KPFYH_cjs.PasswordChangeDialog,
2913
2918
  {
2914
2919
  open,
2915
2920
  onClose: form.onCancel,
@@ -2935,10 +2940,10 @@ function ConnectedSecuritySection({
2935
2940
  children
2936
2941
  }) {
2937
2942
  const [open, setOpen] = react.useState(false);
2938
- return /* @__PURE__ */ jsxRuntime.jsxs(chunkQIMVTGKS_cjs.SettingsSection, { icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.KeyRound, {}), title: "Security", children: [
2939
- /* @__PURE__ */ jsxRuntime.jsxs(chunkQIMVTGKS_cjs.SettingsCard, { padding: "sm", children: [
2943
+ return /* @__PURE__ */ jsxRuntime.jsxs(chunkU73KPFYH_cjs.SettingsSection, { icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.KeyRound, {}), title: "Security", children: [
2944
+ /* @__PURE__ */ jsxRuntime.jsxs(chunkU73KPFYH_cjs.SettingsCard, { padding: "sm", children: [
2940
2945
  /* @__PURE__ */ jsxRuntime.jsx(
2941
- chunkQIMVTGKS_cjs.SettingsActionRow,
2946
+ chunkU73KPFYH_cjs.SettingsActionRow,
2942
2947
  {
2943
2948
  title: "Change password",
2944
2949
  description: "Used to sign in and to unlock your account key. Changing it keeps everything readable and re-encrypts nothing.",
@@ -2959,41 +2964,43 @@ function ConnectedSecuritySection({
2959
2964
  ] });
2960
2965
  }
2961
2966
  function ConnectedNotificationPreferences({
2962
- categories = chunkQIMVTGKS_cjs.EMAIL_NOTIFICATION_CATEGORIES,
2967
+ categories = chunkU73KPFYH_cjs.EMAIL_NOTIFICATION_CATEGORIES,
2963
2968
  title = "Notifications"
2964
2969
  }) {
2965
2970
  const keys = react.useMemo(
2966
- () => categories === chunkQIMVTGKS_cjs.EMAIL_NOTIFICATION_CATEGORIES ? chunkQIMVTGKS_cjs.EMAIL_NOTIFICATION_KEYS : categories.map((c) => c.key),
2971
+ () => categories === chunkU73KPFYH_cjs.EMAIL_NOTIFICATION_CATEGORIES ? chunkU73KPFYH_cjs.EMAIL_NOTIFICATION_KEYS : categories.map((c) => c.key),
2967
2972
  [categories]
2968
2973
  );
2969
2974
  const prefs = react$1.useNotificationPreferences(keys);
2970
- return /* @__PURE__ */ jsxRuntime.jsx(chunkQIMVTGKS_cjs.SettingsSection, { title, children: /* @__PURE__ */ jsxRuntime.jsx(chunkQIMVTGKS_cjs.SettingsCard, { className: "space-y-0", children: /* @__PURE__ */ jsxRuntime.jsx(
2971
- chunkQIMVTGKS_cjs.NotificationCategoryList,
2975
+ return /* @__PURE__ */ jsxRuntime.jsx(chunkU73KPFYH_cjs.SettingsSection, { title, children: /* @__PURE__ */ jsxRuntime.jsx(chunkU73KPFYH_cjs.SettingsCard, { className: "space-y-0", children: /* @__PURE__ */ jsxRuntime.jsx(
2976
+ chunkU73KPFYH_cjs.NotificationCategoryList,
2972
2977
  {
2973
2978
  masterId: "emailNotifications",
2974
2979
  masterTitle: "Email Notifications",
2975
2980
  masterDescription: "Email me about activity when I\u2019m away",
2976
2981
  masterChecked: prefs.masterChecked,
2977
2982
  onMasterChange: prefs.setAll,
2978
- categories: chunkQIMVTGKS_cjs.toNotificationCategories(prefs.checked, categories),
2983
+ categories: chunkU73KPFYH_cjs.toNotificationCategories(prefs.checked, categories),
2979
2984
  onCategoryChange: prefs.setCategory
2980
2985
  }
2981
2986
  ) }) });
2982
2987
  }
2983
- function ConnectedSessionsRow({ renderSessionIcon }) {
2984
- const { notify, confirm } = chunkC4WSHRR6_cjs.useBlocksEnvironment();
2988
+ function ConnectedSessionsRow({
2989
+ renderSessionIcon = renderSessionStatusIcon
2990
+ }) {
2991
+ const { notify, confirm } = chunkKPZZ5FHE_cjs.useBlocksEnvironment();
2985
2992
  const [open, setOpen] = react.useState(false);
2986
2993
  const sessions = react$1.useSessions({ enabled: open });
2987
2994
  const currentSessionId = react$1.useCurrentSessionId();
2988
2995
  const terminate = react$1.useTerminateSession();
2989
- const views = chunkQIMVTGKS_cjs.toActiveSessionViews(sessions.data ?? [], {
2996
+ const views = chunkU73KPFYH_cjs.toActiveSessionViews(sessions.data ?? [], {
2990
2997
  currentSessionId,
2991
2998
  terminatingId: terminate.isPending ? terminate.variables : null,
2992
2999
  renderIcon: renderSessionIcon
2993
3000
  });
2994
3001
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2995
3002
  /* @__PURE__ */ jsxRuntime.jsx(
2996
- chunkQIMVTGKS_cjs.SettingsRow,
3003
+ chunkU73KPFYH_cjs.SettingsRow,
2997
3004
  {
2998
3005
  label: "Active sessions",
2999
3006
  description: "Devices and agents currently signed in to your account.",
@@ -3015,7 +3022,7 @@ function ConnectedSessionsRow({ renderSessionIcon }) {
3015
3022
  }
3016
3023
  ),
3017
3024
  /* @__PURE__ */ jsxRuntime.jsx(
3018
- chunkQIMVTGKS_cjs.ActiveSessionsDialog,
3025
+ chunkU73KPFYH_cjs.ActiveSessionsDialog,
3019
3026
  {
3020
3027
  open,
3021
3028
  onOpenChange: setOpen,
@@ -3046,7 +3053,7 @@ function ConnectedLogoutDialog({
3046
3053
  onClose,
3047
3054
  canLogoutAll = true,
3048
3055
  confirmSignOut,
3049
- renderSessionIcon
3056
+ renderSessionIcon = renderSessionStatusIcon
3050
3057
  }) {
3051
3058
  const sessions = react$1.useSessions({ enabled: open });
3052
3059
  const signOut = react$1.useSignOut();
@@ -3057,7 +3064,7 @@ function ConnectedLogoutDialog({
3057
3064
  signOut.mutate({ everywhere, reason: "manual" });
3058
3065
  };
3059
3066
  return /* @__PURE__ */ jsxRuntime.jsx(
3060
- chunkQIMVTGKS_cjs.LogoutDialog,
3067
+ chunkU73KPFYH_cjs.LogoutDialog,
3061
3068
  {
3062
3069
  open,
3063
3070
  onClose,
@@ -3065,13 +3072,13 @@ function ConnectedLogoutDialog({
3065
3072
  onLogoutAll: () => void run(true),
3066
3073
  canLogoutAll,
3067
3074
  isOnline,
3068
- sessions: chunkQIMVTGKS_cjs.toLogoutSessionViews(sessions.data ?? []),
3075
+ sessions: chunkU73KPFYH_cjs.toLogoutSessionViews(sessions.data ?? []),
3069
3076
  renderSessionIcon
3070
3077
  }
3071
3078
  );
3072
3079
  }
3073
3080
  function ConnectedDangerZone({ renderSubscriptionLink }) {
3074
- const { notify } = chunkC4WSHRR6_cjs.useBlocksEnvironment();
3081
+ const { notify } = chunkKPZZ5FHE_cjs.useBlocksEnvironment();
3075
3082
  const [zoneOpen, setZoneOpen] = react.useState(false);
3076
3083
  const [dialogOpen, setDialogOpen] = react.useState(false);
3077
3084
  const { data: profile } = react$1.useProfile();
@@ -3087,7 +3094,7 @@ function ConnectedDangerZone({ renderSubscriptionLink }) {
3087
3094
  });
3088
3095
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3089
3096
  /* @__PURE__ */ jsxRuntime.jsx(
3090
- chunkQIMVTGKS_cjs.SettingsDangerZone,
3097
+ chunkU73KPFYH_cjs.SettingsDangerZone,
3091
3098
  {
3092
3099
  isOpen: zoneOpen,
3093
3100
  onToggle: () => setZoneOpen((o) => !o),
@@ -3107,12 +3114,12 @@ function ConnectedDangerZone({ renderSubscriptionLink }) {
3107
3114
  }
3108
3115
  ),
3109
3116
  /* @__PURE__ */ jsxRuntime.jsx(
3110
- chunkQIMVTGKS_cjs.DeleteAccountDialog,
3117
+ chunkU73KPFYH_cjs.DeleteAccountDialog,
3111
3118
  {
3112
3119
  open: dialogOpen,
3113
3120
  onClose: flow.onClose,
3114
3121
  step: flow.step,
3115
- blockers: chunkQIMVTGKS_cjs.toDeleteBlockerViews(flow.blockers, renderSubscriptionLink),
3122
+ blockers: chunkU73KPFYH_cjs.toDeleteBlockerViews(flow.blockers, renderSubscriptionLink),
3116
3123
  onContinue: flow.onContinue,
3117
3124
  onBack: flow.onBack,
3118
3125
  userEmail,
@@ -3124,211 +3131,80 @@ function ConnectedDangerZone({ renderSubscriptionLink }) {
3124
3131
  )
3125
3132
  ] });
3126
3133
  }
3127
- function useConnectedDocxNotifications(onOpen) {
3128
- const arbi = react$1.useArbi();
3129
- const { status, user, apiUrl } = chunkGFNELPDP_cjs.useConnection();
3130
- const { notify } = chunkC4WSHRR6_cjs.useBlocksEnvironment();
3131
- const queries = reactQuery.useQueryClient();
3132
- const source = `docx-mentions:${apiUrl}:${user?.externalId || ""}`;
3133
- const queryKey = ["docx-mentions", apiUrl, user?.externalId];
3134
- const { data = [] } = reactQuery.useQuery({
3135
- queryKey,
3136
- queryFn: () => arbi.notifications.list({ type: "docx_mention" }),
3137
- enabled: status === "authenticated",
3138
- refetchInterval: 3e4
3139
- });
3140
- react$1.useArbiWebSocket((message) => {
3141
- if (message.type === "docx_mention") void queries.invalidateQueries({ queryKey });
3142
- });
3143
- react.useEffect(() => {
3144
- const items = [];
3145
- if (status === "authenticated")
3146
- for (const note of data) {
3147
- if (note.recipient.external_id !== user?.externalId || !note.workspace_ext_id) continue;
3148
- try {
3149
- const target = JSON.parse(note.content || "{}");
3150
- if (!target.document_id?.startsWith("doc-") || !target.comment_id) continue;
3151
- const documentId = target.document_id, commentId = target.comment_id, workspaceId = note.workspace_ext_id;
3152
- items.push({
3153
- id: `docx:${note.external_id}`,
3154
- title: "Mentioned you in a document comment",
3155
- description: [note.sender.given_name, note.sender.family_name].filter(Boolean).join(" "),
3156
- variant: "info",
3157
- ts: Date.parse(note.created_at),
3158
- read: note.read,
3159
- source,
3160
- onSelect: () => {
3161
- void Promise.resolve(onOpen({ documentId, commentId, workspaceId })).catch(
3162
- (error) => notify(
3163
- error instanceof Error ? error.message : "Could not open the document.",
3164
- "error"
3165
- )
3166
- );
3167
- }
3168
- });
3169
- } catch {
3170
- }
3171
- }
3172
- shell.useNotify.getState().syncSource(source, items);
3173
- return () => shell.useNotify.getState().syncSource(source, []);
3174
- }, [data, status, user?.externalId, source, onOpen, notify]);
3175
- const markRead = async (ids) => {
3176
- try {
3177
- await arbi.notifications.markRead(ids);
3178
- await queries.invalidateQueries({ queryKey });
3179
- } catch {
3180
- notify("Could not mark document mentions read.", "error");
3181
- }
3182
- };
3183
- return {
3184
- onMarkRead: (id) => {
3185
- if (id.startsWith("docx:")) void markRead([id.slice(5)]);
3186
- },
3187
- onMarkAllRead: () => {
3188
- void markRead(
3189
- data.filter((note) => !note.read && note.recipient.external_id === user?.externalId).map((note) => note.external_id)
3190
- );
3191
- }
3192
- };
3193
- }
3194
- function useConnectedWorkNotifications(onOpen) {
3195
- const { status, user, apiUrl } = chunkGFNELPDP_cjs.useConnection();
3196
- const { notify } = chunkC4WSHRR6_cjs.useBlocksEnvironment();
3197
- const source = `work-notifications:${apiUrl}:${user?.externalId || ""}`;
3198
- const { data = [], markRead: persistRead } = react$1.useWorkNotifications({
3199
- apiUrl,
3200
- userId: user?.externalId,
3201
- enabled: status === "authenticated"
3202
- });
3203
- react.useEffect(() => {
3204
- const items = [];
3205
- if (status === "authenticated")
3206
- for (const note of data) {
3207
- if (note.recipient.external_id !== user?.externalId) continue;
3208
- const mapped = mapWorkNotification(note);
3209
- if (!mapped) continue;
3210
- items.push({
3211
- id: `work:${note.external_id}`,
3212
- title: mapped.title,
3213
- variant: note.type === "workflow_failed" ? "error" : note.type === "conversation_done" ? "success" : "info",
3214
- ts: Date.parse(note.created_at),
3215
- read: note.read,
3216
- source,
3217
- onSelect: () => {
3218
- void Promise.resolve().then(() => onOpen(mapped.target)).catch(
3219
- (error) => notify(
3220
- error instanceof Error ? error.message : "Could not open this notification.",
3221
- "error"
3222
- )
3223
- );
3224
- }
3225
- });
3226
- }
3227
- shell.useNotify.getState().syncSource(source, items);
3228
- return () => shell.useNotify.getState().syncSource(source, []);
3229
- }, [data, status, user?.externalId, source, onOpen, notify]);
3230
- const markRead = async (ids) => {
3231
- if (!ids.length) return;
3134
+ function ServerConnectionRow({ onRefresh, ...status }) {
3135
+ const { runtimeConfig } = chunkKPZZ5FHE_cjs.useBlocksEnvironment();
3136
+ const [isRefreshing, setIsRefreshing] = react.useState(false);
3137
+ const view = chunkU73KPFYH_cjs.serverConnectionView(status, runtimeConfig.deploymentDomain || "server");
3138
+ const refresh = async () => {
3139
+ setIsRefreshing(true);
3232
3140
  try {
3233
- await persistRead(ids);
3234
- } catch {
3235
- notify("Could not mark work notifications read.", "error");
3141
+ await onRefresh();
3142
+ } finally {
3143
+ setIsRefreshing(false);
3236
3144
  }
3237
3145
  };
3238
- return {
3239
- onMarkRead: (id) => {
3240
- if (data.some(
3241
- (note) => `work:${note.external_id}` === id && note.recipient.external_id === user?.externalId && mapWorkNotification(note)
3242
- ))
3243
- void markRead([id.slice(5)]);
3244
- },
3245
- onMarkAllRead: () => {
3246
- void markRead(
3247
- data.filter(
3248
- (note) => !note.read && note.recipient.external_id === user?.externalId && mapWorkNotification(note)
3249
- ).map((note) => note.external_id)
3250
- );
3146
+ return /* @__PURE__ */ jsxRuntime.jsx(chunkU73KPFYH_cjs.SettingsRow, { label: "Server connection", description: view.description, children: /* @__PURE__ */ jsxRuntime.jsx(
3147
+ chunkU73KPFYH_cjs.ServerConnectionButton,
3148
+ {
3149
+ state: view.state,
3150
+ label: view.label,
3151
+ isRefreshing,
3152
+ onRefresh: () => void refresh()
3251
3153
  }
3252
- };
3154
+ ) });
3253
3155
  }
3254
- function mapWorkNotification(note) {
3255
- const sender = [note.sender.given_name, note.sender.family_name].filter(Boolean).join(" ") || note.sender.email;
3256
- if (note.type === "workflow_failed") {
3257
- try {
3258
- const payload = JSON.parse(note.content || "{}");
3259
- if (!payload.workflow_ext_id?.match(/^wfl-[a-zA-Z0-9]+$/)) return null;
3260
- if (note.workspace_ext_id?.match(/^wrk-[a-zA-Z0-9]+$/) && note.conversation_ext_id?.match(/^con-[a-zA-Z0-9]+$/)) {
3261
- return {
3262
- title: "A workflow failed to run",
3263
- target: {
3264
- kind: "conversation",
3265
- workspaceId: note.workspace_ext_id,
3266
- conversationId: note.conversation_ext_id
3267
- }
3268
- };
3156
+ function ConnectedAccountSettings({
3157
+ avatarClassName,
3158
+ onManageBilling,
3159
+ formatIdentityPrice,
3160
+ afterProfile,
3161
+ getUnmetPasswordRequirement,
3162
+ securityRows,
3163
+ connection,
3164
+ onLogout,
3165
+ renderSessionIcon,
3166
+ renderSubscriptionLink
3167
+ }) {
3168
+ const [logoutOpen, setLogoutOpen] = react.useState(false);
3169
+ return /* @__PURE__ */ jsxRuntime.jsxs(chunkU73KPFYH_cjs.SettingsPanel, { className: "max-w-2xl", children: [
3170
+ /* @__PURE__ */ jsxRuntime.jsx(ConnectedProfileCard, { avatarClassName, children: /* @__PURE__ */ jsxRuntime.jsx(
3171
+ ConnectedIdentityVerification,
3172
+ {
3173
+ onManageBilling,
3174
+ formatPrice: formatIdentityPrice
3269
3175
  }
3270
- return {
3271
- title: "A workflow failed to run",
3272
- target: {
3273
- kind: "workflow",
3274
- workflowId: payload.workflow_ext_id,
3275
- workspaceId: note.workspace_ext_id || void 0
3176
+ ) }),
3177
+ afterProfile,
3178
+ /* @__PURE__ */ jsxRuntime.jsx(ConnectedSecuritySection, { getUnmetRequirement: getUnmetPasswordRequirement, children: securityRows }),
3179
+ /* @__PURE__ */ jsxRuntime.jsx(chunkU73KPFYH_cjs.SettingsSection, { icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Wifi, {}), title: "Session", children: /* @__PURE__ */ jsxRuntime.jsxs(chunkU73KPFYH_cjs.SettingsCard, { children: [
3180
+ connection && /* @__PURE__ */ jsxRuntime.jsx(ServerConnectionRow, { ...connection }),
3181
+ /* @__PURE__ */ jsxRuntime.jsx(ConnectedSessionsRow, { renderSessionIcon }),
3182
+ /* @__PURE__ */ jsxRuntime.jsx(chunkU73KPFYH_cjs.SettingsRow, { label: "Logout", description: "Sign out of your account on this device.", children: /* @__PURE__ */ jsxRuntime.jsxs(
3183
+ ui.Button,
3184
+ {
3185
+ type: "button",
3186
+ variant: "secondary",
3187
+ size: "sm",
3188
+ onClick: onLogout ?? (() => setLogoutOpen(true)),
3189
+ className: "flex items-center gap-2",
3190
+ "data-testid": "logout-button",
3191
+ children: [
3192
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.LogOut, { className: "w-4 h-4" }),
3193
+ "Logout"
3194
+ ]
3276
3195
  }
3277
- };
3278
- } catch {
3279
- return null;
3280
- }
3281
- }
3282
- if (note.type === "mail_draft_ready") {
3283
- const draftId = react$1.mailDraftIdFromContent(note.content);
3284
- if (!draftId) return null;
3285
- return {
3286
- title: `${sender} left a draft email for you to review`,
3287
- target: { kind: "mail_draft", draftId, mailbox: "native" }
3288
- };
3289
- }
3290
- const titles = {
3291
- mention: `${sender} mentioned you in a conversation`,
3292
- workspace_access_request: `${sender} needs workspace access to run a thread`,
3293
- conversation_ready: note.sender.external_id === note.recipient.external_id ? "Your thread is ready" : `${sender}\u2019s thread is ready`,
3294
- conversation_done: `${sender} marked a thread done`
3295
- };
3296
- const title = titles[note.type];
3297
- if (!title || !note.workspace_ext_id || !note.conversation_ext_id?.match(/^con-[a-zA-Z0-9]+$/))
3298
- return null;
3299
- return {
3300
- title,
3301
- target: {
3302
- kind: "conversation",
3303
- workspaceId: note.workspace_ext_id,
3304
- conversationId: note.conversation_ext_id,
3305
- ...note.message_ext_id ? { messageId: note.message_ext_id } : {}
3306
- }
3307
- };
3308
- }
3309
- function attachmentPath(accountId, messageId, attachmentId) {
3310
- return `${react$1.accountPath(accountId)}/messages/${encodeURIComponent(messageId)}/attachments/${encodeURIComponent(attachmentId)}`;
3311
- }
3312
- function saveFile(blob, name) {
3313
- const url = URL.createObjectURL(blob);
3314
- const link = document.createElement("a");
3315
- link.href = url;
3316
- link.download = name;
3317
- link.click();
3318
- setTimeout(() => URL.revokeObjectURL(url), 1e3);
3319
- }
3320
- function hydrateMailAttachments(client$1, account, messageId, attachments, { isOnline, offline }) {
3321
- return Promise.all(
3322
- attachments.map(async (a) => {
3323
- if (a.content_base64 != null) return a;
3324
- if (!isOnline) {
3325
- const file = await offline?.loadAttachment(account.id, messageId, a);
3326
- return file ? { ...a, content_base64: client.bytesToBase64(new Uint8Array(await file.arrayBuffer())) } : { ...a, content_base64: null };
3196
+ ) })
3197
+ ] }) }),
3198
+ /* @__PURE__ */ jsxRuntime.jsx(ConnectedDangerZone, { renderSubscriptionLink }),
3199
+ !onLogout && /* @__PURE__ */ jsxRuntime.jsx(
3200
+ ConnectedLogoutDialog,
3201
+ {
3202
+ open: logoutOpen,
3203
+ onClose: () => setLogoutOpen(false),
3204
+ renderSessionIcon
3327
3205
  }
3328
- const response = await client$1.fetch(attachmentPath(account.id, messageId, a.id));
3329
- return react$1.fileAttachment(new File([await response.blob()], a.name, { type: a.content_type }));
3330
- })
3331
- );
3206
+ )
3207
+ ] });
3332
3208
  }
3333
3209
  function ConnectedMailAccounts({
3334
3210
  policy,
@@ -3553,6 +3429,504 @@ function ConnectedMailAccounts({
3553
3429
  }
3554
3430
  );
3555
3431
  }
3432
+ var noop = () => {
3433
+ };
3434
+ function ConnectedMailSettings({ oauthReturnPath, settings }) {
3435
+ const { data: policy } = react$1.useMailPolicy();
3436
+ const accounts = react$1.useMailAccounts({ enabled: !!policy?.enabled });
3437
+ const { data: profile } = react$1.useProfile();
3438
+ if (accounts.isError) {
3439
+ return /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: accounts.error.message });
3440
+ }
3441
+ if (!policy || !accounts.isSuccess) return /* @__PURE__ */ jsxRuntime.jsx("p", { children: "Loading mail accounts\u2026" });
3442
+ return /* @__PURE__ */ jsxRuntime.jsx(
3443
+ ConnectedMailAccounts,
3444
+ {
3445
+ embedded: true,
3446
+ policy,
3447
+ accounts: accounts.data,
3448
+ user: profile && { given_name: profile.givenName, family_name: profile.familyName },
3449
+ oauthReturnPath,
3450
+ settings,
3451
+ onClose: noop
3452
+ },
3453
+ profile ? "named" : "unnamed"
3454
+ );
3455
+ }
3456
+ function ConnectedPrivacySettings({
3457
+ rows,
3458
+ showTipsReset = false
3459
+ }) {
3460
+ const { data: settings } = react$1.useUserSettings();
3461
+ const update = react$1.useUpdateUserSettings();
3462
+ const hideOnlineStatus = settings?.hide_online_status ?? false;
3463
+ const dismissedTips = settings?.dismissed_tips ?? [];
3464
+ return /* @__PURE__ */ jsxRuntime.jsxs(chunkU73KPFYH_cjs.SettingsPanel, { className: "max-w-2xl", children: [
3465
+ /* @__PURE__ */ jsxRuntime.jsx(chunkU73KPFYH_cjs.SettingsSection, { title: "Privacy and tips", children: /* @__PURE__ */ jsxRuntime.jsxs(chunkU73KPFYH_cjs.SettingsCard, { children: [
3466
+ /* @__PURE__ */ jsxRuntime.jsx(
3467
+ chunkU73KPFYH_cjs.SettingsRow,
3468
+ {
3469
+ label: "Show Online Status",
3470
+ labelFor: "showOnlineStatus",
3471
+ description: "When on, other users can see when you're online",
3472
+ children: /* @__PURE__ */ jsxRuntime.jsx(
3473
+ ui.Switch,
3474
+ {
3475
+ id: "showOnlineStatus",
3476
+ checked: !hideOnlineStatus,
3477
+ onCheckedChange: (value) => update.mutate({ hide_online_status: !value }),
3478
+ "data-testid": "toggle-show-online-status"
3479
+ }
3480
+ )
3481
+ }
3482
+ ),
3483
+ rows,
3484
+ showTipsReset && /* @__PURE__ */ jsxRuntime.jsx(
3485
+ chunkU73KPFYH_cjs.SettingsRow,
3486
+ {
3487
+ label: "Hidden tips",
3488
+ description: "Restore any Smart Tips you\u2019ve hidden with \u201Cdon\u2019t show again\u201D.",
3489
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
3490
+ ui.Button,
3491
+ {
3492
+ type: "button",
3493
+ variant: "outline",
3494
+ size: "sm",
3495
+ onClick: () => update.mutate({ dismissed_tips: [] }),
3496
+ disabled: dismissedTips.length === 0,
3497
+ className: "gap-1.5",
3498
+ "data-testid": "reset-tips-button",
3499
+ children: [
3500
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.RotateCcw, { className: "h-4 w-4" }),
3501
+ "Reset tips"
3502
+ ]
3503
+ }
3504
+ )
3505
+ }
3506
+ )
3507
+ ] }) }),
3508
+ /* @__PURE__ */ jsxRuntime.jsx(ConnectedNotificationPreferences, {})
3509
+ ] });
3510
+ }
3511
+ var PROVIDER_NAMES = {
3512
+ openai: "OpenAI",
3513
+ fireworks_ai: "Fireworks AI",
3514
+ "vertex_ai-language-models": "Google",
3515
+ vertex_ai: "Google",
3516
+ gemini: "Google",
3517
+ anthropic: "Anthropic"
3518
+ };
3519
+ var isStandard = (model) => !!model?.tags?.includes("Standard");
3520
+ function PremiumCostHeader() {
3521
+ return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex items-center gap-0.5", children: "\xA3/MT in-out" });
3522
+ }
3523
+ function cheapest(models) {
3524
+ return [...models].sort((a, b) => {
3525
+ const ao = a.output_cost_per_token;
3526
+ const bo = b.output_cost_per_token;
3527
+ if (ao == null && bo == null) return 0;
3528
+ if (ao == null) return 1;
3529
+ if (bo == null) return -1;
3530
+ return ao - bo;
3531
+ })[0];
3532
+ }
3533
+ var COLUMNS = [
3534
+ {
3535
+ colId: "model_name",
3536
+ headerName: "Model",
3537
+ field: "model_name",
3538
+ flex: 2,
3539
+ minWidth: 130,
3540
+ tooltipField: "model_name"
3541
+ },
3542
+ {
3543
+ colId: "provider",
3544
+ headerName: "Provider",
3545
+ field: "provider",
3546
+ flex: 1,
3547
+ minWidth: 120,
3548
+ cellRenderer: (params) => isStandard(params.data) ? /* @__PURE__ */ jsxRuntime.jsx(
3549
+ chunkU73KPFYH_cjs.ModelProviderLabel,
3550
+ {
3551
+ logo: /* @__PURE__ */ jsxRuntime.jsx("img", { src: "/favicon.svg", alt: "ARBI", className: "size-3.5 flex-shrink-0 rounded-sm" }),
3552
+ children: "ARBI CITY"
3553
+ }
3554
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
3555
+ chunkU73KPFYH_cjs.ModelProviderLabel,
3556
+ {
3557
+ logo: /* @__PURE__ */ jsxRuntime.jsx(react$1.ProviderIcon, { modelName: params.data?.model_name, provider: params.value, size: 14 }),
3558
+ children: PROVIDER_NAMES[params.value ?? ""] || params.value || "\u2014"
3559
+ }
3560
+ )
3561
+ },
3562
+ {
3563
+ // Input and output cost in one column so the table fits the panel; sorted by output cost.
3564
+ colId: "cost",
3565
+ headerName: "Cost / MTok",
3566
+ headerComponentParams: { innerHeaderComponent: PremiumCostHeader },
3567
+ headerTooltip: "\xA3 per million tokens \u2014 input then output",
3568
+ field: "output_cost_per_token",
3569
+ flex: 1,
3570
+ minWidth: 120,
3571
+ type: "rightAligned",
3572
+ cellRenderer: (params) => /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "tabular-nums", children: [
3573
+ react$1.formatGbpPerMillionTokens(params.data?.input_cost_per_token) ?? "\xA30",
3574
+ "-",
3575
+ react$1.formatGbpPerMillionTokens(params.data?.output_cost_per_token) ?? "\xA30"
3576
+ ] })
3577
+ }
3578
+ ];
3579
+ function ConnectedPremiumModels() {
3580
+ const { notify } = chunkKPZZ5FHE_cjs.useBlocksEnvironment();
3581
+ const { data: settings } = react$1.useUserSettings();
3582
+ const update = react$1.useUpdateUserSettings();
3583
+ const { data: available } = react$1.useAvailableModels();
3584
+ const isDeveloper = settings?.developer === true;
3585
+ const premiumModel = settings?.premium_model;
3586
+ const premiumModels = react.useMemo(
3587
+ () => (available?.models ?? []).filter(
3588
+ (m) => m.tags?.includes("Premium") && (isDeveloper || !m.model_name.includes("@"))
3589
+ ),
3590
+ [available, isDeveloper]
3591
+ );
3592
+ const rows = react.useMemo(() => {
3593
+ const standards = (available?.models ?? []).filter(isStandard);
3594
+ if (standards.length === 0) return premiumModels;
3595
+ const reference = {
3596
+ ...standards[0],
3597
+ model_name: `Standard (${standards.map((m) => m.model_name).join(", ")})`
3598
+ };
3599
+ return [reference, ...premiumModels];
3600
+ }, [available, premiumModels]);
3601
+ const current = premiumModel ?? available?.premium_default ?? "";
3602
+ const save = react.useCallback(
3603
+ (model) => update.mutate(
3604
+ { premium_model: model },
3605
+ {
3606
+ onError: (err) => notify(`Failed to update Premium setting: ${String(err)}`, "error")
3607
+ }
3608
+ ),
3609
+ [update, notify]
3610
+ );
3611
+ const currentRef = react.useRef(current);
3612
+ currentRef.current = current;
3613
+ const [selected, setSelected] = react.useState([]);
3614
+ react.useEffect(() => {
3615
+ const match = premiumModels.filter((m) => m.model_name === current);
3616
+ setSelected(
3617
+ (prev) => prev.length === match.length && prev[0]?.model_name === match[0]?.model_name ? prev : match
3618
+ );
3619
+ }, [current, premiumModels]);
3620
+ const onSelectionChange = react.useCallback(
3621
+ (items) => {
3622
+ const picked = items.filter((m) => !isStandard(m));
3623
+ const next = picked[0]?.model_name;
3624
+ if (!next || next === currentRef.current) return;
3625
+ setSelected(picked);
3626
+ save(next);
3627
+ },
3628
+ [save]
3629
+ );
3630
+ if (premiumModels.length === 0) return null;
3631
+ return /* @__PURE__ */ jsxRuntime.jsx(chunkU73KPFYH_cjs.SettingsPanel, { className: "max-w-2xl space-y-4", children: /* @__PURE__ */ jsxRuntime.jsx(chunkU73KPFYH_cjs.SettingsSection, { title: "Premium models", children: /* @__PURE__ */ jsxRuntime.jsx(chunkU73KPFYH_cjs.SettingsCard, { className: "space-y-0", children: /* @__PURE__ */ jsxRuntime.jsx(
3632
+ chunkU73KPFYH_cjs.PremiumModelsFrame,
3633
+ {
3634
+ enabled: premiumModel !== "",
3635
+ onEnabledChange: (enabled) => {
3636
+ const target = enabled ? cheapest(premiumModels)?.model_name : "";
3637
+ if (target !== void 0) save(target);
3638
+ },
3639
+ children: /* @__PURE__ */ jsxRuntime.jsx(
3640
+ chunkC2CWWEHO_cjs.GridView,
3641
+ {
3642
+ items: rows,
3643
+ columnDefs: COLUMNS,
3644
+ getItemId: (m) => m.model_name,
3645
+ selection: { mode: "single", selected, onSelectionChange },
3646
+ gridOptions: {
3647
+ rowClassRules: { "opacity-60 italic": (p) => isStandard(p.data) }
3648
+ },
3649
+ height: Math.min(rows.length * 40 + 48, 320),
3650
+ testId: "premium-model-grid"
3651
+ }
3652
+ )
3653
+ }
3654
+ ) }) }) });
3655
+ }
3656
+ var SETTINGS_SECTION_IDS = {
3657
+ account: "account",
3658
+ mail: "mail",
3659
+ privacy: "privacy",
3660
+ chat: "chat"
3661
+ };
3662
+ function accountSettingsSection(props) {
3663
+ return {
3664
+ id: SETTINGS_SECTION_IDS.account,
3665
+ label: "Account",
3666
+ icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.User, { className: "w-6 h-6" }),
3667
+ render: () => /* @__PURE__ */ jsxRuntime.jsx(ConnectedAccountSettings, { ...props })
3668
+ };
3669
+ }
3670
+ function mailSettingsSection(props) {
3671
+ return {
3672
+ id: SETTINGS_SECTION_IDS.mail,
3673
+ label: "Mail",
3674
+ icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Mail, { className: "w-6 h-6" }),
3675
+ render: () => /* @__PURE__ */ jsxRuntime.jsx(ConnectedMailSettings, { ...props })
3676
+ };
3677
+ }
3678
+ function privacySettingsSection(props) {
3679
+ return {
3680
+ id: SETTINGS_SECTION_IDS.privacy,
3681
+ label: "Privacy",
3682
+ icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.HatGlasses, { className: "w-6 h-6" }),
3683
+ render: () => /* @__PURE__ */ jsxRuntime.jsx(ConnectedPrivacySettings, { ...props })
3684
+ };
3685
+ }
3686
+ function chatSettingsSection() {
3687
+ return {
3688
+ id: SETTINGS_SECTION_IDS.chat,
3689
+ label: "Chat",
3690
+ icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MessageSquare, { className: "w-6 h-6" }),
3691
+ render: () => /* @__PURE__ */ jsxRuntime.jsx(ConnectedPremiumModels, {})
3692
+ };
3693
+ }
3694
+ var DEFAULT_SETTINGS_SECTIONS = [
3695
+ accountSettingsSection(),
3696
+ privacySettingsSection(),
3697
+ chatSettingsSection()
3698
+ ];
3699
+ function ConnectedSettingsPage({
3700
+ sections = DEFAULT_SETTINGS_SECTIONS,
3701
+ section,
3702
+ onSectionChange,
3703
+ ...page
3704
+ }) {
3705
+ const requested = chunkKPZZ5FHE_cjs.useRequestedSettingsSection();
3706
+ const [local, setLocal] = react.useState(requested?.section);
3707
+ react.useEffect(() => {
3708
+ if (requested) setLocal(requested.section);
3709
+ }, [requested]);
3710
+ const controlled = section !== void 0;
3711
+ return /* @__PURE__ */ jsxRuntime.jsx(
3712
+ chunkU73KPFYH_cjs.SettingsPage,
3713
+ {
3714
+ ...page,
3715
+ sections,
3716
+ activeSectionId: controlled ? section : local,
3717
+ onSectionChange: (id) => {
3718
+ if (!controlled) setLocal(id);
3719
+ onSectionChange?.(id);
3720
+ }
3721
+ }
3722
+ );
3723
+ }
3724
+ function useConnectedDocxNotifications(onOpen) {
3725
+ const arbi = react$1.useArbi();
3726
+ const { status, user, apiUrl } = chunkGFNELPDP_cjs.useConnection();
3727
+ const { notify } = chunkKPZZ5FHE_cjs.useBlocksEnvironment();
3728
+ const queries = reactQuery.useQueryClient();
3729
+ const source = `docx-mentions:${apiUrl}:${user?.externalId || ""}`;
3730
+ const queryKey = ["docx-mentions", apiUrl, user?.externalId];
3731
+ const { data = [] } = reactQuery.useQuery({
3732
+ queryKey,
3733
+ queryFn: () => arbi.notifications.list({ type: "docx_mention" }),
3734
+ enabled: status === "authenticated",
3735
+ refetchInterval: 3e4
3736
+ });
3737
+ react$1.useArbiWebSocket((message) => {
3738
+ if (message.type === "docx_mention") void queries.invalidateQueries({ queryKey });
3739
+ });
3740
+ react.useEffect(() => {
3741
+ const items = [];
3742
+ if (status === "authenticated")
3743
+ for (const note of data) {
3744
+ if (note.recipient.external_id !== user?.externalId || !note.workspace_ext_id) continue;
3745
+ try {
3746
+ const target = JSON.parse(note.content || "{}");
3747
+ if (!target.document_id?.startsWith("doc-") || !target.comment_id) continue;
3748
+ const documentId = target.document_id, commentId = target.comment_id, workspaceId = note.workspace_ext_id;
3749
+ items.push({
3750
+ id: `docx:${note.external_id}`,
3751
+ title: "Mentioned you in a document comment",
3752
+ description: [note.sender.given_name, note.sender.family_name].filter(Boolean).join(" "),
3753
+ variant: "info",
3754
+ ts: Date.parse(note.created_at),
3755
+ read: note.read,
3756
+ source,
3757
+ onSelect: () => {
3758
+ void Promise.resolve(onOpen({ documentId, commentId, workspaceId })).catch(
3759
+ (error) => notify(
3760
+ error instanceof Error ? error.message : "Could not open the document.",
3761
+ "error"
3762
+ )
3763
+ );
3764
+ }
3765
+ });
3766
+ } catch {
3767
+ }
3768
+ }
3769
+ shell.useNotify.getState().syncSource(source, items);
3770
+ return () => shell.useNotify.getState().syncSource(source, []);
3771
+ }, [data, status, user?.externalId, source, onOpen, notify]);
3772
+ const markRead = async (ids) => {
3773
+ try {
3774
+ await arbi.notifications.markRead(ids);
3775
+ await queries.invalidateQueries({ queryKey });
3776
+ } catch {
3777
+ notify("Could not mark document mentions read.", "error");
3778
+ }
3779
+ };
3780
+ return {
3781
+ onMarkRead: (id) => {
3782
+ if (id.startsWith("docx:")) void markRead([id.slice(5)]);
3783
+ },
3784
+ onMarkAllRead: () => {
3785
+ void markRead(
3786
+ data.filter((note) => !note.read && note.recipient.external_id === user?.externalId).map((note) => note.external_id)
3787
+ );
3788
+ }
3789
+ };
3790
+ }
3791
+ function useConnectedWorkNotifications(onOpen) {
3792
+ const { status, user, apiUrl } = chunkGFNELPDP_cjs.useConnection();
3793
+ const { notify } = chunkKPZZ5FHE_cjs.useBlocksEnvironment();
3794
+ const source = `work-notifications:${apiUrl}:${user?.externalId || ""}`;
3795
+ const { data = [], markRead: persistRead } = react$1.useWorkNotifications({
3796
+ apiUrl,
3797
+ userId: user?.externalId,
3798
+ enabled: status === "authenticated"
3799
+ });
3800
+ react.useEffect(() => {
3801
+ const items = [];
3802
+ if (status === "authenticated")
3803
+ for (const note of data) {
3804
+ if (note.recipient.external_id !== user?.externalId) continue;
3805
+ const mapped = mapWorkNotification(note);
3806
+ if (!mapped) continue;
3807
+ items.push({
3808
+ id: `work:${note.external_id}`,
3809
+ title: mapped.title,
3810
+ variant: note.type === "workflow_failed" ? "error" : note.type === "conversation_done" ? "success" : "info",
3811
+ ts: Date.parse(note.created_at),
3812
+ read: note.read,
3813
+ source,
3814
+ onSelect: () => {
3815
+ void Promise.resolve().then(() => onOpen(mapped.target)).catch(
3816
+ (error) => notify(
3817
+ error instanceof Error ? error.message : "Could not open this notification.",
3818
+ "error"
3819
+ )
3820
+ );
3821
+ }
3822
+ });
3823
+ }
3824
+ shell.useNotify.getState().syncSource(source, items);
3825
+ return () => shell.useNotify.getState().syncSource(source, []);
3826
+ }, [data, status, user?.externalId, source, onOpen, notify]);
3827
+ const markRead = async (ids) => {
3828
+ if (!ids.length) return;
3829
+ try {
3830
+ await persistRead(ids);
3831
+ } catch {
3832
+ notify("Could not mark work notifications read.", "error");
3833
+ }
3834
+ };
3835
+ return {
3836
+ onMarkRead: (id) => {
3837
+ if (data.some(
3838
+ (note) => `work:${note.external_id}` === id && note.recipient.external_id === user?.externalId && mapWorkNotification(note)
3839
+ ))
3840
+ void markRead([id.slice(5)]);
3841
+ },
3842
+ onMarkAllRead: () => {
3843
+ void markRead(
3844
+ data.filter(
3845
+ (note) => !note.read && note.recipient.external_id === user?.externalId && mapWorkNotification(note)
3846
+ ).map((note) => note.external_id)
3847
+ );
3848
+ }
3849
+ };
3850
+ }
3851
+ function mapWorkNotification(note) {
3852
+ const sender = [note.sender.given_name, note.sender.family_name].filter(Boolean).join(" ") || note.sender.email;
3853
+ if (note.type === "workflow_failed") {
3854
+ try {
3855
+ const payload = JSON.parse(note.content || "{}");
3856
+ if (!payload.workflow_ext_id?.match(/^wfl-[a-zA-Z0-9]+$/)) return null;
3857
+ if (note.workspace_ext_id?.match(/^wrk-[a-zA-Z0-9]+$/) && note.conversation_ext_id?.match(/^con-[a-zA-Z0-9]+$/)) {
3858
+ return {
3859
+ title: "A workflow failed to run",
3860
+ target: {
3861
+ kind: "conversation",
3862
+ workspaceId: note.workspace_ext_id,
3863
+ conversationId: note.conversation_ext_id
3864
+ }
3865
+ };
3866
+ }
3867
+ return {
3868
+ title: "A workflow failed to run",
3869
+ target: {
3870
+ kind: "workflow",
3871
+ workflowId: payload.workflow_ext_id,
3872
+ workspaceId: note.workspace_ext_id || void 0
3873
+ }
3874
+ };
3875
+ } catch {
3876
+ return null;
3877
+ }
3878
+ }
3879
+ if (note.type === "mail_draft_ready") {
3880
+ const draftId = react$1.mailDraftIdFromContent(note.content);
3881
+ if (!draftId) return null;
3882
+ return {
3883
+ title: `${sender} left a draft email for you to review`,
3884
+ target: { kind: "mail_draft", draftId, mailbox: "native" }
3885
+ };
3886
+ }
3887
+ const titles = {
3888
+ mention: `${sender} mentioned you in a conversation`,
3889
+ workspace_access_request: `${sender} needs workspace access to run a thread`,
3890
+ conversation_ready: note.sender.external_id === note.recipient.external_id ? "Your thread is ready" : `${sender}\u2019s thread is ready`,
3891
+ conversation_done: `${sender} marked a thread done`
3892
+ };
3893
+ const title = titles[note.type];
3894
+ if (!title || !note.workspace_ext_id || !note.conversation_ext_id?.match(/^con-[a-zA-Z0-9]+$/))
3895
+ return null;
3896
+ return {
3897
+ title,
3898
+ target: {
3899
+ kind: "conversation",
3900
+ workspaceId: note.workspace_ext_id,
3901
+ conversationId: note.conversation_ext_id,
3902
+ ...note.message_ext_id ? { messageId: note.message_ext_id } : {}
3903
+ }
3904
+ };
3905
+ }
3906
+ function attachmentPath(accountId, messageId, attachmentId) {
3907
+ return `${react$1.accountPath(accountId)}/messages/${encodeURIComponent(messageId)}/attachments/${encodeURIComponent(attachmentId)}`;
3908
+ }
3909
+ function saveFile(blob, name) {
3910
+ const url = URL.createObjectURL(blob);
3911
+ const link = document.createElement("a");
3912
+ link.href = url;
3913
+ link.download = name;
3914
+ link.click();
3915
+ setTimeout(() => URL.revokeObjectURL(url), 1e3);
3916
+ }
3917
+ function hydrateMailAttachments(client$1, account, messageId, attachments, { isOnline, offline }) {
3918
+ return Promise.all(
3919
+ attachments.map(async (a) => {
3920
+ if (a.content_base64 != null) return a;
3921
+ if (!isOnline) {
3922
+ const file = await offline?.loadAttachment(account.id, messageId, a);
3923
+ return file ? { ...a, content_base64: client.bytesToBase64(new Uint8Array(await file.arrayBuffer())) } : { ...a, content_base64: null };
3924
+ }
3925
+ const response = await client$1.fetch(attachmentPath(account.id, messageId, a.id));
3926
+ return react$1.fileAttachment(new File([await response.blob()], a.name, { type: a.content_type }));
3927
+ })
3928
+ );
3929
+ }
3556
3930
  var sessionRooms = /* @__PURE__ */ new Map();
3557
3931
  function useWordBody({
3558
3932
  word,
@@ -3672,7 +4046,7 @@ function MailComposerForm({
3672
4046
  headerSlot
3673
4047
  }) {
3674
4048
  const { client } = react$1.useMailClient();
3675
- const { notify, confirm } = chunkC4WSHRR6_cjs.useBlocksEnvironment();
4049
+ const { notify, confirm } = chunkKPZZ5FHE_cjs.useBlocksEnvironment();
3676
4050
  const [to, setTo] = react.useState(initial.to.map((r) => r.email).join("; "));
3677
4051
  const [cc, setCc] = react.useState(initial.cc.map((r) => r.email).join("; "));
3678
4052
  const [showCc, setShowCc] = react.useState(initial.cc.length > 0);
@@ -4520,7 +4894,7 @@ function ConnectedMailbox({
4520
4894
  onGridStateChange,
4521
4895
  initialMessageId = null
4522
4896
  }) {
4523
- const { notify } = chunkC4WSHRR6_cjs.useBlocksEnvironment();
4897
+ const { notify } = chunkKPZZ5FHE_cjs.useBlocksEnvironment();
4524
4898
  const cache = react$1.useMailCache();
4525
4899
  const { client } = react$1.useMailClient();
4526
4900
  const [savingToWorkspace, setSavingToWorkspace] = react.useState(false);
@@ -5195,7 +5569,7 @@ function SubscribeDialog({
5195
5569
  timeZone,
5196
5570
  onClose
5197
5571
  }) {
5198
- const { notify } = chunkC4WSHRR6_cjs.useBlocksEnvironment();
5572
+ const { notify } = chunkKPZZ5FHE_cjs.useBlocksEnvironment();
5199
5573
  const subscribe = react$1.useSubscribeCalendar();
5200
5574
  const [url, setUrl] = react.useState("");
5201
5575
  const [name, setName] = react.useState("");
@@ -5290,7 +5664,7 @@ function SubscribeDialog({
5290
5664
  }
5291
5665
  function HolidaysDialog({ open, onClose }) {
5292
5666
  const { data: countries = [], isLoading } = react$1.useHolidayCountries(open);
5293
- const { notify } = chunkC4WSHRR6_cjs.useBlocksEnvironment();
5667
+ const { notify } = chunkKPZZ5FHE_cjs.useBlocksEnvironment();
5294
5668
  const add = react$1.useAddHolidayCalendar();
5295
5669
  const [country, setCountry] = react.useState("");
5296
5670
  const [subdivision, setSubdivision] = react.useState("");
@@ -5413,7 +5787,7 @@ function StatusBadge({ account }) {
5413
5787
  );
5414
5788
  }
5415
5789
  function AccountRow({ account }) {
5416
- const { notify } = chunkC4WSHRR6_cjs.useBlocksEnvironment();
5790
+ const { notify } = chunkKPZZ5FHE_cjs.useBlocksEnvironment();
5417
5791
  const startOAuth = react$1.useStartCalendarAccountOAuth();
5418
5792
  const sync = react$1.useSyncCalendarAccount();
5419
5793
  const update = react$1.useUpdateCalendarAccount();
@@ -5531,7 +5905,7 @@ function AccountRow({ account }) {
5531
5905
  );
5532
5906
  }
5533
5907
  function CalDavForm({ onDone }) {
5534
- const { notify } = chunkC4WSHRR6_cjs.useBlocksEnvironment();
5908
+ const { notify } = chunkKPZZ5FHE_cjs.useBlocksEnvironment();
5535
5909
  const { data: profiles = [] } = react$1.useCalDavProfiles();
5536
5910
  const connect = react$1.useConnectCalDavAccount();
5537
5911
  const [profileId, setProfileId] = react.useState("");
@@ -5647,7 +6021,7 @@ function CalDavForm({ onDone }) {
5647
6021
  );
5648
6022
  }
5649
6023
  function CalendarAccountsPanel({ className }) {
5650
- const { notify } = chunkC4WSHRR6_cjs.useBlocksEnvironment();
6024
+ const { notify } = chunkKPZZ5FHE_cjs.useBlocksEnvironment();
5651
6025
  const { connectors } = react$1.useCalendarSupport();
5652
6026
  const startOAuth = react$1.useStartCalendarAccountOAuth();
5653
6027
  const { data: accounts = [], isLoading, error } = react$1.useCalendarAccounts();
@@ -5734,7 +6108,7 @@ function CalendarAccountsPanel({ className }) {
5734
6108
 
5735
6109
  // src/connection/calendar/copy.ts
5736
6110
  function useCalendarCopy() {
5737
- const copy = chunk5FTIHRZH_cjs.useCopyText({ copyFailed: "Could not copy. Select the text and copy it manually." });
6111
+ const copy = chunkXVUOMWMD_cjs.useCopyText({ copyFailed: "Could not copy. Select the text and copy it manually." });
5738
6112
  return (value, what = "Copied") => copy(value, `${what} to clipboard`);
5739
6113
  }
5740
6114
  function CopyField({ label, value, mono = true, testId, className }) {
@@ -5783,7 +6157,7 @@ function calendarNames(ids, calendars) {
5783
6157
  return names.length ? names.join(", ") : `${ids.length} calendar${ids.length === 1 ? "" : "s"}`;
5784
6158
  }
5785
6159
  function RevokeButton({ row }) {
5786
- const { notify } = chunkC4WSHRR6_cjs.useBlocksEnvironment();
6160
+ const { notify } = chunkKPZZ5FHE_cjs.useBlocksEnvironment();
5787
6161
  const revoke = react$1.useRevokeAppPassword();
5788
6162
  const [confirming, setConfirming] = react.useState(false);
5789
6163
  if (!confirming)
@@ -6102,7 +6476,7 @@ function summarizeWeekly(page) {
6102
6476
  return days.map((d) => chunk6YTHQ73P_cjs.WEEKDAY_NAMES[d]?.slice(0, 3)).join(", ");
6103
6477
  }
6104
6478
  function BookingPageForm({ page, defaultTimeZone, onDone }) {
6105
- const { notify } = chunkC4WSHRR6_cjs.useBlocksEnvironment();
6479
+ const { notify } = chunkKPZZ5FHE_cjs.useBlocksEnvironment();
6106
6480
  const copyText = useCalendarCopy();
6107
6481
  const [form, setForm] = react.useState(
6108
6482
  () => page ? chunk6YTHQ73P_cjs.bookingToForm(page) : chunk6YTHQ73P_cjs.emptyBookingForm(defaultTimeZone)
@@ -6285,7 +6659,7 @@ function BookingPageForm({ page, defaultTimeZone, onDone }) {
6285
6659
  );
6286
6660
  }
6287
6661
  function BookingPagesPanel({ defaultTimeZone, className }) {
6288
- const { notify } = chunkC4WSHRR6_cjs.useBlocksEnvironment();
6662
+ const { notify } = chunkKPZZ5FHE_cjs.useBlocksEnvironment();
6289
6663
  const copyText = useCalendarCopy();
6290
6664
  const { data: pages = [], isLoading, error } = react$1.useBookingPages();
6291
6665
  const { data: settings } = react$1.useCalendarSettings(!defaultTimeZone);
@@ -6395,7 +6769,7 @@ function BookingPagesPanel({ defaultTimeZone, className }) {
6395
6769
  }
6396
6770
  var selectClass5 = "h-9 w-full rounded-md border border-input bg-background px-2 text-sm text-foreground shadow-sm";
6397
6771
  function CreateRoomForm({ zone, onDone }) {
6398
- const { notify } = chunkC4WSHRR6_cjs.useBlocksEnvironment();
6772
+ const { notify } = chunkKPZZ5FHE_cjs.useBlocksEnvironment();
6399
6773
  const create2 = react$1.useCreateRoom();
6400
6774
  const [name, setName] = react.useState("");
6401
6775
  const [type, setType] = react.useState("room");
@@ -6725,7 +7099,7 @@ function CalendarSettingsDialog({
6725
7099
  initialTab = "general",
6726
7100
  onClose
6727
7101
  }) {
6728
- const { notify } = chunkC4WSHRR6_cjs.useBlocksEnvironment();
7102
+ const { notify } = chunkKPZZ5FHE_cjs.useBlocksEnvironment();
6729
7103
  const save = react$1.useSaveCalendarSettings();
6730
7104
  const [value, setValue] = react.useState(() => chunk6YTHQ73P_cjs.toSettingsValue(settings));
6731
7105
  const [tab, setTab] = react.useState(initialTab);
@@ -6798,7 +7172,7 @@ function EventScheduling({
6798
7172
  workingStartHour = 7
6799
7173
  }) {
6800
7174
  const [open, setOpen] = react.useState(false);
6801
- const { notify } = chunkC4WSHRR6_cjs.useBlocksEnvironment();
7175
+ const { notify } = chunkKPZZ5FHE_cjs.useBlocksEnvironment();
6802
7176
  const arbi = react$1.useArbi();
6803
7177
  const me = arbi.isLoggedIn ? arbi.user.identity()?.email ?? null : null;
6804
7178
  const allDay = chunk6YTHQ73P_cjs.isAllDayDraft(draft);
@@ -7039,7 +7413,7 @@ function proposed(inv, zone) {
7039
7413
  return `${chunkBIXHB4LV_cjs.formatInZone(su, zone, { weekday: "short", day: "numeric", month: "short", hour: "numeric", minute: "2-digit" })} \u2013 ${chunkBIXHB4LV_cjs.formatInZone(eu, zone, { hour: "numeric", minute: "2-digit" })}`;
7040
7414
  }
7041
7415
  function InvitationsPanel({ timeZone, onOpenEvent }) {
7042
- const { notify } = chunkC4WSHRR6_cjs.useBlocksEnvironment();
7416
+ const { notify } = chunkKPZZ5FHE_cjs.useBlocksEnvironment();
7043
7417
  const { data: items = [], refetch } = react$1.useCalendarInvitations();
7044
7418
  const respond = react$1.useRespondToEvent();
7045
7419
  const decide = react$1.useDecideCounter();
@@ -7226,7 +7600,7 @@ function PublishCalendarDialog({
7226
7600
  onClose,
7227
7601
  onConnectAccount
7228
7602
  }) {
7229
- const { notify } = chunkC4WSHRR6_cjs.useBlocksEnvironment();
7603
+ const { notify } = chunkKPZZ5FHE_cjs.useBlocksEnvironment();
7230
7604
  const { data: accounts = [], isLoading } = react$1.useCalendarAccounts(!!calendarId);
7231
7605
  const publish = react$1.usePublishCalendar();
7232
7606
  const [accountId, setAccountId] = react.useState("");
@@ -7303,7 +7677,7 @@ function ShareCalendarDialog({
7303
7677
  calendarName,
7304
7678
  onClose
7305
7679
  }) {
7306
- const { notify } = chunkC4WSHRR6_cjs.useBlocksEnvironment();
7680
+ const { notify } = chunkKPZZ5FHE_cjs.useBlocksEnvironment();
7307
7681
  const { data: shares = [], isLoading } = react$1.useCalendarShares(calendarId);
7308
7682
  const share = react$1.useShareCalendar();
7309
7683
  const unshare = react$1.useUnshareCalendar();
@@ -7607,7 +7981,7 @@ function ConnectedCalendar({
7607
7981
  onOpenOverlay,
7608
7982
  syncAccountsOnOpen = true
7609
7983
  } = {}) {
7610
- const { confirm, notify, openConversation } = chunkC4WSHRR6_cjs.useBlocksEnvironment();
7984
+ const { confirm, notify, openConversation } = chunkKPZZ5FHE_cjs.useBlocksEnvironment();
7611
7985
  const arbi = react$1.useArbi();
7612
7986
  const fetchEvent = react$1.useFetchCalendarEvent();
7613
7987
  const notifyError = (prefix, err) => notify(`${prefix}: ${errorText3(err)}`, "error");
@@ -8360,7 +8734,7 @@ function ConnectedMailInviteCard({
8360
8734
  isOnline,
8361
8735
  onOpenEvent
8362
8736
  }) {
8363
- const { notify } = chunkC4WSHRR6_cjs.useBlocksEnvironment();
8737
+ const { notify } = chunkKPZZ5FHE_cjs.useBlocksEnvironment();
8364
8738
  const part = attachments.find(chunk6YTHQ73P_cjs.isCalendarAttachment);
8365
8739
  const { data: settings } = react$1.useCalendarSettings(!!part);
8366
8740
  const zone = chunkBIXHB4LV_cjs.safeZone(settings?.time_zone, chunkBIXHB4LV_cjs.detectTimeZone());
@@ -8491,7 +8865,7 @@ function Shell({ children, wide = false }) {
8491
8865
  ) });
8492
8866
  }
8493
8867
  function CancelView({ slug, token }) {
8494
- const { apiBaseUrl } = chunkC4WSHRR6_cjs.useBlocksEnvironment().runtimeConfig;
8868
+ const { apiBaseUrl } = chunkKPZZ5FHE_cjs.useBlocksEnvironment().runtimeConfig;
8495
8869
  const [state, setState] = react.useState("idle");
8496
8870
  const [error, setError] = react.useState(null);
8497
8871
  return /* @__PURE__ */ jsxRuntime.jsx(Shell, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid gap-4", "data-testid": "book-cancel", children: [
@@ -8569,7 +8943,7 @@ function Confirmation({
8569
8943
  ] }) });
8570
8944
  }
8571
8945
  function ConnectedPublicBooking({ slug, cancelToken }) {
8572
- const { apiBaseUrl } = chunkC4WSHRR6_cjs.useBlocksEnvironment().runtimeConfig;
8946
+ const { apiBaseUrl } = chunkKPZZ5FHE_cjs.useBlocksEnvironment().runtimeConfig;
8573
8947
  const [zone, setZone] = react.useState(chunkBIXHB4LV_cjs.detectTimeZone);
8574
8948
  const [duration, setDuration] = react.useState(void 0);
8575
8949
  const [offset, setOffset] = react.useState(0);
@@ -8927,59 +9301,59 @@ Object.defineProperty(exports, "useWorkspaceDocs", {
8927
9301
  });
8928
9302
  Object.defineProperty(exports, "ConnectedWorkflowDocumentsField", {
8929
9303
  enumerable: true,
8930
- get: function () { return chunkRA3ZJ45L_cjs.ConnectedWorkflowDocumentsField; }
9304
+ get: function () { return chunkULPFRK3J_cjs.ConnectedWorkflowDocumentsField; }
8931
9305
  });
8932
9306
  Object.defineProperty(exports, "ConnectedWorkflowLauncher", {
8933
9307
  enumerable: true,
8934
- get: function () { return chunkRA3ZJ45L_cjs.ConnectedWorkflowLauncher; }
9308
+ get: function () { return chunkULPFRK3J_cjs.ConnectedWorkflowLauncher; }
8935
9309
  });
8936
9310
  Object.defineProperty(exports, "ConnectedWorkflowsTable", {
8937
9311
  enumerable: true,
8938
- get: function () { return chunkRA3ZJ45L_cjs.ConnectedWorkflowsTable; }
9312
+ get: function () { return chunkULPFRK3J_cjs.ConnectedWorkflowsTable; }
8939
9313
  });
8940
9314
  Object.defineProperty(exports, "DEFAULT_CONNECTED_WORKFLOWS_TABLE_LABELS", {
8941
9315
  enumerable: true,
8942
- get: function () { return chunkRA3ZJ45L_cjs.DEFAULT_CONNECTED_WORKFLOWS_TABLE_LABELS; }
9316
+ get: function () { return chunkULPFRK3J_cjs.DEFAULT_CONNECTED_WORKFLOWS_TABLE_LABELS; }
8943
9317
  });
8944
9318
  Object.defineProperty(exports, "NativeDocxSupportProvider", {
8945
9319
  enumerable: true,
8946
- get: function () { return chunkRA3ZJ45L_cjs.NativeDocxSupportProvider; }
9320
+ get: function () { return chunkULPFRK3J_cjs.NativeDocxSupportProvider; }
8947
9321
  });
8948
9322
  Object.defineProperty(exports, "toWorkflowFieldDocument", {
8949
9323
  enumerable: true,
8950
- get: function () { return chunkRA3ZJ45L_cjs.toWorkflowFieldDocument; }
9324
+ get: function () { return chunkULPFRK3J_cjs.toWorkflowFieldDocument; }
8951
9325
  });
8952
9326
  Object.defineProperty(exports, "useConnectedAgentOptions", {
8953
9327
  enumerable: true,
8954
- get: function () { return chunkRA3ZJ45L_cjs.useConnectedAgentOptions; }
9328
+ get: function () { return chunkULPFRK3J_cjs.useConnectedAgentOptions; }
8955
9329
  });
8956
9330
  Object.defineProperty(exports, "useConnectedWorkflowScopeSource", {
8957
9331
  enumerable: true,
8958
- get: function () { return chunkRA3ZJ45L_cjs.useConnectedWorkflowScopeSource; }
9332
+ get: function () { return chunkULPFRK3J_cjs.useConnectedWorkflowScopeSource; }
8959
9333
  });
8960
9334
  Object.defineProperty(exports, "useConnectedWorkspaceRole", {
8961
9335
  enumerable: true,
8962
- get: function () { return chunkRA3ZJ45L_cjs.useConnectedWorkspaceRole; }
9336
+ get: function () { return chunkULPFRK3J_cjs.useConnectedWorkspaceRole; }
8963
9337
  });
8964
9338
  Object.defineProperty(exports, "useNativeDocxSupport", {
8965
9339
  enumerable: true,
8966
- get: function () { return chunkRA3ZJ45L_cjs.useNativeDocxSupport; }
9340
+ get: function () { return chunkULPFRK3J_cjs.useNativeDocxSupport; }
8967
9341
  });
8968
9342
  Object.defineProperty(exports, "ConnectedWorkspaceDataProvider", {
8969
9343
  enumerable: true,
8970
- get: function () { return chunkJZNXRMLH_cjs.ConnectedWorkspaceDataProvider; }
9344
+ get: function () { return chunkGAYMJWTC_cjs.ConnectedWorkspaceDataProvider; }
8971
9345
  });
8972
9346
  Object.defineProperty(exports, "useConnectedConversations", {
8973
9347
  enumerable: true,
8974
- get: function () { return chunkJZNXRMLH_cjs.useConnectedConversations; }
9348
+ get: function () { return chunkGAYMJWTC_cjs.useConnectedConversations; }
8975
9349
  });
8976
9350
  Object.defineProperty(exports, "useConnectedDocuments", {
8977
9351
  enumerable: true,
8978
- get: function () { return chunkJZNXRMLH_cjs.useConnectedDocuments; }
9352
+ get: function () { return chunkGAYMJWTC_cjs.useConnectedDocuments; }
8979
9353
  });
8980
9354
  Object.defineProperty(exports, "useConnectedTags", {
8981
9355
  enumerable: true,
8982
- get: function () { return chunkJZNXRMLH_cjs.useConnectedTags; }
9356
+ get: function () { return chunkGAYMJWTC_cjs.useConnectedTags; }
8983
9357
  });
8984
9358
  Object.defineProperty(exports, "ConnectionProvider", {
8985
9359
  enumerable: true,
@@ -9002,6 +9376,7 @@ Object.defineProperty(exports, "useConnection", {
9002
9376
  get: function () { return chunkGFNELPDP_cjs.useConnection; }
9003
9377
  });
9004
9378
  exports.ArbiAppProvider = ArbiAppProvider;
9379
+ exports.ConnectedAccountSettings = ConnectedAccountSettings;
9005
9380
  exports.ConnectedAgentChatPanel = ConnectedAgentChatPanel;
9006
9381
  exports.ConnectedAgentCreator = ConnectedAgentCreator;
9007
9382
  exports.ConnectedCalendar = ConnectedCalendar;
@@ -9012,16 +9387,20 @@ exports.ConnectedMailAccounts = ConnectedMailAccounts;
9012
9387
  exports.ConnectedMailComposer = ConnectedMailComposer;
9013
9388
  exports.ConnectedMailInviteCard = ConnectedMailInviteCard;
9014
9389
  exports.ConnectedMailMessage = ConnectedMailMessage;
9390
+ exports.ConnectedMailSettings = ConnectedMailSettings;
9015
9391
  exports.ConnectedMailSetup = ConnectedMailSetup;
9016
9392
  exports.ConnectedMailbox = ConnectedMailbox;
9017
9393
  exports.ConnectedNotificationCenter = ConnectedNotificationCenter;
9018
9394
  exports.ConnectedNotificationPreferences = ConnectedNotificationPreferences;
9019
9395
  exports.ConnectedPasswordChangeDialog = ConnectedPasswordChangeDialog;
9396
+ exports.ConnectedPremiumModels = ConnectedPremiumModels;
9397
+ exports.ConnectedPrivacySettings = ConnectedPrivacySettings;
9020
9398
  exports.ConnectedProfileCard = ConnectedProfileCard;
9021
9399
  exports.ConnectedPublicBooking = ConnectedPublicBooking;
9022
9400
  exports.ConnectedRequireVerified = ConnectedRequireVerified;
9023
9401
  exports.ConnectedSecuritySection = ConnectedSecuritySection;
9024
9402
  exports.ConnectedSessionsRow = ConnectedSessionsRow;
9403
+ exports.ConnectedSettingsPage = ConnectedSettingsPage;
9025
9404
  exports.ConnectedSkillUpload = ConnectedSkillUpload;
9026
9405
  exports.ConnectedSkillsLibrary = ConnectedSkillsLibrary;
9027
9406
  exports.ConnectedTagTable = ConnectedTagTable;
@@ -9035,16 +9414,24 @@ exports.ConnectedWorkspaceActivity = ConnectedWorkspaceActivity;
9035
9414
  exports.ConnectedWorkspaceNotificationMenu = ConnectedWorkspaceNotificationMenu;
9036
9415
  exports.DEFAULT_CONNECTED_SKILL_UPLOAD_LABELS = DEFAULT_CONNECTED_SKILL_UPLOAD_LABELS;
9037
9416
  exports.DEFAULT_CONNECTED_WORKFLOW_RUNNER_LABELS = DEFAULT_CONNECTED_WORKFLOW_RUNNER_LABELS;
9417
+ exports.DEFAULT_SETTINGS_SECTIONS = DEFAULT_SETTINGS_SECTIONS;
9038
9418
  exports.NotificationCenter = NotificationCenter;
9039
9419
  exports.NotificationEvent = NotificationEvent;
9420
+ exports.SETTINGS_SECTION_IDS = SETTINGS_SECTION_IDS;
9421
+ exports.SessionStatusIcon = SessionStatusIcon;
9040
9422
  exports.StreamedArtifact = StreamedArtifact;
9041
9423
  exports.WorkflowRunThread = WorkflowRunThread;
9424
+ exports.accountSettingsSection = accountSettingsSection;
9042
9425
  exports.bookingCancelLink = bookingCancelLink;
9043
9426
  exports.buildNotificationCenterItems = buildNotificationCenterItems;
9427
+ exports.chatSettingsSection = chatSettingsSection;
9044
9428
  exports.countNotificationTypes = countNotificationTypes;
9045
9429
  exports.defaultUnmetPasswordRequirement = defaultUnmetPasswordRequirement;
9046
9430
  exports.filterNotificationCenterItems = filterNotificationCenterItems;
9431
+ exports.mailSettingsSection = mailSettingsSection;
9047
9432
  exports.openMeetingLink = openMeetingLink;
9433
+ exports.privacySettingsSection = privacySettingsSection;
9434
+ exports.renderSessionStatusIcon = renderSessionStatusIcon;
9048
9435
  exports.requestCalendarComposer = requestCalendarComposer;
9049
9436
  exports.requestCalendarEvent = requestCalendarEvent;
9050
9437
  exports.resolveMailbox = resolveMailbox;