@verdocs/web-sdk 6.9.12 → 6.9.13

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 (253) hide show
  1. package/dist/cjs/verdocs-adopt-signature-dialog_7.cjs.entry.js +3 -3
  2. package/dist/cjs/verdocs-adopt-signature-dialog_7.cjs.entry.js.map +1 -1
  3. package/dist/cjs/verdocs-auth.cjs.entry.js +4 -0
  4. package/dist/cjs/verdocs-auth.cjs.entry.js.map +1 -1
  5. package/dist/cjs/verdocs-download-dialog_4.cjs.entry.js +9 -8
  6. package/dist/cjs/verdocs-download-dialog_4.cjs.entry.js.map +1 -1
  7. package/dist/cjs/verdocs-envelopes-list.cjs.entry.js +6 -6
  8. package/dist/cjs/verdocs-field-attachment_11.cjs.entry.js +1 -1
  9. package/dist/cjs/verdocs-initial-dialog.cjs.entry.js +1 -1
  10. package/dist/cjs/verdocs-menu-panel_2.cjs.entry.js +7 -7
  11. package/dist/cjs/verdocs-ok-dialog.cjs.entry.js +1 -1
  12. package/dist/cjs/verdocs-preview_6.cjs.entry.js +4 -0
  13. package/dist/cjs/verdocs-preview_6.cjs.entry.js.map +1 -1
  14. package/dist/cjs/verdocs-quick-functions.cjs.entry.js +1 -1
  15. package/dist/cjs/verdocs-search-tabs.cjs.entry.js +1 -1
  16. package/dist/cjs/verdocs-sign.cjs.entry.js +7 -3
  17. package/dist/cjs/verdocs-sign.cjs.entry.js.map +1 -1
  18. package/dist/cjs/verdocs-signature-dialog.cjs.entry.js +1 -1
  19. package/dist/cjs/verdocs-status-indicator.cjs.entry.js +2 -2
  20. package/dist/cjs/verdocs-template-card.cjs.entry.js +1 -1
  21. package/dist/cjs/verdocs-template-star.cjs.entry.js +1 -1
  22. package/dist/cjs/verdocs-template-tags.cjs.entry.js +1 -1
  23. package/dist/collection/components/dialogs/verdocs-download-dialog/verdocs-download-dialog.js +6 -5
  24. package/dist/collection/components/dialogs/verdocs-download-dialog/verdocs-download-dialog.js.map +1 -1
  25. package/dist/collection/components/dialogs/verdocs-initial-dialog/verdocs-initial-dialog.js +1 -1
  26. package/dist/collection/components/dialogs/verdocs-ok-dialog/verdocs-ok-dialog.js +1 -1
  27. package/dist/collection/components/dialogs/verdocs-otp-dialog/verdocs-otp-dialog.js +1 -1
  28. package/dist/collection/components/dialogs/verdocs-passcode-dialog/verdocs-passcode-dialog.js +1 -1
  29. package/dist/collection/components/dialogs/verdocs-question-dialog/verdocs-question-dialog.js +1 -1
  30. package/dist/collection/components/dialogs/verdocs-signature-dialog/verdocs-signature-dialog.js +1 -1
  31. package/dist/collection/components/dialogs/verdocs-upload-dialog/verdocs-upload-dialog.js +1 -1
  32. package/dist/collection/components/elements/verdocs-quick-functions/verdocs-quick-functions.js +1 -1
  33. package/dist/collection/components/elements/verdocs-search-tabs/verdocs-search-tabs.js +1 -1
  34. package/dist/collection/components/embeds/verdocs-auth/verdocs-auth.js +4 -0
  35. package/dist/collection/components/embeds/verdocs-auth/verdocs-auth.js.map +1 -1
  36. package/dist/collection/components/embeds/verdocs-send/verdocs-send.js +4 -0
  37. package/dist/collection/components/embeds/verdocs-send/verdocs-send.js.map +1 -1
  38. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js +7 -3
  39. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js.map +1 -1
  40. package/dist/collection/components/embeds/verdocs-view/verdocs-view.js +1 -1
  41. package/dist/collection/components/embeds/verdocs-view/verdocs-view.js.map +1 -1
  42. package/dist/collection/components/envelopes/verdocs-envelope-document-page/verdocs-envelope-document-page.js +1 -1
  43. package/dist/collection/components/envelopes/verdocs-envelopes-list/verdocs-envelopes-list.js +6 -6
  44. package/dist/collection/components/envelopes/verdocs-sign-footer/verdocs-sign-footer.js +1 -1
  45. package/dist/collection/components/envelopes/verdocs-status-indicator/verdocs-status-indicator.js +2 -2
  46. package/dist/collection/components/templates/verdocs-template-card/verdocs-template-card.js +1 -1
  47. package/dist/collection/components/templates/verdocs-template-role-properties/verdocs-template-role-properties.js +7 -7
  48. package/dist/collection/components/templates/verdocs-template-star/verdocs-template-star.js +1 -1
  49. package/dist/collection/components/templates/verdocs-template-tags/verdocs-template-tags.js +1 -1
  50. package/dist/components/{p-BxOEoXie.js → p-BIc5CIpg.js} +2 -2
  51. package/dist/components/{p-DjOTs59Z.js → p-BcQsqsDy.js} +2 -2
  52. package/dist/components/{p-Dtndevf4.js → p-BfKv6ivN.js} +2 -2
  53. package/dist/components/{p-Ce29XBfJ.js → p-Bkae9I4G.js} +2 -2
  54. package/dist/components/{p-Ce29XBfJ.js.map → p-Bkae9I4G.js.map} +1 -1
  55. package/dist/components/{p-D3qUITiS.js → p-BwUTiBud.js} +2 -2
  56. package/dist/components/{p-BVhOFpVZ.js → p-C8r3qDBh.js} +2 -2
  57. package/dist/components/p-C8r3qDBh.js.map +1 -0
  58. package/dist/components/{p-DsEO0-XR.js → p-CGWVITS0.js} +2 -2
  59. package/dist/components/{p-BvtSJusb.js → p-CGt7KiUu.js} +2 -2
  60. package/dist/components/{p-u16vefxk.js → p-CQUV5gMT.js} +2 -2
  61. package/dist/components/{p-Dmw-lE3L.js → p-CSIVZcVx.js} +2 -2
  62. package/dist/components/{p-C-V6jrel.js → p-DClinO5r.js} +2 -2
  63. package/dist/components/{p-Bpe5Awxh.js → p-DGws2Zgt.js} +2 -2
  64. package/dist/components/p-DGws2Zgt.js.map +1 -0
  65. package/dist/components/{p-DVGumEtx.js → p-DRgoGiAA.js} +2 -2
  66. package/dist/components/{p-BT8wzCXz.js → p-DSK9z7EN.js} +2 -2
  67. package/dist/components/{p-tub_01MP.js → p-DXbBz25U.js} +2 -2
  68. package/dist/components/{p-DIOVejyL.js → p-DyhyfLyV.js} +2 -2
  69. package/dist/components/{p-Yxa93LOl.js → p-db6IAGB0.js} +2 -2
  70. package/dist/components/{p-CDMCVJys.js → p-qDQgyl7L.js} +2 -2
  71. package/dist/components/{p-CFEw4Xbi.js → p-sPseFic3.js} +2 -2
  72. package/dist/components/verdocs-auth.js +1 -1
  73. package/dist/components/verdocs-auth.js.map +1 -1
  74. package/dist/components/verdocs-build.js +1 -1
  75. package/dist/components/verdocs-download-dialog.js +1 -1
  76. package/dist/components/verdocs-envelope-document-page.js +1 -1
  77. package/dist/components/verdocs-envelope-sidebar.js +1 -1
  78. package/dist/components/verdocs-envelopes-list.js +1 -1
  79. package/dist/components/verdocs-field-attachment.js +1 -1
  80. package/dist/components/verdocs-initial-dialog.js +1 -1
  81. package/dist/components/verdocs-ok-dialog.js +1 -1
  82. package/dist/components/verdocs-otp-dialog.js +1 -1
  83. package/dist/components/verdocs-passcode-dialog.js +1 -1
  84. package/dist/components/verdocs-preview.js +1 -1
  85. package/dist/components/verdocs-question-dialog.js +1 -1
  86. package/dist/components/verdocs-quick-functions.js +1 -1
  87. package/dist/components/verdocs-search-tabs.js +1 -1
  88. package/dist/components/verdocs-send.js +1 -1
  89. package/dist/components/verdocs-sign-footer.js +1 -1
  90. package/dist/components/verdocs-sign.js +1 -1
  91. package/dist/components/verdocs-sign.js.map +1 -1
  92. package/dist/components/verdocs-signature-dialog.js +1 -1
  93. package/dist/components/verdocs-status-indicator.js +1 -1
  94. package/dist/components/verdocs-template-attachments.js +1 -1
  95. package/dist/components/verdocs-template-card.js +1 -1
  96. package/dist/components/verdocs-template-document-page.js +1 -1
  97. package/dist/components/verdocs-template-fields.js +1 -1
  98. package/dist/components/verdocs-template-role-properties.js +1 -1
  99. package/dist/components/verdocs-template-roles.js +1 -1
  100. package/dist/components/verdocs-template-star.js +1 -1
  101. package/dist/components/verdocs-template-tags.js +1 -1
  102. package/dist/components/verdocs-templates-list.js +1 -1
  103. package/dist/components/verdocs-upload-dialog.js +1 -1
  104. package/dist/components/verdocs-view.js +1 -1
  105. package/dist/esm/verdocs-adopt-signature-dialog_7.entry.js +3 -3
  106. package/dist/esm/verdocs-adopt-signature-dialog_7.entry.js.map +1 -1
  107. package/dist/esm/verdocs-auth.entry.js +4 -0
  108. package/dist/esm/verdocs-auth.entry.js.map +1 -1
  109. package/dist/esm/verdocs-download-dialog_4.entry.js +9 -8
  110. package/dist/esm/verdocs-download-dialog_4.entry.js.map +1 -1
  111. package/dist/esm/verdocs-envelopes-list.entry.js +6 -6
  112. package/dist/esm/verdocs-field-attachment_11.entry.js +1 -1
  113. package/dist/esm/verdocs-initial-dialog.entry.js +1 -1
  114. package/dist/esm/verdocs-menu-panel_2.entry.js +7 -7
  115. package/dist/esm/verdocs-ok-dialog.entry.js +1 -1
  116. package/dist/esm/verdocs-preview_6.entry.js +4 -0
  117. package/dist/esm/verdocs-preview_6.entry.js.map +1 -1
  118. package/dist/esm/verdocs-quick-functions.entry.js +1 -1
  119. package/dist/esm/verdocs-search-tabs.entry.js +1 -1
  120. package/dist/esm/verdocs-sign.entry.js +7 -3
  121. package/dist/esm/verdocs-sign.entry.js.map +1 -1
  122. package/dist/esm/verdocs-signature-dialog.entry.js +1 -1
  123. package/dist/esm/verdocs-status-indicator.entry.js +2 -2
  124. package/dist/esm/verdocs-template-card.entry.js +1 -1
  125. package/dist/esm/verdocs-template-star.entry.js +1 -1
  126. package/dist/esm/verdocs-template-tags.entry.js +1 -1
  127. package/dist/esm-es5/verdocs-adopt-signature-dialog_7.entry.js +1 -1
  128. package/dist/esm-es5/verdocs-adopt-signature-dialog_7.entry.js.map +1 -1
  129. package/dist/esm-es5/verdocs-auth.entry.js +1 -1
  130. package/dist/esm-es5/verdocs-auth.entry.js.map +1 -1
  131. package/dist/esm-es5/verdocs-download-dialog_4.entry.js +1 -1
  132. package/dist/esm-es5/verdocs-download-dialog_4.entry.js.map +1 -1
  133. package/dist/esm-es5/verdocs-envelopes-list.entry.js +1 -1
  134. package/dist/esm-es5/verdocs-field-attachment_11.entry.js +1 -1
  135. package/dist/esm-es5/verdocs-initial-dialog.entry.js +1 -1
  136. package/dist/esm-es5/verdocs-menu-panel_2.entry.js +1 -1
  137. package/dist/esm-es5/verdocs-ok-dialog.entry.js +1 -1
  138. package/dist/esm-es5/verdocs-preview_6.entry.js +1 -1
  139. package/dist/esm-es5/verdocs-preview_6.entry.js.map +1 -1
  140. package/dist/esm-es5/verdocs-quick-functions.entry.js +1 -1
  141. package/dist/esm-es5/verdocs-search-tabs.entry.js +1 -1
  142. package/dist/esm-es5/verdocs-sign.entry.js +1 -1
  143. package/dist/esm-es5/verdocs-sign.entry.js.map +1 -1
  144. package/dist/esm-es5/verdocs-signature-dialog.entry.js +1 -1
  145. package/dist/esm-es5/verdocs-status-indicator.entry.js +1 -1
  146. package/dist/esm-es5/verdocs-template-card.entry.js +1 -1
  147. package/dist/esm-es5/verdocs-template-star.entry.js +1 -1
  148. package/dist/esm-es5/verdocs-template-tags.entry.js +1 -1
  149. package/dist/verdocs-web-sdk/{p-2f96e7c9.system.entry.js → p-0625e073.system.entry.js} +2 -2
  150. package/dist/verdocs-web-sdk/{p-40f5ecf3.system.entry.js → p-07a07c6b.system.entry.js} +2 -2
  151. package/dist/verdocs-web-sdk/p-15a1b8b5.system.entry.js +2 -0
  152. package/dist/verdocs-web-sdk/p-15a1b8b5.system.entry.js.map +1 -0
  153. package/dist/verdocs-web-sdk/{p-6abf8f8f.entry.js → p-1f898c53.entry.js} +2 -2
  154. package/dist/verdocs-web-sdk/{p-6abf8f8f.entry.js.map → p-1f898c53.entry.js.map} +1 -1
  155. package/dist/verdocs-web-sdk/p-2fa4010a.system.entry.js +2 -0
  156. package/dist/verdocs-web-sdk/p-2fa4010a.system.entry.js.map +1 -0
  157. package/dist/verdocs-web-sdk/{p-4798c2a5.system.entry.js → p-36aa8081.system.entry.js} +2 -2
  158. package/dist/verdocs-web-sdk/{p-c5b70927.system.entry.js → p-3c9a2290.system.entry.js} +2 -2
  159. package/dist/verdocs-web-sdk/p-48e2baa9.entry.js +2 -0
  160. package/dist/verdocs-web-sdk/p-48e2baa9.entry.js.map +1 -0
  161. package/dist/verdocs-web-sdk/{p-d09a4bb9.entry.js → p-4934f908.entry.js} +2 -2
  162. package/dist/verdocs-web-sdk/{p-6754dfcf.system.entry.js → p-4d8bf603.system.entry.js} +2 -2
  163. package/dist/verdocs-web-sdk/p-4fe507ee.entry.js +2 -0
  164. package/dist/verdocs-web-sdk/{p-810e09ca.entry.js → p-5678acd8.entry.js} +2 -2
  165. package/dist/verdocs-web-sdk/{p-cfb275c5.entry.js → p-609527c7.entry.js} +2 -2
  166. package/dist/verdocs-web-sdk/{p-1f1fc6d7.entry.js → p-82d0e009.entry.js} +2 -2
  167. package/dist/verdocs-web-sdk/p-90400330.entry.js +2 -0
  168. package/dist/verdocs-web-sdk/{p-d4f72da9.entry.js → p-98adcb3a.entry.js} +2 -2
  169. package/dist/verdocs-web-sdk/{p-ed953cca.entry.js → p-996cc1f6.entry.js} +2 -2
  170. package/dist/verdocs-web-sdk/p-BdZ5Ghsa.system.js +1 -1
  171. package/dist/verdocs-web-sdk/{p-9756028f.entry.js → p-ae92881f.entry.js} +2 -2
  172. package/dist/verdocs-web-sdk/p-ae92881f.entry.js.map +1 -0
  173. package/dist/verdocs-web-sdk/{p-04d2fa80.system.entry.js → p-b1146326.system.entry.js} +2 -2
  174. package/dist/verdocs-web-sdk/{p-1929a794.system.entry.js → p-b2aa0637.system.entry.js} +2 -2
  175. package/dist/verdocs-web-sdk/{p-64034b55.system.entry.js → p-b35a1ea8.system.entry.js} +2 -2
  176. package/dist/verdocs-web-sdk/{p-64034b55.system.entry.js.map → p-b35a1ea8.system.entry.js.map} +1 -1
  177. package/dist/verdocs-web-sdk/{p-1827477d.system.entry.js → p-b6390a11.system.entry.js} +2 -2
  178. package/dist/verdocs-web-sdk/p-b81c87ee.system.entry.js +2 -0
  179. package/dist/verdocs-web-sdk/p-b81c87ee.system.entry.js.map +1 -0
  180. package/dist/verdocs-web-sdk/{p-d3d177d0.system.entry.js → p-ba39a8ce.system.entry.js} +2 -2
  181. package/dist/verdocs-web-sdk/{p-495ed75e.system.entry.js → p-bd17bff7.system.entry.js} +2 -2
  182. package/dist/verdocs-web-sdk/{p-e632e92c.entry.js → p-c2b70cb9.entry.js} +2 -2
  183. package/dist/verdocs-web-sdk/{p-ca03555a.system.entry.js → p-c3660cce.system.entry.js} +2 -2
  184. package/dist/verdocs-web-sdk/{p-421c231a.entry.js → p-cbfc895c.entry.js} +2 -2
  185. package/dist/verdocs-web-sdk/{p-f85f8560.system.entry.js → p-d5cfbdac.system.entry.js} +2 -2
  186. package/dist/verdocs-web-sdk/p-d5cfbdac.system.entry.js.map +1 -0
  187. package/dist/verdocs-web-sdk/{p-842c345c.entry.js → p-e207c469.entry.js} +2 -2
  188. package/dist/verdocs-web-sdk/p-e679a32a.entry.js +2 -0
  189. package/dist/verdocs-web-sdk/p-e679a32a.entry.js.map +1 -0
  190. package/dist/verdocs-web-sdk/{p-d3b798ae.system.entry.js → p-e991121e.system.entry.js} +2 -2
  191. package/dist/verdocs-web-sdk/p-ed5c3f2d.entry.js +2 -0
  192. package/dist/verdocs-web-sdk/p-ed5c3f2d.entry.js.map +1 -0
  193. package/dist/verdocs-web-sdk/{p-f97ca49e.entry.js → p-fff5d042.entry.js} +2 -2
  194. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  195. package/package.json +2 -2
  196. package/dist/components/p-BVhOFpVZ.js.map +0 -1
  197. package/dist/components/p-Bpe5Awxh.js.map +0 -1
  198. package/dist/verdocs-web-sdk/p-0240a6e1.system.entry.js +0 -2
  199. package/dist/verdocs-web-sdk/p-0240a6e1.system.entry.js.map +0 -1
  200. package/dist/verdocs-web-sdk/p-12676649.entry.js +0 -2
  201. package/dist/verdocs-web-sdk/p-12676649.entry.js.map +0 -1
  202. package/dist/verdocs-web-sdk/p-1a6869c9.system.entry.js +0 -2
  203. package/dist/verdocs-web-sdk/p-1a6869c9.system.entry.js.map +0 -1
  204. package/dist/verdocs-web-sdk/p-3f5ad836.system.entry.js +0 -2
  205. package/dist/verdocs-web-sdk/p-3f5ad836.system.entry.js.map +0 -1
  206. package/dist/verdocs-web-sdk/p-62b6402f.entry.js +0 -2
  207. package/dist/verdocs-web-sdk/p-682c5a5c.entry.js +0 -2
  208. package/dist/verdocs-web-sdk/p-9756028f.entry.js.map +0 -1
  209. package/dist/verdocs-web-sdk/p-9c6cca6e.entry.js +0 -2
  210. package/dist/verdocs-web-sdk/p-9c6cca6e.entry.js.map +0 -1
  211. package/dist/verdocs-web-sdk/p-c89d74b2.entry.js +0 -2
  212. package/dist/verdocs-web-sdk/p-c89d74b2.entry.js.map +0 -1
  213. package/dist/verdocs-web-sdk/p-f85f8560.system.entry.js.map +0 -1
  214. /package/dist/components/{p-BxOEoXie.js.map → p-BIc5CIpg.js.map} +0 -0
  215. /package/dist/components/{p-DjOTs59Z.js.map → p-BcQsqsDy.js.map} +0 -0
  216. /package/dist/components/{p-Dtndevf4.js.map → p-BfKv6ivN.js.map} +0 -0
  217. /package/dist/components/{p-D3qUITiS.js.map → p-BwUTiBud.js.map} +0 -0
  218. /package/dist/components/{p-DsEO0-XR.js.map → p-CGWVITS0.js.map} +0 -0
  219. /package/dist/components/{p-BvtSJusb.js.map → p-CGt7KiUu.js.map} +0 -0
  220. /package/dist/components/{p-u16vefxk.js.map → p-CQUV5gMT.js.map} +0 -0
  221. /package/dist/components/{p-Dmw-lE3L.js.map → p-CSIVZcVx.js.map} +0 -0
  222. /package/dist/components/{p-C-V6jrel.js.map → p-DClinO5r.js.map} +0 -0
  223. /package/dist/components/{p-DVGumEtx.js.map → p-DRgoGiAA.js.map} +0 -0
  224. /package/dist/components/{p-BT8wzCXz.js.map → p-DSK9z7EN.js.map} +0 -0
  225. /package/dist/components/{p-tub_01MP.js.map → p-DXbBz25U.js.map} +0 -0
  226. /package/dist/components/{p-DIOVejyL.js.map → p-DyhyfLyV.js.map} +0 -0
  227. /package/dist/components/{p-Yxa93LOl.js.map → p-db6IAGB0.js.map} +0 -0
  228. /package/dist/components/{p-CDMCVJys.js.map → p-qDQgyl7L.js.map} +0 -0
  229. /package/dist/components/{p-CFEw4Xbi.js.map → p-sPseFic3.js.map} +0 -0
  230. /package/dist/verdocs-web-sdk/{p-2f96e7c9.system.entry.js.map → p-0625e073.system.entry.js.map} +0 -0
  231. /package/dist/verdocs-web-sdk/{p-40f5ecf3.system.entry.js.map → p-07a07c6b.system.entry.js.map} +0 -0
  232. /package/dist/verdocs-web-sdk/{p-4798c2a5.system.entry.js.map → p-36aa8081.system.entry.js.map} +0 -0
  233. /package/dist/verdocs-web-sdk/{p-c5b70927.system.entry.js.map → p-3c9a2290.system.entry.js.map} +0 -0
  234. /package/dist/verdocs-web-sdk/{p-d09a4bb9.entry.js.map → p-4934f908.entry.js.map} +0 -0
  235. /package/dist/verdocs-web-sdk/{p-6754dfcf.system.entry.js.map → p-4d8bf603.system.entry.js.map} +0 -0
  236. /package/dist/verdocs-web-sdk/{p-62b6402f.entry.js.map → p-4fe507ee.entry.js.map} +0 -0
  237. /package/dist/verdocs-web-sdk/{p-810e09ca.entry.js.map → p-5678acd8.entry.js.map} +0 -0
  238. /package/dist/verdocs-web-sdk/{p-cfb275c5.entry.js.map → p-609527c7.entry.js.map} +0 -0
  239. /package/dist/verdocs-web-sdk/{p-1f1fc6d7.entry.js.map → p-82d0e009.entry.js.map} +0 -0
  240. /package/dist/verdocs-web-sdk/{p-682c5a5c.entry.js.map → p-90400330.entry.js.map} +0 -0
  241. /package/dist/verdocs-web-sdk/{p-d4f72da9.entry.js.map → p-98adcb3a.entry.js.map} +0 -0
  242. /package/dist/verdocs-web-sdk/{p-ed953cca.entry.js.map → p-996cc1f6.entry.js.map} +0 -0
  243. /package/dist/verdocs-web-sdk/{p-04d2fa80.system.entry.js.map → p-b1146326.system.entry.js.map} +0 -0
  244. /package/dist/verdocs-web-sdk/{p-1929a794.system.entry.js.map → p-b2aa0637.system.entry.js.map} +0 -0
  245. /package/dist/verdocs-web-sdk/{p-1827477d.system.entry.js.map → p-b6390a11.system.entry.js.map} +0 -0
  246. /package/dist/verdocs-web-sdk/{p-d3d177d0.system.entry.js.map → p-ba39a8ce.system.entry.js.map} +0 -0
  247. /package/dist/verdocs-web-sdk/{p-495ed75e.system.entry.js.map → p-bd17bff7.system.entry.js.map} +0 -0
  248. /package/dist/verdocs-web-sdk/{p-e632e92c.entry.js.map → p-c2b70cb9.entry.js.map} +0 -0
  249. /package/dist/verdocs-web-sdk/{p-ca03555a.system.entry.js.map → p-c3660cce.system.entry.js.map} +0 -0
  250. /package/dist/verdocs-web-sdk/{p-421c231a.entry.js.map → p-cbfc895c.entry.js.map} +0 -0
  251. /package/dist/verdocs-web-sdk/{p-842c345c.entry.js.map → p-e207c469.entry.js.map} +0 -0
  252. /package/dist/verdocs-web-sdk/{p-d3b798ae.system.entry.js.map → p-e991121e.system.entry.js.map} +0 -0
  253. /package/dist/verdocs-web-sdk/{p-f97ca49e.entry.js.map → p-fff5d042.entry.js.map} +0 -0
