@verdocs/web-sdk 1.11.5 → 1.11.7

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 (206) hide show
  1. package/dist/cjs/{Templates-a94ae841.js → Templates-721828dc.js} +1 -1
  2. package/dist/cjs/{interact.min-d223d04b.js → interact.min-8b2204e4.js} +1 -1
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/{templateStore-4abb214a.js → templateStore-4e927fb4.js} +0 -1
  5. package/dist/cjs/{utils-f4cfa1fb.js → utils-c955f518.js} +3 -0
  6. package/dist/cjs/verdocs-build.cjs.entry.js +2 -2
  7. package/dist/cjs/verdocs-button-panel_3.cjs.entry.js +2 -2
  8. package/dist/cjs/verdocs-contact-picker.cjs.entry.js +7 -2
  9. package/dist/cjs/verdocs-document-page_2.cjs.entry.js +1 -1
  10. package/dist/cjs/verdocs-field-attachment.cjs.entry.js +1 -1
  11. package/dist/cjs/verdocs-field-checkbox.cjs.entry.js +2 -2
  12. package/dist/cjs/verdocs-field-date.cjs.entry.js +2 -2
  13. package/dist/cjs/verdocs-field-dropdown.cjs.entry.js +2 -2
  14. package/dist/cjs/verdocs-field-initial.cjs.entry.js +2 -2
  15. package/dist/cjs/verdocs-field-payment.cjs.entry.js +2 -2
  16. package/dist/cjs/verdocs-field-radio-button.cjs.entry.js +2 -2
  17. package/dist/cjs/verdocs-field-signature.cjs.entry.js +2 -2
  18. package/dist/cjs/verdocs-field-textarea.cjs.entry.js +2 -2
  19. package/dist/cjs/verdocs-field-textbox.cjs.entry.js +2 -2
  20. package/dist/cjs/verdocs-field-timestamp.cjs.entry.js +2 -2
  21. package/dist/cjs/verdocs-preview.cjs.entry.js +3 -3
  22. package/dist/cjs/verdocs-send.cjs.entry.js +3 -3
  23. package/dist/cjs/verdocs-sign.cjs.entry.js +1 -1
  24. package/dist/cjs/verdocs-template-attachments.cjs.entry.js +2 -2
  25. package/dist/cjs/verdocs-template-create_2.cjs.entry.js +6 -6
  26. package/dist/cjs/verdocs-template-document-page.cjs.entry.js +2 -4
  27. package/dist/cjs/verdocs-template-name.cjs.entry.js +2 -2
  28. package/dist/cjs/verdocs-template-properties.cjs.entry.js +1 -1
  29. package/dist/cjs/verdocs-template-reminders.cjs.entry.js +2 -2
  30. package/dist/cjs/verdocs-template-role-properties_2.cjs.entry.js +2 -2
  31. package/dist/cjs/{verdocs-template-recipients.cjs.entry.js → verdocs-template-roles.cjs.entry.js} +19 -20
  32. package/dist/cjs/verdocs-template-visibility.cjs.entry.js +2 -2
  33. package/dist/cjs/verdocs-view.cjs.entry.js +1 -1
  34. package/dist/cjs/verdocs-web-sdk.cjs.js +1 -1
  35. package/dist/collection/collection-manifest.json +2 -2
  36. package/dist/collection/components/elements/verdocs-contact-picker/verdocs-contact-picker.js +11 -3
  37. package/dist/collection/components/{elements → templates}/verdocs-template-document-page/verdocs-template-document-page.js +1 -3
  38. package/dist/collection/components/templates/verdocs-template-fields/verdocs-template-fields.js +2 -2
  39. package/dist/collection/components/templates/verdocs-template-fields/verdocs-template-fields.stories.js +1 -0
  40. package/dist/collection/components/templates/verdocs-template-recipients/{verdocs-template-recipients.css → verdocs-template-roles.css} +42 -42
  41. package/dist/collection/components/templates/verdocs-template-recipients/{verdocs-template-recipients.js → verdocs-template-roles.js} +16 -17
  42. package/dist/collection/components/templates/verdocs-template-recipients/{verdocs-template-recipients.stories.js → verdocs-template-roles.stories.js} +3 -3
  43. package/dist/collection/utils/templateStore.js +0 -1
  44. package/dist/collection/utils/utils.js +3 -0
  45. package/dist/components/index.d.ts +2 -2
  46. package/dist/components/index.js +1 -1
  47. package/dist/components/templateStore.js +0 -1
  48. package/dist/components/utils.js +3 -0
  49. package/dist/components/verdocs-contact-picker2.js +11 -3
  50. package/dist/components/verdocs-template-document-page2.js +1 -3
  51. package/dist/components/verdocs-template-fields2.js +2 -2
  52. package/dist/components/verdocs-template-roles.d.ts +11 -0
  53. package/dist/components/{verdocs-template-recipients.js → verdocs-template-roles.js} +20 -21
  54. package/dist/custom-elements.json +1394 -0
  55. package/dist/docs.json +133 -133
  56. package/dist/esm/{Templates-a693b275.js → Templates-f8a6628a.js} +1 -1
  57. package/dist/esm/{interact.min-e472871a.js → interact.min-097cd61a.js} +1 -1
  58. package/dist/esm/loader.js +1 -1
  59. package/dist/esm/{templateStore-a399f366.js → templateStore-5cb73464.js} +0 -1
  60. package/dist/esm/{utils-8065a62d.js → utils-107a7649.js} +3 -0
  61. package/dist/esm/verdocs-build.entry.js +2 -2
  62. package/dist/esm/verdocs-button-panel_3.entry.js +2 -2
  63. package/dist/esm/verdocs-contact-picker.entry.js +7 -2
  64. package/dist/esm/verdocs-document-page_2.entry.js +1 -1
  65. package/dist/esm/verdocs-field-attachment.entry.js +1 -1
  66. package/dist/esm/verdocs-field-checkbox.entry.js +2 -2
  67. package/dist/esm/verdocs-field-date.entry.js +2 -2
  68. package/dist/esm/verdocs-field-dropdown.entry.js +2 -2
  69. package/dist/esm/verdocs-field-initial.entry.js +2 -2
  70. package/dist/esm/verdocs-field-payment.entry.js +2 -2
  71. package/dist/esm/verdocs-field-radio-button.entry.js +2 -2
  72. package/dist/esm/verdocs-field-signature.entry.js +2 -2
  73. package/dist/esm/verdocs-field-textarea.entry.js +2 -2
  74. package/dist/esm/verdocs-field-textbox.entry.js +2 -2
  75. package/dist/esm/verdocs-field-timestamp.entry.js +2 -2
  76. package/dist/esm/verdocs-preview.entry.js +3 -3
  77. package/dist/esm/verdocs-send.entry.js +3 -3
  78. package/dist/esm/verdocs-sign.entry.js +1 -1
  79. package/dist/esm/verdocs-template-attachments.entry.js +2 -2
  80. package/dist/esm/verdocs-template-create_2.entry.js +6 -6
  81. package/dist/esm/verdocs-template-document-page.entry.js +2 -4
  82. package/dist/esm/verdocs-template-name.entry.js +2 -2
  83. package/dist/esm/verdocs-template-properties.entry.js +1 -1
  84. package/dist/esm/verdocs-template-reminders.entry.js +2 -2
  85. package/dist/esm/verdocs-template-role-properties_2.entry.js +2 -2
  86. package/dist/esm/{verdocs-template-recipients.entry.js → verdocs-template-roles.entry.js} +19 -20
  87. package/dist/esm/verdocs-template-visibility.entry.js +2 -2
  88. package/dist/esm/verdocs-view.entry.js +1 -1
  89. package/dist/esm/verdocs-web-sdk.js +1 -1
  90. package/dist/esm-es5/{Templates-a693b275.js → Templates-f8a6628a.js} +1 -1
  91. package/dist/esm-es5/{interact.min-e472871a.js → interact.min-097cd61a.js} +1 -1
  92. package/dist/esm-es5/loader.js +1 -1
  93. package/dist/esm-es5/templateStore-5cb73464.js +1 -0
  94. package/dist/esm-es5/{utils-8065a62d.js → utils-107a7649.js} +1 -1
  95. package/dist/esm-es5/verdocs-build.entry.js +1 -1
  96. package/dist/esm-es5/verdocs-button-panel_3.entry.js +1 -1
  97. package/dist/esm-es5/verdocs-contact-picker.entry.js +1 -1
  98. package/dist/esm-es5/verdocs-document-page_2.entry.js +1 -1
  99. package/dist/esm-es5/verdocs-field-attachment.entry.js +1 -1
  100. package/dist/esm-es5/verdocs-field-checkbox.entry.js +1 -1
  101. package/dist/esm-es5/verdocs-field-date.entry.js +1 -1
  102. package/dist/esm-es5/verdocs-field-dropdown.entry.js +1 -1
  103. package/dist/esm-es5/verdocs-field-initial.entry.js +1 -1
  104. package/dist/esm-es5/verdocs-field-payment.entry.js +1 -1
  105. package/dist/esm-es5/verdocs-field-radio-button.entry.js +1 -1
  106. package/dist/esm-es5/verdocs-field-signature.entry.js +1 -1
  107. package/dist/esm-es5/verdocs-field-textarea.entry.js +1 -1
  108. package/dist/esm-es5/verdocs-field-textbox.entry.js +1 -1
  109. package/dist/esm-es5/verdocs-field-timestamp.entry.js +1 -1
  110. package/dist/esm-es5/verdocs-preview.entry.js +1 -1
  111. package/dist/esm-es5/verdocs-send.entry.js +1 -1
  112. package/dist/esm-es5/verdocs-sign.entry.js +1 -1
  113. package/dist/esm-es5/verdocs-template-attachments.entry.js +1 -1
  114. package/dist/esm-es5/verdocs-template-create_2.entry.js +1 -1
  115. package/dist/esm-es5/verdocs-template-document-page.entry.js +1 -1
  116. package/dist/esm-es5/verdocs-template-name.entry.js +1 -1
  117. package/dist/esm-es5/verdocs-template-properties.entry.js +1 -1
  118. package/dist/esm-es5/verdocs-template-reminders.entry.js +1 -1
  119. package/dist/esm-es5/verdocs-template-role-properties_2.entry.js +1 -1
  120. package/dist/esm-es5/verdocs-template-roles.entry.js +1 -0
  121. package/dist/esm-es5/verdocs-template-visibility.entry.js +1 -1
  122. package/dist/esm-es5/verdocs-view.entry.js +1 -1
  123. package/dist/esm-es5/verdocs-web-sdk.js +1 -1
  124. package/dist/types/components/elements/verdocs-contact-picker/verdocs-contact-picker.d.ts +3 -0
  125. package/dist/types/components/templates/verdocs-template-recipients/{verdocs-template-recipients.d.ts → verdocs-template-roles.d.ts} +3 -3
  126. package/dist/types/components/templates/verdocs-template-recipients/{verdocs-template-recipients.stories.d.ts → verdocs-template-roles.stories.d.ts} +1 -1
  127. package/dist/types/components.d.ts +48 -48
  128. package/dist/verdocs-web-sdk/p-0048af58.system.entry.js +1 -0
  129. package/dist/verdocs-web-sdk/{p-114d885d.system.entry.js → p-014cb341.system.entry.js} +1 -1
  130. package/dist/verdocs-web-sdk/p-02061f5e.entry.js +1 -0
  131. package/dist/verdocs-web-sdk/{p-996ce975.system.entry.js → p-020a5685.system.entry.js} +1 -1
  132. package/dist/verdocs-web-sdk/{p-0513c8c3.system.js → p-03aeaebe.system.js} +1 -1
  133. package/dist/verdocs-web-sdk/{p-a20ba40a.system.entry.js → p-06201c22.system.entry.js} +1 -1
  134. package/dist/verdocs-web-sdk/{p-38d00c38.system.js → p-07f4e46f.system.js} +1 -1
  135. package/dist/verdocs-web-sdk/{p-ed9528b1.entry.js → p-1705fb61.entry.js} +1 -1
  136. package/dist/verdocs-web-sdk/{p-36dff44e.entry.js → p-187977a7.entry.js} +1 -1
  137. package/dist/verdocs-web-sdk/{p-f063451d.entry.js → p-1a3bfe8f.entry.js} +1 -1
  138. package/dist/verdocs-web-sdk/{p-966a3108.entry.js → p-1e4e776b.entry.js} +1 -1
  139. package/dist/verdocs-web-sdk/p-27cbd078.entry.js +1 -0
  140. package/dist/verdocs-web-sdk/p-28ece044.entry.js +1 -0
  141. package/dist/verdocs-web-sdk/{p-49d9e761.system.entry.js → p-292567c3.system.entry.js} +1 -1
  142. package/dist/verdocs-web-sdk/{p-ef4081e9.entry.js → p-2a5c1eb7.entry.js} +1 -1
  143. package/dist/verdocs-web-sdk/{p-4c5b7410.system.entry.js → p-2de5410a.system.entry.js} +1 -1
  144. package/dist/verdocs-web-sdk/{p-9760d335.js → p-35c46590.js} +1 -1
  145. package/dist/verdocs-web-sdk/{p-13b8ea53.system.entry.js → p-36dd9466.system.entry.js} +1 -1
  146. package/dist/verdocs-web-sdk/{p-837d3790.system.entry.js → p-3f0a7d52.system.entry.js} +1 -1
  147. package/dist/verdocs-web-sdk/{p-f0d35695.system.entry.js → p-3f3d1875.system.entry.js} +1 -1
  148. package/dist/verdocs-web-sdk/{p-b4c56faa.system.entry.js → p-4a6013d8.system.entry.js} +1 -1
  149. package/dist/verdocs-web-sdk/{p-408caf2e.entry.js → p-4cc43b69.entry.js} +1 -1
  150. package/dist/verdocs-web-sdk/{p-02951f09.entry.js → p-516ec9e9.entry.js} +1 -1
  151. package/dist/verdocs-web-sdk/{p-be65a712.entry.js → p-521211b9.entry.js} +1 -1
  152. package/dist/verdocs-web-sdk/{p-486d9b7d.system.entry.js → p-55f89a5b.system.entry.js} +1 -1
  153. package/dist/verdocs-web-sdk/{p-46c17ff0.entry.js → p-5659eb9b.entry.js} +1 -1
  154. package/dist/verdocs-web-sdk/p-5737eeb5.entry.js +1 -0
  155. package/dist/verdocs-web-sdk/{p-9775a49a.entry.js → p-58d47805.entry.js} +1 -1
  156. package/dist/verdocs-web-sdk/{p-f1465d29.entry.js → p-5b4e55a4.entry.js} +1 -1
  157. package/dist/verdocs-web-sdk/{p-64275bfd.entry.js → p-69392f27.entry.js} +1 -1
  158. package/dist/verdocs-web-sdk/{p-fbb9b6e2.system.entry.js → p-6ab80c6d.system.entry.js} +1 -1
  159. package/dist/verdocs-web-sdk/{p-3d4b366c.entry.js → p-6af151f0.entry.js} +1 -1
  160. package/dist/verdocs-web-sdk/{p-ac530c28.entry.js → p-717c36c3.entry.js} +1 -1
  161. package/dist/verdocs-web-sdk/{p-44feafae.system.entry.js → p-7be5af5d.system.entry.js} +1 -1
  162. package/dist/verdocs-web-sdk/p-7e6d7c07.system.js +1 -1
  163. package/dist/verdocs-web-sdk/{p-284ceaf4.entry.js → p-89eaf4c1.entry.js} +1 -1
  164. package/dist/verdocs-web-sdk/{p-e1b674e6.system.entry.js → p-8d1dbbcf.system.entry.js} +1 -1
  165. package/dist/verdocs-web-sdk/{p-5c39e66b.entry.js → p-96d46a1e.entry.js} +1 -1
  166. package/dist/verdocs-web-sdk/{p-8b68678c.system.entry.js → p-9aef6422.system.entry.js} +1 -1
  167. package/dist/verdocs-web-sdk/{p-aa1d72b7.entry.js → p-9b1f97f7.entry.js} +1 -1
  168. package/dist/verdocs-web-sdk/{p-45447db5.entry.js → p-9ced6cad.entry.js} +1 -1
  169. package/dist/verdocs-web-sdk/{p-dff92a1d.system.entry.js → p-a3413844.system.entry.js} +1 -1
  170. package/dist/verdocs-web-sdk/{p-b716d448.entry.js → p-a38a4e2d.entry.js} +1 -1
  171. package/dist/verdocs-web-sdk/{p-30cf9417.entry.js → p-a3ac17a5.entry.js} +1 -1
  172. package/dist/verdocs-web-sdk/{p-d0ed3251.system.entry.js → p-a72e49c5.system.entry.js} +1 -1
  173. package/dist/verdocs-web-sdk/p-a8b01bb9.js +1 -0
  174. package/dist/verdocs-web-sdk/{p-3db71b58.entry.js → p-ac079e06.entry.js} +1 -1
  175. package/dist/verdocs-web-sdk/{p-80fe8ac3.system.js → p-ad9a523d.system.js} +1 -1
  176. package/dist/verdocs-web-sdk/{p-d2711cd7.entry.js → p-affc3613.entry.js} +1 -1
  177. package/dist/verdocs-web-sdk/{p-ffcd34e8.entry.js → p-ba6fa904.entry.js} +1 -1
  178. package/dist/verdocs-web-sdk/{p-f61da49f.system.entry.js → p-bccd1f1b.system.entry.js} +1 -1
  179. package/dist/verdocs-web-sdk/{p-aec28fc8.system.entry.js → p-bd80c5b3.system.entry.js} +1 -1
  180. package/dist/verdocs-web-sdk/{p-fb8c654e.system.entry.js → p-bdfdcb0f.system.entry.js} +1 -1
  181. package/dist/verdocs-web-sdk/{p-87362bbf.system.entry.js → p-bfbca3ba.system.entry.js} +1 -1
  182. package/dist/verdocs-web-sdk/{p-3b3ba829.system.entry.js → p-c3673208.system.entry.js} +1 -1
  183. package/dist/verdocs-web-sdk/{p-49a34d3f.system.entry.js → p-c4b11cd6.system.entry.js} +1 -1
  184. package/dist/verdocs-web-sdk/{p-05581b87.system.entry.js → p-c712f51d.system.entry.js} +1 -1
  185. package/dist/verdocs-web-sdk/{p-ac91d81d.system.entry.js → p-c75f0692.system.entry.js} +1 -1
  186. package/dist/verdocs-web-sdk/{p-219174fc.system.entry.js → p-d0f9cafa.system.entry.js} +1 -1
  187. package/dist/verdocs-web-sdk/{p-58b858fc.entry.js → p-e8d924d2.entry.js} +1 -1
  188. package/dist/verdocs-web-sdk/p-e999ec0a.system.entry.js +1 -0
  189. package/dist/verdocs-web-sdk/{p-d8cea42e.system.entry.js → p-ecd33c4e.system.entry.js} +1 -1
  190. package/dist/verdocs-web-sdk/{p-25fa36d7.js → p-ee5acec4.js} +1 -1
  191. package/dist/verdocs-web-sdk/{p-340316cb.system.js → p-f0f99234.system.js} +1 -1
  192. package/dist/verdocs-web-sdk/{p-a892d5b4.js → p-fa129346.js} +1 -1
  193. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  194. package/package.json +1 -1
  195. package/dist/components/verdocs-template-recipients.d.ts +0 -11
  196. package/dist/esm-es5/templateStore-a399f366.js +0 -1
  197. package/dist/esm-es5/verdocs-template-recipients.entry.js +0 -1
  198. package/dist/verdocs-web-sdk/p-82a78fe5.system.entry.js +0 -1
  199. package/dist/verdocs-web-sdk/p-8466a97d.js +0 -1
  200. package/dist/verdocs-web-sdk/p-85ab335b.entry.js +0 -1
  201. package/dist/verdocs-web-sdk/p-87e5b9b3.entry.js +0 -1
  202. package/dist/verdocs-web-sdk/p-9871f509.entry.js +0 -1
  203. package/dist/verdocs-web-sdk/p-9d063e59.entry.js +0 -1
  204. package/dist/verdocs-web-sdk/p-c5502771.system.entry.js +0 -1
  205. /package/dist/collection/components/{elements → templates}/verdocs-template-document-page/verdocs-template-document-page.css +0 -0
  206. /package/dist/types/components/{elements → templates}/verdocs-template-document-page/verdocs-template-document-page.d.ts +0 -0
