@verdocs/web-sdk 1.14.0 → 1.14.2

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 (135) hide show
  1. package/dist/cjs/{Permissions-1fd17279.js → Permissions-4b710db2.js} +1 -0
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/verdocs-envelope-recipient-summary.cjs.entry.js +9 -6
  4. package/dist/cjs/verdocs-envelope-sidebar.cjs.entry.js +21 -15
  5. package/dist/cjs/verdocs-view.cjs.entry.js +4 -1
  6. package/dist/cjs/verdocs-web-sdk.cjs.js +1 -1
  7. package/dist/collection/components/embeds/verdocs-view/verdocs-view.js +45 -0
  8. package/dist/collection/components/envelopes/verdocs-envelope-recipient-summary/verdocs-envelope-recipient-summary.css +9 -4
  9. package/dist/collection/components/envelopes/verdocs-envelope-recipient-summary/verdocs-envelope-recipient-summary.js +85 -13
  10. package/dist/collection/components/envelopes/verdocs-envelope-recipient-summary/verdocs-envelope-recipient-summary.stories.js +8 -2
  11. package/dist/collection/components/envelopes/verdocs-envelope-sidebar/verdocs-envelope-sidebar.css +8 -0
  12. package/dist/collection/components/envelopes/verdocs-envelope-sidebar/verdocs-envelope-sidebar.js +38 -16
  13. package/dist/collection/components/envelopes/verdocs-envelope-sidebar/verdocs-envelope-sidebar.stories.js +3 -1
  14. package/dist/components/Envelopes.js +1 -1
  15. package/dist/components/Permissions.js +1 -1
  16. package/dist/components/Toast.js +74 -1
  17. package/dist/components/verdocs-envelope-document-page2.js +1 -1
  18. package/dist/components/verdocs-envelope-recipient-summary.js +1 -212
  19. package/dist/components/verdocs-envelope-recipient-summary2.js +219 -0
  20. package/dist/components/verdocs-envelope-sidebar.js +37 -18
  21. package/dist/components/verdocs-sign.js +2 -3
  22. package/dist/components/verdocs-view2.js +4 -1
  23. package/dist/custom-elements.json +12 -0
  24. package/dist/docs.json +110 -7
  25. package/dist/esm/{Envelopes-1c6af4ee.js → Envelopes-c3d471e5.js} +1 -1
  26. package/dist/esm/{Permissions-dfce0dc8.js → Permissions-7192ef7c.js} +1 -1
  27. package/dist/esm/loader.js +1 -1
  28. package/dist/esm/{utils-f1ffad6e.js → utils-75cee3f6.js} +1 -1
  29. package/dist/esm/verdocs-dropdown_2.entry.js +2 -2
  30. package/dist/esm/verdocs-envelope-recipient-summary.entry.js +10 -7
  31. package/dist/esm/verdocs-envelope-sidebar.entry.js +22 -16
  32. package/dist/esm/verdocs-field-checkbox.entry.js +2 -2
  33. package/dist/esm/verdocs-field-date.entry.js +2 -2
  34. package/dist/esm/verdocs-field-dropdown.entry.js +2 -2
  35. package/dist/esm/verdocs-field-initial.entry.js +2 -2
  36. package/dist/esm/verdocs-field-payment.entry.js +2 -2
  37. package/dist/esm/verdocs-field-radio-button.entry.js +2 -2
  38. package/dist/esm/verdocs-field-signature.entry.js +2 -2
  39. package/dist/esm/verdocs-field-textarea.entry.js +2 -2
  40. package/dist/esm/verdocs-field-textbox.entry.js +2 -2
  41. package/dist/esm/verdocs-field-timestamp.entry.js +2 -2
  42. package/dist/esm/verdocs-preview.entry.js +2 -2
  43. package/dist/esm/verdocs-send.entry.js +2 -2
  44. package/dist/esm/verdocs-sign.entry.js +2 -2
  45. package/dist/esm/verdocs-template-document-page_2.entry.js +2 -2
  46. package/dist/esm/verdocs-template-fields_4.entry.js +2 -2
  47. package/dist/esm/verdocs-view.entry.js +6 -3
  48. package/dist/esm/verdocs-web-sdk.js +1 -1
  49. package/dist/esm-es5/{Envelopes-1c6af4ee.js → Envelopes-c3d471e5.js} +1 -1
  50. package/dist/esm-es5/{Permissions-dfce0dc8.js → Permissions-7192ef7c.js} +1 -1
  51. package/dist/esm-es5/loader.js +1 -1
  52. package/dist/esm-es5/{utils-f1ffad6e.js → utils-75cee3f6.js} +1 -1
  53. package/dist/esm-es5/verdocs-dropdown_2.entry.js +1 -1
  54. package/dist/esm-es5/verdocs-envelope-recipient-summary.entry.js +1 -1
  55. package/dist/esm-es5/verdocs-envelope-sidebar.entry.js +1 -1
  56. package/dist/esm-es5/verdocs-field-checkbox.entry.js +1 -1
  57. package/dist/esm-es5/verdocs-field-date.entry.js +1 -1
  58. package/dist/esm-es5/verdocs-field-dropdown.entry.js +1 -1
  59. package/dist/esm-es5/verdocs-field-initial.entry.js +1 -1
  60. package/dist/esm-es5/verdocs-field-payment.entry.js +1 -1
  61. package/dist/esm-es5/verdocs-field-radio-button.entry.js +1 -1
  62. package/dist/esm-es5/verdocs-field-signature.entry.js +1 -1
  63. package/dist/esm-es5/verdocs-field-textarea.entry.js +1 -1
  64. package/dist/esm-es5/verdocs-field-textbox.entry.js +1 -1
  65. package/dist/esm-es5/verdocs-field-timestamp.entry.js +1 -1
  66. package/dist/esm-es5/verdocs-preview.entry.js +1 -1
  67. package/dist/esm-es5/verdocs-send.entry.js +1 -1
  68. package/dist/esm-es5/verdocs-sign.entry.js +1 -1
  69. package/dist/esm-es5/verdocs-template-document-page_2.entry.js +1 -1
  70. package/dist/esm-es5/verdocs-template-fields_4.entry.js +1 -1
  71. package/dist/esm-es5/verdocs-view.entry.js +1 -1
  72. package/dist/esm-es5/verdocs-web-sdk.js +1 -1
  73. package/dist/types/components/embeds/verdocs-view/verdocs-view.d.ts +15 -0
  74. package/dist/types/components/envelopes/verdocs-envelope-recipient-summary/verdocs-envelope-recipient-summary.d.ts +21 -3
  75. package/dist/types/components/envelopes/verdocs-envelope-recipient-summary/verdocs-envelope-recipient-summary.stories.d.ts +4 -1
  76. package/dist/types/components/envelopes/verdocs-envelope-sidebar/verdocs-envelope-sidebar.d.ts +8 -0
  77. package/dist/types/components/envelopes/verdocs-envelope-sidebar/verdocs-envelope-sidebar.stories.d.ts +3 -1
  78. package/dist/types/components.d.ts +43 -3
  79. package/dist/verdocs-web-sdk/p-0251ca3a.entry.js +1 -0
  80. package/dist/verdocs-web-sdk/{p-cb5ddbc2.entry.js → p-05f8c1c8.entry.js} +1 -1
  81. package/dist/verdocs-web-sdk/{p-86e65a30.entry.js → p-060a5281.entry.js} +1 -1
  82. package/dist/verdocs-web-sdk/{p-c3efe8df.entry.js → p-0b99a23e.entry.js} +1 -1
  83. package/dist/verdocs-web-sdk/{p-683d5b6a.system.entry.js → p-18e8f1b5.system.entry.js} +1 -1
  84. package/dist/verdocs-web-sdk/p-1cf38cea.system.js +1 -1
  85. package/dist/verdocs-web-sdk/{p-fec8850f.system.entry.js → p-257b575f.system.entry.js} +1 -1
  86. package/dist/verdocs-web-sdk/{p-d6f8a709.entry.js → p-2cc146cb.entry.js} +1 -1
  87. package/dist/verdocs-web-sdk/{p-e01a6d2f.entry.js → p-3649e7e0.entry.js} +1 -1
  88. package/dist/verdocs-web-sdk/{p-159666a7.system.entry.js → p-375b1328.system.entry.js} +1 -1
  89. package/dist/verdocs-web-sdk/{p-5b1f8c9d.entry.js → p-396207e9.entry.js} +1 -1
  90. package/dist/verdocs-web-sdk/p-483ded0c.system.entry.js +1 -0
  91. package/dist/verdocs-web-sdk/{p-3bc2377f.system.entry.js → p-4e8ae503.system.entry.js} +1 -1
  92. package/dist/verdocs-web-sdk/{p-b1847b74.system.entry.js → p-4f947df8.system.entry.js} +1 -1
  93. package/dist/verdocs-web-sdk/{p-46302433.system.entry.js → p-5a456647.system.entry.js} +1 -1
  94. package/dist/verdocs-web-sdk/{p-58db26cd.js → p-5f61a3ec.js} +1 -1
  95. package/dist/verdocs-web-sdk/{p-534bd4bc.system.entry.js → p-609e9838.system.entry.js} +1 -1
  96. package/dist/verdocs-web-sdk/{p-aed2792a.entry.js → p-611e0ebe.entry.js} +1 -1
  97. package/dist/verdocs-web-sdk/{p-ca698cbb.system.entry.js → p-63a75b10.system.entry.js} +1 -1
  98. package/dist/verdocs-web-sdk/{p-aad84034.system.entry.js → p-73a8954f.system.entry.js} +1 -1
  99. package/dist/verdocs-web-sdk/{p-42406cc5.system.entry.js → p-783a95b0.system.entry.js} +1 -1
  100. package/dist/verdocs-web-sdk/p-79844d8f.entry.js +1 -0
  101. package/dist/verdocs-web-sdk/{p-5edb1116.system.entry.js → p-7b5f4edf.system.entry.js} +1 -1
  102. package/dist/verdocs-web-sdk/p-848371c9.entry.js +1 -0
  103. package/dist/verdocs-web-sdk/p-8c57f5d0.system.js +1 -0
  104. package/dist/verdocs-web-sdk/{p-9d16e9f3.system.entry.js → p-935e379f.system.entry.js} +1 -1
  105. package/dist/verdocs-web-sdk/{p-6e839ddd.system.js → p-973ebb54.system.js} +1 -1
  106. package/dist/verdocs-web-sdk/{p-72c87a28.js → p-9b73909f.js} +1 -1
  107. package/dist/verdocs-web-sdk/{p-1e515ea5.entry.js → p-a3ab475a.entry.js} +1 -1
  108. package/dist/verdocs-web-sdk/{p-da7c681e.entry.js → p-a8043f9d.entry.js} +1 -1
  109. package/dist/verdocs-web-sdk/p-aa3a445b.system.entry.js +1 -0
  110. package/dist/verdocs-web-sdk/{p-d9a0d9b0.entry.js → p-b0b84793.entry.js} +1 -1
  111. package/dist/verdocs-web-sdk/{p-68679b1a.system.entry.js → p-b7af4b3f.system.entry.js} +1 -1
  112. package/dist/verdocs-web-sdk/p-b7cb5531.entry.js +1 -0
  113. package/dist/verdocs-web-sdk/{p-761f9e99.system.entry.js → p-b970a5fe.system.entry.js} +1 -1
  114. package/dist/verdocs-web-sdk/{p-87c778da.system.entry.js → p-c472fbd0.system.entry.js} +1 -1
  115. package/dist/verdocs-web-sdk/p-cf11b652.system.entry.js +1 -0
  116. package/dist/verdocs-web-sdk/{p-3986a092.entry.js → p-d170f421.entry.js} +1 -1
  117. package/dist/verdocs-web-sdk/p-d869c39c.js +1 -0
  118. package/dist/verdocs-web-sdk/{p-4ea7c5fb.entry.js → p-e4aaa309.entry.js} +1 -1
  119. package/dist/verdocs-web-sdk/{p-77ef5b38.entry.js → p-e8ef4d44.entry.js} +1 -1
  120. package/dist/verdocs-web-sdk/{p-56b6d0c8.system.js → p-ee20297a.system.js} +1 -1
  121. package/dist/verdocs-web-sdk/{p-7d67ee9a.entry.js → p-ee743904.entry.js} +1 -1
  122. package/dist/verdocs-web-sdk/{p-e6cce3e9.system.entry.js → p-fa4e7dd4.system.entry.js} +1 -1
  123. package/dist/verdocs-web-sdk/{p-1b25b993.entry.js → p-fe0da205.entry.js} +1 -1
  124. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  125. package/package.json +1 -1
  126. package/dist/components/Recipients.js +0 -74
  127. package/dist/verdocs-web-sdk/p-07088559.entry.js +0 -1
  128. package/dist/verdocs-web-sdk/p-459cbee9.entry.js +0 -1
  129. package/dist/verdocs-web-sdk/p-45e94780.system.entry.js +0 -1
  130. package/dist/verdocs-web-sdk/p-620d2c88.entry.js +0 -1
  131. package/dist/verdocs-web-sdk/p-6412bf20.js +0 -1
  132. package/dist/verdocs-web-sdk/p-c165e8d3.entry.js +0 -1
  133. package/dist/verdocs-web-sdk/p-d7a95cb6.system.entry.js +0 -1
  134. package/dist/verdocs-web-sdk/p-f38aec2d.system.js +0 -1
  135. package/dist/verdocs-web-sdk/p-f465a339.system.entry.js +0 -1
