@verdocs/web-sdk 4.1.14 → 4.1.16

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 (175) hide show
  1. package/dist/cjs/{EnvelopeStore-db4f3f17.js → EnvelopeStore-4aeb54e1.js} +1 -1
  2. package/dist/cjs/{TemplateStore-037833e5.js → TemplateStore-7c7f1c50.js} +1 -1
  3. package/dist/cjs/{index-a5472099.js → index-2a189d85.js} +0 -517
  4. package/dist/cjs/index-cfdfab36.js +12 -24
  5. package/dist/cjs/loader.cjs.js +1 -1
  6. package/dist/cjs/verdocs-build.cjs.entry.js +2 -2
  7. package/dist/cjs/{verdocs-button-panel.cjs.entry.js → verdocs-button-panel_2.cjs.entry.js} +21 -0
  8. package/dist/cjs/{verdocs-checkbox_3.cjs.entry.js → verdocs-checkbox_4.cjs.entry.js} +17 -2
  9. package/dist/cjs/{verdocs-dialog_2.cjs.entry.js → verdocs-dialog.cjs.entry.js} +0 -22
  10. package/dist/cjs/verdocs-envelope-recipient-link_2.cjs.entry.js +2 -2
  11. package/dist/cjs/verdocs-envelope-sidebar.cjs.entry.js +3 -4
  12. package/dist/cjs/verdocs-envelopes-list.cjs.entry.js +10 -11
  13. package/dist/cjs/verdocs-preview_10.cjs.entry.js +15 -13
  14. package/dist/cjs/verdocs-radio-button_3.cjs.entry.js +2 -2
  15. package/dist/cjs/verdocs-table.cjs.entry.js +28 -0
  16. package/dist/cjs/verdocs-templates-list.cjs.entry.js +2 -2
  17. package/dist/cjs/verdocs-view.cjs.entry.js +1 -1
  18. package/dist/cjs/verdocs-web-sdk.cjs.js +1 -1
  19. package/dist/collection/collection-manifest.json +0 -5
  20. package/dist/collection/components/embeds/verdocs-send/verdocs-send.js +13 -11
  21. package/dist/collection/components/embeds/verdocs-view/verdocs-view.js +1 -1
  22. package/dist/collection/components/envelopes/verdocs-envelope-sidebar/verdocs-envelope-sidebar.js +1 -2
  23. package/dist/collection/components/envelopes/verdocs-envelopes-list/verdocs-envelopes-list.js +10 -11
  24. package/dist/collection/components/templates/verdocs-templates-list/verdocs-templates-list.js +2 -2
  25. package/dist/components/EnvelopeStore.js +2 -2
  26. package/dist/components/TemplateFieldStore.js +1 -1
  27. package/dist/components/TemplateRoleStore.js +1 -1
  28. package/dist/components/TemplateStore.js +2 -2
  29. package/dist/components/index.js +0 -10
  30. package/dist/components/index3.js +166 -4207
  31. package/dist/components/index4.js +3692 -167
  32. package/dist/components/verdocs-dialog.js +37 -1
  33. package/dist/components/verdocs-envelope-sidebar.js +1 -2
  34. package/dist/components/verdocs-envelopes-list.js +10 -11
  35. package/dist/components/verdocs-send2.js +13 -11
  36. package/dist/components/verdocs-table.js +39 -1
  37. package/dist/components/verdocs-templates-list.js +2 -2
  38. package/dist/components/verdocs-view2.js +1 -1
  39. package/dist/custom-elements.json +2086 -0
  40. package/dist/esm/{EnvelopeStore-9df042b5.js → EnvelopeStore-1ed5dc8f.js} +1 -1
  41. package/dist/esm/{TemplateStore-78ad24d7.js → TemplateStore-7d41d941.js} +1 -1
  42. package/dist/esm/{index-7456b04f.js → index-7588a071.js} +1 -517
  43. package/dist/esm/index-b89cf6a4.js +12 -24
  44. package/dist/esm/loader.js +1 -1
  45. package/dist/esm/verdocs-build.entry.js +2 -2
  46. package/dist/esm/{verdocs-button-panel.entry.js → verdocs-button-panel_2.entry.js} +22 -2
  47. package/dist/esm/{verdocs-checkbox_3.entry.js → verdocs-checkbox_4.entry.js} +17 -3
  48. package/dist/{components/verdocs-dialog2.js → esm/verdocs-dialog.entry.js} +7 -21
  49. package/dist/esm/verdocs-envelope-recipient-link_2.entry.js +2 -2
  50. package/dist/esm/verdocs-envelope-sidebar.entry.js +3 -4
  51. package/dist/esm/verdocs-envelopes-list.entry.js +10 -11
  52. package/dist/esm/verdocs-preview_10.entry.js +15 -13
  53. package/dist/esm/verdocs-radio-button_3.entry.js +2 -2
  54. package/dist/{components/verdocs-table2.js → esm/verdocs-table.entry.js} +7 -24
  55. package/dist/esm/verdocs-templates-list.entry.js +2 -2
  56. package/dist/esm/verdocs-view.entry.js +1 -1
  57. package/dist/esm/verdocs-web-sdk.js +1 -1
  58. package/dist/esm-es5/{EnvelopeStore-9df042b5.js → EnvelopeStore-1ed5dc8f.js} +1 -1
  59. package/dist/esm-es5/{TemplateStore-78ad24d7.js → TemplateStore-7d41d941.js} +1 -1
  60. package/dist/esm-es5/index-7588a071.js +1 -0
  61. package/dist/esm-es5/index-b89cf6a4.js +1 -1
  62. package/dist/esm-es5/loader.js +1 -1
  63. package/dist/esm-es5/verdocs-build.entry.js +1 -1
  64. package/dist/esm-es5/verdocs-button-panel_2.entry.js +1 -0
  65. package/dist/esm-es5/verdocs-checkbox_4.entry.js +1 -0
  66. package/dist/esm-es5/{verdocs-dialog_2.entry.js → verdocs-dialog.entry.js} +1 -1
  67. package/dist/esm-es5/verdocs-envelope-recipient-link_2.entry.js +1 -1
  68. package/dist/esm-es5/verdocs-envelope-sidebar.entry.js +1 -1
  69. package/dist/esm-es5/verdocs-envelopes-list.entry.js +1 -1
  70. package/dist/esm-es5/verdocs-preview_10.entry.js +1 -1
  71. package/dist/esm-es5/verdocs-radio-button_3.entry.js +1 -1
  72. package/dist/esm-es5/verdocs-table.entry.js +1 -0
  73. package/dist/esm-es5/verdocs-templates-list.entry.js +1 -1
  74. package/dist/esm-es5/verdocs-view.entry.js +1 -1
  75. package/dist/esm-es5/verdocs-web-sdk.js +1 -1
  76. package/dist/types/components.d.ts +2 -322
  77. package/dist/verdocs-web-sdk/{p-5961ce51.entry.js → p-0d54abe5.entry.js} +1 -1
  78. package/dist/verdocs-web-sdk/p-1f771dad.entry.js +1 -0
  79. package/dist/verdocs-web-sdk/{p-95e90092.system.entry.js → p-2be9ba53.system.entry.js} +1 -1
  80. package/dist/verdocs-web-sdk/p-30513f94.entry.js +1 -0
  81. package/dist/verdocs-web-sdk/p-322fa613.system.js +1 -1
  82. package/dist/verdocs-web-sdk/p-3f4b3548.system.entry.js +1 -0
  83. package/dist/verdocs-web-sdk/{p-5309a156.system.entry.js → p-413ab8a1.system.entry.js} +1 -1
  84. package/dist/verdocs-web-sdk/{p-16850eac.system.entry.js → p-48fce604.system.entry.js} +1 -1
  85. package/dist/verdocs-web-sdk/p-61257cb2.entry.js +1 -0
  86. package/dist/verdocs-web-sdk/{p-225418c7.entry.js → p-687c07ad.entry.js} +1 -1
  87. package/dist/verdocs-web-sdk/p-73f45012.system.entry.js +1 -0
  88. package/dist/verdocs-web-sdk/{p-7fe48d2e.entry.js → p-78908c67.entry.js} +1 -1
  89. package/dist/verdocs-web-sdk/{p-5e3e9c4a.system.js → p-889cc411.system.js} +1 -1
  90. package/dist/verdocs-web-sdk/p-9440752e.system.entry.js +1 -0
  91. package/dist/verdocs-web-sdk/{p-f05a3654.system.entry.js → p-977a5a4b.system.entry.js} +1 -1
  92. package/dist/verdocs-web-sdk/{p-540d9467.entry.js → p-9d36d2ad.entry.js} +1 -1
  93. package/dist/verdocs-web-sdk/p-a706bac9.js +1 -0
  94. package/dist/verdocs-web-sdk/p-b3017cd6.entry.js +1 -0
  95. package/dist/verdocs-web-sdk/{p-316b550f.entry.js → p-b61842bd.entry.js} +1 -1
  96. package/dist/verdocs-web-sdk/{p-03aedbe9.system.entry.js → p-b6b6f12a.system.entry.js} +1 -1
  97. package/dist/verdocs-web-sdk/{p-0e022e75.system.entry.js → p-b7397955.system.entry.js} +1 -1
  98. package/dist/verdocs-web-sdk/p-ba6570b4.system.entry.js +1 -0
  99. package/dist/verdocs-web-sdk/{p-afbbdc2f.system.js → p-c8de3052.system.js} +1 -1
  100. package/dist/verdocs-web-sdk/p-cf7f4475.entry.js +1 -0
  101. package/dist/verdocs-web-sdk/{p-8a820b88.system.entry.js → p-d2feac5b.system.entry.js} +1 -1
  102. package/dist/verdocs-web-sdk/p-e7578fac.entry.js +1 -0
  103. package/dist/verdocs-web-sdk/{p-c28c4e43.js → p-f02e08da.js} +1 -1
  104. package/dist/verdocs-web-sdk/p-f5064e0c.system.js +1 -0
  105. package/dist/verdocs-web-sdk/{p-5df130eb.entry.js → p-f632ffac.entry.js} +1 -1
  106. package/dist/verdocs-web-sdk/{p-9ec464df.js → p-fc2ae858.js} +1 -1
  107. package/dist/verdocs-web-sdk/p-fc5e568d.system.entry.js +1 -0
  108. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  109. package/package.json +2 -3
  110. package/dist/cjs/verdocs-component-error.cjs.entry.js +0 -21
  111. package/dist/cjs/verdocs-settings-api-keys_4.cjs.entry.js +0 -542
  112. package/dist/cjs/verdocs-settings.cjs.entry.js +0 -42
  113. package/dist/cjs/verdocs-tabs.cjs.entry.js +0 -27
  114. package/dist/collection/components/embeds/verdocs-settings/verdocs-settings.css +0 -40
  115. package/dist/collection/components/embeds/verdocs-settings/verdocs-settings.js +0 -104
  116. package/dist/collection/components/settings/verdocs-settings-api-keys/verdocs-settings-api-keys.css +0 -64
  117. package/dist/collection/components/settings/verdocs-settings-api-keys/verdocs-settings-api-keys.js +0 -292
  118. package/dist/collection/components/settings/verdocs-settings-members/verdocs-settings-members.css +0 -80
  119. package/dist/collection/components/settings/verdocs-settings-members/verdocs-settings-members.js +0 -349
  120. package/dist/collection/components/settings/verdocs-settings-organization/TimeZones.js +0 -144
  121. package/dist/collection/components/settings/verdocs-settings-organization/verdocs-settings-organization.css +0 -44
  122. package/dist/collection/components/settings/verdocs-settings-organization/verdocs-settings-organization.js +0 -192
  123. package/dist/collection/components/settings/verdocs-settings-profile/verdocs-settings-profile.css +0 -44
  124. package/dist/collection/components/settings/verdocs-settings-profile/verdocs-settings-profile.js +0 -190
  125. package/dist/components/verdocs-settings-api-keys.d.ts +0 -11
  126. package/dist/components/verdocs-settings-api-keys.js +0 -6
  127. package/dist/components/verdocs-settings-api-keys2.js +0 -209
  128. package/dist/components/verdocs-settings-members.d.ts +0 -11
  129. package/dist/components/verdocs-settings-members.js +0 -6
  130. package/dist/components/verdocs-settings-members2.js +0 -273
  131. package/dist/components/verdocs-settings-organization.d.ts +0 -11
  132. package/dist/components/verdocs-settings-organization.js +0 -6
  133. package/dist/components/verdocs-settings-organization2.js +0 -142
  134. package/dist/components/verdocs-settings-profile.d.ts +0 -11
  135. package/dist/components/verdocs-settings-profile.js +0 -6
  136. package/dist/components/verdocs-settings-profile2.js +0 -140
  137. package/dist/components/verdocs-settings.d.ts +0 -11
  138. package/dist/components/verdocs-settings.js +0 -130
  139. package/dist/esm/verdocs-component-error.entry.js +0 -17
  140. package/dist/esm/verdocs-dialog_2.entry.js +0 -46
  141. package/dist/esm/verdocs-settings-api-keys_4.entry.js +0 -535
  142. package/dist/esm/verdocs-settings.entry.js +0 -38
  143. package/dist/esm/verdocs-tabs.entry.js +0 -23
  144. package/dist/esm-es5/index-7456b04f.js +0 -1
  145. package/dist/esm-es5/verdocs-button-panel.entry.js +0 -1
  146. package/dist/esm-es5/verdocs-checkbox_3.entry.js +0 -1
  147. package/dist/esm-es5/verdocs-component-error.entry.js +0 -1
  148. package/dist/esm-es5/verdocs-settings-api-keys_4.entry.js +0 -1
  149. package/dist/esm-es5/verdocs-settings.entry.js +0 -1
  150. package/dist/esm-es5/verdocs-tabs.entry.js +0 -1
  151. package/dist/types/components/embeds/verdocs-settings/verdocs-settings.d.ts +0 -26
  152. package/dist/types/components/settings/verdocs-settings-api-keys/verdocs-settings-api-keys.d.ts +0 -54
  153. package/dist/types/components/settings/verdocs-settings-members/verdocs-settings-members.d.ts +0 -58
  154. package/dist/types/components/settings/verdocs-settings-organization/TimeZones.d.ts +0 -1
  155. package/dist/types/components/settings/verdocs-settings-organization/verdocs-settings-organization.d.ts +0 -37
  156. package/dist/types/components/settings/verdocs-settings-profile/verdocs-settings-profile.d.ts +0 -37
  157. package/dist/verdocs-web-sdk/p-03f8d33f.entry.js +0 -1
  158. package/dist/verdocs-web-sdk/p-12c26b19.system.entry.js +0 -1
  159. package/dist/verdocs-web-sdk/p-141a992e.system.entry.js +0 -1
  160. package/dist/verdocs-web-sdk/p-3ecaea8a.system.entry.js +0 -1
  161. package/dist/verdocs-web-sdk/p-45cf0ab5.entry.js +0 -1
  162. package/dist/verdocs-web-sdk/p-4df630c2.system.entry.js +0 -1
  163. package/dist/verdocs-web-sdk/p-515ee177.system.entry.js +0 -1
  164. package/dist/verdocs-web-sdk/p-6fa08e21.system.entry.js +0 -1
  165. package/dist/verdocs-web-sdk/p-708b5430.system.entry.js +0 -1
  166. package/dist/verdocs-web-sdk/p-753d0e16.entry.js +0 -1
  167. package/dist/verdocs-web-sdk/p-952b88fb.system.js +0 -1
  168. package/dist/verdocs-web-sdk/p-971ab2d1.entry.js +0 -1
  169. package/dist/verdocs-web-sdk/p-e42587b7.entry.js +0 -1
  170. package/dist/verdocs-web-sdk/p-efc547dc.entry.js +0 -1
  171. package/dist/verdocs-web-sdk/p-f3b47dfc.js +0 -1
  172. package/dist/verdocs-web-sdk/p-f44b9bd0.entry.js +0 -1
  173. package/dist/verdocs-web-sdk/p-f73b68fb.entry.js +0 -1
  174. package/dist/verdocs-web-sdk/p-fbfdfcd4.system.entry.js +0 -1
  175. package/dist/verdocs-web-sdk/p-fe0c473d.entry.js +0 -1