@@ -791,16 +791,6 @@ export namespace Components {
791
791
  */
792
792
  "templateId": string;
793
793
  }
794
- interface VerdocsTemplateRecipients {
795
- /**
796
- * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.
797
- */
798
- "endpoint": VerdocsEndpoint;
799
- /**
800
- * The template ID to edit.
801
- */
802
- "templateId": string;
803
- }
804
794
  interface VerdocsTemplateReminders {
805
795
  /**
806
796
  * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.
@@ -829,6 +819,16 @@ export namespace Components {
829
819
  */
830
820
  "templateId": string;
831
821
  }
822
+ interface VerdocsTemplateRoles {
823
+ /**
824
+ * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.
825
+ */
826
+ "endpoint": VerdocsEndpoint;
827
+ /**
828
+ * The template ID to edit.
829
+ */
830
+ "templateId": string;
831
+ }
832
832
  interface VerdocsTemplateSender {
833
833
  /**
834
834
  * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.
@@ -1081,10 +1081,6 @@ export interface VerdocsTemplatePropertiesCustomEvent<T> extends CustomEvent<T>
1081
1081
  detail: T;
1082
1082
  target: HTMLVerdocsTemplatePropertiesElement;
1083
1083
  }
1084
- export interface VerdocsTemplateRecipientsCustomEvent<T> extends CustomEvent<T> {
1085
- detail: T;
1086
- target: HTMLVerdocsTemplateRecipientsElement;
1087
- }
1088
1084
  export interface VerdocsTemplateRemindersCustomEvent<T> extends CustomEvent<T> {
1089
1085
  detail: T;
1090
1086
  target: HTMLVerdocsTemplateRemindersElement;
@@ -1093,6 +1089,10 @@ export interface VerdocsTemplateRolePropertiesCustomEvent<T> extends CustomEvent
1093
1089
  detail: T;
1094
1090
  target: HTMLVerdocsTemplateRolePropertiesElement;
1095
1091
  }
1092
+ export interface VerdocsTemplateRolesCustomEvent<T> extends CustomEvent<T> {
1093
+ detail: T;
1094
+ target: HTMLVerdocsTemplateRolesElement;
1095
+ }
1096
1096
  export interface VerdocsTemplateSenderCustomEvent<T> extends CustomEvent<T> {
1097
1097
  detail: T;
1098
1098
  target: HTMLVerdocsTemplateSenderElement;
@@ -1402,12 +1402,6 @@ declare global {
1402
1402
  prototype: HTMLVerdocsTemplatePropertiesElement;
1403
1403
  new (): HTMLVerdocsTemplatePropertiesElement;
1404
1404
  };
1405
- interface HTMLVerdocsTemplateRecipientsElement extends Components.VerdocsTemplateRecipients, HTMLStencilElement {
1406
- }
1407
- var HTMLVerdocsTemplateRecipientsElement: {
1408
- prototype: HTMLVerdocsTemplateRecipientsElement;
1409
- new (): HTMLVerdocsTemplateRecipientsElement;
1410
- };
1411
1405
  interface HTMLVerdocsTemplateRemindersElement extends Components.VerdocsTemplateReminders, HTMLStencilElement {
1412
1406
  }
1413
1407
  var HTMLVerdocsTemplateRemindersElement: {
@@ -1420,6 +1414,12 @@ declare global {
1420
1414
  prototype: HTMLVerdocsTemplateRolePropertiesElement;
1421
1415
  new (): HTMLVerdocsTemplateRolePropertiesElement;
1422
1416
  };
1417
+ interface HTMLVerdocsTemplateRolesElement extends Components.VerdocsTemplateRoles, HTMLStencilElement {
1418
+ }
1419
+ var HTMLVerdocsTemplateRolesElement: {
1420
+ prototype: HTMLVerdocsTemplateRolesElement;
1421
+ new (): HTMLVerdocsTemplateRolesElement;
1422
+ };
1423
1423
  interface HTMLVerdocsTemplateSenderElement extends Components.VerdocsTemplateSender, HTMLStencilElement {
1424
1424
  }
1425
1425
  var HTMLVerdocsTemplateSenderElement: {
@@ -1523,9 +1523,9 @@ declare global {
1523
1523
  "verdocs-template-fields": HTMLVerdocsTemplateFieldsElement;
1524
1524
  "verdocs-template-name": HTMLVerdocsTemplateNameElement;
1525
1525
  "verdocs-template-properties": HTMLVerdocsTemplatePropertiesElement;
1526
- "verdocs-template-recipients": HTMLVerdocsTemplateRecipientsElement;
1527
1526
  "verdocs-template-reminders": HTMLVerdocsTemplateRemindersElement;
1528
1527
  "verdocs-template-role-properties": HTMLVerdocsTemplateRolePropertiesElement;
1528
+ "verdocs-template-roles": HTMLVerdocsTemplateRolesElement;
1529
1529
  "verdocs-template-sender": HTMLVerdocsTemplateSenderElement;
1530
1530
  "verdocs-template-tags": HTMLVerdocsTemplateTagsElement;
1531
1531
  "verdocs-template-visibility": HTMLVerdocsTemplateVisibilityElement;
@@ -2595,7 +2595,7 @@ declare namespace LocalJSX {
2595
2595
  */
2596
2596
  "templateId"?: string;
2597
2597
  }