@@ -19,6 +19,9 @@ export class VerdocsEnvelopeRecipientSummary {
19
19
  this.store = null;
20
20
  this.endpoint = VerdocsEndpoint.getDefault();
21
21
  this.envelopeId = '';
22
+ this.canSendAnother = true;
23
+ this.canView = true;
24
+ this.canDone = true;
22
25
  this.envelope = undefined;
23
26
  this.isOpen = undefined;
24
27
  this.recipientStatusIcons = [];
@@ -55,17 +58,17 @@ export class VerdocsEnvelopeRecipientSummary {
55
58
  handleAnother(e) {
56
59
  var _a;
57
60
  e.preventDefault();
58
- (_a = this.another) === null || _a === void 0 ? void 0 : _a.emit();
61
+ (_a = this.another) === null || _a === void 0 ? void 0 : _a.emit({ envelope: this.store.state });
59
62
  }
60
63
  handleView(e) {
61
64
  var _a;
62
65
  e.preventDefault();
63
- (_a = this.view) === null || _a === void 0 ? void 0 : _a.emit();
66
+ (_a = this.view) === null || _a === void 0 ? void 0 : _a.emit({ envelope: this.store.state });
64
67
  }
65
68
  handleDone(e) {
66
69
  var _a;
67
70
  e.preventDefault();
68
- (_a = this.next) === null || _a === void 0 ? void 0 : _a.emit();
71
+ (_a = this.next) === null || _a === void 0 ? void 0 : _a.emit({ envelope: this.store.state });
69
72
  }
70
73
  copyLink(link) {
71
74
  navigator.clipboard
@@ -98,7 +101,7 @@ export class VerdocsEnvelopeRecipientSummary {
98
101
  const link = this.links[recipient.role_name];
99
102
  const gettingLink = this.gettingLinks[recipient.role_name];
100
103
  return (h("div", { class: "recipient" }, h("div", { class: "role-name" }, recipient.role_name), h("div", { class: "role-details" }, h("div", { class: "role-info" }, h("div", { class: "role-full-name" }, recipient.full_name, " (", recipient.email || recipient.phone, ")"), showLinkButton && !link && h("verdocs-button", { size: "small", variant: "outline", label: "Get Link", disabled: gettingLink, onClick: () => this.getLink(recipient) })), link && (h("div", { class: "link-wrapper" }, h("div", { class: "link" }, link), h("verdocs-button", { size: "small", variant: "outline", label: "Copy", onClick: () => this.copyLink(link) }))))));
101
- })), h("div", { class: "buttons" }, h("verdocs-button", { size: "small", label: "Send Another", onClick: e => this.handleAnother(e) }), h("verdocs-button", { size: "small", label: "View Now", onClick: e => this.handleView(e) }), h("verdocs-button", { size: "small", label: "Done", onClick: e => this.handleDone(e) })))));
104
+ })), (this.canSendAnother || this.canView || this.canDone) && (h("div", { class: "buttons" }, this.canSendAnother && h("verdocs-button", { size: "small", label: "Send Another", onClick: e => this.handleAnother(e) }), this.canView && h("verdocs-button", { size: "small", label: "View Now", onClick: e => this.handleView(e) }), this.canDone && h("verdocs-button", { size: "small", label: "Done", onClick: e => this.handleDone(e) }))))));
102
105
  }