@@ -1,8 +1,8 @@
1
- import{p as e,H as t,c as n,h as i,d as r,t as o}from"./p-yZBlG3YQ.js";import{VerdocsEndpoint as s,getTemplate as a,updateTemplateRole as l,createTemplateRole as u,formatFullName as f}from"@verdocs/js-sdk";import{S as c}from"./p-C1sRVZWv.js";import{S as d}from"./p-C7hFgM52.js";import{d as h}from"./p-Bdf8pPWm.js";import{d as v}from"./p-CyDWJAOZ.js";import{d as m}from"./p-CioaaWeS.js";import{d as p}from"./p-B-_kYJtC.js";import{d as g}from"./p-BhtYCb5T.js";import{d as b}from"./p-BXGNkmyr.js";import{d as w}from"./p-Dtndevf4.js";import{d as x}from"./p-DYtSnUj9.js";
1
+ import{p as e,H as t,c as n,h as i,d as r,t as o}from"./p-yZBlG3YQ.js";import{VerdocsEndpoint as s,getTemplate as a,updateTemplateRole as l,createTemplateRole as u,formatFullName as f}from"@verdocs/js-sdk";import{S as c}from"./p-C1sRVZWv.js";import{S as d}from"./p-C7hFgM52.js";import{d as h}from"./p-Bdf8pPWm.js";import{d as v}from"./p-CyDWJAOZ.js";import{d as m}from"./p-CioaaWeS.js";import{d as p}from"./p-B-_kYJtC.js";import{d as g}from"./p-BhtYCb5T.js";import{d as b}from"./p-BXGNkmyr.js";import{d as w}from"./p-BfKv6ivN.js";import{d as x}from"./p-DYtSnUj9.js";
2
2
  /**!
3
3
  * Sortable 1.15.7
4
4
  * @author RubaXa <trash@rubaxa.org>
5
5
  * @author owenm <owen23355@gmail.com>
6
6
  * @license MIT
7
7
  */function y(e,t,n){return(t=T(t))in e?Object.defineProperty(e,t,{value:n,enumerable:true,configurable:true,writable:true}):e[t]=n,e}function E(){return E=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},E.apply(null,arguments)}function S(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function k(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?S(Object(n),true).forEach((function(t){y(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):S(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function O(e,t){if(null==e)return{};var n,i,r=q(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)n=o[i],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function q(e,t){if(null==e)return{};var n={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(-1!==t.indexOf(i))continue;n[i]=e[i]}return n}function M(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t);if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function T(e){var t=M(e,"string");return"symbol"==typeof t?t:t+""}function I(e){"@babel/helpers - typeof";return I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},I(e)}var C="1.15.7";function R(e){if(typeof window!=="undefined"&&window.navigator){return!!navigator.userAgent.match(e)}}var L=R(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i);var j=R(/Edge/i);var D=R(/firefox/i);var _=R(/safari/i)&&!R(/chrome/i)&&!R(/android/i);var z=R(/iP(ad|od|hone)/i);var A=R(/chrome/i)&&R(/android/i);var N={capture:false,passive:false};function B(e,t,n){e.addEventListener(t,n,!L&&N)}function H(e,t,n){e.removeEventListener(t,n,!L&&N)}function Z(e,t){if(!t)return;t[0]===">"&&(t=t.substring(1));if(e){try{if(e.matches){return e.matches(t)}else if(e.msMatchesSelector){return e.msMatchesSelector(t)}else if(e.webkitMatchesSelector){return e.webkitMatchesSelector(t)}}catch(e){return false}}return false}function P(e){return e.host&&e!==document&&e.host.nodeType&&e.host!==e?e.host:e.parentNode}function U(e,t,n,i){if(e){n=n||document;do{if(t!=null&&(t[0]===">"?e.parentNode===n&&Z(e,t):Z(e,t))||i&&e===n){return e}if(e===n)break}while(e=P(e))}return null}var W=/\s+/g;function $(e,t,n){if(e&&t){if(e.classList){e.classList[n?"add":"remove"](t)}else{var i=(" "+e.className+" ").replace(W," ").replace(" "+t+" "," ");e.className=(i+(n?" "+t:"")).replace(W," ")}}}function F(e,t,n){var i=e&&e.style;if(i){if(n===void 0){if(document.defaultView&&document.defaultView.getComputedStyle){n=document.defaultView.getComputedStyle(e,"")}else if(e.currentStyle){n=e.currentStyle}return t===void 0?n:n[t]}else{if(!(t in i)&&t.indexOf("webkit")===-1){t="-webkit-"+t}i[t]=n+(typeof n==="string"?"":"px")}}}function Y(e,t){var n="";if(typeof e==="string"){n=e}else{do{var i=F(e,"transform");if(i&&i!=="none"){n=i+" "+n}}while(!t&&(e=e.parentNode))}var r=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return r&&new r(n)}function V(e,t,n){if(e){var i=e.getElementsByTagName(t),r=0,o=i.length;if(n){for(;r<o;r++){n(i[r],r)}}return i}return[]}function G(){var e=document.scrollingElement;if(e){return e}else{return document.documentElement}}function J(e,t,n,i,r){if(!e.getBoundingClientRect&&e!==window)return;var o,s,a,l,u,f,c;if(e!==window&&e.parentNode&&e!==G()){o=e.getBoundingClientRect();s=o.top;a=o.left;l=o.bottom;u=o.right;f=o.height;c=o.width}else{s=0;a=0;l=window.innerHeight;u=window.innerWidth;f=window.innerHeight;c=window.innerWidth}if((t||n)&&e!==window){r=r||e.parentNode;if(!L){do{if(r&&r.getBoundingClientRect&&(F(r,"transform")!=="none"||n&&F(r,"position")!=="static")){var d=r.getBoundingClientRect();s-=d.top+parseInt(F(r,"border-top-width"));a-=d.left+parseInt(F(r,"border-left-width"));l=s+o.height;u=a+o.width;break}}while(r=r.parentNode)}}if(i&&e!==window){var h=Y(r||e),v=h&&h.a,m=h&&h.d;if(h){s/=m;a/=v;c/=v;f/=m;l=s+f;u=a+c}}return{top:s,left:a,bottom:l,right:u,width:c,height:f}}function X(e,t,n){var i=ie(e,true),r=J(e)[t];while(i){var o=J(i)[n],s=void 0;{s=r>=o}if(!s)return i;if(i===G())break;i=ie(i,false)}return false}function K(e,t,n,i){var r=0,o=0,s=e.children;while(o<s.length){if(s[o].style.display!=="none"&&s[o]!==mt.ghost&&(i||s[o]!==mt.dragged)&&U(s[o],n.draggable,e,false)){if(r===t){return s[o]}r++}o++}return null}function Q(e,t){var n=e.lastElementChild;while(n&&(n===mt.ghost||F(n,"display")==="none"||t&&!Z(n,t))){n=n.previousElementSibling}return n||null}function ee(e,t){var n=0;if(!e||!e.parentNode){return-1}while(e=e.previousElementSibling){if(e.nodeName.toUpperCase()!=="TEMPLATE"&&e!==mt.clone&&(!t||Z(e,t))){n++}}return n}function te(e){var t=0,n=0,i=G();if(e){do{var r=Y(e),o=r.a,s=r.d;t+=e.scrollLeft*o;n+=e.scrollTop*s}while(e!==i&&(e=e.parentNode))}return[t,n]}function ne(e,t){for(var n in e){if(!e.hasOwnProperty(n))continue;for(var i in t){if(t.hasOwnProperty(i)&&t[i]===e[n][i])return Number(n)}}return-1}function ie(e,t){if(!e||!e.getBoundingClientRect)return G();var n=e;var i=false;do{if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var r=F(n);if(n.clientWidth<n.scrollWidth&&(r.overflowX=="auto"||r.overflowX=="scroll")||n.clientHeight<n.scrollHeight&&(r.overflowY=="auto"||r.overflowY=="scroll")){if(!n.getBoundingClientRect||n===document.body)return G();if(i||t)return n;i=true}}}while(n=n.parentNode);return G()}function re(e,t){if(e&&t){for(var n in t){if(t.hasOwnProperty(n)){e[n]=t[n]}}}return e}function oe(e,t){return Math.round(e.top)===Math.round(t.top)&&Math.round(e.left)===Math.round(t.left)&&Math.round(e.height)===Math.round(t.height)&&Math.round(e.width)===Math.round(t.width)}var se;function ae(e,t){return function(){if(!se){var n=arguments,i=this;if(n.length===1){e.call(i,n[0])}else{e.apply(i,n)}se=setTimeout((function(){se=void 0}),t)}}}function le(){clearTimeout(se);se=void 0}function ue(e,t,n){e.scrollLeft+=t;e.scrollTop+=n}function fe(e){var t=window.Polymer;var n=window.jQuery||window.Zepto;if(t&&t.dom){return t.dom(e).cloneNode(true)}else if(n){return n(e).clone(true)[0]}else{return e.cloneNode(true)}}function ce(e,t,n){var i={};Array.from(e.children).forEach((function(r){var o,s,a,l;if(!U(r,t.draggable,e,false)||r.animated||r===n)return;var u=J(r);i.left=Math.min((o=i.left)!==null&&o!==void 0?o:Infinity,u.left);i.top=Math.min((s=i.top)!==null&&s!==void 0?s:Infinity,u.top);i.right=Math.max((a=i.right)!==null&&a!==void 0?a:-Infinity,u.right);i.bottom=Math.max((l=i.bottom)!==null&&l!==void 0?l:-Infinity,u.bottom)}));i.width=i.right-i.left;i.height=i.bottom-i.top;i.x=i.left;i.y=i.top;return i}var de="Sortable"+(new Date).getTime();function he(){var e=[],t;return{captureAnimationState:function t(){e=[];if(!this.options.animation)return;var n=[].slice.call(this.el.children);n.forEach((function(t){if(F(t,"display")==="none"||t===mt.ghost)return;e.push({target:t,rect:J(t)});var n=k({},e[e.length-1].rect);if(t.thisAnimationDuration){var i=Y(t,true);if(i){n.top-=i.f;n.left-=i.e}}t.fromRect=n}))},addAnimationState:function t(n){e.push(n)},removeAnimationState:function t(n){e.splice(ne(e,{target:n}),1)},animateAll:function n(i){var r=this;if(!this.options.animation){clearTimeout(t);if(typeof i==="function")i();return}var o=false,s=0;e.forEach((function(e){var t=0,n=e.target,i=n.fromRect,a=J(n),l=n.prevFromRect,u=n.prevToRect,f=e.rect,c=Y(n,true);if(c){a.top-=c.f;a.left-=c.e}n.toRect=a;if(n.thisAnimationDuration){if(oe(l,a)&&!oe(i,a)&&(f.top-a.top)/(f.left-a.left)===(i.top-a.top)/(i.left-a.left)){t=me(f,l,u,r.options)}}if(!oe(a,i)){n.prevFromRect=i;n.prevToRect=a;if(!t){t=r.options.animation}r.animate(n,f,a,t)}if(t){o=true;s=Math.max(s,t);clearTimeout(n.animationResetTimer);n.animationResetTimer=setTimeout((function(){n.animationTime=0;n.prevFromRect=null;n.fromRect=null;n.prevToRect=null;n.thisAnimationDuration=null}),t);n.thisAnimationDuration=t}}));clearTimeout(t);if(!o){if(typeof i==="function")i()}else{t=setTimeout((function(){if(typeof i==="function")i()}),s)}e=[]},animate:function e(t,n,i,r){if(r){F(t,"transition","");F(t,"transform","");var o=Y(this.el),s=o&&o.a,a=o&&o.d,l=(n.left-i.left)/(s||1),u=(n.top-i.top)/(a||1);t.animatingX=!!l;t.animatingY=!!u;F(t,"transform","translate3d("+l+"px,"+u+"px,0)");this.forRepaintDummy=ve(t);F(t,"transition","transform "+r+"ms"+(this.options.easing?" "+this.options.easing:""));F(t,"transform","translate3d(0,0,0)");typeof t.animated==="number"&&clearTimeout(t.animated);t.animated=setTimeout((function(){F(t,"transition","");F(t,"transform","");t.animated=false;t.animatingX=false;t.animatingY=false}),r)}}}}function ve(e){return e.offsetWidth}function me(e,t,n,i){return Math.sqrt(Math.pow(t.top-e.top,2)+Math.pow(t.left-e.left,2))/Math.sqrt(Math.pow(t.top-n.top,2)+Math.pow(t.left-n.left,2))*i.animation}var pe=[];var ge={initializeByDefault:true};var be={mount:function e(t){for(var n in ge){if(ge.hasOwnProperty(n)&&!(n in t)){t[n]=ge[n]}}pe.forEach((function(e){if(e.pluginName===t.pluginName){throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")}}));pe.push(t)},pluginEvent:function e(t,n,i){var r=this;this.eventCanceled=false;i.cancel=function(){r.eventCanceled=true};var o=t+"Global";pe.forEach((function(e){if(!n[e.pluginName])return;if(n[e.pluginName][o]){n[e.pluginName][o](k({sortable:n},i))}if(n.options[e.pluginName]&&n[e.pluginName][t]){n[e.pluginName][t](k({sortable:n},i))}}))},initializePlugins:function e(t,n,i,r){pe.forEach((function(e){var r=e.pluginName;if(!t.options[r]&&!e.initializeByDefault)return;var o=new e(t,n,t.options);o.sortable=t;o.options=t.options;t[r]=o;E(i,o.defaults)}));for(var o in t.options){if(!t.options.hasOwnProperty(o))continue;var s=this.modifyOption(t,o,t.options[o]);if(typeof s!=="undefined"){t.options[o]=s}}},getEventProperties:function e(t,n){var i={};pe.forEach((function(e){if(typeof e.eventProperties!=="function")return;E(i,e.eventProperties.call(n[e.pluginName],t))}));return i},modifyOption:function e(t,n,i){var r;pe.forEach((function(e){if(!t[e.pluginName])return;if(e.optionListeners&&typeof e.optionListeners[n]==="function"){r=e.optionListeners[n].call(t[e.pluginName],i)}}));return r}};function we(e){var t=e.sortable,n=e.rootEl,i=e.name,r=e.targetEl,o=e.cloneEl,s=e.toEl,a=e.fromEl,l=e.oldIndex,u=e.newIndex,f=e.oldDraggableIndex,c=e.newDraggableIndex,d=e.originalEvent,h=e.putSortable,v=e.extraEventProperties;t=t||n&&n[de];if(!t)return;var m,p=t.options,g="on"+i.charAt(0).toUpperCase()+i.substr(1);if(window.CustomEvent&&!L&&!j){m=new CustomEvent(i,{bubbles:true,cancelable:true})}else{m=document.createEvent("Event");m.initEvent(i,true,true)}m.to=s||n;m.from=a||n;m.item=r||n;m.clone=o;m.oldIndex=l;m.newIndex=u;m.oldDraggableIndex=f;m.newDraggableIndex=c;m.originalEvent=d;m.pullMode=h?h.lastPutMode:undefined;var b=k(k({},v),be.getEventProperties(i,t));for(var w in b){m[w]=b[w]}if(n){n.dispatchEvent(m)}if(p[g]){p[g].call(t,m)}}var xe=["evt"];var ye=function e(t,n){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{},r=i.evt,o=O(i,xe);be.pluginEvent.bind(mt)(t,n,k({dragEl:Se,parentEl:ke,ghostEl:Oe,rootEl:qe,nextEl:Me,lastDownEl:Te,cloneEl:Ie,cloneHidden:Ce,dragStarted:Fe,putSortable:ze,activeSortable:mt.active,originalEvent:r,oldIndex:Re,oldDraggableIndex:je,newIndex:Le,newDraggableIndex:De,hideGhostForTarget:ct,unhideGhostForTarget:dt,cloneNowHidden:function e(){Ce=true},cloneNowShown:function e(){Ce=false},dispatchSortableEvent:function e(t){Ee({sortable:n,name:t,originalEvent:r})}},o))};function Ee(e){we(k({putSortable:ze,cloneEl:Ie,targetEl:Se,rootEl:qe,oldIndex:Re,oldDraggableIndex:je,newIndex:Le,newDraggableIndex:De},e))}var Se,ke,Oe,qe,Me,Te,Ie,Ce,Re,Le,je,De,_e,ze,Ae=false,Ne=false,Be=[],He,Ze,Pe,Ue,We,$e,Fe,Ye,Ve,Ge=false,Je=false,Xe,Ke,Qe=[],et=false,tt=[];var nt=typeof document!=="undefined",it=z,rt=j||L?"cssFloat":"float",ot=nt&&!A&&!z&&"draggable"in document.createElement("div"),st=function(){if(!nt)return;if(L){return false}var e=document.createElement("x");e.style.cssText="pointer-events:auto";return e.style.pointerEvents==="auto"}(),at=function e(t,n){var i=F(t),r=parseInt(i.width)-parseInt(i.paddingLeft)-parseInt(i.paddingRight)-parseInt(i.borderLeftWidth)-parseInt(i.borderRightWidth),o=K(t,0,n),s=K(t,1,n),a=o&&F(o),l=s&&F(s),u=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+J(o).width,f=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+J(s).width;if(i.display==="flex"){return i.flexDirection==="column"||i.flexDirection==="column-reverse"?"vertical":"horizontal"}if(i.display==="grid"){return i.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal"}if(o&&a["float"]&&a["float"]!=="none"){var c=a["float"]==="left"?"left":"right";return s&&(l.clear==="both"||l.clear===c)?"vertical":"horizontal"}return o&&(a.display==="block"||a.display==="flex"||a.display==="table"||a.display==="grid"||u>=r&&i[rt]==="none"||s&&i[rt]==="none"&&u+f>r)?"vertical":"horizontal"},lt=function e(t,n,i){var r=i?t.left:t.top,o=i?t.right:t.bottom,s=i?t.width:t.height,a=i?n.left:n.top,l=i?n.right:n.bottom,u=i?n.width:n.height;return r===a||o===l||r+s/2===a+u/2},ut=function e(t,n){var i;Be.some((function(e){var r=e[de].options.emptyInsertThreshold;if(!r||Q(e))return;var o=J(e),s=t>=o.left-r&&t<=o.right+r,a=n>=o.top-r&&n<=o.bottom+r;if(s&&a){return i=e}}));return i},ft=function e(t){function n(e,t){return function(i,r,o,s){var a=i.options.group.name&&r.options.group.name&&i.options.group.name===r.options.group.name;if(e==null&&(t||a)){return true}else if(e==null||e===false){return false}else if(t&&e==="clone"){return e}else if(typeof e==="function"){return n(e(i,r,o,s),t)(i,r,o,s)}else{var l=(t?i:r).options.group.name;return e===true||typeof e==="string"&&e===l||e.join&&e.indexOf(l)>-1}}}var i={};var r=t.group;if(!r||I(r)!="object"){r={name:r}}i.name=r.name;i.checkPull=n(r.pull,true);i.checkPut=n(r.put);i.revertClone=r.revertClone;t.group=i},ct=function e(){if(!st&&Oe){F(Oe,"display","none")}},dt=function e(){if(!st&&Oe){F(Oe,"display","")}};if(nt&&!A){document.addEventListener("click",(function(e){if(Ne){e.preventDefault();e.stopPropagation&&e.stopPropagation();e.stopImmediatePropagation&&e.stopImmediatePropagation();Ne=false;return false}}),true)}var ht=function e(t){if(Se){t=t.touches?t.touches[0]:t;var n=ut(t.clientX,t.clientY);if(n){var i={};for(var r in t){if(t.hasOwnProperty(r)){i[r]=t[r]}}i.target=i.rootEl=n;i.preventDefault=void 0;i.stopPropagation=void 0;n[de]._onDragOver(i)}}};var vt=function e(t){if(Se){Se.parentNode[de]._isOutsideThisEl(t.target)}};function mt(e,t){if(!(e&&e.nodeType&&e.nodeType===1)){throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e))}this.el=e;this.options=t=E({},t);e[de]=this;var n={group:null,sort:true,disabled:false,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:false,invertedSwapThreshold:null,removeCloneOnHide:true,direction:function t(){return at(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:true,animation:0,easing:null,setData:function e(t,n){t.setData("Text",n.textContent)},dropBubble:false,dragoverBubble:false,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:false,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:false,fallbackClass:"sortable-fallback",fallbackOnBody:false,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:mt.supportPointer!==false&&"PointerEvent"in window&&(!_||z),emptyInsertThreshold:5};be.initializePlugins(this,e,n);for(var i in n){!(i in t)&&(t[i]=n[i])}ft(t);for(var r in this){if(r.charAt(0)==="_"&&typeof this[r]==="function"){this[r]=this[r].bind(this)}}this.nativeDraggable=t.forceFallback?false:ot;if(this.nativeDraggable){this.options.touchStartThreshold=1}if(t.supportPointer){B(e,"pointerdown",this._onTapStart)}else{B(e,"mousedown",this._onTapStart);B(e,"touchstart",this._onTapStart)}if(this.nativeDraggable){B(e,"dragover",this);B(e,"dragenter",this)}Be.push(this.el);t.store&&t.store.get&&this.sort(t.store.get(this)||[]);E(this,he())}mt.prototype={constructor:mt,_isOutsideThisEl:function e(t){if(!this.el.contains(t)&&t!==this.el){Ye=null}},_getDirection:function e(t,n){return typeof this.options.direction==="function"?this.options.direction.call(this,t,n,Se):this.options.direction},_onTapStart:function e(t){if(!t.cancelable)return;var n=this,i=this.el,r=this.options,o=r.preventOnFilter,s=t.type,a=t.touches&&t.touches[0]||t.pointerType&&t.pointerType==="touch"&&t,l=(a||t).target,u=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||l,f=r.filter;Ot(i);if(Se){return}if(/mousedown|pointerdown/.test(s)&&t.button!==0||r.disabled){return}if(u.isContentEditable){return}if(!this.nativeDraggable&&_&&l&&l.tagName.toUpperCase()==="SELECT"){return}l=U(l,r.draggable,i,false);if(l&&l.animated){return}if(Te===l){return}Re=ee(l);je=ee(l,r.draggable);if(typeof f==="function"){if(f.call(this,t,l,this)){Ee({sortable:n,rootEl:u,name:"filter",targetEl:l,toEl:i,fromEl:i});ye("filter",n,{evt:t});o&&t.preventDefault();return}}else if(f){f=f.split(",").some((function(e){e=U(u,e.trim(),i,false);if(e){Ee({sortable:n,rootEl:e,name:"filter",targetEl:l,fromEl:i,toEl:i});ye("filter",n,{evt:t});return true}}));if(f){o&&t.preventDefault();return}}if(r.handle&&!U(u,r.handle,i,false)){return}this._prepareDragStart(t,a,l)},_prepareDragStart:function e(t,n,i){var r=this,o=r.el,s=r.options,a=o.ownerDocument,l;if(i&&!Se&&i.parentNode===o){var u=J(i);qe=o;Se=i;ke=Se.parentNode;Me=Se.nextSibling;Te=i;_e=s.group;mt.dragged=Se;He={target:Se,clientX:(n||t).clientX,clientY:(n||t).clientY};We=He.clientX-u.left;$e=He.clientY-u.top;this._lastX=(n||t).clientX;this._lastY=(n||t).clientY;Se.style["will-change"]="all";l=function e(){ye("delayEnded",r,{evt:t});if(mt.eventCanceled){r._onDrop();return}r._disableDelayedDragEvents();if(!D&&r.nativeDraggable){Se.draggable=true}r._triggerDragStart(t,n);Ee({sortable:r,name:"choose",originalEvent:t});$(Se,s.chosenClass,true)};s.ignore.split(",").forEach((function(e){V(Se,e.trim(),bt)}));B(a,"dragover",ht);B(a,"mousemove",ht);B(a,"touchmove",ht);if(s.supportPointer){B(a,"pointerup",r._onDrop);!this.nativeDraggable&&B(a,"pointercancel",r._onDrop)}else{B(a,"mouseup",r._onDrop);B(a,"touchend",r._onDrop);B(a,"touchcancel",r._onDrop)}if(D&&this.nativeDraggable){this.options.touchStartThreshold=4;Se.draggable=true}ye("delayStart",this,{evt:t});if(s.delay&&(!s.delayOnTouchOnly||n)&&(!this.nativeDraggable||!(j||L))){if(mt.eventCanceled){this._onDrop();return}if(s.supportPointer){B(a,"pointerup",r._disableDelayedDrag);B(a,"pointercancel",r._disableDelayedDrag)}else{B(a,"mouseup",r._disableDelayedDrag);B(a,"touchend",r._disableDelayedDrag);B(a,"touchcancel",r._disableDelayedDrag)}B(a,"mousemove",r._delayedDragTouchMoveHandler);B(a,"touchmove",r._delayedDragTouchMoveHandler);s.supportPointer&&B(a,"pointermove",r._delayedDragTouchMoveHandler);r._dragStartTimer=setTimeout(l,s.delay)}else{l()}}},_delayedDragTouchMoveHandler:function e(t){var n=t.touches?t.touches[0]:t;if(Math.max(Math.abs(n.clientX-this._lastX),Math.abs(n.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))){this._disableDelayedDrag()}},_disableDelayedDrag:function e(){Se&&bt(Se);clearTimeout(this._dragStartTimer);this._disableDelayedDragEvents()},_disableDelayedDragEvents:function e(){var t=this.el.ownerDocument;H(t,"mouseup",this._disableDelayedDrag);H(t,"touchend",this._disableDelayedDrag);H(t,"touchcancel",this._disableDelayedDrag);H(t,"pointerup",this._disableDelayedDrag);H(t,"pointercancel",this._disableDelayedDrag);H(t,"mousemove",this._delayedDragTouchMoveHandler);H(t,"touchmove",this._delayedDragTouchMoveHandler);H(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function e(t,n){n=n||t.pointerType=="touch"&&t;if(!this.nativeDraggable||n){if(this.options.supportPointer){B(document,"pointermove",this._onTouchMove)}else if(n){B(document,"touchmove",this._onTouchMove)}else{B(document,"mousemove",this._onTouchMove)}}else{B(Se,"dragend",this);B(qe,"dragstart",this._onDragStart)}try{if(document.selection){qt((function(){document.selection.empty()}))}else{window.getSelection().removeAllRanges()}}catch(e){}},_dragStarted:function e(t,n){Ae=false;if(qe&&Se){ye("dragStarted",this,{evt:n});if(this.nativeDraggable){B(document,"dragover",vt)}var i=this.options;!t&&$(Se,i.dragClass,false);$(Se,i.ghostClass,true);mt.active=this;t&&this._appendGhost();Ee({sortable:this,name:"start",originalEvent:n})}else{this._nulling()}},_emulateDragOver:function e(){if(Ze){this._lastX=Ze.clientX;this._lastY=Ze.clientY;ct();var t=document.elementFromPoint(Ze.clientX,Ze.clientY);var n=t;while(t&&t.shadowRoot){t=t.shadowRoot.elementFromPoint(Ze.clientX,Ze.clientY);if(t===n)break;n=t}Se.parentNode[de]._isOutsideThisEl(t);if(n){do{if(n[de]){var i=void 0;i=n[de]._onDragOver({clientX:Ze.clientX,clientY:Ze.clientY,target:t,rootEl:n});if(i&&!this.options.dragoverBubble){break}}t=n}while(n=P(n))}dt()}},_onTouchMove:function e(t){if(He){var n=this.options,i=n.fallbackTolerance,r=n.fallbackOffset,o=t.touches?t.touches[0]:t,s=Oe&&Y(Oe,true),a=Oe&&s&&s.a,l=Oe&&s&&s.d,u=it&&Ke&&te(Ke),f=(o.clientX-He.clientX+r.x)/(a||1)+(u?u[0]-Qe[0]:0)/(a||1),c=(o.clientY-He.clientY+r.y)/(l||1)+(u?u[1]-Qe[1]:0)/(l||1);if(!mt.active&&!Ae){if(i&&Math.max(Math.abs(o.clientX-this._lastX),Math.abs(o.clientY-this._lastY))<i){return}this._onDragStart(t,true)}if(Oe){if(s){s.e+=f-(Pe||0);s.f+=c-(Ue||0)}else{s={a:1,b:0,c:0,d:1,e:f,f:c}}var d="matrix(".concat(s.a,",").concat(s.b,",").concat(s.c,",").concat(s.d,",").concat(s.e,",").concat(s.f,")");F(Oe,"webkitTransform",d);F(Oe,"mozTransform",d);F(Oe,"msTransform",d);F(Oe,"transform",d);Pe=f;Ue=c;Ze=o}t.cancelable&&t.preventDefault()}},_appendGhost:function e(){if(!Oe){var t=this.options.fallbackOnBody?document.body:qe,n=J(Se,true,it,true,t),i=this.options;if(it){Ke=t;while(F(Ke,"position")==="static"&&F(Ke,"transform")==="none"&&Ke!==document){Ke=Ke.parentNode}if(Ke!==document.body&&Ke!==document.documentElement){if(Ke===document)Ke=G();n.top+=Ke.scrollTop;n.left+=Ke.scrollLeft}else{Ke=G()}Qe=te(Ke)}Oe=Se.cloneNode(true);$(Oe,i.ghostClass,false);$(Oe,i.fallbackClass,true);$(Oe,i.dragClass,true);F(Oe,"transition","");F(Oe,"transform","");F(Oe,"box-sizing","border-box");F(Oe,"margin",0);F(Oe,"top",n.top);F(Oe,"left",n.left);F(Oe,"width",n.width);F(Oe,"height",n.height);F(Oe,"opacity","0.8");F(Oe,"position",it?"absolute":"fixed");F(Oe,"zIndex","100000");F(Oe,"pointerEvents","none");mt.ghost=Oe;t.appendChild(Oe);F(Oe,"transform-origin",We/parseInt(Oe.style.width)*100+"% "+$e/parseInt(Oe.style.height)*100+"%")}},_onDragStart:function e(t,n){var i=this;var r=t.dataTransfer;var o=i.options;ye("dragStart",this,{evt:t});if(mt.eventCanceled){this._onDrop();return}ye("setupClone",this);if(!mt.eventCanceled){Ie=fe(Se);Ie.removeAttribute("id");Ie.draggable=false;Ie.style["will-change"]="";this._hideClone();$(Ie,this.options.chosenClass,false);mt.clone=Ie}i.cloneId=qt((function(){ye("clone",i);if(mt.eventCanceled)return;if(!i.options.removeCloneOnHide){qe.insertBefore(Ie,Se)}i._hideClone();Ee({sortable:i,name:"clone"})}));!n&&$(Se,o.dragClass,true);if(n){Ne=true;i._loopId=setInterval(i._emulateDragOver,50)}else{H(document,"mouseup",i._onDrop);H(document,"touchend",i._onDrop);H(document,"touchcancel",i._onDrop);if(r){r.effectAllowed="move";o.setData&&o.setData.call(i,r,Se)}B(document,"drop",i);F(Se,"transform","translateZ(0)")}Ae=true;i._dragStartId=qt(i._dragStarted.bind(i,n,t));B(document,"selectstart",i);Fe=true;window.getSelection().removeAllRanges();if(_){F(document.body,"user-select","none")}},_onDragOver:function e(t){var n=this.el,i=t.target,r,o,s,a=this.options,l=a.group,u=mt.active,f=_e===l,c=a.sort,d=ze||u,h,v=this,m=false;if(et)return;function p(e,a){ye(e,v,k({evt:t,isOwner:f,axis:h?"vertical":"horizontal",revert:s,dragRect:r,targetRect:o,canSort:c,fromSortable:d,target:i,completed:b,onMove:function e(i,o){return gt(qe,n,Se,r,i,J(i),t,o)},changed:w},a))}function g(){p("dragOverAnimationCapture");v.captureAnimationState();if(v!==d){d.captureAnimationState()}}function b(e){p("dragOverCompleted",{insertion:e});if(e){if(f){u._hideClone()}else{u._showClone(v)}if(v!==d){$(Se,ze?ze.options.ghostClass:u.options.ghostClass,false);$(Se,a.ghostClass,true)}if(ze!==v&&v!==mt.active){ze=v}else if(v===mt.active&&ze){ze=null}if(d===v){v._ignoreWhileAnimating=i}v.animateAll((function(){p("dragOverAnimationComplete");v._ignoreWhileAnimating=null}));if(v!==d){d.animateAll();d._ignoreWhileAnimating=null}}if(i===Se&&!Se.animated||i===n&&!i.animated){Ye=null}if(!a.dragoverBubble&&!t.rootEl&&i!==document){Se.parentNode[de]._isOutsideThisEl(t.target);!e&&ht(t)}!a.dragoverBubble&&t.stopPropagation&&t.stopPropagation();return m=true}function w(){Le=ee(Se);De=ee(Se,a.draggable);Ee({sortable:v,name:"change",toEl:n,newIndex:Le,newDraggableIndex:De,originalEvent:t})}if(t.preventDefault!==void 0){t.cancelable&&t.preventDefault()}i=U(i,a.draggable,n,true);p("dragOver");if(mt.eventCanceled)return m;if(Se.contains(t.target)||i.animated&&i.animatingX&&i.animatingY||v._ignoreWhileAnimating===i){return b(false)}Ne=false;if(u&&!a.disabled&&(f?c||(s=ke!==qe):ze===this||(this.lastPutMode=_e.checkPull(this,u,Se,t))&&l.checkPut(this,u,Se,t))){h=this._getDirection(t,i)==="vertical";r=J(Se);p("dragOverValid");if(mt.eventCanceled)return m;if(s){ke=qe;g();this._hideClone();p("revert");if(!mt.eventCanceled){if(Me){qe.insertBefore(Se,Me)}else{qe.appendChild(Se)}}return b(true)}var x=Q(n,a.draggable);if(!x||yt(t,h,this)&&!x.animated){if(x===Se){return b(false)}if(x&&n===t.target){i=x}if(i){o=J(i)}if(gt(qe,n,Se,r,i,o,t,!!i)!==false){g();if(x&&x.nextSibling){n.insertBefore(Se,x.nextSibling)}else{n.appendChild(Se)}ke=n;w();return b(true)}}else if(x&&xt(t,h,this)){var y=K(n,0,a,true);if(y===Se){return b(false)}i=y;o=J(i);if(gt(qe,n,Se,r,i,o,t,false)!==false){g();n.insertBefore(Se,y);ke=n;w();return b(true)}}else if(i.parentNode===n){o=J(i);var E=0,S,O=Se.parentNode!==n,q=!lt(Se.animated&&Se.toRect||r,i.animated&&i.toRect||o,h),M=h?"top":"left",T=X(i,"top","top")||X(Se,"top","top"),I=T?T.scrollTop:void 0;if(Ye!==i){S=o[M];Ge=false;Je=!q&&a.invertSwap||O}E=Et(t,i,o,h,q?1:a.swapThreshold,a.invertedSwapThreshold==null?a.swapThreshold:a.invertedSwapThreshold,Je,Ye===i);var C;if(E!==0){var R=ee(Se);do{R-=E;C=ke.children[R]}while(C&&(F(C,"display")==="none"||C===Oe))}if(E===0||C===i){return b(false)}Ye=i;Ve=E;var L=i.nextElementSibling,j=false;j=E===1;var D=gt(qe,n,Se,r,i,o,t,j);if(D!==false){if(D===1||D===-1){j=D===1}et=true;setTimeout(wt,30);g();if(j&&!L){n.appendChild(Se)}else{i.parentNode.insertBefore(Se,j?L:i)}if(T){ue(T,0,I-T.scrollTop)}ke=Se.parentNode;if(S!==undefined&&!Je){Xe=Math.abs(S-J(i)[M])}w();return b(true)}}if(n.contains(Se)){return b(false)}}return false},_ignoreWhileAnimating:null,_offMoveEvents:function e(){H(document,"mousemove",this._onTouchMove);H(document,"touchmove",this._onTouchMove);H(document,"pointermove",this._onTouchMove);H(document,"dragover",ht);H(document,"mousemove",ht);H(document,"touchmove",ht)},_offUpEvents:function e(){var t=this.el.ownerDocument;H(t,"mouseup",this._onDrop);H(t,"touchend",this._onDrop);H(t,"pointerup",this._onDrop);H(t,"pointercancel",this._onDrop);H(t,"touchcancel",this._onDrop);H(document,"selectstart",this)},_onDrop:function e(t){var n=this.el,i=this.options;Le=ee(Se);De=ee(Se,i.draggable);ye("drop",this,{evt:t});ke=Se&&Se.parentNode;Le=ee(Se);De=ee(Se,i.draggable);if(mt.eventCanceled){this._nulling();return}Ae=false;Je=false;Ge=false;clearInterval(this._loopId);clearTimeout(this._dragStartTimer);Mt(this.cloneId);Mt(this._dragStartId);if(this.nativeDraggable){H(document,"drop",this);H(n,"dragstart",this._onDragStart)}this._offMoveEvents();this._offUpEvents();if(_){F(document.body,"user-select","")}F(Se,"transform","");if(t){if(Fe){t.cancelable&&t.preventDefault();!i.dropBubble&&t.stopPropagation()}Oe&&Oe.parentNode&&Oe.parentNode.removeChild(Oe);if(qe===ke||ze&&ze.lastPutMode!=="clone"){Ie&&Ie.parentNode&&Ie.parentNode.removeChild(Ie)}if(Se){if(this.nativeDraggable){H(Se,"dragend",this)}bt(Se);Se.style["will-change"]="";if(Fe&&!Ae){$(Se,ze?ze.options.ghostClass:this.options.ghostClass,false)}$(Se,this.options.chosenClass,false);Ee({sortable:this,name:"unchoose",toEl:ke,newIndex:null,newDraggableIndex:null,originalEvent:t});if(qe!==ke){if(Le>=0){Ee({rootEl:ke,name:"add",toEl:ke,fromEl:qe,originalEvent:t});Ee({sortable:this,name:"remove",toEl:ke,originalEvent:t});Ee({rootEl:ke,name:"sort",toEl:ke,fromEl:qe,originalEvent:t});Ee({sortable:this,name:"sort",toEl:ke,originalEvent:t})}ze&&ze.save()}else{if(Le!==Re){if(Le>=0){Ee({sortable:this,name:"update",toEl:ke,originalEvent:t});Ee({sortable:this,name:"sort",toEl:ke,originalEvent:t})}}}if(mt.active){if(Le==null||Le===-1){Le=Re;De=je}Ee({sortable:this,name:"end",toEl:ke,originalEvent:t});this.save()}}}this._nulling()},_nulling:function e(){ye("nulling",this);qe=Se=ke=Oe=Me=Ie=Te=Ce=He=Ze=Fe=Le=De=Re=je=Ye=Ve=ze=_e=mt.dragged=mt.ghost=mt.clone=mt.active=null;var t=this.el;tt.forEach((function(e){if(t.contains(e)){e.checked=true}}));tt.length=Pe=Ue=0},handleEvent:function e(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":if(Se){this._onDragOver(t);pt(t)}break;case"selectstart":t.preventDefault();break}},toArray:function e(){var t=[],n,i=this.el.children,r=0,o=i.length,s=this.options;for(;r<o;r++){n=i[r];if(U(n,s.draggable,this.el,false)){t.push(n.getAttribute(s.dataIdAttr)||kt(n))}}return t},sort:function e(t,n){var i={},r=this.el;this.toArray().forEach((function(e,t){var n=r.children[t];if(U(n,this.options.draggable,r,false)){i[e]=n}}),this);n&&this.captureAnimationState();t.forEach((function(e){if(i[e]){r.removeChild(i[e]);r.appendChild(i[e])}}));n&&this.animateAll()},save:function e(){var t=this.options.store;t&&t.set&&t.set(this)},closest:function e(t,n){return U(t,n||this.options.draggable,this.el,false)},option:function e(t,n){var i=this.options;if(n===void 0){return i[t]}else{var r=be.modifyOption(this,t,n);if(typeof r!=="undefined"){i[t]=r}else{i[t]=n}if(t==="group"){ft(i)}}},destroy:function e(){ye("destroy",this);var t=this.el;t[de]=null;H(t,"mousedown",this._onTapStart);H(t,"touchstart",this._onTapStart);H(t,"pointerdown",this._onTapStart);if(this.nativeDraggable){H(t,"dragover",this);H(t,"dragenter",this)}Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),(function(e){e.removeAttribute("draggable")}));this._onDrop();this._disableDelayedDragEvents();Be.splice(Be.indexOf(this.el),1);this.el=t=null},_hideClone:function e(){if(!Ce){ye("hideClone",this);if(mt.eventCanceled)return;F(Ie,"display","none");if(this.options.removeCloneOnHide&&Ie.parentNode){Ie.parentNode.removeChild(Ie)}Ce=true}},_showClone:function e(t){if(t.lastPutMode!=="clone"){this._hideClone();return}if(Ce){ye("showClone",this);if(mt.eventCanceled)return;if(Se.parentNode==qe&&!this.options.group.revertClone){qe.insertBefore(Ie,Se)}else if(Me){qe.insertBefore(Ie,Me)}else{qe.appendChild(Ie)}if(this.options.group.revertClone){this.animate(Se,Ie)}F(Ie,"display","");Ce=false}}};function pt(e){if(e.dataTransfer){e.dataTransfer.dropEffect="move"}e.cancelable&&e.preventDefault()}function gt(e,t,n,i,r,o,s,a){var l,u=e[de],f=u.options.onMove,c;if(window.CustomEvent&&!L&&!j){l=new CustomEvent("move",{bubbles:true,cancelable:true})}else{l=document.createEvent("Event");l.initEvent("move",true,true)}l.to=t;l.from=e;l.dragged=n;l.draggedRect=i;l.related=r||t;l.relatedRect=o||J(t);l.willInsertAfter=a;l.originalEvent=s;e.dispatchEvent(l);if(f){c=f.call(u,l,s)}return c}function bt(e){e.draggable=false}function wt(){et=false}function xt(e,t,n){var i=J(K(n.el,0,n.options,true));var r=ce(n.el,n.options,Oe);var o=10;return t?e.clientX<r.left-o||e.clientY<i.top&&e.clientX<i.right:e.clientY<r.top-o||e.clientY<i.bottom&&e.clientX<i.left}function yt(e,t,n){var i=J(Q(n.el,n.options.draggable));var r=ce(n.el,n.options,Oe);var o=10;return t?e.clientX>r.right+o||e.clientY>i.bottom&&e.clientX>i.left:e.clientY>r.bottom+o||e.clientX>i.right&&e.clientY>i.top}function Et(e,t,n,i,r,o,s,a){var l=i?e.clientY:e.clientX,u=i?n.height:n.width,f=i?n.top:n.left,c=i?n.bottom:n.right,d=false;if(!s){if(a&&Xe<u*r){if(!Ge&&(Ve===1?l>f+u*o/2:l<c-u*o/2)){Ge=true}if(!Ge){if(Ve===1?l<f+Xe:l>c-Xe){return-Ve}}else{d=true}}else{if(l>f+u*(1-r)/2&&l<c-u*(1-r)/2){return St(t)}}}d=d||s;if(d){if(l<f+u*o/2||l>c-u*o/2){return l>f+u/2?1:-1}}return 0}function St(e){if(ee(Se)<ee(e)){return 1}else{return-1}}function kt(e){var t=e.tagName+e.className+e.src+e.href+e.textContent,n=t.length,i=0;while(n--){i+=t.charCodeAt(n)}return i.toString(36)}function Ot(e){tt.length=0;var t=e.getElementsByTagName("input");var n=t.length;while(n--){var i=t[n];i.checked&&tt.push(i)}}function qt(e){return setTimeout(e,0)}function Mt(e){return clearTimeout(e)}if(nt){B(document,"touchmove",(function(e){if((mt.active||Ae)&&e.cancelable){e.preventDefault()}}))}mt.utils={on:B,off:H,css:F,find:V,is:function e(t,n){return!!U(t,n,t,false)},extend:re,throttle:ae,closest:U,toggleClass:$,clone:fe,index:ee,nextTick:qt,cancelNextTick:Mt,detectDirection:at,getChild:K,expando:de};mt.get=function(e){return e[de]};mt.mount=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}if(t[0].constructor===Array)t=t[0];t.forEach((function(e){if(!e.prototype||!e.prototype.constructor){throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(e))}if(e.utils)mt.utils=k(k({},mt.utils),e.utils);be.mount(e)}))};mt.create=function(e,t){return new mt(e,t)};mt.version=C;var Tt=[],It,Ct,Rt=false,Lt,jt,Dt,_t;function zt(){function e(){this.defaults={scroll:true,forceAutoScrollFallback:false,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:true};for(var e in this){if(e.charAt(0)==="_"&&typeof this[e]==="function"){this[e]=this[e].bind(this)}}}e.prototype={dragStarted:function e(t){var n=t.originalEvent;if(this.sortable.nativeDraggable){B(document,"dragover",this._handleAutoScroll)}else{if(this.options.supportPointer){B(document,"pointermove",this._handleFallbackAutoScroll)}else if(n.touches){B(document,"touchmove",this._handleFallbackAutoScroll)}else{B(document,"mousemove",this._handleFallbackAutoScroll)}}},dragOverCompleted:function e(t){var n=t.originalEvent;if(!this.options.dragOverBubble&&!n.rootEl){this._handleAutoScroll(n)}},drop:function e(){if(this.sortable.nativeDraggable){H(document,"dragover",this._handleAutoScroll)}else{H(document,"pointermove",this._handleFallbackAutoScroll);H(document,"touchmove",this._handleFallbackAutoScroll);H(document,"mousemove",this._handleFallbackAutoScroll)}Nt();At();le()},nulling:function e(){Dt=Ct=It=Rt=_t=Lt=jt=null;Tt.length=0},_handleFallbackAutoScroll:function e(t){this._handleAutoScroll(t,true)},_handleAutoScroll:function e(t,n){var i=this;var r=(t.touches?t.touches[0]:t).clientX,o=(t.touches?t.touches[0]:t).clientY,s=document.elementFromPoint(r,o);Dt=t;if(n||this.options.forceAutoScrollFallback||j||L||_){Bt(t,this.options,s,n);var a=ie(s,true);if(Rt&&(!_t||r!==Lt||o!==jt)){_t&&Nt();_t=setInterval((function(){var e=ie(document.elementFromPoint(r,o),true);if(e!==a){a=e;At()}Bt(t,i.options,e,n)}),10);Lt=r;jt=o}}else{if(!this.options.bubbleScroll||ie(s,true)===G()){At();return}Bt(t,this.options,ie(s,false),false)}}};return E(e,{pluginName:"scroll",initializeByDefault:true})}function At(){Tt.forEach((function(e){clearInterval(e.pid)}));Tt=[]}function Nt(){clearInterval(_t)}var Bt=ae((function(e,t,n,i){if(!t.scroll)return;var r=(e.touches?e.touches[0]:e).clientX,o=(e.touches?e.touches[0]:e).clientY,s=t.scrollSensitivity,a=t.scrollSpeed,l=G();var u=false,f;if(Ct!==n){Ct=n;At();It=t.scroll;f=t.scrollFn;if(It===true){It=ie(n,true)}}var c=0;var d=It;do{var h=d,v=J(h),m=v.top,p=v.bottom,g=v.left,b=v.right,w=v.width,x=v.height,y=void 0,E=void 0,S=h.scrollWidth,k=h.scrollHeight,O=F(h),q=h.scrollLeft,M=h.scrollTop;if(h===l){y=w<S&&(O.overflowX==="auto"||O.overflowX==="scroll"||O.overflowX==="visible");E=x<k&&(O.overflowY==="auto"||O.overflowY==="scroll"||O.overflowY==="visible")}else{y=w<S&&(O.overflowX==="auto"||O.overflowX==="scroll");E=x<k&&(O.overflowY==="auto"||O.overflowY==="scroll")}var T=y&&(Math.abs(b-r)<=s&&q+w<S)-(Math.abs(g-r)<=s&&!!q);var I=E&&(Math.abs(p-o)<=s&&M+x<k)-(Math.abs(m-o)<=s&&!!M);if(!Tt[c]){for(var C=0;C<=c;C++){if(!Tt[C]){Tt[C]={}}}}if(Tt[c].vx!=T||Tt[c].vy!=I||Tt[c].el!==h){Tt[c].el=h;Tt[c].vx=T;Tt[c].vy=I;clearInterval(Tt[c].pid);if(T!=0||I!=0){u=true;Tt[c].pid=setInterval(function(){if(i&&this.layer===0){mt.active._onTouchMove(Dt)}var t=Tt[this.layer].vy?Tt[this.layer].vy*a:0;var n=Tt[this.layer].vx?Tt[this.layer].vx*a:0;if(typeof f==="function"){if(f.call(mt.dragged.parentNode[de],n,t,e,Dt,Tt[this.layer].el)!=="continue"){return}}ue(Tt[this.layer].el,n,t)}.bind({layer:c}),24)}}c++}while(t.bubbleScroll&&d!==l&&(d=ie(d,false)));Rt=u}),30);var Ht=function e(t){var n=t.originalEvent,i=t.putSortable,r=t.dragEl,o=t.activeSortable,s=t.dispatchSortableEvent,a=t.hideGhostForTarget,l=t.unhideGhostForTarget;if(!n)return;var u=i||o;a();var f=n.changedTouches&&n.changedTouches.length?n.changedTouches[0]:n;var c=document.elementFromPoint(f.clientX,f.clientY);l();if(u&&!u.el.contains(c)){s("spill");this.onSpill({dragEl:r,putSortable:i})}};function Zt(){}Zt.prototype={startIndex:null,dragStart:function e(t){var n=t.oldDraggableIndex;this.startIndex=n},onSpill:function e(t){var n=t.dragEl,i=t.putSortable;this.sortable.captureAnimationState();if(i){i.captureAnimationState()}var r=K(this.sortable.el,this.startIndex,this.options);if(r){this.sortable.el.insertBefore(n,r)}else{this.sortable.el.appendChild(n)}this.sortable.animateAll();if(i){i.animateAll()}},drop:Ht};E(Zt,{pluginName:"revertOnSpill"});function Pt(){}Pt.prototype={onSpill:function e(t){var n=t.dragEl,i=t.putSortable;var r=i||this.sortable;r.captureAnimationState();n.parentNode&&n.parentNode.removeChild(n);r.animateAll()},drop:Ht};E(Pt,{pluginName:"removeOnSpill"});mt.mount(new zt);mt.mount(Pt,Zt);const Ut=()=>`verdocs-template-roles{display:block;max-width:600px;font-family:var(--verdocs-primary-font, "Inter", "Barlow", sans-serif)}verdocs-template-roles .roles{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:10px;margin-top:10px}verdocs-template-roles .roles .sequence{gap:10px;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;font-weight:500;padding:0 0 8px 0;-ms-flex-direction:row;flex-direction:row;border-bottom:1px dotted #e3e3e3}verdocs-template-roles .roles .sequence.add-sequence{color:#777777;line-height:34px}verdocs-template-roles .roles .sequence-label{font-size:18px;line-height:32px}verdocs-template-roles .roles .sequence-roles{gap:10px;display:-ms-flexbox;display:flex;position:relative;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-direction:row;flex-direction:row}verdocs-template-roles .roles .role{height:32px;cursor:move;display:-ms-flexbox;display:flex;max-width:200px;position:relative;border-radius:32px;background-color:#eff7fb;-webkit-box-sizing:border-box;box-sizing:border-box;padding:0 14px 0 34px;border:1px solid #ccc;-ms-flex-direction:column;flex-direction:column}verdocs-template-roles .roles .role .role-name{font-size:14px;overflow:hidden;font-weight:400;line-height:30px;white-space:nowrap;text-overflow:ellipsis}verdocs-template-roles .roles .role .icons{position:absolute;left:1px;top:-3px;cursor:pointer;padding:5px;z-index:10}verdocs-template-roles .roles .role .icons .gear-button{display:none;-webkit-transform:scale(1.1);transform:scale(1.1);margin:4px 0 0 1px}verdocs-template-roles .roles .role .icons .type-icon{opacity:0.6;display:block;-webkit-transform:scale(0.8);transform:scale(0.8)}verdocs-template-roles .roles .role .icons:hover .gear-button{display:block}verdocs-template-roles .roles .role .icons:hover .type-icon{display:none}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 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{opacity:0.3;padding:0 10px;cursor:pointer;background:none;height:32px;border:1px solid #cccccc;border-radius:32px}verdocs-template-roles .add-role:hover{opacity:1}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 .row.add-sequence{display:-ms-flexbox;display:flex}verdocs-template-roles .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-direction:row;flex-direction:row}verdocs-template-roles .empty{font-size:13px;margin-top:15px;margin-bottom:5px}verdocs-template-roles .empty svg{width:16px;height:16px;stroke:#666666;margin-bottom:2px;display:inline-block}verdocs-template-roles .sequence-roles{display:-ms-flexbox;display:flex;max-width:400px}verdocs-template-roles ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-roles ::-moz-placeholder{color:#aaaaaa}verdocs-template-roles :-ms-input-placeholder{color:#aaaaaa}verdocs-template-roles ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-roles ::placeholder{color:#aaaaaa}`;const Wt='<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>';const $t=`<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>`;const Ft='<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>';const Yt=`<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><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>`;const Vt=`<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><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>`;const Gt=e(class e extends t{constructor(e){super();if(e!==false){this.__registerHost()}this.next=n(this,"next");this.exit=n(this,"exit");this.sdkError=n(this,"sdkError");this.rolesUpdated=n(this,"rolesUpdated");this.templateListenerId=null;this.endpoint=s.getDefault();this.templateId="";this.showingRoleDialog=null;this.sender=null;this.dragging=false;this.loading=true;this.template=null;this.sortableRefs=[]}disconnectedCallback(){this.unlistenToTemplate();this.cleanupSortables()}async listenToTemplate(){console.log("[ROLES] Loading template",this.templateId);this.unlistenToTemplate();d.subscribe("templates",this.templateId,(()=>a(this.endpoint,this.templateId)),false,(e=>{console.log("[ROLES] Template Updated",e);this.template=e;this.loading=false}))}unlistenToTemplate(){if(this.templateListenerId){d.store.delListener(this.templateListenerId);this.templateListenerId=null}}async componentWillLoad(){var e,t,n;try{this.endpoint.loadSession();if(!this.templateId){console.log(`[ROLES] Missing required template ID ${this.templateId}`);return}if(!this.endpoint.session){console.log("[ROLES] Unable to start builder session, must be authenticated");return}this.listenToTemplate()}catch(i){console.log("[ROLES] Error with preview session",i);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new c(i.message,(t=i.response)===null||t===void 0?void 0:t.status,(n=i.response)===null||n===void 0?void 0:n.data))}}cleanupSortables(){this.sortableRefs.forEach((e=>e.destroy()));this.sortableRefs.length=0}componentDidRender(){this.cleanupSortables();const e=this.getSequenceNumbers();(e||[]).forEach((e=>{const t=document.getElementById(`verdocs-roles-sequence-${e}`);if(t){const e=new mt(t,{group:"roles",animation:150,dragoverBubble:true,filter:".no-drag",onEnd:this.handleMoveEnd.bind(this),onChoose:()=>this.dragging=true,onUnchoose:()=>this.dragging=false});this.sortableRefs.push(e)}}));const t=document.getElementById(`verdocs-roles-sequence-add-target`);if(t){console.log("[ROLES] Applying sortable to add-sequence slot");const e=new mt(t,{group:"roles",animation:150,dragoverBubble:true,filter:".no-drag",onEnd:this.handleMoveEnd.bind(this),onChoose:()=>this.dragging=true,onUnchoose:()=>this.dragging=false});this.sortableRefs.push(e)}}handleMoveEnd(e){const t=+e.from.dataset.sequence;const n=+e.to.dataset.sequence;const i=+e.oldIndex+1;const r=+e.newIndex+1;console.log(`Move from ${t}:${i} to ${n}:${r}`,e.item);const o={};const s=this.getSequenceNumbers();s.forEach((e=>{const t=this.getRolesAtSequence(e);o[String(e)]=JSON.parse(JSON.stringify(t))}));o[s[s.length-1]+1]=[];const a=o[t].splice(i-1,1)[0];o[n]||(o[n]=[]);o[n].splice(r-1,0,a);const u=[];Object.entries(o).forEach((([e,t])=>{t.forEach(((t,n)=>{if(!t){return}const i=+n+1;if(t.sequence!==+e||t.order!==i){t.sequence=+e;t.order=i;u.push(l(this.endpoint,this.templateId,t.name,{sequence:+e,order:i}).then((e=>console.log("[ROLES] Updated role",t.name,e))).catch((e=>console.log("[ROLES] Error updating role",e))))}}))}));return Promise.all(u).then((async()=>console.log("[ROLES] Done renumbering"))).catch((e=>console.log("[ROLES] Error updating roles",e)))}handleCancel(){var e;(e=this.exit)===null||e===void 0?void 0:e.emit()}handleSubmit(){var e;(e=this.next)===null||e===void 0?void 0:e.emit()}getSortedRoles(){var e;return(((e=this.template)===null||e===void 0?void 0:e.roles)||[]).sort(((e,t)=>e.sequence===t.sequence?e.order-t.order:e.sequence-t.sequence))}getSequenceNumbers(){const e={};this.getSortedRoles().forEach((t=>{e[t.sequence]=true}));console.log("[ROLES] Sequences",e);return Object.keys(e).map((e=>+e)).sort(((e,t)=>e-t))}getRoleNames(){const e=this.getSortedRoles();return e.map((e=>e.name))}getRolesAtSequence(e){var t;return(((t=this.template)===null||t===void 0?void 0:t.roles)||[]).filter((t=>t&&t.sequence===e))}async renumberTemplateRoles(){var e;const t={};const n=[];const i=this.getSequenceNumbers();(i||[]).forEach((e=>{(t[e]||[]).forEach(((t,i)=>{const r=+i+1;if(t.sequence!==+e||t.order!==r){console.log("[ROLES] Updating role",t.name,"from",t.sequence,t.order,"to",e,r);t.sequence=+e;t.order=r;n.push(l(this.endpoint,this.templateId,t.name,{sequence:+e,order:r}).then((e=>console.log("[ROLES] Updated role",t.name,e))).catch((e=>console.log("[ROLES] Error updating role",e))))}}))}));console.log(`[ROLES] Awaiting ${n.length} renumber requests`);await Promise.all(n).then((async()=>{const e=JSON.parse(JSON.stringify(this.template));e.roles=Object.keys(t).reduce(((e,n)=>e.concat(t[n])),[]);console.log("[ROLES] Done renumbering",e.roles.map((e=>({name:e.name,sequence:e.sequence,order:e.order}))));d.updateTemplate(this.templateId,e)}));(e=this.rolesUpdated)===null||e===void 0?void 0:e.emit({event:"updated",endpoint:this.endpoint,templateId:this.templateId,roles:this.getSortedRoles()})}getNextRoleName(){var e,t;let n="";let i=(((e=this.template)===null||e===void 0?void 0:e.roles)||[]).length;do{i++;n=`Recipient ${i}`}while(!n||(((t=this.template)===null||t===void 0?void 0:t.roles)||[]).some((e=>e&&e.name===n)));return n}callCreateRole(e,t,n){console.log("[ROLES] Will create role",{name:e,sequence:t,order:n});u(this.endpoint,this.templateId,{template_id:this.templateId,name:e,sequence:t,message:"",order:n,full_name:null,first_name:"",last_name:"",email:"",phone:"",type:"signer",delegator:false,name_locked:false}).then((async e=>{var t;console.log("[ROLES] Created role",e);console.log("Updating template in data store");await d.getTemplate(this.endpoint,this.templateId,true);(t=this.rolesUpdated)===null||t===void 0?void 0:t.emit({event:"added",endpoint:this.endpoint,templateId:this.templateId,roles:this.getSortedRoles()})})).catch((e=>{console.log("[ROLES] Error creating role",e)}))}handleAddRole(e,t){e.stopPropagation();const n=this.getRolesAtSequence(t).length+1;const i=this.getNextRoleName();this.callCreateRole(i,t,n)}handleAddStep(e,t){e.stopPropagation();const n=1;const i=this.getNextRoleName();this.callCreateRole(i,t,n)}render(){if(!this.endpoint.session){return i(r,null,i("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if(this.loading||!this.template){return i(r,{class:"loading"},i("verdocs-loader",null))}const e=this.getRoleNames();const t=this.getSequenceNumbers();const n=t&&t.length>0?(t[t.length-1]||0)+1:1;console.log("[ROLES] Rendering",{roleNames:e,sequences:t,nextSequence:n});return i(r,{class:{dragging:this.dragging}},i("form",{onSubmit:e=>e.preventDefault(),onClick:e=>e.stopPropagation(),autocomplete:"off"},i("h5",null,"Roles and Workflow"),i("div",{class:"roles"},t.map(((e,t)=>i("div",{class:"sequence"},i("div",{class:"sequence-label no-drag"},t+1,"."),i("div",{class:"sequence-roles",id:`verdocs-roles-sequence-${e}`,"data-sequence":e},this.getRolesAtSequence(e).map((t=>{const n=!t.email||!t.first_name||!t.last_name;return n?i("div",{class:"role","data-rolename":t.name,"data-sequence":e,"data-order":t.order},i("div",{class:"role-name"},t.name),i("div",{class:"icons"},i("div",{class:"gear-button",innerHTML:Wt,onClick:()=>this.showingRoleDialog=t.name,"aria-role":"button"}),i("span",{class:"type-icon",innerHTML:t.type==="signer"?Ft:t.type==="cc"?Vt:Yt}))):i("div",{class:"role","data-rolename":t.name,"data-sequence":e,"data-order":t.order},i("div",{class:"role-name"},f(t)),i("div",{class:"icons"},i("div",{class:"gear-button",innerHTML:Wt,onClick:()=>this.showingRoleDialog=t.name,"aria-role":"button"}),i("span",{class:"type-icon",innerHTML:t.type==="signer"?Ft:t.type==="cc"?Vt:Yt})))}))),i("button",{class:"add-role no-drag",onClick:t=>this.handleAddRole(t,e)},"+ Add Role")))),i("div",{class:"sequence add-sequence"},i("div",{class:"sequence-label no-drag"},t.length+1,"."),i("div",{class:"sequence-roles",id:`verdocs-roles-sequence-add-target`,"data-sequence":n}),i("button",{class:"add-role no-drag",onClick:e=>this.handleAddRole(e,n)},"+ Add Role"))),e.length<1&&i("div",{class:"empty"},"You must add at least one Role before proceeding.",i("br",null)," Click the ",i("span",{innerHTML:$t})," Add button above to get started."),i("div",{class:"buttons"},i("div",{class:"flex-fill"}),i("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:()=>this.handleCancel()}),i("verdocs-button",{label:"OK",size:"small",onClick:()=>this.handleSubmit(),disabled:e.length<1}))),this.showingRoleDialog&&i("verdocs-menu-panel",{onClose:()=>this.showingRoleDialog=null},i("verdocs-template-role-properties",{endpoint:this.endpoint,templateId:this.templateId,roleName:this.showingRoleDialog,onClose:()=>{var e;(e=document.getElementById("verdocs-menu-panel-overlay"))===null||e===void 0?void 0:e.remove();this.showingRoleDialog=null},onDelete:async()=>{var e;this.showingRoleDialog=null;await this.renumberTemplateRoles();(e=this.rolesUpdated)===null||e===void 0?void 0:e.emit({event:"deleted",endpoint:this.endpoint,templateId:this.templateId,roles:this.getSortedRoles()})}})))}get el(){return this}static get style(){return Ut()}},[0,"verdocs-template-roles",{endpoint:[16],templateId:[1,"template-id"],showingRoleDialog:[32],sender:[32],dragging:[32],loading:[32],template:[32]}]);function Jt(){if(typeof customElements==="undefined"){return}const e=["verdocs-template-roles","verdocs-button","verdocs-component-error","verdocs-help-icon","verdocs-loader","verdocs-menu-panel","verdocs-select-input","verdocs-template-role-properties","verdocs-text-input"];e.forEach((e=>{switch(e){case"verdocs-template-roles":if(!customElements.get(o(e))){customElements.define(o(e),Gt)}break;case"verdocs-button":if(!customElements.get(o(e))){h()}break;case"verdocs-component-error":if(!customElements.get(o(e))){v()}break;case"verdocs-help-icon":if(!customElements.get(o(e))){m()}break;case"verdocs-loader":if(!customElements.get(o(e))){p()}break;case"verdocs-menu-panel":if(!customElements.get(o(e))){g()}break;case"verdocs-select-input":if(!customElements.get(o(e))){b()}break;case"verdocs-template-role-properties":if(!customElements.get(o(e))){w()}break;case"verdocs-text-input":if(!customElements.get(o(e))){x()}break}}))}export{Gt as V,Jt as d};
8
- //# sourceMappingURL=p-CDMCVJys.js.map
8
+ //# sourceMappingURL=p-qDQgyl7L.js.map
@@ -1,2 +1,2 @@
1
- import{p as e,H as t,c as s,h as a,d as o,t as i}from"./p-yZBlG3YQ.js";import{VerdocsEndpoint as l,getTemplate as n,createTemplateDocument as r,deleteTemplateDocument as c}from"@verdocs/js-sdk";import{b as d,P as p,J as m,c as h,F as f,d as v,T as u}from"./p-BDv5kBUR.js";import{S as x}from"./p-C1sRVZWv.js";import{S as g}from"./p-C7hFgM52.js";import{d as b}from"./p-Bdf8pPWm.js";import{d as w}from"./p-CyDWJAOZ.js";import{d as T}from"./p-DT0LGcPi.js";import{d as k}from"./p-CLxwSMOV.js";import{d as y}from"./p-B-_kYJtC.js";import{d as E}from"./p-D3qUITiS.js";import{d as A}from"./p-2bW-AL6b.js";const C=()=>`verdocs-template-attachments{font-family:var(--verdocs-primary-font, "Inter", "Barlow", sans-serif)}verdocs-template-attachments h5{font-size:16px;font-weight:bold;margin:0 0 10px 0;color:#46497d}verdocs-template-attachments .attachments{margin:0 0 40px 0}verdocs-template-attachments .attachment{display:-ms-flexbox;display:flex;padding:5px 0;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;color:#33364b}verdocs-template-attachments .attachment:hover .trash-icon{display:-ms-flexbox;display:flex}verdocs-template-attachments .attachment:hover .pages{display:none}verdocs-template-attachments svg{width:28px;height:28px;fill:#5c6575;margin:2px 0 0 0}verdocs-template-attachments .file-icon{-ms-flex:0;flex:0}verdocs-template-attachments .pages{width:24px;height:24px;-ms-flex:0 0 24px;flex:0 0 24px;padding-left:4px;position:relative;margin:-10px 0 0 0}verdocs-template-attachments .pages .pages-icon{top:0;left:0;width:24px;height:24px;position:absolute}verdocs-template-attachments .pages .count{top:11px;left:7px;z-index:1;width:18px;font-size:12px;font-weight:500;position:absolute;text-align:center;letter-spacing:-2px}verdocs-template-attachments .filename{-ms-flex:1;flex:1;display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;border-bottom:1px dotted #cccccc}verdocs-template-attachments .trash-icon{-ms-flex:0;flex:0;display:none}verdocs-template-attachments .trash-icon:hover{cursor:pointer}verdocs-template-attachments verdocs-file-chooser{margin:10px 0;border:2px dashed #979797}verdocs-template-attachments .loader-wrapper{background-color:#ffffff;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;width:320px;height:320px;text-align:center;border:2px dashed #979797;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-attachments .progress-wrapper{padding:20px}verdocs-template-attachments .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-attachments .buttons .flex-fill{-ms-flex:1;flex:1}verdocs-template-attachments ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-attachments ::-moz-placeholder{color:#aaaaaa}verdocs-template-attachments :-ms-input-placeholder{color:#aaaaaa}verdocs-template-attachments ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-attachments ::placeholder{color:#aaaaaa}`;const j=e(class e extends t{constructor(e){super();if(e!==false){this.__registerHost()}this.exit=s(this,"exit");this.next=s(this,"next");this.templateUpdated=s(this,"templateUpdated");this.sdkError=s(this,"sdkError");this.templateListenerId=null;this.endpoint=l.getDefault();this.templateId="";this.uploading=false;this.progressLabel="Uploading...";this.progressPercent=0;this.showDeleteError=false;this.confirmDeleteDocument=null;this.loading=true;this.template=null}async componentWillLoad(){var e,t,s;try{this.endpoint.loadSession();if(!this.templateId){console.log(`[ROLES] Missing required template ID ${this.templateId}`);return}if(!this.endpoint.session){console.log("[ROLES] Unable to start builder session, must be authenticated");return}this.listenToTemplate()}catch(a){console.log("[TEMPLATE ATTACHMENTS] Error loading template",a);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new x(a.message,(t=a.response)===null||t===void 0?void 0:t.status,(s=a.response)===null||s===void 0?void 0:s.data))}}disconnectedCallback(){this.unlistenToTemplate()}async listenToTemplate(){this.unlistenToTemplate();g.subscribe("templates",this.templateId,(()=>n(this.endpoint,this.templateId)),false,(e=>{this.template=e;this.loading=false}))}unlistenToTemplate(){if(this.templateListenerId){g.store.delListener(this.templateListenerId);this.templateListenerId=null}}handleCancel(e){e.stopPropagation();this.exit.emit()}handleUploadProgress(e){if(e>=99){this.progressPercent=100;this.progressLabel="Processing..."}else{this.progressPercent=e}}async handleUpload(e){var t,s,a,o;e.stopPropagation();const i=e.detail.file;if(!i){return}console.log("[ATTACHMENTS] Uploading...",i);this.uploading=true;this.progressLabel="Uploading...";try{const e=await r(this.endpoint,this.templateId,i,this.handleUploadProgress.bind(this));console.log("[ATTACHMENTS] Created attachment",e);this.template=await g.getTemplate(this.endpoint,this.templateId,true);console.log("[ATTACHMENTS] Updated template",this.template);(t=this.templateUpdated)===null||t===void 0?void 0:t.emit({endpoint:this.endpoint,template:this.template,event:"attachments"});this.uploading=false;this.progressLabel="";this.progressPercent=0}catch(e){console.log("[ATTACHMENTS] Error creating template",e);(s=this.sdkError)===null||s===void 0?void 0:s.emit(new x(e.message,(a=e.response)===null||a===void 0?void 0:a.status,(o=e.response)===null||o===void 0?void 0:o.data));this.uploading=false}}handleNext(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.template})}async confirmDelete(){await c(this.endpoint,this.confirmDeleteDocument.id);this.template=await g.getTemplate(this.endpoint,this.templateId,true);console.log("[ATTACHMENTS] New template",this.template);this.confirmDeleteDocument=null}async handleDelete(e){var t;if((((t=this.template)===null||t===void 0?void 0:t.documents)||[]).length>1){this.confirmDeleteDocument=e}else{this.showDeleteError=true}}getFileIcon(e){switch(e.mime){case"application/pdf":return h;case"image/jpeg":return m;case"image/png":return p;case"application/msword":case"application/vnd.openxmlformats-officedocument.wordprocessingml.document":return d}return f}render(){var e,t;if(!this.endpoint.session){return a(o,null,a("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if(this.loading){return a(o,{class:"loading"},a("verdocs-loader",null))}if(!this.endpoint.session||!this.template){return a(o,{class:"empty"})}return a(o,null,a("h5",null,"Existing Attachments"),a("div",{class:"attachments"},(((e=this.template)===null||e===void 0?void 0:e.documents)||[]).map((e=>a("div",{class:"attachment"},a("div",{class:"file-icon",innerHTML:this.getFileIcon(e)}),a("div",{class:"filename",title:e.name},e.name),a("div",{class:"pages"},a("div",{class:"count"},e.pages),a("div",{class:"pages-icon",innerHTML:v})),a("div",{class:"trash-icon",innerHTML:u,onClick:()=>this.handleDelete(e)}))))),a("h5",null,"Attach a New Document"),this.uploading?a("div",{class:"loader-wrapper"},a("verdocs-loader",null),this.progressLabel&&a("div",{class:"progress-wrapper"},a("verdocs-progress-bar",{showPercent:true,percent:this.progressPercent,label:this.progressLabel}))):a("verdocs-file-chooser",{onFileSelected:e=>this.handleUpload(e)}),a("div",{class:"buttons"},a("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:e=>this.handleCancel(e),disabled:this.uploading}),a("verdocs-button",{label:"Next",size:"small",onClick:e=>this.handleNext(e),disabled:!(((t=this.template)===null||t===void 0?void 0:t.documents)||[]).length||this.uploading})),this.showDeleteError&&a("verdocs-ok-dialog",{heading:"Unable to Delete Attachment",message:"Templates must contain at least one attachment.",onNext:()=>this.showDeleteError=false}),this.confirmDeleteDocument&&a("verdocs-ok-dialog",{heading:"Delete this Attachment?",message:"This operation cannot be undone. All fields placed<br />on the deleted attachment will also be removed.",onNext:()=>this.confirmDelete(),showCancel:true,onExit:()=>{this.confirmDeleteDocument=null}}))}static get style(){return C()}},[0,"verdocs-template-attachments",{endpoint:[16],templateId:[1,"template-id"],uploading:[32],progressLabel:[32],progressPercent:[32],showDeleteError:[32],confirmDeleteDocument:[32],loading:[32],template:[32]}]);function D(){if(typeof customElements==="undefined"){return}const e=["verdocs-template-attachments","verdocs-button","verdocs-component-error","verdocs-dialog","verdocs-file-chooser","verdocs-loader","verdocs-ok-dialog","verdocs-progress-bar"];e.forEach((e=>{switch(e){case"verdocs-template-attachments":if(!customElements.get(i(e))){customElements.define(i(e),j)}break;case"verdocs-button":if(!customElements.get(i(e))){b()}break;case"verdocs-component-error":if(!customElements.get(i(e))){w()}break;case"verdocs-dialog":if(!customElements.get(i(e))){T()}break;case"verdocs-file-chooser":if(!customElements.get(i(e))){k()}break;case"verdocs-loader":if(!customElements.get(i(e))){y()}break;case"verdocs-ok-dialog":if(!customElements.get(i(e))){E()}break;case"verdocs-progress-bar":if(!customElements.get(i(e))){A()}break}}))}export{j as V,D as d};
2
- //# sourceMappingURL=p-CFEw4Xbi.js.map
1
+ import{p as e,H as t,c as s,h as a,d as o,t as i}from"./p-yZBlG3YQ.js";import{VerdocsEndpoint as l,getTemplate as n,createTemplateDocument as r,deleteTemplateDocument as c}from"@verdocs/js-sdk";import{b as d,P as p,J as m,c as h,F as f,d as v,T as u}from"./p-BDv5kBUR.js";import{S as x}from"./p-C1sRVZWv.js";import{S as g}from"./p-C7hFgM52.js";import{d as b}from"./p-Bdf8pPWm.js";import{d as w}from"./p-CyDWJAOZ.js";import{d as T}from"./p-DT0LGcPi.js";import{d as k}from"./p-CLxwSMOV.js";import{d as y}from"./p-B-_kYJtC.js";import{d as E}from"./p-BwUTiBud.js";import{d as A}from"./p-2bW-AL6b.js";const C=()=>`verdocs-template-attachments{font-family:var(--verdocs-primary-font, "Inter", "Barlow", sans-serif)}verdocs-template-attachments h5{font-size:16px;font-weight:bold;margin:0 0 10px 0;color:#46497d}verdocs-template-attachments .attachments{margin:0 0 40px 0}verdocs-template-attachments .attachment{display:-ms-flexbox;display:flex;padding:5px 0;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;color:#33364b}verdocs-template-attachments .attachment:hover .trash-icon{display:-ms-flexbox;display:flex}verdocs-template-attachments .attachment:hover .pages{display:none}verdocs-template-attachments svg{width:28px;height:28px;fill:#5c6575;margin:2px 0 0 0}verdocs-template-attachments .file-icon{-ms-flex:0;flex:0}verdocs-template-attachments .pages{width:24px;height:24px;-ms-flex:0 0 24px;flex:0 0 24px;padding-left:4px;position:relative;margin:-10px 0 0 0}verdocs-template-attachments .pages .pages-icon{top:0;left:0;width:24px;height:24px;position:absolute}verdocs-template-attachments .pages .count{top:11px;left:7px;z-index:1;width:18px;font-size:12px;font-weight:500;position:absolute;text-align:center;letter-spacing:-2px}verdocs-template-attachments .filename{-ms-flex:1;flex:1;display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;border-bottom:1px dotted #cccccc}verdocs-template-attachments .trash-icon{-ms-flex:0;flex:0;display:none}verdocs-template-attachments .trash-icon:hover{cursor:pointer}verdocs-template-attachments verdocs-file-chooser{margin:10px 0;border:2px dashed #979797}verdocs-template-attachments .loader-wrapper{background-color:#ffffff;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;width:320px;height:320px;text-align:center;border:2px dashed #979797;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-attachments .progress-wrapper{padding:20px}verdocs-template-attachments .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-attachments .buttons .flex-fill{-ms-flex:1;flex:1}verdocs-template-attachments ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-attachments ::-moz-placeholder{color:#aaaaaa}verdocs-template-attachments :-ms-input-placeholder{color:#aaaaaa}verdocs-template-attachments ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-attachments ::placeholder{color:#aaaaaa}`;const j=e(class e extends t{constructor(e){super();if(e!==false){this.__registerHost()}this.exit=s(this,"exit");this.next=s(this,"next");this.templateUpdated=s(this,"templateUpdated");this.sdkError=s(this,"sdkError");this.templateListenerId=null;this.endpoint=l.getDefault();this.templateId="";this.uploading=false;this.progressLabel="Uploading...";this.progressPercent=0;this.showDeleteError=false;this.confirmDeleteDocument=null;this.loading=true;this.template=null}async componentWillLoad(){var e,t,s;try{this.endpoint.loadSession();if(!this.templateId){console.log(`[ROLES] Missing required template ID ${this.templateId}`);return}if(!this.endpoint.session){console.log("[ROLES] Unable to start builder session, must be authenticated");return}this.listenToTemplate()}catch(a){console.log("[TEMPLATE ATTACHMENTS] Error loading template",a);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new x(a.message,(t=a.response)===null||t===void 0?void 0:t.status,(s=a.response)===null||s===void 0?void 0:s.data))}}disconnectedCallback(){this.unlistenToTemplate()}async listenToTemplate(){this.unlistenToTemplate();g.subscribe("templates",this.templateId,(()=>n(this.endpoint,this.templateId)),false,(e=>{this.template=e;this.loading=false}))}unlistenToTemplate(){if(this.templateListenerId){g.store.delListener(this.templateListenerId);this.templateListenerId=null}}handleCancel(e){e.stopPropagation();this.exit.emit()}handleUploadProgress(e){if(e>=99){this.progressPercent=100;this.progressLabel="Processing..."}else{this.progressPercent=e}}async handleUpload(e){var t,s,a,o;e.stopPropagation();const i=e.detail.file;if(!i){return}console.log("[ATTACHMENTS] Uploading...",i);this.uploading=true;this.progressLabel="Uploading...";try{const e=await r(this.endpoint,this.templateId,i,this.handleUploadProgress.bind(this));console.log("[ATTACHMENTS] Created attachment",e);this.template=await g.getTemplate(this.endpoint,this.templateId,true);console.log("[ATTACHMENTS] Updated template",this.template);(t=this.templateUpdated)===null||t===void 0?void 0:t.emit({endpoint:this.endpoint,template:this.template,event:"attachments"});this.uploading=false;this.progressLabel="";this.progressPercent=0}catch(e){console.log("[ATTACHMENTS] Error creating template",e);(s=this.sdkError)===null||s===void 0?void 0:s.emit(new x(e.message,(a=e.response)===null||a===void 0?void 0:a.status,(o=e.response)===null||o===void 0?void 0:o.data));this.uploading=false}}handleNext(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.template})}async confirmDelete(){await c(this.endpoint,this.confirmDeleteDocument.id);this.template=await g.getTemplate(this.endpoint,this.templateId,true);console.log("[ATTACHMENTS] New template",this.template);this.confirmDeleteDocument=null}async handleDelete(e){var t;if((((t=this.template)===null||t===void 0?void 0:t.documents)||[]).length>1){this.confirmDeleteDocument=e}else{this.showDeleteError=true}}getFileIcon(e){switch(e.mime){case"application/pdf":return h;case"image/jpeg":return m;case"image/png":return p;case"application/msword":case"application/vnd.openxmlformats-officedocument.wordprocessingml.document":return d}return f}render(){var e,t;if(!this.endpoint.session){return a(o,null,a("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if(this.loading){return a(o,{class:"loading"},a("verdocs-loader",null))}if(!this.endpoint.session||!this.template){return a(o,{class:"empty"})}return a(o,null,a("h5",null,"Existing Attachments"),a("div",{class:"attachments"},(((e=this.template)===null||e===void 0?void 0:e.documents)||[]).map((e=>a("div",{class:"attachment"},a("div",{class:"file-icon",innerHTML:this.getFileIcon(e)}),a("div",{class:"filename",title:e.name},e.name),a("div",{class:"pages"},a("div",{class:"count"},e.pages),a("div",{class:"pages-icon",innerHTML:v})),a("div",{class:"trash-icon",innerHTML:u,onClick:()=>this.handleDelete(e)}))))),a("h5",null,"Attach a New Document"),this.uploading?a("div",{class:"loader-wrapper"},a("verdocs-loader",null),this.progressLabel&&a("div",{class:"progress-wrapper"},a("verdocs-progress-bar",{showPercent:true,percent:this.progressPercent,label:this.progressLabel}))):a("verdocs-file-chooser",{onFileSelected:e=>this.handleUpload(e)}),a("div",{class:"buttons"},a("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:e=>this.handleCancel(e),disabled:this.uploading}),a("verdocs-button",{label:"Next",size:"small",onClick:e=>this.handleNext(e),disabled:!(((t=this.template)===null||t===void 0?void 0:t.documents)||[]).length||this.uploading})),this.showDeleteError&&a("verdocs-ok-dialog",{heading:"Unable to Delete Attachment",message:"Templates must contain at least one attachment.",onNext:()=>this.showDeleteError=false}),this.confirmDeleteDocument&&a("verdocs-ok-dialog",{heading:"Delete this Attachment?",message:"This operation cannot be undone. All fields placed<br />on the deleted attachment will also be removed.",onNext:()=>this.confirmDelete(),showCancel:true,onExit:()=>{this.confirmDeleteDocument=null}}))}static get style(){return C()}},[0,"verdocs-template-attachments",{endpoint:[16],templateId:[1,"template-id"],uploading:[32],progressLabel:[32],progressPercent:[32],showDeleteError:[32],confirmDeleteDocument:[32],loading:[32],template:[32]}]);function M(){if(typeof customElements==="undefined"){return}const e=["verdocs-template-attachments","verdocs-button","verdocs-component-error","verdocs-dialog","verdocs-file-chooser","verdocs-loader","verdocs-ok-dialog","verdocs-progress-bar"];e.forEach((e=>{switch(e){case"verdocs-template-attachments":if(!customElements.get(i(e))){customElements.define(i(e),j)}break;case"verdocs-button":if(!customElements.get(i(e))){b()}break;case"verdocs-component-error":if(!customElements.get(i(e))){w()}break;case"verdocs-dialog":if(!customElements.get(i(e))){T()}break;case"verdocs-file-chooser":if(!customElements.get(i(e))){k()}break;case"verdocs-loader":if(!customElements.get(i(e))){y()}break;case"verdocs-ok-dialog":if(!customElements.get(i(e))){E()}break;case"verdocs-progress-bar":if(!customElements.get(i(e))){A()}break}}))}export{j as V,M as d};
2
+ //# sourceMappingURL=p-sPseFic3.js.map
@@ -1,2 +1,2 @@
1
- import{p as e,H as t,c as s,h as i,t as o}from"./p-yZBlG3YQ.js";import{VerdocsEndpoint as a,convertToE164 as r,createProfile as n,verifyEmail as l,authenticate as d,getMyUser as c,resendVerification as h,resetPassword as u}from"@verdocs/js-sdk";import{V as p}from"./p-D97GxsI-.js";import{S as f}from"./p-C1sRVZWv.js";import{d as m}from"./p-Bdf8pPWm.js";import{d as v}from"./p-CioaaWeS.js";import{d as b}from"./p-DYtSnUj9.js";const y=()=>`verdocs-auth{font-family:var(--verdocs-primary-font, "Inter", "Barlow", sans-serif);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center}verdocs-auth .form{width:350px;display:-ms-flexbox;display:flex;padding:20px;max-width:90%;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-pack:center;justify-content:center;background:#ffffff}verdocs-auth .logo{width:128px;max-width:100%;margin:20px 0 30px}verdocs-auth h3{color:#092c4c;text-align:center;font-weight:400;font-size:18px;line-height:1.75;margin:0}verdocs-auth em{font-size:14px;margin:15px 0}verdocs-auth .buttons{gap:20px;margin:20px 0 0 0;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:center;justify-content:center}verdocs-auth .status-result{display:none}verdocs-auth .status-result.debug{white-space:pre-wrap;font-size:14px;background:#fff;padding:10px;display:block;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:center;justify-content:center}verdocs-auth form{width:100%}verdocs-auth verdocs-text-input{margin-bottom:10px}verdocs-auth .account-option{gap:8px;margin:20px 0 8px 0;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}verdocs-auth p{color:#092c4c;margin:1em 0;font-size:14px}verdocs-auth p+p{margin-top:0}verdocs-auth verdocs-help-icon{margin-top:18px;display:-ms-flexbox;display:flex;width:32px;height:32px;-ms-flex:0 0 32px;flex:0 0 32px}verdocs-auth .already-have{color:#092c4c;margin:0.5em 0;font-size:14px;text-align:center}verdocs-auth .service-agreement{font-size:12px;color:#777}verdocs-auth .service-agreement a{color:#092c4c}`;const g=e(class e extends t{constructor(e){super();if(e!==false){this.__registerHost()}this.authenticated=s(this,"authenticated");this.sdkError=s(this,"sdkError");this.endpoint=a.getDefault();this.visible=true;this.logo="https://app.verdocs.com/assets/blue-logo.svg";this.displayMode="login";this.org_name="";this.first_name="";this.last_name="";this.email="";this.phone="";this.verificationCode="";this.newPassword="";this.password="";this.confirmpass="";this.submitting=false;this.resendDisabled=false;this.session=null;this.profile=null;this.resendDisabledTimer=null;this.tempAuthEndpoint=new a({baseURL:a.getDefault().getBaseURL(),persist:false});this.handleHashChange=()=>{this.applyHashDisplayMode()}}componentWillLoad(){this.endpoint.loadSession();this.applyHashDisplayMode();if(typeof window!=="undefined"){window.addEventListener("hashchange",this.handleHashChange)}a.getDefault().onSessionChanged(((e,t,s)=>{var i,o;this.session=t;this.profile=s;if(t){(i=this.authenticated)===null||i===void 0?void 0:i.emit({authenticated:true,session:t,profile:s})}else{(o=this.authenticated)===null||o===void 0?void 0:o.emit({authenticated:false,session:t,profile:s})}}))}disconnectedCallback(){if(typeof window!=="undefined"){window.removeEventListener("hashchange",this.handleHashChange)}}applyHashDisplayMode(){if(typeof window==="undefined"){return}const e=(window.location.hash||"").replace(/^#/,"").toLowerCase();if(e==="forgot"){this.displayMode="forgot"}}isPasswordComplex(e){const t=e=>/[A-Z]/.test(e);const s=e=>/[a-z]/.test(e);const i=e=>/[`!@#$%^&*()_\-+=\[\]{};':"\\|,.<>\/?~ ]/.test(e);let o=0,a=0,r=0;for(let n=0;n<e.length;n++){let l=e.charAt(n);if(t(l))o++;else if(s(l))a++;else if(i(l))r++}return e.length>=8&&a>0&&o>0&&r>0}handleSignup(){if(!this.isPasswordComplex(this.password)){p("Password must be at least 8 characters long and contain at least one uppercase, one lowercase, and one special character.",{style:"error"});return}if(this.password!==this.confirmpass){p("Passwords do not match.",{style:"error"});return}this.submitting=true;this.tempAuthEndpoint.clearSession();const e=r(this.phone);n(this.tempAuthEndpoint,{email:this.email,password:this.password,first_name:this.first_name,last_name:this.last_name,org_name:this.org_name,phone:e}).then((e=>{console.log("[AUTH] Profile creation result",e);this.tempAuthEndpoint.setToken(e.access_token);this.password="";this.phone="";this.first_name="";this.last_name="";this.org_name="";this.displayMode="verify";this.submitting=false})).catch((e=>{var t,s,i,o,a,r;console.log("[AUTH] Signup error",e.response);this.submitting=false;(t=this.authenticated)===null||t===void 0?void 0:t.emit({authenticated:false,profile:null,session:null});(s=this.sdkError)===null||s===void 0?void 0:s.emit(new f(e.message,(i=e.response)===null||i===void 0?void 0:i.status,(o=e.response)===null||o===void 0?void 0:o.data));p("Signup failed: "+((r=(a=e.response)===null||a===void 0?void 0:a.data)===null||r===void 0?void 0:r.error)||"Unknown Error",{style:"error"})}))}async handleVerification(){this.submitting=true;try{this.submitting=false;const e=await l(this.tempAuthEndpoint,{email:this.email,token:this.verificationCode});p("Thank you for verifying your email address.",{style:"success"});this.completeLogin(e)}catch(e){this.submitting=false;console.log("Verification error",e);p("Verification error, please check the code and try again.")}}completeLogin(e){this.clearForms();this.tempAuthEndpoint.clearSession();this.endpoint.setToken(e.access_token)}async loginAndCheckVerification(){var e;if(this.submitting){return}this.submitting=true;this.tempAuthEndpoint.clearSession();try{this.submitting=false;const e=await d(this.tempAuthEndpoint,{username:this.email.trim(),password:this.password,grant_type:"password"});console.log("[AUTH] Authenticated, checking email verification");this.tempAuthEndpoint.setToken(e.access_token);const t=await c(this.tempAuthEndpoint);if(!t.email_verified){console.log("[AUTH] Logged in, pending email address verification");this.displayMode="verify"}else{console.log("[AUTH] Email address is verified, completing login");this.completeLogin(e)}}catch(t){this.submitting=false;console.log("[AUTH] Auth failure",((e=t.response)===null||e===void 0?void 0:e.data)||t);p("Login failed. Please check your credentials and try again.",{style:"error"})}}clearForms(){this.submitting=false;this.resendDisabled=false;this.email="";this.phone="";this.password="";this.newPassword="";this.confirmpass="";this.verificationCode="";this.first_name="";this.last_name="";this.org_name=""}handleLogout(){console.log("logging out");this.endpoint.clearSession();this.tempAuthEndpoint.clearSession();this.clearForms();this.displayMode="login"}handleResendVerification(){this.resendDisabled=true;this.resendDisabledTimer=setTimeout((()=>{this.resendDisabled=false;this.resendDisabledTimer=null}),3e4);h(this.tempAuthEndpoint).then((e=>{console.log("[AUTH] Verification request resent",e);p("Please check your email for a verification code.",{style:"info"})})).catch((e=>{console.log("[AUTH] Unable to resend verification",e);p("Unable to resend code. Please try again later.",{style:"error"})}))}handleResendReset(){this.resendDisabled=true;this.resendDisabledTimer=setTimeout((()=>{this.resendDisabled=false;this.resendDisabledTimer=null}),3e4);u(this.tempAuthEndpoint,{email:this.email}).then((e=>{console.log("[AUTH] Resend-code request resent",e);p("Please check your email again for a verification code.",{style:"info"})})).catch((e=>{console.log("[AUTH] Unable to resend reset request",e);p("Unable to resend code. Please try again later.",{style:"error"})}))}async handleResetGetCode(){this.submitting=true;this.confirmpass="";this.newPassword="";try{this.submitting=false;const e=await u(this.endpoint,{email:this.email});console.log("[AUTH] Reset result",e);p("Please check your email inbox for a password reset code.",{style:"success"});this.verificationCode="";this.confirmpass="";this.newPassword="";this.displayMode="reset"}catch(e){this.submitting=false;console.log("Reset request error",e);p("Request failed. Please check your email address and try again.")}}async handleResetPassword(){if(!this.isPasswordComplex(this.newPassword)){p("Password must be at least 8 characters long and contain at least one uppercase, one lowercase, and one special character.",{style:"error"});return}if(this.newPassword!==this.confirmpass){p("Passwords do not match.",{style:"error"});return}this.submitting=true;try{this.submitting=false;const e=await u(this.endpoint,{email:this.email,code:this.verificationCode,new_password:this.newPassword});console.log("reset result",e);p("Your password has been reset. You may now use your new password to login.",{style:"success"});this.verificationCode="";this.confirmpass="";this.newPassword="";this.password="";this.displayMode="login"}catch(e){this.submitting=false;console.log("Verification error",e);p("Verification error, please check the code and try again.")}}async handleReset(){this.submitting=true;try{const e=await u(this.endpoint,{email:this.email});console.log("[AUTH] Reset sent",e);this.submitting=false;this.displayMode="login";p("If your email address is registered, you will receive instructions on resetting your password shortly.",{style:"info"})}catch(e){console.log("[AUTH] Unable to reset password",e);this.submitting=false;p("Unable to reset password. Please check your email address and try again.",{style:"error"})}}render(){if(!this.visible){return i("div",{style:{display:"none"}},"Authenticated")}if(this.session){return i("verdocs-button",{label:"Sign Out",disabled:this.submitting,onClick:()=>this.handleLogout(),style:{display:"flex",justifyContent:"center",margin:"30px auto 0"}})}if(this.displayMode==="signup"){const e=this.submitting||!this.first_name||!this.last_name||!this.email||!this.password||!this.confirmpass||!this.org_name;return i("div",{class:"form"},i("a",{href:"https://verdocs.com/en/"},i("img",{src:this.logo,alt:"Verdocs Logo",class:"logo"})),i("h3",null,"Sign up for a free account"),i("div",{class:"already-have"},"Already have an account?",i("verdocs-button",{label:"Log In",variant:"text",onClick:()=>this.displayMode="login",disabled:this.submitting})),i("form",{onSubmit:()=>this.handleSignup()},i("div",{style:{display:"flex",flexDirection:"row",columnGap:"20px"}},i("verdocs-text-input",{label:"First Name",autocomplete:"first",required:true,value:this.first_name,onInput:e=>this.first_name=e.target.value,disabled:this.submitting}),i("verdocs-text-input",{label:"Last Name",autocomplete:"last",required:true,value:this.last_name,onInput:e=>this.last_name=e.target.value,disabled:this.submitting})),i("verdocs-text-input",{label:"Email Address",autocomplete:"email",required:true,value:this.email,onInput:e=>this.email=e.target.value,disabled:this.submitting}),i("verdocs-text-input",{label:"Password",type:"password",required:true,autocomplete:"new-password",value:this.password,onInput:e=>this.password=e.target.value,disabled:this.submitting}),i("verdocs-text-input",{label:"Confirm Password",type:"password",required:true,autocomplete:"off",value:this.confirmpass,onInput:e=>this.confirmpass=e.target.value,disabled:this.submitting}),i("verdocs-text-input",{label:"Phone Number",type:"tel",required:true,autocomplete:"phone",value:this.phone,onInput:e=>this.phone=e.target.value,disabled:this.submitting}),i("verdocs-text-input",{label:"Organization Name",autocomplete:"org",required:true,value:this.org_name,onInput:e=>this.org_name=e.target.value,disabled:this.submitting,style:{flex:"1"}}),i("div",{class:"service-agreement"},"By clicking the Create Account button, you agree to the"," ",i("a",{href:"https://verdocs.com/eula",target:"_blank"},"End User License Agreement"),". Learn about how we use and protect your data and how you can opt-out in our"," ",i("a",{href:"https://verdocs.com/privacy-policy",target:"_blank"},"Privacy Policy"),"."),i("div",{style:{marginTop:"30px"}}),i("verdocs-button",{label:"Next",disabled:e,onClick:e?()=>{}:()=>this.handleSignup(),style:{display:"flex",justifyContent:"center",margin:"30px auto 0"}})))}if(this.displayMode==="verify"){return i("div",{class:"form"},i("form",{onSubmit:()=>this.handleVerification()},i("p",null,"Please check your e-mail inbox for a verification code and enter it below."),i("verdocs-text-input",{label:"Verification Code",required:true,value:this.verificationCode,onInput:e=>this.verificationCode=e.target.value,disabled:this.submitting}),i("div",{class:"buttons"},i("verdocs-button",{label:"Sign Out",variant:"outline",disabled:this.submitting,onClick:()=>this.handleLogout()}),i("verdocs-button",{label:"Verify",disabled:this.submitting||!this.verificationCode||this.verificationCode.length!==6,onClick:()=>this.handleVerification()})),i("div",{class:"buttons"},i("verdocs-button",{variant:"text",label:"Resend Code",disabled:this.resendDisabled||this.submitting,onClick:()=>this.handleResendVerification()}))))}if(this.displayMode==="forgot"){return i("div",{class:"form"},i("a",{href:"https://verdocs.com/en/"},i("img",{src:this.logo,alt:"Verdocs Logo",class:"logo"})),i("h3",null,"Forgot your password?"),i("p",null,"Enter your e-mail address below. If the e-mail address is valid, a password reset code will be sent to your inbox. Please allow up to 15 minutes to arrive, and check your spam folder if you do not receive the message."),i("form",{onSubmit:()=>this.handleResetGetCode()},i("verdocs-text-input",{label:"Email Address",autocomplete:"email",required:true,value:this.email,onInput:e=>this.email=e.target.value,disabled:this.submitting}),i("div",{style:{marginTop:"30px"}}),i("div",{class:"buttons"},i("verdocs-button",{size:"small",label:"Cancel",variant:"outline",disabled:this.submitting,onClick:()=>this.displayMode="login"}),i("verdocs-button",{size:"small",label:"Request Code",disabled:this.submitting,onClick:()=>this.handleResetGetCode()}))))}if(this.displayMode==="reset"){return i("div",{class:"form"},i("a",{href:"https://verdocs.com/en/"},i("img",{src:this.logo,alt:"Verdocs Logo",class:"logo"})),i("h3",null,"Forgot your password?"),i("p",null,"Enter your e-mail address below, and reset instructions will be sent to your Inbox. Please allow up to 15 minutes to arrive. Check your spam folder if you do not receive the message."),i("form",{onSubmit:()=>this.handleResetPassword()},i("verdocs-text-input",{label:"Verification Code",required:true,value:this.verificationCode,onInput:e=>this.verificationCode=e.target.value,disabled:this.submitting}),i("verdocs-text-input",{label:"Password",type:"password",required:true,autocomplete:"off",value:this.newPassword,onInput:e=>this.newPassword=e.target.value,disabled:this.submitting}),i("verdocs-text-input",{label:"Confirm Password",type:"password",required:true,autocomplete:"off",value:this.confirmpass,onInput:e=>this.confirmpass=e.target.value,disabled:this.submitting}),i("div",{style:{marginTop:"30px"}}),i("div",{class:"buttons"},i("verdocs-button",{label:"Cancel",variant:"outline",disabled:this.submitting,onClick:()=>this.displayMode="login"}),i("verdocs-button",{label:"Reset",disabled:this.submitting,onClick:()=>this.handleResetPassword()})),i("div",{class:"buttons"},i("verdocs-button",{variant:"text",label:"Resend Code",disabled:this.resendDisabled||this.submitting,onClick:()=>this.handleResendReset()}))))}return i("div",{class:"form"},i("a",{href:"https://verdocs.com/en/"},i("img",{src:this.logo,alt:"Verdocs Logo",class:"logo"})),i("h3",null,"Log in to your account"),i("div",{class:"already-have"},"Don't have an account?",i("verdocs-button",{label:"Sign Up",variant:"text",onClick:()=>this.displayMode="signup",disabled:this.submitting})),i("form",{onSubmit:()=>this.loginAndCheckVerification()},i("verdocs-text-input",{label:"Email",autocomplete:"username",value:this.email,onInput:e=>this.email=e.target.value,disabled:this.submitting}),i("verdocs-text-input",{label:"Password",type:"password",autocomplete:"current-password",value:this.password,onInput:e=>this.password=e.target.value,disabled:this.submitting}),i("verdocs-button",{label:"Forgot Your Password?",variant:"text",onClick:()=>this.displayMode="forgot",disabled:this.submitting,style:{display:"flex",justifyContent:"center",margin:"10px auto 20px"}}),i("verdocs-button",{label:"Login",disabled:this.submitting,onClick:()=>this.loginAndCheckVerification(),style:{display:"flex",justifyContent:"center",margin:"10px auto 0"}})))}static get style(){return y()}},[0,"verdocs-auth",{endpoint:[16],visible:[4],logo:[1],displayMode:[1025,"display-mode"],org_name:[32],first_name:[32],last_name:[32],email:[32],phone:[32],verificationCode:[32],newPassword:[32],password:[32],confirmpass:[32],submitting:[32],resendDisabled:[32],session:[32],profile:[32]}]);function x(){if(typeof customElements==="undefined"){return}const e=["verdocs-auth","verdocs-button","verdocs-help-icon","verdocs-text-input"];e.forEach((e=>{switch(e){case"verdocs-auth":if(!customElements.get(o(e))){customElements.define(o(e),g)}break;case"verdocs-button":if(!customElements.get(o(e))){m()}break;case"verdocs-help-icon":if(!customElements.get(o(e))){v()}break;case"verdocs-text-input":if(!customElements.get(o(e))){b()}break}}))}const w=g;const k=x;export{w as VerdocsAuth,k as defineCustomElement};
1
+ import{p as e,H as t,c as s,h as i,t as o}from"./p-yZBlG3YQ.js";import{VerdocsEndpoint as a,convertToE164 as r,createProfile as n,verifyEmail as l,authenticate as d,getMyUser as c,resendVerification as h,resetPassword as u}from"@verdocs/js-sdk";import{V as p}from"./p-D97GxsI-.js";import{S as f}from"./p-C1sRVZWv.js";import{d as m}from"./p-Bdf8pPWm.js";import{d as v}from"./p-CioaaWeS.js";import{d as b}from"./p-DYtSnUj9.js";const y=()=>`verdocs-auth{font-family:var(--verdocs-primary-font, "Inter", "Barlow", sans-serif);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center}verdocs-auth .form{width:350px;display:-ms-flexbox;display:flex;padding:20px;max-width:90%;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-pack:center;justify-content:center;background:#ffffff}verdocs-auth .logo{width:128px;max-width:100%;margin:20px 0 30px}verdocs-auth h3{color:#092c4c;text-align:center;font-weight:400;font-size:18px;line-height:1.75;margin:0}verdocs-auth em{font-size:14px;margin:15px 0}verdocs-auth .buttons{gap:20px;margin:20px 0 0 0;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:center;justify-content:center}verdocs-auth .status-result{display:none}verdocs-auth .status-result.debug{white-space:pre-wrap;font-size:14px;background:#fff;padding:10px;display:block;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:center;justify-content:center}verdocs-auth form{width:100%}verdocs-auth verdocs-text-input{margin-bottom:10px}verdocs-auth .account-option{gap:8px;margin:20px 0 8px 0;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}verdocs-auth p{color:#092c4c;margin:1em 0;font-size:14px}verdocs-auth p+p{margin-top:0}verdocs-auth verdocs-help-icon{margin-top:18px;display:-ms-flexbox;display:flex;width:32px;height:32px;-ms-flex:0 0 32px;flex:0 0 32px}verdocs-auth .already-have{color:#092c4c;margin:0.5em 0;font-size:14px;text-align:center}verdocs-auth .service-agreement{font-size:12px;color:#777}verdocs-auth .service-agreement a{color:#092c4c}`;const g=e(class e extends t{constructor(e){super();if(e!==false){this.__registerHost()}this.authenticated=s(this,"authenticated");this.sdkError=s(this,"sdkError");this.endpoint=a.getDefault();this.visible=true;this.logo="https://app.verdocs.com/assets/blue-logo.svg";this.displayMode="login";this.org_name="";this.first_name="";this.last_name="";this.email="";this.phone="";this.verificationCode="";this.newPassword="";this.password="";this.confirmpass="";this.submitting=false;this.resendDisabled=false;this.session=null;this.profile=null;this.resendDisabledTimer=null;this.tempAuthEndpoint=new a({baseURL:a.getDefault().getBaseURL(),persist:false});this.handleHashChange=()=>{this.applyHashDisplayMode()}}componentWillLoad(){this.endpoint.loadSession();this.applyHashDisplayMode();if(typeof window!=="undefined"){window.addEventListener("hashchange",this.handleHashChange)}a.getDefault().onSessionChanged(((e,t,s)=>{var i,o;this.session=t;this.profile=s;if(t){(i=this.authenticated)===null||i===void 0?void 0:i.emit({authenticated:true,session:t,profile:s})}else{(o=this.authenticated)===null||o===void 0?void 0:o.emit({authenticated:false,session:t,profile:s})}}))}disconnectedCallback(){if(typeof window!=="undefined"){window.removeEventListener("hashchange",this.handleHashChange)}}applyHashDisplayMode(){if(typeof window==="undefined"){return}const e=(window.location.hash||"").replace(/^#/,"").toLowerCase();if(e==="forgot"){this.displayMode="forgot"}}isPasswordComplex(e){const t=e=>/[A-Z]/.test(e);const s=e=>/[a-z]/.test(e);const i=e=>/[`!@#$%^&*()_\-+=\[\]{};':"\\|,.<>\/?~ ]/.test(e);let o=0,a=0,r=0;for(let n=0;n<e.length;n++){let l=e.charAt(n);if(t(l))o++;else if(s(l))a++;else if(i(l))r++}return e.length>=8&&a>0&&o>0&&r>0}handleSignup(){if(!this.isPasswordComplex(this.password)){p("Password must be at least 8 characters long and contain at least one uppercase, one lowercase, and one special character.",{style:"error"});return}if(this.password!==this.confirmpass){p("Passwords do not match.",{style:"error"});return}this.submitting=true;this.tempAuthEndpoint.clearSession();const e=r(this.phone);const t=Intl.DateTimeFormat().resolvedOptions();n(this.tempAuthEndpoint,{email:this.email,password:this.password,first_name:this.first_name,last_name:this.last_name,org_name:this.org_name,phone:e,timezone:t.timeZone,locale:t.locale}).then((e=>{console.log("[AUTH] Profile creation result",e);this.tempAuthEndpoint.setToken(e.access_token);this.password="";this.phone="";this.first_name="";this.last_name="";this.org_name="";this.displayMode="verify";this.submitting=false})).catch((e=>{var t,s,i,o,a,r;console.log("[AUTH] Signup error",e.response);this.submitting=false;(t=this.authenticated)===null||t===void 0?void 0:t.emit({authenticated:false,profile:null,session:null});(s=this.sdkError)===null||s===void 0?void 0:s.emit(new f(e.message,(i=e.response)===null||i===void 0?void 0:i.status,(o=e.response)===null||o===void 0?void 0:o.data));p("Signup failed: "+((r=(a=e.response)===null||a===void 0?void 0:a.data)===null||r===void 0?void 0:r.error)||"Unknown Error",{style:"error"})}))}async handleVerification(){this.submitting=true;try{this.submitting=false;const e=await l(this.tempAuthEndpoint,{email:this.email,token:this.verificationCode});p("Thank you for verifying your email address.",{style:"success"});this.completeLogin(e)}catch(e){this.submitting=false;console.log("Verification error",e);p("Verification error, please check the code and try again.")}}completeLogin(e){this.clearForms();this.tempAuthEndpoint.clearSession();this.endpoint.setToken(e.access_token)}async loginAndCheckVerification(){var e;if(this.submitting){return}this.submitting=true;this.tempAuthEndpoint.clearSession();try{this.submitting=false;const e=await d(this.tempAuthEndpoint,{username:this.email.trim(),password:this.password,grant_type:"password"});console.log("[AUTH] Authenticated, checking email verification");this.tempAuthEndpoint.setToken(e.access_token);const t=await c(this.tempAuthEndpoint);if(!t.email_verified){console.log("[AUTH] Logged in, pending email address verification");this.displayMode="verify"}else{console.log("[AUTH] Email address is verified, completing login");this.completeLogin(e)}}catch(t){this.submitting=false;console.log("[AUTH] Auth failure",((e=t.response)===null||e===void 0?void 0:e.data)||t);p("Login failed. Please check your credentials and try again.",{style:"error"})}}clearForms(){this.submitting=false;this.resendDisabled=false;this.email="";this.phone="";this.password="";this.newPassword="";this.confirmpass="";this.verificationCode="";this.first_name="";this.last_name="";this.org_name=""}handleLogout(){console.log("logging out");this.endpoint.clearSession();this.tempAuthEndpoint.clearSession();this.clearForms();this.displayMode="login"}handleResendVerification(){this.resendDisabled=true;this.resendDisabledTimer=setTimeout((()=>{this.resendDisabled=false;this.resendDisabledTimer=null}),3e4);h(this.tempAuthEndpoint).then((e=>{console.log("[AUTH] Verification request resent",e);p("Please check your email for a verification code.",{style:"info"})})).catch((e=>{console.log("[AUTH] Unable to resend verification",e);p("Unable to resend code. Please try again later.",{style:"error"})}))}handleResendReset(){this.resendDisabled=true;this.resendDisabledTimer=setTimeout((()=>{this.resendDisabled=false;this.resendDisabledTimer=null}),3e4);u(this.tempAuthEndpoint,{email:this.email}).then((e=>{console.log("[AUTH] Resend-code request resent",e);p("Please check your email again for a verification code.",{style:"info"})})).catch((e=>{console.log("[AUTH] Unable to resend reset request",e);p("Unable to resend code. Please try again later.",{style:"error"})}))}async handleResetGetCode(){this.submitting=true;this.confirmpass="";this.newPassword="";try{this.submitting=false;const e=await u(this.endpoint,{email:this.email});console.log("[AUTH] Reset result",e);p("Please check your email inbox for a password reset code.",{style:"success"});this.verificationCode="";this.confirmpass="";this.newPassword="";this.displayMode="reset"}catch(e){this.submitting=false;console.log("Reset request error",e);p("Request failed. Please check your email address and try again.")}}async handleResetPassword(){if(!this.isPasswordComplex(this.newPassword)){p("Password must be at least 8 characters long and contain at least one uppercase, one lowercase, and one special character.",{style:"error"});return}if(this.newPassword!==this.confirmpass){p("Passwords do not match.",{style:"error"});return}this.submitting=true;try{this.submitting=false;const e=await u(this.endpoint,{email:this.email,code:this.verificationCode,new_password:this.newPassword});console.log("reset result",e);p("Your password has been reset. You may now use your new password to login.",{style:"success"});this.verificationCode="";this.confirmpass="";this.newPassword="";this.password="";this.displayMode="login"}catch(e){this.submitting=false;console.log("Verification error",e);p("Verification error, please check the code and try again.")}}async handleReset(){this.submitting=true;try{const e=await u(this.endpoint,{email:this.email});console.log("[AUTH] Reset sent",e);this.submitting=false;this.displayMode="login";p("If your email address is registered, you will receive instructions on resetting your password shortly.",{style:"info"})}catch(e){console.log("[AUTH] Unable to reset password",e);this.submitting=false;p("Unable to reset password. Please check your email address and try again.",{style:"error"})}}render(){if(!this.visible){return i("div",{style:{display:"none"}},"Authenticated")}if(this.session){return i("verdocs-button",{label:"Sign Out",disabled:this.submitting,onClick:()=>this.handleLogout(),style:{display:"flex",justifyContent:"center",margin:"30px auto 0"}})}if(this.displayMode==="signup"){const e=this.submitting||!this.first_name||!this.last_name||!this.email||!this.password||!this.confirmpass||!this.org_name;return i("div",{class:"form"},i("a",{href:"https://verdocs.com/en/"},i("img",{src:this.logo,alt:"Verdocs Logo",class:"logo"})),i("h3",null,"Sign up for a free account"),i("div",{class:"already-have"},"Already have an account?",i("verdocs-button",{label:"Log In",variant:"text",onClick:()=>this.displayMode="login",disabled:this.submitting})),i("form",{onSubmit:()=>this.handleSignup()},i("div",{style:{display:"flex",flexDirection:"row",columnGap:"20px"}},i("verdocs-text-input",{label:"First Name",autocomplete:"first",required:true,value:this.first_name,onInput:e=>this.first_name=e.target.value,disabled:this.submitting}),i("verdocs-text-input",{label:"Last Name",autocomplete:"last",required:true,value:this.last_name,onInput:e=>this.last_name=e.target.value,disabled:this.submitting})),i("verdocs-text-input",{label:"Email Address",autocomplete:"email",required:true,value:this.email,onInput:e=>this.email=e.target.value,disabled:this.submitting}),i("verdocs-text-input",{label:"Password",type:"password",required:true,autocomplete:"new-password",value:this.password,onInput:e=>this.password=e.target.value,disabled:this.submitting}),i("verdocs-text-input",{label:"Confirm Password",type:"password",required:true,autocomplete:"off",value:this.confirmpass,onInput:e=>this.confirmpass=e.target.value,disabled:this.submitting}),i("verdocs-text-input",{label:"Phone Number",type:"tel",required:true,autocomplete:"phone",value:this.phone,onInput:e=>this.phone=e.target.value,disabled:this.submitting}),i("verdocs-text-input",{label:"Organization Name",autocomplete:"org",required:true,value:this.org_name,onInput:e=>this.org_name=e.target.value,disabled:this.submitting,style:{flex:"1"}}),i("div",{class:"service-agreement"},"By clicking the Create Account button, you agree to the"," ",i("a",{href:"https://verdocs.com/eula",target:"_blank"},"End User License Agreement"),". Learn about how we use and protect your data and how you can opt-out in our"," ",i("a",{href:"https://verdocs.com/privacy-policy",target:"_blank"},"Privacy Policy"),"."),i("div",{style:{marginTop:"30px"}}),i("verdocs-button",{label:"Next",disabled:e,onClick:e?()=>{}:()=>this.handleSignup(),style:{display:"flex",justifyContent:"center",margin:"30px auto 0"}})))}if(this.displayMode==="verify"){return i("div",{class:"form"},i("form",{onSubmit:()=>this.handleVerification()},i("p",null,"Please check your e-mail inbox for a verification code and enter it below."),i("verdocs-text-input",{label:"Verification Code",required:true,value:this.verificationCode,onInput:e=>this.verificationCode=e.target.value,disabled:this.submitting}),i("div",{class:"buttons"},i("verdocs-button",{label:"Sign Out",variant:"outline",disabled:this.submitting,onClick:()=>this.handleLogout()}),i("verdocs-button",{label:"Verify",disabled:this.submitting||!this.verificationCode||this.verificationCode.length!==6,onClick:()=>this.handleVerification()})),i("div",{class:"buttons"},i("verdocs-button",{variant:"text",label:"Resend Code",disabled:this.resendDisabled||this.submitting,onClick:()=>this.handleResendVerification()}))))}if(this.displayMode==="forgot"){return i("div",{class:"form"},i("a",{href:"https://verdocs.com/en/"},i("img",{src:this.logo,alt:"Verdocs Logo",class:"logo"})),i("h3",null,"Forgot your password?"),i("p",null,"Enter your e-mail address below. If the e-mail address is valid, a password reset code will be sent to your inbox. Please allow up to 15 minutes to arrive, and check your spam folder if you do not receive the message."),i("form",{onSubmit:()=>this.handleResetGetCode()},i("verdocs-text-input",{label:"Email Address",autocomplete:"email",required:true,value:this.email,onInput:e=>this.email=e.target.value,disabled:this.submitting}),i("div",{style:{marginTop:"30px"}}),i("div",{class:"buttons"},i("verdocs-button",{size:"small",label:"Cancel",variant:"outline",disabled:this.submitting,onClick:()=>this.displayMode="login"}),i("verdocs-button",{size:"small",label:"Request Code",disabled:this.submitting,onClick:()=>this.handleResetGetCode()}))))}if(this.displayMode==="reset"){return i("div",{class:"form"},i("a",{href:"https://verdocs.com/en/"},i("img",{src:this.logo,alt:"Verdocs Logo",class:"logo"})),i("h3",null,"Forgot your password?"),i("p",null,"Enter your e-mail address below, and reset instructions will be sent to your Inbox. Please allow up to 15 minutes to arrive. Check your spam folder if you do not receive the message."),i("form",{onSubmit:()=>this.handleResetPassword()},i("verdocs-text-input",{label:"Verification Code",required:true,value:this.verificationCode,onInput:e=>this.verificationCode=e.target.value,disabled:this.submitting}),i("verdocs-text-input",{label:"Password",type:"password",required:true,autocomplete:"off",value:this.newPassword,onInput:e=>this.newPassword=e.target.value,disabled:this.submitting}),i("verdocs-text-input",{label:"Confirm Password",type:"password",required:true,autocomplete:"off",value:this.confirmpass,onInput:e=>this.confirmpass=e.target.value,disabled:this.submitting}),i("div",{style:{marginTop:"30px"}}),i("div",{class:"buttons"},i("verdocs-button",{label:"Cancel",variant:"outline",disabled:this.submitting,onClick:()=>this.displayMode="login"}),i("verdocs-button",{label:"Reset",disabled:this.submitting,onClick:()=>this.handleResetPassword()})),i("div",{class:"buttons"},i("verdocs-button",{variant:"text",label:"Resend Code",disabled:this.resendDisabled||this.submitting,onClick:()=>this.handleResendReset()}))))}return i("div",{class:"form"},i("a",{href:"https://verdocs.com/en/"},i("img",{src:this.logo,alt:"Verdocs Logo",class:"logo"})),i("h3",null,"Log in to your account"),i("div",{class:"already-have"},"Don't have an account?",i("verdocs-button",{label:"Sign Up",variant:"text",onClick:()=>this.displayMode="signup",disabled:this.submitting})),i("form",{onSubmit:()=>this.loginAndCheckVerification()},i("verdocs-text-input",{label:"Email",autocomplete:"username",value:this.email,onInput:e=>this.email=e.target.value,disabled:this.submitting}),i("verdocs-text-input",{label:"Password",type:"password",autocomplete:"current-password",value:this.password,onInput:e=>this.password=e.target.value,disabled:this.submitting}),i("verdocs-button",{label:"Forgot Your Password?",variant:"text",onClick:()=>this.displayMode="forgot",disabled:this.submitting,style:{display:"flex",justifyContent:"center",margin:"10px auto 20px"}}),i("verdocs-button",{label:"Login",disabled:this.submitting,onClick:()=>this.loginAndCheckVerification(),style:{display:"flex",justifyContent:"center",margin:"10px auto 0"}})))}static get style(){return y()}},[0,"verdocs-auth",{endpoint:[16],visible:[4],logo:[1],displayMode:[1025,"display-mode"],org_name:[32],first_name:[32],last_name:[32],email:[32],phone:[32],verificationCode:[32],newPassword:[32],password:[32],confirmpass:[32],submitting:[32],resendDisabled:[32],session:[32],profile:[32]}]);function x(){if(typeof customElements==="undefined"){return}const e=["verdocs-auth","verdocs-button","verdocs-help-icon","verdocs-text-input"];e.forEach((e=>{switch(e){case"verdocs-auth":if(!customElements.get(o(e))){customElements.define(o(e),g)}break;case"verdocs-button":if(!customElements.get(o(e))){m()}break;case"verdocs-help-icon":if(!customElements.get(o(e))){v()}break;case"verdocs-text-input":if(!customElements.get(o(e))){b()}break}}))}const w=g;const k=x;export{w as VerdocsAuth,k as defineCustomElement};
2
2
  //# sourceMappingURL=verdocs-auth.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["verdocsAuthCss","VerdocsAuth","__stencil_proxyCustomElement","HTMLElement","constructor","registerHost","this","endpoint","VerdocsEndpoint","getDefault","visible","logo","displayMode","org_name","first_name","last_name","email","phone","verificationCode","newPassword","password","confirmpass","submitting","resendDisabled","session","profile","resendDisabledTimer","tempAuthEndpoint","baseURL","getBaseURL","persist","handleHashChange","applyHashDisplayMode","componentWillLoad","loadSession","window","addEventListener","onSessionChanged","_endpoint","_a","authenticated","emit","_b","disconnectedCallback","removeEventListener","hash","location","replace","toLowerCase","isPasswordComplex","isUppercase","ch","test","isLowercase","isSpecialChar","countOfUpperCase","countOfLowerCase","countOfSpecialChar","i","length","charAt","handleSignup","VerdocsToast","style","clearSession","formattedPhone","convertToE164","createProfile","then","r","console","log","setToken","access_token","catch","e","response","sdkError","SDKError","message","_c","status","_d","data","_f","_e","error","handleVerification","verificationResult","verifyEmail","token","completeLogin","result","clearForms","loginAndCheckVerification","authResult","authenticate","username","trim","grant_type","user","getMyUser","email_verified","handleLogout","handleResendVerification","setTimeout","resendVerification","handleResendReset","resetPassword","handleResetGetCode","handleResetPassword","resetResult","code","new_password","handleReset","render","h","display","label","disabled","onClick","justifyContent","margin","invalid","class","href","src","alt","variant","onSubmit","flexDirection","columnGap","autocomplete","required","value","onInput","target","type","flex","marginTop","size"],"sources":["src/components/embeds/verdocs-auth/verdocs-auth.scss?tag=verdocs-auth","src/components/embeds/verdocs-auth/verdocs-auth.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-auth {\n font-family: $verdocs-primary-font;\n display: flex;\n align-items: center;\n flex-direction: column;\n justify-content: center;\n\n .form {\n width: 350px;\n display: flex;\n padding: 20px;\n max-width: 90%;\n align-items: center;\n flex-direction: column;\n box-sizing: border-box;\n justify-content: center;\n background: $verdocs-grey-4;\n }\n\n .logo {\n width: 128px;\n max-width: 100%;\n margin: 20px 0 30px;\n }\n\n h3 {\n color: $verdocs-grey-0;\n text-align: center;\n font-weight: 400;\n font-size: 18px;\n line-height: 1.75;\n margin: 0;\n }\n\n em {\n font-size: 14px;\n margin: 15px 0;\n }\n\n .buttons {\n gap: 20px;\n margin: 20px 0 0 0;\n display: flex;\n flex-direction: row;\n justify-content: center;\n }\n\n .status-result {\n display: none;\n\n &.debug {\n white-space: pre-wrap;\n font-size: 14px;\n background: #fff;\n padding: 10px;\n display: block;\n flex-direction: row;\n justify-content: center;\n }\n }\n\n form {\n width: 100%;\n }\n\n verdocs-text-input {\n margin-bottom: 10px;\n }\n\n .account-option {\n gap: 8px;\n margin: 20px 0 8px 0;\n display: flex;\n flex-direction: row;\n }\n\n p {\n color: $verdocs-grey-0;\n margin: 1em 0;\n font-size: 14px;\n }\n\n // Our <p>s are in a flex layout which prevents margins from collapsing because each item creates its own row\n p + p {\n margin-top: 0;\n }\n\n verdocs-help-icon {\n margin-top: 18px;\n display: flex;\n width: 32px;\n height: 32px;\n flex: 0 0 32px;\n }\n\n .already-have {\n color: $verdocs-grey-0;\n margin: 0.5em 0;\n font-size: 14px;\n text-align: center;\n }\n\n .service-agreement {\n font-size: 12px;\n color: #777;\n\n a {\n color: $verdocs-grey-0;\n }\n }\n}\n","import {Component, Prop, State, h, Event, EventEmitter} from '@stencil/core';\nimport {verifyEmail, IAuthenticateResponse, getMyUser, IProfile, convertToE164} from '@verdocs/js-sdk';\nimport {TSession, VerdocsEndpoint, createProfile, authenticate, resendVerification, resetPassword} from '@verdocs/js-sdk';\nimport {VerdocsToast} from '../../../utils/Toast';\nimport {SDKError} from '../../../utils/errors';\n\nexport interface IAuthStatus {\n authenticated: boolean;\n session: TSession;\n profile: IProfile | null;\n}\n\n/**\n * Display an authentication dialog that allows the user to login or sign up. If the user is\n * already authenticated with a valid session, this component will hide itself and fire the\n * success callback immediately. It is up to the host application to render the next appropriate\n * view for the application.\n *\n * To simplify UI development, a visibility flag can force this component to never display. This\n * allows you to subscribe to notifications from client apps without calling the lower-level JS SDK.\n *\n * This embed is responsive / mobile-friendly, but the calling application should provide at\n * least a 300px wide container to allow sufficient space for the required forms.\n *\n * ```ts\n * <verdocs-auth\n * onAuthenticated={({ detail }) => console.log('Authentication state:', detail) }\n * onSdkError={({ detail }) => { console.log('SDK error', detail) }\n * />\n * ```\n */\n@Component({\n tag: 'verdocs-auth',\n styleUrl: 'verdocs-auth.scss',\n shadow: false,\n})\nexport class VerdocsAuth {\n /**\n * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n /**\n * Normally, if the user has a valid session, this embed will be invisible, otherwise it will display\n * login / signup forms. If this is set to false, this embed will be invisible in both cases. Apps may\n * use this to verify if a user has a valid session without needing a separate call to Verdocs JS SDK.\n */\n @Prop() visible: boolean = true;\n\n /**\n * By default, a Verdocs logo will be displayed above the login/signup forms. This may be used to\n * override its source. (Alternatively, you may simply hide it via CSS overrides.) Logos should be\n * in SVG format for best results.\n */\n @Prop() logo: string = 'https://app.verdocs.com/assets/blue-logo.svg';\n\n /**\n * The display mode to start in.\n */\n @Prop({mutable: true}) displayMode: 'login' | 'forgot' | 'reset' | 'signup' | 'verify' = 'login';\n\n /**\n * Event fired when session authentication process has completed. Check the event\n * contents for completion status. This event will always be called at least once,\n * when the component is first rendered.\n */\n @Event({composed: true}) authenticated: EventEmitter<IAuthStatus>;\n\n /**\n * Event fired if an error occurs. The event details will contain information about the error. Most errors will\n * terminate the process, and the calling application should correct the condition and re-render the component.\n */\n @Event({composed: true}) sdkError: EventEmitter<SDKError>;\n\n @State() org_name: string = '';\n @State() first_name: string = '';\n @State() last_name: string = '';\n @State() email: string = '';\n @State() phone: string = '';\n @State() verificationCode: string = '';\n @State() newPassword: string = '';\n @State() password: string = '';\n @State() confirmpass: string = '';\n @State() submitting: boolean = false;\n @State() resendDisabled = false;\n @State() session: TSession = null;\n @State() profile: IProfile | null = null;\n\n resendDisabledTimer = null;\n\n // We can't instantly log in on the default endpoint because other listeners might see\n // its events and incorrectly trigger before we're done. So we manage our own temp\n // endpoint and pass the final tokens to the default once we're ready.\n tempAuthEndpoint = new VerdocsEndpoint({\n baseURL: VerdocsEndpoint.getDefault().getBaseURL(),\n persist: false,\n });\n\n componentWillLoad() {\n this.endpoint.loadSession();\n this.applyHashDisplayMode();\n\n // We need to listen to the hashchange to know when we're being sent to #forgot\n if (typeof window !== 'undefined') {\n window.addEventListener('hashchange', this.handleHashChange);\n }\n\n VerdocsEndpoint.getDefault().onSessionChanged((_endpoint, session, profile) => {\n this.session = session;\n this.profile = profile;\n if (session) {\n this.authenticated?.emit({authenticated: true, session, profile});\n } else {\n this.authenticated?.emit({authenticated: false, session, profile});\n }\n });\n }\n\n disconnectedCallback() {\n if (typeof window !== 'undefined') {\n window.removeEventListener('hashchange', this.handleHashChange);\n }\n }\n\n handleHashChange = () => {\n this.applyHashDisplayMode();\n };\n\n applyHashDisplayMode() {\n if (typeof window === 'undefined') {\n return;\n }\n\n const hash = (window.location.hash || '').replace(/^#/, '').toLowerCase();\n if (hash === 'forgot') {\n this.displayMode = 'forgot';\n }\n }\n\n isPasswordComplex(password: string) {\n const isUppercase = (ch: string) => /[A-Z]/.test(ch);\n const isLowercase = (ch: string) => /[a-z]/.test(ch);\n const isSpecialChar = (ch: string) => /[`!@#$%^&*()_\\-+=\\[\\]{};':\"\\\\|,.<>\\/?~ ]/.test(ch);\n let countOfUpperCase = 0,\n countOfLowerCase = 0,\n countOfSpecialChar = 0;\n for (let i = 0; i < password.length; i++) {\n let ch = password.charAt(i);\n if (isUppercase(ch)) countOfUpperCase++;\n else if (isLowercase(ch)) countOfLowerCase++;\n else if (isSpecialChar(ch)) countOfSpecialChar++;\n }\n return password.length >= 8 && countOfLowerCase > 0 && countOfUpperCase > 0 && countOfSpecialChar > 0;\n }\n\n handleSignup() {\n if (!this.isPasswordComplex(this.password)) {\n VerdocsToast('Password must be at least 8 characters long and contain at least one uppercase, one lowercase, and one special character.', {style: 'error'});\n return;\n }\n\n if (this.password !== this.confirmpass) {\n VerdocsToast('Passwords do not match.', {style: 'error'});\n return;\n }\n\n this.submitting = true;\n this.tempAuthEndpoint.clearSession();\n const formattedPhone = convertToE164(this.phone);\n\n createProfile(this.tempAuthEndpoint, {\n email: this.email,\n password: this.password,\n first_name: this.first_name,\n last_name: this.last_name,\n org_name: this.org_name,\n phone: formattedPhone,\n })\n .then(r => {\n console.log('[AUTH] Profile creation result', r);\n this.tempAuthEndpoint.setToken(r.access_token);\n // We can't clearForms because we need email to stick around\n this.password = '';\n this.phone = '';\n this.first_name = '';\n this.last_name = '';\n this.org_name = '';\n this.displayMode = 'verify';\n this.submitting = false;\n })\n .catch(e => {\n console.log('[AUTH] Signup error', e.response);\n this.submitting = false;\n this.authenticated?.emit({authenticated: false, profile: null, session: null});\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n\n VerdocsToast('Signup failed: ' + e.response?.data?.error || 'Unknown Error', {style: 'error'});\n });\n }\n\n async handleVerification() {\n this.submitting = true;\n\n try {\n this.submitting = false;\n const verificationResult = await verifyEmail(this.tempAuthEndpoint, {email: this.email, token: this.verificationCode});\n VerdocsToast('Thank you for verifying your email address.', {style: 'success'});\n this.completeLogin(verificationResult);\n } catch (e) {\n this.submitting = false;\n console.log('Verification error', e);\n VerdocsToast('Verification error, please check the code and try again.');\n }\n }\n\n completeLogin(result: IAuthenticateResponse) {\n this.clearForms();\n this.tempAuthEndpoint.clearSession();\n this.endpoint.setToken(result.access_token);\n }\n\n async loginAndCheckVerification() {\n if (this.submitting) {\n return;\n }\n\n this.submitting = true;\n this.tempAuthEndpoint.clearSession();\n\n try {\n this.submitting = false;\n const authResult = await authenticate(this.tempAuthEndpoint, {username: this.email.trim(), password: this.password, grant_type: 'password'});\n console.log('[AUTH] Authenticated, checking email verification');\n this.tempAuthEndpoint.setToken(authResult.access_token);\n\n const user = await getMyUser(this.tempAuthEndpoint);\n\n if (!user.email_verified) {\n console.log('[AUTH] Logged in, pending email address verification');\n this.displayMode = 'verify';\n } else {\n console.log('[AUTH] Email address is verified, completing login');\n this.completeLogin(authResult);\n }\n } catch (e) {\n this.submitting = false;\n console.log('[AUTH] Auth failure', e.response?.data || e);\n VerdocsToast('Login failed. Please check your credentials and try again.', {style: 'error'});\n }\n }\n\n clearForms() {\n this.submitting = false;\n this.resendDisabled = false;\n this.email = '';\n this.phone = '';\n this.password = '';\n this.newPassword = '';\n this.confirmpass = '';\n this.verificationCode = '';\n this.first_name = '';\n this.last_name = '';\n this.org_name = '';\n }\n\n handleLogout() {\n console.log('logging out');\n this.endpoint.clearSession();\n this.tempAuthEndpoint.clearSession();\n this.clearForms();\n this.displayMode = 'login';\n }\n\n handleResendVerification() {\n // Avoid the user just click-spamming this pathway. The server rate-limits this anyway so it's not a\n // security issue but it's a poor user experience to allow it.\n this.resendDisabled = true;\n this.resendDisabledTimer = setTimeout(() => {\n this.resendDisabled = false;\n this.resendDisabledTimer = null;\n }, 30000);\n\n resendVerification(this.tempAuthEndpoint)\n .then(r => {\n console.log('[AUTH] Verification request resent', r);\n VerdocsToast('Please check your email for a verification code.', {style: 'info'});\n })\n .catch((e: any) => {\n console.log('[AUTH] Unable to resend verification', e);\n VerdocsToast('Unable to resend code. Please try again later.', {style: 'error'});\n });\n }\n\n handleResendReset() {\n // Avoid the user just click-spamming this pathway. The server rate-limits this anyway so it's not a\n // security issue but it's a poor user experience to allow it.\n this.resendDisabled = true;\n this.resendDisabledTimer = setTimeout(() => {\n this.resendDisabled = false;\n this.resendDisabledTimer = null;\n }, 30000);\n\n resetPassword(this.tempAuthEndpoint, {email: this.email})\n .then(r => {\n console.log('[AUTH] Resend-code request resent', r);\n VerdocsToast('Please check your email again for a verification code.', {style: 'info'});\n })\n .catch((e: any) => {\n console.log('[AUTH] Unable to resend reset request', e);\n VerdocsToast('Unable to resend code. Please try again later.', {style: 'error'});\n });\n }\n\n async handleResetGetCode() {\n this.submitting = true;\n this.confirmpass = '';\n this.newPassword = '';\n\n try {\n this.submitting = false;\n const result = await resetPassword(this.endpoint, {email: this.email});\n console.log('[AUTH] Reset result', result);\n VerdocsToast('Please check your email inbox for a password reset code.', {style: 'success'});\n this.verificationCode = '';\n this.confirmpass = '';\n this.newPassword = '';\n this.displayMode = 'reset';\n } catch (e) {\n this.submitting = false;\n console.log('Reset request error', e);\n VerdocsToast('Request failed. Please check your email address and try again.');\n }\n }\n\n async handleResetPassword() {\n if (!this.isPasswordComplex(this.newPassword)) {\n VerdocsToast('Password must be at least 8 characters long and contain at least one uppercase, one lowercase, and one special character.', {style: 'error'});\n return;\n }\n\n if (this.newPassword !== this.confirmpass) {\n VerdocsToast('Passwords do not match.', {style: 'error'});\n return;\n }\n\n this.submitting = true;\n try {\n this.submitting = false;\n const resetResult = await resetPassword(this.endpoint, {email: this.email, code: this.verificationCode, new_password: this.newPassword});\n console.log('reset result', resetResult);\n VerdocsToast('Your password has been reset. You may now use your new password to login.', {style: 'success'});\n this.verificationCode = '';\n this.confirmpass = '';\n this.newPassword = '';\n this.password = '';\n this.displayMode = 'login';\n } catch (e) {\n this.submitting = false;\n console.log('Verification error', e);\n VerdocsToast('Verification error, please check the code and try again.');\n }\n }\n\n async handleReset() {\n this.submitting = true;\n\n try {\n const result = await resetPassword(this.endpoint, {email: this.email});\n console.log('[AUTH] Reset sent', result);\n this.submitting = false;\n this.displayMode = 'login';\n VerdocsToast('If your email address is registered, you will receive instructions on resetting your password shortly.', {style: 'info'});\n } catch (e) {\n console.log('[AUTH] Unable to reset password', e);\n this.submitting = false;\n VerdocsToast('Unable to reset password. Please check your email address and try again.', {style: 'error'});\n }\n }\n\n render() {\n if (!this.visible) {\n return <div style={{display: 'none'}}>Authenticated</div>;\n }\n\n if (this.session) {\n return (\n <verdocs-button\n label=\"Sign Out\"\n disabled={this.submitting}\n onClick={() => this.handleLogout()}\n style={{display: 'flex', justifyContent: 'center', margin: '30px auto 0'}}\n />\n );\n }\n\n if (this.displayMode === 'signup') {\n const invalid = this.submitting || !this.first_name || !this.last_name || !this.email || !this.password || !this.confirmpass || !this.org_name;\n\n return (\n <div class=\"form\">\n <a href=\"https://verdocs.com/en/\">\n <img src={this.logo} alt=\"Verdocs Logo\" class=\"logo\" />\n </a>\n\n <h3>Sign up for a free account</h3>\n <div class=\"already-have\">\n Already have an account?\n <verdocs-button label=\"Log In\" variant=\"text\" onClick={() => (this.displayMode = 'login')} disabled={this.submitting} />\n </div>\n\n <form onSubmit={() => this.handleSignup()}>\n <div style={{display: 'flex', flexDirection: 'row', columnGap: '20px'}}>\n <verdocs-text-input\n label=\"First Name\"\n autocomplete=\"first\"\n required={true}\n value={this.first_name}\n onInput={(e: any) => (this.first_name = e.target.value)}\n disabled={this.submitting}\n />\n <verdocs-text-input\n label=\"Last Name\"\n autocomplete=\"last\"\n required={true}\n value={this.last_name}\n onInput={(e: any) => (this.last_name = e.target.value)}\n disabled={this.submitting}\n />\n </div>\n <verdocs-text-input\n label=\"Email Address\"\n autocomplete=\"email\"\n required={true}\n value={this.email}\n onInput={(e: any) => (this.email = e.target.value)}\n disabled={this.submitting}\n />\n <verdocs-text-input\n label=\"Password\"\n type=\"password\"\n required={true}\n autocomplete=\"new-password\"\n value={this.password}\n onInput={(e: any) => (this.password = e.target.value)}\n disabled={this.submitting}\n />\n <verdocs-text-input\n label=\"Confirm Password\"\n type=\"password\"\n required={true}\n autocomplete=\"off\"\n value={this.confirmpass}\n onInput={(e: any) => (this.confirmpass = e.target.value)}\n disabled={this.submitting}\n />\n <verdocs-text-input\n label=\"Phone Number\"\n type=\"tel\"\n required={true}\n autocomplete=\"phone\"\n value={this.phone}\n onInput={(e: any) => (this.phone = e.target.value)}\n disabled={this.submitting}\n />\n <verdocs-text-input\n label=\"Organization Name\"\n autocomplete=\"org\"\n required={true}\n value={this.org_name}\n onInput={(e: any) => (this.org_name = e.target.value)}\n disabled={this.submitting}\n style={{flex: '1'}}\n />\n\n <div class=\"service-agreement\">\n By clicking the Create Account button, you agree to the{' '}\n <a href=\"https://verdocs.com/eula\" target=\"_blank\">\n End User License Agreement\n </a>\n . Learn about how we use and protect your data and how you can opt-out in our{' '}\n <a href=\"https://verdocs.com/privacy-policy\" target=\"_blank\">\n Privacy Policy\n </a>\n .\n </div>\n\n <div style={{marginTop: '30px'}} />\n\n <verdocs-button\n label=\"Next\"\n disabled={invalid}\n onClick={invalid ? () => {} : () => this.handleSignup()}\n style={{display: 'flex', justifyContent: 'center', margin: '30px auto 0'}}\n />\n </form>\n </div>\n );\n }\n\n if (this.displayMode === 'verify') {\n return (\n <div class=\"form\">\n <form onSubmit={() => this.handleVerification()}>\n <p>Please check your e-mail inbox for a verification code and enter it below.</p>\n\n <verdocs-text-input\n label=\"Verification Code\"\n required={true}\n value={this.verificationCode}\n onInput={(e: any) => (this.verificationCode = e.target.value)}\n disabled={this.submitting}\n />\n\n <div class=\"buttons\">\n <verdocs-button label=\"Sign Out\" variant=\"outline\" disabled={this.submitting} onClick={() => this.handleLogout()} />\n <verdocs-button label=\"Verify\" disabled={this.submitting || !this.verificationCode || this.verificationCode.length !== 6} onClick={() => this.handleVerification()} />\n </div>\n <div class=\"buttons\">\n <verdocs-button variant=\"text\" label=\"Resend Code\" disabled={this.resendDisabled || this.submitting} onClick={() => this.handleResendVerification()} />\n </div>\n </form>\n </div>\n );\n }\n\n if (this.displayMode === 'forgot') {\n return (\n <div class=\"form\">\n <a href=\"https://verdocs.com/en/\">\n <img src={this.logo} alt=\"Verdocs Logo\" class=\"logo\" />\n </a>\n\n <h3>Forgot your password?</h3>\n\n <p>\n Enter your e-mail address below. If the e-mail address is valid, a password reset code will be sent to your inbox. Please allow up to 15 minutes to arrive, and check\n your spam folder if you do not receive the message.\n </p>\n\n <form onSubmit={() => this.handleResetGetCode()}>\n <verdocs-text-input\n label=\"Email Address\"\n autocomplete=\"email\"\n required={true}\n value={this.email}\n onInput={(e: any) => (this.email = e.target.value)}\n disabled={this.submitting}\n />\n\n <div style={{marginTop: '30px'}} />\n\n <div class=\"buttons\">\n <verdocs-button size=\"small\" label=\"Cancel\" variant=\"outline\" disabled={this.submitting} onClick={() => (this.displayMode = 'login')} />\n <verdocs-button size=\"small\" label=\"Request Code\" disabled={this.submitting} onClick={() => this.handleResetGetCode()} />\n </div>\n </form>\n </div>\n );\n }\n\n if (this.displayMode === 'reset') {\n return (\n <div class=\"form\">\n <a href=\"https://verdocs.com/en/\">\n <img src={this.logo} alt=\"Verdocs Logo\" class=\"logo\" />\n </a>\n\n <h3>Forgot your password?</h3>\n\n <p>\n Enter your e-mail address below, and reset instructions will be sent to your Inbox. Please allow up to 15 minutes to arrive. Check your spam folder if you do not\n receive the message.\n </p>\n\n <form onSubmit={() => this.handleResetPassword()}>\n <verdocs-text-input\n label=\"Verification Code\"\n required={true}\n value={this.verificationCode}\n onInput={(e: any) => (this.verificationCode = e.target.value)}\n disabled={this.submitting}\n />\n <verdocs-text-input\n label=\"Password\"\n type=\"password\"\n required={true}\n autocomplete=\"off\"\n value={this.newPassword}\n onInput={(e: any) => (this.newPassword = e.target.value)}\n disabled={this.submitting}\n />\n <verdocs-text-input\n label=\"Confirm Password\"\n type=\"password\"\n required={true}\n autocomplete=\"off\"\n value={this.confirmpass}\n onInput={(e: any) => (this.confirmpass = e.target.value)}\n disabled={this.submitting}\n />\n\n <div style={{marginTop: '30px'}} />\n\n <div class=\"buttons\">\n <verdocs-button label=\"Cancel\" variant=\"outline\" disabled={this.submitting} onClick={() => (this.displayMode = 'login')} />\n <verdocs-button label=\"Reset\" disabled={this.submitting} onClick={() => this.handleResetPassword()} />\n </div>\n\n <div class=\"buttons\">\n <verdocs-button variant=\"text\" label=\"Resend Code\" disabled={this.resendDisabled || this.submitting} onClick={() => this.handleResendReset()} />\n </div>\n </form>\n </div>\n );\n }\n\n return (\n <div class=\"form\">\n <a href=\"https://verdocs.com/en/\">\n <img src={this.logo} alt=\"Verdocs Logo\" class=\"logo\" />\n </a>\n\n <h3>Log in to your account</h3>\n <div class=\"already-have\">\n Don't have an account?\n <verdocs-button label=\"Sign Up\" variant=\"text\" onClick={() => (this.displayMode = 'signup')} disabled={this.submitting} />\n </div>\n\n <form onSubmit={() => this.loginAndCheckVerification()}>\n <verdocs-text-input label=\"Email\" autocomplete=\"username\" value={this.email} onInput={(e: any) => (this.email = e.target.value)} disabled={this.submitting} />\n <verdocs-text-input\n label=\"Password\"\n type=\"password\"\n autocomplete=\"current-password\"\n value={this.password}\n onInput={(e: any) => (this.password = e.target.value)}\n disabled={this.submitting}\n />\n\n <verdocs-button\n label=\"Forgot Your Password?\"\n variant=\"text\"\n onClick={() => (this.displayMode = 'forgot')}\n disabled={this.submitting}\n style={{display: 'flex', justifyContent: 'center', margin: '10px auto 20px'}}\n />\n\n <verdocs-button\n label=\"Login\"\n disabled={this.submitting}\n onClick={() => this.loginAndCheckVerification()}\n style={{display: 'flex', justifyContent: 'center', margin: '10px auto 0'}}\n />\n </form>\n </div>\n );\n }\n}\n"],"mappings":"yaAAA,MAAMA,EAAiB,IAAM,wwD,MCoChBC,EAAWC,EAAA,MAAAD,UAAAE,EALxB,WAAAC,CAAAC,G,wHASUC,KAAAC,SAA4BC,EAAgBC,aAO5CH,KAAAI,QAAmB,KAOnBJ,KAAAK,KAAe,+CAKAL,KAAAM,YAAkE,QAehFN,KAAAO,SAAmB,GACnBP,KAAAQ,WAAqB,GACrBR,KAAAS,UAAoB,GACpBT,KAAAU,MAAgB,GAChBV,KAAAW,MAAgB,GAChBX,KAAAY,iBAA2B,GAC3BZ,KAAAa,YAAsB,GACtBb,KAAAc,SAAmB,GACnBd,KAAAe,YAAsB,GACtBf,KAAAgB,WAAsB,MACtBhB,KAAAiB,eAAiB,MACjBjB,KAAAkB,QAAoB,KACpBlB,KAAAmB,QAA2B,KAEpCnB,KAAAoB,oBAAsB,KAKtBpB,KAAAqB,iBAAmB,IAAInB,EAAgB,CACrCoB,QAASpB,EAAgBC,aAAaoB,aACtCC,QAAS,QA6BXxB,KAAAyB,iBAAmB,KACjBzB,KAAK0B,sBAAsB,CAohB9B,CA/iBC,iBAAAC,GACE3B,KAAKC,SAAS2B,cACd5B,KAAK0B,uBAGL,UAAWG,SAAW,YAAa,CACjCA,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MAAM,WACNmB,KAAK,WACLL,aAAa,mBACbE,MAAOhI,KAAKc,SACZmH,QAAU5D,GAAYrE,KAAKc,SAAWuD,EAAE6D,OAAOF,MAC/Cf,SAAUjH,KAAKgB,aAGjB8F,EAAA,kBACEE,MAAM,wBACNU,QAAQ,OACRR,QAAS,IAAOlH,KAAKM,YAAc,SACnC2G,SAAUjH,KAAKgB,WACfyC,MAAO,CAACsD,QAAS,OAAQI,eAAgB,SAAUC,OAAQ,oBAG7DN,EAAA,kBACEE,MAAM,QACNC,SAAUjH,KAAKgB,WACfkG,QAAS,IAAMlH,KAAKwF,4BACpB/B,MAAO,CAACsD,QAAS,OAAQI,eAAgB,SAAUC,OAAQ,kB","ignoreList":[]}
1
+ {"version":3,"names":["verdocsAuthCss","VerdocsAuth","__stencil_proxyCustomElement","HTMLElement","constructor","registerHost","this","endpoint","VerdocsEndpoint","getDefault","visible","logo","displayMode","org_name","first_name","last_name","email","phone","verificationCode","newPassword","password","confirmpass","submitting","resendDisabled","session","profile","resendDisabledTimer","tempAuthEndpoint","baseURL","getBaseURL","persist","handleHashChange","applyHashDisplayMode","componentWillLoad","loadSession","window","addEventListener","onSessionChanged","_endpoint","_a","authenticated","emit","_b","disconnectedCallback","removeEventListener","hash","location","replace","toLowerCase","isPasswordComplex","isUppercase","ch","test","isLowercase","isSpecialChar","countOfUpperCase","countOfLowerCase","countOfSpecialChar","i","length","charAt","handleSignup","VerdocsToast","style","clearSession","formattedPhone","convertToE164","localeData","Intl","DateTimeFormat","resolvedOptions","createProfile","timezone","timeZone","locale","then","r","console","log","setToken","access_token","catch","e","response","sdkError","SDKError","message","_c","status","_d","data","_f","_e","error","handleVerification","verificationResult","verifyEmail","token","completeLogin","result","clearForms","loginAndCheckVerification","authResult","authenticate","username","trim","grant_type","user","getMyUser","email_verified","handleLogout","handleResendVerification","setTimeout","resendVerification","handleResendReset","resetPassword","handleResetGetCode","handleResetPassword","resetResult","code","new_password","handleReset","render","h","display","label","disabled","onClick","justifyContent","margin","invalid","class","href","src","alt","variant","onSubmit","flexDirection","columnGap","autocomplete","required","value","onInput","target","type","flex","marginTop","size"],"sources":["src/components/embeds/verdocs-auth/verdocs-auth.scss?tag=verdocs-auth","src/components/embeds/verdocs-auth/verdocs-auth.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-auth {\n font-family: $verdocs-primary-font;\n display: flex;\n align-items: center;\n flex-direction: column;\n justify-content: center;\n\n .form {\n width: 350px;\n display: flex;\n padding: 20px;\n max-width: 90%;\n align-items: center;\n flex-direction: column;\n box-sizing: border-box;\n justify-content: center;\n background: $verdocs-grey-4;\n }\n\n .logo {\n width: 128px;\n max-width: 100%;\n margin: 20px 0 30px;\n }\n\n h3 {\n color: $verdocs-grey-0;\n text-align: center;\n font-weight: 400;\n font-size: 18px;\n line-height: 1.75;\n margin: 0;\n }\n\n em {\n font-size: 14px;\n margin: 15px 0;\n }\n\n .buttons {\n gap: 20px;\n margin: 20px 0 0 0;\n display: flex;\n flex-direction: row;\n justify-content: center;\n }\n\n .status-result {\n display: none;\n\n &.debug {\n white-space: pre-wrap;\n font-size: 14px;\n background: #fff;\n padding: 10px;\n display: block;\n flex-direction: row;\n justify-content: center;\n }\n }\n\n form {\n width: 100%;\n }\n\n verdocs-text-input {\n margin-bottom: 10px;\n }\n\n .account-option {\n gap: 8px;\n margin: 20px 0 8px 0;\n display: flex;\n flex-direction: row;\n }\n\n p {\n color: $verdocs-grey-0;\n margin: 1em 0;\n font-size: 14px;\n }\n\n // Our <p>s are in a flex layout which prevents margins from collapsing because each item creates its own row\n p + p {\n margin-top: 0;\n }\n\n verdocs-help-icon {\n margin-top: 18px;\n display: flex;\n width: 32px;\n height: 32px;\n flex: 0 0 32px;\n }\n\n .already-have {\n color: $verdocs-grey-0;\n margin: 0.5em 0;\n font-size: 14px;\n text-align: center;\n }\n\n .service-agreement {\n font-size: 12px;\n color: #777;\n\n a {\n color: $verdocs-grey-0;\n }\n }\n}\n","import {Component, Prop, State, h, Event, EventEmitter} from '@stencil/core';\nimport {verifyEmail, IAuthenticateResponse, getMyUser, IProfile, convertToE164} from '@verdocs/js-sdk';\nimport {TSession, VerdocsEndpoint, createProfile, authenticate, resendVerification, resetPassword} from '@verdocs/js-sdk';\nimport {VerdocsToast} from '../../../utils/Toast';\nimport {SDKError} from '../../../utils/errors';\n\nexport interface IAuthStatus {\n authenticated: boolean;\n session: TSession;\n profile: IProfile | null;\n}\n\n/**\n * Display an authentication dialog that allows the user to login or sign up. If the user is\n * already authenticated with a valid session, this component will hide itself and fire the\n * success callback immediately. It is up to the host application to render the next appropriate\n * view for the application.\n *\n * To simplify UI development, a visibility flag can force this component to never display. This\n * allows you to subscribe to notifications from client apps without calling the lower-level JS SDK.\n *\n * This embed is responsive / mobile-friendly, but the calling application should provide at\n * least a 300px wide container to allow sufficient space for the required forms.\n *\n * ```ts\n * <verdocs-auth\n * onAuthenticated={({ detail }) => console.log('Authentication state:', detail) }\n * onSdkError={({ detail }) => { console.log('SDK error', detail) }\n * />\n * ```\n */\n@Component({\n tag: 'verdocs-auth',\n styleUrl: 'verdocs-auth.scss',\n shadow: false,\n})\nexport class VerdocsAuth {\n /**\n * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n /**\n * Normally, if the user has a valid session, this embed will be invisible, otherwise it will display\n * login / signup forms. If this is set to false, this embed will be invisible in both cases. Apps may\n * use this to verify if a user has a valid session without needing a separate call to Verdocs JS SDK.\n */\n @Prop() visible: boolean = true;\n\n /**\n * By default, a Verdocs logo will be displayed above the login/signup forms. This may be used to\n * override its source. (Alternatively, you may simply hide it via CSS overrides.) Logos should be\n * in SVG format for best results.\n */\n @Prop() logo: string = 'https://app.verdocs.com/assets/blue-logo.svg';\n\n /**\n * The display mode to start in.\n */\n @Prop({mutable: true}) displayMode: 'login' | 'forgot' | 'reset' | 'signup' | 'verify' = 'login';\n\n /**\n * Event fired when session authentication process has completed. Check the event\n * contents for completion status. This event will always be called at least once,\n * when the component is first rendered.\n */\n @Event({composed: true}) authenticated: EventEmitter<IAuthStatus>;\n\n /**\n * Event fired if an error occurs. The event details will contain information about the error. Most errors will\n * terminate the process, and the calling application should correct the condition and re-render the component.\n */\n @Event({composed: true}) sdkError: EventEmitter<SDKError>;\n\n @State() org_name: string = '';\n @State() first_name: string = '';\n @State() last_name: string = '';\n @State() email: string = '';\n @State() phone: string = '';\n @State() verificationCode: string = '';\n @State() newPassword: string = '';\n @State() password: string = '';\n @State() confirmpass: string = '';\n @State() submitting: boolean = false;\n @State() resendDisabled = false;\n @State() session: TSession = null;\n @State() profile: IProfile | null = null;\n\n resendDisabledTimer = null;\n\n // We can't instantly log in on the default endpoint because other listeners might see\n // its events and incorrectly trigger before we're done. So we manage our own temp\n // endpoint and pass the final tokens to the default once we're ready.\n tempAuthEndpoint = new VerdocsEndpoint({\n baseURL: VerdocsEndpoint.getDefault().getBaseURL(),\n persist: false,\n });\n\n componentWillLoad() {\n this.endpoint.loadSession();\n this.applyHashDisplayMode();\n\n // We need to listen to the hashchange to know when we're being sent to #forgot\n if (typeof window !== 'undefined') {\n window.addEventListener('hashchange', this.handleHashChange);\n }\n\n VerdocsEndpoint.getDefault().onSessionChanged((_endpoint, session, profile) => {\n this.session = session;\n this.profile = profile;\n if (session) {\n this.authenticated?.emit({authenticated: true, session, profile});\n } else {\n this.authenticated?.emit({authenticated: false, session, profile});\n }\n });\n }\n\n disconnectedCallback() {\n if (typeof window !== 'undefined') {\n window.removeEventListener('hashchange', this.handleHashChange);\n }\n }\n\n handleHashChange = () => {\n this.applyHashDisplayMode();\n };\n\n applyHashDisplayMode() {\n if (typeof window === 'undefined') {\n return;\n }\n\n const hash = (window.location.hash || '').replace(/^#/, '').toLowerCase();\n if (hash === 'forgot') {\n this.displayMode = 'forgot';\n }\n }\n\n isPasswordComplex(password: string) {\n const isUppercase = (ch: string) => /[A-Z]/.test(ch);\n const isLowercase = (ch: string) => /[a-z]/.test(ch);\n const isSpecialChar = (ch: string) => /[`!@#$%^&*()_\\-+=\\[\\]{};':\"\\\\|,.<>\\/?~ ]/.test(ch);\n let countOfUpperCase = 0,\n countOfLowerCase = 0,\n countOfSpecialChar = 0;\n for (let i = 0; i < password.length; i++) {\n let ch = password.charAt(i);\n if (isUppercase(ch)) countOfUpperCase++;\n else if (isLowercase(ch)) countOfLowerCase++;\n else if (isSpecialChar(ch)) countOfSpecialChar++;\n }\n return password.length >= 8 && countOfLowerCase > 0 && countOfUpperCase > 0 && countOfSpecialChar > 0;\n }\n\n handleSignup() {\n if (!this.isPasswordComplex(this.password)) {\n VerdocsToast('Password must be at least 8 characters long and contain at least one uppercase, one lowercase, and one special character.', {style: 'error'});\n return;\n }\n\n if (this.password !== this.confirmpass) {\n VerdocsToast('Passwords do not match.', {style: 'error'});\n return;\n }\n\n this.submitting = true;\n this.tempAuthEndpoint.clearSession();\n const formattedPhone = convertToE164(this.phone);\n const localeData = Intl.DateTimeFormat().resolvedOptions();\n\n createProfile(this.tempAuthEndpoint, {\n email: this.email,\n password: this.password,\n first_name: this.first_name,\n last_name: this.last_name,\n org_name: this.org_name,\n phone: formattedPhone,\n // @ts-expect-error - v6.9.13\n timezone: localeData.timeZone,\n locale: localeData.locale,\n })\n .then(r => {\n console.log('[AUTH] Profile creation result', r);\n this.tempAuthEndpoint.setToken(r.access_token);\n // We can't clearForms because we need email to stick around\n this.password = '';\n this.phone = '';\n this.first_name = '';\n this.last_name = '';\n this.org_name = '';\n this.displayMode = 'verify';\n this.submitting = false;\n })\n .catch(e => {\n console.log('[AUTH] Signup error', e.response);\n this.submitting = false;\n this.authenticated?.emit({authenticated: false, profile: null, session: null});\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n\n VerdocsToast('Signup failed: ' + e.response?.data?.error || 'Unknown Error', {style: 'error'});\n });\n }\n\n async handleVerification() {\n this.submitting = true;\n\n try {\n this.submitting = false;\n const verificationResult = await verifyEmail(this.tempAuthEndpoint, {email: this.email, token: this.verificationCode});\n VerdocsToast('Thank you for verifying your email address.', {style: 'success'});\n this.completeLogin(verificationResult);\n } catch (e) {\n this.submitting = false;\n console.log('Verification error', e);\n VerdocsToast('Verification error, please check the code and try again.');\n }\n }\n\n completeLogin(result: IAuthenticateResponse) {\n this.clearForms();\n this.tempAuthEndpoint.clearSession();\n this.endpoint.setToken(result.access_token);\n }\n\n async loginAndCheckVerification() {\n if (this.submitting) {\n return;\n }\n\n this.submitting = true;\n this.tempAuthEndpoint.clearSession();\n\n try {\n this.submitting = false;\n const authResult = await authenticate(this.tempAuthEndpoint, {username: this.email.trim(), password: this.password, grant_type: 'password'});\n console.log('[AUTH] Authenticated, checking email verification');\n this.tempAuthEndpoint.setToken(authResult.access_token);\n\n const user = await getMyUser(this.tempAuthEndpoint);\n\n if (!user.email_verified) {\n console.log('[AUTH] Logged in, pending email address verification');\n this.displayMode = 'verify';\n } else {\n console.log('[AUTH] Email address is verified, completing login');\n this.completeLogin(authResult);\n }\n } catch (e) {\n this.submitting = false;\n console.log('[AUTH] Auth failure', e.response?.data || e);\n VerdocsToast('Login failed. Please check your credentials and try again.', {style: 'error'});\n }\n }\n\n clearForms() {\n this.submitting = false;\n this.resendDisabled = false;\n this.email = '';\n this.phone = '';\n this.password = '';\n this.newPassword = '';\n this.confirmpass = '';\n this.verificationCode = '';\n this.first_name = '';\n this.last_name = '';\n this.org_name = '';\n }\n\n handleLogout() {\n console.log('logging out');\n this.endpoint.clearSession();\n this.tempAuthEndpoint.clearSession();\n this.clearForms();\n this.displayMode = 'login';\n }\n\n handleResendVerification() {\n // Avoid the user just click-spamming this pathway. The server rate-limits this anyway so it's not a\n // security issue but it's a poor user experience to allow it.\n this.resendDisabled = true;\n this.resendDisabledTimer = setTimeout(() => {\n this.resendDisabled = false;\n this.resendDisabledTimer = null;\n }, 30000);\n\n resendVerification(this.tempAuthEndpoint)\n .then(r => {\n console.log('[AUTH] Verification request resent', r);\n VerdocsToast('Please check your email for a verification code.', {style: 'info'});\n })\n .catch((e: any) => {\n console.log('[AUTH] Unable to resend verification', e);\n VerdocsToast('Unable to resend code. Please try again later.', {style: 'error'});\n });\n }\n\n handleResendReset() {\n // Avoid the user just click-spamming this pathway. The server rate-limits this anyway so it's not a\n // security issue but it's a poor user experience to allow it.\n this.resendDisabled = true;\n this.resendDisabledTimer = setTimeout(() => {\n this.resendDisabled = false;\n this.resendDisabledTimer = null;\n }, 30000);\n\n resetPassword(this.tempAuthEndpoint, {email: this.email})\n .then(r => {\n console.log('[AUTH] Resend-code request resent', r);\n VerdocsToast('Please check your email again for a verification code.', {style: 'info'});\n })\n .catch((e: any) => {\n console.log('[AUTH] Unable to resend reset request', e);\n VerdocsToast('Unable to resend code. Please try again later.', {style: 'error'});\n });\n }\n\n async handleResetGetCode() {\n this.submitting = true;\n this.confirmpass = '';\n this.newPassword = '';\n\n try {\n this.submitting = false;\n const result = await resetPassword(this.endpoint, {email: this.email});\n console.log('[AUTH] Reset result', result);\n VerdocsToast('Please check your email inbox for a password reset code.', {style: 'success'});\n this.verificationCode = '';\n this.confirmpass = '';\n this.newPassword = '';\n this.displayMode = 'reset';\n } catch (e) {\n this.submitting = false;\n console.log('Reset request error', e);\n VerdocsToast('Request failed. Please check your email address and try again.');\n }\n }\n\n async handleResetPassword() {\n if (!this.isPasswordComplex(this.newPassword)) {\n VerdocsToast('Password must be at least 8 characters long and contain at least one uppercase, one lowercase, and one special character.', {style: 'error'});\n return;\n }\n\n if (this.newPassword !== this.confirmpass) {\n VerdocsToast('Passwords do not match.', {style: 'error'});\n return;\n }\n\n this.submitting = true;\n try {\n this.submitting = false;\n const resetResult = await resetPassword(this.endpoint, {email: this.email, code: this.verificationCode, new_password: this.newPassword});\n console.log('reset result', resetResult);\n VerdocsToast('Your password has been reset. You may now use your new password to login.', {style: 'success'});\n this.verificationCode = '';\n this.confirmpass = '';\n this.newPassword = '';\n this.password = '';\n this.displayMode = 'login';\n } catch (e) {\n this.submitting = false;\n console.log('Verification error', e);\n VerdocsToast('Verification error, please check the code and try again.');\n }\n }\n\n async handleReset() {\n this.submitting = true;\n\n try {\n const result = await resetPassword(this.endpoint, {email: this.email});\n console.log('[AUTH] Reset sent', result);\n this.submitting = false;\n this.displayMode = 'login';\n VerdocsToast('If your email address is registered, you will receive instructions on resetting your password shortly.', {style: 'info'});\n } catch (e) {\n console.log('[AUTH] Unable to reset password', e);\n this.submitting = false;\n VerdocsToast('Unable to reset password. Please check your email address and try again.', {style: 'error'});\n }\n }\n\n render() {\n if (!this.visible) {\n return <div style={{display: 'none'}}>Authenticated</div>;\n }\n\n if (this.session) {\n return (\n <verdocs-button\n label=\"Sign Out\"\n disabled={this.submitting}\n onClick={() => this.handleLogout()}\n style={{display: 'flex', justifyContent: 'center', margin: '30px auto 0'}}\n />\n );\n }\n\n if (this.displayMode === 'signup') {\n const invalid = this.submitting || !this.first_name || !this.last_name || !this.email || !this.password || !this.confirmpass || !this.org_name;\n\n return (\n <div class=\"form\">\n <a href=\"https://verdocs.com/en/\">\n <img src={this.logo} alt=\"Verdocs Logo\" class=\"logo\" />\n </a>\n\n <h3>Sign up for a free account</h3>\n <div class=\"already-have\">\n Already have an account?\n <verdocs-button label=\"Log In\" variant=\"text\" onClick={() => (this.displayMode = 'login')} disabled={this.submitting} />\n </div>\n\n <form onSubmit={() => this.handleSignup()}>\n <div style={{display: 'flex', flexDirection: 'row', columnGap: '20px'}}>\n <verdocs-text-input\n label=\"First Name\"\n autocomplete=\"first\"\n required={true}\n value={this.first_name}\n onInput={(e: any) => (this.first_name = e.target.value)}\n disabled={this.submitting}\n />\n <verdocs-text-input\n label=\"Last Name\"\n autocomplete=\"last\"\n required={true}\n value={this.last_name}\n onInput={(e: any) => (this.last_name = e.target.value)}\n disabled={this.submitting}\n />\n </div>\n <verdocs-text-input\n label=\"Email Address\"\n autocomplete=\"email\"\n required={true}\n value={this.email}\n onInput={(e: any) => (this.email = e.target.value)}\n disabled={this.submitting}\n />\n <verdocs-text-input\n label=\"Password\"\n type=\"password\"\n required={true}\n autocomplete=\"new-password\"\n value={this.password}\n onInput={(e: any) => (this.password = e.target.value)}\n disabled={this.submitting}\n />\n <verdocs-text-input\n label=\"Confirm Password\"\n type=\"password\"\n required={true}\n autocomplete=\"off\"\n value={this.confirmpass}\n onInput={(e: any) => (this.confirmpass = e.target.value)}\n disabled={this.submitting}\n />\n <verdocs-text-input\n label=\"Phone Number\"\n type=\"tel\"\n required={true}\n autocomplete=\"phone\"\n value={this.phone}\n onInput={(e: any) => (this.phone = e.target.value)}\n disabled={this.submitting}\n />\n <verdocs-text-input\n label=\"Organization Name\"\n autocomplete=\"org\"\n required={true}\n value={this.org_name}\n onInput={(e: any) => (this.org_name = e.target.value)}\n disabled={this.submitting}\n style={{flex: '1'}}\n />\n\n <div class=\"service-agreement\">\n By clicking the Create Account button, you agree to the{' '}\n <a href=\"https://verdocs.com/eula\" target=\"_blank\">\n End User License Agreement\n </a>\n . Learn about how we use and protect your data and how you can opt-out in our{' '}\n <a href=\"https://verdocs.com/privacy-policy\" target=\"_blank\">\n Privacy Policy\n </a>\n .\n </div>\n\n <div style={{marginTop: '30px'}} />\n\n <verdocs-button\n label=\"Next\"\n disabled={invalid}\n onClick={invalid ? () => {} : () => this.handleSignup()}\n style={{display: 'flex', justifyContent: 'center', margin: '30px auto 0'}}\n />\n </form>\n </div>\n );\n }\n\n if (this.displayMode === 'verify') {\n return (\n <div class=\"form\">\n <form onSubmit={() => this.handleVerification()}>\n <p>Please check your e-mail inbox for a verification code and enter it below.</p>\n\n <verdocs-text-input\n label=\"Verification Code\"\n required={true}\n value={this.verificationCode}\n onInput={(e: any) => (this.verificationCode = e.target.value)}\n disabled={this.submitting}\n />\n\n <div class=\"buttons\">\n <verdocs-button label=\"Sign Out\" variant=\"outline\" disabled={this.submitting} onClick={() => this.handleLogout()} />\n <verdocs-button label=\"Verify\" disabled={this.submitting || !this.verificationCode || this.verificationCode.length !== 6} onClick={() => this.handleVerification()} />\n </div>\n <div class=\"buttons\">\n <verdocs-button variant=\"text\" label=\"Resend Code\" disabled={this.resendDisabled || this.submitting} onClick={() => this.handleResendVerification()} />\n </div>\n </form>\n </div>\n );\n }\n\n if (this.displayMode === 'forgot') {\n return (\n <div class=\"form\">\n <a href=\"https://verdocs.com/en/\">\n <img src={this.logo} alt=\"Verdocs Logo\" class=\"logo\" />\n </a>\n\n <h3>Forgot your password?</h3>\n\n <p>\n Enter your e-mail address below. If the e-mail address is valid, a password reset code will be sent to your inbox. Please allow up to 15 minutes to arrive, and check\n your spam folder if you do not receive the message.\n </p>\n\n <form onSubmit={() => this.handleResetGetCode()}>\n <verdocs-text-input\n label=\"Email Address\"\n autocomplete=\"email\"\n required={true}\n value={this.email}\n onInput={(e: any) => (this.email = e.target.value)}\n disabled={this.submitting}\n />\n\n <div style={{marginTop: '30px'}} />\n\n <div class=\"buttons\">\n <verdocs-button size=\"small\" label=\"Cancel\" variant=\"outline\" disabled={this.submitting} onClick={() => (this.displayMode = 'login')} />\n <verdocs-button size=\"small\" label=\"Request Code\" disabled={this.submitting} onClick={() => this.handleResetGetCode()} />\n </div>\n </form>\n </div>\n );\n }\n\n if (this.displayMode === 'reset') {\n return (\n <div class=\"form\">\n <a href=\"https://verdocs.com/en/\">\n <img src={this.logo} alt=\"Verdocs Logo\" class=\"logo\" />\n </a>\n\n <h3>Forgot your password?</h3>\n\n <p>\n Enter your e-mail address below, and reset instructions will be sent to your Inbox. Please allow up to 15 minutes to arrive. Check your spam folder if you do not\n receive the message.\n </p>\n\n <form onSubmit={() => this.handleResetPassword()}>\n <verdocs-text-input\n label=\"Verification Code\"\n required={true}\n value={this.verificationCode}\n onInput={(e: any) => (this.verificationCode = e.target.value)}\n disabled={this.submitting}\n />\n <verdocs-text-input\n label=\"Password\"\n type=\"password\"\n required={true}\n autocomplete=\"off\"\n value={this.newPassword}\n onInput={(e: any) => (this.newPassword = e.target.value)}\n disabled={this.submitting}\n />\n <verdocs-text-input\n label=\"Confirm Password\"\n type=\"password\"\n required={true}\n autocomplete=\"off\"\n value={this.confirmpass}\n onInput={(e: any) => (this.confirmpass = e.target.value)}\n disabled={this.submitting}\n />\n\n <div style={{marginTop: '30px'}} />\n\n <div class=\"buttons\">\n <verdocs-button label=\"Cancel\" variant=\"outline\" disabled={this.submitting} onClick={() => (this.displayMode = 'login')} />\n <verdocs-button label=\"Reset\" disabled={this.submitting} onClick={() => this.handleResetPassword()} />\n </div>\n\n <div class=\"buttons\">\n <verdocs-button variant=\"text\" label=\"Resend Code\" disabled={this.resendDisabled || this.submitting} onClick={() => this.handleResendReset()} />\n </div>\n </form>\n </div>\n );\n }\n\n return (\n <div class=\"form\">\n <a href=\"https://verdocs.com/en/\">\n <img src={this.logo} alt=\"Verdocs Logo\" class=\"logo\" />\n </a>\n\n <h3>Log in to your account</h3>\n <div class=\"already-have\">\n Don't have an account?\n <verdocs-button label=\"Sign Up\" variant=\"text\" onClick={() => (this.displayMode = 'signup')} disabled={this.submitting} />\n </div>\n\n <form onSubmit={() => this.loginAndCheckVerification()}>\n <verdocs-text-input label=\"Email\" autocomplete=\"username\" value={this.email} onInput={(e: any) => (this.email = e.target.value)} disabled={this.submitting} />\n <verdocs-text-input\n label=\"Password\"\n type=\"password\"\n autocomplete=\"current-password\"\n value={this.password}\n onInput={(e: any) => (this.password = e.target.value)}\n disabled={this.submitting}\n />\n\n <verdocs-button\n label=\"Forgot Your Password?\"\n variant=\"text\"\n onClick={() => (this.displayMode = 'forgot')}\n disabled={this.submitting}\n style={{display: 'flex', justifyContent: 'center', margin: '10px auto 20px'}}\n />\n\n <verdocs-button\n label=\"Login\"\n disabled={this.submitting}\n onClick={() => this.loginAndCheckVerification()}\n style={{display: 'flex', justifyContent: 'center', margin: '10px auto 0'}}\n />\n </form>\n </div>\n );\n }\n}\n"],"mappings":"yaAAA,MAAMA,EAAiB,IAAM,wwD,MCoChBC,EAAWC,EAAA,MAAAD,UAAAE,EALxB,WAAAC,CAAAC,G,wHASUC,KAAAC,SAA4BC,EAAgBC,aA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o,d as r,t as i}from"./p-yZBlG3YQ.js";import{VerdocsEndpoint as d,getTemplate as a}from"@verdocs/js-sdk";import{S as l}from"./p-C1sRVZWv.js";import{S as c}from"./p-C7hFgM52.js";import{d as n}from"./p-Bdf8pPWm.js";import{d as m}from"./p-REnrt0JM.js";import{d as p}from"./p-CyDWJAOZ.js";import{d as f}from"./p-DeQsR41s.js";import{d as v}from"./p-DT0LGcPi.js";import{d as h}from"./p-BT8wzCXz.js";import{d as u}from"./p-BasWFMeN.js";import{d as b}from"./p-DwPH0TQ4.js";import{d as x}from"./p-BwEGkh_6.js";import{d as k}from"./p-DXLcCG08.js";import{d as w}from"./p-B845hxhl.js";import{d as E}from"./p-5E7bNT3k.js";import{d as g}from"./p-Cfiprngx.js";import{d as j}from"./p-pyA5cdVX.js";import{d as y}from"./p-DhO1wfh-.js";import{d as C}from"./p-CLxwSMOV.js";import{d as D}from"./p-wUsR0Dpa.js";import{d as I}from"./p-CioaaWeS.js";import{d as B}from"./p-B-_kYJtC.js";import{d as U}from"./p-BhtYCb5T.js";import{d as T}from"./p-D3qUITiS.js";import{d as L}from"./p-DQTI8vRX.js";import{d as S}from"./p-DjOTs59Z.js";import{d as R}from"./p-2bW-AL6b.js";import{d as N}from"./p-BXGNkmyr.js";import{d as O}from"./p-Bpe5Awxh.js";import{d as W}from"./p-BXQO5Vza.js";import{d as X}from"./p-CFEw4Xbi.js";import{d as A}from"./p-Dm9oOnhq.js";import{d as G}from"./p-DVGumEtx.js";import{d as V}from"./p-D3ohABOv.js";import{d as Y}from"./p-Yxa93LOl.js";import{d as z}from"./p-Dtndevf4.js";import{d as M}from"./p-CDMCVJys.js";import{d as Q}from"./p-DYtSnUj9.js";import{d as J}from"./p-Bxmki12o.js";import{d as Z}from"./p-u16vefxk.js";const F=()=>`verdocs-build{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;font-family:var(--verdocs-primary-font, "Inter", "Barlow", sans-serif)}verdocs-build .content{-ms-flex:1;flex:1;gap:20px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column}verdocs-build verdocs-template-attachments,verdocs-build verdocs-template-roles{display:block;width:500px;max-width:95%;-webkit-box-sizing:border-box;box-sizing:border-box;margin:20px}verdocs-build verdocs-template-fields{border-top:1px solid #777777}verdocs-build verdocs-template-attachments{padding:20px;background:#ffffff}verdocs-build verdocs-template-fields{width:100%}verdocs-build verdocs-preview{-ms-flex:1;flex:1}verdocs-build .preview-container{-ms-flex-direction:row;flex-direction:row;display:-ms-flexbox;display:flex;width:100%;background-color:#eeeeee;max-height:100%}@media all and (max-width: 450px){verdocs-build .preview-container{-ms-flex-direction:column;flex-direction:column}}verdocs-build .preview-send-wrapper{display:-ms-flexbox;display:flex;-ms-flex:0 0 300px;flex:0 0 300px;background-color:#ffffff;-webkit-box-shadow:1px 1px 6px -2px rgba(0, 0, 0, 0.4980392157);box-shadow:1px 1px 6px -2px rgba(0, 0, 0, 0.4980392157)}@media all and (max-width: 450px){verdocs-build .preview-send-wrapper{-ms-flex:0;flex:0}}verdocs-build .preview-preview-wrapper{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-pack:center;justify-content:center;overflow-y:scroll}`;const P=e(class e extends s{constructor(e){super();if(e!==false){this.__registerHost()}this.cancel=t(this,"cancel");this.sdkError=t(this,"sdkError");this.stepChanged=t(this,"stepChanged");this.send=t(this,"send");this.templateUpdated=t(this,"templateUpdated");this.templateCreated=t(this,"templateCreated");this.rolesUpdated=t(this,"rolesUpdated");this.templateListenerId=null;this.endpoint=d.getDefault();this.templateId=null;this.step="preview";this.loading=true;this.template=null}onTemplateIdChanged(e,s){if(!s&&e&&this.step==="attachments"){this.step="preview"}this.loadTemplate(e).catch((e=>console.log("Unknown Error",e)))}onStepChanged(){this.loadTemplate(this.templateId).catch((e=>console.log("Unknown Error",e)))}async componentWillLoad(){var e,s,t,o,r,i;try{this.endpoint.loadSession();if(!this.endpoint.session){console.log("[BUILD] Unable to start builder session, must be authenticated");return}if(!this.templateId){console.log(`[BUILD] No template ID, activating upload mode`);this.step="attachments";this.loading=false;return}try{this.loadTemplate(this.templateId).catch((e=>console.log("[BUILD] Unable to load template",e)))}catch(o){console.log("[BUILD] Error loading template",o);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new l(o.message,(s=o.response)===null||s===void 0?void 0:s.status,(t=o.response)===null||t===void 0?void 0:t.data))}}catch(e){console.log("[BUILD] Error with builder session",e);(o=this.sdkError)===null||o===void 0?void 0:o.emit(new l(e.message,(r=e.response)===null||r===void 0?void 0:r.status,(i=e.response)===null||i===void 0?void 0:i.data))}}async loadTemplate(e){if(e){c.subscribe("templates",this.templateId,(()=>a(this.endpoint,this.templateId)),false,(e=>{this.template=e;this.loading=false}))}}disconnectedCallback(){console.log("[BUILD] Disconnected");this.unlistenToTemplate()}unlistenToTemplate(){if(this.templateListenerId){c.store.delListener(this.templateListenerId);this.templateListenerId=null}}handleCancel(){var e;this.step="preview";(e=this.cancel)===null||e===void 0?void 0:e.emit()}async handleTemplateCreated(e){var s;await this.loadTemplate(e);this.templateId=e;this.step="roles";(s=this.stepChanged)===null||s===void 0?void 0:s.emit("roles")}async handleRolesUpdated(e){var s;console.log("[BUILD] Roloes updated",e);(s=this.templateUpdated)===null||s===void 0?void 0:s.emit(e.detail)}async handleTemplateUpdated(e){var s;console.log("[BUILD] Template updated",e);(s=this.templateUpdated)===null||s===void 0?void 0:s.emit(e.detail)}handleAttachmentsNext(){var e;this.step="roles";(e=this.stepChanged)===null||e===void 0?void 0:e.emit("roles")}handleRolesNext(){var e;this.step="fields";(e=this.stepChanged)===null||e===void 0?void 0:e.emit("fields")}handleStepChanged(e){var s;this.step=e;(s=this.stepChanged)===null||s===void 0?void 0:s.emit(e)}render(){if(this.loading){return o(r,{class:"loading"},o("verdocs-loader",null))}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("div",{class:"content"},o("verdocs-template-build-tabs",{endpoint:this.endpoint,templateId:this.templateId,step:this.step,onSdkError:e=>{var s;return(s=this.sdkError)===null||s===void 0?void 0:s.emit(e.detail)},onStepChanged:e=>this.handleStepChanged(e.detail)}),this.step==="attachments"&&o("verdocs-template-attachments",{templateId:this.templateId,endpoint:this.endpoint,onExit:()=>this.handleCancel(),onNext:()=>this.handleAttachmentsNext(),onTemplateUpdated:e=>this.handleTemplateUpdated(e)}),this.step==="roles"&&o("verdocs-template-roles",{templateId:this.templateId,endpoint:this.endpoint,onExit:()=>this.handleCancel(),onNext:()=>this.handleRolesNext(),onRolesUpdated:e=>this.handleRolesUpdated(e)}),this.step==="fields"&&o("verdocs-template-fields",{templateId:this.templateId,endpoint:this.endpoint,onTemplateUpdated:e=>this.handleTemplateUpdated(e)}),this.step==="preview"&&o("div",{class:"preview-container"},o("div",{class:"preview-send-wrapper"},o("verdocs-send",{templateId:this.templateId,endpoint:this.endpoint,onSend:e=>{var s;return(s=this.send)===null||s===void 0?void 0:s.emit(e.detail)},style:{width:"100%"}})),o("div",{class:"preview-preview-wrapper"},o("verdocs-preview",{templateId:this.templateId,endpoint:this.endpoint,style:{display:"flex",flex:"1",maxWidth:"1000px"}})))))}get el(){return this}static get watchers(){return{templateId:[{onTemplateIdChanged:0}],step:[{onStepChanged:0}]}}static get style(){return F()}},[0,"verdocs-build",{endpoint:[16],templateId:[1537,"template-id"],step:[1537],loading:[32],template:[32]},undefined,{templateId:[{onTemplateIdChanged:0}],step:[{onStepChanged:0}]}]);function q(){if(typeof customElements==="undefined"){return}const e=["verdocs-build","verdocs-button","verdocs-checkbox","verdocs-component-error","verdocs-contact-picker","verdocs-dialog","verdocs-field-attachment","verdocs-field-checkbox","verdocs-field-date","verdocs-field-dropdown","verdocs-field-initial","verdocs-field-radio","verdocs-field-signature","verdocs-field-textarea","verdocs-field-textbox","verdocs-field-timestamp","verdocs-file-chooser","verdocs-flag","verdocs-help-icon","verdocs-loader","verdocs-menu-panel","verdocs-ok-dialog","verdocs-portal","verdocs-preview","verdocs-progress-bar","verdocs-select-input","verdocs-send","verdocs-spinner","verdocs-template-attachments","verdocs-template-build-tabs","verdocs-template-document-page","verdocs-template-field-properties","verdocs-template-fields","verdocs-template-role-properties","verdocs-template-roles","verdocs-text-input","verdocs-toolbar-icon","verdocs-upload-dialog"];e.forEach((e=>{switch(e){case"verdocs-build":if(!customElements.get(i(e))){customElements.define(i(e),P)}break;case"verdocs-button":if(!customElements.get(i(e))){n()}break;case"verdocs-checkbox":if(!customElements.get(i(e))){m()}break;case"verdocs-component-error":if(!customElements.get(i(e))){p()}break;case"verdocs-contact-picker":if(!customElements.get(i(e))){f()}break;case"verdocs-dialog":if(!customElements.get(i(e))){v()}break;case"verdocs-field-attachment":if(!customElements.get(i(e))){h()}break;case"verdocs-field-checkbox":if(!customElements.get(i(e))){u()}break;case"verdocs-field-date":if(!customElements.get(i(e))){b()}break;case"verdocs-field-dropdown":if(!customElements.get(i(e))){x()}break;case"verdocs-field-initial":if(!customElements.get(i(e))){k()}break;case"verdocs-field-radio":if(!customElements.get(i(e))){w()}break;case"verdocs-field-signature":if(!customElements.get(i(e))){E()}break;case"verdocs-field-textarea":if(!customElements.get(i(e))){g()}break;case"verdocs-field-textbox":if(!customElements.get(i(e))){j()}break;case"verdocs-field-timestamp":if(!customElements.get(i(e))){y()}break;case"verdocs-file-chooser":if(!customElements.get(i(e))){C()}break;case"verdocs-flag":if(!customElements.get(i(e))){D()}break;case"verdocs-help-icon":if(!customElements.get(i(e))){I()}break;case"verdocs-loader":if(!customElements.get(i(e))){B()}break;case"verdocs-menu-panel":if(!customElements.get(i(e))){U()}break;case"verdocs-ok-dialog":if(!customElements.get(i(e))){T()}break;case"verdocs-portal":if(!customElements.get(i(e))){L()}break;case"verdocs-preview":if(!customElements.get(i(e))){S()}break;case"verdocs-progress-bar":if(!customElements.get(i(e))){R()}break;case"verdocs-select-input":if(!customElements.get(i(e))){N()}break;case"verdocs-send":if(!customElements.get(i(e))){O()}break;case"verdocs-spinner":if(!customElements.get(i(e))){W()}break;case"verdocs-template-attachments":if(!customElements.get(i(e))){X()}break;case"verdocs-template-build-tabs":if(!customElements.get(i(e))){A()}break;case"verdocs-template-document-page":if(!customElements.get(i(e))){G()}break;case"verdocs-template-field-properties":if(!customElements.get(i(e))){V()}break;case"verdocs-template-fields":if(!customElements.get(i(e))){Y()}break;case"verdocs-template-role-properties":if(!customElements.get(i(e))){z()}break;case"verdocs-template-roles":if(!customElements.get(i(e))){M()}break;case"verdocs-text-input":if(!customElements.get(i(e))){Q()}break;case"verdocs-toolbar-icon":if(!customElements.get(i(e))){J()}break;case"verdocs-upload-dialog":if(!customElements.get(i(e))){Z()}break}}))}const _=P;const H=q;export{_ as VerdocsBuild,H as defineCustomElement};
1
+ import{p as e,H as s,c as t,h as o,d as r,t as i}from"./p-yZBlG3YQ.js";import{VerdocsEndpoint as d,getTemplate as a}from"@verdocs/js-sdk";import{S as l}from"./p-C1sRVZWv.js";import{S as c}from"./p-C7hFgM52.js";import{d as n}from"./p-Bdf8pPWm.js";import{d as m}from"./p-REnrt0JM.js";import{d as p}from"./p-CyDWJAOZ.js";import{d as f}from"./p-DeQsR41s.js";import{d as v}from"./p-DT0LGcPi.js";import{d as h}from"./p-DSK9z7EN.js";import{d as u}from"./p-BasWFMeN.js";import{d as b}from"./p-DwPH0TQ4.js";import{d as x}from"./p-BwEGkh_6.js";import{d as k}from"./p-DXLcCG08.js";import{d as w}from"./p-B845hxhl.js";import{d as E}from"./p-5E7bNT3k.js";import{d as g}from"./p-Cfiprngx.js";import{d as j}from"./p-pyA5cdVX.js";import{d as y}from"./p-DhO1wfh-.js";import{d as D}from"./p-CLxwSMOV.js";import{d as B}from"./p-wUsR0Dpa.js";import{d as I}from"./p-CioaaWeS.js";import{d as C}from"./p-B-_kYJtC.js";import{d as U}from"./p-BhtYCb5T.js";import{d as T}from"./p-BwUTiBud.js";import{d as L}from"./p-DQTI8vRX.js";import{d as S}from"./p-BcQsqsDy.js";import{d as N}from"./p-2bW-AL6b.js";import{d as R}from"./p-BXGNkmyr.js";import{d as A}from"./p-DGws2Zgt.js";import{d as G}from"./p-BXQO5Vza.js";import{d as Q}from"./p-sPseFic3.js";import{d as W}from"./p-Dm9oOnhq.js";import{d as O}from"./p-DRgoGiAA.js";import{d as M}from"./p-D3ohABOv.js";import{d as V}from"./p-db6IAGB0.js";import{d as X}from"./p-BfKv6ivN.js";import{d as Y}from"./p-qDQgyl7L.js";import{d as z}from"./p-DYtSnUj9.js";import{d as P}from"./p-Bxmki12o.js";import{d as Z}from"./p-CQUV5gMT.js";const q=()=>`verdocs-build{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;font-family:var(--verdocs-primary-font, "Inter", "Barlow", sans-serif)}verdocs-build .content{-ms-flex:1;flex:1;gap:20px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column}verdocs-build verdocs-template-attachments,verdocs-build verdocs-template-roles{display:block;width:500px;max-width:95%;-webkit-box-sizing:border-box;box-sizing:border-box;margin:20px}verdocs-build verdocs-template-fields{border-top:1px solid #777777}verdocs-build verdocs-template-attachments{padding:20px;background:#ffffff}verdocs-build verdocs-template-fields{width:100%}verdocs-build verdocs-preview{-ms-flex:1;flex:1}verdocs-build .preview-container{-ms-flex-direction:row;flex-direction:row;display:-ms-flexbox;display:flex;width:100%;background-color:#eeeeee;max-height:100%}@media all and (max-width: 450px){verdocs-build .preview-container{-ms-flex-direction:column;flex-direction:column}}verdocs-build .preview-send-wrapper{display:-ms-flexbox;display:flex;-ms-flex:0 0 300px;flex:0 0 300px;background-color:#ffffff;-webkit-box-shadow:1px 1px 6px -2px rgba(0, 0, 0, 0.4980392157);box-shadow:1px 1px 6px -2px rgba(0, 0, 0, 0.4980392157)}@media all and (max-width: 450px){verdocs-build .preview-send-wrapper{-ms-flex:0;flex:0}}verdocs-build .preview-preview-wrapper{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-pack:center;justify-content:center;overflow-y:scroll}`;const F=e(class e extends s{constructor(e){super();if(e!==false){this.__registerHost()}this.cancel=t(this,"cancel");this.sdkError=t(this,"sdkError");this.stepChanged=t(this,"stepChanged");this.send=t(this,"send");this.templateUpdated=t(this,"templateUpdated");this.templateCreated=t(this,"templateCreated");this.rolesUpdated=t(this,"rolesUpdated");this.templateListenerId=null;this.endpoint=d.getDefault();this.templateId=null;this.step="preview";this.loading=true;this.template=null}onTemplateIdChanged(e,s){if(!s&&e&&this.step==="attachments"){this.step="preview"}this.loadTemplate(e).catch((e=>console.log("Unknown Error",e)))}onStepChanged(){this.loadTemplate(this.templateId).catch((e=>console.log("Unknown Error",e)))}async componentWillLoad(){var e,s,t,o,r,i;try{this.endpoint.loadSession();if(!this.endpoint.session){console.log("[BUILD] Unable to start builder session, must be authenticated");return}if(!this.templateId){console.log(`[BUILD] No template ID, activating upload mode`);this.step="attachments";this.loading=false;return}try{this.loadTemplate(this.templateId).catch((e=>console.log("[BUILD] Unable to load template",e)))}catch(o){console.log("[BUILD] Error loading template",o);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new l(o.message,(s=o.response)===null||s===void 0?void 0:s.status,(t=o.response)===null||t===void 0?void 0:t.data))}}catch(e){console.log("[BUILD] Error with builder session",e);(o=this.sdkError)===null||o===void 0?void 0:o.emit(new l(e.message,(r=e.response)===null||r===void 0?void 0:r.status,(i=e.response)===null||i===void 0?void 0:i.data))}}async loadTemplate(e){if(e){c.subscribe("templates",this.templateId,(()=>a(this.endpoint,this.templateId)),false,(e=>{this.template=e;this.loading=false}))}}disconnectedCallback(){console.log("[BUILD] Disconnected");this.unlistenToTemplate()}unlistenToTemplate(){if(this.templateListenerId){c.store.delListener(this.templateListenerId);this.templateListenerId=null}}handleCancel(){var e;this.step="preview";(e=this.cancel)===null||e===void 0?void 0:e.emit()}async handleTemplateCreated(e){var s;await this.loadTemplate(e);this.templateId=e;this.step="roles";(s=this.stepChanged)===null||s===void 0?void 0:s.emit("roles")}async handleRolesUpdated(e){var s;console.log("[BUILD] Roloes updated",e);(s=this.templateUpdated)===null||s===void 0?void 0:s.emit(e.detail)}async handleTemplateUpdated(e){var s;console.log("[BUILD] Template updated",e);(s=this.templateUpdated)===null||s===void 0?void 0:s.emit(e.detail)}handleAttachmentsNext(){var e;this.step="roles";(e=this.stepChanged)===null||e===void 0?void 0:e.emit("roles")}handleRolesNext(){var e;this.step="fields";(e=this.stepChanged)===null||e===void 0?void 0:e.emit("fields")}handleStepChanged(e){var s;this.step=e;(s=this.stepChanged)===null||s===void 0?void 0:s.emit(e)}render(){if(this.loading){return o(r,{class:"loading"},o("verdocs-loader",null))}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("div",{class:"content"},o("verdocs-template-build-tabs",{endpoint:this.endpoint,templateId:this.templateId,step:this.step,onSdkError:e=>{var s;return(s=this.sdkError)===null||s===void 0?void 0:s.emit(e.detail)},onStepChanged:e=>this.handleStepChanged(e.detail)}),this.step==="attachments"&&o("verdocs-template-attachments",{templateId:this.templateId,endpoint:this.endpoint,onExit:()=>this.handleCancel(),onNext:()=>this.handleAttachmentsNext(),onTemplateUpdated:e=>this.handleTemplateUpdated(e)}),this.step==="roles"&&o("verdocs-template-roles",{templateId:this.templateId,endpoint:this.endpoint,onExit:()=>this.handleCancel(),onNext:()=>this.handleRolesNext(),onRolesUpdated:e=>this.handleRolesUpdated(e)}),this.step==="fields"&&o("verdocs-template-fields",{templateId:this.templateId,endpoint:this.endpoint,onTemplateUpdated:e=>this.handleTemplateUpdated(e)}),this.step==="preview"&&o("div",{class:"preview-container"},o("div",{class:"preview-send-wrapper"},o("verdocs-send",{templateId:this.templateId,endpoint:this.endpoint,onSend:e=>{var s;return(s=this.send)===null||s===void 0?void 0:s.emit(e.detail)},style:{width:"100%"}})),o("div",{class:"preview-preview-wrapper"},o("verdocs-preview",{templateId:this.templateId,endpoint:this.endpoint,style:{display:"flex",flex:"1",maxWidth:"1000px"}})))))}get el(){return this}static get watchers(){return{templateId:[{onTemplateIdChanged:0}],step:[{onStepChanged:0}]}}static get style(){return q()}},[0,"verdocs-build",{endpoint:[16],templateId:[1537,"template-id"],step:[1537],loading:[32],template:[32]},undefined,{templateId:[{onTemplateIdChanged:0}],step:[{onStepChanged:0}]}]);function J(){if(typeof customElements==="undefined"){return}const e=["verdocs-build","verdocs-button","verdocs-checkbox","verdocs-component-error","verdocs-contact-picker","verdocs-dialog","verdocs-field-attachment","verdocs-field-checkbox","verdocs-field-date","verdocs-field-dropdown","verdocs-field-initial","verdocs-field-radio","verdocs-field-signature","verdocs-field-textarea","verdocs-field-textbox","verdocs-field-timestamp","verdocs-file-chooser","verdocs-flag","verdocs-help-icon","verdocs-loader","verdocs-menu-panel","verdocs-ok-dialog","verdocs-portal","verdocs-preview","verdocs-progress-bar","verdocs-select-input","verdocs-send","verdocs-spinner","verdocs-template-attachments","verdocs-template-build-tabs","verdocs-template-document-page","verdocs-template-field-properties","verdocs-template-fields","verdocs-template-role-properties","verdocs-template-roles","verdocs-text-input","verdocs-toolbar-icon","verdocs-upload-dialog"];e.forEach((e=>{switch(e){case"verdocs-build":if(!customElements.get(i(e))){customElements.define(i(e),F)}break;case"verdocs-button":if(!customElements.get(i(e))){n()}break;case"verdocs-checkbox":if(!customElements.get(i(e))){m()}break;case"verdocs-component-error":if(!customElements.get(i(e))){p()}break;case"verdocs-contact-picker":if(!customElements.get(i(e))){f()}break;case"verdocs-dialog":if(!customElements.get(i(e))){v()}break;case"verdocs-field-attachment":if(!customElements.get(i(e))){h()}break;case"verdocs-field-checkbox":if(!customElements.get(i(e))){u()}break;case"verdocs-field-date":if(!customElements.get(i(e))){b()}break;case"verdocs-field-dropdown":if(!customElements.get(i(e))){x()}break;case"verdocs-field-initial":if(!customElements.get(i(e))){k()}break;case"verdocs-field-radio":if(!customElements.get(i(e))){w()}break;case"verdocs-field-signature":if(!customElements.get(i(e))){E()}break;case"verdocs-field-textarea":if(!customElements.get(i(e))){g()}break;case"verdocs-field-textbox":if(!customElements.get(i(e))){j()}break;case"verdocs-field-timestamp":if(!customElements.get(i(e))){y()}break;case"verdocs-file-chooser":if(!customElements.get(i(e))){D()}break;case"verdocs-flag":if(!customElements.get(i(e))){B()}break;case"verdocs-help-icon":if(!customElements.get(i(e))){I()}break;case"verdocs-loader":if(!customElements.get(i(e))){C()}break;case"verdocs-menu-panel":if(!customElements.get(i(e))){U()}break;case"verdocs-ok-dialog":if(!customElements.get(i(e))){T()}break;case"verdocs-portal":if(!customElements.get(i(e))){L()}break;case"verdocs-preview":if(!customElements.get(i(e))){S()}break;case"verdocs-progress-bar":if(!customElements.get(i(e))){N()}break;case"verdocs-select-input":if(!customElements.get(i(e))){R()}break;case"verdocs-send":if(!customElements.get(i(e))){A()}break;case"verdocs-spinner":if(!customElements.get(i(e))){G()}break;case"verdocs-template-attachments":if(!customElements.get(i(e))){Q()}break;case"verdocs-template-build-tabs":if(!customElements.get(i(e))){W()}break;case"verdocs-template-document-page":if(!customElements.get(i(e))){O()}break;case"verdocs-template-field-properties":if(!customElements.get(i(e))){M()}break;case"verdocs-template-fields":if(!customElements.get(i(e))){V()}break;case"verdocs-template-role-properties":if(!customElements.get(i(e))){X()}break;case"verdocs-template-roles":if(!customElements.get(i(e))){Y()}break;case"verdocs-text-input":if(!customElements.get(i(e))){z()}break;case"verdocs-toolbar-icon":if(!customElements.get(i(e))){P()}break;case"verdocs-upload-dialog":if(!customElements.get(i(e))){Z()}break}}))}const K=F;const _=J;export{K as VerdocsBuild,_ as defineCustomElement};
2
2
  //# sourceMappingURL=verdocs-build.js.map