@verdocs/web-sdk 4.2.87 → 4.2.93

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 (248) hide show
  1. package/dist/cjs/{EnvelopeStore-47a7f67b.js → EnvelopeStore-8ff43359.js} +1 -1
  2. package/dist/cjs/{TemplateFieldStore-90f4d98b.js → TemplateFieldStore-2ad4a148.js} +1 -2
  3. package/dist/cjs/{TemplateRoleStore-f3d11184.js → TemplateRoleStore-fe871897.js} +1 -1
  4. package/dist/cjs/{TemplateStore-eb40fcaf.js → TemplateStore-ea66895c.js} +3 -3
  5. package/dist/cjs/{index-65257ef5.js → index-a27a7f77.js} +1 -4
  6. package/dist/cjs/{index-06e6741b.js → index-c12980a1.js} +1 -1
  7. package/dist/cjs/loader.cjs.js +2 -2
  8. package/dist/cjs/{utils-813f2cbf.js → utils-b7682f9b.js} +1 -18
  9. package/dist/cjs/verdocs-auth.cjs.entry.js +1 -1
  10. package/dist/cjs/verdocs-build.cjs.entry.js +5 -5
  11. package/dist/cjs/verdocs-button-panel_2.cjs.entry.js +1 -1
  12. package/dist/cjs/verdocs-button_2.cjs.entry.js +1 -1
  13. package/dist/cjs/verdocs-checkbox_5.cjs.entry.js +5 -5
  14. package/dist/cjs/verdocs-contact-picker_2.cjs.entry.js +2 -2
  15. package/dist/cjs/verdocs-dialog.cjs.entry.js +1 -1
  16. package/dist/cjs/verdocs-dropdown.cjs.entry.js +1 -1
  17. package/dist/cjs/verdocs-envelope-document-page.cjs.entry.js +2 -2
  18. package/dist/cjs/verdocs-envelope-recipient-link_2.cjs.entry.js +3 -3
  19. package/dist/cjs/verdocs-envelope-sidebar.cjs.entry.js +11 -3
  20. package/dist/cjs/verdocs-envelopes-list.cjs.entry.js +2 -2
  21. package/dist/cjs/verdocs-field-attachment_13.cjs.entry.js +9 -6
  22. package/dist/cjs/verdocs-field-payment.cjs.entry.js +4 -4
  23. package/dist/cjs/verdocs-file-chooser_2.cjs.entry.js +1 -1
  24. package/dist/cjs/verdocs-kba-dialog.cjs.entry.js +1 -1
  25. package/dist/cjs/verdocs-loader.cjs.entry.js +1 -1
  26. package/dist/cjs/verdocs-ok-dialog.cjs.entry.js +1 -1
  27. package/dist/cjs/verdocs-organization-card_2.cjs.entry.js +1 -1
  28. package/dist/cjs/verdocs-pagination_2.cjs.entry.js +2 -2
  29. package/dist/cjs/verdocs-preview_9.cjs.entry.js +6 -6
  30. package/dist/cjs/verdocs-quick-functions.cjs.entry.js +1 -1
  31. package/dist/cjs/verdocs-radio-button_3.cjs.entry.js +5 -5
  32. package/dist/cjs/verdocs-search-box.cjs.entry.js +1 -1
  33. package/dist/cjs/verdocs-search-tabs.cjs.entry.js +1 -1
  34. package/dist/cjs/verdocs-sign.cjs.entry.js +17 -16
  35. package/dist/cjs/verdocs-spinner.cjs.entry.js +1 -1
  36. package/dist/cjs/verdocs-status-indicator.cjs.entry.js +1 -1
  37. package/dist/cjs/verdocs-table.cjs.entry.js +1 -1
  38. package/dist/cjs/verdocs-template-card.cjs.entry.js +1 -1
  39. package/dist/cjs/verdocs-template-document-page_2.cjs.entry.js +4 -4
  40. package/dist/cjs/verdocs-template-star.cjs.entry.js +1 -1
  41. package/dist/cjs/verdocs-template-tags.cjs.entry.js +1 -1
  42. package/dist/cjs/verdocs-templates-list.cjs.entry.js +1 -1
  43. package/dist/cjs/verdocs-toggle.cjs.entry.js +1 -1
  44. package/dist/cjs/verdocs-view.cjs.entry.js +2 -2
  45. package/dist/cjs/verdocs-web-sdk.cjs.js +2 -2
  46. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js +17 -16
  47. package/dist/collection/components/envelopes/verdocs-envelope-sidebar/verdocs-envelope-sidebar.js +8 -0
  48. package/dist/collection/components/fields/verdocs-field-initial/verdocs-field-initial.js +2 -1
  49. package/dist/collection/components/fields/verdocs-field-signature/verdocs-field-signature.js +3 -1
  50. package/dist/collection/utils/TemplateFieldStore.js +0 -1
  51. package/dist/collection/utils/utils.js +1 -18
  52. package/dist/components/TemplateFieldStore.js +0 -1
  53. package/dist/components/utils.js +1 -18
  54. package/dist/components/verdocs-envelope-sidebar.js +8 -0
  55. package/dist/components/verdocs-field-initial2.js +2 -1
  56. package/dist/components/verdocs-field-signature2.js +3 -1
  57. package/dist/components/verdocs-sign.js +15 -14
  58. package/dist/esm/{EnvelopeStore-822889cb.js → EnvelopeStore-27e21856.js} +1 -1
  59. package/dist/esm/{TemplateFieldStore-6113ab4b.js → TemplateFieldStore-4a2e5b85.js} +1 -2
  60. package/dist/esm/{TemplateRoleStore-054bd7ed.js → TemplateRoleStore-6d1bec83.js} +1 -1
  61. package/dist/esm/{TemplateStore-83674f6d.js → TemplateStore-cd995a27.js} +3 -3
  62. package/dist/esm/{index-d3ac9650.js → index-a68c7262.js} +1 -4
  63. package/dist/esm/{index-04235019.js → index-a971a584.js} +1 -1
  64. package/dist/esm/loader.js +3 -3
  65. package/dist/esm/{utils-467fcc6a.js → utils-7b0b77d8.js} +1 -18
  66. package/dist/esm/verdocs-auth.entry.js +1 -1
  67. package/dist/esm/verdocs-build.entry.js +5 -5
  68. package/dist/esm/verdocs-button-panel_2.entry.js +1 -1
  69. package/dist/esm/verdocs-button_2.entry.js +1 -1
  70. package/dist/esm/verdocs-checkbox_5.entry.js +5 -5
  71. package/dist/esm/verdocs-contact-picker_2.entry.js +2 -2
  72. package/dist/esm/verdocs-dialog.entry.js +1 -1
  73. package/dist/esm/verdocs-dropdown.entry.js +1 -1
  74. package/dist/esm/verdocs-envelope-document-page.entry.js +2 -2
  75. package/dist/esm/verdocs-envelope-recipient-link_2.entry.js +3 -3
  76. package/dist/esm/verdocs-envelope-sidebar.entry.js +11 -3
  77. package/dist/esm/verdocs-envelopes-list.entry.js +2 -2
  78. package/dist/esm/verdocs-field-attachment_13.entry.js +9 -6
  79. package/dist/esm/verdocs-field-payment.entry.js +4 -4
  80. package/dist/esm/verdocs-file-chooser_2.entry.js +1 -1
  81. package/dist/esm/verdocs-kba-dialog.entry.js +1 -1
  82. package/dist/esm/verdocs-loader.entry.js +1 -1
  83. package/dist/esm/verdocs-ok-dialog.entry.js +1 -1
  84. package/dist/esm/verdocs-organization-card_2.entry.js +1 -1
  85. package/dist/esm/verdocs-pagination_2.entry.js +2 -2
  86. package/dist/esm/verdocs-preview_9.entry.js +6 -6
  87. package/dist/esm/verdocs-quick-functions.entry.js +1 -1
  88. package/dist/esm/verdocs-radio-button_3.entry.js +5 -5
  89. package/dist/esm/verdocs-search-box.entry.js +1 -1
  90. package/dist/esm/verdocs-search-tabs.entry.js +1 -1
  91. package/dist/esm/verdocs-sign.entry.js +18 -17
  92. package/dist/esm/verdocs-spinner.entry.js +1 -1
  93. package/dist/esm/verdocs-status-indicator.entry.js +1 -1
  94. package/dist/esm/verdocs-table.entry.js +1 -1
  95. package/dist/esm/verdocs-template-card.entry.js +1 -1
  96. package/dist/esm/verdocs-template-document-page_2.entry.js +4 -4
  97. package/dist/esm/verdocs-template-star.entry.js +1 -1
  98. package/dist/esm/verdocs-template-tags.entry.js +1 -1
  99. package/dist/esm/verdocs-templates-list.entry.js +1 -1
  100. package/dist/esm/verdocs-toggle.entry.js +1 -1
  101. package/dist/esm/verdocs-view.entry.js +2 -2
  102. package/dist/esm/verdocs-web-sdk.js +3 -3
  103. package/dist/esm-es5/{EnvelopeStore-822889cb.js → EnvelopeStore-27e21856.js} +1 -1
  104. package/dist/esm-es5/{TemplateFieldStore-6113ab4b.js → TemplateFieldStore-4a2e5b85.js} +1 -1
  105. package/dist/esm-es5/{TemplateRoleStore-054bd7ed.js → TemplateRoleStore-6d1bec83.js} +1 -1
  106. package/dist/esm-es5/{TemplateStore-83674f6d.js → TemplateStore-cd995a27.js} +1 -1
  107. package/dist/esm-es5/index-a68c7262.js +1 -0
  108. package/dist/esm-es5/{index-04235019.js → index-a971a584.js} +1 -1
  109. package/dist/esm-es5/loader.js +1 -1
  110. package/dist/esm-es5/{utils-467fcc6a.js → utils-7b0b77d8.js} +1 -1
  111. package/dist/esm-es5/verdocs-auth.entry.js +1 -1
  112. package/dist/esm-es5/verdocs-build.entry.js +1 -1
  113. package/dist/esm-es5/verdocs-button-panel_2.entry.js +1 -1
  114. package/dist/esm-es5/verdocs-button_2.entry.js +1 -1
  115. package/dist/esm-es5/verdocs-checkbox_5.entry.js +1 -1
  116. package/dist/esm-es5/verdocs-contact-picker_2.entry.js +1 -1
  117. package/dist/esm-es5/verdocs-dialog.entry.js +1 -1
  118. package/dist/esm-es5/verdocs-dropdown.entry.js +1 -1
  119. package/dist/esm-es5/verdocs-envelope-document-page.entry.js +1 -1
  120. package/dist/esm-es5/verdocs-envelope-recipient-link_2.entry.js +1 -1
  121. package/dist/esm-es5/verdocs-envelope-sidebar.entry.js +1 -1
  122. package/dist/esm-es5/verdocs-envelopes-list.entry.js +1 -1
  123. package/dist/esm-es5/verdocs-field-attachment_13.entry.js +1 -1
  124. package/dist/esm-es5/verdocs-field-payment.entry.js +1 -1
  125. package/dist/esm-es5/verdocs-file-chooser_2.entry.js +1 -1
  126. package/dist/esm-es5/verdocs-kba-dialog.entry.js +1 -1
  127. package/dist/esm-es5/verdocs-loader.entry.js +1 -1
  128. package/dist/esm-es5/verdocs-ok-dialog.entry.js +1 -1
  129. package/dist/esm-es5/verdocs-organization-card_2.entry.js +1 -1
  130. package/dist/esm-es5/verdocs-pagination_2.entry.js +1 -1
  131. package/dist/esm-es5/verdocs-preview_9.entry.js +1 -1
  132. package/dist/esm-es5/verdocs-quick-functions.entry.js +1 -1
  133. package/dist/esm-es5/verdocs-radio-button_3.entry.js +1 -1
  134. package/dist/esm-es5/verdocs-search-box.entry.js +1 -1
  135. package/dist/esm-es5/verdocs-search-tabs.entry.js +1 -1
  136. package/dist/esm-es5/verdocs-sign.entry.js +1 -1
  137. package/dist/esm-es5/verdocs-spinner.entry.js +1 -1
  138. package/dist/esm-es5/verdocs-status-indicator.entry.js +1 -1
  139. package/dist/esm-es5/verdocs-table.entry.js +1 -1
  140. package/dist/esm-es5/verdocs-template-card.entry.js +1 -1
  141. package/dist/esm-es5/verdocs-template-document-page_2.entry.js +1 -1
  142. package/dist/esm-es5/verdocs-template-star.entry.js +1 -1
  143. package/dist/esm-es5/verdocs-template-tags.entry.js +1 -1
  144. package/dist/esm-es5/verdocs-templates-list.entry.js +1 -1
  145. package/dist/esm-es5/verdocs-toggle.entry.js +1 -1
  146. package/dist/esm-es5/verdocs-view.entry.js +1 -1
  147. package/dist/esm-es5/verdocs-web-sdk.js +1 -1
  148. package/dist/types/components/embeds/verdocs-sign/verdocs-sign.d.ts +3 -3
  149. package/dist/verdocs-web-sdk/{p-5c614b25.system.entry.js → p-00828859.system.entry.js} +1 -1
  150. package/dist/verdocs-web-sdk/p-04e53cb3.entry.js +1 -0
  151. package/dist/verdocs-web-sdk/{p-35e7051c.system.entry.js → p-0833c8d4.system.entry.js} +1 -1
  152. package/dist/verdocs-web-sdk/{p-b62aeeda.entry.js → p-08d272d2.entry.js} +1 -1
  153. package/dist/verdocs-web-sdk/{p-5473bbd9.entry.js → p-0b061610.entry.js} +1 -1
  154. package/dist/verdocs-web-sdk/{p-bb73f4d8.system.entry.js → p-0eeaf11d.system.entry.js} +1 -1
  155. package/dist/verdocs-web-sdk/{p-c86983bc.js → p-1289c3d5.js} +1 -1
  156. package/dist/verdocs-web-sdk/{p-56adb753.entry.js → p-1500a477.entry.js} +1 -1
  157. package/dist/verdocs-web-sdk/{p-e41fa435.system.entry.js → p-17930b47.system.entry.js} +1 -1
  158. package/dist/verdocs-web-sdk/{p-69176f56.entry.js → p-18cdd0d8.entry.js} +1 -1
  159. package/dist/verdocs-web-sdk/{p-a8a5b757.system.entry.js → p-18dd4952.system.entry.js} +1 -1
  160. package/dist/verdocs-web-sdk/p-1acc504b.system.entry.js +1 -0
  161. package/dist/verdocs-web-sdk/{p-d1a1ffaf.entry.js → p-233c47c9.entry.js} +1 -1
  162. package/dist/verdocs-web-sdk/p-267df026.system.js +1 -0
  163. package/dist/verdocs-web-sdk/{p-574853d0.entry.js → p-27d94737.entry.js} +1 -1
  164. package/dist/verdocs-web-sdk/{p-57ce9e5a.system.entry.js → p-281ce405.system.entry.js} +1 -1
  165. package/dist/verdocs-web-sdk/{p-921a282f.system.entry.js → p-286a97a7.system.entry.js} +1 -1
  166. package/dist/verdocs-web-sdk/{p-25c7a632.entry.js → p-2a0d1b6e.entry.js} +1 -1
  167. package/dist/verdocs-web-sdk/{p-40880f27.entry.js → p-2c2a9483.entry.js} +1 -1
  168. package/dist/verdocs-web-sdk/{p-808697ac.system.js → p-2cf67caa.system.js} +1 -1
  169. package/dist/verdocs-web-sdk/{p-96e26aea.entry.js → p-2f191d39.entry.js} +1 -1
  170. package/dist/verdocs-web-sdk/{p-7a43f055.entry.js → p-3514f40b.entry.js} +1 -1
  171. package/dist/verdocs-web-sdk/{p-e339ebc4.system.js → p-38778553.system.js} +1 -1
  172. package/dist/verdocs-web-sdk/{p-f5cac080.entry.js → p-38ab701b.entry.js} +1 -1
  173. package/dist/verdocs-web-sdk/{p-7ca7ef58.system.entry.js → p-42a3802e.system.entry.js} +1 -1
  174. package/dist/verdocs-web-sdk/{p-89ccf031.js → p-4372c294.js} +1 -1
  175. package/dist/verdocs-web-sdk/{p-12264105.system.entry.js → p-4475c970.system.entry.js} +1 -1
  176. package/dist/verdocs-web-sdk/{p-c0d3c96f.entry.js → p-44dad7e0.entry.js} +1 -1
  177. package/dist/verdocs-web-sdk/{p-916a38e8.system.entry.js → p-44ef8fc5.system.entry.js} +1 -1
  178. package/dist/verdocs-web-sdk/{p-e744e6c8.system.entry.js → p-4bf58d00.system.entry.js} +1 -1
  179. package/dist/verdocs-web-sdk/{p-bd596213.system.entry.js → p-4dcd1005.system.entry.js} +1 -1
  180. package/dist/verdocs-web-sdk/p-5207d80c.js +2 -0
  181. package/dist/verdocs-web-sdk/{p-e5a426c4.system.js → p-59073837.system.js} +2 -2
  182. package/dist/verdocs-web-sdk/{p-abeb53f5.entry.js → p-5b511018.entry.js} +1 -1
  183. package/dist/verdocs-web-sdk/{p-5a4950f1.system.entry.js → p-5c0c042d.system.entry.js} +1 -1
  184. package/dist/verdocs-web-sdk/{p-4275b4b5.system.entry.js → p-5c50ce79.system.entry.js} +1 -1
  185. package/dist/verdocs-web-sdk/{p-0f6f5c51.system.entry.js → p-6589d38a.system.entry.js} +1 -1
  186. package/dist/verdocs-web-sdk/{p-124d8ec6.system.entry.js → p-6bcdfa4f.system.entry.js} +1 -1
  187. package/dist/verdocs-web-sdk/{p-0085540e.system.js → p-701b9cbd.system.js} +1 -1
  188. package/dist/verdocs-web-sdk/{p-4de823b1.entry.js → p-7f52a1c4.entry.js} +1 -1
  189. package/dist/verdocs-web-sdk/{p-6ce8381c.js → p-83317d11.js} +1 -1
  190. package/dist/verdocs-web-sdk/{p-9a8c90f4.system.js → p-86ccc8c9.system.js} +1 -1
  191. package/dist/verdocs-web-sdk/{p-d2ad8536.entry.js → p-88437b42.entry.js} +1 -1
  192. package/dist/verdocs-web-sdk/{p-2ac3b1ce.entry.js → p-8b74ca77.entry.js} +1 -1
  193. package/dist/verdocs-web-sdk/{p-9034d0c7.entry.js → p-94852d77.entry.js} +1 -1
  194. package/dist/verdocs-web-sdk/{p-9df7c5b4.entry.js → p-965631d9.entry.js} +1 -1
  195. package/dist/verdocs-web-sdk/p-9753694a.entry.js +1 -0
  196. package/dist/verdocs-web-sdk/{p-8efd4efc.entry.js → p-9ad111fc.entry.js} +1 -1
  197. package/dist/verdocs-web-sdk/{p-17c111cb.system.entry.js → p-9b3bebba.system.entry.js} +1 -1
  198. package/dist/verdocs-web-sdk/{p-ef79cbed.entry.js → p-9cde1db5.entry.js} +1 -1
  199. package/dist/verdocs-web-sdk/{p-5041f47d.system.entry.js → p-9ddaf09d.system.entry.js} +1 -1
  200. package/dist/verdocs-web-sdk/{p-d812d374.js → p-9e371467.js} +1 -1
  201. package/dist/verdocs-web-sdk/p-a1bff034.system.js +1 -0
  202. package/dist/verdocs-web-sdk/{p-12a2b8bb.system.entry.js → p-a324eeca.system.entry.js} +1 -1
  203. package/dist/verdocs-web-sdk/{p-b2cf2cce.system.entry.js → p-a4a60476.system.entry.js} +1 -1
  204. package/dist/verdocs-web-sdk/{p-877e9b3f.system.entry.js → p-a764d4cd.system.entry.js} +1 -1
  205. package/dist/verdocs-web-sdk/{p-87c0f26b.entry.js → p-a87190ad.entry.js} +1 -1
  206. package/dist/verdocs-web-sdk/{p-a5875fbf.entry.js → p-aad40b41.entry.js} +1 -1
  207. package/dist/verdocs-web-sdk/{p-3e4d4e20.system.entry.js → p-b055bec1.system.entry.js} +1 -1
  208. package/dist/verdocs-web-sdk/{p-e66e59d7.system.entry.js → p-b426caa8.system.entry.js} +1 -1
  209. package/dist/verdocs-web-sdk/{p-00db42e2.system.entry.js → p-b743f246.system.entry.js} +1 -1
  210. package/dist/verdocs-web-sdk/{p-b804950e.entry.js → p-b7a0a567.entry.js} +1 -1
  211. package/dist/verdocs-web-sdk/{p-04b24f21.entry.js → p-ba8fc3fc.entry.js} +1 -1
  212. package/dist/verdocs-web-sdk/{p-218a16f9.system.entry.js → p-bb315de2.system.entry.js} +1 -1
  213. package/dist/verdocs-web-sdk/p-bb4674a6.system.entry.js +1 -0
  214. package/dist/verdocs-web-sdk/{p-15aa84ea.system.entry.js → p-bbdc81d5.system.entry.js} +1 -1
  215. package/dist/verdocs-web-sdk/{p-252a42c7.system.entry.js → p-be2431ed.system.entry.js} +1 -1
  216. package/dist/verdocs-web-sdk/{p-78d37e83.system.entry.js → p-c1978016.system.entry.js} +1 -1
  217. package/dist/verdocs-web-sdk/{p-db46606c.entry.js → p-c8e439cc.entry.js} +1 -1
  218. package/dist/verdocs-web-sdk/{p-a0849dc6.system.entry.js → p-c9b00253.system.entry.js} +1 -1
  219. package/dist/verdocs-web-sdk/{p-2a43465a.entry.js → p-ce085249.entry.js} +1 -1
  220. package/dist/verdocs-web-sdk/{p-b7030c25.system.entry.js → p-cea2766d.system.entry.js} +1 -1
  221. package/dist/verdocs-web-sdk/{p-5180a854.system.js → p-d3b5c957.system.js} +1 -1
  222. package/dist/verdocs-web-sdk/{p-59fa9d51.entry.js → p-d55b1490.entry.js} +1 -1
  223. package/dist/verdocs-web-sdk/{p-679639b1.system.entry.js → p-d754b3d1.system.entry.js} +1 -1
  224. package/dist/verdocs-web-sdk/{p-a9a20b20.entry.js → p-d80305c3.entry.js} +1 -1
  225. package/dist/verdocs-web-sdk/{p-048107b2.entry.js → p-dc307e81.entry.js} +1 -1
  226. package/dist/verdocs-web-sdk/{p-80820f5a.entry.js → p-dc4a5bc3.entry.js} +1 -1
  227. package/dist/verdocs-web-sdk/{p-c6d79a0d.entry.js → p-de1f949a.entry.js} +1 -1
  228. package/dist/verdocs-web-sdk/{p-2819b713.system.entry.js → p-e331a1ad.system.entry.js} +1 -1
  229. package/dist/verdocs-web-sdk/{p-b241b339.entry.js → p-e5e05e63.entry.js} +1 -1
  230. package/dist/verdocs-web-sdk/{p-a0839ea6.system.entry.js → p-e8dd697f.system.entry.js} +1 -1
  231. package/dist/verdocs-web-sdk/{p-f4688962.js → p-ed199c97.js} +1 -1
  232. package/dist/verdocs-web-sdk/p-f0449967.entry.js +1 -0
  233. package/dist/verdocs-web-sdk/{p-58071af4.system.entry.js → p-f1a49237.system.entry.js} +1 -1
  234. package/dist/verdocs-web-sdk/p-ff64786a.js +1 -0
  235. package/dist/verdocs-web-sdk/{p-6ecdfe5f.entry.js → p-ffbfc227.entry.js} +1 -1
  236. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  237. package/dist/verdocs-web-sdk/verdocs-web-sdk.js +1 -1
  238. package/package.json +2 -2
  239. package/dist/esm-es5/index-d3ac9650.js +0 -1
  240. package/dist/verdocs-web-sdk/p-00244d09.system.entry.js +0 -1
  241. package/dist/verdocs-web-sdk/p-34325ad6.system.js +0 -1
  242. package/dist/verdocs-web-sdk/p-60e4721d.entry.js +0 -1
  243. package/dist/verdocs-web-sdk/p-67a42e2b.js +0 -2
  244. package/dist/verdocs-web-sdk/p-6ac15c93.system.entry.js +0 -1
  245. package/dist/verdocs-web-sdk/p-78bdc332.entry.js +0 -1
  246. package/dist/verdocs-web-sdk/p-a2c07e00.entry.js +0 -1
  247. package/dist/verdocs-web-sdk/p-f0386b87.system.js +0 -1
  248. package/dist/verdocs-web-sdk/p-fdf18146.js +0 -1