103
106
  static get is() { return "verdocs-envelope-recipient-summary"; }
104
107
  static get originalStyleUrls() {
@@ -152,6 +155,60 @@ export class VerdocsEnvelopeRecipientSummary {
152
155
  "reflect": false,
153
156
  "defaultValue": "''"
154
157
  },
158
+ "canSendAnother": {
159
+ "type": "boolean",
160
+ "mutable": false,
161
+ "complexType": {
162
+ "original": "boolean",
163
+ "resolved": "boolean",
164
+ "references": {}
165
+ },
166
+ "required": false,
167
+ "optional": false,
168
+ "docs": {
169
+ "tags": [],
170
+ "text": "Enable or disable the Send Another button."
171
+ },
172
+ "attribute": "can-send-another",
173
+ "reflect": false,
174
+ "defaultValue": "true"
175
+ },
176
+ "canView": {
177
+ "type": "boolean",
178
+ "mutable": false,
179
+ "complexType": {
180
+ "original": "boolean",
181
+ "resolved": "boolean",
182
+ "references": {}
183
+ },
184
+ "required": false,
185
+ "optional": false,
186
+ "docs": {
187
+ "tags": [],
188
+ "text": "Enable or disable the View button."
189
+ },
190
+ "attribute": "can-view",
191
+ "reflect": false,
192
+ "defaultValue": "true"
193
+ },
194
+ "canDone": {
195
+ "type": "boolean",
196
+ "mutable": false,
197
+ "complexType": {
198
+ "original": "boolean",
199
+ "resolved": "boolean",
200
+ "references": {}
201
+ },
202
+ "required": false,
203
+ "optional": false,
204
+ "docs": {
205
+ "tags": [],
206
+ "text": "Enable or disable the Done button."
207
+ },
208
+ "attribute": "can-done",
209
+ "reflect": false,
210
+ "defaultValue": "true"
211
+ },
155
212
  "envelope": {
156
213
  "type": "unknown",
157
214
  "mutable": false,
@@ -195,9 +252,14 @@ export class VerdocsEnvelopeRecipientSummary {
195
252
  "text": "Event fired when the user clicks Send Another to proceed. It is up to the host application\nto redirect the user to the appropriate next workflow step."
196
253
  },
197
254
  "complexType": {
198
- "original": "any",
199
- "resolved": "any",
200
- "references": {}
255
+ "original": "{envelope: IEnvelope}",
256
+ "resolved": "{ envelope: IEnvelope; }",
257
+ "references": {
258
+ "IEnvelope": {
259
+ "location": "import",
260
+ "path": "@verdocs/js-sdk/Envelopes/Types"
261
+ }
262
+ }
201
263
  }
202
264
  }, {
203
265
  "method": "view",
@@ -210,9 +272,14 @@ export class VerdocsEnvelopeRecipientSummary {
210
272
  "text": "Event fired when the user clicks Send Another to proceed. It is up to the host application\nto redirect the user to the appropriate next workflow step."
211
273
  },
212
274
  "complexType": {
213
- "original": "any",
214
- "resolved": "any",
215
- "references": {}
275
+ "original": "{envelope: IEnvelope}",
276
+ "resolved": "{ envelope: IEnvelope; }",
277
+ "references": {
278
+ "IEnvelope": {
279
+ "location": "import",
280
+ "path": "@verdocs/js-sdk/Envelopes/Types"
281
+ }
282
+ }
216
283
  }
217
284
  }, {
218
285
  "method": "next",
@@ -225,9 +292,14 @@ export class VerdocsEnvelopeRecipientSummary {
225
292
  "text": "Event fired when the user clicks Done to proceed. It is up to the host application\nto redirect the user to the appropriate next workflow step."
226
293
  },
227
294
  "complexType": {
228
- "original": "any",
229
- "resolved": "any",
230
- "references": {}
295
+ "original": "{envelope: IEnvelope}",
296
+ "resolved": "{ envelope: IEnvelope; }",
297
+ "references": {
298
+ "IEnvelope": {
299
+ "location": "import",
300
+ "path": "@verdocs/js-sdk/Envelopes/Types"
301
+ }
302
+ }
231
303
  }
232
304
  }, {
233
305
  "method": "sdkError",
@@ -3,7 +3,10 @@ export default {
3
3
  title: 'Envelopes/Recipient Summary',
4
4
  component: 'verdocs-envelope-recipient-summary',
5
5
  args: {
6
- envelopeId: '498c2404-3d8c-4325-bdd3-e8c7c70e63b1',
6
+ envelopeId: '',
7
+ canView: true,
8
+ canDone: true,
9
+ canSendAnother: true,
7
10
  },
8
11
  argTypes: {
9
12
  another: { action: 'another' },
@@ -11,8 +14,11 @@ export default {
11
14
  next: { action: 'next' },
12
15
  },
13
16
  };
14
- export const RecipientSummary = ({ envelopeId, another, view, next }) => html `<verdocs-envelope-recipient-summary
17
+ export const RecipientSummary = ({ envelopeId, another, view, next, canView, canDone, canSendAnother }) => html `<verdocs-envelope-recipient-summary
15
18
  .envelopeId="${envelopeId}"
19
+ .canView="${canView}"
20
+ .canDone="${canDone}"
21
+ .canSendAnother="${canSendAnother}"
16
22
  @another=${another}
17
23
  @view=${view}
18
24
  @next=${next}
@@ -66,6 +66,14 @@ verdocs-envelope-sidebar .value {
66
66
  color: #fff;
67
67
  flex: 0;
68
68
  }
69
+ verdocs-envelope-sidebar .manage-recipients-button {
70
+ align-self: center;
71
+ white-space: nowrap;
72
+ }
73
+ verdocs-envelope-sidebar .manage-recipients-button .label {
74
+ color: #ffffff;
75
+ font-size: 14px;
76
+ }
69
77
  verdocs-envelope-sidebar .recipient-detail {
70
78
  flex: 0;
71
79
  padding: 8px;
@@ -2,8 +2,9 @@ import { format } from 'date-fns';
2
2
  import { VerdocsEndpoint } from '@verdocs/js-sdk';
3
3
  import { throttledGetEnvelope } from '@verdocs/js-sdk/Envelopes/Envelopes';
4
4
  import { h, Host } from '@stencil/core';
5
+ import { userIsEnvelopeOwner } from '@verdocs/js-sdk/Envelopes/Permissions';
6
+ import { VerdocsToast } from '../../../utils/Toast';
5
7
  import { SDKError } from '../../../utils/errors';
6
- import { getInPersonLink } from '@verdocs/js-sdk/Envelopes/Recipients';
7
8
  const InformationCircle = `<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="#ffffff"><path stroke-linecap="round" stroke-linejoin="round" d="M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z" /></svg>`;
8
9
  const Users = `<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="#ffffff"><path stroke-linecap="round" stroke-linejoin="round" d="M15 19.128a9.38 9.38 0 002.625.372 9.337 9.337 0 004.121-.952 4.125 4.125 0 00-7.533-2.493M15 19.128v-.003c0-1.113-.285-2.16-.786-3.07M15 19.128v.106A12.318 12.318 0 018.624 21c-2.331 0-4.512-.645-6.374-1.766l-.001-.109a6.375 6.375 0 0111.964-3.07M12 6.375a3.375 3.375 0 11-6.75 0 3.375 3.375 0 016.75 0zm8.25 2.25a2.625 2.625 0 11-5.25 0 2.625 2.625 0 015.25 0z" /></svg>`;
9
10
  const ClipboardDocuments = `<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="#ffffff"><path stroke-linecap="round" stroke-linejoin="round" d="M9 12h3.75M9 15h3.75M9 18h3.75m3 .75H18a2.25 2.25 0 002.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 00-1.123-.08m-5.801 0c-.065.21-.1.433-.1.664 0 .414.336.75.75.75h4.5a.75.75 0 00.75-.75 2.25 2.25 0 00-.1-.664m-5.8 0A2.251 2.251 0 0113.5 2.25H15c1.012 0 1.867.668 2.15 1.586m-5.8 0c-.376.023-.75.05-1.124.08C9.095 4.01 8.25 4.973 8.25 6.108V8.25m0 0H4.875c-.621 0-1.125.504-1.125 1.125v11.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V9.375c0-.621-.504-1.125-1.125-1.125H8.25zM6.75 12h.008v.008H6.75V12zm0 3h.008v.008H6.75V15zm0 3h.008v.008H6.75V18z" /></svg>`;
@@ -41,6 +42,7 @@ export class VerdocsEnvelopeSidebar {
41
42
  this.roleNames = [];
42
43
  this.activeTab = 1;
43
44
  this.panelOpen = false;
45
+ this.showManageDialog = false;
44
46
  }
45
47
  componentWillLoad() {
46
48
  this.endpoint.loadSession();
@@ -85,20 +87,14 @@ export class VerdocsEnvelopeSidebar {
85
87
  var _a;
86
88
  console.log('[SIDEBAR] Recipient action', id, recipient);
87
89
  switch (id) {
88
- case 'inperson':
89
- getInPersonLink(this.endpoint, recipient.envelope_id, recipient.role_name)
90
- // TODO: Can remove "any" once js-sdk is updated
91
- .then((response) => {
92
- var _a, _b;
93
- console.log('Got in person link');
94
- return (_b = (_a = window === null || window === void 0 ? void 0 : window.navigator) === null || _a === void 0 ? void 0 : _a.clipboard) === null || _b === void 0 ? void 0 : _b.writeText(response.link);
95
- })
96
- .then(r => console.log('copy result', r))
97
- .catch(e => console.warn('[SIDEBAR] Error getting link', e));
98
- break;
99
90
  case 'reminder':
91
+ VerdocsToast('This feature will be enabled in a future release. Please try again later.', { style: 'info' });
92
+ break;
100
93
  case 'modify':
94
+ VerdocsToast('This feature will be enabled in a future release. Please try again later.', { style: 'info' });
95
+ break;
101
96
  case 'details':
97
+ VerdocsToast('This feature will be enabled in a future release. Please try again later.', { style: 'info' });
102
98
  break;
103
99
  }
104
100
  (_a = this.envelopeUpdated) === null || _a === void 0 ? void 0 : _a.emit({ endpoint: this.endpoint, envelope: this.envelope, event: id });
@@ -223,7 +219,7 @@ export class VerdocsEnvelopeSidebar {
223
219
  return h(Host, null);
224
220
  }
225
221
  const session = this.endpoint.getSession();
226
- const isEnvelopeOwner = session.profile_id === this.envelope.profile_id; // TODO: What about org admins?
222
+ const isEnvelopeOwner = userIsEnvelopeOwner(session, this.envelope);
227
223
  const historyEntries = this.prepareHistoryEntries();
228
224
  console.log('e', this.envelope);
229
225
  return (h(Host, { class: this.panelOpen ? 'open' : '' }, h("div", { class: "buttons" }, h("button", { class: this.activeTab === 1 ? 'active' : '', onClick: () => this.setTab(1), innerHTML: InformationCircle }), h("button", { class: this.activeTab === 2 ? 'active' : '', onClick: () => this.setTab(2), innerHTML: Users }), h("button", { class: this.activeTab === 3 ? 'active' : '', onClick: () => this.setTab(3), innerHTML: ClipboardDocuments })), this.activeTab === 1 && (h("div", { class: "content" }, h("div", { class: "title" }, "Details"), h("div", { class: "label" }, "Envelope ID"), h("div", { class: "value" }, this.envelope.id), h("div", { class: "label" }, "Date Created"), h("div", { class: "value" }, format(new Date(this.envelope.created_at), 'PP pp')), h("div", { class: "label" }, "Last Modified"), h("div", { class: "value" }, format(new Date(this.envelope.updated_at), 'PP pp')), h("div", { class: "label" }, "Status"), h("div", { class: "value" }, this.envelope.status), h("div", { class: "label" }, "Verdoc Owner ID"), h("div", { class: "value" }, this.envelope.profile_id), h("div", { class: "label" }, "Verdoc Owner Name"), h("div", { class: "value" }, (_a = this.envelope.profile) === null || _a === void 0 ? void 0 :
@@ -231,10 +227,15 @@ export class VerdocsEnvelopeSidebar {
231
227
  _b.last_name), h("div", { class: "label" }, "Verdoc Owner Email"), h("div", { class: "value" }, (_c = this.envelope.profile) === null || _c === void 0 ? void 0 : _c.email))), this.activeTab === 2 && (h("div", { class: "content" }, h("div", { class: "title" }, "Recipients"), this.sortedRecipients.map((recipient, index) => (h("div", { class: "recipient-detail" }, h("div", { class: "recipient-header" }, h("div", { class: "recipient-number" }, index + 1), h("div", { class: "recipient-type" }, recipient.role_name), h("div", { class: { 'recipient-status': true, [recipient.status]: true } }, recipient.status), isEnvelopeOwner && (h("verdocs-dropdown", { onOptionSelected: item => this.handleRecipientAction(recipient, item.detail.id), options: [
232
228
  { id: 'reminder', label: 'Send Reminder', disabled: !this.canResendRecipient(recipient) },
233
229
  { id: 'modify', label: 'Modify Recipient', disabled: !this.canModifyRecipient(recipient) },
234
- { id: 'inperson', label: 'Get In-Person Link', disabled: !this.canModifyRecipient(recipient) || !['invited', 'opened'].includes(recipient.status) },
235
230
  // TODO: Details dialog
236
231
  // {id:'details',label: 'View Details'},
237
- ] }))), h("dic", { class: "recipient-content" }, h("div", { class: "recipient-name" }, recipient.full_name), h("div", { class: "recipient-name" }, recipient.email), h("div", { class: "recipient-name" }, recipient.phone))))))), this.activeTab === 3 && (h("div", { class: "content" }, h("div", { class: "title" }, "History"), historyEntries.map(entry => (h("div", { class: "history-entry" }, h("div", { class: "activity-icon", innerHTML: ActivityIcons[entry.icon] || entry.icon }), h("div", { class: "activity-details" }, h("div", { class: "activity-text" }, entry.message), h("div", { class: "activity-date" }, format(entry.date, 'PP pp'))))))))));
232
+ ] }))), h("dic", { class: "recipient-content" }, h("div", { class: "recipient-name" }, recipient.full_name), h("div", { class: "recipient-name" }, recipient.email), h("div", { class: "recipient-name" }, recipient.phone))))), isEnvelopeOwner && h("verdocs-button", { class: "manage-recipients-button", variant: "standard", label: "Manage Recipients", onClick: () => (this.showManageDialog = true) }))), this.activeTab === 3 && (h("div", { class: "content" }, h("div", { class: "title" }, "History"), historyEntries.map(entry => (h("div", { class: "history-entry" }, h("div", { class: "activity-icon", innerHTML: ActivityIcons[entry.icon] || entry.icon }), h("div", { class: "activity-details" }, h("div", { class: "activity-text" }, entry.message), h("div", { class: "activity-date" }, format(entry.date, 'PP pp')))))))), this.showManageDialog && (h("verdocs-envelope-recipient-summary", { envelopeId: this.envelopeId, canView: false, onAnother: () => {
233
+ var _a;
234
+ this.showManageDialog = false;
235
+ (_a = this.another) === null || _a === void 0 ? void 0 : _a.emit({ envelope: this.envelope });
236
+ }, onNext: () => {
237
+ this.showManageDialog = false;
238
+ } }))));
238
239
  }
