@arbidocs/blocks 0.5.149 → 0.5.151

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 (232) hide show
  1. package/README.md +1 -1
  2. package/bin/arbidocs-record-take.mjs +122 -0
  3. package/dist/{ConnectedCallDock-EASMNJXB.cjs → ConnectedCallDock-SD4DKTMX.cjs} +25 -25
  4. package/dist/{ConnectedCallDock-EASMNJXB.cjs.map → ConnectedCallDock-SD4DKTMX.cjs.map} +1 -1
  5. package/dist/{ConnectedCallRoom-BWZ2FHXN.cjs → ConnectedCallRoom-2FLGH3JB.cjs} +17 -17
  6. package/dist/{ConnectedCallRoom-BWZ2FHXN.cjs.map → ConnectedCallRoom-2FLGH3JB.cjs.map} +1 -1
  7. package/dist/{ConnectedMailInviteCard-ITMZRPIP.cjs → ConnectedMailInviteCard-VMFTQ5PW.cjs} +6 -6
  8. package/dist/{ConnectedMailInviteCard-ITMZRPIP.cjs.map → ConnectedMailInviteCard-VMFTQ5PW.cjs.map} +1 -1
  9. package/dist/{ConnectedNativeDocxComparison-4FAJDXPT.cjs → ConnectedNativeDocxComparison-JLT3VHYQ.cjs} +21 -21
  10. package/dist/{ConnectedNativeDocxComparison-4FAJDXPT.cjs.map → ConnectedNativeDocxComparison-JLT3VHYQ.cjs.map} +1 -1
  11. package/dist/{ConnectedPresentation-EIWVV7ON.cjs → ConnectedPresentation-SY42ADRU.cjs} +21 -21
  12. package/dist/{ConnectedPresentation-EIWVV7ON.cjs.map → ConnectedPresentation-SY42ADRU.cjs.map} +1 -1
  13. package/dist/{ConnectedProductionSetDialog-SDHD5KTG.cjs → ConnectedProductionSetDialog-LB5B7OXR.cjs} +11 -11
  14. package/dist/{ConnectedProductionSetDialog-SDHD5KTG.cjs.map → ConnectedProductionSetDialog-LB5B7OXR.cjs.map} +1 -1
  15. package/dist/{ConnectedSlidesTab-4FN5ZRRI.cjs → ConnectedSlidesTab-JATNBI22.cjs} +20 -20
  16. package/dist/{ConnectedSlidesTab-4FN5ZRRI.cjs.map → ConnectedSlidesTab-JATNBI22.cjs.map} +1 -1
  17. package/dist/{ConnectedStreamedWordArtifact-D7EZFIJ7.cjs → ConnectedStreamedWordArtifact-KWK6HLCZ.cjs} +21 -21
  18. package/dist/{ConnectedStreamedWordArtifact-D7EZFIJ7.cjs.map → ConnectedStreamedWordArtifact-KWK6HLCZ.cjs.map} +1 -1
  19. package/dist/{DocumentReviewCard-7MVNPVZC.cjs → DocumentReviewCard-USFBTVEL.cjs} +25 -25
  20. package/dist/{DocumentReviewCard-7MVNPVZC.cjs.map → DocumentReviewCard-USFBTVEL.cjs.map} +1 -1
  21. package/dist/{FilesViewerDialog-6363IOTL.cjs → FilesViewerDialog-O4CY7GM3.cjs} +48 -48
  22. package/dist/{FilesViewerDialog-6363IOTL.cjs.map → FilesViewerDialog-O4CY7GM3.cjs.map} +1 -1
  23. package/dist/{WorkspaceTableView-HHATEV2H.cjs → WorkspaceTableView-2QP2HJLK.cjs} +10 -10
  24. package/dist/{WorkspaceTableView-HHATEV2H.cjs.map → WorkspaceTableView-2QP2HJLK.cjs.map} +1 -1
  25. package/dist/agents/index.cjs +208 -208
  26. package/dist/{ai-NC4ZE3UT.cjs → ai-ODGRIL6Y.cjs} +26 -26
  27. package/dist/ai-ODGRIL6Y.cjs.map +1 -0
  28. package/dist/auth/index.cjs +12 -12
  29. package/dist/calls/connected/ConnectedCallChatHistory.d.ts +1 -1
  30. package/dist/calls/connected/ConnectedCallChatHistory.js +55 -45
  31. package/dist/calls/connected/ConnectedCallChatHistory.js.map +2 -2
  32. package/dist/calls/index.cjs +118 -118
  33. package/dist/chat/index.cjs +48 -48
  34. package/dist/{chunk-NWU2QMW4.cjs → chunk-2QLO3HBN.cjs} +6 -6
  35. package/dist/{chunk-NWU2QMW4.cjs.map → chunk-2QLO3HBN.cjs.map} +1 -1
  36. package/dist/{chunk-NVECYF2N.cjs → chunk-2SILSQNF.cjs} +7 -7
  37. package/dist/{chunk-NVECYF2N.cjs.map → chunk-2SILSQNF.cjs.map} +1 -1
  38. package/dist/{chunk-6IS6TZ7F.cjs → chunk-2XHJVYNY.cjs} +4 -4
  39. package/dist/{chunk-6IS6TZ7F.cjs.map → chunk-2XHJVYNY.cjs.map} +1 -1
  40. package/dist/{chunk-SK6BONXE.cjs → chunk-36NQMOJE.cjs} +6 -6
  41. package/dist/{chunk-SK6BONXE.cjs.map → chunk-36NQMOJE.cjs.map} +1 -1
  42. package/dist/{chunk-JOYB727S.cjs → chunk-3GQQUR27.cjs} +4 -4
  43. package/dist/{chunk-JOYB727S.cjs.map → chunk-3GQQUR27.cjs.map} +1 -1
  44. package/dist/{chunk-F4ULSAOA.cjs → chunk-3XCYPWC5.cjs} +4 -4
  45. package/dist/{chunk-F4ULSAOA.cjs.map → chunk-3XCYPWC5.cjs.map} +1 -1
  46. package/dist/{chunk-VMXTOIXB.cjs → chunk-46LX6EQT.cjs} +7 -7
  47. package/dist/{chunk-VMXTOIXB.cjs.map → chunk-46LX6EQT.cjs.map} +1 -1
  48. package/dist/{chunk-MIYEIACV.cjs → chunk-5DGNJ6VJ.cjs} +14 -14
  49. package/dist/{chunk-MIYEIACV.cjs.map → chunk-5DGNJ6VJ.cjs.map} +1 -1
  50. package/dist/{chunk-7KSOMWCS.cjs → chunk-5GBM7BQB.cjs} +4 -4
  51. package/dist/{chunk-7KSOMWCS.cjs.map → chunk-5GBM7BQB.cjs.map} +1 -1
  52. package/dist/{chunk-SQHR7564.cjs → chunk-6WWYH66F.cjs} +75 -75
  53. package/dist/{chunk-SQHR7564.cjs.map → chunk-6WWYH66F.cjs.map} +1 -1
  54. package/dist/{chunk-FPSHZW4W.cjs → chunk-6XKQAQWF.cjs} +4 -4
  55. package/dist/{chunk-FPSHZW4W.cjs.map → chunk-6XKQAQWF.cjs.map} +1 -1
  56. package/dist/{chunk-STFIBNND.cjs → chunk-73KNWWBW.cjs} +72 -72
  57. package/dist/{chunk-STFIBNND.cjs.map → chunk-73KNWWBW.cjs.map} +1 -1
  58. package/dist/{chunk-MHGZZ6IJ.cjs → chunk-A5SKK3CU.cjs} +6 -6
  59. package/dist/{chunk-MHGZZ6IJ.cjs.map → chunk-A5SKK3CU.cjs.map} +1 -1
  60. package/dist/{chunk-H5ITWXUA.cjs → chunk-AKR4JN6I.cjs} +4 -4
  61. package/dist/{chunk-H5ITWXUA.cjs.map → chunk-AKR4JN6I.cjs.map} +1 -1
  62. package/dist/{chunk-WREXDEOM.cjs → chunk-CYWOL2LS.cjs} +11 -11
  63. package/dist/{chunk-WREXDEOM.cjs.map → chunk-CYWOL2LS.cjs.map} +1 -1
  64. package/dist/{chunk-ETMSINQS.cjs → chunk-D4SJT3NG.cjs} +4 -4
  65. package/dist/{chunk-ETMSINQS.cjs.map → chunk-D4SJT3NG.cjs.map} +1 -1
  66. package/dist/{chunk-X5H2STK4.cjs → chunk-DGUQK5GA.cjs} +9 -9
  67. package/dist/{chunk-X5H2STK4.cjs.map → chunk-DGUQK5GA.cjs.map} +1 -1
  68. package/dist/{chunk-43D2KKWT.cjs → chunk-DLGYR4JL.cjs} +8 -8
  69. package/dist/{chunk-43D2KKWT.cjs.map → chunk-DLGYR4JL.cjs.map} +1 -1
  70. package/dist/{chunk-UGSN47YE.cjs → chunk-DNTSR7UV.cjs} +5 -5
  71. package/dist/{chunk-UGSN47YE.cjs.map → chunk-DNTSR7UV.cjs.map} +1 -1
  72. package/dist/{chunk-TJDCTRB5.cjs → chunk-DUNXLT63.cjs} +3 -3
  73. package/dist/{chunk-TJDCTRB5.cjs.map → chunk-DUNXLT63.cjs.map} +1 -1
  74. package/dist/{chunk-U2HDSS5R.cjs → chunk-DWN5AUMH.cjs} +6 -6
  75. package/dist/{chunk-U2HDSS5R.cjs.map → chunk-DWN5AUMH.cjs.map} +1 -1
  76. package/dist/{chunk-JZWLIOTP.cjs → chunk-DYIZ7W4P.cjs} +6 -6
  77. package/dist/{chunk-JZWLIOTP.cjs.map → chunk-DYIZ7W4P.cjs.map} +1 -1
  78. package/dist/{chunk-GPP7E3OQ.cjs → chunk-E6BM5ENI.cjs} +4 -4
  79. package/dist/{chunk-GPP7E3OQ.cjs.map → chunk-E6BM5ENI.cjs.map} +1 -1
  80. package/dist/{chunk-XFZKPEUD.cjs → chunk-EKFA2OS3.cjs} +4 -4
  81. package/dist/{chunk-XFZKPEUD.cjs.map → chunk-EKFA2OS3.cjs.map} +1 -1
  82. package/dist/{chunk-FZASPI2Q.cjs → chunk-GAA222SK.cjs} +5 -5
  83. package/dist/{chunk-FZASPI2Q.cjs.map → chunk-GAA222SK.cjs.map} +1 -1
  84. package/dist/{chunk-P2K4XL4T.cjs → chunk-GB5MN5FC.cjs} +6 -6
  85. package/dist/{chunk-P2K4XL4T.cjs.map → chunk-GB5MN5FC.cjs.map} +1 -1
  86. package/dist/{chunk-ZLJP6447.cjs → chunk-H7AI54V2.cjs} +25 -25
  87. package/dist/{chunk-ZLJP6447.cjs.map → chunk-H7AI54V2.cjs.map} +1 -1
  88. package/dist/{chunk-6KT6BEP4.cjs → chunk-HNLNRAEU.cjs} +10 -10
  89. package/dist/{chunk-6KT6BEP4.cjs.map → chunk-HNLNRAEU.cjs.map} +1 -1
  90. package/dist/{chunk-CFJAWCVX.cjs → chunk-ILATBO5Z.cjs} +15 -15
  91. package/dist/{chunk-CFJAWCVX.cjs.map → chunk-ILATBO5Z.cjs.map} +1 -1
  92. package/dist/{chunk-2E5AODIC.cjs → chunk-JMBAUHI7.cjs} +28 -28
  93. package/dist/{chunk-2E5AODIC.cjs.map → chunk-JMBAUHI7.cjs.map} +1 -1
  94. package/dist/{chunk-YZBDHBKI.cjs → chunk-K67VMSOX.cjs} +2 -2
  95. package/dist/chunk-K67VMSOX.cjs.map +1 -0
  96. package/dist/{chunk-WXMD4AA4.cjs → chunk-KWWGUQJV.cjs} +3 -3
  97. package/dist/{chunk-WXMD4AA4.cjs.map → chunk-KWWGUQJV.cjs.map} +1 -1
  98. package/dist/{chunk-JOUMBLGL.cjs → chunk-LOSCXAAF.cjs} +5 -2
  99. package/dist/chunk-LOSCXAAF.cjs.map +1 -0
  100. package/dist/{chunk-SDGE2F77.cjs → chunk-MB2Y2ZGM.cjs} +6 -6
  101. package/dist/{chunk-SDGE2F77.cjs.map → chunk-MB2Y2ZGM.cjs.map} +1 -1
  102. package/dist/{chunk-43GIESOM.cjs → chunk-MFZW4FEW.cjs} +4 -4
  103. package/dist/{chunk-43GIESOM.cjs.map → chunk-MFZW4FEW.cjs.map} +1 -1
  104. package/dist/{chunk-47NBCI3E.cjs → chunk-MGGDT6JK.cjs} +4 -4
  105. package/dist/{chunk-47NBCI3E.cjs.map → chunk-MGGDT6JK.cjs.map} +1 -1
  106. package/dist/{chunk-CRN64MYK.cjs → chunk-MH7P5FEK.cjs} +24 -24
  107. package/dist/{chunk-CRN64MYK.cjs.map → chunk-MH7P5FEK.cjs.map} +1 -1
  108. package/dist/{chunk-5QEPUONH.cjs → chunk-N4TOSY7B.cjs} +4 -4
  109. package/dist/{chunk-5QEPUONH.cjs.map → chunk-N4TOSY7B.cjs.map} +1 -1
  110. package/dist/{chunk-H7SGZN33.cjs → chunk-NGM4HIPP.cjs} +21 -21
  111. package/dist/{chunk-H7SGZN33.cjs.map → chunk-NGM4HIPP.cjs.map} +1 -1
  112. package/dist/{chunk-IIOFQKQV.cjs → chunk-NNZFZYTI.cjs} +82 -72
  113. package/dist/chunk-NNZFZYTI.cjs.map +1 -0
  114. package/dist/{chunk-HZF3YPEG.cjs → chunk-NUFZFWHZ.cjs} +4 -4
  115. package/dist/{chunk-HZF3YPEG.cjs.map → chunk-NUFZFWHZ.cjs.map} +1 -1
  116. package/dist/{chunk-LXQMTVAB.cjs → chunk-OF7KMG6R.cjs} +14 -14
  117. package/dist/{chunk-LXQMTVAB.cjs.map → chunk-OF7KMG6R.cjs.map} +1 -1
  118. package/dist/{chunk-2ZH4KVAZ.cjs → chunk-OGJCEWME.cjs} +40 -40
  119. package/dist/{chunk-2ZH4KVAZ.cjs.map → chunk-OGJCEWME.cjs.map} +1 -1
  120. package/dist/{chunk-YV36BZE7.cjs → chunk-PIWXX2M4.cjs} +10 -10
  121. package/dist/{chunk-YV36BZE7.cjs.map → chunk-PIWXX2M4.cjs.map} +1 -1
  122. package/dist/{chunk-UHEOY35C.cjs → chunk-PJ6J4EMZ.cjs} +4 -4
  123. package/dist/{chunk-UHEOY35C.cjs.map → chunk-PJ6J4EMZ.cjs.map} +1 -1
  124. package/dist/{chunk-54Y4LWTA.cjs → chunk-PJTKXKDS.cjs} +62 -62
  125. package/dist/{chunk-54Y4LWTA.cjs.map → chunk-PJTKXKDS.cjs.map} +1 -1
  126. package/dist/{chunk-AN4YKCBD.cjs → chunk-QDZDHP23.cjs} +4 -4
  127. package/dist/{chunk-AN4YKCBD.cjs.map → chunk-QDZDHP23.cjs.map} +1 -1
  128. package/dist/{chunk-UHT2Q6IF.cjs → chunk-QKCFV36K.cjs} +15 -15
  129. package/dist/{chunk-UHT2Q6IF.cjs.map → chunk-QKCFV36K.cjs.map} +1 -1
  130. package/dist/{chunk-A5ZNAZ7Q.cjs → chunk-QWOPEBH2.cjs} +12 -12
  131. package/dist/{chunk-A5ZNAZ7Q.cjs.map → chunk-QWOPEBH2.cjs.map} +1 -1
  132. package/dist/{chunk-MKJBEL4W.cjs → chunk-QX2LAMVE.cjs} +4 -4
  133. package/dist/{chunk-MKJBEL4W.cjs.map → chunk-QX2LAMVE.cjs.map} +1 -1
  134. package/dist/{chunk-C7EGCNLV.cjs → chunk-R3C3S6EH.cjs} +88 -88
  135. package/dist/{chunk-C7EGCNLV.cjs.map → chunk-R3C3S6EH.cjs.map} +1 -1
  136. package/dist/{chunk-C36NH6PR.cjs → chunk-SH7W4WVI.cjs} +6 -6
  137. package/dist/{chunk-C36NH6PR.cjs.map → chunk-SH7W4WVI.cjs.map} +1 -1
  138. package/dist/{chunk-FHNWK5RO.cjs → chunk-SMO4SPPB.cjs} +7 -7
  139. package/dist/{chunk-FHNWK5RO.cjs.map → chunk-SMO4SPPB.cjs.map} +1 -1
  140. package/dist/{chunk-WSUHF676.cjs → chunk-TN3UP3CI.cjs} +5 -5
  141. package/dist/{chunk-WSUHF676.cjs.map → chunk-TN3UP3CI.cjs.map} +1 -1
  142. package/dist/{chunk-X6QGVLMV.cjs → chunk-U4KUTO6O.cjs} +5 -5
  143. package/dist/{chunk-X6QGVLMV.cjs.map → chunk-U4KUTO6O.cjs.map} +1 -1
  144. package/dist/{chunk-3WXAGCUL.cjs → chunk-U4YOVI5D.cjs} +6 -6
  145. package/dist/{chunk-3WXAGCUL.cjs.map → chunk-U4YOVI5D.cjs.map} +1 -1
  146. package/dist/{chunk-ZUYY3JRO.cjs → chunk-V27WLYTG.cjs} +5 -5
  147. package/dist/{chunk-ZUYY3JRO.cjs.map → chunk-V27WLYTG.cjs.map} +1 -1
  148. package/dist/{chunk-DHQH4EYB.cjs → chunk-VH4QXK5W.cjs} +4 -4
  149. package/dist/{chunk-DHQH4EYB.cjs.map → chunk-VH4QXK5W.cjs.map} +1 -1
  150. package/dist/{chunk-JARRHAQW.cjs → chunk-VSDD5TH5.cjs} +8 -8
  151. package/dist/{chunk-JARRHAQW.cjs.map → chunk-VSDD5TH5.cjs.map} +1 -1
  152. package/dist/{chunk-J5YEEWZT.cjs → chunk-WPUEGDBE.cjs} +8 -8
  153. package/dist/{chunk-J5YEEWZT.cjs.map → chunk-WPUEGDBE.cjs.map} +1 -1
  154. package/dist/{chunk-U6XMZG6G.cjs → chunk-WQ2KG4LS.cjs} +4 -4
  155. package/dist/{chunk-U6XMZG6G.cjs.map → chunk-WQ2KG4LS.cjs.map} +1 -1
  156. package/dist/{chunk-2XZJBPBV.cjs → chunk-XMSK3LQX.cjs} +4 -4
  157. package/dist/{chunk-2XZJBPBV.cjs.map → chunk-XMSK3LQX.cjs.map} +1 -1
  158. package/dist/{chunk-2FA7UVLG.cjs → chunk-XYN3RP5W.cjs} +11 -8
  159. package/dist/chunk-XYN3RP5W.cjs.map +1 -0
  160. package/dist/{chunk-GAVQFR6P.cjs → chunk-YA6GXWC2.cjs} +4 -4
  161. package/dist/{chunk-GAVQFR6P.cjs.map → chunk-YA6GXWC2.cjs.map} +1 -1
  162. package/dist/citations/index.cjs +9 -9
  163. package/dist/collaboration/index.cjs +13 -13
  164. package/dist/connect/docx.cjs +24 -24
  165. package/dist/connect/index.cjs +1741 -1500
  166. package/dist/connect/index.cjs.map +1 -1
  167. package/dist/connect/viewer.cjs +34 -34
  168. package/dist/connection/dialogs/ConnectedGlobalDialogs.js +3 -1
  169. package/dist/connection/dialogs/ConnectedGlobalDialogs.js.map +2 -2
  170. package/dist/connection/messenger/ConnectedChatThread.js +31 -5
  171. package/dist/connection/messenger/ConnectedChatThread.js.map +2 -2
  172. package/dist/connection/messenger/ConnectedMessenger.js +7 -1
  173. package/dist/connection/messenger/ConnectedMessenger.js.map +2 -2
  174. package/dist/connection/messenger/DmFileShareCard.d.ts +16 -0
  175. package/dist/connection/messenger/DmFileShareCard.js +123 -0
  176. package/dist/connection/messenger/DmFileShareCard.js.map +7 -0
  177. package/dist/connection/messenger/file-share-status.d.ts +23 -0
  178. package/dist/connection/messenger/file-share-status.js +40 -0
  179. package/dist/connection/messenger/file-share-status.js.map +7 -0
  180. package/dist/connection/messenger/thread-entries.d.ts +25 -0
  181. package/dist/connection/messenger/thread-entries.js +31 -0
  182. package/dist/connection/messenger/thread-entries.js.map +7 -0
  183. package/dist/connection/messenger/types.d.ts +7 -0
  184. package/dist/connection/notification-center/useOpenNotificationTarget.js +8 -0
  185. package/dist/connection/notification-center/useOpenNotificationTarget.js.map +2 -2
  186. package/dist/connection/viewer/ConnectedSharedFileDialog.d.ts +2 -0
  187. package/dist/connection/viewer/ConnectedSharedFileDialog.js +59 -0
  188. package/dist/connection/viewer/ConnectedSharedFileDialog.js.map +7 -0
  189. package/dist/connection/viewer/ConnectedSharedFilesPage.js +2 -15
  190. package/dist/connection/viewer/ConnectedSharedFilesPage.js.map +2 -2
  191. package/dist/connection/viewer/publish-shared-file.d.ts +7 -0
  192. package/dist/connection/viewer/publish-shared-file.js +13 -0
  193. package/dist/connection/viewer/publish-shared-file.js.map +7 -0
  194. package/dist/dashboards/index.cjs +19 -19
  195. package/dist/document-tools/index.cjs +7 -7
  196. package/dist/document-tools/viewer/SharedFileView.d.ts +5 -1
  197. package/dist/document-tools/viewer/SharedFileView.js +9 -6
  198. package/dist/document-tools/viewer/SharedFileView.js.map +2 -2
  199. package/dist/document-tools/viewer/index.cjs +9 -9
  200. package/dist/embed/index.cjs +41 -41
  201. package/dist/facts/index.cjs +47 -47
  202. package/dist/files/index.cjs +229 -229
  203. package/dist/home/index.cjs +34 -34
  204. package/dist/index.cjs +561 -561
  205. package/dist/lib/routes.d.ts +2 -0
  206. package/dist/lib/routes.js +3 -0
  207. package/dist/lib/routes.js.map +2 -2
  208. package/dist/pages/index.cjs +15 -15
  209. package/dist/provider/dialog-registry.d.ts +5 -0
  210. package/dist/provider/dialog-registry.js.map +2 -2
  211. package/dist/record/index.cjs +234 -3
  212. package/dist/record/index.cjs.map +1 -1
  213. package/dist/record/index.d.ts +29 -2
  214. package/dist/record/index.js +231 -4
  215. package/dist/record/index.js.map +1 -1
  216. package/dist/record/runs.d.ts +101 -0
  217. package/dist/retrieval/index.cjs +5 -5
  218. package/dist/settings/index.cjs +150 -150
  219. package/dist/shell/index.cjs +57 -57
  220. package/dist/site/index.cjs +5 -5
  221. package/dist/studio/index.cjs +36 -36
  222. package/dist/styles.css +1 -1
  223. package/dist/workflow-canvas/index.cjs +57 -57
  224. package/dist/workspaces/index.cjs +19 -19
  225. package/node_modules/@arbidocs/coedit/package.json +1 -1
  226. package/package.json +7 -5
  227. package/record/SKILL.md +126 -0
  228. package/dist/ai-NC4ZE3UT.cjs.map +0 -1
  229. package/dist/chunk-2FA7UVLG.cjs.map +0 -1
  230. package/dist/chunk-IIOFQKQV.cjs.map +0 -1
  231. package/dist/chunk-JOUMBLGL.cjs.map +0 -1
  232. package/dist/chunk-YZBDHBKI.cjs.map +0 -1
