@verdocs/web-sdk 4.0.7 → 4.0.9

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 (283) hide show
  1. package/dist/cjs/index-cfdfab36.js +4 -4
  2. package/dist/cjs/verdocs-button-panel.cjs.entry.js +2 -2
  3. package/dist/cjs/verdocs-button_3.cjs.entry.js +3 -3
  4. package/dist/cjs/verdocs-checkbox_5.cjs.entry.js +2 -2
  5. package/dist/cjs/verdocs-contact-picker_2.cjs.entry.js +1 -1
  6. package/dist/cjs/verdocs-dialog_2.cjs.entry.js +1 -1
  7. package/dist/cjs/verdocs-dropdown.cjs.entry.js +1 -1
  8. package/dist/cjs/verdocs-envelope-document-page.cjs.entry.js +1 -1
  9. package/dist/cjs/verdocs-envelope-sidebar.cjs.entry.js +15 -19280
  10. package/dist/cjs/verdocs-envelopes-list.cjs.entry.js +6 -6
  11. package/dist/cjs/verdocs-field-attachment_14.cjs.entry.js +4 -4
  12. package/dist/cjs/verdocs-file-chooser_2.cjs.entry.js +3 -2
  13. package/dist/cjs/verdocs-kba-dialog.cjs.entry.js +2 -2
  14. package/dist/cjs/verdocs-ok-dialog.cjs.entry.js +1 -1
  15. package/dist/cjs/verdocs-organization-card.cjs.entry.js +19275 -5
  16. package/dist/cjs/verdocs-pagination_2.cjs.entry.js +1 -1
  17. package/dist/cjs/verdocs-preview_10.cjs.entry.js +2 -2
  18. package/dist/cjs/verdocs-quick-functions_2.cjs.entry.js +1 -1
  19. package/dist/cjs/verdocs-radio-button_3.cjs.entry.js +9 -9
  20. package/dist/cjs/verdocs-search-tabs.cjs.entry.js +1 -1
  21. package/dist/cjs/verdocs-search.cjs.entry.js +1 -1
  22. package/dist/cjs/verdocs-spinner.cjs.entry.js +1 -1
  23. package/dist/cjs/verdocs-status-indicator.cjs.entry.js +2 -2
  24. package/dist/cjs/verdocs-template-card.cjs.entry.js +1 -1
  25. package/dist/cjs/verdocs-template-star.cjs.entry.js +1 -1
  26. package/dist/cjs/verdocs-template-tags.cjs.entry.js +1 -1
  27. package/dist/cjs/verdocs-toolbar-icon.cjs.entry.js +1 -1
  28. package/dist/collection/components/controls/verdocs-button/verdocs-button.js +8 -1
  29. package/dist/collection/components/controls/verdocs-button-panel/verdocs-button-panel.js +6 -2
  30. package/dist/collection/components/controls/verdocs-dropdown/verdocs-dropdown.js +17 -1
  31. package/dist/collection/components/controls/verdocs-file-chooser/verdocs-file-chooser.js +5 -1
  32. package/dist/collection/components/controls/verdocs-organization-card/verdocs-organization-card.css +15 -3
  33. package/dist/collection/components/controls/verdocs-organization-card/verdocs-organization-card.js +6 -1
  34. package/dist/collection/components/controls/verdocs-pagination/verdocs-pagination.js +2 -2
  35. package/dist/collection/components/controls/verdocs-portal/verdocs-portal.js +1 -1
  36. package/dist/collection/components/controls/verdocs-progress-bar/verdocs-progress-bar.js +3 -2
  37. package/dist/collection/components/controls/verdocs-radio-button/verdocs-radio-button.js +1 -1
  38. package/dist/collection/components/controls/verdocs-select-input/verdocs-select-input.js +1 -1
  39. package/dist/collection/components/controls/verdocs-spinner/verdocs-spinner.js +1 -1
  40. package/dist/collection/components/controls/verdocs-text-input/verdocs-text-input.js +2 -2
  41. package/dist/collection/components/controls/verdocs-toggle-button/verdocs-toggle-button.js +1 -1
  42. package/dist/collection/components/controls/verdocs-toolbar-icon/verdocs-toolbar-icon.js +1 -1
  43. package/dist/collection/components/dialogs/verdocs-dialog/verdocs-dialog.js +1 -1
  44. package/dist/collection/components/dialogs/verdocs-initial-dialog/verdocs-initial-dialog.js +1 -1
  45. package/dist/collection/components/dialogs/verdocs-kba-dialog/verdocs-kba-dialog.js +2 -2
  46. package/dist/collection/components/dialogs/verdocs-ok-dialog/verdocs-ok-dialog.js +1 -1
  47. package/dist/collection/components/dialogs/verdocs-signature-dialog/verdocs-signature-dialog.js +1 -1
  48. package/dist/collection/components/dialogs/verdocs-upload-dialog/verdocs-upload-dialog.js +1 -1
  49. package/dist/collection/components/elements/verdocs-quick-functions/verdocs-quick-functions.js +1 -1
  50. package/dist/collection/components/elements/verdocs-search-tabs/verdocs-search-tabs.js +1 -1
  51. package/dist/collection/components/embeds/verdocs-search/verdocs-search.js +1 -1
  52. package/dist/collection/components/embeds/verdocs-send/verdocs-send.js +2 -2
  53. package/dist/collection/components/envelopes/verdocs-envelope-document-page/verdocs-envelope-document-page.js +1 -1
  54. package/dist/collection/components/envelopes/verdocs-envelopes-list/verdocs-envelopes-list.js +6 -6
  55. package/dist/collection/components/envelopes/verdocs-status-indicator/verdocs-status-indicator.js +2 -2
  56. package/dist/collection/components/templates/verdocs-template-card/verdocs-template-card.js +1 -1
  57. package/dist/collection/components/templates/verdocs-template-document-page/verdocs-template-document-page.js +1 -1
  58. package/dist/collection/components/templates/verdocs-template-role-properties/verdocs-template-role-properties.js +7 -7
  59. package/dist/collection/components/templates/verdocs-template-sender/verdocs-template-sender.js +1 -1
  60. package/dist/collection/components/templates/verdocs-template-star/verdocs-template-star.js +1 -1
  61. package/dist/collection/components/templates/verdocs-template-tags/verdocs-template-tags.js +1 -1
  62. package/dist/components/EnvelopeStore.js +1 -1
  63. package/dist/components/TemplateFieldStore.js +2 -2
  64. package/dist/components/TemplateRoleStore.js +1 -1
  65. package/dist/components/TemplateStore.js +2 -2
  66. package/dist/components/Types.js +1 -1
  67. package/dist/components/index.d.ts +12 -0
  68. package/dist/components/index.js +171 -0
  69. package/dist/components/index2.js +2 -193
  70. package/dist/components/index4.js +193 -2
  71. package/dist/components/utils.js +3 -3
  72. package/dist/components/verdocs-activity-box.js +0 -1
  73. package/dist/components/verdocs-auth.js +0 -1
  74. package/dist/components/verdocs-build.js +0 -1
  75. package/dist/components/verdocs-button-panel.js +2 -3
  76. package/dist/components/verdocs-button2.js +1 -2
  77. package/dist/components/verdocs-checkbox2.js +0 -1
  78. package/dist/components/verdocs-component-error2.js +0 -1
  79. package/dist/components/verdocs-contact-picker2.js +0 -1
  80. package/dist/components/verdocs-dialog2.js +1 -2
  81. package/dist/components/verdocs-dropdown2.js +1 -2
  82. package/dist/components/verdocs-envelope-document-page2.js +1 -2
  83. package/dist/components/verdocs-envelope-recipient-link2.js +0 -1
  84. package/dist/components/verdocs-envelope-recipient-summary2.js +0 -1
  85. package/dist/components/verdocs-envelope-sidebar.js +2 -3
  86. package/dist/components/verdocs-envelopes-list.js +6 -7
  87. package/dist/components/verdocs-field-attachment2.js +0 -1
  88. package/dist/components/verdocs-field-checkbox2.js +1 -2
  89. package/dist/components/verdocs-field-date2.js +3 -4
  90. package/dist/components/verdocs-field-dropdown2.js +1 -2
  91. package/dist/components/verdocs-field-initial2.js +1 -2
  92. package/dist/components/verdocs-field-payment.js +0 -1
  93. package/dist/components/verdocs-field-radio-button2.js +1 -2
  94. package/dist/components/verdocs-field-signature2.js +1 -2
  95. package/dist/components/verdocs-field-textarea2.js +1 -2
  96. package/dist/components/verdocs-field-textbox2.js +1 -2
  97. package/dist/components/verdocs-field-timestamp2.js +3 -4
  98. package/dist/components/verdocs-file-chooser2.js +1 -2
  99. package/dist/components/verdocs-floating-menu.js +0 -1
  100. package/dist/components/verdocs-help-icon2.js +0 -1
  101. package/dist/components/verdocs-initial-dialog2.js +1 -2
  102. package/dist/components/verdocs-kba-dialog.js +2 -3
  103. package/dist/components/verdocs-loader2.js +0 -1
  104. package/dist/components/verdocs-ok-dialog2.js +1 -2
  105. package/dist/components/verdocs-organization-card.js +8 -4
  106. package/dist/components/verdocs-pagination2.js +1 -2
  107. package/dist/components/verdocs-portal2.js +1 -2
  108. package/dist/components/verdocs-preview2.js +0 -1
  109. package/dist/components/verdocs-progress-bar2.js +2 -2
  110. package/dist/components/verdocs-quick-filter2.js +1 -2
  111. package/dist/components/verdocs-quick-functions2.js +1 -2
  112. package/dist/components/verdocs-radio-button2.js +1 -2
  113. package/dist/components/verdocs-search-box2.js +0 -1
  114. package/dist/components/verdocs-search-tabs.js +1 -2
  115. package/dist/components/verdocs-search.js +1 -2
  116. package/dist/components/verdocs-select-input2.js +1 -2
  117. package/dist/components/verdocs-send2.js +2 -3
  118. package/dist/components/verdocs-settings-api-keys2.js +0 -1
  119. package/dist/components/verdocs-settings-members2.js +1 -2
  120. package/dist/components/verdocs-settings-organization2.js +0 -1
  121. package/dist/components/verdocs-settings-profile2.js +0 -1
  122. package/dist/components/verdocs-settings.js +0 -1
  123. package/dist/components/verdocs-sign.js +2 -3
  124. package/dist/components/verdocs-signature-dialog2.js +1 -2
  125. package/dist/components/verdocs-spinner2.js +1 -2
  126. package/dist/components/verdocs-status-indicator2.js +2 -3
  127. package/dist/components/verdocs-table2.js +0 -1
  128. package/dist/components/verdocs-tabs2.js +0 -1
  129. package/dist/components/verdocs-template-attachments2.js +0 -1
  130. package/dist/components/verdocs-template-build-tabs2.js +0 -1
  131. package/dist/components/verdocs-template-card.js +1 -2
  132. package/dist/components/verdocs-template-create2.js +0 -1
  133. package/dist/components/verdocs-template-document-page2.js +2 -3
  134. package/dist/components/verdocs-template-field-properties2.js +0 -1
  135. package/dist/components/verdocs-template-fields2.js +1 -2
  136. package/dist/components/verdocs-template-name2.js +0 -1
  137. package/dist/components/verdocs-template-reminders2.js +0 -1
  138. package/dist/components/verdocs-template-role-properties2.js +7 -8
  139. package/dist/components/verdocs-template-roles2.js +0 -1
  140. package/dist/components/verdocs-template-sender2.js +1 -2
  141. package/dist/components/verdocs-template-star2.js +1 -2
  142. package/dist/components/verdocs-template-tags.js +1 -2
  143. package/dist/components/verdocs-template-visibility2.js +0 -1
  144. package/dist/components/verdocs-templates-list.js +1 -2
  145. package/dist/components/verdocs-text-input2.js +2 -3
  146. package/dist/components/verdocs-toggle-button2.js +1 -2
  147. package/dist/components/verdocs-toggle.js +0 -1
  148. package/dist/components/verdocs-toolbar-icon2.js +1 -2
  149. package/dist/components/verdocs-upload-dialog2.js +1 -2
  150. package/dist/components/verdocs-view2.js +0 -1
  151. package/dist/custom-elements.json +2134 -0
  152. package/dist/esm/index-b89cf6a4.js +4 -4
  153. package/dist/esm/verdocs-button-panel.entry.js +2 -2
  154. package/dist/esm/verdocs-button_3.entry.js +3 -3
  155. package/dist/esm/verdocs-checkbox_5.entry.js +2 -2
  156. package/dist/esm/verdocs-contact-picker_2.entry.js +1 -1
  157. package/dist/esm/verdocs-dialog_2.entry.js +1 -1
  158. package/dist/esm/verdocs-dropdown.entry.js +1 -1
  159. package/dist/esm/verdocs-envelope-document-page.entry.js +1 -1
  160. package/dist/esm/verdocs-envelope-sidebar.entry.js +1 -19266
  161. package/dist/esm/verdocs-envelopes-list.entry.js +6 -6
  162. package/dist/esm/verdocs-field-attachment_14.entry.js +4 -4
  163. package/dist/esm/verdocs-file-chooser_2.entry.js +3 -2
  164. package/dist/esm/verdocs-kba-dialog.entry.js +2 -2
  165. package/dist/esm/verdocs-ok-dialog.entry.js +1 -1
  166. package/dist/esm/verdocs-organization-card.entry.js +19272 -2
  167. package/dist/esm/verdocs-pagination_2.entry.js +1 -1
  168. package/dist/esm/verdocs-preview_10.entry.js +2 -2
  169. package/dist/esm/verdocs-quick-functions_2.entry.js +1 -1
  170. package/dist/esm/verdocs-radio-button_3.entry.js +9 -9
  171. package/dist/esm/verdocs-search-tabs.entry.js +1 -1
  172. package/dist/esm/verdocs-search.entry.js +1 -1
  173. package/dist/esm/verdocs-spinner.entry.js +1 -1
  174. package/dist/esm/verdocs-status-indicator.entry.js +2 -2
  175. package/dist/esm/verdocs-template-card.entry.js +1 -1
  176. package/dist/esm/verdocs-template-star.entry.js +1 -1
  177. package/dist/esm/verdocs-template-tags.entry.js +1 -1
  178. package/dist/esm/verdocs-toolbar-icon.entry.js +1 -1
  179. package/dist/esm-es5/index-b89cf6a4.js +1 -1
  180. package/dist/esm-es5/verdocs-button-panel.entry.js +1 -1
  181. package/dist/esm-es5/verdocs-button_3.entry.js +1 -1
  182. package/dist/esm-es5/verdocs-checkbox_5.entry.js +1 -1
  183. package/dist/esm-es5/verdocs-contact-picker_2.entry.js +1 -1
  184. package/dist/esm-es5/verdocs-dialog_2.entry.js +1 -1
  185. package/dist/esm-es5/verdocs-dropdown.entry.js +1 -1
  186. package/dist/esm-es5/verdocs-envelope-document-page.entry.js +1 -1
  187. package/dist/esm-es5/verdocs-envelope-sidebar.entry.js +1 -1
  188. package/dist/esm-es5/verdocs-envelopes-list.entry.js +1 -1
  189. package/dist/esm-es5/verdocs-field-attachment_14.entry.js +1 -1
  190. package/dist/esm-es5/verdocs-file-chooser_2.entry.js +1 -1
  191. package/dist/esm-es5/verdocs-kba-dialog.entry.js +1 -1
  192. package/dist/esm-es5/verdocs-ok-dialog.entry.js +1 -1
  193. package/dist/esm-es5/verdocs-organization-card.entry.js +1 -1
  194. package/dist/esm-es5/verdocs-pagination_2.entry.js +1 -1
  195. package/dist/esm-es5/verdocs-preview_10.entry.js +1 -1
  196. package/dist/esm-es5/verdocs-quick-functions_2.entry.js +1 -1
  197. package/dist/esm-es5/verdocs-radio-button_3.entry.js +1 -1
  198. package/dist/esm-es5/verdocs-search-tabs.entry.js +1 -1
  199. package/dist/esm-es5/verdocs-search.entry.js +1 -1
  200. package/dist/esm-es5/verdocs-spinner.entry.js +1 -1
  201. package/dist/esm-es5/verdocs-status-indicator.entry.js +1 -1
  202. package/dist/esm-es5/verdocs-template-card.entry.js +1 -1
  203. package/dist/esm-es5/verdocs-template-star.entry.js +1 -1
  204. package/dist/esm-es5/verdocs-template-tags.entry.js +1 -1
  205. package/dist/esm-es5/verdocs-toolbar-icon.entry.js +1 -1
  206. package/{loader → dist/loader}/cdn.js +1 -1
  207. package/{loader → dist/loader}/index.cjs.js +1 -1
  208. package/{loader → dist/loader}/index.d.ts +1 -1
  209. package/dist/loader/index.es2017.js +2 -0
  210. package/{loader → dist/loader}/index.js +2 -2
  211. package/dist/types/components/controls/verdocs-button/verdocs-button.d.ts +7 -0
  212. package/dist/types/components/controls/verdocs-button-panel/verdocs-button-panel.d.ts +4 -0
  213. package/dist/types/components/controls/verdocs-dropdown/verdocs-dropdown.d.ts +16 -0
  214. package/dist/types/components/controls/verdocs-file-chooser/verdocs-file-chooser.d.ts +4 -0
  215. package/dist/types/components/controls/verdocs-pagination/verdocs-pagination.d.ts +1 -1
  216. package/dist/types/components/controls/verdocs-progress-bar/verdocs-progress-bar.d.ts +1 -1
  217. package/dist/types/components.d.ts +124 -8
  218. package/dist/verdocs-web-sdk/{p-b355111d.entry.js → p-0003dac3.entry.js} +1 -1
  219. package/dist/verdocs-web-sdk/{p-fa51066b.entry.js → p-039c572c.entry.js} +1 -1
  220. package/dist/verdocs-web-sdk/p-0ac52131.system.entry.js +1 -0
  221. package/dist/verdocs-web-sdk/{p-3ae988e6.entry.js → p-0bd91b17.entry.js} +1 -1
  222. package/dist/verdocs-web-sdk/{p-e26e9907.system.entry.js → p-164d9eb4.system.entry.js} +1 -1
  223. package/dist/verdocs-web-sdk/{p-fb3afee2.system.entry.js → p-165bbc34.system.entry.js} +1 -1
  224. package/dist/verdocs-web-sdk/{p-b661c95f.system.entry.js → p-192fe783.system.entry.js} +1 -1
  225. package/dist/verdocs-web-sdk/{p-9f7a6ff6.entry.js → p-216757ff.entry.js} +1 -1
  226. package/dist/verdocs-web-sdk/p-322fa613.system.js +1 -1
  227. package/dist/verdocs-web-sdk/{p-a396eee6.entry.js → p-3c3570cc.entry.js} +1 -1
  228. package/dist/verdocs-web-sdk/{p-5bc622c5.entry.js → p-50035423.entry.js} +1 -1
  229. package/dist/verdocs-web-sdk/{p-0191eac7.system.entry.js → p-5714caa0.system.entry.js} +1 -1
  230. package/dist/verdocs-web-sdk/{p-ba19b1d8.system.entry.js → p-5727dd92.system.entry.js} +1 -1
  231. package/dist/verdocs-web-sdk/{p-0f5dc1c5.system.entry.js → p-5f8341f5.system.entry.js} +1 -1
  232. package/dist/verdocs-web-sdk/{p-eeece233.entry.js → p-65d71829.entry.js} +1 -1
  233. package/dist/verdocs-web-sdk/{p-dee3aeec.entry.js → p-6a88d98b.entry.js} +1 -1
  234. package/dist/verdocs-web-sdk/{p-9746816b.system.entry.js → p-6cd31085.system.entry.js} +1 -1
  235. package/dist/verdocs-web-sdk/{p-32e396c5.system.entry.js → p-6f1df8e8.system.entry.js} +1 -1
  236. package/dist/verdocs-web-sdk/{p-3415ddee.system.entry.js → p-71a93045.system.entry.js} +1 -1
  237. package/dist/verdocs-web-sdk/p-756791df.system.entry.js +1 -0
  238. package/dist/verdocs-web-sdk/{p-503072b6.entry.js → p-780c095e.entry.js} +1 -1
  239. package/dist/verdocs-web-sdk/{p-832bc1b5.entry.js → p-79407dd8.entry.js} +1 -1
  240. package/dist/verdocs-web-sdk/{p-7602d431.entry.js → p-794109d4.entry.js} +1 -1
  241. package/dist/verdocs-web-sdk/{p-846ee5dd.entry.js → p-79a5e9a6.entry.js} +1 -1
  242. package/dist/verdocs-web-sdk/{p-75f98b48.system.entry.js → p-79cef953.system.entry.js} +1 -1
  243. package/dist/verdocs-web-sdk/{p-1e6cecc0.entry.js → p-7a9b4f83.entry.js} +1 -1
  244. package/dist/verdocs-web-sdk/{p-854a3caa.entry.js → p-7ab60efa.entry.js} +1 -1
  245. package/dist/verdocs-web-sdk/{p-bd9f7023.system.entry.js → p-819187c7.system.entry.js} +1 -1
  246. package/dist/verdocs-web-sdk/p-819fb18d.entry.js +1 -0
  247. package/dist/verdocs-web-sdk/{p-b12f1302.entry.js → p-82fbf5b5.entry.js} +1 -1
  248. package/dist/verdocs-web-sdk/p-83d0f5e1.entry.js +1 -0
  249. package/dist/verdocs-web-sdk/{p-c327f3e6.system.entry.js → p-8b5d40b6.system.entry.js} +1 -1
  250. package/dist/verdocs-web-sdk/{p-2cc1724f.entry.js → p-8fbf27ec.entry.js} +1 -1
  251. package/dist/verdocs-web-sdk/p-907bf2f3.entry.js +1 -0
  252. package/dist/verdocs-web-sdk/{p-3d9d0c2e.system.entry.js → p-943c7b8f.system.entry.js} +1 -1
  253. package/dist/verdocs-web-sdk/{p-7a708333.system.entry.js → p-95e2ff59.system.entry.js} +1 -1
  254. package/dist/verdocs-web-sdk/{p-0017dee2.system.entry.js → p-99c29b9c.system.entry.js} +1 -1
  255. package/dist/verdocs-web-sdk/{p-0664e011.system.entry.js → p-a164376d.system.entry.js} +1 -1
  256. package/dist/verdocs-web-sdk/{p-e504ebcd.entry.js → p-a88760cd.entry.js} +1 -1
  257. package/dist/verdocs-web-sdk/{p-7db995b0.system.entry.js → p-aaa5c11a.system.entry.js} +1 -1
  258. package/dist/verdocs-web-sdk/{p-bca3887c.system.entry.js → p-ac014bc9.system.entry.js} +1 -1
  259. package/dist/verdocs-web-sdk/{p-9a780e51.system.entry.js → p-ae6a23ba.system.entry.js} +1 -1
  260. package/dist/verdocs-web-sdk/{p-c3abfbb5.system.entry.js → p-b259c449.system.entry.js} +1 -1
  261. package/dist/verdocs-web-sdk/{p-8eed20fe.entry.js → p-c244e090.entry.js} +1 -1
  262. package/dist/verdocs-web-sdk/{p-235d82f0.system.entry.js → p-c6645da7.system.entry.js} +1 -1
  263. package/dist/verdocs-web-sdk/{p-8a0fd8b4.system.entry.js → p-ca71117e.system.entry.js} +1 -1
  264. package/dist/verdocs-web-sdk/{p-fd064f80.entry.js → p-cdb8b832.entry.js} +1 -1
  265. package/dist/verdocs-web-sdk/{p-656ba4ba.system.entry.js → p-da9d0886.system.entry.js} +1 -1
  266. package/dist/verdocs-web-sdk/p-db6a7e39.entry.js +1 -0
  267. package/dist/verdocs-web-sdk/p-db9ef2cc.entry.js +1 -0
  268. package/dist/verdocs-web-sdk/{p-0f12fb66.entry.js → p-ea798c11.entry.js} +1 -1
  269. package/dist/verdocs-web-sdk/{p-817b0210.entry.js → p-eb86419b.entry.js} +1 -1
  270. package/dist/verdocs-web-sdk/{p-bf31565b.system.entry.js → p-ecfe6d7e.system.entry.js} +1 -1
  271. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  272. package/package.json +7 -6
  273. package/dist/docs.d.ts +0 -435
  274. package/dist/docs.json +0 -15193
  275. package/dist/verdocs-web-sdk/p-294fd56c.entry.js +0 -1
  276. package/dist/verdocs-web-sdk/p-5cc3dcb2.entry.js +0 -1
  277. package/dist/verdocs-web-sdk/p-69ea5cb9.system.entry.js +0 -1
  278. package/dist/verdocs-web-sdk/p-77fe89f5.system.entry.js +0 -1
  279. package/dist/verdocs-web-sdk/p-b952113a.entry.js +0 -1
  280. package/dist/verdocs-web-sdk/p-c7d2e9c4.entry.js +0 -1
  281. package/dist/verdocs-web-sdk/p-ed863acf.entry.js +0 -1
  282. package/loader/index.es2017.js +0 -2
  283. /package/{loader → dist/loader}/package.json +0 -0