239
240
  static get is() { return "verdocs-envelope-sidebar"; }
240
241
  static get originalStyleUrls() {
@@ -296,7 +297,8 @@ export class VerdocsEnvelopeSidebar {
296
297
  "sortedRecipients": {},
297
298
  "roleNames": {},
298
299
  "activeTab": {},
299
- "panelOpen": {}
300
+ "panelOpen": {},
301
+ "showManageDialog": {}
300
302
  };
301
303
  }
302
304
  static get events() {
@@ -359,6 +361,26 @@ export class VerdocsEnvelopeSidebar {
359
361
  "resolved": "{ open: boolean; }",
360
362
  "references": {}
361
363
  }
364
+ }, {
365
+ "method": "another",
366
+ "name": "another",
367
+ "bubbles": true,
368
+ "cancelable": true,
369
+ "composed": true,
370
+ "docs": {
371
+ "tags": [],
372
+ "text": "Event fired when the user clicks Send Another in the Manage Recipients dialog. It is up to the host application\nto redirect the user to the appropriate next workflow step."
373
+ },
374
+ "complexType": {
375
+ "original": "{envelope: IEnvelope}",
376
+ "resolved": "{ envelope: IEnvelope; }",
377
+ "references": {
378
+ "IEnvelope": {
379
+ "location": "import",
380
+ "path": "@verdocs/js-sdk/Envelopes/Types"
381
+ }
382
+ }
383
+ }
362
384
  }];
