@verdocs/web-sdk 4.2.102 → 4.2.106
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.
- package/dist/cjs/verdocs-auth.cjs.entry.js +5 -1
- package/dist/cjs/verdocs-contact-picker_2.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-sign.cjs.entry.js +5 -0
- package/dist/collection/components/embeds/verdocs-auth/verdocs-auth.js +5 -1
- package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js +6 -1
- package/dist/collection/components/envelopes/verdocs-contact-picker/verdocs-contact-picker.css +4 -2
- package/dist/components/verdocs-auth.js +5 -1
- package/dist/components/verdocs-contact-picker2.js +1 -1
- package/dist/components/verdocs-sign.js +6 -1
- package/dist/esm/verdocs-auth.entry.js +5 -1
- package/dist/esm/verdocs-contact-picker_2.entry.js +1 -1
- package/dist/esm/verdocs-sign.entry.js +6 -1
- package/dist/esm-es5/verdocs-auth.entry.js +1 -1
- package/dist/esm-es5/verdocs-contact-picker_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-sign.entry.js +1 -1
- package/dist/verdocs-web-sdk/p-267df026.system.js +1 -1
- package/dist/verdocs-web-sdk/p-3007fa21.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-4ae0fd79.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-afcde3c3.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-b7fdf5cb.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-c33ecae3.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-fbcf4277.entry.js → p-ef8aafa1.entry.js} +1 -1
- package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
- package/package.json +2 -2
- package/dist/verdocs-web-sdk/p-0226144d.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-08d272d2.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-40b66b54.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-7da5f9e6.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-b055bec1.system.entry.js +0 -1
@@ -91,7 +91,11 @@ const VerdocsAuth = class {
|
|
91
91
|
.then(r => {
|
92
92
|
console.log('[AUTH] Profile creation result', r);
|
93
93
|
this.tempAuthEndpoint.setToken(r.access_token);
|
94
|
-
|
94
|
+
// We can't clearForms because we need email to stick around
|
95
|
+
this.password = '';
|
96
|
+
this.first_name = '';
|
97
|
+
this.last_name = '';
|
98
|
+
this.org_name = '';
|
95
99
|
this.displayMode = 'verify';
|
96
100
|
})
|
97
101
|
.catch(e => {
|
@@ -9,7 +9,7 @@ require('./_commonjsHelpers-e6ff1d6e.js');
|
|
9
9
|
require('./Types-7a726ff3.js');
|
10
10
|
require('./index-5f130ec0.js');
|
11
11
|
|
12
|
-
const verdocsContactPickerCss = "@-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-contact-picker{display:block;border:1px solid #ebebeb;background-color:#ffffff;font-family:\"Inter\", -apple-system, \"Segoe UI\", \"Roboto\", \"Helvetica Neue\", sans-serif;-webkit-box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1);box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1)}verdocs-contact-picker form{display:-ms-flexbox;display:flex;gap:14px;width:300px;padding:12px;display:flex;-ms-flex-direction:column;flex-direction:column;background-color:#f5f5fa}verdocs-contact-picker form .row{gap:8px;width:
|
12
|
+
const verdocsContactPickerCss = "@-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-contact-picker{display:block;border:1px solid #ebebeb;background-color:#ffffff;font-family:\"Inter\", -apple-system, \"Segoe UI\", \"Roboto\", \"Helvetica Neue\", sans-serif;-webkit-box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1);box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1)}verdocs-contact-picker form{display:-ms-flexbox;display:flex;gap:14px;width:300px;padding:12px;display:flex;-ms-flex-direction:column;flex-direction:column;background-color:#f5f5fa}verdocs-contact-picker form .row{gap:8px;width:276px;display:-ms-flexbox;display:flex;position:relative;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center}verdocs-contact-picker form .row.message{-ms-flex-direction:column;flex-direction:column;-ms-flex-align:start;align-items:flex-start}verdocs-contact-picker form .names-row{gap:8px;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker form .names-row>input{font-size:14px;width:110px}verdocs-contact-picker form .kba-row{gap:8px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker form .kba-row>input{font-size:14px;width:110px}verdocs-contact-picker form .kba-row verdocs-select-input{margin:0}verdocs-contact-picker form label{display:-ms-flexbox;display:flex;-ms-flex:0 0 50px;flex:0 0 50px;font-size:14px;font-weight:500;color:#5c6575}verdocs-contact-picker form .row.message label{-ms-flex:0;flex:0}verdocs-contact-picker form .row.message input{width:100%}verdocs-contact-picker form input{-ms-flex:1;flex:1;border:none;font-size:14px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-contact-picker form input:focus{outline:none}verdocs-contact-picker form .dropdown{left:0;right:0;top:49px;z-index:1000000;max-height:225px;overflow-y:scroll;position:absolute;background:#ffffff;-webkit-box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1);box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1)}verdocs-contact-picker form .dropdown .suggestion{display:-ms-flexbox;display:flex;padding:6px 12px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker form .dropdown .suggestion svg{width:32px;height:32px}verdocs-contact-picker form .dropdown .suggestion .avatar{width:32px;height:32px;-ms-flex:0 0 32px;flex:0 0 32px;margin-right:8px;border-radius:100%}verdocs-contact-picker form .dropdown .suggestion .details{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-contact-picker form .dropdown .suggestion .name{font-size:16px;font-weight:500;margin-bottom:3px;color:#092c4c}verdocs-contact-picker form .dropdown .suggestion .destination{font-size:14px;margin-bottom:3px;color:#33364b}verdocs-contact-picker form .dropdown .suggestion:hover{background:#eee;cursor:pointer}verdocs-contact-picker .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:6px;-moz-column-gap:6px;column-gap:6px;margin-top:16px;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker .buttons .flex-fill{-ms-flex:1;flex:1}verdocs-contact-picker ::-webkit-input-placeholder{color:#aaaaaa}verdocs-contact-picker ::-moz-placeholder{color:#aaaaaa}verdocs-contact-picker :-ms-input-placeholder{color:#aaaaaa}verdocs-contact-picker ::-ms-input-placeholder{color:#aaaaaa}verdocs-contact-picker ::placeholder{color:#aaaaaa}verdocs-contact-picker [data-lastpass-icon-root]{display:none !important}";
|
13
13
|
const VerdocsContactPickerStyle0 = verdocsContactPickerCss;
|
14
14
|
|
15
15
|
const messageIcon = '<svg focusable="false" viewBox="0 0 24 24"><path d="M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-2 12H6v-2h12v2zm0-3H6V9h12v2zm0-3H6V6h12v2z"></path></svg>';
|
@@ -83,6 +83,11 @@ const VerdocsSign = class {
|
|
83
83
|
console.log(`[SIGN] Loaded signing session`, envelope, recipient);
|
84
84
|
this.recipient = recipient;
|
85
85
|
this.envelope = envelope;
|
86
|
+
jsSdk.getKbaStep(this.endpoint, this.envelopeId, this.roleId)
|
87
|
+
.then(r => {
|
88
|
+
console.log('KBA Step', r);
|
89
|
+
})
|
90
|
+
.catch(e => console.log('Error getting KBA step', e));
|
86
91
|
if (this.agreed) {
|
87
92
|
this.nextButtonLabel = 'Next';
|
88
93
|
}
|
@@ -105,7 +105,11 @@ export class VerdocsAuth {
|
|
105
105
|
.then(r => {
|
106
106
|
console.log('[AUTH] Profile creation result', r);
|
107
107
|
this.tempAuthEndpoint.setToken(r.access_token);
|
108
|
-
|
108
|
+
// We can't clearForms because we need email to stick around
|
109
|
+
this.password = '';
|
110
|
+
this.first_name = '';
|
111
|
+
this.last_name = '';
|
112
|
+
this.org_name = '';
|
109
113
|
this.displayMode = 'verify';
|
110
114
|
})
|
111
115
|
.catch(e => {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { Host, Fragment, h } from "@stencil/core";
|
2
|
-
import { fullNameToInitials, startSigningSession, deleteEnvelopeFieldAttachment } from "@verdocs/js-sdk";
|
2
|
+
import { fullNameToInitials, startSigningSession, deleteEnvelopeFieldAttachment, getKbaStep } from "@verdocs/js-sdk";
|
3
3
|
import { integerSequence, isValidEmail, isValidPhone, updateEnvelopeFieldInitials } from "@verdocs/js-sdk";
|
4
4
|
import { updateEnvelopeFieldSignature, uploadEnvelopeFieldAttachment, VerdocsEndpoint, updateEnvelopeField } from "@verdocs/js-sdk";
|
5
5
|
import { createInitials, createSignature, envelopeRecipientAgree, envelopeRecipientDecline, envelopeRecipientSubmit, formatFullName } from "@verdocs/js-sdk";
|
@@ -87,6 +87,11 @@ export class VerdocsSign {
|
|
87
87
|
console.log(`[SIGN] Loaded signing session`, envelope, recipient);
|
88
88
|
this.recipient = recipient;
|
89
89
|
this.envelope = envelope;
|
90
|
+
getKbaStep(this.endpoint, this.envelopeId, this.roleId)
|
91
|
+
.then(r => {
|
92
|
+
console.log('KBA Step', r);
|
93
|
+
})
|
94
|
+
.catch(e => console.log('Error getting KBA step', e));
|
90
95
|
if (this.agreed) {
|
91
96
|
this.nextButtonLabel = 'Next';
|
92
97
|
}
|
package/dist/collection/components/envelopes/verdocs-contact-picker/verdocs-contact-picker.css
CHANGED
@@ -27,7 +27,7 @@ verdocs-contact-picker form {
|
|
27
27
|
}
|
28
28
|
verdocs-contact-picker form .row {
|
29
29
|
gap: 8px;
|
30
|
-
width:
|
30
|
+
width: 276px;
|
31
31
|
display: flex;
|
32
32
|
position: relative;
|
33
33
|
flex-direction: row;
|
@@ -43,6 +43,7 @@ verdocs-contact-picker form .names-row {
|
|
43
43
|
flex-direction: row;
|
44
44
|
}
|
45
45
|
verdocs-contact-picker form .names-row > input {
|
46
|
+
font-size: 14px;
|
46
47
|
width: 110px;
|
47
48
|
}
|
48
49
|
verdocs-contact-picker form .kba-row {
|
@@ -52,6 +53,7 @@ verdocs-contact-picker form .kba-row {
|
|
52
53
|
flex-direction: row;
|
53
54
|
}
|
54
55
|
verdocs-contact-picker form .kba-row > input {
|
56
|
+
font-size: 14px;
|
55
57
|
width: 110px;
|
56
58
|
}
|
57
59
|
verdocs-contact-picker form .kba-row verdocs-select-input {
|
@@ -73,7 +75,7 @@ verdocs-contact-picker form .row.message input {
|
|
73
75
|
verdocs-contact-picker form input {
|
74
76
|
flex: 1;
|
75
77
|
border: none;
|
76
|
-
font-size:
|
78
|
+
font-size: 14px;
|
77
79
|
padding: 3px 6px 3px 0;
|
78
80
|
background: transparent;
|
79
81
|
border-bottom: 1px solid #33364b;
|
@@ -91,7 +91,11 @@ const VerdocsAuth$1 = /*@__PURE__*/ proxyCustomElement(class VerdocsAuth extends
|
|
91
91
|
.then(r => {
|
92
92
|
console.log('[AUTH] Profile creation result', r);
|
93
93
|
this.tempAuthEndpoint.setToken(r.access_token);
|
94
|
-
|
94
|
+
// We can't clearForms because we need email to stick around
|
95
|
+
this.password = '';
|
96
|
+
this.first_name = '';
|
97
|
+
this.last_name = '';
|
98
|
+
this.org_name = '';
|
95
99
|
this.displayMode = 'verify';
|
96
100
|
})
|
97
101
|
.catch(e => {
|
@@ -6,7 +6,7 @@ import { d as defineCustomElement$3 } from './verdocs-help-icon2.js';
|
|
6
6
|
import { d as defineCustomElement$2 } from './verdocs-select-input2.js';
|
7
7
|
import { d as defineCustomElement$1 } from './verdocs-toggle-button2.js';
|
8
8
|
|
9
|
-
const verdocsContactPickerCss = "@-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-contact-picker{display:block;border:1px solid #ebebeb;background-color:#ffffff;font-family:\"Inter\", -apple-system, \"Segoe UI\", \"Roboto\", \"Helvetica Neue\", sans-serif;-webkit-box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1);box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1)}verdocs-contact-picker form{display:-ms-flexbox;display:flex;gap:14px;width:300px;padding:12px;display:flex;-ms-flex-direction:column;flex-direction:column;background-color:#f5f5fa}verdocs-contact-picker form .row{gap:8px;width:
|
9
|
+
const verdocsContactPickerCss = "@-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-contact-picker{display:block;border:1px solid #ebebeb;background-color:#ffffff;font-family:\"Inter\", -apple-system, \"Segoe UI\", \"Roboto\", \"Helvetica Neue\", sans-serif;-webkit-box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1);box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1)}verdocs-contact-picker form{display:-ms-flexbox;display:flex;gap:14px;width:300px;padding:12px;display:flex;-ms-flex-direction:column;flex-direction:column;background-color:#f5f5fa}verdocs-contact-picker form .row{gap:8px;width:276px;display:-ms-flexbox;display:flex;position:relative;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center}verdocs-contact-picker form .row.message{-ms-flex-direction:column;flex-direction:column;-ms-flex-align:start;align-items:flex-start}verdocs-contact-picker form .names-row{gap:8px;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker form .names-row>input{font-size:14px;width:110px}verdocs-contact-picker form .kba-row{gap:8px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker form .kba-row>input{font-size:14px;width:110px}verdocs-contact-picker form .kba-row verdocs-select-input{margin:0}verdocs-contact-picker form label{display:-ms-flexbox;display:flex;-ms-flex:0 0 50px;flex:0 0 50px;font-size:14px;font-weight:500;color:#5c6575}verdocs-contact-picker form .row.message label{-ms-flex:0;flex:0}verdocs-contact-picker form .row.message input{width:100%}verdocs-contact-picker form input{-ms-flex:1;flex:1;border:none;font-size:14px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-contact-picker form input:focus{outline:none}verdocs-contact-picker form .dropdown{left:0;right:0;top:49px;z-index:1000000;max-height:225px;overflow-y:scroll;position:absolute;background:#ffffff;-webkit-box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1);box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1)}verdocs-contact-picker form .dropdown .suggestion{display:-ms-flexbox;display:flex;padding:6px 12px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker form .dropdown .suggestion svg{width:32px;height:32px}verdocs-contact-picker form .dropdown .suggestion .avatar{width:32px;height:32px;-ms-flex:0 0 32px;flex:0 0 32px;margin-right:8px;border-radius:100%}verdocs-contact-picker form .dropdown .suggestion .details{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-contact-picker form .dropdown .suggestion .name{font-size:16px;font-weight:500;margin-bottom:3px;color:#092c4c}verdocs-contact-picker form .dropdown .suggestion .destination{font-size:14px;margin-bottom:3px;color:#33364b}verdocs-contact-picker form .dropdown .suggestion:hover{background:#eee;cursor:pointer}verdocs-contact-picker .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:6px;-moz-column-gap:6px;column-gap:6px;margin-top:16px;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker .buttons .flex-fill{-ms-flex:1;flex:1}verdocs-contact-picker ::-webkit-input-placeholder{color:#aaaaaa}verdocs-contact-picker ::-moz-placeholder{color:#aaaaaa}verdocs-contact-picker :-ms-input-placeholder{color:#aaaaaa}verdocs-contact-picker ::-ms-input-placeholder{color:#aaaaaa}verdocs-contact-picker ::placeholder{color:#aaaaaa}verdocs-contact-picker [data-lastpass-icon-root]{display:none !important}";
|
10
10
|
const VerdocsContactPickerStyle0 = verdocsContactPickerCss;
|
11
11
|
|
12
12
|
const messageIcon = '<svg focusable="false" viewBox="0 0 24 24"><path d="M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-2 12H6v-2h12v2zm0-3H6V9h12v2zm0-3H6V6h12v2z"></path></svg>';
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host, Fragment } from '@stencil/core/internal/client';
|
2
|
-
import { VerdocsEndpoint, startSigningSession, envelopeRecipientAgree, envelopeRecipientDecline, updateEnvelopeField, createSignature, updateEnvelopeFieldSignature, createInitials, updateEnvelopeFieldInitials, isValidPhone, isValidEmail, envelopeRecipientSubmit, uploadEnvelopeFieldAttachment, deleteEnvelopeFieldAttachment, formatFullName, fullNameToInitials, integerSequence } from '@verdocs/js-sdk';
|
2
|
+
import { VerdocsEndpoint, startSigningSession, getKbaStep, envelopeRecipientAgree, envelopeRecipientDecline, updateEnvelopeField, createSignature, updateEnvelopeFieldSignature, createInitials, updateEnvelopeFieldInitials, isValidPhone, isValidEmail, envelopeRecipientSubmit, uploadEnvelopeFieldAttachment, deleteEnvelopeFieldAttachment, formatFullName, fullNameToInitials, integerSequence } from '@verdocs/js-sdk';
|
3
3
|
import { a as saveAttachment, u as updateDocumentFieldValue, r as renderDocumentField, g as getFieldId } from './utils.js';
|
4
4
|
import { c as createTemplateFieldStoreFromEnvelope } from './TemplateFieldStore.js';
|
5
5
|
import { V as VerdocsToast } from './Toast.js';
|
@@ -83,6 +83,11 @@ const VerdocsSign$1 = /*@__PURE__*/ proxyCustomElement(class VerdocsSign extends
|
|
83
83
|
console.log(`[SIGN] Loaded signing session`, envelope, recipient);
|
84
84
|
this.recipient = recipient;
|
85
85
|
this.envelope = envelope;
|
86
|
+
getKbaStep(this.endpoint, this.envelopeId, this.roleId)
|
87
|
+
.then(r => {
|
88
|
+
console.log('KBA Step', r);
|
89
|
+
})
|
90
|
+
.catch(e => console.log('Error getting KBA step', e));
|
86
91
|
if (this.agreed) {
|
87
92
|
this.nextButtonLabel = 'Next';
|
88
93
|
}
|
@@ -87,7 +87,11 @@ const VerdocsAuth = class {
|
|
87
87
|
.then(r => {
|
88
88
|
console.log('[AUTH] Profile creation result', r);
|
89
89
|
this.tempAuthEndpoint.setToken(r.access_token);
|
90
|
-
|
90
|
+
// We can't clearForms because we need email to stick around
|
91
|
+
this.password = '';
|
92
|
+
this.first_name = '';
|
93
|
+
this.last_name = '';
|
94
|
+
this.org_name = '';
|
91
95
|
this.displayMode = 'verify';
|
92
96
|
})
|
93
97
|
.catch(e => {
|
@@ -5,7 +5,7 @@ import './_commonjsHelpers-bdec4bbd.js';
|
|
5
5
|
import './Types-95d86a44.js';
|
6
6
|
import './index-0329eed3.js';
|
7
7
|
|
8
|
-
const verdocsContactPickerCss = "@-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-contact-picker{display:block;border:1px solid #ebebeb;background-color:#ffffff;font-family:\"Inter\", -apple-system, \"Segoe UI\", \"Roboto\", \"Helvetica Neue\", sans-serif;-webkit-box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1);box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1)}verdocs-contact-picker form{display:-ms-flexbox;display:flex;gap:14px;width:300px;padding:12px;display:flex;-ms-flex-direction:column;flex-direction:column;background-color:#f5f5fa}verdocs-contact-picker form .row{gap:8px;width:
|
8
|
+
const verdocsContactPickerCss = "@-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-contact-picker{display:block;border:1px solid #ebebeb;background-color:#ffffff;font-family:\"Inter\", -apple-system, \"Segoe UI\", \"Roboto\", \"Helvetica Neue\", sans-serif;-webkit-box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1);box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1)}verdocs-contact-picker form{display:-ms-flexbox;display:flex;gap:14px;width:300px;padding:12px;display:flex;-ms-flex-direction:column;flex-direction:column;background-color:#f5f5fa}verdocs-contact-picker form .row{gap:8px;width:276px;display:-ms-flexbox;display:flex;position:relative;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center}verdocs-contact-picker form .row.message{-ms-flex-direction:column;flex-direction:column;-ms-flex-align:start;align-items:flex-start}verdocs-contact-picker form .names-row{gap:8px;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker form .names-row>input{font-size:14px;width:110px}verdocs-contact-picker form .kba-row{gap:8px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker form .kba-row>input{font-size:14px;width:110px}verdocs-contact-picker form .kba-row verdocs-select-input{margin:0}verdocs-contact-picker form label{display:-ms-flexbox;display:flex;-ms-flex:0 0 50px;flex:0 0 50px;font-size:14px;font-weight:500;color:#5c6575}verdocs-contact-picker form .row.message label{-ms-flex:0;flex:0}verdocs-contact-picker form .row.message input{width:100%}verdocs-contact-picker form input{-ms-flex:1;flex:1;border:none;font-size:14px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-contact-picker form input:focus{outline:none}verdocs-contact-picker form .dropdown{left:0;right:0;top:49px;z-index:1000000;max-height:225px;overflow-y:scroll;position:absolute;background:#ffffff;-webkit-box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1);box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1)}verdocs-contact-picker form .dropdown .suggestion{display:-ms-flexbox;display:flex;padding:6px 12px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker form .dropdown .suggestion svg{width:32px;height:32px}verdocs-contact-picker form .dropdown .suggestion .avatar{width:32px;height:32px;-ms-flex:0 0 32px;flex:0 0 32px;margin-right:8px;border-radius:100%}verdocs-contact-picker form .dropdown .suggestion .details{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-contact-picker form .dropdown .suggestion .name{font-size:16px;font-weight:500;margin-bottom:3px;color:#092c4c}verdocs-contact-picker form .dropdown .suggestion .destination{font-size:14px;margin-bottom:3px;color:#33364b}verdocs-contact-picker form .dropdown .suggestion:hover{background:#eee;cursor:pointer}verdocs-contact-picker .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:6px;-moz-column-gap:6px;column-gap:6px;margin-top:16px;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker .buttons .flex-fill{-ms-flex:1;flex:1}verdocs-contact-picker ::-webkit-input-placeholder{color:#aaaaaa}verdocs-contact-picker ::-moz-placeholder{color:#aaaaaa}verdocs-contact-picker :-ms-input-placeholder{color:#aaaaaa}verdocs-contact-picker ::-ms-input-placeholder{color:#aaaaaa}verdocs-contact-picker ::placeholder{color:#aaaaaa}verdocs-contact-picker [data-lastpass-icon-root]{display:none !important}";
|
9
9
|
const VerdocsContactPickerStyle0 = verdocsContactPickerCss;
|
10
10
|
|
11
11
|
const messageIcon = '<svg focusable="false" viewBox="0 0 24 24"><path d="M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-2 12H6v-2h12v2zm0-3H6V9h12v2zm0-3H6V6h12v2z"></path></svg>';
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, F as Fragment } from './index-a68c7262.js';
|
2
|
-
import { VerdocsEndpoint, startSigningSession, envelopeRecipientAgree, envelopeRecipientDecline, updateEnvelopeField, createSignature, updateEnvelopeFieldSignature, createInitials, updateEnvelopeFieldInitials, isValidPhone, isValidEmail, envelopeRecipientSubmit, uploadEnvelopeFieldAttachment, deleteEnvelopeFieldAttachment, formatFullName, fullNameToInitials, integerSequence } from '@verdocs/js-sdk';
|
2
|
+
import { VerdocsEndpoint, startSigningSession, getKbaStep, envelopeRecipientAgree, envelopeRecipientDecline, updateEnvelopeField, createSignature, updateEnvelopeFieldSignature, createInitials, updateEnvelopeFieldInitials, isValidPhone, isValidEmail, envelopeRecipientSubmit, uploadEnvelopeFieldAttachment, deleteEnvelopeFieldAttachment, formatFullName, fullNameToInitials, integerSequence } from '@verdocs/js-sdk';
|
3
3
|
import { a as saveAttachment, u as updateDocumentFieldValue, r as renderDocumentField, g as getFieldId } from './utils-a79aa5dd.js';
|
4
4
|
import { a as createTemplateFieldStoreFromEnvelope } from './TemplateFieldStore-68bf6acd.js';
|
5
5
|
import { V as VerdocsToast } from './Toast-c4843828.js';
|
@@ -79,6 +79,11 @@ const VerdocsSign = class {
|
|
79
79
|
console.log(`[SIGN] Loaded signing session`, envelope, recipient);
|
80
80
|
this.recipient = recipient;
|
81
81
|
this.envelope = envelope;
|
82
|
+
getKbaStep(this.endpoint, this.envelopeId, this.roleId)
|
83
|
+
.then(r => {
|
84
|
+
console.log('KBA Step', r);
|
85
|
+
})
|
86
|
+
.catch(e => console.log('Error getting KBA step', e));
|
82
87
|
if (this.agreed) {
|
83
88
|
this.nextButtonLabel = 'Next';
|
84
89
|
}
|
@@ -1 +1 @@
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,t,s,r){function i(e){return e instanceof s?e:new s((function(t){t(e)}))}return new(s||(s=Promise))((function(s,o){function n(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r["throw"](e))}catch(e){o(e)}}function l(e){e.done?s(e.value):i(e.value).then(n,a)}l((r=r.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var s={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,n;return n={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(n[Symbol.iterator]=function(){return this}),n;function a(e){return function(t){return l([e,t])}}function l(a){if(r)throw new TypeError("Generator is already executing.");while(n&&(n=0,a[0]&&(s=0)),s)try{if(r=1,i&&(o=a[0]&2?i["return"]:a[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;if(i=0,o)a=[a[0]&2,o.value];switch(a[0]){case 0:case 1:o=a;break;case 4:s.label++;return{value:a[1],done:false};case 5:s.label++;i=a[1];a=[0];continue;case 7:a=s.ops.pop();s.trys.pop();continue;default:if(!(o=s.trys,o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){s=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){s.label=a[1];break}if(a[0]===6&&s.label<o[1]){s.label=o[1];o=a;break}if(o&&s.label<o[2]){s.label=o[2];s.ops.push(a);break}if(o[2])s.ops.pop();s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e];i=0}finally{r=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h}from"./index-a68c7262.js";import{VerdocsEndpoint,createProfile,verifyEmail,authenticate,getMyUser,resendVerification,resetPassword}from"@verdocs/js-sdk";import{V as VerdocsToast}from"./Toast-c4843828.js";import{S as SDKError}from"./errors-887f1e88.js";var verdocsAuthCss='@-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-auth{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center}verdocs-auth .form{width:320px;display:-ms-flexbox;display:flex;padding:20px;max-width:90%;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-pack:center;justify-content:center;background:#ffffff}verdocs-auth .logo{width:128px;max-width:100%;margin:20px 0 30px}verdocs-auth h3{text-align:center;font-weight:400;font-size:18px;line-height:1.75;margin:0}verdocs-auth em{font-size:14px;margin:15px 0}verdocs-auth .buttons{gap:20px;margin:20px 0 0 0;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:center;justify-content:center}verdocs-auth .status-result{display:none}verdocs-auth .status-result.debug{white-space:pre-wrap;font-size:14px;background:#fff;padding:10px;display:block;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:center;justify-content:center}verdocs-auth form{width:100%}verdocs-auth verdocs-text-input{margin-bottom:10px}verdocs-auth .account-option{gap:8px;margin:20px 0 8px 0;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}verdocs-auth p{margin:1em 0;font-size:14px}verdocs-auth p+p{margin-top:0}verdocs-auth verdocs-help-icon{margin-top:18px;display:-ms-flexbox;display:flex;width:32px;height:32px;-ms-flex:0 0 32px;flex:0 0 32px}verdocs-auth .already-have{margin:0.5em 0;font-size:14px}';var VerdocsAuthStyle0=verdocsAuthCss;var VerdocsAuth=function(){function e(e){registerInstance(this,e);this.authenticated=createEvent(this,"authenticated",7);this.sdkError=createEvent(this,"sdkError",7);this.resendDisabledTimer=null;this.tempAuthEndpoint=new VerdocsEndpoint({baseURL:VerdocsEndpoint.getDefault().getBaseURL(),persist:false});this.endpoint=VerdocsEndpoint.getDefault();this.visible=true;this.logo="https://app.verdocs.com/assets/blue-logo.svg";this.displayMode="login";this.org_name="";this.first_name="";this.last_name="";this.email="";this.verificationCode="";this.newPassword="";this.password="";this.confirmpass="";this.submitting=false;this.resendDisabled=false;this.session=null;this.profile=null}e.prototype.componentWillLoad=function(){var e=this;this.endpoint.loadSession();VerdocsEndpoint.getDefault().onSessionChanged((function(t,s,r){var i,o;e.session=s;e.profile=r;if(s){(i=e.authenticated)===null||i===void 0?void 0:i.emit({authenticated:true,session:s,profile:r})}else{(o=e.authenticated)===null||o===void 0?void 0:o.emit({authenticated:false,session:s,profile:r})}}))};e.prototype.isPasswordComplex=function(e){var t=function(e){return/[A-Z]/.test(e)};var s=function(e){return/[a-z]/.test(e)};var r=function(e){return/[`!@#$%^&*()_\-+=\[\]{};':"\\|,.<>\/?~ ]/.test(e)};var i=0,o=0,n=0;for(var a=0;a<e.length;a++){var l=e.charAt(a);if(t(l))i++;else if(s(l))o++;else if(r(l))n++}return e.length>=8&&o>0&&i>0&&n>0};e.prototype.handleSignup=function(){var e=this;if(!this.isPasswordComplex(this.password)){VerdocsToast("Password must be at least 8 characters long and contain at least one uppercase, one lowercase, and one special character.",{style:"error"});return}if(this.password!==this.confirmpass){VerdocsToast("Passwords do not match.",{style:"error"});return}this.submitting=true;this.tempAuthEndpoint.clearSession();createProfile(this.tempAuthEndpoint,{email:this.email,password:this.password,first_name:this.first_name,last_name:this.last_name,org_name:this.org_name}).then((function(t){console.log("[AUTH] Profile creation result",t);e.tempAuthEndpoint.setToken(t.access_token);e.clearForms();e.displayMode="verify"})).catch((function(t){var s,r,i,o,n,a;console.log("[AUTH] Signup error",t.response);e.submitting=false;(s=e.authenticated)===null||s===void 0?void 0:s.emit({authenticated:false,profile:null,session:null});(r=e.sdkError)===null||r===void 0?void 0:r.emit(new SDKError(t.message,(i=t.response)===null||i===void 0?void 0:i.status,(o=t.response)===null||o===void 0?void 0:o.data));VerdocsToast("Signup failed: "+((a=(n=t.response)===null||n===void 0?void 0:n.data)===null||a===void 0?void 0:a.error)||"Unknown Error",{style:"error"})}))};e.prototype.handleVerification=function(){return __awaiter(this,void 0,void 0,(function(){var e,t;return __generator(this,(function(s){switch(s.label){case 0:this.submitting=true;s.label=1;case 1:s.trys.push([1,3,,4]);this.submitting=false;return[4,verifyEmail(this.tempAuthEndpoint,{email:this.email,token:this.verificationCode})];case 2:e=s.sent();VerdocsToast("Thank you for verifying your email address.",{style:"success"});this.completeLogin(e);return[3,4];case 3:t=s.sent();this.submitting=false;console.log("Verification error",t);VerdocsToast("Verification error, please check the code and try again.");return[3,4];case 4:return[2]}}))}))};e.prototype.completeLogin=function(e){this.clearForms();this.tempAuthEndpoint.clearSession();this.endpoint.setToken(e.access_token)};e.prototype.loginAndCheckVerification=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,s,r;return __generator(this,(function(i){switch(i.label){case 0:if(this.submitting){return[2]}this.submitting=true;this.tempAuthEndpoint.clearSession();i.label=1;case 1:i.trys.push([1,4,,5]);this.submitting=false;return[4,authenticate(this.tempAuthEndpoint,{username:this.email,password:this.password,grant_type:"password"})];case 2:t=i.sent();console.log("[AUTH] Authenticated, checking email verification");this.tempAuthEndpoint.setToken(t.access_token);return[4,getMyUser(this.tempAuthEndpoint)];case 3:s=i.sent();console.log("Got user",s);if(!s.email_verified){console.log("[AUTH] Logged in, pending email address verification");this.displayMode="verify"}else{console.log("[AUTH] Email address is verified, completing login");this.completeLogin(t)}return[3,5];case 4:r=i.sent();this.submitting=false;console.log("[AUTH] Auth failure",((e=r.response)===null||e===void 0?void 0:e.data)||r);VerdocsToast("Login failed. Please check your credentials and try again.",{style:"error"});return[3,5];case 5:return[2]}}))}))};e.prototype.clearForms=function(){this.submitting=false;this.resendDisabled=false;this.email="";this.password="";this.newPassword="";this.confirmpass="";this.verificationCode="";this.first_name="";this.last_name="";this.org_name=""};e.prototype.handleLogout=function(){console.log("logging out");this.endpoint.clearSession();this.tempAuthEndpoint.clearSession();this.clearForms();this.displayMode="login"};e.prototype.handleResendVerification=function(){var e=this;this.resendDisabled=true;this.resendDisabledTimer=setTimeout((function(){e.resendDisabled=false;e.resendDisabledTimer=null}),3e4);resendVerification(this.tempAuthEndpoint).then((function(e){console.log("[AUTH] Verification request resent",e);VerdocsToast("Please check your email for a verification code.",{style:"info"})})).catch((function(e){console.log("[AUTH] Unable to resend verification",e);VerdocsToast("Unable to resend code. Please try again later.",{style:"error"})}))};e.prototype.handleResendReset=function(){var e=this;this.resendDisabled=true;this.resendDisabledTimer=setTimeout((function(){e.resendDisabled=false;e.resendDisabledTimer=null}),3e4);resetPassword(this.tempAuthEndpoint,{email:this.email}).then((function(e){console.log("[AUTH] Resend-code request resent",e);VerdocsToast("Please check your email again for a verification code.",{style:"info"})})).catch((function(e){console.log("[AUTH] Unable to resend reset request",e);VerdocsToast("Unable to resend code. Please try again later.",{style:"error"})}))};e.prototype.handleResetGetCode=function(){return __awaiter(this,void 0,void 0,(function(){var e,t;return __generator(this,(function(s){switch(s.label){case 0:this.submitting=true;this.confirmpass="";this.newPassword="";s.label=1;case 1:s.trys.push([1,3,,4]);this.submitting=false;return[4,resetPassword(this.endpoint,{email:this.email})];case 2:e=s.sent();console.log("[AUTH] Reset result",e);VerdocsToast("Please check your email inbox for a password reset code.",{style:"success"});this.verificationCode="";this.confirmpass="";this.newPassword="";this.displayMode="reset";return[3,4];case 3:t=s.sent();this.submitting=false;console.log("Reset request error",t);VerdocsToast("Request failed. Please check your email address and try again.");return[3,4];case 4:return[2]}}))}))};e.prototype.handleResetPassword=function(){return __awaiter(this,void 0,void 0,(function(){var e,t;return __generator(this,(function(s){switch(s.label){case 0:if(!this.isPasswordComplex(this.newPassword)){VerdocsToast("Password must be at least 8 characters long and contain at least one uppercase, one lowercase, and one special character.",{style:"error"});return[2]}if(this.newPassword!==this.confirmpass){VerdocsToast("Passwords do not match.",{style:"error"});return[2]}this.submitting=true;s.label=1;case 1:s.trys.push([1,3,,4]);this.submitting=false;return[4,resetPassword(this.endpoint,{email:this.email,code:this.verificationCode,new_password:this.newPassword})];case 2:e=s.sent();console.log("reset result",e);VerdocsToast("Your password has been reset. You may now use your new password to login.",{style:"success"});this.verificationCode="";this.confirmpass="";this.newPassword="";this.password="";this.displayMode="login";return[3,4];case 3:t=s.sent();this.submitting=false;console.log("Verification error",t);VerdocsToast("Verification error, please check the code and try again.");return[3,4];case 4:return[2]}}))}))};e.prototype.handleReset=function(){return __awaiter(this,void 0,void 0,(function(){var e,t;return __generator(this,(function(s){switch(s.label){case 0:this.submitting=true;s.label=1;case 1:s.trys.push([1,3,,4]);return[4,resetPassword(this.endpoint,{email:this.email})];case 2:e=s.sent();console.log("[AUTH] Reset sent",e);this.submitting=false;this.displayMode="login";VerdocsToast("If your email address is registered, you will receive instructions on resetting your password shortly.",{style:"info"});return[3,4];case 3:t=s.sent();console.log("[AUTH] Unable to reset password",t);this.submitting=false;VerdocsToast("Unable to reset password. Please check your email address and try again.",{style:"error"});return[3,4];case 4:return[2]}}))}))};e.prototype.render=function(){var e=this;if(!this.visible){return h("div",{style:{display:"none"}},"Authenticated")}if(this.session){return h("verdocs-button",{label:"Sign Out",disabled:this.submitting,onClick:function(){return e.handleLogout()},style:{display:"flex",justifyContent:"center",margin:"30px auto 0"}})}if(this.displayMode==="signup"){var t=this.submitting||!this.first_name||!this.last_name||!this.email||!this.password||!this.confirmpass||!this.org_name;return h("div",{class:"form"},h("a",{href:"https://verdocs.com/en/"},h("img",{src:this.logo,alt:"Verdocs Logo",class:"logo"})),h("h3",null,"Sign up for a free account"),h("div",{class:"already-have"},"Already have an account?",h("verdocs-button",{label:"Log In",variant:"text",onClick:function(){return e.displayMode="login"},disabled:this.submitting})),h("form",{onSubmit:function(){return e.handleSignup()}},h("div",{style:{display:"flex",flexDirection:"row",columnGap:"20px"}},h("verdocs-text-input",{label:"First Name",autocomplete:"first",required:true,value:this.first_name,onInput:function(t){return e.first_name=t.target.value},disabled:this.submitting}),h("verdocs-text-input",{label:"Last Name",autocomplete:"last",required:true,value:this.last_name,onInput:function(t){return e.last_name=t.target.value},disabled:this.submitting})),h("verdocs-text-input",{label:"Email Address",autocomplete:"email",required:true,value:this.email,onInput:function(t){return e.email=t.target.value},disabled:this.submitting}),h("verdocs-text-input",{label:"Password",type:"password",required:true,autocomplete:"new-password",value:this.password,onInput:function(t){return e.password=t.target.value},disabled:this.submitting}),h("verdocs-text-input",{label:"Confirm Password",type:"password",required:true,autocomplete:"off",value:this.confirmpass,onInput:function(t){return e.confirmpass=t.target.value},disabled:this.submitting}),h("verdocs-text-input",{label:"Organization Name",autocomplete:"org",required:true,value:this.org_name,onInput:function(t){return e.org_name=t.target.value},disabled:this.submitting,style:{flex:"1"}}),h("div",{style:{marginTop:"30px"}}),h("verdocs-button",{label:"Next",disabled:t,onClick:t?function(){}:function(){return e.handleSignup()},style:{display:"flex",justifyContent:"center",margin:"30px auto 0"}})))}if(this.displayMode==="verify"){return h("div",{class:"form"},h("form",{onSubmit:function(){return e.handleVerification()}},h("p",null,"Please check your e-mail inbox for a verification code and enter it below."),h("verdocs-text-input",{label:"Verification Code",required:true,value:this.verificationCode,onInput:function(t){return e.verificationCode=t.target.value},disabled:this.submitting}),h("div",{class:"buttons"},h("verdocs-button",{label:"Sign Out",variant:"outline",disabled:this.submitting,onClick:function(){return e.handleLogout()}}),h("verdocs-button",{label:"Verify",disabled:this.submitting||!this.verificationCode||this.verificationCode.length!==6,onClick:function(){return e.handleVerification()}})),h("div",{class:"buttons"},h("verdocs-button",{variant:"text",label:"Resend Code",disabled:this.resendDisabled||this.submitting,onClick:function(){return e.handleResendVerification()}}))))}if(this.displayMode==="forgot"){return h("div",{class:"form"},h("a",{href:"https://verdocs.com/en/"},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. If the e-mail address is valid, a password reset code will be sent to your inbox. Please allow up to 15 minutes to arrive, and check your spam folder if you do not receive the message."),h("form",{onSubmit:function(){return e.handleResetGetCode()}},h("verdocs-text-input",{label:"Email Address",autocomplete:"email",required:true,value:this.email,onInput:function(t){return e.email=t.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:function(){return e.displayMode="login"}}),h("verdocs-button",{label:"Request Code",disabled:this.submitting,onClick:function(){return e.handleResetGetCode()}}))))}if(this.displayMode==="reset"){return h("div",{class:"form"},h("a",{href:"https://verdocs.com/en/"},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. Please allow up to 15 minutes to arrive. Check your spam folder if you do not receive the message."),h("form",{onSubmit:function(){return e.handleResetPassword()}},h("verdocs-text-input",{label:"Verification Code",required:true,value:this.verificationCode,onInput:function(t){return e.verificationCode=t.target.value},disabled:this.submitting}),h("verdocs-text-input",{label:"Password",type:"password",required:true,autocomplete:"off",value:this.newPassword,onInput:function(t){return e.newPassword=t.target.value},disabled:this.submitting}),h("verdocs-text-input",{label:"Confirm Password",type:"password",required:true,autocomplete:"off",value:this.confirmpass,onInput:function(t){return e.confirmpass=t.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:function(){return e.displayMode="login"}}),h("verdocs-button",{label:"Reset",disabled:this.submitting,onClick:function(){return e.handleResetPassword()}})),h("div",{class:"buttons"},h("verdocs-button",{variant:"text",label:"Resend Code",disabled:this.resendDisabled||this.submitting,onClick:function(){return e.handleResendReset()}}))))}return h("div",{class:"form"},h("a",{href:"https://verdocs.com/en/"},h("img",{src:this.logo,alt:"Verdocs Logo",class:"logo"})),h("h3",null,"Log in to your account"),h("div",{class:"already-have"},"Don't have an account?",h("verdocs-button",{label:"Sign Up",variant:"text",onClick:function(){return e.displayMode="signup"},disabled:this.submitting})),h("form",{onSubmit:function(){return e.loginAndCheckVerification()}},h("verdocs-text-input",{label:"Email",autocomplete:"username",value:this.email,onInput:function(t){return e.email=t.target.value},disabled:this.submitting}),h("verdocs-text-input",{label:"Password",type:"password",autocomplete:"current-password",value:this.password,onInput:function(t){return e.password=t.target.value},disabled:this.submitting}),h("verdocs-button",{label:"Forgot Your Password?",variant:"text",onClick:function(){return e.displayMode="forgot"},disabled:this.submitting,style:{display:"flex",justifyContent:"center",margin:"10px auto 20px"}}),h("verdocs-button",{label:"Login",disabled:this.submitting,onClick:function(){return e.loginAndCheckVerification()},style:{display:"flex",justifyContent:"center",margin:"10px auto 0"}})))};return e}();VerdocsAuth.style=VerdocsAuthStyle0;export{VerdocsAuth as verdocs_auth};
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,t,s,r){function i(e){return e instanceof s?e:new s((function(t){t(e)}))}return new(s||(s=Promise))((function(s,o){function n(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r["throw"](e))}catch(e){o(e)}}function l(e){e.done?s(e.value):i(e.value).then(n,a)}l((r=r.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var s={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,n;return n={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(n[Symbol.iterator]=function(){return this}),n;function a(e){return function(t){return l([e,t])}}function l(a){if(r)throw new TypeError("Generator is already executing.");while(n&&(n=0,a[0]&&(s=0)),s)try{if(r=1,i&&(o=a[0]&2?i["return"]:a[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;if(i=0,o)a=[a[0]&2,o.value];switch(a[0]){case 0:case 1:o=a;break;case 4:s.label++;return{value:a[1],done:false};case 5:s.label++;i=a[1];a=[0];continue;case 7:a=s.ops.pop();s.trys.pop();continue;default:if(!(o=s.trys,o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){s=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){s.label=a[1];break}if(a[0]===6&&s.label<o[1]){s.label=o[1];o=a;break}if(o&&s.label<o[2]){s.label=o[2];s.ops.push(a);break}if(o[2])s.ops.pop();s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e];i=0}finally{r=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h}from"./index-a68c7262.js";import{VerdocsEndpoint,createProfile,verifyEmail,authenticate,getMyUser,resendVerification,resetPassword}from"@verdocs/js-sdk";import{V as VerdocsToast}from"./Toast-c4843828.js";import{S as SDKError}from"./errors-887f1e88.js";var verdocsAuthCss='@-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-auth{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center}verdocs-auth .form{width:320px;display:-ms-flexbox;display:flex;padding:20px;max-width:90%;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-pack:center;justify-content:center;background:#ffffff}verdocs-auth .logo{width:128px;max-width:100%;margin:20px 0 30px}verdocs-auth h3{text-align:center;font-weight:400;font-size:18px;line-height:1.75;margin:0}verdocs-auth em{font-size:14px;margin:15px 0}verdocs-auth .buttons{gap:20px;margin:20px 0 0 0;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:center;justify-content:center}verdocs-auth .status-result{display:none}verdocs-auth .status-result.debug{white-space:pre-wrap;font-size:14px;background:#fff;padding:10px;display:block;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:center;justify-content:center}verdocs-auth form{width:100%}verdocs-auth verdocs-text-input{margin-bottom:10px}verdocs-auth .account-option{gap:8px;margin:20px 0 8px 0;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}verdocs-auth p{margin:1em 0;font-size:14px}verdocs-auth p+p{margin-top:0}verdocs-auth verdocs-help-icon{margin-top:18px;display:-ms-flexbox;display:flex;width:32px;height:32px;-ms-flex:0 0 32px;flex:0 0 32px}verdocs-auth .already-have{margin:0.5em 0;font-size:14px}';var VerdocsAuthStyle0=verdocsAuthCss;var VerdocsAuth=function(){function e(e){registerInstance(this,e);this.authenticated=createEvent(this,"authenticated",7);this.sdkError=createEvent(this,"sdkError",7);this.resendDisabledTimer=null;this.tempAuthEndpoint=new VerdocsEndpoint({baseURL:VerdocsEndpoint.getDefault().getBaseURL(),persist:false});this.endpoint=VerdocsEndpoint.getDefault();this.visible=true;this.logo="https://app.verdocs.com/assets/blue-logo.svg";this.displayMode="login";this.org_name="";this.first_name="";this.last_name="";this.email="";this.verificationCode="";this.newPassword="";this.password="";this.confirmpass="";this.submitting=false;this.resendDisabled=false;this.session=null;this.profile=null}e.prototype.componentWillLoad=function(){var e=this;this.endpoint.loadSession();VerdocsEndpoint.getDefault().onSessionChanged((function(t,s,r){var i,o;e.session=s;e.profile=r;if(s){(i=e.authenticated)===null||i===void 0?void 0:i.emit({authenticated:true,session:s,profile:r})}else{(o=e.authenticated)===null||o===void 0?void 0:o.emit({authenticated:false,session:s,profile:r})}}))};e.prototype.isPasswordComplex=function(e){var t=function(e){return/[A-Z]/.test(e)};var s=function(e){return/[a-z]/.test(e)};var r=function(e){return/[`!@#$%^&*()_\-+=\[\]{};':"\\|,.<>\/?~ ]/.test(e)};var i=0,o=0,n=0;for(var a=0;a<e.length;a++){var l=e.charAt(a);if(t(l))i++;else if(s(l))o++;else if(r(l))n++}return e.length>=8&&o>0&&i>0&&n>0};e.prototype.handleSignup=function(){var e=this;if(!this.isPasswordComplex(this.password)){VerdocsToast("Password must be at least 8 characters long and contain at least one uppercase, one lowercase, and one special character.",{style:"error"});return}if(this.password!==this.confirmpass){VerdocsToast("Passwords do not match.",{style:"error"});return}this.submitting=true;this.tempAuthEndpoint.clearSession();createProfile(this.tempAuthEndpoint,{email:this.email,password:this.password,first_name:this.first_name,last_name:this.last_name,org_name:this.org_name}).then((function(t){console.log("[AUTH] Profile creation result",t);e.tempAuthEndpoint.setToken(t.access_token);e.password="";e.first_name="";e.last_name="";e.org_name="";e.displayMode="verify"})).catch((function(t){var s,r,i,o,n,a;console.log("[AUTH] Signup error",t.response);e.submitting=false;(s=e.authenticated)===null||s===void 0?void 0:s.emit({authenticated:false,profile:null,session:null});(r=e.sdkError)===null||r===void 0?void 0:r.emit(new SDKError(t.message,(i=t.response)===null||i===void 0?void 0:i.status,(o=t.response)===null||o===void 0?void 0:o.data));VerdocsToast("Signup failed: "+((a=(n=t.response)===null||n===void 0?void 0:n.data)===null||a===void 0?void 0:a.error)||"Unknown Error",{style:"error"})}))};e.prototype.handleVerification=function(){return __awaiter(this,void 0,void 0,(function(){var e,t;return __generator(this,(function(s){switch(s.label){case 0:this.submitting=true;s.label=1;case 1:s.trys.push([1,3,,4]);this.submitting=false;return[4,verifyEmail(this.tempAuthEndpoint,{email:this.email,token:this.verificationCode})];case 2:e=s.sent();VerdocsToast("Thank you for verifying your email address.",{style:"success"});this.completeLogin(e);return[3,4];case 3:t=s.sent();this.submitting=false;console.log("Verification error",t);VerdocsToast("Verification error, please check the code and try again.");return[3,4];case 4:return[2]}}))}))};e.prototype.completeLogin=function(e){this.clearForms();this.tempAuthEndpoint.clearSession();this.endpoint.setToken(e.access_token)};e.prototype.loginAndCheckVerification=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,s,r;return __generator(this,(function(i){switch(i.label){case 0:if(this.submitting){return[2]}this.submitting=true;this.tempAuthEndpoint.clearSession();i.label=1;case 1:i.trys.push([1,4,,5]);this.submitting=false;return[4,authenticate(this.tempAuthEndpoint,{username:this.email,password:this.password,grant_type:"password"})];case 2:t=i.sent();console.log("[AUTH] Authenticated, checking email verification");this.tempAuthEndpoint.setToken(t.access_token);return[4,getMyUser(this.tempAuthEndpoint)];case 3:s=i.sent();console.log("Got user",s);if(!s.email_verified){console.log("[AUTH] Logged in, pending email address verification");this.displayMode="verify"}else{console.log("[AUTH] Email address is verified, completing login");this.completeLogin(t)}return[3,5];case 4:r=i.sent();this.submitting=false;console.log("[AUTH] Auth failure",((e=r.response)===null||e===void 0?void 0:e.data)||r);VerdocsToast("Login failed. Please check your credentials and try again.",{style:"error"});return[3,5];case 5:return[2]}}))}))};e.prototype.clearForms=function(){this.submitting=false;this.resendDisabled=false;this.email="";this.password="";this.newPassword="";this.confirmpass="";this.verificationCode="";this.first_name="";this.last_name="";this.org_name=""};e.prototype.handleLogout=function(){console.log("logging out");this.endpoint.clearSession();this.tempAuthEndpoint.clearSession();this.clearForms();this.displayMode="login"};e.prototype.handleResendVerification=function(){var e=this;this.resendDisabled=true;this.resendDisabledTimer=setTimeout((function(){e.resendDisabled=false;e.resendDisabledTimer=null}),3e4);resendVerification(this.tempAuthEndpoint).then((function(e){console.log("[AUTH] Verification request resent",e);VerdocsToast("Please check your email for a verification code.",{style:"info"})})).catch((function(e){console.log("[AUTH] Unable to resend verification",e);VerdocsToast("Unable to resend code. Please try again later.",{style:"error"})}))};e.prototype.handleResendReset=function(){var e=this;this.resendDisabled=true;this.resendDisabledTimer=setTimeout((function(){e.resendDisabled=false;e.resendDisabledTimer=null}),3e4);resetPassword(this.tempAuthEndpoint,{email:this.email}).then((function(e){console.log("[AUTH] Resend-code request resent",e);VerdocsToast("Please check your email again for a verification code.",{style:"info"})})).catch((function(e){console.log("[AUTH] Unable to resend reset request",e);VerdocsToast("Unable to resend code. Please try again later.",{style:"error"})}))};e.prototype.handleResetGetCode=function(){return __awaiter(this,void 0,void 0,(function(){var e,t;return __generator(this,(function(s){switch(s.label){case 0:this.submitting=true;this.confirmpass="";this.newPassword="";s.label=1;case 1:s.trys.push([1,3,,4]);this.submitting=false;return[4,resetPassword(this.endpoint,{email:this.email})];case 2:e=s.sent();console.log("[AUTH] Reset result",e);VerdocsToast("Please check your email inbox for a password reset code.",{style:"success"});this.verificationCode="";this.confirmpass="";this.newPassword="";this.displayMode="reset";return[3,4];case 3:t=s.sent();this.submitting=false;console.log("Reset request error",t);VerdocsToast("Request failed. Please check your email address and try again.");return[3,4];case 4:return[2]}}))}))};e.prototype.handleResetPassword=function(){return __awaiter(this,void 0,void 0,(function(){var e,t;return __generator(this,(function(s){switch(s.label){case 0:if(!this.isPasswordComplex(this.newPassword)){VerdocsToast("Password must be at least 8 characters long and contain at least one uppercase, one lowercase, and one special character.",{style:"error"});return[2]}if(this.newPassword!==this.confirmpass){VerdocsToast("Passwords do not match.",{style:"error"});return[2]}this.submitting=true;s.label=1;case 1:s.trys.push([1,3,,4]);this.submitting=false;return[4,resetPassword(this.endpoint,{email:this.email,code:this.verificationCode,new_password:this.newPassword})];case 2:e=s.sent();console.log("reset result",e);VerdocsToast("Your password has been reset. You may now use your new password to login.",{style:"success"});this.verificationCode="";this.confirmpass="";this.newPassword="";this.password="";this.displayMode="login";return[3,4];case 3:t=s.sent();this.submitting=false;console.log("Verification error",t);VerdocsToast("Verification error, please check the code and try again.");return[3,4];case 4:return[2]}}))}))};e.prototype.handleReset=function(){return __awaiter(this,void 0,void 0,(function(){var e,t;return __generator(this,(function(s){switch(s.label){case 0:this.submitting=true;s.label=1;case 1:s.trys.push([1,3,,4]);return[4,resetPassword(this.endpoint,{email:this.email})];case 2:e=s.sent();console.log("[AUTH] Reset sent",e);this.submitting=false;this.displayMode="login";VerdocsToast("If your email address is registered, you will receive instructions on resetting your password shortly.",{style:"info"});return[3,4];case 3:t=s.sent();console.log("[AUTH] Unable to reset password",t);this.submitting=false;VerdocsToast("Unable to reset password. Please check your email address and try again.",{style:"error"});return[3,4];case 4:return[2]}}))}))};e.prototype.render=function(){var e=this;if(!this.visible){return h("div",{style:{display:"none"}},"Authenticated")}if(this.session){return h("verdocs-button",{label:"Sign Out",disabled:this.submitting,onClick:function(){return e.handleLogout()},style:{display:"flex",justifyContent:"center",margin:"30px auto 0"}})}if(this.displayMode==="signup"){var t=this.submitting||!this.first_name||!this.last_name||!this.email||!this.password||!this.confirmpass||!this.org_name;return h("div",{class:"form"},h("a",{href:"https://verdocs.com/en/"},h("img",{src:this.logo,alt:"Verdocs Logo",class:"logo"})),h("h3",null,"Sign up for a free account"),h("div",{class:"already-have"},"Already have an account?",h("verdocs-button",{label:"Log In",variant:"text",onClick:function(){return e.displayMode="login"},disabled:this.submitting})),h("form",{onSubmit:function(){return e.handleSignup()}},h("div",{style:{display:"flex",flexDirection:"row",columnGap:"20px"}},h("verdocs-text-input",{label:"First Name",autocomplete:"first",required:true,value:this.first_name,onInput:function(t){return e.first_name=t.target.value},disabled:this.submitting}),h("verdocs-text-input",{label:"Last Name",autocomplete:"last",required:true,value:this.last_name,onInput:function(t){return e.last_name=t.target.value},disabled:this.submitting})),h("verdocs-text-input",{label:"Email Address",autocomplete:"email",required:true,value:this.email,onInput:function(t){return e.email=t.target.value},disabled:this.submitting}),h("verdocs-text-input",{label:"Password",type:"password",required:true,autocomplete:"new-password",value:this.password,onInput:function(t){return e.password=t.target.value},disabled:this.submitting}),h("verdocs-text-input",{label:"Confirm Password",type:"password",required:true,autocomplete:"off",value:this.confirmpass,onInput:function(t){return e.confirmpass=t.target.value},disabled:this.submitting}),h("verdocs-text-input",{label:"Organization Name",autocomplete:"org",required:true,value:this.org_name,onInput:function(t){return e.org_name=t.target.value},disabled:this.submitting,style:{flex:"1"}}),h("div",{style:{marginTop:"30px"}}),h("verdocs-button",{label:"Next",disabled:t,onClick:t?function(){}:function(){return e.handleSignup()},style:{display:"flex",justifyContent:"center",margin:"30px auto 0"}})))}if(this.displayMode==="verify"){return h("div",{class:"form"},h("form",{onSubmit:function(){return e.handleVerification()}},h("p",null,"Please check your e-mail inbox for a verification code and enter it below."),h("verdocs-text-input",{label:"Verification Code",required:true,value:this.verificationCode,onInput:function(t){return e.verificationCode=t.target.value},disabled:this.submitting}),h("div",{class:"buttons"},h("verdocs-button",{label:"Sign Out",variant:"outline",disabled:this.submitting,onClick:function(){return e.handleLogout()}}),h("verdocs-button",{label:"Verify",disabled:this.submitting||!this.verificationCode||this.verificationCode.length!==6,onClick:function(){return e.handleVerification()}})),h("div",{class:"buttons"},h("verdocs-button",{variant:"text",label:"Resend Code",disabled:this.resendDisabled||this.submitting,onClick:function(){return e.handleResendVerification()}}))))}if(this.displayMode==="forgot"){return h("div",{class:"form"},h("a",{href:"https://verdocs.com/en/"},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. If the e-mail address is valid, a password reset code will be sent to your inbox. Please allow up to 15 minutes to arrive, and check your spam folder if you do not receive the message."),h("form",{onSubmit:function(){return e.handleResetGetCode()}},h("verdocs-text-input",{label:"Email Address",autocomplete:"email",required:true,value:this.email,onInput:function(t){return e.email=t.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:function(){return e.displayMode="login"}}),h("verdocs-button",{label:"Request Code",disabled:this.submitting,onClick:function(){return e.handleResetGetCode()}}))))}if(this.displayMode==="reset"){return h("div",{class:"form"},h("a",{href:"https://verdocs.com/en/"},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. Please allow up to 15 minutes to arrive. Check your spam folder if you do not receive the message."),h("form",{onSubmit:function(){return e.handleResetPassword()}},h("verdocs-text-input",{label:"Verification Code",required:true,value:this.verificationCode,onInput:function(t){return e.verificationCode=t.target.value},disabled:this.submitting}),h("verdocs-text-input",{label:"Password",type:"password",required:true,autocomplete:"off",value:this.newPassword,onInput:function(t){return e.newPassword=t.target.value},disabled:this.submitting}),h("verdocs-text-input",{label:"Confirm Password",type:"password",required:true,autocomplete:"off",value:this.confirmpass,onInput:function(t){return e.confirmpass=t.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:function(){return e.displayMode="login"}}),h("verdocs-button",{label:"Reset",disabled:this.submitting,onClick:function(){return e.handleResetPassword()}})),h("div",{class:"buttons"},h("verdocs-button",{variant:"text",label:"Resend Code",disabled:this.resendDisabled||this.submitting,onClick:function(){return e.handleResendReset()}}))))}return h("div",{class:"form"},h("a",{href:"https://verdocs.com/en/"},h("img",{src:this.logo,alt:"Verdocs Logo",class:"logo"})),h("h3",null,"Log in to your account"),h("div",{class:"already-have"},"Don't have an account?",h("verdocs-button",{label:"Sign Up",variant:"text",onClick:function(){return e.displayMode="signup"},disabled:this.submitting})),h("form",{onSubmit:function(){return e.loginAndCheckVerification()}},h("verdocs-text-input",{label:"Email",autocomplete:"username",value:this.email,onInput:function(t){return e.email=t.target.value},disabled:this.submitting}),h("verdocs-text-input",{label:"Password",type:"password",autocomplete:"current-password",value:this.password,onInput:function(t){return e.password=t.target.value},disabled:this.submitting}),h("verdocs-button",{label:"Forgot Your Password?",variant:"text",onClick:function(){return e.displayMode="forgot"},disabled:this.submitting,style:{display:"flex",justifyContent:"center",margin:"10px auto 20px"}}),h("verdocs-button",{label:"Login",disabled:this.submitting,onClick:function(){return e.loginAndCheckVerification()},style:{display:"flex",justifyContent:"center",margin:"10px auto 0"}})))};return e}();VerdocsAuth.style=VerdocsAuthStyle0;export{VerdocsAuth as verdocs_auth};
|
@@ -1 +1 @@
|
|
1
|
-
import{r as registerInstance,c as createEvent,h,F as Fragment,H as Host}from"./index-a68c7262.js";import{VerdocsEndpoint,formatFullName}from"@verdocs/js-sdk";import{f as convertToE164}from"./utils-a79aa5dd.js";import"./_commonjsHelpers-bdec4bbd.js";import"./Types-95d86a44.js";import"./index-0329eed3.js";var verdocsContactPickerCss='@-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-contact-picker{display:block;border:1px solid #ebebeb;background-color:#ffffff;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;-webkit-box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1);box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1)}verdocs-contact-picker form{display:-ms-flexbox;display:flex;gap:14px;width:300px;padding:12px;display:flex;-ms-flex-direction:column;flex-direction:column;background-color:#f5f5fa}verdocs-contact-picker form .row{gap:8px;width:300px;display:-ms-flexbox;display:flex;position:relative;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center}verdocs-contact-picker form .row.message{-ms-flex-direction:column;flex-direction:column;-ms-flex-align:start;align-items:flex-start}verdocs-contact-picker form .names-row{gap:8px;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker form .names-row>input{width:110px}verdocs-contact-picker form .kba-row{gap:8px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker form .kba-row>input{width:110px}verdocs-contact-picker form .kba-row verdocs-select-input{margin:0}verdocs-contact-picker form label{display:-ms-flexbox;display:flex;-ms-flex:0 0 50px;flex:0 0 50px;font-size:14px;font-weight:500;color:#5c6575}verdocs-contact-picker form .row.message label{-ms-flex:0;flex:0}verdocs-contact-picker form .row.message input{width:100%}verdocs-contact-picker form input{-ms-flex:1;flex:1;border:none;font-size:16px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-contact-picker form input:focus{outline:none}verdocs-contact-picker form .dropdown{left:0;right:0;top:49px;z-index:1000000;max-height:225px;overflow-y:scroll;position:absolute;background:#ffffff;-webkit-box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1);box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1)}verdocs-contact-picker form .dropdown .suggestion{display:-ms-flexbox;display:flex;padding:6px 12px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker form .dropdown .suggestion svg{width:32px;height:32px}verdocs-contact-picker form .dropdown .suggestion .avatar{width:32px;height:32px;-ms-flex:0 0 32px;flex:0 0 32px;margin-right:8px;border-radius:100%}verdocs-contact-picker form .dropdown .suggestion .details{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-contact-picker form .dropdown .suggestion .name{font-size:16px;font-weight:500;margin-bottom:3px;color:#092c4c}verdocs-contact-picker form .dropdown .suggestion .destination{font-size:14px;margin-bottom:3px;color:#33364b}verdocs-contact-picker form .dropdown .suggestion:hover{background:#eee;cursor:pointer}verdocs-contact-picker .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:6px;-moz-column-gap:6px;column-gap:6px;margin-top:16px;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker .buttons .flex-fill{-ms-flex:1;flex:1}verdocs-contact-picker ::-webkit-input-placeholder{color:#aaaaaa}verdocs-contact-picker ::-moz-placeholder{color:#aaaaaa}verdocs-contact-picker :-ms-input-placeholder{color:#aaaaaa}verdocs-contact-picker ::-ms-input-placeholder{color:#aaaaaa}verdocs-contact-picker ::placeholder{color:#aaaaaa}verdocs-contact-picker [data-lastpass-icon-root]{display:none !important}';var VerdocsContactPickerStyle0=verdocsContactPickerCss;var messageIcon='<svg focusable="false" viewBox="0 0 24 24"><path d="M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-2 12H6v-2h12v2zm0-3H6V9h12v2zm0-3H6V6h12v2z"></path></svg>';var kbaIcon='<svg focusable="false" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M4.5 3.75a3 3 0 0 0-3 3v10.5a3 3 0 0 0 3 3h15a3 3 0 0 0 3-3V6.75a3 3 0 0 0-3-3h-15Zm4.125 3a2.25 2.25 0 1 0 0 4.5 2.25 2.25 0 0 0 0-4.5Zm-3.873 8.703a4.126 4.126 0 0 1 7.746 0 .75.75 0 0 1-.351.92 7.47 7.47 0 0 1-3.522.877 7.47 7.47 0 0 1-3.522-.877.75.75 0 0 1-.351-.92ZM15 8.25a.75.75 0 0 0 0 1.5h3.75a.75.75 0 0 0 0-1.5H15ZM14.25 12a.75.75 0 0 1 .75-.75h3.75a.75.75 0 0 1 0 1.5H15a.75.75 0 0 1-.75-.75Zm.75 2.25a.75.75 0 0 0 0 1.5h3.75a.75.75 0 0 0 0-1.5H15Z" clip-rule="evenodd" /></svg>';var addrBookIcon='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-book-user"><path d="M15 13a3 3 0 1 0-6 0"/><path d="M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20"/><circle cx="12" cy="8" r="2"/></svg>';var VerdocsContactPicker=function(){function e(e){registerInstance(this,e);this.searchContacts=createEvent(this,"searchContacts",7);this.exit=createEvent(this,"exit",7);this.next=createEvent(this,"next",7);this.endpoint=VerdocsEndpoint.getDefault();this.templateRole=null;this.contactSuggestions=[];this.first_name=undefined;this.last_name=undefined;this.email=undefined;this.phone=undefined;this.message=undefined;this.showSuggestions=false;this.showMessage=false;this.delegator=false;this.showKba=false;this.kbaMethod="";this.pinCode="";this.nameFieldId="verdocs-contact-picker-name-".concat(Math.random().toString(36).substring(2,11));this.firstNameFieldId="verdocs-contact-picker-firstname-".concat(Math.random().toString(36).substring(2,11));this.lastNameFieldId="verdocs-contact-picker-lastname-".concat(Math.random().toString(36).substring(2,11));this.emailFieldId="verdocs-contact-picker-email-".concat(Math.random().toString(36).substring(2,11));this.phoneFieldId="verdocs-contact-picker-phone-".concat(Math.random().toString(36).substring(2,11))}e.prototype.componentWillLoad=function(){if(this.templateRole){var e=formatFullName(this.templateRole);var t=e.split(" ");var o=this.templateRole.first_name||t.shift()||"";var a=this.templateRole.last_name||t.join(" ")||"";this.first_name=o;this.last_name=a;this.email=this.templateRole.email||"";this.phone=this.templateRole.phone||"";this.delegator=this.templateRole.delegator||false;this.message=this.templateRole.message||"";this.showMessage=this.message!=="";this.kbaMethod=this.templateRole.kba_method||"";this.showKba=!!this.kbaMethod;this.pinCode=""}};e.prototype.handleFirstNameChange=function(e){var t;this.first_name=e.target.value;(t=this.searchContacts)===null||t===void 0?void 0:t.emit({query:this.first_name})};e.prototype.handleLastNameChange=function(e){var t;this.last_name=e.target.value;(t=this.searchContacts)===null||t===void 0?void 0:t.emit({query:this.last_name})};e.prototype.handleCancel=function(e){var t;e.stopPropagation();this.showSuggestions=false;(t=this.exit)===null||t===void 0?void 0:t.emit()};e.prototype.handleSubmit=function(e){var t;e.stopPropagation();this.showSuggestions=false;(t=this.next)===null||t===void 0?void 0:t.emit({first_name:this.first_name,last_name:this.last_name,email:this.email,phone:this.phone,message:this.message,delegator:this.delegator})};e.prototype.handleSelectSuggestion=function(e,t){e.stopPropagation();this.first_name=t.first_name;this.last_name=t.last_name;this.email=t.email;this.phone=t.phone;this.showSuggestions=false};e.prototype.render=function(){var e=this;return h("form",{key:"8c7cb46336302d309187ca68d7e38ebb3d001468",onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},h("div",{key:"8bc7c876bb89ee84dc14978560c6198d31983261",class:"row"},h("label",{key:"b57ac6d694661a48397afc6ab37fbf5cbca8cbc6",htmlFor:this.nameFieldId},"Name:"),h("div",{key:"197fbb1e998f52d0df3fe9040fd5d9d640b0237a",class:"names-row"},h("input",{key:"343aa3e3c8bb31edfc43c4bd51bed1928ea29d49",id:this.firstNameFieldId,name:this.firstNameFieldId,type:"text","data-lpignore":"true",autocomplete:"blocked",value:this.first_name,placeholder:"First...",onFocus:function(){var t;return e.showSuggestions=((t=e.contactSuggestions)===null||t===void 0?void 0:t.length)>0},onInput:function(t){return e.handleFirstNameChange(t)}}),h("input",{key:"78e830e80650f52d72e5c35523fa111df228c86b",id:this.lastNameFieldId,name:this.lastNameFieldId,type:"text","data-lpignore":"true",autocomplete:"blocked",value:this.last_name,placeholder:"Last...",onFocus:function(){return e.showSuggestions=false},onInput:function(t){return e.handleLastNameChange(t)}})),this.showSuggestions&&h("div",{key:"9b35e34eba14d6ff17c29b7bb334e5a5d8080595",class:"dropdown"},this.contactSuggestions.filter((function(t){return!e.first_name||t.first_name.toLowerCase().includes(e.first_name.toLowerCase())})).map((function(t){var o;return h("div",{key:(o=t.id)!==null&&o!==void 0?o:t.email,class:"suggestion",onClick:function(o){return e.handleSelectSuggestion(o,t)}},t.picture?h("img",{alt:"Avatar",class:"avatar",src:t.picture}):h("div",{class:"avatar",innerHTML:addrBookIcon}),h("div",{class:"details"},h("div",{class:"name"},formatFullName(t)),t.email&&h("div",{class:"destination"},t.email),t.phone&&h("div",{class:"destination"},t.phone)))})))),h("div",{key:"4e37f340b40e14e1469742856b9d9f2ea79add97",class:"row"},h("label",{key:"0778e1b56c175a1a5077726fbba30280e5052773",htmlFor:this.emailFieldId},"Email:"),h("input",{key:"9f6806efb77821579c5eee7bf020e0219212761a",id:this.emailFieldId,name:this.emailFieldId,type:"text","data-lpignore":"true",autoComplete:"blocked",value:this.email,placeholder:"Email address...",onFocus:function(){return e.showSuggestions=false},onInput:function(t){return e.email=t.target.value}})),h("div",{key:"6e99f4b3a76f5696f39d721784be7ca0350a42bb",class:"row"},h("label",{key:"cdbfcb45cb531b203d4417f21daffe82a2b4974a",htmlFor:this.phoneFieldId},"Phone:"),h("input",{key:"384b2d948efacbdbb44bad6e8da4174035a63ad3",id:this.phoneFieldId,name:this.phoneFieldId,type:"text","data-lpignore":"true",autoComplete:"blocked",value:this.phone,placeholder:"Phone (SMS)...",onFocus:function(){return e.showSuggestions=false},onInput:function(e){return convertToE164(e.target.value)}})),this.showKba&&h(Fragment,{key:"3824ab85ac446ee579279c034d44c9c7d9f80f44"},h("div",{key:"253b5ce372f405f20dda62f889eb791dbc958d8c",class:"kba-row"},h("label",{key:"6714f992e2f7710d1fe93ed34596f99c54d8e9b0"},"KBA:"),h("verdocs-select-input",{key:"06107cc54709178c007a5416d0c8dcf9c206a1ca",value:this.kbaMethod,onInput:function(t){return e.kbaMethod=t.target.value},options:[{label:"None",value:""},{label:"PIN Code",value:"pin"},{label:"Full Verification",value:"kba"}]}),h("div",{key:"2d898124db289daada4f174e3fe4b557716ef563",style:{flex:"1"}}),h("verdocs-help-icon",{key:"17c58ed5bedaffa1a0bc1f72f7830076dd46502e",text:"Knowledge-Based Authentication adds additional authentication for this user either via a simple PIN code or full address validation. NOTE: There may be a fee for using this feature."})),this.kbaMethod==="pin"&&h("div",{key:"caf64fae166a136aebfcce7ed96bfe015a3cdeb4",class:"row pin-code"},h("input",{key:"545918a43fbb7464dcf5f1aa19a7654899071017",id:"verdocs-pin-code",name:"verdocs-pin-code",type:"text","data-lpignore":"true",autocomplete:"blocked",value:this.pinCode,placeholder:"KBA PIN Code...",onFocus:function(){return e.showSuggestions=false},onInput:function(t){return e.pinCode=t.target.value}}))),this.showMessage&&h("div",{key:"a747e2260ae8224b5b871ddbf1e8423d0da5e0be",class:"row message"},h("label",{key:"2ff918a32677e81887639120cc5ab09be09e27f3",htmlFor:"verdocs-contact-picker-message"},"Message:"),h("input",{key:"9c4c90117ca81c97f359e4b66dfde17d77506b98",id:"verdocs-contact-picker-message",name:"verdocs-contact-picker-message",type:"text","data-lpignore":"true",autocomplete:"blocked",value:this.message,placeholder:"Message shown in invitation...",onFocus:function(){return e.showSuggestions=false},onInput:function(t){return e.message=t.target.value}})),h("div",{key:"3c043c21f0fd8e202de82782ed5d9beec1fa9f2f",class:"buttons"},h("verdocs-toggle-button",{key:"e4e7261482091d4ba73ca11ee0f5b1f738562339",icon:kbaIcon,size:"small",active:this.showKba,onToggle:function(t){e.showKba=t.detail.active;if(!t.detail.active){e.pinCode="";e.kbaMethod=""}e.showSuggestions=false}}),h("verdocs-toggle-button",{key:"d4fb36d6031a641bf056ee8ef022665bd1655e27",icon:messageIcon,size:"small",active:this.showMessage,onToggle:function(t){e.showMessage=t.detail.active;e.showSuggestions=false}}),h("div",{key:"954cbf03867afb74ba9589f0c817541e410dd20c",class:"flex-fill"}),h("verdocs-button",{key:"1b02d3280ab090332a31cd200eed4f2d76d3df4e",variant:"outline",label:"Cancel",size:"small",onClick:function(t){return e.handleCancel(t)}}),h("verdocs-button",{key:"6213ec5d1b337771d53ab8daee0818662666df9f",label:"OK",size:"small",onClick:function(t){return e.handleSubmit(t)}})))};return e}();VerdocsContactPicker.style=VerdocsContactPickerStyle0;var verdocsToggleButtonCss='@-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-toggle-button{font-family:"Inter", "Barlow", sans-serif}verdocs-toggle-button button{border:none;outline:none;cursor:pointer;-ms-flex-align:center;align-items:center;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-pack:center;justify-content:center;background:#cccccc;color:#33364b}verdocs-toggle-button button svg{max-width:100%;max-height:100%;fill:#33364b}verdocs-toggle-button button.active{background:#55bc81;color:#f5f5fa}verdocs-toggle-button button.active svg{fill:#f5f5fa}verdocs-toggle-button button:focus{border:none;outline:none}verdocs-toggle-button.size-normal button{width:40px;height:40px;padding:6px;border-radius:4px}verdocs-toggle-button.size-small button{width:34px;height:34px;padding:4px;border-radius:2px}';var VerdocsToggleButtonStyle0=verdocsToggleButtonCss;var VerdocsToggleButton=function(){function e(e){registerInstance(this,e);this.toggle=createEvent(this,"toggle",7);this.active=false;this.icon=null;this.label=null;this.size="normal";this._active=false}e.prototype.componentWillLoad=function(){this._active=this.active};e.prototype.handleToggle=function(e){var t;e.stopPropagation();var o=!this._active;this._active=o;(t=this.toggle)===null||t===void 0?void 0:t.emit({active:o})};e.prototype.render=function(){var e=this;return h(Host,{key:"32eb5cccbb9687200cf1b57266ceb09143d4a478",class:"size-".concat(this.size)},this.icon?h("button",{innerHTML:this.icon,class:{active:this._active},onClick:function(t){return e.handleToggle(t)}}):h("button",{class:{active:this._active},onClick:function(t){return e.handleToggle(t)}},this.label))};return e}();VerdocsToggleButton.style=VerdocsToggleButtonStyle0;export{VerdocsContactPicker as verdocs_contact_picker,VerdocsToggleButton as verdocs_toggle_button};
|
1
|
+
import{r as registerInstance,c as createEvent,h,F as Fragment,H as Host}from"./index-a68c7262.js";import{VerdocsEndpoint,formatFullName}from"@verdocs/js-sdk";import{f as convertToE164}from"./utils-a79aa5dd.js";import"./_commonjsHelpers-bdec4bbd.js";import"./Types-95d86a44.js";import"./index-0329eed3.js";var verdocsContactPickerCss='@-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-contact-picker{display:block;border:1px solid #ebebeb;background-color:#ffffff;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;-webkit-box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1);box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1)}verdocs-contact-picker form{display:-ms-flexbox;display:flex;gap:14px;width:300px;padding:12px;display:flex;-ms-flex-direction:column;flex-direction:column;background-color:#f5f5fa}verdocs-contact-picker form .row{gap:8px;width:276px;display:-ms-flexbox;display:flex;position:relative;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center}verdocs-contact-picker form .row.message{-ms-flex-direction:column;flex-direction:column;-ms-flex-align:start;align-items:flex-start}verdocs-contact-picker form .names-row{gap:8px;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker form .names-row>input{font-size:14px;width:110px}verdocs-contact-picker form .kba-row{gap:8px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker form .kba-row>input{font-size:14px;width:110px}verdocs-contact-picker form .kba-row verdocs-select-input{margin:0}verdocs-contact-picker form label{display:-ms-flexbox;display:flex;-ms-flex:0 0 50px;flex:0 0 50px;font-size:14px;font-weight:500;color:#5c6575}verdocs-contact-picker form .row.message label{-ms-flex:0;flex:0}verdocs-contact-picker form .row.message input{width:100%}verdocs-contact-picker form input{-ms-flex:1;flex:1;border:none;font-size:14px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-contact-picker form input:focus{outline:none}verdocs-contact-picker form .dropdown{left:0;right:0;top:49px;z-index:1000000;max-height:225px;overflow-y:scroll;position:absolute;background:#ffffff;-webkit-box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1);box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1)}verdocs-contact-picker form .dropdown .suggestion{display:-ms-flexbox;display:flex;padding:6px 12px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker form .dropdown .suggestion svg{width:32px;height:32px}verdocs-contact-picker form .dropdown .suggestion .avatar{width:32px;height:32px;-ms-flex:0 0 32px;flex:0 0 32px;margin-right:8px;border-radius:100%}verdocs-contact-picker form .dropdown .suggestion .details{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-contact-picker form .dropdown .suggestion .name{font-size:16px;font-weight:500;margin-bottom:3px;color:#092c4c}verdocs-contact-picker form .dropdown .suggestion .destination{font-size:14px;margin-bottom:3px;color:#33364b}verdocs-contact-picker form .dropdown .suggestion:hover{background:#eee;cursor:pointer}verdocs-contact-picker .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:6px;-moz-column-gap:6px;column-gap:6px;margin-top:16px;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker .buttons .flex-fill{-ms-flex:1;flex:1}verdocs-contact-picker ::-webkit-input-placeholder{color:#aaaaaa}verdocs-contact-picker ::-moz-placeholder{color:#aaaaaa}verdocs-contact-picker :-ms-input-placeholder{color:#aaaaaa}verdocs-contact-picker ::-ms-input-placeholder{color:#aaaaaa}verdocs-contact-picker ::placeholder{color:#aaaaaa}verdocs-contact-picker [data-lastpass-icon-root]{display:none !important}';var VerdocsContactPickerStyle0=verdocsContactPickerCss;var messageIcon='<svg focusable="false" viewBox="0 0 24 24"><path d="M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-2 12H6v-2h12v2zm0-3H6V9h12v2zm0-3H6V6h12v2z"></path></svg>';var kbaIcon='<svg focusable="false" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M4.5 3.75a3 3 0 0 0-3 3v10.5a3 3 0 0 0 3 3h15a3 3 0 0 0 3-3V6.75a3 3 0 0 0-3-3h-15Zm4.125 3a2.25 2.25 0 1 0 0 4.5 2.25 2.25 0 0 0 0-4.5Zm-3.873 8.703a4.126 4.126 0 0 1 7.746 0 .75.75 0 0 1-.351.92 7.47 7.47 0 0 1-3.522.877 7.47 7.47 0 0 1-3.522-.877.75.75 0 0 1-.351-.92ZM15 8.25a.75.75 0 0 0 0 1.5h3.75a.75.75 0 0 0 0-1.5H15ZM14.25 12a.75.75 0 0 1 .75-.75h3.75a.75.75 0 0 1 0 1.5H15a.75.75 0 0 1-.75-.75Zm.75 2.25a.75.75 0 0 0 0 1.5h3.75a.75.75 0 0 0 0-1.5H15Z" clip-rule="evenodd" /></svg>';var addrBookIcon='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-book-user"><path d="M15 13a3 3 0 1 0-6 0"/><path d="M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20"/><circle cx="12" cy="8" r="2"/></svg>';var VerdocsContactPicker=function(){function e(e){registerInstance(this,e);this.searchContacts=createEvent(this,"searchContacts",7);this.exit=createEvent(this,"exit",7);this.next=createEvent(this,"next",7);this.endpoint=VerdocsEndpoint.getDefault();this.templateRole=null;this.contactSuggestions=[];this.first_name=undefined;this.last_name=undefined;this.email=undefined;this.phone=undefined;this.message=undefined;this.showSuggestions=false;this.showMessage=false;this.delegator=false;this.showKba=false;this.kbaMethod="";this.pinCode="";this.nameFieldId="verdocs-contact-picker-name-".concat(Math.random().toString(36).substring(2,11));this.firstNameFieldId="verdocs-contact-picker-firstname-".concat(Math.random().toString(36).substring(2,11));this.lastNameFieldId="verdocs-contact-picker-lastname-".concat(Math.random().toString(36).substring(2,11));this.emailFieldId="verdocs-contact-picker-email-".concat(Math.random().toString(36).substring(2,11));this.phoneFieldId="verdocs-contact-picker-phone-".concat(Math.random().toString(36).substring(2,11))}e.prototype.componentWillLoad=function(){if(this.templateRole){var e=formatFullName(this.templateRole);var t=e.split(" ");var o=this.templateRole.first_name||t.shift()||"";var a=this.templateRole.last_name||t.join(" ")||"";this.first_name=o;this.last_name=a;this.email=this.templateRole.email||"";this.phone=this.templateRole.phone||"";this.delegator=this.templateRole.delegator||false;this.message=this.templateRole.message||"";this.showMessage=this.message!=="";this.kbaMethod=this.templateRole.kba_method||"";this.showKba=!!this.kbaMethod;this.pinCode=""}};e.prototype.handleFirstNameChange=function(e){var t;this.first_name=e.target.value;(t=this.searchContacts)===null||t===void 0?void 0:t.emit({query:this.first_name})};e.prototype.handleLastNameChange=function(e){var t;this.last_name=e.target.value;(t=this.searchContacts)===null||t===void 0?void 0:t.emit({query:this.last_name})};e.prototype.handleCancel=function(e){var t;e.stopPropagation();this.showSuggestions=false;(t=this.exit)===null||t===void 0?void 0:t.emit()};e.prototype.handleSubmit=function(e){var t;e.stopPropagation();this.showSuggestions=false;(t=this.next)===null||t===void 0?void 0:t.emit({first_name:this.first_name,last_name:this.last_name,email:this.email,phone:this.phone,message:this.message,delegator:this.delegator})};e.prototype.handleSelectSuggestion=function(e,t){e.stopPropagation();this.first_name=t.first_name;this.last_name=t.last_name;this.email=t.email;this.phone=t.phone;this.showSuggestions=false};e.prototype.render=function(){var e=this;return h("form",{key:"8c7cb46336302d309187ca68d7e38ebb3d001468",onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},h("div",{key:"8bc7c876bb89ee84dc14978560c6198d31983261",class:"row"},h("label",{key:"b57ac6d694661a48397afc6ab37fbf5cbca8cbc6",htmlFor:this.nameFieldId},"Name:"),h("div",{key:"197fbb1e998f52d0df3fe9040fd5d9d640b0237a",class:"names-row"},h("input",{key:"343aa3e3c8bb31edfc43c4bd51bed1928ea29d49",id:this.firstNameFieldId,name:this.firstNameFieldId,type:"text","data-lpignore":"true",autocomplete:"blocked",value:this.first_name,placeholder:"First...",onFocus:function(){var t;return e.showSuggestions=((t=e.contactSuggestions)===null||t===void 0?void 0:t.length)>0},onInput:function(t){return e.handleFirstNameChange(t)}}),h("input",{key:"78e830e80650f52d72e5c35523fa111df228c86b",id:this.lastNameFieldId,name:this.lastNameFieldId,type:"text","data-lpignore":"true",autocomplete:"blocked",value:this.last_name,placeholder:"Last...",onFocus:function(){return e.showSuggestions=false},onInput:function(t){return e.handleLastNameChange(t)}})),this.showSuggestions&&h("div",{key:"9b35e34eba14d6ff17c29b7bb334e5a5d8080595",class:"dropdown"},this.contactSuggestions.filter((function(t){return!e.first_name||t.first_name.toLowerCase().includes(e.first_name.toLowerCase())})).map((function(t){var o;return h("div",{key:(o=t.id)!==null&&o!==void 0?o:t.email,class:"suggestion",onClick:function(o){return e.handleSelectSuggestion(o,t)}},t.picture?h("img",{alt:"Avatar",class:"avatar",src:t.picture}):h("div",{class:"avatar",innerHTML:addrBookIcon}),h("div",{class:"details"},h("div",{class:"name"},formatFullName(t)),t.email&&h("div",{class:"destination"},t.email),t.phone&&h("div",{class:"destination"},t.phone)))})))),h("div",{key:"4e37f340b40e14e1469742856b9d9f2ea79add97",class:"row"},h("label",{key:"0778e1b56c175a1a5077726fbba30280e5052773",htmlFor:this.emailFieldId},"Email:"),h("input",{key:"9f6806efb77821579c5eee7bf020e0219212761a",id:this.emailFieldId,name:this.emailFieldId,type:"text","data-lpignore":"true",autoComplete:"blocked",value:this.email,placeholder:"Email address...",onFocus:function(){return e.showSuggestions=false},onInput:function(t){return e.email=t.target.value}})),h("div",{key:"6e99f4b3a76f5696f39d721784be7ca0350a42bb",class:"row"},h("label",{key:"cdbfcb45cb531b203d4417f21daffe82a2b4974a",htmlFor:this.phoneFieldId},"Phone:"),h("input",{key:"384b2d948efacbdbb44bad6e8da4174035a63ad3",id:this.phoneFieldId,name:this.phoneFieldId,type:"text","data-lpignore":"true",autoComplete:"blocked",value:this.phone,placeholder:"Phone (SMS)...",onFocus:function(){return e.showSuggestions=false},onInput:function(e){return convertToE164(e.target.value)}})),this.showKba&&h(Fragment,{key:"3824ab85ac446ee579279c034d44c9c7d9f80f44"},h("div",{key:"253b5ce372f405f20dda62f889eb791dbc958d8c",class:"kba-row"},h("label",{key:"6714f992e2f7710d1fe93ed34596f99c54d8e9b0"},"KBA:"),h("verdocs-select-input",{key:"06107cc54709178c007a5416d0c8dcf9c206a1ca",value:this.kbaMethod,onInput:function(t){return e.kbaMethod=t.target.value},options:[{label:"None",value:""},{label:"PIN Code",value:"pin"},{label:"Full Verification",value:"kba"}]}),h("div",{key:"2d898124db289daada4f174e3fe4b557716ef563",style:{flex:"1"}}),h("verdocs-help-icon",{key:"17c58ed5bedaffa1a0bc1f72f7830076dd46502e",text:"Knowledge-Based Authentication adds additional authentication for this user either via a simple PIN code or full address validation. NOTE: There may be a fee for using this feature."})),this.kbaMethod==="pin"&&h("div",{key:"caf64fae166a136aebfcce7ed96bfe015a3cdeb4",class:"row pin-code"},h("input",{key:"545918a43fbb7464dcf5f1aa19a7654899071017",id:"verdocs-pin-code",name:"verdocs-pin-code",type:"text","data-lpignore":"true",autocomplete:"blocked",value:this.pinCode,placeholder:"KBA PIN Code...",onFocus:function(){return e.showSuggestions=false},onInput:function(t){return e.pinCode=t.target.value}}))),this.showMessage&&h("div",{key:"a747e2260ae8224b5b871ddbf1e8423d0da5e0be",class:"row message"},h("label",{key:"2ff918a32677e81887639120cc5ab09be09e27f3",htmlFor:"verdocs-contact-picker-message"},"Message:"),h("input",{key:"9c4c90117ca81c97f359e4b66dfde17d77506b98",id:"verdocs-contact-picker-message",name:"verdocs-contact-picker-message",type:"text","data-lpignore":"true",autocomplete:"blocked",value:this.message,placeholder:"Message shown in invitation...",onFocus:function(){return e.showSuggestions=false},onInput:function(t){return e.message=t.target.value}})),h("div",{key:"3c043c21f0fd8e202de82782ed5d9beec1fa9f2f",class:"buttons"},h("verdocs-toggle-button",{key:"e4e7261482091d4ba73ca11ee0f5b1f738562339",icon:kbaIcon,size:"small",active:this.showKba,onToggle:function(t){e.showKba=t.detail.active;if(!t.detail.active){e.pinCode="";e.kbaMethod=""}e.showSuggestions=false}}),h("verdocs-toggle-button",{key:"d4fb36d6031a641bf056ee8ef022665bd1655e27",icon:messageIcon,size:"small",active:this.showMessage,onToggle:function(t){e.showMessage=t.detail.active;e.showSuggestions=false}}),h("div",{key:"954cbf03867afb74ba9589f0c817541e410dd20c",class:"flex-fill"}),h("verdocs-button",{key:"1b02d3280ab090332a31cd200eed4f2d76d3df4e",variant:"outline",label:"Cancel",size:"small",onClick:function(t){return e.handleCancel(t)}}),h("verdocs-button",{key:"6213ec5d1b337771d53ab8daee0818662666df9f",label:"OK",size:"small",onClick:function(t){return e.handleSubmit(t)}})))};return e}();VerdocsContactPicker.style=VerdocsContactPickerStyle0;var verdocsToggleButtonCss='@-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-toggle-button{font-family:"Inter", "Barlow", sans-serif}verdocs-toggle-button button{border:none;outline:none;cursor:pointer;-ms-flex-align:center;align-items:center;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-pack:center;justify-content:center;background:#cccccc;color:#33364b}verdocs-toggle-button button svg{max-width:100%;max-height:100%;fill:#33364b}verdocs-toggle-button button.active{background:#55bc81;color:#f5f5fa}verdocs-toggle-button button.active svg{fill:#f5f5fa}verdocs-toggle-button button:focus{border:none;outline:none}verdocs-toggle-button.size-normal button{width:40px;height:40px;padding:6px;border-radius:4px}verdocs-toggle-button.size-small button{width:34px;height:34px;padding:4px;border-radius:2px}';var VerdocsToggleButtonStyle0=verdocsToggleButtonCss;var VerdocsToggleButton=function(){function e(e){registerInstance(this,e);this.toggle=createEvent(this,"toggle",7);this.active=false;this.icon=null;this.label=null;this.size="normal";this._active=false}e.prototype.componentWillLoad=function(){this._active=this.active};e.prototype.handleToggle=function(e){var t;e.stopPropagation();var o=!this._active;this._active=o;(t=this.toggle)===null||t===void 0?void 0:t.emit({active:o})};e.prototype.render=function(){var e=this;return h(Host,{key:"32eb5cccbb9687200cf1b57266ceb09143d4a478",class:"size-".concat(this.size)},this.icon?h("button",{innerHTML:this.icon,class:{active:this._active},onClick:function(t){return e.handleToggle(t)}}):h("button",{class:{active:this._active},onClick:function(t){return e.handleToggle(t)}},this.label))};return e}();VerdocsToggleButton.style=VerdocsToggleButtonStyle0;export{VerdocsContactPicker as verdocs_contact_picker,VerdocsToggleButton as verdocs_toggle_button};
|
@@ -1 +1 @@
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,i,t,n){function r(e){return e instanceof t?e:new t((function(i){i(e)}))}return new(t||(t=Promise))((function(t,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n["throw"](e))}catch(e){o(e)}}function l(e){e.done?t(e.value):r(e.value).then(s,a)}l((n=n.apply(e,i||[])).next())}))};var __generator=this&&this.__generator||function(e,i){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,r,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(e){return function(i){return l([e,i])}}function l(a){if(n)throw new TypeError("Generator is already executing.");while(s&&(s=0,a[0]&&(t=0)),t)try{if(n=1,r&&(o=a[0]&2?r["return"]:a[0]?r["throw"]||((o=r["return"])&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;if(r=0,o)a=[a[0]&2,o.value];switch(a[0]){case 0:case 1:o=a;break;case 4:t.label++;return{value:a[1],done:false};case 5:t.label++;r=a[1];a=[0];continue;case 7:a=t.ops.pop();t.trys.pop();continue;default:if(!(o=t.trys,o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){t=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){t.label=a[1];break}if(a[0]===6&&t.label<o[1]){t.label=o[1];o=a;break}if(o&&t.label<o[2]){t.label=o[2];t.ops.push(a);break}if(o[2])t.ops.pop();t.trys.pop();continue}a=i.call(e,t)}catch(e){a=[6,e];r=0}finally{n=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,i,t){if(t||arguments.length===2)for(var n=0,r=i.length,o;n<r;n++){if(o||!(n in i)){if(!o)o=Array.prototype.slice.call(i,0,n);o[n]=i[n]}}return e.concat(o||Array.prototype.slice.call(i))};import{r as registerInstance,c as createEvent,h,H as Host,F as Fragment}from"./index-a68c7262.js";import{VerdocsEndpoint,startSigningSession,envelopeRecipientAgree,envelopeRecipientDecline,updateEnvelopeField,createSignature,updateEnvelopeFieldSignature,createInitials,updateEnvelopeFieldInitials,isValidPhone,isValidEmail,envelopeRecipientSubmit,uploadEnvelopeFieldAttachment,deleteEnvelopeFieldAttachment,formatFullName,fullNameToInitials,integerSequence}from"@verdocs/js-sdk";import{a as saveAttachment,u as updateDocumentFieldValue,r as renderDocumentField,g as getFieldId}from"./utils-a79aa5dd.js";import{a as createTemplateFieldStoreFromEnvelope}from"./TemplateFieldStore-68bf6acd.js";import{V as VerdocsToast}from"./Toast-c4843828.js";import{S as SDKError}from"./errors-887f1e88.js";import"./_commonjsHelpers-bdec4bbd.js";import"./Types-95d86a44.js";import"./index-0329eed3.js";import"./index-a971a584.js";var verdocsSignCss='@-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-sign{display:-ms-flexbox;display:flex;overflow:hidden;position:relative;min-height:600px;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-sign div{display:block;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-sign input{vertical-align:top}verdocs-sign>.document{-ms-flex:1;flex:1;width:100%;height:100%;-ms-flex-item-align:center;align-self:center;display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;max-width:1200px;min-height:200px;position:relative;overflow-y:scroll;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column}verdocs-sign>.document .inner{width:100%;max-width:1028px}verdocs-sign .cover{top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;z-index:5000;position:absolute;padding-top:100px;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column;background:rgba(0, 0, 0, 0.5)}verdocs-sign .agree{-ms-flex:0;flex:0;width:600px;display:-ms-flexbox;display:flex;max-width:90%;padding:30px 15px;-ms-flex-direction:column;flex-direction:column;background-color:#ffffff}verdocs-sign .agree .header{-ms-flex:0 0 56px;flex:0 0 56px}verdocs-sign .agree li{margin:0.5em 0}verdocs-sign verdocs-ok-dialog .background-overlay{-ms-flex-align:start;align-items:flex-start;padding-top:100px}verdocs-sign .loading-indicator{top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;z-index:10000;position:fixed;background-color:rgba(0, 0, 0, 0.7)}@media print{verdocs-sign .header{display:none}}#verdocs-sign-header{color:#fff;width:100%;display:-ms-flexbox;display:flex;z-index:1000;-ms-flex:0 0 56px;flex:0 0 56px;font-size:12px;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-webkit-transition:all 0.25s;transition:all 0.25s;background-color:#33354c;-webkit-box-shadow:0 4px 4px 0 rgba(0, 0, 0, 0.24), 0 0 4px 0 rgba(0, 0, 0, 0.12);box-shadow:0 4px 4px 0 rgba(0, 0, 0, 0.24), 0 0 4px 0 rgba(0, 0, 0, 0.12)}#verdocs-sign-header .inner{width:100%;display:-ms-flexbox;display:flex;margin:0 auto;padding:0 20px;max-width:1200px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}#verdocs-sign-header .logo{width:80px;display:none;margin:-6px 0 0 0}#verdocs-sign-header .title{font-size:18px;font-weight:500;overflow:hidden;white-space:nowrap;padding:0 10px 0 0;text-overflow:ellipsis}';var VerdocsSignStyle0=verdocsSignCss;var inProgressMenuOptions=[{id:"later",label:"Finish Later"},{id:"decline",label:"Decline to Sign"},{id:"print",label:"Print Without Signing"},{id:"download",label:"Download"}];var doneMenuOptions=[{id:"print",label:"Print"},{id:"download",label:"Download"}];var VerdocsSign=function(){function e(e){registerInstance(this,e);this.sdkError=createEvent(this,"sdkError",7);this.envelopeLoaded=createEvent(this,"envelopeLoaded",7);this.envelopeUpdated=createEvent(this,"envelopeUpdated",7);this.recipientIndex=-1;this.endpoint=null;this.envelopeId=null;this.roleId=null;this.inviteCode=null;this.headerTargetId=null;this.envelope=null;this.roleNames=[];this.sortedRecipients=[];this.recipient=null;this.hasSignature=false;this.nextButtonLabel="Start";this.nextSubmits=false;this.errorMessage="";this.focusedField="";this.submitting=false;this.isDone=false;this.showDone=false;this.showLoadError=false;this.finishLater=false;this.showFinishLater=false;this.agreed=false;this.documentsSingularPlural="document"}e.prototype.componentWillLoad=function(){if(!this.endpoint){console.log("[SIGN] Creating signing endpoint");this.endpoint=new VerdocsEndpoint({sessionType:"signing"})}};e.prototype.componentDidLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,i,t,n,r,o,s,a,l,c,d;var u=this;return __generator(this,(function(h){switch(h.label){case 0:if(!this.envelopeId){(e=this.sdkError)===null||e===void 0?void 0:e.emit(new SDKError("[SIGN] Missing required envelopId",500,""));return[2]}if(!this.roleId){(i=this.sdkError)===null||i===void 0?void 0:i.emit(new SDKError("[SIGN] Missing required roleId",500,""));return[2]}if(!this.inviteCode){(t=this.sdkError)===null||t===void 0?void 0:t.emit(new SDKError("[SIGN] Missing required inviteCode",500,""));return[2]}h.label=1;case 1:h.trys.push([1,3,,4]);console.log("[SIGN] Processing invite code for ".concat(this.envelopeId," / ").concat(this.roleId));return[4,startSigningSession(this.endpoint,this.envelopeId,this.roleId,this.inviteCode)];case 2:a=h.sent(),l=a.envelope,c=a.recipient;console.log("[SIGN] Loaded signing session",l,c);this.recipient=c;this.envelope=l;if(this.agreed){this.nextButtonLabel="Next"}createTemplateFieldStoreFromEnvelope(this.envelope);this.sortedRecipients=__spreadArray([],this.envelope.recipients,true);this.sortedRecipients.sort((function(e,i){return e.sequence===i.sequence?e.order-i.order:e.sequence-i.sequence}));this.roleNames=this.sortedRecipients.map((function(e){return e.role_name}));if(this.envelope.documents.length>0){this.documentsSingularPlural="document(s)"}this.recipientIndex=this.roleNames.findIndex((function(e){return e==u.roleId}));if(this.recipientIndex>-1){this.recipient=this.sortedRecipients[this.recipientIndex];this.agreed=this.recipient.agreed}else{console.warn("[SIGN] Could not find our recipient record",this.roleId,this.sortedRecipients)}this.isDone=["submitted","canceled","declined"].includes(this.recipient.status);this.checkRecipientFields();(n=this.envelopeLoaded)===null||n===void 0?void 0:n.emit({endpoint:this.endpoint,envelope:this.envelope});return[3,4];case 3:d=h.sent();console.log("[SIGN] Error with signing session",d);(r=this.sdkError)===null||r===void 0?void 0:r.emit(new SDKError(d.message,(o=d.response)===null||o===void 0?void 0:o.status,(s=d.response)===null||s===void 0?void 0:s.data));this.showLoadError=true;return[3,4];case 4:return[2]}}))}))};e.prototype.componentDidRender=function(){var e=this.headerTargetId?document.getElementById(this.headerTargetId):null;var i=document.getElementById("verdocs-sign-header");if(e&&i){console.log("[SIGN] Moving header");i.remove();e.append(i)}};e.prototype.handleClickAgree=function(){var e=this;this.submitting=true;envelopeRecipientAgree(this.endpoint,this.envelopeId,this.roleId,true).then((function(){var i;e.nextButtonLabel="Next";e.recipient.agreed=true;e.submitting=false;e.agreed=true;(i=e.envelopeUpdated)===null||i===void 0?void 0:i.emit({endpoint:e.endpoint,envelope:e.envelope,event:"agreed"})})).catch((function(i){var t,n,r;console.log("[SIGN] Update failure",i);e.submitting=false;(t=e.sdkError)===null||t===void 0?void 0:t.emit(new SDKError(i.message,(n=i.response)===null||n===void 0?void 0:n.status,(r=i.response)===null||r===void 0?void 0:r.data))}))};e.prototype.handleOptionSelected=function(e){return __awaiter(this,void 0,void 0,(function(){var i,t,n,r,o,s,a,l;return __generator(this,(function(c){switch(c.label){case 0:s=e.detail.id;switch(s){case"later":return[3,1];case"claim":return[3,2];case"decline":return[3,3];case"print":return[3,5];case"download":return[3,6]}return[3,7];case 1:this.finishLater=true;this.showFinishLater=true;(i=this.envelopeUpdated)===null||i===void 0?void 0:i.emit({endpoint:this.endpoint,envelope:this.envelope,event:"later"});return[3,7];case 2:VerdocsToast("This feature will be available in an upcoming release.");(t=this.envelopeUpdated)===null||t===void 0?void 0:t.emit({endpoint:this.endpoint,envelope:this.envelope,event:"claimed"});return[3,7];case 3:this.submitting=true;return[4,envelopeRecipientDecline(this.endpoint,this.envelopeId,this.roleId)];case 4:a=c.sent();console.log("[SIGN] Decline result",a);(n=this.envelopeUpdated)===null||n===void 0?void 0:n.emit({endpoint:this.endpoint,envelope:this.envelope,event:"declined"});this.submitting=false;this.isDone=true;return[3,7];case 5:window.print();(r=this.envelopeUpdated)===null||r===void 0?void 0:r.emit({endpoint:this.endpoint,envelope:this.envelope,event:"printed"});return[3,7];case 6:{l=this.envelope.documents.find((function(e){return e.type==="attachment"}));if(l){saveAttachment(this.endpoint,this.envelope,l.id).catch((function(e){console.log("[SIGN] Error downloading PDF",e)}));(o=this.envelopeUpdated)===null||o===void 0?void 0:o.emit({endpoint:this.endpoint,envelope:this.envelope,event:"downloaded"})}}return[3,7];case 7:return[2]}}))}))};e.prototype.updateRecipientFieldValue=function(e,i){var t=this;console.log("[SIGN] updateRecipientFieldValue",e);this.getRecipientFields().forEach((function(n){if(n.name===e){n.value=i.value;n.settings=i.settings;updateDocumentFieldValue(n);t.checkRecipientFields()}}))};e.prototype.saveFieldChange=function(e,i){var t=this;console.log("[SIGN] updateRecipientFieldValue",e);updateEnvelopeField(this.endpoint,this.envelopeId,e,i).then((function(i){return t.updateRecipientFieldValue(e,i)})).catch((function(e){var i,n,r,o,s,a;if(((i=e.response)===null||i===void 0?void 0:i.status)===401&&((r=(n=e.response)===null||n===void 0?void 0:n.data)===null||r===void 0?void 0:r.error)==="jwt expired"){console.log("[SIGN] Signing session expired");t.errorMessage="Signing session expired. Please reload your browser to continue."}else{console.log("[SIGN] Server error",e)}(o=t.sdkError)===null||o===void 0?void 0:o.emit(new SDKError(e.message,(s=e.response)===null||s===void 0?void 0:s.status,(a=e.response)===null||a===void 0?void 0:a.data))}))};e.prototype.handleFieldChange=function(e,i){return __awaiter(this,void 0,void 0,(function(){var t,n,r,o,s,a,l;var c=this;return __generator(this,(function(d){switch(d.label){case 0:t=i.target,n=t.value,r=t.checked;o=e.type;switch(o){case"textbox":return[3,1];case"checkbox":return[3,2];case"radio":return[3,3];case"dropdown":return[3,4];case"initial":return[3,5];case"signature":return[3,8];case"date":return[3,11];case"timestamp":return[3,12]}return[3,13];case 1:return[2,this.saveFieldChange(e.name,{prepared:false,value:n})];case 2:{return[2,this.saveFieldChange(e.name,{prepared:false,value:String(i.target.checked)})]}d.label=3;case 3:{return[2,this.saveFieldChange(e.name,{prepared:false,value:String(i.target.checked)})]}d.label=4;case 4:console.log("Saving dropdown",e.name,i.detail);return[2,this.saveFieldChange(e.name,{prepared:false,value:i.detail})];case 5:if(!i.detail){return[2]}return[4,fetch(i.detail)];case 6:return[4,d.sent().blob()];case 7:s=d.sent();return[2,createInitials(this.endpoint,"initial",s).then((function(i){return __awaiter(c,void 0,void 0,(function(){var t;return __generator(this,(function(n){switch(n.label){case 0:return[4,updateEnvelopeFieldInitials(this.endpoint,this.envelopeId,e.name,i.id)];case 1:t=n.sent();this.updateRecipientFieldValue(e.name,t);return[2]}}))}))}))];case 8:if(!i.detail){return[2]}return[4,fetch(i.detail)];case 9:return[4,d.sent().blob()];case 10:a=d.sent();return[2,createSignature(this.endpoint,"signature",a).then((function(i){return __awaiter(c,void 0,void 0,(function(){var t;return __generator(this,(function(n){switch(n.label){case 0:console.log("Signature update result",i);return[4,updateEnvelopeFieldSignature(this.endpoint,this.envelopeId,e.name,i.id)];case 1:t=n.sent();this.updateRecipientFieldValue(e.name,t);return[2]}}))}))})).catch((function(e){console.warn("[SIGN] Error updating signature",e)}))];case 11:l=i.detail.formattedDate;if(l){return[2,this.saveFieldChange(e.name,{prepared:false,value:l})]}return[3,14];case 12:console.log("[SIGN] Updating timestamp",{value:n,ts:i.target.getAttribute("timestamp")});return[3,14];case 13:console.log("[SIGN] Unhandled field update",{value:n,checked:r},e);return[3,14];case 14:return[2]}}))}))};e.prototype.isFieldFilled=function(e){var i=e.value,t=i===void 0?"":i;switch(e.type){case"textbox":switch(e.validator||""){case"email":return isValidEmail(t);case"phone":return isValidPhone(t);default:return t!==""}case"signature":return t==="signed";case"initial":return t==="initialed";case"timestamp":return true;case"textarea":case"date":return t!=="";case"attachment":return t==="attached";case"dropdown":return t!=="";case"checkbox":return t==="true";case"radio":if(!!e.group){return this.getRecipientFields().filter((function(i){return i.group===e.group})).some((function(e){return e.value==="true"}))}return e.value==="true";default:return false}};e.prototype.isFieldValid=function(e){return!e.required||this.isFieldFilled(e)};e.prototype.getSortedFillableFields=function(){var e=this.getRecipientFields().filter((function(e){return e.type!=="timestamp"}));e.sort((function(e,i){var t=e.x||0;var n=e.y||0;var r=i.x||0;var o=i.y||0;var s=Math.floor(n/5);var a=Math.floor(o/5);return a!==s?a-s:t-r}));return e};e.prototype.handleNext=function(){return __awaiter(this,void 0,void 0,(function(){var e,i,t,n,r,o,s,a,l,c,d;var u=this;return __generator(this,(function(h){switch(h.label){case 0:if(!this.nextSubmits)return[3,5];h.label=1;case 1:h.trys.push([1,3,,4]);(e=document.getElementById("air-datepicker-global-container"))===null||e===void 0?void 0:e.remove();this.submitting=true;return[4,envelopeRecipientSubmit(this.endpoint,this.envelopeId,this.roleId)];case 2:t=h.sent();console.log("[SIGN] Submitted successfully",t);this.recipient.status="submitted";this.showDone=true;this.isDone=true;return[3,4];case 3:n=h.sent();console.log("[SIGN] Error submitting",n);return[3,4];case 4:this.submitting=false;return[2];case 5:r=this.getSortedFillableFields().filter((function(e){return!u.isFieldFilled(e)}));r.sort((function(e,i){var t=e.x||0;var n=e.y||0;var r=i.x||0;var o=i.y||0;var s=Math.floor(n/5);var a=Math.floor(o/5);return a!==s?a-s:t-r}));o=r.findIndex((function(e){return e.name===u.focusedField}));s=o+1;if(s>=r.length){s=0}a=r[s];l=0;if(l<r.length&&["signature","initial"].includes(a.type)&&((i=a.settings)===null||i===void 0?void 0:i.result)==="signed"){l++;s++;if(s>=r.length){s=0}a=r[s]}if(l>=r.length){a=null}if(a){c=getFieldId(a);d=document.getElementById(c);d===null||d===void 0?void 0:d.focusField();d===null||d===void 0?void 0:d.scrollTo({behavior:"smooth",top:0});this.focusedField=a.name}return[2]}}))}))};e.prototype.getRecipientFields=function(){var e=this;return this.envelope.fields.filter((function(i){return i.role_name===e.recipient.role_name}))};e.prototype.checkRecipientFields=function(){var e=this;var i=this.getRecipientFields().filter((function(i){return!e.isFieldValid(i)}));if(i.length<1){this.nextButtonLabel="Finish";if(!this.nextSubmits){this.nextSubmits=true}}else{console.log("[SIGN] Invalid fields remaining",i);this.nextButtonLabel="Next";this.nextSubmits=false}};e.prototype.attachFieldAttributes=function(e,i,t){var n=this;t.addEventListener("input",(function(e){console.log("onInput",e.target.type,e.target.name);if(e.target.type==="radio"||e.target.type==="checkbox"){n.handleFieldChange(i,e).finally((function(){return n.checkRecipientFields()}))}else{n.checkRecipientFields()}}));t.addEventListener("attached",(function(e){return __awaiter(n,void 0,void 0,(function(){var t;return __generator(this,(function(n){switch(n.label){case 0:console.log("[SIGN] onAttached",e.detail,e.target.value);return[4,uploadEnvelopeFieldAttachment(this.endpoint,this.envelopeId,i.name,e.detail)];case 1:t=n.sent();console.log("upload result",t);this.checkRecipientFields();return[2]}}))}))}));t.addEventListener("remove",(function(e){console.log("[SIGN] onRemoved",e.detail,e.target.value);deleteEnvelopeFieldAttachment(n.endpoint,n.envelopeId,i.name).then((function(e){console.log("[SIGN] Deleted attachment",e)})).catch((function(e){return console.log("[SIGN] Error deleting attachment",e)}))}));t.addEventListener("focusout",(function(e){if(i.type!=="dropdown"){n.handleFieldChange(i,e).finally((function(){return n.checkRecipientFields()}))}}));t.addEventListener("fieldChange",(function(e){n.handleFieldChange(i,e).finally((function(){return n.checkRecipientFields()}))}));t.setAttribute("templateid",this.envelope.template_id);t.setAttribute("fieldname",i.name);t.setAttribute("page",e.pageNumber);t.setAttribute("xScale",e.xScale);t.setAttribute("yScale",e.yScale);var r=formatFullName(this.recipient);t.setAttribute("initials",fullNameToInitials(r));t.setAttribute("name",r)};e.prototype.handlePageRendered=function(e){var i=this;var t=e.detail;var n=this.getSortedFillableFields();console.log("Recipient fields",n);n.forEach((function(e,n){if(e.page!==t.pageNumber){return}var r=renderDocumentField(e,t,{disabled:false,editable:false,draggable:false,done:i.isDone},n);if(!r){return}if(Array.isArray(r)){r.map((function(n){return i.attachFieldAttributes(t,e,n)}))}else{i.attachFieldAttributes(t,e,r)}}));this.sortedRecipients.filter((function(e){return e.role_name!==i.recipient.role_name&&(e.status==="invited"||e.status==="opened"||e.status==="pending")})).forEach((function(){i.getRecipientFields().filter((function(e){return e.page===t.pageNumber})).forEach((function(e){var n=renderDocumentField(e,t,{disabled:true,editable:false,draggable:false,done:i.isDone});if(!n){return}if(Array.isArray(n)){n.map((function(n){return i.attachFieldAttributes(t,e,n)}))}else{i.attachFieldAttributes(t,e,n)}}))}));this.checkRecipientFields()};e.prototype.render=function(){var e=this;if(this.showLoadError){return h(Host,null,h("verdocs-ok-dialog",{heading:"Unable to Start Signing",message:"Sorry, your invite code is invalid or has expired. Please check your email for an updated invitation, or contact the sender.",buttonLabel:"OK",onNext:function(){window.location.reload()}}))}if(!this.envelope){return h(Host,null,h("verdocs-loader",null))}if(this.isDone){return h(Host,{class:{agreed:this.agreed}},h("verdocs-view",{endpoint:this.endpoint,envelopeId:this.envelopeId,onSdkError:function(i){var t;return(t=e.sdkError)===null||t===void 0?void 0:t.emit(i.detail)}}),this.errorMessage&&h("verdocs-ok-dialog",{heading:"Network Error",message:this.errorMessage,onNext:function(){return e.errorMessage=""}}),this.showDone&&h("verdocs-ok-dialog",{heading:"You're Done!",message:"You can access the ".concat(this.documentsSingularPlural," at any time by clicking on the link from the invitation email.<br /><br />After all recipients have completed their actions, you will receive an email with the document and envelope certificate attached."),onNext:function(){e.showDone=false;e.isDone=true}}),this.submitting&&h("div",{class:"loading-indicator"},h("verdocs-loader",null)))}return h(Host,{class:{agreed:this.agreed}},h("div",{id:"verdocs-sign-header"},h("div",{class:"inner"},h("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),h("div",{class:"title"},this.envelope.name),h("div",{style:{flex:"1"}}),this.agreed&&!this.finishLater&&h("verdocs-button",{size:"small",label:this.nextButtonLabel,disabled:!this.agreed,onClick:function(){return e.handleNext()}}),h("div",{style:{marginLeft:"10px"}}),this.agreed&&h("verdocs-dropdown",{options:!this.isDone&&!this.finishLater?inProgressMenuOptions:doneMenuOptions,onOptionSelected:function(i){return e.handleOptionSelected(i)}}))),this.agreed?h("div",{class:"document",style:{paddingTop:"15px"}},(this.envelope.documents||[]).map((function(i){var t=integerSequence(1,i.pages);return h(Fragment,null,t.map((function(t){return h("verdocs-envelope-document-page",{envelopeId:e.envelopeId,documentId:i.id,endpoint:e.endpoint,virtualWidth:612,virtualHeight:792,pageNumber:t,onPageRendered:function(i){return e.handlePageRendered(i)},type:"filled",layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})})))}))):h("div",{class:"document",style:{paddingTop:"15px"}},h("img",{src:"https://public-assets.verdocs.com/loading-placeholder.png",style:{width:"612px",height:"792px",boxShadow:"0 0 10px 5px #0000000f",marginTop:"15px"},alt:"Placeholder page"})),this.showFinishLater&&h("verdocs-ok-dialog",{heading:"You've saved your document to finish later.",message:"To complete the ".concat(this.documentsSingularPlural,", use the link in the original email notification inviting you to review and finish the document."),onNext:function(){return e.showFinishLater=false}}),this.errorMessage&&h("verdocs-ok-dialog",{heading:"Network Error",message:this.errorMessage,onNext:function(){return e.errorMessage=""}}),this.showDone&&h("verdocs-ok-dialog",{heading:"You're Done!",message:"You can access the ".concat(this.documentsSingularPlural," at any time by clicking on the link from the invitation email.<br /><br />After all recipients have completed their actions, you will receive an email with the document and envelope certificate attached."),onNext:function(){e.showDone=false;e.isDone=true}}),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:function(){return e.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"),".")))))};return e}();VerdocsSign.style=VerdocsSignStyle0;export{VerdocsSign as verdocs_sign};
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,i,t,n){function r(e){return e instanceof t?e:new t((function(i){i(e)}))}return new(t||(t=Promise))((function(t,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n["throw"](e))}catch(e){o(e)}}function l(e){e.done?t(e.value):r(e.value).then(s,a)}l((n=n.apply(e,i||[])).next())}))};var __generator=this&&this.__generator||function(e,i){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,r,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(e){return function(i){return l([e,i])}}function l(a){if(n)throw new TypeError("Generator is already executing.");while(s&&(s=0,a[0]&&(t=0)),t)try{if(n=1,r&&(o=a[0]&2?r["return"]:a[0]?r["throw"]||((o=r["return"])&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;if(r=0,o)a=[a[0]&2,o.value];switch(a[0]){case 0:case 1:o=a;break;case 4:t.label++;return{value:a[1],done:false};case 5:t.label++;r=a[1];a=[0];continue;case 7:a=t.ops.pop();t.trys.pop();continue;default:if(!(o=t.trys,o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){t=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){t.label=a[1];break}if(a[0]===6&&t.label<o[1]){t.label=o[1];o=a;break}if(o&&t.label<o[2]){t.label=o[2];t.ops.push(a);break}if(o[2])t.ops.pop();t.trys.pop();continue}a=i.call(e,t)}catch(e){a=[6,e];r=0}finally{n=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,i,t){if(t||arguments.length===2)for(var n=0,r=i.length,o;n<r;n++){if(o||!(n in i)){if(!o)o=Array.prototype.slice.call(i,0,n);o[n]=i[n]}}return e.concat(o||Array.prototype.slice.call(i))};import{r as registerInstance,c as createEvent,h,H as Host,F as Fragment}from"./index-a68c7262.js";import{VerdocsEndpoint,startSigningSession,getKbaStep,envelopeRecipientAgree,envelopeRecipientDecline,updateEnvelopeField,createSignature,updateEnvelopeFieldSignature,createInitials,updateEnvelopeFieldInitials,isValidPhone,isValidEmail,envelopeRecipientSubmit,uploadEnvelopeFieldAttachment,deleteEnvelopeFieldAttachment,formatFullName,fullNameToInitials,integerSequence}from"@verdocs/js-sdk";import{a as saveAttachment,u as updateDocumentFieldValue,r as renderDocumentField,g as getFieldId}from"./utils-a79aa5dd.js";import{a as createTemplateFieldStoreFromEnvelope}from"./TemplateFieldStore-68bf6acd.js";import{V as VerdocsToast}from"./Toast-c4843828.js";import{S as SDKError}from"./errors-887f1e88.js";import"./_commonjsHelpers-bdec4bbd.js";import"./Types-95d86a44.js";import"./index-0329eed3.js";import"./index-a971a584.js";var verdocsSignCss='@-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-sign{display:-ms-flexbox;display:flex;overflow:hidden;position:relative;min-height:600px;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-sign div{display:block;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-sign input{vertical-align:top}verdocs-sign>.document{-ms-flex:1;flex:1;width:100%;height:100%;-ms-flex-item-align:center;align-self:center;display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;max-width:1200px;min-height:200px;position:relative;overflow-y:scroll;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column}verdocs-sign>.document .inner{width:100%;max-width:1028px}verdocs-sign .cover{top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;z-index:5000;position:absolute;padding-top:100px;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column;background:rgba(0, 0, 0, 0.5)}verdocs-sign .agree{-ms-flex:0;flex:0;width:600px;display:-ms-flexbox;display:flex;max-width:90%;padding:30px 15px;-ms-flex-direction:column;flex-direction:column;background-color:#ffffff}verdocs-sign .agree .header{-ms-flex:0 0 56px;flex:0 0 56px}verdocs-sign .agree li{margin:0.5em 0}verdocs-sign verdocs-ok-dialog .background-overlay{-ms-flex-align:start;align-items:flex-start;padding-top:100px}verdocs-sign .loading-indicator{top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;z-index:10000;position:fixed;background-color:rgba(0, 0, 0, 0.7)}@media print{verdocs-sign .header{display:none}}#verdocs-sign-header{color:#fff;width:100%;display:-ms-flexbox;display:flex;z-index:1000;-ms-flex:0 0 56px;flex:0 0 56px;font-size:12px;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-webkit-transition:all 0.25s;transition:all 0.25s;background-color:#33354c;-webkit-box-shadow:0 4px 4px 0 rgba(0, 0, 0, 0.24), 0 0 4px 0 rgba(0, 0, 0, 0.12);box-shadow:0 4px 4px 0 rgba(0, 0, 0, 0.24), 0 0 4px 0 rgba(0, 0, 0, 0.12)}#verdocs-sign-header .inner{width:100%;display:-ms-flexbox;display:flex;margin:0 auto;padding:0 20px;max-width:1200px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}#verdocs-sign-header .logo{width:80px;display:none;margin:-6px 0 0 0}#verdocs-sign-header .title{font-size:18px;font-weight:500;overflow:hidden;white-space:nowrap;padding:0 10px 0 0;text-overflow:ellipsis}';var VerdocsSignStyle0=verdocsSignCss;var inProgressMenuOptions=[{id:"later",label:"Finish Later"},{id:"decline",label:"Decline to Sign"},{id:"print",label:"Print Without Signing"},{id:"download",label:"Download"}];var doneMenuOptions=[{id:"print",label:"Print"},{id:"download",label:"Download"}];var VerdocsSign=function(){function e(e){registerInstance(this,e);this.sdkError=createEvent(this,"sdkError",7);this.envelopeLoaded=createEvent(this,"envelopeLoaded",7);this.envelopeUpdated=createEvent(this,"envelopeUpdated",7);this.recipientIndex=-1;this.endpoint=null;this.envelopeId=null;this.roleId=null;this.inviteCode=null;this.headerTargetId=null;this.envelope=null;this.roleNames=[];this.sortedRecipients=[];this.recipient=null;this.hasSignature=false;this.nextButtonLabel="Start";this.nextSubmits=false;this.errorMessage="";this.focusedField="";this.submitting=false;this.isDone=false;this.showDone=false;this.showLoadError=false;this.finishLater=false;this.showFinishLater=false;this.agreed=false;this.documentsSingularPlural="document"}e.prototype.componentWillLoad=function(){if(!this.endpoint){console.log("[SIGN] Creating signing endpoint");this.endpoint=new VerdocsEndpoint({sessionType:"signing"})}};e.prototype.componentDidLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,i,t,n,r,o,s,a,l,c,d;var u=this;return __generator(this,(function(h){switch(h.label){case 0:if(!this.envelopeId){(e=this.sdkError)===null||e===void 0?void 0:e.emit(new SDKError("[SIGN] Missing required envelopId",500,""));return[2]}if(!this.roleId){(i=this.sdkError)===null||i===void 0?void 0:i.emit(new SDKError("[SIGN] Missing required roleId",500,""));return[2]}if(!this.inviteCode){(t=this.sdkError)===null||t===void 0?void 0:t.emit(new SDKError("[SIGN] Missing required inviteCode",500,""));return[2]}h.label=1;case 1:h.trys.push([1,3,,4]);console.log("[SIGN] Processing invite code for ".concat(this.envelopeId," / ").concat(this.roleId));return[4,startSigningSession(this.endpoint,this.envelopeId,this.roleId,this.inviteCode)];case 2:a=h.sent(),l=a.envelope,c=a.recipient;console.log("[SIGN] Loaded signing session",l,c);this.recipient=c;this.envelope=l;getKbaStep(this.endpoint,this.envelopeId,this.roleId).then((function(e){console.log("KBA Step",e)})).catch((function(e){return console.log("Error getting KBA step",e)}));if(this.agreed){this.nextButtonLabel="Next"}createTemplateFieldStoreFromEnvelope(this.envelope);this.sortedRecipients=__spreadArray([],this.envelope.recipients,true);this.sortedRecipients.sort((function(e,i){return e.sequence===i.sequence?e.order-i.order:e.sequence-i.sequence}));this.roleNames=this.sortedRecipients.map((function(e){return e.role_name}));if(this.envelope.documents.length>0){this.documentsSingularPlural="document(s)"}this.recipientIndex=this.roleNames.findIndex((function(e){return e==u.roleId}));if(this.recipientIndex>-1){this.recipient=this.sortedRecipients[this.recipientIndex];this.agreed=this.recipient.agreed}else{console.warn("[SIGN] Could not find our recipient record",this.roleId,this.sortedRecipients)}this.isDone=["submitted","canceled","declined"].includes(this.recipient.status);this.checkRecipientFields();(n=this.envelopeLoaded)===null||n===void 0?void 0:n.emit({endpoint:this.endpoint,envelope:this.envelope});return[3,4];case 3:d=h.sent();console.log("[SIGN] Error with signing session",d);(r=this.sdkError)===null||r===void 0?void 0:r.emit(new SDKError(d.message,(o=d.response)===null||o===void 0?void 0:o.status,(s=d.response)===null||s===void 0?void 0:s.data));this.showLoadError=true;return[3,4];case 4:return[2]}}))}))};e.prototype.componentDidRender=function(){var e=this.headerTargetId?document.getElementById(this.headerTargetId):null;var i=document.getElementById("verdocs-sign-header");if(e&&i){console.log("[SIGN] Moving header");i.remove();e.append(i)}};e.prototype.handleClickAgree=function(){var e=this;this.submitting=true;envelopeRecipientAgree(this.endpoint,this.envelopeId,this.roleId,true).then((function(){var i;e.nextButtonLabel="Next";e.recipient.agreed=true;e.submitting=false;e.agreed=true;(i=e.envelopeUpdated)===null||i===void 0?void 0:i.emit({endpoint:e.endpoint,envelope:e.envelope,event:"agreed"})})).catch((function(i){var t,n,r;console.log("[SIGN] Update failure",i);e.submitting=false;(t=e.sdkError)===null||t===void 0?void 0:t.emit(new SDKError(i.message,(n=i.response)===null||n===void 0?void 0:n.status,(r=i.response)===null||r===void 0?void 0:r.data))}))};e.prototype.handleOptionSelected=function(e){return __awaiter(this,void 0,void 0,(function(){var i,t,n,r,o,s,a,l;return __generator(this,(function(c){switch(c.label){case 0:s=e.detail.id;switch(s){case"later":return[3,1];case"claim":return[3,2];case"decline":return[3,3];case"print":return[3,5];case"download":return[3,6]}return[3,7];case 1:this.finishLater=true;this.showFinishLater=true;(i=this.envelopeUpdated)===null||i===void 0?void 0:i.emit({endpoint:this.endpoint,envelope:this.envelope,event:"later"});return[3,7];case 2:VerdocsToast("This feature will be available in an upcoming release.");(t=this.envelopeUpdated)===null||t===void 0?void 0:t.emit({endpoint:this.endpoint,envelope:this.envelope,event:"claimed"});return[3,7];case 3:this.submitting=true;return[4,envelopeRecipientDecline(this.endpoint,this.envelopeId,this.roleId)];case 4:a=c.sent();console.log("[SIGN] Decline result",a);(n=this.envelopeUpdated)===null||n===void 0?void 0:n.emit({endpoint:this.endpoint,envelope:this.envelope,event:"declined"});this.submitting=false;this.isDone=true;return[3,7];case 5:window.print();(r=this.envelopeUpdated)===null||r===void 0?void 0:r.emit({endpoint:this.endpoint,envelope:this.envelope,event:"printed"});return[3,7];case 6:{l=this.envelope.documents.find((function(e){return e.type==="attachment"}));if(l){saveAttachment(this.endpoint,this.envelope,l.id).catch((function(e){console.log("[SIGN] Error downloading PDF",e)}));(o=this.envelopeUpdated)===null||o===void 0?void 0:o.emit({endpoint:this.endpoint,envelope:this.envelope,event:"downloaded"})}}return[3,7];case 7:return[2]}}))}))};e.prototype.updateRecipientFieldValue=function(e,i){var t=this;console.log("[SIGN] updateRecipientFieldValue",e);this.getRecipientFields().forEach((function(n){if(n.name===e){n.value=i.value;n.settings=i.settings;updateDocumentFieldValue(n);t.checkRecipientFields()}}))};e.prototype.saveFieldChange=function(e,i){var t=this;console.log("[SIGN] updateRecipientFieldValue",e);updateEnvelopeField(this.endpoint,this.envelopeId,e,i).then((function(i){return t.updateRecipientFieldValue(e,i)})).catch((function(e){var i,n,r,o,s,a;if(((i=e.response)===null||i===void 0?void 0:i.status)===401&&((r=(n=e.response)===null||n===void 0?void 0:n.data)===null||r===void 0?void 0:r.error)==="jwt expired"){console.log("[SIGN] Signing session expired");t.errorMessage="Signing session expired. Please reload your browser to continue."}else{console.log("[SIGN] Server error",e)}(o=t.sdkError)===null||o===void 0?void 0:o.emit(new SDKError(e.message,(s=e.response)===null||s===void 0?void 0:s.status,(a=e.response)===null||a===void 0?void 0:a.data))}))};e.prototype.handleFieldChange=function(e,i){return __awaiter(this,void 0,void 0,(function(){var t,n,r,o,s,a,l;var c=this;return __generator(this,(function(d){switch(d.label){case 0:t=i.target,n=t.value,r=t.checked;o=e.type;switch(o){case"textbox":return[3,1];case"checkbox":return[3,2];case"radio":return[3,3];case"dropdown":return[3,4];case"initial":return[3,5];case"signature":return[3,8];case"date":return[3,11];case"timestamp":return[3,12]}return[3,13];case 1:return[2,this.saveFieldChange(e.name,{prepared:false,value:n})];case 2:{return[2,this.saveFieldChange(e.name,{prepared:false,value:String(i.target.checked)})]}d.label=3;case 3:{return[2,this.saveFieldChange(e.name,{prepared:false,value:String(i.target.checked)})]}d.label=4;case 4:console.log("Saving dropdown",e.name,i.detail);return[2,this.saveFieldChange(e.name,{prepared:false,value:i.detail})];case 5:if(!i.detail){return[2]}return[4,fetch(i.detail)];case 6:return[4,d.sent().blob()];case 7:s=d.sent();return[2,createInitials(this.endpoint,"initial",s).then((function(i){return __awaiter(c,void 0,void 0,(function(){var t;return __generator(this,(function(n){switch(n.label){case 0:return[4,updateEnvelopeFieldInitials(this.endpoint,this.envelopeId,e.name,i.id)];case 1:t=n.sent();this.updateRecipientFieldValue(e.name,t);return[2]}}))}))}))];case 8:if(!i.detail){return[2]}return[4,fetch(i.detail)];case 9:return[4,d.sent().blob()];case 10:a=d.sent();return[2,createSignature(this.endpoint,"signature",a).then((function(i){return __awaiter(c,void 0,void 0,(function(){var t;return __generator(this,(function(n){switch(n.label){case 0:console.log("Signature update result",i);return[4,updateEnvelopeFieldSignature(this.endpoint,this.envelopeId,e.name,i.id)];case 1:t=n.sent();this.updateRecipientFieldValue(e.name,t);return[2]}}))}))})).catch((function(e){console.warn("[SIGN] Error updating signature",e)}))];case 11:l=i.detail.formattedDate;if(l){return[2,this.saveFieldChange(e.name,{prepared:false,value:l})]}return[3,14];case 12:console.log("[SIGN] Updating timestamp",{value:n,ts:i.target.getAttribute("timestamp")});return[3,14];case 13:console.log("[SIGN] Unhandled field update",{value:n,checked:r},e);return[3,14];case 14:return[2]}}))}))};e.prototype.isFieldFilled=function(e){var i=e.value,t=i===void 0?"":i;switch(e.type){case"textbox":switch(e.validator||""){case"email":return isValidEmail(t);case"phone":return isValidPhone(t);default:return t!==""}case"signature":return t==="signed";case"initial":return t==="initialed";case"timestamp":return true;case"textarea":case"date":return t!=="";case"attachment":return t==="attached";case"dropdown":return t!=="";case"checkbox":return t==="true";case"radio":if(!!e.group){return this.getRecipientFields().filter((function(i){return i.group===e.group})).some((function(e){return e.value==="true"}))}return e.value==="true";default:return false}};e.prototype.isFieldValid=function(e){return!e.required||this.isFieldFilled(e)};e.prototype.getSortedFillableFields=function(){var e=this.getRecipientFields().filter((function(e){return e.type!=="timestamp"}));e.sort((function(e,i){var t=e.x||0;var n=e.y||0;var r=i.x||0;var o=i.y||0;var s=Math.floor(n/5);var a=Math.floor(o/5);return a!==s?a-s:t-r}));return e};e.prototype.handleNext=function(){return __awaiter(this,void 0,void 0,(function(){var e,i,t,n,r,o,s,a,l,c,d;var u=this;return __generator(this,(function(h){switch(h.label){case 0:if(!this.nextSubmits)return[3,5];h.label=1;case 1:h.trys.push([1,3,,4]);(e=document.getElementById("air-datepicker-global-container"))===null||e===void 0?void 0:e.remove();this.submitting=true;return[4,envelopeRecipientSubmit(this.endpoint,this.envelopeId,this.roleId)];case 2:t=h.sent();console.log("[SIGN] Submitted successfully",t);this.recipient.status="submitted";this.showDone=true;this.isDone=true;return[3,4];case 3:n=h.sent();console.log("[SIGN] Error submitting",n);return[3,4];case 4:this.submitting=false;return[2];case 5:r=this.getSortedFillableFields().filter((function(e){return!u.isFieldFilled(e)}));r.sort((function(e,i){var t=e.x||0;var n=e.y||0;var r=i.x||0;var o=i.y||0;var s=Math.floor(n/5);var a=Math.floor(o/5);return a!==s?a-s:t-r}));o=r.findIndex((function(e){return e.name===u.focusedField}));s=o+1;if(s>=r.length){s=0}a=r[s];l=0;if(l<r.length&&["signature","initial"].includes(a.type)&&((i=a.settings)===null||i===void 0?void 0:i.result)==="signed"){l++;s++;if(s>=r.length){s=0}a=r[s]}if(l>=r.length){a=null}if(a){c=getFieldId(a);d=document.getElementById(c);d===null||d===void 0?void 0:d.focusField();d===null||d===void 0?void 0:d.scrollTo({behavior:"smooth",top:0});this.focusedField=a.name}return[2]}}))}))};e.prototype.getRecipientFields=function(){var e=this;return this.envelope.fields.filter((function(i){return i.role_name===e.recipient.role_name}))};e.prototype.checkRecipientFields=function(){var e=this;var i=this.getRecipientFields().filter((function(i){return!e.isFieldValid(i)}));if(i.length<1){this.nextButtonLabel="Finish";if(!this.nextSubmits){this.nextSubmits=true}}else{console.log("[SIGN] Invalid fields remaining",i);this.nextButtonLabel="Next";this.nextSubmits=false}};e.prototype.attachFieldAttributes=function(e,i,t){var n=this;t.addEventListener("input",(function(e){console.log("onInput",e.target.type,e.target.name);if(e.target.type==="radio"||e.target.type==="checkbox"){n.handleFieldChange(i,e).finally((function(){return n.checkRecipientFields()}))}else{n.checkRecipientFields()}}));t.addEventListener("attached",(function(e){return __awaiter(n,void 0,void 0,(function(){var t;return __generator(this,(function(n){switch(n.label){case 0:console.log("[SIGN] onAttached",e.detail,e.target.value);return[4,uploadEnvelopeFieldAttachment(this.endpoint,this.envelopeId,i.name,e.detail)];case 1:t=n.sent();console.log("upload result",t);this.checkRecipientFields();return[2]}}))}))}));t.addEventListener("remove",(function(e){console.log("[SIGN] onRemoved",e.detail,e.target.value);deleteEnvelopeFieldAttachment(n.endpoint,n.envelopeId,i.name).then((function(e){console.log("[SIGN] Deleted attachment",e)})).catch((function(e){return console.log("[SIGN] Error deleting attachment",e)}))}));t.addEventListener("focusout",(function(e){if(i.type!=="dropdown"){n.handleFieldChange(i,e).finally((function(){return n.checkRecipientFields()}))}}));t.addEventListener("fieldChange",(function(e){n.handleFieldChange(i,e).finally((function(){return n.checkRecipientFields()}))}));t.setAttribute("templateid",this.envelope.template_id);t.setAttribute("fieldname",i.name);t.setAttribute("page",e.pageNumber);t.setAttribute("xScale",e.xScale);t.setAttribute("yScale",e.yScale);var r=formatFullName(this.recipient);t.setAttribute("initials",fullNameToInitials(r));t.setAttribute("name",r)};e.prototype.handlePageRendered=function(e){var i=this;var t=e.detail;var n=this.getSortedFillableFields();console.log("Recipient fields",n);n.forEach((function(e,n){if(e.page!==t.pageNumber){return}var r=renderDocumentField(e,t,{disabled:false,editable:false,draggable:false,done:i.isDone},n);if(!r){return}if(Array.isArray(r)){r.map((function(n){return i.attachFieldAttributes(t,e,n)}))}else{i.attachFieldAttributes(t,e,r)}}));this.sortedRecipients.filter((function(e){return e.role_name!==i.recipient.role_name&&(e.status==="invited"||e.status==="opened"||e.status==="pending")})).forEach((function(){i.getRecipientFields().filter((function(e){return e.page===t.pageNumber})).forEach((function(e){var n=renderDocumentField(e,t,{disabled:true,editable:false,draggable:false,done:i.isDone});if(!n){return}if(Array.isArray(n)){n.map((function(n){return i.attachFieldAttributes(t,e,n)}))}else{i.attachFieldAttributes(t,e,n)}}))}));this.checkRecipientFields()};e.prototype.render=function(){var e=this;if(this.showLoadError){return h(Host,null,h("verdocs-ok-dialog",{heading:"Unable to Start Signing",message:"Sorry, your invite code is invalid or has expired. Please check your email for an updated invitation, or contact the sender.",buttonLabel:"OK",onNext:function(){window.location.reload()}}))}if(!this.envelope){return h(Host,null,h("verdocs-loader",null))}if(this.isDone){return h(Host,{class:{agreed:this.agreed}},h("verdocs-view",{endpoint:this.endpoint,envelopeId:this.envelopeId,onSdkError:function(i){var t;return(t=e.sdkError)===null||t===void 0?void 0:t.emit(i.detail)}}),this.errorMessage&&h("verdocs-ok-dialog",{heading:"Network Error",message:this.errorMessage,onNext:function(){return e.errorMessage=""}}),this.showDone&&h("verdocs-ok-dialog",{heading:"You're Done!",message:"You can access the ".concat(this.documentsSingularPlural," at any time by clicking on the link from the invitation email.<br /><br />After all recipients have completed their actions, you will receive an email with the document and envelope certificate attached."),onNext:function(){e.showDone=false;e.isDone=true}}),this.submitting&&h("div",{class:"loading-indicator"},h("verdocs-loader",null)))}return h(Host,{class:{agreed:this.agreed}},h("div",{id:"verdocs-sign-header"},h("div",{class:"inner"},h("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),h("div",{class:"title"},this.envelope.name),h("div",{style:{flex:"1"}}),this.agreed&&!this.finishLater&&h("verdocs-button",{size:"small",label:this.nextButtonLabel,disabled:!this.agreed,onClick:function(){return e.handleNext()}}),h("div",{style:{marginLeft:"10px"}}),this.agreed&&h("verdocs-dropdown",{options:!this.isDone&&!this.finishLater?inProgressMenuOptions:doneMenuOptions,onOptionSelected:function(i){return e.handleOptionSelected(i)}}))),this.agreed?h("div",{class:"document",style:{paddingTop:"15px"}},(this.envelope.documents||[]).map((function(i){var t=integerSequence(1,i.pages);return h(Fragment,null,t.map((function(t){return h("verdocs-envelope-document-page",{envelopeId:e.envelopeId,documentId:i.id,endpoint:e.endpoint,virtualWidth:612,virtualHeight:792,pageNumber:t,onPageRendered:function(i){return e.handlePageRendered(i)},type:"filled",layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})})))}))):h("div",{class:"document",style:{paddingTop:"15px"}},h("img",{src:"https://public-assets.verdocs.com/loading-placeholder.png",style:{width:"612px",height:"792px",boxShadow:"0 0 10px 5px #0000000f",marginTop:"15px"},alt:"Placeholder page"})),this.showFinishLater&&h("verdocs-ok-dialog",{heading:"You've saved your document to finish later.",message:"To complete the ".concat(this.documentsSingularPlural,", use the link in the original email notification inviting you to review and finish the document."),onNext:function(){return e.showFinishLater=false}}),this.errorMessage&&h("verdocs-ok-dialog",{heading:"Network Error",message:this.errorMessage,onNext:function(){return e.errorMessage=""}}),this.showDone&&h("verdocs-ok-dialog",{heading:"You're Done!",message:"You can access the ".concat(this.documentsSingularPlural," at any time by clicking on the link from the invitation email.<br /><br />After all recipients have completed their actions, you will receive an email with the document and envelope certificate attached."),onNext:function(){e.showDone=false;e.isDone=true}}),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:function(){return e.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"),".")))))};return e}();VerdocsSign.style=VerdocsSignStyle0;export{VerdocsSign as verdocs_sign};
|