@verdocs/web-sdk 2.0.28 → 2.1.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 (32) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/verdocs-auth.cjs.entry.js +194 -31
  3. package/dist/cjs/verdocs-sign.cjs.entry.js +2 -8
  4. package/dist/cjs/verdocs-web-sdk.cjs.js +1 -1
  5. package/dist/collection/components/embeds/verdocs-auth/verdocs-auth.css +10 -2
  6. package/dist/collection/components/embeds/verdocs-auth/verdocs-auth.js +135 -32
  7. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js +2 -9
  8. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.stories.js +3 -3
  9. package/dist/components/verdocs-auth.js +197 -33
  10. package/dist/components/verdocs-sign.js +2 -9
  11. package/dist/docs.json +1 -1
  12. package/dist/esm/loader.js +1 -1
  13. package/dist/esm/verdocs-auth.entry.js +194 -31
  14. package/dist/esm/verdocs-sign.entry.js +2 -8
  15. package/dist/esm/verdocs-web-sdk.js +1 -1
  16. package/dist/esm-es5/loader.js +1 -1
  17. package/dist/esm-es5/verdocs-auth.entry.js +1 -1
  18. package/dist/esm-es5/verdocs-sign.entry.js +1 -1
  19. package/dist/esm-es5/verdocs-web-sdk.js +1 -1
  20. package/dist/types/components/embeds/verdocs-auth/verdocs-auth.d.ts +12 -4
  21. package/dist/types/components/embeds/verdocs-sign/verdocs-sign.d.ts +0 -1
  22. package/dist/verdocs-web-sdk/p-450d6648.system.entry.js +1 -0
  23. package/dist/verdocs-web-sdk/p-647cdb84.system.js +1 -1
  24. package/dist/verdocs-web-sdk/p-986f78e3.entry.js +1 -0
  25. package/dist/verdocs-web-sdk/p-9964cc5e.entry.js +1 -0
  26. package/dist/verdocs-web-sdk/p-b3e0db4b.system.entry.js +1 -0
  27. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  28. package/package.json +5 -5
  29. package/dist/verdocs-web-sdk/p-5786a569.system.entry.js +0 -1
  30. package/dist/verdocs-web-sdk/p-cfdd1d5b.entry.js +0 -1
  31. package/dist/verdocs-web-sdk/p-d5d751b7.entry.js +0 -1
  32. package/dist/verdocs-web-sdk/p-d7e29ce9.system.entry.js +0 -1
@@ -1,9 +1,11 @@
1
- import { Auth } from '@verdocs/js-sdk/Users';
1
+ import { Token } from '@verdocs/js-sdk/Utils';
2
2
  import { VerdocsEndpoint } from '@verdocs/js-sdk';
3
+ import { Auth, Profiles } from '@verdocs/js-sdk/Users';
3
4
  import { Organizations } from '@verdocs/js-sdk/Organizations';
4
5
  import { h } from '@stencil/core';
5
6
  import { VerdocsToast } from '../../../utils/Toast';
6
7
  import { SDKError } from '../../../utils/errors';