363
385
  }
364
386
  }
@@ -8,6 +8,8 @@ export default {
8
8
  argTypes: {
9
9
  envelopeId: { name: 'envelopeId' },
10
10
  toggle: { action: 'toggle' },
11
+ another: { action: 'another' },
12
+ envelopeUpdated: { action: 'envelopeUpdated' },
11
13
  },
12
14
  };
13
- export const EnvelopeSidebar = ({ envelopeId, toggle }) => html `<verdocs-envelope-sidebar .envelopeId=${envelopeId} @toggle=${toggle} />`;
15
+ export const EnvelopeSidebar = ({ envelopeId, toggle, another, envelopeUpdated }) => html `<verdocs-envelope-sidebar .envelopeId=${envelopeId} @toggle=${toggle} @envelopeUpdated=${envelopeUpdated} @another=${another} />`;
@@ -163,4 +163,4 @@ var throttledGetEnvelope = function (endpoint, envelopeId) {
163
163
  });
164
164
  };
165
165
 
166
- export { getSigningSession as a, updateEnvelopeFieldSignature as b, updateEnvelopeFieldInitials as c, getEnvelopeDocumentPageDisplayUri as d, cancelEnvelope as e, getEnvelopeFile as f, getEnvelope as g, getFieldAttachment as h, throttledGetEnvelope as t, updateEnvelopeField as u };
166
+ export { updateEnvelopeFieldSignature as a, updateEnvelopeFieldInitials as b, getEnvelopeDocumentPageDisplayUri as c, getEnvelope as d, cancelEnvelope as e, getEnvelopeFile as f, getSigningSession as g, getFieldAttachment as h, throttledGetEnvelope as t, updateEnvelopeField as u };
@@ -31,4 +31,4 @@ var getRecipientsWithActions = function (envelope) { return ((envelope === null
31
31
  */
32
32
  var recipientCanAct = function (recipient, recipientsWithActions) { var _a; return recipient.sequence === ((_a = recipientsWithActions === null || recipientsWithActions === void 0 ? void 0 : recipientsWithActions[0]) === null || _a === void 0 ? void 0 : _a.sequence); };
33
33
 
34
- export { getRecipientsWithActions as g, recipientCanAct as r, userCanCancelEnvelope as u };
34
+ export { userCanCancelEnvelope as a, getRecipientsWithActions as g, recipientCanAct as r, userIsEnvelopeOwner as u };
@@ -1,3 +1,76 @@
1
+ var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
11
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
12
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
13
+ function verb(n) { return function (v) { return step([n, v]); }; }
14
+ function step(op) {
15
+ if (f) throw new TypeError("Generator is already executing.");
16
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
17
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
18
+ if (y = 0, t) op = [op[0] & 2, t.value];
19
+ switch (op[0]) {
20
+ case 0: case 1: t = op; break;
21
+ case 4: _.label++; return { value: op[1], done: false };
22
+ case 5: _.label++; y = op[1]; op = [0]; continue;
23
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
24
+ default:
25
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
26
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
27
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
28
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
29
+ if (t[2]) _.ops.pop();
30
+ _.trys.pop(); continue;
31
+ }
32
+ op = body.call(thisArg, _);
33
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
34
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
35
+ }
36
+ };
37
+ /**
38
+ * Update a recipient's status block
39
+ */
40
+ var updateRecipient = function (endpoint, envelopeId, roleName, params) { return __awaiter(void 0, void 0, void 0, function () {
41
+ return __generator(this, function (_a) {
42
+ return [2 /*return*/, endpoint.api //
43
+ .put("/envelopes/".concat(envelopeId, "/recipients/").concat(roleName), params)
44
+ .then(function (r) { return r.data; })];
45
+ });
46
+ }); };
47
+ /**
48
+ * Submit an envelope (signing is finished). Note that all fields must be valid/completed for this to succeed.
49
+ */
50
+ var envelopeRecipientSubmit = function (endpoint, envelopeId, roleName) {
51
+ return updateRecipient(endpoint, envelopeId, roleName, { action: 'submit' });
52
+ };
53
+ /**
54
+ * Decline to complete an envelope (signing will not terminated).
55
+ */
56
+ var envelopeRecipientDecline = function (endpoint, envelopeId, roleName) {
57
+ return updateRecipient(endpoint, envelopeId, roleName, { action: 'decline' });
58
+ };
59
+ /**
60
+ * Agree to electronic signing.
61
+ */
62
+ var envelopeRecipientAgree = function (endpoint, envelopeId, roleName, agreed) {
63
+ return updateRecipient(endpoint, envelopeId, roleName, { action: 'update', agreed: agreed });
64
+ };
65
+ /**
66
+ * Get an in-person signing link.
67
+ */
68
+ var getInPersonLink = function (endpoint, envelopeId, roleName) {
69
+ return endpoint.api //
70
+ .get("/envelopes/".concat(envelopeId, "/recipients/").concat(encodeURIComponent(roleName), "?in_person_link=true"))
71
+ .then(function (r) { return r.data; });
72
+ };
73
+
1
74
  /**
2
75
  * Simple helper to display basic toast messages. These toasts do not stack, and
3
76
  * because of this are meant to be used only for infrequent notifications (those
@@ -62,4 +135,4 @@ box-shadow: 0 3px 7px 2px rgba(0, 0, 0, 0.12), 0 10px 36px -4px rgba(77, 96, 232
62
135
  setTimeout(removeToasts, duration);
63
136
  };
64
137
 
65
- export { VerdocsToast as V };
138
+ export { VerdocsToast as V, envelopeRecipientDecline as a, envelopeRecipientSubmit as b, envelopeRecipientAgree as e, getInPersonLink as g };
@@ -1,5 +1,5 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
- import { d as getEnvelopeDocumentPageDisplayUri } from './Envelopes.js';
2
+ import { c as getEnvelopeDocumentPageDisplayUri } from './Envelopes.js';
3
3
  import './Types.js';
4
4
  import { V as VerdocsEndpoint } from './VerdocsEndpoint.js';
5
5
  import { t as throttle } from './utils.js';
@@ -1,215 +1,4 @@
1
- import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
- import { g as getRecipientsWithActions, r as recipientCanAct } from './Permissions.js';
3
- import { g as getInPersonLink } from './Recipients.js';
4
- import './Types.js';
5
- import { V as VerdocsEndpoint } from './VerdocsEndpoint.js';
6
- import { c as createStore } from './index3.js';
7
- import { g as getEnvelope } from './Envelopes.js';
8
- import { V as VerdocsToast } from './Toast.js';
9
- import { S as SDKError } from './errors.js';
10
- import { d as defineCustomElement$2 } from './verdocs-button2.js';
11
-
12
- const createEnvelopeStore = (envelopeId) => {
13
- const now = new Date().toISOString();
14
- return createStore({
15
- isLoading: true,
16
- isLoaded: false,
17
- isError: false,
18
- error: null,
19
- updateCount: 0,
20
- roleNames: [],
21
- id: envelopeId,
22
- template_id: '',
23
- name: '',
24
- status: 'pending',
25
- profile_id: '',
26
- organization_id: '',
27
- no_contact: false,
28
- created_at: now,
29
- updated_at: now,
30
- canceled_at: null,
31
- reminder_id: null,
32
- envelope_document_id: '',
33
- certificate_document_id: null,
34
- visibility: 'private',
35
- histories: [],
36
- recipients: [],
37
- profile: undefined,
38
- certificate: undefined,
39
- document: undefined,
40
- documents: undefined,
41
- fields: undefined,
42
- });
43
- };
44
- const envelopeStores = {};
45
- const getEnvelopeStore = async (endpoint, envelopeId, forceReload = false) => {
46
- let created = false;
47
- if (!envelopeStores[envelopeId]) {
48
- console.debug('[ENVELOPES] No envelope store found for ID, creating', envelopeId);
49
- envelopeStores[envelopeId] = createEnvelopeStore(envelopeId);
50
- created = true;
51
- }
52
- const store = envelopeStores[envelopeId];
53
- // NOTE: If we need it, store.use() returns an unsubcribe function
54
- // See https://github.com/ionic-team/stencil-store#storeusesubscriptions
55
- store.use({
56
- reset: () => console.debug('[ENVELOPES] Store got reset'),
57
- dispose: () => console.debug('[ENVELOPES] Store got disposed'),
58
- });
59
- // TODO: This can create a race condition if two components call this at the same time.
60
- // For now we can probably defer doing something smart here because it's only a
61
- // double-load issue.
62
- if (created || forceReload) {
63
- console.debug('[ENVELOPES] Reloading envelope', { envelopeId, created, forceReload });
64
- store.state.isLoading = true;
65
- store.state.isLoaded = false;
66
- store.state.isError = false;
67
- store.state.error = undefined;
68
- try {
69
- const envelope = await getEnvelope(endpoint, envelopeId);
70
- console.debug('[ENVELOPES] Got envelope', envelope);
71
- Object.assign(store.state, envelope);
72
- store.state.isLoaded = true;
73
- store.state.isError = false;
74
- store.state.error = undefined;
75
- }
76
- catch (e) {
77
- console.error('[ENVELOPES] Error loading envelope', e);
78
- store.state.isLoaded = false;
79
- store.state.isError = true;
80
- store.state.error = e;
81
- throw e;
82
- }
83
- store.state.isLoading = false;
84
- store.state.updateCount++;
85
- }
86
- return store;
87
- };
88
-
89
- const verdocsEnvelopeRecipientSummaryCss = "verdocs-envelope-recipient-summary{top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;z-index:100000;position:fixed;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;font-family:\"Inter\", \"Barlow\", sans-serif;background-color:#0000007f}verdocs-envelope-recipient-summary .content{padding:30px 20px 20px;width:600px;max-width:100%;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border-radius:6px;background:#ffffff;font-size:18px}verdocs-envelope-recipient-summary .content .title{font-size:20px;margin:0 0 10px 0;color:#33364b}verdocs-envelope-recipient-summary .recipient{display:-ms-flexbox;display:flex;margin:8px 0 24px 0;-ms-flex-direction:column;flex-direction:column}verdocs-envelope-recipient-summary .recipient .role-name{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;font-size:14px;font-weight:600;margin:0 0 8px 0;color:#092c4c}verdocs-envelope-recipient-summary .recipient .role-info{gap:5px;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}verdocs-envelope-recipient-summary .recipient .role-full-name{-ms-flex:1;flex:1;height:34px;display:-ms-flexbox;display:flex;font-size:16px;padding:0 12px;border-radius:4px;-ms-flex-align:center;align-items:center;border:1px solid #cccccc;background:#f9fafb}verdocs-envelope-recipient-summary .recipient .recipient-link{width:120px;padding:0 16px;font-weight:500;margin:0 0 0 8px;text-align:center;font-size:0.875rem;border-radius:100%;color:#374151;line-height:1.25rem;background-color:#d8d8d8;border:2px solid #9ca3af}verdocs-envelope-recipient-summary .recipient .link-wrapper{gap:5px;display:-ms-flexbox;display:flex;margin:4px 0 0 0;-ms-flex-direction:row;flex-direction:row}verdocs-envelope-recipient-summary .recipient .link-wrapper .link{-ms-flex:1;flex:1;height:34px;display:-ms-flexbox;display:flex;font-size:16px;padding:0 12px;border-radius:4px;-ms-flex-align:center;align-items:center;border:1px solid #cccccc;background:#f9fafb}verdocs-envelope-recipient-summary .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;margin:10px 0 0 0;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}verdocs-envelope-recipient-summary .buttons verdocs-button{-ms-flex:0 0 120px;flex:0 0 120px;margin-left:10px;white-space:nowrap}verdocs-envelope-recipient-summary .buttons verdocs-button button{width:100%}";
90
-
91
- const VerdocsEnvelopeRecipientSummary$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
92
- constructor() {
93
- super();
94
- this.__registerHost();
95
- this.another = createEvent(this, "another", 7);
96
- this.view = createEvent(this, "view", 7);
97
- this.next = createEvent(this, "next", 7);
98
- this.sdkError = createEvent(this, "sdkError", 7);
99
- this.store = null;
100
- this.endpoint = VerdocsEndpoint.getDefault();
101
- this.envelopeId = '';
102
- this.envelope = undefined;
103
- this.isOpen = undefined;
104
- this.recipientStatusIcons = [];
105
- this.containerId = `verdocs-status-indicator-${Math.random().toString(36).substring(2, 11)}`;
106
- this.gettingLinks = {};
107
- this.links = {};
108
- }
109
- async componentWillLoad() {
110
- var _a, _b, _c;
111
- try {
112
- this.endpoint.loadSession();
113
- if (!this.envelopeId) {
114
- console.log(`[RECIPIENTS] Missing required envelope ID ${this.envelopeId}`);
115
- return;
116
- }
117
- if (!this.endpoint.session) {
118
- console.log('[RECIPIENTS] Unable to start session, must be authenticated');
119
- return;
120
- }
121
- this.store = await getEnvelopeStore(this.endpoint, this.envelopeId, true);
122
- this.sortEnvelopeRecipients();
123
- }
124
- catch (e) {
125
- console.log('[RECIPIENTS] Error loading envelope', e);
126
- (_a = this.sdkError) === null || _a === void 0 ? void 0 : _a.emit(new SDKError(e.message, (_b = e.response) === null || _b === void 0 ? void 0 : _b.status, (_c = e.response) === null || _c === void 0 ? void 0 : _c.data));
127
- }
128
- }
129
- sortEnvelopeRecipients() {
130
- var _a, _b;
131
- (_b = (_a = this.store) === null || _a === void 0 ? void 0 : _a.state) === null || _b === void 0 ? void 0 : _b.recipients.sort((a, b) => {
132
- return a.sequence === b.sequence ? a.order - b.order : a.sequence - b.sequence;
133
- });
134
- }
135
- handleAnother(e) {
136
- var _a;
137
- e.preventDefault();
138
- (_a = this.another) === null || _a === void 0 ? void 0 : _a.emit();
139
- }
140
- handleView(e) {
141
- var _a;
142
- e.preventDefault();
143
- (_a = this.view) === null || _a === void 0 ? void 0 : _a.emit();
144
- }
145
- handleDone(e) {
146
- var _a;
147
- e.preventDefault();
148
- (_a = this.next) === null || _a === void 0 ? void 0 : _a.emit();
149
- }
150
- copyLink(link) {
151
- navigator.clipboard
152
- .writeText(link)
153
- .then(() => VerdocsToast('Link copied to clipboard!', { style: 'success', duration: 3000 }))
154
- .catch(e => {
155
- console.warn('[RECIPIENTS] Error copying to clipboard', e);
156
- VerdocsToast(`Unable to copy to clipboard: ${e.message}`, { style: 'error' });
157
- });
158
- }
159
- getLink(recipient) {
160
- this.gettingLinks[recipient.role_name] = true;
161
- getInPersonLink(this.endpoint, recipient.envelope_id, recipient.role_name)
162
- .then(response => {
163
- this.gettingLinks[recipient.role_name] = false;
164
- this.links = { ...this.links, [recipient.role_name]: response.link };
165
- this.copyLink(response.link);
166
- })
167
- .catch(e => {
168
- this.gettingLinks[recipient.role_name] = false;
169
- console.log('[RECIPIENTS] Error getting link', e);
170
- VerdocsToast('Unable to get link: ' + e.message, { style: 'error' });
171
- });
172
- }
173
- render() {
174
- var _a;
175
- return (h(Host, null, h("div", { class: "content" }, h("h1", { class: "title" }, "Recipient Summary"), h("div", { class: "rows" }, (_a = this.store.state) === null || _a === void 0 ? void 0 : _a.recipients.map(recipient => {
176
- const recipientsWithActions = getRecipientsWithActions(this.store.state);
177
- const showLinkButton = recipientCanAct(recipient, recipientsWithActions);
178
- const link = this.links[recipient.role_name];
179
- const gettingLink = this.gettingLinks[recipient.role_name];
180
- return (h("div", { class: "recipient" }, h("div", { class: "role-name" }, recipient.role_name), h("div", { class: "role-details" }, h("div", { class: "role-info" }, h("div", { class: "role-full-name" }, recipient.full_name, " (", recipient.email || recipient.phone, ")"), showLinkButton && !link && h("verdocs-button", { size: "small", variant: "outline", label: "Get Link", disabled: gettingLink, onClick: () => this.getLink(recipient) })), link && (h("div", { class: "link-wrapper" }, h("div", { class: "link" }, link), h("verdocs-button", { size: "small", variant: "outline", label: "Copy", onClick: () => this.copyLink(link) }))))));
181
- })), h("div", { class: "buttons" }, h("verdocs-button", { size: "small", label: "Send Another", onClick: e => this.handleAnother(e) }), h("verdocs-button", { size: "small", label: "View Now", onClick: e => this.handleView(e) }), h("verdocs-button", { size: "small", label: "Done", onClick: e => this.handleDone(e) })))));
182
- }
183
- static get style() { return verdocsEnvelopeRecipientSummaryCss; }
184
- }, [0, "verdocs-envelope-recipient-summary", {
185
- "endpoint": [16],
186
- "envelopeId": [1, "envelope-id"],
187
- "envelope": [16],
188
- "isOpen": [32],
189
- "recipientStatusIcons": [32],
190
- "containerId": [32],
191
- "gettingLinks": [32],
192
- "links": [32]
193
- }]);
194
- function defineCustomElement$1() {
195
- if (typeof customElements === "undefined") {
196
- return;
197
- }
198
- const components = ["verdocs-envelope-recipient-summary", "verdocs-button"];
199
- components.forEach(tagName => { switch (tagName) {
200
- case "verdocs-envelope-recipient-summary":
201
- if (!customElements.get(tagName)) {
202
- customElements.define(tagName, VerdocsEnvelopeRecipientSummary$1);
203
- }
204
- break;
205
- case "verdocs-button":
206
- if (!customElements.get(tagName)) {
207
- defineCustomElement$2();
208
- }
209
- break;
210
- } });
211
- }
212
- defineCustomElement$1();
1
+ import { V as VerdocsEnvelopeRecipientSummary$1, d as defineCustomElement$1 } from './verdocs-envelope-recipient-summary2.js';
213
2
 
214
3
  const VerdocsEnvelopeRecipientSummary = VerdocsEnvelopeRecipientSummary$1;
215
4
  const defineCustomElement = defineCustomElement$1;