2598
- interface VerdocsTemplateRecipients {
2598
+ interface VerdocsTemplateReminders {
2599
2599
  /**
2600
2600
  * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.
2601
2601
  */
@@ -2603,25 +2603,17 @@ declare namespace LocalJSX {
2603
2603
  /**
2604
2604
  * Event fired when the user cancels the dialog.
2605
2605
  */
2606
- "onCancel"?: (event: VerdocsTemplateRecipientsCustomEvent<any>) => void;
2607
- /**
2608
- * Event fired when the user clicks to proceed.
2609
- */
2610
- "onNext"?: (event: VerdocsTemplateRecipientsCustomEvent<any>) => void;
2606
+ "onClose"?: (event: VerdocsTemplateRemindersCustomEvent<any>) => void;
2611
2607
  /**
2612
2608
  * Event fired if an error occurs. The event details will contain information about the error. Most errors will terminate the process, and the calling application should correct the condition and re-render the component.
2613
2609
  */
2614
- "onSdkError"?: (event: VerdocsTemplateRecipientsCustomEvent<SDKError>) => void;
2615
- /**
2616
- * Event fired when the template is updated in any way. May be used for tasks such as cache invalidation or reporting to other systems.
2617
- */
2618
- "onTemplateUpdated"?: (event: VerdocsTemplateRecipientsCustomEvent<{endpoint: VerdocsEndpoint; template: ITemplate; event: string}>) => void;
2610
+ "onSdkError"?: (event: VerdocsTemplateRemindersCustomEvent<SDKError>) => void;
2619
2611
  /**
2620
2612
  * The template ID to edit.
2621
2613
  */
2622
2614
  "templateId"?: string;
2623
2615
  }
2624
- interface VerdocsTemplateReminders {
2616
+ interface VerdocsTemplateRoleProperties {
2625
2617
  /**
2626
2618
  * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.
2627
2619
  */
@@ -2629,17 +2621,29 @@ declare namespace LocalJSX {
2629
2621
  /**
2630
2622
  * Event fired when the user cancels the dialog.
2631
2623
  */
2632
- "onClose"?: (event: VerdocsTemplateRemindersCustomEvent<any>) => void;
2624
+ "onClose"?: (event: VerdocsTemplateRolePropertiesCustomEvent<any>) => void;
2625
+ /**
2626
+ * Event fired when the user deletes the role. The parent should update its UI to reflect the removal. When this event is emitted, the role will have already been deleted server-side.
2627
+ */
2628
+ "onDelete"?: (event: VerdocsTemplateRolePropertiesCustomEvent<{templateId: string; roleName: string}>) => void;
2633
2629
  /**
2634
2630
  * Event fired if an error occurs. The event details will contain information about the error. Most errors will terminate the process, and the calling application should correct the condition and re-render the component.
2635
2631
  */
2636
- "onSdkError"?: (event: VerdocsTemplateRemindersCustomEvent<SDKError>) => void;
2632
+ "onSdkError"?: (event: VerdocsTemplateRolePropertiesCustomEvent<SDKError>) => void;
2633
+ /**
2634
+ * The role name to edit.
2635
+ */
2636
+ "roleName"?: string;
2637
+ /**
2638
+ * Whether the dialog is currently being displayed. This allows it to be added to the DOM before being displayed.
2639
+ */
2640
+ "sender"?: TTemplateSender;
2637
2641
  /**
2638
2642
  * The template ID to edit.
2639
2643
  */
2640
2644
  "templateId"?: string;
2641
2645
  }
2642
- interface VerdocsTemplateRoleProperties {
2646
+ interface VerdocsTemplateRoles {
2643
2647
  /**
2644
2648
  * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.
2645
2649
  */
@@ -2647,23 +2651,19 @@ declare namespace LocalJSX {
2647
2651
  /**
2648
2652
  * Event fired when the user cancels the dialog.
2649
2653
  */
2650
- "onClose"?: (event: VerdocsTemplateRolePropertiesCustomEvent<any>) => void;
2654
+ "onCancel"?: (event: VerdocsTemplateRolesCustomEvent<any>) => void;
2651
2655
  /**
2652
- * Event fired when the user deletes the role. The parent should update its UI to reflect the removal. When this event is emitted, the role will have already been deleted server-side.
2656
+ * Event fired when the user clicks to proceed.
2653
2657
  */
2654
- "onDelete"?: (event: VerdocsTemplateRolePropertiesCustomEvent<{templateId: string; roleName: string}>) => void;
2658
+ "onNext"?: (event: VerdocsTemplateRolesCustomEvent<any>) => void;
2655
2659
  /**
2656
2660
  * Event fired if an error occurs. The event details will contain information about the error. Most errors will terminate the process, and the calling application should correct the condition and re-render the component.
2657
2661
  */
2658
- "onSdkError"?: (event: VerdocsTemplateRolePropertiesCustomEvent<SDKError>) => void;
2659
- /**
2660
- * The role name to edit.
2661
- */
2662
- "roleName"?: string;
2662
+ "onSdkError"?: (event: VerdocsTemplateRolesCustomEvent<SDKError>) => void;
2663
2663
  /**
2664
- * Whether the dialog is currently being displayed. This allows it to be added to the DOM before being displayed.
2664
+ * Event fired when the template is updated in any way. May be used for tasks such as cache invalidation or reporting to other systems.
2665
2665
  */
2666
- "sender"?: TTemplateSender;
2666
+ "onTemplateUpdated"?: (event: VerdocsTemplateRolesCustomEvent<{endpoint: VerdocsEndpoint; template: ITemplate; event: string}>) => void;
2667
2667
  /**
2668
2668
  * The template ID to edit.
2669
2669
  */
@@ -2865,9 +2865,9 @@ declare namespace LocalJSX {
2865
2865
  "verdocs-template-fields": VerdocsTemplateFields;
2866
2866
  "verdocs-template-name": VerdocsTemplateName;
2867
2867
  "verdocs-template-properties": VerdocsTemplateProperties;
2868
- "verdocs-template-recipients": VerdocsTemplateRecipients;
2869
2868
  "verdocs-template-reminders": VerdocsTemplateReminders;
2870
2869
  "verdocs-template-role-properties": VerdocsTemplateRoleProperties;
2870
+ "verdocs-template-roles": VerdocsTemplateRoles;
2871
2871
  "verdocs-template-sender": VerdocsTemplateSender;
2872
2872
  "verdocs-template-tags": VerdocsTemplateTags;
2873
2873
  "verdocs-template-visibility": VerdocsTemplateVisibility;
@@ -2931,9 +2931,9 @@ declare module "@stencil/core" {
2931
2931
  "verdocs-template-fields": LocalJSX.VerdocsTemplateFields & JSXBase.HTMLAttributes<HTMLVerdocsTemplateFieldsElement>;
2932
2932
  "verdocs-template-name": LocalJSX.VerdocsTemplateName & JSXBase.HTMLAttributes<HTMLVerdocsTemplateNameElement>;
2933
2933
  "verdocs-template-properties": LocalJSX.VerdocsTemplateProperties & JSXBase.HTMLAttributes<HTMLVerdocsTemplatePropertiesElement>;
2934
- "verdocs-template-recipients": LocalJSX.VerdocsTemplateRecipients & JSXBase.HTMLAttributes<HTMLVerdocsTemplateRecipientsElement>;
2935
2934
  "verdocs-template-reminders": LocalJSX.VerdocsTemplateReminders & JSXBase.HTMLAttributes<HTMLVerdocsTemplateRemindersElement>;
2936
2935
  "verdocs-template-role-properties": LocalJSX.VerdocsTemplateRoleProperties & JSXBase.HTMLAttributes<HTMLVerdocsTemplateRolePropertiesElement>;
2936
+ "verdocs-template-roles": LocalJSX.VerdocsTemplateRoles & JSXBase.HTMLAttributes<HTMLVerdocsTemplateRolesElement>;
2937
2937
  "verdocs-template-sender": LocalJSX.VerdocsTemplateSender & JSXBase.HTMLAttributes<HTMLVerdocsTemplateSenderElement>;
2938
2938
  "verdocs-template-tags": LocalJSX.VerdocsTemplateTags & JSXBase.HTMLAttributes<HTMLVerdocsTemplateTagsElement>;
2939
2939
  "verdocs-template-visibility": LocalJSX.VerdocsTemplateVisibility & JSXBase.HTMLAttributes<HTMLVerdocsTemplateVisibilityElement>;
@@ -0,0 +1 @@
1
+ System.register(["./p-9422b807.system.js","./p-4f63fae0.system.js","./p-af2c2f79.system.js"],(function(e){"use strict";var t,o,n,i;return{setters:[function(e){t=e.r;o=e.c;n=e.h},function(e){i=e.V},function(){}],execute:function(){var a='verdocs-contact-picker{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;background-color:#ffffff}verdocs-contact-picker form{background-color:#f5f5fa;padding:12px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-contact-picker form .row{width:300px;display:-ms-flexbox;display:flex;position:relative;margin:0 0 20px 0;-ms-flex-direction:column;flex-direction:column}verdocs-contact-picker form label{display:block;font-size:14px;font-weight:500;margin:0 0 4px 0;color:#5c6575}verdocs-contact-picker form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-contact-picker form input:focus{outline:none}verdocs-contact-picker form .dropdown{left:0;right:0;top:49px;z-index:100;position:absolute;background:#ffffff;-webkit-box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1);box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1)}verdocs-contact-picker form .dropdown .suggestion{display:-ms-flexbox;display:flex;padding:6px 12px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker form .dropdown .suggestion svg{fill:#666666}verdocs-contact-picker form .dropdown .suggestion .avatar{width:48px;height:48px;-ms-flex:0 0 48px;flex:0 0 48px;margin-right:8px;border-radius:100%}verdocs-contact-picker form .dropdown .suggestion .details{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-contact-picker form .dropdown .suggestion .name{font-size:16px;font-weight:500;margin-bottom:3px;color:#092c4c}verdocs-contact-picker form .dropdown .suggestion .destination{font-size:14px;margin-bottom:3px;color:#33364b}verdocs-contact-picker form .dropdown .suggestion:hover{background:#eee;cursor:pointer}verdocs-contact-picker .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker .buttons .flex-fill{-ms-flex:1;flex:1}verdocs-contact-picker ::-webkit-input-placeholder{color:#aaaaaa}verdocs-contact-picker ::-moz-placeholder{color:#aaaaaa}verdocs-contact-picker :-ms-input-placeholder{color:#aaaaaa}verdocs-contact-picker ::-ms-input-placeholder{color:#aaaaaa}verdocs-contact-picker ::placeholder{color:#aaaaaa}verdocs-contact-picker [data-lastpass-icon-root]{display:none !important}';var s='<svg class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium MuiBox-root css-1om0hkc" focusable="false" aria-hidden="true" viewBox="0 0 24 24"><path d="M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-2 12H6v-2h12v2zm0-3H6V9h12v2zm0-3H6V6h12v2z"></path></svg>';var c='<svg class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium MuiSvgIcon-root MuiSvgIcon-fontSizeLarge css-zjt8k" focusable="false" aria-hidden="true" viewBox="0 0 24 24" data-testid="AssignmentIndIcon" tabindex="-1" title="AssignmentInd"><path d="M19 3h-4.18C14.4 1.84 13.3 1 12 1c-1.3 0-2.4.84-2.82 2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm0 4c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3zm6 12H6v-1.4c0-2 4-3.1 6-3.1s6 1.1 6 3.1V19z"></path></svg>';var l='<svg class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium MuiSvgIcon-root MuiSvgIcon-fontSizeLarge css-zjt8k" focusable="false" aria-hidden="true" viewBox="0 0 24 24" data-testid="AccountCircleIcon" tabindex="-1" title="AccountCircle"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 4c1.93 0 3.5 1.57 3.5 3.5S13.93 13 12 13s-3.5-1.57-3.5-3.5S10.07 6 12 6zm0 14c-2.03 0-4.43-.82-6.14-2.88C7.55 15.8 9.68 15 12 15s4.45.8 6.14 2.12C16.43 19.18 14.03 20 12 20z"></path></svg>';var r=e("verdocs_contact_picker",function(){function e(e){t(this,e);this.searchContacts=o(this,"searchContacts",7);this.cancel=o(this,"cancel",7);this.next=o(this,"next",7);this.endpoint=i.getDefault();this.templateRole=null;this.contactSuggestions=[];this.name=undefined;this.email=undefined;this.phone=undefined;this.message=undefined;this.showSuggestions=false;this.showMessage=false;this.delegator=false;this.nameFieldId="verdocs-contact-picker-name-".concat(Math.random().toString(36).substring(2,11));this.emailFieldId="verdocs-contact-picker-email-".concat(Math.random().toString(36).substring(2,11));this.phoneFieldId="verdocs-contact-picker-phone-".concat(Math.random().toString(36).substring(2,11))}e.prototype.componentWillLoad=function(){if(this.templateRole){this.name=this.templateRole.full_name||"";this.email=this.templateRole.email||"";this.phone=this.templateRole.phone||"";this.delegator=this.templateRole.delegator||false;this.message=this.templateRole.message||"";this.showMessage=this.message!==""}};e.prototype.handleNameChange=function(e){var t;this.name=e.target.value;(t=this.searchContacts)===null||t===void 0?void 0:t.emit({query:this.name})};e.prototype.handleEmailChange=function(e){this.email=e.target.value};e.prototype.handlePhoneChange=function(e){this.phone=e.target.value};e.prototype.handleMessageChange=function(e){this.message=e.target.value};e.prototype.handleCancel=function(e){var t;e.stopPropagation();this.showSuggestions=false;(t=this.cancel)===null||t===void 0?void 0:t.emit()};e.prototype.handleSubmit=function(e){var t;e.stopPropagation();this.showSuggestions=false;(t=this.next)===null||t===void 0?void 0:t.emit({full_name:this.name,email:this.email,phone:this.phone,message:this.message,delegator:this.delegator})};e.prototype.handleSelectSuggestion=function(e,t){e.stopPropagation();this.name=t.name;this.email=t.email;this.phone=t.phone;this.showSuggestions=false};e.prototype.render=function(){var e=this;return n("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},n("div",{class:"row"},n("label",{htmlFor:this.nameFieldId},"Name:"),n("input",{id:this.nameFieldId,name:this.nameFieldId,type:"text","data-lpignore":"true",autocomplete:"blocked",value:this.name,placeholder:"Recipient Name...",onFocus:function(){var t;return e.showSuggestions=((t=e.contactSuggestions)===null||t===void 0?void 0:t.length)>0},onInput:function(t){return e.handleNameChange(t)}}),this.showSuggestions&&n("div",{class:"dropdown"},this.contactSuggestions.map((function(t){var o;return n("div",{key:(o=t.id)!==null&&o!==void 0?o:t.name,class:"suggestion",onClick:function(o){return e.handleSelectSuggestion(o,t)}},t.avatar?n("img",{alt:"Avatar",class:"avatar",src:t.avatar}):n("div",{class:"avatar",innerHTML:l}),n("div",{class:"details"},n("div",{class:"name"},t.name),t.email&&n("div",{class:"destination"},t.email),t.phone&&n("div",{class:"destination"},t.phone)))})))),n("div",{class:"row"},n("label",{htmlFor:this.emailFieldId},"Email:"),n("input",{id:this.emailFieldId,name:this.emailFieldId,type:"text","data-lpignore":"true",autoComplete:"blocked",value:this.email,placeholder:"Email Address...",onFocus:function(){return e.showSuggestions=false},onInput:function(t){return e.handleEmailChange(t)}})),n("div",{class:"row"},n("label",{htmlFor:this.phoneFieldId},"Phone:"),n("input",{id:this.phoneFieldId,name:this.phoneFieldId,type:"text","data-lpignore":"true",autoComplete:"blocked",value:this.phone,placeholder:"Phone Number...",onFocus:function(){return e.showSuggestions=false},onInput:function(t){return e.handlePhoneChange(t)}})),this.showMessage&&n("div",{class:"row"},n("label",{htmlFor:"verdocs-contact-picker-message"},"Message:"),n("input",{id:"verdocs-contact-picker-message",name:"verdocs-contact-picker-message",type:"text","data-lpignore":"true",autocomplete:"blocked",value:this.message,placeholder:"Invitation Message...",onFocus:function(){return e.showSuggestions=false},onInput:function(t){return e.handleMessageChange(t)}})),n("div",{class:"buttons"},n("verdocs-toggle-button",{icon:s,size:"small",active:this.showMessage,onToggle:function(t){e.showMessage=t.detail.active;e.showSuggestions=false}}),n("verdocs-toggle-button",{icon:c,size:"small",active:this.delegator,onToggle:function(t){e.delegator=t.detail.active;e.showSuggestions=false}}),n("div",{class:"flex-fill"}),n("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:function(t){return e.handleCancel(t)}}),n("verdocs-button",{label:"OK",size:"small",onClick:function(t){return e.handleSubmit(t)}})))};return e}());r.style=a}}}));
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(e,t,n,i){function r(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i["throw"](e))}catch(e){o(e)}}function l(e){e.done?n(e.value):r(e.value).then(s,a)}l((i=i.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,r,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(e){return function(t){return l([e,t])}}function l(s){if(i)throw new TypeError("Generator is already executing.");while(n)try{if(i=1,r&&(o=s[0]&2?r["return"]:s[0]?r["throw"]||((o=r["return"])&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;if(r=0,o)s=[s[0]&2,o.value];switch(s[0]){case 0:case 1:o=s;break;case 4:n.label++;return{value:s[1],done:false};case 5:n.label++;r=s[1];s=[0];continue;case 7:s=n.ops.pop();n.trys.pop();continue;default:if(!(o=n.trys,o=o.length>0&&o[o.length-1])&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!o||s[1]>o[0]&&s[1]<o[3])){n.label=s[1];break}if(s[0]===6&&n.label<o[1]){n.label=o[1];o=s;break}if(o&&n.label<o[2]){n.label=o[2];n.ops.push(s);break}if(o[2])n.ops.pop();n.trys.pop();continue}s=t.call(e,n)}catch(e){s=[6,e];r=0}finally{i=o=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var i=0,r=t.length,o;i<r;i++){if(o||!(i in t)){if(!o)o=Array.prototype.slice.call(t,0,i);o[i]=t[i]}}return e.concat(o||Array.prototype.slice.call(t))};System.register(["./p-9422b807.system.js","./p-e764098e.system.js","./p-4f63fae0.system.js","./p-7efdefa3.system.js","./p-d50523fd.system.js","./p-38d00c38.system.js","./p-f8eddf94.system.js","./p-187b20b7.system.js","./p-af2c2f79.system.js","./p-327858f0.system.js","./p-51a3ea62.system.js","./p-71c7e1ba.system.js","./p-69912cbf.system.js"],(function(e){"use strict";var t,n,i,r,o,s,a,l,d,c,u,p,h,f,v,g,m,b,x,y,w;return{setters:[function(e){t=e.r;n=e.c;i=e.h;r=e.H;o=e.F},function(e){s=e.c;a=e.u;l=e.d;d=e.e},function(e){c=e.V},function(e){u=e.a;p=e.i},function(e){h=e.f},function(e){f=e.s;v=e.u;g=e.a;m=e.r;b=e.b},function(e){x=e.g;y=e.s},function(e){w=e.S},function(){},function(){},function(){},function(){},function(){}],execute:function(){var k=undefined&&undefined.__awaiter||function(e,t,n,i){function r(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i["throw"](e))}catch(e){o(e)}}function l(e){e.done?n(e.value):r(e.value).then(s,a)}l((i=i.apply(e,t||[])).next())}))};var I=undefined&&undefined.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,r,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(e){return function(t){return l([e,t])}}function l(a){if(i)throw new TypeError("Generator is already executing.");while(s&&(s=0,a[0]&&(n=0)),n)try{if(i=1,r&&(o=a[0]&2?r["return"]:a[0]?r["throw"]||((o=r["return"])&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;if(r=0,o)a=[a[0]&2,o.value];switch(a[0]){case 0:case 1:o=a;break;case 4:n.label++;return{value:a[1],done:false};case 5:n.label++;r=a[1];a=[0];continue;case 7:a=n.ops.pop();n.trys.pop();continue;default:if(!(o=n.trys,o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){n=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){n.label=a[1];break}if(a[0]===6&&n.label<o[1]){n.label=o[1];o=a;break}if(o&&n.label<o[2]){n.label=o[2];n.ops.push(a);break}if(o[2])n.ops.pop();n.trys.pop();continue}a=t.call(e,n)}catch(e){a=[6,e];r=0}finally{i=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};var S=function(e,t,n,i){return k(void 0,void 0,void 0,(function(){return I(this,(function(r){return[2,e.api.put("/envelopes/".concat(t,"/recipients/").concat(n),i).then((function(e){return e.data}))]}))}))};var F=function(e,t,n){return S(e,t,n,{action:"submit"})};var _=function(e,t,n){return S(e,t,n,{action:"decline"})};var N=function(e,t,n,i){return S(e,t,n,{action:"update",agreed:i})};var L=function(e,t,n){var i=new FormData;i.append("signature",n,t);return e.api.post("/signatures",i).then((function(e){return e.data}))};var D=function(e,t,n){var i=new FormData;i.append("initial",n,t);return e.api.post("/initials",i).then((function(e){return e.data}))};var A='verdocs-sign{display:-ms-flexbox;display:flex;overflow:hidden;position:relative;min-height:600px;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-sign div{display:block;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-sign input{vertical-align:top}verdocs-sign .header{color:#fff;display:-ms-flexbox;display:flex;z-index:1000;-ms-flex:0 0 56px;flex:0 0 56px;padding:0 15px;font-size:12px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-webkit-transition:all 0.25s;transition:all 0.25s;background-color:#33354c;-webkit-box-shadow:0 4px 4px 0 rgba(0, 0, 0, 0.24), 0 0 4px 0 rgba(0, 0, 0, 0.12);box-shadow:0 4px 4px 0 rgba(0, 0, 0, 0.24), 0 0 4px 0 rgba(0, 0, 0, 0.12)}verdocs-sign .header .logo{width:80px;display:none;margin:-6px 0 0 10px}verdocs-sign .header .title{padding-left:16px;font-size:18px;font-weight:500;text-overflow:ellipsis;white-space:nowrap}verdocs-sign .intro{width:100%;display:-ms-flexbox;display:flex;-ms-flex:0 0 60px;flex:0 0 60px;color:#111111;padding:0 15px;font-size:18px;font-weight:500;line-height:28px;-ms-flex-direction:row;flex-direction:row;background:#ffffff;-ms-flex-align:center;align-items:center}verdocs-sign .cover{top:0;left:0;right:0;bottom:0;z-index:999;position:absolute;background:rgba(0, 0, 0, 0.5)}verdocs-sign>.document{-ms-flex:1;flex:1;height:100%;display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;min-height:200px;position:relative;overflow-y:scroll;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center}verdocs-sign>.document .inner{width:100%;max-width:1028px}verdocs-sign .agree{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;padding:0 15px}verdocs-sign .agree .intro{display:none}verdocs-sign .agree .header{-ms-flex:0 0 56px;flex:0 0 56px}@media print{verdocs-sign .header{display:none}}';var E=[{id:"later",label:"Finish Later"},{id:"decline",label:"Decline to Sign"},{id:"print",label:"Print Without Signing"},{id:"download",label:"Download"}];var C=[{id:"print",label:"Print"},{id:"download",label:"Download"}];var P=e("verdocs_sign",function(){function e(e){t(this,e);this.sdkError=n(this,"sdkError",7);this.envelopeLoaded=n(this,"envelopeLoaded",7);this.envelopeUpdated=n(this,"envelopeUpdated",7);this.endpoint=null;this.recipientIndex=-1;this.envelopeId=null;this.roleId=null;this.inviteCode=null;this.recipient=null;this.signerToken=null;this.hasSignature=false;this.nextButtonLabel="Start";this.nextSubmits=false;this.errorMessage="";this.focusedField="";this.isDone=false;this.showDone=false;this.finishLater=false;this.showFinishLater=false;this.agreed=false;this.documentsSingularPlural="document"}e.prototype.componentWillLoad=function(){this.endpoint=new c({sessionType:"signing"})};e.prototype.componentDidLoad=function(){return k(this,void 0,void 0,(function(){var e,t,n,i,r,o,a,l,d,c,u,p;var h=this;return I(this,(function(f){switch(f.label){case 0:if(!this.envelopeId){(e=this.sdkError)===null||e===void 0?void 0:e.emit(new w("[SIGN] Missing required envelopId",500,""));return[2]}if(!this.roleId){(t=this.sdkError)===null||t===void 0?void 0:t.emit(new w("[SIGN] Missing required roleId",500,""));return[2]}if(!this.inviteCode){(n=this.sdkError)===null||n===void 0?void 0:n.emit(new w("[SIGN] Missing required inviteCode",500,""));return[2]}f.label=1;case 1:f.trys.push([1,4,,5]);console.log("[SIGN] Processing invite code for ".concat(this.envelopeId," / ").concat(this.roleId));return[4,s(this.endpoint,{envelopeId:this.envelopeId,roleId:this.roleId,inviteCode:this.inviteCode})];case 2:l=f.sent(),d=l.session,c=l.recipient,u=l.signerToken;console.log("[SIGN] Loaded signing session ".concat(d.email," / ").concat(d.profile_id));this.recipient=c;console.log("[SIGN] We are recipient",this.recipient);this.signerToken=u;this.endpoint.setToken(u);if(this.agreed){this.nextButtonLabel="Next"}return[4,x(this.endpoint,this.envelopeId)];case 3:f.sent();if(y.envelope.documents.length>0){this.documentsSingularPlural="document(s)"}this.recipientIndex=y.envelope.recipients.findIndex((function(e){return e.role_name==h.roleId}));if(this.recipientIndex>-1){this.recipient=y.envelope.recipients[this.recipientIndex];this.agreed=this.recipient.agreed;console.log("[SIGN] Found our recipient in the envelope",this.recipientIndex,this.recipient)}else{console.log("[SIGN] Could not find our recipient record",this.roleId,y.envelope.recipients)}this.isDone=["submitted","canceled","declined"].includes(this.recipient.status);(i=this.envelopeLoaded)===null||i===void 0?void 0:i.emit({endpoint:this.endpoint,envelope:y.envelope});return[3,5];case 4:p=f.sent();console.log("Error with signing session",p);(r=this.sdkError)===null||r===void 0?void 0:r.emit(new w(p.message,(o=p.response)===null||o===void 0?void 0:o.status,(a=p.response)===null||a===void 0?void 0:a.data));return[3,5];case 5:return[2]}}))}))};e.prototype.handleClickAgree=function(){var e=this;N(this.endpoint,this.envelopeId,this.roleId,true).then((function(){var t;e.nextButtonLabel="Next";e.agreed=true;(t=e.envelopeUpdated)===null||t===void 0?void 0:t.emit({endpoint:e.endpoint,envelope:y.envelope,event:"agreed"})})).catch((function(t){var n,i,r;console.log("Update failure",t);(n=e.sdkError)===null||n===void 0?void 0:n.emit(new w(t.message,(i=t.response)===null||i===void 0?void 0:i.status,(r=t.response)===null||r===void 0?void 0:r.data))}))};e.prototype.handleOptionSelected=function(e){return k(this,void 0,void 0,(function(){var t,n,i,r,o,s,a;return I(this,(function(l){switch(l.label){case 0:s=e.detail.id;switch(s){case"later":return[3,1];case"claim":return[3,2];case"decline":return[3,3];case"print":return[3,5];case"download":return[3,6]}return[3,7];case 1:this.finishLater=true;this.showFinishLater=true;(t=this.envelopeUpdated)===null||t===void 0?void 0:t.emit({endpoint:this.endpoint,envelope:y.envelope,event:"later"});return[3,7];case 2:window.alert("This feature will be available in an upcoming release.");(n=this.envelopeUpdated)===null||n===void 0?void 0:n.emit({endpoint:this.endpoint,envelope:y.envelope,event:"claimed"});return[3,7];case 3:return[4,_(this.endpoint,this.envelopeId,this.roleId)];case 4:a=l.sent();console.log("Decline result",a);(i=this.envelopeUpdated)===null||i===void 0?void 0:i.emit({endpoint:this.endpoint,envelope:y.envelope,event:"declined"});this.isDone=true;return[3,7];case 5:window.print();(r=this.envelopeUpdated)===null||r===void 0?void 0:r.emit({endpoint:this.endpoint,envelope:y.envelope,event:"printed"});return[3,7];case 6:f(this.endpoint,y.envelope,y.envelope.envelope_document_id).catch((function(e){console.log("Error downloading PDF",e)}));(o=this.envelopeUpdated)===null||o===void 0?void 0:o.emit({endpoint:this.endpoint,envelope:y.envelope,event:"downloaded"});return[3,7];case 7:return[2]}}))}))};e.prototype.updateRecipientFieldValue=function(e,t){this.recipient.fields.forEach((function(n){if(n.name===e){n.settings=t.settings;v(n)}}))};e.prototype.saveFieldChange=function(e,t){var n=this;a(this.endpoint,this.envelopeId,e,t).then((function(t){n.updateRecipientFieldValue(e,t)})).catch((function(e){var t,i,r,o,s,a;if(((t=e.response)===null||t===void 0?void 0:t.status)===401&&((r=(i=e.response)===null||i===void 0?void 0:i.data)===null||r===void 0?void 0:r.error)==="jwt expired"){console.log("[SIGN] Signing session expired");n.errorMessage="Signing session expired. Please reload your browser to continue."}else{console.log("[SIGN] Server error",e)}(o=n.sdkError)===null||o===void 0?void 0:o.emit(new w(e.message,(s=e.response)===null||s===void 0?void 0:s.status,(a=e.response)===null||a===void 0?void 0:a.data))}))};e.prototype.handleFieldChange=function(e,t){return k(this,void 0,void 0,(function(){var n,i,r,o,s,s,a,c,u;var p=this;return I(this,(function(h){switch(h.label){case 0:n=t.target,i=n.value,r=n.checked;o=e.type;switch(o){case"textbox":return[3,1];case"checkbox_group":return[3,2];case"radio_button_group":return[3,3];case"dropdown":return[3,4];case"initial":return[3,5];case"signature":return[3,8];case"date":return[3,11];case"timestamp":return[3,12]}return[3,13];case 1:return[2,this.saveFieldChange(e.name,{prepared:false,value:i})];case 2:{s=e.settings.options.map((function(e){return{id:e.id,checked:t.target.checked}}));return[2,this.saveFieldChange(e.name,{prepared:false,value:{options:s}})]}h.label=3;case 3:{s=e.settings.options.map((function(e){return{id:e.id,selected:t.target.value===e.id}}));return[2,this.saveFieldChange(e.name,{prepared:false,value:{options:s}})]}h.label=4;case 4:return[2,this.saveFieldChange(e.name,{prepared:false,value:t.detail})];case 5:return[4,fetch(t.detail)];case 6:return[4,h.sent().blob()];case 7:a=h.sent();return[2,D(this.endpoint,"initial",a).then((function(t){return k(p,void 0,void 0,(function(){var n;return I(this,(function(i){switch(i.label){case 0:return[4,d(this.endpoint,this.envelopeId,e.name,t.id)];case 1:n=i.sent();this.updateRecipientFieldValue(e.name,n);return[2]}}))}))}))];case 8:return[4,fetch(t.detail)];case 9:return[4,h.sent().blob()];case 10:c=h.sent();return[2,L(this.endpoint,"signature",c).then((function(t){return k(p,void 0,void 0,(function(){var n;return I(this,(function(i){switch(i.label){case 0:return[4,l(this.endpoint,this.envelopeId,e.name,t.id)];case 1:n=i.sent();this.updateRecipientFieldValue(e.name,n);return[2]}}))}))}))];case 11:u=t.target.getAttribute("iso");return[2,this.saveFieldChange(e.name,{prepared:false,value:u})];case 12:console.log("Updating timestamp",{value:i,ts:t.target.getAttribute("timestamp")});return[3,14];case 13:console.log("Unhandled field update",{value:i,checked:r},e);return[3,14];case 14:return[2]}}))}))};e.prototype.isFieldValid=function(e){var t,n,i,r,o,s,a;var l=e.required,d=l===void 0?false:l;var c=e.settings||{},h=c.result,f=h===void 0?"":h,v=c.value,g=v===void 0?"":v,m=c.base64,b=m===void 0?"":m;switch(e.type){case"textbox":switch(((t=e.settings)===null||t===void 0?void 0:t.validator)||""){case"email":return p(f);case"phone":return u(f);default:return!d||f!==""}case"signature":case"initial":return!d||b!=="";case"timestamp":return true;case"textarea":case"date":case"attachment":return!d||f!=="";case"dropdown":return!d||g!=="";case"checkbox_group":var x=(((i=(n=e.settings)===null||n===void 0?void 0:n.options)===null||i===void 0?void 0:i.filter((function(e){return e.checked})))||[]).length;return!d||x>=(((r=e.settings)===null||r===void 0?void 0:r.minimum_checked)||0)&&x<=(((o=e.settings)===null||o===void 0?void 0:o.maximum_checked)||999);case"radio_button_group":return!d||(((a=(s=e.settings)===null||s===void 0?void 0:s.options)===null||a===void 0?void 0:a.filter((function(e){return e.selected})))||[]).length>0;default:return false}};e.prototype.handleNext=function(){return k(this,void 0,void 0,(function(){var e,t,n,i,r,o,s,a,l,d;var c=this;return I(this,(function(u){switch(u.label){case 0:if(!this.nextSubmits)return[3,5];u.label=1;case 1:u.trys.push([1,3,,4]);return[4,F(this.endpoint,this.envelopeId,this.roleId)];case 2:t=u.sent();console.log("[SIGN] Submitted successfully",t);this.showDone=true;this.isDone=true;return[3,4];case 3:n=u.sent();console.log("Error submitting",n);return[3,4];case 4:return[2];case 5:i=this.recipient.fields.filter((function(e){return e.required}));r=i.findIndex((function(e){return e.name===c.focusedField}));o=r+1;if(o>=i.length){o=0}s=i[o];a=0;if(a<i.length&&["signature","initial"].includes(s.type)&&((e=s.settings)===null||e===void 0?void 0:e.result)==="signed"){a++;o++;if(o>=i.length){o=0}s=i[o]}if(a>=i.length){s=null}if(s){l=b(s);d=document.getElementById(l);d===null||d===void 0?void 0:d.focusField();this.focusedField=s.name}return[2]}}))}))};e.prototype.checkRecipientFields=function(){var e=this;var t=this.recipient.fields.filter((function(t){return!e.isFieldValid(t)}));if(t.length<1){this.nextButtonLabel="Finish";this.nextSubmits=true}else{console.log("[SIGN] Remaining invalid fields",t);this.nextButtonLabel="Next";this.nextSubmits=false}};e.prototype.attachFieldAttributes=function(e,t,n,i){var r=this;var o;i.addEventListener("input",(function(){return r.checkRecipientFields()}));i.addEventListener("focusout",(function(e){return r.handleFieldChange(t,e).finally((function(){return r.checkRecipientFields()}))}));i.addEventListener("fieldChange",(function(e){return r.handleFieldChange(t,e).finally((function(){return r.checkRecipientFields()}))}));i.setAttribute("roleindex",n);i.setAttribute("xScale",e.xScale);i.setAttribute("yScale",e.yScale);i.setAttribute("initials",this.recipient?h(this.recipient.full_name):"");i.setAttribute("name",((o=this.recipient)===null||o===void 0?void 0:o.full_name)||"")};e.prototype.handlePageRendered=function(e){var t=this;var n=e.detail;var i=g(y.roleNames,this.recipient.role_name);var r=this.recipient.fields.filter((function(e){return e.page===n.pageNumber}));console.log("[SIGN] Page rendered, updating fields",{pageInfo:n,roleIndex:i,recipientFields:r});r.forEach((function(e){var r=m(e,n,i,{disabled:false,editable:false,draggable:false,done:t.isDone});if(!r){return}if(Array.isArray(r)){r.map((function(r){return t.attachFieldAttributes(n,e,i,r)}))}else{t.attachFieldAttributes(n,e,i,r)}}));y.envelope.recipients.filter((function(e){return e.role_name!==t.recipient.role_name})).forEach((function(e){var i=g(y.roleNames,e.role_name);var r=e.fields.filter((function(e){return e.page===n.pageNumber}));r.forEach((function(e){var r=m(e,n,i,{disabled:true,editable:false,draggable:false,done:t.isDone});if(!r){return}if(r.setAttribute){r.setAttribute("roleindex",i);r.setAttribute("xScale",n.xScale);r.setAttribute("yScale",n.yScale)}}))}));this.checkRecipientFields()};e.prototype.render=function(){var e=this;if(y.loading||!y.envelope){return i(r,null,i("verdocs-loader",null))}return i(r,{class:{agreed:this.agreed},"data-r":y.updateCount},!this.isDone&&!this.finishLater&&i("div",{class:"intro"},"Please review and act on these documents."),!this.isDone&&i("div",{class:"header"},!this.agreed?i("div",{class:"agree"},i("verdocs-checkbox",{name:"agree",label:"I agree to use electronic records and signatures.",onInput:function(){return e.handleClickAgree()}})):i(o,null,i("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),i("div",{class:"title"},y.envelope.name),i("div",{style:{flex:"1"}})),!this.isDone&&!this.finishLater&&i("verdocs-button",{size:"small",label:this.nextButtonLabel,disabled:!this.agreed,onClick:function(){return e.handleNext()}}),i("div",{style:{marginLeft:"10px"}}),i("verdocs-dropdown",{options:!this.isDone&&!this.finishLater?E:C,onOptionSelected:function(t){return e.handleOptionSelected(t)}})),!this.isDone&&!this.agreed?i("div",{class:"cover"}):i("div",{style:{display:"none"}}),this.isDone?i("verdocs-view",{endpoint:this.endpoint,envelopeId:this.envelopeId,onSdkError:function(t){var n;return(n=e.sdkError)===null||n===void 0?void 0:n.emit(t.detail)}}):i("div",{class:"document"},(y.envelope.documents||[]).map((function(t){var n=__spreadArray([],(t===null||t===void 0?void 0:t.pages)||[],true);n.sort((function(e,t){return e.sequence-t.sequence}));return i(o,null,n.map((function(t){var n;var r=(n=y.template)===null||n===void 0?void 0:n.pages.find((function(e){return e.sequence===t.sequence}));return i("verdocs-document-page",{pageImageUri:(r===null||r===void 0?void 0:r.display_uri)||t.display_uri,virtualWidth:612,virtualHeight:792,pageNumber:t.sequence,onPageRendered:function(t){return e.handlePageRendered(t)},layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})})))}))),this.showFinishLater&&i("verdocs-ok-dialog",{heading:"You've saved your document to finish later.",message:"To complete the ".concat(this.documentsSingularPlural,", use the link in the original email notification inviting you to review and finish the document."),onNext:function(){return e.showFinishLater=false}}),this.errorMessage&&i("verdocs-ok-dialog",{heading:"Network Error",message:this.errorMessage,onNext:function(){return e.errorMessage=""}}),this.showDone&&i("verdocs-ok-dialog",{heading:"You're Done!",message:"You can access the ".concat(this.documentsSingularPlural," at any time by clicking on the link from the invitation email.<br /><br />After all recipients have completed their actions, you will receive an email with the document and envelope certificate attached."),onNext:function(){return e.showDone=false}}))};return e}());P.style=A}}}));
1
+ var __awaiter=this&&this.__awaiter||function(e,t,n,i){function r(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i["throw"](e))}catch(e){o(e)}}function l(e){e.done?n(e.value):r(e.value).then(s,a)}l((i=i.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,r,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(e){return function(t){return l([e,t])}}function l(s){if(i)throw new TypeError("Generator is already executing.");while(n)try{if(i=1,r&&(o=s[0]&2?r["return"]:s[0]?r["throw"]||((o=r["return"])&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;if(r=0,o)s=[s[0]&2,o.value];switch(s[0]){case 0:case 1:o=s;break;case 4:n.label++;return{value:s[1],done:false};case 5:n.label++;r=s[1];s=[0];continue;case 7:s=n.ops.pop();n.trys.pop();continue;default:if(!(o=n.trys,o=o.length>0&&o[o.length-1])&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!o||s[1]>o[0]&&s[1]<o[3])){n.label=s[1];break}if(s[0]===6&&n.label<o[1]){n.label=o[1];o=s;break}if(o&&n.label<o[2]){n.label=o[2];n.ops.push(s);break}if(o[2])n.ops.pop();n.trys.pop();continue}s=t.call(e,n)}catch(e){s=[6,e];r=0}finally{i=o=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var i=0,r=t.length,o;i<r;i++){if(o||!(i in t)){if(!o)o=Array.prototype.slice.call(t,0,i);o[i]=t[i]}}return e.concat(o||Array.prototype.slice.call(t))};System.register(["./p-9422b807.system.js","./p-e764098e.system.js","./p-4f63fae0.system.js","./p-7efdefa3.system.js","./p-d50523fd.system.js","./p-07f4e46f.system.js","./p-f8eddf94.system.js","./p-187b20b7.system.js","./p-af2c2f79.system.js","./p-327858f0.system.js","./p-51a3ea62.system.js","./p-71c7e1ba.system.js","./p-69912cbf.system.js"],(function(e){"use strict";var t,n,i,r,o,s,a,l,d,c,u,p,h,f,v,g,m,b,x,y,w;return{setters:[function(e){t=e.r;n=e.c;i=e.h;r=e.H;o=e.F},function(e){s=e.c;a=e.u;l=e.d;d=e.e},function(e){c=e.V},function(e){u=e.a;p=e.i},function(e){h=e.f},function(e){f=e.s;v=e.u;g=e.a;m=e.r;b=e.b},function(e){x=e.g;y=e.s},function(e){w=e.S},function(){},function(){},function(){},function(){},function(){}],execute:function(){var k=undefined&&undefined.__awaiter||function(e,t,n,i){function r(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i["throw"](e))}catch(e){o(e)}}function l(e){e.done?n(e.value):r(e.value).then(s,a)}l((i=i.apply(e,t||[])).next())}))};var I=undefined&&undefined.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,r,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(e){return function(t){return l([e,t])}}function l(a){if(i)throw new TypeError("Generator is already executing.");while(s&&(s=0,a[0]&&(n=0)),n)try{if(i=1,r&&(o=a[0]&2?r["return"]:a[0]?r["throw"]||((o=r["return"])&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;if(r=0,o)a=[a[0]&2,o.value];switch(a[0]){case 0:case 1:o=a;break;case 4:n.label++;return{value:a[1],done:false};case 5:n.label++;r=a[1];a=[0];continue;case 7:a=n.ops.pop();n.trys.pop();continue;default:if(!(o=n.trys,o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){n=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){n.label=a[1];break}if(a[0]===6&&n.label<o[1]){n.label=o[1];o=a;break}if(o&&n.label<o[2]){n.label=o[2];n.ops.push(a);break}if(o[2])n.ops.pop();n.trys.pop();continue}a=t.call(e,n)}catch(e){a=[6,e];r=0}finally{i=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};var S=function(e,t,n,i){return k(void 0,void 0,void 0,(function(){return I(this,(function(r){return[2,e.api.put("/envelopes/".concat(t,"/recipients/").concat(n),i).then((function(e){return e.data}))]}))}))};var F=function(e,t,n){return S(e,t,n,{action:"submit"})};var _=function(e,t,n){return S(e,t,n,{action:"decline"})};var N=function(e,t,n,i){return S(e,t,n,{action:"update",agreed:i})};var L=function(e,t,n){var i=new FormData;i.append("signature",n,t);return e.api.post("/signatures",i).then((function(e){return e.data}))};var D=function(e,t,n){var i=new FormData;i.append("initial",n,t);return e.api.post("/initials",i).then((function(e){return e.data}))};var A='verdocs-sign{display:-ms-flexbox;display:flex;overflow:hidden;position:relative;min-height:600px;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-sign div{display:block;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-sign input{vertical-align:top}verdocs-sign .header{color:#fff;display:-ms-flexbox;display:flex;z-index:1000;-ms-flex:0 0 56px;flex:0 0 56px;padding:0 15px;font-size:12px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-webkit-transition:all 0.25s;transition:all 0.25s;background-color:#33354c;-webkit-box-shadow:0 4px 4px 0 rgba(0, 0, 0, 0.24), 0 0 4px 0 rgba(0, 0, 0, 0.12);box-shadow:0 4px 4px 0 rgba(0, 0, 0, 0.24), 0 0 4px 0 rgba(0, 0, 0, 0.12)}verdocs-sign .header .logo{width:80px;display:none;margin:-6px 0 0 10px}verdocs-sign .header .title{padding-left:16px;font-size:18px;font-weight:500;text-overflow:ellipsis;white-space:nowrap}verdocs-sign .intro{width:100%;display:-ms-flexbox;display:flex;-ms-flex:0 0 60px;flex:0 0 60px;color:#111111;padding:0 15px;font-size:18px;font-weight:500;line-height:28px;-ms-flex-direction:row;flex-direction:row;background:#ffffff;-ms-flex-align:center;align-items:center}verdocs-sign .cover{top:0;left:0;right:0;bottom:0;z-index:999;position:absolute;background:rgba(0, 0, 0, 0.5)}verdocs-sign>.document{-ms-flex:1;flex:1;height:100%;display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;min-height:200px;position:relative;overflow-y:scroll;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center}verdocs-sign>.document .inner{width:100%;max-width:1028px}verdocs-sign .agree{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;padding:0 15px}verdocs-sign .agree .intro{display:none}verdocs-sign .agree .header{-ms-flex:0 0 56px;flex:0 0 56px}@media print{verdocs-sign .header{display:none}}';var E=[{id:"later",label:"Finish Later"},{id:"decline",label:"Decline to Sign"},{id:"print",label:"Print Without Signing"},{id:"download",label:"Download"}];var C=[{id:"print",label:"Print"},{id:"download",label:"Download"}];var P=e("verdocs_sign",function(){function e(e){t(this,e);this.sdkError=n(this,"sdkError",7);this.envelopeLoaded=n(this,"envelopeLoaded",7);this.envelopeUpdated=n(this,"envelopeUpdated",7);this.endpoint=null;this.recipientIndex=-1;this.envelopeId=null;this.roleId=null;this.inviteCode=null;this.recipient=null;this.signerToken=null;this.hasSignature=false;this.nextButtonLabel="Start";this.nextSubmits=false;this.errorMessage="";this.focusedField="";this.isDone=false;this.showDone=false;this.finishLater=false;this.showFinishLater=false;this.agreed=false;this.documentsSingularPlural="document"}e.prototype.componentWillLoad=function(){this.endpoint=new c({sessionType:"signing"})};e.prototype.componentDidLoad=function(){return k(this,void 0,void 0,(function(){var e,t,n,i,r,o,a,l,d,c,u,p;var h=this;return I(this,(function(f){switch(f.label){case 0:if(!this.envelopeId){(e=this.sdkError)===null||e===void 0?void 0:e.emit(new w("[SIGN] Missing required envelopId",500,""));return[2]}if(!this.roleId){(t=this.sdkError)===null||t===void 0?void 0:t.emit(new w("[SIGN] Missing required roleId",500,""));return[2]}if(!this.inviteCode){(n=this.sdkError)===null||n===void 0?void 0:n.emit(new w("[SIGN] Missing required inviteCode",500,""));return[2]}f.label=1;case 1:f.trys.push([1,4,,5]);console.log("[SIGN] Processing invite code for ".concat(this.envelopeId," / ").concat(this.roleId));return[4,s(this.endpoint,{envelopeId:this.envelopeId,roleId:this.roleId,inviteCode:this.inviteCode})];case 2:l=f.sent(),d=l.session,c=l.recipient,u=l.signerToken;console.log("[SIGN] Loaded signing session ".concat(d.email," / ").concat(d.profile_id));this.recipient=c;console.log("[SIGN] We are recipient",this.recipient);this.signerToken=u;this.endpoint.setToken(u);if(this.agreed){this.nextButtonLabel="Next"}return[4,x(this.endpoint,this.envelopeId)];case 3:f.sent();if(y.envelope.documents.length>0){this.documentsSingularPlural="document(s)"}this.recipientIndex=y.envelope.recipients.findIndex((function(e){return e.role_name==h.roleId}));if(this.recipientIndex>-1){this.recipient=y.envelope.recipients[this.recipientIndex];this.agreed=this.recipient.agreed;console.log("[SIGN] Found our recipient in the envelope",this.recipientIndex,this.recipient)}else{console.log("[SIGN] Could not find our recipient record",this.roleId,y.envelope.recipients)}this.isDone=["submitted","canceled","declined"].includes(this.recipient.status);(i=this.envelopeLoaded)===null||i===void 0?void 0:i.emit({endpoint:this.endpoint,envelope:y.envelope});return[3,5];case 4:p=f.sent();console.log("Error with signing session",p);(r=this.sdkError)===null||r===void 0?void 0:r.emit(new w(p.message,(o=p.response)===null||o===void 0?void 0:o.status,(a=p.response)===null||a===void 0?void 0:a.data));return[3,5];case 5:return[2]}}))}))};e.prototype.handleClickAgree=function(){var e=this;N(this.endpoint,this.envelopeId,this.roleId,true).then((function(){var t;e.nextButtonLabel="Next";e.agreed=true;(t=e.envelopeUpdated)===null||t===void 0?void 0:t.emit({endpoint:e.endpoint,envelope:y.envelope,event:"agreed"})})).catch((function(t){var n,i,r;console.log("Update failure",t);(n=e.sdkError)===null||n===void 0?void 0:n.emit(new w(t.message,(i=t.response)===null||i===void 0?void 0:i.status,(r=t.response)===null||r===void 0?void 0:r.data))}))};e.prototype.handleOptionSelected=function(e){return k(this,void 0,void 0,(function(){var t,n,i,r,o,s,a;return I(this,(function(l){switch(l.label){case 0:s=e.detail.id;switch(s){case"later":return[3,1];case"claim":return[3,2];case"decline":return[3,3];case"print":return[3,5];case"download":return[3,6]}return[3,7];case 1:this.finishLater=true;this.showFinishLater=true;(t=this.envelopeUpdated)===null||t===void 0?void 0:t.emit({endpoint:this.endpoint,envelope:y.envelope,event:"later"});return[3,7];case 2:window.alert("This feature will be available in an upcoming release.");(n=this.envelopeUpdated)===null||n===void 0?void 0:n.emit({endpoint:this.endpoint,envelope:y.envelope,event:"claimed"});return[3,7];case 3:return[4,_(this.endpoint,this.envelopeId,this.roleId)];case 4:a=l.sent();console.log("Decline result",a);(i=this.envelopeUpdated)===null||i===void 0?void 0:i.emit({endpoint:this.endpoint,envelope:y.envelope,event:"declined"});this.isDone=true;return[3,7];case 5:window.print();(r=this.envelopeUpdated)===null||r===void 0?void 0:r.emit({endpoint:this.endpoint,envelope:y.envelope,event:"printed"});return[3,7];case 6:f(this.endpoint,y.envelope,y.envelope.envelope_document_id).catch((function(e){console.log("Error downloading PDF",e)}));(o=this.envelopeUpdated)===null||o===void 0?void 0:o.emit({endpoint:this.endpoint,envelope:y.envelope,event:"downloaded"});return[3,7];case 7:return[2]}}))}))};e.prototype.updateRecipientFieldValue=function(e,t){this.recipient.fields.forEach((function(n){if(n.name===e){n.settings=t.settings;v(n)}}))};e.prototype.saveFieldChange=function(e,t){var n=this;a(this.endpoint,this.envelopeId,e,t).then((function(t){n.updateRecipientFieldValue(e,t)})).catch((function(e){var t,i,r,o,s,a;if(((t=e.response)===null||t===void 0?void 0:t.status)===401&&((r=(i=e.response)===null||i===void 0?void 0:i.data)===null||r===void 0?void 0:r.error)==="jwt expired"){console.log("[SIGN] Signing session expired");n.errorMessage="Signing session expired. Please reload your browser to continue."}else{console.log("[SIGN] Server error",e)}(o=n.sdkError)===null||o===void 0?void 0:o.emit(new w(e.message,(s=e.response)===null||s===void 0?void 0:s.status,(a=e.response)===null||a===void 0?void 0:a.data))}))};e.prototype.handleFieldChange=function(e,t){return k(this,void 0,void 0,(function(){var n,i,r,o,s,s,a,c,u;var p=this;return I(this,(function(h){switch(h.label){case 0:n=t.target,i=n.value,r=n.checked;o=e.type;switch(o){case"textbox":return[3,1];case"checkbox_group":return[3,2];case"radio_button_group":return[3,3];case"dropdown":return[3,4];case"initial":return[3,5];case"signature":return[3,8];case"date":return[3,11];case"timestamp":return[3,12]}return[3,13];case 1:return[2,this.saveFieldChange(e.name,{prepared:false,value:i})];case 2:{s=e.settings.options.map((function(e){return{id:e.id,checked:t.target.checked}}));return[2,this.saveFieldChange(e.name,{prepared:false,value:{options:s}})]}h.label=3;case 3:{s=e.settings.options.map((function(e){return{id:e.id,selected:t.target.value===e.id}}));return[2,this.saveFieldChange(e.name,{prepared:false,value:{options:s}})]}h.label=4;case 4:return[2,this.saveFieldChange(e.name,{prepared:false,value:t.detail})];case 5:return[4,fetch(t.detail)];case 6:return[4,h.sent().blob()];case 7:a=h.sent();return[2,D(this.endpoint,"initial",a).then((function(t){return k(p,void 0,void 0,(function(){var n;return I(this,(function(i){switch(i.label){case 0:return[4,d(this.endpoint,this.envelopeId,e.name,t.id)];case 1:n=i.sent();this.updateRecipientFieldValue(e.name,n);return[2]}}))}))}))];case 8:return[4,fetch(t.detail)];case 9:return[4,h.sent().blob()];case 10:c=h.sent();return[2,L(this.endpoint,"signature",c).then((function(t){return k(p,void 0,void 0,(function(){var n;return I(this,(function(i){switch(i.label){case 0:return[4,l(this.endpoint,this.envelopeId,e.name,t.id)];case 1:n=i.sent();this.updateRecipientFieldValue(e.name,n);return[2]}}))}))}))];case 11:u=t.target.getAttribute("iso");return[2,this.saveFieldChange(e.name,{prepared:false,value:u})];case 12:console.log("Updating timestamp",{value:i,ts:t.target.getAttribute("timestamp")});return[3,14];case 13:console.log("Unhandled field update",{value:i,checked:r},e);return[3,14];case 14:return[2]}}))}))};e.prototype.isFieldValid=function(e){var t,n,i,r,o,s,a;var l=e.required,d=l===void 0?false:l;var c=e.settings||{},h=c.result,f=h===void 0?"":h,v=c.value,g=v===void 0?"":v,m=c.base64,b=m===void 0?"":m;switch(e.type){case"textbox":switch(((t=e.settings)===null||t===void 0?void 0:t.validator)||""){case"email":return p(f);case"phone":return u(f);default:return!d||f!==""}case"signature":case"initial":return!d||b!=="";case"timestamp":return true;case"textarea":case"date":case"attachment":return!d||f!=="";case"dropdown":return!d||g!=="";case"checkbox_group":var x=(((i=(n=e.settings)===null||n===void 0?void 0:n.options)===null||i===void 0?void 0:i.filter((function(e){return e.checked})))||[]).length;return!d||x>=(((r=e.settings)===null||r===void 0?void 0:r.minimum_checked)||0)&&x<=(((o=e.settings)===null||o===void 0?void 0:o.maximum_checked)||999);case"radio_button_group":return!d||(((a=(s=e.settings)===null||s===void 0?void 0:s.options)===null||a===void 0?void 0:a.filter((function(e){return e.selected})))||[]).length>0;default:return false}};e.prototype.handleNext=function(){return k(this,void 0,void 0,(function(){var e,t,n,i,r,o,s,a,l,d;var c=this;return I(this,(function(u){switch(u.label){case 0:if(!this.nextSubmits)return[3,5];u.label=1;case 1:u.trys.push([1,3,,4]);return[4,F(this.endpoint,this.envelopeId,this.roleId)];case 2:t=u.sent();console.log("[SIGN] Submitted successfully",t);this.showDone=true;this.isDone=true;return[3,4];case 3:n=u.sent();console.log("Error submitting",n);return[3,4];case 4:return[2];case 5:i=this.recipient.fields.filter((function(e){return e.required}));r=i.findIndex((function(e){return e.name===c.focusedField}));o=r+1;if(o>=i.length){o=0}s=i[o];a=0;if(a<i.length&&["signature","initial"].includes(s.type)&&((e=s.settings)===null||e===void 0?void 0:e.result)==="signed"){a++;o++;if(o>=i.length){o=0}s=i[o]}if(a>=i.length){s=null}if(s){l=b(s);d=document.getElementById(l);d===null||d===void 0?void 0:d.focusField();this.focusedField=s.name}return[2]}}))}))};e.prototype.checkRecipientFields=function(){var e=this;var t=this.recipient.fields.filter((function(t){return!e.isFieldValid(t)}));if(t.length<1){this.nextButtonLabel="Finish";this.nextSubmits=true}else{console.log("[SIGN] Remaining invalid fields",t);this.nextButtonLabel="Next";this.nextSubmits=false}};e.prototype.attachFieldAttributes=function(e,t,n,i){var r=this;var o;i.addEventListener("input",(function(){return r.checkRecipientFields()}));i.addEventListener("focusout",(function(e){return r.handleFieldChange(t,e).finally((function(){return r.checkRecipientFields()}))}));i.addEventListener("fieldChange",(function(e){return r.handleFieldChange(t,e).finally((function(){return r.checkRecipientFields()}))}));i.setAttribute("roleindex",n);i.setAttribute("xScale",e.xScale);i.setAttribute("yScale",e.yScale);i.setAttribute("initials",this.recipient?h(this.recipient.full_name):"");i.setAttribute("name",((o=this.recipient)===null||o===void 0?void 0:o.full_name)||"")};e.prototype.handlePageRendered=function(e){var t=this;var n=e.detail;var i=g(y.roleNames,this.recipient.role_name);var r=this.recipient.fields.filter((function(e){return e.page===n.pageNumber}));console.log("[SIGN] Page rendered, updating fields",{pageInfo:n,roleIndex:i,recipientFields:r});r.forEach((function(e){var r=m(e,n,i,{disabled:false,editable:false,draggable:false,done:t.isDone});if(!r){return}if(Array.isArray(r)){r.map((function(r){return t.attachFieldAttributes(n,e,i,r)}))}else{t.attachFieldAttributes(n,e,i,r)}}));y.envelope.recipients.filter((function(e){return e.role_name!==t.recipient.role_name})).forEach((function(e){var i=g(y.roleNames,e.role_name);var r=e.fields.filter((function(e){return e.page===n.pageNumber}));r.forEach((function(e){var r=m(e,n,i,{disabled:true,editable:false,draggable:false,done:t.isDone});if(!r){return}if(r.setAttribute){r.setAttribute("roleindex",i);r.setAttribute("xScale",n.xScale);r.setAttribute("yScale",n.yScale)}}))}));this.checkRecipientFields()};e.prototype.render=function(){var e=this;if(y.loading||!y.envelope){return i(r,null,i("verdocs-loader",null))}return i(r,{class:{agreed:this.agreed},"data-r":y.updateCount},!this.isDone&&!this.finishLater&&i("div",{class:"intro"},"Please review and act on these documents."),!this.isDone&&i("div",{class:"header"},!this.agreed?i("div",{class:"agree"},i("verdocs-checkbox",{name:"agree",label:"I agree to use electronic records and signatures.",onInput:function(){return e.handleClickAgree()}})):i(o,null,i("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),i("div",{class:"title"},y.envelope.name),i("div",{style:{flex:"1"}})),!this.isDone&&!this.finishLater&&i("verdocs-button",{size:"small",label:this.nextButtonLabel,disabled:!this.agreed,onClick:function(){return e.handleNext()}}),i("div",{style:{marginLeft:"10px"}}),i("verdocs-dropdown",{options:!this.isDone&&!this.finishLater?E:C,onOptionSelected:function(t){return e.handleOptionSelected(t)}})),!this.isDone&&!this.agreed?i("div",{class:"cover"}):i("div",{style:{display:"none"}}),this.isDone?i("verdocs-view",{endpoint:this.endpoint,envelopeId:this.envelopeId,onSdkError:function(t){var n;return(n=e.sdkError)===null||n===void 0?void 0:n.emit(t.detail)}}):i("div",{class:"document"},(y.envelope.documents||[]).map((function(t){var n=__spreadArray([],(t===null||t===void 0?void 0:t.pages)||[],true);n.sort((function(e,t){return e.sequence-t.sequence}));return i(o,null,n.map((function(t){var n;var r=(n=y.template)===null||n===void 0?void 0:n.pages.find((function(e){return e.sequence===t.sequence}));return i("verdocs-document-page",{pageImageUri:(r===null||r===void 0?void 0:r.display_uri)||t.display_uri,virtualWidth:612,virtualHeight:792,pageNumber:t.sequence,onPageRendered:function(t){return e.handlePageRendered(t)},layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})})))}))),this.showFinishLater&&i("verdocs-ok-dialog",{heading:"You've saved your document to finish later.",message:"To complete the ".concat(this.documentsSingularPlural,", use the link in the original email notification inviting you to review and finish the document."),onNext:function(){return e.showFinishLater=false}}),this.errorMessage&&i("verdocs-ok-dialog",{heading:"Network Error",message:this.errorMessage,onNext:function(){return e.errorMessage=""}}),this.showDone&&i("verdocs-ok-dialog",{heading:"You're Done!",message:"You can access the ".concat(this.documentsSingularPlural," at any time by clicking on the link from the invitation email.<br /><br />After all recipients have completed their actions, you will receive an email with the document and envelope certificate attached."),onNext:function(){return e.showDone=false}}))};return e}());P.style=A}}}));
@@ -0,0 +1 @@
1
+ import{r as e,c as o,h as t,H as s,F as r,a as l}from"./p-7239d28d.js";import{i}from"./p-fa129346.js";import{u as a,c as n}from"./p-8027431e.js";import{V as d,T as p}from"./p-4e49fb12.js";import{g as c}from"./p-6de76553.js";import{s as m}from"./p-a8b01bb9.js";import{l as h}from"./p-35c46590.js";import{a as v}from"./p-ee5acec4.js";import{S as f}from"./p-7a1b2643.js";import"./p-21603661.js";import"./p-8b2040be.js";import"./p-7291906c.js";import"./p-b28ef4bb.js";import"./p-388b771c.js";import"./p-aa124212.js";import"./p-ab01f71e.js";const x={[p.EVERYONE]:"Everyone",[p.EVERYONE_AS_CREATOR]:"Everyone as Me",[p.ORGANIZATION_MEMBER]:"Organization member",[p.ORGANIZATION_MEMBER_AS_CREATOR]:"Organization Member as Me",[p.CREATOR]:"Me"},g='<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>',u='<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>',b=class{constructor(t){e(this,t),this.next=o(this,"next",7),this.cancel=o(this,"cancel",7),this.sdkError=o(this,"sdkError",7),this.templateUpdated=o(this,"templateUpdated",7),this.sequences=[],this.endpoint=d.getDefault(),this.templateId="",this.showingRoleDialog=null,this.showingSenderDialog=!1,this.sender=null,this.forceRerender=1}async componentWillLoad(){var e,o,t,s,r,l;try{if(this.endpoint.loadSession(),!this.templateId)return void console.log(`[ROLES] Missing required template ID ${this.templateId}`);if(!this.endpoint.session)return void console.log("[ROLES] Unable to start builder session, must be authenticated");try{console.log(`[ROLES] Loading template ${this.templateId}`,this.endpoint.session),await h(this.endpoint,this.templateId,!0)}catch(s){console.log("[ROLES] Error loading template",s),null===(e=this.sdkError)||void 0===e||e.emit(new f(s.message,null===(o=s.response)||void 0===o?void 0:o.status,null===(t=s.response)||void 0===t?void 0:t.data))}this.sortTemplateRoles(),this.renumberTemplateRoles()}catch(e){console.log("[FIELDS] Error with preview session",e),null===(s=this.sdkError)||void 0===s||s.emit(new f(e.message,null===(r=e.response)||void 0===r?void 0:r.status,null===(l=e.response)||void 0===l?void 0:l.data))}}componentDidRender(){i.dynamicDrop(!0),i(".recipient").draggable({listeners:{start:function(e){e.target.classList.add("dragging"),this.el.classList.add("dragging")}.bind(this),move:function(e){const o=+(e.target.getAttribute("posX")||0),t=+(e.target.getAttribute("posY")||0),s=e.dx+o,r=e.dy+t;e.target.setAttribute("posX",s),e.target.setAttribute("posy",r),e.target.style.transform=`translate(${s+100}px, ${r-40}px)`}.bind(this),end:function(e){e.target.classList.remove("dragging"),this.el.classList.remove("dragging"),e.target.setAttribute("posX",0),e.target.setAttribute("posy",0),e.target.style.transform="translate(0px, 0px)"}.bind(this)}}),i(".dropzone").dropzone({overlap:.05,ondrop:function(e){var o,t;e.target.classList.remove("active");const s=e.relatedTarget.dataset.rolename,r=+e.target.dataset.sequence,l=+e.target.dataset.order,i=null===(o=m.template)||void 0===o?void 0:o.roles.find((e=>e.name===s));i&&(i.sequence=r,i.order=l,this.sortTemplateRoles(),this.renumberTemplateRoles(),this.forceRerender++,Promise.all(null===(t=m.template)||void 0===t?void 0:t.roles.map((e=>a(this.endpoint,this.templateId,e.name,{sequence:e.sequence,order:e.order})))).then((()=>console.log("[ROLES] Updated roles"))).catch((e=>console.log("[ROLES] Role updates failed",e))))}.bind(this),ondropactivate:e=>{e.target.classList.add("visible")},ondropdeactivate:e=>{e.target.classList.remove("visible")},ondragenter:e=>{e.target.classList.add("active")},ondragleave:e=>{e.target.classList.remove("active")}})}handleCancel(e){var o;e.stopPropagation(),null===(o=this.cancel)||void 0===o||o.emit()}handleSubmit(e){var o;e.stopPropagation(),null===(o=this.next)||void 0===o||o.emit()}sortTemplateRoles(){var e;null===(e=m.template)||void 0===e||e.roles.sort(((e,o)=>e.sequence===o.sequence?e.order-o.order:e.sequence-o.sequence))}extractSequenceNumbers(){var e;this.sequences=[],null===(e=m.template)||void 0===e||e.roles.forEach((e=>{this.sequences.includes(e.sequence)||this.sequences.push(e.sequence)}))}renumberTemplateRoles(){this.extractSequenceNumbers();const e=[];this.sequences.sort(((e,o)=>e-o)),this.sequences.forEach(((o,t)=>{var s;null===(s=m.template)||void 0===s||s.roles.filter((e=>e.sequence===o)).forEach(((o,s)=>{e.includes(o.name)||(o.sequence=t+1,o.order=s+1,e.push(o.name))}))})),this.extractSequenceNumbers()}getNextRoleName(){var e,o;let t="",s=null===(e=m.template)||void 0===e?void 0:e.roles.length;do{s++,t=`Recipient ${s}`}while(!t||(null===(o=m.template)||void 0===o?void 0:o.roles.some((e=>e.name===t))));return t}handleAddRole(e,o){e.stopPropagation();const t=m.template.roles.filter((e=>e.sequence===o)).length+1,s=this.getNextRoleName();console.log("Will create",s,o,t),n(this.endpoint,this.templateId,{template_id:this.templateId,name:s,full_name:"",email:"",phone:"",sequence:o,order:t,type:"signer",delegator:!1}).then((e=>{console.log("Created role",e),m.template.roles.push(e),this.renumberTemplateRoles(),this.forceRerender++})).catch((e=>{console.log("Error creating role",e)}))}handleAddStep(e,o){e.stopPropagation();const t=this.getNextRoleName();console.log("Will create",t,o,1),n(this.endpoint,this.templateId,{template_id:this.templateId,name:t,full_name:"",email:"",phone:"",sequence:o,order:1,type:"signer",delegator:!1}).then((e=>{console.log("Created role",e),m.template.roles.push(e),this.renumberTemplateRoles(),this.forceRerender++})).catch((e=>{console.log("Error creating role",e)}))}render(){var e;if(!this.endpoint.session)return t(s,null,t("verdocs-component-error",{message:"You must be authenticated to use this module."}));if(m.loading||!m.template)return t(s,null,t("verdocs-loader",null));const o=((null===(e=m.template)||void 0===e?void 0:e.roles)||[]).map((e=>e.name));return t(s,null,t("form",{onSubmit:e=>e.preventDefault(),onClick:e=>e.stopPropagation(),autocomplete:"off","data-r":this.forceRerender},t("h5",null,"Roles"),t("div",{class:"participants"},t("div",{class:"left-line"}),t("div",{class:"row"},t("div",{class:"icon",innerHTML:'<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" fill="#00000089"><path d="M2 12C2 6.48 6.48 2 12 2s10 4.48 10 10-4.48 10-10 10S2 17.52 2 12zm10 6c3.31 0 6-2.69 6-6s-2.69-6-6-6-6 2.69-6 6 2.69 6 6 6z"></path></svg>'}),t("div",{class:"row-roles"},t("div",{class:"sender"},t("span",{class:"label"},"Sender:")," ",x[m.template.sender]," ",t("div",{class:"settings-button",innerHTML:g,onClick:()=>this.showingSenderDialog=!0,"aria-role":"button"})))),t("div",{class:"row add-sequence","data-sequence":0},t("div",{class:"icon",innerHTML:u}),t("div",{class:"row-roles"},t("div",{class:"dropzone","data-sequence":0,"data-order":1},"Add Step"))),this.sequences.map((e=>t(r,null,t("div",{class:"row"},t("div",{class:"icon",innerHTML:'<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" fill="#00000089"><path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"></path></svg>'}),t("div",{class:"row-roles"},t("div",{class:"dropzone","data-order":.5,"data-sequence":e}),m.template.roles.filter((o=>o.sequence===e)).map((s=>t(r,null,t("div",{class:"recipient",style:{backgroundColor:c(v(o,s.name))},"data-rolename":s.name},t("span",{class:"type-icon",innerHTML:"signer"===s.type?'<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>':"cc"===s.type?'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M1.5 8.67v8.58a3 3 0 003 3h15a3 3 0 003-3V8.67l-8.928 5.493a3 3 0 01-3.144 0L1.5 8.67z" /><path d="M22.5 6.908V6.75a3 3 0 00-3-3h-15a3 3 0 00-3 3v.158l9.714 5.978a1.5 1.5 0 001.572 0L22.5 6.908z" /></svg>':'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12zm13.36-1.814a.75.75 0 10-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 00-1.06 1.06l2.25 2.25a.75.75 0 001.14-.094l3.75-5.25z" clip-rule="evenodd" /></svg>'}),s.name," ",t("div",{class:"settings-button",innerHTML:g,onClick:()=>this.showingRoleDialog=s.name,"aria-role":"button"})),t("div",{class:"dropzone","data-order":s.order+.5,"data-sequence":e})))),t("button",{class:"add-role",innerHTML:u,onClick:o=>this.handleAddRole(o,e)}))),this.sequences.length>0&&t("div",{class:"row add-sequence","data-sequence":e},t("div",{class:"row-roles"},t("div",{class:"icon",innerHTML:u}),t("div",{class:"dropzone","data-sequence":e+1,"data-order":1},"Add Step")))))),t("div",{class:"row","data-sequence":this.sequences.length+1},t("div",{class:"row-roles"},t("div",{class:"icon",innerHTML:u}),t("button",{class:"add-step",innerHTML:u,onClick:e=>this.handleAddStep(e,this.sequences.length+1)}))),t("div",{class:"row"},t("div",{class:"icon",innerHTML:'<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" fill="#00000089"><path d="m18 7-1.41-1.41-6.34 6.34 1.41 1.41L18 7zm4.24-1.41L11.66 16.17 7.48 12l-1.41 1.41L11.66 19l12-12-1.42-1.41zM.41 13.41 6 19l1.41-1.41L1.83 12 .41 13.41z"></path></svg>'}),t("div",{class:"row-roles"},t("div",{class:"complete"},"Document Complete")))),o.length<1&&t("div",{class:"empty"},"You must add at least one Role before proceeding.",t("br",null)," Click the ",t("span",{innerHTML:u})," Add button above to get started."),t("div",{class:"buttons"},t("div",{class:"flex-fill"}),t("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:e=>this.handleCancel(e)}),t("verdocs-button",{label:"OK",size:"small",onClick:e=>this.handleSubmit(e),disabled:o.length<1}))),this.showingRoleDialog&&t("verdocs-template-role-properties",{endpoint:this.endpoint,templateId:this.templateId,roleName:this.showingRoleDialog,onClose:()=>{this.showingRoleDialog=null,this.forceRerender++},onDelete:e=>{console.log("deleted",e.detail),this.renumberTemplateRoles(),this.showingRoleDialog=null,this.forceRerender++}}),this.showingSenderDialog&&t("verdocs-template-sender",{endpoint:this.endpoint,templateId:this.templateId,onClose:()=>this.showingSenderDialog=!1}))}get el(){return l(this)}};b.style='verdocs-template-roles{display:block;min-width:400px;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-roles>form{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;background-color:#ffffff;padding:12px}verdocs-template-roles>form h5{font-size:16px;font-weight:bold;color:#4c56cb;margin:0 0 10px 0}verdocs-template-roles>form .participants{position:relative}verdocs-template-roles>form .left-line{top:32px;left:11px;z-index:1;width:12px;bottom:30px;position:absolute;background:#ffffff;border-left:3px dotted #9b9b9b}verdocs-template-roles>form .row{display:-ms-flexbox;display:flex;-webkit-column-gap:0;-moz-column-gap:0;column-gap:0;min-height:35px;margin-left:40px;position:relative;-ms-flex-direction:row;flex-direction:row;padding:6px 0 4px 0}verdocs-template-roles>form .row .row-roles{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;-webkit-column-gap:10px;-moz-column-gap:10px;column-gap:10px;-ms-flex-direction:row;flex-direction:row}verdocs-template-roles>form .row .icon{top:14px;z-index:2;left:-40px;width:24px;height:24px;position:absolute;background:#ffffff}verdocs-template-roles>form .row .sender{height:30px;display:-ms-flexbox;display:flex;font-size:14px;padding:0 5px 0 15px;line-height:30px;-ms-flex-direction:row;flex-direction:row;border-radius:30px;border:1px solid #c6c9cc;background-color:#f5f5fa}verdocs-template-roles>form .row .complete{height:30px;display:-ms-flexbox;display:flex;font-size:14px;padding:0 15px;line-height:30px;-ms-flex-direction:row;flex-direction:row;border-radius:30px;background-color:#f5f5fa;border:1px solid #aeb4bf}verdocs-template-roles>form .row .label{font-weight:bold;margin-right:6px;color:#33364b}verdocs-template-roles>form .row .settings-button{margin:0 0 0 9px;cursor:pointer}verdocs-template-roles>form .row .recipient{height:30px;display:-ms-flexbox;display:flex;font-size:14px;border-radius:30px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;padding:0 5px 0 6px;white-space:nowrap;border:1px solid #aeb4bf}verdocs-template-roles>form .row .recipient .type-icon{width:24px;height:24px;-webkit-transform:scale(0.8);transform:scale(0.8);opacity:0.6;margin:0 12px 0 0}verdocs-template-roles>form .row .recipient.dragging{position:absolute}verdocs-template-roles>form .row .recipient.dragging+.dropzone{display:none !important}verdocs-template-roles>form .row .dropzone{width:14px;height:30px;display:none}verdocs-template-roles>form .row .dropzone svg{fill:#cccccc}verdocs-template-roles>form .row .dropzone.visible{margin:0 7px;display:-ms-flexbox;display:flex;-ms-flex:0 0 14px;flex:0 0 14px}verdocs-template-roles>form .row .dropzone.active{-ms-flex:0 0 120px;flex:0 0 120px;border-radius:30px;background:#654dcb7f;border:1px dashed #654dcb}verdocs-template-roles>form label{display:block;font-size:14px;font-weight:500;margin:0 0 4px 0;color:#5c6575}verdocs-template-roles>form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-template-roles>form input:focus{outline:none}verdocs-template-roles .row.add-sequence{display:none}verdocs-template-roles .add-role{margin:0;padding:0;border:none;opacity:0.5;cursor:pointer;background:none}verdocs-template-roles .add-role:hover{opacity:1}verdocs-template-roles .add-role svg{width:32px;height:32px}verdocs-template-roles .add-step{margin:0;padding:0;border:none;opacity:0.5;cursor:pointer;background:none}verdocs-template-roles .add-step:hover{opacity:1}verdocs-template-roles .add-step svg{width:32px;height:32px}verdocs-template-roles.dragging .add-role{display:none}verdocs-template-roles.dragging form .row .recipient+.dropzone{display:-ms-flexbox;display:flex}verdocs-template-roles.dragging .row.add-sequence{display:-ms-flexbox;display:flex}verdocs-template-roles.dragging .row.add-sequence .dropzone{opacity:0.5;-ms-flex:0 0 120px;flex:0 0 120px;border-radius:30px;-ms-flex-align:center;align-items:center;background:#654dcb7f;-ms-flex-pack:center;justify-content:center;border:1px dashed #654dcb}verdocs-template-roles.dragging .row.add-sequence .dropzone.active{opacity:1}verdocs-template-roles .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-direction:row;flex-direction:row}verdocs-template-roles .empty{font-size:13px;margin-top:15px;margin-bottom:5px}verdocs-template-roles .empty svg{width:20px;height:20px;stroke:#666666;margin-bottom:-5px}verdocs-template-roles ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-roles ::-moz-placeholder{color:#aaaaaa}verdocs-template-roles :-ms-input-placeholder{color:#aaaaaa}verdocs-template-roles ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-roles ::placeholder{color:#aaaaaa}';export{b as verdocs_template_roles}
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r["throw"](e))}catch(e){o(e)}}function l(e){e.done?n(e.value):i(e.value).then(s,a)}l((r=r.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(e){return function(t){return l([e,t])}}function l(s){if(r)throw new TypeError("Generator is already executing.");while(n)try{if(r=1,i&&(o=s[0]&2?i["return"]:s[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,s[1])).done)return o;if(i=0,o)s=[s[0]&2,o.value];switch(s[0]){case 0:case 1:o=s;break;case 4:n.label++;return{value:s[1],done:false};case 5:n.label++;i=s[1];s=[0];continue;case 7:s=n.ops.pop();n.trys.pop();continue;default:if(!(o=n.trys,o=o.length>0&&o[o.length-1])&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!o||s[1]>o[0]&&s[1]<o[3])){n.label=s[1];break}if(s[0]===6&&n.label<o[1]){n.label=o[1];o=s;break}if(o&&n.label<o[2]){n.label=o[2];n.ops.push(s);break}if(o[2])n.ops.pop();n.trys.pop();continue}s=t.call(e,n)}catch(e){s=[6,e];i=0}finally{r=o=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};System.register(["./p-9422b807.system.js","./p-05eb4fed.system.js","./p-38d00c38.system.js","./p-0513c8c3.system.js","./p-e764098e.system.js","./p-af2c2f79.system.js","./p-327858f0.system.js","./p-51a3ea62.system.js","./p-71c7e1ba.system.js","./p-d50523fd.system.js"],(function(e){"use strict";var t,n,r,i,o,s,a;return{setters:[function(e){t=e.r;n=e.c;r=e.h;i=e.H},function(e){o=e.g},function(e){s=e.g},function(e){a=e.s},function(){},function(){},function(){},function(){},function(){},function(){}],execute:function(){var l='verdocs-field-dropdown{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;width:85px;height:20px;display:block;font-size:11px;position:relative;background-color:transparent;-webkit-transform-origin:bottom left;transform-origin:bottom left}verdocs-field-dropdown.disabled{opacity:0.5}verdocs-field-dropdown select{position:absolute;background:linear-gradient(55deg, transparent 50%, #333 50%), linear-gradient(125deg, #333 50%, transparent 50%), linear-gradient(to right, transparent, transparent);background-position:calc(100% - 7px) 4px, calc(100% - 3px) 4px, 100% 0;background-size:5px 5px, 5px 5px, 2.5em 2.5em;background-repeat:no-repeat;-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-box-sizing:border-box;box-sizing:border-box;color:rgba(0, 0, 0, 0.87);font-weight:500;-webkit-transform-origin:0 0;transform-origin:0 0;height:100%;width:100%;font-size:11px;border:1px solid rgba(0, 0, 0, 0.2)}verdocs-field-dropdown select:focus{outline:none}verdocs-field-dropdown select.hide{display:none}verdocs-field-dropdown.required select{border:1px solid #cc0000}verdocs-field-dropdown.focused{-webkit-animation:verdocs-field-pulse 0.75s 2;animation:verdocs-field-pulse 0.75s 2}';var d=e("verdocs_field_dropdown",function(){function e(e){t(this,e);this.fieldChange=n(this,"fieldChange",7);this.settingsChanged=n(this,"settingsChanged",7);this.deleted=n(this,"deleted",7);this.field=null;this.disabled=false;this.roleindex=0}e.prototype.focusField=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.el.focus();return[2]}))}))};e.prototype.handleChange=function(e){this.fieldChange.emit(e.target.value)};e.prototype.showSettingsPanel=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){e=document.getElementById("verdocs-settings-panel-".concat(this.field.name));if(e&&e.showPanel){e.showPanel()}return[2]}))}))};e.prototype.hideSettingsPanel=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){e=document.getElementById("verdocs-settings-panel-".concat(this.field.name));if(e&&e.hidePanel){e.hidePanel()}a.updateCount++;return[2]}))}))};e.prototype.render=function(){var e=this;var t,n;var a=s(this.field);var l=(n=(t=this.disabled)!==null&&t!==void 0?t:a.disabled)!==null&&n!==void 0?n:false;var d=this.field["rgba"]||o(this.roleindex);return r(i,{class:{required:a.required,disabled:l},style:{backgroundColor:d}},r("select",{tabIndex:a.order,disabled:l,ref:function(t){return e.el=t},onChange:function(t){return e.handleChange(t)}},r("option",{value:""},"Select..."),(a.options||[]).map((function(e){return r("option",{value:e.id,selected:e.value===a.value},e.value)}))))};return e}());d.style=l}}}));
1
+ var __awaiter=this&&this.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r["throw"](e))}catch(e){o(e)}}function l(e){e.done?n(e.value):i(e.value).then(a,s)}l((r=r.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(e){return function(t){return l([e,t])}}function l(a){if(r)throw new TypeError("Generator is already executing.");while(n)try{if(r=1,i&&(o=a[0]&2?i["return"]:a[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;if(i=0,o)a=[a[0]&2,o.value];switch(a[0]){case 0:case 1:o=a;break;case 4:n.label++;return{value:a[1],done:false};case 5:n.label++;i=a[1];a=[0];continue;case 7:a=n.ops.pop();n.trys.pop();continue;default:if(!(o=n.trys,o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){n=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){n.label=a[1];break}if(a[0]===6&&n.label<o[1]){n.label=o[1];o=a;break}if(o&&n.label<o[2]){n.label=o[2];n.ops.push(a);break}if(o[2])n.ops.pop();n.trys.pop();continue}a=t.call(e,n)}catch(e){a=[6,e];i=0}finally{r=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};System.register(["./p-9422b807.system.js","./p-05eb4fed.system.js","./p-07f4e46f.system.js","./p-03aeaebe.system.js","./p-e764098e.system.js","./p-af2c2f79.system.js","./p-327858f0.system.js","./p-51a3ea62.system.js","./p-71c7e1ba.system.js","./p-d50523fd.system.js"],(function(e){"use strict";var t,n,r,i,o,a,s;return{setters:[function(e){t=e.r;n=e.c;r=e.h;i=e.H},function(e){o=e.g},function(e){a=e.g},function(e){s=e.s},function(){},function(){},function(){},function(){},function(){},function(){}],execute:function(){var l='verdocs-field-dropdown{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;width:85px;height:20px;display:block;font-size:11px;position:relative;background-color:transparent;-webkit-transform-origin:bottom left;transform-origin:bottom left}verdocs-field-dropdown.disabled{opacity:0.5}verdocs-field-dropdown select{position:absolute;background:linear-gradient(55deg, transparent 50%, #333 50%), linear-gradient(125deg, #333 50%, transparent 50%), linear-gradient(to right, transparent, transparent);background-position:calc(100% - 7px) 4px, calc(100% - 3px) 4px, 100% 0;background-size:5px 5px, 5px 5px, 2.5em 2.5em;background-repeat:no-repeat;-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-box-sizing:border-box;box-sizing:border-box;color:rgba(0, 0, 0, 0.87);font-weight:500;-webkit-transform-origin:0 0;transform-origin:0 0;height:100%;width:100%;font-size:11px;border:1px solid rgba(0, 0, 0, 0.2)}verdocs-field-dropdown select:focus{outline:none}verdocs-field-dropdown select.hide{display:none}verdocs-field-dropdown.required select{border:1px solid #cc0000}verdocs-field-dropdown.focused{-webkit-animation:verdocs-field-pulse 0.75s 2;animation:verdocs-field-pulse 0.75s 2}';var d=e("verdocs_field_dropdown",function(){function e(e){t(this,e);this.fieldChange=n(this,"fieldChange",7);this.settingsChanged=n(this,"settingsChanged",7);this.deleted=n(this,"deleted",7);this.field=null;this.disabled=false;this.roleindex=0}e.prototype.focusField=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.el.focus();return[2]}))}))};e.prototype.handleChange=function(e){this.fieldChange.emit(e.target.value)};e.prototype.showSettingsPanel=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){e=document.getElementById("verdocs-settings-panel-".concat(this.field.name));if(e&&e.showPanel){e.showPanel()}return[2]}))}))};e.prototype.hideSettingsPanel=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){e=document.getElementById("verdocs-settings-panel-".concat(this.field.name));if(e&&e.hidePanel){e.hidePanel()}s.updateCount++;return[2]}))}))};e.prototype.render=function(){var e=this;var t,n;var s=a(this.field);var l=(n=(t=this.disabled)!==null&&t!==void 0?t:s.disabled)!==null&&n!==void 0?n:false;var d=this.field["rgba"]||o(this.roleindex);return r(i,{class:{required:s.required,disabled:l},style:{backgroundColor:d}},r("select",{tabIndex:s.order,disabled:l,ref:function(t){return e.el=t},onChange:function(t){return e.handleChange(t)}},r("option",{value:""},"Select..."),(s.options||[]).map((function(e){return r("option",{value:e.id,selected:e.value===s.value},e.value)}))))};return e}());d.style=l}}}));
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(e,t,n,r){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,a){function l(e){try{s(r.next(e))}catch(e){a(e)}}function i(e){try{s(r["throw"](e))}catch(e){a(e)}}function s(e){e.done?n(e.value):o(e.value).then(l,i)}s((r=r.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,o,a,l;return l={next:i(0),throw:i(1),return:i(2)},typeof Symbol==="function"&&(l[Symbol.iterator]=function(){return this}),l;function i(e){return function(t){return s([e,t])}}function s(l){if(r)throw new TypeError("Generator is already executing.");while(n)try{if(r=1,o&&(a=l[0]&2?o["return"]:l[0]?o["throw"]||((a=o["return"])&&a.call(o),0):o.next)&&!(a=a.call(o,l[1])).done)return a;if(o=0,a)l=[l[0]&2,a.value];switch(l[0]){case 0:case 1:a=l;break;case 4:n.label++;return{value:l[1],done:false};case 5:n.label++;o=l[1];l=[0];continue;case 7:l=n.ops.pop();n.trys.pop();continue;default:if(!(a=n.trys,a=a.length>0&&a[a.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]<a[3])){n.label=l[1];break}if(l[0]===6&&n.label<a[1]){n.label=a[1];a=l;break}if(a&&n.label<a[2]){n.label=a[2];n.ops.push(l);break}if(a[2])n.ops.pop();n.trys.pop();continue}l=t.call(e,n)}catch(e){l=[6,e];o=0}finally{r=a=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}};System.register(["./p-71c7e1ba.system.js","./p-d50523fd.system.js"],(function(e){"use strict";var t,n;return{setters:[function(e){t=e.c},function(e){n=e.i}],execute:function(){var r=this;var o=t({templateId:"",template:null,loadProgress:0,loading:false,updateCount:1,pageNumbers:[],pageUris:{},roleNames:[],fields:[],dirty:false}),a=o.state,l=o.onChange;e("s",a);l("template",(function(e){return __awaiter(r,void 0,void 0,(function(){return __generator(this,(function(t){console.log("nt",e);if(!e){console.log("[TEMPLATESTORE] Clearing template");a.fields=[];a.roleNames=[];a.pageNumbers=[];a.dirty=false;a.loading=false;a.loadProgress=0;return[2]}console.log("[TEMPLATESTORE] Template loaded",e);a.roleNames=e.roles.map((function(e){return e.name}));console.log("[TEMPLATESTORE] Loaded roles",a.roleNames);a.fields=[];e.roles.forEach((function(e){var t;(t=a.fields).push.apply(t,e.fields)}));console.log("[TEMPLATESTORE] Loaded fields",a.fields);a.pageNumbers=n(1,e.pages.length);a.updateCount++;return[2]}))}))}));l("fields",(function(e){console.log("[TEMPLATESTORE] Field changed",e);a.dirty=true}))}}}));
1
+ var __awaiter=this&&this.__awaiter||function(e,t,n,r){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,a){function l(e){try{s(r.next(e))}catch(e){a(e)}}function i(e){try{s(r["throw"](e))}catch(e){a(e)}}function s(e){e.done?n(e.value):o(e.value).then(l,i)}s((r=r.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,o,a,l;return l={next:i(0),throw:i(1),return:i(2)},typeof Symbol==="function"&&(l[Symbol.iterator]=function(){return this}),l;function i(e){return function(t){return s([e,t])}}function s(l){if(r)throw new TypeError("Generator is already executing.");while(n)try{if(r=1,o&&(a=l[0]&2?o["return"]:l[0]?o["throw"]||((a=o["return"])&&a.call(o),0):o.next)&&!(a=a.call(o,l[1])).done)return a;if(o=0,a)l=[l[0]&2,a.value];switch(l[0]){case 0:case 1:a=l;break;case 4:n.label++;return{value:l[1],done:false};case 5:n.label++;o=l[1];l=[0];continue;case 7:l=n.ops.pop();n.trys.pop();continue;default:if(!(a=n.trys,a=a.length>0&&a[a.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]<a[3])){n.label=l[1];break}if(l[0]===6&&n.label<a[1]){n.label=a[1];a=l;break}if(a&&n.label<a[2]){n.label=a[2];n.ops.push(l);break}if(a[2])n.ops.pop();n.trys.pop();continue}l=t.call(e,n)}catch(e){l=[6,e];o=0}finally{r=a=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}};System.register(["./p-71c7e1ba.system.js","./p-d50523fd.system.js"],(function(e){"use strict";var t,n;return{setters:[function(e){t=e.c},function(e){n=e.i}],execute:function(){var r=this;var o=t({templateId:"",template:null,loadProgress:0,loading:false,updateCount:1,pageNumbers:[],pageUris:{},roleNames:[],fields:[],dirty:false}),a=o.state,l=o.onChange;e("s",a);l("template",(function(e){return __awaiter(r,void 0,void 0,(function(){return __generator(this,(function(t){if(!e){console.log("[TEMPLATESTORE] Clearing template");a.fields=[];a.roleNames=[];a.pageNumbers=[];a.dirty=false;a.loading=false;a.loadProgress=0;return[2]}console.log("[TEMPLATESTORE] Template loaded",e);a.roleNames=e.roles.map((function(e){return e.name}));console.log("[TEMPLATESTORE] Loaded roles",a.roleNames);a.fields=[];e.roles.forEach((function(e){var t;(t=a.fields).push.apply(t,e.fields)}));console.log("[TEMPLATESTORE] Loaded fields",a.fields);a.pageNumbers=n(1,e.pages.length);a.updateCount++;return[2]}))}))}));l("fields",(function(e){console.log("[TEMPLATESTORE] Field changed",e);a.dirty=true}))}}}));
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(e,t,r,n){function s(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,i){function o(e){try{l(n.next(e))}catch(e){i(e)}}function a(e){try{l(n["throw"](e))}catch(e){i(e)}}function l(e){e.done?r(e.value):s(e.value).then(o,a)}l((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,s,i,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(e){return function(t){return l([e,t])}}function l(o){if(n)throw new TypeError("Generator is already executing.");while(r)try{if(n=1,s&&(i=o[0]&2?s["return"]:o[0]?s["throw"]||((i=s["return"])&&i.call(s),0):s.next)&&!(i=i.call(s,o[1])).done)return i;if(s=0,i)o=[o[0]&2,i.value];switch(o[0]){case 0:case 1:i=o;break;case 4:r.label++;return{value:o[1],done:false};case 5:r.label++;s=o[1];o=[0];continue;case 7:o=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(o[0]===6||o[0]===2)){r=0;continue}if(o[0]===3&&(!i||o[1]>i[0]&&o[1]<i[3])){r.label=o[1];break}if(o[0]===6&&r.label<i[1]){r.label=i[1];i=o;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(o);break}if(i[2])r.ops.pop();r.trys.pop();continue}o=t.call(e,r)}catch(e){o=[6,e];s=0}finally{n=i=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};System.register(["./p-9422b807.system.js","./p-4f63fae0.system.js","./p-0513c8c3.system.js","./p-340316cb.system.js","./p-187b20b7.system.js","./p-af2c2f79.system.js","./p-71c7e1ba.system.js","./p-d50523fd.system.js","./p-69912cbf.system.js"],(function(e){"use strict";var t,r,n,s,i,o,a,l;return{setters:[function(e){t=e.r;r=e.c;n=e.h;s=e.H},function(e){i=e.V},function(e){o=e.s},function(e){a=e.l},function(e){l=e.S},function(){},function(){},function(){},function(){}],execute:function(){var d=function(e,t,r){return e.api.post("/templates/".concat(t,"/reminder/"),r).then((function(e){return e.data}))};var c=function(e,t,r,n){return e.api.put("/templates/".concat(t,"/reminder/").concat(r),n).then((function(e){return e.data}))};var u=function(e,t,r){return e.api.delete("/templates/".concat(t,"/reminder/").concat(r)).then((function(e){return e.data}))};var m='verdocs-template-reminders{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-reminders.loading{min-height:300px;position:relative;display:block}verdocs-template-reminders.empty{display:none}verdocs-template-reminders form{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-template-reminders form h5{font-size:16px;font-weight:bold;color:#4c56cb;margin:0 0 20px 0}verdocs-template-reminders form label{font-size:16px;font-weight:500;margin:0 0 6px 0;color:#33364b}verdocs-template-reminders form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-template-reminders form input:focus{outline:none}verdocs-template-reminders form .input-row{display:-ms-flexbox;display:flex;margin:0 0 10px 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-template-reminders form .input-row label{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex}verdocs-template-reminders form .input-row verdocs-text-input{margin:0;display:-ms-flexbox;display:flex;-ms-flex:0 0 60px;flex:0 0 60px}verdocs-template-reminders form .input-row verdocs-text-input input{text-align:center}verdocs-template-reminders form .input-row verdocs-checkbox{display:-ms-flexbox;display:flex;-ms-flex:0 0 40px;flex:0 0 40px;-ms-flex-pack:center;justify-content:center}verdocs-template-reminders .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-direction:row;flex-direction:row}verdocs-template-reminders ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-reminders ::-moz-placeholder{color:#aaaaaa}verdocs-template-reminders :-ms-input-placeholder{color:#aaaaaa}verdocs-template-reminders ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-reminders ::placeholder{color:#aaaaaa}';var p=e("verdocs_template_reminders",function(){function e(e){t(this,e);this.close=r(this,"close",7);this.sdkError=r(this,"sdkError",7);this.endpoint=i.getDefault();this.templateId="";this.showPlanBlocker=false;this.sendReminders=false;this.firstReminderDays="1";this.reminderDays="1";this.dirty=false;this.loading=true}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,r,n;return __generator(this,(function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);this.endpoint.loadSession();return[4,a(this.endpoint,this.templateId)];case 1:s.sent();this.loading=false;this.sendReminders=!!o.template.reminder_id;this.dirty=false;return[3,3];case 2:n=s.sent();console.log("[TEMPLATE REMINDERS] Error loading template",n);this.loading=false;(e=this.sdkError)===null||e===void 0?void 0:e.emit(new l(n.message,(t=n.response)===null||t===void 0?void 0:t.status,(r=n.response)===null||r===void 0?void 0:r.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleCancel=function(e){var t;e.stopPropagation();this.sendReminders=!!o.template.reminder_id;this.dirty=false;(t=this.close)===null||t===void 0?void 0:t.emit()};e.prototype.handleSave=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r;return __generator(this,(function(n){switch(n.label){case 0:e.stopPropagation();if(!this.sendReminders)return[3,5];r={setup_time:864e5*+this.firstReminderDays,interval_time:864e5*+this.reminderDays};if(!!o.template.reminder_id)return[3,2];return[4,d(this.endpoint,this.templateId,r)];case 1:n.sent();return[3,4];case 2:return[4,c(this.endpoint,this.templateId,o.template.reminder_id,r)];case 3:n.sent();n.label=4;case 4:return[3,7];case 5:return[4,u(this.endpoint,this.templateId,o.template.reminder_id)];case 6:n.sent();n.label=7;case 7:this.dirty=false;(t=this.close)===null||t===void 0?void 0:t.emit();return[2]}}))}))};e.prototype.render=function(){var e=this;if(!this.endpoint.session){return n(s,null,n("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if(!this.endpoint.session||!o.template){return n(s,{class:"empty"})}return n(s,null,n("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},n("h5",null,"Reminders"),n("div",{class:"input-row"},n("label",{htmlFor:"verdocs-send-reminders"},"Send Automatic Reminders"),n("verdocs-checkbox",{id:"verdocs-send-reminders",name:"automatic-reminders",checked:this.sendReminders,value:"on",onInput:function(t){e.showPlanBlocker=true;t.target.checked=false}})),n("div",{class:"input-row"},n("label",{htmlFor:"verdocs-first-reminder-days"},"Days Before First Reminder"),n("verdocs-text-input",{id:"verdocs-first-reminder-days",type:"number",value:this.firstReminderDays,onInput:function(t){return e.firstReminderDays=t.target.value},disabled:!this.sendReminders})),n("div",{class:"input-row"},n("label",{htmlFor:"verdocs-days-between-reminders"},"Days Between Reminders"),n("verdocs-text-input",{id:"verdocs-days-between-reminders",type:"number",value:this.reminderDays,onInput:function(t){return e.reminderDays=t.target.value},disabled:!this.sendReminders})),n("div",{class:"buttons"},n("verdocs-button",{size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:function(t){return e.handleCancel(t)}}),n("verdocs-button",{size:"small",label:"Save",disabled:!this.dirty,onClick:function(t){return e.handleSave(t)}}))),this.showPlanBlocker&&n("verdocs-ok-dialog",{heading:"Upgrade to access this feature",message:"Please upgrade your plan to access this feature.",onNext:function(){return e.showPlanBlocker=false}}))};return e}());p.style=m}}}));
1
+ var __awaiter=this&&this.__awaiter||function(e,t,r,n){function s(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,i){function o(e){try{l(n.next(e))}catch(e){i(e)}}function a(e){try{l(n["throw"](e))}catch(e){i(e)}}function l(e){e.done?r(e.value):s(e.value).then(o,a)}l((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,s,i,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(e){return function(t){return l([e,t])}}function l(o){if(n)throw new TypeError("Generator is already executing.");while(r)try{if(n=1,s&&(i=o[0]&2?s["return"]:o[0]?s["throw"]||((i=s["return"])&&i.call(s),0):s.next)&&!(i=i.call(s,o[1])).done)return i;if(s=0,i)o=[o[0]&2,i.value];switch(o[0]){case 0:case 1:i=o;break;case 4:r.label++;return{value:o[1],done:false};case 5:r.label++;s=o[1];o=[0];continue;case 7:o=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(o[0]===6||o[0]===2)){r=0;continue}if(o[0]===3&&(!i||o[1]>i[0]&&o[1]<i[3])){r.label=o[1];break}if(o[0]===6&&r.label<i[1]){r.label=i[1];i=o;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(o);break}if(i[2])r.ops.pop();r.trys.pop();continue}o=t.call(e,r)}catch(e){o=[6,e];s=0}finally{n=i=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};System.register(["./p-9422b807.system.js","./p-4f63fae0.system.js","./p-03aeaebe.system.js","./p-f0f99234.system.js","./p-187b20b7.system.js","./p-af2c2f79.system.js","./p-71c7e1ba.system.js","./p-d50523fd.system.js","./p-69912cbf.system.js"],(function(e){"use strict";var t,r,n,s,i,o,a,l;return{setters:[function(e){t=e.r;r=e.c;n=e.h;s=e.H},function(e){i=e.V},function(e){o=e.s},function(e){a=e.l},function(e){l=e.S},function(){},function(){},function(){},function(){}],execute:function(){var d=function(e,t,r){return e.api.post("/templates/".concat(t,"/reminder/"),r).then((function(e){return e.data}))};var c=function(e,t,r,n){return e.api.put("/templates/".concat(t,"/reminder/").concat(r),n).then((function(e){return e.data}))};var u=function(e,t,r){return e.api.delete("/templates/".concat(t,"/reminder/").concat(r)).then((function(e){return e.data}))};var m='verdocs-template-reminders{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-reminders.loading{min-height:300px;position:relative;display:block}verdocs-template-reminders.empty{display:none}verdocs-template-reminders form{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-template-reminders form h5{font-size:16px;font-weight:bold;color:#4c56cb;margin:0 0 20px 0}verdocs-template-reminders form label{font-size:16px;font-weight:500;margin:0 0 6px 0;color:#33364b}verdocs-template-reminders form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-template-reminders form input:focus{outline:none}verdocs-template-reminders form .input-row{display:-ms-flexbox;display:flex;margin:0 0 10px 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-template-reminders form .input-row label{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex}verdocs-template-reminders form .input-row verdocs-text-input{margin:0;display:-ms-flexbox;display:flex;-ms-flex:0 0 60px;flex:0 0 60px}verdocs-template-reminders form .input-row verdocs-text-input input{text-align:center}verdocs-template-reminders form .input-row verdocs-checkbox{display:-ms-flexbox;display:flex;-ms-flex:0 0 40px;flex:0 0 40px;-ms-flex-pack:center;justify-content:center}verdocs-template-reminders .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-direction:row;flex-direction:row}verdocs-template-reminders ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-reminders ::-moz-placeholder{color:#aaaaaa}verdocs-template-reminders :-ms-input-placeholder{color:#aaaaaa}verdocs-template-reminders ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-reminders ::placeholder{color:#aaaaaa}';var p=e("verdocs_template_reminders",function(){function e(e){t(this,e);this.close=r(this,"close",7);this.sdkError=r(this,"sdkError",7);this.endpoint=i.getDefault();this.templateId="";this.showPlanBlocker=false;this.sendReminders=false;this.firstReminderDays="1";this.reminderDays="1";this.dirty=false;this.loading=true}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,r,n;return __generator(this,(function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);this.endpoint.loadSession();return[4,a(this.endpoint,this.templateId)];case 1:s.sent();this.loading=false;this.sendReminders=!!o.template.reminder_id;this.dirty=false;return[3,3];case 2:n=s.sent();console.log("[TEMPLATE REMINDERS] Error loading template",n);this.loading=false;(e=this.sdkError)===null||e===void 0?void 0:e.emit(new l(n.message,(t=n.response)===null||t===void 0?void 0:t.status,(r=n.response)===null||r===void 0?void 0:r.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleCancel=function(e){var t;e.stopPropagation();this.sendReminders=!!o.template.reminder_id;this.dirty=false;(t=this.close)===null||t===void 0?void 0:t.emit()};e.prototype.handleSave=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r;return __generator(this,(function(n){switch(n.label){case 0:e.stopPropagation();if(!this.sendReminders)return[3,5];r={setup_time:864e5*+this.firstReminderDays,interval_time:864e5*+this.reminderDays};if(!!o.template.reminder_id)return[3,2];return[4,d(this.endpoint,this.templateId,r)];case 1:n.sent();return[3,4];case 2:return[4,c(this.endpoint,this.templateId,o.template.reminder_id,r)];case 3:n.sent();n.label=4;case 4:return[3,7];case 5:return[4,u(this.endpoint,this.templateId,o.template.reminder_id)];case 6:n.sent();n.label=7;case 7:this.dirty=false;(t=this.close)===null||t===void 0?void 0:t.emit();return[2]}}))}))};e.prototype.render=function(){var e=this;if(!this.endpoint.session){return n(s,null,n("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if(!this.endpoint.session||!o.template){return n(s,{class:"empty"})}return n(s,null,n("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},n("h5",null,"Reminders"),n("div",{class:"input-row"},n("label",{htmlFor:"verdocs-send-reminders"},"Send Automatic Reminders"),n("verdocs-checkbox",{id:"verdocs-send-reminders",name:"automatic-reminders",checked:this.sendReminders,value:"on",onInput:function(t){e.showPlanBlocker=true;t.target.checked=false}})),n("div",{class:"input-row"},n("label",{htmlFor:"verdocs-first-reminder-days"},"Days Before First Reminder"),n("verdocs-text-input",{id:"verdocs-first-reminder-days",type:"number",value:this.firstReminderDays,onInput:function(t){return e.firstReminderDays=t.target.value},disabled:!this.sendReminders})),n("div",{class:"input-row"},n("label",{htmlFor:"verdocs-days-between-reminders"},"Days Between Reminders"),n("verdocs-text-input",{id:"verdocs-days-between-reminders",type:"number",value:this.reminderDays,onInput:function(t){return e.reminderDays=t.target.value},disabled:!this.sendReminders})),n("div",{class:"buttons"},n("verdocs-button",{size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:function(t){return e.handleCancel(t)}}),n("verdocs-button",{size:"small",label:"Save",disabled:!this.dirty,onClick:function(t){return e.handleSave(t)}}))),this.showPlanBlocker&&n("verdocs-ok-dialog",{heading:"Upgrade to access this feature",message:"Please upgrade your plan to access this feature.",onNext:function(){return e.showPlanBlocker=false}}))};return e}());p.style=m}}}));