@verdocs/web-sdk 2.3.14 → 2.3.16

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 (364) hide show
  1. package/dist/cjs/{EnvelopeStore-f8c301e1.js → EnvelopeStore-efc35530.js} +1 -1
  2. package/dist/cjs/{Envelopes-99ca79fe.js → Envelopes-0b9deb2c.js} +2 -6
  3. package/dist/cjs/{Profiles-54271244.js → Profiles-1a26e4eb.js} +0 -34
  4. package/dist/cjs/TemplateFieldStore-7449e5ff.js +24 -0
  5. package/dist/cjs/{TemplateStore-d9936a68.js → TemplateStore-0074c71d.js} +3 -1
  6. package/dist/cjs/{Types-ee5afdf8.js → Types-fb95ed6b.js} +2 -1
  7. package/dist/cjs/{VerdocsEndpoint-2d85658d.js → VerdocsEndpoint-8f298664.js} +197 -563
  8. package/dist/cjs/{_commonjsHelpers-0c557e26.js → _commonjsHelpers-1fbbf0eb.js} +0 -5
  9. package/dist/cjs/interact.min-a61b43b3.js +12 -0
  10. package/dist/cjs/ipc-test.cjs.entry.js +3 -2
  11. package/dist/cjs/loader.cjs.js +1 -1
  12. package/dist/cjs/{utils-2ddfdf9e.js → utils-0916d10f.js} +3 -3
  13. package/dist/cjs/verdocs-activity-box.cjs.entry.js +2 -2
  14. package/dist/cjs/verdocs-auth.cjs.entry.js +8 -34
  15. package/dist/cjs/verdocs-build.cjs.entry.js +3 -2
  16. package/dist/cjs/verdocs-button-panel_2.cjs.entry.js +71 -45
  17. package/dist/cjs/{verdocs-contact-picker_2.cjs.entry.js → verdocs-contact-picker_3.cjs.entry.js} +78 -6
  18. package/dist/cjs/verdocs-envelope-document-page.cjs.entry.js +5 -5
  19. package/dist/cjs/verdocs-envelope-recipient-link_2.cjs.entry.js +3 -3
  20. package/dist/cjs/verdocs-envelope-sidebar.cjs.entry.js +5 -4
  21. package/dist/cjs/verdocs-envelopes-list.cjs.entry.js +5 -5
  22. package/dist/cjs/verdocs-field-attachment.cjs.entry.js +4 -4
  23. package/dist/cjs/verdocs-field-checkbox.cjs.entry.js +4 -4
  24. package/dist/cjs/verdocs-field-date.cjs.entry.js +5 -5
  25. package/dist/cjs/verdocs-field-dropdown.cjs.entry.js +4 -5
  26. package/dist/cjs/verdocs-field-initial.cjs.entry.js +4 -4
  27. package/dist/cjs/verdocs-field-payment.cjs.entry.js +4 -4
  28. package/dist/cjs/verdocs-field-radio-button.cjs.entry.js +4 -4
  29. package/dist/cjs/verdocs-field-signature.cjs.entry.js +4 -4
  30. package/dist/cjs/verdocs-field-textarea.cjs.entry.js +10 -9
  31. package/dist/cjs/verdocs-field-textbox.cjs.entry.js +19 -10
  32. package/dist/cjs/verdocs-field-timestamp.cjs.entry.js +5 -5
  33. package/dist/cjs/verdocs-file-chooser_2.cjs.entry.js +1 -1
  34. package/dist/cjs/verdocs-ok-dialog.cjs.entry.js +2 -1
  35. package/dist/cjs/verdocs-pagination_2.cjs.entry.js +4 -4
  36. package/dist/cjs/verdocs-preview_8.cjs.entry.js +10 -8
  37. package/dist/cjs/verdocs-quick-functions_2.cjs.entry.js +79 -0
  38. package/dist/cjs/verdocs-search.cjs.entry.js +1 -1
  39. package/dist/cjs/verdocs-settings-api-keys_4.cjs.entry.js +70 -37
  40. package/dist/cjs/verdocs-settings.cjs.entry.js +1 -1
  41. package/dist/cjs/verdocs-sign.cjs.entry.js +12 -9
  42. package/dist/cjs/verdocs-template-document-page_2.cjs.entry.js +5 -5
  43. package/dist/cjs/verdocs-template-fields_4.cjs.entry.js +92 -80
  44. package/dist/cjs/verdocs-template-star.cjs.entry.js +1 -1
  45. package/dist/cjs/verdocs-templates-list.cjs.entry.js +1 -1
  46. package/dist/cjs/verdocs-view.cjs.entry.js +5 -5
  47. package/dist/cjs/verdocs-web-sdk.cjs.js +1 -1
  48. package/dist/collection/collection-manifest.json +1 -1
  49. package/dist/collection/components/controls/verdocs-portal/verdocs-portal.css +0 -0
  50. package/dist/collection/components/controls/verdocs-portal/verdocs-portal.js +181 -0
  51. package/dist/collection/components/controls/verdocs-portal/verdocs-portal.stories.js +20 -0
  52. package/dist/collection/components/dialogs/verdocs-ok-dialog/verdocs-ok-dialog.js +20 -1
  53. package/dist/collection/components/embeds/verdocs-auth/verdocs-auth.js +6 -34
  54. package/dist/collection/components/embeds/verdocs-send/verdocs-send.js +2 -1
  55. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js +8 -4
  56. package/dist/collection/components/envelopes/verdocs-contact-picker/verdocs-contact-picker.css +4 -1
  57. package/dist/collection/components/envelopes/verdocs-envelope-sidebar/verdocs-envelope-sidebar.js +1 -0
  58. package/dist/collection/components/fields/verdocs-field-date/verdocs-field-date.css +1 -0
  59. package/dist/collection/components/fields/verdocs-field-dropdown/verdocs-field-dropdown.js +0 -1
  60. package/dist/collection/components/fields/verdocs-field-textarea/verdocs-field-textarea.js +2 -1
  61. package/dist/collection/components/fields/verdocs-field-textbox/verdocs-field-textbox.css +1 -1
  62. package/dist/collection/components/fields/verdocs-field-textbox/verdocs-field-textbox.js +27 -1
  63. package/dist/collection/components/fields/verdocs-field-timestamp/verdocs-field-timestamp.css +1 -0
  64. package/dist/collection/components/templates/verdocs-template-create/verdocs-template-create.js +2 -2
  65. package/dist/collection/components/templates/verdocs-template-field-properties/verdocs-template-field-properties.js +71 -44
  66. package/dist/collection/components/templates/verdocs-template-fields/verdocs-template-fields.js +80 -68
  67. package/dist/collection/utils/TemplateFieldStore.js +18 -0
  68. package/dist/collection/utils/TemplateStore.js +2 -0
  69. package/dist/collection/utils/Types.js +2 -1
  70. package/dist/components/Envelopes.js +2 -6
  71. package/dist/components/TemplateStore.js +21 -2
  72. package/dist/components/Types2.js +2 -1
  73. package/dist/components/VerdocsEndpoint.js +197 -562
  74. package/dist/components/_commonjsHelpers.js +1 -5
  75. package/dist/components/index.d.ts +1 -1
  76. package/dist/components/index.js +1 -1
  77. package/dist/components/index3.js +40 -29
  78. package/dist/components/interact.min.js +5 -6
  79. package/dist/components/verdocs-auth.js +12 -46
  80. package/dist/components/verdocs-build.js +22 -16
  81. package/dist/components/verdocs-contact-picker2.js +1 -1
  82. package/dist/components/verdocs-envelope-sidebar.js +1 -0
  83. package/dist/components/verdocs-field-date.js +1 -1
  84. package/dist/components/verdocs-field-dropdown.js +0 -1
  85. package/dist/components/verdocs-field-textarea.js +5 -4
  86. package/dist/components/verdocs-field-textbox.js +14 -5
  87. package/dist/components/verdocs-field-timestamp.js +1 -1
  88. package/dist/components/verdocs-ok-dialog2.js +3 -1
  89. package/dist/components/verdocs-portal.d.ts +11 -0
  90. package/dist/components/verdocs-portal.js +6 -0
  91. package/dist/components/verdocs-portal2.js +93 -0
  92. package/dist/components/verdocs-preview2.js +1 -1
  93. package/dist/components/verdocs-search.js +2 -8
  94. package/dist/components/verdocs-send2.js +12 -5
  95. package/dist/components/verdocs-settings-organization2.js +22 -1
  96. package/dist/components/verdocs-sign.js +8 -4
  97. package/dist/components/verdocs-template-create2.js +2 -2
  98. package/dist/components/verdocs-template-field-properties2.js +71 -45
  99. package/dist/components/verdocs-template-fields2.js +83 -72
  100. package/dist/components/verdocs-template-roles2.js +4 -4
  101. package/dist/docs.json +156 -108
  102. package/dist/esm/{EnvelopeStore-15cc99ef.js → EnvelopeStore-17c0bc52.js} +1 -1
  103. package/dist/esm/{Envelopes-21ffb899.js → Envelopes-627c5239.js} +2 -6
  104. package/dist/esm/{Profiles-4cc942ef.js → Profiles-d4df4d1c.js} +1 -32
  105. package/dist/esm/TemplateFieldStore-4f1b6332.js +21 -0
  106. package/dist/esm/{TemplateStore-018fc1db.js → TemplateStore-a2ebdaca.js} +3 -1
  107. package/dist/esm/Types-1628dc71.js +5 -0
  108. package/dist/esm/{VerdocsEndpoint-b011af25.js → VerdocsEndpoint-56fa3371.js} +197 -562
  109. package/dist/esm/{_commonjsHelpers-5ec8f9b7.js → _commonjsHelpers-8a9f3b18.js} +1 -5
  110. package/dist/esm/interact.min-6a7b19a1.js +10 -0
  111. package/dist/esm/ipc-test.entry.js +3 -2
  112. package/dist/esm/loader.js +1 -1
  113. package/dist/esm/{utils-d269cea3.js → utils-ca3121df.js} +3 -3
  114. package/dist/esm/verdocs-activity-box.entry.js +2 -2
  115. package/dist/esm/verdocs-auth.entry.js +8 -34
  116. package/dist/esm/verdocs-build.entry.js +3 -2
  117. package/dist/esm/verdocs-button-panel_2.entry.js +71 -45
  118. package/dist/esm/{verdocs-contact-picker_2.entry.js → verdocs-contact-picker_3.entry.js} +78 -7
  119. package/dist/esm/verdocs-envelope-document-page.entry.js +5 -5
  120. package/dist/esm/verdocs-envelope-recipient-link_2.entry.js +3 -3
  121. package/dist/esm/verdocs-envelope-sidebar.entry.js +5 -4
  122. package/dist/esm/verdocs-envelopes-list.entry.js +5 -5
  123. package/dist/esm/verdocs-field-attachment.entry.js +4 -4
  124. package/dist/esm/verdocs-field-checkbox.entry.js +4 -4
  125. package/dist/esm/verdocs-field-date.entry.js +5 -5
  126. package/dist/esm/verdocs-field-dropdown.entry.js +4 -5
  127. package/dist/esm/verdocs-field-initial.entry.js +4 -4
  128. package/dist/esm/verdocs-field-payment.entry.js +4 -4
  129. package/dist/esm/verdocs-field-radio-button.entry.js +4 -4
  130. package/dist/esm/verdocs-field-signature.entry.js +4 -4
  131. package/dist/esm/verdocs-field-textarea.entry.js +10 -9
  132. package/dist/esm/verdocs-field-textbox.entry.js +19 -10
  133. package/dist/esm/verdocs-field-timestamp.entry.js +5 -5
  134. package/dist/esm/verdocs-file-chooser_2.entry.js +1 -1
  135. package/dist/esm/verdocs-ok-dialog.entry.js +2 -1
  136. package/dist/esm/verdocs-pagination_2.entry.js +4 -4
  137. package/dist/esm/verdocs-preview_8.entry.js +10 -8
  138. package/dist/esm/verdocs-quick-functions_2.entry.js +74 -0
  139. package/dist/esm/verdocs-search.entry.js +1 -1
  140. package/dist/esm/verdocs-settings-api-keys_4.entry.js +68 -35
  141. package/dist/esm/verdocs-settings.entry.js +1 -1
  142. package/dist/esm/verdocs-sign.entry.js +12 -9
  143. package/dist/esm/verdocs-template-document-page_2.entry.js +5 -5
  144. package/dist/esm/verdocs-template-fields_4.entry.js +92 -80
  145. package/dist/esm/verdocs-template-star.entry.js +1 -1
  146. package/dist/esm/verdocs-templates-list.entry.js +1 -1
  147. package/dist/esm/verdocs-view.entry.js +5 -5
  148. package/dist/esm/verdocs-web-sdk.js +1 -1
  149. package/dist/esm-es5/{EnvelopeStore-15cc99ef.js → EnvelopeStore-17c0bc52.js} +1 -1
  150. package/dist/esm-es5/Envelopes-627c5239.js +1 -0
  151. package/dist/esm-es5/Profiles-d4df4d1c.js +1 -0
  152. package/dist/esm-es5/TemplateFieldStore-4f1b6332.js +1 -0
  153. package/dist/esm-es5/TemplateStore-a2ebdaca.js +1 -0
  154. package/dist/esm-es5/Types-1628dc71.js +1 -0
  155. package/dist/esm-es5/VerdocsEndpoint-56fa3371.js +1 -0
  156. package/dist/esm-es5/_commonjsHelpers-8a9f3b18.js +1 -0
  157. package/dist/esm-es5/interact.min-6a7b19a1.js +1 -0
  158. package/dist/esm-es5/ipc-test.entry.js +1 -1
  159. package/dist/esm-es5/loader.js +1 -1
  160. package/dist/esm-es5/{utils-d269cea3.js → utils-ca3121df.js} +2 -2
  161. package/dist/esm-es5/verdocs-activity-box.entry.js +1 -1
  162. package/dist/esm-es5/verdocs-auth.entry.js +1 -1
  163. package/dist/esm-es5/verdocs-build.entry.js +1 -1
  164. package/dist/esm-es5/verdocs-button-panel_2.entry.js +1 -1
  165. package/dist/esm-es5/verdocs-contact-picker_3.entry.js +1 -0
  166. package/dist/esm-es5/verdocs-envelope-document-page.entry.js +1 -1
  167. package/dist/esm-es5/verdocs-envelope-recipient-link_2.entry.js +1 -1
  168. package/dist/esm-es5/verdocs-envelope-sidebar.entry.js +1 -1
  169. package/dist/esm-es5/verdocs-envelopes-list.entry.js +1 -1
  170. package/dist/esm-es5/verdocs-field-attachment.entry.js +1 -1
  171. package/dist/esm-es5/verdocs-field-checkbox.entry.js +1 -1
  172. package/dist/esm-es5/verdocs-field-date.entry.js +1 -1
  173. package/dist/esm-es5/verdocs-field-dropdown.entry.js +1 -1
  174. package/dist/esm-es5/verdocs-field-initial.entry.js +1 -1
  175. package/dist/esm-es5/verdocs-field-payment.entry.js +1 -1
  176. package/dist/esm-es5/verdocs-field-radio-button.entry.js +1 -1
  177. package/dist/esm-es5/verdocs-field-signature.entry.js +1 -1
  178. package/dist/esm-es5/verdocs-field-textarea.entry.js +1 -1
  179. package/dist/esm-es5/verdocs-field-textbox.entry.js +1 -1
  180. package/dist/esm-es5/verdocs-field-timestamp.entry.js +1 -1
  181. package/dist/esm-es5/verdocs-file-chooser_2.entry.js +1 -1
  182. package/dist/esm-es5/verdocs-ok-dialog.entry.js +1 -1
  183. package/dist/esm-es5/verdocs-pagination_2.entry.js +1 -1
  184. package/dist/esm-es5/verdocs-preview_8.entry.js +1 -1
  185. package/dist/esm-es5/verdocs-quick-functions_2.entry.js +1 -0
  186. package/dist/esm-es5/verdocs-search.entry.js +1 -1
  187. package/dist/esm-es5/verdocs-settings-api-keys_4.entry.js +1 -1
  188. package/dist/esm-es5/verdocs-settings.entry.js +1 -1
  189. package/dist/esm-es5/verdocs-sign.entry.js +1 -1
  190. package/dist/esm-es5/verdocs-template-document-page_2.entry.js +1 -1
  191. package/dist/esm-es5/verdocs-template-fields_4.entry.js +1 -1
  192. package/dist/esm-es5/verdocs-template-star.entry.js +1 -1
  193. package/dist/esm-es5/verdocs-templates-list.entry.js +1 -1
  194. package/dist/esm-es5/verdocs-view.entry.js +1 -1
  195. package/dist/esm-es5/verdocs-web-sdk.js +1 -1
  196. package/dist/types/components/controls/verdocs-portal/verdocs-portal.d.ts +37 -0
  197. package/dist/types/components/{elements/verdocs-search-activity/verdocs-search-activity.stories.d.ts → controls/verdocs-portal/verdocs-portal.stories.d.ts} +3 -6
  198. package/dist/types/components/dialogs/verdocs-ok-dialog/verdocs-ok-dialog.d.ts +4 -0
  199. package/dist/types/components/embeds/verdocs-auth/verdocs-auth.d.ts +0 -2
  200. package/dist/types/components/embeds/verdocs-sign/verdocs-sign.d.ts +1 -0
  201. package/dist/types/components/fields/verdocs-field-textbox/verdocs-field-textbox.d.ts +7 -0
  202. package/dist/types/components/templates/verdocs-template-field-properties/verdocs-template-field-properties.d.ts +8 -5
  203. package/dist/types/components/templates/verdocs-template-fields/verdocs-template-fields.d.ts +4 -2
  204. package/dist/types/components.d.ts +58 -34
  205. package/dist/types/utils/TemplateFieldStore.d.ts +6 -0
  206. package/dist/types/utils/TemplateStore.d.ts +1 -1
  207. package/dist/types/utils/Types.d.ts +1 -1
  208. package/dist/types/utils/utils.d.ts +2 -2
  209. package/dist/verdocs-web-sdk/{p-a35314fe.js → p-02a71e03.js} +1 -1
  210. package/dist/verdocs-web-sdk/{p-7805f0e0.entry.js → p-035a3ce2.entry.js} +1 -1
  211. package/dist/verdocs-web-sdk/p-035f6b38.js +1 -0
  212. package/dist/verdocs-web-sdk/{p-1406ffd2.entry.js → p-05e6bc91.entry.js} +1 -1
  213. package/dist/verdocs-web-sdk/{p-10af7aec.system.entry.js → p-0685d939.system.entry.js} +1 -1
  214. package/dist/verdocs-web-sdk/p-084c23e4.system.js +1 -0
  215. package/dist/verdocs-web-sdk/p-0abf0058.system.entry.js +1 -0
  216. package/dist/verdocs-web-sdk/p-12d00a0f.entry.js +1 -0
  217. package/dist/verdocs-web-sdk/p-17598002.system.entry.js +1 -0
  218. package/dist/verdocs-web-sdk/{p-04d7d759.system.entry.js → p-17bf98f2.system.entry.js} +1 -1
  219. package/dist/verdocs-web-sdk/p-1a7aa04b.entry.js +1 -0
  220. package/dist/verdocs-web-sdk/p-1ba9f457.system.js +1 -0
  221. package/dist/verdocs-web-sdk/{p-2f04fb38.system.entry.js → p-1cb878c8.system.entry.js} +1 -1
  222. package/dist/verdocs-web-sdk/{p-261d376e.system.entry.js → p-1e38b22f.system.entry.js} +1 -1
  223. package/dist/verdocs-web-sdk/{p-ebc4142c.js → p-1f78be32.js} +1 -1
  224. package/dist/verdocs-web-sdk/p-22e0d2bc.entry.js +1 -0
  225. package/dist/verdocs-web-sdk/{p-4f439363.entry.js → p-2ccbf54d.entry.js} +1 -1
  226. package/dist/verdocs-web-sdk/p-319c00bd.entry.js +1 -0
  227. package/dist/verdocs-web-sdk/p-32c40388.entry.js +1 -0
  228. package/dist/verdocs-web-sdk/p-358aef29.entry.js +1 -0
  229. package/dist/verdocs-web-sdk/{p-77abc3ce.entry.js → p-37dfdc84.entry.js} +1 -1
  230. package/dist/verdocs-web-sdk/p-3cd0d440.system.entry.js +1 -0
  231. package/dist/verdocs-web-sdk/p-3e607686.js +1 -0
  232. package/dist/verdocs-web-sdk/{p-a171983b.system.entry.js → p-3f3807b0.system.entry.js} +1 -1
  233. package/dist/verdocs-web-sdk/{p-8da1555a.entry.js → p-410c63e6.entry.js} +1 -1
  234. package/dist/verdocs-web-sdk/p-429cad70.js +1 -0
  235. package/dist/verdocs-web-sdk/{p-3a702f79.entry.js → p-46624bec.entry.js} +1 -1
  236. package/dist/verdocs-web-sdk/{p-a0b02d83.system.entry.js → p-4d98f194.system.entry.js} +1 -1
  237. package/dist/verdocs-web-sdk/{p-af3e9624.entry.js → p-4e47ed1c.entry.js} +1 -1
  238. package/dist/verdocs-web-sdk/p-4e74bb3c.entry.js +1 -0
  239. package/dist/verdocs-web-sdk/p-588d6cea.system.entry.js +1 -0
  240. package/dist/verdocs-web-sdk/{p-e3a9d167.system.entry.js → p-59769c39.system.entry.js} +1 -1
  241. package/dist/verdocs-web-sdk/{p-126ba5d2.system.entry.js → p-5aa77f6d.system.entry.js} +1 -1
  242. package/dist/verdocs-web-sdk/p-5bf12ef8.entry.js +1 -0
  243. package/dist/verdocs-web-sdk/{p-39cbfe15.entry.js → p-6331d113.entry.js} +1 -1
  244. package/dist/verdocs-web-sdk/{p-9b07a2a7.entry.js → p-637187de.entry.js} +1 -1
  245. package/dist/verdocs-web-sdk/{p-df6a373e.system.entry.js → p-6685ff29.system.entry.js} +1 -1
  246. package/dist/verdocs-web-sdk/p-6dd69d82.system.entry.js +1 -0
  247. package/dist/verdocs-web-sdk/p-72978ba3.system.entry.js +1 -0
  248. package/dist/verdocs-web-sdk/p-736fbb87.system.entry.js +1 -0
  249. package/dist/verdocs-web-sdk/p-76f8c30a.entry.js +1 -0
  250. package/dist/verdocs-web-sdk/p-7b30c523.system.entry.js +1 -0
  251. package/dist/verdocs-web-sdk/p-7d5dbd9a.js +1 -0
  252. package/dist/verdocs-web-sdk/{p-eef694e8.entry.js → p-82d4afbf.entry.js} +1 -1
  253. package/dist/verdocs-web-sdk/p-839f6f0d.js +1 -0
  254. package/dist/verdocs-web-sdk/{p-c694cf93.system.js → p-840827b7.system.js} +1 -1
  255. package/dist/verdocs-web-sdk/{p-62f090c7.system.entry.js → p-870707e8.system.entry.js} +1 -1
  256. package/dist/verdocs-web-sdk/p-8aae8d16.system.js +1 -0
  257. package/dist/verdocs-web-sdk/{p-14aefeb2.system.entry.js → p-8af68516.system.entry.js} +1 -1
  258. package/dist/verdocs-web-sdk/{p-ace35be6.entry.js → p-8b0a5309.entry.js} +1 -1
  259. package/dist/verdocs-web-sdk/p-8dc15d33.js +1 -0
  260. package/dist/verdocs-web-sdk/p-915883e6.js +1 -0
  261. package/dist/verdocs-web-sdk/{p-aa51514f.system.entry.js → p-9360b085.system.entry.js} +1 -1
  262. package/dist/verdocs-web-sdk/{p-a310f65b.entry.js → p-94009f45.entry.js} +1 -1
  263. package/dist/verdocs-web-sdk/{p-7e8d64fb.system.js → p-9615b087.system.js} +1 -1
  264. package/dist/verdocs-web-sdk/p-9bf2d124.system.js +1 -0
  265. package/dist/verdocs-web-sdk/{p-5c50a778.system.entry.js → p-9ceff040.system.entry.js} +1 -1
  266. package/dist/verdocs-web-sdk/p-9fc06f7b.entry.js +1 -0
  267. package/dist/verdocs-web-sdk/{p-0df58c57.entry.js → p-a40b3946.entry.js} +1 -1
  268. package/dist/verdocs-web-sdk/p-a627881e.system.js +1 -0
  269. package/dist/verdocs-web-sdk/p-aae6b4e0.entry.js +1 -0
  270. package/dist/verdocs-web-sdk/{p-35769d0c.system.entry.js → p-ac98f6f1.system.entry.js} +1 -1
  271. package/dist/verdocs-web-sdk/{p-bd0bc3dd.system.entry.js → p-acc873cf.system.entry.js} +1 -1
  272. package/dist/verdocs-web-sdk/{p-50ac71f3.system.entry.js → p-b6231fd3.system.entry.js} +1 -1
  273. package/dist/verdocs-web-sdk/{p-609c7fab.system.entry.js → p-b648ab63.system.entry.js} +1 -1
  274. package/dist/verdocs-web-sdk/{p-a52a832b.system.entry.js → p-b7a815e9.system.entry.js} +1 -1
  275. package/dist/verdocs-web-sdk/p-b91de346.entry.js +1 -0
  276. package/dist/verdocs-web-sdk/{p-0e5449d1.system.entry.js → p-ba653c39.system.entry.js} +1 -1
  277. package/dist/verdocs-web-sdk/p-bd9ba3b3.system.entry.js +1 -0
  278. package/dist/verdocs-web-sdk/{p-3abfff14.entry.js → p-c80237f9.entry.js} +1 -1
  279. package/dist/verdocs-web-sdk/p-cd20fb77.system.js +1 -0
  280. package/dist/verdocs-web-sdk/{p-6bda7dce.entry.js → p-cf703fe4.entry.js} +1 -1
  281. package/dist/verdocs-web-sdk/p-d0a09719.entry.js +1 -0
  282. package/dist/verdocs-web-sdk/{p-013d1556.system.entry.js → p-d1ea580b.system.entry.js} +1 -1
  283. package/dist/verdocs-web-sdk/{p-37187046.system.entry.js → p-d39e4a26.system.entry.js} +1 -1
  284. package/dist/verdocs-web-sdk/{p-137cedc8.entry.js → p-d59b6988.entry.js} +1 -1
  285. package/dist/verdocs-web-sdk/p-d61fda4b.entry.js +1 -0
  286. package/dist/verdocs-web-sdk/p-d8cd6b59.system.js +1 -0
  287. package/dist/verdocs-web-sdk/{p-b73415c3.system.entry.js → p-d99a05e4.system.entry.js} +1 -1
  288. package/dist/verdocs-web-sdk/p-dc2ad047.js +1 -0
  289. package/dist/verdocs-web-sdk/{p-0f94d635.entry.js → p-dd2c2edc.entry.js} +1 -1
  290. package/dist/verdocs-web-sdk/{p-79dc4f76.entry.js → p-e1bc55f8.entry.js} +1 -1
  291. package/dist/verdocs-web-sdk/p-e28878eb.system.entry.js +1 -0
  292. package/dist/verdocs-web-sdk/p-e2ae3679.entry.js +1 -0
  293. package/dist/verdocs-web-sdk/p-e2ff37fb.system.js +1 -0
  294. package/dist/verdocs-web-sdk/p-e3ffc00f.system.entry.js +1 -0
  295. package/dist/verdocs-web-sdk/p-e4dc3264.system.entry.js +1 -0
  296. package/dist/verdocs-web-sdk/{p-cf765153.entry.js → p-eeca4c30.entry.js} +1 -1
  297. package/dist/verdocs-web-sdk/p-f04bf956.system.js +1 -1
  298. package/dist/verdocs-web-sdk/{p-3f9fbf94.entry.js → p-f42c84f1.entry.js} +1 -1
  299. package/dist/verdocs-web-sdk/{p-dd8845d4.system.entry.js → p-f6b7439f.system.entry.js} +1 -1
  300. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  301. package/package.json +8 -7
  302. package/dist/cjs/interact.min-ba5cc513.js +0 -13
  303. package/dist/cjs/verdocs-quick-functions_3.cjs.entry.js +0 -220
  304. package/dist/collection/components/elements/verdocs-search-activity/verdocs-search-activity.css +0 -66
  305. package/dist/collection/components/elements/verdocs-search-activity/verdocs-search-activity.js +0 -187
  306. package/dist/collection/components/elements/verdocs-search-activity/verdocs-search-activity.stories.js +0 -14
  307. package/dist/components/Organizations.js +0 -32
  308. package/dist/components/verdocs-search-activity.d.ts +0 -11
  309. package/dist/components/verdocs-search-activity.js +0 -6
  310. package/dist/components/verdocs-search-activity2.js +0 -170
  311. package/dist/esm/Types-de18e225.js +0 -4
  312. package/dist/esm/interact.min-cf83fa88.js +0 -11
  313. package/dist/esm/verdocs-quick-functions_3.entry.js +0 -214
  314. package/dist/esm-es5/Envelopes-21ffb899.js +0 -1
  315. package/dist/esm-es5/Profiles-4cc942ef.js +0 -1
  316. package/dist/esm-es5/TemplateStore-018fc1db.js +0 -1
  317. package/dist/esm-es5/Types-de18e225.js +0 -1
  318. package/dist/esm-es5/VerdocsEndpoint-b011af25.js +0 -1
  319. package/dist/esm-es5/_commonjsHelpers-5ec8f9b7.js +0 -1
  320. package/dist/esm-es5/interact.min-cf83fa88.js +0 -1
  321. package/dist/esm-es5/verdocs-contact-picker_2.entry.js +0 -1
  322. package/dist/esm-es5/verdocs-quick-functions_3.entry.js +0 -1
  323. package/dist/types/components/elements/verdocs-search-activity/verdocs-search-activity.d.ts +0 -33
  324. package/dist/verdocs-web-sdk/p-01166179.system.entry.js +0 -1
  325. package/dist/verdocs-web-sdk/p-04580be0.entry.js +0 -1
  326. package/dist/verdocs-web-sdk/p-0ad1fd33.entry.js +0 -1
  327. package/dist/verdocs-web-sdk/p-0d28cf05.js +0 -1
  328. package/dist/verdocs-web-sdk/p-15cb963a.system.entry.js +0 -1
  329. package/dist/verdocs-web-sdk/p-17d0e5f4.entry.js +0 -1
  330. package/dist/verdocs-web-sdk/p-23be436b.entry.js +0 -1
  331. package/dist/verdocs-web-sdk/p-2ccbcfeb.system.js +0 -1
  332. package/dist/verdocs-web-sdk/p-30b4bd45.js +0 -1
  333. package/dist/verdocs-web-sdk/p-3305a941.system.js +0 -1
  334. package/dist/verdocs-web-sdk/p-343672f5.system.entry.js +0 -1
  335. package/dist/verdocs-web-sdk/p-409e992a.entry.js +0 -1
  336. package/dist/verdocs-web-sdk/p-4a94ee00.system.entry.js +0 -1
  337. package/dist/verdocs-web-sdk/p-51756c1b.system.entry.js +0 -1
  338. package/dist/verdocs-web-sdk/p-5a91bf23.js +0 -1
  339. package/dist/verdocs-web-sdk/p-5df0fa7a.system.entry.js +0 -1
  340. package/dist/verdocs-web-sdk/p-6307e6ae.entry.js +0 -1
  341. package/dist/verdocs-web-sdk/p-66d66e2b.entry.js +0 -1
  342. package/dist/verdocs-web-sdk/p-76907130.entry.js +0 -1
  343. package/dist/verdocs-web-sdk/p-7b63017c.js +0 -1
  344. package/dist/verdocs-web-sdk/p-7fd7152d.system.js +0 -1
  345. package/dist/verdocs-web-sdk/p-89aa696c.system.entry.js +0 -1
  346. package/dist/verdocs-web-sdk/p-961708ac.entry.js +0 -1
  347. package/dist/verdocs-web-sdk/p-983da2f6.js +0 -1
  348. package/dist/verdocs-web-sdk/p-9934f3ec.system.entry.js +0 -1
  349. package/dist/verdocs-web-sdk/p-a5425a9b.entry.js +0 -1
  350. package/dist/verdocs-web-sdk/p-b17a20b8.entry.js +0 -1
  351. package/dist/verdocs-web-sdk/p-b2d698f7.system.entry.js +0 -1
  352. package/dist/verdocs-web-sdk/p-bb2c866b.system.entry.js +0 -1
  353. package/dist/verdocs-web-sdk/p-bbee73c8.system.js +0 -1
  354. package/dist/verdocs-web-sdk/p-bfcf8ad2.entry.js +0 -1
  355. package/dist/verdocs-web-sdk/p-cbbf849f.system.js +0 -1
  356. package/dist/verdocs-web-sdk/p-cbd0802f.entry.js +0 -1
  357. package/dist/verdocs-web-sdk/p-de60d3a8.js +0 -1
  358. package/dist/verdocs-web-sdk/p-eab67c09.js +0 -1
  359. package/dist/verdocs-web-sdk/p-eb595245.system.js +0 -1
  360. package/dist/verdocs-web-sdk/p-ecf04564.system.entry.js +0 -1
  361. package/dist/verdocs-web-sdk/p-ee195e5e.entry.js +0 -1
  362. package/dist/verdocs-web-sdk/p-f1257cd0.system.entry.js +0 -1
  363. package/dist/verdocs-web-sdk/p-f65a1b9e.system.js +0 -1
  364. package/dist/verdocs-web-sdk/p-fde6b724.entry.js +0 -1
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(t,e,i,o){function n(t){return t instanceof i?t:new i((function(e){e(t)}))}return new(i||(i=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o["throw"](t))}catch(t){r(t)}}function l(t){t.done?i(t.value):n(t.value).then(a,s)}l((o=o.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var i={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},o,n,r,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(t){return function(e){return l([t,e])}}function l(a){if(o)throw new TypeError("Generator is already executing.");while(i)try{if(o=1,n&&(r=a[0]&2?n["return"]:a[0]?n["throw"]||((r=n["return"])&&r.call(n),0):n.next)&&!(r=r.call(n,a[1])).done)return r;if(n=0,r)a=[a[0]&2,r.value];switch(a[0]){case 0:case 1:r=a;break;case 4:i.label++;return{value:a[1],done:false};case 5:i.label++;n=a[1];a=[0];continue;case 7:a=i.ops.pop();i.trys.pop();continue;default:if(!(r=i.trys,r=r.length>0&&r[r.length-1])&&(a[0]===6||a[0]===2)){i=0;continue}if(a[0]===3&&(!r||a[1]>r[0]&&a[1]<r[3])){i.label=a[1];break}if(a[0]===6&&i.label<r[1]){i.label=r[1];r=a;break}if(r&&i.label<r[2]){i.label=r[2];i.ops.push(a);break}if(r[2])i.ops.pop();i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t];n=0}finally{o=r=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host}from"./index-172625c5.js";import{g as getSummary}from"./Envelopes-21ffb899.js";import"./Types-5f31149e.js";import{V as VerdocsEndpoint}from"./VerdocsEndpoint-b011af25.js";import{i as integerSequence}from"./Primitives-8fe93caf.js";import{S as SDKError}from"./errors-9b5498c8.js";var YEAR=365*24*60*60;var WEEK=7*24*60*60;var DAY=24*60*60;var HOUR=60*60;var MINUTE=60;var formatShortTimeAgo=function(t){if(t===undefined||t===null){return""}var e;if(typeof t==="string"||typeof t==="number"){e=new Date(t)}else if(typeof t==="object"){e=t}else{return""}var i=Math.floor(((new Date).getTime()-e.getTime())/1e3);if(i>=YEAR){return Math.floor(i/YEAR)+"Y"}if(i>=WEEK){return Math.floor(i/WEEK)+"W"}if(i>=DAY){return Math.floor(i/DAY)+"D"}if(i>=HOUR){return Math.floor(i/HOUR)+"H"}if(i>=MINUTE){return Math.floor(i/MINUTE)+"M"}return"".concat(i,"S")};var verdocsActivityBoxCss='verdocs-activity-box{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;font-size:18px;min-width:300px;-ms-flex-wrap:nowrap;flex-wrap:nowrap;color:#33364b;-ms-flex-align:center;align-items:center;border:1px solid #ccc;-ms-flex-direction:column;flex-direction:column;font-family:"Inter", "Barlow", sans-serif;background:#ffffff;padding:20px 20px 8px 20px}verdocs-activity-box .box-title{width:100%;display:-ms-flexbox;display:flex;color:#33364b;font-size:20px;font-weight:600;-webkit-column-gap:10px;-moz-column-gap:10px;column-gap:10px;margin:0 0 20px 0;-ms-flex-align:center;align-items:center}verdocs-activity-box .box-title .count{margin:0 0 0 6px;font-weight:300}verdocs-activity-box .box-title verdocs-loader{margin:0 0 20px 0}@media screen and (max-width: 1200px){verdocs-activity-box .box-title{font-size:18px}verdocs-activity-box .box-title .count{display:none}}verdocs-activity-box .spacer{-ms-flex:1;flex:1}verdocs-activity-box .loading-placeholder{width:100%;height:62px;display:block;-ms-flex:0 0 62px;flex:0 0 62px;margin:0 0 10px 0;border-radius:6px;background-color:#f5f8f9}verdocs-activity-box .loading-placeholder .loading-placeholder-bg{height:62px;position:relative;background:#f5f8f9;-webkit-animation-duration:1.25s;animation-duration:1.25s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-timing-function:linear;animation-timing-function:linear;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;-webkit-animation-name:loadingPlaceholderSwoop;animation-name:loadingPlaceholderSwoop;background:-webkit-gradient(linear, left top, right top, color-stop(10%, #f5f8f9), color-stop(18%, #eeeeee), color-stop(33%, #f5f8f9));background:linear-gradient(to right, #f5f8f9 10%, #eeeeee 18%, #f5f8f9 33%);background-size:800px 62px}verdocs-activity-box .activity-entry{width:100%;display:-ms-flexbox;display:flex;-ms-flex:0 0 62px;flex:0 0 62px;border-radius:6px;margin-bottom:10px;-ms-flex-direction:row;flex-direction:row;padding:0 16px 0 0;background:#f5f8f9;-ms-flex-align:center;align-items:center;border:1px solid #f5f8f9}verdocs-activity-box .activity-entry:hover{cursor:pointer;background:#f2f4f5;border:1px solid #ddd}verdocs-activity-box .activity-entry svg{width:32px;height:32px;margin-right:20px}@media screen and (max-width: 1300px){verdocs-activity-box .activity-entry svg{width:24px;height:24px;margin-right:15px}}verdocs-activity-box .activity-entry .title{-ms-flex:1;flex:1;color:black;font-size:16px;font-weight:500;margin-left:12px}@media screen and (max-width: 1300px){verdocs-activity-box .activity-entry .title{font-size:14px}}verdocs-activity-box .activity-entry .time-ago{height:24px;display:-ms-flexbox;display:flex;-ms-flex:0 0 24px;flex:0 0 24px;color:#7f8e92;font-size:16px;font-weight:500;padding-left:14px;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;border-left:1px solid #d8e3e6}@media screen and (max-width: 1300px){verdocs-activity-box .activity-entry .time-ago{font-size:14px}}@-webkit-keyframes loadingPlaceholderSwoop{0%{background-position:-468px 0}100%{background-position:468px 0}}@keyframes loadingPlaceholderSwoop{0%{background-position:-468px 0}100%{background-position:468px 0}}';var EmptyImage="https://verdocs-public-assets.s3.amazonaws.com/no-verdocs.png";var VerdocsActivityBox=function(){function t(t){registerInstance(this,t);this.sdkError=createEvent(this,"sdkError",7);this.viewEnvelope=createEvent(this,"viewEnvelope",7);this.viewAll=createEvent(this,"viewAll",7);this.endpoint=VerdocsEndpoint.getDefault();this.items=5;this.view=undefined;this.header=undefined;this.title="";this.count=0;this.loading=true;this.entries=[]}t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,i;return __generator(this,(function(o){try{this.endpoint.loadSession();if(!this.endpoint.session){console.log("[ACTIVITIES] Must be authenticated");return[2]}this.loadActivity()}catch(o){console.log("[ACTIVITIES] Error with preview session",o);(t=this.sdkError)===null||t===void 0?void 0:t.emit(new SDKError(o.message,(e=o.response)===null||e===void 0?void 0:e.status,(i=o.response)===null||i===void 0?void 0:i.data))}return[2]}))}))};t.prototype.handleItemsUpdated=function(){return this.loadActivity()};t.prototype.handleViewUpdated=function(){return this.loadActivity()};t.prototype.loadActivity=function(){return __awaiter(this,void 0,void 0,(function(){var t,e;return __generator(this,(function(i){switch(i.label){case 0:this.loading=true;return[4,getSummary(this.endpoint,0)];case 1:t=i.sent();if(this.view==="action"){e="Action Required";this.entries=t.action_required.result;this.count=t.action_required.total}else if(this.view==="waiting"){e="Waiting on Others";this.entries=t.waiting_others.result;this.count=t.waiting_others.total}else if(this.view==="completed"){e="Completed";this.entries=t.completed.result;this.count=t.completed.total}this.title=this.header!==undefined?this.header:e;this.loading=false;return[2]}}))}))};t.prototype.render=function(){var t=this;if(this.loading){return h(Host,{style:{minHeight:"300px"}},this.title&&h("div",{class:"box-title"},this.title," ",h("span",{class:"count"},"(0)")),integerSequence(0,this.items).map((function(){return h("div",{class:"loading-placeholder"},h("div",{class:"loading-placeholder-bg"}))})))}return h(Host,null,this.title&&h("div",{class:"box-title"},this.title," ",h("span",{class:"count"},"(",this.count,")"),h("div",{class:"spacer"}),h("verdocs-button",{label:"View All",size:"small",onClick:function(){var e;return(e=t.viewAll)===null||e===void 0?void 0:e.emit({endpoint:t.endpoint,view:t.view})}})),this.count>0?this.entries.slice(0,Math.max(this.items,1)).map((function(e){return h("div",{class:"activity-entry",onClick:function(){var i;(i=t.viewEnvelope)===null||i===void 0?void 0:i.emit({endpoint:t.endpoint,entry:e})}},h("div",{class:"title"},e.name,h("br",null)," ",h("strong",null,e.recipient.name)),h("div",{class:"time-ago"},formatShortTimeAgo(e.updated_at)))})):h("img",{src:EmptyImage,alt:"No documents to show",style:{width:"190px",margin:"0 auto"}}))};Object.defineProperty(t,"watchers",{get:function(){return{items:["handleItemsUpdated"],view:["handleViewUpdated"]}},enumerable:false,configurable:true});return t}();VerdocsActivityBox.style=verdocsActivityBoxCss;export{VerdocsActivityBox as verdocs_activity_box};
1
+ var __awaiter=this&&this.__awaiter||function(t,e,i,o){function n(t){return t instanceof i?t:new i((function(e){e(t)}))}return new(i||(i=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o["throw"](t))}catch(t){r(t)}}function l(t){t.done?i(t.value):n(t.value).then(a,s)}l((o=o.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var i={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},o,n,r,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(t){return function(e){return l([t,e])}}function l(a){if(o)throw new TypeError("Generator is already executing.");while(i)try{if(o=1,n&&(r=a[0]&2?n["return"]:a[0]?n["throw"]||((r=n["return"])&&r.call(n),0):n.next)&&!(r=r.call(n,a[1])).done)return r;if(n=0,r)a=[a[0]&2,r.value];switch(a[0]){case 0:case 1:r=a;break;case 4:i.label++;return{value:a[1],done:false};case 5:i.label++;n=a[1];a=[0];continue;case 7:a=i.ops.pop();i.trys.pop();continue;default:if(!(r=i.trys,r=r.length>0&&r[r.length-1])&&(a[0]===6||a[0]===2)){i=0;continue}if(a[0]===3&&(!r||a[1]>r[0]&&a[1]<r[3])){i.label=a[1];break}if(a[0]===6&&i.label<r[1]){i.label=r[1];r=a;break}if(r&&i.label<r[2]){i.label=r[2];i.ops.push(a);break}if(r[2])i.ops.pop();i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t];n=0}finally{o=r=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host}from"./index-172625c5.js";import{g as getSummary}from"./Envelopes-627c5239.js";import"./Types-5f31149e.js";import{V as VerdocsEndpoint}from"./VerdocsEndpoint-56fa3371.js";import{i as integerSequence}from"./Primitives-8fe93caf.js";import{S as SDKError}from"./errors-9b5498c8.js";var YEAR=365*24*60*60;var WEEK=7*24*60*60;var DAY=24*60*60;var HOUR=60*60;var MINUTE=60;var formatShortTimeAgo=function(t){if(t===undefined||t===null){return""}var e;if(typeof t==="string"||typeof t==="number"){e=new Date(t)}else if(typeof t==="object"){e=t}else{return""}var i=Math.floor(((new Date).getTime()-e.getTime())/1e3);if(i>=YEAR){return Math.floor(i/YEAR)+"Y"}if(i>=WEEK){return Math.floor(i/WEEK)+"W"}if(i>=DAY){return Math.floor(i/DAY)+"D"}if(i>=HOUR){return Math.floor(i/HOUR)+"H"}if(i>=MINUTE){return Math.floor(i/MINUTE)+"M"}return"".concat(i,"S")};var verdocsActivityBoxCss='verdocs-activity-box{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;font-size:18px;min-width:300px;-ms-flex-wrap:nowrap;flex-wrap:nowrap;color:#33364b;-ms-flex-align:center;align-items:center;border:1px solid #ccc;-ms-flex-direction:column;flex-direction:column;font-family:"Inter", "Barlow", sans-serif;background:#ffffff;padding:20px 20px 8px 20px}verdocs-activity-box .box-title{width:100%;display:-ms-flexbox;display:flex;color:#33364b;font-size:20px;font-weight:600;-webkit-column-gap:10px;-moz-column-gap:10px;column-gap:10px;margin:0 0 20px 0;-ms-flex-align:center;align-items:center}verdocs-activity-box .box-title .count{margin:0 0 0 6px;font-weight:300}verdocs-activity-box .box-title verdocs-loader{margin:0 0 20px 0}@media screen and (max-width: 1200px){verdocs-activity-box .box-title{font-size:18px}verdocs-activity-box .box-title .count{display:none}}verdocs-activity-box .spacer{-ms-flex:1;flex:1}verdocs-activity-box .loading-placeholder{width:100%;height:62px;display:block;-ms-flex:0 0 62px;flex:0 0 62px;margin:0 0 10px 0;border-radius:6px;background-color:#f5f8f9}verdocs-activity-box .loading-placeholder .loading-placeholder-bg{height:62px;position:relative;background:#f5f8f9;-webkit-animation-duration:1.25s;animation-duration:1.25s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-timing-function:linear;animation-timing-function:linear;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;-webkit-animation-name:loadingPlaceholderSwoop;animation-name:loadingPlaceholderSwoop;background:-webkit-gradient(linear, left top, right top, color-stop(10%, #f5f8f9), color-stop(18%, #eeeeee), color-stop(33%, #f5f8f9));background:linear-gradient(to right, #f5f8f9 10%, #eeeeee 18%, #f5f8f9 33%);background-size:800px 62px}verdocs-activity-box .activity-entry{width:100%;display:-ms-flexbox;display:flex;-ms-flex:0 0 62px;flex:0 0 62px;border-radius:6px;margin-bottom:10px;-ms-flex-direction:row;flex-direction:row;padding:0 16px 0 0;background:#f5f8f9;-ms-flex-align:center;align-items:center;border:1px solid #f5f8f9}verdocs-activity-box .activity-entry:hover{cursor:pointer;background:#f2f4f5;border:1px solid #ddd}verdocs-activity-box .activity-entry svg{width:32px;height:32px;margin-right:20px}@media screen and (max-width: 1300px){verdocs-activity-box .activity-entry svg{width:24px;height:24px;margin-right:15px}}verdocs-activity-box .activity-entry .title{-ms-flex:1;flex:1;color:black;font-size:16px;font-weight:500;margin-left:12px}@media screen and (max-width: 1300px){verdocs-activity-box .activity-entry .title{font-size:14px}}verdocs-activity-box .activity-entry .time-ago{height:24px;display:-ms-flexbox;display:flex;-ms-flex:0 0 24px;flex:0 0 24px;color:#7f8e92;font-size:16px;font-weight:500;padding-left:14px;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;border-left:1px solid #d8e3e6}@media screen and (max-width: 1300px){verdocs-activity-box .activity-entry .time-ago{font-size:14px}}@-webkit-keyframes loadingPlaceholderSwoop{0%{background-position:-468px 0}100%{background-position:468px 0}}@keyframes loadingPlaceholderSwoop{0%{background-position:-468px 0}100%{background-position:468px 0}}';var EmptyImage="https://verdocs-public-assets.s3.amazonaws.com/no-verdocs.png";var VerdocsActivityBox=function(){function t(t){registerInstance(this,t);this.sdkError=createEvent(this,"sdkError",7);this.viewEnvelope=createEvent(this,"viewEnvelope",7);this.viewAll=createEvent(this,"viewAll",7);this.endpoint=VerdocsEndpoint.getDefault();this.items=5;this.view=undefined;this.header=undefined;this.title="";this.count=0;this.loading=true;this.entries=[]}t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,i;return __generator(this,(function(o){try{this.endpoint.loadSession();if(!this.endpoint.session){console.log("[ACTIVITIES] Must be authenticated");return[2]}this.loadActivity()}catch(o){console.log("[ACTIVITIES] Error with preview session",o);(t=this.sdkError)===null||t===void 0?void 0:t.emit(new SDKError(o.message,(e=o.response)===null||e===void 0?void 0:e.status,(i=o.response)===null||i===void 0?void 0:i.data))}return[2]}))}))};t.prototype.handleItemsUpdated=function(){return this.loadActivity()};t.prototype.handleViewUpdated=function(){return this.loadActivity()};t.prototype.loadActivity=function(){return __awaiter(this,void 0,void 0,(function(){var t,e;return __generator(this,(function(i){switch(i.label){case 0:this.loading=true;return[4,getSummary(this.endpoint,0)];case 1:t=i.sent();if(this.view==="action"){e="Action Required";this.entries=t.action_required.result;this.count=t.action_required.total}else if(this.view==="waiting"){e="Waiting on Others";this.entries=t.waiting_others.result;this.count=t.waiting_others.total}else if(this.view==="completed"){e="Completed";this.entries=t.completed.result;this.count=t.completed.total}this.title=this.header!==undefined?this.header:e;this.loading=false;return[2]}}))}))};t.prototype.render=function(){var t=this;if(this.loading){return h(Host,{style:{minHeight:"300px"}},this.title&&h("div",{class:"box-title"},this.title," ",h("span",{class:"count"},"(0)")),integerSequence(0,this.items).map((function(){return h("div",{class:"loading-placeholder"},h("div",{class:"loading-placeholder-bg"}))})))}return h(Host,null,this.title&&h("div",{class:"box-title"},this.title," ",h("span",{class:"count"},"(",this.count,")"),h("div",{class:"spacer"}),h("verdocs-button",{label:"View All",size:"small",onClick:function(){var e;return(e=t.viewAll)===null||e===void 0?void 0:e.emit({endpoint:t.endpoint,view:t.view})}})),this.count>0?this.entries.slice(0,Math.max(this.items,1)).map((function(e){return h("div",{class:"activity-entry",onClick:function(){var i;(i=t.viewEnvelope)===null||i===void 0?void 0:i.emit({endpoint:t.endpoint,entry:e})}},h("div",{class:"title"},e.name,h("br",null)," ",h("strong",null,e.recipient.name)),h("div",{class:"time-ago"},formatShortTimeAgo(e.updated_at)))})):h("img",{src:EmptyImage,alt:"No documents to show",style:{width:"190px",margin:"0 auto"}}))};Object.defineProperty(t,"watchers",{get:function(){return{items:["handleItemsUpdated"],view:["handleViewUpdated"]}},enumerable:false,configurable:true});return t}();VerdocsActivityBox.style=verdocsActivityBoxCss;export{VerdocsActivityBox as verdocs_activity_box};
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(e,t,i,n){function s(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,o){function a(e){try{l(n.next(e))}catch(e){o(e)}}function r(e){try{l(n["throw"](e))}catch(e){o(e)}}function l(e){e.done?i(e.value):s(e.value).then(a,r)}l((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var i={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,s,o,a;return a={next:r(0),throw:r(1),return:r(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function r(e){return function(t){return l([e,t])}}function l(a){if(n)throw new TypeError("Generator is already executing.");while(i)try{if(n=1,s&&(o=a[0]&2?s["return"]:a[0]?s["throw"]||((o=s["return"])&&o.call(s),0):s.next)&&!(o=o.call(s,a[1])).done)return o;if(s=0,o)a=[a[0]&2,o.value];switch(a[0]){case 0:case 1:o=a;break;case 4:i.label++;return{value:a[1],done:false};case 5:i.label++;s=a[1];a=[0];continue;case 7:a=i.ops.pop();i.trys.pop();continue;default:if(!(o=i.trys,o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){i=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(a[0]===6&&i.label<o[1]){i.label=o[1];o=a;break}if(o&&i.label<o[2]){i.label=o[2];i.ops.push(a);break}if(o[2])i.ops.pop();i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e];s=0}finally{n=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h}from"./index-172625c5.js";import{d as decodeAccessTokenBody}from"./Types-5f31149e.js";import{c as createBusinessAccount,i as isOrgAvailable}from"./Profiles-4cc942ef.js";import{V as VerdocsEndpoint}from"./VerdocsEndpoint-b011af25.js";import{V as VerdocsToast}from"./Toast-f3b8fd46.js";import{S as SDKError}from"./errors-9b5498c8.js";var authenticateUser=function(e,t){return e.api.post("/authentication/login",t).then((function(e){return e.data}))};var resetPassword=function(e,t){return e.api.post("/user/reset_password",t).then((function(e){return e.data}))};var resendVerification=function(e,t){return e.api.post("/user/email_verification",{},t?{headers:{Authorization:"Bearer ".concat(t)}}:{}).then((function(e){return e.data}))};var verdocsAuthCss='verdocs-auth{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}verdocs-auth .form{background:#ffffff;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;-ms-flex-direction:column;flex-direction:column;display:-ms-flexbox;display:flex;padding:20px;width:300px;max-width:100%}verdocs-auth .logo{margin:20px 0 30px;width:128px;max-width:100%}verdocs-auth h3{text-align:center;font-weight:400;font-size:16px;line-height:1.75;margin:0}verdocs-auth h4{text-align:center;font-weight:400;font-size:14px;line-height:1.43;margin:0}verdocs-auth h4 verdocs-button button.normal .button-label{padding:0}verdocs-auth .buttons{gap:20px;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:center;justify-content:center}verdocs-auth .status-result{display:none}verdocs-auth .status-result.debug{white-space:pre-wrap;font-size:14px;background:#fff;padding:10px;display:block;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:center;justify-content:center}verdocs-auth form{width:100%}verdocs-auth verdocs-text-input{margin-bottom:10px}verdocs-auth .account-option{gap:8px;margin:20px 0 8px 0;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}verdocs-auth p+p{margin-top:0}verdocs-auth verdocs-help-icon{margin-top:18px;display:-ms-flexbox;display:flex;width:32px;height:32px;-ms-flex:0 0 32px;flex:0 0 32px}';var RECHECK_INTERVAL=5e3;var OkIcon='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24" viewBox="0 0 24 24" fill="green"><path fill-rule="evenodd" d="M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12zm13.36-1.814a.75.75 0 10-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 00-1.06 1.06l2.25 2.25a.75.75 0 001.14-.094l3.75-5.25z" clip-rule="evenodd" /></svg>';var TakenIcon='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24" viewBox="0 0 24 24" fill="red"><path fill-rule="evenodd" d="M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z" clip-rule="evenodd" /></svg>';var InfoIcon='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24" viewBox="0 0 24 24" fill="#4a4a4a"><path fill-rule="evenodd" d="M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12zm11.378-3.917c-.89-.777-2.366-.777-3.255 0a.75.75 0 01-.988-1.129c1.454-1.272 3.776-1.272 5.23 0 1.513 1.324 1.513 3.518 0 4.842a3.75 3.75 0 01-.837.552c-.676.328-1.028.774-1.028 1.152v.75a.75.75 0 01-1.5 0v-.75c0-1.279 1.06-2.107 1.875-2.502.182-.088.351-.199.503-.331.83-.727.83-1.857 0-2.584zM12 18a.75.75 0 100-1.5.75.75 0 000 1.5z" clip-rule="evenodd" /></svg>';var Industries=[{value:"",label:""},{value:"Accounting & Tax",label:"Accounting & Tax"},{value:"Business Services / Consulting",label:"Business Services / Consulting"},{value:"Construction",label:"Construction"},{value:"Education",label:"Education"},{value:"Financial Services",label:"Financial Services"},{value:"Government",label:"Government"},{value:"Healthcare - Health Plans & Payers",label:"Healthcare - Health Plans & Payers"},{value:"Healthcare - Providers",label:"Healthcare - Providers"},{value:"Insurance",label:"Insurance"},{value:"Legal",label:"Legal"},{value:"Life Sciences",label:"Life Sciences"},{value:"Manufacturing",label:"Manufacturing"},{value:"Mortgage",label:"Mortgage"},{value:"Not For Profit",label:"Not For Profit"},{value:"Real Estate - Commercial",label:"Real Estate - Commercial"},{value:"Real Estate - Residential",label:"Real Estate - Residential"},{value:"Retail",label:"Retail"},{value:"Technology",label:"Technology"},{value:"Other",label:"Other"}];var Reasons=[{value:"",label:""},{value:"I want to send a document for signature.",label:"I want to send a document for signature."},{value:"I just need to sign a document today.",label:"I just need to sign a document today."},{value:"I'm evaluating it for my business.",label:"I'm evaluating it for my business."},{value:"I'm evaluating it for my personal use.",label:"I'm evaluating it for my personal use."},{value:"I'm a developer building an integration.",label:"I'm a developer building an integration."}];var CompanySizes=[{value:"",label:""},{value:"Solo",label:"Solo"},{value:"2-10",label:"2-10"},{value:"11-50",label:"11-50"},{value:"51-200",label:"51-200"},{value:"201-500",label:"201-500"},{value:"501-1000",label:"501-1000"},{value:"1000+",label:"1000+"}];var VerdocsAuth=function(){function e(e){registerInstance(this,e);this.authenticated=createEvent(this,"authenticated",7);this.sdkError=createEvent(this,"sdkError",7);this.recheckTimer=null;this.resendDisabledTimer=null;this.accessTokenForVerification=null;this.endpoint=VerdocsEndpoint.getDefault();this.visible=true;this.logo="https://app.verdocs.com/assets/blue-logo.svg";this.isAuthenticated=false;this.displayMode="login";this.orgname="";this.orgAvailable="UNKNOWN";this.first="";this.last="";this.username="";this.phone="";this.password="";this.submitting=false;this.activeSession=null;this.accountType="org";this.howHear="";this.industry="";this.companySize="";this.reason="";this.signupStep=1;this.resendDisabled=false;this.checkingOrg=false}e.prototype.componentWillLoad=function(){var e,t;this.endpoint.loadSession();if(this.endpoint.session){console.log("[AUTH] Authenticated");this.isAuthenticated=true;this.activeSession=this.endpoint.session;(e=this.authenticated)===null||e===void 0?void 0:e.emit({authenticated:true,session:this.endpoint.session})}else{console.log("[AUTH] Anonymous");(t=this.authenticated)===null||t===void 0?void 0:t.emit({authenticated:false,session:null})}};e.prototype.disconnectedCallback=function(){this.cancelRecheckTimer()};e.prototype.cancelRecheckTimer=function(){if(this.recheckTimer){try{clearTimeout(this.recheckTimer)}catch(e){}this.recheckTimer=null}if(this.resendDisabledTimer){try{clearTimeout(this.resendDisabledTimer)}catch(e){}this.resendDisabledTimer=null}};e.prototype.handleSignup=function(){var e=this;this.submitting=true;this.accessTokenForVerification=null;createBusinessAccount(this.endpoint,{email:this.username,password:this.password,firstName:this.first,lastName:this.last,orgName:this.orgname,industry:this.industry,size:this.companySize,reason:this.reason,hearabout:this.howHear}).then((function(t){console.log("Result",t);console.log("[AUTH] Created profile",t.profile);console.log("[AUTH] Created organization",t.organization);e.loginAndCheckVerification()})).catch((function(t){var i,n,s,o,a;console.log("[AUTH] Signup error",t.response,JSON.stringify(t));e.submitting=false;e.activeSession=null;(i=e.authenticated)===null||i===void 0?void 0:i.emit({authenticated:false,session:null});(n=e.sdkError)===null||n===void 0?void 0:n.emit(new SDKError(t.message,(s=t.response)===null||s===void 0?void 0:s.status,(o=t.response)===null||o===void 0?void 0:o.data));VerdocsToast("Signup failed: "+((a=t.response)===null||a===void 0?void 0:a.data),{style:"error"})}))};e.prototype.loginAndCheckVerification=function(){var e=this;this.submitting=true;this.accessTokenForVerification=null;authenticateUser(this.endpoint,{username:this.username,password:this.password}).then((function(t){var i;e.cancelRecheckTimer();e.submitting=false;var n=decodeAccessTokenBody(t.accessToken);console.log("[AUTH] Got access token body",n);if(n===null||n===void 0?void 0:n.email_verified){console.log("[AUTH] Email address is verified, completing login");e.displayMode="login";e.accessTokenForVerification=null;e.endpoint.setToken(t.accessToken);e.activeSession=e.endpoint.session;e.isAuthenticated=true;(i=e.authenticated)===null||i===void 0?void 0:i.emit({authenticated:true,session:e.endpoint.session})}else{console.log("[AUTH] Logged in, pending email address verification");e.displayMode="verify";e.accessTokenForVerification=t.accessToken;e.recheckTimer=setTimeout((function(){return e.loginAndCheckVerification()}),RECHECK_INTERVAL)}})).catch((function(t){var i,n,s,o;e.cancelRecheckTimer();console.log("[AUTH] Authentication error",t.response,JSON.stringify(t));e.displayMode="login";e.submitting=false;e.activeSession=null;(i=e.authenticated)===null||i===void 0?void 0:i.emit({authenticated:false,session:null});(n=e.sdkError)===null||n===void 0?void 0:n.emit(new SDKError(t.message,(s=t.response)===null||s===void 0?void 0:s.status,(o=t.response)===null||o===void 0?void 0:o.data));VerdocsToast("Login failed. Please check your username and password and try again.",{style:"error"})}))};e.prototype.handleLogout=function(){var e;this.endpoint.clearSession();this.isAuthenticated=false;this.accessTokenForVerification=null;(e=this.authenticated)===null||e===void 0?void 0:e.emit({authenticated:false,session:null})};e.prototype.handleResend=function(){var e=this;this.resendDisabled=true;this.resendDisabledTimer=setTimeout((function(){e.resendDisabled=false;e.resendDisabledTimer=null}),3e4);resendVerification(this.endpoint,this.accessTokenForVerification).then((function(e){console.log("[AUTH] Verification request resent",e);VerdocsToast("Please check your email for a message with verification instructions.",{style:"info"})})).catch((function(e){console.log("[AUTH] Unable to resend verification",e)}))};e.prototype.handleReset=function(){var e=this;this.submitting=true;resetPassword(this.endpoint,{email:this.username}).then((function(t){console.log("[AUTH] Reset sent",t);e.submitting=false;e.displayMode="login";VerdocsToast("If your email address is registered, you will receive instructions on resetting your password shortly.",{style:"info"})})).catch((function(t){console.log("[AUTH] Unable to reset password",t);e.submitting=false}))};e.prototype.checkAvailability=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i;return __generator(this,(function(n){switch(n.label){case 0:this.checkingOrg=true;n.label=1;case 1:n.trys.push([1,3,,4]);this.orgname=e;return[4,isOrgAvailable(this.endpoint,e)];case 2:t=n.sent();this.orgAvailable=t.result;console.log("response",this.orgAvailable);return[3,4];case 3:i=n.sent();this.orgAvailable="UNKNOWN";return[3,4];case 4:this.checkingOrg=false;return[2]}}))}))};e.prototype.render=function(){var e=this;if(!this.visible){return h("div",{style:{display:"none"}},"Authenticated")}if(this.isAuthenticated){return h("verdocs-button",{label:"Sign Out",disabled:this.submitting,onClick:function(){return e.handleLogout()},style:{display:"flex",justifyContent:"center",margin:"30px auto 0"}})}if(this.displayMode==="signup"){var t=this.submitting||!this.first||!this.last||!this.username||!this.password||!this.orgname||this.orgAvailable!=="AVAILABLE";return h("div",{class:"form"},h("a",{href:"https://verdocs.com/en/"},h("img",{src:this.logo,alt:"Verdocs Logo",class:"logo"})),h("h3",null,"Sign up for a trial account"),h("h4",null,"Already have an account?",h("verdocs-button",{label:"Log In",variant:"text",onClick:function(){return e.displayMode="login"},disabled:this.submitting})),this.signupStep===1&&h("form",{onSubmit:function(){return e.handleSignup()}},h("div",{style:{display:"flex",flexDirection:"row",columnGap:"20px"}},h("verdocs-text-input",{label:"First Name",autocomplete:"first",required:true,value:this.first,onInput:function(t){return e.first=t.target.value},disabled:this.submitting}),h("verdocs-text-input",{label:"Last Name",autocomplete:"last",required:true,value:this.last,onInput:function(t){return e.last=t.target.value},disabled:this.submitting})),h("verdocs-text-input",{label:"Email",autocomplete:"email",required:true,value:this.username,onInput:function(t){return e.username=t.target.value},disabled:this.submitting}),h("verdocs-text-input",{label:"Phone #",autocomplete:"phone",value:this.phone,onInput:function(t){return e.phone=t.target.value},disabled:this.submitting}),h("verdocs-text-input",{label:"Password",type:"password",required:true,autocomplete:"current-password",value:this.password,onInput:function(t){return e.password=t.target.value},disabled:this.submitting}),h("div",{style:{display:"flex",flexDirection:"row",gap:"10px",alignItems:"center"}},h("verdocs-text-input",{label:"Organization Name",autocomplete:"org",required:true,value:this.orgname,onInput:function(t){return e.checkAvailability(t.target.value)},disabled:this.submitting,style:{flex:"1"},onBlur:function(){console.log("blur")}}),!this.checkingOrg&&this.orgAvailable==="AVAILABLE"&&h("verdocs-help-icon",{icon:OkIcon,text:"Organization name is available."}),!this.checkingOrg&&this.orgAvailable==="TAKEN"&&h("verdocs-help-icon",{icon:TakenIcon,text:"Organization already registered."}),!this.checkingOrg&&this.orgAvailable==="UNKNOWN"&&h("verdocs-help-icon",{icon:InfoIcon,text:"Organization name must be unique."}),this.checkingOrg&&h("verdocs-spinner",{mode:"dark",size:24})),h("div",{style:{marginTop:"30px"}}),h("verdocs-button",{label:"Next",disabled:t,onClick:function(){return e.signupStep=2},style:{display:"flex",justifyContent:"center",margin:"30px auto 0"}})),this.signupStep===2&&h("form",{onSubmit:function(){return e.handleSignup()}},h("verdocs-text-input",{label:"How did you hear about Verdocs?",value:this.howHear,onInput:function(t){return e.howHear=t.target.value},disabled:this.submitting}),h("verdocs-select-input",{label:"Your Industry",options:Industries,value:this.industry,onInput:function(t){return e.industry=t.target.value},disabled:this.submitting}),h("verdocs-select-input",{label:"Company Size",options:CompanySizes,value:this.companySize,onInput:function(t){return e.companySize=t.target.value},disabled:this.submitting}),h("verdocs-select-input",{label:"Purpose",options:Reasons,value:this.reason,onInput:function(t){return e.reason=t.target.value},disabled:this.submitting}),h("div",{style:{marginTop:"30px"}}),h("verdocs-button",{label:"Create Account",disabled:this.submitting,onClick:function(){return e.handleSignup()},style:{display:"flex",justifyContent:"center",margin:"30px auto 0"}})),this.signupStep===3&&h("form",{onSubmit:function(){return e.handleSignup()}},h("p",null,"Please check your e-mail inbox for a verification code and follow the instructions provided."),h("p",null,h("em",null,"Verification messages may take up to 1 hour to arrive. If you do not receive the invitation, ",h("a",{href:"#"},"Click Here")," to resend it. Be sure to check your spam folder.")),h("div",{style:{display:"flex",flexDirection:"row",gap:"20px"}},h("verdocs-button",{label:"Back",disabled:this.submitting,onClick:function(){e.signupStep=2},style:{display:"flex",justifyContent:"center",margin:"30px auto 0"}}),h("verdocs-button",{label:"Go to Dashboard",disabled:true,onClick:function(){return e.handleSignup()},style:{display:"flex",justifyContent:"center",margin:"30px auto 0"}}))))}if(this.displayMode==="forgot"){return h("div",{class:"form"},h("a",{href:"https://verdocs.com/en/"},h("img",{src:this.logo,alt:"Verdocs Logo",class:"logo"})),h("h3",null,"Forgot your password?"),h("p",null,"Enter your e-mail address below, and reset instructions will be sent to your Inbox."),h("p",null,h("em",null,"Please allow up to 24 hours for delivery, and check your spam folder if you do not receive the message. ")),h("form",{onSubmit:function(){return e.handleSignup()}},h("verdocs-text-input",{label:"Email",autocomplete:"email",required:true,value:this.username,onInput:function(t){return e.username=t.target.value},disabled:this.submitting}),h("div",{style:{marginTop:"30px"}}),h("div",{class:"buttons"},h("verdocs-button",{label:"Cancel",variant:"outline",disabled:this.submitting,onClick:function(){return e.displayMode="login"}}),h("verdocs-button",{label:"Reset",disabled:this.submitting,onClick:function(){return e.handleReset()}}))))}if(this.displayMode==="verify"){return h("div",{class:"form"},h("img",{src:this.logo,alt:"Verdocs Logo",class:"logo"}),h("h3",null,"Please Verify your Email Address"),h("p",null,"Check your e-mail inbox for a verification email, and follow the instructions provided."),h("p",null,h("em",null,"Please allow up to 24 hours for delivery, and check your spam folder if you do not receive the message. ")),h("div",{class:"buttons"},h("verdocs-button",{label:"Sign Out",variant:"outline",disabled:this.submitting,onClick:function(){e.username="";e.password="";e.cancelRecheckTimer();e.displayMode="login"}}),h("verdocs-button",{label:"Resend Email",disabled:this.resendDisabled,onClick:function(){return e.handleResend()}})))}return h("div",{class:"form"},h("a",{href:"https://verdocs.com/en/"},h("img",{src:this.logo,alt:"Verdocs Logo",class:"logo"})),h("h3",null,"Log in to your account"),h("h4",null,"Don't have an account?",h("verdocs-button",{label:"Sign Up",variant:"text",onClick:function(){e.displayMode="signup";e.signupStep=1},disabled:this.submitting})),h("form",{onSubmit:function(){return e.loginAndCheckVerification()}},h("verdocs-text-input",{label:"Email",autocomplete:"username",value:this.username,onInput:function(t){return e.username=t.target.value},disabled:this.submitting}),h("verdocs-text-input",{label:"Password",type:"password",autocomplete:"current-password",value:this.password,onInput:function(t){return e.password=t.target.value},disabled:this.submitting}),h("verdocs-button",{label:"Forgot Your Password?",variant:"text",onClick:function(){return e.displayMode="forgot"},disabled:this.submitting,style:{display:"flex",justifyContent:"center",margin:"10px auto 20px"}}),h("verdocs-button",{label:"Login",disabled:this.submitting,onClick:function(){return e.loginAndCheckVerification()},style:{display:"flex",justifyContent:"center",margin:"10px auto 0"}})))};return e}();VerdocsAuth.style=verdocsAuthCss;export{VerdocsAuth as verdocs_auth};
1
+ import{r as registerInstance,c as createEvent,h}from"./index-172625c5.js";import{d as decodeAccessTokenBody}from"./Types-5f31149e.js";import{V as VerdocsEndpoint}from"./VerdocsEndpoint-56fa3371.js";import{c as createBusinessAccount}from"./Profiles-d4df4d1c.js";import{V as VerdocsToast}from"./Toast-f3b8fd46.js";import{S as SDKError}from"./errors-9b5498c8.js";var authenticateUser=function(e,t){return e.api.post("/authentication/login",t).then((function(e){return e.data}))};var resetPassword=function(e,t){return e.api.post("/user/reset_password",t).then((function(e){return e.data}))};var resendVerification=function(e,t){return e.api.post("/user/email_verification",{},t?{headers:{Authorization:"Bearer ".concat(t)}}:{}).then((function(e){return e.data}))};var verdocsAuthCss='verdocs-auth{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}verdocs-auth .form{background:#ffffff;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;-ms-flex-direction:column;flex-direction:column;display:-ms-flexbox;display:flex;padding:20px;width:300px;max-width:100%}verdocs-auth .logo{margin:20px 0 30px;width:128px;max-width:100%}verdocs-auth h3{text-align:center;font-weight:400;font-size:16px;line-height:1.75;margin:0}verdocs-auth h4{text-align:center;font-weight:400;font-size:14px;line-height:1.43;margin:0}verdocs-auth h4 verdocs-button button.normal .button-label{padding:0}verdocs-auth .buttons{gap:20px;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:center;justify-content:center}verdocs-auth .status-result{display:none}verdocs-auth .status-result.debug{white-space:pre-wrap;font-size:14px;background:#fff;padding:10px;display:block;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:center;justify-content:center}verdocs-auth form{width:100%}verdocs-auth verdocs-text-input{margin-bottom:10px}verdocs-auth .account-option{gap:8px;margin:20px 0 8px 0;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}verdocs-auth p+p{margin-top:0}verdocs-auth verdocs-help-icon{margin-top:18px;display:-ms-flexbox;display:flex;width:32px;height:32px;-ms-flex:0 0 32px;flex:0 0 32px}';var RECHECK_INTERVAL=5e3;var Industries=[{value:"",label:""},{value:"Accounting & Tax",label:"Accounting & Tax"},{value:"Business Services / Consulting",label:"Business Services / Consulting"},{value:"Construction",label:"Construction"},{value:"Education",label:"Education"},{value:"Financial Services",label:"Financial Services"},{value:"Government",label:"Government"},{value:"Healthcare - Health Plans & Payers",label:"Healthcare - Health Plans & Payers"},{value:"Healthcare - Providers",label:"Healthcare - Providers"},{value:"Insurance",label:"Insurance"},{value:"Legal",label:"Legal"},{value:"Life Sciences",label:"Life Sciences"},{value:"Manufacturing",label:"Manufacturing"},{value:"Mortgage",label:"Mortgage"},{value:"Not For Profit",label:"Not For Profit"},{value:"Real Estate - Commercial",label:"Real Estate - Commercial"},{value:"Real Estate - Residential",label:"Real Estate - Residential"},{value:"Retail",label:"Retail"},{value:"Technology",label:"Technology"},{value:"Other",label:"Other"}];var Reasons=[{value:"",label:""},{value:"I want to send a document for signature.",label:"I want to send a document for signature."},{value:"I just need to sign a document today.",label:"I just need to sign a document today."},{value:"I'm evaluating it for my business.",label:"I'm evaluating it for my business."},{value:"I'm evaluating it for my personal use.",label:"I'm evaluating it for my personal use."},{value:"I'm a developer building an integration.",label:"I'm a developer building an integration."}];var CompanySizes=[{value:"",label:""},{value:"Solo",label:"Solo"},{value:"2-10",label:"2-10"},{value:"11-50",label:"11-50"},{value:"51-200",label:"51-200"},{value:"201-500",label:"201-500"},{value:"501-1000",label:"501-1000"},{value:"1000+",label:"1000+"}];var VerdocsAuth=function(){function e(e){registerInstance(this,e);this.authenticated=createEvent(this,"authenticated",7);this.sdkError=createEvent(this,"sdkError",7);this.recheckTimer=null;this.resendDisabledTimer=null;this.accessTokenForVerification=null;this.endpoint=VerdocsEndpoint.getDefault();this.visible=true;this.logo="https://app.verdocs.com/assets/blue-logo.svg";this.isAuthenticated=false;this.displayMode="login";this.orgname="";this.first="";this.last="";this.username="";this.phone="";this.password="";this.submitting=false;this.activeSession=null;this.accountType="org";this.howHear="";this.industry="";this.companySize="";this.reason="";this.signupStep=1;this.resendDisabled=false;this.checkingOrg=false}e.prototype.componentWillLoad=function(){var e,t;this.endpoint.loadSession();if(this.endpoint.session){console.log("[AUTH] Authenticated");this.isAuthenticated=true;this.activeSession=this.endpoint.session;(e=this.authenticated)===null||e===void 0?void 0:e.emit({authenticated:true,session:this.endpoint.session})}else{console.log("[AUTH] Anonymous");(t=this.authenticated)===null||t===void 0?void 0:t.emit({authenticated:false,session:null})}};e.prototype.disconnectedCallback=function(){this.cancelRecheckTimer()};e.prototype.cancelRecheckTimer=function(){if(this.recheckTimer){try{clearTimeout(this.recheckTimer)}catch(e){}this.recheckTimer=null}if(this.resendDisabledTimer){try{clearTimeout(this.resendDisabledTimer)}catch(e){}this.resendDisabledTimer=null}};e.prototype.handleSignup=function(){var e=this;this.submitting=true;this.accessTokenForVerification=null;createBusinessAccount(this.endpoint,{email:this.username,password:this.password,firstName:this.first,lastName:this.last,orgName:this.orgname}).then((function(t){console.log("Result",t);console.log("[AUTH] Created profile",t.profile);console.log("[AUTH] Created organization",t.organization);e.loginAndCheckVerification()})).catch((function(t){var i,n,s,o,a;console.log("[AUTH] Signup error",t.response,JSON.stringify(t));e.submitting=false;e.activeSession=null;(i=e.authenticated)===null||i===void 0?void 0:i.emit({authenticated:false,session:null});(n=e.sdkError)===null||n===void 0?void 0:n.emit(new SDKError(t.message,(s=t.response)===null||s===void 0?void 0:s.status,(o=t.response)===null||o===void 0?void 0:o.data));VerdocsToast("Signup failed: "+((a=t.response)===null||a===void 0?void 0:a.data),{style:"error"})}))};e.prototype.loginAndCheckVerification=function(){var e=this;this.submitting=true;this.accessTokenForVerification=null;authenticateUser(this.endpoint,{username:this.username,password:this.password}).then((function(t){var i;e.cancelRecheckTimer();e.submitting=false;var n=decodeAccessTokenBody(t.accessToken);console.log("[AUTH] Got access token body",n);if(n===null||n===void 0?void 0:n.email_verified){console.log("[AUTH] Email address is verified, completing login");e.displayMode="login";e.accessTokenForVerification=null;e.endpoint.setToken(t.accessToken);e.activeSession=e.endpoint.session;e.isAuthenticated=true;(i=e.authenticated)===null||i===void 0?void 0:i.emit({authenticated:true,session:e.endpoint.session})}else{console.log("[AUTH] Logged in, pending email address verification");e.displayMode="verify";e.accessTokenForVerification=t.accessToken;e.recheckTimer=setTimeout((function(){return e.loginAndCheckVerification()}),RECHECK_INTERVAL)}})).catch((function(t){var i,n,s,o;e.cancelRecheckTimer();console.log("[AUTH] Authentication error",t.response,JSON.stringify(t));e.displayMode="login";e.submitting=false;e.activeSession=null;(i=e.authenticated)===null||i===void 0?void 0:i.emit({authenticated:false,session:null});(n=e.sdkError)===null||n===void 0?void 0:n.emit(new SDKError(t.message,(s=t.response)===null||s===void 0?void 0:s.status,(o=t.response)===null||o===void 0?void 0:o.data));VerdocsToast("Login failed. Please check your username and password and try again.",{style:"error"})}))};e.prototype.handleLogout=function(){var e;this.endpoint.clearSession();this.isAuthenticated=false;this.accessTokenForVerification=null;(e=this.authenticated)===null||e===void 0?void 0:e.emit({authenticated:false,session:null})};e.prototype.handleResend=function(){var e=this;this.resendDisabled=true;this.resendDisabledTimer=setTimeout((function(){e.resendDisabled=false;e.resendDisabledTimer=null}),3e4);resendVerification(this.endpoint,this.accessTokenForVerification).then((function(e){console.log("[AUTH] Verification request resent",e);VerdocsToast("Please check your email for a message with verification instructions.",{style:"info"})})).catch((function(e){console.log("[AUTH] Unable to resend verification",e)}))};e.prototype.handleReset=function(){var e=this;this.submitting=true;resetPassword(this.endpoint,{email:this.username}).then((function(t){console.log("[AUTH] Reset sent",t);e.submitting=false;e.displayMode="login";VerdocsToast("If your email address is registered, you will receive instructions on resetting your password shortly.",{style:"info"})})).catch((function(t){console.log("[AUTH] Unable to reset password",t);e.submitting=false}))};e.prototype.render=function(){var e=this;if(!this.visible){return h("div",{style:{display:"none"}},"Authenticated")}if(this.isAuthenticated){return h("verdocs-button",{label:"Sign Out",disabled:this.submitting,onClick:function(){return e.handleLogout()},style:{display:"flex",justifyContent:"center",margin:"30px auto 0"}})}if(this.displayMode==="signup"){var t=this.submitting||!this.first||!this.last||!this.username||!this.password||!this.orgname;return h("div",{class:"form"},h("a",{href:"https://verdocs.com/en/"},h("img",{src:this.logo,alt:"Verdocs Logo",class:"logo"})),h("h3",null,"Sign up for a trial account"),h("h4",null,"Already have an account?",h("verdocs-button",{label:"Log In",variant:"text",onClick:function(){return e.displayMode="login"},disabled:this.submitting})),this.signupStep===1&&h("form",{onSubmit:function(){return e.handleSignup()}},h("div",{style:{display:"flex",flexDirection:"row",columnGap:"20px"}},h("verdocs-text-input",{label:"First Name",autocomplete:"first",required:true,value:this.first,onInput:function(t){return e.first=t.target.value},disabled:this.submitting}),h("verdocs-text-input",{label:"Last Name",autocomplete:"last",required:true,value:this.last,onInput:function(t){return e.last=t.target.value},disabled:this.submitting})),h("verdocs-text-input",{label:"Email",autocomplete:"email",required:true,value:this.username,onInput:function(t){return e.username=t.target.value},disabled:this.submitting}),h("verdocs-text-input",{label:"Phone #",autocomplete:"phone",value:this.phone,onInput:function(t){return e.phone=t.target.value},disabled:this.submitting}),h("verdocs-text-input",{label:"Password",type:"password",required:true,autocomplete:"current-password",value:this.password,onInput:function(t){return e.password=t.target.value},disabled:this.submitting}),h("verdocs-text-input",{label:"Organization Name",autocomplete:"org",required:true,value:this.orgname,onInput:function(t){return e.orgname=t.target.value},disabled:this.submitting,style:{flex:"1"}}),h("div",{style:{marginTop:"30px"}}),h("verdocs-button",{label:"Next",disabled:t,onClick:function(){return e.signupStep=2},style:{display:"flex",justifyContent:"center",margin:"30px auto 0"}})),this.signupStep===2&&h("form",{onSubmit:function(){return e.handleSignup()}},h("verdocs-text-input",{label:"How did you hear about Verdocs?",value:this.howHear,onInput:function(t){return e.howHear=t.target.value},disabled:this.submitting}),h("verdocs-select-input",{label:"Your Industry",options:Industries,value:this.industry,onInput:function(t){return e.industry=t.target.value},disabled:this.submitting}),h("verdocs-select-input",{label:"Company Size",options:CompanySizes,value:this.companySize,onInput:function(t){return e.companySize=t.target.value},disabled:this.submitting}),h("verdocs-select-input",{label:"Purpose",options:Reasons,value:this.reason,onInput:function(t){return e.reason=t.target.value},disabled:this.submitting}),h("div",{style:{marginTop:"30px"}}),h("verdocs-button",{label:"Create Account",disabled:this.submitting,onClick:function(){return e.handleSignup()},style:{display:"flex",justifyContent:"center",margin:"30px auto 0"}})),this.signupStep===3&&h("form",{onSubmit:function(){return e.handleSignup()}},h("p",null,"Please check your e-mail inbox for a verification code and follow the instructions provided."),h("p",null,h("em",null,"Verification messages may take up to 1 hour to arrive. If you do not receive the invitation, ",h("a",{href:"#"},"Click Here")," to resend it. Be sure to check your spam folder.")),h("div",{style:{display:"flex",flexDirection:"row",gap:"20px"}},h("verdocs-button",{label:"Back",disabled:this.submitting,onClick:function(){e.signupStep=2},style:{display:"flex",justifyContent:"center",margin:"30px auto 0"}}),h("verdocs-button",{label:"Go to Dashboard",disabled:true,onClick:function(){return e.handleSignup()},style:{display:"flex",justifyContent:"center",margin:"30px auto 0"}}))))}if(this.displayMode==="forgot"){return h("div",{class:"form"},h("a",{href:"https://verdocs.com/en/"},h("img",{src:this.logo,alt:"Verdocs Logo",class:"logo"})),h("h3",null,"Forgot your password?"),h("p",null,"Enter your e-mail address below, and reset instructions will be sent to your Inbox."),h("p",null,h("em",null,"Please allow up to 24 hours for delivery, and check your spam folder if you do not receive the message. ")),h("form",{onSubmit:function(){return e.handleSignup()}},h("verdocs-text-input",{label:"Email",autocomplete:"email",required:true,value:this.username,onInput:function(t){return e.username=t.target.value},disabled:this.submitting}),h("div",{style:{marginTop:"30px"}}),h("div",{class:"buttons"},h("verdocs-button",{label:"Cancel",variant:"outline",disabled:this.submitting,onClick:function(){return e.displayMode="login"}}),h("verdocs-button",{label:"Reset",disabled:this.submitting,onClick:function(){return e.handleReset()}}))))}if(this.displayMode==="verify"){return h("div",{class:"form"},h("img",{src:this.logo,alt:"Verdocs Logo",class:"logo"}),h("h3",null,"Please Verify your Email Address"),h("p",null,"Check your e-mail inbox for a verification email, and follow the instructions provided."),h("p",null,h("em",null,"Please allow up to 24 hours for delivery, and check your spam folder if you do not receive the message. ")),h("div",{class:"buttons"},h("verdocs-button",{label:"Sign Out",variant:"outline",disabled:this.submitting,onClick:function(){e.username="";e.password="";e.cancelRecheckTimer();e.displayMode="login"}}),h("verdocs-button",{label:"Resend Email",disabled:this.resendDisabled,onClick:function(){return e.handleResend()}})))}return h("div",{class:"form"},h("a",{href:"https://verdocs.com/en/"},h("img",{src:this.logo,alt:"Verdocs Logo",class:"logo"})),h("h3",null,"Log in to your account"),h("h4",null,"Don't have an account?",h("verdocs-button",{label:"Sign Up",variant:"text",onClick:function(){e.displayMode="signup";e.signupStep=1},disabled:this.submitting})),h("form",{onSubmit:function(){return e.loginAndCheckVerification()}},h("verdocs-text-input",{label:"Email",autocomplete:"username",value:this.username,onInput:function(t){return e.username=t.target.value},disabled:this.submitting}),h("verdocs-text-input",{label:"Password",type:"password",autocomplete:"current-password",value:this.password,onInput:function(t){return e.password=t.target.value},disabled:this.submitting}),h("verdocs-button",{label:"Forgot Your Password?",variant:"text",onClick:function(){return e.displayMode="forgot"},disabled:this.submitting,style:{display:"flex",justifyContent:"center",margin:"10px auto 20px"}}),h("verdocs-button",{label:"Login",disabled:this.submitting,onClick:function(){return e.loginAndCheckVerification()},style:{display:"flex",justifyContent:"center",margin:"10px auto 0"}})))};return e}();VerdocsAuth.style=verdocsAuthCss;export{VerdocsAuth as verdocs_auth};
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(e,t,n,o){function i(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,r){function a(e){try{s(o.next(e))}catch(e){r(e)}}function l(e){try{s(o["throw"](e))}catch(e){r(e)}}function s(e){e.done?n(e.value):i(e.value).then(a,l)}s((o=o.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},o,i,r,a;return a={next:l(0),throw:l(1),return:l(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function l(e){return function(t){return s([e,t])}}function s(a){if(o)throw new TypeError("Generator is already executing.");while(n)try{if(o=1,i&&(r=a[0]&2?i["return"]:a[0]?i["throw"]||((r=i["return"])&&r.call(i),0):i.next)&&!(r=r.call(i,a[1])).done)return r;if(i=0,r)a=[a[0]&2,r.value];switch(a[0]){case 0:case 1:r=a;break;case 4:n.label++;return{value:a[1],done:false};case 5:n.label++;i=a[1];a=[0];continue;case 7:a=n.ops.pop();n.trys.pop();continue;default:if(!(r=n.trys,r=r.length>0&&r[r.length-1])&&(a[0]===6||a[0]===2)){n=0;continue}if(a[0]===3&&(!r||a[1]>r[0]&&a[1]<r[3])){n.label=a[1];break}if(a[0]===6&&n.label<r[1]){n.label=r[1];r=a;break}if(r&&n.label<r[2]){n.label=r[2];n.ops.push(a);break}if(r[2])n.ops.pop();n.trys.pop();continue}a=t.call(e,n)}catch(e){a=[6,e];i=0}finally{o=r=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,f as forceUpdate,h,H as Host,a as getElement}from"./index-172625c5.js";import"./Types-5f31149e.js";import{V as VerdocsEndpoint}from"./VerdocsEndpoint-b011af25.js";import{g as getTemplateStore}from"./TemplateStore-018fc1db.js";import{S as SDKError}from"./errors-9b5498c8.js";import"./index-4439b0d1.js";var verdocsBuildCss='verdocs-build{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-build .content{-ms-flex:1;flex:1;gap:20px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column}verdocs-build verdocs-template-attachments,verdocs-build verdocs-template-roles{margin:20px}verdocs-build verdocs-template-fields{border-top:1px solid #777777}verdocs-build verdocs-template-attachments{padding:20px;background:#ffffff}verdocs-build verdocs-template-fields{width:100%}verdocs-build verdocs-preview{-ms-flex:1;flex:1}verdocs-build .preview-container{-ms-flex-direction:row;flex-direction:row;display:-ms-flexbox;display:flex;width:100%;background-color:#eeeeee;max-height:100%}@media all and (max-width: 450px){verdocs-build .preview-container{-ms-flex-direction:column;flex-direction:column}}verdocs-build .preview-send-wrapper{display:-ms-flexbox;display:flex;-ms-flex:0 0 300px;flex:0 0 300px;background-color:#ffffff;-webkit-box-shadow:1px 1px 6px -2px #0000007f;box-shadow:1px 1px 6px -2px #0000007f}@media all and (max-width: 450px){verdocs-build .preview-send-wrapper{-ms-flex:0;flex:0}}verdocs-build .preview-preview-wrapper{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-pack:center;justify-content:center;overflow-y:scroll}';var VerdocsBuild=function(){function e(e){registerInstance(this,e);this.sdkError=createEvent(this,"sdkError",7);this.stepChanged=createEvent(this,"stepChanged",7);this.send=createEvent(this,"send",7);this.templateUpdated=createEvent(this,"templateUpdated",7);this.templateCreated=createEvent(this,"templateCreated",7);this.endpoint=VerdocsEndpoint.getDefault();this.templateId=null;this.step="preview";this.store=null}e.prototype.onTemplateIdChanged=function(e){console.log("Template ID changed",e);this.loadTemplate(e).catch((function(e){return console.log("Unknown Error",e)}))};e.prototype.onStepChanged=function(e){console.log("Step changed",e);this.loadTemplate(this.templateId).catch((function(e){return console.log("Unknown Error",e)}))};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,n;return __generator(this,(function(o){try{this.endpoint.loadSession();if(!this.templateId){console.log("[BUILD] No template ID, activating upload mode");this.step="attachments";return[2]}if(!this.endpoint.session){console.log("[BUILD] Unable to start builder session, must be authenticated");return[2]}this.loadTemplate(this.templateId).catch((function(e){return console.log("[BUILD] Unable to load template",e)}))}catch(o){console.log("[BUILD] Error loading template",o);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new SDKError(o.message,(t=o.response)===null||t===void 0?void 0:t.status,(n=o.response)===null||n===void 0?void 0:n.data))}return[2]}))}))};e.prototype.loadTemplate=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(n){switch(n.label){case 0:if(!e)return[3,2];console.log("Loading store",e);t=this;return[4,getTemplateStore(this.endpoint,e,true)];case 1:t.store=n.sent();forceUpdate(this.el);n.label=2;case 2:return[2]}}))}))};e.prototype.handleCancel=function(e){console.log("Cancel",e.detail);this.step="preview"};e.prototype.handleTemplateCreated=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(n){switch(n.label){case 0:return[4,this.loadTemplate(e)];case 1:n.sent();this.templateId=e;this.step="roles";(t=this.stepChanged)===null||t===void 0?void 0:t.emit("roles");return[2]}}))}))};e.prototype.handleTemplateUpdated=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(n){console.log("tup");(t=this.templateUpdated)===null||t===void 0?void 0:t.emit(e.detail);return[2]}))}))};e.prototype.handleAttachmentsNext=function(){var e;this.step="roles";(e=this.stepChanged)===null||e===void 0?void 0:e.emit("roles")};e.prototype.handleRolesNext=function(){var e;this.step="fields";(e=this.stepChanged)===null||e===void 0?void 0:e.emit("fields")};e.prototype.handleStepChanged=function(e){var t;console.log("osc",e);this.step=e;(t=this.stepChanged)===null||t===void 0?void 0:t.emit(e)};e.prototype.render=function(){var e=this;if(!this.endpoint.session){return h(Host,null,h("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if(!this.store){console.log("[BUILD] No template ID, rendering created view");return h(Host,null,h("div",{class:"content"},h("verdocs-template-build-tabs",{endpoint:this.endpoint,templateId:this.templateId,step:"attachments",onSdkError:function(t){var n;return(n=e.sdkError)===null||n===void 0?void 0:n.emit(t.detail)},onStepChanged:function(t){return e.handleStepChanged(t.detail)}}),h("verdocs-template-create",{endpoint:this.endpoint,onExit:function(t){return e.handleCancel(t)},onNext:function(){return e.handleAttachmentsNext()},onTemplateCreated:function(t){return e.handleTemplateCreated(t.detail.templateId)}})))}console.log("[BUILD] Rendering build view",this.templateId,this.step,["attachments","roles","settings","fields","preview"].indexOf(this.step));return h(Host,null,h("div",{class:"content"},h("verdocs-template-build-tabs",{endpoint:this.endpoint,templateId:this.templateId,step:this.step,onSdkError:function(t){var n;return(n=e.sdkError)===null||n===void 0?void 0:n.emit(t.detail)},onStepChanged:function(t){return e.handleStepChanged(t.detail)}}),this.step==="attachments"&&h("verdocs-template-attachments",{templateId:this.templateId,endpoint:this.endpoint,onExit:function(t){return e.handleCancel(t)},onNext:function(){return e.handleAttachmentsNext()},onTemplateUpdated:function(t){return e.handleTemplateUpdated(t)}}),this.step==="roles"&&h("verdocs-template-roles",{templateId:this.templateId,endpoint:this.endpoint,onExit:function(t){return e.handleCancel(t)},onNext:function(){return e.handleRolesNext()},onTemplateUpdated:function(t){return e.handleTemplateUpdated(t)}}),this.step==="settings"&&h("div",{style:{flexDirection:"column",gap:"20px",display:"flex",maxWidth:"400px",margin:"20px"}},h("verdocs-template-name",{templateId:this.templateId,endpoint:this.endpoint,style:{backgroundColor:"#ffffff",padding:"20px"},onTemplateUpdated:function(t){return e.handleTemplateUpdated(t)}}),h("verdocs-template-reminders",{templateId:this.templateId,endpoint:this.endpoint,style:{backgroundColor:"#ffffff",padding:"20px"},onTemplateUpdated:function(t){return e.handleTemplateUpdated(t)}}),h("verdocs-template-visibility",{templateId:this.templateId,endpoint:this.endpoint,style:{backgroundColor:"#ffffff",padding:"20px"},onTemplateUpdated:function(t){return e.handleTemplateUpdated(t)}})),this.step==="fields"&&h("verdocs-template-fields",{templateId:this.templateId,endpoint:this.endpoint,onTemplateUpdated:function(t){return e.handleTemplateUpdated(t)}}),this.step==="preview"&&h("div",{class:"preview-container"},h("div",{class:"preview-send-wrapper"},h("verdocs-send",{templateId:this.templateId,endpoint:this.endpoint,onSend:function(t){var n;return(n=e.send)===null||n===void 0?void 0:n.emit(t.detail)},style:{width:"100%"}})),h("div",{class:"preview-preview-wrapper"},h("verdocs-preview",{templateId:this.templateId,endpoint:this.endpoint,style:{display:"flex",flex:"1",maxWidth:"1000px"}})))))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{templateId:["onTemplateIdChanged"],step:["onStepChanged"]}},enumerable:false,configurable:true});return e}();VerdocsBuild.style=verdocsBuildCss;export{VerdocsBuild as verdocs_build};
1
+ var __awaiter=this&&this.__awaiter||function(e,t,n,o){function i(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,r){function a(e){try{s(o.next(e))}catch(e){r(e)}}function l(e){try{s(o["throw"](e))}catch(e){r(e)}}function s(e){e.done?n(e.value):i(e.value).then(a,l)}s((o=o.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},o,i,r,a;return a={next:l(0),throw:l(1),return:l(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function l(e){return function(t){return s([e,t])}}function s(a){if(o)throw new TypeError("Generator is already executing.");while(n)try{if(o=1,i&&(r=a[0]&2?i["return"]:a[0]?i["throw"]||((r=i["return"])&&r.call(i),0):i.next)&&!(r=r.call(i,a[1])).done)return r;if(i=0,r)a=[a[0]&2,r.value];switch(a[0]){case 0:case 1:r=a;break;case 4:n.label++;return{value:a[1],done:false};case 5:n.label++;i=a[1];a=[0];continue;case 7:a=n.ops.pop();n.trys.pop();continue;default:if(!(r=n.trys,r=r.length>0&&r[r.length-1])&&(a[0]===6||a[0]===2)){n=0;continue}if(a[0]===3&&(!r||a[1]>r[0]&&a[1]<r[3])){n.label=a[1];break}if(a[0]===6&&n.label<r[1]){n.label=r[1];r=a;break}if(r&&n.label<r[2]){n.label=r[2];n.ops.push(a);break}if(r[2])n.ops.pop();n.trys.pop();continue}a=t.call(e,n)}catch(e){a=[6,e];i=0}finally{o=r=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,f as forceUpdate,h,H as Host,a as getElement}from"./index-172625c5.js";import"./Types-5f31149e.js";import{V as VerdocsEndpoint}from"./VerdocsEndpoint-56fa3371.js";import{g as getTemplateStore}from"./TemplateStore-a2ebdaca.js";import{S as SDKError}from"./errors-9b5498c8.js";import"./index-4439b0d1.js";import"./TemplateFieldStore-4f1b6332.js";var verdocsBuildCss='verdocs-build{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-build .content{-ms-flex:1;flex:1;gap:20px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column}verdocs-build verdocs-template-attachments,verdocs-build verdocs-template-roles{margin:20px}verdocs-build verdocs-template-fields{border-top:1px solid #777777}verdocs-build verdocs-template-attachments{padding:20px;background:#ffffff}verdocs-build verdocs-template-fields{width:100%}verdocs-build verdocs-preview{-ms-flex:1;flex:1}verdocs-build .preview-container{-ms-flex-direction:row;flex-direction:row;display:-ms-flexbox;display:flex;width:100%;background-color:#eeeeee;max-height:100%}@media all and (max-width: 450px){verdocs-build .preview-container{-ms-flex-direction:column;flex-direction:column}}verdocs-build .preview-send-wrapper{display:-ms-flexbox;display:flex;-ms-flex:0 0 300px;flex:0 0 300px;background-color:#ffffff;-webkit-box-shadow:1px 1px 6px -2px #0000007f;box-shadow:1px 1px 6px -2px #0000007f}@media all and (max-width: 450px){verdocs-build .preview-send-wrapper{-ms-flex:0;flex:0}}verdocs-build .preview-preview-wrapper{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-pack:center;justify-content:center;overflow-y:scroll}';var VerdocsBuild=function(){function e(e){registerInstance(this,e);this.sdkError=createEvent(this,"sdkError",7);this.stepChanged=createEvent(this,"stepChanged",7);this.send=createEvent(this,"send",7);this.templateUpdated=createEvent(this,"templateUpdated",7);this.templateCreated=createEvent(this,"templateCreated",7);this.endpoint=VerdocsEndpoint.getDefault();this.templateId=null;this.step="preview";this.store=null}e.prototype.onTemplateIdChanged=function(e){console.log("Template ID changed",e);this.loadTemplate(e).catch((function(e){return console.log("Unknown Error",e)}))};e.prototype.onStepChanged=function(e){console.log("Step changed",e);this.loadTemplate(this.templateId).catch((function(e){return console.log("Unknown Error",e)}))};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,n;return __generator(this,(function(o){try{this.endpoint.loadSession();if(!this.templateId){console.log("[BUILD] No template ID, activating upload mode");this.step="attachments";return[2]}if(!this.endpoint.session){console.log("[BUILD] Unable to start builder session, must be authenticated");return[2]}this.loadTemplate(this.templateId).catch((function(e){return console.log("[BUILD] Unable to load template",e)}))}catch(o){console.log("[BUILD] Error loading template",o);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new SDKError(o.message,(t=o.response)===null||t===void 0?void 0:t.status,(n=o.response)===null||n===void 0?void 0:n.data))}return[2]}))}))};e.prototype.loadTemplate=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(n){switch(n.label){case 0:if(!e)return[3,2];console.log("Loading store",e);t=this;return[4,getTemplateStore(this.endpoint,e,true)];case 1:t.store=n.sent();forceUpdate(this.el);n.label=2;case 2:return[2]}}))}))};e.prototype.handleCancel=function(e){console.log("Cancel",e.detail);this.step="preview"};e.prototype.handleTemplateCreated=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(n){switch(n.label){case 0:return[4,this.loadTemplate(e)];case 1:n.sent();this.templateId=e;this.step="roles";(t=this.stepChanged)===null||t===void 0?void 0:t.emit("roles");return[2]}}))}))};e.prototype.handleTemplateUpdated=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(n){console.log("tup");(t=this.templateUpdated)===null||t===void 0?void 0:t.emit(e.detail);return[2]}))}))};e.prototype.handleAttachmentsNext=function(){var e;this.step="roles";(e=this.stepChanged)===null||e===void 0?void 0:e.emit("roles")};e.prototype.handleRolesNext=function(){var e;this.step="fields";(e=this.stepChanged)===null||e===void 0?void 0:e.emit("fields")};e.prototype.handleStepChanged=function(e){var t;console.log("osc",e);this.step=e;(t=this.stepChanged)===null||t===void 0?void 0:t.emit(e)};e.prototype.render=function(){var e=this;if(!this.endpoint.session){return h(Host,null,h("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if(!this.store){console.log("[BUILD] No template ID, rendering created view");return h(Host,null,h("div",{class:"content"},h("verdocs-template-build-tabs",{endpoint:this.endpoint,templateId:this.templateId,step:"attachments",onSdkError:function(t){var n;return(n=e.sdkError)===null||n===void 0?void 0:n.emit(t.detail)},onStepChanged:function(t){return e.handleStepChanged(t.detail)}}),h("verdocs-template-create",{endpoint:this.endpoint,onExit:function(t){return e.handleCancel(t)},onNext:function(){return e.handleAttachmentsNext()},onTemplateCreated:function(t){return e.handleTemplateCreated(t.detail.templateId)}})))}console.log("[BUILD] Rendering build view",this.templateId,this.step,["attachments","roles","settings","fields","preview"].indexOf(this.step));return h(Host,null,h("div",{class:"content"},h("verdocs-template-build-tabs",{endpoint:this.endpoint,templateId:this.templateId,step:this.step,onSdkError:function(t){var n;return(n=e.sdkError)===null||n===void 0?void 0:n.emit(t.detail)},onStepChanged:function(t){return e.handleStepChanged(t.detail)}}),this.step==="attachments"&&h("verdocs-template-attachments",{templateId:this.templateId,endpoint:this.endpoint,onExit:function(t){return e.handleCancel(t)},onNext:function(){return e.handleAttachmentsNext()},onTemplateUpdated:function(t){return e.handleTemplateUpdated(t)}}),this.step==="roles"&&h("verdocs-template-roles",{templateId:this.templateId,endpoint:this.endpoint,onExit:function(t){return e.handleCancel(t)},onNext:function(){return e.handleRolesNext()},onTemplateUpdated:function(t){return e.handleTemplateUpdated(t)}}),this.step==="settings"&&h("div",{style:{flexDirection:"column",gap:"20px",display:"flex",maxWidth:"400px",margin:"20px"}},h("verdocs-template-name",{templateId:this.templateId,endpoint:this.endpoint,style:{backgroundColor:"#ffffff",padding:"20px"},onTemplateUpdated:function(t){return e.handleTemplateUpdated(t)}}),h("verdocs-template-reminders",{templateId:this.templateId,endpoint:this.endpoint,style:{backgroundColor:"#ffffff",padding:"20px"},onTemplateUpdated:function(t){return e.handleTemplateUpdated(t)}}),h("verdocs-template-visibility",{templateId:this.templateId,endpoint:this.endpoint,style:{backgroundColor:"#ffffff",padding:"20px"},onTemplateUpdated:function(t){return e.handleTemplateUpdated(t)}})),this.step==="fields"&&h("verdocs-template-fields",{templateId:this.templateId,endpoint:this.endpoint,onTemplateUpdated:function(t){return e.handleTemplateUpdated(t)}}),this.step==="preview"&&h("div",{class:"preview-container"},h("div",{class:"preview-send-wrapper"},h("verdocs-send",{templateId:this.templateId,endpoint:this.endpoint,onSend:function(t){var n;return(n=e.send)===null||n===void 0?void 0:n.emit(t.detail)},style:{width:"100%"}})),h("div",{class:"preview-preview-wrapper"},h("verdocs-preview",{templateId:this.templateId,endpoint:this.endpoint,style:{display:"flex",flex:"1",maxWidth:"1000px"}})))))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{templateId:["onTemplateIdChanged"],step:["onStepChanged"]}},enumerable:false,configurable:true});return e}();VerdocsBuild.style=verdocsBuildCss;export{VerdocsBuild as verdocs_build};
@@ -1 +1 @@
1
- var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++){t=arguments[o];for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r))e[r]=t[r]}return e};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(e,t,o,i){function r(e){return e instanceof o?e:new o((function(t){t(e)}))}return new(o||(o=Promise))((function(o,n){function s(e){try{a(i.next(e))}catch(e){n(e)}}function l(e){try{a(i["throw"](e))}catch(e){n(e)}}function a(e){e.done?o(e.value):r(e.value).then(s,l)}a((i=i.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var o={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},i,r,n,s;return s={next:l(0),throw:l(1),return:l(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(e){return function(t){return a([e,t])}}function a(s){if(i)throw new TypeError("Generator is already executing.");while(o)try{if(i=1,r&&(n=s[0]&2?r["return"]:s[0]?r["throw"]||((n=r["return"])&&n.call(r),0):r.next)&&!(n=n.call(r,s[1])).done)return n;if(r=0,n)s=[s[0]&2,n.value];switch(s[0]){case 0:case 1:n=s;break;case 4:o.label++;return{value:s[1],done:false};case 5:o.label++;r=s[1];s=[0];continue;case 7:s=o.ops.pop();o.trys.pop();continue;default:if(!(n=o.trys,n=n.length>0&&n[n.length-1])&&(s[0]===6||s[0]===2)){o=0;continue}if(s[0]===3&&(!n||s[1]>n[0]&&s[1]<n[3])){o.label=s[1];break}if(s[0]===6&&o.label<n[1]){o.label=n[1];n=s;break}if(n&&o.label<n[2]){o.label=n[2];o.ops.push(s);break}if(n[2])o.ops.pop();o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e];r=0}finally{i=n=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,o){if(o||arguments.length===2)for(var i=0,r=t.length,n;i<r;i++){if(n||!(i in t)){if(!n)n=Array.prototype.slice.call(t,0,i);n[i]=t[i]}}return e.concat(n||Array.prototype.slice.call(t))};import{r as registerInstance,h,H as Host,c as createEvent,a as getElement}from"./index-172625c5.js";import{c as createPopper}from"./popper-15e448b4.js";import{a as commonjsGlobal}from"./_commonjsHelpers-5ec8f9b7.js";import"./Types-5f31149e.js";import{V as VerdocsEndpoint}from"./VerdocsEndpoint-b011af25.js";import{u as updateField,d as deleteField}from"./Fields-c82e6df3.js";import{g as getTemplateStore}from"./TemplateStore-018fc1db.js";import{S as SDKError}from"./errors-9b5498c8.js";import"./index-4439b0d1.js";var verdocsButtonPanelCss='verdocs-button-panel{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;display:inline-block}verdocs-button-panel .icon{display:inline-block;cursor:pointer;opacity:0.6}verdocs-button-panel .icon svg{fill:#707ae5}verdocs-button-panel .icon:hover{opacity:1}.verdocs-button-panel-content{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;-webkit-box-shadow:0 0 10px 1px #999999;box-shadow:0 0 10px 1px #999999;display:none;background:#ffffff;color:#33364b;width:320px;font-weight:bold;padding:15px;font-size:14px;position:relative;border-radius:4px;z-index:10000}.verdocs-button-panel-content .arrow,.verdocs-button-panel-content .arrow::before{position:absolute;width:8px;height:8px;background:inherit}.verdocs-button-panel-content .arrow{visibility:hidden;top:-4px}.verdocs-button-panel-content .arrow::before{visibility:visible;content:"";-webkit-transform:rotate(45deg);transform:rotate(45deg)}.verdocs-button-panel-content[data-show]{display:block}.verdocs-button-panel-content[data-popper-placement^=top]>.arrow{bottom:-4px}.verdocs-button-panel-content[data-popper-placement^=bottom]>.arrow{top:-4px}.verdocs-button-panel-content[data-popper-placement^=left]>.arrow{right:-4px}.verdocs-button-panel-content[data-popper-placement^=right]>.arrow{left:-4px}.verdocs-button-panel-content h6{font-size:16px;font-weight:bold;margin:0 0 16px 0;color:#092c4c;border-bottom:1px solid #cccccc}';var VerdocsButtonPanel=function(){function e(e){registerInstance(this,e);this.showing=false;this.icon=""}e.prototype.componentDidRender=function(){document.body.appendChild(this.panelEl);if(this.popperInstance){this.popperInstance.destroy()}this.popperInstance=createPopper(this.iconEl,this.panelEl,{})};e.prototype.disconnectedCallback=function(){if(this.popperInstance){this.popperInstance.destroy();this.popperInstance=null}if(this.panelEl){this.panelEl.remove()}};e.prototype.showPanel=function(){return __awaiter(this,void 0,void 0,(function(){var e,t;var o=this;return __generator(this,(function(i){(e=this.panelEl)===null||e===void 0?void 0:e.setAttribute("data-show","");(t=this.popperInstance)===null||t===void 0?void 0:t.update().catch((function(){}));this.showing=true;this.hiderEl=document.createElement("div");this.hiderEl.id="verdocs-button-panel-hider";this.hiderEl.style.zIndex="100";this.hiderEl.style.position="absolute";this.hiderEl.style.top="0px";this.hiderEl.style.left="0px";this.hiderEl.style.right="0px";this.hiderEl.style.bottom="0px";this.hiderEl.onclick=function(e){e.stopPropagation();o.toggle()};document.body.appendChild(this.hiderEl);return[2]}))}))};e.prototype.hidePanel=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){Array.from(document.getElementsByClassName("verdocs-button-panel-content")).forEach((function(e){e.removeAttribute("data-show")}));(e=document.getElementById("verdocs-button-panel-hider"))===null||e===void 0?void 0:e.remove();this.showing=false;return[2]}))}))};e.prototype.toggle=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:if(!this.showing)return[3,2];return[4,this.hidePanel()];case 1:e.sent();return[3,4];case 2:return[4,this.showPanel()];case 3:e.sent();e.label=4;case 4:return[2]}}))}))};e.prototype.render=function(){var e=this;return h(Host,null,h("div",{class:"icon",innerHTML:this.icon,onClick:function(t){t.stopPropagation();return e.toggle()},ref:function(t){return e.iconEl=t}}),h("div",{role:"tooltip",class:"verdocs-button-panel-content","data-popper-placement":"bottom",ref:function(t){return e.panelEl=t}},h("div",{"data-popper-arrow":"true",class:"arrow"}),h("slot",null)))};return e}();VerdocsButtonPanel.style=verdocsButtonPanelCss;var rng;var crypto=typeof commonjsGlobal!=="undefined"&&(commonjsGlobal.crypto||commonjsGlobal.msCrypto);if(crypto&&crypto.getRandomValues){var rnds8=new Uint8Array(16);rng=function e(){crypto.getRandomValues(rnds8);return rnds8}}if(!rng){var rnds=new Array(16);rng=function(){for(var e=0,t;e<16;e++){if((e&3)===0)t=Math.random()*4294967296;rnds[e]=t>>>((e&3)<<3)&255}return rnds}}var rngBrowser=rng;var byteToHex=[];for(var i=0;i<256;++i){byteToHex[i]=(i+256).toString(16).substr(1)}function bytesToUuid(e,t){var o=t||0;var i=byteToHex;return i[e[o++]]+i[e[o++]]+i[e[o++]]+i[e[o++]]+"-"+i[e[o++]]+i[e[o++]]+"-"+i[e[o++]]+i[e[o++]]+"-"+i[e[o++]]+i[e[o++]]+"-"+i[e[o++]]+i[e[o++]]+i[e[o++]]+i[e[o++]]+i[e[o++]]+i[e[o++]]}var bytesToUuid_1=bytesToUuid;var _seedBytes=rngBrowser();var _nodeId=[_seedBytes[0]|1,_seedBytes[1],_seedBytes[2],_seedBytes[3],_seedBytes[4],_seedBytes[5]];var _clockseq=(_seedBytes[6]<<8|_seedBytes[7])&16383;var _lastMSecs=0,_lastNSecs=0;function v1(e,t,o){var i=t&&o||0;var r=t||[];e=e||{};var n=e.clockseq!==undefined?e.clockseq:_clockseq;var s=e.msecs!==undefined?e.msecs:(new Date).getTime();var l=e.nsecs!==undefined?e.nsecs:_lastNSecs+1;var a=s-_lastMSecs+(l-_lastNSecs)/1e4;if(a<0&&e.clockseq===undefined){n=n+1&16383}if((a<0||s>_lastMSecs)&&e.nsecs===undefined){l=0}if(l>=1e4){throw new Error("uuid.v1(): Can't create more than 10M uuids/sec")}_lastMSecs=s;_lastNSecs=l;_clockseq=n;s+=122192928e5;var d=((s&268435455)*1e4+l)%4294967296;r[i++]=d>>>24&255;r[i++]=d>>>16&255;r[i++]=d>>>8&255;r[i++]=d&255;var p=s/4294967296*1e4&268435455;r[i++]=p>>>8&255;r[i++]=p&255;r[i++]=p>>>24&15|16;r[i++]=p>>>16&255;r[i++]=n>>>8|128;r[i++]=n&255;var c=e.node||_nodeId;for(var u=0;u<6;++u){r[i+u]=c[u]}return t?t:bytesToUuid_1(r)}var v1_1=v1;function v4(e,t,o){var i=t&&o||0;if(typeof e=="string"){t=e=="binary"?new Array(16):null;e=null}e=e||{};var r=e.random||(e.rng||rngBrowser)();r[6]=r[6]&15|64;r[8]=r[8]&63|128;if(t){for(var n=0;n<16;++n){t[i+n]=r[n]}}return t||bytesToUuid_1(r)}var v4_1=v4;var uuid=v4_1;uuid.v1=v1_1;uuid.v4=v4_1;var uuidBrowser=uuid;var verdocsTemplateFieldPropertiesCss='verdocs-template-field-properties{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-field-properties .buttons{display:-ms-flexbox;display:flex;margin-top:30px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-field-properties .buttons verdocs-button{margin-left:16px}verdocs-template-field-properties form .row{display:-ms-flexbox;display:flex;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;margin:0 0 10px 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-template-field-properties form .row .input-label{display:block;color:#555570;font-weight:700;font-size:14px;margin:0 0 4px 0;-ms-flex:0 0 100px;flex:0 0 100px}verdocs-template-field-properties verdocs-select-input{-ms-flex:1;flex:1;margin:0}verdocs-template-field-properties verdocs-text-input{margin:0;-ms-flex:1;flex:1}verdocs-template-field-properties verdocs-text-input label{margin:0;display:-ms-flexbox;display:flex;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-template-field-properties verdocs-text-input .input-label{-ms-flex:0 0 100px;flex:0 0 100px}verdocs-template-field-properties verdocs-text-input input{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex}verdocs-template-field-properties .checkbox-wrapper{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex}verdocs-template-field-properties .delete-button{height:34px;display:-ms-flexbox;display:flex;cursor:pointer;background:none;border-radius:4px;-ms-flex-align:center;align-items:center;border:1px solid #999;-ms-flex-pack:center;justify-content:center}verdocs-template-field-properties .delete-button:active{background:#f3f3f3}verdocs-template-field-properties .delete-button svg{width:24px;height:24px}verdocs-template-field-properties h6{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;font-size:16px;font-weight:bold;margin:0 0 8px 0;-ms-flex-direction:row;flex-direction:row;color:#092c4c}verdocs-template-field-properties h6 .help-icon{opacity:0.5}verdocs-template-field-properties h6 .help-icon:hover{opacity:1;cursor:pointer}verdocs-template-field-properties .row-header{gap:15px;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}verdocs-template-field-properties .row-header h6{margin-bottom:0}verdocs-template-field-properties .row-header verdocs-help-icon{-webkit-transform:scale(0.85);transform:scale(0.85)}verdocs-template-field-properties .row-header verdocs-help-icon svg{margin-bottom:-5px}verdocs-template-field-properties .row-header .add-button{margin:0;padding:0;border:none;opacity:0.5;cursor:pointer;background:none}verdocs-template-field-properties .row-header .add-button:hover{opacity:1}verdocs-template-field-properties .row-header .add-button svg{width:32px;height:32px}verdocs-template-field-properties .option-row{margin:15px 0}verdocs-template-field-properties .option-row .remove-button{height:28px;display:-ms-flexbox;display:flex;cursor:pointer;background:none;border-radius:4px;-ms-flex-align:center;align-items:center;border:1px solid #999;-ms-flex-pack:center;justify-content:center}verdocs-template-field-properties .option-row .remove-button:active{background:#f3f3f3}verdocs-template-field-properties .option-row .remove-button:hover svg{stroke:#a50021}verdocs-template-field-properties .option-row .remove-button svg{width:20px;height:20px;stroke:#333333}verdocs-template-field-properties .options{background:#f3f3f3;padding:0 0 10px 0}verdocs-template-field-properties .options .row-header,verdocs-template-field-properties .options .option-row{padding:0 10px}verdocs-template-field-properties .options .add-option-button{border-radius:5px;border:1px solid #cccccc;background:#46497d;color:#ffffff;padding:3px 8px}verdocs-template-field-properties .options .option-row .input-element{font-size:14px}verdocs-template-field-properties .options verdocs-help-icon{opacity:1;-webkit-transform:scale(0.8);transform:scale(0.8)}verdocs-template-field-properties .options verdocs-help-icon svg{fill:#ffffff}';var capitalize=function(e){return e.charAt(0).toUpperCase()+e.slice(1)};var TrashIcon='<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="#a50021"><path stroke-linecap="round" stroke-linejoin="round" d="M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0" /></svg>';var HelpIcon='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path d="M11.925 18q.55 0 .938-.387.387-.388.387-.938 0-.55-.387-.925-.388-.375-.938-.375-.55 0-.925.375t-.375.925q0 .55.375.938.375.387.925.387Zm-.95-3.85h1.95q0-.8.2-1.287.2-.488 1.025-1.288.65-.625 1.025-1.213.375-.587.375-1.437 0-1.425-1.025-2.175Q13.5 6 12.1 6q-1.425 0-2.35.775t-1.275 1.85l1.775.7q.125-.45.55-.975.425-.525 1.275-.525.725 0 1.1.412.375.413.375.888 0 .475-.287.9-.288.425-.713.775-1.075.95-1.325 1.475-.25.525-.25 1.875ZM12 22.2q-2.125 0-3.988-.8-1.862-.8-3.237-2.175Q3.4 17.85 2.6 15.988 1.8 14.125 1.8 12t.8-3.988q.8-1.862 2.175-3.237Q6.15 3.4 8.012 2.6 9.875 1.8 12 1.8t3.988.8q1.862.8 3.237 2.175Q20.6 6.15 21.4 8.012q.8 1.863.8 3.988t-.8 3.988q-.8 1.862-2.175 3.237Q17.85 20.6 15.988 21.4q-1.863.8-3.988.8Zm0-2.275q3.325 0 5.625-2.3t2.3-5.625q0-3.325-2.3-5.625T12 4.075q-3.325 0-5.625 2.3T4.075 12q0 3.325 2.3 5.625t5.625 2.3ZM12 12Z"/></svg>';var VerdocsTemplateFieldProperties=function(){function e(e){registerInstance(this,e);this.close=createEvent(this,"close",7);this.delete=createEvent(this,"delete",7);this.settingsChanged=createEvent(this,"settingsChanged",7);this.sdkError=createEvent(this,"sdkError",7);this.store=null;this.endpoint=VerdocsEndpoint.getDefault();this.templateId="";this.fieldName="";this.helpText="";this.dirty=false;this.loading=true;this.type="signature";this.setting=null;this.name="";this.roleName="";this.group="";this.fieldType="";this.required=false;this.options=[];this.placeholder="";this.value="";this.leading=0;this.showingHelp=false}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,o,i,r,n,s,l,a,d,p,c;var u=this;return __generator(this,(function(h){switch(h.label){case 0:h.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.templateId){console.log("[FIELD PROPERTIES] Missing required template ID ".concat(this.templateId));return[2]}if(!this.fieldName){console.error("[FIELD PROPERTIES] Missing required field name");return[2]}if(!this.endpoint.session){console.log("[FIELD PROPERTIES] Unable to start builder session, must be authenticated");return[2]}d=this;return[4,getTemplateStore(this.endpoint,this.templateId,false)];case 1:d.store=h.sent();p=(t=(e=this.store)===null||e===void 0?void 0:e.state)===null||t===void 0?void 0:t.fields.find((function(e){return e.name===u.fieldName}));if(!p){console.log('[FIELD PROPERTIES] Unable to find field "'.concat(this.fieldName,'" in template'))}this.type=p.type;this.name=p.name;this.group=p.name;this.roleName=p.role_name;this.required=p.required;this.fieldType=p.type;this.placeholder=((o=p.setting)===null||o===void 0?void 0:o.placeholder)||"";this.value=((i=p.setting)===null||i===void 0?void 0:i.result)||"";this.leading=((r=p.setting)===null||r===void 0?void 0:r.leading)||0;this.setting=p.setting||{};this.options=((n=p.setting)===null||n===void 0?void 0:n.options)||[];this.dirty=false;this.loading=false;return[3,3];case 2:c=h.sent();console.log("[FIELD PROPERTIES] Error loading template",c);this.loading=false;(s=this.sdkError)===null||s===void 0?void 0:s.emit(new SDKError(c.message,(l=c.response)===null||l===void 0?void 0:l.status,(a=c.response)===null||a===void 0?void 0:a.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleCancel=function(e){var t=this;var o,i,r,n,s,l;e.stopPropagation();var a=(i=(o=this.store)===null||o===void 0?void 0:o.state)===null||i===void 0?void 0:i.fields.find((function(e){return e.name===t.fieldName}));if(a){this.name=a.name;this.roleName=a.role_name;this.required=a.required;this.placeholder=((r=a.setting)===null||r===void 0?void 0:r.placeholder)||"";this.value=((n=a.setting)===null||n===void 0?void 0:n.result)||"";this.leading=((s=a.setting)===null||s===void 0?void 0:s.leading)||0}this.dirty=false;(l=this.close)===null||l===void 0?void 0:l.emit()};e.prototype.handleSave=function(e){var t=this;e.stopPropagation();var o={name:this.name,required:this.required,role_name:this.roleName};if(this.type==="checkbox_group"||this.type==="radio_button_group"){o.setting=this.setting;o.setting.options=this.options}else if(this.type==="textarea"||this.type==="textbox"){o.setting=__assign({},this.setting);o.setting.result=(this.value||"").trim()}else if(this.type==="dropdown"){o.setting={x:this.setting.x,y:this.setting.y,options:this.options}}updateField(this.endpoint,this.templateId,this.fieldName,o).then((function(e){var i,r;t.dirty=false;t.updateField(e);(i=t.settingsChanged)===null||i===void 0?void 0:i.emit({fieldName:t.fieldName,settings:o,field:e});(r=t.close)===null||r===void 0?void 0:r.emit()})).catch((function(){console.log("Field update failed",e)}))};e.prototype.handleAddOption=function(e){var t=this;e.stopPropagation();var o={name:this.name,required:this.required,role_name:this.roleName};this.options.push(this.type==="radio_button_group"?{id:uuidBrowser(),value:"Option ".concat(this.options.length+1),selected:false,x:this.options.length>0?this.options[this.options.length-1].x:20,y:this.options.length>0?this.options[this.options.length-1].y-25:20}:{id:uuidBrowser(),value:"Option ".concat(this.options.length+1),checked:false,x:this.options.length>0?this.options[this.options.length-1].x:20,y:this.options.length>0?this.options[this.options.length-1].y-25:20});o.setting=__assign({},this.setting);delete o.setting.result;o.setting.options=__spreadArray([],this.options,true);updateField(this.endpoint,this.templateId,this.fieldName,o).then((function(e){var i,r;t.dirty=false;t.updateField(e);(i=t.settingsChanged)===null||i===void 0?void 0:i.emit({fieldName:t.fieldName,settings:o,field:e});(r=t.close)===null||r===void 0?void 0:r.emit()})).catch((function(){console.log("Field update failed",e)}))};e.prototype.updateField=function(e){var t=this;var o=__spreadArray([],this.store.state.fields,true);o.forEach((function(o){if(o.name===t.fieldName){Object.assign(o,e)}}));this.store.state.fields=o};e.prototype.handleDelete=function(e){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(o){e.stopPropagation();if(window.confirm("Are you sure you wish to remove this field? This action cannot be undone.")){deleteField(this.endpoint,this.templateId,this.fieldName).then((function(){var e,o,i,r,n;t.store.state.fields=__spreadArray([],(o=(e=t.store)===null||e===void 0?void 0:e.state)===null||o===void 0?void 0:o.fields.filter((function(e){return e.name!==t.fieldName})),true);(r=(i=t.store)===null||i===void 0?void 0:i.state)===null||r===void 0?void 0:r.roles.forEach((function(e){e.fields=__spreadArray([],e.fields.filter((function(e){return e.name!==t.fieldName})),true)}));(n=t.delete)===null||n===void 0?void 0:n.emit({templateId:t.templateId,roleName:t.roleName})})).catch((function(e){console.log("[FIELD PROPERTIES] Deletion error",e)}))}return[2]}))}))};e.prototype.render=function(){var e=this;var t,o,i,r;if(!this.endpoint.session){return h(Host,null,h("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if(!this.endpoint.session||!((o=(t=this.store)===null||t===void 0?void 0:t.state)===null||o===void 0?void 0:o.isLoaded)){return h(Host,{class:"empty"})}if(this.helpText&&this.showingHelp){return h(Host,null,h("h6",null,capitalize(this.fieldType)," Settings ",h("div",{style:{flex:"1"}}),h("div",{class:"help-icon",innerHTML:HelpIcon,onClick:function(){return e.showingHelp=false}})),h("p",{class:"instructions",innerHTML:this.helpText}))}return h(Host,null,h("h6",null,capitalize(this.fieldType.replace(/_/g," "))," Settings ",h("div",{style:{flex:"1"}}),this.helpText&&h("div",{class:"help-icon",innerHTML:HelpIcon,onClick:function(){return e.showingHelp=true}})),h("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},h("div",{class:"row"},h("verdocs-text-input",{id:"verdocs-field-name",label:"Field Name",value:this.name,autocomplete:"off",placeholder:"Field Name...",onInput:function(t){e.name=t.target.value;e.dirty=true}})),h("div",{class:"row"},h("div",{class:"input-label"},"Role:"),h("verdocs-select-input",{value:this.roleName,options:(r=(i=this.store)===null||i===void 0?void 0:i.state)===null||r===void 0?void 0:r.roles.map((function(e){return{label:e.name,value:e.name}})),onInput:function(t){e.roleName=t.target.value;e.dirty=true}})),["textbox","textarea"].includes(this.type)&&h("div",{class:"row",style:{marginTop:"10px",marginBottom:"10px"}},h("verdocs-text-input",{id:"verdocs-field-value",label:"Value",value:this.value,autocomplete:"off",placeholder:"Pre-defined value...",onInput:function(t){e.value=t.target.value;e.dirty=true}})),["textbox","textarea"].includes(this.type)&&h("div",{class:"row",style:{marginTop:"10px",marginBottom:"10px"}},h("verdocs-text-input",{id:"verdocs-field-placeholder",label:"Placeholder",value:this.placeholder,autocomplete:"off",placeholder:"Placeholder...",onInput:function(t){e.placeholder=t.target.value;e.dirty=true}})),h("div",{class:"row",style:{marginTop:"15px",marginBottom:"15px"}},h("label",{htmlFor:"verdocs-is-required",class:"input-label"},"Required"),h("verdocs-checkbox",{id:"verdocs-is-required",name:"is-required",checked:this.required,value:"on",onInput:function(t){e.required=t.target.checked;e.dirty=true}})),["checkbox_group","radio_button_group"].includes(this.type)&&h("verdocs-button",{size:"small",onClick:function(t){return e.handleAddOption(t)},label:"Add Option"}),["dropdown"].includes(this.type)&&h("div",{class:"options"},h("div",{class:"row",style:{marginTop:"15px",marginBottom:"15px",textAlign:"center",fontWeight:"700",fontSize:"14px",justifyContent:"center",backgroundColor:"#333333",padding:"5px 8px",color:"#ffffff"}},"Options"),h("div",{class:"row-header"},h("h6",null,"ID"),h("h6",null,"Label"),h("div",{style:{width:"34px"}})),this.options.map((function(t,o){return h("div",{class:"row option-row",key:o},h("verdocs-text-input",{id:"verdocs-option-id-".concat(t.id),value:t.id,placeholder:"Unique ID",onInput:function(t){e.options[o].id=t.target.value;e.dirty=true}}),h("verdocs-text-input",{id:"verdocs-option-value-".concat(t.id),value:t.value,placeholder:"Display value",onInput:function(t){e.options[o].value=t.target.value;e.dirty=true}}),h("button",{innerHTML:TrashIcon,class:"remove-button",onClick:function(){e.options=e.options.filter((function(e){return e.id!==t.id}));e.dirty=true}}))})),h("div",{class:"row-header"},h("button",{class:"add-option-button",onClick:function(){e.options=__spreadArray(__spreadArray([],e.options,true),[{id:"option-".concat(e.options.length+1),value:"Option ".concat(e.options.length+1)}],false);e.dirty=true}},"Add Option"))),h("div",{class:"buttons"},h("button",{class:"delete-button",disabled:this.dirty,onClick:function(t){return e.handleDelete(t)},innerHTML:TrashIcon}),h("div",{style:{flex:"1"}}),h("verdocs-button",{size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:function(t){return e.handleCancel(t)}}),h("verdocs-button",{size:"small",label:"Save",disabled:!this.dirty,onClick:function(t){return e.handleSave(t)}}))))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();VerdocsTemplateFieldProperties.style=verdocsTemplateFieldPropertiesCss;export{VerdocsButtonPanel as verdocs_button_panel,VerdocsTemplateFieldProperties as verdocs_template_field_properties};
1
+ var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++){t=arguments[o];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(e,t,o,i){function n(e){return e instanceof o?e:new o((function(t){t(e)}))}return new(o||(o=Promise))((function(o,r){function s(e){try{a(i.next(e))}catch(e){r(e)}}function l(e){try{a(i["throw"](e))}catch(e){r(e)}}function a(e){e.done?o(e.value):n(e.value).then(s,l)}a((i=i.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var o={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,n,r,s;return s={next:l(0),throw:l(1),return:l(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(e){return function(t){return a([e,t])}}function a(s){if(i)throw new TypeError("Generator is already executing.");while(o)try{if(i=1,n&&(r=s[0]&2?n["return"]:s[0]?n["throw"]||((r=n["return"])&&r.call(n),0):n.next)&&!(r=r.call(n,s[1])).done)return r;if(n=0,r)s=[s[0]&2,r.value];switch(s[0]){case 0:case 1:r=s;break;case 4:o.label++;return{value:s[1],done:false};case 5:o.label++;n=s[1];s=[0];continue;case 7:s=o.ops.pop();o.trys.pop();continue;default:if(!(r=o.trys,r=r.length>0&&r[r.length-1])&&(s[0]===6||s[0]===2)){o=0;continue}if(s[0]===3&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(s[0]===6&&o.label<r[1]){o.label=r[1];r=s;break}if(r&&o.label<r[2]){o.label=r[2];o.ops.push(s);break}if(r[2])o.ops.pop();o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e];n=0}finally{i=r=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,o){if(o||arguments.length===2)for(var i=0,n=t.length,r;i<n;i++){if(r||!(i in t)){if(!r)r=Array.prototype.slice.call(t,0,i);r[i]=t[i]}}return e.concat(r||Array.prototype.slice.call(t))};import{r as registerInstance,h,H as Host,c as createEvent,a as getElement}from"./index-172625c5.js";import{c as createPopper}from"./popper-15e448b4.js";import{a as commonjsGlobal}from"./_commonjsHelpers-8a9f3b18.js";import"./Types-5f31149e.js";import{V as VerdocsEndpoint}from"./VerdocsEndpoint-56fa3371.js";import{u as updateField,d as deleteField}from"./Fields-c82e6df3.js";import{c as createTemplateFieldStore}from"./TemplateFieldStore-4f1b6332.js";import{g as getTemplateStore}from"./TemplateStore-a2ebdaca.js";import{S as SDKError}from"./errors-9b5498c8.js";import"./index-4439b0d1.js";var verdocsButtonPanelCss='verdocs-button-panel{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;display:inline-block}verdocs-button-panel .icon{display:inline-block;cursor:pointer;opacity:0.6}verdocs-button-panel .icon svg{fill:#707ae5}verdocs-button-panel .icon:hover{opacity:1}.verdocs-button-panel-content{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;-webkit-box-shadow:0 0 10px 1px #999999;box-shadow:0 0 10px 1px #999999;display:none;background:#ffffff;color:#33364b;width:320px;font-weight:bold;padding:15px;font-size:14px;position:relative;border-radius:4px;z-index:10000}.verdocs-button-panel-content .arrow,.verdocs-button-panel-content .arrow::before{position:absolute;width:8px;height:8px;background:inherit}.verdocs-button-panel-content .arrow{visibility:hidden;top:-4px}.verdocs-button-panel-content .arrow::before{visibility:visible;content:"";-webkit-transform:rotate(45deg);transform:rotate(45deg)}.verdocs-button-panel-content[data-show]{display:block}.verdocs-button-panel-content[data-popper-placement^=top]>.arrow{bottom:-4px}.verdocs-button-panel-content[data-popper-placement^=bottom]>.arrow{top:-4px}.verdocs-button-panel-content[data-popper-placement^=left]>.arrow{right:-4px}.verdocs-button-panel-content[data-popper-placement^=right]>.arrow{left:-4px}.verdocs-button-panel-content h6{font-size:16px;font-weight:bold;margin:0 0 16px 0;color:#092c4c;border-bottom:1px solid #cccccc}';var VerdocsButtonPanel=function(){function e(e){registerInstance(this,e);this.showing=false;this.icon=""}e.prototype.componentDidRender=function(){document.body.appendChild(this.panelEl);if(this.popperInstance){this.popperInstance.destroy()}this.popperInstance=createPopper(this.iconEl,this.panelEl,{})};e.prototype.disconnectedCallback=function(){if(this.popperInstance){this.popperInstance.destroy();this.popperInstance=null}if(this.panelEl){this.panelEl.remove()}};e.prototype.showPanel=function(){return __awaiter(this,void 0,void 0,(function(){var e,t;var o=this;return __generator(this,(function(i){(e=this.panelEl)===null||e===void 0?void 0:e.setAttribute("data-show","");(t=this.popperInstance)===null||t===void 0?void 0:t.update().catch((function(){}));this.showing=true;this.hiderEl=document.createElement("div");this.hiderEl.id="verdocs-button-panel-hider";this.hiderEl.style.zIndex="100";this.hiderEl.style.position="absolute";this.hiderEl.style.top="0px";this.hiderEl.style.left="0px";this.hiderEl.style.right="0px";this.hiderEl.style.bottom="0px";this.hiderEl.onclick=function(e){e.stopPropagation();o.toggle()};document.body.appendChild(this.hiderEl);return[2]}))}))};e.prototype.hidePanel=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){Array.from(document.getElementsByClassName("verdocs-button-panel-content")).forEach((function(e){e.removeAttribute("data-show")}));(e=document.getElementById("verdocs-button-panel-hider"))===null||e===void 0?void 0:e.remove();this.showing=false;return[2]}))}))};e.prototype.toggle=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:if(!this.showing)return[3,2];return[4,this.hidePanel()];case 1:e.sent();return[3,4];case 2:return[4,this.showPanel()];case 3:e.sent();e.label=4;case 4:return[2]}}))}))};e.prototype.render=function(){var e=this;return h(Host,null,h("div",{class:"icon",innerHTML:this.icon,onClick:function(t){t.stopPropagation();return e.toggle()},ref:function(t){return e.iconEl=t}}),h("div",{role:"tooltip",class:"verdocs-button-panel-content","data-popper-placement":"bottom",ref:function(t){return e.panelEl=t}},h("div",{"data-popper-arrow":"true",class:"arrow"}),h("slot",null)))};return e}();VerdocsButtonPanel.style=verdocsButtonPanelCss;var rng;var crypto=typeof commonjsGlobal!=="undefined"&&(commonjsGlobal.crypto||commonjsGlobal.msCrypto);if(crypto&&crypto.getRandomValues){var rnds8=new Uint8Array(16);rng=function e(){crypto.getRandomValues(rnds8);return rnds8}}if(!rng){var rnds=new Array(16);rng=function(){for(var e=0,t;e<16;e++){if((e&3)===0)t=Math.random()*4294967296;rnds[e]=t>>>((e&3)<<3)&255}return rnds}}var rngBrowser=rng;var byteToHex=[];for(var i=0;i<256;++i){byteToHex[i]=(i+256).toString(16).substr(1)}function bytesToUuid(e,t){var o=t||0;var i=byteToHex;return i[e[o++]]+i[e[o++]]+i[e[o++]]+i[e[o++]]+"-"+i[e[o++]]+i[e[o++]]+"-"+i[e[o++]]+i[e[o++]]+"-"+i[e[o++]]+i[e[o++]]+"-"+i[e[o++]]+i[e[o++]]+i[e[o++]]+i[e[o++]]+i[e[o++]]+i[e[o++]]}var bytesToUuid_1=bytesToUuid;var _seedBytes=rngBrowser();var _nodeId=[_seedBytes[0]|1,_seedBytes[1],_seedBytes[2],_seedBytes[3],_seedBytes[4],_seedBytes[5]];var _clockseq=(_seedBytes[6]<<8|_seedBytes[7])&16383;var _lastMSecs=0,_lastNSecs=0;function v1(e,t,o){var i=t&&o||0;var n=t||[];e=e||{};var r=e.clockseq!==undefined?e.clockseq:_clockseq;var s=e.msecs!==undefined?e.msecs:(new Date).getTime();var l=e.nsecs!==undefined?e.nsecs:_lastNSecs+1;var a=s-_lastMSecs+(l-_lastNSecs)/1e4;if(a<0&&e.clockseq===undefined){r=r+1&16383}if((a<0||s>_lastMSecs)&&e.nsecs===undefined){l=0}if(l>=1e4){throw new Error("uuid.v1(): Can't create more than 10M uuids/sec")}_lastMSecs=s;_lastNSecs=l;_clockseq=r;s+=122192928e5;var d=((s&268435455)*1e4+l)%4294967296;n[i++]=d>>>24&255;n[i++]=d>>>16&255;n[i++]=d>>>8&255;n[i++]=d&255;var p=s/4294967296*1e4&268435455;n[i++]=p>>>8&255;n[i++]=p&255;n[i++]=p>>>24&15|16;n[i++]=p>>>16&255;n[i++]=r>>>8|128;n[i++]=r&255;var c=e.node||_nodeId;for(var u=0;u<6;++u){n[i+u]=c[u]}return t?t:bytesToUuid_1(n)}var v1_1=v1;function v4(e,t,o){var i=t&&o||0;if(typeof e=="string"){t=e=="binary"?new Array(16):null;e=null}e=e||{};var n=e.random||(e.rng||rngBrowser)();n[6]=n[6]&15|64;n[8]=n[8]&63|128;if(t){for(var r=0;r<16;++r){t[i+r]=n[r]}}return t||bytesToUuid_1(n)}var v4_1=v4;var uuid=v4_1;uuid.v1=v1_1;uuid.v4=v4_1;var uuidBrowser=uuid;var verdocsTemplateFieldPropertiesCss='verdocs-template-field-properties{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-field-properties .buttons{display:-ms-flexbox;display:flex;margin-top:30px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-field-properties .buttons verdocs-button{margin-left:16px}verdocs-template-field-properties form .row{display:-ms-flexbox;display:flex;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;margin:0 0 10px 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-template-field-properties form .row .input-label{display:block;color:#555570;font-weight:700;font-size:14px;margin:0 0 4px 0;-ms-flex:0 0 100px;flex:0 0 100px}verdocs-template-field-properties verdocs-select-input{-ms-flex:1;flex:1;margin:0}verdocs-template-field-properties verdocs-text-input{margin:0;-ms-flex:1;flex:1}verdocs-template-field-properties verdocs-text-input label{margin:0;display:-ms-flexbox;display:flex;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-template-field-properties verdocs-text-input .input-label{-ms-flex:0 0 100px;flex:0 0 100px}verdocs-template-field-properties verdocs-text-input input{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex}verdocs-template-field-properties .checkbox-wrapper{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex}verdocs-template-field-properties .delete-button{height:34px;display:-ms-flexbox;display:flex;cursor:pointer;background:none;border-radius:4px;-ms-flex-align:center;align-items:center;border:1px solid #999;-ms-flex-pack:center;justify-content:center}verdocs-template-field-properties .delete-button:active{background:#f3f3f3}verdocs-template-field-properties .delete-button svg{width:24px;height:24px}verdocs-template-field-properties h6{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;font-size:16px;font-weight:bold;margin:0 0 8px 0;-ms-flex-direction:row;flex-direction:row;color:#092c4c}verdocs-template-field-properties h6 .help-icon{opacity:0.5}verdocs-template-field-properties h6 .help-icon:hover{opacity:1;cursor:pointer}verdocs-template-field-properties .row-header{gap:15px;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}verdocs-template-field-properties .row-header h6{margin-bottom:0}verdocs-template-field-properties .row-header verdocs-help-icon{-webkit-transform:scale(0.85);transform:scale(0.85)}verdocs-template-field-properties .row-header verdocs-help-icon svg{margin-bottom:-5px}verdocs-template-field-properties .row-header .add-button{margin:0;padding:0;border:none;opacity:0.5;cursor:pointer;background:none}verdocs-template-field-properties .row-header .add-button:hover{opacity:1}verdocs-template-field-properties .row-header .add-button svg{width:32px;height:32px}verdocs-template-field-properties .option-row{margin:15px 0}verdocs-template-field-properties .option-row .remove-button{height:28px;display:-ms-flexbox;display:flex;cursor:pointer;background:none;border-radius:4px;-ms-flex-align:center;align-items:center;border:1px solid #999;-ms-flex-pack:center;justify-content:center}verdocs-template-field-properties .option-row .remove-button:active{background:#f3f3f3}verdocs-template-field-properties .option-row .remove-button:hover svg{stroke:#a50021}verdocs-template-field-properties .option-row .remove-button svg{width:20px;height:20px;stroke:#333333}verdocs-template-field-properties .options{background:#f3f3f3;padding:0 0 10px 0}verdocs-template-field-properties .options .row-header,verdocs-template-field-properties .options .option-row{padding:0 10px}verdocs-template-field-properties .options .add-option-button{border-radius:5px;border:1px solid #cccccc;background:#46497d;color:#ffffff;padding:3px 8px}verdocs-template-field-properties .options .option-row .input-element{font-size:14px}verdocs-template-field-properties .options verdocs-help-icon{opacity:1;-webkit-transform:scale(0.8);transform:scale(0.8)}verdocs-template-field-properties .options verdocs-help-icon svg{fill:#ffffff}';var capitalize=function(e){return e.charAt(0).toUpperCase()+e.slice(1)};var TrashIcon='<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="#a50021"><path stroke-linecap="round" stroke-linejoin="round" d="M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0" /></svg>';var HelpIcon='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path d="M11.925 18q.55 0 .938-.387.387-.388.387-.938 0-.55-.387-.925-.388-.375-.938-.375-.55 0-.925.375t-.375.925q0 .55.375.938.375.387.925.387Zm-.95-3.85h1.95q0-.8.2-1.287.2-.488 1.025-1.288.65-.625 1.025-1.213.375-.587.375-1.437 0-1.425-1.025-2.175Q13.5 6 12.1 6q-1.425 0-2.35.775t-1.275 1.85l1.775.7q.125-.45.55-.975.425-.525 1.275-.525.725 0 1.1.412.375.413.375.888 0 .475-.287.9-.288.425-.713.775-1.075.95-1.325 1.475-.25.525-.25 1.875ZM12 22.2q-2.125 0-3.988-.8-1.862-.8-3.237-2.175Q3.4 17.85 2.6 15.988 1.8 14.125 1.8 12t.8-3.988q.8-1.862 2.175-3.237Q6.15 3.4 8.012 2.6 9.875 1.8 12 1.8t3.988.8q1.862.8 3.237 2.175Q20.6 6.15 21.4 8.012q.8 1.863.8 3.988t-.8 3.988q-.8 1.862-2.175 3.237Q17.85 20.6 15.988 21.4q-1.863.8-3.988.8Zm0-2.275q3.325 0 5.625-2.3t2.3-5.625q0-3.325-2.3-5.625T12 4.075q-3.325 0-5.625 2.3T4.075 12q0 3.325 2.3 5.625t5.625 2.3ZM12 12Z"/></svg>';var VerdocsTemplateFieldProperties=function(){function e(e){registerInstance(this,e);this.close=createEvent(this,"close",7);this.delete=createEvent(this,"delete",7);this.settingsChanged=createEvent(this,"settingsChanged",7);this.sdkError=createEvent(this,"sdkError",7);this.templateStore=null;this.fieldStore=null;this.watcher=null;this.endpoint=VerdocsEndpoint.getDefault();this.templateId="";this.fieldName="";this.helpText="";this.dirty=false;this.loading=true;this.setting=null;this.label="";this.type="textbox";this.name="";this.required=false;this.roleName="";this.group="";this.fieldType="";this.options=[];this.placeholder="";this.value="";this.leading=0;this.showingHelp=false}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,o,i,n,r,s,l,a,d,p;var c=this;return __generator(this,(function(u){switch(u.label){case 0:u.trys.push([0,3,,4]);this.endpoint.loadSession();if(!this.templateId){console.log("[FIELD PROPERTIES] Missing required template ID ".concat(this.templateId));return[2]}if(!this.fieldName){console.error("[FIELD PROPERTIES] Missing required field name");return[2]}if(!this.endpoint.session){console.log("[FIELD PROPERTIES] Unable to start builder session, must be authenticated");return[2]}l=this;return[4,getTemplateStore(this.endpoint,this.templateId)];case 1:l.templateStore=u.sent();a=this;return[4,createTemplateFieldStore(this.templateStore.state)];case 2:a.fieldStore=u.sent();d=this.fieldStore.get(this.fieldName);if(!d){console.log('[FIELD PROPERTIES] Unable to find field "'.concat(this.fieldName,'" in fields'))}else{console.log("props",d)}createTemplateFieldStore(this.templateStore.state);this.watcher=this.fieldStore.onChange(this.fieldName,(function(e){var t,o,i,n;console.log("Field changed",e);c.type=e.type;c.name=e.name;c.label=e.label;c.group=e.name;c.roleName=e.role_name;c.required=e.required;c.fieldType=e.type;c.placeholder=((t=e.setting)===null||t===void 0?void 0:t.placeholder)||"";c.value=((o=e.setting)===null||o===void 0?void 0:o.result)||"";c.leading=((i=e.setting)===null||i===void 0?void 0:i.leading)||0;c.setting=e.setting||{};c.options=((n=e.setting)===null||n===void 0?void 0:n.options)||[];c.dirty=false;c.loading=false}));console.log("watcher",this.watcher);this.type=d.type;this.name=d.name;this.label=d.label;this.group=d.name;this.roleName=d.role_name;this.required=d.required;this.fieldType=d.type;this.placeholder=((e=d.setting)===null||e===void 0?void 0:e.placeholder)||"";this.value=((t=d.setting)===null||t===void 0?void 0:t.result)||"";this.leading=((o=d.setting)===null||o===void 0?void 0:o.leading)||0;this.setting=d.setting||{};this.options=((i=d.setting)===null||i===void 0?void 0:i.options)||[];this.dirty=false;this.loading=false;console.log("Displaying settings for",this.setting);return[3,4];case 3:p=u.sent();console.log("[FIELD PROPERTIES] Error loading template",p);this.loading=false;(n=this.sdkError)===null||n===void 0?void 0:n.emit(new SDKError(p.message,(r=p.response)===null||r===void 0?void 0:r.status,(s=p.response)===null||s===void 0?void 0:s.data));return[3,4];case 4:return[2]}}))}))};e.prototype.handleCancel=function(e){var t,o,i,n;e.stopPropagation();var r=this.fieldStore.get(this.fieldName);if(r){this.name=r.name;this.label=r.label;this.roleName=r.role_name;this.required=r.required;this.placeholder=((t=r.setting)===null||t===void 0?void 0:t.placeholder)||"";this.value=((o=r.setting)===null||o===void 0?void 0:o.result)||"";this.leading=((i=r.setting)===null||i===void 0?void 0:i.leading)||0}this.dirty=false;(n=this.close)===null||n===void 0?void 0:n.emit()};e.prototype.handleSave=function(e){var t=this;e.stopPropagation();var o={name:this.name,label:this.label||null,required:this.required,role_name:this.roleName};if(this.type==="checkbox_group"||this.type==="radio_button_group"){o.setting=this.setting;o.setting.options=this.options}else if(this.type==="textarea"||this.type==="textbox"){o.setting=__assign({},this.setting);o.setting.result=(this.value||"").trim()}else if(this.type==="dropdown"){o.setting={x:this.setting.x,y:this.setting.y,options:this.options}}console.log("FP: Will update",o);updateField(this.endpoint,this.templateId,this.fieldName,o).then((function(e){var i,n;t.dirty=false;t.updateField(e);(i=t.settingsChanged)===null||i===void 0?void 0:i.emit({fieldName:t.fieldName,settings:o,field:e});(n=t.close)===null||n===void 0?void 0:n.emit()})).catch((function(){console.log("Field update failed",e)}))};e.prototype.handleAddOption=function(e){var t=this;e.stopPropagation();var o={name:this.name,required:this.required,role_name:this.roleName};this.options.push(this.type==="radio_button_group"?{id:uuidBrowser(),value:"Option ".concat(this.options.length+1),selected:false,x:this.options.length>0?this.options[this.options.length-1].x:20,y:this.options.length>0?this.options[this.options.length-1].y-25:20}:{id:uuidBrowser(),value:"Option ".concat(this.options.length+1),checked:false,x:this.options.length>0?this.options[this.options.length-1].x:20,y:this.options.length>0?this.options[this.options.length-1].y-25:20});o.setting=__assign({},this.setting);delete o.setting.result;o.setting.options=__spreadArray([],this.options,true);updateField(this.endpoint,this.templateId,this.fieldName,o).then((function(e){var i,n;t.dirty=false;t.updateField(e);(i=t.settingsChanged)===null||i===void 0?void 0:i.emit({fieldName:t.fieldName,settings:o,field:e});(n=t.close)===null||n===void 0?void 0:n.emit()})).catch((function(){console.log("Field update failed",e)}))};e.prototype.updateField=function(e){var t=this.fieldStore.get(this.fieldName)||{};console.log("Updating field",e,t);Object.assign(t,e);this.fieldStore.set(this.fieldName,e)};e.prototype.handleDelete=function(e){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(o){e.stopPropagation();if(window.confirm("Are you sure you wish to remove this field? This action cannot be undone.")){deleteField(this.endpoint,this.templateId,this.fieldName).then((function(){var e;t.fieldStore.set(t.fieldName,undefined);(e=t.delete)===null||e===void 0?void 0:e.emit({templateId:t.templateId,roleName:t.roleName})})).catch((function(e){console.log("[FIELD PROPERTIES] Deletion error",e)}))}return[2]}))}))};e.prototype.render=function(){var e=this;var t;if(!this.endpoint.session){return h(Host,null,h("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if(!this.endpoint.session||!this.fieldStore.get(this.fieldName)){return h(Host,{class:"empty"})}if(this.helpText&&this.showingHelp){return h(Host,null,h("h6",null,capitalize(this.fieldType)," Settings ",h("div",{style:{flex:"1"}}),h("div",{class:"help-icon",innerHTML:HelpIcon,onClick:function(){return e.showingHelp=false}})),h("p",{class:"instructions",innerHTML:this.helpText}))}return h(Host,null,h("h6",null,capitalize(this.fieldType.replace(/_/g," "))," Settings ",h("div",{style:{flex:"1"}}),this.helpText&&h("div",{class:"help-icon",innerHTML:HelpIcon,onClick:function(){return e.showingHelp=true}})),h("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},h("div",{class:"row"},h("verdocs-text-input",{id:"verdocs-field-name",label:"Field Name",value:this.name,autocomplete:"off",placeholder:"Field Name...",onInput:function(t){e.name=t.target.value;e.dirty=true}})),h("div",{class:"row"},h("verdocs-text-input",{id:"verdocs-field-label",label:"Optional Label",value:this.label,autocomplete:"off",placeholder:"Optional Label...",onInput:function(t){e.label=t.target.value;e.dirty=true}})),h("div",{class:"row"},h("div",{class:"input-label"},"Role:"),h("verdocs-select-input",{value:this.roleName,options:(t=this.templateStore.state)===null||t===void 0?void 0:t.roles.map((function(e){return{label:e.name,value:e.name}})),onInput:function(t){e.roleName=t.target.value;e.dirty=true}})),["textbox","textarea"].includes(this.type)&&h("div",{class:"row",style:{marginTop:"10px",marginBottom:"10px"}},h("verdocs-text-input",{id:"verdocs-field-value",label:"Value",value:this.value,autocomplete:"off",placeholder:"Pre-defined value...",onInput:function(t){e.value=t.target.value;e.dirty=true}})),["textbox","textarea"].includes(this.type)&&h("div",{class:"row",style:{marginTop:"10px",marginBottom:"10px"}},h("verdocs-text-input",{id:"verdocs-field-placeholder",label:"Placeholder",value:this.placeholder,autocomplete:"off",placeholder:"Placeholder...",onInput:function(t){e.placeholder=t.target.value;e.dirty=true}})),h("div",{class:"row",style:{marginTop:"15px",marginBottom:"15px"}},h("label",{htmlFor:"verdocs-is-required",class:"input-label"},"Required"),h("verdocs-checkbox",{id:"verdocs-is-required",name:"is-required",checked:this.required,value:"on",onInput:function(t){e.required=t.target.checked;e.dirty=true}})),["checkbox_group","radio_button_group"].includes(this.type)&&h("verdocs-button",{size:"small",onClick:function(t){return e.handleAddOption(t)},label:"Add Option"}),["dropdown"].includes(this.type)&&h("div",{class:"options"},h("div",{class:"row",style:{marginTop:"15px",marginBottom:"15px",textAlign:"center",fontWeight:"700",fontSize:"14px",justifyContent:"center",backgroundColor:"#333333",padding:"5px 8px",color:"#ffffff"}},"Options"),h("div",{class:"row-header"},h("h6",null,"ID"),h("h6",null,"Label"),h("div",{style:{width:"34px"}})),this.options.map((function(t,o){return h("div",{class:"row option-row",key:o},h("verdocs-text-input",{id:"verdocs-option-id-".concat(t.id),value:t.id,placeholder:"Unique ID",onInput:function(t){e.options[o].id=t.target.value;e.dirty=true}}),h("verdocs-text-input",{id:"verdocs-option-value-".concat(t.id),value:t.value,placeholder:"Display value",onInput:function(t){e.options[o].value=t.target.value;e.dirty=true}}),h("button",{innerHTML:TrashIcon,class:"remove-button",onClick:function(){e.options=e.options.filter((function(e){return e.id!==t.id}));e.dirty=true}}))})),h("div",{class:"row-header"},h("button",{class:"add-option-button",onClick:function(){e.options=__spreadArray(__spreadArray([],e.options,true),[{id:"option-".concat(e.options.length+1),value:"Option ".concat(e.options.length+1)}],false);e.dirty=true}},"Add Option"))),h("div",{class:"buttons"},h("button",{class:"delete-button",disabled:this.dirty,onClick:function(t){return e.handleDelete(t)},innerHTML:TrashIcon}),h("div",{style:{flex:"1"}}),h("verdocs-button",{size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:function(t){return e.handleCancel(t)}}),h("verdocs-button",{size:"small",label:"Save",disabled:!this.dirty,onClick:function(t){return e.handleSave(t)}}))))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();VerdocsTemplateFieldProperties.style=verdocsTemplateFieldPropertiesCss;export{VerdocsButtonPanel as verdocs_button_panel,VerdocsTemplateFieldProperties as verdocs_template_field_properties};
@@ -0,0 +1 @@
1
+ import{r as registerInstance,c as createEvent,h,H as Host}from"./index-172625c5.js";import"./Types-5f31149e.js";import{V as VerdocsEndpoint}from"./VerdocsEndpoint-56fa3371.js";import{d as convertToE164}from"./utils-ca3121df.js";import"./_commonjsHelpers-8a9f3b18.js";import"./Envelopes-627c5239.js";import"./Files-70a192df.js";import"./Types-1628dc71.js";import"./index-914ed6f7.js";var verdocsContactPickerCss='verdocs-contact-picker{display:block;border:1px solid #ebebeb;background-color:#ffffff;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;-webkit-box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1);box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1)}verdocs-contact-picker form{background-color:#f5f5fa;padding:12px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-contact-picker form .row{width:300px;display:-ms-flexbox;display:flex;position:relative;margin:0 0 20px 0;-ms-flex-direction:column;flex-direction:column}verdocs-contact-picker form label{display:block;font-size:14px;font-weight:500;margin:0 0 4px 0;color:#5c6575}verdocs-contact-picker form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-contact-picker form input:focus{outline:none}verdocs-contact-picker form .dropdown{left:0;right:0;top:49px;z-index:1000000;position:absolute;background:#ffffff;-webkit-box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1);box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1)}verdocs-contact-picker form .dropdown .suggestion{display:-ms-flexbox;display:flex;padding:6px 12px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker form .dropdown .suggestion svg{fill:#666666}verdocs-contact-picker form .dropdown .suggestion .avatar{width:48px;height:48px;-ms-flex:0 0 48px;flex:0 0 48px;margin-right:8px;border-radius:100%}verdocs-contact-picker form .dropdown .suggestion .details{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-contact-picker form .dropdown .suggestion .name{font-size:16px;font-weight:500;margin-bottom:3px;color:#092c4c}verdocs-contact-picker form .dropdown .suggestion .destination{font-size:14px;margin-bottom:3px;color:#33364b}verdocs-contact-picker form .dropdown .suggestion:hover{background:#eee;cursor:pointer}verdocs-contact-picker .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker .buttons .flex-fill{-ms-flex:1;flex:1}verdocs-contact-picker ::-webkit-input-placeholder{color:#aaaaaa}verdocs-contact-picker ::-moz-placeholder{color:#aaaaaa}verdocs-contact-picker :-ms-input-placeholder{color:#aaaaaa}verdocs-contact-picker ::-ms-input-placeholder{color:#aaaaaa}verdocs-contact-picker ::placeholder{color:#aaaaaa}verdocs-contact-picker [data-lastpass-icon-root]{display:none !important}';var messageIcon='<svg class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium MuiBox-root css-1om0hkc" focusable="false" aria-hidden="true" viewBox="0 0 24 24"><path d="M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-2 12H6v-2h12v2zm0-3H6V9h12v2zm0-3H6V6h12v2z"></path></svg>';var delegateIcon='<svg class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium MuiSvgIcon-root MuiSvgIcon-fontSizeLarge css-zjt8k" focusable="false" aria-hidden="true" viewBox="0 0 24 24" data-testid="AssignmentIndIcon" tabindex="-1" title="AssignmentInd"><path d="M19 3h-4.18C14.4 1.84 13.3 1 12 1c-1.3 0-2.4.84-2.82 2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm0 4c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3zm6 12H6v-1.4c0-2 4-3.1 6-3.1s6 1.1 6 3.1V19z"></path></svg>';var placeholderIcon='<svg class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium MuiSvgIcon-root MuiSvgIcon-fontSizeLarge css-zjt8k" focusable="false" aria-hidden="true" viewBox="0 0 24 24" data-testid="AccountCircleIcon" tabindex="-1" title="AccountCircle"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 4c1.93 0 3.5 1.57 3.5 3.5S13.93 13 12 13s-3.5-1.57-3.5-3.5S10.07 6 12 6zm0 14c-2.03 0-4.43-.82-6.14-2.88C7.55 15.8 9.68 15 12 15s4.45.8 6.14 2.12C16.43 19.18 14.03 20 12 20z"></path></svg>';var VerdocsContactPicker=function(){function t(t){registerInstance(this,t);this.searchContacts=createEvent(this,"searchContacts",7);this.exit=createEvent(this,"exit",7);this.next=createEvent(this,"next",7);this.endpoint=VerdocsEndpoint.getDefault();this.templateRole=null;this.contactSuggestions=[];this.name=undefined;this.email=undefined;this.phone=undefined;this.message=undefined;this.showSuggestions=false;this.showMessage=false;this.delegator=false;this.nameFieldId="verdocs-contact-picker-name-".concat(Math.random().toString(36).substring(2,11));this.emailFieldId="verdocs-contact-picker-email-".concat(Math.random().toString(36).substring(2,11));this.phoneFieldId="verdocs-contact-picker-phone-".concat(Math.random().toString(36).substring(2,11))}t.prototype.componentWillLoad=function(){if(this.templateRole){this.name=this.templateRole.full_name||"";this.email=this.templateRole.email||"";this.phone=this.templateRole.phone||"";this.delegator=this.templateRole.delegator||false;this.message=this.templateRole.message||"";this.showMessage=this.message!==""}};t.prototype.handleNameChange=function(t){var e;this.name=t.target.value;(e=this.searchContacts)===null||e===void 0?void 0:e.emit({query:this.name})};t.prototype.handleEmailChange=function(t){this.email=t.target.value};t.prototype.handlePhoneChange=function(t){this.phone=convertToE164(t.target.value)};t.prototype.handleMessageChange=function(t){this.message=t.target.value};t.prototype.handleCancel=function(t){var e;t.stopPropagation();this.showSuggestions=false;(e=this.exit)===null||e===void 0?void 0:e.emit()};t.prototype.handleSubmit=function(t){var e;t.stopPropagation();this.showSuggestions=false;(e=this.next)===null||e===void 0?void 0:e.emit({full_name:this.name,email:this.email,phone:this.phone,message:this.message,delegator:this.delegator})};t.prototype.handleSelectSuggestion=function(t,e){t.stopPropagation();this.name=e.name;this.email=e.email;this.phone=e.phone;this.showSuggestions=false};t.prototype.render=function(){var t=this;return h("form",{onSubmit:function(t){return t.preventDefault()},onClick:function(t){return t.stopPropagation()},autocomplete:"off"},h("div",{class:"row"},h("label",{htmlFor:this.nameFieldId},"Name:"),h("input",{id:this.nameFieldId,name:this.nameFieldId,type:"text","data-lpignore":"true",autocomplete:"blocked",value:this.name,placeholder:"Recipient Name...",onFocus:function(){var e;return t.showSuggestions=((e=t.contactSuggestions)===null||e===void 0?void 0:e.length)>0},onInput:function(e){return t.handleNameChange(e)}}),this.showSuggestions&&h("div",{class:"dropdown"},this.contactSuggestions.map((function(e){var o;return h("div",{key:(o=e.id)!==null&&o!==void 0?o:e.name,class:"suggestion",onClick:function(o){return t.handleSelectSuggestion(o,e)}},e.avatar?h("img",{alt:"Avatar",class:"avatar",src:e.avatar}):h("div",{class:"avatar",innerHTML:placeholderIcon}),h("div",{class:"details"},h("div",{class:"name"},e.name),e.email&&h("div",{class:"destination"},e.email),e.phone&&h("div",{class:"destination"},e.phone)))})))),h("div",{class:"row"},h("label",{htmlFor:this.emailFieldId},"Email:"),h("input",{id:this.emailFieldId,name:this.emailFieldId,type:"text","data-lpignore":"true",autoComplete:"blocked",value:this.email,placeholder:"Email Address...",onFocus:function(){return t.showSuggestions=false},onInput:function(e){return t.handleEmailChange(e)}})),h("div",{class:"row"},h("label",{htmlFor:this.phoneFieldId},"Phone:"),h("input",{id:this.phoneFieldId,name:this.phoneFieldId,type:"text","data-lpignore":"true",autoComplete:"blocked",value:this.phone,placeholder:"Phone Number...",onFocus:function(){return t.showSuggestions=false},onInput:function(e){return t.handlePhoneChange(e)}})),this.showMessage&&h("div",{class:"row"},h("label",{htmlFor:"verdocs-contact-picker-message"},"Message:"),h("input",{id:"verdocs-contact-picker-message",name:"verdocs-contact-picker-message",type:"text","data-lpignore":"true",autocomplete:"blocked",value:this.message,placeholder:"Invitation Message...",onFocus:function(){return t.showSuggestions=false},onInput:function(e){return t.handleMessageChange(e)}})),h("div",{class:"buttons"},h("verdocs-toggle-button",{icon:messageIcon,size:"small",active:this.showMessage,onToggle:function(e){t.showMessage=e.detail.active;t.showSuggestions=false}}),h("verdocs-toggle-button",{icon:delegateIcon,size:"small",active:this.delegator,onToggle:function(e){t.delegator=e.detail.active;t.showSuggestions=false}}),h("div",{class:"flex-fill"}),h("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:function(e){return t.handleCancel(e)}}),h("verdocs-button",{label:"OK",size:"small",onClick:function(e){return t.handleSubmit(e)}})))};return t}();VerdocsContactPicker.style=verdocsContactPickerCss;var verdocsPortalCss="";var Z_INDEX="10001";var VerdocsPortal=function(){function t(t){registerInstance(this,t);this.clickAway=createEvent(this,"clickAway",7);this.moved=false;this.anchor=undefined;this.voffset=0;this.align="left"}t.prototype.handleScroll=function(){this.calculatePosition()};t.prototype.handleResize=function(){this.calculatePosition()};t.prototype.handleClick=function(t){var e;if(!this.element.contains(t.target)){(e=this.clickAway)===null||e===void 0?void 0:e.emit()}};t.prototype.calculateLeft=function(){var t=document.getElementById(this.anchor);if(!t)return 0;var e=t.getBoundingClientRect();if(this.align==="left"){return Math.max(e.left,0)}if(this.align==="right"){return Math.max(e.left+e.width-this.portal.offsetWidth,0)}return Math.max(e.left-this.portal.offsetWidth/2+e.width/2,0)};t.prototype.calculateTop=function(){var t=document.getElementById(this.anchor);if(!t)return 0;var e=t.getBoundingClientRect();return e.bottom+this.voffset};t.prototype.calculatePosition=function(){this.portal.style.top="".concat(this.calculateTop(),"px");this.portal.style.left="".concat(this.calculateLeft(),"px")};t.prototype.componentWillLoad=function(){var t;var e="".concat(this.anchor,"-portal");(t=document.getElementById(e))===null||t===void 0?void 0:t.remove();this.portal=document.createElement("div");this.portal.setAttribute("id",e);this.portal.style.zIndex=Z_INDEX;this.portal.style.position="absolute";document.body.append(this.portal)};t.prototype.componentDidLoad=function(){this.portal.appendChild(this.element);this.calculatePosition()};t.prototype.disconnectedCallback=function(){this.moved?this.portal.remove():this.moved=true};t.prototype.render=function(){var t=this;return h(Host,{ref:function(e){return t.element=e}},h("slot",null))};return t}();VerdocsPortal.style=verdocsPortalCss;var verdocsToggleButtonCss='verdocs-toggle-button{font-family:"Inter", "Barlow", sans-serif}verdocs-toggle-button button{border:none;outline:none;cursor:pointer;-ms-flex-align:center;align-items:center;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-pack:center;justify-content:center;background:#cccccc;color:#33364b}verdocs-toggle-button button svg{max-width:100%;max-height:100%;fill:#33364b}verdocs-toggle-button button.active{background:#55bc81;color:#f5f5fa}verdocs-toggle-button button.active svg{fill:#f5f5fa}verdocs-toggle-button button:focus{border:none;outline:none}verdocs-toggle-button.size-normal button{width:40px;height:40px;padding:6px;border-radius:4px}verdocs-toggle-button.size-small button{width:34px;height:34px;padding:4px;border-radius:2px}';var VerdocsToggleButton=function(){function t(t){registerInstance(this,t);this.toggle=createEvent(this,"toggle",7);this.active=false;this.icon=null;this.label=null;this.size="normal";this._active=false}t.prototype.componentWillLoad=function(){this._active=this.active};t.prototype.handleToggle=function(t){var e;t.stopPropagation();var o=!this._active;this._active=o;(e=this.toggle)===null||e===void 0?void 0:e.emit({active:o})};t.prototype.render=function(){var t=this;return h(Host,{class:"size-".concat(this.size)},this.icon?h("button",{innerHTML:this.icon,class:{active:this._active},onClick:function(e){return t.handleToggle(e)}}):h("button",{class:{active:this._active},onClick:function(e){return t.handleToggle(e)}},this.label))};return t}();VerdocsToggleButton.style=verdocsToggleButtonCss;export{VerdocsContactPicker as verdocs_contact_picker,VerdocsPortal as verdocs_portal,VerdocsToggleButton as verdocs_toggle_button};
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(e,t,i,r){function n(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r["throw"](e))}catch(e){a(e)}}function c(e){e.done?i(e.value):n(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var i={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,n,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return c([e,t])}}function c(o){if(r)throw new TypeError("Generator is already executing.");while(i)try{if(r=1,n&&(a=o[0]&2?n["return"]:o[0]?n["throw"]||((a=n["return"])&&a.call(n),0):n.next)&&!(a=a.call(n,o[1])).done)return a;if(n=0,a)o=[o[0]&2,a.value];switch(o[0]){case 0:case 1:a=o;break;case 4:i.label++;return{value:o[1],done:false};case 5:i.label++;n=o[1];o=[0];continue;case 7:o=i.ops.pop();i.trys.pop();continue;default:if(!(a=i.trys,a=a.length>0&&a[a.length-1])&&(o[0]===6||o[0]===2)){i=0;continue}if(o[0]===3&&(!a||o[1]>a[0]&&o[1]<a[3])){i.label=o[1];break}if(o[0]===6&&i.label<a[1]){i.label=a[1];a=o;break}if(a&&i.label<a[2]){i.label=a[2];i.ops.push(o);break}if(a[2])i.ops.pop();i.trys.pop();continue}o=t.call(e,i)}catch(e){o=[6,e];n=0}finally{r=a=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host,a as getElement}from"./index-172625c5.js";import{m as getEnvelopeDocumentPageDisplayUri}from"./Envelopes-21ffb899.js";import"./Types-5f31149e.js";import{V as VerdocsEndpoint}from"./VerdocsEndpoint-b011af25.js";import{t as throttle}from"./utils-d269cea3.js";import"./_commonjsHelpers-5ec8f9b7.js";import"./Files-70a192df.js";import"./Types-de18e225.js";import"./index-914ed6f7.js";var verdocsEnvelopeDocumentPageCss="verdocs-envelope-document-page{width:100%;position:relative}verdocs-envelope-document-page .verdocs-envelope-document-page-layer{position:absolute;top:0;left:0;right:0;bottom:0;-webkit-box-shadow:0 0 10px 5px #0000000f;box-shadow:0 0 10px 5px #0000000f}verdocs-envelope-document-page .verdocs-envelope-document-page-layer.img{width:100%}";var VerdocsEnvelopeDocumentPage=function(){function e(e){registerInstance(this,e);this.pageRendered=createEvent(this,"pageRendered",7);this.endpoint=VerdocsEndpoint.getDefault();this.envelopeId="";this.documentId="";this.pageNumber=1;this.virtualWidth=612;this.virtualHeight=792;this.layers=[{name:"page",type:"canvas"}];this.type="original";this.containerId="verdocs-envelope-document-page-".concat(Math.random().toString(36).substring(2,11));this.renderedWidth=this.virtualWidth;this.renderedHeight=this.virtualHeight;this.naturalWidth=this.virtualWidth;this.naturalHeight=this.virtualHeight;this.aspectRatio=this.virtualWidth/this.virtualHeight;this.skipFirstNotification=true;this.pageDisplayUri="https://verdocs-public-assets.s3.amazonaws.com/page-loading-placeholder.png"}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:e=this;return[4,getEnvelopeDocumentPageDisplayUri(this.endpoint,this.envelopeId,this.documentId,this.pageNumber,this.type)];case 1:e.pageDisplayUri=t.sent();return[2]}}))}))};e.prototype.componentDidLoad=function(){var e=this;this.resizeObserver=new ResizeObserver(throttle((function(t){for(var i=0,r=t;i<r.length;i++){var n=r[i];var a=n.contentRect.width;e.renderedWidth=a;e.renderedHeight=e.virtualHeight*(a/e.virtualWidth)}e.notifyRenderedSize()}),100));this.resizeObserver.observe(this.container)};e.prototype.disconnectedCallback=function(){var e;(e=this.resizeObserver)===null||e===void 0?void 0:e.disconnect()};e.prototype.notifyRenderedSize=function(){if(this.skipFirstNotification){this.skipFirstNotification=false;return}this.pageRendered.emit({containerId:this.containerId,documentId:this.documentId,pageNumber:this.pageNumber,virtualWidth:this.virtualWidth,virtualHeight:this.virtualHeight,renderedWidth:this.renderedWidth,renderedHeight:this.renderedHeight,naturalWidth:this.naturalWidth,naturalHeight:this.naturalHeight,aspectRatio:this.aspectRatio,xScale:this.renderedWidth/this.virtualWidth,yScale:this.renderedHeight/this.virtualHeight})};e.prototype.render=function(){var e=this;var t="".concat(this.renderedHeight,"px");return h(Host,{id:"".concat(this.containerId),style:{height:t,flex:"0 0 ".concat(t)}},this.layers.map((function(i){return i.type==="div"?h("div",{class:"verdocs-envelope-document-page-layer",id:"".concat(e.containerId,"-").concat(i.name),style:{height:t}}):e.pageDisplayUri?h("img",{class:"verdocs-envelope-document-page-layer img",id:"".concat(e.containerId,"-").concat(i.name),src:e.pageDisplayUri,alt:"Page ".concat(e.pageNumber),"aria-hidden":true,loading:"lazy",onLoad:function(t){e.naturalWidth=t.target.naturalWidth;e.naturalHeight=t.target.naturalHeight;e.aspectRatio=e.naturalWidth/e.naturalHeight;e.virtualHeight=e.virtualWidth/e.aspectRatio;e.renderedHeight=t.target.offsetWidth/e.aspectRatio}}):h("div",null)})))};Object.defineProperty(e.prototype,"container",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();VerdocsEnvelopeDocumentPage.style=verdocsEnvelopeDocumentPageCss;export{VerdocsEnvelopeDocumentPage as verdocs_envelope_document_page};
1
+ var __awaiter=this&&this.__awaiter||function(e,t,i,r){function n(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r["throw"](e))}catch(e){a(e)}}function c(e){e.done?i(e.value):n(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var i={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,n,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return c([e,t])}}function c(o){if(r)throw new TypeError("Generator is already executing.");while(i)try{if(r=1,n&&(a=o[0]&2?n["return"]:o[0]?n["throw"]||((a=n["return"])&&a.call(n),0):n.next)&&!(a=a.call(n,o[1])).done)return a;if(n=0,a)o=[o[0]&2,a.value];switch(o[0]){case 0:case 1:a=o;break;case 4:i.label++;return{value:o[1],done:false};case 5:i.label++;n=o[1];o=[0];continue;case 7:o=i.ops.pop();i.trys.pop();continue;default:if(!(a=i.trys,a=a.length>0&&a[a.length-1])&&(o[0]===6||o[0]===2)){i=0;continue}if(o[0]===3&&(!a||o[1]>a[0]&&o[1]<a[3])){i.label=o[1];break}if(o[0]===6&&i.label<a[1]){i.label=a[1];a=o;break}if(a&&i.label<a[2]){i.label=a[2];i.ops.push(o);break}if(a[2])i.ops.pop();i.trys.pop();continue}o=t.call(e,i)}catch(e){o=[6,e];n=0}finally{r=a=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host,a as getElement}from"./index-172625c5.js";import{m as getEnvelopeDocumentPageDisplayUri}from"./Envelopes-627c5239.js";import"./Types-5f31149e.js";import{V as VerdocsEndpoint}from"./VerdocsEndpoint-56fa3371.js";import{t as throttle}from"./utils-ca3121df.js";import"./_commonjsHelpers-8a9f3b18.js";import"./Files-70a192df.js";import"./Types-1628dc71.js";import"./index-914ed6f7.js";var verdocsEnvelopeDocumentPageCss="verdocs-envelope-document-page{width:100%;position:relative}verdocs-envelope-document-page .verdocs-envelope-document-page-layer{position:absolute;top:0;left:0;right:0;bottom:0;-webkit-box-shadow:0 0 10px 5px #0000000f;box-shadow:0 0 10px 5px #0000000f}verdocs-envelope-document-page .verdocs-envelope-document-page-layer.img{width:100%}";var VerdocsEnvelopeDocumentPage=function(){function e(e){registerInstance(this,e);this.pageRendered=createEvent(this,"pageRendered",7);this.endpoint=VerdocsEndpoint.getDefault();this.envelopeId="";this.documentId="";this.pageNumber=1;this.virtualWidth=612;this.virtualHeight=792;this.layers=[{name:"page",type:"canvas"}];this.type="original";this.containerId="verdocs-envelope-document-page-".concat(Math.random().toString(36).substring(2,11));this.renderedWidth=this.virtualWidth;this.renderedHeight=this.virtualHeight;this.naturalWidth=this.virtualWidth;this.naturalHeight=this.virtualHeight;this.aspectRatio=this.virtualWidth/this.virtualHeight;this.skipFirstNotification=true;this.pageDisplayUri="https://verdocs-public-assets.s3.amazonaws.com/page-loading-placeholder.png"}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:e=this;return[4,getEnvelopeDocumentPageDisplayUri(this.endpoint,this.envelopeId,this.documentId,this.pageNumber,this.type)];case 1:e.pageDisplayUri=t.sent();return[2]}}))}))};e.prototype.componentDidLoad=function(){var e=this;this.resizeObserver=new ResizeObserver(throttle((function(t){for(var i=0,r=t;i<r.length;i++){var n=r[i];var a=n.contentRect.width;e.renderedWidth=a;e.renderedHeight=e.virtualHeight*(a/e.virtualWidth)}e.notifyRenderedSize()}),100));this.resizeObserver.observe(this.container)};e.prototype.disconnectedCallback=function(){var e;(e=this.resizeObserver)===null||e===void 0?void 0:e.disconnect()};e.prototype.notifyRenderedSize=function(){if(this.skipFirstNotification){this.skipFirstNotification=false;return}this.pageRendered.emit({containerId:this.containerId,documentId:this.documentId,pageNumber:this.pageNumber,virtualWidth:this.virtualWidth,virtualHeight:this.virtualHeight,renderedWidth:this.renderedWidth,renderedHeight:this.renderedHeight,naturalWidth:this.naturalWidth,naturalHeight:this.naturalHeight,aspectRatio:this.aspectRatio,xScale:this.renderedWidth/this.virtualWidth,yScale:this.renderedHeight/this.virtualHeight})};e.prototype.render=function(){var e=this;var t="".concat(this.renderedHeight,"px");return h(Host,{id:"".concat(this.containerId),style:{height:t,flex:"0 0 ".concat(t)}},this.layers.map((function(i){return i.type==="div"?h("div",{class:"verdocs-envelope-document-page-layer",id:"".concat(e.containerId,"-").concat(i.name),style:{height:t}}):e.pageDisplayUri?h("img",{class:"verdocs-envelope-document-page-layer img",id:"".concat(e.containerId,"-").concat(i.name),src:e.pageDisplayUri,alt:"Page ".concat(e.pageNumber),"aria-hidden":true,loading:"lazy",onLoad:function(t){e.naturalWidth=t.target.naturalWidth;e.naturalHeight=t.target.naturalHeight;e.aspectRatio=e.naturalWidth/e.naturalHeight;e.virtualHeight=e.virtualWidth/e.aspectRatio;e.renderedHeight=t.target.offsetWidth/e.aspectRatio}}):h("div",null)})))};Object.defineProperty(e.prototype,"container",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();VerdocsEnvelopeDocumentPage.style=verdocsEnvelopeDocumentPageCss;export{VerdocsEnvelopeDocumentPage as verdocs_envelope_document_page};
@@ -1 +1 @@
1
- var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var n,i=1,t=arguments.length;i<t;i++){n=arguments[i];for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r))e[r]=n[r]}return e};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(e,n,i,t){function r(e){return e instanceof i?e:new i((function(n){n(e)}))}return new(i||(i=Promise))((function(i,o){function s(e){try{a(t.next(e))}catch(e){o(e)}}function l(e){try{a(t["throw"](e))}catch(e){o(e)}}function a(e){e.done?i(e.value):r(e.value).then(s,l)}a((t=t.apply(e,n||[])).next())}))};var __generator=this&&this.__generator||function(e,n){var i={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},t,r,o,s;return s={next:l(0),throw:l(1),return:l(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(e){return function(n){return a([e,n])}}function a(s){if(t)throw new TypeError("Generator is already executing.");while(i)try{if(t=1,r&&(o=s[0]&2?r["return"]:s[0]?r["throw"]||((o=r["return"])&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;if(r=0,o)s=[s[0]&2,o.value];switch(s[0]){case 0:case 1:o=s;break;case 4:i.label++;return{value:s[1],done:false};case 5:i.label++;r=s[1];s=[0];continue;case 7:s=i.ops.pop();i.trys.pop();continue;default:if(!(o=i.trys,o=o.length>0&&o[o.length-1])&&(s[0]===6||s[0]===2)){i=0;continue}if(s[0]===3&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(s[0]===6&&i.label<o[1]){i.label=o[1];o=s;break}if(o&&i.label<o[2]){i.label=o[2];i.ops.push(s);break}if(o[2])i.ops.pop();i.trys.pop();continue}s=n.call(e,i)}catch(e){s=[6,e];r=0}finally{t=o=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host}from"./index-172625c5.js";import"./Types-5f31149e.js";import{g as getInPersonLink}from"./Recipients-4ec2138c.js";import{V as VerdocsEndpoint}from"./VerdocsEndpoint-b011af25.js";import{g as getEnvelopeStore}from"./EnvelopeStore-15cc99ef.js";import{V as VerdocsToast}from"./Toast-f3b8fd46.js";import{S as SDKError}from"./errors-9b5498c8.js";import{g as getRecipientsWithActions,r as recipientCanAct}from"./Permissions-f2eb0421.js";import"./index-4439b0d1.js";import"./Envelopes-21ffb899.js";var verdocsEnvelopeRecipientLinkCss='verdocs-envelope-recipient-link{top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;z-index:100000;position:fixed;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;font-family:"Inter", "Barlow", sans-serif;background-color:#0000007f}verdocs-envelope-recipient-link .summary-content{width:600px;display:-ms-flexbox;display:flex;max-width:90%;font-size:18px;-ms-flex:0 0 600px;flex:0 0 600px;border-radius:6px;background:#ffffff;-ms-flex-direction:column;flex-direction:column;padding:30px 20px 20px}verdocs-envelope-recipient-link .summary-content .summary-title{font-size:20px;font-weight:700;margin:0 0 10px 0;color:#33364b}verdocs-envelope-recipient-link .summary-recipient{display:-ms-flexbox;display:flex;color:#33364b;margin:8px 0 24px 0;-ms-flex-direction:column;flex-direction:column}verdocs-envelope-recipient-link .summary-recipient .role-name{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;font-size:14px;font-weight:600;margin:0 0 8px 0;color:#092c4c}verdocs-envelope-recipient-link .summary-recipient .role-info{gap:5px;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:end;align-items:flex-end}verdocs-envelope-recipient-link .summary-recipient .role-full-name{-ms-flex:1;flex:1;height:34px;display:-ms-flexbox;display:flex;font-size:16px;padding:0 12px;border-radius:4px;-ms-flex-align:center;align-items:center;border:1px solid #cccccc;background:#f9fafb}verdocs-envelope-recipient-link .summary-recipient .recipient-link{width:120px;padding:0 16px;font-weight:500;margin:0 0 0 8px;text-align:center;font-size:0.875rem;border-radius:100%;color:#374151;line-height:1.25rem;background-color:#d8d8d8;border:2px solid #9ca3af}verdocs-envelope-recipient-link .summary-recipient .link-wrapper{gap:5px;display:-ms-flexbox;display:flex;margin:4px 0 0 0;-ms-flex-direction:row;flex-direction:row}verdocs-envelope-recipient-link .summary-recipient .link-wrapper .link{-ms-flex:1;flex:1;height:34px;display:-ms-flexbox;display:flex;font-size:16px;padding:0 12px;border-radius:4px;-ms-flex-align:center;align-items:center;border:1px solid #cccccc;background:#f9fafb}verdocs-envelope-recipient-link .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;margin:10px 0 0 0;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}verdocs-envelope-recipient-link .buttons verdocs-button{-ms-flex:0 0 120px;flex:0 0 120px;margin-left:10px;white-space:nowrap}verdocs-envelope-recipient-link .buttons verdocs-button button{width:100%}';var VerdocsEnvelopeRecipientLink=function(){function e(e){registerInstance(this,e);this.next=createEvent(this,"next",7);this.sdkError=createEvent(this,"sdkError",7);this.store=null;this.recipient=null;this.endpoint=VerdocsEndpoint.getDefault();this.envelopeId="";this.roleName="";this.isOpen=undefined;this.loading=true;this.gettingLink=true;this.link=""}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,n,i,t,r,o,s,l;var a=this;return __generator(this,(function(c){switch(c.label){case 0:c.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.envelopeId){console.log("[RECIPIENT_LINK] Missing required envelope ID ".concat(this.envelopeId));return[2]}if(!this.endpoint.session){console.log("[RECIPIENT_LINK] Unable to start session, must be authenticated");return[2]}s=this;return[4,getEnvelopeStore(this.endpoint,this.envelopeId,true)];case 1:s.store=c.sent();this.loading=false;this.gettingLink=true;this.recipient=(i=(n=(e=this.store)===null||e===void 0?void 0:e.state)===null||n===void 0?void 0:n.recipients)===null||i===void 0?void 0:i.find((function(e){return e.role_name===a.roleName}));this.getLink(this.recipient);return[3,3];case 2:l=c.sent();console.log("[RECIPIENT_LINK] Error loading envelope",l);(t=this.sdkError)===null||t===void 0?void 0:t.emit(new SDKError(l.message,(r=l.response)===null||r===void 0?void 0:r.status,(o=l.response)===null||o===void 0?void 0:o.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleDone=function(e){var n;e.preventDefault();(n=this.next)===null||n===void 0?void 0:n.emit({envelope:this.store.state})};e.prototype.copyLink=function(e){navigator.clipboard.writeText(e).then((function(){return VerdocsToast("Link copied to clipboard!",{style:"success",duration:3e3})})).catch((function(e){console.warn("[RECIPIENT_LINK] Error copying to clipboard",e);VerdocsToast("Unable to copy to clipboard: ".concat(e.message),{style:"error"})}))};e.prototype.getLink=function(e){var n=this;this.gettingLink=true;getInPersonLink(this.endpoint,e.envelope_id,e.role_name).then((function(e){n.gettingLink=false;n.link=e.link})).catch((function(e){n.gettingLink=false;console.log("[RECIPIENT_LINK] Error getting link",e);VerdocsToast("Unable to get link: "+e.message,{style:"error"})}))};e.prototype.render=function(){var e=this;if(this.loading||!this.recipient){return h(Host,null)}return h(Host,null,h("div",{class:"summary-content"},h("h1",{class:"summary-title"},"In-Person Signing Link"),h("div",{class:"summary-rows"},h("div",{class:"summary-recipient"},h("div",{class:"role-name"},this.recipient.role_name),h("div",{class:"role-details"},h("div",{class:"role-info"},h("div",{class:"role-full-name"},this.recipient.full_name," (",this.recipient.email||this.recipient.phone,")"),!this.link&&h("verdocs-button",{size:"small",variant:"outline",label:this.gettingLink?"Loading...":"Get Link",disabled:this.gettingLink,onClick:function(){return e.getLink(e.recipient)}})),this.link&&h("div",{class:"link-wrapper"},h("div",{class:"link"},this.link),h("verdocs-button",{size:"small",variant:"outline",label:"Copy",onClick:function(){return e.copyLink(e.link)}}))))),h("div",{class:"buttons"},h("verdocs-button",{size:"small",label:"Done",onClick:function(n){return e.handleDone(n)}}))))};return e}();VerdocsEnvelopeRecipientLink.style=verdocsEnvelopeRecipientLinkCss;var verdocsEnvelopeRecipientSummaryCss='verdocs-envelope-recipient-summary{top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;z-index:100000;position:fixed;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;font-family:"Inter", "Barlow", sans-serif;background-color:#0000007f}verdocs-envelope-recipient-summary .summary-content{width:600px;display:-ms-flexbox;display:flex;max-width:90%;font-size:18px;-ms-flex:0 0 600px;flex:0 0 600px;border-radius:6px;background:#ffffff;-ms-flex-direction:column;flex-direction:column;padding:30px 20px 20px}verdocs-envelope-recipient-summary .summary-content .summary-title{font-size:20px;font-weight:700;margin:0 0 10px 0;color:#33364b}verdocs-envelope-recipient-summary .summary-recipient{display:-ms-flexbox;display:flex;color:#33364b;margin:8px 0 24px 0;-ms-flex-direction:column;flex-direction:column}verdocs-envelope-recipient-summary .summary-recipient .role-name{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;font-size:14px;font-weight:600;margin:0 0 8px 0;color:#092c4c}verdocs-envelope-recipient-summary .summary-recipient .role-info{gap:5px;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:end;align-items:flex-end}verdocs-envelope-recipient-summary .summary-recipient .role-full-name{-ms-flex:1;flex:1;height:34px;display:-ms-flexbox;display:flex;font-size:16px;padding:0 12px;border-radius:4px;-ms-flex-align:center;align-items:center;border:1px solid #cccccc;background:#f9fafb}verdocs-envelope-recipient-summary .summary-recipient .recipient-link{width:120px;padding:0 16px;font-weight:500;margin:0 0 0 8px;text-align:center;font-size:0.875rem;border-radius:100%;color:#374151;line-height:1.25rem;background-color:#d8d8d8;border:2px solid #9ca3af}verdocs-envelope-recipient-summary .summary-recipient .link-wrapper{gap:5px;display:-ms-flexbox;display:flex;margin:4px 0 0 0;-ms-flex-direction:row;flex-direction:row}verdocs-envelope-recipient-summary .summary-recipient .link-wrapper .link{-ms-flex:1;flex:1;height:34px;display:-ms-flexbox;display:flex;font-size:16px;padding:0 12px;border-radius:4px;-ms-flex-align:center;align-items:center;border:1px solid #cccccc;background:#f9fafb}verdocs-envelope-recipient-summary .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;margin:10px 0 0 0;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}verdocs-envelope-recipient-summary .buttons verdocs-button{-ms-flex:0 0 120px;flex:0 0 120px;margin-left:10px;white-space:nowrap}verdocs-envelope-recipient-summary .buttons verdocs-button button{width:100%}';var VerdocsEnvelopeRecipientSummary=function(){function e(e){registerInstance(this,e);this.another=createEvent(this,"another",7);this.view=createEvent(this,"view",7);this.next=createEvent(this,"next",7);this.sdkError=createEvent(this,"sdkError",7);this.store=null;this.endpoint=VerdocsEndpoint.getDefault();this.envelopeId="";this.canSendAnother=true;this.canView=true;this.canDone=true;this.isOpen=undefined;this.loading=true;this.recipientStatusIcons=[];this.containerId="verdocs-status-indicator-".concat(Math.random().toString(36).substring(2,11));this.gettingLinks={};this.links={}}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,n,i,t,r;return __generator(this,(function(o){switch(o.label){case 0:o.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.envelopeId){console.log("[RECIPIENTS] Missing required envelope ID ".concat(this.envelopeId));return[2]}if(!this.endpoint.session){console.log("[RECIPIENTS] Unable to start session, must be authenticated");return[2]}t=this;return[4,getEnvelopeStore(this.endpoint,this.envelopeId,true)];case 1:t.store=o.sent();this.sortEnvelopeRecipients();this.loading=false;return[3,3];case 2:r=o.sent();console.log("[RECIPIENTS] Error loading envelope",r);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new SDKError(r.message,(n=r.response)===null||n===void 0?void 0:n.status,(i=r.response)===null||i===void 0?void 0:i.data));return[3,3];case 3:return[2]}}))}))};e.prototype.sortEnvelopeRecipients=function(){var e,n;(n=(e=this.store)===null||e===void 0?void 0:e.state)===null||n===void 0?void 0:n.recipients.sort((function(e,n){return e.sequence===n.sequence?e.order-n.order:e.sequence-n.sequence}))};e.prototype.handleAnother=function(e){var n;e.preventDefault();(n=this.another)===null||n===void 0?void 0:n.emit({envelope:this.store.state})};e.prototype.handleView=function(e){var n;e.preventDefault();(n=this.view)===null||n===void 0?void 0:n.emit({envelope:this.store.state})};e.prototype.handleDone=function(e){var n;e.preventDefault();(n=this.next)===null||n===void 0?void 0:n.emit({envelope:this.store.state})};e.prototype.copyLink=function(e){var n=this;navigator.clipboard.writeText(e).then((function(){})).catch((function(e){var i;console.warn("[RECIPIENTS] Error copying to clipboard",e);(i=n.sdkError)===null||i===void 0?void 0:i.emit(e)}))};e.prototype.getLink=function(e){var n;var i=this;this.gettingLinks=__assign(__assign({},this.gettingLinks),(n={},n[e.role_name]=true,n));getInPersonLink(this.endpoint,e.envelope_id,e.role_name).then((function(n){var t,r;i.gettingLinks=__assign(__assign({},i.gettingLinks),(t={},t[e.role_name]=false,t));i.links=__assign(__assign({},i.links),(r={},r[e.role_name]=n.link,r));i.copyLink(n.link)})).catch((function(n){var t;var r;i.gettingLinks=__assign(__assign({},i.gettingLinks),(t={},t[e.role_name]=false,t));console.log("[RECIPIENTS] Error getting link",n);(r=i.sdkError)===null||r===void 0?void 0:r.emit(n)}))};e.prototype.render=function(){var e=this;var n,i;if(this.loading){return h(Host,null)}return h(Host,null,h("div",{class:"summary-content"},h("h1",{class:"summary-title"},"Recipient Summary"),h("div",{class:"summary-rows"},(((i=(n=this.store)===null||n===void 0?void 0:n.state)===null||i===void 0?void 0:i.recipients)||[]).map((function(n){var i=getRecipientsWithActions(e.store.state);var t=recipientCanAct(n,i);var r=e.links[n.role_name];var o=e.gettingLinks[n.role_name];return h("div",{class:"summary-recipient"},h("div",{class:"role-name"},n.role_name),h("div",{class:"role-details"},h("div",{class:"role-info"},h("div",{class:"role-full-name"},n.full_name," (",n.email||n.phone,")"),t&&!r&&h("verdocs-button",{size:"small",variant:"outline",label:"Get Link",disabled:o,onClick:function(){return e.getLink(n)}})),r&&h("div",{class:"link-wrapper"},h("div",{class:"link"},r),h("verdocs-button",{size:"small",variant:"outline",label:"Copy",onClick:function(){return e.copyLink(r)}}))))}))),(this.canSendAnother||this.canView||this.canDone)&&h("div",{class:"buttons"},this.canSendAnother&&h("verdocs-button",{size:"small",label:"Send Another",onClick:function(n){return e.handleAnother(n)}}),this.canView&&h("verdocs-button",{size:"small",label:"View Now",onClick:function(n){return e.handleView(n)}}),this.canDone&&h("verdocs-button",{size:"small",label:"Done",onClick:function(n){return e.handleDone(n)}}))))};return e}();VerdocsEnvelopeRecipientSummary.style=verdocsEnvelopeRecipientSummaryCss;export{VerdocsEnvelopeRecipientLink as verdocs_envelope_recipient_link,VerdocsEnvelopeRecipientSummary as verdocs_envelope_recipient_summary};
1
+ var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var n,i=1,t=arguments.length;i<t;i++){n=arguments[i];for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r))e[r]=n[r]}return e};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(e,n,i,t){function r(e){return e instanceof i?e:new i((function(n){n(e)}))}return new(i||(i=Promise))((function(i,o){function s(e){try{a(t.next(e))}catch(e){o(e)}}function l(e){try{a(t["throw"](e))}catch(e){o(e)}}function a(e){e.done?i(e.value):r(e.value).then(s,l)}a((t=t.apply(e,n||[])).next())}))};var __generator=this&&this.__generator||function(e,n){var i={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},t,r,o,s;return s={next:l(0),throw:l(1),return:l(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(e){return function(n){return a([e,n])}}function a(s){if(t)throw new TypeError("Generator is already executing.");while(i)try{if(t=1,r&&(o=s[0]&2?r["return"]:s[0]?r["throw"]||((o=r["return"])&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;if(r=0,o)s=[s[0]&2,o.value];switch(s[0]){case 0:case 1:o=s;break;case 4:i.label++;return{value:s[1],done:false};case 5:i.label++;r=s[1];s=[0];continue;case 7:s=i.ops.pop();i.trys.pop();continue;default:if(!(o=i.trys,o=o.length>0&&o[o.length-1])&&(s[0]===6||s[0]===2)){i=0;continue}if(s[0]===3&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(s[0]===6&&i.label<o[1]){i.label=o[1];o=s;break}if(o&&i.label<o[2]){i.label=o[2];i.ops.push(s);break}if(o[2])i.ops.pop();i.trys.pop();continue}s=n.call(e,i)}catch(e){s=[6,e];r=0}finally{t=o=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host}from"./index-172625c5.js";import"./Types-5f31149e.js";import{g as getInPersonLink}from"./Recipients-4ec2138c.js";import{V as VerdocsEndpoint}from"./VerdocsEndpoint-56fa3371.js";import{g as getEnvelopeStore}from"./EnvelopeStore-17c0bc52.js";import{V as VerdocsToast}from"./Toast-f3b8fd46.js";import{S as SDKError}from"./errors-9b5498c8.js";import{g as getRecipientsWithActions,r as recipientCanAct}from"./Permissions-f2eb0421.js";import"./index-4439b0d1.js";import"./Envelopes-627c5239.js";var verdocsEnvelopeRecipientLinkCss='verdocs-envelope-recipient-link{top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;z-index:100000;position:fixed;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;font-family:"Inter", "Barlow", sans-serif;background-color:#0000007f}verdocs-envelope-recipient-link .summary-content{width:600px;display:-ms-flexbox;display:flex;max-width:90%;font-size:18px;-ms-flex:0 0 600px;flex:0 0 600px;border-radius:6px;background:#ffffff;-ms-flex-direction:column;flex-direction:column;padding:30px 20px 20px}verdocs-envelope-recipient-link .summary-content .summary-title{font-size:20px;font-weight:700;margin:0 0 10px 0;color:#33364b}verdocs-envelope-recipient-link .summary-recipient{display:-ms-flexbox;display:flex;color:#33364b;margin:8px 0 24px 0;-ms-flex-direction:column;flex-direction:column}verdocs-envelope-recipient-link .summary-recipient .role-name{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;font-size:14px;font-weight:600;margin:0 0 8px 0;color:#092c4c}verdocs-envelope-recipient-link .summary-recipient .role-info{gap:5px;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:end;align-items:flex-end}verdocs-envelope-recipient-link .summary-recipient .role-full-name{-ms-flex:1;flex:1;height:34px;display:-ms-flexbox;display:flex;font-size:16px;padding:0 12px;border-radius:4px;-ms-flex-align:center;align-items:center;border:1px solid #cccccc;background:#f9fafb}verdocs-envelope-recipient-link .summary-recipient .recipient-link{width:120px;padding:0 16px;font-weight:500;margin:0 0 0 8px;text-align:center;font-size:0.875rem;border-radius:100%;color:#374151;line-height:1.25rem;background-color:#d8d8d8;border:2px solid #9ca3af}verdocs-envelope-recipient-link .summary-recipient .link-wrapper{gap:5px;display:-ms-flexbox;display:flex;margin:4px 0 0 0;-ms-flex-direction:row;flex-direction:row}verdocs-envelope-recipient-link .summary-recipient .link-wrapper .link{-ms-flex:1;flex:1;height:34px;display:-ms-flexbox;display:flex;font-size:16px;padding:0 12px;border-radius:4px;-ms-flex-align:center;align-items:center;border:1px solid #cccccc;background:#f9fafb}verdocs-envelope-recipient-link .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;margin:10px 0 0 0;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}verdocs-envelope-recipient-link .buttons verdocs-button{-ms-flex:0 0 120px;flex:0 0 120px;margin-left:10px;white-space:nowrap}verdocs-envelope-recipient-link .buttons verdocs-button button{width:100%}';var VerdocsEnvelopeRecipientLink=function(){function e(e){registerInstance(this,e);this.next=createEvent(this,"next",7);this.sdkError=createEvent(this,"sdkError",7);this.store=null;this.recipient=null;this.endpoint=VerdocsEndpoint.getDefault();this.envelopeId="";this.roleName="";this.isOpen=undefined;this.loading=true;this.gettingLink=true;this.link=""}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,n,i,t,r,o,s,l;var a=this;return __generator(this,(function(c){switch(c.label){case 0:c.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.envelopeId){console.log("[RECIPIENT_LINK] Missing required envelope ID ".concat(this.envelopeId));return[2]}if(!this.endpoint.session){console.log("[RECIPIENT_LINK] Unable to start session, must be authenticated");return[2]}s=this;return[4,getEnvelopeStore(this.endpoint,this.envelopeId,true)];case 1:s.store=c.sent();this.loading=false;this.gettingLink=true;this.recipient=(i=(n=(e=this.store)===null||e===void 0?void 0:e.state)===null||n===void 0?void 0:n.recipients)===null||i===void 0?void 0:i.find((function(e){return e.role_name===a.roleName}));this.getLink(this.recipient);return[3,3];case 2:l=c.sent();console.log("[RECIPIENT_LINK] Error loading envelope",l);(t=this.sdkError)===null||t===void 0?void 0:t.emit(new SDKError(l.message,(r=l.response)===null||r===void 0?void 0:r.status,(o=l.response)===null||o===void 0?void 0:o.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleDone=function(e){var n;e.preventDefault();(n=this.next)===null||n===void 0?void 0:n.emit({envelope:this.store.state})};e.prototype.copyLink=function(e){navigator.clipboard.writeText(e).then((function(){return VerdocsToast("Link copied to clipboard!",{style:"success",duration:3e3})})).catch((function(e){console.warn("[RECIPIENT_LINK] Error copying to clipboard",e);VerdocsToast("Unable to copy to clipboard: ".concat(e.message),{style:"error"})}))};e.prototype.getLink=function(e){var n=this;this.gettingLink=true;getInPersonLink(this.endpoint,e.envelope_id,e.role_name).then((function(e){n.gettingLink=false;n.link=e.link})).catch((function(e){n.gettingLink=false;console.log("[RECIPIENT_LINK] Error getting link",e);VerdocsToast("Unable to get link: "+e.message,{style:"error"})}))};e.prototype.render=function(){var e=this;if(this.loading||!this.recipient){return h(Host,null)}return h(Host,null,h("div",{class:"summary-content"},h("h1",{class:"summary-title"},"In-Person Signing Link"),h("div",{class:"summary-rows"},h("div",{class:"summary-recipient"},h("div",{class:"role-name"},this.recipient.role_name),h("div",{class:"role-details"},h("div",{class:"role-info"},h("div",{class:"role-full-name"},this.recipient.full_name," (",this.recipient.email||this.recipient.phone,")"),!this.link&&h("verdocs-button",{size:"small",variant:"outline",label:this.gettingLink?"Loading...":"Get Link",disabled:this.gettingLink,onClick:function(){return e.getLink(e.recipient)}})),this.link&&h("div",{class:"link-wrapper"},h("div",{class:"link"},this.link),h("verdocs-button",{size:"small",variant:"outline",label:"Copy",onClick:function(){return e.copyLink(e.link)}}))))),h("div",{class:"buttons"},h("verdocs-button",{size:"small",label:"Done",onClick:function(n){return e.handleDone(n)}}))))};return e}();VerdocsEnvelopeRecipientLink.style=verdocsEnvelopeRecipientLinkCss;var verdocsEnvelopeRecipientSummaryCss='verdocs-envelope-recipient-summary{top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;z-index:100000;position:fixed;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;font-family:"Inter", "Barlow", sans-serif;background-color:#0000007f}verdocs-envelope-recipient-summary .summary-content{width:600px;display:-ms-flexbox;display:flex;max-width:90%;font-size:18px;-ms-flex:0 0 600px;flex:0 0 600px;border-radius:6px;background:#ffffff;-ms-flex-direction:column;flex-direction:column;padding:30px 20px 20px}verdocs-envelope-recipient-summary .summary-content .summary-title{font-size:20px;font-weight:700;margin:0 0 10px 0;color:#33364b}verdocs-envelope-recipient-summary .summary-recipient{display:-ms-flexbox;display:flex;color:#33364b;margin:8px 0 24px 0;-ms-flex-direction:column;flex-direction:column}verdocs-envelope-recipient-summary .summary-recipient .role-name{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;font-size:14px;font-weight:600;margin:0 0 8px 0;color:#092c4c}verdocs-envelope-recipient-summary .summary-recipient .role-info{gap:5px;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:end;align-items:flex-end}verdocs-envelope-recipient-summary .summary-recipient .role-full-name{-ms-flex:1;flex:1;height:34px;display:-ms-flexbox;display:flex;font-size:16px;padding:0 12px;border-radius:4px;-ms-flex-align:center;align-items:center;border:1px solid #cccccc;background:#f9fafb}verdocs-envelope-recipient-summary .summary-recipient .recipient-link{width:120px;padding:0 16px;font-weight:500;margin:0 0 0 8px;text-align:center;font-size:0.875rem;border-radius:100%;color:#374151;line-height:1.25rem;background-color:#d8d8d8;border:2px solid #9ca3af}verdocs-envelope-recipient-summary .summary-recipient .link-wrapper{gap:5px;display:-ms-flexbox;display:flex;margin:4px 0 0 0;-ms-flex-direction:row;flex-direction:row}verdocs-envelope-recipient-summary .summary-recipient .link-wrapper .link{-ms-flex:1;flex:1;height:34px;display:-ms-flexbox;display:flex;font-size:16px;padding:0 12px;border-radius:4px;-ms-flex-align:center;align-items:center;border:1px solid #cccccc;background:#f9fafb}verdocs-envelope-recipient-summary .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;margin:10px 0 0 0;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}verdocs-envelope-recipient-summary .buttons verdocs-button{-ms-flex:0 0 120px;flex:0 0 120px;margin-left:10px;white-space:nowrap}verdocs-envelope-recipient-summary .buttons verdocs-button button{width:100%}';var VerdocsEnvelopeRecipientSummary=function(){function e(e){registerInstance(this,e);this.another=createEvent(this,"another",7);this.view=createEvent(this,"view",7);this.next=createEvent(this,"next",7);this.sdkError=createEvent(this,"sdkError",7);this.store=null;this.endpoint=VerdocsEndpoint.getDefault();this.envelopeId="";this.canSendAnother=true;this.canView=true;this.canDone=true;this.isOpen=undefined;this.loading=true;this.recipientStatusIcons=[];this.containerId="verdocs-status-indicator-".concat(Math.random().toString(36).substring(2,11));this.gettingLinks={};this.links={}}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,n,i,t,r;return __generator(this,(function(o){switch(o.label){case 0:o.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.envelopeId){console.log("[RECIPIENTS] Missing required envelope ID ".concat(this.envelopeId));return[2]}if(!this.endpoint.session){console.log("[RECIPIENTS] Unable to start session, must be authenticated");return[2]}t=this;return[4,getEnvelopeStore(this.endpoint,this.envelopeId,true)];case 1:t.store=o.sent();this.sortEnvelopeRecipients();this.loading=false;return[3,3];case 2:r=o.sent();console.log("[RECIPIENTS] Error loading envelope",r);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new SDKError(r.message,(n=r.response)===null||n===void 0?void 0:n.status,(i=r.response)===null||i===void 0?void 0:i.data));return[3,3];case 3:return[2]}}))}))};e.prototype.sortEnvelopeRecipients=function(){var e,n;(n=(e=this.store)===null||e===void 0?void 0:e.state)===null||n===void 0?void 0:n.recipients.sort((function(e,n){return e.sequence===n.sequence?e.order-n.order:e.sequence-n.sequence}))};e.prototype.handleAnother=function(e){var n;e.preventDefault();(n=this.another)===null||n===void 0?void 0:n.emit({envelope:this.store.state})};e.prototype.handleView=function(e){var n;e.preventDefault();(n=this.view)===null||n===void 0?void 0:n.emit({envelope:this.store.state})};e.prototype.handleDone=function(e){var n;e.preventDefault();(n=this.next)===null||n===void 0?void 0:n.emit({envelope:this.store.state})};e.prototype.copyLink=function(e){var n=this;navigator.clipboard.writeText(e).then((function(){})).catch((function(e){var i;console.warn("[RECIPIENTS] Error copying to clipboard",e);(i=n.sdkError)===null||i===void 0?void 0:i.emit(e)}))};e.prototype.getLink=function(e){var n;var i=this;this.gettingLinks=__assign(__assign({},this.gettingLinks),(n={},n[e.role_name]=true,n));getInPersonLink(this.endpoint,e.envelope_id,e.role_name).then((function(n){var t,r;i.gettingLinks=__assign(__assign({},i.gettingLinks),(t={},t[e.role_name]=false,t));i.links=__assign(__assign({},i.links),(r={},r[e.role_name]=n.link,r));i.copyLink(n.link)})).catch((function(n){var t;var r;i.gettingLinks=__assign(__assign({},i.gettingLinks),(t={},t[e.role_name]=false,t));console.log("[RECIPIENTS] Error getting link",n);(r=i.sdkError)===null||r===void 0?void 0:r.emit(n)}))};e.prototype.render=function(){var e=this;var n,i;if(this.loading){return h(Host,null)}return h(Host,null,h("div",{class:"summary-content"},h("h1",{class:"summary-title"},"Recipient Summary"),h("div",{class:"summary-rows"},(((i=(n=this.store)===null||n===void 0?void 0:n.state)===null||i===void 0?void 0:i.recipients)||[]).map((function(n){var i=getRecipientsWithActions(e.store.state);var t=recipientCanAct(n,i);var r=e.links[n.role_name];var o=e.gettingLinks[n.role_name];return h("div",{class:"summary-recipient"},h("div",{class:"role-name"},n.role_name),h("div",{class:"role-details"},h("div",{class:"role-info"},h("div",{class:"role-full-name"},n.full_name," (",n.email||n.phone,")"),t&&!r&&h("verdocs-button",{size:"small",variant:"outline",label:"Get Link",disabled:o,onClick:function(){return e.getLink(n)}})),r&&h("div",{class:"link-wrapper"},h("div",{class:"link"},r),h("verdocs-button",{size:"small",variant:"outline",label:"Copy",onClick:function(){return e.copyLink(r)}}))))}))),(this.canSendAnother||this.canView||this.canDone)&&h("div",{class:"buttons"},this.canSendAnother&&h("verdocs-button",{size:"small",label:"Send Another",onClick:function(n){return e.handleAnother(n)}}),this.canView&&h("verdocs-button",{size:"small",label:"View Now",onClick:function(n){return e.handleView(n)}}),this.canDone&&h("verdocs-button",{size:"small",label:"Done",onClick:function(n){return e.handleDone(n)}}))))};return e}();VerdocsEnvelopeRecipientSummary.style=verdocsEnvelopeRecipientSummaryCss;export{VerdocsEnvelopeRecipientLink as verdocs_envelope_recipient_link,VerdocsEnvelopeRecipientSummary as verdocs_envelope_recipient_summary};