@@ -3,7 +3,7 @@
3
3
 
4
4
  var chunk4M3OIBIS_cjs = require('./chunk-4M3OIBIS.cjs');
5
5
  var chunkQUMUAJ2P_cjs = require('./chunk-QUMUAJ2P.cjs');
6
- var chunkVMXTOIXB_cjs = require('./chunk-VMXTOIXB.cjs');
6
+ var chunk46LX6EQT_cjs = require('./chunk-46LX6EQT.cjs');
7
7
  var react$1 = require('react');
8
8
  var lucideReact = require('lucide-react');
9
9
  var ui = require('@arbidocs/react/ui');
@@ -23,7 +23,7 @@ function ConnectedMailInviteCard({
23
23
  isOnline,
24
24
  onOpenEvent
25
25
  }) {
26
- const { notify } = chunkVMXTOIXB_cjs.useBlocksEnvironment();
26
+ const { notify } = chunk46LX6EQT_cjs.useBlocksEnvironment();
27
27
  const part = attachments.find(chunk4M3OIBIS_cjs.isCalendarAttachment);
28
28
  const { data: settings } = react.useCalendarSettings(!!part);
29
29
  const zone = chunkQUMUAJ2P_cjs.safeZone(settings?.time_zone, chunkQUMUAJ2P_cjs.detectTimeZone());
@@ -132,5 +132,5 @@ function ConnectedMailInviteCard({
132
132
  }
133
133
 
134
134
  exports.ConnectedMailInviteCard = ConnectedMailInviteCard;
135
- //# sourceMappingURL=chunk-6IS6TZ7F.cjs.map
136
- //# sourceMappingURL=chunk-6IS6TZ7F.cjs.map
135
+ //# sourceMappingURL=chunk-2XHJVYNY.cjs.map
136
+ //# sourceMappingURL=chunk-2XHJVYNY.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/connection/calendar/ConnectedMailInviteCard.tsx"],"names":["useBlocksEnvironment","isCalendarAttachment","useCalendarSettings","safeZone","detectTimeZone","useMailAttachmentText","parseIcsInvite","useCalendarEventByUid","useRespondToEvent","useState","useEffect","formatEventWhen","isQueuedCalendarWrite","jsxs","jsx","CalendarDays","cn","Fragment","Button"],"mappings":";;;;;;;;;;;AAkCA,IAAM,aAAA,GAAwC;AAAA,EAC5C,QAAA,EAAU,cAAA;AAAA,EACV,QAAA,EA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AAS,WAAA,oBACRJ,cAAA;AAAA,cAACI,SAAA;AAAA,cAAA;AAAA,gBACC,IAAA,EAAK,IAAA;AAAA,gBACL,OAAA,EAAQ,OAAA;AAAA,gBACR,SAAS,MAAM,WAAA,CAAY,EAAE,EAAA,EAAI,KAAA,CAAM,IAAI,CAAA;AAAA,gBAC3C,aAAA,EAAY,kBAAA;AAAA,gBACb,QAAA,EAAA;AAAA;AAAA;AAED,WAAA,EAEJ;AAAA,SAAA,EACF;AAAA;AAAA;AAAA,GACF;AAEJ","file":"chunk-6IS6TZ7F.cjs","sourcesContent":["/**\n * Invitation card in the Mail message view: when the message carries an iCalendar part, show the event\n * (parsed client-side) and, if it is in my calendar (GET /lookup?uid=), Accept / Maybe / Decline and\n * Open in calendar. Self-contained so the mail view only mounts it.\n */\nimport { useEffect, useState } from 'react'\nimport { CalendarDays } from 'lucide-react'\nimport { Button, cn } from '@arbidocs/react/ui'\nimport {\n isQueuedCalendarWrite,\n useCalendarEventByUid,\n useCalendarSettings,\n useMailAttachmentText,\n useRespondToEvent,\n type MailAttachment,\n} from '@arbidocs/react'\nimport {\n detectTimeZone,\n formatEventWhen,\n isCalendarAttachment,\n parseIcsInvite,\n safeZone,\n} from '../../calendar'\nimport { useBlocksEnvironment } from '../../provider/environment'\n\nexport interface ConnectedMailInviteCardProps {\n accountId: string\n messageId: string\n attachments: MailAttachment[]\n isOnline: boolean\n /** Open the event in the host's calendar (\"Open in calendar\"); without it the button is hidden. */\n onOpenEvent?: (event: { id: string }) => void\n}\n\nconst PARTSTAT_TEXT: Record<string, string> = {\n accepted: 'You accepted',\n declined: 'You declined',\n tentative: 'You said maybe',\n needs_action: 'Not answered yet',\n}\n\nexport function ConnectedMailInviteCard({\n accountId,\n messageId,\n attachments,\n isOnline,\n onOpenEvent,\n}: ConnectedMailInviteCardProps) {\n const { notify } = useBlocksEnvironment()\n const part = attachments.find(isCalendarAttachment)\n const { data: settings } = useCalendarSettings(!!part)\n const zone = safeZone(settings?.time_zone, detectTimeZone())\n const { data: ics } = useMailAttachmentText(accountId, messageId, part, { enabled: isOnline })\n const invite = ics ? parseIcsInvite(ics, zone) : null\n const lookup = useCalendarEventByUid(invite?.uid && invite.method !== 'REPLY' ? invite.uid : null)\n const respond = useRespondToEvent()\n const [partstat, setPartstat] = useState<string | null>(null)\n const event = lookup.data ?? null\n useEffect(() => setPartstat(event?.my_partstat ?? null), [event?.my_partstat])\n\n if (!part || !invite) return null\n const cancelled = invite.method === 'CANCEL' || invite.status === 'CANCELLED'\n const when =\n invite.startUtc && invite.endUtc\n ? formatEventWhen(\n {\n all_day: invite.allDay,\n start_utc: invite.startUtc,\n end_utc: invite.endUtc,\n start: { date: invite.startDate },\n end: { date: invite.endDate },\n },\n zone\n )\n : ''\n const canRespond = !!event && !event.is_organizer && event.my_partstat != null && !cancelled\n\n const answer = (p: 'accepted' | 'tentative' | 'declined') =>\n event &&\n respond.mutate(\n { id: event.id, partstat: p },\n {\n onSuccess: (updated) =>\n setPartstat(isQueuedCalendarWrite(updated) ? p : (updated.my_partstat ?? p)),\n onError: (err) => notify(`Could not send your response: ${err.message}`, 'error'),\n }\n )\n\n return (\n <div\n className=\"mb-4 flex gap-3 rounded-lg border border-border bg-muted/20 p-3\"\n data-testid=\"mail-invite-card\"\n >\n <CalendarDays className=\"mt-0.5 size-5 shrink-0 text-primary\" aria-hidden />\n <div className=\"min-w-0 flex-1 space-y-1.5\">\n <div\n className={cn('font-medium', cancelled && 'line-through')}\n data-testid=\"mail-invite-title\"\n >\n {invite.title || 'Untitled event'}\n </div>\n <div className=\"text-sm text-muted-foreground\">{when}</div>\n {invite.location && <div className=\"text-sm text-muted-foreground\">{invite.location}</div>}\n {invite.organizer && (\n <div className=\"text-xs text-muted-foreground\">\n Organiser: {invite.organizer.name || invite.organizer.email}\n </div>\n )}\n {cancelled && <div className=\"text-sm text-destructive\">This event was cancelled.</div>}\n {invite.method === 'REPLY' && (\n <div className=\"text-sm text-muted-foreground\">A guest replied to your invitation.</div>\n )}\n {!cancelled && invite.method !== 'REPLY' && !lookup.isLoading && !event && isOnline && (\n <div className=\"text-xs text-muted-foreground\">Not in your calendar yet.</div>\n )}\n {canRespond && partstat && (\n <div className=\"text-xs text-muted-foreground\" data-testid=\"mail-invite-status\">\n {PARTSTAT_TEXT[partstat] ?? partstat}\n </div>\n )}\n <div className=\"flex flex-wrap gap-1.5 pt-1\">\n {canRespond && (\n <>\n <Button\n size=\"sm\"\n variant={partstat === 'accepted' ? 'default' : 'outline'}\n disabled={!isOnline || respond.isPending}\n onClick={() => answer('accepted')}\n data-testid=\"mail-invite-accept\"\n >\n Accept\n </Button>\n <Button\n size=\"sm\"\n variant={partstat === 'tentative' ? 'default' : 'outline'}\n disabled={!isOnline || respond.isPending}\n onClick={() => answer('tentative')}\n >\n Maybe\n </Button>\n <Button\n size=\"sm\"\n variant={partstat === 'declined' ? 'default' : 'outline'}\n disabled={!isOnline || respond.isPending}\n onClick={() => answer('declined')}\n >\n Decline\n </Button>\n </>\n )}\n {event && onOpenEvent && (\n <Button\n size=\"sm\"\n variant=\"ghost\"\n onClick={() => onOpenEvent({ id: event.id })}\n data-testid=\"mail-invite-open\"\n >\n Open in calendar\n </Button>\n )}\n </div>\n </div>\n </div>\n )\n}\n"]}
1
+ {"version":3,"sources":["../src/connection/calendar/ConnectedMailInviteCard.tsx"],"names":["useBlocksEnvironment","isCalendarAttachment","useCalendarSettings","safeZone","detectTimeZone","useMailAttachmentText","parseIcsInvite","useCalendarEventByUid","useRespondToEvent","useState","useEffect","formatEventWhen","isQueuedCalendarWrite","jsxs","jsx","CalendarDays","cn","Fragment","Button"],"mappings":";;;;;;;;;;;AAkCA,IAAM,aAAA,GAAwC;AAAA,EAC5C,QAAA,EAAU,cAAA;AAAA,EACV,QAAA,EAAU,cAAA;AAAA,EACV,SAAA,EAAW,gBAAA;AAAA,EACX,YAAA,EAAc;AAChB,CAAA;AAEO,SAAS,uBAAA,CAAwB;AAAA,EACtC,SAAA;AAAA,EACA,SAA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,MAAM,WAAA,CAAY,EAAE,EAAA,EAAI,KAAA,CAAM,IAAI,CAAA;AAAA,gBAC3C,aAAA,EAAY,kBAAA;AAAA,gBACb,QAAA,EAAA;AAAA;AAAA;AAED,WAAA,EAEJ;AAAA,SAAA,EACF;AAAA;AAAA;AAAA,GACF;AAEJ","file":"chunk-2XHJVYNY.cjs","sourcesContent":["/**\n * Invitation card in the Mail message view: when the message carries an iCalendar part, show the event\n * (parsed client-side) and, if it is in my calendar (GET /lookup?uid=), Accept / Maybe / Decline and\n * Open in calendar. Self-contained so the mail view only mounts it.\n */\nimport { useEffect, useState } from 'react'\nimport { CalendarDays } from 'lucide-react'\nimport { Button, cn } from '@arbidocs/react/ui'\nimport {\n isQueuedCalendarWrite,\n useCalendarEventByUid,\n useCalendarSettings,\n useMailAttachmentText,\n useRespondToEvent,\n type MailAttachment,\n} from '@arbidocs/react'\nimport {\n detectTimeZone,\n formatEventWhen,\n isCalendarAttachment,\n parseIcsInvite,\n safeZone,\n} from '../../calendar'\nimport { useBlocksEnvironment } from '../../provider/environment'\n\nexport interface ConnectedMailInviteCardProps {\n accountId: string\n messageId: string\n attachments: MailAttachment[]\n isOnline: boolean\n /** Open the event in the host's calendar (\"Open in calendar\"); without it the button is hidden. */\n onOpenEvent?: (event: { id: string }) => void\n}\n\nconst PARTSTAT_TEXT: Record<string, string> = {\n accepted: 'You accepted',\n declined: 'You declined',\n tentative: 'You said maybe',\n needs_action: 'Not answered yet',\n}\n\nexport function ConnectedMailInviteCard({\n accountId,\n messageId,\n attachments,\n isOnline,\n onOpenEvent,\n}: ConnectedMailInviteCardProps) {\n const { notify } = useBlocksEnvironment()\n const part = attachments.find(isCalendarAttachment)\n const { data: settings } = useCalendarSettings(!!part)\n const zone = safeZone(settings?.time_zone, detectTimeZone())\n const { data: ics } = useMailAttachmentText(accountId, messageId, part, { enabled: isOnline })\n const invite = ics ? parseIcsInvite(ics, zone) : null\n const lookup = useCalendarEventByUid(invite?.uid && invite.method !== 'REPLY' ? invite.uid : null)\n const respond = useRespondToEvent()\n const [partstat, setPartstat] = useState<string | null>(null)\n const event = lookup.data ?? null\n useEffect(() => setPartstat(event?.my_partstat ?? null), [event?.my_partstat])\n\n if (!part || !invite) return null\n const cancelled = invite.method === 'CANCEL' || invite.status === 'CANCELLED'\n const when =\n invite.startUtc && invite.endUtc\n ? formatEventWhen(\n {\n all_day: invite.allDay,\n start_utc: invite.startUtc,\n end_utc: invite.endUtc,\n start: { date: invite.startDate },\n end: { date: invite.endDate },\n },\n zone\n )\n : ''\n const canRespond = !!event && !event.is_organizer && event.my_partstat != null && !cancelled\n\n const answer = (p: 'accepted' | 'tentative' | 'declined') =>\n event &&\n respond.mutate(\n { id: event.id, partstat: p },\n {\n onSuccess: (updated) =>\n setPartstat(isQueuedCalendarWrite(updated) ? p : (updated.my_partstat ?? p)),\n onError: (err) => notify(`Could not send your response: ${err.message}`, 'error'),\n }\n )\n\n return (\n <div\n className=\"mb-4 flex gap-3 rounded-lg border border-border bg-muted/20 p-3\"\n data-testid=\"mail-invite-card\"\n >\n <CalendarDays className=\"mt-0.5 size-5 shrink-0 text-primary\" aria-hidden />\n <div className=\"min-w-0 flex-1 space-y-1.5\">\n <div\n className={cn('font-medium', cancelled && 'line-through')}\n data-testid=\"mail-invite-title\"\n >\n {invite.title || 'Untitled event'}\n </div>\n <div className=\"text-sm text-muted-foreground\">{when}</div>\n {invite.location && <div className=\"text-sm text-muted-foreground\">{invite.location}</div>}\n {invite.organizer && (\n <div className=\"text-xs text-muted-foreground\">\n Organiser: {invite.organizer.name || invite.organizer.email}\n </div>\n )}\n {cancelled && <div className=\"text-sm text-destructive\">This event was cancelled.</div>}\n {invite.method === 'REPLY' && (\n <div className=\"text-sm text-muted-foreground\">A guest replied to your invitation.</div>\n )}\n {!cancelled && invite.method !== 'REPLY' && !lookup.isLoading && !event && isOnline && (\n <div className=\"text-xs text-muted-foreground\">Not in your calendar yet.</div>\n )}\n {canRespond && partstat && (\n <div className=\"text-xs text-muted-foreground\" data-testid=\"mail-invite-status\">\n {PARTSTAT_TEXT[partstat] ?? partstat}\n </div>\n )}\n <div className=\"flex flex-wrap gap-1.5 pt-1\">\n {canRespond && (\n <>\n <Button\n size=\"sm\"\n variant={partstat === 'accepted' ? 'default' : 'outline'}\n disabled={!isOnline || respond.isPending}\n onClick={() => answer('accepted')}\n data-testid=\"mail-invite-accept\"\n >\n Accept\n </Button>\n <Button\n size=\"sm\"\n variant={partstat === 'tentative' ? 'default' : 'outline'}\n disabled={!isOnline || respond.isPending}\n onClick={() => answer('tentative')}\n >\n Maybe\n </Button>\n <Button\n size=\"sm\"\n variant={partstat === 'declined' ? 'default' : 'outline'}\n disabled={!isOnline || respond.isPending}\n onClick={() => answer('declined')}\n >\n Decline\n </Button>\n </>\n )}\n {event && onOpenEvent && (\n <Button\n size=\"sm\"\n variant=\"ghost\"\n onClick={() => onOpenEvent({ id: event.id })}\n data-testid=\"mail-invite-open\"\n >\n Open in calendar\n </Button>\n )}\n </div>\n </div>\n </div>\n )\n}\n"]}
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
- var chunkX6QGVLMV_cjs = require('./chunk-X6QGVLMV.cjs');
4
+ var chunkU4KUTO6O_cjs = require('./chunk-U4KUTO6O.cjs');
5
5
  var chunkAFQTQC7A_cjs = require('./chunk-AFQTQC7A.cjs');
6
6
  var chunkXJEXFEWG_cjs = require('./chunk-XJEXFEWG.cjs');
7
7
  var react = require('react');
@@ -31,7 +31,7 @@ function AssistantDockToggle({
31
31
  label = "Assistant chat",
32
32
  testId = "chat-dock-toggle"
33
33
  }) {
34
- const { isDockAvailable } = chunkX6QGVLMV_cjs.useChatSurface();
34
+ const { isDockAvailable } = chunkU4KUTO6O_cjs.useChatSurface();
35
35
  const dock = useAssistantDock();
36
36
  if (!isDockAvailable) return null;
37
37
  return /* @__PURE__ */ jsxRuntime.jsx(chunkAFQTQC7A_cjs.ToolButton, { onClick: dock.toggle, label, active: dock.isOpen, "data-testid": testId, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MessageSquare, { className: "size-4", "aria-hidden": "true" }) });
@@ -45,7 +45,7 @@ function AssistantDock({
45
45
  labels,
46
46
  onOpenCitation
47
47
  }) {
48
- const { isDockAvailable } = chunkX6QGVLMV_cjs.useChatSurface();
48
+ const { isDockAvailable } = chunkU4KUTO6O_cjs.useChatSurface();
49
49
  const dock = useAssistantDock();
50
50
  if (!isDockAvailable) return null;
51
51
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -59,7 +59,7 @@ function AssistantDock({
59
59
  closeLabel,
60
60
  "data-testid": "chat-dock",
61
61
  children: /* @__PURE__ */ jsxRuntime.jsx(
62
- chunkX6QGVLMV_cjs.ChatPage,
62
+ chunkU4KUTO6O_cjs.ChatPage,
63
63
  {
64
64
  chat,
65
65
  labels,
@@ -87,5 +87,5 @@ function AssistantDock({
87
87
  exports.AssistantDock = AssistantDock;
88
88
  exports.AssistantDockToggle = AssistantDockToggle;
89
89
  exports.useAssistantDock = useAssistantDock;
90
- //# sourceMappingURL=chunk-SK6BONXE.cjs.map
91
- //# sourceMappingURL=chunk-SK6BONXE.cjs.map
90
+ //# sourceMappingURL=chunk-36NQMOJE.cjs.map
91
+ //# sourceMappingURL=chunk-36NQMOJE.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/chat/assistant-dock-state.tsx","../src/chat/AssistantDock.tsx"],"names":["useSyncExternalStore","useChatSurface","ToolButton","jsx","MessageSquare","Shell","ChatPage","X"],"mappings":";;;;;;;;;AASA,IAAI,MAAA,GAAS,KAAA;AACb,IAAM,SAAA,uBAAgB,GAAA,EAAgB;AACtC,IAAM,SAAA,GAAY,CAAC,CAAA,KAAkB;AACnC,EAAA,SAAA,CAAU,IAAI,CAAC,CAAA;AACf,EAAA,OAAO,MAAM,SAAA,CAAU,MAAA,CAAO,CAAC,CAAA;AACjC,CAAA;AACA,SAAS,IAAI,IAAA,EAAe;AAC1B,EAAA,IAAI,SAA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,EAAA,uBACEE,cAAAA;AAAA,IAACE,uBAAA,CAAM,IAAA;AAAA,IAAN;AAAA,MACC,QAAQ,IAAA,CAAK,MAAA;AAAA,MACb,cAAc,IAAA,CAAK,OAAA;AAAA,MACnB,QAAA;AAAA,MACA,KAAA;AAAA,MACA,KAAA;AAAA,MACA,UAAA;AAAA,MACA,aAAA,EAAY,WAAA;AAAA,MAEZ,QAAA,kBAAAF,cAAAA;AAAA,QAACG,0BAAA;AAAA,QAAA;AAAA,UACC,IAAA;AAAA,UACA,MAAA;AAAA,UACA,cAAA;AAAA,UACA,OAAA,EAAQ,MAAA;AAAA,UACR,SAAA,EAAU,gBAAA;AAAA,UACV,aAAA;AAAA;AAAA,YAEE,CAAC,4BACCH,cAAAA;AAAA,cAACD,4BAAA;AAAA,cAAA;AAAA,gBACC,OAAA,EAAS,MAAM,IAAA,CAAK,OAAA,CAAQ,KAAK,CAAA;AAAA,gBACjC,KAAA,EAAO,UAAA;AAAA,gBACP,aAAA,EAAY,YAAA;AAAA,gBAEZ,0BAAAC,cAAAA,CAACI,aAAA,EAAA,EAAE,SAAA,EAAU,QAAA,EAAS,eAAY,MAAA,EAAO;AAAA;AAAA;AAC3C;AAAA;AAAA;AAGN;AAAA,GACF;AAEJ","file":"chunk-SK6BONXE.cjs","sourcesContent":["import { useSyncExternalStore } from 'react'\nimport { MessageSquare } from 'lucide-react'\nimport { ToolButton } from '../shell/ToolButton'\nimport { useChatSurface } from './chat-surface'\n\n/**\n * Open/closed state of the assistant dock: one module-level store, so the topbar button and the\n * dock agree wherever they are mounted, with no host store to write.\n */\nlet isOpen = false\nconst listeners = new Set<() => void>()\nconst subscribe = (l: () => void) => {\n listeners.add(l)\n return () => listeners.delete(l)\n}\nfunction set(next: boolean) {\n if (next === isOpen) return\n isOpen = next\n listeners.forEach((l) => l())\n}\n\nexport function useAssistantDock() {\n const open = useSyncExternalStore(\n subscribe,\n () => isOpen,\n () => false\n )\n return { isOpen: open, setOpen: set, toggle: () => set(!isOpen) }\n}\n\nexport interface AssistantDockToggleProps {\n /** Accessible name. Default \"Open assistant chat\". */\n label?: string\n testId?: string\n}\n\n/** Topbar button that opens and closes the dock. Renders nothing while a page chat is mounted. */\nexport function AssistantDockToggle({\n label = 'Assistant chat',\n testId = 'chat-dock-toggle',\n}: AssistantDockToggleProps) {\n const { isDockAvailable } = useChatSurface()\n const dock = useAssistantDock()\n if (!isDockAvailable) return null\n return (\n <ToolButton onClick={dock.toggle} label={label} active={dock.isOpen} data-testid={testId}>\n <MessageSquare className=\"size-4\" aria-hidden=\"true\" />\n </ToolButton>\n )\n}\n","import { X } from 'lucide-react'\nimport { Shell } from '../shell/Shell'\nimport { ToolButton } from '../shell/ToolButton'\nimport { ChatPage } from './ChatPage'\nimport { useChatSurface } from './chat-surface'\nimport type { ChatPageController, ChatPageProps } from './chat-page-types'\nimport { useAssistantDock } from './assistant-dock-state'\n\n/** What a dock takes: its chat, its frame and its words. The thread is the full page's `ChatPage`. */\nexport interface AssistantDockProps extends Pick<ChatPageProps, 'labels' | 'onOpenCitation'> {\n chat: ChatPageController\n /** Phone layout: the dock covers the screen as a modal. */\n isMobile?: boolean\n /** Desktop width. Default 380. */\n width?: number | string\n /** Accessible name of the dock. Default \"Assistant chat\". */\n label?: string\n closeLabel?: string\n}\n\n/**\n * The assistant as a right-hand dock: `Shell.Dock` around the same `ChatPage` as the full page\n * (`surface=\"dock\"`), with its open state in `useAssistantDock`. It yields to a mounted page chat\n * (`useChatSurface`), so the host only mounts it once, next to `Shell.Root`'s `aside`:\n *\n * ```tsx\n * <Shell.Root aside={<AssistantDock chat={chat} isMobile={isMobile} />} ... />\n * <AssistantDockToggle /> // in the topbar\n * ```\n *\n * Keep the `chat` controller in a component that stays mounted (the layout), so the conversation\n * survives closing the dock.\n */\nexport function AssistantDock({\n chat,\n isMobile = false,\n width = 380,\n label = 'Assistant chat',\n closeLabel = 'Close chat',\n labels,\n onOpenCitation,\n}: AssistantDockProps) {\n const { isDockAvailable } = useChatSurface()\n const dock = useAssistantDock()\n if (!isDockAvailable) return null\n return (\n <Shell.Dock\n isOpen={dock.isOpen}\n onOpenChange={dock.setOpen}\n isMobile={isMobile}\n width={width}\n label={label}\n closeLabel={closeLabel}\n data-testid=\"chat-dock\"\n >\n <ChatPage\n chat={chat}\n labels={labels}\n onOpenCitation={onOpenCitation}\n surface=\"dock\"\n className=\"min-h-0 flex-1\"\n headerActions={\n // On a phone the dock draws its own close button over the header.\n !isMobile && (\n <ToolButton\n onClick={() => dock.setOpen(false)}\n label={closeLabel}\n data-testid=\"chat-close\"\n >\n <X className=\"size-4\" aria-hidden=\"true\" />\n </ToolButton>\n )\n }\n />\n </Shell.Dock>\n )\n}\n"]}
1
+ {"version":3,"sources":["../src/chat/assistant-dock-state.tsx","../src/chat/AssistantDock.tsx"],"names":["useSyncExternalStore","useChatSurface","ToolButton","jsx","MessageSquare","Shell","ChatPage","X"],"mappings":";;;;;;;;;AASA,IAAI,MAAA,GAAS,KAAA;AACb,IAAM,SAAA,uBAAgB,GAAA,EAAgB;AACtC,IAAM,SAAA,GAAY,CAAC,CAAA,KAAkB;AACnC,EAAA,SAAA,CAAU,IAAI,CAAC,CAAA;AACf,EAAA,OAAO,MAAM,SAAA,CAAU,MAAA,CAAO,CAAC,CAAA;AACjC,CAAA;AACA,SAAS,IAAI,IAAA,EAAe;AAC1B,EAAA,IAAI,SAAS,MAAA,EAAQ;AACrB,EAAA,MAAA,GAAS,IAAA;AACT,EAAA,SAAA,CAAU,OAAA,CAAQ,CAAC,CAAA,KAAM,CAAA,EAAG,CAAA;AAC9B;AAEO,SAAS,gBAAA,GAAmB;AACjC,EAAA,MAAM,IAAA,GAAOA,0BAAA;AAAA,IACX,SAAA;AAAA,IACA,MAAM,MAAA;AAAA,IACN,MAAM;AAAA,GACR;AACA,EAAA,OAAO,EAAE,MAAA,EAAQ,IAAA,EAAM,OAAA,EAAS,GAAA,EAAK,QAAQ,MAAM,GAAA,CAAI,CAAC,MAAM,CAAA,EAAE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A;AAAA,UACR,SAAA,EAAU,gBAAA;AAAA,UACV,aAAA;AAAA;AAAA,YAEE,CAAC,4BACCH,cAAAA;AAAA,cAACD,4BAAA;AAAA,cAAA;AAAA,gBACC,OAAA,EAAS,MAAM,IAAA,CAAK,OAAA,CAAQ,KAAK,CAAA;AAAA,gBACjC,KAAA,EAAO,UAAA;AAAA,gBACP,aAAA,EAAY,YAAA;AAAA,gBAEZ,0BAAAC,cAAAA,CAACI,aAAA,EAAA,EAAE,SAAA,EAAU,QAAA,EAAS,eAAY,MAAA,EAAO;AAAA;AAAA;AAC3C;AAAA;AAAA;AAGN;AAAA,GACF;AAEJ","file":"chunk-36NQMOJE.cjs","sourcesContent":["import { useSyncExternalStore } from 'react'\nimport { MessageSquare } from 'lucide-react'\nimport { ToolButton } from '../shell/ToolButton'\nimport { useChatSurface } from './chat-surface'\n\n/**\n * Open/closed state of the assistant dock: one module-level store, so the topbar button and the\n * dock agree wherever they are mounted, with no host store to write.\n */\nlet isOpen = false\nconst listeners = new Set<() => void>()\nconst subscribe = (l: () => void) => {\n listeners.add(l)\n return () => listeners.delete(l)\n}\nfunction set(next: boolean) {\n if (next === isOpen) return\n isOpen = next\n listeners.forEach((l) => l())\n}\n\nexport function useAssistantDock() {\n const open = useSyncExternalStore(\n subscribe,\n () => isOpen,\n () => false\n )\n return { isOpen: open, setOpen: set, toggle: () => set(!isOpen) }\n}\n\nexport interface AssistantDockToggleProps {\n /** Accessible name. Default \"Open assistant chat\". */\n label?: string\n testId?: string\n}\n\n/** Topbar button that opens and closes the dock. Renders nothing while a page chat is mounted. */\nexport function AssistantDockToggle({\n label = 'Assistant chat',\n testId = 'chat-dock-toggle',\n}: AssistantDockToggleProps) {\n const { isDockAvailable } = useChatSurface()\n const dock = useAssistantDock()\n if (!isDockAvailable) return null\n return (\n <ToolButton onClick={dock.toggle} label={label} active={dock.isOpen} data-testid={testId}>\n <MessageSquare className=\"size-4\" aria-hidden=\"true\" />\n </ToolButton>\n )\n}\n","import { X } from 'lucide-react'\nimport { Shell } from '../shell/Shell'\nimport { ToolButton } from '../shell/ToolButton'\nimport { ChatPage } from './ChatPage'\nimport { useChatSurface } from './chat-surface'\nimport type { ChatPageController, ChatPageProps } from './chat-page-types'\nimport { useAssistantDock } from './assistant-dock-state'\n\n/** What a dock takes: its chat, its frame and its words. The thread is the full page's `ChatPage`. */\nexport interface AssistantDockProps extends Pick<ChatPageProps, 'labels' | 'onOpenCitation'> {\n chat: ChatPageController\n /** Phone layout: the dock covers the screen as a modal. */\n isMobile?: boolean\n /** Desktop width. Default 380. */\n width?: number | string\n /** Accessible name of the dock. Default \"Assistant chat\". */\n label?: string\n closeLabel?: string\n}\n\n/**\n * The assistant as a right-hand dock: `Shell.Dock` around the same `ChatPage` as the full page\n * (`surface=\"dock\"`), with its open state in `useAssistantDock`. It yields to a mounted page chat\n * (`useChatSurface`), so the host only mounts it once, next to `Shell.Root`'s `aside`:\n *\n * ```tsx\n * <Shell.Root aside={<AssistantDock chat={chat} isMobile={isMobile} />} ... />\n * <AssistantDockToggle /> // in the topbar\n * ```\n *\n * Keep the `chat` controller in a component that stays mounted (the layout), so the conversation\n * survives closing the dock.\n */\nexport function AssistantDock({\n chat,\n isMobile = false,\n width = 380,\n label = 'Assistant chat',\n closeLabel = 'Close chat',\n labels,\n onOpenCitation,\n}: AssistantDockProps) {\n const { isDockAvailable } = useChatSurface()\n const dock = useAssistantDock()\n if (!isDockAvailable) return null\n return (\n <Shell.Dock\n isOpen={dock.isOpen}\n onOpenChange={dock.setOpen}\n isMobile={isMobile}\n width={width}\n label={label}\n closeLabel={closeLabel}\n data-testid=\"chat-dock\"\n >\n <ChatPage\n chat={chat}\n labels={labels}\n onOpenCitation={onOpenCitation}\n surface=\"dock\"\n className=\"min-h-0 flex-1\"\n headerActions={\n // On a phone the dock draws its own close button over the header.\n !isMobile && (\n <ToolButton\n onClick={() => dock.setOpen(false)}\n label={closeLabel}\n data-testid=\"chat-close\"\n >\n <X className=\"size-4\" aria-hidden=\"true\" />\n </ToolButton>\n )\n }\n />\n </Shell.Dock>\n )\n}\n"]}
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
- var chunkC36NH6PR_cjs = require('./chunk-C36NH6PR.cjs');
4
+ var chunkSH7W4WVI_cjs = require('./chunk-SH7W4WVI.cjs');
5
5
  var chunkZBP4ZSAJ_cjs = require('./chunk-ZBP4ZSAJ.cjs');
6
6
  var jsxRuntime = require('react/jsx-runtime');
7
7
  var react = require('react');
@@ -26,7 +26,7 @@ function TranscriptEntry({
26
26
  {
27
27
  speakerId,
28
28
  speakerName,
29
- speaker: /* @__PURE__ */ jsxRuntime.jsx(chunkC36NH6PR_cjs.CallUserPill, { identity: speakerId, name: speakerName }),
29
+ speaker: /* @__PURE__ */ jsxRuntime.jsx(chunkSH7W4WVI_cjs.CallUserPill, { identity: speakerId, name: speakerName }),
30
30
  time: formatTime(at),
31
31
  text,
32
32
  continued,
@@ -57,5 +57,5 @@ exports.TranscriptEntry = TranscriptEntry;
57
57
  exports.TranscriptRunsContext = TranscriptRunsContext;
58
58
  exports.threadTranscriptRuns = threadTranscriptRuns;
59
59
  exports.useTranscriptRuns = useTranscriptRuns;
60
- //# sourceMappingURL=chunk-JOYB727S.cjs.map
61
- //# sourceMappingURL=chunk-JOYB727S.cjs.map
60
+ //# sourceMappingURL=chunk-3GQQUR27.cjs.map
61
+ //# sourceMappingURL=chunk-3GQQUR27.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/calls/connected/TranscriptEntry.tsx","../src/calls/connected/transcript-runs-context.ts"],"names":["jsx","TranscriptLine","CallUserPill","createContext","useContext","transcriptSegmentOf","transcriptRuns"],"mappings":";;;;;;;;AAUA,SAAS,WAAW,GAAA,EAAwC;AAC1D,EAAA,IAAI,CAAC,KAAK,OAAO,EAAA;AACjB,EAAA,MAAM,EAAA,GAAK,IAAA,CAAK,KAAA,CAAM,GAAG,CAAA;AACzB,EAAA,IAAI,MAAA,CAAO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AA,IAAK;AAAA,GACvE;AACA,EAAA,OAAO;AAAA,IACL,WAAW,IAAI,GAAA;AAAA,MACb,CAAC,GAAG,cAAc,CAAA,CAAE,IAAI,CAAC,CAAA,KAAM,CAAA,CAAE,WAAW,EAAE,MAAA,CAAO,CAAC,EAAA,KAAqB,CAAC,CAAC,EAAE;AAAA;AACjF,GACF;AACF","file":"chunk-JOYB727S.cjs","sourcesContent":["/**\n * One stored line of a call transcript in its conversation (meeting chat or workspace meeting\n * thread): `TranscriptLine` from `@arbidocs/blocks`, centred for everyone. What someone is saying\n * right now shows as a provisional \"is speaking…\" row below, not as a highlight on a past line.\n */\n\nimport type { ReactElement } from 'react'\nimport { TranscriptLine } from '../../chat/TranscriptLine'\nimport { CallUserPill } from './CallUserPill'\n\nfunction formatTime(iso: string | null | undefined): string {\n if (!iso) return ''\n const at = Date.parse(iso)\n if (Number.isNaN(at)) return ''\n return new Date(at).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' })\n}\n\nexport function TranscriptEntry({\n speakerId,\n speakerName,\n text,\n at,\n continued = false,\n className,\n}: {\n /** The speaker's identity (user ext id), for `data-speaker`. */\n speakerId: string\n /** The name to show (\"Me\" for my own lines). */\n speakerName: string\n text: string\n /** ISO time the segment started (or the message was stored). */\n at: string | null | undefined\n /** A further line of the same speaker's run (no name repeated). */\n continued?: boolean\n className?: string\n}): ReactElement {\n return (\n <TranscriptLine\n speakerId={speakerId}\n speakerName={speakerName}\n speaker={<CallUserPill identity={speakerId} name={speakerName} />}\n time={formatTime(at)}\n text={text}\n continued={continued}\n className={className}\n />\n )\n}\n","/**\n * How a meeting thread's transcript lines group: which messages continue their speaker's run (the\n * name is not repeated). Provided by the conversation page, read by each transcript message.\n */\n\nimport { createContext, useContext } from 'react'\nimport { transcriptRuns } from '../../chat/transcript-runs'\nimport { transcriptSegmentOf } from '@arbidocs/react'\n\nexport interface TranscriptRunInfo {\n continued: ReadonlySet<string>\n}\n\nconst EMPTY: TranscriptRunInfo = { continued: new Set() }\n\nexport const TranscriptRunsContext = createContext<TranscriptRunInfo>(EMPTY)\n\nexport function useTranscriptRuns(): TranscriptRunInfo {\n return useContext(TranscriptRunsContext)\n}\n\ninterface ThreadMessageLike {\n external_id?: string | null\n created_at?: string | null\n tools?: unknown\n meta?: { tools?: unknown } | null\n}\n\n/** Runs of a thread's messages (in display order). */\nexport function threadTranscriptRuns(messages: ThreadMessageLike[]): TranscriptRunInfo {\n const segmentOf = (m: ThreadMessageLike) => transcriptSegmentOf(m.tools ?? m.meta?.tools)\n const continuedItems = transcriptRuns(\n messages,\n (m) => segmentOf(m)?.speaker_ext_id ?? null,\n (m) => Date.parse(segmentOf(m)?.started_at ?? m.created_at ?? '') || 0\n )\n return {\n continued: new Set(\n [...continuedItems].map((m) => m.external_id).filter((id): id is string => !!id)\n ),\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/calls/connected/TranscriptEntry.tsx","../src/calls/connected/transcript-runs-context.ts"],"names":["jsx","TranscriptLine","CallUserPill","createContext","useContext","transcriptSegmentOf","transcriptRuns"],"mappings":";;;;;;;;AAUA,SAAS,WAAW,GAAA,EAAwC;AAC1D,EAAA,IAAI,CAAC,KAAK,OAAO,EAAA;AACjB,EAAA,MAAM,EAAA,GAAK,IAAA,CAAK,KAAA,CAAM,GAAG,CAAA;AACzB,EAAA,IAAI,MAAA,CAAO,KAAA,CAAM,EAAE,CAAA,EAAG,OAAO,EAAA;AAC7B,EAAA,OAAO,IAAI,IAAA,CAAK,EAAE,CAAA,CAAE,kBAAA,CAAmB,EAAC,EAAG,EAAE,IAAA,EAAM,SAAA,EAAW,MAAA,EAAQ,SAAA,EAAW,CAAA;AACnF;AAEO,SAAS,eAAA,CAAgB;AAAA,EAC9B,SAAA;AAAA,EACA,WAAA;AAAA,EACA,IAAA;AAAA,EACA,EAAA;AAAA,EACA,SAAA,GAAY,KAAA;AAAA,EACZ;AACF,CAAA,EAWiB;AACf,EAAA,uBACEA,cAAA;AAAA,IAACC,gCAAA;AAAA,IAAA;AAAA,MACC,SAAA;AAAA,MACA,WAAA;AAAA,MACA,yBAASD,cAAA,CAACE,8BAAA,EAAA,EAAa,QAAA,EAAU,SAAA,EAAW,MAAM,WAAA,EAAa,CAAA;AAAA,MAC/D,IAAA,EAAM,WAAW,EAAE,CAAA;AAAA,MACnB,IAAA;AAAA,MACA,SAAA;AAAA,MACA;AAAA;AAAA,GACF;AAEJ;AClCA,IAAM,KAAA,GAA2B,EAAE,SAAA,kBAAW,IAAI,KAAI,EAAE;AAEjD,IAAM,qBAAA,GAAwBC,oBAAiC,KAAK;AAEpE,SAAS,iBAAA,GAAuC;AACrD,EAAA,OAAOC,iBAAW,qBAAqB,CAAA;AACzC;AAUO,SAAS,qBAAqB,QAAA,EAAkD;AACrF,EAAA,MAAM,SAAA,GAAY,CAAC,CAAA,KAAyBC,2BAAA,CAAoB,EAAE,KAAA,IAAS,CAAA,CAAE,MAAM,KAAK,CAAA;AACxF,EAAA,MAAM,cAAA,GAAiBC,gCAAA;AAAA,IACrB,QAAA;AAAA,IACA,CAAC,CAAA,KAAM,SAAA,CAAU,CAAC,GAAG,cAAA,IAAkB,IAAA;AAAA,IACvC,CAAC,CAAA,KAAM,IAAA,CAAK,KAAA,CAAM,SAAA,CAAU,CAAC,CAAA,EAAG,UAAA,IAAc,CAAA,CAAE,UAAA,IAAc,EAAE,CAAA,IAAK;AAAA,GACvE;AACA,EAAA,OAAO;AAAA,IACL,WAAW,IAAI,GAAA;AAAA,MACb,CAAC,GAAG,cAAc,CAAA,CAAE,IAAI,CAAC,CAAA,KAAM,CAAA,CAAE,WAAW,EAAE,MAAA,CAAO,CAAC,EAAA,KAAqB,CAAC,CAAC,EAAE;AAAA;AACjF,GACF;AACF","file":"chunk-3GQQUR27.cjs","sourcesContent":["/**\n * One stored line of a call transcript in its conversation (meeting chat or workspace meeting\n * thread): `TranscriptLine` from `@arbidocs/blocks`, centred for everyone. What someone is saying\n * right now shows as a provisional \"is speaking…\" row below, not as a highlight on a past line.\n */\n\nimport type { ReactElement } from 'react'\nimport { TranscriptLine } from '../../chat/TranscriptLine'\nimport { CallUserPill } from './CallUserPill'\n\nfunction formatTime(iso: string | null | undefined): string {\n if (!iso) return ''\n const at = Date.parse(iso)\n if (Number.isNaN(at)) return ''\n return new Date(at).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' })\n}\n\nexport function TranscriptEntry({\n speakerId,\n speakerName,\n text,\n at,\n continued = false,\n className,\n}: {\n /** The speaker's identity (user ext id), for `data-speaker`. */\n speakerId: string\n /** The name to show (\"Me\" for my own lines). */\n speakerName: string\n text: string\n /** ISO time the segment started (or the message was stored). */\n at: string | null | undefined\n /** A further line of the same speaker's run (no name repeated). */\n continued?: boolean\n className?: string\n}): ReactElement {\n return (\n <TranscriptLine\n speakerId={speakerId}\n speakerName={speakerName}\n speaker={<CallUserPill identity={speakerId} name={speakerName} />}\n time={formatTime(at)}\n text={text}\n continued={continued}\n className={className}\n />\n )\n}\n","/**\n * How a meeting thread's transcript lines group: which messages continue their speaker's run (the\n * name is not repeated). Provided by the conversation page, read by each transcript message.\n */\n\nimport { createContext, useContext } from 'react'\nimport { transcriptRuns } from '../../chat/transcript-runs'\nimport { transcriptSegmentOf } from '@arbidocs/react'\n\nexport interface TranscriptRunInfo {\n continued: ReadonlySet<string>\n}\n\nconst EMPTY: TranscriptRunInfo = { continued: new Set() }\n\nexport const TranscriptRunsContext = createContext<TranscriptRunInfo>(EMPTY)\n\nexport function useTranscriptRuns(): TranscriptRunInfo {\n return useContext(TranscriptRunsContext)\n}\n\ninterface ThreadMessageLike {\n external_id?: string | null\n created_at?: string | null\n tools?: unknown\n meta?: { tools?: unknown } | null\n}\n\n/** Runs of a thread's messages (in display order). */\nexport function threadTranscriptRuns(messages: ThreadMessageLike[]): TranscriptRunInfo {\n const segmentOf = (m: ThreadMessageLike) => transcriptSegmentOf(m.tools ?? m.meta?.tools)\n const continuedItems = transcriptRuns(\n messages,\n (m) => segmentOf(m)?.speaker_ext_id ?? null,\n (m) => Date.parse(segmentOf(m)?.started_at ?? m.created_at ?? '') || 0\n )\n return {\n continued: new Set(\n [...continuedItems].map((m) => m.external_id).filter((id): id is string => !!id)\n ),\n }\n}\n"]}
@@ -2,7 +2,7 @@
2
2
  'use strict';
3
3
 
4
4
  var chunkZU2B2RZK_cjs = require('./chunk-ZU2B2RZK.cjs');
5
- var chunkGAVQFR6P_cjs = require('./chunk-GAVQFR6P.cjs');
5
+ var chunkYA6GXWC2_cjs = require('./chunk-YA6GXWC2.cjs');
6
6
  var chunkZW6FPIFC_cjs = require('./chunk-ZW6FPIFC.cjs');
7
7
  var lucideReact = require('lucide-react');
8
8
  var ui = require('@arbidocs/react/ui');
@@ -181,7 +181,7 @@ function MetricCard({
181
181
  );
182
182
  if (!isInteractive) return card;
183
183
  return /* @__PURE__ */ jsxRuntime.jsx(
184
- chunkGAVQFR6P_cjs.ActionLink,
184
+ chunkYA6GXWC2_cjs.ActionLink,
185
185
  {
186
186
  href,
187
187
  onSelect,
@@ -194,5 +194,5 @@ function MetricCard({
194
194
 
195
195
  exports.DataTable = DataTable;
196
196
  exports.MetricCard = MetricCard;
197
- //# sourceMappingURL=chunk-F4ULSAOA.cjs.map
198
- //# sourceMappingURL=chunk-F4ULSAOA.cjs.map
197
+ //# sourceMappingURL=chunk-3XCYPWC5.cjs.map
198
+ //# sourceMappingURL=chunk-3XCYPWC5.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/DataTable.tsx","../src/components/MetricCard.tsx"],"names":["tid","jsx","EmptyState","cn","jsxs","Table","TableHeader","TableRow","TableHead","ArrowUp","ArrowDown","ChevronsUpDown","TableBody","TableCell","Card","ArrowUpRight","ArrowDownRight","ActionLink"],"mappings":";;;;;;;;;AAoDA,IAAM,aAAa,EAAE,IAAA,EAAM,aAAa,KAAA,EAAO,YAAA,EAAc,QAAQ,aAAA,EAAc;AAEnF,IAAM,wBAAA,GAA2B,EAAE,SAAA,EAAW,iBAAA,EAAmB,WAAW,Y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A,EACZ,QAAA,EAAA;AAAA,UAAA,KAAA,IAAS,CAAC,6BACTA,eAAAA;AAAA,YAAC,MAAA;AAAA,YAAA;AAAA,cACC,SAAA,EAAWD,KAAAA;AAAA,gBACT,sDAAA;AAAA,gBACA,YAAY,cAAA,GAAiB;AAAA,eAC/B;AAAA,cAEC,QAAA,EAAA;AAAA,gBAAA,KAAA,CAAM,SAAA,KAAc,IAAA,mBACnBF,cAAAA,CAACc,wBAAA,EAAA,EAAa,SAAA,EAAU,QAAA,EAAS,CAAA,mBAEjCd,cAAAA,CAACe,0BAAA,EAAA,EAAe,SAAA,EAAU,QAAA,EAAS,CAAA;AAAA,gBAEpC,KAAA,CAAM;AAAA;AAAA;AAAA,WACT;AAAA,UAED,wBAAQf,cAAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAU,iCAAiC,QAAA,EAAA,IAAA,EAAK;AAAA,SAAA,EACjE;AAAA;AAAA;AAAA,GACF;AAEF,EAAA,IAAI,CAAC,eAAe,OAAO,IAAA;AAC3B,EAAA,uBACEA,cAAAA;AAAA,IAACgB,4BAAA;AAAA,IAAA;AAAA,MACC,IAAA;AAAA,MACA,QAAA;AAAA,MACA,SAAA,EAAU,oGAAA;AAAA,MACV,aAAA,EAAa,MAAA;AAAA,MAEZ,QAAA,EAAA;AAAA;AAAA,GACH;AAEJ","file":"chunk-F4ULSAOA.cjs","sourcesContent":["import type { ReactNode } from 'react'\nimport { ArrowDown, ArrowUp, ChevronsUpDown } from 'lucide-react'\nimport { cn } from '@arbidocs/react/ui'\nimport { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@arbidocs/react/ui'\nimport { tid } from '../lib/testid'\nimport { EmptyState } from './EmptyState'\n\nexport interface Column<T> {\n key: string\n header: ReactNode\n render: (row: T) => ReactNode\n align?: 'left' | 'right' | 'center'\n /** Header becomes a sort button (needs `sort` and `onSortChange` on the table). */\n isSortable?: boolean\n className?: string\n headClassName?: string\n}\n\nexport interface DataTableSort {\n key: string\n direction: 'asc' | 'desc'\n}\n\nexport interface DataTableTestIds {\n table: string\n empty: string\n /** Test id of a row. */\n row: (id: string) => string\n}\n\nexport interface DataTableProps<T> {\n columns: Column<T>[]\n rows: T[]\n getRowId: (row: T) => string\n onRowClick?: (row: T) => void\n /** Test id area prefix, e.g. \"orders\" gives rows \"orders-row-{id}\". Default \"data\". */\n area?: string\n /** Replaces the ids derived from `area`. */\n testIds?: Partial<DataTableTestIds>\n emptyTitle?: string\n emptyDescription?: string\n /** Controlled sort state. The host sorts `rows`; the table only renders headers. */\n sort?: DataTableSort | null\n onSortChange?: (sort: DataTableSort) => void\n /** Controlled row selection: adds a leading checkbox column when `onSelectedIdsChange` is set. */\n selectedIds?: string[]\n onSelectedIdsChange?: (ids: string[]) => void\n /** Accessible names of the selection checkboxes. */\n selectionLabels?: { selectAll: string; selectRow: string }\n className?: string\n}\n\nconst alignClass = { left: 'text-left', right: 'text-right', center: 'text-center' } as const\n\nconst DEFAULT_SELECTION_LABELS = { selectAll: 'Select all rows', selectRow: 'Select row' }\n\n/** The one true table. Column-config driven, fully test-id'd, optional navigation, sort, selection. */\nexport function DataTable<T>({\n columns,\n rows,\n getRowId,\n onRowClick,\n area = 'data',\n testIds,\n emptyTitle = 'Nothing to show',\n emptyDescription,\n sort,\n onSortChange,\n selectedIds,\n onSelectedIdsChange,\n selectionLabels,\n className,\n}: DataTableProps<T>) {\n const ids = {\n table: testIds?.table ?? tid(area, 'table'),\n empty: testIds?.empty ?? tid(area, 'empty'),\n row: testIds?.row ?? ((id: string) => tid(area, 'row', id)),\n }\n const labels = { ...DEFAULT_SELECTION_LABELS, ...selectionLabels }\n if (rows.length === 0) {\n return <EmptyState title={emptyTitle} description={emptyDescription} testId={ids.empty} />\n }\n\n const isSelectable = Boolean(onSelectedIdsChange)\n const selected = new Set(selectedIds ?? [])\n const rowIds = rows.map(getRowId)\n const allSelected = rowIds.length > 0 && rowIds.every((id) => selected.has(id))\n const toggleRow = (id: string) => {\n const next = new Set(selected)\n if (next.has(id)) next.delete(id)\n else next.add(id)\n onSelectedIdsChange?.([...next])\n }\n\n return (\n <div className={cn('rounded-lg border border-border bg-card', className)}>\n <Table data-testid={ids.table}>\n <TableHeader>\n <TableRow className=\"hover:bg-transparent\">\n {isSelectable && (\n <TableHead className=\"w-10\">\n <input\n type=\"checkbox\"\n aria-label={labels.selectAll}\n checked={allSelected}\n onChange={() => onSelectedIdsChange?.(allSelected ? [] : rowIds)}\n />\n </TableHead>\n )}\n {columns.map((c) => {\n const active = sort?.key === c.key ? sort : null\n const isSortable = c.isSortable && onSortChange\n return (\n <TableHead\n key={c.key}\n aria-sort={\n active ? (active.direction === 'asc' ? 'ascending' : 'descending') : undefined\n }\n className={cn(c.align && alignClass[c.align], c.headClassName)}\n >\n {isSortable ? (\n <button\n type=\"button\"\n className=\"inline-flex items-center gap-1 hover:text-foreground\"\n onClick={() =>\n onSortChange({\n key: c.key,\n direction: active?.direction === 'asc' ? 'desc' : 'asc',\n })\n }\n >\n {c.header}\n {active ? (\n active.direction === 'asc' ? (\n <ArrowUp className=\"size-3\" />\n ) : (\n <ArrowDown className=\"size-3\" />\n )\n ) : (\n <ChevronsUpDown className=\"size-3 opacity-50\" />\n )}\n </button>\n ) : (\n c.header\n )}\n </TableHead>\n )\n })}\n </TableRow>\n </TableHeader>\n <TableBody>\n {rows.map((row) => {\n const id = getRowId(row)\n return (\n <TableRow\n key={id}\n data-testid={ids.row(id)}\n data-state={selected.has(id) ? 'selected' : undefined}\n onClick={onRowClick ? () => onRowClick(row) : undefined}\n className={cn(onRowClick && 'cursor-pointer')}\n >\n {isSelectable && (\n <TableCell className=\"w-10\" onClick={(e) => e.stopPropagation()}>\n <input\n type=\"checkbox\"\n aria-label={labels.selectRow}\n checked={selected.has(id)}\n onChange={() => toggleRow(id)}\n />\n </TableCell>\n )}\n {columns.map((c) => (\n <TableCell\n key={c.key}\n className={cn(c.align && alignClass[c.align], c.className)}\n >\n {c.render(row)}\n </TableCell>\n ))}\n </TableRow>\n )\n })}\n </TableBody>\n </Table>\n </div>\n )\n}\n","import type { ReactNode } from 'react'\nimport type { LucideIcon } from 'lucide-react'\nimport { ArrowDownRight, ArrowUpRight } from 'lucide-react'\nimport { Card, cn } from '@arbidocs/react/ui'\nimport { ActionLink } from './ActionLink'\n\nexport interface MetricCardProps {\n label: ReactNode\n value: ReactNode\n icon?: LucideIcon\n hint?: ReactNode\n delta?: { value: string; direction: 'up' | 'down'; good?: boolean }\n /**\n * Icon accent as a theme colour-token key (e.g. `primary`, `success`, or the host's own brand\n * token). Resolved to `var(--color-<accent>)` at render. `'default'` inherits `foreground`.\n */\n accent?: string\n /** Show a placeholder instead of the value (the figure is still being fetched). */\n isLoading?: boolean\n /** Makes the tile a real link (ctrl/cmd-click works). */\n href?: string\n /** Click handler; with `href`, a plain click calls it instead of navigating. */\n onSelect?: () => void\n className?: string\n testId?: string\n}\n\n/** The one true KPI tile. Used across every dashboard and module header. */\nexport function MetricCard({\n label,\n value,\n icon: Icon,\n hint,\n delta,\n accent = 'default',\n isLoading = false,\n href,\n onSelect,\n className,\n testId,\n}: MetricCardProps) {\n const accentStyle =\n accent && accent !== 'default' ? { color: `var(--color-${accent})` } : undefined\n const deltaGood = delta?.good ?? delta?.direction === 'up'\n const isInteractive = Boolean(href || onSelect)\n const card = (\n <Card\n variant=\"elevated\"\n className={cn('card-hover min-w-0 rounded-xl p-5', className)}\n data-testid={isInteractive ? undefined : testId}\n aria-busy={isLoading || undefined}\n >\n <div className=\"flex items-start justify-between gap-3\">\n <p className=\"min-w-0 text-xs font-medium uppercase tracking-wide text-muted-foreground\">\n {label}\n </p>\n {Icon && <Icon className=\"size-4 shrink-0\" style={accentStyle} />}\n </div>\n {isLoading ? (\n <div\n className=\"mt-2 h-8 w-20 animate-pulse rounded bg-muted\"\n data-slot=\"metric-card-skeleton\"\n />\n ) : (\n <p\n className=\"mt-2 font-display text-2xl font-semibold tracking-tight [overflow-wrap:anywhere]\"\n data-testid={testId && `${testId}-value`}\n >\n {value}\n </p>\n )}\n <div className=\"mt-1 flex items-center gap-2\">\n {delta && !isLoading && (\n <span\n className={cn(\n 'inline-flex items-center gap-0.5 text-xs font-medium',\n deltaGood ? 'text-success' : 'text-destructive'\n )}\n >\n {delta.direction === 'up' ? (\n <ArrowUpRight className=\"size-3\" />\n ) : (\n <ArrowDownRight className=\"size-3\" />\n )}\n {delta.value}\n </span>\n )}\n {hint && <span className=\"text-xs text-muted-foreground\">{hint}</span>}\n </div>\n </Card>\n )\n if (!isInteractive) return card\n return (\n <ActionLink\n href={href}\n onSelect={onSelect}\n className=\"block rounded-xl text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n data-testid={testId}\n >\n {card}\n </ActionLink>\n )\n}\n"]}
1
+ {"version":3,"sources":["../src/components/DataTable.tsx","../src/components/MetricCard.tsx"],"names":["tid","jsx","EmptyState","cn","jsxs","Table","TableHeader","TableRow","TableHead","ArrowUp","ArrowDown","ChevronsUpDown","TableBody","TableCell","Card","ArrowUpRight","ArrowDownRight","ActionLink"],"mappings":";;;;;;;;;AAoDA,IAAM,aAAa,EAAE,IAAA,EAAM,aAAa,KAAA,EAAO,YAAA,EAAc,QAAQ,aAAA,EAAc;AAEnF,IAAM,wBAAA,GAA2B,EAAE,SAAA,EAAW,iBAAA,EAAmB,WAAW,YAAA,EAAa;AAGlF,SAAS,SAAA,CAAa;AAAA,EAC3B,OAAA;AAAA,EACA,IAAA;AAAA,EACA,QAAA;AAAA,EACA,UAAA;AAAA,EACA,IAAA,GAAO,MAAA;AAAA,EACP,OAAA;AAAA,EACA,UAAA,GAAa,iBAAA;AAAA,EACb,gBAAA;AAAA,EACA,IAAA;AAAA,EACA,YAAA;AAAA,EACA,WAAA;AAAA,EACA,mBAAA;AAAA,EACA,eAAA;AAAA,EACA;AACF,CAAA,EAAsB;AACpB,EAAA,MAAM,GAAA,GAAM;AAAA,IACV,KAAA,EAAO,OAAA,EAAS,KAAA,IAASA,qBAAA,CAAI,MAAM,OAA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,KAAA,CAAM;AAAA;AAAA;AAAA,WACT;AAAA,UAED,wBAAQf,cAAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAU,iCAAiC,QAAA,EAAA,IAAA,EAAK;AAAA,SAAA,EACjE;AAAA;AAAA;AAAA,GACF;AAEF,EAAA,IAAI,CAAC,eAAe,OAAO,IAAA;AAC3B,EAAA,uBACEA,cAAAA;AAAA,IAACgB,4BAAA;AAAA,IAAA;AAAA,MACC,IAAA;AAAA,MACA,QAAA;AAAA,MACA,SAAA,EAAU,oGAAA;AAAA,MACV,aAAA,EAAa,MAAA;AAAA,MAEZ,QAAA,EAAA;AAAA;AAAA,GACH;AAEJ","file":"chunk-3XCYPWC5.cjs","sourcesContent":["import type { ReactNode } from 'react'\nimport { ArrowDown, ArrowUp, ChevronsUpDown } from 'lucide-react'\nimport { cn } from '@arbidocs/react/ui'\nimport { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@arbidocs/react/ui'\nimport { tid } from '../lib/testid'\nimport { EmptyState } from './EmptyState'\n\nexport interface Column<T> {\n key: string\n header: ReactNode\n render: (row: T) => ReactNode\n align?: 'left' | 'right' | 'center'\n /** Header becomes a sort button (needs `sort` and `onSortChange` on the table). */\n isSortable?: boolean\n className?: string\n headClassName?: string\n}\n\nexport interface DataTableSort {\n key: string\n direction: 'asc' | 'desc'\n}\n\nexport interface DataTableTestIds {\n table: string\n empty: string\n /** Test id of a row. */\n row: (id: string) => string\n}\n\nexport interface DataTableProps<T> {\n columns: Column<T>[]\n rows: T[]\n getRowId: (row: T) => string\n onRowClick?: (row: T) => void\n /** Test id area prefix, e.g. \"orders\" gives rows \"orders-row-{id}\". Default \"data\". */\n area?: string\n /** Replaces the ids derived from `area`. */\n testIds?: Partial<DataTableTestIds>\n emptyTitle?: string\n emptyDescription?: string\n /** Controlled sort state. The host sorts `rows`; the table only renders headers. */\n sort?: DataTableSort | null\n onSortChange?: (sort: DataTableSort) => void\n /** Controlled row selection: adds a leading checkbox column when `onSelectedIdsChange` is set. */\n selectedIds?: string[]\n onSelectedIdsChange?: (ids: string[]) => void\n /** Accessible names of the selection checkboxes. */\n selectionLabels?: { selectAll: string; selectRow: string }\n className?: string\n}\n\nconst alignClass = { left: 'text-left', right: 'text-right', center: 'text-center' } as const\n\nconst DEFAULT_SELECTION_LABELS = { selectAll: 'Select all rows', selectRow: 'Select row' }\n\n/** The one true table. Column-config driven, fully test-id'd, optional navigation, sort, selection. */\nexport function DataTable<T>({\n columns,\n rows,\n getRowId,\n onRowClick,\n area = 'data',\n testIds,\n emptyTitle = 'Nothing to show',\n emptyDescription,\n sort,\n onSortChange,\n selectedIds,\n onSelectedIdsChange,\n selectionLabels,\n className,\n}: DataTableProps<T>) {\n const ids = {\n table: testIds?.table ?? tid(area, 'table'),\n empty: testIds?.empty ?? tid(area, 'empty'),\n row: testIds?.row ?? ((id: string) => tid(area, 'row', id)),\n }\n const labels = { ...DEFAULT_SELECTION_LABELS, ...selectionLabels }\n if (rows.length === 0) {\n return <EmptyState title={emptyTitle} description={emptyDescription} testId={ids.empty} />\n }\n\n const isSelectable = Boolean(onSelectedIdsChange)\n const selected = new Set(selectedIds ?? [])\n const rowIds = rows.map(getRowId)\n const allSelected = rowIds.length > 0 && rowIds.every((id) => selected.has(id))\n const toggleRow = (id: string) => {\n const next = new Set(selected)\n if (next.has(id)) next.delete(id)\n else next.add(id)\n onSelectedIdsChange?.([...next])\n }\n\n return (\n <div className={cn('rounded-lg border border-border bg-card', className)}>\n <Table data-testid={ids.table}>\n <TableHeader>\n <TableRow className=\"hover:bg-transparent\">\n {isSelectable && (\n <TableHead className=\"w-10\">\n <input\n type=\"checkbox\"\n aria-label={labels.selectAll}\n checked={allSelected}\n onChange={() => onSelectedIdsChange?.(allSelected ? [] : rowIds)}\n />\n </TableHead>\n )}\n {columns.map((c) => {\n const active = sort?.key === c.key ? sort : null\n const isSortable = c.isSortable && onSortChange\n return (\n <TableHead\n key={c.key}\n aria-sort={\n active ? (active.direction === 'asc' ? 'ascending' : 'descending') : undefined\n }\n className={cn(c.align && alignClass[c.align], c.headClassName)}\n >\n {isSortable ? (\n <button\n type=\"button\"\n className=\"inline-flex items-center gap-1 hover:text-foreground\"\n onClick={() =>\n onSortChange({\n key: c.key,\n direction: active?.direction === 'asc' ? 'desc' : 'asc',\n })\n }\n >\n {c.header}\n {active ? (\n active.direction === 'asc' ? (\n <ArrowUp className=\"size-3\" />\n ) : (\n <ArrowDown className=\"size-3\" />\n )\n ) : (\n <ChevronsUpDown className=\"size-3 opacity-50\" />\n )}\n </button>\n ) : (\n c.header\n )}\n </TableHead>\n )\n })}\n </TableRow>\n </TableHeader>\n <TableBody>\n {rows.map((row) => {\n const id = getRowId(row)\n return (\n <TableRow\n key={id}\n data-testid={ids.row(id)}\n data-state={selected.has(id) ? 'selected' : undefined}\n onClick={onRowClick ? () => onRowClick(row) : undefined}\n className={cn(onRowClick && 'cursor-pointer')}\n >\n {isSelectable && (\n <TableCell className=\"w-10\" onClick={(e) => e.stopPropagation()}>\n <input\n type=\"checkbox\"\n aria-label={labels.selectRow}\n checked={selected.has(id)}\n onChange={() => toggleRow(id)}\n />\n </TableCell>\n )}\n {columns.map((c) => (\n <TableCell\n key={c.key}\n className={cn(c.align && alignClass[c.align], c.className)}\n >\n {c.render(row)}\n </TableCell>\n ))}\n </TableRow>\n )\n })}\n </TableBody>\n </Table>\n </div>\n )\n}\n","import type { ReactNode } from 'react'\nimport type { LucideIcon } from 'lucide-react'\nimport { ArrowDownRight, ArrowUpRight } from 'lucide-react'\nimport { Card, cn } from '@arbidocs/react/ui'\nimport { ActionLink } from './ActionLink'\n\nexport interface MetricCardProps {\n label: ReactNode\n value: ReactNode\n icon?: LucideIcon\n hint?: ReactNode\n delta?: { value: string; direction: 'up' | 'down'; good?: boolean }\n /**\n * Icon accent as a theme colour-token key (e.g. `primary`, `success`, or the host's own brand\n * token). Resolved to `var(--color-<accent>)` at render. `'default'` inherits `foreground`.\n */\n accent?: string\n /** Show a placeholder instead of the value (the figure is still being fetched). */\n isLoading?: boolean\n /** Makes the tile a real link (ctrl/cmd-click works). */\n href?: string\n /** Click handler; with `href`, a plain click calls it instead of navigating. */\n onSelect?: () => void\n className?: string\n testId?: string\n}\n\n/** The one true KPI tile. Used across every dashboard and module header. */\nexport function MetricCard({\n label,\n value,\n icon: Icon,\n hint,\n delta,\n accent = 'default',\n isLoading = false,\n href,\n onSelect,\n className,\n testId,\n}: MetricCardProps) {\n const accentStyle =\n accent && accent !== 'default' ? { color: `var(--color-${accent})` } : undefined\n const deltaGood = delta?.good ?? delta?.direction === 'up'\n const isInteractive = Boolean(href || onSelect)\n const card = (\n <Card\n variant=\"elevated\"\n className={cn('card-hover min-w-0 rounded-xl p-5', className)}\n data-testid={isInteractive ? undefined : testId}\n aria-busy={isLoading || undefined}\n >\n <div className=\"flex items-start justify-between gap-3\">\n <p className=\"min-w-0 text-xs font-medium uppercase tracking-wide text-muted-foreground\">\n {label}\n </p>\n {Icon && <Icon className=\"size-4 shrink-0\" style={accentStyle} />}\n </div>\n {isLoading ? (\n <div\n className=\"mt-2 h-8 w-20 animate-pulse rounded bg-muted\"\n data-slot=\"metric-card-skeleton\"\n />\n ) : (\n <p\n className=\"mt-2 font-display text-2xl font-semibold tracking-tight [overflow-wrap:anywhere]\"\n data-testid={testId && `${testId}-value`}\n >\n {value}\n </p>\n )}\n <div className=\"mt-1 flex items-center gap-2\">\n {delta && !isLoading && (\n <span\n className={cn(\n 'inline-flex items-center gap-0.5 text-xs font-medium',\n deltaGood ? 'text-success' : 'text-destructive'\n )}\n >\n {delta.direction === 'up' ? (\n <ArrowUpRight className=\"size-3\" />\n ) : (\n <ArrowDownRight className=\"size-3\" />\n )}\n {delta.value}\n </span>\n )}\n {hint && <span className=\"text-xs text-muted-foreground\">{hint}</span>}\n </div>\n </Card>\n )\n if (!isInteractive) return card\n return (\n <ActionLink\n href={href}\n onSelect={onSelect}\n className=\"block rounded-xl text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n data-testid={testId}\n >\n {card}\n </ActionLink>\n )\n}\n"]}
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
- var chunkYZBDHBKI_cjs = require('./chunk-YZBDHBKI.cjs');
4
+ var chunkK67VMSOX_cjs = require('./chunk-K67VMSOX.cjs');
5
5
  var zustand = require('zustand');
6
6
  var middleware = require('zustand/middleware');
7
7
  var react = require('react');
@@ -106,10 +106,10 @@ var defaultEnvironment = {
106
106
  notify: (message, kind = "info", options) => {
107
107
  shell.notify[kind](message, options);
108
108
  },
109
- confirm: chunkYZBDHBKI_cjs.confirmDialog,
110
- choose: chunkYZBDHBKI_cjs.choiceDialog,
111
- openDialog: chunkYZBDHBKI_cjs.openDialog,
112
- closeDialog: chunkYZBDHBKI_cjs.closeDialog,
109
+ confirm: chunkK67VMSOX_cjs.confirmDialog,
110
+ choose: chunkK67VMSOX_cjs.choiceDialog,
111
+ openDialog: chunkK67VMSOX_cjs.openDialog,
112
+ closeDialog: chunkK67VMSOX_cjs.closeDialog,
113
113
  runtimeConfig: {
114
114
  apiBaseUrl: "",
115
115
  deploymentDomain: typeof window !== "undefined" ? window.location.host : ""
@@ -208,5 +208,5 @@ exports.useCalendarViewStore = useCalendarViewStore;
208
208
  exports.useIntentRequest = useIntentRequest;
209
209
  exports.useRequestedSettingsSection = useRequestedSettingsSection;
210
210
  exports.workflowOpenRequest = workflowOpenRequest;
211
- //# sourceMappingURL=chunk-VMXTOIXB.cjs.map
212
- //# sourceMappingURL=chunk-VMXTOIXB.cjs.map
211
+ //# sourceMappingURL=chunk-46LX6EQT.cjs.map
212
+ //# sourceMappingURL=chunk-46LX6EQT.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/connection/calendar/store.ts","../src/provider/settings-section.ts","../src/provider/requests.ts","../src/provider/environment.ts"],"names":["create","persist","createJSONStorage","useSyncExternalStore","listeners","useRef","useEffect","notifyStore","confirmDialog","choiceDialog","openDialog","closeDialog","useHostConfigR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EAAY;AACnC","file":"chunk-VMXTOIXB.cjs","sourcesContent":["/**\n * The connected calendar's view state: the chosen view is remembered across reloads (localStorage),\n * the anchor date lives for the session, and two requests carry intents from elsewhere into the\n * calendar once it mounts: an event to open (a deep link, a reminder) and a prefilled new event\n * (\"Schedule a call\" from a thread). The host navigates to its calendar page after making one.\n */\nimport { create } from 'zustand'\nimport { createJSONStorage, persist } from 'zustand/middleware'\nimport type { CalendarViewKind } from '../../calendar/types'\n\n/** \"Schedule a call\" from elsewhere (a thread, a DM, a dashboard): the editor opens prefilled. */\nexport interface CalendarComposerPrefill {\n title?: string\n attendees?: { email?: string | null; user_id?: string | null; name?: string | null }[]\n conversationId?: string | null\n /** Add an ARBI call when the event is saved (\"Add ARBI call\" ticked). */\n addCall?: boolean\n}\n\nexport interface PendingCalendarEvent {\n id: string\n recurrenceId?: string | null\n}\n\ninterface CalendarViewState {\n /** `null` until the user picks one: the settings' default view applies. */\n view: CalendarViewKind | null\n /** YYYY-MM-DD anchor; `null` = today. */\n date: string | null\n pendingEvent: PendingCalendarEvent | null\n pendingComposer: CalendarComposerPrefill | null\n setPendingComposer: (prefill: CalendarComposerPrefill | null) => void\n setView: (view: CalendarViewKind) => void\n setDate: (date: string | null) => void\n setPendingEvent: (pending: PendingCalendarEvent | null) => void\n}\n\nexport const useCalendarViewStore = create<CalendarViewState>()(\n persist(\n (set) => ({\n view: null,\n date: null,\n pendingEvent: null,\n pendingComposer: null,\n setPendingComposer: (pendingComposer) => set({ pendingComposer }),\n setView: (view) => set({ view }),\n setDate: (date) => set({ date }),\n setPendingEvent: (pendingEvent) => set({ pendingEvent }),\n }),\n {\n name: 'arbi-calendar-view',\n storage: createJSONStorage(() => localStorage),\n partialize: (s) => ({ view: s.view }),\n }\n )\n)\n\nconst EVT_RE = /^evt-[A-Za-z0-9]{8}$/\n\n/** Ask the calendar to open on an event (ignored unless it is an `evt-` id). */\nexport function requestCalendarEvent(event: PendingCalendarEvent): void {\n if (EVT_RE.test(event.id)) useCalendarViewStore.getState().setPendingEvent(event)\n}\n\n/** Ask the calendar to open the event editor prefilled. */\nexport function requestCalendarComposer(prefill: CalendarComposerPrefill): void {\n useCalendarViewStore.getState().setPendingComposer(prefill)\n}\n","/**\n * The settings section asked for last, so `openSettings(section)` opens that section in every host.\n *\n * `BlocksEnvironment.openSettings` records the section here before the host shows its settings\n * (a panel, a route); a `ConnectedSettingsPage` without its own `section` prop opens at it and\n * follows every later request, even one for the section asked for before. A host that keeps the\n * open section itself (`section` + `onSectionChange`) routes `openSettings` to its own state.\n */\nimport { useSyncExternalStore } from 'react'\n\nexport interface SettingsSectionRequest {\n section: string\n /** Increases with every request, so asking again for the same section is a new request. */\n seq: number\n}\n\nlet request: SettingsSectionRequest | undefined\nconst listeners = new Set<() => void>()\n\n/** Ask for a settings section; no section asks for none (the page stays where it is). */\nexport function requestSettingsSection(section?: string): void {\n if (!section) return\n request = { section, seq: (request?.seq ?? 0) + 1 }\n listeners.forEach((listener) => listener())\n}\n\nfunction subscribe(listener: () => void): () => void {\n listeners.add(listener)\n return () => listeners.delete(listener)\n}\n\nconst snapshot = () => request\n\n/** The last settings-section request (`undefined` until there is one). */\nexport function useRequestedSettingsSection(): SettingsSectionRequest | undefined {\n return useSyncExternalStore(subscribe, snapshot, snapshot)\n}\n","/**\n * What an intent asks of the surface it opens, carried across the navigation: the first message\n * of a new conversation (`openNewConversation({ prompt })`), the email draft or message to show\n * (`openMail({ draftId })`, `openMail({ messageId })`), the folder (`openMail({ folder })`), a new\n * message with files (`openMail({ attachments })`) and the workflow to show\n * (`openWorkflow(id, { view })`). The environment records the request before the host navigates;\n * the surface takes it when it mounts, or at once while it is already on screen. Taking clears it,\n * so a request is acted on once, by one surface.\n */\nimport { useEffect, useRef } from 'react'\nimport type { MailAttachment } from '@arbidocs/react'\n\nexport interface IntentRequest<T> {\n /** Record a request (replacing one not taken yet). */\n request(value: T): void\n /** The pending request, cleared: `undefined` when there is none. */\n take(): T | undefined\n /** Calls `listener` whenever a request is made. */\n subscribe(listener: () => void): () => void\n}\n\nfunction intentRequest<T>(): IntentRequest<T> {\n let pending: { value: T } | undefined\n const listeners = new Set<() => void>()\n return {\n request(value) {\n pending = { value }\n listeners.forEach((listener) => listener())\n },\n take() {\n const taken = pending\n pending = undefined\n return taken?.value\n },\n subscribe(listener) {\n listeners.add(listener)\n return () => listeners.delete(listener)\n },\n }\n}\n\n/**\n * Take each request while `enabled`: the one pending on mount and every later one. The latest\n * `onRequest` is called.\n */\nexport function useIntentRequest<T>(\n store: IntentRequest<T>,\n onRequest: (value: T) => void,\n enabled = true\n): void {\n const latest = useRef(onRequest)\n latest.current = onRequest\n useEffect(() => {\n if (!enabled) return\n const take = () => {\n const value = store.take()\n if (value !== undefined) latest.current(value)\n }\n take()\n return store.subscribe(take)\n }, [store, enabled])\n}\n\n/** The first message of the new conversation `openNewConversation({ prompt })` showed. */\nexport const conversationStartRequest = intentRequest<string>()\n\n/** The email draft `openMail({ draftId })` showed. */\nexport const mailDraftRequest = intentRequest<string>()\n\n/** The message `openMail({ messageId })` showed. */\nexport const mailMessageRequest = intentRequest<string>()\n\n/** The folder `openMail({ folder })` showed (a role such as `outbox`, or an id). */\nexport const mailFolderRequest = intentRequest<string>()\n\n/** The new message `openMail({ attachments })` starts, with these files attached. */\nexport const mailComposeRequest = intentRequest<MailAttachment[]>()\n\n/**\n * The workflow `openWorkflow(id, { view })` showed: its editor, its runs, or (`run`, a host\n * catalogue entry) its run page (no id: the list).\n */\nexport const workflowOpenRequest = intentRequest<{\n workflowId?: string\n view?: 'builder' | 'runs' | 'run'\n /** No workflow: a new one's builder starts from this preset. */\n preset?: 'schedule'\n /** `run` on a saved workflow: the workspace to start it in. */\n runIn?: string\n}>()\n","import { useSyncExternalStore, type ReactNode } from 'react'\nimport type { AnalyticsChartRequest, MailAttachment } from '@arbidocs/react'\nimport {\n notify as notifyStore,\n useHostConfigRecord,\n type NotifyOptions,\n type NotifyVariant,\n} from '@arbidocs/react/shell'\nimport type { BlockLinkComponent } from '../components/blockLink'\nimport { requestCalendarEvent, type PendingCalendarEvent } from '../connection/calendar/store'\nimport { choiceDialog, confirmDialog, type ChoiceRequest, type ConfirmRequest } from './dialogs'\nimport {\n closeDialog,\n openDialog,\n type BlocksDialogKind,\n type DialogPropsArg,\n type ShareRequest,\n type UploadSource,\n} from './dialog-registry'\nimport {\n conversationStartRequest,\n mailDraftRequest,\n mailMessageRequest,\n mailFolderRequest,\n mailComposeRequest,\n workflowOpenRequest,\n} from './requests'\nimport { requestSettingsSection } from './settings-section'\n\n/** What blocks need from the host's runtime configuration (the app's `config.json`). */\nexport interface BlocksRuntimeConfig {\n /** Origin of the ARBI API; `''` means the page's own origin. */\n apiBaseUrl: string\n /** The deployment's domain, e.g. `www.arbidocs.com` (deep links, key derivation, labels). */\n deploymentDomain: string\n /** Where seats are added for this deployment (a Box's licence page); none: its settings. */\n licenceUrl?: string\n /**\n * A public page where a Microsoft administrator approves SharePoint access, for the user to send\n * them (the accounts import offers the link). None: no link.\n */\n sharePointAdminUrl?: string\n}\n\nexport interface OpenDocumentOptions {\n /** 1-based page to scroll to. */\n page?: number\n /** Passage (chunk) to highlight. */\n passageId?: string\n /**\n * The workspace the document is in, when it is not the open one (a document an agent wrote in\n * its own workspace): the host opens that workspace first.\n */\n workspaceId?: string\n /** An earlier version (1-based); none: the current one. */\n version?: number\n /**\n * The viewer tab to show: `pdf` is where a signature request is reviewed and signed, and where\n * a copy the document tools made (frozen, signed) opens.\n */\n tab?: 'pdf'\n}\n\nexport type { ShareRequest, UploadSource }\n\nexport interface OpenWordEditorOptions {\n /** The comment to show (a mention in it, a reply to it). */\n commentId?: string\n /** The workspace the document is in, when it is not the open one. */\n workspaceId?: string\n}\n\nexport interface OpenConversationOptions {\n /** The message to scroll to. */\n messageId?: string\n /** The open document stays on screen beside the thread (a thread about it). */\n keepDocumentOpen?: boolean\n /** The workspace the thread is in, when it is not the open one. */\n workspaceId?: string\n}\n\nexport interface OpenNewConversationOptions {\n /** Its first message, sent once the new conversation is ready (an ask bar, \"Ask about this\"). */\n prompt?: string\n /** The open document stays on screen beside it (a chat started from it). */\n keepDocumentOpen?: boolean\n}\n\nexport interface OpenWorkflowOptions {\n /**\n * The workflow's editor (default), its runs, or (`run`, a host catalogue entry) where it starts.\n * The Workflows page (`ConnectedWorkflowsPage`) opens the editor, the runs or the run page\n * (`ConnectedWorkflowRunPage`) itself; the host only shows the page.\n */\n view?: 'builder' | 'runs' | 'run'\n /**\n * With no workflow: a new workflow's builder starts from this preset instead of a blank one\n * (`schedule`: a repeating schedule with one task prompt to fill in).\n */\n preset?: 'schedule'\n /** The workspace the workflow is in, when it is not the open one. */\n workspaceId?: string\n /**\n * `run` on a saved workflow: the workspace to start it in (opened for the run, its pickers that\n * workspace's), e.g. a matter's for a process of the skills workspace. Absent: the open one.\n */\n runIn?: string\n}\n\nexport interface OpenMailOptions {\n /** The email draft to show (a draft a workflow step or an agent left), to check and send. */\n draftId?: string\n /** The folder to show (`inbox`, `sent`, `trash`, `outbox`…). Default: the host's own. */\n folder?: string\n /** A message to show in the native inbox (a secure message just claimed from its link). */\n messageId?: string\n /** Start a new message with these files attached (\"Email\" on a document). */\n attachments?: MailAttachment[]\n}\n\nexport interface OpenCalendarOptions {\n /** The event to open on. */\n event?: PendingCalendarEvent\n}\n\n/** What `openFiles` shows: some files selected, and the list narrowed. */\nexport interface OpenFilesOptions {\n /** Files to select. */\n select?: string[]\n /** Quick filters by key (a label id, `folder:<path>`, `folder:none`): show or hide those files. */\n filters?: Record<string, 'include' | 'exclude'>\n}\n\n/**\n * Something a kit links to (the target of an `open…` intent), for `hrefFor`. `workspaceId` is the\n * workspace it is in, when the kit knows it.\n */\nexport type LinkTarget =\n | { kind: 'document'; documentId: string; workspaceId?: string | null }\n | {\n kind: 'conversation'\n conversationId: string\n workspaceId?: string | null\n messageId?: string\n }\n | { kind: 'workspace'; workspaceId: string }\n /** A project; none: the projects list. */\n | { kind: 'project'; projectId?: string }\n /** A workflow (its editor); none: the workflows list. */\n | { kind: 'workflow'; workflowId?: string; workspaceId?: string | null }\n /** The mailbox, on an email draft when given. */\n | { kind: 'mail'; draftId?: string }\n /** The user's settings, at a section when given. */\n | { kind: 'settings'; section?: string }\n /** The calendar, on an event when given. */\n | { kind: 'calendar'; eventId?: string }\n\n/**\n * The only way blocks reach the host app's environment: the host configuration's `environment`\n * (`<ArbiHost config={{ environment: { navigate, notify, … } }}>`). Blocks never import a router, a\n * toast library or an app store; the host gives what it has, and every field has a safe default so\n * a block renders correctly with no host at all. A nested host overrides only the fields it gives\n * and inherits the rest.\n */\nexport interface BlocksEnvironment {\n /** Router-aware link (keeps navigation in-SPA). Default: a plain `<a href>`. */\n linkComponent?: BlockLinkComponent\n /** Imperative navigation for buttons and keyboard shortcuts. Default: `window.location.assign`. */\n navigate: (href: string) => void\n /**\n * A hook: the address on screen (path, then any search), re-rendering when it changes. A routed\n * shell reads its current row from it. A host with a router adapts that router's location\n * (react-router: `() => { const l = useLocation(); return l.pathname + l.search }`); keep the\n * same hook for the host's life. Default: the window's address, following Back/Forward.\n */\n useLocation: () => string\n /** Surface a transient message (and record it in the notification centre). Default: the shared\n * `@arbidocs/react` notify store, rendered by its `<Toaster/>`. */\n notify: (message: ReactNode, kind?: NotifyVariant, options?: NotifyOptions) => void\n /** Ask the user to confirm. Default: the blocks prompt dialog. */\n confirm: (request: ConfirmRequest) => Promise<boolean>\n /** Ask the user to pick one of several choices; `null` when dismissed. Default: the blocks\n * prompt dialog. */\n choose: <T extends string>(request: ChoiceRequest<T>) => Promise<T | null>\n /**\n * Open a global dialog by kind (`BlocksDialogProps`), shown by the one `<ConnectedGlobalDialogs>`\n * in the shell. Default: the blocks dialog registry.\n */\n openDialog: <K extends BlocksDialogKind>(kind: K, ...props: DialogPropsArg<K>) => void\n /** Close a global dialog. Default: the blocks dialog registry. */\n closeDialog: (kind: BlocksDialogKind) => void\n /** Deployment configuration. Default: same-origin API on the page's own host. */\n runtimeConfig: BlocksRuntimeConfig\n /**\n * The address of a target in the host's router, for a real link (open in a new tab, middle-click,\n * copy link) beside the matching `open…` intent: a kit never builds an app path itself, so its\n * links and its navigation agree on every site. `undefined`: no link (the row still opens on a\n * click). Default: none. ARBI's addresses (`/wrk-…/doc-…`): the route codec's `hrefFor`.\n */\n hrefFor: (target: LinkTarget) => string | undefined\n /** Open a document (optionally at a page / passage) wherever the host shows documents.\n * Default: no-op. */\n openDocument: (documentId: string, options?: OpenDocumentOptions) => void\n /**\n * Open a Word document (`opensInWord`) in the host's Word editor, optionally on a comment.\n * Default: `openDocument` (a host whose viewer edits Word documents in place needs no other).\n */\n openWordEditor: (documentId: string, options?: OpenWordEditorOptions) => void\n /** Open a conversation thread, optionally scrolled to a message. Default: no-op. */\n openConversation: (conversationId: string, options?: OpenConversationOptions) => void\n /**\n * Show a new, empty conversation, unbound to any document. With a `prompt` it is sent as the\n * first message once the conversation is ready (recorded for the chat that shows it:\n * `ConnectedConversationThread`, `ChatPage`). Without one a launch composes into the session's draft\n * after this. Default: no-op.\n */\n openNewConversation: (options?: OpenNewConversationOptions) => void\n /**\n * Open the user's settings, optionally at a section (a `ConnectedSettingsPage` section id).\n * The section is always recorded for `ConnectedSettingsPage` first (`requestSettingsSection`);\n * the host's handler then shows its settings. Default: only that record.\n */\n openSettings: (section?: string) => void\n /** Open a project; no id: the projects list. Default: no-op. */\n openProject: (projectId?: string) => void\n /**\n * Show the calendar page (`ConnectedCalendar`), optionally on an event (recorded for the\n * calendar first: `requestCalendarEvent`). Default: only that record.\n */\n openCalendar: (options?: OpenCalendarOptions) => void\n /**\n * Show the mailbox (`ConnectedMailbox`), optionally on an email draft (recorded for the mailbox\n * first). Absent: the host has no mail, and a kit offers no way to open it.\n */\n openMail?: (options?: OpenMailOptions) => void\n /** Show the host's calls page (call history, scheduled calls). Absent: not offered. */\n openCalls?: () => void\n /** Open the direct chat with a person (the host's messenger). Absent: not offered. */\n openDirectChat?: (userId: string) => void\n /** Open one of my chats (a group or meeting chat) in the host's messenger. Absent: not offered. */\n openChat?: (chatId: string) => void\n /** Show the host's notification centre (`ConnectedNotificationCenter`), optionally on one\n * entry (`focusId`). Absent: not offered. */\n openNotifications?: (options?: { focusId?: string }) => void\n /** Show the host's contacts (a panel it toggles, a page). Absent: not offered. */\n openContacts?: () => void\n /** Show the host's databases page (user-defined tables). Absent: not offered. */\n openDatabases?: () => void\n /** Show the host's Analytics page (saved dashboards); `database`: with a new dashboard charting that\n * database (a database's \"Chart this\"). Absent: not offered. */\n openAnalytics?: (options?: { database?: AnalyticsChartRequest }) => void\n /** Show the host's tags page (people, organisations and the other tags). Absent: not offered. */\n openTags?: () => void\n /** Show the host's facts page; `compose`: with its composer open for a new fact; `focusId`: at\n * that fact. Absent: not offered. */\n openFacts?: (options?: { compose?: boolean; focusId?: string }) => void\n /** Show the open workspace's threads (the host's threads page). Absent: not offered. */\n openThreads?: () => void\n /** Show the host's Smart Search page (`ConnectedSearchPage`). Absent: not offered. */\n openSmartSearch?: () => void\n /**\n * Open a workflow in the host's Workflows page (its editor, or its runs); no id: the list.\n * Offered only while the `workflows` feature is on (`useOpenWorkflow` in `/connect`). Absent: never.\n */\n openWorkflow?: (workflowId?: string, options?: OpenWorkflowOptions) => void\n /**\n * Show the open workspace's document processing (the host's processing panel: what is indexing,\n * what failed). Absent: not offered.\n */\n openProcessing?: () => void\n /** Show the open workspace's files, optionally with some selected and the list narrowed. Default: no-op. */\n openFiles: (options?: OpenFilesOptions) => void\n /**\n * Add files the host's way (its upload dialog), optionally with some already picked, or from one\n * source. Absent: a kit that adds files uploads them itself.\n */\n openUpload?: (files?: File[], options?: { source?: UploadSource }) => void\n /** Open the host's skills browser, optionally at one skill. Absent: not offered. */\n openSkillsBrowser?: (skillSlug?: string) => void\n /** Share a document or a thread by email (the host's share dialog). Absent: not offered. */\n openShare?: (request: ShareRequest) => void\n /**\n * Show a workspace (its own page). Under `defaultHost`'s sign-in layer the kits select it first\n * (`useConnectedWorkspace().openWorkspace`); a host that keeps its own session switches to it\n * here. `name` is for the host's messages. Default: no-op.\n */\n openWorkspace: (workspaceId: string, options?: { name?: string }) => void\n}\n\nconst noop = () => {}\n\nconst subscribeToHistory = (listener: () => void) => {\n window.addEventListener('popstate', listener)\n return () => window.removeEventListener('popstate', listener)\n}\nconst windowAddress = () => window.location.pathname + window.location.search\n\n/** The window's address, following Back/Forward (the environment's default `useLocation`). */\nfunction useWindowLocation(): string {\n return useSyncExternalStore(subscribeToHistory, windowAddress, () => '/')\n}\n\nconst defaultEnvironment: BlocksEnvironment = {\n navigate: (href) => {\n if (typeof window !== 'undefined') window.location.assign(href)\n },\n useLocation: useWindowLocation,\n notify: (message, kind = 'info', options) => {\n notifyStore[kind](message, options)\n },\n confirm: confirmDialog,\n choose: choiceDialog,\n openDialog,\n closeDialog,\n runtimeConfig: {\n apiBaseUrl: '',\n deploymentDomain: typeof window !== 'undefined' ? window.location.host : '',\n },\n hrefFor: () => undefined,\n openDocument: noop,\n openWordEditor: noop,\n openConversation: noop,\n openNewConversation: noop,\n openSettings: requestSettingsSection,\n openProject: noop,\n openCalendar: (options) => {\n if (options?.event) requestCalendarEvent(options.event)\n },\n openFiles: noop,\n openWorkspace: noop,\n}\n\nconst resolved = new WeakMap<object, BlocksEnvironment>()\nconst complete = new WeakSet<BlocksEnvironment>()\n// The intents below that record what they open on: a resolved environment passed on again (a\n// nested host's, `createBlocksEnvironment`'s) records once, not twice.\nconst recording = new WeakSet<object>()\n\nfunction records<F extends object>(intent: F): F {\n recording.add(intent)\n return intent\n}\n\nfunction recordingIntent<F extends object>(\n host: F | undefined,\n wrap: (host: F) => F\n): F | undefined {\n if (!host) return undefined\n return recording.has(host) ? host : records(wrap(host))\n}\n\nfunction resolve(environment: Partial<BlocksEnvironment>): BlocksEnvironment {\n const { openDocument } = environment\n const value: BlocksEnvironment = {\n ...defaultEnvironment,\n openWordEditor: openDocument\n ? (documentId, options) => openDocument(documentId, { workspaceId: options?.workspaceId })\n : noop,\n ...environment,\n // What an intent opens on is recorded for the surface before the host shows it.\n openSettings:\n recordingIntent(environment.openSettings, (openSettings) => (section) => {\n requestSettingsSection(section)\n openSettings(section)\n }) ?? defaultEnvironment.openSettings,\n openCalendar:\n recordingIntent(environment.openCalendar, (openCalendar) => (options) => {\n defaultEnvironment.openCalendar(options)\n openCalendar(options)\n }) ?? defaultEnvironment.openCalendar,\n openMail: recordingIntent(environment.openMail, (openMail) => (options) => {\n if (options?.draftId) mailDraftRequest.request(options.draftId)\n if (options?.messageId) mailMessageRequest.request(options.messageId)\n if (options?.folder) mailFolderRequest.request(options.folder)\n if (options?.attachments?.length) mailComposeRequest.request(options.attachments)\n openMail(options)\n }),\n openWorkflow: recordingIntent(environment.openWorkflow, (openWorkflow) => (id, options) => {\n workflowOpenRequest.request({\n workflowId: id,\n view: options?.view,\n preset: options?.preset,\n runIn: options?.runIn,\n })\n openWorkflow(id, options)\n }),\n openNewConversation:\n recordingIntent(environment.openNewConversation, (openNewConversation) => (options) => {\n openNewConversation(options)\n // After the host's reset of the new conversation, which clears its draft.\n const prompt = options?.prompt?.trim()\n if (prompt) conversationStartRequest.request(prompt)\n }) ?? noop,\n }\n complete.add(value)\n return value\n}\n\n/**\n * The environment with every field filled in (the defaults where `environment` gives none), and\n * every intent recording what it opens on. A host calls it for code outside React (a store action,\n * a notification handler); passing the result as the host configuration's `environment` uses it\n * as is.\n */\nexport function createBlocksEnvironment(\n environment: Partial<BlocksEnvironment>\n): BlocksEnvironment {\n if (complete.has(environment as BlocksEnvironment)) return environment as BlocksEnvironment\n let value = resolved.get(environment)\n if (!value) resolved.set(environment, (value = resolve(environment)))\n return value\n}\n\n/** The host's environment, every field filled in (the defaults where the host gives none). */\nexport function useBlocksEnvironment(): BlocksEnvironment {\n const environment = useHostConfigRecord().environment as Partial<BlocksEnvironment> | undefined\n return environment ? createBlocksEnvironment(environment) : defaultEnvironment\n}\n\n/** Open and close the global dialogs (`<ConnectedGlobalDialogs>`), the host's way. */\nexport function useBlocksDialogs(): Pick<BlocksEnvironment, 'openDialog' | 'closeDialog'> {\n const { openDialog, closeDialog } = useBlocksEnvironment()\n return { openDialog, closeDialog }\n}\n"]}
1
+ {"version":3,"sources":["../src/connection/calendar/store.ts","../src/provider/settings-section.ts","../src/provider/requests.ts","../src/provider/environment.ts"],"names":["create","persist","createJSONStorage","useSyncExternalStore","listeners","useRef","useEffect","notifyStore","confirmDialog","choiceDialog","openDialog","closeDialog","useHostConfigRecord"],"mappings":";;;;;;;;AAqCO,IAAM,uBAAuBA,cAAA,EAA0B;AAAA,EAC5DC,kBAAA;AAAA,IACE,CAAC,GAAA,MAAS;AAAA,MACR,IAAA,EAAM,IAAA;AAAA,MACN,IAAA,EAAM,IAAA;AAAA,MACN,YAAA,EAAc,IAAA;AAAA,MACd,eAAA,EAAiB,IAAA;AAAA,MACjB,oBAAoB,CAAC,eAAA,KAAoB,GAAA,CAAI,EAAE,iBAAiB,CAAA;AAAA,MAChE,SAAS,CAAC,IAAA,KAAS,GAAA,CAAI,EAAE,MAAM,CAAA;AAAA,MAC/B,SAAS,CAAC,IAAA,KAAS,GAAA,CAAI,EAAE,MAAM,CAAA;AAAA,MAC/B,iBAAiB,CAAC,YAAA,KAAiB,GAAA,CAAI,EAAE,cAAc;AAAA,KACzD,CAAA;AAAA,IACA;AAAA,MACE,IAAA,EAAM,oBAAA;AAAA,MACN,OAAA,EAASC,4BAAA,CAAkB,MAAM,YAAY,CAAA;AAAA,MAC7C,YAAY,CAAC,CAAA,MAAO,EAAE,IAAA,EAAM,EAAE,IAAA,EAAK;AAAA;AACrC;AAEJ;AAEA,IAAM,MAAA,GAAS,sBAAA;AAGR,SAAS,qBAAqB,KAAA,EAAmC;AACtE,EAAA,IAAI,MAAA,CAAO,KAAK,KAAA,CAAM,EAAE,GAAG,oBAAA,CAAqB,QAAA,EAAS,CAAE,eAAA,CAAgB,KAAK,CAAA;AAClF;AAGO,SAAS,wBAAwB,OAAA,EAAwC;AAC9E,EAAA,oBAAA,CAAqB,QAAA,EAAS,CAAE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C,EAAA,OAAO,WAAA,GAAc,uBAAA,CAAwB,WAAW,CAAA,GAAI,kBAAA;AAC9D;AAGO,SAAS,gBAAA,GAA0E;AACxF,EAAA,MAAM,EAAE,UAAA,EAAAF,WAAAA,EAAY,WAAA,EAAAC,YAAAA,KAAgB,oBAAA,EAAqB;AACzD,EAAA,OAAO,EAAE,UAAA,EAAAD,WAAAA,EAAY,WAAA,EAAAC,YAAAA,EAAY;AACnC","file":"chunk-46LX6EQT.cjs","sourcesContent":["/**\n * The connected calendar's view state: the chosen view is remembered across reloads (localStorage),\n * the anchor date lives for the session, and two requests carry intents from elsewhere into the\n * calendar once it mounts: an event to open (a deep link, a reminder) and a prefilled new event\n * (\"Schedule a call\" from a thread). The host navigates to its calendar page after making one.\n */\nimport { create } from 'zustand'\nimport { createJSONStorage, persist } from 'zustand/middleware'\nimport type { CalendarViewKind } from '../../calendar/types'\n\n/** \"Schedule a call\" from elsewhere (a thread, a DM, a dashboard): the editor opens prefilled. */\nexport interface CalendarComposerPrefill {\n title?: string\n attendees?: { email?: string | null; user_id?: string | null; name?: string | null }[]\n conversationId?: string | null\n /** Add an ARBI call when the event is saved (\"Add ARBI call\" ticked). */\n addCall?: boolean\n}\n\nexport interface PendingCalendarEvent {\n id: string\n recurrenceId?: string | null\n}\n\ninterface CalendarViewState {\n /** `null` until the user picks one: the settings' default view applies. */\n view: CalendarViewKind | null\n /** YYYY-MM-DD anchor; `null` = today. */\n date: string | null\n pendingEvent: PendingCalendarEvent | null\n pendingComposer: CalendarComposerPrefill | null\n setPendingComposer: (prefill: CalendarComposerPrefill | null) => void\n setView: (view: CalendarViewKind) => void\n setDate: (date: string | null) => void\n setPendingEvent: (pending: PendingCalendarEvent | null) => void\n}\n\nexport const useCalendarViewStore = create<CalendarViewState>()(\n persist(\n (set) => ({\n view: null,\n date: null,\n pendingEvent: null,\n pendingComposer: null,\n setPendingComposer: (pendingComposer) => set({ pendingComposer }),\n setView: (view) => set({ view }),\n setDate: (date) => set({ date }),\n setPendingEvent: (pendingEvent) => set({ pendingEvent }),\n }),\n {\n name: 'arbi-calendar-view',\n storage: createJSONStorage(() => localStorage),\n partialize: (s) => ({ view: s.view }),\n }\n )\n)\n\nconst EVT_RE = /^evt-[A-Za-z0-9]{8}$/\n\n/** Ask the calendar to open on an event (ignored unless it is an `evt-` id). */\nexport function requestCalendarEvent(event: PendingCalendarEvent): void {\n if (EVT_RE.test(event.id)) useCalendarViewStore.getState().setPendingEvent(event)\n}\n\n/** Ask the calendar to open the event editor prefilled. */\nexport function requestCalendarComposer(prefill: CalendarComposerPrefill): void {\n useCalendarViewStore.getState().setPendingComposer(prefill)\n}\n","/**\n * The settings section asked for last, so `openSettings(section)` opens that section in every host.\n *\n * `BlocksEnvironment.openSettings` records the section here before the host shows its settings\n * (a panel, a route); a `ConnectedSettingsPage` without its own `section` prop opens at it and\n * follows every later request, even one for the section asked for before. A host that keeps the\n * open section itself (`section` + `onSectionChange`) routes `openSettings` to its own state.\n */\nimport { useSyncExternalStore } from 'react'\n\nexport interface SettingsSectionRequest {\n section: string\n /** Increases with every request, so asking again for the same section is a new request. */\n seq: number\n}\n\nlet request: SettingsSectionRequest | undefined\nconst listeners = new Set<() => void>()\n\n/** Ask for a settings section; no section asks for none (the page stays where it is). */\nexport function requestSettingsSection(section?: string): void {\n if (!section) return\n request = { section, seq: (request?.seq ?? 0) + 1 }\n listeners.forEach((listener) => listener())\n}\n\nfunction subscribe(listener: () => void): () => void {\n listeners.add(listener)\n return () => listeners.delete(listener)\n}\n\nconst snapshot = () => request\n\n/** The last settings-section request (`undefined` until there is one). */\nexport function useRequestedSettingsSection(): SettingsSectionRequest | undefined {\n return useSyncExternalStore(subscribe, snapshot, snapshot)\n}\n","/**\n * What an intent asks of the surface it opens, carried across the navigation: the first message\n * of a new conversation (`openNewConversation({ prompt })`), the email draft or message to show\n * (`openMail({ draftId })`, `openMail({ messageId })`), the folder (`openMail({ folder })`), a new\n * message with files (`openMail({ attachments })`) and the workflow to show\n * (`openWorkflow(id, { view })`). The environment records the request before the host navigates;\n * the surface takes it when it mounts, or at once while it is already on screen. Taking clears it,\n * so a request is acted on once, by one surface.\n */\nimport { useEffect, useRef } from 'react'\nimport type { MailAttachment } from '@arbidocs/react'\n\nexport interface IntentRequest<T> {\n /** Record a request (replacing one not taken yet). */\n request(value: T): void\n /** The pending request, cleared: `undefined` when there is none. */\n take(): T | undefined\n /** Calls `listener` whenever a request is made. */\n subscribe(listener: () => void): () => void\n}\n\nfunction intentRequest<T>(): IntentRequest<T> {\n let pending: { value: T } | undefined\n const listeners = new Set<() => void>()\n return {\n request(value) {\n pending = { value }\n listeners.forEach((listener) => listener())\n },\n take() {\n const taken = pending\n pending = undefined\n return taken?.value\n },\n subscribe(listener) {\n listeners.add(listener)\n return () => listeners.delete(listener)\n },\n }\n}\n\n/**\n * Take each request while `enabled`: the one pending on mount and every later one. The latest\n * `onRequest` is called.\n */\nexport function useIntentRequest<T>(\n store: IntentRequest<T>,\n onRequest: (value: T) => void,\n enabled = true\n): void {\n const latest = useRef(onRequest)\n latest.current = onRequest\n useEffect(() => {\n if (!enabled) return\n const take = () => {\n const value = store.take()\n if (value !== undefined) latest.current(value)\n }\n take()\n return store.subscribe(take)\n }, [store, enabled])\n}\n\n/** The first message of the new conversation `openNewConversation({ prompt })` showed. */\nexport const conversationStartRequest = intentRequest<string>()\n\n/** The email draft `openMail({ draftId })` showed. */\nexport const mailDraftRequest = intentRequest<string>()\n\n/** The message `openMail({ messageId })` showed. */\nexport const mailMessageRequest = intentRequest<string>()\n\n/** The folder `openMail({ folder })` showed (a role such as `outbox`, or an id). */\nexport const mailFolderRequest = intentRequest<string>()\n\n/** The new message `openMail({ attachments })` starts, with these files attached. */\nexport const mailComposeRequest = intentRequest<MailAttachment[]>()\n\n/**\n * The workflow `openWorkflow(id, { view })` showed: its editor, its runs, or (`run`, a host\n * catalogue entry) its run page (no id: the list).\n */\nexport const workflowOpenRequest = intentRequest<{\n workflowId?: string\n view?: 'builder' | 'runs' | 'run'\n /** No workflow: a new one's builder starts from this preset. */\n preset?: 'schedule'\n /** `run` on a saved workflow: the workspace to start it in. */\n runIn?: string\n}>()\n","import { useSyncExternalStore, type ReactNode } from 'react'\nimport type { AnalyticsChartRequest, MailAttachment } from '@arbidocs/react'\nimport {\n notify as notifyStore,\n useHostConfigRecord,\n type NotifyOptions,\n type NotifyVariant,\n} from '@arbidocs/react/shell'\nimport type { BlockLinkComponent } from '../components/blockLink'\nimport { requestCalendarEvent, type PendingCalendarEvent } from '../connection/calendar/store'\nimport { choiceDialog, confirmDialog, type ChoiceRequest, type ConfirmRequest } from './dialogs'\nimport {\n closeDialog,\n openDialog,\n type BlocksDialogKind,\n type DialogPropsArg,\n type ShareRequest,\n type UploadSource,\n} from './dialog-registry'\nimport {\n conversationStartRequest,\n mailDraftRequest,\n mailMessageRequest,\n mailFolderRequest,\n mailComposeRequest,\n workflowOpenRequest,\n} from './requests'\nimport { requestSettingsSection } from './settings-section'\n\n/** What blocks need from the host's runtime configuration (the app's `config.json`). */\nexport interface BlocksRuntimeConfig {\n /** Origin of the ARBI API; `''` means the page's own origin. */\n apiBaseUrl: string\n /** The deployment's domain, e.g. `www.arbidocs.com` (deep links, key derivation, labels). */\n deploymentDomain: string\n /** Where seats are added for this deployment (a Box's licence page); none: its settings. */\n licenceUrl?: string\n /**\n * A public page where a Microsoft administrator approves SharePoint access, for the user to send\n * them (the accounts import offers the link). None: no link.\n */\n sharePointAdminUrl?: string\n}\n\nexport interface OpenDocumentOptions {\n /** 1-based page to scroll to. */\n page?: number\n /** Passage (chunk) to highlight. */\n passageId?: string\n /**\n * The workspace the document is in, when it is not the open one (a document an agent wrote in\n * its own workspace): the host opens that workspace first.\n */\n workspaceId?: string\n /** An earlier version (1-based); none: the current one. */\n version?: number\n /**\n * The viewer tab to show: `pdf` is where a signature request is reviewed and signed, and where\n * a copy the document tools made (frozen, signed) opens.\n */\n tab?: 'pdf'\n}\n\nexport type { ShareRequest, UploadSource }\n\nexport interface OpenWordEditorOptions {\n /** The comment to show (a mention in it, a reply to it). */\n commentId?: string\n /** The workspace the document is in, when it is not the open one. */\n workspaceId?: string\n}\n\nexport interface OpenConversationOptions {\n /** The message to scroll to. */\n messageId?: string\n /** The open document stays on screen beside the thread (a thread about it). */\n keepDocumentOpen?: boolean\n /** The workspace the thread is in, when it is not the open one. */\n workspaceId?: string\n}\n\nexport interface OpenNewConversationOptions {\n /** Its first message, sent once the new conversation is ready (an ask bar, \"Ask about this\"). */\n prompt?: string\n /** The open document stays on screen beside it (a chat started from it). */\n keepDocumentOpen?: boolean\n}\n\nexport interface OpenWorkflowOptions {\n /**\n * The workflow's editor (default), its runs, or (`run`, a host catalogue entry) where it starts.\n * The Workflows page (`ConnectedWorkflowsPage`) opens the editor, the runs or the run page\n * (`ConnectedWorkflowRunPage`) itself; the host only shows the page.\n */\n view?: 'builder' | 'runs' | 'run'\n /**\n * With no workflow: a new workflow's builder starts from this preset instead of a blank one\n * (`schedule`: a repeating schedule with one task prompt to fill in).\n */\n preset?: 'schedule'\n /** The workspace the workflow is in, when it is not the open one. */\n workspaceId?: string\n /**\n * `run` on a saved workflow: the workspace to start it in (opened for the run, its pickers that\n * workspace's), e.g. a matter's for a process of the skills workspace. Absent: the open one.\n */\n runIn?: string\n}\n\nexport interface OpenMailOptions {\n /** The email draft to show (a draft a workflow step or an agent left), to check and send. */\n draftId?: string\n /** The folder to show (`inbox`, `sent`, `trash`, `outbox`…). Default: the host's own. */\n folder?: string\n /** A message to show in the native inbox (a secure message just claimed from its link). */\n messageId?: string\n /** Start a new message with these files attached (\"Email\" on a document). */\n attachments?: MailAttachment[]\n}\n\nexport interface OpenCalendarOptions {\n /** The event to open on. */\n event?: PendingCalendarEvent\n}\n\n/** What `openFiles` shows: some files selected, and the list narrowed. */\nexport interface OpenFilesOptions {\n /** Files to select. */\n select?: string[]\n /** Quick filters by key (a label id, `folder:<path>`, `folder:none`): show or hide those files. */\n filters?: Record<string, 'include' | 'exclude'>\n}\n\n/**\n * Something a kit links to (the target of an `open…` intent), for `hrefFor`. `workspaceId` is the\n * workspace it is in, when the kit knows it.\n */\nexport type LinkTarget =\n | { kind: 'document'; documentId: string; workspaceId?: string | null }\n | {\n kind: 'conversation'\n conversationId: string\n workspaceId?: string | null\n messageId?: string\n }\n | { kind: 'workspace'; workspaceId: string }\n /** A project; none: the projects list. */\n | { kind: 'project'; projectId?: string }\n /** A workflow (its editor); none: the workflows list. */\n | { kind: 'workflow'; workflowId?: string; workspaceId?: string | null }\n /** The mailbox, on an email draft when given. */\n | { kind: 'mail'; draftId?: string }\n /** The user's settings, at a section when given. */\n | { kind: 'settings'; section?: string }\n /** The calendar, on an event when given. */\n | { kind: 'calendar'; eventId?: string }\n\n/**\n * The only way blocks reach the host app's environment: the host configuration's `environment`\n * (`<ArbiHost config={{ environment: { navigate, notify, … } }}>`). Blocks never import a router, a\n * toast library or an app store; the host gives what it has, and every field has a safe default so\n * a block renders correctly with no host at all. A nested host overrides only the fields it gives\n * and inherits the rest.\n */\nexport interface BlocksEnvironment {\n /** Router-aware link (keeps navigation in-SPA). Default: a plain `<a href>`. */\n linkComponent?: BlockLinkComponent\n /** Imperative navigation for buttons and keyboard shortcuts. Default: `window.location.assign`. */\n navigate: (href: string) => void\n /**\n * A hook: the address on screen (path, then any search), re-rendering when it changes. A routed\n * shell reads its current row from it. A host with a router adapts that router's location\n * (react-router: `() => { const l = useLocation(); return l.pathname + l.search }`); keep the\n * same hook for the host's life. Default: the window's address, following Back/Forward.\n */\n useLocation: () => string\n /** Surface a transient message (and record it in the notification centre). Default: the shared\n * `@arbidocs/react` notify store, rendered by its `<Toaster/>`. */\n notify: (message: ReactNode, kind?: NotifyVariant, options?: NotifyOptions) => void\n /** Ask the user to confirm. Default: the blocks prompt dialog. */\n confirm: (request: ConfirmRequest) => Promise<boolean>\n /** Ask the user to pick one of several choices; `null` when dismissed. Default: the blocks\n * prompt dialog. */\n choose: <T extends string>(request: ChoiceRequest<T>) => Promise<T | null>\n /**\n * Open a global dialog by kind (`BlocksDialogProps`), shown by the one `<ConnectedGlobalDialogs>`\n * in the shell. Default: the blocks dialog registry.\n */\n openDialog: <K extends BlocksDialogKind>(kind: K, ...props: DialogPropsArg<K>) => void\n /** Close a global dialog. Default: the blocks dialog registry. */\n closeDialog: (kind: BlocksDialogKind) => void\n /** Deployment configuration. Default: same-origin API on the page's own host. */\n runtimeConfig: BlocksRuntimeConfig\n /**\n * The address of a target in the host's router, for a real link (open in a new tab, middle-click,\n * copy link) beside the matching `open…` intent: a kit never builds an app path itself, so its\n * links and its navigation agree on every site. `undefined`: no link (the row still opens on a\n * click). Default: none. ARBI's addresses (`/wrk-…/doc-…`): the route codec's `hrefFor`.\n */\n hrefFor: (target: LinkTarget) => string | undefined\n /** Open a document (optionally at a page / passage) wherever the host shows documents.\n * Default: no-op. */\n openDocument: (documentId: string, options?: OpenDocumentOptions) => void\n /**\n * Open a Word document (`opensInWord`) in the host's Word editor, optionally on a comment.\n * Default: `openDocument` (a host whose viewer edits Word documents in place needs no other).\n */\n openWordEditor: (documentId: string, options?: OpenWordEditorOptions) => void\n /** Open a conversation thread, optionally scrolled to a message. Default: no-op. */\n openConversation: (conversationId: string, options?: OpenConversationOptions) => void\n /**\n * Show a new, empty conversation, unbound to any document. With a `prompt` it is sent as the\n * first message once the conversation is ready (recorded for the chat that shows it:\n * `ConnectedConversationThread`, `ChatPage`). Without one a launch composes into the session's draft\n * after this. Default: no-op.\n */\n openNewConversation: (options?: OpenNewConversationOptions) => void\n /**\n * Open the user's settings, optionally at a section (a `ConnectedSettingsPage` section id).\n * The section is always recorded for `ConnectedSettingsPage` first (`requestSettingsSection`);\n * the host's handler then shows its settings. Default: only that record.\n */\n openSettings: (section?: string) => void\n /** Open a project; no id: the projects list. Default: no-op. */\n openProject: (projectId?: string) => void\n /**\n * Show the calendar page (`ConnectedCalendar`), optionally on an event (recorded for the\n * calendar first: `requestCalendarEvent`). Default: only that record.\n */\n openCalendar: (options?: OpenCalendarOptions) => void\n /**\n * Show the mailbox (`ConnectedMailbox`), optionally on an email draft (recorded for the mailbox\n * first). Absent: the host has no mail, and a kit offers no way to open it.\n */\n openMail?: (options?: OpenMailOptions) => void\n /** Show the host's calls page (call history, scheduled calls). Absent: not offered. */\n openCalls?: () => void\n /** Open the direct chat with a person (the host's messenger). Absent: not offered. */\n openDirectChat?: (userId: string) => void\n /** Open one of my chats (a group or meeting chat) in the host's messenger. Absent: not offered. */\n openChat?: (chatId: string) => void\n /** Show the host's notification centre (`ConnectedNotificationCenter`), optionally on one\n * entry (`focusId`). Absent: not offered. */\n openNotifications?: (options?: { focusId?: string }) => void\n /** Show the host's contacts (a panel it toggles, a page). Absent: not offered. */\n openContacts?: () => void\n /** Show the host's databases page (user-defined tables). Absent: not offered. */\n openDatabases?: () => void\n /** Show the host's Analytics page (saved dashboards); `database`: with a new dashboard charting that\n * database (a database's \"Chart this\"). Absent: not offered. */\n openAnalytics?: (options?: { database?: AnalyticsChartRequest }) => void\n /** Show the host's tags page (people, organisations and the other tags). Absent: not offered. */\n openTags?: () => void\n /** Show the host's facts page; `compose`: with its composer open for a new fact; `focusId`: at\n * that fact. Absent: not offered. */\n openFacts?: (options?: { compose?: boolean; focusId?: string }) => void\n /** Show the open workspace's threads (the host's threads page). Absent: not offered. */\n openThreads?: () => void\n /** Show the host's Smart Search page (`ConnectedSearchPage`). Absent: not offered. */\n openSmartSearch?: () => void\n /**\n * Open a workflow in the host's Workflows page (its editor, or its runs); no id: the list.\n * Offered only while the `workflows` feature is on (`useOpenWorkflow` in `/connect`). Absent: never.\n */\n openWorkflow?: (workflowId?: string, options?: OpenWorkflowOptions) => void\n /**\n * Show the open workspace's document processing (the host's processing panel: what is indexing,\n * what failed). Absent: not offered.\n */\n openProcessing?: () => void\n /** Show the open workspace's files, optionally with some selected and the list narrowed. Default: no-op. */\n openFiles: (options?: OpenFilesOptions) => void\n /**\n * Add files the host's way (its upload dialog), optionally with some already picked, or from one\n * source. Absent: a kit that adds files uploads them itself.\n */\n openUpload?: (files?: File[], options?: { source?: UploadSource }) => void\n /** Open the host's skills browser, optionally at one skill. Absent: not offered. */\n openSkillsBrowser?: (skillSlug?: string) => void\n /** Share a document or a thread by email (the host's share dialog). Absent: not offered. */\n openShare?: (request: ShareRequest) => void\n /**\n * Show a workspace (its own page). Under `defaultHost`'s sign-in layer the kits select it first\n * (`useConnectedWorkspace().openWorkspace`); a host that keeps its own session switches to it\n * here. `name` is for the host's messages. Default: no-op.\n */\n openWorkspace: (workspaceId: string, options?: { name?: string }) => void\n}\n\nconst noop = () => {}\n\nconst subscribeToHistory = (listener: () => void) => {\n window.addEventListener('popstate', listener)\n return () => window.removeEventListener('popstate', listener)\n}\nconst windowAddress = () => window.location.pathname + window.location.search\n\n/** The window's address, following Back/Forward (the environment's default `useLocation`). */\nfunction useWindowLocation(): string {\n return useSyncExternalStore(subscribeToHistory, windowAddress, () => '/')\n}\n\nconst defaultEnvironment: BlocksEnvironment = {\n navigate: (href) => {\n if (typeof window !== 'undefined') window.location.assign(href)\n },\n useLocation: useWindowLocation,\n notify: (message, kind = 'info', options) => {\n notifyStore[kind](message, options)\n },\n confirm: confirmDialog,\n choose: choiceDialog,\n openDialog,\n closeDialog,\n runtimeConfig: {\n apiBaseUrl: '',\n deploymentDomain: typeof window !== 'undefined' ? window.location.host : '',\n },\n hrefFor: () => undefined,\n openDocument: noop,\n openWordEditor: noop,\n openConversation: noop,\n openNewConversation: noop,\n openSettings: requestSettingsSection,\n openProject: noop,\n openCalendar: (options) => {\n if (options?.event) requestCalendarEvent(options.event)\n },\n openFiles: noop,\n openWorkspace: noop,\n}\n\nconst resolved = new WeakMap<object, BlocksEnvironment>()\nconst complete = new WeakSet<BlocksEnvironment>()\n// The intents below that record what they open on: a resolved environment passed on again (a\n// nested host's, `createBlocksEnvironment`'s) records once, not twice.\nconst recording = new WeakSet<object>()\n\nfunction records<F extends object>(intent: F): F {\n recording.add(intent)\n return intent\n}\n\nfunction recordingIntent<F extends object>(\n host: F | undefined,\n wrap: (host: F) => F\n): F | undefined {\n if (!host) return undefined\n return recording.has(host) ? host : records(wrap(host))\n}\n\nfunction resolve(environment: Partial<BlocksEnvironment>): BlocksEnvironment {\n const { openDocument } = environment\n const value: BlocksEnvironment = {\n ...defaultEnvironment,\n openWordEditor: openDocument\n ? (documentId, options) => openDocument(documentId, { workspaceId: options?.workspaceId })\n : noop,\n ...environment,\n // What an intent opens on is recorded for the surface before the host shows it.\n openSettings:\n recordingIntent(environment.openSettings, (openSettings) => (section) => {\n requestSettingsSection(section)\n openSettings(section)\n }) ?? defaultEnvironment.openSettings,\n openCalendar:\n recordingIntent(environment.openCalendar, (openCalendar) => (options) => {\n defaultEnvironment.openCalendar(options)\n openCalendar(options)\n }) ?? defaultEnvironment.openCalendar,\n openMail: recordingIntent(environment.openMail, (openMail) => (options) => {\n if (options?.draftId) mailDraftRequest.request(options.draftId)\n if (options?.messageId) mailMessageRequest.request(options.messageId)\n if (options?.folder) mailFolderRequest.request(options.folder)\n if (options?.attachments?.length) mailComposeRequest.request(options.attachments)\n openMail(options)\n }),\n openWorkflow: recordingIntent(environment.openWorkflow, (openWorkflow) => (id, options) => {\n workflowOpenRequest.request({\n workflowId: id,\n view: options?.view,\n preset: options?.preset,\n runIn: options?.runIn,\n })\n openWorkflow(id, options)\n }),\n openNewConversation:\n recordingIntent(environment.openNewConversation, (openNewConversation) => (options) => {\n openNewConversation(options)\n // After the host's reset of the new conversation, which clears its draft.\n const prompt = options?.prompt?.trim()\n if (prompt) conversationStartRequest.request(prompt)\n }) ?? noop,\n }\n complete.add(value)\n return value\n}\n\n/**\n * The environment with every field filled in (the defaults where `environment` gives none), and\n * every intent recording what it opens on. A host calls it for code outside React (a store action,\n * a notification handler); passing the result as the host configuration's `environment` uses it\n * as is.\n */\nexport function createBlocksEnvironment(\n environment: Partial<BlocksEnvironment>\n): BlocksEnvironment {\n if (complete.has(environment as BlocksEnvironment)) return environment as BlocksEnvironment\n let value = resolved.get(environment)\n if (!value) resolved.set(environment, (value = resolve(environment)))\n return value\n}\n\n/** The host's environment, every field filled in (the defaults where the host gives none). */\nexport function useBlocksEnvironment(): BlocksEnvironment {\n const environment = useHostConfigRecord().environment as Partial<BlocksEnvironment> | undefined\n return environment ? createBlocksEnvironment(environment) : defaultEnvironment\n}\n\n/** Open and close the global dialogs (`<ConnectedGlobalDialogs>`), the host's way. */\nexport function useBlocksDialogs(): Pick<BlocksEnvironment, 'openDialog' | 'closeDialog'> {\n const { openDialog, closeDialog } = useBlocksEnvironment()\n return { openDialog, closeDialog }\n}\n"]}
@@ -1,10 +1,10 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
- var chunkU2HDSS5R_cjs = require('./chunk-U2HDSS5R.cjs');
5
- var chunkP2K4XL4T_cjs = require('./chunk-P2K4XL4T.cjs');
6
- var chunkJARRHAQW_cjs = require('./chunk-JARRHAQW.cjs');
7
- var chunkVMXTOIXB_cjs = require('./chunk-VMXTOIXB.cjs');
4
+ var chunkVSDD5TH5_cjs = require('./chunk-VSDD5TH5.cjs');
5
+ var chunkDWN5AUMH_cjs = require('./chunk-DWN5AUMH.cjs');
6
+ var chunkGB5MN5FC_cjs = require('./chunk-GB5MN5FC.cjs');
7
+ var chunk46LX6EQT_cjs = require('./chunk-46LX6EQT.cjs');
8
8
  var react = require('react');
9
9
  var react$1 = require('@arbidocs/react');
10
10
  var jsxRuntime = require('react/jsx-runtime');
@@ -23,9 +23,9 @@ function toWorkflowFieldDocument(doc) {
23
23
  };
24
24
  }
25
25
  function useConnectedWorkflowScopeSource() {
26
- const { data: docs } = chunkU2HDSS5R_cjs.useListedDocuments();
27
- const { data: tags } = chunkU2HDSS5R_cjs.useConnectedTags();
28
- return react.useMemo(() => chunkJARRHAQW_cjs.buildWorkflowScopeSource(docs, chunkJARRHAQW_cjs.documentScopeLabels(tags)), [docs, tags]);
26
+ const { data: docs } = chunkDWN5AUMH_cjs.useListedDocuments();
27
+ const { data: tags } = chunkDWN5AUMH_cjs.useConnectedTags();
28
+ return react.useMemo(() => chunkVSDD5TH5_cjs.buildWorkflowScopeSource(docs, chunkVSDD5TH5_cjs.documentScopeLabels(tags)), [docs, tags]);
29
29
  }
30
30
  function useConnectedAgentOptions() {
31
31
  const { data: agents } = react$1.useAgents();
@@ -41,9 +41,9 @@ function ConnectedWorkflowDocumentsField({
41
41
  onAddFiles,
42
42
  labels
43
43
  }) {
44
- const { notify } = chunkVMXTOIXB_cjs.useBlocksEnvironment();
45
- const { ensureWorkspaceOpen } = chunkP2K4XL4T_cjs.useConnectedWorkspace();
46
- const { data: docs, loaded } = chunkU2HDSS5R_cjs.useListedDocuments();
44
+ const { notify } = chunk46LX6EQT_cjs.useBlocksEnvironment();
45
+ const { ensureWorkspaceOpen } = chunkGB5MN5FC_cjs.useConnectedWorkspace();
46
+ const { data: docs, loaded } = chunkDWN5AUMH_cjs.useListedDocuments();
47
47
  const uploadDocuments = react$1.useUploadDocuments();
48
48
  const documents = react.useMemo(() => docs.map(toWorkflowFieldDocument), [docs]);
49
49
  const chosen = value.documents ?? [];
@@ -82,7 +82,7 @@ function ConnectedWorkflowDocumentsField({
82
82
  }
83
83
  ),
84
84
  /* @__PURE__ */ jsxRuntime.jsx(
85
- chunkJARRHAQW_cjs.WorkflowDocumentsField,
85
+ chunkVSDD5TH5_cjs.WorkflowDocumentsField,
86
86
  {
87
87
  field,
88
88
  value,
@@ -104,7 +104,7 @@ function ConnectedWorkflowLauncher({
104
104
  const scopeSource = useConnectedWorkflowScopeSource();
105
105
  const agents = useConnectedAgentOptions();
106
106
  return /* @__PURE__ */ jsxRuntime.jsx(
107
- chunkJARRHAQW_cjs.WorkflowLauncher,
107
+ chunkVSDD5TH5_cjs.WorkflowLauncher,
108
108
  {
109
109
  ...props,
110
110
  scopeSource,
@@ -126,5 +126,5 @@ exports.ConnectedWorkflowDocumentsField = ConnectedWorkflowDocumentsField;
126
126
  exports.ConnectedWorkflowLauncher = ConnectedWorkflowLauncher;
127
127
  exports.toWorkflowFieldDocument = toWorkflowFieldDocument;
128
128
  exports.useConnectedWorkflowScopeSource = useConnectedWorkflowScopeSource;
129
- //# sourceMappingURL=chunk-MIYEIACV.cjs.map
130
- //# sourceMappingURL=chunk-MIYEIACV.cjs.map
129
+ //# sourceMappingURL=chunk-5DGNJ6VJ.cjs.map
130
+ //# sourceMappingURL=chunk-5DGNJ6VJ.cjs.map