@@ -1,535 +0,0 @@
1
- import { r as registerInstance, c as createEvent, h, H as Host } from './index-b89cf6a4.js';
2
- import { VerdocsEndpoint, getOrganizationMembers, getApiKeys, deleteApiKey, rotateApiKey, createApiKey, formatFullName, getOrganizationInvitations, createOrganizationInvitation, deleteOrganizationMember, deleteOrganizationInvitation, resendOrganizationInvitation, capitalize, formatInitials, getOrganization, updateOrganization, getCurrentProfile, updateProfile } from '@verdocs/js-sdk';
3
- import { V as VerdocsToast } from './Toast-b71de686.js';
4
- import { S as SDKError } from './errors-887f1e88.js';
5
- import { d as dateFns } from './index-0329eed3.js';
6
- import { z } from './index-7456b04f.js';
7
- import { i as convertToE164 } from './utils-d1c95309.js';
8
- import './Types-e4a6eba5.js';
9
-
10
- const verdocsSettingsApiKeysCss = "@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-settings-api-keys{display:-ms-flexbox;display:flex;padding:10px;font-size:18px;-ms-flex-wrap:nowrap;flex-wrap:nowrap;border-radius:6px;color:#33364b;-ms-flex-direction:column;flex-direction:column;font-family:\"Inter\", \"Barlow\", sans-serif}verdocs-settings-api-keys .table{margin:12px 0}verdocs-settings-api-keys .data-col div{gap:12px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-settings-api-keys .data-col svg{width:24px;height:24px}verdocs-settings-api-keys .col-name svg,verdocs-settings-api-keys .col-client_id svg,verdocs-settings-api-keys .col-profile_id svg{fill:#a1a1aa}verdocs-settings-api-keys .col-actions svg{fill:#ffffff;stroke:#a1a1aa}verdocs-settings-api-keys .col-actions svg:hover{cursor:pointer;stroke:red}verdocs-settings-api-keys .col-actions>div{-ms-flex-pack:center;justify-content:center}verdocs-settings-api-keys .header-col.col-actions{text-align:center}verdocs-settings-api-keys verdocs-dialog p{font-size:16px;line-height:18px;margin:0 0 1em 0}@media all and (max-width: 450px){verdocs-settings-api-keys .col-client_id,verdocs-settings-api-keys .col-actions{display:none}}";
11
- const VerdocsSettingsApiKeysStyle0 = verdocsSettingsApiKeysCss;
12
-
13
- // const ClockIcon = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25zM12.75 6a.75.75 0 00-1.5 0v6c0 .414.336.75.75.75h4.5a.75.75 0 000-1.5h-3.75V6z" clip-rule="evenodd" /></svg>`;
14
- const TagIcon = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path fill-rule="evenodd" d="M5.5 3A2.5 2.5 0 003 5.5v2.879a2.5 2.5 0 00.732 1.767l6.5 6.5a2.5 2.5 0 003.536 0l2.878-2.878a2.5 2.5 0 000-3.536l-6.5-6.5A2.5 2.5 0 008.38 3H5.5zM6 7a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd" /></svg>`;
15
- const UserIcon = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-5.5-2.5a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0zM10 12a5.99 5.99 0 00-4.793 2.39A6.483 6.483 0 0010 16.5a6.483 6.483 0 004.793-2.11A5.99 5.99 0 0010 12z" clip-rule="evenodd" /></svg>`;
16
- const TrashIcon$1 = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0" /></svg>`;
17
- const ArrowPathIcon$1 = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0l3.181 3.183a8.25 8.25 0 0013.803-3.7M4.031 9.865a8.25 8.25 0 0113.803-3.7l3.181 3.182m0-4.991v4.99" /></svg>`;
18
- const VerdocsSettingsApiKeys = class {
19
- constructor(hostRef) {
20
- registerInstance(this, hostRef);
21
- this.sdkError = createEvent(this, "sdkError", 7);
22
- this.memberInvited = createEvent(this, "memberInvited", 7);
23
- this.memberUpdated = createEvent(this, "memberUpdated", 7);
24
- this.memberRemoved = createEvent(this, "memberRemoved", 7);
25
- this.endpoint = VerdocsEndpoint.getDefault();
26
- this.keys = [];
27
- this.creatingKey = false;
28
- this.createdKey = null;
29
- this.deletingKey = null;
30
- this.rotatingKey = null;
31
- this.newApiKeyName = '';
32
- this.newApiKeyProfileId = '';
33
- this.members = [];
34
- }
35
- componentWillLoad() {
36
- this.endpoint.loadSession();
37
- if (!this.endpoint.session) {
38
- console.log('[SETTINGS] Must be authenticated');
39
- return;
40
- }
41
- }
42
- async componentDidLoad() {
43
- this.newApiKeyProfileId = this.endpoint.session.profile_id;
44
- getOrganizationMembers(this.endpoint)
45
- .then(mem => {
46
- this.members = mem;
47
- })
48
- .catch((e) => {
49
- var _a, _b, _c;
50
- console.log('[SETTINGS] Error loading organization members', e);
51
- (_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));
52
- VerdocsToast('Unable to load API keys. Please try again later', { style: 'error' });
53
- });
54
- this.loadKeys();
55
- }
56
- loadKeys() {
57
- getApiKeys(this.endpoint)
58
- .then(r => {
59
- this.keys = r;
60
- })
61
- .catch(e => {
62
- var _a, _b, _c;
63
- console.log('[SETTINGS] Unable to load API keys', e);
64
- (_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));
65
- VerdocsToast('Unable to load API keys. Please try again later', { style: 'error' });
66
- });
67
- }
68
- async handleDeleteKey() {
69
- deleteApiKey(this.endpoint, this.deletingKey.client_id)
70
- .then(() => {
71
- this.deletingKey = null;
72
- VerdocsToast('API key deleted', { style: 'success' });
73
- this.loadKeys();
74
- })
75
- .catch(e => {
76
- var _a, _b, _c;
77
- this.deletingKey = null;
78
- console.log('[SETTINGS] Unable to delete API key', e);
79
- (_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));
80
- VerdocsToast('Unable to delete API key. Please try again later', { style: 'error' });
81
- });
82
- }
83
- async handleRotateKey() {
84
- rotateApiKey(this.endpoint, this.rotatingKey.client_id)
85
- .then(r => {
86
- this.rotatingKey = null;
87
- VerdocsToast('API key rotated', { style: 'success' });
88
- this.loadKeys();
89
- this.createdKey = r;
90
- })
91
- .catch(e => {
92
- var _a, _b, _c;
93
- this.rotatingKey = null;
94
- console.log('[SETTINGS] Unable to rotate API key', e);
95
- (_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));
96
- VerdocsToast('Unable to rotate API key. Please try again later', { style: 'error' });
97
- });
98
- }
99
- async handleCreateKey() {
100
- // TODO: Add permission dropdown
101
- createApiKey(this.endpoint, { permission: 'personal', name: this.newApiKeyName, profile_id: this.newApiKeyProfileId })
102
- .then(r => {
103
- this.creatingKey = false;
104
- this.createdKey = r;
105
- VerdocsToast('API key created', { style: 'success' });
106
- this.loadKeys();
107
- })
108
- .catch(e => {
109
- var _a, _b, _c;
110
- this.creatingKey = false;
111
- console.log('[SETTINGS] Unable to create API key', e);
112
- (_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));
113
- VerdocsToast('Unable to create API key. Please try again later', { style: 'error' });
114
- });
115
- }
116
- render() {
117
- var _a, _b, _c, _d;
118
- const profileOptions = this.members.map(member => ({ label: formatFullName(member), value: member.id }));
119
- if (!this.endpoint.session) {
120
- console.log('[SETTINGS] Must be authenticated');
121
- return h(Host, { class: "authentication-required" }, "Must be authenticated");
122
- }
123
- return (h(Host, null, h("verdocs-table", { data: this.keys, columns: [
124
- {
125
- id: 'name',
126
- header: 'Name',
127
- renderCell: (_, row) => (h("div", null, h("div", null, row.name))),
128
- },
129
- {
130
- id: 'client_id',
131
- header: 'Client ID',
132
- renderCell: (_, row) => (h("div", null, h("div", { innerHTML: TagIcon }), h("div", null, row.client_id))),
133
- },
134
- {
135
- id: 'profile_id',
136
- header: 'Acts as',
137
- renderCell: (_, row) => (h("div", null, h("div", { innerHTML: UserIcon }), h("div", null, formatFullName(row.profile)))),
138
- },
139
- {
140
- id: 'actions',
141
- header: 'Actions',
142
- renderCell: (_, row) => (h("div", null, h("div", { innerHTML: TrashIcon$1, onClick: () => (this.deletingKey = row) }), h("div", { innerHTML: ArrowPathIcon$1, onClick: () => (this.rotatingKey = row) }))),
143
- },
144
- ] }), h("verdocs-button", { label: "Add API Key", size: "normal", onClick: () => (this.creatingKey = true) }), this.deletingKey && (h("verdocs-dialog", { onExit: () => (this.deletingKey = null) }, h("div", { slot: "title", class: "heading" }, "Delete API key \"", this.deletingKey.name, "\"?"), h("div", { class: "content" }, h("p", null, "Are you sure you want to delete this key? This action cannot be undone."), h("div", { class: "buttons" }, h("verdocs-button", { variant: "outline", size: "small", label: "Cancel", onClick: () => (this.deletingKey = null) }), h("verdocs-button", { size: "small", label: "OK", onClick: () => this.handleDeleteKey() }))))), this.rotatingKey && (h("verdocs-dialog", { onExit: () => (this.rotatingKey = null) }, h("div", { slot: "title", class: "heading" }, "Rotate API key \"", this.rotatingKey.name, "\"?"), h("div", { class: "content" }, h("p", null, "Are you sure you want to rotate this key? A new client secret will be generated, and the old value will become unusable. This action cannot be undone."), h("div", { class: "buttons" }, h("verdocs-button", { variant: "outline", size: "small", label: "Cancel", onClick: () => (this.rotatingKey = null) }), h("verdocs-button", { size: "small", label: "OK", onClick: () => this.handleRotateKey() }))))), this.creatingKey && (h("verdocs-dialog", { onExit: () => (this.creatingKey = false) }, h("div", { slot: "title", class: "heading" }, "Create API Key"), h("div", { class: "content" }, h("verdocs-text-input", { label: "Name", placeholder: "API key name...", id: "verdocs-api-key-name", value: this.newApiKeyName, autocomplete: "off", required: true, onInput: (e) => (this.newApiKeyName = e.target.value), onFocusout: (e) => {
145
- this.newApiKeyName = e.target.value.trim();
146
- } }), h("p", null, "API keys must be associated with a profile. Actions performed via API calls using this key will \"act as\" this profile."), h("verdocs-select-input", { options: profileOptions, label: "Act as Profile", onInput: (e) => {
147
- this.newApiKeyProfileId = e.target.value;
148
- } }), h("div", { class: "buttons" }, h("verdocs-button", { variant: "outline", size: "small", label: "Cancel", onClick: () => (this.creatingKey = false) }), h("verdocs-button", { size: "small", label: "OK", onClick: () => this.handleCreateKey() }))))), this.createdKey && (h("verdocs-dialog", { onExit: () => (this.createdKey = null) }, h("div", { slot: "title", class: "heading" }, "API Key Details"), h("div", { class: "content" }, h("verdocs-text-input", { label: "Name", disabled: true, value: (_a = this.createdKey) === null || _a === void 0 ? void 0 : _a.name }), h("verdocs-text-input", { label: "Profile", disabled: true, value: formatFullName((_b = this.createdKey) === null || _b === void 0 ? void 0 : _b.profile) }), h("p", null, "Please save the Client ID and Secret below. Be sure to never expose your secret key in insecure (Web or mobile environments)!"), h("verdocs-text-input", { label: "Client ID", disabled: true, value: (_c = this.createdKey) === null || _c === void 0 ? void 0 : _c.client_id, copyable: true }), h("verdocs-text-input", { label: "Secret Key", disabled: true, value: (_d = this.createdKey) === null || _d === void 0 ? void 0 : _d.client_secret, copyable: true }), h("div", { class: "buttons" }, h("verdocs-button", { size: "small", label: "Done", onClick: () => (this.createdKey = null) })))))));
149
- }
150
- };
151
- VerdocsSettingsApiKeys.style = VerdocsSettingsApiKeysStyle0;
152
-
153
- const verdocsSettingsMembersCss = "@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-settings-members{display:-ms-flexbox;display:flex;padding:10px;font-size:18px;-ms-flex-wrap:nowrap;flex-wrap:nowrap;border-radius:6px;color:#33364b;-ms-flex-direction:column;flex-direction:column;font-family:\"Inter\", \"Barlow\", sans-serif}verdocs-settings-members .table{margin:12px 0}verdocs-settings-members .role{font-size:12px;width:32px;height:32px;border-radius:32px;background:#777777;color:#ffffff;font-weight:700;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}verdocs-settings-members .table{margin:12px 0}verdocs-settings-members .data-col div{gap:12px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-settings-members .data-col svg{width:24px;height:24px}verdocs-settings-members .col-name svg,verdocs-settings-members .col-client_id svg,verdocs-settings-members .col-profile_id svg{fill:#a1a1aa}verdocs-settings-members .col-actions svg{fill:#ffffff;stroke:#a1a1aa}verdocs-settings-members .col-actions svg:hover{cursor:pointer;stroke:red}verdocs-settings-members .col-actions>div{-ms-flex-pack:center;justify-content:center}verdocs-settings-members .header-col.col-actions{text-align:center}verdocs-settings-members verdocs-dialog p{font-size:16px;line-height:18px;margin:0 0 1em 0}@media all and (max-width: 450px){verdocs-settings-members .col-email,verdocs-settings-members .col-phone,verdocs-settings-members .col-actions{display:none}}";
154
- const VerdocsSettingsMembersStyle0 = verdocsSettingsMembersCss;
155
-
156
- const TrashIcon = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0" /></svg>`;
157
- const ArrowPathIcon = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0l3.181 3.183a8.25 8.25 0 0013.803-3.7M4.031 9.865a8.25 8.25 0 0113.803-3.7l3.181 3.182m0-4.991v4.99" /></svg>`;
158
- // const getRoleLabel = (roles: any[]) => {
159
- // if (roles.find(role => role.name === 'owner') !== undefined) return 'Owner';
160
- // if (roles.find(role => role.name === 'admin') !== undefined) return 'Admin';
161
- // if (roles.find(role => role.name === 'member') !== undefined) return 'Member';
162
- // if (roles.find(role => role.name === 'basic_user') !== undefined) return 'Basic User';
163
- // if (roles.find(role => role.name === 'contact') !== undefined) return 'Contact';
164
- // };
165
- //
166
- const getRoleColor = (roles) => {
167
- if (roles.find(role => role.name === 'owner') !== undefined)
168
- return '#9333ea';
169
- if (roles.find(role => role.name === 'admin') !== undefined)
170
- return '#2563eb';
171
- if (roles.find(role => role.name === 'member') !== undefined)
172
- return '#16a34a';
173
- if (roles.find(role => role.name === 'basic_user') !== undefined)
174
- return '#ea580c';
175
- if (roles.find(role => role.name === 'contact') !== undefined)
176
- return '#52525B';
177
- };
178
- const roleOptions = [
179
- { label: 'Contact', value: 'contact' },
180
- { label: 'Basic User', value: 'basic_user' },
181
- { label: 'Member', value: 'member' },
182
- { label: 'Admin', value: 'admin' },
183
- { label: 'Owner', value: 'owner' },
184
- ];
185
- const VerdocsSettingsMembers = class {
186
- constructor(hostRef) {
187
- registerInstance(this, hostRef);
188
- this.sdkError = createEvent(this, "sdkError", 7);
189
- this.memberInvited = createEvent(this, "memberInvited", 7);
190
- this.memberUpdated = createEvent(this, "memberUpdated", 7);
191
- this.memberRemoved = createEvent(this, "memberRemoved", 7);
192
- this.endpoint = VerdocsEndpoint.getDefault();
193
- this.members = [];
194
- this.invited = [];
195
- this.selectedTab = 0;
196
- this.invitingMember = false;
197
- this.newEmailAddress = '';
198
- this.newFirst = '';
199
- this.newLast = '';
200
- this.newRole = 'member';
201
- this.submitting = false;
202
- this.deletingInvitation = null;
203
- this.resendingInvitation = null;
204
- this.deletingMember = null;
205
- }
206
- componentWillLoad() {
207
- this.endpoint.loadSession();
208
- if (!this.endpoint.session) {
209
- console.log('[SETTINGS] Must be authenticated');
210
- return;
211
- }
212
- }
213
- async componentDidLoad() {
214
- this.loadMembers().catch((e) => console.log('Unknown Error', e));
215
- }
216
- async loadMembers() {
217
- var _a, _b, _c;
218
- try {
219
- const [members, invites] = await Promise.all([getOrganizationMembers(this.endpoint), getOrganizationInvitations(this.endpoint)]);
220
- this.members = members;
221
- this.invited = invites;
222
- this.newRole = 'member';
223
- }
224
- catch (e) {
225
- (_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));
226
- VerdocsToast('Unable to load members. Please try again later');
227
- }
228
- }
229
- async handleInviteMember() {
230
- this.submitting = true;
231
- createOrganizationInvitation(VerdocsEndpoint.getDefault(), {
232
- email: this.newEmailAddress,
233
- first_name: this.newFirst,
234
- last_name: this.newLast,
235
- role: this.newRole,
236
- })
237
- .then(r => {
238
- console.log('[SETTINGS] Invited member', r);
239
- this.invitingMember = false;
240
- this.submitting = false;
241
- this.newRole = 'member';
242
- this.newEmailAddress = '';
243
- this.newFirst = '';
244
- this.newLast = '';
245
- VerdocsToast('Invitation sent!', { style: 'success' });
246
- this.loadMembers();
247
- })
248
- .catch(e => {
249
- console.log('[SETTINGS] Unable to invite member', e);
250
- this.invitingMember = false;
251
- this.submitting = false;
252
- this.newRole = 'member';
253
- this.newEmailAddress = '';
254
- this.newFirst = '';
255
- this.newLast = '';
256
- VerdocsToast('Unable to invite member. Please try again later', { style: 'error' });
257
- });
258
- }
259
- async handleDeleteMember() {
260
- this.submitting = true;
261
- deleteOrganizationMember(VerdocsEndpoint.getDefault(), this.deletingMember.email)
262
- .then(() => {
263
- this.submitting = false;
264
- this.deletingMember = null;
265
- VerdocsToast('The member has been deleted.', { style: 'success' });
266
- this.loadMembers();
267
- })
268
- .catch(e => {
269
- this.submitting = false;
270
- this.deletingMember = null;
271
- console.log('Delete error', e);
272
- VerdocsToast('Unable to cancel invitation. Please try again later', { style: 'error' });
273
- });
274
- }
275
- async handleDeleteInvitation() {
276
- this.submitting = true;
277
- deleteOrganizationInvitation(VerdocsEndpoint.getDefault(), this.deletingInvitation.email)
278
- .then(() => {
279
- this.submitting = false;
280
- this.deletingInvitation = null;
281
- VerdocsToast('The invitation has been cancelled.', { style: 'success' });
282
- this.loadMembers();
283
- })
284
- .catch(e => {
285
- this.submitting = false;
286
- this.deletingInvitation = null;
287
- console.log('Delete error', e);
288
- VerdocsToast('Unable to cancel invitation. Please try again later', { style: 'error' });
289
- });
290
- }
291
- async handleResendInvitation() {
292
- this.submitting = true;
293
- resendOrganizationInvitation(VerdocsEndpoint.getDefault(), this.resendingInvitation.email)
294
- .then(() => {
295
- this.submitting = false;
296
- this.resendingInvitation = null;
297
- VerdocsToast('The invitation has been resent.', { style: 'success' });
298
- this.loadMembers();
299
- })
300
- .catch(e => {
301
- this.submitting = false;
302
- this.resendingInvitation = null;
303
- console.log('REsend error', e);
304
- VerdocsToast('Unable to resend invitation. Please try again later', { style: 'error' });
305
- });
306
- }
307
- render() {
308
- if (!this.endpoint.session) {
309
- console.log('[SETTINGS] Must be authenticated');
310
- return h(Host, { class: "authentication-required" }, "Must be authenticated");
311
- }
312
- return (h(Host, null, h("verdocs-tabs", { tabs: [{ label: `Members (${this.members.length})` }, { label: `Pending Invitations (${this.invited.length})` }], onSelectTab: e => (this.selectedTab = e.detail.index) }), this.selectedTab === 0 && (h("verdocs-table", { data: this.members, columns: [
313
- {
314
- id: 'name',
315
- renderHeader: () => 'Member',
316
- renderCell: (_, row) => (h("div", { style: { display: 'flex', flexDirection: 'row', gap: '10px', alignItems: 'center' } }, h("div", { class: "role", style: { backgroundColor: getRoleColor(row.roles) } }, formatInitials(row)), h("span", null, formatFullName(row)))),
317
- },
318
- { id: 'email', header: 'E-mail Address' },
319
- { id: 'phone', header: 'Phone Number' },
320
- { id: 'roles', header: 'Role', renderCell: (_, row) => `${row.roles}` },
321
- {
322
- id: 'actions',
323
- header: 'Actions',
324
- renderCell: (_, row) => h("div", null, row.id !== this.endpoint.session.profile_id && h("div", { innerHTML: TrashIcon, onClick: () => (this.deletingMember = row) })),
325
- },
326
- ] })), this.selectedTab === 1 && (h("verdocs-table", { data: this.invited, columns: [
327
- { id: 'email', header: 'E-mail Address' },
328
- { id: 'generated_at', header: 'Invited', renderCell: (_, row) => h("div", null, dateFns.format(new Date(row.generated_at), 'MMM d, Y')) },
329
- { id: 'role', header: 'Role', renderCell: (_, row) => h("div", null, row.role) },
330
- { id: 'status', header: 'Status', renderCell: (_, row) => h("div", null, capitalize(row.status)) },
331
- {
332
- id: 'actions',
333
- header: 'Actions',
334
- renderCell: (_, row) => (h("div", null, h("div", { innerHTML: TrashIcon, onClick: () => (this.deletingInvitation = row) }), h("div", { innerHTML: ArrowPathIcon, onClick: () => (this.resendingInvitation = row) }))),
335
- },
336
- ] })), h("verdocs-button", { label: "Invite New Member", size: "normal", disabled: this.submitting, onClick: () => (this.invitingMember = true) }), this.invitingMember && (h("verdocs-dialog", { onExit: () => (this.invitingMember = false) }, h("div", { slot: "title", class: "heading" }, "Invite New Member"), h("div", { class: "content" }, h("verdocs-text-input", { label: "E-mail Address", placeholder: "Enter the user's email address...", id: "verdocs-invite-email", value: this.newEmailAddress, autocomplete: "off", required: true, onInput: (e) => (this.newEmailAddress = e.target.value), onFocusout: (e) => {
337
- this.newEmailAddress = e.target.value.trim();
338
- } }), h("verdocs-text-input", { label: "First", placeholder: "First name...", id: "verdocs-invite-first", value: this.newFirst, autocomplete: "off", required: true, onInput: (e) => (this.newFirst = e.target.value), onFocusout: (e) => {
339
- this.newFirst = e.target.value.trim();
340
- } }), h("verdocs-text-input", { label: "Last", placeholder: "Enter the user's last name...", id: "verdocs-invite-last", value: this.newLast, autocomplete: "off", required: true, onInput: (e) => (this.newLast = e.target.value), onFocusout: (e) => {
341
- this.newLast = e.target.value.trim();
342
- } }), h("div", { style: { marginBottom: '20px' } }), h("verdocs-select-input", { options: roleOptions, label: "Role", onInput: (e) => {
343
- this.newRole = e.target.value;
344
- } }), h("div", { class: "buttons" }, h("verdocs-button", { variant: "outline", size: "small", label: "Cancel", disabled: this.submitting, onClick: () => (this.invitingMember = false) }), h("verdocs-button", { size: "small", label: "OK", disabled: this.submitting || !this.newEmailAddress || !this.newRole, onClick: () => this.handleInviteMember() }))))), this.deletingMember && (h("verdocs-dialog", { onExit: () => (this.deletingMember = null) }, h("div", { slot: "title", class: "heading" }, "Delete Member?"), h("div", { class: "content" }, h("p", null, "Are you sure you want to delete this member? This action cannot be undone."), h("div", { class: "buttons" }, h("verdocs-button", { variant: "outline", size: "small", disabled: this.submitting, label: "Cancel", onClick: () => (this.deletingMember = null) }), h("verdocs-button", { size: "small", label: "OK", disabled: this.submitting, onClick: () => this.handleDeleteMember() }))))), this.deletingInvitation && (h("verdocs-dialog", { onExit: () => (this.deletingInvitation = null) }, h("div", { slot: "title", class: "heading" }, "Cancel Invitation?"), h("div", { class: "content" }, h("p", null, "Are you sure you want to cancel this invitation? This action cannot be undone."), h("div", { class: "buttons" }, h("verdocs-button", { variant: "outline", size: "small", disabled: this.submitting, label: "Cancel", onClick: () => (this.deletingInvitation = null) }), h("verdocs-button", { size: "small", label: "OK", disabled: this.submitting, onClick: () => this.handleDeleteInvitation() }))))), this.resendingInvitation && (h("verdocs-dialog", { onExit: () => (this.resendingInvitation = null) }, h("div", { slot: "title", class: "heading" }, "Resend Invitation?"), h("div", { class: "content" }, h("p", null, "The user will receive an email reminder to join your organization."), h("div", { class: "buttons" }, h("verdocs-button", { variant: "outline", size: "small", disabled: this.submitting, label: "Cancel", onClick: () => (this.resendingInvitation = null) }), h("verdocs-button", { size: "small", label: "OK", disabled: this.submitting, onClick: () => this.handleResendInvitation() })))))));
345
- }
346
- };
347
- VerdocsSettingsMembers.style = VerdocsSettingsMembersStyle0;
348
-
349
- const verdocsSettingsOrganizationCss = "@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-settings-organization{display:-ms-flexbox;display:flex;padding:10px;font-size:18px;-ms-flex-wrap:nowrap;flex-wrap:nowrap;border-radius:6px;color:#33364b;-ms-flex-direction:column;flex-direction:column;font-family:\"Inter\", \"Barlow\", sans-serif}verdocs-settings-organization .columns{gap:20px;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-direction:row;flex-direction:row}verdocs-settings-organization .column{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-settings-organization verdocs-text-input{margin:10px 0}verdocs-settings-organization verdocs-text-input input{height:32px}@media screen and (max-width: 600px){verdocs-settings-organization .columns{gap:0;-ms-flex-direction:column;flex-direction:column}}";
350
- const VerdocsSettingsOrganizationStyle0 = verdocsSettingsOrganizationCss;
351
-
352
- const schema$1 = z.object({
353
- // name: z.string().trim().min(1, 'Name is required').max(30),
354
- business_name: z.string().trim().max(30).optional(),
355
- contact_email: z.string().trim().email('Invalid email').optional().or(z.literal('')),
356
- phone: z.preprocess(val => convertToE164(String(val).trim()), z.string().optional()),
357
- url: z.string().trim().optional(),
358
- });
359
- const VerdocsSettingsOrganization = class {
360
- constructor(hostRef) {
361
- registerInstance(this, hostRef);
362
- this.sdkError = createEvent(this, "sdkError", 7);
363
- this.organizationUpdated = createEvent(this, "organizationUpdated", 7);
364
- this.endpoint = VerdocsEndpoint.getDefault();
365
- this.valid = false;
366
- this.dirty = false;
367
- this.submitting = false;
368
- this.name = '';
369
- this.contact_email = '';
370
- this.phone = '';
371
- this.url = '';
372
- }
373
- componentWillLoad() {
374
- this.endpoint.loadSession();
375
- if (!this.endpoint.session) {
376
- console.log('[SETTINGS] Must be authenticated');
377
- return;
378
- }
379
- }
380
- async componentDidLoad() {
381
- const organization = await getOrganization(this.endpoint, this.endpoint.session.organization_id);
382
- console.log('[SETTINGS] Loaded organization', organization);
383
- this.resetForm(organization);
384
- }
385
- resetForm(organization) {
386
- this.name = organization.name;
387
- this.contact_email = organization.contact_email;
388
- this.phone = organization.phone;
389
- this.url = organization.url;
390
- this.dirty = false;
391
- this.valid = true;
392
- }
393
- handleSubmit(e) {
394
- e.preventDefault();
395
- e.stopPropagation();
396
- updateOrganization(VerdocsEndpoint.getDefault(), this.endpoint.session.organization_id, {
397
- name: this.name,
398
- contact_email: this.contact_email,
399
- phone: this.phone,
400
- url: this.url,
401
- })
402
- .then(newOrganization => {
403
- var _a;
404
- console.log('[SETTINGS] Update result', newOrganization);
405
- (_a = this.organizationUpdated) === null || _a === void 0 ? void 0 : _a.emit({ endpoint: this.endpoint, organization: newOrganization });
406
- this.resetForm(newOrganization);
407
- })
408
- .catch(e => VerdocsToast(`Error updating organization: ${e.message}`, { style: 'error' }));
409
- }
410
- processFields() {
411
- const validation = schema$1.safeParse({
412
- name: this.name,
413
- contact_email: this.contact_email,
414
- phone: this.phone,
415
- url: this.url,
416
- });
417
- console.log('[SETTINGS] Validation result', validation);
418
- this.valid = validation.success;
419
- this.dirty = true;
420
- }
421
- render() {
422
- if (!this.endpoint.session) {
423
- console.log('[SETTINGS] Must be authenticated');
424
- return h(Host, { class: "authentication-required" }, "Must be authenticated");
425
- }
426
- return (h(Host, null, h("h1", null, "Organization Profile"), h("form", { onSubmit: e => this.handleSubmit(e) }, h("div", { class: "columns" }, h("div", { class: "column" }, h("verdocs-text-input", { id: "verdocs-organization-name", value: this.name, autocomplete: "off", label: "Name", required: false, disabled: false, placeholder: "Enter your organization's name...", onInput: (e) => (this.name = e.target.value), onFocusout: (e) => {
427
- this.name = e.target.value.trim();
428
- this.processFields();
429
- } }), h("verdocs-text-input", { id: "verdocs-organization-url", value: this.url, autocomplete: "off", label: "Web URL", placeholder: "Enter your Web URL...", onInput: (e) => (this.url = e.target.value), onFocusout: (e) => {
430
- this.url = e.target.value.trim();
431
- this.processFields();
432
- } }), h("verdocs-text-input", { id: "verdocs-organization-phone", value: this.phone, autocomplete: "off", label: "Phone Number", placeholder: "Enter your phone number...", onInput: (e) => (this.phone = e.target.value), onFocusout: (e) => {
433
- this.phone = e.target.value.trim();
434
- this.processFields();
435
- } })), h("div", { class: "column" }, h("verdocs-text-input", { id: "verdocs-organization-email", value: this.contact_email, clearable: true, autocomplete: "off", label: "Contact Email", placeholder: "Enter your contact email address...", onInput: (e) => (this.contact_email = e.target.value), onFocusout: (e) => {
436
- this.contact_email = e.target.value.trim();
437
- this.processFields();
438
- } }))), h("verdocs-button", { type: "submit", label: "Save", size: "normal", disabled: this.submitting || !this.dirty }))));
439
- }
440
- };
441
- VerdocsSettingsOrganization.style = VerdocsSettingsOrganizationStyle0;
442
-
443
- const verdocsSettingsProfileCss = "@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-settings-profile{display:-ms-flexbox;display:flex;padding:10px;font-size:18px;-ms-flex-wrap:nowrap;flex-wrap:nowrap;border-radius:6px;color:#33364b;-ms-flex-direction:column;flex-direction:column;font-family:\"Inter\", \"Barlow\", sans-serif}verdocs-settings-profile .columns{gap:20px;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-direction:row;flex-direction:row}verdocs-settings-profile .column{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-settings-profile verdocs-text-input{margin:10px 0}verdocs-settings-profile verdocs-text-input input{height:32px}@media screen and (max-width: 600px){verdocs-settings-profile .columns{gap:0;-ms-flex-direction:column;flex-direction:column}}";
444
- const VerdocsSettingsProfileStyle0 = verdocsSettingsProfileCss;
445
-
446
- const schema = z.object({
447
- first_name: z.string().trim().min(1, 'First name is required').max(30),
448
- last_name: z.string().trim().min(1, 'Last name is required').max(30),
449
- email: z.string().trim().email('Invalid email').min(1, 'Email is required'),
450
- phone: z.preprocess(val => convertToE164(String(val).trim()), z.string()),
451
- });
452
- const VerdocsSettingsProfile = class {
453
- constructor(hostRef) {
454
- registerInstance(this, hostRef);
455
- this.sdkError = createEvent(this, "sdkError", 7);
456
- this.profileUpdated = createEvent(this, "profileUpdated", 7);
457
- this.endpoint = VerdocsEndpoint.getDefault();
458
- this.valid = false;
459
- this.dirty = false;
460
- this.submitting = false;
461
- this.first_name = '';
462
- this.last_name = '';
463
- this.email = '';
464
- this.phone = '';
465
- }
466
- componentWillLoad() {
467
- this.endpoint.loadSession();
468
- if (!this.endpoint.session) {
469
- console.log('[SETTINGS] Must be authenticated');
470
- return;
471
- }
472
- }
473
- async componentDidLoad() {
474
- const profile = await getCurrentProfile(this.endpoint);
475
- console.log('[SETTINGS] Loaded profile', profile);
476
- this.resetForm(profile);
477
- }
478
- resetForm(profile) {
479
- this.first_name = profile.first_name;
480
- this.last_name = profile.last_name;
481
- this.email = profile.email;
482
- this.phone = profile.phone;
483
- this.dirty = false;
484
- this.valid = true;
485
- }
486
- handleSubmit(e) {
487
- e.preventDefault();
488
- e.stopPropagation();
489
- updateProfile(VerdocsEndpoint.getDefault(), this.endpoint.session.profile_id, {
490
- first_name: this.first_name,
491
- last_name: this.last_name,
492
- phone: this.phone,
493
- })
494
- .then(newProfile => {
495
- var _a;
496
- console.log('[SETTINGS] Update result', newProfile);
497
- (_a = this.profileUpdated) === null || _a === void 0 ? void 0 : _a.emit({ endpoint: this.endpoint, profile: newProfile });
498
- this.resetForm(newProfile);
499
- })
500
- .catch(e => VerdocsToast(`Error updating profile: ${e.message}`, { style: 'error' }));
501
- }
502
- processFields() {
503
- const validation = schema.safeParse({
504
- first_name: this.first_name,
505
- last_name: this.last_name,
506
- email: this.email,
507
- phone: this.phone,
508
- });
509
- console.log('[SETTINGS] Validation result', validation);
510
- this.valid = validation.success;
511
- this.dirty = true;
512
- }
513
- render() {
514
- if (!this.endpoint.session) {
515
- console.log('[SETTINGS] Must be authenticated');
516
- return h(Host, { class: "authentication-required" }, "Must be authenticated");
517
- }
518
- return (h(Host, null, h("h1", null, "My Profile"), h("form", { onSubmit: e => this.handleSubmit(e) }, h("div", { class: "columns" }, h("div", { class: "column" }, h("verdocs-text-input", { id: "verdocs-profile-first-name", value: this.first_name, autocomplete: "off", label: "First Name", required: true, placeholder: "Enter your first name...", onInput: (e) => (this.first_name = e.target.value), onFocusout: (e) => {
519
- this.first_name = e.target.value.trim();
520
- this.processFields();
521
- } }), h("verdocs-text-input", { id: "verdocs-profile-last-name", value: this.last_name, autocomplete: "off", label: "Last Name", required: true, placeholder: "Enter your last name...", onInput: (e) => (this.last_name = e.target.value), onFocusout: (e) => {
522
- this.last_name = e.target.value.trim();
523
- this.processFields();
524
- } })), h("div", { class: "column" }, h("verdocs-text-input", { id: "verdocs-profile-email", value: this.email, autocomplete: "off", label: "Email Address", required: true, disabled: true, placeholder: "Enter your email address...", onInput: (e) => (this.email = e.target.value), onFocusout: (e) => {
525
- this.email = e.target.value.trim();
526
- this.processFields();
527
- } }), h("verdocs-text-input", { id: "verdocs-profile-phone", value: this.phone, clearable: true, autocomplete: "off", label: "Phone Number", placeholder: "Enter your phone number...", onInput: (e) => (this.phone = e.target.value), onFocusout: (e) => {
528
- this.phone = e.target.value.trim();
529
- this.processFields();
530
- } }))), h("verdocs-button", { type: "submit", label: "Save", size: "normal", disabled: this.submitting || !this.dirty }))));
531
- }
532
- };
533
- VerdocsSettingsProfile.style = VerdocsSettingsProfileStyle0;
534
-
535
- export { VerdocsSettingsApiKeys as verdocs_settings_api_keys, VerdocsSettingsMembers as verdocs_settings_members, VerdocsSettingsOrganization as verdocs_settings_organization, VerdocsSettingsProfile as verdocs_settings_profile };
@@ -1,38 +0,0 @@
1
- import { r as registerInstance, c as createEvent, h, H as Host } from './index-b89cf6a4.js';
2
- import { VerdocsEndpoint } from '@verdocs/js-sdk';
3
- import { S as SDKError } from './errors-887f1e88.js';
4
-
5
- const verdocsSettingsCss = "@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-settings{font-family:\"Inter\", -apple-system, \"Segoe UI\", \"Roboto\", \"Helvetica Neue\", sans-serif;display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;min-height:200px;position:relative;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column}verdocs-settings .tabs{gap:4px;width:100%;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-direction:row;flex-direction:row;border-bottom:1px solid #654dcb}verdocs-settings .tabs .tab{cursor:pointer;padding:5px 10px;color:#ffffff;background-color:#777777}verdocs-settings .tabs .tab.active{color:#ffffff;background-color:#654dcb}";
6
- const VerdocsSettingsStyle0 = verdocsSettingsCss;
7
-
8
- const VerdocsSettings = class {
9
- constructor(hostRef) {
10
- registerInstance(this, hostRef);
11
- this.sdkError = createEvent(this, "sdkError", 7);
12
- this.endpoint = VerdocsEndpoint.getDefault();
13
- this.tab = 'profile';
14
- }
15
- async componentWillLoad() {
16
- var _a, _b, _c;
17
- try {
18
- this.endpoint.loadSession();
19
- if (!this.endpoint.session) {
20
- console.log('[SETTINGS] Unable to start session, must be authenticated');
21
- return;
22
- }
23
- }
24
- catch (e) {
25
- console.log('[SETTINGS] Error with session', e);
26
- (_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));
27
- }
28
- }
29
- render() {
30
- if (!this.endpoint.session) {
31
- return (h(Host, null, h("verdocs-component-error", { message: "You must be authenticated to use this module." })));
32
- }
33
- return (h(Host, null, h("div", { class: "tabs" }, h("div", { class: `tab ${this.tab === 'profile' ? 'active' : ''}`, onClick: () => (this.tab = 'profile') }, "Profile"), h("div", { class: `tab ${this.tab === 'organization' ? 'active' : ''}`, onClick: () => (this.tab = 'organization') }, "Organization"), h("div", { class: `tab ${this.tab === 'members' ? 'active' : ''}`, onClick: () => (this.tab = 'members') }, "Members"), h("div", { class: `tab ${this.tab === 'apikeys' ? 'active' : ''}`, onClick: () => (this.tab = 'apikeys') }, "API Keys")), this.tab === 'profile' && h("verdocs-settings-profile", { endpoint: this.endpoint }), this.tab === 'organization' && h("verdocs-settings-organization", { endpoint: this.endpoint }), this.tab === 'members' && h("verdocs-settings-members", { endpoint: this.endpoint }), this.tab === 'apikeys' && h("verdocs-settings-api-keys", { endpoint: this.endpoint })));
34
- }
35
- };
36
- VerdocsSettings.style = VerdocsSettingsStyle0;
37
-
38
- export { VerdocsSettings as verdocs_settings };
@@ -1,23 +0,0 @@
1
- import { r as registerInstance, c as createEvent, h, H as Host } from './index-b89cf6a4.js';
2
-
3
- const verdocsTabsCss = "@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-tabs{gap:10px;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-direction:row;flex-direction:row;font-family:\"Inter\", \"Barlow\", sans-serif}verdocs-tabs .tab{display:-ms-flexbox;display:flex;color:#111111;cursor:pointer;font-size:14px;font-weight:400;padding:5px 10px;-ms-flex-align:center;align-items:center;text-transform:none;-ms-flex-pack:center;justify-content:center;border-bottom:4px solid transparent}verdocs-tabs .tab:focus{border:none;outline:none}verdocs-tabs .tab.active{color:#000000;font-weight:500;border-bottom:4px solid #654dcb}verdocs-tabs .tab.disabled{color:#aaaaaa;cursor:default}";
4
- const VerdocsTabsStyle0 = verdocsTabsCss;
5
-
6
- const VerdocsTabs = class {
7
- constructor(hostRef) {
8
- registerInstance(this, hostRef);
9
- this.selectTab = createEvent(this, "selectTab", 7);
10
- this.tabs = [];
11
- this.selectedTab = 0;
12
- }
13
- handleSelectTab(index) {
14
- var _a;
15
- (_a = this.selectTab) === null || _a === void 0 ? void 0 : _a.emit({ tab: this.tabs[index], index });
16
- }
17
- render() {
18
- return (h(Host, { key: '40357821a495d7b0c94b205ed90e5fd83b4a5146' }, this.tabs.map((tab, index) => (h("div", { class: `tab ${index === this.selectedTab ? 'active' : ''} ${tab.disabled ? 'disabled' : ''}`, onClick: tab.disabled ? () => { } : () => this.handleSelectTab(index) }, tab.label))), h("div", { key: 'dd9e2a621082bd61f62b161830c6fd1138f0e8c1', class: "flex flex-1" }), h("slot", { key: '4e64f7e7221fd9d5613f83db4067f71f2c4c1f12' }, h("div", { key: '4926afa57bb87a838b66807837f3b71c436a4586' }))));
19
- }
20
- };
21
- VerdocsTabs.style = VerdocsTabsStyle0;
22
-
23
- export { VerdocsTabs as verdocs_tabs };