@arbidocs/blocks 0.4.147 → 0.4.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 (339) hide show
  1. package/dist/ConnectedNativeDocxComparison-OFPIXNJB.js +35 -0
  2. package/dist/ConnectedNativeDocxComparison-OFPIXNJB.js.map +1 -0
  3. package/dist/ConnectedNativeDocxComparison-Y5BNLNH6.cjs +44 -0
  4. package/dist/ConnectedNativeDocxComparison-Y5BNLNH6.cjs.map +1 -0
  5. package/dist/ConnectedNativeDocxEditor-HTEW5JAH.cjs +46 -0
  6. package/dist/ConnectedNativeDocxEditor-HTEW5JAH.cjs.map +1 -0
  7. package/dist/ConnectedNativeDocxEditor-LRYU5HPA.js +33 -0
  8. package/dist/ConnectedNativeDocxEditor-LRYU5HPA.js.map +1 -0
  9. package/dist/ConnectedStreamedWordArtifact-QAUVUCSX.js +35 -0
  10. package/dist/ConnectedStreamedWordArtifact-QAUVUCSX.js.map +1 -0
  11. package/dist/ConnectedStreamedWordArtifact-QW74LKHN.cjs +44 -0
  12. package/dist/ConnectedStreamedWordArtifact-QW74LKHN.cjs.map +1 -0
  13. package/dist/FactTextEditor-YESAU2IJ.js +25 -0
  14. package/dist/FactTextEditor-YESAU2IJ.js.map +1 -0
  15. package/dist/FactTextEditor-YUPBCTXK.cjs +27 -0
  16. package/dist/FactTextEditor-YUPBCTXK.cjs.map +1 -0
  17. package/dist/{NativeDocxEditor-BE2OEOTJ.cjs → NativeDocxEditor-5VBNM5I7.cjs} +8 -8
  18. package/dist/{NativeDocxEditor-BE2OEOTJ.cjs.map → NativeDocxEditor-5VBNM5I7.cjs.map} +1 -1
  19. package/dist/{NativeDocxEditor-KOPFMRYW.js → NativeDocxEditor-XT5ZLFGU.js} +4 -4
  20. package/dist/{NativeDocxEditor-KOPFMRYW.js.map → NativeDocxEditor-XT5ZLFGU.js.map} +1 -1
  21. package/dist/agents/index.cjs +263 -264
  22. package/dist/agents/index.js +6 -7
  23. package/dist/calendar/index.cjs +117 -125
  24. package/dist/calendar/index.d.ts +0 -1
  25. package/dist/calendar/index.js +1 -1
  26. package/dist/chat/index.cjs +78 -78
  27. package/dist/chat/index.js +3 -3
  28. package/dist/{chunk-2FL7QJKJ.js → chunk-265GOG4W.js} +3 -3
  29. package/dist/{chunk-2FL7QJKJ.js.map → chunk-265GOG4W.js.map} +1 -1
  30. package/dist/{chunk-LTU35TQN.cjs → chunk-2FLWPM3B.cjs} +636 -31
  31. package/dist/chunk-2FLWPM3B.cjs.map +1 -0
  32. package/dist/{chunk-SUUPR735.js → chunk-3PCBYOIZ.js} +4 -4
  33. package/dist/{chunk-SUUPR735.js.map → chunk-3PCBYOIZ.js.map} +1 -1
  34. package/dist/{chunk-WIZ7Z7FN.js → chunk-4236BRZK.js} +46 -221
  35. package/dist/chunk-4236BRZK.js.map +1 -0
  36. package/dist/{chunk-IL3WB3YX.cjs → chunk-4JNKXOFZ.cjs} +3 -3
  37. package/dist/{chunk-IL3WB3YX.cjs.map → chunk-4JNKXOFZ.cjs.map} +1 -1
  38. package/dist/{chunk-ODRHHWHY.cjs → chunk-4KMLM3GY.cjs} +4 -4
  39. package/dist/chunk-4KMLM3GY.cjs.map +1 -0
  40. package/dist/chunk-6I6CVX5G.cjs +22 -0
  41. package/dist/chunk-6I6CVX5G.cjs.map +1 -0
  42. package/dist/{chunk-MHFF5N65.cjs → chunk-757OYF6G.cjs} +4 -38
  43. package/dist/chunk-757OYF6G.cjs.map +1 -0
  44. package/dist/chunk-B3FMUFAW.cjs +1956 -0
  45. package/dist/chunk-B3FMUFAW.cjs.map +1 -0
  46. package/dist/{chunk-B3AHCIV5.js → chunk-BJ24VPOA.js} +4 -55
  47. package/dist/chunk-BJ24VPOA.js.map +1 -0
  48. package/dist/chunk-C7PTF6BQ.cjs +172 -0
  49. package/dist/chunk-C7PTF6BQ.cjs.map +1 -0
  50. package/dist/{chunk-LZRMXJIE.js → chunk-COA3S3CZ.js} +3 -3
  51. package/dist/{chunk-LZRMXJIE.js.map → chunk-COA3S3CZ.js.map} +1 -1
  52. package/dist/{chunk-VUR63NMQ.js → chunk-CROTH2BS.js} +6 -6
  53. package/dist/{chunk-VUR63NMQ.js.map → chunk-CROTH2BS.js.map} +1 -1
  54. package/dist/{chunk-AO7SK6WP.cjs → chunk-CU2O32Z4.cjs} +31 -31
  55. package/dist/{chunk-AO7SK6WP.cjs.map → chunk-CU2O32Z4.cjs.map} +1 -1
  56. package/dist/chunk-D3WFIFRY.cjs +659 -0
  57. package/dist/chunk-D3WFIFRY.cjs.map +1 -0
  58. package/dist/{chunk-DAHCRVPM.js → chunk-DB2OXRQC.js} +84 -82
  59. package/dist/chunk-DB2OXRQC.js.map +1 -0
  60. package/dist/{chunk-QXMR5YHC.js → chunk-DIB4JYUY.js} +19 -3
  61. package/dist/chunk-DIB4JYUY.js.map +1 -0
  62. package/dist/chunk-DVB5ZKOF.js +22 -0
  63. package/dist/chunk-DVB5ZKOF.js.map +1 -0
  64. package/dist/chunk-EYJMMGXF.js +19 -0
  65. package/dist/chunk-EYJMMGXF.js.map +1 -0
  66. package/dist/chunk-FAXXN7KI.cjs +213 -0
  67. package/dist/chunk-FAXXN7KI.cjs.map +1 -0
  68. package/dist/{chunk-2MJWWPHY.js → chunk-G4IYES7G.js} +140 -15
  69. package/dist/chunk-G4IYES7G.js.map +1 -0
  70. package/dist/{chunk-T5I4NRFP.cjs → chunk-GFOEWPAP.cjs} +8 -8
  71. package/dist/{chunk-T5I4NRFP.cjs.map → chunk-GFOEWPAP.cjs.map} +1 -1
  72. package/dist/{chunk-QI6AIHWP.cjs → chunk-GOWXP5KT.cjs} +145 -14
  73. package/dist/chunk-GOWXP5KT.cjs.map +1 -0
  74. package/dist/chunk-HALD6ZB5.cjs +18 -0
  75. package/dist/chunk-HALD6ZB5.cjs.map +1 -0
  76. package/dist/chunk-HUJF2XM2.js +6584 -0
  77. package/dist/chunk-HUJF2XM2.js.map +1 -0
  78. package/dist/{chunk-NRFAWUVD.js → chunk-JAANWQGB.js} +157 -157
  79. package/dist/chunk-JAANWQGB.js.map +1 -0
  80. package/dist/{chunk-7RJTEWYM.js → chunk-JGOST4IL.js} +350 -64
  81. package/dist/chunk-JGOST4IL.js.map +1 -0
  82. package/dist/chunk-KHXEIEXN.js +41 -0
  83. package/dist/chunk-KHXEIEXN.js.map +1 -0
  84. package/dist/chunk-KQYPP72K.js +644 -0
  85. package/dist/chunk-KQYPP72K.js.map +1 -0
  86. package/dist/chunk-KUT2Y7JF.cjs +43 -0
  87. package/dist/chunk-KUT2Y7JF.cjs.map +1 -0
  88. package/dist/{chunk-6YTHQ73P.cjs → chunk-LLYZGH3L.cjs} +3 -56
  89. package/dist/chunk-LLYZGH3L.cjs.map +1 -0
  90. package/dist/{chunk-YSHIC4NJ.cjs → chunk-LXTOOUEN.cjs} +159 -154
  91. package/dist/chunk-LXTOOUEN.cjs.map +1 -0
  92. package/dist/{chunk-EVUEIBNU.js → chunk-M4S75AEJ.js} +44 -5
  93. package/dist/chunk-M4S75AEJ.js.map +1 -0
  94. package/dist/{chunk-V5OAXIBN.cjs → chunk-NPR5BGFF.cjs} +11 -11
  95. package/dist/{chunk-V5OAXIBN.cjs.map → chunk-NPR5BGFF.cjs.map} +1 -1
  96. package/dist/{chunk-PLJ7PHWU.cjs → chunk-NS7NVX4E.cjs} +3 -3
  97. package/dist/{chunk-PLJ7PHWU.cjs.map → chunk-NS7NVX4E.cjs.map} +1 -1
  98. package/dist/{chunk-AINU3EJ6.cjs → chunk-Q4BY2CQQ.cjs} +92 -90
  99. package/dist/chunk-Q4BY2CQQ.cjs.map +1 -0
  100. package/dist/chunk-QN47Q4N7.js +16 -0
  101. package/dist/chunk-QN47Q4N7.js.map +1 -0
  102. package/dist/{chunk-I2QSDQQV.cjs → chunk-QT3A4PFC.cjs} +21 -2
  103. package/dist/chunk-QT3A4PFC.cjs.map +1 -0
  104. package/dist/{chunk-ZM26YEOT.js → chunk-RY2SODRN.js} +3 -3
  105. package/dist/{chunk-ZM26YEOT.js.map → chunk-RY2SODRN.js.map} +1 -1
  106. package/dist/chunk-SDOEHEJP.js +208 -0
  107. package/dist/chunk-SDOEHEJP.js.map +1 -0
  108. package/dist/{chunk-DETZZBG2.cjs → chunk-SIB6C7P7.cjs} +43 -2
  109. package/dist/chunk-SIB6C7P7.cjs.map +1 -0
  110. package/dist/{chunk-MFY2ZNP6.cjs → chunk-SMN32BQ3.cjs} +4 -4
  111. package/dist/chunk-SMN32BQ3.cjs.map +1 -0
  112. package/dist/chunk-T74Q3MCZ.cjs +6751 -0
  113. package/dist/chunk-T74Q3MCZ.cjs.map +1 -0
  114. package/dist/{chunk-AOSUHWIL.js → chunk-TZOQKV64.js} +4 -37
  115. package/dist/chunk-TZOQKV64.js.map +1 -0
  116. package/dist/{chunk-U37AYUPI.cjs → chunk-U6JQ4KMX.cjs} +46 -233
  117. package/dist/chunk-U6JQ4KMX.cjs.map +1 -0
  118. package/dist/chunk-WFA2GVZJ.js +16 -0
  119. package/dist/chunk-WFA2GVZJ.js.map +1 -0
  120. package/dist/chunk-WU34CHU5.js +1907 -0
  121. package/dist/chunk-WU34CHU5.js.map +1 -0
  122. package/dist/{chunk-O4YPVYPO.cjs → chunk-YAEXSCUW.cjs} +364 -60
  123. package/dist/chunk-YAEXSCUW.cjs.map +1 -0
  124. package/dist/{chunk-H74HEPKT.js → chunk-YXNNNP57.js} +598 -13
  125. package/dist/chunk-YXNNNP57.js.map +1 -0
  126. package/dist/chunk-Z27QMJ6S.cjs +25 -0
  127. package/dist/chunk-Z27QMJ6S.cjs.map +1 -0
  128. package/dist/{chunk-CSI2B2H5.js → chunk-Z4NQ3TED.js} +4 -4
  129. package/dist/chunk-Z4NQ3TED.js.map +1 -0
  130. package/dist/{chunk-DGV7HQA7.js → chunk-ZLEYLCE4.js} +4 -4
  131. package/dist/chunk-ZLEYLCE4.js.map +1 -0
  132. package/dist/chunk-ZNLTEZEF.js +170 -0
  133. package/dist/chunk-ZNLTEZEF.js.map +1 -0
  134. package/dist/chunk-ZP6Q3KXU.cjs +18 -0
  135. package/dist/chunk-ZP6Q3KXU.cjs.map +1 -0
  136. package/dist/citations/index.cjs +14 -14
  137. package/dist/citations/index.js +2 -2
  138. package/dist/collaboration/index.cjs +35 -35
  139. package/dist/collaboration/index.js +1 -1
  140. package/dist/connect/docx.cjs +21 -26
  141. package/dist/connect/docx.cjs.map +1 -1
  142. package/dist/connect/docx.js +10 -26
  143. package/dist/connect/docx.js.map +1 -1
  144. package/dist/connect/index.cjs +8662 -2824
  145. package/dist/connect/index.cjs.map +1 -1
  146. package/dist/connect/index.d.ts +10 -2
  147. package/dist/connect/index.js +8467 -2670
  148. package/dist/connect/index.js.map +1 -1
  149. package/dist/connect/viewer.cjs +2357 -0
  150. package/dist/connect/viewer.cjs.map +1 -0
  151. package/dist/connect/viewer.d.ts +8 -0
  152. package/dist/connect/viewer.js +2350 -0
  153. package/dist/connect/viewer.js.map +1 -0
  154. package/dist/connection/ConnectedWorkflowsTable.d.ts +2 -12
  155. package/dist/connection/ai.d.ts +2 -9
  156. package/dist/connection/billing/AddAddonDialog.d.ts +24 -0
  157. package/dist/connection/billing/BillingCard.d.ts +18 -0
  158. package/dist/connection/billing/BillingProjectEntity.d.ts +9 -0
  159. package/dist/connection/billing/ChangePlanDialog.d.ts +20 -0
  160. package/dist/connection/billing/ChangeProPlan.d.ts +20 -0
  161. package/dist/connection/billing/CheckoutTotal.d.ts +12 -0
  162. package/dist/connection/billing/DailyCapEditor.d.ts +4 -0
  163. package/dist/connection/billing/InvoicesModal.d.ts +6 -0
  164. package/dist/connection/billing/NewProjectFlow.d.ts +14 -0
  165. package/dist/connection/billing/PlanChangeLines.d.ts +13 -0
  166. package/dist/connection/billing/PlanSelector.d.ts +50 -0
  167. package/dist/connection/billing/ProjectBilling.d.ts +24 -0
  168. package/dist/connection/billing/ProjectDetail.d.ts +16 -0
  169. package/dist/connection/billing/ProjectUsageCard.d.ts +21 -0
  170. package/dist/connection/billing/ProjectUsageContent.d.ts +18 -0
  171. package/dist/connection/billing/ProjectsTable.d.ts +13 -0
  172. package/dist/connection/billing/ReduceAddonDialog.d.ts +18 -0
  173. package/dist/connection/billing/ReferralReward.d.ts +32 -0
  174. package/dist/connection/billing/SharedProjects.d.ts +13 -0
  175. package/dist/connection/billing/StripeCheckoutModal.d.ts +32 -0
  176. package/dist/connection/billing/SubscriptionPlans.d.ts +15 -0
  177. package/dist/connection/billing/SubscriptionStatus.d.ts +10 -0
  178. package/dist/connection/billing/addon-pricing.d.ts +97 -0
  179. package/dist/connection/billing/api-error.d.ts +6 -0
  180. package/dist/connection/billing/billing-country.d.ts +14 -0
  181. package/dist/connection/billing/billing-focus.d.ts +11 -0
  182. package/dist/connection/billing/index.d.ts +22 -0
  183. package/dist/connection/billing/plan-badge.d.ts +15 -0
  184. package/dist/connection/billing/plan-change-outcome.d.ts +15 -0
  185. package/dist/connection/billing/plan-constants.d.ts +29 -0
  186. package/dist/connection/billing/plan-pricing.d.ts +67 -0
  187. package/dist/connection/billing/quota-items.d.ts +33 -0
  188. package/dist/connection/billing/referral-reward.d.ts +28 -0
  189. package/dist/connection/billing/refusal-copy.d.ts +5 -0
  190. package/dist/connection/billing/reward-balance.d.ts +19 -0
  191. package/dist/connection/billing/support.d.ts +35 -0
  192. package/dist/connection/billing/tax-quote.d.ts +36 -0
  193. package/dist/connection/billing/useAddonPurchase.d.ts +32 -0
  194. package/dist/connection/billing/useAutoRefreshPendingProjects.d.ts +11 -0
  195. package/dist/connection/billing/useCheckoutQuote.d.ts +30 -0
  196. package/dist/connection/billing/useOpenBillingPortal.d.ts +12 -0
  197. package/dist/connection/calendar/CalendarSettingsDialog.d.ts +1 -1
  198. package/dist/connection/facts/ConnectedFactsPage.d.ts +50 -0
  199. package/dist/connection/facts/FactMarkdownEditor.d.ts +57 -0
  200. package/dist/connection/facts/FactSourcesPopover.d.ts +38 -0
  201. package/dist/connection/facts/FactTextEditor.d.ts +2 -0
  202. package/dist/connection/facts/factNouns.d.ts +4 -0
  203. package/dist/connection/facts/factPageColumns.d.ts +37 -0
  204. package/dist/connection/facts/types.d.ts +127 -0
  205. package/dist/connection/facts/useFactActions.d.ts +10 -0
  206. package/dist/connection/facts/useFactComposer.d.ts +54 -0
  207. package/dist/connection/facts/useFactFilters.d.ts +101 -0
  208. package/dist/connection/facts/useFactSelection.d.ts +82 -0
  209. package/dist/connection/facts/useFactsGrid.d.ts +87 -0
  210. package/dist/connection/facts/useFactsPageView.d.ts +4 -0
  211. package/dist/connection/mail/ConnectedMailComposer.d.ts +3 -1
  212. package/dist/connection/mail/ConnectedMailbox.d.ts +4 -2
  213. package/dist/connection/mail/MailComposerForm.d.ts +4 -2
  214. package/dist/connection/mail/MailRecipientInput.d.ts +14 -0
  215. package/dist/connection/mail/index.d.ts +1 -1
  216. package/dist/connection/mail/types.d.ts +10 -0
  217. package/dist/connection/search/ConnectedSearchPage.d.ts +64 -0
  218. package/dist/connection/search/SearchResultRows.d.ts +38 -0
  219. package/dist/connection/search/index.d.ts +2 -0
  220. package/dist/connection/tags/ConnectedTagTable.d.ts +108 -0
  221. package/dist/connection/tags/ConnectedTagsPage.d.ts +55 -0
  222. package/dist/connection/tags/DocTagPassages.d.ts +25 -0
  223. package/dist/connection/tags/GlossaryExport.d.ts +7 -0
  224. package/dist/connection/tags/TagCombineFilter.d.ts +14 -0
  225. package/dist/connection/tags/TagPlacement.d.ts +16 -0
  226. package/dist/connection/tags/TagsPageSections.d.ts +36 -0
  227. package/dist/connection/tags/tagCombine.d.ts +55 -0
  228. package/dist/connection/useConnectedWorkNotifications.d.ts +7 -24
  229. package/dist/connection/viewer/ConnectedDocumentToolsProvider.d.ts +11 -0
  230. package/dist/connection/viewer/ConnectedDocumentViewer.d.ts +21 -0
  231. package/dist/connection/viewer/FinaliseTranslationButton.d.ts +15 -0
  232. package/dist/connection/viewer/ViewerPdfPane.d.ts +46 -0
  233. package/dist/connection/viewer/parsed/ParsedPassage.d.ts +48 -0
  234. package/dist/connection/viewer/parsed/ParsedTextView.d.ts +17 -0
  235. package/dist/connection/viewer/parsed/PassageTagPanel.d.ts +18 -0
  236. package/dist/connection/viewer/parsed/citation-line.d.ts +17 -0
  237. package/dist/connection/viewer/parsed/document-tags.d.ts +8 -0
  238. package/dist/connection/viewer/parsed/useChunkTagging.d.ts +46 -0
  239. package/dist/connection/viewer/parsed/useCitationSelection.d.ts +27 -0
  240. package/dist/connection/viewer/parsed/useDocumentLabels.d.ts +38 -0
  241. package/dist/connection/viewer/parsed/useLazyPages.d.ts +18 -0
  242. package/dist/connection/viewer/parsed/usePageScrollSync.d.ts +17 -0
  243. package/dist/connection/viewer/parsed/usePassageCopy.d.ts +25 -0
  244. package/dist/connection/viewer/support.d.ts +97 -0
  245. package/dist/connection/viewer/useImageCrop.d.ts +13 -0
  246. package/dist/connection/viewer/useViewedDocument.d.ts +70 -0
  247. package/dist/connection/viewer/useViewerBlobs.d.ts +15 -0
  248. package/dist/connection/viewer/useViewerTabs.d.ts +18 -0
  249. package/dist/connection/viewer/useViewerVersions.d.ts +11 -0
  250. package/dist/connection/workspace-settings/useConnectedWorkspaceSettings.d.ts +6 -0
  251. package/dist/document-tools/index.cjs +59 -652
  252. package/dist/document-tools/index.cjs.map +1 -1
  253. package/dist/document-tools/index.js +2 -641
  254. package/dist/document-tools/index.js.map +1 -1
  255. package/dist/docx/index.cjs +48 -47
  256. package/dist/docx/index.js +4 -3
  257. package/dist/facts/FactsBulkBar.d.ts +6 -3
  258. package/dist/facts/cited-version-ref.d.ts +1 -0
  259. package/dist/facts/index.cjs +204 -1940
  260. package/dist/facts/index.cjs.map +1 -1
  261. package/dist/facts/index.d.ts +1 -0
  262. package/dist/facts/index.js +13 -1895
  263. package/dist/facts/index.js.map +1 -1
  264. package/dist/files/TagPassagePanel.d.ts +2 -1
  265. package/dist/files/ViewerChrome.d.ts +5 -4
  266. package/dist/files/ViewerControlBar.d.ts +12 -0
  267. package/dist/files/doc-labels.d.ts +35 -0
  268. package/dist/files/grid/FilterButton.d.ts +12 -0
  269. package/dist/files/grid/RowDensityControl.d.ts +18 -0
  270. package/dist/files/grid/row-density.d.ts +27 -0
  271. package/dist/files/index.cjs +778 -7099
  272. package/dist/files/index.cjs.map +1 -1
  273. package/dist/files/index.d.ts +5 -0
  274. package/dist/files/index.js +13 -6918
  275. package/dist/files/index.js.map +1 -1
  276. package/dist/index.cjs +993 -1209
  277. package/dist/index.cjs.map +1 -1
  278. package/dist/index.js +22 -355
  279. package/dist/index.js.map +1 -1
  280. package/dist/retrieval/SearchSnippet.d.ts +6 -0
  281. package/dist/retrieval/index.cjs +74 -41
  282. package/dist/retrieval/index.d.ts +2 -0
  283. package/dist/retrieval/index.js +2 -1
  284. package/dist/retrieval/search-results.d.ts +46 -0
  285. package/dist/settings/Billing.d.ts +0 -66
  286. package/dist/settings/SubscriptionParts.d.ts +1 -50
  287. package/dist/settings/index.cjs +166 -214
  288. package/dist/settings/index.d.ts +3 -2
  289. package/dist/settings/index.js +1 -1
  290. package/dist/settings/inverted-index-filter.d.ts +26 -0
  291. package/dist/studio/index.cjs +3 -3
  292. package/dist/studio/index.js +2 -2
  293. package/dist/tags/definitions.d.ts +10 -0
  294. package/dist/tags/index.d.ts +4 -1
  295. package/dist/tags/page/ExtractEntitiesDialog.d.ts +24 -0
  296. package/dist/tags/page/TagPicker.d.ts +16 -0
  297. package/dist/tags/page/tagsPageLabels.d.ts +36 -0
  298. package/dist/workflow-canvas/index.cjs +19 -20
  299. package/dist/workflow-canvas/index.cjs.map +1 -1
  300. package/dist/workflow-canvas/index.js +6 -7
  301. package/dist/workflow-canvas/index.js.map +1 -1
  302. package/node_modules/@arbidocs/coedit/package.json +1 -1
  303. package/package.json +13 -4
  304. package/dist/calendar/access-setup.d.ts +0 -8
  305. package/dist/chunk-2MJWWPHY.js.map +0 -1
  306. package/dist/chunk-3AFWGEDJ.cjs +0 -53
  307. package/dist/chunk-3AFWGEDJ.cjs.map +0 -1
  308. package/dist/chunk-6YTHQ73P.cjs.map +0 -1
  309. package/dist/chunk-7RJTEWYM.js.map +0 -1
  310. package/dist/chunk-AINU3EJ6.cjs.map +0 -1
  311. package/dist/chunk-AOSUHWIL.js.map +0 -1
  312. package/dist/chunk-B3AHCIV5.js.map +0 -1
  313. package/dist/chunk-CSI2B2H5.js.map +0 -1
  314. package/dist/chunk-DAHCRVPM.js.map +0 -1
  315. package/dist/chunk-DETZZBG2.cjs.map +0 -1
  316. package/dist/chunk-DGV7HQA7.js.map +0 -1
  317. package/dist/chunk-EVUEIBNU.js.map +0 -1
  318. package/dist/chunk-H74HEPKT.js.map +0 -1
  319. package/dist/chunk-I2QSDQQV.cjs.map +0 -1
  320. package/dist/chunk-J5CWKFSC.js +0 -170
  321. package/dist/chunk-J5CWKFSC.js.map +0 -1
  322. package/dist/chunk-LTU35TQN.cjs.map +0 -1
  323. package/dist/chunk-MFY2ZNP6.cjs.map +0 -1
  324. package/dist/chunk-MHFF5N65.cjs.map +0 -1
  325. package/dist/chunk-NRFAWUVD.js.map +0 -1
  326. package/dist/chunk-O4YPVYPO.cjs.map +0 -1
  327. package/dist/chunk-ODRHHWHY.cjs.map +0 -1
  328. package/dist/chunk-QI6AIHWP.cjs.map +0 -1
  329. package/dist/chunk-QXMR5YHC.js.map +0 -1
  330. package/dist/chunk-RFXJYIDV.js +0 -50
  331. package/dist/chunk-RFXJYIDV.js.map +0 -1
  332. package/dist/chunk-U37AYUPI.cjs.map +0 -1
  333. package/dist/chunk-WIZ7Z7FN.js.map +0 -1
  334. package/dist/chunk-XVUOMWMD.cjs +0 -177
  335. package/dist/chunk-XVUOMWMD.cjs.map +0 -1
  336. package/dist/chunk-YSHIC4NJ.cjs.map +0 -1
  337. package/dist/connection/ConnectedTagTable.d.ts +0 -32
  338. package/dist/connection/calendar/CopyField.d.ts +0 -9
  339. package/dist/connection/calendar/OpenAccessPanel.d.ts +0 -7