8
+ const RECHECK_INTERVAL = 5000;
7
9
  const Industries = [
8
10
  { value: '', label: '' },
9
11
  { value: 'Accounting & Tax', label: 'Accounting & Tax' },
@@ -75,6 +77,9 @@ const CompanySizes = [
75
77
  */
76
78
  export class VerdocsAuth {
77
79
  constructor() {
80
+ this.recheckTimer = null;
81
+ this.resendDisabledTimer = null;
82
+ this.accessTokenForVerification = null;
78
83
  this.endpoint = VerdocsEndpoint.getDefault();
79
84
  this.visible = true;
80
85
  this.logo = 'https://app.verdocs.com/assets/blue-logo.svg';
@@ -87,14 +92,15 @@ export class VerdocsAuth {
87
92
  this.username = '';
88
93
  this.phone = '';
89
94
  this.password = '';
90
- this.loggingIn = false;
95
+ this.submitting = false;
91
96
  this.activeSession = null;
92
97
  this.accountType = 'org';
93
98
  this.howHear = '';
94
99
  this.industry = '';
95
100
  this.companySize = '';
96
101
  this.reason = '';
97
- this.step = 1;
102
+ this.signupStep = 1;
103
+ this.resendDisabled = false;
98
104
  }
99
105
  componentWillLoad() {
100
106
  var _a, _b;
@@ -110,42 +116,94 @@ export class VerdocsAuth {
110
116
  (_b = this.authenticated) === null || _b === void 0 ? void 0 : _b.emit({ authenticated: false, session: null });
111
117
  }
112
118
  }
119
+ disconnectedCallback() {
120
+ this.cancelRecheckTimer();
121
+ }
122
+ cancelRecheckTimer() {
123
+ if (this.recheckTimer) {
124
+ try {
125
+ clearTimeout(this.recheckTimer);
126
+ }
127
+ catch (e) {
128
+ // NOP
129
+ }
130
+ this.recheckTimer = null;
131
+ }
132
+ if (this.resendDisabledTimer) {
133
+ try {
134
+ clearTimeout(this.resendDisabledTimer);
135
+ }
136
+ catch (e) {
137
+ // NOP
138
+ }
139
+ this.resendDisabledTimer = null;
140
+ }
141
+ }
113
142
  handleSignup() {
114
- this.loggingIn = true;
115
- Auth.authenticateUser(this.endpoint, { username: this.username, password: this.password })
143
+ this.submitting = true;
144
+ this.accessTokenForVerification = null;
145
+ Profiles.createBusinessAccount(this.endpoint, {
146
+ email: this.username,
147
+ password: this.password,
148
+ firstName: this.first,
149
+ lastName: this.last,
150
+ orgName: this.orgname,
151
+ industry: this.industry,
152
+ size: this.companySize,
153
+ // source?: string;
154
+ // referral?: string;
155
+ // coupon?: string;
156
+ reason: this.reason,
157
+ hearabout: this.howHear,
158
+ })
116
159
  .then(r => {
117
- var _a;
118
- this.loggingIn = false;
119
- this.endpoint.setToken(r.accessToken);
120
- this.activeSession = this.endpoint.session;
121
- this.isAuthenticated = true;
122
- (_a = this.authenticated) === null || _a === void 0 ? void 0 : _a.emit({ authenticated: true, session: this.endpoint.session });
160
+ console.log('Result', r);
161
+ console.log('[AUTH] Created profile', r.profile);
162
+ console.log('[AUTH] Created organization', r.organization);
163
+ this.loginAndCheckVerification();
123
164
  })
124
165
  .catch(e => {
125
- var _a, _b, _c, _d;
126
- console.log('[AUTH] Authentication error', e.response, JSON.stringify(e));
127
- this.loggingIn = false;
166
+ var _a, _b, _c, _d, _e;
167
+ console.log('[AUTH] Signup error', e.response, JSON.stringify(e));
168
+ this.submitting = false;
128
169
  this.activeSession = null;
129
170
  (_a = this.authenticated) === null || _a === void 0 ? void 0 : _a.emit({ authenticated: false, session: null });
130
171
  (_b = this.sdkError) === null || _b === void 0 ? void 0 : _b.emit(new SDKError(e.message, (_c = e.response) === null || _c === void 0 ? void 0 : _c.status, (_d = e.response) === null || _d === void 0 ? void 0 : _d.data));
131
- VerdocsToast('Login failed. Please check your username and password and try again.', { style: 'error' });
172
+ VerdocsToast('Signup failed: ' + ((_e = e.response) === null || _e === void 0 ? void 0 : _e.data), { style: 'error' });
132
173
  });
133
174
  }
134
- handleLogin() {
135
- this.loggingIn = true;
175
+ loginAndCheckVerification() {
176
+ this.submitting = true;
177
+ this.accessTokenForVerification = null;
136
178
  Auth.authenticateUser(this.endpoint, { username: this.username, password: this.password })
137
179
  .then(r => {
138
180
  var _a;
139
- this.loggingIn = false;
140
- this.endpoint.setToken(r.accessToken);
141
- this.activeSession = this.endpoint.session;
142
- this.isAuthenticated = true;
143
- (_a = this.authenticated) === null || _a === void 0 ? void 0 : _a.emit({ authenticated: true, session: this.endpoint.session });
181
+ this.cancelRecheckTimer();
182
+ this.submitting = false;
183
+ const body = Token.decodeAccessTokenBody(r.accessToken);
184
+ console.log('[AUTH] Got access token body', body);
185
+ if (body === null || body === void 0 ? void 0 : body.email_verified) {
186
+ console.log('[AUTH] Email address is verified, completing login');
187
+ this.displayMode = 'login'; // After signing out, this will be the next mode
188
+ this.accessTokenForVerification = null;
189
+ this.endpoint.setToken(r.accessToken);
190
+ this.activeSession = this.endpoint.session;
191
+ this.isAuthenticated = true;
192
+ (_a = this.authenticated) === null || _a === void 0 ? void 0 : _a.emit({ authenticated: true, session: this.endpoint.session });
193
+ }
194
+ else {
195
+ console.log('[AUTH] Logged in, pending email address verification');
196
+ this.displayMode = 'verify';
197
+ this.accessTokenForVerification = r.accessToken;
198
+ this.recheckTimer = setTimeout(() => this.loginAndCheckVerification(), RECHECK_INTERVAL);
199
+ }
144
200
  })
145
201
  .catch(e => {
146
202
  var _a, _b, _c, _d;
203
+ this.cancelRecheckTimer();
147
204
  console.log('[AUTH] Authentication error', e.response, JSON.stringify(e));
148
- this.loggingIn = false;
205
+ this.displayMode = 'login';
206
+ this.submitting = false;
149
207
  this.activeSession = null;
150
208
  (_a = this.authenticated) === null || _a === void 0 ? void 0 : _a.emit({ authenticated: false, session: null });
151
209
  (_b = this.sdkError) === null || _b === void 0 ? void 0 : _b.emit(new SDKError(e.message, (_c = e.response) === null || _c === void 0 ? void 0 : _c.status, (_d = e.response) === null || _d === void 0 ? void 0 : _d.data));
@@ -156,8 +214,40 @@ export class VerdocsAuth {
156
214
  var _a;
157
215
  this.endpoint.clearSession();
158
216
  this.isAuthenticated = false;
217
+ this.accessTokenForVerification = null;
159
218
  (_a = this.authenticated) === null || _a === void 0 ? void 0 : _a.emit({ authenticated: false, session: null });
160
219
  }
220
+ handleResend() {
221
+ // Avoid the user just click-spamming this pathway. The server rate-limits this anyway so it's not a
222
+ // security issue but it's a poor user experience to allow it.
223
+ this.resendDisabled = true;
224
+ this.resendDisabledTimer = setTimeout(() => {
225
+ this.resendDisabled = false;
226
+ this.resendDisabledTimer = null;
227
+ }, 30000);
228
+ Auth.resendVerification(this.endpoint, this.accessTokenForVerification)
229
+ .then(r => {
230
+ console.log('[AUTH] Verification request resent', r);
231
+ VerdocsToast('Please check your email for a message with verification instructions.', { style: 'info' });
232
+ })
233
+ .catch((e) => {
234
+ console.log('[AUTH] Unable to resend verification', e);
235
+ });
236
+ }
237
+ handleReset() {
238
+ this.submitting = true;
239
+ Auth.resetPassword(this.endpoint, { email: this.username })
240
+ .then(r => {
241
+ console.log('[AUTH] Reset sent', r);
242
+ this.submitting = false;
243
+ this.displayMode = 'login';
244
+ VerdocsToast('If your email address is registered, you will receive instructions on resetting your password shortly.', { style: 'info' });
245
+ })
246
+ .catch((e) => {
247
+ console.log('[AUTH] Unable to reset password', e);
248
+ this.submitting = false;
249
+ });
250
+ }
161
251
  async checkAvailability(name) {
162
252
  this.orgname = name;
163
253
  this.orgAvailable = '';
@@ -171,18 +261,30 @@ export class VerdocsAuth {
171
261
  return h("div", { style: { display: 'none' } }, "Authenticated");
172
262
  }
173
263
  if (this.isAuthenticated) {
174
- return (h("verdocs-button", { label: "Sign Out", disabled: this.loggingIn, onClick: () => this.handleLogout(), style: { display: 'flex', justifyContent: 'center', margin: '30px auto 0' } }));
264
+ return (h("verdocs-button", { label: "Sign Out", disabled: this.submitting, onClick: () => this.handleLogout(), style: { display: 'flex', justifyContent: 'center', margin: '30px auto 0' } }));
175
265
  }
176
266
  if (this.displayMode === 'signup') {
177
- const step1Valid = this.loggingIn || !this.first || !this.last || !this.username || !this.password || !this.orgname || this.orgAvailable !== 'OK';
178
- return (h("div", { class: "signup-form" }, h("img", { src: this.logo, alt: "Verdocs Logo", class: "logo" }), h("h3", null, "Sign up for a trial account"), h("h4", null, "Already have an account?", h("verdocs-button", { label: "Log In", variant: "text", onClick: () => (this.displayMode = 'login'), disabled: this.loggingIn })), this.step === 1 && (h("form", { onSubmit: () => this.handleSignup() }, h("div", { style: { display: 'flex', flexDirection: 'row', columnGap: '20px' } }, h("verdocs-text-input", { label: "First Name", autocomplete: "first", required: true, value: this.first, onInput: (e) => (this.first = e.target.value), disabled: this.loggingIn }), h("verdocs-text-input", { label: "Last Name", autocomplete: "last", required: true, value: this.last, onInput: (e) => (this.last = e.target.value), disabled: this.loggingIn })), h("verdocs-text-input", { label: "Email", autocomplete: "email", required: true, value: this.username, onInput: (e) => (this.username = e.target.value), disabled: this.loggingIn }), h("verdocs-text-input", { label: "Phone #", autocomplete: "phone", value: this.phone, onInput: (e) => (this.phone = e.target.value), disabled: this.loggingIn }), h("verdocs-text-input", { label: "Password", type: "password", required: true, autocomplete: "current-password", value: this.password, onInput: (e) => (this.password = e.target.value), disabled: this.loggingIn }), h("verdocs-text-input", { label: "Organization Name", autocomplete: "org", required: true, value: this.orgname, onInput: (e) => this.checkAvailability(e.target.value), disabled: this.loggingIn }), this.orgAvailable === 'TAKEN' && h("p", { style: { color: 'red' } }, "This organization name is already taken."), h("div", { style: { marginTop: '30px' } }), h("verdocs-button", { label: "Next", disabled: step1Valid, onClick: () => (this.step = 2), style: { display: 'flex', justifyContent: 'center', margin: '30px auto 0' } }))), this.step === 2 && (h("form", { onSubmit: () => this.handleSignup() }, h("verdocs-text-input", { label: "How did you hear about Verdocs?", value: this.howHear, onInput: (e) => (this.howHear = e.target.value), disabled: this.loggingIn }), h("verdocs-select-input", { label: "Your Industry", options: Industries, value: this.industry, onInput: (e) => (this.industry = e.target.value), disabled: this.loggingIn }), h("verdocs-select-input", { label: "Company Size", options: CompanySizes, value: this.companySize, onInput: (e) => (this.companySize = e.target.value), disabled: this.loggingIn }), h("verdocs-select-input", { label: "Purpose", options: Reasons, value: this.reason, onInput: (e) => (this.reason = e.target.value), disabled: this.loggingIn }), h("div", { style: { marginTop: '30px' } }), h("verdocs-button", { label: "Create Account", disabled: this.loggingIn, onClick: () => this.handleSignup(), style: { display: 'flex', justifyContent: 'center', margin: '30px auto 0' } }))), this.step === 3 && (h("form", { onSubmit: () => this.handleSignup() }, h("p", null, "Please check your e-mail inbox for a verification code and follow the instructions provided."), h("p", null, h("em", null, "Verification messages may take up to 1 hour to arrive. If you do not receive the invitation, ", h("a", { href: "#" }, "Click Here"), " to resend it. Be sure to check your spam folder.")), h("div", { style: { display: 'flex', flexDirection: 'row', gap: '20px' } }, h("verdocs-button", { label: "Back", disabled: this.loggingIn, onClick: () => {
179
- this.step = 4;
267
+ const step1Invalid = this.submitting || !this.first || !this.last || !this.username || !this.password || !this.orgname || this.orgAvailable !== 'OK';
268
+ console.log({ step1Invalid }, this.orgAvailable);
269
+ return (h("div", { class: "form" }, h("img", { src: this.logo, alt: "Verdocs Logo", class: "logo" }), h("h3", null, "Sign up for a trial account"), h("h4", null, "Already have an account?", h("verdocs-button", { label: "Log In", variant: "text", onClick: () => (this.displayMode = 'login'), disabled: this.submitting })), this.signupStep === 1 && (h("form", { onSubmit: () => this.handleSignup() }, h("div", { style: { display: 'flex', flexDirection: 'row', columnGap: '20px' } }, h("verdocs-text-input", { label: "First Name", autocomplete: "first", required: true, value: this.first, onInput: (e) => (this.first = e.target.value), disabled: this.submitting }), h("verdocs-text-input", { label: "Last Name", autocomplete: "last", required: true, value: this.last, onInput: (e) => (this.last = e.target.value), disabled: this.submitting })), h("verdocs-text-input", { label: "Email", autocomplete: "email", required: true, value: this.username, onInput: (e) => (this.username = e.target.value), disabled: this.submitting }), h("verdocs-text-input", { label: "Phone #", autocomplete: "phone", value: this.phone, onInput: (e) => (this.phone = e.target.value), disabled: this.submitting }), h("verdocs-text-input", { label: "Password", type: "password", required: true, autocomplete: "current-password", value: this.password, onInput: (e) => (this.password = e.target.value), disabled: this.submitting }), h("verdocs-text-input", { label: "Organization Name", autocomplete: "org", required: true, value: this.orgname, onInput: (e) => this.checkAvailability(e.target.value), disabled: this.submitting }), this.orgAvailable === 'TAKEN' && h("p", { style: { color: 'red' } }, "This organization name is already taken."), h("div", { style: { marginTop: '30px' } }), h("verdocs-button", { label: "Next", disabled: step1Invalid, onClick: () => (this.signupStep = 2), style: { display: 'flex', justifyContent: 'center', margin: '30px auto 0' } }))), this.signupStep === 2 && (h("form", { onSubmit: () => this.handleSignup() }, h("verdocs-text-input", { label: "How did you hear about Verdocs?", value: this.howHear, onInput: (e) => (this.howHear = e.target.value), disabled: this.submitting }), h("verdocs-select-input", { label: "Your Industry", options: Industries, value: this.industry, onInput: (e) => (this.industry = e.target.value), disabled: this.submitting }), h("verdocs-select-input", { label: "Company Size", options: CompanySizes, value: this.companySize, onInput: (e) => (this.companySize = e.target.value), disabled: this.submitting }), h("verdocs-select-input", { label: "Purpose", options: Reasons, value: this.reason, onInput: (e) => (this.reason = e.target.value), disabled: this.submitting }), h("div", { style: { marginTop: '30px' } }), h("verdocs-button", { label: "Create Account", disabled: this.submitting, onClick: () => this.handleSignup(), style: { display: 'flex', justifyContent: 'center', margin: '30px auto 0' } }))), this.signupStep === 3 && (h("form", { onSubmit: () => this.handleSignup() }, h("p", null, "Please check your e-mail inbox for a verification code and follow the instructions provided."), h("p", null, h("em", null, "Verification messages may take up to 1 hour to arrive. If you do not receive the invitation, ", h("a", { href: "#" }, "Click Here"), " to resend it. Be sure to check your spam folder.")), h("div", { style: { display: 'flex', flexDirection: 'row', gap: '20px' } }, h("verdocs-button", { label: "Back", disabled: this.submitting, onClick: () => {
270
+ this.signupStep = 2;
180
271
  }, style: { display: 'flex', justifyContent: 'center', margin: '30px auto 0' } }), h("verdocs-button", { label: "Go to Dashboard", disabled: true, onClick: () => this.handleSignup(), style: { display: 'flex', justifyContent: 'center', margin: '30px auto 0' } }))))));
181
272
  }
182
- return (h("div", { class: "login-form" }, h("img", { src: this.logo, alt: "Verdocs Logo", class: "logo" }), h("h3", null, "Log in to your account"), h("h4", null, "Don't have an account?", h("verdocs-button", { label: "Sign Up", variant: "text", onClick: () => {
273
+ if (this.displayMode === 'forgot') {
274
+ return (h("div", { class: "form" }, h("img", { src: this.logo, alt: "Verdocs Logo", class: "logo" }), h("h3", null, "Forgot your password?"), h("p", null, "Enter your e-mail address below, and reset instructions will be sent to your Inbox."), h("p", null, h("em", null, "Please allow up to 24 hours for delivery, and check your spam folder if you do not receive the message. ")), h("form", { onSubmit: () => this.handleSignup() }, h("verdocs-text-input", { label: "Email", autocomplete: "email", required: true, value: this.username, onInput: (e) => (this.username = e.target.value), disabled: this.submitting }), h("div", { style: { marginTop: '30px' } }), h("div", { class: "buttons" }, h("verdocs-button", { label: "Cancel", variant: "outline", disabled: this.submitting, onClick: () => (this.displayMode = 'login') }), h("verdocs-button", { label: "Reset", disabled: this.submitting, onClick: () => this.handleReset() })))));
275
+ }
276
+ if (this.displayMode === 'verify') {
277
+ return (h("div", { class: "form" }, h("img", { src: this.logo, alt: "Verdocs Logo", class: "logo" }), h("h3", null, "Please Verify your Email Address"), h("p", null, "Check your e-mail inbox for a verification email, and follow the instructions provided."), h("p", null, h("em", null, "Please allow up to 24 hours for delivery, and check your spam folder if you do not receive the message. ")), h("div", { class: "buttons" }, h("verdocs-button", { label: "Sign Out", variant: "outline", disabled: this.submitting, onClick: () => {
278
+ this.username = '';
279
+ this.password = '';
280
+ this.cancelRecheckTimer();
281
+ this.displayMode = 'login';
282
+ } }), h("verdocs-button", { label: "Resend Email", disabled: this.resendDisabled, onClick: () => this.handleResend() }))));
283
+ }
284
+ return (h("div", { class: "form" }, h("img", { src: this.logo, alt: "Verdocs Logo", class: "logo" }), h("h3", null, "Log in to your account"), h("h4", null, "Don't have an account?", h("verdocs-button", { label: "Sign Up", variant: "text", onClick: () => {
183
285
  this.displayMode = 'signup';
184
- this.step = 1;
185
- }, disabled: this.loggingIn })), h("form", { onSubmit: () => this.handleLogin() }, h("verdocs-text-input", { label: "Email", autocomplete: "username", value: this.username, onInput: (e) => (this.username = e.target.value), disabled: this.loggingIn }), h("verdocs-text-input", { label: "Password", type: "password", autocomplete: "current-password", value: this.password, onInput: (e) => (this.password = e.target.value), disabled: this.loggingIn }), h("verdocs-button", { label: "Forgot Your Password?", variant: "text", onClick: () => (this.displayMode = 'signup'), disabled: this.loggingIn, style: { display: 'flex', justifyContent: 'center', margin: '10px auto 20px' } }), h("verdocs-button", { label: "Login", disabled: this.loggingIn, onClick: () => this.handleLogin(), style: { display: 'flex', justifyContent: 'center', margin: '10px auto 0' } }))));
286
+ this.signupStep = 1;
287
+ }, disabled: this.submitting })), h("form", { onSubmit: () => this.loginAndCheckVerification() }, h("verdocs-text-input", { label: "Email", autocomplete: "username", value: this.username, onInput: (e) => (this.username = e.target.value), disabled: this.submitting }), h("verdocs-text-input", { label: "Password", type: "password", autocomplete: "current-password", value: this.password, onInput: (e) => (this.password = e.target.value), disabled: this.submitting }), h("verdocs-button", { label: "Forgot Your Password?", variant: "text", onClick: () => (this.displayMode = 'forgot'), disabled: this.submitting, style: { display: 'flex', justifyContent: 'center', margin: '10px auto 20px' } }), h("verdocs-button", { label: "Login", disabled: this.submitting, onClick: () => this.loginAndCheckVerification(), style: { display: 'flex', justifyContent: 'center', margin: '10px auto 0' } }))));
186
288
  }
187
289
  static get is() { return "verdocs-auth"; }
188
290
  static get originalStyleUrls() {
@@ -267,14 +369,15 @@ export class VerdocsAuth {
267
369
  "username": {},
268
370
  "phone": {},
269
371
  "password": {},
270
- "loggingIn": {},
372
+ "submitting": {},
271
373
  "activeSession": {},
272
374
  "accountType": {},
273
375
  "howHear": {},
274
376
  "industry": {},
275
377
  "companySize": {},
276
378
  "reason": {},
277
- "step": {}
379
+ "signupStep": {},
380
+ "resendDisabled": {}
278
381
  };
279
382
  }
280
383
  static get events() {
@@ -11,8 +11,8 @@ import { envelopeRecipientAgree, envelopeRecipientDecline, envelopeRecipientSubm
11
11
  import { throttledGetEnvelope, updateEnvelopeFieldInitials, updateEnvelopeFieldSignature, uploadEnvelopeFieldAttachment } from '@verdocs/js-sdk/Envelopes/Envelopes';
12
12
  import { getFieldId, getRoleIndex, renderDocumentField, saveAttachment, updateDocumentFieldValue } from '../../../utils/utils';
13
13
  import { FORMAT_DATE } from '../../../utils/Types';
14
- import { SDKError } from '../../../utils/errors';
15
14
  import { VerdocsToast } from '../../../utils/Toast';
15
+ import { SDKError } from '../../../utils/errors';
16
16
  const inProgressMenuOptions = [
17
17
  { id: 'later', label: 'Finish Later' },
18
18
  // {id: 'claim', label: 'Claim the Document', disabled: true},
@@ -57,7 +57,6 @@ export class VerdocsSign {
57
57
  this.hasSignature = false;
58
58
  this.nextButtonLabel = 'Start';
59
59
  this.nextSubmits = false;
60
- this.showSubmitDialog = false;
61
60
  this.errorMessage = '';
62
61
  this.focusedField = '';
63
62
  this.submitting = false;
@@ -360,7 +359,7 @@ export class VerdocsSign {
360
359
  if (invalidFields.length < 1) {
361
360
  this.nextButtonLabel = 'Finish';
362
361
  if (!this.nextSubmits) {
363
- this.showSubmitDialog = true;
362
+ // this.showSubmitDialog = true;
364
363
  this.nextSubmits = true;
365
364
  }
366
365
  }
@@ -473,11 +472,6 @@ export class VerdocsSign {
473
472
  })), this.showFinishLater && (h("verdocs-ok-dialog", { heading: "You've saved your document to finish later.", message: `To complete the ${this.documentsSingularPlural}, use the link in the original email notification inviting you to review and finish the document.`, onNext: () => (this.showFinishLater = false) })), this.errorMessage && h("verdocs-ok-dialog", { heading: "Network Error", message: this.errorMessage, onNext: () => (this.errorMessage = '') }), this.showDone && (h("verdocs-ok-dialog", { heading: "You're Done!", message: `You can access the ${this.documentsSingularPlural} at any time by clicking on the link from the invitation email.<br /><br />After all recipients have completed their actions, you will receive an email with the document and envelope certificate attached.`, onNext: () => {
474
473
  this.showDone = false;
475
474
  this.isDone = true;
476
- } })), this.showSubmitDialog && (h("verdocs-ok-dialog", { heading: "Ready to Submit?", message: `All required fields have been completed.<br />Are you ready to submit this document?`, showCancel: true, onExit: () => {
477
- this.showSubmitDialog = false;
478
- }, onNext: () => {
479
- this.showSubmitDialog = false;
480
- return this.handleNext();
481
475
  } })), this.submitting && (h("div", { class: "loading-indicator" }, h("verdocs-loader", null))), !this.agreed && (h("div", { class: "cover" }, h("div", { class: "agree" }, h("verdocs-checkbox", { name: "agree", label: "By checking this box, you:", onInput: () => this.handleClickAgree() }), h("ul", null, h("li", null, "Agree to use electronic records and signatures, and confirm you have read the", ' ', h("a", { href: "https://verdocs.com/en/electronic-record-signature-disclosure/", target: "_blank" }, "Electronic Record and Signatures Disclosure"), "."), h("li", null, "Agree to Verdocs", ' ', h("a", { href: "https://verdocs.com/en/eula", target: "_blank" }, "End User License Agreement"), ' ', "and confirm you have read Verdocs'", ' ', h("a", { href: "https://verdocs.com/en/privacy-policy/", target: "_blank" }, "Privacy Policy"), ".")))))));
482
476
  }
483
477
  static get is() { return "verdocs-sign"; }
@@ -577,7 +571,6 @@ export class VerdocsSign {
577
571
  "hasSignature": {},
578
572
  "nextButtonLabel": {},
579
573
  "nextSubmits": {},
580
- "showSubmitDialog": {},
581
574
  "errorMessage": {},
582
575
  "focusedField": {},
583
576
  "submitting": {},
@@ -3,9 +3,9 @@ export default {
3
3
  title: 'Embeds/Sign',
4
4
  component: 'verdocs-sign',
5
5
  args: {
6
- envelopeId: '26651429-f023-4afc-b969-23ba68adad4b',
7
- roleId: 'Buyer',
8
- inviteCode: '44fcfa9435cdb855a7ddb0c3c2d7da9c',
6
+ envelopeId: '',
7
+ roleId: '',
8
+ inviteCode: '',
9
9
  },
10
10
  argTypes: {
11
11
  envelopeId: {