@@ -1 +1 @@
1
- var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var t,i=1,o=arguments.length;i<o;i++){t=arguments[i];for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r))e[r]=t[r]}return e};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(e,t,i,o){function r(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,s){function n(e){try{a(o.next(e))}catch(e){s(e)}}function l(e){try{a(o["throw"](e))}catch(e){s(e)}}function a(e){e.done?i(e.value):r(e.value).then(n,l)}a((o=o.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var i={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},o,r,s,n;return n={next:l(0),throw:l(1),return:l(2)},typeof Symbol==="function"&&(n[Symbol.iterator]=function(){return this}),n;function l(e){return function(t){return a([e,t])}}function a(l){if(o)throw new TypeError("Generator is already executing.");while(n&&(n=0,l[0]&&(i=0)),i)try{if(o=1,r&&(s=l[0]&2?r["return"]:l[0]?r["throw"]||((s=r["return"])&&s.call(r),0):r.next)&&!(s=s.call(r,l[1])).done)return s;if(r=0,s)l=[l[0]&2,s.value];switch(l[0]){case 0:case 1:s=l;break;case 4:i.label++;return{value:l[1],done:false};case 5:i.label++;r=l[1];l=[0];continue;case 7:l=i.ops.pop();i.trys.pop();continue;default:if(!(s=i.trys,s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){i=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){i.label=l[1];break}if(l[0]===6&&i.label<s[1]){i.label=s[1];s=l;break}if(s&&i.label<s[2]){i.label=s[2];i.ops.push(l);break}if(s[2])i.ops.pop();i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e];r=0}finally{o=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,i){if(i||arguments.length===2)for(var o=0,r=t.length,s;o<r;o++){if(s||!(o in t)){if(!s)s=Array.prototype.slice.call(t,0,o);s[o]=t[o]}}return e.concat(s||Array.prototype.slice.call(t))};System.register(["./p-e748b2d2.system.js","@verdocs/js-sdk","./p-98f14855.system.js","./p-a1f6189b.system.js","./p-6a82e278.system.js","./p-94c638b9.system.js","./p-c8a15cb7.system.js","./p-cd546dbe.system.js","./p-6d1bdae8.system.js","./p-7ce23c90.system.js","./p-f7620900.system.js","./p-952b88fb.system.js","./p-1a180595.system.js","./p-f24d887c.system.js"],(function(e){"use strict";var t,i,o,r,s,n,l,a,d,c,u,p,v,h,f,m,g,b,x,w,y,k,_,E,C,q,z,S,M,L,H,I,Z,T,V,R,A,D,U,N,j,B,O,P,F,Q,Y;return{setters:[function(e){t=e.r;i=e.c;o=e.h;r=e.H;s=e.F;n=e.g},function(e){l=e.VerdocsEndpoint;a=e.integerSequence;d=e.createEnvelope;c=e.isValidEmail;u=e.isValidPhone;p=e.getRGBA;v=e.createTemplateDocument;h=e.deleteTemplateDocument;f=e.createTemplatev2;m=e.updateField;g=e.createField;b=e.updateTemplate;x=e.createTemplateReminder;w=e.updateTemplateReminder;y=e.deleteTemplateReminder;k=e.updateTemplateRole;_=e.createTemplateRole},function(e){E=e.g;C=e.u},function(e){q=e.g;z=e.b;S=e.a;M=e.u},function(e){L=e.g},function(e){H=e.r;I=e.b;Z=e.c;T=e.g;V=e.d;R=e.e;A=e.f},function(e){D=e.S},function(e){U=e.D;N=e.P;j=e.J;B=e.a;O=e.F;P=e.b;F=e.T},function(e){Q=e.i},function(e){Y=e.V},function(){},function(){},function(){},function(){}],execute:function(){var W='@-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}';var X=W;var G=e("verdocs_preview",function(){function e(e){t(this,e);this.sdkError=i(this,"sdkError",7);this.templateStore=null;this.fieldStore=null;this.roleStore=null;this.endpoint=l.getDefault();this.templateId=null;this.loading=true}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i;var o=this;return __generator(this,(function(r){try{this.endpoint.loadSession();if(!this.templateId){console.log("[PREVIEW] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[PREVIEW] Unable to start builder session, must be authenticated");return[2]}L(this.endpoint,this.templateId,true).then((function(e){o.templateStore=e;console.log("[PREVIEW] Loaded Template Store",e.state);o.fieldStore=E(o.templateId);o.roleStore=q(o.templateId);console.log("[PREVIEW] Loaded template",o.templateStore.state,o.roleStore.get("roles"),o.fieldStore.get("fields"));o.loading=false})).catch((function(e){console.log(e)}))}catch(o){console.log("[PREVIEW] Error with preview session",o);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new D(o.message,(t=o.response)===null||t===void 0?void 0:t.status,(i=o.response)===null||i===void 0?void 0:i.data))}return[2]}))}))};e.prototype.handlePageRendered=function(e){var t,i;var o=e.detail;var r=(i=(t=this.templateStore)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.fields.filter((function(e){return e.page===o.pageNumber}));console.log("[PREVIEW] Page rendered",o,r);r.forEach((function(e){return H(e,o,{disabled:true,editable:false,draggable:false})}))};e.prototype.render=function(){var e=this;var t,i;if(this.loading){return o(r,null,o("verdocs-loader",null))}return o(r,null,(((i=(t=this.templateStore)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.documents)||[]).map((function(t){var i=a(1,t.pages);return o(s,null,i.map((function(i){return o("verdocs-template-document-page",{templateId:t.template_id,documentId:t.id,pageNumber:i,disabled:true,editable:true,done:false,virtualWidth:612,virtualHeight:792,onPageRendered:function(t){return e.handlePageRendered(t)},layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})})))})))};return e}());G.style=X;var K='@-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;display:none}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)}';var J=K;var $='<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>';var ee='<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>';var te='<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>';var ie='<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>';var oe=e("verdocs_send",function(){function e(e){t(this,e);this.sendingEnvelope=i(this,"sendingEnvelope",7);this.send=i(this,"send",7);this.exit=i(this,"exit",7);this.sdkError=i(this,"sdkError",7);this.searchContacts=i(this,"searchContacts",7);this.levels=[];this.templateStore=null;this.roleStore=null;this.endpoint=l.getDefault();this.templateId=null;this.environment="web";this.containerId="verdocs-send-".concat(Math.random().toString(36).substring(2,11));this.rolesAtLevel={};this.showPickerForId="";this.sessionContacts=[];this.sending=false;this.rolesCompleted={}}e.prototype.reset=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.rolesCompleted={};return[2]}))}))};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,o,r,s,n,l,a,d;var c=this;return __generator(this,(function(u){switch(u.label){case 0:u.trys.push([0,2,,3]);n=this.endpoint.loadSession();if(!this.templateId){console.log("[SEND] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[SEND] Unable to start builder session, must be authenticated");return[2]}l=this;return[4,L(this.endpoint,this.templateId,false)];case 1:l.templateStore=u.sent();this.roleStore=q(this.templateId);if(!((t=(e=this.templateStore)===null||e===void 0?void 0:e.state)===null||t===void 0?void 0:t.is_sendable)){console.warn("[SEND] Template is not sendable",this.templateId)}if(this.roleStore.get("roles")){a={};this.rolesCompleted={};this.roleStore.get("roles").forEach((function(e){var t=e.sequence-1;a[t]||(a[t]=[]);var i="r-".concat(t,"-").concat(a[t].length);a[t].push(__assign(__assign({},e),{id:i}));if(e.full_name&&(e.email||e.phone)){c.rolesCompleted[i]=__assign(__assign({},e),{id:i})}}));this.rolesAtLevel=a;this.levels=Object.keys(a).map((function(e){return+e}));this.levels.sort((function(e,t){return e-t}))}if((i=n===null||n===void 0?void 0:n.session)===null||i===void 0?void 0:i.profile){this.sessionContacts.push({id:n.session.profile.id,name:"".concat(n.session.profile.first_name," ").concat(n.session.profile.last_name),email:n.session.profile.email,phone:n.session.profile.phone})}return[3,3];case 2:d=u.sent();console.log("[SEND] Error with preview session",d);(o=this.sdkError)===null||o===void 0?void 0:o.emit(new D(d.message,(r=d.response)===null||r===void 0?void 0:r.status,(s=d.response)===null||s===void 0?void 0:s.data));return[3,3];case 3:return[2]}}))}))};e.prototype.getLevelIcon=function(e){if(e<0){return o("div",{class:"level-icon",innerHTML:ee})}else if(e>=this.levels.length){return o("div",{class:"level-icon",innerHTML:ie})}else{return o("div",{class:"level-icon",innerHTML:te})}};e.prototype.handleSelectContact=function(e,t){e.preventDefault();this.rolesCompleted[t.id]=__assign(__assign({},t),e.detail);this.showPickerForId=""};e.prototype.handleClickRole=function(e,t){e.stopPropagation();this.showPickerForId=t.id};e.prototype.handleSend=function(e){var t=this;var i,o,r;if(this.sending){console.log("Skipping duplicate send",e);return}console.log("Sending",e);e.preventDefault();e.stopPropagation();this.sending=true;(i=this.sendingEnvelope)===null||i===void 0?void 0:i.emit({sending:true});var s={template_id:this.templateId,name:(r=(o=this.templateStore)===null||o===void 0?void 0:o.state)===null||r===void 0?void 0:r.name,environment:this.environment,roles:Object.values(this.rolesCompleted),prepared_fields:[]};console.log("[SEND] Creating envelope",s);d(this.endpoint,s).then((function(e){var i,o;console.log("[SEND] Send envelope",e);t.reset().catch((function(e){return console.log("Unknown Error",e)}));t.sending=false;(i=t.sendingEnvelope)===null||i===void 0?void 0:i.emit({sending:false});(o=t.send)===null||o===void 0?void 0:o.emit(__assign(__assign({},s),{envelope_id:e.id,envelope:e}))})).catch((function(e){var i;console.log("Send error",e);t.sending=false;(i=t.sendingEnvelope)===null||i===void 0?void 0:i.emit({sending:false})}))};e.prototype.handleCancel=function(e){var t;e.stopPropagation();(t=this.exit)===null||t===void 0?void 0:t.emit()};e.prototype.render=function(){var e=this;var t,i;var s=z(this.roleStore);var n=Object.values(this.rolesCompleted).filter((function(e){return c(e.email)||u(e.phone)}));var l=n.length>=s.length;return o(r,{key:"d0bd3f9d7ef226896f095059203280e1c1e71265",class:{sendable:(i=(t=this.templateStore)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.is_sendable}},o("div",{key:"1d4fdeda91a23a81bb1c72a4200de76e36ba74c8",class:"recipients"},o("div",{key:"9bb72122ba245dd95c3f2ffb0c1768764c2f2da7",class:"left-line"}),o("div",{key:"c2056047a4bf20612fb83693fcf279a1354c98e0",class:"level level-start"},this.getLevelIcon(-1),o("div",{key:"0220edca79c791bdd561d0ff92cfad3236dd7800",class:"complete"},"Send Envelope")),this.levels.map((function(t){return o("div",{class:"level level-".concat(t)},e.getLevelIcon(t),e.rolesAtLevel[t].map((function(t){var i,r,s,n,l,a;var d=!t.email;var c="verdocs-send-recipient-".concat(t.name);return d?o("div",{class:"recipient",style:{backgroundColor:p(S(e.roleStore,t.name))},onClick:function(i){return e.handleClickRole(i,t)},id:c},(r=(i=e.rolesCompleted[t.id])===null||i===void 0?void 0:i.full_name)!==null&&r!==void 0?r:t.name,o("div",{class:"icon",innerHTML:$}),e.showPickerForId===t.id&&o("verdocs-portal",{anchor:c,onClickAway:function(){return e.showPickerForId=""}},o("verdocs-contact-picker",{onExit:function(){return e.showPickerForId=""},onNext:function(i){return e.handleSelectContact(i,t)},contactSuggestions:e.sessionContacts,templateRole:(s=e.rolesCompleted[t.id])!==null&&s!==void 0?s:t,onSearchContacts:function(t){var i;return(i=e.searchContacts)===null||i===void 0?void 0:i.emit(t.detail)}}))):o("div",{class:"recipient",style:{borderColor:p(S(e.roleStore,t.name))},onClick:function(i){return e.handleClickRole(i,t)},id:c},(l=(n=e.rolesCompleted[t.id])===null||n===void 0?void 0:n.full_name)!==null&&l!==void 0?l:t.full_name,o("div",{class:"icon",innerHTML:$}),e.showPickerForId===t.id&&o("verdocs-portal",{anchor:c,onClickAway:function(){return e.showPickerForId=""}},o("verdocs-contact-picker",{onExit:function(){return e.showPickerForId=""},onNext:function(i){return e.handleSelectContact(i,t)},contactSuggestions:e.sessionContacts,templateRole:(a=e.rolesCompleted[t.id])!==null&&a!==void 0?a:t,onSearchContacts:function(t){var i;return(i=e.searchContacts)===null||i===void 0?void 0:i.emit(t.detail)}})))})))})),o("div",{key:"16fba92b62896c3368d54743c9ae5c79b7558f16",class:"level level-done"},this.getLevelIcon(this.levels.length),o("div",{key:"0cae926609fc5c2a10387bee716d49c98a8ebcf6",class:"complete"},"Signing Complete"))),o("div",{key:"f8457f0c451cc70a096e46447395186aca90169f",class:"buttons"},o("verdocs-button",{key:"2be6f8c3cfb4c2ec8c010c4cba79855f20e5461d",label:"Cancel",size:"small",variant:"outline",onClick:function(t){return e.handleCancel(t)},disabled:this.sending}),o("verdocs-button",{key:"b34393a6e3197acd0143161c71a43420f45302be",label:"Send",size:"small",disabled:!l||this.sending,onClick:function(t){return e.handleSend(t)}}),this.sending&&o("verdocs-spinner",{key:"8e26caa183719e765c771921d365e39ec4916be4"})))};return e}());oe.style=J;var re='@-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}';var se=re;var ne=e("verdocs_template_attachments",function(){function e(e){t(this,e);this.exit=i(this,"exit",7);this.next=i(this,"next",7);this.templateUpdated=i(this,"templateUpdated",7);this.sdkError=i(this,"sdkError",7);this.endpoint=l.getDefault();this.templateId="";this.uploading=false;this.progressLabel="Uploading...";this.progressPercent=0;this.showDeleteError=false;this.confirmDeleteDocument=null;this.store=null}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,o,r;return __generator(this,(function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.templateId){console.log("[ROLES] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[ROLES] Unable to start builder session, must be authenticated");return[2]}o=this;return[4,L(this.endpoint,this.templateId,false)];case 1:o.store=s.sent();return[3,3];case 2:r=s.sent();console.log("[TEMPLATE ATTACHMENTS] Error loading template",r);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new D(r.message,(t=r.response)===null||t===void 0?void 0:t.status,(i=r.response)===null||i===void 0?void 0:i.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleCancel=function(e){e.stopPropagation();this.exit.emit()};e.prototype.handleUploadProgress=function(e){if(e>=99){this.progressPercent=100;this.progressLabel="Processing..."}else{this.progressPercent=e}};e.prototype.handleUpload=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i,o,r,s,n,l,a;return __generator(this,(function(d){switch(d.label){case 0:e.stopPropagation();s=e.detail.file;if(!s){return[2]}console.log("[ATTACHMENTS] Uploading...",s);this.uploading=true;this.progressLabel="Uploading...";d.label=1;case 1:d.trys.push([1,4,,5]);return[4,v(this.endpoint,this.templateId,s,this.handleUploadProgress.bind(this))];case 2:n=d.sent();console.log("[ATTACHMENTS] Created attachment",n);l=this;return[4,L(this.endpoint,this.templateId,false)];case 3:l.store=d.sent();console.log("[ATTACHMENTS] Updated template",this.store.state);(t=this.templateUpdated)===null||t===void 0?void 0:t.emit({endpoint:this.endpoint,template:this.store.state,event:"attachments"});this.uploading=false;this.progressLabel="";this.progressPercent=0;return[3,5];case 4:a=d.sent();console.log("[ATTACHMENTS] Error creating template",a);(i=this.sdkError)===null||i===void 0?void 0:i.emit(new D(a.message,(o=a.response)===null||o===void 0?void 0:o.status,(r=a.response)===null||r===void 0?void 0:r.data));this.uploading=false;return[3,5];case 5:return[2]}}))}))};e.prototype.handleNext=function(e){var t;e.stopPropagation();this.uploading=false;this.progressLabel="";this.progressPercent=0;(t=this.next)===null||t===void 0?void 0:t.emit({template:this.store.state})};e.prototype.confirmDelete=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:return[4,h(this.endpoint,this.templateId,this.confirmDeleteDocument.id)];case 1:t.sent();e=this;return[4,L(this.endpoint,this.templateId,false)];case 2:e.store=t.sent();console.log("[ATTACHMENTS] New template",this.store.state);this.confirmDeleteDocument=null;return[2]}}))}))};e.prototype.handleDelete=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(i){if(((t=this.store.state)===null||t===void 0?void 0:t.documents.length)>1){this.confirmDeleteDocument=e}else{this.showDeleteError=true}return[2]}))}))};e.prototype.getFileIcon=function(e){switch(e.mime){case"application/pdf":return B;case"image/jpeg":return j;case"image/png":return N;case"application/msword":case"application/vnd.openxmlformats-officedocument.wordprocessingml.document":return U}return O};e.prototype.render=function(){var e=this;var t,i,s;if(!this.endpoint.session){return o(r,null,o("verdocs-component-error",{message:"You must be authenticated to use this module."}))}var n=(t=this.store)===null||t===void 0?void 0:t.state;if(!n.isLoaded){return o(r,{class:"loading"},o("verdocs-loader",null))}if(!this.endpoint.session||!n.profile_id){return o(r,{class:"empty"})}return o(r,null,o("h5",null,"Existing Attachments"),o("div",{class:"attachments"},(i=this.store)===null||i===void 0?void 0:i.state.documents.map((function(t){return o("div",{class:"attachment"},o("div",{class:"file-icon",innerHTML:e.getFileIcon(t)}),o("div",{class:"filename",title:t.name},t.name),o("div",{class:"pages"},o("div",{class:"count"},t.pages),o("div",{class:"pages-icon",innerHTML:P})),o("div",{class:"trash-icon",innerHTML:F,onClick:function(){return e.handleDelete(t)}}))}))),o("h5",null,"Attach a New Document"),this.uploading?o("div",{class:"loader-wrapper"},o("verdocs-loader",null),this.progressLabel&&o("div",{class:"progress-wrapper"},o("verdocs-progress-bar",{showPercent:true,percent:this.progressPercent,label:this.progressLabel}))):o("verdocs-file-chooser",{onFileSelected:function(t){return e.handleUpload(t)}}),o("div",{class:"buttons"},o("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:function(t){return e.handleCancel(t)},disabled:this.uploading}),o("verdocs-button",{label:"Next",size:"small",onClick:function(t){return e.handleNext(t)},disabled:!((s=this.store)===null||s===void 0?void 0:s.state.documents.length)||this.uploading})),this.showDeleteError&&o("verdocs-ok-dialog",{heading:"Unable to Delete Attachment",message:"Templates must contain at least one attachment.",onNext:function(){return e.showDeleteError=false}}),this.confirmDeleteDocument&&o("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:function(){return e.confirmDelete()},showCancel:true,onExit:function(){e.confirmDeleteDocument=null}}))};return e}());ne.style=se;var le='@-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:20px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}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}';var ae=le;var de=["attachments","roles","settings","fields","preview"];var ce=e("verdocs_template_build_tabs",function(){function e(e){t(this,e);this.sdkError=i(this,"sdkError",7);this.stepChanged=i(this,"stepChanged",7);this.endpoint=l.getDefault();this.templateId=null;this.step="preview";this.store=null}e.prototype.onStepChanged=function(){console.log("Step changed",this.step,this.templateId);this.loadTemplate().catch((function(e){return console.log("Unknown Error",e)}))};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i;return __generator(this,(function(o){try{this.endpoint.loadSession();if(!this.endpoint.session){console.log("[BUILD_TABS] Unable to start builder session, must be authenticated");return[2]}if(!this.templateId){this.step="preview";return[2]}this.loadTemplate().catch((function(e){return console.log("[BUILD_TABS] Unable to load template",e)}))}catch(o){console.log("[BUILD_TABS] Error loading template",o);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new D(o.message,(t=o.response)===null||t===void 0?void 0:t.status,(i=o.response)===null||i===void 0?void 0:i.data))}return[2]}))}))};e.prototype.loadTemplate=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:if(!this.templateId)return[3,2];e=this;return[4,L(this.endpoint,this.templateId,false)];case 1:e.store=t.sent();t.label=2;case 2:return[2]}}))}))};e.prototype.setStep=function(e){var t;console.log("Selected step",e.detail.tab.id);e.stopPropagation();e.preventDefault();this.step=e.detail.tab.id;(t=this.stepChanged)===null||t===void 0?void 0:t.emit(e.detail.tab.id)};e.prototype.render=function(){var e=this;var t,i,s,n,l,a,d,c,u;if(!this.endpoint.session){return o(r,null,o("verdocs-component-error",{message:"You must be authenticated to use this module."}))}var p=false;var v=false;var h=false;console.log("[BUILD_TABS] Rendering tabs",this.templateId,this.step);if(this.templateId&&this.store&&this.store.state){h=((s=(i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.documents)===null||s===void 0?void 0:s.length)>0;v=h&&((a=(l=(n=this.store)===null||n===void 0?void 0:n.state)===null||l===void 0?void 0:l.roles)===null||a===void 0?void 0:a.length)>0;p=v&&((u=(c=(d=this.store)===null||d===void 0?void 0:d.state)===null||c===void 0?void 0:c.fields)===null||u===void 0?void 0:u.length)>0}var f=Math.max(de.indexOf(this.step),0);if(!p&&f>=4){f=3}if(!v&&f>=3){f=1}if(!h&&f>=1){f=0}console.log({selectedStepIndex:f,canPreview:p,canEditFields:v,canEditRoles:h});return o(r,null,o("verdocs-tabs",{onSelectTab:function(t){return e.setStep(t)},selectedTab:f,tabs:[{id:"attachments",disabled:false,label:this.templateId&&this.store?"Attachment(s)":"Upload Attachment(s)"},{id:"roles",disabled:!h,label:"Roles"},{id:"settings",disabled:!v,label:"Settings"},{id:"fields",disabled:!v,label:"Fields"},{id:"preview",disabled:!p,label:"Preview/Send"}]}))};Object.defineProperty(e,"watchers",{get:function(){return{step:["onStepChanged"]}},enumerable:false,configurable:true});return e}());ce.style=ae;var ue='@-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}';var pe=ue;var ve=" ";var he='<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>';var fe=e("verdocs_template_create",function(){function e(e){t(this,e);this.exit=i(this,"exit",7);this.next=i(this,"next",7);this.sdkError=i(this,"sdkError",7);this.templateCreated=i(this,"templateCreated",7);this.endpoint=l.getDefault();this.file=undefined;this.creating=false;this.progressLabel="Uploading...";this.progressPercent=0}e.prototype.componentWillLoad=function(){this.endpoint.setTimeout(3e4);this.endpoint.loadSession()};e.prototype.handleFileChanged=function(e){var t;this.file=((t=e.target.files)===null||t===void 0?void 0:t[0])||null;console.log("[CREATE] Selected file",this.file)};e.prototype.handleUpload=function(e){e.stopPropagation();var t=document.getElementById("verdocs-template-create-file");t.click()};e.prototype.handleCancel=function(e){e.stopPropagation();this.exit.emit()};e.prototype.handleSubmit=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i,o,r,s;var n=this;return __generator(this,(function(l){switch(l.label){case 0:e.stopPropagation();console.log("Submitting");if(!this.file){return[2]}this.creating=true;this.progressLabel="Uploading...";l.label=1;case 1:l.trys.push([1,3,,4]);return[4,f(this.endpoint,{name:this.file.name,documents:[this.file]},(function(e){if(e>=99){n.progressLabel="Processing...";n.progressPercent=100}else{n.progressPercent=e}}))];case 2:r=l.sent();console.log("[CREATE] Created template",r);L(this.endpoint,r.id,true).then((function(){var e,t;(e=n.templateCreated)===null||e===void 0?void 0:e.emit({endpoint:n.endpoint,template:r,templateId:r.id});(t=n.next)===null||t===void 0?void 0:t.emit(r);n.creating=false;n.progressLabel="";n.progressPercent=0})).catch((function(e){console.log(e)}));return[3,4];case 3:s=l.sent();console.log("[CREATE] Error creating template",s);(t=this.sdkError)===null||t===void 0?void 0:t.emit(new D(s.message,(i=s.response)===null||i===void 0?void 0:i.status,(o=s.response)===null||o===void 0?void 0:o.data));this.creating=false;return[3,4];case 4:return[2]}}))}))};e.prototype.render=function(){var e=this;if(!this.endpoint.session){return o(r,null,o("verdocs-component-error",{message:"You must be authenticated to use this module."}))}return o(r,null,o("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},o("input",{type:"file",id:"verdocs-template-create-file",multiple:true,accept:"application/pdf",style:{display:"none"},onChange:function(t){return e.handleFileChanged(t)}}),this.creating?o("div",{class:"loader-wrapper"},o("verdocs-loader",null),this.progressLabel&&o("div",{class:"progress-wrapper"},o("verdocs-progress-bar",{showPercent:true,percent:this.progressPercent,label:this.progressLabel}))):o("div",{class:"upload-box",onDrop:function(t){t.preventDefault();t.target.classList.remove("drag-over");e.file=t.dataTransfer.files[0]},onDragOver:function(e){e.preventDefault();e.dataTransfer.dropEffect="copy"},onDragEnter:function(e){return e.target.classList.add("drag-over")},onDragLeave:function(e){return e.target.classList.remove("drag-over")}},o("div",null,o("span",{innerHTML:he})),o("div",{style:{marginTop:"20px",fontSize:"20px",fontWeight:"bold",overflowWrap:"anywhere"}},this.file?this.file.name:"Drag a file here"),o("div",{style:{marginTop:"20px",marginBottom:"20px",fontSize:"16px",height:"20px"}},this.file?ve:"Or, if you prefer..."),o("verdocs-button",{label:this.file?"Select a different file":"Select a file from your computer",size:"small",onClick:function(t){return e.handleUpload(t)}})),o("div",{class:"buttons"},o("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:function(t){return e.handleCancel(t)},disabled:this.creating}),o("verdocs-button",{label:"Next",size:"small",onClick:function(t){return e.handleSubmit(t)},disabled:!this.file||this.creating}))))};return e}());fe.style=pe;var me="@-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;-ms-flex:0 0 50px;flex:0 0 50px;-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}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_group{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_button_group{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}";var ge=me;var be='<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>';var xe='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" 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"/></svg>';var we='<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>';var ye='<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>';var ke='<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>';var _e='<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>';var Ee='<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>';var Ce='<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>';var qe='<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>';var ze='<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>';var Se=[{id:"signature",tooltip:"Signature",icon:_e},{id:"initial",tooltip:"Initials",icon:Ee},{id:"sep1",tooltip:"",icon:ze},{id:"textbox",tooltip:"Text Box",icon:be},{id:"textarea",tooltip:"Text Area",icon:xe},{id:"checkbox_group",tooltip:"Check Box",icon:we},{id:"radio_button_group",tooltip:"Radio Button",icon:ye},{id:"dropdown",tooltip:"Dropdown",icon:qe},{id:"sep2",tooltip:"",icon:ze},{id:"date",tooltip:"Date",icon:ke},{id:"timestamp",tooltip:"Timestamp",icon:Ce}];var Me=e("verdocs_template_fields",function(){function e(e){t(this,e);this.sdkError=i(this,"sdkError",7);this.templateUpdated=i(this,"templateUpdated",7);this.fieldsUpdated=i(this,"fieldsUpdated",7);this.pageHeights={};this.templateStore=null;this.fieldStore=null;this.roleStore=null;this.cachedPageInfo={};this.endpoint=l.getDefault();this.templateId=null;this.toolbarTargetId=null;this.placing=null;this.showMustSelectRole=false;this.selectedRoleName="";this.loading=true}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i;var o=this;return __generator(this,(function(r){try{this.endpoint.loadSession();if(!this.templateId){console.log("[FIELDS] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[FIELDS] Unable to start builder session, must be authenticated");return[2]}L(this.endpoint,this.templateId,true).then((function(e){var t,i;o.templateStore=e;o.fieldStore=E(o.templateId);o.roleStore=q(o.templateId);o.selectedRoleName=((i=(t=o.roleStore.get("roles"))===null||t===void 0?void 0:t[0])===null||i===void 0?void 0:i.name)||"";o.loading=false;o.fieldStore.onChange("fields",(function(e){var t;console.log("[FIELDS] Fields changed",{fields:e});(t=o.fieldsUpdated)===null||t===void 0?void 0:t.emit({event:"updated",endpoint:o.endpoint,templateId:o.templateId,fields:e})}))})).catch((function(e){console.log(e)}))}catch(o){console.log("[FIELDS] Error with preview session",o);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new D(o.message,(t=o.response)===null||t===void 0?void 0:t.status,(i=o.response)===null||i===void 0?void 0:i.data))}return[2]}))}))};e.prototype.componentDidRender=function(){Q.dynamicDrop(true);var e=this.toolbarTargetId?document.getElementById(this.toolbarTargetId):null;var t=document.getElementById("verdocs-template-fields-toolbar");if(e&&t){console.log("[FIELDS] Moving toolbar");t.remove();e.append(t)}};e.prototype.componentWillUpdate=function(){var e=this;var t;var i=this.roleStore.get("roles");if(!this.selectedRoleName||!i.find((function(t){return t&&t.name===e.selectedRoleName}))){this.selectedRoleName=((t=i[0])===null||t===void 0?void 0:t.name)||"";console.log("[FIELDS] Selected new role",this.selectedRoleName)}};e.prototype.handleKeyDown=function(e){if(e.key==="Escape"){this.placing=null}};e.prototype.handleFieldChange=function(e,t,i){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){console.log("[FIELDS] handleFieldChange",e,t,i);return[2]}))}))};e.prototype.attachFieldAttributes=function(e,t,i){var o=this;i.addEventListener("input",(function(e){return o.handleFieldChange(t,e)}));i.addEventListener("settingsChanged",(function(e){var t,i;console.log("Settings changed",e.detail);(t=o.templateUpdated)===null||t===void 0?void 0:t.emit({endpoint:o.endpoint,template:(i=o.templateStore)===null||i===void 0?void 0:i.state,event:"added-field"})}));i.addEventListener("deleted",(function(){var e,r;console.log("[FIELDS] Deleted",o,t);i.remove();(e=o.templateUpdated)===null||e===void 0?void 0:e.emit({endpoint:o.endpoint,template:(r=o.templateStore)===null||r===void 0?void 0:r.state,event:"updated-field"})}));i.setAttribute("templateid",this.templateId);i.setAttribute("fieldname",t.name);i.setAttribute("pageNumber",e.pageNumber);i.setAttribute("xScale",e.xScale);i.setAttribute("yScale",e.yScale);i.setAttribute("name",t.name)};e.prototype.handlePageRendered=function(e){var t=this;var i=e.detail;this.cachedPageInfo[i.pageNumber]=i;this.pageHeights[i.pageNumber]=i.naturalHeight;this.fieldStore.get("fields").filter((function(e){return e&&e.page===i.pageNumber})).forEach((function(e){switch(e.type){case"checkbox_group":case"radio_button_group":(e.settings||{}).options.map((function(i,o){var r=V(e,o);var s=document.getElementById(r);if(s){s.setAttribute("fieldname",e.name);s.setAttribute("pagenumber",String(e.page));t.makeDraggable(s)}}));break;default:var i=T(e);var o=document.getElementById(i);if(o){o.setAttribute("fieldname",e.name);o.setAttribute("pagenumber",String(e.page));t.makeDraggable(o)}break}}))};e.prototype.makeDraggable=function(e){Q(e).draggable({listeners:{move:this.handleMoveField.bind(this),end:this.handleMoveEnd.bind(this)}})};e.prototype.handleMoveField=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i,o,r,s,n;return __generator(this,(function(l){t=+(e.target.getAttribute("posX")||0);i=+(e.target.getAttribute("posY")||0);o=+(e.target.getAttribute("xScale")||1);r=+(e.target.getAttribute("yScale")||1);s=e.dx/o+t;n=e.dy/r+i;e.target.setAttribute("posX",s);e.target.setAttribute("posy",n);I(e.target,"translate","".concat(s,"px, ").concat(n,"px"));return[2]}))}))};e.prototype.handleMoveEnd=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i,o,r,s,n,l,a,d,c,u,p,v,h,f,g,b,x,w,y,k,_,E,q,z;return __generator(this,(function(S){switch(S.label){case 0:o=e.target.getAttribute("fieldname");r=+(e.target.getAttribute("option")||"0");s=this.fieldStore.get("fields").find((function(e){return e.name===o}));if(!s){console.log("[FIELDS] Unable to find field",o,e.target);return[2]}n=e.target.getAttribute("pagenumber");l=this.cachedPageInfo[n],a=l.naturalWidth,d=a===void 0?612:a,c=l.naturalHeight,u=c===void 0?792:c,p=l.renderedHeight,v=p===void 0?792:p;h=e.target.getBoundingClientRect();f=e.target.parentElement;g=f.getBoundingClientRect();b=s.settings.width||R(s.type);x=s.settings.height||A(s.type);w=Math.max(h.left-g.left,0);y=Math.max(v-(g.bottom-h.bottom),0);k=this.viewCoordinatesToPageCoordinates(w,y,n,d-b,u-x),_=k.x,E=k.y;switch(s.type){case"attachment":case"payment":case"initial":case"signature":case"date":case"dropdown":case"textarea":case"textbox":case"timestamp":s.settings.x=_;s.settings.y=E;break;case"checkbox_group":case"radio_button_group":{q=s.settings.options[r];if(q){q.x=_;q.y=E}}break}console.log("[FIELDS] Will update",o,E,r,s);return[4,m(this.endpoint,this.templateId,o,s)];case 1:z=S.sent();C(this.fieldStore,o,z);e.target.removeAttribute("posX");e.target.removeAttribute("posY");Z(e.target);(t=this.templateUpdated)===null||t===void 0?void 0:t.emit({endpoint:this.endpoint,template:(i=this.templateStore)===null||i===void 0?void 0:i.state,event:"updated-field"});return[2]}}))}))};e.prototype.generateFieldName=function(e,t){var i=1;var o;do{o="".concat(e,"P").concat(t,"-").concat(i);i++}while(this.fieldStore.get("fields").some((function(e){return e&&e.name===o})));return o};e.prototype.viewCoordinatesToPageCoordinates=function(e,t,i,o,r){var s=this.cachedPageInfo[i],n=s.xScale,l=n===void 0?1:n,a=s.yScale,d=a===void 0?1:a,c=s.renderedHeight,u=c===void 0?792:c;var p=Math.floor(Math.min(e/l,o));var v=Math.floor(Math.min(Math.max(u-t,0)/d,r));return{x:p,y:v}};e.prototype.handleClickPage=function(e,t){return __awaiter(this,void 0,void 0,(function(){var i,o,r,s,n,l,a,d,c,u,p,v,h,f,m,b;return __generator(this,(function(x){switch(x.label){case 0:if(!this.placing)return[3,2];r=e.offsetX;s=e.offsetY;n=R(this.placing);l=A(this.placing);a=this.cachedPageInfo[t];d=a.naturalWidth,c=d===void 0?612:d,u=a.naturalHeight,p=u===void 0?792:u;v=this.viewCoordinatesToPageCoordinates(r,s,t,c-n,p-l);h=Math.floor(v.x);f=Math.floor(v.y);m={name:this.generateFieldName(this.placing,t),role_name:this.selectedRoleName,template_id:this.templateId,document_id:a.documentId,type:this.placing,required:true,page:t,validator:null,label:null,default:null,placeholder:null,group:null,settings:{x:h,y:f},x:h,y:f,width:n,height:l};console.log("[FIELDS] Will save new field",m);switch(m.type){case"attachment":case"payment":m.settings={x:h,y:f};break;case"initial":case"signature":m.settings={x:h,y:f,result:""};break;case"checkbox_group":m.setting={minimum_checked:0,maximum_checked:1e3,options:[{id:"".concat(m.name,"-1"),value:"Option 1",checked:false,x:h,y:f}]};break;case"date":m.settings={x:h,y:f,width:n,height:l,result:""};break;case"dropdown":m.required=false;m.settings={x:h,y:f,width:n,height:l,value:null,placeholder:"Choose",options:[{id:"option-1",value:"Option 1"}]};break;case"radio_button_group":m.setting={options:[{id:"".concat(m.name,"-1"),value:"Option 1",selected:false,x:h,y:f}]};break;case"textarea":case"textbox":m.settings={x:h,y:f,width:n,height:l,result:"",leading:0,alignment:0,upperCase:false};break;case"timestamp":m.settings={x:h,y:f,width:n,height:l};break}if(m.type==="textarea"){m.settings.leading=16;m.type="textbox"}return[4,g(this.endpoint,this.templateId,m)];case 1:b=x.sent();console.log("[FIELDS] Saved field",b);this.fieldStore.set("fields",__spreadArray(__spreadArray([],this.fieldStore.get("fields"),true),[b],false));this.placing=null;(i=this.templateUpdated)===null||i===void 0?void 0:i.emit({endpoint:this.endpoint,template:(o=this.templateStore)===null||o===void 0?void 0:o.state,event:"added-field"});x.label=2;case 2:return[2]}}))}))};e.prototype.render=function(){var e;var t=this;var i,s,n;if(!this.endpoint.session){return o(r,null,o("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if(this.loading||!((i=this.templateStore)===null||i===void 0?void 0:i.state.isLoaded)){return o(r,null,o("verdocs-loader",null))}var l=this.roleStore.get("roles").map((function(e){return{value:e.name,label:e.full_name?"".concat(e.name,": ").concat(e.full_name):e.name}}));return o(r,{class:this.placing?(e={},e["placing-".concat(this.placing)]=true,e):{},onSubmit:function(){}},o("div",{id:"verdocs-template-fields-toolbar"},o("div",{class:"add-for"},"Add field:"),o("verdocs-select-input",{value:this.selectedRoleName,options:l,onInput:function(e){return t.selectedRoleName=e.target.value}}),Se.map((function(e){return o("verdocs-toolbar-icon",{text:e.tooltip,icon:e.icon,onClick:function(){if(e.tooltip){if(t.selectedRoleName){t.placing=e.id}else{t.showMustSelectRole=true}}}})}))),o("div",{class:"pages"},(((n=(s=this.templateStore)===null||s===void 0?void 0:s.state)===null||n===void 0?void 0:n.documents)||[]).map((function(e){var i=a(1,e.pages);return i.map((function(i){return o("verdocs-template-document-page",{templateId:t.templateId,documentId:e.id,pageNumber:i,virtualWidth:612,virtualHeight:792,disabled:true,editable:true,done:false,onClick:function(e){return t.handleClickPage(e,i)},onPageRendered:function(e){return t.handlePageRendered(e)},layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})}))}))),this.showMustSelectRole&&o("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:function(){return t.showMustSelectRole=false}}))};return e}());Me.style=ge;var Le="";var He=Le;var Ie=e("verdocs_template_name",function(){function e(e){t(this,e);this.close=i(this,"close",7);this.sdkError=i(this,"sdkError",7);this.templateUpdated=i(this,"templateUpdated",7);this.store=null;this.endpoint=l.getDefault();this.templateId="";this.name="";this.dirty=false}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,o,r,s,n;return __generator(this,(function(l){switch(l.label){case 0:l.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.templateId){console.log("[ROLES] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[ROLES] Unable to start builder session, must be authenticated");return[2]}s=this;return[4,L(this.endpoint,this.templateId,false)];case 1:s.store=l.sent();this.name=(t=(e=this.store)===null||e===void 0?void 0:e.state)===null||t===void 0?void 0:t.name;this.dirty=false;return[3,3];case 2:n=l.sent();console.log("[TEMPLATE NAME] Error loading template",n);(i=this.sdkError)===null||i===void 0?void 0:i.emit(new D(n.message,(o=n.response)===null||o===void 0?void 0:o.status,(r=n.response)===null||r===void 0?void 0:r.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleCancel=function(e){var t,i,o;e.stopPropagation();this.name=(i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.name;this.dirty=false;console.log("Closing");(o=this.close)===null||o===void 0?void 0:o.emit()};e.prototype.handleSave=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i,o;return __generator(this,(function(r){switch(r.label){case 0:e.stopPropagation();return[4,b(this.endpoint,this.templateId,{name:this.name})];case 1:r.sent();if((t=this.store)===null||t===void 0?void 0:t.state){this.store.state.name=this.name}this.dirty=false;(i=this.templateUpdated)===null||i===void 0?void 0:i.emit({endpoint:this.endpoint,template:this.store.state,event:"name"});(o=this.close)===null||o===void 0?void 0:o.emit();return[2]}}))}))};e.prototype.render=function(){var e=this;var t,i;if(!this.endpoint.session){return o(r,null,o("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if((i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.isLoading){return o(r,{class:"loading"},o("verdocs-loader",null))}return o(r,null,o("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},o("label",{htmlFor:"verdocs-template-name"},"Template Name"),o("verdocs-text-input",{id:"verdocs-template-name",value:this.name,autocomplete:"off",placeholder:"Template Name...",onInput:function(t){var i,o;e.name=t.target.value;e.dirty=e.name!==((o=(i=e.store)===null||i===void 0?void 0:i.state)===null||o===void 0?void 0:o.name)}}),o("div",{class:"buttons"},o("verdocs-button",{size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:function(t){return e.handleCancel(t)}}),o("verdocs-button",{size:"small",label:"Save",disabled:!this.dirty,onClick:function(t){return e.handleSave(t)}}))))};return e}());Ie.style=He;var Ze='@-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-reminders{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-reminders.loading{min-height:300px;position:relative;display:block}verdocs-template-reminders.empty{display:none}verdocs-template-reminders form{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-template-reminders form h5{font-size:16px;font-weight:bold;color:#4c56cb;margin:0 0 20px 0}verdocs-template-reminders form label{font-size:16px;font-weight:500;margin:0 0 6px 0;color:#33364b}verdocs-template-reminders form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-template-reminders form input:focus{outline:none}verdocs-template-reminders form .input-row{display:-ms-flexbox;display:flex;margin:0 0 10px 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-template-reminders form .input-row label{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex}verdocs-template-reminders form .input-row verdocs-text-input{margin:0;display:-ms-flexbox;display:flex;-ms-flex:0 0 60px;flex:0 0 60px}verdocs-template-reminders form .input-row verdocs-text-input input{text-align:center}verdocs-template-reminders form .input-row verdocs-checkbox{display:-ms-flexbox;display:flex;-ms-flex:0 0 40px;flex:0 0 40px;-ms-flex-pack:center;justify-content:center}verdocs-template-reminders .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-reminders ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-reminders ::-moz-placeholder{color:#aaaaaa}verdocs-template-reminders :-ms-input-placeholder{color:#aaaaaa}verdocs-template-reminders ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-reminders ::placeholder{color:#aaaaaa}';var Te=Ze;var Ve=e("verdocs_template_reminders",function(){function e(e){t(this,e);this.close=i(this,"close",7);this.sdkError=i(this,"sdkError",7);this.templateUpdated=i(this,"templateUpdated",7);this.store=null;this.endpoint=l.getDefault();this.templateId="";this.showPlanBlocker=false;this.sendReminders=false;this.firstReminderDays="1";this.reminderDays="1";this.dirty=false}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,o,r,s,n;return __generator(this,(function(l){switch(l.label){case 0:l.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.templateId){console.log("[ROLES] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[ROLES] Unable to start builder session, must be authenticated");return[2]}s=this;return[4,L(this.endpoint,this.templateId,false)];case 1:s.store=l.sent();this.sendReminders=!!((t=(e=this.store)===null||e===void 0?void 0:e.state)===null||t===void 0?void 0:t.reminder_id);this.dirty=false;return[3,3];case 2:n=l.sent();console.log("[TEMPLATE REMINDERS] Error loading template",n);(i=this.sdkError)===null||i===void 0?void 0:i.emit(new D(n.message,(o=n.response)===null||o===void 0?void 0:o.status,(r=n.response)===null||r===void 0?void 0:r.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleCancel=function(e){var t,i,o;e.stopPropagation();this.sendReminders=!!((i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.reminder_id);this.dirty=false;(o=this.close)===null||o===void 0?void 0:o.emit()};e.prototype.handleSave=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i,o,r,s,n,l,a,d,c,u,p,v,h;return __generator(this,(function(f){switch(f.label){case 0:e.stopPropagation();f.label=1;case 1:f.trys.push([1,12,,13]);if(!this.sendReminders)return[3,8];c={setup_time:+this.firstReminderDays,interval_time:+this.reminderDays};if(!!((i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.reminder_id))return[3,4];return[4,x(this.endpoint,this.templateId,c)];case 2:f.sent();u=this;return[4,L(this.endpoint,this.templateId,false)];case 3:u.store=f.sent();return[3,7];case 4:return[4,w(this.endpoint,this.templateId,(o=this.store)===null||o===void 0?void 0:o.state.reminder_id,c)];case 5:f.sent();p=this;return[4,L(this.endpoint,this.templateId,false)];case 6:p.store=f.sent();f.label=7;case 7:return[3,11];case 8:return[4,y(this.endpoint,this.templateId,(r=this.store)===null||r===void 0?void 0:r.state.reminder_id)];case 9:f.sent();v=this;return[4,L(this.endpoint,this.templateId,false)];case 10:v.store=f.sent();f.label=11;case 11:(s=this.templateUpdated)===null||s===void 0?void 0:s.emit({endpoint:this.endpoint,template:this.store.state,event:"attachments"});return[3,13];case 12:h=f.sent();console.log("[TEMPLATE REMINDERS] Unable to update reminders",h);Y(h.message);(n=this.sdkError)===null||n===void 0?void 0:n.emit(new D(h.message,(l=h.response)===null||l===void 0?void 0:l.status,(a=h.response)===null||a===void 0?void 0:a.data));return[3,13];case 13:this.dirty=false;(d=this.close)===null||d===void 0?void 0:d.emit();return[2]}}))}))};e.prototype.render=function(){var e=this;var t,i;if(!this.endpoint.session){return o(r,null,o("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if(!this.endpoint.session||!((i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.isLoaded)){return o(r,{class:"empty"})}return o(r,null,o("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},o("h5",null,"Reminders"),o("div",{class:"input-row"},o("label",{htmlFor:"verdocs-send-reminders"},"Send Automatic Reminders"),o("verdocs-checkbox",{id:"verdocs-send-reminders",name:"automatic-reminders",checked:this.sendReminders,value:"on",onInput:function(t){e.sendReminders=t.target.checked;e.dirty=true}})),o("p",null,o("strong",null,"NOTE:")," Reminders will only be sent for up to 14 days."),o("div",{class:"input-row"},o("label",{htmlFor:"verdocs-first-reminder-days"},"Days Before First Reminder"),o("verdocs-text-input",{id:"verdocs-first-reminder-days",type:"number",value:this.firstReminderDays,onInput:function(t){e.firstReminderDays=t.target.value;e.dirty=true},disabled:!this.sendReminders})),o("div",{class:"input-row"},o("label",{htmlFor:"verdocs-days-between-reminders"},"Days Between Reminders"),o("verdocs-text-input",{id:"verdocs-days-between-reminders",type:"number",value:this.reminderDays,onInput:function(t){e.reminderDays=t.target.value;e.dirty=true},disabled:!this.sendReminders})),o("div",{class:"buttons"},o("verdocs-button",{size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:function(t){return e.handleCancel(t)}}),o("verdocs-button",{size:"small",label:"Save",disabled:!this.dirty,onClick:function(t){return e.handleSave(t)}}))),this.showPlanBlocker&&o("verdocs-ok-dialog",{heading:"Upgrade to access this feature",message:"Please upgrade your plan to access this feature.",onNext:function(){return e.showPlanBlocker=false}}))};return e}());Ve.style=Te;var Re='@-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-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:20px;height:20px;stroke:#666666;margin-bottom:-5px}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}';var Ae=Re;var De={everyone:"Everyone",everyone_as_creator:"Everyone as Me",organization_member:"Organization member",organization_member_as_creator:"Organization Member as Me",creator:"Me"};var Ue='<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>';var Ne='<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>';var je='<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>';var Be='<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>';var Oe='<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>';var Pe='<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>';var Fe='<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>';var Qe='<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>';var Ye=e("verdocs_template_roles",function(){function e(e){t(this,e);this.next=i(this,"next",7);this.exit=i(this,"exit",7);this.sdkError=i(this,"sdkError",7);this.rolesUpdated=i(this,"rolesUpdated",7);this.templateStore=null;this.roleStore=null;this.endpoint=l.getDefault();this.templateId="";this.showingRoleDialog=null;this.showingSenderDialog=false;this.sender=null;this.loading=true}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,o;var r=this;return __generator(this,(function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.templateId){console.log("[ROLES] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[ROLES] Unable to start builder session, must be authenticated");return[2]}return[4,L(this.endpoint,this.templateId,false).then((function(e){var t;r.templateStore=e;r.roleStore=q(r.templateId);console.log("RS",(t=r.roleStore)===null||t===void 0?void 0:t.state);r.loading=false;r.roleStore.onChange("roles",(function(e){var t;console.log("[ROLES] Roles changed",{roles:e});(t=r.rolesUpdated)===null||t===void 0?void 0:t.emit({event:"updated",endpoint:r.endpoint,templateId:r.templateId,roles:e})}))})).catch((function(e){console.log(e)}))];case 1:s.sent();return[3,3];case 2:o=s.sent();console.log("[FIELDS] Error with preview session",o);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new D(o.message,(t=o.response)===null||t===void 0?void 0:t.status,(i=o.response)===null||i===void 0?void 0:i.data));return[3,3];case 3:return[2]}}))}))};e.prototype.componentDidRender=function(){Q.dynamicDrop(true);Q(".recipient").draggable({listeners:{start:function e(t){t.target.classList.add("dragging");this.el.classList.add("dragging")}.bind(this),move:function e(t){var i=+(t.target.getAttribute("dX")||0);var o=+(t.target.getAttribute("dY")||0);var r=+(t.target.dataset["sequence"]||0);var s=+(t.target.dataset["order"]||0);var n=t.dx+i;var l=t.dy+o;t.target.setAttribute("dX",n);t.target.setAttribute("dY",l);var a=t.target.getBoundingClientRect();console.log("w",a.width);t.target.style.transform="translate(".concat(n+a.width-(s+1),"px, ").concat(l-a.height*r,"px)")}.bind(this),end:function e(t){t.target.classList.remove("dragging");this.el.classList.remove("dragging");t.target.removeAttribute("dX");t.target.removeAttribute("dY");t.target.style.transform=null}.bind(this)}});Q(".dropzone").dropzone({overlap:.05,ondrop:function e(t){return __awaiter(this,void 0,void 0,(function(){var e,i,o,r;return __generator(this,(function(s){switch(s.label){case 0:console.log("dropped",t.target.classList);t.target.classList.remove("active");i=t.relatedTarget.dataset.rolename;o=+t.target.dataset.sequence;r=+t.target.dataset.order;M(this.roleStore,i,{sequence:o,order:r});return[4,this.renumberTemplateRoles()];case 1:s.sent();console.log("[ROLES] Updated roles",this.getSortedRoles());(e=this.rolesUpdated)===null||e===void 0?void 0:e.emit({event:"updated",endpoint:this.endpoint,templateId:this.templateId,roles:this.getSortedRoles()});return[2]}}))}))}.bind(this),ondropactivate:function(e){e.target.classList.add("visible")},ondropdeactivate:function(e){e.target.classList.remove("visible")},ondragenter:function(e){e.target.classList.add("active")},ondragleave:function(e){e.target.classList.remove("active")}})};e.prototype.handleCancel=function(){var e;(e=this.exit)===null||e===void 0?void 0:e.emit()};e.prototype.handleSubmit=function(){var e;(e=this.next)===null||e===void 0?void 0:e.emit()};e.prototype.getSortedRoles=function(){return this.roleStore.state.roles.sort((function(e,t){return e.sequence===t.sequence?e.order-t.order:e.sequence-t.sequence}))};e.prototype.getSequenceNumbers=function(){var e=[];this.getSortedRoles().forEach((function(t){if(!e.includes(t.sequence)){e.push(t.sequence)}}));return e.sort((function(e,t){return e-t}))};e.prototype.getRoleNames=function(){var e=this.getSortedRoles();return e.map((function(e){return e.name}))};e.prototype.getRolesAtSequence=function(e){return this.roleStore.state.roles.filter((function(t){return t&&t.sequence===e}))};e.prototype.renumberTemplateRoles=function(){var e=this;var t=[];var i=[];this.getSequenceNumbers().forEach((function(o,r){e.getRolesAtSequence(o).forEach((function(o,s){if(!t.includes(o.name)){o.sequence=r+1;o.order=s+1;t.push(o.name);i.push(k(e.endpoint,e.templateId,o.name,{sequence:o.sequence,order:o.order}))}}))}));return Promise.all(i)};e.prototype.getNextRoleName=function(){var e="";var t=Object.keys(this.roleStore.state).length-1;do{t++;e="Recipient ".concat(t)}while(!e||this.roleStore.state.roles.some((function(t){return t&&t.name===e})));return e};e.prototype.callCreateRole=function(e,t,i){var o=this;console.log("[ROLES] Will create role",{name:e,sequence:t,order:i});_(this.endpoint,this.templateId,{template_id:this.templateId,name:e,sequence:t,message:"",order:i,full_name:"",email:"",phone:"",type:"signer",delegator:false}).then((function(e){return __awaiter(o,void 0,void 0,(function(){var t;return __generator(this,(function(i){switch(i.label){case 0:console.log("[ROLES] Created role",e);this.roleStore.set("roles",__spreadArray(__spreadArray([],this.roleStore.state.roles,true),[e],false));return[4,this.renumberTemplateRoles()];case 1:i.sent();(t=this.rolesUpdated)===null||t===void 0?void 0:t.emit({event:"added",endpoint:this.endpoint,templateId:this.templateId,roles:this.getSortedRoles()});return[2]}}))}))})).catch((function(e){console.log("[ROLES] Error creating role",e)}))};e.prototype.handleAddRole=function(e,t){e.stopPropagation();var i=this.getRolesAtSequence(t).length+1;var o=this.getNextRoleName();this.callCreateRole(o,t,i)};e.prototype.handleAddStep=function(e,t){e.stopPropagation();var i=1;var o=this.getNextRoleName();this.callCreateRole(o,t,i)};e.prototype.render=function(){var e=this;var t,i,n,l;if(!this.endpoint.session){return o(r,null,o("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if(this.loading||!((t=this.templateStore)===null||t===void 0?void 0:t.state.isLoaded)){console.log("Loading",this.loading,(i=this.templateStore)===null||i===void 0?void 0:i.state.isLoaded);return o(r,{class:"loading"},o("verdocs-loader",null))}console.log("Rendering roles",this.roleStore.get("roles"));var a=this.getRoleNames();var d=this.getSequenceNumbers();console.log("Rendering",a,d);return o(r,null,o("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},o("h5",null,"Roles and Workflow"),o("div",{class:"participants"},o("div",{class:"left-line"}),o("div",{class:"row"},o("div",{class:"icon",innerHTML:Ne}),o("div",{class:"row-roles"},o("div",{class:"sender"},o("span",{class:"label"},"Sender:")," ",De[(l=(n=this.templateStore)===null||n===void 0?void 0:n.state)===null||l===void 0?void 0:l.sender]," ",o("div",{class:"settings-button",innerHTML:Ue,onClick:function(){return e.showingSenderDialog=true},"aria-role":"button"})))),o("div",{class:"row add-sequence","data-sequence":0},o("div",{class:"icon",innerHTML:Oe}),o("div",{class:"row-roles"},o("div",{class:"dropzone","data-sequence":0,"data-order":1},"Add Step"))),d.map((function(t){return o(s,null,o("div",{class:"row"},o("div",{class:"icon",innerHTML:je}),o("div",{class:"row-roles"},o("div",{class:"dropzone","data-order":.5,"data-sequence":t}),e.getRolesAtSequence(t).map((function(i){var r=!i.email;return r?o(s,null,o("div",{class:"recipient",style:{backgroundColor:p(S(e.roleStore,i.name))},"data-rolename":i.name,"data-sequence":t,"data-order":i.order},o("span",{class:"type-icon",innerHTML:i.type==="signer"?Pe:i.type==="cc"?Qe:Fe}),i.name," ",o("div",{class:"settings-button",innerHTML:Ue,onClick:function(){return e.showingRoleDialog=i.name},"aria-role":"button"})),o("div",{class:"dropzone","data-order":i.order+.5,"data-sequence":t})):o(s,null,o("div",{class:"recipient",style:{borderColor:p(S(e.roleStore,i.name))},"data-rolename":i.name,"data-sequence":t,"data-order":i.order},o("span",{class:"type-icon",innerHTML:i.type==="signer"?Pe:i.type==="cc"?Qe:Fe}),i.full_name," ",o("div",{class:"settings-button",innerHTML:Ue,onClick:function(){return e.showingRoleDialog=i.name},"aria-role":"button"})),o("div",{class:"dropzone","data-order":i.order+.5,"data-sequence":t}))})),o("button",{class:"add-role",innerHTML:Oe,onClick:function(i){return e.handleAddRole(i,t)}}))),d.length>0&&o("div",{class:"row add-sequence","data-sequence":t},o("div",{class:"row-roles"},o("div",{class:"icon",innerHTML:Oe}),o("div",{class:"dropzone","data-sequence":t+1,"data-order":1},"Add Step"))))})),o("div",{class:"row","data-sequence":d.length+1},o("div",{class:"row-roles"},o("div",{class:"icon",innerHTML:Oe}),o("button",{class:"add-step",innerHTML:Oe,onClick:function(t){return e.handleAddStep(t,d.length+1)}}))),o("div",{class:"row"},o("div",{class:"icon",innerHTML:Be}),o("div",{class:"row-roles"},o("div",{class:"complete"},"Document Complete")))),a.length<1&&o("div",{class:"empty"},"You must add at least one Role before proceeding.",o("br",null)," Click the ",o("span",{innerHTML:Oe})," Add button above to get started."),o("div",{class:"buttons"},o("div",{class:"flex-fill"}),o("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:function(){return e.handleCancel()}}),o("verdocs-button",{label:"OK",size:"small",onClick:function(){return e.handleSubmit()},disabled:a.length<1}))),this.showingRoleDialog&&o("verdocs-template-role-properties",{endpoint:this.endpoint,templateId:this.templateId,roleName:this.showingRoleDialog,onClose:function(){e.showingRoleDialog=null},onDelete:function(){return __awaiter(e,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:this.showingRoleDialog=null;return[4,this.renumberTemplateRoles()];case 1:t.sent();(e=this.rolesUpdated)===null||e===void 0?void 0:e.emit({event:"deleted",endpoint:this.endpoint,templateId:this.templateId,roles:this.getSortedRoles()});return[2]}}))}))}}),this.showingSenderDialog&&o("verdocs-template-sender",{endpoint:this.endpoint,templateId:this.templateId,onClose:function(){return e.showingSenderDialog=false}}))};Object.defineProperty(e.prototype,"el",{get:function(){return n(this)},enumerable:false,configurable:true});return e}());Ye.style=Ae;var We='@-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}';var Xe=We;var Ge=e("verdocs_template_visibility",function(){function e(e){t(this,e);this.close=i(this,"close",7);this.sdkError=i(this,"sdkError",7);this.templateUpdated=i(this,"templateUpdated",7);this.store=null;this.endpoint=l.getDefault();this.templateId="";this.dirty=false;this.personal=false;this.public=false}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,o,r,s,n,l,a;return __generator(this,(function(d){switch(d.label){case 0:d.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.templateId){console.log("[VISIBILITY] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[VISIBILITY] Unable to start builder session, must be authenticated");return[2]}l=this;return[4,L(this.endpoint,this.templateId,false)];case 1:l.store=d.sent();this.personal=((t=(e=this.store)===null||e===void 0?void 0:e.state)===null||t===void 0?void 0:t.is_personal)||true;this.public=((o=(i=this.store)===null||i===void 0?void 0:i.state)===null||o===void 0?void 0:o.is_public)||false;this.dirty=false;return[3,3];case 2:a=d.sent();console.log("[TEMPLATE VISIBILITY] Error loading template",a);(r=this.sdkError)===null||r===void 0?void 0:r.emit(new D(a.message,(s=a.response)===null||s===void 0?void 0:s.status,(n=a.response)===null||n===void 0?void 0:n.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleCancel=function(e){var t,i,o,r,s;e.stopPropagation();this.personal=(i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.is_personal;this.public=(r=(o=this.store)===null||o===void 0?void 0:o.state)===null||r===void 0?void 0:r.is_public;this.dirty=false;(s=this.close)===null||s===void 0?void 0:s.emit()};e.prototype.handleSave=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i,o;return __generator(this,(function(r){switch(r.label){case 0:e.stopPropagation();return[4,b(this.endpoint,this.templateId,{is_personal:this.personal,is_public:this.public})];case 1:r.sent();if((t=this.store)===null||t===void 0?void 0:t.state){this.store.state.is_personal=this.personal;this.store.state.is_public=this.public}this.dirty=false;(i=this.templateUpdated)===null||i===void 0?void 0:i.emit({endpoint:this.endpoint,template:this.store.state,event:"visibility"});(o=this.close)===null||o===void 0?void 0:o.emit();return[2]}}))}))};e.prototype.render=function(){var e=this;var t,i;if(!this.endpoint.session){return o(r,null,o("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if(!this.endpoint.session||!((i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.isLoaded)){return o(r,{class:"empty"})}return o(r,null,o("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},o("h5",null,"Visibility"),o("div",{class:"input-row"},o("label",{htmlFor:"verdocs-is-shared"},"Shared"),o("verdocs-checkbox",{id:"verdocs-is-shared",name:"is-shared",checked:!this.personal,value:"on",onInput:function(t){e.personal=!t.target.checked;e.dirty=true}})),o("div",{class:"description"},"Shared templates are visible to other members of your Organization (if any)."),o("div",{class:"input-row"},o("label",{htmlFor:"verdocs-is-public"},"Public"),o("verdocs-checkbox",{id:"verdocs-is-public",name:"is-public",checked:this.public,value:"on",onInput:function(t){e.public=t.target.checked;e.dirty=true}})),o("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)."),o("div",{class:"buttons"},o("verdocs-button",{size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:function(t){return e.handleCancel(t)}}),o("verdocs-button",{size:"small",label:"Save",disabled:!this.dirty,onClick:function(t){return e.handleSave(t)}}))))};return e}());Ge.style=Xe}}}));
1
+ var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var t,i=1,o=arguments.length;i<o;i++){t=arguments[i];for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r))e[r]=t[r]}return e};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(e,t,i,o){function r(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,s){function n(e){try{a(o.next(e))}catch(e){s(e)}}function l(e){try{a(o["throw"](e))}catch(e){s(e)}}function a(e){e.done?i(e.value):r(e.value).then(n,l)}a((o=o.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var i={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},o,r,s,n;return n={next:l(0),throw:l(1),return:l(2)},typeof Symbol==="function"&&(n[Symbol.iterator]=function(){return this}),n;function l(e){return function(t){return a([e,t])}}function a(l){if(o)throw new TypeError("Generator is already executing.");while(n&&(n=0,l[0]&&(i=0)),i)try{if(o=1,r&&(s=l[0]&2?r["return"]:l[0]?r["throw"]||((s=r["return"])&&s.call(r),0):r.next)&&!(s=s.call(r,l[1])).done)return s;if(r=0,s)l=[l[0]&2,s.value];switch(l[0]){case 0:case 1:s=l;break;case 4:i.label++;return{value:l[1],done:false};case 5:i.label++;r=l[1];l=[0];continue;case 7:l=i.ops.pop();i.trys.pop();continue;default:if(!(s=i.trys,s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){i=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){i.label=l[1];break}if(l[0]===6&&i.label<s[1]){i.label=s[1];s=l;break}if(s&&i.label<s[2]){i.label=s[2];i.ops.push(l);break}if(s[2])i.ops.pop();i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e];r=0}finally{o=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,i){if(i||arguments.length===2)for(var o=0,r=t.length,s;o<r;o++){if(s||!(o in t)){if(!s)s=Array.prototype.slice.call(t,0,o);s[o]=t[o]}}return e.concat(s||Array.prototype.slice.call(t))};System.register(["./p-e748b2d2.system.js","@verdocs/js-sdk","./p-98f14855.system.js","./p-a1f6189b.system.js","./p-6a82e278.system.js","./p-94c638b9.system.js","./p-c8a15cb7.system.js","./p-cd546dbe.system.js","./p-6d1bdae8.system.js","./p-7ce23c90.system.js","./p-f7620900.system.js","./p-952b88fb.system.js","./p-1a180595.system.js","./p-f24d887c.system.js"],(function(e){"use strict";var t,i,o,r,s,n,l,a,d,c,u,p,v,h,f,m,g,b,x,w,y,k,_,E,C,q,z,S,M,L,H,I,Z,T,V,R,A,D,U,N,j,B,O,P,F,Q,Y;return{setters:[function(e){t=e.r;i=e.c;o=e.h;r=e.H;s=e.F;n=e.g},function(e){l=e.VerdocsEndpoint;a=e.integerSequence;d=e.createEnvelope;c=e.isValidEmail;u=e.isValidPhone;p=e.getRGBA;v=e.createTemplateDocument;h=e.deleteTemplateDocument;f=e.createTemplatev2;m=e.updateField;g=e.createField;b=e.updateTemplate;x=e.createTemplateReminder;w=e.updateTemplateReminder;y=e.deleteTemplateReminder;k=e.updateTemplateRole;_=e.createTemplateRole},function(e){E=e.g;C=e.u},function(e){q=e.g;z=e.b;S=e.a;M=e.u},function(e){L=e.g},function(e){H=e.r;I=e.b;Z=e.c;T=e.g;V=e.d;R=e.e;A=e.f},function(e){D=e.S},function(e){U=e.D;N=e.P;j=e.J;B=e.a;O=e.F;P=e.b;F=e.T},function(e){Q=e.i},function(e){Y=e.V},function(){},function(){},function(){},function(){}],execute:function(){var W='@-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}';var X=W;var G=e("verdocs_preview",function(){function e(e){t(this,e);this.sdkError=i(this,"sdkError",7);this.templateStore=null;this.fieldStore=null;this.roleStore=null;this.endpoint=l.getDefault();this.templateId=null;this.loading=true}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i;var o=this;return __generator(this,(function(r){try{this.endpoint.loadSession();if(!this.templateId){console.log("[PREVIEW] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[PREVIEW] Unable to start builder session, must be authenticated");return[2]}L(this.endpoint,this.templateId,true).then((function(e){o.templateStore=e;console.log("[PREVIEW] Loaded Template Store",e.state);o.fieldStore=E(o.templateId);o.roleStore=q(o.templateId);console.log("[PREVIEW] Loaded template",o.templateStore.state,o.roleStore.get("roles"),o.fieldStore.get("fields"));o.loading=false})).catch((function(e){console.log(e)}))}catch(o){console.log("[PREVIEW] Error with preview session",o);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new D(o.message,(t=o.response)===null||t===void 0?void 0:t.status,(i=o.response)===null||i===void 0?void 0:i.data))}return[2]}))}))};e.prototype.handlePageRendered=function(e){var t,i;var o=e.detail;var r=(i=(t=this.templateStore)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.fields.filter((function(e){return e.page===o.pageNumber}));console.log("[PREVIEW] Page rendered",o,r);r.forEach((function(e){return H(e,o,{disabled:true,editable:false,draggable:false})}))};e.prototype.render=function(){var e=this;var t,i;if(this.loading){return o(r,null,o("verdocs-loader",null))}return o(r,null,(((i=(t=this.templateStore)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.documents)||[]).map((function(t){var i=a(1,t.pages);return o(s,null,i.map((function(i){return o("verdocs-template-document-page",{templateId:t.template_id,documentId:t.id,pageNumber:i,disabled:true,editable:true,done:false,virtualWidth:612,virtualHeight:792,onPageRendered:function(t){return e.handlePageRendered(t)},layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})})))})))};return e}());G.style=X;var K='@-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;display:none}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)}';var J=K;var $='<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>';var ee='<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>';var te='<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>';var ie='<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>';var oe=e("verdocs_send",function(){function e(e){t(this,e);this.sendingEnvelope=i(this,"sendingEnvelope",7);this.send=i(this,"send",7);this.exit=i(this,"exit",7);this.sdkError=i(this,"sdkError",7);this.searchContacts=i(this,"searchContacts",7);this.levels=[];this.templateStore=null;this.roleStore=null;this.endpoint=l.getDefault();this.templateId=null;this.environment="web";this.containerId="verdocs-send-".concat(Math.random().toString(36).substring(2,11));this.rolesAtLevel={};this.showPickerForId="";this.sessionContacts=[];this.sending=false;this.rolesCompleted={}}e.prototype.reset=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.rolesCompleted={};return[2]}))}))};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,o,r,s,n,l,a,d;var c=this;return __generator(this,(function(u){switch(u.label){case 0:u.trys.push([0,2,,3]);n=this.endpoint.loadSession();if(!this.templateId){console.log("[SEND] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[SEND] Unable to start builder session, must be authenticated");return[2]}l=this;return[4,L(this.endpoint,this.templateId,false)];case 1:l.templateStore=u.sent();this.roleStore=q(this.templateId);if(!((t=(e=this.templateStore)===null||e===void 0?void 0:e.state)===null||t===void 0?void 0:t.is_sendable)){console.warn("[SEND] Template is not sendable",this.templateId)}if(this.roleStore.get("roles")){a={};this.rolesCompleted={};this.roleStore.get("roles").forEach((function(e){var t=e.sequence-1;a[t]||(a[t]=[]);var i="r-".concat(t,"-").concat(a[t].length);a[t].push(__assign(__assign({},e),{id:i}));if(e.full_name&&(e.email||e.phone)){c.rolesCompleted[i]=__assign(__assign({},e),{id:i})}}));this.rolesAtLevel=a;this.levels=Object.keys(a).map((function(e){return+e}));this.levels.sort((function(e,t){return e-t}))}if((i=n===null||n===void 0?void 0:n.session)===null||i===void 0?void 0:i.profile){this.sessionContacts.push({id:n.session.profile.id,name:"".concat(n.session.profile.first_name," ").concat(n.session.profile.last_name),email:n.session.profile.email,phone:n.session.profile.phone})}return[3,3];case 2:d=u.sent();console.log("[SEND] Error with preview session",d);(o=this.sdkError)===null||o===void 0?void 0:o.emit(new D(d.message,(r=d.response)===null||r===void 0?void 0:r.status,(s=d.response)===null||s===void 0?void 0:s.data));return[3,3];case 3:return[2]}}))}))};e.prototype.getLevelIcon=function(e){if(e<0){return o("div",{class:"level-icon",innerHTML:ee})}else if(e>=this.levels.length){return o("div",{class:"level-icon",innerHTML:ie})}else{return o("div",{class:"level-icon",innerHTML:te})}};e.prototype.handleSelectContact=function(e,t){e.preventDefault();this.rolesCompleted[t.id]=__assign(__assign({},t),e.detail);this.showPickerForId=""};e.prototype.handleClickRole=function(e,t){e.stopPropagation();this.showPickerForId=t.id};e.prototype.handleSend=function(e){var t=this;var i,o,r;if(this.sending){console.log("Skipping duplicate send",e);return}console.log("Sending",e);e.preventDefault();e.stopPropagation();this.sending=true;(i=this.sendingEnvelope)===null||i===void 0?void 0:i.emit({sending:true});var s={template_id:this.templateId,name:(r=(o=this.templateStore)===null||o===void 0?void 0:o.state)===null||r===void 0?void 0:r.name,environment:this.environment,roles:Object.values(this.rolesCompleted),prepared_fields:[]};console.log("[SEND] Creating envelope",s);d(this.endpoint,s).then((function(e){var i,o;console.log("[SEND] Send envelope",e);t.reset().catch((function(e){return console.log("Unknown Error",e)}));t.sending=false;(i=t.sendingEnvelope)===null||i===void 0?void 0:i.emit({sending:false});(o=t.send)===null||o===void 0?void 0:o.emit(__assign(__assign({},s),{envelope_id:e.id,envelope:e}))})).catch((function(e){var i;console.log("Send error",e);t.sending=false;(i=t.sendingEnvelope)===null||i===void 0?void 0:i.emit({sending:false})}))};e.prototype.handleCancel=function(e){var t;e.stopPropagation();(t=this.exit)===null||t===void 0?void 0:t.emit()};e.prototype.render=function(){var e=this;var t,i;var s=z(this.roleStore);var n=Object.values(this.rolesCompleted).filter((function(e){return c(e.email)||u(e.phone)}));var l=n.length>=s.length;return o(r,{key:"ecdc1830949a5a35b092167b201c6feb8284e221",class:{sendable:(i=(t=this.templateStore)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.is_sendable}},o("div",{key:"2d8ebba91a5cff228135465c0956848fcc8873b5",class:"recipients"},o("div",{key:"1c72951bfc1e11a1d95c04e005b3fcd8108c39f5",class:"left-line"}),o("div",{key:"82834a006584cde2b8020f7f233dfff685e647f2",class:"level level-start"},this.getLevelIcon(-1),o("div",{key:"930ca1cc5b3f93f11f0a38703396538ee90dba5b",class:"complete"},"Send Envelope")),this.levels.map((function(t){return o("div",{class:"level level-".concat(t)},e.getLevelIcon(t),e.rolesAtLevel[t].map((function(t){var i,r,s,n,l,a;var d=!t.email;var c="verdocs-send-recipient-".concat(t.name);return d?o("div",{class:"recipient",style:{backgroundColor:p(S(e.roleStore,t.name))},onClick:function(i){return e.handleClickRole(i,t)},id:c},(r=(i=e.rolesCompleted[t.id])===null||i===void 0?void 0:i.full_name)!==null&&r!==void 0?r:t.name,o("div",{class:"icon",innerHTML:$}),e.showPickerForId===t.id&&o("verdocs-portal",{anchor:c,onClickAway:function(){return e.showPickerForId=""}},o("verdocs-contact-picker",{onExit:function(){return e.showPickerForId=""},onNext:function(i){return e.handleSelectContact(i,t)},contactSuggestions:e.sessionContacts,templateRole:(s=e.rolesCompleted[t.id])!==null&&s!==void 0?s:t,onSearchContacts:function(t){var i;return(i=e.searchContacts)===null||i===void 0?void 0:i.emit(t.detail)}}))):o("div",{class:"recipient",style:{borderColor:p(S(e.roleStore,t.name))},onClick:function(i){return e.handleClickRole(i,t)},id:c},(l=(n=e.rolesCompleted[t.id])===null||n===void 0?void 0:n.full_name)!==null&&l!==void 0?l:t.full_name,o("div",{class:"icon",innerHTML:$}),e.showPickerForId===t.id&&o("verdocs-portal",{anchor:c,onClickAway:function(){return e.showPickerForId=""}},o("verdocs-contact-picker",{onExit:function(){return e.showPickerForId=""},onNext:function(i){return e.handleSelectContact(i,t)},contactSuggestions:e.sessionContacts,templateRole:(a=e.rolesCompleted[t.id])!==null&&a!==void 0?a:t,onSearchContacts:function(t){var i;return(i=e.searchContacts)===null||i===void 0?void 0:i.emit(t.detail)}})))})))})),o("div",{key:"241118ea059aadb8a6030b5ee5bd4383e88af212",class:"level level-done"},this.getLevelIcon(this.levels.length),o("div",{key:"05ba689ac40aaf1543b921b490f8fe4550bad4df",class:"complete"},"Signing Complete"))),o("div",{key:"39c73b0a3310d85dfbd29f2d2fda347d37091e90",class:"buttons"},o("verdocs-button",{key:"c3d1196a34f1cd4ab654aa07b707372054f26202",label:"Cancel",size:"small",variant:"outline",onClick:function(t){return e.handleCancel(t)},disabled:this.sending}),o("verdocs-button",{key:"d2e16d7a4d97c8888df3e7257296dee6f8db3234",label:"Send",size:"small",disabled:!l||this.sending,onClick:function(t){return e.handleSend(t)}}),this.sending&&o("verdocs-spinner",{key:"d8c0a234261d1b77d6343dd7e426c28475dceadf"})))};return e}());oe.style=J;var re='@-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}';var se=re;var ne=e("verdocs_template_attachments",function(){function e(e){t(this,e);this.exit=i(this,"exit",7);this.next=i(this,"next",7);this.templateUpdated=i(this,"templateUpdated",7);this.sdkError=i(this,"sdkError",7);this.endpoint=l.getDefault();this.templateId="";this.uploading=false;this.progressLabel="Uploading...";this.progressPercent=0;this.showDeleteError=false;this.confirmDeleteDocument=null;this.store=null}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,o,r;return __generator(this,(function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.templateId){console.log("[ROLES] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[ROLES] Unable to start builder session, must be authenticated");return[2]}o=this;return[4,L(this.endpoint,this.templateId,false)];case 1:o.store=s.sent();return[3,3];case 2:r=s.sent();console.log("[TEMPLATE ATTACHMENTS] Error loading template",r);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new D(r.message,(t=r.response)===null||t===void 0?void 0:t.status,(i=r.response)===null||i===void 0?void 0:i.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleCancel=function(e){e.stopPropagation();this.exit.emit()};e.prototype.handleUploadProgress=function(e){if(e>=99){this.progressPercent=100;this.progressLabel="Processing..."}else{this.progressPercent=e}};e.prototype.handleUpload=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i,o,r,s,n,l,a;return __generator(this,(function(d){switch(d.label){case 0:e.stopPropagation();s=e.detail.file;if(!s){return[2]}console.log("[ATTACHMENTS] Uploading...",s);this.uploading=true;this.progressLabel="Uploading...";d.label=1;case 1:d.trys.push([1,4,,5]);return[4,v(this.endpoint,this.templateId,s,this.handleUploadProgress.bind(this))];case 2:n=d.sent();console.log("[ATTACHMENTS] Created attachment",n);l=this;return[4,L(this.endpoint,this.templateId,false)];case 3:l.store=d.sent();console.log("[ATTACHMENTS] Updated template",this.store.state);(t=this.templateUpdated)===null||t===void 0?void 0:t.emit({endpoint:this.endpoint,template:this.store.state,event:"attachments"});this.uploading=false;this.progressLabel="";this.progressPercent=0;return[3,5];case 4:a=d.sent();console.log("[ATTACHMENTS] Error creating template",a);(i=this.sdkError)===null||i===void 0?void 0:i.emit(new D(a.message,(o=a.response)===null||o===void 0?void 0:o.status,(r=a.response)===null||r===void 0?void 0:r.data));this.uploading=false;return[3,5];case 5:return[2]}}))}))};e.prototype.handleNext=function(e){var t;e.stopPropagation();this.uploading=false;this.progressLabel="";this.progressPercent=0;(t=this.next)===null||t===void 0?void 0:t.emit({template:this.store.state})};e.prototype.confirmDelete=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:return[4,h(this.endpoint,this.templateId,this.confirmDeleteDocument.id)];case 1:t.sent();e=this;return[4,L(this.endpoint,this.templateId,false)];case 2:e.store=t.sent();console.log("[ATTACHMENTS] New template",this.store.state);this.confirmDeleteDocument=null;return[2]}}))}))};e.prototype.handleDelete=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(i){if(((t=this.store.state)===null||t===void 0?void 0:t.documents.length)>1){this.confirmDeleteDocument=e}else{this.showDeleteError=true}return[2]}))}))};e.prototype.getFileIcon=function(e){switch(e.mime){case"application/pdf":return B;case"image/jpeg":return j;case"image/png":return N;case"application/msword":case"application/vnd.openxmlformats-officedocument.wordprocessingml.document":return U}return O};e.prototype.render=function(){var e=this;var t,i,s;if(!this.endpoint.session){return o(r,null,o("verdocs-component-error",{message:"You must be authenticated to use this module."}))}var n=(t=this.store)===null||t===void 0?void 0:t.state;if(!n.isLoaded){return o(r,{class:"loading"},o("verdocs-loader",null))}if(!this.endpoint.session||!n.profile_id){return o(r,{class:"empty"})}return o(r,null,o("h5",null,"Existing Attachments"),o("div",{class:"attachments"},(i=this.store)===null||i===void 0?void 0:i.state.documents.map((function(t){return o("div",{class:"attachment"},o("div",{class:"file-icon",innerHTML:e.getFileIcon(t)}),o("div",{class:"filename",title:t.name},t.name),o("div",{class:"pages"},o("div",{class:"count"},t.pages),o("div",{class:"pages-icon",innerHTML:P})),o("div",{class:"trash-icon",innerHTML:F,onClick:function(){return e.handleDelete(t)}}))}))),o("h5",null,"Attach a New Document"),this.uploading?o("div",{class:"loader-wrapper"},o("verdocs-loader",null),this.progressLabel&&o("div",{class:"progress-wrapper"},o("verdocs-progress-bar",{showPercent:true,percent:this.progressPercent,label:this.progressLabel}))):o("verdocs-file-chooser",{onFileSelected:function(t){return e.handleUpload(t)}}),o("div",{class:"buttons"},o("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:function(t){return e.handleCancel(t)},disabled:this.uploading}),o("verdocs-button",{label:"Next",size:"small",onClick:function(t){return e.handleNext(t)},disabled:!((s=this.store)===null||s===void 0?void 0:s.state.documents.length)||this.uploading})),this.showDeleteError&&o("verdocs-ok-dialog",{heading:"Unable to Delete Attachment",message:"Templates must contain at least one attachment.",onNext:function(){return e.showDeleteError=false}}),this.confirmDeleteDocument&&o("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:function(){return e.confirmDelete()},showCancel:true,onExit:function(){e.confirmDeleteDocument=null}}))};return e}());ne.style=se;var le='@-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:20px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}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}';var ae=le;var de=["attachments","roles","settings","fields","preview"];var ce=e("verdocs_template_build_tabs",function(){function e(e){t(this,e);this.sdkError=i(this,"sdkError",7);this.stepChanged=i(this,"stepChanged",7);this.endpoint=l.getDefault();this.templateId=null;this.step="preview";this.store=null}e.prototype.onStepChanged=function(){console.log("Step changed",this.step,this.templateId);this.loadTemplate().catch((function(e){return console.log("Unknown Error",e)}))};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i;return __generator(this,(function(o){try{this.endpoint.loadSession();if(!this.endpoint.session){console.log("[BUILD_TABS] Unable to start builder session, must be authenticated");return[2]}if(!this.templateId){this.step="preview";return[2]}this.loadTemplate().catch((function(e){return console.log("[BUILD_TABS] Unable to load template",e)}))}catch(o){console.log("[BUILD_TABS] Error loading template",o);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new D(o.message,(t=o.response)===null||t===void 0?void 0:t.status,(i=o.response)===null||i===void 0?void 0:i.data))}return[2]}))}))};e.prototype.loadTemplate=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:if(!this.templateId)return[3,2];e=this;return[4,L(this.endpoint,this.templateId,false)];case 1:e.store=t.sent();t.label=2;case 2:return[2]}}))}))};e.prototype.setStep=function(e){var t;console.log("Selected step",e.detail.tab.id);e.stopPropagation();e.preventDefault();this.step=e.detail.tab.id;(t=this.stepChanged)===null||t===void 0?void 0:t.emit(e.detail.tab.id)};e.prototype.render=function(){var e=this;var t,i,s,n,l,a,d,c,u;if(!this.endpoint.session){return o(r,null,o("verdocs-component-error",{message:"You must be authenticated to use this module."}))}var p=false;var v=false;var h=false;console.log("[BUILD_TABS] Rendering tabs",this.templateId,this.step);if(this.templateId&&this.store&&this.store.state){h=((s=(i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.documents)===null||s===void 0?void 0:s.length)>0;v=h&&((a=(l=(n=this.store)===null||n===void 0?void 0:n.state)===null||l===void 0?void 0:l.roles)===null||a===void 0?void 0:a.length)>0;p=v&&((u=(c=(d=this.store)===null||d===void 0?void 0:d.state)===null||c===void 0?void 0:c.fields)===null||u===void 0?void 0:u.length)>0}var f=Math.max(de.indexOf(this.step),0);if(!p&&f>=4){f=3}if(!v&&f>=3){f=1}if(!h&&f>=1){f=0}console.log({selectedStepIndex:f,canPreview:p,canEditFields:v,canEditRoles:h});return o(r,null,o("verdocs-tabs",{onSelectTab:function(t){return e.setStep(t)},selectedTab:f,tabs:[{id:"attachments",disabled:false,label:this.templateId&&this.store?"Attachment(s)":"Upload Attachment(s)"},{id:"roles",disabled:!h,label:"Roles"},{id:"settings",disabled:!v,label:"Settings"},{id:"fields",disabled:!v,label:"Fields"},{id:"preview",disabled:!p,label:"Preview/Send"}]}))};Object.defineProperty(e,"watchers",{get:function(){return{step:["onStepChanged"]}},enumerable:false,configurable:true});return e}());ce.style=ae;var ue='@-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}';var pe=ue;var ve=" ";var he='<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>';var fe=e("verdocs_template_create",function(){function e(e){t(this,e);this.exit=i(this,"exit",7);this.next=i(this,"next",7);this.sdkError=i(this,"sdkError",7);this.templateCreated=i(this,"templateCreated",7);this.endpoint=l.getDefault();this.file=undefined;this.creating=false;this.progressLabel="Uploading...";this.progressPercent=0}e.prototype.componentWillLoad=function(){this.endpoint.setTimeout(3e4);this.endpoint.loadSession()};e.prototype.handleFileChanged=function(e){var t;this.file=((t=e.target.files)===null||t===void 0?void 0:t[0])||null;console.log("[CREATE] Selected file",this.file)};e.prototype.handleUpload=function(e){e.stopPropagation();var t=document.getElementById("verdocs-template-create-file");t.click()};e.prototype.handleCancel=function(e){e.stopPropagation();this.exit.emit()};e.prototype.handleSubmit=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i,o,r,s;var n=this;return __generator(this,(function(l){switch(l.label){case 0:e.stopPropagation();console.log("Submitting");if(!this.file){return[2]}this.creating=true;this.progressLabel="Uploading...";l.label=1;case 1:l.trys.push([1,3,,4]);return[4,f(this.endpoint,{name:this.file.name,documents:[this.file]},(function(e){if(e>=99){n.progressLabel="Processing...";n.progressPercent=100}else{n.progressPercent=e}}))];case 2:r=l.sent();console.log("[CREATE] Created template",r);L(this.endpoint,r.id,true).then((function(){var e,t;(e=n.templateCreated)===null||e===void 0?void 0:e.emit({endpoint:n.endpoint,template:r,templateId:r.id});(t=n.next)===null||t===void 0?void 0:t.emit(r);n.creating=false;n.progressLabel="";n.progressPercent=0})).catch((function(e){console.log(e)}));return[3,4];case 3:s=l.sent();console.log("[CREATE] Error creating template",s);(t=this.sdkError)===null||t===void 0?void 0:t.emit(new D(s.message,(i=s.response)===null||i===void 0?void 0:i.status,(o=s.response)===null||o===void 0?void 0:o.data));this.creating=false;return[3,4];case 4:return[2]}}))}))};e.prototype.render=function(){var e=this;if(!this.endpoint.session){return o(r,null,o("verdocs-component-error",{message:"You must be authenticated to use this module."}))}return o(r,null,o("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},o("input",{type:"file",id:"verdocs-template-create-file",multiple:true,accept:"application/pdf",style:{display:"none"},onChange:function(t){return e.handleFileChanged(t)}}),this.creating?o("div",{class:"loader-wrapper"},o("verdocs-loader",null),this.progressLabel&&o("div",{class:"progress-wrapper"},o("verdocs-progress-bar",{showPercent:true,percent:this.progressPercent,label:this.progressLabel}))):o("div",{class:"upload-box",onDrop:function(t){t.preventDefault();t.target.classList.remove("drag-over");e.file=t.dataTransfer.files[0]},onDragOver:function(e){e.preventDefault();e.dataTransfer.dropEffect="copy"},onDragEnter:function(e){return e.target.classList.add("drag-over")},onDragLeave:function(e){return e.target.classList.remove("drag-over")}},o("div",null,o("span",{innerHTML:he})),o("div",{style:{marginTop:"20px",fontSize:"20px",fontWeight:"bold",overflowWrap:"anywhere"}},this.file?this.file.name:"Drag a file here"),o("div",{style:{marginTop:"20px",marginBottom:"20px",fontSize:"16px",height:"20px"}},this.file?ve:"Or, if you prefer..."),o("verdocs-button",{label:this.file?"Select a different file":"Select a file from your computer",size:"small",onClick:function(t){return e.handleUpload(t)}})),o("div",{class:"buttons"},o("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:function(t){return e.handleCancel(t)},disabled:this.creating}),o("verdocs-button",{label:"Next",size:"small",onClick:function(t){return e.handleSubmit(t)},disabled:!this.file||this.creating}))))};return e}());fe.style=pe;var me="@-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;-ms-flex:0 0 50px;flex:0 0 50px;-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}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_group{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_button_group{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}";var ge=me;var be='<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>';var xe='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" 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"/></svg>';var we='<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>';var ye='<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>';var ke='<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>';var _e='<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>';var Ee='<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>';var Ce='<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>';var qe='<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>';var ze='<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>';var Se=[{id:"signature",tooltip:"Signature",icon:_e},{id:"initial",tooltip:"Initials",icon:Ee},{id:"sep1",tooltip:"",icon:ze},{id:"textbox",tooltip:"Text Box",icon:be},{id:"textarea",tooltip:"Text Area",icon:xe},{id:"checkbox_group",tooltip:"Check Box",icon:we},{id:"radio_button_group",tooltip:"Radio Button",icon:ye},{id:"dropdown",tooltip:"Dropdown",icon:qe},{id:"sep2",tooltip:"",icon:ze},{id:"date",tooltip:"Date",icon:ke},{id:"timestamp",tooltip:"Timestamp",icon:Ce}];var Me=e("verdocs_template_fields",function(){function e(e){t(this,e);this.sdkError=i(this,"sdkError",7);this.templateUpdated=i(this,"templateUpdated",7);this.fieldsUpdated=i(this,"fieldsUpdated",7);this.pageHeights={};this.templateStore=null;this.fieldStore=null;this.roleStore=null;this.cachedPageInfo={};this.endpoint=l.getDefault();this.templateId=null;this.toolbarTargetId=null;this.placing=null;this.showMustSelectRole=false;this.selectedRoleName="";this.loading=true}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i;var o=this;return __generator(this,(function(r){try{this.endpoint.loadSession();if(!this.templateId){console.log("[FIELDS] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[FIELDS] Unable to start builder session, must be authenticated");return[2]}L(this.endpoint,this.templateId,true).then((function(e){var t,i;o.templateStore=e;o.fieldStore=E(o.templateId);o.roleStore=q(o.templateId);o.selectedRoleName=((i=(t=o.roleStore.get("roles"))===null||t===void 0?void 0:t[0])===null||i===void 0?void 0:i.name)||"";o.loading=false;o.fieldStore.onChange("fields",(function(e){var t;console.log("[FIELDS] Fields changed",{fields:e});(t=o.fieldsUpdated)===null||t===void 0?void 0:t.emit({event:"updated",endpoint:o.endpoint,templateId:o.templateId,fields:e})}))})).catch((function(e){console.log(e)}))}catch(o){console.log("[FIELDS] Error with preview session",o);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new D(o.message,(t=o.response)===null||t===void 0?void 0:t.status,(i=o.response)===null||i===void 0?void 0:i.data))}return[2]}))}))};e.prototype.componentDidRender=function(){Q.dynamicDrop(true);var e=this.toolbarTargetId?document.getElementById(this.toolbarTargetId):null;var t=document.getElementById("verdocs-template-fields-toolbar");if(e&&t){console.log("[FIELDS] Moving toolbar");t.remove();e.append(t)}};e.prototype.componentWillUpdate=function(){var e=this;var t;var i=this.roleStore.get("roles");if(!this.selectedRoleName||!i.find((function(t){return t&&t.name===e.selectedRoleName}))){this.selectedRoleName=((t=i[0])===null||t===void 0?void 0:t.name)||"";console.log("[FIELDS] Selected new role",this.selectedRoleName)}};e.prototype.handleKeyDown=function(e){if(e.key==="Escape"){this.placing=null}};e.prototype.handleFieldChange=function(e,t,i){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){console.log("[FIELDS] handleFieldChange",e,t,i);return[2]}))}))};e.prototype.attachFieldAttributes=function(e,t,i){var o=this;i.addEventListener("input",(function(e){return o.handleFieldChange(t,e)}));i.addEventListener("settingsChanged",(function(e){var t,i;console.log("Settings changed",e.detail);(t=o.templateUpdated)===null||t===void 0?void 0:t.emit({endpoint:o.endpoint,template:(i=o.templateStore)===null||i===void 0?void 0:i.state,event:"added-field"})}));i.addEventListener("deleted",(function(){var e,r;console.log("[FIELDS] Deleted",o,t);i.remove();(e=o.templateUpdated)===null||e===void 0?void 0:e.emit({endpoint:o.endpoint,template:(r=o.templateStore)===null||r===void 0?void 0:r.state,event:"updated-field"})}));i.setAttribute("templateid",this.templateId);i.setAttribute("fieldname",t.name);i.setAttribute("pageNumber",e.pageNumber);i.setAttribute("xScale",e.xScale);i.setAttribute("yScale",e.yScale);i.setAttribute("name",t.name)};e.prototype.handlePageRendered=function(e){var t=this;var i=e.detail;this.cachedPageInfo[i.pageNumber]=i;this.pageHeights[i.pageNumber]=i.naturalHeight;this.fieldStore.get("fields").filter((function(e){return e&&e.page===i.pageNumber})).forEach((function(e){switch(e.type){case"checkbox_group":case"radio_button_group":(e.settings||{}).options.map((function(i,o){var r=V(e,o);var s=document.getElementById(r);if(s){s.setAttribute("fieldname",e.name);s.setAttribute("pagenumber",String(e.page));t.makeDraggable(s)}}));break;default:var i=T(e);var o=document.getElementById(i);if(o){o.setAttribute("fieldname",e.name);o.setAttribute("pagenumber",String(e.page));t.makeDraggable(o)}break}}))};e.prototype.makeDraggable=function(e){Q(e).draggable({listeners:{move:this.handleMoveField.bind(this),end:this.handleMoveEnd.bind(this)}})};e.prototype.handleMoveField=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i,o,r,s,n;return __generator(this,(function(l){t=+(e.target.getAttribute("posX")||0);i=+(e.target.getAttribute("posY")||0);o=+(e.target.getAttribute("xScale")||1);r=+(e.target.getAttribute("yScale")||1);s=e.dx/o+t;n=e.dy/r+i;e.target.setAttribute("posX",s);e.target.setAttribute("posy",n);I(e.target,"translate","".concat(s,"px, ").concat(n,"px"));return[2]}))}))};e.prototype.handleMoveEnd=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i,o,r,s,n,l,a,d,c,u,p,v,h,f,g,b,x,w,y,k,_,E,q,z;return __generator(this,(function(S){switch(S.label){case 0:o=e.target.getAttribute("fieldname");r=+(e.target.getAttribute("option")||"0");s=this.fieldStore.get("fields").find((function(e){return e.name===o}));if(!s){console.log("[FIELDS] Unable to find field",o,e.target);return[2]}n=e.target.getAttribute("pagenumber");l=this.cachedPageInfo[n],a=l.naturalWidth,d=a===void 0?612:a,c=l.naturalHeight,u=c===void 0?792:c,p=l.renderedHeight,v=p===void 0?792:p;h=e.target.getBoundingClientRect();f=e.target.parentElement;g=f.getBoundingClientRect();b=s.settings.width||R(s.type);x=s.settings.height||A(s.type);w=Math.max(h.left-g.left,0);y=Math.max(v-(g.bottom-h.bottom),0);k=this.viewCoordinatesToPageCoordinates(w,y,n,d-b,u-x),_=k.x,E=k.y;switch(s.type){case"attachment":case"payment":case"initial":case"signature":case"date":case"dropdown":case"textarea":case"textbox":case"timestamp":s.settings.x=_;s.settings.y=E;break;case"checkbox_group":case"radio_button_group":{q=s.settings.options[r];if(q){q.x=_;q.y=E}}break}console.log("[FIELDS] Will update",o,E,r,s);return[4,m(this.endpoint,this.templateId,o,s)];case 1:z=S.sent();C(this.fieldStore,o,z);e.target.removeAttribute("posX");e.target.removeAttribute("posY");Z(e.target);(t=this.templateUpdated)===null||t===void 0?void 0:t.emit({endpoint:this.endpoint,template:(i=this.templateStore)===null||i===void 0?void 0:i.state,event:"updated-field"});return[2]}}))}))};e.prototype.generateFieldName=function(e,t){var i=1;var o;do{o="".concat(e,"P").concat(t,"-").concat(i);i++}while(this.fieldStore.get("fields").some((function(e){return e&&e.name===o})));return o};e.prototype.viewCoordinatesToPageCoordinates=function(e,t,i,o,r){var s=this.cachedPageInfo[i],n=s.xScale,l=n===void 0?1:n,a=s.yScale,d=a===void 0?1:a,c=s.renderedHeight,u=c===void 0?792:c;var p=Math.floor(Math.min(e/l,o));var v=Math.floor(Math.min(Math.max(u-t,0)/d,r));return{x:p,y:v}};e.prototype.handleClickPage=function(e,t){return __awaiter(this,void 0,void 0,(function(){var i,o,r,s,n,l,a,d,c,u,p,v,h,f,m,b;return __generator(this,(function(x){switch(x.label){case 0:if(!this.placing)return[3,2];r=e.offsetX;s=e.offsetY;n=R(this.placing);l=A(this.placing);a=this.cachedPageInfo[t];d=a.naturalWidth,c=d===void 0?612:d,u=a.naturalHeight,p=u===void 0?792:u;v=this.viewCoordinatesToPageCoordinates(r,s,t,c-n,p-l);h=Math.floor(v.x);f=Math.floor(v.y);m={name:this.generateFieldName(this.placing,t),role_name:this.selectedRoleName,template_id:this.templateId,document_id:a.documentId,type:this.placing,required:true,page:t,validator:null,label:null,default:null,placeholder:null,group:null,settings:{x:h,y:f},x:h,y:f,width:n,height:l};console.log("[FIELDS] Will save new field",m);switch(m.type){case"attachment":case"payment":m.settings={x:h,y:f};break;case"initial":case"signature":m.settings={x:h,y:f,result:""};break;case"checkbox_group":m.setting={minimum_checked:0,maximum_checked:1e3,options:[{id:"".concat(m.name,"-1"),value:"Option 1",checked:false,x:h,y:f}]};break;case"date":m.settings={x:h,y:f,width:n,height:l,result:""};break;case"dropdown":m.required=false;m.settings={x:h,y:f,width:n,height:l,value:null,placeholder:"Choose",options:[{id:"option-1",value:"Option 1"}]};break;case"radio_button_group":m.setting={options:[{id:"".concat(m.name,"-1"),value:"Option 1",selected:false,x:h,y:f}]};break;case"textarea":case"textbox":m.settings={x:h,y:f,width:n,height:l,result:"",leading:0,alignment:0,upperCase:false};break;case"timestamp":m.settings={x:h,y:f,width:n,height:l};break}if(m.type==="textarea"){m.settings.leading=16;m.type="textbox"}return[4,g(this.endpoint,this.templateId,m)];case 1:b=x.sent();console.log("[FIELDS] Saved field",b);this.fieldStore.set("fields",__spreadArray(__spreadArray([],this.fieldStore.get("fields"),true),[b],false));this.placing=null;(i=this.templateUpdated)===null||i===void 0?void 0:i.emit({endpoint:this.endpoint,template:(o=this.templateStore)===null||o===void 0?void 0:o.state,event:"added-field"});x.label=2;case 2:return[2]}}))}))};e.prototype.render=function(){var e;var t=this;var i,s,n;if(!this.endpoint.session){return o(r,null,o("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if(this.loading||!((i=this.templateStore)===null||i===void 0?void 0:i.state.isLoaded)){return o(r,null,o("verdocs-loader",null))}var l=this.roleStore.get("roles").map((function(e){return{value:e.name,label:e.full_name?"".concat(e.name,": ").concat(e.full_name):e.name}}));return o(r,{class:this.placing?(e={},e["placing-".concat(this.placing)]=true,e):{},onSubmit:function(){}},o("div",{id:"verdocs-template-fields-toolbar"},o("div",{class:"add-for"},"Add field:"),o("verdocs-select-input",{value:this.selectedRoleName,options:l,onInput:function(e){return t.selectedRoleName=e.target.value}}),Se.map((function(e){return o("verdocs-toolbar-icon",{text:e.tooltip,icon:e.icon,onClick:function(){if(e.tooltip){if(t.selectedRoleName){t.placing=e.id}else{t.showMustSelectRole=true}}}})}))),o("div",{class:"pages"},(((n=(s=this.templateStore)===null||s===void 0?void 0:s.state)===null||n===void 0?void 0:n.documents)||[]).map((function(e){var i=a(1,e.pages);return i.map((function(i){return o("verdocs-template-document-page",{templateId:t.templateId,documentId:e.id,pageNumber:i,virtualWidth:612,virtualHeight:792,disabled:true,editable:true,done:false,onClick:function(e){return t.handleClickPage(e,i)},onPageRendered:function(e){return t.handlePageRendered(e)},layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})}))}))),this.showMustSelectRole&&o("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:function(){return t.showMustSelectRole=false}}))};return e}());Me.style=ge;var Le="";var He=Le;var Ie=e("verdocs_template_name",function(){function e(e){t(this,e);this.close=i(this,"close",7);this.sdkError=i(this,"sdkError",7);this.templateUpdated=i(this,"templateUpdated",7);this.store=null;this.endpoint=l.getDefault();this.templateId="";this.name="";this.dirty=false}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,o,r,s,n;return __generator(this,(function(l){switch(l.label){case 0:l.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.templateId){console.log("[ROLES] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[ROLES] Unable to start builder session, must be authenticated");return[2]}s=this;return[4,L(this.endpoint,this.templateId,false)];case 1:s.store=l.sent();this.name=(t=(e=this.store)===null||e===void 0?void 0:e.state)===null||t===void 0?void 0:t.name;this.dirty=false;return[3,3];case 2:n=l.sent();console.log("[TEMPLATE NAME] Error loading template",n);(i=this.sdkError)===null||i===void 0?void 0:i.emit(new D(n.message,(o=n.response)===null||o===void 0?void 0:o.status,(r=n.response)===null||r===void 0?void 0:r.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleCancel=function(e){var t,i,o;e.stopPropagation();this.name=(i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.name;this.dirty=false;console.log("Closing");(o=this.close)===null||o===void 0?void 0:o.emit()};e.prototype.handleSave=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i,o;return __generator(this,(function(r){switch(r.label){case 0:e.stopPropagation();return[4,b(this.endpoint,this.templateId,{name:this.name})];case 1:r.sent();if((t=this.store)===null||t===void 0?void 0:t.state){this.store.state.name=this.name}this.dirty=false;(i=this.templateUpdated)===null||i===void 0?void 0:i.emit({endpoint:this.endpoint,template:this.store.state,event:"name"});(o=this.close)===null||o===void 0?void 0:o.emit();return[2]}}))}))};e.prototype.render=function(){var e=this;var t,i;if(!this.endpoint.session){return o(r,null,o("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if((i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.isLoading){return o(r,{class:"loading"},o("verdocs-loader",null))}return o(r,null,o("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},o("label",{htmlFor:"verdocs-template-name"},"Template Name"),o("verdocs-text-input",{id:"verdocs-template-name",value:this.name,autocomplete:"off",placeholder:"Template Name...",onInput:function(t){var i,o;e.name=t.target.value;e.dirty=e.name!==((o=(i=e.store)===null||i===void 0?void 0:i.state)===null||o===void 0?void 0:o.name)}}),o("div",{class:"buttons"},o("verdocs-button",{size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:function(t){return e.handleCancel(t)}}),o("verdocs-button",{size:"small",label:"Save",disabled:!this.dirty,onClick:function(t){return e.handleSave(t)}}))))};return e}());Ie.style=He;var Ze='@-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-reminders{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-reminders.loading{min-height:300px;position:relative;display:block}verdocs-template-reminders.empty{display:none}verdocs-template-reminders form{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-template-reminders form h5{font-size:16px;font-weight:bold;color:#4c56cb;margin:0 0 20px 0}verdocs-template-reminders form label{font-size:16px;font-weight:500;margin:0 0 6px 0;color:#33364b}verdocs-template-reminders form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-template-reminders form input:focus{outline:none}verdocs-template-reminders form .input-row{display:-ms-flexbox;display:flex;margin:0 0 10px 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-template-reminders form .input-row label{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex}verdocs-template-reminders form .input-row verdocs-text-input{margin:0;display:-ms-flexbox;display:flex;-ms-flex:0 0 60px;flex:0 0 60px}verdocs-template-reminders form .input-row verdocs-text-input input{text-align:center}verdocs-template-reminders form .input-row verdocs-checkbox{display:-ms-flexbox;display:flex;-ms-flex:0 0 40px;flex:0 0 40px;-ms-flex-pack:center;justify-content:center}verdocs-template-reminders .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-reminders ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-reminders ::-moz-placeholder{color:#aaaaaa}verdocs-template-reminders :-ms-input-placeholder{color:#aaaaaa}verdocs-template-reminders ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-reminders ::placeholder{color:#aaaaaa}';var Te=Ze;var Ve=e("verdocs_template_reminders",function(){function e(e){t(this,e);this.close=i(this,"close",7);this.sdkError=i(this,"sdkError",7);this.templateUpdated=i(this,"templateUpdated",7);this.store=null;this.endpoint=l.getDefault();this.templateId="";this.showPlanBlocker=false;this.sendReminders=false;this.firstReminderDays="1";this.reminderDays="1";this.dirty=false}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,o,r,s,n;return __generator(this,(function(l){switch(l.label){case 0:l.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.templateId){console.log("[ROLES] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[ROLES] Unable to start builder session, must be authenticated");return[2]}s=this;return[4,L(this.endpoint,this.templateId,false)];case 1:s.store=l.sent();this.sendReminders=!!((t=(e=this.store)===null||e===void 0?void 0:e.state)===null||t===void 0?void 0:t.reminder_id);this.dirty=false;return[3,3];case 2:n=l.sent();console.log("[TEMPLATE REMINDERS] Error loading template",n);(i=this.sdkError)===null||i===void 0?void 0:i.emit(new D(n.message,(o=n.response)===null||o===void 0?void 0:o.status,(r=n.response)===null||r===void 0?void 0:r.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleCancel=function(e){var t,i,o;e.stopPropagation();this.sendReminders=!!((i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.reminder_id);this.dirty=false;(o=this.close)===null||o===void 0?void 0:o.emit()};e.prototype.handleSave=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i,o,r,s,n,l,a,d,c,u,p,v,h;return __generator(this,(function(f){switch(f.label){case 0:e.stopPropagation();f.label=1;case 1:f.trys.push([1,12,,13]);if(!this.sendReminders)return[3,8];c={setup_time:+this.firstReminderDays,interval_time:+this.reminderDays};if(!!((i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.reminder_id))return[3,4];return[4,x(this.endpoint,this.templateId,c)];case 2:f.sent();u=this;return[4,L(this.endpoint,this.templateId,false)];case 3:u.store=f.sent();return[3,7];case 4:return[4,w(this.endpoint,this.templateId,(o=this.store)===null||o===void 0?void 0:o.state.reminder_id,c)];case 5:f.sent();p=this;return[4,L(this.endpoint,this.templateId,false)];case 6:p.store=f.sent();f.label=7;case 7:return[3,11];case 8:return[4,y(this.endpoint,this.templateId,(r=this.store)===null||r===void 0?void 0:r.state.reminder_id)];case 9:f.sent();v=this;return[4,L(this.endpoint,this.templateId,false)];case 10:v.store=f.sent();f.label=11;case 11:(s=this.templateUpdated)===null||s===void 0?void 0:s.emit({endpoint:this.endpoint,template:this.store.state,event:"attachments"});return[3,13];case 12:h=f.sent();console.log("[TEMPLATE REMINDERS] Unable to update reminders",h);Y(h.message);(n=this.sdkError)===null||n===void 0?void 0:n.emit(new D(h.message,(l=h.response)===null||l===void 0?void 0:l.status,(a=h.response)===null||a===void 0?void 0:a.data));return[3,13];case 13:this.dirty=false;(d=this.close)===null||d===void 0?void 0:d.emit();return[2]}}))}))};e.prototype.render=function(){var e=this;var t,i;if(!this.endpoint.session){return o(r,null,o("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if(!this.endpoint.session||!((i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.isLoaded)){return o(r,{class:"empty"})}return o(r,null,o("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},o("h5",null,"Reminders"),o("div",{class:"input-row"},o("label",{htmlFor:"verdocs-send-reminders"},"Send Automatic Reminders"),o("verdocs-checkbox",{id:"verdocs-send-reminders",name:"automatic-reminders",checked:this.sendReminders,value:"on",onInput:function(t){e.sendReminders=t.target.checked;e.dirty=true}})),o("p",null,o("strong",null,"NOTE:")," Reminders will only be sent for up to 14 days."),o("div",{class:"input-row"},o("label",{htmlFor:"verdocs-first-reminder-days"},"Days Before First Reminder"),o("verdocs-text-input",{id:"verdocs-first-reminder-days",type:"number",value:this.firstReminderDays,onInput:function(t){e.firstReminderDays=t.target.value;e.dirty=true},disabled:!this.sendReminders})),o("div",{class:"input-row"},o("label",{htmlFor:"verdocs-days-between-reminders"},"Days Between Reminders"),o("verdocs-text-input",{id:"verdocs-days-between-reminders",type:"number",value:this.reminderDays,onInput:function(t){e.reminderDays=t.target.value;e.dirty=true},disabled:!this.sendReminders})),o("div",{class:"buttons"},o("verdocs-button",{size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:function(t){return e.handleCancel(t)}}),o("verdocs-button",{size:"small",label:"Save",disabled:!this.dirty,onClick:function(t){return e.handleSave(t)}}))),this.showPlanBlocker&&o("verdocs-ok-dialog",{heading:"Upgrade to access this feature",message:"Please upgrade your plan to access this feature.",onNext:function(){return e.showPlanBlocker=false}}))};return e}());Ve.style=Te;var Re='@-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-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:20px;height:20px;stroke:#666666;margin-bottom:-5px}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}';var Ae=Re;var De={everyone:"Everyone",everyone_as_creator:"Everyone as Me",organization_member:"Organization member",organization_member_as_creator:"Organization Member as Me",creator:"Me"};var Ue='<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>';var Ne='<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>';var je='<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>';var Be='<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>';var Oe='<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>';var Pe='<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>';var Fe='<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>';var Qe='<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>';var Ye=e("verdocs_template_roles",function(){function e(e){t(this,e);this.next=i(this,"next",7);this.exit=i(this,"exit",7);this.sdkError=i(this,"sdkError",7);this.rolesUpdated=i(this,"rolesUpdated",7);this.templateStore=null;this.roleStore=null;this.endpoint=l.getDefault();this.templateId="";this.showingRoleDialog=null;this.showingSenderDialog=false;this.sender=null;this.loading=true}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,o;var r=this;return __generator(this,(function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.templateId){console.log("[ROLES] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[ROLES] Unable to start builder session, must be authenticated");return[2]}return[4,L(this.endpoint,this.templateId,false).then((function(e){var t;r.templateStore=e;r.roleStore=q(r.templateId);console.log("RS",(t=r.roleStore)===null||t===void 0?void 0:t.state);r.loading=false;r.roleStore.onChange("roles",(function(e){var t;console.log("[ROLES] Roles changed",{roles:e});(t=r.rolesUpdated)===null||t===void 0?void 0:t.emit({event:"updated",endpoint:r.endpoint,templateId:r.templateId,roles:e})}))})).catch((function(e){console.log(e)}))];case 1:s.sent();return[3,3];case 2:o=s.sent();console.log("[FIELDS] Error with preview session",o);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new D(o.message,(t=o.response)===null||t===void 0?void 0:t.status,(i=o.response)===null||i===void 0?void 0:i.data));return[3,3];case 3:return[2]}}))}))};e.prototype.componentDidRender=function(){Q.dynamicDrop(true);Q(".recipient").draggable({listeners:{start:function e(t){t.target.classList.add("dragging");this.el.classList.add("dragging")}.bind(this),move:function e(t){var i=+(t.target.getAttribute("dX")||0);var o=+(t.target.getAttribute("dY")||0);var r=+(t.target.dataset["sequence"]||0);var s=+(t.target.dataset["order"]||0);var n=t.dx+i;var l=t.dy+o;t.target.setAttribute("dX",n);t.target.setAttribute("dY",l);var a=t.target.getBoundingClientRect();console.log("w",a.width);t.target.style.transform="translate(".concat(n+a.width-(s+1),"px, ").concat(l-a.height*r,"px)")}.bind(this),end:function e(t){t.target.classList.remove("dragging");this.el.classList.remove("dragging");t.target.removeAttribute("dX");t.target.removeAttribute("dY");t.target.style.transform=null}.bind(this)}});Q(".dropzone").dropzone({overlap:.05,ondrop:function e(t){return __awaiter(this,void 0,void 0,(function(){var e,i,o,r;return __generator(this,(function(s){switch(s.label){case 0:console.log("dropped",t.target.classList);t.target.classList.remove("active");i=t.relatedTarget.dataset.rolename;o=+t.target.dataset.sequence;r=+t.target.dataset.order;M(this.roleStore,i,{sequence:o,order:r});return[4,this.renumberTemplateRoles()];case 1:s.sent();console.log("[ROLES] Updated roles",this.getSortedRoles());(e=this.rolesUpdated)===null||e===void 0?void 0:e.emit({event:"updated",endpoint:this.endpoint,templateId:this.templateId,roles:this.getSortedRoles()});return[2]}}))}))}.bind(this),ondropactivate:function(e){e.target.classList.add("visible")},ondropdeactivate:function(e){e.target.classList.remove("visible")},ondragenter:function(e){e.target.classList.add("active")},ondragleave:function(e){e.target.classList.remove("active")}})};e.prototype.handleCancel=function(){var e;(e=this.exit)===null||e===void 0?void 0:e.emit()};e.prototype.handleSubmit=function(){var e;(e=this.next)===null||e===void 0?void 0:e.emit()};e.prototype.getSortedRoles=function(){return this.roleStore.state.roles.sort((function(e,t){return e.sequence===t.sequence?e.order-t.order:e.sequence-t.sequence}))};e.prototype.getSequenceNumbers=function(){var e=[];this.getSortedRoles().forEach((function(t){if(!e.includes(t.sequence)){e.push(t.sequence)}}));return e.sort((function(e,t){return e-t}))};e.prototype.getRoleNames=function(){var e=this.getSortedRoles();return e.map((function(e){return e.name}))};e.prototype.getRolesAtSequence=function(e){return this.roleStore.state.roles.filter((function(t){return t&&t.sequence===e}))};e.prototype.renumberTemplateRoles=function(){var e=this;var t=[];var i=[];this.getSequenceNumbers().forEach((function(o,r){e.getRolesAtSequence(o).forEach((function(o,s){if(!t.includes(o.name)){o.sequence=r+1;o.order=s+1;t.push(o.name);i.push(k(e.endpoint,e.templateId,o.name,{sequence:o.sequence,order:o.order}))}}))}));return Promise.all(i)};e.prototype.getNextRoleName=function(){var e="";var t=Object.keys(this.roleStore.state).length-1;do{t++;e="Recipient ".concat(t)}while(!e||this.roleStore.state.roles.some((function(t){return t&&t.name===e})));return e};e.prototype.callCreateRole=function(e,t,i){var o=this;console.log("[ROLES] Will create role",{name:e,sequence:t,order:i});_(this.endpoint,this.templateId,{template_id:this.templateId,name:e,sequence:t,message:"",order:i,full_name:"",email:"",phone:"",type:"signer",delegator:false}).then((function(e){return __awaiter(o,void 0,void 0,(function(){var t;return __generator(this,(function(i){switch(i.label){case 0:console.log("[ROLES] Created role",e);this.roleStore.set("roles",__spreadArray(__spreadArray([],this.roleStore.state.roles,true),[e],false));return[4,this.renumberTemplateRoles()];case 1:i.sent();(t=this.rolesUpdated)===null||t===void 0?void 0:t.emit({event:"added",endpoint:this.endpoint,templateId:this.templateId,roles:this.getSortedRoles()});return[2]}}))}))})).catch((function(e){console.log("[ROLES] Error creating role",e)}))};e.prototype.handleAddRole=function(e,t){e.stopPropagation();var i=this.getRolesAtSequence(t).length+1;var o=this.getNextRoleName();this.callCreateRole(o,t,i)};e.prototype.handleAddStep=function(e,t){e.stopPropagation();var i=1;var o=this.getNextRoleName();this.callCreateRole(o,t,i)};e.prototype.render=function(){var e=this;var t,i,n,l;if(!this.endpoint.session){return o(r,null,o("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if(this.loading||!((t=this.templateStore)===null||t===void 0?void 0:t.state.isLoaded)){console.log("Loading",this.loading,(i=this.templateStore)===null||i===void 0?void 0:i.state.isLoaded);return o(r,{class:"loading"},o("verdocs-loader",null))}console.log("Rendering roles",this.roleStore.get("roles"));var a=this.getRoleNames();var d=this.getSequenceNumbers();console.log("Rendering",a,d);return o(r,null,o("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},o("h5",null,"Roles and Workflow"),o("div",{class:"participants"},o("div",{class:"left-line"}),o("div",{class:"row"},o("div",{class:"icon",innerHTML:Ne}),o("div",{class:"row-roles"},o("div",{class:"sender"},o("span",{class:"label"},"Sender:")," ",De[(l=(n=this.templateStore)===null||n===void 0?void 0:n.state)===null||l===void 0?void 0:l.sender]," ",o("div",{class:"settings-button",innerHTML:Ue,onClick:function(){return e.showingSenderDialog=true},"aria-role":"button"})))),o("div",{class:"row add-sequence","data-sequence":0},o("div",{class:"icon",innerHTML:Oe}),o("div",{class:"row-roles"},o("div",{class:"dropzone","data-sequence":0,"data-order":1},"Add Step"))),d.map((function(t){return o(s,null,o("div",{class:"row"},o("div",{class:"icon",innerHTML:je}),o("div",{class:"row-roles"},o("div",{class:"dropzone","data-order":.5,"data-sequence":t}),e.getRolesAtSequence(t).map((function(i){var r=!i.email;return r?o(s,null,o("div",{class:"recipient",style:{backgroundColor:p(S(e.roleStore,i.name))},"data-rolename":i.name,"data-sequence":t,"data-order":i.order},o("span",{class:"type-icon",innerHTML:i.type==="signer"?Pe:i.type==="cc"?Qe:Fe}),i.name," ",o("div",{class:"settings-button",innerHTML:Ue,onClick:function(){return e.showingRoleDialog=i.name},"aria-role":"button"})),o("div",{class:"dropzone","data-order":i.order+.5,"data-sequence":t})):o(s,null,o("div",{class:"recipient",style:{borderColor:p(S(e.roleStore,i.name))},"data-rolename":i.name,"data-sequence":t,"data-order":i.order},o("span",{class:"type-icon",innerHTML:i.type==="signer"?Pe:i.type==="cc"?Qe:Fe}),i.full_name," ",o("div",{class:"settings-button",innerHTML:Ue,onClick:function(){return e.showingRoleDialog=i.name},"aria-role":"button"})),o("div",{class:"dropzone","data-order":i.order+.5,"data-sequence":t}))})),o("button",{class:"add-role",innerHTML:Oe,onClick:function(i){return e.handleAddRole(i,t)}}))),d.length>0&&o("div",{class:"row add-sequence","data-sequence":t},o("div",{class:"row-roles"},o("div",{class:"icon",innerHTML:Oe}),o("div",{class:"dropzone","data-sequence":t+1,"data-order":1},"Add Step"))))})),o("div",{class:"row","data-sequence":d.length+1},o("div",{class:"row-roles"},o("div",{class:"icon",innerHTML:Oe}),o("button",{class:"add-step",innerHTML:Oe,onClick:function(t){return e.handleAddStep(t,d.length+1)}}))),o("div",{class:"row"},o("div",{class:"icon",innerHTML:Be}),o("div",{class:"row-roles"},o("div",{class:"complete"},"Document Complete")))),a.length<1&&o("div",{class:"empty"},"You must add at least one Role before proceeding.",o("br",null)," Click the ",o("span",{innerHTML:Oe})," Add button above to get started."),o("div",{class:"buttons"},o("div",{class:"flex-fill"}),o("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:function(){return e.handleCancel()}}),o("verdocs-button",{label:"OK",size:"small",onClick:function(){return e.handleSubmit()},disabled:a.length<1}))),this.showingRoleDialog&&o("verdocs-template-role-properties",{endpoint:this.endpoint,templateId:this.templateId,roleName:this.showingRoleDialog,onClose:function(){e.showingRoleDialog=null},onDelete:function(){return __awaiter(e,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:this.showingRoleDialog=null;return[4,this.renumberTemplateRoles()];case 1:t.sent();(e=this.rolesUpdated)===null||e===void 0?void 0:e.emit({event:"deleted",endpoint:this.endpoint,templateId:this.templateId,roles:this.getSortedRoles()});return[2]}}))}))}}),this.showingSenderDialog&&o("verdocs-template-sender",{endpoint:this.endpoint,templateId:this.templateId,onClose:function(){return e.showingSenderDialog=false}}))};Object.defineProperty(e.prototype,"el",{get:function(){return n(this)},enumerable:false,configurable:true});return e}());Ye.style=Ae;var We='@-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}';var Xe=We;var Ge=e("verdocs_template_visibility",function(){function e(e){t(this,e);this.close=i(this,"close",7);this.sdkError=i(this,"sdkError",7);this.templateUpdated=i(this,"templateUpdated",7);this.store=null;this.endpoint=l.getDefault();this.templateId="";this.dirty=false;this.personal=false;this.public=false}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,o,r,s,n,l,a;return __generator(this,(function(d){switch(d.label){case 0:d.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.templateId){console.log("[VISIBILITY] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[VISIBILITY] Unable to start builder session, must be authenticated");return[2]}l=this;return[4,L(this.endpoint,this.templateId,false)];case 1:l.store=d.sent();this.personal=((t=(e=this.store)===null||e===void 0?void 0:e.state)===null||t===void 0?void 0:t.is_personal)||true;this.public=((o=(i=this.store)===null||i===void 0?void 0:i.state)===null||o===void 0?void 0:o.is_public)||false;this.dirty=false;return[3,3];case 2:a=d.sent();console.log("[TEMPLATE VISIBILITY] Error loading template",a);(r=this.sdkError)===null||r===void 0?void 0:r.emit(new D(a.message,(s=a.response)===null||s===void 0?void 0:s.status,(n=a.response)===null||n===void 0?void 0:n.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleCancel=function(e){var t,i,o,r,s;e.stopPropagation();this.personal=(i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.is_personal;this.public=(r=(o=this.store)===null||o===void 0?void 0:o.state)===null||r===void 0?void 0:r.is_public;this.dirty=false;(s=this.close)===null||s===void 0?void 0:s.emit()};e.prototype.handleSave=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i,o;return __generator(this,(function(r){switch(r.label){case 0:e.stopPropagation();return[4,b(this.endpoint,this.templateId,{is_personal:this.personal,is_public:this.public})];case 1:r.sent();if((t=this.store)===null||t===void 0?void 0:t.state){this.store.state.is_personal=this.personal;this.store.state.is_public=this.public}this.dirty=false;(i=this.templateUpdated)===null||i===void 0?void 0:i.emit({endpoint:this.endpoint,template:this.store.state,event:"visibility"});(o=this.close)===null||o===void 0?void 0:o.emit();return[2]}}))}))};e.prototype.render=function(){var e=this;var t,i;if(!this.endpoint.session){return o(r,null,o("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if(!this.endpoint.session||!((i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.isLoaded)){return o(r,{class:"empty"})}return o(r,null,o("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},o("h5",null,"Visibility"),o("div",{class:"input-row"},o("label",{htmlFor:"verdocs-is-shared"},"Shared"),o("verdocs-checkbox",{id:"verdocs-is-shared",name:"is-shared",checked:!this.personal,value:"on",onInput:function(t){e.personal=!t.target.checked;e.dirty=true}})),o("div",{class:"description"},"Shared templates are visible to other members of your Organization (if any)."),o("div",{class:"input-row"},o("label",{htmlFor:"verdocs-is-public"},"Public"),o("verdocs-checkbox",{id:"verdocs-is-public",name:"is-public",checked:this.public,value:"on",onInput:function(t){e.public=t.target.checked;e.dirty=true}})),o("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)."),o("div",{class:"buttons"},o("verdocs-button",{size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:function(t){return e.handleCancel(t)}}),o("verdocs-button",{size:"small",label:"Save",disabled:!this.dirty,onClick:function(t){return e.handleSave(t)}}))))};return e}());Ge.style=Xe}}}));
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(t,e,r,n){function i(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,o){function a(t){try{c(n.next(t))}catch(t){o(t)}}function s(t){try{c(n["throw"](t))}catch(t){o(t)}}function c(t){t.done?r(t.value):i(t.value).then(a,s)}c((n=n.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(t){return function(e){return c([t,e])}}function c(s){if(n)throw new TypeError("Generator is already executing.");while(a&&(a=0,s[0]&&(r=0)),r)try{if(n=1,i&&(o=s[0]&2?i["return"]:s[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,s[1])).done)return o;if(i=0,o)s=[s[0]&2,o.value];switch(s[0]){case 0:case 1:o=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;i=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(o=r.trys,o=o.length>0&&o[o.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!o||s[1]>o[0]&&s[1]<o[3])){r.label=s[1];break}if(s[0]===6&&r.label<o[1]){r.label=o[1];o=s;break}if(o&&r.label<o[2]){r.label=o[2];r.ops.push(s);break}if(o[2])r.ops.pop();r.trys.pop();continue}s=e.call(t,r)}catch(t){s=[6,t];i=0}finally{n=o=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};System.register(["./p-e748b2d2.system.js","@verdocs/js-sdk"],(function(t){"use strict";var e,r,n,i,o,a;return{setters:[function(t){e=t.r;r=t.c;n=t.h;i=t.H},function(t){o=t.VerdocsEndpoint;a=t.toggleStar}],execute:function(){var s='@-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-star{display:-ms-flexbox;display:flex;-ms-flex:0 0 60px;flex:0 0 60px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;font-family:"Inter", "Barlow", sans-serif}verdocs-template-star .star{line-height:10px}verdocs-template-star .star.updating{-webkit-animation:spinningStar 2s infinite linear;animation:spinningStar 2s infinite linear}verdocs-template-star .star svg{width:24px;height:24px}verdocs-template-star .count{color:#595c5d;font-size:14px;margin-left:10px}@-webkit-keyframes spinningStar{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes spinningStar{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}';var c=s;var f='<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M11.48 3.499a.562.562 0 011.04 0l2.125 5.111a.563.563 0 00.475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 00-.182.557l1.285 5.385a.562.562 0 01-.84.61l-4.725-2.885a.563.563 0 00-.586 0L6.982 20.54a.562.562 0 01-.84-.61l1.285-5.386a.562.562 0 00-.182-.557l-4.204-3.602a.563.563 0 01.321-.988l5.518-.442a.563.563 0 00.475-.345L11.48 3.5z" /></svg>';var l='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M10.788 3.21c.448-1.077 1.976-1.077 2.424 0l2.082 5.007 5.404.433c1.164.093 1.636 1.545.749 2.305l-4.117 3.527 1.257 5.273c.271 1.136-.964 2.033-1.96 1.425L12 18.354 7.373 21.18c-.996.608-2.231-.29-1.96-1.425l1.257-5.273-4.117-3.527c-.887-.76-.415-2.212.749-2.305l5.404-.433 2.082-5.006z" clip-rule="evenodd" /></svg>';var u=t("verdocs_template_star",function(){function t(t){e(this,t);this.starChange=r(this,"starChange",7);this.sdkError=r(this,"sdkError",7);this.endpoint=o.getDefault();this.template=undefined;this.updating=false}t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.endpoint.loadSession();if(!this.endpoint.session){console.log("[TEMPLATES] Must be authenticated");return[2]}return[2]}))}))};t.prototype.toggle=function(t){var e=this;t.stopPropagation();this.updating=true;a(o.getDefault(),this.template.id).then((function(t){e.updating=false;e.template.star_counter=t.star_counter;e.starChange.emit({templateId:e.template.id,starred:t.star_counter>0,count:t.star_counter})})).catch((function(t){e.updating=false;console.log("[STAR] Error toggling template star",t.message);e.sdkError.emit(t)}))};t.prototype.render=function(){var t=this;return n(i,{key:"0bfc2a29037c8753d08852eb5b0d0e7ccae821fc"},n("div",{key:"16441206c390f010d43fddf52df556f503f2309b",class:"star ".concat(this.updating?"updating":""),innerHTML:this.template.star_counter?l:f,onClick:function(e){return t.toggle(e)}}),n("div",{key:"0b7ed0bba53a2e243c47195efcb09934d056d479",class:"count"},this.template.star_counter||"--"))};return t}());u.style=c}}}));
1
+ var __awaiter=this&&this.__awaiter||function(t,e,r,n){function i(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,a){function o(t){try{c(n.next(t))}catch(t){a(t)}}function s(t){try{c(n["throw"](t))}catch(t){a(t)}}function c(t){t.done?r(t.value):i(t.value).then(o,s)}c((n=n.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var r={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(t){return function(e){return c([t,e])}}function c(s){if(n)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(r=0)),r)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:r.label++;return{value:s[1],done:false};case 5:r.label++;i=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(a=r.trys,a=a.length>0&&a[a.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){r.label=s[1];break}if(s[0]===6&&r.label<a[1]){r.label=a[1];a=s;break}if(a&&r.label<a[2]){r.label=a[2];r.ops.push(s);break}if(a[2])r.ops.pop();r.trys.pop();continue}s=e.call(t,r)}catch(t){s=[6,t];i=0}finally{n=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};System.register(["./p-e748b2d2.system.js","@verdocs/js-sdk"],(function(t){"use strict";var e,r,n,i,a,o;return{setters:[function(t){e=t.r;r=t.c;n=t.h;i=t.H},function(t){a=t.VerdocsEndpoint;o=t.toggleStar}],execute:function(){var s='@-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-star{display:-ms-flexbox;display:flex;-ms-flex:0 0 60px;flex:0 0 60px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;font-family:"Inter", "Barlow", sans-serif}verdocs-template-star .star{line-height:10px}verdocs-template-star .star.updating{-webkit-animation:spinningStar 2s infinite linear;animation:spinningStar 2s infinite linear}verdocs-template-star .star svg{width:24px;height:24px}verdocs-template-star .count{color:#595c5d;font-size:14px;margin-left:10px}@-webkit-keyframes spinningStar{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes spinningStar{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}';var c=s;var f='<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M11.48 3.499a.562.562 0 011.04 0l2.125 5.111a.563.563 0 00.475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 00-.182.557l1.285 5.385a.562.562 0 01-.84.61l-4.725-2.885a.563.563 0 00-.586 0L6.982 20.54a.562.562 0 01-.84-.61l1.285-5.386a.562.562 0 00-.182-.557l-4.204-3.602a.563.563 0 01.321-.988l5.518-.442a.563.563 0 00.475-.345L11.48 3.5z" /></svg>';var l='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M10.788 3.21c.448-1.077 1.976-1.077 2.424 0l2.082 5.007 5.404.433c1.164.093 1.636 1.545.749 2.305l-4.117 3.527 1.257 5.273c.271 1.136-.964 2.033-1.96 1.425L12 18.354 7.373 21.18c-.996.608-2.231-.29-1.96-1.425l1.257-5.273-4.117-3.527c-.887-.76-.415-2.212.749-2.305l5.404-.433 2.082-5.006z" clip-rule="evenodd" /></svg>';var u=t("verdocs_template_star",function(){function t(t){e(this,t);this.starChange=r(this,"starChange",7);this.sdkError=r(this,"sdkError",7);this.endpoint=a.getDefault();this.template=undefined;this.updating=false}t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.endpoint.loadSession();if(!this.endpoint.session){console.log("[TEMPLATES] Must be authenticated");return[2]}return[2]}))}))};t.prototype.toggle=function(t){var e=this;t.stopPropagation();this.updating=true;o(a.getDefault(),this.template.id).then((function(t){e.updating=false;e.template.star_counter=t.star_counter;e.starChange.emit({templateId:e.template.id,starred:t.star_counter>0,count:t.star_counter})})).catch((function(t){e.updating=false;console.log("[STAR] Error toggling template star",t.message);e.sdkError.emit(t)}))};t.prototype.render=function(){var t=this;return n(i,{key:"a3b6ca54b4549954355f9061b871489243432da7"},n("div",{key:"abcfec7a6fb4d928b3bc7080cbe49eb299cb56f9",class:"star ".concat(this.updating?"updating":""),innerHTML:this.template.star_counter?l:f,onClick:function(e){return t.toggle(e)}}),n("div",{key:"a36087cb85065e3cf888ec8c8ef6fa88f4b3a2e9",class:"count"},this.template.star_counter||"--"))};return t}());u.style=c}}}));
@@ -1 +1 @@
1
- System.register(["./p-e748b2d2.system.js","@verdocs/js-sdk","./p-94c638b9.system.js","./p-1a180595.system.js","./p-f24d887c.system.js"],(function(e){"use strict";var t,o,i,c,n,a;return{setters:[function(e){t=e.r;o=e.c;i=e.h;c=e.H},function(e){n=e.VerdocsEndpoint},function(e){a=e.i},function(){},function(){}],execute:function(){var s='@-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-contact-picker{display:block;border:1px solid #ebebeb;background-color:#ffffff;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;-webkit-box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1);box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1)}verdocs-contact-picker form{background-color:#f5f5fa;padding:12px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-contact-picker form .row{width:300px;display:-ms-flexbox;display:flex;position:relative;margin:0 0 20px 0;-ms-flex-direction:column;flex-direction:column}verdocs-contact-picker form label{display:block;font-size:14px;font-weight:500;margin:0 0 4px 0;color:#5c6575}verdocs-contact-picker form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-contact-picker form input:focus{outline:none}verdocs-contact-picker form .dropdown{left:0;right:0;top:49px;z-index:1000000;position:absolute;background:#ffffff;-webkit-box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1);box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1)}verdocs-contact-picker form .dropdown .suggestion{display:-ms-flexbox;display:flex;padding:6px 12px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker form .dropdown .suggestion svg{fill:#666666}verdocs-contact-picker form .dropdown .suggestion .avatar{width:48px;height:48px;-ms-flex:0 0 48px;flex:0 0 48px;margin-right:8px;border-radius:100%}verdocs-contact-picker form .dropdown .suggestion .details{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-contact-picker form .dropdown .suggestion .name{font-size:16px;font-weight:500;margin-bottom:3px;color:#092c4c}verdocs-contact-picker form .dropdown .suggestion .destination{font-size:14px;margin-bottom:3px;color:#33364b}verdocs-contact-picker form .dropdown .suggestion:hover{background:#eee;cursor:pointer}verdocs-contact-picker .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker .buttons .flex-fill{-ms-flex:1;flex:1}verdocs-contact-picker ::-webkit-input-placeholder{color:#aaaaaa}verdocs-contact-picker ::-moz-placeholder{color:#aaaaaa}verdocs-contact-picker :-ms-input-placeholder{color:#aaaaaa}verdocs-contact-picker ::-ms-input-placeholder{color:#aaaaaa}verdocs-contact-picker ::placeholder{color:#aaaaaa}verdocs-contact-picker [data-lastpass-icon-root]{display:none !important}';var r=s;var d='<svg class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium MuiBox-root css-1om0hkc" focusable="false" aria-hidden="true" viewBox="0 0 24 24"><path d="M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-2 12H6v-2h12v2zm0-3H6V9h12v2zm0-3H6V6h12v2z"></path></svg>';var l='<svg class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium MuiSvgIcon-root MuiSvgIcon-fontSizeLarge css-zjt8k" focusable="false" aria-hidden="true" viewBox="0 0 24 24" data-testid="AssignmentIndIcon" tabindex="-1" title="AssignmentInd"><path d="M19 3h-4.18C14.4 1.84 13.3 1 12 1c-1.3 0-2.4.84-2.82 2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm0 4c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3zm6 12H6v-1.4c0-2 4-3.1 6-3.1s6 1.1 6 3.1V19z"></path></svg>';var f='<svg class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium MuiSvgIcon-root MuiSvgIcon-fontSizeLarge css-zjt8k" focusable="false" aria-hidden="true" viewBox="0 0 24 24" data-testid="AccountCircleIcon" tabindex="-1" title="AccountCircle"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 4c1.93 0 3.5 1.57 3.5 3.5S13.93 13 12 13s-3.5-1.57-3.5-3.5S10.07 6 12 6zm0 14c-2.03 0-4.43-.82-6.14-2.88C7.55 15.8 9.68 15 12 15s4.45.8 6.14 2.12C16.43 19.18 14.03 20 12 20z"></path></svg>';var u=e("verdocs_contact_picker",function(){function e(e){t(this,e);this.searchContacts=o(this,"searchContacts",7);this.exit=o(this,"exit",7);this.next=o(this,"next",7);this.endpoint=n.getDefault();this.templateRole=null;this.contactSuggestions=[];this.name=undefined;this.email=undefined;this.phone=undefined;this.message=undefined;this.showSuggestions=false;this.showMessage=false;this.delegator=false;this.nameFieldId="verdocs-contact-picker-name-".concat(Math.random().toString(36).substring(2,11));this.emailFieldId="verdocs-contact-picker-email-".concat(Math.random().toString(36).substring(2,11));this.phoneFieldId="verdocs-contact-picker-phone-".concat(Math.random().toString(36).substring(2,11))}e.prototype.componentWillLoad=function(){if(this.templateRole){this.name=this.templateRole.full_name||"";this.email=this.templateRole.email||"";this.phone=this.templateRole.phone||"";this.delegator=this.templateRole.delegator||false;this.message=this.templateRole.message||"";this.showMessage=this.message!==""}};e.prototype.handleNameChange=function(e){var t;this.name=e.target.value;(t=this.searchContacts)===null||t===void 0?void 0:t.emit({query:this.name})};e.prototype.handleEmailChange=function(e){this.email=e.target.value};e.prototype.handlePhoneChange=function(e){this.phone=a(e.target.value)};e.prototype.handleMessageChange=function(e){this.message=e.target.value};e.prototype.handleCancel=function(e){var t;e.stopPropagation();this.showSuggestions=false;(t=this.exit)===null||t===void 0?void 0:t.emit()};e.prototype.handleSubmit=function(e){var t;e.stopPropagation();this.showSuggestions=false;(t=this.next)===null||t===void 0?void 0:t.emit({full_name:this.name,email:this.email,phone:this.phone,message:this.message,delegator:this.delegator})};e.prototype.handleSelectSuggestion=function(e,t){e.stopPropagation();this.name=t.name;this.email=t.email;this.phone=t.phone;this.showSuggestions=false};e.prototype.render=function(){var e=this;return i("form",{key:"45acdba47c2999d3d4aa88c72e4451c5565b222e",onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},i("div",{key:"96b525fe36cb094bbd4492841cb095e62b4358b8",class:"row"},i("label",{key:"f264a4b8cc6da4ef82f78a1841d5b3bce0ae4fef",htmlFor:this.nameFieldId},"Name:"),i("input",{key:"15898561eeff05ad20dd73787f39702ab862d295",id:this.nameFieldId,name:this.nameFieldId,type:"text","data-lpignore":"true",autocomplete:"blocked",value:this.name,placeholder:"Recipient Name...",onFocus:function(){var t;return e.showSuggestions=((t=e.contactSuggestions)===null||t===void 0?void 0:t.length)>0},onInput:function(t){return e.handleNameChange(t)}}),this.showSuggestions&&i("div",{key:"ad28ba30382a2d2a40ac1992352368b883097553",class:"dropdown"},this.contactSuggestions.map((function(t){var o;return i("div",{key:(o=t.id)!==null&&o!==void 0?o:t.name,class:"suggestion",onClick:function(o){return e.handleSelectSuggestion(o,t)}},t.avatar?i("img",{alt:"Avatar",class:"avatar",src:t.avatar}):i("div",{class:"avatar",innerHTML:f}),i("div",{class:"details"},i("div",{class:"name"},t.name),t.email&&i("div",{class:"destination"},t.email),t.phone&&i("div",{class:"destination"},t.phone)))})))),i("div",{key:"7a7d4b6df5eab37ede0b87f9d10ba8b8e4e8254f",class:"row"},i("label",{key:"2058494eeac07248115323afe529bcaf681afed1",htmlFor:this.emailFieldId},"Email:"),i("input",{key:"d1c41d7b356190b4705e7d255103534bd1a47cd2",id:this.emailFieldId,name:this.emailFieldId,type:"text","data-lpignore":"true",autoComplete:"blocked",value:this.email,placeholder:"Email Address...",onFocus:function(){return e.showSuggestions=false},onInput:function(t){return e.handleEmailChange(t)}})),i("div",{key:"5f9668b15bfb2e1e06cc03e2f1ea051b893307f6",class:"row"},i("label",{key:"54b40e4aa240e2c6fb2364fbe59707d25dbfdb65",htmlFor:this.phoneFieldId},"Phone:"),i("input",{key:"dc20e317c4dbeae41bc9454685a0bf97f57db2bb",id:this.phoneFieldId,name:this.phoneFieldId,type:"text","data-lpignore":"true",autoComplete:"blocked",value:this.phone,placeholder:"Phone Number...",onFocus:function(){return e.showSuggestions=false},onInput:function(t){return e.handlePhoneChange(t)}})),this.showMessage&&i("div",{key:"85fb931022f96a0916c162e335a1ea91a11a9590",class:"row"},i("label",{key:"45c30e86e0038b8159c417bb59fb88885e309853",htmlFor:"verdocs-contact-picker-message"},"Message:"),i("input",{key:"edd7b070c3fa83fe93e3305d70182a63b8a273b5",id:"verdocs-contact-picker-message",name:"verdocs-contact-picker-message",type:"text","data-lpignore":"true",autocomplete:"blocked",value:this.message,placeholder:"Invitation Message...",onFocus:function(){return e.showSuggestions=false},onInput:function(t){return e.handleMessageChange(t)}})),i("div",{key:"0cfb64faed1d1bfa9d712811ac7c05412b135a8c",class:"buttons"},i("verdocs-toggle-button",{key:"6fe54edfc3e822f4863c8e2ad8109ea7cde8be94",icon:d,size:"small",active:this.showMessage,onToggle:function(t){e.showMessage=t.detail.active;e.showSuggestions=false}}),i("verdocs-toggle-button",{key:"56941f96e455fa978d664cfecd6c015c0c133127",icon:l,size:"small",active:this.delegator,onToggle:function(t){e.delegator=t.detail.active;e.showSuggestions=false}}),i("div",{key:"ec687a638006d9902d5041b57de14a0d6fbb4ff3",class:"flex-fill"}),i("verdocs-button",{key:"e984e3783aa6483ab20873254dd96998e0d505e8",variant:"outline",label:"Cancel",size:"small",onClick:function(t){return e.handleCancel(t)}}),i("verdocs-button",{key:"1b997aede29f9e8576c0739e089d879ba05ce123",label:"OK",size:"small",onClick:function(t){return e.handleSubmit(t)}})))};return e}());u.style=r;var b='@-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-toggle-button{font-family:"Inter", "Barlow", sans-serif}verdocs-toggle-button button{border:none;outline:none;cursor:pointer;-ms-flex-align:center;align-items:center;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-pack:center;justify-content:center;background:#cccccc;color:#33364b}verdocs-toggle-button button svg{max-width:100%;max-height:100%;fill:#33364b}verdocs-toggle-button button.active{background:#55bc81;color:#f5f5fa}verdocs-toggle-button button.active svg{fill:#f5f5fa}verdocs-toggle-button button:focus{border:none;outline:none}verdocs-toggle-button.size-normal button{width:40px;height:40px;padding:6px;border-radius:4px}verdocs-toggle-button.size-small button{width:34px;height:34px;padding:4px;border-radius:2px}';var p=b;var h=e("verdocs_toggle_button",function(){function e(e){t(this,e);this.toggle=o(this,"toggle",7);this.active=false;this.icon=null;this.label=null;this.size="normal";this._active=false}e.prototype.componentWillLoad=function(){this._active=this.active};e.prototype.handleToggle=function(e){var t;e.stopPropagation();var o=!this._active;this._active=o;(t=this.toggle)===null||t===void 0?void 0:t.emit({active:o})};e.prototype.render=function(){var e=this;return i(c,{key:"f953a03258c2b74858b247a3d206028bf0285f1f",class:"size-".concat(this.size)},this.icon?i("button",{innerHTML:this.icon,class:{active:this._active},onClick:function(t){return e.handleToggle(t)}}):i("button",{class:{active:this._active},onClick:function(t){return e.handleToggle(t)}},this.label))};return e}());h.style=p}}}));
1
+ System.register(["./p-e748b2d2.system.js","@verdocs/js-sdk","./p-94c638b9.system.js","./p-1a180595.system.js","./p-f24d887c.system.js"],(function(e){"use strict";var t,o,i,c,n,a;return{setters:[function(e){t=e.r;o=e.c;i=e.h;c=e.H},function(e){n=e.VerdocsEndpoint},function(e){a=e.i},function(){},function(){}],execute:function(){var s='@-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-contact-picker{display:block;border:1px solid #ebebeb;background-color:#ffffff;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;-webkit-box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1);box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1)}verdocs-contact-picker form{background-color:#f5f5fa;padding:12px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-contact-picker form .row{width:300px;display:-ms-flexbox;display:flex;position:relative;margin:0 0 20px 0;-ms-flex-direction:column;flex-direction:column}verdocs-contact-picker form label{display:block;font-size:14px;font-weight:500;margin:0 0 4px 0;color:#5c6575}verdocs-contact-picker form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-contact-picker form input:focus{outline:none}verdocs-contact-picker form .dropdown{left:0;right:0;top:49px;z-index:1000000;position:absolute;background:#ffffff;-webkit-box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1);box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1)}verdocs-contact-picker form .dropdown .suggestion{display:-ms-flexbox;display:flex;padding:6px 12px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker form .dropdown .suggestion svg{fill:#666666}verdocs-contact-picker form .dropdown .suggestion .avatar{width:48px;height:48px;-ms-flex:0 0 48px;flex:0 0 48px;margin-right:8px;border-radius:100%}verdocs-contact-picker form .dropdown .suggestion .details{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-contact-picker form .dropdown .suggestion .name{font-size:16px;font-weight:500;margin-bottom:3px;color:#092c4c}verdocs-contact-picker form .dropdown .suggestion .destination{font-size:14px;margin-bottom:3px;color:#33364b}verdocs-contact-picker form .dropdown .suggestion:hover{background:#eee;cursor:pointer}verdocs-contact-picker .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker .buttons .flex-fill{-ms-flex:1;flex:1}verdocs-contact-picker ::-webkit-input-placeholder{color:#aaaaaa}verdocs-contact-picker ::-moz-placeholder{color:#aaaaaa}verdocs-contact-picker :-ms-input-placeholder{color:#aaaaaa}verdocs-contact-picker ::-ms-input-placeholder{color:#aaaaaa}verdocs-contact-picker ::placeholder{color:#aaaaaa}verdocs-contact-picker [data-lastpass-icon-root]{display:none !important}';var r=s;var d='<svg class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium MuiBox-root css-1om0hkc" focusable="false" aria-hidden="true" viewBox="0 0 24 24"><path d="M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-2 12H6v-2h12v2zm0-3H6V9h12v2zm0-3H6V6h12v2z"></path></svg>';var l='<svg class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium MuiSvgIcon-root MuiSvgIcon-fontSizeLarge css-zjt8k" focusable="false" aria-hidden="true" viewBox="0 0 24 24" data-testid="AssignmentIndIcon" tabindex="-1" title="AssignmentInd"><path d="M19 3h-4.18C14.4 1.84 13.3 1 12 1c-1.3 0-2.4.84-2.82 2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm0 4c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3zm6 12H6v-1.4c0-2 4-3.1 6-3.1s6 1.1 6 3.1V19z"></path></svg>';var f='<svg class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium MuiSvgIcon-root MuiSvgIcon-fontSizeLarge css-zjt8k" focusable="false" aria-hidden="true" viewBox="0 0 24 24" data-testid="AccountCircleIcon" tabindex="-1" title="AccountCircle"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 4c1.93 0 3.5 1.57 3.5 3.5S13.93 13 12 13s-3.5-1.57-3.5-3.5S10.07 6 12 6zm0 14c-2.03 0-4.43-.82-6.14-2.88C7.55 15.8 9.68 15 12 15s4.45.8 6.14 2.12C16.43 19.18 14.03 20 12 20z"></path></svg>';var u=e("verdocs_contact_picker",function(){function e(e){t(this,e);this.searchContacts=o(this,"searchContacts",7);this.exit=o(this,"exit",7);this.next=o(this,"next",7);this.endpoint=n.getDefault();this.templateRole=null;this.contactSuggestions=[];this.name=undefined;this.email=undefined;this.phone=undefined;this.message=undefined;this.showSuggestions=false;this.showMessage=false;this.delegator=false;this.nameFieldId="verdocs-contact-picker-name-".concat(Math.random().toString(36).substring(2,11));this.emailFieldId="verdocs-contact-picker-email-".concat(Math.random().toString(36).substring(2,11));this.phoneFieldId="verdocs-contact-picker-phone-".concat(Math.random().toString(36).substring(2,11))}e.prototype.componentWillLoad=function(){if(this.templateRole){this.name=this.templateRole.full_name||"";this.email=this.templateRole.email||"";this.phone=this.templateRole.phone||"";this.delegator=this.templateRole.delegator||false;this.message=this.templateRole.message||"";this.showMessage=this.message!==""}};e.prototype.handleNameChange=function(e){var t;this.name=e.target.value;(t=this.searchContacts)===null||t===void 0?void 0:t.emit({query:this.name})};e.prototype.handleEmailChange=function(e){this.email=e.target.value};e.prototype.handlePhoneChange=function(e){this.phone=a(e.target.value)};e.prototype.handleMessageChange=function(e){this.message=e.target.value};e.prototype.handleCancel=function(e){var t;e.stopPropagation();this.showSuggestions=false;(t=this.exit)===null||t===void 0?void 0:t.emit()};e.prototype.handleSubmit=function(e){var t;e.stopPropagation();this.showSuggestions=false;(t=this.next)===null||t===void 0?void 0:t.emit({full_name:this.name,email:this.email,phone:this.phone,message:this.message,delegator:this.delegator})};e.prototype.handleSelectSuggestion=function(e,t){e.stopPropagation();this.name=t.name;this.email=t.email;this.phone=t.phone;this.showSuggestions=false};e.prototype.render=function(){var e=this;return i("form",{key:"45acdba47c2999d3d4aa88c72e4451c5565b222e",onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},i("div",{key:"96b525fe36cb094bbd4492841cb095e62b4358b8",class:"row"},i("label",{key:"f264a4b8cc6da4ef82f78a1841d5b3bce0ae4fef",htmlFor:this.nameFieldId},"Name:"),i("input",{key:"15898561eeff05ad20dd73787f39702ab862d295",id:this.nameFieldId,name:this.nameFieldId,type:"text","data-lpignore":"true",autocomplete:"blocked",value:this.name,placeholder:"Recipient Name...",onFocus:function(){var t;return e.showSuggestions=((t=e.contactSuggestions)===null||t===void 0?void 0:t.length)>0},onInput:function(t){return e.handleNameChange(t)}}),this.showSuggestions&&i("div",{key:"ad28ba30382a2d2a40ac1992352368b883097553",class:"dropdown"},this.contactSuggestions.map((function(t){var o;return i("div",{key:(o=t.id)!==null&&o!==void 0?o:t.name,class:"suggestion",onClick:function(o){return e.handleSelectSuggestion(o,t)}},t.avatar?i("img",{alt:"Avatar",class:"avatar",src:t.avatar}):i("div",{class:"avatar",innerHTML:f}),i("div",{class:"details"},i("div",{class:"name"},t.name),t.email&&i("div",{class:"destination"},t.email),t.phone&&i("div",{class:"destination"},t.phone)))})))),i("div",{key:"7a7d4b6df5eab37ede0b87f9d10ba8b8e4e8254f",class:"row"},i("label",{key:"2058494eeac07248115323afe529bcaf681afed1",htmlFor:this.emailFieldId},"Email:"),i("input",{key:"d1c41d7b356190b4705e7d255103534bd1a47cd2",id:this.emailFieldId,name:this.emailFieldId,type:"text","data-lpignore":"true",autoComplete:"blocked",value:this.email,placeholder:"Email Address...",onFocus:function(){return e.showSuggestions=false},onInput:function(t){return e.handleEmailChange(t)}})),i("div",{key:"5f9668b15bfb2e1e06cc03e2f1ea051b893307f6",class:"row"},i("label",{key:"54b40e4aa240e2c6fb2364fbe59707d25dbfdb65",htmlFor:this.phoneFieldId},"Phone:"),i("input",{key:"dc20e317c4dbeae41bc9454685a0bf97f57db2bb",id:this.phoneFieldId,name:this.phoneFieldId,type:"text","data-lpignore":"true",autoComplete:"blocked",value:this.phone,placeholder:"Phone Number...",onFocus:function(){return e.showSuggestions=false},onInput:function(t){return e.handlePhoneChange(t)}})),this.showMessage&&i("div",{key:"85fb931022f96a0916c162e335a1ea91a11a9590",class:"row"},i("label",{key:"45c30e86e0038b8159c417bb59fb88885e309853",htmlFor:"verdocs-contact-picker-message"},"Message:"),i("input",{key:"edd7b070c3fa83fe93e3305d70182a63b8a273b5",id:"verdocs-contact-picker-message",name:"verdocs-contact-picker-message",type:"text","data-lpignore":"true",autocomplete:"blocked",value:this.message,placeholder:"Invitation Message...",onFocus:function(){return e.showSuggestions=false},onInput:function(t){return e.handleMessageChange(t)}})),i("div",{key:"0cfb64faed1d1bfa9d712811ac7c05412b135a8c",class:"buttons"},i("verdocs-toggle-button",{key:"6fe54edfc3e822f4863c8e2ad8109ea7cde8be94",icon:d,size:"small",active:this.showMessage,onToggle:function(t){e.showMessage=t.detail.active;e.showSuggestions=false}}),i("verdocs-toggle-button",{key:"56941f96e455fa978d664cfecd6c015c0c133127",icon:l,size:"small",active:this.delegator,onToggle:function(t){e.delegator=t.detail.active;e.showSuggestions=false}}),i("div",{key:"ec687a638006d9902d5041b57de14a0d6fbb4ff3",class:"flex-fill"}),i("verdocs-button",{key:"e984e3783aa6483ab20873254dd96998e0d505e8",variant:"outline",label:"Cancel",size:"small",onClick:function(t){return e.handleCancel(t)}}),i("verdocs-button",{key:"1b997aede29f9e8576c0739e089d879ba05ce123",label:"OK",size:"small",onClick:function(t){return e.handleSubmit(t)}})))};return e}());u.style=r;var b='@-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-toggle-button{font-family:"Inter", "Barlow", sans-serif}verdocs-toggle-button button{border:none;outline:none;cursor:pointer;-ms-flex-align:center;align-items:center;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-pack:center;justify-content:center;background:#cccccc;color:#33364b}verdocs-toggle-button button svg{max-width:100%;max-height:100%;fill:#33364b}verdocs-toggle-button button.active{background:#55bc81;color:#f5f5fa}verdocs-toggle-button button.active svg{fill:#f5f5fa}verdocs-toggle-button button:focus{border:none;outline:none}verdocs-toggle-button.size-normal button{width:40px;height:40px;padding:6px;border-radius:4px}verdocs-toggle-button.size-small button{width:34px;height:34px;padding:4px;border-radius:2px}';var p=b;var h=e("verdocs_toggle_button",function(){function e(e){t(this,e);this.toggle=o(this,"toggle",7);this.active=false;this.icon=null;this.label=null;this.size="normal";this._active=false}e.prototype.componentWillLoad=function(){this._active=this.active};e.prototype.handleToggle=function(e){var t;e.stopPropagation();var o=!this._active;this._active=o;(t=this.toggle)===null||t===void 0?void 0:t.emit({active:o})};e.prototype.render=function(){var e=this;return i(c,{key:"20e488d05d44870dcc7dd9ab4bf14b49d99b8d97",class:"size-".concat(this.size)},this.icon?i("button",{innerHTML:this.icon,class:{active:this._active},onClick:function(t){return e.handleToggle(t)}}):i("button",{class:{active:this._active},onClick:function(t){return e.handleToggle(t)}},this.label))};return e}());h.style=p}}}));