@@ -1,648 +1,9 @@
1
1
  "use client";
2
+ export { AnnotateButton, DEFAULT_VERSION_SNAPSHOT_BAR_LABELS, DownloadMarkupButton, MarkupNotices, MarkupViewNote, RequestSignaturesButton, ShowOriginalButton, SignButton, SignatureCertificate, SignatureRequestBanner, SignatureStatus, SignedEditNote, VersionSnapshotBar, formatSignedAt } from '../chunk-KQYPP72K.js';
2
3
  export { AdoptSignatureDialog, TYPED_SIGNATURE_STYLE } from '../chunk-EQB3WELX.js';
4
+ import '../chunk-6HKLTYNN.js';
3
5
  export { SignDocumentDialog } from '../chunk-2YOVK524.js';
4
- import { ViewerStatusNote } from '../chunk-6HKLTYNN.js';
5
6
  import '../chunk-TX2ZICS7.js';
6
7
  import '../chunk-VUNV25KB.js';
7
- import { PencilLine, FileText, PenLine, Users, Send, FilePenLine, Download } from 'lucide-react';
8
- import { Button, Popover, PopoverTrigger, PopoverContent, cn } from '@arbidocs/react/ui';
9
- import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
10
- import { useOptionalDocumentTools, certificateLink, useDocumentTools, useDocumentSignatureRequests, useVoidSignatureRequest, matchSignedCopy } from '@arbidocs/react/document-tools';
11
- import { useState, useRef } from 'react';
12
-
13
- var TOUCH = "pointer-coarse:min-h-11";
14
- function AnnotateButton({ active, onClick, compact }) {
15
- return /* @__PURE__ */ jsxs(
16
- Button,
17
- {
18
- type: "button",
19
- variant: active ? "default" : "outline",
20
- size: compact ? "icon" : "sm",
21
- "aria-pressed": active,
22
- title: "Annotate: highlight, comment, stamp, redact",
23
- "aria-label": "Annotate",
24
- "data-testid": "annotate-toggle",
25
- className: TOUCH,
26
- onClick,
27
- children: [
28
- /* @__PURE__ */ jsx(PencilLine, { className: "size-4" }),
29
- !compact && /* @__PURE__ */ jsx("span", { className: "ml-1", children: "Annotate" })
30
- ]
31
- }
32
- );
33
- }
34
- function ShowOriginalButton({ active, onClick, compact }) {
35
- return /* @__PURE__ */ jsxs(
36
- Button,
37
- {
38
- type: "button",
39
- variant: active ? "default" : "outline",
40
- size: compact ? "icon" : "sm",
41
- "aria-pressed": active,
42
- title: active ? "Show the markup again" : "Show the original, without markup",
43
- "aria-label": "Show original",
44
- "data-testid": "markup-show-original",
45
- className: TOUCH,
46
- onClick,
47
- children: [
48
- /* @__PURE__ */ jsx(FileText, { className: "size-4" }),
49
- !compact && /* @__PURE__ */ jsx("span", { className: "ml-1", children: "Show original" })
50
- ]
51
- }
52
- );
53
- }
54
- function DownloadMarkupButton({
55
- onClick,
56
- disabledReason
57
- }) {
58
- const button = /* @__PURE__ */ jsx(
59
- Button,
60
- {
61
- type: "button",
62
- variant: "outline",
63
- size: "icon",
64
- title: disabledReason ?? "Download with markup: the PDF with its annotations (opens in Acrobat or Preview)",
65
- "aria-label": "Download with markup",
66
- "aria-description": disabledReason,
67
- disabled: !!disabledReason,
68
- "data-testid": "markup-download",
69
- className: TOUCH,
70
- onClick,
71
- children: /* @__PURE__ */ jsx(Download, { className: "size-4" })
72
- }
73
- );
74
- return disabledReason ? /* @__PURE__ */ jsx("span", { title: disabledReason, className: "inline-flex", "data-testid": "markup-download-locked", children: button }) : button;
75
- }
76
- function SignedEditNote() {
77
- return /* @__PURE__ */ jsx(
78
- "p",
79
- {
80
- className: "border-b px-3 py-1.5 text-xs text-muted-foreground",
81
- "data-testid": "signed-edit-note",
82
- children: "Editing creates a new unsigned version"
83
- }
84
- );
85
- }
86
- function SignButton({ active, onClick, compact }) {
87
- return /* @__PURE__ */ jsxs(
88
- Button,
89
- {
90
- type: "button",
91
- variant: active ? "default" : "outline",
92
- size: compact ? "icon" : "sm",
93
- "aria-pressed": active,
94
- title: "Sign document",
95
- "aria-label": "Sign",
96
- "data-testid": "sign-document-button",
97
- className: TOUCH,
98
- onClick,
99
- children: [
100
- /* @__PURE__ */ jsx(PenLine, { className: "size-4" }),
101
- !compact && /* @__PURE__ */ jsx("span", { className: "ml-1", children: "Sign" })
102
- ]
103
- }
104
- );
105
- }
106
- function RequestSignaturesButton({ active, onClick, compact }) {
107
- return /* @__PURE__ */ jsxs(
108
- Button,
109
- {
110
- type: "button",
111
- variant: active ? "default" : "outline",
112
- size: compact ? "icon" : "sm",
113
- "aria-pressed": active,
114
- title: "Request signatures",
115
- "aria-label": "Request signatures",
116
- "data-testid": "request-signatures-button",
117
- className: TOUCH,
118
- onClick,
119
- children: [
120
- /* @__PURE__ */ jsx(Users, { className: "size-4" }),
121
- !compact && /* @__PURE__ */ jsx("span", { className: "ml-1", children: "Request signatures" })
122
- ]
123
- }
124
- );
125
- }
126
- var BAR = "flex flex-wrap items-center justify-between gap-2 border-b px-3 py-2 text-xs";
127
- var LINK = "font-medium text-primary hover:underline disabled:opacity-50 disabled:no-underline pointer-coarse:min-h-11";
128
- function MarkupNotices({ legacyPrompt, olderNote, onOpenVersion }) {
129
- return /* @__PURE__ */ jsxs(Fragment, { children: [
130
- legacyPrompt && /* @__PURE__ */ jsxs("div", { className: BAR, role: "status", "data-testid": "markup-migration-prompt", children: [
131
- /* @__PURE__ */ jsxs("span", { children: [
132
- legacyPrompt.count,
133
- " annotation",
134
- legacyPrompt.count === 1 ? "" : "s",
135
- " on this document",
136
- legacyPrompt.count === 1 ? " is" : " are",
137
- " saved only in this browser. Add",
138
- " ",
139
- legacyPrompt.count === 1 ? "it" : "them",
140
- " to the shared markup, where everyone with access sees ",
141
- legacyPrompt.count === 1 ? "it" : "them",
142
- "?"
143
- ] }),
144
- /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-3", children: [
145
- /* @__PURE__ */ jsx(
146
- "button",
147
- {
148
- type: "button",
149
- className: LINK,
150
- disabled: legacyPrompt.busy,
151
- "data-testid": "markup-migration-add",
152
- onClick: legacyPrompt.add,
153
- children: legacyPrompt.busy ? "Adding\u2026" : "Add to shared markup"
154
- }
155
- ),
156
- /* @__PURE__ */ jsx(
157
- "button",
158
- {
159
- type: "button",
160
- className: LINK,
161
- disabled: legacyPrompt.busy,
162
- "data-testid": "markup-migration-discard",
163
- onClick: legacyPrompt.discard,
164
- children: "Discard"
165
- }
166
- )
167
- ] })
168
- ] }),
169
- olderNote && /* @__PURE__ */ jsxs("div", { className: BAR, "data-testid": "markup-older-version-note", children: [
170
- /* @__PURE__ */ jsxs("span", { children: [
171
- "The markup is on version ",
172
- olderNote.version,
173
- ". This version started without it.",
174
- olderNote.signed && /* @__PURE__ */ jsxs("span", { "data-testid": "markup-older-version-signed", children: [
175
- " ",
176
- "It is signed: comments copied here are kept beside it, and the signed PDF does not change."
177
- ] })
178
- ] }),
179
- /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-3", children: [
180
- /* @__PURE__ */ jsxs(
181
- "button",
182
- {
183
- type: "button",
184
- className: LINK,
185
- "data-testid": "markup-open-older-version",
186
- onClick: () => onOpenVersion(olderNote.version),
187
- children: [
188
- "Open version ",
189
- olderNote.version
190
- ]
191
- }
192
- ),
193
- /* @__PURE__ */ jsx(
194
- "button",
195
- {
196
- type: "button",
197
- className: LINK,
198
- disabled: olderNote.busy,
199
- "data-testid": "markup-copy-open-threads",
200
- title: "Copy the unresolved comment threads onto this version (redactions never carry over)",
201
- onClick: olderNote.copy,
202
- children: olderNote.busy ? "Copying\u2026" : "Copy open comments here"
203
- }
204
- )
205
- ] })
206
- ] })
207
- ] });
208
- }
209
- function MarkupViewNote({ showOriginal, onToggle }) {
210
- return /* @__PURE__ */ jsxs(ViewerStatusNote, { testId: "markup-view-note", children: [
211
- showOriginal ? "Original, without markup" : "With markup",
212
- " \xB7 ",
213
- /* @__PURE__ */ jsx(
214
- "button",
215
- {
216
- type: "button",
217
- className: "font-medium text-primary hover:underline pointer-coarse:min-h-11",
218
- "data-testid": "markup-view-note-toggle",
219
- onClick: onToggle,
220
- children: showOriginal ? "Show markup" : "Show original"
221
- }
222
- )
223
- ] });
224
- }
225
- function formatSignedAt(iso) {
226
- const date = new Date(iso);
227
- if (Number.isNaN(date.getTime())) return iso;
228
- return date.toLocaleString([], { dateStyle: "medium", timeStyle: "short" });
229
- }
230
- function Row({ label, field, children }) {
231
- return /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-[5.5rem_1fr] gap-2", children: [
232
- /* @__PURE__ */ jsx("dt", { className: "text-muted-foreground", children: label }),
233
- /* @__PURE__ */ jsx("dd", { className: "min-w-0 break-words", "data-testid": `signature-detail-${field}`, children })
234
- ] });
235
- }
236
- function SignatureStatus({
237
- status,
238
- formatDate = formatSignedAt,
239
- certificateUrl
240
- }) {
241
- const tools = useOptionalDocumentTools();
242
- const hostCertificateUrl = certificateUrl ?? tools?.certificateUrl;
243
- const signatures = status.signatures ?? [];
244
- const isCounterSigned = signatures.length > 1;
245
- return /* @__PURE__ */ jsxs(Popover, { children: [
246
- /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
247
- "button",
248
- {
249
- type: "button",
250
- className: "flex-shrink-0 text-sm text-muted-foreground underline decoration-dotted underline-offset-4 hover:text-foreground pointer-coarse:min-h-11",
251
- "data-testid": "document-signature-status",
252
- "aria-label": `${status.intact ? "Signed, locked" : "Modified after signing"}: show signature details`,
253
- children: status.intact ? "Signed \u2014 locked" : "Modified after signing"
254
- }
255
- ) }),
256
- /* @__PURE__ */ jsxs(
257
- PopoverContent,
258
- {
259
- className: "max-h-[70vh] w-80 overflow-y-auto p-3 text-sm",
260
- align: "start",
261
- "data-testid": "signature-details",
262
- children: [
263
- /* @__PURE__ */ jsx("p", { className: "mb-2 font-medium", "data-testid": "signature-details-title", children: isCounterSigned ? `Electronic signatures (${signatures.length})` : "Electronic signature" }),
264
- signatures.map((signature, index) => /* @__PURE__ */ jsxs(
265
- "dl",
266
- {
267
- className: `mb-3 space-y-1 ${index > 0 ? "border-t border-border pt-2" : ""}`,
268
- "data-testid": `signature-item-${index}`,
269
- children: [
270
- /* @__PURE__ */ jsx(Row, { label: "Signed by", field: "signer", children: signature.signer_name || signature.signer_email }),
271
- /* @__PURE__ */ jsx(Row, { label: "On", field: "time", children: formatDate(signature.signed_at) }),
272
- /* @__PURE__ */ jsx("dd", { children: /* @__PURE__ */ jsx(
273
- "a",
274
- {
275
- href: certificateLink(signature, hostCertificateUrl),
276
- target: "_blank",
277
- rel: "noopener noreferrer",
278
- className: "inline-flex items-center font-medium text-primary hover:underline pointer-coarse:min-h-11",
279
- "data-testid": `signature-certificate-link-${index}`,
280
- children: "View certificate"
281
- }
282
- ) })
283
- ]
284
- },
285
- signature.reference
286
- )),
287
- /* @__PURE__ */ jsx(
288
- "p",
289
- {
290
- className: `border-t border-border pt-2 ${status.intact ? "" : "text-red-text"}`,
291
- "data-testid": "signature-detail-intact",
292
- children: status.intact ? isCounterSigned ? "\u2713 Unchanged since the last signature" : "\u2713 Unchanged since signing" : "\u2717 Changed after it was signed"
293
- }
294
- ),
295
- /* @__PURE__ */ jsx("p", { className: "mt-1 text-xs text-muted-foreground", "data-testid": "signature-detail-locked", children: "Locked: only further signatures can be added." })
296
- ]
297
- }
298
- )
299
- ] });
300
- }
301
- function Frame({ children }) {
302
- return /* @__PURE__ */ jsxs(
303
- "main",
304
- {
305
- className: "mx-auto w-full max-w-xl px-4 py-10 text-foreground",
306
- "data-testid": "signature-certificate",
307
- children: [
308
- /* @__PURE__ */ jsx("h1", { className: "mb-6 text-xl font-semibold", children: "Signature certificate" }),
309
- children
310
- ]
311
- }
312
- );
313
- }
314
- function copyResult(name, match) {
315
- if (match.kind === "current") return `\u2713 ${name} is the signed document, unchanged.`;
316
- if (match.kind === "earlier") {
317
- return `\u2713 ${name}: this is the version signed by ${match.signature.signer_name || "an ARBI user"}.`;
318
- }
319
- return `\u2717 ${name} is not the signed document: it differs from what was signed.`;
320
- }
321
- function SignatureCertificate({
322
- reference,
323
- verification,
324
- isLoading = false,
325
- error,
326
- isErrorTransient = false,
327
- formatDate = formatSignedAt,
328
- allowCopyCheck = true
329
- }) {
330
- const [copy, setCopy] = useState({ state: "idle" });
331
- const [dragging, setDragging] = useState(false);
332
- const input = useRef(null);
333
- if (isLoading) {
334
- return /* @__PURE__ */ jsx(Frame, { children: /* @__PURE__ */ jsx("p", { className: "text-muted-foreground", "data-testid": "signature-certificate-loading", children: "Checking the signature\u2026" }) });
335
- }
336
- if (error || !verification) {
337
- return /* @__PURE__ */ jsx(Frame, { children: /* @__PURE__ */ jsx(
338
- "p",
339
- {
340
- className: isErrorTransient ? "text-muted-foreground" : "text-red-text",
341
- role: isErrorTransient ? "status" : "alert",
342
- "data-testid": "signature-certificate-error",
343
- children: error || "The signature could not be checked."
344
- }
345
- ) });
346
- }
347
- const [first, ...counter] = verification.signatures;
348
- const check = async (file) => {
349
- if (!file) return;
350
- setCopy({ state: "checking", name: file.name });
351
- try {
352
- setCopy({ state: "done", name: file.name, match: await matchSignedCopy(file, verification) });
353
- } catch {
354
- setCopy({ state: "failed", name: file.name });
355
- }
356
- };
357
- const onDrop = (e) => {
358
- e.preventDefault();
359
- setDragging(false);
360
- void check(e.dataTransfer.files[0]);
361
- };
362
- return /* @__PURE__ */ jsxs(Frame, { children: [
363
- /* @__PURE__ */ jsxs("section", { className: "space-y-3", children: [
364
- first && /* @__PURE__ */ jsxs("p", { className: "text-base", "data-testid": "signature-certificate-signer", children: [
365
- "Signed by ",
366
- /* @__PURE__ */ jsx("strong", { children: first.signer_name || "an ARBI user" }),
367
- " on",
368
- " ",
369
- formatDate(first.signed_at)
370
- ] }),
371
- counter.length > 0 && /* @__PURE__ */ jsx("ul", { className: "space-y-1 text-sm", "data-testid": "signature-certificate-counter", children: counter.map((s, i) => /* @__PURE__ */ jsxs("li", { children: [
372
- "Also signed by ",
373
- /* @__PURE__ */ jsx("strong", { children: s.signer_name || "an ARBI user" }),
374
- " on",
375
- " ",
376
- formatDate(s.signed_at)
377
- ] }, `${s.sha256}-${i}`)) }),
378
- /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: "ARBI checks that this document hasn\u2019t changed since it was signed. If anything changed, this check fails." }),
379
- /* @__PURE__ */ jsx(
380
- "p",
381
- {
382
- className: cn(
383
- "rounded-md border px-3 py-2 font-medium",
384
- verification.intact ? "border-green-border bg-green-bg text-green-text" : "border-red-text text-red-text"
385
- ),
386
- role: "status",
387
- "data-testid": "signature-certificate-result",
388
- "data-intact": verification.intact,
389
- children: verification.intact ? "\u2713 Unchanged since signing" : "\u2717 Changed since signing: this is not the document that was signed"
390
- }
391
- )
392
- ] }),
393
- allowCopyCheck && /* @__PURE__ */ jsxs("section", { className: "mt-8 space-y-2", children: [
394
- /* @__PURE__ */ jsx("h2", { className: "text-sm font-medium", children: "Check your copy" }),
395
- /* @__PURE__ */ jsxs(
396
- "div",
397
- {
398
- role: "button",
399
- tabIndex: 0,
400
- className: cn(
401
- "flex min-h-24 cursor-pointer flex-col items-center justify-center rounded-md border border-dashed px-4 py-6 text-center text-sm text-muted-foreground pointer-coarse:min-h-32",
402
- dragging && "border-primary bg-muted"
403
- ),
404
- "data-testid": "signature-certificate-dropzone",
405
- onClick: () => input.current?.click(),
406
- onKeyDown: (e) => {
407
- if (e.key === "Enter" || e.key === " ") {
408
- e.preventDefault();
409
- input.current?.click();
410
- }
411
- },
412
- onDragOver: (e) => {
413
- e.preventDefault();
414
- setDragging(true);
415
- },
416
- onDragLeave: () => setDragging(false),
417
- onDrop,
418
- children: [
419
- "Drop the PDF you were sent here, or choose it",
420
- /* @__PURE__ */ jsx("span", { className: "mt-1 text-xs", children: "It is checked in this browser and never uploaded." }),
421
- /* @__PURE__ */ jsx(
422
- "input",
423
- {
424
- ref: input,
425
- type: "file",
426
- accept: "application/pdf,.pdf",
427
- className: "sr-only",
428
- "data-testid": "signature-certificate-file-input",
429
- onChange: (e) => void check(e.target.files?.[0])
430
- }
431
- )
432
- ]
433
- }
434
- ),
435
- copy.state !== "idle" && /* @__PURE__ */ jsx(
436
- "p",
437
- {
438
- className: cn(
439
- "text-sm",
440
- copy.state === "done" && copy.match.kind !== "none" && "text-green-text",
441
- (copy.state === "done" && copy.match.kind === "none" || copy.state === "failed") && "text-red-text"
442
- ),
443
- role: "status",
444
- "data-testid": "signature-certificate-copy-result",
445
- children: copy.state === "checking" ? `Checking ${copy.name}\u2026` : copy.state === "failed" ? `${copy.name} could not be read.` : copyResult(copy.name, copy.match)
446
- }
447
- )
448
- ] }),
449
- reference && /* @__PURE__ */ jsxs(
450
- "p",
451
- {
452
- className: "mt-8 text-xs text-muted-foreground",
453
- "data-testid": "signature-certificate-reference",
454
- children: [
455
- "Reference ",
456
- reference
457
- ]
458
- }
459
- )
460
- ] });
461
- }
462
- var LINK2 = "font-medium text-primary hover:underline pointer-coarse:min-h-11";
463
- var DEFAULT_VERSION_SNAPSHOT_BAR_LABELS = {
464
- title: (number) => `${number ? `Version ${number}` : "Saved version"} \xB7 read only`,
465
- ask: "Ask about this version",
466
- returnToCurrent: "Return to current version",
467
- returnToLive: "Return to live document"
468
- };
469
- function VersionSnapshotBar({
470
- versionNumber,
471
- live = false,
472
- onAsk,
473
- onReturn,
474
- labels: overrides
475
- }) {
476
- const labels = { ...DEFAULT_VERSION_SNAPSHOT_BAR_LABELS, ...overrides };
477
- return /* @__PURE__ */ jsxs(
478
- "div",
479
- {
480
- className: "flex items-center justify-between border-b px-3 py-2 text-xs",
481
- "data-testid": "version-snapshot-bar",
482
- children: [
483
- /* @__PURE__ */ jsx("span", { children: labels.title(versionNumber) }),
484
- /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-3", children: [
485
- onAsk && /* @__PURE__ */ jsx("button", { type: "button", className: LINK2, "data-testid": "version-snapshot-ask", onClick: onAsk, children: labels.ask }),
486
- /* @__PURE__ */ jsx(
487
- "button",
488
- {
489
- type: "button",
490
- className: LINK2,
491
- "data-testid": "version-snapshot-return",
492
- onClick: onReturn,
493
- children: live ? labels.returnToLive : labels.returnToCurrent
494
- }
495
- )
496
- ] })
497
- ]
498
- }
499
- );
500
- }
501
- function names(request, status) {
502
- return request.signers.filter((s) => s.status === status).map((s) => s.name || s.email || "");
503
- }
504
- function SignatureRequestBanner({
505
- documentId,
506
- onSign,
507
- onEditDraft,
508
- hidden = false
509
- }) {
510
- const { user, notify } = useDocumentTools();
511
- const requests = useDocumentSignatureRequests(documentId, !hidden);
512
- const voidRequest = useVoidSignatureRequest();
513
- const me = user?.externalId ?? null;
514
- if (hidden || !me || !requests.data) return null;
515
- const open = requests.data.filter((r) => r.status === "sent" || r.status === "draft");
516
- const awaitingMe = open.filter(
517
- (r) => r.status === "sent" && r.signers.some((s) => s.user_ext_id === me && s.status === "pending")
518
- );
519
- const sentByMe = open.filter(
520
- (r) => r.status === "sent" && r.created_by === me && !awaitingMe.includes(r)
521
- );
522
- const drafts = open.filter((r) => r.status === "draft" && r.created_by === me);
523
- if (awaitingMe.length + sentByMe.length + drafts.length === 0) return null;
524
- const doVoid = async (request) => {
525
- try {
526
- await voidRequest.mutateAsync(request.external_id);
527
- notify(request.status === "draft" ? "Draft discarded." : "Signature request voided.", "info");
528
- } catch (err) {
529
- notify(err instanceof Error ? err.message : "Could not void it", "error");
530
- }
531
- };
532
- return /* @__PURE__ */ jsxs(
533
- "div",
534
- {
535
- className: "space-y-1.5 border-b border-border px-3 py-2 text-sm",
536
- "data-testid": "signature-request-banner",
537
- children: [
538
- awaitingMe.map((r) => {
539
- const count = r.fields.filter((f) => f.signer === me).length;
540
- const author = r.signers.find((s) => s.user_ext_id === r.created_by)?.name;
541
- return /* @__PURE__ */ jsxs(
542
- "div",
543
- {
544
- className: "flex flex-wrap items-center gap-2 rounded-md bg-blue-50 px-2 py-1.5 text-blue-950 dark:bg-blue-950/40 dark:text-blue-100",
545
- "data-testid": "signature-request-awaiting-me",
546
- children: [
547
- /* @__PURE__ */ jsx(PenLine, { className: "size-4 shrink-0", "aria-hidden": true }),
548
- /* @__PURE__ */ jsxs("span", { className: "mr-auto", children: [
549
- author && r.created_by !== me ? `${author} asked you to sign` : "You are asked to sign",
550
- " ",
551
- count,
552
- " field",
553
- count === 1 ? "" : "s",
554
- " in this document.",
555
- r.stale && " It has changed since it was sent: ask for it again."
556
- ] }),
557
- /* @__PURE__ */ jsx(
558
- Button,
559
- {
560
- type: "button",
561
- size: "sm",
562
- onClick: () => onSign(r),
563
- disabled: r.stale,
564
- "data-testid": "signature-request-start",
565
- children: "Review and sign"
566
- }
567
- )
568
- ]
569
- },
570
- r.external_id
571
- );
572
- }),
573
- sentByMe.map((r) => {
574
- const pending = names(r, "pending");
575
- const signed = r.signers.length - pending.length;
576
- return /* @__PURE__ */ jsxs(
577
- "div",
578
- {
579
- className: "flex flex-wrap items-center gap-2",
580
- "data-testid": "signature-request-sent",
581
- children: [
582
- /* @__PURE__ */ jsx(Send, { className: "size-4 shrink-0 text-muted-foreground", "aria-hidden": true }),
583
- /* @__PURE__ */ jsxs("span", { className: "mr-auto", children: [
584
- "Out for signature: ",
585
- signed,
586
- " of ",
587
- r.signers.length,
588
- " signed",
589
- pending.length > 0 && /* @__PURE__ */ jsxs("span", { className: "text-muted-foreground", children: [
590
- " \xB7 waiting for ",
591
- pending.join(", ")
592
- ] }),
593
- r.stale && /* @__PURE__ */ jsx("span", { className: "text-red-text", children: " \xB7 the document has changed since it was sent" })
594
- ] }),
595
- /* @__PURE__ */ jsx(
596
- Button,
597
- {
598
- type: "button",
599
- size: "sm",
600
- variant: "ghost",
601
- onClick: () => doVoid(r),
602
- disabled: voidRequest.isPending,
603
- children: "Void"
604
- }
605
- )
606
- ]
607
- },
608
- r.external_id
609
- );
610
- }),
611
- drafts.map((r) => /* @__PURE__ */ jsxs(
612
- "div",
613
- {
614
- className: "flex flex-wrap items-center gap-2",
615
- "data-testid": "signature-request-draft",
616
- children: [
617
- /* @__PURE__ */ jsx(FilePenLine, { className: "size-4 shrink-0 text-muted-foreground", "aria-hidden": true }),
618
- /* @__PURE__ */ jsxs("span", { className: "mr-auto", children: [
619
- "Draft signature request: ",
620
- r.fields.length,
621
- " field",
622
- r.fields.length === 1 ? "" : "s",
623
- ", not sent yet."
624
- ] }),
625
- /* @__PURE__ */ jsx(Button, { type: "button", size: "sm", variant: "outline", onClick: () => onEditDraft(r), children: "Continue" }),
626
- /* @__PURE__ */ jsx(
627
- Button,
628
- {
629
- type: "button",
630
- size: "sm",
631
- variant: "ghost",
632
- onClick: () => doVoid(r),
633
- disabled: voidRequest.isPending,
634
- children: "Discard"
635
- }
636
- )
637
- ]
638
- },
639
- r.external_id
640
- ))
641
- ]
642
- }
643
- );
644
- }
645
-
646
- export { AnnotateButton, DEFAULT_VERSION_SNAPSHOT_BAR_LABELS, DownloadMarkupButton, MarkupNotices, MarkupViewNote, RequestSignaturesButton, ShowOriginalButton, SignButton, SignatureCertificate, SignatureRequestBanner, SignatureStatus, SignedEditNote, VersionSnapshotBar, formatSignedAt };
647
8
  //# sourceMappingURL=index.js.map
648
9
  //# sourceMappingURL=index.js.map