@@ -1 +1 @@
1
- import{r as e,c as t,h as i,H as s,F as o,g as l}from"./p-67a42e2b.js";import{VerdocsEndpoint as a,integerSequence as r,getOrganizationContacts as n,createEnvelope as d,isValidEmail as c,isValidPhone as p,getRGBA as h,createTemplateDocument as v,deleteTemplateDocument as m,createTemplate as u,updateField as g,createField as f,updateTemplate as x,updateTemplateRole as b,createTemplateRole as w}from"@verdocs/js-sdk";import{g as y,u as k}from"./p-fdf18146.js";import{g as C,b as q,a as E,u as S}from"./p-d812d374.js";import{g as z}from"./p-89ccf031.js";import{S as M}from"./p-fd97809c.js";import{D as L,P as I,J as T,a as H,F as Z,b as D,T as V}from"./p-b0766439.js";import{V as _}from"./p-04c07b7b.js";import{d as R}from"./p-edaec1b6.js";import{i as N}from"./p-a901dff2.js";import{b as U,c as A,g as B,d as j,e as P}from"./p-c86983bc.js";import"./p-6ce8381c.js";import"./p-a706bac9.js";import"./p-85aa8e05.js";import"./p-251c4106.js";const F=class{constructor(i){e(this,i),this.sdkError=t(this,"sdkError",7),this.templateStore=null,this.fieldStore=null,this.roleStore=null,this.endpoint=a.getDefault(),this.templateId=null,this.loading=!0}onTemplateIdChanged(e){console.log("[PREVIEW] Template ID changed",e),this.loadTemplate(e).catch((e=>console.log("Unknown Error",e)))}async componentWillLoad(){var e,t,i;try{return this.endpoint.loadSession(),this.endpoint.session?this.templateId?this.loadTemplate(this.templateId):void console.log(`[PREVIEW] Missing required template ID ${this.templateId}`):void console.log("[PREVIEW] Unable to start builder session, must be authenticated")}catch(s){console.log("[PREVIEW] Error with preview session",s),null===(e=this.sdkError)||void 0===e||e.emit(new M(s.message,null===(t=s.response)||void 0===t?void 0:t.status,null===(i=s.response)||void 0===i?void 0:i.data))}}async loadTemplate(e){e&&z(this.endpoint,e,!1).then((e=>{this.templateStore=e,this.fieldStore=y(this.templateId),this.roleStore=C(this.templateId),this.loading=!1})).catch((e=>{throw console.log("Unable to load template",e),e}))}handlePageRendered(e){}render(){var e,t;return i(s,null,this.loading?i("verdocs-loader",null):((null===(t=null===(e=this.templateStore)||void 0===e?void 0:e.state)||void 0===t?void 0:t.documents)||[]).map((e=>{const t=r(1,e.pages);return i(o,null,t.map((t=>i("verdocs-template-document-page",{templateId:e.template_id,documentId:e.id,pageNumber:t,disabled:!0,editable:!1,done:!1,virtualWidth:612,virtualHeight:792,onPageRendered:e=>this.handlePageRendered(e),layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]}))))})))}static get watchers(){return{templateId:["onTemplateIdChanged"]}}};F.style='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-preview{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;min-height:200px;position:relative;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column}verdocs-preview div,verdocs-preview canvas{-webkit-box-sizing:border-box;box-sizing:border-box}';const Q='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" tabindex="-1"><path d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"></path></svg>',W=class{constructor(i){e(this,i),this.sendingEnvelope=t(this,"sendingEnvelope",7),this.send=t(this,"send",7),this.exit=t(this,"exit",7),this.sdkError=t(this,"sdkError",7),this.searchContacts=t(this,"searchContacts",7),this.endpoint=a.getDefault(),this.templateId=null,this.environment="",this.containerId=`verdocs-send-${Math.random().toString(36).substring(2,11)}`,this.showPickerForId="",this.sessionContacts=[],this.sending=!1,this.rolesCompleted={},this.templateStore=null,this.roleStore=null}async reset(){this.rolesCompleted={}}onTemplateIdChanged(e){console.log("[SEND] Template ID changed",e),this.loadTemplate(e).catch((e=>console.log("Unknown Error",e)))}async componentWillLoad(){var e,t,i;try{return this.endpoint.onSessionChanged(((e,t,i)=>{if(!i)return;const s={id:i.id,first_name:i.first_name,last_name:i.last_name,email:i.email,phone:i.phone};i&&(this.sessionContacts=[s],n(this.endpoint).then((e=>{console.log("[SEND] Got contacts",e),this.sessionContacts=[...e,s]})).catch((e=>{console.log("[SEND] Error getting contacts",e)})))})),this.endpoint.loadSession(),this.endpoint.session?this.templateId?this.loadTemplate(this.templateId):void console.log(`[SEND] Missing required template ID ${this.templateId}`):void console.log("[SEND] Unable to start Send operation, must be authenticated")}catch(s){console.log("[SEND] Error with send session",s),null===(e=this.sdkError)||void 0===e||e.emit(new M(s.message,null===(t=s.response)||void 0===t?void 0:t.status,null===(i=s.response)||void 0===i?void 0:i.data))}}async loadTemplate(e){var t,i,s,o,l;if(e)try{this.templateStore=await z(this.endpoint,e,!1),this.roleStore=C(e),this.recomputeRolesCompleted(),(null===(i=null===(t=this.templateStore)||void 0===t?void 0:t.state)||void 0===i?void 0:i.is_sendable)||console.warn("[SEND] Template is not sendable",e)}catch(e){console.log("[SEND] Error with preview session",e),null===(s=this.sdkError)||void 0===s||s.emit(new M(e.message,null===(o=e.response)||void 0===o?void 0:o.status,null===(l=e.response)||void 0===l?void 0:l.data))}}recomputeRolesCompleted(){var e;const t=(null===(e=this.roleStore)||void 0===e?void 0:e.get("roles"))||[],i={};this.rolesCompleted={},t.forEach((e=>{const t=e.sequence-1;i[t]||(i[t]=[]);const s=`r-${t}-${i[t].length}`;i[t].push({...e,id:s,role_name:e.name,first_name:e.first_name,last_name:e.last_name}),e.first_name&&(e.email||e.phone)&&(this.rolesCompleted[s]={...e,id:s,role_name:e.name,first_name:e.first_name,last_name:e.last_name})}))}getLevels(){var e;const t=(null===(e=this.roleStore)||void 0===e?void 0:e.get("roles"))||[],i=[...new Set(t.map((e=>e.sequence-1)))];return i.sort(((e,t)=>e-t)),i}getRolesAtLevel(e){var t;return((null===(t=this.roleStore)||void 0===t?void 0:t.get("roles"))||[]).filter((t=>t.sequence-1===e)).map(((t,i)=>({...t,id:`r-${e}-${i}`,role_name:t.name,first_name:"",last_name:""})))}getLevelIcon(e){const t=this.getLevels();return i("div",e<0?{class:"level-icon",innerHTML:'<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" tabindex="-1"><path d="M2 12C2 6.48 6.48 2 12 2s10 4.48 10 10-4.48 10-10 10S2 17.52 2 12zm10 6c3.31 0 6-2.69 6-6s-2.69-6-6-6-6 2.69-6 6 2.69 6 6 6z"></path></svg>'}:e>=t.length?{class:"level-icon",innerHTML:'<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" tabindex="-1"><path d="m18 7-1.41-1.41-6.34 6.34 1.41 1.41L18 7zm4.24-1.41L11.66 16.17 7.48 12l-1.41 1.41L11.66 19l12-12-1.42-1.41zM.41 13.41 6 19l1.41-1.41L1.83 12 .41 13.41z"></path></svg>'}:{class:"level-icon",innerHTML:'<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" tabindex="-1"><path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"></path></svg>'})}handleSelectContact(e,t){e.preventDefault(),this.rolesCompleted[t.id]={...t,...e.detail},this.showPickerForId=""}handleClickRole(e,t){e.stopPropagation(),this.showPickerForId=t.id}handleSend(e){var t,i,s;if(this.sending)return void console.log("[SEND] Skipping duplicate send",e);console.log("[SEND] Sending",e),e.preventDefault(),e.stopPropagation(),this.sending=!0,null===(t=this.sendingEnvelope)||void 0===t||t.emit({sending:!0});const o={template_id:this.templateId,name:null===(s=null===(i=this.templateStore)||void 0===i?void 0:i.state)||void 0===s?void 0:s.name,environment:this.environment,initial_reminder:0,followup_reminders:0,recipients:Object.values(this.rolesCompleted),fields:[]};console.log("[SEND] Creating envelope",o),d(this.endpoint,o).then((e=>{var t,i;console.log("[SEND] Send envelope",e),this.reset().catch((e=>console.log("Unknown Error",e))),this.sending=!1,null===(t=this.sendingEnvelope)||void 0===t||t.emit({sending:!1}),null===(i=this.send)||void 0===i||i.emit({...o,envelope_id:e.id,envelope:e})})).catch((e=>{var t;console.log("Send error",e),this.sending=!1,null===(t=this.sendingEnvelope)||void 0===t||t.emit({sending:!1})}))}handleCancel(e){var t;e.stopPropagation(),null===(t=this.exit)||void 0===t||t.emit()}render(){var e,t;if(!this.endpoint.session)return i(s,{style:{display:"flex"}},i("verdocs-component-error",{message:"You must be authenticated to use this module."}));const o=this.getLevels(),l=q(this.roleStore),a=Object.values(this.rolesCompleted).filter((e=>c(e.email)||p(e.phone))).length>=l.length;return console.log("[SEND] Roles completed",this.rolesCompleted),i(s,{class:{sendable:null===(t=null===(e=this.templateStore)||void 0===e?void 0:e.state)||void 0===t?void 0:t.is_sendable}},i("div",{class:"recipients"},i("div",{class:"left-line"}),i("div",{class:"level level-start"},this.getLevelIcon(-1),i("div",{class:"complete"},"Send Envelope")),o.map((e=>i("div",{class:`level level-${e}`},this.getLevelIcon(e),this.getRolesAtLevel(e).map((e=>{var t,s,o,l,a,r;const n=`verdocs-send-recipient-${e.role_name}`;return e.email?i("div",{class:"recipient",style:{borderColor:h(E(this.roleStore,e.role_name))},onClick:t=>this.handleClickRole(t,e),id:n},null!==(a=null===(l=this.rolesCompleted[e.id])||void 0===l?void 0:l.first_name)&&void 0!==a?a:e.first_name,i("div",{class:"icon",innerHTML:Q}),this.showPickerForId===e.id&&i("verdocs-portal",{anchor:n,onClickAway:()=>this.showPickerForId=""},i("verdocs-contact-picker",{onExit:()=>this.showPickerForId="",onNext:t=>this.handleSelectContact(t,e),contactSuggestions:this.sessionContacts,templateRole:null!==(r=this.rolesCompleted[e.id])&&void 0!==r?r:e,onSearchContacts:e=>{var t;return null===(t=this.searchContacts)||void 0===t?void 0:t.emit(e.detail)}}))):i("div",{class:"recipient","data-ri":E(this.roleStore,e.role_name),"data-rn":e.role_name,style:{backgroundColor:h(E(this.roleStore,e.role_name))},onClick:t=>this.handleClickRole(t,e),id:n},null!==(s=null===(t=this.rolesCompleted[e.id])||void 0===t?void 0:t.first_name)&&void 0!==s?s:e.role_name,i("div",{class:"icon",innerHTML:Q}),this.showPickerForId===e.id&&i("verdocs-portal",{anchor:n,onClickAway:()=>this.showPickerForId=""},i("verdocs-contact-picker",{onExit:()=>this.showPickerForId="",onNext:t=>this.handleSelectContact(t,e),contactSuggestions:this.sessionContacts,templateRole:null!==(o=this.rolesCompleted[e.id])&&void 0!==o?o:e,onSearchContacts:e=>{var t;return null===(t=this.searchContacts)||void 0===t?void 0:t.emit(e.detail)}})))}))))),i("div",{class:"level level-done"},this.getLevelIcon(o.length),i("div",{class:"complete"},"Signing Complete"))),i("div",{class:"buttons"},i("verdocs-button",{label:"Cancel",size:"small",variant:"outline",onClick:e=>this.handleCancel(e),disabled:this.sending}),i("verdocs-button",{label:"Send",size:"small",disabled:!a||this.sending,onClick:e=>this.handleSend(e)}),this.sending&&i("verdocs-spinner",null)))}static get watchers(){return{templateId:["onTemplateIdChanged"]}}};W.style='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-send{padding:10px;position:relative;background:#ffffff;-ms-flex-direction:column;flex-direction:column;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-send.sendable{display:-ms-flexbox;display:flex}verdocs-send .recipients{position:relative}verdocs-send .left-line{top:32px;left:20px;z-index:1;width:12px;bottom:30px;position:absolute;background:#ffffff;border-left:3px dotted #9b9b9b}verdocs-send .level{display:-ms-flexbox;display:flex;-webkit-column-gap:10px;-moz-column-gap:10px;column-gap:10px;margin-left:50px;position:relative;-ms-flex-direction:row;flex-direction:row;padding:8px 0 4px 0;border-bottom:1px solid rgba(151, 151, 151, 0.2666666667)}verdocs-send .level .level-icon{top:14px;z-index:2;left:-40px;width:24px;height:24px;position:absolute;background:#ffffff}verdocs-send .level .level-icon svg{fill:rgba(0, 0, 0, 0.537254902)}verdocs-send .level .recipient{height:30px;display:-ms-flexbox;display:flex;-ms-flex:0 0 30px;flex:0 0 30px;color:#000000;cursor:pointer;font-size:14px;-ms-flex-align:center;align-items:center;border-radius:30px;-ms-flex-direction:row;flex-direction:row;background:#dddddd;white-space:nowrap;border:2px solid #dddddd;padding:2px 10px 2px 14px}verdocs-send .level .recipient .icon{width:22px;height:22px;-ms-flex:0 0 22px;flex:0 0 22px;margin:0 0 0 10px}verdocs-send .level .recipient .icon svg{width:22px;height:22px;fill:#333333;outline:none}verdocs-send .level .complete{-ms-flex:1;flex:1;height:30px;display:-ms-flexbox;display:flex;color:#000000;font-size:14px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;padding:3px 10px 3px 2px}verdocs-send .buttons{display:-ms-flexbox;display:flex;margin-top:10px;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;-ms-flex-direction:row;flex-direction:row}verdocs-send verdocs-contact-picker{left:0;top:41px;z-index:10;position:absolute;border:1px solid #dddddd;-webkit-box-shadow:0 0 6px 3px rgba(0, 0, 0, 0.1);box-shadow:0 0 6px 3px rgba(0, 0, 0, 0.1)}';const $=class{constructor(i){e(this,i),this.exit=t(this,"exit",7),this.next=t(this,"next",7),this.templateUpdated=t(this,"templateUpdated",7),this.sdkError=t(this,"sdkError",7),this.endpoint=a.getDefault(),this.templateId="",this.uploading=!1,this.progressLabel="Uploading...",this.progressPercent=0,this.showDeleteError=!1,this.confirmDeleteDocument=null,this.store=null}async componentWillLoad(){var e,t,i;try{if(this.endpoint.loadSession(),!this.templateId)return void console.log(`[ROLES] Missing required template ID ${this.templateId}`);if(!this.endpoint.session)return void console.log("[ROLES] Unable to start builder session, must be authenticated");this.store=await z(this.endpoint,this.templateId,!1)}catch(s){console.log("[TEMPLATE ATTACHMENTS] Error loading template",s),null===(e=this.sdkError)||void 0===e||e.emit(new M(s.message,null===(t=s.response)||void 0===t?void 0:t.status,null===(i=s.response)||void 0===i?void 0:i.data))}}handleCancel(e){e.stopPropagation(),this.exit.emit()}handleUploadProgress(e){e>=99?(this.progressPercent=100,this.progressLabel="Processing..."):this.progressPercent=e}async handleUpload(e){var t,i,s,o;e.stopPropagation();const l=e.detail.file;if(l){console.log("[ATTACHMENTS] Uploading...",l),this.uploading=!0,this.progressLabel="Uploading...";try{const e=await v(this.endpoint,this.templateId,l,this.handleUploadProgress.bind(this));console.log("[ATTACHMENTS] Created attachment",e),this.store=await z(this.endpoint,this.templateId,!1),console.log("[ATTACHMENTS] Updated template",this.store.state),null===(t=this.templateUpdated)||void 0===t||t.emit({endpoint:this.endpoint,template:this.store.state,event:"attachments"}),this.uploading=!1,this.progressLabel="",this.progressPercent=0}catch(e){console.log("[ATTACHMENTS] Error creating template",e),null===(i=this.sdkError)||void 0===i||i.emit(new M(e.message,null===(s=e.response)||void 0===s?void 0:s.status,null===(o=e.response)||void 0===o?void 0:o.data)),this.uploading=!1}}}handleNext(e){var t;e.stopPropagation(),this.uploading=!1,this.progressLabel="",this.progressPercent=0,null===(t=this.next)||void 0===t||t.emit({template:this.store.state})}async confirmDelete(){await m(this.endpoint,this.templateId,this.confirmDeleteDocument.id),this.store=await z(this.endpoint,this.templateId,!1),console.log("[ATTACHMENTS] New template",this.store.state),this.confirmDeleteDocument=null}async handleDelete(e){var t;(null===(t=this.store.state)||void 0===t?void 0:t.documents.length)>1?this.confirmDeleteDocument=e:this.showDeleteError=!0}getFileIcon(e){switch(e.mime){case"application/pdf":return H;case"image/jpeg":return T;case"image/png":return I;case"application/msword":case"application/vnd.openxmlformats-officedocument.wordprocessingml.document":return L}return Z}render(){var e,t,o;if(!this.endpoint.session)return i(s,null,i("verdocs-component-error",{message:"You must be authenticated to use this module."}));const l=null===(e=this.store)||void 0===e?void 0:e.state;return l.isLoaded?this.endpoint.session&&l.profile_id?i(s,null,i("h5",null,"Existing Attachments"),i("div",{class:"attachments"},null===(t=this.store)||void 0===t?void 0:t.state.documents.map((e=>i("div",{class:"attachment"},i("div",{class:"file-icon",innerHTML:this.getFileIcon(e)}),i("div",{class:"filename",title:e.name},e.name),i("div",{class:"pages"},i("div",{class:"count"},e.pages),i("div",{class:"pages-icon",innerHTML:D})),i("div",{class:"trash-icon",innerHTML:V,onClick:()=>this.handleDelete(e)}))))),i("h5",null,"Attach a New Document"),this.uploading?i("div",{class:"loader-wrapper"},i("verdocs-loader",null),this.progressLabel&&i("div",{class:"progress-wrapper"},i("verdocs-progress-bar",{showPercent:!0,percent:this.progressPercent,label:this.progressLabel}))):i("verdocs-file-chooser",{onFileSelected:e=>this.handleUpload(e)}),i("div",{class:"buttons"},i("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:e=>this.handleCancel(e),disabled:this.uploading}),i("verdocs-button",{label:"Next",size:"small",onClick:e=>this.handleNext(e),disabled:!(null===(o=this.store)||void 0===o?void 0:o.state.documents.length)||this.uploading})),this.showDeleteError&&i("verdocs-ok-dialog",{heading:"Unable to Delete Attachment",message:"Templates must contain at least one attachment.",onNext:()=>this.showDeleteError=!1}),this.confirmDeleteDocument&&i("verdocs-ok-dialog",{heading:"Delete this Attachment?",message:"This operation cannot be undone. All fields placed<br />on the deleted attachment will also be removed.",onNext:()=>this.confirmDelete(),showCancel:!0,onExit:()=>{this.confirmDeleteDocument=null}})):i(s,{class:"empty"}):i(s,{class:"loading"},i("verdocs-loader",null))}};$.style='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-template-attachments{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-attachments h5{font-size:16px;font-weight:bold;margin:0 0 10px 0;color:#46497d}verdocs-template-attachments .attachments{margin:0 0 40px 0}verdocs-template-attachments .attachment{display:-ms-flexbox;display:flex;padding:5px 0;-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;color:#33364b}verdocs-template-attachments .attachment:hover .trash-icon{display:-ms-flexbox;display:flex}verdocs-template-attachments .attachment:hover .pages{display:none}verdocs-template-attachments svg{width:28px;height:28px;fill:#5c6575;margin:2px 0 0 0}verdocs-template-attachments .file-icon{-ms-flex:0;flex:0}verdocs-template-attachments .pages{width:24px;height:24px;-ms-flex:0 0 24px;flex:0 0 24px;padding-left:4px;position:relative;margin:-10px 0 0 0}verdocs-template-attachments .pages .pages-icon{top:0;left:0;width:24px;height:24px;position:absolute}verdocs-template-attachments .pages .count{top:11px;left:7px;z-index:1;width:18px;font-size:12px;font-weight:500;position:absolute;text-align:center;letter-spacing:-2px}verdocs-template-attachments .filename{-ms-flex:1;flex:1;display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;border-bottom:1px dotted #cccccc}verdocs-template-attachments .trash-icon{-ms-flex:0;flex:0;display:none}verdocs-template-attachments .trash-icon:hover{cursor:pointer}verdocs-template-attachments verdocs-file-chooser{margin:10px 0;border:2px dashed #979797}verdocs-template-attachments .loader-wrapper{background-color:#ffffff;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;width:320px;height:320px;text-align:center;border:2px dashed #979797;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-attachments .progress-wrapper{padding:20px}verdocs-template-attachments .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-attachments .buttons .flex-fill{-ms-flex:1;flex:1}verdocs-template-attachments ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-attachments ::-moz-placeholder{color:#aaaaaa}verdocs-template-attachments :-ms-input-placeholder{color:#aaaaaa}verdocs-template-attachments ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-attachments ::placeholder{color:#aaaaaa}';const O=["attachments","roles","settings","fields","preview"],Y=class{constructor(i){e(this,i),this.sdkError=t(this,"sdkError",7),this.stepChanged=t(this,"stepChanged",7),this.endpoint=a.getDefault(),this.templateId=null,this.step="preview",this.templateStore=null}onTemplateIdChanged(e){console.log("[BUILD_TABS] Template ID changed",e),this.loadTemplate(e).catch((e=>console.log("Unknown Error",e)))}onStepChanged(e){console.log("[BUILD_TABS] Step changed",e),this.loadTemplate(this.templateId).catch((e=>console.log("Unknown Error",e)))}async componentWillLoad(){var e,t,i,s,o,l;try{if(this.endpoint.loadSession(),!this.endpoint.session)return void console.log("[BUILD_TABS] Unable to start builder session, must be authenticated");if(!this.templateId)return this.step="attachments",void console.log("[BUILD_TABS] Missing required template ID, forcing view to attachments");try{this.templateStore=await z(this.endpoint,this.templateId,!1)}catch(s){console.log("[BUILD_TABS] Error loading template",s),null===(e=this.sdkError)||void 0===e||e.emit(new M(s.message,null===(t=s.response)||void 0===t?void 0:t.status,null===(i=s.response)||void 0===i?void 0:i.data))}}catch(e){console.log("[BUILD_TABS] Error loading template",e),null===(s=this.sdkError)||void 0===s||s.emit(new M(e.message,null===(o=e.response)||void 0===o?void 0:o.status,null===(l=e.response)||void 0===l?void 0:l.data))}}async loadTemplate(e){e&&(this.templateStore=await z(this.endpoint,e,!1))}setStep(e){var t;console.log("Selected step",e.detail.tab.id),e.stopPropagation(),e.preventDefault(),this.step=e.detail.tab.id,null===(t=this.stepChanged)||void 0===t||t.emit(e.detail.tab.id)}copyTemplateId(){navigator.clipboard.writeText(this.templateId).then((()=>{_("Template ID copied",{style:"success",duration:3e3})})).catch((e=>{var t;console.warn("[BUILD_TABS] Error copying to clipboard",e),null===(t=this.sdkError)||void 0===t||t.emit(e)}))}render(){var e,t,o,l,a,r,n,d,c,p,h,v,m,u,g,f,x,b,w,y,k;if(!this.endpoint.session)return i(s,null,i("verdocs-component-error",{message:"You must be authenticated to use this module."}));let C=!1,q=!1,E=!1;this.templateId&&this.templateStore&&this.templateStore.state&&(E=(null===(o=null===(t=null===(e=this.templateStore)||void 0===e?void 0:e.state)||void 0===t?void 0:t.documents)||void 0===o?void 0:o.length)>0,q=E&&(null===(r=null===(a=null===(l=this.templateStore)||void 0===l?void 0:l.state)||void 0===a?void 0:a.roles)||void 0===r?void 0:r.length)>0,C=q&&(null===(c=null===(d=null===(n=this.templateStore)||void 0===n?void 0:n.state)||void 0===d?void 0:d.fields)||void 0===c?void 0:c.length)>0);let S=Math.max(O.indexOf(this.step),0);return!C&&S>=4&&(S=3),!q&&S>=3&&(S=1),!E&&S>=1&&(S=0),i(s,null,i("verdocs-tabs",{onSelectTab:e=>this.setStep(e),selectedTab:S,tabs:[{id:"attachments",disabled:!1,label:"Attachment(s)"},{id:"roles",disabled:!E,label:"Roles"},{id:"settings",disabled:!q,label:"Settings"},{id:"fields",disabled:!q,label:"Fields"},{id:"preview",disabled:!C,label:"Preview/Send"}]}),this.templateId&&i("div",{class:"info"},i("verdocs-button-panel",{icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24" fill="#5c6575"><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>'},i("div",{class:"template-details-panel"},i("h6",null,"Template Details"),i("div",{class:"row"},i("label",null,"ID:"),i("div",{class:"value"},this.templateId),i("div",{class:"icon-button",innerHTML:'<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M15.75 17.25v3.375c0 .621-.504 1.125-1.125 1.125h-9.75a1.125 1.125 0 0 1-1.125-1.125V7.875c0-.621.504-1.125 1.125-1.125H6.75a9.06 9.06 0 0 1 1.5.124m7.5 10.376h3.375c.621 0 1.125-.504 1.125-1.125V11.25c0-4.46-3.243-8.161-7.5-8.876a9.06 9.06 0 0 0-1.5-.124H9.375c-.621 0-1.125.504-1.125 1.125v3.5m7.5 10.375H9.375a1.125 1.125 0 0 1-1.125-1.125v-9.25m12 6.625v-1.875a3.375 3.375 0 0 0-3.375-3.375h-1.5a1.125 1.125 0 0 1-1.125-1.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H9.75" /></svg>',onClick:()=>this.copyTemplateId()})),i("div",{class:"row"},i("label",null,"Name:"),i("div",{class:"value"},null===(h=null===(p=this.templateStore)||void 0===p?void 0:p.state)||void 0===h?void 0:h.name)),i("div",{class:"row"},i("label",null,"Visibility:"),i("div",{class:"value"},(null===(m=null===(v=this.templateStore)||void 0===v?void 0:v.state)||void 0===m?void 0:m.is_public)?"Public":(null===(g=null===(u=this.templateStore)||void 0===u?void 0:u.state)||void 0===g?void 0:g.is_personal)?"Private":"Shared")),i("div",{class:"row"},i("label",null,"Created:"),i("div",{class:"value"},(null===(x=null===(f=this.templateStore)||void 0===f?void 0:f.state)||void 0===x?void 0:x.counter)?R.format(new Date(null===(w=null===(b=this.templateStore)||void 0===b?void 0:b.state)||void 0===w?void 0:w.created_at),"P p"):"")),i("div",{class:"row"},i("label",null,"Used:"),i("div",{class:"value"},null===(k=null===(y=this.templateStore)||void 0===y?void 0:y.state)||void 0===k?void 0:k.counter," time(s)"))))))}static get watchers(){return{templateId:["onTemplateIdChanged"],step:["onStepChanged"]}}};Y.style='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-template-build-tabs{-ms-flex:1;flex:1;gap:15px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-build-tabs verdocs-button-panel svg{-webkit-transform:scale(0.8);transform:scale(0.8)}verdocs-template-build-tabs verdocs-template-attachments,verdocs-template-build-tabs verdocs-template-roles{margin:20px}verdocs-template-build-tabs verdocs-template-fields{border-top:1px solid #777777}verdocs-template-build-tabs verdocs-template-attachments{padding:20px;background:#ffffff}verdocs-template-build-tabs verdocs-template-fields{width:100%}verdocs-template-build-tabs verdocs-preview{-ms-flex:1;flex:1}.template-details-panel .row{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;gap:8px;margin:10px 0}.template-details-panel label{-ms-flex:0 0 70px;flex:0 0 70px}.template-details-panel .value{-ms-flex:1;flex:1;font-weight:300;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.template-details-panel .icon-button{cursor:pointer;opacity:0.8;-ms-flex:0;flex:0;width:18px;height:18px}.template-details-panel .icon-button svg{stroke:#000000;width:18px;height:18px}.template-details-panel .icon-button:hover{opacity:1}';const X=class{constructor(i){e(this,i),this.exit=t(this,"exit",7),this.next=t(this,"next",7),this.sdkError=t(this,"sdkError",7),this.templateCreated=t(this,"templateCreated",7),this.endpoint=a.getDefault(),this.file=void 0,this.creating=!1,this.progressLabel="Uploading...",this.progressPercent=0}componentWillLoad(){this.endpoint.setTimeout(3e4),this.endpoint.loadSession()}handleFileChanged(e){var t;this.file=(null===(t=e.target.files)||void 0===t?void 0:t[0])||null,console.log("[CREATE] Selected file",this.file)}handleUpload(e){e.stopPropagation(),document.getElementById("verdocs-template-create-file").click()}handleCancel(e){e.stopPropagation(),this.exit.emit()}async handleSubmit(e){var t,i,s;if(e.stopPropagation(),console.log("Submitting"),this.file){this.creating=!0,this.progressLabel="Uploading...";try{const e=await u(this.endpoint,{name:this.file.name,initial_reminder:0,followup_reminders:0,documents:[this.file]},(e=>{e>=99?(this.progressLabel="Processing...",this.progressPercent=100):this.progressPercent=e}));console.log("[CREATE] Created template",e),z(this.endpoint,e.id,!0).then((()=>{var t,i;null===(t=this.templateCreated)||void 0===t||t.emit({endpoint:this.endpoint,template:e,templateId:e.id}),null===(i=this.next)||void 0===i||i.emit(e),this.creating=!1,this.progressLabel="",this.progressPercent=0})).catch((e=>{console.log(e)}))}catch(e){console.log("[CREATE] Error creating template",e),null===(t=this.sdkError)||void 0===t||t.emit(new M(e.message,null===(i=e.response)||void 0===i?void 0:i.status,null===(s=e.response)||void 0===s?void 0:s.data)),this.creating=!1}}}render(){return i(s,null,this.endpoint.session?i("form",{onSubmit:e=>e.preventDefault(),onClick:e=>e.stopPropagation(),autocomplete:"off"},i("input",{type:"file",id:"verdocs-template-create-file",multiple:!0,accept:".pdf,application/pdf,.doc,.docx,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document",style:{display:"none"},onChange:e=>this.handleFileChanged(e)}),this.creating?i("div",{class:"loader-wrapper"},i("verdocs-loader",null),this.progressLabel&&i("div",{class:"progress-wrapper"},i("verdocs-progress-bar",{showPercent:!0,percent:this.progressPercent,label:this.progressLabel}))):i("div",{class:"upload-box",onDrop:e=>{e.preventDefault(),e.target.classList.remove("drag-over"),this.file=e.dataTransfer.files[0]},onDragOver:e=>{e.preventDefault(),e.dataTransfer.dropEffect="copy"},onDragEnter:e=>e.target.classList.add("drag-over"),onDragLeave:e=>e.target.classList.remove("drag-over")},i("span",{innerHTML:'<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24"><path d="M6 2c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6H6zm7 7V3.5L18.5 9H13z"></path></svg>',style:{display:"flex",justifyContent:"center"}}),i("div",{style:{marginTop:"20px",fontSize:"20px",fontWeight:"bold",overflowWrap:"anywhere"}},this.file?this.file.name:"Drag a file here"),i("div",{style:{marginTop:"20px",marginBottom:"20px",fontSize:"16px",height:"20px"}},this.file?" ":"Or, if you prefer..."),i("verdocs-button",{label:this.file?"Select a different file":"Select a file from your computer",size:"small",onClick:e=>this.handleUpload(e)})),i("div",{class:"buttons"},i("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:e=>this.handleCancel(e),disabled:this.creating}),i("verdocs-button",{label:"Next",size:"small",onClick:e=>this.handleSubmit(e),disabled:!this.file||this.creating}))):i("verdocs-component-error",{message:"You must be authenticated to use this module."}))}};X.style='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-template-create{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-create form{background-color:#ffffff;padding:12px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-template-create form .upload-box{-webkit-box-sizing:border-box;box-sizing:border-box;width:320px;text-align:center;padding:44px 18px 66px;border:2px dashed #979797;color:rgba(0, 0, 0, 0.54)}verdocs-template-create form .upload-box.drag-over{border:2px solid #4c56cb}verdocs-template-create form .upload-box svg{width:64px;fill:#5c6575}verdocs-template-create .loader-wrapper{background-color:#ffffff;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;width:320px;height:320px;text-align:center;border:2px dashed #979797;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-create .progress-wrapper{padding:20px}verdocs-template-create .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-create .buttons .flex-fill{-ms-flex:1;flex:1}verdocs-template-create ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-create ::-moz-placeholder{color:#aaaaaa}verdocs-template-create :-ms-input-placeholder{color:#aaaaaa}verdocs-template-create ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-create ::placeholder{color:#aaaaaa}';const K='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14.707 14.707"><g><rect x="6.275" y="0" fill="#ffffff7f" width="1" height="15"/></g></svg>',G=[{id:"signature",tooltip:"Signature",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z"/></svg>',class:"signature"},{id:"initial",tooltip:"Initials",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M6.225 20.775V7h-5V3.225H15V7h-5v13.775Zm9.775 0v-8h-3V9h9.775v3.775h-3v8Z"/></svg>',class:"initial"},{id:"sep1",tooltip:"",icon:K,class:"separator"},{id:"textbox",tooltip:"Text Box",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M3.425 16.15V13h11.15v3.15Zm0-5.15V7.85h17.15V11Z"/></svg>',class:"textbox"},{id:"checkbox",tooltip:"Check Box",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z"/></svg>',class:"checkbox"},{id:"radio",tooltip:"Radio Button",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M12 17q2.075 0 3.538-1.463Q17 14.075 17 12t-1.462-3.538Q14.075 7 12 7 9.925 7 8.463 8.462 7 9.925 7 12q0 2.075 1.463 3.537Q9.925 17 12 17Zm0 5.85q-2.275 0-4.25-.85t-3.438-2.312Q2.85 18.225 2 16.25q-.85-1.975-.85-4.25T2 7.75q.85-1.975 2.312-3.438Q5.775 2.85 7.75 2q1.975-.85 4.25-.85t4.25.85q1.975.85 3.438 2.312Q21.15 5.775 22 7.75q.85 1.975.85 4.25T22 16.25q-.85 1.975-2.312 3.438Q18.225 21.15 16.25 22q-1.975.85-4.25.85Zm0-3.15q3.25 0 5.475-2.225Q19.7 15.25 19.7 12q0-3.25-2.225-5.475Q15.25 4.3 12 4.3q-3.25 0-5.475 2.225Q4.3 8.75 4.3 12q0 3.25 2.225 5.475Q8.75 19.7 12 19.7Zm0-7.7Z"/></svg>',class:"radio"},{id:"dropdown",tooltip:"Dropdown",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24" stroke-width="1.5" stroke="currentColor"><path stroke="#ffffff" stroke-linecap="round" stroke-linejoin="round" d="M3 4.5h14.25M3 9h9.75M3 13.5h9.75m4.5-4.5v12m0 0l-3.75-3.75M17.25 21L21 17.25" /></svg>',class:"dropdown"},{id:"sep2",tooltip:"",icon:K,class:"separator"},{id:"date",tooltip:"Date",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M7.6 13.925q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375ZM5.3 22.85q-1.325 0-2.238-.912-.912-.913-.912-2.238V6.3q0-1.325.912-2.238.913-.912 2.238-.912H6v-2h2.575v2h6.85v-2H18v2h.7q1.325 0 2.238.912.912.913.912 2.238v13.4q0 1.325-.912 2.238-.913.912-2.238.912Zm0-3.15h13.4V10H5.3v9.7ZM5.3 8h13.4V6.3H5.3Zm0 0V6.3 8Z"/></svg>',class:"date"},{id:"timestamp",tooltip:"Timestamp",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M9 1h6v2H9zm10.03 6.39 1.42-1.42c-.43-.51-.9-.99-1.41-1.41l-1.42 1.42C16.07 4.74 14.12 4 12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9 9-4.03 9-9c0-2.12-.74-4.07-1.97-5.61zM13 14h-2V8h2v6z"></path></svg>',class:"timestamp"},{id:"attachment",tooltip:"Attachment",icon:'<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6"><path stroke-linecap="round" stroke-linejoin="round" d="m18.375 12.739-7.693 7.693a4.5 4.5 0 0 1-6.364-6.364l10.94-10.94A3 3 0 1 1 19.5 7.372L8.552 18.32m.009-.01-.01.01m5.699-9.941-7.81 7.81a1.5 1.5 0 0 0 2.112 2.13" /></svg>',class:"attachment"}],J=class{constructor(i){e(this,i),this.sdkError=t(this,"sdkError",7),this.templateUpdated=t(this,"templateUpdated",7),this.fieldsUpdated=t(this,"fieldsUpdated",7),this.pageHeights={},this.templateStore=null,this.fieldStore=null,this.roleStore=null,this.cachedPageInfo={},this.endpoint=a.getDefault(),this.templateId=null,this.toolbarTargetId=null,this.placing=null,this.showMustSelectRole=!1,this.selectedRoleName="",this.loading=!0}async componentWillLoad(){var e,t,i;try{if(this.endpoint.loadSession(),!this.templateId)return void console.log(`[FIELDS] Missing required template ID ${this.templateId}`);if(!this.endpoint.session)return void console.log("[FIELDS] Unable to start builder session, must be authenticated");z(this.endpoint,this.templateId,!0).then((e=>{var t,i;this.templateStore=e,this.fieldStore=y(this.templateId),this.roleStore=C(this.templateId),this.selectedRoleName=(null===(i=null===(t=this.roleStore.get("roles"))||void 0===t?void 0:t[0])||void 0===i?void 0:i.name)||"",this.loading=!1,this.fieldStore.onChange("fields",(e=>{var t;console.log("[FIELDS] Fields changed",{fields:e}),null===(t=this.fieldsUpdated)||void 0===t||t.emit({event:"updated",endpoint:this.endpoint,templateId:this.templateId,fields:e})}))})).catch((e=>{console.log(e)}))}catch(s){console.log("[FIELDS] Error with fields session",s),null===(e=this.sdkError)||void 0===e||e.emit(new M(s.message,null===(t=s.response)||void 0===t?void 0:t.status,null===(i=s.response)||void 0===i?void 0:i.data))}}componentDidRender(){N.dynamicDrop(!0);const e=this.toolbarTargetId?document.getElementById(this.toolbarTargetId):null,t=document.getElementById("verdocs-template-fields-toolbar");e&&t&&(console.log("[FIELDS] Moving toolbar"),t.remove(),e.append(t))}componentWillUpdate(){var e;const t=this.roleStore.get("roles");this.selectedRoleName&&t.find((e=>e&&e.name===this.selectedRoleName))||(this.selectedRoleName=(null===(e=t[0])||void 0===e?void 0:e.name)||"",console.log("[FIELDS] Selected new role",this.selectedRoleName))}handleKeyDown(e){"Escape"===e.key&&(this.placing=null)}async handleFieldChange(e,t,i){console.log("[FIELDS] handleFieldChange",e,t,i)}attachFieldAttributes(e,t,i){i.addEventListener("input",(e=>this.handleFieldChange(t,e))),i.addEventListener("settingsChanged",(e=>{var t,i;console.log("Settings changed",e.detail),null===(t=this.templateUpdated)||void 0===t||t.emit({endpoint:this.endpoint,template:null===(i=this.templateStore)||void 0===i?void 0:i.state,event:"added-field"})})),i.addEventListener("deleted",(()=>{var e,s;console.log("[FIELDS] Deleted",this,t),i.remove(),null===(e=this.templateUpdated)||void 0===e||e.emit({endpoint:this.endpoint,template:null===(s=this.templateStore)||void 0===s?void 0:s.state,event:"updated-field"})})),i.setAttribute("templateid",this.templateId),i.setAttribute("fieldname",t.name),i.setAttribute("pageNumber",String(e.pageNumber)),i.setAttribute("xScale",String(e.xScale)),i.setAttribute("yScale",String(e.yScale)),i.setAttribute("name",t.name)}handlePageRendered(e){const t=e.detail;this.cachedPageInfo[t.pageNumber]=t,this.pageHeights[t.pageNumber]=t.naturalHeight,this.fieldStore.get("fields").filter((e=>e&&e.page===t.pageNumber)).forEach((e=>{const t=B(e),i=document.getElementById(t);i&&(i.setAttribute("fieldname",e.name),i.setAttribute("pagenumber",String(e.page)),this.makeDraggable(i))}))}makeDraggable(e){N(e).draggable({listeners:{move:this.handleMoveField.bind(this),end:this.handleMoveEnd.bind(this)}})}async handleMoveField(e){const t=+(e.target.getAttribute("posX")||0),i=+(e.target.getAttribute("posY")||0),s=+(e.target.getAttribute("xScale")||1),o=+(e.target.getAttribute("yScale")||1),l=e.dx/s+t,a=e.dy/o+i;e.target.setAttribute("posX",l),e.target.setAttribute("posy",a),U(e.target,"translate",`${l}px, ${a}px`)}async handleMoveEnd(e){var t,i,s,o,l;const a=e.target.getAttribute("fieldname"),r=+(e.target.getAttribute("option")||"0"),n=this.fieldStore.get("fields").find((e=>e.name===a));if(!n)return void console.log("[FIELDS] Unable to find field",a,e.target);const d=e.target.getAttribute("pagenumber"),{naturalWidth:c=612,naturalHeight:p=792,renderedHeight:h=792}=this.cachedPageInfo[d],v=e.target.getBoundingClientRect(),m=e.target.parentElement.getBoundingClientRect(),u=n.width||j(n.type),f=n.height||P(n.type),x=Math.max(v.left-m.left,0),b=Math.max(h-(m.bottom-v.bottom),0),{x:w,y}=this.viewCoordinatesToPageCoordinates(x,b,d,c-u,p-f);try{const s={x:w,y};console.log("[FIELDS] Will update",a,y,r,s);const o=await g(this.endpoint,this.templateId,a,s);console.log("[FIELDS] Updated",o),k(this.fieldStore,a,o),e.target.removeAttribute("posX"),e.target.removeAttribute("posY"),A(e.target),null===(t=this.templateUpdated)||void 0===t||t.emit({endpoint:this.endpoint,template:null===(i=this.templateStore)||void 0===i?void 0:i.state,event:"updated-field"})}catch(t){_("Error updating field, please try again later",{style:"error"}),console.log("[FIELDS] Error updating field",t),null===(s=this.sdkError)||void 0===s||s.emit(new M(t.message,null===(o=t.response)||void 0===o?void 0:o.status,null===(l=t.response)||void 0===l?void 0:l.data)),e.target.removeAttribute("posX"),e.target.removeAttribute("posY"),A(e.target)}}generateFieldName(e,t){let i,s=1;do{i=`${e}P${t}-${s}`,s++}while(this.fieldStore.get("fields").some((e=>e&&e.name===i)));return i}viewCoordinatesToPageCoordinates(e,t,i,s,o){const{xScale:l=1,yScale:a=1,renderedHeight:r=792}=this.cachedPageInfo[i];return{x:Math.floor(Math.min(e/l,s)),y:Math.floor(Math.min(Math.max(r-t,0)/a,o))}}async handleClickPage(e,t){var i,s;if(this.placing){const o=e.offsetX,l=e.offsetY,a=j(this.placing),r=P(this.placing),n=this.cachedPageInfo[t],{naturalWidth:d=612,naturalHeight:c=792}=n,p=this.viewCoordinatesToPageCoordinates(o,l,t,d-a,c-r),h=Math.floor(p.x),v=Math.floor(p.y),m={name:this.generateFieldName(this.placing,t),role_name:this.selectedRoleName,template_id:this.templateId,document_id:n.documentId,type:this.placing,required:"radio"!==this.placing,page:t,validator:null,label:null,default:null,placeholder:null,group:null,settings:{},x:h,y:v,width:a,height:r,multiline:!1,options:"radio"===this.placing?[{value:"option-1",label:"Option 1"}]:[]};console.log("[FIELDS] Will save new field",m);const u=await f(this.endpoint,this.templateId,m);console.log("[FIELDS] Saved field",u),this.fieldStore.set("fields",[...this.fieldStore.get("fields"),u]),this.placing=null,null===(i=this.templateUpdated)||void 0===i||i.emit({endpoint:this.endpoint,template:null===(s=this.templateStore)||void 0===s?void 0:s.state,event:"added-field"})}}render(){var e,t,o;if(!this.endpoint.session)return i(s,null,i("verdocs-component-error",{message:"You must be authenticated to use this module."}));if(this.loading||!(null===(e=this.templateStore)||void 0===e?void 0:e.state.isLoaded))return i(s,null,i("verdocs-loader",null));const l=this.roleStore.get("roles").map((e=>({value:e.name,label:e.full_name?`${e.name}: ${e.full_name}`:e.name})));return i(s,{class:this.placing?{[`placing-${this.placing}`]:!0}:{},onSubmit:()=>{}},i("div",{id:"verdocs-template-fields-toolbar"},i("div",{class:"add-for"},"Add field:"),i("verdocs-select-input",{value:this.selectedRoleName,options:l,onInput:e=>this.selectedRoleName=e.target.value}),G.map((e=>i("verdocs-toolbar-icon",{text:e.tooltip,icon:e.icon,class:e.class,onClick:()=>{e.tooltip&&(this.selectedRoleName?this.placing=e.id:this.showMustSelectRole=!0)}})))),i("div",{class:"pages"},((null===(o=null===(t=this.templateStore)||void 0===t?void 0:t.state)||void 0===o?void 0:o.documents)||[]).map((e=>r(1,e.pages).map((t=>i("verdocs-template-document-page",{templateId:this.templateId,documentId:e.id,pageNumber:t,virtualWidth:612,virtualHeight:792,disabled:!0,editable:!0,done:!1,onClick:e=>this.handleClickPage(e,t),onPageRendered:e=>this.handlePageRendered(e),layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})))))),this.showMustSelectRole&&i("verdocs-ok-dialog",{heading:"Unable to add field",message:this.roleStore.get("roles").length>0?"Please select a role before adding fields.":"Please add at least one role before adding fields.",onNext:()=>this.showMustSelectRole=!1}))}};J.style="@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-template-fields{font-family:\"Inter\", -apple-system, \"Segoe UI\", \"Roboto\", \"Helvetica Neue\", sans-serif;position:relative;display:block;min-height:600px}verdocs-template-fields .page-0{padding:65px 15px 0 15px;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-fields .page-0 .user-placed-fields{height:100px;position:relative;background:#ffffff;-webkit-box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294);box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294)}verdocs-template-fields .page-0 .user-placed-fields .title{top:0;left:0;color:#ffffff;font-size:12px;padding:3px 6px;font-weight:bold;position:absolute;background:#46497d}verdocs-template-fields .pages{display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;min-height:200px;position:relative;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column}verdocs-template-fields .pages div,verdocs-template-fields .pages canvas{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-fields #verdocs-template-fields-toolbar{height:50px;display:-ms-flexbox;display:flex;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;font-weight:700;padding:0 20px 0 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;color:#f5f5fa;-ms-flex-pack:center;justify-content:center;background:#46497d}verdocs-template-fields #verdocs-template-fields-toolbar>verdocs-select-input{margin:0}verdocs-template-fields #verdocs-template-fields-toolbar svg{width:24px;height:24px}verdocs-template-fields #verdocs-template-fields-toolbar .add-for{margin:0;font-weight:500;color:#f5f5fa}verdocs-template-fields #verdocs-template-fields-toolbar verdocs-select-input{margin:0 20px 0 0}@media all and (max-width: 1000px){verdocs-template-fields #verdocs-template-fields-toolbar{-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;padding:0 10px 0 0}verdocs-template-fields #verdocs-template-fields-toolbar svg{-webkit-transform:scale(0.8);transform:scale(0.8)}verdocs-template-fields #verdocs-template-fields-toolbar .add-for,verdocs-template-fields #verdocs-template-fields-toolbar verdocs-select-input{display:none}}@media all and (max-width: 600px){verdocs-template-fields #verdocs-template-fields-toolbar{-webkit-column-gap:6px;-moz-column-gap:6px;column-gap:6px}verdocs-template-fields #verdocs-template-fields-toolbar svg{-webkit-transform:scale(0.6);transform:scale(0.6)}verdocs-template-fields #verdocs-template-fields-toolbar .separator,verdocs-template-fields #verdocs-template-fields-toolbar .add-for,verdocs-template-fields #verdocs-template-fields-toolbar verdocs-select-input{display:none}}verdocs-template-fields.placing-attachment{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-checkbox{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-date{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath fill='%23000000' d='M7.6 13.925q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375ZM5.3 22.85q-1.325 0-2.238-.912-.912-.913-.912-2.238V6.3q0-1.325.912-2.238.913-.912 2.238-.912H6v-2h2.575v2h6.85v-2H18v2h.7q1.325 0 2.238.912.912.913.912 2.238v13.4q0 1.325-.912 2.238-.913.912-2.238.912Zm0-3.15h13.4V10H5.3v9.7ZM5.3 8h13.4V6.3H5.3Zm0 0V6.3 8Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-dropdown{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24' stroke-width='1.5' stroke='currentColor'%3E%3Cpath stroke='%23000000' stroke-linecap='round' stroke-linejoin='round' d='M3 4.5h14.25M3 9h9.75M3 13.5h9.75m4.5-4.5v12m0 0l-3.75-3.75M17.25 21L21 17.25' /%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-initial{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M6.225 20.775V7h-5V3.225H15V7h-5v13.775Zm9.775 0v-8h-3V9h9.775v3.775h-3v8Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-payment{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-radio{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M12 17q2.075 0 3.538-1.463Q17 14.075 17 12t-1.462-3.538Q14.075 7 12 7 9.925 7 8.463 8.462 7 9.925 7 12q0 2.075 1.463 3.537Q9.925 17 12 17Zm0 5.85q-2.275 0-4.25-.85t-3.438-2.312Q2.85 18.225 2 16.25q-.85-1.975-.85-4.25T2 7.75q.85-1.975 2.312-3.438Q5.775 2.85 7.75 2q1.975-.85 4.25-.85t4.25.85q1.975.85 3.438 2.312Q21.15 5.775 22 7.75q.85 1.975.85 4.25T22 16.25q-.85 1.975-2.312 3.438Q18.225 21.15 16.25 22q-1.975.85-4.25.85Zm0-3.15q3.25 0 5.475-2.225Q19.7 15.25 19.7 12q0-3.25-2.225-5.475Q15.25 4.3 12 4.3q-3.25 0-5.475 2.225Q4.3 8.75 4.3 12q0 3.25 2.225 5.475Q8.75 19.7 12 19.7Zm0-7.7Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-signature{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-textarea{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M3.225 20.725v-3.15h11.55v3.15Zm0-4.775V12.8h17.55v3.15Zm0-4.75V8.05h17.55v3.15Zm0-4.775v-3.15h17.55v3.15Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-textbox{cursor:url(\"data:image/svg+xml,%3Csvg width='32' height='15' viewBox='0 0 32 15' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cmask id='path-1-inside-1_1401_24' fill='white'%3E%3Cpath d='M0 0H32V15H0V0Z'/%3E%3C/mask%3E%3Cpath d='M0 0H32V15H0V0Z' fill='%234C56CB' fill-opacity='0.1'/%3E%3Cpath d='M0 0V-1H-1V0H0ZM0 15H-1V16H0V15ZM0 1H32V-1H0V1ZM32 14H0V16H32V14ZM1 15V0H-1V15H1Z' fill='%234C56CB' mask='url(%23path-1-inside-1_1401_24)'/%3E%3Cpath d='M3 11.8V8.65H14.15V11.8H3ZM3 6.65V3.5H20.15V6.65H3Z' fill='%234C56CB'/%3E%3Cline x1='31.5' y1='1' x2='31.5' y2='14' stroke='%234C56CB' stroke-opacity='0.32' stroke-dasharray='1 1'/%3E%3C/svg%3E%0A\") 0 14, pointer}verdocs-template-fields.placing-timestamp{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath fill='%23000000' d='M9 1h6v2H9zm10.03 6.39 1.42-1.42c-.43-.51-.9-.99-1.41-1.41l-1.42 1.42C16.07 4.74 14.12 4 12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9 9-4.03 9-9c0-2.12-.74-4.07-1.97-5.61zM13 14h-2V8h2v6z'%3E%3C/path%3E%3C/svg%3E\") 16 16, pointer}";const ee=class{constructor(i){e(this,i),this.close=t(this,"close",7),this.sdkError=t(this,"sdkError",7),this.templateUpdated=t(this,"templateUpdated",7),this.store=null,this.endpoint=a.getDefault(),this.templateId="",this.name="",this.dirty=!1}async componentWillLoad(){var e,t,i,s,o;try{if(this.endpoint.loadSession(),!this.templateId)return void console.log(`[ROLES] Missing required template ID ${this.templateId}`);if(!this.endpoint.session)return void console.log("[ROLES] Unable to start builder session, must be authenticated");this.store=await z(this.endpoint,this.templateId,!1),this.name=null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t?void 0:t.name,this.dirty=!1}catch(e){console.log("[TEMPLATE NAME] Error loading template",e),null===(i=this.sdkError)||void 0===i||i.emit(new M(e.message,null===(s=e.response)||void 0===s?void 0:s.status,null===(o=e.response)||void 0===o?void 0:o.data))}}handleCancel(e){var t,i,s;e.stopPropagation(),this.name=null===(i=null===(t=this.store)||void 0===t?void 0:t.state)||void 0===i?void 0:i.name,this.dirty=!1,console.log("Closing"),null===(s=this.close)||void 0===s||s.emit()}async handleSave(e){var t,i,s;e.stopPropagation(),await x(this.endpoint,this.templateId,{name:this.name}),(null===(t=this.store)||void 0===t?void 0:t.state)&&(this.store.state.name=this.name),this.dirty=!1,null===(i=this.templateUpdated)||void 0===i||i.emit({endpoint:this.endpoint,template:this.store.state,event:"name"}),null===(s=this.close)||void 0===s||s.emit()}render(){var e,t;return this.endpoint.session?(null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t?void 0:t.isLoading)?i(s,{class:"loading"},i("verdocs-loader",null)):i(s,null,i("form",{onSubmit:e=>e.preventDefault(),onClick:e=>e.stopPropagation(),autocomplete:"off"},i("label",{htmlFor:"verdocs-template-name"},"Template Name"),i("verdocs-text-input",{id:"verdocs-template-name",value:this.name,autocomplete:"off",placeholder:"Template Name...",onInput:e=>{var t,i;this.name=e.target.value,this.dirty=this.name!==(null===(i=null===(t=this.store)||void 0===t?void 0:t.state)||void 0===i?void 0:i.name)}}),i("div",{class:"buttons"},i("verdocs-button",{size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:e=>this.handleCancel(e)}),i("verdocs-button",{size:"small",label:"Save",disabled:!this.dirty,onClick:e=>this.handleSave(e)})))):i(s,null,i("verdocs-component-error",{message:"You must be authenticated to use this module."}))}};ee.style="";const te={everyone:"Everyone",everyone_as_creator:"Everyone as Me",organization_member:"Organization member",organization_member_as_creator:"Organization Member as Me",creator:"Me"},ie='<svg xmlns="http://www.w3.org/2000/svg" height="20" width="20" fill="#00000089"><path d="m8.021 17.917-.313-2.5q-.27-.125-.625-.334-.354-.208-.625-.395l-2.312.979-1.979-3.438 1.979-1.5q-.021-.167-.031-.364-.011-.198-.011-.365 0-.146.011-.344.01-.198.031-.385l-1.979-1.5 1.979-3.417 2.312.958q.271-.187.615-.385t.635-.344l.313-2.5h3.958l.313 2.5q.312.167.625.344.312.177.604.385l2.333-.958 1.979 3.417-1.979 1.521q.021.187.021.364V10q0 .146-.01.333-.011.188-.011.396l1.958 1.5-1.979 3.438-2.312-.979q-.292.208-.615.395-.323.188-.614.334l-.313 2.5Zm1.937-5.355q1.063 0 1.813-.75t.75-1.812q0-1.062-.75-1.812t-1.813-.75q-1.041 0-1.802.75-.76.75-.76 1.812t.76 1.812q.761.75 1.802.75Zm0-1.333q-.5 0-.864-.364-.365-.365-.365-.865t.365-.865q.364-.364.864-.364t.865.364q.365.365.365.865t-.365.865q-.365.364-.865.364ZM10.021 10Zm-.854 6.583h1.666l.25-2.187q.605-.167 1.136-.49.531-.323 1.031-.802l2.021.875.854-1.375-1.792-1.354q.105-.333.136-.635.031-.303.031-.615 0-.292-.031-.573-.031-.281-.115-.635l1.792-1.396-.834-1.375-2.062.875q-.438-.438-1.021-.781-.583-.344-1.125-.49l-.271-2.208H9.167l-.271 2.208q-.584.146-1.125.458-.542.313-1.042.792l-2.021-.854-.833 1.375 1.75 1.354q-.083.333-.125.646-.042.312-.042.604t.042.594q.042.302.125.635l-1.75 1.375.833 1.375 2.021-.854q.479.458 1.021.771.542.312 1.146.479Z"/></svg>',se='<svg xmlns="http://www.w3.org/2000/svg" fill="#ffffff" viewBox="0 0 24 24" strokeWidth={1.5} stroke="currentColor"><path strokeLinecap="round" strokeLinejoin="round" d="M12 9v6m3-3H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z" /></svg>',oe='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path d="m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z"/></svg>',le='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><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>',ae='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M1.5 8.67v8.58a3 3 0 003 3h15a3 3 0 003-3V8.67l-8.928 5.493a3 3 0 01-3.144 0L1.5 8.67z" /><path d="M22.5 6.908V6.75a3 3 0 00-3-3h-15a3 3 0 00-3 3v.158l9.714 5.978a1.5 1.5 0 001.572 0L22.5 6.908z" /></svg>',re=class{constructor(i){e(this,i),this.next=t(this,"next",7),this.exit=t(this,"exit",7),this.sdkError=t(this,"sdkError",7),this.rolesUpdated=t(this,"rolesUpdated",7),this.templateStore=null,this.roleStore=null,this.endpoint=a.getDefault(),this.templateId="",this.showingRoleDialog=null,this.showingSenderDialog=!1,this.sender=null,this.loading=!0}async componentWillLoad(){var e,t,i;try{if(this.endpoint.loadSession(),!this.templateId)return void console.log(`[ROLES] Missing required template ID ${this.templateId}`);if(!this.endpoint.session)return void console.log("[ROLES] Unable to start builder session, must be authenticated");await z(this.endpoint,this.templateId,!1).then((e=>{this.templateStore=e,this.roleStore=C(this.templateId),this.loading=!1,this.roleStore.onChange("roles",(e=>{var t;console.log("[ROLES] Roles changed",{roles:e}),null===(t=this.rolesUpdated)||void 0===t||t.emit({event:"updated",endpoint:this.endpoint,templateId:this.templateId,roles:e})}))})).catch((e=>console.warn(e)))}catch(s){console.log("[FIELDS] Error with preview session",s),null===(e=this.sdkError)||void 0===e||e.emit(new M(s.message,null===(t=s.response)||void 0===t?void 0:t.status,null===(i=s.response)||void 0===i?void 0:i.data))}}componentDidRender(){N.dynamicDrop(!0),N(".recipient").draggable({listeners:{start:function(e){e.target.classList.add("dragging"),this.el.classList.add("dragging")}.bind(this),move:function(e){const t=+(e.target.getAttribute("dX")||0),i=+(e.target.getAttribute("dY")||0),s=+(e.target.dataset.sequence||0),o=+(e.target.dataset.order||0),l=e.dx+t,a=e.dy+i;e.target.setAttribute("dX",l),e.target.setAttribute("dY",a);const r=e.target.getBoundingClientRect();console.log("w",r.width),e.target.style.transform=`translate(${l+r.width-(o+1)}px, ${a-r.height*s}px)`}.bind(this),end:function(e){e.target.classList.remove("dragging"),this.el.classList.remove("dragging"),e.target.removeAttribute("dX"),e.target.removeAttribute("dY"),e.target.style.transform=null}.bind(this)}}),N(".dropzone").dropzone({overlap:.05,ondrop:async function(e){var t;console.log("dropped",e.target.classList),e.target.classList.remove("active"),S(this.roleStore,e.relatedTarget.dataset.rolename,{sequence:+e.target.dataset.sequence,order:+e.target.dataset.order}),await this.renumberTemplateRoles(),console.log("[ROLES] Updated roles",this.getSortedRoles()),null===(t=this.rolesUpdated)||void 0===t||t.emit({event:"updated",endpoint:this.endpoint,templateId:this.templateId,roles:this.getSortedRoles()})}.bind(this),ondropactivate:e=>{e.target.classList.add("visible")},ondropdeactivate:e=>{e.target.classList.remove("visible")},ondragenter:e=>{e.target.classList.add("active")},ondragleave:e=>{e.target.classList.remove("active")}})}handleCancel(){var e;null===(e=this.exit)||void 0===e||e.emit()}handleSubmit(){var e;null===(e=this.next)||void 0===e||e.emit()}getSortedRoles(){return this.roleStore.state.roles.sort(((e,t)=>e.sequence===t.sequence?e.order-t.order:e.sequence-t.sequence))}getSequenceNumbers(){const e=[];return this.getSortedRoles().forEach((t=>{e.includes(t.sequence)||e.push(t.sequence)})),e.sort(((e,t)=>e-t))}getRoleNames(){return this.getSortedRoles().map((e=>e.name))}getRolesAtSequence(e){return this.roleStore.state.roles.filter((t=>t&&t.sequence===e))}renumberTemplateRoles(){const e=[],t=[];return this.getSequenceNumbers().forEach(((i,s)=>{this.getRolesAtSequence(i).forEach(((i,o)=>{e.includes(i.name)||i.sequence===s+1&&i.order===o+1||(i.sequence=s+1,i.order=o+1,e.push(i.name),t.push(b(this.endpoint,this.templateId,i.name,{sequence:i.sequence,order:i.order})))}))})),Promise.all(t)}getNextRoleName(){let e="",t=Object.keys(this.roleStore.state).length-1;do{t++,e=`Recipient ${t}`}while(!e||this.roleStore.state.roles.some((t=>t&&t.name===e)));return e}callCreateRole(e,t,i){console.log("[ROLES] Will create role",{name:e,sequence:t,order:i}),w(this.endpoint,this.templateId,{template_id:this.templateId,name:e,sequence:t,message:"",order:i,full_name:null,first_name:"",last_name:"",email:"",phone:"",type:"signer",delegator:!1,kba_method:null}).then((async e=>{var t;console.log("[ROLES] Created role",e),this.roleStore.set("roles",[...this.roleStore.state.roles,e]),await this.renumberTemplateRoles(),null===(t=this.rolesUpdated)||void 0===t||t.emit({event:"added",endpoint:this.endpoint,templateId:this.templateId,roles:this.getSortedRoles()})})).catch((e=>{console.log("[ROLES] Error creating role",e)}))}handleAddRole(e,t){e.stopPropagation();const i=this.getRolesAtSequence(t).length+1,s=this.getNextRoleName();this.callCreateRole(s,t,i)}handleAddStep(e,t){e.stopPropagation();const i=this.getNextRoleName();this.callCreateRole(i,t,1)}render(){var e,t,l,a;if(!this.endpoint.session)return i(s,null,i("verdocs-component-error",{message:"You must be authenticated to use this module."}));if(this.loading||!(null===(e=this.templateStore)||void 0===e?void 0:e.state.isLoaded))return console.log("Loading",this.loading,null===(t=this.templateStore)||void 0===t?void 0:t.state.isLoaded),i(s,{class:"loading"},i("verdocs-loader",null));console.log("Rendering roles",this.roleStore.get("roles"));const r=this.getRoleNames(),n=this.getSequenceNumbers();return console.log("Rendering",r,n),i(s,null,i("form",{onSubmit:e=>e.preventDefault(),onClick:e=>e.stopPropagation(),autocomplete:"off"},i("h5",null,"Roles and Workflow"),i("div",{class:"participants"},i("div",{class:"left-line"}),i("div",{class:"row"},i("div",{class:"icon",innerHTML:'<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" fill="#00000089"><path d="M2 12C2 6.48 6.48 2 12 2s10 4.48 10 10-4.48 10-10 10S2 17.52 2 12zm10 6c3.31 0 6-2.69 6-6s-2.69-6-6-6-6 2.69-6 6 2.69 6 6 6z"></path></svg>'}),i("div",{class:"row-roles"},i("div",{class:"sender"},i("span",{class:"label"},"Sender:")," ",te[null===(a=null===(l=this.templateStore)||void 0===l?void 0:l.state)||void 0===a?void 0:a.sender]," ",i("div",{class:"settings-button",innerHTML:ie,onClick:()=>this.showingSenderDialog=!0,"aria-role":"button"})))),i("div",{class:"row add-sequence","data-sequence":0},i("div",{class:"icon",innerHTML:se}),i("div",{class:"row-roles"},i("div",{class:"dropzone","data-sequence":0,"data-order":1},"Add Step"))),n.map((e=>i(o,null,i("div",{class:"row"},i("div",{class:"icon",innerHTML:'<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" fill="#00000089"><path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"></path></svg>'}),i("div",{class:"row-roles"},i("div",{class:"dropzone","data-order":.5,"data-sequence":e}),this.getRolesAtSequence(e).map((t=>{const s=!t.email;return console.log("ras",e,t),i(o,null,s?i("div",{class:"recipient",style:{backgroundColor:h(E(this.roleStore,t.name))},"data-rolename":t.name,"data-sequence":e,"data-order":t.order},i("span",{class:"type-icon",innerHTML:"signer"===t.type?oe:"cc"===t.type?ae:le}),t.name," ",i("div",{class:"settings-button",innerHTML:ie,onClick:()=>this.showingRoleDialog=t.name,"aria-role":"button"})):i("div",{class:"recipient",style:{borderColor:h(E(this.roleStore,t.name))},"data-rolename":t.name,"data-sequence":e,"data-order":t.order},i("span",{class:"type-icon",innerHTML:"signer"===t.type?oe:"cc"===t.type?ae:le}),t.first_name," ",i("div",{class:"settings-button",innerHTML:ie,onClick:()=>this.showingRoleDialog=t.name,"aria-role":"button"})),i("div",{class:"dropzone","data-order":t.order+.5,"data-sequence":e}))})),i("button",{class:"add-role",innerHTML:se,onClick:t=>this.handleAddRole(t,e)}))),n.length>0&&i("div",{class:"row add-sequence","data-sequence":e},i("div",{class:"row-roles"},i("div",{class:"icon",innerHTML:se}),i("div",{class:"dropzone","data-sequence":e+1,"data-order":1},"Add Step")))))),i("div",{class:"row","data-sequence":n.length+1},i("div",{class:"row-roles"},i("div",{class:"icon",innerHTML:se}),i("button",{class:"add-step",innerHTML:se,onClick:e=>this.handleAddStep(e,n.length+1)}))),i("div",{class:"row"},i("div",{class:"icon",innerHTML:'<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" fill="#00000089"><path d="m18 7-1.41-1.41-6.34 6.34 1.41 1.41L18 7zm4.24-1.41L11.66 16.17 7.48 12l-1.41 1.41L11.66 19l12-12-1.42-1.41zM.41 13.41 6 19l1.41-1.41L1.83 12 .41 13.41z"></path></svg>'}),i("div",{class:"row-roles"},i("div",{class:"complete"},"Document Complete")))),r.length<1&&i("div",{class:"empty"},"You must add at least one Role before proceeding.",i("br",null)," Click the ",i("span",{innerHTML:se})," Add button above to get started."),i("div",{class:"buttons"},i("div",{class:"flex-fill"}),i("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:()=>this.handleCancel()}),i("verdocs-button",{label:"OK",size:"small",onClick:()=>this.handleSubmit(),disabled:r.length<1}))),this.showingRoleDialog&&i("verdocs-template-role-properties",{endpoint:this.endpoint,templateId:this.templateId,roleName:this.showingRoleDialog,onClose:()=>{this.showingRoleDialog=null},onDelete:async()=>{var e;this.showingRoleDialog=null,await this.renumberTemplateRoles(),null===(e=this.rolesUpdated)||void 0===e||e.emit({event:"deleted",endpoint:this.endpoint,templateId:this.templateId,roles:this.getSortedRoles()})}}),this.showingSenderDialog&&i("verdocs-template-sender",{endpoint:this.endpoint,templateId:this.templateId,onClose:()=>this.showingSenderDialog=!1}))}get el(){return l(this)}};re.style='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-template-roles{display:block;min-width:400px;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-roles>form{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;background-color:#ffffff;padding:12px}verdocs-template-roles>form h5{font-size:16px;font-weight:bold;color:#46497d;margin:0 0 10px 0}verdocs-template-roles>form .participants{position:relative}verdocs-template-roles>form .left-line{top:32px;left:11px;z-index:1;width:12px;bottom:30px;position:absolute;background:#ffffff;border-left:3px dotted #9b9b9b}verdocs-template-roles>form .row{display:-ms-flexbox;display:flex;-webkit-column-gap:0;-moz-column-gap:0;column-gap:0;min-height:35px;margin-top:0;margin-left:40px;position:relative;-ms-flex-direction:row;flex-direction:row;padding:6px 0 4px 0}verdocs-template-roles>form .row .row-roles{-ms-flex:1;flex:1;gap:10px;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-direction:row;flex-direction:row}verdocs-template-roles>form .row .icon{top:14px;z-index:2;left:-40px;width:24px;height:24px;position:absolute;background:#ffffff}verdocs-template-roles>form .row .sender{height:30px;display:-ms-flexbox;display:flex;font-size:14px;line-height:30px;-ms-flex-align:center;align-items:center;border-radius:30px;-ms-flex-direction:row;flex-direction:row;padding:0 5px 0 15px;border:1px solid #c6c9cc;background-color:#f5f5fa}verdocs-template-roles>form .row .complete{height:30px;display:-ms-flexbox;display:flex;font-size:14px;padding:0 15px;line-height:30px;-ms-flex-direction:row;flex-direction:row;border-radius:30px;background-color:#f5f5fa;border:1px solid #aeb4bf}verdocs-template-roles>form .row .label{font-weight:bold;margin-right:6px;color:#33364b}verdocs-template-roles>form .row .settings-button{display:-ms-flexbox;display:flex;cursor:pointer;margin:0 0 0 9px}verdocs-template-roles>form .row .recipient{height:30px;display:-ms-flexbox;display:flex;font-size:14px;border-radius:30px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;padding:0 5px 0 6px;white-space:nowrap;border:2px solid #aeb4bf}verdocs-template-roles>form .row .recipient .type-icon{width:24px;height:24px;-webkit-transform:scale(0.8);transform:scale(0.8);opacity:0.6;margin:0 12px 0 0}verdocs-template-roles>form .row .recipient.dragging{position:absolute}verdocs-template-roles>form .row .recipient.dragging+.dropzone{display:none !important}verdocs-template-roles>form .row .dropzone{width:14px;height:30px;display:none}verdocs-template-roles>form .row .dropzone svg{fill:#cccccc}verdocs-template-roles>form .row .dropzone.visible{margin:0 7px;display:-ms-flexbox;display:flex;-ms-flex:0 0 14px;flex:0 0 14px}verdocs-template-roles>form .row .dropzone.active{-ms-flex:0 0 120px;flex:0 0 120px;border-radius:30px;background:rgba(101, 77, 203, 0.4980392157);border:1px dashed #654dcb}verdocs-template-roles>form label{display:block;font-size:14px;font-weight:500;margin:0 0 4px 0;color:#5c6575}verdocs-template-roles>form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-template-roles>form input:focus{outline:none}verdocs-template-roles .row.add-sequence{display:none}verdocs-template-roles .add-role{margin:0;padding:0;border:none;opacity:0.5;cursor:pointer;background:none}verdocs-template-roles .add-role:hover{opacity:1}verdocs-template-roles .add-role svg{width:32px;height:32px}verdocs-template-roles .add-step{margin:0;padding:0;border:none;opacity:0.5;cursor:pointer;background:none}verdocs-template-roles .add-step:hover{opacity:1}verdocs-template-roles .add-step svg{width:32px;height:32px}verdocs-template-roles.dragging .add-role{display:none}verdocs-template-roles.dragging form .row .recipient+.dropzone{display:-ms-flexbox;display:flex}verdocs-template-roles.dragging .row.add-sequence{display:-ms-flexbox;display:flex}verdocs-template-roles.dragging .row.add-sequence .dropzone{opacity:0.5;-ms-flex:0 0 120px;flex:0 0 120px;border-radius:30px;-ms-flex-align:center;align-items:center;background:rgba(101, 77, 203, 0.4980392157);-ms-flex-pack:center;justify-content:center;border:1px dashed #654dcb}verdocs-template-roles.dragging .row.add-sequence .dropzone.active{opacity:1}verdocs-template-roles .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-template-roles .empty{font-size:13px;margin-top:15px;margin-bottom:5px}verdocs-template-roles .empty svg{width:16px;height:16px;stroke:#666666;margin-bottom:2px;display:inline-block}verdocs-template-roles ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-roles ::-moz-placeholder{color:#aaaaaa}verdocs-template-roles :-ms-input-placeholder{color:#aaaaaa}verdocs-template-roles ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-roles ::placeholder{color:#aaaaaa}';const ne=class{constructor(i){e(this,i),this.close=t(this,"close",7),this.sdkError=t(this,"sdkError",7),this.templateUpdated=t(this,"templateUpdated",7),this.store=null,this.endpoint=a.getDefault(),this.templateId="",this.dirty=!1,this.personal=!1,this.public=!1}async componentWillLoad(){var e,t,i,s,o,l,a;try{if(this.endpoint.loadSession(),!this.templateId)return void console.log(`[VISIBILITY] Missing required template ID ${this.templateId}`);if(!this.endpoint.session)return void console.log("[VISIBILITY] Unable to start builder session, must be authenticated");this.store=await z(this.endpoint,this.templateId,!1),this.personal=(null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t?void 0:t.is_personal)||!0,this.public=(null===(s=null===(i=this.store)||void 0===i?void 0:i.state)||void 0===s?void 0:s.is_public)||!1,this.dirty=!1}catch(e){console.log("[TEMPLATE VISIBILITY] Error loading template",e),null===(o=this.sdkError)||void 0===o||o.emit(new M(e.message,null===(l=e.response)||void 0===l?void 0:l.status,null===(a=e.response)||void 0===a?void 0:a.data))}}handleCancel(e){var t,i,s,o,l;e.stopPropagation(),this.personal=null===(i=null===(t=this.store)||void 0===t?void 0:t.state)||void 0===i?void 0:i.is_personal,this.public=null===(o=null===(s=this.store)||void 0===s?void 0:s.state)||void 0===o?void 0:o.is_public,this.dirty=!1,null===(l=this.close)||void 0===l||l.emit()}async handleSave(e){var t,i,s;e.stopPropagation(),await x(this.endpoint,this.templateId,{is_personal:this.personal,is_public:this.public}),(null===(t=this.store)||void 0===t?void 0:t.state)&&(this.store.state.is_personal=this.personal,this.store.state.is_public=this.public),this.dirty=!1,null===(i=this.templateUpdated)||void 0===i||i.emit({endpoint:this.endpoint,template:this.store.state,event:"visibility"}),null===(s=this.close)||void 0===s||s.emit()}render(){var e,t;return this.endpoint.session?this.endpoint.session&&(null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t?void 0:t.isLoaded)?i(s,null,i("form",{onSubmit:e=>e.preventDefault(),onClick:e=>e.stopPropagation(),autocomplete:"off"},i("h5",null,"Visibility"),i("div",{class:"input-row"},i("label",{htmlFor:"verdocs-is-shared"},"Shared"),i("verdocs-checkbox",{id:"verdocs-is-shared",name:"is-shared",checked:!this.personal,value:"on",onInput:e=>{this.personal=!e.target.checked,this.dirty=!0}})),i("div",{class:"description"},"Shared templates are visible to other members of your Organization (if any)."),i("div",{class:"input-row"},i("label",{htmlFor:"verdocs-is-public"},"Public"),i("verdocs-checkbox",{id:"verdocs-is-public",name:"is-public",checked:this.public,value:"on",onInput:e=>{this.public=e.target.checked,this.dirty=!0}})),i("div",{class:"description"},"Public templates may appear in results when any other user searches for templates. Note that a template may be both Personal and Public, which may be useful if you want your template to be found via search but not otherwise displayed to other members of your Organization (if any)."),i("div",{class:"buttons"},i("verdocs-button",{size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:e=>this.handleCancel(e)}),i("verdocs-button",{size:"small",label:"Save",disabled:!this.dirty,onClick:e=>this.handleSave(e)})))):i(s,{class:"empty"}):i(s,null,i("verdocs-component-error",{message:"You must be authenticated to use this module."}))}};ne.style='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-template-visibility{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-visibility.loading{min-height:300px;position:relative;display:block}verdocs-template-visibility.empty{display:none}verdocs-template-visibility form{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-template-visibility form .description{font-size:14px;text-align:justify;color:#5c6575}verdocs-template-visibility form h5{font-size:16px;font-weight:bold;color:#4c56cb;margin:0}verdocs-template-visibility form label{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;font-size:16px;font-weight:500;margin:0 0 4px 0;color:#33364b}verdocs-template-visibility form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-template-visibility form input:focus{outline:none}verdocs-template-visibility form .input-row{display:-ms-flexbox;display:flex;margin:20px 0 0 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-template-visibility form .input-row verdocs-text-input{margin:0;display:-ms-flexbox;display:flex;-ms-flex:0 0 40px;flex:0 0 40px}verdocs-template-visibility form .input-row verdocs-text-input input{text-align:center}verdocs-template-visibility form .input-row verdocs-checkbox{-ms-flex:0;flex:0;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}verdocs-template-visibility form .input-row verdocs-checkbox label>input[type=checkbox]+*::before{margin-right:0}verdocs-template-visibility .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:25px;-ms-flex-direction:row;flex-direction:row}verdocs-template-visibility ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-visibility ::-moz-placeholder{color:#aaaaaa}verdocs-template-visibility :-ms-input-placeholder{color:#aaaaaa}verdocs-template-visibility ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-visibility ::placeholder{color:#aaaaaa}';export{F as verdocs_preview,W as verdocs_send,$ as verdocs_template_attachments,Y as verdocs_template_build_tabs,X as verdocs_template_create,J as verdocs_template_fields,ee as verdocs_template_name,re as verdocs_template_roles,ne as verdocs_template_visibility}
1
+ import{r as e,c as t,h as i,H as s,F as o,g as l}from"./p-5207d80c.js";import{VerdocsEndpoint as a,integerSequence as r,getOrganizationContacts as n,createEnvelope as d,isValidEmail as c,isValidPhone as p,getRGBA as h,createTemplateDocument as v,deleteTemplateDocument as m,createTemplate as u,updateField as g,createField as f,updateTemplate as x,updateTemplateRole as b,createTemplateRole as w}from"@verdocs/js-sdk";import{g as y,u as k}from"./p-ff64786a.js";import{g as C,b as q,a as E,u as S}from"./p-9e371467.js";import{g as z}from"./p-4372c294.js";import{S as M}from"./p-fd97809c.js";import{D as L,P as I,J as T,a as H,F as Z,b as D,T as V}from"./p-b0766439.js";import{V as _}from"./p-04c07b7b.js";import{d as R}from"./p-edaec1b6.js";import{i as N}from"./p-a901dff2.js";import{b as U,c as A,g as B,d as j,e as P}from"./p-1289c3d5.js";import"./p-83317d11.js";import"./p-a706bac9.js";import"./p-85aa8e05.js";import"./p-251c4106.js";const F=class{constructor(i){e(this,i),this.sdkError=t(this,"sdkError",7),this.templateStore=null,this.fieldStore=null,this.roleStore=null,this.endpoint=a.getDefault(),this.templateId=null,this.loading=!0}onTemplateIdChanged(e){console.log("[PREVIEW] Template ID changed",e),this.loadTemplate(e).catch((e=>console.log("Unknown Error",e)))}async componentWillLoad(){var e,t,i;try{return this.endpoint.loadSession(),this.endpoint.session?this.templateId?this.loadTemplate(this.templateId):void console.log(`[PREVIEW] Missing required template ID ${this.templateId}`):void console.log("[PREVIEW] Unable to start builder session, must be authenticated")}catch(s){console.log("[PREVIEW] Error with preview session",s),null===(e=this.sdkError)||void 0===e||e.emit(new M(s.message,null===(t=s.response)||void 0===t?void 0:t.status,null===(i=s.response)||void 0===i?void 0:i.data))}}async loadTemplate(e){e&&z(this.endpoint,e,!1).then((e=>{this.templateStore=e,this.fieldStore=y(this.templateId),this.roleStore=C(this.templateId),this.loading=!1})).catch((e=>{throw console.log("Unable to load template",e),e}))}handlePageRendered(e){}render(){var e,t;return i(s,null,this.loading?i("verdocs-loader",null):((null===(t=null===(e=this.templateStore)||void 0===e?void 0:e.state)||void 0===t?void 0:t.documents)||[]).map((e=>{const t=r(1,e.pages);return i(o,null,t.map((t=>i("verdocs-template-document-page",{templateId:e.template_id,documentId:e.id,pageNumber:t,disabled:!0,editable:!1,done:!1,virtualWidth:612,virtualHeight:792,onPageRendered:e=>this.handlePageRendered(e),layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]}))))})))}static get watchers(){return{templateId:["onTemplateIdChanged"]}}};F.style='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-preview{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;min-height:200px;position:relative;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column}verdocs-preview div,verdocs-preview canvas{-webkit-box-sizing:border-box;box-sizing:border-box}';const Q='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" tabindex="-1"><path d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"></path></svg>',W=class{constructor(i){e(this,i),this.sendingEnvelope=t(this,"sendingEnvelope",7),this.send=t(this,"send",7),this.exit=t(this,"exit",7),this.sdkError=t(this,"sdkError",7),this.searchContacts=t(this,"searchContacts",7),this.endpoint=a.getDefault(),this.templateId=null,this.environment="",this.containerId=`verdocs-send-${Math.random().toString(36).substring(2,11)}`,this.showPickerForId="",this.sessionContacts=[],this.sending=!1,this.rolesCompleted={},this.templateStore=null,this.roleStore=null}async reset(){this.rolesCompleted={}}onTemplateIdChanged(e){console.log("[SEND] Template ID changed",e),this.loadTemplate(e).catch((e=>console.log("Unknown Error",e)))}async componentWillLoad(){var e,t,i;try{return this.endpoint.onSessionChanged(((e,t,i)=>{if(!i)return;const s={id:i.id,first_name:i.first_name,last_name:i.last_name,email:i.email,phone:i.phone};i&&(this.sessionContacts=[s],n(this.endpoint).then((e=>{console.log("[SEND] Got contacts",e),this.sessionContacts=[...e,s]})).catch((e=>{console.log("[SEND] Error getting contacts",e)})))})),this.endpoint.loadSession(),this.endpoint.session?this.templateId?this.loadTemplate(this.templateId):void console.log(`[SEND] Missing required template ID ${this.templateId}`):void console.log("[SEND] Unable to start Send operation, must be authenticated")}catch(s){console.log("[SEND] Error with send session",s),null===(e=this.sdkError)||void 0===e||e.emit(new M(s.message,null===(t=s.response)||void 0===t?void 0:t.status,null===(i=s.response)||void 0===i?void 0:i.data))}}async loadTemplate(e){var t,i,s,o,l;if(e)try{this.templateStore=await z(this.endpoint,e,!1),this.roleStore=C(e),this.recomputeRolesCompleted(),(null===(i=null===(t=this.templateStore)||void 0===t?void 0:t.state)||void 0===i?void 0:i.is_sendable)||console.warn("[SEND] Template is not sendable",e)}catch(e){console.log("[SEND] Error with preview session",e),null===(s=this.sdkError)||void 0===s||s.emit(new M(e.message,null===(o=e.response)||void 0===o?void 0:o.status,null===(l=e.response)||void 0===l?void 0:l.data))}}recomputeRolesCompleted(){var e;const t=(null===(e=this.roleStore)||void 0===e?void 0:e.get("roles"))||[],i={};this.rolesCompleted={},t.forEach((e=>{const t=e.sequence-1;i[t]||(i[t]=[]);const s=`r-${t}-${i[t].length}`;i[t].push({...e,id:s,role_name:e.name,first_name:e.first_name,last_name:e.last_name}),e.first_name&&(e.email||e.phone)&&(this.rolesCompleted[s]={...e,id:s,role_name:e.name,first_name:e.first_name,last_name:e.last_name})}))}getLevels(){var e;const t=(null===(e=this.roleStore)||void 0===e?void 0:e.get("roles"))||[],i=[...new Set(t.map((e=>e.sequence-1)))];return i.sort(((e,t)=>e-t)),i}getRolesAtLevel(e){var t;return((null===(t=this.roleStore)||void 0===t?void 0:t.get("roles"))||[]).filter((t=>t.sequence-1===e)).map(((t,i)=>({...t,id:`r-${e}-${i}`,role_name:t.name,first_name:"",last_name:""})))}getLevelIcon(e){const t=this.getLevels();return i("div",e<0?{class:"level-icon",innerHTML:'<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" tabindex="-1"><path d="M2 12C2 6.48 6.48 2 12 2s10 4.48 10 10-4.48 10-10 10S2 17.52 2 12zm10 6c3.31 0 6-2.69 6-6s-2.69-6-6-6-6 2.69-6 6 2.69 6 6 6z"></path></svg>'}:e>=t.length?{class:"level-icon",innerHTML:'<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" tabindex="-1"><path d="m18 7-1.41-1.41-6.34 6.34 1.41 1.41L18 7zm4.24-1.41L11.66 16.17 7.48 12l-1.41 1.41L11.66 19l12-12-1.42-1.41zM.41 13.41 6 19l1.41-1.41L1.83 12 .41 13.41z"></path></svg>'}:{class:"level-icon",innerHTML:'<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" tabindex="-1"><path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"></path></svg>'})}handleSelectContact(e,t){e.preventDefault(),this.rolesCompleted[t.id]={...t,...e.detail},this.showPickerForId=""}handleClickRole(e,t){e.stopPropagation(),this.showPickerForId=t.id}handleSend(e){var t,i,s;if(this.sending)return void console.log("[SEND] Skipping duplicate send",e);console.log("[SEND] Sending",e),e.preventDefault(),e.stopPropagation(),this.sending=!0,null===(t=this.sendingEnvelope)||void 0===t||t.emit({sending:!0});const o={template_id:this.templateId,name:null===(s=null===(i=this.templateStore)||void 0===i?void 0:i.state)||void 0===s?void 0:s.name,environment:this.environment,initial_reminder:0,followup_reminders:0,recipients:Object.values(this.rolesCompleted),fields:[]};console.log("[SEND] Creating envelope",o),d(this.endpoint,o).then((e=>{var t,i;console.log("[SEND] Send envelope",e),this.reset().catch((e=>console.log("Unknown Error",e))),this.sending=!1,null===(t=this.sendingEnvelope)||void 0===t||t.emit({sending:!1}),null===(i=this.send)||void 0===i||i.emit({...o,envelope_id:e.id,envelope:e})})).catch((e=>{var t;console.log("Send error",e),this.sending=!1,null===(t=this.sendingEnvelope)||void 0===t||t.emit({sending:!1})}))}handleCancel(e){var t;e.stopPropagation(),null===(t=this.exit)||void 0===t||t.emit()}render(){var e,t;if(!this.endpoint.session)return i(s,{style:{display:"flex"}},i("verdocs-component-error",{message:"You must be authenticated to use this module."}));const o=this.getLevels(),l=q(this.roleStore),a=Object.values(this.rolesCompleted).filter((e=>c(e.email)||p(e.phone))).length>=l.length;return console.log("[SEND] Roles completed",this.rolesCompleted),i(s,{class:{sendable:null===(t=null===(e=this.templateStore)||void 0===e?void 0:e.state)||void 0===t?void 0:t.is_sendable}},i("div",{class:"recipients"},i("div",{class:"left-line"}),i("div",{class:"level level-start"},this.getLevelIcon(-1),i("div",{class:"complete"},"Send Envelope")),o.map((e=>i("div",{class:`level level-${e}`},this.getLevelIcon(e),this.getRolesAtLevel(e).map((e=>{var t,s,o,l,a,r;const n=`verdocs-send-recipient-${e.role_name}`;return e.email?i("div",{class:"recipient",style:{borderColor:h(E(this.roleStore,e.role_name))},onClick:t=>this.handleClickRole(t,e),id:n},null!==(a=null===(l=this.rolesCompleted[e.id])||void 0===l?void 0:l.first_name)&&void 0!==a?a:e.first_name,i("div",{class:"icon",innerHTML:Q}),this.showPickerForId===e.id&&i("verdocs-portal",{anchor:n,onClickAway:()=>this.showPickerForId=""},i("verdocs-contact-picker",{onExit:()=>this.showPickerForId="",onNext:t=>this.handleSelectContact(t,e),contactSuggestions:this.sessionContacts,templateRole:null!==(r=this.rolesCompleted[e.id])&&void 0!==r?r:e,onSearchContacts:e=>{var t;return null===(t=this.searchContacts)||void 0===t?void 0:t.emit(e.detail)}}))):i("div",{class:"recipient","data-ri":E(this.roleStore,e.role_name),"data-rn":e.role_name,style:{backgroundColor:h(E(this.roleStore,e.role_name))},onClick:t=>this.handleClickRole(t,e),id:n},null!==(s=null===(t=this.rolesCompleted[e.id])||void 0===t?void 0:t.first_name)&&void 0!==s?s:e.role_name,i("div",{class:"icon",innerHTML:Q}),this.showPickerForId===e.id&&i("verdocs-portal",{anchor:n,onClickAway:()=>this.showPickerForId=""},i("verdocs-contact-picker",{onExit:()=>this.showPickerForId="",onNext:t=>this.handleSelectContact(t,e),contactSuggestions:this.sessionContacts,templateRole:null!==(o=this.rolesCompleted[e.id])&&void 0!==o?o:e,onSearchContacts:e=>{var t;return null===(t=this.searchContacts)||void 0===t?void 0:t.emit(e.detail)}})))}))))),i("div",{class:"level level-done"},this.getLevelIcon(o.length),i("div",{class:"complete"},"Signing Complete"))),i("div",{class:"buttons"},i("verdocs-button",{label:"Cancel",size:"small",variant:"outline",onClick:e=>this.handleCancel(e),disabled:this.sending}),i("verdocs-button",{label:"Send",size:"small",disabled:!a||this.sending,onClick:e=>this.handleSend(e)}),this.sending&&i("verdocs-spinner",null)))}static get watchers(){return{templateId:["onTemplateIdChanged"]}}};W.style='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-send{padding:10px;position:relative;background:#ffffff;-ms-flex-direction:column;flex-direction:column;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-send.sendable{display:-ms-flexbox;display:flex}verdocs-send .recipients{position:relative}verdocs-send .left-line{top:32px;left:20px;z-index:1;width:12px;bottom:30px;position:absolute;background:#ffffff;border-left:3px dotted #9b9b9b}verdocs-send .level{display:-ms-flexbox;display:flex;-webkit-column-gap:10px;-moz-column-gap:10px;column-gap:10px;margin-left:50px;position:relative;-ms-flex-direction:row;flex-direction:row;padding:8px 0 4px 0;border-bottom:1px solid rgba(151, 151, 151, 0.2666666667)}verdocs-send .level .level-icon{top:14px;z-index:2;left:-40px;width:24px;height:24px;position:absolute;background:#ffffff}verdocs-send .level .level-icon svg{fill:rgba(0, 0, 0, 0.537254902)}verdocs-send .level .recipient{height:30px;display:-ms-flexbox;display:flex;-ms-flex:0 0 30px;flex:0 0 30px;color:#000000;cursor:pointer;font-size:14px;-ms-flex-align:center;align-items:center;border-radius:30px;-ms-flex-direction:row;flex-direction:row;background:#dddddd;white-space:nowrap;border:2px solid #dddddd;padding:2px 10px 2px 14px}verdocs-send .level .recipient .icon{width:22px;height:22px;-ms-flex:0 0 22px;flex:0 0 22px;margin:0 0 0 10px}verdocs-send .level .recipient .icon svg{width:22px;height:22px;fill:#333333;outline:none}verdocs-send .level .complete{-ms-flex:1;flex:1;height:30px;display:-ms-flexbox;display:flex;color:#000000;font-size:14px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;padding:3px 10px 3px 2px}verdocs-send .buttons{display:-ms-flexbox;display:flex;margin-top:10px;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;-ms-flex-direction:row;flex-direction:row}verdocs-send verdocs-contact-picker{left:0;top:41px;z-index:10;position:absolute;border:1px solid #dddddd;-webkit-box-shadow:0 0 6px 3px rgba(0, 0, 0, 0.1);box-shadow:0 0 6px 3px rgba(0, 0, 0, 0.1)}';const $=class{constructor(i){e(this,i),this.exit=t(this,"exit",7),this.next=t(this,"next",7),this.templateUpdated=t(this,"templateUpdated",7),this.sdkError=t(this,"sdkError",7),this.endpoint=a.getDefault(),this.templateId="",this.uploading=!1,this.progressLabel="Uploading...",this.progressPercent=0,this.showDeleteError=!1,this.confirmDeleteDocument=null,this.store=null}async componentWillLoad(){var e,t,i;try{if(this.endpoint.loadSession(),!this.templateId)return void console.log(`[ROLES] Missing required template ID ${this.templateId}`);if(!this.endpoint.session)return void console.log("[ROLES] Unable to start builder session, must be authenticated");this.store=await z(this.endpoint,this.templateId,!1)}catch(s){console.log("[TEMPLATE ATTACHMENTS] Error loading template",s),null===(e=this.sdkError)||void 0===e||e.emit(new M(s.message,null===(t=s.response)||void 0===t?void 0:t.status,null===(i=s.response)||void 0===i?void 0:i.data))}}handleCancel(e){e.stopPropagation(),this.exit.emit()}handleUploadProgress(e){e>=99?(this.progressPercent=100,this.progressLabel="Processing..."):this.progressPercent=e}async handleUpload(e){var t,i,s,o;e.stopPropagation();const l=e.detail.file;if(l){console.log("[ATTACHMENTS] Uploading...",l),this.uploading=!0,this.progressLabel="Uploading...";try{const e=await v(this.endpoint,this.templateId,l,this.handleUploadProgress.bind(this));console.log("[ATTACHMENTS] Created attachment",e),this.store=await z(this.endpoint,this.templateId,!1),console.log("[ATTACHMENTS] Updated template",this.store.state),null===(t=this.templateUpdated)||void 0===t||t.emit({endpoint:this.endpoint,template:this.store.state,event:"attachments"}),this.uploading=!1,this.progressLabel="",this.progressPercent=0}catch(e){console.log("[ATTACHMENTS] Error creating template",e),null===(i=this.sdkError)||void 0===i||i.emit(new M(e.message,null===(s=e.response)||void 0===s?void 0:s.status,null===(o=e.response)||void 0===o?void 0:o.data)),this.uploading=!1}}}handleNext(e){var t;e.stopPropagation(),this.uploading=!1,this.progressLabel="",this.progressPercent=0,null===(t=this.next)||void 0===t||t.emit({template:this.store.state})}async confirmDelete(){await m(this.endpoint,this.templateId,this.confirmDeleteDocument.id),this.store=await z(this.endpoint,this.templateId,!1),console.log("[ATTACHMENTS] New template",this.store.state),this.confirmDeleteDocument=null}async handleDelete(e){var t;(null===(t=this.store.state)||void 0===t?void 0:t.documents.length)>1?this.confirmDeleteDocument=e:this.showDeleteError=!0}getFileIcon(e){switch(e.mime){case"application/pdf":return H;case"image/jpeg":return T;case"image/png":return I;case"application/msword":case"application/vnd.openxmlformats-officedocument.wordprocessingml.document":return L}return Z}render(){var e,t,o;if(!this.endpoint.session)return i(s,null,i("verdocs-component-error",{message:"You must be authenticated to use this module."}));const l=null===(e=this.store)||void 0===e?void 0:e.state;return l.isLoaded?this.endpoint.session&&l.profile_id?i(s,null,i("h5",null,"Existing Attachments"),i("div",{class:"attachments"},null===(t=this.store)||void 0===t?void 0:t.state.documents.map((e=>i("div",{class:"attachment"},i("div",{class:"file-icon",innerHTML:this.getFileIcon(e)}),i("div",{class:"filename",title:e.name},e.name),i("div",{class:"pages"},i("div",{class:"count"},e.pages),i("div",{class:"pages-icon",innerHTML:D})),i("div",{class:"trash-icon",innerHTML:V,onClick:()=>this.handleDelete(e)}))))),i("h5",null,"Attach a New Document"),this.uploading?i("div",{class:"loader-wrapper"},i("verdocs-loader",null),this.progressLabel&&i("div",{class:"progress-wrapper"},i("verdocs-progress-bar",{showPercent:!0,percent:this.progressPercent,label:this.progressLabel}))):i("verdocs-file-chooser",{onFileSelected:e=>this.handleUpload(e)}),i("div",{class:"buttons"},i("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:e=>this.handleCancel(e),disabled:this.uploading}),i("verdocs-button",{label:"Next",size:"small",onClick:e=>this.handleNext(e),disabled:!(null===(o=this.store)||void 0===o?void 0:o.state.documents.length)||this.uploading})),this.showDeleteError&&i("verdocs-ok-dialog",{heading:"Unable to Delete Attachment",message:"Templates must contain at least one attachment.",onNext:()=>this.showDeleteError=!1}),this.confirmDeleteDocument&&i("verdocs-ok-dialog",{heading:"Delete this Attachment?",message:"This operation cannot be undone. All fields placed<br />on the deleted attachment will also be removed.",onNext:()=>this.confirmDelete(),showCancel:!0,onExit:()=>{this.confirmDeleteDocument=null}})):i(s,{class:"empty"}):i(s,{class:"loading"},i("verdocs-loader",null))}};$.style='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-template-attachments{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-attachments h5{font-size:16px;font-weight:bold;margin:0 0 10px 0;color:#46497d}verdocs-template-attachments .attachments{margin:0 0 40px 0}verdocs-template-attachments .attachment{display:-ms-flexbox;display:flex;padding:5px 0;-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;color:#33364b}verdocs-template-attachments .attachment:hover .trash-icon{display:-ms-flexbox;display:flex}verdocs-template-attachments .attachment:hover .pages{display:none}verdocs-template-attachments svg{width:28px;height:28px;fill:#5c6575;margin:2px 0 0 0}verdocs-template-attachments .file-icon{-ms-flex:0;flex:0}verdocs-template-attachments .pages{width:24px;height:24px;-ms-flex:0 0 24px;flex:0 0 24px;padding-left:4px;position:relative;margin:-10px 0 0 0}verdocs-template-attachments .pages .pages-icon{top:0;left:0;width:24px;height:24px;position:absolute}verdocs-template-attachments .pages .count{top:11px;left:7px;z-index:1;width:18px;font-size:12px;font-weight:500;position:absolute;text-align:center;letter-spacing:-2px}verdocs-template-attachments .filename{-ms-flex:1;flex:1;display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;border-bottom:1px dotted #cccccc}verdocs-template-attachments .trash-icon{-ms-flex:0;flex:0;display:none}verdocs-template-attachments .trash-icon:hover{cursor:pointer}verdocs-template-attachments verdocs-file-chooser{margin:10px 0;border:2px dashed #979797}verdocs-template-attachments .loader-wrapper{background-color:#ffffff;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;width:320px;height:320px;text-align:center;border:2px dashed #979797;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-attachments .progress-wrapper{padding:20px}verdocs-template-attachments .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-attachments .buttons .flex-fill{-ms-flex:1;flex:1}verdocs-template-attachments ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-attachments ::-moz-placeholder{color:#aaaaaa}verdocs-template-attachments :-ms-input-placeholder{color:#aaaaaa}verdocs-template-attachments ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-attachments ::placeholder{color:#aaaaaa}';const O=["attachments","roles","settings","fields","preview"],Y=class{constructor(i){e(this,i),this.sdkError=t(this,"sdkError",7),this.stepChanged=t(this,"stepChanged",7),this.endpoint=a.getDefault(),this.templateId=null,this.step="preview",this.templateStore=null}onTemplateIdChanged(e){console.log("[BUILD_TABS] Template ID changed",e),this.loadTemplate(e).catch((e=>console.log("Unknown Error",e)))}onStepChanged(e){console.log("[BUILD_TABS] Step changed",e),this.loadTemplate(this.templateId).catch((e=>console.log("Unknown Error",e)))}async componentWillLoad(){var e,t,i,s,o,l;try{if(this.endpoint.loadSession(),!this.endpoint.session)return void console.log("[BUILD_TABS] Unable to start builder session, must be authenticated");if(!this.templateId)return this.step="attachments",void console.log("[BUILD_TABS] Missing required template ID, forcing view to attachments");try{this.templateStore=await z(this.endpoint,this.templateId,!1)}catch(s){console.log("[BUILD_TABS] Error loading template",s),null===(e=this.sdkError)||void 0===e||e.emit(new M(s.message,null===(t=s.response)||void 0===t?void 0:t.status,null===(i=s.response)||void 0===i?void 0:i.data))}}catch(e){console.log("[BUILD_TABS] Error loading template",e),null===(s=this.sdkError)||void 0===s||s.emit(new M(e.message,null===(o=e.response)||void 0===o?void 0:o.status,null===(l=e.response)||void 0===l?void 0:l.data))}}async loadTemplate(e){e&&(this.templateStore=await z(this.endpoint,e,!1))}setStep(e){var t;console.log("Selected step",e.detail.tab.id),e.stopPropagation(),e.preventDefault(),this.step=e.detail.tab.id,null===(t=this.stepChanged)||void 0===t||t.emit(e.detail.tab.id)}copyTemplateId(){navigator.clipboard.writeText(this.templateId).then((()=>{_("Template ID copied",{style:"success",duration:3e3})})).catch((e=>{var t;console.warn("[BUILD_TABS] Error copying to clipboard",e),null===(t=this.sdkError)||void 0===t||t.emit(e)}))}render(){var e,t,o,l,a,r,n,d,c,p,h,v,m,u,g,f,x,b,w,y,k;if(!this.endpoint.session)return i(s,null,i("verdocs-component-error",{message:"You must be authenticated to use this module."}));let C=!1,q=!1,E=!1;this.templateId&&this.templateStore&&this.templateStore.state&&(E=(null===(o=null===(t=null===(e=this.templateStore)||void 0===e?void 0:e.state)||void 0===t?void 0:t.documents)||void 0===o?void 0:o.length)>0,q=E&&(null===(r=null===(a=null===(l=this.templateStore)||void 0===l?void 0:l.state)||void 0===a?void 0:a.roles)||void 0===r?void 0:r.length)>0,C=q&&(null===(c=null===(d=null===(n=this.templateStore)||void 0===n?void 0:n.state)||void 0===d?void 0:d.fields)||void 0===c?void 0:c.length)>0);let S=Math.max(O.indexOf(this.step),0);return!C&&S>=4&&(S=3),!q&&S>=3&&(S=1),!E&&S>=1&&(S=0),i(s,null,i("verdocs-tabs",{onSelectTab:e=>this.setStep(e),selectedTab:S,tabs:[{id:"attachments",disabled:!1,label:"Attachment(s)"},{id:"roles",disabled:!E,label:"Roles"},{id:"settings",disabled:!q,label:"Settings"},{id:"fields",disabled:!q,label:"Fields"},{id:"preview",disabled:!C,label:"Preview/Send"}]}),this.templateId&&i("div",{class:"info"},i("verdocs-button-panel",{icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24" fill="#5c6575"><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>'},i("div",{class:"template-details-panel"},i("h6",null,"Template Details"),i("div",{class:"row"},i("label",null,"ID:"),i("div",{class:"value"},this.templateId),i("div",{class:"icon-button",innerHTML:'<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M15.75 17.25v3.375c0 .621-.504 1.125-1.125 1.125h-9.75a1.125 1.125 0 0 1-1.125-1.125V7.875c0-.621.504-1.125 1.125-1.125H6.75a9.06 9.06 0 0 1 1.5.124m7.5 10.376h3.375c.621 0 1.125-.504 1.125-1.125V11.25c0-4.46-3.243-8.161-7.5-8.876a9.06 9.06 0 0 0-1.5-.124H9.375c-.621 0-1.125.504-1.125 1.125v3.5m7.5 10.375H9.375a1.125 1.125 0 0 1-1.125-1.125v-9.25m12 6.625v-1.875a3.375 3.375 0 0 0-3.375-3.375h-1.5a1.125 1.125 0 0 1-1.125-1.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H9.75" /></svg>',onClick:()=>this.copyTemplateId()})),i("div",{class:"row"},i("label",null,"Name:"),i("div",{class:"value"},null===(h=null===(p=this.templateStore)||void 0===p?void 0:p.state)||void 0===h?void 0:h.name)),i("div",{class:"row"},i("label",null,"Visibility:"),i("div",{class:"value"},(null===(m=null===(v=this.templateStore)||void 0===v?void 0:v.state)||void 0===m?void 0:m.is_public)?"Public":(null===(g=null===(u=this.templateStore)||void 0===u?void 0:u.state)||void 0===g?void 0:g.is_personal)?"Private":"Shared")),i("div",{class:"row"},i("label",null,"Created:"),i("div",{class:"value"},(null===(x=null===(f=this.templateStore)||void 0===f?void 0:f.state)||void 0===x?void 0:x.counter)?R.format(new Date(null===(w=null===(b=this.templateStore)||void 0===b?void 0:b.state)||void 0===w?void 0:w.created_at),"P p"):"")),i("div",{class:"row"},i("label",null,"Used:"),i("div",{class:"value"},null===(k=null===(y=this.templateStore)||void 0===y?void 0:y.state)||void 0===k?void 0:k.counter," time(s)"))))))}static get watchers(){return{templateId:["onTemplateIdChanged"],step:["onStepChanged"]}}};Y.style='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-template-build-tabs{-ms-flex:1;flex:1;gap:15px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-build-tabs verdocs-button-panel svg{-webkit-transform:scale(0.8);transform:scale(0.8)}verdocs-template-build-tabs verdocs-template-attachments,verdocs-template-build-tabs verdocs-template-roles{margin:20px}verdocs-template-build-tabs verdocs-template-fields{border-top:1px solid #777777}verdocs-template-build-tabs verdocs-template-attachments{padding:20px;background:#ffffff}verdocs-template-build-tabs verdocs-template-fields{width:100%}verdocs-template-build-tabs verdocs-preview{-ms-flex:1;flex:1}.template-details-panel .row{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;gap:8px;margin:10px 0}.template-details-panel label{-ms-flex:0 0 70px;flex:0 0 70px}.template-details-panel .value{-ms-flex:1;flex:1;font-weight:300;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.template-details-panel .icon-button{cursor:pointer;opacity:0.8;-ms-flex:0;flex:0;width:18px;height:18px}.template-details-panel .icon-button svg{stroke:#000000;width:18px;height:18px}.template-details-panel .icon-button:hover{opacity:1}';const X=class{constructor(i){e(this,i),this.exit=t(this,"exit",7),this.next=t(this,"next",7),this.sdkError=t(this,"sdkError",7),this.templateCreated=t(this,"templateCreated",7),this.endpoint=a.getDefault(),this.file=void 0,this.creating=!1,this.progressLabel="Uploading...",this.progressPercent=0}componentWillLoad(){this.endpoint.setTimeout(3e4),this.endpoint.loadSession()}handleFileChanged(e){var t;this.file=(null===(t=e.target.files)||void 0===t?void 0:t[0])||null,console.log("[CREATE] Selected file",this.file)}handleUpload(e){e.stopPropagation(),document.getElementById("verdocs-template-create-file").click()}handleCancel(e){e.stopPropagation(),this.exit.emit()}async handleSubmit(e){var t,i,s;if(e.stopPropagation(),console.log("Submitting"),this.file){this.creating=!0,this.progressLabel="Uploading...";try{const e=await u(this.endpoint,{name:this.file.name,initial_reminder:0,followup_reminders:0,documents:[this.file]},(e=>{e>=99?(this.progressLabel="Processing...",this.progressPercent=100):this.progressPercent=e}));console.log("[CREATE] Created template",e),z(this.endpoint,e.id,!0).then((()=>{var t,i;null===(t=this.templateCreated)||void 0===t||t.emit({endpoint:this.endpoint,template:e,templateId:e.id}),null===(i=this.next)||void 0===i||i.emit(e),this.creating=!1,this.progressLabel="",this.progressPercent=0})).catch((e=>{console.log(e)}))}catch(e){console.log("[CREATE] Error creating template",e),null===(t=this.sdkError)||void 0===t||t.emit(new M(e.message,null===(i=e.response)||void 0===i?void 0:i.status,null===(s=e.response)||void 0===s?void 0:s.data)),this.creating=!1}}}render(){return i(s,null,this.endpoint.session?i("form",{onSubmit:e=>e.preventDefault(),onClick:e=>e.stopPropagation(),autocomplete:"off"},i("input",{type:"file",id:"verdocs-template-create-file",multiple:!0,accept:".pdf,application/pdf,.doc,.docx,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document",style:{display:"none"},onChange:e=>this.handleFileChanged(e)}),this.creating?i("div",{class:"loader-wrapper"},i("verdocs-loader",null),this.progressLabel&&i("div",{class:"progress-wrapper"},i("verdocs-progress-bar",{showPercent:!0,percent:this.progressPercent,label:this.progressLabel}))):i("div",{class:"upload-box",onDrop:e=>{e.preventDefault(),e.target.classList.remove("drag-over"),this.file=e.dataTransfer.files[0]},onDragOver:e=>{e.preventDefault(),e.dataTransfer.dropEffect="copy"},onDragEnter:e=>e.target.classList.add("drag-over"),onDragLeave:e=>e.target.classList.remove("drag-over")},i("span",{innerHTML:'<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24"><path d="M6 2c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6H6zm7 7V3.5L18.5 9H13z"></path></svg>',style:{display:"flex",justifyContent:"center"}}),i("div",{style:{marginTop:"20px",fontSize:"20px",fontWeight:"bold",overflowWrap:"anywhere"}},this.file?this.file.name:"Drag a file here"),i("div",{style:{marginTop:"20px",marginBottom:"20px",fontSize:"16px",height:"20px"}},this.file?" ":"Or, if you prefer..."),i("verdocs-button",{label:this.file?"Select a different file":"Select a file from your computer",size:"small",onClick:e=>this.handleUpload(e)})),i("div",{class:"buttons"},i("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:e=>this.handleCancel(e),disabled:this.creating}),i("verdocs-button",{label:"Next",size:"small",onClick:e=>this.handleSubmit(e),disabled:!this.file||this.creating}))):i("verdocs-component-error",{message:"You must be authenticated to use this module."}))}};X.style='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-template-create{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-create form{background-color:#ffffff;padding:12px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-template-create form .upload-box{-webkit-box-sizing:border-box;box-sizing:border-box;width:320px;text-align:center;padding:44px 18px 66px;border:2px dashed #979797;color:rgba(0, 0, 0, 0.54)}verdocs-template-create form .upload-box.drag-over{border:2px solid #4c56cb}verdocs-template-create form .upload-box svg{width:64px;fill:#5c6575}verdocs-template-create .loader-wrapper{background-color:#ffffff;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;width:320px;height:320px;text-align:center;border:2px dashed #979797;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-create .progress-wrapper{padding:20px}verdocs-template-create .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-create .buttons .flex-fill{-ms-flex:1;flex:1}verdocs-template-create ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-create ::-moz-placeholder{color:#aaaaaa}verdocs-template-create :-ms-input-placeholder{color:#aaaaaa}verdocs-template-create ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-create ::placeholder{color:#aaaaaa}';const K='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14.707 14.707"><g><rect x="6.275" y="0" fill="#ffffff7f" width="1" height="15"/></g></svg>',G=[{id:"signature",tooltip:"Signature",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z"/></svg>',class:"signature"},{id:"initial",tooltip:"Initials",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M6.225 20.775V7h-5V3.225H15V7h-5v13.775Zm9.775 0v-8h-3V9h9.775v3.775h-3v8Z"/></svg>',class:"initial"},{id:"sep1",tooltip:"",icon:K,class:"separator"},{id:"textbox",tooltip:"Text Box",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M3.425 16.15V13h11.15v3.15Zm0-5.15V7.85h17.15V11Z"/></svg>',class:"textbox"},{id:"checkbox",tooltip:"Check Box",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z"/></svg>',class:"checkbox"},{id:"radio",tooltip:"Radio Button",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M12 17q2.075 0 3.538-1.463Q17 14.075 17 12t-1.462-3.538Q14.075 7 12 7 9.925 7 8.463 8.462 7 9.925 7 12q0 2.075 1.463 3.537Q9.925 17 12 17Zm0 5.85q-2.275 0-4.25-.85t-3.438-2.312Q2.85 18.225 2 16.25q-.85-1.975-.85-4.25T2 7.75q.85-1.975 2.312-3.438Q5.775 2.85 7.75 2q1.975-.85 4.25-.85t4.25.85q1.975.85 3.438 2.312Q21.15 5.775 22 7.75q.85 1.975.85 4.25T22 16.25q-.85 1.975-2.312 3.438Q18.225 21.15 16.25 22q-1.975.85-4.25.85Zm0-3.15q3.25 0 5.475-2.225Q19.7 15.25 19.7 12q0-3.25-2.225-5.475Q15.25 4.3 12 4.3q-3.25 0-5.475 2.225Q4.3 8.75 4.3 12q0 3.25 2.225 5.475Q8.75 19.7 12 19.7Zm0-7.7Z"/></svg>',class:"radio"},{id:"dropdown",tooltip:"Dropdown",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24" stroke-width="1.5" stroke="currentColor"><path stroke="#ffffff" stroke-linecap="round" stroke-linejoin="round" d="M3 4.5h14.25M3 9h9.75M3 13.5h9.75m4.5-4.5v12m0 0l-3.75-3.75M17.25 21L21 17.25" /></svg>',class:"dropdown"},{id:"sep2",tooltip:"",icon:K,class:"separator"},{id:"date",tooltip:"Date",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M7.6 13.925q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375ZM5.3 22.85q-1.325 0-2.238-.912-.912-.913-.912-2.238V6.3q0-1.325.912-2.238.913-.912 2.238-.912H6v-2h2.575v2h6.85v-2H18v2h.7q1.325 0 2.238.912.912.913.912 2.238v13.4q0 1.325-.912 2.238-.913.912-2.238.912Zm0-3.15h13.4V10H5.3v9.7ZM5.3 8h13.4V6.3H5.3Zm0 0V6.3 8Z"/></svg>',class:"date"},{id:"timestamp",tooltip:"Timestamp",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M9 1h6v2H9zm10.03 6.39 1.42-1.42c-.43-.51-.9-.99-1.41-1.41l-1.42 1.42C16.07 4.74 14.12 4 12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9 9-4.03 9-9c0-2.12-.74-4.07-1.97-5.61zM13 14h-2V8h2v6z"></path></svg>',class:"timestamp"},{id:"attachment",tooltip:"Attachment",icon:'<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6"><path stroke-linecap="round" stroke-linejoin="round" d="m18.375 12.739-7.693 7.693a4.5 4.5 0 0 1-6.364-6.364l10.94-10.94A3 3 0 1 1 19.5 7.372L8.552 18.32m.009-.01-.01.01m5.699-9.941-7.81 7.81a1.5 1.5 0 0 0 2.112 2.13" /></svg>',class:"attachment"}],J=class{constructor(i){e(this,i),this.sdkError=t(this,"sdkError",7),this.templateUpdated=t(this,"templateUpdated",7),this.fieldsUpdated=t(this,"fieldsUpdated",7),this.pageHeights={},this.templateStore=null,this.fieldStore=null,this.roleStore=null,this.cachedPageInfo={},this.endpoint=a.getDefault(),this.templateId=null,this.toolbarTargetId=null,this.placing=null,this.showMustSelectRole=!1,this.selectedRoleName="",this.loading=!0}async componentWillLoad(){var e,t,i;try{if(this.endpoint.loadSession(),!this.templateId)return void console.log(`[FIELDS] Missing required template ID ${this.templateId}`);if(!this.endpoint.session)return void console.log("[FIELDS] Unable to start builder session, must be authenticated");z(this.endpoint,this.templateId,!0).then((e=>{var t,i;this.templateStore=e,this.fieldStore=y(this.templateId),this.roleStore=C(this.templateId),this.selectedRoleName=(null===(i=null===(t=this.roleStore.get("roles"))||void 0===t?void 0:t[0])||void 0===i?void 0:i.name)||"",this.loading=!1,this.fieldStore.onChange("fields",(e=>{var t;console.log("[FIELDS] Fields changed",{fields:e}),null===(t=this.fieldsUpdated)||void 0===t||t.emit({event:"updated",endpoint:this.endpoint,templateId:this.templateId,fields:e})}))})).catch((e=>{console.log(e)}))}catch(s){console.log("[FIELDS] Error with fields session",s),null===(e=this.sdkError)||void 0===e||e.emit(new M(s.message,null===(t=s.response)||void 0===t?void 0:t.status,null===(i=s.response)||void 0===i?void 0:i.data))}}componentDidRender(){N.dynamicDrop(!0);const e=this.toolbarTargetId?document.getElementById(this.toolbarTargetId):null,t=document.getElementById("verdocs-template-fields-toolbar");e&&t&&(console.log("[FIELDS] Moving toolbar"),t.remove(),e.append(t))}componentWillUpdate(){var e;const t=this.roleStore.get("roles");this.selectedRoleName&&t.find((e=>e&&e.name===this.selectedRoleName))||(this.selectedRoleName=(null===(e=t[0])||void 0===e?void 0:e.name)||"",console.log("[FIELDS] Selected new role",this.selectedRoleName))}handleKeyDown(e){"Escape"===e.key&&(this.placing=null)}async handleFieldChange(e,t,i){console.log("[FIELDS] handleFieldChange",e,t,i)}attachFieldAttributes(e,t,i){i.addEventListener("input",(e=>this.handleFieldChange(t,e))),i.addEventListener("settingsChanged",(e=>{var t,i;console.log("Settings changed",e.detail),null===(t=this.templateUpdated)||void 0===t||t.emit({endpoint:this.endpoint,template:null===(i=this.templateStore)||void 0===i?void 0:i.state,event:"added-field"})})),i.addEventListener("deleted",(()=>{var e,s;console.log("[FIELDS] Deleted",this,t),i.remove(),null===(e=this.templateUpdated)||void 0===e||e.emit({endpoint:this.endpoint,template:null===(s=this.templateStore)||void 0===s?void 0:s.state,event:"updated-field"})})),i.setAttribute("templateid",this.templateId),i.setAttribute("fieldname",t.name),i.setAttribute("pageNumber",String(e.pageNumber)),i.setAttribute("xScale",String(e.xScale)),i.setAttribute("yScale",String(e.yScale)),i.setAttribute("name",t.name)}handlePageRendered(e){const t=e.detail;this.cachedPageInfo[t.pageNumber]=t,this.pageHeights[t.pageNumber]=t.naturalHeight,this.fieldStore.get("fields").filter((e=>e&&e.page===t.pageNumber)).forEach((e=>{const t=B(e),i=document.getElementById(t);i&&(i.setAttribute("fieldname",e.name),i.setAttribute("pagenumber",String(e.page)),this.makeDraggable(i))}))}makeDraggable(e){N(e).draggable({listeners:{move:this.handleMoveField.bind(this),end:this.handleMoveEnd.bind(this)}})}async handleMoveField(e){const t=+(e.target.getAttribute("posX")||0),i=+(e.target.getAttribute("posY")||0),s=+(e.target.getAttribute("xScale")||1),o=+(e.target.getAttribute("yScale")||1),l=e.dx/s+t,a=e.dy/o+i;e.target.setAttribute("posX",l),e.target.setAttribute("posy",a),U(e.target,"translate",`${l}px, ${a}px`)}async handleMoveEnd(e){var t,i,s,o,l;const a=e.target.getAttribute("fieldname"),r=+(e.target.getAttribute("option")||"0"),n=this.fieldStore.get("fields").find((e=>e.name===a));if(!n)return void console.log("[FIELDS] Unable to find field",a,e.target);const d=e.target.getAttribute("pagenumber"),{naturalWidth:c=612,naturalHeight:p=792,renderedHeight:h=792}=this.cachedPageInfo[d],v=e.target.getBoundingClientRect(),m=e.target.parentElement.getBoundingClientRect(),u=n.width||j(n.type),f=n.height||P(n.type),x=Math.max(v.left-m.left,0),b=Math.max(h-(m.bottom-v.bottom),0),{x:w,y}=this.viewCoordinatesToPageCoordinates(x,b,d,c-u,p-f);try{const s={x:w,y};console.log("[FIELDS] Will update",a,y,r,s);const o=await g(this.endpoint,this.templateId,a,s);console.log("[FIELDS] Updated",o),k(this.fieldStore,a,o),e.target.removeAttribute("posX"),e.target.removeAttribute("posY"),A(e.target),null===(t=this.templateUpdated)||void 0===t||t.emit({endpoint:this.endpoint,template:null===(i=this.templateStore)||void 0===i?void 0:i.state,event:"updated-field"})}catch(t){_("Error updating field, please try again later",{style:"error"}),console.log("[FIELDS] Error updating field",t),null===(s=this.sdkError)||void 0===s||s.emit(new M(t.message,null===(o=t.response)||void 0===o?void 0:o.status,null===(l=t.response)||void 0===l?void 0:l.data)),e.target.removeAttribute("posX"),e.target.removeAttribute("posY"),A(e.target)}}generateFieldName(e,t){let i,s=1;do{i=`${e}P${t}-${s}`,s++}while(this.fieldStore.get("fields").some((e=>e&&e.name===i)));return i}viewCoordinatesToPageCoordinates(e,t,i,s,o){const{xScale:l=1,yScale:a=1,renderedHeight:r=792}=this.cachedPageInfo[i];return{x:Math.floor(Math.min(e/l,s)),y:Math.floor(Math.min(Math.max(r-t,0)/a,o))}}async handleClickPage(e,t){var i,s;if(this.placing){const o=e.offsetX,l=e.offsetY,a=j(this.placing),r=P(this.placing),n=this.cachedPageInfo[t],{naturalWidth:d=612,naturalHeight:c=792}=n,p=this.viewCoordinatesToPageCoordinates(o,l,t,d-a,c-r),h=Math.floor(p.x),v=Math.floor(p.y),m={name:this.generateFieldName(this.placing,t),role_name:this.selectedRoleName,template_id:this.templateId,document_id:n.documentId,type:this.placing,required:"radio"!==this.placing,page:t,validator:null,label:null,default:null,placeholder:null,group:null,settings:{},x:h,y:v,width:a,height:r,multiline:!1,options:"radio"===this.placing?[{value:"option-1",label:"Option 1"}]:[]};console.log("[FIELDS] Will save new field",m);const u=await f(this.endpoint,this.templateId,m);console.log("[FIELDS] Saved field",u),this.fieldStore.set("fields",[...this.fieldStore.get("fields"),u]),this.placing=null,null===(i=this.templateUpdated)||void 0===i||i.emit({endpoint:this.endpoint,template:null===(s=this.templateStore)||void 0===s?void 0:s.state,event:"added-field"})}}render(){var e,t,o;if(!this.endpoint.session)return i(s,null,i("verdocs-component-error",{message:"You must be authenticated to use this module."}));if(this.loading||!(null===(e=this.templateStore)||void 0===e?void 0:e.state.isLoaded))return i(s,null,i("verdocs-loader",null));const l=this.roleStore.get("roles").map((e=>({value:e.name,label:e.full_name?`${e.name}: ${e.full_name}`:e.name})));return i(s,{class:this.placing?{[`placing-${this.placing}`]:!0}:{},onSubmit:()=>{}},i("div",{id:"verdocs-template-fields-toolbar"},i("div",{class:"add-for"},"Add field:"),i("verdocs-select-input",{value:this.selectedRoleName,options:l,onInput:e=>this.selectedRoleName=e.target.value}),G.map((e=>i("verdocs-toolbar-icon",{text:e.tooltip,icon:e.icon,class:e.class,onClick:()=>{e.tooltip&&(this.selectedRoleName?this.placing=e.id:this.showMustSelectRole=!0)}})))),i("div",{class:"pages"},((null===(o=null===(t=this.templateStore)||void 0===t?void 0:t.state)||void 0===o?void 0:o.documents)||[]).map((e=>r(1,e.pages).map((t=>i("verdocs-template-document-page",{templateId:this.templateId,documentId:e.id,pageNumber:t,virtualWidth:612,virtualHeight:792,disabled:!0,editable:!0,done:!1,onClick:e=>this.handleClickPage(e,t),onPageRendered:e=>this.handlePageRendered(e),layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})))))),this.showMustSelectRole&&i("verdocs-ok-dialog",{heading:"Unable to add field",message:this.roleStore.get("roles").length>0?"Please select a role before adding fields.":"Please add at least one role before adding fields.",onNext:()=>this.showMustSelectRole=!1}))}};J.style="@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-template-fields{font-family:\"Inter\", -apple-system, \"Segoe UI\", \"Roboto\", \"Helvetica Neue\", sans-serif;position:relative;display:block;min-height:600px}verdocs-template-fields .page-0{padding:65px 15px 0 15px;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-fields .page-0 .user-placed-fields{height:100px;position:relative;background:#ffffff;-webkit-box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294);box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294)}verdocs-template-fields .page-0 .user-placed-fields .title{top:0;left:0;color:#ffffff;font-size:12px;padding:3px 6px;font-weight:bold;position:absolute;background:#46497d}verdocs-template-fields .pages{display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;min-height:200px;position:relative;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column}verdocs-template-fields .pages div,verdocs-template-fields .pages canvas{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-fields #verdocs-template-fields-toolbar{height:50px;display:-ms-flexbox;display:flex;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;font-weight:700;padding:0 20px 0 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;color:#f5f5fa;-ms-flex-pack:center;justify-content:center;background:#46497d}verdocs-template-fields #verdocs-template-fields-toolbar>verdocs-select-input{margin:0}verdocs-template-fields #verdocs-template-fields-toolbar svg{width:24px;height:24px}verdocs-template-fields #verdocs-template-fields-toolbar .add-for{margin:0;font-weight:500;color:#f5f5fa}verdocs-template-fields #verdocs-template-fields-toolbar verdocs-select-input{margin:0 20px 0 0}@media all and (max-width: 1000px){verdocs-template-fields #verdocs-template-fields-toolbar{-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;padding:0 10px 0 0}verdocs-template-fields #verdocs-template-fields-toolbar svg{-webkit-transform:scale(0.8);transform:scale(0.8)}verdocs-template-fields #verdocs-template-fields-toolbar .add-for,verdocs-template-fields #verdocs-template-fields-toolbar verdocs-select-input{display:none}}@media all and (max-width: 600px){verdocs-template-fields #verdocs-template-fields-toolbar{-webkit-column-gap:6px;-moz-column-gap:6px;column-gap:6px}verdocs-template-fields #verdocs-template-fields-toolbar svg{-webkit-transform:scale(0.6);transform:scale(0.6)}verdocs-template-fields #verdocs-template-fields-toolbar .separator,verdocs-template-fields #verdocs-template-fields-toolbar .add-for,verdocs-template-fields #verdocs-template-fields-toolbar verdocs-select-input{display:none}}verdocs-template-fields.placing-attachment{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-checkbox{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-date{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath fill='%23000000' d='M7.6 13.925q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375ZM5.3 22.85q-1.325 0-2.238-.912-.912-.913-.912-2.238V6.3q0-1.325.912-2.238.913-.912 2.238-.912H6v-2h2.575v2h6.85v-2H18v2h.7q1.325 0 2.238.912.912.913.912 2.238v13.4q0 1.325-.912 2.238-.913.912-2.238.912Zm0-3.15h13.4V10H5.3v9.7ZM5.3 8h13.4V6.3H5.3Zm0 0V6.3 8Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-dropdown{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24' stroke-width='1.5' stroke='currentColor'%3E%3Cpath stroke='%23000000' stroke-linecap='round' stroke-linejoin='round' d='M3 4.5h14.25M3 9h9.75M3 13.5h9.75m4.5-4.5v12m0 0l-3.75-3.75M17.25 21L21 17.25' /%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-initial{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M6.225 20.775V7h-5V3.225H15V7h-5v13.775Zm9.775 0v-8h-3V9h9.775v3.775h-3v8Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-payment{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-radio{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M12 17q2.075 0 3.538-1.463Q17 14.075 17 12t-1.462-3.538Q14.075 7 12 7 9.925 7 8.463 8.462 7 9.925 7 12q0 2.075 1.463 3.537Q9.925 17 12 17Zm0 5.85q-2.275 0-4.25-.85t-3.438-2.312Q2.85 18.225 2 16.25q-.85-1.975-.85-4.25T2 7.75q.85-1.975 2.312-3.438Q5.775 2.85 7.75 2q1.975-.85 4.25-.85t4.25.85q1.975.85 3.438 2.312Q21.15 5.775 22 7.75q.85 1.975.85 4.25T22 16.25q-.85 1.975-2.312 3.438Q18.225 21.15 16.25 22q-1.975.85-4.25.85Zm0-3.15q3.25 0 5.475-2.225Q19.7 15.25 19.7 12q0-3.25-2.225-5.475Q15.25 4.3 12 4.3q-3.25 0-5.475 2.225Q4.3 8.75 4.3 12q0 3.25 2.225 5.475Q8.75 19.7 12 19.7Zm0-7.7Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-signature{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-textarea{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M3.225 20.725v-3.15h11.55v3.15Zm0-4.775V12.8h17.55v3.15Zm0-4.75V8.05h17.55v3.15Zm0-4.775v-3.15h17.55v3.15Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-textbox{cursor:url(\"data:image/svg+xml,%3Csvg width='32' height='15' viewBox='0 0 32 15' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cmask id='path-1-inside-1_1401_24' fill='white'%3E%3Cpath d='M0 0H32V15H0V0Z'/%3E%3C/mask%3E%3Cpath d='M0 0H32V15H0V0Z' fill='%234C56CB' fill-opacity='0.1'/%3E%3Cpath d='M0 0V-1H-1V0H0ZM0 15H-1V16H0V15ZM0 1H32V-1H0V1ZM32 14H0V16H32V14ZM1 15V0H-1V15H1Z' fill='%234C56CB' mask='url(%23path-1-inside-1_1401_24)'/%3E%3Cpath d='M3 11.8V8.65H14.15V11.8H3ZM3 6.65V3.5H20.15V6.65H3Z' fill='%234C56CB'/%3E%3Cline x1='31.5' y1='1' x2='31.5' y2='14' stroke='%234C56CB' stroke-opacity='0.32' stroke-dasharray='1 1'/%3E%3C/svg%3E%0A\") 0 14, pointer}verdocs-template-fields.placing-timestamp{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath fill='%23000000' d='M9 1h6v2H9zm10.03 6.39 1.42-1.42c-.43-.51-.9-.99-1.41-1.41l-1.42 1.42C16.07 4.74 14.12 4 12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9 9-4.03 9-9c0-2.12-.74-4.07-1.97-5.61zM13 14h-2V8h2v6z'%3E%3C/path%3E%3C/svg%3E\") 16 16, pointer}";const ee=class{constructor(i){e(this,i),this.close=t(this,"close",7),this.sdkError=t(this,"sdkError",7),this.templateUpdated=t(this,"templateUpdated",7),this.store=null,this.endpoint=a.getDefault(),this.templateId="",this.name="",this.dirty=!1}async componentWillLoad(){var e,t,i,s,o;try{if(this.endpoint.loadSession(),!this.templateId)return void console.log(`[ROLES] Missing required template ID ${this.templateId}`);if(!this.endpoint.session)return void console.log("[ROLES] Unable to start builder session, must be authenticated");this.store=await z(this.endpoint,this.templateId,!1),this.name=null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t?void 0:t.name,this.dirty=!1}catch(e){console.log("[TEMPLATE NAME] Error loading template",e),null===(i=this.sdkError)||void 0===i||i.emit(new M(e.message,null===(s=e.response)||void 0===s?void 0:s.status,null===(o=e.response)||void 0===o?void 0:o.data))}}handleCancel(e){var t,i,s;e.stopPropagation(),this.name=null===(i=null===(t=this.store)||void 0===t?void 0:t.state)||void 0===i?void 0:i.name,this.dirty=!1,console.log("Closing"),null===(s=this.close)||void 0===s||s.emit()}async handleSave(e){var t,i,s;e.stopPropagation(),await x(this.endpoint,this.templateId,{name:this.name}),(null===(t=this.store)||void 0===t?void 0:t.state)&&(this.store.state.name=this.name),this.dirty=!1,null===(i=this.templateUpdated)||void 0===i||i.emit({endpoint:this.endpoint,template:this.store.state,event:"name"}),null===(s=this.close)||void 0===s||s.emit()}render(){var e,t;return this.endpoint.session?(null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t?void 0:t.isLoading)?i(s,{class:"loading"},i("verdocs-loader",null)):i(s,null,i("form",{onSubmit:e=>e.preventDefault(),onClick:e=>e.stopPropagation(),autocomplete:"off"},i("label",{htmlFor:"verdocs-template-name"},"Template Name"),i("verdocs-text-input",{id:"verdocs-template-name",value:this.name,autocomplete:"off",placeholder:"Template Name...",onInput:e=>{var t,i;this.name=e.target.value,this.dirty=this.name!==(null===(i=null===(t=this.store)||void 0===t?void 0:t.state)||void 0===i?void 0:i.name)}}),i("div",{class:"buttons"},i("verdocs-button",{size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:e=>this.handleCancel(e)}),i("verdocs-button",{size:"small",label:"Save",disabled:!this.dirty,onClick:e=>this.handleSave(e)})))):i(s,null,i("verdocs-component-error",{message:"You must be authenticated to use this module."}))}};ee.style="";const te={everyone:"Everyone",everyone_as_creator:"Everyone as Me",organization_member:"Organization member",organization_member_as_creator:"Organization Member as Me",creator:"Me"},ie='<svg xmlns="http://www.w3.org/2000/svg" height="20" width="20" fill="#00000089"><path d="m8.021 17.917-.313-2.5q-.27-.125-.625-.334-.354-.208-.625-.395l-2.312.979-1.979-3.438 1.979-1.5q-.021-.167-.031-.364-.011-.198-.011-.365 0-.146.011-.344.01-.198.031-.385l-1.979-1.5 1.979-3.417 2.312.958q.271-.187.615-.385t.635-.344l.313-2.5h3.958l.313 2.5q.312.167.625.344.312.177.604.385l2.333-.958 1.979 3.417-1.979 1.521q.021.187.021.364V10q0 .146-.01.333-.011.188-.011.396l1.958 1.5-1.979 3.438-2.312-.979q-.292.208-.615.395-.323.188-.614.334l-.313 2.5Zm1.937-5.355q1.063 0 1.813-.75t.75-1.812q0-1.062-.75-1.812t-1.813-.75q-1.041 0-1.802.75-.76.75-.76 1.812t.76 1.812q.761.75 1.802.75Zm0-1.333q-.5 0-.864-.364-.365-.365-.365-.865t.365-.865q.364-.364.864-.364t.865.364q.365.365.365.865t-.365.865q-.365.364-.865.364ZM10.021 10Zm-.854 6.583h1.666l.25-2.187q.605-.167 1.136-.49.531-.323 1.031-.802l2.021.875.854-1.375-1.792-1.354q.105-.333.136-.635.031-.303.031-.615 0-.292-.031-.573-.031-.281-.115-.635l1.792-1.396-.834-1.375-2.062.875q-.438-.438-1.021-.781-.583-.344-1.125-.49l-.271-2.208H9.167l-.271 2.208q-.584.146-1.125.458-.542.313-1.042.792l-2.021-.854-.833 1.375 1.75 1.354q-.083.333-.125.646-.042.312-.042.604t.042.594q.042.302.125.635l-1.75 1.375.833 1.375 2.021-.854q.479.458 1.021.771.542.312 1.146.479Z"/></svg>',se='<svg xmlns="http://www.w3.org/2000/svg" fill="#ffffff" viewBox="0 0 24 24" strokeWidth={1.5} stroke="currentColor"><path strokeLinecap="round" strokeLinejoin="round" d="M12 9v6m3-3H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z" /></svg>',oe='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path d="m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z"/></svg>',le='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><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>',ae='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M1.5 8.67v8.58a3 3 0 003 3h15a3 3 0 003-3V8.67l-8.928 5.493a3 3 0 01-3.144 0L1.5 8.67z" /><path d="M22.5 6.908V6.75a3 3 0 00-3-3h-15a3 3 0 00-3 3v.158l9.714 5.978a1.5 1.5 0 001.572 0L22.5 6.908z" /></svg>',re=class{constructor(i){e(this,i),this.next=t(this,"next",7),this.exit=t(this,"exit",7),this.sdkError=t(this,"sdkError",7),this.rolesUpdated=t(this,"rolesUpdated",7),this.templateStore=null,this.roleStore=null,this.endpoint=a.getDefault(),this.templateId="",this.showingRoleDialog=null,this.showingSenderDialog=!1,this.sender=null,this.loading=!0}async componentWillLoad(){var e,t,i;try{if(this.endpoint.loadSession(),!this.templateId)return void console.log(`[ROLES] Missing required template ID ${this.templateId}`);if(!this.endpoint.session)return void console.log("[ROLES] Unable to start builder session, must be authenticated");await z(this.endpoint,this.templateId,!1).then((e=>{this.templateStore=e,this.roleStore=C(this.templateId),this.loading=!1,this.roleStore.onChange("roles",(e=>{var t;console.log("[ROLES] Roles changed",{roles:e}),null===(t=this.rolesUpdated)||void 0===t||t.emit({event:"updated",endpoint:this.endpoint,templateId:this.templateId,roles:e})}))})).catch((e=>console.warn(e)))}catch(s){console.log("[FIELDS] Error with preview session",s),null===(e=this.sdkError)||void 0===e||e.emit(new M(s.message,null===(t=s.response)||void 0===t?void 0:t.status,null===(i=s.response)||void 0===i?void 0:i.data))}}componentDidRender(){N.dynamicDrop(!0),N(".recipient").draggable({listeners:{start:function(e){e.target.classList.add("dragging"),this.el.classList.add("dragging")}.bind(this),move:function(e){const t=+(e.target.getAttribute("dX")||0),i=+(e.target.getAttribute("dY")||0),s=+(e.target.dataset.sequence||0),o=+(e.target.dataset.order||0),l=e.dx+t,a=e.dy+i;e.target.setAttribute("dX",l),e.target.setAttribute("dY",a);const r=e.target.getBoundingClientRect();console.log("w",r.width),e.target.style.transform=`translate(${l+r.width-(o+1)}px, ${a-r.height*s}px)`}.bind(this),end:function(e){e.target.classList.remove("dragging"),this.el.classList.remove("dragging"),e.target.removeAttribute("dX"),e.target.removeAttribute("dY"),e.target.style.transform=null}.bind(this)}}),N(".dropzone").dropzone({overlap:.05,ondrop:async function(e){var t;console.log("dropped",e.target.classList),e.target.classList.remove("active"),S(this.roleStore,e.relatedTarget.dataset.rolename,{sequence:+e.target.dataset.sequence,order:+e.target.dataset.order}),await this.renumberTemplateRoles(),console.log("[ROLES] Updated roles",this.getSortedRoles()),null===(t=this.rolesUpdated)||void 0===t||t.emit({event:"updated",endpoint:this.endpoint,templateId:this.templateId,roles:this.getSortedRoles()})}.bind(this),ondropactivate:e=>{e.target.classList.add("visible")},ondropdeactivate:e=>{e.target.classList.remove("visible")},ondragenter:e=>{e.target.classList.add("active")},ondragleave:e=>{e.target.classList.remove("active")}})}handleCancel(){var e;null===(e=this.exit)||void 0===e||e.emit()}handleSubmit(){var e;null===(e=this.next)||void 0===e||e.emit()}getSortedRoles(){return this.roleStore.state.roles.sort(((e,t)=>e.sequence===t.sequence?e.order-t.order:e.sequence-t.sequence))}getSequenceNumbers(){const e=[];return this.getSortedRoles().forEach((t=>{e.includes(t.sequence)||e.push(t.sequence)})),e.sort(((e,t)=>e-t))}getRoleNames(){return this.getSortedRoles().map((e=>e.name))}getRolesAtSequence(e){return this.roleStore.state.roles.filter((t=>t&&t.sequence===e))}renumberTemplateRoles(){const e=[],t=[];return this.getSequenceNumbers().forEach(((i,s)=>{this.getRolesAtSequence(i).forEach(((i,o)=>{e.includes(i.name)||i.sequence===s+1&&i.order===o+1||(i.sequence=s+1,i.order=o+1,e.push(i.name),t.push(b(this.endpoint,this.templateId,i.name,{sequence:i.sequence,order:i.order})))}))})),Promise.all(t)}getNextRoleName(){let e="",t=Object.keys(this.roleStore.state).length-1;do{t++,e=`Recipient ${t}`}while(!e||this.roleStore.state.roles.some((t=>t&&t.name===e)));return e}callCreateRole(e,t,i){console.log("[ROLES] Will create role",{name:e,sequence:t,order:i}),w(this.endpoint,this.templateId,{template_id:this.templateId,name:e,sequence:t,message:"",order:i,full_name:null,first_name:"",last_name:"",email:"",phone:"",type:"signer",delegator:!1,kba_method:null}).then((async e=>{var t;console.log("[ROLES] Created role",e),this.roleStore.set("roles",[...this.roleStore.state.roles,e]),await this.renumberTemplateRoles(),null===(t=this.rolesUpdated)||void 0===t||t.emit({event:"added",endpoint:this.endpoint,templateId:this.templateId,roles:this.getSortedRoles()})})).catch((e=>{console.log("[ROLES] Error creating role",e)}))}handleAddRole(e,t){e.stopPropagation();const i=this.getRolesAtSequence(t).length+1,s=this.getNextRoleName();this.callCreateRole(s,t,i)}handleAddStep(e,t){e.stopPropagation();const i=this.getNextRoleName();this.callCreateRole(i,t,1)}render(){var e,t,l,a;if(!this.endpoint.session)return i(s,null,i("verdocs-component-error",{message:"You must be authenticated to use this module."}));if(this.loading||!(null===(e=this.templateStore)||void 0===e?void 0:e.state.isLoaded))return console.log("Loading",this.loading,null===(t=this.templateStore)||void 0===t?void 0:t.state.isLoaded),i(s,{class:"loading"},i("verdocs-loader",null));console.log("Rendering roles",this.roleStore.get("roles"));const r=this.getRoleNames(),n=this.getSequenceNumbers();return console.log("Rendering",r,n),i(s,null,i("form",{onSubmit:e=>e.preventDefault(),onClick:e=>e.stopPropagation(),autocomplete:"off"},i("h5",null,"Roles and Workflow"),i("div",{class:"participants"},i("div",{class:"left-line"}),i("div",{class:"row"},i("div",{class:"icon",innerHTML:'<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" fill="#00000089"><path d="M2 12C2 6.48 6.48 2 12 2s10 4.48 10 10-4.48 10-10 10S2 17.52 2 12zm10 6c3.31 0 6-2.69 6-6s-2.69-6-6-6-6 2.69-6 6 2.69 6 6 6z"></path></svg>'}),i("div",{class:"row-roles"},i("div",{class:"sender"},i("span",{class:"label"},"Sender:")," ",te[null===(a=null===(l=this.templateStore)||void 0===l?void 0:l.state)||void 0===a?void 0:a.sender]," ",i("div",{class:"settings-button",innerHTML:ie,onClick:()=>this.showingSenderDialog=!0,"aria-role":"button"})))),i("div",{class:"row add-sequence","data-sequence":0},i("div",{class:"icon",innerHTML:se}),i("div",{class:"row-roles"},i("div",{class:"dropzone","data-sequence":0,"data-order":1},"Add Step"))),n.map((e=>i(o,null,i("div",{class:"row"},i("div",{class:"icon",innerHTML:'<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" fill="#00000089"><path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"></path></svg>'}),i("div",{class:"row-roles"},i("div",{class:"dropzone","data-order":.5,"data-sequence":e}),this.getRolesAtSequence(e).map((t=>{const s=!t.email;return console.log("ras",e,t),i(o,null,s?i("div",{class:"recipient",style:{backgroundColor:h(E(this.roleStore,t.name))},"data-rolename":t.name,"data-sequence":e,"data-order":t.order},i("span",{class:"type-icon",innerHTML:"signer"===t.type?oe:"cc"===t.type?ae:le}),t.name," ",i("div",{class:"settings-button",innerHTML:ie,onClick:()=>this.showingRoleDialog=t.name,"aria-role":"button"})):i("div",{class:"recipient",style:{borderColor:h(E(this.roleStore,t.name))},"data-rolename":t.name,"data-sequence":e,"data-order":t.order},i("span",{class:"type-icon",innerHTML:"signer"===t.type?oe:"cc"===t.type?ae:le}),t.first_name," ",i("div",{class:"settings-button",innerHTML:ie,onClick:()=>this.showingRoleDialog=t.name,"aria-role":"button"})),i("div",{class:"dropzone","data-order":t.order+.5,"data-sequence":e}))})),i("button",{class:"add-role",innerHTML:se,onClick:t=>this.handleAddRole(t,e)}))),n.length>0&&i("div",{class:"row add-sequence","data-sequence":e},i("div",{class:"row-roles"},i("div",{class:"icon",innerHTML:se}),i("div",{class:"dropzone","data-sequence":e+1,"data-order":1},"Add Step")))))),i("div",{class:"row","data-sequence":n.length+1},i("div",{class:"row-roles"},i("div",{class:"icon",innerHTML:se}),i("button",{class:"add-step",innerHTML:se,onClick:e=>this.handleAddStep(e,n.length+1)}))),i("div",{class:"row"},i("div",{class:"icon",innerHTML:'<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" fill="#00000089"><path d="m18 7-1.41-1.41-6.34 6.34 1.41 1.41L18 7zm4.24-1.41L11.66 16.17 7.48 12l-1.41 1.41L11.66 19l12-12-1.42-1.41zM.41 13.41 6 19l1.41-1.41L1.83 12 .41 13.41z"></path></svg>'}),i("div",{class:"row-roles"},i("div",{class:"complete"},"Document Complete")))),r.length<1&&i("div",{class:"empty"},"You must add at least one Role before proceeding.",i("br",null)," Click the ",i("span",{innerHTML:se})," Add button above to get started."),i("div",{class:"buttons"},i("div",{class:"flex-fill"}),i("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:()=>this.handleCancel()}),i("verdocs-button",{label:"OK",size:"small",onClick:()=>this.handleSubmit(),disabled:r.length<1}))),this.showingRoleDialog&&i("verdocs-template-role-properties",{endpoint:this.endpoint,templateId:this.templateId,roleName:this.showingRoleDialog,onClose:()=>{this.showingRoleDialog=null},onDelete:async()=>{var e;this.showingRoleDialog=null,await this.renumberTemplateRoles(),null===(e=this.rolesUpdated)||void 0===e||e.emit({event:"deleted",endpoint:this.endpoint,templateId:this.templateId,roles:this.getSortedRoles()})}}),this.showingSenderDialog&&i("verdocs-template-sender",{endpoint:this.endpoint,templateId:this.templateId,onClose:()=>this.showingSenderDialog=!1}))}get el(){return l(this)}};re.style='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-template-roles{display:block;min-width:400px;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-roles>form{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;background-color:#ffffff;padding:12px}verdocs-template-roles>form h5{font-size:16px;font-weight:bold;color:#46497d;margin:0 0 10px 0}verdocs-template-roles>form .participants{position:relative}verdocs-template-roles>form .left-line{top:32px;left:11px;z-index:1;width:12px;bottom:30px;position:absolute;background:#ffffff;border-left:3px dotted #9b9b9b}verdocs-template-roles>form .row{display:-ms-flexbox;display:flex;-webkit-column-gap:0;-moz-column-gap:0;column-gap:0;min-height:35px;margin-top:0;margin-left:40px;position:relative;-ms-flex-direction:row;flex-direction:row;padding:6px 0 4px 0}verdocs-template-roles>form .row .row-roles{-ms-flex:1;flex:1;gap:10px;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-direction:row;flex-direction:row}verdocs-template-roles>form .row .icon{top:14px;z-index:2;left:-40px;width:24px;height:24px;position:absolute;background:#ffffff}verdocs-template-roles>form .row .sender{height:30px;display:-ms-flexbox;display:flex;font-size:14px;line-height:30px;-ms-flex-align:center;align-items:center;border-radius:30px;-ms-flex-direction:row;flex-direction:row;padding:0 5px 0 15px;border:1px solid #c6c9cc;background-color:#f5f5fa}verdocs-template-roles>form .row .complete{height:30px;display:-ms-flexbox;display:flex;font-size:14px;padding:0 15px;line-height:30px;-ms-flex-direction:row;flex-direction:row;border-radius:30px;background-color:#f5f5fa;border:1px solid #aeb4bf}verdocs-template-roles>form .row .label{font-weight:bold;margin-right:6px;color:#33364b}verdocs-template-roles>form .row .settings-button{display:-ms-flexbox;display:flex;cursor:pointer;margin:0 0 0 9px}verdocs-template-roles>form .row .recipient{height:30px;display:-ms-flexbox;display:flex;font-size:14px;border-radius:30px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;padding:0 5px 0 6px;white-space:nowrap;border:2px solid #aeb4bf}verdocs-template-roles>form .row .recipient .type-icon{width:24px;height:24px;-webkit-transform:scale(0.8);transform:scale(0.8);opacity:0.6;margin:0 12px 0 0}verdocs-template-roles>form .row .recipient.dragging{position:absolute}verdocs-template-roles>form .row .recipient.dragging+.dropzone{display:none !important}verdocs-template-roles>form .row .dropzone{width:14px;height:30px;display:none}verdocs-template-roles>form .row .dropzone svg{fill:#cccccc}verdocs-template-roles>form .row .dropzone.visible{margin:0 7px;display:-ms-flexbox;display:flex;-ms-flex:0 0 14px;flex:0 0 14px}verdocs-template-roles>form .row .dropzone.active{-ms-flex:0 0 120px;flex:0 0 120px;border-radius:30px;background:rgba(101, 77, 203, 0.4980392157);border:1px dashed #654dcb}verdocs-template-roles>form label{display:block;font-size:14px;font-weight:500;margin:0 0 4px 0;color:#5c6575}verdocs-template-roles>form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-template-roles>form input:focus{outline:none}verdocs-template-roles .row.add-sequence{display:none}verdocs-template-roles .add-role{margin:0;padding:0;border:none;opacity:0.5;cursor:pointer;background:none}verdocs-template-roles .add-role:hover{opacity:1}verdocs-template-roles .add-role svg{width:32px;height:32px}verdocs-template-roles .add-step{margin:0;padding:0;border:none;opacity:0.5;cursor:pointer;background:none}verdocs-template-roles .add-step:hover{opacity:1}verdocs-template-roles .add-step svg{width:32px;height:32px}verdocs-template-roles.dragging .add-role{display:none}verdocs-template-roles.dragging form .row .recipient+.dropzone{display:-ms-flexbox;display:flex}verdocs-template-roles.dragging .row.add-sequence{display:-ms-flexbox;display:flex}verdocs-template-roles.dragging .row.add-sequence .dropzone{opacity:0.5;-ms-flex:0 0 120px;flex:0 0 120px;border-radius:30px;-ms-flex-align:center;align-items:center;background:rgba(101, 77, 203, 0.4980392157);-ms-flex-pack:center;justify-content:center;border:1px dashed #654dcb}verdocs-template-roles.dragging .row.add-sequence .dropzone.active{opacity:1}verdocs-template-roles .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-template-roles .empty{font-size:13px;margin-top:15px;margin-bottom:5px}verdocs-template-roles .empty svg{width:16px;height:16px;stroke:#666666;margin-bottom:2px;display:inline-block}verdocs-template-roles ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-roles ::-moz-placeholder{color:#aaaaaa}verdocs-template-roles :-ms-input-placeholder{color:#aaaaaa}verdocs-template-roles ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-roles ::placeholder{color:#aaaaaa}';const ne=class{constructor(i){e(this,i),this.close=t(this,"close",7),this.sdkError=t(this,"sdkError",7),this.templateUpdated=t(this,"templateUpdated",7),this.store=null,this.endpoint=a.getDefault(),this.templateId="",this.dirty=!1,this.personal=!1,this.public=!1}async componentWillLoad(){var e,t,i,s,o,l,a;try{if(this.endpoint.loadSession(),!this.templateId)return void console.log(`[VISIBILITY] Missing required template ID ${this.templateId}`);if(!this.endpoint.session)return void console.log("[VISIBILITY] Unable to start builder session, must be authenticated");this.store=await z(this.endpoint,this.templateId,!1),this.personal=(null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t?void 0:t.is_personal)||!0,this.public=(null===(s=null===(i=this.store)||void 0===i?void 0:i.state)||void 0===s?void 0:s.is_public)||!1,this.dirty=!1}catch(e){console.log("[TEMPLATE VISIBILITY] Error loading template",e),null===(o=this.sdkError)||void 0===o||o.emit(new M(e.message,null===(l=e.response)||void 0===l?void 0:l.status,null===(a=e.response)||void 0===a?void 0:a.data))}}handleCancel(e){var t,i,s,o,l;e.stopPropagation(),this.personal=null===(i=null===(t=this.store)||void 0===t?void 0:t.state)||void 0===i?void 0:i.is_personal,this.public=null===(o=null===(s=this.store)||void 0===s?void 0:s.state)||void 0===o?void 0:o.is_public,this.dirty=!1,null===(l=this.close)||void 0===l||l.emit()}async handleSave(e){var t,i,s;e.stopPropagation(),await x(this.endpoint,this.templateId,{is_personal:this.personal,is_public:this.public}),(null===(t=this.store)||void 0===t?void 0:t.state)&&(this.store.state.is_personal=this.personal,this.store.state.is_public=this.public),this.dirty=!1,null===(i=this.templateUpdated)||void 0===i||i.emit({endpoint:this.endpoint,template:this.store.state,event:"visibility"}),null===(s=this.close)||void 0===s||s.emit()}render(){var e,t;return this.endpoint.session?this.endpoint.session&&(null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t?void 0:t.isLoaded)?i(s,null,i("form",{onSubmit:e=>e.preventDefault(),onClick:e=>e.stopPropagation(),autocomplete:"off"},i("h5",null,"Visibility"),i("div",{class:"input-row"},i("label",{htmlFor:"verdocs-is-shared"},"Shared"),i("verdocs-checkbox",{id:"verdocs-is-shared",name:"is-shared",checked:!this.personal,value:"on",onInput:e=>{this.personal=!e.target.checked,this.dirty=!0}})),i("div",{class:"description"},"Shared templates are visible to other members of your Organization (if any)."),i("div",{class:"input-row"},i("label",{htmlFor:"verdocs-is-public"},"Public"),i("verdocs-checkbox",{id:"verdocs-is-public",name:"is-public",checked:this.public,value:"on",onInput:e=>{this.public=e.target.checked,this.dirty=!0}})),i("div",{class:"description"},"Public templates may appear in results when any other user searches for templates. Note that a template may be both Personal and Public, which may be useful if you want your template to be found via search but not otherwise displayed to other members of your Organization (if any)."),i("div",{class:"buttons"},i("verdocs-button",{size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:e=>this.handleCancel(e)}),i("verdocs-button",{size:"small",label:"Save",disabled:!this.dirty,onClick:e=>this.handleSave(e)})))):i(s,{class:"empty"}):i(s,null,i("verdocs-component-error",{message:"You must be authenticated to use this module."}))}};ne.style='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-template-visibility{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-visibility.loading{min-height:300px;position:relative;display:block}verdocs-template-visibility.empty{display:none}verdocs-template-visibility form{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-template-visibility form .description{font-size:14px;text-align:justify;color:#5c6575}verdocs-template-visibility form h5{font-size:16px;font-weight:bold;color:#4c56cb;margin:0}verdocs-template-visibility form label{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;font-size:16px;font-weight:500;margin:0 0 4px 0;color:#33364b}verdocs-template-visibility form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-template-visibility form input:focus{outline:none}verdocs-template-visibility form .input-row{display:-ms-flexbox;display:flex;margin:20px 0 0 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-template-visibility form .input-row verdocs-text-input{margin:0;display:-ms-flexbox;display:flex;-ms-flex:0 0 40px;flex:0 0 40px}verdocs-template-visibility form .input-row verdocs-text-input input{text-align:center}verdocs-template-visibility form .input-row verdocs-checkbox{-ms-flex:0;flex:0;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}verdocs-template-visibility form .input-row verdocs-checkbox label>input[type=checkbox]+*::before{margin-right:0}verdocs-template-visibility .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:25px;-ms-flex-direction:row;flex-direction:row}verdocs-template-visibility ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-visibility ::-moz-placeholder{color:#aaaaaa}verdocs-template-visibility :-ms-input-placeholder{color:#aaaaaa}verdocs-template-visibility ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-visibility ::placeholder{color:#aaaaaa}';export{F as verdocs_preview,W as verdocs_send,$ as verdocs_template_attachments,Y as verdocs_template_build_tabs,X as verdocs_template_create,J as verdocs_template_fields,ee as verdocs_template_name,re as verdocs_template_roles,ne as verdocs_template_visibility}
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(e,r,t,n){function i(e){return e instanceof t?e:new t((function(r){r(e)}))}return new(t||(t=Promise))((function(t,a){function o(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n["throw"](e))}catch(e){a(e)}}function u(e){e.done?t(e.value):i(e.value).then(o,s)}u((n=n.apply(e,r||[])).next())}))};var __generator=this&&this.__generator||function(e,r){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,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(r){return u([e,r])}}function u(s){if(n)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(t=0)),t)try{if(n=1,i&&(a=s[0]&2?i["return"]:s[0]?i["throw"]||((a=i["return"])&&a.call(i),0):i.next)&&!(a=a.call(i,s[1])).done)return a;if(i=0,a)s=[s[0]&2,a.value];switch(s[0]){case 0:case 1:a=s;break;case 4:t.label++;return{value:s[1],done:false};case 5:t.label++;i=s[1];s=[0];continue;case 7:s=t.ops.pop();t.trys.pop();continue;default:if(!(a=t.trys,a=a.length>0&&a[a.length-1])&&(s[0]===6||s[0]===2)){t=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){t.label=s[1];break}if(s[0]===6&&t.label<a[1]){t.label=a[1];a=s;break}if(a&&t.label<a[2]){t.label=a[2];t.ops.push(s);break}if(a[2])t.ops.pop();t.trys.pop();continue}s=r.call(e,t)}catch(e){s=[6,e];i=0}finally{n=a=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,r,t){if(t||arguments.length===2)for(var n=0,i=r.length,a;n<i;n++){if(a||!(n in r)){if(!a)a=Array.prototype.slice.call(r,0,n);a[n]=r[n]}}return e.concat(a||Array.prototype.slice.call(r))};System.register(["./p-e339ebc4.system.js","@verdocs/js-sdk","./p-0085540e.system.js","./p-f0386b87.system.js","./p-f5064e0c.system.js"],(function(e){"use strict";var r,t,n,i,a,o,s;return{setters:[function(e){r=e.c},function(e){t=e.getTemplate},function(e){n=e.c;i=e.g},function(e){a=e.c;o=e.g},function(e){s=e.u}],execute:function(){var u=this;var c=function(e){var t=(new Date).toISOString();return r({isLoading:true,isLoaded:false,isError:false,error:null,roleNames:[],id:e,name:"",description:"",sender:"creator",profile_id:"",organization_id:"",counter:0,star_counter:0,is_sendable:false,is_personal:true,is_public:false,created_at:t,updated_at:t,last_used_at:t,initial_reminder:0,followup_reminders:0,organization:null,roles:[],data:{},documents:[],fields:[],profile:null,search_key:"",tags:[],pages:[]})};var f={};var l=e("g",(function(e,r){var l=[];for(var d=2;d<arguments.length;d++){l[d-2]=arguments[d]}return __awaiter(u,__spreadArray([e,r],l,true),void 0,(function(e,r,u){var l,d,_,p,v;if(u===void 0){u=false}return __generator(this,(function(h){switch(h.label){case 0:d=false;if(!f[r]){console.debug("[TEMPLATES] No template store found for ID, creating",r);f[r]=c(r);d=true}_=f[r];if(!(d||u))return[3,5];console.debug("[TEMPLATES] Loading template",{templateId:r,created:d,forceReload:u});_.state.isLoading=true;_.state.isLoaded=false;_.state.isError=false;_.state.error=s;h.label=1;case 1:h.trys.push([1,3,,4]);return[4,t(e,r)];case 2:p=h.sent();if(!p.documents&&p.template_documents){p.documents=p.template_documents}(l=p.documents)===null||l===void 0?void 0:l.forEach((function(e){if(!e.order){e.order=0}if(e.page_numbers){e.pages=e.page_numbers}}));console.debug("[TEMPLATES] Got template",p);Object.assign(_.state,p);_.state.isLoaded=true;_.state.isError=false;_.state.error=s;n(p);a(p);return[3,4];case 3:v=h.sent();console.error("[TEMPLATES] Error loading template",v);_.state.isLoaded=false;_.state.isError=true;_.state.error=v;throw v;case 4:_.state.isLoading=false;return[3,6];case 5:i(r);o(r);h.label=6;case 6:return[2,_]}}))}))}))}}}));
1
+ var __awaiter=this&&this.__awaiter||function(e,r,t,n){function i(e){return e instanceof t?e:new t((function(r){r(e)}))}return new(t||(t=Promise))((function(t,a){function o(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n["throw"](e))}catch(e){a(e)}}function u(e){e.done?t(e.value):i(e.value).then(o,s)}u((n=n.apply(e,r||[])).next())}))};var __generator=this&&this.__generator||function(e,r){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,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(r){return u([e,r])}}function u(s){if(n)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(t=0)),t)try{if(n=1,i&&(a=s[0]&2?i["return"]:s[0]?i["throw"]||((a=i["return"])&&a.call(i),0):i.next)&&!(a=a.call(i,s[1])).done)return a;if(i=0,a)s=[s[0]&2,a.value];switch(s[0]){case 0:case 1:a=s;break;case 4:t.label++;return{value:s[1],done:false};case 5:t.label++;i=s[1];s=[0];continue;case 7:s=t.ops.pop();t.trys.pop();continue;default:if(!(a=t.trys,a=a.length>0&&a[a.length-1])&&(s[0]===6||s[0]===2)){t=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){t.label=s[1];break}if(s[0]===6&&t.label<a[1]){t.label=a[1];a=s;break}if(a&&t.label<a[2]){t.label=a[2];t.ops.push(s);break}if(a[2])t.ops.pop();t.trys.pop();continue}s=r.call(e,t)}catch(e){s=[6,e];i=0}finally{n=a=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,r,t){if(t||arguments.length===2)for(var n=0,i=r.length,a;n<i;n++){if(a||!(n in r)){if(!a)a=Array.prototype.slice.call(r,0,n);a[n]=r[n]}}return e.concat(a||Array.prototype.slice.call(r))};System.register(["./p-38778553.system.js","@verdocs/js-sdk","./p-701b9cbd.system.js","./p-a1bff034.system.js","./p-f5064e0c.system.js"],(function(e){"use strict";var r,t,n,i,a,o,s;return{setters:[function(e){r=e.c},function(e){t=e.getTemplate},function(e){n=e.c;i=e.g},function(e){a=e.c;o=e.g},function(e){s=e.u}],execute:function(){var u=this;var c=function(e){var t=(new Date).toISOString();return r({isLoading:true,isLoaded:false,isError:false,error:null,roleNames:[],id:e,name:"",description:"",sender:"creator",profile_id:"",organization_id:"",counter:0,star_counter:0,is_sendable:false,is_personal:true,is_public:false,created_at:t,updated_at:t,last_used_at:t,initial_reminder:0,followup_reminders:0,organization:null,roles:[],data:{},documents:[],fields:[],profile:null,search_key:"",tags:[],pages:[]})};var f={};var l=e("g",(function(e,r){var l=[];for(var d=2;d<arguments.length;d++){l[d-2]=arguments[d]}return __awaiter(u,__spreadArray([e,r],l,true),void 0,(function(e,r,u){var l,d,_,p,v;if(u===void 0){u=false}return __generator(this,(function(h){switch(h.label){case 0:d=false;if(!f[r]){console.debug("[TEMPLATES] No template store found for ID, creating",r);f[r]=c(r);d=true}_=f[r];if(!(d||u))return[3,5];console.debug("[TEMPLATES] Loading template",{templateId:r,created:d,forceReload:u});_.state.isLoading=true;_.state.isLoaded=false;_.state.isError=false;_.state.error=s;h.label=1;case 1:h.trys.push([1,3,,4]);return[4,t(e,r)];case 2:p=h.sent();if(!p.documents&&p.template_documents){p.documents=p.template_documents}(l=p.documents)===null||l===void 0?void 0:l.forEach((function(e){if(!e.order){e.order=0}if(e.page_numbers){e.pages=e.page_numbers}}));console.debug("[TEMPLATES] Got template",p);Object.assign(_.state,p);_.state.isLoaded=true;_.state.isError=false;_.state.error=s;n(p);a(p);return[3,4];case 3:v=h.sent();console.error("[TEMPLATES] Error loading template",v);_.state.isLoaded=false;_.state.isError=true;_.state.error=v;throw v;case 4:_.state.isLoading=false;return[3,6];case 5:i(r);o(r);h.label=6;case 6:return[2,_]}}))}))}))}}}));
@@ -1 +1 @@
1
- import{r as e,h as m,H as a}from"./p-67a42e2b.js";const b=class{constructor(m){e(this,m)}render(){return m(a,{key:"e62911490bdee24308a18ef52651393469dd6e5b"})}};b.style="@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-loader{display:block;position:absolute;top:50%;left:50%;margin-left:-20px;margin-top:-20px;font-size:24px;width:24px;height:24px;border-radius:50%;text-indent:-9999em;-webkit-animation:load5 1.1s infinite ease;animation:verdocs-loader-kf 1.1s infinite ease;-webkit-transform:translateZ(0);-ms-transform:translateZ(0);transform:translateZ(0)}@-webkit-keyframes verdocs-loader-kf{0%,100%{-webkit-box-shadow:0em -2.6em 0em 0em #aaaaaa, 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.3), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.4);box-shadow:0em -2.6em 0em 0em #aaaaaa, 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.3), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.4)}12.5%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.4), 1.8em -1.8em 0 0em #aaaaaa, 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.3);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.4), 1.8em -1.8em 0 0em #aaaaaa, 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.3)}25%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.3), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.4), 2.5em 0em 0 0em #aaaaaa, 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.3), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.4), 2.5em 0em 0 0em #aaaaaa, 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2)}37.5%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.3), 2.5em 0em 0 0em rgba(0, 0, 0, 0.4), 1.75em 1.75em 0 0em #aaaaaa, 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.3), 2.5em 0em 0 0em rgba(0, 0, 0, 0.4), 1.75em 1.75em 0 0em #aaaaaa, 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2)}50%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.3), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.4), 0em 2.5em 0 0em #aaaaaa, -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.3), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.4), 0em 2.5em 0 0em #aaaaaa, -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2)}62.5%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.3), 0em 2.5em 0 0em rgba(0, 0, 0, 0.4), -1.8em 1.8em 0 0em #aaaaaa, -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.3), 0em 2.5em 0 0em rgba(0, 0, 0, 0.4), -1.8em 1.8em 0 0em #aaaaaa, -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2)}75%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.3), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.4), -2.6em 0em 0 0em #aaaaaa, -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.3), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.4), -2.6em 0em 0 0em #aaaaaa, -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2)}87.5%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.3), -2.6em 0em 0 0em rgba(0, 0, 0, 0.4), -1.8em -1.8em 0 0em #aaaaaa;box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.3), -2.6em 0em 0 0em rgba(0, 0, 0, 0.4), -1.8em -1.8em 0 0em #aaaaaa}}@keyframes verdocs-loader-kf{0%,100%{-webkit-box-shadow:0em -2.6em 0em 0em #aaaaaa, 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.3), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.4);box-shadow:0em -2.6em 0em 0em #aaaaaa, 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.3), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.4)}12.5%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.4), 1.8em -1.8em 0 0em #aaaaaa, 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.3);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.4), 1.8em -1.8em 0 0em #aaaaaa, 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.3)}25%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.3), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.4), 2.5em 0em 0 0em #aaaaaa, 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.3), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.4), 2.5em 0em 0 0em #aaaaaa, 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2)}37.5%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.3), 2.5em 0em 0 0em rgba(0, 0, 0, 0.4), 1.75em 1.75em 0 0em #aaaaaa, 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.3), 2.5em 0em 0 0em rgba(0, 0, 0, 0.4), 1.75em 1.75em 0 0em #aaaaaa, 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2)}50%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.3), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.4), 0em 2.5em 0 0em #aaaaaa, -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.3), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.4), 0em 2.5em 0 0em #aaaaaa, -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2)}62.5%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.3), 0em 2.5em 0 0em rgba(0, 0, 0, 0.4), -1.8em 1.8em 0 0em #aaaaaa, -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.3), 0em 2.5em 0 0em rgba(0, 0, 0, 0.4), -1.8em 1.8em 0 0em #aaaaaa, -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2)}75%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.3), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.4), -2.6em 0em 0 0em #aaaaaa, -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.3), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.4), -2.6em 0em 0 0em #aaaaaa, -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2)}87.5%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.3), -2.6em 0em 0 0em rgba(0, 0, 0, 0.4), -1.8em -1.8em 0 0em #aaaaaa;box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.3), -2.6em 0em 0 0em rgba(0, 0, 0, 0.4), -1.8em -1.8em 0 0em #aaaaaa}}";export{b as verdocs_loader}
1
+ import{r as e,h as m,H as a}from"./p-5207d80c.js";const b=class{constructor(m){e(this,m)}render(){return m(a,{key:"e62911490bdee24308a18ef52651393469dd6e5b"})}};b.style="@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-loader{display:block;position:absolute;top:50%;left:50%;margin-left:-20px;margin-top:-20px;font-size:24px;width:24px;height:24px;border-radius:50%;text-indent:-9999em;-webkit-animation:load5 1.1s infinite ease;animation:verdocs-loader-kf 1.1s infinite ease;-webkit-transform:translateZ(0);-ms-transform:translateZ(0);transform:translateZ(0)}@-webkit-keyframes verdocs-loader-kf{0%,100%{-webkit-box-shadow:0em -2.6em 0em 0em #aaaaaa, 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.3), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.4);box-shadow:0em -2.6em 0em 0em #aaaaaa, 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.3), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.4)}12.5%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.4), 1.8em -1.8em 0 0em #aaaaaa, 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.3);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.4), 1.8em -1.8em 0 0em #aaaaaa, 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.3)}25%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.3), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.4), 2.5em 0em 0 0em #aaaaaa, 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.3), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.4), 2.5em 0em 0 0em #aaaaaa, 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2)}37.5%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.3), 2.5em 0em 0 0em rgba(0, 0, 0, 0.4), 1.75em 1.75em 0 0em #aaaaaa, 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.3), 2.5em 0em 0 0em rgba(0, 0, 0, 0.4), 1.75em 1.75em 0 0em #aaaaaa, 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2)}50%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.3), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.4), 0em 2.5em 0 0em #aaaaaa, -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.3), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.4), 0em 2.5em 0 0em #aaaaaa, -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2)}62.5%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.3), 0em 2.5em 0 0em rgba(0, 0, 0, 0.4), -1.8em 1.8em 0 0em #aaaaaa, -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.3), 0em 2.5em 0 0em rgba(0, 0, 0, 0.4), -1.8em 1.8em 0 0em #aaaaaa, -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2)}75%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.3), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.4), -2.6em 0em 0 0em #aaaaaa, -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.3), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.4), -2.6em 0em 0 0em #aaaaaa, -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2)}87.5%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.3), -2.6em 0em 0 0em rgba(0, 0, 0, 0.4), -1.8em -1.8em 0 0em #aaaaaa;box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.3), -2.6em 0em 0 0em rgba(0, 0, 0, 0.4), -1.8em -1.8em 0 0em #aaaaaa}}@keyframes verdocs-loader-kf{0%,100%{-webkit-box-shadow:0em -2.6em 0em 0em #aaaaaa, 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.3), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.4);box-shadow:0em -2.6em 0em 0em #aaaaaa, 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.3), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.4)}12.5%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.4), 1.8em -1.8em 0 0em #aaaaaa, 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.3);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.4), 1.8em -1.8em 0 0em #aaaaaa, 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.3)}25%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.3), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.4), 2.5em 0em 0 0em #aaaaaa, 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.3), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.4), 2.5em 0em 0 0em #aaaaaa, 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2)}37.5%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.3), 2.5em 0em 0 0em rgba(0, 0, 0, 0.4), 1.75em 1.75em 0 0em #aaaaaa, 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.3), 2.5em 0em 0 0em rgba(0, 0, 0, 0.4), 1.75em 1.75em 0 0em #aaaaaa, 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2)}50%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.3), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.4), 0em 2.5em 0 0em #aaaaaa, -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.3), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.4), 0em 2.5em 0 0em #aaaaaa, -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2)}62.5%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.3), 0em 2.5em 0 0em rgba(0, 0, 0, 0.4), -1.8em 1.8em 0 0em #aaaaaa, -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.3), 0em 2.5em 0 0em rgba(0, 0, 0, 0.4), -1.8em 1.8em 0 0em #aaaaaa, -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2)}75%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.3), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.4), -2.6em 0em 0 0em #aaaaaa, -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.3), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.4), -2.6em 0em 0 0em #aaaaaa, -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2)}87.5%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.3), -2.6em 0em 0 0em rgba(0, 0, 0, 0.4), -1.8em -1.8em 0 0em #aaaaaa;box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.3), -2.6em 0em 0 0em rgba(0, 0, 0, 0.4), -1.8em -1.8em 0 0em #aaaaaa}}";export{b as verdocs_loader}
@@ -1 +1 @@
1
- import{r,h as o,H as a}from"./p-67a42e2b.js";const e=class{constructor(o){r(this,o),this.tags=void 0}render(){var r;return o(a,{key:"16a590cac229600625f42680d2743b112358c502"},null===(r=this.tags)||void 0===r?void 0:r.map((r=>o("span",null,r))))}};e.style='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-template-tags{font-family:"Inter", "Barlow", sans-serif}verdocs-template-tags span{margin:0 4px;height:28px;font-size:12px;font-weight:600;padding:5px 12px 7px;border-radius:5px;display:inline-block;-webkit-box-sizing:border-box;box-sizing:border-box;text-transform:uppercase;color:#33364b;border:1px solid #707ae5;background-color:#f5f5fa}';export{e as verdocs_template_tags}
1
+ import{r,h as o,H as a}from"./p-5207d80c.js";const e=class{constructor(o){r(this,o),this.tags=void 0}render(){var r;return o(a,{key:"16a590cac229600625f42680d2743b112358c502"},null===(r=this.tags)||void 0===r?void 0:r.map((r=>o("span",null,r))))}};e.style='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-template-tags{font-family:"Inter", "Barlow", sans-serif}verdocs-template-tags span{margin:0 4px;height:28px;font-size:12px;font-weight:600;padding:5px 12px 7px;border-radius:5px;display:inline-block;-webkit-box-sizing:border-box;box-sizing:border-box;text-transform:uppercase;color:#33364b;border:1px solid #707ae5;background-color:#f5f5fa}';export{e as verdocs_template_tags}
@@ -1 +1 @@
1
- System.register(["./p-e5a426c4.system.js"],(function(n){"use strict";var r,t;return{setters:[function(n){r=n.a;t=n.f}],execute:function(){var e=function(n,r,t){var e=n.get(r);if(!e){n.set(r,[t])}else if(!e.includes(t)){e.push(t)}};var u=function(n,r){var t;return function(){var e=[];for(var u=0;u<arguments.length;u++){e[u]=arguments[u]}if(t){clearTimeout(t)}t=setTimeout((function(){t=0;n.apply(void 0,e)}),r)}};var i=function(n){return!("isConnected"in n)||n.isConnected};var o=u((function(n){for(var r=0,t=n.keys();r<t.length;r++){var e=t[r];n.set(e,n.get(e).filter(i))}}),2e3);var f=function(){if(typeof r!=="function"){return{}}var n=new Map;return{dispose:function(){return n.clear()},get:function(t){var u=r();if(u){e(n,t,u)}},set:function(r){var e=n.get(r);if(e){n.set(r,e.filter(t))}o(n)},reset:function(){n.forEach((function(n){return n.forEach(t)}));o(n)}}};var c=function(n){return typeof n==="function"?n():n};var a=function(n,r){if(r===void 0){r=function(n,r){return n!==r}}var t=c(n);var e=new Map(Object.entries(t!==null&&t!==void 0?t:{}));var u={dispose:[],get:[],set:[],reset:[]};var i=function(){var r;e=new Map(Object.entries((r=c(n))!==null&&r!==void 0?r:{}));u.reset.forEach((function(n){return n()}))};var o=function(){u.dispose.forEach((function(n){return n()}));i()};var f=function(n){u.get.forEach((function(r){return r(n)}));return e.get(n)};var a=function(n,t){var i=e.get(n);if(r(t,i,n)){e.set(n,t);u.set.forEach((function(r){return r(n,t,i)}))}};var s=typeof Proxy==="undefined"?{}:new Proxy(t,{get:function(n,r){return f(r)},ownKeys:function(n){return Array.from(e.keys())},getOwnPropertyDescriptor:function(){return{enumerable:true,configurable:true}},has:function(n,r){return e.has(r)},set:function(n,r,t){a(r,t);return true}});var p=function(n,r){u[n].push(r);return function(){v(u[n],r)}};var d=function(r,t){var e=p("set",(function(n,e){if(n===r){t(e)}}));var u=p("reset",(function(){return t(c(n)[r])}));return function(){e();u()}};var y=function(){var n=[];for(var r=0;r<arguments.length;r++){n[r]=arguments[r]}var t=n.reduce((function(n,r){if(r.set){n.push(p("set",r.set))}if(r.get){n.push(p("get",r.get))}if(r.reset){n.push(p("reset",r.reset))}if(r.dispose){n.push(p("dispose",r.dispose))}return n}),[]);return function(){return t.forEach((function(n){return n()}))}};var g=function(n){var r=e.get(n);u.set.forEach((function(t){return t(n,r,r)}))};return{state:s,get:f,set:a,on:p,onChange:d,use:y,dispose:o,reset:i,forceUpdate:g}};var v=function(n,r){var t=n.indexOf(r);if(t>=0){n[t]=n[n.length-1];n.length--}};var s=n("c",(function(n,r){var t=a(n,r);t.use(f());return t}))}}}));
1
+ System.register(["./p-59073837.system.js"],(function(n){"use strict";var r,t;return{setters:[function(n){r=n.a;t=n.f}],execute:function(){var e=function(n,r,t){var e=n.get(r);if(!e){n.set(r,[t])}else if(!e.includes(t)){e.push(t)}};var u=function(n,r){var t;return function(){var e=[];for(var u=0;u<arguments.length;u++){e[u]=arguments[u]}if(t){clearTimeout(t)}t=setTimeout((function(){t=0;n.apply(void 0,e)}),r)}};var i=function(n){return!("isConnected"in n)||n.isConnected};var o=u((function(n){for(var r=0,t=n.keys();r<t.length;r++){var e=t[r];n.set(e,n.get(e).filter(i))}}),2e3);var f=function(){if(typeof r!=="function"){return{}}var n=new Map;return{dispose:function(){return n.clear()},get:function(t){var u=r();if(u){e(n,t,u)}},set:function(r){var e=n.get(r);if(e){n.set(r,e.filter(t))}o(n)},reset:function(){n.forEach((function(n){return n.forEach(t)}));o(n)}}};var c=function(n){return typeof n==="function"?n():n};var a=function(n,r){if(r===void 0){r=function(n,r){return n!==r}}var t=c(n);var e=new Map(Object.entries(t!==null&&t!==void 0?t:{}));var u={dispose:[],get:[],set:[],reset:[]};var i=function(){var r;e=new Map(Object.entries((r=c(n))!==null&&r!==void 0?r:{}));u.reset.forEach((function(n){return n()}))};var o=function(){u.dispose.forEach((function(n){return n()}));i()};var f=function(n){u.get.forEach((function(r){return r(n)}));return e.get(n)};var a=function(n,t){var i=e.get(n);if(r(t,i,n)){e.set(n,t);u.set.forEach((function(r){return r(n,t,i)}))}};var s=typeof Proxy==="undefined"?{}:new Proxy(t,{get:function(n,r){return f(r)},ownKeys:function(n){return Array.from(e.keys())},getOwnPropertyDescriptor:function(){return{enumerable:true,configurable:true}},has:function(n,r){return e.has(r)},set:function(n,r,t){a(r,t);return true}});var p=function(n,r){u[n].push(r);return function(){v(u[n],r)}};var d=function(r,t){var e=p("set",(function(n,e){if(n===r){t(e)}}));var u=p("reset",(function(){return t(c(n)[r])}));return function(){e();u()}};var y=function(){var n=[];for(var r=0;r<arguments.length;r++){n[r]=arguments[r]}var t=n.reduce((function(n,r){if(r.set){n.push(p("set",r.set))}if(r.get){n.push(p("get",r.get))}if(r.reset){n.push(p("reset",r.reset))}if(r.dispose){n.push(p("dispose",r.dispose))}return n}),[]);return function(){return t.forEach((function(n){return n()}))}};var g=function(n){var r=e.get(n);u.set.forEach((function(t){return t(n,r,r)}))};return{state:s,get:f,set:a,on:p,onChange:d,use:y,dispose:o,reset:i,forceUpdate:g}};var v=function(n,r){var t=n.indexOf(r);if(t>=0){n[t]=n[n.length-1];n.length--}};var s=n("c",(function(n,r){var t=a(n,r);t.use(f());return t}))}}}));
@@ -1 +1 @@
1
- import{r as e,c as i,h as o,H as t,F as s,g as n}from"./p-67a42e2b.js";import{VerdocsEndpoint as l,getEnvelope as a,getDocumentDownloadLink as d,cancelEnvelope as r,userCanCancelEnvelope as c,integerSequence as h}from"@verdocs/js-sdk";import{s as p}from"./p-c86983bc.js";import{S as v}from"./p-fd97809c.js";import"./p-85aa8e05.js";import"./p-251c4106.js";import"./p-edaec1b6.js";const x=class{constructor(o){e(this,o),this.sdkError=i(this,"sdkError",7),this.envelopeUpdated=i(this,"envelopeUpdated",7),this.another=i(this,"another",7),this.view=i(this,"view",7),this.next=i(this,"next",7),this.endpoint=l.getDefault(),this.envelopeId="",this.headerTargetId=null,this.canceling=!1,this.envelope=null,this.roleNames=[],this.showCancelDone=!1}async componentWillLoad(){var e,i,o;if(this.endpoint.loadSession(),this.envelopeId){console.log("[VIEW] Loading envelope...");try{this.envelope=await a(this.endpoint,this.envelopeId),console.log("[VIEW] Loaded envelope",this.envelope),this.roleNames=this.envelope.recipients.map((e=>e.role_name)),setTimeout((async()=>{console.log("[VIEW] Reloading envelope..."),this.envelope=await a(this.endpoint,this.envelopeId),console.log("[VIEW] Reloaded envelope",this.envelope)}),2e3)}catch(t){null===(e=this.sdkError)||void 0===e||e.emit(new v(t.message,null===(i=t.response)||void 0===i?void 0:i.status,null===(o=t.response)||void 0===o?void 0:o.data))}}else console.error("[VIEW] Missing required envelopeId")}componentDidRender(){const e=this.headerTargetId?document.getElementById(this.headerTargetId):null,i=document.getElementById("verdocs-view-header");e&&i&&(console.log("[VIEW] Moving header"),i.remove(),e.append(i))}handlePageRendered(e){console.log("[VIEW] Page rendered",e.detail)}async handleOptionSelected(e){var i,o;switch(e.detail.id){case"cancel":confirm("Are you sure you wish to cancel this envelope? This action cannot be undone.")&&(this.canceling=!0,r(this.endpoint,this.envelopeId).then((e=>(this.canceling=!1,console.log("[VIEW] Envelope canceled",e),a(this.endpoint,this.envelopeId)))).then((e=>{console.log("[VIEW] Loaded new envelope details",e),this.envelope=e})).catch((e=>{var i,o,t;this.canceling=!1,console.log("[VIEW] Error canceling envelope",e),null===(i=this.sdkError)||void 0===i||i.emit(new v(e.message,null===(o=e.response)||void 0===o?void 0:o.status,null===(t=e.response)||void 0===t?void 0:t.data))})),this.showCancelDone=!0,null===(i=this.envelopeUpdated)||void 0===i||i.emit({endpoint:this.endpoint,envelope:this.envelope,event:"canceled"}));break;case"print":window.print(),null===(o=this.envelopeUpdated)||void 0===o||o.emit({endpoint:this.endpoint,envelope:this.envelope,event:"printed"});break;case"download-attachments":{const e=this.envelope.documents.find((e=>"attachment"===e.type));if(e){const i=await d(this.endpoint,this.envelopeId,e.id);window.open(i,"_blank")}}break;case"download-certificate":{const e=this.envelope.documents.find((e=>"certificate"===e.type));if(e){const i=await d(this.endpoint,this.envelopeId,e.id);window.open(i,"_blank")}}break;case"download-all":p(this.endpoint,[this.envelope]).then((()=>{var e;null===(e=this.envelopeUpdated)||void 0===e||e.emit({endpoint:this.endpoint,envelope:this.envelope,event:"downloaded"})})).catch((e=>{console.log("Error downloading Zip",e)}))}}render(){var e;if(!this.envelope)return o(t,null,o("img",{src:"https://verdocs-public-assets.s3.amazonaws.com/loading-placeholder.png",style:{width:"612px",height:"792px",boxShadow:"0 0 10px 5px #0000000f",marginTop:"15px"},alt:"Placeholder page"}));const i=[{id:"print",label:"Print"}];c(this.endpoint.profile,this.envelope)&&i.push({id:"cancel",label:"Cancel"});const n=this.envelope.documents.length>0,l=this.envelope.documents.filter((e=>"attachment"===e.type)).length,a=void 0!==this.envelope.documents.find((e=>"certificate"===e.type));return(n||a)&&(i.push({label:""}),n&&i.push({id:"download-attachments",label:l>1?"Download Documents":"Download Document"}),a&&i.push({id:"download-certificate",label:"Download Certificate"}),n&&a&&i.push({id:"download-all",label:"Download All Files"})),o(t,null,o("div",{id:"verdocs-view-header"},o("div",{class:"inner"},o("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),o("div",{class:"title"},this.envelope.name),o("div",{style:{flex:"1"}}),o("div",{style:{marginLeft:"10px"}}),o("verdocs-dropdown",{options:i,onOptionSelected:e=>this.handleOptionSelected(e)}))),o("div",{class:"document",style:{paddingTop:this.headerTargetId?"70px":"15px"}},((null===(e=this.envelope)||void 0===e?void 0:e.documents)||[]).filter((e=>"certificate"!==e.type)).map((e=>{const i=h(1,e.pages);return o(s,null,i.map((i=>o("verdocs-envelope-document-page",{envelopeId:this.envelopeId,documentId:e.id,endpoint:this.endpoint,type:"filled",virtualWidth:612,virtualHeight:792,pageNumber:i,onPageRendered:e=>this.handlePageRendered(e),layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]}))))}))),this.showCancelDone&&o("verdocs-ok-dialog",{heading:"Cancelled",message:"This envelope has been cancelled successfully.",onNext:()=>{this.showCancelDone=!1}}),this.canceling&&o("div",{class:"loading-indicator"},o("verdocs-loader",null)))}get component(){return n(this)}};x.style='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-view{display:-ms-flexbox;display:flex;overflow:hidden;min-height:600px;position:relative;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-view div,verdocs-view canvas{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-view .document{-ms-flex:1;flex:1;width:100%;height:100%;display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;min-height:200px;max-width:1200px;position:relative;overflow-y:scroll;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column}verdocs-view .document .inner{width:100%;max-width:1028px}verdocs-view .loading-indicator{top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;z-index:10000;position:fixed;background-color:rgba(0, 0, 0, 0.7)}#verdocs-view-header{width:100%;color:#fff;display:-ms-flexbox;display:flex;z-index:1000;-ms-flex:0 0 56px;flex:0 0 56px;padding:0 20px;font-size:12px;-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;-webkit-transition:all 0.25s;transition:all 0.25s;background-color:#33354c;-webkit-box-shadow:0 4px 4px 0 rgba(0, 0, 0, 0.24), 0 0 4px 0 rgba(0, 0, 0, 0.12);box-shadow:0 4px 4px 0 rgba(0, 0, 0, 0.24), 0 0 4px 0 rgba(0, 0, 0, 0.12)}@media all and (max-width: 500px){#verdocs-view-header{padding:0 10px}}#verdocs-view-header .inner{width:100%;display:-ms-flexbox;display:flex;margin:0 auto;padding:0 20px;max-width:1200px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}@media all and (max-width: 500px){#verdocs-view-header .inner{padding:0 10px}}#verdocs-view-header .logo{width:80px;display:none;margin:-6px 0 0 0}#verdocs-view-header .title{font-size:18px;font-weight:500;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}';export{x as verdocs_view}
1
+ import{r as e,c as i,h as o,H as t,F as s,g as n}from"./p-5207d80c.js";import{VerdocsEndpoint as l,getEnvelope as d,getDocumentDownloadLink as a,cancelEnvelope as r,userCanCancelEnvelope as c,integerSequence as h}from"@verdocs/js-sdk";import{s as p}from"./p-1289c3d5.js";import{S as v}from"./p-fd97809c.js";import"./p-85aa8e05.js";import"./p-251c4106.js";import"./p-edaec1b6.js";const x=class{constructor(o){e(this,o),this.sdkError=i(this,"sdkError",7),this.envelopeUpdated=i(this,"envelopeUpdated",7),this.another=i(this,"another",7),this.view=i(this,"view",7),this.next=i(this,"next",7),this.endpoint=l.getDefault(),this.envelopeId="",this.headerTargetId=null,this.canceling=!1,this.envelope=null,this.roleNames=[],this.showCancelDone=!1}async componentWillLoad(){var e,i,o;if(this.endpoint.loadSession(),this.envelopeId){console.log("[VIEW] Loading envelope...");try{this.envelope=await d(this.endpoint,this.envelopeId),console.log("[VIEW] Loaded envelope",this.envelope),this.roleNames=this.envelope.recipients.map((e=>e.role_name)),setTimeout((async()=>{console.log("[VIEW] Reloading envelope..."),this.envelope=await d(this.endpoint,this.envelopeId),console.log("[VIEW] Reloaded envelope",this.envelope)}),2e3)}catch(t){null===(e=this.sdkError)||void 0===e||e.emit(new v(t.message,null===(i=t.response)||void 0===i?void 0:i.status,null===(o=t.response)||void 0===o?void 0:o.data))}}else console.error("[VIEW] Missing required envelopeId")}componentDidRender(){const e=this.headerTargetId?document.getElementById(this.headerTargetId):null,i=document.getElementById("verdocs-view-header");e&&i&&(console.log("[VIEW] Moving header"),i.remove(),e.append(i))}handlePageRendered(e){console.log("[VIEW] Page rendered",e.detail)}async handleOptionSelected(e){var i,o;switch(e.detail.id){case"cancel":confirm("Are you sure you wish to cancel this envelope? This action cannot be undone.")&&(this.canceling=!0,r(this.endpoint,this.envelopeId).then((e=>(this.canceling=!1,console.log("[VIEW] Envelope canceled",e),d(this.endpoint,this.envelopeId)))).then((e=>{console.log("[VIEW] Loaded new envelope details",e),this.envelope=e})).catch((e=>{var i,o,t;this.canceling=!1,console.log("[VIEW] Error canceling envelope",e),null===(i=this.sdkError)||void 0===i||i.emit(new v(e.message,null===(o=e.response)||void 0===o?void 0:o.status,null===(t=e.response)||void 0===t?void 0:t.data))})),this.showCancelDone=!0,null===(i=this.envelopeUpdated)||void 0===i||i.emit({endpoint:this.endpoint,envelope:this.envelope,event:"canceled"}));break;case"print":window.print(),null===(o=this.envelopeUpdated)||void 0===o||o.emit({endpoint:this.endpoint,envelope:this.envelope,event:"printed"});break;case"download-attachments":{const e=this.envelope.documents.find((e=>"attachment"===e.type));if(e){const i=await a(this.endpoint,this.envelopeId,e.id);window.open(i,"_blank")}}break;case"download-certificate":{const e=this.envelope.documents.find((e=>"certificate"===e.type));if(e){const i=await a(this.endpoint,this.envelopeId,e.id);window.open(i,"_blank")}}break;case"download-all":p(this.endpoint,[this.envelope]).then((()=>{var e;null===(e=this.envelopeUpdated)||void 0===e||e.emit({endpoint:this.endpoint,envelope:this.envelope,event:"downloaded"})})).catch((e=>{console.log("Error downloading Zip",e)}))}}render(){var e;if(!this.envelope)return o(t,null,o("img",{src:"https://verdocs-public-assets.s3.amazonaws.com/loading-placeholder.png",style:{width:"612px",height:"792px",boxShadow:"0 0 10px 5px #0000000f",marginTop:"15px"},alt:"Placeholder page"}));const i=[{id:"print",label:"Print"}];c(this.endpoint.profile,this.envelope)&&i.push({id:"cancel",label:"Cancel"});const n=this.envelope.documents.length>0,l=this.envelope.documents.filter((e=>"attachment"===e.type)).length,d=void 0!==this.envelope.documents.find((e=>"certificate"===e.type));return(n||d)&&(i.push({label:""}),n&&i.push({id:"download-attachments",label:l>1?"Download Documents":"Download Document"}),d&&i.push({id:"download-certificate",label:"Download Certificate"}),n&&d&&i.push({id:"download-all",label:"Download All Files"})),o(t,null,o("div",{id:"verdocs-view-header"},o("div",{class:"inner"},o("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),o("div",{class:"title"},this.envelope.name),o("div",{style:{flex:"1"}}),o("div",{style:{marginLeft:"10px"}}),o("verdocs-dropdown",{options:i,onOptionSelected:e=>this.handleOptionSelected(e)}))),o("div",{class:"document",style:{paddingTop:this.headerTargetId?"70px":"15px"}},((null===(e=this.envelope)||void 0===e?void 0:e.documents)||[]).filter((e=>"certificate"!==e.type)).map((e=>{const i=h(1,e.pages);return o(s,null,i.map((i=>o("verdocs-envelope-document-page",{envelopeId:this.envelopeId,documentId:e.id,endpoint:this.endpoint,type:"filled",virtualWidth:612,virtualHeight:792,pageNumber:i,onPageRendered:e=>this.handlePageRendered(e),layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]}))))}))),this.showCancelDone&&o("verdocs-ok-dialog",{heading:"Cancelled",message:"This envelope has been cancelled successfully.",onNext:()=>{this.showCancelDone=!1}}),this.canceling&&o("div",{class:"loading-indicator"},o("verdocs-loader",null)))}get component(){return n(this)}};x.style='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-view{display:-ms-flexbox;display:flex;overflow:hidden;min-height:600px;position:relative;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-view div,verdocs-view canvas{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-view .document{-ms-flex:1;flex:1;width:100%;height:100%;display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;min-height:200px;max-width:1200px;position:relative;overflow-y:scroll;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column}verdocs-view .document .inner{width:100%;max-width:1028px}verdocs-view .loading-indicator{top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;z-index:10000;position:fixed;background-color:rgba(0, 0, 0, 0.7)}#verdocs-view-header{width:100%;color:#fff;display:-ms-flexbox;display:flex;z-index:1000;-ms-flex:0 0 56px;flex:0 0 56px;padding:0 20px;font-size:12px;-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;-webkit-transition:all 0.25s;transition:all 0.25s;background-color:#33354c;-webkit-box-shadow:0 4px 4px 0 rgba(0, 0, 0, 0.24), 0 0 4px 0 rgba(0, 0, 0, 0.12);box-shadow:0 4px 4px 0 rgba(0, 0, 0, 0.24), 0 0 4px 0 rgba(0, 0, 0, 0.12)}@media all and (max-width: 500px){#verdocs-view-header{padding:0 10px}}#verdocs-view-header .inner{width:100%;display:-ms-flexbox;display:flex;margin:0 auto;padding:0 20px;max-width:1200px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}@media all and (max-width: 500px){#verdocs-view-header .inner{padding:0 10px}}#verdocs-view-header .logo{width:80px;display:none;margin:-6px 0 0 0}#verdocs-view-header .title{font-size:18px;font-weight:500;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}';export{x as verdocs_view}